From 0294a182a1629b1d854b84906e73487d6cb75fba Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 30 Apr 2011 10:55:14 +0000 Subject: [PATCH 1/4] Import a stock copy of ncurses 5.8 into the vendor space. It seems both local changes we made to 5.7 have already been fixed upstream properly, so there is no need to preserve the changes. Also, with SVN we import full source trees. Unlike CVS, where we removed unneeded cruft. --- ANNOUNCE | 590 +- Ada95/Makefile.in | 81 + Ada95/README | 33 + Ada95/TODO | 55 + Ada95/aclocal.m4 | 3458 ++++ Ada95/configure | 12189 ++++++++++++ Ada95/configure.in | 626 + Ada95/gen/Makefile.in | 449 + Ada95/gen/adacurses-config.in | 79 + Ada95/gen/gen.c | 1537 ++ Ada95/gen/html.m4 | 40 + Ada95/gen/normal.m4 | 37 + Ada95/gen/table.m4 | 35 + .../gen/terminal_interface-curses-aux.ads.m4 | 105 + ..._interface-curses-forms-field_types.ads.m4 | 238 + ...erface-curses-forms-field_user_data.ads.m4 | 70 + ...terface-curses-forms-form_user_data.ads.m4 | 70 + .../terminal_interface-curses-forms.ads.m4 | 699 + ...terface-curses-menus-item_user_data.ads.m4 | 75 + ...terface-curses-menus-menu_user_data.ads.m4 | 70 + .../terminal_interface-curses-menus.ads.m4 | 604 + .../terminal_interface-curses-mouse.ads.m4 | 182 + ...l_interface-curses-panels-user_data.ads.m4 | 70 + .../terminal_interface-curses-panels.ads.m4 | 147 + .../terminal_interface-curses-trace.ads.m4 | 78 + Ada95/gen/terminal_interface-curses.adb.m4 | 2502 +++ Ada95/gen/terminal_interface-curses.ads.m4 | 1559 ++ Ada95/include/MKncurses_def.sh | 80 + Ada95/include/Makefile.in | 90 + Ada95/include/ncurses_cfg.hin | 72 + Ada95/include/ncurses_defs | 207 + Ada95/make-tar.sh | 90 + Ada95/mk-1st.awk | 90 + Ada95/samples/Makefile.in | 133 + Ada95/samples/README | 35 + Ada95/samples/explain.txt | 186 + Ada95/samples/ncurses.adb | 47 + Ada95/samples/ncurses2-acs_and_scroll.adb | 714 + Ada95/samples/ncurses2-acs_and_scroll.ads | 41 + Ada95/samples/ncurses2-acs_display.adb | 235 + Ada95/samples/ncurses2-acs_display.ads | 41 + Ada95/samples/ncurses2-attr_test.adb | 362 + Ada95/samples/ncurses2-attr_test.ads | 42 + Ada95/samples/ncurses2-color_edit.adb | 259 + Ada95/samples/ncurses2-color_edit.ads | 41 + Ada95/samples/ncurses2-color_test.adb | 163 + Ada95/samples/ncurses2-color_test.ads | 41 + Ada95/samples/ncurses2-demo_forms.adb | 497 + Ada95/samples/ncurses2-demo_forms.ads | 41 + Ada95/samples/ncurses2-demo_pad.adb | 675 + Ada95/samples/ncurses2-demo_pad.ads | 41 + Ada95/samples/ncurses2-demo_panels.adb | 382 + Ada95/samples/ncurses2-demo_panels.ads | 41 + Ada95/samples/ncurses2-flushinp_test.adb | 135 + Ada95/samples/ncurses2-flushinp_test.ads | 43 + Ada95/samples/ncurses2-genericputs.adb | 117 + Ada95/samples/ncurses2-genericputs.ads | 72 + Ada95/samples/ncurses2-getch.ads | 41 + Ada95/samples/ncurses2-getch_test.adb | 254 + Ada95/samples/ncurses2-getch_test.ads | 41 + Ada95/samples/ncurses2-getopt.adb | 163 + Ada95/samples/ncurses2-getopt.ads | 60 + Ada95/samples/ncurses2-m.adb | 448 + Ada95/samples/ncurses2-m.ads | 43 + Ada95/samples/ncurses2-menu_test.adb | 168 + Ada95/samples/ncurses2-menu_test.ads | 41 + Ada95/samples/ncurses2-overlap_test.adb | 157 + Ada95/samples/ncurses2-overlap_test.ads | 41 + Ada95/samples/ncurses2-slk_test.adb | 174 + Ada95/samples/ncurses2-slk_test.ads | 41 + .../samples/ncurses2-test_sgr_attributes.adb | 185 + .../samples/ncurses2-test_sgr_attributes.ads | 41 + Ada95/samples/ncurses2-trace_set.adb | 480 + Ada95/samples/ncurses2-trace_set.ads | 41 + Ada95/samples/ncurses2-util.adb | 190 + Ada95/samples/ncurses2-util.ads | 76 + Ada95/samples/ncurses2.ads | 44 + Ada95/samples/rain.adb | 179 + Ada95/samples/rain.ads | 43 + .../samples/sample-curses_demo-attributes.adb | 122 + .../samples/sample-curses_demo-attributes.ads | 45 + Ada95/samples/sample-curses_demo-mouse.adb | 220 + Ada95/samples/sample-curses_demo-mouse.ads | 45 + Ada95/samples/sample-curses_demo.adb | 143 + Ada95/samples/sample-curses_demo.ads | 45 + Ada95/samples/sample-explanation.adb | 408 + Ada95/samples/sample-explanation.ads | 59 + Ada95/samples/sample-form_demo-aux.adb | 263 + Ada95/samples/sample-form_demo-aux.ads | 92 + Ada95/samples/sample-form_demo-handler.adb | 98 + Ada95/samples/sample-form_demo-handler.ads | 64 + Ada95/samples/sample-form_demo.adb | 130 + Ada95/samples/sample-form_demo.ads | 45 + Ada95/samples/sample-function_key_setting.adb | 214 + Ada95/samples/sample-function_key_setting.ads | 82 + Ada95/samples/sample-header_handler.adb | 180 + Ada95/samples/sample-header_handler.ads | 53 + Ada95/samples/sample-helpers.adb | 68 + Ada95/samples/sample-helpers.ads | 54 + Ada95/samples/sample-keyboard_handler.adb | 194 + Ada95/samples/sample-keyboard_handler.ads | 55 + Ada95/samples/sample-manifest.ads | 67 + Ada95/samples/sample-menu_demo-aux.adb | 204 + Ada95/samples/sample-menu_demo-aux.ads | 71 + Ada95/samples/sample-menu_demo-handler.adb | 108 + Ada95/samples/sample-menu_demo-handler.ads | 64 + Ada95/samples/sample-menu_demo.adb | 396 + Ada95/samples/sample-menu_demo.ads | 45 + Ada95/samples/sample-my_field_type.adb | 68 + Ada95/samples/sample-my_field_type.ads | 61 + Ada95/samples/sample-text_io_demo.adb | 181 + Ada95/samples/sample-text_io_demo.ads | 45 + Ada95/samples/sample.adb | 220 + Ada95/samples/sample.ads | 43 + Ada95/samples/status.adb | 57 + Ada95/samples/status.ads | 60 + Ada95/samples/tour.adb | 46 + Ada95/samples/tour.ads | 41 + Ada95/src/Makefile.in | 304 + Ada95/src/library.gpr | 55 + Ada95/src/modules | 70 + Ada95/src/terminal_interface-curses-aux.adb | 116 + ...terface-curses-forms-field_types-alpha.adb | 66 + ...terface-curses-forms-field_types-alpha.ads | 53 + ...-curses-forms-field_types-alphanumeric.adb | 66 + ...-curses-forms-field_types-alphanumeric.ads | 54 + ...rses-forms-field_types-enumeration-ada.adb | 81 + ...rses-forms-field_types-enumeration-ada.ads | 59 + ...e-curses-forms-field_types-enumeration.adb | 119 + ...e-curses-forms-field_types-enumeration.ads | 98 + ...face-curses-forms-field_types-intfield.adb | 70 + ...face-curses-forms-field_types-intfield.ads | 55 + ...-curses-forms-field_types-ipv4_address.adb | 66 + ...-curses-forms-field_types-ipv4_address.ads | 51 + ...rface-curses-forms-field_types-numeric.adb | 73 + ...rface-curses-forms-field_types-numeric.ads | 55 + ...erface-curses-forms-field_types-regexp.adb | 71 + ...erface-curses-forms-field_types-regexp.ads | 55 + ...e-curses-forms-field_types-user-choice.adb | 110 + ...e-curses-forms-field_types-user-choice.ads | 94 + ...nterface-curses-forms-field_types-user.adb | 133 + ...nterface-curses-forms-field_types-user.ads | 95 + ...nal_interface-curses-forms-field_types.adb | 296 + ...interface-curses-forms-field_user_data.adb | 85 + ..._interface-curses-forms-form_user_data.adb | 86 + Ada95/src/terminal_interface-curses-forms.adb | 1161 ++ ..._interface-curses-menus-item_user_data.adb | 77 + ..._interface-curses-menus-menu_user_data.adb | 76 + Ada95/src/terminal_interface-curses-menus.adb | 1022 + Ada95/src/terminal_interface-curses-mouse.adb | 217 + ...inal_interface-curses-panels-user_data.adb | 78 + .../src/terminal_interface-curses-panels.adb | 165 + .../src/terminal_interface-curses-putwin.adb | 77 + .../src/terminal_interface-curses-putwin.ads | 50 + .../src/terminal_interface-curses-termcap.adb | 163 + .../src/terminal_interface-curses-termcap.ads | 80 + .../terminal_interface-curses-terminfo.adb | 161 + .../terminal_interface-curses-terminfo.ads | 81 + .../terminal_interface-curses-text_io-aux.adb | 128 + .../terminal_interface-curses-text_io-aux.ads | 55 + ...al_interface-curses-text_io-complex_io.adb | 73 + ...al_interface-curses-text_io-complex_io.ads | 70 + ...al_interface-curses-text_io-decimal_io.adb | 75 + ...al_interface-curses-text_io-decimal_io.ads | 66 + ...nterface-curses-text_io-enumeration_io.adb | 80 + ...nterface-curses-text_io-enumeration_io.ads | 63 + ...inal_interface-curses-text_io-fixed_io.adb | 75 + ...inal_interface-curses-text_io-fixed_io.ads | 66 + ...inal_interface-curses-text_io-float_io.adb | 76 + ...inal_interface-curses-text_io-float_io.ads | 66 + ...al_interface-curses-text_io-integer_io.adb | 70 + ...al_interface-curses-text_io-integer_io.ads | 63 + ...al_interface-curses-text_io-modular_io.adb | 70 + ...al_interface-curses-text_io-modular_io.ads | 63 + .../src/terminal_interface-curses-text_io.adb | 337 + .../src/terminal_interface-curses-text_io.ads | 136 + .../src/terminal_interface-curses-trace.adb_p | 97 + Ada95/src/terminal_interface.ads | 47 + INSTALL | 194 +- MANIFEST | 65 +- Makefile.in | 15 +- NEWS | 994 +- README.MinGW | 149 + TO-DO | 57 +- aclocal.m4 | 1690 +- announce.html.in | 1419 +- c++/Makefile.in | 248 + c++/NEWS | 71 + c++/PROBLEMS | 34 + c++/README-first | 80 + c++/cursesapp.cc | 164 + c++/cursesapp.h | 176 + c++/cursesf.cc | 454 + c++/cursesf.h | 967 + c++/cursesm.cc | 407 + c++/cursesm.h | 672 + c++/cursesmain.cc | 93 + c++/cursesp.cc | 138 + c++/cursesp.h | 268 + c++/cursespad.cc | 279 + c++/cursesw.cc | 468 + c++/cursesw.h | 1556 ++ c++/cursslk.cc | 132 + c++/cursslk.h | 238 + c++/demo.cc | 569 + tar-copy.sh => c++/edit_cfg.sh | 80 +- c++/etip.h.in | 378 + c++/headers | 40 + c++/internal.h | 65 + c++/modules | 45 + config.guess | 370 +- config.sub | 166 +- configure | 6797 ++++--- configure.in | 435 +- dist.mk | 11 +- doc/html/Ada95.html | 184 + doc/html/ada/files.htm | 6 + doc/html/ada/files/T.htm | 78 + doc/html/ada/funcs.htm | 27 + doc/html/ada/funcs/A.htm | 24 + doc/html/ada/funcs/B.htm | 21 + doc/html/ada/funcs/C.htm | 56 + doc/html/ada/funcs/D.htm | 47 + doc/html/ada/funcs/E.htm | 18 + doc/html/ada/funcs/F.htm | 55 + doc/html/ada/funcs/G.htm | 96 + doc/html/ada/funcs/H.htm | 22 + doc/html/ada/funcs/I.htm | 51 + doc/html/ada/funcs/K.htm | 14 + doc/html/ada/funcs/L.htm | 20 + doc/html/ada/funcs/M.htm | 51 + doc/html/ada/funcs/N.htm | 35 + doc/html/ada/funcs/O.htm | 12 + doc/html/ada/funcs/P.htm | 59 + doc/html/ada/funcs/Q.htm | 8 + doc/html/ada/funcs/R.htm | 39 + doc/html/ada/funcs/S.htm | 191 + doc/html/ada/funcs/T.htm | 38 + doc/html/ada/funcs/U.htm | 23 + doc/html/ada/funcs/V.htm | 11 + doc/html/ada/funcs/W.htm | 53 + doc/html/ada/index.htm | 39 + doc/html/ada/main.htm | 69 + doc/html/ada/table.html | 341 + .../terminal_interface-curses-aux__adb.htm | 122 + .../terminal_interface-curses-aux__ads.htm | 130 + ...ce-curses-forms-field_types-alpha__adb.htm | 72 + ...ce-curses-forms-field_types-alpha__ads.htm | 59 + ...es-forms-field_types-alphanumeric__adb.htm | 72 + ...es-forms-field_types-alphanumeric__ads.htm | 60 + ...forms-field_types-enumeration-ada__adb.htm | 87 + ...forms-field_types-enumeration-ada__ads.htm | 65 + ...ses-forms-field_types-enumeration__adb.htm | 125 + ...ses-forms-field_types-enumeration__ads.htm | 104 + ...curses-forms-field_types-intfield__adb.htm | 76 + ...curses-forms-field_types-intfield__ads.htm | 61 + ...es-forms-field_types-ipv4_address__adb.htm | 72 + ...es-forms-field_types-ipv4_address__ads.htm | 57 + ...-curses-forms-field_types-numeric__adb.htm | 79 + ...-curses-forms-field_types-numeric__ads.htm | 61 + ...e-curses-forms-field_types-regexp__adb.htm | 77 + ...e-curses-forms-field_types-regexp__ads.htm | 61 + ...ses-forms-field_types-user-choice__adb.htm | 116 + ...ses-forms-field_types-user-choice__ads.htm | 100 + ...ace-curses-forms-field_types-user__adb.htm | 139 + ...ace-curses-forms-field_types-user__ads.htm | 101 + ...nterface-curses-forms-field_types__adb.htm | 302 + ...nterface-curses-forms-field_types__ads.htm | 245 + ...face-curses-forms-field_user_data__adb.htm | 91 + ...face-curses-forms-field_user_data__ads.htm | 75 + ...rface-curses-forms-form_user_data__adb.htm | 92 + ...rface-curses-forms-form_user_data__ads.htm | 75 + .../terminal_interface-curses-forms__adb.htm | 1167 ++ .../terminal_interface-curses-forms__ads.htm | 786 + ...rface-curses-menus-item_user_data__adb.htm | 83 + ...rface-curses-menus-item_user_data__ads.htm | 80 + ...rface-curses-menus-menu_user_data__adb.htm | 82 + ...rface-curses-menus-menu_user_data__ads.htm | 75 + .../terminal_interface-curses-menus__adb.htm | 1028 + .../terminal_interface-curses-menus__ads.htm | 681 + .../terminal_interface-curses-mouse__adb.htm | 223 + .../terminal_interface-curses-mouse__ads.htm | 235 + ...interface-curses-panels-user_data__adb.htm | 84 + ...interface-curses-panels-user_data__ads.htm | 75 + .../terminal_interface-curses-panels__adb.htm | 171 + .../terminal_interface-curses-panels__ads.htm | 153 + .../terminal_interface-curses-putwin__adb.htm | 83 + .../terminal_interface-curses-putwin__ads.htm | 56 + ...terminal_interface-curses-termcap__adb.htm | 169 + ...terminal_interface-curses-termcap__ads.htm | 86 + ...erminal_interface-curses-terminfo__adb.htm | 167 + ...erminal_interface-curses-terminfo__ads.htm | 87 + ...inal_interface-curses-text_io-aux__adb.htm | 134 + ...inal_interface-curses-text_io-aux__ads.htm | 61 + ...terface-curses-text_io-complex_io__adb.htm | 79 + ...terface-curses-text_io-complex_io__ads.htm | 76 + ...terface-curses-text_io-decimal_io__adb.htm | 81 + ...terface-curses-text_io-decimal_io__ads.htm | 72 + ...ace-curses-text_io-enumeration_io__adb.htm | 86 + ...ace-curses-text_io-enumeration_io__ads.htm | 69 + ...interface-curses-text_io-fixed_io__adb.htm | 81 + ...interface-curses-text_io-fixed_io__ads.htm | 72 + ...interface-curses-text_io-float_io__adb.htm | 82 + ...interface-curses-text_io-float_io__ads.htm | 72 + ...terface-curses-text_io-integer_io__adb.htm | 76 + ...terface-curses-text_io-integer_io__ads.htm | 69 + ...terface-curses-text_io-modular_io__adb.htm | 76 + ...terface-curses-text_io-modular_io__ads.htm | 69 + ...terminal_interface-curses-text_io__adb.htm | 343 + ...terminal_interface-curses-text_io__ads.htm | 142 + .../terminal_interface-curses-trace__adb.htm | 83 + .../terminal_interface-curses-trace__ads.htm | 118 + .../ada/terminal_interface-curses__adb.htm | 2562 +++ .../ada/terminal_interface-curses__ads.htm | 1935 ++ doc/html/ada/terminal_interface__ads.htm | 53 + doc/html/announce.html | 1419 +- doc/html/hackguide.html | 6 +- doc/html/index.html | 51 + doc/html/man/adacurses-config.1.html | 96 + doc/html/man/captoinfo.1m.html | 229 + doc/html/man/clear.1.html | 84 + doc/html/man/curs_add_wch.3x.html | 232 + doc/html/man/curs_add_wchstr.3x.html | 131 + doc/html/man/curs_addch.3x.html | 220 + doc/html/man/curs_addchstr.3x.html | 133 + doc/html/man/curs_addstr.3x.html | 125 + doc/html/man/curs_addwstr.3x.html | 124 + doc/html/man/curs_attr.3x.html | 267 + doc/html/man/curs_beep.3x.html | 106 + doc/html/man/curs_bkgd.3x.html | 131 + doc/html/man/curs_bkgrnd.3x.html | 128 + doc/html/man/curs_border.3x.html | 162 + doc/html/man/curs_border_set.3x.html | 184 + doc/html/man/curs_clear.3x.html | 146 + doc/html/man/curs_color.3x.html | 285 + doc/html/man/curs_delch.3x.html | 112 + doc/html/man/curs_deleteln.3x.html | 126 + doc/html/man/curs_extend.3x.html | 111 + doc/html/man/curs_get_wch.3x.html | 155 + doc/html/man/curs_get_wstr.3x.html | 166 + doc/html/man/curs_getcchar.3x.html | 158 + doc/html/man/curs_getch.3x.html | 359 + doc/html/man/curs_getstr.3x.html | 155 + doc/html/man/curs_getyx.3x.html | 131 + doc/html/man/curs_in_wch.3x.html | 109 + doc/html/man/curs_in_wchstr.3x.html | 124 + doc/html/man/curs_inch.3x.html | 118 + doc/html/man/curs_inchstr.3x.html | 133 + doc/html/man/curs_initscr.3x.html | 167 + doc/html/man/curs_inopts.3x.html | 261 + doc/html/man/curs_ins_wch.3x.html | 104 + doc/html/man/curs_ins_wstr.3x.html | 129 + doc/html/man/curs_insch.3x.html | 117 + doc/html/man/curs_insstr.3x.html | 131 + doc/html/man/curs_instr.3x.html | 123 + doc/html/man/curs_inwstr.3x.html | 115 + doc/html/man/curs_kernel.3x.html | 206 + doc/html/man/curs_legacy.3x.html | 121 + doc/html/man/curs_memleaks.3x.html | 111 + doc/html/man/curs_mouse.3x.html | 318 + doc/html/man/curs_move.3x.html | 105 + doc/html/man/curs_opaque.3x.html | 161 + doc/html/man/curs_outopts.3x.html | 234 + doc/html/man/curs_overlay.3x.html | 122 + doc/html/man/curs_pad.3x.html | 184 + doc/html/man/curs_print.3x.html | 121 + doc/html/man/curs_printw.3x.html | 126 + doc/html/man/curs_refresh.3x.html | 170 + doc/html/man/curs_scanw.3x.html | 133 + doc/html/man/curs_scr_dump.3x.html | 137 + doc/html/man/curs_scroll.3x.html | 131 + doc/html/man/curs_slk.3x.html | 235 + doc/html/man/curs_sp_funcs.3x.html | 285 + doc/html/man/curs_termattrs.3x.html | 161 + doc/html/man/curs_termcap.3x.html | 191 + doc/html/man/curs_terminfo.3x.html | 363 + doc/html/man/curs_threads.3x.html | 634 + doc/html/man/curs_touch.3x.html | 144 + doc/html/man/curs_trace.3x.html | 186 + doc/html/man/curs_util.3x.html | 266 + doc/html/man/curs_variables.3x.html | 164 + doc/html/man/curs_window.3x.html | 216 + doc/html/man/default_colors.3x.html | 180 + doc/html/man/define_key.3x.html | 111 + doc/html/man/form.3x.html | 258 + doc/html/man/form_cursor.3x.html | 118 + doc/html/man/form_data.3x.html | 104 + doc/html/man/form_driver.3x.html | 375 + doc/html/man/form_field.3x.html | 142 + doc/html/man/form_field_attributes.3x.html | 130 + doc/html/man/form_field_buffer.3x.html | 179 + doc/html/man/form_field_info.3x.html | 129 + doc/html/man/form_field_just.3x.html | 119 + doc/html/man/form_field_new.3x.html | 150 + doc/html/man/form_field_opts.3x.html | 168 + doc/html/man/form_field_userptr.3x.html | 112 + doc/html/man/form_field_validation.3x.html | 195 + doc/html/man/form_fieldtype.3x.html | 190 + doc/html/man/form_hook.3x.html | 138 + doc/html/man/form_new.3x.html | 132 + doc/html/man/form_new_page.3x.html | 119 + doc/html/man/form_opts.3x.html | 134 + doc/html/man/form_page.3x.html | 139 + doc/html/man/form_post.3x.html | 136 + doc/html/man/form_requestname.3x.html | 112 + doc/html/man/form_userptr.3x.html | 112 + doc/html/man/form_variables.3x.html | 118 + doc/html/man/form_win.3x.html | 139 + doc/html/man/index.html | 67 + doc/html/man/infocmp.1m.html | 444 + doc/html/man/infotocap.1m.html | 115 + doc/html/man/key_defined.3x.html | 103 + doc/html/man/keybound.3x.html | 105 + doc/html/man/keyok.3x.html | 105 + doc/html/man/legacy_coding.3x.html | 118 + doc/html/man/menu.3x.html | 241 + doc/html/man/menu_attributes.3x.html | 139 + doc/html/man/menu_cursor.3x.html | 117 + doc/html/man/menu_driver.3x.html | 255 + doc/html/man/menu_format.3x.html | 133 + doc/html/man/menu_hook.3x.html | 138 + doc/html/man/menu_items.3x.html | 138 + doc/html/man/menu_mark.3x.html | 131 + doc/html/man/menu_new.3x.html | 129 + doc/html/man/menu_opts.3x.html | 148 + doc/html/man/menu_pattern.3x.html | 138 + doc/html/man/menu_post.3x.html | 138 + doc/html/man/menu_requestname.3x.html | 112 + doc/html/man/menu_spacing.3x.html | 129 + doc/html/man/menu_userptr.3x.html | 112 + doc/html/man/menu_win.3x.html | 139 + doc/html/man/mitem_current.3x.html | 146 + doc/html/man/mitem_name.3x.html | 107 + doc/html/man/mitem_new.3x.html | 134 + doc/html/man/mitem_opts.3x.html | 126 + doc/html/man/mitem_userptr.3x.html | 112 + doc/html/man/mitem_value.3x.html | 117 + doc/html/man/mitem_visible.3x.html | 100 + doc/html/man/ncurses.3x.html | 1267 ++ doc/html/man/ncurses5-config.1.html | 133 + doc/html/man/panel.3x.html | 241 + doc/html/man/resizeterm.3x.html | 141 + doc/html/man/tabs.1.html | 171 + doc/html/man/term.5.html | 308 + doc/html/man/term.7.html | 251 + doc/html/man/term_variables.3x.html | 165 + doc/html/man/terminfo.5.html | 2375 +++ doc/html/man/tic.1m.html | 330 + doc/html/man/toe.1m.html | 126 + doc/html/man/tput.1.html | 343 + doc/html/man/tset.1.html | 334 + doc/html/man/wresize.3x.html | 108 + doc/html/ncurses-intro.html | 6 +- form/Makefile.in | 19 +- form/f_trace.c | 12 +- form/fld_arg.c | 8 +- form/fld_attr.c | 6 +- form/fld_current.c | 10 +- form/fld_def.c | 10 +- form/fld_dup.c | 8 +- form/fld_ftchoice.c | 11 +- form/fld_ftlink.c | 8 +- form/fld_info.c | 18 +- form/fld_just.c | 8 +- form/fld_link.c | 8 +- form/fld_max.c | 6 +- form/fld_move.c | 6 +- form/fld_newftyp.c | 28 +- form/fld_opts.c | 12 +- form/fld_pad.c | 8 +- form/fld_page.c | 8 +- form/fld_stat.c | 8 +- form/fld_type.c | 8 +- form/fld_user.c | 8 +- form/form.h | 81 +- form/form.priv.h | 61 +- form/frm_cursor.c | 6 +- form/frm_data.c | 8 +- form/frm_def.c | 67 +- form/frm_driver.c | 350 +- form/frm_hook.c | 6 +- form/frm_opts.c | 12 +- form/frm_page.c | 8 +- form/frm_post.c | 8 +- form/frm_req_name.c | 8 +- form/frm_scale.c | 9 +- form/frm_sub.c | 23 +- form/frm_user.c | 8 +- form/frm_win.c | 29 +- form/fty_alnum.c | 65 +- form/fty_alpha.c | 65 +- form/fty_enum.c | 160 +- form/fty_generic.c | 297 + form/fty_int.c | 79 +- form/fty_ipv4.c | 25 +- form/fty_num.c | 91 +- form/fty_regex.c | 228 +- form/llib-lform | 51 +- form/llib-lformt | 777 + form/llib-lformtw | 783 + form/llib-lformw | 51 +- form/modules | 86 +- include/Caps | 10 +- include/Caps.aix4 | 10 +- include/Caps.hpux11 | 10 +- include/Caps.keys | 10 +- include/Caps.osf1r5 | 10 +- include/Caps.uwin | 10 +- include/MKterm.h.awk.in | 56 +- include/Makefile.in | 20 +- include/capdefaults.c | 6 +- include/curses.h.in | 270 +- include/curses.tail | 32 +- include/curses.wide | 68 +- include/headers | 6 +- include/nc_alloc.h | 18 +- include/nc_mingw.h | 69 + include/nc_panel.h | 35 +- include/nc_tparm.h | 12 +- include/ncurses_defs | 10 +- include/{ncurses_dll.h => ncurses_dll.h.in} | 20 +- include/ncurses_mingw.h | 164 + include/term_entry.h | 12 +- include/tic.h | 28 +- include/unctrl.h.in | 8 +- man/MKada_config.in | 56 + man/MKncu_config.in | 98 + man/Makefile.in | 11 +- man/captoinfo.1m | 59 +- man/clear.1 | 12 +- man/curs_add_wch.3x | 129 +- man/curs_add_wchstr.3x | 16 +- man/curs_addch.3x | 34 +- man/curs_addchstr.3x | 18 +- man/curs_addstr.3x | 18 +- man/curs_addwstr.3x | 16 +- man/curs_attr.3x | 24 +- man/curs_beep.3x | 12 +- man/curs_bkgd.3x | 14 +- man/curs_bkgrnd.3x | 10 +- man/curs_border.3x | 32 +- man/curs_border_set.3x | 31 +- man/curs_clear.3x | 17 +- man/curs_color.3x | 51 +- man/curs_delch.3x | 16 +- man/curs_deleteln.3x | 12 +- man/curs_extend.3x | 12 +- man/curs_get_wch.3x | 8 +- man/curs_get_wstr.3x | 14 +- man/curs_getcchar.3x | 45 +- man/curs_getch.3x | 34 +- man/curs_getstr.3x | 20 +- man/curs_getyx.3x | 14 +- man/curs_in_wch.3x | 16 +- man/curs_in_wchstr.3x | 14 +- man/curs_inch.3x | 20 +- man/curs_inchstr.3x | 18 +- man/curs_initscr.3x | 20 +- man/curs_inopts.3x | 14 +- man/curs_ins_wch.3x | 14 +- man/curs_ins_wstr.3x | 14 +- man/curs_insch.3x | 16 +- man/curs_insstr.3x | 16 +- man/curs_instr.3x | 16 +- man/curs_inwstr.3x | 14 +- man/curs_kernel.3x | 29 +- man/curs_legacy.3x | 21 +- man/curs_memleaks.3x | 14 +- man/curs_mouse.3x | 29 +- man/curs_move.3x | 12 +- man/curs_opaque.3x | 28 +- man/curs_outopts.3x | 26 +- man/curs_overlay.3x | 12 +- man/curs_pad.3x | 19 +- man/curs_print.3x | 12 +- man/curs_printw.3x | 16 +- man/curs_refresh.3x | 16 +- man/curs_scanw.3x | 16 +- man/curs_scr_dump.3x | 12 +- man/curs_scroll.3x | 12 +- man/curs_slk.3x | 111 +- man/curs_sp_funcs.3x | 353 + man/curs_termattrs.3x | 12 +- man/curs_termcap.3x | 29 +- man/curs_terminfo.3x | 41 +- man/curs_threads.3x | 40 +- man/curs_touch.3x | 16 +- man/curs_trace.3x | 37 +- man/curs_util.3x | 59 +- man/curs_variables.3x | 135 + man/curs_window.3x | 21 +- man/default_colors.3x | 22 +- man/define_key.3x | 16 +- man/form.3x | 16 +- man/form_cursor.3x | 12 +- man/form_data.3x | 12 +- man/form_driver.3x | 44 +- man/form_field.3x | 14 +- man/form_field_attributes.3x | 12 +- man/form_field_buffer.3x | 40 +- man/form_field_info.3x | 12 +- man/form_field_just.3x | 12 +- man/form_field_new.3x | 12 +- man/form_field_opts.3x | 13 +- man/form_field_userptr.3x | 12 +- man/form_field_validation.3x | 26 +- man/form_fieldtype.3x | 12 +- man/form_hook.3x | 12 +- man/form_new.3x | 12 +- man/form_new_page.3x | 12 +- man/form_opts.3x | 12 +- man/form_page.3x | 12 +- man/form_post.3x | 12 +- man/form_requestname.3x | 12 +- man/form_userptr.3x | 12 +- man/form_variables.3x | 82 + man/form_win.3x | 16 +- man/infocmp.1m | 182 +- man/infotocap.1m | 45 +- man/key_defined.3x | 12 +- man/keybound.3x | 10 +- man/keyok.3x | 12 +- man/legacy_coding.3x | 10 +- man/man_db.renames | 20 +- man/menu.3x | 16 +- man/menu_attributes.3x | 12 +- man/menu_cursor.3x | 12 +- man/menu_driver.3x | 55 +- man/menu_format.3x | 12 +- man/menu_hook.3x | 12 +- man/menu_items.3x | 14 +- man/menu_mark.3x | 14 +- man/menu_new.3x | 12 +- man/menu_opts.3x | 12 +- man/menu_pattern.3x | 12 +- man/menu_post.3x | 12 +- man/menu_requestname.3x | 12 +- man/menu_spacing.3x | 52 +- man/menu_userptr.3x | 12 +- man/menu_win.3x | 16 +- man/mitem_current.3x | 14 +- man/mitem_name.3x | 12 +- man/mitem_new.3x | 12 +- man/mitem_opts.3x | 12 +- man/mitem_userptr.3x | 12 +- man/mitem_value.3x | 12 +- man/mitem_visible.3x | 12 +- man/ncurses.3x | 130 +- man/panel.3x | 19 +- man/resizeterm.3x | 13 +- man/tabs.1 | 141 + man/term.5 | 22 +- man/term.7 | 62 +- man/term_variables.3x | 153 + man/terminfo.head | 34 +- man/terminfo.tail | 103 +- man/tic.1m | 180 +- man/toe.1m | 26 +- man/tput.1 | 56 +- man/tset.1 | 95 +- man/wresize.3x | 17 +- menu/Makefile.in | 19 +- menu/llib-lmenu | 12 +- menu/llib-lmenut | 551 + menu/llib-lmenutw | 553 + menu/llib-lmenuw | 12 +- menu/m_attribs.c | 11 +- menu/m_cursor.c | 8 +- menu/m_driver.c | 11 +- menu/m_format.c | 6 +- menu/m_global.c | 14 +- menu/m_hook.c | 6 +- menu/m_item_cur.c | 10 +- menu/m_item_nam.c | 8 +- menu/m_item_new.c | 15 +- menu/m_item_opt.c | 12 +- menu/m_item_top.c | 8 +- menu/m_item_use.c | 8 +- menu/m_item_val.c | 8 +- menu/m_item_vis.c | 6 +- menu/m_items.c | 10 +- menu/m_new.c | 84 +- menu/m_opts.c | 12 +- menu/m_pad.c | 12 +- menu/m_pattern.c | 8 +- menu/m_post.c | 14 +- menu/m_req_name.c | 6 +- menu/m_scale.c | 9 +- menu/m_spacing.c | 13 +- menu/m_sub.c | 28 +- menu/m_trace.c | 10 +- menu/m_userptr.c | 8 +- menu/m_win.c | 30 +- menu/menu.h | 8 +- menu/menu.priv.h | 10 +- menu/modules | 58 +- misc/Makefile.in | 38 +- misc/gen-pkgconfig.in | 139 + misc/jpf-indent | 119 - misc/ncu-indent | 132 - misc/ncurses-config.in | 59 +- misc/run_tic.in | 90 +- misc/terminfo.src | 1084 +- mk-0th.awk | 16 +- mk-1st.awk | 39 +- mk-dlls.sh.in | 114 + mk-hdr.awk | 6 +- mkdirs.sh | 51 - ncurses/Makefile.in | 54 +- ncurses/README | 23 +- ncurses/base/MKkeyname.awk | 21 +- ncurses/base/MKlib_gen.sh | 75 +- ncurses/base/MKunctrl.awk | 26 +- ncurses/base/define_key.c | 39 +- ncurses/base/key_defined.c | 20 +- ncurses/base/keybound.c | 23 +- ncurses/base/keyok.c | 39 +- ncurses/base/legacy_coding.c | 25 +- ncurses/base/lib_addch.c | 80 +- ncurses/base/lib_addstr.c | 19 +- ncurses/base/lib_beep.c | 27 +- ncurses/base/lib_bkgd.c | 16 +- ncurses/base/lib_box.c | 9 +- ncurses/base/lib_chgat.c | 8 +- ncurses/base/lib_clear.c | 6 +- ncurses/base/lib_clearok.c | 6 +- ncurses/base/lib_clrbot.c | 6 +- ncurses/base/lib_clreol.c | 6 +- ncurses/base/lib_color.c | 566 +- ncurses/base/lib_colorset.c | 19 +- ncurses/base/lib_delch.c | 6 +- ncurses/base/lib_delwin.c | 21 +- ncurses/base/lib_dft_fgbg.c | 74 +- ncurses/base/lib_driver.c | 143 + ncurses/base/lib_echo.c | 36 +- ncurses/base/lib_endwin.c | 47 +- ncurses/base/lib_erase.c | 6 +- ncurses/base/lib_flash.c | 30 +- ncurses/base/lib_freeall.c | 62 +- ncurses/base/lib_getch.c | 181 +- ncurses/base/lib_getstr.c | 25 +- ncurses/base/lib_hline.c | 10 +- ncurses/base/lib_immedok.c | 6 +- ncurses/base/lib_inchstr.c | 11 +- ncurses/base/lib_initscr.c | 8 +- ncurses/base/lib_insch.c | 48 +- ncurses/base/lib_insdel.c | 6 +- ncurses/base/lib_insnstr.c | 10 +- ncurses/base/lib_instr.c | 30 +- ncurses/base/lib_isendwin.c | 20 +- ncurses/base/lib_leaveok.c | 6 +- ncurses/base/lib_mouse.c | 277 +- ncurses/base/lib_move.c | 6 +- ncurses/base/lib_mvwin.c | 20 +- ncurses/base/lib_newterm.c | 238 +- ncurses/base/lib_newwin.c | 160 +- ncurses/base/lib_nl.c | 54 +- ncurses/base/lib_overlay.c | 16 +- ncurses/base/lib_pad.c | 82 +- ncurses/base/lib_printw.c | 16 +- ncurses/base/lib_redrawln.c | 27 +- ncurses/base/lib_refresh.c | 69 +- ncurses/base/lib_restart.c | 78 +- ncurses/base/lib_scanw.c | 6 +- ncurses/base/lib_screen.c | 130 +- ncurses/base/lib_scroll.c | 10 +- ncurses/base/lib_scrollok.c | 6 +- ncurses/base/lib_scrreg.c | 6 +- ncurses/base/lib_set_term.c | 468 +- ncurses/base/lib_slk.c | 240 +- ncurses/base/lib_slkatr_set.c | 52 +- ncurses/base/lib_slkatrof.c | 26 +- ncurses/base/lib_slkatron.c | 26 +- ncurses/base/lib_slkatrset.c | 20 +- ncurses/base/lib_slkattr.c | 24 +- ncurses/base/lib_slkclear.c | 30 +- ncurses/base/lib_slkcolor.c | 40 +- ncurses/base/lib_slkinit.c | 39 +- ncurses/base/lib_slklab.c | 24 +- ncurses/base/lib_slkrefr.c | 103 +- ncurses/base/lib_slkset.c | 28 +- ncurses/base/lib_slktouch.c | 24 +- ncurses/base/lib_touch.c | 14 +- ncurses/base/lib_ungetch.c | 14 +- ncurses/base/lib_vline.c | 10 +- ncurses/base/lib_wattroff.c | 6 +- ncurses/base/lib_wattron.c | 8 +- ncurses/base/lib_winch.c | 12 +- ncurses/base/lib_window.c | 66 +- ncurses/base/nc_panel.c | 18 +- ncurses/base/resizeterm.c | 198 +- ncurses/base/safe_sprintf.c | 37 +- ncurses/base/tries.c | 12 +- ncurses/base/use_window.c | 6 +- ncurses/base/wresize.c | 33 +- ncurses/build.priv.h | 108 + ncurses/curses.priv.h | 878 +- ncurses/llib-lncurses | 1026 +- ncurses/llib-lncursest | 1055 +- ncurses/llib-lncursestw | 5270 +++++ ncurses/llib-lncursesw | 1071 +- ncurses/modules | 370 +- ncurses/tinfo/MKcaptab.sh | 136 +- ncurses/tinfo/MKcodes.awk | 23 +- ncurses/tinfo/MKfallback.sh | 18 +- ncurses/tinfo/MKnames.awk | 26 +- ncurses/tinfo/access.c | 7 +- ncurses/tinfo/add_tries.c | 11 +- ncurses/tinfo/alloc_entry.c | 19 +- ncurses/tinfo/alloc_ttype.c | 90 +- ncurses/tinfo/captoinfo.c | 49 +- ncurses/tinfo/comp_expand.c | 6 +- ncurses/tinfo/comp_hash.c | 330 +- ncurses/tinfo/comp_parse.c | 18 +- ncurses/tinfo/comp_scan.c | 92 +- ncurses/tinfo/db_iterator.c | 11 +- ncurses/tinfo/entries.c | 18 +- ncurses/tinfo/free_ttype.c | 6 +- ncurses/tinfo/hashed_db.c | 60 +- ncurses/tinfo/home_terminfo.c | 6 +- ncurses/tinfo/init_keytry.c | 20 +- ncurses/tinfo/lib_acs.c | 82 +- ncurses/tinfo/lib_baudrate.c | 32 +- ncurses/tinfo/lib_cur_term.c | 122 +- ncurses/tinfo/lib_data.c | 50 +- ncurses/tinfo/lib_has_cap.c | 53 +- ncurses/tinfo/lib_kernel.c | 82 +- ncurses/tinfo/lib_longname.c | 42 +- ncurses/tinfo/lib_napms.c | 21 +- ncurses/tinfo/lib_options.c | 281 +- ncurses/tinfo/lib_print.c | 39 +- ncurses/tinfo/lib_raw.c | 202 +- ncurses/tinfo/lib_setup.c | 403 +- ncurses/tinfo/lib_termcap.c | 223 +- ncurses/tinfo/lib_termname.c | 22 +- ncurses/tinfo/lib_ti.c | 164 +- ncurses/tinfo/lib_tparm.c | 49 +- ncurses/tinfo/lib_tputs.c | 168 +- ncurses/tinfo/lib_ttyflags.c | 217 +- ncurses/tinfo/make_hash.c | 294 + ncurses/tinfo/make_keys.c | 24 +- ncurses/tinfo/name_match.c | 3 +- ncurses/tinfo/parse_entry.c | 55 +- ncurses/tinfo/read_entry.c | 71 +- ncurses/tinfo/read_termcap.c | 20 +- ncurses/tinfo/setbuf.c | 35 +- ncurses/tinfo/tinfo_driver.c | 1337 ++ ncurses/tinfo/trim_sgr0.c | 38 +- ncurses/tinfo/use_screen.c | 8 +- ncurses/tinfo/write_entry.c | 82 +- ncurses/trace/lib_trace.c | 37 +- ncurses/trace/lib_traceatr.c | 55 +- ncurses/trace/lib_tracebits.c | 7 +- ncurses/trace/lib_tracechr.c | 10 +- ncurses/trace/lib_tracedmp.c | 12 +- ncurses/trace/lib_tracemse.c | 42 +- ncurses/trace/trace_buf.c | 11 +- ncurses/trace/trace_tries.c | 14 +- ncurses/trace/trace_xnames.c | 7 +- ncurses/trace/varargs.c | 4 +- ncurses/trace/visbuf.c | 57 +- ncurses/tty/MKexpanded.sh | 61 +- ncurses/tty/hardscroll.c | 113 +- ncurses/tty/hashmap.c | 257 +- ncurses/tty/lib_mvcur.c | 500 +- ncurses/tty/lib_tstp.c | 45 +- ncurses/tty/lib_twait.c | 82 +- ncurses/tty/lib_vidattr.c | 133 +- ncurses/tty/tty_update.c | 1222 +- ncurses/wcwidth.h | 309 + ncurses/widechar/lib_add_wch.c | 438 +- ncurses/widechar/lib_box_set.c | 6 +- ncurses/widechar/lib_cchar.c | 34 +- ncurses/widechar/lib_erasewchar.c | 8 +- ncurses/widechar/lib_get_wch.c | 33 +- ncurses/widechar/lib_get_wstr.c | 7 +- ncurses/widechar/lib_hline_set.c | 12 +- ncurses/widechar/lib_in_wch.c | 6 +- ncurses/widechar/lib_in_wchnstr.c | 6 +- ncurses/widechar/lib_ins_wch.c | 56 +- ncurses/widechar/lib_inwstr.c | 8 +- ncurses/widechar/lib_pecho_wchar.c | 8 +- ncurses/widechar/lib_unget_wch.c | 28 +- ncurses/widechar/lib_vid_attr.c | 124 +- ncurses/widechar/lib_vline_set.c | 12 +- ncurses/widechar/lib_wacs.c | 31 +- ncurses/widechar/lib_wunctrl.c | 26 +- ncurses/win32con/gettimeofday.c | 51 + ncurses/win32con/wcwidth.c | 50 + ncurses/win32con/win_driver.c | 1241 ++ panel/Makefile.in | 19 +- panel/llib-lpanel | 21 +- panel/llib-lpanelt | 197 + panel/llib-lpaneltw | 197 + panel/llib-lpanelw | 21 +- panel/modules | 34 +- panel/p_above.c | 46 +- panel/p_below.c | 45 +- panel/p_bottom.c | 8 +- panel/p_delete.c | 14 +- panel/p_hidden.c | 18 +- panel/p_hide.c | 24 +- panel/p_move.c | 24 +- panel/p_new.c | 29 +- panel/p_replace.c | 26 +- panel/p_show.c | 39 +- panel/p_top.c | 6 +- panel/p_update.c | 43 +- panel/p_user.c | 8 +- panel/p_win.c | 6 +- panel/panel.c | 10 +- panel/panel.h | 12 +- panel/panel.priv.h | 61 +- progs/Makefile.in | 49 +- progs/dump_entry.c | 16 +- progs/infocmp.c | 24 +- progs/modules | 10 +- progs/tabs.c | 510 + progs/tic.c | 207 +- progs/toe.c | 23 +- progs/tput.c | 60 +- progs/transform.c | 79 + progs/tset.c | 38 +- test/Makefile.in | 131 + test/README | 800 + test/aclocal.m4 | 3111 +++ test/background.c | 95 + test/blue.c | 465 + test/bs.6 | 71 + test/bs.c | 1257 ++ test/bulgarian-utf8.txt | 6 + test/cardfile.c | 621 + test/cardfile.dat | 13 + test/chgat.c | 375 + test/clip_printw.c | 380 + test/color_set.c | 92 + test/configure | 15873 ++++++++++++++++ test/configure.in | 320 + test/demo_altkeys.c | 163 + test/demo_defkey.c | 282 + test/demo_forms.c | 550 + test/demo_keyok.c | 82 + test/demo_menus.c | 902 + test/demo_panels.c | 816 + test/demo_termcap.c | 311 + test/demo_terminfo.c | 317 + test/ditto.c | 441 + test/dots.c | 164 + test/dots_mvcur.c | 174 + test/echochar.c | 159 + test/edit_field.c | 465 + test/edit_field.h | 53 + test/filter.c | 164 + test/firework.c | 196 + test/firstlast.c | 123 + test/foldkeys.c | 264 + test/gdc.6 | 64 + test/gdc.c | 351 + test/hanoi.c | 338 + test/hashtest.c | 247 + test/inch_wide.c | 279 + test/inchs.c | 272 + test/ins_wide.c | 508 + test/insdelln.c | 387 + test/inserts.c | 438 + test/key_names.c | 93 + test/keynames.c | 83 + test/knight.c | 727 + test/linedata.h | 100 + test/linux-color.dat | 48 + test/listused.sh | 183 + test/lrtest.c | 182 + test/make-tar.sh | 83 + test/mk-test.awk | 132 + test/modules | 96 + test/movewindow.c | 639 + test/ncurses.c | 6847 +++++++ test/ncurses_tst.hin | 56 + test/newdemo.c | 358 + test/programs | 93 + test/railroad.c | 254 + test/rain.c | 390 + test/redraw.c | 171 + test/savescreen.c | 342 + test/savescreen.sh | 56 + test/tclock.c | 258 + test/test.priv.h | 767 + test/test_add_wchstr.c | 589 + test/test_addchstr.c | 511 + test/test_addstr.c | 424 + test/test_addwstr.c | 516 + test/test_arrays.c | 99 + test/test_get_wstr.c | 372 + test/test_getstr.c | 363 + test/test_instr.c | 260 + test/test_inwstr.c | 269 + test/test_opaque.c | 471 + test/testaddch.c | 88 + test/testcurs.c | 737 + test/testscanw.c | 67 + test/tracemunch | 161 + test/view.c | 586 + test/widechars-utf8.txt | 7 + test/worm.c | 618 + test/xmas.c | 1162 ++ test/xterm-16color.dat | 53 + test/xterm-256color.dat | 293 + test/xterm-88color.dat | 125 + 1008 files changed, 187842 insertions(+), 12493 deletions(-) create mode 100644 Ada95/Makefile.in create mode 100644 Ada95/README create mode 100644 Ada95/TODO create mode 100644 Ada95/aclocal.m4 create mode 100755 Ada95/configure create mode 100644 Ada95/configure.in create mode 100644 Ada95/gen/Makefile.in create mode 100644 Ada95/gen/adacurses-config.in create mode 100644 Ada95/gen/gen.c create mode 100644 Ada95/gen/html.m4 create mode 100644 Ada95/gen/normal.m4 create mode 100644 Ada95/gen/table.m4 create mode 100644 Ada95/gen/terminal_interface-curses-aux.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-menus.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-mouse.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-panels.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-trace.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses.adb.m4 create mode 100644 Ada95/gen/terminal_interface-curses.ads.m4 create mode 100755 Ada95/include/MKncurses_def.sh create mode 100644 Ada95/include/Makefile.in create mode 100644 Ada95/include/ncurses_cfg.hin create mode 100644 Ada95/include/ncurses_defs create mode 100755 Ada95/make-tar.sh create mode 100644 Ada95/mk-1st.awk create mode 100644 Ada95/samples/Makefile.in create mode 100644 Ada95/samples/README create mode 100644 Ada95/samples/explain.txt create mode 100644 Ada95/samples/ncurses.adb create mode 100644 Ada95/samples/ncurses2-acs_and_scroll.adb create mode 100644 Ada95/samples/ncurses2-acs_and_scroll.ads create mode 100644 Ada95/samples/ncurses2-acs_display.adb create mode 100644 Ada95/samples/ncurses2-acs_display.ads create mode 100644 Ada95/samples/ncurses2-attr_test.adb create mode 100644 Ada95/samples/ncurses2-attr_test.ads create mode 100644 Ada95/samples/ncurses2-color_edit.adb create mode 100644 Ada95/samples/ncurses2-color_edit.ads create mode 100644 Ada95/samples/ncurses2-color_test.adb create mode 100644 Ada95/samples/ncurses2-color_test.ads create mode 100644 Ada95/samples/ncurses2-demo_forms.adb create mode 100644 Ada95/samples/ncurses2-demo_forms.ads create mode 100644 Ada95/samples/ncurses2-demo_pad.adb create mode 100644 Ada95/samples/ncurses2-demo_pad.ads create mode 100644 Ada95/samples/ncurses2-demo_panels.adb create mode 100644 Ada95/samples/ncurses2-demo_panels.ads create mode 100644 Ada95/samples/ncurses2-flushinp_test.adb create mode 100644 Ada95/samples/ncurses2-flushinp_test.ads create mode 100644 Ada95/samples/ncurses2-genericputs.adb create mode 100644 Ada95/samples/ncurses2-genericputs.ads create mode 100644 Ada95/samples/ncurses2-getch.ads create mode 100644 Ada95/samples/ncurses2-getch_test.adb create mode 100644 Ada95/samples/ncurses2-getch_test.ads create mode 100644 Ada95/samples/ncurses2-getopt.adb create mode 100644 Ada95/samples/ncurses2-getopt.ads create mode 100644 Ada95/samples/ncurses2-m.adb create mode 100644 Ada95/samples/ncurses2-m.ads create mode 100644 Ada95/samples/ncurses2-menu_test.adb create mode 100644 Ada95/samples/ncurses2-menu_test.ads create mode 100644 Ada95/samples/ncurses2-overlap_test.adb create mode 100644 Ada95/samples/ncurses2-overlap_test.ads create mode 100644 Ada95/samples/ncurses2-slk_test.adb create mode 100644 Ada95/samples/ncurses2-slk_test.ads create mode 100644 Ada95/samples/ncurses2-test_sgr_attributes.adb create mode 100644 Ada95/samples/ncurses2-test_sgr_attributes.ads create mode 100644 Ada95/samples/ncurses2-trace_set.adb create mode 100644 Ada95/samples/ncurses2-trace_set.ads create mode 100644 Ada95/samples/ncurses2-util.adb create mode 100644 Ada95/samples/ncurses2-util.ads create mode 100644 Ada95/samples/ncurses2.ads create mode 100644 Ada95/samples/rain.adb create mode 100644 Ada95/samples/rain.ads create mode 100644 Ada95/samples/sample-curses_demo-attributes.adb create mode 100644 Ada95/samples/sample-curses_demo-attributes.ads create mode 100644 Ada95/samples/sample-curses_demo-mouse.adb create mode 100644 Ada95/samples/sample-curses_demo-mouse.ads create mode 100644 Ada95/samples/sample-curses_demo.adb create mode 100644 Ada95/samples/sample-curses_demo.ads create mode 100644 Ada95/samples/sample-explanation.adb create mode 100644 Ada95/samples/sample-explanation.ads create mode 100644 Ada95/samples/sample-form_demo-aux.adb create mode 100644 Ada95/samples/sample-form_demo-aux.ads create mode 100644 Ada95/samples/sample-form_demo-handler.adb create mode 100644 Ada95/samples/sample-form_demo-handler.ads create mode 100644 Ada95/samples/sample-form_demo.adb create mode 100644 Ada95/samples/sample-form_demo.ads create mode 100644 Ada95/samples/sample-function_key_setting.adb create mode 100644 Ada95/samples/sample-function_key_setting.ads create mode 100644 Ada95/samples/sample-header_handler.adb create mode 100644 Ada95/samples/sample-header_handler.ads create mode 100644 Ada95/samples/sample-helpers.adb create mode 100644 Ada95/samples/sample-helpers.ads create mode 100644 Ada95/samples/sample-keyboard_handler.adb create mode 100644 Ada95/samples/sample-keyboard_handler.ads create mode 100644 Ada95/samples/sample-manifest.ads create mode 100644 Ada95/samples/sample-menu_demo-aux.adb create mode 100644 Ada95/samples/sample-menu_demo-aux.ads create mode 100644 Ada95/samples/sample-menu_demo-handler.adb create mode 100644 Ada95/samples/sample-menu_demo-handler.ads create mode 100644 Ada95/samples/sample-menu_demo.adb create mode 100644 Ada95/samples/sample-menu_demo.ads create mode 100644 Ada95/samples/sample-my_field_type.adb create mode 100644 Ada95/samples/sample-my_field_type.ads create mode 100644 Ada95/samples/sample-text_io_demo.adb create mode 100644 Ada95/samples/sample-text_io_demo.ads create mode 100644 Ada95/samples/sample.adb create mode 100644 Ada95/samples/sample.ads create mode 100644 Ada95/samples/status.adb create mode 100644 Ada95/samples/status.ads create mode 100644 Ada95/samples/tour.adb create mode 100644 Ada95/samples/tour.ads create mode 100644 Ada95/src/Makefile.in create mode 100644 Ada95/src/library.gpr create mode 100644 Ada95/src/modules create mode 100644 Ada95/src/terminal_interface-curses-aux.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user.ads create mode 100644 Ada95/src/terminal_interface-curses-forms-field_types.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-field_user_data.adb create mode 100644 Ada95/src/terminal_interface-curses-forms-form_user_data.adb create mode 100644 Ada95/src/terminal_interface-curses-forms.adb create mode 100644 Ada95/src/terminal_interface-curses-menus-item_user_data.adb create mode 100644 Ada95/src/terminal_interface-curses-menus-menu_user_data.adb create mode 100644 Ada95/src/terminal_interface-curses-menus.adb create mode 100644 Ada95/src/terminal_interface-curses-mouse.adb create mode 100644 Ada95/src/terminal_interface-curses-panels-user_data.adb create mode 100644 Ada95/src/terminal_interface-curses-panels.adb create mode 100644 Ada95/src/terminal_interface-curses-putwin.adb create mode 100644 Ada95/src/terminal_interface-curses-putwin.ads create mode 100644 Ada95/src/terminal_interface-curses-termcap.adb create mode 100644 Ada95/src/terminal_interface-curses-termcap.ads create mode 100644 Ada95/src/terminal_interface-curses-terminfo.adb create mode 100644 Ada95/src/terminal_interface-curses-terminfo.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-aux.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-aux.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-complex_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-complex_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-decimal_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-decimal_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-fixed_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-fixed_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-float_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-float_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-integer_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-integer_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io-modular_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io-modular_io.ads create mode 100644 Ada95/src/terminal_interface-curses-text_io.adb create mode 100644 Ada95/src/terminal_interface-curses-text_io.ads create mode 100644 Ada95/src/terminal_interface-curses-trace.adb_p create mode 100644 Ada95/src/terminal_interface.ads create mode 100644 README.MinGW create mode 100644 c++/Makefile.in create mode 100644 c++/NEWS create mode 100644 c++/PROBLEMS create mode 100644 c++/README-first create mode 100644 c++/cursesapp.cc create mode 100644 c++/cursesapp.h create mode 100644 c++/cursesf.cc create mode 100644 c++/cursesf.h create mode 100644 c++/cursesm.cc create mode 100644 c++/cursesm.h create mode 100644 c++/cursesmain.cc create mode 100644 c++/cursesp.cc create mode 100644 c++/cursesp.h create mode 100644 c++/cursespad.cc create mode 100644 c++/cursesw.cc create mode 100644 c++/cursesw.h create mode 100644 c++/cursslk.cc create mode 100644 c++/cursslk.h create mode 100644 c++/demo.cc rename tar-copy.sh => c++/edit_cfg.sh (69%) create mode 100644 c++/etip.h.in create mode 100644 c++/headers create mode 100644 c++/internal.h create mode 100644 c++/modules create mode 100644 doc/html/Ada95.html create mode 100644 doc/html/ada/files.htm create mode 100644 doc/html/ada/files/T.htm create mode 100644 doc/html/ada/funcs.htm create mode 100644 doc/html/ada/funcs/A.htm create mode 100644 doc/html/ada/funcs/B.htm create mode 100644 doc/html/ada/funcs/C.htm create mode 100644 doc/html/ada/funcs/D.htm create mode 100644 doc/html/ada/funcs/E.htm create mode 100644 doc/html/ada/funcs/F.htm create mode 100644 doc/html/ada/funcs/G.htm create mode 100644 doc/html/ada/funcs/H.htm create mode 100644 doc/html/ada/funcs/I.htm create mode 100644 doc/html/ada/funcs/K.htm create mode 100644 doc/html/ada/funcs/L.htm create mode 100644 doc/html/ada/funcs/M.htm create mode 100644 doc/html/ada/funcs/N.htm create mode 100644 doc/html/ada/funcs/O.htm create mode 100644 doc/html/ada/funcs/P.htm create mode 100644 doc/html/ada/funcs/Q.htm create mode 100644 doc/html/ada/funcs/R.htm create mode 100644 doc/html/ada/funcs/S.htm create mode 100644 doc/html/ada/funcs/T.htm create mode 100644 doc/html/ada/funcs/U.htm create mode 100644 doc/html/ada/funcs/V.htm create mode 100644 doc/html/ada/funcs/W.htm create mode 100644 doc/html/ada/index.htm create mode 100644 doc/html/ada/main.htm create mode 100644 doc/html/ada/table.html create mode 100644 doc/html/ada/terminal_interface-curses-aux__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-aux__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-forms__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-menus__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-menus__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-mouse__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-mouse__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-panels__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-panels__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-putwin__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-putwin__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-termcap__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-termcap__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-terminfo__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-terminfo__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-text_io__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses-trace__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses-trace__ads.htm create mode 100644 doc/html/ada/terminal_interface-curses__adb.htm create mode 100644 doc/html/ada/terminal_interface-curses__ads.htm create mode 100644 doc/html/ada/terminal_interface__ads.htm create mode 100644 doc/html/index.html create mode 100644 doc/html/man/adacurses-config.1.html create mode 100644 doc/html/man/captoinfo.1m.html create mode 100644 doc/html/man/clear.1.html create mode 100644 doc/html/man/curs_add_wch.3x.html create mode 100644 doc/html/man/curs_add_wchstr.3x.html create mode 100644 doc/html/man/curs_addch.3x.html create mode 100644 doc/html/man/curs_addchstr.3x.html create mode 100644 doc/html/man/curs_addstr.3x.html create mode 100644 doc/html/man/curs_addwstr.3x.html create mode 100644 doc/html/man/curs_attr.3x.html create mode 100644 doc/html/man/curs_beep.3x.html create mode 100644 doc/html/man/curs_bkgd.3x.html create mode 100644 doc/html/man/curs_bkgrnd.3x.html create mode 100644 doc/html/man/curs_border.3x.html create mode 100644 doc/html/man/curs_border_set.3x.html create mode 100644 doc/html/man/curs_clear.3x.html create mode 100644 doc/html/man/curs_color.3x.html create mode 100644 doc/html/man/curs_delch.3x.html create mode 100644 doc/html/man/curs_deleteln.3x.html create mode 100644 doc/html/man/curs_extend.3x.html create mode 100644 doc/html/man/curs_get_wch.3x.html create mode 100644 doc/html/man/curs_get_wstr.3x.html create mode 100644 doc/html/man/curs_getcchar.3x.html create mode 100644 doc/html/man/curs_getch.3x.html create mode 100644 doc/html/man/curs_getstr.3x.html create mode 100644 doc/html/man/curs_getyx.3x.html create mode 100644 doc/html/man/curs_in_wch.3x.html create mode 100644 doc/html/man/curs_in_wchstr.3x.html create mode 100644 doc/html/man/curs_inch.3x.html create mode 100644 doc/html/man/curs_inchstr.3x.html create mode 100644 doc/html/man/curs_initscr.3x.html create mode 100644 doc/html/man/curs_inopts.3x.html create mode 100644 doc/html/man/curs_ins_wch.3x.html create mode 100644 doc/html/man/curs_ins_wstr.3x.html create mode 100644 doc/html/man/curs_insch.3x.html create mode 100644 doc/html/man/curs_insstr.3x.html create mode 100644 doc/html/man/curs_instr.3x.html create mode 100644 doc/html/man/curs_inwstr.3x.html create mode 100644 doc/html/man/curs_kernel.3x.html create mode 100644 doc/html/man/curs_legacy.3x.html create mode 100644 doc/html/man/curs_memleaks.3x.html create mode 100644 doc/html/man/curs_mouse.3x.html create mode 100644 doc/html/man/curs_move.3x.html create mode 100644 doc/html/man/curs_opaque.3x.html create mode 100644 doc/html/man/curs_outopts.3x.html create mode 100644 doc/html/man/curs_overlay.3x.html create mode 100644 doc/html/man/curs_pad.3x.html create mode 100644 doc/html/man/curs_print.3x.html create mode 100644 doc/html/man/curs_printw.3x.html create mode 100644 doc/html/man/curs_refresh.3x.html create mode 100644 doc/html/man/curs_scanw.3x.html create mode 100644 doc/html/man/curs_scr_dump.3x.html create mode 100644 doc/html/man/curs_scroll.3x.html create mode 100644 doc/html/man/curs_slk.3x.html create mode 100644 doc/html/man/curs_sp_funcs.3x.html create mode 100644 doc/html/man/curs_termattrs.3x.html create mode 100644 doc/html/man/curs_termcap.3x.html create mode 100644 doc/html/man/curs_terminfo.3x.html create mode 100644 doc/html/man/curs_threads.3x.html create mode 100644 doc/html/man/curs_touch.3x.html create mode 100644 doc/html/man/curs_trace.3x.html create mode 100644 doc/html/man/curs_util.3x.html create mode 100644 doc/html/man/curs_variables.3x.html create mode 100644 doc/html/man/curs_window.3x.html create mode 100644 doc/html/man/default_colors.3x.html create mode 100644 doc/html/man/define_key.3x.html create mode 100644 doc/html/man/form.3x.html create mode 100644 doc/html/man/form_cursor.3x.html create mode 100644 doc/html/man/form_data.3x.html create mode 100644 doc/html/man/form_driver.3x.html create mode 100644 doc/html/man/form_field.3x.html create mode 100644 doc/html/man/form_field_attributes.3x.html create mode 100644 doc/html/man/form_field_buffer.3x.html create mode 100644 doc/html/man/form_field_info.3x.html create mode 100644 doc/html/man/form_field_just.3x.html create mode 100644 doc/html/man/form_field_new.3x.html create mode 100644 doc/html/man/form_field_opts.3x.html create mode 100644 doc/html/man/form_field_userptr.3x.html create mode 100644 doc/html/man/form_field_validation.3x.html create mode 100644 doc/html/man/form_fieldtype.3x.html create mode 100644 doc/html/man/form_hook.3x.html create mode 100644 doc/html/man/form_new.3x.html create mode 100644 doc/html/man/form_new_page.3x.html create mode 100644 doc/html/man/form_opts.3x.html create mode 100644 doc/html/man/form_page.3x.html create mode 100644 doc/html/man/form_post.3x.html create mode 100644 doc/html/man/form_requestname.3x.html create mode 100644 doc/html/man/form_userptr.3x.html create mode 100644 doc/html/man/form_variables.3x.html create mode 100644 doc/html/man/form_win.3x.html create mode 100644 doc/html/man/index.html create mode 100644 doc/html/man/infocmp.1m.html create mode 100644 doc/html/man/infotocap.1m.html create mode 100644 doc/html/man/key_defined.3x.html create mode 100644 doc/html/man/keybound.3x.html create mode 100644 doc/html/man/keyok.3x.html create mode 100644 doc/html/man/legacy_coding.3x.html create mode 100644 doc/html/man/menu.3x.html create mode 100644 doc/html/man/menu_attributes.3x.html create mode 100644 doc/html/man/menu_cursor.3x.html create mode 100644 doc/html/man/menu_driver.3x.html create mode 100644 doc/html/man/menu_format.3x.html create mode 100644 doc/html/man/menu_hook.3x.html create mode 100644 doc/html/man/menu_items.3x.html create mode 100644 doc/html/man/menu_mark.3x.html create mode 100644 doc/html/man/menu_new.3x.html create mode 100644 doc/html/man/menu_opts.3x.html create mode 100644 doc/html/man/menu_pattern.3x.html create mode 100644 doc/html/man/menu_post.3x.html create mode 100644 doc/html/man/menu_requestname.3x.html create mode 100644 doc/html/man/menu_spacing.3x.html create mode 100644 doc/html/man/menu_userptr.3x.html create mode 100644 doc/html/man/menu_win.3x.html create mode 100644 doc/html/man/mitem_current.3x.html create mode 100644 doc/html/man/mitem_name.3x.html create mode 100644 doc/html/man/mitem_new.3x.html create mode 100644 doc/html/man/mitem_opts.3x.html create mode 100644 doc/html/man/mitem_userptr.3x.html create mode 100644 doc/html/man/mitem_value.3x.html create mode 100644 doc/html/man/mitem_visible.3x.html create mode 100644 doc/html/man/ncurses.3x.html create mode 100644 doc/html/man/ncurses5-config.1.html create mode 100644 doc/html/man/panel.3x.html create mode 100644 doc/html/man/resizeterm.3x.html create mode 100644 doc/html/man/tabs.1.html create mode 100644 doc/html/man/term.5.html create mode 100644 doc/html/man/term.7.html create mode 100644 doc/html/man/term_variables.3x.html create mode 100644 doc/html/man/terminfo.5.html create mode 100644 doc/html/man/tic.1m.html create mode 100644 doc/html/man/toe.1m.html create mode 100644 doc/html/man/tput.1.html create mode 100644 doc/html/man/tset.1.html create mode 100644 doc/html/man/wresize.3x.html create mode 100644 form/fty_generic.c create mode 100644 form/llib-lformt create mode 100644 form/llib-lformtw create mode 100644 include/nc_mingw.h rename include/{ncurses_dll.h => ncurses_dll.h.in} (93%) create mode 100644 include/ncurses_mingw.h create mode 100644 man/MKada_config.in create mode 100644 man/MKncu_config.in create mode 100644 man/curs_sp_funcs.3x create mode 100644 man/curs_variables.3x create mode 100644 man/form_variables.3x create mode 100644 man/tabs.1 create mode 100644 man/term_variables.3x create mode 100644 menu/llib-lmenut create mode 100644 menu/llib-lmenutw create mode 100644 misc/gen-pkgconfig.in delete mode 100755 misc/jpf-indent delete mode 100755 misc/ncu-indent create mode 100644 mk-dlls.sh.in delete mode 100644 mkdirs.sh create mode 100644 ncurses/base/lib_driver.c create mode 100644 ncurses/build.priv.h create mode 100644 ncurses/llib-lncursestw create mode 100644 ncurses/tinfo/make_hash.c create mode 100644 ncurses/tinfo/tinfo_driver.c create mode 100644 ncurses/wcwidth.h create mode 100644 ncurses/win32con/gettimeofday.c create mode 100644 ncurses/win32con/wcwidth.c create mode 100644 ncurses/win32con/win_driver.c create mode 100644 panel/llib-lpanelt create mode 100644 panel/llib-lpaneltw create mode 100644 progs/tabs.c create mode 100644 progs/transform.c create mode 100644 test/Makefile.in create mode 100644 test/README create mode 100644 test/aclocal.m4 create mode 100644 test/background.c create mode 100644 test/blue.c create mode 100644 test/bs.6 create mode 100644 test/bs.c create mode 100644 test/bulgarian-utf8.txt create mode 100644 test/cardfile.c create mode 100644 test/cardfile.dat create mode 100644 test/chgat.c create mode 100644 test/clip_printw.c create mode 100644 test/color_set.c create mode 100755 test/configure create mode 100644 test/configure.in create mode 100644 test/demo_altkeys.c create mode 100644 test/demo_defkey.c create mode 100644 test/demo_forms.c create mode 100644 test/demo_keyok.c create mode 100644 test/demo_menus.c create mode 100644 test/demo_panels.c create mode 100644 test/demo_termcap.c create mode 100644 test/demo_terminfo.c create mode 100644 test/ditto.c create mode 100644 test/dots.c create mode 100644 test/dots_mvcur.c create mode 100644 test/echochar.c create mode 100644 test/edit_field.c create mode 100644 test/edit_field.h create mode 100644 test/filter.c create mode 100644 test/firework.c create mode 100644 test/firstlast.c create mode 100644 test/foldkeys.c create mode 100644 test/gdc.6 create mode 100644 test/gdc.c create mode 100644 test/hanoi.c create mode 100644 test/hashtest.c create mode 100644 test/inch_wide.c create mode 100644 test/inchs.c create mode 100644 test/ins_wide.c create mode 100644 test/insdelln.c create mode 100644 test/inserts.c create mode 100644 test/key_names.c create mode 100644 test/keynames.c create mode 100644 test/knight.c create mode 100644 test/linedata.h create mode 100644 test/linux-color.dat create mode 100755 test/listused.sh create mode 100644 test/lrtest.c create mode 100755 test/make-tar.sh create mode 100644 test/mk-test.awk create mode 100644 test/modules create mode 100644 test/movewindow.c create mode 100644 test/ncurses.c create mode 100644 test/ncurses_tst.hin create mode 100644 test/newdemo.c create mode 100644 test/programs create mode 100644 test/railroad.c create mode 100644 test/rain.c create mode 100644 test/redraw.c create mode 100644 test/savescreen.c create mode 100755 test/savescreen.sh create mode 100644 test/tclock.c create mode 100644 test/test.priv.h create mode 100644 test/test_add_wchstr.c create mode 100644 test/test_addchstr.c create mode 100644 test/test_addstr.c create mode 100644 test/test_addwstr.c create mode 100644 test/test_arrays.c create mode 100644 test/test_get_wstr.c create mode 100644 test/test_getstr.c create mode 100644 test/test_instr.c create mode 100644 test/test_inwstr.c create mode 100644 test/test_opaque.c create mode 100644 test/testaddch.c create mode 100644 test/testcurs.c create mode 100644 test/testscanw.c create mode 100755 test/tracemunch create mode 100644 test/view.c create mode 100644 test/widechars-utf8.txt create mode 100644 test/worm.c create mode 100644 test/xmas.c create mode 100644 test/xterm-16color.dat create mode 100644 test/xterm-256color.dat create mode 100644 test/xterm-88color.dat diff --git a/ANNOUNCE b/ANNOUNCE index e09e73177a4..269bd2bca2a 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ - Announcing ncurses 5.7 + Announcing ncurses 5.8 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,217 +27,393 @@ Release Notes This release is designed to be upward compatible from ncurses 5.0 - through 5.6; very few applications will require recompilation, + through 5.7; very few applications will require recompilation, depending on the platform. These are the highlights from the - change-log since ncurses 5.6 release. + change-log since ncurses 5.7 release. - Interface changes: - * generate linkable stubs for some macros: - getattrs +Interface changes - New features and improvements: - * library - + new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are reentrant, - but most require either a window-level or screen-level mutex. - (This is API-compatible, but not ABI-compatible with the - normal library). - + add NCURSES_OPAQUE symbol to curses.h, will use to make - structs opaque in selected configurations. - + add NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS symbols to - curses.h to make it simpler to tell if the extended functions - and/or colors are declared. - + add wresize() to C++ binding - + eliminate fixed-buffer vsprintf() calls in C++ binding. - + add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - + adapt mouse-handling code from menu library in form-library - + improve tracing for form library, showing created forms, - fields, etc. - + make $NCURSES_NO_PADDING feature work for termcap interface . - + add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - + several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x - * programs: - + modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - + several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - + add adacurses-config to the Ada95 install. - + modify tic -f option to format spaces as \s to prevent them - from being lost when that is read back in unformatted - strings. - + The tack program is now distributed separately from ncurses. - * terminal database - + added entries: - o Eterm-256color, Eterm-88color and rxvt-88color - o aterm - o konsole-256color - o mrxvt - o screen.mlterm - o screen.rxvt - o teraterm4.59 is now the primary primary teraterm entry, - renamed original to teraterm2.3 - o 9term terminal - o Newbury Data entries - + updated/improved entries: - o gnome to version 2.22.3 - o h19, z100 - o konsole to version 1.6.6 - o mlterm, mlterm+pcfkeys - o xterm, and building-blocks for function-keys to [3]xterm - patch #230. + * turn on _XOPEN_CURSES definition in curses.h. + * change _nc_has_mouse to has_mouse, reflect its use in C++ and + Ada95. + * add is_pad and is_subwin functions for opaque access to the WINDOW + structure. + * add tiparm, based on review of X/Open Curses Issue 7. - Major bug fixes: - * add logic to tic for cancelling strings in user-defined - capabilities (this is needed for current konsole terminfo entry). - * modify mk-1st.awk so the generated makefile rules for linking or - installing shared libraries do not first remove the library, in - case it is in use, e.g., libncurses.so by /bin/sh. - * correct check for notimeout() in wgetch(). - * fix a sign-extension bug in infocmp's repair_acsc() function. - * change winnstr() to stop at the end of the line. - * make Ada95 demo_panels() example work. - * fix for adding a non-spacing character at the beginning of a line. - * fill in extended-color pair to make colors work for - wide-characters using extended-colors. - * improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - * modify win_wchnstr() to ensure that only a base cell is returned - for each multi-column character. - * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by - using unctrl() to display illegal bytes rather than trying to - append further bytes to make up a valid sequence. - * restore curs_set() state after endwin()/refresh() - * modify keyname() to use "^X" form only if meta() has been called, - or if keyname() is called without initializing curses, e.g., via - initscr() or newterm(). - * modify unctrl() to check codes in 128-255 range versus isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - * improve resizeterm() by moving ripped-off lines, and repainting - the soft-keys. - * modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - * use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., - to make those work properly with the --enable-ext-mouse - configuration - * correct some functions in Ada95 binding which were using return - value from C where none was returned. - * reviewed/fixed issues reported by Coverity and Klocwork tools. +New features and improvements + + Library Improvements + + * add a terminal driver for Windows console, which supports a MinGW + port to Windows. + * add extended functions which specify the SCREEN pointer for + several curses functions which use the global SP. + * improve the NCURSES_NO_UTF8_ACS feature by adding a check for an + extended terminfo capability U8. + * improve performance of tigetstr, etc., by using hashing code from + tic. + * add WACS_xxx definitions to wide-character configuration for + thick- and double-lines. + * modify init_pair to allow caller to create extra color pairs + beyond the color_pairs limit, which use default colors. + + Improvements to Programs + + * add tabs program. + * modify tic's -I/-C dump to reformat acsc strings into canonical + form (sorted, unique mapping). + * add checks in tic for inconsistent cursor-movement controls, and + for inconsistent printer-controls. + * add special case to _nc_infotocap (used by tic and infocmp) to + recognize the setaf/setab strings from xterm+256color and + xterm+88color, and provide a reduced version which works with + termcap. + + Terminal Database + + * added entries: + + bterm terminfo entry, based on bogl 0.1.18 + + cons25-debian entry + + eterm-color entry + + linux-16color + + mlterm+256color entry, for mlterm 3.0.0 + + several screen-bce.xxx entries + + screen.Eterm terminfo entry + + vwmterm entry + + xterm-utf8 entry as a demo of the U8 feature + * updated/improved entries: + + use extended capabilities: + o add U8 feature to denote entries for terminal emulators + which do not support VT100 SI/SO when processing UTF-8 + encoding + o add XT capability to entries for terminals that support + both xterm-style mouse- and title-controls, for screen + which special-cases TERM beginning with xterm or rxvt + + improvements based on new checks in tic: + + + o fill in no-parameter forms of cursor-movement where a + parameterized form is available + o fill in missing cursor controls where the form of the + controls is ANSI + o add parameterized cursor-controls to linux-basic + o modify nsterm, xnuppc and tek4115 to make sgr/sgr0 + consistent + o change several terminfo entries to make consistent use + of ANSI clear-all-tabs + + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, + moving function key definitions from emx-base for + consistency. + + correct missing final 'p' in pfkey capability of + ansi.sys-old. + + rename atari and st52 terminfo entries to atari-old, + st52-old, use newer entries from FreeMiNT. + + repurpose gnome terminfo entries as vte, retaining gnome + variants for compatibility, but generally deprecating those + since the VTE library is what actually defines the behavior + of "gnome", etc., since 2003. + + improve interix smso terminfo capability by using reverse + rather than bold. + + correct initc capability of linux-c-nc end-of-range, make + similar change for dg+ccc and dgunix+ccc. + + update minix terminfo entry. + + updated nsterm* entries. + + remove unnecessary kcan assignment to ^C from putty. + + suppress ncv in screen and konsole-base entries, allowing + underline. + + change ncv and op capabilities in sun-color terminfo entry to + match Sun's entry for this. + + fix typo in rmso for tek4106 entry. + + improve acsc string for vt52, show arrow keys. + + add hard-reset for rs2 to wsvt25 to help ensure that reset + ends the alternate character set. + + add ccc and initc capabilities to xterm-16color. + +Major bug fixes + + * ncurses library + + wide character support + o modify length returned by getcchar to count the trailing + null which is documented in X/Open. + o fix an infinite recursion when adding a legacy-coding + 8-bit value using insch. + o improve a workaround in adding wide-characters, when a + control character is found. The library uses unctrl to + obtain a printable version of the control character, but + was not passing color or video attributes. + o modify waddch_literal, updating line-pointer after a + multicolumn character is found to not fit on the current + row, and wrapping is done. Since the line-pointer was + not updated, the wrapped multicolumn character was + written to the beginning of the current row. + o fixes in wins_nwstr and related functions to ensure that + special characters, i.e., control characters are handled + properly with the wide-character configuration. + o correct internal _nc_insert_ch to use _nc_insert_wch + when inserting wide characters, since the wins_wch + function that it used did not update the cursor + position. + + mouse + o add check if Gpm_Open returns a -2, e.g., for "xterm". + This is normally suppressed but can be overridden using + $NCURSES_GPM_TERMS. Ensure that Gpm_Close is called in + this case. + o add check in mouse-driver to disable connection if GPM + returns a zero, indicating that the connection is + closed. + o modify getmouse to act as its documentation implied, + returning on each call the preceding event until none + are left. When no more events remain, it will return + ERR. + + miscellaneous + o improve handling of color-pairs embedded in attributes + for the extended-colors configuration. + o add check for failure to open hashed-database needed for + db4.6. + o modify use of $CC environment variable which is defined + by X/Open as a curses feature, to ignore it if it is not + a single character. + o modify declaration of cur_term when broken-linker is + used, but enable-reentrant is not, to match pre-5.7. + o correct limit-checks in derwin. + o remove old check in mvderwin which prevented moving a + derived window whose origin happened to coincide with + its parent's origin. + o correct limit-checks in newwin, to ensure that windows + have nonzero size. + o modify set_curterm to make broken-linker configuration + work with changes from 20090228. + o modify wgetch to ensure it checks SIGWINCH when it gets + an error in non-blocking mode. + o correct limit-check in wredrawln, accounting for + begy/begx values. + o fix a null-pointer check in _nc_format_slks in + lib_slk.c, from 20070704 changes. + o correct translation of "^" in _nc_infotocap, used to + transform terminfo to termcap strings. + o modify _nc_wgetch to check for a -1 in the fifo, e.g., + after a SIGWINCH, and discard that value, to avoid + confusing application. + * other libraries + + correct transfer of multicolumn characters in multirow + field_buffer, which stopped at the end of the first row due + to filling of unused entries in a cchar_t array with nulls. + + correct buffer-size after internal resizing of wide-character + set_field_buffer, broken in 20081018 changes. + + correct layout of working window used to extract data in + wide-character configured by set_field_buffer + +Portability - Portability: * configure script: + new options: - --disable-big-strings - control whether static string tables are generated - as single large strings (to improve startup - performance), or as array of individual strings. + --disable-libtool-version + use the "-version-number" feature which was added + in libtool 1.5. The default value for the option + uses the newer feature, which makes libraries + generated using libtool compatible with the + standard builds of ncurses. - --disable-relink - control whether shared libraries are relinked - (during install) when rpath is enabled. + --disable-rpath-hack + disable a feature which adds rpath options for + libraries in unusual places. - --disable-tic-depends - make explicit whether tic library depends on - ncurses/ncursesw library. + --enable-interop + integrate changes for generic/interop support to + form-library. - --enable-mixed-case - override the configure script's check if the - filesystem supports mixed-case filenames. This - allows one to control how the terminal database - maps to the filesystem. For filesystems that do not - support mixed-case, the library uses generate - 2-character (hexadecimal) codes for the lower-level - of the filesystem terminfo database + --enable-pc-files + generate ".pc" files for each of the libraries, and + install them in pkg-config's library directory. - --enable-reentrant - builds a different flavor of the ncurses library - (ncursest) which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded - support). + --enable-pthreads-eintr + control whether to allow EINTR to interrupt a read + operation in wgetch. This applies only to the + pthread configuration - --enable-weak-symbols - use weak-symbols for linking to the POSIX thread - library, and use the same soname for the ncurses - shared library as the normal library (caveat: the - ABI is for the threaded library, which makes global - data accessed via functions). + --enable-sp-funcs + compile-in support for extended functions which + accept a SCREEN pointer, reducing the need for + juggling the global SP value with set_term and + delscreen. - --with-pthread - build with the POSIX thread library (tested with - AIX, Linux, FreeBSD, OpenBSD, HPUX, IRIX64, - Solaris, Tru64). + --enable-term-driver + compile with terminal-driver. That is used in the + MinGW port, and (being somewhat more complicated) + is an experimental alternative to the conventional + termlib internals. Currently, it requires the + sp-funcs feature to be enabled. - --with-ticlib - build/install the tic-support functions in a - separate library + --with-ncurses-wrap-prefix + allows setting the prefix for functions used to + wrap global variables to something other than + "_nc_". + + --with-pkg-config=[DIR] + check for pkg-config, optionally specifying its + path. + + --without-manpages + tells the configure script to suppress the install + of ncurses' manpages. + + --without-tests + suppress building test programs. + improved options: - - --enable-ext-colors - requires the wide-character configuration. - - --with-chtype - ignore option value "unsigned" is always added to - the type in curses.h; do the same for - --with-mmask-t. - - --with-dmalloc - build-fix for redefinition of strndup. - - --with-hashed-db - accepts a parameter which is the install-prefix of - a given Berkeley Database. - - --with-hashed-db - the $LIBS environment variable overrides the search - for the db library. - - --without-hashed-db - assumed when "--disable-database" is used. - + o correct logic for --with-database, which was coded as an + enable-type switch. + o omit the opaque-functions from lib_gen.o when + --disable-ext-funcs is used. + * packaging: + + *-config scripts: + o modify adacurses-config to look for ".ali" files in the + adalib directory. + o correct install for the Ada95 tree, which omitted + libAdaCurses.a used in adacurses-config. + o change install for adacurses-config to provide + additional flavors such as adacursesw-config, for + ncursesw. + o modify scripts to generate ncurses*-config and pc-files + to add dependency for tinfo library. + o use ncurses*-config scripts if available for + test/configure. + o correct name for termlib in ncurses*-config, e.g., if it + is renamed to provide a single file for ncurses/ncursesw + libraries. + o generate manpages for the *-config scripts, adapted from + help2man. + o modify install-rule for manpages so that *-config + manpages will install when building with --srcdir. + o build-fixes for OpenSolaris aka Solaris 11, for + wide-character configuration as well as for rpath + feature in *-config scripts. + o use $includedir symbol in misc/ncurses-config.in, add + --includedir option. + o improve install-rules for pc-files. + o create the pkg-config library directory if needed. + o fix typo "==" where "=" is needed in ncurses-config.in + and gen-pkgconfig.in files. + o modify gen-pkgconfig.in to eliminate a dependency on + rpath when deciding whether to add $LIBS to --libs + output; that should be shown for the ncurses and tinfo + libraries without taking rpath into account. + o modify handling of $PKG_CONFIG_LIBDIR to use only the + first item in a possibly colon-separated list. + + other packaging issues + o add make-tar.sh scripts to Ada95 and test subdirectories + to help with making those separately distributable. + o add Ada95/configure script, to use in tar-file created + by Ada95/make-tar.sh. + o remove tar-copy.sh and related configure/Makefile + chunks, since the Ada95 binding is now installed using + rules in Ada95/src. + * cross-compiling: + + improve configure checks for location of tic and infocmp + programs used for installing database and for generating + fallback data, e.g., for cross-compiling. + + modify #define's for build-compiler to suppress cchar_t + symbol from compile of make_hash and make_keys, improving + cross-compilation of ncursesw. + + simplify include-dependencies of make_hash and make_keys, to + reduce the need for setting BUILD_CPPFLAGS in cross-compiling + when the build- and target-machines differ. + + correct cross-compiling configure check for CF_MKSTEMP macro, + by adding a check cache variable set by AC_CHECK_FUNC. + * library dependencies: + + revise wadd_wch and wecho_wchar to eliminate dependency on + unctrl. + + adjust configure script so that "t" is not added to library + suffix when weak-symbols are used, allowing the pthread + configuration to more closely match the non-thread naming. + * building the Ada95 tree: + + changes to use gnatmake project files in the Ada95 tree. + + add/use configure check to turn on project rules for + Ada95/src. + + old gnatmake (3.15) does not produce libraries using + project-file; work around by adding script to generate + alternate makefile. + + add configure --with-ada-sharedlib option, for the test_make + rule. + + move Ada95-related logic into aclocal.m4, since additional + checks will be needed to distinguish old/new implementations + of gnat. + + add test_make / test_clean / test_install rules in Ada95/src + + change install-path for adainclude directory to + /usr/share/ada (was /usr/lib/ada). * other configure/build issues: - + build-fixes for LynxOS - + modify shared-library rules to allow FreeBSD 3.x to use - rpath. - + build-fix for FreeBSD "contemporary" TTY interface. - + build-fixes for AIX with libtool. - + build-fixes for Darwin and libtool. - + modify BeOS-specific ifdef's to build on Haiku. - + corrected gcc options for building shared libraries on - Solaris and IRIX64. - + change shared-library configuration for OpenBSD, make rpath - work. - + build-fixes for using libutf8, e.g., on OpenBSD 3.7 - + add "-e" option in ncurses/Makefile.in when generating - source-files to force earlier exit if the build environment - fails unexpectedly. - + add support for shared libraries for QNX. - + change delimiter in MKlib_gen.sh from '%' to '@', to avoid - substitution by IBM xlc to '#' as part of its extensions to - digraphs. - * library: - + rewrite wrapper for wcrtomb(), making it work on Solaris. - This is used in the form library to determine the length of - the buffer needed by field_buffer. - + add/use configure script macro CF_SIG_ATOMIC_T, use the - corresponding type for data manipulated by signal handlers. - + set locale in misc/ncurses-config.in since it uses a range - + disable GPM mouse support when $TERM does not happen to - contain "linux", since Gpm_Open() no longer limits its - assertion to terminals that it might handle, e.g., within - "screen" in xterm. - + reset mouse file-descriptor when unloading GPM library. + + make CCHARW_MAX value configurable, noting that changing this + would change the size of cchar_t, and would be + ABI-incompatible. + + improve comparison of program-names when checking for linked + flavors such as "reset" by ignoring the executable suffix. + + drop mkdirs.sh, use "mkdir -p". + + drop misc/ncu-indent and misc/jpf-indent; they are provided + by an external package [3]cindent. + + change makefiles to use $ARFLAGS rather than $AR_OPTS, + provide a configure check to detect whether a "-" is needed + before "ar" options. + + modify CF_DISABLE_LEAKS configure macro so that the + --enable-leaks option is not the same as --disable-leaks. + + improve configure script macros CF_HEADER_PATH and + CF_LIBRARY_PATH by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS + values to the search-lists. + + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS + to work with gcc 4.x's c89 alias, which gives warning + messages for cases where older versions would produce an + error. + + modify CF_WITH_LIBTOOL configure check to allow unreleased + libtool version numbers (e.g. which include alphabetic chars, + as well as digits, after the final '.'). + + improve use of symbolic links in makefiles by using "-f" + option if it is supported, to eliminate temporary removal of + the target + + add a configure-time check to pick a suitable value for + CC_SHARED_OPTS for Solaris. + + add -shared option to MK_SHARED_LIB when -Bsharable is used, + for *BSD's, without which "main" might be one of the shared + library's dependencies. + + modify configure script to allow building shared libraries + with gcc on AIX 5 or 6. + + suppress configure check for static/dynamic linker flags for + gcc on Solaris 10, since gcc is confused by absence of static + libc, and does not switch back to dynamic mode before + finishing the libraries. + + suppress configure check for static/dynamic linker flags for + gcc on Darwin. + + modify misc/run_tic.in to create parent directory, in case + this is a new install of hashed database. + + modify configure check for tic program, used for fallbacks, + to a warning if not found. This makes it simpler to use + additonal scripts to bootstrap the fallbacks code using tic + from the build tree. * test programs: - + update test programs to build/work with various UNIX curses - for comparisons. + + add test/demo_terminfo, for comparison with demo_termcap. + + improve test/ncurses.c 'F' test, show combining characters in + color. + + fix logic for 'V' in test/ncurses.c tests f/F. + + improve test/ncurses.c 'a test to put mouse droppings in the + proper window. + + modify ncurses 'F' test to demo wborder_set with colored + lines. + + modify ncurses 'f' test to demo wborder with colored lines. + + improve test/ncurses.c 'a' test, using unctrl more + consistently to display meta-characters. + + correct use of key_name in test/ncurses.c 'A' test, which + only displays wide-characters, not key-codes since 20070612. + + add test/clip_printw.c to illustrate how to use printw + without wrapping. + + modify test-programs, e.g,. test/view.c, to address subtle + differences between Tru64/Solaris and HPUX/AIX getcchar + return values. + + add some test programs (and make these use the same special + keys by sharing linedata.h functions): test/test_addstr.c + test/test_addwstr.c test/test_addchstr.c + test/test_add_wchstr.c + + add test/xterm-256color.dat + + modify test programs to allow them to be built with NetBSD + curses. + + fixes for test programs to build/work on HPUX and AIX, etc. Features of Ncurses @@ -274,15 +450,15 @@ * Support for mouse event reporting with X Window xterm and FreeBSD and OS/2 console windows. * Extended mouse support via Alessandro Rubini's gpm package. - * The function wresize() allows you to resize windows, preserving + * The function wresize allows you to resize windows, preserving their data. - * The function use_default_colors() allows you to use the terminal's + * The function use_default_colors allows you to use the terminal's default colors for the default color pair, achieving the effect of transparent colors. - * The functions keyok() and define_key() allow you to better control - the use of function keys, e.g., disabling the ncurses KEY_MOUSE, - or by defining more than one control sequence to map to a given - key code. + * The functions keyok and define_key allow you to better control the + use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code. * Support for 256-color terminals, such as modern xterm, when configured using the --enable-ext-colors option. * Support for 16-color terminals, such as aixterm and modern xterm. @@ -293,7 +469,7 @@ incorporates a novel, simple, and cheap algorithm that enables it to make optimal use of hardware scrolling, line-insertion, and line-deletion for screen-line movements. This algorithm is more - powerful than the 4.4BSD curses quickch() routine. + powerful than the 4.4BSD curses quickch routine. * Real support for terminals with the magic-cookie glitch. The screen-update code will refrain from drawing a highlight if the magic- cookie unattributed spaces required just before the @@ -374,7 +550,7 @@ Midnight Commander file manager - [9]http://www.ibiblio.org/mc/ + [9]http://www.midnight-commander.org/ mutt mail utility @@ -387,7 +563,7 @@ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [12]http://www.bostic.com/vi/ + [12]https://sites.google.com/a/bostic.com/keithbostic/nvi pinfo Lynx-like info browser. @@ -412,7 +588,7 @@ Who's Who and What's What Zeyd Ben-Halim started it from a previous package pcurses, written by - Pavel Curtis. Eric S. Raymond continued development. Jürgen Pfeifer + Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer wrote most of the form and menu libraries. Ongoing work is being done by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. @@ -452,16 +628,16 @@ References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/xterm/xterm.log.html#xterm_230 + 3. http://invisible-island.net/cindent/cindent.html 4. http://invisible-island.net/cdk/ 5. http://www.vexus.ca/products/CDK/ 6. http://invisible-island.net/ded/ 7. http://invisible-island.net/dialog/ 8. http://lynx.isc.org/release/ - 9. http://www.ibiblio.org/mc/ + 9. http://www.midnight-commander.org/ 10. http://www.mutt.org/ 11. http://www.ncftp.com/ - 12. http://www.bostic.com/vi/ + 12. https://sites.google.com/a/bostic.com/keithbostic/nvi 13. https://alioth.debian.org/projects/pinfo/ 14. http://www.tin.org/ 15. http://alioth.debian.org/projects/minicom/ @@ -470,4 +646,4 @@ References 18. mailto:bug-ncurses@gnu.org 19. ftp://invisible-island.net/ncurses/ 20. http://www.catb.org/~esr/terminfo/ - 21. http://www.cs.utk.edu/~shuford/terminal_index.html + 21. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal diff --git a/Ada95/Makefile.in b/Ada95/Makefile.in new file mode 100644 index 00000000000..f8207933021 --- /dev/null +++ b/Ada95/Makefile.in @@ -0,0 +1,81 @@ +# $Id: Makefile.in,v 1.21 2010/11/27 21:45:27 tom Exp $ +############################################################################## +# Copyright (c) 1998-2003,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"), # +# 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: Juergen Pfeifer, 1996 +# +# Version Control +# $Revision: 1.21 $ +# +SHELL = /bin/sh +VPATH = @srcdir@ +THIS = Makefile + +SUBDIRS = @ADA_SUBDIRS@ + +CF_MFLAGS = @cf_cv_makeflags@ +@SET_MAKE@ + +all \ +libs \ +sources \ +install \ +install.libs \ +uninstall \ +uninstall.libs :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ + done + +clean \ +mostlyclean :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ + done + +distclean \ +realclean :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\ + done + rm -rf lib + for lib_kind in static dynamic; do \ + rm -rf $${lib_kind}-ali; \ + rm -rf $${lib_kind}-obj; \ + done + -rm -f config.cache config.log config.status include/ncurses_cfg.h + -rm -f Makefile + +tags : + @ + +preinstall : + @ + +install.data : + @ diff --git a/Ada95/README b/Ada95/README new file mode 100644 index 00000000000..be8425969de --- /dev/null +++ b/Ada95/README @@ -0,0 +1,33 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 + +The documentation is provided in HTML format in the ./html +subdirectory. The main document is named index.html + diff --git a/Ada95/TODO b/Ada95/TODO new file mode 100644 index 00000000000..f5c8acde4c4 --- /dev/null +++ b/Ada95/TODO @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-1999,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"), 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: TODO,v 1.5 2006/04/22 22:23:21 tom Exp $ +------------------------------------------------------------------------------- + +-- Intensive testing + Perhaps the delivery of the Beta will help a bit. + +-- Documentation + Like most WEB pages: under continuous construction + +-- Style cleanup + +-- Alternate functions for procedures with out params + Comfort purpose + +-- Sample program + Under continuous construction (and it's not a WEB page!!!) + +-- Make the binding objects a shared library + They are rather large, so it would make sense, otherwise Ada95 + would look too large, although the generated code is as compact + as C or C++. I'll wait a bit until the GNAT people provide some + better support to construct shared libraries. + +-- Think about more inlining + +-- Check for memory leaks. + Oh I would like it so much if the GNAT guys would put an optional + GC into their system. diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 new file mode 100644 index 00000000000..99a89cec0b1 --- /dev/null +++ b/Ada95/aclocal.m4 @@ -0,0 +1,3458 @@ +dnl*************************************************************************** +dnl Copyright (c) 2010,2011 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl Author: Thomas E. Dickey +dnl +dnl $Id: aclocal.m4,v 1.20 2011/01/22 19:46:50 tom Exp $ +dnl Macros used in NCURSES Ada95 auto-configuration script. +dnl +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 +dnl --------------------------------------------------------------------------- +dnl --------------------------------------------------------------------------- +dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 +dnl ------------------- +dnl Construct the list of include-options for the C programs in the Ada95 +dnl binding. +AC_DEFUN([CF_ADA_INCLUDE_DIRS], +[ +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" +if test "$srcdir" != "."; then + ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" +fi +if test "$GCC" != yes; then + ACPPFLAGS="$ACPPFLAGS -I\${includedir}" +elif test "$includedir" != "/usr/include"; then + if test "$includedir" = '${prefix}/include' ; then + if test $prefix != /usr ; then + ACPPFLAGS="$ACPPFLAGS -I\${includedir}" + fi + else + ACPPFLAGS="$ACPPFLAGS -I\${includedir}" + fi +fi +AC_SUBST(ACPPFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18 +dnl --------------- +dnl Add to $ADAFLAGS, which is substituted into makefile and scripts. +AC_DEFUN([CF_ADD_ADAFLAGS],[ + ADAFLAGS="$ADAFLAGS $1" + AC_SUBST(ADAFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 +dnl ------------- +dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. +dnl +dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, +dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily +dnl confused by the quotes (which require backslashes to keep them usable). +AC_DEFUN([CF_ADD_CFLAGS], +[ +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + CFLAGS="$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" +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" +fi + +AC_SUBST(EXTRA_CPPFLAGS) + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 +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, +dnl but old versions (and some misinstalled ones) need that. To make things +dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to +dnl the include-path). +AC_DEFUN([CF_ADD_INCDIR], +[ +if test -n "$1" ; then + for cf_add_incdir in $1 + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + AC_TRY_COMPILE([#include ], + [printf("Hello")], + [], + [cf_have_incdir=yes]) + CPPFLAGS=$cf_save_CPPFLAGS + fi + fi + fi + + if test "$cf_have_incdir" = no ; then + CF_VERBOSE(adding $cf_add_incdir to include-path) + ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -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 + fi + done + done +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 +dnl ---------- +dnl Add a library, used to enforce consistency. +dnl +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 ------------- +dnl Adds to the library-path +dnl +dnl Some machines have trouble with multiple -L options. +dnl +dnl $1 is the (list of) directory(s) to add +dnl $2 is the optional name of the variable to update (default LDFLAGS) +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 +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl ----------- +dnl Add one or more libraries, used to enforce consistency. +dnl +dnl $1 = libraries to add, with the "-l", etc. +dnl $2 = variable to update (default $LIBS) +AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 +dnl ------------------ +dnl Append to a search-list for a nonstandard header/lib-file +dnl $1 = the variable to return as result +dnl $2 = the package name +dnl $3 = the subdirectory, e.g., bin, include or lib +dnl $4 = the directory under which we will test for subdirectories +dnl $5 = a directory that we do not want $4 to match +AC_DEFUN([CF_ADD_SUBDIR_PATH], +[ +test "$4" != "$5" && \ +test -d "$4" && \ +ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { + test -n "$verbose" && echo " ... testing for $3-directories under $4" + test -d $4/$3 && $1="[$]$1 $4/$3" + test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" + test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" + test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" + test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" +} +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 +dnl ---------------- +dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' +dnl in the sharutils 4.2 distribution. +AC_DEFUN([CF_ANSI_CC_CHECK], +[ +AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + -Ae \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +do + CF_ADD_CFLAGS($cf_arg) + AC_TRY_COMPILE( +[ +#ifndef CC_HAS_PROTOS +#if !defined(__STDC__) || (__STDC__ != 1) +choke me +#endif +#endif +],[ + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);};], + [cf_cv_ansi_cc="$cf_arg"; break]) +done +CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" +]) + +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + CF_ADD_CFLAGS($cf_cv_ansi_cc) +else + AC_DEFINE(CC_HAS_PROTOS) +fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 +dnl --------------- +dnl For programs that must use an ANSI compiler, obtain compiler options that +dnl will make it recognize prototypes. We'll do preprocessor checks in other +dnl macros, since tools such as unproto can fake prototypes, but only part of +dnl the preprocessor. +AC_DEFUN([CF_ANSI_CC_REQD], +[AC_REQUIRE([CF_ANSI_CC_CHECK]) +if test "$cf_cv_ansi_cc" = "no"; then + AC_MSG_ERROR( +[Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29 +dnl ----------- +dnl Check for suitable "ar" (archiver) options for updating an archive. +AC_DEFUN([CF_AR_FLAGS],[ +AC_REQUIRE([CF_PROG_AR]) + +AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do + + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&AC_FD_CC + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + CF_VERBOSE(cannot compile test-program) + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext +]) + +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags +fi + +AC_SUBST(ARFLAGS) +]) +dnl --------------------------------------------------------------------------- +dnl CF_BUILD_CC version: 6 updated: 2006/10/14 15:23:15 +dnl ----------- +dnl If we're cross-compiling, allow the user to override the tools and their +dnl options. The configure script is oriented toward identifying the host +dnl compiler, etc., but we need a build compiler to generate parts of the +dnl source. +dnl +dnl $1 = default for $CPPFLAGS +dnl $2 = default for $LIBS +AC_DEFUN([CF_BUILD_CC],[ +AC_REQUIRE([CF_PROG_EXT]) +if test "$cross_compiling" = yes ; then + + # defaults that we might want to override + : ${BUILD_CFLAGS:=''} + : ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'} + : ${BUILD_LDFLAGS:=''} + : ${BUILD_LIBS:='ifelse([$2],,,[$2])'} + : ${BUILD_EXEEXT:='$x'} + : ${BUILD_OBJEXT:='o'} + + AC_ARG_WITH(build-cc, + [ --with-build-cc=XXX the build C compiler ($BUILD_CC)], + [BUILD_CC="$withval"], + [AC_CHECK_PROGS(BUILD_CC, gcc cc cl)]) + AC_MSG_CHECKING(for native build C compiler) + AC_MSG_RESULT($BUILD_CC) + + AC_MSG_CHECKING(for native build C preprocessor) + AC_ARG_WITH(build-cpp, + [ --with-build-cpp=XXX the build C preprocessor ($BUILD_CPP)], + [BUILD_CPP="$withval"], + [BUILD_CPP='${BUILD_CC} -E']) + AC_MSG_RESULT($BUILD_CPP) + + AC_MSG_CHECKING(for native build C flags) + AC_ARG_WITH(build-cflags, + [ --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)], + [BUILD_CFLAGS="$withval"]) + AC_MSG_RESULT($BUILD_CFLAGS) + + AC_MSG_CHECKING(for native build C preprocessor-flags) + AC_ARG_WITH(build-cppflags, + [ --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)], + [BUILD_CPPFLAGS="$withval"]) + AC_MSG_RESULT($BUILD_CPPFLAGS) + + AC_MSG_CHECKING(for native build linker-flags) + AC_ARG_WITH(build-ldflags, + [ --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)], + [BUILD_LDFLAGS="$withval"]) + AC_MSG_RESULT($BUILD_LDFLAGS) + + AC_MSG_CHECKING(for native build linker-libraries) + AC_ARG_WITH(build-libs, + [ --with-build-libs=XXX the build libraries (${BUILD_LIBS})], + [BUILD_LIBS="$withval"]) + AC_MSG_RESULT($BUILD_LIBS) + + # this assumes we're on Unix. + BUILD_EXEEXT= + BUILD_OBJEXT=o + + : ${BUILD_CC:='${CC}'} + + if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then + AC_MSG_ERROR([Cross-build requires two compilers. +Use --with-build-cc to specify the native compiler.]) + fi + +else + : ${BUILD_CC:='${CC}'} + : ${BUILD_CPP:='${CPP}'} + : ${BUILD_CFLAGS:='${CFLAGS}'} + : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} + : ${BUILD_LDFLAGS:='${LDFLAGS}'} + : ${BUILD_LIBS:='${LIBS}'} + : ${BUILD_EXEEXT:='$x'} + : ${BUILD_OBJEXT:='o'} +fi + +AC_SUBST(BUILD_CC) +AC_SUBST(BUILD_CPP) +AC_SUBST(BUILD_CFLAGS) +AC_SUBST(BUILD_CPPFLAGS) +AC_SUBST(BUILD_LDFLAGS) +AC_SUBST(BUILD_LIBS) +AC_SUBST(BUILD_EXEEXT) +AC_SUBST(BUILD_OBJEXT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CFG_DEFAULTS version: 7 updated: 2005/09/24 16:15:00 +dnl --------------- +dnl Determine the default configuration into which we'll install ncurses. This +dnl can be overridden by the user's command-line options. There's two items to +dnl look for: +dnl 1. the prefix (e.g., /usr) +dnl 2. the header files (e.g., /usr/include/ncurses) +dnl We'll look for a previous installation of ncurses and use the same defaults. +dnl +dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and +dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's +dnl programs from a vendor's. +AC_DEFUN([CF_CFG_DEFAULTS], +[ +AC_MSG_CHECKING(for prefix) +if test "x$prefix" = "xNONE" ; then + case "$cf_cv_system_name" in + # non-vendor systems don't have a conflict + openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu) + prefix=/usr + ;; + *) prefix=$ac_default_prefix + ;; + esac +fi +AC_MSG_RESULT($prefix) + +if test "x$prefix" = "xNONE" ; then +AC_MSG_CHECKING(for default include-directory) +test -n "$verbose" && echo 1>&AC_FD_MSG +for cf_symbol in \ + $includedir \ + $includedir/ncurses \ + $prefix/include \ + $prefix/include/ncurses \ + /usr/local/include \ + /usr/local/include/ncurses \ + /usr/include \ + /usr/include/ncurses +do + cf_dir=`eval echo $cf_symbol` + if test -f $cf_dir/curses.h ; then + if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then + includedir="$cf_symbol" + test -n "$verbose" && echo $ac_n " found " 1>&AC_FD_MSG + break + fi + fi + test -n "$verbose" && echo " tested $cf_dir" 1>&AC_FD_MSG +done +AC_MSG_RESULT($includedir) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 +dnl -------------- +dnl Check if we're accidentally using a cache from a different machine. +dnl Derive the system name, as a check for reusing the autoconf cache. +dnl +dnl If we've packaged config.guess and config.sub, run that (since it does a +dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow +dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM +dnl which is useful in cross-compiles. +dnl +dnl Note: we would use $ac_config_sub, but that is one of the places where +dnl autoconf 2.5x broke compatibility with autoconf 2.13 +AC_DEFUN([CF_CHECK_CACHE], +[ +if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then + ifelse([$1],,[AC_CANONICAL_HOST],[$1]) + system_name="$host_os" +else + system_name="`(uname -s -r) 2>/dev/null`" + if test -z "$system_name" ; then + system_name="`(hostname) 2>/dev/null`" + fi +fi +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") +AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) + +test -z "$system_name" && system_name="$cf_cv_system_name" +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) + +if test ".$system_name" != ".$cf_cv_system_name" ; then + AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) + AC_MSG_ERROR("Please remove config.cache and try again.") +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16 +dnl ---------------- +dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common +dnl variations of ncurses' installs. +dnl +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/curses.h \ + $1/ncurses.h]) \ + curses.h \ + ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h]) +do +AC_TRY_COMPILE([#include <${cf_header}>], + [initscr(); tgoto("?", 0,0)], + [cf_cv_ncurses_header=$cf_header; break],[]) +done +]) + +if test "$cf_cv_ncurses_header" = none ; then + AC_MSG_ERROR(No curses header-files found) +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. +AC_CHECK_HEADERS($cf_cv_ncurses_header) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 +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_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 +dnl --------------- +dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We +dnl prefer a standard location, and use -L options only if we do not find the +dnl library in the standard library location(s). +dnl $1 = library name +dnl $2 = library class, usually the same as library name +dnl $3 = includes +dnl $4 = code fragment to compile/link +dnl $5 = corresponding function-name +dnl $6 = flag, nonnull if failure should not cause an error-exit +dnl +dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had +dnl to use a -L option. +AC_DEFUN([CF_FIND_LIBRARY], +[ + eval 'cf_cv_have_lib_'$1'=no' + cf_libdir="" + AC_CHECK_FUNC($5, + eval 'cf_cv_have_lib_'$1'=yes',[ + cf_save_LIBS="$LIBS" + AC_MSG_CHECKING(for $5 in -l$1) + LIBS="-l$1 $LIBS" + AC_TRY_LINK([$3],[$4], + [AC_MSG_RESULT(yes) + eval 'cf_cv_have_lib_'$1'=yes' + ], + [AC_MSG_RESULT(no) + CF_LIBRARY_PATH(cf_search,$2) + for cf_libdir in $cf_search + do + AC_MSG_CHECKING(for -l$1 in $cf_libdir) + LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" + AC_TRY_LINK([$3],[$4], + [AC_MSG_RESULT(yes) + eval 'cf_cv_have_lib_'$1'=yes' + break], + [AC_MSG_RESULT(no) + LIBS="$cf_save_LIBS"]) + done + ]) + ]) +eval 'cf_found_library=[$]cf_cv_have_lib_'$1 +ifelse($6,,[ +if test $cf_found_library = no ; then + AC_MSG_ERROR(Cannot link $1 library) +fi +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 +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. +dnl See also CF_ADD_SEARCHPATH. +dnl +dnl Parameters (4-on are optional): +dnl $1 = headers for library entrypoint +dnl $2 = code fragment for library entrypoint +dnl $3 = the library name without the "-l" option or ".so" suffix. +dnl $4 = action to perform if successful (default: update CPPFLAGS, etc) +dnl $5 = action to perform if not successful +dnl $6 = module name, if not the same as the library name +dnl $7 = extra libraries +dnl +dnl Sets these variables: +dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found +dnl $cf_cv_header_path_$3 - include-directory if needed +dnl $cf_cv_library_path_$3 - library-directory if needed +dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 +AC_DEFUN([CF_FIND_LINKAGE],[ + +# 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_$3= +cf_cv_library_path_$3= + +CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) + +cf_save_LIBS="$LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib +],[ + +LIBS="-l$3 $7 $cf_save_LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib + cf_cv_library_file_$3="-l$3" +],[ + 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) +]) + +LIBS="$cf_save_LIBS" + +if test "$cf_cv_find_linkage_$3" = yes ; then +ifelse([$4],,[ + CF_ADD_INCDIR($cf_cv_header_path_$3) + CF_ADD_LIBDIR($cf_cv_library_path_$3) + CF_ADD_LIB($3) +],[$4]) +else +ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 +dnl ----------------- +dnl Test for availability of useful gcc __attribute__ directives to quiet +dnl compiler warnings. Though useful, not all are supported -- and contrary +dnl to documentation, unrecognized directives cause older compilers to barf. +AC_DEFUN([CF_GCC_ATTRIBUTES], +[ +if test "$GCC" = yes +then +cat > conftest.i < conftest.$ac_ext <&AC_FD_CC + + case $cf_attribute in #(vi + printf) #(vi + cf_printf_attribute=yes + cat >conftest.h <conftest.h <conftest.h <>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h +fi +rm -rf conftest* +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31 +dnl -------------- +dnl Find version of gcc +AC_DEFUN([CF_GCC_VERSION],[ +AC_REQUIRE([AC_PROG_CC]) +GCC_VERSION=none +if test "$GCC" = yes ; then + AC_MSG_CHECKING(version of $CC) + GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + test -z "$GCC_VERSION" && GCC_VERSION=unknown + AC_MSG_RESULT($GCC_VERSION) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32 +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 -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 +dnl is enabled for ncurses using "--enable-const". +dnl -pedantic +dnl +dnl Parameter: +dnl $1 is an optional list of gcc warning flags that a particular +dnl application might want to use, e.g., "no-unused" for +dnl -Wno-unused +dnl Special: +dnl If $with_ext_const is "yes", add a check for -Wwrite-strings +dnl +AC_DEFUN([CF_GCC_WARNINGS], +[ +AC_REQUIRE([CF_GCC_VERSION]) +CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) + +cat > conftest.$ac_ext <>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then +ifelse($3,, :,[ $3]) +ifelse($4,,,[else + $4]) +fi +rm -rf conftest* +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_TRY_RUN version: 4 updated: 2010/08/14 18:25:37 +dnl --------------- +dnl Verify that a test program compiles and runs with GNAT +dnl $cf_ada_make is set to the program that compiles/links +dnl $ADAFLAGS may be set to the GNAT flags. +dnl +dnl $1 is the text of the spec +dnl $2 is the text of the body +dnl $3 is the shell command to execute if successful +dnl $4 is the shell command to execute if not successful +AC_DEFUN([CF_GNAT_TRY_RUN], +[ +rm -rf conftest* +cat >>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then + if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then +ifelse($3,, :,[ $3]) +ifelse($4,,,[ else + $4]) + fi +ifelse($4,,,[else + $4]) +fi +rm -rf conftest* +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_VERSION version: 16 updated: 2010/11/13 14:15:18 +dnl --------------- +dnl Verify version of GNAT. +AC_DEFUN([CF_GNAT_VERSION], +[ +AC_MSG_CHECKING(for gnat version) +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` +AC_MSG_RESULT($cf_gnat_version) + +case $cf_gnat_version in #(vi +3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) + cf_cv_prog_gnat_correct=no + ;; +esac + +CF_GNAT_GENERICS +CF_GNAT_PROJECTS +]) +dnl --------------------------------------------------------------------------- +dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07 +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 +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... +AC_DEFUN([CF_GNU_SOURCE], +[ +AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ +AC_TRY_COMPILE([#include ],[ +#ifndef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_gnu_source=no], + [cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + AC_TRY_COMPILE([#include ],[ +#ifdef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_gnu_source=no], + [cf_cv_gnu_source=yes]) + CPPFLAGS="$cf_save" + ]) +]) +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 +dnl -------------- +dnl Construct a search-list of directories for a nonstandard header-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name +AC_DEFUN([CF_HEADER_PATH], +[ +$1= + +# 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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) + cf_header_path_list="$cf_header_path_list [$]$1" + ;; + esac + done +fi + +# add the variations for the package we are looking for +CF_SUBDIR_PATH($1,$2,include) + +test "$includedir" != NONE && \ +test "$includedir" != "/usr/include" && \ +test -d "$includedir" && { + test -d $includedir && $1="[$]$1 $includedir" + test -d $includedir/$2 && $1="[$]$1 $includedir/$2" +} + +test "$oldincludedir" != NONE && \ +test "$oldincludedir" != "/usr/include" && \ +test -d "$oldincludedir" && { + test -d $oldincludedir && $1="[$]$1 $oldincludedir" + test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" +} + +$1="[$]$1 $cf_header_path_list" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 +dnl --------------- +dnl Insert text into the help-message, for readability, from AC_ARG_WITH. +AC_DEFUN([CF_HELP_MESSAGE], +[AC_DIVERT_HELP([$1])dnl +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40 +dnl --------------- +dnl Construct the list of include-options according to whether we're building +dnl in the source directory or using '--srcdir=DIR' option. If we're building +dnl with gcc, don't append the includedir if it happens to be /usr/include, +dnl since that usually breaks gcc's shadow-includes. +AC_DEFUN([CF_INCLUDE_DIRS], +[ +CPPFLAGS="$CPPFLAGS -I. -I../include" +if test "$srcdir" != "."; then + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" +fi +if test "$GCC" != yes; then + CPPFLAGS="$CPPFLAGS -I\${includedir}" +elif test "$includedir" != "/usr/include"; then + if test "$includedir" = '${prefix}/include' ; then + if test $prefix != /usr ; then + CPPFLAGS="$CPPFLAGS -I\${includedir}" + fi + else + CPPFLAGS="$CPPFLAGS -I\${includedir}" + fi +fi +AC_SUBST(CPPFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 +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 +dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. +dnl +dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to +dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from +dnl the wrappers for gcc and g++ warnings. +dnl +dnl $1 = GCC (default) or GXX +dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $3 = CFLAGS (default) or CXXFLAGS +AC_DEFUN([CF_INTEL_COMPILER],[ +ifelse([$2],,INTEL_COMPILER,[$2])=no + +if test "$ifelse([$1],,[$1],GCC)" = yes ; then + case $host_os in + 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" + AC_TRY_COMPILE([],[ +#ifdef __INTEL_COMPILER +#else +make an error +#endif +],[ifelse([$2],,INTEL_COMPILER,[$2])=yes +cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" +],[]) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) + ;; + esac +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50 +dnl ------------ +dnl Add checks for large file support. +AC_DEFUN([CF_LARGEFILE],[ +ifdef([AC_FUNC_FSEEKO],[ + AC_SYS_LARGEFILE + if test "$enable_largefile" != no ; then + AC_FUNC_FSEEKO + + # Normally we would collect these definitions in the config.h, + # but (like _XOPEN_SOURCE), some environments rely on having these + # defined before any of the system headers are included. Another + # case comes up with C++, e.g., on AIX the compiler compiles the + # header files by themselves before looking at the body files it is + # told to compile. For ncurses, those header files do not include + # the config.h + test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES " + test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " + test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " + + AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[ + AC_TRY_COMPILE([ +#include +#include + ],[ + /* if transitional largefile support is setup, this is true */ + extern struct dirent64 * readdir(DIR *); + struct dirent64 *x = readdir((DIR *)0); + struct dirent *y = readdir((DIR *)0); + int z = x - y; + ], + [cf_cv_struct_dirent64=yes], + [cf_cv_struct_dirent64=no]) + ]) + test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64) + fi +]) +]) +dnl --------------------------------------------------------------------------- +dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 +dnl --------------- +dnl For the given system and compiler, find the compiler flags to pass to the +dnl loader to use the "rpath" feature. +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 + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[[2-9]].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +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) + +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 +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 +dnl --------------- +dnl Construct a search-list of directories for a nonstandard library-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name +AC_DEFUN([CF_LIBRARY_PATH], +[ +$1= +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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) + cf_library_path_list="$cf_library_path_list [$]$1" + ;; + esac + done +fi + +CF_SUBDIR_PATH($1,$2,lib) + +$1="$cf_library_path_list [$]$1" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 +dnl ------------- +dnl Compute the library-prefix for the given host system +dnl $1 = variable to set +AC_DEFUN([CF_LIB_PREFIX], +[ + case $cf_cv_system_name in #(vi + OS/2*|os2*) #(vi + LIB_PREFIX='' + ;; + *) LIB_PREFIX='lib' + ;; + esac +ifelse($1,,,[$1=$LIB_PREFIX]) + AC_SUBST(LIB_PREFIX) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIB_SONAME version: 5 updated: 2010/08/14 18:25:37 +dnl ------------- +dnl Find the and soname for the given shared library. Set the cache variable +dnl cf_cv_$3_soname to this, unless it is not found. Then set the cache +dnl variable to "unknown". +dnl +dnl $1 = headers +dnl $2 = code +dnl $3 = library name +AC_DEFUN([CF_LIB_SONAME], +[ +AC_CACHE_CHECK(for soname of $3 library,cf_cv_$3_soname,[ + +cf_cv_$3_soname=unknown +if test "$cross_compiling" != yes ; then +cat >conftest.$ac_ext </dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.` + test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown + fi + fi +rm -rf conftest* +LIBS="$cf_save_LIBS" +fi +]) +]) +dnl --------------------------------------------------------------------------- +dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03 +dnl ------------- +dnl Compute the library file-suffix from the given model name +dnl $1 = model name +dnl $2 = variable to set (the nominal library suffix) +dnl $3 = dependency variable to set (actual filename) +dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. +AC_DEFUN([CF_LIB_SUFFIX], +[ + AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + case $1 in #(vi + libtool) #(vi + $2='.la' + $3=[$]$2 + ;; + normal) #(vi + $2='.a' + $3=[$]$2 + ;; + debug) #(vi + $2='_g.a' + $3=[$]$2 + ;; + profile) #(vi + $2='_p.a' + $3=[$]$2 + ;; + shared) #(vi + case $cf_cv_system_name in + aix[[56]]*) #(vi + $2='.a' + $3=[$]$2 + ;; + cygwin*) #(vi + $2='.dll' + $3='.dll.a' + ;; + darwin*) #(vi + $2='.dylib' + $3=[$]$2 + ;; + hpux*) #(vi + case $target in + ia64*) #(vi + $2='.so' + $3=[$]$2 + ;; + *) #(vi + $2='.sl' + $3=[$]$2 + ;; + esac + ;; + *) $2='.so' + $3=[$]$2 + ;; + esac + esac + test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" + test -n "$LIB_SUFFIX" && $3="${LIB_SUFFIX}[$]{$3}" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIB_TYPE version: 4 updated: 2000/10/20 22:57:49 +dnl ----------- +dnl Compute the string to append to -library from the given model name +dnl $1 = model name +dnl $2 = variable to set +dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. +AC_DEFUN([CF_LIB_TYPE], +[ + case $1 in + libtool) $2='' ;; + normal) $2='' ;; + debug) $2='_g' ;; + profile) $2='_p' ;; + shared) $2='' ;; + esac + test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38 +dnl ---------------- +dnl Some systems have a non-ANSI linker that doesn't pull in modules that have +dnl only data (i.e., no functions), for example NeXT. On those systems we'll +dnl have to provide wrappers for global tables to ensure they're linked +dnl properly. +AC_DEFUN([CF_LINK_DATAONLY], +[ +AC_MSG_CHECKING([if data-only library module links]) +AC_CACHE_VAL(cf_cv_link_dataonly,[ + rm -f conftest.a + cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null + fi + rm -f conftest.$ac_ext data.o + cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null + fi + rm -f conftest.$ac_ext func.o + ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null + cf_saveLIBS="$LIBS" + LIBS="conftest.a $LIBS" + AC_TRY_RUN([ + int main() + { + extern int testfunc(); + ${cf_cv_main_return:-return} (!testfunc()); + } + ], + [cf_cv_link_dataonly=yes], + [cf_cv_link_dataonly=no], + [cf_cv_link_dataonly=unknown]) + LIBS="$cf_saveLIBS" + ]) +AC_MSG_RESULT($cf_cv_link_dataonly) + +if test "$cf_cv_link_dataonly" = no ; then + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 +fi + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LINK_FUNCS version: 7 updated: 2006/12/16 12:33:30 +dnl ------------- +dnl Most Unix systems have both link and symlink, a few don't have symlink. +dnl A few non-Unix systems implement symlink, but not link. +dnl A few non-systems implement neither (or have nonfunctional versions). +AC_DEFUN([CF_LINK_FUNCS], +[ +AC_CHECK_FUNCS( \ + remove \ + unlink ) + +if test "$cross_compiling" = yes ; then + AC_CHECK_FUNCS( \ + link \ + symlink ) +else + AC_CACHE_CHECK(if link/symlink functions work,cf_cv_link_funcs,[ + cf_cv_link_funcs= + for cf_func in link symlink ; do + AC_TRY_RUN([ +#include +#include +#ifdef HAVE_UNISTD_H +#include +#endif +int main() +{ + int fail = 0; + char *src = "config.log"; + char *dst = "conftest.chk"; + struct stat src_sb; + struct stat dst_sb; + + stat(src, &src_sb); + fail = ($cf_func("config.log", "conftest.chk") < 0) + || (stat(dst, &dst_sb) < 0) + || (dst_sb.st_mtime != src_sb.st_mtime); +#ifdef HAVE_UNLINK + unlink(dst); +#else + remove(dst); +#endif + ${cf_cv_main_return:-return} (fail); +} + ],[ + cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" + eval 'ac_cv_func_'$cf_func'=yes'],[ + eval 'ac_cv_func_'$cf_func'=no'],[ + eval 'ac_cv_func_'$cf_func'=error']) + done + test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no + ]) + test "$ac_cv_func_link" = yes && AC_DEFINE(HAVE_LINK) + test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MAIN_RETURN version: 1 updated: 2006/12/10 09:51:54 +dnl -------------- +dnl Check if a return from main to the shell actually returns the same exit +dnl code. This is true for almost any POSIX environment. +dnl +dnl Some very old environments did not flush stdout, etc., on an exit. That +dnl would be a useful case to test for also. +AC_DEFUN([CF_MAIN_RETURN], +[ +cf_cv_main_return=return +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MAKEFLAGS version: 13 updated: 2010/10/23 15:52:32 +dnl ------------ +dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' +dnl options to lower-levels. It's very useful for "make -n" -- if we have it. +dnl (GNU 'make' does both, something POSIX 'make', which happens to make the +dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) +AC_DEFUN([CF_MAKEFLAGS], +[ +AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ + cf_cv_makeflags='' + for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' + do + cat >cf_makeflags.tmp </dev/null | sed -e 's,[[ ]]*$,,'` + case "$cf_result" in + .*k) + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + case "$cf_result" in + .*CC=*) cf_cv_makeflags= + ;; + *) cf_cv_makeflags=$cf_option + ;; + esac + break + ;; + .-) ;; + *) echo "given option \"$cf_option\", no match \"$cf_result\"" + ;; + esac + done + rm -f cf_makeflags.tmp +]) + +AC_SUBST(cf_cv_makeflags) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 +dnl ------------ +dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have +dnl a monocase filesystem. +AC_DEFUN([CF_MAKE_TAGS],[ +AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) + +AC_CHECK_PROGS(CTAGS, exctags ctags) +AC_CHECK_PROGS(ETAGS, exetags etags) + +AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) + +if test "$cf_cv_mixedcase" = yes ; then + AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +else + MAKE_UPPER_TAGS="#" +fi + +if test "$MAKE_LOWER_TAGS" = yes ; then + MAKE_LOWER_TAGS= +else + MAKE_LOWER_TAGS="#" +fi + +AC_SUBST(CTAGS) +AC_SUBST(ETAGS) + +AC_SUBST(MAKE_UPPER_TAGS) +AC_SUBST(MAKE_LOWER_TAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55 +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. +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*|*-mingw32*|*-uwin*) #(vi + cf_cv_mixedcase=no + ;; + *) + cf_cv_mixedcase=yes + ;; + esac +else + rm -f conftest CONFTEST + echo test >conftest + if test -f CONFTEST ; then + cf_cv_mixedcase=no + else + cf_cv_mixedcase=yes + fi + rm -f conftest CONFTEST +fi +]) +test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37 +dnl ---------- +dnl Check for a working mkstemp. This creates two files, checks that they are +dnl successfully created and distinct (AmigaOS apparently fails on the last). +AC_DEFUN([CF_MKSTEMP],[ +AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ +rm -rf conftest* +AC_TRY_RUN([ +#include +#include +#include +#include +#include +int main() +{ + char *tmpl = "conftestXXXXXX"; + char name[2][80]; + int n; + int result = 0; + int fd; + struct stat sb; + + umask(077); + for (n = 0; n < 2; ++n) { + strcpy(name[n], tmpl); + if ((fd = mkstemp(name[n])) >= 0) { + if (!strcmp(name[n], tmpl) + || stat(name[n], &sb) != 0 + || (sb.st_mode & S_IFMT) != S_IFREG + || (sb.st_mode & 077) != 0) { + result = 1; + } + close(fd); + } + } + if (result == 0 + && !strcmp(name[0], name[1])) + result = 1; + ${cf_cv_main_return:-return}(result); +} +],[cf_cv_func_mkstemp=yes +],[cf_cv_func_mkstemp=no +],[AC_CHECK_FUNC(mkstemp) +]) +]) +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then + AC_DEFINE(HAVE_MKSTEMP) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 +dnl ---------- +dnl Write a debug message to config.log, along with the line number in the +dnl configure script. +AC_DEFUN([CF_MSG_LOG],[ +echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_ADDON version: 3 updated: 2010/10/23 15:54:49 +dnl ---------------- +dnl Configure an ncurses add-on, built outside the ncurses tree. +AC_DEFUN([CF_NCURSES_ADDON],[ + +AC_PROVIDE([CF_SUBST_NCURSES_VERSION]) + +AC_MSG_CHECKING(if you want wide-character code) +AC_ARG_ENABLE(widec, + [ --enable-widec compile with wide-char/UTF-8 code], + [with_widec=$enableval], + [with_widec=no]) +AC_MSG_RESULT($with_widec) +if test "$with_widec" = yes ; then + CF_UTF8_LIB + CF_NCURSES_CONFIG(ncursesw) +else + CF_NCURSES_CONFIG(ncurses) +fi + +if test "$NCURSES_CONFIG" != none ; then + +cf_version=`$NCURSES_CONFIG --version` + +NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` +NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.//' -e 's/\..*//'` +NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.[[0-9]]\+\.//'` + +# ABI version is not available from headers +cf_cv_abi_version=`$NCURSES_CONFIG --abi-version` + +else + +for cf_name in MAJOR MINOR PATCH +do +cat >conftest.$ac_ext < +AUTOCONF_$cf_name NCURSES_VERSION_$cf_name +CF_EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out" + AC_TRY_EVAL(cf_try) + if test -f conftest.out ; then + cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ ]]\+//"` + eval NCURSES_$cf_name=$cf_result + cat conftest.$ac_ext + cat conftest.out + fi +done + +cf_cv_abi_version=${NCURSES_MAJOR} + +fi + +cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} + +dnl Show the computed version, for logging +cf_cv_timestamp=`date` + +AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)) + +dnl We need these values in the generated headers +AC_SUBST(NCURSES_MAJOR) +AC_SUBST(NCURSES_MINOR) +AC_SUBST(NCURSES_PATCH) + +dnl We need these values in the generated makefiles +AC_SUBST(cf_cv_rel_version) +AC_SUBST(cf_cv_abi_version) + +dnl FIXME - not needed for Ada95 +AC_SUBST(cf_cv_builtin_bool) +AC_SUBST(cf_cv_header_stdbool_h) +AC_SUBST(cf_cv_type_of_bool)dnl + +]) +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 +dnl ------------------- +dnl Check if we can compile with ncurses' header file +dnl $1 is the cache variable to set +dnl $2 is the header-file to include +dnl $3 is the root name (ncurses or ncursesw) +AC_DEFUN([CF_NCURSES_CC_CHECK],[ + AC_TRY_COMPILE([ +]ifelse($3,ncursesw,[ +#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 <$2>],[ +#ifdef NCURSES_VERSION +]ifelse($3,ncursesw,[ +#ifndef WACS_BSSB + make an error +#endif +])[ +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + ] + ,[$1=$2] + ,[$1=no]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30 +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 +dnl $1 is the root library name (default: "ncurses") +AC_DEFUN([CF_NCURSES_CONFIG], +[ +cf_ncuconfig_root=ifelse($1,,ncurses,$1) + +echo "Looking for ${cf_ncuconfig_root}-config" +AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none) + +if test "$NCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$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) + +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 +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38 +dnl ------------------- +dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting +dnl the CPPFLAGS variable so we can include its header. +dnl +dnl The header files may be installed as either curses.h, or ncurses.h (would +dnl be obsolete, except that some packagers prefer this name to distinguish it +dnl from a "native" curses implementation). If not installed for overwrite, +dnl the curses.h file would be in an ncurses subdirectory (e.g., +dnl /usr/include/ncurses), but someone may have installed overwriting the +dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd +dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in +dnl the header. +dnl +dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header +dnl is already in the include-path, don't even bother with this, since we cannot +dnl easily determine which file it is. In this case, it has to be . +dnl +dnl The optional parameter gives the root name of the library, in case it is +dnl not installed as the default curses library. That is how the +dnl wide-character version of ncurses is installed. +AC_DEFUN([CF_NCURSES_CPPFLAGS], +[AC_REQUIRE([CF_WITH_CURSES_DIR]) + +AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl +cf_ncuhdr_root=ifelse($1,,ncurses,$1) + +test -n "$cf_cv_curses_dir" && \ +test "$cf_cv_curses_dir" != "no" && { \ + CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) +} + +AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ + cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" + ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" + for cf_header in $cf_header_list + do + CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) + test "$cf_cv_ncurses_h" != no && break + done +]) + +CF_NCURSES_HEADER +CF_TERM_HEADER + +# some applications need this, but should check for NCURSES_VERSION +AC_DEFINE(NCURSES) + +CF_NCURSES_VERSION +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54 +dnl ----------------- +dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common +dnl variations of ncurses' installs. +dnl +dnl See also CF_CURSES_HEADER, which sets the same cache variable. +AC_DEFUN([CF_NCURSES_HEADER],[ + +if test "$cf_cv_ncurses_h" != no ; then + cf_cv_ncurses_header=$cf_cv_ncurses_h +else + +AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ + test -n "$verbose" && echo + CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) + test -n "$verbose" && echo search path $cf_search + cf_save2_CPPFLAGS="$CPPFLAGS" + for cf_incdir in $cf_search + do + CF_ADD_INCDIR($cf_incdir) + for cf_header in \ + ncurses.h \ + curses.h + do + CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) + if test "$cf_cv_ncurses_h2" != no ; then + cf_cv_ncurses_h2=$cf_incdir/$cf_header + test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG + break + fi + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG + done + CPPFLAGS="$cf_save2_CPPFLAGS" + test "$cf_cv_ncurses_h2" != no && break + done + test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) + ]) + + CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) + cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` + if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then + cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header + fi + CF_ADD_INCDIR($cf_1st_incdir) + +fi + +# Set definitions to allow ifdef'ing for ncurses.h + +case $cf_cv_ncurses_header in # (vi +*ncurses.h) + AC_DEFINE(HAVE_NCURSES_H) + ;; +esac + +case $cf_cv_ncurses_header in # (vi +ncurses/curses.h|ncurses/ncurses.h) + AC_DEFINE(HAVE_NCURSES_NCURSES_H) + ;; +ncursesw/curses.h|ncursesw/ncurses.h) + AC_DEFINE(HAVE_NCURSESW_NCURSES_H) + ;; +esac + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38 +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. +dnl Some distributions have gpm linked with (bsd) curses, which makes it +dnl unusable with ncurses. However, we don't want to link with gpm unless +dnl ncurses has a dependency, since gpm is normally set up as a shared library, +dnl and the linker will record a dependency. +dnl +dnl The optional parameter gives the root name of the library, in case it is +dnl not installed as the default curses library. That is how the +dnl wide-character version of ncurses is installed. +AC_DEFUN([CF_NCURSES_LIBS], +[AC_REQUIRE([CF_NCURSES_CPPFLAGS]) + +cf_nculib_root=ifelse($1,,ncurses,$1) + # 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" +AC_CHECK_LIB(gpm,Gpm_Open, + [AC_CHECK_LIB(gpm,initscr, + [LIBS="$cf_ncurses_SAVE"], + [cf_ncurses_LIBS="-lgpm"])]) + +case $host_os in #(vi +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 + AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) + fi + ;; +esac + +CF_ADD_LIBS($cf_ncurses_LIBS) + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + CF_ADD_LIBS(-l$cf_nculib_root) +else + CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, + [#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr()], + initscr) +fi + +if test -n "$cf_ncurses_LIBS" ; then + AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) + cf_ncurses_SAVE="$LIBS" + for p in $cf_ncurses_LIBS ; do + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + LIBS="$cf_ncurses_SAVE"]) +fi + +CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) +AC_DEFINE_UNQUOTED($cf_nculib_ROOT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49 +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 +dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. +AC_DEFUN([CF_NCURSES_VERSION], +[ +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + AC_TRY_RUN([ +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +}],[ + cf_cv_ncurses_version=`cat $cf_tempfile`],,[ + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" + AC_TRY_EVAL(cf_try) + if test -f conftest.out ; then + cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi +]) + rm -f $cf_tempfile +]) +test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 +dnl ------------------ +dnl see CF_WITH_NO_LEAKS +AC_DEFUN([CF_NO_LEAKS_OPTION],[ +AC_MSG_CHECKING(if you want to use $1 for testing) +AC_ARG_WITH($1, + [$2], + [AC_DEFINE($3)ifelse([$4],,[ + $4 +]) + : ${with_cflags:=-g} + : ${with_no_leaks:=yes} + with_$1=yes], + [with_$1=]) +AC_MSG_RESULT(${with_$1:-no}) + +case .$with_cflags in #(vi +.*-g*) + case .$CFLAGS in #(vi + .*-g*) #(vi + ;; + *) + CF_ADD_CFLAGS([-g]) + ;; + esac + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NUMBER_SYNTAX version: 1 updated: 2003/09/20 18:12:49 +dnl ---------------- +dnl Check if the given variable is a number. If not, report an error. +dnl $1 is the variable +dnl $2 is the message +AC_DEFUN([CF_NUMBER_SYNTAX],[ +if test -n "$1" ; then + case $1 in #(vi + [[0-9]]*) #(vi + ;; + *) + AC_MSG_ERROR($2 is not a number: $1) + ;; + esac +else + AC_MSG_ERROR($2 value is empty) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_OBJ_SUBDIR version: 4 updated: 2002/02/23 20:38:31 +dnl ------------- +dnl Compute the object-directory name from the given model name +AC_DEFUN([CF_OBJ_SUBDIR], +[ + case $1 in + libtool) $2='obj_lo' ;; + normal) $2='objects' ;; + debug) $2='obj_g' ;; + profile) $2='obj_p' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + $2='objects' ;; + *) + $2='obj_s' ;; + esac + esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42 +dnl ---------- +dnl Provide a value for the $PATH and similar separator +AC_DEFUN([CF_PATHSEP], +[ + case $cf_cv_system_name in + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; + esac +ifelse([$1],,,[$1=$PATH_SEPARATOR]) + AC_SUBST(PATH_SEPARATOR) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 +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 +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" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".[$]$1" in #(vi +.\[$]\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX + ;; +.\[$]{*prefix}*) #(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) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09 +dnl ------------- +dnl Check for the package-config program, unless disabled by command-line. +AC_DEFUN([CF_PKG_CONFIG], +[ +AC_MSG_CHECKING(if you want to use pkg-config) +AC_ARG_WITH(pkg-config, + [ --with-pkg-config{=path} enable/disable use of pkg-config], + [cf_pkg_config=$withval], + [cf_pkg_config=yes]) +AC_MSG_RESULT($cf_pkg_config) + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + AC_PATH_PROG(PKG_CONFIG, pkg-config, none) + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + CF_PATH_SYNTAX(PKG_CONFIG) +fi + +AC_SUBST(PKG_CONFIG) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 +dnl ----------------- +dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. +dnl +dnl POSIX.1-1990 _POSIX_SOURCE +dnl POSIX.1-1990 and _POSIX_SOURCE and +dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 +dnl Bindings Option +dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L +dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L +dnl X/Open 2000 _POSIX_C_SOURCE=200112L +dnl +dnl Parameters: +dnl $1 is the nominal value for _POSIX_C_SOURCE +AC_DEFUN([CF_POSIX_C_SOURCE], +[ +cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) + +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" + +CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) +CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) + +AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ + CF_MSG_LOG(if the symbol is already defined go no further) + AC_TRY_COMPILE([#include ],[ +#ifndef _POSIX_C_SOURCE +make an error +#endif], + [cf_cv_posix_c_source=no], + [cf_want_posix_source=no + case .$cf_POSIX_C_SOURCE in #(vi + .[[12]]??*) #(vi + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" + ;; + .2) #(vi + 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 + AC_TRY_COMPILE([#include ],[ +#ifdef _POSIX_SOURCE +make an error +#endif],[], + cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") + fi + CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CF_MSG_LOG(if the second compile does not leave our definition intact error) + AC_TRY_COMPILE([#include ],[ +#ifndef _POSIX_C_SOURCE +make an error +#endif],, + [cf_cv_posix_c_source=no]) + CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" + ]) +]) + +if test "$cf_cv_posix_c_source" != no ; then + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS" + CF_ADD_CFLAGS($cf_cv_posix_c_source) +fi + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 +dnl ---------- +dnl Check for archiver "ar". +AC_DEFUN([CF_PROG_AR],[ +AC_CHECK_TOOL(AR, ar, ar) +]) +dnl --------------------------------------------------------------------------- +dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 +dnl ----------- +dnl Check for awk, ensure that the check found something. +AC_DEFUN([CF_PROG_AWK], +[ +AC_PROG_AWK +test -z "$AWK" && AC_MSG_ERROR(No awk program found) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37 +dnl -------------- +dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that +dnl the output file can be renamed, and allows for a shell variable that can +dnl be used later. The parameter is either CC or CXX. The result is the +dnl cache variable: +dnl $cf_cv_prog_CC_c_o +dnl $cf_cv_prog_CXX_c_o +AC_DEFUN([CF_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_MSG_CHECKING([whether [$]$1 understands -c and -o together]) +AC_CACHE_VAL(cf_cv_prog_$1_c_o, +[ +cat > conftest.$ac_ext < +int main() +{ + ${cf_cv_main_return:-return}(0); +} +CF_EOF +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='[$]$1 -c conftest.$ac_ext -o conftest2.$ac_objext >&AC_FD_CC' +if AC_TRY_EVAL(ac_try) && + test -f conftest2.$ac_objext && AC_TRY_EVAL(ac_try); +then + eval cf_cv_prog_$1_c_o=yes +else + eval cf_cv_prog_$1_c_o=no +fi +rm -rf conftest* +])dnl +if test $cf_cv_prog_$1_c_o = yes; then + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_EGREP version: 1 updated: 2006/09/16 11:40:59 +dnl ------------- +dnl AC_PROG_EGREP was introduced in autoconf 2.53. +dnl This macro adds a check to ensure the script found something. +AC_DEFUN([CF_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +test -z "$EGREP" && AC_MSG_ERROR(No egrep program found) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 +dnl ----------- +dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. +AC_DEFUN([CF_PROG_EXT], +[ +AC_REQUIRE([CF_CHECK_CACHE]) +case $cf_cv_system_name in +os2*) + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" + # autoconf's macro sets -Zexe and suffix both, which conflict:w + LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" + ac_cv_exeext=.exe + ;; +esac + +AC_EXEEXT +AC_OBJEXT + +PROG_EXT="$EXEEXT" +AC_SUBST(PROG_EXT) +test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 +dnl ------------ +dnl Check for gnatmake, ensure that it is complete. +AC_DEFUN([CF_PROG_GNAT],[ +cf_ada_make=gnatmake +AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= +else + CF_GNAT_VERSION + AC_CHECK_PROG(M4_exists, m4, yes, no) + if test "$ac_cv_prog_M4_exists" = no; then + cf_cv_prog_gnat_correct=no + echo Ada95 binding required program m4 not found. Ada95 binding disabled. + fi + if test "$cf_cv_prog_gnat_correct" = yes; then + AC_MSG_CHECKING(if GNAT works) + CF_GNAT_TRY_RUN([procedure conftest;], +[with Text_IO; +with GNAT.OS_Lib; +procedure conftest is +begin + Text_IO.Put ("Hello World"); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (0); +end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) + AC_MSG_RESULT($cf_cv_prog_gnat_correct) + fi +fi + +AC_SUBST(cf_ada_make) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 +dnl ------------ +dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" +dnl option if it is supported. +AC_DEFUN([CF_PROG_LN_S],[ +AC_PROG_LN_S +AC_MSG_CHECKING(if $LN_S -f options work) + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +AC_MSG_RESULT($cf_prog_ln_sf) + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 +dnl ---------------- +dnl Remove all -U and -D options that refer to the given symbol from a list +dnl of C compiler options. This works around the problem that not all +dnl compilers process -U and -D options from left-to-right, so a -U option +dnl cannot be used to cancel the effect of a preceding -D option. +dnl +dnl $1 = target (which could be the same as the source variable) +dnl $2 = source (including '$') +dnl $3 = symbol to remove +define([CF_REMOVE_DEFINE], +[ +$1=`echo "$2" | \ + sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 +dnl ------------- +dnl Remove the given library from the symbol +dnl +dnl $1 = target (which could be the same as the source variable) +dnl $2 = source (including '$') +dnl $3 = library to remove +define([CF_REMOVE_LIB], +[ +# remove $3 library from $2 +$1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16 +dnl -------------- +dnl -------------- +dnl Attempt to determine the appropriate CC/LD options for creating a shared +dnl library. +dnl +dnl Note: ${LOCAL_LDFLAGS} is used to link executables that will run within the +dnl build-tree, i.e., by making use of the libraries that are compiled in ../lib +dnl We avoid compiling-in a ../lib path for the shared library since that can +dnl lead to unexpected results at runtime. +dnl ${LOCAL_LDFLAGS2} has the same intention but assumes that the shared libraries +dnl are compiled in ../../lib +dnl +dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure +dnl to install symbolic links to the rel/abi versions of shared libraries. +dnl +dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi +dnl version when making symbolic links. +dnl +dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library +dnl version numbers are infix (ex: libncurses..dylib) or postfix +dnl (ex: libncurses.so.). +dnl +dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. +AC_DEFUN([CF_SHARED_OPTS], +[ + AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + AC_REQUIRE([CF_LD_RPATH_OPT]) + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= + LD_SHARED_OPTS= + INSTALL_LIB="-m 644" + + cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" + + AC_MSG_CHECKING(if release/abi version should be used for shared libs) + AC_ARG_WITH(shlib-version, + [ --with-shlib-version=X Specify rel or abi version for shared libs], + [test -z "$withval" && withval=auto + case $withval in #(vi + yes) #(vi + cf_cv_shlib_version=auto + ;; + rel|abi|auto|no) #(vi + cf_cv_shlib_version=$withval + ;; + *) + AC_MSG_ERROR([option value must be one of: rel, abi, auto or no]) + ;; + esac + ],[cf_cv_shlib_version=auto]) + AC_MSG_RESULT($cf_cv_shlib_version) + + cf_cv_rm_so_locs=no + + # Some less-capable ports of gcc support only -fpic + CC_SHARED_OPTS= + if test "$GCC" = yes + then + AC_MSG_CHECKING(which $CC option to use) + cf_save_CFLAGS="$CFLAGS" + for CC_SHARED_OPTS in -fPIC -fpic '' + do + CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" + AC_TRY_COMPILE([#include ],[int x = 1],[break],[]) + done + AC_MSG_RESULT($CC_SHARED_OPTS) + CFLAGS="$cf_save_CFLAGS" + fi + + cf_cv_shlib_version_infix=no + + case $cf_cv_system_name in #(vi + aix[[56]]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi + MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' + ;; + cygwin*) #(vi + CC_SHARED_OPTS= + MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + cat >mk_shared_lib.sh <<-CF_EOF + #!/bin/sh + SHARED_LIB=\[$]1 + IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` + shift + cat <<-EOF + Linking shared library + ** SHARED_LIB \[$]SHARED_LIB + ** IMPORT_LIB \[$]IMPORT_LIB +EOF + exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} +CF_EOF + chmod +x mk_shared_lib.sh + ;; + darwin*) #(vi + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi + cf_cv_shlib_version_infix=yes + AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [ + cf_save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no) + LDFLAGS=$cf_save_LDFLAGS]) + if test $cf_cv_ldflags_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + ;; + hpux*) #(vi + # (tested with gcc 2.7.2 -- I don't have c89) + if test "$GCC" = yes; then + LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' + else + CC_SHARED_OPTS='+Z' + LD_SHARED_OPTS='-Wl,+b,${libdir}' + fi + MK_SHARED_LIB='${LD} +b ${libdir} -b -o $[@]' + # HP-UX shared libraries must be executable, and should be + # readonly to exploit a quirk in the memory manager. + INSTALL_LIB="-m 555" + ;; + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + # tested with IRIX 5.2 and 'cc'. + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]' + else + MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $[@]` -o $[@]' + fi + cf_cv_rm_so_locs=yes + ;; + linux*|gnu*|k*bsd*-gnu) #(vi + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + CF_SHARED_SONAME + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + ;; + openbsd[[2-9]].*) #(vi + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + CF_SHARED_SONAME + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + ;; + nto-qnx*|openbsd*|freebsd[[12]].*) #(vi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + MK_SHARED_LIB='${LD} -Bshareable -o $[@]' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + freebsd*) #(vi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + CF_SHARED_SONAME + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]' + ;; + netbsd*) #(vi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_shlib_version" = auto; then + if test -f /usr/libexec/ld.elf_so; then + cf_cv_shlib_version=abi + else + cf_cv_shlib_version=rel + fi + fi + CF_SHARED_SONAME + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' + else + MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]' + fi + ;; + osf*|mls+*) #(vi + # tested with OSF/1 V3.2 and 'cc' + # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't + # link with shared libs). + MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`' + case $host_os in #(vi + osf4*) + MK_SHARED_LIB="${MK_SHARED_LIB} -msym" + ;; + esac + MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + cf_cv_rm_so_locs=yes + ;; + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 + # tested with osr5.0.5 + if test "$GCC" != yes; then + CC_SHARED_OPTS='-belf -KPIC' + fi + MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@' + if test "$cf_cv_enable_rpath" = yes ; then + # only way is to set LD_RUN_PATH but no switch for it + RUN_PATH=$libdir + fi + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + LINK_PROGS='LD_RUN_PATH=${libdir}' + LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' + ;; + sunos4*) #(vi + # tested with SunOS 4.1.1 and gcc 2.7.0 + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='${LD} -assert pure-text -o $[@]' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + solaris2*) #(vi + # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 + # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" + fi + CF_SHARED_SONAME + if test "$GCC" != yes; then + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break]) + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts + MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' + else + MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' + fi + ;; + sysv5uw7*|unix_sv*) #(vi + # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='${LD} -d y -G -o [$]@' + ;; + *) + CC_SHARED_OPTS='unknown' + MK_SHARED_LIB='echo unknown' + ;; + esac + + # This works if the last tokens in $MK_SHARED_LIB are the -o target. + case "$cf_cv_shlib_version" in #(vi + rel|abi) + case "$MK_SHARED_LIB" in #(vi + *'-o $[@]') #(vi + test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes + ;; + *) + AC_MSG_WARN(ignored --with-shlib-version) + ;; + esac + ;; + esac + + if test -n "$cf_ld_rpath_opt" ; then + MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" + fi + + AC_SUBST(CC_SHARED_OPTS) + AC_SUBST(LD_RPATH_OPT) + AC_SUBST(LD_SHARED_OPTS) + AC_SUBST(MK_SHARED_LIB) + AC_SUBST(LINK_PROGS) + AC_SUBST(LINK_TESTS) + AC_SUBST(EXTRA_LDFLAGS) + AC_SUBST(LOCAL_LDFLAGS) + AC_SUBST(LOCAL_LDFLAGS2) + AC_SUBST(INSTALL_LIB) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43 +dnl ---------------- +dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for +dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar) +dnl option. +dnl +dnl $1 is the default that should be used for "$cf_cv_shlib_version". +dnl If missing, use "rel". +define([CF_SHARED_SONAME], +[ + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1) + if test "$cf_cv_shlib_version" = rel; then + cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}' + else + cf_cv_shared_soname='`basename $[@]`' + fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52 +dnl -------------- +dnl Remove "-g" option from the compiler options +AC_DEFUN([CF_STRIP_G_OPT], +[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 +dnl -------------- +dnl Construct a search-list for a nonstandard header/lib-file +dnl $1 = the variable to return as result +dnl $2 = the package name +dnl $3 = the subdirectory, e.g., bin, include or lib +AC_DEFUN([CF_SUBDIR_PATH], +[ +$1= + +CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) +CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03 +dnl -------- +dnl Shorthand macro for substituting things that the user may override +dnl with an environment variable. +dnl +dnl $1 = long/descriptive name +dnl $2 = environment variable +dnl $3 = default value +AC_DEFUN([CF_SUBST], +[AC_CACHE_VAL(cf_cv_subst_$2,[ +AC_MSG_CHECKING(for $1 (symbol $2)) +CF_SUBST_IF([-z "[$]$2"], [$2], [$3]) +cf_cv_subst_$2=[$]$2 +AC_MSG_RESULT([$]$2) +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49 +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 + 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 +AC_TRY_COMPILE([#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> +],[int x = auto_left_margin],[ + cf_cv_term_header="$cf_test"],[ + cf_cv_term_header=unknown + ]) + test "$cf_cv_term_header" != unknown && break +done +]) + +# Set definitions to allow ifdef'ing to accommodate subdirectories + +case $cf_cv_term_header in # (vi +*term.h) + AC_DEFINE(HAVE_TERM_H) + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + AC_DEFINE(HAVE_NCURSES_TERM_H) + ;; +ncursesw/term.h) + AC_DEFINE(HAVE_NCURSESW_TERM_H) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_TOP_BUILDDIR version: 1 updated: 2006/10/15 16:33:23 +dnl --------------- +dnl Define a top_builddir symbol, for applications that need an absolute path. +AC_DEFUN([CF_TOP_BUILDDIR], +[ +top_builddir=`pwd` +AC_SUBST(top_builddir) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 +dnl -------- +dnl Make an uppercase version of a variable +dnl $1=uppercase($2) +AC_DEFUN([CF_UPPER], +[ +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 +dnl ----------- +dnl Check for multibyte support, and if not found, utf8 compatibility library +AC_DEFUN([CF_UTF8_LIB], +[ +AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ + cf_save_LIBS="$LIBS" + AC_TRY_LINK([ +#include ],[putwc(0,0);], + [cf_cv_utf8_lib=yes], + [CF_FIND_LINKAGE([ +#include ],[putwc(0,0);],utf8, + [cf_cv_utf8_lib=add-on], + [cf_cv_utf8_lib=no]) +])]) + +# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between +# ncurses/ncursesw: +if test "$cf_cv_utf8_lib" = "add-on" ; then + AC_DEFINE(HAVE_LIBUTF8_H) + CF_ADD_INCDIR($cf_cv_header_path_utf8) + CF_ADD_LIBDIR($cf_cv_library_path_utf8) + CF_ADD_LIBS($cf_cv_library_file_utf8) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 +dnl ---------- +dnl Use AC_VERBOSE w/o the warnings +AC_DEFUN([CF_VERBOSE], +[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG +CF_MSG_LOG([$1]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WEAK_SYMBOLS version: 1 updated: 2008/08/16 19:18:06 +dnl --------------- +dnl Check for compiler-support for weak symbols. +dnl This works with "recent" gcc. +AC_DEFUN([CF_WEAK_SYMBOLS],[ +AC_CACHE_CHECK(if $CC supports weak symbols,cf_cv_weak_symbols,[ + +AC_TRY_COMPILE([ +#include ], +[ +#if defined(__GNUC__) +# if defined __USE_ISOC99 +# define _cat_pragma(exp) _Pragma(#exp) +# define _weak_pragma(exp) _cat_pragma(weak name) +# else +# define _weak_pragma(exp) +# endif +# define _declare(name) __extension__ extern __typeof__(name) name +# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) +#endif + +weak_symbol(fopen); +],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no]) +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 +dnl -------------------- +dnl Command-line option to specify the Ada95 compiler. +AC_DEFUN([CF_WITH_ADA_COMPILER],[ +AC_MSG_CHECKING(for ada-compiler) +AC_ARG_WITH(ada-compiler, + [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], + [cf_ada_compiler=$withval], + [cf_ada_compiler=gnatmake]) +AC_SUBST(cf_ada_compiler) +AC_MSG_RESULT($cf_ada_compiler) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada includes will install. +AC_DEFUN([CF_WITH_ADA_INCLUDE],[ +AC_MSG_CHECKING(for ada-include) +CF_WITH_PATH(ada-include, + [ --with-ada-include=DIR Ada includes are in DIR], + ADA_INCLUDE, + PREFIX/share/ada/adainclude, + [$]prefix/share/ada/adainclude) +AC_SUBST(ADA_INCLUDE) +AC_MSG_RESULT($ADA_INCLUDE) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada objects will install. +AC_DEFUN([CF_WITH_ADA_OBJECTS],[ +AC_MSG_CHECKING(for ada-objects) +CF_WITH_PATH(ada-objects, + [ --with-ada-objects=DIR Ada objects are in DIR], + ADA_OBJECTS, + PREFIX/lib/ada/adalib, + [$]prefix/lib/ada/adalib) +AC_SUBST(ADA_OBJECTS) +AC_MSG_RESULT($ADA_OBJECTS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58 +dnl --------------------- +dnl Command-line option to specify if an Ada95 shared-library should be built, +dnl and optionally what its soname should be. +AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ +AC_MSG_CHECKING(if an Ada95 shared-library should be built) +AC_ARG_WITH(ada-sharedlib, + [ --with-ada-sharedlib=XX build Ada95 shared-library], + [with_ada_sharedlib=$withval], + [with_ada_sharedlib=no]) +AC_MSG_RESULT($with_ada_sharedlib) + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + +AC_SUBST(ADA_SHAREDLIB) +AC_SUBST(MAKE_ADA_SHAREDLIB) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38 +dnl ------------------ +dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses +dnl libraries. +AC_DEFUN([CF_WITH_CURSES_DIR],[ + +AC_MSG_CHECKING(for specific curses-directory) +AC_ARG_WITH(curses-dir, + [ --with-curses-dir=DIR directory in which (n)curses is installed], + [cf_cv_curses_dir=$withval], + [cf_cv_curses_dir=no]) +AC_MSG_RESULT($cf_cv_curses_dir) + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + CF_PATH_SYNTAX(withval) + if test -d "$cf_cv_curses_dir" + then + CF_ADD_INCDIR($cf_cv_curses_dir/include) + CF_ADD_LIBDIR($cf_cv_curses_dir/lib) + fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 +dnl ------------ +dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just +dnl defaulting to yes/no. +dnl +dnl $1 = option name +dnl $2 = help-text +dnl $3 = environment variable to set +dnl $4 = default value, shown in the help-message, must be a constant +dnl $5 = default value, if it's an expression & cannot be in the help-message +dnl +AC_DEFUN([CF_WITH_PATH], +[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, +ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl +if ifelse([$5],,true,[test -n "$5"]) ; then +CF_PATH_SYNTAX(withval) +fi +$3="$withval" +AC_SUBST($3)dnl +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02 +dnl --------------- +dnl Check for POSIX thread library. +AC_DEFUN([CF_WITH_PTHREAD], +[ +AC_MSG_CHECKING(if you want to link with the pthread library) +AC_ARG_WITH(pthread, + [ --with-pthread use POSIX thread library], + [with_pthread=$withval], + [with_pthread=no]) +AC_MSG_RESULT($with_pthread) + +if test "$with_pthread" != no ; then + AC_CHECK_HEADER(pthread.h,[ + AC_DEFINE(HAVE_PTHREADS_H) + + AC_MSG_CHECKING(if we can link with the pthread library) + cf_save_LIBS="$LIBS" + CF_ADD_LIB(pthread) + AC_TRY_LINK([ +#include +],[ + int rc = pthread_create(0,0,0,0); +],[with_pthread=yes],[with_pthread=no]) + LIBS="$cf_save_LIBS" + AC_MSG_RESULT($with_pthread) + + if test "$with_pthread" = yes ; then + CF_ADD_LIB(pthread) + AC_DEFINE(HAVE_LIBPTHREADS) + else + AC_MSG_ERROR(Cannot link with pthread library) + fi + ]) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 +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, +dnl without losing the common non-POSIX features. +dnl +dnl Parameters: +dnl $1 is the nominal value for _XOPEN_SOURCE +dnl $2 is the nominal value for _POSIX_C_SOURCE +AC_DEFUN([CF_XOPEN_SOURCE],[ + +cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) +cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) +cf_xopen_source= + +case $host_os in #(vi +aix[[456]]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +darwin[[0-8]].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" + ;; +freebsd*|dragonfly*) #(vi + # 5.x headers associate + # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L + # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L + cf_POSIX_C_SOURCE=200112L + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + ;; +hpux*) #(vi + cf_xopen_source="-D_HPUX_SOURCE" + ;; +irix[[56]].*) #(vi + cf_xopen_source="-D_SGI_SOURCE" + ;; +linux*|gnu*|mint*|k*bsd*-gnu) #(vi + CF_GNU_SOURCE + ;; +mirbsd*) #(vi + # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks + ;; +netbsd*) #(vi + # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + ;; +openbsd*) #(vi + # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw + ;; +osf[[45]]*) #(vi + cf_xopen_source="-D_OSF_SOURCE" + ;; +nto-qnx*) #(vi + cf_xopen_source="-D_QNX_SOURCE" + ;; +sco*) #(vi + # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer + ;; +solaris2.1[[0-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[[1-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__" + ;; +*) + AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ + AC_TRY_COMPILE([#include ],[ +#ifndef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_xopen_source=no], + [cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + AC_TRY_COMPILE([#include ],[ +#ifdef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_xopen_source=no], + [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) + CPPFLAGS="$cf_save" + ]) +]) + if test "$cf_cv_xopen_source" != no ; then + CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) + CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_ADD_CFLAGS($cf_temp_xopen_source) + fi + CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) + ;; +esac + +if test -n "$cf_xopen_source" ; then + CF_ADD_CFLAGS($cf_xopen_source) +fi +]) diff --git a/Ada95/configure b/Ada95/configure new file mode 100755 index 00000000000..f35d349a475 --- /dev/null +++ b/Ada95/configure @@ -0,0 +1,12189 @@ +#! /bin/sh +# From configure.in Revision: 1.21 . +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52.20101001. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="gen/gen.c" + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:882: 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" + fi +done + +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:893: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:901: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:917: 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:921: 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:927: 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:929: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:931: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:950: 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:952: 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 + +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 + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:973: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:976: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin" + +top_builddir=`pwd` + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:1006: 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 +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +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:1016: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1020: 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 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:1029: 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:1033: 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:1038: 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/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1045: 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 +else + ac_cv_host_alias=$host_alias +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:1054: 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:1059: 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/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then + echo "$as_me:1067: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:1076: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1081: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + system_name="$host_os" +else + system_name="`(uname -s -r) 2>/dev/null`" + if test -z "$system_name" ; then + system_name="`(hostname) 2>/dev/null`" + fi +fi +test -n "$system_name" && cat >>confdefs.h <&6 +else + cf_cv_system_name="$system_name" +fi + +test -z "$system_name" && system_name="$cf_cv_system_name" +test -n "$cf_cv_system_name" && echo "$as_me:1112: 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:1116: 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:1118: 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 + +# Check whether --with-system-type or --without-system-type was given. +if test "${with_system_type+set}" = set; then + withval="$with_system_type" + { echo "$as_me:1126: WARNING: overriding system type to $withval" >&5 +echo "$as_me: WARNING: overriding system type to $withval" >&2;} + cf_cv_system_name=$withval +fi; + +### Save the given $CFLAGS to allow user-override. +cf_user_CFLAGS="$CFLAGS" + +### Default install-location + +echo "$as_me:1136: checking for prefix" >&5 +echo $ECHO_N "checking for prefix... $ECHO_C" >&6 +if test "x$prefix" = "xNONE" ; then + case "$cf_cv_system_name" in + # non-vendor systems don't have a conflict + openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu) + prefix=/usr + ;; + *) prefix=$ac_default_prefix + ;; + esac +fi +echo "$as_me:1148: result: $prefix" >&5 +echo "${ECHO_T}$prefix" >&6 + +if test "x$prefix" = "xNONE" ; then +echo "$as_me:1152: checking for default include-directory" >&5 +echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 +test -n "$verbose" && echo 1>&6 +for cf_symbol in \ + $includedir \ + $includedir/ncurses \ + $prefix/include \ + $prefix/include/ncurses \ + /usr/local/include \ + /usr/local/include/ncurses \ + /usr/include \ + /usr/include/ncurses +do + cf_dir=`eval echo $cf_symbol` + if test -f $cf_dir/curses.h ; then + if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then + includedir="$cf_symbol" + test -n "$verbose" && echo $ac_n " found " 1>&6 + break + fi + fi + test -n "$verbose" && echo " tested $cf_dir" 1>&6 +done +echo "$as_me:1175: result: $includedir" >&5 +echo "${ECHO_T}$includedir" >&6 +fi + +### Checks for programs. +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 +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:1189: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1204: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1212: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1215: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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:1224: 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 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1239: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1247: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1250: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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:1263: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1278: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1286: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1289: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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:1298: 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 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1313: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1321: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1324: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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:1337: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1357: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1379: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1382: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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:1393: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1408: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1416: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1419: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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:1432: 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 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1447: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1455: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1458: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1470: 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:1475:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1478: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1481: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1483: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1486: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1488: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1491: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1495 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +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:1511: 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:1514: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1517: \$? = $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 +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1540: 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:1546: 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:1551: 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:1557: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1560: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1567: 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;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1575: 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:1582: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1584: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1587: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1589: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1592: \$? = $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 +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1608: 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:1614: 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:1620: 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 1626 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1641: \$? = $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 + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1653: 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:1660: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1664: 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 1670 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1688: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1691: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1694: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1706: 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:1712: 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 1718 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1733: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1736: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1739: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1749: 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 +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1776: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1779: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1782: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1785: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1797 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1810: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1813: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1816: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1819: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1829 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1841: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1844: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1847: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1850: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -rf conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +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 + +GCC_VERSION=none +if test "$GCC" = yes ; then + echo "$as_me:1880: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + test -z "$GCC_VERSION" && GCC_VERSION=unknown + echo "$as_me:1884: result: $GCC_VERSION" >&5 +echo "${ECHO_T}$GCC_VERSION" >&6 +fi + +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:1894: 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 + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # 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 1915 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1920: \"$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:1926: \$? = $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 + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +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 1949 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1953: \"$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:1959: \$? = $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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:1996: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # 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 2006 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:2011: \"$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:2017: \$? = $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 + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +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 2040 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2044: \"$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:2050: \$? = $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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:2078: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +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 + +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:2091: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +#line 2098 "configure" +#include "confdefs.h" +#include +int Autoconf = TIOCGETP; +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -rf conftest* + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +#line 2113 "configure" +#include "confdefs.h" +#include +int Autoconf = TCGETA; +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -rf conftest* + + fi +fi +echo "$as_me:2126: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +echo "$as_me:2133: checking whether $CC understands -c and -o together" >&5 +echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 +if test "${cf_cv_prog_CC_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat > conftest.$ac_ext < +int main() +{ + ${cf_cv_main_return:-return}(0); +} +CF_EOF +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +if { (eval echo "$as_me:2149: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2152: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (eval echo "$as_me:2154: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2157: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval cf_cv_prog_CC_c_o=yes +else + eval cf_cv_prog_CC_c_o=no +fi +rm -rf conftest* + +fi +if test $cf_cv_prog_CC_c_o = yes; then + echo "$as_me:2168: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:2171: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +echo "$as_me:2175: checking for POSIXized ISC" >&5 +echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 +if test -d /etc/conf/kconfig.d && + grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 +then + echo "$as_me:2180: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ISC=yes # If later tests want to check for ISC. + +cat >>confdefs.h <<\EOF +#define _POSIX_SOURCE 1 +EOF + + if test "$GCC" = yes; then + CC="$CC -posix" + else + CC="$CC -Xp" + fi +else + echo "$as_me:2194: result: no" >&5 +echo "${ECHO_T}no" >&6 + ISC= +fi + +echo "$as_me:2199: checking for ${CC:-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 +if test "${cf_cv_ansi_cc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + -Ae \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +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 #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + cat >conftest.$ac_ext <<_ACEOF +#line 2303 "configure" +#include "confdefs.h" + +#ifndef CC_HAS_PROTOS +#if !defined(__STDC__) || (__STDC__ != 1) +choke me +#endif +#endif + +int +main () +{ + + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2324: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2327: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2330: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2333: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ansi_cc="$cf_arg"; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" + +fi +echo "$as_me:2346: result: $cf_cv_ansi_cc" >&5 +echo "${ECHO_T}$cf_cv_ansi_cc" >&6 + +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_cv_ansi_cc +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +else + cat >>confdefs.h <<\EOF +#define CC_HAS_PROTOS 1 +EOF + +fi +fi + +if test "$cf_cv_ansi_cc" = "no"; then + { { echo "$as_me:2439: error: Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto" >&5 +echo "$as_me: error: Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto" >&2;} + { (exit 1); exit 1; }; } +fi + +case $cf_cv_system_name in +os2*) + CFLAGS="$CFLAGS -Zmt" + CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt" + # autoconf's macro sets -Zexe and suffix both, which conflict:w + LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" + ac_cv_exeext=.exe + ;; +esac + +PROG_EXT="$EXEEXT" + +test -n "$PROG_EXT" && cat >>confdefs.h <conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +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:2486: 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 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:2501: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:2509: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:2512: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +test -z "$AWK" && { { echo "$as_me:2519: error: No awk program found" >&5 +echo "$as_me: error: No awk program found" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:2523: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:2533: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + +test -z "$EGREP" && { { echo "$as_me:2537: error: No egrep program found" >&5 +echo "$as_me: error: No egrep program found" >&2;} + { (exit 1); exit 1; }; } + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# 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:2553: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if $as_executable_p "$ac_dir/$ac_prog"; then + if test $ac_prog = install && + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:2602: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:2613: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:2617: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:2620: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + +echo "$as_me:2624: checking if $LN_S -f options work" >&5 +echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +echo "$as_me:2636: result: $cf_prog_ln_sf" >&5 +echo "${ECHO_T}$cf_prog_ln_sf" >&6 + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" + +echo "$as_me:2641: checking for long file names" >&5 +echo $ECHO_N "checking for long file names... $ECHO_C" >&6 +if test "${ac_cv_sys_long_file_names+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_long_file_names=yes +# Test for long file names in all the places we know might matter: +# . the current directory, where building will happen +# $prefix/lib where we will be installing things +# $exec_prefix/lib likewise +# eval it to expand exec_prefix. +# $TMPDIR if set, where it might want to write temporary files +# if $TMPDIR is not set: +# /tmp where it might want to write temporary files +# /var/tmp likewise +# /usr/tmp likewise +if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then + ac_tmpdirs=$TMPDIR +else + ac_tmpdirs='/tmp /var/tmp /usr/tmp' +fi +for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do + test -d $ac_dir || continue + test -w $ac_dir || continue # It is less confusing to not echo anything here. + ac_xdir=$ac_dir/cf$$ + (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue + ac_tf1=$ac_xdir/conftest9012345 + ac_tf2=$ac_xdir/conftest9012346 + (echo 1 >$ac_tf1) 2>/dev/null + (echo 2 >$ac_tf2) 2>/dev/null + ac_val=`cat $ac_tf1 2>/dev/null` + if test ! -f $ac_tf1 || test "$ac_val" != 1; then + ac_cv_sys_long_file_names=no + rm -rf $ac_xdir 2>/dev/null + break + fi + rm -rf $ac_xdir 2>/dev/null +done +fi +echo "$as_me:2680: result: $ac_cv_sys_long_file_names" >&5 +echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 +if test $ac_cv_sys_long_file_names = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_LONG_FILE_NAMES 1 +EOF + +fi + +# if we find pkg-config, check if we should install the ".pc" files. + +echo "$as_me:2692: 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. +if test "${with_pkg_config+set}" = set; then + withval="$with_pkg_config" + cf_pkg_config=$withval +else + cf_pkg_config=yes +fi; +echo "$as_me:2702: result: $cf_pkg_config" >&5 +echo "${ECHO_T}$cf_pkg_config" >&6 + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + # 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:2712: 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 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:2729: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:2741: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:2744: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$PKG_CONFIG" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:2782: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 +echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi + +if test "$PKG_CONFIG" != no ; then + echo "$as_me:2791: checking if we should install .pc files for $PKG_CONFIG" >&5 +echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6 + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + +# Check whether --enable-pc-files or --disable-pc-files was given. +if test "${enable_pc_files+set}" = set; then + enableval="$enable_pc_files" + enable_pc_files=$enableval +else + enable_pc_files=no +fi; + echo "$as_me:2808: result: $enable_pc_files" >&5 +echo "${ECHO_T}$enable_pc_files" >&6 + else + echo "$as_me:2811: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:2813: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 +echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} + enable_pc_files=no + fi +fi + +echo "$as_me:2819: checking if you want to build test-programs" >&5 +echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 + +# Check whether --with-tests or --without-tests was given. +if test "${with_tests+set}" = set; then + withval="$with_tests" + cf_with_tests=$withval +else + cf_with_tests=yes +fi; +echo "$as_me:2829: result: $cf_with_tests" >&5 +echo "${ECHO_T}$cf_with_tests" >&6 + +echo "$as_me:2832: checking if we should assume mixed-case filenames" >&5 +echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 + +# Check whether --enable-mixed-case or --disable-mixed-case was given. +if test "${enable_mixed_case+set}" = set; then + enableval="$enable_mixed_case" + enable_mixedcase=$enableval +else + enable_mixedcase=auto +fi; +echo "$as_me:2842: result: $enable_mixedcase" >&5 +echo "${ECHO_T}$enable_mixedcase" >&6 +if test "$enable_mixedcase" = "auto" ; then + +echo "$as_me:2846: 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*|*-mingw32*|*-uwin*) #(vi + cf_cv_mixedcase=no + ;; + *) + cf_cv_mixedcase=yes + ;; + esac +else + rm -f conftest CONFTEST + echo test >conftest + if test -f CONFTEST ; then + cf_cv_mixedcase=no + else + cf_cv_mixedcase=yes + fi + rm -f conftest CONFTEST +fi + +fi +echo "$as_me:2873: result: $cf_cv_mixedcase" >&5 +echo "${ECHO_T}$cf_cv_mixedcase" >&6 +test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF +#define MIXEDCASE_FILENAMES 1 +EOF + +else + cf_cv_mixedcase=$enable_mixedcase + if test "$enable_mixedcase" = "yes" ; then + cat >>confdefs.h <<\EOF +#define MIXEDCASE_FILENAMES 1 +EOF + + fi +fi + +# do this after mixed-case option (tags/TAGS is not as important as tic). +echo "$as_me:2890: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:2910: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:2914: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +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:2923: 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 +else + if test -n "$CTAGS"; then + ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CTAGS="$ac_prog" +echo "$as_me:2938: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CTAGS=$ac_cv_prog_CTAGS +if test -n "$CTAGS"; then + echo "$as_me:2946: result: $CTAGS" >&5 +echo "${ECHO_T}$CTAGS" >&6 +else + echo "$as_me:2949: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CTAGS" && break +done + +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:2960: 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 +else + if test -n "$ETAGS"; then + ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ETAGS="$ac_prog" +echo "$as_me:2975: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ETAGS=$ac_cv_prog_ETAGS +if test -n "$ETAGS"; then + echo "$as_me:2983: result: $ETAGS" >&5 +echo "${ECHO_T}$ETAGS" >&6 +else + echo "$as_me:2986: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ETAGS" && break +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:2995: 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 +else + if test -n "$MAKE_LOWER_TAGS"; then + ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE_LOWER_TAGS="yes" +echo "$as_me:3010: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" +fi +fi +MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS +if test -n "$MAKE_LOWER_TAGS"; then + echo "$as_me:3019: result: $MAKE_LOWER_TAGS" >&5 +echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 +else + echo "$as_me:3022: 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:3029: 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 +else + if test -n "$MAKE_UPPER_TAGS"; then + ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE_UPPER_TAGS="yes" +echo "$as_me:3044: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" +fi +fi +MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS +if test -n "$MAKE_UPPER_TAGS"; then + echo "$as_me:3053: result: $MAKE_UPPER_TAGS" >&5 +echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 +else + echo "$as_me:3056: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +else + MAKE_UPPER_TAGS="#" +fi + +if test "$MAKE_LOWER_TAGS" = yes ; then + MAKE_LOWER_TAGS= +else + MAKE_LOWER_TAGS="#" +fi + +echo "$as_me:3076: checking for makeflags variable" >&5 +echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 +if test "${cf_cv_makeflags+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_cv_makeflags='' + for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' + do + cat >cf_makeflags.tmp </dev/null | sed -e 's,[ ]*$,,'` + case "$cf_result" in + .*k) + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + case "$cf_result" in + .*CC=*) cf_cv_makeflags= + ;; + *) cf_cv_makeflags=$cf_option + ;; + esac + break + ;; + .-) ;; + *) echo "given option \"$cf_option\", no match \"$cf_result\"" + ;; + esac + done + rm -f cf_makeflags.tmp + +fi +echo "$as_me:3110: result: $cf_cv_makeflags" >&5 +echo "${ECHO_T}$cf_cv_makeflags" >&6 + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +echo "$as_me:3116: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" +echo "$as_me:3131: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:3139: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:3142: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:3151: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_RANLIB="ranlib" +echo "$as_me:3166: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:3175: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:3178: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. +set dummy ${ac_tool_prefix}ld; ac_word=$2 +echo "$as_me:3190: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_LD="${ac_tool_prefix}ld" +echo "$as_me:3205: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +LD=$ac_cv_prog_LD +if test -n "$LD"; then + echo "$as_me:3213: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 +else + echo "$as_me:3216: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_LD"; then + ac_ct_LD=$LD + # Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +echo "$as_me:3225: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_LD"; then + ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_LD="ld" +echo "$as_me:3240: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld" +fi +fi +ac_ct_LD=$ac_cv_prog_ac_ct_LD +if test -n "$ac_ct_LD"; then + echo "$as_me:3249: result: $ac_ct_LD" >&5 +echo "${ECHO_T}$ac_ct_LD" >&6 +else + echo "$as_me:3252: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + LD=$ac_ct_LD +else + LD="$ac_cv_prog_LD" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:3264: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${ac_tool_prefix}ar" +echo "$as_me:3279: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:3287: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:3290: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:3299: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_AR="ar" +echo "$as_me:3314: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:3323: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:3326: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:3338: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${ac_tool_prefix}ar" +echo "$as_me:3353: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:3361: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:3364: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:3373: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_AR="ar" +echo "$as_me:3388: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:3397: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:3400: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +echo "$as_me:3409: checking for options to update archives" >&5 +echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 +if test "${cf_cv_ar_flags+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do + + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3438: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + test -n "$verbose" && echo " cannot compile test-program" 1>&6 + +echo "${as_me:-configure}:3449: testing cannot compile test-program ..." 1>&5 + + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext + +fi +echo "$as_me:3457: result: $cf_cv_ar_flags" >&5 +echo "${ECHO_T}$cf_cv_ar_flags" >&6 + +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags +fi + +echo "$as_me:3468: checking if you have specified an install-prefix" >&5 +echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 + +# Check whether --with-install-prefix or --without-install-prefix was given. +if test "${with_install_prefix+set}" = set; then + withval="$with_install_prefix" + case "$withval" in #(vi + yes|no) #(vi + ;; + *) DESTDIR="$withval" + ;; + esac +fi; +echo "$as_me:3481: result: $DESTDIR" >&5 +echo "${ECHO_T}$DESTDIR" >&6 + +############################################################################### + +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the host +# compiler, etc., but we need a build compiler to generate parts of the source. + +if test "$cross_compiling" = yes ; then + + # defaults that we might want to override + : ${BUILD_CFLAGS:=''} + : ${BUILD_CPPFLAGS:=''} + : ${BUILD_LDFLAGS:=''} + : ${BUILD_LIBS:=''} + : ${BUILD_EXEEXT:='$x'} + : ${BUILD_OBJEXT:='o'} + +# Check whether --with-build-cc or --without-build-cc was given. +if test "${with_build_cc+set}" = set; then + withval="$with_build_cc" + BUILD_CC="$withval" +else + for ac_prog in gcc cc cl +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:3509: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_BUILD_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$BUILD_CC"; then + ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_BUILD_CC="$ac_prog" +echo "$as_me:3524: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +BUILD_CC=$ac_cv_prog_BUILD_CC +if test -n "$BUILD_CC"; then + echo "$as_me:3532: result: $BUILD_CC" >&5 +echo "${ECHO_T}$BUILD_CC" >&6 +else + echo "$as_me:3535: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$BUILD_CC" && break +done + +fi; + echo "$as_me:3543: checking for native build C compiler" >&5 +echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 + echo "$as_me:3545: result: $BUILD_CC" >&5 +echo "${ECHO_T}$BUILD_CC" >&6 + + echo "$as_me:3548: checking for native build C preprocessor" >&5 +echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 + +# Check whether --with-build-cpp or --without-build-cpp was given. +if test "${with_build_cpp+set}" = set; then + withval="$with_build_cpp" + BUILD_CPP="$withval" +else + BUILD_CPP='${BUILD_CC} -E' +fi; + echo "$as_me:3558: result: $BUILD_CPP" >&5 +echo "${ECHO_T}$BUILD_CPP" >&6 + + echo "$as_me:3561: checking for native build C flags" >&5 +echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 + +# Check whether --with-build-cflags or --without-build-cflags was given. +if test "${with_build_cflags+set}" = set; then + withval="$with_build_cflags" + BUILD_CFLAGS="$withval" +fi; + echo "$as_me:3569: result: $BUILD_CFLAGS" >&5 +echo "${ECHO_T}$BUILD_CFLAGS" >&6 + + echo "$as_me:3572: checking for native build C preprocessor-flags" >&5 +echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 + +# Check whether --with-build-cppflags or --without-build-cppflags was given. +if test "${with_build_cppflags+set}" = set; then + withval="$with_build_cppflags" + BUILD_CPPFLAGS="$withval" +fi; + echo "$as_me:3580: result: $BUILD_CPPFLAGS" >&5 +echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 + + echo "$as_me:3583: checking for native build linker-flags" >&5 +echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 + +# Check whether --with-build-ldflags or --without-build-ldflags was given. +if test "${with_build_ldflags+set}" = set; then + withval="$with_build_ldflags" + BUILD_LDFLAGS="$withval" +fi; + echo "$as_me:3591: result: $BUILD_LDFLAGS" >&5 +echo "${ECHO_T}$BUILD_LDFLAGS" >&6 + + echo "$as_me:3594: checking for native build linker-libraries" >&5 +echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 + +# Check whether --with-build-libs or --without-build-libs was given. +if test "${with_build_libs+set}" = set; then + withval="$with_build_libs" + BUILD_LIBS="$withval" +fi; + echo "$as_me:3602: result: $BUILD_LIBS" >&5 +echo "${ECHO_T}$BUILD_LIBS" >&6 + + # this assumes we're on Unix. + BUILD_EXEEXT= + BUILD_OBJEXT=o + + : ${BUILD_CC:='${CC}'} + + if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then + { { echo "$as_me:3612: error: Cross-build requires two compilers. +Use --with-build-cc to specify the native compiler." >&5 +echo "$as_me: error: Cross-build requires two compilers. +Use --with-build-cc to specify the native compiler." >&2;} + { (exit 1); exit 1; }; } + fi + +else + : ${BUILD_CC:='${CC}'} + : ${BUILD_CPP:='${CPP}'} + : ${BUILD_CFLAGS:='${CFLAGS}'} + : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} + : ${BUILD_LDFLAGS:='${LDFLAGS}'} + : ${BUILD_LIBS:='${LIBS}'} + : ${BUILD_EXEEXT:='$x'} + : ${BUILD_OBJEXT:='o'} +fi + +############################################################################### + +### Options to allow the user to specify the set of libraries which are used. +### Use "--without-normal --with-shared" to allow the default model to be +### shared, for example. +cf_list_models="" +echo "$as_me:3636: checking for specified models" >&5 +echo $ECHO_N "checking for specified models... $ECHO_C" >&6 +test -z "$cf_list_models" && cf_list_models=normal +echo "$as_me:3639: result: $cf_list_models" >&5 +echo "${ECHO_T}$cf_list_models" >&6 + +### Use the first model as the default, and save its suffix for use in building +### up test-applications. +echo "$as_me:3644: checking for default model" >&5 +echo $ECHO_N "checking for default model... $ECHO_C" >&6 +DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` +echo "$as_me:3647: result: $DFT_LWR_MODEL" >&5 +echo "${ECHO_T}$DFT_LWR_MODEL" >&6 + +DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +echo "$as_me:3652: 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. +if test "${with_curses_dir+set}" = set; then + withval="$with_curses_dir" + cf_cv_curses_dir=$withval +else + cf_cv_curses_dir=no +fi; +echo "$as_me:3662: 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" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$withval" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:3693: 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" + then + +if test -n "$cf_cv_curses_dir/include" ; then + for cf_add_incdir in $cf_cv_curses_dir/include + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 3726 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3738: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3741: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3744: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3747: \$? = $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}:3764: 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 + 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 + +echo "${as_me:-configure}:3798: testing adding $cf_add_libdir to library-path ..." 1>&5 + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + fi +fi + +echo "$as_me:3809: checking if you want wide-character code" >&5 +echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 + +# Check whether --enable-widec or --disable-widec was given. +if test "${enable_widec+set}" = set; then + enableval="$enable_widec" + with_widec=$enableval +else + with_widec=no +fi; +echo "$as_me:3819: result: $with_widec" >&5 +echo "${ECHO_T}$with_widec" >&6 +if test "$with_widec" = yes ; then + +echo "$as_me:3823: 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 3831 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3844: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3847: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3850: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3853: \$? = $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}:3865: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 + +cf_save_LIBS="$LIBS" + +cat >conftest.$ac_ext <<_ACEOF +#line 3870 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3883: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3886: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3889: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3892: \$? = $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 3906 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3919: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3922: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3925: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3928: \$? = $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}:3945: testing find linkage for utf8 library ..." 1>&5 + +echo "${as_me:-configure}:3947: 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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" + test -d /usr/include/utf8/include && cf_search="$cf_search /usr/include/utf8/include" + test -d /usr/utf8/include && cf_search="$cf_search /usr/utf8/include" + test -d /usr/utf8/include/utf8 && cf_search="$cf_search /usr/utf8/include/utf8" +} + +test "$prefix" != "NONE" && \ +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 "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" + test -d /usr/local/include/utf8/include && cf_search="$cf_search /usr/local/include/utf8/include" + test -d /usr/local/utf8/include && cf_search="$cf_search /usr/local/utf8/include" + test -d /usr/local/utf8/include/utf8 && cf_search="$cf_search /usr/local/utf8/include/utf8" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" + test -d /opt/include/utf8/include && cf_search="$cf_search /opt/include/utf8/include" + test -d /opt/utf8/include && cf_search="$cf_search /opt/utf8/include" + test -d /opt/utf8/include/utf8 && cf_search="$cf_search /opt/utf8/include/utf8" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" + test -d $HOME/include/utf8/include && cf_search="$cf_search $HOME/include/utf8/include" + test -d $HOME/utf8/include && cf_search="$cf_search $HOME/utf8/include" + test -d $HOME/utf8/include/utf8 && cf_search="$cf_search $HOME/utf8/include/utf8" +} + +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}:4060: 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 4064 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4077: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4080: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4083: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4086: \$? = $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}:4091: 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}:4109: 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$,,'` + +test "$cf_library_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" + test -d /usr/lib/utf8/lib && cf_search="$cf_search /usr/lib/utf8/lib" + test -d /usr/utf8/lib && cf_search="$cf_search /usr/utf8/lib" + test -d /usr/utf8/lib/utf8 && cf_search="$cf_search /usr/utf8/lib/utf8" +} + +test "$prefix" != "NONE" && \ +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" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" + test -d /usr/local/lib/utf8/lib && cf_search="$cf_search /usr/local/lib/utf8/lib" + test -d /usr/local/utf8/lib && cf_search="$cf_search /usr/local/utf8/lib" + test -d /usr/local/utf8/lib/utf8 && cf_search="$cf_search /usr/local/utf8/lib/utf8" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" + test -d /opt/lib/utf8/lib && cf_search="$cf_search /opt/lib/utf8/lib" + test -d /opt/utf8/lib && cf_search="$cf_search /opt/utf8/lib" + test -d /opt/utf8/lib/utf8 && cf_search="$cf_search /opt/utf8/lib/utf8" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" + test -d $HOME/lib/utf8/lib && cf_search="$cf_search $HOME/lib/utf8/lib" + test -d $HOME/utf8/lib && cf_search="$cf_search $HOME/utf8/lib" + test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" +} + +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}:4206: 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 4212 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4225: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4228: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4231: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4234: \$? = $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}:4239: 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 + + 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 + +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:4281: 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 4315 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4327: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4330: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4333: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4336: \$? = $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}:4353: 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 + 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}:4387: testing adding $cf_add_libdir to library-path ..." 1>&5 + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + LIBS="$cf_cv_library_file_utf8 $LIBS" +fi + +cf_ncuconfig_root=ncursesw + +echo "Looking for ${cf_ncuconfig_root}-config" +for ac_prog in ${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:4405: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NCURSES_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word" + echo "$as_me:4422: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG + +if test -n "$NCURSES_CONFIG"; then + echo "$as_me:4433: result: $NCURSES_CONFIG" >&5 +echo "${ECHO_T}$NCURSES_CONFIG" >&6 +else + echo "$as_me:4436: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NCURSES_CONFIG" && break +done +test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none" + +if test "$NCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" +LIBS="`$NCURSES_CONFIG --libs` $LIBS" + +# even with config script, some packages use no-override for curses.h + +echo "$as_me:4451: 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/curses.h \ + ncursesw/ncurses.h \ + curses.h \ + ncurses.h +do +cat >conftest.$ac_ext <<_ACEOF +#line 4465 "configure" +#include "confdefs.h" +#include <${cf_header}> +int +main () +{ +initscr(); tgoto("?", 0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4477: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4480: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4483: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4486: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_header=$cf_header; 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:4497: 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:4501: error: No curses header-files found" >&5 +echo "$as_me: error: No curses header-files found" >&2;} + { (exit 1); exit 1; }; } +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. + +for ac_header in $cf_cv_ncurses_header +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:4511: 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 4517 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:4521: \"$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:4527: \$? = $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:4546: 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 <>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <conftest.$ac_ext <<_ACEOF +#line 4599 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4611: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4614: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4617: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4620: \$? = $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}:4637: 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 + fi + done + done +fi + +} + +echo "$as_me:4654: 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 +else + + cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" + ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" + for cf_header in $cf_header_list + do + + cat >conftest.$ac_ext <<_ACEOF +#line 4666 "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 () +{ + +#ifdef NCURSES_VERSION + +#ifndef WACS_BSSB + make an error +#endif + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4698: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4701: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4704: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4707: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + test "$cf_cv_ncurses_h" != no && break + done + +fi +echo "$as_me:4722: 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:4729: 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 +else + + test -n "$verbose" && echo + +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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" + test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + + 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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" + test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" + test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" + test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" + test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" + test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$includedir" != NONE && \ +test "$includedir" != "/usr/include" && \ +test -d "$includedir" && { + test -d $includedir && cf_search="$cf_search $includedir" + test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" +} + +test "$oldincludedir" != NONE && \ +test "$oldincludedir" != "/usr/include" && \ +test -d "$oldincludedir" && { + test -d $oldincludedir && cf_search="$cf_search $oldincludedir" + test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" +} + +cf_search="$cf_search $cf_header_path_list" + + test -n "$verbose" && echo search path $cf_search + cf_save2_CPPFLAGS="$CPPFLAGS" + for cf_incdir in $cf_search + do + +if test -n "$cf_incdir" ; then + for cf_add_incdir in $cf_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 4869 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4881: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4884: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4887: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4890: \$? = $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}:4907: 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 + fi + done + done +fi + + for cf_header in \ + ncurses.h \ + curses.h + do + + cat >conftest.$ac_ext <<_ACEOF +#line 4928 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main () +{ + +#ifdef NCURSES_VERSION + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4952: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4955: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4958: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4961: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h2=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h2=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + if test "$cf_cv_ncurses_h2" != no ; then + cf_cv_ncurses_h2=$cf_incdir/$cf_header + test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 + break + fi + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 + done + CPPFLAGS="$cf_save2_CPPFLAGS" + test "$cf_cv_ncurses_h2" != no && break + done + test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:4982: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:4987: 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%/[^/]*$%%'` + cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` + if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then + cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header + fi + +if test -n "$cf_1st_incdir" ; then + for cf_add_incdir in $cf_1st_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 5020 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5032: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5035: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5038: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5041: \$? = $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}:5058: 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 + fi + done + done +fi + +fi + +# Set definitions to allow ifdef'ing for ncurses.h + +case $cf_cv_ncurses_header in # (vi +*ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_H 1 +EOF + + ;; +esac + +case $cf_cv_ncurses_header in # (vi +ncurses/curses.h|ncurses/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_NCURSES_H 1 +EOF + + ;; +ncursesw/curses.h|ncursesw/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSESW_NCURSES_H 1 +EOF + + ;; +esac + +echo "$as_me:5101: 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 + 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 5119 "configure" +#include "confdefs.h" +#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> + +int +main () +{ +int x = auto_left_margin + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5134: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5137: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5140: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5143: \$? = $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:5159: 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) + cat >>confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + 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 + +# some applications need this, but should check for NCURSES_VERSION +cat >>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +echo "$as_me:5193: 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 +else + + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + if test "$cross_compiling" = yes; then + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" + { (eval echo "$as_me:5219: \"$cf_try\"") >&5 + (eval $cf_try) 2>&5 + ac_status=$? + echo "$as_me:5222: \$? = $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%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi + +else + cat >conftest.$ac_ext <<_ACEOF +#line 5232 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:5257: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5260: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:5262: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5265: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_ncurses_version=`cat $cf_tempfile` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f $cf_tempfile + +fi +echo "$as_me:5279: 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 + # 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:5291: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5299 "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 Gpm_Open (); +int +main () +{ +Gpm_Open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5318: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5321: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5324: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5327: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_Gpm_Open=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_Gpm_Open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5338: 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:5341: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5349 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5368: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5371: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5374: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5377: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5388: 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" +else + cf_ncurses_LIBS="-lgpm" +fi + +fi + +case $host_os in #(vi +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:5403: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmytinfo $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5411 "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 tgoto (); +int +main () +{ +tgoto (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5430: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5433: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5436: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5439: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mytinfo_tgoto=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_mytinfo_tgoto=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5450: 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" +fi + + fi + ;; +esac + +LIBS="$cf_ncurses_LIBS $LIBS" + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + LIBS="-l$cf_nculib_root $LIBS" +else + + eval 'cf_cv_have_lib_'$cf_nculib_root'=no' + cf_libdir="" + echo "$as_me:5469: 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 5475 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char initscr (); below. */ +#include +/* 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 (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5506: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5509: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5512: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5515: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5525: 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:5532: 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 5536 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5548: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5551: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5554: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5557: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:5559: 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:5566: result: no" >&5 +echo "${ECHO_T}no" >&6 + +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$,,'` + +test "$cf_library_path" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" + test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" +} + + cf_library_path_list="$cf_library_path_list $cf_search" + ;; + esac + done +fi + +cf_search= + +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" + test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" + test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" + test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" + test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" + test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" +} + +cf_search="$cf_library_path_list $cf_search" + + for cf_libdir in $cf_search + do + echo "$as_me:5656: 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 5660 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5672: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5675: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5678: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5681: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:5683: 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:5690: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_save_LIBS" +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 + +eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root + +if test $cf_found_library = no ; then + { { echo "$as_me:5705: error: Cannot link $cf_nculib_root library" >&5 +echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +if test -n "$cf_ncurses_LIBS" ; then + echo "$as_me:5713: 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 + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + cat >conftest.$ac_ext <<_ACEOF +#line 5723 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +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:5735: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5738: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5741: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5744: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:5746: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:5751: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_ncurses_SAVE" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NCURSES_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word" + echo "$as_me:5792: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG + +if test -n "$NCURSES_CONFIG"; then + echo "$as_me:5803: result: $NCURSES_CONFIG" >&5 +echo "${ECHO_T}$NCURSES_CONFIG" >&6 +else + echo "$as_me:5806: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NCURSES_CONFIG" && break +done +test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none" + +if test "$NCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" +LIBS="`$NCURSES_CONFIG --libs` $LIBS" + +# even with config script, some packages use no-override for curses.h + +echo "$as_me:5821: 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/curses.h \ + ncurses/ncurses.h \ + curses.h \ + ncurses.h +do +cat >conftest.$ac_ext <<_ACEOF +#line 5835 "configure" +#include "confdefs.h" +#include <${cf_header}> +int +main () +{ +initscr(); tgoto("?", 0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5847: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5850: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5853: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5856: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_header=$cf_header; 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:5867: 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:5871: error: No curses header-files found" >&5 +echo "$as_me: error: No curses header-files found" >&2;} + { (exit 1); exit 1; }; } +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. + +for ac_header in $cf_cv_ncurses_header +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:5881: 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 5887 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:5891: \"$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:5897: \$? = $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:5916: 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 <>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <conftest.$ac_ext <<_ACEOF +#line 5969 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5981: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5984: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5987: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5990: \$? = $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}:6007: 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 + fi + done + done +fi + +} + +echo "$as_me:6024: 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 +else + + cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" + ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" + for cf_header in $cf_header_list + do + + cat >conftest.$ac_ext <<_ACEOF +#line 6036 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main () +{ + +#ifdef NCURSES_VERSION + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6060: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6063: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6066: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6069: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + test "$cf_cv_ncurses_h" != no && break + done + +fi +echo "$as_me:6084: 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:6091: 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 +else + + test -n "$verbose" && echo + +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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" + test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + + 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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" + test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" + test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" + test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" + test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" + test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$includedir" != NONE && \ +test "$includedir" != "/usr/include" && \ +test -d "$includedir" && { + test -d $includedir && cf_search="$cf_search $includedir" + test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" +} + +test "$oldincludedir" != NONE && \ +test "$oldincludedir" != "/usr/include" && \ +test -d "$oldincludedir" && { + test -d $oldincludedir && cf_search="$cf_search $oldincludedir" + test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" +} + +cf_search="$cf_search $cf_header_path_list" + + test -n "$verbose" && echo search path $cf_search + cf_save2_CPPFLAGS="$CPPFLAGS" + for cf_incdir in $cf_search + do + +if test -n "$cf_incdir" ; then + for cf_add_incdir in $cf_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 6231 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6243: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6246: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6249: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6252: \$? = $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}:6269: 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 + fi + done + done +fi + + for cf_header in \ + ncurses.h \ + curses.h + do + + cat >conftest.$ac_ext <<_ACEOF +#line 6290 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main () +{ + +#ifdef NCURSES_VERSION + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6314: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6317: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6320: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6323: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h2=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h2=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + if test "$cf_cv_ncurses_h2" != no ; then + cf_cv_ncurses_h2=$cf_incdir/$cf_header + test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 + break + fi + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 + done + CPPFLAGS="$cf_save2_CPPFLAGS" + test "$cf_cv_ncurses_h2" != no && break + done + test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6344: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:6349: 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%/[^/]*$%%'` + cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` + if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then + cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header + fi + +if test -n "$cf_1st_incdir" ; then + for cf_add_incdir in $cf_1st_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 6382 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6394: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6397: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6400: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6403: \$? = $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}:6420: 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 + fi + done + done +fi + +fi + +# Set definitions to allow ifdef'ing for ncurses.h + +case $cf_cv_ncurses_header in # (vi +*ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_H 1 +EOF + + ;; +esac + +case $cf_cv_ncurses_header in # (vi +ncurses/curses.h|ncurses/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_NCURSES_H 1 +EOF + + ;; +ncursesw/curses.h|ncursesw/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSESW_NCURSES_H 1 +EOF + + ;; +esac + +echo "$as_me:6463: 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 + 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 6481 "configure" +#include "confdefs.h" +#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> + +int +main () +{ +int x = auto_left_margin + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6496: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6499: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6502: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6505: \$? = $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:6521: 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) + cat >>confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + 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 + +# some applications need this, but should check for NCURSES_VERSION +cat >>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +echo "$as_me:6555: 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 +else + + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + if test "$cross_compiling" = yes; then + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" + { (eval echo "$as_me:6581: \"$cf_try\"") >&5 + (eval $cf_try) 2>&5 + ac_status=$? + echo "$as_me:6584: \$? = $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%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi + +else + cat >conftest.$ac_ext <<_ACEOF +#line 6594 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:6619: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6622: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:6624: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6627: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_ncurses_version=`cat $cf_tempfile` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f $cf_tempfile + +fi +echo "$as_me:6641: 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 + # 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:6653: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6661 "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 Gpm_Open (); +int +main () +{ +Gpm_Open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6680: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6683: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6686: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6689: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_Gpm_Open=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_Gpm_Open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6700: 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:6703: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6711 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6730: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6733: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6736: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6739: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6750: 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" +else + cf_ncurses_LIBS="-lgpm" +fi + +fi + +case $host_os in #(vi +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:6765: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmytinfo $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6773 "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 tgoto (); +int +main () +{ +tgoto (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6792: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6795: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6798: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6801: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mytinfo_tgoto=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_mytinfo_tgoto=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6812: 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" +fi + + fi + ;; +esac + +LIBS="$cf_ncurses_LIBS $LIBS" + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + LIBS="-l$cf_nculib_root $LIBS" +else + + eval 'cf_cv_have_lib_'$cf_nculib_root'=no' + cf_libdir="" + echo "$as_me:6831: 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 6837 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char initscr (); below. */ +#include +/* 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 (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6868: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6871: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6874: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6877: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:6887: 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:6894: 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 6898 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6910: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6913: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6916: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6919: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:6921: 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:6928: result: no" >&5 +echo "${ECHO_T}no" >&6 + +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$,,'` + +test "$cf_library_path" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" + test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" +} + + cf_library_path_list="$cf_library_path_list $cf_search" + ;; + esac + done +fi + +cf_search= + +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" + test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" + test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" + test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" + test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" + test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" +} + +cf_search="$cf_library_path_list $cf_search" + + for cf_libdir in $cf_search + do + echo "$as_me:7018: 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 7022 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7034: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7037: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7040: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7043: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7045: 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:7052: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_save_LIBS" +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 + +eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root + +if test $cf_found_library = no ; then + { { echo "$as_me:7067: error: Cannot link $cf_nculib_root library" >&5 +echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +if test -n "$cf_ncurses_LIBS" ; then + echo "$as_me:7075: 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 + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + cat >conftest.$ac_ext <<_ACEOF +#line 7085 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +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:7097: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7100: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7103: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7106: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7108: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:7113: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_ncurses_SAVE" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <conftest.$ac_ext < +AUTOCONF_$cf_name NCURSES_VERSION_$cf_name +CF_EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out" + { (eval echo "$as_me:7150: \"$cf_try\"") >&5 + (eval $cf_try) 2>&5 + ac_status=$? + echo "$as_me:7153: \$? = $ac_status" >&5 + (exit $ac_status); } + if test -f conftest.out ; then + cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[ ]\+//"` + eval NCURSES_$cf_name=$cf_result + cat conftest.$ac_ext + cat conftest.out + fi +done + +cf_cv_abi_version=${NCURSES_MAJOR} + +fi + +cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} + +cf_cv_timestamp=`date` + +echo "$as_me:7171: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 + + case $cf_cv_system_name in #(vi + OS/2*|os2*) #(vi + LIB_PREFIX='' + ;; + *) LIB_PREFIX='lib' + ;; + esac +cf_prefix=$LIB_PREFIX + +LIB_PREFIX=$cf_prefix + +LIB_SUFFIX= + +############################################################################### + +if test X"$CC_G_OPT" = X"" ; then + CC_G_OPT='-g' + test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT='' +fi + +echo "$as_me:7194: checking for default loader flags" >&5 +echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 +case $DFT_LWR_MODEL in +normal) LD_MODEL='' ;; +debug) LD_MODEL=$CC_G_OPT ;; +profile) LD_MODEL='-pg';; +shared) LD_MODEL='' ;; +esac +echo "$as_me:7202: result: $LD_MODEL" >&5 +echo "${ECHO_T}$LD_MODEL" >&6 + +LD_RPATH_OPT= +echo "$as_me:7206: 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 + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[2-9].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +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:7237: result: $LD_RPATH_OPT" >&5 +echo "${ECHO_T}$LD_RPATH_OPT" >&6 + +case "x$LD_RPATH_OPT" in #(vi +x-R*) + echo "$as_me:7242: 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" + LIBS="${LD_RPATH_OPT}$libdir $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 7247 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7259: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7262: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7265: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7268: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_space=no +else + echo "$as_me: failed program was:" >&5 +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:7278: result: $cf_rpath_space" >&5 +echo "${ECHO_T}$cf_rpath_space" >&6 + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; +esac + + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= + LD_SHARED_OPTS= + INSTALL_LIB="-m 644" + + cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" + + echo "$as_me:7293: checking if release/abi version should be used for shared libs" >&5 +echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 + +# Check whether --with-shlib-version or --without-shlib-version was given. +if test "${with_shlib_version+set}" = set; then + withval="$with_shlib_version" + test -z "$withval" && withval=auto + case $withval in #(vi + yes) #(vi + cf_cv_shlib_version=auto + ;; + rel|abi|auto|no) #(vi + cf_cv_shlib_version=$withval + ;; + *) + { { echo "$as_me:7308: error: option value must be one of: rel, abi, auto or no" >&5 +echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + cf_cv_shlib_version=auto +fi; + echo "$as_me:7317: result: $cf_cv_shlib_version" >&5 +echo "${ECHO_T}$cf_cv_shlib_version" >&6 + + cf_cv_rm_so_locs=no + + # Some less-capable ports of gcc support only -fpic + CC_SHARED_OPTS= + if test "$GCC" = yes + then + echo "$as_me:7326: checking which $CC option to use" >&5 +echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 + cf_save_CFLAGS="$CFLAGS" + for CC_SHARED_OPTS in -fPIC -fpic '' + do + CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" + cat >conftest.$ac_ext <<_ACEOF +#line 7333 "configure" +#include "confdefs.h" +#include +int +main () +{ +int x = 1 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7345: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7348: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7351: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7354: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + echo "$as_me:7363: result: $CC_SHARED_OPTS" >&5 +echo "${ECHO_T}$CC_SHARED_OPTS" >&6 + CFLAGS="$cf_save_CFLAGS" + fi + + cf_cv_shlib_version_infix=no + + case $cf_cv_system_name in #(vi + aix[56]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi + MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' + ;; + cygwin*) #(vi + CC_SHARED_OPTS= + MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}' + cf_cv_shlib_version=cygdll + cf_cv_shlib_version_infix=cygdll + cat >mk_shared_lib.sh <<-CF_EOF + #!/bin/sh + SHARED_LIB=\$1 + IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\` + shift + cat <<-EOF + Linking shared library + ** SHARED_LIB \$SHARED_LIB + ** IMPORT_LIB \$IMPORT_LIB +EOF + exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB} +CF_EOF + chmod +x mk_shared_lib.sh + ;; + darwin*) #(vi + EXTRA_CFLAGS="-no-cpp-precomp" + CC_SHARED_OPTS="-dynamic" + MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi + cf_cv_shlib_version_infix=yes + echo "$as_me:7405: checking if ld -search_paths_first works" >&5 +echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 +if test "${cf_cv_ldflags_search_paths_first+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + cat >conftest.$ac_ext <<_ACEOF +#line 7414 "configure" +#include "confdefs.h" + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7426: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7429: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7432: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7435: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ldflags_search_paths_first=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ldflags_search_paths_first=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$cf_save_LDFLAGS +fi +echo "$as_me:7446: result: $cf_cv_ldflags_search_paths_first" >&5 +echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 + if test $cf_cv_ldflags_search_paths_first = yes; then + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + fi + ;; + hpux*) #(vi + # (tested with gcc 2.7.2 -- I don't have c89) + if test "$GCC" = yes; then + LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' + else + CC_SHARED_OPTS='+Z' + LD_SHARED_OPTS='-Wl,+b,${libdir}' + fi + MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@' + # HP-UX shared libraries must be executable, and should be + # readonly to exploit a quirk in the memory manager. + INSTALL_LIB="-m 555" + ;; + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + # tested with IRIX 5.2 and 'cc'. + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@' + else + MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@' + fi + cf_cv_rm_so_locs=yes + ;; + linux*|gnu*|k*bsd*-gnu) #(vi + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + if test "$cf_cv_shlib_version" = rel; then + cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' + else + cf_cv_shared_soname='`basename $@`' + fi + + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + ;; + openbsd[2-9].*) #(vi + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + if test "$cf_cv_shlib_version" = rel; then + cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' + else + cf_cv_shared_soname='`basename $@`' + fi + + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + ;; + nto-qnx*|openbsd*|freebsd[12].*) #(vi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + MK_SHARED_LIB='${LD} -Bshareable -o $@' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + freebsd*) #(vi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + fi + + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + if test "$cf_cv_shlib_version" = rel; then + cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' + else + cf_cv_shared_soname='`basename $@`' + fi + + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@' + ;; + netbsd*) #(vi + CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_shlib_version" = auto; then + if test -f /usr/libexec/ld.elf_so; then + cf_cv_shlib_version=abi + else + cf_cv_shlib_version=rel + fi + fi + + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + if test "$cf_cv_shlib_version" = rel; then + cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' + else + cf_cv_shared_soname='`basename $@`' + fi + + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@' + else + MK_SHARED_LIB='${LD} -shared -Bshareable -o $@' + fi + ;; + osf*|mls+*) #(vi + # tested with OSF/1 V3.2 and 'cc' + # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't + # link with shared libs). + MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`' + case $host_os in #(vi + osf4*) + MK_SHARED_LIB="${MK_SHARED_LIB} -msym" + ;; + esac + MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + cf_cv_rm_so_locs=yes + ;; + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 + # tested with osr5.0.5 + if test "$GCC" != yes; then + CC_SHARED_OPTS='-belf -KPIC' + fi + MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@' + if test "$cf_cv_enable_rpath" = yes ; then + # only way is to set LD_RUN_PATH but no switch for it + RUN_PATH=$libdir + fi + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + LINK_PROGS='LD_RUN_PATH=${libdir}' + LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' + ;; + sunos4*) #(vi + # tested with SunOS 4.1.1 and gcc 2.7.0 + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='${LD} -assert pure-text -o $@' + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + ;; + solaris2*) #(vi + # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 + # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 + if test "$DFT_LWR_MODEL" = "shared" ; then + LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" + LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" + fi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" + fi + + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + if test "$cf_cv_shlib_version" = rel; then + cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' + else + cf_cv_shared_soname='`basename $@`' + fi + + if test "$GCC" != yes; then + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +#line 7626 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello\n"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7638: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7641: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7644: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7647: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts + MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@' + else + MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@' + fi + ;; + sysv5uw7*|unix_sv*) #(vi + # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) + if test "$GCC" != yes; then + CC_SHARED_OPTS='-KPIC' + fi + MK_SHARED_LIB='${LD} -d y -G -o $@' + ;; + *) + CC_SHARED_OPTS='unknown' + MK_SHARED_LIB='echo unknown' + ;; + esac + + # This works if the last tokens in $MK_SHARED_LIB are the -o target. + case "$cf_cv_shlib_version" in #(vi + rel|abi) + case "$MK_SHARED_LIB" in #(vi + *'-o $@') #(vi + test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes + ;; + *) + { echo "$as_me:7684: WARNING: ignored --with-shlib-version" >&5 +echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} + ;; + esac + ;; + esac + + if test -n "$cf_ld_rpath_opt" ; then + MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" + fi + +############################################################################### + + case $cf_cv_system_name in + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; + esac + +### use option --enable-broken-linker to force on use of broken-linker support +echo "$as_me:7703: checking if you want broken-linker support code" >&5 +echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 + +# Check whether --enable-broken_linker or --disable-broken_linker was given. +if test "${enable_broken_linker+set}" = set; then + enableval="$enable_broken_linker" + with_broken_linker=$enableval +else + with_broken_linker=${BROKEN_LINKER:-no} +fi; +echo "$as_me:7713: result: $with_broken_linker" >&5 +echo "${ECHO_T}$with_broken_linker" >&6 + +BROKEN_LINKER=0 +if test "$with_broken_linker" = yes ; then + cat >>confdefs.h <<\EOF +#define BROKEN_LINKER 1 +EOF + + BROKEN_LINKER=1 +elif test "$DFT_LWR_MODEL" = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + cat >>confdefs.h <<\EOF +#define BROKEN_LINKER 1 +EOF + + BROKEN_LINKER=1 + test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 + +echo "${as_me:-configure}:7733: testing cygwin linker is broken anyway ..." 1>&5 + + ;; + esac +fi + +# Check to define _XOPEN_SOURCE "automatically" + +cf_XOPEN_SOURCE=500 +cf_POSIX_C_SOURCE=199506L +cf_xopen_source= + +case $host_os in #(vi +aix[456]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +darwin[0-8].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" + ;; +freebsd*|dragonfly*) #(vi + # 5.x headers associate + # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L + # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L + cf_POSIX_C_SOURCE=200112L + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + ;; +hpux*) #(vi + cf_xopen_source="-D_HPUX_SOURCE" + ;; +irix[56].*) #(vi + cf_xopen_source="-D_SGI_SOURCE" + ;; +linux*|gnu*|mint*|k*bsd*-gnu) #(vi + +echo "$as_me:7774: 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 7781 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7796: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7799: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7802: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7805: \$? = $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 7814 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7829: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7832: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7835: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7838: \$? = $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_cv_gnu_source=yes +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:7853: 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" + + ;; +mirbsd*) #(vi + # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks + ;; +netbsd*) #(vi + # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + ;; +openbsd*) #(vi + # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw + ;; +osf[45]*) #(vi + cf_xopen_source="-D_OSF_SOURCE" + ;; +nto-qnx*) #(vi + cf_xopen_source="-D_QNX_SOURCE" + ;; +sco*) #(vi + # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer + ;; +solaris2.1[0-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[1-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__" + ;; +*) + echo "$as_me:7883: 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 7890 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7905: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7908: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7911: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7914: \$? = $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" + cat >conftest.$ac_ext <<_ACEOF +#line 7923 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7938: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7941: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7944: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7947: \$? = $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_cv_xopen_source=$cf_XOPEN_SOURCE +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:7962: result: $cf_cv_xopen_source" >&5 +echo "${ECHO_T}$cf_cv_xopen_source" >&6 + if test "$cf_cv_xopen_source" != no ; then + +CFLAGS=`echo "$CFLAGS" | \ + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + fi + +cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE + +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" + +cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` + +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:8069: 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}:8075: testing if the symbol is already defined go no further ..." 1>&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 8078 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _POSIX_C_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8093: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8096: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8099: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8102: \$? = $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 + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" + ;; + .2) #(vi + 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 8123 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _POSIX_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8138: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8141: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8144: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8147: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" +fi +rm -f conftest.$ac_objext conftest.$ac_ext + fi + +echo "${as_me:-configure}:8158: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 + + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + +echo "${as_me:-configure}:8163: testing if the second compile does not leave our definition intact error ..." 1>&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 8166 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _POSIX_C_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8181: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8184: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8187: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8190: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_posix_c_source=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:8206: 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 + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + + ;; +esac + +if test -n "$cf_xopen_source" ; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + +# Check whether --enable-largefile or --disable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval="$enable_largefile" + +fi; +if test "$enable_largefile" != no; then + + echo "$as_me:8385: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +#line 8397 "configure" +#include "confdefs.h" +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (eval echo "$as_me:8417: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8420: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8423: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8426: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:8436: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8439: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8442: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8445: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +echo "$as_me:8459: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + echo "$as_me:8465: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_file_offset_bits=no + cat >conftest.$ac_ext <<_ACEOF +#line 8473 "configure" +#include "confdefs.h" +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8493: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8496: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8499: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8502: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 8511 "configure" +#include "confdefs.h" +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8532: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8535: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8538: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8541: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + break +done +fi +echo "$as_me:8552: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_large_files=no + cat >conftest.$ac_ext <<_ACEOF +#line 8570 "configure" +#include "confdefs.h" +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8590: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8593: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8596: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8599: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 8608 "configure" +#include "confdefs.h" +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8629: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8632: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8635: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8638: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + break +done +fi +echo "$as_me:8649: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + ac_cv_sys_largefile_source=no + cat >conftest.$ac_ext <<_ACEOF +#line 8670 "configure" +#include "confdefs.h" +#include +int +main () +{ +return !fseeko; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8682: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8685: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8688: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8691: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 8700 "configure" +#include "confdefs.h" +#define _LARGEFILE_SOURCE 1 +#include +int +main () +{ +return !fseeko; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8713: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8716: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8719: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8722: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sys_largefile_source=1; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + break +done +fi +echo "$as_me:8733: result: $ac_cv_sys_largefile_source" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 +if test "$ac_cv_sys_largefile_source" != no; then + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 +if test "${ac_cv_func_fseeko+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 8753 "configure" +#include "confdefs.h" +#include +int +main () +{ +return fseeko && fseeko (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8765: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8768: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8771: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8774: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fseeko=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_fseeko=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8784: result: $ac_cv_func_fseeko" >&5 +echo "${ECHO_T}$ac_cv_func_fseeko" >&6 +if test $ac_cv_func_fseeko = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_FSEEKO 1 +EOF + +fi + + # Normally we would collect these definitions in the config.h, + # but (like _XOPEN_SOURCE), some environments rely on having these + # defined before any of the system headers are included. Another + # case comes up with C++, e.g., on AIX the compiler compiles the + # header files by themselves before looking at the body files it is + # told to compile. For ncurses, those header files do not include + # the config.h + test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES " + test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " + test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " + + echo "$as_me:8805: checking whether to use struct dirent64" >&5 +echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 +if test "${cf_cv_struct_dirent64+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cat >conftest.$ac_ext <<_ACEOF +#line 8812 "configure" +#include "confdefs.h" + +#include +#include + +int +main () +{ + + /* if transitional largefile support is setup, this is true */ + extern struct dirent64 * readdir(DIR *); + struct dirent64 *x = readdir((DIR *)0); + struct dirent *y = readdir((DIR *)0); + int z = x - y; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8836: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8839: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8842: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_struct_dirent64=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_struct_dirent64=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:8853: result: $cf_cv_struct_dirent64" >&5 +echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 + test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF +#define HAVE_STRUCT_DIRENT64 1 +EOF + + fi + +### Enable compiling-in rcs id's +echo "$as_me:8862: checking if RCS identifiers should be compiled-in" >&5 +echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 + +# Check whether --with-rcs-ids or --without-rcs-ids was given. +if test "${with_rcs_ids+set}" = set; then + withval="$with_rcs_ids" + with_rcs_ids=$withval +else + with_rcs_ids=no +fi; +echo "$as_me:8872: result: $with_rcs_ids" >&5 +echo "${ECHO_T}$with_rcs_ids" >&6 +test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF +#define USE_RCS_IDS 1 +EOF + +############################################################################### + +### Note that some functions (such as const) are normally disabled anyway. +echo "$as_me:8881: checking if you want to build with function extensions" >&5 +echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 + +# Check whether --enable-ext-funcs or --disable-ext-funcs was given. +if test "${enable_ext_funcs+set}" = set; then + enableval="$enable_ext_funcs" + with_ext_funcs=$enableval +else + with_ext_funcs=yes +fi; +echo "$as_me:8891: result: $with_ext_funcs" >&5 +echo "${ECHO_T}$with_ext_funcs" >&6 +if test "$with_ext_funcs" = yes ; then + NCURSES_EXT_FUNCS=1 + cat >>confdefs.h <<\EOF +#define HAVE_USE_DEFAULT_COLORS 1 +EOF + + cat >>confdefs.h <<\EOF +#define NCURSES_EXT_FUNCS 1 +EOF + +else + NCURSES_EXT_FUNCS=0 +fi + +### use option --enable-const to turn on use of const beyond that in XSI. +echo "$as_me:8908: checking for extended use of const keyword" >&5 +echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 + +# Check whether --enable-const or --disable-const was given. +if test "${enable_const+set}" = set; then + enableval="$enable_const" + with_ext_const=$enableval +else + with_ext_const=no +fi; +echo "$as_me:8918: result: $with_ext_const" >&5 +echo "${ECHO_T}$with_ext_const" >&6 +NCURSES_CONST='/*nothing*/' +if test "$with_ext_const" = yes ; then + NCURSES_CONST=const +fi + +############################################################################### +# These options are relatively safe to experiment with. + +echo "$as_me:8928: checking if you want all development code" >&5 +echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 + +# Check whether --with-develop or --without-develop was given. +if test "${with_develop+set}" = set; then + withval="$with_develop" + with_develop=$withval +else + with_develop=no +fi; +echo "$as_me:8938: result: $with_develop" >&5 +echo "${ECHO_T}$with_develop" >&6 + +############################################################################### +# These are just experimental, probably should not be in a package: + +# This is still experimental (20080329), but should ultimately be moved to +# the script-block --with-normal, etc. + +echo "$as_me:8947: checking if you want to link with the pthread library" >&5 +echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 + +# Check whether --with-pthread or --without-pthread was given. +if test "${with_pthread+set}" = set; then + withval="$with_pthread" + with_pthread=$withval +else + with_pthread=no +fi; +echo "$as_me:8957: result: $with_pthread" >&5 +echo "${ECHO_T}$with_pthread" >&6 + +if test "$with_pthread" != no ; then + echo "$as_me:8961: checking for pthread.h" >&5 +echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 +if test "${ac_cv_header_pthread_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 8967 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:8971: \"$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:8977: \$? = $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 + ac_cv_header_pthread_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_pthread_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:8996: result: $ac_cv_header_pthread_h" >&5 +echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 +if test $ac_cv_header_pthread_h = yes; then + + cat >>confdefs.h <<\EOF +#define HAVE_PTHREADS_H 1 +EOF + + echo "$as_me:9004: checking if we can link with the pthread library" >&5 +echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6 + cf_save_LIBS="$LIBS" + LIBS="-lpthread $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 9009 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + int rc = pthread_create(0,0,0,0); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9025: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9028: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9031: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9034: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + with_pthread=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +with_pthread=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$cf_save_LIBS" + echo "$as_me:9044: result: $with_pthread" >&5 +echo "${ECHO_T}$with_pthread" >&6 + + if test "$with_pthread" = yes ; then + LIBS="-lpthread $LIBS" + cat >>confdefs.h <<\EOF +#define HAVE_LIBPTHREADS 1 +EOF + + else + { { echo "$as_me:9054: error: Cannot link with pthread library" >&5 +echo "$as_me: error: Cannot link with pthread library" >&2;} + { (exit 1); exit 1; }; } + fi + +fi + +fi + +echo "$as_me:9063: checking if you want to use weak-symbols for pthreads" >&5 +echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 + +# Check whether --enable-weak-symbols or --disable-weak-symbols was given. +if test "${enable_weak_symbols+set}" = set; then + enableval="$enable_weak_symbols" + use_weak_symbols=$withval +else + use_weak_symbols=no +fi; +echo "$as_me:9073: result: $use_weak_symbols" >&5 +echo "${ECHO_T}$use_weak_symbols" >&6 +if test "$use_weak_symbols" = yes ; then + +echo "$as_me:9077: checking if $CC supports weak symbols" >&5 +echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 +if test "${cf_cv_weak_symbols+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 9084 "configure" +#include "confdefs.h" + +#include +int +main () +{ + +#if defined(__GNUC__) +# if defined __USE_ISOC99 +# define _cat_pragma(exp) _Pragma(#exp) +# define _weak_pragma(exp) _cat_pragma(weak name) +# else +# define _weak_pragma(exp) +# endif +# define _declare(name) __extension__ extern __typeof__(name) name +# define weak_symbol(name) _weak_pragma(name) _declare(name) __attribute__((weak)) +#endif + +weak_symbol(fopen); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9110: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9113: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9116: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9119: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_weak_symbols=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_weak_symbols=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:9130: result: $cf_cv_weak_symbols" >&5 +echo "${ECHO_T}$cf_cv_weak_symbols" >&6 + +else + cf_cv_weak_symbols=no +fi + +if test $cf_cv_weak_symbols = yes ; then + cat >>confdefs.h <<\EOF +#define USE_WEAK_SYMBOLS 1 +EOF + +fi + +PTHREAD= +if test "$with_pthread" = "yes" ; then + cat >>confdefs.h <<\EOF +#define USE_PTHREADS 1 +EOF + + enable_reentrant=yes + if test $cf_cv_weak_symbols = yes ; then + PTHREAD=-lpthread + fi +fi + +# Reentrant code has to be opaque; there's little advantage to making ncurses +# opaque outside of that, so there is no --enable-opaque option. We can use +# this option without --with-pthreads, but this will be always set for +# pthreads. +echo "$as_me:9160: checking if you want experimental reentrant code" >&5 +echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 + +# Check whether --enable-reentrant or --disable-reentrant was given. +if test "${enable_reentrant+set}" = set; then + enableval="$enable_reentrant" + with_reentrant=$enableval +else + with_reentrant=no +fi; +echo "$as_me:9170: result: $with_reentrant" >&5 +echo "${ECHO_T}$with_reentrant" >&6 +if test "$with_reentrant" = yes ; then + cf_cv_enable_reentrant=1 + if test $cf_cv_weak_symbols = yes ; then + +# remove pthread library from $LIBS +LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` + + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi + cat >>confdefs.h <<\EOF +#define USE_REENTRANT 1 +EOF + +else + cf_cv_enable_reentrant=0 +fi + +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + echo "$as_me:9192: checking for prefix used to wrap public variables" >&5 +echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 + +# Check whether --with-wrap-prefix or --without-wrap-prefix was given. +if test "${with_wrap_prefix+set}" = set; then + withval="$with_wrap_prefix" + NCURSES_WRAP_PREFIX=$withval +else + NCURSES_WRAP_PREFIX=_nc_ +fi; + echo "$as_me:9202: result: $NCURSES_WRAP_PREFIX" >&5 +echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 +else + NCURSES_WRAP_PREFIX=_nc_ +fi + +cat >>confdefs.h <&5 +echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 + +# Check whether --enable-echo or --disable-echo was given. +if test "${enable_echo+set}" = set; then + enableval="$enable_echo" + with_echo=$enableval +else + with_echo=yes +fi; +if test "$with_echo" = yes; then + ECHO_LINK= +else + ECHO_LINK='@ echo linking $@ ... ;' +fi +echo "$as_me:9230: result: $with_echo" >&5 +echo "${ECHO_T}$with_echo" >&6 + +### use option --enable-warnings to turn on all gcc warnings +echo "$as_me:9234: checking if you want to see compiler warnings" >&5 +echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 + +# Check whether --enable-warnings or --disable-warnings was given. +if test "${enable_warnings+set}" = set; then + enableval="$enable_warnings" + with_warnings=$enableval +fi; +echo "$as_me:9242: result: $with_warnings" >&5 +echo "${ECHO_T}$with_warnings" >&6 + +if test "x$with_warnings" = "xyes"; then + ADAFLAGS="$ADAFLAGS -gnatg" + +INTEL_COMPILER=no + +if test "$GCC" = yes ; then + case $host_os in + linux*|gnu*) + echo "$as_me:9253: 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 9258 "configure" +#include "confdefs.h" + +int +main () +{ + +#ifdef __INTEL_COMPILER +#else +make an error +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9275: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9278: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9281: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9284: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + INTEL_COMPILER=yes +cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" + +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:9295: result: $INTEL_COMPILER" >&5 +echo "${ECHO_T}$INTEL_COMPILER" >&6 + ;; + esac +fi + +cat > conftest.$ac_ext <&5 +echo "$as_me: checking for $CC warning options..." >&6;} + cf_save_CFLAGS="$CFLAGS" + EXTRA_CFLAGS="-Wall" + for cf_opt in \ + wd1419 \ + wd1683 \ + wd1684 \ + wd193 \ + wd593 \ + wd279 \ + wd810 \ + wd869 \ + wd981 + do + CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" + if { (eval echo "$as_me:9335: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9338: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:9340: 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 +then + { echo "$as_me:9349: checking for $CC warning options..." >&5 +echo "$as_me: checking for $CC warning options..." >&6;} + cf_save_CFLAGS="$CFLAGS" + EXTRA_CFLAGS= + cf_warn_CONST="" + test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" + for cf_opt in W Wall \ + Wbad-function-cast \ + Wcast-align \ + Wcast-qual \ + Winline \ + Wmissing-declarations \ + Wmissing-prototypes \ + Wnested-externs \ + Wpointer-arith \ + Wshadow \ + Wstrict-prototypes \ + Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum + do + CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" + if { (eval echo "$as_me:9369: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9372: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:9374: result: ... -$cf_opt" >&5 +echo "${ECHO_T}... -$cf_opt" >&6 + case $cf_opt in #(vi + Wcast-qual) #(vi + CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" + ;; + Winline) #(vi + case $GCC_VERSION in + [34].*) + test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 + +echo "${as_me:-configure}:9385: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 + + continue;; + esac + ;; + esac + EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" + fi + done + CFLAGS="$cf_save_CFLAGS" +fi +rm -rf conftest* + +fi + +if test "$GCC" = yes +then +cat > conftest.i <&5 +echo "$as_me: checking for $CC __attribute__ directives..." >&6;} +cat > conftest.$ac_ext <&5 + + case $cf_attribute in #(vi + printf) #(vi + cf_printf_attribute=yes + cat >conftest.h <conftest.h <conftest.h <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9473: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:9475: result: ... $cf_attribute" >&5 +echo "${ECHO_T}... $cf_attribute" >&6 + cat conftest.h >>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h +fi +rm -rf conftest* +fi + +### use option --enable-assertions to turn on generation of assertion code +echo "$as_me:9511: checking if you want to enable runtime assertions" >&5 +echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 + +# Check whether --enable-assertions or --disable-assertions was given. +if test "${enable_assertions+set}" = set; then + enableval="$enable_assertions" + with_assertions=$enableval +else + with_assertions=no +fi; +echo "$as_me:9521: result: $with_assertions" >&5 +echo "${ECHO_T}$with_assertions" >&6 +if test -n "$GCC" +then + if test "$with_assertions" = no + then + cat >>confdefs.h <<\EOF +#define NDEBUG 1 +EOF + + CPPFLAGS="$CPPFLAGS -DNDEBUG" + else + ADAFLAGS="$ADAFLAGS -gnata" + fi +fi + +### use option --disable-leaks to suppress "permanent" leaks, for testing +cat >>confdefs.h <<\EOF +#define HAVE_NC_ALLOC_H 1 +EOF + +### use option --enable-expanded to generate certain macros as functions + +# Check whether --enable-expanded or --disable-expanded was given. +if test "${enable_expanded+set}" = set; then + enableval="$enable_expanded" + test "$enableval" = yes && cat >>confdefs.h <<\EOF +#define NCURSES_EXPANDED 1 +EOF + +fi; + +### use option --disable-macros to suppress macros in favor of functions + +# Check whether --enable-macros or --disable-macros was given. +if test "${enable_macros+set}" = set; then + enableval="$enable_macros" + test "$enableval" = no && cat >>confdefs.h <<\EOF +#define NCURSES_NOMACROS 1 +EOF + +fi; + +# Normally we only add trace() to the debug-library. Allow this to be +# extended to all models of the ncurses library: +cf_all_traces=no +case "$CFLAGS $CPPFLAGS" in +*-DTRACE*) + cf_all_traces=yes + ;; +esac + +echo "$as_me:9573: checking whether to add trace feature to all models" >&5 +echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 + +# Check whether --with-trace or --without-trace was given. +if test "${with_trace+set}" = set; then + withval="$with_trace" + cf_with_trace=$withval +else + cf_with_trace=$cf_all_traces +fi; +echo "$as_me:9583: result: $cf_with_trace" >&5 +echo "${ECHO_T}$cf_with_trace" >&6 + +if test "$cf_with_trace" = yes ; then + ADA_TRACE=TRUE + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in -DTRACE +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +else + ADA_TRACE=FALSE +fi + +### Checks for libraries. +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) +echo "$as_me:9676: checking for gettimeofday" >&5 +echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 +if test "${ac_cv_func_gettimeofday+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 9682 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gettimeofday (); below. */ +#include +/* 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 gettimeofday (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_gettimeofday) || defined (__stub___gettimeofday) +choke me +#else +f = gettimeofday; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9713: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9716: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9719: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9722: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_gettimeofday=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:9732: result: $ac_cv_func_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 +if test $ac_cv_func_gettimeofday = yes; then + cat >>confdefs.h <<\EOF +#define HAVE_GETTIMEOFDAY 1 +EOF + +else + +echo "$as_me:9741: checking for gettimeofday in -lbsd" >&5 +echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gettimeofday+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 9749 "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 gettimeofday (); +int +main () +{ +gettimeofday (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9768: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9771: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9774: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9777: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gettimeofday=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_bsd_gettimeofday=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:9788: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 +if test $ac_cv_lib_bsd_gettimeofday = yes; then + cat >>confdefs.h <<\EOF +#define HAVE_GETTIMEOFDAY 1 +EOF + + LIBS="$LIBS -lbsd" +fi + +fi + ;; +esac + +### Checks for header files. +echo "$as_me:9803: 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 9809 "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:9817: \"$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:9823: \$? = $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 + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +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 9845 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -rf conftest* + +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 9863 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -rf conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line 9884 "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + $ac_main_return(2); + $ac_main_return (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:9910: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9913: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:9915: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9918: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:9931: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +echo "$as_me:9944: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 9950 "configure" +#include "confdefs.h" +#include +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:9965: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:9968: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:9971: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9974: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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.$ac_objext conftest.$ac_ext +fi +echo "$as_me:9984: 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 <&5 +echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 +if test "${ac_cv_lib_dir_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldir $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 10005 "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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10024: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10027: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10030: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10033: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dir_opendir=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dir_opendir=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10044: result: $ac_cv_lib_dir_opendir" >&5 +echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 +if test $ac_cv_lib_dir_opendir = yes; then + LIBS="$LIBS -ldir" +fi + +else + echo "$as_me:10051: checking for opendir in -lx" >&5 +echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 +if test "${ac_cv_lib_x_opendir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lx $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 10059 "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 opendir (); +int +main () +{ +opendir (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10078: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10081: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10084: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10087: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_x_opendir=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_x_opendir=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10098: result: $ac_cv_lib_x_opendir" >&5 +echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 +if test $ac_cv_lib_x_opendir = yes; then + LIBS="$LIBS -lx" +fi + +fi + +echo "$as_me:10106: 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 10112 "configure" +#include "confdefs.h" +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:10128: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10131: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:10134: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10137: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:10147: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +### checks for compiler characteristics +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:10165: 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 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line 10173 "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:10222: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10225: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:10228: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10231: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:10248: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:10251: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:10256: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 10262 "configure" +#include "confdefs.h" + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:10320: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10323: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:10326: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10329: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:10339: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\EOF +#define const +EOF + +fi + +### Checks for external-data + +echo "$as_me:10351: checking if data-only library module links" >&5 +echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 +if test "${cf_cv_link_dataonly+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + rm -f conftest.a + cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10365: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + mv conftest.o data.o && \ + ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null + fi + rm -f conftest.$ac_ext data.o + cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10388: \$? = $ac_status" >&5 + (exit $ac_status); }; then + mv conftest.o func.o && \ + ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null + fi + rm -f conftest.$ac_ext func.o + ( eval $RANLIB conftest.a ) 2>&5 >/dev/null + cf_saveLIBS="$LIBS" + LIBS="conftest.a $LIBS" + if test "$cross_compiling" = yes; then + cf_cv_link_dataonly=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 10401 "configure" +#include "confdefs.h" + + int main() + { + extern int testfunc(); + ${cf_cv_main_return:-return} (!testfunc()); + } + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:10412: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10415: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:10417: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10420: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_link_dataonly=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_cv_link_dataonly=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + LIBS="$cf_saveLIBS" + +fi + +echo "$as_me:10435: result: $cf_cv_link_dataonly" >&5 +echo "${ECHO_T}$cf_cv_link_dataonly" >&6 + +if test "$cf_cv_link_dataonly" = no ; then + cat >>confdefs.h <<\EOF +#define BROKEN_LINKER 1 +EOF + + BROKEN_LINKER=1 +fi + +### Checks for library functions. + +echo "$as_me:10448: checking for working mkstemp" >&5 +echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 +if test "${cf_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rm -rf conftest* +if test "$cross_compiling" = yes; then + echo "$as_me:10456: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 10462 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. */ +#include +/* 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 mkstemp (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_mkstemp) || defined (__stub___mkstemp) +choke me +#else +f = mkstemp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10493: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10496: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10499: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10502: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkstemp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_mkstemp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:10512: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 + +else + cat >conftest.$ac_ext <<_ACEOF +#line 10517 "configure" +#include "confdefs.h" + +#include +#include +#include +#include +#include +int main() +{ + char *tmpl = "conftestXXXXXX"; + char name[2][80]; + int n; + int result = 0; + int fd; + struct stat sb; + + umask(077); + for (n = 0; n < 2; ++n) { + strcpy(name[n], tmpl); + if ((fd = mkstemp(name[n])) >= 0) { + if (!strcmp(name[n], tmpl) + || stat(name[n], &sb) != 0 + || (sb.st_mode & S_IFMT) != S_IFREG + || (sb.st_mode & 077) != 0) { + result = 1; + } + close(fd); + } + } + if (result == 0 + && !strcmp(name[0], name[1])) + result = 1; + ${cf_cv_main_return:-return}(result); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:10555: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10558: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:10560: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10563: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_mkstemp=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_cv_func_mkstemp=no + +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi +echo "$as_me:10578: result: $cf_cv_func_mkstemp" >&5 +echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then + cat >>confdefs.h <<\EOF +#define HAVE_MKSTEMP 1 +EOF + +fi + +echo "$as_me:10587: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 10593 "configure" +#include "confdefs.h" +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:10615: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:10618: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:10621: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10624: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_signal=int +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:10634: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_gnat_exists+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$gnat_exists"; then + ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_gnat_exists="yes" +echo "$as_me:10666: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no" +fi +fi +gnat_exists=$ac_cv_prog_gnat_exists +if test -n "$gnat_exists"; then + echo "$as_me:10675: result: $gnat_exists" >&5 +echo "${ECHO_T}$gnat_exists" >&6 +else + echo "$as_me:10678: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= +else + +echo "$as_me:10686: checking for gnat version" >&5 +echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[0-9].[0-9][0-9]*' |\ + sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` +echo "$as_me:10691: result: $cf_gnat_version" >&5 +echo "${ECHO_T}$cf_gnat_version" >&6 + +case $cf_gnat_version in #(vi +3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + { echo "$as_me:10699: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 +echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} + cf_cv_prog_gnat_correct=no + ;; +esac + +echo "$as_me:10705: checking if GNAT supports generics" >&5 +echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[1-9]*|[4-9].*) #(vi + cf_gnat_generics=yes + ;; +*) + cf_gnat_generics=no + ;; +esac +echo "$as_me:10715: result: $cf_gnat_generics" >&5 +echo "${ECHO_T}$cf_gnat_generics" >&6 + +if test "$cf_gnat_generics" = yes +then + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" +else + cf_compile_generics= + cf_generic_objects= +fi + +echo "$as_me:10727: checking if GNAT supports project files" >&5 +echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[0-9]*) #(vi + cf_gnat_projects=no + ;; +*) + case $cf_cv_system_name in #(vi + cygwin*) #(vi + cf_gnat_projects=no + ;; + *) + cf_gnat_projects=yes + ;; + esac + ;; +esac +echo "$as_me:10744: result: $cf_gnat_projects" >&5 +echo "${ECHO_T}$cf_gnat_projects" >&6 + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi + + # Extract the first word of "m4", so it can be a program name with args. +set dummy m4; ac_word=$2 +echo "$as_me:10758: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_M4_exists+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$M4_exists"; then + ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_M4_exists="yes" +echo "$as_me:10773: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no" +fi +fi +M4_exists=$ac_cv_prog_M4_exists +if test -n "$M4_exists"; then + echo "$as_me:10782: result: $M4_exists" >&5 +echo "${ECHO_T}$M4_exists" >&6 +else + echo "$as_me:10785: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test "$ac_cv_prog_M4_exists" = no; then + cf_cv_prog_gnat_correct=no + echo Ada95 binding required program m4 not found. Ada95 binding disabled. + fi + if test "$cf_cv_prog_gnat_correct" = yes; then + echo "$as_me:10794: checking if GNAT works" >&5 +echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 + +rm -rf conftest* +cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then + if ( ./conftest 1>&5 2>&1 ) ; then + cf_cv_prog_gnat_correct=yes + else + cf_cv_prog_gnat_correct=no + fi +else + cf_cv_prog_gnat_correct=no +fi +rm -rf conftest* + + echo "$as_me:10822: result: $cf_cv_prog_gnat_correct" >&5 +echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 + fi +fi + + if test "$cf_cv_prog_gnat_correct" = yes; then + + ADAFLAGS="$ADAFLAGS -O3 -gnatpn" + +echo "$as_me:10831: checking if GNAT pragma Unreferenced works" >&5 +echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 +if test "${cf_cv_pragma_unreferenced+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rm -rf conftest* +cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then + cf_cv_pragma_unreferenced=yes +else + cf_cv_pragma_unreferenced=no +fi +rm -rf conftest* + +fi +echo "$as_me:10862: result: $cf_cv_pragma_unreferenced" >&5 +echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 + +# if the pragma is supported, use it (needed in the Trace code). +if test $cf_cv_pragma_unreferenced = yes ; then + PRAGMA_UNREF=TRUE +else + PRAGMA_UNREF=FALSE +fi + +echo "$as_me:10872: checking for ada-compiler" >&5 +echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 + +# Check whether --with-ada-compiler or --without-ada-compiler was given. +if test "${with_ada_compiler+set}" = set; then + withval="$with_ada_compiler" + cf_ada_compiler=$withval +else + cf_ada_compiler=gnatmake +fi; + +echo "$as_me:10883: result: $cf_ada_compiler" >&5 +echo "${ECHO_T}$cf_ada_compiler" >&6 + + cf_ada_package=terminal_interface + +echo "$as_me:10888: checking for ada-include" >&5 +echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 + +# Check whether --with-ada-include or --without-ada-include was given. +if test "${with_ada_include+set}" = set; then + withval="$with_ada_include" + +else + withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}" +fi; if test -n "$prefix/share/ada/adainclude" ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$withval" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:10924: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi +ADA_INCLUDE="$withval" + +echo "$as_me:10933: result: $ADA_INCLUDE" >&5 +echo "${ECHO_T}$ADA_INCLUDE" >&6 + +echo "$as_me:10936: checking for ada-objects" >&5 +echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 + +# Check whether --with-ada-objects or --without-ada-objects was given. +if test "${with_ada_objects+set}" = set; then + withval="$with_ada_objects" + +else + withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}" +fi; if test -n "$prefix/lib/ada/adalib" ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$withval" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:10972: error: expected a pathname, not \"$withval\"" >&5 +echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi +ADA_OBJECTS="$withval" + +echo "$as_me:10981: result: $ADA_OBJECTS" >&5 +echo "${ECHO_T}$ADA_OBJECTS" >&6 + +echo "$as_me:10984: checking if an Ada95 shared-library should be built" >&5 +echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 + +# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. +if test "${with_ada_sharedlib+set}" = set; then + withval="$with_ada_sharedlib" + with_ada_sharedlib=$withval +else + with_ada_sharedlib=no +fi; +echo "$as_me:10994: result: $with_ada_sharedlib" >&5 +echo "${ECHO_T}$with_ada_sharedlib" >&6 + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + + fi +fi + +################################################################################ + +# not needed +TINFO_ARGS2= + +### Construct the list of include-directories to be generated + +CPPFLAGS="$CPPFLAGS -I. -I../include" +if test "$srcdir" != "."; then + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" +fi +if test "$GCC" != yes; then + CPPFLAGS="$CPPFLAGS -I\${includedir}" +elif test "$includedir" != "/usr/include"; then + if test "$includedir" = '${prefix}/include' ; then + if test $prefix != /usr ; then + CPPFLAGS="$CPPFLAGS -I\${includedir}" + fi + else + CPPFLAGS="$CPPFLAGS -I\${includedir}" + fi +fi + +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" +if test "$srcdir" != "."; then + ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" +fi +if test "$GCC" != yes; then + ACPPFLAGS="$ACPPFLAGS -I\${includedir}" +elif test "$includedir" != "/usr/include"; then + if test "$includedir" = '${prefix}/include' ; then + if test $prefix != /usr ; then + ACPPFLAGS="$ACPPFLAGS -I\${includedir}" + fi + else + ACPPFLAGS="$ACPPFLAGS -I\${includedir}" + fi +fi + +### Build up pieces for makefile rules +echo "$as_me:11052: checking default library suffix" >&5 +echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 + + case $DFT_LWR_MODEL in + libtool) DFT_ARG_SUFFIX='' ;; + normal) DFT_ARG_SUFFIX='' ;; + debug) DFT_ARG_SUFFIX='_g' ;; + profile) DFT_ARG_SUFFIX='_p' ;; + shared) DFT_ARG_SUFFIX='' ;; + esac + test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" +echo "$as_me:11063: result: $DFT_ARG_SUFFIX" >&5 +echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 + +echo "$as_me:11066: checking default library-dependency suffix" >&5 +echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 + + case $DFT_LWR_MODEL in #(vi + libtool) #(vi + DFT_LIB_SUFFIX='.la' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + normal) #(vi + DFT_LIB_SUFFIX='.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + debug) #(vi + DFT_LIB_SUFFIX='_g.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + profile) #(vi + DFT_LIB_SUFFIX='_p.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + shared) #(vi + case $cf_cv_system_name in + aix[56]*) #(vi + DFT_LIB_SUFFIX='.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + cygwin*) #(vi + DFT_LIB_SUFFIX='.dll' + DFT_DEP_SUFFIX='.dll.a' + ;; + darwin*) #(vi + DFT_LIB_SUFFIX='.dylib' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + hpux*) #(vi + case $target in + ia64*) #(vi + DFT_LIB_SUFFIX='.so' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + *) #(vi + DFT_LIB_SUFFIX='.sl' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + esac + ;; + *) DFT_LIB_SUFFIX='.so' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + esac + esac + test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" + test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" +echo "$as_me:11119: result: $DFT_DEP_SUFFIX" >&5 +echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 + +echo "$as_me:11122: checking default object directory" >&5 +echo $ECHO_N "checking default object directory... $ECHO_C" >&6 + + case $DFT_LWR_MODEL in + libtool) DFT_OBJ_SUBDIR='obj_lo' ;; + normal) DFT_OBJ_SUBDIR='objects' ;; + debug) DFT_OBJ_SUBDIR='obj_g' ;; + profile) DFT_OBJ_SUBDIR='obj_p' ;; + shared) + case $cf_cv_system_name in #(vi + cygwin) #(vi + DFT_OBJ_SUBDIR='objects' ;; + *) + DFT_OBJ_SUBDIR='obj_s' ;; + esac + esac +echo "$as_me:11138: result: $DFT_OBJ_SUBDIR" >&5 +echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 + +### Set up low-level terminfo dependencies for makefiles. + +if test "$DFT_LWR_MODEL" = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + # "lib" files have ".dll.a" suffix, "cyg" files have ".dll" + ;; + esac +fi + +### Construct the list of subdirectories for which we'll customize makefiles +### with the appropriate compile-rules. + +SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in" + +cat >>confdefs.h <confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +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:11351: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:11527: 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;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:11546: 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;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me 2.52.20101001, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; + *) { { echo "$as_me:11616: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@top_builddir@,$top_builddir,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t +s,@PROG_EXT@,$PROG_EXT,;t t +s,@AWK@,$AWK,;t t +s,@EGREP@,$EGREP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@LN_S@,$LN_S,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@CTAGS@,$CTAGS,;t t +s,@ETAGS@,$ETAGS,;t t +s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t +s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t +s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@LD@,$LD,;t t +s,@ac_ct_LD@,$ac_ct_LD,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@ARFLAGS@,$ARFLAGS,;t t +s,@DESTDIR@,$DESTDIR,;t t +s,@BUILD_CC@,$BUILD_CC,;t t +s,@BUILD_CPP@,$BUILD_CPP,;t t +s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t +s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t +s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t +s,@BUILD_LIBS@,$BUILD_LIBS,;t t +s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t +s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t +s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t +s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t +s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t +s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t +s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t +s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t +s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t +s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t +s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t +s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t +s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t +s,@LIB_PREFIX@,$LIB_PREFIX,;t t +s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t +s,@CC_G_OPT@,$CC_G_OPT,;t t +s,@LD_MODEL@,$LD_MODEL,;t t +s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t +s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t +s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t +s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t +s,@LINK_PROGS@,$LINK_PROGS,;t t +s,@LINK_TESTS@,$LINK_TESTS,;t t +s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t +s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t +s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t +s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t +s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t +s,@NCURSES_CONST@,$NCURSES_CONST,;t t +s,@PTHREAD@,$PTHREAD,;t t +s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t +s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t +s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t +s,@ADA_TRACE@,$ADA_TRACE,;t t +s,@gnat_exists@,$gnat_exists,;t t +s,@cf_compile_generics@,$cf_compile_generics,;t t +s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t +s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t +s,@M4_exists@,$M4_exists,;t t +s,@cf_ada_make@,$cf_ada_make,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t +s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t +s,@cf_ada_compiler@,$cf_ada_compiler,;t t +s,@cf_ada_package@,$cf_ada_package,;t t +s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t +s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t +s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t +s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t +s,@TINFO_ARGS2@,$TINFO_ARGS2,;t t +s,@ACPPFLAGS@,$ACPPFLAGS,;t t +s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t +s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t +s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t +s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t +s,@cross_compiling@,$cross_compiling,;t t +s,@TEST_ARG2@,$TEST_ARG2,;t t +s,@TEST_LIBS2@,$TEST_LIBS2,;t t +s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t +s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t +s,@NCURSES_TREE@,$NCURSES_TREE,;t t +s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # 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 + if test -z "$ac_sed_cmds"; then + 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" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:11927: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:11945: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:11958: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_iB='\([ ]\),\1#\2define\3' +ac_iC=' ' +ac_iD='\4,;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:12024: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:12035: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:12048: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into a list of #define's. We won't use it as a sed +# script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to +# be either 'cat' or 'sort'. +cat confdefs.h | uniq >conftest.vals + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +echo ' rm -f conftest.frag' >> $CONFIG_STATUS +while grep . conftest.vals >/dev/null +do + # Write chunks of a limited-size here document to conftest.frag. + echo ' cat >> conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS + echo 'CEOF' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +# Run sed to substitute the contents of conftest.frag into $tmp/in at the +# marker @DEFS@. +echo ' cat >> conftest.edit < $tmp/out +rm -f $tmp/in +mv $tmp/out $tmp/in +rm -f conftest.edit conftest.frag +' >> $CONFIG_STATUS + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + 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:12106: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +EOF +cat >>$CONFIG_STATUS <<\EOF +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + default ) +if test -z "$USE_OLD_MAKERULES" ; then + $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile +fi + ;; + esac +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi +${MAKE:-make} preinstall diff --git a/Ada95/configure.in b/Ada95/configure.in new file mode 100644 index 00000000000..3b721395482 --- /dev/null +++ b/Ada95/configure.in @@ -0,0 +1,626 @@ +dnl*************************************************************************** +dnl Copyright (c) 2010 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl Author: Thomas E. Dickey +dnl +dnl $Id: configure.in,v 1.21 2010/11/06 22:11:21 tom Exp $ +dnl Process this file with autoconf to produce a configure script. +dnl +dnl See http://invisible-island.net/autoconf/ for additional information. +dnl +dnl --------------------------------------------------------------------------- +AC_PREREQ(2.13.20020210) +AC_REVISION($Revision: 1.21 $) +AC_INIT(gen/gen.c) +AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) + +CF_TOP_BUILDDIR + +CF_CHECK_CACHE([AC_CANONICAL_SYSTEM]) +AC_ARG_WITH(system-type, +[ --with-system-type=XXX test: override derived host system-type], +[AC_MSG_WARN(overriding system type to $withval) + cf_cv_system_name=$withval]) + +### Save the given $CFLAGS to allow user-override. +cf_user_CFLAGS="$CFLAGS" + +### Default install-location +CF_CFG_DEFAULTS + +### Checks for programs. +AC_PROG_CC +CF_GCC_VERSION + +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL +CF_PROG_CC_C_O(CC) +AC_ISC_POSIX +CF_ANSI_CC_REQD +CF_PROG_EXT + +AC_ARG_PROGRAM + +CF_PROG_AWK +CF_PROG_EGREP +AC_PROG_INSTALL +CF_PROG_LN_S + +AC_SYS_LONG_FILE_NAMES + +# if we find pkg-config, check if we should install the ".pc" files. +CF_PKG_CONFIG + +if test "$PKG_CONFIG" != no ; then + AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) + AC_MSG_RESULT($enable_pc_files) + else + AC_MSG_RESULT(no) + AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR) + enable_pc_files=no + fi +fi +AC_SUBST(PKG_CONFIG_LIBDIR) + +AC_MSG_CHECKING(if you want to build test-programs) +AC_ARG_WITH(tests, + [ --without-tests suppress build with test-programs], + [cf_with_tests=$withval], + [cf_with_tests=yes]) +AC_MSG_RESULT($cf_with_tests) + +AC_MSG_CHECKING(if we should assume mixed-case filenames) +AC_ARG_ENABLE(mixed-case, + [ --enable-mixed-case tic should assume mixed-case filenames], + [enable_mixedcase=$enableval], + [enable_mixedcase=auto]) +AC_MSG_RESULT($enable_mixedcase) +if test "$enable_mixedcase" = "auto" ; then + CF_MIXEDCASE_FILENAMES +else + cf_cv_mixedcase=$enable_mixedcase + if test "$enable_mixedcase" = "yes" ; then + AC_DEFINE(MIXEDCASE_FILENAMES) + fi +fi + +# do this after mixed-case option (tags/TAGS is not as important as tic). +AC_PROG_MAKE_SET +CF_MAKE_TAGS +CF_MAKEFLAGS + +dnl These are standard among *NIX systems, but not when cross-compiling +AC_CHECK_TOOL(RANLIB, ranlib, ':') +AC_CHECK_TOOL(LD, ld, ld) +AC_CHECK_TOOL(AR, ar, ar) +CF_AR_FLAGS + +dnl Special option for use by system-builders: the install-prefix is used to +dnl adjust the location into which the actual install is done, so that an +dnl archive can be built without modifying the host system's configuration. +AC_MSG_CHECKING(if you have specified an install-prefix) +AC_ARG_WITH(install-prefix, + [ --with-install-prefix prefixes actual install-location ($DESTDIR)], + [case "$withval" in #(vi + yes|no) #(vi + ;; + *) DESTDIR="$withval" + ;; + esac]) +AC_MSG_RESULT($DESTDIR) +AC_SUBST(DESTDIR) + +############################################################################### +CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:) +# If we're cross-compiling, allow the user to override the tools and their +# options. The configure script is oriented toward identifying the host +# compiler, etc., but we need a build compiler to generate parts of the source. +CF_BUILD_CC + +############################################################################### +CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) + +### Options to allow the user to specify the set of libraries which are used. +### Use "--without-normal --with-shared" to allow the default model to be +### shared, for example. +cf_list_models="" +AC_MSG_CHECKING(for specified models) +test -z "$cf_list_models" && cf_list_models=normal +AC_MSG_RESULT($cf_list_models) + +### Use the first model as the default, and save its suffix for use in building +### up test-applications. +AC_MSG_CHECKING(for default model) +DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` +AC_MSG_RESULT($DFT_LWR_MODEL) + +CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl + +AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal") +AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL") + +CF_NCURSES_ADDON + +CF_LIB_PREFIX(cf_prefix) +LIB_PREFIX=$cf_prefix +AC_SUBST(LIB_PREFIX) + +LIB_SUFFIX= +AC_SUBST(LIB_SUFFIX) + +############################################################################### + +dnl Not all ports of gcc support the -g option + +if test X"$CC_G_OPT" = X"" ; then + CC_G_OPT='-g' + test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT='' +fi +AC_SUBST(CC_G_OPT) + +AC_MSG_CHECKING(for default loader flags) +case $DFT_LWR_MODEL in +normal) LD_MODEL='' ;; +debug) LD_MODEL=$CC_G_OPT ;; +profile) LD_MODEL='-pg';; +shared) LD_MODEL='' ;; +esac +AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg) +AC_MSG_RESULT($LD_MODEL) + +CF_SHARED_OPTS + +############################################################################### +CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) + +CF_PATHSEP + +### use option --enable-broken-linker to force on use of broken-linker support +AC_MSG_CHECKING(if you want broken-linker support code) +AC_ARG_ENABLE(broken_linker, + [ --enable-broken_linker compile with broken-linker support code], + [with_broken_linker=$enableval], + [with_broken_linker=${BROKEN_LINKER:-no}]) +AC_MSG_RESULT($with_broken_linker) + +BROKEN_LINKER=0 +if test "$with_broken_linker" = yes ; then + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 +elif test "$DFT_LWR_MODEL" = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + AC_DEFINE(BROKEN_LINKER) + BROKEN_LINKER=1 + CF_VERBOSE(cygwin linker is broken anyway) + ;; + esac +fi +AC_SUBST(BROKEN_LINKER) + +# Check to define _XOPEN_SOURCE "automatically" +CF_XOPEN_SOURCE + +CF_LARGEFILE + +### Enable compiling-in rcs id's +AC_MSG_CHECKING(if RCS identifiers should be compiled-in) +AC_ARG_WITH(rcs-ids, + [ --with-rcs-ids compile-in RCS identifiers], + [with_rcs_ids=$withval], + [with_rcs_ids=no]) +AC_MSG_RESULT($with_rcs_ids) +test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) + +############################################################################### +CF_HELP_MESSAGE(Extensions:) + +### Note that some functions (such as const) are normally disabled anyway. +AC_MSG_CHECKING(if you want to build with function extensions) +AC_ARG_ENABLE(ext-funcs, + [ --disable-ext-funcs disable function-extensions], + [with_ext_funcs=$enableval], + [with_ext_funcs=yes]) +AC_MSG_RESULT($with_ext_funcs) +if test "$with_ext_funcs" = yes ; then + NCURSES_EXT_FUNCS=1 + AC_DEFINE(HAVE_USE_DEFAULT_COLORS) + AC_DEFINE(NCURSES_EXT_FUNCS) +else + NCURSES_EXT_FUNCS=0 +fi +AC_SUBST(NCURSES_EXT_FUNCS) + +### use option --enable-const to turn on use of const beyond that in XSI. +AC_MSG_CHECKING(for extended use of const keyword) +AC_ARG_ENABLE(const, + [ --enable-const compile with extra/non-standard const], + [with_ext_const=$enableval], + [with_ext_const=no]) +AC_MSG_RESULT($with_ext_const) +NCURSES_CONST='/*nothing*/' +if test "$with_ext_const" = yes ; then + NCURSES_CONST=const +fi +AC_SUBST(NCURSES_CONST) + +############################################################################### +# These options are relatively safe to experiment with. +CF_HELP_MESSAGE(Development Code:) +AC_MSG_CHECKING(if you want all development code) +AC_ARG_WITH(develop, + [ --without-develop disable development options], + [with_develop=$withval], + [with_develop=no]) +AC_MSG_RESULT($with_develop) + +############################################################################### +# These are just experimental, probably should not be in a package: +CF_HELP_MESSAGE(Experimental Code:) + +# This is still experimental (20080329), but should ultimately be moved to +# the script-block --with-normal, etc. +CF_WITH_PTHREAD + +AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) +AC_ARG_ENABLE(weak-symbols, + [ --enable-weak-symbols enable weak-symbols for pthreads], + [use_weak_symbols=$withval], + [use_weak_symbols=no]) +AC_MSG_RESULT($use_weak_symbols) +if test "$use_weak_symbols" = yes ; then + CF_WEAK_SYMBOLS +else + cf_cv_weak_symbols=no +fi + +if test $cf_cv_weak_symbols = yes ; then + AC_DEFINE(USE_WEAK_SYMBOLS) +fi + +PTHREAD= +if test "$with_pthread" = "yes" ; then + AC_DEFINE(USE_PTHREADS) + enable_reentrant=yes + if test $cf_cv_weak_symbols = yes ; then + PTHREAD=-lpthread + fi +fi +AC_SUBST(PTHREAD) + +# Reentrant code has to be opaque; there's little advantage to making ncurses +# opaque outside of that, so there is no --enable-opaque option. We can use +# this option without --with-pthreads, but this will be always set for +# pthreads. +AC_MSG_CHECKING(if you want experimental reentrant code) +AC_ARG_ENABLE(reentrant, + [ --enable-reentrant compile with experimental reentrant code], + [with_reentrant=$enableval], + [with_reentrant=no]) +AC_MSG_RESULT($with_reentrant) +if test "$with_reentrant" = yes ; then + cf_cv_enable_reentrant=1 + if test $cf_cv_weak_symbols = yes ; then + CF_REMOVE_LIB(LIBS,$LIBS,pthread) + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi + AC_DEFINE(USE_REENTRANT) +else + cf_cv_enable_reentrant=0 +fi +AC_SUBST(cf_cv_enable_reentrant) + +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + AC_MSG_CHECKING(for prefix used to wrap public variables) + AC_ARG_WITH(wrap-prefix, + [ --with-wrap-prefix=XXX override prefix used for public variables], + [NCURSES_WRAP_PREFIX=$withval], + [NCURSES_WRAP_PREFIX=_nc_]) + AC_MSG_RESULT($NCURSES_WRAP_PREFIX) +else + NCURSES_WRAP_PREFIX=_nc_ +fi +AC_SUBST(NCURSES_WRAP_PREFIX) +AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX") + +############################################################################### +CF_HELP_MESSAGE(Testing/development Options:) + +### use option --disable-echo to suppress full display compiling commands +AC_MSG_CHECKING(if you want to display full commands during build) +AC_ARG_ENABLE(echo, + [ --enable-echo build: display "compiling" commands (default)], + [with_echo=$enableval], + [with_echo=yes]) +if test "$with_echo" = yes; then + ECHO_LINK= +else + ECHO_LINK='@ echo linking $@ ... ;' +fi +AC_MSG_RESULT($with_echo) +AC_SUBST(ECHO_LINK) + +### use option --enable-warnings to turn on all gcc warnings +AC_MSG_CHECKING(if you want to see compiler warnings) +AC_ARG_ENABLE(warnings, + [ --enable-warnings build: turn on GCC compiler warnings], + [with_warnings=$enableval]) +AC_MSG_RESULT($with_warnings) + +if test "x$with_warnings" = "xyes"; then + ADAFLAGS="$ADAFLAGS -gnatg" + CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) +fi +CF_GCC_ATTRIBUTES + +### use option --enable-assertions to turn on generation of assertion code +AC_MSG_CHECKING(if you want to enable runtime assertions) +AC_ARG_ENABLE(assertions, + [ --enable-assertions test: turn on generation of assertion code], + [with_assertions=$enableval], + [with_assertions=no]) +AC_MSG_RESULT($with_assertions) +if test -n "$GCC" +then + if test "$with_assertions" = no + then + AC_DEFINE(NDEBUG) + CPPFLAGS="$CPPFLAGS -DNDEBUG" + else + ADAFLAGS="$ADAFLAGS -gnata" + fi +fi + +### use option --disable-leaks to suppress "permanent" leaks, for testing +AC_DEFINE(HAVE_NC_ALLOC_H) + +### use option --enable-expanded to generate certain macros as functions +AC_ARG_ENABLE(expanded, + [ --enable-expanded test: generate functions for certain macros], + [test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)]) + +### use option --disable-macros to suppress macros in favor of functions +AC_ARG_ENABLE(macros, + [ --disable-macros test: use functions rather than macros], + [test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)]) + +# Normally we only add trace() to the debug-library. Allow this to be +# extended to all models of the ncurses library: +cf_all_traces=no +case "$CFLAGS $CPPFLAGS" in +*-DTRACE*) + cf_all_traces=yes + ;; +esac + +AC_MSG_CHECKING(whether to add trace feature to all models) +AC_ARG_WITH(trace, +[ --with-trace test: add trace() function to all models of ncurses], +[cf_with_trace=$withval], +[cf_with_trace=$cf_all_traces]) +AC_MSG_RESULT($cf_with_trace) + +if test "$cf_with_trace" = yes ; then + ADA_TRACE=TRUE + CF_ADD_CFLAGS(-DTRACE) +else + ADA_TRACE=FALSE +fi + +AC_SUBST(ADA_TRACE) + +### Checks for libraries. +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) +AC_CHECK_FUNC(gettimeofday, + AC_DEFINE(HAVE_GETTIMEOFDAY),[ + +AC_CHECK_LIB(bsd, gettimeofday, + AC_DEFINE(HAVE_GETTIMEOFDAY) + LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday + ;; +esac + +### Checks for header files. +AC_STDC_HEADERS +AC_HEADER_DIRENT +AC_HEADER_TIME + +### checks for compiler characteristics +AC_LANG_C +AC_C_CONST + +### Checks for external-data +CF_LINK_DATAONLY + +### Checks for library functions. +CF_MKSTEMP + +AC_TYPE_SIGNAL + +dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS +if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then + CF_STRIP_G_OPT(CFLAGS) + CF_STRIP_G_OPT(CXXFLAGS) +fi + +CF_HELP_MESSAGE(Ada95 Binding Options:) + +dnl Check for availability of GNU Ada Translator (GNAT). +dnl At the moment we support no other Ada95 compiler. +if test "$cf_with_ada" != "no" ; then + CF_PROG_GNAT + if test "$cf_cv_prog_gnat_correct" = yes; then + CF_ADD_ADAFLAGS(-O3 -gnatpn) + + CF_GNAT_PRAGMA_UNREF + + CF_WITH_ADA_COMPILER + + cf_ada_package=terminal_interface + AC_SUBST(cf_ada_package) + + CF_WITH_ADA_INCLUDE + CF_WITH_ADA_OBJECTS + CF_WITH_ADA_SHAREDLIB + fi +fi + +################################################################################ + +# not needed +TINFO_ARGS2= +AC_SUBST(TINFO_ARGS2) + +### Construct the list of include-directories to be generated +CF_INCLUDE_DIRS +CF_ADA_INCLUDE_DIRS + +### Build up pieces for makefile rules +AC_MSG_CHECKING(default library suffix) +CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl +AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("") +AC_MSG_RESULT($DFT_ARG_SUFFIX) + +AC_MSG_CHECKING(default library-dependency suffix) +CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl +AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a") +AC_MSG_RESULT($DFT_DEP_SUFFIX) + +AC_MSG_CHECKING(default object directory) +CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl +AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj") +AC_MSG_RESULT($DFT_OBJ_SUBDIR) + +### Set up low-level terminfo dependencies for makefiles. + +if test "$DFT_LWR_MODEL" = shared ; then + case $cf_cv_system_name in #(vi + cygwin*) + # "lib" files have ".dll.a" suffix, "cyg" files have ".dll" + ;; + esac +fi + +### Construct the list of subdirectories for which we'll customize makefiles +### with the appropriate compile-rules. + +SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in" + +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR') + +### Now that we're done running tests, add the compiler-warnings, if any +CF_ADD_CFLAGS($EXTRA_CFLAGS) + +################################################################################ + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi +AC_SUBST(MAKE_PC_FILES) +AC_SUBST(cross_compiling) + +################################################################################ + +TEST_ARG2= +AC_SUBST(TEST_ARG2) + +TEST_LIBS2= +AC_SUBST(TEST_LIBS2) + +dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib" +NCURSES_SHLIB2="sh -c" +AC_SUBST(NCURSES_SHLIB2) + +ADA_SUBDIRS="include gen src" +if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" +fi +for cf_dir in $ADA_SUBDIRS +do + SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile" +done +AC_SUBST(ADA_SUBDIRS) + +NCURSES_TREE="#" +AC_SUBST(NCURSES_TREE) + +EXTERNAL_TREE= +AC_SUBST(EXTERNAL_TREE) + +AC_OUTPUT( \ + $SUB_MAKEFILES \ + Makefile,[ +if test -z "$USE_OLD_MAKERULES" ; then + $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile +fi +],[ +### Special initialization commands, used to pass information from the +### configuration-run into config.status + +AWK="$AWK" +DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" +DFT_LWR_MODEL="$DFT_LWR_MODEL" +ECHO_LINK="$ECHO_LINK" +LIB_NAME="$LIB_NAME" +LIB_SUFFIX="$LIB_SUFFIX" +LN_S="$LN_S" +NCURSES_MAJOR="$NCURSES_MAJOR" +NCURSES_MINOR="$NCURSES_MINOR" +NCURSES_PATCH="$NCURSES_PATCH" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" +cf_cv_abi_version="$cf_cv_abi_version" +cf_cv_rel_version="$cf_cv_rel_version" +cf_cv_rm_so_locs="$cf_cv_rm_so_locs" +cf_cv_shared_soname='$cf_cv_shared_soname' +cf_cv_shlib_version="$cf_cv_shlib_version" +cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" +cf_cv_system_name="$cf_cv_system_name" +host="$host" +target="$target" + +],cat)dnl +${MAKE:-make} preinstall diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in new file mode 100644 index 00000000000..7292d27d510 --- /dev/null +++ b/Ada95/gen/Makefile.in @@ -0,0 +1,449 @@ +############################################################################## +# Copyright (c) 1998-2010,2011 Free 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: Juergen Pfeifer, 1996 +# +# $Id: Makefile.in,v 1.71 2011/01/22 19:47:09 tom Exp $ +# +.SUFFIXES: + +SHELL = /bin/sh +VPATH = @srcdir@ +THIS = Makefile + +x = @PROG_EXT@ + +top_srcdir = @top_srcdir@ +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +includedir = @includedir@ + +INSTALL = @INSTALL@ +INSTALL_PROG = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ + +AWK = @AWK@ +LN_S = @LN_S@ + +CC = @CC@ +HOST_CC = @BUILD_CC@ +CFLAGS = @CFLAGS@ + +CPPFLAGS = @ACPPFLAGS@ \ + -DHAVE_CONFIG_H -I$(srcdir) + +CCFLAGS = $(CPPFLAGS) $(CFLAGS) +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +REL_VERSION = @cf_cv_rel_version@ +ABI_VERSION = @cf_cv_abi_version@ +LOCAL_LIBDIR = @top_builddir@/lib + +LINK = $(HOST_CC) +LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_ARGS2@ + +RANLIB = @RANLIB@ + +M4 = m4 +M4FLAGS = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@ + +ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config + +WRAPPER = @NCURSES_SHLIB2@ + +PROG_GENERATE = ./generate$x +GENERATE = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@' +DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' + +GNATHTML = `type -p gnathtml || type -p gnathtml.pl` +GNATHP = www.gnat.com + +################################################################################ +ALIB = @cf_ada_package@ +ABASE = $(ALIB)-curses + +ADA_SRCDIR = ../src + +GEN_FILES0 = Base_Defs + +GEN_FILES1 = ACS_Map \ + AC_Rep \ + Base_Defs \ + Character_Attribute_Set_Rep \ + Color_Defs \ + Key_Definitions \ + Linker_Options \ + Old_Keys \ + Public_Variables \ + Trace_Defs \ + Version_Info \ + Window_Offsets + +GEN_FILES2 = Menu_Opt_Rep \ + Menu_Base_Defs \ + Menu_Linker_Options \ + Item_Rep + +GEN_FILES3 = Form_Opt_Rep \ + Form_Base_Defs \ + Form_Linker_Options \ + Field_Rep + +GEN_FILES4 = Mouse_Base_Defs \ + Mouse_Event_Rep \ + Mouse_Events \ + Panel_Linker_Options + +GEN_FILES5 = Chtype_Def \ + Eti_Defs + +GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \ + $(ADA_SRCDIR)/$(ABASE).adb \ + $(ADA_SRCDIR)/$(ABASE)-aux.ads \ + $(ADA_SRCDIR)/$(ABASE)-trace.ads \ + $(ADA_SRCDIR)/$(ABASE)-menus.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms.ads \ + $(ADA_SRCDIR)/$(ABASE)-mouse.ads \ + $(ADA_SRCDIR)/$(ABASE)-panels.ads \ + $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads + +GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \ + $(srcdir)/$(ABASE).adb.m4 \ + $(srcdir)/$(ABASE)-aux.ads.m4 \ + $(srcdir)/$(ABASE)-trace.ads.m4 \ + $(srcdir)/$(ABASE)-menus.ads.m4 \ + $(srcdir)/$(ABASE)-forms.ads.m4 \ + $(srcdir)/$(ABASE)-mouse.ads.m4 \ + $(srcdir)/$(ABASE)-panels.ads.m4 \ + $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \ + $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-panels-user_data.ads.m4 + + +all \ +libs : $(GEN_TARGETS) + @echo made $@ + +sources: + +$(DESTDIR)$(bindir) : + mkdir -p $@ + +install \ +install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG) + $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG) + +uninstall \ +uninstall.libs :: + -rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG) + +$(PROG_GENERATE): gen.o + @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ + +gen.o: $(srcdir)/gen.c + $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c +################################################################################ +Character_Attribute_Set_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B A" >$@ + +Base_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B B" >$@ + +Color_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B C" >$@ + +Window_Offsets: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B D" >$@ + +Key_Definitions: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B K" >$@ + +Linker_Options: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B L" >$@ + +ACS_Map: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B M" >$@ + +Old_Keys: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B O" >$@ + +Public_Variables: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B P" >$@ + +AC_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B R" >$@ + +Version_Info: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B V" >$@ + +Trace_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B T" >$@ +################################################################################ +Menu_Opt_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) M R" >$@ + +Menu_Base_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) M B" >$@ + +Menu_Linker_Options: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) M L" >$@ + +Item_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) M I" >$@ +################################################################################ +Form_Opt_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) F R" >$@ + +Form_Base_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) F B" >$@ + +Form_Linker_Options: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) F L" >$@ + +Field_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) F I" >$@ +################################################################################ +Mouse_Base_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) P B" >$@ + +Mouse_Event_Rep: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) P M" >$@ + +Mouse_Events: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) B E" >$@ + +Panel_Linker_Options: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) P L" >$@ + +Chtype_Def: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) E C" >$@ + +Eti_Defs: $(PROG_GENERATE) + $(WRAPPER) "$(GENERATE) E E" >$@ +################################################################################ +$(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \ + $(GEN_FILES1) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE).ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE).adb: $(srcdir)/$(ABASE).adb.m4 \ + $(GEN_FILES1) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE).adb.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \ + $(GEN_FILES5) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-aux.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \ + $(GEN_FILES5) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-trace.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \ + $(GEN_FILES2) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-menus.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \ + $(GEN_FILES3) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \ + $(GEN_FILES4) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-mouse.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-panels.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \ + $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \ + $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \ + $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \ + $(srcdir)/$(ABASE)-forms-field_types.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \ + $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \ + $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +install.progs :: + +tags: + ctags *.[ch] + +@MAKE_UPPER_TAGS@TAGS: +@MAKE_UPPER_TAGS@ etags *.[ch] + +mostlyclean :: + -rm -f a.out core $(PROG_GENERATE) *.o + -rm -f $(GEN_FILES1) + -rm -f $(GEN_FILES2) + -rm -f $(GEN_FILES3) + -rm -f $(GEN_FILES4) + -rm -f $(GEN_FILES5) + +clean :: mostlyclean + -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp + +distclean :: clean + -rm -f $(ADACURSES_CONFIG) + -rm -f Makefile + +realclean :: distclean + +HTML_DIR = ../../doc/html/ada + +instab.tmp : table.m4 $(GEN_SRC) + @rm -f $@ + @for f in $(GEN_SRC) ; do \ + $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\ + done; + +$(HTML_DIR)/table.html : instab.tmp + @-touch $@ + @-chmod +w $@ + @echo ' $@ + @echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@ + @echo '' >> $@ + @echo '' >> $@ + @echo 'Correspondence between ncurses C and Ada functions' >>$@ + @echo '' >> $@ + @echo '' >> $@ + @echo '

Correspondence between ncurses C and Ada functions

' >>$@ + @echo '

Sorted by C function name

' >>$@ + @echo '' >>$@ + @echo '' >>$@ + @echo '' >>$@ + @sort < instab.tmp >> $@ + @echo '
C nameAda nameman page
' >>$@ + @rm -f instab.tmp + +adahtml: + @find $(HTML_DIR) -type f -exec rm -f {} \; + @mkdir -p $(HTML_DIR) + cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] +@USE_OLD_MAKERULES@ ln -sf ../src/*.ali . +@USE_GNAT_PROJECTS@ ln -sf ../static-ali/*.ali . + @echo "Filtering generated files" + @for f in $(GEN_SRC); do \ + h=`basename $$f` ;\ + g=`basename $$f .ads.m4` ;\ + if test "$$g" != "$$h" ; then \ + $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\ + echo "... $$g.ads" ;\ + fi \ + done + @-rm -f $(HTML_DIR)/$(ALIB)*.htm* + $(GNATHTML) -d -f $(ALIB)*.ads + for f in html/$(ALIB)*.htm*; do \ + a=`basename $$f` ; \ + sed -e 's/You may also.*body.*//' <$$f |\ + sed -e 's%GNAT%GNAT%g' |\ + sed -e 's%<A HREF%%g' |\ + sed -e 's/3X/3x/g' |\ + sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\ + sed -e 's%</A>%%g' > $$a.tmp ;\ + mv $$a.tmp $$f ;\ + done + @rm -f *.ad[sb] *.ali *.tmp + @for f in funcs.htm main.htm ; do \ + sed -e "\%\[ \]%d" < html/$$f > $$f ;\ + mv $$f html/$$f ;\ + done + @rm -f "html/funcs/ .htm" + @cp -pdrf html/* $(HTML_DIR)/ + @rm -rf html + +html : adahtml $(HTML_DIR)/table.html + @echo made $@ + +############################################################################### +# The remainder of this file is automatically generated during configuration +############################################################################### diff --git a/Ada95/gen/adacurses-config.in b/Ada95/gen/adacurses-config.in new file mode 100644 index 00000000000..ec0b6b68b67 --- /dev/null +++ b/Ada95/gen/adacurses-config.in @@ -0,0 +1,79 @@ +#! /bin/sh +# $Id: adacurses-config.in,v 1.6 2010/03/06 21:05:01 tom Exp $ +############################################################################## +# Copyright (c) 2007-2009,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"), # +# 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. # +############################################################################## +# +# This script returns the options to add to `gnatmake' for using AdaCurses. + +DESTDIR=@DESTDIR@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ + +ADA_INCLUDE=@ADA_INCLUDE@ +ADA_OBJECTS=@ADA_OBJECTS@ + +VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@ + +CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS" +LIBS="-L$ADA_OBJECTS -lAdaCurses" + +THIS="adacurses" + +case "x$1" in + x--version) + echo AdaCurses $VERSION + ;; + x--cflags) + echo $CFLAGS + ;; + x--libs) + echo $LIBS + ;; + x) + # if no parameter is given, give what gnatmake needs + echo "$CFLAGS -i -largs $LIBS" + ;; + x--help) + cat <&2 + exit 1 + ;; +esac diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c new file mode 100644 index 00000000000..31391864d1b --- /dev/null +++ b/Ada95/gen/gen.c @@ -0,0 +1,1537 @@ +/**************************************************************************** + * Copyright (c) 1998,2009,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"), 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: Juergen Pfeifer, 1996 * + ****************************************************************************/ + +/* + Version Control + $Id: gen.c,v 1.54 2010/09/04 21:19:50 tom Exp $ + --------------------------------------------------------------------------*/ +/* + This program generates various record structures and constants from the + ncurses header file for the Ada95 packages. Essentially it produces + Ada95 source on stdout, which is then merged using m4 into a template + to produce the real source. + */ + +#ifdef HAVE_CONFIG_H +#include +#else +#include +#define HAVE_USE_DEFAULT_COLORS 1 +#endif + +#include +#include +#include +#include +#include + +#include +#include + +#define UChar(c) ((unsigned char)(c)) +#define RES_NAME "Reserved" + +static const char *model = ""; +static int little_endian = 0; + +typedef struct + { + const char *name; + unsigned long attr; + } +name_attribute_pair; + +static int +find_pos(char *s, unsigned len, int *low, int *high) +{ + unsigned int i, j; + int l = 0; + + *high = -1; + *low = (int)(8 * len); + + for (i = 0; i < len; i++, s++) + { + if (*s) + { + for (j = 0; j < 8 * sizeof(char); j++) + + { + if (((little_endian && ((*s) & 0x01)) || + (!little_endian && ((*s) & 0x80)))) + { + if (l > *high) + *high = l; + if (l < *low) + *low = l; + } + l++; + if (little_endian) + { + *s >>= 1; + } + else + { + *s = (char)(*s << 1); + } + } + } + else + l += 8; + } + return (*high >= 0 && (*low <= *high)) ? *low : -1; +} + +/* + * This helper routine generates a representation clause for a + * record type defined in the binding. + * We are only dealing with record types which are of 32 or 16 + * bit size, i.e. they fit into an (u)int or a (u)short. + */ +static void +gen_reps( + const name_attribute_pair * nap, /* array of name_attribute_pair records */ + const char *name, /* name of the represented record type */ + int len, /* size of the record in bytes */ + int bias) +{ + int i, n, l, cnt = 0, low, high; + int width = strlen(RES_NAME) + 3; + unsigned long a; + unsigned long mask = 0; + + assert(nap != NULL); + + for (i = 0; nap[i].name != (char *)0; i++) + { + cnt++; + l = (int)strlen(nap[i].name); + if (l > width) + width = l; + } + assert(width > 0); + + printf(" type %s is\n", name); + printf(" record\n"); + for (i = 0; nap[i].name != (char *)0; i++) + { + printf(" %-*s : Boolean;\n", width, nap[i].name); + } + printf(" end record;\n"); + printf(" pragma Convention (C, %s);\n\n", name); + + printf(" for %s use\n", name); + printf(" record\n"); + + for (i = 0; nap[i].name != (char *)0; i++) + { + a = nap[i].attr; + mask |= a; + l = find_pos((char *)&a, sizeof(a), &low, &high); + if (l >= 0) + printf(" %-*s at 0 range %2d .. %2d;\n", width, nap[i].name, + low - bias, high - bias); + } + i = 1; + n = cnt; + printf(" end record;\n"); + printf(" for %s'Size use %d;\n", name, 8 * len); + printf(" -- Please note: this rep. clause is generated and may be\n"); + printf(" -- different on your system."); +} + +static void +chtype_rep(const char *name, attr_t mask) +{ + attr_t x = (attr_t)-1; + attr_t t = x & mask; + int low, high; + int l = find_pos((char *)&t, sizeof(t), &low, &high); + + if (l >= 0) + printf(" %-5s at 0 range %2d .. %2d;\n", name, low, high); +} + +static void +gen_chtype_rep(const char *name) +{ + printf(" for %s use\n record\n", name); + chtype_rep("Ch", A_CHARTEXT); + chtype_rep("Color", A_COLOR); + chtype_rep("Attr", (A_ATTRIBUTES & ~A_COLOR)); + printf(" end record;\n for %s'Size use %ld;\n", + name, (long)(8 * sizeof(chtype))); + + printf(" -- Please note: this rep. clause is generated and may be\n"); + printf(" -- different on your system.\n"); +} + +static void +mrep_rep(const char *name, void *rec) +{ + int low, high; + int l = find_pos((char *)rec, sizeof(MEVENT), &low, &high); + + if (l >= 0) + printf(" %-7s at 0 range %3d .. %3d;\n", name, low, high); +} + +static void +gen_mrep_rep(const char *name) +{ + MEVENT x; + + printf(" for %s use\n record\n", name); + + memset(&x, 0, sizeof(x)); + x.id = -1; + mrep_rep("Id", &x); + + memset(&x, 0, sizeof(x)); + x.x = -1; + mrep_rep("X", &x); + + memset(&x, 0, sizeof(x)); + x.y = -1; + mrep_rep("Y", &x); + + memset(&x, 0, sizeof(x)); + x.z = -1; + mrep_rep("Z", &x); + + memset(&x, 0, sizeof(x)); + x.bstate = (mmask_t) - 1; + mrep_rep("Bstate", &x); + + printf(" end record;\n"); + printf(" -- Please note: this rep. clause is generated and may be\n"); + printf(" -- different on your system.\n"); +} + +static void +gen_attr_set(const char *name) +{ + /* All of the A_xxx symbols are defined in ncurses, but not all are nonzero + * if "configure --enable-widec" is specified. + */ + static const name_attribute_pair nap[] = + { +#if A_STANDOUT + {"Stand_Out", A_STANDOUT}, +#endif +#if A_UNDERLINE + {"Under_Line", A_UNDERLINE}, +#endif +#if A_REVERSE + {"Reverse_Video", A_REVERSE}, +#endif +#if A_BLINK + {"Blink", A_BLINK}, +#endif +#if A_DIM + {"Dim_Character", A_DIM}, +#endif +#if A_BOLD + {"Bold_Character", A_BOLD}, +#endif +#if A_ALTCHARSET + {"Alternate_Character_Set", A_ALTCHARSET}, +#endif +#if A_INVIS + {"Invisible_Character", A_INVIS}, +#endif +#if A_PROTECT + {"Protected_Character", A_PROTECT}, +#endif +#if A_HORIZONTAL + {"Horizontal", A_HORIZONTAL}, +#endif +#if A_LEFT + {"Left", A_LEFT}, +#endif +#if A_LOW + {"Low", A_LOW}, +#endif +#if A_RIGHT + {"Right", A_RIGHT}, +#endif +#if A_TOP + {"Top", A_TOP}, +#endif +#if A_VERTICAL + {"Vertical", A_VERTICAL}, +#endif + {(char *)0, 0} + }; + chtype attr = A_ATTRIBUTES & ~A_COLOR; + int start = -1; + int len = 0; + int i; + chtype set; + for (i = 0; i < (int)(8 * sizeof(chtype)); i++) + + { + set = (attr & 1); + if (set) + { + if (start < 0) + start = i; + if (start >= 0) + { + len++; + } + } + attr = attr >> 1; + } + gen_reps(nap, name, (len + 7) / 8, little_endian ? start : 0); +} + +static void +gen_trace(const char *name) +{ + static const name_attribute_pair nap[] = + { + {"Times", TRACE_TIMES}, + {"Tputs", TRACE_TPUTS}, + {"Update", TRACE_UPDATE}, + {"Cursor_Move", TRACE_MOVE}, + {"Character_Output", TRACE_CHARPUT}, + {"Calls", TRACE_CALLS}, + {"Virtual_Puts", TRACE_VIRTPUT}, + {"Input_Events", TRACE_IEVENT}, + {"TTY_State", TRACE_BITS}, + {"Internal_Calls", TRACE_ICALLS}, + {"Character_Calls", TRACE_CCALLS}, + {"Termcap_TermInfo", TRACE_DATABASE}, + {(char *)0, 0} + }; + gen_reps(nap, name, sizeof(int), 0); +} + +static void +gen_menu_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = + { +#ifdef O_ONEVALUE + {"One_Valued", O_ONEVALUE}, +#endif +#ifdef O_SHOWDESC + {"Show_Descriptions", O_SHOWDESC}, +#endif +#ifdef O_ROWMAJOR + {"Row_Major_Order", O_ROWMAJOR}, +#endif +#ifdef O_IGNORECASE + {"Ignore_Case", O_IGNORECASE}, +#endif +#ifdef O_SHOWMATCH + {"Show_Matches", O_SHOWMATCH}, +#endif +#ifdef O_NONCYCLIC + {"Non_Cyclic", O_NONCYCLIC}, +#endif + {(char *)0, 0} + }; + gen_reps(nap, name, sizeof(int), 0); +} + +static void +gen_item_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = + { +#ifdef O_SELECTABLE + {"Selectable", O_SELECTABLE}, +#endif + {(char *)0, 0} + }; + gen_reps(nap, name, sizeof(int), 0); +} + +static void +gen_form_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = + { +#ifdef O_NL_OVERLOAD + {"NL_Overload", O_NL_OVERLOAD}, +#endif +#ifdef O_BS_OVERLOAD + {"BS_Overload", O_BS_OVERLOAD}, +#endif + {(char *)0, 0} + }; + gen_reps(nap, name, sizeof(int), 0); +} + +/* + * Generate the representation clause for the Field_Option_Set record + */ +static void +gen_field_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = + { +#ifdef O_VISIBLE + {"Visible", O_VISIBLE}, +#endif +#ifdef O_ACTIVE + {"Active", O_ACTIVE}, +#endif +#ifdef O_PUBLIC + {"Public", O_PUBLIC}, +#endif +#ifdef O_EDIT + {"Edit", O_EDIT}, +#endif +#ifdef O_WRAP + {"Wrap", O_WRAP}, +#endif +#ifdef O_BLANK + {"Blank", O_BLANK}, +#endif +#ifdef O_AUTOSKIP + {"Auto_Skip", O_AUTOSKIP}, +#endif +#ifdef O_NULLOK + {"Null_Ok", O_NULLOK}, +#endif +#ifdef O_PASSOK + {"Pass_Ok", O_PASSOK}, +#endif +#ifdef O_STATIC + {"Static", O_STATIC}, +#endif + {(char *)0, 0} + }; + gen_reps(nap, name, sizeof(int), 0); +} + +/* + * Generate a single key code constant definition. + */ +static void +keydef(const char *name, const char *old_name, int value, int mode) +{ + if (mode == 0) /* Generate the new name */ + printf(" %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value); + else + { + const char *s = old_name; + const char *t = name; + + /* generate the old name, but only if it doesn't conflict with the old + * name (Ada95 isn't case sensitive!) + */ + while (*s && *t && (toupper(UChar(*s++)) == toupper(UChar(*t++)))); + if (*s || *t) + printf(" %-16s : Special_Key_Code renames %s;\n", old_name, name); + } +} + +/* + * Generate constants for the key codes. When called with mode==0, a + * complete list with nice constant names in proper casing style will + * be generated. Otherwise a list of old (i.e. C-style) names will be + * generated, given that the name wasn't already defined in the "nice" + * list. + */ +static void +gen_keydefs(int mode) +{ + char buf[16]; + char obuf[16]; + int i; + +#ifdef KEY_CODE_YES + keydef("Key_Code_Yes", "KEY_CODE_YES", KEY_CODE_YES, mode); +#endif +#ifdef KEY_MIN + keydef("Key_Min", "KEY_MIN", KEY_MIN, mode); +#endif +#ifdef KEY_BREAK + keydef("Key_Break", "KEY_BREAK", KEY_BREAK, mode); +#endif +#ifdef KEY_DOWN + keydef("Key_Cursor_Down", "KEY_DOWN", KEY_DOWN, mode); +#endif +#ifdef KEY_UP + keydef("Key_Cursor_Up", "KEY_UP", KEY_UP, mode); +#endif +#ifdef KEY_LEFT + keydef("Key_Cursor_Left", "KEY_LEFT", KEY_LEFT, mode); +#endif +#ifdef KEY_RIGHT + keydef("Key_Cursor_Right", "KEY_RIGHT", KEY_RIGHT, mode); +#endif +#ifdef KEY_HOME + keydef("Key_Home", "KEY_HOME", KEY_HOME, mode); +#endif +#ifdef KEY_BACKSPACE + keydef("Key_Backspace", "KEY_BACKSPACE", KEY_BACKSPACE, mode); +#endif +#ifdef KEY_F0 + keydef("Key_F0", "KEY_F0", KEY_F0, mode); +#endif +#ifdef KEY_F + for (i = 1; i <= 24; i++) + { + sprintf(buf, "Key_F%d", i); + sprintf(obuf, "KEY_F%d", i); + keydef(buf, obuf, KEY_F(i), mode); + } +#endif +#ifdef KEY_DL + keydef("Key_Delete_Line", "KEY_DL", KEY_DL, mode); +#endif +#ifdef KEY_IL + keydef("Key_Insert_Line", "KEY_IL", KEY_IL, mode); +#endif +#ifdef KEY_DC + keydef("Key_Delete_Char", "KEY_DC", KEY_DC, mode); +#endif +#ifdef KEY_IC + keydef("Key_Insert_Char", "KEY_IC", KEY_IC, mode); +#endif +#ifdef KEY_EIC + keydef("Key_Exit_Insert_Mode", "KEY_EIC", KEY_EIC, mode); +#endif +#ifdef KEY_CLEAR + keydef("Key_Clear_Screen", "KEY_CLEAR", KEY_CLEAR, mode); +#endif +#ifdef KEY_EOS + keydef("Key_Clear_End_Of_Screen", "KEY_EOS", KEY_EOS, mode); +#endif +#ifdef KEY_EOL + keydef("Key_Clear_End_Of_Line", "KEY_EOL", KEY_EOL, mode); +#endif +#ifdef KEY_SF + keydef("Key_Scroll_1_Forward", "KEY_SF", KEY_SF, mode); +#endif +#ifdef KEY_SR + keydef("Key_Scroll_1_Backward", "KEY_SR", KEY_SR, mode); +#endif +#ifdef KEY_NPAGE + keydef("Key_Next_Page", "KEY_NPAGE", KEY_NPAGE, mode); +#endif +#ifdef KEY_PPAGE + keydef("Key_Previous_Page", "KEY_PPAGE", KEY_PPAGE, mode); +#endif +#ifdef KEY_STAB + keydef("Key_Set_Tab", "KEY_STAB", KEY_STAB, mode); +#endif +#ifdef KEY_CTAB + keydef("Key_Clear_Tab", "KEY_CTAB", KEY_CTAB, mode); +#endif +#ifdef KEY_CATAB + keydef("Key_Clear_All_Tabs", "KEY_CATAB", KEY_CATAB, mode); +#endif +#ifdef KEY_ENTER + keydef("Key_Enter_Or_Send", "KEY_ENTER", KEY_ENTER, mode); +#endif +#ifdef KEY_SRESET + keydef("Key_Soft_Reset", "KEY_SRESET", KEY_SRESET, mode); +#endif +#ifdef KEY_RESET + keydef("Key_Reset", "KEY_RESET", KEY_RESET, mode); +#endif +#ifdef KEY_PRINT + keydef("Key_Print", "KEY_PRINT", KEY_PRINT, mode); +#endif +#ifdef KEY_LL + keydef("Key_Bottom", "KEY_LL", KEY_LL, mode); +#endif +#ifdef KEY_A1 + keydef("Key_Upper_Left_Of_Keypad", "KEY_A1", KEY_A1, mode); +#endif +#ifdef KEY_A3 + keydef("Key_Upper_Right_Of_Keypad", "KEY_A3", KEY_A3, mode); +#endif +#ifdef KEY_B2 + keydef("Key_Center_Of_Keypad", "KEY_B2", KEY_B2, mode); +#endif +#ifdef KEY_C1 + keydef("Key_Lower_Left_Of_Keypad", "KEY_C1", KEY_C1, mode); +#endif +#ifdef KEY_C3 + keydef("Key_Lower_Right_Of_Keypad", "KEY_C3", KEY_C3, mode); +#endif +#ifdef KEY_BTAB + keydef("Key_Back_Tab", "KEY_BTAB", KEY_BTAB, mode); +#endif +#ifdef KEY_BEG + keydef("Key_Beginning", "KEY_BEG", KEY_BEG, mode); +#endif +#ifdef KEY_CANCEL + keydef("Key_Cancel", "KEY_CANCEL", KEY_CANCEL, mode); +#endif +#ifdef KEY_CLOSE + keydef("Key_Close", "KEY_CLOSE", KEY_CLOSE, mode); +#endif +#ifdef KEY_COMMAND + keydef("Key_Command", "KEY_COMMAND", KEY_COMMAND, mode); +#endif +#ifdef KEY_COPY + keydef("Key_Copy", "KEY_COPY", KEY_COPY, mode); +#endif +#ifdef KEY_CREATE + keydef("Key_Create", "KEY_CREATE", KEY_CREATE, mode); +#endif +#ifdef KEY_END + keydef("Key_End", "KEY_END", KEY_END, mode); +#endif +#ifdef KEY_EXIT + keydef("Key_Exit", "KEY_EXIT", KEY_EXIT, mode); +#endif +#ifdef KEY_FIND + keydef("Key_Find", "KEY_FIND", KEY_FIND, mode); +#endif +#ifdef KEY_HELP + keydef("Key_Help", "KEY_HELP", KEY_HELP, mode); +#endif +#ifdef KEY_MARK + keydef("Key_Mark", "KEY_MARK", KEY_MARK, mode); +#endif +#ifdef KEY_MESSAGE + keydef("Key_Message", "KEY_MESSAGE", KEY_MESSAGE, mode); +#endif +#ifdef KEY_MOVE + keydef("Key_Move", "KEY_MOVE", KEY_MOVE, mode); +#endif +#ifdef KEY_NEXT + keydef("Key_Next", "KEY_NEXT", KEY_NEXT, mode); +#endif +#ifdef KEY_OPEN + keydef("Key_Open", "KEY_OPEN", KEY_OPEN, mode); +#endif +#ifdef KEY_OPTIONS + keydef("Key_Options", "KEY_OPTIONS", KEY_OPTIONS, mode); +#endif +#ifdef KEY_PREVIOUS + keydef("Key_Previous", "KEY_PREVIOUS", KEY_PREVIOUS, mode); +#endif +#ifdef KEY_REDO + keydef("Key_Redo", "KEY_REDO", KEY_REDO, mode); +#endif +#ifdef KEY_REFERENCE + keydef("Key_Reference", "KEY_REFERENCE", KEY_REFERENCE, mode); +#endif +#ifdef KEY_REFRESH + keydef("Key_Refresh", "KEY_REFRESH", KEY_REFRESH, mode); +#endif +#ifdef KEY_REPLACE + keydef("Key_Replace", "KEY_REPLACE", KEY_REPLACE, mode); +#endif +#ifdef KEY_RESTART + keydef("Key_Restart", "KEY_RESTART", KEY_RESTART, mode); +#endif +#ifdef KEY_RESUME + keydef("Key_Resume", "KEY_RESUME", KEY_RESUME, mode); +#endif +#ifdef KEY_SAVE + keydef("Key_Save", "KEY_SAVE", KEY_SAVE, mode); +#endif +#ifdef KEY_SBEG + keydef("Key_Shift_Begin", "KEY_SBEG", KEY_SBEG, mode); +#endif +#ifdef KEY_SCANCEL + keydef("Key_Shift_Cancel", "KEY_SCANCEL", KEY_SCANCEL, mode); +#endif +#ifdef KEY_SCOMMAND + keydef("Key_Shift_Command", "KEY_SCOMMAND", KEY_SCOMMAND, mode); +#endif +#ifdef KEY_SCOPY + keydef("Key_Shift_Copy", "KEY_SCOPY", KEY_SCOPY, mode); +#endif +#ifdef KEY_SCREATE + keydef("Key_Shift_Create", "KEY_SCREATE", KEY_SCREATE, mode); +#endif +#ifdef KEY_SDC + keydef("Key_Shift_Delete_Char", "KEY_SDC", KEY_SDC, mode); +#endif +#ifdef KEY_SDL + keydef("Key_Shift_Delete_Line", "KEY_SDL", KEY_SDL, mode); +#endif +#ifdef KEY_SELECT + keydef("Key_Select", "KEY_SELECT", KEY_SELECT, mode); +#endif +#ifdef KEY_SEND + keydef("Key_Shift_End", "KEY_SEND", KEY_SEND, mode); +#endif +#ifdef KEY_SEOL + keydef("Key_Shift_Clear_End_Of_Line", "KEY_SEOL", KEY_SEOL, mode); +#endif +#ifdef KEY_SEXIT + keydef("Key_Shift_Exit", "KEY_SEXIT", KEY_SEXIT, mode); +#endif +#ifdef KEY_SFIND + keydef("Key_Shift_Find", "KEY_SFIND", KEY_SFIND, mode); +#endif +#ifdef KEY_SHELP + keydef("Key_Shift_Help", "KEY_SHELP", KEY_SHELP, mode); +#endif +#ifdef KEY_SHOME + keydef("Key_Shift_Home", "KEY_SHOME", KEY_SHOME, mode); +#endif +#ifdef KEY_SIC + keydef("Key_Shift_Insert_Char", "KEY_SIC", KEY_SIC, mode); +#endif +#ifdef KEY_SLEFT + keydef("Key_Shift_Cursor_Left", "KEY_SLEFT", KEY_SLEFT, mode); +#endif +#ifdef KEY_SMESSAGE + keydef("Key_Shift_Message", "KEY_SMESSAGE", KEY_SMESSAGE, mode); +#endif +#ifdef KEY_SMOVE + keydef("Key_Shift_Move", "KEY_SMOVE", KEY_SMOVE, mode); +#endif +#ifdef KEY_SNEXT + keydef("Key_Shift_Next_Page", "KEY_SNEXT", KEY_SNEXT, mode); +#endif +#ifdef KEY_SOPTIONS + keydef("Key_Shift_Options", "KEY_SOPTIONS", KEY_SOPTIONS, mode); +#endif +#ifdef KEY_SPREVIOUS + keydef("Key_Shift_Previous_Page", "KEY_SPREVIOUS", KEY_SPREVIOUS, mode); +#endif +#ifdef KEY_SPRINT + keydef("Key_Shift_Print", "KEY_SPRINT", KEY_SPRINT, mode); +#endif +#ifdef KEY_SREDO + keydef("Key_Shift_Redo", "KEY_SREDO", KEY_SREDO, mode); +#endif +#ifdef KEY_SREPLACE + keydef("Key_Shift_Replace", "KEY_SREPLACE", KEY_SREPLACE, mode); +#endif +#ifdef KEY_SRIGHT + keydef("Key_Shift_Cursor_Right", "KEY_SRIGHT", KEY_SRIGHT, mode); +#endif +#ifdef KEY_SRSUME + keydef("Key_Shift_Resume", "KEY_SRSUME", KEY_SRSUME, mode); +#endif +#ifdef KEY_SSAVE + keydef("Key_Shift_Save", "KEY_SSAVE", KEY_SSAVE, mode); +#endif +#ifdef KEY_SSUSPEND + keydef("Key_Shift_Suspend", "KEY_SSUSPEND", KEY_SSUSPEND, mode); +#endif +#ifdef KEY_SUNDO + keydef("Key_Shift_Undo", "KEY_SUNDO", KEY_SUNDO, mode); +#endif +#ifdef KEY_SUSPEND + keydef("Key_Suspend", "KEY_SUSPEND", KEY_SUSPEND, mode); +#endif +#ifdef KEY_UNDO + keydef("Key_Undo", "KEY_UNDO", KEY_UNDO, mode); +#endif +#ifdef KEY_MOUSE + keydef("Key_Mouse", "KEY_MOUSE", KEY_MOUSE, mode); +#endif +#ifdef KEY_RESIZE + keydef("Key_Resize", "KEY_RESIZE", KEY_RESIZE, mode); +#endif +} + +/* + * Generate a constant with the given name. The second parameter + * is a reference to the ACS character in the acs_map[] array and + * will be translated into an index. + */ +static void +acs_def(const char *name, chtype *a) +{ + int c = a - &acs_map[0]; + + printf(" %-24s : constant Character := ", name); + if (isprint(UChar(c)) && (c != '`')) + printf("'%c';\n", c); + else + printf("Character'Val (%d);\n", c); +} + +/* + * Generate the constants for the ACS characters + */ +static void +gen_acs(void) +{ + printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n"); + printf(" of Attributed_Character;\n"); +#if USE_REENTRANT || BROKEN_LINKER + printf(" type C_ACS_Ptr is access C_ACS_Map;\n"); + printf(" function ACS_Map return C_ACS_Ptr;\n"); + printf(" pragma Import (C, ACS_Map, \"" + NCURSES_WRAP_PREFIX + "acs_map\");\n"); +#else + printf(" ACS_Map : C_ACS_Map;\n"); + printf(" pragma Import (C, ACS_Map, \"acs_map\");\n"); +#endif + printf(" --\n"); + printf(" --\n"); + printf(" -- Constants for several characters from the Alternate Character Set\n"); + printf(" -- You must use these constants as indices into the ACS_Map array\n"); + printf(" -- to get the corresponding attributed character at runtime.\n"); + printf(" --\n"); + +#ifdef ACS_ULCORNER + acs_def("ACS_Upper_Left_Corner", &ACS_ULCORNER); +#endif +#ifdef ACS_LLCORNER + acs_def("ACS_Lower_Left_Corner", &ACS_LLCORNER); +#endif +#ifdef ACS_URCORNER + acs_def("ACS_Upper_Right_Corner", &ACS_URCORNER); +#endif +#ifdef ACS_LRCORNER + acs_def("ACS_Lower_Right_Corner", &ACS_LRCORNER); +#endif +#ifdef ACS_LTEE + acs_def("ACS_Left_Tee", &ACS_LTEE); +#endif +#ifdef ACS_RTEE + acs_def("ACS_Right_Tee", &ACS_RTEE); +#endif +#ifdef ACS_BTEE + acs_def("ACS_Bottom_Tee", &ACS_BTEE); +#endif +#ifdef ACS_TTEE + acs_def("ACS_Top_Tee", &ACS_TTEE); +#endif +#ifdef ACS_HLINE + acs_def("ACS_Horizontal_Line", &ACS_HLINE); +#endif +#ifdef ACS_VLINE + acs_def("ACS_Vertical_Line", &ACS_VLINE); +#endif +#ifdef ACS_PLUS + acs_def("ACS_Plus_Symbol", &ACS_PLUS); +#endif +#ifdef ACS_S1 + acs_def("ACS_Scan_Line_1", &ACS_S1); +#endif +#ifdef ACS_S9 + acs_def("ACS_Scan_Line_9", &ACS_S9); +#endif +#ifdef ACS_DIAMOND + acs_def("ACS_Diamond", &ACS_DIAMOND); +#endif +#ifdef ACS_CKBOARD + acs_def("ACS_Checker_Board", &ACS_CKBOARD); +#endif +#ifdef ACS_DEGREE + acs_def("ACS_Degree", &ACS_DEGREE); +#endif +#ifdef ACS_PLMINUS + acs_def("ACS_Plus_Minus", &ACS_PLMINUS); +#endif +#ifdef ACS_BULLET + acs_def("ACS_Bullet", &ACS_BULLET); +#endif +#ifdef ACS_LARROW + acs_def("ACS_Left_Arrow", &ACS_LARROW); +#endif +#ifdef ACS_RARROW + acs_def("ACS_Right_Arrow", &ACS_RARROW); +#endif +#ifdef ACS_DARROW + acs_def("ACS_Down_Arrow", &ACS_DARROW); +#endif +#ifdef ACS_UARROW + acs_def("ACS_Up_Arrow", &ACS_UARROW); +#endif +#ifdef ACS_BOARD + acs_def("ACS_Board_Of_Squares", &ACS_BOARD); +#endif +#ifdef ACS_LANTERN + acs_def("ACS_Lantern", &ACS_LANTERN); +#endif +#ifdef ACS_BLOCK + acs_def("ACS_Solid_Block", &ACS_BLOCK); +#endif +#ifdef ACS_S3 + acs_def("ACS_Scan_Line_3", &ACS_S3); +#endif +#ifdef ACS_S7 + acs_def("ACS_Scan_Line_7", &ACS_S7); +#endif +#ifdef ACS_LEQUAL + acs_def("ACS_Less_Or_Equal", &ACS_LEQUAL); +#endif +#ifdef ACS_GEQUAL + acs_def("ACS_Greater_Or_Equal", &ACS_GEQUAL); +#endif +#ifdef ACS_PI + acs_def("ACS_PI", &ACS_PI); +#endif +#ifdef ACS_NEQUAL + acs_def("ACS_Not_Equal", &ACS_NEQUAL); +#endif +#ifdef ACS_STERLING + acs_def("ACS_Sterling", &ACS_STERLING); +#endif +} + +#define GEN_EVENT(name,value) \ + printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \ + #name, value) + +#define GEN_MEVENT(name) \ + printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \ + #name, name) + +static void +gen_mouse_events(void) +{ + mmask_t all1 = 0; + mmask_t all2 = 0; + mmask_t all3 = 0; + mmask_t all4 = 0; + +#ifdef BUTTON1_RELEASED + GEN_MEVENT(BUTTON1_RELEASED); + all1 |= BUTTON1_RELEASED; +#endif +#ifdef BUTTON1_PRESSED + GEN_MEVENT(BUTTON1_PRESSED); + all1 |= BUTTON1_PRESSED; +#endif +#ifdef BUTTON1_CLICKED + GEN_MEVENT(BUTTON1_CLICKED); + all1 |= BUTTON1_CLICKED; +#endif +#ifdef BUTTON1_DOUBLE_CLICKED + GEN_MEVENT(BUTTON1_DOUBLE_CLICKED); + all1 |= BUTTON1_DOUBLE_CLICKED; +#endif +#ifdef BUTTON1_TRIPLE_CLICKED + GEN_MEVENT(BUTTON1_TRIPLE_CLICKED); + all1 |= BUTTON1_TRIPLE_CLICKED; +#endif +#ifdef BUTTON1_RESERVED_EVENT + GEN_MEVENT(BUTTON1_RESERVED_EVENT); + all1 |= BUTTON1_RESERVED_EVENT; +#endif +#ifdef BUTTON2_RELEASED + GEN_MEVENT(BUTTON2_RELEASED); + all2 |= BUTTON2_RELEASED; +#endif +#ifdef BUTTON2_PRESSED + GEN_MEVENT(BUTTON2_PRESSED); + all2 |= BUTTON2_PRESSED; +#endif +#ifdef BUTTON2_CLICKED + GEN_MEVENT(BUTTON2_CLICKED); + all2 |= BUTTON2_CLICKED; +#endif +#ifdef BUTTON2_DOUBLE_CLICKED + GEN_MEVENT(BUTTON2_DOUBLE_CLICKED); + all2 |= BUTTON2_DOUBLE_CLICKED; +#endif +#ifdef BUTTON2_TRIPLE_CLICKED + GEN_MEVENT(BUTTON2_TRIPLE_CLICKED); + all2 |= BUTTON2_TRIPLE_CLICKED; +#endif +#ifdef BUTTON2_RESERVED_EVENT + GEN_MEVENT(BUTTON2_RESERVED_EVENT); + all2 |= BUTTON2_RESERVED_EVENT; +#endif +#ifdef BUTTON3_RELEASED + GEN_MEVENT(BUTTON3_RELEASED); + all3 |= BUTTON3_RELEASED; +#endif +#ifdef BUTTON3_PRESSED + GEN_MEVENT(BUTTON3_PRESSED); + all3 |= BUTTON3_PRESSED; +#endif +#ifdef BUTTON3_CLICKED + GEN_MEVENT(BUTTON3_CLICKED); + all3 |= BUTTON3_CLICKED; +#endif +#ifdef BUTTON3_DOUBLE_CLICKED + GEN_MEVENT(BUTTON3_DOUBLE_CLICKED); + all3 |= BUTTON3_DOUBLE_CLICKED; +#endif +#ifdef BUTTON3_TRIPLE_CLICKED + GEN_MEVENT(BUTTON3_TRIPLE_CLICKED); + all3 |= BUTTON3_TRIPLE_CLICKED; +#endif +#ifdef BUTTON3_RESERVED_EVENT + GEN_MEVENT(BUTTON3_RESERVED_EVENT); + all3 |= BUTTON3_RESERVED_EVENT; +#endif +#ifdef BUTTON4_RELEASED + GEN_MEVENT(BUTTON4_RELEASED); + all4 |= BUTTON4_RELEASED; +#endif +#ifdef BUTTON4_PRESSED + GEN_MEVENT(BUTTON4_PRESSED); + all4 |= BUTTON4_PRESSED; +#endif +#ifdef BUTTON4_CLICKED + GEN_MEVENT(BUTTON4_CLICKED); + all4 |= BUTTON4_CLICKED; +#endif +#ifdef BUTTON4_DOUBLE_CLICKED + GEN_MEVENT(BUTTON4_DOUBLE_CLICKED); + all4 |= BUTTON4_DOUBLE_CLICKED; +#endif +#ifdef BUTTON4_TRIPLE_CLICKED + GEN_MEVENT(BUTTON4_TRIPLE_CLICKED); + all4 |= BUTTON4_TRIPLE_CLICKED; +#endif +#ifdef BUTTON4_RESERVED_EVENT + GEN_MEVENT(BUTTON4_RESERVED_EVENT); + all4 |= BUTTON4_RESERVED_EVENT; +#endif +#ifdef BUTTON_CTRL + GEN_MEVENT(BUTTON_CTRL); +#endif +#ifdef BUTTON_SHIFT + GEN_MEVENT(BUTTON_SHIFT); +#endif +#ifdef BUTTON_ALT + GEN_MEVENT(BUTTON_ALT); +#endif +#ifdef REPORT_MOUSE_POSITION + GEN_MEVENT(REPORT_MOUSE_POSITION); +#endif +#ifdef ALL_MOUSE_EVENTS + GEN_MEVENT(ALL_MOUSE_EVENTS); +#endif + + GEN_EVENT(BUTTON1_EVENTS, all1); + GEN_EVENT(BUTTON2_EVENTS, all2); + GEN_EVENT(BUTTON3_EVENTS, all3); + GEN_EVENT(BUTTON4_EVENTS, all4); +} + +static void +wrap_one_var(const char *c_var, + const char *c_type, + const char *ada_func, + const char *ada_type) +{ +#if USE_REENTRANT + /* must wrap variables */ + printf("\n"); + printf(" function %s return %s\n", ada_func, ada_type); + printf(" is\n"); + printf(" function Result return %s;\n", c_type); + printf(" pragma Import (C, Result, \"" NCURSES_WRAP_PREFIX "%s\");\n", c_var); + printf(" begin\n"); + if (strcmp(c_type, ada_type)) + printf(" return %s (Result);\n", ada_type); + else + printf(" return Result;\n"); + printf(" end %s;\n", ada_func); +#else + /* global variables are really global */ + printf("\n"); + printf(" function %s return %s\n", ada_func, ada_type); + printf(" is\n"); + printf(" Result : %s;\n", c_type); + printf(" pragma Import (C, Result, \"%s\");\n", c_var); + printf(" begin\n"); + if (strcmp(c_type, ada_type)) + printf(" return %s (Result);\n", ada_type); + else + printf(" return Result;\n"); + printf(" end %s;\n", ada_func); +#endif +} + +#define GEN_PUBLIC_VAR(c_var, c_type, ada_func, ada_type) \ + wrap_one_var(#c_var, #c_type, #ada_func, #ada_type) + +static void +gen_public_vars(void) +{ + GEN_PUBLIC_VAR(stdscr, Window, Standard_Window, Window); + GEN_PUBLIC_VAR(curscr, Window, Current_Window, Window); + GEN_PUBLIC_VAR(LINES, C_Int, Lines, Line_Count); + GEN_PUBLIC_VAR(COLS, C_Int, Columns, Column_Count); + GEN_PUBLIC_VAR(TABSIZE, C_Int, Tab_Size, Natural); + GEN_PUBLIC_VAR(COLORS, C_Int, Number_Of_Colors, Natural); + GEN_PUBLIC_VAR(COLOR_PAIRS, C_Int, Number_Of_Color_Pairs, Natural); +} + +/* + * Output some comment lines indicating that the file is generated. + * The name parameter is the name of the facility to be used in + * the comment. + */ +static void +prologue(const char *name) +{ + printf("-- %s binding.\n", name); + printf("-- This module is generated. Please don't change it manually!\n"); + printf("-- Run the generator instead.\n-- |"); + + printf("define(`M4_BIT_ORDER',`%s_Order_First')", + little_endian ? "Low" : "High"); +} + +/* + * Write the prologue for the curses facility and make sure that + * KEY_MIN and KEY_MAX are defined for the rest of this source. + */ +static void +basedefs(void) +{ + prologue("curses"); +#ifndef KEY_MAX +# define KEY_MAX 0777 +#endif + printf("define(`M4_KEY_MAX',`8#%o#')", KEY_MAX); +#ifndef KEY_MIN +# define KEY_MIN 0401 +#endif + if (KEY_MIN == 256) + { + fprintf(stderr, "Unexpected value for KEY_MIN: %d\n", KEY_MIN); + exit(1); + } + printf("define(`M4_SPECIAL_FIRST',`8#%o#')", KEY_MIN - 1); +} + +/* + * Write out the comment lines for the menu facility + */ +static void +menu_basedefs(void) +{ + prologue("menu"); +} + +/* + * Write out the comment lines for the form facility + */ +static void +form_basedefs(void) +{ + prologue("form"); +} + +/* + * Write out the comment lines for the mouse facility + */ +static void +mouse_basedefs(void) +{ + prologue("mouse"); +} + +/* + * Write the definition of a single color + */ +static void +color_def(const char *name, int value) +{ + printf(" %-16s : constant Color_Number := %d;\n", name, value); +} + +/* + * Generate all color definitions + */ +static void +gen_color(void) +{ +#if HAVE_USE_DEFAULT_COLORS + color_def("Default_Color", -1); +#endif +#ifdef COLOR_BLACK + color_def("Black", COLOR_BLACK); +#endif +#ifdef COLOR_RED + color_def("Red", COLOR_RED); +#endif +#ifdef COLOR_GREEN + color_def("Green", COLOR_GREEN); +#endif +#ifdef COLOR_YELLOW + color_def("Yellow", COLOR_YELLOW); +#endif +#ifdef COLOR_BLUE + color_def("Blue", COLOR_BLUE); +#endif +#ifdef COLOR_MAGENTA + color_def("Magenta", COLOR_MAGENTA); +#endif +#ifdef COLOR_CYAN + color_def("Cyan", COLOR_CYAN); +#endif +#ifdef COLOR_WHITE + color_def("White", COLOR_WHITE); +#endif +} + +/* + * Generate the linker options for the base facility + */ +static void +gen_linkopts(void) +{ + printf(" pragma Linker_Options (\"-lncurses%s\");\n", model); +} + +/* + * Generate the linker options for the menu facility + */ +static void +gen_menu_linkopts(void) +{ + printf(" pragma Linker_Options (\"-lmenu%s\");\n", model); +} + +/* + * Generate the linker options for the form facility + */ +static void +gen_form_linkopts(void) +{ + printf(" pragma Linker_Options (\"-lform%s\");\n", model); +} + +/* + * Generate the linker options for the panel facility + */ +static void +gen_panel_linkopts(void) +{ + printf(" pragma Linker_Options (\"-lpanel%s\");\n", model); +} + +static void +gen_version_info(void) +{ + static const char *v1 = + " NC_Major_Version : constant := %d; -- Major version of the library\n"; + static const char *v2 = + " NC_Minor_Version : constant := %d; -- Minor version of the library\n"; + static const char *v3 = + " NC_Version : constant String := %c%d.%d%c; -- Version of library\n"; + + printf(v1, NCURSES_VERSION_MAJOR); + printf(v2, NCURSES_VERSION_MINOR); + printf(v3, '"', NCURSES_VERSION_MAJOR, NCURSES_VERSION_MINOR, '"'); +} + +static int +eti_gen(char *buf, int code, const char *name, int *etimin, int *etimax) +{ + sprintf(buf, " E_%-16s : constant Eti_Error := %d;\n", name, code); + if (code < *etimin) + *etimin = code; + if (code > *etimax) + *etimax = code; + return (int)strlen(buf); +} + +static void +gen_offsets(void) +{ + const char *s_bool = ""; + + if (sizeof(bool) == sizeof(char)) + { + s_bool = "char"; + } + else if (sizeof(bool) == sizeof(short)) + { + s_bool = "short"; + } + else if (sizeof(bool) == sizeof(int)) + { + s_bool = "int"; + } + printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n", + 12, "_bool", (long)sizeof(bool), "bool"); + + /* In ncurses _maxy and _maxx needs an offset for the "public" + * value + */ + printf(" Offset%-*s : constant Natural := %2d; -- %s\n", + 12, "_XY", 1, "int"); + printf("\n"); + printf(" type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n", s_bool); +} + +/* + * main() expects two arguments on the commandline, both single characters. + * The first character denotes the facility for which we generate output. + * Possible values are + * B - Base + * M - Menus + * F - Forms + * P - Pointer Device (Mouse) + * E - ETI base definitions + * + * The second character then denotes the specific output that should be + * generated for the selected facility. + */ +int +main(int argc, char *argv[]) +{ + int x = 0x12345678; + char *s = (char *)&x; + + if (*s == 0x78) + little_endian = 1; + + if (argc != 4) + exit(1); + model = *++argv; + + switch (argv[1][0]) + { + /* --------------------------------------------------------------- */ + case 'B': /* The Base facility */ + switch (argv[2][0]) + { + case 'A': /* chtype translation into Ada95 record type */ + gen_attr_set("Character_Attribute_Set"); + break; + case 'B': /* write some initial comment lines */ + basedefs(); + break; + case 'C': /* generate color constants */ + gen_color(); + break; + case 'D': /* generate displacements of fields in WINDOW struct. */ + gen_offsets(); + break; + case 'E': /* generate Mouse Event codes */ + gen_mouse_events(); + break; + case 'K': /* translation of keycodes */ + gen_keydefs(0); + break; + case 'L': /* generate the Linker_Options pragma */ + gen_linkopts(); + break; + case 'M': /* generate constants for the ACS characters */ + gen_acs(); + break; + case 'O': /* generate definitions of the old key code names */ + gen_keydefs(1); + break; + case 'P': /* generate definitions of the public variables */ + gen_public_vars(); + break; + case 'R': /* generate representation clause for Attributed character */ + gen_chtype_rep("Attributed_Character"); + break; + case 'T': /* generate the Trace info */ + gen_trace("Trace_Attribute_Set"); + break; + case 'V': /* generate version info */ + gen_version_info(); + break; + default: + break; + } + break; + /* --------------------------------------------------------------- */ + case 'M': /* The Menu facility */ + switch (argv[2][0]) + { + case 'R': /* generate representation clause for Menu_Option_Set */ + gen_menu_opt_rep("Menu_Option_Set"); + break; + case 'B': /* write some initial comment lines */ + menu_basedefs(); + break; + case 'L': /* generate the Linker_Options pragma */ + gen_menu_linkopts(); + break; + case 'I': /* generate representation clause for Item_Option_Set */ + gen_item_opt_rep("Item_Option_Set"); + break; + default: + break; + } + break; + /* --------------------------------------------------------------- */ + case 'F': /* The Form facility */ + switch (argv[2][0]) + { + case 'R': /* generate representation clause for Form_Option_Set */ + gen_form_opt_rep("Form_Option_Set"); + break; + case 'B': /* write some initial comment lines */ + form_basedefs(); + break; + case 'L': /* generate the Linker_Options pragma */ + gen_form_linkopts(); + break; + case 'I': /* generate representation clause for Field_Option_Set */ + gen_field_opt_rep("Field_Option_Set"); + break; + default: + break; + } + break; + /* --------------------------------------------------------------- */ + case 'P': /* The Pointer(=Mouse) facility */ + switch (argv[2][0]) + { + case 'B': /* write some initial comment lines */ + mouse_basedefs(); + break; + case 'M': /* generate representation clause for Mouse_Event */ + gen_mrep_rep("Mouse_Event"); + break; + case 'L': /* generate the Linker_Options pragma */ + gen_panel_linkopts(); + break; + default: + break; + } + break; + /* --------------------------------------------------------------- */ + case 'E': /* chtype size detection */ + switch (argv[2][0]) + { + case 'C': + { + const char *fmt = " type C_Chtype is new %s;\n"; + const char *afmt = " type C_AttrType is new %s;\n"; + + if (sizeof(chtype) == sizeof(int)) + { + if (sizeof(int) == sizeof(long)) + printf(fmt, "C_ULong"); + + else + printf(fmt, "C_UInt"); + } + else if (sizeof(chtype) == sizeof(long)) + { + printf(fmt, "C_ULong"); + } + else + printf("Error\n"); + + if (sizeof(attr_t) == sizeof(int)) + { + if (sizeof(int) == sizeof(long)) + printf(afmt, "C_ULong"); + + else + printf(afmt, "C_UInt"); + } + else if (sizeof(attr_t) == sizeof(long)) + { + printf(afmt, "C_ULong"); + } + else + printf("Error\n"); + + printf("define(`CF_CURSES_OK',`%d')", OK); + printf("define(`CF_CURSES_ERR',`%d')", ERR); + printf("define(`CF_CURSES_TRUE',`%d')", TRUE); + printf("define(`CF_CURSES_FALSE',`%d')", FALSE); + } + break; + case 'E': + { + char *buf = (char *)malloc(2048); + char *p = buf; + int etimin = E_OK; + int etimax = E_OK; + + if (p) + { + p += eti_gen(p, E_OK, "Ok", &etimin, &etimax); + p += eti_gen(p, E_SYSTEM_ERROR, "System_Error", &etimin, &etimax); + p += eti_gen(p, E_BAD_ARGUMENT, "Bad_Argument", &etimin, &etimax); + p += eti_gen(p, E_POSTED, "Posted", &etimin, &etimax); + p += eti_gen(p, E_CONNECTED, "Connected", &etimin, &etimax); + p += eti_gen(p, E_BAD_STATE, "Bad_State", &etimin, &etimax); + p += eti_gen(p, E_NO_ROOM, "No_Room", &etimin, &etimax); + p += eti_gen(p, E_NOT_POSTED, "Not_Posted", &etimin, &etimax); + p += eti_gen(p, E_UNKNOWN_COMMAND, + "Unknown_Command", &etimin, &etimax); + p += eti_gen(p, E_NO_MATCH, "No_Match", &etimin, &etimax); + p += eti_gen(p, E_NOT_SELECTABLE, + "Not_Selectable", &etimin, &etimax); + p += eti_gen(p, E_NOT_CONNECTED, + "Not_Connected", &etimin, &etimax); + p += eti_gen(p, E_REQUEST_DENIED, + "Request_Denied", &etimin, &etimax); + p += eti_gen(p, E_INVALID_FIELD, + "Invalid_Field", &etimin, &etimax); + p += eti_gen(p, E_CURRENT, + "Current", &etimin, &etimax); + } + printf(" subtype Eti_Error is C_Int range %d .. %d;\n\n", + etimin, etimax); + printf("%s", buf); + } + break; + default: + break; + } + break; + /* --------------------------------------------------------------- */ + case 'V': /* plain version dump */ + { + switch (argv[2][0]) + { + case '1': /* major version */ +#ifdef NCURSES_VERSION_MAJOR + printf("%d", NCURSES_VERSION_MAJOR); +#endif + break; + case '2': /* minor version */ +#ifdef NCURSES_VERSION_MINOR + printf("%d", NCURSES_VERSION_MINOR); +#endif + break; + case '3': /* patch level */ +#ifdef NCURSES_VERSION_PATCH + printf("%d", NCURSES_VERSION_PATCH); +#endif + break; + default: + break; + } + } + break; + /* --------------------------------------------------------------- */ + default: + break; + } + return 0; +} diff --git a/Ada95/gen/html.m4 b/Ada95/gen/html.m4 new file mode 100644 index 00000000000..8df2653c7ec --- /dev/null +++ b/Ada95/gen/html.m4 @@ -0,0 +1,40 @@ +dnl*************************************************************************** +dnl Copyright (c) 2000-2006,2007 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl $Id: html.m4,v 1.3 2007/09/01 23:59:59 tom Exp $ +define(`ANCHORIDX',`0')dnl +define(`MANPAGE',`define(`MANPG',$1)dnl +|===================================================================== + -- | Man page MANPG + -- |=====================================================================')dnl +define(`ANCHOR',`define(`ANCHORIDX',incr(ANCHORIDX))dnl +`#'1A NAME="AFU`_'ANCHORIDX"`#'2dnl +define(`CFUNAME',`$1')define(`AFUNAME',`$2')dnl +|')dnl +define(`AKA',``AKA': CFUNAME')dnl +define(`ALIAS',``AKA': $1')dnl diff --git a/Ada95/gen/normal.m4 b/Ada95/gen/normal.m4 new file mode 100644 index 00000000000..95299768314 --- /dev/null +++ b/Ada95/gen/normal.m4 @@ -0,0 +1,37 @@ +dnl*************************************************************************** +dnl Copyright (c) 1998,2006 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl $Id: normal.m4,v 1.2 2006/04/22 23:16:14 tom Exp $ +define(`MANPAGE',`define(`MANPG',$1)dnl +|===================================================================== + -- | Man page MANPG + -- |=====================================================================')dnl +define(`ANCHOR',`define(`CFUNAME',`$1')define(`AFUNAME',`$2')'dnl +|)dnl +define(`AKA',``AKA': CFUNAME')dnl +define(`ALIAS',``AKA': $1')dnl diff --git a/Ada95/gen/table.m4 b/Ada95/gen/table.m4 new file mode 100644 index 00000000000..36b0027b8d1 --- /dev/null +++ b/Ada95/gen/table.m4 @@ -0,0 +1,35 @@ +dnl*************************************************************************** +dnl Copyright (c) 2000,2006 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl $Id: table.m4,v 1.2 2006/04/22 23:16:44 tom Exp $ +define(`ANCHORIDX',`0')dnl +define(`MANPAGE',`define(`MANPG',$1)')dnl +divert(-1)dnl +define(`ANCHOR',`divert(0)define(`ANCHORIDX',incr(ANCHORIDX))dnl +$1$2MANPG +divert(-1)') diff --git a/Ada95/gen/terminal_interface-curses-aux.ads.m4 b/Ada95/gen/terminal_interface-curses-aux.ads.m4 new file mode 100644 index 00000000000..0f4c0626616 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-aux.ads.m4 @@ -0,0 +1,105 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-aux__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Aux -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2007,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.17 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +include(`Base_Defs') +with System; +with Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Unchecked_Conversion; + +package Terminal_Interface.Curses.Aux is + pragma Preelaborate (Terminal_Interface.Curses.Aux); + + use type Interfaces.C.int; + + subtype C_Int is Interfaces.C.int; + subtype C_Short is Interfaces.C.short; + subtype C_Long_Int is Interfaces.C.long; + subtype C_Size_T is Interfaces.C.size_t; + subtype C_UInt is Interfaces.C.unsigned; + subtype C_ULong is Interfaces.C.unsigned_long; + subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr; + type C_Void_Ptr is new System.Address; +include(`Chtype_Def') + -- This is how those constants are defined in ncurses. I see them also + -- exactly like this in all ETI implementations I ever tested. So it + -- could be that this is quite general, but please check with your curses. + -- This is critical, because curses sometime mixes boolean returns with + -- returning an error status. + Curses_Ok : constant C_Int := CF_CURSES_OK; + Curses_Err : constant C_Int := CF_CURSES_ERR; + + Curses_True : constant C_Int := CF_CURSES_TRUE; + Curses_False : constant C_Int := CF_CURSES_FALSE; + + -- Eti_Error: type for error codes returned by the menu and form subsystem +include(`Eti_Defs') + procedure Eti_Exception (Code : Eti_Error); + -- Dispatch the error code and raise the appropriate exception + -- + -- + -- Some helpers + function Chtype_To_AttrChar is new + Unchecked_Conversion (Source => C_Chtype, + Target => Attributed_Character); + function AttrChar_To_Chtype is new + Unchecked_Conversion (Source => Attributed_Character, + Target => C_Chtype); + + function AttrChar_To_AttrType is new + Unchecked_Conversion (Source => Attributed_Character, + Target => C_AttrType); + + function AttrType_To_AttrChar is new + Unchecked_Conversion (Source => C_AttrType, + Target => Attributed_Character); + + procedure Fill_String (Cp : chars_ptr; + Str : out String); + -- Fill the Str parameter with the string denoted by the chars_ptr + -- C-Style string. + + function Fill_String (Cp : chars_ptr) return String; + -- Same but as function. + +end Terminal_Interface.Curses.Aux; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 new file mode 100644 index 00000000000..36314012ed9 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 @@ -0,0 +1,238 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.15 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; + +package Terminal_Interface.Curses.Forms.Field_Types is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types); + use type Interfaces.C.int; + subtype C_Int is Interfaces.C.int; + + -- MANPAGE(`form_fieldtype.3x') + + type Field_Type is abstract tagged null record; + -- Abstract base type for all field types. A concrete field type + -- is an extension that adds some data elements describing formats or + -- boundary values for the type and validation routines. + -- For the builtin low-level fieldtypes, the validation routines are + -- already defined by the low-level C library. + -- The builtin types like Alpha or AlphaNumeric etc. are defined in + -- child packages of this package. You may use one of them as example + -- how to create you own child packages for low-level field types that + -- you may have already written in C. + + type Field_Type_Access is access all Field_Type'Class; + + -- ANCHOR(`set_field_type()',`Set_Type') + procedure Set_Field_Type (Fld : Field; + Fld_Type : Field_Type) is abstract; + -- AKA + -- But: we hide the vararg mechanism of the C interface. You always + -- have to pass a single Field_Type parameter. + + -- --------------------------------------------------------------------- + + -- MANPAGE(`form_field_validation.3x') + + -- ANCHOR(`field_type()',`Get_Type') + function Get_Type (Fld : Field) return Field_Type_Access; + -- AKA + -- ALIAS(`field_arg()') + -- In Ada95 we can combine these. If you try to retrieve the field type + -- that is not defined as extension of the abstract tagged type above, + -- you will raise a Form_Exception. + -- This is not inlined + + -- +---------------------------------------------------------------------- + -- | Private Part. + -- | Most of this is used by the implementations of the child packages. + -- | +private + type Makearg_Function is access + function (Args : System.Address) return System.Address; + pragma Convention (C, Makearg_Function); + + type Copyarg_Function is access + function (Usr : System.Address) return System.Address; + pragma Convention (C, Copyarg_Function); + + type Freearg_Function is access + procedure (Usr : System.Address); + pragma Convention (C, Freearg_Function); + + type Field_Check_Function is access + function (Fld : Field; Usr : System.Address) return C_Int; + pragma Convention (C, Field_Check_Function); + + type Char_Check_Function is access + function (Ch : C_Int; Usr : System.Address) return C_Int; + pragma Convention (C, Char_Check_Function); + + type Choice_Function is access + function (Fld : Field; Usr : System.Address) return C_Int; + pragma Convention (C, Choice_Function); + + -- +---------------------------------------------------------------------- + -- | This must be in sync with the FIELDTYPE structure in form.h + -- | + type Low_Level_Field_Type is + record + Status : Interfaces.C.short; + Ref_Count : Interfaces.C.long; + Left, Right : System.Address; + Makearg : Makearg_Function; + Copyarg : Copyarg_Function; + Freearg : Freearg_Function; + Fcheck : Field_Check_Function; + Ccheck : Char_Check_Function; + Next, Prev : Choice_Function; + end record; + pragma Convention (C, Low_Level_Field_Type); + type C_Field_Type is access all Low_Level_Field_Type; + + Null_Field_Type : constant C_Field_Type := null; + + -- +---------------------------------------------------------------------- + -- | This four low-level fieldtypes are the ones associated with + -- | fieldtypes handled by this binding. Any other low-level fieldtype + -- | will result in a Form_Exception is function Get_Type. + -- | + M_Generic_Type : C_Field_Type := null; + M_Generic_Choice : C_Field_Type := null; + M_Builtin_Router : C_Field_Type := null; + M_Choice_Router : C_Field_Type := null; + + -- Two wrapper functions to access those low-level fieldtypes defined + -- in this package. + function C_Builtin_Router return C_Field_Type; + function C_Choice_Router return C_Field_Type; + + procedure Wrap_Builtin (Fld : Field; + Typ : Field_Type'Class; + Cft : C_Field_Type := C_Builtin_Router); + -- This procedure has to be called by the Set_Field_Type implementation + -- for builtin low-level fieldtypes to replace it by an Ada95 + -- conformant Field_Type object. + -- The parameter Cft must be C_Builtin_Router for regular low-level + -- fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for + -- low-level fieldtypes witch choice functions (like TYP_ENUM). + -- Any other value will raise a Form_Exception. + + function Make_Arg (Args : System.Address) return System.Address; + pragma Convention (C, Make_Arg); + -- This is the Makearg_Function for the internal low-level types + -- introduced by this binding. + + function Copy_Arg (Usr : System.Address) return System.Address; + pragma Convention (C, Copy_Arg); + -- This is the Copyarg_Function for the internal low-level types + -- introduced by this binding. + + procedure Free_Arg (Usr : System.Address); + pragma Convention (C, Free_Arg); + -- This is the Freearg_Function for the internal low-level types + -- introduced by this binding. + + function Field_Check_Router (Fld : Field; + Usr : System.Address) return C_Int; + pragma Convention (C, Field_Check_Router); + -- This is the Field_Check_Function for the internal low-level types + -- introduced to wrap the low-level types by a Field_Type derived + -- type. It routes the call to the corresponding low-level validation + -- function. + + function Char_Check_Router (Ch : C_Int; + Usr : System.Address) return C_Int; + pragma Convention (C, Char_Check_Router); + -- This is the Char_Check_Function for the internal low-level types + -- introduced to wrap the low-level types by a Field_Type derived + -- type. It routes the call to the corresponding low-level validation + -- function. + + function Next_Router (Fld : Field; + Usr : System.Address) return C_Int; + pragma Convention (C, Next_Router); + -- This is the Choice_Function for the internal low-level types + -- introduced to wrap the low-level types by a Field_Type derived + -- type. It routes the call to the corresponding low-level next_choice + -- function. + + function Prev_Router (Fld : Field; + Usr : System.Address) return C_Int; + pragma Convention (C, Prev_Router); + -- This is the Choice_Function for the internal low-level types + -- introduced to wrap the low-level types by a Field_Type derived + -- type. It routes the call to the corresponding low-level prev_choice + -- function. + + -- This is the Argument structure maintained by all low-level field types + -- introduced by this binding. + type Argument is record + Typ : Field_Type_Access; -- the Field_Type creating this record + Usr : System.Address; -- original arg for builtin low-level types + Cft : C_Field_Type; -- the original low-level type + end record; + type Argument_Access is access all Argument; + + -- +---------------------------------------------------------------------- + -- | + -- | Some Imports of libform routines to deal with low-level fieldtypes. + -- | + function New_Fieldtype (Fcheck : Field_Check_Function; + Ccheck : Char_Check_Function) + return C_Field_Type; + pragma Import (C, New_Fieldtype, "new_fieldtype"); + + function Set_Fieldtype_Arg (Cft : C_Field_Type; + Mak : Makearg_Function := Make_Arg'Access; + Cop : Copyarg_Function := Copy_Arg'Access; + Fre : Freearg_Function := Free_Arg'Access) + return C_Int; + pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg"); + + function Set_Fieldtype_Choice (Cft : C_Field_Type; + Next, Prev : Choice_Function) + return C_Int; + pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice"); + +end Terminal_Interface.Curses.Forms.Field_Types; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 new file mode 100644 index 00000000000..9de700bcd05 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 @@ -0,0 +1,70 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_User_Data -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.16 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Forms.Field_User_Data is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data); + + -- MANPAGE(`form_field_userptr.3x') + + -- ANCHOR(`set_field_userptr',`Set_User_Data') + procedure Set_User_Data (Fld : Field; + Data : User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`field_userptr',`Get_User_Data') + procedure Get_User_Data (Fld : Field; + Data : out User_Access); + -- AKA + + -- ANCHOR(`field_userptr',`Get_User_Data') + function Get_User_Data (Fld : Field) return User_Access; + -- AKA + -- Sama as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 new file mode 100644 index 00000000000..f7fb1a702f3 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 @@ -0,0 +1,70 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms-form_user_data__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Form_User_Data -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.15 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Forms.Form_User_Data is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data); + + -- MANPAGE(`form_userptr.3x') + + -- ANCHOR(`set_form_userptr',`Set_User_Data') + procedure Set_User_Data (Frm : Form; + Data : User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`form_userptr',`Get_User_Data') + procedure Get_User_Data (Frm : Form; + Data : out User_Access); + -- AKA + + -- ANCHOR(`form_userptr',`Get_User_Data') + function Get_User_Data (Frm : Form) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Forms.Form_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4 new file mode 100644 index 00000000000..a4329ba9f0c --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms.ads.m4 @@ -0,0 +1,699 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Form -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.30 $ +-- $Date: 2009/12/26 17:31:35 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +include(`Form_Base_Defs') +with System; +with Ada.Characters.Latin_1; + +package Terminal_Interface.Curses.Forms is + pragma Preelaborate (Terminal_Interface.Curses.Forms); +include(`Form_Linker_Options')dnl +include(`Linker_Options') + Space : Character renames Ada.Characters.Latin_1.Space; + + type Field is private; + type Form is private; + + Null_Field : constant Field; + Null_Form : constant Form; + + type Field_Justification is (None, + Left, + Center, + Right); + + pragma Warnings (Off); +include(`Field_Rep')Dnl + + pragma Warnings (On); + + function Default_Field_Options return Field_Option_Set; + -- The initial defaults for the field options. + pragma Inline (Default_Field_Options); + + pragma Warnings (Off); +include(`Form_Opt_Rep')Dnl + + pragma Warnings (On); + + function Default_Form_Options return Form_Option_Set; + -- The initial defaults for the form options. + pragma Inline (Default_Form_Options); + + type Buffer_Number is new Natural; + + type Field_Array is array (Positive range <>) of aliased Field; + pragma Convention (C, Field_Array); + + type Field_Array_Access is access Field_Array; + + procedure Free (FA : in out Field_Array_Access; + Free_Fields : Boolean := False); + -- Release the memory for an allocated field array + -- If Free_Fields is True, call Delete() for all the fields in + -- the array. + + subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57); + + -- The prefix F_ stands for "Form Request" + F_Next_Page : constant Form_Request_Code := Key_Max + 1; + F_Previous_Page : constant Form_Request_Code := Key_Max + 2; + F_First_Page : constant Form_Request_Code := Key_Max + 3; + F_Last_Page : constant Form_Request_Code := Key_Max + 4; + + F_Next_Field : constant Form_Request_Code := Key_Max + 5; + F_Previous_Field : constant Form_Request_Code := Key_Max + 6; + F_First_Field : constant Form_Request_Code := Key_Max + 7; + F_Last_Field : constant Form_Request_Code := Key_Max + 8; + F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9; + F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10; + F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11; + F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12; + F_Left_Field : constant Form_Request_Code := Key_Max + 13; + F_Right_Field : constant Form_Request_Code := Key_Max + 14; + F_Up_Field : constant Form_Request_Code := Key_Max + 15; + F_Down_Field : constant Form_Request_Code := Key_Max + 16; + + F_Next_Char : constant Form_Request_Code := Key_Max + 17; + F_Previous_Char : constant Form_Request_Code := Key_Max + 18; + F_Next_Line : constant Form_Request_Code := Key_Max + 19; + F_Previous_Line : constant Form_Request_Code := Key_Max + 20; + F_Next_Word : constant Form_Request_Code := Key_Max + 21; + F_Previous_Word : constant Form_Request_Code := Key_Max + 22; + F_Begin_Field : constant Form_Request_Code := Key_Max + 23; + F_End_Field : constant Form_Request_Code := Key_Max + 24; + F_Begin_Line : constant Form_Request_Code := Key_Max + 25; + F_End_Line : constant Form_Request_Code := Key_Max + 26; + F_Left_Char : constant Form_Request_Code := Key_Max + 27; + F_Right_Char : constant Form_Request_Code := Key_Max + 28; + F_Up_Char : constant Form_Request_Code := Key_Max + 29; + F_Down_Char : constant Form_Request_Code := Key_Max + 30; + + F_New_Line : constant Form_Request_Code := Key_Max + 31; + F_Insert_Char : constant Form_Request_Code := Key_Max + 32; + F_Insert_Line : constant Form_Request_Code := Key_Max + 33; + F_Delete_Char : constant Form_Request_Code := Key_Max + 34; + F_Delete_Previous : constant Form_Request_Code := Key_Max + 35; + F_Delete_Line : constant Form_Request_Code := Key_Max + 36; + F_Delete_Word : constant Form_Request_Code := Key_Max + 37; + F_Clear_EOL : constant Form_Request_Code := Key_Max + 38; + F_Clear_EOF : constant Form_Request_Code := Key_Max + 39; + F_Clear_Field : constant Form_Request_Code := Key_Max + 40; + F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41; + F_Insert_Mode : constant Form_Request_Code := Key_Max + 42; + + -- Vertical Scrolling + F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43; + F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44; + F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45; + F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46; + F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47; + F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48; + + -- Horizontal Scrolling + F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49; + F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50; + F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51; + F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52; + F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53; + F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54; + + F_Validate_Field : constant Form_Request_Code := Key_Max + 55; + F_Next_Choice : constant Form_Request_Code := Key_Max + 56; + F_Previous_Choice : constant Form_Request_Code := Key_Max + 57; + + -- For those who like the old 'C' style request names + REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page; + REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page; + REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page; + REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page; + + REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field; + REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field; + REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field; + REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field; + REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field; + REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field; + REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field; + REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field; + REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field; + REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field; + REQ_UP_FIELD : Form_Request_Code renames F_Up_Field; + REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field; + + REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char; + REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char; + REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line; + REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line; + REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word; + REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word; + REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field; + REQ_END_FIELD : Form_Request_Code renames F_End_Field; + REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line; + REQ_END_LINE : Form_Request_Code renames F_End_Line; + REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char; + REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char; + REQ_UP_CHAR : Form_Request_Code renames F_Up_Char; + REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char; + + REQ_NEW_LINE : Form_Request_Code renames F_New_Line; + REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char; + REQ_INS_LINE : Form_Request_Code renames F_Insert_Line; + REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char; + REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous; + REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line; + REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word; + REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL; + REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF; + REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field; + REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode; + REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode; + + REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line; + REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line; + REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page; + REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page; + REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage; + REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage; + + REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char; + REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char; + REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line; + REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line; + REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine; + REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine; + + REQ_VALIDATION : Form_Request_Code renames F_Validate_Field; + REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice; + REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice; + + procedure Request_Name (Key : Form_Request_Code; + Name : out String); + + function Request_Name (Key : Form_Request_Code) return String; + -- Same as function + pragma Inline (Request_Name); + + ------------------ + -- Exceptions -- + ------------------ + Form_Exception : exception; + + -- MANPAGE(`form_field_new.3x') + + -- ANCHOR(`new_field()',`Create') + function Create (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field; + -- AKA + -- An overloaded Create is defined later. Pragma Inline appears there. + + -- ANCHOR(`new_field()',`New_Field') + function New_Field (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field renames Create; + -- AKA + pragma Inline (New_Field); + + -- ANCHOR(`free_field()',`Delete') + procedure Delete (Fld : in out Field); + -- AKA + -- Reset Fld to Null_Field + -- An overloaded Delete is defined later. Pragma Inline appears there. + + -- ANCHOR(`dup_field()',`Duplicate') + function Duplicate (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field; + -- AKA + pragma Inline (Duplicate); + + -- ANCHOR(`link_field()',`Link') + function Link (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field; + -- AKA + pragma Inline (Link); + + -- MANPAGE(`form_field_just.3x') + + -- ANCHOR(`set_field_just()',`Set_Justification') + procedure Set_Justification (Fld : Field; + Just : Field_Justification := None); + -- AKA + pragma Inline (Set_Justification); + + -- ANCHOR(`field_just()',`Get_Justification') + function Get_Justification (Fld : Field) return Field_Justification; + -- AKA + pragma Inline (Get_Justification); + + -- MANPAGE(`form_field_buffer.3x') + + -- ANCHOR(`set_field_buffer()',`Set_Buffer') + procedure Set_Buffer + (Fld : Field; + Buffer : Buffer_Number := Buffer_Number'First; + Str : String); + -- AKA + -- Not inlined + + -- ANCHOR(`field_buffer()',`Get_Buffer') + procedure Get_Buffer + (Fld : Field; + Buffer : Buffer_Number := Buffer_Number'First; + Str : out String); + -- AKA + + function Get_Buffer + (Fld : Field; + Buffer : Buffer_Number := Buffer_Number'First) return String; + -- AKA + -- Same but as function + pragma Inline (Get_Buffer); + + -- ANCHOR(`set_field_status()',`Set_Status') + procedure Set_Status (Fld : Field; + Status : Boolean := True); + -- AKA + pragma Inline (Set_Status); + + -- ANCHOR(`field_status()',`Changed') + function Changed (Fld : Field) return Boolean; + -- AKA + pragma Inline (Changed); + + -- ANCHOR(`set_field_max()',`Set_Maximum_Size') + procedure Set_Maximum_Size (Fld : Field; + Max : Natural := 0); + -- AKA + pragma Inline (Set_Maximum_Size); + + -- MANPAGE(`form_field_opts.3x') + + -- ANCHOR(`set_field_opts()',`Set_Options') + procedure Set_Options (Fld : Field; + Options : Field_Option_Set); + -- AKA + -- An overloaded version is defined later. Pragma Inline appears there + + -- ANCHOR(`field_opts_on()',`Switch_Options') + procedure Switch_Options (Fld : Field; + Options : Field_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`field_opts_off()') + -- An overloaded version is defined later. Pragma Inline appears there + + -- ANCHOR(`field_opts()',`Get_Options') + procedure Get_Options (Fld : Field; + Options : out Field_Option_Set); + -- AKA + + -- ANCHOR(`field_opts()',`Get_Options') + function Get_Options (Fld : Field := Null_Field) + return Field_Option_Set; + -- AKA + -- An overloaded version is defined later. Pragma Inline appears there + + -- MANPAGE(`form_field_attributes.3x') + + -- ANCHOR(`set_field_fore()',`Set_Foreground') + procedure Set_Foreground + (Fld : Field; + Fore : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Foreground); + + -- ANCHOR(`field_fore()',`Foreground') + procedure Foreground (Fld : Field; + Fore : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`field_fore()',`Foreground') + procedure Foreground (Fld : Field; + Fore : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Foreground); + + -- ANCHOR(`set_field_back()',`Set_Background') + procedure Set_Background + (Fld : Field; + Back : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Background); + + -- ANCHOR(`field_back()',`Background') + procedure Background (Fld : Field; + Back : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`field_back()',`Background') + procedure Background (Fld : Field; + Back : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Background); + + -- ANCHOR(`set_field_pad()',`Set_Pad_Character') + procedure Set_Pad_Character (Fld : Field; + Pad : Character := Space); + -- AKA + pragma Inline (Set_Pad_Character); + + -- ANCHOR(`field_pad()',`Pad_Character') + procedure Pad_Character (Fld : Field; + Pad : out Character); + -- AKA + pragma Inline (Pad_Character); + + -- MANPAGE(`form_field_info.3x') + + -- ANCHOR(`field_info()',`Info') + procedure Info (Fld : Field; + Lines : out Line_Count; + Columns : out Column_Count; + First_Row : out Line_Position; + First_Column : out Column_Position; + Off_Screen : out Natural; + Additional_Buffers : out Buffer_Number); + -- AKA + pragma Inline (Info); + + -- ANCHOR(`dynamic_field_info()',`Dynamic_Info') + procedure Dynamic_Info (Fld : Field; + Lines : out Line_Count; + Columns : out Column_Count; + Max : out Natural); + -- AKA + pragma Inline (Dynamic_Info); + + -- MANPAGE(`form_win.3x') + + -- ANCHOR(`set_form_win()',`Set_Window') + procedure Set_Window (Frm : Form; + Win : Window); + -- AKA + pragma Inline (Set_Window); + + -- ANCHOR(`form_win()',`Get_Window') + function Get_Window (Frm : Form) return Window; + -- AKA + pragma Inline (Get_Window); + + -- ANCHOR(`set_form_sub()',`Set_Sub_Window') + procedure Set_Sub_Window (Frm : Form; + Win : Window); + -- AKA + pragma Inline (Set_Sub_Window); + + -- ANCHOR(`form_sub()',`Get_Sub_Window') + function Get_Sub_Window (Frm : Form) return Window; + -- AKA + pragma Inline (Get_Sub_Window); + + -- ANCHOR(`scale_form()',`Scale') + procedure Scale (Frm : Form; + Lines : out Line_Count; + Columns : out Column_Count); + -- AKA + pragma Inline (Scale); + + -- MANPAGE(`form_hook.3x') + + type Form_Hook_Function is access procedure (Frm : Form); + pragma Convention (C, Form_Hook_Function); + + -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook') + procedure Set_Field_Init_Hook (Frm : Form; + Proc : Form_Hook_Function); + -- AKA + pragma Inline (Set_Field_Init_Hook); + + -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook') + procedure Set_Field_Term_Hook (Frm : Form; + Proc : Form_Hook_Function); + -- AKA + pragma Inline (Set_Field_Term_Hook); + + -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook') + procedure Set_Form_Init_Hook (Frm : Form; + Proc : Form_Hook_Function); + -- AKA + pragma Inline (Set_Form_Init_Hook); + + -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook') + procedure Set_Form_Term_Hook (Frm : Form; + Proc : Form_Hook_Function); + -- AKA + pragma Inline (Set_Form_Term_Hook); + + -- ANCHOR(`field_init()',`Get_Field_Init_Hook') + function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Field_Init_Hook, "field_init"); + + -- ANCHOR(`field_term()',`Get_Field_Term_Hook') + function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Field_Term_Hook, "field_term"); + + -- ANCHOR(`form_init()',`Get_Form_Init_Hook') + function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Form_Init_Hook, "form_init"); + + -- ANCHOR(`form_term()',`Get_Form_Term_Hook') + function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Form_Term_Hook, "form_term"); + + -- MANPAGE(`form_field.3x') + + -- ANCHOR(`set_form_fields()',`Redefine') + procedure Redefine (Frm : Form; + Flds : Field_Array_Access); + -- AKA + pragma Inline (Redefine); + + -- ANCHOR(`set_form_fields()',`Set_Fields') + procedure Set_Fields (Frm : Form; + Flds : Field_Array_Access) renames Redefine; + -- AKA + -- pragma Inline (Set_Fields); + + -- ANCHOR(`form_fields()',`Fields') + function Fields (Frm : Form; + Index : Positive) return Field; + -- AKA + pragma Inline (Fields); + + -- ANCHOR(`field_count()',`Field_Count') + function Field_Count (Frm : Form) return Natural; + -- AKA + pragma Inline (Field_Count); + + -- ANCHOR(`move_field()',`Move') + procedure Move (Fld : Field; + Line : Line_Position; + Column : Column_Position); + -- AKA + pragma Inline (Move); + + -- MANPAGE(`form_new.3x') + + -- ANCHOR(`new_form()',`Create') + function Create (Fields : Field_Array_Access) return Form; + -- AKA + pragma Inline (Create); + + -- ANCHOR(`new_form()',`New_Form') + function New_Form (Fields : Field_Array_Access) return Form + renames Create; + -- AKA + -- pragma Inline (New_Form); + + -- ANCHOR(`free_form()',`Delete') + procedure Delete (Frm : in out Form); + -- AKA + -- Reset Frm to Null_Form + pragma Inline (Delete); + + -- MANPAGE(`form_opts.3x') + + -- ANCHOR(`set_form_opts()',`Set_Options') + procedure Set_Options (Frm : Form; + Options : Form_Option_Set); + -- AKA + pragma Inline (Set_Options); + + -- ANCHOR(`form_opts_on()',`Switch_Options') + procedure Switch_Options (Frm : Form; + Options : Form_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`form_opts_off()') + pragma Inline (Switch_Options); + + -- ANCHOR(`form_opts()',`Get_Options') + procedure Get_Options (Frm : Form; + Options : out Form_Option_Set); + -- AKA + + -- ANCHOR(`form_opts()',`Get_Options') + function Get_Options (Frm : Form := Null_Form) return Form_Option_Set; + -- AKA + pragma Inline (Get_Options); + + -- MANPAGE(`form_post.3x') + + -- ANCHOR(`post_form()',`Post') + procedure Post (Frm : Form; + Post : Boolean := True); + -- AKA + -- ALIAS(`unpost_form()') + pragma Inline (Post); + + -- MANPAGE(`form_cursor.3x') + + -- ANCHOR(`pos_form_cursor()',`Position_Cursor') + procedure Position_Cursor (Frm : Form); + -- AKA + pragma Inline (Position_Cursor); + + -- MANPAGE(`form_data.3x') + + -- ANCHOR(`data_ahead()',`Data_Ahead') + function Data_Ahead (Frm : Form) return Boolean; + -- AKA + pragma Inline (Data_Ahead); + + -- ANCHOR(`data_behind()',`Data_Behind') + function Data_Behind (Frm : Form) return Boolean; + -- AKA + pragma Inline (Data_Behind); + + -- MANPAGE(`form_driver.3x') + + type Driver_Result is (Form_Ok, + Request_Denied, + Unknown_Request, + Invalid_Field); + + -- ANCHOR(`form_driver()',`Driver') + function Driver (Frm : Form; + Key : Key_Code) return Driver_Result; + -- AKA + -- Driver not inlined + + -- MANPAGE(`form_page.3x') + + type Page_Number is new Natural; + + -- ANCHOR(`set_current_field()',`Set_Current') + procedure Set_Current (Frm : Form; + Fld : Field); + -- AKA + pragma Inline (Set_Current); + + -- ANCHOR(`current_field()',`Current') + function Current (Frm : Form) return Field; + -- AKA + pragma Inline (Current); + + -- ANCHOR(`set_form_page()',`Set_Page') + procedure Set_Page (Frm : Form; + Page : Page_Number := Page_Number'First); + -- AKA + pragma Inline (Set_Page); + + -- ANCHOR(`form_page()',`Page') + function Page (Frm : Form) return Page_Number; + -- AKA + pragma Inline (Page); + + -- ANCHOR(`field_index()',`Get_Index') + function Get_Index (Fld : Field) return Positive; + -- AKA + -- Please note that in this binding we start the numbering of fields + -- with 1. So this is number is one more than you get from the low + -- level call. + pragma Inline (Get_Index); + + -- MANPAGE(`form_new_page.3x') + + -- ANCHOR(`set_new_page()',`Set_New_Page') + procedure Set_New_Page (Fld : Field; + New_Page : Boolean := True); + -- AKA + pragma Inline (Set_New_Page); + + -- ANCHOR(`new_page()',`Is_New_Page') + function Is_New_Page (Fld : Field) return Boolean; + -- AKA + pragma Inline (Is_New_Page); + + -- MANPAGE(`form_requestname.3x') + -- Not Implemented: form_request_name, form_request_by_name + +------------------------------------------------------------------------------ +private + type Field is new System.Storage_Elements.Integer_Address; + type Form is new System.Storage_Elements.Integer_Address; + + Null_Field : constant Field := 0; + Null_Form : constant Form := 0; + +end Terminal_Interface.Curses.Forms; diff --git a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 new file mode 100644 index 00000000000..4ffa41b5bde --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 @@ -0,0 +1,75 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-menus-item_user_data__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Item_User_Data -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.17 $ +-- $Date: 2009/12/26 17:31:35 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Menus.Item_User_Data is + pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data); + + -- The binding uses the same user pointer for menu items + -- as the low level C implementation. So you can safely + -- read or write the user pointer also with the C routines + -- + -- MANPAGE(`mitem_userptr.3x') + + -- ANCHOR(`set_item_userptr',`Set_User_Data') + procedure Set_User_Data (Itm : Item; + Data : User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`item_userptr',`Get_User_Data') + procedure Get_User_Data (Itm : Item; + Data : out User_Access); + -- AKA + + -- ANCHOR(`item_userptr',`Get_User_Data') + function Get_User_Data (Itm : Item) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Menus.Item_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 new file mode 100644 index 00000000000..9138ba6c3ab --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 @@ -0,0 +1,70 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-menus-menu_user_data__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Menu_User_Data -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.15 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Menus.Menu_User_Data is + pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data); + + -- MANPAGE(`menu_userptr.3x') + + -- ANCHOR(`set_menu_userptr',`Set_User_Data') + procedure Set_User_Data (Men : Menu; + Data : User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`menu_userptr',`Get_User_Data') + procedure Get_User_Data (Men : Menu; + Data : out User_Access); + -- AKA + + -- ANCHOR(`menu_userptr',`Get_User_Data') + function Get_User_Data (Men : Menu) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 new file mode 100644 index 00000000000..6274b6ed8f2 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4 @@ -0,0 +1,604 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-menus__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menu -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2007,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.28 $ +-- $Date: 2009/12/26 18:35:22 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +include(`Menu_Base_Defs') +with System; +with Ada.Characters.Latin_1; + +package Terminal_Interface.Curses.Menus is + pragma Preelaborate (Terminal_Interface.Curses.Menus); +include(`Menu_Linker_Options')dnl +include(`Linker_Options') + Space : Character renames Ada.Characters.Latin_1.Space; + + type Item is private; + type Menu is private; + + --------------------------- + -- Interface constants -- + --------------------------- + Null_Item : constant Item; + Null_Menu : constant Menu; + + subtype Menu_Request_Code is Key_Code + range (Key_Max + 1) .. (Key_Max + 17); + + -- The prefix M_ stands for "Menu Request" + M_Left_Item : constant Menu_Request_Code := Key_Max + 1; + M_Right_Item : constant Menu_Request_Code := Key_Max + 2; + M_Up_Item : constant Menu_Request_Code := Key_Max + 3; + M_Down_Item : constant Menu_Request_Code := Key_Max + 4; + M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5; + M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6; + M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7; + M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8; + M_First_Item : constant Menu_Request_Code := Key_Max + 9; + M_Last_Item : constant Menu_Request_Code := Key_Max + 10; + M_Next_Item : constant Menu_Request_Code := Key_Max + 11; + M_Previous_Item : constant Menu_Request_Code := Key_Max + 12; + M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13; + M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14; + M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15; + M_Next_Match : constant Menu_Request_Code := Key_Max + 16; + M_Previous_Match : constant Menu_Request_Code := Key_Max + 17; + + -- For those who like the old 'C' names for the request codes + REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item; + REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item; + REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item; + REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item; + REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line; + REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line; + REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page; + REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page; + REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item; + REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item; + REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item; + REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item; + REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item; + REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern; + REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern; + REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match; + REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match; + + procedure Request_Name (Key : Menu_Request_Code; + Name : out String); + + function Request_Name (Key : Menu_Request_Code) return String; + -- Same as function + + ------------------ + -- Exceptions -- + ------------------ + + Menu_Exception : exception; + -- + -- Menu options + -- + pragma Warnings (Off); +include(`Menu_Opt_Rep')dnl + + pragma Warnings (On); + + function Default_Menu_Options return Menu_Option_Set; + -- Initial default options for a menu. + pragma Inline (Default_Menu_Options); + -- + -- Item options + -- + pragma Warnings (Off); +include(`Item_Rep')dnl + + pragma Warnings (On); + + function Default_Item_Options return Item_Option_Set; + -- Initial default options for an item. + pragma Inline (Default_Item_Options); + + -- + -- Item Array + -- + type Item_Array is array (Positive range <>) of aliased Item; + pragma Convention (C, Item_Array); + + type Item_Array_Access is access Item_Array; + + procedure Free (IA : in out Item_Array_Access; + Free_Items : Boolean := False); + -- Release the memory for an allocated item array + -- If Free_Items is True, call Delete() for all the items in + -- the array. + + -- MANPAGE(`mitem_new.3x') + + -- ANCHOR(`new_item()',`Create') + function Create (Name : String; + Description : String := "") return Item; + -- AKA + -- Not inlined. + + -- ANCHOR(`new_item()',`New_Item') + function New_Item (Name : String; + Description : String := "") return Item + renames Create; + -- AKA + + -- ANCHOR(`free_item()',`Delete') + procedure Delete (Itm : in out Item); + -- AKA + -- Resets Itm to Null_Item + + -- MANPAGE(`mitem_value.3x') + + -- ANCHOR(`set_item_value()',`Set_Value') + procedure Set_Value (Itm : Item; + Value : Boolean := True); + -- AKA + pragma Inline (Set_Value); + + -- ANCHOR(`item_value()',`Value') + function Value (Itm : Item) return Boolean; + -- AKA + pragma Inline (Value); + + -- MANPAGE(`mitem_visible.3x') + + -- ANCHOR(`item_visible()',`Visible') + function Visible (Itm : Item) return Boolean; + -- AKA + pragma Inline (Visible); + + -- MANPAGE(`mitem_opts.3x') + + -- ANCHOR(`set_item_opts()',`Set_Options') + procedure Set_Options (Itm : Item; + Options : Item_Option_Set); + -- AKA + -- An overloaded Set_Options is defined later. Pragma Inline appears there + + -- ANCHOR(`item_opts_on()',`Switch_Options') + procedure Switch_Options (Itm : Item; + Options : Item_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`item_opts_off()') + -- An overloaded Switch_Options is defined later. + -- Pragma Inline appears there + + -- ANCHOR(`item_opts()',`Get_Options') + procedure Get_Options (Itm : Item; + Options : out Item_Option_Set); + -- AKA + + -- ANCHOR(`item_opts()',`Get_Options') + function Get_Options (Itm : Item := Null_Item) return Item_Option_Set; + -- AKA + -- An overloaded Get_Options is defined later. Pragma Inline appears there + + -- MANPAGE(`mitem_name.3x') + + -- ANCHOR(`item_name()',`Name') + procedure Name (Itm : Item; + Name : out String); + -- AKA + function Name (Itm : Item) return String; + -- AKA + -- Implemented as function + pragma Inline (Name); + + -- ANCHOR(`item_description();',`Description') + procedure Description (Itm : Item; + Description : out String); + -- AKA + + function Description (Itm : Item) return String; + -- AKA + -- Implemented as function + pragma Inline (Description); + + -- MANPAGE(`mitem_current.3x') + + -- ANCHOR(`set_current_item()',`Set_Current') + procedure Set_Current (Men : Menu; + Itm : Item); + -- AKA + pragma Inline (Set_Current); + + -- ANCHOR(`current_item()',`Current') + function Current (Men : Menu) return Item; + -- AKA + pragma Inline (Current); + + -- ANCHOR(`set_top_row()',`Set_Top_Row') + procedure Set_Top_Row (Men : Menu; + Line : Line_Position); + -- AKA + pragma Inline (Set_Top_Row); + + -- ANCHOR(`top_row()',`Top_Row') + function Top_Row (Men : Menu) return Line_Position; + -- AKA + pragma Inline (Top_Row); + + -- ANCHOR(`item_index()',`Get_Index') + function Get_Index (Itm : Item) return Positive; + -- AKA + -- Please note that in this binding we start the numbering of items + -- with 1. So this is number is one more than you get from the low + -- level call. + pragma Inline (Get_Index); + + -- MANPAGE(`menu_post.3x') + + -- ANCHOR(`post_menu()',`Post') + procedure Post (Men : Menu; + Post : Boolean := True); + -- AKA + -- ALIAS(`unpost_menu()') + pragma Inline (Post); + + -- MANPAGE(`menu_opts.3x') + + -- ANCHOR(`set_menu_opts()',`Set_Options') + procedure Set_Options (Men : Menu; + Options : Menu_Option_Set); + -- AKA + pragma Inline (Set_Options); + + -- ANCHOR(`menu_opts_on()',`Switch_Options') + procedure Switch_Options (Men : Menu; + Options : Menu_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`menu_opts_off()') + pragma Inline (Switch_Options); + + -- ANCHOR(`menu_opts()',`Get_Options') + procedure Get_Options (Men : Menu; + Options : out Menu_Option_Set); + -- AKA + + -- ANCHOR(`menu_opts()',`Get_Options') + function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set; + -- AKA + pragma Inline (Get_Options); + + -- MANPAGE(`menu_win.3x') + + -- ANCHOR(`set_menu_win()',`Set_Window') + procedure Set_Window (Men : Menu; + Win : Window); + -- AKA + pragma Inline (Set_Window); + + -- ANCHOR(`menu_win()',`Get_Window') + function Get_Window (Men : Menu) return Window; + -- AKA + pragma Inline (Get_Window); + + -- ANCHOR(`set_menu_sub()',`Set_Sub_Window') + procedure Set_Sub_Window (Men : Menu; + Win : Window); + -- AKA + pragma Inline (Set_Sub_Window); + + -- ANCHOR(`menu_sub()',`Get_Sub_Window') + function Get_Sub_Window (Men : Menu) return Window; + -- AKA + pragma Inline (Get_Sub_Window); + + -- ANCHOR(`scale_menu()',`Scale') + procedure Scale (Men : Menu; + Lines : out Line_Count; + Columns : out Column_Count); + -- AKA + pragma Inline (Scale); + + -- MANPAGE(`menu_cursor.3x') + + -- ANCHOR(`pos_menu_cursor()',`Position_Cursor') + procedure Position_Cursor (Men : Menu); + -- AKA + pragma Inline (Position_Cursor); + + -- MANPAGE(`menu_mark.3x') + + -- ANCHOR(`set_menu_mark()',`Set_Mark') + procedure Set_Mark (Men : Menu; + Mark : String); + -- AKA + pragma Inline (Set_Mark); + + -- ANCHOR(`menu_mark()',`Mark') + procedure Mark (Men : Menu; + Mark : out String); + -- AKA + + function Mark (Men : Menu) return String; + -- AKA + -- Implemented as function + pragma Inline (Mark); + + -- MANPAGE(`menu_attributes.3x') + + -- ANCHOR(`set_menu_fore()',`Set_Foreground') + procedure Set_Foreground + (Men : Menu; + Fore : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Foreground); + + -- ANCHOR(`menu_fore()',`Foreground') + procedure Foreground (Men : Menu; + Fore : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`menu_fore()',`Foreground') + procedure Foreground (Men : Menu; + Fore : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Foreground); + + -- ANCHOR(`set_menu_back()',`Set_Background') + procedure Set_Background + (Men : Menu; + Back : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Background); + + -- ANCHOR(`menu_back()',`Background') + procedure Background (Men : Menu; + Back : out Character_Attribute_Set); + -- AKA + -- ANCHOR(`menu_back()',`Background') + + procedure Background (Men : Menu; + Back : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Background); + + -- ANCHOR(`set_menu_grey()',`Set_Grey') + procedure Set_Grey + (Men : Menu; + Grey : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Grey); + + -- ANCHOR(`menu_grey()',`Grey') + procedure Grey (Men : Menu; + Grey : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`menu_grey()',`Grey') + procedure Grey + (Men : Menu; + Grey : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + pragma Inline (Grey); + + -- ANCHOR(`set_menu_pad()',`Set_Pad_Character') + procedure Set_Pad_Character (Men : Menu; + Pad : Character := Space); + -- AKA + pragma Inline (Set_Pad_Character); + + -- ANCHOR(`menu_pad()',`Pad_Character') + procedure Pad_Character (Men : Menu; + Pad : out Character); + -- AKA + pragma Inline (Pad_Character); + + -- MANPAGE(`menu_spacing.3x') + + -- ANCHOR(`set_menu_spacing()',`Set_Spacing') + procedure Set_Spacing (Men : Menu; + Descr : Column_Position := 0; + Row : Line_Position := 0; + Col : Column_Position := 0); + -- AKA + pragma Inline (Set_Spacing); + + -- ANCHOR(`menu_spacing()',`Spacing') + procedure Spacing (Men : Menu; + Descr : out Column_Position; + Row : out Line_Position; + Col : out Column_Position); + -- AKA + pragma Inline (Spacing); + + -- MANPAGE(`menu_pattern.3x') + + -- ANCHOR(`set_menu_pattern()',`Set_Pattern') + function Set_Pattern (Men : Menu; + Text : String) return Boolean; + -- AKA + -- Return TRUE if the pattern matches, FALSE otherwise + pragma Inline (Set_Pattern); + + -- ANCHOR(`menu_pattern()',`Pattern') + procedure Pattern (Men : Menu; + Text : out String); + -- AKA + pragma Inline (Pattern); + + -- MANPAGE(`menu_format.3x') + + -- ANCHOR(`set_menu_format()',`Set_Format') + procedure Set_Format (Men : Menu; + Lines : Line_Count; + Columns : Column_Count); + -- Not implemented: 0 argument for Lines or Columns; + -- instead use Format to get the current sizes + -- The default format is 16 rows, 1 column. Calling + -- set_menu_format with a null menu pointer will change this + -- default. A zero row or column argument to set_menu_format + -- is interpreted as a request not to change the current + -- value. + -- AKA + pragma Inline (Set_Format); + + -- ANCHOR(`menu_format()',`Format') + procedure Format (Men : Menu; + Lines : out Line_Count; + Columns : out Column_Count); + -- AKA + pragma Inline (Format); + + -- MANPAGE(`menu_hook.3x') + + type Menu_Hook_Function is access procedure (Men : Menu); + pragma Convention (C, Menu_Hook_Function); + + -- ANCHOR(`set_item_init()',`Set_Item_Init_Hook') + procedure Set_Item_Init_Hook (Men : Menu; + Proc : Menu_Hook_Function); + -- AKA + pragma Inline (Set_Item_Init_Hook); + + -- ANCHOR(`set_item_term()',`Set_Item_Term_Hook') + procedure Set_Item_Term_Hook (Men : Menu; + Proc : Menu_Hook_Function); + -- AKA + pragma Inline (Set_Item_Term_Hook); + + -- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook') + procedure Set_Menu_Init_Hook (Men : Menu; + Proc : Menu_Hook_Function); + -- AKA + pragma Inline (Set_Menu_Init_Hook); + + -- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook') + procedure Set_Menu_Term_Hook (Men : Menu; + Proc : Menu_Hook_Function); + -- AKA + pragma Inline (Set_Menu_Term_Hook); + + -- ANCHOR(`item_init()',`Get_Item_Init_Hook') + function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + pragma Inline (Get_Item_Init_Hook); + + -- ANCHOR(`item_term()',`Get_Item_Term_Hook') + function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + pragma Inline (Get_Item_Term_Hook); + + -- ANCHOR(`menu_init()',`Get_Menu_Init_Hook') + function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + pragma Inline (Get_Menu_Init_Hook); + + -- ANCHOR(`menu_term()',`Get_Menu_Term_Hook') + function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + pragma Inline (Get_Menu_Term_Hook); + + -- MANPAGE(`menu_items.3x') + + -- ANCHOR(`set_menu_items()',`Redefine') + procedure Redefine (Men : Menu; + Items : Item_Array_Access); + -- AKA + pragma Inline (Redefine); + + procedure Set_Items (Men : Menu; + Items : Item_Array_Access) renames Redefine; + -- pragma Inline (Set_Items); + + -- ANCHOR(`menu_items()',`Items') + function Items (Men : Menu; + Index : Positive) return Item; + -- AKA + pragma Inline (Items); + + -- ANCHOR(`item_count()',`Item_Count') + function Item_Count (Men : Menu) return Natural; + -- AKA + pragma Inline (Item_Count); + + -- MANPAGE(`menu_new.3x') + + -- ANCHOR(`new_menu()',`Create') + function Create (Items : Item_Array_Access) return Menu; + -- AKA + -- Not inlined + + function New_Menu (Items : Item_Array_Access) return Menu renames Create; + + -- ANCHOR(`free_menu()',`Delete') + procedure Delete (Men : in out Menu); + -- AKA + -- Reset Men to Null_Menu + -- Not inlined + + -- MANPAGE(`menu_driver.3x') + + type Driver_Result is (Menu_Ok, + Request_Denied, + Unknown_Request, + No_Match); + + -- ANCHOR(`menu_driver()',`Driver') + function Driver (Men : Menu; + Key : Key_Code) return Driver_Result; + -- AKA + -- Driver is not inlined + + -- ANCHOR(`menu_requestname.3x') + -- Not Implemented: menu_request_name, menu_request_by_name +------------------------------------------------------------------------------- +private + type Item is new System.Storage_Elements.Integer_Address; + type Menu is new System.Storage_Elements.Integer_Address; + + Null_Item : constant Item := 0; + Null_Menu : constant Menu := 0; + +end Terminal_Interface.Curses.Menus; diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 new file mode 100644 index 00000000000..d61eb0c7953 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -0,0 +1,182 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-mouse__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Mouse -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.28 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +include(`Mouse_Base_Defs') +with System; + +package Terminal_Interface.Curses.Mouse is + pragma Preelaborate (Terminal_Interface.Curses.Mouse); + + -- MANPAGE(`curs_mouse.3x') + -- Please note, that in ncurses-1.9.9e documentation mouse support + -- is still marked as experimental. So also this binding will change + -- if the ncurses methods change. + -- + -- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates + -- in the parent package. + -- + -- Not implemented: + -- REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event + -- or Start_Mouse) + type Event_Mask is private; + No_Events : constant Event_Mask; + All_Events : constant Event_Mask; + + type Mouse_Button is (Left, -- aka: Button 1 + Middle, -- aka: Button 2 + Right, -- aka: Button 3 + Button4, -- aka: Button 4 + Control, -- Control Key + Shift, -- Shift Key + Alt); -- ALT Key + + subtype Real_Buttons is Mouse_Button range Left .. Button4; + subtype Modifier_Keys is Mouse_Button range Control .. Alt; + + type Button_State is (Released, + Pressed, + Clicked, + Double_Clicked, + Triple_Clicked); + + type Button_States is array (Button_State) of Boolean; + pragma Pack (Button_States); + + All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True, + others => False); + All_States : constant Button_States := (others => True); + + type Mouse_Event is private; + + -- MANPAGE(`curs_mouse.3x') + + function Has_Mouse return Boolean; + -- Return true if a mouse device is supported, false otherwise. + + procedure Register_Reportable_Event + (Button : Mouse_Button; + State : Button_State; + Mask : in out Event_Mask); + -- Stores the event described by the button and the state in the mask. + -- Before you call this the first time, you should init the mask + -- with the Empty_Mask constant + pragma Inline (Register_Reportable_Event); + + procedure Register_Reportable_Events + (Button : Mouse_Button; + State : Button_States; + Mask : in out Event_Mask); + -- Register all events described by the Button and the State bitmap. + -- Before you call this the first time, you should init the mask + -- with the Empty_Mask constant + + -- ANCHOR(`mousemask()',`Start_Mouse') + -- There is one difference to mousmask(): we return the value of the + -- old mask, that means the event mask value before this call. + -- Not Implemented: The library version + -- returns a Mouse_Mask that tells which events are reported. + function Start_Mouse (Mask : Event_Mask := All_Events) + return Event_Mask; + -- AKA + pragma Inline (Start_Mouse); + + procedure End_Mouse (Mask : Event_Mask := No_Events); + -- Terminates the mouse, restores the specified event mask + pragma Inline (End_Mouse); + + -- ANCHOR(`getmouse()',`Get_Mouse') + function Get_Mouse return Mouse_Event; + -- AKA + pragma Inline (Get_Mouse); + + procedure Get_Event (Event : Mouse_Event; + Y : out Line_Position; + X : out Column_Position; + Button : out Mouse_Button; + State : out Button_State); + -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they + -- may not be identical to window coordinates. + -- Not Implemented: Get_Event only reports one event, the C library + -- version supports multiple events, e.g. {click-1, click-3} + pragma Inline (Get_Event); + + -- ANCHOR(`ungetmouse()',`Unget_Mouse') + procedure Unget_Mouse (Event : Mouse_Event); + -- AKA + pragma Inline (Unget_Mouse); + + -- ANCHOR(`wenclose()',`Enclosed_In_Window') + function Enclosed_In_Window (Win : Window := Standard_Window; + Event : Mouse_Event) return Boolean; + -- AKA + -- But : use event instead of screen coordinates. + pragma Inline (Enclosed_In_Window); + + -- ANCHOR(`mouseinterval()',`Mouse_Interval') + function Mouse_Interval (Msec : Natural := 200) return Natural; + -- AKA + pragma Inline (Mouse_Interval); + +private + type Event_Mask is new Interfaces.C.unsigned_long; + + type Mouse_Event is + record + Id : Integer range Integer (Interfaces.C.short'First) .. + Integer (Interfaces.C.short'Last); + X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. + Integer (Interfaces.C.int'Last); + Bstate : Event_Mask; + end record; + pragma Convention (C, Mouse_Event); + +include(`Mouse_Event_Rep') + Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; + -- This constant may be different on your system. + +include(`Mouse_Events') + No_Events : constant Event_Mask := 0; + All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; + +end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 new file mode 100644 index 00000000000..03d8114fdff --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 @@ -0,0 +1,70 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-panels-user_data__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels.User_Data -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.15 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access all User; +package Terminal_Interface.Curses.Panels.User_Data is + pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data); + + -- MANPAGE(`panel.3x') + + -- ANCHOR(`set_panel_userptr',`Set_User_Data') + procedure Set_User_Data (Pan : Panel; + Data : User_Access); + -- AKA + pragma Inline (Set_User_Data); + + -- ANCHOR(`panel_userptr',`Get_User_Data') + procedure Get_User_Data (Pan : Panel; + Data : out User_Access); + -- AKA + + -- ANCHOR(`panel_userptr',`Get_User_Data') + function Get_User_Data (Pan : Panel) return User_Access; + -- AKA + -- Same as function + pragma Inline (Get_User_Data); + +end Terminal_Interface.Curses.Panels.User_Data; diff --git a/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/Ada95/gen/terminal_interface-curses-panels.ads.m4 new file mode 100644 index 00000000000..dc06fa42171 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-panels.ads.m4 @@ -0,0 +1,147 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-panels__ads.htm')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.20 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with System; + +package Terminal_Interface.Curses.Panels is + pragma Preelaborate (Terminal_Interface.Curses.Panels); +include(`Panel_Linker_Options')dnl +include(`Linker_Options') + type Panel is private; + + --------------------------- + -- Interface constants -- + --------------------------- + Null_Panel : constant Panel; + + ------------------- + -- Exceptions -- + ------------------- + + Panel_Exception : exception; + + -- MANPAGE(`panel.3x') + + -- ANCHOR(`new_panel()',`Create') + function Create (Win : Window) return Panel; + -- AKA + pragma Inline (Create); + + -- ANCHOR(`new_panel()',`New_Panel') + function New_Panel (Win : Window) return Panel renames Create; + -- AKA + -- pragma Inline (New_Panel); + + -- ANCHOR(`bottom_panel()',`Bottom') + procedure Bottom (Pan : Panel); + -- AKA + pragma Inline (Bottom); + + -- ANCHOR(`top_panel()',`Top') + procedure Top (Pan : Panel); + -- AKA + pragma Inline (Top); + + -- ANCHOR(`show_panel()',`Show') + procedure Show (Pan : Panel); + -- AKA + pragma Inline (Show); + + -- ANCHOR(`update_panels()',`Update_Panels') + procedure Update_Panels; + -- AKA + pragma Import (C, Update_Panels, "update_panels"); + + -- ANCHOR(`hide_panel()',`Hide') + procedure Hide (Pan : Panel); + -- AKA + pragma Inline (Hide); + + -- ANCHOR(`panel_window()',`Get_Window') + function Get_Window (Pan : Panel) return Window; + -- AKA + pragma Inline (Get_Window); + + -- ANCHOR(`panel_window()',`Panel_Window') + function Panel_Window (Pan : Panel) return Window renames Get_Window; + -- pragma Inline (Panel_Window); + + -- ANCHOR(`replace_panel()',`Replace') + procedure Replace (Pan : Panel; + Win : Window); + -- AKA + pragma Inline (Replace); + + -- ANCHOR(`move_panel()',`Move') + procedure Move (Pan : Panel; + Line : Line_Position; + Column : Column_Position); + -- AKA + pragma Inline (Move); + + -- ANCHOR(`panel_hidden()',`Is_Hidden') + function Is_Hidden (Pan : Panel) return Boolean; + -- AKA + pragma Inline (Is_Hidden); + + -- ANCHOR(`panel_above()',`Above') + function Above (Pan : Panel) return Panel; + -- AKA + pragma Import (C, Above, "panel_above"); + + -- ANCHOR(`panel_below()',`Below') + function Below (Pan : Panel) return Panel; + -- AKA + pragma Import (C, Below, "panel_below"); + + -- ANCHOR(`del_panel()',`Delete') + procedure Delete (Pan : in out Panel); + -- AKA + pragma Inline (Delete); + +private + type Panel is new System.Storage_Elements.Integer_Address; + Null_Panel : constant Panel := 0; + +end Terminal_Interface.Curses.Panels; diff --git a/Ada95/gen/terminal_interface-curses-trace.ads.m4 b/Ada95/gen/terminal_interface-curses-trace.ads.m4 new file mode 100644 index 00000000000..546004fd493 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-trace.ads.m4 @@ -0,0 +1,78 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-trace__ads.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Trace -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control: +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package Terminal_Interface.Curses.Trace is + pragma Preelaborate (Terminal_Interface.Curses.Trace); + + pragma Warnings (Off); +include(`Trace_Defs') + + pragma Warnings (On); + + Trace_Disable : constant Trace_Attribute_Set := (others => False); + + Trace_Ordinary : constant Trace_Attribute_Set := + (Times => True, + Tputs => True, + Update => True, + Cursor_Move => True, + Character_Output => True, + others => False); + Trace_Maximum : constant Trace_Attribute_Set := (others => True); + +------------------------------------------------------------------------------ + + -- MANPAGE(`curs_trace.3x') + + -- ANCHOR(`trace()',`Trace_on') + procedure Trace_On (x : Trace_Attribute_Set); + -- The debugging library has trace. + + -- ANCHOR(`_tracef()',`Trace_Put') + procedure Trace_Put (str : String); + -- AKA + + Current_Trace_Setting : Trace_Attribute_Set; + pragma Import (C, Current_Trace_Setting, "_nc_tracing"); + +end Terminal_Interface.Curses.Trace; diff --git a/Ada95/gen/terminal_interface-curses.adb.m4 b/Ada95/gen/terminal_interface-curses.adb.m4 new file mode 100644 index 00000000000..a77676cd3cc --- /dev/null +++ b/Ada95/gen/terminal_interface-curses.adb.m4 @@ -0,0 +1,2502 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses__adb.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.6 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with System; + +with Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Ada.Characters.Handling; use Ada.Characters.Handling; +with Ada.Strings.Fixed; + +package body Terminal_Interface.Curses is + + use Aux; + use type System.Bit_Order; + + package ASF renames Ada.Strings.Fixed; + + type chtype_array is array (size_t range <>) + of aliased Attributed_Character; + pragma Convention (C, chtype_array); + +------------------------------------------------------------------------------ + function Key_Name (Key : Real_Key_Code) return String + is + function Keyname (K : C_Int) return chars_ptr; + pragma Import (C, Keyname, "keyname"); + + Ch : Character; + begin + if Key <= Character'Pos (Character'Last) then + Ch := Character'Val (Key); + if Is_Control (Ch) then + return Un_Control (Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + elsif Is_Graphic (Ch) then + declare + S : String (1 .. 1); + begin + S (1) := Ch; + return S; + end; + else + return ""; + end if; + else + return Fill_String (Keyname (C_Int (Key))); + end if; + end Key_Name; + + procedure Key_Name (Key : Real_Key_Code; + Name : out String) + is + begin + ASF.Move (Key_Name (Key), Name); + end Key_Name; + +------------------------------------------------------------------------------ + procedure Init_Screen + is + function Initscr return Window; + pragma Import (C, Initscr, "initscr"); + + W : Window; + begin + W := Initscr; + if W = Null_Window then + raise Curses_Exception; + end if; + end Init_Screen; + + procedure End_Windows + is + function Endwin return C_Int; + pragma Import (C, Endwin, "endwin"); + begin + if Endwin = Curses_Err then + raise Curses_Exception; + end if; + end End_Windows; + + function Is_End_Window return Boolean + is + function Isendwin return Curses_Bool; + pragma Import (C, Isendwin, "isendwin"); + begin + if Isendwin = Curses_Bool_False then + return False; + else + return True; + end if; + end Is_End_Window; +------------------------------------------------------------------------------ + procedure Move_Cursor (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position) + is + function Wmove (Win : Window; + Line : C_Int; + Column : C_Int + ) return C_Int; + pragma Import (C, Wmove, "wmove"); + begin + if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Move_Cursor; +------------------------------------------------------------------------------ + procedure Add (Win : Window := Standard_Window; + Ch : Attributed_Character) + is + function Waddch (W : Window; + Ch : C_Chtype) return C_Int; + pragma Import (C, Waddch, "waddch"); + begin + if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add (Win : Window := Standard_Window; + Ch : Character) + is + begin + Add (Win, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add; + + procedure Add + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Ch : Attributed_Character) + is + function mvwaddch (W : Window; + Y : C_Int; + X : C_Int; + Ch : C_Chtype) return C_Int; + pragma Import (C, mvwaddch, "mvwaddch"); + begin + if mvwaddch (Win, C_Int (Line), + C_Int (Column), + AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Ch : Character) + is + begin + Add (Win, + Line, + Column, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add; + + procedure Add_With_Immediate_Echo + (Win : Window := Standard_Window; + Ch : Attributed_Character) + is + function Wechochar (W : Window; + Ch : C_Chtype) return C_Int; + pragma Import (C, Wechochar, "wechochar"); + begin + if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add_With_Immediate_Echo; + + procedure Add_With_Immediate_Echo + (Win : Window := Standard_Window; + Ch : Character) + is + begin + Add_With_Immediate_Echo + (Win, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add_With_Immediate_Echo; +------------------------------------------------------------------------------ + function Create (Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Newwin (Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Newwin, "newwin"); + + W : Window; + begin + W := Newwin (C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Create; + + procedure Delete (Win : in out Window) + is + function Wdelwin (W : Window) return C_Int; + pragma Import (C, Wdelwin, "delwin"); + begin + if Wdelwin (Win) = Curses_Err then + raise Curses_Exception; + end if; + Win := Null_Window; + end Delete; + + function Sub_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Subwin + (Win : Window; + Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Subwin, "subwin"); + + W : Window; + begin + W := Subwin (Win, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Sub_Window; + + function Derived_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Derwin + (Win : Window; + Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Derwin, "derwin"); + + W : Window; + begin + W := Derwin (Win, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Derived_Window; + + function Duplicate (Win : Window) return Window + is + function Dupwin (Win : Window) return Window; + pragma Import (C, Dupwin, "dupwin"); + + W : constant Window := Dupwin (Win); + begin + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Duplicate; + + procedure Move_Window (Win : Window; + Line : Line_Position; + Column : Column_Position) + is + function Mvwin (Win : Window; + Line : C_Int; + Column : C_Int) return C_Int; + pragma Import (C, Mvwin, "mvwin"); + begin + if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Move_Window; + + procedure Move_Derived_Window (Win : Window; + Line : Line_Position; + Column : Column_Position) + is + function Mvderwin (Win : Window; + Line : C_Int; + Column : C_Int) return C_Int; + pragma Import (C, Mvderwin, "mvderwin"); + begin + if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Move_Derived_Window; + + procedure Set_Synch_Mode (Win : Window := Standard_Window; + Mode : Boolean := False) + is + function Syncok (Win : Window; + Mode : Curses_Bool) return C_Int; + pragma Import (C, Syncok, "syncok"); + begin + if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Synch_Mode; +------------------------------------------------------------------------------ + procedure Add (Win : Window := Standard_Window; + Str : String; + Len : Integer := -1) + is + function Waddnstr (Win : Window; + Str : char_array; + Len : C_Int := -1) return C_Int; + pragma Import (C, Waddnstr, "waddnstr"); + + Txt : char_array (0 .. Str'Length); + Length : size_t; + begin + To_C (Str, Txt, Length); + if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : String; + Len : Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Add (Win, Str, Len); + end Add; +------------------------------------------------------------------------------ + procedure Add + (Win : Window := Standard_Window; + Str : Attributed_String; + Len : Integer := -1) + is + function Waddchnstr (Win : Window; + Str : chtype_array; + Len : C_Int := -1) return C_Int; + pragma Import (C, Waddchnstr, "waddchnstr"); + + Txt : chtype_array (0 .. Str'Length); + begin + for Length in 1 .. size_t (Str'Length) loop + Txt (Length - 1) := Str (Natural (Length)); + end loop; + Txt (Str'Length) := Default_Character; + if Waddchnstr (Win, + Txt, + C_Int (Len)) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : Attributed_String; + Len : Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Add (Win, Str, Len); + end Add; +------------------------------------------------------------------------------ + procedure Border + (Win : Window := Standard_Window; + Left_Side_Symbol : Attributed_Character := Default_Character; + Right_Side_Symbol : Attributed_Character := Default_Character; + Top_Side_Symbol : Attributed_Character := Default_Character; + Bottom_Side_Symbol : Attributed_Character := Default_Character; + Upper_Left_Corner_Symbol : Attributed_Character := Default_Character; + Upper_Right_Corner_Symbol : Attributed_Character := Default_Character; + Lower_Left_Corner_Symbol : Attributed_Character := Default_Character; + Lower_Right_Corner_Symbol : Attributed_Character := Default_Character) + is + function Wborder (W : Window; + LS : C_Chtype; + RS : C_Chtype; + TS : C_Chtype; + BS : C_Chtype; + ULC : C_Chtype; + URC : C_Chtype; + LLC : C_Chtype; + LRC : C_Chtype) return C_Int; + pragma Import (C, Wborder, "wborder"); + begin + if Wborder (Win, + AttrChar_To_Chtype (Left_Side_Symbol), + AttrChar_To_Chtype (Right_Side_Symbol), + AttrChar_To_Chtype (Top_Side_Symbol), + AttrChar_To_Chtype (Bottom_Side_Symbol), + AttrChar_To_Chtype (Upper_Left_Corner_Symbol), + AttrChar_To_Chtype (Upper_Right_Corner_Symbol), + AttrChar_To_Chtype (Lower_Left_Corner_Symbol), + AttrChar_To_Chtype (Lower_Right_Corner_Symbol) + ) = Curses_Err + then + raise Curses_Exception; + end if; + end Border; + + procedure Box + (Win : Window := Standard_Window; + Vertical_Symbol : Attributed_Character := Default_Character; + Horizontal_Symbol : Attributed_Character := Default_Character) + is + begin + Border (Win, + Vertical_Symbol, Vertical_Symbol, + Horizontal_Symbol, Horizontal_Symbol); + end Box; + + procedure Horizontal_Line + (Win : Window := Standard_Window; + Line_Size : Natural; + Line_Symbol : Attributed_Character := Default_Character) + is + function Whline (W : Window; + Ch : C_Chtype; + Len : C_Int) return C_Int; + pragma Import (C, Whline, "whline"); + begin + if Whline (Win, + AttrChar_To_Chtype (Line_Symbol), + C_Int (Line_Size)) = Curses_Err then + raise Curses_Exception; + end if; + end Horizontal_Line; + + procedure Vertical_Line + (Win : Window := Standard_Window; + Line_Size : Natural; + Line_Symbol : Attributed_Character := Default_Character) + is + function Wvline (W : Window; + Ch : C_Chtype; + Len : C_Int) return C_Int; + pragma Import (C, Wvline, "wvline"); + begin + if Wvline (Win, + AttrChar_To_Chtype (Line_Symbol), + C_Int (Line_Size)) = Curses_Err then + raise Curses_Exception; + end if; + end Vertical_Line; + +------------------------------------------------------------------------------ + function Get_Keystroke (Win : Window := Standard_Window) + return Real_Key_Code + is + function Wgetch (W : Window) return C_Int; + pragma Import (C, Wgetch, "wgetch"); + + C : constant C_Int := Wgetch (Win); + begin + if C = Curses_Err then + return Key_None; + else + return Real_Key_Code (C); + end if; + end Get_Keystroke; + + procedure Undo_Keystroke (Key : Real_Key_Code) + is + function Ungetch (Ch : C_Int) return C_Int; + pragma Import (C, Ungetch, "ungetch"); + begin + if Ungetch (C_Int (Key)) = Curses_Err then + raise Curses_Exception; + end if; + end Undo_Keystroke; + + function Has_Key (Key : Special_Key_Code) return Boolean + is + function Haskey (Key : C_Int) return C_Int; + pragma Import (C, Haskey, "has_key"); + begin + if Haskey (C_Int (Key)) = Curses_False then + return False; + else + return True; + end if; + end Has_Key; + + function Is_Function_Key (Key : Special_Key_Code) return Boolean + is + L : constant Special_Key_Code := Special_Key_Code (Natural (Key_F0) + + Natural (Function_Key_Number'Last)); + begin + if (Key >= Key_F0) and then (Key <= L) then + return True; + else + return False; + end if; + end Is_Function_Key; + + function Function_Key (Key : Real_Key_Code) + return Function_Key_Number + is + begin + if Is_Function_Key (Key) then + return Function_Key_Number (Key - Key_F0); + else + raise Constraint_Error; + end if; + end Function_Key; + + function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code + is + begin + return Real_Key_Code (Natural (Key_F0) + Natural (Key)); + end Function_Key_Code; +------------------------------------------------------------------------------ + procedure Standout (Win : Window := Standard_Window; + On : Boolean := True) + is + function wstandout (Win : Window) return C_Int; + pragma Import (C, wstandout, "wstandout"); + function wstandend (Win : Window) return C_Int; + pragma Import (C, wstandend, "wstandend"); + + Err : C_Int; + begin + if On then + Err := wstandout (Win); + else + Err := wstandend (Win); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Standout; + + procedure Switch_Character_Attribute + (Win : Window := Standard_Window; + Attr : Character_Attribute_Set := Normal_Video; + On : Boolean := True) + is + function Wattron (Win : Window; + C_Attr : C_AttrType) return C_Int; + pragma Import (C, Wattron, "wattr_on"); + function Wattroff (Win : Window; + C_Attr : C_AttrType) return C_Int; + pragma Import (C, Wattroff, "wattr_off"); + -- In Ada we use the On Boolean to control whether or not we want to + -- switch on or off the attributes in the set. + Err : C_Int; + AC : constant Attributed_Character := (Ch => Character'First, + Color => Color_Pair'First, + Attr => Attr); + begin + if On then + Err := Wattron (Win, AttrChar_To_AttrType (AC)); + else + Err := Wattroff (Win, AttrChar_To_AttrType (AC)); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Switch_Character_Attribute; + + procedure Set_Character_Attributes + (Win : Window := Standard_Window; + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Wattrset (Win : Window; + C_Attr : C_AttrType) return C_Int; + pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set + begin + if Wattrset (Win, + AttrChar_To_AttrType (Attributed_Character' + (Ch => Character'First, + Color => Color, + Attr => Attr))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Character_Attributes; + + function Get_Character_Attribute (Win : Window := Standard_Window) + return Character_Attribute_Set + is + function Wattrget (Win : Window; + Atr : access C_AttrType; + Col : access C_Short; + Opt : System.Address) return C_Int; + pragma Import (C, Wattrget, "wattr_get"); + + Attr : aliased C_AttrType; + Col : aliased C_Short; + Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access, + System.Null_Address); + Ch : Attributed_Character; + begin + if Res = Curses_Ok then + Ch := AttrType_To_AttrChar (Attr); + return Ch.Attr; + else + raise Curses_Exception; + end if; + end Get_Character_Attribute; + + function Get_Character_Attribute (Win : Window := Standard_Window) + return Color_Pair + is + function Wattrget (Win : Window; + Atr : access C_AttrType; + Col : access C_Short; + Opt : System.Address) return C_Int; + pragma Import (C, Wattrget, "wattr_get"); + + Attr : aliased C_AttrType; + Col : aliased C_Short; + Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access, + System.Null_Address); + Ch : Attributed_Character; + begin + if Res = Curses_Ok then + Ch := AttrType_To_AttrChar (Attr); + return Ch.Color; + else + raise Curses_Exception; + end if; + end Get_Character_Attribute; + + procedure Set_Color (Win : Window := Standard_Window; + Pair : Color_Pair) + is + function Wset_Color (Win : Window; + Color : C_Short; + Opts : C_Void_Ptr) return C_Int; + pragma Import (C, Wset_Color, "wcolor_set"); + begin + if Wset_Color (Win, + C_Short (Pair), + C_Void_Ptr (System.Null_Address)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Color; + + procedure Change_Attributes + (Win : Window := Standard_Window; + Count : Integer := -1; + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Wchgat (Win : Window; + Cnt : C_Int; + Attr : C_AttrType; + Color : C_Short; + Opts : System.Address := System.Null_Address) + return C_Int; + pragma Import (C, Wchgat, "wchgat"); + + Ch : constant Attributed_Character := + (Ch => Character'First, Color => Color_Pair'First, Attr => Attr); + begin + if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch), + C_Short (Color)) = Curses_Err then + raise Curses_Exception; + end if; + end Change_Attributes; + + procedure Change_Attributes + (Win : Window := Standard_Window; + Line : Line_Position := Line_Position'First; + Column : Column_Position := Column_Position'First; + Count : Integer := -1; + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + begin + Move_Cursor (Win, Line, Column); + Change_Attributes (Win, Count, Attr, Color); + end Change_Attributes; +------------------------------------------------------------------------------ + procedure Beep + is + function Beeper return C_Int; + pragma Import (C, Beeper, "beep"); + begin + if Beeper = Curses_Err then + raise Curses_Exception; + end if; + end Beep; + + procedure Flash_Screen + is + function Flash return C_Int; + pragma Import (C, Flash, "flash"); + begin + if Flash = Curses_Err then + raise Curses_Exception; + end if; + end Flash_Screen; +------------------------------------------------------------------------------ + procedure Set_Cbreak_Mode (SwitchOn : Boolean := True) + is + function Cbreak return C_Int; + pragma Import (C, Cbreak, "cbreak"); + function NoCbreak return C_Int; + pragma Import (C, NoCbreak, "nocbreak"); + + Err : C_Int; + begin + if SwitchOn then + Err := Cbreak; + else + Err := NoCbreak; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_Cbreak_Mode; + + procedure Set_Raw_Mode (SwitchOn : Boolean := True) + is + function Raw return C_Int; + pragma Import (C, Raw, "raw"); + function NoRaw return C_Int; + pragma Import (C, NoRaw, "noraw"); + + Err : C_Int; + begin + if SwitchOn then + Err := Raw; + else + Err := NoRaw; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_Raw_Mode; + + procedure Set_Echo_Mode (SwitchOn : Boolean := True) + is + function Echo return C_Int; + pragma Import (C, Echo, "echo"); + function NoEcho return C_Int; + pragma Import (C, NoEcho, "noecho"); + + Err : C_Int; + begin + if SwitchOn then + Err := Echo; + else + Err := NoEcho; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_Echo_Mode; + + procedure Set_Meta_Mode (Win : Window := Standard_Window; + SwitchOn : Boolean := True) + is + function Meta (W : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Meta, "meta"); + begin + if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Meta_Mode; + + procedure Set_KeyPad_Mode (Win : Window := Standard_Window; + SwitchOn : Boolean := True) + is + function Keypad (W : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Keypad, "keypad"); + begin + if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_KeyPad_Mode; + + function Get_KeyPad_Mode (Win : Window := Standard_Window) + return Boolean + is + function Is_Keypad (W : Window) return Curses_Bool; + pragma Import (C, Is_Keypad, "is_keypad"); + begin + return (Is_Keypad (Win) /= Curses_Bool_False); + end Get_KeyPad_Mode; + + procedure Half_Delay (Amount : Half_Delay_Amount) + is + function Halfdelay (Amount : C_Int) return C_Int; + pragma Import (C, Halfdelay, "halfdelay"); + begin + if Halfdelay (C_Int (Amount)) = Curses_Err then + raise Curses_Exception; + end if; + end Half_Delay; + + procedure Set_Flush_On_Interrupt_Mode + (Win : Window := Standard_Window; + Mode : Boolean := True) + is + function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Intrflush, "intrflush"); + begin + if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Flush_On_Interrupt_Mode; + + procedure Set_Queue_Interrupt_Mode + (Win : Window := Standard_Window; + Flush : Boolean := True) + is + procedure Qiflush; + pragma Import (C, Qiflush, "qiflush"); + procedure No_Qiflush; + pragma Import (C, No_Qiflush, "noqiflush"); + begin + if Win = Null_Window then + raise Curses_Exception; + end if; + if Flush then + Qiflush; + else + No_Qiflush; + end if; + end Set_Queue_Interrupt_Mode; + + procedure Set_NoDelay_Mode + (Win : Window := Standard_Window; + Mode : Boolean := False) + is + function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Nodelay, "nodelay"); + begin + if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_NoDelay_Mode; + + procedure Set_Timeout_Mode (Win : Window := Standard_Window; + Mode : Timeout_Mode; + Amount : Natural) + is + procedure Wtimeout (Win : Window; Amount : C_Int); + pragma Import (C, Wtimeout, "wtimeout"); + + Time : C_Int; + begin + case Mode is + when Blocking => Time := -1; + when Non_Blocking => Time := 0; + when Delayed => + if Amount = 0 then + raise Constraint_Error; + end if; + Time := C_Int (Amount); + end case; + Wtimeout (Win, Time); + end Set_Timeout_Mode; + + procedure Set_Escape_Timer_Mode + (Win : Window := Standard_Window; + Timer_Off : Boolean := False) + is + function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Notimeout, "notimeout"); + begin + if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off))) + = Curses_Err then + raise Curses_Exception; + end if; + end Set_Escape_Timer_Mode; + +------------------------------------------------------------------------------ + procedure Set_NL_Mode (SwitchOn : Boolean := True) + is + function NL return C_Int; + pragma Import (C, NL, "nl"); + function NoNL return C_Int; + pragma Import (C, NoNL, "nonl"); + + Err : C_Int; + begin + if SwitchOn then + Err := NL; + else + Err := NoNL; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_NL_Mode; + + procedure Clear_On_Next_Update + (Win : Window := Standard_Window; + Do_Clear : Boolean := True) + is + function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int; + pragma Import (C, Clear_Ok, "clearok"); + begin + if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then + raise Curses_Exception; + end if; + end Clear_On_Next_Update; + + procedure Use_Insert_Delete_Line + (Win : Window := Standard_Window; + Do_Idl : Boolean := True) + is + function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int; + pragma Import (C, IDL_Ok, "idlok"); + begin + if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then + raise Curses_Exception; + end if; + end Use_Insert_Delete_Line; + + procedure Use_Insert_Delete_Character + (Win : Window := Standard_Window; + Do_Idc : Boolean := True) + is + procedure IDC_Ok (W : Window; Flag : Curses_Bool); + pragma Import (C, IDC_Ok, "idcok"); + begin + IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))); + end Use_Insert_Delete_Character; + + procedure Leave_Cursor_After_Update + (Win : Window := Standard_Window; + Do_Leave : Boolean := True) + is + function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int; + pragma Import (C, Leave_Ok, "leaveok"); + begin + if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then + raise Curses_Exception; + end if; + end Leave_Cursor_After_Update; + + procedure Immediate_Update_Mode + (Win : Window := Standard_Window; + Mode : Boolean := False) + is + procedure Immedok (Win : Window; Mode : Curses_Bool); + pragma Import (C, Immedok, "immedok"); + begin + Immedok (Win, Curses_Bool (Boolean'Pos (Mode))); + end Immediate_Update_Mode; + + procedure Allow_Scrolling + (Win : Window := Standard_Window; + Mode : Boolean := False) + is + function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int; + pragma Import (C, Scrollok, "scrollok"); + begin + if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then + raise Curses_Exception; + end if; + end Allow_Scrolling; + + function Scrolling_Allowed (Win : Window := Standard_Window) + return Boolean + is + function Is_Scroll_Ok (W : Window) return Curses_Bool; + pragma Import (C, Is_Scroll_Ok, "is_scrollok"); + begin + return (Is_Scroll_Ok (Win) /= Curses_Bool_False); + end Scrolling_Allowed; + + procedure Set_Scroll_Region + (Win : Window := Standard_Window; + Top_Line : Line_Position; + Bottom_Line : Line_Position) + is + function Wsetscrreg (Win : Window; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Wsetscrreg, "wsetscrreg"); + begin + if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line)) + = Curses_Err then + raise Curses_Exception; + end if; + end Set_Scroll_Region; +------------------------------------------------------------------------------ + procedure Update_Screen + is + function Do_Update return C_Int; + pragma Import (C, Do_Update, "doupdate"); + begin + if Do_Update = Curses_Err then + raise Curses_Exception; + end if; + end Update_Screen; + + procedure Refresh (Win : Window := Standard_Window) + is + function Wrefresh (W : Window) return C_Int; + pragma Import (C, Wrefresh, "wrefresh"); + begin + if Wrefresh (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh; + + procedure Refresh_Without_Update + (Win : Window := Standard_Window) + is + function Wnoutrefresh (W : Window) return C_Int; + pragma Import (C, Wnoutrefresh, "wnoutrefresh"); + begin + if Wnoutrefresh (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Without_Update; + + procedure Redraw (Win : Window := Standard_Window) + is + function Redrawwin (Win : Window) return C_Int; + pragma Import (C, Redrawwin, "redrawwin"); + begin + if Redrawwin (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Redraw; + + procedure Redraw + (Win : Window := Standard_Window; + Begin_Line : Line_Position; + Line_Count : Positive) + is + function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int) + return C_Int; + pragma Import (C, Wredrawln, "wredrawln"); + begin + if Wredrawln (Win, + C_Int (Begin_Line), + C_Int (Line_Count)) = Curses_Err then + raise Curses_Exception; + end if; + end Redraw; + +------------------------------------------------------------------------------ + procedure Erase (Win : Window := Standard_Window) + is + function Werase (W : Window) return C_Int; + pragma Import (C, Werase, "werase"); + begin + if Werase (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Erase; + + procedure Clear (Win : Window := Standard_Window) + is + function Wclear (W : Window) return C_Int; + pragma Import (C, Wclear, "wclear"); + begin + if Wclear (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Clear; + + procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window) + is + function Wclearbot (W : Window) return C_Int; + pragma Import (C, Wclearbot, "wclrtobot"); + begin + if Wclearbot (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Clear_To_End_Of_Screen; + + procedure Clear_To_End_Of_Line (Win : Window := Standard_Window) + is + function Wcleareol (W : Window) return C_Int; + pragma Import (C, Wcleareol, "wclrtoeol"); + begin + if Wcleareol (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Clear_To_End_Of_Line; +------------------------------------------------------------------------------ + procedure Set_Background + (Win : Window := Standard_Window; + Ch : Attributed_Character) + is + procedure WBackground (W : Window; Ch : C_Chtype); + pragma Import (C, WBackground, "wbkgdset"); + begin + WBackground (Win, AttrChar_To_Chtype (Ch)); + end Set_Background; + + procedure Change_Background + (Win : Window := Standard_Window; + Ch : Attributed_Character) + is + function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int; + pragma Import (C, WChangeBkgd, "wbkgd"); + begin + if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Change_Background; + + function Get_Background (Win : Window := Standard_Window) + return Attributed_Character + is + function Wgetbkgd (Win : Window) return C_Chtype; + pragma Import (C, Wgetbkgd, "getbkgd"); + begin + return Chtype_To_AttrChar (Wgetbkgd (Win)); + end Get_Background; +------------------------------------------------------------------------------ + procedure Change_Lines_Status (Win : Window := Standard_Window; + Start : Line_Position; + Count : Positive; + State : Boolean) + is + function Wtouchln (Win : Window; + Sta : C_Int; + Cnt : C_Int; + Chg : C_Int) return C_Int; + pragma Import (C, Wtouchln, "wtouchln"); + begin + if Wtouchln (Win, C_Int (Start), C_Int (Count), + C_Int (Boolean'Pos (State))) = Curses_Err then + raise Curses_Exception; + end if; + end Change_Lines_Status; + + procedure Touch (Win : Window := Standard_Window) + is + Y : Line_Position; + X : Column_Position; + begin + Get_Size (Win, Y, X); + Change_Lines_Status (Win, 0, Positive (Y), True); + end Touch; + + procedure Untouch (Win : Window := Standard_Window) + is + Y : Line_Position; + X : Column_Position; + begin + Get_Size (Win, Y, X); + Change_Lines_Status (Win, 0, Positive (Y), False); + end Untouch; + + procedure Touch (Win : Window := Standard_Window; + Start : Line_Position; + Count : Positive) + is + begin + Change_Lines_Status (Win, Start, Count, True); + end Touch; + + function Is_Touched + (Win : Window := Standard_Window; + Line : Line_Position) return Boolean + is + function WLineTouched (W : Window; L : C_Int) return Curses_Bool; + pragma Import (C, WLineTouched, "is_linetouched"); + begin + if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then + return False; + else + return True; + end if; + end Is_Touched; + + function Is_Touched + (Win : Window := Standard_Window) return Boolean + is + function WWinTouched (W : Window) return Curses_Bool; + pragma Import (C, WWinTouched, "is_wintouched"); + begin + if WWinTouched (Win) = Curses_Bool_False then + return False; + else + return True; + end if; + end Is_Touched; +------------------------------------------------------------------------------ + procedure Copy + (Source_Window : Window; + Destination_Window : Window; + Source_Top_Row : Line_Position; + Source_Left_Column : Column_Position; + Destination_Top_Row : Line_Position; + Destination_Left_Column : Column_Position; + Destination_Bottom_Row : Line_Position; + Destination_Right_Column : Column_Position; + Non_Destructive_Mode : Boolean := True) + is + function Copywin (Src : Window; + Dst : Window; + Str : C_Int; + Slc : C_Int; + Dtr : C_Int; + Dlc : C_Int; + Dbr : C_Int; + Drc : C_Int; + Ndm : C_Int) return C_Int; + pragma Import (C, Copywin, "copywin"); + begin + if Copywin (Source_Window, + Destination_Window, + C_Int (Source_Top_Row), + C_Int (Source_Left_Column), + C_Int (Destination_Top_Row), + C_Int (Destination_Left_Column), + C_Int (Destination_Bottom_Row), + C_Int (Destination_Right_Column), + Boolean'Pos (Non_Destructive_Mode) + ) = Curses_Err then + raise Curses_Exception; + end if; + end Copy; + + procedure Overwrite + (Source_Window : Window; + Destination_Window : Window) + is + function Overwrite (Src : Window; Dst : Window) return C_Int; + pragma Import (C, Overwrite, "overwrite"); + begin + if Overwrite (Source_Window, Destination_Window) = Curses_Err then + raise Curses_Exception; + end if; + end Overwrite; + + procedure Overlay + (Source_Window : Window; + Destination_Window : Window) + is + function Overlay (Src : Window; Dst : Window) return C_Int; + pragma Import (C, Overlay, "overlay"); + begin + if Overlay (Source_Window, Destination_Window) = Curses_Err then + raise Curses_Exception; + end if; + end Overlay; + +------------------------------------------------------------------------------ + procedure Insert_Delete_Lines + (Win : Window := Standard_Window; + Lines : Integer := 1) -- default is to insert one line above + is + function Winsdelln (W : Window; N : C_Int) return C_Int; + pragma Import (C, Winsdelln, "winsdelln"); + begin + if Winsdelln (Win, C_Int (Lines)) = Curses_Err then + raise Curses_Exception; + end if; + end Insert_Delete_Lines; + + procedure Delete_Line (Win : Window := Standard_Window) + is + begin + Insert_Delete_Lines (Win, -1); + end Delete_Line; + + procedure Insert_Line (Win : Window := Standard_Window) + is + begin + Insert_Delete_Lines (Win, 1); + end Insert_Line; +------------------------------------------------------------------------------ + + procedure Get_Size + (Win : Window := Standard_Window; + Number_Of_Lines : out Line_Count; + Number_Of_Columns : out Column_Count) + is + function GetMaxY (W : Window) return C_Int; + pragma Import (C, GetMaxY, "getmaxy"); + + function GetMaxX (W : Window) return C_Int; + pragma Import (C, GetMaxX, "getmaxx"); + + Y : constant C_Int := GetMaxY (Win) + + C_Int (Offset_XY); + X : constant C_Int := GetMaxX (Win) + + C_Int (Offset_XY); + begin + Number_Of_Lines := Line_Count (Y); + Number_Of_Columns := Column_Count (X); + end Get_Size; + + procedure Get_Window_Position + (Win : Window := Standard_Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position) + is + function GetBegY (W : Window) return C_Int; + pragma Import (C, GetBegY, "getbegy"); + + function GetBegX (W : Window) return C_Int; + pragma Import (C, GetBegX, "getbegx"); + + Y : constant C_Short := C_Short (GetBegY (Win)); + X : constant C_Short := C_Short (GetBegX (Win)); + begin + Top_Left_Line := Line_Position (Y); + Top_Left_Column := Column_Position (X); + end Get_Window_Position; + + procedure Get_Cursor_Position + (Win : Window := Standard_Window; + Line : out Line_Position; + Column : out Column_Position) + is + function GetCurY (W : Window) return C_Int; + pragma Import (C, GetCurY, "getcury"); + + function GetCurX (W : Window) return C_Int; + pragma Import (C, GetCurX, "getcurx"); + + Y : constant C_Short := C_Short (GetCurY (Win)); + X : constant C_Short := C_Short (GetCurX (Win)); + begin + Line := Line_Position (Y); + Column := Column_Position (X); + end Get_Cursor_Position; + + procedure Get_Origin_Relative_To_Parent + (Win : Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position; + Is_Not_A_Subwindow : out Boolean) + is + function GetParY (W : Window) return C_Int; + pragma Import (C, GetParY, "getpary"); + + function GetParX (W : Window) return C_Int; + pragma Import (C, GetParX, "getparx"); + + Y : constant C_Int := GetParY (Win); + X : constant C_Int := GetParX (Win); + begin + if Y = -1 then + Top_Left_Line := Line_Position'Last; + Top_Left_Column := Column_Position'Last; + Is_Not_A_Subwindow := True; + else + Top_Left_Line := Line_Position (Y); + Top_Left_Column := Column_Position (X); + Is_Not_A_Subwindow := False; + end if; + end Get_Origin_Relative_To_Parent; +------------------------------------------------------------------------------ + function New_Pad (Lines : Line_Count; + Columns : Column_Count) return Window + is + function Newpad (Lines : C_Int; Columns : C_Int) return Window; + pragma Import (C, Newpad, "newpad"); + + W : Window; + begin + W := Newpad (C_Int (Lines), C_Int (Columns)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end New_Pad; + + function Sub_Pad + (Pad : Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Subpad + (Pad : Window; + Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Subpad, "subpad"); + + W : Window; + begin + W := Subpad (Pad, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Sub_Pad; + + procedure Refresh + (Pad : Window; + Source_Top_Row : Line_Position; + Source_Left_Column : Column_Position; + Destination_Top_Row : Line_Position; + Destination_Left_Column : Column_Position; + Destination_Bottom_Row : Line_Position; + Destination_Right_Column : Column_Position) + is + function Prefresh + (Pad : Window; + Source_Top_Row : C_Int; + Source_Left_Column : C_Int; + Destination_Top_Row : C_Int; + Destination_Left_Column : C_Int; + Destination_Bottom_Row : C_Int; + Destination_Right_Column : C_Int) return C_Int; + pragma Import (C, Prefresh, "prefresh"); + begin + if Prefresh (Pad, + C_Int (Source_Top_Row), + C_Int (Source_Left_Column), + C_Int (Destination_Top_Row), + C_Int (Destination_Left_Column), + C_Int (Destination_Bottom_Row), + C_Int (Destination_Right_Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh; + + procedure Refresh_Without_Update + (Pad : Window; + Source_Top_Row : Line_Position; + Source_Left_Column : Column_Position; + Destination_Top_Row : Line_Position; + Destination_Left_Column : Column_Position; + Destination_Bottom_Row : Line_Position; + Destination_Right_Column : Column_Position) + is + function Pnoutrefresh + (Pad : Window; + Source_Top_Row : C_Int; + Source_Left_Column : C_Int; + Destination_Top_Row : C_Int; + Destination_Left_Column : C_Int; + Destination_Bottom_Row : C_Int; + Destination_Right_Column : C_Int) return C_Int; + pragma Import (C, Pnoutrefresh, "pnoutrefresh"); + begin + if Pnoutrefresh (Pad, + C_Int (Source_Top_Row), + C_Int (Source_Left_Column), + C_Int (Destination_Top_Row), + C_Int (Destination_Left_Column), + C_Int (Destination_Bottom_Row), + C_Int (Destination_Right_Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Without_Update; + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : Window; + Ch : Attributed_Character) + is + function Pechochar (Pad : Window; Ch : C_Chtype) + return C_Int; + pragma Import (C, Pechochar, "pechochar"); + begin + if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add_Character_To_Pad_And_Echo_It; + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : Window; + Ch : Character) + is + begin + Add_Character_To_Pad_And_Echo_It + (Pad, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add_Character_To_Pad_And_Echo_It; +------------------------------------------------------------------------------ + procedure Scroll (Win : Window := Standard_Window; + Amount : Integer := 1) + is + function Wscrl (Win : Window; N : C_Int) return C_Int; + pragma Import (C, Wscrl, "wscrl"); + + begin + if Wscrl (Win, C_Int (Amount)) = Curses_Err then + raise Curses_Exception; + end if; + end Scroll; + +------------------------------------------------------------------------------ + procedure Delete_Character (Win : Window := Standard_Window) + is + function Wdelch (Win : Window) return C_Int; + pragma Import (C, Wdelch, "wdelch"); + begin + if Wdelch (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Delete_Character; + + procedure Delete_Character + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position) + is + function Mvwdelch (Win : Window; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Mvwdelch, "mvwdelch"); + begin + if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Delete_Character; +------------------------------------------------------------------------------ + function Peek (Win : Window := Standard_Window) + return Attributed_Character + is + function Winch (Win : Window) return C_Chtype; + pragma Import (C, Winch, "winch"); + begin + return Chtype_To_AttrChar (Winch (Win)); + end Peek; + + function Peek + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position) return Attributed_Character + is + function Mvwinch (Win : Window; + Lin : C_Int; + Col : C_Int) return C_Chtype; + pragma Import (C, Mvwinch, "mvwinch"); + begin + return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column))); + end Peek; +------------------------------------------------------------------------------ + procedure Insert (Win : Window := Standard_Window; + Ch : Attributed_Character) + is + function Winsch (Win : Window; Ch : C_Chtype) return C_Int; + pragma Import (C, Winsch, "winsch"); + begin + if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Insert; + + procedure Insert + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Ch : Attributed_Character) + is + function Mvwinsch (Win : Window; + Lin : C_Int; + Col : C_Int; + Ch : C_Chtype) return C_Int; + pragma Import (C, Mvwinsch, "mvwinsch"); + begin + if Mvwinsch (Win, + C_Int (Line), + C_Int (Column), + AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Insert; +------------------------------------------------------------------------------ + procedure Insert (Win : Window := Standard_Window; + Str : String; + Len : Integer := -1) + is + function Winsnstr (Win : Window; + Str : char_array; + Len : Integer := -1) return C_Int; + pragma Import (C, Winsnstr, "winsnstr"); + + Txt : char_array (0 .. Str'Length); + Length : size_t; + begin + To_C (Str, Txt, Length); + if Winsnstr (Win, Txt, Len) = Curses_Err then + raise Curses_Exception; + end if; + end Insert; + + procedure Insert + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : String; + Len : Integer := -1) + is + function Mvwinsnstr (Win : Window; + Line : C_Int; + Column : C_Int; + Str : char_array; + Len : C_Int) return C_Int; + pragma Import (C, Mvwinsnstr, "mvwinsnstr"); + + Txt : char_array (0 .. Str'Length); + Length : size_t; + begin + To_C (Str, Txt, Length); + if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len)) + = Curses_Err then + raise Curses_Exception; + end if; + end Insert; +------------------------------------------------------------------------------ + procedure Peek (Win : Window := Standard_Window; + Str : out String; + Len : Integer := -1) + is + function Winnstr (Win : Window; + Str : char_array; + Len : C_Int) return C_Int; + pragma Import (C, Winnstr, "winnstr"); + + N : Integer := Len; + Txt : char_array (0 .. Str'Length); + Cnt : Natural; + begin + if N < 0 then + N := Str'Length; + end if; + if N > Str'Length then + raise Constraint_Error; + end if; + Txt (0) := Interfaces.C.char'First; + if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + To_Ada (Txt, Str, Cnt, True); + if Cnt < Str'Length then + Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); + end if; + end Peek; + + procedure Peek + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : out String; + Len : Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Peek (Win, Str, Len); + end Peek; +------------------------------------------------------------------------------ + procedure Peek + (Win : Window := Standard_Window; + Str : out Attributed_String; + Len : Integer := -1) + is + function Winchnstr (Win : Window; + Str : chtype_array; -- out + Len : C_Int) return C_Int; + pragma Import (C, Winchnstr, "winchnstr"); + + N : Integer := Len; + Txt : constant chtype_array (0 .. Str'Length) + := (0 => Default_Character); + Cnt : Natural := 0; + begin + if N < 0 then + N := Str'Length; + end if; + if N > Str'Length then + raise Constraint_Error; + end if; + if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + for To in Str'Range loop + exit when Txt (size_t (Cnt)) = Default_Character; + Str (To) := Txt (size_t (Cnt)); + Cnt := Cnt + 1; + end loop; + if Cnt < Str'Length then + Str ((Str'First + Cnt) .. Str'Last) := + (others => (Ch => ' ', + Color => Color_Pair'First, + Attr => Normal_Video)); + end if; + end Peek; + + procedure Peek + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : out Attributed_String; + Len : Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Peek (Win, Str, Len); + end Peek; +------------------------------------------------------------------------------ + procedure Get (Win : Window := Standard_Window; + Str : out String; + Len : Integer := -1) + is + function Wgetnstr (Win : Window; + Str : char_array; + Len : C_Int) return C_Int; + pragma Import (C, Wgetnstr, "wgetnstr"); + + N : Integer := Len; + Txt : char_array (0 .. Str'Length); + Cnt : Natural; + begin + if N < 0 then + N := Str'Length; + end if; + if N > Str'Length then + raise Constraint_Error; + end if; + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + To_Ada (Txt, Str, Cnt, True); + if Cnt < Str'Length then + Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); + end if; + end Get; + + procedure Get + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : out String; + Len : Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Get (Win, Str, Len); + end Get; +------------------------------------------------------------------------------ + procedure Init_Soft_Label_Keys + (Format : Soft_Label_Key_Format := Three_Two_Three) + is + function Slk_Init (Fmt : C_Int) return C_Int; + pragma Import (C, Slk_Init, "slk_init"); + begin + if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then + raise Curses_Exception; + end if; + end Init_Soft_Label_Keys; + + procedure Set_Soft_Label_Key (Label : Label_Number; + Text : String; + Fmt : Label_Justification := Left) + is + function Slk_Set (Label : C_Int; + Txt : char_array; + Fmt : C_Int) return C_Int; + pragma Import (C, Slk_Set, "slk_set"); + + Txt : char_array (0 .. Text'Length); + Len : size_t; + begin + To_C (Text, Txt, Len); + if Slk_Set (C_Int (Label), Txt, + C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Soft_Label_Key; + + procedure Refresh_Soft_Label_Keys + is + function Slk_Refresh return C_Int; + pragma Import (C, Slk_Refresh, "slk_refresh"); + begin + if Slk_Refresh = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Soft_Label_Keys; + + procedure Refresh_Soft_Label_Keys_Without_Update + is + function Slk_Noutrefresh return C_Int; + pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh"); + begin + if Slk_Noutrefresh = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Soft_Label_Keys_Without_Update; + + procedure Get_Soft_Label_Key (Label : Label_Number; + Text : out String) + is + function Slk_Label (Label : C_Int) return chars_ptr; + pragma Import (C, Slk_Label, "slk_label"); + begin + Fill_String (Slk_Label (C_Int (Label)), Text); + end Get_Soft_Label_Key; + + function Get_Soft_Label_Key (Label : Label_Number) return String + is + function Slk_Label (Label : C_Int) return chars_ptr; + pragma Import (C, Slk_Label, "slk_label"); + begin + return Fill_String (Slk_Label (C_Int (Label))); + end Get_Soft_Label_Key; + + procedure Clear_Soft_Label_Keys + is + function Slk_Clear return C_Int; + pragma Import (C, Slk_Clear, "slk_clear"); + begin + if Slk_Clear = Curses_Err then + raise Curses_Exception; + end if; + end Clear_Soft_Label_Keys; + + procedure Restore_Soft_Label_Keys + is + function Slk_Restore return C_Int; + pragma Import (C, Slk_Restore, "slk_restore"); + begin + if Slk_Restore = Curses_Err then + raise Curses_Exception; + end if; + end Restore_Soft_Label_Keys; + + procedure Touch_Soft_Label_Keys + is + function Slk_Touch return C_Int; + pragma Import (C, Slk_Touch, "slk_touch"); + begin + if Slk_Touch = Curses_Err then + raise Curses_Exception; + end if; + end Touch_Soft_Label_Keys; + + procedure Switch_Soft_Label_Key_Attributes + (Attr : Character_Attribute_Set; + On : Boolean := True) + is + function Slk_Attron (Ch : C_Chtype) return C_Int; + pragma Import (C, Slk_Attron, "slk_attron"); + function Slk_Attroff (Ch : C_Chtype) return C_Int; + pragma Import (C, Slk_Attroff, "slk_attroff"); + + Err : C_Int; + Ch : constant Attributed_Character := (Ch => Character'First, + Attr => Attr, + Color => Color_Pair'First); + begin + if On then + Err := Slk_Attron (AttrChar_To_Chtype (Ch)); + else + Err := Slk_Attroff (AttrChar_To_Chtype (Ch)); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Switch_Soft_Label_Key_Attributes; + + procedure Set_Soft_Label_Key_Attributes + (Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Slk_Attrset (Ch : C_Chtype) return C_Int; + pragma Import (C, Slk_Attrset, "slk_attrset"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Attr => Attr, + Color => Color); + begin + if Slk_Attrset (AttrChar_To_Chtype (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Soft_Label_Key_Attributes; + + function Get_Soft_Label_Key_Attributes return Character_Attribute_Set + is + function Slk_Attr return C_Chtype; + pragma Import (C, Slk_Attr, "slk_attr"); + + Attr : constant C_Chtype := Slk_Attr; + begin + return Chtype_To_AttrChar (Attr).Attr; + end Get_Soft_Label_Key_Attributes; + + function Get_Soft_Label_Key_Attributes return Color_Pair + is + function Slk_Attr return C_Chtype; + pragma Import (C, Slk_Attr, "slk_attr"); + + Attr : constant C_Chtype := Slk_Attr; + begin + return Chtype_To_AttrChar (Attr).Color; + end Get_Soft_Label_Key_Attributes; + + procedure Set_Soft_Label_Key_Color (Pair : Color_Pair) + is + function Slk_Color (Color : C_Short) return C_Int; + pragma Import (C, Slk_Color, "slk_color"); + begin + if Slk_Color (C_Short (Pair)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Soft_Label_Key_Color; + +------------------------------------------------------------------------------ + procedure Enable_Key (Key : Special_Key_Code; + Enable : Boolean := True) + is + function Keyok (Keycode : C_Int; + On_Off : Curses_Bool) return C_Int; + pragma Import (C, Keyok, "keyok"); + begin + if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable))) + = Curses_Err then + raise Curses_Exception; + end if; + end Enable_Key; +------------------------------------------------------------------------------ + procedure Define_Key (Definition : String; + Key : Special_Key_Code) + is + function Defkey (Def : char_array; + Key : C_Int) return C_Int; + pragma Import (C, Defkey, "define_key"); + + Txt : char_array (0 .. Definition'Length); + Length : size_t; + begin + To_C (Definition, Txt, Length); + if Defkey (Txt, C_Int (Key)) = Curses_Err then + raise Curses_Exception; + end if; + end Define_Key; +------------------------------------------------------------------------------ + procedure Un_Control (Ch : Attributed_Character; + Str : out String) + is + function Unctrl (Ch : C_Chtype) return chars_ptr; + pragma Import (C, Unctrl, "unctrl"); + begin + Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str); + end Un_Control; + + function Un_Control (Ch : Attributed_Character) return String + is + function Unctrl (Ch : C_Chtype) return chars_ptr; + pragma Import (C, Unctrl, "unctrl"); + begin + return Fill_String (Unctrl (AttrChar_To_Chtype (Ch))); + end Un_Control; + + procedure Delay_Output (Msecs : Natural) + is + function Delayoutput (Msecs : C_Int) return C_Int; + pragma Import (C, Delayoutput, "delay_output"); + begin + if Delayoutput (C_Int (Msecs)) = Curses_Err then + raise Curses_Exception; + end if; + end Delay_Output; + + procedure Flush_Input + is + function Flushinp return C_Int; + pragma Import (C, Flushinp, "flushinp"); + begin + if Flushinp = Curses_Err then -- docu says that never happens, but... + raise Curses_Exception; + end if; + end Flush_Input; +------------------------------------------------------------------------------ + function Baudrate return Natural + is + function Baud return C_Int; + pragma Import (C, Baud, "baudrate"); + begin + return Natural (Baud); + end Baudrate; + + function Erase_Character return Character + is + function Erasechar return C_Int; + pragma Import (C, Erasechar, "erasechar"); + begin + return Character'Val (Erasechar); + end Erase_Character; + + function Kill_Character return Character + is + function Killchar return C_Int; + pragma Import (C, Killchar, "killchar"); + begin + return Character'Val (Killchar); + end Kill_Character; + + function Has_Insert_Character return Boolean + is + function Has_Ic return Curses_Bool; + pragma Import (C, Has_Ic, "has_ic"); + begin + if Has_Ic = Curses_Bool_False then + return False; + else + return True; + end if; + end Has_Insert_Character; + + function Has_Insert_Line return Boolean + is + function Has_Il return Curses_Bool; + pragma Import (C, Has_Il, "has_il"); + begin + if Has_Il = Curses_Bool_False then + return False; + else + return True; + end if; + end Has_Insert_Line; + + function Supported_Attributes return Character_Attribute_Set + is + function Termattrs return C_Chtype; + pragma Import (C, Termattrs, "termattrs"); + + Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs); + begin + return Ch.Attr; + end Supported_Attributes; + + procedure Long_Name (Name : out String) + is + function Longname return chars_ptr; + pragma Import (C, Longname, "longname"); + begin + Fill_String (Longname, Name); + end Long_Name; + + function Long_Name return String + is + function Longname return chars_ptr; + pragma Import (C, Longname, "longname"); + begin + return Fill_String (Longname); + end Long_Name; + + procedure Terminal_Name (Name : out String) + is + function Termname return chars_ptr; + pragma Import (C, Termname, "termname"); + begin + Fill_String (Termname, Name); + end Terminal_Name; + + function Terminal_Name return String + is + function Termname return chars_ptr; + pragma Import (C, Termname, "termname"); + begin + return Fill_String (Termname); + end Terminal_Name; +------------------------------------------------------------------------------ + procedure Init_Pair (Pair : Redefinable_Color_Pair; + Fore : Color_Number; + Back : Color_Number) + is + function Initpair (Pair : C_Short; + Fore : C_Short; + Back : C_Short) return C_Int; + pragma Import (C, Initpair, "init_pair"); + begin + if Integer (Pair) >= Number_Of_Color_Pairs then + raise Constraint_Error; + end if; + if Integer (Fore) >= Number_Of_Colors or else + Integer (Back) >= Number_Of_Colors then + raise Constraint_Error; + end if; + if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back)) + = Curses_Err then + raise Curses_Exception; + end if; + end Init_Pair; + + procedure Pair_Content (Pair : Color_Pair; + Fore : out Color_Number; + Back : out Color_Number) + is + type C_Short_Access is access all C_Short; + function Paircontent (Pair : C_Short; + Fp : C_Short_Access; + Bp : C_Short_Access) return C_Int; + pragma Import (C, Paircontent, "pair_content"); + + F, B : aliased C_Short; + begin + if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then + raise Curses_Exception; + else + Fore := Color_Number (F); + Back := Color_Number (B); + end if; + end Pair_Content; + + function Has_Colors return Boolean + is + function Hascolors return Curses_Bool; + pragma Import (C, Hascolors, "has_colors"); + begin + if Hascolors = Curses_Bool_False then + return False; + else + return True; + end if; + end Has_Colors; + + procedure Init_Color (Color : Color_Number; + Red : RGB_Value; + Green : RGB_Value; + Blue : RGB_Value) + is + function Initcolor (Col : C_Short; + Red : C_Short; + Green : C_Short; + Blue : C_Short) return C_Int; + pragma Import (C, Initcolor, "init_color"); + begin + if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green), + C_Short (Blue)) = Curses_Err then + raise Curses_Exception; + end if; + end Init_Color; + + function Can_Change_Color return Boolean + is + function Canchangecolor return Curses_Bool; + pragma Import (C, Canchangecolor, "can_change_color"); + begin + if Canchangecolor = Curses_Bool_False then + return False; + else + return True; + end if; + end Can_Change_Color; + + procedure Color_Content (Color : Color_Number; + Red : out RGB_Value; + Green : out RGB_Value; + Blue : out RGB_Value) + is + type C_Short_Access is access all C_Short; + + function Colorcontent (Color : C_Short; R, G, B : C_Short_Access) + return C_Int; + pragma Import (C, Colorcontent, "color_content"); + + R, G, B : aliased C_Short; + begin + if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) = + Curses_Err then + raise Curses_Exception; + else + Red := RGB_Value (R); + Green := RGB_Value (G); + Blue := RGB_Value (B); + end if; + end Color_Content; + +------------------------------------------------------------------------------ + procedure Save_Curses_Mode (Mode : Curses_Mode) + is + function Def_Prog_Mode return C_Int; + pragma Import (C, Def_Prog_Mode, "def_prog_mode"); + function Def_Shell_Mode return C_Int; + pragma Import (C, Def_Shell_Mode, "def_shell_mode"); + + Err : C_Int; + begin + case Mode is + when Curses => Err := Def_Prog_Mode; + when Shell => Err := Def_Shell_Mode; + end case; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Save_Curses_Mode; + + procedure Reset_Curses_Mode (Mode : Curses_Mode) + is + function Reset_Prog_Mode return C_Int; + pragma Import (C, Reset_Prog_Mode, "reset_prog_mode"); + function Reset_Shell_Mode return C_Int; + pragma Import (C, Reset_Shell_Mode, "reset_shell_mode"); + + Err : C_Int; + begin + case Mode is + when Curses => Err := Reset_Prog_Mode; + when Shell => Err := Reset_Shell_Mode; + end case; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Reset_Curses_Mode; + + procedure Save_Terminal_State + is + function Savetty return C_Int; + pragma Import (C, Savetty, "savetty"); + begin + if Savetty = Curses_Err then + raise Curses_Exception; + end if; + end Save_Terminal_State; + + procedure Reset_Terminal_State + is + function Resetty return C_Int; + pragma Import (C, Resetty, "resetty"); + begin + if Resetty = Curses_Err then + raise Curses_Exception; + end if; + end Reset_Terminal_State; + + procedure Rip_Off_Lines (Lines : Integer; + Proc : Stdscr_Init_Proc) + is + function Ripoffline (Lines : C_Int; + Proc : Stdscr_Init_Proc) return C_Int; + pragma Import (C, Ripoffline, "_nc_ripoffline"); + begin + if Ripoffline (C_Int (Lines), Proc) = Curses_Err then + raise Curses_Exception; + end if; + end Rip_Off_Lines; + + procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility) + is + function Curs_Set (Curs : C_Int) return C_Int; + pragma Import (C, Curs_Set, "curs_set"); + + Res : C_Int; + begin + Res := Curs_Set (Cursor_Visibility'Pos (Visibility)); + if Res /= Curses_Err then + Visibility := Cursor_Visibility'Val (Res); + end if; + end Set_Cursor_Visibility; + + procedure Nap_Milli_Seconds (Ms : Natural) + is + function Napms (Ms : C_Int) return C_Int; + pragma Import (C, Napms, "napms"); + begin + if Napms (C_Int (Ms)) = Curses_Err then + raise Curses_Exception; + end if; + end Nap_Milli_Seconds; +------------------------------------------------------------------------------ +include(`Public_Variables') +------------------------------------------------------------------------------ + procedure Transform_Coordinates + (W : Window := Standard_Window; + Line : in out Line_Position; + Column : in out Column_Position; + Dir : Transform_Direction := From_Screen) + is + type Int_Access is access all C_Int; + function Transform (W : Window; + Y, X : Int_Access; + Dir : Curses_Bool) return C_Int; + pragma Import (C, Transform, "wmouse_trafo"); + + X : aliased C_Int := C_Int (Column); + Y : aliased C_Int := C_Int (Line); + D : Curses_Bool := Curses_Bool_False; + R : C_Int; + begin + if Dir = To_Screen then + D := 1; + end if; + R := Transform (W, Y'Access, X'Access, D); + if R = Curses_False then + raise Curses_Exception; + else + Line := Line_Position (Y); + Column := Column_Position (X); + end if; + end Transform_Coordinates; +------------------------------------------------------------------------------ + procedure Use_Default_Colors is + function C_Use_Default_Colors return C_Int; + pragma Import (C, C_Use_Default_Colors, "use_default_colors"); + Err : constant C_Int := C_Use_Default_Colors; + begin + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Use_Default_Colors; + + procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; + Back : Color_Number := Default_Color) + is + function C_Assume_Default_Colors (Fore : C_Int; + Back : C_Int) return C_Int; + pragma Import (C, C_Assume_Default_Colors, "assume_default_colors"); + + Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore), + C_Int (Back)); + begin + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Assume_Default_Colors; +------------------------------------------------------------------------------ + function Curses_Version return String + is + function curses_versionC return chars_ptr; + pragma Import (C, curses_versionC, "curses_version"); + Result : constant chars_ptr := curses_versionC; + begin + return Fill_String (Result); + end Curses_Version; +------------------------------------------------------------------------------ + procedure Curses_Free_All is + procedure curses_freeall; + pragma Import (C, curses_freeall, "_nc_freeall"); + begin + -- Use this only for testing: you cannot use curses after calling it, + -- so it has to be the "last" thing done before exiting the program. + -- This will not really free ALL of memory used by curses. That is + -- because it cannot free the memory used for stdout's setbuf. The + -- _nc_free_and_exit() procedure can do that, but it can be invoked + -- safely only from C - and again, that only as the "last" thing done + -- before exiting the program. + curses_freeall; + end Curses_Free_All; +------------------------------------------------------------------------------ + function Use_Extended_Names (Enable : Boolean) return Boolean + is + function use_extended_namesC (e : Curses_Bool) return C_Int; + pragma Import (C, use_extended_namesC, "use_extended_names"); + + Res : constant C_Int := + use_extended_namesC (Curses_Bool (Boolean'Pos (Enable))); + begin + if Res = C_Int (Curses_Bool_False) then + return False; + else + return True; + end if; + end Use_Extended_Names; +------------------------------------------------------------------------------ + procedure Screen_Dump_To_File (Filename : String) + is + function scr_dump (f : char_array) return C_Int; + pragma Import (C, scr_dump, "scr_dump"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_dump (Txt) then + raise Curses_Exception; + end if; + end Screen_Dump_To_File; + + procedure Screen_Restore_From_File (Filename : String) + is + function scr_restore (f : char_array) return C_Int; + pragma Import (C, scr_restore, "scr_restore"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_restore (Txt) then + raise Curses_Exception; + end if; + end Screen_Restore_From_File; + + procedure Screen_Init_From_File (Filename : String) + is + function scr_init (f : char_array) return C_Int; + pragma Import (C, scr_init, "scr_init"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_init (Txt) then + raise Curses_Exception; + end if; + end Screen_Init_From_File; + + procedure Screen_Set_File (Filename : String) + is + function scr_set (f : char_array) return C_Int; + pragma Import (C, scr_set, "scr_set"); + Txt : char_array (0 .. Filename'Length); + Length : size_t; + begin + To_C (Filename, Txt, Length); + if Curses_Err = scr_set (Txt) then + raise Curses_Exception; + end if; + end Screen_Set_File; +------------------------------------------------------------------------------ + procedure Resize (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count) is + function wresize (win : Window; + lines : C_Int; + columns : C_Int) return C_Int; + pragma Import (C, wresize); + begin + if wresize (Win, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns)) = Curses_Err then + raise Curses_Exception; + end if; + end Resize; +------------------------------------------------------------------------------ + +end Terminal_Interface.Curses; diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 new file mode 100644 index 00000000000..deb762896de --- /dev/null +++ b/Ada95/gen/terminal_interface-curses.ads.m4 @@ -0,0 +1,1559 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2007,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.42 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +include(`Base_Defs') +with System.Storage_Elements; +with Interfaces.C; -- We need this for some assertions. + +package Terminal_Interface.Curses is + pragma Preelaborate (Terminal_Interface.Curses); +include(`Linker_Options') +include(`Version_Info') + type Window is private; + Null_Window : constant Window; + + type Line_Position is new Natural; -- line coordinate + type Column_Position is new Natural; -- column coordinate + + subtype Line_Count is Line_Position range 1 .. Line_Position'Last; + -- Type to count lines. We do not allow null windows, so must be positive + subtype Column_Count is Column_Position range 1 .. Column_Position'Last; + -- Type to count columns. We do not allow null windows, so must be positive + + type Key_Code is new Integer; + -- That is anything including real characters, special keys and logical + -- request codes. + + -- FIXME: The "-1" should be Curses_Err + subtype Real_Key_Code is Key_Code range -1 .. M4_KEY_MAX; + -- This are the codes that potentially represent a real keystroke. + -- Not all codes may be possible on a specific terminal. To check the + -- availability of a special key, the Has_Key function is provided. + + subtype Special_Key_Code is Real_Key_Code + range M4_SPECIAL_FIRST .. Real_Key_Code'Last; + -- Type for a function- or special key number + + subtype Normal_Key_Code is Real_Key_Code range + Character'Pos (Character'First) .. Character'Pos (Character'Last); + -- This are the codes for regular (incl. non-graphical) characters. + + -- Constants for function- and special keys + -- + Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST; +include(`Key_Definitions') + Key_Max : constant Special_Key_Code + := Special_Key_Code'Last; + + subtype User_Key_Code is Key_Code + range (Key_Max + 129) .. Key_Code'Last; + -- This is reserved for user defined key codes. The range between Key_Max + -- and the first user code is reserved for subsystems like menu and forms. + + -- For those who like to use the original key names we produce them were + -- they differ from the original. Please note that they may differ in + -- lower/upper case. +include(`Old_Keys')dnl + +------------------------------------------------------------------------------ + + type Color_Number is range -1 .. Integer (Interfaces.C.short'Last); + for Color_Number'Size use Interfaces.C.short'Size; + -- (n)curses uses a short for the color index + -- The model is, that a Color_Number is an index into an array of + -- (potentially) definable colors. Some of those indices are + -- predefined (see below), although they may not really exist. + +include(`Color_Defs') + type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last); + for RGB_Value'Size use Interfaces.C.short'Size; + -- Some system may allow to redefine a color by setting RGB values. + + type Color_Pair is range 0 .. 255; + for Color_Pair'Size use 8; + subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255; + -- (n)curses reserves 1 Byte for the color-pair number. Color Pair 0 + -- is fixed (Black & White). A color pair is simply a combination of + -- two colors described by Color_Numbers, one for the foreground and + -- the other for the background + +include(`Character_Attribute_Set_Rep') + -- (n)curses uses all but the lowest 16 Bits for Attributes. + + Normal_Video : constant Character_Attribute_Set := (others => False); + + type Attributed_Character is + record + Attr : Character_Attribute_Set; + Color : Color_Pair; + Ch : Character; + end record; + pragma Convention (C, Attributed_Character); + -- This is the counterpart for the chtype in C. + +include(`AC_Rep') + Default_Character : constant Attributed_Character + := (Ch => Character'First, + Color => Color_Pair'First, + Attr => (others => False)); -- preelaboratable Normal_Video + + type Attributed_String is array (Positive range <>) of Attributed_Character; + pragma Pack (Attributed_String); + -- In this binding we allow strings of attributed characters. + + ------------------ + -- Exceptions -- + ------------------ + Curses_Exception : exception; + Wrong_Curses_Version : exception; + + -- Those exceptions are raised by the ETI (Extended Terminal Interface) + -- subpackets for Menu and Forms handling. + -- + Eti_System_Error : exception; + Eti_Bad_Argument : exception; + Eti_Posted : exception; + Eti_Connected : exception; + Eti_Bad_State : exception; + Eti_No_Room : exception; + Eti_Not_Posted : exception; + Eti_Unknown_Command : exception; + Eti_No_Match : exception; + Eti_Not_Selectable : exception; + Eti_Not_Connected : exception; + Eti_Request_Denied : exception; + Eti_Invalid_Field : exception; + Eti_Current : exception; + + -------------------------------------------------------------------------- + -- External C variables + -- Conceptually even in C this are kind of constants, but they are + -- initialized and sometimes changed by the library routines at runtime + -- depending on the type of terminal. I believe the best way to model + -- this is to use functions. + -------------------------------------------------------------------------- + + function Lines return Line_Count; + pragma Inline (Lines); + + function Columns return Column_Count; + pragma Inline (Columns); + + function Tab_Size return Natural; + pragma Inline (Tab_Size); + + function Number_Of_Colors return Natural; + pragma Inline (Number_Of_Colors); + + function Number_Of_Color_Pairs return Natural; + pragma Inline (Number_Of_Color_Pairs); + +include(`ACS_Map')dnl + + -- MANPAGE(`curs_initscr.3x') + -- | Not implemented: newterm, set_term, delscreen + + -- ANCHOR(`stdscr',`Standard_Window') + function Standard_Window return Window; + -- AKA + pragma Inline (Standard_Window); + + -- ANCHOR(`curscr',`Current_Window') + function Current_Window return Window; + -- AKA + pragma Inline (Current_Window); + + -- ANCHOR(`initscr()',`Init_Screen') + procedure Init_Screen; + + -- ANCHOR(`initscr()',`Init_Windows') + procedure Init_Windows renames Init_Screen; + -- AKA + pragma Inline (Init_Screen); + -- pragma Inline (Init_Windows); + + -- ANCHOR(`endwin()',`End_Windows') + procedure End_Windows; + -- AKA + procedure End_Screen renames End_Windows; + pragma Inline (End_Windows); + -- pragma Inline (End_Screen); + + -- ANCHOR(`isendwin()',`Is_End_Window') + function Is_End_Window return Boolean; + -- AKA + pragma Inline (Is_End_Window); + + -- MANPAGE(`curs_move.3x') + + -- ANCHOR(`wmove()',`Move_Cursor') + procedure Move_Cursor (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position); + -- AKA + -- ALIAS(`move()') + pragma Inline (Move_Cursor); + + -- MANPAGE(`curs_addch.3x') + + -- ANCHOR(`waddch()',`Add') + procedure Add (Win : Window := Standard_Window; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`addch()') + + procedure Add (Win : Window := Standard_Window; + Ch : Character); + -- Add a single character at the current logical cursor position to + -- the window. Use the current windows attributes. + + -- ANCHOR(`mvwaddch()',`Add') + procedure Add + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`mvaddch()') + + procedure Add + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Ch : Character); + -- Move to the position and add a single character into the window + -- There are more Add routines, so the Inline pragma follows later + + -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo') + procedure Add_With_Immediate_Echo + (Win : Window := Standard_Window; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`echochar()') + + procedure Add_With_Immediate_Echo + (Win : Window := Standard_Window; + Ch : Character); + -- Add a character and do an immediate refresh of the screen. + pragma Inline (Add_With_Immediate_Echo); + + -- MANPAGE(`curs_window.3x') + -- Not Implemented: wcursyncup + + -- ANCHOR(`newwin()',`Create') + function Create + (Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns + -- the C version lets them be 0, see the man page. + -- AKA + pragma Inline (Create); + + function New_Window + (Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + renames Create; + -- pragma Inline (New_Window); + + -- ANCHOR(`delwin()',`Delete') + procedure Delete (Win : in out Window); + -- AKA + -- Reset Win to Null_Window + pragma Inline (Delete); + + -- ANCHOR(`subwin()',`Sub_Window') + function Sub_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + pragma Inline (Sub_Window); + + -- ANCHOR(`derwin()',`Derived_Window') + function Derived_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + pragma Inline (Derived_Window); + + -- ANCHOR(`dupwin()',`Duplicate') + function Duplicate (Win : Window) return Window; + -- AKA + pragma Inline (Duplicate); + + -- ANCHOR(`mvwin()',`Move_Window') + procedure Move_Window (Win : Window; + Line : Line_Position; + Column : Column_Position); + -- AKA + pragma Inline (Move_Window); + + -- ANCHOR(`mvderwin()',`Move_Derived_Window') + procedure Move_Derived_Window (Win : Window; + Line : Line_Position; + Column : Column_Position); + -- AKA + pragma Inline (Move_Derived_Window); + + -- ANCHOR(`wsyncup()',`Synchronize_Upwards') + procedure Synchronize_Upwards (Win : Window); + -- AKA + pragma Import (C, Synchronize_Upwards, "wsyncup"); + + -- ANCHOR(`wsyncdown()',`Synchronize_Downwards') + procedure Synchronize_Downwards (Win : Window); + -- AKA + pragma Import (C, Synchronize_Downwards, "wsyncdown"); + + -- ANCHOR(`syncok()',`Set_Synch_Mode') + procedure Set_Synch_Mode (Win : Window := Standard_Window; + Mode : Boolean := False); + -- AKA + pragma Inline (Set_Synch_Mode); + + -- MANPAGE(`curs_addstr.3x') + + -- ANCHOR(`waddnstr()',`Add') + procedure Add (Win : Window := Standard_Window; + Str : String; + Len : Integer := -1); + -- AKA + -- ALIAS(`waddstr()') + -- ALIAS(`addnstr()') + -- ALIAS(`addstr()') + + -- ANCHOR(`mvwaddnstr()',`Add') + procedure Add (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : String; + Len : Integer := -1); + -- AKA + -- ALIAS(`mvwaddstr()') + -- ALIAS(`mvaddnstr()') + -- ALIAS(`mvaddstr()') + + -- MANPAGE(`curs_addchstr.3x') + + -- ANCHOR(`waddchnstr()',`Add') + procedure Add (Win : Window := Standard_Window; + Str : Attributed_String; + Len : Integer := -1); + -- AKA + -- ALIAS(`waddchstr()') + -- ALIAS(`addchnstr()') + -- ALIAS(`addchstr()') + + -- ANCHOR(`mvwaddchnstr()',`Add') + procedure Add (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : Attributed_String; + Len : Integer := -1); + -- AKA + -- ALIAS(`mvwaddchstr()') + -- ALIAS(`mvaddchnstr()') + -- ALIAS(`mvaddchstr()') + pragma Inline (Add); + + -- MANPAGE(`curs_border.3x') + -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline + -- | use Move_Cursor then Horizontal_Line or Vertical_Line + + -- ANCHOR(`wborder()',`Border') + procedure Border + (Win : Window := Standard_Window; + Left_Side_Symbol : Attributed_Character := Default_Character; + Right_Side_Symbol : Attributed_Character := Default_Character; + Top_Side_Symbol : Attributed_Character := Default_Character; + Bottom_Side_Symbol : Attributed_Character := Default_Character; + Upper_Left_Corner_Symbol : Attributed_Character := Default_Character; + Upper_Right_Corner_Symbol : Attributed_Character := Default_Character; + Lower_Left_Corner_Symbol : Attributed_Character := Default_Character; + Lower_Right_Corner_Symbol : Attributed_Character := Default_Character + ); + -- AKA + -- ALIAS(`border()') + pragma Inline (Border); + + -- ANCHOR(`box()',`Box') + procedure Box + (Win : Window := Standard_Window; + Vertical_Symbol : Attributed_Character := Default_Character; + Horizontal_Symbol : Attributed_Character := Default_Character); + -- AKA + pragma Inline (Box); + + -- ANCHOR(`whline()',`Horizontal_Line') + procedure Horizontal_Line + (Win : Window := Standard_Window; + Line_Size : Natural; + Line_Symbol : Attributed_Character := Default_Character); + -- AKA + -- ALIAS(`hline()') + pragma Inline (Horizontal_Line); + + -- ANCHOR(`wvline()',`Vertical_Line') + procedure Vertical_Line + (Win : Window := Standard_Window; + Line_Size : Natural; + Line_Symbol : Attributed_Character := Default_Character); + -- AKA + -- ALIAS(`vline()') + pragma Inline (Vertical_Line); + + -- MANPAGE(`curs_getch.3x') + -- Not implemented: mvgetch, mvwgetch + + -- ANCHOR(`wgetch()',`Get_Keystroke') + function Get_Keystroke (Win : Window := Standard_Window) + return Real_Key_Code; + -- AKA + -- ALIAS(`getch()') + -- Get a character from the keyboard and echo it - if enabled - to the + -- window. + -- If for any reason (i.e. a timeout) we couldn't get a character the + -- returned keycode is Key_None. + pragma Inline (Get_Keystroke); + + -- ANCHOR(`ungetch()',`Undo_Keystroke') + procedure Undo_Keystroke (Key : Real_Key_Code); + -- AKA + pragma Inline (Undo_Keystroke); + + -- ANCHOR(`has_key()',`Has_Key') + function Has_Key (Key : Special_Key_Code) return Boolean; + -- AKA + pragma Inline (Has_Key); + + -- | + -- | Some helper functions + -- | + function Is_Function_Key (Key : Special_Key_Code) return Boolean; + -- Return True if the Key is a function key (i.e. one of F0 .. F63) + pragma Inline (Is_Function_Key); + + subtype Function_Key_Number is Integer range 0 .. 63; + -- (n)curses allows for 64 function keys. + + function Function_Key (Key : Real_Key_Code) return Function_Key_Number; + -- Return the number of the function key. If the code is not a + -- function key, a CONSTRAINT_ERROR will be raised. + pragma Inline (Function_Key); + + function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code; + -- Return the key code for a given function-key number. + pragma Inline (Function_Key_Code); + + -- MANPAGE(`curs_attr.3x') + -- | Not implemented attr_off, wattr_off, + -- | attr_on, wattr_on, attr_set, wattr_set + + -- PAIR_NUMBER + -- PAIR_NUMBER(c) is the same as c.Color + + -- ANCHOR(`standout()',`Standout') + procedure Standout (Win : Window := Standard_Window; + On : Boolean := True); + -- ALIAS(`wstandout()') + -- ALIAS(`wstandend()') + + -- ANCHOR(`wattron()',`Switch_Character_Attribute') + procedure Switch_Character_Attribute + (Win : Window := Standard_Window; + Attr : Character_Attribute_Set := Normal_Video; + On : Boolean := True); -- if False we switch Off. + -- Switches those Attributes set to true in the list. + -- AKA + -- ALIAS(`wattroff()') + -- ALIAS(`attron()') + -- ALIAS(`attroff()') + + -- ANCHOR(`wattrset()',`Set_Character_Attributes') + procedure Set_Character_Attributes + (Win : Window := Standard_Window; + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + -- ALIAS(`attrset()') + pragma Inline (Set_Character_Attributes); + + -- ANCHOR(`wattr_get()',`Get_Character_Attributes') + function Get_Character_Attribute + (Win : Window := Standard_Window) return Character_Attribute_Set; + -- AKA + -- ALIAS(`attr_get()') + + -- ANCHOR(`wattr_get()',`Get_Character_Attribute') + function Get_Character_Attribute + (Win : Window := Standard_Window) return Color_Pair; + -- AKA + pragma Inline (Get_Character_Attribute); + + -- ANCHOR(`wcolor_set()',`Set_Color') + procedure Set_Color (Win : Window := Standard_Window; + Pair : Color_Pair); + -- AKA + -- ALIAS(`color_set()') + pragma Inline (Set_Color); + + -- ANCHOR(`wchgat()',`Change_Attributes') + procedure Change_Attributes + (Win : Window := Standard_Window; + Count : Integer := -1; + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + -- ALIAS(`chgat()') + + -- ANCHOR(`mvwchgat()',`Change_Attributes') + procedure Change_Attributes + (Win : Window := Standard_Window; + Line : Line_Position := Line_Position'First; + Column : Column_Position := Column_Position'First; + Count : Integer := -1; + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + -- ALIAS(`mvchgat()') + pragma Inline (Change_Attributes); + + -- MANPAGE(`curs_beep.3x') + + -- ANCHOR(`beep()',`Beep') + procedure Beep; + -- AKA + pragma Inline (Beep); + + -- ANCHOR(`flash()',`Flash_Screen') + procedure Flash_Screen; + -- AKA + pragma Inline (Flash_Screen); + + -- MANPAGE(`curs_inopts.3x') + + -- | Not implemented : typeahead + -- + -- ANCHOR(`cbreak()',`Set_Cbreak_Mode') + procedure Set_Cbreak_Mode (SwitchOn : Boolean := True); + -- AKA + -- ALIAS(`nocbreak()') + pragma Inline (Set_Cbreak_Mode); + + -- ANCHOR(`raw()',`Set_Raw_Mode') + procedure Set_Raw_Mode (SwitchOn : Boolean := True); + -- AKA + -- ALIAS(`noraw()') + pragma Inline (Set_Raw_Mode); + + -- ANCHOR(`echo()',`Set_Echo_Mode') + procedure Set_Echo_Mode (SwitchOn : Boolean := True); + -- AKA + -- ALIAS(`noecho()') + pragma Inline (Set_Echo_Mode); + + -- ANCHOR(`meta()',`Set_Meta_Mode') + procedure Set_Meta_Mode (Win : Window := Standard_Window; + SwitchOn : Boolean := True); + -- AKA + pragma Inline (Set_Meta_Mode); + + -- ANCHOR(`keypad()',`Set_KeyPad_Mode') + procedure Set_KeyPad_Mode (Win : Window := Standard_Window; + SwitchOn : Boolean := True); + -- AKA + pragma Inline (Set_KeyPad_Mode); + + function Get_KeyPad_Mode (Win : Window := Standard_Window) + return Boolean; + -- This has no pendant in C. There you've to look into the WINDOWS + -- structure to get the value. Bad practice, not repeated in Ada. + + type Half_Delay_Amount is range 1 .. 255; + + -- ANCHOR(`halfdelay()',`Half_Delay') + procedure Half_Delay (Amount : Half_Delay_Amount); + -- AKA + pragma Inline (Half_Delay); + + -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode') + procedure Set_Flush_On_Interrupt_Mode + (Win : Window := Standard_Window; + Mode : Boolean := True); + -- AKA + pragma Inline (Set_Flush_On_Interrupt_Mode); + + -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode') + procedure Set_Queue_Interrupt_Mode + (Win : Window := Standard_Window; + Flush : Boolean := True); + -- AKA + -- ALIAS(`noqiflush()') + pragma Inline (Set_Queue_Interrupt_Mode); + + -- ANCHOR(`nodelay()',`Set_NoDelay_Mode') + procedure Set_NoDelay_Mode + (Win : Window := Standard_Window; + Mode : Boolean := False); + -- AKA + pragma Inline (Set_NoDelay_Mode); + + type Timeout_Mode is (Blocking, Non_Blocking, Delayed); + + -- ANCHOR(`wtimeout()',`Set_Timeout_Mode') + procedure Set_Timeout_Mode (Win : Window := Standard_Window; + Mode : Timeout_Mode; + Amount : Natural); -- in Milliseconds + -- AKA + -- ALIAS(`timeout()') + -- Instead of overloading the semantic of the sign of amount, we + -- introduce the Timeout_Mode parameter. This should improve + -- readability. For Blocking and Non_Blocking, the Amount is not + -- evaluated. + -- We don't inline this procedure. + + -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode') + procedure Set_Escape_Timer_Mode + (Win : Window := Standard_Window; + Timer_Off : Boolean := False); + -- AKA + pragma Inline (Set_Escape_Timer_Mode); + + -- MANPAGE(`curs_outopts.3x') + + -- ANCHOR(`nl()',`Set_NL_Mode') + procedure Set_NL_Mode (SwitchOn : Boolean := True); + -- AKA + -- ALIAS(`nonl()') + pragma Inline (Set_NL_Mode); + + -- ANCHOR(`clearok()',`Clear_On_Next_Update') + procedure Clear_On_Next_Update + (Win : Window := Standard_Window; + Do_Clear : Boolean := True); + -- AKA + pragma Inline (Clear_On_Next_Update); + + -- ANCHOR(`idlok()',`Use_Insert_Delete_Line') + procedure Use_Insert_Delete_Line + (Win : Window := Standard_Window; + Do_Idl : Boolean := True); + -- AKA + pragma Inline (Use_Insert_Delete_Line); + + -- ANCHOR(`idcok()',`Use_Insert_Delete_Character') + procedure Use_Insert_Delete_Character + (Win : Window := Standard_Window; + Do_Idc : Boolean := True); + -- AKA + pragma Inline (Use_Insert_Delete_Character); + + -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update') + procedure Leave_Cursor_After_Update + (Win : Window := Standard_Window; + Do_Leave : Boolean := True); + -- AKA + pragma Inline (Leave_Cursor_After_Update); + + -- ANCHOR(`immedok()',`Immediate_Update_Mode') + procedure Immediate_Update_Mode + (Win : Window := Standard_Window; + Mode : Boolean := False); + -- AKA + pragma Inline (Immediate_Update_Mode); + + -- ANCHOR(`scrollok()',`Allow_Scrolling') + procedure Allow_Scrolling + (Win : Window := Standard_Window; + Mode : Boolean := False); + -- AKA + pragma Inline (Allow_Scrolling); + + function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean; + -- There is no such function in the C interface. + pragma Inline (Scrolling_Allowed); + + -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region') + procedure Set_Scroll_Region + (Win : Window := Standard_Window; + Top_Line : Line_Position; + Bottom_Line : Line_Position); + -- AKA + -- ALIAS(`setscrreg()') + pragma Inline (Set_Scroll_Region); + + -- MANPAGE(`curs_refresh.3x') + + -- ANCHOR(`doupdate()',`Update_Screen') + procedure Update_Screen; + -- AKA + pragma Inline (Update_Screen); + + -- ANCHOR(`wrefresh()',`Refresh') + procedure Refresh (Win : Window := Standard_Window); + -- AKA + -- There is an overloaded Refresh for Pads. + -- The Inline pragma appears there + -- ALIAS(`refresh()') + + -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update') + procedure Refresh_Without_Update + (Win : Window := Standard_Window); + -- AKA + -- There is an overloaded Refresh_Without_Update for Pads. + -- The Inline pragma appears there + + -- ANCHOR(`redrawwin()',`Redraw') + procedure Redraw (Win : Window := Standard_Window); + -- AKA + + -- ANCHOR(`wredrawln()',`Redraw') + procedure Redraw (Win : Window := Standard_Window; + Begin_Line : Line_Position; + Line_Count : Positive); + -- AKA + pragma Inline (Redraw); + + -- MANPAGE(`curs_clear.3x') + + -- ANCHOR(`werase()',`Erase') + procedure Erase (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`erase()') + pragma Inline (Erase); + + -- ANCHOR(`wclear()',`Clear') + procedure Clear + (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`clear()') + pragma Inline (Clear); + + -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen') + procedure Clear_To_End_Of_Screen + (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`clrtobot()') + pragma Inline (Clear_To_End_Of_Screen); + + -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line') + procedure Clear_To_End_Of_Line + (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`clrtoeol()') + pragma Inline (Clear_To_End_Of_Line); + + -- MANPAGE(`curs_bkgd.3x') + + -- ANCHOR(`wbkgdset()',`Set_Background') + -- TODO: we could have Set_Background(Window; Character_Attribute_Set) + -- because in C it is common to see bkgdset(A_BOLD) or + -- bkgdset(COLOR_PAIR(n)) + procedure Set_Background + (Win : Window := Standard_Window; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`bkgdset()') + pragma Inline (Set_Background); + + -- ANCHOR(`wbkgd()',`Change_Background') + procedure Change_Background + (Win : Window := Standard_Window; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`bkgd()') + pragma Inline (Change_Background); + + -- ANCHOR(`wbkgdget()',`Get_Background') + -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough. + function Get_Background (Win : Window := Standard_Window) + return Attributed_Character; + -- AKA + -- ALIAS(`bkgdget()') + pragma Inline (Get_Background); + + -- MANPAGE(`curs_touch.3x') + + -- ANCHOR(`untouchwin()',`Untouch') + procedure Untouch (Win : Window := Standard_Window); + -- AKA + pragma Inline (Untouch); + + -- ANCHOR(`touchwin()',`Touch') + procedure Touch (Win : Window := Standard_Window); + -- AKA + + -- ANCHOR(`touchline()',`Touch') + procedure Touch (Win : Window := Standard_Window; + Start : Line_Position; + Count : Positive); + -- AKA + pragma Inline (Touch); + + -- ANCHOR(`wtouchln()',`Change_Line_Status') + procedure Change_Lines_Status (Win : Window := Standard_Window; + Start : Line_Position; + Count : Positive; + State : Boolean); + -- AKA + pragma Inline (Change_Lines_Status); + + -- ANCHOR(`is_linetouched()',`Is_Touched') + function Is_Touched (Win : Window := Standard_Window; + Line : Line_Position) return Boolean; + -- AKA + + -- ANCHOR(`is_wintouched()',`Is_Touched') + function Is_Touched (Win : Window := Standard_Window) return Boolean; + -- AKA + pragma Inline (Is_Touched); + + -- MANPAGE(`curs_overlay.3x') + + -- ANCHOR(`copywin()',`Copy') + procedure Copy + (Source_Window : Window; + Destination_Window : Window; + Source_Top_Row : Line_Position; + Source_Left_Column : Column_Position; + Destination_Top_Row : Line_Position; + Destination_Left_Column : Column_Position; + Destination_Bottom_Row : Line_Position; + Destination_Right_Column : Column_Position; + Non_Destructive_Mode : Boolean := True); + -- AKA + pragma Inline (Copy); + + -- ANCHOR(`overwrite()',`Overwrite') + procedure Overwrite (Source_Window : Window; + Destination_Window : Window); + -- AKA + pragma Inline (Overwrite); + + -- ANCHOR(`overlay()',`Overlay') + procedure Overlay (Source_Window : Window; + Destination_Window : Window); + -- AKA + pragma Inline (Overlay); + + -- MANPAGE(`curs_deleteln.3x') + + -- ANCHOR(`winsdelln()',`Insert_Delete_Lines') + procedure Insert_Delete_Lines + (Win : Window := Standard_Window; + Lines : Integer := 1); -- default is to insert one line above + -- AKA + -- ALIAS(`insdelln()') + pragma Inline (Insert_Delete_Lines); + + -- ANCHOR(`wdeleteln()',`Delete_Line') + procedure Delete_Line (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`deleteln()') + pragma Inline (Delete_Line); + + -- ANCHOR(`winsertln()',`Insert_Line') + procedure Insert_Line (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`insertln()') + pragma Inline (Insert_Line); + + -- MANPAGE(`curs_getyx.3x') + + -- ANCHOR(`getmaxyx()',`Get_Size') + procedure Get_Size + (Win : Window := Standard_Window; + Number_Of_Lines : out Line_Count; + Number_Of_Columns : out Column_Count); + -- AKA + pragma Inline (Get_Size); + + -- ANCHOR(`getbegyx()',`Get_Window_Position') + procedure Get_Window_Position + (Win : Window := Standard_Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position); + -- AKA + pragma Inline (Get_Window_Position); + + -- ANCHOR(`getyx()',`Get_Cursor_Position') + procedure Get_Cursor_Position + (Win : Window := Standard_Window; + Line : out Line_Position; + Column : out Column_Position); + -- AKA + pragma Inline (Get_Cursor_Position); + + -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent') + procedure Get_Origin_Relative_To_Parent + (Win : Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position; + Is_Not_A_Subwindow : out Boolean); + -- AKA + -- Instead of placing -1 in the coordinates as return, we use a boolean + -- to return the info that the window has no parent. + pragma Inline (Get_Origin_Relative_To_Parent); + + -- MANPAGE(`curs_pad.3x') + + -- ANCHOR(`newpad()',`New_Pad') + function New_Pad (Lines : Line_Count; + Columns : Column_Count) return Window; + -- AKA + pragma Inline (New_Pad); + + -- ANCHOR(`subpad()',`Sub_Pad') + function Sub_Pad + (Pad : Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + pragma Inline (Sub_Pad); + + -- ANCHOR(`prefresh()',`Refresh') + procedure Refresh + (Pad : Window; + Source_Top_Row : Line_Position; + Source_Left_Column : Column_Position; + Destination_Top_Row : Line_Position; + Destination_Left_Column : Column_Position; + Destination_Bottom_Row : Line_Position; + Destination_Right_Column : Column_Position); + -- AKA + pragma Inline (Refresh); + + -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update') + procedure Refresh_Without_Update + (Pad : Window; + Source_Top_Row : Line_Position; + Source_Left_Column : Column_Position; + Destination_Top_Row : Line_Position; + Destination_Left_Column : Column_Position; + Destination_Bottom_Row : Line_Position; + Destination_Right_Column : Column_Position); + -- AKA + pragma Inline (Refresh_Without_Update); + + -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It') + procedure Add_Character_To_Pad_And_Echo_It + (Pad : Window; + Ch : Attributed_Character); + -- AKA + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : Window; + Ch : Character); + pragma Inline (Add_Character_To_Pad_And_Echo_It); + + -- MANPAGE(`curs_scroll.3x') + + -- ANCHOR(`wscrl()',`Scroll') + procedure Scroll (Win : Window := Standard_Window; + Amount : Integer := 1); + -- AKA + -- ALIAS(`scroll()') + -- ALIAS(`scrl()') + pragma Inline (Scroll); + + -- MANPAGE(`curs_delch.3x') + + -- ANCHOR(`wdelch()',`Delete_Character') + procedure Delete_Character (Win : Window := Standard_Window); + -- AKA + -- ALIAS(`delch()') + + -- ANCHOR(`mvwdelch()',`Delete_Character') + procedure Delete_Character + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position); + -- AKA + -- ALIAS(`mvdelch()') + pragma Inline (Delete_Character); + + -- MANPAGE(`curs_inch.3x') + + -- ANCHOR(`winch()',`Peek') + function Peek (Win : Window := Standard_Window) + return Attributed_Character; + -- ALIAS(`inch()') + -- AKA + + -- ANCHOR(`mvwinch()',`Peek') + function Peek + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position) return Attributed_Character; + -- AKA + -- ALIAS(`mvinch()') + -- More Peek's follow, pragma Inline appears later. + + -- MANPAGE(`curs_insch.3x') + + -- ANCHOR(`winsch()',`Insert') + procedure Insert (Win : Window := Standard_Window; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`insch()') + + -- ANCHOR(`mvwinsch()',`Insert') + procedure Insert (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Ch : Attributed_Character); + -- AKA + -- ALIAS(`mvinsch()') + + -- MANPAGE(`curs_insstr.3x') + + -- ANCHOR(`winsnstr()',`Insert') + procedure Insert (Win : Window := Standard_Window; + Str : String; + Len : Integer := -1); + -- AKA + -- ALIAS(`winsstr()') + -- ALIAS(`insnstr()') + -- ALIAS(`insstr()') + + -- ANCHOR(`mvwinsnstr()',`Insert') + procedure Insert (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : String; + Len : Integer := -1); + -- AKA + -- ALIAS(`mvwinsstr()') + -- ALIAS(`mvinsnstr()') + -- ALIAS(`mvinsstr()') + pragma Inline (Insert); + + -- MANPAGE(`curs_instr.3x') + + -- ANCHOR(`winnstr()',`Peek') + procedure Peek (Win : Window := Standard_Window; + Str : out String; + Len : Integer := -1); + -- AKA + -- ALIAS(`winstr()') + -- ALIAS(`innstr()') + -- ALIAS(`instr()') + + -- ANCHOR(`mvwinnstr()',`Peek') + procedure Peek (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : out String; + Len : Integer := -1); + -- AKA + -- ALIAS(`mvwinstr()') + -- ALIAS(`mvinnstr()') + -- ALIAS(`mvinstr()') + + -- MANPAGE(`curs_inchstr.3x') + + -- ANCHOR(`winchnstr()',`Peek') + procedure Peek (Win : Window := Standard_Window; + Str : out Attributed_String; + Len : Integer := -1); + -- AKA + -- ALIAS(`winchstr()') + -- ALIAS(`inchnstr()') + -- ALIAS(`inchstr()') + + -- ANCHOR(`mvwinchnstr()',`Peek') + procedure Peek (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : out Attributed_String; + Len : Integer := -1); + -- AKA + -- ALIAS(`mvwinchstr()') + -- ALIAS(`mvinchnstr()') + -- ALIAS(`mvinchstr()') + -- We don't inline the Peek procedures + + -- MANPAGE(`curs_getstr.3x') + + -- ANCHOR(`wgetnstr()',`Get') + procedure Get (Win : Window := Standard_Window; + Str : out String; + Len : Integer := -1); + -- AKA + -- ALIAS(`wgetstr()') + -- ALIAS(`getnstr()') + -- ALIAS(`getstr()') + -- actually getstr is not supported because that results in buffer + -- overflows. + + -- ANCHOR(`mvwgetnstr()',`Get') + procedure Get (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position; + Str : out String; + Len : Integer := -1); + -- AKA + -- ALIAS(`mvwgetstr()') + -- ALIAS(`mvgetnstr()') + -- ALIAS(`mvgetstr()') + -- Get is not inlined + + -- MANPAGE(`curs_slk.3x') + + -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set + + type Soft_Label_Key_Format is (Three_Two_Three, + Four_Four, + PC_Style, -- ncurses specific + PC_Style_With_Index); -- " + type Label_Number is new Positive range 1 .. 12; + type Label_Justification is (Left, Centered, Right); + + -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys') + procedure Init_Soft_Label_Keys + (Format : Soft_Label_Key_Format := Three_Two_Three); + -- AKA + pragma Inline (Init_Soft_Label_Keys); + + -- ANCHOR(`slk_set()',`Set_Soft_Label_Key') + procedure Set_Soft_Label_Key (Label : Label_Number; + Text : String; + Fmt : Label_Justification := Left); + -- AKA + -- We don't inline this procedure + + -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key') + procedure Refresh_Soft_Label_Keys; + -- AKA + pragma Inline (Refresh_Soft_Label_Keys); + + -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update') + procedure Refresh_Soft_Label_Keys_Without_Update; + -- AKA + pragma Inline (Refresh_Soft_Label_Keys_Without_Update); + + -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') + procedure Get_Soft_Label_Key (Label : Label_Number; + Text : out String); + -- AKA + + -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') + function Get_Soft_Label_Key (Label : Label_Number) return String; + -- AKA + -- Same as function + pragma Inline (Get_Soft_Label_Key); + + -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys') + procedure Clear_Soft_Label_Keys; + -- AKA + pragma Inline (Clear_Soft_Label_Keys); + + -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys') + procedure Restore_Soft_Label_Keys; + -- AKA + pragma Inline (Restore_Soft_Label_Keys); + + -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys') + procedure Touch_Soft_Label_Keys; + -- AKA + pragma Inline (Touch_Soft_Label_Keys); + + -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes') + procedure Switch_Soft_Label_Key_Attributes + (Attr : Character_Attribute_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`slk_attroff()') + pragma Inline (Switch_Soft_Label_Key_Attributes); + + -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes') + procedure Set_Soft_Label_Key_Attributes + (Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First); + -- AKA + pragma Inline (Set_Soft_Label_Key_Attributes); + + -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') + function Get_Soft_Label_Key_Attributes return Character_Attribute_Set; + -- AKA + + -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') + function Get_Soft_Label_Key_Attributes return Color_Pair; + -- AKA + pragma Inline (Get_Soft_Label_Key_Attributes); + + -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color') + procedure Set_Soft_Label_Key_Color (Pair : Color_Pair); + -- AKA + pragma Inline (Set_Soft_Label_Key_Color); + + -- MANPAGE(`keybound.3x') + -- Not Implemented: keybound + + -- MANPAGE(`keyok.3x') + + -- ANCHOR(`keyok()',`Enable_Key') + procedure Enable_Key (Key : Special_Key_Code; + Enable : Boolean := True); + -- AKA + pragma Inline (Enable_Key); + + -- MANPAGE(`define_key.3x') + + -- ANCHOR(`define_key()',`Define_Key') + procedure Define_Key (Definition : String; + Key : Special_Key_Code); + -- AKA + pragma Inline (Define_Key); + + -- MANPAGE(`curs_util.3x') + + -- | Not implemented : filter, use_env + -- | putwin, getwin are in the child package PutWin + -- + + -- ANCHOR(`keyname()',`Key_Name') + procedure Key_Name (Key : Real_Key_Code; + Name : out String); + -- AKA + -- The external name for a real keystroke. + + -- ANCHOR(`keyname()',`Key_Name') + function Key_Name (Key : Real_Key_Code) return String; + -- AKA + -- Same as function + -- We don't inline this routine + + -- ANCHOR(`unctrl()',`Un_Control') + procedure Un_Control (Ch : Attributed_Character; + Str : out String); + -- AKA + + -- ANCHOR(`unctrl()',`Un_Control') + function Un_Control (Ch : Attributed_Character) return String; + -- AKA + -- Same as function + pragma Inline (Un_Control); + + -- ANCHOR(`delay_output()',`Delay_Output') + procedure Delay_Output (Msecs : Natural); + -- AKA + pragma Inline (Delay_Output); + + -- ANCHOR(`flushinp()',`Flush_Input') + procedure Flush_Input; + -- AKA + pragma Inline (Flush_Input); + + -- MANPAGE(`curs_termattrs.3x') + + -- ANCHOR(`baudrate()',`Baudrate') + function Baudrate return Natural; + -- AKA + pragma Inline (Baudrate); + + -- ANCHOR(`erasechar()',`Erase_Character') + function Erase_Character return Character; + -- AKA + pragma Inline (Erase_Character); + + -- ANCHOR(`killchar()',`Kill_Character') + function Kill_Character return Character; + -- AKA + pragma Inline (Kill_Character); + + -- ANCHOR(`has_ic()',`Has_Insert_Character') + function Has_Insert_Character return Boolean; + -- AKA + pragma Inline (Has_Insert_Character); + + -- ANCHOR(`has_il()',`Has_Insert_Line') + function Has_Insert_Line return Boolean; + -- AKA + pragma Inline (Has_Insert_Line); + + -- ANCHOR(`termattrs()',`Supported_Attributes') + function Supported_Attributes return Character_Attribute_Set; + -- AKA + pragma Inline (Supported_Attributes); + + -- ANCHOR(`longname()',`Long_Name') + procedure Long_Name (Name : out String); + -- AKA + + -- ANCHOR(`longname()',`Long_Name') + function Long_Name return String; + -- AKA + -- Same as function + pragma Inline (Long_Name); + + -- ANCHOR(`termname()',`Terminal_Name') + procedure Terminal_Name (Name : out String); + -- AKA + + -- ANCHOR(`termname()',`Terminal_Name') + function Terminal_Name return String; + -- AKA + -- Same as function + pragma Inline (Terminal_Name); + + -- MANPAGE(`curs_color.3x') + + -- COLOR_PAIR + -- COLOR_PAIR(n) in C is the same as + -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video) + -- In C you often see something like c = c | COLOR_PAIR(n); + -- This is equivalent to c.Color := n; + + -- ANCHOR(`start_color()',`Start_Color') + procedure Start_Color; + -- AKA + pragma Import (C, Start_Color, "start_color"); + + -- ANCHOR(`init_pair()',`Init_Pair') + procedure Init_Pair (Pair : Redefinable_Color_Pair; + Fore : Color_Number; + Back : Color_Number); + -- AKA + pragma Inline (Init_Pair); + + -- ANCHOR(`pair_content()',`Pair_Content') + procedure Pair_Content (Pair : Color_Pair; + Fore : out Color_Number; + Back : out Color_Number); + -- AKA + pragma Inline (Pair_Content); + + -- ANCHOR(`has_colors()',`Has_Colors') + function Has_Colors return Boolean; + -- AKA + pragma Inline (Has_Colors); + + -- ANCHOR(`init_color()',`Init_Color') + procedure Init_Color (Color : Color_Number; + Red : RGB_Value; + Green : RGB_Value; + Blue : RGB_Value); + -- AKA + pragma Inline (Init_Color); + + -- ANCHOR(`can_change_color()',`Can_Change_Color') + function Can_Change_Color return Boolean; + -- AKA + pragma Inline (Can_Change_Color); + + -- ANCHOR(`color_content()',`Color_Content') + procedure Color_Content (Color : Color_Number; + Red : out RGB_Value; + Green : out RGB_Value; + Blue : out RGB_Value); + -- AKA + pragma Inline (Color_Content); + + -- MANPAGE(`curs_kernel.3x') + -- | Not implemented: getsyx, setsyx + -- + type Curses_Mode is (Curses, Shell); + + -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode') + procedure Save_Curses_Mode (Mode : Curses_Mode); + -- AKA + -- ALIAS(`def_shell_mode()') + pragma Inline (Save_Curses_Mode); + + -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode') + procedure Reset_Curses_Mode (Mode : Curses_Mode); + -- AKA + -- ALIAS(`reset_shell_mode()') + pragma Inline (Reset_Curses_Mode); + + -- ANCHOR(`savetty()',`Save_Terminal_State') + procedure Save_Terminal_State; + -- AKA + pragma Inline (Save_Terminal_State); + + -- ANCHOR(`resetty();',`Reset_Terminal_State') + procedure Reset_Terminal_State; + -- AKA + pragma Inline (Reset_Terminal_State); + + type Stdscr_Init_Proc is access + function (Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, Stdscr_Init_Proc); + -- N.B.: the return value is actually ignored, but it seems to be + -- a good practice to return 0 if you think all went fine + -- and -1 otherwise. + + -- ANCHOR(`ripoffline()',`Rip_Off_Lines') + procedure Rip_Off_Lines (Lines : Integer; + Proc : Stdscr_Init_Proc); + -- AKA + -- N.B.: to be more precise, this uses a ncurses specific enhancement of + -- ripoffline(), in which the Lines argument absolute value is the + -- number of lines to be ripped of. The official ripoffline() only + -- uses the sign of Lines to rip of a single line from bottom or top. + pragma Inline (Rip_Off_Lines); + + type Cursor_Visibility is (Invisible, Normal, Very_Visible); + + -- ANCHOR(`curs_set()',`Set_Cursor_Visibility') + procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility); + -- AKA + pragma Inline (Set_Cursor_Visibility); + + -- ANCHOR(`napms()',`Nap_Milli_Seconds') + procedure Nap_Milli_Seconds (Ms : Natural); + -- AKA + pragma Inline (Nap_Milli_Seconds); + + -- |===================================================================== + -- | Some useful helpers. + -- |===================================================================== + type Transform_Direction is (From_Screen, To_Screen); + procedure Transform_Coordinates + (W : Window := Standard_Window; + Line : in out Line_Position; + Column : in out Column_Position; + Dir : Transform_Direction := From_Screen); + -- This procedure transforms screen coordinates into coordinates relative + -- to the window and vice versa, depending on the Dir parameter. + -- Screen coordinates are the position informations on the physical device. + -- An Curses_Exception will be raised if Line and Column are not in the + -- Window or if you pass the Null_Window as argument. + -- We don't inline this procedure + + -- MANPAGE(`default_colors.3x') + + -- ANCHOR(`use_default_colors()',`Use_Default_Colors') + procedure Use_Default_Colors; + -- AKA + pragma Inline (Use_Default_Colors); + + -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors') + procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; + Back : Color_Number := Default_Color); + -- AKA + pragma Inline (Assume_Default_Colors); + + -- MANPAGE(`curs_extend.3x') + + -- ANCHOR(`curses_version()',`Curses_Version') + function Curses_Version return String; + -- AKA + + -- ANCHOR(`use_extended_names()',`Use_Extended_Names') + -- The returnvalue is the previous setting of the flag + function Use_Extended_Names (Enable : Boolean) return Boolean; + -- AKA + + -- MANPAGE(`curs_trace.3x') + + -- ANCHOR(`_nc_freeall()',`Curses_Free_All') + procedure Curses_Free_All; + -- AKA + + -- MANPAGE(`curs_scr_dump.3x') + + -- ANCHOR(`scr_dump()',`Screen_Dump_To_File') + procedure Screen_Dump_To_File (Filename : String); + -- AKA + + -- ANCHOR(`scr_restore()',`Screen_Restore_From_File') + procedure Screen_Restore_From_File (Filename : String); + -- AKA + + -- ANCHOR(`scr_init()',`Screen_Init_From_File') + procedure Screen_Init_From_File (Filename : String); + -- AKA + + -- ANCHOR(`scr_set()',`Screen_Set_File') + procedure Screen_Set_File (Filename : String); + -- AKA + + -- MANPAGE(`curs_print.3x') + -- Not implemented: mcprint + + -- MANPAGE(`curs_printw.3x') + -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw, + -- vw_printw + -- Please use the Ada style Text_IO child packages for formatted + -- printing. It doesn't make a lot of sense to map the printf style + -- C functions to Ada. + + -- MANPAGE(`curs_scanw.3x') + -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw + + -- MANPAGE(`resizeterm.3x') + -- Not Implemented: resizeterm + + -- MANPAGE(`wresize.3x') + + -- ANCHOR(`wresize()',`Resize') + procedure Resize (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count); + -- AKA + +private + type Window is new System.Storage_Elements.Integer_Address; + Null_Window : constant Window := 0; + + -- The next constants are generated and may be different on your + -- architecture. + -- +include(`Window_Offsets')dnl + Curses_Bool_False : constant Curses_Bool := 0; + +end Terminal_Interface.Curses; diff --git a/Ada95/include/MKncurses_def.sh b/Ada95/include/MKncurses_def.sh new file mode 100755 index 00000000000..4aac86554b5 --- /dev/null +++ b/Ada95/include/MKncurses_def.sh @@ -0,0 +1,80 @@ +#! /bin/sh +# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $ +############################################################################## +# Copyright (c) 2000 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "Software"), # +# 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. # +############################################################################## +# +# MKncurses_def.sh -- generate fallback definitions for ncurses_cfg.h +# +# Author: Thomas E. Dickey 2000 +# +# Given the choice between constructs such as +# +# #if defined(foo) && foo +# #if foo +# +# we chose the latter. It is guaranteed by the language standard, and there +# appear to be no broken compilers that do not honor that detail. But some +# people want to use gcc's -Wundef option (corresponding to one of the less +# useful features in Watcom's compiler) to check for misspellings. So we +# generate a set of fallback definitions to quiet the warnings without making +# the code ugly. +# +DEFS="${1-ncurses_defs}" +cat <$@ + +tags: + ctags *.[ch] + +@MAKE_UPPER_TAGS@TAGS: +@MAKE_UPPER_TAGS@ etags *.[ch] + +mostlyclean :: + -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace + +clean :: mostlyclean + -rm -f $(AUTO_SRC) + +distclean :: clean + -rm -f Makefile + +realclean :: distclean + +############################################################################### +# The remainder of this file is automatically generated during configuration +############################################################################### diff --git a/Ada95/include/ncurses_cfg.hin b/Ada95/include/ncurses_cfg.hin new file mode 100644 index 00000000000..3f8a482a5d8 --- /dev/null +++ b/Ada95/include/ncurses_cfg.hin @@ -0,0 +1,72 @@ +/**************************************************************************** + * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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 1997 * + ****************************************************************************/ +/* + * $Id: ncurses_cfg.hin,v 1.7 2005/01/02 01:26:58 tom Exp $ + * + * This is a template-file used to generate the "ncurses_cfg.h" file. + * + * Rather than list every definition, the configuration script substitutes the + * definitions that it finds using 'sed'. You need a patch (original date + * 971222) to autoconf 2.12 or 2.13 to do this. + * + * See: + * http://invisible-island.net/autoconf/ + * ftp://invisible-island.net/autoconf/ + */ +#ifndef NC_CONFIG_H +#define NC_CONFIG_H +@DEFS@ + +#include + + /* The C compiler may not treat these properly but C++ has to */ +#ifdef __cplusplus +#undef const +#undef inline +#else +#if defined(lint) || defined(TRACE) +#undef inline +#define inline /* nothing */ +#endif +#endif + + /* On HP-UX, the C compiler doesn't grok mbstate_t without + -D_XOPEN_SOURCE=500. However, this causes problems on + IRIX. So, we #define mbstate_t to int in configure.in + only for the C compiler if needed. */ +#ifndef __cplusplus +#ifdef NEED_MBSTATE_T_DEF +#define mbstate_t int +#endif +#endif + +#endif /* NC_CONFIG_H */ diff --git a/Ada95/include/ncurses_defs b/Ada95/include/ncurses_defs new file mode 100644 index 00000000000..b07f5f1f7bd --- /dev/null +++ b/Ada95/include/ncurses_defs @@ -0,0 +1,207 @@ +# $Id: ncurses_defs,v 1.41 2008/11/16 00:19:59 juergen Exp $ +############################################################################## +# Copyright (c) 2000-2007,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 "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. # +############################################################################## +# +# See "MKncurses_def.sh" for an explanation. +# +# (hint: don't try to define NDEBUG ;-) + +BROKEN_LINKER +BSD_TPUTS +CC_HAS_PROTOS +CPP_HAS_PARAM_INIT +CURSES_ACS_ARRAY acs_map +CURSES_WACS_ARRAY _nc_wacs +DECL_ERRNO +ETIP_NEEDS_MATH_H +GCC_NORETURN /* nothing */ +GCC_UNUSED /* nothing */ +HAVE_BIG_CORE +HAVE_BSD_CGETENT +HAVE_BSD_SIGNAL_H +HAVE_BTOWC +HAVE_BUILTIN_H +HAVE_CHGAT 1 +HAVE_COLOR_SET 1 +HAVE_DIRENT_H +HAVE_ERRNO +HAVE_FCNTL_H +HAVE_FILTER 1 +HAVE_FORM_H +HAVE_GETBEGX 1 +HAVE_GETCURX 1 +HAVE_GETCWD +HAVE_GETEGID +HAVE_GETEUID +HAVE_GETMAXX 1 +HAVE_GETNSTR +HAVE_GETOPT_H +HAVE_GETPARX 1 +HAVE_GETTIMEOFDAY +HAVE_GETTTYNAM +HAVE_GETWIN 1 +HAVE_GPM_H +HAVE_GPP_BUILTIN_H +HAVE_GXX_BUILTIN_H +HAVE_HAS_KEY +HAVE_IOSTREAM +HAVE_ISASCII +HAVE_ISSETUGID +HAVE_LANGINFO_CODESET +HAVE_LIBC_H +HAVE_LIBDBMALLOC +HAVE_LIBDMALLOC +HAVE_LIBFORM +HAVE_LIBGPM +HAVE_LIBMENU +HAVE_LIBMPATROL +HAVE_LIBPANEL +HAVE_LIMITS_H +HAVE_LINK +HAVE_LOCALE_H +HAVE_LONG_FILE_NAMES +HAVE_MBLEN +HAVE_MBRLEN +HAVE_MBRTOWC +HAVE_MBSRTOWCS +HAVE_MBSTOWCS +HAVE_MBTOWC +HAVE_MENU_H +HAVE_MKSTEMP +HAVE_MVVLINE 1 +HAVE_MVWVLINE 1 +HAVE_NANOSLEEP +HAVE_NC_ALLOC_H +HAVE_PANEL_H +HAVE_POLL +HAVE_POLL_H +HAVE_PURIFY +HAVE_PUTWC +HAVE_PUTWIN 1 +HAVE_REGEXPR_H_FUNCS +HAVE_REGEXP_H_FUNCS +HAVE_REGEX_H_FUNCS +HAVE_REMOVE +HAVE_RESIZETERM +HAVE_RESIZE_TERM +HAVE_RIPOFFLINE 1 +HAVE_SELECT +HAVE_SETBUF +HAVE_SETBUFFER +HAVE_SETUPTERM 1 +HAVE_SETVBUF +HAVE_SIGACTION +HAVE_SIGVEC +HAVE_SIZECHANGE +HAVE_SLK_COLOR +HAVE_SLK_INIT 1 +HAVE_STRDUP +HAVE_STRSTR +HAVE_SYMLINK +HAVE_SYS_BSDTYPES_H +HAVE_SYS_IOCTL_H +HAVE_SYS_PARAM_H +HAVE_SYS_POLL_H +HAVE_SYS_SELECT_H +HAVE_SYS_TERMIO_H +HAVE_SYS_TIMES_H +HAVE_SYS_TIME_H +HAVE_SYS_TIME_SELECT +HAVE_TCGETATTR +HAVE_TCGETPGRP +HAVE_TELL +HAVE_TERMATTRS 1 +HAVE_TERMIOS_H +HAVE_TERMIO_H +HAVE_TERMNAME 1 +HAVE_TERM_H 1 +HAVE_TGETENT 1 +HAVE_TIGETNUM 1 +HAVE_TIGETSTR 1 +HAVE_TIMES +HAVE_TTYENT_H +HAVE_TYPEAHEAD 1 +HAVE_TYPEINFO +HAVE_TYPE_ATTR_T +HAVE_TYPE_SIGACTION +HAVE_UNISTD_H +HAVE_UNLINK +HAVE_USE_DEFAULT_COLORS +HAVE_VFSCANF +HAVE_VSNPRINTF +HAVE_VSSCANF +HAVE_WCSRTOMBS +HAVE_WCSTOMBS +HAVE_WCTOB +HAVE_WCTOMB +HAVE_WCTYPE_H +HAVE_WINSSTR 1 +HAVE_WORKING_POLL +HAVE_WRESIZE +HAVE__DOSCAN +MIXEDCASE_FILENAMES +NCURSES_CHAR_EQ +NCURSES_EXPANDED +NCURSES_EXT_COLORS +NCURSES_EXT_FUNCS +NCURSES_NO_PADDING +NCURSES_PATHSEP ':' +NEED_PTEM_H +NO_LEAKS +PURE_TERMINFO +RETSIGTYPE +STDC_HEADERS +SVR4_ACTION +SVR4_TERMIO +SYSTEM_NAME "unknown" +TERMINFO "none" +TERMPATH "none" +TIME_WITH_SYS_TIME +TYPEOF_CHTYPE +USE_COLORFGBG +USE_DATABASE +USE_GETCAP +USE_GETCAP_CACHE +USE_HARD_TABS +USE_HASHED_DB +USE_HASHMAP +USE_HOME_TERMINFO +USE_LINKS +USE_MY_MEMMOVE +USE_OK_BCOPY +USE_RCS_IDS +USE_REENTRANT +USE_SAFE_SPRINTF +USE_SCROLL_HINTS +USE_SIGWINCH +USE_SYMLINKS +USE_SYSMOUSE +USE_TERMCAP +USE_WEAK_SYMBOLS +USE_WIDEC_SUPPORT +USE_XMC_SUPPORT diff --git a/Ada95/make-tar.sh b/Ada95/make-tar.sh new file mode 100755 index 00000000000..a2498fb3ecb --- /dev/null +++ b/Ada95/make-tar.sh @@ -0,0 +1,90 @@ +#!/bin/sh +# $Id: make-tar.sh,v 1.6 2010/11/06 19:59:07 tom Exp $ +############################################################################## +# Copyright (c) 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"), # +# 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. # +############################################################################## +# Construct a tar-file containing only the Ada95 tree as well as its associated +# documentation. The reason for doing that is to simplify distributing the +# ada binding as a separate package. + +TARGET=`pwd` + +: ${ROOTNAME:=ncurses-Ada95} +: ${DESTDIR:=$TARGET} +: ${TMPDIR:=/tmp} + +# This can be run from either the Ada95 subdirectory, or from the top-level +# source directory. We will put the tar file in the original directory. +test -d ./Ada95 && cd ./Ada95 + +BUILD=$TMPDIR/make-tar$$ +trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15 + +umask 077 +if ! ( mkdir $BUILD ) +then + echo "? cannot make build directory $BUILD" +fi + +umask 022 +mkdir $BUILD/$ROOTNAME + +cp -p -r * $BUILD/$ROOTNAME/ || exit + +# Add the config.* utility scripts from the top-level directory. +for i in . .. +do + for j in config.guess config.sub install-sh tar-copy.sh + do + test -f $i/$j && cp -p $i/$j $BUILD/$ROOTNAME/ + done +done + +# Add the ada documentation. +mkdir $BUILD/$ROOTNAME/doc || exit +cd ../doc/html || exit + +cp -p -r Ada* $BUILD/$ROOTNAME/doc/ +cp -p -r ada $BUILD/$ROOTNAME/doc/ + +cd $BUILD || exit + +# There is no need for this script in the tar file. +rm -f $ROOTNAME/make-tar.sh + +# Remove build-artifacts. +find . -name RCS -exec rm -rf {} \; +find . -name "*.gz" -exec rm -rf {} \; + +# Make the files writable... +chmod -R u+w . + +tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz +cd $DESTDIR + +pwd +ls -l $ROOTNAME.tar.gz diff --git a/Ada95/mk-1st.awk b/Ada95/mk-1st.awk new file mode 100644 index 00000000000..77265497152 --- /dev/null +++ b/Ada95/mk-1st.awk @@ -0,0 +1,90 @@ +# $Id: mk-1st.awk,v 1.4 2011/02/22 09:40:01 tom Exp $ +############################################################################## +# Copyright (c) 2010,2011 Free 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 +# +# Generate compile-rules for the Ada95 modules that we are using in libraries +# or programs. This script is used for older versions of gnatmake, which do +# not build libraries reliably, e.g., gnatmake 3.15. +# +# Fields in src/modules: +# $1 = module name +# $2 = directory where spec-dependency ".ads" is found +# $3 = directory where body-dependency ".adb" is found +# $4 = unit to compile (spec or body) +# +BEGIN { + printf "\n"; + printf "# generated by Ada95/mk-1st.awk\n"; + } + /^[#]/ { + next + } + /^$/ { + next + } + { + printf "\n"; + printf "%s.o :", $1; + + if ( $2 == "none" ) { + pre_spec = ""; + } else if ( $2 == "." ) { + pre_spec = ""; + printf " \\\n\t\t%s.ads", $1; + } else { + pre_spec = sprintf("%s/", $2); + printf " \\\n\t\t%s%s.ads", pre_spec, $1; + } + + if ( $3 == "none" ) { + pre_body = ""; + } else if ( $3 == "." ) { + pre_body = ""; + printf " \\\n\t\t%s.adb", $1; + } else { + pre_body = sprintf("%s/", $3); + printf " \\\n\t\t%s%s.adb", pre_body, $1; + printf " \\\n\t\t$(BASEDEPS)"; + } + + if ( $4 == "spec" ) { + suffix = "ads"; + prefix = pre_spec; + } else { + suffix = "adb"; + prefix = pre_body; + } + + printf "\n"; + printf "\t$(ADA) $(ADAFLAGS) -c -o $@ %s%s.%s\n", prefix, $1, suffix + } +END { + print "" + } diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in new file mode 100644 index 00000000000..3d1554c7211 --- /dev/null +++ b/Ada95/samples/Makefile.in @@ -0,0 +1,133 @@ +############################################################################## +# Copyright (c) 1998-2009,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"), # +# 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: Juergen Pfeifer, 1996 +# +# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $ +# +.SUFFIXES: + +SHELL = /bin/sh +VPATH = @srcdir@ +THIS = Makefile + +x = @PROG_EXT@ + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AWK = @AWK@ +LN_S = @LN_S@ + +CC = @CC@ +CFLAGS = @CFLAGS@ + +CPPFLAGS = @ACPPFLAGS@ \ + -DHAVE_CONFIG_H -I$(srcdir) + +CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +REL_VERSION = @cf_cv_rel_version@ +ABI_VERSION = @cf_cv_abi_version@ +LOCAL_LIBDIR = @top_builddir@/lib + +LINK = $(CC) +LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + +RANLIB = @RANLIB@ +################################################################################ +ada_srcdir=../src + +LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) + +ADA = @cf_ada_compiler@ +ADAFLAGS = @ADAFLAGS@ -I$(srcdir) + +ADAMAKE = @cf_ada_make@ +ADAMAKEFLAGS = -a -A$(srcdir) -A$(ada_srcdir) -A$(srcdir)/$(ada_srcdir) + +ALIB = @cf_ada_package@ +ABASE = $(ALIB)-curses + +CARGS =-cargs $(ADAFLAGS) +LARGS =-largs @TEST_ARG2@ $(LD_FLAGS) -L../lib -lAdaCurses @TEST_LIBS2@ + +PROGS = tour rain ncurses + +all :: tour$x rain$x ncurses$x + @echo made $@ + +sources : + @echo made $@ + +libs \ +install \ +install.libs :: + @echo made $@ + +uninstall \ +uninstall.libs :: + @echo made $@ + +ncurses$x : + $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS) + +tour$x : explain.msg + $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) + +explain.msg: $(srcdir)/explain.txt + cp $(srcdir)/explain.txt $@ + +rain$x : + $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS) + +mostlyclean: + @echo made $@ + +clean :: mostlyclean + rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ + explain.msg trace screendump b~*.ad[bs] + +distclean :: clean + rm -f Makefile + +realclean :: distclean + @echo made $@ diff --git a/Ada95/samples/README b/Ada95/samples/README new file mode 100644 index 00000000000..c4f16ad306d --- /dev/null +++ b/Ada95/samples/README @@ -0,0 +1,35 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 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 -- +-- "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: README,v 1.2 2006/04/22 22:24:12 tom Exp $ +------------------------------------------------------------------------------- + +The intention of the demo at this point in time is not to demonstrate all +the features of (n)curses and its subsystems, but to give some sample +sources how to use the binding at all. + +Ideally in the future we can combine both goals. diff --git a/Ada95/samples/explain.txt b/Ada95/samples/explain.txt new file mode 100644 index 00000000000..570f617bf92 --- /dev/null +++ b/Ada95/samples/explain.txt @@ -0,0 +1,186 @@ +#VERSION +This is Version 00.90.00 of the demo package. +#MENUKEYS +In a menu you can use the following Keys in the whole application: + + - CTRL-X eXit the menu + - CTRL-N Go to next item + - CTRL-P Go to previous item + - CTRL-U Scroll up one line + - CTRL-D Scroll down one line + - CTRL-F Scroll down one page + - PAGE DOWN Scroll down one page + - PAGE UP Scroll back one page + - CTRL-B Scroll back one page + - CTRL-Y Clear pattern + - CTRL-H Delete last character from pattern + - Backspace Delete last character from pattern + - CTRL-A Next pattern match + - CTRL-E Previous pattern match + - CTRL-T Toggle item in a multi-selection menu + - CR or LF Select an item + - HOME Key Go to the first item + - F3 Quit the menu + - Cursor Down Down one item + - Cursor Up Up one item + - Cursor Left Left one item + - Cursor Right Right one item + - END Key Go to last item +#FORMKEYS + - CTRL-X eXit the form + - CTRL-F Go forward to the next field + - CTRL-B Go backward to the previous field + - CTRL-L Go to the field left of the current one + - CTRL-R Go to the field right of the current one + - CTRL-U Go to the field above the current one + - CTRL-D Go to the field below the current one + + - CTRL-W Go to the next word in the field + - CTRL-T Go to the previous word in the field + + - CTRL-A Go to the beginning of the field + - CTRL-E Go to the end of the field + + - CTRL-I Insert a blank character at the current position + - CTRL-O Insert a line + - CTRL-V Delete a character + - CTRL-H Delete previous character + - CTRL-Y Delete a line + - CTRL-G Delete a word + - CTRL-K Clear to end of field + + - CTRL-N Next choice in a choice field (Enumerations etc.) + - CTRL-P Previous choice in a choice field. +#HELP +#HELPKEYS +You may scroll with the Cursor Up/Down Keys. +You may leave the help with the Function Key labelled 'Quit'. +#INHELP +You are already in the help system. +You may leave the help with the Function Key labelled 'Quit'. +#MAIN +This is the main menu of the sample program for the ncurses Ada95 +binding. The main intention of the demo is not to demonstate or +test all the features of ncurses and it's subsystems, but to provide +to you some sample code how to use the binding with Ada95. + +You may select this options: + + * Look at some ncurses core functions + * Look at some features of the menu subsystem + * Look at some features of the form subsystem + * Look at the output of the Ada.Text_IO like functions + for ncurses. + +#MAINPAD +You may press at any place in this demo CTRL-C. This will give you a command +window. You can just type in the Label-String of a function key, then this +key will be simulated. This should help you to run the application even if +you run it on a terminal with no or only a few function keys. With CTRL-N +and CTRL-P you may browse through the possible values in the command window. +#MENU00 +Here we give you a selection of various menu demonstrations. +#MENU-PAD00 +This menu itself is a demo for a single valued, 1-column menu with +descriptions for the items, a marker and a padding character between +the item name and the description. +#MENU01 +This is a demo of the some of the menu layout options. One of them +is the spacing functionality. Just press the Key labelled "Flip" to +flip between the non-spaced and a spaced version of the menu. Please +note that this functionality is unique for ncurses and is not found +in the SVr4 menu implementation. + +This is a menu that sometimes doesn't fit into it's window and +therefore it becomes a scroll menu. + +You can also see here very nicely the pattern matching functionality +of menus. Type for example a 'J' and you will be positioned to the +next item after the current starting with a 'J'. Any more characters +you type in make the pattern more specific. With CTRL-A and CTRL-Z +(for more details press the Key labelled "Keys") you can browse +through all the items matching the pattern. + +You may change the format of the menu. Just press one of the keys +labelled "4x1", "4x2" or "4x3" to get a menu with that many rows +and columns. + +With the Keys "O-Row" or "O-Col" (they occupy the same label and +switch on selection) you can change the major order scheme for +the menu. If "O-Col" is visible, the menu is currently major +ordered by rows, you can switch to major column order by pressing +the key. If "O-Row" is visible, it's just the reverse situation. +This Key is not visible in "4x1" layout mode, because in this case +the functionality makes no sense. + +With the Keys "Multi" or "Singl" (they occupy the same label and +switch on selection) you can change whether or not the menu allows +multiple or only single selection. + +With the Keys "+Desc" or "-Desc" (they occupy the same label and +switch on selection) you can change whether or not the descriptions +for each item should be displayed. Please not that this key is +not visible in the "4x3" layout mode, because in this case the +menu wouldn't fit on a typicall 80x24 screen. + +With the Keys "Disab" or "Enab" (they occupy the same label and +switch on selection) you can dis- or enable the selectability of +the month with 31 days. +#MENU-PAD01 +You may press "Flip" to see the effect of ncurses unique menu-spacing. +The Keys "4x1", "4x2" and "4x3" will change the format of the menu. +Please note that this is a scrolling menu. You may also play with the +pattern matching functionality or try to change the format of the menu. +For more details press the Key labelled "Help". +#FORM00 +This is a demo of the forms package. +#FORM-PAD00 +Please note that this demo is far from being complete. It really shows +only a small part of the functionality of the forms package. Let's hope +the next version will have a richer demo (You wan't to contribute ?). +#NOTIMPL +Sorry this functionality of the demo is not implemented at the moment. +Remember this is a freeware project, so I can use only my very rare +free time to continue coding. If you would like to contribute, you +are very welcome ! +#CURSES00 +This is a menu where you can select some different demos of the ncurses +functionality. +#CURSES-PAD00 +Please note that this demo is far from being complete. It really shows +only a small part of the functionality of the curses package. Let's hope +the next version will have a richer demo (You wan't to contribute ?). +#MOUSEKEYS +In this demo you may use this keys: + + - Key labelled "Help" to get a help + - Key labelled "Keys" is what you are reading now + - Key labelled "Quit" to leave the demo + +You may click the mouse buttons at any location at the screen and look +at the protocol window ! +#MOUSE00 +A rather simple use of a mouse as demo. It's there just to test the +code and to provide the sample source. + +It might be of interest, that the output into the protocol window is +done by the (n)curses Text_IO subpackages. Especially the output of +the button and state names is done by Ads's enumeration IO, which +allows you to print the names of enumeration literals. That's really +nice. +#MOUSE-PAD00 +This is a very simple demo of the mouse features of ncurses. It's there +just to test whether or not the generated code for the binding really +works on the different architectures (seems so). +#ATTRIBDEMO +Again this is a more than simple demo and just here to give you the +sourcecode. +#ATTRIBKEYS +You may press one of the three well known standard keys of this demo. +#ATTRIB-PAD00 +Again this is a more than simple demo and just here to give you the +sourcecode. Feel free to contribute more. +#TEXTIO +#TEXTIOKEYS +#TEXTIO-PAD00 +#END diff --git a/Ada95/samples/ncurses.adb b/Ada95/samples/ncurses.adb new file mode 100644 index 00000000000..19f658d5632 --- /dev/null +++ b/Ada95/samples/ncurses.adb @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.m; use ncurses2.m; +with GNAT.OS_Lib; use GNAT.OS_Lib; + +procedure ncurses is +begin + OS_Exit (main); +end ncurses; diff --git a/Ada95/samples/ncurses2-acs_and_scroll.adb b/Ada95/samples/ncurses2-acs_and_scroll.adb new file mode 100644 index 00000000000..5d965983b84 --- /dev/null +++ b/Ada95/samples/ncurses2-acs_and_scroll.adb @@ -0,0 +1,714 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.9 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- Windows and scrolling tester. +-- Demonstrate windows + +with Ada.Strings.Fixed; +with Ada.Strings; + +with ncurses2.util; use ncurses2.util; +with ncurses2.genericPuts; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; +with Terminal_Interface.Curses.PutWin; use Terminal_Interface.Curses.PutWin; + +with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; +with Ada.Streams; use Ada.Streams; + +procedure ncurses2.acs_and_scroll is + + Macro_Quit : constant Key_Code := Character'Pos ('Q') mod 16#20#; + Macro_Escape : constant Key_Code := Character'Pos ('[') mod 16#20#; + + Quit : constant Key_Code := CTRL ('Q'); + Escape : constant Key_Code := CTRL ('['); + + Botlines : constant Line_Position := 4; + + type pair is record + y : Line_Position; + x : Column_Position; + end record; + + type Frame; + type FrameA is access Frame; + + f : File_Type; + dumpfile : constant String := "screendump"; + + procedure Outerbox (ul, lr : pair; onoff : Boolean); + function HaveKeyPad (w : Window) return Boolean; + function HaveScroll (w : Window) return Boolean; + procedure newwin_legend (curpw : Window); + procedure transient (curpw : Window; msg : String); + procedure newwin_report (win : Window := Standard_Window); + procedure selectcell (uli : Line_Position; + ulj : Column_Position; + lri : Line_Position; + lrj : Column_Position; + p : out pair; + b : out Boolean); + function getwindow return Window; + procedure newwin_move (win : Window; + dy : Line_Position; + dx : Column_Position); + function delete_framed (fp : FrameA; showit : Boolean) return FrameA; + + -- A linked list + -- I wish there was a standard library linked list. Oh well. + type Frame is record + next, last : FrameA; + do_scroll : Boolean; + do_keypad : Boolean; + wind : Window; + end record; + + current : FrameA; + + c : Key_Code; + + procedure Outerbox (ul, lr : pair; onoff : Boolean) is + begin + if onoff then + -- Note the fix of an obscure bug + -- try making a 1x1 box then enlarging it, the is a blank + -- upper left corner! + Add (Line => ul.y - 1, Column => ul.x - 1, + Ch => ACS_Map (ACS_Upper_Left_Corner)); + Add (Line => ul.y - 1, Column => lr.x + 1, + Ch => ACS_Map (ACS_Upper_Right_Corner)); + Add (Line => lr.y + 1, Column => lr.x + 1, + Ch => ACS_Map (ACS_Lower_Right_Corner)); + Add (Line => lr.y + 1, Column => ul.x - 1, + Ch => ACS_Map (ACS_Lower_Left_Corner)); + + Move_Cursor (Line => ul.y - 1, Column => ul.x); + Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => ul.x - 1); + Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), + Line_Size => Integer (lr.y - ul.y) + 1); + Move_Cursor (Line => lr.y + 1, Column => ul.x); + Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => lr.x + 1); + Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), + Line_Size => Integer (lr.y - ul.y) + 1); + else + Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ' '); + Add (Line => ul.y - 1, Column => lr.x + 1, Ch => ' '); + Add (Line => lr.y + 1, Column => lr.x + 1, Ch => ' '); + Add (Line => lr.y + 1, Column => ul.x - 1, Ch => ' '); + + Move_Cursor (Line => ul.y - 1, Column => ul.x); + Horizontal_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => ul.x - 1); + Vertical_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.y - ul.y) + 1); + Move_Cursor (Line => lr.y + 1, Column => ul.x); + Horizontal_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.x - ul.x) + 1); + Move_Cursor (Line => ul.y, Column => lr.x + 1); + Vertical_Line (Line_Symbol => Blank2, + Line_Size => Integer (lr.y - ul.y) + 1); + end if; + end Outerbox; + + function HaveKeyPad (w : Window) return Boolean is + begin + return Get_KeyPad_Mode (w); + exception + when Curses_Exception => return False; + end HaveKeyPad; + + function HaveScroll (w : Window) return Boolean is + begin + return Scrolling_Allowed (w); + exception + when Curses_Exception => return False; + end HaveScroll; + + procedure newwin_legend (curpw : Window) is + + package p is new genericPuts (200); + use p; + use p.BS; + + type string_a is access String; + + type rrr is record + msg : string_a; + code : Integer range 0 .. 3; + end record; + + legend : constant array (Positive range <>) of rrr := + ( + ( + new String'("^C = create window"), 0 + ), + ( + new String'("^N = next window"), 0 + ), + ( + new String'("^P = previous window"), 0 + ), + ( + new String'("^F = scroll forward"), 0 + ), + ( + new String'("^B = scroll backward"), 0 + ), + ( + new String'("^K = keypad(%s)"), 1 + ), + ( + new String'("^S = scrollok(%s)"), 2 + ), + ( + new String'("^W = save window to file"), 0 + ), + ( + new String'("^R = restore window"), 0 + ), + ( + new String'("^X = resize"), 0 + ), + ( + new String'("^Q%s = exit"), 3 + ) + ); + + buf : Bounded_String; + do_keypad : constant Boolean := HaveKeyPad (curpw); + do_scroll : constant Boolean := HaveScroll (curpw); + + pos : Natural; + + mypair : pair; + + use Ada.Strings.Fixed; + + begin + Move_Cursor (Line => Lines - 4, Column => 0); + for n in legend'Range loop + pos := Ada.Strings.Fixed.Index (Source => legend (n).msg.all, + Pattern => "%s"); + -- buf := (others => ' '); + buf := To_Bounded_String (legend (n).msg.all); + case legend (n).code is + when 0 => null; + when 1 => + if do_keypad then + Replace_Slice (buf, pos, pos + 1, "yes"); + else + Replace_Slice (buf, pos, pos + 1, "no"); + end if; + when 2 => + if do_scroll then + Replace_Slice (buf, pos, pos + 1, "yes"); + else + Replace_Slice (buf, pos, pos + 1, "no"); + end if; + when 3 => + if do_keypad then + Replace_Slice (buf, pos, pos + 1, "/ESC"); + else + Replace_Slice (buf, pos, pos + 1, ""); + end if; + end case; + Get_Cursor_Position (Line => mypair.y, Column => mypair.x); + if Columns < mypair.x + 3 + Column_Position (Length (buf)) then + Add (Ch => newl); + elsif n /= 1 then -- n /= legen'First + Add (Str => ", "); + end if; + myAdd (Str => buf); + end loop; + Clear_To_End_Of_Line; + end newwin_legend; + + procedure transient (curpw : Window; msg : String) is + begin + newwin_legend (curpw); + if msg /= "" then + Add (Line => Lines - 1, Column => 0, Str => msg); + Refresh; + Nap_Milli_Seconds (1000); + end if; + + Move_Cursor (Line => Lines - 1, Column => 0); + + if HaveKeyPad (curpw) then + Add (Str => "Non-arrow"); + else + Add (Str => "All other"); + end if; + Add (Str => " characters are echoed, window should "); + if not HaveScroll (curpw) then + Add (Str => "not "); + end if; + Add (Str => "scroll"); + + Clear_To_End_Of_Line; + end transient; + + procedure newwin_report (win : Window := Standard_Window) is + y : Line_Position; + x : Column_Position; + use Int_IO; + tmp2a : String (1 .. 2); + tmp2b : String (1 .. 2); + begin + if win /= Standard_Window then + transient (win, ""); + end if; + Get_Cursor_Position (win, y, x); + Move_Cursor (Line => Lines - 1, Column => Columns - 17); + Put (tmp2a, Integer (y)); + Put (tmp2b, Integer (x)); + Add (Str => "Y = " & tmp2a & " X = " & tmp2b); + if win /= Standard_Window then + Refresh; + else + Move_Cursor (win, y, x); + end if; + end newwin_report; + + procedure selectcell (uli : Line_Position; + ulj : Column_Position; + lri : Line_Position; + lrj : Column_Position; + p : out pair; + b : out Boolean) is + c : Key_Code; + res : pair; + i : Line_Position := 0; + j : Column_Position := 0; + si : constant Line_Position := lri - uli + 1; + sj : constant Column_Position := lrj - ulj + 1; + begin + res.y := uli; + res.x := ulj; + loop + Move_Cursor (Line => uli + i, Column => ulj + j); + newwin_report; + + c := Getchar; + case c is + when + Macro_Quit | + Macro_Escape => + -- on the same line macro calls interfere due to the # comment + -- this is needed because keypad off affects all windows. + -- try removing the ESCAPE and see what happens. + b := False; + return; + when KEY_UP => + i := i + si - 1; + -- same as i := i - 1 because of Modulus arithetic, + -- on Line_Position, which is a Natural + -- the C version uses this form too, interestingly. + when KEY_DOWN => + i := i + 1; + when KEY_LEFT => + j := j + sj - 1; + when KEY_RIGHT => + j := j + 1; + when Key_Mouse => + declare + event : Mouse_Event; + y : Line_Position; + x : Column_Position; + Button : Mouse_Button; + State : Button_State; + + begin + event := Get_Mouse; + Get_Event (Event => event, + Y => y, + X => x, + Button => Button, + State => State); + if y > uli and x > ulj then + i := y - uli; + j := x - ulj; + -- same as when others => + res.y := uli + i; + res.x := ulj + j; + p := res; + b := True; + return; + else + Beep; + end if; + end; + when others => + res.y := uli + i; + res.x := ulj + j; + p := res; + b := True; + return; + end case; + i := i mod si; + j := j mod sj; + end loop; + end selectcell; + + function getwindow return Window is + rwindow : Window; + ul, lr : pair; + result : Boolean; + begin + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Add (Str => "Use arrows to move cursor, anything else to mark corner 1"); + Refresh; + selectcell (2, 1, Lines - Botlines - 2, Columns - 2, ul, result); + if not result then + return Null_Window; + end if; + Add (Line => ul.y - 1, Column => ul.x - 1, + Ch => ACS_Map (ACS_Upper_Left_Corner)); + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Add (Str => "Use arrows to move cursor, anything else to mark corner 2"); + Refresh; + selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, lr, result); + if not result then + return Null_Window; + end if; + + rwindow := Sub_Window (Number_Of_Lines => lr.y - ul.y + 1, + Number_Of_Columns => lr.x - ul.x + 1, + First_Line_Position => ul.y, + First_Column_Position => ul.x); + + Outerbox (ul, lr, True); + Refresh; + + Refresh (rwindow); + + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + return rwindow; + end getwindow; + + procedure newwin_move (win : Window; + dy : Line_Position; + dx : Column_Position) is + cur_y, max_y : Line_Position; + cur_x, max_x : Column_Position; + begin + Get_Cursor_Position (win, cur_y, cur_x); + Get_Size (win, max_y, max_x); + cur_x := Column_Position'Min (Column_Position'Max (cur_x + dx, 0), + max_x - 1); + cur_y := Line_Position'Min (Line_Position'Max (cur_y + dy, 0), + max_y - 1); + + Move_Cursor (win, Line => cur_y, Column => cur_x); + end newwin_move; + + function delete_framed (fp : FrameA; showit : Boolean) return FrameA is + np : FrameA; + begin + fp.last.next := fp.next; + fp.next.last := fp.last; + + if showit then + Erase (fp.wind); + Refresh (fp.wind); + end if; + Delete (fp.wind); + + if fp = fp.next then + np := null; + else + np := fp.next; + end if; + -- TODO free(fp); + return np; + end delete_framed; + + Mask : Event_Mask := No_Events; + Mask2 : Event_Mask; + + usescr : Window; + +begin + if Has_Mouse then + Register_Reportable_Event ( + Button => Left, + State => Clicked, + Mask => Mask); + Mask2 := Start_Mouse (Mask); + end if; + c := CTRL ('C'); + Set_Raw_Mode (SwitchOn => True); + loop + transient (Standard_Window, ""); + case c is + when Character'Pos ('c') mod 16#20# => -- Ctrl('c') + declare + neww : constant FrameA := new Frame'(null, null, + False, False, + Null_Window); + begin + neww.wind := getwindow; + if neww.wind = Null_Window then + exit; + -- was goto breakout; ha ha ha + else + + if current = null then + neww.next := neww; + neww.last := neww; + else + neww.next := current.next; + neww.last := current; + neww.last.next := neww; + neww.next.last := neww; + end if; + current := neww; + + Set_KeyPad_Mode (current.wind, True); + current.do_keypad := HaveKeyPad (current.wind); + current.do_scroll := HaveScroll (current.wind); + end if; + end; + when Character'Pos ('N') mod 16#20# => -- Ctrl('N') + if current /= null then + current := current.next; + end if; + when Character'Pos ('P') mod 16#20# => -- Ctrl('P') + if current /= null then + current := current.last; + end if; + when Character'Pos ('F') mod 16#20# => -- Ctrl('F') + if current /= null and then HaveScroll (current.wind) then + Scroll (current.wind, 1); + end if; + when Character'Pos ('B') mod 16#20# => -- Ctrl('B') + if current /= null and then HaveScroll (current.wind) then + -- The C version of Scroll may return ERR which is ignored + -- we need to avoid the exception + -- with the 'and HaveScroll(current.wind)' + Scroll (current.wind, -1); + end if; + when Character'Pos ('K') mod 16#20# => -- Ctrl('K') + if current /= null then + current.do_keypad := not current.do_keypad; + Set_KeyPad_Mode (current.wind, current.do_keypad); + end if; + when Character'Pos ('S') mod 16#20# => -- Ctrl('S') + if current /= null then + current.do_scroll := not current.do_scroll; + Allow_Scrolling (current.wind, current.do_scroll); + end if; + when Character'Pos ('W') mod 16#20# => -- Ctrl('W') + if current /= current.next then + Create (f, Name => dumpfile); -- TODO error checking + if not Is_Open (f) then + raise Curses_Exception; + end if; + Put_Window (current.wind, f); + Close (f); + current := delete_framed (current, True); + end if; + when Character'Pos ('R') mod 16#20# => -- Ctrl('R') + declare + neww : FrameA := new Frame'(null, null, False, False, + Null_Window); + begin + Open (f, Mode => In_File, Name => dumpfile); + neww := new Frame'(null, null, False, False, Null_Window); + + neww.next := current.next; + neww.last := current; + neww.last.next := neww; + neww.next.last := neww; + + neww.wind := Get_Window (f); + Close (f); + + Refresh (neww.wind); + end; + when Character'Pos ('X') mod 16#20# => -- Ctrl('X') + if current /= null then + declare + tmp, ul, lr : pair; + mx : Column_Position; + my : Line_Position; + tmpbool : Boolean; + begin + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Add (Str => "Use arrows to move cursor, anything else " & + "to mark new corner"); + Refresh; + + Get_Window_Position (current.wind, ul.y, ul.x); + + selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, + tmp, tmpbool); + if not tmpbool then + -- the C version had a goto. I refuse gotos. + Beep; + else + Get_Size (current.wind, lr.y, lr.x); + lr.y := lr.y + ul.y - 1; + lr.x := lr.x + ul.x - 1; + Outerbox (ul, lr, False); + Refresh_Without_Update; + + Get_Size (current.wind, my, mx); + if my > tmp.y - ul.y then + Get_Cursor_Position (current.wind, lr.y, lr.x); + Move_Cursor (current.wind, tmp.y - ul.y + 1, 0); + Clear_To_End_Of_Screen (current.wind); + Move_Cursor (current.wind, lr.y, lr.x); + end if; + if mx > tmp.x - ul.x then + for i in 0 .. my - 1 loop + Move_Cursor (current.wind, i, tmp.x - ul.x + 1); + Clear_To_End_Of_Line (current.wind); + end loop; + end if; + Refresh_Without_Update (current.wind); + + lr := tmp; + -- The C version passes invalid args to resize + -- which returns an ERR. For Ada we avoid the exception. + if lr.y /= ul.y and lr.x /= ul.x then + Resize (current.wind, lr.y - ul.y + 0, + lr.x - ul.x + 0); + end if; + + Get_Window_Position (current.wind, ul.y, ul.x); + Get_Size (current.wind, lr.y, lr.x); + lr.y := lr.y + ul.y - 1; + lr.x := lr.x + ul.x - 1; + Outerbox (ul, lr, True); + Refresh_Without_Update; + + Refresh_Without_Update (current.wind); + Move_Cursor (Line => 0, Column => 0); + Clear_To_End_Of_Line; + Update_Screen; + end if; + end; + end if; + when Key_F10 => + declare tmp : pair; tmpbool : Boolean; + begin + -- undocumented --- use this to test area clears + selectcell (0, 0, Lines - 1, Columns - 1, tmp, tmpbool); + Clear_To_End_Of_Screen; + Refresh; + end; + when Key_Cursor_Up => + newwin_move (current.wind, -1, 0); + when Key_Cursor_Down => + newwin_move (current.wind, 1, 0); + when Key_Cursor_Left => + newwin_move (current.wind, 0, -1); + when Key_Cursor_Right => + newwin_move (current.wind, 0, 1); + when Key_Backspace | Key_Delete_Char => + declare + y : Line_Position; + x : Column_Position; + tmp : Line_Position; + begin + Get_Cursor_Position (current.wind, y, x); + -- x := x - 1; + -- I got tricked by the -1 = Max_Natural - 1 result + -- y := y - 1; + if not (x = 0 and y = 0) then + if x = 0 then + y := y - 1; + Get_Size (current.wind, tmp, x); + end if; + x := x - 1; + Delete_Character (current.wind, y, x); + end if; + end; + when others => + -- TODO c = '\r' ? + if current /= null then + declare + begin + Add (current.wind, Ch => Code_To_Char (c)); + exception + when Curses_Exception => null; + -- this happens if we are at the + -- lower right of a window and add a character. + end; + else + Beep; + end if; + end case; + newwin_report (current.wind); + if current /= null then + usescr := current.wind; + else + usescr := Standard_Window; + end if; + Refresh (usescr); + c := Getchar (usescr); + exit when c = Quit or (c = Escape and HaveKeyPad (usescr)); + -- TODO when does c = ERR happen? + end loop; + + -- TODO while current /= null loop + -- current := delete_framed(current, False); + -- end loop; + + Allow_Scrolling (Mode => True); + + End_Mouse (Mask2); + Set_Raw_Mode (SwitchOn => True); + Erase; + End_Windows; + +end ncurses2.acs_and_scroll; diff --git a/Ada95/samples/ncurses2-acs_and_scroll.ads b/Ada95/samples/ncurses2-acs_and_scroll.ads new file mode 100644 index 00000000000..79e4862af0f --- /dev/null +++ b/Ada95/samples/ncurses2-acs_and_scroll.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.acs_and_scroll; diff --git a/Ada95/samples/ncurses2-acs_display.adb b/Ada95/samples/ncurses2-acs_display.adb new file mode 100644 index 00000000000..a71c61d5daf --- /dev/null +++ b/Ada95/samples/ncurses2-acs_display.adb @@ -0,0 +1,235 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.6 $ +-- $Date: 2008/07/26 18:47:34 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with ncurses2.genericPuts; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Strings.Unbounded; +with Ada.Strings.Fixed; + +procedure ncurses2.acs_display is + use Int_IO; + + procedure show_upper_chars (first : Integer); + function show_1_acs (N : Integer; + name : String; + code : Attributed_Character) + return Integer; + procedure show_acs_chars; + + procedure show_upper_chars (first : Integer) is + C1 : constant Boolean := (first = 128); + last : constant Integer := first + 31; + package p is new ncurses2.genericPuts (200); + use p; + use p.BS; + use Ada.Strings.Unbounded; + + tmpa : Unbounded_String; + tmpb : BS.Bounded_String; + begin + Erase; + Switch_Character_Attribute + (Attr => (Bold_Character => True, others => False)); + Move_Cursor (Line => 0, Column => 20); + tmpa := To_Unbounded_String ("Display of "); + if C1 then + tmpa := tmpa & "C1"; + else + tmpa := tmpa & "GR"; + end if; + tmpa := tmpa & " Character Codes "; + myPut (tmpb, first); + Append (tmpa, To_String (tmpb)); + Append (tmpa, " to "); + myPut (tmpb, last); + Append (tmpa, To_String (tmpb)); + Add (Str => To_String (tmpa)); + Switch_Character_Attribute + (On => False, + Attr => (Bold_Character => True, others => False)); + Refresh; + + for code in first .. last loop + declare + row : constant Line_Position + := Line_Position (4 + ((code - first) mod 16)); + col : constant Column_Position + := Column_Position (((code - first) / 16) * + Integer (Columns) / 2); + tmp3 : String (1 .. 3); + tmpx : String (1 .. Integer (Columns / 4)); + reply : Key_Code; + begin + Put (tmp3, code); + myPut (tmpb, code, 16); + tmpa := To_Unbounded_String (tmp3 & " (" & To_String (tmpb) & ')'); + + Ada.Strings.Fixed.Move (To_String (tmpa), tmpx, + Justify => Ada.Strings.Right); + Add (Line => row, Column => col, + Str => tmpx & ' ' & ':' & ' '); + if C1 then + Set_NoDelay_Mode (Mode => True); + end if; + Add_With_Immediate_Echo (Ch => Code_To_Char (Key_Code (code))); + -- TODO check this + if C1 then + reply := Getchar; + while reply /= Key_None loop + Add (Ch => Code_To_Char (reply)); + Nap_Milli_Seconds (10); + reply := Getchar; + end loop; + Set_NoDelay_Mode (Mode => False); + end if; + end; + end loop; + end show_upper_chars; + + function show_1_acs (N : Integer; + name : String; + code : Attributed_Character) + return Integer is + height : constant Integer := 16; + row : constant Line_Position := Line_Position (4 + (N mod height)); + col : constant Column_Position := Column_Position ((N / height) * + Integer (Columns) / 2); + tmpx : String (1 .. Integer (Columns) / 3); + begin + Ada.Strings.Fixed.Move (name, tmpx, + Justify => Ada.Strings.Right, + Drop => Ada.Strings.Left); + Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' '); + -- we need more room than C because our identifiers are longer + -- 22 chars actually + Add (Ch => code); + return N + 1; + end show_1_acs; + + procedure show_acs_chars is + n : Integer; + begin + Erase; + Switch_Character_Attribute + (Attr => (Bold_Character => True, others => False)); + Add (Line => 0, Column => 20, + Str => "Display of the ACS Character Set"); + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + Refresh; + + -- the following is useful to generate the below + -- grep '^[ ]*ACS_' ../src/terminal_interface-curses.ads | + -- awk '{print "n := show_1_acs(n, \""$1"\", ACS_Map("$1"));"}' + + n := show_1_acs (0, "ACS_Upper_Left_Corner", + ACS_Map (ACS_Upper_Left_Corner)); + n := show_1_acs (n, "ACS_Lower_Left_Corner", + ACS_Map (ACS_Lower_Left_Corner)); + n := show_1_acs (n, "ACS_Upper_Right_Corner", + ACS_Map (ACS_Upper_Right_Corner)); + n := show_1_acs (n, "ACS_Lower_Right_Corner", + ACS_Map (ACS_Lower_Right_Corner)); + n := show_1_acs (n, "ACS_Left_Tee", ACS_Map (ACS_Left_Tee)); + n := show_1_acs (n, "ACS_Right_Tee", ACS_Map (ACS_Right_Tee)); + n := show_1_acs (n, "ACS_Bottom_Tee", ACS_Map (ACS_Bottom_Tee)); + n := show_1_acs (n, "ACS_Top_Tee", ACS_Map (ACS_Top_Tee)); + n := show_1_acs (n, "ACS_Horizontal_Line", + ACS_Map (ACS_Horizontal_Line)); + n := show_1_acs (n, "ACS_Vertical_Line", ACS_Map (ACS_Vertical_Line)); + n := show_1_acs (n, "ACS_Plus_Symbol", ACS_Map (ACS_Plus_Symbol)); + n := show_1_acs (n, "ACS_Scan_Line_1", ACS_Map (ACS_Scan_Line_1)); + n := show_1_acs (n, "ACS_Scan_Line_9", ACS_Map (ACS_Scan_Line_9)); + n := show_1_acs (n, "ACS_Diamond", ACS_Map (ACS_Diamond)); + n := show_1_acs (n, "ACS_Checker_Board", ACS_Map (ACS_Checker_Board)); + n := show_1_acs (n, "ACS_Degree", ACS_Map (ACS_Degree)); + n := show_1_acs (n, "ACS_Plus_Minus", ACS_Map (ACS_Plus_Minus)); + n := show_1_acs (n, "ACS_Bullet", ACS_Map (ACS_Bullet)); + n := show_1_acs (n, "ACS_Left_Arrow", ACS_Map (ACS_Left_Arrow)); + n := show_1_acs (n, "ACS_Right_Arrow", ACS_Map (ACS_Right_Arrow)); + n := show_1_acs (n, "ACS_Down_Arrow", ACS_Map (ACS_Down_Arrow)); + n := show_1_acs (n, "ACS_Up_Arrow", ACS_Map (ACS_Up_Arrow)); + n := show_1_acs (n, "ACS_Board_Of_Squares", + ACS_Map (ACS_Board_Of_Squares)); + n := show_1_acs (n, "ACS_Lantern", ACS_Map (ACS_Lantern)); + n := show_1_acs (n, "ACS_Solid_Block", ACS_Map (ACS_Solid_Block)); + n := show_1_acs (n, "ACS_Scan_Line_3", ACS_Map (ACS_Scan_Line_3)); + n := show_1_acs (n, "ACS_Scan_Line_7", ACS_Map (ACS_Scan_Line_7)); + n := show_1_acs (n, "ACS_Less_Or_Equal", ACS_Map (ACS_Less_Or_Equal)); + n := show_1_acs (n, "ACS_Greater_Or_Equal", + ACS_Map (ACS_Greater_Or_Equal)); + n := show_1_acs (n, "ACS_PI", ACS_Map (ACS_PI)); + n := show_1_acs (n, "ACS_Not_Equal", ACS_Map (ACS_Not_Equal)); + n := show_1_acs (n, "ACS_Sterling", ACS_Map (ACS_Sterling)); + + if n = 0 then + raise Constraint_Error; + end if; + end show_acs_chars; + + c1 : Key_Code; + c : Character := 'a'; +begin + loop + case c is + when 'a' => + show_acs_chars; + when '0' | '1' | '2' | '3' => + show_upper_chars (ctoi (c) * 32 + 128); + when others => + null; + end case; + Add (Line => Lines - 3, Column => 0, + Str => "Note: ANSI terminals may not display C1 characters."); + Add (Line => Lines - 2, Column => 0, + Str => "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit"); + Refresh; + c1 := Getchar; + c := Code_To_Char (c1); + exit when c = 'q' or c = 'x'; + end loop; + Pause; + Erase; + End_Windows; +end ncurses2.acs_display; diff --git a/Ada95/samples/ncurses2-acs_display.ads b/Ada95/samples/ncurses2-acs_display.ads new file mode 100644 index 00000000000..4e616c5e144 --- /dev/null +++ b/Ada95/samples/ncurses2-acs_display.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.acs_display; diff --git a/Ada95/samples/ncurses2-attr_test.adb b/Ada95/samples/ncurses2-attr_test.adb new file mode 100644 index 00000000000..66271042c0b --- /dev/null +++ b/Ada95/samples/ncurses2-attr_test.adb @@ -0,0 +1,362 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2007,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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.9 $ +-- $Date: 2008/07/26 18:47:26 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Terminfo; +use Terminal_Interface.Curses.Terminfo; +with Ada.Characters.Handling; +with Ada.Strings.Fixed; + +procedure ncurses2.attr_test is + + function subset (super, sub : Character_Attribute_Set) return Boolean; + function intersect (b, a : Character_Attribute_Set) return Boolean; + function has_A_COLOR (attr : Attributed_Character) return Boolean; + function show_attr (row : Line_Position; + skip : Natural; + attr : Character_Attribute_Set; + name : String; + once : Boolean) return Line_Position; + procedure attr_getc (skip : in out Integer; + fg, bg : in out Color_Number; + result : out Boolean); + + function subset (super, sub : Character_Attribute_Set) return Boolean is + begin + if + (super.Stand_Out or not sub.Stand_Out) and + (super.Under_Line or not sub.Under_Line) and + (super.Reverse_Video or not sub.Reverse_Video) and + (super.Blink or not sub.Blink) and + (super.Dim_Character or not sub.Dim_Character) and + (super.Bold_Character or not sub.Bold_Character) and + (super.Alternate_Character_Set or not sub.Alternate_Character_Set) and + (super.Invisible_Character or not sub.Invisible_Character) -- and +-- (super.Protected_Character or not sub.Protected_Character) and +-- (super.Horizontal or not sub.Horizontal) and +-- (super.Left or not sub.Left) and +-- (super.Low or not sub.Low) and +-- (super.Right or not sub.Right) and +-- (super.Top or not sub.Top) and +-- (super.Vertical or not sub.Vertical) + then + return True; + else + return False; + end if; + end subset; + + function intersect (b, a : Character_Attribute_Set) return Boolean is + begin + if + (a.Stand_Out and b.Stand_Out) or + (a.Under_Line and b.Under_Line) or + (a.Reverse_Video and b.Reverse_Video) or + (a.Blink and b.Blink) or + (a.Dim_Character and b.Dim_Character) or + (a.Bold_Character and b.Bold_Character) or + (a.Alternate_Character_Set and b.Alternate_Character_Set) or + (a.Invisible_Character and b.Invisible_Character) -- or +-- (a.Protected_Character and b.Protected_Character) or +-- (a.Horizontal and b.Horizontal) or +-- (a.Left and b.Left) or +-- (a.Low and b.Low) or +-- (a.Right and b.Right) or +-- (a.Top and b.Top) or +-- (a.Vertical and b.Vertical) + then + return True; + else + return False; + end if; + end intersect; + + function has_A_COLOR (attr : Attributed_Character) return Boolean is + begin + if attr.Color /= Color_Pair (0) then + return True; + else + return False; + end if; + end has_A_COLOR; + + -- Print some text with attributes. + function show_attr (row : Line_Position; + skip : Natural; + attr : Character_Attribute_Set; + name : String; + once : Boolean) return Line_Position is + + function make_record (n : Integer) return Character_Attribute_Set; + function make_record (n : Integer) return Character_Attribute_Set is + -- unsupported means true + a : Character_Attribute_Set := (others => False); + m : Integer; + rest : Integer; + begin + -- ncv is a bitmap with these fields + -- A_STANDOUT, + -- A_UNDERLINE, + -- A_REVERSE, + -- A_BLINK, + -- A_DIM, + -- A_BOLD, + -- A_INVIS, + -- A_PROTECT, + -- A_ALTCHARSET + -- It means no_color_video, + -- video attributes that can't be used with colors + -- see man terminfo.5 + m := n mod 2; + rest := n / 2; + if 1 = m then + a.Stand_Out := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Under_Line := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Reverse_Video := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Blink := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Bold_Character := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Invisible_Character := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Protected_Character := True; + end if; + m := rest mod 2; + rest := rest / 2; + if 1 = m then + a.Alternate_Character_Set := True; + end if; + + return a; + end make_record; + + ncv : constant Integer := Get_Number ("ncv"); + + begin + Move_Cursor (Line => row, Column => 8); + Add (Str => name & " mode:"); + Move_Cursor (Line => row, Column => 24); + Add (Ch => '|'); + if skip /= 0 then + -- printw("%*s", skip, " ") + Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); + end if; + if once then + Switch_Character_Attribute (Attr => attr); + else + Set_Character_Attributes (Attr => attr); + end if; + Add (Str => "abcde fghij klmno pqrst uvwxy z"); + if once then + Switch_Character_Attribute (Attr => attr, On => False); + end if; + if skip /= 0 then + Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); + end if; + Add (Ch => '|'); + if attr /= Normal_Video then + declare begin + if not subset (super => Supported_Attributes, sub => attr) then + Add (Str => " (N/A)"); + elsif ncv > 0 and has_A_COLOR (Get_Background) then + declare + Color_Supported_Attributes : + constant Character_Attribute_Set := make_record (ncv); + begin + if intersect (Color_Supported_Attributes, attr) then + Add (Str => " (NCV) "); + end if; + end; + end if; + end; + end if; + return row + 2; + end show_attr; + + procedure attr_getc (skip : in out Integer; + fg, bg : in out Color_Number; + result : out Boolean) is + ch : constant Key_Code := Getchar; + nc : constant Color_Number := Color_Number (Number_Of_Colors); + begin + result := True; + if Ada.Characters.Handling.Is_Digit (Character'Val (ch)) then + skip := ctoi (Code_To_Char (ch)); + elsif ch = CTRL ('L') then + Touch; + Touch (Current_Window); + Refresh; + elsif Has_Colors then + case ch is + -- Note the mathematical elegance compared to the C version. + when Character'Pos ('f') => fg := (fg + 1) mod nc; + when Character'Pos ('F') => fg := (fg - 1) mod nc; + when Character'Pos ('b') => bg := (bg + 1) mod nc; + when Character'Pos ('B') => bg := (bg - 1) mod nc; + when others => + result := False; + end case; + else + result := False; + end if; + end attr_getc; + + -- pairs could be defined as array ( Color_Number(0) .. colors - 1) of + -- array (Color_Number(0).. colors - 1) of Boolean; + pairs : array (Color_Pair'Range) of Boolean := (others => False); + fg, bg : Color_Number := Black; -- = 0; + xmc : constant Integer := Get_Number ("xmc"); + skip : Integer := xmc; + n : Integer; + + use Int_IO; + +begin + pairs (0) := True; + + if skip < 0 then + skip := 0; + end if; + n := skip; + + loop + declare + row : Line_Position := 2; + normal : Attributed_Character := Blank2; + -- ??? + begin + -- row := 2; -- weird, row is set to 0 without this. + -- TODO delete the above line, it was a gdb quirk that confused me + if Has_Colors then + declare pair : constant Color_Pair := + Color_Pair (fg * Color_Number (Number_Of_Colors) + bg); + begin + -- Go though each color pair. Assume that the number of + -- Redefinable_Color_Pairs is 8*8 with predefined Colors 0..7 + if not pairs (pair) then + Init_Pair (pair, fg, bg); + pairs (pair) := True; + end if; + normal.Color := pair; + end; + end if; + Set_Background (Ch => normal); + Erase; + + Add (Line => 0, Column => 20, + Str => "Character attribute test display"); + + row := show_attr (row, n, (Stand_Out => True, others => False), + "STANDOUT", True); + row := show_attr (row, n, (Reverse_Video => True, others => False), + "REVERSE", True); + row := show_attr (row, n, (Bold_Character => True, others => False), + "BOLD", True); + row := show_attr (row, n, (Under_Line => True, others => False), + "UNDERLINE", True); + row := show_attr (row, n, (Dim_Character => True, others => False), + "DIM", True); + row := show_attr (row, n, (Blink => True, others => False), + "BLINK", True); +-- row := show_attr (row, n, (Protected_Character => True, +-- others => False), "PROTECT", True); + row := show_attr (row, n, (Invisible_Character => True, + others => False), "INVISIBLE", True); + row := show_attr (row, n, Normal_Video, "NORMAL", False); + + Move_Cursor (Line => row, Column => 8); + if xmc > -1 then + Add (Str => "This terminal does have the magic-cookie glitch"); + else + Add (Str => "This terminal does not have the magic-cookie glitch"); + end if; + Move_Cursor (Line => row + 1, Column => 8); + Add (Str => "Enter a digit to set gaps on each side of " & + "displayed attributes"); + Move_Cursor (Line => row + 2, Column => 8); + Add (Str => "^L = repaint"); + if Has_Colors then + declare tmp1 : String (1 .. 1); + begin + Add (Str => ". f/F/b/F toggle colors ("); + Put (tmp1, Integer (fg)); + Add (Str => tmp1); + Add (Ch => '/'); + Put (tmp1, Integer (bg)); + Add (Str => tmp1); + Add (Ch => ')'); + end; + end if; + Refresh; + end; + + declare result : Boolean; begin + attr_getc (n, fg, bg, result); + exit when not result; + end; + end loop; + + Set_Background (Ch => Blank2); + Erase; + End_Windows; +end ncurses2.attr_test; diff --git a/Ada95/samples/ncurses2-attr_test.ads b/Ada95/samples/ncurses2-attr_test.ads new file mode 100644 index 00000000000..51c51435eab --- /dev/null +++ b/Ada95/samples/ncurses2-attr_test.ads @@ -0,0 +1,42 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.2 $ +-- $Date: 2006/06/25 14:24:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.attr_test; diff --git a/Ada95/samples/ncurses2-color_edit.adb b/Ada95/samples/ncurses2-color_edit.adb new file mode 100644 index 00000000000..098f98d837b --- /dev/null +++ b/Ada95/samples/ncurses2-color_edit.adb @@ -0,0 +1,259 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2006,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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.6 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with ncurses2.genericPuts; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +procedure ncurses2.color_edit is + use Int_IO; + + type RGB_Enum is (Redx, Greenx, Bluex); + + procedure change_color (current : Color_Number; + field : RGB_Enum; + value : RGB_Value; + usebase : Boolean); + + procedure change_color (current : Color_Number; + field : RGB_Enum; + value : RGB_Value; + usebase : Boolean) is + red, green, blue : RGB_Value; + begin + if usebase then + Color_Content (current, red, green, blue); + else + red := 0; + green := 0; + blue := 0; + end if; + + case field is + when Redx => red := red + value; + when Greenx => green := green + value; + when Bluex => blue := blue + value; + end case; + + declare + begin + Init_Color (current, red, green, blue); + exception + when Curses_Exception => Beep; + end; + + end change_color; + + package x is new ncurses2.genericPuts (100); use x; + + tmpb : x.BS.Bounded_String; + + tmp4 : String (1 .. 4); + tmp6 : String (1 .. 6); + tmp8 : String (1 .. 8); + -- This would be easier if Ada had a Bounded_String + -- defined as a class instead of the inferior generic package, + -- then I could define Put, Add, and Get for them. Blech. + value : RGB_Value := 0; + red, green, blue : RGB_Value; + max_colors : constant Natural := Number_Of_Colors; + current : Color_Number := 0; + field : RGB_Enum := Redx; + this_c : Key_Code := 0; +begin + Refresh; + + for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop + Init_Pair (Color_Pair (i), White, i); + end loop; + + Move_Cursor (Line => Lines - 2, Column => 0); + Add (Str => "Number: "); + myPut (tmpb, Integer (value)); + myAdd (Str => tmpb); + + loop + + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + Add (Line => 0, Column => 20, Str => "Color RGB Value Editing"); + + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + + for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop + Move_Cursor (Line => 2 + Line_Position (i), Column => 0); + if current = i then + Add (Ch => '>'); + else + Add (Ch => ' '); + end if; + -- TODO if i <= color_names'Max then + Put (tmp8, Integer (i)); + Set_Character_Attributes (Color => Color_Pair (i)); + Add (Str => " "); + Set_Character_Attributes; + + Refresh; + + Color_Content (i, red, green, blue); + Add (Str => " R = "); + if current = i and field = Redx then + Switch_Character_Attribute (On => True, + Attr => (Stand_Out => True, + others => False)); + end if; + Put (tmp4, Integer (red)); + Add (Str => tmp4); + if current = i and field = Redx then + Set_Character_Attributes; + end if; + Add (Str => " G = "); + if current = i and field = Greenx then + Switch_Character_Attribute (On => True, + Attr => (Stand_Out => True, + others => False)); + end if; + Put (tmp4, Integer (green)); + Add (Str => tmp4); + if current = i and field = Greenx then + Set_Character_Attributes; + end if; + Add (Str => " B = "); + if current = i and field = Bluex then + Switch_Character_Attribute (On => True, + Attr => (Stand_Out => True, + others => False)); + end if; + Put (tmp4, Integer (blue)); + Add (Str => tmp4); + if current = i and field = Bluex then + Set_Character_Attributes; + end if; + Set_Character_Attributes; + Add (Ch => ')'); + end loop; + Add (Line => Line_Position (Number_Of_Colors + 3), Column => 0, + Str => "Use up/down to select a color, left/right to change " & + "fields."); + Add (Line => Line_Position (Number_Of_Colors + 4), Column => 0, + Str => "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); + + Move_Cursor (Line => 2 + Line_Position (current), Column => 0); + + this_c := Getchar; + if Is_Digit (this_c) then + value := 0; + end if; + + case this_c is + when KEY_UP => + current := (current - 1) mod Color_Number (max_colors); + when KEY_DOWN => + current := (current + 1) mod Color_Number (max_colors); + when KEY_RIGHT => + field := RGB_Enum'Val ((RGB_Enum'Pos (field) + 1) mod 3); + when KEY_LEFT => + field := RGB_Enum'Val ((RGB_Enum'Pos (field) - 1) mod 3); + when + Character'Pos ('0') | + Character'Pos ('1') | + Character'Pos ('2') | + Character'Pos ('3') | + Character'Pos ('4') | + Character'Pos ('5') | + Character'Pos ('6') | + Character'Pos ('7') | + Character'Pos ('8') | + Character'Pos ('9') => + value := value * 10 + RGB_Value (ctoi (Code_To_Char (this_c))); + + when Character'Pos ('+') => + change_color (current, field, value, True); + + when Character'Pos ('-') => + change_color (current, field, -value, True); + + when Character'Pos ('=') => + change_color (current, field, value, False); + + when Character'Pos ('?') => + Erase; + P (" RGB Value Editing Help"); + P (""); + P ("You are in the RGB value editor. Use the arrow keys to " & + "select one of"); + P ("the fields in one of the RGB triples of the current colors;" & + " the one"); + P ("currently selected will be reverse-video highlighted."); + P (""); + P ("To change a field, enter the digits of the new value; they" & + " are echoed"); + P ("as entered. Finish by typing `='. The change will take" & + " effect instantly."); + P ("To increment or decrement a value, use the same procedure," & + " but finish"); + P ("with a `+' or `-'."); + P (""); + P ("To quit, do `x' or 'q'"); + + Pause; + Erase; + when Character'Pos ('q') | + Character'Pos ('x') => + null; + when others => + Beep; + end case; + Move_Cursor (Line => Lines - 2, Column => 0); + Put (tmp6, Integer (value)); + Add (Str => "Number: " & tmp6); + + Clear_To_End_Of_Line; + exit when this_c = Character'Pos ('x') or + this_c = Character'Pos ('q'); + end loop; + + Erase; + End_Windows; +end ncurses2.color_edit; diff --git a/Ada95/samples/ncurses2-color_edit.ads b/Ada95/samples/ncurses2-color_edit.ads new file mode 100644 index 00000000000..3e8e392dfe8 --- /dev/null +++ b/Ada95/samples/ncurses2-color_edit.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.color_edit; diff --git a/Ada95/samples/ncurses2-color_test.adb b/Ada95/samples/ncurses2-color_test.adb new file mode 100644 index 00000000000..c8f6c837ae1 --- /dev/null +++ b/Ada95/samples/ncurses2-color_test.adb @@ -0,0 +1,163 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.3 $ +-- $Date: 2008/07/26 18:47:17 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Ada.Strings.Fixed; + +procedure ncurses2.color_test is + use Int_IO; + + procedure show_color_name (y, x : Integer; color : Integer); + + color_names : constant array (0 .. 15) of String (1 .. 7) := + ( + "black ", + "red ", + "green ", + "yellow ", + "blue ", + "magenta", + "cyan ", + "white ", + "BLACK ", + "RED ", + "GREEN ", + "YELLOW ", + "BLUE ", + "MAGENTA", + "CYAN ", + "WHITE " + ); + + procedure show_color_name (y, x : Integer; color : Integer) is + tmp5 : String (1 .. 5); + begin + if Number_Of_Colors > 8 then + + Put (tmp5, color); + Add (Line => Line_Position (y), Column => Column_Position (x), + Str => tmp5); + else + Add (Line => Line_Position (y), Column => Column_Position (x), + Str => color_names (color)); + end if; + end show_color_name; + + top, width : Integer; + hello : String (1 .. 5); + -- tmp3 : String (1 .. 3); + -- tmp2 : String (1 .. 2); + +begin + Refresh; + Add (Str => "There are "); + -- Put(tmp3, Number_Of_Colors*Number_Of_Colors); + Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors * + Number_Of_Colors), + Ada.Strings.Left)); + Add (Str => " color pairs"); + Add (Ch => newl); + + if Number_Of_Colors > 8 then + width := 4; + else + width := 8; + end if; + + if Number_Of_Colors > 8 then + hello := "Test "; + else + hello := "Hello"; + end if; + + for Bright in Boolean loop + if Number_Of_Colors > 8 then + top := 0; + else + top := Boolean'Pos (Bright) * (Number_Of_Colors + 3); + end if; + Clear_To_End_Of_Screen; + Move_Cursor (Line => Line_Position (top) + 1, Column => 0); + -- Put(tmp2, Number_Of_Colors); + Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), + Ada.Strings.Left)); + Add (Ch => 'x'); + Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), + Ada.Strings.Left)); + Add (Str => " matrix of foreground/background colors, bright *"); + if Bright then + Add (Str => "on"); + else + Add (Str => "off"); + end if; + Add (Ch => '*'); + + for i in 0 .. Number_Of_Colors - 1 loop + show_color_name (top + 2, (i + 1) * width, i); + end loop; + for i in 0 .. Number_Of_Colors - 1 loop + show_color_name (top + 3 + i, 0, i); + end loop; + for i in 1 .. Number_Of_Color_Pairs - 1 loop + Init_Pair (Color_Pair (i), Color_Number (i mod Number_Of_Colors), + Color_Number (i / Number_Of_Colors)); + -- attron((attr_t) COLOR_PAIR(i)) -- Huh? + Set_Color (Pair => Color_Pair (i)); + if Bright then + Switch_Character_Attribute (Attr => (Bold_Character => True, + others => False)); + end if; + Add (Line => Line_Position (top + 3 + (i / Number_Of_Colors)), + Column => Column_Position ((i mod Number_Of_Colors + 1) * + width), + Str => hello); + Set_Character_Attributes; + end loop; + if Number_Of_Colors > 8 or Bright then + Pause; + end if; + end loop; + + Erase; + End_Windows; +end ncurses2.color_test; diff --git a/Ada95/samples/ncurses2-color_test.ads b/Ada95/samples/ncurses2-color_test.ads new file mode 100644 index 00000000000..6e663181a9b --- /dev/null +++ b/Ada95/samples/ncurses2-color_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.color_test; diff --git a/Ada95/samples/ncurses2-demo_forms.adb b/Ada95/samples/ncurses2-demo_forms.adb new file mode 100644 index 00000000000..7137aa0b1e4 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_forms.adb @@ -0,0 +1,497 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.5 $ +-- $Date: 2006/06/25 14:24:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; +with Terminal_Interface.Curses.Forms.Field_User_Data; +with Ada.Characters.Handling; +with Ada.Strings; +with Ada.Strings.Bounded; + +procedure ncurses2.demo_forms is + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (80); + + type myptr is access Integer; + + -- The C version stores a pointer in the userptr and + -- converts it into a long integer. + -- The correct, but inconvenient way to do it is to use a + -- pointer to long and keep the pointer constant. + -- It just adds one memory piece to allocate and deallocate (not done here) + + package StringData is new + Terminal_Interface.Curses.Forms.Field_User_Data (Integer, myptr); + + function edit_secure (me : Field; c_in : Key_Code) return Key_Code; + function form_virtualize (f : Form; w : Window) return Key_Code; + function my_form_driver (f : Form; c : Key_Code) return Boolean; + function make_label (frow : Line_Position; + fcol : Column_Position; + label : String) return Field; + function make_field (frow : Line_Position; + fcol : Column_Position; + rows : Line_Count; + cols : Column_Count; + secure : Boolean) return Field; + procedure display_form (f : Form); + procedure erase_form (f : Form); + + -- prints '*' instead of characters. + -- Not that this keeps a bug from the C version: + -- type in the psasword field then move off and back. + -- the cursor is at position one, but + -- this assumes it as at the end so text gets appended instead + -- of overwtitting. + function edit_secure (me : Field; c_in : Key_Code) return Key_Code is + rows, frow : Line_Position; + nrow : Natural; + cols, fcol : Column_Position; + nbuf : Buffer_Number; + c : Key_Code := c_in; + c2 : Character; + + use StringData; + begin + Info (me, rows, cols, frow, fcol, nrow, nbuf); + -- TODO if result = Form_Ok and nbuf > 0 then + -- C version checked the return value + -- of Info, the Ada binding throws an exception I think. + if nbuf > 0 then + declare + temp : BS.Bounded_String; + temps : String (1 .. 10); + -- TODO Get_Buffer povides no information on the field length? + len : myptr; + begin + Get_Buffer (me, 1, Str => temps); + -- strcpy(temp, field_buffer(me, 1)); + Get_User_Data (me, len); + temp := BS.To_Bounded_String (temps (1 .. len.all)); + if c <= Key_Max then + c2 := Code_To_Char (c); + if Ada.Characters.Handling.Is_Graphic (c2) then + BS.Append (temp, c2); + len.all := len.all + 1; + Set_Buffer (me, 1, BS.To_String (temp)); + c := Character'Pos ('*'); + else + c := 0; + end if; + else + case c is + when REQ_BEG_FIELD | + REQ_CLR_EOF | + REQ_CLR_EOL | + REQ_DEL_LINE | + REQ_DEL_WORD | + REQ_DOWN_CHAR | + REQ_END_FIELD | + REQ_INS_CHAR | + REQ_INS_LINE | + REQ_LEFT_CHAR | + REQ_NEW_LINE | + REQ_NEXT_WORD | + REQ_PREV_WORD | + REQ_RIGHT_CHAR | + REQ_UP_CHAR => + c := 0; -- we don't want to do inline editing + when REQ_CLR_FIELD => + if len.all /= 0 then + temp := BS.To_Bounded_String (""); + Set_Buffer (me, 1, BS.To_String (temp)); + len.all := 0; + end if; + + when REQ_DEL_CHAR | + REQ_DEL_PREV => + if len.all /= 0 then + BS.Delete (temp, BS.Length (temp), BS.Length (temp)); + Set_Buffer (me, 1, BS.To_String (temp)); + len.all := len.all - 1; + end if; + when others => null; + end case; + end if; + end; + end if; + return c; + end edit_secure; + + mode : Key_Code := REQ_INS_MODE; + + function form_virtualize (f : Form; w : Window) return Key_Code is + type lookup_t is record + code : Key_Code; + result : Key_Code; + -- should be Form_Request_Code, but we need MAX_COMMAND + 1 + end record; + + lookup : constant array (Positive range <>) of lookup_t := + ( + ( + Character'Pos ('A') mod 16#20#, REQ_NEXT_CHOICE + ), + ( + Character'Pos ('B') mod 16#20#, REQ_PREV_WORD + ), + ( + Character'Pos ('C') mod 16#20#, REQ_CLR_EOL + ), + ( + Character'Pos ('D') mod 16#20#, REQ_DOWN_FIELD + ), + ( + Character'Pos ('E') mod 16#20#, REQ_END_FIELD + ), + ( + Character'Pos ('F') mod 16#20#, REQ_NEXT_PAGE + ), + ( + Character'Pos ('G') mod 16#20#, REQ_DEL_WORD + ), + ( + Character'Pos ('H') mod 16#20#, REQ_DEL_PREV + ), + ( + Character'Pos ('I') mod 16#20#, REQ_INS_CHAR + ), + ( + Character'Pos ('K') mod 16#20#, REQ_CLR_EOF + ), + ( + Character'Pos ('L') mod 16#20#, REQ_LEFT_FIELD + ), + ( + Character'Pos ('M') mod 16#20#, REQ_NEW_LINE + ), + ( + Character'Pos ('N') mod 16#20#, REQ_NEXT_FIELD + ), + ( + Character'Pos ('O') mod 16#20#, REQ_INS_LINE + ), + ( + Character'Pos ('P') mod 16#20#, REQ_PREV_FIELD + ), + ( + Character'Pos ('R') mod 16#20#, REQ_RIGHT_FIELD + ), + ( + Character'Pos ('S') mod 16#20#, REQ_BEG_FIELD + ), + ( + Character'Pos ('U') mod 16#20#, REQ_UP_FIELD + ), + ( + Character'Pos ('V') mod 16#20#, REQ_DEL_CHAR + ), + ( + Character'Pos ('W') mod 16#20#, REQ_NEXT_WORD + ), + ( + Character'Pos ('X') mod 16#20#, REQ_CLR_FIELD + ), + ( + Character'Pos ('Y') mod 16#20#, REQ_DEL_LINE + ), + ( + Character'Pos ('Z') mod 16#20#, REQ_PREV_CHOICE + ), + ( + Character'Pos ('[') mod 16#20#, -- ESCAPE + Form_Request_Code'Last + 1 + ), + ( + Key_Backspace, REQ_DEL_PREV + ), + ( + KEY_DOWN, REQ_DOWN_CHAR + ), + ( + Key_End, REQ_LAST_FIELD + ), + ( + Key_Home, REQ_FIRST_FIELD + ), + ( + KEY_LEFT, REQ_LEFT_CHAR + ), + ( + KEY_LL, REQ_LAST_FIELD + ), + ( + Key_Next, REQ_NEXT_FIELD + ), + ( + KEY_NPAGE, REQ_NEXT_PAGE + ), + ( + KEY_PPAGE, REQ_PREV_PAGE + ), + ( + Key_Previous, REQ_PREV_FIELD + ), + ( + KEY_RIGHT, REQ_RIGHT_CHAR + ), + ( + KEY_UP, REQ_UP_CHAR + ), + ( + Character'Pos ('Q') mod 16#20#, -- QUIT + Form_Request_Code'Last + 1 -- TODO MAX_FORM_COMMAND + 1 + ) + ); + + c : Key_Code := Getchar (w); + me : constant Field := Current (f); + + begin + if c = Character'Pos (']') mod 16#20# then + if mode = REQ_INS_MODE then + mode := REQ_OVL_MODE; + else + mode := REQ_INS_MODE; + end if; + c := mode; + else + for n in lookup'Range loop + if lookup (n).code = c then + c := lookup (n).result; + exit; + end if; + end loop; + end if; + + -- Force the field that the user is typing into to be in reverse video, + -- while the other fields are shown underlined. + if c <= Key_Max then + c := edit_secure (me, c); + Set_Background (me, (Reverse_Video => True, others => False)); + elsif c <= Form_Request_Code'Last then + c := edit_secure (me, c); + Set_Background (me, (Under_Line => True, others => False)); + end if; + return c; + end form_virtualize; + + function my_form_driver (f : Form; c : Key_Code) return Boolean is + flag : constant Driver_Result := Driver (f, F_Validate_Field); + begin + if c = Form_Request_Code'Last + 1 + and flag = Form_Ok then + return True; + else + Beep; + return False; + end if; + end my_form_driver; + + function make_label (frow : Line_Position; + fcol : Column_Position; + label : String) return Field is + f : constant Field := Create (1, label'Length, frow, fcol, 0, 0); + o : Field_Option_Set := Get_Options (f); + begin + if f /= Null_Field then + Set_Buffer (f, 0, label); + o.Active := False; + Set_Options (f, o); + end if; + return f; + end make_label; + + function make_field (frow : Line_Position; + fcol : Column_Position; + rows : Line_Count; + cols : Column_Count; + secure : Boolean) return Field is + f : Field; + use StringData; + len : myptr; + begin + if secure then + f := Create (rows, cols, frow, fcol, 0, 1); + else + f := Create (rows, cols, frow, fcol, 0, 0); + end if; + + if f /= Null_Field then + Set_Background (f, (Under_Line => True, others => False)); + len := new Integer; + len.all := 0; + Set_User_Data (f, len); + end if; + return f; + end make_field; + + procedure display_form (f : Form) is + w : Window; + rows : Line_Count; + cols : Column_Count; + begin + Scale (f, rows, cols); + + w := New_Window (rows + 2, cols + 4, 0, 0); + if w /= Null_Window then + Set_Window (f, w); + Set_Sub_Window (f, Derived_Window (w, rows, cols, 1, 2)); + Box (w); -- 0,0 + Set_KeyPad_Mode (w, True); + end if; + + -- TODO if Post(f) /= Form_Ok then it's a procedure + declare + begin + Post (f); + exception + when + Eti_System_Error | + Eti_Bad_Argument | + Eti_Posted | + Eti_Connected | + Eti_Bad_State | + Eti_No_Room | + Eti_Not_Posted | + Eti_Unknown_Command | + Eti_No_Match | + Eti_Not_Selectable | + Eti_Not_Connected | + Eti_Request_Denied | + Eti_Invalid_Field | + Eti_Current => + Refresh (w); + end; + -- end if; + end display_form; + + procedure erase_form (f : Form) is + w : Window := Get_Window (f); + s : Window := Get_Sub_Window (f); + begin + Post (f, False); + Erase (w); + Refresh (w); + Delete (s); + Delete (w); + end erase_form; + + finished : Boolean := False; + f : constant Field_Array_Access := new Field_Array (1 .. 12); + secure : Field; + myform : Form; + w : Window; + c : Key_Code; + result : Driver_Result; +begin + Move_Cursor (Line => 18, Column => 0); + Add (Str => "Defined form-traversal keys: ^Q/ESC- exit form"); + Add (Ch => newl); + Add (Str => "^N -- go to next field ^P -- go to previous field"); + Add (Ch => newl); + Add (Str => "Home -- go to first field End -- go to last field"); + Add (Ch => newl); + Add (Str => "^L -- go to field to left ^R -- go to field to right"); + Add (Ch => newl); + Add (Str => "^U -- move upward to field ^D -- move downward to field"); + Add (Ch => newl); + Add (Str => "^W -- go to next word ^B -- go to previous word"); + Add (Ch => newl); + Add (Str => "^S -- go to start of field ^E -- go to end of field"); + Add (Ch => newl); + Add (Str => "^H -- delete previous char ^Y -- delete line"); + Add (Ch => newl); + Add (Str => "^G -- delete current word ^C -- clear to end of line"); + Add (Ch => newl); + Add (Str => "^K -- clear to end of field ^X -- clear field"); + Add (Ch => newl); + Add (Str => "Arrow keys move within a field as you would expect."); + + Add (Line => 4, Column => 57, Str => "Forms Entry Test"); + + Refresh; + + -- describe the form + f (1) := make_label (0, 15, "Sample Form"); + f (2) := make_label (2, 0, "Last Name"); + f (3) := make_field (3, 0, 1, 18, False); + f (4) := make_label (2, 20, "First Name"); + f (5) := make_field (3, 20, 1, 12, False); + f (6) := make_label (2, 34, "Middle Name"); + f (7) := make_field (3, 34, 1, 12, False); + f (8) := make_label (5, 0, "Comments"); + f (9) := make_field (6, 0, 4, 46, False); + f (10) := make_label (5, 20, "Password:"); + f (11) := make_field (5, 30, 1, 9, True); + secure := f (11); + f (12) := Null_Field; + + myform := New_Form (f); + + display_form (myform); + + w := Get_Window (myform); + Set_Raw_Mode (SwitchOn => True); + Set_NL_Mode (SwitchOn => True); -- lets us read ^M's + while not finished loop + c := form_virtualize (myform, w); + result := Driver (myform, c); + case result is + when Form_Ok => + Add (Line => 5, Column => 57, Str => Get_Buffer (secure, 1)); + Clear_To_End_Of_Line; + Refresh; + when Unknown_Request => + finished := my_form_driver (myform, c); + when others => + Beep; + end case; + end loop; + + erase_form (myform); + + -- TODO Free_Form(myform); + -- for (c = 0; f[c] != 0; c++) free_field(f[c]); + Set_Raw_Mode (SwitchOn => False); + Set_NL_Mode (SwitchOn => True); + +end ncurses2.demo_forms; diff --git a/Ada95/samples/ncurses2-demo_forms.ads b/Ada95/samples/ncurses2-demo_forms.ads new file mode 100644 index 00000000000..eabaa01b9e9 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_forms.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_forms; diff --git a/Ada95/samples/ncurses2-demo_pad.adb b/Ada95/samples/ncurses2-demo_pad.adb new file mode 100644 index 00000000000..862b8b70da2 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_pad.adb @@ -0,0 +1,675 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.7 $ +-- $Date: 2008/07/26 18:47:06 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Interfaces.C; +with System.Storage_Elements; +with System.Address_To_Access_Conversions; + +with Ada.Text_IO; +-- with Ada.Real_Time; use Ada.Real_Time; +-- TODO is there a way to use Real_Time or Ada.Calendar in place of +-- gettimeofday? + +-- Demonstrate pads. +procedure ncurses2.demo_pad is + + type timestruct is record + seconds : Integer; + microseconds : Integer; + end record; + + type myfunc is access function (w : Window) return Key_Code; + + function gettime return timestruct; + procedure do_h_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Column_Position); + procedure do_v_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Line_Position); + function padgetch (win : Window) return Key_Code; + function panner_legend (line : Line_Position) return Boolean; + procedure panner_legend (line : Line_Position); + procedure panner_h_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_x : Column_Position); + procedure panner_v_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_y : Line_Position); + procedure panner (pad : Window; + top_xp : Column_Position; + top_yp : Line_Position; + portyp : Line_Position; + portxp : Column_Position; + pgetc : myfunc); + + function gettime return timestruct is + + retval : timestruct; + + use Interfaces.C; + type timeval is record + tv_sec : long; + tv_usec : long; + end record; + pragma Convention (C, timeval); + + -- TODO function from_timeval is new Ada.Unchecked_Conversion( + -- timeval_a, System.Storage_Elements.Integer_Address); + -- should Interfaces.C.Pointers be used here? + + package myP is new System.Address_To_Access_Conversions (timeval); + use myP; + + t : constant Object_Pointer := new timeval; + + function gettimeofday + (TP : System.Storage_Elements.Integer_Address; + TZP : System.Storage_Elements.Integer_Address) return int; + pragma Import (C, gettimeofday, "gettimeofday"); + tmp : int; + begin + tmp := gettimeofday (System.Storage_Elements.To_Integer + (myP.To_Address (t)), + System.Storage_Elements.To_Integer + (myP.To_Address (null))); + if tmp < 0 then + retval.seconds := 0; + retval.microseconds := 0; + else + retval.seconds := Integer (t.tv_sec); + retval.microseconds := Integer (t.tv_usec); + end if; + return retval; + end gettime; + + -- in C, The behavior of mvhline, mvvline for negative/zero length is + -- unspecified, though we can rely on negative x/y values to stop the + -- macro. Except Ada makes Line_Position(-1) = Natural - 1 so forget it. + procedure do_h_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Column_Position) is + begin + if to > x then + Move_Cursor (Line => y, Column => x); + Horizontal_Line (Line_Size => Natural (to - x), Line_Symbol => c); + end if; + end do_h_line; + + procedure do_v_line (y : Line_Position; + x : Column_Position; + c : Attributed_Character; + to : Line_Position) is + begin + if to > y then + Move_Cursor (Line => y, Column => x); + Vertical_Line (Line_Size => Natural (to - y), Line_Symbol => c); + end if; + end do_v_line; + + function padgetch (win : Window) return Key_Code is + c : Key_Code; + c2 : Character; + begin + c := Getchar (win); + c2 := Code_To_Char (c); + + case c2 is + when '!' => + ShellOut (False); + return Key_Refresh; + when Character'Val (Character'Pos ('r') mod 16#20#) => -- CTRL('r') + End_Windows; + Refresh; + return Key_Refresh; + when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') + return Key_Refresh; + when 'U' => + return Key_Cursor_Up; + when 'D' => + return Key_Cursor_Down; + when 'R' => + return Key_Cursor_Right; + when 'L' => + return Key_Cursor_Left; + when '+' => + return Key_Insert_Line; + when '-' => + return Key_Delete_Line; + when '>' => + return Key_Insert_Char; + when '<' => + return Key_Delete_Char; + -- when ERR=> /* FALLTHRU */ + when 'q' => + return (Key_Exit); + when others => + return (c); + end case; + end padgetch; + + show_panner_legend : Boolean := True; + + function panner_legend (line : Line_Position) return Boolean is + legend : constant array (0 .. 3) of String (1 .. 61) := + ( + "Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags) ", + "Use ! to shell-out. Toggle legend:?, timer:t, scroll mark:s.", + "Use +,- (or j,k) to grow/shrink the panner vertically. ", + "Use <,> (or h,l) to grow/shrink the panner horizontally. "); + legendsize : constant := 4; + + n : constant Integer := legendsize - Integer (Lines - line); + begin + if line < Lines and n >= 0 then + Move_Cursor (Line => line, Column => 0); + if show_panner_legend then + Add (Str => legend (n)); + end if; + Clear_To_End_Of_Line; + return show_panner_legend; + end if; + return False; + end panner_legend; + + procedure panner_legend (line : Line_Position) is + begin + if not panner_legend (line) then + Beep; + end if; + end panner_legend; + + procedure panner_h_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_x : Column_Position) is + begin + if not panner_legend (from_y) then + do_h_line (from_y, from_x, Blank2, to_x); + end if; + end panner_h_cleanup; + + procedure panner_v_cleanup (from_y : Line_Position; + from_x : Column_Position; + to_y : Line_Position) is + begin + if not panner_legend (from_y) then + do_v_line (from_y, from_x, Blank2, to_y); + end if; + end panner_v_cleanup; + + procedure panner (pad : Window; + top_xp : Column_Position; + top_yp : Line_Position; + portyp : Line_Position; + portxp : Column_Position; + pgetc : myfunc) is + + function f (y : Line_Position) return Line_Position; + function f (x : Column_Position) return Column_Position; + function greater (y1, y2 : Line_Position) return Integer; + function greater (x1, x2 : Column_Position) return Integer; + + top_x : Column_Position := top_xp; + top_y : Line_Position := top_yp; + porty : Line_Position := portyp; + portx : Column_Position := portxp; + + -- f[x] returns max[x - 1, 0] + function f (y : Line_Position) return Line_Position is + begin + if y > 0 then + return y - 1; + else + return y; -- 0 + end if; + end f; + + function f (x : Column_Position) return Column_Position is + begin + if x > 0 then + return x - 1; + else + return x; -- 0 + end if; + end f; + + function greater (y1, y2 : Line_Position) return Integer is + begin + if y1 > y2 then + return 1; + else + return 0; + end if; + end greater; + + function greater (x1, x2 : Column_Position) return Integer is + begin + if x1 > x2 then + return 1; + else + return 0; + end if; + end greater; + + pymax : Line_Position; + basey : Line_Position := 0; + pxmax : Column_Position; + basex : Column_Position := 0; + c : Key_Code; + scrollers : Boolean := True; + before, after : timestruct; + timing : Boolean := True; + + package floatio is new Ada.Text_IO.Float_IO (Long_Float); + begin + Get_Size (pad, pymax, pxmax); + Allow_Scrolling (Mode => False); -- we don't want stdscr to scroll! + + c := Key_Refresh; + loop + -- During shell-out, the user may have resized the window. Adjust + -- the port size of the pad to accommodate this. Ncurses + -- automatically resizes all of the normal windows to fit on the + -- new screen. + if top_x > Columns then + top_x := Columns; + end if; + if portx > Columns then + portx := Columns; + end if; + if top_y > Lines then + top_y := Lines; + end if; + if porty > Lines then + porty := Lines; + end if; + + case c is + when Key_Refresh | Character'Pos ('?') => + if c = Key_Refresh then + Erase; + else -- '?' + show_panner_legend := not show_panner_legend; + end if; + panner_legend (Lines - 4); + panner_legend (Lines - 3); + panner_legend (Lines - 2); + panner_legend (Lines - 1); + when Character'Pos ('t') => + timing := not timing; + if not timing then + panner_legend (Lines - 1); + end if; + when Character'Pos ('s') => + scrollers := not scrollers; + + -- Move the top-left corner of the pad, keeping the + -- bottom-right corner fixed. + when Character'Pos ('h') => + -- increase-columns: move left edge to left + if top_x = 0 then + Beep; + else + panner_v_cleanup (top_y, top_x, porty); + top_x := top_x - 1; + end if; + + when Character'Pos ('j') => + -- decrease-lines: move top-edge down + if top_y >= porty then + Beep; + else + if top_y /= 0 then + panner_h_cleanup (top_y - 1, f (top_x), portx); + end if; + top_y := top_y + 1; + end if; + when Character'Pos ('k') => + -- increase-lines: move top-edge up + if top_y = 0 then + Beep; + else + top_y := top_y - 1; + panner_h_cleanup (top_y, top_x, portx); + end if; + + when Character'Pos ('l') => + -- decrease-columns: move left-edge to right + if top_x >= portx then + Beep; + else + if top_x /= 0 then + panner_v_cleanup (f (top_y), top_x - 1, porty); + end if; + top_x := top_x + 1; + end if; + + -- Move the bottom-right corner of the pad, keeping the + -- top-left corner fixed. + when Key_Insert_Char => + -- increase-columns: move right-edge to right + if portx >= pxmax or portx >= Columns then + Beep; + else + panner_v_cleanup (f (top_y), portx - 1, porty); + portx := portx + 1; + -- C had ++portx instead of portx++, weird. + end if; + when Key_Insert_Line => + -- increase-lines: move bottom-edge down + if porty >= pymax or porty >= Lines then + Beep; + else + panner_h_cleanup (porty - 1, f (top_x), portx); + porty := porty + 1; + end if; + + when Key_Delete_Char => + -- decrease-columns: move bottom edge up + if portx <= top_x then + Beep; + else + portx := portx - 1; + panner_v_cleanup (f (top_y), portx, porty); + end if; + + when Key_Delete_Line => + -- decrease-lines + if porty <= top_y then + Beep; + else + porty := porty - 1; + panner_h_cleanup (porty, f (top_x), portx); + end if; + when Key_Cursor_Left => + -- pan leftwards + if basex > 0 then + basex := basex - 1; + else + Beep; + end if; + when Key_Cursor_Right => + -- pan rightwards + -- if (basex + portx - (pymax > porty) < pxmax) + if basex + portx - + Column_Position (greater (pymax, porty)) < pxmax then + -- if basex + portx < pxmax or + -- (pymax > porty and basex + portx - 1 < pxmax) then + basex := basex + 1; + else + Beep; + end if; + + when Key_Cursor_Up => + -- pan upwards + if basey > 0 then + basey := basey - 1; + else + Beep; + end if; + + when Key_Cursor_Down => + -- pan downwards + -- same as if (basey + porty - (pxmax > portx) < pymax) + if basey + porty - + Line_Position (greater (pxmax, portx)) < pymax then + -- if (basey + porty < pymax) or + -- (pxmax > portx and basey + porty - 1 < pymax) then + basey := basey + 1; + else + Beep; + end if; + + when Character'Pos ('H') | + Key_Home | + Key_Find => + basey := 0; + + when Character'Pos ('E') | + Key_End | + Key_Select => + if pymax < porty then + basey := 0; + else + basey := pymax - porty; + end if; + + when others => + Beep; + end case; + + -- more writing off the screen. + -- Interestingly, the exception is not handled if + -- we put a block around this. + -- delcare --begin + if top_y /= 0 and top_x /= 0 then + Add (Line => top_y - 1, Column => top_x - 1, + Ch => ACS_Map (ACS_Upper_Left_Corner)); + end if; + if top_x /= 0 then + do_v_line (top_y, top_x - 1, ACS_Map (ACS_Vertical_Line), porty); + end if; + if top_y /= 0 then + do_h_line (top_y - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); + end if; + -- exception when Curses_Exception => null; end; + + -- in C was ... pxmax > portx - 1 + if scrollers and pxmax >= portx then + declare + length : constant Column_Position := portx - top_x - 1; + lowend, highend : Column_Position; + begin + -- Instead of using floats, I'll use integers only. + lowend := top_x + (basex * length) / pxmax; + highend := top_x + ((basex + length) * length) / pxmax; + + do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), + lowend); + if highend < portx then + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => True); + do_h_line (porty - 1, lowend, Blank2, highend + 1); + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => False); + do_h_line (porty - 1, highend + 1, + ACS_Map (ACS_Horizontal_Line), portx); + end if; + end; + else + do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); + end if; + + if scrollers and pymax >= porty then + declare + length : constant Line_Position := porty - top_y - 1; + lowend, highend : Line_Position; + begin + lowend := top_y + (basey * length) / pymax; + highend := top_y + ((basey + length) * length) / pymax; + + do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), + lowend); + if highend < porty then + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => True); + do_v_line (lowend, portx - 1, Blank2, highend + 1); + Switch_Character_Attribute + (Attr => (Reverse_Video => True, others => False), + On => False); + do_v_line (highend + 1, portx - 1, + ACS_Map (ACS_Vertical_Line), porty); + end if; + end; + else + do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), porty); + end if; + + if top_y /= 0 then + Add (Line => top_y - 1, Column => portx - 1, + Ch => ACS_Map (ACS_Upper_Right_Corner)); + end if; + if top_x /= 0 then + Add (Line => porty - 1, Column => top_x - 1, + Ch => ACS_Map (ACS_Lower_Left_Corner)); + end if; + declare + begin + -- Here is another place where it is possible + -- to write to the corner of the screen. + Add (Line => porty - 1, Column => portx - 1, + Ch => ACS_Map (ACS_Lower_Right_Corner)); + exception + when Curses_Exception => null; + end; + + before := gettime; + + Refresh_Without_Update; + + declare + -- the C version allows the panel to have a zero height + -- wich raise the exception + begin + Refresh_Without_Update + ( + pad, + basey, basex, + top_y, top_x, + porty - Line_Position (greater (pxmax, portx)) - 1, + portx - Column_Position (greater (pymax, porty)) - 1); + exception + when Curses_Exception => null; + end; + + Update_Screen; + + if timing then + declare + s : String (1 .. 7); + elapsed : Long_Float; + begin + after := gettime; + elapsed := (Long_Float (after.seconds - before.seconds) + + Long_Float (after.microseconds + - before.microseconds) + / 1.0e6); + Move_Cursor (Line => Lines - 1, Column => Columns - 20); + floatio.Put (s, elapsed, Aft => 3, Exp => 0); + Add (Str => s); + Refresh; + end; + end if; + + c := pgetc (pad); + exit when c = Key_Exit; + + end loop; + + Allow_Scrolling (Mode => True); + + end panner; + + Gridsize : constant := 3; + Gridcount : Integer := 0; + + Pad_High : constant Line_Count := 200; + Pad_Wide : constant Column_Count := 200; + panpad : Window := New_Pad (Pad_High, Pad_Wide); +begin + if panpad = Null_Window then + Cannot ("cannot create requested pad"); + return; + end if; + + for i in 0 .. Pad_High - 1 loop + for j in 0 .. Pad_Wide - 1 loop + if i mod Gridsize = 0 and j mod Gridsize = 0 then + if i = 0 or j = 0 then + Add (panpad, '+'); + else + -- depends on ASCII? + Add (panpad, + Ch => Character'Val (Character'Pos ('A') + + Gridcount mod 26)); + Gridcount := Gridcount + 1; + end if; + elsif i mod Gridsize = 0 then + Add (panpad, '-'); + elsif j mod Gridsize = 0 then + Add (panpad, '|'); + else + declare + -- handle the write to the lower right corner error + begin + Add (panpad, ' '); + exception + when Curses_Exception => null; + end; + end if; + end loop; + end loop; + panner_legend (Lines - 4); + panner_legend (Lines - 3); + panner_legend (Lines - 2); + panner_legend (Lines - 1); + + Set_KeyPad_Mode (panpad, True); + -- Make the pad (initially) narrow enough that a trace file won't wrap. + -- We'll still be able to widen it during a test, since that's required + -- for testing boundaries. + + panner (panpad, 2, 2, Lines - 5, Columns - 15, padgetch'Access); + + Delete (panpad); + End_Windows; -- Hmm, Erase after End_Windows + Erase; +end ncurses2.demo_pad; diff --git a/Ada95/samples/ncurses2-demo_pad.ads b/Ada95/samples/ncurses2-demo_pad.ads new file mode 100644 index 00000000000..b996263c1cd --- /dev/null +++ b/Ada95/samples/ncurses2-demo_pad.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_pad; diff --git a/Ada95/samples/ncurses2-demo_panels.adb b/Ada95/samples/ncurses2-demo_panels.adb new file mode 100644 index 00000000000..d2558ed4730 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_panels.adb @@ -0,0 +1,382 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2004,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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.6 $ +-- $Date: 2008/08/30 23:35:01 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Panels.User_Data; + +with ncurses2.genericPuts; + +procedure ncurses2.demo_panels (nap_mseci : Integer) is + use Int_IO; + + function mkpanel (color : Color_Number; + rows : Line_Count; + cols : Column_Count; + tly : Line_Position; + tlx : Column_Position) return Panel; + procedure rmpanel (pan : in out Panel); + procedure pflush; + procedure wait_a_while (msec : Integer); + procedure saywhat (text : String); + procedure fill_panel (pan : Panel); + + nap_msec : Integer := nap_mseci; + + function mkpanel (color : Color_Number; + rows : Line_Count; + cols : Column_Count; + tly : Line_Position; + tlx : Column_Position) return Panel is + win : Window; + pan : Panel := Null_Panel; + begin + win := New_Window (rows, cols, tly, tlx); + if Null_Window /= win then + pan := New_Panel (win); + if pan = Null_Panel then + Delete (win); + elsif Has_Colors then + declare + fg, bg : Color_Number; + begin + if color = Blue then + fg := White; + else + fg := Black; + end if; + bg := color; + Init_Pair (Color_Pair (color), fg, bg); + Set_Background (win, (Ch => ' ', + Attr => Normal_Video, + Color => Color_Pair (color))); + end; + else + Set_Background (win, (Ch => ' ', + Attr => (Bold_Character => True, + others => False), + Color => Color_Pair (color))); + end if; + end if; + return pan; + end mkpanel; + + procedure rmpanel (pan : in out Panel) is + win : Window := Panel_Window (pan); + begin + Delete (pan); + Delete (win); + end rmpanel; + + procedure pflush is + begin + Update_Panels; + Update_Screen; + end pflush; + + procedure wait_a_while (msec : Integer) is + begin + -- The C version had some #ifdef blocks here + if msec = 1 then + Getchar; + else + Nap_Milli_Seconds (msec); + end if; + end wait_a_while; + + procedure saywhat (text : String) is + begin + Move_Cursor (Line => Lines - 1, Column => 0); + Clear_To_End_Of_Line; + Add (Str => text); + end saywhat; + + -- from sample-curses_demo.adb + type User_Data is new String (1 .. 2); + type User_Data_Access is access all User_Data; + package PUD is new Panels.User_Data (User_Data, User_Data_Access); + + use PUD; + + procedure fill_panel (pan : Panel) is + win : constant Window := Panel_Window (pan); + num : constant Character := Get_User_Data (pan) (2); + tmp6 : String (1 .. 6) := "-panx-"; + maxy : Line_Count; + maxx : Column_Count; + + begin + Move_Cursor (win, 1, 1); + tmp6 (5) := num; + Add (win, Str => tmp6); + Clear_To_End_Of_Line (win); + Box (win); + Get_Size (win, maxy, maxx); + for y in 2 .. maxy - 3 loop + for x in 1 .. maxx - 3 loop + Move_Cursor (win, y, x); + Add (win, num); + end loop; + end loop; + exception + when Curses_Exception => null; + end fill_panel; + + modstr : constant array (0 .. 5) of String (1 .. 5) := + ("test ", + "TEST ", + "(**) ", + "*()* ", + "<--> ", + "LAST " + ); + + package p is new ncurses2.genericPuts (1024); + use p; + use p.BS; + -- the C version said register int y, x; + tmpb : BS.Bounded_String; + +begin + Refresh; + + for y in 0 .. Integer (Lines - 2) loop + for x in 0 .. Integer (Columns - 1) loop + myPut (tmpb, (y + x) mod 10); + myAdd (Str => tmpb); + end loop; + end loop; + for y in 0 .. 4 loop + declare + p1, p2, p3, p4, p5 : Panel; + U1 : constant User_Data_Access := new User_Data'("p1"); + U2 : constant User_Data_Access := new User_Data'("p2"); + U3 : constant User_Data_Access := new User_Data'("p3"); + U4 : constant User_Data_Access := new User_Data'("p4"); + U5 : constant User_Data_Access := new User_Data'("p5"); + + begin + p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0); + Set_User_Data (p1, U1); + p2 := mkpanel (Green, Lines / 2 + 1, Columns / 7, Lines / 4, + Columns / 10); + Set_User_Data (p2, U2); + p3 := mkpanel (Yellow, Lines / 4, Columns / 10, Lines / 2, + Columns / 9); + Set_User_Data (p3, U3); + p4 := mkpanel (Blue, Lines / 2 - 2, Columns / 8, Lines / 2 - 2, + Columns / 3); + Set_User_Data (p4, U4); + p5 := mkpanel (Magenta, Lines / 2 - 2, Columns / 8, Lines / 2, + Columns / 2 - 2); + Set_User_Data (p5, U5); + + fill_panel (p1); + fill_panel (p2); + fill_panel (p3); + fill_panel (p4); + fill_panel (p5); + Hide (p4); + Hide (p5); + pflush; + saywhat ("press any key to continue"); + wait_a_while (nap_msec); + + saywhat ("h3 s1 s2 s4 s5; press any key to continue"); + Move (p1, 0, 0); + Hide (p3); + Show (p1); + Show (p2); + Show (p4); + Show (p5); + pflush; + wait_a_while (nap_msec); + + saywhat ("s1; press any key to continue"); + Show (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("s2; press any key to continue"); + Show (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("m2; press any key to continue"); + Move (p2, Lines / 3 + 1, Columns / 8); + pflush; + wait_a_while (nap_msec); + + saywhat ("s3;"); + Show (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("m3; press any key to continue"); + Move (p3, Lines / 4 + 1, Columns / 15); + pflush; + wait_a_while (nap_msec); + + saywhat ("b3; press any key to continue"); + Bottom (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("s4; press any key to continue"); + Show (p4); + pflush; + wait_a_while (nap_msec); + + saywhat ("s5; press any key to continue"); + Show (p5); + pflush; + wait_a_while (nap_msec); + + saywhat ("t3; press any key to continue"); + Top (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("t1; press any key to continue"); + Top (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("t2; press any key to continue"); + Top (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("t3; press any key to continue"); + Top (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("t4; press any key to continue"); + Top (p4); + pflush; + wait_a_while (nap_msec); + + for itmp in 0 .. 5 loop + declare + w4 : constant Window := Panel_Window (p4); + w5 : constant Window := Panel_Window (p5); + begin + + saywhat ("m4; press any key to continue"); + Move_Cursor (w4, Lines / 8, 1); + Add (w4, modstr (itmp)); + Move (p4, Lines / 6, Column_Position (itmp) * (Columns / 8)); + Move_Cursor (w5, Lines / 6, 1); + Add (w5, modstr (itmp)); + pflush; + wait_a_while (nap_msec); + + saywhat ("m5; press any key to continue"); + Move_Cursor (w4, Lines / 6, 1); + Add (w4, modstr (itmp)); + Move (p5, Lines / 3 - 1, (Column_Position (itmp) * 10) + 6); + Move_Cursor (w5, Lines / 8, 1); + Add (w5, modstr (itmp)); + pflush; + wait_a_while (nap_msec); + end; + end loop; + + saywhat ("m4; press any key to continue"); + Move (p4, Lines / 6, 6 * (Columns / 8)); + -- Move(p4, Lines / 6, itmp * (Columns / 8)); + pflush; + wait_a_while (nap_msec); + + saywhat ("t5; press any key to continue"); + Top (p5); + pflush; + wait_a_while (nap_msec); + + saywhat ("t2; press any key to continue"); + Top (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("t1; press any key to continue"); + Top (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("d2; press any key to continue"); + rmpanel (p2); + pflush; + wait_a_while (nap_msec); + + saywhat ("h3; press any key to continue"); + Hide (p3); + pflush; + wait_a_while (nap_msec); + + saywhat ("d1; press any key to continue"); + rmpanel (p1); + pflush; + wait_a_while (nap_msec); + + saywhat ("d4; press any key to continue"); + rmpanel (p4); + pflush; + wait_a_while (nap_msec); + + saywhat ("d5; press any key to continue"); + rmpanel (p5); + pflush; + wait_a_while (nap_msec); + if nap_msec = 1 then + exit; + else + nap_msec := 100; + end if; + + end; + end loop; + + Erase; + End_Windows; + +end ncurses2.demo_panels; diff --git a/Ada95/samples/ncurses2-demo_panels.ads b/Ada95/samples/ncurses2-demo_panels.ads new file mode 100644 index 00000000000..eb2878c8501 --- /dev/null +++ b/Ada95/samples/ncurses2-demo_panels.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.demo_panels (nap_mseci : Integer); diff --git a/Ada95/samples/ncurses2-flushinp_test.adb b/Ada95/samples/ncurses2-flushinp_test.adb new file mode 100644 index 00000000000..9ea98e158c3 --- /dev/null +++ b/Ada95/samples/ncurses2-flushinp_test.adb @@ -0,0 +1,135 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with ncurses2.util; use ncurses2.util; + +procedure ncurses2.flushinp_test (win : Window) is + + procedure Continue (win : Window); + + procedure Continue (win : Window) is + begin + Set_Echo_Mode (False); + Move_Cursor (win, 10, 1); + Add (win, 10, 1, " Press any key to continue"); + Refresh (win); + Getchar (win); + end Continue; + + h, by, sh : Line_Position; + w, bx, sw : Column_Position; + + subWin : Window; + +begin + Clear (win); + Get_Size (win, h, w); + Get_Window_Position (win, by, bx); + sw := w / 3; + sh := h / 3; + subWin := Sub_Window (win, sh, sw, by + h - sh - 2, bx + w - sw - 2); + + if Has_Colors then + Init_Pair (2, Cyan, Blue); + Change_Background (subWin, + Attributed_Character'(Ch => ' ', Color => 2, + Attr => Normal_Video)); + end if; + + Set_Character_Attributes (subWin, + (Bold_Character => True, others => False)); + Box (subWin); + Add (subWin, 2, 1, "This is a subwindow"); + Refresh (win); + + Set_Cbreak_Mode (True); + Add (win, 0, 1, "This is a test of the flushinp() call."); + + Add (win, 2, 1, "Type random keys for 5 seconds."); + Add (win, 3, 1, + "These should be discarded (not echoed) after the subwindow " & + "goes away."); + Refresh (win); + + for i in 0 .. 4 loop + Move_Cursor (subWin, 1, 1); + Add (subWin, Str => "Time = "); + Add (subWin, Str => Integer'Image (i)); + Refresh (subWin); + Nap_Milli_Seconds (1000); + Flush_Input; + end loop; + + Delete (subWin); + Erase (win); + Flash_Screen; + Refresh (win); + Nap_Milli_Seconds (1000); + + Add (win, 2, 1, + Str => "If you were still typing when the window timer expired,"); + Add (win, 3, 1, + "or else you typed nothing at all while it was running,"); + Add (win, 4, 1, + "test was invalid. You'll see garbage or nothing at all. "); + Add (win, 6, 1, "Press a key"); + Move_Cursor (win, 9, 10); + Refresh (win); + Set_Echo_Mode (True); + Getchar (win); + Flush_Input; + Add (win, 12, 0, + "If you see any key other than what you typed, flushinp() is broken."); + Continue (win); + + Move_Cursor (win, 9, 10); + Delete_Character (win); + Refresh (win); + Move_Cursor (win, 12, 0); + Clear_To_End_Of_Line; + Add (win, + "What you typed should now have been deleted; if not, wdelch() " & + "failed."); + Continue (win); + + Set_Cbreak_Mode (True); + +end ncurses2.flushinp_test; diff --git a/Ada95/samples/ncurses2-flushinp_test.ads b/Ada95/samples/ncurses2-flushinp_test.ads new file mode 100644 index 00000000000..5376c94a54b --- /dev/null +++ b/Ada95/samples/ncurses2-flushinp_test.ads @@ -0,0 +1,43 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; + +procedure ncurses2.flushinp_test (win : Terminal_Interface.Curses.Window); diff --git a/Ada95/samples/ncurses2-genericputs.adb b/Ada95/samples/ncurses2-genericputs.adb new file mode 100644 index 00000000000..829d08d23a2 --- /dev/null +++ b/Ada95/samples/ncurses2-genericputs.adb @@ -0,0 +1,117 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.4 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body ncurses2.genericPuts is + + procedure myGet (Win : Window := Standard_Window; + Str : out BS.Bounded_String; + Len : Integer := -1) + is + function Wgetnstr (Win : Window; + Str : char_array; + Len : int) return int; + pragma Import (C, Wgetnstr, "wgetnstr"); + + N : Integer := Len; + Txt : char_array (0 .. size_t (Max_Length)); + xStr : String (1 .. Max_Length); + Cnt : Natural; + begin + if N < 0 then + N := Max_Length; + end if; + if N > Max_Length then + raise Constraint_Error; + end if; + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + To_Ada (Txt, xStr, Cnt, True); + Str := To_Bounded_String (xStr (1 .. Cnt)); + end myGet; + + procedure myPut (Str : out BS.Bounded_String; + i : Integer; + Base : Number_Base := 10) is + package Int_IO is new Integer_IO (Integer); use Int_IO; + tmp : String (1 .. BS.Max_Length); + begin + Put (tmp, i, Base); + Str := To_Bounded_String (tmp); + Trim (Str, Ada.Strings.Trim_End'(Ada.Strings.Left)); + end myPut; + + procedure myAdd (Str : BS.Bounded_String) is + begin + Add (Str => To_String (Str)); + end myAdd; + + -- from ncurses-aux + procedure Fill_String (Cp : chars_ptr; + Str : out BS.Bounded_String) + is + -- Fill the string with the characters referenced by the + -- chars_ptr. + -- + Len : Natural; + begin + if Cp /= Null_Ptr then + Len := Natural (Strlen (Cp)); + if Max_Length < Len then + raise Constraint_Error; + end if; + declare + S : String (1 .. Len); + begin + S := Value (Cp); + Str := To_Bounded_String (S); + end; + else + Str := Null_Bounded_String; + end if; + + end Fill_String; + +end ncurses2.genericPuts; diff --git a/Ada95/samples/ncurses2-genericputs.ads b/Ada95/samples/ncurses2-genericputs.ads new file mode 100644 index 00000000000..accc3cc63d7 --- /dev/null +++ b/Ada95/samples/ncurses2-genericputs.ads @@ -0,0 +1,72 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2006,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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.3 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Ada.Text_IO; use Ada.Text_IO; +with Ada.Strings.Bounded; +use Ada.Strings.Bounded; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Terminal_Interface.Curses; + +generic + Max : Natural; + -- type mystring is private; + -- type myint is +package ncurses2.genericPuts is + package BS is new + Ada.Strings.Bounded.Generic_Bounded_Length (Max); + use BS; + + procedure myGet (Win : Terminal_Interface.Curses.Window + := Terminal_Interface.Curses.Standard_Window; + Str : out BS.Bounded_String; + Len : Integer := -1); + + procedure myPut (Str : out BS.Bounded_String; + i : Integer; + Base : Number_Base := 10); + -- the default should be Ada.Text_IO.Integer_IO.Default_Base + -- but Default_Base is hidden in the generic so doesn't exist! + procedure myAdd (Str : BS.Bounded_String); + + procedure Fill_String (Cp : chars_ptr; Str : out BS.Bounded_String); +end ncurses2.genericPuts; diff --git a/Ada95/samples/ncurses2-getch.ads b/Ada95/samples/ncurses2-getch.ads new file mode 100644 index 00000000000..21a09f3160f --- /dev/null +++ b/Ada95/samples/ncurses2-getch.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure getch_test; diff --git a/Ada95/samples/ncurses2-getch_test.adb b/Ada95/samples/ncurses2-getch_test.adb new file mode 100644 index 00000000000..2802cfb5501 --- /dev/null +++ b/Ada95/samples/ncurses2-getch_test.adb @@ -0,0 +1,254 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.8 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- Character input test +-- test the keypad feature + +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; +with Ada.Characters.Handling; +with Ada.Strings.Bounded; + +with ncurses2.genericPuts; + +procedure ncurses2.getch_test is + use Int_IO; + + function mouse_decode (ep : Mouse_Event) return String; + + function mouse_decode (ep : Mouse_Event) return String is + Y : Line_Position; + X : Column_Position; + Button : Mouse_Button; + State : Button_State; + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); + use BS; + buf : Bounded_String := To_Bounded_String (""); + begin + -- Note that these bindings do not allow + -- two button states, + -- The C version can print {click-1, click-3} for example. + -- They also don't have the 'id' or z coordinate. + Get_Event (ep, Y, X, Button, State); + + -- TODO Append (buf, "id "); from C version + Append (buf, "at ("); + Append (buf, Column_Position'Image (X)); + Append (buf, ", "); + Append (buf, Line_Position'Image (Y)); + Append (buf, ") state"); + Append (buf, Mouse_Button'Image (Button)); + + Append (buf, " = "); + Append (buf, Button_State'Image (State)); + return To_String (buf); + end mouse_decode; + + buf : String (1 .. 1024); -- TODO was BUFSIZE + n : Integer; + c : Key_Code; + blockflag : Timeout_Mode := Blocking; + firsttime : Boolean := True; + tmp2 : Event_Mask; + tmp6 : String (1 .. 6); + tmp20 : String (1 .. 20); + x : Column_Position; + y : Line_Position; + tmpx : Integer; + incount : Integer := 0; + +begin + Refresh; + tmp2 := Start_Mouse (All_Events); + Add (Str => "Delay in 10ths of a second ( for blocking input)? "); + Set_Echo_Mode (SwitchOn => True); + Get (Str => buf); + + Set_Echo_Mode (SwitchOn => False); + Set_NL_Mode (SwitchOn => False); + + if Ada.Characters.Handling.Is_Digit (buf (1)) then + Get (Item => n, From => buf, Last => tmpx); + Set_Timeout_Mode (Mode => Delayed, Amount => n * 100); + blockflag := Delayed; + end if; + + c := Character'Pos ('?'); + Set_Raw_Mode (SwitchOn => True); + loop + if not firsttime then + Add (Str => "Key pressed: "); + Put (tmp6, Integer (c), 8); + Add (Str => tmp6); + Add (Ch => ' '); + if c = Key_Mouse then + declare + event : Mouse_Event; + begin + event := Get_Mouse; + Add (Str => "KEY_MOUSE, "); + Add (Str => mouse_decode (event)); + Add (Ch => newl); + end; + elsif c >= Key_Min then + Key_Name (c, tmp20); + Add (Str => tmp20); + -- I used tmp and got bitten by the length problem:-> + Add (Ch => newl); + elsif c > 16#80# then -- TODO fix, use constant if possible + declare + c2 : constant Character := Character'Val (c mod 16#80#); + begin + if Ada.Characters.Handling.Is_Graphic (c2) then + Add (Str => "M-"); + Add (Ch => c2); + else + Add (Str => "M-"); + Add (Str => Un_Control ((Ch => c2, + Color => Color_Pair'First, + Attr => Normal_Video))); + end if; + Add (Str => " (high-half character)"); + Add (Ch => newl); + end; + else + declare + c2 : constant Character := Character'Val (c mod 16#80#); + begin + if Ada.Characters.Handling.Is_Graphic (c2) then + Add (Ch => c2); + Add (Str => " (ASCII printable character)"); + Add (Ch => newl); + else + Add (Str => Un_Control ((Ch => c2, + Color => Color_Pair'First, + Attr => Normal_Video))); + Add (Str => " (ASCII control character)"); + Add (Ch => newl); + end if; + end; + end if; + -- TODO I am not sure why this was in the C version + -- the delay statement scroll anyway. + Get_Cursor_Position (Line => y, Column => x); + if y >= Lines - 1 then + Move_Cursor (Line => 0, Column => 0); + end if; + Clear_To_End_Of_Line; + end if; + + firsttime := False; + if c = Character'Pos ('g') then + declare + package p is new ncurses2.genericPuts (1024); + use p; + use p.BS; + timedout : Boolean := False; + boundedbuf : Bounded_String; + begin + Add (Str => "getstr test: "); + Set_Echo_Mode (SwitchOn => True); + -- Note that if delay mode is set + -- Get can raise an exception. + -- The C version would print the string it had so far + -- also TODO get longer length string, like the C version + declare begin + myGet (Str => boundedbuf); + exception when Curses_Exception => + Add (Str => "Timed out."); + Add (Ch => newl); + timedout := True; + end; + -- note that the Ada Get will stop reading at 1024. + if not timedout then + Set_Echo_Mode (SwitchOn => False); + Add (Str => " I saw '"); + myAdd (Str => boundedbuf); + Add (Str => "'."); + Add (Ch => newl); + end if; + end; + elsif c = Character'Pos ('s') then + ShellOut (True); + elsif c = Character'Pos ('x') or c = Character'Pos ('q') or + (c = Key_None and blockflag = Blocking) then + exit; + elsif c = Character'Pos ('?') then + Add (Str => "Type any key to see its keypad value. Also:"); + Add (Ch => newl); + Add (Str => "g -- triggers a getstr test"); + Add (Ch => newl); + Add (Str => "s -- shell out"); + Add (Ch => newl); + Add (Str => "q -- quit"); + Add (Ch => newl); + Add (Str => "? -- repeats this help message"); + Add (Ch => newl); + end if; + + loop + c := Getchar; + exit when c /= Key_None; + if blockflag /= Blocking then + Put (tmp6, incount); -- argh string length! + Add (Str => tmp6); + Add (Str => ": input timed out"); + Add (Ch => newl); + else + Put (tmp6, incount); + Add (Str => tmp6); + Add (Str => ": input error"); + Add (Ch => newl); + exit; + end if; + incount := incount + 1; + end loop; + end loop; + + End_Mouse (tmp2); + Set_Timeout_Mode (Mode => Blocking, Amount => 0); -- amount is ignored + Set_Raw_Mode (SwitchOn => False); + Set_NL_Mode (SwitchOn => True); + Erase; + End_Windows; +end ncurses2.getch_test; diff --git a/Ada95/samples/ncurses2-getch_test.ads b/Ada95/samples/ncurses2-getch_test.ads new file mode 100644 index 00000000000..78a0a48c172 --- /dev/null +++ b/Ada95/samples/ncurses2-getch_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.getch_test; diff --git a/Ada95/samples/ncurses2-getopt.adb b/Ada95/samples/ncurses2-getopt.adb new file mode 100644 index 00000000000..238c43919ea --- /dev/null +++ b/Ada95/samples/ncurses2-getopt.adb @@ -0,0 +1,163 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2004,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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.7 $ +-- $Date: 2008/07/26 18:46:44 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- A simplified version of the GNU getopt function +-- copyright Free Software Foundtion + +with Ada.Strings.Fixed; +with Ada.Strings.Bounded; +with Ada.Text_IO; use Ada.Text_IO; + +package body ncurses2.getopt is + + nextchar : Natural := 0; + + -- Ncurses doesn't use the non option elements so we are spared + -- the job of computing those. + + -- also the user is not allowed to modify argv or argc + -- Doing so is Erroneous execution. + + -- longoptions are not handled. + + procedure Qgetopt (retval : out Integer; + argc : Integer; + argv : stringfunc; + -- argv will be the Argument function. + optstring : String; + optind : in out Integer; + -- ignored for ncurses, must be initialized to 1 by + -- the caller + Optarg : out stringa + -- a garbage colector would be useful here. + ) is + + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); + use BS; + optargx : Bounded_String; + begin + + if argc < optind then + retval := -1; + return; + end if; + + optargx := To_Bounded_String (""); + + if nextchar = 0 then + + if argv (optind) = "--" then + -- the rest are non-options, we ignore them + retval := -1; + return; + end if; + + if argv (optind)(1) /= '-' or argv (optind)'Length = 1 then + optind := optind + 1; + Optarg := new String'(argv (optind)); + retval := 1; + return; + end if; + + nextchar := 2; -- skip the one hyphen. + end if; + + -- Look at and handle the next short option-character. + declare + c : Character := argv (optind) (nextchar); + temp : constant Natural := + Ada.Strings.Fixed.Index (optstring, String'(1 => c)); + begin + if temp = 0 or c = ':' then + Put_Line (Standard_Error, + argv (optind) & ": invalid option -- " & c); + c := '?'; + return; + end if; + + if optstring (temp + 1) = ':' then + if optstring (temp + 2) = ':' then + -- This is an option that accepts an argument optionally. + if nextchar /= argv (optind)'Length then + optargx := To_Bounded_String + (argv (optind) (nextchar .. argv (optind)'Length)); + else + Optarg := null; + end if; + else + -- This is an option that requires an argument. + if nextchar /= argv (optind)'Length then + optargx := To_Bounded_String + (argv (optind) (nextchar .. argv (optind)'Length)); + optind := optind + 1; + elsif optind = argc then + Put_Line (Standard_Error, + argv (optind) & + ": option requires an argument -- " & c); + if optstring (optstring'First) = ':' then + c := ':'; + else + c := '?'; + end if; + else + -- increment it again when taking next ARGV-elt as argument. + optind := optind + 1; + optargx := To_Bounded_String (argv (optind)); + optind := optind + 1; + end if; + end if; + nextchar := 0; + else -- no argument for the option + if nextchar = argv (optind)'Length then + optind := optind + 1; + nextchar := 0; + else + nextchar := nextchar + 1; + end if; + end if; + + retval := Character'Pos (c); + Optarg := new String'(To_String (optargx)); + return; + end; + end Qgetopt; + +end ncurses2.getopt; diff --git a/Ada95/samples/ncurses2-getopt.ads b/Ada95/samples/ncurses2-getopt.ads new file mode 100644 index 00000000000..a8b356e968d --- /dev/null +++ b/Ada95/samples/ncurses2-getopt.ads @@ -0,0 +1,60 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.2 $ +-- $Date: 2006/06/25 14:24:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package ncurses2.getopt is + + type stringa is access String; + + type stringfunc is access + function (n : Positive) return String; + + procedure Qgetopt (retval : out Integer; + argc : Integer; + argv : stringfunc; + optstring : String; + optind : in out Integer; + -- ignored for ncurses, must be initialized to 0 + -- by the caller + Optarg : out stringa + -- a garbage collector would be useful here. + ); + +end ncurses2.getopt; diff --git a/Ada95/samples/ncurses2-m.adb b/Ada95/samples/ncurses2-m.adb new file mode 100644 index 00000000000..5b20428c20a --- /dev/null +++ b/Ada95/samples/ncurses2-m.adb @@ -0,0 +1,448 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.8 $ +-- $Date: 2008/07/26 18:47:50 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- TODO use Default_Character where appropriate + +-- This is an Ada version of ncurses +-- I translated this because it tests the most features. + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; + +with Ada.Text_IO; use Ada.Text_IO; + +with Ada.Characters.Latin_1; +-- with Ada.Characters.Handling; + +with Ada.Command_Line; use Ada.Command_Line; + +with Ada.Strings.Unbounded; + +with ncurses2.util; use ncurses2.util; +with ncurses2.getch_test; +with ncurses2.attr_test; +with ncurses2.color_test; +with ncurses2.demo_panels; +with ncurses2.color_edit; +with ncurses2.slk_test; +with ncurses2.acs_display; +with ncurses2.acs_and_scroll; +with ncurses2.flushinp_test; +with ncurses2.test_sgr_attributes; +with ncurses2.menu_test; +with ncurses2.demo_pad; +with ncurses2.demo_forms; +with ncurses2.overlap_test; +with ncurses2.trace_set; + +with ncurses2.getopt; use ncurses2.getopt; + +package body ncurses2.m is + use Int_IO; + + function To_trace (n : Integer) return Trace_Attribute_Set; + procedure usage; + procedure Set_Terminal_Modes; + function Do_Single_Test (c : Character) return Boolean; + + function To_trace (n : Integer) return Trace_Attribute_Set is + a : Trace_Attribute_Set := (others => False); + m : Integer; + rest : Integer; + begin + m := n mod 2; + if 1 = m then + a.Times := True; + end if; + rest := n / 2; + + m := rest mod 2; + if 1 = m then + a.Tputs := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Update := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Cursor_Move := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Character_Output := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Calls := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Virtual_Puts := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Input_Events := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.TTY_State := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Internal_Calls := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Character_Calls := True; + end if; + rest := rest / 2; + m := rest mod 2; + if 1 = m then + a.Termcap_TermInfo := True; + end if; + + return a; + end To_trace; + + -- these are type Stdscr_Init_Proc; + + function rip_footer ( + Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, rip_footer); + + function rip_footer ( + Win : Window; + Columns : Column_Count) return Integer is + begin + Set_Background (Win, (Ch => ' ', + Attr => (Reverse_Video => True, others => False), + Color => 0)); + Erase (Win); + Move_Cursor (Win, 0, 0); + Add (Win, "footer:" & Columns'Img & " columns"); + Refresh_Without_Update (Win); + return 0; -- Curses_OK; + end rip_footer; + + function rip_header ( + Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, rip_header); + + function rip_header ( + Win : Window; + Columns : Column_Count) return Integer is + begin + Set_Background (Win, (Ch => ' ', + Attr => (Reverse_Video => True, others => False), + Color => 0)); + Erase (Win); + Move_Cursor (Win, 0, 0); + Add (Win, "header:" & Columns'Img & " columns"); + -- 'Img is a GNAT extention + Refresh_Without_Update (Win); + return 0; -- Curses_OK; + end rip_header; + + procedure usage is + -- type Stringa is access String; + use Ada.Strings.Unbounded; + -- tbl : constant array (Positive range <>) of Stringa := ( + tbl : constant array (Positive range <>) of Unbounded_String + := ( + To_Unbounded_String ("Usage: ncurses [options]"), + To_Unbounded_String (""), + To_Unbounded_String ("Options:"), + To_Unbounded_String (" -a f,b set default-colors " & + "(assumed white-on-black)"), + To_Unbounded_String (" -d use default-colors if terminal " & + "supports them"), + To_Unbounded_String (" -e fmt specify format for soft-keys " & + "test (e)"), + To_Unbounded_String (" -f rip-off footer line " & + "(can repeat)"), + To_Unbounded_String (" -h rip-off header line " & + "(can repeat)"), + To_Unbounded_String (" -s msec specify nominal time for " & + "panel-demo (default: 1, to hold)"), + To_Unbounded_String (" -t mask specify default trace-level " & + "(may toggle with ^T)") + ); + begin + for n in tbl'Range loop + Put_Line (Standard_Error, To_String (tbl (n))); + end loop; + -- exit(EXIT_FAILURE); + -- TODO should we use Set_Exit_Status and throw and exception? + end usage; + + procedure Set_Terminal_Modes is begin + Set_Raw_Mode (SwitchOn => False); + Set_Cbreak_Mode (SwitchOn => True); + Set_Echo_Mode (SwitchOn => False); + Allow_Scrolling (Mode => True); + Use_Insert_Delete_Line (Do_Idl => True); + Set_KeyPad_Mode (SwitchOn => True); + end Set_Terminal_Modes; + + nap_msec : Integer := 1; + + function Do_Single_Test (c : Character) return Boolean is + begin + case c is + when 'a' => + getch_test; + when 'b' => + attr_test; + when 'c' => + if not Has_Colors then + Cannot ("does not support color."); + else + color_test; + end if; + when 'd' => + if not Has_Colors then + Cannot ("does not support color."); + elsif not Can_Change_Color then + Cannot ("has hardwired color values."); + else + color_edit; + end if; + when 'e' => + slk_test; + when 'f' => + acs_display; + when 'o' => + demo_panels (nap_msec); + when 'g' => + acs_and_scroll; + when 'i' => + flushinp_test (Standard_Window); + when 'k' => + test_sgr_attributes; + when 'm' => + menu_test; + when 'p' => + demo_pad; + when 'r' => + demo_forms; + when 's' => + overlap_test; + when 't' => + trace_set; + when '?' => + null; + when others => return False; + end case; + return True; + end Do_Single_Test; + + command : Character; + my_e_param : Soft_Label_Key_Format := Four_Four; + assumed_colors : Boolean := False; + default_colors : Boolean := False; + default_fg : Color_Number := White; + default_bg : Color_Number := Black; + -- nap_msec was an unsigned long integer in the C version, + -- yet napms only takes an int! + + c : Integer; + c2 : Character; + optind : Integer := 1; -- must be initialized to one. + optarg : getopt.stringa; + + length : Integer; + tmpi : Integer; + + package myio is new Ada.Text_IO.Integer_IO (Integer); + use myio; + + save_trace : Integer := 0; + save_trace_set : Trace_Attribute_Set; + + function main return Integer is + begin + loop + Qgetopt (c, Argument_Count, Argument'Access, + "a:de:fhs:t:", optind, optarg); + exit when c = -1; + c2 := Character'Val (c); + case c2 is + when 'a' => + -- Ada doesn't have scanf, it doesn't even have a + -- regular expression library. + assumed_colors := True; + myio.Get (optarg.all, Integer (default_fg), length); + myio.Get (optarg.all (length + 2 .. optarg.all'Length), + Integer (default_bg), length); + when 'd' => + default_colors := True; + when 'e' => + myio.Get (optarg.all, tmpi, length); + if tmpi > 3 then + usage; + return 1; + end if; + my_e_param := Soft_Label_Key_Format'Val (tmpi); + when 'f' => + Rip_Off_Lines (-1, rip_footer'Access); + when 'h' => + Rip_Off_Lines (1, rip_header'Access); + when 's' => + myio.Get (optarg.all, nap_msec, length); + when 't' => + myio.Get (optarg.all, save_trace, length); + when others => + usage; + return 1; + end case; + end loop; + + -- the C version had a bunch of macros here. + + -- if (!isatty(fileno(stdin))) + -- isatty is not available in the standard Ada so skip it. + save_trace_set := To_trace (save_trace); + Trace_On (save_trace_set); + + Init_Soft_Label_Keys (my_e_param); + + Init_Screen; + Set_Background (Ch => (Ch => Blank, + Attr => Normal_Video, + Color => Color_Pair'First)); + + if Has_Colors then + Start_Color; + if default_colors then + Use_Default_Colors; + elsif assumed_colors then + Assume_Default_Colors (default_fg, default_bg); + end if; + end if; + + Set_Terminal_Modes; + Save_Curses_Mode (Curses); + + End_Windows; + + -- TODO add macro #if blocks. + Put_Line ("Welcome to " & Curses_Version & ". Press ? for help."); + + loop + Put_Line ("This is the ncurses main menu"); + Put_Line ("a = keyboard and mouse input test"); + Put_Line ("b = character attribute test"); + Put_Line ("c = color test pattern"); + Put_Line ("d = edit RGB color values"); + Put_Line ("e = exercise soft keys"); + Put_Line ("f = display ACS characters"); + Put_Line ("g = display windows and scrolling"); + Put_Line ("i = test of flushinp()"); + Put_Line ("k = display character attributes"); + Put_Line ("m = menu code test"); + Put_Line ("o = exercise panels library"); + Put_Line ("p = exercise pad features"); + Put_Line ("q = quit"); + Put_Line ("r = exercise forms code"); + Put_Line ("s = overlapping-refresh test"); + Put_Line ("t = set trace level"); + Put_Line ("? = repeat this command summary"); + + Put ("> "); + Flush; + + command := Ada.Characters.Latin_1.NUL; + -- get_input: + -- loop + declare + Ch : Character; + begin + Get (Ch); + -- TODO if read(ch) <= 0 + -- TODO ada doesn't have an Is_Space function + command := Ch; + -- TODO if ch = '\n' or '\r' are these in Ada? + end; + -- end loop get_input; + + declare + begin + if Do_Single_Test (command) then + Flush_Input; + Set_Terminal_Modes; + Reset_Curses_Mode (Curses); + Clear; + Refresh; + End_Windows; + if command = '?' then + Put_Line ("This is the ncurses capability tester."); + Put_Line ("You may select a test from the main menu by " & + "typing the"); + Put_Line ("key letter of the choice (the letter to left " & + "of the =)"); + Put_Line ("at the > prompt. The commands `x' or `q' will " & + "exit."); + end if; + -- continue; --why continue in the C version? + end if; + exception + when Curses_Exception => End_Windows; + end; + + exit when command = 'q'; + end loop; + Curses_Free_All; + return 0; -- TODO ExitProgram(EXIT_SUCCESS); + end main; + +end ncurses2.m; diff --git a/Ada95/samples/ncurses2-m.ads b/Ada95/samples/ncurses2-m.ads new file mode 100644 index 00000000000..c32d895dc14 --- /dev/null +++ b/Ada95/samples/ncurses2-m.ads @@ -0,0 +1,43 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package ncurses2.m is + function main return Integer; +end ncurses2.m; diff --git a/Ada95/samples/ncurses2-menu_test.adb b/Ada95/samples/ncurses2-menu_test.adb new file mode 100644 index 00000000000..a4c4807b281 --- /dev/null +++ b/Ada95/samples/ncurses2-menu_test.adb @@ -0,0 +1,168 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.6 $ +-- $Date: 2006/06/25 14:24:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; + +procedure ncurses2.menu_test is + function menu_virtualize (c : Key_Code) return Menu_Request_Code; + procedure xAdd (l : Line_Position; c : Column_Position; s : String); + + function menu_virtualize (c : Key_Code) return Menu_Request_Code is + begin + case c is + when Character'Pos (newl) | Key_Exit => + return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO + when Character'Pos ('u') => + return M_ScrollUp_Line; + when Character'Pos ('d') => + return M_ScrollDown_Line; + when Character'Pos ('b') | Key_Next_Page => + return M_ScrollUp_Page; + when Character'Pos ('f') | Key_Previous_Page => + return M_ScrollDown_Page; + when Character'Pos ('n') | Key_Cursor_Down => + return M_Next_Item; + when Character'Pos ('p') | Key_Cursor_Up => + return M_Previous_Item; + when Character'Pos (' ') => + return M_Toggle_Item; + when Key_Mouse => + return c; + when others => + Beep; + return c; + end case; + end menu_virtualize; + + MENU_Y : constant Line_Count := 8; + MENU_X : constant Column_Count := 8; + + type String_Access is access String; + + animals : constant array (Positive range <>) of String_Access := + (new String'("Lions"), + new String'("Tigers"), + new String'("Bears"), + new String'("(Oh my!)"), + new String'("Newts"), + new String'("Platypi"), + new String'("Lemurs")); + + items_a : constant Item_Array_Access := + new Item_Array (1 .. animals'Last + 1); + + tmp : Event_Mask; + + procedure xAdd (l : Line_Position; c : Column_Position; s : String) is + begin + Add (Line => l, Column => c, Str => s); + end xAdd; + + mrows : Line_Count; + mcols : Column_Count; + + menuwin : Window; + + m : Menu; + + c1 : Key_Code; + + c : Driver_Result; + r : Menu_Request_Code; +begin + tmp := Start_Mouse; + xAdd (0, 0, "This is the menu test:"); + xAdd (2, 0, " Use up and down arrow to move the select bar."); + xAdd (3, 0, " 'n' and 'p' act like arrows."); + xAdd (4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); + xAdd (5, 0, " Press return to exit."); + Refresh; + + for i in animals'Range loop + items_a (i) := New_Item (animals (i).all); + end loop; + items_a (animals'Last + 1) := Null_Item; + + m := New_Menu (items_a); + + Set_Format (m, Line_Position (animals'Last + 1) / 2, 1); + Scale (m, mrows, mcols); + + menuwin := Create (mrows + 2, mcols + 2, MENU_Y, MENU_X); + Set_Window (m, menuwin); + Set_KeyPad_Mode (menuwin, True); + Box (menuwin); -- 0,0? + + Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); + + Post (m); + + loop + c1 := Getchar (menuwin); + r := menu_virtualize (c1); + c := Driver (m, r); + exit when c = Unknown_Request; -- E_UNKNOWN_COMMAND? + if c = Request_Denied then + Beep; + end if; + -- continue ? + end loop; + + Move_Cursor (Line => Lines - 2, Column => 0); + Add (Str => "You chose: "); + Add (Str => Name (Current (m))); + Add (Ch => newl); + Pause; -- the C version didn't use Pause, it spelled it out + + Post (m, False); -- unpost, not clear :-( + declare begin + Delete (menuwin); + exception when Curses_Exception => null; end; + -- menuwin has children so will raise the exception. + + Delete (m); + + End_Mouse (tmp); +end ncurses2.menu_test; diff --git a/Ada95/samples/ncurses2-menu_test.ads b/Ada95/samples/ncurses2-menu_test.ads new file mode 100644 index 00000000000..17e5b16b3e4 --- /dev/null +++ b/Ada95/samples/ncurses2-menu_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.menu_test; diff --git a/Ada95/samples/ncurses2-overlap_test.adb b/Ada95/samples/ncurses2-overlap_test.adb new file mode 100644 index 00000000000..37e8d4c2eb5 --- /dev/null +++ b/Ada95/samples/ncurses2-overlap_test.adb @@ -0,0 +1,157 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000,2004 Free 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.4 $ +-- $Date: 2004/08/21 21:37:00 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +-- test effects of overlapping windows + +procedure ncurses2.overlap_test is + + procedure fillwin (win : Window; ch : Character); + procedure crosswin (win : Window; ch : Character); + + procedure fillwin (win : Window; ch : Character) is + y1 : Line_Position; + x1 : Column_Position; + begin + Get_Size (win, y1, x1); + for y in 0 .. y1 - 1 loop + Move_Cursor (win, y, 0); + for x in 0 .. x1 - 1 loop + Add (win, Ch => ch); + end loop; + end loop; + exception + when Curses_Exception => null; + -- write to lower right corner + end fillwin; + + procedure crosswin (win : Window; ch : Character) is + y1 : Line_Position; + x1 : Column_Position; + begin + Get_Size (win, y1, x1); + for y in 0 .. y1 - 1 loop + for x in 0 .. x1 - 1 loop + if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3)) + or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3))) then + Move_Cursor (win, y, x); + Add (win, Ch => ch); + end if; + end loop; + end loop; + end crosswin; + + -- In a 24x80 screen like some xterms are, the instructions will + -- be overwritten. + ch : Character; + win1 : Window := New_Window (9, 20, 3, 3); + win2 : Window := New_Window (9, 20, 9, 16); +begin + Set_Raw_Mode (SwitchOn => True); + Refresh; + Move_Cursor (Line => 0, Column => 0); + Add (Str => "This test shows the behavior of wnoutrefresh() with " & + "respect to"); + Add (Ch => newl); + Add (Str => "the shared region of two overlapping windows A and B. "& + "The cross"); + Add (Ch => newl); + Add (Str => "pattern in each window does not overlap the other."); + Add (Ch => newl); + + Move_Cursor (Line => 18, Column => 0); + Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " & + "then A, then doupdaute"); + Add (Ch => newl); + Add (Str => "c = fill window A with letter A. d = fill window B " & + "with letter B."); + Add (Ch => newl); + Add (Str => "e = cross pattern in window A. f = cross pattern " & + "in window B."); + Add (Ch => newl); + Add (Str => "g = clear window A. h = clear window B."); + Add (Ch => newl); + Add (Str => "i = overwrite A onto B. j = overwrite " & + "B onto A."); + Add (Ch => newl); + Add (Str => "^Q/ESC = terminate test."); + + loop + ch := Code_To_Char (Getchar); + exit when ch = CTRL ('Q') or ch = CTRL ('['); -- QUIT or ESCAPE + case ch is + when 'a' => -- refresh window A first, then B + Refresh_Without_Update (win1); + Refresh_Without_Update (win2); + Update_Screen; + when 'b' => -- refresh window B first, then A + Refresh_Without_Update (win2); + Refresh_Without_Update (win1); + Update_Screen; + when 'c' => -- fill window A so it's visible + fillwin (win1, 'A'); + when 'd' => -- fill window B so it's visible + fillwin (win2, 'B'); + when 'e' => -- cross test pattern in window A + crosswin (win1, 'A'); + when 'f' => -- cross test pattern in window B + crosswin (win2, 'B'); + when 'g' => -- clear window A + Clear (win1); + Move_Cursor (win1, 0, 0); + when 'h' => -- clear window B + Clear (win2); + Move_Cursor (win2, 0, 0); + when 'i' => -- overwrite A onto B + Overwrite (win1, win2); + when 'j' => -- overwrite B onto A + Overwrite (win2, win1); + when others => null; + end case; + end loop; + + Delete (win2); + Delete (win1); + Erase; + End_Windows; +end ncurses2.overlap_test; diff --git a/Ada95/samples/ncurses2-overlap_test.ads b/Ada95/samples/ncurses2-overlap_test.ads new file mode 100644 index 00000000000..ce6e3e69612 --- /dev/null +++ b/Ada95/samples/ncurses2-overlap_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.overlap_test; diff --git a/Ada95/samples/ncurses2-slk_test.adb b/Ada95/samples/ncurses2-slk_test.adb new file mode 100644 index 00000000000..256becf92da --- /dev/null +++ b/Ada95/samples/ncurses2-slk_test.adb @@ -0,0 +1,174 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2006,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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.8 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Strings.Unbounded; +with Interfaces.C; +with Terminal_Interface.Curses.Aux; + +procedure ncurses2.slk_test is + procedure myGet (Win : Window := Standard_Window; + Str : out Ada.Strings.Unbounded.Unbounded_String; + Len : Integer := -1); + + procedure myGet (Win : Window := Standard_Window; + Str : out Ada.Strings.Unbounded.Unbounded_String; + Len : Integer := -1) + is + use Ada.Strings.Unbounded; + use Interfaces.C; + use Terminal_Interface.Curses.Aux; + + function Wgetnstr (Win : Window; + Str : char_array; + Len : int) return int; + pragma Import (C, Wgetnstr, "wgetnstr"); + + -- FIXME: how to construct "(Len > 0) ? Len : 80"? + Ask : constant Interfaces.C.size_t := Interfaces.C.size_t'Val (Len + 80); + Txt : char_array (0 .. Ask); + + begin + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, Txt'Length) = Curses_Err then + raise Curses_Exception; + end if; + Str := To_Unbounded_String (To_Ada (Txt, True)); + end myGet; + + use Int_IO; + + use Ada.Strings.Unbounded; + + c : Key_Code; + buf : Unbounded_String; + c2 : Character; + fmt : Label_Justification := Centered; + tmp : Integer; + +begin + c := CTRL ('l'); + loop + Move_Cursor (Line => 0, Column => 0); + c2 := Code_To_Char (c); + case c2 is + when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') + Erase; + Switch_Character_Attribute (Attr => (Bold_Character => True, + others => False)); + Add (Line => 0, Column => 20, + Str => "Soft Key Exerciser"); + Switch_Character_Attribute (On => False, + Attr => (Bold_Character => True, + others => False)); + + Move_Cursor (Line => 2, Column => 0); + P ("Available commands are:"); + P (""); + P ("^L -- refresh screen"); + P ("a -- activate or restore soft keys"); + P ("d -- disable soft keys"); + P ("c -- set centered format for labels"); + P ("l -- set left-justified format for labels"); + P ("r -- set right-justified format for labels"); + P ("[12345678] -- set label; labels are numbered 1 through 8"); + P ("e -- erase stdscr (should not erase labels)"); + P ("s -- test scrolling of shortened screen"); + P ("x, q -- return to main menu"); + P (""); + P ("Note: if activating the soft keys causes your terminal to"); + P ("scroll up one line, your terminal auto-scrolls when anything"); + P ("is written to the last screen position. The ncurses code"); + P ("does not yet handle this gracefully."); + Refresh; + Restore_Soft_Label_Keys; + + when 'a' => + Restore_Soft_Label_Keys; + when 'e' => + Clear; + when 's' => + Add (Line => 20, Column => 0, + Str => "Press Q to stop the scrolling-test: "); + loop + c := Getchar; + c2 := Code_To_Char (c); + exit when c2 = 'Q'; + -- c = ERR? + -- TODO when c is not a character (arrow key) + -- the behavior is different from the C version. + Add (Ch => c2); + end loop; + when 'd' => + Clear_Soft_Label_Keys; + when 'l' => + fmt := Left; + when 'c' => + fmt := Centered; + when 'r' => + fmt := Right; + when '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' => + Add (Line => 20, Column => 0, + Str => "Please enter the label value: "); + Set_Echo_Mode (SwitchOn => True); + myGet (Str => buf); + Set_Echo_Mode (SwitchOn => False); + tmp := ctoi (c2); + Set_Soft_Label_Key (Label_Number (tmp), To_String (buf), fmt); + Refresh_Soft_Label_Keys; + Move_Cursor (Line => 20, Column => 0); + Clear_To_End_Of_Line; + when 'x' | 'q' => + exit; + -- the C version needed a goto, ha ha + -- breaks exit the case not the loop because fall-throuh + -- happens in C! + when others => + Beep; + end case; + c := Getchar; + -- TODO exit when c = EOF + end loop; + Erase; + End_Windows; +end ncurses2.slk_test; diff --git a/Ada95/samples/ncurses2-slk_test.ads b/Ada95/samples/ncurses2-slk_test.ads new file mode 100644 index 00000000000..51e95871a97 --- /dev/null +++ b/Ada95/samples/ncurses2-slk_test.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.slk_test; diff --git a/Ada95/samples/ncurses2-test_sgr_attributes.adb b/Ada95/samples/ncurses2-test_sgr_attributes.adb new file mode 100644 index 00000000000..97449a40caf --- /dev/null +++ b/Ada95/samples/ncurses2-test_sgr_attributes.adb @@ -0,0 +1,185 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.2 $ +-- $Date: 2006/06/25 14:24:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with ncurses2.util; use ncurses2.util; + +-- Graphic-rendition test (adapted from vttest) + +procedure ncurses2.test_sgr_attributes is + + procedure xAdd (l : Line_Position; c : Column_Position; s : String); + + procedure xAdd (l : Line_Position; c : Column_Position; s : String) is + begin + Add (Line => l, Column => c, Str => s); + end xAdd; + + normal, current : Attributed_Character; +begin + for pass in reverse Boolean loop + if pass then + normal := (Ch => ' ', Attr => Normal_Video, Color => 0); + else + normal := (Ch => ' ', Attr => + (Reverse_Video => True, others => False), Color => 0); + end if; + + -- Use non-default colors if possible to exercise bce a little + if Has_Colors then + Init_Pair (1, White, Blue); + normal.Color := 1; + end if; + Set_Background (Ch => normal); + Erase; + xAdd (1, 20, "Graphic rendition test pattern:"); + + xAdd (4, 1, "vanilla"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + Set_Background (Ch => current); + xAdd (4, 40, "bold"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + Set_Background (Ch => current); + xAdd (6, 6, "underline"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + Set_Background (Ch => current); + xAdd (6, 45, "bold underline"); + + current := normal; + current.Attr.Blink := not current.Attr.Blink; + Set_Background (Ch => current); + xAdd (8, 1, "blink"); + + current := normal; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + Set_Background (Ch => current); + xAdd (8, 40, "bold blink"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + Set_Background (Ch => current); + xAdd (10, 6, "underline blink"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + Set_Background (Ch => current); + xAdd (10, 45, "bold underline blink"); + + current := normal; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (12, 1, "negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (12, 40, "bold negative"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (14, 6, "underline negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (14, 45, "bold underline negative"); + + current := normal; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (16, 1, "blink negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (16, 40, "bold blink negative"); + + current := normal; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (18, 6, "underline blink negative"); + + current := normal; + current.Attr.Bold_Character := not current.Attr.Bold_Character; + current.Attr.Under_Line := not current.Attr.Under_Line; + current.Attr.Blink := not current.Attr.Blink; + current.Attr.Reverse_Video := not current.Attr.Reverse_Video; + Set_Background (Ch => current); + xAdd (18, 45, "bold underline blink negative"); + + Set_Background (Ch => normal); + Move_Cursor (Line => Lines - 2, Column => 1); + if pass then + Add (Str => "Dark"); + else + Add (Str => "Light"); + end if; + Add (Str => " background. "); + Clear_To_End_Of_Line; + Pause; + end loop; + + Set_Background (Ch => Blank2); + Erase; + End_Windows; + +end ncurses2.test_sgr_attributes; diff --git a/Ada95/samples/ncurses2-test_sgr_attributes.ads b/Ada95/samples/ncurses2-test_sgr_attributes.ads new file mode 100644 index 00000000000..241118094e1 --- /dev/null +++ b/Ada95/samples/ncurses2-test_sgr_attributes.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.test_sgr_attributes; diff --git a/Ada95/samples/ncurses2-trace_set.adb b/Ada95/samples/ncurses2-trace_set.adb new file mode 100644 index 00000000000..1e2716e1e25 --- /dev/null +++ b/Ada95/samples/ncurses2-trace_set.adb @@ -0,0 +1,480 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.trace_set -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.3 $ +-- $Date: 2008/07/26 18:46:18 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with ncurses2.util; use ncurses2.util; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; + +with Ada.Strings.Bounded; + +-- interactively set the trace level + +procedure ncurses2.trace_set is + + function menu_virtualize (c : Key_Code) return Menu_Request_Code; + function subset (super, sub : Trace_Attribute_Set) return Boolean; + function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set; + function trace_num (tlevel : Trace_Attribute_Set) return String; + function tracetrace (tlevel : Trace_Attribute_Set) return String; + function run_trace_menu (m : Menu; count : Integer) return Boolean; + + function menu_virtualize (c : Key_Code) return Menu_Request_Code is + begin + case c is + when Character'Pos (newl) | Key_Exit => + return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO + when Character'Pos ('u') => + return M_ScrollUp_Line; + when Character'Pos ('d') => + return M_ScrollDown_Line; + when Character'Pos ('b') | Key_Next_Page => + return M_ScrollUp_Page; + when Character'Pos ('f') | Key_Previous_Page => + return M_ScrollDown_Page; + when Character'Pos ('n') | Key_Cursor_Down => + return M_Next_Item; + when Character'Pos ('p') | Key_Cursor_Up => + return M_Previous_Item; + when Character'Pos (' ') => + return M_Toggle_Item; + when Key_Mouse => + return c; + when others => + Beep; + return c; + end case; + end menu_virtualize; + + type string_a is access String; + type tbl_entry is record + name : string_a; + mask : Trace_Attribute_Set; + end record; + + t_tbl : constant array (Positive range <>) of tbl_entry := + ( + (new String'("Disable"), + Trace_Disable), + (new String'("Times"), + Trace_Attribute_Set'(Times => True, others => False)), + (new String'("Tputs"), + Trace_Attribute_Set'(Tputs => True, others => False)), + (new String'("Update"), + Trace_Attribute_Set'(Update => True, others => False)), + (new String'("Cursor_Move"), + Trace_Attribute_Set'(Cursor_Move => True, others => False)), + (new String'("Character_Output"), + Trace_Attribute_Set'(Character_Output => True, others => False)), + (new String'("Ordinary"), + Trace_Ordinary), + (new String'("Calls"), + Trace_Attribute_Set'(Calls => True, others => False)), + (new String'("Virtual_Puts"), + Trace_Attribute_Set'(Virtual_Puts => True, others => False)), + (new String'("Input_Events"), + Trace_Attribute_Set'(Input_Events => True, others => False)), + (new String'("TTY_State"), + Trace_Attribute_Set'(TTY_State => True, others => False)), + (new String'("Internal_Calls"), + Trace_Attribute_Set'(Internal_Calls => True, others => False)), + (new String'("Character_Calls"), + Trace_Attribute_Set'(Character_Calls => True, others => False)), + (new String'("Termcap_TermInfo"), + Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)), + (new String'("Maximium"), + Trace_Maximum) + ); + + package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (300); + + function subset (super, sub : Trace_Attribute_Set) return Boolean is + begin + if + (super.Times or not sub.Times) and + (super.Tputs or not sub.Tputs) and + (super.Update or not sub.Update) and + (super.Cursor_Move or not sub.Cursor_Move) and + (super.Character_Output or not sub.Character_Output) and + (super.Calls or not sub.Calls) and + (super.Virtual_Puts or not sub.Virtual_Puts) and + (super.Input_Events or not sub.Input_Events) and + (super.TTY_State or not sub.TTY_State) and + (super.Internal_Calls or not sub.Internal_Calls) and + (super.Character_Calls or not sub.Character_Calls) and + (super.Termcap_TermInfo or not sub.Termcap_TermInfo) and + True then + return True; + else + return False; + end if; + end subset; + + function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set is + retval : Trace_Attribute_Set := Trace_Disable; + begin + retval.Times := (a.Times or b.Times); + retval.Tputs := (a.Tputs or b.Tputs); + retval.Update := (a.Update or b.Update); + retval.Cursor_Move := (a.Cursor_Move or b.Cursor_Move); + retval.Character_Output := (a.Character_Output or b.Character_Output); + retval.Calls := (a.Calls or b.Calls); + retval.Virtual_Puts := (a.Virtual_Puts or b.Virtual_Puts); + retval.Input_Events := (a.Input_Events or b.Input_Events); + retval.TTY_State := (a.TTY_State or b.TTY_State); + retval.Internal_Calls := (a.Internal_Calls or b.Internal_Calls); + retval.Character_Calls := (a.Character_Calls or b.Character_Calls); + retval.Termcap_TermInfo := (a.Termcap_TermInfo or b.Termcap_TermInfo); + + return retval; + end trace_or; + + -- Print the hexadecimal value of the mask so + -- users can set it from the command line. + + function trace_num (tlevel : Trace_Attribute_Set) return String is + result : Integer := 0; + m : Integer := 1; + begin + + if tlevel.Times then + result := result + m; + end if; + m := m * 2; + + if tlevel.Tputs then + result := result + m; + end if; + m := m * 2; + + if tlevel.Update then + result := result + m; + end if; + m := m * 2; + + if tlevel.Cursor_Move then + result := result + m; + end if; + m := m * 2; + + if tlevel.Character_Output then + result := result + m; + end if; + m := m * 2; + + if tlevel.Calls then + result := result + m; + end if; + m := m * 2; + + if tlevel.Virtual_Puts then + result := result + m; + end if; + m := m * 2; + + if tlevel.Input_Events then + result := result + m; + end if; + m := m * 2; + + if tlevel.TTY_State then + result := result + m; + end if; + m := m * 2; + + if tlevel.Internal_Calls then + result := result + m; + end if; + m := m * 2; + + if tlevel.Character_Calls then + result := result + m; + end if; + m := m * 2; + + if tlevel.Termcap_TermInfo then + result := result + m; + end if; + m := m * 2; + return result'Img; + end trace_num; + + function tracetrace (tlevel : Trace_Attribute_Set) return String is + + use BS; + buf : Bounded_String := To_Bounded_String (""); + begin + -- The C version prints the hexadecimal value of the mask, we + -- won't do that here because this is Ada. + + if tlevel = Trace_Disable then + Append (buf, "Trace_Disable"); + else + + if subset (tlevel, + Trace_Attribute_Set'(Times => True, others => False)) then + Append (buf, "Times"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Tputs => True, others => False)) then + Append (buf, "Tputs"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Update => True, others => False)) then + Append (buf, "Update"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Cursor_Move => True, + others => False)) then + Append (buf, "Cursor_Move"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Character_Output => True, + others => False)) then + Append (buf, "Character_Output"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Ordinary) then + Append (buf, "Ordinary"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Calls => True, others => False)) then + Append (buf, "Calls"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Virtual_Puts => True, + others => False)) then + Append (buf, "Virtual_Puts"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Input_Events => True, + others => False)) then + Append (buf, "Input_Events"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(TTY_State => True, + others => False)) then + Append (buf, "TTY_State"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Internal_Calls => True, + others => False)) then + Append (buf, "Internal_Calls"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Character_Calls => True, + others => False)) then + Append (buf, "Character_Calls"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Attribute_Set'(Termcap_TermInfo => True, + others => False)) then + Append (buf, "Termcap_TermInfo"); + Append (buf, ", "); + end if; + + if subset (tlevel, + Trace_Maximum) then + Append (buf, "Maximium"); + Append (buf, ", "); + end if; + end if; + + if To_String (buf) (Length (buf) - 1) = ',' then + Delete (buf, Length (buf) - 1, Length (buf)); + end if; + + return To_String (buf); + end tracetrace; + + function run_trace_menu (m : Menu; count : Integer) return Boolean is + i, p : Item; + changed : Boolean; + c, v : Key_Code; + begin + loop + changed := (count /= 0); + c := Getchar (Get_Window (m)); + v := menu_virtualize (c); + case Driver (m, v) is + when Unknown_Request => + return False; + when others => + i := Current (m); + if i = Menus.Items (m, 1) then -- the first item + for n in t_tbl'First + 1 .. t_tbl'Last loop + if Value (i) then + Set_Value (i, False); + changed := True; + end if; + end loop; + else + for n in t_tbl'First + 1 .. t_tbl'Last loop + p := Menus.Items (m, n); + if Value (p) then + Set_Value (Menus.Items (m, 1), False); + changed := True; + exit; + end if; + end loop; + end if; + if not changed then + return True; + end if; + end case; + end loop; + end run_trace_menu; + + nc_tracing, mask : Trace_Attribute_Set; + pragma Import (C, nc_tracing, "_nc_tracing"); + items_a : constant Item_Array_Access := + new Item_Array (t_tbl'First .. t_tbl'Last + 1); + mrows : Line_Count; + mcols : Column_Count; + menuwin : Window; + menu_y : constant Line_Position := 8; + menu_x : constant Column_Position := 8; + ip : Item; + m : Menu; + count : Integer; + newtrace : Trace_Attribute_Set; +begin + Add (Line => 0, Column => 0, Str => "Interactively set trace level:"); + Add (Line => 2, Column => 0, + Str => " Press space bar to toggle a selection."); + Add (Line => 3, Column => 0, + Str => " Use up and down arrow to move the select bar."); + Add (Line => 4, Column => 0, + Str => " Press return to set the trace level."); + Add (Line => 6, Column => 0, Str => "(Current trace level is "); + Add (Str => tracetrace (nc_tracing) & " numerically: " & + trace_num (nc_tracing)); + Add (Ch => ')'); + + Refresh; + + for n in t_tbl'Range loop + items_a (n) := New_Item (t_tbl (n).name.all); + end loop; + items_a (t_tbl'Last + 1) := Null_Item; + + m := New_Menu (items_a); + + Set_Format (m, 16, 2); + Scale (m, mrows, mcols); + + Switch_Options (m, (One_Valued => True, others => False), On => False); + menuwin := New_Window (mrows + 2, mcols + 2, menu_y, menu_x); + Set_Window (m, menuwin); + Set_KeyPad_Mode (menuwin, SwitchOn => True); + Box (menuwin); + + Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); + + Post (m); + + for n in t_tbl'Range loop + ip := Items (m, n); + mask := t_tbl (n).mask; + if mask = Trace_Disable then + Set_Value (ip, nc_tracing = Trace_Disable); + elsif subset (sub => mask, super => nc_tracing) then + Set_Value (ip, True); + end if; + end loop; + + count := 1; + while run_trace_menu (m, count) loop + count := count + 1; + end loop; + + newtrace := Trace_Disable; + for n in t_tbl'Range loop + ip := Items (m, n); + if Value (ip) then + mask := t_tbl (n).mask; + newtrace := trace_or (newtrace, mask); + end if; + end loop; + + Trace_On (newtrace); + Trace_Put ("trace level interactively set to " & + tracetrace (nc_tracing)); + + Move_Cursor (Line => Lines - 4, Column => 0); + Add (Str => "Trace level is "); + Add (Str => tracetrace (nc_tracing)); + Add (Ch => newl); + Pause; -- was just Add(); Getchar + + Post (m, False); + -- menuwin has subwindows I think, which makes an error. + declare begin + Delete (menuwin); + exception when Curses_Exception => null; end; + + -- free_menu(m); + -- free_item() +end ncurses2.trace_set; diff --git a/Ada95/samples/ncurses2-trace_set.ads b/Ada95/samples/ncurses2-trace_set.ads new file mode 100644 index 00000000000..7bbf8ca5450 --- /dev/null +++ b/Ada95/samples/ncurses2-trace_set.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.trace_set -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure ncurses2.trace_set; diff --git a/Ada95/samples/ncurses2-util.adb b/Ada95/samples/ncurses2-util.adb new file mode 100644 index 00000000000..8ae327242ba --- /dev/null +++ b/Ada95/samples/ncurses2-util.adb @@ -0,0 +1,190 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.util -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-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 -- +-- "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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.7 $ +-- $Date: 2008/07/26 18:51:20 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; use Ada.Text_IO; + +pragma Warnings (Off); +with Terminal_Interface.Curses.Aux; +pragma Warnings (On); + +with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; + +with Interfaces.C; +with Interfaces.C.Strings; + +with Ada.Characters.Handling; + +with ncurses2.genericPuts; + +package body ncurses2.util is + + -- #defines from C + -- #define CTRL(x) ((x) & 0x1f) + function CTRL (c : Character) return Key_Code is + begin + return Character'Pos (c) mod 16#20#; + -- uses a property of ASCII + -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# + end CTRL; + + function CTRL (c : Character) return Character is + begin + return Character'Val (Character'Pos (c) mod 16#20#); + -- uses a property of ASCII + -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# + end CTRL; + + save_trace : Trace_Attribute_Set; + -- Common function to allow ^T to toggle trace-mode in the middle of a test + -- so that trace-files can be made smaller. + function Getchar (win : Window := Standard_Window) return Key_Code is + c : Key_Code; + begin + -- #ifdef TRACE + c := Get_Keystroke (win); + while c = CTRL ('T') loop + -- if _nc_tracing in C + if Current_Trace_Setting /= Trace_Disable then + save_trace := Current_Trace_Setting; + Trace_Put ("TOGGLE-TRACING OFF"); + Current_Trace_Setting := Trace_Disable; + else + Current_Trace_Setting := save_trace; + end if; + Trace_On (Current_Trace_Setting); + if Current_Trace_Setting /= Trace_Disable then + Trace_Put ("TOGGLE-TRACING ON"); + end if; + end loop; + -- #else c := Get_Keystroke; + return c; + end Getchar; + + procedure Getchar (win : Window := Standard_Window) is + begin + if Getchar (win) < 0 then + Beep; + end if; + end Getchar; + + procedure Pause is + begin + Move_Cursor (Line => Lines - 1, Column => 0); + Add (Str => "Press any key to continue... "); + Getchar; + end Pause; + + procedure Cannot (s : String) is + use Interfaces.C; + use Interfaces.C.Strings; + use Terminal_Interface.Curses.Aux; + function getenv (x : char_array) return chars_ptr; + pragma Import (C, getenv, "getenv"); + tmp1 : char_array (0 .. 10); + package p is new ncurses2.genericPuts (1024); + use p; + use p.BS; + + tmpb : BS.Bounded_String; + + Length : size_t; + begin + To_C ("TERM", tmp1, Length); + Fill_String (getenv (tmp1), tmpb); + Add (Ch => newl); + myAdd (Str => "This " & tmpb & " terminal " & s); + Pause; + end Cannot; + + procedure ShellOut (message : Boolean) is + use Interfaces.C; + Txt : char_array (0 .. 10); + Length : size_t; + procedure system (x : char_array); + pragma Import (C, system, "system"); + begin + To_C ("sh", Txt, Length); + if message then + Add (Str => "Shelling out..."); + end if; + Save_Curses_Mode (Mode => Curses); + End_Windows; + system (Txt); + if message then + Add (Str => "returned from shellout."); + Add (Ch => newl); + end if; + Refresh; + end ShellOut; + + function Is_Digit (c : Key_Code) return Boolean is + begin + if c >= 16#100# then + return False; + else + return Ada.Characters.Handling.Is_Digit (Character'Val (c)); + end if; + end Is_Digit; + + procedure P (s : String) is + begin + Add (Str => s); + Add (Ch => newl); + end P; + + function Code_To_Char (c : Key_Code) return Character is + begin + if c > Character'Pos (Character'Last) then + return Character'Val (0); + -- maybe raise exception? + else + return Character'Val (c); + end if; + end Code_To_Char; + + -- This was untestable due to a bug in GNAT (3.12p) + -- Hmm, what bug? I don't remember. + function ctoi (c : Character) return Integer is + begin + return Character'Pos (c) - Character'Pos ('0'); + end ctoi; + +end ncurses2.util; diff --git a/Ada95/samples/ncurses2-util.ads b/Ada95/samples/ncurses2-util.ads new file mode 100644 index 00000000000..f46749f0686 --- /dev/null +++ b/Ada95/samples/ncurses2-util.ads @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses2.util -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.2 $ +-- $Date: 2006/06/25 14:24:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +with Ada.Text_IO; +package ncurses2.util is + + Blank : constant Character := ' '; + Blank2 : constant Attributed_Character := + (Ch => Blank, Attr => Normal_Video, Color => Color_Pair'First); + + newl : constant Character := Character'Val (10); + + function CTRL (c : Character) return Key_Code; + + function CTRL (c : Character) return Character; + + function Getchar (win : Window := Standard_Window) return Key_Code; + + procedure Getchar (win : Window := Standard_Window); + + procedure Pause; + + procedure Cannot (s : String); + + procedure ShellOut (message : Boolean); + + package Int_IO is new Ada.Text_IO.Integer_IO (Integer); + + function Is_Digit (c : Key_Code) return Boolean; + + procedure P (s : String); + + function Code_To_Char (c : Key_Code) return Character; + function ctoi (c : Character) return Integer; + +end ncurses2.util; diff --git a/Ada95/samples/ncurses2.ads b/Ada95/samples/ncurses2.ads new file mode 100644 index 00000000000..2fe01970899 --- /dev/null +++ b/Ada95/samples/ncurses2.ads @@ -0,0 +1,44 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- ncurses -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Eugene V. Melaragno 2000 +-- Version Control +-- $Revision: 1.1 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package ncurses2 is + pragma Pure (ncurses2); +end ncurses2; diff --git a/Ada95/samples/rain.adb b/Ada95/samples/rain.adb new file mode 100644 index 00000000000..d673018eb03 --- /dev/null +++ b/Ada95/samples/rain.adb @@ -0,0 +1,179 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Rain -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2007,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 -- +-- "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: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Version Control +-- $Revision: 1.8 $ +-- $Date: 2008/08/30 21:38:07 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- -- +with ncurses2.util; use ncurses2.util; +with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; +with Status; use Status; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +procedure Rain is + + Visibility : Cursor_Visibility; + + subtype X_Position is Line_Position; + subtype Y_Position is Column_Position; + + Xpos : array (1 .. 5) of X_Position; + Ypos : array (1 .. 5) of Y_Position; + + done : Boolean; + + c : Key_Code; + + N : Integer; + + G : Generator; + + Max_X, X : X_Position; + Max_Y, Y : Y_Position; + + procedure Next (J : in out Integer); + procedure Cursor (X : X_Position; Y : Y_Position); + + procedure Next (J : in out Integer) is + begin + if J = 5 then + J := 1; + else + J := J + 1; + end if; + end Next; + + procedure Cursor (X : X_Position; Y : Y_Position) is + begin + Move_Cursor (Line => X, Column => Y); + end Cursor; + pragma Inline (Cursor); + +begin + + Init_Screen; + Set_NL_Mode; + Set_Echo_Mode (False); + + Visibility := Invisible; + Set_Cursor_Visibility (Visibility); + Set_Timeout_Mode (Standard_Window, Non_Blocking, 0); + + Max_X := Lines - 5; + Max_Y := Columns - 5; + + for I in Xpos'Range loop + Xpos (I) := X_Position (Float (Max_X) * Random (G)) + 2; + Ypos (I) := Y_Position (Float (Max_Y) * Random (G)) + 2; + end loop; + + N := 1; + done := False; + while not done and Process.Continue loop + + X := X_Position (Float (Max_X) * Random (G)) + 2; + Y := Y_Position (Float (Max_Y) * Random (G)) + 2; + + Cursor (X, Y); + Add (Ch => '.'); + + Cursor (Xpos (N), Ypos (N)); + Add (Ch => 'o'); + + -- + Next (N); + Cursor (Xpos (N), Ypos (N)); + Add (Ch => 'O'); + + -- + Next (N); + Cursor (Xpos (N) - 1, Ypos (N)); + Add (Ch => '-'); + Cursor (Xpos (N), Ypos (N) - 1); + Add (Str => "|.|"); + Cursor (Xpos (N) + 1, Ypos (N)); + Add (Ch => '-'); + + -- + Next (N); + Cursor (Xpos (N) - 2, Ypos (N)); + Add (Ch => '-'); + Cursor (Xpos (N) - 1, Ypos (N) - 1); + Add (Str => "/\\"); + Cursor (Xpos (N), Ypos (N) - 2); + Add (Str => "| O |"); + Cursor (Xpos (N) + 1, Ypos (N) - 1); + Add (Str => "\\/"); + Cursor (Xpos (N) + 2, Ypos (N)); + Add (Ch => '-'); + + -- + Next (N); + Cursor (Xpos (N) - 2, Ypos (N)); + Add (Ch => ' '); + Cursor (Xpos (N) - 1, Ypos (N) - 1); + Add (Str => " "); + Cursor (Xpos (N), Ypos (N) - 2); + Add (Str => " "); + Cursor (Xpos (N) + 1, Ypos (N) - 1); + Add (Str => " "); + Cursor (Xpos (N) + 2, Ypos (N)); + Add (Ch => ' '); + + Xpos (N) := X; + Ypos (N) := Y; + + c := Getchar; + case c is + when Character'Pos ('q') => done := True; + when Character'Pos ('Q') => done := True; + when Character'Pos ('s') => Set_NoDelay_Mode (Standard_Window, False); + when Character'Pos (' ') => Set_NoDelay_Mode (Standard_Window, True); + when others => null; + end case; + + Nap_Milli_Seconds (50); + end loop; + + Visibility := Normal; + Set_Cursor_Visibility (Visibility); + End_Windows; + Curses_Free_All; + +end Rain; diff --git a/Ada95/samples/rain.ads b/Ada95/samples/rain.ads new file mode 100644 index 00000000000..3ad1912c5e4 --- /dev/null +++ b/Ada95/samples/rain.ads @@ -0,0 +1,43 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Rain -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Version Control +-- $Revision: 1.6 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- -- +procedure Rain; diff --git a/Ada95/samples/sample-curses_demo-attributes.adb b/Ada95/samples/sample-curses_demo-attributes.adb new file mode 100644 index 00000000000..c49f37d6024 --- /dev/null +++ b/Ada95/samples/sample-curses_demo-attributes.adb @@ -0,0 +1,122 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo.Attributes -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Explanation; use Sample.Explanation; + +package body Sample.Curses_Demo.Attributes is + + procedure Demo + is + P : Panel := Create (Standard_Window); + K : Real_Key_Code; + begin + Set_Meta_Mode; + Set_KeyPad_Mode; + + Top (P); + + Push_Environment ("ATTRIBDEMO"); + Default_Labels; + Notepad ("ATTRIB-PAD00"); + + Set_Character_Attributes (Attr => (others => False)); + Add (Line => 1, Column => Columns / 2 - 10, + Str => "This is NORMAL"); + + Set_Character_Attributes (Attr => (Stand_Out => True, + others => False)); + Add (Line => 2, Column => Columns / 2 - 10, + Str => "This is Stand_Out"); + + Set_Character_Attributes (Attr => (Under_Line => True, + others => False)); + Add (Line => 3, Column => Columns / 2 - 10, + Str => "This is Under_Line"); + + Set_Character_Attributes (Attr => (Reverse_Video => True, + others => False)); + Add (Line => 4, Column => Columns / 2 - 10, + Str => "This is Reverse_Video"); + + Set_Character_Attributes (Attr => (Blink => True, + others => False)); + Add (Line => 5, Column => Columns / 2 - 10, + Str => "This is Blink"); + + Set_Character_Attributes (Attr => (Dim_Character => True, + others => False)); + Add (Line => 6, Column => Columns / 2 - 10, + Str => "This is Dim_Character"); + + Set_Character_Attributes (Attr => (Bold_Character => True, + others => False)); + Add (Line => 7, Column => Columns / 2 - 10, + Str => "This is Bold_Character"); + + Refresh_Without_Update; + Update_Panels; Update_Screen; + + loop + K := Get_Key; + if K in Special_Key_Code'Range then + case K is + when QUIT_CODE => exit; + when HELP_CODE => Explain_Context; + when EXPLAIN_CODE => Explain ("ATTRIBKEYS"); + when others => null; + end case; + end if; + end loop; + + Pop_Environment; + Clear; + Refresh_Without_Update; + Delete (P); + Update_Panels; Update_Screen; + + end Demo; + +end Sample.Curses_Demo.Attributes; diff --git a/Ada95/samples/sample-curses_demo-attributes.ads b/Ada95/samples/sample-curses_demo-attributes.ads new file mode 100644 index 00000000000..6d9b4e8df80 --- /dev/null +++ b/Ada95/samples/sample-curses_demo-attributes.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo.Attributes -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Curses_Demo.Attributes is + + procedure Demo; + +end Sample.Curses_Demo.Attributes; diff --git a/Ada95/samples/sample-curses_demo-mouse.adb b/Ada95/samples/sample-curses_demo-mouse.adb new file mode 100644 index 00000000000..490685c7507 --- /dev/null +++ b/Ada95/samples/sample-curses_demo-mouse.adb @@ -0,0 +1,220 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo.Mouse -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.16 $ +-- $Date: 2008/07/26 18:48:19 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; +with Terminal_Interface.Curses.Text_IO; use Terminal_Interface.Curses.Text_IO; +with Terminal_Interface.Curses.Text_IO.Integer_IO; +with Terminal_Interface.Curses.Text_IO.Enumeration_IO; + +with Sample.Helpers; use Sample.Helpers; +with Sample.Manifest; use Sample.Manifest; +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Explanation; use Sample.Explanation; + +package body Sample.Curses_Demo.Mouse is + + package Int_IO is new + Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); + use Int_IO; + + package Button_IO is new + Terminal_Interface.Curses.Text_IO.Enumeration_IO (Mouse_Button); + use Button_IO; + + package State_IO is new + Terminal_Interface.Curses.Text_IO.Enumeration_IO (Button_State); + use State_IO; + + procedure Demo is + + type Controls is array (1 .. 3) of Panel; + + Frame : Window; + Msg : Window; + Ctl : Controls; + Pan : Panel; + K : Real_Key_Code; + V : Cursor_Visibility := Invisible; + W : Window; + Note : Window; + Msg_L : constant Line_Count := 8; + Lins : Line_Position := Lines; + Cols : Column_Position; + Mask : Event_Mask; + procedure Show_Mouse_Event; + + procedure Show_Mouse_Event + is + Evt : constant Mouse_Event := Get_Mouse; + Y : Line_Position; + X : Column_Position; + Button : Mouse_Button; + State : Button_State; + W : Window; + begin + Get_Event (Evt, Y, X, Button, State); + Put (Msg, "Event at"); + Put (Msg, " X="); Put (Msg, Integer (X), 3); + Put (Msg, ", Y="); Put (Msg, Integer (Y), 3); + Put (Msg, ", Btn="); Put (Msg, Button, 10); + Put (Msg, ", Stat="); Put (Msg, State, 15); + for I in Ctl'Range loop + W := Get_Window (Ctl (I)); + if Enclosed_In_Window (W, Evt) then + Transform_Coordinates (W, Y, X, From_Screen); + Put (Msg, ",Box("); + Put (Msg, (I), 1); Put (Msg, ","); + Put (Msg, Integer (Y), 1); Put (Msg, ","); + Put (Msg, Integer (X), 1); Put (Msg, ")"); + end if; + end loop; + New_Line (Msg); + Flush (Msg); + Update_Panels; Update_Screen; + end Show_Mouse_Event; + + begin + Push_Environment ("MOUSE00"); + Notepad ("MOUSE-PAD00"); + Default_Labels; + Set_Cursor_Visibility (V); + + Note := Notepad_Window; + if Note /= Null_Window then + Get_Window_Position (Note, Lins, Cols); + end if; + Frame := Create (Msg_L, Columns, Lins - Msg_L, 0); + if Has_Colors then + Set_Background (Win => Frame, + Ch => (Color => Default_Colors, + Attr => Normal_Video, + Ch => ' ')); + Set_Character_Attributes (Win => Frame, + Attr => Normal_Video, + Color => Default_Colors); + Erase (Frame); + end if; + Msg := Derived_Window (Frame, Msg_L - 2, Columns - 2, 1, 1); + Pan := Create (Frame); + + Set_Meta_Mode; + Set_KeyPad_Mode; + Mask := Start_Mouse; + + Box (Frame); + Window_Title (Frame, "Mouse Protocol"); + Refresh_Without_Update (Frame); + Allow_Scrolling (Msg, True); + + declare + Middle_Column : constant Integer := Integer (Columns) / 2; + Middle_Index : constant Natural := Ctl'First + (Ctl'Length / 2); + Width : constant Column_Count := 5; + Height : constant Line_Count := 3; + Half : constant Column_Count := Width / 2; + Space : constant Column_Count := 3; + Position : Integer; + W : Window; + begin + for I in Ctl'Range loop + Position := ((I) - Integer (Middle_Index)) * + Integer (Half + Space + Width) + Middle_Column; + W := Create (Height, + Width, + 1, + Column_Position (Position)); + if Has_Colors then + Set_Background (Win => W, + Ch => (Color => Menu_Back_Color, + Attr => Normal_Video, + Ch => ' ')); + Set_Character_Attributes (Win => W, + Attr => Normal_Video, + Color => Menu_Fore_Color); + Erase (W); + end if; + Ctl (I) := Create (W); + Box (W); + Move_Cursor (W, 1, Half); + Put (W, (I), 1); + Refresh_Without_Update (W); + end loop; + end; + + Update_Panels; Update_Screen; + + loop + K := Get_Key; + if K in Special_Key_Code'Range then + case K is + when QUIT_CODE => exit; + when HELP_CODE => Explain_Context; + when EXPLAIN_CODE => Explain ("MOUSEKEYS"); + when Key_Mouse => Show_Mouse_Event; + when others => null; + end case; + end if; + end loop; + + for I in Ctl'Range loop + W := Get_Window (Ctl (I)); + Clear (W); + Delete (Ctl (I)); + Delete (W); + end loop; + + Clear (Frame); + Delete (Pan); + Delete (Msg); + Delete (Frame); + + Set_Cursor_Visibility (V); + End_Mouse (Mask); + + Pop_Environment; + Update_Panels; Update_Screen; + + end Demo; + +end Sample.Curses_Demo.Mouse; diff --git a/Ada95/samples/sample-curses_demo-mouse.ads b/Ada95/samples/sample-curses_demo-mouse.ads new file mode 100644 index 00000000000..ad78d0d0a75 --- /dev/null +++ b/Ada95/samples/sample-curses_demo-mouse.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo.Mouse -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Curses_Demo.Mouse is + + procedure Demo; + +end Sample.Curses_Demo.Mouse; diff --git a/Ada95/samples/sample-curses_demo.adb b/Ada95/samples/sample-curses_demo.adb new file mode 100644 index 00000000000..700da7684be --- /dev/null +++ b/Ada95/samples/sample-curses_demo.adb @@ -0,0 +1,143 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998,2004 Free 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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.15 $ +-- $Date: 2004/08/21 21:37:00 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Panels.User_Data; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Helpers; use Sample.Helpers; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; + +with Sample.Explanation; use Sample.Explanation; + +with Sample.Menu_Demo.Handler; +with Sample.Curses_Demo.Mouse; +with Sample.Curses_Demo.Attributes; + +package body Sample.Curses_Demo is + + type User_Data is new Integer; + type User_Data_Access is access all User_Data; + package PUD is new Panels.User_Data (User_Data, User_Data_Access); + -- We use above instantiation of the generic User_Data package to + -- demonstrate and test the use of the user data maechanism. + + procedure Demo + is + function My_Driver (M : Menu; + K : Key_Code; + Pan : Panel) return Boolean; + package Mh is new Sample.Menu_Demo.Handler (My_Driver); + + Itm : Item_Array_Access := new Item_Array' + (New_Item ("Attributes Demo"), + New_Item ("Mouse Demo"), + Null_Item); + M : Menu := New_Menu (Itm); + U1 : constant User_Data_Access := new User_Data'(4711); + U2 : User_Data_Access; + + function My_Driver (M : Menu; + K : Key_Code; + Pan : Panel) return Boolean + is + Idx : constant Positive := Get_Index (Current (M)); + Result : Boolean := False; + begin + PUD.Set_User_Data (Pan, U1); -- set some user data, just for fun + if K in User_Key_Code'Range then + if K = QUIT then + Result := True; + elsif K = SELECT_ITEM then + if Idx in Itm'Range then + Hide (Pan); + Update_Panels; + end if; + case Idx is + when 1 => Sample.Curses_Demo.Attributes.Demo; + when 2 => Sample.Curses_Demo.Mouse.Demo; + when others => Not_Implemented; + end case; + if Idx in Itm'Range then + Top (Pan); + Show (Pan); + Update_Panels; + Update_Screen; + end if; + end if; + end if; + PUD.Get_User_Data (Pan, U2); -- get the user data + pragma Assert (U1.all = U2.all and then U1 = U2); + return Result; + end My_Driver; + + begin + + if (1 + Item_Count (M)) /= Itm'Length then + raise Constraint_Error; + end if; + + if not Has_Mouse then + declare + O : Item_Option_Set; + begin + Get_Options (Itm (2), O); + O.Selectable := False; + Set_Options (Itm (2), O); + end; + end if; + + Push_Environment ("CURSES00"); + Notepad ("CURSES-PAD00"); + Default_Labels; + Refresh_Soft_Label_Keys_Without_Update; + + Mh.Drive_Me (M, " Demo "); + Pop_Environment; + + Delete (M); + Free (Itm, True); + end Demo; + +end Sample.Curses_Demo; diff --git a/Ada95/samples/sample-curses_demo.ads b/Ada95/samples/sample-curses_demo.ads new file mode 100644 index 00000000000..ed4ad0f019f --- /dev/null +++ b/Ada95/samples/sample-curses_demo.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Curses_Demo -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Curses_Demo is + + procedure Demo; + +end Sample.Curses_Demo; diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb new file mode 100644 index 00000000000..3129dfd76a7 --- /dev/null +++ b/Ada95/samples/sample-explanation.adb @@ -0,0 +1,408 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Explanation -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.21 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- Poor mans help system. This scans a sequential file for key lines and +-- then reads the lines up to the next key. Those lines are presented in +-- a window as help or explanation. +-- +with Ada.Text_IO; use Ada.Text_IO; +with Ada.Unchecked_Deallocation; +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; + +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Manifest; use Sample.Manifest; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Helpers; use Sample.Helpers; + +package body Sample.Explanation is + + Help_Keys : constant String := "HELPKEYS"; + In_Help : constant String := "INHELP"; + + File_Name : constant String := "explain.msg"; + F : File_Type; + + type Help_Line; + type Help_Line_Access is access Help_Line; + pragma Controlled (Help_Line_Access); + type String_Access is access String; + pragma Controlled (String_Access); + + type Help_Line is + record + Prev, Next : Help_Line_Access; + Line : String_Access; + end record; + + procedure Explain (Key : String; + Win : Window); + + procedure Release_String is + new Ada.Unchecked_Deallocation (String, + String_Access); + procedure Release_Help_Line is + new Ada.Unchecked_Deallocation (Help_Line, + Help_Line_Access); + + function Search (Key : String) return Help_Line_Access; + procedure Release_Help (Root : in out Help_Line_Access); + + procedure Explain (Key : String) + is + begin + Explain (Key, Null_Window); + end Explain; + + procedure Explain (Key : String; + Win : Window) + is + -- Retrieve the text associated with this key and display it in this + -- window. If no window argument is passed, the routine will create + -- a temporary window and use it. + + function Filter_Key return Real_Key_Code; + procedure Unknown_Key; + procedure Redo; + procedure To_Window (C : in out Help_Line_Access; + More : in out Boolean); + + Frame : Window := Null_Window; + + W : Window := Win; + K : Real_Key_Code; + P : Panel; + + Height : Line_Count; + Width : Column_Count; + Help : Help_Line_Access := Search (Key); + Current : Help_Line_Access; + Top_Line : Help_Line_Access; + + Has_More : Boolean := True; + + procedure Unknown_Key + is + begin + Add (W, "Help message with ID "); + Add (W, Key); + Add (W, " not found."); + Add (W, Character'Val (10)); + Add (W, "Press the Function key labelled 'Quit' key to continue."); + end Unknown_Key; + + procedure Redo + is + H : Help_Line_Access := Top_Line; + begin + if Top_Line /= null then + for L in 0 .. (Height - 1) loop + Add (W, L, 0, H.Line.all); + exit when H.Next = null; + H := H.Next; + end loop; + else + Unknown_Key; + end if; + end Redo; + + function Filter_Key return Real_Key_Code + is + K : Real_Key_Code; + begin + loop + K := Get_Key (W); + if K in Special_Key_Code'Range then + case K is + when HELP_CODE => + if not Find_Context (In_Help) then + Push_Environment (In_Help, False); + Explain (In_Help, W); + Pop_Environment; + Redo; + end if; + when EXPLAIN_CODE => + if not Find_Context (Help_Keys) then + Push_Environment (Help_Keys, False); + Explain (Help_Keys, W); + Pop_Environment; + Redo; + end if; + when others => exit; + end case; + else + exit; + end if; + end loop; + return K; + end Filter_Key; + + procedure To_Window (C : in out Help_Line_Access; + More : in out Boolean) + is + L : Line_Position := 0; + begin + loop + Add (W, L, 0, C.Line.all); + L := L + 1; + exit when C.Next = null or else L = Height; + C := C.Next; + end loop; + if C.Next /= null then + pragma Assert (L = Height); + More := True; + else + More := False; + end if; + end To_Window; + + begin + if W = Null_Window then + Push_Environment ("HELP"); + Default_Labels; + Frame := New_Window (Lines - 2, Columns, 0, 0); + if Has_Colors then + Set_Background (Win => Frame, + Ch => (Ch => ' ', + Color => Help_Color, + Attr => Normal_Video)); + Set_Character_Attributes (Win => Frame, + Attr => Normal_Video, + Color => Help_Color); + Erase (Frame); + end if; + Box (Frame); + Set_Character_Attributes (Frame, (Reverse_Video => True, + others => False)); + Add (Frame, Lines - 3, 2, "Cursor Up/Down scrolls"); + Set_Character_Attributes (Frame); -- Back to default. + Window_Title (Frame, "Explanation"); + W := Derived_Window (Frame, Lines - 4, Columns - 2, 1, 1); + Refresh_Without_Update (Frame); + Get_Size (W, Height, Width); + Set_Meta_Mode (W); + Set_KeyPad_Mode (W); + Allow_Scrolling (W, True); + Set_Echo_Mode (False); + P := Create (Frame); + Top (P); + Update_Panels; + else + Clear (W); + Refresh_Without_Update (W); + end if; + + Current := Help; Top_Line := Help; + + if null = Help then + Unknown_Key; + loop + K := Filter_Key; + exit when K = QUIT_CODE; + end loop; + else + To_Window (Current, Has_More); + if Has_More then + -- This means there are more lines available, so we have to go + -- into a scroll manager. + loop + K := Filter_Key; + if K in Special_Key_Code'Range then + case K is + when Key_Cursor_Down => + if Current.Next /= null then + Move_Cursor (W, Height - 1, 0); + Scroll (W, 1); + Current := Current.Next; + Top_Line := Top_Line.Next; + Add (W, Current.Line.all); + end if; + when Key_Cursor_Up => + if Top_Line.Prev /= null then + Move_Cursor (W, 0, 0); + Scroll (W, -1); + Top_Line := Top_Line.Prev; + Current := Current.Prev; + Add (W, Top_Line.Line.all); + end if; + when QUIT_CODE => exit; + when others => null; + end case; + end if; + end loop; + else + loop + K := Filter_Key; + exit when K = QUIT_CODE; + end loop; + end if; + end if; + + Clear (W); + + if Frame /= Null_Window then + Clear (Frame); + Delete (P); + Delete (W); + Delete (Frame); + Pop_Environment; + end if; + + Update_Panels; + Update_Screen; + + Release_Help (Help); + + end Explain; + + function Search (Key : String) return Help_Line_Access + is + Last : Natural; + Buffer : String (1 .. 256); + Root : Help_Line_Access := null; + Current : Help_Line_Access; + Tail : Help_Line_Access := null; + + function Next_Line return Boolean; + + function Next_Line return Boolean + is + H_End : constant String := "#END"; + begin + Get_Line (F, Buffer, Last); + if Last = H_End'Length and then H_End = Buffer (1 .. Last) then + return False; + else + return True; + end if; + end Next_Line; + begin + Reset (F); + Outer : + loop + exit Outer when not Next_Line; + if Last = (1 + Key'Length) and then Key = Buffer (2 .. Last) + and then Buffer (1) = '#' then + loop + exit when not Next_Line; + exit when Buffer (1) = '#'; + Current := new Help_Line'(null, null, + new String'(Buffer (1 .. Last))); + if Tail = null then + Release_Help (Root); + Root := Current; + else + Tail.Next := Current; + Current.Prev := Tail; + end if; + Tail := Current; + end loop; + exit Outer; + end if; + end loop Outer; + return Root; + end Search; + + procedure Release_Help (Root : in out Help_Line_Access) + is + Next : Help_Line_Access; + begin + loop + exit when Root = null; + Next := Root.Next; + Release_String (Root.Line); + Release_Help_Line (Root); + Root := Next; + end loop; + end Release_Help; + + procedure Explain_Context + is + begin + Explain (Context); + end Explain_Context; + + procedure Notepad (Key : String) + is + H : constant Help_Line_Access := Search (Key); + T : Help_Line_Access := H; + N : Line_Count := 1; + L : Line_Position := 0; + W : Window; + P : Panel; + begin + if H /= null then + loop + T := T.Next; + exit when T = null; + N := N + 1; + end loop; + W := New_Window (N + 2, Columns, Lines - N - 2, 0); + if Has_Colors then + Set_Background (Win => W, + Ch => (Ch => ' ', + Color => Notepad_Color, + Attr => Normal_Video)); + Set_Character_Attributes (Win => W, + Attr => Normal_Video, + Color => Notepad_Color); + Erase (W); + end if; + Box (W); + Window_Title (W, "Notepad"); + P := New_Panel (W); + T := H; + loop + Add (W, L + 1, 1, T.Line.all, Integer (Columns - 2)); + L := L + 1; + T := T.Next; + exit when T = null; + end loop; + T := H; + Release_Help (T); + Refresh_Without_Update (W); + Notepad_To_Context (P); + end if; + end Notepad; + +begin + Open (F, In_File, File_Name); +end Sample.Explanation; diff --git a/Ada95/samples/sample-explanation.ads b/Ada95/samples/sample-explanation.ads new file mode 100644 index 00000000000..728825e2c9d --- /dev/null +++ b/Ada95/samples/sample-explanation.ads @@ -0,0 +1,59 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Explanation -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- Poor mans help system. This scans a sequential file for key lines and +-- then reads the lines up to the next key. Those lines are presented in +-- a window as help or explanation. +-- +package Sample.Explanation is + + procedure Explain (Key : String); + -- Retrieve the text associated with this key and display it. + + procedure Explain_Context; + -- Explain the current context. + + procedure Notepad (Key : String); + -- Put a note on the screen and maintain it with the context + + Explanation_Not_Found : exception; + Explanation_Error : exception; + +end Sample.Explanation; diff --git a/Ada95/samples/sample-form_demo-aux.adb b/Ada95/samples/sample-form_demo-aux.adb new file mode 100644 index 00000000000..a3b044dcc3e --- /dev/null +++ b/Ada95/samples/sample-form_demo-aux.adb @@ -0,0 +1,263 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.Aux -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.17 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Helpers; use Sample.Helpers; +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Explanation; use Sample.Explanation; + +package body Sample.Form_Demo.Aux is + + procedure Geometry (F : Form; + L : out Line_Count; -- Lines used for menu + C : out Column_Count; -- Columns used for menu + Y : out Line_Position; -- Proposed Line for menu + X : out Column_Position) -- Proposed Column for menu + is + begin + Scale (F, L, C); + + L := L + 2; -- count for frame at top and bottom + C := C + 2; -- " + + -- Calculate horizontal coordinate at the screen center + X := (Columns - C) / 2; + Y := 1; -- start always in line 1 + end Geometry; + + function Create (F : Form; + Title : String; + Lin : Line_Position; + Col : Column_Position) return Panel + is + W, S : Window; + L : Line_Count; + C : Column_Count; + Y : Line_Position; + X : Column_Position; + Pan : Panel; + begin + Geometry (F, L, C, Y, X); + W := New_Window (L, C, Lin, Col); + Set_Meta_Mode (W); + Set_KeyPad_Mode (W); + if Has_Colors then + Set_Background (Win => W, + Ch => (Ch => ' ', + Color => Default_Colors, + Attr => Normal_Video)); + Set_Character_Attributes (Win => W, + Color => Default_Colors, + Attr => Normal_Video); + Erase (W); + end if; + S := Derived_Window (W, L - 2, C - 2, 1, 1); + Set_Meta_Mode (S); + Set_KeyPad_Mode (S); + Box (W); + Set_Window (F, W); + Set_Sub_Window (F, S); + if Title'Length > 0 then + Window_Title (W, Title); + end if; + Pan := New_Panel (W); + Post (F); + return Pan; + end Create; + + procedure Destroy (F : Form; + P : in out Panel) + is + W, S : Window; + begin + W := Get_Window (F); + S := Get_Sub_Window (F); + Post (F, False); + Erase (W); + Delete (P); + Set_Window (F, Null_Window); + Set_Sub_Window (F, Null_Window); + Delete (S); + Delete (W); + Update_Panels; + end Destroy; + + function Get_Request (F : Form; + P : Panel; + Handle_CRLF : Boolean := True) return Key_Code + is + W : constant Window := Get_Window (F); + K : Real_Key_Code; + Ch : Character; + begin + Top (P); + loop + K := Get_Key (W); + if K in Special_Key_Code'Range then + case K is + when HELP_CODE => Explain_Context; + when EXPLAIN_CODE => Explain ("FORMKEYS"); + when Key_Home => return F_First_Field; + when Key_End => return F_Last_Field; + when QUIT_CODE => return QUIT; + when Key_Cursor_Down => return F_Down_Char; + when Key_Cursor_Up => return F_Up_Char; + when Key_Cursor_Left => return F_Previous_Char; + when Key_Cursor_Right => return F_Next_Char; + when Key_Next_Page => return F_Next_Page; + when Key_Previous_Page => return F_Previous_Page; + when Key_Backspace => return F_Delete_Previous; + when Key_Clear_Screen => return F_Clear_Field; + when Key_Clear_End_Of_Line => return F_Clear_EOF; + when others => return K; + end case; + elsif K in Normal_Key_Code'Range then + Ch := Character'Val (K); + case Ch is + when CAN => return QUIT; -- CTRL-X + + when ACK => return F_Next_Field; -- CTRL-F + when STX => return F_Previous_Field; -- CTRL-B + when FF => return F_Left_Field; -- CTRL-L + when DC2 => return F_Right_Field; -- CTRL-R + when NAK => return F_Up_Field; -- CTRL-U + when EOT => return F_Down_Field; -- CTRL-D + + when ETB => return F_Next_Word; -- CTRL-W + when DC4 => return F_Previous_Word; -- CTRL-T + + when SOH => return F_Begin_Field; -- CTRL-A + when ENQ => return F_End_Field; -- CTRL-E + + when HT => return F_Insert_Char; -- CTRL-I + when SI => return F_Insert_Line; -- CTRL-O + when SYN => return F_Delete_Char; -- CTRL-V + when BS => return F_Delete_Previous; -- CTRL-H + when EM => return F_Delete_Line; -- CTRL-Y + when BEL => return F_Delete_Word; -- CTRL-G + when VT => return F_Clear_EOF; -- CTRL-K + + when SO => return F_Next_Choice; -- CTRL-N + when DLE => return F_Previous_Choice; -- CTRL-P + + when CR | LF => + if Handle_CRLF then + return F_New_Line; + else + return K; + end if; + when others => return K; + end case; + else + return K; + end if; + end loop; + end Get_Request; + + function Make (Top : Line_Position; + Left : Column_Position; + Text : String) return Field + is + Fld : Field; + C : constant Column_Count := Column_Count (Text'Length); + begin + Fld := New_Field (1, C, Top, Left); + Set_Buffer (Fld, 0, Text); + Switch_Options (Fld, (Active => True, others => False), False); + if Has_Colors then + Set_Background (Fld => Fld, Color => Default_Colors); + end if; + return Fld; + end Make; + + function Make (Height : Line_Count := 1; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0) return Field + is + Fld : constant Field := New_Field (Height, Width, Top, Left, Off_Screen); + begin + if Has_Colors then + Set_Foreground (Fld => Fld, Color => Form_Fore_Color); + Set_Background (Fld => Fld, Color => Form_Back_Color); + else + Set_Background (Fld, (Reverse_Video => True, others => False)); + end if; + return Fld; + end Make; + + function Default_Driver (F : Form; + K : Key_Code; + P : Panel) return Boolean + is + begin + if P = Null_Panel then + raise Panel_Exception; + end if; + if K in User_Key_Code'Range and then K = QUIT then + if Driver (F, F_Validate_Field) = Form_Ok then + return True; + end if; + end if; + return False; + end Default_Driver; + + function Count_Active (F : Form) return Natural + is + N : Natural := 0; + O : Field_Option_Set; + H : constant Natural := Field_Count (F); + begin + if H > 0 then + for I in 1 .. H loop + Get_Options (Fields (F, I), O); + if O.Active then + N := N + 1; + end if; + end loop; + end if; + return N; + end Count_Active; + +end Sample.Form_Demo.Aux; diff --git a/Ada95/samples/sample-form_demo-aux.ads b/Ada95/samples/sample-form_demo-aux.ads new file mode 100644 index 00000000000..57e5bc1a2ac --- /dev/null +++ b/Ada95/samples/sample-form_demo-aux.ads @@ -0,0 +1,92 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.Aux -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; + +package Sample.Form_Demo.Aux is + + procedure Geometry (F : Form; + L : out Line_Count; + C : out Column_Count; + Y : out Line_Position; + X : out Column_Position); + -- Calculate the geometry for a panel beeing able to be used to display + -- the menu. + + function Create (F : Form; + Title : String; + Lin : Line_Position; + Col : Column_Position) return Panel; + -- Create a panel decorated with a frame and the title at the specified + -- position. The dimension of the panel is derived from the menus layout. + + procedure Destroy (F : Form; + P : in out Panel); + -- Destroy all the windowing structures associated with this menu and + -- panel. + + function Get_Request (F : Form; + P : Panel; + Handle_CRLF : Boolean := True) return Key_Code; + -- Centralized request driver for all menus in this sample. This + -- gives us a common key binding for all menus. + + function Make (Top : Line_Position; + Left : Column_Position; + Text : String) return Field; + -- create a label + + function Make (Height : Line_Count := 1; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0) return Field; + -- create a editable field + + function Default_Driver (F : Form; + K : Key_Code; + P : Panel) return Boolean; + + function Count_Active (F : Form) return Natural; + -- Count the number of active fields in the form + +end Sample.Form_Demo.Aux; diff --git a/Ada95/samples/sample-form_demo-handler.adb b/Ada95/samples/sample-form_demo-handler.adb new file mode 100644 index 00000000000..d871c1cc779 --- /dev/null +++ b/Ada95/samples/sample-form_demo-handler.adb @@ -0,0 +1,98 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.Handler -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.14 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Sample.Form_Demo.Aux; + +package body Sample.Form_Demo.Handler is + + package Aux renames Sample.Form_Demo.Aux; + + procedure Drive_Me (F : Form; + Title : String := "") + is + L : Line_Count; + C : Column_Count; + Y : Line_Position; + X : Column_Position; + begin + Aux.Geometry (F, L, C, Y, X); + Drive_Me (F, Y, X, Title); + end Drive_Me; + + procedure Drive_Me (F : Form; + Lin : Line_Position; + Col : Column_Position; + Title : String := "") + is + Pan : Panel := Aux.Create (F, Title, Lin, Col); + V : Cursor_Visibility := Normal; + Handle_CRLF : Boolean := True; + + begin + Set_Cursor_Visibility (V); + if Aux.Count_Active (F) = 1 then + Handle_CRLF := False; + end if; + loop + declare + K : constant Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF); + R : Driver_Result; + begin + if (K = 13 or else K = 10) and then not Handle_CRLF then + R := Unknown_Request; + else + R := Driver (F, K); + end if; + case R is + when Form_Ok => null; + when Unknown_Request => + if My_Driver (F, K, Pan) then + exit; + end if; + when others => Beep; + end case; + end; + end loop; + Set_Cursor_Visibility (V); + Aux.Destroy (F, Pan); + end Drive_Me; + +end Sample.Form_Demo.Handler; diff --git a/Ada95/samples/sample-form_demo-handler.ads b/Ada95/samples/sample-form_demo-handler.ads new file mode 100644 index 00000000000..7d875a0fff6 --- /dev/null +++ b/Ada95/samples/sample-form_demo-handler.ads @@ -0,0 +1,64 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo.Handler -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; +use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; +use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Forms; +use Terminal_Interface.Curses.Forms; + +generic + with function My_Driver (Frm : Form; + K : Key_Code; + Pan : Panel) return Boolean; +package Sample.Form_Demo.Handler is + + procedure Drive_Me (F : Form; + Lin : Line_Position; + Col : Column_Position; + Title : String := ""); + -- Position the menu at the given point and drive it. + + procedure Drive_Me (F : Form; + Title : String := ""); + -- Center menu and drive it. + +end Sample.Form_Demo.Handler; diff --git a/Ada95/samples/sample-form_demo.adb b/Ada95/samples/sample-form_demo.adb new file mode 100644 index 00000000000..e26a5d98a2b --- /dev/null +++ b/Ada95/samples/sample-form_demo.adb @@ -0,0 +1,130 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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"), 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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.15 $ +-- $Date: 2006/06/25 14:30:22 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; +with Terminal_Interface.Curses.Forms.Field_User_Data; +with Sample.My_Field_Type; use Sample.My_Field_Type; +with Sample.Explanation; use Sample.Explanation; +with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Form_Demo.Handler; + +with Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; +with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; +use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; +with Terminal_Interface.Curses.Forms.Field_Types.IntField; +use Terminal_Interface.Curses.Forms.Field_Types.IntField; + +package body Sample.Form_Demo is + + type User_Data is + record + Data : Integer; + end record; + type User_Access is access User_Data; + + package Fld_U is new + Terminal_Interface.Curses.Forms.Field_User_Data (User_Data, + User_Access); + + type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday, + Friday, Saturday); + + package Weekday_Enum is new + Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada (Weekday); + + Enum_Field : constant Enumeration_Field := + Weekday_Enum.Create; + + procedure Demo + is + + Mft : constant My_Data := (Ch => 'X'); + + FA : Field_Array_Access := new Field_Array' + (Make (0, 14, "Sample Entry Form"), + Make (2, 0, "WeekdayEnumeration"), + Make (2, 20, "Numeric 1-10"), + Make (2, 34, "Only 'X'"), + Make (5, 0, "Multiple Lines offscreen(Scroll)"), + Make (Width => 18, Top => 3, Left => 0), + Make (Width => 12, Top => 3, Left => 20), + Make (Width => 12, Top => 3, Left => 34), + Make (Width => 46, Top => 6, Left => 0, Height => 4, Off_Screen => 2), + Null_Field + ); + + Frm : Terminal_Interface.Curses.Forms.Form := Create (FA); + + I_F : constant Integer_Field := (Precision => 0, + Lower_Limit => 1, + Upper_Limit => 10); + + F1, F2 : User_Access; + + package Fh is new Sample.Form_Demo.Handler (Default_Driver); + + begin + Push_Environment ("FORM00"); + Notepad ("FORM-PAD00"); + Default_Labels; + + Set_Field_Type (FA (6), Enum_Field); + Set_Field_Type (FA (7), I_F); + Set_Field_Type (FA (8), Mft); + + F1 := new User_Data'(Data => 4711); + Fld_U.Set_User_Data (FA (1), F1); + + Fh.Drive_Me (Frm); + + Fld_U.Get_User_Data (FA (1), F2); + pragma Assert (F1 = F2); + pragma Assert (F1.Data = F2.Data); + + Pop_Environment; + Delete (Frm); + + Free (FA, True); + end Demo; + +end Sample.Form_Demo; diff --git a/Ada95/samples/sample-form_demo.ads b/Ada95/samples/sample-form_demo.ads new file mode 100644 index 00000000000..bd33f578750 --- /dev/null +++ b/Ada95/samples/sample-form_demo.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Form_Demo -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Form_Demo is + + procedure Demo; + +end Sample.Form_Demo; diff --git a/Ada95/samples/sample-function_key_setting.adb b/Ada95/samples/sample-function_key_setting.adb new file mode 100644 index 00000000000..0ce3a224c68 --- /dev/null +++ b/Ada95/samples/sample-function_key_setting.adb @@ -0,0 +1,214 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Function_Key_Setting -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.14 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Deallocation; +with Sample.Manifest; use Sample.Manifest; + +-- This package implements a simple stack of function key label environments. +-- +package body Sample.Function_Key_Setting is + + Max_Label_Length : constant Positive := 8; + Number_Of_Keys : Label_Number := Label_Number'Last; + Justification : Label_Justification := Left; + + subtype Label is String (1 .. Max_Label_Length); + type Label_Array is array (Label_Number range <>) of Label; + + type Key_Environment (N : Label_Number := Label_Number'Last); + type Env_Ptr is access Key_Environment; + pragma Controlled (Env_Ptr); + + type String_Access is access String; + pragma Controlled (String_Access); + + Active_Context : String_Access := new String'("MAIN"); + Active_Notepad : Panel := Null_Panel; + + type Key_Environment (N : Label_Number := Label_Number'Last) is + record + Prev : Env_Ptr; + Help : String_Access; + Notepad : Panel; + Labels : Label_Array (1 .. N); + end record; + + procedure Release_String is + new Ada.Unchecked_Deallocation (String, + String_Access); + + procedure Release_Environment is + new Ada.Unchecked_Deallocation (Key_Environment, + Env_Ptr); + + Top_Of_Stack : Env_Ptr := null; + + procedure Push_Environment (Key : String; + Reset : Boolean := True) + is + P : constant Env_Ptr := new Key_Environment (Number_Of_Keys); + begin + -- Store the current labels in the environment + for I in 1 .. Number_Of_Keys loop + Get_Soft_Label_Key (I, P.Labels (I)); + if Reset then + Set_Soft_Label_Key (I, " "); + end if; + end loop; + P.Prev := Top_Of_Stack; + -- now store active help context and notepad + P.Help := Active_Context; + P.Notepad := Active_Notepad; + -- The notepad must now vanish and the new notepad is empty. + if P.Notepad /= Null_Panel then + Hide (P.Notepad); + Update_Panels; + end if; + Active_Notepad := Null_Panel; + Active_Context := new String'(Key); + + Top_Of_Stack := P; + if Reset then + Refresh_Soft_Label_Keys_Without_Update; + end if; + end Push_Environment; + + procedure Pop_Environment + is + P : Env_Ptr := Top_Of_Stack; + begin + if Top_Of_Stack = null then + raise Function_Key_Stack_Error; + else + for I in 1 .. Number_Of_Keys loop + Set_Soft_Label_Key (I, P.Labels (I), Justification); + end loop; + pragma Assert (Active_Context /= null); + Release_String (Active_Context); + Active_Context := P.Help; + Refresh_Soft_Label_Keys_Without_Update; + Notepad_To_Context (P.Notepad); + Top_Of_Stack := P.Prev; + Release_Environment (P); + end if; + end Pop_Environment; + + function Context return String + is + begin + if Active_Context /= null then + return Active_Context.all; + else + return ""; + end if; + end Context; + + function Find_Context (Key : String) return Boolean + is + P : Env_Ptr := Top_Of_Stack; + begin + if Active_Context.all = Key then + return True; + else + loop + exit when P = null; + if P.Help.all = Key then + return True; + else + P := P.Prev; + end if; + end loop; + return False; + end if; + end Find_Context; + + procedure Notepad_To_Context (Pan : Panel) + is + W : Window; + begin + if Active_Notepad /= Null_Panel then + W := Get_Window (Active_Notepad); + Clear (W); + Delete (Active_Notepad); + Delete (W); + end if; + Active_Notepad := Pan; + if Pan /= Null_Panel then + Top (Pan); + end if; + Update_Panels; + Update_Screen; + end Notepad_To_Context; + + procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style; + Just : Label_Justification := Left) + is + begin + case Mode is + when PC_Style .. PC_Style_With_Index + => Number_Of_Keys := 12; + when others + => Number_Of_Keys := 8; + end case; + Init_Soft_Label_Keys (Mode); + Justification := Just; + end Initialize; + + procedure Default_Labels + is + begin + Set_Soft_Label_Key (FKEY_QUIT, "Quit"); + Set_Soft_Label_Key (FKEY_HELP, "Help"); + Set_Soft_Label_Key (FKEY_EXPLAIN, "Keys"); + Refresh_Soft_Label_Keys_Without_Update; + end Default_Labels; + + function Notepad_Window return Window + is + begin + if Active_Notepad /= Null_Panel then + return Get_Window (Active_Notepad); + else + return Null_Window; + end if; + end Notepad_Window; + +end Sample.Function_Key_Setting; diff --git a/Ada95/samples/sample-function_key_setting.ads b/Ada95/samples/sample-function_key_setting.ads new file mode 100644 index 00000000000..77699136e7e --- /dev/null +++ b/Ada95/samples/sample-function_key_setting.ads @@ -0,0 +1,82 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Function_Key_Setting -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; + +-- This package implements a simple stack of function key label environments. +-- +package Sample.Function_Key_Setting is + + procedure Push_Environment (Key : String; + Reset : Boolean := True); + -- Push the definition of the current function keys on an internal + -- stack. If the reset flag is true, all labels are reset while + -- pushed, so the new environment can assume a tabula rasa. + -- The Key defines the new Help Context associated with the new + -- Environment. This saves also the currently active Notepad. + + procedure Pop_Environment; + -- Pop the Definitions from the stack and make them the current ones. + -- This also restores the Help context and the previous Notepad. + + procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style; + Just : Label_Justification := Left); + -- Initialize the environment + + function Context return String; + -- Return the current context identitfier + + function Find_Context (Key : String) return Boolean; + -- Look for a context, return true if it is in the stack, + -- false otherwise. + + procedure Notepad_To_Context (Pan : Panel); + -- Add a panel representing a notepad to the current context. + + Function_Key_Stack_Error : exception; + + procedure Default_Labels; + -- Set the default labels used in all environments + + function Notepad_Window return Window; + -- Return the current notepad window or Null_Window if there is none. + +end Sample.Function_Key_Setting; diff --git a/Ada95/samples/sample-header_handler.adb b/Ada95/samples/sample-header_handler.adb new file mode 100644 index 00000000000..189118d0402 --- /dev/null +++ b/Ada95/samples/sample-header_handler.adb @@ -0,0 +1,180 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Header_Handler -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.17 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Calendar; use Ada.Calendar; +with Terminal_Interface.Curses.Text_IO.Integer_IO; +with Sample.Manifest; use Sample.Manifest; + +-- This package handles the painting of the header line of the screen. +-- +package body Sample.Header_Handler is + + package Int_IO is new + Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); + use Int_IO; + + Header_Window : Window := Null_Window; + + Display_Hour : Integer := -1; -- hour last displayed + Display_Min : Integer := -1; -- minute last displayed + Display_Day : Integer := -1; -- day last displayed + Display_Month : Integer := -1; -- month last displayed + + -- This is the routine handed over to the curses library to be called + -- as initialization routine when ripping of the header lines from + -- the screen. This routine must follow C conventions. + function Init_Header_Window (Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, Init_Header_Window); + + procedure Internal_Update_Header_Window (Do_Update : Boolean); + + -- The initialization must be called before Init_Screen. It steals two + -- lines from the top of the screen. + procedure Init_Header_Handler + is + begin + Rip_Off_Lines (2, Init_Header_Window'Access); + end Init_Header_Handler; + + procedure N_Out (N : Integer); + + -- Emit a two digit number and ensure that a leading zero is generated if + -- necessary. + procedure N_Out (N : Integer) + is + begin + if N < 10 then + Add (Header_Window, '0'); + Put (Header_Window, N, 1); + else + Put (Header_Window, N, 2); + end if; + end N_Out; + + -- Paint the header window. The input parameter is a flag indicating + -- whether or not the screen should be updated physically after painting. + procedure Internal_Update_Header_Window (Do_Update : Boolean) + is + type Month_Name_Array is + array (Month_Number'First .. Month_Number'Last) of String (1 .. 9); + + Month_Names : constant Month_Name_Array := + ("January ", + "February ", + "March ", + "April ", + "May ", + "June ", + "July ", + "August ", + "September", + "October ", + "November ", + "December "); + + Now : constant Time := Clock; + Sec : constant Integer := Integer (Seconds (Now)); + Hour : constant Integer := Sec / 3600; + Minute : constant Integer := (Sec - Hour * 3600) / 60; + Mon : constant Month_Number := Month (Now); + D : constant Day_Number := Day (Now); + begin + if Header_Window /= Null_Window then + if Minute /= Display_Min or else Hour /= Display_Hour + or else Display_Day /= D or else Display_Month /= Mon then + Move_Cursor (Header_Window, 0, 0); + N_Out (D); Add (Header_Window, '.'); + Add (Header_Window, Month_Names (Mon)); + Move_Cursor (Header_Window, 1, 0); + N_Out (Hour); Add (Header_Window, ':'); + N_Out (Minute); + Display_Min := Minute; + Display_Hour := Hour; + Display_Month := Mon; + Display_Day := D; + Refresh_Without_Update (Header_Window); + if Do_Update then + Update_Screen; + end if; + end if; + end if; + end Internal_Update_Header_Window; + + -- This routine is called in the keyboard input timeout handler. So it will + -- periodically update the header line of the screen. + procedure Update_Header_Window + is + begin + Internal_Update_Header_Window (True); + end Update_Header_Window; + + function Init_Header_Window (Win : Window; + Columns : Column_Count) return Integer + is + Title : constant String := "Ada 95 ncurses Binding Sample"; + Pos : Column_Position; + begin + Header_Window := Win; + if Win /= Null_Window then + if Has_Colors then + Set_Background (Win => Win, + Ch => (Ch => ' ', + Color => Header_Color, + Attr => Normal_Video)); + Set_Character_Attributes (Win => Win, + Attr => Normal_Video, + Color => Header_Color); + Erase (Win); + end if; + Leave_Cursor_After_Update (Win, True); + Pos := Columns - Column_Position (Title'Length); + Add (Win, 0, Pos / 2, Title); + -- In this phase we must not allow a physical update, because + -- ncurses isn´t properly initialized at this point. + Internal_Update_Header_Window (False); + return 0; + else + return -1; + end if; + end Init_Header_Window; + +end Sample.Header_Handler; diff --git a/Ada95/samples/sample-header_handler.ads b/Ada95/samples/sample-header_handler.ads new file mode 100644 index 00000000000..aa0a0c29e9f --- /dev/null +++ b/Ada95/samples/sample-header_handler.ads @@ -0,0 +1,53 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Header_Handler -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +-- This package handles the painting of the header line of the screen. +-- +package Sample.Header_Handler is + + procedure Init_Header_Handler; + -- Initialize the handler for the headerlines. + + procedure Update_Header_Window; + -- Update the information in the header window + +end Sample.Header_Handler; diff --git a/Ada95/samples/sample-helpers.adb b/Ada95/samples/sample-helpers.adb new file mode 100644 index 00000000000..e19464c4080 --- /dev/null +++ b/Ada95/samples/sample-helpers.adb @@ -0,0 +1,68 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Helpers -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.13 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Sample.Explanation; use Sample.Explanation; + +-- This package contains some conveniant helper routines used throughout +-- this example. +-- +package body Sample.Helpers is + + procedure Window_Title (Win : Window; + Title : String) + is + Height : Line_Count; + Width : Column_Count; + Pos : Column_Position := 0; + begin + Get_Size (Win, Height, Width); + if Title'Length < Width then + Pos := (Width - Title'Length) / 2; + end if; + Add (Win, 0, Pos, Title); + end Window_Title; + + procedure Not_Implemented is + begin + Explain ("NOTIMPL"); + end Not_Implemented; + +end Sample.Helpers; diff --git a/Ada95/samples/sample-helpers.ads b/Ada95/samples/sample-helpers.ads new file mode 100644 index 00000000000..f9bec6a5591 --- /dev/null +++ b/Ada95/samples/sample-helpers.ads @@ -0,0 +1,54 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Helpers -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +-- This package contains some conveniant helper routines used throughout +-- this example. +-- +package Sample.Helpers is + + procedure Window_Title (Win : Window; + Title : String); + -- Put a title string into the first line of the window + + procedure Not_Implemented; + +end Sample.Helpers; diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb new file mode 100644 index 00000000000..fdac054d298 --- /dev/null +++ b/Ada95/samples/sample-keyboard_handler.adb @@ -0,0 +1,194 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Keyboard_Handler -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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"), 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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.14 $ +-- $Date: 2006/06/25 14:30:22 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Strings; use Ada.Strings; +with Ada.Strings.Fixed; use Ada.Strings.Fixed; +with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; +with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; +with Ada.Characters.Handling; use Ada.Characters.Handling; + +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; +with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; +use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; + +with Sample.Header_Handler; use Sample.Header_Handler; +with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; +with Sample.Manifest; use Sample.Manifest; +with Sample.Form_Demo.Handler; + +-- This package contains a centralized keyboard handler used throughout +-- this example. The handler establishes a timeout mechanism that provides +-- periodical updates of the common header lines used in this example. +-- + +package body Sample.Keyboard_Handler is + + In_Command : Boolean := False; + + function Get_Key (Win : Window := Standard_Window) return Real_Key_Code + is + K : Real_Key_Code; + + function Command return Real_Key_Code; + + function Command return Real_Key_Code + is + function My_Driver (F : Form; + C : Key_Code; + P : Panel) return Boolean; + package Fh is new Sample.Form_Demo.Handler (My_Driver); + + type Label_Array is array (Label_Number) of String (1 .. 8); + + Labels : Label_Array; + + FA : Field_Array_Access := new Field_Array' + (Make (0, 0, "Command:"), + Make (Top => 0, Left => 9, Width => Columns - 11), + Null_Field); + + K : Real_Key_Code := Key_None; + N : Natural := 0; + + function My_Driver (F : Form; + C : Key_Code; + P : Panel) return Boolean + is + Ch : Character; + begin + if P = Null_Panel then + raise Panel_Exception; + end if; + if C in User_Key_Code'Range and then C = QUIT then + if Driver (F, F_Validate_Field) = Form_Ok then + K := Key_None; + return True; + end if; + elsif C in Normal_Key_Code'Range then + Ch := Character'Val (C); + if Ch = LF or else Ch = CR then + if Driver (F, F_Validate_Field) = Form_Ok then + declare + Buffer : String (1 .. Positive (Columns - 11)); + Cmdc : String (1 .. 8); + begin + Get_Buffer (Fld => FA (2), Str => Buffer); + Trim (Buffer, Left); + if Buffer (1) /= ' ' then + Cmdc := To_Upper (Buffer (Cmdc'Range)); + for I in Labels'Range loop + if Cmdc = Labels (I) then + K := Function_Key_Code + (Function_Key_Number (I)); + exit; + end if; + end loop; + end if; + return True; + end; + end if; + end if; + end if; + return False; + end My_Driver; + + begin + In_Command := True; + for I in Label_Number'Range loop + Get_Soft_Label_Key (I, Labels (I)); + Trim (Labels (I), Left); + Translate (Labels (I), Upper_Case_Map); + if Labels (I) (1) /= ' ' then + N := N + 1; + end if; + end loop; + if N > 0 then -- some labels were really set + declare + Enum_Info : Enumeration_Info (N); + Enum_Field : Enumeration_Field; + J : Positive := Enum_Info.Names'First; + + Frm : Form := Create (FA); + + begin + for I in Label_Number'Range loop + if Labels (I) (1) /= ' ' then + Enum_Info.Names (J) := new String'(Labels (I)); + J := J + 1; + end if; + end loop; + Enum_Field := Create (Enum_Info, True); + Set_Field_Type (FA (2), Enum_Field); + Set_Background (FA (2), Normal_Video); + + Fh.Drive_Me (Frm, Lines - 3, 0); + Delete (Frm); + Update_Panels; Update_Screen; + end; + end if; + Free (FA, True); + In_Command := False; + return K; + end Command; + + begin + Set_Timeout_Mode (Win, Delayed, 30000); + loop + K := Get_Keystroke (Win); + if K = Key_None then -- a timeout occured + Update_Header_Window; + elsif K = 3 and then not In_Command then -- CTRL-C + K := Command; + exit when K /= Key_None; + else + exit; + end if; + end loop; + return K; + end Get_Key; + + procedure Init_Keyboard_Handler is + begin + null; + end Init_Keyboard_Handler; + +end Sample.Keyboard_Handler; diff --git a/Ada95/samples/sample-keyboard_handler.ads b/Ada95/samples/sample-keyboard_handler.ads new file mode 100644 index 00000000000..ac5b1399db0 --- /dev/null +++ b/Ada95/samples/sample-keyboard_handler.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Keyboard_Handler -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +-- This package contains a centralized keyboard handler used throughout +-- this example. The handler establishes a timeout mechanism that provides +-- periodical updates of the common header lines used in this example. +-- +package Sample.Keyboard_Handler is + + function Get_Key (Win : Window := Standard_Window) return Real_Key_Code; + -- The central routine for handling keystrokes. + + procedure Init_Keyboard_Handler; + -- Initialize the keyboard + +end Sample.Keyboard_Handler; diff --git a/Ada95/samples/sample-manifest.ads b/Ada95/samples/sample-manifest.ads new file mode 100644 index 00000000000..bb76c4cba78 --- /dev/null +++ b/Ada95/samples/sample-manifest.ads @@ -0,0 +1,67 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Manifest -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; + +package Sample.Manifest is + + QUIT : constant User_Key_Code := User_Key_Code'First; + SELECT_ITEM : constant User_Key_Code := QUIT + 1; + + FKEY_HELP : constant Label_Number := 1; + HELP_CODE : constant Special_Key_Code := Key_F1; + FKEY_EXPLAIN : constant Label_Number := 2; + EXPLAIN_CODE : constant Special_Key_Code := Key_F2; + FKEY_QUIT : constant Label_Number := 3; + QUIT_CODE : constant Special_Key_Code := Key_F3; + + Menu_Marker : constant String := "=> "; + + Default_Colors : constant Redefinable_Color_Pair := 1; + Menu_Fore_Color : constant Redefinable_Color_Pair := 2; + Menu_Back_Color : constant Redefinable_Color_Pair := 3; + Menu_Grey_Color : constant Redefinable_Color_Pair := 4; + Form_Fore_Color : constant Redefinable_Color_Pair := 5; + Form_Back_Color : constant Redefinable_Color_Pair := 6; + Notepad_Color : constant Redefinable_Color_Pair := 7; + Help_Color : constant Redefinable_Color_Pair := 8; + Header_Color : constant Redefinable_Color_Pair := 9; + +end Sample.Manifest; diff --git a/Ada95/samples/sample-menu_demo-aux.adb b/Ada95/samples/sample-menu_demo-aux.adb new file mode 100644 index 00000000000..091f08b92a3 --- /dev/null +++ b/Ada95/samples/sample-menu_demo-aux.adb @@ -0,0 +1,204 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.Aux -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.14 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Helpers; use Sample.Helpers; +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Explanation; use Sample.Explanation; + +package body Sample.Menu_Demo.Aux is + + procedure Geometry (M : Menu; + L : out Line_Count; + C : out Column_Count; + Y : out Line_Position; + X : out Column_Position; + Fy : out Line_Position; + Fx : out Column_Position); + + procedure Geometry (M : Menu; + L : out Line_Count; -- Lines used for menu + C : out Column_Count; -- Columns used for menu + Y : out Line_Position; -- Proposed Line for menu + X : out Column_Position; -- Proposed Column for menu + Fy : out Line_Position; -- Vertical inner frame + Fx : out Column_Position) -- Horiz. inner frame + is + Spc_Desc : Column_Position; -- spaces between description and item + begin + Set_Mark (M, Menu_Marker); + + Spacing (M, Spc_Desc, Fy, Fx); + Scale (M, L, C); + + Fx := Fx + Column_Position (Fy - 1); -- looks a bit nicer + + L := L + 2 * Fy; -- count for frame at top and bottom + C := C + 2 * Fx; -- " + + -- Calculate horizontal coordinate at the screen center + X := (Columns - C) / 2; + Y := 1; -- always startin line 1 + + end Geometry; + + procedure Geometry (M : Menu; + L : out Line_Count; -- Lines used for menu + C : out Column_Count; -- Columns used for menu + Y : out Line_Position; -- Proposed Line for menu + X : out Column_Position) -- Proposed Column for menu + is + Fy : Line_Position; + Fx : Column_Position; + begin + Geometry (M, L, C, Y, X, Fy, Fx); + end Geometry; + + function Create (M : Menu; + Title : String; + Lin : Line_Position; + Col : Column_Position) return Panel + is + W, S : Window; + L : Line_Count; + C : Column_Count; + Y, Fy : Line_Position; + X, Fx : Column_Position; + Pan : Panel; + begin + Geometry (M, L, C, Y, X, Fy, Fx); + W := New_Window (L, C, Lin, Col); + Set_Meta_Mode (W); + Set_KeyPad_Mode (W); + if Has_Colors then + Set_Background (Win => W, + Ch => (Ch => ' ', + Color => Menu_Back_Color, + Attr => Normal_Video)); + Set_Foreground (Men => M, Color => Menu_Fore_Color); + Set_Background (Men => M, Color => Menu_Back_Color); + Set_Grey (Men => M, Color => Menu_Grey_Color); + Erase (W); + end if; + S := Derived_Window (W, L - Fy, C - Fx, Fy, Fx); + Set_Meta_Mode (S); + Set_KeyPad_Mode (S); + Box (W); + Set_Window (M, W); + Set_Sub_Window (M, S); + if Title'Length > 0 then + Window_Title (W, Title); + end if; + Pan := New_Panel (W); + Post (M); + return Pan; + end Create; + + procedure Destroy (M : Menu; + P : in out Panel) + is + W, S : Window; + begin + W := Get_Window (M); + S := Get_Sub_Window (M); + Post (M, False); + Erase (W); + Delete (P); + Set_Window (M, Null_Window); + Set_Sub_Window (M, Null_Window); + Delete (S); + Delete (W); + Update_Panels; + end Destroy; + + function Get_Request (M : Menu; P : Panel) return Key_Code + is + W : constant Window := Get_Window (M); + K : Real_Key_Code; + Ch : Character; + begin + Top (P); + loop + K := Get_Key (W); + if K in Special_Key_Code'Range then + case K is + when HELP_CODE => Explain_Context; + when EXPLAIN_CODE => Explain ("MENUKEYS"); + when Key_Home => return REQ_FIRST_ITEM; + when QUIT_CODE => return QUIT; + when Key_Cursor_Down => return REQ_DOWN_ITEM; + when Key_Cursor_Up => return REQ_UP_ITEM; + when Key_Cursor_Left => return REQ_LEFT_ITEM; + when Key_Cursor_Right => return REQ_RIGHT_ITEM; + when Key_End => return REQ_LAST_ITEM; + when Key_Backspace => return REQ_BACK_PATTERN; + when Key_Next_Page => return REQ_SCR_DPAGE; + when Key_Previous_Page => return REQ_SCR_UPAGE; + when others => return K; + end case; + elsif K in Normal_Key_Code'Range then + Ch := Character'Val (K); + case Ch is + when CAN => return QUIT; -- CTRL-X + when SO => return REQ_NEXT_ITEM; -- CTRL-N + when DLE => return REQ_PREV_ITEM; -- CTRL-P + when NAK => return REQ_SCR_ULINE; -- CTRL-U + when EOT => return REQ_SCR_DLINE; -- CTRL-D + when ACK => return REQ_SCR_DPAGE; -- CTRL-F + when STX => return REQ_SCR_UPAGE; -- CTRL-B + when EM => return REQ_CLEAR_PATTERN; -- CTRL-Y + when BS => return REQ_BACK_PATTERN; -- CTRL-H + when SOH => return REQ_NEXT_MATCH; -- CTRL-A + when ENQ => return REQ_PREV_MATCH; -- CTRL-E + when DC4 => return REQ_TOGGLE_ITEM; -- CTRL-T + + when CR | LF => return SELECT_ITEM; + when others => return K; + end case; + else + return K; + end if; + end loop; + end Get_Request; + +end Sample.Menu_Demo.Aux; diff --git a/Ada95/samples/sample-menu_demo-aux.ads b/Ada95/samples/sample-menu_demo-aux.ads new file mode 100644 index 00000000000..50eea900cc9 --- /dev/null +++ b/Ada95/samples/sample-menu_demo-aux.ads @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.Aux -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; + +package Sample.Menu_Demo.Aux is + + procedure Geometry (M : Menu; + L : out Line_Count; + C : out Column_Count; + Y : out Line_Position; + X : out Column_Position); + -- Calculate the geometry for a panel beeing able to be used to display + -- the menu. + + function Create (M : Menu; + Title : String; + Lin : Line_Position; + Col : Column_Position) return Panel; + -- Create a panel decorated with a frame and the title at the specified + -- position. The dimension of the panel is derived from the menus layout. + + procedure Destroy (M : Menu; + P : in out Panel); + -- Destroy all the windowing structures associated with this menu and + -- panel. + + function Get_Request (M : Menu; P : Panel) return Key_Code; + -- Centralized request driver for all menus in this sample. This + -- gives us a common key binding for all menus. + +end Sample.Menu_Demo.Aux; diff --git a/Ada95/samples/sample-menu_demo-handler.adb b/Ada95/samples/sample-menu_demo-handler.adb new file mode 100644 index 00000000000..84d29f6351b --- /dev/null +++ b/Ada95/samples/sample-menu_demo-handler.adb @@ -0,0 +1,108 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.Handler -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.16 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Sample.Menu_Demo.Aux; +with Sample.Manifest; use Sample.Manifest; +with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; + +package body Sample.Menu_Demo.Handler is + + package Aux renames Sample.Menu_Demo.Aux; + + procedure Drive_Me (M : Menu; + Title : String := "") + is + L : Line_Count; + C : Column_Count; + Y : Line_Position; + X : Column_Position; + begin + Aux.Geometry (M, L, C, Y, X); + Drive_Me (M, Y, X, Title); + end Drive_Me; + + procedure Drive_Me (M : Menu; + Lin : Line_Position; + Col : Column_Position; + Title : String := "") + is + Mask : Event_Mask := No_Events; + Old : Event_Mask; + Pan : Panel := Aux.Create (M, Title, Lin, Col); + V : Cursor_Visibility := Invisible; + begin + -- We are only interested in Clicks with the left button + Register_Reportable_Events (Left, All_Clicks, Mask); + Old := Start_Mouse (Mask); + Set_Cursor_Visibility (V); + loop + declare + K : Key_Code := Aux.Get_Request (M, Pan); + R : constant Driver_Result := Driver (M, K); + begin + case R is + when Menu_Ok => null; + when Unknown_Request => + declare + I : constant Item := Current (M); + O : Item_Option_Set; + begin + if K = Key_Mouse then + K := SELECT_ITEM; + end if; + Get_Options (I, O); + if K = SELECT_ITEM and then not O.Selectable then + Beep; + else + if My_Driver (M, K, Pan) then + exit; + end if; + end if; + end; + when others => Beep; + end case; + end; + end loop; + End_Mouse (Old); + Aux.Destroy (M, Pan); + end Drive_Me; + +end Sample.Menu_Demo.Handler; diff --git a/Ada95/samples/sample-menu_demo-handler.ads b/Ada95/samples/sample-menu_demo-handler.ads new file mode 100644 index 00000000000..e9eaa6b74b7 --- /dev/null +++ b/Ada95/samples/sample-menu_demo-handler.ads @@ -0,0 +1,64 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo.Handler -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; +use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; +use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Menus; +use Terminal_Interface.Curses.Menus; + +generic + with function My_Driver (Men : Menu; + K : Key_Code; + Pan : Panel) return Boolean; +package Sample.Menu_Demo.Handler is + + procedure Drive_Me (M : Menu; + Lin : Line_Position; + Col : Column_Position; + Title : String := ""); + -- Position the menu at the given point and drive it. + + procedure Drive_Me (M : Menu; + Title : String := ""); + -- Center menu and drive it. + +end Sample.Menu_Demo.Handler; diff --git a/Ada95/samples/sample-menu_demo.adb b/Ada95/samples/sample-menu_demo.adb new file mode 100644 index 00000000000..38646748713 --- /dev/null +++ b/Ada95/samples/sample-menu_demo.adb @@ -0,0 +1,396 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.18 $ +-- $Date: 2008/07/26 18:48:30 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; +with Terminal_Interface.Curses.Menus.Menu_User_Data; +with Terminal_Interface.Curses.Menus.Item_User_Data; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Menu_Demo.Handler; +with Sample.Helpers; use Sample.Helpers; +with Sample.Explanation; use Sample.Explanation; + +package body Sample.Menu_Demo is + + package Spacing_Demo is + procedure Spacing_Test; + end Spacing_Demo; + + package body Spacing_Demo is + + procedure Spacing_Test + is + function My_Driver (M : Menu; + K : Key_Code; + P : Panel) return Boolean; + + procedure Set_Option_Key; + procedure Set_Select_Key; + procedure Set_Description_Key; + procedure Set_Hide_Key; + + package Mh is new Sample.Menu_Demo.Handler (My_Driver); + + I : Item_Array_Access := new Item_Array' + (New_Item ("January", "31 Days"), + New_Item ("February", "28/29 Days"), + New_Item ("March", "31 Days"), + New_Item ("April", "30 Days"), + New_Item ("May", "31 Days"), + New_Item ("June", "30 Days"), + New_Item ("July", "31 Days"), + New_Item ("August", "31 Days"), + New_Item ("September", "30 Days"), + New_Item ("October", "31 Days"), + New_Item ("November", "30 Days"), + New_Item ("December", "31 Days"), + Null_Item); + + M : Menu := New_Menu (I); + Flip_State : Boolean := True; + Hide_Long : Boolean := False; + + type Format_Code is (Four_By_1, Four_By_2, Four_By_3); + type Operations is (Flip, Reorder, Reformat, Reselect, Describe); + + type Change is array (Operations) of Boolean; + pragma Pack (Change); + No_Change : constant Change := Change'(others => False); + + Current_Format : Format_Code := Four_By_1; + To_Change : Change := No_Change; + + function My_Driver (M : Menu; + K : Key_Code; + P : Panel) return Boolean + is + begin + if M = Null_Menu then + raise Menu_Exception; + end if; + if P = Null_Panel then + raise Panel_Exception; + end if; + To_Change := No_Change; + if K in User_Key_Code'Range then + if K = QUIT then + return True; + end if; + end if; + if K in Special_Key_Code'Range then + case K is + when Key_F4 => + To_Change (Flip) := True; + return True; + when Key_F5 => + To_Change (Reformat) := True; + Current_Format := Four_By_1; + return True; + when Key_F6 => + To_Change (Reformat) := True; + Current_Format := Four_By_2; + return True; + when Key_F7 => + To_Change (Reformat) := True; + Current_Format := Four_By_3; + return True; + when Key_F8 => + To_Change (Reorder) := True; + return True; + when Key_F9 => + To_Change (Reselect) := True; + return True; + when Key_F10 => + if Current_Format /= Four_By_3 then + To_Change (Describe) := True; + return True; + else + return False; + end if; + when Key_F11 => + Hide_Long := not Hide_Long; + declare + O : Item_Option_Set; + begin + for J in I'Range loop + Get_Options (I (J), O); + O.Selectable := True; + if Hide_Long then + case J is + when 1 | 3 | 5 | 7 | 8 | 10 | 12 => + O.Selectable := False; + when others => null; + end case; + end if; + Set_Options (I (J), O); + end loop; + end; + return False; + when others => null; + end case; + end if; + return False; + end My_Driver; + + procedure Set_Option_Key + is + O : Menu_Option_Set; + begin + if Current_Format = Four_By_1 then + Set_Soft_Label_Key (8, ""); + else + Get_Options (M, O); + if O.Row_Major_Order then + Set_Soft_Label_Key (8, "O-Col"); + else + Set_Soft_Label_Key (8, "O-Row"); + end if; + end if; + Refresh_Soft_Label_Keys_Without_Update; + end Set_Option_Key; + + procedure Set_Select_Key + is + O : Menu_Option_Set; + begin + Get_Options (M, O); + if O.One_Valued then + Set_Soft_Label_Key (9, "Multi"); + else + Set_Soft_Label_Key (9, "Singl"); + end if; + Refresh_Soft_Label_Keys_Without_Update; + end Set_Select_Key; + + procedure Set_Description_Key + is + O : Menu_Option_Set; + begin + if Current_Format = Four_By_3 then + Set_Soft_Label_Key (10, ""); + else + Get_Options (M, O); + if O.Show_Descriptions then + Set_Soft_Label_Key (10, "-Desc"); + else + Set_Soft_Label_Key (10, "+Desc"); + end if; + end if; + Refresh_Soft_Label_Keys_Without_Update; + end Set_Description_Key; + + procedure Set_Hide_Key + is + begin + if Hide_Long then + Set_Soft_Label_Key (11, "Enab"); + else + Set_Soft_Label_Key (11, "Disab"); + end if; + Refresh_Soft_Label_Keys_Without_Update; + end Set_Hide_Key; + + begin + Push_Environment ("MENU01"); + Notepad ("MENU-PAD01"); + Default_Labels; + Set_Soft_Label_Key (4, "Flip"); + Set_Soft_Label_Key (5, "4x1"); + Set_Soft_Label_Key (6, "4x2"); + Set_Soft_Label_Key (7, "4x3"); + Set_Option_Key; + Set_Select_Key; + Set_Description_Key; + Set_Hide_Key; + + Set_Format (M, 4, 1); + loop + Mh.Drive_Me (M); + exit when To_Change = No_Change; + if To_Change (Flip) then + if Flip_State then + Flip_State := False; + Set_Spacing (M, 3, 2, 0); + else + Flip_State := True; + Set_Spacing (M); + end if; + elsif To_Change (Reformat) then + case Current_Format is + when Four_By_1 => Set_Format (M, 4, 1); + when Four_By_2 => Set_Format (M, 4, 2); + when Four_By_3 => + declare + O : Menu_Option_Set; + begin + Get_Options (M, O); + O.Show_Descriptions := False; + Set_Options (M, O); + Set_Format (M, 4, 3); + end; + end case; + Set_Option_Key; + Set_Description_Key; + elsif To_Change (Reorder) then + declare + O : Menu_Option_Set; + begin + Get_Options (M, O); + O.Row_Major_Order := not O.Row_Major_Order; + Set_Options (M, O); + Set_Option_Key; + end; + elsif To_Change (Reselect) then + declare + O : Menu_Option_Set; + begin + Get_Options (M, O); + O.One_Valued := not O.One_Valued; + Set_Options (M, O); + Set_Select_Key; + end; + elsif To_Change (Describe) then + declare + O : Menu_Option_Set; + begin + Get_Options (M, O); + O.Show_Descriptions := not O.Show_Descriptions; + Set_Options (M, O); + Set_Description_Key; + end; + else + null; + end if; + end loop; + Set_Spacing (M); + + Pop_Environment; + pragma Assert (Get_Index (Items (M, 1)) = Get_Index (I (1))); + Delete (M); + Free (I, True); + end Spacing_Test; + end Spacing_Demo; + + procedure Demo + is + -- We use this datatype only to test the instantiation of + -- the Menu_User_Data generic package. No functionality + -- behind it. + type User_Data is new Integer; + type User_Data_Access is access User_Data; + + -- Those packages are only instantiated to test the usability. + -- No real functionality is shown in the demo. + package MUD is new Menu_User_Data (User_Data, User_Data_Access); + package IUD is new Item_User_Data (User_Data, User_Data_Access); + + function My_Driver (M : Menu; + K : Key_Code; + P : Panel) return Boolean; + + package Mh is new Sample.Menu_Demo.Handler (My_Driver); + + Itm : Item_Array_Access := new Item_Array' + (New_Item ("Menu Layout Options"), + New_Item ("Demo of Hook functions"), + Null_Item); + M : Menu := New_Menu (Itm); + + U1 : constant User_Data_Access := new User_Data'(4711); + U2 : User_Data_Access; + U3 : constant User_Data_Access := new User_Data'(4712); + U4 : User_Data_Access; + + function My_Driver (M : Menu; + K : Key_Code; + P : Panel) return Boolean + is + Idx : constant Positive := Get_Index (Current (M)); + begin + if K in User_Key_Code'Range then + if K = QUIT then + return True; + elsif K = SELECT_ITEM then + if Idx in Itm'Range then + Hide (P); + Update_Panels; + end if; + case Idx is + when 1 => Spacing_Demo.Spacing_Test; + when others => Not_Implemented; + end case; + if Idx in Itm'Range then + Top (P); + Show (P); + Update_Panels; + Update_Screen; + end if; + end if; + end if; + return False; + end My_Driver; + begin + Push_Environment ("MENU00"); + Notepad ("MENU-PAD00"); + Default_Labels; + Refresh_Soft_Label_Keys_Without_Update; + Set_Pad_Character (M, '|'); + + MUD.Set_User_Data (M, U1); + IUD.Set_User_Data (Itm (1), U3); + + Mh.Drive_Me (M); + + MUD.Get_User_Data (M, U2); + pragma Assert (U1 = U2 and U1.all = 4711); + + IUD.Get_User_Data (Itm (1), U4); + pragma Assert (U3 = U4 and U3.all = 4712); + + Pop_Environment; + Delete (M); + Free (Itm, True); + end Demo; + +end Sample.Menu_Demo; diff --git a/Ada95/samples/sample-menu_demo.ads b/Ada95/samples/sample-menu_demo.ads new file mode 100644 index 00000000000..b071afc8277 --- /dev/null +++ b/Ada95/samples/sample-menu_demo.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Menu_Demo -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Menu_Demo is + + procedure Demo; + +end Sample.Menu_Demo; diff --git a/Ada95/samples/sample-my_field_type.adb b/Ada95/samples/sample-my_field_type.adb new file mode 100644 index 00000000000..e0d6f6732d1 --- /dev/null +++ b/Ada95/samples/sample-my_field_type.adb @@ -0,0 +1,68 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.My_Field_Type -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.16 $ +-- $Date: 2008/07/26 18:47:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +-- This is a very simple user defined field type. It accepts only a +-- defined character as input into the field. +-- +package body Sample.My_Field_Type is + + -- That's simple. There are minimal field validity checks. + function Field_Check (Fld : Field; + Typ : My_Data) return Boolean + is + begin + if Fld = Null_Field or Typ.Ch = Character'Val (0) then + return False; + end if; + return True; + end Field_Check; + + -- Check exactly against the specified character. + function Character_Check (Ch : Character; + Typ : My_Data) return Boolean + is + C : constant Character := Typ.Ch; + begin + return Ch = C; + end Character_Check; + +end Sample.My_Field_Type; diff --git a/Ada95/samples/sample-my_field_type.ads b/Ada95/samples/sample-my_field_type.ads new file mode 100644 index 00000000000..b8f3653c1d0 --- /dev/null +++ b/Ada95/samples/sample-my_field_type.ads @@ -0,0 +1,61 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.My_Field_Type -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; +with Terminal_Interface.Curses.Forms.Field_Types.User; +use Terminal_Interface.Curses.Forms.Field_Types.User; + +-- This is a very simple user defined field type. It accepts only a +-- defined character as input into the field. +-- +package Sample.My_Field_Type is + + type My_Data is new User_Defined_Field_Type with + record + Ch : Character; + end record; + + function Field_Check (Fld : Field; + Typ : My_Data) return Boolean; + + function Character_Check (Ch : Character; + Typ : My_Data) return Boolean; + +end Sample.My_Field_Type; diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb new file mode 100644 index 00000000000..0b385c45907 --- /dev/null +++ b/Ada95/samples/sample-text_io_demo.adb @@ -0,0 +1,181 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Text_IO_Demo -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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"), 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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.16 $ +-- $Date: 2006/06/25 14:30:22 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Numerics.Generic_Elementary_Functions; +with Ada.Numerics.Complex_Types; +use Ada.Numerics.Complex_Types; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Text_IO; +use Terminal_Interface.Curses.Text_IO; +with Terminal_Interface.Curses.Text_IO.Integer_IO; +with Terminal_Interface.Curses.Text_IO.Float_IO; +with Terminal_Interface.Curses.Text_IO.Enumeration_IO; +with Terminal_Interface.Curses.Text_IO.Complex_IO; +with Terminal_Interface.Curses.Text_IO.Fixed_IO; +with Terminal_Interface.Curses.Text_IO.Decimal_IO; +with Terminal_Interface.Curses.Text_IO.Modular_IO; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Explanation; use Sample.Explanation; + +package body Sample.Text_IO_Demo is + + type Weekday is (Sunday, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday); + + type Fix is delta 0.1 range 0.0 .. 4.0; + type Dec is delta 0.01 digits 5 range 0.0 .. 4.0; + type Md is mod 5; + + package Math is new + Ada.Numerics.Generic_Elementary_Functions (Float); + + package Int_IO is new + Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); + use Int_IO; + + package Real_IO is new + Terminal_Interface.Curses.Text_IO.Float_IO (Float); + use Real_IO; + + package Enum_IO is new + Terminal_Interface.Curses.Text_IO.Enumeration_IO (Weekday); + use Enum_IO; + + package C_IO is new + Terminal_Interface.Curses.Text_IO.Complex_IO (Ada.Numerics.Complex_Types); + use C_IO; + + package F_IO is new + Terminal_Interface.Curses.Text_IO.Fixed_IO (Fix); + use F_IO; + + package D_IO is new + Terminal_Interface.Curses.Text_IO.Decimal_IO (Dec); + use D_IO; + + package M_IO is new + Terminal_Interface.Curses.Text_IO.Modular_IO (Md); + use M_IO; + + procedure Demo + is + W : Window; + P : Panel := Create (Standard_Window); + K : Real_Key_Code; + Im : constant Complex := (0.0, 1.0); + Fx : constant Dec := 3.14; + Dc : constant Dec := 2.72; + L : Md; + + begin + Push_Environment ("TEXTIO"); + Default_Labels; + Notepad ("TEXTIO-PAD00"); + + Set_Echo_Mode (False); + Set_Meta_Mode; + Set_KeyPad_Mode; + W := Sub_Window (Standard_Window, Lines - 2, Columns - 2, 1, 1); + Box; + Refresh_Without_Update; + Set_Meta_Mode (W); + Set_KeyPad_Mode (W); + Immediate_Update_Mode (W, True); + + Set_Window (W); + + for I in 1 .. 10 loop + Put ("Square root of "); + Put (Item => I, Width => 5); + Put (" is "); + Put (Item => Math.Sqrt (Float (I)), Exp => 0, Aft => 7); + New_Line; + end loop; + + for W in Weekday loop + Put (Item => W); Put (' '); + end loop; + New_Line; + + L := Md'First; + for I in 1 .. 2 loop + for J in Md'Range loop + Put (L); Put (' '); + L := L + 1; + end loop; + end loop; + New_Line; + + Put (Im); New_Line; + Put (Fx); New_Line; + Put (Dc); New_Line; + + loop + K := Get_Key; + if K in Special_Key_Code'Range then + case K is + when QUIT_CODE => exit; + when HELP_CODE => Explain_Context; + when EXPLAIN_CODE => Explain ("TEXTIOKEYS"); + when others => null; + end case; + end if; + end loop; + + Set_Window (Null_Window); + Erase; Refresh_Without_Update; + Delete (P); + Delete (W); + + Pop_Environment; + end Demo; + +end Sample.Text_IO_Demo; diff --git a/Ada95/samples/sample-text_io_demo.ads b/Ada95/samples/sample-text_io_demo.ads new file mode 100644 index 00000000000..d3f5a188baf --- /dev/null +++ b/Ada95/samples/sample-text_io_demo.ads @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample.Text_IO_Demo -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample.Text_IO_Demo is + + procedure Demo; + +end Sample.Text_IO_Demo; diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb new file mode 100644 index 00000000000..648036f74a0 --- /dev/null +++ b/Ada95/samples/sample.adb @@ -0,0 +1,220 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.17 $ +-- $Date: 2008/09/27 14:42:40 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Text_IO; + +with Ada.Exceptions; use Ada.Exceptions; + +with Terminal_Interface.Curses; use Terminal_Interface.Curses; +with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; +with Terminal_Interface.Curses.Menus.Menu_User_Data; +with Terminal_Interface.Curses.Menus.Item_User_Data; + +with Sample.Manifest; use Sample.Manifest; +with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; +with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; +with Sample.Header_Handler; use Sample.Header_Handler; +with Sample.Explanation; use Sample.Explanation; + +with Sample.Menu_Demo.Handler; +with Sample.Curses_Demo; +with Sample.Form_Demo; +with Sample.Menu_Demo; +with Sample.Text_IO_Demo; + +with GNAT.OS_Lib; + +package body Sample is + + type User_Data is + record + Data : Integer; + end record; + type User_Access is access User_Data; + + package Ud is new + Terminal_Interface.Curses.Menus.Menu_User_Data + (User_Data, User_Access); + + package Id is new + Terminal_Interface.Curses.Menus.Item_User_Data + (User_Data, User_Access); + + procedure Whow is + procedure Main_Menu; + procedure Main_Menu + is + function My_Driver (M : Menu; + K : Key_Code; + Pan : Panel) return Boolean; + + package Mh is new Sample.Menu_Demo.Handler (My_Driver); + + I : Item_Array_Access := new Item_Array' + (New_Item ("Curses Core Demo"), + New_Item ("Menu Demo"), + New_Item ("Form Demo"), + New_Item ("Text IO Demo"), + Null_Item); + + M : Menu := New_Menu (I); + + D1, D2 : User_Access; + I1, I2 : User_Access; + + function My_Driver (M : Menu; + K : Key_Code; + Pan : Panel) return Boolean + is + Idx : constant Positive := Get_Index (Current (M)); + begin + if K in User_Key_Code'Range then + if K = QUIT then + return True; + elsif K = SELECT_ITEM then + if Idx <= 4 then + Hide (Pan); + Update_Panels; + end if; + case Idx is + when 1 => Sample.Curses_Demo.Demo; + when 2 => Sample.Menu_Demo.Demo; + when 3 => Sample.Form_Demo.Demo; + when 4 => Sample.Text_IO_Demo.Demo; + when others => null; + end case; + if Idx <= 4 then + Top (Pan); + Show (Pan); + Update_Panels; + Update_Screen; + end if; + end if; + end if; + return False; + end My_Driver; + + begin + + if (1 + Item_Count (M)) /= I'Length then + raise Constraint_Error; + end if; + + D1 := new User_Data'(Data => 4711); + Ud.Set_User_Data (M, D1); + + I1 := new User_Data'(Data => 1174); + Id.Set_User_Data (I (1), I1); + + Set_Spacing (Men => M, Row => 2); + + Default_Labels; + Notepad ("MAINPAD"); + + Mh.Drive_Me (M, " Demo "); + + Ud.Get_User_Data (M, D2); + pragma Assert (D1 = D2); + pragma Assert (D1.Data = D2.Data); + + Id.Get_User_Data (I (1), I2); + pragma Assert (I1 = I2); + pragma Assert (I1.Data = I2.Data); + + Delete (M); + Free (I, True); + end Main_Menu; + + begin + Initialize (PC_Style_With_Index); + Init_Header_Handler; + Init_Screen; + + if Has_Colors then + Start_Color; + + Init_Pair (Pair => Default_Colors, Fore => Black, Back => White); + Init_Pair (Pair => Menu_Back_Color, Fore => Black, Back => Cyan); + Init_Pair (Pair => Menu_Fore_Color, Fore => Red, Back => Cyan); + Init_Pair (Pair => Menu_Grey_Color, Fore => White, Back => Cyan); + Init_Pair (Pair => Notepad_Color, Fore => Black, Back => Yellow); + Init_Pair (Pair => Help_Color, Fore => Blue, Back => Cyan); + Init_Pair (Pair => Form_Back_Color, Fore => Black, Back => Cyan); + Init_Pair (Pair => Form_Fore_Color, Fore => Red, Back => Cyan); + Init_Pair (Pair => Header_Color, Fore => Black, Back => Green); + + Set_Background (Ch => (Color => Default_Colors, + Attr => Normal_Video, + Ch => ' ')); + Set_Character_Attributes (Attr => Normal_Video, + Color => Default_Colors); + Erase; + + Set_Soft_Label_Key_Attributes (Color => Header_Color); + -- This propagates the attributes to the label window + Refresh_Soft_Label_Keys; + end if; + + Init_Keyboard_Handler; + + Set_Echo_Mode (False); + Set_Raw_Mode; + Set_Meta_Mode; + Set_KeyPad_Mode; + + -- Initialize the Function Key Environment + -- We have some fixed key throughout this sample + Main_Menu; + End_Windows; + Curses_Free_All; + + exception + when Event : others => + Terminal_Interface.Curses.End_Windows; + Text_IO.Put ("Exception: "); + Text_IO.Put (Exception_Name (Event)); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (1); + + end Whow; + +end Sample; diff --git a/Ada95/samples/sample.ads b/Ada95/samples/sample.ads new file mode 100644 index 00000000000..9d0647dad78 --- /dev/null +++ b/Ada95/samples/sample.ads @@ -0,0 +1,43 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Sample -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Sample is + procedure Whow; +end Sample; diff --git a/Ada95/samples/status.adb b/Ada95/samples/status.adb new file mode 100644 index 00000000000..e6581317f40 --- /dev/null +++ b/Ada95/samples/status.adb @@ -0,0 +1,57 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Status -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Version Control +-- $Revision: 1.7 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- This package has been contributed by Laurent Pautet -- +-- -- +package body Status is + + protected body Process is + procedure Stop is + begin + Done := True; + end Stop; + function Continue return Boolean is + begin + return not Done; + end Continue; + end Process; + +end Status; diff --git a/Ada95/samples/status.ads b/Ada95/samples/status.ads new file mode 100644 index 00000000000..e9e3ee8b350 --- /dev/null +++ b/Ada95/samples/status.ads @@ -0,0 +1,60 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Status -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Laurent Pautet +-- Modified by: Juergen Pfeifer, 1997 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- This package has been contributed by Laurent Pautet -- +-- -- +with Ada.Interrupts.Names; + +package Status is + + pragma Warnings (Off); -- the next pragma exists since 3.11p + pragma Unreserve_All_Interrupts; + pragma Warnings (On); + + protected Process is + procedure Stop; + function Continue return Boolean; + pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); + private + Done : Boolean := False; + end Process; + +end Status; diff --git a/Ada95/samples/tour.adb b/Ada95/samples/tour.adb new file mode 100644 index 00000000000..1cc91c15d74 --- /dev/null +++ b/Ada95/samples/tour.adb @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- tour -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Sample; use Sample; + +procedure Tour is +begin + Whow; +end Tour; diff --git a/Ada95/samples/tour.ads b/Ada95/samples/tour.ads new file mode 100644 index 00000000000..8888169160a --- /dev/null +++ b/Ada95/samples/tour.ads @@ -0,0 +1,41 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding Samples -- +-- -- +-- Tour -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +procedure Tour; diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in new file mode 100644 index 00000000000..4a599acb892 --- /dev/null +++ b/Ada95/src/Makefile.in @@ -0,0 +1,304 @@ +############################################################################## +# Copyright (c) 1998-2009,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"), # +# 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: Juergen Pfeifer, 1996 +# +# $Id: Makefile.in,v 1.53 2010/11/27 22:14:16 tom Exp $ +# +.SUFFIXES: + +SHELL = /bin/sh +VPATH = @srcdir@ +THIS = Makefile + +MODEL = ../../@DFT_OBJ_SUBDIR@ + +DESTDIR = @DESTDIR@ + +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = ${exec_prefix}/lib + +LIBDIR = $(DESTDIR)$(libdir) +ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@ +ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@ + +INSTALL = @INSTALL@ +INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ + +AR = @AR@ +ARFLAGS = @ARFLAGS@ +AWK = @AWK@ +LN_S = @LN_S@ + +CC = @CC@ +CFLAGS = @CFLAGS@ + +CPPFLAGS = @ACPPFLAGS@ \ + -DHAVE_CONFIG_H -I$(srcdir) + +CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +LINK = $(CC) +LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + +RANLIB = @RANLIB@ + +################################################################################ +ADA = @cf_ada_compiler@ +ADAPREP = gnatprep +ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) + +LIB_NAME = AdaCurses +SONAME = @ADA_SHAREDLIB@ + +GNAT_PROJECT = $(srcdir)/library.gpr + +# build/source are the Ada95 tree +BUILD_DIR = .. +SOURCE_DIR = .. + +BUILD_DIR_LIB = $(BUILD_DIR)/lib +SOURCE_DIR_SRC = $(SOURCE_DIR)/src + +ADAMAKE = @cf_ada_make@ +ADAMAKEFLAGS = \ + -P$(GNAT_PROJECT) \ + -XBUILD_DIR=`cd $(BUILD_DIR);pwd` \ + -XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \ + -XSOURCE_DIR2=`cd $(srcdir);pwd` \ + -XLIB_NAME=$(LIB_NAME) \ + -XSONAME=$(SONAME) + +CARGS = -cargs $(ADAFLAGS) +LARGS = + +STATIC_LIBNAME = lib$(LIB_NAME).a +SHARED_LIBNAME = $(SONAME) +SHARED_SYMLINK = lib$(LIB_NAME).so + +ALIB = @cf_ada_package@ +ABASE = $(ALIB)-curses +################################################################################ +GENERATED_SOURCES=$(ABASE).ads \ + $(ABASE).adb \ + $(ABASE)-aux.ads \ + $(ABASE)-trace.ads \ + $(ABASE)-menus.ads \ + $(ABASE)-forms.ads \ + $(ABASE)-mouse.ads \ + $(ABASE)-panels.ads \ + $(ABASE)-menus-menu_user_data.ads \ + $(ABASE)-menus-item_user_data.ads \ + $(ABASE)-forms-form_user_data.ads \ + $(ABASE)-forms-field_types.ads \ + $(ABASE)-forms-field_user_data.ads \ + $(ABASE)-panels-user_data.ads +################################################################################ +LIBOBJS=$(ALIB).o \ + $(ABASE)-aux.o \ + $(ABASE).o \ + $(ABASE)-terminfo.o \ + $(ABASE)-termcap.o \ + $(ABASE)-putwin.o \ + $(ABASE)-trace.o \ + $(ABASE)-mouse.o \ + $(ABASE)-panels.o \ + $(ABASE)-menus.o \ + $(ABASE)-forms.o \ + $(ABASE)-forms-field_types.o \ + $(ABASE)-forms-field_types-alpha.o \ + $(ABASE)-forms-field_types-alphanumeric.o \ + $(ABASE)-forms-field_types-intfield.o \ + $(ABASE)-forms-field_types-numeric.o \ + $(ABASE)-forms-field_types-regexp.o \ + $(ABASE)-forms-field_types-enumeration.o \ + $(ABASE)-forms-field_types-ipv4_address.o \ + $(ABASE)-forms-field_types-user.o \ + $(ABASE)-forms-field_types-user-choice.o \ + $(ABASE)-text_io.o \ + $(ABASE)-text_io-aux.o + +# Ada object files for generic packages. Since gnat 3.10 they are +# also compiled +GENOBJS=$(ABASE)-menus-menu_user_data.o \ + $(ABASE)-menus-item_user_data.o \ + $(ABASE)-forms-form_user_data.o \ + $(ABASE)-forms-field_user_data.o \ + $(ABASE)-forms-field_types-enumeration-ada.o \ + $(ABASE)-panels-user_data.o \ + $(ABASE)-text_io-integer_io.o \ + $(ABASE)-text_io-float_io.o \ + $(ABASE)-text_io-fixed_io.o \ + $(ABASE)-text_io-decimal_io.o \ + $(ABASE)-text_io-enumeration_io.o \ + $(ABASE)-text_io-modular_io.o \ + $(ABASE)-text_io-complex_io.o + +all :: $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) + @echo done + +$(ADA_INCLUDE) \ +$(ADA_OBJECTS) \ +$(LIBDIR) \ +$(BUILD_DIR_LIB) : + mkdir -p $@ + +sources : + @echo made $@ + +libs \ +install \ +install.libs :: \ + $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) + @echo made $(STATIC_LIBNAME) + +install \ +install.libs :: \ + $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \ + $(ADA_OBJECTS) + @$(INSTALL_LIB) \ + $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \ + $(ADA_OBJECTS) + +uninstall \ +uninstall.libs :: + @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) + +mostlyclean :: + rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a + +clean :: mostlyclean + rm -f $(ABASE)-trace.adb + +distclean :: clean + rm -f Makefile + +realclean :: distclean + +BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb + +$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p + rm -f $@ + $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@ + +############################################################################### + +@USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ +@USE_OLD_MAKERULES@ $(BUILD_DIR_LIB) \ +@USE_OLD_MAKERULES@ $(LIBOBJS) @cf_generic_objects@ +@USE_OLD_MAKERULES@ $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@ + +$(BUILD_DIR)/static-ali : ; mkdir -p $@ +$(BUILD_DIR)/static-obj : ; mkdir -p $@ + +STATIC_DIRS = \ + $(BUILD_DIR_LIB) \ + $(BUILD_DIR)/static-ali \ + $(BUILD_DIR)/static-obj + +@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ +@USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \ +@USE_GNAT_PROJECTS@ $(STATIC_DIRS) +@USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static +@USE_GNAT_PROJECTS@ +@USE_GNAT_PROJECTS@install \ +@USE_GNAT_PROJECTS@install.libs :: \ +@USE_GNAT_PROJECTS@ $(ADA_OBJECTS) +@USE_GNAT_PROJECTS@ $(INSTALL_LIB) \ +@USE_GNAT_PROJECTS@ $(BUILD_DIR)/static-ali/*.ali \ +@USE_GNAT_PROJECTS@ $(ADA_OBJECTS) + +uninstall \ +uninstall.libs :: + @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) + +@USE_GNAT_PROJECTS@uninstall \ +@USE_GNAT_PROJECTS@uninstall.libs :: +@USE_GNAT_PROJECTS@ @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' + +$(BUILD_DIR)/dynamic-ali : ; mkdir -p $@ +$(BUILD_DIR)/dynamic-obj : ; mkdir -p $@ + +SHARED_DIRS = \ + $(BUILD_DIR_LIB) \ + $(BUILD_DIR)/dynamic-ali \ + $(BUILD_DIR)/dynamic-obj + +@MAKE_ADA_SHAREDLIB@all \ +@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: $(ABASE)-trace.adb $(SHARED_DIRS) +@MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic + +install \ +install.libs :: $(ADA_INCLUDE) + $(INSTALL_LIB) \ + $(SOURCE_DIR_SRC)/*.ad[sb] \ + $(ADA_INCLUDE) + +install \ +install.libs :: $(ADA_INCLUDE) + $(INSTALL_LIB) \ + $(GENERATED_SOURCES) \ + $(ADA_INCLUDE) + +uninstall \ +uninstall.libs :: + $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done' + +@MAKE_ADA_SHAREDLIB@install \ +@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) +@MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ +@MAKE_ADA_SHAREDLIB@ $(BUILD_DIR)/dynamic-ali/* \ +@MAKE_ADA_SHAREDLIB@ $(ADA_OBJECTS) +@MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ +@MAKE_ADA_SHAREDLIB@ $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \ +@MAKE_ADA_SHAREDLIB@ $(LIBDIR) +@MAKE_ADA_SHAREDLIB@ cd $(LIBDIR) && ln -s $(SHARED_LIBNAME) $(SHARED_SYMLINK) +@MAKE_ADA_SHAREDLIB@ +@MAKE_ADA_SHAREDLIB@uninstall \ +@MAKE_ADA_SHAREDLIB@uninstall.libs :: +@MAKE_ADA_SHAREDLIB@ $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' +@MAKE_ADA_SHAREDLIB@ +@MAKE_ADA_SHAREDLIB@uninstall \ +@MAKE_ADA_SHAREDLIB@uninstall.libs :: +@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_SYMLINK) +@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_LIBNAME) + +clean :: + rm -rf $(BUILD_DIR)/*-ali + rm -rf $(BUILD_DIR)/*-obj + rm -rf $(BUILD_DIR_LIB) diff --git a/Ada95/src/library.gpr b/Ada95/src/library.gpr new file mode 100644 index 00000000000..62d67702b9c --- /dev/null +++ b/Ada95/src/library.gpr @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- Copyright (c) 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"), 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: library.gpr,v 1.5 2010/11/27 22:15:04 tom Exp $ +-- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html +-- http://www.adaworld.com/debian/debian-ada-policy.html +project Library is + Build_Dir := External ("BUILD_DIR"); + Source_Dir := External ("SOURCE_DIR"); + Source_Dir2 := External ("SOURCE_DIR2"); + Kind := External ("LIB_KIND"); + for Library_Name use External ("LIB_NAME"); + for Library_Version use External ("SONAME"); + + for Library_Kind use Kind; + for Library_Dir use Build_Dir & "/lib"; + for Object_Dir use Build_Dir & "/" & Kind & "-obj"; + for Library_ALI_Dir use Build_Dir & "/" & Kind & "-ali"; + for Source_Dirs use (Source_Dir & "/src", + Source_Dir2, + Build_Dir & "/src"); + package Compiler is + for Default_Switches ("Ada") use + ("-g", + "-O2", + "-gnatafno", + "-gnatVa", -- All validity checks + "-gnatwa"); -- Activate all optional errors + end Compiler; + +end Library; diff --git a/Ada95/src/modules b/Ada95/src/modules new file mode 100644 index 00000000000..9f5e03038eb --- /dev/null +++ b/Ada95/src/modules @@ -0,0 +1,70 @@ +# $Id: modules,v 1.3 2010/06/26 23:33:14 tom Exp $ +############################################################################## +# Copyright (c) 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"), # +# 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 2010 +# + +# Library objects +# rootname depend-spec depend-body unit +$(ALIB) $(srcdir) none spec +$(ABASE)-aux none $(srcdir) body +$(ABASE) none . body +$(ABASE)-terminfo $(srcdir) $(srcdir) body +$(ABASE)-termcap $(srcdir) $(srcdir) body +$(ABASE)-putwin $(srcdir) $(srcdir) body +$(ABASE)-trace . . body +$(ABASE)-mouse . $(srcdir) body +$(ABASE)-panels . $(srcdir) body +$(ABASE)-menus . $(srcdir) body +$(ABASE)-forms . $(srcdir) body +$(ABASE)-forms-field_types . $(srcdir) body +$(ABASE)-forms-field_types-alpha $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-alphanumeric $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-intfield $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-numeric $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-regexp $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-enumeration $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-ipv4_address $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-user $(srcdir) $(srcdir) body +$(ABASE)-forms-field_types-user-choice $(srcdir) $(srcdir) body +$(ABASE)-text_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-aux $(srcdir) $(srcdir) body +$(ABASE)-menus-menu_user_data . $(srcdir) body +$(ABASE)-menus-item_user_data . $(srcdir) body +$(ABASE)-forms-form_user_data . $(srcdir) body +$(ABASE)-forms-field_user_data . $(srcdir) body +$(ABASE)-forms-field_types-enumeration-ada $(srcdir) $(srcdir) body +$(ABASE)-panels-user_data . $(srcdir) body +$(ABASE)-text_io-integer_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-float_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-fixed_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-decimal_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-enumeration_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-modular_io $(srcdir) $(srcdir) body +$(ABASE)-text_io-complex_io $(srcdir) $(srcdir) body diff --git a/Ada95/src/terminal_interface-curses-aux.adb b/Ada95/src/terminal_interface-curses-aux.adb new file mode 100644 index 00000000000..9c2f8cd3867 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-aux.adb @@ -0,0 +1,116 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Aux -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Aux is + -- + -- Some helpers + procedure Fill_String (Cp : chars_ptr; + Str : out String) + is + -- Fill the string with the characters referenced by the + -- chars_ptr. + -- + Len : Natural; + begin + if Cp /= Null_Ptr then + Len := Natural (Strlen (Cp)); + if Str'Length < Len then + raise Constraint_Error; + end if; + declare + S : String (1 .. Len); + begin + S := Value (Cp); + Str (Str'First .. (Str'First + Len - 1)) := S (S'Range); + end; + else + Len := 0; + end if; + + if Len < Str'Length then + Str ((Str'First + Len) .. Str'Last) := (others => ' '); + end if; + + end Fill_String; + + function Fill_String (Cp : chars_ptr) return String + is + Len : Natural; + begin + if Cp /= Null_Ptr then + Len := Natural (Strlen (Cp)); + if Len = 0 then + return ""; + else + declare + S : String (1 .. Len); + begin + Fill_String (Cp, S); + return S; + end; + end if; + else + return ""; + end if; + end Fill_String; + + procedure Eti_Exception (Code : Eti_Error) + is + begin + case Code is + when E_Ok => null; + when E_System_Error => raise Eti_System_Error; + when E_Bad_Argument => raise Eti_Bad_Argument; + when E_Posted => raise Eti_Posted; + when E_Connected => raise Eti_Connected; + when E_Bad_State => raise Eti_Bad_State; + when E_No_Room => raise Eti_No_Room; + when E_Not_Posted => raise Eti_Not_Posted; + when E_Unknown_Command => raise Eti_Unknown_Command; + when E_No_Match => raise Eti_No_Match; + when E_Not_Selectable => raise Eti_Not_Selectable; + when E_Not_Connected => raise Eti_Not_Connected; + when E_Request_Denied => raise Eti_Request_Denied; + when E_Invalid_Field => raise Eti_Invalid_Field; + when E_Current => raise Eti_Current; + end case; + end Eti_Exception; + +end Terminal_Interface.Curses.Aux; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb new file mode 100644 index 00000000000..8e9d71adaf4 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.10 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is + + procedure Set_Field_Type (Fld : Field; + Typ : Alpha_Field) + is + C_Alpha_Field_Type : C_Field_Type; + pragma Import (C, C_Alpha_Field_Type, "TYPE_ALPHA"); + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_Alpha_Field_Type; + Arg1 : C_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.Alpha; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads new file mode 100644 index 00000000000..7878f73b2b5 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -0,0 +1,53 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface.Curses.Forms.Field_Types.Alpha is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha); + + type Alpha_Field is new Field_Type + with record + Minimum_Field_Width : Natural := 0; + end record; + + procedure Set_Field_Type (Fld : Field; + Typ : Alpha_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.Alpha; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb new file mode 100644 index 00000000000..4a2f76b8370 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.10 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is + + procedure Set_Field_Type (Fld : Field; + Typ : AlphaNumeric_Field) + is + C_AlphaNumeric_Field_Type : C_Field_Type; + pragma Import (C, C_AlphaNumeric_Field_Type, "TYPE_ALNUM"); + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_AlphaNumeric_Field_Type; + Arg1 : C_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads new file mode 100644 index 00000000000..c1009ac77ad --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads @@ -0,0 +1,54 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric); + + type AlphaNumeric_Field is new Field_Type + with record + Minimum_Field_Width : Natural := 0; + end record; + + procedure Set_Field_Type (Fld : Field; + Typ : AlphaNumeric_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb new file mode 100644 index 00000000000..b3eaf447ad8 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998,2004 Free 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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.10 $ +-- $Date: 2004/08/21 21:37:00 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Characters.Handling; use Ada.Characters.Handling; + +package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is + + function Create (Set : Type_Set := Mixed_Case; + Case_Sensitive : Boolean := False; + Must_Be_Unique : Boolean := False) + return Enumeration_Field + is + I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1); + J : Positive := 1; + begin + I.Case_Sensitive := Case_Sensitive; + I.Match_Must_Be_Unique := Must_Be_Unique; + + for E in T'Range loop + I.Names (J) := new String'(T'Image (E)); + -- The Image attribute defaults to upper case, so we have to handle + -- only the other ones... + if Set /= Upper_Case then + I.Names (J).all := To_Lower (I.Names (J).all); + if Set = Mixed_Case then + I.Names (J)(I.Names (J).all'First) := + To_Upper (I.Names (J)(I.Names (J).all'First)); + end if; + end if; + J := J + 1; + end loop; + + return Create (I, True); + end Create; + + function Value (Fld : Field; + Buf : Buffer_Number := Buffer_Number'First) return T + is + begin + return T'Value (Get_Buffer (Fld, Buf)); + end Value; + +end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads new file mode 100644 index 00000000000..48fad09c2f2 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads @@ -0,0 +1,59 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.10 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type T is (<>); + +package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); + + function Create (Set : Type_Set := Mixed_Case; + Case_Sensitive : Boolean := False; + Must_Be_Unique : Boolean := False) + return Enumeration_Field; + + function Value (Fld : Field; + Buf : Buffer_Number := Buffer_Number'First) return T; + -- Translate the content of the fields buffer - indicated by the + -- buffer number - into an enumeration value. If the buffer is empty + -- or the content is invalid, a Constraint_Error is raises. + +end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb new file mode 100644 index 00000000000..8c7815f6611 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb @@ -0,0 +1,119 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.8 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Deallocation; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is + + function Create (Info : Enumeration_Info; + Auto_Release_Names : Boolean := False) + return Enumeration_Field + is + procedure Release_String is + new Ada.Unchecked_Deallocation (String, + String_Access); + E : Enumeration_Field; + L : constant size_t := 1 + size_t (Info.C); + S : String_Access; + begin + E.Case_Sensitive := Info.Case_Sensitive; + E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique; + E.Arr := new chars_ptr_array (size_t (1) .. L); + for I in 1 .. Positive (L - 1) loop + if Info.Names (I) = null then + raise Form_Exception; + end if; + E.Arr (size_t (I)) := New_String (Info.Names (I).all); + if Auto_Release_Names then + S := Info.Names (I); + Release_String (S); + end if; + end loop; + E.Arr (L) := Null_Ptr; + return E; + end Create; + + procedure Release (Enum : in out Enumeration_Field) + is + I : size_t := 0; + P : chars_ptr; + begin + loop + P := Enum.Arr (I); + exit when P = Null_Ptr; + Free (P); + Enum.Arr (I) := Null_Ptr; + I := I + 1; + end loop; + Enum.Arr := null; + end Release; + + procedure Set_Field_Type (Fld : Field; + Typ : Enumeration_Field) + is + C_Enum_Type : C_Field_Type; + pragma Import (C, C_Enum_Type, "TYPE_ENUM"); + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_Enum_Type; + Arg1 : chars_ptr_array; + Arg2 : C_Int; + Arg3 : C_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + begin + if Typ.Arr = null then + raise Form_Exception; + end if; + Res := Set_Fld_Type (Arg1 => Typ.Arr.all, + Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)), + Arg3 => C_Int (Boolean'Pos + (Typ.Match_Must_Be_Unique))); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ, C_Choice_Router); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.Enumeration; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads new file mode 100644 index 00000000000..e6924f6b19f --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads @@ -0,0 +1,98 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C.Strings; + +package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.Enumeration); + + type String_Access is access String; + + -- Type_Set is used by the child package Ada + type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); + + type Enum_Array is array (Positive range <>) + of String_Access; + + type Enumeration_Info (C : Positive) is + record + Names : Enum_Array (1 .. C); + Case_Sensitive : Boolean := False; + Match_Must_Be_Unique : Boolean := False; + end record; + + type Enumeration_Field is new Field_Type with private; + + function Create (Info : Enumeration_Info; + Auto_Release_Names : Boolean := False) + return Enumeration_Field; + -- Make an fieldtype from the info. Enumerations are special, because + -- they normally don't copy the enum values into a private store, so + -- we have to care for the lifetime of the info we provide. + -- The Auto_Release_Names flag may be used to automatically releases + -- the strings in the Names array of the Enumeration_Info. + + function Make_Enumeration_Type (Info : Enumeration_Info; + Auto_Release_Names : Boolean := False) + return Enumeration_Field renames Create; + + procedure Release (Enum : in out Enumeration_Field); + -- But we may want to release the field to release the memory allocated + -- by it internally. After that the Enumeration field is no longer usable. + + -- The next type defintions are all ncurses extensions. They are typically + -- not available in other curses implementations. + + procedure Set_Field_Type (Fld : Field; + Typ : Enumeration_Field); + pragma Inline (Set_Field_Type); + +private + type CPA_Access is access Interfaces.C.Strings.chars_ptr_array; + + type Enumeration_Field is new Field_Type with + record + Case_Sensitive : Boolean := False; + Match_Must_Be_Unique : Boolean := False; + Arr : CPA_Access := null; + end record; + +end Terminal_Interface.Curses.Forms.Field_Types.Enumeration; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb new file mode 100644 index 00000000000..8b934d08955 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb @@ -0,0 +1,70 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IntField -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.10 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.IntField is + + procedure Set_Field_Type (Fld : Field; + Typ : Integer_Field) + is + C_Integer_Field_Type : C_Field_Type; + pragma Import (C, C_Integer_Field_Type, "TYPE_INTEGER"); + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_Integer_Field_Type; + Arg1 : C_Int; + Arg2 : C_Long_Int; + Arg3 : C_Long_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision), + Arg2 => C_Long_Int (Typ.Lower_Limit), + Arg3 => C_Long_Int (Typ.Upper_Limit)); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.IntField; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads new file mode 100644 index 00000000000..e90f0d06f17 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IntField -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface.Curses.Forms.Field_Types.IntField is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField); + + type Integer_Field is new Field_Type with + record + Precision : Natural; + Lower_Limit : Integer; + Upper_Limit : Integer; + end record; + + procedure Set_Field_Type (Fld : Field; + Typ : Integer_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.IntField; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb new file mode 100644 index 00000000000..2328f4ed0c0 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.10 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is + + procedure Set_Field_Type (Fld : Field; + Typ : Internet_V4_Address_Field) + is + C_IPV4_Field_Type : C_Field_Type; + pragma Import (C, C_IPV4_Field_Type, "TYPE_IPV4"); + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_IPV4_Field_Type) + return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + begin + Res := Set_Fld_Type; + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads new file mode 100644 index 00000000000..af367e7e5ab --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads @@ -0,0 +1,51 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address); + + type Internet_V4_Address_Field is new Field_Type with null record; + + procedure Set_Field_Type (Fld : Field; + Typ : Internet_V4_Address_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb new file mode 100644 index 00000000000..7151bb8b993 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb @@ -0,0 +1,73 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is + + procedure Set_Field_Type (Fld : Field; + Typ : Numeric_Field) + is + type Double is new Interfaces.C.double; + + C_Numeric_Field_Type : C_Field_Type; + pragma Import (C, C_Numeric_Field_Type, "TYPE_NUMERIC"); + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_Numeric_Field_Type; + Arg1 : C_Int; + Arg2 : Double; + Arg3 : Double) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision), + Arg2 => Double (Typ.Lower_Limit), + Arg3 => Double (Typ.Upper_Limit)); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.Numeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads new file mode 100644 index 00000000000..7c6f9fa15ce --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface.Curses.Forms.Field_Types.Numeric is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric); + + type Numeric_Field is new Field_Type with + record + Precision : Natural; + Lower_Limit : Float; + Upper_Limit : Float; + end record; + + procedure Set_Field_Type (Fld : Field; + Typ : Numeric_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.Numeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb new file mode 100644 index 00000000000..f4c7c587ad9 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.9 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; use Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is + + procedure Set_Field_Type (Fld : Field; + Typ : Regular_Expression_Field) + is + type Char_Ptr is access all Interfaces.C.char; + + C_Regexp_Field_Type : C_Field_Type; + pragma Import (C, C_Regexp_Field_Type, "TYPE_REGEXP"); + + function Set_Ftyp (F : Field := Fld; + Cft : C_Field_Type := C_Regexp_Field_Type; + Arg1 : Char_Ptr) return C_Int; + pragma Import (C, Set_Ftyp, "set_field_type"); + + Txt : char_array (0 .. Typ.Regular_Expression.all'Length); + Len : size_t; + Res : Eti_Error; + begin + To_C (Typ.Regular_Expression.all, Txt, Len); + Res := Set_Ftyp (Arg1 => Txt (Txt'First)'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Wrap_Builtin (Fld, Typ); + end Set_Field_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.RegExp; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads new file mode 100644 index 00000000000..26841382dcb --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface.Curses.Forms.Field_Types.RegExp is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp); + + type String_Access is access String; + + type Regular_Expression_Field is new Field_Type with + record + Regular_Expression : String_Access; + end record; + + procedure Set_Field_Type (Fld : Field; + Typ : Regular_Expression_Field); + pragma Inline (Set_Field_Type); + +end Terminal_Interface.Curses.Forms.Field_Types.RegExp; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb new file mode 100644 index 00000000000..f26a42cdca1 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb @@ -0,0 +1,110 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.15 $ +-- $Date: 2008/07/26 18:48:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Conversion; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is + + pragma Warnings (Off); + function To_Argument_Access is new Ada.Unchecked_Conversion + (System.Address, Argument_Access); + pragma Warnings (On); + + function Generic_Next (Fld : Field; + Usr : System.Address) return C_Int + is + Result : Boolean; + Udf : constant User_Defined_Field_Type_With_Choice_Access := + User_Defined_Field_Type_With_Choice_Access + (To_Argument_Access (Usr).Typ); + begin + Result := Next (Fld, Udf.all); + return C_Int (Boolean'Pos (Result)); + end Generic_Next; + + function Generic_Prev (Fld : Field; + Usr : System.Address) return C_Int + is + Result : Boolean; + Udf : constant User_Defined_Field_Type_With_Choice_Access := + User_Defined_Field_Type_With_Choice_Access + (To_Argument_Access (Usr).Typ); + begin + Result := Previous (Fld, Udf.all); + return C_Int (Boolean'Pos (Result)); + end Generic_Prev; + + -- ----------------------------------------------------------------------- + -- + function C_Generic_Choice return C_Field_Type + is + Res : Eti_Error; + T : C_Field_Type; + begin + if M_Generic_Choice = Null_Field_Type then + T := New_Fieldtype (Generic_Field_Check'Access, + Generic_Char_Check'Access); + if T = Null_Field_Type then + raise Form_Exception; + else + Res := Set_Fieldtype_Arg (T, + Make_Arg'Access, + Copy_Arg'Access, + Free_Arg'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + + Res := Set_Fieldtype_Choice (T, + Generic_Next'Access, + Generic_Prev'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + M_Generic_Choice := T; + end if; + pragma Assert (M_Generic_Choice /= Null_Field_Type); + return M_Generic_Choice; + end C_Generic_Choice; + +end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads new file mode 100644 index 00000000000..1e69f43a915 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads @@ -0,0 +1,94 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- $Date: 2008/07/26 18:49:20 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; + +package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is + pragma Preelaborate + (Terminal_Interface.Curses.Forms.Field_Types.User.Choice); + + subtype C_Int is Interfaces.C.int; + + type User_Defined_Field_Type_With_Choice is abstract new + User_Defined_Field_Type with null record; + -- This is the root of the mechanism we use to create field types in + -- Ada95 that allow the prev/next mechanism. You should your own type + -- derive from this one and implement the Field_Check, Character_Check + -- Next and Previous functions for your own type. + + type User_Defined_Field_Type_With_Choice_Access is access all + User_Defined_Field_Type_With_Choice'Class; + + function Next + (Fld : Field; + Typ : User_Defined_Field_Type_With_Choice) return Boolean + is abstract; + -- If True is returned, the function successfully generated a next + -- value into the fields buffer. + + function Previous + (Fld : Field; + Typ : User_Defined_Field_Type_With_Choice) return Boolean + is abstract; + -- If True is returned, the function successfully generated a previous + -- value into the fields buffer. + + -- +---------------------------------------------------------------------- + -- | Private Part. + -- | +private + function C_Generic_Choice return C_Field_Type; + + function Generic_Next (Fld : Field; + Usr : System.Address) return C_Int; + pragma Convention (C, Generic_Next); + -- This is the generic next Choice_Function for the low-level fieldtype + -- representing all the User_Defined_Field_Type derivates. It routes + -- the call to the Next implementation for the type. + + function Generic_Prev (Fld : Field; + Usr : System.Address) return C_Int; + pragma Convention (C, Generic_Prev); + -- This is the generic prev Choice_Function for the low-level fieldtype + -- representing all the User_Defined_Field_Type derivates. It routes + -- the call to the Previous implementation for the type. + +end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb new file mode 100644 index 00000000000..695f9197193 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb @@ -0,0 +1,133 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.16 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Conversion; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Field_Types.User is + + procedure Set_Field_Type (Fld : Field; + Typ : User_Defined_Field_Type) + is + function Allocate_Arg (T : User_Defined_Field_Type'Class) + return Argument_Access; + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := C_Generic_Type; + Arg1 : Argument_Access) + return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + Res : Eti_Error; + + function Allocate_Arg (T : User_Defined_Field_Type'Class) + return Argument_Access + is + Ptr : constant Field_Type_Access + := new User_Defined_Field_Type'Class'(T); + begin + return new Argument'(Usr => System.Null_Address, + Typ => Ptr, + Cft => Null_Field_Type); + end Allocate_Arg; + + begin + Res := Set_Fld_Type (Arg1 => Allocate_Arg (Typ)); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Field_Type; + + pragma Warnings (Off); + function To_Argument_Access is new Ada.Unchecked_Conversion + (System.Address, Argument_Access); + pragma Warnings (On); + + function Generic_Field_Check (Fld : Field; + Usr : System.Address) return C_Int + is + Result : Boolean; + Udf : constant User_Defined_Field_Type_Access := + User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ); + begin + Result := Field_Check (Fld, Udf.all); + return C_Int (Boolean'Pos (Result)); + end Generic_Field_Check; + + function Generic_Char_Check (Ch : C_Int; + Usr : System.Address) return C_Int + is + Result : Boolean; + Udf : constant User_Defined_Field_Type_Access := + User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ); + begin + Result := Character_Check (Character'Val (Ch), Udf.all); + return C_Int (Boolean'Pos (Result)); + end Generic_Char_Check; + + -- ----------------------------------------------------------------------- + -- + function C_Generic_Type return C_Field_Type + is + Res : Eti_Error; + T : C_Field_Type; + begin + if M_Generic_Type = Null_Field_Type then + T := New_Fieldtype (Generic_Field_Check'Access, + Generic_Char_Check'Access); + if T = Null_Field_Type then + raise Form_Exception; + else + Res := Set_Fieldtype_Arg (T, + Make_Arg'Access, + Copy_Arg'Access, + Free_Arg'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + M_Generic_Type := T; + end if; + pragma Assert (M_Generic_Type /= Null_Field_Type); + return M_Generic_Type; + end C_Generic_Type; + +end Terminal_Interface.Curses.Forms.Field_Types.User; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads new file mode 100644 index 00000000000..af45fab4922 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads @@ -0,0 +1,95 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types.User -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.13 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; + +package Terminal_Interface.Curses.Forms.Field_Types.User is + pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User); + subtype C_Int is Interfaces.C.int; + + type User_Defined_Field_Type is abstract new Field_Type with null record; + -- This is the root of the mechanism we use to create field types in + -- Ada95. You should your own type derive from this one and implement + -- the Field_Check and Character_Check functions for your own type. + + type User_Defined_Field_Type_Access is access all + User_Defined_Field_Type'Class; + + function Field_Check + (Fld : Field; + Typ : User_Defined_Field_Type) return Boolean + is abstract; + -- If True is returned, the field is considered valid, otherwise it is + -- invalid. + + function Character_Check + (Ch : Character; + Typ : User_Defined_Field_Type) return Boolean + is abstract; + -- If True is returned, the character is considered as valid for the + -- field, otherwise as invalid. + + procedure Set_Field_Type (Fld : Field; + Typ : User_Defined_Field_Type); + -- This should work for all types derived from User_Defined_Field_Type. + -- No need to reimplement it for your derived type. + + -- +---------------------------------------------------------------------- + -- | Private Part. + -- | Used by the Choice child package. +private + function C_Generic_Type return C_Field_Type; + + function Generic_Field_Check (Fld : Field; + Usr : System.Address) return C_Int; + pragma Convention (C, Generic_Field_Check); + -- This is the generic Field_Check_Function for the low-level fieldtype + -- representing all the User_Defined_Field_Type derivates. It routes + -- the call to the Field_Check implementation for the type. + + function Generic_Char_Check (Ch : C_Int; + Usr : System.Address) return C_Int; + pragma Convention (C, Generic_Char_Check); + -- This is the generic Char_Check_Function for the low-level fieldtype + -- representing all the User_Defined_Field_Type derivates. It routes + -- the call to the Character_Check implementation for the type. + +end Terminal_Interface.Curses.Forms.Field_Types.User; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types.adb b/Ada95/src/terminal_interface-curses-forms-field_types.adb new file mode 100644 index 00000000000..aef5d3c8a38 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_types.adb @@ -0,0 +1,296 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.21 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Ada.Unchecked_Deallocation; +with Ada.Unchecked_Conversion; +-- | +-- |===================================================================== +-- | man page form_fieldtype.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Field_Types is + + use type System.Address; + + pragma Warnings (Off); + function To_Argument_Access is new Ada.Unchecked_Conversion + (System.Address, Argument_Access); + pragma Warnings (On); + + function Get_Fieldtype (F : Field) return C_Field_Type; + pragma Import (C, Get_Fieldtype, "field_type"); + + function Get_Arg (F : Field) return System.Address; + pragma Import (C, Get_Arg, "field_arg"); + -- | + -- |===================================================================== + -- | man page form_field_validation.3x + -- |===================================================================== + -- | + -- | + -- | + function Get_Type (Fld : Field) return Field_Type_Access + is + Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); + Arg : Argument_Access; + begin + if Low_Level = Null_Field_Type then + return null; + else + if Low_Level = M_Builtin_Router or else + Low_Level = M_Generic_Type or else + Low_Level = M_Choice_Router or else + Low_Level = M_Generic_Choice then + Arg := To_Argument_Access (Get_Arg (Fld)); + if Arg = null then + raise Form_Exception; + else + return Arg.Typ; + end if; + else + raise Form_Exception; + end if; + end if; + end Get_Type; + + function Make_Arg (Args : System.Address) return System.Address + is + -- Actually args is a double indirected pointer to the arguments + -- of a C variable argument list. In theory it is now quite + -- complicated to write portable routine that reads the arguments, + -- because one has to know the growth direction of the stack and + -- the sizes of the individual arguments. + -- Fortunately we are only interested in the first argument (#0), + -- we know its size and for the first arg we don't care about + -- into which stack direction we have to proceed. We simply + -- resolve the double indirection and thats it. + type V is access all System.Address; + function To_Access is new Ada.Unchecked_Conversion (System.Address, + V); + begin + return To_Access (To_Access (Args).all).all; + end Make_Arg; + + function Copy_Arg (Usr : System.Address) return System.Address + is + begin + return Usr; + end Copy_Arg; + + procedure Free_Arg (Usr : System.Address) + is + procedure Free_Type is new Ada.Unchecked_Deallocation + (Field_Type'Class, Field_Type_Access); + procedure Freeargs is new Ada.Unchecked_Deallocation + (Argument, Argument_Access); + + To_Be_Free : Argument_Access := To_Argument_Access (Usr); + Low_Level : C_Field_Type; + begin + if To_Be_Free /= null then + if To_Be_Free.Usr /= System.Null_Address then + Low_Level := To_Be_Free.Cft; + if Low_Level.Freearg /= null then + Low_Level.Freearg (To_Be_Free.Usr); + end if; + end if; + if To_Be_Free.Typ /= null then + Free_Type (To_Be_Free.Typ); + end if; + Freeargs (To_Be_Free); + end if; + end Free_Arg; + + procedure Wrap_Builtin (Fld : Field; + Typ : Field_Type'Class; + Cft : C_Field_Type := C_Builtin_Router) + is + Usr_Arg : constant System.Address := Get_Arg (Fld); + Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); + Arg : Argument_Access; + Res : Eti_Error; + function Set_Fld_Type (F : Field := Fld; + Cf : C_Field_Type := Cft; + Arg1 : Argument_Access) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + + begin + pragma Assert (Low_Level /= Null_Field_Type); + if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then + raise Form_Exception; + else + Arg := new Argument'(Usr => System.Null_Address, + Typ => new Field_Type'Class'(Typ), + Cft => Get_Fieldtype (Fld)); + if Usr_Arg /= System.Null_Address then + if Low_Level.Copyarg /= null then + Arg.Usr := Low_Level.Copyarg (Usr_Arg); + else + Arg.Usr := Usr_Arg; + end if; + end if; + + Res := Set_Fld_Type (Arg1 => Arg); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + end Wrap_Builtin; + + function Field_Check_Router (Fld : Field; + Usr : System.Address) return C_Int + is + Arg : constant Argument_Access := To_Argument_Access (Usr); + begin + pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type + and then Arg.Typ /= null); + if Arg.Cft.Fcheck /= null then + return Arg.Cft.Fcheck (Fld, Arg.Usr); + else + return 1; + end if; + end Field_Check_Router; + + function Char_Check_Router (Ch : C_Int; + Usr : System.Address) return C_Int + is + Arg : constant Argument_Access := To_Argument_Access (Usr); + begin + pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type + and then Arg.Typ /= null); + if Arg.Cft.Ccheck /= null then + return Arg.Cft.Ccheck (Ch, Arg.Usr); + else + return 1; + end if; + end Char_Check_Router; + + function Next_Router (Fld : Field; + Usr : System.Address) return C_Int + is + Arg : constant Argument_Access := To_Argument_Access (Usr); + begin + pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type + and then Arg.Typ /= null); + if Arg.Cft.Next /= null then + return Arg.Cft.Next (Fld, Arg.Usr); + else + return 1; + end if; + end Next_Router; + + function Prev_Router (Fld : Field; + Usr : System.Address) return C_Int + is + Arg : constant Argument_Access := To_Argument_Access (Usr); + begin + pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type + and then Arg.Typ /= null); + if Arg.Cft.Prev /= null then + return Arg.Cft.Prev (Fld, Arg.Usr); + else + return 1; + end if; + end Prev_Router; + + -- ----------------------------------------------------------------------- + -- + function C_Builtin_Router return C_Field_Type + is + Res : Eti_Error; + T : C_Field_Type; + begin + if M_Builtin_Router = Null_Field_Type then + T := New_Fieldtype (Field_Check_Router'Access, + Char_Check_Router'Access); + if T = Null_Field_Type then + raise Form_Exception; + else + Res := Set_Fieldtype_Arg (T, + Make_Arg'Access, + Copy_Arg'Access, + Free_Arg'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + M_Builtin_Router := T; + end if; + pragma Assert (M_Builtin_Router /= Null_Field_Type); + return M_Builtin_Router; + end C_Builtin_Router; + + -- ----------------------------------------------------------------------- + -- + function C_Choice_Router return C_Field_Type + is + Res : Eti_Error; + T : C_Field_Type; + begin + if M_Choice_Router = Null_Field_Type then + T := New_Fieldtype (Field_Check_Router'Access, + Char_Check_Router'Access); + if T = Null_Field_Type then + raise Form_Exception; + else + Res := Set_Fieldtype_Arg (T, + Make_Arg'Access, + Copy_Arg'Access, + Free_Arg'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + + Res := Set_Fieldtype_Choice (T, + Next_Router'Access, + Prev_Router'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + M_Choice_Router := T; + end if; + pragma Assert (M_Choice_Router /= Null_Field_Type); + return M_Choice_Router; + end C_Choice_Router; + +end Terminal_Interface.Curses.Forms.Field_Types; diff --git a/Ada95/src/terminal_interface-curses-forms-field_user_data.adb b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb new file mode 100644 index 00000000000..96178d8a934 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb @@ -0,0 +1,85 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_User_Data -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.13 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +-- | +-- |===================================================================== +-- | man page form_field_userptr.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Field_User_Data is + -- | + -- | + -- | + use type Interfaces.C.int; + + procedure Set_User_Data (Fld : Field; + Data : User_Access) + is + function Set_Field_Userptr (Fld : Field; + Usr : User_Access) return C_Int; + pragma Import (C, Set_Field_Userptr, "set_field_userptr"); + + Res : constant Eti_Error := Set_Field_Userptr (Fld, Data); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_User_Data; + -- | + -- | + -- | + function Get_User_Data (Fld : Field) return User_Access + is + function Field_Userptr (Fld : Field) return User_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + begin + return Field_Userptr (Fld); + end Get_User_Data; + + procedure Get_User_Data (Fld : Field; + Data : out User_Access) + is + begin + Data := Get_User_Data (Fld); + end Get_User_Data; + +end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/Ada95/src/terminal_interface-curses-forms-form_user_data.adb b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb new file mode 100644 index 00000000000..84353eb5570 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb @@ -0,0 +1,86 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Form_User_Data -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.13 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +-- | +-- |===================================================================== +-- | man page form__userptr.3x +-- |===================================================================== +-- | +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms.Form_User_Data is + + use type Interfaces.C.int; + + -- | + -- | + -- | + procedure Set_User_Data (Frm : Form; + Data : User_Access) + is + function Set_Form_Userptr (Frm : Form; + Data : User_Access) return C_Int; + pragma Import (C, Set_Form_Userptr, "set_form_userptr"); + + Res : constant Eti_Error := Set_Form_Userptr (Frm, Data); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_User_Data; + -- | + -- | + -- | + function Get_User_Data (Frm : Form) return User_Access + is + function Form_Userptr (Frm : Form) return User_Access; + pragma Import (C, Form_Userptr, "form_userptr"); + begin + return Form_Userptr (Frm); + end Get_User_Data; + + procedure Get_User_Data (Frm : Form; + Data : out User_Access) + is + begin + Data := Get_User_Data (Frm); + end Get_User_Data; + +end Terminal_Interface.Curses.Forms.Form_User_Data; diff --git a/Ada95/src/terminal_interface-curses-forms.adb b/Ada95/src/terminal_interface-curses-forms.adb new file mode 100644 index 00000000000..68825fc3dfb --- /dev/null +++ b/Ada95/src/terminal_interface-curses-forms.adb @@ -0,0 +1,1161 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.27 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Deallocation; +with Ada.Unchecked_Conversion; + +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Interfaces.C.Pointers; + +with Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Forms is + + use Terminal_Interface.Curses.Aux; + + type C_Field_Array is array (Natural range <>) of aliased Field; + package F_Array is new + Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field); + +------------------------------------------------------------------------------ + -- | + -- | + -- | + -- subtype chars_ptr is Interfaces.C.Strings.chars_ptr; + + function FOS_2_CInt is new + Ada.Unchecked_Conversion (Field_Option_Set, + C_Int); + + function CInt_2_FOS is new + Ada.Unchecked_Conversion (C_Int, + Field_Option_Set); + + function FrmOS_2_CInt is new + Ada.Unchecked_Conversion (Form_Option_Set, + C_Int); + + function CInt_2_FrmOS is new + Ada.Unchecked_Conversion (C_Int, + Form_Option_Set); + + procedure Request_Name (Key : Form_Request_Code; + Name : out String) + is + function Form_Request_Name (Key : C_Int) return chars_ptr; + pragma Import (C, Form_Request_Name, "form_request_name"); + begin + Fill_String (Form_Request_Name (C_Int (Key)), Name); + end Request_Name; + + function Request_Name (Key : Form_Request_Code) return String + is + function Form_Request_Name (Key : C_Int) return chars_ptr; + pragma Import (C, Form_Request_Name, "form_request_name"); + begin + return Fill_String (Form_Request_Name (C_Int (Key))); + end Request_Name; +------------------------------------------------------------------------------ + -- | + -- | + -- | + -- | + -- |===================================================================== + -- | man page form_field_new.3x + -- |===================================================================== + -- | + -- | + -- | + function Create (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field + is + function Newfield (H, W, T, L, O, M : C_Int) return Field; + pragma Import (C, Newfield, "new_field"); + Fld : constant Field := Newfield (C_Int (Height), C_Int (Width), + C_Int (Top), C_Int (Left), + C_Int (Off_Screen), + C_Int (More_Buffers)); + begin + if Fld = Null_Field then + raise Form_Exception; + end if; + return Fld; + end Create; +-- | +-- | +-- | + procedure Delete (Fld : in out Field) + is + function Free_Field (Fld : Field) return C_Int; + pragma Import (C, Free_Field, "free_field"); + + Res : Eti_Error; + begin + Res := Free_Field (Fld); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Fld := Null_Field; + end Delete; + -- | + -- | + -- | + function Duplicate (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field + is + function Dup_Field (Fld : Field; + Top : C_Int; + Left : C_Int) return Field; + pragma Import (C, Dup_Field, "dup_field"); + + F : constant Field := Dup_Field (Fld, + C_Int (Top), + C_Int (Left)); + begin + if F = Null_Field then + raise Form_Exception; + end if; + return F; + end Duplicate; + -- | + -- | + -- | + function Link (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field + is + function Lnk_Field (Fld : Field; + Top : C_Int; + Left : C_Int) return Field; + pragma Import (C, Lnk_Field, "link_field"); + + F : constant Field := Lnk_Field (Fld, + C_Int (Top), + C_Int (Left)); + begin + if F = Null_Field then + raise Form_Exception; + end if; + return F; + end Link; + -- | + -- |===================================================================== + -- | man page form_field_just.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Justification (Fld : Field; + Just : Field_Justification := None) + is + function Set_Field_Just (Fld : Field; + Just : C_Int) return C_Int; + pragma Import (C, Set_Field_Just, "set_field_just"); + + Res : constant Eti_Error := + Set_Field_Just (Fld, + C_Int (Field_Justification'Pos (Just))); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Justification; + -- | + -- | + -- | + function Get_Justification (Fld : Field) return Field_Justification + is + function Field_Just (Fld : Field) return C_Int; + pragma Import (C, Field_Just, "field_just"); + begin + return Field_Justification'Val (Field_Just (Fld)); + end Get_Justification; + -- | + -- |===================================================================== + -- | man page form_field_buffer.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Buffer + (Fld : Field; + Buffer : Buffer_Number := Buffer_Number'First; + Str : String) + is + type Char_Ptr is access all Interfaces.C.char; + function Set_Fld_Buffer (Fld : Field; + Bufnum : C_Int; + S : Char_Ptr) + return C_Int; + pragma Import (C, Set_Fld_Buffer, "set_field_buffer"); + + Txt : char_array (0 .. Str'Length); + Len : size_t; + Res : Eti_Error; + begin + To_C (Str, Txt, Len); + Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Buffer; + -- | + -- | + -- | + procedure Get_Buffer + (Fld : Field; + Buffer : Buffer_Number := Buffer_Number'First; + Str : out String) + is + function Field_Buffer (Fld : Field; + B : C_Int) return chars_ptr; + pragma Import (C, Field_Buffer, "field_buffer"); + begin + Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str); + end Get_Buffer; + + function Get_Buffer + (Fld : Field; + Buffer : Buffer_Number := Buffer_Number'First) return String + is + function Field_Buffer (Fld : Field; + B : C_Int) return chars_ptr; + pragma Import (C, Field_Buffer, "field_buffer"); + begin + return Fill_String (Field_Buffer (Fld, C_Int (Buffer))); + end Get_Buffer; + -- | + -- | + -- | + procedure Set_Status (Fld : Field; + Status : Boolean := True) + is + function Set_Fld_Status (Fld : Field; + St : C_Int) return C_Int; + pragma Import (C, Set_Fld_Status, "set_field_status"); + + Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status)); + begin + if Res /= E_Ok then + raise Form_Exception; + end if; + end Set_Status; + -- | + -- | + -- | + function Changed (Fld : Field) return Boolean + is + function Field_Status (Fld : Field) return C_Int; + pragma Import (C, Field_Status, "field_status"); + + Res : constant C_Int := Field_Status (Fld); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Changed; + -- | + -- | + -- | + procedure Set_Maximum_Size (Fld : Field; + Max : Natural := 0) + is + function Set_Field_Max (Fld : Field; + M : C_Int) return C_Int; + pragma Import (C, Set_Field_Max, "set_max_field"); + + Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Maximum_Size; + -- | + -- |===================================================================== + -- | man page form_field_opts.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Options (Fld : Field; + Options : Field_Option_Set) + is + function Set_Field_Opts (Fld : Field; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Field_Opts, "set_field_opts"); + + Opt : constant C_Int := FOS_2_CInt (Options); + Res : Eti_Error; + begin + Res := Set_Field_Opts (Fld, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + -- | + -- | + -- | + procedure Switch_Options (Fld : Field; + Options : Field_Option_Set; + On : Boolean := True) + is + function Field_Opts_On (Fld : Field; + Opt : C_Int) return C_Int; + pragma Import (C, Field_Opts_On, "field_opts_on"); + function Field_Opts_Off (Fld : Field; + Opt : C_Int) return C_Int; + pragma Import (C, Field_Opts_Off, "field_opts_off"); + + Err : Eti_Error; + Opt : constant C_Int := FOS_2_CInt (Options); + begin + if On then + Err := Field_Opts_On (Fld, Opt); + else + Err := Field_Opts_Off (Fld, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + -- | + -- | + -- | + procedure Get_Options (Fld : Field; + Options : out Field_Option_Set) + is + function Field_Opts (Fld : Field) return C_Int; + pragma Import (C, Field_Opts, "field_opts"); + + Res : constant C_Int := Field_Opts (Fld); + begin + Options := CInt_2_FOS (Res); + end Get_Options; + -- | + -- | + -- | + function Get_Options (Fld : Field := Null_Field) + return Field_Option_Set + is + Fos : Field_Option_Set; + begin + Get_Options (Fld, Fos); + return Fos; + end Get_Options; + -- | + -- |===================================================================== + -- | man page form_field_attributes.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Foreground + (Fld : Field; + Fore : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Set_Field_Fore (Fld : Field; + Attr : C_Chtype) return C_Int; + pragma Import (C, Set_Field_Fore, "set_field_fore"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Fore); + Res : constant Eti_Error := + Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Foreground; + -- | + -- | + -- | + procedure Foreground (Fld : Field; + Fore : out Character_Attribute_Set) + is + function Field_Fore (Fld : Field) return C_Chtype; + pragma Import (C, Field_Fore, "field_fore"); + begin + Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; + end Foreground; + + procedure Foreground (Fld : Field; + Fore : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Field_Fore (Fld : Field) return C_Chtype; + pragma Import (C, Field_Fore, "field_fore"); + begin + Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; + Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color; + end Foreground; + -- | + -- | + -- | + procedure Set_Background + (Fld : Field; + Back : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Set_Field_Back (Fld : Field; + Attr : C_Chtype) return C_Int; + pragma Import (C, Set_Field_Back, "set_field_back"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Back); + Res : constant Eti_Error := + Set_Field_Back (Fld, AttrChar_To_Chtype (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Background; + -- | + -- | + -- | + procedure Background (Fld : Field; + Back : out Character_Attribute_Set) + is + function Field_Back (Fld : Field) return C_Chtype; + pragma Import (C, Field_Back, "field_back"); + begin + Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; + end Background; + + procedure Background (Fld : Field; + Back : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Field_Back (Fld : Field) return C_Chtype; + pragma Import (C, Field_Back, "field_back"); + begin + Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; + Color := Chtype_To_AttrChar (Field_Back (Fld)).Color; + end Background; + -- | + -- | + -- | + procedure Set_Pad_Character (Fld : Field; + Pad : Character := Space) + is + function Set_Field_Pad (Fld : Field; + Ch : C_Int) return C_Int; + pragma Import (C, Set_Field_Pad, "set_field_pad"); + + Res : constant Eti_Error := Set_Field_Pad (Fld, + C_Int (Character'Pos (Pad))); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Pad_Character; + -- | + -- | + -- | + procedure Pad_Character (Fld : Field; + Pad : out Character) + is + function Field_Pad (Fld : Field) return C_Int; + pragma Import (C, Field_Pad, "field_pad"); + begin + Pad := Character'Val (Field_Pad (Fld)); + end Pad_Character; + -- | + -- |===================================================================== + -- | man page form_field_info.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Info (Fld : Field; + Lines : out Line_Count; + Columns : out Column_Count; + First_Row : out Line_Position; + First_Column : out Column_Position; + Off_Screen : out Natural; + Additional_Buffers : out Buffer_Number) + is + type C_Int_Access is access all C_Int; + function Fld_Info (Fld : Field; + L, C, Fr, Fc, Os, Ab : C_Int_Access) + return C_Int; + pragma Import (C, Fld_Info, "field_info"); + + L, C, Fr, Fc, Os, Ab : aliased C_Int; + Res : constant Eti_Error := Fld_Info (Fld, + L'Access, C'Access, + Fr'Access, Fc'Access, + Os'Access, Ab'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Lines := Line_Count (L); + Columns := Column_Count (C); + First_Row := Line_Position (Fr); + First_Column := Column_Position (Fc); + Off_Screen := Natural (Os); + Additional_Buffers := Buffer_Number (Ab); + end if; + end Info; +-- | +-- | +-- | + procedure Dynamic_Info (Fld : Field; + Lines : out Line_Count; + Columns : out Column_Count; + Max : out Natural) + is + type C_Int_Access is access all C_Int; + function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int; + pragma Import (C, Dyn_Info, "dynamic_field_info"); + + L, C, M : aliased C_Int; + Res : constant Eti_Error := Dyn_Info (Fld, + L'Access, C'Access, + M'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Lines := Line_Count (L); + Columns := Column_Count (C); + Max := Natural (M); + end if; + end Dynamic_Info; + -- | + -- |===================================================================== + -- | man page form_win.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Window (Frm : Form; + Win : Window) + is + function Set_Form_Win (Frm : Form; + Win : Window) return C_Int; + pragma Import (C, Set_Form_Win, "set_form_win"); + + Res : constant Eti_Error := Set_Form_Win (Frm, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Window; + -- | + -- | + -- | + function Get_Window (Frm : Form) return Window + is + function Form_Win (Frm : Form) return Window; + pragma Import (C, Form_Win, "form_win"); + + W : constant Window := Form_Win (Frm); + begin + return W; + end Get_Window; + -- | + -- | + -- | + procedure Set_Sub_Window (Frm : Form; + Win : Window) + is + function Set_Form_Sub (Frm : Form; + Win : Window) return C_Int; + pragma Import (C, Set_Form_Sub, "set_form_sub"); + + Res : constant Eti_Error := Set_Form_Sub (Frm, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Sub_Window; + -- | + -- | + -- | + function Get_Sub_Window (Frm : Form) return Window + is + function Form_Sub (Frm : Form) return Window; + pragma Import (C, Form_Sub, "form_sub"); + + W : constant Window := Form_Sub (Frm); + begin + return W; + end Get_Sub_Window; + -- | + -- | + -- | + procedure Scale (Frm : Form; + Lines : out Line_Count; + Columns : out Column_Count) + is + type C_Int_Access is access all C_Int; + function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int; + pragma Import (C, M_Scale, "scale_form"); + + X, Y : aliased C_Int; + Res : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Lines := Line_Count (Y); + Columns := Column_Count (X); + end Scale; + -- | + -- |===================================================================== + -- | man page menu_hook.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Field_Init_Hook (Frm : Form; + Proc : Form_Hook_Function) + is + function Set_Field_Init (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Field_Init, "set_field_init"); + + Res : constant Eti_Error := Set_Field_Init (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Field_Init_Hook; + -- | + -- | + -- | + procedure Set_Field_Term_Hook (Frm : Form; + Proc : Form_Hook_Function) + is + function Set_Field_Term (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Field_Term, "set_field_term"); + + Res : constant Eti_Error := Set_Field_Term (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Field_Term_Hook; + -- | + -- | + -- | + procedure Set_Form_Init_Hook (Frm : Form; + Proc : Form_Hook_Function) + is + function Set_Form_Init (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Form_Init, "set_form_init"); + + Res : constant Eti_Error := Set_Form_Init (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Form_Init_Hook; + -- | + -- | + -- | + procedure Set_Form_Term_Hook (Frm : Form; + Proc : Form_Hook_Function) + is + function Set_Form_Term (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Form_Term, "set_form_term"); + + Res : constant Eti_Error := Set_Form_Term (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Form_Term_Hook; + -- | + -- |===================================================================== + -- | man page form_fields.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Redefine (Frm : Form; + Flds : Field_Array_Access) + is + function Set_Frm_Fields (Frm : Form; + Items : System.Address) return C_Int; + pragma Import (C, Set_Frm_Fields, "set_form_fields"); + + Res : Eti_Error; + begin + pragma Assert (Flds (Flds'Last) = Null_Field); + if Flds (Flds'Last) /= Null_Field then + raise Form_Exception; + else + Res := Set_Frm_Fields (Frm, Flds (Flds'First)'Address); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + end Redefine; + -- | + -- | + -- | + function Fields (Frm : Form; + Index : Positive) return Field + is + use F_Array; + + function C_Fields (Frm : Form) return Pointer; + pragma Import (C, C_Fields, "form_fields"); + + P : Pointer := C_Fields (Frm); + begin + if P = null or else Index > Field_Count (Frm) then + raise Form_Exception; + else + P := P + ptrdiff_t (C_Int (Index) - 1); + return P.all; + end if; + end Fields; + -- | + -- | + -- | + function Field_Count (Frm : Form) return Natural + is + function Count (Frm : Form) return C_Int; + pragma Import (C, Count, "field_count"); + begin + return Natural (Count (Frm)); + end Field_Count; + -- | + -- | + -- | + procedure Move (Fld : Field; + Line : Line_Position; + Column : Column_Position) + is + function Move (Fld : Field; L, C : C_Int) return C_Int; + pragma Import (C, Move, "move_field"); + + Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Move; + -- | + -- |===================================================================== + -- | man page form_new.3x + -- |===================================================================== + -- | + -- | + -- | + function Create (Fields : Field_Array_Access) return Form + is + function NewForm (Fields : System.Address) return Form; + pragma Import (C, NewForm, "new_form"); + + M : Form; + begin + pragma Assert (Fields (Fields'Last) = Null_Field); + if Fields (Fields'Last) /= Null_Field then + raise Form_Exception; + else + M := NewForm (Fields (Fields'First)'Address); + if M = Null_Form then + raise Form_Exception; + end if; + return M; + end if; + end Create; + -- | + -- | + -- | + procedure Delete (Frm : in out Form) + is + function Free (Frm : Form) return C_Int; + pragma Import (C, Free, "free_form"); + + Res : constant Eti_Error := Free (Frm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Frm := Null_Form; + end Delete; + -- | + -- |===================================================================== + -- | man page form_opts.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Options (Frm : Form; + Options : Form_Option_Set) + is + function Set_Form_Opts (Frm : Form; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Form_Opts, "set_form_opts"); + + Opt : constant C_Int := FrmOS_2_CInt (Options); + Res : Eti_Error; + begin + Res := Set_Form_Opts (Frm, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + -- | + -- | + -- | + procedure Switch_Options (Frm : Form; + Options : Form_Option_Set; + On : Boolean := True) + is + function Form_Opts_On (Frm : Form; + Opt : C_Int) return C_Int; + pragma Import (C, Form_Opts_On, "form_opts_on"); + function Form_Opts_Off (Frm : Form; + Opt : C_Int) return C_Int; + pragma Import (C, Form_Opts_Off, "form_opts_off"); + + Err : Eti_Error; + Opt : constant C_Int := FrmOS_2_CInt (Options); + begin + if On then + Err := Form_Opts_On (Frm, Opt); + else + Err := Form_Opts_Off (Frm, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + -- | + -- | + -- | + procedure Get_Options (Frm : Form; + Options : out Form_Option_Set) + is + function Form_Opts (Frm : Form) return C_Int; + pragma Import (C, Form_Opts, "form_opts"); + + Res : constant C_Int := Form_Opts (Frm); + begin + Options := CInt_2_FrmOS (Res); + end Get_Options; + -- | + -- | + -- | + function Get_Options (Frm : Form := Null_Form) return Form_Option_Set + is + Fos : Form_Option_Set; + begin + Get_Options (Frm, Fos); + return Fos; + end Get_Options; + -- | + -- |===================================================================== + -- | man page form_post.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Post (Frm : Form; + Post : Boolean := True) + is + function M_Post (Frm : Form) return C_Int; + pragma Import (C, M_Post, "post_form"); + function M_Unpost (Frm : Form) return C_Int; + pragma Import (C, M_Unpost, "unpost_form"); + + Res : Eti_Error; + begin + if Post then + Res := M_Post (Frm); + else + Res := M_Unpost (Frm); + end if; + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Post; + -- | + -- |===================================================================== + -- | man page form_cursor.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Position_Cursor (Frm : Form) + is + function Pos_Form_Cursor (Frm : Form) return C_Int; + pragma Import (C, Pos_Form_Cursor, "pos_form_cursor"); + + Res : constant Eti_Error := Pos_Form_Cursor (Frm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Position_Cursor; + -- | + -- |===================================================================== + -- | man page form_data.3x + -- |===================================================================== + -- | + -- | + -- | + function Data_Ahead (Frm : Form) return Boolean + is + function Ahead (Frm : Form) return C_Int; + pragma Import (C, Ahead, "data_ahead"); + + Res : constant C_Int := Ahead (Frm); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Data_Ahead; + -- | + -- | + -- | + function Data_Behind (Frm : Form) return Boolean + is + function Behind (Frm : Form) return C_Int; + pragma Import (C, Behind, "data_behind"); + + Res : constant C_Int := Behind (Frm); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Data_Behind; + -- | + -- |===================================================================== + -- | man page form_driver.3x + -- |===================================================================== + -- | + -- | + -- | + function Driver (Frm : Form; + Key : Key_Code) return Driver_Result + is + function Frm_Driver (Frm : Form; Key : C_Int) return C_Int; + pragma Import (C, Frm_Driver, "form_driver"); + + R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key)); + begin + if R /= E_Ok then + if R = E_Unknown_Command then + return Unknown_Request; + elsif R = E_Invalid_Field then + return Invalid_Field; + elsif R = E_Request_Denied then + return Request_Denied; + else + Eti_Exception (R); + return Form_Ok; + end if; + else + return Form_Ok; + end if; + end Driver; + -- | + -- |===================================================================== + -- | man page form_page.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Current (Frm : Form; + Fld : Field) + is + function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int; + pragma Import (C, Set_Current_Fld, "set_current_field"); + + Res : constant Eti_Error := Set_Current_Fld (Frm, Fld); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Current; + -- | + -- | + -- | + function Current (Frm : Form) return Field + is + function Current_Fld (Frm : Form) return Field; + pragma Import (C, Current_Fld, "current_field"); + + Fld : constant Field := Current_Fld (Frm); + begin + if Fld = Null_Field then + raise Form_Exception; + end if; + return Fld; + end Current; + -- | + -- | + -- | + procedure Set_Page (Frm : Form; + Page : Page_Number := Page_Number'First) + is + function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int; + pragma Import (C, Set_Frm_Page, "set_form_page"); + + Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Page; + -- | + -- | + -- | + function Page (Frm : Form) return Page_Number + is + function Get_Page (Frm : Form) return C_Int; + pragma Import (C, Get_Page, "form_page"); + + P : constant C_Int := Get_Page (Frm); + begin + if P < 0 then + raise Form_Exception; + else + return Page_Number (P); + end if; + end Page; + + function Get_Index (Fld : Field) return Positive + is + function Get_Fieldindex (Fld : Field) return C_Int; + pragma Import (C, Get_Fieldindex, "field_index"); + + Res : constant C_Int := Get_Fieldindex (Fld); + begin + if Res = Curses_Err then + raise Form_Exception; + end if; + return Positive (Natural (Res) + Positive'First); + end Get_Index; + + -- | + -- |===================================================================== + -- | man page form_new_page.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_New_Page (Fld : Field; + New_Page : Boolean := True) + is + function Set_Page (Fld : Field; Flg : C_Int) return C_Int; + pragma Import (C, Set_Page, "set_new_page"); + + Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_New_Page; + -- | + -- | + -- | + function Is_New_Page (Fld : Field) return Boolean + is + function Is_New (Fld : Field) return C_Int; + pragma Import (C, Is_New, "new_page"); + + Res : constant C_Int := Is_New (Fld); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Is_New_Page; + + procedure Free (FA : in out Field_Array_Access; + Free_Fields : Boolean := False) + is + procedure Release is new Ada.Unchecked_Deallocation + (Field_Array, Field_Array_Access); + begin + if FA /= null and then Free_Fields then + for I in FA'First .. (FA'Last - 1) loop + if FA (I) /= Null_Field then + Delete (FA (I)); + end if; + end loop; + end if; + Release (FA); + end Free; + + -- |===================================================================== + + function Default_Field_Options return Field_Option_Set + is + begin + return Get_Options (Null_Field); + end Default_Field_Options; + + function Default_Form_Options return Form_Option_Set + is + begin + return Get_Options (Null_Form); + end Default_Form_Options; + +end Terminal_Interface.Curses.Forms; diff --git a/Ada95/src/terminal_interface-curses-menus-item_user_data.adb b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb new file mode 100644 index 00000000000..eb06d096dfb --- /dev/null +++ b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb @@ -0,0 +1,77 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Item_User_Data -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Menus.Item_User_Data is + + use type Interfaces.C.int; + + procedure Set_User_Data (Itm : Item; + Data : User_Access) + is + function Set_Item_Userptr (Itm : Item; + Addr : User_Access) return C_Int; + pragma Import (C, Set_Item_Userptr, "set_item_userptr"); + + Res : constant Eti_Error := Set_Item_Userptr (Itm, Data); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_User_Data; + + function Get_User_Data (Itm : Item) return User_Access + is + function Item_Userptr (Itm : Item) return User_Access; + pragma Import (C, Item_Userptr, "item_userptr"); + begin + return Item_Userptr (Itm); + end Get_User_Data; + + procedure Get_User_Data (Itm : Item; + Data : out User_Access) + is + begin + Data := Get_User_Data (Itm); + end Get_User_Data; + +end Terminal_Interface.Curses.Menus.Item_User_Data; diff --git a/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb new file mode 100644 index 00000000000..7d66a8c052e --- /dev/null +++ b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Menu_User_Data -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.13 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Menus.Menu_User_Data is + + use type Interfaces.C.int; + + procedure Set_User_Data (Men : Menu; + Data : User_Access) + is + function Set_Menu_Userptr (Men : Menu; + Data : User_Access) return C_Int; + pragma Import (C, Set_Menu_Userptr, "set_menu_userptr"); + + Res : constant Eti_Error := Set_Menu_Userptr (Men, Data); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_User_Data; + + function Get_User_Data (Men : Menu) return User_Access + is + function Menu_Userptr (Men : Menu) return User_Access; + pragma Import (C, Menu_Userptr, "menu_userptr"); + begin + return Menu_Userptr (Men); + end Get_User_Data; + + procedure Get_User_Data (Men : Menu; + Data : out User_Access) + is + begin + Data := Get_User_Data (Men); + end Get_User_Data; + +end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/Ada95/src/terminal_interface-curses-menus.adb b/Ada95/src/terminal_interface-curses-menus.adb new file mode 100644 index 00000000000..9fce6de6d9f --- /dev/null +++ b/Ada95/src/terminal_interface-curses-menus.adb @@ -0,0 +1,1022 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.27 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Unchecked_Deallocation; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Interfaces.C.Pointers; + +with Ada.Unchecked_Conversion; + +package body Terminal_Interface.Curses.Menus is + + type C_Item_Array is array (Natural range <>) of aliased Item; + package I_Array is new + Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); + + use type System.Bit_Order; + subtype chars_ptr is Interfaces.C.Strings.chars_ptr; + + function MOS_2_CInt is new + Ada.Unchecked_Conversion (Menu_Option_Set, + C_Int); + + function CInt_2_MOS is new + Ada.Unchecked_Conversion (C_Int, + Menu_Option_Set); + + function IOS_2_CInt is new + Ada.Unchecked_Conversion (Item_Option_Set, + C_Int); + + function CInt_2_IOS is new + Ada.Unchecked_Conversion (C_Int, + Item_Option_Set); + +------------------------------------------------------------------------------ + procedure Request_Name (Key : Menu_Request_Code; + Name : out String) + is + function Request_Name (Key : C_Int) return chars_ptr; + pragma Import (C, Request_Name, "menu_request_name"); + begin + Fill_String (Request_Name (C_Int (Key)), Name); + end Request_Name; + + function Request_Name (Key : Menu_Request_Code) return String + is + function Request_Name (Key : C_Int) return chars_ptr; + pragma Import (C, Request_Name, "menu_request_name"); + begin + return Fill_String (Request_Name (C_Int (Key))); + end Request_Name; + + function Create (Name : String; + Description : String := "") return Item + is + type Char_Ptr is access all Interfaces.C.char; + function Newitem (Name, Desc : Char_Ptr) return Item; + pragma Import (C, Newitem, "new_item"); + + type Name_String is new char_array (0 .. Name'Length); + type Name_String_Ptr is access Name_String; + pragma Controlled (Name_String_Ptr); + + type Desc_String is new char_array (0 .. Description'Length); + type Desc_String_Ptr is access Desc_String; + pragma Controlled (Desc_String_Ptr); + + Name_Str : constant Name_String_Ptr := new Name_String; + Desc_Str : constant Desc_String_Ptr := new Desc_String; + Name_Len, Desc_Len : size_t; + Result : Item; + begin + To_C (Name, Name_Str.all, Name_Len); + To_C (Description, Desc_Str.all, Desc_Len); + Result := Newitem (Name_Str.all (Name_Str.all'First)'Access, + Desc_Str.all (Desc_Str.all'First)'Access); + if Result = Null_Item then + raise Eti_System_Error; + end if; + return Result; + end Create; + + procedure Delete (Itm : in out Item) + is + function Descname (Itm : Item) return chars_ptr; + pragma Import (C, Descname, "item_description"); + function Itemname (Itm : Item) return chars_ptr; + pragma Import (C, Itemname, "item_name"); + + function Freeitem (Itm : Item) return C_Int; + pragma Import (C, Freeitem, "free_item"); + + Res : Eti_Error; + Ptr : chars_ptr; + begin + Ptr := Descname (Itm); + if Ptr /= Null_Ptr then + Interfaces.C.Strings.Free (Ptr); + end if; + Ptr := Itemname (Itm); + if Ptr /= Null_Ptr then + Interfaces.C.Strings.Free (Ptr); + end if; + Res := Freeitem (Itm); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Itm := Null_Item; + end Delete; +------------------------------------------------------------------------------- + procedure Set_Value (Itm : Item; + Value : Boolean := True) + is + function Set_Item_Val (Itm : Item; + Val : C_Int) return C_Int; + pragma Import (C, Set_Item_Val, "set_item_value"); + + Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Value; + + function Value (Itm : Item) return Boolean + is + function Item_Val (Itm : Item) return C_Int; + pragma Import (C, Item_Val, "item_value"); + begin + if Item_Val (Itm) = Curses_False then + return False; + else + return True; + end if; + end Value; + +------------------------------------------------------------------------------- + function Visible (Itm : Item) return Boolean + is + function Item_Vis (Itm : Item) return C_Int; + pragma Import (C, Item_Vis, "item_visible"); + begin + if Item_Vis (Itm) = Curses_False then + return False; + else + return True; + end if; + end Visible; +------------------------------------------------------------------------------- + procedure Set_Options (Itm : Item; + Options : Item_Option_Set) + is + function Set_Item_Opts (Itm : Item; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Item_Opts, "set_item_opts"); + + Opt : constant C_Int := IOS_2_CInt (Options); + Res : Eti_Error; + begin + Res := Set_Item_Opts (Itm, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + + procedure Switch_Options (Itm : Item; + Options : Item_Option_Set; + On : Boolean := True) + is + function Item_Opts_On (Itm : Item; + Opt : C_Int) return C_Int; + pragma Import (C, Item_Opts_On, "item_opts_on"); + function Item_Opts_Off (Itm : Item; + Opt : C_Int) return C_Int; + pragma Import (C, Item_Opts_Off, "item_opts_off"); + + Opt : constant C_Int := IOS_2_CInt (Options); + Err : Eti_Error; + begin + if On then + Err := Item_Opts_On (Itm, Opt); + else + Err := Item_Opts_Off (Itm, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + + procedure Get_Options (Itm : Item; + Options : out Item_Option_Set) + is + function Item_Opts (Itm : Item) return C_Int; + pragma Import (C, Item_Opts, "item_opts"); + + Res : constant C_Int := Item_Opts (Itm); + begin + Options := CInt_2_IOS (Res); + end Get_Options; + + function Get_Options (Itm : Item := Null_Item) return Item_Option_Set + is + Ios : Item_Option_Set; + begin + Get_Options (Itm, Ios); + return Ios; + end Get_Options; +------------------------------------------------------------------------------- + procedure Name (Itm : Item; + Name : out String) + is + function Itemname (Itm : Item) return chars_ptr; + pragma Import (C, Itemname, "item_name"); + begin + Fill_String (Itemname (Itm), Name); + end Name; + + function Name (Itm : Item) return String + is + function Itemname (Itm : Item) return chars_ptr; + pragma Import (C, Itemname, "item_name"); + begin + return Fill_String (Itemname (Itm)); + end Name; + + procedure Description (Itm : Item; + Description : out String) + is + function Descname (Itm : Item) return chars_ptr; + pragma Import (C, Descname, "item_description"); + begin + Fill_String (Descname (Itm), Description); + end Description; + + function Description (Itm : Item) return String + is + function Descname (Itm : Item) return chars_ptr; + pragma Import (C, Descname, "item_description"); + begin + return Fill_String (Descname (Itm)); + end Description; +------------------------------------------------------------------------------- + procedure Set_Current (Men : Menu; + Itm : Item) + is + function Set_Curr_Item (Men : Menu; + Itm : Item) return C_Int; + pragma Import (C, Set_Curr_Item, "set_current_item"); + + Res : constant Eti_Error := Set_Curr_Item (Men, Itm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Current; + + function Current (Men : Menu) return Item + is + function Curr_Item (Men : Menu) return Item; + pragma Import (C, Curr_Item, "current_item"); + + Res : constant Item := Curr_Item (Men); + begin + if Res = Null_Item then + raise Menu_Exception; + end if; + return Res; + end Current; + + procedure Set_Top_Row (Men : Menu; + Line : Line_Position) + is + function Set_Toprow (Men : Menu; + Line : C_Int) return C_Int; + pragma Import (C, Set_Toprow, "set_top_row"); + + Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Top_Row; + + function Top_Row (Men : Menu) return Line_Position + is + function Toprow (Men : Menu) return C_Int; + pragma Import (C, Toprow, "top_row"); + + Res : constant C_Int := Toprow (Men); + begin + if Res = Curses_Err then + raise Menu_Exception; + end if; + return Line_Position (Res); + end Top_Row; + + function Get_Index (Itm : Item) return Positive + is + function Get_Itemindex (Itm : Item) return C_Int; + pragma Import (C, Get_Itemindex, "item_index"); + + Res : constant C_Int := Get_Itemindex (Itm); + begin + if Res = Curses_Err then + raise Menu_Exception; + end if; + return Positive (Natural (Res) + Positive'First); + end Get_Index; +------------------------------------------------------------------------------- + procedure Post (Men : Menu; + Post : Boolean := True) + is + function M_Post (Men : Menu) return C_Int; + pragma Import (C, M_Post, "post_menu"); + function M_Unpost (Men : Menu) return C_Int; + pragma Import (C, M_Unpost, "unpost_menu"); + + Res : Eti_Error; + begin + if Post then + Res := M_Post (Men); + else + Res := M_Unpost (Men); + end if; + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Post; +------------------------------------------------------------------------------- + procedure Set_Options (Men : Menu; + Options : Menu_Option_Set) + is + function Set_Menu_Opts (Men : Menu; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Menu_Opts, "set_menu_opts"); + + Opt : constant C_Int := MOS_2_CInt (Options); + Res : Eti_Error; + begin + Res := Set_Menu_Opts (Men, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + + procedure Switch_Options (Men : Menu; + Options : Menu_Option_Set; + On : Boolean := True) + is + function Menu_Opts_On (Men : Menu; + Opt : C_Int) return C_Int; + pragma Import (C, Menu_Opts_On, "menu_opts_on"); + function Menu_Opts_Off (Men : Menu; + Opt : C_Int) return C_Int; + pragma Import (C, Menu_Opts_Off, "menu_opts_off"); + + Opt : constant C_Int := MOS_2_CInt (Options); + Err : Eti_Error; + begin + if On then + Err := Menu_Opts_On (Men, Opt); + else + Err := Menu_Opts_Off (Men, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + + procedure Get_Options (Men : Menu; + Options : out Menu_Option_Set) + is + function Menu_Opts (Men : Menu) return C_Int; + pragma Import (C, Menu_Opts, "menu_opts"); + + Res : constant C_Int := Menu_Opts (Men); + begin + Options := CInt_2_MOS (Res); + end Get_Options; + + function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set + is + Mos : Menu_Option_Set; + begin + Get_Options (Men, Mos); + return Mos; + end Get_Options; +------------------------------------------------------------------------------- + procedure Set_Window (Men : Menu; + Win : Window) + is + function Set_Menu_Win (Men : Menu; + Win : Window) return C_Int; + pragma Import (C, Set_Menu_Win, "set_menu_win"); + + Res : constant Eti_Error := Set_Menu_Win (Men, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Window; + + function Get_Window (Men : Menu) return Window + is + function Menu_Win (Men : Menu) return Window; + pragma Import (C, Menu_Win, "menu_win"); + + W : constant Window := Menu_Win (Men); + begin + return W; + end Get_Window; + + procedure Set_Sub_Window (Men : Menu; + Win : Window) + is + function Set_Menu_Sub (Men : Menu; + Win : Window) return C_Int; + pragma Import (C, Set_Menu_Sub, "set_menu_sub"); + + Res : constant Eti_Error := Set_Menu_Sub (Men, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Sub_Window; + + function Get_Sub_Window (Men : Menu) return Window + is + function Menu_Sub (Men : Menu) return Window; + pragma Import (C, Menu_Sub, "menu_sub"); + + W : constant Window := Menu_Sub (Men); + begin + return W; + end Get_Sub_Window; + + procedure Scale (Men : Menu; + Lines : out Line_Count; + Columns : out Column_Count) + is + type C_Int_Access is access all C_Int; + function M_Scale (Men : Menu; + Yp, Xp : C_Int_Access) return C_Int; + pragma Import (C, M_Scale, "scale_menu"); + + X, Y : aliased C_Int; + Res : constant Eti_Error := M_Scale (Men, Y'Access, X'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Lines := Line_Count (Y); + Columns := Column_Count (X); + end Scale; +------------------------------------------------------------------------------- + procedure Position_Cursor (Men : Menu) + is + function Pos_Menu_Cursor (Men : Menu) return C_Int; + pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor"); + + Res : constant Eti_Error := Pos_Menu_Cursor (Men); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Position_Cursor; + +------------------------------------------------------------------------------- + procedure Set_Mark (Men : Menu; + Mark : String) + is + type Char_Ptr is access all Interfaces.C.char; + function Set_Mark (Men : Menu; + Mark : Char_Ptr) return C_Int; + pragma Import (C, Set_Mark, "set_menu_mark"); + + Txt : char_array (0 .. Mark'Length); + Len : size_t; + Res : Eti_Error; + begin + To_C (Mark, Txt, Len); + Res := Set_Mark (Men, Txt (Txt'First)'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Mark; + + procedure Mark (Men : Menu; + Mark : out String) + is + function Get_Menu_Mark (Men : Menu) return chars_ptr; + pragma Import (C, Get_Menu_Mark, "menu_mark"); + begin + Fill_String (Get_Menu_Mark (Men), Mark); + end Mark; + + function Mark (Men : Menu) return String + is + function Get_Menu_Mark (Men : Menu) return chars_ptr; + pragma Import (C, Get_Menu_Mark, "menu_mark"); + begin + return Fill_String (Get_Menu_Mark (Men)); + end Mark; + +------------------------------------------------------------------------------- + procedure Set_Foreground + (Men : Menu; + Fore : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Set_Menu_Fore (Men : Menu; + Attr : C_Chtype) return C_Int; + pragma Import (C, Set_Menu_Fore, "set_menu_fore"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Fore); + Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Foreground; + + procedure Foreground (Men : Menu; + Fore : out Character_Attribute_Set) + is + function Menu_Fore (Men : Menu) return C_Chtype; + pragma Import (C, Menu_Fore, "menu_fore"); + begin + Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; + end Foreground; + + procedure Foreground (Men : Menu; + Fore : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Menu_Fore (Men : Menu) return C_Chtype; + pragma Import (C, Menu_Fore, "menu_fore"); + begin + Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color; + end Foreground; + + procedure Set_Background + (Men : Menu; + Back : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Set_Menu_Back (Men : Menu; + Attr : C_Chtype) return C_Int; + pragma Import (C, Set_Menu_Back, "set_menu_back"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Back); + Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Background; + + procedure Background (Men : Menu; + Back : out Character_Attribute_Set) + is + function Menu_Back (Men : Menu) return C_Chtype; + pragma Import (C, Menu_Back, "menu_back"); + begin + Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; + end Background; + + procedure Background (Men : Menu; + Back : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Menu_Back (Men : Menu) return C_Chtype; + pragma Import (C, Menu_Back, "menu_back"); + begin + Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Back (Men)).Color; + end Background; + + procedure Set_Grey (Men : Menu; + Grey : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) + is + function Set_Menu_Grey (Men : Menu; + Attr : C_Chtype) return C_Int; + pragma Import (C, Set_Menu_Grey, "set_menu_grey"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Grey); + + Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Grey; + + procedure Grey (Men : Menu; + Grey : out Character_Attribute_Set) + is + function Menu_Grey (Men : Menu) return C_Chtype; + pragma Import (C, Menu_Grey, "menu_grey"); + begin + Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; + end Grey; + + procedure Grey (Men : Menu; + Grey : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Menu_Grey (Men : Menu) return C_Chtype; + pragma Import (C, Menu_Grey, "menu_grey"); + begin + Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; + Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color; + end Grey; + + procedure Set_Pad_Character (Men : Menu; + Pad : Character := Space) + is + function Set_Menu_Pad (Men : Menu; + Ch : C_Int) return C_Int; + pragma Import (C, Set_Menu_Pad, "set_menu_pad"); + + Res : constant Eti_Error := Set_Menu_Pad (Men, + C_Int (Character'Pos (Pad))); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Pad_Character; + + procedure Pad_Character (Men : Menu; + Pad : out Character) + is + function Menu_Pad (Men : Menu) return C_Int; + pragma Import (C, Menu_Pad, "menu_pad"); + begin + Pad := Character'Val (Menu_Pad (Men)); + end Pad_Character; +------------------------------------------------------------------------------- + procedure Set_Spacing (Men : Menu; + Descr : Column_Position := 0; + Row : Line_Position := 0; + Col : Column_Position := 0) + is + function Set_Spacing (Men : Menu; + D, R, C : C_Int) return C_Int; + pragma Import (C, Set_Spacing, "set_menu_spacing"); + + Res : constant Eti_Error := Set_Spacing (Men, + C_Int (Descr), + C_Int (Row), + C_Int (Col)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Spacing; + + procedure Spacing (Men : Menu; + Descr : out Column_Position; + Row : out Line_Position; + Col : out Column_Position) + is + type C_Int_Access is access all C_Int; + function Get_Spacing (Men : Menu; + D, R, C : C_Int_Access) return C_Int; + pragma Import (C, Get_Spacing, "menu_spacing"); + + D, R, C : aliased C_Int; + Res : constant Eti_Error := Get_Spacing (Men, + D'Access, + R'Access, + C'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Descr := Column_Position (D); + Row := Line_Position (R); + Col := Column_Position (C); + end if; + end Spacing; +------------------------------------------------------------------------------- + function Set_Pattern (Men : Menu; + Text : String) return Boolean + is + type Char_Ptr is access all Interfaces.C.char; + function Set_Pattern (Men : Menu; + Pattern : Char_Ptr) return C_Int; + pragma Import (C, Set_Pattern, "set_menu_pattern"); + + S : char_array (0 .. Text'Length); + L : size_t; + Res : Eti_Error; + begin + To_C (Text, S, L); + Res := Set_Pattern (Men, S (S'First)'Access); + case Res is + when E_No_Match => return False; + when E_Ok => return True; + when others => + Eti_Exception (Res); + return False; + end case; + end Set_Pattern; + + procedure Pattern (Men : Menu; + Text : out String) + is + function Get_Pattern (Men : Menu) return chars_ptr; + pragma Import (C, Get_Pattern, "menu_pattern"); + begin + Fill_String (Get_Pattern (Men), Text); + end Pattern; +------------------------------------------------------------------------------- + procedure Set_Format (Men : Menu; + Lines : Line_Count; + Columns : Column_Count) + is + function Set_Menu_Fmt (Men : Menu; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Set_Menu_Fmt, "set_menu_format"); + + Res : constant Eti_Error := Set_Menu_Fmt (Men, + C_Int (Lines), + C_Int (Columns)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Format; + + procedure Format (Men : Menu; + Lines : out Line_Count; + Columns : out Column_Count) + is + type C_Int_Access is access all C_Int; + function Menu_Fmt (Men : Menu; + Y, X : C_Int_Access) return C_Int; + pragma Import (C, Menu_Fmt, "menu_format"); + + L, C : aliased C_Int; + Res : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Lines := Line_Count (L); + Columns := Column_Count (C); + end if; + end Format; +------------------------------------------------------------------------------- + procedure Set_Item_Init_Hook (Men : Menu; + Proc : Menu_Hook_Function) + is + function Set_Item_Init (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Item_Init, "set_item_init"); + + Res : constant Eti_Error := Set_Item_Init (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Item_Init_Hook; + + procedure Set_Item_Term_Hook (Men : Menu; + Proc : Menu_Hook_Function) + is + function Set_Item_Term (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Item_Term, "set_item_term"); + + Res : constant Eti_Error := Set_Item_Term (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Item_Term_Hook; + + procedure Set_Menu_Init_Hook (Men : Menu; + Proc : Menu_Hook_Function) + is + function Set_Menu_Init (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Menu_Init, "set_menu_init"); + + Res : constant Eti_Error := Set_Menu_Init (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Menu_Init_Hook; + + procedure Set_Menu_Term_Hook (Men : Menu; + Proc : Menu_Hook_Function) + is + function Set_Menu_Term (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Menu_Term, "set_menu_term"); + + Res : constant Eti_Error := Set_Menu_Term (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Menu_Term_Hook; + + function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function + is + function Item_Init (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Item_Init, "item_init"); + begin + return Item_Init (Men); + end Get_Item_Init_Hook; + + function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function + is + function Item_Term (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Item_Term, "item_term"); + begin + return Item_Term (Men); + end Get_Item_Term_Hook; + + function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function + is + function Menu_Init (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Menu_Init, "menu_init"); + begin + return Menu_Init (Men); + end Get_Menu_Init_Hook; + + function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function + is + function Menu_Term (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Menu_Term, "menu_term"); + begin + return Menu_Term (Men); + end Get_Menu_Term_Hook; +------------------------------------------------------------------------------- + procedure Redefine (Men : Menu; + Items : Item_Array_Access) + is + function Set_Items (Men : Menu; + Items : System.Address) return C_Int; + pragma Import (C, Set_Items, "set_menu_items"); + + Res : Eti_Error; + begin + pragma Assert (Items (Items'Last) = Null_Item); + if Items (Items'Last) /= Null_Item then + raise Menu_Exception; + else + Res := Set_Items (Men, Items.all'Address); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + end Redefine; + + function Item_Count (Men : Menu) return Natural + is + function Count (Men : Menu) return C_Int; + pragma Import (C, Count, "item_count"); + begin + return Natural (Count (Men)); + end Item_Count; + + function Items (Men : Menu; + Index : Positive) return Item + is + use I_Array; + + function C_Mitems (Men : Menu) return Pointer; + pragma Import (C, C_Mitems, "menu_items"); + + P : Pointer := C_Mitems (Men); + begin + if P = null or else Index > Item_Count (Men) then + raise Menu_Exception; + else + P := P + ptrdiff_t (C_Int (Index) - 1); + return P.all; + end if; + end Items; + +------------------------------------------------------------------------------- + function Create (Items : Item_Array_Access) return Menu + is + function Newmenu (Items : System.Address) return Menu; + pragma Import (C, Newmenu, "new_menu"); + + M : Menu; + begin + pragma Assert (Items (Items'Last) = Null_Item); + if Items (Items'Last) /= Null_Item then + raise Menu_Exception; + else + M := Newmenu (Items.all'Address); + if M = Null_Menu then + raise Menu_Exception; + end if; + return M; + end if; + end Create; + + procedure Delete (Men : in out Menu) + is + function Free (Men : Menu) return C_Int; + pragma Import (C, Free, "free_menu"); + + Res : constant Eti_Error := Free (Men); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Men := Null_Menu; + end Delete; + +------------------------------------------------------------------------------ + function Driver (Men : Menu; + Key : Key_Code) return Driver_Result + is + function Driver (Men : Menu; + Key : C_Int) return C_Int; + pragma Import (C, Driver, "menu_driver"); + + R : constant Eti_Error := Driver (Men, C_Int (Key)); + begin + if R /= E_Ok then + case R is + when E_Unknown_Command => return Unknown_Request; + when E_No_Match => return No_Match; + when E_Request_Denied | + E_Not_Selectable => return Request_Denied; + when others => + Eti_Exception (R); + end case; + end if; + return Menu_Ok; + end Driver; + + procedure Free (IA : in out Item_Array_Access; + Free_Items : Boolean := False) + is + procedure Release is new Ada.Unchecked_Deallocation + (Item_Array, Item_Array_Access); + begin + if IA /= null and then Free_Items then + for I in IA'First .. (IA'Last - 1) loop + if IA (I) /= Null_Item then + Delete (IA (I)); + end if; + end loop; + end if; + Release (IA); + end Free; + +------------------------------------------------------------------------------- + function Default_Menu_Options return Menu_Option_Set + is + begin + return Get_Options (Null_Menu); + end Default_Menu_Options; + + function Default_Item_Options return Item_Option_Set + is + begin + return Get_Options (Null_Item); + end Default_Item_Options; +------------------------------------------------------------------------------- + +end Terminal_Interface.Curses.Menus; diff --git a/Ada95/src/terminal_interface-curses-mouse.adb b/Ada95/src/terminal_interface-curses-mouse.adb new file mode 100644 index 00000000000..9b403263930 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-mouse.adb @@ -0,0 +1,217 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Mouse -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.24 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +use Interfaces; + +package body Terminal_Interface.Curses.Mouse is + + use type System.Bit_Order; + + function Has_Mouse return Boolean + is + function Mouse_Avail return C_Int; + pragma Import (C, Mouse_Avail, "has_mouse"); + begin + if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then + return True; + else + return False; + end if; + end Has_Mouse; + + function Get_Mouse return Mouse_Event + is + type Event_Access is access all Mouse_Event; + + function Getmouse (Ev : Event_Access) return C_Int; + pragma Import (C, Getmouse, "getmouse"); + + Event : aliased Mouse_Event; + begin + if Getmouse (Event'Access) = Curses_Err then + raise Curses_Exception; + end if; + return Event; + end Get_Mouse; + + procedure Register_Reportable_Event (Button : Mouse_Button; + State : Button_State; + Mask : in out Event_Mask) + is + Button_Nr : constant Natural := Mouse_Button'Pos (Button); + State_Nr : constant Natural := Button_State'Pos (State); + begin + if Button in Modifier_Keys and then State /= Pressed then + raise Curses_Exception; + else + if Button in Real_Buttons then + Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr); + else + Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4)); + end if; + end if; + end Register_Reportable_Event; + + procedure Register_Reportable_Events (Button : Mouse_Button; + State : Button_States; + Mask : in out Event_Mask) + is + begin + for S in Button_States'Range loop + if State (S) then + Register_Reportable_Event (Button, S, Mask); + end if; + end loop; + end Register_Reportable_Events; + + function Start_Mouse (Mask : Event_Mask := All_Events) + return Event_Mask + is + function MMask (M : Event_Mask; + O : access Event_Mask) return Event_Mask; + pragma Import (C, MMask, "mousemask"); + R : Event_Mask; + Old : aliased Event_Mask; + begin + R := MMask (Mask, Old'Access); + if R = No_Events then + Beep; + end if; + return Old; + end Start_Mouse; + + procedure End_Mouse (Mask : Event_Mask := No_Events) + is + begin + if Mask /= No_Events then + Beep; + end if; + end End_Mouse; + + procedure Dispatch_Event (Mask : Event_Mask; + Button : out Mouse_Button; + State : out Button_State); + + procedure Dispatch_Event (Mask : Event_Mask; + Button : out Mouse_Button; + State : out Button_State) is + L : Event_Mask; + begin + Button := Alt; -- preset to non real button; + if (Mask and BUTTON1_EVENTS) /= 0 then + Button := Left; + elsif (Mask and BUTTON2_EVENTS) /= 0 then + Button := Middle; + elsif (Mask and BUTTON3_EVENTS) /= 0 then + Button := Right; + elsif (Mask and BUTTON4_EVENTS) /= 0 then + Button := Button4; + end if; + if Button in Real_Buttons then + L := 2 ** (6 * Mouse_Button'Pos (Button)); + for I in Button_State'Range loop + if (Mask and L) /= 0 then + State := I; + exit; + end if; + L := 2 * L; + end loop; + else + State := Pressed; + if (Mask and BUTTON_CTRL) /= 0 then + Button := Control; + elsif (Mask and BUTTON_SHIFT) /= 0 then + Button := Shift; + elsif (Mask and BUTTON_ALT) /= 0 then + Button := Alt; + end if; + end if; + end Dispatch_Event; + + procedure Get_Event (Event : Mouse_Event; + Y : out Line_Position; + X : out Column_Position; + Button : out Mouse_Button; + State : out Button_State) + is + Mask : constant Event_Mask := Event.Bstate; + begin + X := Column_Position (Event.X); + Y := Line_Position (Event.Y); + Dispatch_Event (Mask, Button, State); + end Get_Event; + + procedure Unget_Mouse (Event : Mouse_Event) + is + function Ungetmouse (Ev : Mouse_Event) return C_Int; + pragma Import (C, Ungetmouse, "ungetmouse"); + begin + if Ungetmouse (Event) = Curses_Err then + raise Curses_Exception; + end if; + end Unget_Mouse; + + function Enclosed_In_Window (Win : Window := Standard_Window; + Event : Mouse_Event) return Boolean + is + function Wenclose (Win : Window; Y : C_Int; X : C_Int) + return Curses_Bool; + pragma Import (C, Wenclose, "wenclose"); + begin + if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X)) + = Curses_Bool_False then + return False; + else + return True; + end if; + end Enclosed_In_Window; + + function Mouse_Interval (Msec : Natural := 200) return Natural + is + function Mouseinterval (Msec : C_Int) return C_Int; + pragma Import (C, Mouseinterval, "mouseinterval"); + begin + return Natural (Mouseinterval (C_Int (Msec))); + end Mouse_Interval; + +end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/src/terminal_interface-curses-panels-user_data.adb b/Ada95/src/terminal_interface-curses-panels-user_data.adb new file mode 100644 index 00000000000..d855f5423c7 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-panels-user_data.adb @@ -0,0 +1,78 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels.User_Data -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; +use Terminal_Interface.Curses.Aux; +with Terminal_Interface.Curses.Panels; +use Terminal_Interface.Curses.Panels; + +package body Terminal_Interface.Curses.Panels.User_Data is + + use type Interfaces.C.int; + + procedure Set_User_Data (Pan : Panel; + Data : User_Access) + is + function Set_Panel_Userptr (Pan : Panel; + Addr : User_Access) return C_Int; + pragma Import (C, Set_Panel_Userptr, "set_panel_userptr"); + begin + if Set_Panel_Userptr (Pan, Data) = Curses_Err then + raise Panel_Exception; + end if; + end Set_User_Data; + + function Get_User_Data (Pan : Panel) return User_Access + is + function Panel_Userptr (Pan : Panel) return User_Access; + pragma Import (C, Panel_Userptr, "panel_userptr"); + begin + return Panel_Userptr (Pan); + end Get_User_Data; + + procedure Get_User_Data (Pan : Panel; + Data : out User_Access) + is + begin + Data := Get_User_Data (Pan); + end Get_User_Data; + +end Terminal_Interface.Curses.Panels.User_Data; diff --git a/Ada95/src/terminal_interface-curses-panels.adb b/Ada95/src/terminal_interface-curses-panels.adb new file mode 100644 index 00000000000..84e29e519c2 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-panels.adb @@ -0,0 +1,165 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.14 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; + +package body Terminal_Interface.Curses.Panels is + + use type Interfaces.C.int; + + function Create (Win : Window) return Panel + is + function Newpanel (Win : Window) return Panel; + pragma Import (C, Newpanel, "new_panel"); + + Pan : Panel; + begin + Pan := Newpanel (Win); + if Pan = Null_Panel then + raise Panel_Exception; + end if; + return Pan; + end Create; + + procedure Bottom (Pan : Panel) + is + function Bottompanel (Pan : Panel) return C_Int; + pragma Import (C, Bottompanel, "bottom_panel"); + begin + if Bottompanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Bottom; + + procedure Top (Pan : Panel) + is + function Toppanel (Pan : Panel) return C_Int; + pragma Import (C, Toppanel, "top_panel"); + begin + if Toppanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Top; + + procedure Show (Pan : Panel) + is + function Showpanel (Pan : Panel) return C_Int; + pragma Import (C, Showpanel, "show_panel"); + begin + if Showpanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Show; + + procedure Hide (Pan : Panel) + is + function Hidepanel (Pan : Panel) return C_Int; + pragma Import (C, Hidepanel, "hide_panel"); + begin + if Hidepanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Hide; + + function Get_Window (Pan : Panel) return Window + is + function Panel_Win (Pan : Panel) return Window; + pragma Import (C, Panel_Win, "panel_window"); + + Win : constant Window := Panel_Win (Pan); + begin + if Win = Null_Window then + raise Panel_Exception; + end if; + return Win; + end Get_Window; + + procedure Replace (Pan : Panel; + Win : Window) + is + function Replace_Pan (Pan : Panel; + Win : Window) return C_Int; + pragma Import (C, Replace_Pan, "replace_panel"); + begin + if Replace_Pan (Pan, Win) = Curses_Err then + raise Panel_Exception; + end if; + end Replace; + + procedure Move (Pan : Panel; + Line : Line_Position; + Column : Column_Position) + is + function Move (Pan : Panel; + Line : C_Int; + Column : C_Int) return C_Int; + pragma Import (C, Move, "move_panel"); + begin + if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Panel_Exception; + end if; + end Move; + + function Is_Hidden (Pan : Panel) return Boolean + is + function Panel_Hidden (Pan : Panel) return C_Int; + pragma Import (C, Panel_Hidden, "panel_hidden"); + begin + if Panel_Hidden (Pan) = Curses_False then + return False; + else + return True; + end if; + end Is_Hidden; + + procedure Delete (Pan : in out Panel) + is + function Del_Panel (Pan : Panel) return C_Int; + pragma Import (C, Del_Panel, "del_panel"); + begin + if Del_Panel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + Pan := Null_Panel; + end Delete; + +end Terminal_Interface.Curses.Panels; diff --git a/Ada95/src/terminal_interface-curses-putwin.adb b/Ada95/src/terminal_interface-curses-putwin.adb new file mode 100644 index 00000000000..986cd6b9bd6 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-putwin.adb @@ -0,0 +1,77 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.PutWin -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.3 $ +-- Binding Version 01.00 + +with Ada.Streams.Stream_IO.C_Streams; +with Interfaces.C_Streams; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.PutWin is + + package ICS renames Interfaces.C_Streams; + package ACS renames Ada.Streams.Stream_IO.C_Streams; + use type C_Int; + + procedure Put_Window (Win : Window; + File : Ada.Streams.Stream_IO.File_Type) is + function putwin (Win : Window; f : ICS.FILEs) return C_Int; + pragma Import (C, putwin, "putwin"); + + R : constant C_Int := putwin (Win, ACS.C_Stream (File)); + begin + if R /= Curses_Ok then + raise Curses_Exception; + end if; + end Put_Window; + + function Get_Window (File : Ada.Streams.Stream_IO.File_Type) + return Window is + function getwin (f : ICS.FILEs) return Window; + pragma Import (C, getwin, "getwin"); + + W : constant Window := getwin (ACS.C_Stream (File)); + begin + if W = Null_Window then + raise Curses_Exception; + else + return W; + end if; + end Get_Window; + +end Terminal_Interface.Curses.PutWin; diff --git a/Ada95/src/terminal_interface-curses-putwin.ads b/Ada95/src/terminal_interface-curses-putwin.ads new file mode 100644 index 00000000000..d302bdcec45 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-putwin.ads @@ -0,0 +1,50 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.PutWin -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.3 $ +-- Binding Version 01.00 + +with Ada.Streams.Stream_IO; + +package Terminal_Interface.Curses.PutWin is + + procedure Put_Window (Win : Window; + File : Ada.Streams.Stream_IO.File_Type); + + function Get_Window (File : Ada.Streams.Stream_IO.File_Type) return Window; + +end Terminal_Interface.Curses.PutWin; diff --git a/Ada95/src/terminal_interface-curses-termcap.adb b/Ada95/src/terminal_interface-curses-termcap.adb new file mode 100644 index 00000000000..643865781fd --- /dev/null +++ b/Ada95/src/terminal_interface-curses-termcap.adb @@ -0,0 +1,163 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Termcap -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; + +package body Terminal_Interface.Curses.Termcap is + + function Get_Entry (Name : String) return Boolean + is + function tgetent (name : char_array; val : char_array) + return C_Int; + pragma Import (C, tgetent, "tgetent"); + NameTxt : char_array (0 .. Name'Length); + Length : size_t; + ignored : constant char_array (0 .. 0) := (0 => nul); + result : C_Int; + begin + To_C (Name, NameTxt, Length); + result := tgetent (char_array (ignored), NameTxt); + if result = -1 then + raise Curses_Exception; + else + return Boolean'Val (result); + end if; + end Get_Entry; + +------------------------------------------------------------------------------ + function Get_Flag (Name : String) return Boolean + is + function tgetflag (id : char_array) return C_Int; + pragma Import (C, tgetflag, "tgetflag"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + if tgetflag (Txt) = 0 then + return False; + else + return True; + end if; + end Get_Flag; + +------------------------------------------------------------------------------ + procedure Get_Number (Name : String; + Value : out Integer; + Result : out Boolean) + is + function tgetnum (id : char_array) return C_Int; + pragma Import (C, tgetnum, "tgetnum"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + Value := Integer (tgetnum (Txt)); + if Value = -1 then + Result := False; + else + Result := True; + end if; + end Get_Number; + +------------------------------------------------------------------------------ + procedure Get_String (Name : String; + Value : out String; + Result : out Boolean) + is + function tgetstr (id : char_array; + buf : char_array) return chars_ptr; + pragma Import (C, tgetstr, "tgetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + type t is new char_array (0 .. 1024); -- does it need to be 1024? + Return_Buffer : constant t := (others => nul); + begin + To_C (Name, Txt, Length); + Txt2 := tgetstr (Txt, char_array (Return_Buffer)); + if Txt2 = Null_Ptr then + Result := False; + else + Value := Fill_String (Txt2); + Result := True; + end if; + end Get_String; + + function Get_String (Name : String) return Boolean + is + function tgetstr (Id : char_array; + buf : char_array) return chars_ptr; + pragma Import (C, tgetstr, "tgetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + type t is new char_array (0 .. 1024); -- does it need to be 1024? + Phony_Txt : constant t := (others => nul); + begin + To_C (Name, Txt, Length); + Txt2 := tgetstr (Txt, char_array (Phony_Txt)); + if Txt2 = Null_Ptr then + return False; + else + return True; + end if; + end Get_String; + +------------------------------------------------------------------------------ + function TGoto (Cap : String; + Col : Column_Position; + Row : Line_Position) return Termcap_String is + function tgoto (cap : char_array; + col : C_Int; + row : C_Int) return chars_ptr; + pragma Import (C, tgoto); + Txt : char_array (0 .. Cap'Length); + Length : size_t; + begin + To_C (Cap, Txt, Length); + return Termcap_String (Fill_String + (tgoto (Txt, C_Int (Col), C_Int (Row)))); + end TGoto; + +end Terminal_Interface.Curses.Termcap; diff --git a/Ada95/src/terminal_interface-curses-termcap.ads b/Ada95/src/terminal_interface-curses-termcap.ads new file mode 100644 index 00000000000..dd01396e8b0 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-termcap.ads @@ -0,0 +1,80 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Termcap -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.3 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +package Terminal_Interface.Curses.Termcap is + pragma Preelaborate (Terminal_Interface.Curses.Termcap); + + -- |===================================================================== + -- | Man page curs_termcap.3x + -- |===================================================================== + -- Not implemented: tputs (see curs_terminfo) + + type Termcap_String is new String; + + -- | + function TGoto (Cap : String; + Col : Column_Position; + Row : Line_Position) return Termcap_String; + -- AKA: tgoto() + + -- | + function Get_Entry (Name : String) return Boolean; + -- AKA: tgetent() + + -- | + function Get_Flag (Name : String) return Boolean; + -- AKA: tgetflag() + + -- | + procedure Get_Number (Name : String; + Value : out Integer; + Result : out Boolean); + -- AKA: tgetnum() + + -- | + procedure Get_String (Name : String; + Value : out String; + Result : out Boolean); + function Get_String (Name : String) return Boolean; + -- Returns True if the string is found. + -- AKA: tgetstr() + +end Terminal_Interface.Curses.Termcap; diff --git a/Ada95/src/terminal_interface-curses-terminfo.adb b/Ada95/src/terminal_interface-curses-terminfo.adb new file mode 100644 index 00000000000..9b3c9d56b33 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-terminfo.adb @@ -0,0 +1,161 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Terminfo -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.6 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Ada.Unchecked_Conversion; + +package body Terminal_Interface.Curses.Terminfo is + + function Is_MinusOne_Pointer (P : chars_ptr) return Boolean; + + function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is + type Weird_Address is new System.Storage_Elements.Integer_Address; + Invalid_Pointer : constant Weird_Address := -1; + function To_Weird is new Ada.Unchecked_Conversion + (Source => chars_ptr, Target => Weird_Address); + begin + if To_Weird (P) = Invalid_Pointer then + return True; + else + return False; + end if; + end Is_MinusOne_Pointer; + pragma Inline (Is_MinusOne_Pointer); + +------------------------------------------------------------------------------ + function Get_Flag (Name : String) return Boolean + is + function tigetflag (id : char_array) return Curses_Bool; + pragma Import (C, tigetflag); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + if tigetflag (Txt) = Curses_Bool (Curses_True) then + return True; + else + return False; + end if; + end Get_Flag; + +------------------------------------------------------------------------------ + procedure Get_String (Name : String; + Value : out Terminfo_String; + Result : out Boolean) + is + function tigetstr (id : char_array) return chars_ptr; + pragma Import (C, tigetstr, "tigetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + begin + To_C (Name, Txt, Length); + Txt2 := tigetstr (Txt); + if Txt2 = Null_Ptr then + Result := False; + elsif Is_MinusOne_Pointer (Txt2) then + raise Curses_Exception; + else + Value := Terminfo_String (Fill_String (Txt2)); + Result := True; + end if; + end Get_String; + +------------------------------------------------------------------------------ + function Has_String (Name : String) return Boolean + is + function tigetstr (id : char_array) return chars_ptr; + pragma Import (C, tigetstr, "tigetstr"); + Txt : char_array (0 .. Name'Length); + Length : size_t; + Txt2 : chars_ptr; + begin + To_C (Name, Txt, Length); + Txt2 := tigetstr (Txt); + if Txt2 = Null_Ptr then + return False; + elsif Is_MinusOne_Pointer (Txt2) then + raise Curses_Exception; + else + return True; + end if; + end Has_String; + +------------------------------------------------------------------------------ + function Get_Number (Name : String) return Integer is + function tigetstr (s : char_array) return C_Int; + pragma Import (C, tigetstr); + Txt : char_array (0 .. Name'Length); + Length : size_t; + begin + To_C (Name, Txt, Length); + return Integer (tigetstr (Txt)); + end Get_Number; + +------------------------------------------------------------------------------ + procedure Put_String (Str : Terminfo_String; + affcnt : Natural := 1; + putc : putctype := null) is + function tputs (str : char_array; + affcnt : C_Int; + putc : putctype) return C_Int; + function putp (str : char_array) return C_Int; + pragma Import (C, tputs); + pragma Import (C, putp); + Txt : char_array (0 .. Str'Length); + Length : size_t; + Err : C_Int; + begin + To_C (String (Str), Txt, Length); + if putc = null then + Err := putp (Txt); + else + Err := tputs (Txt, C_Int (affcnt), putc); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Put_String; + +end Terminal_Interface.Curses.Terminfo; diff --git a/Ada95/src/terminal_interface-curses-terminfo.ads b/Ada95/src/terminal_interface-curses-terminfo.ads new file mode 100644 index 00000000000..fb39bf1ed6f --- /dev/null +++ b/Ada95/src/terminal_interface-curses-terminfo.ads @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Terminfo -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.3 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ + +with Interfaces.C; + +package Terminal_Interface.Curses.Terminfo is + pragma Preelaborate (Terminal_Interface.Curses.Terminfo); + + -- |===================================================================== + -- | Man page curs_terminfo.3x + -- |===================================================================== + -- Not implemented: setupterm, setterm, set_curterm, del_curterm, + -- restartterm, tparm, putp, vidputs, vidattr, + -- mvcur + + type Terminfo_String is new String; + + -- | + procedure Get_String (Name : String; + Value : out Terminfo_String; + Result : out Boolean); + function Has_String (Name : String) return Boolean; + -- AKA: tigetstr() + + -- | + function Get_Flag (Name : String) return Boolean; + -- AKA: tigetflag() + + -- | + function Get_Number (Name : String) return Integer; + -- AKA: tigetnum() + + type putctype is access function (c : Interfaces.C.int) + return Interfaces.C.int; + pragma Convention (C, putctype); + + -- | + procedure Put_String (Str : Terminfo_String; + affcnt : Natural := 1; + putc : putctype := null); + -- AKA: tputs() + +end Terminal_Interface.Curses.Terminfo; diff --git a/Ada95/src/terminal_interface-curses-text_io-aux.adb b/Ada95/src/terminal_interface-curses-text_io-aux.adb new file mode 100644 index 00000000000..50a4e4461ba --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-aux.adb @@ -0,0 +1,128 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Aux -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.13 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Text_IO.Aux is + + procedure Put_Buf + (Win : Window; + Buf : String; + Width : Field; + Signal : Boolean := True; + Ljust : Boolean := False) + is + L : Field; + Len : Field; + W : Field := Width; + LC : Line_Count; + CC : Column_Count; + Y : Line_Position; + X : Column_Position; + + procedure Output (From, To : Field); + + procedure Output (From, To : Field) + is + begin + if Len > 0 then + if W = 0 then + W := Len; + end if; + if Len > W then + -- LRM A10.6 (7) says this + W := Len; + end if; + + pragma Assert (Len <= W); + Get_Size (Win, LC, CC); + if Column_Count (Len) > CC then + if Signal then + raise Layout_Error; + else + return; + end if; + else + if Len < W and then not Ljust then + declare + Filler : constant String (1 .. (W - Len)) + := (others => ' '); + begin + Put (Win, Filler); + end; + end if; + Get_Cursor_Position (Win, Y, X); + if (X + Column_Position (Len)) > CC then + New_Line (Win); + end if; + Put (Win, Buf (From .. To)); + if Len < W and then Ljust then + declare + Filler : constant String (1 .. (W - Len)) + := (others => ' '); + begin + Put (Win, Filler); + end; + end if; + end if; + end if; + end Output; + + begin + pragma Assert (Win /= Null_Window); + if Ljust then + L := 1; + for I in 1 .. Buf'Length loop + exit when Buf (L) = ' '; + L := L + 1; + end loop; + Len := L - 1; + Output (1, Len); + else -- input buffer is not left justified + L := Buf'Length; + for I in 1 .. Buf'Length loop + exit when Buf (L) = ' '; + L := L - 1; + end loop; + Len := Buf'Length - L; + Output (L + 1, Buf'Length); + end if; + end Put_Buf; + +end Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/src/terminal_interface-curses-text_io-aux.ads b/Ada95/src/terminal_interface-curses-text_io-aux.ads new file mode 100644 index 00000000000..6b50b339506 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-aux.ads @@ -0,0 +1,55 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Aux -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.14 $ +-- $Date: 2009/12/26 17:38:58 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +private package Terminal_Interface.Curses.Text_IO.Aux is + -- pragma Preelaborate (Aux); + + -- This routine is called from the Text_IO output routines for numeric + -- and enumeration types. + -- + procedure Put_Buf + (Win : Window; -- The output window + Buf : String; -- The buffer containing the text + Width : Field; -- The width of the output field + Signal : Boolean := True; -- If true, we raise Layout_Error + Ljust : Boolean := False); -- The Buf is left justified + +end Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/src/terminal_interface-curses-text_io-complex_io.adb b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb new file mode 100644 index 00000000000..6c2e144eb37 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb @@ -0,0 +1,73 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Complex_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Text_IO.Float_IO; + +package body Terminal_Interface.Curses.Text_IO.Complex_IO is + + package FIO is new + Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base); + + procedure Put + (Win : Window; + Item : Complex; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) + is + begin + Put (Win, '('); + FIO.Put (Win, Item.Re, Fore, Aft, Exp); + Put (Win, ','); + FIO.Put (Win, Item.Im, Fore, Aft, Exp); + Put (Win, ')'); + end Put; + + procedure Put + (Item : Complex; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) + is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-complex_io.ads b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads new file mode 100644 index 00000000000..e61345895d1 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads @@ -0,0 +1,70 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Complex_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Numerics.Generic_Complex_Types; + +generic + with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>); + +package Terminal_Interface.Curses.Text_IO.Complex_IO is + + use Complex_Types; + + Default_Fore : Field := 2; + Default_Aft : Field := Real'Digits - 1; + Default_Exp : Field := 3; + + procedure Put + (Win : Window; + Item : Complex; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + + procedure Put + (Item : Complex; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb new file mode 100644 index 00000000000..1b1ad8cbf2e --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb @@ -0,0 +1,75 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Decimal_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Decimal_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package DIO is new Ada.Text_IO.Decimal_IO (Num); + + procedure Put + (Win : Window; + Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) + is + Buf : String (1 .. Field'Last); + Len : Field := Fore + 1 + Aft; + begin + if Exp > 0 then + Len := Len + 1 + Exp; + end if; + DIO.Put (Buf, Item, Aft, Exp); + Aux.Put_Buf (Win, Buf, Len, False); + end Put; + + procedure Put + (Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads new file mode 100644 index 00000000000..1590127451e --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Decimal_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type Num is delta <> digits <>; + +package Terminal_Interface.Curses.Text_IO.Decimal_IO is + + Default_Fore : Field := Num'Fore; + Default_Aft : Field := Num'Aft; + Default_Exp : Field := 0; + + procedure Put + (Win : Window; + Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + + procedure Put + (Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb new file mode 100644 index 00000000000..53f3e55ec83 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb @@ -0,0 +1,80 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Ada.Characters.Handling; use Ada.Characters.Handling; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package EIO is new Ada.Text_IO.Enumeration_IO (Enum); + + procedure Put + (Win : Window; + Item : Enum; + Width : Field := Default_Width; + Set : Type_Set := Default_Setting) + is + Buf : String (1 .. Field'Last); + Tset : Ada.Text_IO.Type_Set; + begin + if Set /= Mixed_Case then + Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set)); + else + Tset := Ada.Text_IO.Lower_Case; + end if; + EIO.Put (Buf, Item, Tset); + if Set = Mixed_Case then + Buf (Buf'First) := To_Upper (Buf (Buf'First)); + end if; + Aux.Put_Buf (Win, Buf, Width, True, True); + end Put; + + procedure Put + (Item : Enum; + Width : Field := Default_Width; + Set : Type_Set := Default_Setting) + is + begin + Put (Get_Window, Item, Width, Set); + end Put; + +end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads new file mode 100644 index 00000000000..a981f0ebc57 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads @@ -0,0 +1,63 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type Enum is (<>); + +package Terminal_Interface.Curses.Text_IO.Enumeration_IO is + + Default_Width : Field := 0; + Default_Setting : Type_Set := Mixed_Case; + + procedure Put + (Win : Window; + Item : Enum; + Width : Field := Default_Width; + Set : Type_Set := Default_Setting); + + procedure Put + (Item : Enum; + Width : Field := Default_Width; + Set : Type_Set := Default_Setting); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb new file mode 100644 index 00000000000..13a34202389 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb @@ -0,0 +1,75 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Fixed_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Fixed_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package FIXIO is new Ada.Text_IO.Fixed_IO (Num); + + procedure Put + (Win : Window; + Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) + is + Buf : String (1 .. Field'Last); + Len : Field := Fore + 1 + Aft; + begin + if Exp > 0 then + Len := Len + 1 + Exp; + end if; + FIXIO.Put (Buf, Item, Aft, Exp); + Aux.Put_Buf (Win, Buf, Len, False); + end Put; + + procedure Put + (Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads new file mode 100644 index 00000000000..3c22a01479c --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Fixed_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type Num is delta <>; + +package Terminal_Interface.Curses.Text_IO.Fixed_IO is + + Default_Fore : Field := Num'Fore; + Default_Aft : Field := Num'Aft; + Default_Exp : Field := 0; + + procedure Put + (Win : Window; + Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + + procedure Put + (Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-float_io.adb b/Ada95/src/terminal_interface-curses-text_io-float_io.adb new file mode 100644 index 00000000000..af667b4cd17 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-float_io.adb @@ -0,0 +1,76 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Float_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Float_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package FIO is new Ada.Text_IO.Float_IO (Num); + + procedure Put + (Win : Window; + Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) + is + Buf : String (1 .. Field'Last); + Len : Field := Fore + 1 + Aft; + begin + if Exp > 0 then + Len := Len + 1 + Exp; + end if; + FIO.Put (Buf, Item, Aft, Exp); + Aux.Put_Buf (Win, Buf, Len, False); + end Put; + + procedure Put + (Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp) + is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-float_io.ads b/Ada95/src/terminal_interface-curses-text_io-float_io.ads new file mode 100644 index 00000000000..b0a68d029eb --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-float_io.ads @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Float_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type Num is digits <>; + +package Terminal_Interface.Curses.Text_IO.Float_IO is + + Default_Fore : Field := 2; + Default_Aft : Field := Num'Digits - 1; + Default_Exp : Field := 3; + + procedure Put + (Win : Window; + Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + + procedure Put + (Item : Num; + Fore : Field := Default_Fore; + Aft : Field := Default_Aft; + Exp : Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-integer_io.adb b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb new file mode 100644 index 00000000000..4d19c42e883 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb @@ -0,0 +1,70 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Integer_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Integer_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package IIO is new Ada.Text_IO.Integer_IO (Num); + + procedure Put + (Win : Window; + Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base) + is + Buf : String (1 .. Field'Last); + begin + IIO.Put (Buf, Item, Base); + Aux.Put_Buf (Win, Buf, Width); + end Put; + + procedure Put + (Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base) + is + begin + Put (Get_Window, Item, Width, Base); + end Put; + +end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-integer_io.ads b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads new file mode 100644 index 00000000000..9ffe1e01816 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads @@ -0,0 +1,63 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Integer_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type Num is range <>; + +package Terminal_Interface.Curses.Text_IO.Integer_IO is + + Default_Width : Field := Num'Width; + Default_Base : Number_Base := 10; + + procedure Put + (Win : Window; + Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base); + + procedure Put + (Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-modular_io.adb b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb new file mode 100644 index 00000000000..fe8a6d0b155 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb @@ -0,0 +1,70 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Modular_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.11 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Modular_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package MIO is new Ada.Text_IO.Modular_IO (Num); + + procedure Put + (Win : Window; + Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base) + is + Buf : String (1 .. Field'Last); + begin + MIO.Put (Buf, Item, Base); + Aux.Put_Buf (Win, Buf, Width); + end Put; + + procedure Put + (Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base) + is + begin + Put (Get_Window, Item, Width, Base); + end Put; + +end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-modular_io.ads b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads new file mode 100644 index 00000000000..68e70e556bf --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads @@ -0,0 +1,63 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Modular_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.12 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +generic + type Num is mod <>; + +package Terminal_Interface.Curses.Text_IO.Modular_IO is + + Default_Width : Field := Num'Width; + Default_Base : Number_Base := 10; + + procedure Put + (Win : Window; + Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base); + + procedure Put + (Item : Num; + Width : Field := Default_Width; + Base : Number_Base := Default_Base); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io.adb b/Ada95/src/terminal_interface-curses-text_io.adb new file mode 100644 index 00000000000..4b29514efbf --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io.adb @@ -0,0 +1,337 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2006,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.19 $ +-- $Date: 2009/12/26 17:40:46 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Text_IO is + + Default_Window : Window := Null_Window; + + procedure Set_Window (Win : Window) + is + begin + Default_Window := Win; + end Set_Window; + + function Get_Window return Window + is + begin + if Default_Window = Null_Window then + return Standard_Window; + else + return Default_Window; + end if; + end Get_Window; + pragma Inline (Get_Window); + + procedure Flush (Win : Window) + is + begin + Refresh (Win); + end Flush; + + procedure Flush + is + begin + Flush (Get_Window); + end Flush; + + -------------------------------------------- + -- Specification of line and page lengths -- + -------------------------------------------- + + -- There are no set routines in this package. I assume, that you allocate + -- the window with an appropriate size. + -- A scroll-window is interpreted as an page with unbounded page length, + -- i.e. it returns the conventional 0 as page length. + + function Line_Length (Win : Window) return Count + is + N_Lines : Line_Count; + N_Cols : Column_Count; + begin + Get_Size (Win, N_Lines, N_Cols); + -- if Natural (N_Cols) > Natural (Count'Last) then + -- raise Layout_Error; + -- end if; + return Count (N_Cols); + end Line_Length; + + function Line_Length return Count + is + begin + return Line_Length (Get_Window); + end Line_Length; + + function Page_Length (Win : Window) return Count + is + N_Lines : Line_Count; + N_Cols : Column_Count; + begin + if Scrolling_Allowed (Win) then + return 0; + else + Get_Size (Win, N_Lines, N_Cols); + -- if Natural (N_Lines) > Natural (Count'Last) then + -- raise Layout_Error; + -- end if; + return Count (N_Lines); + end if; + end Page_Length; + + function Page_Length return Count + is + begin + return Page_Length (Get_Window); + end Page_Length; + + ------------------------------------ + -- Column, Line, and Page Control -- + ------------------------------------ + procedure New_Line (Win : Window; Spacing : Positive_Count := 1) + is + P_Size : constant Count := Page_Length (Win); + begin + if not Spacing'Valid then + raise Constraint_Error; + end if; + + for I in 1 .. Spacing loop + if P_Size > 0 and then Line (Win) >= P_Size then + New_Page (Win); + else + Add (Win, ASCII.LF); + end if; + end loop; + end New_Line; + + procedure New_Line (Spacing : Positive_Count := 1) + is + begin + New_Line (Get_Window, Spacing); + end New_Line; + + procedure New_Page (Win : Window) + is + begin + Clear (Win); + end New_Page; + + procedure New_Page + is + begin + New_Page (Get_Window); + end New_Page; + + procedure Set_Col (Win : Window; To : Positive_Count) + is + Y : Line_Position; + X1 : Column_Position; + X2 : Column_Position; + N : Natural; + begin + if not To'Valid then + raise Constraint_Error; + end if; + + Get_Cursor_Position (Win, Y, X1); + N := Natural (To); N := N - 1; + X2 := Column_Position (N); + if X1 > X2 then + New_Line (Win, 1); + X1 := 0; + end if; + if X1 < X2 then + declare + Filler : constant String (Integer (X1) .. (Integer (X2) - 1)) + := (others => ' '); + begin + Put (Win, Filler); + end; + end if; + end Set_Col; + + procedure Set_Col (To : Positive_Count) + is + begin + Set_Col (Get_Window, To); + end Set_Col; + + procedure Set_Line (Win : Window; To : Positive_Count) + is + Y1 : Line_Position; + Y2 : Line_Position; + X : Column_Position; + N : Natural; + begin + if not To'Valid then + raise Constraint_Error; + end if; + + Get_Cursor_Position (Win, Y1, X); + N := Natural (To); N := N - 1; + Y2 := Line_Position (N); + if Y2 < Y1 then + New_Page (Win); + Y1 := 0; + end if; + if Y1 < Y2 then + New_Line (Win, Positive_Count (Y2 - Y1)); + end if; + end Set_Line; + + procedure Set_Line (To : Positive_Count) + is + begin + Set_Line (Get_Window, To); + end Set_Line; + + function Col (Win : Window) return Positive_Count + is + Y : Line_Position; + X : Column_Position; + N : Natural; + begin + Get_Cursor_Position (Win, Y, X); + N := Natural (X); N := N + 1; + -- if N > Natural (Count'Last) then + -- raise Layout_Error; + -- end if; + return Positive_Count (N); + end Col; + + function Col return Positive_Count + is + begin + return Col (Get_Window); + end Col; + + function Line (Win : Window) return Positive_Count + is + Y : Line_Position; + X : Column_Position; + N : Natural; + begin + Get_Cursor_Position (Win, Y, X); + N := Natural (Y); N := N + 1; + -- if N > Natural (Count'Last) then + -- raise Layout_Error; + -- end if; + return Positive_Count (N); + end Line; + + function Line return Positive_Count + is + begin + return Line (Get_Window); + end Line; + + ----------------------- + -- Characters Output -- + ----------------------- + + procedure Put (Win : Window; Item : Character) + is + P_Size : constant Count := Page_Length (Win); + Y : Line_Position; + X : Column_Position; + L : Line_Count; + C : Column_Count; + begin + if P_Size > 0 then + Get_Cursor_Position (Win, Y, X); + Get_Size (Win, L, C); + if (Y + 1) = L and then (X + 1) = C then + New_Page (Win); + end if; + end if; + Add (Win, Item); + end Put; + + procedure Put (Item : Character) + is + begin + Put (Get_Window, Item); + end Put; + + -------------------- + -- Strings-Output -- + -------------------- + + procedure Put (Win : Window; Item : String) + is + P_Size : constant Count := Page_Length (Win); + Y : Line_Position; + X : Column_Position; + L : Line_Count; + C : Column_Count; + begin + if P_Size > 0 then + Get_Cursor_Position (Win, Y, X); + Get_Size (Win, L, C); + if (Y + 1) = L and then (X + 1 + Item'Length) >= C then + New_Page (Win); + end if; + end if; + Add (Win, Item); + end Put; + + procedure Put (Item : String) + is + begin + Put (Get_Window, Item); + end Put; + + procedure Put_Line + (Win : Window; + Item : String) + is + begin + Put (Win, Item); + New_Line (Win, 1); + end Put_Line; + + procedure Put_Line + (Item : String) + is + begin + Put_Line (Get_Window, Item); + end Put_Line; + +end Terminal_Interface.Curses.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io.ads b/Ada95/src/terminal_interface-curses-text_io.ads new file mode 100644 index 00000000000..9c40329ff4b --- /dev/null +++ b/Ada95/src/terminal_interface-curses-text_io.ads @@ -0,0 +1,136 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2003,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.14 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Ada.IO_Exceptions; + +package Terminal_Interface.Curses.Text_IO is + + use type Ada.Text_IO.Count; + subtype Count is Ada.Text_IO.Count; + subtype Positive_Count is Count range 1 .. Count'Last; + + subtype Field is Ada.Text_IO.Field; + subtype Number_Base is Integer range 2 .. 16; + + type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); + + -- For most of the routines you will see a version without a Window + -- type parameter. They will operate on a default window, which can + -- be set by the user. It is initially equal to Standard_Window. + + procedure Set_Window (Win : Window); + -- Set Win as the default window + + function Get_Window return Window; + -- Get the current default window + + procedure Flush (Win : Window); + procedure Flush; + + -------------------------------------------- + -- Specification of line and page lengths -- + -------------------------------------------- + + -- There are no set routines in this package. I assume, that you allocate + -- the window with an appropriate size. + -- A scroll-window is interpreted as an page with unbounded page length, + -- i.e. it returns the conventional 0 as page length. + + function Line_Length (Win : Window) return Count; + function Line_Length return Count; + + function Page_Length (Win : Window) return Count; + function Page_Length return Count; + + ------------------------------------ + -- Column, Line, and Page Control -- + ------------------------------------ + procedure New_Line (Win : Window; Spacing : Positive_Count := 1); + procedure New_Line (Spacing : Positive_Count := 1); + + procedure New_Page (Win : Window); + procedure New_Page; + + procedure Set_Col (Win : Window; To : Positive_Count); + procedure Set_Col (To : Positive_Count); + + procedure Set_Line (Win : Window; To : Positive_Count); + procedure Set_Line (To : Positive_Count); + + function Col (Win : Window) return Positive_Count; + function Col return Positive_Count; + + function Line (Win : Window) return Positive_Count; + function Line return Positive_Count; + + ----------------------- + -- Characters-Output -- + ----------------------- + + procedure Put (Win : Window; Item : Character); + procedure Put (Item : Character); + + -------------------- + -- Strings-Output -- + -------------------- + + procedure Put (Win : Window; Item : String); + procedure Put (Item : String); + + procedure Put_Line + (Win : Window; + Item : String); + + procedure Put_Line + (Item : String); + + -- Exceptions + + Status_Error : exception renames Ada.IO_Exceptions.Status_Error; + Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error; + Name_Error : exception renames Ada.IO_Exceptions.Name_Error; + Use_Error : exception renames Ada.IO_Exceptions.Use_Error; + Device_Error : exception renames Ada.IO_Exceptions.Device_Error; + End_Error : exception renames Ada.IO_Exceptions.End_Error; + Data_Error : exception renames Ada.IO_Exceptions.Data_Error; + Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error; + +end Terminal_Interface.Curses.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-trace.adb_p b/Ada95/src/terminal_interface-curses-trace.adb_p new file mode 100644 index 00000000000..f40d8bf3123 --- /dev/null +++ b/Ada95/src/terminal_interface-curses-trace.adb_p @@ -0,0 +1,97 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Trace -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 2000-2004,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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.6 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +#if ADA_TRACE then +with Interfaces.C; use Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Ada.Unchecked_Conversion; +#end if; + +package body Terminal_Interface.Curses.Trace is + +#if ADA_TRACE then + type C_TraceType is new C_UInt; + + function TraceAda_To_TraceC is new + Ada.Unchecked_Conversion (Source => Trace_Attribute_Set, + Target => C_TraceType); + + procedure Trace_On (x : Trace_Attribute_Set) is + procedure traceC (y : C_TraceType); + pragma Import (C, traceC, "trace"); + begin + traceC (TraceAda_To_TraceC (x)); + end Trace_On; + + -- 75. (12) A C function that takes a variable number of arguments can + -- correspond to several Ada subprograms, taking various specific + -- numbers and types of parameters. + + procedure Trace_Put (str : String) is + procedure tracef (format : char_array; s : char_array); + pragma Import (C, tracef, "_tracef"); + Txt : char_array (0 .. str'Length); + Length : size_t; + formatstr : constant String := "%s" & ASCII.NUL; + formattxt : char_array (0 .. formatstr'Length); + begin + To_C (formatstr, formattxt, Length); + To_C (str, Txt, Length); + tracef (formattxt, Txt); + end Trace_Put; +#else + procedure Trace_On (x : Trace_Attribute_Set) is +#if PRAGMA_UNREF + pragma Unreferenced (x); +#end if; + begin + null; + end Trace_On; + + procedure Trace_Put (str : String) is +#if PRAGMA_UNREF + pragma Unreferenced (str); +#end if; + begin + null; + end Trace_Put; +#end if; + +end Terminal_Interface.Curses.Trace; diff --git a/Ada95/src/terminal_interface.ads b/Ada95/src/terminal_interface.ads new file mode 100644 index 00000000000..fdaaf9fe727 --- /dev/null +++ b/Ada95/src/terminal_interface.ads @@ -0,0 +1,47 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface -- +-- -- +-- S P E C -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 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 -- +-- "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: Juergen Pfeifer, 1996 +-- Version Control: +-- $Revision: 1.14 $ +-- $Date: 2006/06/25 14:30:22 $ +-- Binding Version 01.00 +------------------------------------------------------------------------------ +package Terminal_Interface is + pragma Pure (Terminal_Interface); +-- +-- Everything is in the child units +-- +end Terminal_Interface; diff --git a/INSTALL b/INSTALL index ab7dcd82995..282c2a36543 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,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 -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ +-- $Id: INSTALL,v 1.152 2011/02/25 22:10:53 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -39,9 +39,8 @@ d.d is the current version number. There should be several subdirectories, including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs', and `test'. See the README file for a roadmap to the package. -If you are a Linux or FreeBSD or NetBSD distribution integrator or packager, -please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR -below. +If you are a distribution integrator or packager, please read and act on the +section titled IF YOU ARE A SYSTEM INTEGRATOR below. If you are converting from BSD curses and do not have root access, be sure to read the BSD CONVERSION NOTES section below. @@ -58,10 +57,6 @@ CROSS-COMPILER. If you want to build the Ada95 binding, go to the Ada95 directory and follow the instructions there. The Ada95 binding is not covered below. -If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based -i386 Unixes, go read the Portability section in the TO-DO file before you -do anything else. - REQUIREMENTS: ------------ @@ -86,14 +81,14 @@ INSTALLATION PROCEDURE: The --prefix option to configure changes the root directory for installing ncurses. The default is normally in subdirectories of /usr/local, except - for systems where ncurses is normally installed as a system library, e.g., - Linux, the various BSD systems and Cygwin. Use --prefix=/usr to replace - your default curses distribution. + for systems where ncurses is normally installed as a system library (see + "IF YOU ARE A SYSTEM INTEGRATOR"). Use --prefix=/usr to replace your + default curses distribution. The package gets installed beneath the --prefix directory as follows: In $(prefix)/bin: tic, infocmp, captoinfo, tset, - reset, clear, tput, toe + reset, clear, tput, toe, tabs In $(prefix)/lib: libncurses*.* libcurses.a In $(prefix)/share/terminfo: compiled terminal descriptions In $(prefix)/include: C header files @@ -105,12 +100,12 @@ INSTALLATION PROCEDURE: Do not use commands such as - make install prefix=XXX + make install prefix=XXX to change the prefix after configuration, since the prefix value is used for some absolute pathnames such as TERMINFO. Instead do this - make install DESTDIR=XXX + make install DESTDIR=XXX See also the discussion of --with-install-prefix. @@ -147,7 +142,7 @@ INSTALLATION PROCEDURE: library interfaces are not binary-compatible with the non-wide-character version. Building and running the wide-character code relies on a fairly recent implementation of libiconv. We have built this configuration on - Linux using libiconv, sometimes requiring libutf8. + various systems using libiconv, sometimes requiring libutf8. If you configure using the --with-pthread option, a "t" is appended to the library names (e.g., libncursest.a, libncursestw.a). @@ -170,8 +165,8 @@ INSTALLATION PROCEDURE: ./configure --with-shared --without-normal --without-debug Rules for generating shared libraries are highly dependent upon the choice - of host system and compiler. We've been testing shared libraries on Linux - and SunOS with gcc, but more work needs to be done to make shared libraries + of host system and compiler. We've been testing shared libraries on + several systems, but more work needs to be done to make shared libraries work on other systems. If you have libtool installed, you can type @@ -338,6 +333,17 @@ SUMMARY OF CONFIGURE OPTIONS: --disable-largefile Disable compiler flags needed to use large-file interfaces. + --disable-libtool-version + when using --with-libtool, control how the major/minor version numbers + are used for constructing the library name. + + The default uses the -version-number feature of libtool, which makes + the library names compatible (though not identical) with the standard + build using --with-shared. + + Use --disable-libtool-version to use the libtool -version-info feature. + This corresponds to the setting used before patch 20100515. + --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. @@ -389,6 +395,12 @@ SUMMARY OF CONFIGURE OPTIONS: application. These are (for example $TERMINFO) those that allow the search path for the terminfo or termcap entry to be customized. + --disable-rpath-hack + Normally the configure script helps link libraries found in unusual + places by adding an rpath option to the link command. If you are + building packages, this feature may be redundant. Use this option + to suppress the feature. + --disable-scroll-hints Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. @@ -513,6 +525,10 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. + --enable-interop + Compile-in experimental interop bindings. These provide generic types + for the form-library. + --enable-mixed-case Controls whether the filesystem on which the terminfo database resides supports mixed-case filenames (normal for UNIX, but not on other @@ -525,6 +541,15 @@ SUMMARY OF CONFIGURE OPTIONS: terminfo entries. This is the default, unless you have disabled the extended functions. + --enable-pc-files + If pkg-config is found (see --with-pkg-config), generate ".pc" files + for each of the libraries, and install them in pkg-config's library + directory. + + --enable-pthreads-eintr + add logic in threaded configuration to ensure that a read(2) system + call can be interrupted for SIGWINCH. + --enable-reentrant Compile experimental configuration which improves reentrant use of the library by reducing global and static variables. This option is also @@ -565,6 +590,11 @@ SUMMARY OF CONFIGURE OPTIONS: is not strictly compatible. This option allows one to implement this alteration without patching the source code. + --enable-sp-funcs + Compile-in support for extended functions which accept a SCREEN pointer, + reducing the need for juggling the global SP value with set_term() and + delscreen(). + --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -576,6 +606,11 @@ SUMMARY OF CONFIGURE OPTIONS: capabilities as user-defined strings. This option is the default, unless you have disabled the extended functions. + --enable-term-driver + Enable experimental terminal-driver. This is currently used for the + MinGW port, by providing a way to substitute the low-level terminfo + library with different terminal drivers. + --enable-termcap Compile in support for reading terminal descriptions from termcap if no match is found in the terminfo database. See also the --enable-getcap @@ -630,12 +665,19 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib + Build a shared library for Ada95 binding, if the compiler permits. + --with-bool=TYPE If --without-cxx is specified, override the type used for the "bool" declared in curses.h (normally the type is automatically chosen to correspond with that in , or defaults to platform-specific sizes). + --with-build-cpp=XXX + This option is provided by the same macro used for $BUILD_CC, etc., + but is not directly used by ncurses. + --with-build-cc=XXX If cross-compiling, specify a host C compiler, which is needed to compile a few utilities which generate source modules for ncurses. @@ -682,6 +724,10 @@ SUMMARY OF CONFIGURE OPTIONS: to use a terminfo database which is compatible with the native applications. + --with-ccharw-max=XXX + Override the size of the wide-character array in cchar_t structures. + Changing this will alter the binary interface. This defaults to 5. + --with-chtype=TYPE Override type of chtype, which stores the video attributes and (if --enable-widec is not given) a character. Prior to ncurses 5.5, this @@ -719,7 +765,7 @@ SUMMARY OF CONFIGURE OPTIONS: use Alessandro Rubini's GPM library to provide mouse support on the Linux console. Prior to ncurses 5.5, this introduced a dependency on the GPM library. - + Currently ncurses uses the dlsym() function to bind to the library at runtime, so it is only necessary that the library be present when ncurses is built, to obtain the filename (or soname) used in the @@ -736,7 +782,7 @@ SUMMARY OF CONFIGURE OPTIONS: Use a hashed database for storing terminfo data rather than storing each compiled entry in a separate binary file within a directory tree. - + In particular, this uses the Berkeley database 1.8.5 interface, as provided by that and its successors db 2, 3, and 4. The actual interface is slightly different in the successor versions of the @@ -807,9 +853,9 @@ SUMMARY OF CONFIGURE OPTIONS: --with-manpage-renames=XXX Tell the configure script that you wish to rename the manpages while - installing. Currently the only distribution which does this is - the Linux Debian. The option value specifies the name of a file - that lists the renamed files, e.g., $srcdir/man/man_db.renames + installing. Currently the only distribution which does this is Debian. + The option value specifies the name of a file that lists the renamed + files, e.g., $srcdir/man/man_db.renames --with-manpage-symlinks Tell the configure script that you wish to make symbolic links in the @@ -850,6 +896,9 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. + --with-pkg-config=[DIR] + Check for pkg-config, optionally specifying its path. + --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -885,7 +934,7 @@ SUMMARY OF CONFIGURE OPTIONS: loads the system's copy of the ncurses shared libraries. In that case, using the misc/shlib script may be helpful, since it sets $LD_LIBRARY_PATH to point to the build tree, e.g., - ./misc/shlib make install + ./misc/shlib make install --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. @@ -946,6 +995,17 @@ SUMMARY OF CONFIGURE OPTIONS: For testing, compile with debug option. This also sets the --disable-leaks option. + --with-wrap-prefix=XXX + When using the --enable-reentrant option, ncurses redefines variables + that would be global in curses, e.g., LINES, as a macro that calls a + "wrapping" function which fetches the data from the current SCREEN + structure. Normally that function is named by prepending "_nc_" to the + variable's name. The function is technically private (since portable + applications would not refer directly to it). But according to one + line of reasoning, it is not the same type of "private" as functions + which applications should not call even via a macro. This configure + option lets you choose the prefix for these wrapped variables. + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -975,11 +1035,18 @@ SUMMARY OF CONFIGURE OPTIONS: --without-dlsym Do not use dlsym() to load GPM dynamically. + --without-manpages + Tell the configure script to suppress the install of ncurses' manpages. + --without-progs Tell the configure script to suppress the build of ncurses' application programs (e.g., tic). The test applications will still be built if you type "make", though not if you simply do "make install". + --without-tests + Tell the configure script to suppress the build of ncurses' test + programs. + --without-xterm-new Tell the configure script to use "xterm-old" for the entry used in the terminfo database. This will work with variations such as @@ -1001,6 +1068,60 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: you may encounter when building a system with different versions of ncurses: + 5.8 (Feb 26, 2011) + Interface changes: + + + add an alternate library configuration, i.e., "terminal driver" to + support port to Windows, built with MinGW. There are two drivers + (terminfo and Windows console). The terminfo driver works on other + platforms. + + + add a new set of functions which accept a SCREEN* parameter, in + contrast with the original set which use the global value "sp". + By default, these names end with "_sp", and are otherwise + functionally identical with the originals. + + In addition to the "_sp" functions, there are a few new functions + associated with this feature: ceiling_panel, ground_panel, + new_prescr. + + If the library is not built with the sp-funcs extension, there + are no related interface changes. + + + add tiparm function based on review of X/Open Curses Issue 7. + + + change internal _nc_has_mouse function to public has_mouse function + + Added extensions: + + + add a few more functions to support the NCURSES_OPAQUE feature: + get_escdelay, is_pad, is_subwin + + Added internal functions (other than "_sp" variants): + _nc_curscr_of + _nc_format_slks + _nc_get_alias_table + _nc_get_hash_info + _nc_insert_wch + _nc_newscr_of + _nc_outc_wrapper + _nc_retrace_char + _nc_retrace_int_attr_t + _nc_retrace_mmask_t + _nc_setup_tinfo + _nc_stdscr_of + _nc_tinfo_cmdch + + Removed internal functions: + _nc_makenew (some configurations replace by _nc_makenew_sp) + + Modified internal functions: + _nc_UpdateAttrs + _nc_get_hash_table + _nc_has_mouse + _nc_insert_ch + _nc_wgetch + 5.7 (November 2, 2008) Interface changes: @@ -1011,7 +1132,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: of the ncurses library used for the tic program as well as some others such as tack. There is no API change, but makefiles would be changed to use the tic-library built separately. - + tack, distributed separately from ncurses, uses some of the internal _nc_XXX functions, which are declared in the tic.h header file. @@ -1158,7 +1279,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: still used in this release to allow compiling with not-so-old compilers. - + form and menu libraries now work with wide-character data. + + form and menu libraries now work with wide-character data. Applications which bypassed the form library and manipulated the FIELD.buf data directly will not work properly with libformw, since that no longer points to an array of char. The set_field_buffer() @@ -1438,8 +1559,8 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: 4.0 (December 24, 1996) - We bumped to version 4.0 because the newly released dynamic loader - (ld.so.1.8.5) on Linux did not load shared libraries whose ABI and REL + We bumped to version 4.0 because the newly released Linux dynamic + loader (ld.so.1.8.5) did not load shared libraries whose ABI and REL versions were inconsistent. At that point, ncurses ABI was 3.4 and the REL was 1.9.9g, so we made them consistent. @@ -1496,10 +1617,10 @@ IF YOU ARE A SYSTEM INTEGRATOR: Configuration and Installation: - On platforms where ncurses is assumed to be installed in /usr/lib, + On platforms where ncurses is assumed to be installed in /usr/lib, the configure script uses "/usr" as a default: - Linux, FreeBSD, NetBSD, OpenBSD, Cygwin + GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin For other platforms, the default is "/usr/local". See the discussion of the "--disable-overwrite" option. @@ -1562,7 +1683,7 @@ IF YOU ARE A SYSTEM INTEGRATOR: bsdos -- BSD/OS If you are responsible for integrating ncurses for one of these - distribution, please either use the recommended name or get back + distributions, please either use the recommended name or get back to us explaining why you don't want to, so we can work out nomenclature that will make users' lives easier rather than harder. @@ -1584,7 +1705,8 @@ CONFIGURING FALLBACK ENTRIES: tree is accessible (that is, in single-user mode or at OS installation time) the ncurses library can be compiled to include an array of pre-fetched fallback entries. This must be done on a machine which - has ncurses' infocmp and terminfo database installed. + has ncurses' infocmp and terminfo database installed (as well as + ncurses' tic and infocmp programs). These entries are checked by setupterm() only when the conventional fetches from the terminfo tree and the termcap fallback (if configured) @@ -1689,8 +1811,8 @@ USING NCURSES WITH AFS: with this by making tic use symbolic links. USING NCURSES WITH GPM: - Ncurses 4.1 and up can be configured to use GPM (General Purpose - Mouse) which is used on Linux console. Be aware that GPM is commonly + Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) + which is used with Linux console. Be aware that GPM is commonly installed as a shared library which contains a wrapper for the curses wgetch() function (libcurses.o). Some integrators have simplified linking applications by combining all or part of libcurses.so into the @@ -1735,6 +1857,10 @@ BUILDING NCURSES WITH A CROSS-COMPILER option), ncurses uses the development platform's tic to do the "make install.data" portion. + The system's tic program is used to install the terminal database, + even for cross-compiles. For best results, the tic program should + be from the most current version of ncurses. + BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to diff --git a/MANIFEST b/MANIFEST index db3871f2e11..5debc64e5f2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,6 +3,9 @@ ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO +./Ada95/aclocal.m4 +./Ada95/configure +./Ada95/configure.in ./Ada95/gen/Makefile.in ./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c @@ -23,6 +26,12 @@ ./Ada95/gen/terminal_interface-curses-trace.ads.m4 ./Ada95/gen/terminal_interface-curses.adb.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 +./Ada95/include/MKncurses_def.sh +./Ada95/include/Makefile.in +./Ada95/include/ncurses_cfg.hin +./Ada95/include/ncurses_defs +./Ada95/make-tar.sh +./Ada95/mk-1st.awk ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -109,6 +118,8 @@ ./Ada95/samples/tour.adb ./Ada95/samples/tour.ads ./Ada95/src/Makefile.in +./Ada95/src/library.gpr +./Ada95/src/modules ./Ada95/src/terminal_interface-curses-aux.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -172,6 +183,7 @@ ./Makefile.os2 ./NEWS ./README +./README.MinGW ./README.emx ./TO-DO ./aclocal.m4 @@ -311,6 +323,7 @@ ./doc/html/announce.html ./doc/html/hackguide.html ./doc/html/index.html +./doc/html/man/adacurses-config.1.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html ./doc/html/man/curs_add_wch.3x.html @@ -350,6 +363,7 @@ ./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html ./doc/html/man/curs_legacy.3x.html +./doc/html/man/curs_memleaks.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html ./doc/html/man/curs_opaque.3x.html @@ -363,6 +377,7 @@ ./doc/html/man/curs_scr_dump.3x.html ./doc/html/man/curs_scroll.3x.html ./doc/html/man/curs_slk.3x.html +./doc/html/man/curs_sp_funcs.3x.html ./doc/html/man/curs_termattrs.3x.html ./doc/html/man/curs_termcap.3x.html ./doc/html/man/curs_terminfo.3x.html @@ -370,6 +385,7 @@ ./doc/html/man/curs_touch.3x.html ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html +./doc/html/man/curs_variables.3x.html ./doc/html/man/curs_window.3x.html ./doc/html/man/default_colors.3x.html ./doc/html/man/define_key.3x.html @@ -395,6 +411,7 @@ ./doc/html/man/form_post.3x.html ./doc/html/man/form_requestname.3x.html ./doc/html/man/form_userptr.3x.html +./doc/html/man/form_variables.3x.html ./doc/html/man/form_win.3x.html ./doc/html/man/index.html ./doc/html/man/infocmp.1m.html @@ -427,10 +444,13 @@ ./doc/html/man/mitem_value.3x.html ./doc/html/man/mitem_visible.3x.html ./doc/html/man/ncurses.3x.html +./doc/html/man/ncurses5-config.1.html ./doc/html/man/panel.3x.html ./doc/html/man/resizeterm.3x.html +./doc/html/man/tabs.1.html ./doc/html/man/term.5.html ./doc/html/man/term.7.html +./doc/html/man/term_variables.3x.html ./doc/html/man/terminfo.5.html ./doc/html/man/tic.1m.html ./doc/html/man/toe.1m.html @@ -479,12 +499,15 @@ ./form/fty_alnum.c ./form/fty_alpha.c ./form/fty_enum.c +./form/fty_generic.c ./form/fty_int.c ./form/fty_ipv4.c ./form/fty_num.c ./form/fty_regex.c ./form/headers ./form/llib-lform +./form/llib-lformt +./form/llib-lformtw ./form/llib-lformw ./form/modules ./include/Caps @@ -507,16 +530,20 @@ ./include/hashed_db.h ./include/headers ./include/nc_alloc.h +./include/nc_mingw.h ./include/nc_panel.h ./include/nc_tparm.h ./include/ncurses_cfg.hin ./include/ncurses_defs -./include/ncurses_dll.h +./include/ncurses_dll.h.in +./include/ncurses_mingw.h ./include/term_entry.h ./include/termcap.h.in ./include/tic.h ./include/unctrl.h.in ./install-sh +./man/MKada_config.in +./man/MKncu_config.in ./man/MKterminfo.sh ./man/Makefile.in ./man/captoinfo.1m @@ -572,6 +599,7 @@ ./man/curs_scr_dump.3x ./man/curs_scroll.3x ./man/curs_slk.3x +./man/curs_sp_funcs.3x ./man/curs_termattrs.3x ./man/curs_termcap.3x ./man/curs_terminfo.3x @@ -579,6 +607,7 @@ ./man/curs_touch.3x ./man/curs_trace.3x ./man/curs_util.3x +./man/curs_variables.3x ./man/curs_window.3x ./man/default_colors.3x ./man/define_key.3x @@ -604,6 +633,7 @@ ./man/form_post.3x ./man/form_requestname.3x ./man/form_userptr.3x +./man/form_variables.3x ./man/form_win.3x ./man/infocmp.1m ./man/infotocap.1m @@ -640,8 +670,10 @@ ./man/ncurses.3x ./man/panel.3x ./man/resizeterm.3x +./man/tabs.1 ./man/term.5 ./man/term.7 +./man/term_variables.3x ./man/terminfo.head ./man/terminfo.tail ./man/tic.1m @@ -654,6 +686,8 @@ ./menu/eti.h ./menu/headers ./menu/llib-lmenu +./menu/llib-lmenut +./menu/llib-lmenutw ./menu/llib-lmenuw ./menu/m_attribs.c ./menu/m_cursor.c @@ -694,13 +728,12 @@ ./misc/emx.src ./misc/form.def ./misc/form.ref +./misc/gen-pkgconfig.in ./misc/gen_edit.sh -./misc/jpf-indent ./misc/makedef.cmd ./misc/makellib ./misc/menu.def ./misc/menu.ref -./misc/ncu-indent ./misc/ncurses-config.in ./misc/ncurses.def ./misc/ncurses.ref @@ -718,8 +751,8 @@ ./mk-0th.awk ./mk-1st.awk ./mk-2nd.awk +./mk-dlls.sh.in ./mk-hdr.awk -./mkdirs.sh ./ncurses/Makefile.in ./ncurses/README ./ncurses/README.IZ @@ -748,6 +781,7 @@ ./ncurses/base/lib_delch.c ./ncurses/base/lib_delwin.c ./ncurses/base/lib_dft_fgbg.c +./ncurses/base/lib_driver.c ./ncurses/base/lib_echo.c ./ncurses/base/lib_endwin.c ./ncurses/base/lib_erase.c @@ -813,10 +847,12 @@ ./ncurses/base/version.c ./ncurses/base/vsscanf.c ./ncurses/base/wresize.c +./ncurses/build.priv.h ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses ./ncurses/llib-lncursest +./ncurses/llib-lncursestw ./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk @@ -863,6 +899,7 @@ ./ncurses/tinfo/lib_tparm.c ./ncurses/tinfo/lib_tputs.c ./ncurses/tinfo/lib_ttyflags.c +./ncurses/tinfo/make_hash.c ./ncurses/tinfo/make_keys.c ./ncurses/tinfo/name_match.c ./ncurses/tinfo/parse_entry.c @@ -870,6 +907,7 @@ ./ncurses/tinfo/read_termcap.c ./ncurses/tinfo/setbuf.c ./ncurses/tinfo/strings.c +./ncurses/tinfo/tinfo_driver.c ./ncurses/tinfo/trim_sgr0.c ./ncurses/tinfo/use_screen.c ./ncurses/tinfo/write_entry.c @@ -895,6 +933,7 @@ ./ncurses/tty/tty_display.h ./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c +./ncurses/wcwidth.h ./ncurses/widechar/charable.c ./ncurses/widechar/lib_add_wch.c ./ncurses/widechar/lib_box_set.c @@ -915,9 +954,14 @@ ./ncurses/widechar/lib_vline_set.c ./ncurses/widechar/lib_wacs.c ./ncurses/widechar/lib_wunctrl.c +./ncurses/win32con/gettimeofday.c +./ncurses/win32con/wcwidth.c +./ncurses/win32con/win_driver.c ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel +./panel/llib-lpanelt +./panel/llib-lpaneltw ./panel/llib-lpanelw ./panel/modules ./panel/p_above.c @@ -947,11 +991,12 @@ ./progs/infocmp.c ./progs/modules ./progs/progs.priv.h +./progs/tabs.c ./progs/tic.c ./progs/toe.c ./progs/tput.c +./progs/transform.c ./progs/tset.c -./tar-copy.sh ./test/Makefile.in ./test/README ./test/aclocal.m4 @@ -963,6 +1008,7 @@ ./test/cardfile.c ./test/cardfile.dat ./test/chgat.c +./test/clip_printw.c ./test/color_set.c ./test/configure ./test/configure.in @@ -973,6 +1019,7 @@ ./test/demo_menus.c ./test/demo_panels.c ./test/demo_termcap.c +./test/demo_terminfo.c ./test/ditto.c ./test/dots.c ./test/dots_mvcur.c @@ -990,13 +1037,16 @@ ./test/inch_wide.c ./test/inchs.c ./test/ins_wide.c +./test/insdelln.c ./test/inserts.c ./test/key_names.c ./test/keynames.c ./test/knight.c +./test/linedata.h ./test/linux-color.dat ./test/listused.sh ./test/lrtest.c +./test/make-tar.sh ./test/mk-test.awk ./test/modules ./test/movewindow.c @@ -1011,6 +1061,10 @@ ./test/savescreen.sh ./test/tclock.c ./test/test.priv.h +./test/test_add_wchstr.c +./test/test_addchstr.c +./test/test_addstr.c +./test/test_addwstr.c ./test/test_arrays.c ./test/test_get_wstr.c ./test/test_getstr.c @@ -1026,4 +1080,5 @@ ./test/worm.c ./test/xmas.c ./test/xterm-16color.dat +./test/xterm-256color.dat ./test/xterm-88color.dat diff --git a/Makefile.in b/Makefile.in index cb8cd422cc4..d891e002fd8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.24 2005/01/29 19:30:06 tom Exp $ +# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,6 +32,7 @@ # Master Makefile for ncurses library. SHELL = /bin/sh +VPATH = @srcdir@ DESTDIR=@DESTDIR@ CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" @@ -42,6 +43,9 @@ NCURSES_MAJOR = @NCURSES_MAJOR@ NCURSES_MINOR = @NCURSES_MINOR@ NCURSES_PATCH = @NCURSES_PATCH@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ + prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -83,6 +87,13 @@ preinstall : fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ echo '** Will overwrite non-ncurses curses.h' +dlls: libs + $(SHELL) $(srcdir)/mk-dlls.sh + +distclean \ +realclean :: + -rm -f mk-dlls.sh mingw_arch + # Put the common rules here so that we can easily construct the list of # directories to visit. all \ diff --git a/NEWS b/NEWS index a64450b3022..55f3cc74c33 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ +-- $Id: NEWS,v 1.1651 2011/02/26 16:54:31 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,988 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20110226 5.8 release for upload to ftp.gnu.org + +20110226 + + update release notes, for 5.8. + + regenerated html manpages. + + change open() in _nc_read_file_entry() to fopen() for consistency + with write_file(). + + modify misc/run_tic.in to create parent directory, in case this is + a new install of hashed database. + + fix typo in Ada95/mk-1st.awk which causes error with original awk. + +20110220 + + configure script rpath fixes from xterm #269. + + workaround for cygwin's non-functional features.h, to force ncurses' + configure script to define _XOPEN_SOURCE_EXTENDED when building + wide-character configuration. + + build-fix in run_tic.sh for OS/2 EMX install + + add cons25-debian entry (patch by Brian M Carlson, Debian #607662). + +20110212 + + regenerated html manpages. + + use _tracef() in show_where() function of tic, to work correctly with + special case of trace configuration. + +20110205 + + add xterm-utf8 entry as a demo of the U8 feature -TD + + add U8 feature to denote entries for terminal emulators which do not + support VT100 SI/SO when processing UTF-8 encoding -TD + + improve the NCURSES_NO_UTF8_ACS feature by adding a check for an + extended terminfo capability U8 (prompted by mailing list + discussion). + +20110122 + + start documenting interface changes for upcoming 5.8 release. + + correct limit-checks in derwin(). + + correct limit-checks in newwin(), to ensure that windows have nonzero + size (report by Garrett Cooper). + + fix a missing "weak" declaration for pthread_kill (patch by Nicholas + Alcock). + + improve documentation of KEY_ENTER in curs_getch.3x manpage (prompted + by discussion with Kevin Martin). + +20110115 + + modify Ada95/configure script to make the --with-curses-dir option + work without requiring the --with-ncurses option. + + modify test programs to allow them to be built with NetBSD curses. + + document thick- and double-line symbols in curs_add_wch.3x manpage. + + document WACS_xxx constants in curs_add_wch.3x manpage. + + fix some warnings for clang 2.6 "--analyze" + + modify Ada95 makefiles to make html-documentation with the project + file configuration if that is used. + + update config.guess, config.sub + +20110108 + + regenerated html manpages. + + minor fixes to enable lint when trace is not enabled, e.g., with + clang --analyze. + + fix typo in man/default_colors.3x (patch by Tim van der Molen). + + update ncurses/llib-lncurses* + +20110101 + + fix remaining strict compiler warnings in ncurses library ABI=5, + except those dealing with function pointers, etc. + +20101225 + + modify nc_tparm.h, adding guards against repeated inclusion, and + allowing TPARM_ARG to be overridden. + + fix some strict compiler warnings in ncurses library. + +20101211 + + suppress ncv in screen entry, allowing underline (patch by Alejandro + R Sedeno). + + also suppress ncv in konsole-base -TD + + fixes in wins_nwstr() and related functions to ensure that special + characters, i.e., control characters are handled properly with the + wide-character configuration. + + correct a comparison in wins_nwstr() (Redhat #661506). + + correct help-messages in some of the test-programs, which still + referred to quitting with 'q'. + +20101204 + + add special case to _nc_infotocap() to recognize the setaf/setab + strings from xterm+256color and xterm+88color, and provide a reduced + version which works with termcap. + + remove obsolete emacs "Local Variables" section from documentation + (request by Sven Joachim). + + update doc/html/index.html to include NCURSES-Programming-HOWTO.html + (report by Sven Joachim). + +20101128 + + modify test/configure and test/Makefile.in to handle this special + case of building within a build-tree (Debian #34182): + mkdir -p build && cd build && ../test/configure && make + +20101127 + + miscellaneous build-fixes for Ada95 and test-directories when built + out-of-tree. + + use VPATH in makefiles to simplify out-of-tree builds (Debian #34182). + + fix typo in rmso for tek4106 entry -Goran Weinholt + +20101120 + + improve checks in test/configure for X libraries, from xterm #267 + changes. + + modify test/configure to allow it to use the build-tree's libraries + e.g., when using that to configure the test-programs without the + rpath feature (request by Sven Joachim). + + repurpose "gnome" terminfo entries as "vte", retaining "gnome" items + for compatibility, but generally deprecating those since the VTE + library is what actually defines the behavior of "gnome", etc., + since 2003 -TD + +20101113 + + compiler warning fixes for test programs. + + various build-fixes for test-programs with pdcurses. + + updated configure checks for X packages in test/configure from xterm + #267 changes. + + add configure check to gnatmake, to accommodate cygwin. + +20101106 + + correct list of sub-directories needed in Ada95 tree for building as + a separate package. + + modify scripts in test-directory to improve builds as a separate + package. + +20101023 + + correct parsing of relative tab-stops in tabs program (report by + Philip Ganchev). + + adjust configure script so that "t" is not added to library suffix + when weak-symbols are used, allowing the pthread configuration to + more closely match the non-thread naming (report by Werner Fink). + + modify configure check for tic program, used for fallbacks, to a + warning if not found. This makes it simpler to use additonal + scripts to bootstrap the fallbacks code using tic from the build + tree (report by Werner Fink). + + fix several places in configure script using ${variable-value} form. + + modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders + which do not support selectively linking against static libraries + (report by John P. Hartmann) + + fix an unescaped dash in man/tset.1 (report by Sven Joachim). + +20101009 + + correct comparison used for setting 16-colors in linux-16color + entry (Novell #644831) -TD + + improve linux-16color entry, using "dim" for color-8 which makes it + gray rather than black like color-0 -TD + + drop misc/ncu-indent and misc/jpf-indent; they are provided by an + external package "cindent". + +20101002 + + improve linkages in html manpages, adding references to the newer + pages, e.g., *_variables, curs_sp_funcs, curs_threads. + + add checks in tic for inconsistent cursor-movement controls, and for + inconsistent printer-controls. + + fill in no-parameter forms of cursor-movement where a parameterized + form is available -TD + + fill in missing cursor controls where the form of the controls is + ANSI -TD + + fix inconsistent punctuation in form_variables manpage (patch by + Sven Joachim). + + add parameterized cursor-controls to linux-basic (report by Dae) -TD + > patch by Juergen Pfeifer: + + document how to build 32-bit libraries in README.MinGW + + fixes to filename computation in mk-dlls.sh.in + + use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven + Joachim). + + add a check in mk-dlls.sh.in to obtain the size of a pointer to + distinguish between 32-bit and 64-bit hosts. The result is stored + in mingw_arch + +20100925 + + add "XT" capability to entries for terminals that support both + xterm-style mouse- and title-controls, for "screen" which + special-cases TERM beginning with "xterm" or "rxvt" -TD + > patch by Juergen Pfeifer: + + use 64-Bit MinGW toolchain (recommended package from TDM, see + README.MinGW). + + support pthreads when using the TDM MinGW toolchain + +20100918 + + regenerated html manpages. + + minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages. + + add manpage for sp-funcs. + + add sp-funcs to test/listused.sh, for documentation aids. + +20100911 + + add manpages for summarizing public variables of curses-, terminfo- + and form-libraries. + + minor fixes to manpages for consistency (patch by Jason McIntyre). + + modify tic's -I/-C dump to reformat acsc strings into canonical form + (sorted, unique mapping) (cf: 971004). + + add configure check for pthread_kill(), needed for some old + platforms. + +20100904 + + add configure option --without-tests, to suppress building test + programs (request by Frederic L W Meunier). + +20100828 + + modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD + + add check in terminfo source-reader to provide more informative + message when someone attempts to run tic on a compiled terminal + description (prompted by Debian #593920). + + note in infotocap and captoinfo manpages that they read terminal + descriptions from text-files (Debian #593920). + + improve acsc string for vt52, show arrow keys (patch by Benjamin + Sittler). + +20100814 + + document in manpages that "mv" functions first use wmove() to check + the window pointer and whether the position lies within the window + (suggested by Poul-Henning Kamp). + + fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch + by Tim van der Molen). + + modify configure script to transform library names for tic- and + tinfo-libraries so that those build properly with Mac OS X shared + library configuration. + + modify configure script to ensure that it removes conftest.dSYM + directory leftover on checks with Mac OS X. + + modify configure script to cleanup after check for symbolic links. + +20100807 + + correct a typo in mk-1st.awk (patch by Gabriele Balducci) + (cf: 20100724) + + improve configure checks for location of tic and infocmp programs + used for installing database and for generating fallback data, + e.g., for cross-compiling. + + add Markus Kuhn's wcwidth function for compiling MinGW + + add special case to CF_REGEX for cross-compiling to MinGW target. + +20100731 + + modify initialization check for win32con driver to eliminate need for + special case for TERM "unknown", using terminal database if available + (prompted by discussion with Roumen Petrov). + + for MinGW port, ensure that terminal driver is setup if tgetent() + is called (patch by Roumen Petrov). + + document tabs "-0" and "-8" options in manpage. + + fix Debian "lintian" issues with manpages reported in + http://lintian.debian.org/full/csmall@debian.org.html#ncurses + +20100724 + + add a check in tic for missing set_tab if clear_all_tabs given. + + improve use of symbolic links in makefiles by using "-f" option if + it is supported, to eliminate temporary removal of the target + (prompted by http://www.t2-project.org/packages/ncurses.html) + + minor improvement to test/ncurses.c, reset color pairs in 'd' test + after exit from 'm' main-menu command. + + improved ncu-indent, from mawk changes, allows more than one of + GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line. + +20100717 + + add hard-reset for rs2 to wsvt25 to help ensure that reset ends + the alternate character set (patch by Nicholas Marriott) + + remove tar-copy.sh and related configure/Makefile chunks, since the + Ada95 binding is now installed using rules in Ada95/src. + +20100703 + + continue integrating changes to use gnatmake project files in Ada95 + + add/use configure check to turn on project rules for Ada95/src. + + revert the vfork change from 20100130, since it does not work. + +20100626 + + continue integrating changes to use gnatmake project files in Ada95 + + old gnatmake (3.15) does not produce libraries using project-file; + work around by adding script to generate alternate makefile. + +20100619 + + continue integrating changes to use gnatmake project files in Ada95 + + add configure --with-ada-sharedlib option, for the test_make rule. + + move Ada95-related logic into aclocal.m4, since additional checks + will be needed to distinguish old/new implementations of gnat. + +20100612 + + start integrating changes to use gnatmake project files in Ada95 tree + + add test_make / test_clean / test_install rules in Ada95/src + + change install-path for adainclude directory to /usr/share/ada (was + /usr/lib/ada). + + update Ada95/configure. + + add mlterm+256color entry, for mlterm 3.0.0 -TD + + modify test/configure to use macros to ensure consistent order + of updating LIBS variable. + +20100605 + + change search order of options for Solaris in CF_SHARED_OPTS, to + work with 64-bit compiles. + + correct quoting of assignment in CF_SHARED_OPTS case for aix + (cf: 20081227) + +20100529 + + regenerated html documentation. + + modify test/configure to support pkg-config for checking X libraries + used by PDCurses. + + add/use configure macro CF_ADD_LIB to force consistency of + assignments to $LIBS, etc. + + fix configure script for combining --with-pthread + and --enable-weak-symbols options. + +20100522 + + correct cross-compiling configure check for CF_MKSTEMP macro, by + adding a check cache variable set by AC_CHECK_FUNC (report by + Pierre Labastie). + + simplify include-dependencies of make_hash and make_keys, to reduce + the need for setting BUILD_CPPFLAGS in cross-compiling when the + build- and target-machines differ. + + repair broken-linker configuration by restoring a definition of SP + variable to curses.priv.h, and adjusting for cases where sp-funcs + are used. + + improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment + variable to override (prompted by report by Pablo Cazallas). + +20100515 + + add configure option --enable-pthreads-eintr to control whether the + new EINTR feature is enabled. + + modify logic in pthread configuration to allow EINTR to interrupt + a read operation in wgetch() (Novell #540571, patch by Werner Fink). + + drop mkdirs.sh, use "mkdir -p". + + add configure option --disable-libtool-version, to use the + "-version-number" feature which was added in libtool 1.5 (report by + Peter Haering). The default value for the option uses the newer + feature, which makes libraries generated using libtool compatible + with the standard builds of ncurses. + + updated test/configure to match configure script macros. + + fixes for configure script from lynx changes: + + improve CF_FIND_LINKAGE logic for the case where a function is + found in predefined libraries. + + revert part of change to CF_HEADER (cf: 20100424) + +20100501 + + correct limit-check in wredrawln, accounting for begy/begx values + (patch by David Benjamin). + + fix most compiler warnings from clang. + + amend build-fix for OpenSolaris, to ensure that a system header is + included in curses.h before testing feature symbols, since they + may be defined by that route. + +20100424 + + fix some strict compiler warnings in ncurses library. + + modify configure macro CF_HEADER_PATH to not look for variations in + the predefined include directories. + + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work + with gcc 4.x's c89 alias, which gives warning messages for cases + where older versions would produce an error. + +20100417 + + modify _nc_capcmp() to work with cancelled strings. + + correct translation of "^" in _nc_infotocap(), used to transform + terminfo to termcap strings + + add configure --disable-rpath-hack, to allow disabling the feature + which adds rpath options for libraries in unusual places. + + improve CF_RPATH_HACK_2 by checking if the rpath option for a given + directory was already added. + + improve CF_RPATH_HACK_2 by using ldd to provide a standard list of + directories (which will be ignored). + +20100410 + + improve win_driver.c handling of mouse: + + discard motion events + + avoid calling _nc_timed_wait when there is a mouse event + + handle 4th and "rightmost" buttons. + + quote substitutions in CF_RPATH_HACK_2 configure macro, needed for + cases where there are embedded blanks in the rpath option. + +20100403 + + add configure check for exctags vs ctags, to work around pkgsrc. + + simplify logic in _nc_get_screensize() to make it easier to see how + environment variables may override system- and terminfo-values + (prompted by discussion with Igor Bujna). + + make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose. + + improve handling of color-pairs embedded in attributes for the + extended-colors configuration. + + modify MKlib_gen.sh to build link_test with sp-funcs. + + build-fixes for OpenSolaris aka Solaris 11, for wide-character + configuration as well as for rpath feature in *-config scripts. + +20100327 + + refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more + reusable. + + improve configure CF_REGEX, similar fixes. + + improve configure CF_FIND_LINKAGE, adding add check between system + (default) and explicit paths, where we can find the entrypoint in the + given library. + + add check if Gpm_Open() returns a -2, e.g., for "xterm". This is + normally suppressed but can be overridden using $NCURSES_GPM_TERMS. + Ensure that Gpm_Close() is called in this case. + +20100320 + + rename atari and st52 terminfo entries to atari-old, st52-old, use + newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan + Hourihane). + +20100313 + + modify install-rule for manpages so that *-config manpages will + install when building with --srcdir (report by Sven Joachim). + + modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks + option is not the same as --disable-leaks (GenToo #305889). + + modify #define's for build-compiler to suppress cchar_t symbol from + compile of make_hash and make_keys, improving cross-compilation of + ncursesw (report by Bernhard Rosenkraenzer). + + modify CF_MAN_PAGES configure macro to replace all occurrences of + TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders + Kaseorg). + +20100306 + + generate manpages for the *-config scripts, adapted from help2man + (suggested by Sven Joachim). + + use va_copy() in _nc_printf_string() to avoid conflicting use of + va_list value in _nc_printf_length() (report by Wim Lewis). + +20100227 + + add Ada95/configure script, to use in tar-file created by + Ada95/make-tar.sh + + fix typo in wresize.3x (patch by Tim van der Molen). + + modify screen-bce.XXX entries to exclude ech, since screen's color + model does not clear with color for that feature -TD + +20100220 + + add make-tar.sh scripts to Ada95 and test subdirectories to help with + making those separately distributable. + + build-fix for static libraries without dlsym (Debian #556378). + + fix a syntax error in man/form_field_opts.3x (patch by Ingo + Schwarze). + +20100213 + + add several screen-bce.XXX entries -TD + +20100206 + + update mrxvt terminfo entry -TD + + modify win_driver.c to support mouse single-clicks. + + correct name for termlib in ncurses*-config, e.g., if it is renamed + to provide a single file for ncurses/ncursesw libraries (patch by + Miroslav Lichvar). + +20100130 + + use vfork in test/ditto.c if available (request by Mike Frysinger). + + miscellaneous cleanup of manpages. + + fix typo in curs_bkgd.3x (patch by Tim van der Molen). + + build-fix for --srcdir (patch by Miroslav Lichvar). + +20100123 + + for term-driver configuration, ensure that the driver pointer is + initialized in setupterm so that terminfo/termcap programs work. + + amend fix for Debian #542031 to ensure that wattrset() returns only + OK or ERR, rather than the attribute value (report by Miroslav + Lichvar). + + reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making + _nc_screen_of() compatible between normal/wide libraries again (patch + by Miroslav Lichvar) + + review/fix include-dependencies in modules files (report by Miroslav + Lichvar). + +20100116 + + modify win_driver.c to initialize acs_map for win32 console, so + that line-drawing works. + + modify win_driver.c to initialize TERMINAL struct so that programs + such as test/lrtest.c and test/ncurses.c which test string + capabilities can run. + + modify term-driver modules to eliminate forward-reference + declarations. + +20100109 + + modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS + consistently to add new -D's while removing duplicates. + + modify a few configure macros to consistently put new options + before older in the list. + + add tiparm(), based on review of X/Open Curses Issue 7. + + minor documentation cleanup. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + (caveat - its maintainer put 2010 copyright date on files dated 2009) + +20100102 + + minor improvement to tic's checking of similar SGR's to allow for the + most common case of SGR 0. + + modify getmouse() to act as its documentation implied, returning on + each call the preceding event until none are left. When no more + events remain, it will return ERR. + +20091227 + + change order of lookup in progs/tput.c, looking for terminfo data + first. This fixes a confusion between termcap "sg" and terminfo + "sgr" or "sgr0", originally from 990123 changes, but exposed by + 20091114 fixes for hashing. With this change, only "dl" and "ed" are + ambiguous (Mandriva #56272). + +20091226 + + add bterm terminfo entry, based on bogl 0.1.18 -TD + + minor fix to rxvt+pcfkeys terminfo entry -TD + + build-fixes for Ada95 tree for gnat 4.4 "style". + +20091219 + + remove old check in mvderwin() which prevented moving a derived + window whose origin happened to coincide with its parent's origin + (report by Katarina Machalkova). + + improve test/ncurses.c to put mouse droppings in the proper window. + + update minix terminfo entry -TD + + add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler) + +20091212 + + correct transfer of multicolumn characters in multirow + field_buffer(), which stopped at the end of the first row due to + filling of unused entries in a cchar_t array with nulls. + + updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta) + + modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character + nulls. + + use strdup() in set_menu_mark(), restore .marklen struct member on + failure. + + eliminate clause 3 from the UCB copyrights in read_termcap.c and + tset.c per + ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + (patch by Nicholas Marriott). + + replace a malloc in tic.c with strdup, checking for failure (patch by + Nicholas Marriott). + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + +20091205 + + correct layout of working window used to extract data in + wide-character configured by set_field_buffer (patch by Rafael + Garrido Fernandez) + + improve some limit-checks related to filename length in reading and + writing terminfo entries. + + ensure that filename is always filled in when attempting to read + a terminfo entry, so that infocmp can report the filename (patch + by Nicholas Marriott). + +20091128 + + modify mk-1st.awk to allow tinfo library to be built when term-driver + is enabled. + + add error-check to configure script to ensure that sp-funcs is + enabled if term-driver is, since some internal interfaces rely upon + this. + +20091121 + + fix case where progs/tput is used while sp-funcs is configure; this + requires save/restore of out-character function from _nc_prescreen + rather than the SCREEN structure (report by Charles Wilson). + + fix typo in man/curs_trace.3x which caused incorrect symbolic links + + improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT. + +20091114 + + + updated man/curs_trace.3x + + limit hashing for termcap-names to 2-characters (Ubuntu #481740). + + change a variable name in lib_newwin.c to make it clearer which + value is being freed on error (patch by Nicholas Marriott). + +20091107 + + improve test/ncurses.c color-cycling test by reusing attribute- + and color-cycling logic from the video-attributes screen. + + add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form + library which help make it compatible with interop applications + (patch by Juergen Pfeifer). + + add configure option --enable-interop, for integrating changes + for generic/interop support to form-library by Juergen Pfeifer + +20091031 + + modify use of $CC environment variable which is defined by X/Open + as a curses feature, to ignore it if it is not a single character + (prompted by discussion with Benjamin C W Sittler). + + add START_TRACE in slk_init + + fix a regression in _nc_ripoffline which made test/ncurses.c not show + soft-keys, broken in 20090927 merging. + + change initialization of "hidden" flag for soft-keys from true to + false, broken in 20090704 merging (Ubuntu #464274). + + update nsterm entries (patch by Benjamin C W Sittler, prompted by + discussion with Fabian Groffen in GenToo #206201). + + add test/xterm-256color.dat + +20091024 + + quiet some pedantic gcc warnings. + + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a + SIGWINCH, and discard that value, to avoid confusing application + (patch by Eygene Ryabinkin, FreeBSD bin/136223). + +20091017 + + modify handling of $PKG_CONFIG_LIBDIR to use only the first item in + a possibly colon-separated list (Debian #550716). + +20091010 + + supply a null-terminator to buffer in _nc_viswibuf(). + + fix a sign-extension bug in unget_wch() (report by Mike Gran). + + minor fixes to error-returns in default function for tputs, as well + as in lib_screen.c + +20091003 + + add WACS_xxx definitions to wide-character configuration for thick- + and double-lines (discussion with Slava Zanko). + + remove unnecessary kcan assignment to ^C from putty (Sven Joachim) + + add ccc and initc capabilities to xterm-16color -TD + > patch by Benjamin C W Sittler: + + add linux-16color + + correct initc capability of linux-c-nc end-of-range + + similar change for dg+ccc and dgunix+ccc + +20090927 + + move leak-checking for comp_captab.c into _nc_leaks_tinfo() since + that module since 20090711 is in libtinfo. + + add configure option --enable-term-driver, to allow compiling with + terminal-driver. That is used in MinGW port, and (being somewhat + more complicated) is an experimental alternative to the conventional + termlib internals. Currently, it requires the sp-funcs feature to + be enabled. + + completed integrating "sp-funcs" by Juergen Pfeifer in ncurses + library (some work remains for forms library). + +20090919 + + document return code from define_key (report by Mike Gran). + + make some symbolic links in the terminfo directory-tree shorter + (patch by Daniel Jacobowitz, forwarded by Sven Joachim).). + + fix some groff warnings in terminfo.5, etc., from recent Debian + changes. + + change ncv and op capabilities in sun-color terminfo entry to match + Sun's entry for this (report by Laszlo Peter). + + improve interix smso terminfo capability by using reverse rather than + bold (report by Kristof Zelechovski). + +20090912 + + add some test programs (and make these use the same special keys + by sharing linedata.h functions): + test/test_addstr.c + test/test_addwstr.c + test/test_addchstr.c + test/test_add_wchstr.c + + correct internal _nc_insert_ch() to use _nc_insert_wch() when + inserting wide characters, since the wins_wch() function that it used + did not update the cursor position (report by Ciprian Craciun). + +20090906 + + fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not + work. + + add null-pointer checks to other opaque-functions. + + add is_pad() and is_subwin() functions for opaque access to WINDOW + (discussion with Mark Dickinson). + + correct merge to lib_newterm.c, which broke when sp-funcs was + enabled. + +20090905 + + build-fix for building outside source-tree (report by Sven Joachim). + + fix Debian lintian warning for man/tabs.1 by making section number + agree with file-suffix (report by Sven Joachim). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090829 + + workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on + amd64 (Debian #542031). + + fix typo in curs_mouse.3x (Debian #429198). + +20090822 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090815 + + correct use of terminfo capabilities for initializing soft-keys, + broken in 20090509 merging. + + modify wgetch() to ensure it checks SIGWINCH when it gets an error + in non-blocking mode (patch by Clemens Ladisch). + + use PATH_SEPARATOR symbol when substituting into run_tic.sh, to + help with builds on non-Unix platforms such as OS/2 EMX. + + modify scripting for misc/run_tic.sh to test configure script's + $cross_compiling variable directly rather than comparing host/build + compiler names (prompted by comment in GenToo #249363). + + fix configure script option --with-database, which was coded as an + enable-type switch. + + build-fixes for --srcdir (report by Frederic L W Meunier). + +20090808 + + separate _nc_find_entry() and _nc_find_type_entry() from + implementation details of hash function. + +20090803 + + add tabs.1 to man/man_db.renames + + modify lib_addch.c to compensate for removal of wide-character test + from unctrl() in 20090704 (Debian #539735). + +20090801 + + improve discussion in INSTALL for use of system's tic/infocmp for + cross-compiling and building fallbacks. + + modify test/demo_termcap.c to correspond better to options in + test/demo_terminfo.c + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + fix logic for 'V' in test/ncurses.c tests f/F. + +20090728 + + correct logic in tigetnum(), which caused tput program to treat all + string capabilities as numeric (report by Rajeev V Pillai, + cf: 20090711). + +20090725 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090718 + + fix a null-pointer check in _nc_format_slks() in lib_slk.c, from + 20070704 changes. + + modify _nc_find_type_entry() to use hashing. + + make CCHARW_MAX value configurable, noting that changing this would + change the size of cchar_t, and would be ABI-incompatible. + + modify test-programs, e.g,. test/view.c, to address subtle + differences between Tru64/Solaris and HPUX/AIX getcchar() return + values. + + modify length returned by getcchar() to count the trailing null + which is documented in X/Open (cf: 20020427). + + fixes for test programs to build/work on HPUX and AIX, etc. + +20090711 + + improve performance of tigetstr, etc., by using hashing code from tic. + + minor fixes for memory-leak checking. + + add test/demo_terminfo, for comparison with demo_termcap + +20090704 + + remove wide-character checks from unctrl() (patch by Clemens Ladisch). + + revise wadd_wch() and wecho_wchar() to eliminate dependency on + unctrl(). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090627 + + update llib-lncurses[wt] to use sp-funcs. + + various code-fixes to build/work with --disable-macros configure + option. + + add several new files from Juergen Pfeifer which will be used when + integration of "sp-funcs" is complete. This includes a port to + MinGW. + +20090613 + + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to + make includes of term.h without curses.h work (report by "Nix"). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090607 + + fix a regression in lib_tputs.c, from ongoing merges. + +20090606 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090530 + + fix an infinite recursion when adding a legacy-coding 8-bit value + using insch() (report by Clemens Ladisch). + + free home-terminfo string in del_curterm() (patch by Dan Weber). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090523 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090516 + + work around antique BSD game's manipulation of stdscr, etc., versus + SCREEN's copy of the pointer (Debian #528411). + + add a cast to wattrset macro to avoid compiler warning when comparing + its result against ERR (adapted from patch by Matt Kraii, Debian + #528374). + +20090510 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090502 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + add vwmterm terminfo entry (patch by Bryan Christ). + +20090425 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090419 + + build fix for _nc_free_and_exit() change in 20090418 (report by + Christian Ebert). + +20090418 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090411 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + This change finishes merging for menu and panel libraries, does + part of the form library. + +20090404 + + suppress configure check for static/dynamic linker flags for gcc on + Darwin (report by Nelson Beebe). + +20090328 + + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving + function key definitions from emx-base for consistency -TD + + correct missing final 'p' in pfkey capability of ansi.sys-old (report + by Kalle Olavi Niemitalo). + + improve test/ncurses.c 'F' test, show combining characters in color. + + quiet a false report by cppcheck in c++/cursesw.cc by eliminating + a temporary variable. + + use _nc_doalloc() rather than realloc() in a few places in ncurses + library to avoid leak in out-of-memory condition (reports by William + Egert and Martin Ettl based on cppcheck tool). + + add --with-ncurses-wrap-prefix option to test/configure (discussion + with Charles Wilson). + + use ncurses*-config scripts if available for test/configure. + + update test/aclocal.m4 and test/configure + > patches by Charles Wilson: + + modify CF_WITH_LIBTOOL configure check to allow unreleased libtool + version numbers (e.g. which include alphabetic chars, as well as + digits, after the final '.'). + + improve use of -no-undefined option for libtool by setting an + intermediate variable LT_UNDEF in the configure script, and then + using that in the libtool link-commands. + + fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk + from 2009031 changes. + + improve mk-1st.awk script by writing separate cases for the + LIBTOOL_LINK command, depending on which library (ncurses, ticlib, + termlib) is to be linked. + + modify configure.in to allow broken-linker configurations, not just + enable-reentrant, to set public wrap prefix. + +20090321 + + add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to + build with tic and term libraries (patch by Charles Wilson). + + add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX + (report by Charles Wilson). + + fix definition for c++/Makefile.in's SHLIB_LIST, which did not list + the form, menu or panel libraries (patch by Charles Wilson). + + add configure option --with-wrap-prefix to allow setting the prefix + for functions used to wrap global variables to something other than + "_nc_" (discussion with Charles Wilson). + +20090314 + + modify scripts to generate ncurses*-config and pc-files to add + dependency for tinfo library (patch by Charles Wilson). + + improve comparison of program-names when checking for linked flavors + such as "reset" by ignoring the executable suffix (reports by Charles + Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing + list). + + suppress configure check for static/dynamic linker flags for gcc on + Solaris 10, since gcc is confused by absence of static libc, and + does not switch back to dynamic mode before finishing the libraries + (reports by Joel Bertrand, Alan Pae). + + minor fixes to Intel compiler warning checks in configure script. + + modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works. + + modify set_curterm() to make broken-linker configuration work with + changes from 20090228 (report by Charles Wilson). + +20090228 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + modify declaration of cur_term when broken-linker is used, but + enable-reentrant is not, to match pre-5.7 (report by Charles Wilson). + +20090221 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090214 + + add configure script --enable-sp-funcs to enable the new set of + extended functions. + + start integrating patches by Juergen Pfeifer: + + add extended functions which specify the SCREEN pointer for several + curses functions which use the global SP (these are incomplete; + some internals work is needed to complete these). + + add special cases to configure script for MinGW port. + +20090207 + + update several configure macros from lynx changes + + append (not prepend) to CFLAGS/CPPFLAGS + + change variable from PATHSEP to PATH_SEPARATOR + + improve install-rules for pc-files (patch by Miroslav Lichvar). + + make it work with $DESTDIR + + create the pkg-config library directory if needed. + +20090124 + + modify init_pair() to allow caller to create extra color pairs beyond + the color_pairs limit, which use default colors (request by Emanuele + Giaquinta). + + add misc/terminfo.tmp and misc/*.pc to "sources" rule. + + fix typo "==" where "=" is needed in ncurses-config.in and + gen-pkgconfig.in files (Debian #512161). + +20090117 + + add -shared option to MK_SHARED_LIB when -Bsharable is used, for + *BSD's, without which "main" might be one of the shared library's + dependencies (report/analysis by Ken Dickey). + + modify waddch_literal(), updating line-pointer after a multicolumn + character is found to not fit on the current row, and wrapping is + done. Since the line-pointer was not updated, the wrapped + multicolumn character was written to the beginning of the current row + (cf: 20041023, reported by "Nick" regarding problem with ncmpc + http://musicpd.org/mantis/bug_view_page.php?bug_id=1930). + +20090110 + + add screen.Eterm terminfo entry (GenToo #124887) -TD + + modify adacurses-config to look for ".ali" files in the adalib + directory. + + correct install for Ada95, which omitted libAdaCurses.a used in + adacurses-config + + change install for adacurses-config to provide additional flavors + such as adacursesw-config, for ncursesw (GenToo #167849). + +20090105 + + remove undeveloped feature in ncurses-config.in for setting + prefix variable. + + recent change to ncurses-config.in did not take into account the + --disable-overwrite option, which sets $includedir to the + subdirectory and using just that for a -I option does not work - fix + (report by Frederic L W Meunier). + +20090104 + + modify gen-pkgconfig.in to eliminate a dependency on rpath when + deciding whether to add $LIBS to --libs output; that should be shown + for the ncurses and tinfo libraries without taking rpath into + account. + + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk, + used in static libraries (report by Marty Jack). + +20090103 + + add a configure-time check to pick a suitable value for + CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen). + + add configure --with-pkg-config and --enable-pc-files options, along + with misc/gen-pkgconfig.in which can be used to generate ".pc" files + for pkg-config (request by Jan Engelhardt). + + use $includedir symbol in misc/ncurses-config.in, add --includedir + option. + + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a + configure check to detect whether a "-" is needed before "ar" + options. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + +20081227 + + modify mk-1st.awk to work with extra categories for tinfo library. + + modify configure script to allow building shared libraries with gcc + on AIX 5 or 6 (adapted from patch by Lital Natan). + +20081220 + + modify to omit the opaque-functions from lib_gen.o when + --disable-ext-funcs is used. + + add test/clip_printw.c to illustrate how to use printw without + wrapping. + + modify ncurses 'F' test to demo wborder_set() with colored lines. + + modify ncurses 'f' test to demo wborder() with colored lines. + +20081213 + + add check for failure to open hashed-database needed for db4.6 + (GenToo #245370). + + corrected --without-manpages option; previous change only suppressed + the auxiliary rules install.man and uninstall.man + + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from + GenToo #250454). + + fixes from NetBSD port at + http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches + patch-ac (build-fix for DragonFly) + patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config). + + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH + by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the + search-lists. + + correct title string for keybound manpage (patch by Frederic Culot, + OpenBSD documentation/6019), + +20081206 + + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to + work for progs/clear, progs/tabs, etc. + + correct buffer-size after internal resizing of wide-character + set_field_buffer(), broken in 20081018 changes (report by Mike Gran). + + add "-i" option to test/filter.c to tell it to use initscr() rather + than newterm(), to investigate report on comp.unix.programmer that + ncurses would clear the screen in that case (it does not - the issue + was xterm's alternate screen feature). + + add check in mouse-driver to disable connection if GPM returns a + zero, indicating that the connection is closed (Debian #506717, + adapted from patch by Samuel Thibault). + +20081129 + + improve a workaround in adding wide-characters, when a control + character is found. The library (cf: 20040207) uses unctrl() to + obtain a printable version of the control character, but was not + passing color or video attributes. + + improve test/ncurses.c 'a' test, using unctrl() more consistently to + display meta-characters. + + turn on _XOPEN_CURSES definition in curses.h + + add eterm-color entry (report by Vincent Lefevre) -TD + + correct use of key_name() in test/ncurses.c 'A' test, which only + displays wide-characters, not key-codes since 20070612 (report by + Ricardo Cantu). + +20081122 + + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and + Ada95 (patch by Juergen Pfeifer). + + document in TO-DO an issue with Cygwin's package for GNAT (report + by Mike Dennison). + + improve error-checking of command-line options in "tabs" program. + +20081115 + + change several terminfo entries to make consistent use of ANSI + clear-all-tabs -TD + + add "tabs" program (prompted by Debian #502260). + + add configure --without-manpages option (request by Mike Frysinger). + 20081102 5.7 release for upload to ftp.gnu.org 20081025 @@ -77,7 +1059,7 @@ it is not possible to add this information. overlooked til now. 20081011 - + update html documentation. + + regenerated html documentation. + add -m and -s options to test/keynames.c and test/key_names.c to test the meta() function with keyname() or key_name(), respectively. + correct return value of key_name() on error; it is null. @@ -2204,7 +3186,7 @@ it is not possible to add this information. (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., - #define NCURSES_ENABLE_STDBOOL_H 0 + #define NCURSES_ENABLE_STDBOOL_H 0 #include (discussion on XFree86 mailing list). @@ -2784,7 +3766,7 @@ it is not possible to add this information. 20030208 + add checking in tic for incomplete line-drawing character mapping. - + update configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, + + updated configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda ). + make return value from _nc_printf_string() consistent. Before, @@ -3503,7 +4485,7 @@ it is not possible to add this information. + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. - + update configure macro CF_WITH_PATHLIST, to omit some double quotes + + updated configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) diff --git a/README.MinGW b/README.MinGW new file mode 100644 index 00000000000..d111b387784 --- /dev/null +++ b/README.MinGW @@ -0,0 +1,149 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 2008-2010,2011 Free 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: README.MinGW,v 1.5 2011/02/26 16:57:17 tom Exp $ +-- Author: Juergen Pfeifer +------------------------------------------------------------------------------- + +This is work in progress, but it's in an state where one can see it +works at least on the Windows Console. + +You should install the MSYS package, so that you've a shell environment that +allows you to run the scripts, especially configure etc. You can get that +from http://www.mingw.org + +To build ncurses for native Windows, you need the MinGW toolchain. The +original MinGW toolchain from the above site is only for 32-Bit Windows. As +Windows Server - and also regular workstations - are moving to 64-Bit, it +seems to be reasonable to have a toolchain that supports both architectures. +I recommend to use the TDM gcc toolchain which you can find at +http://tdm-gcc.tdragon.net/download. Go to the download section and select +the bundle installer for tdm64 (MinGW-w64). This installs a multilib version +of the gcc toolchain that can compile for native 32- and 64-Bit Windows +versions. It also comes with a working pthread implementation. + +The latest config and build scripts we use for MinGW have only been tested +for the gcc-4.4 compiler toolchain (or better). + +Using MinGW is a pragmatic decision, it's the easiest way to port this +heavily UNIX based sourcebase to native Windows. The goal is of course +to provide the includes, libraries and DLLs to be used with the more +common traditional development environments on Windows, mainly with +Microsoft Visual Studio. + +If you start a bash from the MSYS environment, please make sure that the +Microsoft Development tools are in your PATH right after the MinGW +tools. The LIB.EXE tool is the only one needed. You need this only if +you want to build DLLs that work with native Windows programs. If you +don't have any Microsoft Development tools on your machine, consider +at least to get the free "Visual C++ 2010 Express Edition". +It contains the LIB.EXE tool. You may also use this compiler to test +writing native Windows programs using the ncurses DLLs without using +MinGW then for writing apps. + +It is necessary to unset the TERM environment variable, to activate the +Windows console-driver. + +Please also make sure that MSYS links to the correct directory containing +your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows +CMD.EXE command shell go to the MSYS root directory (most probably +C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw +that points to the MinGW toolchain directory. If not, delete the mingw +directory and use the mklink command (or the linkd.exe utility on older +Windows) to create the junction point. + +This code requires WindowsNT 5.1 or better, which means on the client +Windows XP or better, on the server Windows Server 2003 or better. + +In order to build ncurses for the planned interop layer with .NET, we +recommend to use these options with configure + + --disable-home-terminfo + --enable-reentrant + --enable-sp-funcs + --enable-term-driver + --enable-interop + --with-pthread (if using TDM toolchain as recommended) + +This is the configuration commandline as I'm using it at the moment: + +./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread + +If you are on a 64-Bit Windows system and want to build a 32-Bit version +of ncurses, you may use this commandline for configuration (when using +the TDM toolchain): + +CC="gcc -m32" LD="ld -m32" ./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread + +All the options above are - like the whole Windows support - +experimental. + +In order to build the DLLs, after your regular make you must call + + make dlls + +A lot is still TODO, e.g.: + + - Wide Character support + The Win32Con driver should actually only use Unicode in the + future. + - Thread support (locking). If using TDM toolchain this is done by + configuring pthreads. + - A GUI console driver + - Support for Terminals attached via a serial port (via terminfo) + - Support for networked Terminal connections (via terminfo) + - Workarounds for MinGW's filesystem access are necessary to make infocmp + work (though tic works). + +To support terminfo, we need to have an ioctl() simulation for the +serial and networked Terminals. diff --git a/TO-DO b/TO-DO index ca47d02d0ec..ae780b438e3 100644 --- a/TO-DO +++ b/TO-DO @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $ +-- $Id: TO-DO,v 1.56 2011/02/26 16:58:53 tom Exp $ ------------------------------------------------------------------------------- SHORT-TERM TO-DO ITEMS: @@ -45,7 +45,7 @@ Known Problems: + Scrolling optimization has holes: for example, it forces repaints of the screen between calls to refresh(). -+ SVr4 uses slightly different rules for determining when softkeys are shown. ++ SVr4 uses slightly different rules for determining when softkeys are shown. For example, they are initially displayed (before the ncurses 'e' test activates them), and a touchwin can apparently also force them to be displayed. @@ -58,7 +58,7 @@ Known Problems: + The window classes defined in the c++ subdirectory need documentation. Some C++ programmer could earn a lot of good karma by doing this... -+ vid_attr() should support the set_a_attributes (sgr1) string, but does not. ++ vid_attr() should support the set_a_attributes (sgr1) string, but does not. There appear to be no terminals that require that functionality. + the configure --disable-ext-funcs option does not work for Ada95 tree. @@ -66,33 +66,52 @@ Known Problems: + the --with-pthread configuration builds for Cygwin, but does not work properly (test/worm.c shows all of the worms in the same location). ++ the Ada95 tree may require a small fix to build on Cygwin, since the GNAT + port to that platform for 3.4.4 provides an incomplete Interrupts.Names + package. For instance (your gcc version may be different): + /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads + + cut here... +------------------------------------------------------------------------------- +--- a-intnam.ads.orig 2003-10-21 13:41:51.000000000 +0000 ++++ a-intnam.ads 2007-05-05 22:40:02.609375000 +0000 +@@ -44,5 +44,6 @@ + + DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1; + DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2; ++ SIGINT : constant Interrupt_ID := 2; + + end Ada.Interrupts.Names; +------------------------------------------------------------------------------- + + the --enable-rpath configure option builds for the corresponding platforms; however combining it with --with-ticlib and --with-termlib does not always produce libraries that can be run without setting environment variables. Building those with libtool does not work either. (This is a problem with the BSD platforms). ++ more work is needed to make the MinGW port support ordinary terminals. + Portability (or lack thereof): + Users of older System V UNIXes (but not Solaris, and probably not SVr4) may trip over a known problem with the signal-handling code which causes abrupt termination of ncurses applications following resume from a ^Z suspend (this problem was first seen running lynx). You will not see this problem if you - are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or - BSDI. For details, see the analysis in the header comment of - ncurses/tty/lib_tstp.c . + are using one of the 4.4BSD derivatives like such as, NetBSD, or BSDI, or + systems using that convention. For details, see the analysis in the header + comment of ncurses/tty/lib_tstp.c . + In theory, vwprintw and vwscanf are supposed to use the older varargs.h interface for handling variadic argument lists (and are deprecated by X/Open - for that reason). Linux doesn't have varargs.h, it has the newer - X/Open-standard stdargs.h equivalent. So these functions use stdargs - instead. This is unlikely to be a problem unless you're building ncurses on - a System V old enough to only have varargs.h. (Solaris 2.5.1 used the - stdarg.h binding as well). + for that reason). Many newer systems do no have varargs.h, instead they have + only the newer X/Open-standard stdargs.h equivalent. So these functions use + stdargs instead. This is unlikely to be a problem unless you're building + ncurses on a System V old enough to only have varargs.h. (Solaris 2.5.1 used + the stdarg.h binding as well). -+ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have - a native vsscanf(3) in its library, vwscanw() will not work. You lose. (It - should work on any System V, however). If you want to fix this, add an ++ If you're using a system old enough not to have a native vsscanf(3) in its + library, vwscanw() will not work. If you want to fix this, add an implementation to ncurses/vsscanf.c. + The C++ binding fails to build with a few C++ compilers. @@ -122,7 +141,7 @@ supporting internationalization. 2. DOS port Only a few of the files in the library depend on the terminfo format. -It should be possible to further kernelize the package, then rewrite +It should be possible to further kernelize the package, then rewrite a small number of core files to produce a functionally-compatible port that would do updates to a memory-mapped screen area. The first result of this would be a DOS port. @@ -195,10 +214,10 @@ F. Unused VDT capabilities: move_insert, dest_tabs_magic_smso, transparent_underline, needs_xon_xoff, hard_cursor. Numerics: lines_of_memory, buttons. - Strings: pkey_key, pkey_local, pkey_xmit, underline_char, - enter_xon_mode, exit_xon_mode, xon_character, xoff_character, + Strings: pkey_key, pkey_local, pkey_xmit, underline_char, + enter_xon_mode, exit_xon_mode, xon_character, xoff_character, display_clock, remove_clock, user[0-5], display_pc_char, - enter_scancode_mode, exit_scancode_mode, pc_term_options, + enter_scancode_mode, exit_scancode_mode, pc_term_options, scancode_escape, alt_scancode_esc. These are the potentially important ones for ncurses. Notes: diff --git a/aclocal.m4 b/aclocal.m4 index 4c8e818f240..06a636a7a9b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2010,2011 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 * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.470 2008/10/25 22:15:32 tom Exp $ +dnl $Id: aclocal.m4,v 1.549 2011/02/21 01:40:21 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -62,13 +62,13 @@ AC_DEFUN([AM_LANGINFO_CODESET], fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. AC_DEFUN([CF_ADA_INCLUDE_DIRS], [ -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -86,7 +86,15 @@ fi AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30 +dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18 +dnl --------------- +dnl Add to $ADAFLAGS, which is substituted into makefile and scripts. +AC_DEFUN([CF_ADD_ADAFLAGS],[ + ADAFLAGS="$ADAFLAGS $1" + AC_SUBST(ADAFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -112,8 +120,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -128,6 +136,12 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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" ;; esac @@ -143,24 +157,24 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) + CPPFLAGS="$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)]) + ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi @@ -168,7 +182,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 +dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 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, @@ -195,7 +209,7 @@ if test -n "$1" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS @@ -211,11 +225,11 @@ if test -n "$1" ; then if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) - ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)" + ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -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" + 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 @@ -225,7 +239,15 @@ if test -n "$1" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34 +dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 +dnl ---------- +dnl Add a library, used to enforce consistency. +dnl +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 ------------- dnl Adds to the library-path dnl @@ -254,14 +276,22 @@ if test -n "$1" ; then 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)" + ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59 +dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl ----------- +dnl Add one or more libraries, used to enforce consistency. +dnl +dnl $1 = libraries to add, with the "-l", etc. +dnl $2 = variable to update (default $LIBS) +AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -273,7 +303,7 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "$4" != "$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { +ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" @@ -283,13 +313,13 @@ ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { } ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 +dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 dnl ---------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ -AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -353,7 +383,89 @@ You have the following choices: fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_AWK_BIG_PRINTF version: 2 updated: 2008/10/04 17:16:18 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 +dnl -------------- +dnl Allow user to disable a normally-on option. +AC_DEFUN([CF_ARG_DISABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 +dnl ------------- +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus +dnl values. +dnl +dnl Parameters: +dnl $1 = option name +dnl $2 = help-string +dnl $3 = action to perform if option is not default +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 +ifelse([$3],,[ :]dnl +,[ $3]) ifelse([$4],,,[ + else + $4]) + fi],[enableval=$5 ifelse([$4],,,[ + $4 +])dnl + ])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29 +dnl ----------- +dnl Check for suitable "ar" (archiver) options for updating an archive. +AC_DEFUN([CF_AR_FLAGS],[ +AC_REQUIRE([CF_PROG_AR]) + +AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do + + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&AC_FD_CC + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + CF_VERBOSE(cannot compile test-program) + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext +]) + +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags +fi + +AC_SUBST(ARFLAGS) +]) +dnl --------------------------------------------------------------------------- +dnl CF_AWK_BIG_PRINTF version: 3 updated: 2008/12/27 12:30:03 dnl ----------------- dnl Check if awk can handle big strings using printf. Some older versions of dnl awk choke on large strings passed via "%s". @@ -362,19 +474,19 @@ dnl $1 = desired string size dnl $2 = variable to set with result AC_DEFUN([CF_AWK_BIG_PRINTF], [ - case x$AWK in #(vi - x) - eval $2=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval $2=yes - else - eval $2=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval $2=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval $2=yes + else + eval $2=no + fi + ;; + esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18 @@ -695,7 +807,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22 +dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it @@ -713,7 +825,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ #include #include #include ], - ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1, + ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) @@ -724,7 +836,7 @@ if test "$cf_cv_dcl_$1" = no ; then fi # It's possible (for near-UNIX clones) that the data doesn't exist -CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2)) +CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 @@ -752,7 +864,7 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_GPM_WGETCH version: 1 updated: 2007/04/28 14:38:06 +dnl CF_CHECK_GPM_WGETCH version: 2 updated: 2010/08/14 18:25:37 dnl ------------------- dnl Check if GPM is already linked with curses. If so - and if the linkage dnl is not "weak" - warn about this because it can create problems linking @@ -786,7 +898,7 @@ CF_EOF test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -f conftest* + rm -rf conftest* LIBS="$cf_save_LIBS" fi ]) @@ -887,7 +999,7 @@ fi test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50 +dnl CF_C_INLINE version: 3 updated: 2010/05/01 15:14:41 dnl ----------- dnl Check if the C compiler supports "inline". dnl $1 is the name of a shell variable to set if inline is supported @@ -902,7 +1014,7 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[ + AC_CACHE_CHECK(if $CC supports options to tune inlining,cf_cv_gcc_inline,[ cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=$2" AC_TRY_COMPILE([inline int foo(void) { return 1; }], @@ -945,7 +1057,7 @@ done AC_SUBST(DIRS_TO_MAKE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 4 updated: 2006/12/16 15:10:42 +dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -958,27 +1070,71 @@ AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], - [with_no_leaks=yes], + [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], : ${with_no_leaks:=no}) AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then AC_DEFINE(NO_LEAKS) + AC_DEFINE(YY_NO_LEAKS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_RPATH version: 1 updated: 2008/09/13 10:22:30 +dnl CF_DISABLE_LIBTOOL_VERSION version: 1 updated: 2010/05/15 15:45:59 +dnl -------------------------- +dnl Check if we should use the libtool 1.5 feature "-version-number" instead of +dnl the older "-version-info" feature. The newer feature allows us to use +dnl version numbering on shared libraries which make them compatible with +dnl various systems. +AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION], +[ +AC_MSG_CHECKING(if libtool -version-number should be used) +CF_ARG_DISABLE(libtool-version, + [ --disable-libtool-version enable to use libtool's incompatible naming scheme], + [cf_libtool_version=no], + [cf_libtool_version=yes]) +AC_MSG_RESULT($cf_libtool_version) + +if test "$cf_libtool_version" = yes ; then + LIBTOOL_VERSION="-version-number" +else + LIBTOOL_VERSION="-version-info" +fi + +AC_SUBST(LIBTOOL_VERSION) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33 +dnl --------------------- +dnl The rpath-hack makes it simpler to build programs, particularly with the +dnl *BSD ports which may have essential libraries in unusual places. But it +dnl can interfere with building an executable for the base system. Use this +dnl option in that case. +AC_DEFUN([CF_DISABLE_RPATH_HACK], +[ +AC_MSG_CHECKING(if rpath-hack should be disabled) +CF_ARG_DISABLE(rpath-hack, + [ --disable-rpath-hack don't add rpath options for additional libraries], + [cf_disable_rpath_hack=yes], + [cf_disable_rpath_hack=no]) +AC_MSG_RESULT($cf_disable_rpath_hack) +if test "$cf_disable_rpath_hack" = no ; then + CF_RPATH_HACK +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42 dnl --------------- dnl Check if the rpath option should be used, setting cache variable -dnl cf_cv_ld_rpath if so. +dnl cf_cv_enable_rpath if so. AC_DEFUN([CF_ENABLE_RPATH], [ AC_MSG_CHECKING(if rpath option should be used) AC_ARG_ENABLE(rpath, [ --enable-rpath use rpath option when generating shared libraries], -[cf_cv_ld_rpath=$enableval], -[cf_cv_ld_rpath=no]) -AC_MSG_RESULT($cf_cv_ld_rpath) +[cf_cv_enable_rpath=$enableval], +[cf_cv_enable_rpath=no]) +AC_MSG_RESULT($cf_cv_enable_rpath) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 @@ -1019,7 +1175,7 @@ AC_MSG_RESULT($cf_result) CXXFLAGS="$cf_save_CXXFLAGS" ]) dnl --------------------------------------------------------------------------- -dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53 +dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 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. @@ -1048,10 +1204,26 @@ cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) -AC_TRY_LINK([$1],[$2], - cf_cv_find_linkage_$3=yes,[ - cf_cv_find_linkage_$3=no +cf_save_LIBS="$LIBS" +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib +],[ + +LIBS="-l$3 $7 $cf_save_LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib + cf_cv_library_file_$3="-l$3" +],[ + 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" @@ -1110,7 +1282,6 @@ AC_TRY_LINK([$1],[$2], ]) fi done - LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -1119,19 +1290,22 @@ AC_TRY_LINK([$1],[$2], cf_cv_find_linkage_$3=no fi ],$7) +]) + +LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ - CF_ADD_INCDIR($cf_cv_header_path_$3) - CF_ADD_LIBDIR($cf_cv_library_path_$3) - LIBS="-l$3 $LIBS" + CF_ADD_INCDIR($cf_cv_header_path_$3) + CF_ADD_LIBDIR($cf_cv_library_path_$3) + CF_ADD_LIB($3) ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_DLSYM version: 1 updated: 2004/06/16 20:52:45 +dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02 dnl ------------- dnl Test for dlsym() and related functions, as well as libdl. dnl @@ -1148,7 +1322,7 @@ AC_CHECK_LIB(dl,dlsym,[ cf_have_libdl=yes])]) if test "$cf_have_dlsym" = yes ; then - test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" + test "$cf_have_libdl" = yes && CF_ADD_LIB(dl) AC_MSG_CHECKING(whether able to link to dl*() functions) AC_TRY_LINK([#include ],[ @@ -1231,7 +1405,7 @@ int main() { test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP) ]) dnl --------------------------------------------------------------------------- -dnl CF_FUNC_OPENPTY version: 2 updated: 2008/04/12 19:49:01 +dnl CF_FUNC_OPENPTY version: 3 updated: 2010/05/29 16:31:02 dnl --------------- dnl Check for openpty() function, along with header. It may need the dnl "util" library as well. @@ -1240,7 +1414,7 @@ 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 && LIBS="-lutil $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([ @@ -1362,7 +1536,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 +dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1389,7 +1563,7 @@ if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) cat > conftest.$ac_ext <&AC_FD_CC - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <>conftest.ads <>conftest.ads <&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ - sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` AC_MSG_RESULT($cf_gnat_version) -case $cf_gnat_version in - 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; -esac -case $cf_gnat_version in - 3.[[1-9]]*|[[4-9]].*) - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; +case $cf_gnat_version in #(vi +3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) + cf_cv_prog_gnat_correct=no + ;; esac + +CF_GNAT_GENERICS +CF_GNAT_PROJECTS ]) dnl --------------------------------------------------------------------------- dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07 @@ -1679,7 +1974,7 @@ make an error test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46 +dnl CF_GPP_LIBRARY version: 10 updated: 2010/05/29 16:31:02 dnl -------------- dnl If we're trying to use g++, test if libg++ is installed (a rather common dnl problem :-). If we have the compiler but no library, we'll be able to @@ -1698,13 +1993,13 @@ esac if test "$GXX" = yes; then AC_MSG_CHECKING([for lib$cf_gpp_libname]) cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname) AC_TRY_LINK([ #include <$cf_gpp_libname/builtin.h> ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname,CXXLIBS) if test "$cf_gpp_libname" = cpp ; then AC_DEFINE(HAVE_GPP_BUILTIN_H) else @@ -1715,7 +2010,7 @@ if test "$GXX" = yes; then ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname,CXXLIBS) AC_DEFINE(HAVE_BUILTIN_H)], [cf_cxx_library=no])]) LIBS="$cf_save" @@ -1723,7 +2018,7 @@ if test "$GXX" = yes; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_VERSION version: 5 updated: 2005/08/27 09:53:42 +dnl CF_GXX_VERSION version: 6 updated: 2010/10/23 15:44:18 dnl -------------- dnl Check for version of g++ AC_DEFUN([CF_GXX_VERSION],[ @@ -1731,13 +2026,13 @@ AC_REQUIRE([AC_PROG_CPP]) GXX_VERSION=none if test "$GXX" = yes; then AC_MSG_CHECKING(version of g++) - GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown AC_MSG_RESULT($GXX_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_WARNINGS version: 5 updated: 2005/08/13 14:54:38 +dnl CF_GXX_WARNINGS version: 6 updated: 2010/08/14 18:25:37 dnl --------------- dnl Check if the compiler supports useful warning options. dnl @@ -1848,12 +2143,12 @@ then CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -f conftest* +rm -rf conftest* AC_LANG_RESTORE AC_SUBST(EXTRA_CXXFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB version: 3 updated: 2007/11/24 17:43:37 +dnl CF_HASHED_DB version: 4 updated: 2010/05/29 16:31:02 dnl ------------ dnl Look for an instance of the Berkeley hashed database. dnl @@ -1880,7 +2175,7 @@ else if test "$cf_cv_hashed_db_libs" = unknown ; then AC_MSG_ERROR(Cannot determine library for db) elif test "$cf_cv_hashed_db_libs" != default ; then - LIBS="-l$cf_cv_hashed_db_libs $LIBS" + CF_ADD_LIB($cf_cv_hashed_db_libs) fi fi ],[ @@ -1888,7 +2183,7 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB_LIBS version: 8 updated: 2008/08/04 06:18:06 +dnl CF_HASHED_DB_LIBS version: 9 updated: 2010/05/29 16:31:02 dnl ----------------- dnl Given that we have the header and version for hashed database, find the dnl library information. @@ -1900,7 +2195,7 @@ for cf_db_libs in "" db$cf_cv_hashed_db_version db-$cf_cv_hashed_db_version db ' do cf_save_libs="$LIBS" if test -n "$cf_db_libs"; then - LIBS="-l$cf_db_libs $LIBS" + CF_ADD_LIB($cf_db_libs) fi CF_MSG_LOG(checking for library "$cf_db_libs") AC_TRY_LINK([ @@ -1998,11 +2293,35 @@ done ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59 +dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 dnl -------------- -dnl Construct a search-list for a nonstandard header-file +dnl Construct a search-list of directories for a nonstandard header-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name AC_DEFUN([CF_HEADER_PATH], -[CF_SUBDIR_PATH($1,$2,include) +[ +$1= + +# 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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) + cf_header_path_list="$cf_header_path_list [$]$1" + ;; + esac + done +fi + +# add the variations for the package we are looking for +CF_SUBDIR_PATH($1,$2,include) + test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { @@ -2017,6 +2336,7 @@ test -d "$oldincludedir" && { test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" } +$1="[$]$1 $cf_header_path_list" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 @@ -2026,7 +2346,7 @@ AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40 dnl --------------- dnl Construct the list of include-options according to whether we're building dnl in the source directory or using '--srcdir=DIR' option. If we're building @@ -2034,9 +2354,9 @@ dnl with gcc, don't append the includedir if it happens to be /usr/include, dnl since that usually breaks gcc's shadow-includes. AC_DEFUN([CF_INCLUDE_DIRS], [ -CPPFLAGS="-I. -I../include $CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then - CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -2052,7 +2372,7 @@ fi AC_SUBST(CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29 +dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 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 @@ -2066,24 +2386,24 @@ dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ -ifelse($2,,INTEL_COMPILER,[$2])=no +ifelse([$2],,INTEL_COMPILER,[$2])=no -if test "$ifelse($1,,[$1],GCC)" = yes ; then +if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in 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" + 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" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif -],[ifelse($2,,INTEL_COMPILER,[$2])=yes +],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" ],[]) - ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS" - AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2])) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi @@ -2143,7 +2463,7 @@ ifdef([AC_FUNC_FSEEKO],[ ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LDFLAGS_STATIC version: 4 updated: 2008/10/18 17:58:20 +dnl CF_LDFLAGS_STATIC version: 8 updated: 2010/10/23 14:39:56 dnl ----------------- dnl Check for compiler/linker flags used to temporarily force usage of static dnl libraries. This depends on the compiler and platform. Use this to help @@ -2153,7 +2473,7 @@ AC_DEFUN([CF_LDFLAGS_STATIC],[ if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[[45]]*) #( vi + OS/2*|os2*|aix[[4]]*|solaris2.1[[0-9]]|darwin*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -2164,7 +2484,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[[45]]*) #( from ld manpage + aix[[456]]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -2179,7 +2499,7 @@ else ;; osf[[45]]*) #( from ld manpage osf4.0d, osf5.1 # alternative "-oldstyle_liblookup" (not in cc manpage) - LDFLAGS_STATIC=-noso + LDFLAGS_STATIC=-noso LDFLAGS_SHARED=-so_archive ;; solaris2*) @@ -2189,15 +2509,134 @@ else esac fi +if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" +then + AC_MSG_CHECKING(if linker supports switching between static/dynamic) + + rm -f libconftest.a + cat >conftest.$ac_ext < +int cf_ldflags_static(FILE *fp) { return fflush(fp); } +EOF + if AC_TRY_EVAL(ac_compile) ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&AC_FD_CC 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&AC_FD_CC >/dev/null + fi + rm -f conftest.* + + cf_save_LIBS="$LIBS" + + LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" + AC_TRY_LINK([ +#line __oline__ "configure" +#include +int cf_ldflags_static(FILE *fp); +],[ + return cf_ldflags_static(stdin); +],[cf_ldflags_static=yes],[cf_ldflags_static=no]) + + rm -f libconftest.* + LIBS="$cf_save_LIBS" + + AC_MSG_RESULT($cf_ldflags_static) + + if test $cf_ldflags_static != yes + then + LDFLAGS_STATIC= + LDFLAGS_SHARED= + fi +else + LDFLAGS_STATIC= + LDFLAGS_SHARED= +fi + AC_SUBST(LDFLAGS_STATIC) AC_SUBST(LDFLAGS_SHARED) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59 +dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 dnl --------------- -dnl Construct a search-list for a nonstandard library-file +dnl For the given system and compiler, find the compiler flags to pass to the +dnl loader to use the "rpath" feature. +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 + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[[2-9]].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +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) + +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 +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 +dnl --------------- +dnl Construct a search-list of directories for a nonstandard library-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name AC_DEFUN([CF_LIBRARY_PATH], -[CF_SUBDIR_PATH($1,$2,lib)])dnl +[ +$1= +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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) + cf_library_path_list="$cf_library_path_list [$]$1" + ;; + esac + done +fi + +CF_SUBDIR_PATH($1,$2,lib) + +$1="$cf_library_path_list [$]$1" +])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 dnl ------------- @@ -2216,7 +2655,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59 +dnl CF_LIB_RULES version: 61 updated: 2010/10/23 16:10:30 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -2239,6 +2678,23 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi +if test -n "$TINFO_SUFFIX" ; then + case $TINFO_SUFFIX in + tw*) + TINFO_NAME="${TINFO_NAME}tw" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` + ;; + t*) + TINFO_NAME="${TINFO_NAME}t" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` + ;; + w*) + TINFO_NAME="${TINFO_NAME}w" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` + ;; + esac +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -2257,6 +2713,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${REL_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -2273,6 +2737,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -2393,6 +2865,16 @@ do if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in + tw*) + cf_libname=`echo $cf_libname | sed 's/tw$//'` + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_dir_suffix=tw + ;; + t*) + cf_libname=`echo $cf_libname | sed 's/t$//'` + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_dir_suffix=t + ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -2410,17 +2892,19 @@ do prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink-no} \ + ReLink=${cf_cv_do_relink:-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ + libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -2504,18 +2988,28 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile </dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.` test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown fi fi -rm -f conftest* +rm -rf conftest* LIBS="$cf_save_LIBS" fi ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 15 updated: 2008/09/13 11:54:48 +dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name @@ -2689,40 +3184,44 @@ dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_SUFFIX], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - case $1 in - libtool) + case $1 in #(vi + libtool) #(vi $2='.la' $3=[$]$2 ;; - normal) + normal) #(vi $2='.a' $3=[$]$2 ;; - debug) + debug) #(vi $2='_g.a' $3=[$]$2 ;; - profile) + profile) #(vi $2='_p.a' $3=[$]$2 ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[[56]]*) #(vi + $2='.a' + $3=[$]$2 + ;; + cygwin*) #(vi $2='.dll' $3='.dll.a' ;; - darwin*) + darwin*) #(vi $2='.dylib' $3=[$]$2 ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi $2='.so' $3=[$]$2 ;; - *) + *) #(vi $2='.sl' $3=[$]$2 ;; @@ -2755,7 +3254,7 @@ AC_DEFUN([CF_LIB_TYPE], test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 8 updated: 2006/12/16 12:33:30 +dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll @@ -2772,7 +3271,7 @@ int testdata[[3]] = { 123, 456, 789 }; EOF if AC_TRY_EVAL(ac_compile) ; then mv conftest.o data.o && \ - ( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null + ( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null + ( $AR $ARFLAGS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null @@ -2887,7 +3386,7 @@ AC_DEFUN([CF_MAIN_RETURN], cf_cv_main_return=return ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03 +dnl CF_MAKEFLAGS version: 13 updated: 2010/10/23 15:52:32 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. @@ -2904,10 +3403,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -2927,16 +3426,20 @@ CF_EOF AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40 +dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have dnl a monocase filesystem. AC_DEFUN([CF_MAKE_TAGS],[ AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) -AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no) + +AC_CHECK_PROGS(CTAGS, exctags ctags) +AC_CHECK_PROGS(ETAGS, exetags etags) + +AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) if test "$cf_cv_mixedcase" = yes ; then - AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) + AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) else MAKE_UPPER_TAGS=no fi @@ -2946,17 +3449,21 @@ if test "$MAKE_UPPER_TAGS" = yes ; then else MAKE_UPPER_TAGS="#" fi -AC_SUBST(MAKE_UPPER_TAGS) if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi + +AC_SUBST(CTAGS) +AC_SUBST(ETAGS) + +AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34 +dnl CF_MANPAGE_FORMAT version: 9 updated: 2010/10/23 16:10:30 dnl ----------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases: @@ -2998,7 +3505,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -3112,7 +3619,7 @@ AC_MSG_RESULT($MANPAGE_RENAMES) AC_SUBST(MANPAGE_RENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58 +dnl CF_MANPAGE_SYMLINKS version: 5 updated: 2010/07/24 17:12:40 dnl ------------------- dnl Some people expect each tool to make all aliases for manpages in the dnl man-directory. This accommodates the older, less-capable implementations @@ -3128,11 +3635,14 @@ AC_ARG_WITH(manpage-aliases, AC_MSG_RESULT($MANPAGE_ALIASES) -if test "$LN_S" = "ln -s"; then +case "x$LN_S" in #(vi +xln*) #(vi cf_use_symlinks=yes -else + ;; +*) cf_use_symlinks=no -fi + ;; +esac MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then @@ -3171,7 +3681,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29 +dnl CF_MAN_PAGES version: 39 updated: 2010/10/23 15:44:18 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -3214,7 +3724,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) #(vi +*gzip*) cf_so_strip="gz" cf_compress=gzip ;; @@ -3237,14 +3747,12 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" - INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR-/tmp}/man\$\$ +TMP=\${TMPDIR:=/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\[$]1 @@ -3282,7 +3790,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - \$MKDIRS \$cf_subdir\$section + mkdir -p \$cf_subdir\$section fi fi @@ -3302,7 +3810,7 @@ CF_EOF cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name, + s,@$cf_NAME@,$cf_name,g CF_EOF done ]) @@ -3431,8 +3939,21 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -3491,7 +4012,7 @@ chmod 755 $cf_edit_man ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10 +dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02 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 @@ -3504,13 +4025,13 @@ AC_CACHE_CHECK(if -lm needed for math functions, #include #include ], - [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)], + [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])]) if test "$cf_cv_need_libm" = yes then ifelse($1,,[ - LIBS="$LIBS -lm" + CF_ADD_LIB(m) ],[$1=-lm]) fi ]) @@ -3545,13 +4066,13 @@ fi test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 5 updated: 2006/12/16 12:33:30 +dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ -rm -f conftest* +rm -rf conftest* AC_TRY_RUN([ #include #include @@ -3590,17 +4111,17 @@ int main() ],[AC_CHECK_FUNC(mkstemp) ]) ]) -if test "$cf_cv_func_mkstemp" = yes ; then +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then AC_DEFINE(HAVE_MKSTEMP) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12 +dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ -echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49 @@ -3687,20 +4208,20 @@ AC_DEFUN([CF_OBJ_SUBDIR], esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53 +dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42 dnl ---------- dnl Provide a value for the $PATH and similar separator AC_DEFUN([CF_PATHSEP], [ case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; esac -ifelse($1,,,[$1=$PATHSEP]) - AC_SUBST(PATHSEP) +ifelse([$1],,,[$1=$PATH_SEPARATOR]) + AC_SUBST(PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59 +dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 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 @@ -3732,12 +4253,44 @@ case ".[$]$1" in #(vi $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; *) - ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10 +dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24 +dnl ------------- +dnl Check for the package-config program, unless disabled by command-line. +AC_DEFUN([CF_PKG_CONFIG], +[ +AC_MSG_CHECKING(if you want to use pkg-config) +AC_ARG_WITH(pkg-config, + [ --with-pkg-config{=path} enable/disable use of pkg-config], + [cf_pkg_config=$withval], + [cf_pkg_config=yes]) +AC_MSG_RESULT($cf_pkg_config) + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + AC_PATH_TOOL(PKG_CONFIG, pkg-config, none) + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + CF_PATH_SYNTAX(PKG_CONFIG) +fi + +AC_SUBST(PKG_CONFIG) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -3753,7 +4306,7 @@ dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ -cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1) +cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -3805,17 +4358,12 @@ make an error if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56 +dnl CF_PREDEFINE version: 2 updated: 2010/05/26 16:44:57 dnl ------------ dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles. dnl @@ -3832,7 +4380,7 @@ make an error AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then - CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])" + CPPFLAGS="$CPPFLAGS ifelse([$2],,-D$1,[-D$1=$2])" elif test "x$2" != "x" ; then AC_MSG_CHECKING(checking for compatible value versus $2) AC_TRY_COMPILE([#include @@ -3872,6 +4420,13 @@ done ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 +dnl ---------- +dnl Check for archiver "ar". +AC_DEFUN([CF_PROG_AR],[ +AC_CHECK_TOOL(AR, ar, ar) +]) +dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. @@ -3881,7 +4436,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC_C_O version: 2 updated: 2006/12/16 15:55:46 +dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37 dnl -------------- dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that dnl the output file can be renamed, and allows for a shell variable that can @@ -3911,7 +4466,7 @@ then else eval cf_cv_prog_$1_c_o=no fi -rm -f conftest* +rm -rf conftest* ])dnl if test $cf_cv_prog_$1_c_o = yes; then AC_MSG_RESULT([yes]) @@ -3985,6 +4540,39 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 +dnl ------------ +dnl Check for gnatmake, ensure that it is complete. +AC_DEFUN([CF_PROG_GNAT],[ +cf_ada_make=gnatmake +AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= +else + CF_GNAT_VERSION + AC_CHECK_PROG(M4_exists, m4, yes, no) + if test "$ac_cv_prog_M4_exists" = no; then + cf_cv_prog_gnat_correct=no + echo Ada95 binding required program m4 not found. Ada95 binding disabled. + fi + if test "$cf_cv_prog_gnat_correct" = yes; then + AC_MSG_CHECKING(if GNAT works) + CF_GNAT_TRY_RUN([procedure conftest;], +[with Text_IO; +with GNAT.OS_Lib; +procedure conftest is +begin + Text_IO.Put ("Hello World"); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (0); +end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) + AC_MSG_RESULT($cf_cv_prog_gnat_correct) + fi +fi + +AC_SUBST(cf_ada_make) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 dnl --------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -4003,7 +4591,7 @@ case $INSTALL in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55 +dnl CF_PROG_LDCONFIG version: 2 updated: 2008/12/13 14:08:40 dnl ---------------- dnl Check for ldconfig, needed to fixup shared libraries that would be built dnl and then used in the install. @@ -4012,7 +4600,7 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -freebsd*) #(vi +dragonfly*|freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin @@ -4023,49 +4611,117 @@ fi AC_SUBST(LDCONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 1 updated: 2006/09/16 11:40:59 +dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ -AC_CHECK_PROGS(LINT, tdlint lint alint) +AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01 +dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 +dnl ------------ +dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" +dnl option if it is supported. +AC_DEFUN([CF_PROG_LN_S],[ +AC_PROG_LN_S +AC_MSG_CHECKING(if $LN_S -f options work) + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +AC_MSG_RESULT($cf_prog_ln_sf) + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REGEX version: 8 updated: 2010/08/07 14:09:44 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression dnl code that we can support. AC_DEFUN([CF_REGEX], [ -AC_MSG_CHECKING([for regular-expression headers]) -AC_CACHE_VAL(cf_cv_regex,[ -AC_TRY_LINK([#include -#include ],[ - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - ],[cf_cv_regex="regex.h"],[ - AC_TRY_LINK([#include ],[ - char *p = compile("", "", "", 0); - int x = step("", ""); - ],[cf_cv_regex="regexp.h"],[ - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" - AC_TRY_LINK([#include ],[ - char *p = compile("", "", ""); - int x = step("", ""); - ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])]) + +cf_regex_func=no + +cf_regex_libs="regex re" +case $host_os in #(vi +mingw*) + cf_regex_libs="regex.dll $cf_regex_libs" + ;; +esac + +AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ + for cf_regex_lib in $cf_regex_libs + do + AC_CHECK_LIB($cf_regex_lib,regcomp,[ + CF_ADD_LIB($cf_regex_lib) + cf_regex_func=regcomp + break]) + done ]) -AC_MSG_RESULT($cf_cv_regex) -case $cf_cv_regex in - regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; - regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; - regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; + +if test "$cf_regex_func" = no ; then + AC_CHECK_FUNC(compile,[cf_regex_func=compile],[ + AC_CHECK_LIB(gen,compile,[ + CF_ADD_LIB(gen) + cf_regex_func=compile])]) +fi + +if test "$cf_regex_func" = no ; then + AC_MSG_WARN(cannot find regular expression library) +fi + +AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[ + +cf_cv_regex_hdrs=no +case $cf_regex_func in #(vi +compile) #(vi + for cf_regex_hdr in regexp.h regexpr.h + do + AC_TRY_LINK([#include <$cf_regex_hdr>],[ + char *p = compile("", "", "", 0); + int x = step("", ""); + ],[ + cf_cv_regex_hdrs=$cf_regex_hdr + break + ]) + done + ;; +*) + for cf_regex_hdr in regex.h + do + AC_TRY_LINK([#include +#include <$cf_regex_hdr>],[ + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + ],[ + cf_cv_regex_hdrs=$cf_regex_hdr + break + ]) + done + ;; +esac + +]) + +case $cf_cv_regex_hdrs in #(vi + no) AC_MSG_WARN(no regular expression header found) ;; #(vi + regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; #(vi + regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; #(vi + regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18 +dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all @@ -4077,10 +4733,9 @@ dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ -# remove $3 symbol from $2 $1=`echo "$2" | \ - sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \ - -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` + sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 @@ -4096,58 +4751,122 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK version: 4 updated: 2008/09/13 12:53:26 +dnl CF_RPATH_HACK version: 9 updated: 2011/02/13 13:31:33 dnl ------------- AC_DEFUN([CF_RPATH_HACK], [ -AC_REQUIRE([CF_SHARED_OPTS]) +AC_REQUIRE([CF_LD_RPATH_OPT]) AC_MSG_CHECKING(for updated LDFLAGS) -if test -n "$LDFLAGS" ; then -AC_MSG_RESULT(maybe) -CF_VERBOSE(...checking LDFLAGS $LDFLAGS) -CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) -case "$EXTRA_LDFLAGS" in #(vi --Wl,-rpath,*) #(vi - cf_rpath_hack="-Wl,-rpath," - ;; --R\ *) - cf_rpath_hack="-R " - ;; --R*) - cf_rpath_hack="-R" - ;; -*) - cf_rpath_hack= - ;; -esac -if test -n "$cf_rpath_hack" ; then - cf_rpath_dst= - for cf_rpath_src in $LDFLAGS - do - CF_VERBOSE(Filtering $cf_rpath_src) - case $cf_rpath_src in #(vi - -L*) #(vi - if test "$cf_rpath_hack" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` - fi - CF_VERBOSE(...Filter $cf_rpath_tmp) - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" - done - LDFLAGS=$cf_rpath_dst - CF_VERBOSE(...checked LDFLAGS $LDFLAGS) +if test -n "$LD_RPATH_OPT" ; then + AC_MSG_RESULT(maybe) + + AC_CHECK_PROGS(cf_ldd_prog,ldd,no) + cf_rpath_list="/usr/lib /lib" + if test "$cf_ldd_prog" != no + then + cf_rpath_oops= + +AC_TRY_LINK([#include ], + [printf("Hello");], + [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` + cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`]) + + # If we passed the link-test, but get a "not found" on a given library, + # this could be due to inept reconfiguration of gcc to make it only + # partly honor /usr/local/lib (or whatever). Sometimes this behavior + # is intentional, e.g., installing gcc in /usr/bin and suppressing the + # /usr/local libraries. + if test -n "$cf_rpath_oops" + then + for cf_rpath_src in $cf_rpath_oops + do + for cf_rpath_dir in \ + /usr/local \ + /usr/pkg \ + /opt/sfw + do + if test -f $cf_rpath_dir/lib/$cf_rpath_src + then + CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src) + LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" + break + fi + done + done + fi + fi + + CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) + + CF_RPATH_HACK_2(LDFLAGS) + CF_RPATH_HACK_2(LIBS) + CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS) fi -else -AC_MSG_RESULT(no) -fi +AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 53 updated: 2008/10/25 18:14:20 +dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24 +dnl --------------- +dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to +dnl EXTRA_LDFLAGS for each -L option found. +dnl +dnl $cf_rpath_list contains a list of directories to ignore. +dnl +dnl $1 = variable name to update. The LDFLAGS variable should be the only one, +dnl but LIBS often has misplaced -L options. +AC_DEFUN([CF_RPATH_HACK_2], +[ +CF_VERBOSE(...checking $1 [$]$1) + +cf_rpath_dst= +for cf_rpath_src in [$]$1 +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp) + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +$1=$cf_rpath_dst + +CF_VERBOSE(...checked $1 [$]$1) +AC_SUBST(EXTRA_LDFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4174,12 +4893,15 @@ dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + AC_REQUIRE([CF_LD_RPATH_OPT]) LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" AC_MSG_CHECKING(if release/abi version should be used for shared libs) AC_ARG_WITH(shlib-version, @@ -4218,11 +4940,17 @@ AC_DEFUN([CF_SHARED_OPTS], cf_cv_shlib_version_infix=no - case $cf_cv_system_name in - beos*) + case $cf_cv_system_name in #(vi + aix[[56]]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; - cygwin*) + cygwin*) #(vi CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' cf_cv_shlib_version=cygdll @@ -4239,9 +4967,9 @@ AC_DEFUN([CF_SHARED_OPTS], EOF exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} CF_EOF - chmod +x mk_shared_lib.sh + chmod +x mk_shared_lib.sh ;; - darwin*) + darwin*) #(vi EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' @@ -4256,7 +4984,7 @@ CF_EOF LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) + hpux*) #(vi # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -4269,15 +4997,9 @@ CF_EOF # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - if test "$GCC" = yes; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" - else - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" - fi + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -4288,54 +5010,50 @@ CF_EOF fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) + linux*|gnu*|k*bsd*-gnu) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - openbsd[[2-9]].*) + openbsd[[2-9]].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - nto-qnx*|openbsd*|freebsd[[12]].*) + nto-qnx*|openbsd*|freebsd[[12]].*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) + freebsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $[@]` -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]' ;; - netbsd*) + netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -4346,37 +5064,33 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${LD} -Bshareable -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]' fi ;; - osf*|mls+*) + osf*|mls+*) #(vi # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`' - case $host_os in + case $host_os in #(vi osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@' - if test "$cf_cv_ld_rpath" = yes ; then + if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -4384,7 +5098,7 @@ CF_EOF LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) + sunos4*) #(vi # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -4392,26 +5106,32 @@ CF_EOF MK_SHARED_LIB='${LD} -assert pure-text -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) + solaris2*) #(vi # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then - CC_SHARED_OPTS='-xcode=pic32' + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break]) + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' fi ;; - sysv5uw7*|unix_sv*) + sysv5uw7*|unix_sv*) #(vi # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -4428,7 +5148,7 @@ CF_EOF case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $[@]') + *'-o $[@]') #(vi test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) @@ -4439,17 +5159,11 @@ CF_EOF esac if test -n "$cf_ld_rpath_opt" ; then - AC_MSG_CHECKING(if we need a space after rpath option) - cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_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 && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi AC_SUBST(CC_SHARED_OPTS) + AC_SUBST(LD_RPATH_OPT) AC_SUBST(LD_SHARED_OPTS) AC_SUBST(MK_SHARED_LIB) AC_SUBST(LINK_PROGS) @@ -4642,7 +5356,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 18 updated: 2005/05/28 12:58:54 +dnl CF_SRC_MODULES version: 21 updated: 2010/09/04 17:37:40 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll @@ -4717,19 +5431,28 @@ AC_SUBST(TEST_DEPS) AC_SUBST(TEST_ARG2) AC_SUBST(TEST_DEP2) -SRC_SUBDIRS="man include" +SRC_SUBDIRS= +if test "x$cf_with_manpages" != xno ; then + SRC_SUBDIRS="$SRC_SUBDIRS man" +fi +SRC_SUBDIRS="$SRC_SUBDIRS include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS test" +if test "x$cf_with_tests" != "xno" ; then + SRC_SUBDIRS="$SRC_SUBDIRS test" +fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src" + if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" + fi fi SUB_MAKEFILES= @@ -4739,15 +5462,15 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done - AC_SUBST(ADA_SUBDIRS) + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done + AC_SUBST(ADA_SUBDIRS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52 +dnl CF_STDCPP_LIBRARY version: 7 updated: 2010/05/29 16:31:02 dnl ----------------- dnl Check for -lstdc++, which is GNU's standard C++ library. AC_DEFUN([CF_STDCPP_LIBRARY], @@ -4763,7 +5486,7 @@ os2*) #(vi esac AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + CF_ADD_LIB($cf_stdcpp_libname) AC_TRY_LINK([ #include ],[ char buf[80]; @@ -4773,7 +5496,7 @@ strstreambuf foo(buf, sizeof(buf)) [cf_cv_libstdcpp=no]) LIBS="$cf_save" ]) -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CF_ADD_LIB($cf_stdcpp_libname,CXXLIBS) fi ])dnl dnl --------------------------------------------------------------------------- @@ -4846,14 +5569,15 @@ if test "$ac_cv_header_termios_h" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12 +dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], -[$1="" +[ +$1= CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) @@ -5048,7 +5772,7 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52 +dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], @@ -5070,10 +5794,40 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H) CF_ADD_INCDIR($cf_cv_header_path_utf8) CF_ADD_LIBDIR($cf_cv_library_path_utf8) - LIBS="-lutf8 $LIBS" + CF_ADD_LIBS($cf_cv_library_file_utf8) fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29 +dnl ---------- +dnl check for va_copy, part of stdarg.h +dnl Also, workaround for glibc's __va_copy, by checking for both. +AC_DEFUN([CF_VA_COPY],[ +AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + va_copy(dst, src)], + cf_cv_have_va_copy=yes, + cf_cv_have_va_copy=no)]) + +test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY) + +AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + __va_copy(dst, src)], + cf_cv_have___va_copy=yes, + cf_cv_have___va_copy=no)]) + +test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY) +]) +dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings @@ -5082,7 +5836,7 @@ AC_DEFUN([CF_VERBOSE], CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20 +dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57 dnl ------------- dnl Check if type wide-character type $1 is declared, and if so, which header dnl file is needed. The second parameter is used to set a shell variable when @@ -5118,7 +5872,7 @@ if test "$cf_cv_$1" = yes ; then NEED_WCHAR_H=1 fi -ifelse($2,,,[ +ifelse([$2],,,[ # if we do not find $1 in either place, use substitution to provide a fallback. if test "$cf_cv_$1" = unknown ; then $2=1 @@ -5178,7 +5932,76 @@ $1_ABI=$cf_cv_abi_version ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05 +dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 +dnl -------------------- +dnl Command-line option to specify the Ada95 compiler. +AC_DEFUN([CF_WITH_ADA_COMPILER],[ +AC_MSG_CHECKING(for ada-compiler) +AC_ARG_WITH(ada-compiler, + [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], + [cf_ada_compiler=$withval], + [cf_ada_compiler=gnatmake]) +AC_SUBST(cf_ada_compiler) +AC_MSG_RESULT($cf_ada_compiler) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada includes will install. +AC_DEFUN([CF_WITH_ADA_INCLUDE],[ +AC_MSG_CHECKING(for ada-include) +CF_WITH_PATH(ada-include, + [ --with-ada-include=DIR Ada includes are in DIR], + ADA_INCLUDE, + PREFIX/share/ada/adainclude, + [$]prefix/share/ada/adainclude) +AC_SUBST(ADA_INCLUDE) +AC_MSG_RESULT($ADA_INCLUDE) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada objects will install. +AC_DEFUN([CF_WITH_ADA_OBJECTS],[ +AC_MSG_CHECKING(for ada-objects) +CF_WITH_PATH(ada-objects, + [ --with-ada-objects=DIR Ada objects are in DIR], + ADA_OBJECTS, + PREFIX/lib/ada/adalib, + [$]prefix/lib/ada/adalib) +AC_SUBST(ADA_OBJECTS) +AC_MSG_RESULT($ADA_OBJECTS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58 +dnl --------------------- +dnl Command-line option to specify if an Ada95 shared-library should be built, +dnl and optionally what its soname should be. +AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ +AC_MSG_CHECKING(if an Ada95 shared-library should be built) +AC_ARG_WITH(ada-sharedlib, + [ --with-ada-sharedlib=XX build Ada95 shared-library], + [with_ada_sharedlib=$withval], + [with_ada_sharedlib=no]) +AC_MSG_RESULT($with_ada_sharedlib) + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + +AC_SUBST(ADA_SHAREDLIB) +AC_SUBST(MAKE_ADA_SHAREDLIB) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. @@ -5189,11 +6012,11 @@ CF_NO_LEAKS_OPTION(dbmalloc, if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, - [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))]) + [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05 +dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. @@ -5204,7 +6027,7 @@ CF_NO_LEAKS_OPTION(dmalloc, if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, - [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))]) + [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- @@ -5241,7 +6064,7 @@ if test "$with_gpm" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_LIBTOOL version: 19 updated: 2008/03/29 15:46:43 +dnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24 dnl --------------- dnl Provide a configure option to incorporate libtool. Define several useful dnl symbols for the makefile rules. @@ -5261,22 +6084,23 @@ dnl elif test ! -f $ACLOCAL/libtool.m4 ; then dnl echo cannot find libtool.m4 file dnl exit 1 dnl fi -dnl +dnl dnl LOCAL=aclocal.m4 dnl ORIG=aclocal.m4.orig -dnl +dnl dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15 dnl rm -f $ORIG dnl mv $LOCAL $ORIG -dnl +dnl dnl # sed the LIBTOOL= assignment to omit the current directory? -dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL +dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL dnl cat $ORIG >>$LOCAL -dnl +dnl dnl autoconf-257 $* dnl AC_DEFUN([CF_WITH_LIBTOOL], [ +AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION]) ifdef([AC_PROG_LIBTOOL],,[ LIBTOOL= ]) @@ -5306,17 +6130,17 @@ ifdef([AC_PROG_LIBTOOL],[ AC_PROG_LIBTOOL # missing_content_AC_PROG_LIBTOOL}} ],[ - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then CF_PATH_SYNTAX(with_libtool) LIBTOOL=$with_libtool else - AC_PATH_PROG(LIBTOOL,libtool) - fi - if test -z "$LIBTOOL" ; then - AC_MSG_ERROR(Cannot find libtool) - fi + AC_PATH_PROG(LIBTOOL,libtool) + fi + if test -z "$LIBTOOL" ; then + AC_MSG_ERROR(Cannot find libtool) + fi ])dnl - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -5331,16 +6155,25 @@ ifdef([AC_PROG_LIBTOOL],[ # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. + # bug reports it might be useful to have the original string. "(" cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'` AC_MSG_RESULT($cf_cv_libtool_version) if test -z "$cf_cv_libtool_version" ; then AC_MSG_ERROR(This is not GNU libtool) fi + # special hack to add -no-undefined (which libtool should do for itself) + LT_UNDEF= + case "$cf_cv_system_name" in #(vi + cygwin*|mingw32*|uwin*|aix[[456]]) #(vi + LT_UNDEF=-no-undefined + ;; + esac + AC_SUBST([LT_UNDEF]) + # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[[5-9]]*|[[2-9]]*) + case $cf_cv_libtool_version in #(vi + 1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*) #(vi LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -5372,7 +6205,7 @@ AC_SUBST(LIB_UNINSTALL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35 +dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. @@ -5384,16 +6217,16 @@ dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], -[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl -if ifelse($5,,true,[test -n "$5"]) ; then +[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, +ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl +if ifelse([$5],,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30 +dnl CF_WITH_PATHLIST version: 7 updated: 2010/10/23 16:10:30 dnl ---------------- dnl Process an option specifying a list of colon-separated paths. dnl @@ -5407,9 +6240,9 @@ dnl AC_DEFUN([CF_WITH_PATHLIST],[ AC_REQUIRE([CF_PATHSEP]) AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl +ifelse($4,,[withval=${$3}],[withval=${$3:-ifelse($5,,$4,$5)}]))dnl -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5435,7 +6268,7 @@ AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05 +dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -5453,7 +6286,7 @@ if test "$with_pthread" != no ; then AC_MSG_CHECKING(if we can link with the pthread library) cf_save_LIBS="$LIBS" - LIBS="-lpthread $LIBS" + CF_ADD_LIB(pthread) AC_TRY_LINK([ #include ],[ @@ -5463,7 +6296,7 @@ if test "$with_pthread" != no ; then AC_MSG_RESULT($with_pthread) if test "$with_pthread" = yes ; then - LIBS="-lpthread $LIBS" + CF_ADD_LIB(pthread) AC_DEFINE(HAVE_LIBPTHREADS) else AC_MSG_ERROR(Cannot link with pthread library) @@ -5535,7 +6368,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57 +dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 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, @@ -5546,14 +6379,22 @@ 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([CF_PROG_CC_U_D]) - -cf_XOPEN_SOURCE=ifelse($1,,500,$1) -cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) +cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) +cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) +cf_xopen_source= case $host_os in #(vi -aix[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" +aix[[456]]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; +darwin[[0-8]].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -5561,15 +6402,18 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[[56]].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; -linux*|gnu*|k*bsd*-gnu) #(vi +linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi @@ -5582,16 +6426,19 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" +solaris2.1[[0-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[[1-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ @@ -5614,11 +6461,14 @@ make an error if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_ADD_CFLAGS($cf_temp_xopen_source) fi CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac + +if test -n "$cf_xopen_source" ; then + CF_ADD_CFLAGS($cf_xopen_source) +fi ]) diff --git a/announce.html.in b/announce.html.in index 1d4121ee4ff..da9298a298d 100644 --- a/announce.html.in +++ b/announce.html.in @@ -1,8 +1,8 @@ - + - - -Announcing ncurses @VERSION@ - - - - -

Announcing ncurses @VERSION@

+ + + -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

+ Announcing ncurses @VERSION@ + + + -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and encouraged the keepers of -Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to -ncurses.

+ +

Announcing ncurses @VERSION@

The ncurses (new curses) + library is a free software emulation of curses in System V + Release 4.0, and more. It uses terminfo format, supports pads and + color and multiple highlights and forms characters and + function-key mapping, and has all the other SYSV-curses + enhancements over BSD curses. -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

+

In mid-June 1995, the maintainer of 4.4BSD curses declared + that he considered 4.4BSD curses obsolete, and encouraged the + keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to + switch over to ncurses.

-The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

+

The ncurses code was developed under GNU/Linux. It has been in + use for some time with OpenBSD as the system curses library, and + on FreeBSD and NetBSD as an external package. It should port + easily to any ANSI/POSIX-conforming UNIX. It has even been ported + to OS/2 Warp!

-The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . +

The distribution includes the library and support utilities, + including a terminfo compiler tic(1), a decompiler infocmp(1), + clear(1), tput(1), tset(1), and a termcap conversion tool + captoinfo(1). Full manual pages are provided for the library and + tools.

-

Release Notes

+

The ncurses distribution is available via anonymous FTP at the + GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
-This release is designed to be upward compatible from ncurses 5.0 through 5.6; -very few applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.6 release. -

-Interface changes: -

-New features and improvements: -
    -
  • library -
      -
    • new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are - reentrant, but most require either a window-level or - screen-level mutex.
      - (This is API-compatible, - but not ABI-compatible with the normal library). +

      Release Notes

      This release is designed to be upward + compatible from ncurses 5.0 through 5.7; very few applications + will require recompilation, depending on the platform. These are + the highlights from the change-log since ncurses 5.7 release. -
    • add NCURSES_OPAQUE symbol to curses.h, will - use to make structs opaque in selected configurations. +

      Interface changes

      -
    • add NCURSES_EXT_FUNCS and - NCURSES_EXT_COLORS symbols to curses.h to make - it simpler to tell if the extended functions and/or colors - are declared. +
        +
      • turn on _XOPEN_CURSES definition in + curses.h.
      • -
      • add wresize() to C++ binding +
      • change _nc_has_mouse to + has_mouse, reflect its use in C++ and Ada95.
      • -
      • eliminate fixed-buffer vsprintf() calls in C++ binding. +
      • add is_pad and is_subwin + functions for opaque access to the WINDOW structure.
      • -
      • add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. +
      • add tiparm, based on review of X/Open Curses + Issue 7.
      • +
      -
    • adapt mouse-handling code from menu library in form-library +

      New features and improvements

      -
    • improve tracing for form library, showing created forms, - fields, etc. +

      Library Improvements

      -
    • make $NCURSES_NO_PADDING feature work for termcap interface . +
        +
      • add a terminal driver for Windows console, which supports a + MinGW port to Windows.
      • -
      • add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. +
      • add extended functions which specify the + SCREEN pointer for several curses functions which + use the global SP.
      • -
      • several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x -
      +
    • improve the NCURSES_NO_UTF8_ACS feature by + adding a check for an extended terminfo capability + U8.
    • -
    • programs: -
        -
      • modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. +
      • improve performance of tigetstr, etc., by + using hashing code from tic.
      • -
      • several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. +
      • add WACS_xxx definitions to wide-character + configuration for thick- and double-lines.
      • -
      • add adacurses-config to the Ada95 install. +
      • modify init_pair to allow caller to create extra color + pairs beyond the color_pairs limit, which use default + colors.
      • +
      -
    • modify tic -f option to format spaces as - \s to prevent them from being lost when that - is read back in unformatted strings. +

      Improvements to Programs

      -
    • The tack program is now distributed separately - from ncurses. -
    +
      +
    • add tabs program.
    • -
    • terminal database -
        -
      • added entries: -
          -
        • Eterm-256color, - Eterm-88color and - rxvt-88color -
        • aterm -
        • konsole-256color -
        • mrxvt -
        • screen.mlterm -
        • screen.rxvt -
        • teraterm4.59 is now the primary primary - teraterm entry, renamed original to - teraterm2.3 -
        • 9term terminal -
        • Newbury Data entries -
        -
      • updated/improved entries: -
          -
        • gnome to version 2.22.3 -
        • h19, z100 -
        • konsole to version 1.6.6 -
        • mlterm, mlterm+pcfkeys -
        • xterm, and building-blocks for function-keys - to xterm patch #230. -
        -
      -
    -Major bug fixes: -
      -
    • add logic to tic for cancelling strings in user-defined - capabilities - (this is needed for - current konsole terminfo entry). +
    • modify tic's -I/-C dump to reformat acsc strings into + canonical form (sorted, unique mapping).
    • -
    • modify mk-1st.awk so the generated makefile rules for - linking or installing shared libraries do not first remove the - library, in case it is in use, e.g., libncurses.so by - /bin/sh. +
    • add checks in tic for inconsistent cursor-movement + controls, and for inconsistent printer-controls.
    • -
    • correct check for notimeout() in wgetch(). +
    • add special case to _nc_infotocap (used by tic + and infocmp) to recognize the + setaf/setab strings from + xterm+256color and xterm+88color, and + provide a reduced version which works with termcap.
    • +
    -
  • fix a sign-extension bug in infocmp's repair_acsc() function. +

    Terminal Database

    -
  • change winnstr() to stop at the end of the line. +
      +
    • added entries: -
    • make Ada95 demo_panels() example work. +
        +
      • bterm terminfo entry, based on bogl + 0.1.18
      • -
      • fix for adding a non-spacing character at the beginning of a line. +
      • cons25-debian entry
      • -
      • fill in extended-color pair to make colors work - for wide-characters using extended-colors. +
      • eterm-color entry
      • -
      • improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. +
      • linux-16color
      • -
      • modify win_wchnstr() to ensure that only a base cell - is returned for each multi-column character. +
      • mlterm+256color entry, for mlterm + 3.0.0
      • -
      • improve waddch() and winsch() handling of - EILSEQ from mbrtowc() by using unctrl() - to display illegal bytes rather than trying to append further bytes - to make up a valid sequence. +
      • several screen-bce.xxx entries
      • -
      • restore curs_set() state after - endwin()/refresh() +
      • screen.Eterm terminfo entry
      • -
      • modify keyname() to use "^X" form only if - meta() has been called, or if keyname() - is called without initializing curses, e.g., via - initscr() or newterm(). +
      • vwmterm entry
      • -
      • modify unctrl() to check codes in 128-255 range versus - isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. +
      • xterm-utf8 entry as a demo of the + U8 feature
      • +
      +
    • -
    • improve resizeterm() by moving ripped-off lines, and - repainting the soft-keys. +
    • updated/improved entries: -
    • modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. +
        +
      • use extended capabilities: -
      • use NCURSES_MOUSE_MASK() in definition of - BUTTON_RELEASE(), etc., to make those work properly - with the --enable-ext-mouse configuration - -
      • correct some functions in Ada95 binding which were using return - value from C where none was returned. - -
      • reviewed/fixed issues reported by Coverity and Klocwork tools. -
      - -Portability: -
        -
      • configure script:
          -
        • new options: -
          +
        • add U8 feature to denote entries for + terminal emulators which do not support VT100 SI/SO + when processing UTF-8 encoding
        • -
          --disable-big-strings -
          control whether static string tables are generated as single - large strings (to improve startup performance), or as array - of individual strings. +
        • add XT capability to entries for + terminals that support both xterm-style mouse- and + title-controls, for screen which + special-cases TERM beginning with xterm or + rxvt
        • +
        +
      • -
        --disable-relink -
        control whether shared libraries are relinked (during install) - when rpath is enabled. +
      • improvements based on new checks in tic:
      • -
        --disable-tic-depends -
        make explicit whether tic library depends on ncurses/ncursesw - library. +
      • +
          +
        • fill in no-parameter forms of cursor-movement where + a parameterized form is available
        • -
          --enable-mixed-case -
          override the configure script's check if the filesystem - supports mixed-case filenames. - This allows one to control how the terminal database - maps to the filesystem. - For filesystems that do not support mixed-case, the library - uses generate 2-character (hexadecimal) codes for the - lower-level of the filesystem terminfo database +
        • fill in missing cursor controls where the form of + the controls is ANSI
        • -
          --enable-reentrant -
          builds a different flavor of the ncurses library (ncursest) - which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded support). +
        • add parameterized cursor-controls to + linux-basic
        • -
          --enable-weak-symbols -
          use weak-symbols for linking to the POSIX thread library, - and use the same soname for the ncurses shared library - as the normal library (caveat: the ABI is for the threaded - library, which makes global data accessed via functions). +
        • modify nsterm, xnuppc and + tek4115 to make + sgr/sgr0 consistent
        • -
          --with-pthread -
          build with the POSIX thread library (tested with AIX, - Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). +
        • change several terminfo entries to make consistent + use of ANSI clear-all-tabs
        • +
        +
      • -
        --with-ticlib -
        build/install the tic-support functions in a separate library +
      • extend ansi.sys pfkey + capability from kf1-kf10 to kf1-kf48, moving function key + definitions from emx-base for + consistency.
      • - +
      • correct missing final 'p' in pfkey + capability of ansi.sys-old.
      • -
      • improved options: -
        +
      • rename atari and st52 + terminfo entries to atari-old, st52-old, use newer entries + from FreeMiNT.
      • -
        --enable-ext-colors -
        requires the wide-character configuration. +
      • repurpose gnome terminfo entries as + vte, retaining gnome variants for + compatibility, but generally deprecating those since the + VTE library is what actually defines the behavior of + "gnome", etc., since 2003.
      • -
        --with-chtype -
        ignore option value "unsigned" is always added to - the type in curses.h; do the same for --with-mmask-t. +
      • improve interix smso terminfo + capability by using reverse rather than bold.
      • -
        --with-dmalloc -
        build-fix for redefinition of strndup. +
      • correct initc capability of + linux-c-nc end-of-range, make similar change + for dg+ccc and dgunix+ccc.
      • -
        --with-hashed-db -
        accepts a parameter which is the install-prefix of a given - Berkeley Database. +
      • update minix terminfo entry.
      • -
        --with-hashed-db -
        the $LIBS environment variable overrides the search for the db - library. +
      • updated nsterm* entries.
      • -
        --without-hashed-db -
        assumed when "--disable-database" is used. +
      • remove unnecessary kcan assignment to + ^C from putty.
      • -
        +
      • suppress ncv in screen and + konsole-base entries, allowing underline.
      • -
      +
    • change ncv and op capabilities in + sun-color terminfo entry to match Sun's entry + for this.
    • -
    • other configure/build issues: -
        -
      • build-fixes for LynxOS -
      • modify shared-library rules to allow FreeBSD 3.x to use rpath. -
      • build-fix for FreeBSD "contemporary" TTY interface. -
      • build-fixes for AIX with libtool. -
      • build-fixes for Darwin and libtool. -
      • modify BeOS-specific ifdef's to build on Haiku. -
      • corrected gcc options for building shared libraries on Solaris - and IRIX64. -
      • change shared-library configuration for OpenBSD, make rpath work. -
      • build-fixes for using libutf8, e.g., on OpenBSD 3.7 -
      • add "-e" option in ncurses/Makefile.in when generating source-files - to force earlier exit if the build environment fails unexpectedly. -
      • add support for shared libraries for QNX. -
      • change delimiter in MKlib_gen.sh from '%' to '@', to - avoid substitution by IBM xlc to '#' as part of its extensions to - digraphs. -
      +
    • fix typo in rmso for tek4106 + entry.
    • -
    • library: -
        -
      • rewrite wrapper for wcrtomb(), making it work on - Solaris. This is used in the form library to determine the length - of the buffer needed by field_buffer. -
      • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding - type for data manipulated by signal handlers. -
      • set locale in misc/ncurses-config.in since it uses a range -
      • disable GPM mouse support when $TERM does not happen to contain - "linux", since Gpm_Open() no longer limits its assertion to terminals - that it might handle, e.g., within "screen" in xterm. -
      • reset mouse file-descriptor when unloading GPM library. -
      +
    • improve acsc string for vt52, + show arrow keys.
    • -
    • test programs: -
        -
      • update test programs to build/work with various UNIX curses for - comparisons. -
      -
    +
  • add hard-reset for rs2 to + wsvt25 to help ensure that reset ends the + alternate character set.
  • -

    Features of Ncurses

    +
  • add ccc and initc + capabilities to xterm-16color.
  • +
+ + -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: +

Major bug fixes

-
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
+
    +
  • ncurses library -The ncurses package also has many useful extensions over SVr4: +
      +
    • wide character support -
        -
      • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -and most EXTENDED features). -It includes many function calls not supported under SVr4 curses -(but portability of all -calls is documented so you can use the SVr4 subset only). -
      • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
      • Ada95 and C++ bindings. -
      • Support for mouse event reporting with X Window xterm -and FreeBSD and OS/2 console windows. -
      • Extended mouse support via Alessandro Rubini's gpm package. -
      • The function wresize() allows you to resize windows, preserving -their data. -
      • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
      • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
      • Support for 256-color terminals, such as modern xterm, when configured -using the --enable-ext-colors option. -
      • Support for 16-color terminals, such as aixterm and modern xterm. -
      • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
      • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
      • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
      • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
      • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
      • A BSD-like tset(1) utility is provided. -
      • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
      • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
      • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
      • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
      • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
      • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
      • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
      • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
      +
        +
      • modify length returned by getcchar to + count the trailing null which is documented in + X/Open.
      • -

        State of the Package

        +
      • fix an infinite recursion when adding a + legacy-coding 8-bit value using + insch.
      • -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

        +

      • improve a workaround in adding wide-characters, + when a control character is found. The library uses + unctrl to obtain a printable version of + the control character, but was not passing color or + video attributes.
      • -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -
        -
        cdk -
        Curses Development Kit -
        -http://invisible-island.net/cdk/ -
        -http://www.vexus.ca/products/CDK/ -
        ded -
        directory-editor -
        -http://invisible-island.net/ded/ -
        dialog -
        the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
        -http://invisible-island.net/dialog/ -
        lynx -
        the character-screen WWW browser -
        -http://lynx.isc.org/release/ -
        Midnight Commander -
        file manager -
        -http://www.ibiblio.org/mc/ -
        mutt -
        mail utility -
        -http://www.mutt.org/ -
        ncftp -
        file-transfer utility -
        -http://www.ncftp.com/ -
        nvi -
        New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
        -http://www.bostic.com/vi/ -
        -
        pinfo -
        Lynx-like info browser. -https://alioth.debian.org/projects/pinfo/ -
        tin -
        newsreader, supporting color, MIME -http://www.tin.org/ -
        -as well as some that use ncurses for the terminfo support alone: -
        -
        minicom -
        terminal emulator -
        - -http://alioth.debian.org/projects/minicom/ -
        vile -
        vi-like-emacs -
        -http://invisible-island.net/vile/ -
        -

        +

      • modify waddch_literal, updating + line-pointer after a multicolumn character is found to + not fit on the current row, and wrapping is done. Since + the line-pointer was not updated, the wrapped + multicolumn character was written to the beginning of + the current row.
      • -The ncurses distribution includes a selection of test programs (including -a few games). +
      • fixes in wins_nwstr and related + functions to ensure that special characters, i.e., + control characters are handled properly with the + wide-character configuration.
      • -

        Who's Who and What's What

        +
      • correct internal _nc_insert_ch to use + _nc_insert_wch when inserting wide + characters, since the wins_wch function + that it used did not update the cursor position.
      • +
      +
    • -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

      +

    • mouse -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -
      +          
        +
      • add check if Gpm_Open returns a -2, + e.g., for "xterm". This is normally suppressed but can + be overridden using $NCURSES_GPM_TERMS. + Ensure that Gpm_Close is called in this + case.
      • + +
      • add check in mouse-driver to disable connection if + GPM returns a zero, indicating that the connection is + closed.
      • + +
      • modify getmouse to act as its + documentation implied, returning on each call the + preceding event until none are left. When no more + events remain, it will return ERR.
      • +
      +
    • + +
    • miscellaneous + +
        +
      • improve handling of color-pairs embedded in + attributes for the extended-colors configuration.
      • + +
      • add check for failure to open hashed-database + needed for db4.6.
      • + +
      • modify use of $CC environment variable + which is defined by X/Open as a curses feature, to + ignore it if it is not a single character.
      • + +
      • modify declaration of cur_term when + broken-linker is used, but enable-reentrant is not, to + match pre-5.7.
      • + +
      • correct limit-checks in derwin.
      • + +
      • remove old check in mvderwin which + prevented moving a derived window whose origin happened + to coincide with its parent's origin.
      • + +
      • correct limit-checks in newwin, to + ensure that windows have nonzero size.
      • + +
      • modify set_curterm to make + broken-linker configuration work with changes from + 20090228.
      • + +
      • modify wgetch to ensure it checks + SIGWINCH when it gets an error in + non-blocking mode.
      • + +
      • correct limit-check in wredrawln, + accounting for begy/begx + values.
      • + +
      • fix a null-pointer check in + _nc_format_slks in lib_slk.c, from + 20070704 changes.
      • + +
      • correct translation of "^" in + _nc_infotocap, used to transform terminfo + to termcap strings.
      • + +
      • modify _nc_wgetch to check for a -1 in + the fifo, e.g., after a SIGWINCH, and + discard that value, to avoid confusing + application.
      • +
      +
    • +
    +
  • + +
  • other libraries + +
      +
    • correct transfer of multicolumn characters in multirow + field_buffer, which stopped at the end of the + first row due to filling of unused entries in a cchar_t + array with nulls.
    • + +
    • correct buffer-size after internal resizing of + wide-character set_field_buffer, broken in + 20081018 changes.
    • + +
    • correct layout of working window used to extract data + in wide-character configured by + set_field_buffer
    • +
    +
  • +
+ +

Portability

+ +
    +
  • configure script: + +
      +
    • new options: + +
      +
      --disable-libtool-version
      + +
      use the "-version-number" feature which was added + in libtool 1.5. The default value for the option uses + the newer feature, which makes libraries generated + using libtool compatible with the standard builds of + ncurses.
      + +
      --disable-rpath-hack
      + +
      disable a feature which adds rpath options for + libraries in unusual places.
      + +
      --enable-interop
      + +
      integrate changes for generic/interop support to + form-library.
      + +
      --enable-pc-files
      + +
      generate ".pc" files for each of the libraries, and + install them in pkg-config's library + directory.
      + +
      --enable-pthreads-eintr
      + +
      control whether to allow EINTR to + interrupt a read operation in wgetch. This + applies only to the pthread configuration
      + +
      --enable-sp-funcs
      + +
      compile-in support for extended functions which + accept a SCREEN pointer, reducing the need + for juggling the global SP value with + set_term and delscreen.
      + +
      --enable-term-driver
      + +
      compile with terminal-driver. That is used in the + MinGW port, and (being somewhat more complicated) is an + experimental alternative to the conventional termlib + internals. Currently, it requires the sp-funcs feature + to be enabled.
      + +
      --with-ncurses-wrap-prefix
      + +
      allows setting the prefix for functions used to + wrap global variables to something other than + "_nc_".
      + +
      --with-pkg-config=[DIR]
      + +
      check for pkg-config, optionally + specifying its path.
      + +
      --without-manpages
      + +
      tells the configure script to suppress the install + of ncurses' manpages.
      + +
      --without-tests
      + +
      suppress building test programs.
      +
      +
    • + +
    • improved options: + +
        +
      • correct logic for --with-database, + which was coded as an enable-type switch.
      • + +
      • omit the opaque-functions from + lib_gen.o when + --disable-ext-funcs is used.
      • +
      +
    • +
    +
  • + +
  • packaging: + +
      +
    • *-config scripts: + +
        +
      • modify adacurses-config to look for + ".ali" files in the adalib directory.
      • + +
      • correct install for the Ada95 tree, which omitted + libAdaCurses.a used in + adacurses-config.
      • + +
      • change install for adacurses-config to + provide additional flavors such as + adacursesw-config, for ncursesw.
      • + +
      • modify scripts to generate + ncurses*-config and pc-files to add + dependency for tinfo library.
      • + +
      • use ncurses*-config scripts if + available for test/configure.
      • + +
      • correct name for termlib in + ncurses*-config, e.g., if it is renamed to + provide a single file for ncurses/ncursesw + libraries.
      • + +
      • generate manpages for the *-config scripts, adapted + from help2man.
      • + +
      • modify install-rule for manpages so that *-config + manpages will install when building with + --srcdir.
      • + +
      • build-fixes for OpenSolaris aka Solaris 11, for + wide-character configuration as well as for rpath + feature in *-config scripts.
      • + +
      • use $includedir symbol in + misc/ncurses-config.in, add + --includedir option.
      • + +
      • improve install-rules for pc-files.
      • + +
      • create the pkg-config library + directory if needed.
      • + +
      • fix typo "==" where "=" + is needed in ncurses-config.in and + gen-pkgconfig.in files.
      • + +
      • modify gen-pkgconfig.in to eliminate a + dependency on rpath when deciding whether to add + $LIBS to --libs output; that + should be shown for the ncurses and tinfo libraries + without taking rpath into account.
      • + +
      • modify handling of $PKG_CONFIG_LIBDIR + to use only the first item in a possibly + colon-separated list.
      • +
      +
    • + +
    • other packaging issues + +
        +
      • add make-tar.sh scripts to Ada95 and + test subdirectories to help with making those + separately distributable.
      • + +
      • add Ada95/configure script, to use in + tar-file created by + Ada95/make-tar.sh.
      • + +
      • remove tar-copy.sh and related + configure/Makefile chunks, since the Ada95 + binding is now installed using rules in + Ada95/src.
      • +
      +
    • +
    +
  • + +
  • cross-compiling: + +
      +
    • improve configure checks for location of tic and + infocmp programs used for installing database and for + generating fallback data, e.g., for cross-compiling.
    • + +
    • modify #define's for build-compiler to suppress cchar_t + symbol from compile of make_hash and + make_keys, improving cross-compilation of + ncursesw.
    • + +
    • simplify include-dependencies of make_hash + and make_keys, to reduce the need for setting + BUILD_CPPFLAGS in cross-compiling when the build- and + target-machines differ.
    • + +
    • correct cross-compiling configure check for + CF_MKSTEMP macro, by adding a check cache + variable set by AC_CHECK_FUNC.
    • +
    +
  • + +
  • library dependencies: + +
      +
    • revise wadd_wch and + wecho_wchar to eliminate dependency on + unctrl.
    • + +
    • adjust configure script so that "t" is not added to + library suffix when weak-symbols are used, allowing the + pthread configuration to more closely match the non-thread + naming.
    • +
    +
  • + +
  • building the Ada95 tree: + +
      +
    • changes to use gnatmake project files in the Ada95 + tree.
    • + +
    • add/use configure check to turn on project rules for + Ada95/src.
    • + +
    • old gnatmake (3.15) does not produce libraries using + project-file; work around by adding script to generate + alternate makefile.
    • + +
    • add configure --with-ada-sharedlib option, for the + test_make rule.
    • + +
    • move Ada95-related logic into aclocal.m4, since + additional checks will be needed to distinguish old/new + implementations of gnat.
    • + +
    • add test_make / test_clean / test_install rules in + Ada95/src
    • + +
    • change install-path for adainclude directory to + /usr/share/ada (was /usr/lib/ada).
    • +
    +
  • + +
  • other configure/build issues: + +
      +
    • make CCHARW_MAX value configurable, noting + that changing this would change the size of + cchar_t, and would be ABI-incompatible.
    • + +
    • improve comparison of program-names when checking for + linked flavors such as "reset" by ignoring the executable + suffix.
    • + +
    • drop mkdirs.sh, use + "mkdir -p".
    • + +
    • drop misc/ncu-indent and + misc/jpf-indent; they are provided by an + external package cindent.
    • + +
    • change makefiles to use $ARFLAGS rather + than $AR_OPTS, provide a configure check to + detect whether a "-" is needed before "ar" options.
    • + +
    • modify CF_DISABLE_LEAKS configure macro so + that the --enable-leaks option is not the same as + --disable-leaks.
    • + +
    • improve configure script macros + CF_HEADER_PATH and + CF_LIBRARY_PATH by adding CFLAGS, + CPPFLAGS and LDFLAGS, + LIBS values to the search-lists.
    • + +
    • improve configure macros CF_GCC_VERSION + and CF_GCC_WARNINGS to work with gcc 4.x's c89 + alias, which gives warning messages for cases where older + versions would produce an error.
    • + +
    • modify CF_WITH_LIBTOOL configure check to + allow unreleased libtool version numbers (e.g. which + include alphabetic chars, as well as digits, after the + final '.').
    • + +
    • improve use of symbolic links in makefiles by using + "-f" option if it is supported, to eliminate + temporary removal of the target
    • + +
    • add a configure-time check to pick a suitable value for + CC_SHARED_OPTS for Solaris.
    • + +
    • add -shared option to MK_SHARED_LIB when + -Bsharable is used, for *BSD's, without which "main" might + be one of the shared library's dependencies.
    • + +
    • modify configure script to allow building shared + libraries with gcc on AIX 5 or 6.
    • + +
    • suppress configure check for static/dynamic linker + flags for gcc on Solaris 10, since gcc is confused by + absence of static libc, and does not switch back to dynamic + mode before finishing the libraries.
    • + +
    • suppress configure check for static/dynamic linker + flags for gcc on Darwin.
    • + +
    • modify misc/run_tic.in to create parent + directory, in case this is a new install of hashed + database.
    • + +
    • modify configure check for tic program, used for + fallbacks, to a warning if not found. This makes it simpler + to use additonal scripts to bootstrap the fallbacks code + using tic from the build tree.
    • +
    +
  • + +
  • test programs: + +
      +
    • add test/demo_terminfo, for comparison with + demo_termcap.
    • + +
    • improve test/ncurses.c 'F' test, show combining + characters in color.
    • + +
    • fix logic for 'V' in test/ncurses.c tests f/F.
    • + +
    • improve test/ncurses.c 'a test to put mouse droppings + in the proper window.
    • + +
    • modify ncurses 'F' test to demo wborder_set with + colored lines.
    • + +
    • modify ncurses 'f' test to demo wborder with colored + lines.
    • + +
    • improve test/ncurses.c 'a' test, using unctrl more + consistently to display meta-characters.
    • + +
    • correct use of key_name in test/ncurses.c + 'A' test, which only displays wide-characters, not + key-codes since 20070612.
    • + +
    • add test/clip_printw.c to illustrate how to use printw + without wrapping.
    • + +
    • modify test-programs, e.g,. test/view.c, to address + subtle differences between Tru64/Solaris and HPUX/AIX + getcchar return values.
    • + +
    • add some test programs (and make these use the same + special keys by sharing linedata.h functions): + test/test_addstr.c test/test_addwstr.c test/test_addchstr.c + test/test_add_wchstr.c
    • + +
    • add test/xterm-256color.dat
    • + +
    • modify test programs to allow them to be built with + NetBSD curses.
    • + +
    • fixes for test programs to build/work on HPUX and AIX, + etc.
    • +
    +
  • +
+ +

Features of Ncurses

The ncurses package is fully + compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are + documented).
  • + +
  • Full support for SVr4 curses features including keyboard + mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys.
  • + +
  • An emulation of the SVr4 panels library, supporting a stack + of windows with backing store, is included.
  • + +
  • An emulation of the SVr4 menus library, supporting a + uniform but flexible interface for menu programming, is + included.
  • + +
  • An emulation of the SVr4 form library, supporting data + collection through on-screen forms, is included.
  • + +
  • Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses.
  • + +
  • The utilities have options to allow you to filter terminfo + entries for use with less capable + curses/terminfo versions such + as the HP/UX and AIX ports.
  • +
The ncurses package also has many useful extensions over + SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the + X/OPEN curses specification, XSI curses (that is, it implements + all BASE level features, and most EXTENDED features). It + includes many function calls not supported under SVr4 curses + (but portability of all calls is documented so you can use the + SVr4 subset only).
  • + +
  • Unlike SVr3 curses, ncurses can write to the + rightmost-bottommost corner of the screen if your terminal has + an insert-character capability.
  • + +
  • Ada95 and C++ bindings.
  • + +
  • Support for mouse event reporting with X Window xterm and + FreeBSD and OS/2 console windows.
  • + +
  • Extended mouse support via Alessandro Rubini's gpm + package.
  • + +
  • The function wresize allows you to resize + windows, preserving their data.
  • + +
  • The function use_default_colors allows you to + use the terminal's default colors for the default color pair, + achieving the effect of transparent colors.
  • + +
  • The functions keyok and + define_key allow you to better control the use of + function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code.
  • + +
  • Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors + option.
  • + +
  • Support for 16-color terminals, such as aixterm + and modern xterm.
  • + +
  • Better cursor-movement optimization. The package now + features a cursor-local-movement computation more efficient + than either BSD's or System V's.
  • + +
  • Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables + it to make optimal use of hardware scrolling, line-insertion, + and line-deletion for screen-line movements. This algorithm is + more powerful than the 4.4BSD curses quickch + routine.
  • + +
  • Real support for terminals with the magic-cookie glitch. + The screen-update code will refrain from drawing a highlight if + the magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space + character. It will automatically shift highlight boundaries + when doing so would make it possible to draw the highlight + without changing the visual appearance of the screen.
  • + +
  • It is possible to generate the library with a list of + pre-loaded fallback entries linked to it so that it can serve + those terminal types even when no terminfo tree or termcap file + is accessible (this may be useful for support of + screen-oriented programs that must run in single-user + mode).
  • + +
  • The tic(1)/captoinfo utility provided with ncurses has the + ability to translate many termcaps from the XENIX, IBM and + AT&T extension sets.
  • + +
  • A BSD-like tset(1) utility is provided.
  • + +
  • The ncurses library and utilities will automatically read + terminfo entries from $HOME/.terminfo if it exists, and compile + to that directory if it exists and the user has no write access + to the system directory. This feature makes it easier for users + to have personal terminfo entries without giving up access to + the system terminfo directory.
  • + +
  • You may specify a path of directories to search for + compiled descriptions with the environment variable + TERMINFO_DIRS (this generalizes the feature provided by + TERMINFO under stock System V.)
  • + +
  • In terminfo source files, use capabilities may refer not + just to other entries in the same source file (as in System V) + but also to compiled entries in either the system terminfo + directory or the user's $HOME/.terminfo directory.
  • + +
  • A script (capconvert) is provided to help + BSD users transition from termcap to terminfo. It gathers the + information in a TERMCAP environment variable and/or a + ~/.termcap local entries file and converts it to an equivalent + local terminfo tree under $HOME/.terminfo.
  • + +
  • Automatic fallback to the /etc/termcap file can be compiled + in when it is not possible to build a terminfo tree. This + feature is neither fast nor cheap, you don't want to use it + unless you have to, but it's there.
  • + +
  • The table-of-entries utility toe makes it + easy for users to see exactly what terminal types are available + on the system.
  • + +
  • The library meets the XSI requirement that every macro + entry point have a corresponding function which may be linked + (and will be prototype-checked) if the macro definition is + disabled with #undef.
  • + +
  • An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface.
  • +
+ +

State of the Package

Numerous bugs present in earlier + versions have been fixed; the library is far more reliable than + it used to be. Bounds checking in many `dangerous' entry points + has been improved. The code is now type-safe according to gcc + -Wall. The library has been checked for malloc leaks and arena + corruption by the Purify memory-allocation tester. + +

The ncurses code has been tested with a wide variety of + applications including (versions starting with those noted):

+ +
+
cdk
+ +
Curses Development Kit
+ http://invisible-island.net/cdk/
+ + http://www.vexus.ca/products/CDK/
+ +
ded
+ +
directory-editor
+ http://invisible-island.net/ded/
+ +
dialog
+ +
the underlying application used in Slackware's setup, and + the basis for similar applications on GNU/Linux.
+ http://invisible-island.net/dialog/
+ +
lynx
+ +
the character-screen WWW browser
+ http://lynx.isc.org/release/
+ +
Midnight Commander
+ +
file manager
+ http://www.midnight-commander.org/
+ +
mutt
+ +
mail utility
+ http://www.mutt.org/
+ +
ncftp
+ +
file-transfer utility
+ http://www.ncftp.com/
+ +
nvi
+ +
New vi versions 1.50 are able to use ncurses versions 1.9.7 + and later.
+ https://sites.google.com/a/bostic.com/keithbostic/nvi
+
+ +
pinfo
+ +
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
+ +
tin
+ +
newsreader, supporting color, MIME http://www.tin.org/
+
as well as some that use ncurses for the terminfo support + alone: + +
+
minicom
+ +
terminal emulator
+ http://alioth.debian.org/projects/minicom/
+ +
vile
+ +
vi-like-emacs
+ http://invisible-island.net/vile/
+
+ +

The ncurses distribution includes a selection of test programs + (including a few games).

+ +

Who's Who and What's What

Zeyd Ben-Halim started it from + a previous package pcurses, written by Pavel Curtis. Eric S. + Raymond continued development. Jürgen Pfeifer wrote most of + the form and menu libraries. Ongoing work is being done by + Thomas Dickey. + Thomas Dickey acts as the maintainer for the Free Software + Foundation, which holds the copyright on ncurses. Contact the + current maintainers at bug-ncurses@gnu.org. + +

To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line:

+
              subscribe <name>@<host.domain>
-
+ -This list is open to anyone interested in helping with the development and -testing of this package.

+

This list is open to anyone interested in helping with the + development and testing of this package.

-Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . +

Beta versions of ncurses and patches to the current release + are made available at ftp://invisible-island.net/ncurses/ .

-

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. +

Future Plans

-

Other Related Resources

+
    +
  • Extended-level XPG4 conformance, with internationalization + support.
  • -The distribution provides a newer version of the terminfo-format -terminal description file once maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file, and provides several user-definable extensions -beyond the X/Open specification.

    +

  • Ports to more systems, including DOS and Windows.
  • +
We need people to help with these projects. If you are + interested in working on them, please join the ncurses list. -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - +

Other Related Resources

The distribution provides a newer + version of the terminfo-format terminal description file once + maintained by Eric + Raymond . Unlike the older version, the termcap and + terminfo data are provided in the same file, and provides several + user-definable extensions beyond the X/Open specification. + +

You can find lots of information on terminal-related topics + not covered in the terminfo file at + Richard Shuford's archive .

+ + diff --git a/c++/Makefile.in b/c++/Makefile.in new file mode 100644 index 00000000000..6fd8ffc55f2 --- /dev/null +++ b/c++/Makefile.in @@ -0,0 +1,248 @@ +# $Id: Makefile.in,v 1.93 2010/11/27 21:45:27 tom Exp $ +############################################################################## +# Copyright (c) 1998-2009,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"), # +# 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 +# +# Simple makefile for c++ window class demo + +# turn off _all_ suffix rules; we'll generate our own +.SUFFIXES: + +SHELL = /bin/sh +VPATH = @srcdir@ + +CF_MFLAGS = @cf_cv_makeflags@ +@SET_MAKE@ +x = @EXEEXT@ +o = .@OBJEXT@ + +MODEL = ../@DFT_OBJ_SUBDIR@ +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ + +LIBTOOL = @LIBTOOL_CXX@ +LIBTOOL_CLEAN = @LIB_CLEAN@ +LIBTOOL_COMPILE = @LIB_COMPILE@ +LIBTOOL_LINK = @LIB_LINK@ +LIBTOOL_INSTALL = @LIB_INSTALL@ +LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ +LIBTOOL_VERSION = @LIBTOOL_VERSION@ +LT_UNDEF = @LT_UNDEF@ + +INSTALL = @INSTALL@ +INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +INSTALL_DATA = @INSTALL_DATA@ + +AR = @AR@ +ARFLAGS = @ARFLAGS@ + +CXX_AR = @CXX_AR@ +CXX_ARFLAGS = @CXX_ARFLAGS@ +RANLIB = @LIB_PREP@ + +CXX = @CXX@ +CPP = @CXXCPP@ +CXXFLAGS = @CXXFLAGS@ @EXTRA_CXXFLAGS@ +CXXLIBS = @CXXLIBS@ + +INCDIR = ../include +CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ + +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + +CC = ${CXX} +CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) + +CFLAGS_LIBTOOL = $(CCFLAGS) +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +NCURSES_MAJOR = @NCURSES_MAJOR@ +NCURSES_MINOR = @NCURSES_MINOR@ +REL_VERSION = @cf_cv_rel_version@ +ABI_VERSION = @cf_cv_abi_version@ + +LOCAL_LIBDIR = @top_builddir@/lib + +LINK = @LINK_PROGS@ $(LIBTOOL_LINK) @CXXLDFLAGS@ +SHLIB_DIRS = -L../lib +SHLIB_LIST = $(SHLIB_DIRS) -lform@LIB_SUFFIX@ -lmenu@LIB_SUFFIX@ -lpanel@LIB_SUFFIX@ -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ + +LIBROOT = ncurses++ + +LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la +LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a +LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ + +MY_LIBRARY = ../lib/$(LIBNAME) + +LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ + +LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib $(MY_LIBRARY) +LINK_NORMAL = $(LINK_FLAGS) +LINK_DEBUG = $(LINK_FLAGS) +LINK_PROFILE = $(LINK_FLAGS) +LINK_SHARED = $(LINK_FLAGS) + +TEST_LIBS = @TEST_LIBS@ +TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ + +LDFLAGS = $(TEST_ARGS) @LDFLAGS@ \ + @LD_MODEL@ $(TEST_LIBS) @LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS) + +LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL) +LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL) +LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG) +LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) +LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@ + +LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@) + +AUTO_SRC = \ + etip.h + +all \ +libs :: $(AUTO_SRC) $(MY_LIBRARY) + +@MAKE_TESTS@all :: demo$x + +sources : $(AUTO_SRC) + +depend : + +tags: + $(CTAGS) *.[h] *.cc + +# Build a conventional library for installing, since a shared library would +# pull in all of the ncurses libraries (panel, menu, form, ncurses) as direct +# dependencies. +LIB_OBJS = \ + $(MODEL)/cursesf$o \ + $(MODEL)/cursesm$o \ + $(MODEL)/cursesw$o \ + $(MODEL)/cursespad$o \ + $(MODEL)/cursesp$o \ + $(MODEL)/cursslk$o \ + $(MODEL)/cursesapp$o \ + $(MODEL)/cursesmain$o + +../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) + $(CXX_AR) $(CXX_ARFLAGS) $@ $? + $(RANLIB) $@ + +../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) + cd ../lib && $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) \ + -o $(LIBNAME) $(LIB_OBJS:$o=.lo) \ + -rpath $(INSTALL_PREFIX)$(libdir) \ + $(LIBTOOL_VERSION) $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(SHLIB_LIST) + +OBJS_DEMO = $(MODEL)/demo$o + +$(MODEL)/demo$o : $(srcdir)/demo.cc \ + $(cursesf_h) $(cursesm_h) $(cursesapp_h) + +demo$x: $(OBJS_DEMO) \ + $(MY_LIBRARY) \ + @TEST_DEPS@ + @ECHO_LINK@ $(LINK) -o $@ $(OBJS_DEMO) $(LDFLAGS_DEFAULT) + +etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh + cp $(srcdir)/etip.h.in $@ + sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ + +$(DESTDIR)$(libdir) : + mkdir -p $@ + +install \ +install.libs:: $(MY_LIBRARY) $(DESTDIR)$(libdir) + $(LIBTOOL_INSTALL) $(INSTALL_LIB) $(MY_LIBRARY) $(DESTDIR)$(libdir)/$(LIBNAME) + +uninstall \ +uninstall.libs:: + -$(LIBTOOL_UNINSTALL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) + +mostlyclean :: + -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace + +clean :: mostlyclean + -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi" + -rm -rf $(MODEL)/SunWS_cache + -$(LIBTOOL_CLEAN) rm -f demo$x $(AUTO_SRC) $(MY_LIBRARY) $(LIB_OBJS) $(OBJS_DEMO) + -rm -rf .libs + +distclean :: clean + -rm -f Makefile + +realclean :: distclean + +############################################################################### + +cursesw_h = $(srcdir)/cursesw.h \ + etip.h \ + $(INCDIR)/curses.h + +cursesp_h = $(srcdir)/cursesp.h \ + $(cursesw_h) \ + $(INCDIR)/panel.h + +cursesf_h = $(srcdir)/cursesf.h \ + $(cursesp_h) \ + $(INCDIR)/form.h + +cursesm_h = $(srcdir)/cursesm.h \ + $(cursesp_h) \ + $(INCDIR)/menu.h + +cursslk_h = $(srcdir)/cursslk.h \ + $(cursesw_h) + +cursesapp_h = $(srcdir)/cursesapp.h \ + $(cursslk_h) + +$(INCDIR)/form.h : + cd ../form && $(MAKE) $@ + +$(INCDIR)/menu.h : + cd ../menu && $(MAKE) $@ + +$(INCDIR)/panel.h : + cd ../panel && $(MAKE) $@ + +############################################################################### +# The remainder of this file is automatically generated during configuration +############################################################################### diff --git a/c++/NEWS b/c++/NEWS new file mode 100644 index 00000000000..17488a41f4c --- /dev/null +++ b/c++/NEWS @@ -0,0 +1,71 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 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 -- +-- "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: NEWS,v 1.4 2006/04/22 22:19:37 tom Exp $ +------------------------------------------------------------------------------- +This is a log of changes that the ncurses C++ binding has gone +through starting with the integration of menu and forms integration +into the binding. + +990731 + Improve support for pads. A viewport window may now be added to + a pad. It will then be possible to use a builtin panning mechanism + to view the pad. + +970908 + Improve NCursesWindow class: added additional methods to + cover more ncurses functionality. Make refresh() and + noutrefresh() virtual members to allow different implementation + in the NCursesPanel class. + + CAUTION: changed order of parameters in vline() and hline() of + NCursesWindow class. + + Make refresh() in NCursesPanel non-static, it is now a + reimplementation of refresh() in the base class. Added + noutrefresh() to NCursesPanel. + + Added NCursesForm and related classes to support libform + functionality. + + Moved most of configuration related stuff from cursesw.h to + etip.h + + Added NCursesApplication class to support easy configuration + of menu and forms related attributes as well as ripped of + title lines and Soft-Label-Keys for an application. + + Support of Auto-Cleanup for a menus fieldlist. + + Change of return type for current_item() and operator[] for + menus. + + Enhanced demo. +970502 + + Introduced the THROW and THROWS functions/macros to prepare + a smoother transition to real exception handling. + + Exception classes provided in etip.h + + Added the NCursesMenu class to support libmenu functionality. + + The inheritace relation between NCursesWindow and NCursesColorWindow + was kind of brain damage. Monochrome is a special case of colored, so + the relation should be just the opposite. This would allow all + derived classes like NCursesPanel, NCursesMenu or NCursesForm to + have colors. + To resolve that design flaw I put the color functionality into the + NCursesWindow class and it can be switched on by the static member + useColors(). NCursesColorWindow is still there for compatibility + reasons. diff --git a/c++/PROBLEMS b/c++/PROBLEMS new file mode 100644 index 00000000000..7f2a7df5efc --- /dev/null +++ b/c++/PROBLEMS @@ -0,0 +1,34 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 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 -- +-- "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: PROBLEMS,v 1.3 2006/04/22 22:19:37 tom Exp $ +------------------------------------------------------------------------------- +This is a list of open problems. This mainly lists known missing pieces +and design flaws. + +1. Testing!!! +2. Better demo program diff --git a/c++/README-first b/c++/README-first new file mode 100644 index 00000000000..42487f52db4 --- /dev/null +++ b/c++/README-first @@ -0,0 +1,80 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), 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: README-first,v 1.9 2007/01/27 18:27:09 tom Exp $ +------------------------------------------------------------------------------- + C++ interface to ncurses routines +----------------------------------------------------------------------- + +This directory contains the source code for several C++ classes which +ease the use of writing ncurses-based programs. The code was originally +derived from the libg++ CursesWindow class, but rewritten for ncurses. + +The classes simplify the use of window specific functions by +encapsulating them in the window object. Function overloading is +used in order to narrow the interface. For example, you do not have the +distinction between `printw' and `mvprintw' anymore. + +A second benefit is the removal of all #defines which are included in +the curses.h file. This is a steady cause of trouble because many +common identifiers are used. Instead now all #defines are inline +functions, which also allows strict type checking of arguments. + +The next enhancement is color support. It was originally provided by a +derived class. This caused some trouble if you think about Panels or +Menus and Forms with colors. We decided to put color support into the +base class so that any derived class may use color support also. +The implementation chosen here is directed to unrestricted use +of mixes of color and monochrome windows. The original NCursesColorWindow +class is maintained for compatibility reasons. + +The last point to mention is the support of other packages that are +distributed with the ncurses package: the panels library, the menu library +and the form library. This support is provided by the NCursesPanel class, +which is also derived from the NCursesWindow class and the NCursesMenu +and NCursesForm classes which are derived from NCursesPanel. This allows +building interfaces with windows. + +Please see the example program for a quick introduction. + +Note that at this point, there is no documentation for these classes. +Hopefully some will be written in the not too distant future. For now, +to find out how to use the classes, read the code and the example program. + +Suggestions for enhancements and contributions of code (and docs) are +welcome. Please let us know which functionality you miss. + +Original author: + Eric Newton for FSF's libg++ + +Authors of first ncurses based release (NCursesWindow, NCursesPanel): + Ulrich Drepper + and Anatoly Ivasyuk + +Authors of this release: + Juergen Pfeifer + Thomas E. Dickey diff --git a/c++/cursesapp.cc b/c++/cursesapp.cc new file mode 100644 index 00000000000..ddab6fdf9b9 --- /dev/null +++ b/c++/cursesapp.cc @@ -0,0 +1,164 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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: Juergen Pfeifer, 1997 * + * and: Thomas E. Dickey * + ****************************************************************************/ + +#include "internal.h" +#include "cursesapp.h" + +MODULE_ID("$Id: cursesapp.cc,v 1.15 2008/08/16 17:15:35 tom Exp $") + +void +NCursesApplication::init(bool bColors) +{ + if (bColors) + NCursesWindow::useColors(); + + if (Root_Window->colors() > 1) { + b_Colors = TRUE; + Root_Window->setcolor(1); + Root_Window->setpalette(COLOR_YELLOW,COLOR_BLUE); + Root_Window->setcolor(2); + Root_Window->setpalette(COLOR_CYAN,COLOR_BLUE); + Root_Window->setcolor(3); + Root_Window->setpalette(COLOR_BLACK,COLOR_BLUE); + Root_Window->setcolor(4); + Root_Window->setpalette(COLOR_BLACK,COLOR_CYAN); + Root_Window->setcolor(5); + Root_Window->setpalette(COLOR_BLUE,COLOR_YELLOW); + Root_Window->setcolor(6); + Root_Window->setpalette(COLOR_BLACK,COLOR_GREEN); + } + else + b_Colors = FALSE; + + Root_Window->bkgd(' '|window_backgrounds()); +} + +NCursesApplication* NCursesApplication::theApp = 0; +NCursesWindow* NCursesApplication::titleWindow = 0; +NCursesApplication::SLK_Link* NCursesApplication::slk_stack = 0; + +NCursesApplication::~NCursesApplication() +{ + Soft_Label_Key_Set* S; + + delete titleWindow; + titleWindow = 0; + + while( (S=top()) ) { + pop(); + delete S; + } + + delete Root_Window; + Root_Window = 0; + + ::endwin(); +} + +int NCursesApplication::rinit(NCursesWindow& w) +{ + titleWindow = &w; + return OK; +} + +void NCursesApplication::push(Soft_Label_Key_Set& S) +{ + SLK_Link* L = new SLK_Link; + assert(L != 0); + L->prev = slk_stack; + L->SLKs = &S; + slk_stack = L; + if (Root_Window) + S.show(); +} + +bool NCursesApplication::pop() +{ + if (slk_stack) { + SLK_Link* L = slk_stack; + slk_stack = slk_stack->prev; + delete L; + if (Root_Window) { + Soft_Label_Key_Set* xx = top(); + if (xx != 0) + xx->show(); + } + } + return (slk_stack ? FALSE : TRUE); +} + +Soft_Label_Key_Set* NCursesApplication::top() const +{ + if (slk_stack) + return slk_stack->SLKs; + else + return static_cast(0); +} + +int NCursesApplication::operator()(void) +{ + bool bColors = b_Colors; + Soft_Label_Key_Set* S = 0; + + int ts = titlesize(); + if (ts>0) + NCursesWindow::ripoffline(ts,rinit); + Soft_Label_Key_Set::Label_Layout fmt = useSLKs(); + if (fmt!=Soft_Label_Key_Set::None) { + S = new Soft_Label_Key_Set(fmt); + assert(S != 0); + init_labels(*S); + } + + Root_Window = new NCursesWindow(::stdscr); + init(bColors); + + if (ts>0) + title(); + if (fmt!=Soft_Label_Key_Set::None) { + push(*S); + } + + return run(); +} + +NCursesApplication::NCursesApplication(bool bColors) + : b_Colors(bColors), + Root_Window(NULL) +{ + if (theApp) + THROW(new NCursesException("Application object already created.")); + else + theApp = this; +} diff --git a/c++/cursesapp.h b/c++/cursesapp.h new file mode 100644 index 00000000000..7e995d2e39c --- /dev/null +++ b/c++/cursesapp.h @@ -0,0 +1,176 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +// $Id: cursesapp.h,v 1.11 2005/05/28 21:57:44 tom Exp $ + +#ifndef NCURSES_CURSESAPP_H_incl +#define NCURSES_CURSESAPP_H_incl + +#include + +class NCURSES_IMPEXP NCursesApplication { +public: + typedef struct _slk_link { // This structure is used to maintain + struct _slk_link* prev; // a stack of SLKs + Soft_Label_Key_Set* SLKs; + } SLK_Link; +private: + static int rinit(NCursesWindow& w); // Internal Init function for title + static NCursesApplication* theApp; // Global ref. to the application + + static SLK_Link* slk_stack; + +protected: + static NCursesWindow* titleWindow; // The Title Window (if any) + + bool b_Colors; // Is this a color application? + NCursesWindow* Root_Window; // This is the stdscr equiv. + + // Initialization of attributes; + // Rewrite this in your derived class if you prefer other settings + virtual void init(bool bColors); + + // The number of lines for the title window. Default is no title window + // You may rewrite this in your derived class + virtual int titlesize() const { + return 0; + } + + // This method is called to put something into the title window initially + // You may rewrite this in your derived class + virtual void title() { + } + + // The layout used for the Soft Label Keys. Default is to have no SLKs. + // You may rewrite this in your derived class + virtual Soft_Label_Key_Set::Label_Layout useSLKs() const { + return Soft_Label_Key_Set::None; + } + + // This method is called to initialize the SLKs. Default is nothing. + // You may rewrite this in your derived class + virtual void init_labels(Soft_Label_Key_Set& S) const { + } + + // Your derived class must implement this method. The return value must + // be the exit value of your application. + virtual int run() = 0; + + // The constructor is protected, so you may use it in your derived + // class constructor. The argument tells whether or not you want colors. + NCursesApplication(bool wantColors = FALSE); + + NCursesApplication& operator=(const NCursesApplication& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + NCursesApplication(const NCursesApplication& rhs) + : b_Colors(rhs.b_Colors), + Root_Window(rhs.Root_Window) + { + } + +public: + virtual ~NCursesApplication(); + + // Get a pointer to the current application object + static NCursesApplication* getApplication() { + return theApp; + } + + // This method runs the application and returns its exit value + int operator()(void); + + // Process the commandline arguments. The default implementation simply + // ignores them. Your derived class may rewrite this. + virtual void handleArgs(int argc, char* argv[]) { + } + + // Does this application use colors? + inline bool useColors() const { + return b_Colors; + } + + // Push the Key Set S onto the SLK Stack. S then becomes the current set + // of Soft Labelled Keys. + void push(Soft_Label_Key_Set& S); + + // Throw away the current set of SLKs and make the previous one the + // new current set. + bool pop(); + + // Retrieve the current set of Soft Labelled Keys. + Soft_Label_Key_Set* top() const; + + // Attributes to use for menu and forms foregrounds + virtual chtype foregrounds() const { + return b_Colors ? COLOR_PAIR(1) : A_BOLD; + } + + // Attributes to use for menu and forms backgrounds + virtual chtype backgrounds() const { + return b_Colors ? COLOR_PAIR(2) : A_NORMAL; + } + + // Attributes to use for inactive (menu) elements + virtual chtype inactives() const { + return b_Colors ? (COLOR_PAIR(3)|A_DIM) : A_DIM; + } + + // Attributes to use for (form) labels and SLKs + virtual chtype labels() const { + return b_Colors ? COLOR_PAIR(4) : A_NORMAL; + } + + // Attributes to use for form backgrounds + virtual chtype dialog_backgrounds() const { + return b_Colors ? COLOR_PAIR(4) : A_NORMAL; + } + + // Attributes to use as default for (form) window backgrounds + virtual chtype window_backgrounds() const { + return b_Colors ? COLOR_PAIR(5) : A_NORMAL; + } + + // Attributes to use for the title window + virtual chtype screen_titles() const { + return b_Colors ? COLOR_PAIR(6) : A_BOLD; + } + +}; + +#endif /* NCURSES_CURSESAPP_H_incl */ diff --git a/c++/cursesf.cc b/c++/cursesf.cc new file mode 100644 index 00000000000..aaf1202ca94 --- /dev/null +++ b/c++/cursesf.cc @@ -0,0 +1,454 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +#include "internal.h" +#include "cursesf.h" +#include "cursesapp.h" + +MODULE_ID("$Id: cursesf.cc,v 1.21 2005/08/13 18:09:06 tom Exp $") + +NCursesFormField::~NCursesFormField () +{ + if (field) + OnError(::free_field (field)); +} + +/* Construct a FIELD* array from an array of NCursesFormField + * objects. + */ +FIELD** +NCursesForm::mapFields(NCursesFormField* nfields[]) +{ + int fieldCount = 0,lcv; + FIELD** old_fields; + + assert(nfields != 0); + + for (lcv=0; nfields[lcv]->field; ++lcv) + ++fieldCount; + + FIELD** fields = new FIELD*[fieldCount + 1]; + + for (lcv=0;nfields[lcv]->field;++lcv) { + fields[lcv] = nfields[lcv]->field; + } + fields[lcv] = NULL; + + my_fields = nfields; + + if (form && (old_fields = ::form_fields(form))) { + ::set_form_fields(form, static_cast(0)); + delete[] old_fields; + } + return fields; +} + +void NCursesForm::setDefaultAttributes() +{ + NCursesApplication* S = NCursesApplication::getApplication(); + + int n = count(); + if (n > 0) { + for(int i=0; ioptions() & (O_EDIT|O_ACTIVE))==(O_EDIT|O_ACTIVE)) { + if (S) { + f->set_foreground(S->foregrounds()); + f->set_background(S->backgrounds()); + } + f->set_pad_character('_'); + } + else { + if (S) + f->set_background(S->labels()); + } + } + } + + if (S) { + bkgd(' '|S->dialog_backgrounds()); + if (sub) + sub->bkgd(' '|S->dialog_backgrounds()); + } +} + +void +NCursesForm::InitForm(NCursesFormField* nfields[], + bool with_frame, + bool autoDelete_Fields) +{ + int mrows, mcols; + + keypad(TRUE); + meta(TRUE); + + b_framed = with_frame; + b_autoDelete = autoDelete_Fields; + + form = static_cast(0); + form = ::new_form(mapFields(nfields)); + if (!form) + OnError (E_SYSTEM_ERROR); + + UserHook* hook = new UserHook; + hook->m_user = NULL; + hook->m_back = this; + hook->m_owner = form; + ::set_form_userptr(form, reinterpret_cast(hook)); + + ::set_form_init (form, _nc_xx_frm_init); + ::set_form_term (form, _nc_xx_frm_term); + ::set_field_init (form, _nc_xx_fld_init); + ::set_field_term (form, _nc_xx_fld_term); + + scale(mrows, mcols); + ::set_form_win(form, w); + + if (with_frame) { + if ((mrows > height()-2) || (mcols > width()-2)) + OnError(E_NO_ROOM); + sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); + ::set_form_sub(form, sub->w); + b_sub_owner = TRUE; + } + else { + sub = static_cast(0); + b_sub_owner = FALSE; + } + options_on(O_NL_OVERLOAD); + setDefaultAttributes(); +} + +NCursesForm::~NCursesForm() +{ + UserHook* hook = reinterpret_cast(::form_userptr(form)); + delete hook; + if (b_sub_owner) { + delete sub; + ::set_form_sub(form, static_cast(0)); + } + if (form) { + FIELD** fields = ::form_fields(form); + int cnt = count(); + + OnError(::set_form_fields(form, static_cast(0))); + + if (b_autoDelete) { + if (cnt>0) { + for (int i=0; i <= cnt; i++) + delete my_fields[i]; + } + delete[] my_fields; + } + + ::free_form(form); + // It's essential to do this after free_form() + delete[] fields; + } +} + +void +NCursesForm::setSubWindow(NCursesWindow& nsub) +{ + if (!isDescendant(nsub)) + OnError(E_SYSTEM_ERROR); + else { + if (b_sub_owner) + delete sub; + sub = ⊄ + ::set_form_sub(form,sub->w); + } +} + +/* Internal hook functions. They will route the hook + * calls to virtual methods of the NCursesForm class, + * so in C++ providing a hook is done simply by + * implementing a virtual method in a derived class + */ +void +_nc_xx_frm_init(FORM *f) +{ + NCursesForm::getHook(f)->On_Form_Init(); +} + +void +_nc_xx_frm_term(FORM *f) +{ + NCursesForm::getHook(f)->On_Form_Termination(); +} + +void +_nc_xx_fld_init(FORM *f) +{ + NCursesForm* F = NCursesForm::getHook(f); + F->On_Field_Init (*(F->current_field ())); +} + +void +_nc_xx_fld_term(FORM *f) +{ + NCursesForm* F = NCursesForm::getHook(f); + F->On_Field_Termination (*(F->current_field ())); +} + +void +NCursesForm::On_Form_Init() +{ +} + +void +NCursesForm::On_Form_Termination() +{ +} + +void +NCursesForm::On_Field_Init(NCursesFormField& field) +{ +} + +void +NCursesForm::On_Field_Termination(NCursesFormField& field) +{ +} + +// call the form driver and do basic error checking. +int +NCursesForm::driver (int c) +{ + int res = ::form_driver (form, c); + switch (res) { + case E_OK: + case E_REQUEST_DENIED: + case E_INVALID_FIELD: + case E_UNKNOWN_COMMAND: + break; + default: + OnError (res); + } + return (res); +} + +void NCursesForm::On_Request_Denied(int c) const +{ + ::beep(); +} + +void NCursesForm::On_Invalid_Field(int c) const +{ + ::beep(); +} + +void NCursesForm::On_Unknown_Command(int c) const +{ + ::beep(); +} + +static const int CMD_QUIT = MAX_COMMAND + 1; + +NCursesFormField* +NCursesForm::operator()(void) +{ + int drvCmnd; + int err; + int c; + + post(); + show(); + refresh(); + + while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { + switch((err=driver(drvCmnd))) { + case E_REQUEST_DENIED: + On_Request_Denied(c); + break; + case E_INVALID_FIELD: + On_Invalid_Field(c); + break; + case E_UNKNOWN_COMMAND: + On_Unknown_Command(c); + break; + case E_OK: + break; + default: + OnError(err); + } + } + + unpost(); + hide(); + refresh(); + return my_fields[::field_index (::current_field (form))]; +} + +// Provide a default key virtualization. Translate the keyboard +// code c into a form request code. +// The default implementation provides a hopefully straightforward +// mapping for the most common keystrokes and form requests. +int +NCursesForm::virtualize(int c) +{ + switch(c) { + + case KEY_HOME : return(REQ_FIRST_FIELD); + case KEY_END : return(REQ_LAST_FIELD); + + case KEY_DOWN : return(REQ_DOWN_CHAR); + case KEY_UP : return(REQ_UP_CHAR); + case KEY_LEFT : return(REQ_PREV_CHAR); + case KEY_RIGHT : return(REQ_NEXT_CHAR); + + case KEY_NPAGE : return(REQ_NEXT_PAGE); + case KEY_PPAGE : return(REQ_PREV_PAGE); + + case KEY_BACKSPACE : return(REQ_DEL_PREV); + case KEY_ENTER : return(REQ_NEW_LINE); + case KEY_CLEAR : return(REQ_CLR_FIELD); + + case CTRL('X') : return(CMD_QUIT); // eXit + + case CTRL('F') : return(REQ_NEXT_FIELD); // Forward + case CTRL('B') : return(REQ_PREV_FIELD); // Backward + case CTRL('L') : return(REQ_LEFT_FIELD); // Left + case CTRL('R') : return(REQ_RIGHT_FIELD); // Right + case CTRL('U') : return(REQ_UP_FIELD); // Up + case CTRL('D') : return(REQ_DOWN_FIELD); // Down + + case CTRL('W') : return(REQ_NEXT_WORD); + case CTRL('T') : return(REQ_PREV_WORD); + + case CTRL('A') : return(REQ_BEG_FIELD); + case CTRL('E') : return(REQ_END_FIELD); + + case CTRL('I') : return(REQ_INS_CHAR); + case CTRL('M') : + case CTRL('J') : return(REQ_NEW_LINE); + case CTRL('O') : return(REQ_INS_LINE); + case CTRL('V') : return(REQ_DEL_CHAR); + case CTRL('H') : return(REQ_DEL_PREV); + case CTRL('Y') : return(REQ_DEL_LINE); + case CTRL('G') : return(REQ_DEL_WORD); + case CTRL('K') : return(REQ_CLR_EOF); + + case CTRL('N') : return(REQ_NEXT_CHOICE); + case CTRL('P') : return(REQ_PREV_CHOICE); + + default: + return(c); + } +} +// +// ------------------------------------------------------------------------- +// User Defined Fieldtypes +// ------------------------------------------------------------------------- +// +bool _nc_xx_fld_fcheck(FIELD *f, const void *u) +{ + NCursesFormField* F = reinterpret_cast(const_cast(u)); + assert(F != 0); + UserDefinedFieldType* udf = reinterpret_cast(F->fieldtype()); + assert(udf != 0); + return udf->field_check(*F); +} + +bool _nc_xx_fld_ccheck(int c, const void *u) +{ + NCursesFormField* F = reinterpret_cast(const_cast(u)); + assert(F != 0); + UserDefinedFieldType* udf = + reinterpret_cast(F->fieldtype()); + assert(udf != 0); + return udf->char_check(c); +} + +void* _nc_xx_fld_makearg(va_list* va) +{ + return va_arg(*va,NCursesFormField*); +} + +FIELDTYPE* UserDefinedFieldType::generic_fieldtype = + ::new_fieldtype(_nc_xx_fld_fcheck, + _nc_xx_fld_ccheck); + +FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = + ::new_fieldtype(_nc_xx_fld_fcheck, + _nc_xx_fld_ccheck); + +bool _nc_xx_next_choice(FIELD *f, const void *u) +{ + NCursesFormField* F = reinterpret_cast(const_cast(u)); + assert(F != 0); + UserDefinedFieldType_With_Choice* udf = + reinterpret_cast(F->fieldtype()); + assert(udf != 0); + return udf->next(*F); +} + +bool _nc_xx_prev_choice(FIELD *f, const void *u) +{ + NCursesFormField* F = reinterpret_cast(const_cast(u)); + assert(F != 0); + UserDefinedFieldType_With_Choice* udf = + reinterpret_cast(F->fieldtype()); + assert(udf != 0); + return udf->previous(*F); +} + +class UDF_Init +{ +private: + int code; + static UDF_Init* I; + +public: + UDF_Init() + : code(0) + { + code = ::set_fieldtype_arg(UserDefinedFieldType::generic_fieldtype, + _nc_xx_fld_makearg, + NULL, + NULL); + if (code==E_OK) + code = ::set_fieldtype_arg + (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, + _nc_xx_fld_makearg, + NULL, + NULL); + if (code==E_OK) + code = ::set_fieldtype_choice + (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, + _nc_xx_next_choice, + _nc_xx_prev_choice); + } +}; + +UDF_Init* UDF_Init::I = new UDF_Init(); diff --git a/c++/cursesf.h b/c++/cursesf.h new file mode 100644 index 00000000000..70a30c370e5 --- /dev/null +++ b/c++/cursesf.h @@ -0,0 +1,967 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +// $Id: cursesf.h,v 1.28 2005/08/13 18:08:24 tom Exp $ + +#ifndef NCURSES_CURSESF_H_incl +#define NCURSES_CURSESF_H_incl 1 + +#include + +#ifndef __EXT_QNX +#include +#endif + +extern "C" { +# include +} +// +// ------------------------------------------------------------------------- +// The abstract base class for buitin and user defined Fieldtypes. +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP NCursesFormField; // forward declaration + +// Class to represent builtin field types as well as C++ written new +// fieldtypes (see classes UserDefineFieldType... +class NCURSES_IMPEXP NCursesFieldType +{ + friend class NCursesFormField; + +protected: + FIELDTYPE* fieldtype; + + inline void OnError(int err) const THROWS(NCursesFormException) { + if (err!=E_OK) + THROW(new NCursesFormException (err)); + } + + NCursesFieldType(FIELDTYPE *f) : fieldtype(f) { + } + + virtual ~NCursesFieldType() {} + + // Set the fields f fieldtype to this one. + virtual void set(NCursesFormField& f) = 0; + +public: + NCursesFieldType() + : fieldtype(STATIC_CAST(FIELDTYPE*)(0)) + { + } + + NCursesFieldType& operator=(const NCursesFieldType& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + NCursesFieldType(const NCursesFieldType& rhs) + : fieldtype(rhs.fieldtype) + { + } + +}; + +// +// ------------------------------------------------------------------------- +// The class representing a forms field, wrapping the lowlevel FIELD struct +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP NCursesFormField +{ + friend class NCursesForm; + +protected: + FIELD *field; // lowlevel structure + NCursesFieldType* ftype; // Associated field type + + // Error handler + inline void OnError (int err) const THROWS(NCursesFormException) { + if (err != E_OK) + THROW(new NCursesFormException (err)); + } + +public: + // Create a 'Null' field. Can be used to delimit a field list + NCursesFormField() + : field(STATIC_CAST(FIELD*)(0)), + ftype(STATIC_CAST(NCursesFieldType*)(0)) + { + } + + // Create a new field + NCursesFormField (int rows, + int ncols, + int first_row = 0, + int first_col = 0, + int offscreen_rows = 0, + int additional_buffers = 0) + : field(0), + ftype(STATIC_CAST(NCursesFieldType*)(0)) + { + field = ::new_field(rows, ncols, first_row, first_col, + offscreen_rows, additional_buffers); + if (!field) + OnError(errno); + } + + NCursesFormField& operator=(const NCursesFormField& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + NCursesFormField(const NCursesFormField& rhs) + : field(rhs.field), ftype(rhs.ftype) + { + } + + virtual ~NCursesFormField (); + + // Duplicate the field at a new position + inline NCursesFormField* dup(int first_row, int first_col) + { + NCursesFormField* f = new NCursesFormField(); + if (!f) + OnError(E_SYSTEM_ERROR); + else { + f->ftype = ftype; + f->field = ::dup_field(field,first_row,first_col); + if (!f->field) + OnError(errno); + } + return f; + } + + // Link the field to a new location + inline NCursesFormField* link(int first_row, int first_col) { + NCursesFormField* f = new NCursesFormField(); + if (!f) + OnError(E_SYSTEM_ERROR); + else { + f->ftype = ftype; + f->field = ::link_field(field,first_row,first_col); + if (!f->field) + OnError(errno); + } + return f; + } + + // Get the lowlevel field representation + inline FIELD* get_field() const { + return field; + } + + // Retrieve info about the field + inline void info(int& rows, int& ncols, + int& first_row, int& first_col, + int& offscreen_rows, int& additional_buffers) const { + OnError(::field_info(field, &rows, &ncols, + &first_row, &first_col, + &offscreen_rows, &additional_buffers)); + } + + // Retrieve info about the fields dynamic properties. + inline void dynamic_info(int& dynamic_rows, int& dynamic_cols, + int& max_growth) const { + OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols, + &max_growth)); + } + + // For a dynamic field you may set the maximum growth limit. + // A zero means unlimited growth. + inline void set_maximum_growth(int growth = 0) { + OnError(::set_max_field(field,growth)); + } + + // Move the field to a new position + inline void move(int row, int col) { + OnError(::move_field(field,row,col)); + } + + // Mark the field to start a new page + inline void new_page(bool pageFlag = FALSE) { + OnError(::set_new_page(field,pageFlag)); + } + + // Retrieve whether or not the field starts a new page. + inline bool is_new_page() const { + return ::new_page(field); + } + + // Set the justification for the field + inline void set_justification(int just) { + OnError(::set_field_just(field,just)); + } + + // Retrieve the fields justification + inline int justification() const { + return ::field_just(field); + } + // Set the foreground attribute for the field + inline void set_foreground(chtype foreground) { + OnError(::set_field_fore(field,foreground)); + } + + // Retrieve the fields foreground attribute + inline chtype fore() const { + return ::field_fore(field); + } + + // Set the background attribute for the field + inline void set_background(chtype background) { + OnError(::set_field_back(field,background)); + } + + // Retrieve the fields background attribute + inline chtype back() const { + return ::field_back(field); + } + + // Set the padding character for the field + inline void set_pad_character(int padding) { + OnError(::set_field_pad(field, padding)); + } + + // Retrieve the fields padding character + inline int pad() const { + return ::field_pad(field); + } + + // Switch on the fields options + inline void options_on (Field_Options opts) { + OnError (::field_opts_on (field, opts)); + } + + // Switch off the fields options + inline void options_off (Field_Options opts) { + OnError (::field_opts_off (field, opts)); + } + + // Retrieve the fields options + inline Field_Options options () const { + return ::field_opts (field); + } + + // Set the fields options + inline void set_options (Field_Options opts) { + OnError (::set_field_opts (field, opts)); + } + + // Mark the field as changed + inline void set_changed(bool changeFlag = TRUE) { + OnError(::set_field_status(field,changeFlag)); + } + + // Test whether or not the field is marked as changed + inline bool changed() const { + return ::field_status(field); + } + + // Return the index of the field in the field array of a form + // or -1 if the field is not associated to a form + inline int (index)() const { + return ::field_index(field); + } + + // Store a value in a fields buffer. The default buffer is nr. 0 + inline void set_value(const char *val, int buffer = 0) { + OnError(::set_field_buffer(field,buffer,val)); + } + + // Retrieve the value of a fields buffer. The default buffer is nr. 0 + inline char* value(int buffer = 0) const { + return ::field_buffer(field,buffer); + } + + // Set the validation type of the field. + inline void set_fieldtype(NCursesFieldType& f) { + ftype = &f; + f.set(*this); // A good friend may do that... + } + + // Retrieve the validation type of the field. + inline NCursesFieldType* fieldtype() const { + return ftype; + } + +}; + + // This are the built-in hook functions in this C++ binding. In C++ we use + // virtual member functions (see below On_..._Init and On_..._Termination) + // to provide this functionality in an object oriented manner. +extern "C" { + void _nc_xx_frm_init(FORM *); + void _nc_xx_frm_term(FORM *); + void _nc_xx_fld_init(FORM *); + void _nc_xx_fld_term(FORM *); +} + +// +// ------------------------------------------------------------------------- +// The class representing a form, wrapping the lowlevel FORM struct +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP NCursesForm : public NCursesPanel +{ +protected: + FORM* form; // the lowlevel structure + +private: + NCursesWindow* sub; // the subwindow object + bool b_sub_owner; // is this our own subwindow? + bool b_framed; // has the form a border? + bool b_autoDelete; // Delete fields when deleting form? + + NCursesFormField** my_fields; // The array of fields for this form + + // This structure is used for the form's user data field to link the + // FORM* to the C++ object and to provide extra space for a user pointer. + typedef struct { + void* m_user; // the pointer for the user's data + const NCursesForm* m_back; // backward pointer to C++ object + const FORM* m_owner; + } UserHook; + + // Get the backward pointer to the C++ object from a FORM + static inline NCursesForm* getHook(const FORM *f) { + UserHook* hook = reinterpret_cast(::form_userptr(f)); + assert(hook != 0 && hook->m_owner==f); + return const_cast(hook->m_back); + } + + friend void _nc_xx_frm_init(FORM *); + friend void _nc_xx_frm_term(FORM *); + friend void _nc_xx_fld_init(FORM *); + friend void _nc_xx_fld_term(FORM *); + + // Calculate FIELD* array for the menu + FIELD** mapFields(NCursesFormField* nfields[]); + +protected: + // internal routines + inline void set_user(void *user) { + UserHook* uptr = reinterpret_cast(::form_userptr (form)); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); + uptr->m_user = user; + } + + inline void *get_user() { + UserHook* uptr = reinterpret_cast(::form_userptr (form)); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); + return uptr->m_user; + } + + void InitForm (NCursesFormField* Fields[], + bool with_frame, + bool autoDeleteFields); + + inline void OnError (int err) const THROWS(NCursesFormException) { + if (err != E_OK) + THROW(new NCursesFormException (err)); + } + + // this wraps the form_driver call. + virtual int driver (int c) ; + + // 'Internal' constructor, builds an object without association to a + // field array. + NCursesForm( int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0) + : NCursesPanel(nlines, ncols, begin_y, begin_x), + form (STATIC_CAST(FORM*)(0)), + sub(0), + b_sub_owner(0), + b_framed(0), + b_autoDelete(0), + my_fields(0) + { + } + +public: + // Create form for the default panel. + NCursesForm (NCursesFormField* Fields[], + bool with_frame=FALSE, // reserve space for a frame? + bool autoDelete_Fields=FALSE) // do automatic cleanup? + : NCursesPanel(), + form(0), + sub(0), + b_sub_owner(0), + b_framed(0), + b_autoDelete(0), + my_fields(0) + { + InitForm(Fields, with_frame, autoDelete_Fields); + } + + // Create a form in a panel with the given position and size. + NCursesForm (NCursesFormField* Fields[], + int nlines, + int ncols, + int begin_y, + int begin_x, + bool with_frame=FALSE, // reserve space for a frame? + bool autoDelete_Fields=FALSE) // do automatic cleanup? + : NCursesPanel(nlines, ncols, begin_y, begin_x), + form(0), + sub(0), + b_sub_owner(0), + b_framed(0), + b_autoDelete(0), + my_fields(0) + { + InitForm(Fields, with_frame, autoDelete_Fields); + } + + NCursesForm& operator=(const NCursesForm& rhs) + { + if (this != &rhs) { + *this = rhs; + NCursesPanel::operator=(rhs); + } + return *this; + } + + NCursesForm(const NCursesForm& rhs) + : NCursesPanel(rhs), + form(rhs.form), + sub(rhs.sub), + b_sub_owner(rhs.b_sub_owner), + b_framed(rhs.b_framed), + b_autoDelete(rhs.b_autoDelete), + my_fields(rhs.my_fields) + { + } + + virtual ~NCursesForm(); + + // Set the default attributes for the form + virtual void setDefaultAttributes(); + + // Retrieve current field of the form. + inline NCursesFormField* current_field() const { + return my_fields[::field_index(::current_field(form))]; + } + + // Set the forms subwindow + void setSubWindow(NCursesWindow& sub); + + // Set these fields for the form + inline void setFields(NCursesFormField* Fields[]) { + OnError(::set_form_fields(form,mapFields(Fields))); + } + + // Remove the form from the screen + inline void unpost (void) { + OnError (::unpost_form (form)); + } + + // Post the form to the screen if flag is true, unpost it otherwise + inline void post(bool flag = TRUE) { + OnError (flag ? ::post_form(form) : ::unpost_form (form)); + } + + // Decorations + inline void frame(const char *title=NULL, const char* btitle=NULL) { + if (b_framed) + NCursesPanel::frame(title,btitle); + else + OnError(E_SYSTEM_ERROR); + } + + inline void boldframe(const char *title=NULL, const char* btitle=NULL) { + if (b_framed) + NCursesPanel::boldframe(title,btitle); + else + OnError(E_SYSTEM_ERROR); + } + + inline void label(const char *topLabel, const char *bottomLabel) { + if (b_framed) + NCursesPanel::label(topLabel,bottomLabel); + else + OnError(E_SYSTEM_ERROR); + } + + // ----- + // Hooks + // ----- + + // Called after the form gets repositioned in its window. + // This is especially true if the form is posted. + virtual void On_Form_Init(); + + // Called before the form gets repositioned in its window. + // This is especially true if the form is unposted. + virtual void On_Form_Termination(); + + // Called after the field became the current field + virtual void On_Field_Init(NCursesFormField& field); + + // Called before this field is left as current field. + virtual void On_Field_Termination(NCursesFormField& field); + + // Calculate required window size for the form. + void scale(int& rows, int& ncols) const { + OnError(::scale_form(form,&rows,&ncols)); + } + + // Retrieve number of fields in the form. + int count() const { + return ::field_count(form); + } + + // Make the page the current page of the form. + void set_page(int pageNum) { + OnError(::set_form_page(form, pageNum)); + } + + // Retrieve current page number + int page() const { + return ::form_page(form); + } + + // Switch on the forms options + inline void options_on (Form_Options opts) { + OnError (::form_opts_on (form, opts)); + } + + // Switch off the forms options + inline void options_off (Form_Options opts) { + OnError (::form_opts_off (form, opts)); + } + + // Retrieve the forms options + inline Form_Options options () const { + return ::form_opts (form); + } + + // Set the forms options + inline void set_options (Form_Options opts) { + OnError (::set_form_opts (form, opts)); + } + + // Are there more data in the current field after the data shown + inline bool data_ahead() const { + return ::data_ahead(form); + } + + // Are there more data in the current field before the data shown + inline bool data_behind() const { + return ::data_behind(form); + } + + // Position the cursor to the current field + inline void position_cursor () { + OnError (::pos_form_cursor (form)); + } + // Set the current field + inline void set_current(NCursesFormField& F) { + OnError (::set_current_field(form, F.field)); + } + + // Provide a default key virtualization. Translate the keyboard + // code c into a form request code. + // The default implementation provides a hopefully straightforward + // mapping for the most common keystrokes and form requests. + virtual int virtualize(int c); + + // Operators + inline NCursesFormField* operator[](int i) const { + if ( (i < 0) || (i >= ::field_count (form)) ) + OnError (E_BAD_ARGUMENT); + return my_fields[i]; + } + + // Perform the menu's operation + // Return the field where you left the form. + virtual NCursesFormField* operator()(void); + + // Exception handlers. The default is a Beep. + virtual void On_Request_Denied(int c) const; + virtual void On_Invalid_Field(int c) const; + virtual void On_Unknown_Command(int c) const; + +}; + +// +// ------------------------------------------------------------------------- +// This is the typical C++ typesafe way to allow to attach +// user data to a field of a form. Its assumed that the user +// data belongs to some class T. Use T as template argument +// to create a UserField. +// ------------------------------------------------------------------------- +template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField +{ +public: + NCursesUserField (int rows, + int ncols, + int first_row = 0, + int first_col = 0, + const T* p_UserData = STATIC_CAST(T*)(0), + int offscreen_rows = 0, + int additional_buffers = 0) + : NCursesFormField (rows, ncols, + first_row, first_col, + offscreen_rows, additional_buffers) { + if (field) + OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData))); + } + + virtual ~NCursesUserField() {}; + + inline const T* UserData (void) const { + return reinterpret_cast(::field_userptr (field)); + } + + inline virtual void setUserData(const T* p_UserData) { + if (field) + OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData))); + } +}; +// +// ------------------------------------------------------------------------- +// The same mechanism is used to attach user data to a form +// ------------------------------------------------------------------------- +// +template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm +{ +protected: + // 'Internal' constructor, builds an object without association to a + // field array. + NCursesUserForm( int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0)) + : NCursesForm(nlines,ncols,begin_y,begin_x) { + if (form) + set_user (const_cast(p_UserData)); + } + +public: + NCursesUserForm (NCursesFormField Fields[], + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) + : NCursesForm (Fields, with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); + }; + + NCursesUserForm (NCursesFormField Fields[], + int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) + : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, + with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); + }; + + virtual ~NCursesUserForm() { + }; + + inline T* UserData (void) const { + return reinterpret_cast(get_user ()); + }; + + inline virtual void setUserData (const T* p_UserData) { + if (form) + set_user (const_cast(p_UserData)); + } + +}; +// +// ------------------------------------------------------------------------- +// Builtin Fieldtypes +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType +{ +private: + int min_field_width; + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); + } + +public: + Alpha_Field(int width) + : NCursesFieldType(TYPE_ALPHA), + min_field_width(width) { + } +}; + +class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType +{ +private: + int min_field_width; + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); + } + +public: + Alphanumeric_Field(int width) + : NCursesFieldType(TYPE_ALNUM), + min_field_width(width) { + } +}; + +class NCURSES_IMPEXP Integer_Field : public NCursesFieldType +{ +private: + int precision; + long lower_limit, upper_limit; + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype, + precision,lower_limit,upper_limit)); + } + +public: + Integer_Field(int prec, long low=0L, long high=0L) + : NCursesFieldType(TYPE_INTEGER), + precision(prec), lower_limit(low), upper_limit(high) { + } +}; + +class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType +{ +private: + int precision; + double lower_limit, upper_limit; + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype, + precision,lower_limit,upper_limit)); + } + +public: + Numeric_Field(int prec, double low=0.0, double high=0.0) + : NCursesFieldType(TYPE_NUMERIC), + precision(prec), lower_limit(low), upper_limit(high) { + } +}; + +class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType +{ +private: + char* regex; + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype,regex)); + } + + void copy_regex(const char *source) + { + regex = new char[1 + ::strlen(source)]; + (::strcpy)(regex, source); + } + +public: + Regular_Expression_Field(const char *expr) + : NCursesFieldType(TYPE_REGEXP), + regex(NULL) + { + copy_regex(expr); + } + + Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs) + { + if (this != &rhs) { + *this = rhs; + copy_regex(rhs.regex); + NCursesFieldType::operator=(rhs); + } + return *this; + } + + Regular_Expression_Field(const Regular_Expression_Field& rhs) + : NCursesFieldType(rhs), + regex(NULL) + { + copy_regex(rhs.regex); + } + + ~Regular_Expression_Field() { + delete[] regex; + } +}; + +class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType +{ +private: + const char** list; + int case_sensitive; + int non_unique_matches; + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype, + list,case_sensitive,non_unique_matches)); + } +public: + Enumeration_Field(const char* enums[], + bool case_sens=FALSE, + bool non_unique=FALSE) + : NCursesFieldType(TYPE_ENUM), + list(enums), + case_sensitive(case_sens ? -1 : 0), + non_unique_matches(non_unique ? -1 : 0) { + } + + Enumeration_Field& operator=(const Enumeration_Field& rhs) + { + if (this != &rhs) { + *this = rhs; + NCursesFieldType::operator=(rhs); + } + return *this; + } + + Enumeration_Field(const Enumeration_Field& rhs) + : NCursesFieldType(rhs), + list(rhs.list), + case_sensitive(rhs.case_sensitive), + non_unique_matches(rhs.non_unique_matches) + { + } +}; + +class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType +{ +private: + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype)); + } + +public: + IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) { + } +}; + +extern "C" { + bool _nc_xx_fld_fcheck(FIELD *, const void*); + bool _nc_xx_fld_ccheck(int c, const void *); + void* _nc_xx_fld_makearg(va_list*); +} + +// +// ------------------------------------------------------------------------- +// Abstract base class for User-Defined Fieldtypes +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType +{ + friend class UDF_Init; // Internal helper to set up statics +private: + // For all C++ defined fieldtypes we need only one generic lowlevel + // FIELDTYPE* element. + static FIELDTYPE* generic_fieldtype; + +protected: + // This are the functions required by the low level libforms functions + // to construct a fieldtype. + friend bool _nc_xx_fld_fcheck(FIELD *, const void*); + friend bool _nc_xx_fld_ccheck(int c, const void *); + friend void* _nc_xx_fld_makearg(va_list*); + + void set(NCursesFormField& f) { + OnError(::set_field_type(f.get_field(),fieldtype,&f)); + } + +protected: + // Redefine this function to do a field validation. The argument + // is a reference to the field you should validate. + virtual bool field_check(NCursesFormField& f) = 0; + + // Redefine this function to do a character validation. The argument + // is the character to be validated. + virtual bool char_check (int c) = 0; + +public: + UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) { + } +}; + +extern "C" { + bool _nc_xx_next_choice(FIELD*, const void *); + bool _nc_xx_prev_choice(FIELD*, const void *); +} + +// +// ------------------------------------------------------------------------- +// Abstract base class for User-Defined Fieldtypes with Choice functions +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType +{ + friend class UDF_Init; // Internal helper to set up statics +private: + // For all C++ defined fieldtypes with choice functions we need only one + // generic lowlevel FIELDTYPE* element. + static FIELDTYPE* generic_fieldtype_with_choice; + + // This are the functions required by the low level libforms functions + // to construct a fieldtype with choice functions. + friend bool _nc_xx_next_choice(FIELD*, const void *); + friend bool _nc_xx_prev_choice(FIELD*, const void *); + +protected: + // Redefine this function to do the retrieval of the next choice value. + // The argument is a reference to the field tobe examined. + virtual bool next (NCursesFormField& f) = 0; + + // Redefine this function to do the retrieval of the previous choice value. + // The argument is a reference to the field tobe examined. + virtual bool previous(NCursesFormField& f) = 0; + +public: + UserDefinedFieldType_With_Choice() { + fieldtype = generic_fieldtype_with_choice; + } +}; + +#endif /* NCURSES_CURSESF_H_incl */ diff --git a/c++/cursesm.cc b/c++/cursesm.cc new file mode 100644 index 00000000000..c253a679990 --- /dev/null +++ b/c++/cursesm.cc @@ -0,0 +1,407 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +#include "internal.h" +#include "cursesm.h" +#include "cursesapp.h" + +MODULE_ID("$Id: cursesm.cc,v 1.22 2005/04/02 20:39:05 tom Exp $") + +NCursesMenuItem::~NCursesMenuItem() +{ + if (item) + OnError(::free_item(item)); +} + +bool +NCursesMenuItem::action() +{ + return FALSE; +} + +NCursesMenuCallbackItem::~NCursesMenuCallbackItem() +{ +} + +bool +NCursesMenuCallbackItem::action() +{ + if (p_fct) + return p_fct (*this); + else + return FALSE; +} + +/* Internal hook functions. They will route the hook + * calls to virtual methods of the NCursesMenu class, + * so in C++ providing a hook is done simply by + * implementing a virtual method in a derived class + */ +void +_nc_xx_mnu_init(MENU *m) +{ + NCursesMenu::getHook(m)->On_Menu_Init(); +} + +void +_nc_xx_mnu_term(MENU *m) +{ + NCursesMenu::getHook(m)->On_Menu_Termination(); +} + +void +_nc_xx_itm_init(MENU *m) +{ + NCursesMenu* M = NCursesMenu::getHook(m); + M->On_Item_Init (*(M->current_item ())); +} + +void +_nc_xx_itm_term(MENU *m) +{ + NCursesMenu* M = NCursesMenu::getHook(m); + M->On_Item_Termination (*(M->current_item ())); +} + +/* Construct an ITEM* array from an array of NCursesMenuItem + * objects. + */ +ITEM** +NCursesMenu::mapItems(NCursesMenuItem* nitems[]) +{ + int itemCount = 0,lcv; + + for (lcv=0; nitems[lcv]->item; ++lcv) + ++itemCount; + + ITEM** itemArray = new ITEM*[itemCount + 1]; + + for (lcv=0;nitems[lcv]->item;++lcv) { + itemArray[lcv] = nitems[lcv]->item; + } + itemArray[lcv] = NULL; + + my_items = nitems; + + if (menu) + delete[] ::menu_items(menu); + return itemArray; +} + +void +NCursesMenu::InitMenu(NCursesMenuItem* nitems[], + bool with_frame, + bool autoDelete_Items) +{ + int mrows, mcols; + + keypad(TRUE); + meta(TRUE); + + b_framed = with_frame; + b_autoDelete = autoDelete_Items; + + menu = static_cast(0); + menu = ::new_menu(mapItems(nitems)); + if (!menu) + OnError (E_SYSTEM_ERROR); + + UserHook* hook = new UserHook; + hook->m_user = NULL; + hook->m_back = this; + hook->m_owner = menu; + ::set_menu_userptr(menu, static_cast(hook)); + + ::set_menu_init (menu, _nc_xx_mnu_init); + ::set_menu_term (menu, _nc_xx_mnu_term); + ::set_item_init (menu, _nc_xx_itm_init); + ::set_item_term (menu, _nc_xx_itm_term); + + scale(mrows, mcols); + ::set_menu_win(menu, w); + + if (with_frame) { + if ((mrows > height()-2) || (mcols > width()-2)) + OnError(E_NO_ROOM); + sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); + ::set_menu_sub(menu, sub->w); + b_sub_owner = TRUE; + } + else { + sub = static_cast(0); + b_sub_owner = FALSE; + } + setDefaultAttributes(); +} + +void +NCursesMenu::setDefaultAttributes() +{ + NCursesApplication* S = NCursesApplication::getApplication(); + if (S) { + ::set_menu_fore(menu, S->foregrounds()); + ::set_menu_back(menu, S->backgrounds()); + ::set_menu_grey(menu, S->inactives()); + } +} + +NCursesMenu::~NCursesMenu() +{ + UserHook* hook = reinterpret_cast(::menu_userptr(menu)); + delete hook; + if (b_sub_owner) { + delete sub; + ::set_menu_sub(menu, static_cast(0)); + } + if (menu) { + ITEM** itms = ::menu_items(menu); + int cnt = count(); + + OnError(::set_menu_items(menu, static_cast(0))); + + if (b_autoDelete) { + if (cnt>0) { + for (int i=0; i <= cnt; i++) + delete my_items[i]; + } + delete[] my_items; + } + + ::free_menu(menu); + // It's essential to do this after free_menu() + delete[] itms; + } +} + +void +NCursesMenu::setSubWindow(NCursesWindow& nsub) +{ + if (!isDescendant(nsub)) + OnError(E_SYSTEM_ERROR); + else { + if (b_sub_owner) + delete sub; + sub = ⊄ + ::set_menu_sub(menu,sub->w); + } +} + +bool +NCursesMenu::set_pattern (const char *pat) +{ + int res = ::set_menu_pattern (menu, pat); + switch(res) { + case E_OK: + break; + case E_NO_MATCH: + return FALSE; + default: + OnError (res); + } + return TRUE; +} + +// call the menu driver and do basic error checking. +int +NCursesMenu::driver (int c) +{ + int res = ::menu_driver (menu, c); + switch (res) { + case E_OK: + case E_REQUEST_DENIED: + case E_NOT_SELECTABLE: + case E_UNKNOWN_COMMAND: + case E_NO_MATCH: + break; + default: + OnError (res); + } + return (res); +} + +static const int CMD_QUIT = MAX_COMMAND + 1; +static const int CMD_ACTION = MAX_COMMAND + 2; +// +// ------------------------------------------------------------------------- +// Provide a default key virtualization. Translate the keyboard +// code c into a menu request code. +// The default implementation provides a hopefully straightforward +// mapping for the most common keystrokes and menu requests. +// ------------------------------------------------------------------------- +int +NCursesMenu::virtualize(int c) +{ + switch(c) { + case CTRL('X') : return(CMD_QUIT); // eXit + + case KEY_DOWN : return(REQ_DOWN_ITEM); + case CTRL('N') : return(REQ_NEXT_ITEM); // Next + case KEY_UP : return(REQ_UP_ITEM); + case CTRL('P') : return(REQ_PREV_ITEM); // Previous + + case CTRL('U') : return(REQ_SCR_ULINE); // Up + case CTRL('D') : return(REQ_SCR_DLINE); // Down + case CTRL('F') : return(REQ_SCR_DPAGE); // Forward + case CTRL('B') : return(REQ_SCR_UPAGE); // Backward + + case CTRL('Y') : return(REQ_CLEAR_PATTERN); + case CTRL('H') : return(REQ_BACK_PATTERN); + case CTRL('A') : return(REQ_NEXT_MATCH); + case CTRL('E') : return(REQ_PREV_MATCH); + case CTRL('T') : return(REQ_TOGGLE_ITEM); + + case CTRL('J') : + case CTRL('M') : return(CMD_ACTION); + + case KEY_HOME : return(REQ_FIRST_ITEM); + case KEY_LEFT : return(REQ_LEFT_ITEM); + case KEY_RIGHT : return(REQ_RIGHT_ITEM); + case KEY_END : return(REQ_LAST_ITEM); + case KEY_BACKSPACE : return(REQ_BACK_PATTERN); + case KEY_NPAGE : return(REQ_SCR_DPAGE); + case KEY_PPAGE : return(REQ_SCR_UPAGE); + + default: + return(c); + } +} + +NCursesMenuItem* +NCursesMenu::operator()(void) +{ + int drvCmnd; + int err; + int c; + bool b_action = FALSE; + + post(); + show(); + refresh(); + + while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { + + switch((err=driver(drvCmnd))) { + case E_REQUEST_DENIED: + On_Request_Denied(c); + break; + case E_NOT_SELECTABLE: + On_Not_Selectable(c); + break; + case E_UNKNOWN_COMMAND: + if (drvCmnd == CMD_ACTION) { + if (options() & O_ONEVALUE) { + NCursesMenuItem* itm = current_item(); + assert(itm != 0); + if (itm->options() & O_SELECTABLE) + { + b_action = itm->action(); + refresh(); + } + else + On_Not_Selectable(c); + } + else { + int n = count(); + for(int i=0; ivalue()) { + b_action |= itm->action(); + refresh(); + } + } + } + } else + On_Unknown_Command(c); + break; + case E_NO_MATCH: + On_No_Match(c); + break; + case E_OK: + break; + default: + OnError(err); + } + } + + unpost(); + hide(); + refresh(); + if (options() & O_ONEVALUE) + return my_items[::item_index (::current_item (menu))]; + else + return NULL; +} + +void +NCursesMenu::On_Menu_Init() +{ +} + +void +NCursesMenu::On_Menu_Termination() +{ +} + +void +NCursesMenu::On_Item_Init(NCursesMenuItem& item) +{ +} + +void +NCursesMenu::On_Item_Termination(NCursesMenuItem& item) +{ +} + +void +NCursesMenu::On_Request_Denied(int c) const +{ + ::beep(); +} + +void +NCursesMenu::On_Not_Selectable(int c) const +{ + ::beep(); +} + +void +NCursesMenu::On_No_Match(int c) const +{ + ::beep(); +} + +void +NCursesMenu::On_Unknown_Command(int c) const +{ + ::beep(); +} diff --git a/c++/cursesm.h b/c++/cursesm.h new file mode 100644 index 00000000000..d9c2273e6f6 --- /dev/null +++ b/c++/cursesm.h @@ -0,0 +1,672 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +// $Id: cursesm.h,v 1.25 2005/08/13 18:10:36 tom Exp $ + +#ifndef NCURSES_CURSESM_H_incl +#define NCURSES_CURSESM_H_incl 1 + +#include + +extern "C" { +# include +} +// +// ------------------------------------------------------------------------- +// This wraps the ITEM type of +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP NCursesMenuItem +{ + friend class NCursesMenu; + +protected: + ITEM *item; + + inline void OnError (int err) const THROWS(NCursesMenuException) { + if (err != E_OK) + THROW(new NCursesMenuException (err)); + } + +public: + NCursesMenuItem (const char* p_name = NULL, + const char* p_descript = NULL) + : item(0) + { + item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0); + if (p_name && !item) + OnError (E_SYSTEM_ERROR); + } + // Create an item. If you pass both parameters as NULL, a delimiting + // item is constructed which can be used to terminate a list of + // NCursesMenu objects. + + NCursesMenuItem& operator=(const NCursesMenuItem& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + NCursesMenuItem(const NCursesMenuItem& rhs) + : item(0) + { + } + + virtual ~NCursesMenuItem (); + // Release the items memory + + inline const char* name () const { + return ::item_name (item); + } + // Name of the item + + inline const char* description () const { + return ::item_description (item); + } + // Description of the item + + inline int (index) (void) const { + return ::item_index (item); + } + // Index of the item in an item array (or -1) + + inline void options_on (Item_Options opts) { + OnError (::item_opts_on (item, opts)); + } + // Switch on the items options + + inline void options_off (Item_Options opts) { + OnError (::item_opts_off (item, opts)); + } + // Switch off the item's option + + inline Item_Options options () const { + return ::item_opts (item); + } + // Retrieve the items options + + inline void set_options (Item_Options opts) { + OnError (::set_item_opts (item, opts)); + } + // Set the items options + + inline void set_value (bool f) { + OnError (::set_item_value (item,f)); + } + // Set/Reset the items selection state + + inline bool value () const { + return ::item_value (item); + } + // Retrieve the items selection state + + inline bool visible () const { + return ::item_visible (item); + } + // Retrieve visibility of the item + + virtual bool action(); + // Perform an action associated with this item; you may use this in an + // user supplied driver for a menu; you may derive from this class and + // overload action() to supply items with different actions. + // If an action returns true, the menu will be exited. The default action + // is to do nothing. +}; + +// Prototype for an items callback function. +typedef bool ITEMCALLBACK(NCursesMenuItem&); + +// If you don't like to create a child class for individual items to +// overload action(), you may use this class and provide a callback +// function pointer for items. +class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem +{ +private: + ITEMCALLBACK* p_fct; + +public: + NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, + const char* p_name = NULL, + const char* p_descript = NULL ) + : NCursesMenuItem (p_name, p_descript), + p_fct (fct) { + } + + NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs) + : NCursesMenuItem(rhs), + p_fct(0) + { + } + + virtual ~NCursesMenuCallbackItem(); + + bool action(); +}; + + // This are the built-in hook functions in this C++ binding. In C++ we use + // virtual member functions (see below On_..._Init and On_..._Termination) + // to provide this functionality in an object oriented manner. +extern "C" { + void _nc_xx_mnu_init(MENU *); + void _nc_xx_mnu_term(MENU *); + void _nc_xx_itm_init(MENU *); + void _nc_xx_itm_term(MENU *); +} + +// +// ------------------------------------------------------------------------- +// This wraps the MENU type of +// ------------------------------------------------------------------------- +// +class NCURSES_IMPEXP NCursesMenu : public NCursesPanel +{ +protected: + MENU *menu; + +private: + NCursesWindow* sub; // the subwindow object + bool b_sub_owner; // is this our own subwindow? + bool b_framed; // has the menu a border? + bool b_autoDelete; // Delete items when deleting menu? + + NCursesMenuItem** my_items; // The array of items for this menu + + // This structure is used for the menu's user data field to link the + // MENU* to the C++ object and to provide extra space for a user pointer. + typedef struct { + void* m_user; // the pointer for the user's data + const NCursesMenu* m_back; // backward pointer to C++ object + const MENU* m_owner; + } UserHook; + + // Get the backward pointer to the C++ object from a MENU + static inline NCursesMenu* getHook(const MENU *m) { + UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m)); + assert(hook != 0 && hook->m_owner==m); + return const_cast(hook->m_back); + } + + friend void _nc_xx_mnu_init(MENU *); + friend void _nc_xx_mnu_term(MENU *); + friend void _nc_xx_itm_init(MENU *); + friend void _nc_xx_itm_term(MENU *); + + // Calculate ITEM* array for the menu + ITEM** mapItems(NCursesMenuItem* nitems[]); + +protected: + // internal routines + inline void set_user(void *user) { + UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); + uptr->m_user = user; + } + + inline void *get_user() { + UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); + assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); + return uptr->m_user; + } + + void InitMenu (NCursesMenuItem* menu[], + bool with_frame, + bool autoDeleteItems); + + inline void OnError (int err) const THROWS(NCursesMenuException) { + if (err != E_OK) + THROW(new NCursesMenuException (this, err)); + } + + // this wraps the menu_driver call. + virtual int driver (int c) ; + + // 'Internal' constructor to create a menu without association to + // an array of items. + NCursesMenu( int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0) + : NCursesPanel(nlines,ncols,begin_y,begin_x), + menu (STATIC_CAST(MENU*)(0)), + sub(0), + b_sub_owner(0), + b_framed(0), + b_autoDelete(0), + my_items(0) + { + } + +public: + // Make a full window size menu + NCursesMenu (NCursesMenuItem* Items[], + bool with_frame=FALSE, // Reserve space for a frame? + bool autoDelete_Items=FALSE) // Autocleanup of Items? + : NCursesPanel(), + menu(0), + sub(0), + b_sub_owner(0), + b_framed(0), + b_autoDelete(0), + my_items(0) + { + InitMenu(Items, with_frame, autoDelete_Items); + } + + // Make a menu with a window of this size. + NCursesMenu (NCursesMenuItem* Items[], + int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0, + bool with_frame=FALSE, // Reserve space for a frame? + bool autoDelete_Items=FALSE) // Autocleanup of Items? + : NCursesPanel(nlines, ncols, begin_y, begin_x), + menu(0), + sub(0), + b_sub_owner(0), + b_framed(0), + b_autoDelete(0), + my_items(0) + { + InitMenu(Items, with_frame, autoDelete_Items); + } + + NCursesMenu& operator=(const NCursesMenu& rhs) + { + if (this != &rhs) { + *this = rhs; + NCursesPanel::operator=(rhs); + } + return *this; + } + + NCursesMenu(const NCursesMenu& rhs) + : NCursesPanel(rhs), + menu(rhs.menu), + sub(rhs.sub), + b_sub_owner(rhs.b_sub_owner), + b_framed(rhs.b_framed), + b_autoDelete(rhs.b_autoDelete), + my_items(rhs.my_items) + { + } + + virtual ~NCursesMenu (); + + // Retrieve the menus subwindow + inline NCursesWindow& subWindow() const { + assert(sub!=NULL); + return *sub; + } + + // Set the menus subwindow + void setSubWindow(NCursesWindow& sub); + + // Set these items for the menu + inline void setItems(NCursesMenuItem* Items[]) { + OnError(::set_menu_items(menu,mapItems(Items))); + } + + // Remove the menu from the screen + inline void unpost (void) { + OnError (::unpost_menu (menu)); + } + + // Post the menu to the screen if flag is true, unpost it otherwise + inline void post(bool flag = TRUE) { + flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu)); + } + + // Get the numer of rows and columns for this menu + inline void scale (int& mrows, int& mcols) const { + OnError (::scale_menu (menu, &mrows, &mcols)); + } + + // Set the format of this menu + inline void set_format(int mrows, int mcols) { + OnError (::set_menu_format(menu, mrows, mcols)); + } + + // Get the format of this menu + inline void menu_format(int& rows,int& ncols) { + ::menu_format(menu,&rows,&ncols); + } + + // Items of the menu + inline NCursesMenuItem* items() const { + return *my_items; + } + + // Get the number of items in this menu + inline int count() const { + return ::item_count(menu); + } + + // Get the current item (i.e. the one the cursor is located) + inline NCursesMenuItem* current_item() const { + return my_items[::item_index(::current_item(menu))]; + } + + // Get the marker string + inline const char* mark() const { + return ::menu_mark(menu); + } + + // Set the marker string + inline void set_mark(const char *marker) { + OnError (::set_menu_mark (menu, marker)); + } + + // Get the name of the request code c + inline static const char* request_name(int c) { + return ::menu_request_name(c); + } + + // Get the current pattern + inline char* pattern() const { + return ::menu_pattern(menu); + } + + // true if there is a pattern match, false otherwise. + bool set_pattern (const char *pat); + + // set the default attributes for the menu + // i.e. set fore, back and grey attribute + virtual void setDefaultAttributes(); + + // Get the menus background attributes + inline chtype back() const { + return ::menu_back(menu); + } + + // Get the menus foreground attributes + inline chtype fore() const { + return ::menu_fore(menu); + } + + // Get the menus grey attributes (used for unselectable items) + inline chtype grey() const { + return ::menu_grey(menu); + } + + // Set the menus background attributes + inline chtype set_background(chtype a) { + return ::set_menu_back(menu,a); + } + + // Set the menus foreground attributes + inline chtype set_foreground(chtype a) { + return ::set_menu_fore(menu,a); + } + + // Set the menus grey attributes (used for unselectable items) + inline chtype set_grey(chtype a) { + return ::set_menu_grey(menu,a); + } + + inline void options_on (Menu_Options opts) { + OnError (::menu_opts_on (menu,opts)); + } + + inline void options_off(Menu_Options opts) { + OnError (::menu_opts_off(menu,opts)); + } + + inline Menu_Options options() const { + return ::menu_opts(menu); + } + + inline void set_options (Menu_Options opts) { + OnError (::set_menu_opts (menu,opts)); + } + + inline int pad() const { + return ::menu_pad(menu); + } + + inline void set_pad (int padch) { + OnError (::set_menu_pad (menu, padch)); + } + + // Position the cursor to the current item + inline void position_cursor () const { + OnError (::pos_menu_cursor (menu)); + } + + // Set the current item + inline void set_current(NCursesMenuItem& I) { + OnError (::set_current_item(menu, I.item)); + } + + // Get the current top row of the menu + inline int top_row (void) const { + return ::top_row (menu); + } + + // Set the current top row of the menu + inline void set_top_row (int row) { + OnError (::set_top_row (menu, row)); + } + + // spacing control + // Set the spacing for the menu + inline void setSpacing(int spc_description, + int spc_rows, + int spc_columns) { + OnError(::set_menu_spacing(menu, + spc_description, + spc_rows, + spc_columns)); + } + + // Get the spacing info for the menu + inline void Spacing(int& spc_description, + int& spc_rows, + int& spc_columns) const { + OnError(::menu_spacing(menu, + &spc_description, + &spc_rows, + &spc_columns)); + } + + // Decorations + inline void frame(const char *title=NULL, const char* btitle=NULL) { + if (b_framed) + NCursesPanel::frame(title,btitle); + else + OnError(E_SYSTEM_ERROR); + } + + inline void boldframe(const char *title=NULL, const char* btitle=NULL) { + if (b_framed) + NCursesPanel::boldframe(title,btitle); + else + OnError(E_SYSTEM_ERROR); + } + + inline void label(const char *topLabel, const char *bottomLabel) { + if (b_framed) + NCursesPanel::label(topLabel,bottomLabel); + else + OnError(E_SYSTEM_ERROR); + } + + // ----- + // Hooks + // ----- + + // Called after the menu gets repositioned in its window. + // This is especially true if the menu is posted. + virtual void On_Menu_Init(); + + // Called before the menu gets repositioned in its window. + // This is especially true if the menu is unposted. + virtual void On_Menu_Termination(); + + // Called after the item became the current item + virtual void On_Item_Init(NCursesMenuItem& item); + + // Called before this item is left as current item. + virtual void On_Item_Termination(NCursesMenuItem& item); + + // Provide a default key virtualization. Translate the keyboard + // code c into a menu request code. + // The default implementation provides a hopefully straightforward + // mapping for the most common keystrokes and menu requests. + virtual int virtualize(int c); + + + // Operators + inline NCursesMenuItem* operator[](int i) const { + if ( (i < 0) || (i >= ::item_count (menu)) ) + OnError (E_BAD_ARGUMENT); + return (my_items[i]); + } + + // Perform the menu's operation + // Return the item where you left the selection mark for a single + // selection menu, or NULL for a multivalued menu. + virtual NCursesMenuItem* operator()(void); + + // -------------------- + // Exception handlers + // Called by operator() + // -------------------- + + // Called if the request is denied + virtual void On_Request_Denied(int c) const; + + // Called if the item is not selectable + virtual void On_Not_Selectable(int c) const; + + // Called if pattern doesn't match + virtual void On_No_Match(int c) const; + + // Called if the command is unknown + virtual void On_Unknown_Command(int c) const; + +}; +// +// ------------------------------------------------------------------------- +// This is the typical C++ typesafe way to allow to attach +// user data to an item of a menu. Its assumed that the user +// data belongs to some class T. Use T as template argument +// to create a UserItem. +// ------------------------------------------------------------------------- +// +template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem +{ +public: + NCursesUserItem (const char* p_name, + const char* p_descript = NULL, + const T* p_UserData = STATIC_CAST(T*)(0)) + : NCursesMenuItem (p_name, p_descript) { + if (item) + OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); + } + + virtual ~NCursesUserItem() {} + + inline const T* UserData (void) const { + return reinterpret_cast(::item_userptr (item)); + }; + + inline virtual void setUserData(const T* p_UserData) { + if (item) + OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); + } +}; +// +// ------------------------------------------------------------------------- +// The same mechanism is used to attach user data to a menu +// ------------------------------------------------------------------------- +// +template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu +{ +protected: + NCursesUserMenu( int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0)) + : NCursesMenu(nlines,ncols,begin_y,begin_x) { + if (menu) + set_user (const_cast(p_UserData)); + } + +public: + NCursesUserMenu (NCursesMenuItem Items[], + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Items=FALSE) + : NCursesMenu (Items, with_frame, autoDelete_Items) { + if (menu) + set_user (const_cast(p_UserData)); + }; + + NCursesUserMenu (NCursesMenuItem Items[], + int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE) + : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { + if (menu) + set_user (const_cast(p_UserData)); + }; + + virtual ~NCursesUserMenu() { + }; + + inline T* UserData (void) const { + return reinterpret_cast(get_user ()); + }; + + inline virtual void setUserData (const T* p_UserData) { + if (menu) + set_user (const_cast(p_UserData)); + } +}; + +#endif /* NCURSES_CURSESM_H_incl */ diff --git a/c++/cursesmain.cc b/c++/cursesmain.cc new file mode 100644 index 00000000000..1f82d4ad84c --- /dev/null +++ b/c++/cursesmain.cc @@ -0,0 +1,93 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), 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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +#include "internal.h" +#include "cursesapp.h" + +#if CPP_HAS_TRY_CATCH && HAVE_IOSTREAM +#include +#else +#undef CPP_HAS_TRY_CATCH +#define CPP_HAS_TRY_CATCH 0 +#endif + +MODULE_ID("$Id: cursesmain.cc,v 1.14 2007/04/07 17:10:11 tom Exp $") + +#if HAVE_LOCALE_H +#include +#else +#define setlocale(name,string) /* nothing */ +#endif + +#if NO_LEAKS +#include +#endif + +/* This is the default implementation of main() for a NCursesApplication. + * You only have to instantiate a static NCursesApplication object in your + * main application source file and link this module with your application. + */ +int main(int argc, char* argv[]) +{ + setlocale(LC_ALL, ""); + + NCursesApplication* A = NCursesApplication::getApplication(); + if (!A) + return(1); + else { + int res; + + A->handleArgs(argc,argv); + ::endwin(); +#if CPP_HAS_TRY_CATCH + try { + res = (*A)(); + ::endwin(); + } + catch(const NCursesException &e) { + ::endwin(); + std::cerr << e.message << std::endl; + res = e.errorno; + } +#else + res = (*A)(); + ::endwin(); +#endif +#if NO_LEAKS + delete A; + _nc_free_and_exit(res); +#else + return(res); +#endif + } +} diff --git a/c++/cursesp.cc b/c++/cursesp.cc new file mode 100644 index 00000000000..9c4eab6954e --- /dev/null +++ b/c++/cursesp.cc @@ -0,0 +1,138 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1993, 1997 * + ****************************************************************************/ + +#include "internal.h" +#include "cursesp.h" + +MODULE_ID("$Id: cursesp.cc,v 1.25 2005/08/06 22:12:36 tom Exp $") + +NCursesPanel* NCursesPanel::dummy = static_cast(0); + +void NCursesPanel::init() +{ + p = ::new_panel(w); + if (!p) + OnError(ERR); + + UserHook* hook = new UserHook; + hook->m_user = NULL; + hook->m_back = this; + hook->m_owner = p; + ::set_panel_userptr(p, reinterpret_cast(hook)); +} + +NCursesPanel::~NCursesPanel() +{ + UserHook* hook = UserPointer(); + assert(hook != 0 && hook->m_back==this && hook->m_owner==p); + delete hook; + ::del_panel(p); + ::update_panels(); +} + +void +NCursesPanel::redraw() +{ + PANEL *pan; + + pan = ::panel_above(NULL); + while (pan) { + ::touchwin(panel_window(pan)); + pan = ::panel_above(pan); + } + ::update_panels(); + ::doupdate(); +} + +int +NCursesPanel::refresh() +{ + ::update_panels(); + return ::doupdate(); +} + +int +NCursesPanel::noutrefresh() +{ + ::update_panels(); + return OK; +} + +void +NCursesPanel::boldframe(const char *title, const char* btitle) +{ + standout(); + frame(title, btitle); + standend(); +} + +void +NCursesPanel::frame(const char *title,const char *btitle) +{ + int err = OK; + if (!title && !btitle) { + err = box(); + } + else { + err = box(); + if (err==OK) + label(title,btitle); + } + OnError(err); +} + +void +NCursesPanel::label(const char *tLabel, const char *bLabel) +{ + if (tLabel) + centertext(0,tLabel); + if (bLabel) + centertext(maxy(),bLabel); +} + +void +NCursesPanel::centertext(int row,const char *labelText) +{ + if (labelText) { + int x = (maxx() - ::strlen(labelText)) / 2; + if (x<0) + x=0; + OnError(addstr(row, x, labelText, width())); + } +} + +int +NCursesPanel::getKey(void) +{ + return getch(); +} diff --git a/c++/cursesp.h b/c++/cursesp.h new file mode 100644 index 00000000000..9b63d6d671b --- /dev/null +++ b/c++/cursesp.h @@ -0,0 +1,268 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +#ifndef NCURSES_CURSESP_H_incl +#define NCURSES_CURSESP_H_incl 1 + +// $Id: cursesp.h,v 1.29 2008/08/16 17:20:23 tom Exp $ + +#include + +extern "C" { +# include +} + +class NCURSES_IMPEXP NCursesPanel + : public NCursesWindow +{ +protected: + PANEL *p; + static NCursesPanel *dummy; + +private: + // This structure is used for the panel's user data field to link the + // PANEL* to the C++ object and to provide extra space for a user pointer. + typedef struct { + void* m_user; // the pointer for the user's data + const NCursesPanel* m_back; // backward pointer to C++ object + const PANEL* m_owner; // the panel itself + } UserHook; + + inline UserHook *UserPointer() + { + UserHook* uptr = reinterpret_cast( + const_cast(::panel_userptr (p))); + return uptr; + } + + void init(); // Initialize the panel object + +protected: + void set_user(void *user) + { + UserHook* uptr = UserPointer(); + if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) { + uptr->m_user = user; + } + } + // Set the user pointer of the panel. + + void *get_user() + { + UserHook* uptr = UserPointer(); + void *result = 0; + if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) + result = uptr->m_user; + return result; + } + + void OnError (int err) const THROWS(NCursesPanelException) + { + if (err==ERR) + THROW(new NCursesPanelException (this, err)); + } + // If err is equal to the curses error indicator ERR, an error handler + // is called. + + // Get a keystroke. Default implementation calls getch() + virtual int getKey(void); + +public: + NCursesPanel(int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0) + : NCursesWindow(nlines,ncols,begin_y,begin_x), p(0) + { + init(); + } + // Create a panel with this size starting at the requested position. + + NCursesPanel() + : NCursesWindow(::stdscr), p(0) + { + init(); + } + // This constructor creates the default Panel associated with the + // ::stdscr window + + NCursesPanel& operator=(const NCursesPanel& rhs) + { + if (this != &rhs) { + *this = rhs; + NCursesWindow::operator=(rhs); + } + return *this; + } + + NCursesPanel(const NCursesPanel& rhs) + : NCursesWindow(rhs), + p(rhs.p) + { + } + + virtual ~NCursesPanel(); + + // basic manipulation + inline void hide() + { + OnError (::hide_panel(p)); + } + // Hide the panel. It stays in the stack but becomes invisible. + + inline void show() + { + OnError (::show_panel(p)); + } + // Show the panel, i.e. make it visible. + + inline void top() + { + OnError (::top_panel(p)); + } + // Make this panel the top panel in the stack. + + inline void bottom() + { + OnError (::bottom_panel(p)); + } + // Make this panel the bottom panel in the stack. + // N.B.: The panel associated with ::stdscr is always on the bottom. So + // actually bottom() makes the panel the first above ::stdscr. + + virtual int mvwin(int y, int x) + { + OnError(::move_panel(p, y, x)); + return OK; + } + + inline bool hidden() const + { + return (::panel_hidden (p) ? TRUE : FALSE); + } + // Return TRUE if the panel is hidden, FALSE otherwise. + +/* The functions panel_above() and panel_below() are not reflected in + the NCursesPanel class. The reason for this is, that we cannot + assume that a panel retrieved by those operations is one wrapped + by a C++ class. Although this situation might be handled, we also + need a reverse mapping from PANEL to NCursesPanel which needs some + redesign of the low level stuff. At the moment, we define them in the + interface but they will always produce an error. */ + inline NCursesPanel& above() const + { + OnError(ERR); + return *dummy; + } + + inline NCursesPanel& below() const + { + OnError(ERR); + return *dummy; + } + + // Those two are rewrites of the corresponding virtual members of + // NCursesWindow + virtual int refresh(); + // Propagate all panel changes to the virtual screen and update the + // physical screen. + + virtual int noutrefresh(); + // Propagate all panel changes to the virtual screen. + + static void redraw(); + // Redraw all panels. + + // decorations + virtual void frame(const char* title=NULL, + const char* btitle=NULL); + // Put a frame around the panel and put the title centered in the top line + // and btitle in the bottom line. + + virtual void boldframe(const char* title=NULL, + const char* btitle=NULL); + // Same as frame(), but use highlighted attributes. + + virtual void label(const char* topLabel, + const char* bottomLabel); + // Put the title centered in the top line and btitle in the bottom line. + + virtual void centertext(int row,const char* label); + // Put the label text centered in the specified row. +}; + +/* We use templates to provide a typesafe mechanism to associate + * user data with a panel. A NCursesUserPanel is a panel + * associated with some user data of type T. + */ +template class NCursesUserPanel : public NCursesPanel +{ +public: + NCursesUserPanel (int nlines, + int ncols, + int begin_y = 0, + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0)) + : NCursesPanel (nlines, ncols, begin_y, begin_x) + { + if (p) + set_user (const_cast(p_UserData)); + }; + // This creates an user panel of the requested size with associated + // user data pointed to by p_UserData. + + NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel() + { + if (p) + set_user(const_cast(p_UserData)); + }; + // This creates an user panel associated with the ::stdscr and user data + // pointed to by p_UserData. + + virtual ~NCursesUserPanel() {}; + + T* UserData (void) const + { + return reinterpret_cast(get_user ()); + }; + // Retrieve the user data associated with the panel. + + virtual void setUserData (const T* p_UserData) + { + if (p) + set_user (const_cast(p_UserData)); + } + // Associate the user panel with the user data pointed to by p_UserData. +}; + +#endif /* NCURSES_CURSESP_H_incl */ diff --git a/c++/cursespad.cc b/c++/cursespad.cc new file mode 100644 index 00000000000..28c58fab36a --- /dev/null +++ b/c++/cursespad.cc @@ -0,0 +1,279 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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: Juergen Pfeifer, 1999 * + ****************************************************************************/ + +#include "internal.h" + +#include +#include + +MODULE_ID("$Id: cursespad.cc,v 1.13 2008/08/04 18:59:22 tom Exp $") + +NCursesPad::NCursesPad(int nlines, int ncols) + : NCursesWindow(), + viewWin(static_cast(0)), + viewSub(static_cast(0)), + h_gridsize(0), v_gridsize(0), + min_row(0), min_col(0) +{ + w = ::newpad(nlines, ncols); + if (static_cast(0) == w) { + count--; + err_handler("Cannot construct window"); + } + alloced = TRUE; +} + + +int NCursesPad::driver (int key) +{ + // Default implementation + switch(key) { + case KEY_UP: + // ======= + return REQ_PAD_UP; + case KEY_DOWN: + // ========= + return REQ_PAD_DOWN; + case KEY_LEFT: + // ========= + return REQ_PAD_LEFT; + case KEY_RIGHT: + // ========== + return REQ_PAD_RIGHT; + case KEY_EXIT: + // ========= + case CTRL('X'): + // ========== + return REQ_PAD_EXIT; + + default: return(key); + } +} + + +void NCursesPad::operator()(void) +{ + NCursesWindow* W = Win(); + + if (static_cast(0) != W) { + int Width = W->width(); + int Height = W->height(); + + int req = REQ_PAD_REFRESH; + + W->keypad(TRUE); + W->meta(TRUE); + refresh(); + + do { + bool changed = FALSE; + + switch (req) { + case REQ_PAD_REFRESH: + // ================ + changed = TRUE; + break; + case REQ_PAD_LEFT: + // ============= + if (min_col > 0) { + changed = TRUE; + if (min_col < h_gridsize) + min_col = 0; + else + min_col -= h_gridsize; + } + else + OnNavigationError(req); + break; + case REQ_PAD_RIGHT: + // ============== + if (min_col < (width() - Width - 1)) { + changed = TRUE; + if (min_col > (width() - Width - h_gridsize - 1)) + min_col = width() - Width - 1; + else + min_col += h_gridsize; + } + else + OnNavigationError(req); + break; + case REQ_PAD_UP: + // =========== + if (min_row > 0) { + changed = TRUE; + if (min_row < v_gridsize) + min_row = 0; + else + min_row -= v_gridsize; + } + else + OnNavigationError(req); + break; + case REQ_PAD_DOWN: + // ============= + if (min_row < (height() - Height - 1)) { + changed = TRUE; + if (min_row > (height() - Height - v_gridsize - 1)) + min_row = height() - Height - 1; + else + min_row += v_gridsize; + } + else + OnNavigationError(req); + break; + + default: + OnUnknownOperation(req); + } + + if (changed) { + noutrefresh(); + W->syncup(); + OnOperation(req); + viewWin->refresh(); + } + } while( (req=driver(W->getch())) != REQ_PAD_EXIT ); + } +} + + +int NCursesPad::refresh() +{ + int res = noutrefresh(); + if (res==OK && (static_cast(0) != viewWin)) { + res = (viewWin->refresh()); + } + return(res); +} + +int NCursesPad::noutrefresh() +{ + int res = OK; + NCursesWindow* W = Win(); + if (static_cast(0) != W) { + int high = W->maxy(); + int wide = W->maxx(); + res = copywin(*W, min_row, min_col, + 0, 0, high, wide, + FALSE); + if (res==OK) { + W->syncup(); + res = viewWin->noutrefresh(); + } + } + return (res); +} + +void NCursesPad::setWindow(NCursesWindow& view, + int v_grid NCURSES_PARAM_INIT(1), + int h_grid NCURSES_PARAM_INIT(1)) +{ + viewWin = &view; + min_row = min_col = 0; + if (h_grid <=0 || v_grid <= 0) + err_handler("Illegal Gridsize"); + else { + h_gridsize = h_grid; + v_gridsize = v_grid; + } +} + +void NCursesPad::setSubWindow(NCursesWindow& sub) +{ + if (static_cast(0) == viewWin) + err_handler("Pad has no viewport"); + assert(viewWin != 0); + if (!viewWin->isDescendant(sub)) + THROW(new NCursesException("NCursesFramePad", E_SYSTEM_ERROR)); + viewSub = ⊂ +} + +void NCursesFramedPad::OnOperation(int pad_req) +{ + NCursesWindow* W = Win(); + NCursesWindow* W2 = getWindow(); + + if ((static_cast(0) != W) && (static_cast(0) != W2)) { + int Width = W->width(); + int Height = W->height(); + int i, row, col, h_len, v_len; + + h_len = (Width*Width + width() - 1)/width(); + if (h_len==0) + h_len = 1; + if (h_len > Width) + h_len = Width; + + v_len = (Height*Height + height() - 1)/height(); + if (v_len==0) + v_len = 1; + if (v_len > Height) + v_len = Height; + + col = (min_col * Width + width() - 1) / width(); + if (col + h_len > Width) + col = Width - h_len; + + row = (min_row * Height + height() - 1) / height(); + if (row + v_len > Height) + row = Height - v_len; + + W2->vline(1,Width+1,Height); + W2->attron(A_REVERSE); + if (v_len>=2) { + W2->addch(row+1,Width+1,ACS_UARROW); + for(i=2;iaddch(row+i,Width+1,' '); + W2->addch(row+v_len,Width+1,ACS_DARROW); + } + else { + for(i=1;i<=v_len;i++) + W2->addch(row+i,Width+1,' '); + } + W2->attroff(A_REVERSE); + + W2->hline(Height+1,1,Width); + W2->attron(A_REVERSE); + if (h_len >= 2) { + W2->addch(Height+1,col+1,ACS_LARROW); + for(i=2;iaddch(Height+1,col+i,' '); + W2->addch(Height+1,col+h_len,ACS_RARROW); + } + else { + for(i=1;i<=h_len;i++) + W2->addch(Height+1,col+i,' '); + } + W2->attroff(A_REVERSE); + } +} diff --git a/c++/cursesw.cc b/c++/cursesw.cc new file mode 100644 index 00000000000..47e5cf64dcf --- /dev/null +++ b/c++/cursesw.cc @@ -0,0 +1,468 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 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 * + * "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. * + ****************************************************************************/ + +/* + * Authors: + * Thomas E. Dickey + * Juergen Pfeifer + * + * The NCursesWindow class was originally based on a file written by + * Eric Newton, later modified by Ulrich Drepper and Anatoly Ivasyuk. + * However, aside from the compatible interface definition, no trace + * of the original code remains in this version: it consists only of + * changes introduced since 1995. + */ + +#include "internal.h" +#include "cursesw.h" + +MODULE_ID("$Id: cursesw.cc,v 1.51 2009/03/28 21:31:37 tom Exp $") + +#define COLORS_NEED_INITIALIZATION -1 +#define COLORS_NOT_INITIALIZED 0 +#define COLORS_MONOCHROME 1 +#define COLORS_ARE_REALLY_THERE 2 + +#define HaveColors() (colorInitialized == COLORS_ARE_REALLY_THERE) + +// declare static variables for the class +long NCursesWindow::count = 0L; +bool NCursesWindow::b_initialized = FALSE; + +int +NCursesWindow::scanw(const char* fmt, ...) +{ + int result = ERR; + + va_list args; + va_start(args, fmt); + result = ::vw_scanw (w, const_cast(fmt), args); + va_end(args); + + return result; +} + + +int +NCursesWindow::scanw(int y, int x, const char* fmt, ...) +{ + int result = ERR; + + if (::wmove(w, y, x) != ERR) { + va_list args; + va_start(args, fmt); + result = ::vw_scanw (w, const_cast(fmt), args); + va_end(args); + } + return result; +} + + +int +NCursesWindow::scanw(const char* fmt, va_list args) +{ + int result = ERR; + + result = ::vw_scanw (w, const_cast(fmt), args); + + return result; +} + + +int +NCursesWindow::scanw(int y, int x, const char* fmt, va_list args) +{ + int result = ERR; + + if (::wmove(w, y, x) != ERR) { + result = ::vw_scanw (w, const_cast(fmt), args); + } + return result; +} + + +int +NCursesWindow::printw(const char * fmt, ...) +{ + va_list args; + va_start(args, fmt); + int result = ::vw_printw(w, fmt, args); + va_end(args); + return result; +} + + +int +NCursesWindow::printw(int y, int x, const char * fmt, ...) +{ + va_list args; + va_start(args, fmt); + int result = ::wmove(w, y, x); + if (result == OK) { + result = ::vw_printw(w, fmt, args); + } + va_end(args); + return result; +} + + +int +NCursesWindow::printw(const char * fmt, va_list args) +{ + int result = ::vw_printw(w, fmt, args); + return result; +} + + +int +NCursesWindow::printw(int y, int x, const char * fmt, va_list args) +{ + int result = ::wmove(w, y, x); + if (result == OK) { + result = ::vw_printw(w, fmt, args); + } + return result; +} + + +void +NCursesWindow::set_keyboard(void) +{ + keypad(TRUE); + meta(TRUE); +} + +void +NCursesWindow::err_handler(const char *msg) const THROWS(NCursesException) +{ + THROW(new NCursesException(msg)); +} + +void +NCursesWindow::initialize() +{ + if (!b_initialized) { + ::initscr(); + b_initialized = TRUE; + if (colorInitialized == COLORS_NEED_INITIALIZATION) { + colorInitialized = COLORS_NOT_INITIALIZED; + useColors(); + } + ::noecho(); + ::cbreak(); + } +} + +void +NCursesWindow::constructing() +{ + initialize(); + ++count; +} + +NCursesWindow::NCursesWindow() + : w(0), alloced(FALSE), par(0), subwins(0), sib(0) +{ + constructing(); + + w = static_cast(0); + set_keyboard(); +} + +NCursesWindow::NCursesWindow(int nlines, int ncols, int begin_y, int begin_x) + : w(0), alloced(TRUE), par(0), subwins(0), sib(0) +{ + constructing(); + + w = ::newwin(nlines, ncols, begin_y, begin_x); + if (w == 0) { + err_handler("Cannot construct window"); + } + set_keyboard(); +} + +NCursesWindow::NCursesWindow(WINDOW* window) + : w(0), alloced(FALSE), par(0), subwins(0), sib(0) +{ + constructing(); + + // We used to use a reference on the "window" parameter, but we cannot do + // that with an opaque pointer (see NCURSES_OPAQUE). If the parameter was + // "::stdscr", that is first set via the "constructing() call, and is null + // up to that point. So we allow a null pointer here as meaning the "same" + // as "::stdscr". + w = window ? window : ::stdscr; + set_keyboard(); +} + +NCursesWindow::NCursesWindow(NCursesWindow& win, int ny, int nx, + int begin_y, int begin_x, char absrel) + : w(0), alloced(TRUE), par(0), subwins(0), sib(0) +{ + constructing(); + if (absrel == 'a') { // absolute origin + begin_y -= win.begy(); + begin_x -= win.begx(); + } + + // Link this window into its parent's list of subwindows. + // We use derwin(), since this also works for pads. + w = ::derwin(win.w, ny, nx, begin_y, begin_x); + if (w == 0) { + err_handler("Cannot construct subwindow"); + } + + par = &win; + sib = win.subwins; + win.subwins = this; +} + +NCursesWindow::NCursesWindow(NCursesWindow& win, + bool do_box NCURSES_PARAM_INIT(TRUE)) + : w(0), alloced(TRUE), par(0), subwins(0), sib(0) +{ + constructing(); + int myHeight = win.height(); + int myWidth = win.width(); + w = :: derwin(win.w, myHeight - 2, myWidth - 2, 1, 1); + if (w == 0) { + err_handler("Cannot construct subwindow"); + } + + par = &win; + sib = win.subwins; + win.subwins = this; + subwins = 0; + + if (do_box) { + win.box(); + win.touchwin(); + } +} + +NCursesWindow NCursesWindow::Clone() +{ + WINDOW *d = ::dupwin(w); + NCursesWindow W(d); + W.subwins = subwins; + W.sib = sib; + W.par = par; + W.alloced = alloced; + return W; +} + +typedef int (*RIPOFFINIT)(NCursesWindow&); +static RIPOFFINIT R_INIT[5]; // There can't be more +static int r_init_idx = 0; +static RIPOFFINIT* prip = R_INIT; + +NCursesWindow::NCursesWindow(WINDOW *win, int ncols) + : w(0), alloced(FALSE), par(0), subwins(0), sib(0) +{ + initialize(); + w = win; +} + +int _nc_xx_ripoff_init(WINDOW *w, int ncols) +{ + int res = ERR; + + RIPOFFINIT init = *prip++; + if (init) { + res = init(*(new NCursesWindow(w,ncols))); + } + return res; +} + +int NCursesWindow::ripoffline(int ripoff_lines, + int (*init)(NCursesWindow& win)) +{ + int code = ::_nc_ripoffline(ripoff_lines,_nc_xx_ripoff_init); + if (code == OK && init && ripoff_lines) { + R_INIT[r_init_idx++] = init; + } + return code; +} + +bool +NCursesWindow::isDescendant(NCursesWindow& win) +{ + bool result = FALSE; + + for (NCursesWindow* p = subwins; p != NULL; p = p->sib) { + if (p == &win || p->isDescendant(win)) { + result = TRUE; + break; + } + } + return result; +} + +void +NCursesWindow::kill_subwindows() +{ + NCursesWindow* p = subwins; + + subwins = 0; + while (p != 0) { + NCursesWindow* q = p->sib; + p->kill_subwindows(); + if (p->alloced) { + if (p->w != 0) + ::delwin(p->w); + } + delete p; + p = q; + } +} + + +NCursesWindow::~NCursesWindow() +{ + kill_subwindows(); + + if (par != 0) { + // Remove this window from the parent's list of subwindows. + NCursesWindow * next = par->subwins; + NCursesWindow * prev = 0; + while (next != 0) { + if (next == this) { + if (prev != 0) { + prev->sib = next->sib; + } else { + par->subwins = next->sib; + } + break; + } + prev = next; + next = next->sib; + } + } + + if (alloced && w != 0) + ::delwin(w); + + if (alloced) { + --count; + if (count == 0) { + ::endwin(); + } else if (count < 0) { // cannot happen! + err_handler("Too many windows destroyed"); + } + } +} + +// --------------------------------------------------------------------- +// Color stuff +// +int NCursesWindow::colorInitialized = COLORS_NOT_INITIALIZED; + +void +NCursesWindow::useColors(void) +{ + if (colorInitialized == COLORS_NOT_INITIALIZED) { + if (b_initialized) { + if (::has_colors()) { + ::start_color(); + colorInitialized = COLORS_ARE_REALLY_THERE; + } else { + colorInitialized = COLORS_MONOCHROME; + } + } else { + colorInitialized = COLORS_NEED_INITIALIZATION; + } + } +} + +short +NCursesWindow::getPair() const +{ + return static_cast(PAIR_NUMBER(getattrs(w))); +} + +short +NCursesWindow::getcolor(int getback) const +{ + short fore, back; + + if (HaveColors()) { + if (::pair_content(getPair(), &fore, &back) == ERR) + err_handler("Can't get color pair"); + } else { + // Monochrome means white on black + back = COLOR_BLACK; + fore = COLOR_WHITE; + } + return getback ? back : fore; +} + +int NCursesWindow::NumberOfColors() +{ + return (HaveColors()) ? COLORS : 1; +} + +short +NCursesWindow::getcolor() const +{ + return (HaveColors()) ? getPair() : 0; +} + +int +NCursesWindow::setpalette(short fore, short back, short pair) +{ + return (HaveColors()) ? ::init_pair(pair, fore, back) : OK; +} + +int +NCursesWindow::setpalette(short fore, short back) +{ + return setpalette(fore, back, getPair()); +} + + +int +NCursesWindow::setcolor(short pair) +{ + if (HaveColors()) { + if ((pair < 1) || (pair > COLOR_PAIRS)) + err_handler("Can't set color pair"); + + attroff(A_COLOR); + attrset(COLOR_PAIR(pair)); + } + return OK; +} + +#if HAVE_HAS_KEY +bool NCursesWindow::has_mouse() const +{ + return ((::has_key(KEY_MOUSE) || ::has_mouse()) + ? TRUE : FALSE); +} +#endif diff --git a/c++/cursesw.h b/c++/cursesw.h new file mode 100644 index 00000000000..b8e921a9b7a --- /dev/null +++ b/c++/cursesw.h @@ -0,0 +1,1556 @@ +// * This makes emacs happy -*-Mode: C++;-*- +// vile:cppmode +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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. * + ****************************************************************************/ + +#ifndef NCURSES_CURSESW_H_incl +#define NCURSES_CURSESW_H_incl 1 + +// $Id: cursesw.h,v 1.48 2008/01/19 21:09:10 tom Exp $ + +#include + +extern "C" { +# include +} + +/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. + Undefine it here, because NCursesWindow uses lines as a method. */ +#undef lines + +/* "Convert" macros to inlines. We'll define it as another symbol to avoid + * conflict with library symbols. + */ +#undef UNDEF +#define UNDEF(name) CUR_ ##name + +#ifdef addch +inline int UNDEF(addch)(chtype ch) { return addch(ch); } +#undef addch +#define addch UNDEF(addch) +#endif + +#ifdef addchstr +inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); } +#undef addchstr +#define addchstr UNDEF(addchstr) +#endif + +#ifdef addnstr +inline int UNDEF(addnstr)(const char *str, int n) +{ return addnstr(str, n); } +#undef addnstr +#define addnstr UNDEF(addnstr) +#endif + +#ifdef addstr +inline int UNDEF(addstr)(const char * str) { return addstr(str); } +#undef addstr +#define addstr UNDEF(addstr) +#endif + +#ifdef attroff +inline int UNDEF(attroff)(chtype at) { return attroff(at); } +#undef attroff +#define attroff UNDEF(attroff) +#endif + +#ifdef attron +inline int UNDEF(attron)(chtype at) { return attron(at); } +#undef attron +#define attron UNDEF(attron) +#endif + +#ifdef attrset +inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } +#undef attrset +#define attrset UNDEF(attrset) +#endif + +#ifdef bkgd +inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } +#undef bkgd +#define bkgd UNDEF(bkgd) +#endif + +#ifdef bkgdset +inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } +#undef bkgdset +#define bkgdset UNDEF(bkgdset) +#endif + +#ifdef border +inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) +{ return border(ls, rs, ts, bs, tl, tr, bl, br); } +#undef border +#define border UNDEF(border) +#endif + +#ifdef box +inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } +#undef box +#define box UNDEF(box) +#endif + +#ifdef chgat +inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) { + return chgat(n, attr, color, opts); } +#undef chgat +#define chgat UNDEF(chgat) +#endif + +#ifdef clear +inline int UNDEF(clear)() { return clear(); } +#undef clear +#define clear UNDEF(clear) +#endif + +#ifdef clearok +inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } +#undef clearok +#define clearok UNDEF(clearok) +#else +extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); +#endif + +#ifdef clrtobot +inline int UNDEF(clrtobot)() { return clrtobot(); } +#undef clrtobot +#define clrtobot UNDEF(clrtobot) +#endif + +#ifdef clrtoeol +inline int UNDEF(clrtoeol)() { return clrtoeol(); } +#undef clrtoeol +#define clrtoeol UNDEF(clrtoeol) +#endif + +#ifdef color_set +inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); } +#undef color_set +#define color_set UNDEF(color_set) +#endif + +#ifdef crmode +inline int UNDEF(crmode)(void) { return crmode(); } +#undef crmode +#define crmode UNDEF(crmode) +#endif + +#ifdef delch +inline int UNDEF(delch)() { return delch(); } +#undef delch +#define delch UNDEF(delch) +#endif + +#ifdef deleteln +inline int UNDEF(deleteln)() { return deleteln(); } +#undef deleteln +#define deleteln UNDEF(deleteln) +#endif + +#ifdef echochar +inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } +#undef echochar +#define echochar UNDEF(echochar) +#endif + +#ifdef erase +inline int UNDEF(erase)() { return erase(); } +#undef erase +#define erase UNDEF(erase) +#endif + +#ifdef fixterm +inline int UNDEF(fixterm)(void) { return fixterm(); } +#undef fixterm +#define fixterm UNDEF(fixterm) +#endif + +#ifdef flushok +inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { + return flushok(_win, _bf); } +#undef flushok +#define flushok UNDEF(flushok) +#else +#define _no_flushok +#endif + +#ifdef getattrs +inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); } +#undef getattrs +#define getattrs UNDEF(getattrs) +#endif + +#ifdef getbegyx +inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } +#undef getbegyx +#define getbegyx UNDEF(getbegyx) +#endif + +#ifdef getbkgd +inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } +#undef getbkgd +#define getbkgd UNDEF(getbkgd) +#endif + +#ifdef getch +inline int UNDEF(getch)() { return getch(); } +#undef getch +#define getch UNDEF(getch) +#endif + +#ifdef getmaxyx +inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } +#undef getmaxyx +#define getmaxyx UNDEF(getmaxyx) +#endif + +#ifdef getnstr +inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } +#undef getnstr +#define getnstr UNDEF(getnstr) +#endif + +#ifdef getparyx +inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); } +#undef getparyx +#define getparyx UNDEF(getparyx) +#endif + +#ifdef getstr +inline int UNDEF(getstr)(char *_str) { return getstr(_str); } +#undef getstr +#define getstr UNDEF(getstr) +#endif + +#ifdef getyx +inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { + getyx(win, y, x); } +#undef getyx +#define getyx UNDEF(getyx) +#endif + +#ifdef hline +inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } +#undef hline +#define hline UNDEF(hline) +#endif + +#ifdef inch +inline chtype UNDEF(inch)() { return inch(); } +#undef inch +#define inch UNDEF(inch) +#endif + +#ifdef inchstr +inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); } +#undef inchstr +#define inchstr UNDEF(inchstr) +#endif + +#ifdef innstr +inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } +#undef innstr +#define innstr UNDEF(innstr) +#endif + +#ifdef insch +inline int UNDEF(insch)(chtype c) { return insch(c); } +#undef insch +#define insch UNDEF(insch) +#endif + +#ifdef insdelln +inline int UNDEF(insdelln)(int n) { return insdelln(n); } +#undef insdelln +#define insdelln UNDEF(insdelln) +#endif + +#ifdef insertln +inline int UNDEF(insertln)() { return insertln(); } +#undef insertln +#define insertln UNDEF(insertln) +#endif + +#ifdef insnstr +inline int UNDEF(insnstr)(const char *_str, int n) { + return insnstr(_str, n); } +#undef insnstr +#define insnstr UNDEF(insnstr) +#endif + +#ifdef insstr +inline int UNDEF(insstr)(const char *_str) { + return insstr(_str); } +#undef insstr +#define insstr UNDEF(insstr) +#endif + +#ifdef instr +inline int UNDEF(instr)(char *_str) { return instr(_str); } +#undef instr +#define instr UNDEF(instr) +#endif + +#ifdef intrflush +inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); } +#undef intrflush +#define intrflush UNDEF(intrflush) +#endif + +#ifdef leaveok +inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } +#undef leaveok +#define leaveok UNDEF(leaveok) +#else +extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); +#endif + +#ifdef move +inline int UNDEF(move)(int x, int y) { return move(x, y); } +#undef move +#define move UNDEF(move) +#endif + +#ifdef mvaddch +inline int UNDEF(mvaddch)(int y, int x, chtype ch) +{ return mvaddch(y, x, ch); } +#undef mvaddch +#define mvaddch UNDEF(mvaddch) +#endif + +#ifdef mvaddnstr +inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) +{ return mvaddnstr(y, x, str, n); } +#undef mvaddnstr +#define mvaddnstr UNDEF(mvaddnstr) +#endif + +#ifdef mvaddstr +inline int UNDEF(mvaddstr)(int y, int x, const char * str) +{ return mvaddstr(y, x, str); } +#undef mvaddstr +#define mvaddstr UNDEF(mvaddstr) +#endif + +#ifdef mvchgat +inline int UNDEF(mvchgat)(int y, int x, int n, + attr_t attr, short color, const void *opts) { + return mvchgat(y, x, n, attr, color, opts); } +#undef mvchgat +#define mvchgat UNDEF(mvchgat) +#endif + +#ifdef mvdelch +inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} +#undef mvdelch +#define mvdelch UNDEF(mvdelch) +#endif + +#ifdef mvgetch +inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} +#undef mvgetch +#define mvgetch UNDEF(mvgetch) +#endif + +#ifdef mvgetnstr +inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { + return mvgetnstr(y, x, str, n);} +#undef mvgetnstr +#define mvgetnstr UNDEF(mvgetnstr) +#endif + +#ifdef mvgetstr +inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} +#undef mvgetstr +#define mvgetstr UNDEF(mvgetstr) +#endif + +#ifdef mvinch +inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} +#undef mvinch +#define mvinch UNDEF(mvinch) +#endif + +#ifdef mvinnstr +inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { + return mvinnstr(y, x, _str, n); } +#undef mvinnstr +#define mvinnstr UNDEF(mvinnstr) +#endif + +#ifdef mvinsch +inline int UNDEF(mvinsch)(int y, int x, chtype c) +{ return mvinsch(y, x, c); } +#undef mvinsch +#define mvinsch UNDEF(mvinsch) +#endif + +#ifdef mvinsnstr +inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { + return mvinsnstr(y, x, _str, n); } +#undef mvinsnstr +#define mvinsnstr UNDEF(mvinsnstr) +#endif + +#ifdef mvinsstr +inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { + return mvinsstr(y, x, _str); } +#undef mvinsstr +#define mvinsstr UNDEF(mvinsstr) +#endif + +#ifdef mvwaddch +inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) +{ return mvwaddch(win, y, x, ch); } +#undef mvwaddch +#define mvwaddch UNDEF(mvwaddch) +#endif + +#ifdef mvwaddchnstr +inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n) +{ return mvwaddchnstr(win, y, x, str, n); } +#undef mvwaddchnstr +#define mvwaddchnstr UNDEF(mvwaddchnstr) +#endif + +#ifdef mvwaddchstr +inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str) +{ return mvwaddchstr(win, y, x, str); } +#undef mvwaddchstr +#define mvwaddchstr UNDEF(mvwaddchstr) +#endif + +#ifdef mvwaddnstr +inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) +{ return mvwaddnstr(win, y, x, str, n); } +#undef mvwaddnstr +#define mvwaddnstr UNDEF(mvwaddnstr) +#endif + +#ifdef mvwaddstr +inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) +{ return mvwaddstr(win, y, x, str); } +#undef mvwaddstr +#define mvwaddstr UNDEF(mvwaddstr) +#endif + +#ifdef mvwchgat +inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, + attr_t attr, short color, const void *opts) { + return mvwchgat(win, y, x, n, attr, color, opts); } +#undef mvwchgat +#define mvwchgat UNDEF(mvwchgat) +#endif + +#ifdef mvwdelch +inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) +{ return mvwdelch(win, y, x); } +#undef mvwdelch +#define mvwdelch UNDEF(mvwdelch) +#endif + +#ifdef mvwgetch +inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} +#undef mvwgetch +#define mvwgetch UNDEF(mvwgetch) +#endif + +#ifdef mvwgetnstr +inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) +{return mvwgetnstr(win, y, x, str, n);} +#undef mvwgetnstr +#define mvwgetnstr UNDEF(mvwgetnstr) +#endif + +#ifdef mvwgetstr +inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) +{return mvwgetstr(win, y, x, str);} +#undef mvwgetstr +#define mvwgetstr UNDEF(mvwgetstr) +#endif + +#ifdef mvwhline +inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { + return mvwhline(win, y, x, c, n); } +#undef mvwhline +#define mvwhline UNDEF(mvwhline) +#endif + +#ifdef mvwinch +inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { + return mvwinch(win, y, x);} +#undef mvwinch +#define mvwinch UNDEF(mvwinch) +#endif + +#ifdef mvwinchnstr +inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); } +#undef mvwinchnstr +#define mvwinchnstr UNDEF(mvwinchnstr) +#endif + +#ifdef mvwinchstr +inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); } +#undef mvwinchstr +#define mvwinchstr UNDEF(mvwinchstr) +#endif + +#ifdef mvwinnstr +inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { + return mvwinnstr(win, y, x, _str, n); } +#undef mvwinnstr +#define mvwinnstr UNDEF(mvwinnstr) +#endif + +#ifdef mvwinsch +inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) +{ return mvwinsch(win, y, x, c); } +#undef mvwinsch +#define mvwinsch UNDEF(mvwinsch) +#endif + +#ifdef mvwinsnstr +inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { + return mvwinsnstr(w, y, x, _str, n); } +#undef mvwinsnstr +#define mvwinsnstr UNDEF(mvwinsnstr) +#endif + +#ifdef mvwinsstr +inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { + return mvwinsstr(w, y, x, _str); } +#undef mvwinsstr +#define mvwinsstr UNDEF(mvwinsstr) +#endif + +#ifdef mvwvline +inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { + return mvwvline(win, y, x, c, n); } +#undef mvwvline +#define mvwvline UNDEF(mvwvline) +#endif + +#ifdef napms +inline void UNDEF(napms)(unsigned long x) { napms(x); } +#undef napms +#define napms UNDEF(napms) +#endif + +#ifdef nocrmode +inline int UNDEF(nocrmode)(void) { return nocrmode(); } +#undef nocrmode +#define nocrmode UNDEF(nocrmode) +#endif + +#ifdef nodelay +inline void UNDEF(nodelay)() { nodelay(); } +#undef nodelay +#define nodelay UNDEF(nodelay) +#endif + +#ifdef redrawwin +inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } +#undef redrawwin +#define redrawwin UNDEF(redrawwin) +#endif + +#ifdef refresh +inline int UNDEF(refresh)() { return refresh(); } +#undef refresh +#define refresh UNDEF(refresh) +#endif + +#ifdef resetterm +inline int UNDEF(resetterm)(void) { return resetterm(); } +#undef resetterm +#define resetterm UNDEF(resetterm) +#endif + +#ifdef saveterm +inline int UNDEF(saveterm)(void) { return saveterm(); } +#undef saveterm +#define saveterm UNDEF(saveterm) +#endif + +#ifdef scrl +inline int UNDEF(scrl)(int l) { return scrl(l); } +#undef scrl +#define scrl UNDEF(scrl) +#endif + +#ifdef scroll +inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } +#undef scroll +#define scroll UNDEF(scroll) +#endif + +#ifdef scrollok +inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } +#undef scrollok +#define scrollok UNDEF(scrollok) +#else +#if defined(__NCURSES_H) +extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); +#else +extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); +#endif +#endif + +#ifdef setscrreg +inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } +#undef setscrreg +#define setscrreg UNDEF(setscrreg) +#endif + +#ifdef standend +inline int UNDEF(standend)() { return standend(); } +#undef standend +#define standend UNDEF(standend) +#endif + +#ifdef standout +inline int UNDEF(standout)() { return standout(); } +#undef standout +#define standout UNDEF(standout) +#endif + +#ifdef subpad +inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) +{ return derwin(p, l, c, y, x); } +#undef subpad +#define subpad UNDEF(subpad) +#endif + +#ifdef timeout +inline void UNDEF(timeout)(int delay) { timeout(delay); } +#undef timeout +#define timeout UNDEF(timeout) +#endif + +#ifdef touchline +inline int UNDEF(touchline)(WINDOW *win, int s, int c) +{ return touchline(win, s, c); } +#undef touchline +#define touchline UNDEF(touchline) +#endif + +#ifdef touchwin +inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } +#undef touchwin +#define touchwin UNDEF(touchwin) +#endif + +#ifdef untouchwin +inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } +#undef untouchwin +#define untouchwin UNDEF(untouchwin) +#endif + +#ifdef vline +inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } +#undef vline +#define vline UNDEF(vline) +#endif + +#ifdef waddchstr +inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } +#undef waddchstr +#define waddchstr UNDEF(waddchstr) +#endif + +#ifdef waddstr +inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } +#undef waddstr +#define waddstr UNDEF(waddstr) +#endif + +#ifdef wattroff +inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } +#undef wattroff +#define wattroff UNDEF(wattroff) +#endif + +#ifdef wattrset +inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } +#undef wattrset +#define wattrset UNDEF(wattrset) +#endif + +#ifdef winch +inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } +#undef winch +#define winch UNDEF(winch) +#endif + +#ifdef winchnstr +inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); } +#undef winchnstr +#define winchnstr UNDEF(winchnstr) +#endif + +#ifdef winchstr +inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); } +#undef winchstr +#define winchstr UNDEF(winchstr) +#endif + +#ifdef winsstr +inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { + return winsstr(w, _str); } +#undef winsstr +#define winsstr UNDEF(winsstr) +#endif + +#ifdef wstandend +inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } +#undef wstandend +#define wstandend UNDEF(wstandend) +#endif + +#ifdef wstandout +inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } +#undef wstandout +#define wstandout UNDEF(wstandout) +#endif + +/* + * + * C++ class for windows. + * + */ + +extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); +extern "C" int _nc_xx_ripoff_init(WINDOW *, int); +extern "C" int _nc_has_mouse(void); + +class NCURSES_IMPEXP NCursesWindow +{ + friend class NCursesMenu; + friend class NCursesForm; + +private: + static bool b_initialized; + static void initialize(); + void constructing(); + friend int _nc_xx_ripoff_init(WINDOW *, int); + + void set_keyboard(); + + short getcolor(int getback) const; + short getPair() const; + + static int setpalette(short fore, short back, short pair); + static int colorInitialized; + + // This private constructor is only used during the initialization + // of windows generated by ripoffline() calls. + NCursesWindow(WINDOW* win, int ncols); + +protected: + virtual void err_handler(const char *) const THROWS(NCursesException); + // Signal an error with the given message text. + + static long count; // count of all active windows: + // We rely on the c++ promise that + // all otherwise uninitialized + // static class vars are set to 0 + + WINDOW* w; // the curses WINDOW + + bool alloced; // TRUE if we own the WINDOW + + NCursesWindow* par; // parent, if subwindow + NCursesWindow* subwins; // head of subwindows list + NCursesWindow* sib; // next subwindow of parent + + void kill_subwindows(); // disable all subwindows + // Destroy all subwindows. + + /* Only for use by derived classes. They are then in charge to + fill the member variables correctly. */ + NCursesWindow(); + +public: + NCursesWindow(WINDOW* window); // useful only for stdscr + + NCursesWindow(int nlines, // number of lines + int ncols, // number of columns + int begin_y, // line origin + int begin_x); // col origin + + NCursesWindow(NCursesWindow& par,// parent window + int nlines, // number of lines + int ncols, // number of columns + int begin_y, // absolute or relative + int begin_x, // origins: + char absrel = 'a');// if `a', begin_y & begin_x are + // absolute screen pos, else if `r', they are relative to par origin + + NCursesWindow(NCursesWindow& par,// parent window + bool do_box = TRUE); + // this is the very common case that we want to create the subwindow that + // is two lines and two columns smaller and begins at (1,1). + // We may automatically request the box around it. + + NCursesWindow& operator=(const NCursesWindow& rhs) + { + if (this != &rhs) + *this = rhs; + return *this; + } + + NCursesWindow(const NCursesWindow& rhs) + : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib) + { + } + + virtual ~NCursesWindow(); + + NCursesWindow Clone(); + // Make an exact copy of the window. + + // Initialization. + static void useColors(void); + // Call this routine very early if you want to have colors. + + static int ripoffline(int ripoff_lines, + int (*init)(NCursesWindow& win)); + // This function is used to generate a window of ripped-of lines. + // If the argument is positive, lines are removed from the top, if it + // is negative lines are removed from the bottom. This enhances the + // lowlevel ripoffline() function because it uses the internal + // implementation that allows to remove more than just a single line. + // This function must be called before any other ncurses function. The + // creation of the window is deferred until ncurses gets initialized. + // The initialization function is then called. + + // ------------------------------------------------------------------------- + // terminal status + // ------------------------------------------------------------------------- + int lines() const { initialize(); return LINES; } + // Number of lines on terminal, *not* window + + int cols() const { initialize(); return COLS; } + // Number of cols on terminal, *not* window + + int tabsize() const { initialize(); return TABSIZE; } + // Size of a tab on terminal, *not* window + + static int NumberOfColors(); + // Number of available colors + + int colors() const { return NumberOfColors(); } + // Number of available colors + + // ------------------------------------------------------------------------- + // window status + // ------------------------------------------------------------------------- + int height() const { return maxy() + 1; } + // Number of lines in this window + + int width() const { return maxx() + 1; } + // Number of columns in this window + + int begx() const { return getbegx(w); } + // Column of top left corner relative to stdscr + + int begy() const { return getbegy(w); } + // Line of top left corner relative to stdscr + + int curx() const { return getcurx(w); } + // Column of top left corner relative to stdscr + + int cury() const { return getcury(w); } + // Line of top left corner relative to stdscr + + int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; } + // Largest x coord in window + + int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; } + // Largest y coord in window + + short getcolor() const; + // Actual color pair + + short foreground() const { return getcolor(0); } + // Actual foreground color + + short background() const { return getcolor(1); } + // Actual background color + + int setpalette(short fore, short back); + // Set color palette entry + + int setcolor(short pair); + // Set actually used palette entry + + // ------------------------------------------------------------------------- + // window positioning + // ------------------------------------------------------------------------- + virtual int mvwin(int begin_y, int begin_x) { + return ::mvwin(w, begin_y, begin_x); } + // Move window to new position with the new position as top left corner. + // This is virtual because it is redefined in NCursesPanel. + + // ------------------------------------------------------------------------- + // coordinate positioning + // ------------------------------------------------------------------------- + int move(int y, int x) { return ::wmove(w, y, x); } + // Move cursor the this position + + void getyx(int& y, int& x) const { ::getyx(w, y, x); } + // Get current position of the cursor + + void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); } + // Get beginning of the window + + void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); } + // Get size of the window + + void getparyx(int& y, int& x) const { ::getparyx(w, y, x); } + // Get parent's beginning of the window + + int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { + return ::mvcur(oldrow, oldcol, newrow, newcol); } + // Perform lowlevel cursor motion that takes effect immediately. + + // ------------------------------------------------------------------------- + // input + // ------------------------------------------------------------------------- + int getch() { return ::wgetch(w); } + // Get a keystroke from the window. + + int getch(int y, int x) { return ::mvwgetch(w, y, x); } + // Move cursor to position and get a keystroke from the window + + int getstr(char* str, int n=-1) { + return ::wgetnstr(w, str, n); } + // Read a series of characters into str until a newline or carriage return + // is received. Read at most n characters. If n is negative, the limit is + // ignored. + + int getstr(int y, int x, char* str, int n=-1) { + return ::mvwgetnstr(w, y, x, str, n); } + // Move the cursor to the requested position and then perform the getstr() + // as described above. + + int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } + // Get a string of characters from the window into the buffer s. Retrieve + // at most n characters, if n is negative retrieve all characters up to the + // end of the current line. Attributes are stripped from the characters. + + int instr(int y, int x, char *s, int n=-1) { + return ::mvwinnstr(w, y, x, s, n); } + // Move the cursor to the requested position and then perform the instr() + // as described above. + + int scanw(const char* fmt, ...) + // Perform a scanw function from the window. +#if __GNUG__ >= 2 + __attribute__ ((format (scanf, 2, 3))); +#else + ; +#endif + + int scanw(const char*, va_list); + // Perform a scanw function from the window. + + int scanw(int y, int x, const char* fmt, ...) + // Move the cursor to the requested position and then perform a scanw + // from the window. +#if __GNUG__ >= 2 + __attribute__ ((format (scanf, 4, 5))); +#else + ; +#endif + + int scanw(int y, int x, const char* fmt, va_list); + // Move the cursor to the requested position and then perform a scanw + // from the window. + + // ------------------------------------------------------------------------- + // output + // ------------------------------------------------------------------------- + int addch(const chtype ch) { return ::waddch(w, ch); } + // Put attributed character to the window. + + int addch(int y, int x, const chtype ch) { + return ::mvwaddch(w, y, x, ch); } + // Move cursor to the requested position and then put attributed character + // to the window. + + int echochar(const chtype ch) { return ::wechochar(w, ch); } + // Put attributed character to the window and refresh it immediately. + + int addstr(const char* str, int n=-1) { + return ::waddnstr(w, str, n); } + // Write the string str to the window, stop writing if the terminating + // NUL or the limit n is reached. If n is negative, it is ignored. + + int addstr(int y, int x, const char * str, int n=-1) { + return ::mvwaddnstr(w, y, x, str, n); } + // Move the cursor to the requested position and then perform the addchstr + // as described above. + + int addchstr(const chtype* str, int n=-1) { + return ::waddchnstr(w, str, n); } + // Write the string str to the window, stop writing if the terminating + // NUL or the limit n is reached. If n is negative, it is ignored. + + int addchstr(int y, int x, const chtype * str, int n=-1) { + return ::mvwaddchnstr(w, y, x, str, n); } + // Move the cursor to the requested position and then perform the addchstr + // as described above. + + int printw(const char* fmt, ...) + // Do a formatted print to the window. +#if (__GNUG__ >= 2) && !defined(printf) + __attribute__ ((format (printf, 2, 3))); +#else + ; +#endif + + int printw(int y, int x, const char * fmt, ...) + // Move the cursor and then do a formatted print to the window. +#if (__GNUG__ >= 2) && !defined(printf) + __attribute__ ((format (printf, 4, 5))); +#else + ; +#endif + + int printw(const char* fmt, va_list args); + // Do a formatted print to the window. + + int printw(int y, int x, const char * fmt, va_list args); + // Move the cursor and then do a formatted print to the window. + + chtype inch() const { return ::winch(w); } + // Retrieve attributed character under the current cursor position. + + chtype inch(int y, int x) { return ::mvwinch(w, y, x); } + // Move cursor to requested position and then retrieve attributed character + // at this position. + + int inchstr(chtype* str, int n=-1) { + return ::winchnstr(w, str, n); } + // Read the string str from the window, stop reading if the terminating + // NUL or the limit n is reached. If n is negative, it is ignored. + + int inchstr(int y, int x, chtype * str, int n=-1) { + return ::mvwinchnstr(w, y, x, str, n); } + // Move the cursor to the requested position and then perform the inchstr + // as described above. + + int insch(chtype ch) { return ::winsch(w, ch); } + // Insert attributed character into the window before current cursor + // position. + + int insch(int y, int x, chtype ch) { + return ::mvwinsch(w, y, x, ch); } + // Move cursor to requested position and then insert the attributed + // character before that position. + + int insertln() { return ::winsdelln(w, 1); } + // Insert an empty line above the current line. + + int insdelln(int n=1) { return ::winsdelln(w, n); } + // If n>0 insert that many lines above the current line. If n<0 delete + // that many lines beginning with the current line. + + int insstr(const char *s, int n=-1) { + return ::winsnstr(w, s, n); } + // Insert the string into the window before the current cursor position. + // Insert stops at end of string or when the limit n is reached. If n is + // negative, it is ignored. + + int insstr(int y, int x, const char *s, int n=-1) { + return ::mvwinsnstr(w, y, x, s, n); } + // Move the cursor to the requested position and then perform the insstr() + // as described above. + + int attron (chtype at) { return ::wattron (w, at); } + // Switch on the window attributes; + + int attroff(chtype at) { return ::wattroff(w, static_cast(at)); } + // Switch off the window attributes; + + int attrset(chtype at) { return ::wattrset(w, static_cast(at)); } + // Set the window attributes; + + chtype attrget() { return ::getattrs(w); } + // Get the window attributes; + + int color_set(short color_pair_number, void* opts=NULL) { + return ::wcolor_set(w, color_pair_number, opts); } + // Set the window color attribute; + + int chgat(int n, attr_t attr, short color, const void *opts=NULL) { + return ::wchgat(w, n, attr, color, opts); } + // Change the attributes of the next n characters in the current line. If + // n is negative or greater than the number of remaining characters in the + // line, the attributes will be changed up to the end of the line. + + int chgat(int y, int x, + int n, attr_t attr, short color, const void *opts=NULL) { + return ::mvwchgat(w, y, x, n, attr, color, opts); } + // Move the cursor to the requested position and then perform chgat() as + // described above. + + // ------------------------------------------------------------------------- + // background + // ------------------------------------------------------------------------- + chtype getbkgd() const { return ::getbkgd(w); } + // Get current background setting. + + int bkgd(const chtype ch) { return ::wbkgd(w, ch); } + // Set the background property and apply it to the window. + + void bkgdset(chtype ch) { ::wbkgdset(w, ch); } + // Set the background property. + + // ------------------------------------------------------------------------- + // borders + // ------------------------------------------------------------------------- + int box(chtype vert=0, chtype hor=0) { + return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); } + // Draw a box around the window with the given vertical and horizontal + // drawing characters. If you specify a zero as character, curses will try + // to find a "nice" character. + + int border(chtype left=0, chtype right=0, + chtype top =0, chtype bottom=0, + chtype top_left =0, chtype top_right=0, + chtype bottom_left =0, chtype bottom_right=0) { + return ::wborder(w, left, right, top, bottom, top_left, top_right, + bottom_left, bottom_right); } + // Draw a border around the window with the given characters for the + // various parts of the border. If you pass zero for a character, curses + // will try to find "nice" characters. + + // ------------------------------------------------------------------------- + // lines and boxes + // ------------------------------------------------------------------------- + int hline(int len, chtype ch=0) { return ::whline(w, ch, len); } + // Draw a horizontal line of len characters with the given character. If + // you pass zero for the character, curses will try to find a "nice" one. + + int hline(int y, int x, int len, chtype ch=0) { + return ::mvwhline(w, y, x, ch, len); } + // Move the cursor to the requested position and then draw a horizontal line. + + int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); } + // Draw a vertical line of len characters with the given character. If + // you pass zero for the character, curses will try to find a "nice" one. + + int vline(int y, int x, int len, chtype ch=0) { + return ::mvwvline(w, y, x, ch, len); } + // Move the cursor to the requested position and then draw a vertical line. + + // ------------------------------------------------------------------------- + // erasure + // ------------------------------------------------------------------------- + int erase() { return ::werase(w); } + // Erase the window. + + int clear() { return ::wclear(w); } + // Clear the window. + + int clearok(bool bf) { return ::clearok(w, bf); } + // Set/Reset the clear flag. If set, the next refresh() will clear the + // screen. + + int clrtobot() { return ::wclrtobot(w); } + // Clear to the end of the window. + + int clrtoeol() { return ::wclrtoeol(w); } + // Clear to the end of the line. + + int delch() { return ::wdelch(w); } + // Delete character under the cursor. + + int delch(int y, int x) { return ::mvwdelch(w, y, x); } + // Move cursor to requested position and delete the character under the + // cursor. + + int deleteln() { return ::winsdelln(w, -1); } + // Delete the current line. + + // ------------------------------------------------------------------------- + // screen control + // ------------------------------------------------------------------------- + int scroll(int amount=1) { return ::wscrl(w, amount); } + // Scroll amount lines. If amount is positive, scroll up, otherwise + // scroll down. + + int scrollok(bool bf) { return ::scrollok(w, bf); } + // If bf is TRUE, window scrolls if cursor is moved off the bottom + // edge of the window or a scrolling region, otherwise the cursor is left + // at the bottom line. + + int setscrreg(int from, int to) { + return ::wsetscrreg(w, from, to); } + // Define a soft scrolling region. + + int idlok(bool bf) { return ::idlok(w, bf); } + // If bf is TRUE, use insert/delete line hardware support if possible. + // Otherwise do it in software. + + void idcok(bool bf) { ::idcok(w, bf); } + // If bf is TRUE, use insert/delete character hardware support if possible. + // Otherwise do it in software. + + int touchline(int s, int c) { return ::touchline(w, s, c); } + // Mark the given lines as modified. + + int touchwin() { return ::wtouchln(w, 0, height(), 1); } + // Mark the whole window as modified. + + int untouchwin() { return ::wtouchln(w, 0, height(), 0); } + // Mark the whole window as unmodified. + + int touchln(int s, int cnt, bool changed=TRUE) { + return ::wtouchln(w, s, cnt, static_cast(changed ? 1 : 0)); } + // Mark cnt lines beginning from line s as changed or unchanged, depending + // on the value of the changed flag. + + bool is_linetouched(int line) const { + return (::is_linetouched(w, line) ? TRUE:FALSE); } + // Return TRUE if line is marked as changed, FALSE otherwise + + bool is_wintouched() const { + return (::is_wintouched(w) ? TRUE:FALSE); } + // Return TRUE if window is marked as changed, FALSE otherwise + + int leaveok(bool bf) { return ::leaveok(w, bf); } + // If bf is TRUE, curses will leave the cursor after an update whereever + // it is after the update. + + int redrawln(int from, int n) { return ::wredrawln(w, from, n); } + // Redraw n lines starting from the requested line + + int redrawwin() { return ::wredrawln(w, 0, height()); } + // Redraw the whole window + + int doupdate() { return ::doupdate(); } + // Do all outputs to make the physical screen looking like the virtual one + + void syncdown() { ::wsyncdown(w); } + // Propagate the changes down to all descendant windows + + void syncup() { ::wsyncup(w); } + // Propagate the changes up in the hierarchy + + void cursyncup() { ::wcursyncup(w); } + // Position the cursor in all ancestor windows corresponding to our setting + + int syncok(bool bf) { return ::syncok(w, bf); } + // If called with bf=TRUE, syncup() is called whenever the window is changed + +#ifndef _no_flushok + int flushok(bool bf) { return ::flushok(w, bf); } +#endif + + void immedok(bool bf) { ::immedok(w, bf); } + // If called with bf=TRUE, any change in the window will cause an + // automatic immediate refresh() + + int intrflush(bool bf) { return ::intrflush(w, bf); } + + int keypad(bool bf) { return ::keypad(w, bf); } + // If called with bf=TRUE, the application will interpret function keys. + + int nodelay(bool bf) { return ::nodelay(w, bf); } + + int meta(bool bf) { return ::meta(w, bf); } + // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise + // 7-Bit characters are generated. + + int standout() { return ::wstandout(w); } + // Enable "standout" attributes + + int standend() { return ::wstandend(w); } + // Disable "standout" attributes + + // ------------------------------------------------------------------------- + // The next two are virtual, because we redefine them in the + // NCursesPanel class. + // ------------------------------------------------------------------------- + virtual int refresh() { return ::wrefresh(w); } + // Propagate the changes in this window to the virtual screen and call + // doupdate(). This is redefined in NCursesPanel. + + virtual int noutrefresh() { return ::wnoutrefresh(w); } + // Propagate the changes in this window to the virtual screen. This is + // redefined in NCursesPanel. + + // ------------------------------------------------------------------------- + // multiple window control + // ------------------------------------------------------------------------- + int overlay(NCursesWindow& win) { + return ::overlay(w, win.w); } + // Overlay this window over win. + + int overwrite(NCursesWindow& win) { + return ::overwrite(w, win.w); } + // Overwrite win with this window. + + int copywin(NCursesWindow& win, + int sminrow, int smincol, + int dminrow, int dmincol, + int dmaxrow, int dmaxcol, bool overlaywin=TRUE) { + return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, + dmaxrow, dmaxcol, static_cast(overlaywin ? 1 : 0)); } + // Overlay or overwrite the rectangle in win given by dminrow,dmincol, + // dmaxrow,dmaxcol with the rectangle in this window beginning at + // sminrow,smincol. + + // ------------------------------------------------------------------------- + // Extended functions + // ------------------------------------------------------------------------- +#if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0) + int wresize(int newLines, int newColumns) { + return ::wresize(w, newLines, newColumns); } +#endif + + // ------------------------------------------------------------------------- + // Mouse related + // ------------------------------------------------------------------------- + bool has_mouse() const; + // Return TRUE if terminal supports a mouse, FALSE otherwise + + // ------------------------------------------------------------------------- + // traversal support + // ------------------------------------------------------------------------- + NCursesWindow* child() { return subwins; } + // Get the first child window. + + NCursesWindow* sibling() { return sib; } + // Get the next child of my parent. + + NCursesWindow* parent() { return par; } + // Get my parent. + + bool isDescendant(NCursesWindow& win); + // Return TRUE if win is a descendant of this. +}; + +// ------------------------------------------------------------------------- +// We leave this here for compatibility reasons. +// ------------------------------------------------------------------------- +class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow +{ +public: + NCursesColorWindow(WINDOW* &window) // useful only for stdscr + : NCursesWindow(window) { + useColors(); } + + NCursesColorWindow(int nlines, // number of lines + int ncols, // number of columns + int begin_y, // line origin + int begin_x) // col origin + : NCursesWindow(nlines, ncols, begin_y, begin_x) { + useColors(); } + + NCursesColorWindow(NCursesWindow& parentWin,// parent window + int nlines, // number of lines + int ncols, // number of columns + int begin_y, // absolute or relative + int begin_x, // origins: + char absrel = 'a') // if `a', by & bx are + : NCursesWindow(parentWin, + nlines, ncols, // absolute screen pos, + begin_y, begin_x, // else if `r', they are + absrel ) { // relative to par origin + useColors(); } +}; + +// These enum definitions really belong inside the NCursesPad class, but only +// recent compilers support that feature. + + typedef enum { + REQ_PAD_REFRESH = KEY_MAX + 1, + REQ_PAD_UP, + REQ_PAD_DOWN, + REQ_PAD_LEFT, + REQ_PAD_RIGHT, + REQ_PAD_EXIT + } Pad_Request; + + const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code + const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code + +// ------------------------------------------------------------------------- +// Pad Support. We allow an association of a pad with a "real" window +// through which the pad may be viewed. +// ------------------------------------------------------------------------- +class NCURSES_IMPEXP NCursesPad : public NCursesWindow +{ +private: + NCursesWindow* viewWin; // the "viewport" window + NCursesWindow* viewSub; // the "viewport" subwindow + + int h_gridsize, v_gridsize; + +protected: + int min_row, min_col; // top left row/col of the pads display area + + NCursesWindow* Win(void) const { + // Get the window into which the pad should be copied (if any) + return (viewSub?viewSub:(viewWin?viewWin:0)); + } + + NCursesWindow* getWindow(void) const { + return viewWin; + } + + NCursesWindow* getSubWindow(void) const { + return viewSub; + } + + virtual int driver (int key); // Virtualize keystroke key + // The driver translates the keystroke c into an Pad_Request + + virtual void OnUnknownOperation(int pad_req) { + ::beep(); + } + // This is called if the driver returns an unknown op-code + + virtual void OnNavigationError(int pad_req) { + ::beep(); + } + // This is called if a navigation request couldn't be satisfied + + virtual void OnOperation(int pad_req) { + }; + // OnOperation is called if a Pad_Operation was executed and just before + // the refresh() operation is done. + +public: + NCursesPad(int nlines, int ncols); + // create a pad with the given size + + NCursesPad& operator=(const NCursesPad& rhs) + { + if (this != &rhs) { + *this = rhs; + NCursesWindow::operator=(rhs); + } + return *this; + } + + NCursesPad(const NCursesPad& rhs) + : NCursesWindow(rhs), + viewWin(rhs.viewWin), + viewSub(rhs.viewSub), + h_gridsize(rhs.h_gridsize), + v_gridsize(rhs.v_gridsize), + min_row(rhs.min_row), + min_col(rhs.min_col) + { + } + + virtual ~NCursesPad() {} + + int echochar(const chtype ch) { return ::pechochar(w, ch); } + // Put the attributed character onto the pad and immediately do a + // prefresh(). + + int refresh(); + // If a viewport is defined the pad is displayed in this window, otherwise + // this is a noop. + + int refresh(int pminrow, int pmincol, + int sminrow, int smincol, + int smaxrow, int smaxcol) { + return ::prefresh(w, pminrow, pmincol, + sminrow, smincol, smaxrow, smaxcol); + } + // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle + // on the screen. refresh copies a rectangle of this size beginning + // with top left corner pminrow,pmincol onto the screen and calls doupdate(). + + int noutrefresh(); + // If a viewport is defined the pad is displayed in this window, otherwise + // this is a noop. + + int noutrefresh(int pminrow, int pmincol, + int sminrow, int smincol, + int smaxrow, int smaxcol) { + return ::pnoutrefresh(w, pminrow, pmincol, + sminrow, smincol, smaxrow, smaxcol); + } + // Does the same as refresh() but without calling doupdate(). + + virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1); + // Add the window "view" as viewing window to the pad. + + virtual void setSubWindow(NCursesWindow& sub); + // Use the subwindow "sub" of the viewport window for the actual viewing. + // The full viewport window is usually used to provide some decorations + // like frames, titles etc. + + virtual void operator() (void); + // Perform Pad's operation +}; + +// A FramedPad is constructed always with a viewport window. This viewport +// will be framed (by a box() command) and the interior of the box is the +// viewport subwindow. On the frame we display scrollbar sliders. +class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad +{ +protected: + virtual void OnOperation(int pad_req); + +public: + NCursesFramedPad(NCursesWindow& win, int nlines, int ncols, + int v_grid = 1, int h_grid = 1) + : NCursesPad(nlines, ncols) { + NCursesPad::setWindow(win, v_grid, h_grid); + NCursesPad::setSubWindow(*(new NCursesWindow(win))); + } + // Construct the FramedPad with the given Window win as viewport. + + virtual ~NCursesFramedPad() { + delete getSubWindow(); + } + + void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { + err_handler("Operation not allowed"); + } + // Disable this call; the viewport is already defined + + void setSubWindow(NCursesWindow& sub) { + err_handler("Operation not allowed"); + } + // Disable this call; the viewport subwindow is already defined + +}; + +#endif /* NCURSES_CURSESW_H_incl */ diff --git a/c++/cursslk.cc b/c++/cursslk.cc new file mode 100644 index 00000000000..cfbc9da42da --- /dev/null +++ b/c++/cursslk.cc @@ -0,0 +1,132 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +#include "internal.h" +#include "cursslk.h" +#include "cursesapp.h" + +MODULE_ID("$Id: cursslk.cc,v 1.15 2005/08/06 22:12:36 tom Exp $") + +Soft_Label_Key_Set::Soft_Label_Key& + Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) +{ + delete[] label; + label = new char[1 + ::strlen(text)]; + (::strcpy)(label,text); + return *this; +} + +long Soft_Label_Key_Set::count = 0L; +int Soft_Label_Key_Set::num_labels = 0; + +Soft_Label_Key_Set::Label_Layout + Soft_Label_Key_Set::format = None; + +void Soft_Label_Key_Set::init() +{ + slk_array = new Soft_Label_Key[num_labels]; + for(int i=0; i < num_labels; i++) { + slk_array[i].num = i+1; + } + b_attrInit = FALSE; +} + +Soft_Label_Key_Set::Soft_Label_Key_Set() + : b_attrInit(FALSE), + slk_array(NULL) +{ + if (format==None) + Error("No default SLK layout"); + init(); +} + +Soft_Label_Key_Set::Soft_Label_Key_Set(Soft_Label_Key_Set::Label_Layout fmt) + : b_attrInit(FALSE), + slk_array(NULL) +{ + if (fmt==None) + Error("Invalid SLK Layout"); + if (count++==0) { + format = fmt; + if (ERR == ::slk_init(static_cast(fmt))) + Error("slk_init"); + num_labels = (fmt>=PC_Style?12:8); + } + else if (fmt!=format) + Error("All SLKs must have same layout"); + init(); +} + +Soft_Label_Key_Set::~Soft_Label_Key_Set() { + if (!::isendwin()) + clear(); + delete[] slk_array; + count--; +} + +Soft_Label_Key_Set::Soft_Label_Key& Soft_Label_Key_Set::operator[](int i) { + if (i<1 || i>num_labels) + Error("Invalid Label index"); + return slk_array[i-1]; +} + +void Soft_Label_Key_Set::activate_label(int i, bool bf) { + if (!b_attrInit) { + NCursesApplication* A = NCursesApplication::getApplication(); + if (A) attrset(A->labels()); + b_attrInit = TRUE; + } + Soft_Label_Key& K = (*this)[i]; + if (ERR==::slk_set(K.num,bf?K.label:"",K.format)) + Error("slk_set"); + noutrefresh(); +} + +void Soft_Label_Key_Set::activate_labels(bool bf) +{ + if (!b_attrInit) { + NCursesApplication* A = NCursesApplication::getApplication(); + if (A) attrset(A->labels()); + b_attrInit = TRUE; + } + for(int i=1; i <= num_labels; i++) { + Soft_Label_Key& K = (*this)[i]; + if (ERR==::slk_set(K.num,bf?K.label:"",K.format)) + Error("slk_set"); + } + if (bf) + restore(); + else + clear(); + noutrefresh(); +} diff --git a/c++/cursslk.h b/c++/cursslk.h new file mode 100644 index 00000000000..091695eef27 --- /dev/null +++ b/c++/cursslk.h @@ -0,0 +1,238 @@ +// * this is for making emacs happy: -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +// $Id: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $ + +#ifndef NCURSES_CURSSLK_H_incl +#define NCURSES_CURSSLK_H_incl + +#include + +class NCURSES_IMPEXP Soft_Label_Key_Set { +public: + // This inner class represents the attributes of a Soft Label Key (SLK) + class NCURSES_IMPEXP Soft_Label_Key { + friend class Soft_Label_Key_Set; + public: + typedef enum { Left=0, Center=1, Right=2 } Justification; + + private: + char *label; // The Text of the Label + Justification format; // The Justification + int num; // The number of the Label + + Soft_Label_Key() : label(NULL), format(Left), num(-1) { + } + + virtual ~Soft_Label_Key() { + delete[] label; + }; + + public: + // Set the text of the Label + Soft_Label_Key& operator=(char *text); + + // Set the Justification of the Label + Soft_Label_Key& operator=(Justification just) { + format = just; + return *this; + } + + // Retrieve the text of the label + inline char* operator()(void) const { + return label; + } + + Soft_Label_Key& operator=(const Soft_Label_Key& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + Soft_Label_Key(const Soft_Label_Key& rhs) + : label(NULL), + format(rhs.format), + num(rhs.num) + { + *this = rhs.label; + } + }; + +public: + typedef enum { + None = -1, + Three_Two_Three = 0, + Four_Four = 1, + PC_Style = 2, + PC_Style_With_Index = 3 + } Label_Layout; + +private: + static long NCURSES_IMPEXP count; // Number of Key Sets + static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets + static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets + bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized + + Soft_Label_Key *slk_array; // The array of SLK's + + // Init the Key Set + void init(); + + // Activate or Deactivate Label# i, Label counting starts with 1! + void activate_label(int i, bool bf=TRUE); + + // Activate of Deactivate all Labels + void activate_labels(bool bf); + +protected: + inline void Error (const char* msg) const THROWS(NCursesException) { + THROW(new NCursesException (msg)); + } + + // Remove SLK's from screen + void clear() { + if (ERR==::slk_clear()) + Error("slk_clear"); + } + + // Restore them + void restore() { + if (ERR==::slk_restore()) + Error("slk_restore"); + } + +public: + + // Construct a Key Set, use the most comfortable layout as default. + // You must create a Soft_Label_Key_Set before you create any object of + // the NCursesWindow, NCursesPanel or derived classes. (Actually before + // ::initscr() is called). + Soft_Label_Key_Set(Label_Layout fmt); + + // This constructor assumes, that you already constructed a Key Set + // with a layout by the constructor above. This layout will be reused. + NCURSES_IMPEXP Soft_Label_Key_Set(); + + Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) + { + if (this != &rhs) { + *this = rhs; + init(); // allocate a new slk_array[] + } + return *this; + } + + Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs) + : b_attrInit(rhs.b_attrInit), + slk_array(NULL) + { + init(); // allocate a new slk_array[] + } + + virtual ~Soft_Label_Key_Set(); + + // Get Label# i. Label counting starts with 1! + NCURSES_IMPEXP Soft_Label_Key& operator[](int i); + + // Retrieve number of Labels + inline int labels() const { return num_labels; } + + // Refresh the SLK portion of the screen + inline void refresh() { + if (ERR==::slk_refresh()) + Error("slk_refresh"); + } + + // Mark the SLK portion of the screen for refresh, defer actual refresh + // until next update call. + inline void noutrefresh() { + if (ERR==::slk_noutrefresh()) + Error("slk_noutrefresh"); + } + + // Mark the whole SLK portion of the screen as modified + inline void touch() { + if (ERR==::slk_touch()) + Error("slk_touch"); + } + + // Activate Label# i + inline void show(int i) { + activate_label(i,FALSE); + activate_label(i,TRUE); + } + + // Hide Label# i + inline void hide(int i) { + activate_label(i,FALSE); + } + + // Show all Labels + inline void show() { + activate_labels(FALSE); + activate_labels(TRUE); + } + + // Hide all Labels + inline void hide() { + activate_labels(FALSE); + } + + inline void attron(attr_t attrs) { + if (ERR==::slk_attron(attrs)) + Error("slk_attron"); + } + + inline void attroff(attr_t attrs) { + if (ERR==::slk_attroff(attrs)) + Error("slk_attroff"); + } + + inline void attrset(attr_t attrs) { + if (ERR==::slk_attrset(attrs)) + Error("slk_attrset"); + } + + inline void color(short color_pair_number) { + if (ERR==::slk_color(color_pair_number)) + Error("slk_color"); + } + + inline attr_t attr() const { + return ::slk_attr(); + } +}; + +#endif /* NCURSES_CURSSLK_H_incl */ diff --git a/c++/demo.cc b/c++/demo.cc new file mode 100644 index 00000000000..35433425f1f --- /dev/null +++ b/c++/demo.cc @@ -0,0 +1,569 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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. * + ****************************************************************************/ + +/* + * Silly demo program for the NCursesPanel class. + * + * written by Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) + * + * Demo code for NCursesMenu and NCursesForm written by + * Juergen Pfeifer + * + * $Id: demo.cc,v 1.39 2008/12/07 02:07:34 juergen Exp $ + */ + +#include "internal.h" +#include "cursesapp.h" +#include "cursesm.h" +#include "cursesf.h" + +#ifdef __MINGW32__ +#undef KEY_EVENT +#endif + +#ifndef __MINGW32__ +extern "C" unsigned int sleep(unsigned int); +#endif + +#undef index // needed for NeXT + +// +// ------------------------------------------------------------------------- +// +class SillyDemo +{ + public: + void run(int sleeptime) { + + NCursesPanel *mystd = new NCursesPanel(); + + // Make a few small demo panels + + NCursesPanel *u = new NCursesPanel(8, 20, 12, 4); + NCursesPanel *v = new NCursesPanel(8, 20, 10, 6); + NCursesPanel *w = new NCursesPanel(8, 20, 8, 8); + NCursesPanel *x = new NCursesPanel(8, 20, 6, 10); + NCursesPanel *y = new NCursesPanel(8, 20, 4, 12); + NCursesPanel *z = new NCursesPanel(8, 30, 2, 14); + + // Draw something on the main screen, so we can see what happens + // when panels get moved or deleted. + + mystd->box(); + mystd->move(mystd->height()/2, 1); + mystd->hline(mystd->width()-2); + mystd->move(1, mystd->width()/2); + mystd->vline(mystd->height()-2); + mystd->addch(0, mystd->width()/2, ACS_TTEE); + mystd->addch(mystd->height()-1, mystd->width()/2, ACS_BTEE); + mystd->addch(mystd->height()/2, 0, ACS_LTEE); + mystd->addch(mystd->height()/2, mystd->width()-1, ACS_RTEE); + mystd->addch(mystd->height()/2, mystd->width()/2, ACS_PLUS); + + // Draw frames with titles around panels so that we can see where + // the panels are located. + u->boldframe("Win U"); + v->frame("Win V"); + w->boldframe("Win W"); + x->frame("Win X"); + y->boldframe("Win Y"); + z->frame("Win Z"); + if (NCursesApplication::getApplication()->useColors()) { + u->bkgd(' '|COLOR_PAIR(1)); + w->bkgd(' '|COLOR_PAIR(1)); + y->bkgd(' '|COLOR_PAIR(1)); + v->bkgd(' '|COLOR_PAIR(2)); + x->bkgd(' '|COLOR_PAIR(2)); + z->bkgd(' '|COLOR_PAIR(2)); + } + + // A refresh to any valid panel updates all panels and refreshes + // the screen. Using mystd is just convenient - We know it's always + // valid until the end of the program. + + mystd->refresh(); + sleep(sleeptime); + + // Show what happens when panels are deleted and moved. + + sleep(sleeptime); + delete u; + mystd->refresh(); + + sleep(sleeptime); + delete z; + mystd->refresh(); + + sleep(sleeptime); + delete v; + mystd->refresh(); + + // show how it looks when a panel moves + sleep(sleeptime); + y->mvwin(5, 30); + mystd->refresh(); + + sleep(sleeptime); + delete y; + mystd->refresh(); + + // show how it looks when you raise a panel + sleep(sleeptime); + w->top(); + mystd->refresh(); + + sleep(sleeptime); + delete w; + mystd->refresh(); + + sleep(sleeptime); + delete x; + + mystd->clear(); + mystd->refresh(); + + // Don't forget to clean up the main screen. Since this is the + // last thing using NCursesWindow, this has the effect of + // shutting down ncurses and restoring the terminal state. + + sleep(sleeptime); + delete mystd; + } +}; + +class UserData +{ +private: + int u; +public: + UserData(int x) : u(x) {} + int sleeptime() const { return u; } +}; +// +// ------------------------------------------------------------------------- +// +template class MyAction : public NCursesUserItem +{ +public: + MyAction (const char* p_name, + const T* p_UserData) + : NCursesUserItem(p_name, static_cast(0), p_UserData) + {} + + virtual ~MyAction() {} + + bool action() { + SillyDemo a; + a.run(NCursesUserItem::UserData()->sleeptime()); + return FALSE; + } +}; + +template class MyAction; +template class NCURSES_IMPEXP NCursesUserItem; + +class QuitItem : public NCursesMenuItem +{ +public: + QuitItem() : NCursesMenuItem("Quit") { + } + + bool action() { + return TRUE; + } +}; +// +// ------------------------------------------------------------------------- +// +class Label : public NCursesFormField +{ +public: + Label(const char* title, + int row, int col) + : NCursesFormField(1, static_cast(::strlen(title)), row, col) { + set_value(title); + options_off(O_EDIT|O_ACTIVE); + } +}; +// +// ------------------------------------------------------------------------- +// +class MyFieldType : public UserDefinedFieldType +{ +private: + int chk; +protected: + bool field_check(NCursesFormField& f) { + return TRUE; + } + bool char_check(int c) { + return (c==chk?TRUE:FALSE); + } +public: + MyFieldType(int x) : chk(x) { + } +}; +// +// ------------------------------------------------------------------------- +// +class TestForm : public NCursesForm +{ +private: + NCursesFormField** F; + MyFieldType* mft; + Integer_Field *ift; + Enumeration_Field *eft; + + static const char *weekdays[]; + +public: + TestForm() + : NCursesForm(13, 51, (lines() - 15)/2, (cols() - 53)/2), + F(0), + mft(0), + ift(0), + eft(0) + { + + F = new NCursesFormField*[10]; + mft = new MyFieldType('X'); + ift = new Integer_Field(0, 1, 10); + eft = new Enumeration_Field(weekdays); + + F[0] = new Label("Demo Entry Form", 0, 16); + F[1] = new Label("Weekday Enum", 2, 1); + F[2] = new Label("Number(1-10)", 2, 21); + F[3] = new Label("Only 'X'", 2, 35); + F[4] = new Label("Multiline Field (Dynamic and Scrollable)", 5, 1); + F[5] = new NCursesFormField(1, 18, 3, 1); + F[6] = new NCursesFormField(1, 12, 3, 21); + F[7] = new NCursesFormField(1, 12, 3, 35); + F[8] = new NCursesFormField(4, 46, 6, 1, 2); + F[9] = new NCursesFormField(); + + InitForm(F, TRUE, TRUE); + boldframe(); + + F[5]->set_fieldtype(*eft); + F[6]->set_fieldtype(*ift); + + F[7]->set_fieldtype(*mft); + F[7]->set_maximum_growth(20); // max. 20 characters + F[7]->options_off(O_STATIC); // make field dynamic + + F[8]->set_maximum_growth(10); // max. 10 lines + F[8]->options_off(O_STATIC); // make field dynamic + } + + TestForm& operator=(const TestForm& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + TestForm(const TestForm& rhs) + : NCursesForm(rhs), F(0), mft(0), ift(0), eft(0) + { + } + + ~TestForm() { + delete mft; + delete ift; + delete eft; + } +}; + +const char* TestForm::weekdays[] = { + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", + "Friday", "Saturday", NULL }; +// +// ------------------------------------------------------------------------- +// +class FormAction : public NCursesMenuItem +{ +public: + FormAction(const char *s) : NCursesMenuItem(s) { + } + + bool action() { + TestForm F; + Soft_Label_Key_Set* S = new Soft_Label_Key_Set; + for(int i=1; i <= S->labels(); i++) { + char buf[8]; + assert(i < 100); + ::sprintf(buf, "Frm%02d", i); + (*S)[i] = buf; // Text + (*S)[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification + } + NCursesApplication::getApplication()->push(*S); + F(); + NCursesApplication::getApplication()->pop(); + delete S; + return FALSE; + } +}; +// +// ------------------------------------------------------------------------- +// +class PadAction : public NCursesMenuItem +{ +public: + PadAction(const char* s) : NCursesMenuItem(s) { + } + + bool action() { + const int GRIDSIZE = 3; + const int PADSIZE = 200; + unsigned gridcount = 0; + + NCursesPanel mystd; + NCursesPanel P(mystd.lines()-2, mystd.cols()-2, 1, 1); + NCursesFramedPad FP(P, PADSIZE, PADSIZE); + + for (int i=0; i < PADSIZE; i++) { + for (int j=0; j < PADSIZE; j++) { + if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { + if (i==0 || j==0) + FP.addch('+'); + else + FP.addch(static_cast('A' + (gridcount++ % 26))); + } + else if (i % GRIDSIZE == 0) + FP.addch('-'); + else if (j % GRIDSIZE == 0) + FP.addch('|'); + else + FP.addch(' '); + } + } + + P.label("Pad Demo", NULL); + FP(); + P.clear(); + return FALSE; + } +}; + +// +// ------------------------------------------------------------------------- +// +class PassiveItem : public NCursesMenuItem +{ +public: + PassiveItem(const char* text) : NCursesMenuItem(text) { + options_off(O_SELECTABLE); + } +}; + +// +// ------------------------------------------------------------------------- +// +class ScanAction : public NCursesMenuItem +{ +public: + ScanAction(const char* s) : NCursesMenuItem(s) { + } + + bool action() { + NCursesPanel *mystd = new NCursesPanel(); + + NCursesPanel *w = new NCursesPanel(mystd->lines() - 2, mystd->cols() - 2, 1, 1); + w->box(); + w->refresh(); + + NCursesPanel *s = new NCursesPanel(w->lines() - 6, w->cols() - 6, 3, 3); + s->scrollok(TRUE); + ::echo(); + + s->printw("Enter decimal integers. The running total will be shown\n"); + int nvalue = -1; + int result = 0; + while (nvalue != 0) { + nvalue = 0; + s->scanw("%d", &nvalue); + if (nvalue != 0) { + s->printw("%d: ", result += nvalue); + } + s->refresh(); + } + s->printw("\nPress any key to continue..."); + s->getch(); + + delete s; + delete w; + delete mystd; + ::noecho(); + return FALSE; + } +}; + +// +// ------------------------------------------------------------------------- +// +class MyMenu : public NCursesMenu +{ +private: + NCursesPanel* P; + NCursesMenuItem** I; + UserData *u; + #define n_items 7 + +public: + MyMenu () + : NCursesMenu (n_items+2, 8, (lines()-10)/2, (cols()-10)/2), + P(0), I(0), u(0) + { + u = new UserData(1); + I = new NCursesMenuItem*[1+n_items]; + I[0] = new PassiveItem("One"); + I[1] = new PassiveItem("Two"); + I[2] = new MyAction ("Silly", u); + I[3] = new FormAction("Form"); + I[4] = new PadAction("Pad"); + I[5] = new ScanAction("Scan"); + I[6] = new QuitItem(); + I[7] = new NCursesMenuItem(); // Terminating empty item + + InitMenu(I, TRUE, TRUE); + + P = new NCursesPanel(1, n_items, LINES-1, 1); + boldframe("Demo", "Silly"); + P->show(); + } + + MyMenu& operator=(const MyMenu& rhs) + { + if (this != &rhs) { + *this = rhs; + } + return *this; + } + + MyMenu(const MyMenu& rhs) + : NCursesMenu(rhs), P(0), I(0), u(0) + { + } + + ~MyMenu() + { + P->hide(); + delete P; + delete u; + } + + virtual void On_Menu_Init() + { + NCursesWindow W(::stdscr); + P->move(0, 0); + P->clrtoeol(); + for(int i=1; i<=count(); i++) + P->addch('0' + i); + P->bkgd(W.getbkgd()); + refresh(); + } + + virtual void On_Menu_Termination() + { + P->move(0, 0); + P->clrtoeol(); + refresh(); + } + + virtual void On_Item_Init(NCursesMenuItem& item) + { + P->move(0, item.index()); + P->attron(A_REVERSE); + P->printw("%1d", 1+item.index()); + P->attroff(A_REVERSE); + refresh(); + } + + virtual void On_Item_Termination(NCursesMenuItem& item) + { + P->move(0, item.index()); + P->attroff(A_REVERSE); + P->printw("%1d", 1+item.index()); + refresh(); + } +}; +// +// ------------------------------------------------------------------------- +// +class TestApplication : public NCursesApplication +{ +protected: + int titlesize() const { return 1; } + void title(); + Soft_Label_Key_Set::Label_Layout useSLKs() const { + return Soft_Label_Key_Set::PC_Style_With_Index; + } + void init_labels(Soft_Label_Key_Set& S) const; + +public: + TestApplication() : NCursesApplication(TRUE) { + } + + int run(); +}; + +void TestApplication::init_labels(Soft_Label_Key_Set& S) const +{ + for(int i=1; i <= S.labels(); i++) { + char buf[8]; + assert(i < 100); + ::sprintf(buf, "Key%02d", i); + S[i] = buf; // Text + S[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification + } +} + +void TestApplication::title() +{ + const char * const titleText = "Simple C++ Binding Demo"; + const int len = ::strlen(titleText); + + titleWindow->bkgd(screen_titles()); + titleWindow->addstr(0, (titleWindow->cols() - len)/2, titleText); + titleWindow->noutrefresh(); +} + + +int TestApplication::run() +{ + MyMenu M; + M(); + return 0; +} + +// +// ------------------------------------------------------------------------- +// +static TestApplication *Demo = new TestApplication(); diff --git a/tar-copy.sh b/c++/edit_cfg.sh similarity index 69% rename from tar-copy.sh rename to c++/edit_cfg.sh index 3df1bc11169..73c31b274ed 100755 --- a/tar-copy.sh +++ b/c++/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: tar-copy.sh,v 1.5 2003/10/25 14:40:07 tom Exp $ +# $Id: edit_cfg.sh,v 1.17 2008/08/30 19:44:25 tom Exp $ ############################################################################## -# Copyright (c) 1998,2003 Free Software Foundation, Inc. # +# Copyright (c) 1998-2007,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 "Software"), # @@ -28,50 +28,44 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey +# Author: Thomas E. Dickey 1997-on # -# Copy a collection of files using 'tar', so that their dates and links are -# preserved +# Edit the default value of the etip.h file based on the autoconf-generated +# values: # -# Parameters: -# $1 = files to copy -# $2 = source directory -# $3 = destination directory +# $1 = ncurses_cfg.h +# $2 = etip.h # -#DOIT=echo -DOIT=eval - -if test $# != 3 ; then - echo "Usage: $0 files source target" - exit 1 -elif test ! -d "$2" ; then - echo "Source directory not found: $2" - exit 1 -elif test ! -d "$3" ; then - echo "Target directory not found: $3" - exit 1 -fi - -WD=`pwd` - -TMP=$WD/copy$$ - -cd $2 -TEST=`ls -d $1 2>/dev/null` -if test -z "$TEST" -then - echo "... no match for \"$1\" in $2" -else - echo "... installing files matching \"$1\" in $2" - trap "rm -f $TMP" 0 1 2 5 15 - if ( tar cf $TMP $1 ) +echo "substituting autoconf'd values from $1 into $2" +for name in \ + CPP_HAS_PARAM_INIT \ + CPP_HAS_STATIC_CAST \ + ETIP_NEEDS_MATH_EXCEPTION \ + ETIP_NEEDS_MATH_H \ + HAVE_BUILTIN_H \ + HAVE_GPP_BUILTIN_H \ + HAVE_GXX_BUILTIN_H \ + HAVE_IOSTREAM \ + HAVE_TYPEINFO \ + HAVE_VALUES_H \ + IOSTREAM_NAMESPACE +do + rm -f $2.bak + mv $2 $2.bak + if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) then - cd $3 - LIST=`tar tf $TMP 2>&1` - $DOIT rm -rf $LIST 2>/dev/null - $DOIT tar xvf $TMP + value=1 + sed -e 's/define '$name'.*$/define '$name' 1/' $2.bak >$2 else - echo "Cannot create tar of $1 files" - exit 1 + value=0 + sed -e 's/define '$name'.*$/define '$name' 0/' $2.bak >$2 fi -fi + if (cmp -s $2 $2.bak) + then + echo '... '$name $value + mv $2.bak $2 + else + echo '... '$name $value + rm -f $2.bak + fi +done diff --git a/c++/etip.h.in b/c++/etip.h.in new file mode 100644 index 00000000000..20642a60ec7 --- /dev/null +++ b/c++/etip.h.in @@ -0,0 +1,378 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +// $Id: etip.h.in,v 1.37 2008/08/30 19:27:32 tom Exp $ + +#ifndef NCURSES_ETIP_H_incl +#define NCURSES_ETIP_H_incl 1 + +// These are substituted at configure/build time +#ifndef HAVE_BUILTIN_H +#define HAVE_BUILTIN_H 0 +#endif + +#ifndef HAVE_GXX_BUILTIN_H +#define HAVE_GXX_BUILTIN_H 0 +#endif + +#ifndef HAVE_GPP_BUILTIN_H +#define HAVE_GPP_BUILTIN_H 0 +#endif + +#ifndef HAVE_IOSTREAM +#define HAVE_IOSTREAM 0 +#endif + +#ifndef HAVE_TYPEINFO +#define HAVE_TYPEINFO 0 +#endif + +#ifndef HAVE_VALUES_H +#define HAVE_VALUES_H 0 +#endif + +#ifndef ETIP_NEEDS_MATH_H +#define ETIP_NEEDS_MATH_H 0 +#endif + +#ifndef ETIP_NEEDS_MATH_EXCEPTION +#define ETIP_NEEDS_MATH_EXCEPTION 0 +#endif + +#ifndef CPP_HAS_PARAM_INIT +#define CPP_HAS_PARAM_INIT 0 +#endif + +#ifndef CPP_HAS_STATIC_CAST +#define CPP_HAS_STATIC_CAST 0 // workaround for g++ 2.95.3 +#endif + +#ifndef IOSTREAM_NAMESPACE +#define IOSTREAM_NAMESPACE 0 +#endif + +#ifdef __GNUG__ +# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) +# if HAVE_TYPEINFO +# include +# endif +# endif +#endif + +#if defined(__GNUG__) +# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H +# if ETIP_NEEDS_MATH_H +# if ETIP_NEEDS_MATH_EXCEPTION +# undef exception +# define exception math_exception +# endif +# include +# endif +# undef exception +# define exception builtin_exception +# if HAVE_GPP_BUILTIN_H +# include +# elif HAVE_GXX_BUILTIN_H +# include +# else +# include +# endif +# undef exception +# endif +#elif defined (__SUNPRO_CC) +# include +#endif + +#include + +extern "C" { +#if HAVE_VALUES_H +# include +#endif + +#include +#include +#include +} + +// Language features +#if CPP_HAS_PARAM_INIT +#define NCURSES_PARAM_INIT(value) = value +#else +#define NCURSES_PARAM_INIT(value) /*nothing*/ +#endif + +#if CPP_HAS_STATIC_CAST +#define STATIC_CAST(s) static_cast +#else +#define STATIC_CAST(s) (s) +#endif + +// Forward Declarations +class NCURSES_IMPEXP NCursesPanel; +class NCURSES_IMPEXP NCursesMenu; +class NCURSES_IMPEXP NCursesForm; + +class NCURSES_IMPEXP NCursesException +{ +public: + const char *message; + int errorno; + + NCursesException (const char* msg, int err) + : message(msg), errorno (err) + {}; + + NCursesException (const char* msg) + : message(msg), errorno (E_SYSTEM_ERROR) + {}; + + NCursesException& operator=(const NCursesException& rhs) + { + errorno = rhs.errorno; + return *this; + } + + NCursesException(const NCursesException& rhs) + : message(rhs.message), errorno(rhs.errorno) + { + } + + virtual const char *classname() const { + return "NCursesWindow"; + } + + virtual ~NCursesException() + { + } +}; + +class NCURSES_IMPEXP NCursesPanelException : public NCursesException +{ +public: + const NCursesPanel* p; + + NCursesPanelException (const char *msg, int err) : + NCursesException (msg, err), + p (NULL) + {}; + + NCursesPanelException (const NCursesPanel* panel, + const char *msg, + int err) : + NCursesException (msg, err), + p (panel) + {}; + + NCursesPanelException (int err) : + NCursesException ("panel library error", err), + p (NULL) + {}; + + NCursesPanelException (const NCursesPanel* panel, + int err) : + NCursesException ("panel library error", err), + p (panel) + {}; + + NCursesPanelException& operator=(const NCursesPanelException& rhs) + { + if (this != &rhs) { + NCursesException::operator=(rhs); + p = rhs.p; + } + return *this; + } + + NCursesPanelException(const NCursesPanelException& rhs) + : NCursesException(rhs), p(rhs.p) + { + } + + virtual const char *classname() const { + return "NCursesPanel"; + } + + virtual ~NCursesPanelException() + { + } +}; + +class NCURSES_IMPEXP NCursesMenuException : public NCursesException +{ +public: + const NCursesMenu* m; + + NCursesMenuException (const char *msg, int err) : + NCursesException (msg, err), + m (NULL) + {}; + + NCursesMenuException (const NCursesMenu* menu, + const char *msg, + int err) : + NCursesException (msg, err), + m (menu) + {}; + + NCursesMenuException (int err) : + NCursesException ("menu library error", err), + m (NULL) + {}; + + NCursesMenuException (const NCursesMenu* menu, + int err) : + NCursesException ("menu library error", err), + m (menu) + {}; + + NCursesMenuException& operator=(const NCursesMenuException& rhs) + { + if (this != &rhs) { + NCursesException::operator=(rhs); + m = rhs.m; + } + return *this; + } + + NCursesMenuException(const NCursesMenuException& rhs) + : NCursesException(rhs), m(rhs.m) + { + } + + virtual const char *classname() const { + return "NCursesMenu"; + } + + virtual ~NCursesMenuException() + { + } +}; + +class NCURSES_IMPEXP NCursesFormException : public NCursesException +{ +public: + const NCursesForm* f; + + NCursesFormException (const char *msg, int err) : + NCursesException (msg, err), + f (NULL) + {}; + + NCursesFormException (const NCursesForm* form, + const char *msg, + int err) : + NCursesException (msg, err), + f (form) + {}; + + NCursesFormException (int err) : + NCursesException ("form library error", err), + f (NULL) + {}; + + NCursesFormException (const NCursesForm* form, + int err) : + NCursesException ("form library error", err), + f (form) + {}; + + NCursesFormException& operator=(const NCursesFormException& rhs) + { + if (this != &rhs) { + NCursesException::operator=(rhs); + f = rhs.f; + } + return *this; + } + + NCursesFormException(const NCursesFormException& rhs) + : NCursesException(rhs), f(rhs.f) + { + } + + virtual const char *classname() const { + return "NCursesForm"; + } + + virtual ~NCursesFormException() + { + } +}; + +#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC)) +# if HAVE_IOSTREAM +# include +# if IOSTREAM_NAMESPACE +using std::cerr; +using std::endl; +# endif +# else +# include +# endif + extern "C" void exit(int); +#endif + +inline void THROW(const NCursesException *e) { +#if defined(__GNUG__) && defined(__EXCEPTIONS) +# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) + (*lib_error_handler)(e ? e->classname() : "", e ? e->message : ""); +#else +#define CPP_HAS_TRY_CATCH 1 +#endif +#elif defined(__SUNPRO_CC) +# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) + genericerror(1, ((e != 0) ? (char *)(e->message) : "")); +#else +#define CPP_HAS_TRY_CATCH 1 +#endif +#else + if (e) + cerr << e->message << endl; + exit(0); +#endif + +#ifndef CPP_HAS_TRY_CATCH +#define CPP_HAS_TRY_CATCH 0 +#define NCURSES_CPP_TRY /* nothing */ +#define NCURSES_CPP_CATCH(e) if (false) +#define THROWS(s) /* nothing */ +#elif CPP_HAS_TRY_CATCH + throw *e; +#define NCURSES_CPP_TRY try +#define NCURSES_CPP_CATCH(e) catch(e) +#define THROWS(s) throw(s) +#endif +} + +#endif /* NCURSES_ETIP_H_incl */ diff --git a/c++/headers b/c++/headers new file mode 100644 index 00000000000..0be0311bd9c --- /dev/null +++ b/c++/headers @@ -0,0 +1,40 @@ +# C++ headers +# $Id: headers,v 1.3 2006/12/24 16:25:45 tom Exp $ +############################################################################## +# Copyright (c) 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 "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 1997 +# +$(srcdir)/cursesapp.h +$(srcdir)/cursesf.h +$(srcdir)/cursesm.h +$(srcdir)/cursesp.h +$(srcdir)/cursesw.h +$(srcdir)/cursslk.h +etip.h +# vile:makemode diff --git a/c++/internal.h b/c++/internal.h new file mode 100644 index 00000000000..64d57cd712d --- /dev/null +++ b/c++/internal.h @@ -0,0 +1,65 @@ +// * This makes emacs happy -*-Mode: C++;-*- +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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: Juergen Pfeifer, 1997 * + ****************************************************************************/ + +// $Id: internal.h,v 1.17 2008/12/07 02:07:34 juergen Exp $ + +#ifndef NCURSES_CPLUS_INTERNAL_H +#define NCURSES_CPLUS_INTERNAL_H 1 + +#include + +#if USE_RCS_IDS +#define MODULE_ID(id) static const char Ident[] = id; +#else +#define MODULE_ID(id) /*nothing*/ +#endif + +#ifdef __MINGW32__ +#include +#undef KEY_EVENT +#endif + +#ifndef _QNX_SOURCE +#include +#include +#endif + +#ifndef CTRL +#define CTRL(x) ((x) & 0x1f) +#endif + +#ifndef NULL +#define NULL 0 +#endif + +#endif /* NCURSES_CPLUS_INTERNAL_H */ diff --git a/c++/modules b/c++/modules new file mode 100644 index 00000000000..bc4fae59925 --- /dev/null +++ b/c++/modules @@ -0,0 +1,45 @@ +# Program modules +# $Id: modules,v 1.7 2006/12/24 00:53:08 tom Exp $ +############################################################################## +# Copyright (c) 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 "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 1995-on +# + +@ base +cursesf c++ $(srcdir) $(cursesf_h) $(cursesapp_h) +cursesm c++ $(srcdir) $(cursesm_h) $(cursesapp_h) +cursesp c++ $(srcdir) $(cursesp_h) +cursesw c++ $(srcdir) $(cursesw_h) +cursespad c++ $(srcdir) $(cursesw_h) +cursslk c++ $(srcdir) $(cursslk_h) $(cursesapp_h) +cursesapp c++ $(srcdir) $(cursesapp_h) +cursesmain c++ $(srcdir) $(cursesapp_h) +demo c++ $(srcdir) $(cursesf_h) $(cursesm_h) $(cursesapp_h) + +# vile:makemode diff --git a/config.guess b/config.guess index c7607c74f1b..bec935b96fc 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-04-14' +timestamp='2010-09-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2008-04-14' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -91,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +trap 'exit 1' HUP INT TERM # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -105,7 +106,7 @@ trap 'exit 1' 1 2 15 set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -219,11 +220,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -295,7 +296,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -324,14 +325,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -375,23 +395,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -461,8 +481,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -532,7 +552,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -575,8 +595,8 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 @@ -640,7 +660,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -711,22 +731,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -750,14 +770,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -785,27 +805,30 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -835,10 +858,24 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ + grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else @@ -855,7 +892,18 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -866,75 +914,34 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -943,14 +950,17 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -958,6 +968,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -965,68 +978,8 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1034,11 +987,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1055,7 +1008,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1070,7 +1023,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1098,10 +1051,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1136,8 +1092,18 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1150,7 +1116,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1171,9 +1137,9 @@ EOF fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1203,7 +1169,7 @@ EOF else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1243,6 +1209,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1250,14 +1226,17 @@ EOF *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1303,13 +1282,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1324,6 +1303,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/config.sub b/config.sub index a649350a6ca..de11910f0b1 100755 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-06-16' +timestamp='2010-09-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2008-06-16' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,8 +124,10 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -148,10 +154,13 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -249,6 +258,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -270,28 +280,41 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be\ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -306,8 +329,8 @@ case $basic_machine in # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; + basic_machine=$basic_machine-pc + ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 @@ -322,7 +345,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -331,9 +354,10 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -355,27 +379,30 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -397,7 +424,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -443,6 +470,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,11 +490,24 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -711,6 +755,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -815,6 +862,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -1049,17 +1102,10 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu ;; tile*) basic_machine=tile-unknown @@ -1140,6 +1186,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1178,7 +1228,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1225,9 +1275,12 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1248,10 +1301,11 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1262,7 +1316,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1270,7 +1325,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1309,7 +1364,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1358,7 +1413,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1403,6 +1458,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1425,10 +1482,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1440,8 +1497,17 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1468,7 +1534,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1495,7 +1561,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) @@ -1600,7 +1666,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff --git a/configure b/configure index 1342387ce63..708f69433c9 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.454 . +# From configure.in Revision: 1.514 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20080325. +# Generated by Autoconf 2.52.20101002. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -697,8 +697,12 @@ Optional Features: --without-cxx do not adjust ncurses bool to match C++ --without-cxx-binding do not build C++ binding and demo --without-ada suppress check for Ada95, don't build demo + --without-manpages suppress install of manpages --without-progs suppress build with programs (e.g., tic) + --without-tests suppress build with test-programs --without-curses-h install curses.h as ncurses.h only + --with-pkg-config{=path} enable/disable use of pkg-config + --enable-pc-files generate and install .pc files for pkg-config --enable-mixed-case tic should assume mixed-case filenames --with-install-prefix prefixes actual install-location ($DESTDIR) Build-Tools Needed to Compile Temporary Applications for Cross-compiling: @@ -709,6 +713,7 @@ Build-Tools Needed to Compile Temporary Applications for Cross-compiling: --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS) --with-build-libs=XXX the build libraries (${BUILD_LIBS}) Options to Specify the Libraries Built/Used: + --disable-libtool-version enable to use libtool's incompatible naming scheme --with-libtool generate libraries with libtool --with-shared generate shared-libraries --with-normal generate normal-libraries (default) @@ -722,6 +727,7 @@ Options to Specify the Libraries Built/Used: --enable-rpath use rpath option when generating shared libraries --disable-relink relink shared libraries during install --with-shlib-version=X Specify rel or abi version for shared libs + --disable-rpath-hack don't add rpath options for additional libraries Fine-Tuning Your Configuration: --disable-overwrite leave out the link to -lcurses --disable-database do not use terminfo, only fallbacks/termcap @@ -752,6 +758,7 @@ Fine-Tuning Your Configuration: --with-chtype=TYPE override type of chtype --with-ospeed=TYPE override type of ospeed variable --with-mmask-t=TYPE override type of mmask_t + --with-ccharw-max=XXX override size CCHARW_MAX --with-rcs-ids compile-in RCS identifiers Options to Specify How Manpages are Installed: --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and @@ -762,6 +769,8 @@ Options to Specify How Manpages are Installed: --with-manpage-tbl specify manpage processing with tbl Extensions: --disable-ext-funcs disable function-extensions + --enable-sp-funcs enable experimental SCREEN-extensions + --enable-term-driver enable experimental terminal-driver --enable-const compile with extra/non-standard const --enable-ext-colors compile for 256-color support --enable-ext-mouse compile for extended mouse-encoding @@ -776,10 +785,13 @@ Development Code: Experimental Code: --disable-assumed-color do not assume anything about default-colors --disable-hashmap compile without hashmap scrolling-optimization - --enable-colorfgbg compile with $COLORFGBG code + --enable-colorfgbg compile-in experimental $COLORFGBG code + --enable-interop compile-in experimental interop bindings --with-pthread use POSIX thread library + --enable-pthreads-eintr enable EINTR in wgetch with pthreads --enable-weak-symbols enable weak-symbols for pthreads --enable-reentrant compile with experimental reentrant code + --with-wrap-prefix=XXX override prefix used for public variables --enable-safe-sprintf compile with experimental safe-sprintf code --disable-scroll-hints compile without scroll-hints code --enable-wgetch-events compile with experimental wgetch-events code @@ -796,8 +808,9 @@ Testing/development Options: --with-trace test: add trace() function to all models of ncurses Ada95 Binding Options: --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake) - --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/lib/ada/adainclude) + --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/share/ada/adainclude) --with-ada-objects=DIR Ada objects are in DIR (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib=XX build Ada95 shared-library Some influential environment variables: CC C compiler command @@ -870,7 +883,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.20080325. Invocation command line was +generated by GNU Autoconf 2.52.20101002. Invocation command line was $ $0 $@ @@ -994,7 +1007,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:997: loading site script $ac_site_file" >&5 + { echo "$as_me:1010: 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" @@ -1005,7 +1018,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:1008: loading cache $cache_file" >&5 + { echo "$as_me:1021: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -1013,7 +1026,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:1016: creating cache $cache_file" >&5 + { echo "$as_me:1029: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1029,21 +1042,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:1032: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:1045: 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:1036: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:1049: 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:1042: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:1055: 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:1044: former value: $ac_old_val" >&5 + { echo "$as_me:1057: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:1046: current value: $ac_new_val" >&5 + { echo "$as_me:1059: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -1062,9 +1075,9 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:1065: error: changes in the environment can compromise the build" >&5 + { echo "$as_me:1078: 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:1067: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:1080: 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 @@ -1085,10 +1098,10 @@ esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:1088: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:1101: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:1091: \$? = $ac_status" >&5 + echo "$as_me:1104: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else @@ -1101,7 +1114,7 @@ ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg. top_builddir=`pwd` -echo "$as_me:1104: checking for egrep" >&5 +echo "$as_me:1117: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1111,11 +1124,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:1114: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:1127: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:1118: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:1131: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -1125,7 +1138,7 @@ NCURSES_PATCH="`$ac_cv_prog_egrep '^NCURSES_PATCH[ ]*=' $srcdir/dist.mk | sed - cf_cv_abi_version=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} cf_cv_timestamp=`date` -echo "$as_me:1128: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "$as_me:1141: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 @@ -1133,7 +1146,7 @@ test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 # Check whether --with-rel-version or --without-rel-version was given. if test "${with_rel_version+set}" = set; then withval="$with_rel_version" - { echo "$as_me:1136: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 + { echo "$as_me:1149: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 echo "$as_me: WARNING: overriding release version $cf_cv_rel_version to $withval" >&2;} cf_cv_rel_version=$withval fi; @@ -1146,13 +1159,13 @@ if test -n "$NCURSES_MAJOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1149: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 + { { echo "$as_me:1162: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 echo "$as_me: error: Release major-version is not a number: $NCURSES_MAJOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1155: error: Release major-version value is empty" >&5 + { { echo "$as_me:1168: error: Release major-version value is empty" >&5 echo "$as_me: error: Release major-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1162,13 +1175,13 @@ if test -n "$NCURSES_MINOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1165: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 + { { echo "$as_me:1178: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 echo "$as_me: error: Release minor-version is not a number: $NCURSES_MINOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1171: error: Release minor-version value is empty" >&5 + { { echo "$as_me:1184: error: Release minor-version value is empty" >&5 echo "$as_me: error: Release minor-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1178,7 +1191,7 @@ test -z "$cf_cv_abi_version" && cf_cv_abi_version=0 # Check whether --with-abi-version or --without-abi-version was given. if test "${with_abi_version+set}" = set; then withval="$with_abi_version" - { echo "$as_me:1181: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 + { echo "$as_me:1194: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 echo "$as_me: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&2;} cf_cv_abi_version=$withval fi; @@ -1188,13 +1201,13 @@ if test -n "$cf_cv_abi_version" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1191: error: ABI version is not a number: $cf_cv_abi_version" >&5 + { { echo "$as_me:1204: error: ABI version is not a number: $cf_cv_abi_version" >&5 echo "$as_me: error: ABI version is not a number: $cf_cv_abi_version" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1197: error: ABI version value is empty" >&5 + { { echo "$as_me:1210: error: ABI version value is empty" >&5 echo "$as_me: error: ABI version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1216,7 +1229,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1219: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1232: 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 @@ -1226,11 +1239,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:1229: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1242: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1233: checking build system type" >&5 +echo "$as_me:1246: 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 @@ -1239,23 +1252,23 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1242: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1255: 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:1246: error: $ac_config_sub $ac_cv_build_alias failed." >&5 + { { echo "$as_me:1259: 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:1251: result: $ac_cv_build" >&5 +echo "$as_me:1264: 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/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:1258: checking host system type" >&5 +echo "$as_me:1271: 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 @@ -1264,12 +1277,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:1267: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { echo "$as_me:1280: 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:1272: result: $ac_cv_host" >&5 +echo "$as_me:1285: 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/'` @@ -1277,7 +1290,7 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1280: checking target system type" >&5 + echo "$as_me:1293: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1286,12 +1299,12 @@ else test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1289: error: $ac_config_sub $ac_cv_target_alias failed" >&5 + { { echo "$as_me:1302: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1294: result: $ac_cv_target" >&5 +echo "$as_me:1307: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1322,13 +1335,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1325: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1338: 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:1329: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1342: 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:1331: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1344: 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 @@ -1336,7 +1349,7 @@ fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" - { echo "$as_me:1339: WARNING: overriding system type to $withval" >&5 + { echo "$as_me:1352: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval fi; @@ -1346,7 +1359,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location -echo "$as_me:1349: checking for prefix" >&5 +echo "$as_me:1362: checking for prefix" >&5 echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in @@ -1358,11 +1371,11 @@ if test "x$prefix" = "xNONE" ; then ;; esac fi -echo "$as_me:1361: result: $prefix" >&5 +echo "$as_me:1374: result: $prefix" >&5 echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then -echo "$as_me:1365: checking for default include-directory" >&5 +echo "$as_me:1378: checking for default include-directory" >&5 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ @@ -1385,7 +1398,7 @@ do fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done -echo "$as_me:1388: result: $includedir" >&5 +echo "$as_me:1401: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 fi @@ -1399,7 +1412,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:1402: checking for $ac_word" >&5 +echo "$as_me:1415: 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 @@ -1414,7 +1427,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:1417: found $ac_dir/$ac_word" >&5 +echo "$as_me:1430: found $ac_dir/$ac_word" >&5 break done @@ -1422,10 +1435,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1425: result: $CC" >&5 + echo "$as_me:1438: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1428: result: no" >&5 + echo "$as_me:1441: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1434,7 +1447,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:1437: checking for $ac_word" >&5 +echo "$as_me:1450: 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 @@ -1449,7 +1462,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:1452: found $ac_dir/$ac_word" >&5 +echo "$as_me:1465: found $ac_dir/$ac_word" >&5 break done @@ -1457,10 +1470,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1460: result: $ac_ct_CC" >&5 + echo "$as_me:1473: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1463: result: no" >&5 + echo "$as_me:1476: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1473,7 +1486,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:1476: checking for $ac_word" >&5 +echo "$as_me:1489: 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 @@ -1488,7 +1501,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:1491: found $ac_dir/$ac_word" >&5 +echo "$as_me:1504: found $ac_dir/$ac_word" >&5 break done @@ -1496,10 +1509,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1499: result: $CC" >&5 + echo "$as_me:1512: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1502: result: no" >&5 + echo "$as_me:1515: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1508,7 +1521,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:1511: checking for $ac_word" >&5 +echo "$as_me:1524: 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 @@ -1523,7 +1536,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:1526: found $ac_dir/$ac_word" >&5 +echo "$as_me:1539: found $ac_dir/$ac_word" >&5 break done @@ -1531,10 +1544,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1534: result: $ac_ct_CC" >&5 + echo "$as_me:1547: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1537: result: no" >&5 + echo "$as_me:1550: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1547,7 +1560,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:1550: checking for $ac_word" >&5 +echo "$as_me:1563: 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 @@ -1567,7 +1580,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1570: found $ac_dir/$ac_word" >&5 +echo "$as_me:1583: found $ac_dir/$ac_word" >&5 break done @@ -1589,10 +1602,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1592: result: $CC" >&5 + echo "$as_me:1605: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1595: result: no" >&5 + echo "$as_me:1608: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1603,7 +1616,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:1606: checking for $ac_word" >&5 +echo "$as_me:1619: 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 @@ -1618,7 +1631,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:1621: found $ac_dir/$ac_word" >&5 +echo "$as_me:1634: found $ac_dir/$ac_word" >&5 break done @@ -1626,10 +1639,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1629: result: $CC" >&5 + echo "$as_me:1642: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1632: result: no" >&5 + echo "$as_me:1645: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1642,7 +1655,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:1645: checking for $ac_word" >&5 +echo "$as_me:1658: 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 @@ -1657,7 +1670,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:1660: found $ac_dir/$ac_word" >&5 +echo "$as_me:1673: found $ac_dir/$ac_word" >&5 break done @@ -1665,10 +1678,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1668: result: $ac_ct_CC" >&5 + echo "$as_me:1681: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1671: result: no" >&5 + echo "$as_me:1684: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1680,32 +1693,32 @@ fi fi -test -z "$CC" && { { echo "$as_me:1683: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1696: 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:1688:" \ +echo "$as_me:1701:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1691: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:1704: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:1694: \$? = $ac_status" >&5 + echo "$as_me:1707: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1696: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:1709: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:1699: \$? = $ac_status" >&5 + echo "$as_me:1712: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1701: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:1714: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:1704: \$? = $ac_status" >&5 + echo "$as_me:1717: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1708 "configure" +#line 1721 "configure" #include "confdefs.h" int @@ -1721,13 +1734,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:1724: checking for C compiler default output" >&5 +echo "$as_me:1737: 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:1727: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:1740: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1730: \$? = $ac_status" >&5 + echo "$as_me:1743: \$? = $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 @@ -1736,7 +1749,7 @@ for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; @@ -1750,34 +1763,34 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1753: error: C compiler cannot create executables" >&5 +{ { echo "$as_me:1766: 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:1759: result: $ac_file" >&5 +echo "$as_me:1772: 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:1764: checking whether the C compiler works" >&5 +echo "$as_me:1777: 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:1770: \"$ac_try\"") >&5 + { (eval echo "$as_me:1783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1773: \$? = $ac_status" >&5 + echo "$as_me:1786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1780: error: cannot run C compiled programs. + { { echo "$as_me:1793: 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;} @@ -1785,24 +1798,24 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1788: result: yes" >&5 +echo "$as_me:1801: 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:1795: checking whether we are cross compiling" >&5 +echo "$as_me:1808: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1797: result: $cross_compiling" >&5 +echo "$as_me:1810: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1800: checking for executable suffix" >&5 +echo "$as_me:1813: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1805: \$? = $ac_status" >&5 + echo "$as_me:1818: \$? = $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 @@ -1810,7 +1823,7 @@ if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -1818,25 +1831,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1821: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1834: 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:1827: result: $ac_cv_exeext" >&5 +echo "$as_me:1840: 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:1833: checking for object suffix" >&5 +echo "$as_me:1846: 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 1839 "configure" +#line 1852 "configure" #include "confdefs.h" int @@ -1848,14 +1861,14 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1851: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1854: \$? = $ac_status" >&5 + echo "$as_me:1867: \$? = $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 - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1863,24 +1876,24 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1866: error: cannot compute OBJEXT: cannot compile" >&5 +{ { echo "$as_me:1879: 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:1873: result: $ac_cv_objext" >&5 +echo "$as_me:1886: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1877: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1890: 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 1883 "configure" +#line 1896 "configure" #include "confdefs.h" int @@ -1895,16 +1908,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1911: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1901: \$? = $ac_status" >&5 + echo "$as_me:1914: \$? = $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:1917: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1907: \$? = $ac_status" >&5 + echo "$as_me:1920: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -1916,19 +1929,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1919: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1932: 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:1925: checking whether $CC accepts -g" >&5 +echo "$as_me:1938: 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 1931 "configure" +#line 1944 "configure" #include "confdefs.h" int @@ -1940,16 +1953,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1943: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1956: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1946: \$? = $ac_status" >&5 + echo "$as_me:1959: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1949: \"$ac_try\"") >&5 + { (eval echo "$as_me:1962: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1952: \$? = $ac_status" >&5 + echo "$as_me:1965: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -1959,7 +1972,7 @@ ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1962: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1975: 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 @@ -1986,16 +1999,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1992: \$? = $ac_status" >&5 + echo "$as_me:2005: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1995: \"$ac_try\"") >&5 + { (eval echo "$as_me:2008: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1998: \$? = $ac_status" >&5 + echo "$as_me:2011: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -2007,7 +2020,7 @@ if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2010 "configure" +#line 2023 "configure" #include "confdefs.h" #include $ac_declaration @@ -2020,16 +2033,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2023: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2036: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2026: \$? = $ac_status" >&5 + echo "$as_me:2039: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2029: \"$ac_try\"") >&5 + { (eval echo "$as_me:2042: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2032: \$? = $ac_status" >&5 + echo "$as_me:2045: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2039,7 +2052,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2042 "configure" +#line 2055 "configure" #include "confdefs.h" $ac_declaration int @@ -2051,16 +2064,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2054: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2067: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2057: \$? = $ac_status" >&5 + echo "$as_me:2070: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2060: \"$ac_try\"") >&5 + { (eval echo "$as_me:2073: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2063: \$? = $ac_status" >&5 + echo "$as_me:2076: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -2069,7 +2082,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -f conftest* +rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -2090,11 +2103,11 @@ ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:2093: checking version of $CC" >&5 + echo "$as_me:2106: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 - GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:2097: result: $GCC_VERSION" >&5 + echo "$as_me:2110: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi @@ -2104,7 +2117,7 @@ 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:2107: checking how to run the C preprocessor" >&5 +echo "$as_me:2120: 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 @@ -2125,18 +2138,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 2128 "configure" +#line 2141 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2133: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2146: \"$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:2139: \$? = $ac_status" >&5 + echo "$as_me:2152: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2159,17 +2172,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 2162 "configure" +#line 2175 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2179: \"$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:2172: \$? = $ac_status" >&5 + echo "$as_me:2185: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2206,7 +2219,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:2209: result: $CPP" >&5 +echo "$as_me:2222: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2216,18 +2229,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 2219 "configure" +#line 2232 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2224: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2237: \"$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:2230: \$? = $ac_status" >&5 + echo "$as_me:2243: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2250,17 +2263,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 2253 "configure" +#line 2266 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2257: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2270: \"$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:2263: \$? = $ac_status" >&5 + echo "$as_me:2276: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2288,7 +2301,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2291: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2304: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2301,14 +2314,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:2304: checking whether $CC needs -traditional" >&5 + echo "$as_me:2317: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line 2311 "configure" +#line 2324 "configure" #include "confdefs.h" #include int Autoconf = TIOCGETP; @@ -2319,11 +2332,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_prog_gcc_traditional=no fi -rm -f conftest* +rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line 2326 "configure" +#line 2339 "configure" #include "confdefs.h" #include int Autoconf = TCGETA; @@ -2332,18 +2345,18 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* +rm -rf conftest* fi fi -echo "$as_me:2339: result: $ac_cv_prog_gcc_traditional" >&5 +echo "$as_me:2352: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo "$as_me:2346: checking whether $CC understands -c and -o together" >&5 +echo "$as_me:2359: checking whether $CC understands -c and -o together" >&5 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CC_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2359,38 +2372,38 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:2362: \"$ac_try\"") >&5 +if { (eval echo "$as_me:2375: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2365: \$? = $ac_status" >&5 + echo "$as_me:2378: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:2367: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:2380: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2370: \$? = $ac_status" >&5 + echo "$as_me:2383: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CC_c_o=yes else eval cf_cv_prog_CC_c_o=no fi -rm -f conftest* +rm -rf conftest* fi if test $cf_cv_prog_CC_c_o = yes; then - echo "$as_me:2381: result: yes" >&5 + echo "$as_me:2394: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2384: result: no" >&5 + echo "$as_me:2397: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:2388: checking for POSIXized ISC" >&5 +echo "$as_me:2401: checking for POSIXized ISC" >&5 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then - echo "$as_me:2393: result: yes" >&5 + echo "$as_me:2406: result: yes" >&5 echo "${ECHO_T}yes" >&6 ISC=yes # If later tests want to check for ISC. @@ -2404,13 +2417,13 @@ EOF CC="$CC -Xp" fi else - echo "$as_me:2407: result: no" >&5 + echo "$as_me:2420: result: no" >&5 echo "${ECHO_T}no" >&6 ISC= fi -echo "$as_me:2412: checking for ${CC-cc} option to accept ANSI C" >&5 -echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 +echo "$as_me:2425: checking for ${CC:-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2450,8 +2463,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2466,6 +2479,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2481,8 +2504,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2494,7 +2517,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2503,7 +2526,7 @@ if test -n "$cf_new_extra_cppflags" ; then fi cat >conftest.$ac_ext <<_ACEOF -#line 2506 "configure" +#line 2529 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2524,16 +2547,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2527: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2550: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2530: \$? = $ac_status" >&5 + echo "$as_me:2553: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2533: \"$ac_try\"") >&5 + { (eval echo "$as_me:2556: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2536: \$? = $ac_status" >&5 + echo "$as_me:2559: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else @@ -2546,7 +2569,7 @@ CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$as_me:2549: result: $cf_cv_ansi_cc" >&5 +echo "$as_me:2572: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then @@ -2568,8 +2591,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2584,6 +2607,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2599,8 +2632,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2612,7 +2645,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2629,7 +2662,7 @@ fi fi if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2632: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2665: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler @@ -2663,13 +2696,13 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -freebsd*) #(vi +dragonfly*|freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 -echo "$as_me:2672: checking for $ac_word" >&5 +echo "$as_me:2705: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2686,7 +2719,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_LDCONFIG="$ac_dir/$ac_word" - echo "$as_me:2689: found $ac_dir/$ac_word" >&5 + echo "$as_me:2722: found $ac_dir/$ac_word" >&5 break fi done @@ -2697,10 +2730,10 @@ fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then - echo "$as_me:2700: result: $LDCONFIG" >&5 + echo "$as_me:2733: result: $LDCONFIG" >&5 echo "${ECHO_T}$LDCONFIG" >&6 else - echo "$as_me:2703: result: no" >&5 + echo "$as_me:2736: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2708,7 +2741,7 @@ fi esac fi -echo "$as_me:2711: checking if you want to ensure bool is consistent with C++" >&5 +echo "$as_me:2744: checking if you want to ensure bool is consistent with C++" >&5 echo $ECHO_N "checking if you want to ensure bool is consistent with C++... $ECHO_C" >&6 # Check whether --with-cxx or --without-cxx was given. @@ -2718,7 +2751,7 @@ if test "${with_cxx+set}" = set; then else cf_with_cxx=yes fi; -echo "$as_me:2721: result: $cf_with_cxx" >&5 +echo "$as_me:2754: result: $cf_with_cxx" >&5 echo "${ECHO_T}$cf_with_cxx" >&6 if test "X$cf_with_cxx" = Xno ; then CXX="" @@ -2736,7 +2769,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:2739: checking for $ac_word" >&5 +echo "$as_me:2772: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2751,7 +2784,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_CXX="$ac_tool_prefix$ac_prog" -echo "$as_me:2754: found $ac_dir/$ac_word" >&5 +echo "$as_me:2787: found $ac_dir/$ac_word" >&5 break done @@ -2759,10 +2792,10 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:2762: result: $CXX" >&5 + echo "$as_me:2795: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:2765: result: no" >&5 + echo "$as_me:2798: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2775,7 +2808,7 @@ if test -z "$CXX"; 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:2778: checking for $ac_word" >&5 +echo "$as_me:2811: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2790,7 +2823,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_CXX="$ac_prog" -echo "$as_me:2793: found $ac_dir/$ac_word" >&5 +echo "$as_me:2826: found $ac_dir/$ac_word" >&5 break done @@ -2798,10 +2831,10 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:2801: result: $ac_ct_CXX" >&5 + echo "$as_me:2834: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else - echo "$as_me:2804: result: no" >&5 + echo "$as_me:2837: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2813,32 +2846,32 @@ test -n "$ac_ct_CXX" || ac_ct_CXX="g++" fi # Provide some information about the compiler. -echo "$as_me:2816:" \ +echo "$as_me:2849:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:2819: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:2852: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:2822: \$? = $ac_status" >&5 + echo "$as_me:2855: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2824: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:2857: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:2827: \$? = $ac_status" >&5 + echo "$as_me:2860: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2829: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:2862: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:2832: \$? = $ac_status" >&5 + echo "$as_me:2865: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:2835: checking whether we are using the GNU C++ compiler" >&5 +echo "$as_me:2868: 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_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2841 "configure" +#line 2874 "configure" #include "confdefs.h" int @@ -2853,16 +2886,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2856: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2889: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2859: \$? = $ac_status" >&5 + echo "$as_me:2892: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2862: \"$ac_try\"") >&5 + { (eval echo "$as_me:2895: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2865: \$? = $ac_status" >&5 + echo "$as_me:2898: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -2874,19 +2907,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:2877: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "$as_me:2910: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" -echo "$as_me:2883: checking whether $CXX accepts -g" >&5 +echo "$as_me:2916: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2889 "configure" +#line 2922 "configure" #include "confdefs.h" int @@ -2898,16 +2931,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2901: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2934: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2904: \$? = $ac_status" >&5 + echo "$as_me:2937: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2907: \"$ac_try\"") >&5 + { (eval echo "$as_me:2940: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2910: \$? = $ac_status" >&5 + echo "$as_me:2943: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else @@ -2917,7 +2950,7 @@ ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2920: result: $ac_cv_prog_cxx_g" >&5 +echo "$as_me:2953: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS @@ -2944,7 +2977,7 @@ for ac_declaration in \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2947 "configure" +#line 2980 "configure" #include "confdefs.h" #include $ac_declaration @@ -2957,16 +2990,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2960: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2993: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2963: \$? = $ac_status" >&5 + echo "$as_me:2996: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2966: \"$ac_try\"") >&5 + { (eval echo "$as_me:2999: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2969: \$? = $ac_status" >&5 + echo "$as_me:3002: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2976,7 +3009,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2979 "configure" +#line 3012 "configure" #include "confdefs.h" $ac_declaration int @@ -2988,16 +3021,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2991: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3024: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2994: \$? = $ac_status" >&5 + echo "$as_me:3027: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2997: \"$ac_try\"") >&5 + { (eval echo "$as_me:3030: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3000: \$? = $ac_status" >&5 + echo "$as_me:3033: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -3006,7 +3039,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -f conftest* +rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -3024,7 +3057,7 @@ ac_main_return=return if test "$CXX" = "g++" ; then # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -echo "$as_me:3027: checking for $ac_word" >&5 +echo "$as_me:3060: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3041,7 +3074,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_CXX="$ac_dir/$ac_word" - echo "$as_me:3044: found $ac_dir/$ac_word" >&5 + echo "$as_me:3077: found $ac_dir/$ac_word" >&5 break fi done @@ -3052,16 +3085,16 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - echo "$as_me:3055: result: $CXX" >&5 + echo "$as_me:3088: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:3058: result: no" >&5 + echo "$as_me:3091: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$CXX" = "g++" ; then - { echo "$as_me:3064: WARNING: ignoring hardcoded g++" >&5 + { echo "$as_me:3097: WARNING: ignoring hardcoded g++" >&5 echo "$as_me: WARNING: ignoring hardcoded g++" >&2;} cf_with_cxx=no; CXX=""; GXX=""; fi @@ -3069,11 +3102,11 @@ fi GXX_VERSION=none if test "$GXX" = yes; then - echo "$as_me:3072: checking version of g++" >&5 + echo "$as_me:3105: checking version of g++" >&5 echo $ECHO_N "checking version of g++... $ECHO_C" >&6 - GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown - echo "$as_me:3076: result: $GXX_VERSION" >&5 + echo "$as_me:3109: result: $GXX_VERSION" >&5 echo "${ECHO_T}$GXX_VERSION" >&6 fi @@ -3081,12 +3114,12 @@ case $GXX_VERSION in 1*|2.[0-6]*) # GXX=""; CXX=""; ac_cv_prog_gxx=no # cf_cxx_library=no - { echo "$as_me:3084: WARNING: templates do not work" >&5 + { echo "$as_me:3117: WARNING: templates do not work" >&5 echo "$as_me: WARNING: templates do not work" >&2;} ;; esac -echo "$as_me:3089: checking if you want to build C++ binding and demo" >&5 +echo "$as_me:3122: checking if you want to build C++ binding and demo" >&5 echo $ECHO_N "checking if you want to build C++ binding and demo... $ECHO_C" >&6 # Check whether --with-cxx-binding or --without-cxx-binding was given. @@ -3096,10 +3129,10 @@ if test "${with_cxx_binding+set}" = set; then else cf_with_cxx_binding=$cf_with_cxx fi; -echo "$as_me:3099: result: $cf_with_cxx_binding" >&5 +echo "$as_me:3132: result: $cf_with_cxx_binding" >&5 echo "${ECHO_T}$cf_with_cxx_binding" >&6 -echo "$as_me:3102: checking if you want to build with Ada95" >&5 +echo "$as_me:3135: checking if you want to build with Ada95" >&5 echo $ECHO_N "checking if you want to build with Ada95... $ECHO_C" >&6 # Check whether --with-ada or --without-ada was given. @@ -3109,10 +3142,23 @@ if test "${with_ada+set}" = set; then else cf_with_ada=yes fi; -echo "$as_me:3112: result: $cf_with_ada" >&5 +echo "$as_me:3145: result: $cf_with_ada" >&5 echo "${ECHO_T}$cf_with_ada" >&6 -echo "$as_me:3115: checking if you want to build programs such as tic" >&5 +echo "$as_me:3148: checking if you want to install manpages" >&5 +echo $ECHO_N "checking if you want to install manpages... $ECHO_C" >&6 + +# Check whether --with-manpages or --without-manpages was given. +if test "${with_manpages+set}" = set; then + withval="$with_manpages" + cf_with_manpages=$withval +else + cf_with_manpages=yes +fi; +echo "$as_me:3158: result: $cf_with_manpages" >&5 +echo "${ECHO_T}$cf_with_manpages" >&6 + +echo "$as_me:3161: checking if you want to build programs such as tic" >&5 echo $ECHO_N "checking if you want to build programs such as tic... $ECHO_C" >&6 # Check whether --with-progs or --without-progs was given. @@ -3122,10 +3168,23 @@ if test "${with_progs+set}" = set; then else cf_with_progs=yes fi; -echo "$as_me:3125: result: $cf_with_progs" >&5 +echo "$as_me:3171: result: $cf_with_progs" >&5 echo "${ECHO_T}$cf_with_progs" >&6 -echo "$as_me:3128: checking if you wish to install curses.h" >&5 +echo "$as_me:3174: checking if you want to build test-programs" >&5 +echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 + +# Check whether --with-tests or --without-tests was given. +if test "${with_tests+set}" = set; then + withval="$with_tests" + cf_with_tests=$withval +else + cf_with_tests=yes +fi; +echo "$as_me:3184: result: $cf_with_tests" >&5 +echo "${ECHO_T}$cf_with_tests" >&6 + +echo "$as_me:3187: checking if you wish to install curses.h" >&5 echo $ECHO_N "checking if you wish to install curses.h... $ECHO_C" >&6 # Check whether --with-curses-h or --without-curses-h was given. @@ -3135,7 +3194,7 @@ if test "${with_curses_h+set}" = set; then else with_curses_h=yes fi; -echo "$as_me:3138: result: $with_curses_h" >&5 +echo "$as_me:3197: result: $with_curses_h" >&5 echo "${ECHO_T}$with_curses_h" >&6 modules_to_build="ncurses" @@ -3161,7 +3220,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:3164: checking for $ac_word" >&5 +echo "$as_me:3223: 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 @@ -3176,7 +3235,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:3179: found $ac_dir/$ac_word" >&5 +echo "$as_me:3238: found $ac_dir/$ac_word" >&5 break done @@ -3184,21 +3243,21 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:3187: result: $AWK" >&5 + echo "$as_me:3246: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:3190: result: no" >&5 + echo "$as_me:3249: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done -test -z "$AWK" && { { echo "$as_me:3197: error: No awk program found" >&5 +test -z "$AWK" && { { echo "$as_me:3256: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:3201: checking for egrep" >&5 +echo "$as_me:3260: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3208,11 +3267,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:3211: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:3270: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:3215: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:3274: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -3228,7 +3287,7 @@ echo "$as_me: error: No egrep program found" >&2;} # 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:3231: checking for a BSD compatible install" >&5 +echo "$as_me:3290: 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 @@ -3277,7 +3336,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:3280: result: $INSTALL" >&5 +echo "$as_me:3339: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -3298,11 +3357,11 @@ case $INSTALL in ;; esac -for ac_prog in tdlint lint alint +for ac_prog in tdlint lint alint splint lclint 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:3305: checking for $ac_word" >&5 +echo "$as_me:3364: 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 @@ -3317,7 +3376,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:3320: found $ac_dir/$ac_word" >&5 +echo "$as_me:3379: found $ac_dir/$ac_word" >&5 break done @@ -3325,28 +3384,45 @@ fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$as_me:3328: result: $LINT" >&5 + echo "$as_me:3387: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else - echo "$as_me:3331: result: no" >&5 + echo "$as_me:3390: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done -echo "$as_me:3338: checking whether ln -s works" >&5 +echo "$as_me:3397: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:3342: result: yes" >&5 + echo "$as_me:3401: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:3345: result: no, using $LN_S" >&5 + echo "$as_me:3404: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi -echo "$as_me:3349: checking for long file names" >&5 +echo "$as_me:3408: checking if $LN_S -f options work" >&5 +echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +echo "$as_me:3420: result: $cf_prog_ln_sf" >&5 +echo "${ECHO_T}$cf_prog_ln_sf" >&6 + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" + +echo "$as_me:3425: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3385,7 +3461,7 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do rm -rf $ac_xdir 2>/dev/null done fi -echo "$as_me:3388: result: $ac_cv_sys_long_file_names" >&5 +echo "$as_me:3464: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then @@ -3395,7 +3471,182 @@ EOF fi -echo "$as_me:3398: checking if we should assume mixed-case filenames" >&5 +# if we find pkg-config, check if we should install the ".pc" files. + +echo "$as_me:3476: 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. +if test "${with_pkg_config+set}" = set; then + withval="$with_pkg_config" + cf_pkg_config=$withval +else + cf_pkg_config=yes +fi; +echo "$as_me:3486: result: $cf_pkg_config" >&5 +echo "${ECHO_T}$cf_pkg_config" >&6 + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + 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:3497: 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 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:3514: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:3525: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:3528: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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:3537: 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 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:3554: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:3566: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:3569: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$PKG_CONFIG" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:3612: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 +echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi + +if test "$PKG_CONFIG" != no ; then + echo "$as_me:3621: checking if we should install .pc files for $PKG_CONFIG" >&5 +echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6 + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + +# Check whether --enable-pc-files or --disable-pc-files was given. +if test "${enable_pc_files+set}" = set; then + enableval="$enable_pc_files" + enable_pc_files=$enableval +else + enable_pc_files=no +fi; + echo "$as_me:3638: result: $enable_pc_files" >&5 +echo "${ECHO_T}$enable_pc_files" >&6 + else + echo "$as_me:3641: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:3643: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 +echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} + enable_pc_files=no + fi +fi + +echo "$as_me:3649: checking if we should assume mixed-case filenames" >&5 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 # Check whether --enable-mixed-case or --disable-mixed-case was given. @@ -3405,11 +3656,11 @@ if test "${enable_mixed_case+set}" = set; then else enable_mixedcase=auto fi; -echo "$as_me:3408: result: $enable_mixedcase" >&5 +echo "$as_me:3659: result: $enable_mixedcase" >&5 echo "${ECHO_T}$enable_mixedcase" >&6 if test "$enable_mixedcase" = "auto" ; then -echo "$as_me:3412: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:3663: 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 @@ -3436,7 +3687,7 @@ else fi fi -echo "$as_me:3439: result: $cf_cv_mixedcase" >&5 +echo "$as_me:3690: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 @@ -3453,7 +3704,7 @@ EOF fi # do this after mixed-case option (tags/TAGS is not as important as tic). -echo "$as_me:3456: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "$as_me:3707: 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 @@ -3473,18 +3724,92 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:3476: result: yes" >&5 + echo "$as_me:3727: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:3480: result: no" >&5 + echo "$as_me:3731: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi -# Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -echo "$as_me:3487: checking for $ac_word" >&5 +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:3740: 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 +else + if test -n "$CTAGS"; then + ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CTAGS="$ac_prog" +echo "$as_me:3755: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CTAGS=$ac_cv_prog_CTAGS +if test -n "$CTAGS"; then + echo "$as_me:3763: result: $CTAGS" >&5 +echo "${ECHO_T}$CTAGS" >&6 +else + echo "$as_me:3766: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CTAGS" && break +done + +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:3777: 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 +else + if test -n "$ETAGS"; then + ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ETAGS="$ac_prog" +echo "$as_me:3792: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ETAGS=$ac_cv_prog_ETAGS +if test -n "$ETAGS"; then + echo "$as_me:3800: result: $ETAGS" >&5 +echo "${ECHO_T}$ETAGS" >&6 +else + echo "$as_me:3803: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ETAGS" && break +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:3812: 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 @@ -3499,7 +3824,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:3502: found $ac_dir/$ac_word" >&5 +echo "$as_me:3827: found $ac_dir/$ac_word" >&5 break done @@ -3508,17 +3833,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:3511: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:3836: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:3514: result: no" >&5 + echo "$as_me:3839: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then - # Extract the first word of "etags", so it can be a program name with args. -set dummy etags; ac_word=$2 -echo "$as_me:3521: checking for $ac_word" >&5 + # 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:3846: 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 @@ -3533,7 +3858,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:3536: found $ac_dir/$ac_word" >&5 +echo "$as_me:3861: found $ac_dir/$ac_word" >&5 break done @@ -3542,10 +3867,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:3545: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:3870: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:3548: result: no" >&5 + echo "$as_me:3873: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3565,7 +3890,7 @@ else MAKE_LOWER_TAGS="#" fi -echo "$as_me:3568: checking for makeflags variable" >&5 +echo "$as_me:3893: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3579,10 +3904,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -3599,13 +3924,13 @@ CF_EOF rm -f cf_makeflags.tmp fi -echo "$as_me:3602: result: $cf_cv_makeflags" >&5 +echo "$as_me:3927: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:3608: checking for $ac_word" >&5 +echo "$as_me:3933: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3620,7 +3945,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_RANLIB="${ac_tool_prefix}ranlib" -echo "$as_me:3623: found $ac_dir/$ac_word" >&5 +echo "$as_me:3948: found $ac_dir/$ac_word" >&5 break done @@ -3628,10 +3953,10 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:3631: result: $RANLIB" >&5 + echo "$as_me:3956: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else - echo "$as_me:3634: result: no" >&5 + echo "$as_me:3959: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3640,7 +3965,7 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:3643: checking for $ac_word" >&5 +echo "$as_me:3968: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3655,7 +3980,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_RANLIB="ranlib" -echo "$as_me:3658: found $ac_dir/$ac_word" >&5 +echo "$as_me:3983: found $ac_dir/$ac_word" >&5 break done @@ -3664,10 +3989,10 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:3667: result: $ac_ct_RANLIB" >&5 + echo "$as_me:3992: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$as_me:3670: result: no" >&5 + echo "$as_me:3995: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3679,7 +4004,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 -echo "$as_me:3682: checking for $ac_word" >&5 +echo "$as_me:4007: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3694,7 +4019,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_LD="${ac_tool_prefix}ld" -echo "$as_me:3697: found $ac_dir/$ac_word" >&5 +echo "$as_me:4022: found $ac_dir/$ac_word" >&5 break done @@ -3702,10 +4027,10 @@ fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$as_me:3705: result: $LD" >&5 + echo "$as_me:4030: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else - echo "$as_me:3708: result: no" >&5 + echo "$as_me:4033: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3714,7 +4039,7 @@ if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo "$as_me:3717: checking for $ac_word" >&5 +echo "$as_me:4042: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3729,7 +4054,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_LD="ld" -echo "$as_me:3732: found $ac_dir/$ac_word" >&5 +echo "$as_me:4057: found $ac_dir/$ac_word" >&5 break done @@ -3738,10 +4063,10 @@ fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then - echo "$as_me:3741: result: $ac_ct_LD" >&5 + echo "$as_me:4066: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else - echo "$as_me:3744: result: no" >&5 + echo "$as_me:4069: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3753,7 +4078,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:3756: checking for $ac_word" >&5 +echo "$as_me:4081: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3768,7 +4093,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_AR="${ac_tool_prefix}ar" -echo "$as_me:3771: found $ac_dir/$ac_word" >&5 +echo "$as_me:4096: found $ac_dir/$ac_word" >&5 break done @@ -3776,10 +4101,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:3779: result: $AR" >&5 + echo "$as_me:4104: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:3782: result: no" >&5 + echo "$as_me:4107: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3788,7 +4113,7 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:3791: checking for $ac_word" >&5 +echo "$as_me:4116: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3803,7 +4128,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_AR="ar" -echo "$as_me:3806: found $ac_dir/$ac_word" >&5 +echo "$as_me:4131: found $ac_dir/$ac_word" >&5 break done @@ -3812,10 +4137,10 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:3815: result: $ac_ct_AR" >&5 + echo "$as_me:4140: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else - echo "$as_me:3818: result: no" >&5 + echo "$as_me:4143: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3824,25 +4149,140 @@ else AR="$ac_cv_prog_AR" fi -if test "${cf_cv_subst_AR_OPTS+set}" = set; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:4155: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${ac_tool_prefix}ar" +echo "$as_me:4170: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:4178: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:4181: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:4190: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_AR="ar" +echo "$as_me:4205: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:4214: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:4217: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +echo "$as_me:4226: checking for options to update archives" >&5 +echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 +if test "${cf_cv_ar_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "$as_me:3831: checking for archiver options (symbol AR_OPTS)" >&5 -echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6 + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do -if test -z "$AR_OPTS" ; then - AR_OPTS=rv + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4255: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + test -n "$verbose" && echo " cannot compile test-program" 1>&6 + +echo "${as_me:-configure}:4266: testing cannot compile test-program ..." 1>&5 + + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext fi +echo "$as_me:4274: result: $cf_cv_ar_flags" >&5 +echo "${ECHO_T}$cf_cv_ar_flags" >&6 -cf_cv_subst_AR_OPTS=$AR_OPTS -echo "$as_me:3840: result: $AR_OPTS" >&5 -echo "${ECHO_T}$AR_OPTS" >&6 - +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags fi -echo "$as_me:3845: checking if you have specified an install-prefix" >&5 +echo "$as_me:4285: checking if you have specified an install-prefix" >&5 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. @@ -3855,7 +4295,7 @@ if test "${with_install_prefix+set}" = set; then ;; esac fi; -echo "$as_me:3858: result: $DESTDIR" >&5 +echo "$as_me:4298: result: $DESTDIR" >&5 echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### @@ -3883,7 +4323,7 @@ else 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:3886: checking for $ac_word" >&5 +echo "$as_me:4326: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3898,7 +4338,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_BUILD_CC="$ac_prog" -echo "$as_me:3901: found $ac_dir/$ac_word" >&5 +echo "$as_me:4341: found $ac_dir/$ac_word" >&5 break done @@ -3906,10 +4346,10 @@ fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - echo "$as_me:3909: result: $BUILD_CC" >&5 + echo "$as_me:4349: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else - echo "$as_me:3912: result: no" >&5 + echo "$as_me:4352: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3917,12 +4357,12 @@ fi done fi; - echo "$as_me:3920: checking for native build C compiler" >&5 + echo "$as_me:4360: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 - echo "$as_me:3922: result: $BUILD_CC" >&5 + echo "$as_me:4362: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 - echo "$as_me:3925: checking for native build C preprocessor" >&5 + echo "$as_me:4365: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. @@ -3932,10 +4372,10 @@ if test "${with_build_cpp+set}" = set; then else BUILD_CPP='${BUILD_CC} -E' fi; - echo "$as_me:3935: result: $BUILD_CPP" >&5 + echo "$as_me:4375: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 - echo "$as_me:3938: checking for native build C flags" >&5 + echo "$as_me:4378: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. @@ -3943,10 +4383,10 @@ if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; - echo "$as_me:3946: result: $BUILD_CFLAGS" >&5 + echo "$as_me:4386: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 - echo "$as_me:3949: checking for native build C preprocessor-flags" >&5 + echo "$as_me:4389: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. @@ -3954,10 +4394,10 @@ if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; - echo "$as_me:3957: result: $BUILD_CPPFLAGS" >&5 + echo "$as_me:4397: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 - echo "$as_me:3960: checking for native build linker-flags" >&5 + echo "$as_me:4400: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. @@ -3965,10 +4405,10 @@ if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; - echo "$as_me:3968: result: $BUILD_LDFLAGS" >&5 + echo "$as_me:4408: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 - echo "$as_me:3971: checking for native build linker-libraries" >&5 + echo "$as_me:4411: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. @@ -3976,7 +4416,7 @@ if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; - echo "$as_me:3979: result: $BUILD_LIBS" >&5 + echo "$as_me:4419: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. @@ -3986,7 +4426,7 @@ echo "${ECHO_T}$BUILD_LIBS" >&6 : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then - { { echo "$as_me:3989: error: Cross-build requires two compilers. + { { echo "$as_me:4429: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} @@ -4011,6 +4451,32 @@ fi ### shared, for example. cf_list_models="" +echo "$as_me:4454: checking if libtool -version-number should be used" >&5 +echo $ECHO_N "checking if libtool -version-number should be used... $ECHO_C" >&6 + +# Check whether --enable-libtool-version or --disable-libtool-version was given. +if test "${enable_libtool_version+set}" = set; then + enableval="$enable_libtool_version" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + cf_libtool_version=no + else + cf_libtool_version=yes + fi +else + enableval=yes + cf_libtool_version=yes + +fi; +echo "$as_me:4471: result: $cf_libtool_version" >&5 +echo "${ECHO_T}$cf_libtool_version" >&6 + +if test "$cf_libtool_version" = yes ; then + LIBTOOL_VERSION="-version-number" +else + LIBTOOL_VERSION="-version-info" +fi + LIBTOOL= # common library maintenance symbols that are convenient for libtool scripts: @@ -4027,7 +4493,7 @@ LIB_LINK='${CC}' LIB_INSTALL= LIB_UNINSTALL= -echo "$as_me:4030: checking if you want to build libraries with libtool" >&5 +echo "$as_me:4496: checking if you want to build libraries with libtool" >&5 echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6 # Check whether --with-libtool or --without-libtool was given. @@ -4037,11 +4503,11 @@ if test "${with_libtool+set}" = set; then else with_libtool=no fi; -echo "$as_me:4040: result: $with_libtool" >&5 +echo "$as_me:4506: result: $with_libtool" >&5 echo "${ECHO_T}$with_libtool" >&6 if test "$with_libtool" != "no"; then - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -4068,7 +4534,7 @@ case ".$with_libtool" in #(vi with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:4071: error: expected a pathname, not \"$with_libtool\"" >&5 + { { echo "$as_me:4537: error: expected a pathname, not \"$with_libtool\"" >&5 echo "$as_me: error: expected a pathname, not \"$with_libtool\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -4076,9 +4542,9 @@ esac LIBTOOL=$with_libtool else - # Extract the first word of "libtool", so it can be a program name with args. + # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 -echo "$as_me:4081: checking for $ac_word" >&5 +echo "$as_me:4547: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LIBTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4095,7 +4561,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_LIBTOOL="$ac_dir/$ac_word" - echo "$as_me:4098: found $ac_dir/$ac_word" >&5 + echo "$as_me:4564: found $ac_dir/$ac_word" >&5 break fi done @@ -4106,20 +4572,20 @@ fi LIBTOOL=$ac_cv_path_LIBTOOL if test -n "$LIBTOOL"; then - echo "$as_me:4109: result: $LIBTOOL" >&5 + echo "$as_me:4575: result: $LIBTOOL" >&5 echo "${ECHO_T}$LIBTOOL" >&6 else - echo "$as_me:4112: result: no" >&5 + echo "$as_me:4578: result: no" >&5 echo "${ECHO_T}no" >&6 fi - fi - if test -z "$LIBTOOL" ; then - { { echo "$as_me:4118: error: Cannot find libtool" >&5 + fi + if test -z "$LIBTOOL" ; then + { { echo "$as_me:4584: error: Cannot find libtool" >&5 echo "$as_me: error: Cannot find libtool" >&2;} { (exit 1); exit 1; }; } - fi - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + fi + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -4130,24 +4596,32 @@ echo "$as_me: error: Cannot find libtool" >&2;} LIB_PREP=: # Show the version of libtool - echo "$as_me:4133: checking version of libtool" >&5 + echo "$as_me:4599: checking version of libtool" >&5 echo $ECHO_N "checking version of libtool... $ECHO_C" >&6 # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. + # bug reports it might be useful to have the original string. "(" cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([^)]*)//g' -e 's/^[^1-9]*//' -e 's/[^0-9.].*//'` - echo "$as_me:4140: result: $cf_cv_libtool_version" >&5 + echo "$as_me:4606: result: $cf_cv_libtool_version" >&5 echo "${ECHO_T}$cf_cv_libtool_version" >&6 if test -z "$cf_cv_libtool_version" ; then - { { echo "$as_me:4143: error: This is not GNU libtool" >&5 + { { echo "$as_me:4609: error: This is not GNU libtool" >&5 echo "$as_me: error: This is not GNU libtool" >&2;} { (exit 1); exit 1; }; } fi + # special hack to add -no-undefined (which libtool should do for itself) + LT_UNDEF= + case "$cf_cv_system_name" in #(vi + cygwin*|mingw32*|uwin*|aix[456]) #(vi + LT_UNDEF=-no-undefined + ;; + esac + # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[5-9]*|[2-9]*) + case $cf_cv_libtool_version in #(vi + 1.[5-9]*|[2-9].[0-9.a-z]*) #(vi LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -4168,7 +4642,7 @@ cf_list_models="$cf_list_models libtool" else -echo "$as_me:4171: checking if you want to build shared libraries" >&5 +echo "$as_me:4645: checking if you want to build shared libraries" >&5 echo $ECHO_N "checking if you want to build shared libraries... $ECHO_C" >&6 # Check whether --with-shared or --without-shared was given. @@ -4178,11 +4652,11 @@ if test "${with_shared+set}" = set; then else with_shared=no fi; -echo "$as_me:4181: result: $with_shared" >&5 +echo "$as_me:4655: result: $with_shared" >&5 echo "${ECHO_T}$with_shared" >&6 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" -echo "$as_me:4185: checking if you want to build static libraries" >&5 +echo "$as_me:4659: checking if you want to build static libraries" >&5 echo $ECHO_N "checking if you want to build static libraries... $ECHO_C" >&6 # Check whether --with-normal or --without-normal was given. @@ -4192,11 +4666,11 @@ if test "${with_normal+set}" = set; then else with_normal=yes fi; -echo "$as_me:4195: result: $with_normal" >&5 +echo "$as_me:4669: result: $with_normal" >&5 echo "${ECHO_T}$with_normal" >&6 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" -echo "$as_me:4199: checking if you want to build debug libraries" >&5 +echo "$as_me:4673: checking if you want to build debug libraries" >&5 echo $ECHO_N "checking if you want to build debug libraries... $ECHO_C" >&6 # Check whether --with-debug or --without-debug was given. @@ -4206,11 +4680,11 @@ if test "${with_debug+set}" = set; then else with_debug=yes fi; -echo "$as_me:4209: result: $with_debug" >&5 +echo "$as_me:4683: result: $with_debug" >&5 echo "${ECHO_T}$with_debug" >&6 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" -echo "$as_me:4213: checking if you want to build profiling libraries" >&5 +echo "$as_me:4687: checking if you want to build profiling libraries" >&5 echo $ECHO_N "checking if you want to build profiling libraries... $ECHO_C" >&6 # Check whether --with-profile or --without-profile was given. @@ -4220,7 +4694,7 @@ if test "${with_profile+set}" = set; then else with_profile=no fi; -echo "$as_me:4223: result: $with_profile" >&5 +echo "$as_me:4697: result: $with_profile" >&5 echo "${ECHO_T}$with_profile" >&6 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" @@ -4228,19 +4702,19 @@ fi ############################################################################### -echo "$as_me:4231: checking for specified models" >&5 +echo "$as_me:4705: checking for specified models" >&5 echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal test "$with_libtool" != "no" && cf_list_models=libtool -echo "$as_me:4235: result: $cf_list_models" >&5 +echo "$as_me:4709: result: $cf_list_models" >&5 echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. -echo "$as_me:4240: checking for default model" >&5 +echo "$as_me:4714: checking for default model" >&5 echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` -echo "$as_me:4243: result: $DFT_LWR_MODEL" >&5 +echo "$as_me:4717: result: $DFT_LWR_MODEL" >&5 echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` @@ -4269,7 +4743,7 @@ LIB_SUFFIX= ############################################################################### -echo "$as_me:4272: checking if you want to build a separate terminfo library" >&5 +echo "$as_me:4746: checking if you want to build a separate terminfo library" >&5 echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6 # Check whether --with-termlib or --without-termlib was given. @@ -4279,10 +4753,10 @@ if test "${with_termlib+set}" = set; then else with_termlib=no fi; -echo "$as_me:4282: result: $with_termlib" >&5 +echo "$as_me:4756: result: $with_termlib" >&5 echo "${ECHO_T}$with_termlib" >&6 -echo "$as_me:4285: checking if you want to build a separate tic library" >&5 +echo "$as_me:4759: checking if you want to build a separate tic library" >&5 echo $ECHO_N "checking if you want to build a separate tic library... $ECHO_C" >&6 # Check whether --with-ticlib or --without-ticlib was given. @@ -4292,13 +4766,13 @@ if test "${with_ticlib+set}" = set; then else with_ticlib=no fi; -echo "$as_me:4295: result: $with_ticlib" >&5 +echo "$as_me:4769: result: $with_ticlib" >&5 echo "${ECHO_T}$with_ticlib" >&6 ### Checks for special libraries, must be done up-front. SHLIB_LIST="" -echo "$as_me:4301: checking if you want to link with the GPM mouse library" >&5 +echo "$as_me:4775: checking if you want to link with the GPM mouse library" >&5 echo $ECHO_N "checking if you want to link with the GPM mouse library... $ECHO_C" >&6 # Check whether --with-gpm or --without-gpm was given. @@ -4308,27 +4782,27 @@ if test "${with_gpm+set}" = set; then else with_gpm=maybe fi; -echo "$as_me:4311: result: $with_gpm" >&5 +echo "$as_me:4785: result: $with_gpm" >&5 echo "${ECHO_T}$with_gpm" >&6 if test "$with_gpm" != no ; then - echo "$as_me:4315: checking for gpm.h" >&5 + echo "$as_me:4789: checking for gpm.h" >&5 echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6 if test "${ac_cv_header_gpm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4321 "configure" +#line 4795 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4325: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4799: \"$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:4331: \$? = $ac_status" >&5 + echo "$as_me:4805: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4347,7 +4821,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4350: result: $ac_cv_header_gpm_h" >&5 +echo "$as_me:4824: result: $ac_cv_header_gpm_h" >&5 echo "${ECHO_T}$ac_cv_header_gpm_h" >&6 if test $ac_cv_header_gpm_h = yes; then @@ -4358,14 +4832,14 @@ EOF if test "$with_gpm" != yes && test "$with_gpm" != maybe ; then test -n "$verbose" && echo " assuming we really have GPM library" 1>&6 -echo "${as_me-configure}:4361: testing assuming we really have GPM library ..." 1>&5 +echo "${as_me:-configure}:4835: testing assuming we really have GPM library ..." 1>&5 cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF else - echo "$as_me:4368: checking for Gpm_Open in -lgpm" >&5 + echo "$as_me:4842: 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 @@ -4373,7 +4847,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4376 "configure" +#line 4850 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4392,16 +4866,16 @@ Gpm_Open (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4395: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4869: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4398: \$? = $ac_status" >&5 + echo "$as_me:4872: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4401: \"$ac_try\"") >&5 + { (eval echo "$as_me:4875: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4404: \$? = $ac_status" >&5 + echo "$as_me:4878: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else @@ -4412,13 +4886,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4415: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "$as_me:4889: 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 : else - { { echo "$as_me:4421: error: Cannot link with GPM library" >&5 + { { echo "$as_me:4895: error: Cannot link with GPM library" >&5 echo "$as_me: error: Cannot link with GPM library" >&2;} { (exit 1); exit 1; }; } fi @@ -4428,7 +4902,7 @@ fi else - test "$with_gpm" != maybe && { echo "$as_me:4431: WARNING: Cannot find GPM header" >&5 + test "$with_gpm" != maybe && { echo "$as_me:4905: WARNING: Cannot find GPM header" >&5 echo "$as_me: WARNING: Cannot find GPM header" >&2;} with_gpm=no @@ -4437,7 +4911,7 @@ fi fi if test "$with_gpm" != no ; then - echo "$as_me:4440: checking if you want to load GPM dynamically" >&5 + echo "$as_me:4914: checking if you want to load GPM dynamically" >&5 echo $ECHO_N "checking if you want to load GPM dynamically... $ECHO_C" >&6 # Check whether --with-dlsym or --without-dlsym was given. @@ -4447,18 +4921,18 @@ if test "${with_dlsym+set}" = set; then else with_dlsym=yes fi; - echo "$as_me:4450: result: $with_dlsym" >&5 + echo "$as_me:4924: result: $with_dlsym" >&5 echo "${ECHO_T}$with_dlsym" >&6 if test "$with_dlsym" = yes ; then cf_have_dlsym=no -echo "$as_me:4455: checking for dlsym" >&5 +echo "$as_me:4929: checking for dlsym" >&5 echo $ECHO_N "checking for dlsym... $ECHO_C" >&6 if test "${ac_cv_func_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4461 "configure" +#line 4935 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlsym (); below. */ @@ -4489,16 +4963,16 @@ f = dlsym; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4492: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4966: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4495: \$? = $ac_status" >&5 + echo "$as_me:4969: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4498: \"$ac_try\"") >&5 + { (eval echo "$as_me:4972: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4501: \$? = $ac_status" >&5 + echo "$as_me:4975: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlsym=yes else @@ -4508,14 +4982,14 @@ ac_cv_func_dlsym=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4511: result: $ac_cv_func_dlsym" >&5 +echo "$as_me:4985: result: $ac_cv_func_dlsym" >&5 echo "${ECHO_T}$ac_cv_func_dlsym" >&6 if test $ac_cv_func_dlsym = yes; then cf_have_dlsym=yes else cf_have_libdl=no -echo "$as_me:4518: checking for dlsym in -ldl" >&5 +echo "$as_me:4992: checking for dlsym in -ldl" >&5 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4523,7 +4997,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4526 "configure" +#line 5000 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4542,16 +5016,16 @@ dlsym (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4545: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5019: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4548: \$? = $ac_status" >&5 + echo "$as_me:5022: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4551: \"$ac_try\"") >&5 + { (eval echo "$as_me:5025: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4554: \$? = $ac_status" >&5 + echo "$as_me:5028: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlsym=yes else @@ -4562,7 +5036,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4565: result: $ac_cv_lib_dl_dlsym" >&5 +echo "$as_me:5039: result: $ac_cv_lib_dl_dlsym" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6 if test $ac_cv_lib_dl_dlsym = yes; then @@ -4575,10 +5049,10 @@ fi if test "$cf_have_dlsym" = yes ; then test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" - echo "$as_me:4578: checking whether able to link to dl*() functions" >&5 + echo "$as_me:5052: checking whether able to link to dl*() functions" >&5 echo $ECHO_N "checking whether able to link to dl*() functions... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 4581 "configure" +#line 5055 "configure" #include "confdefs.h" #include int @@ -4596,16 +5070,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4599: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5073: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4602: \$? = $ac_status" >&5 + echo "$as_me:5076: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4605: \"$ac_try\"") >&5 + { (eval echo "$as_me:5079: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4608: \$? = $ac_status" >&5 + echo "$as_me:5082: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\EOF @@ -4616,15 +5090,15 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - { { echo "$as_me:4619: error: Cannot link test program for libdl" >&5 + { { echo "$as_me:5093: error: Cannot link test program for libdl" >&5 echo "$as_me: error: Cannot link test program for libdl" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:4624: result: ok" >&5 + echo "$as_me:5098: result: ok" >&5 echo "${ECHO_T}ok" >&6 else - { { echo "$as_me:4627: error: Cannot find dlsym function" >&5 + { { echo "$as_me:5101: error: Cannot find dlsym function" >&5 echo "$as_me: error: Cannot find dlsym function" >&2;} { (exit 1); exit 1; }; } fi @@ -4632,12 +5106,12 @@ fi if test "$with_gpm" != yes ; then test -n "$verbose" && echo " assuming soname for gpm is $with_gpm" 1>&6 -echo "${as_me-configure}:4635: testing assuming soname for gpm is $with_gpm ..." 1>&5 +echo "${as_me:-configure}:5109: testing assuming soname for gpm is $with_gpm ..." 1>&5 cf_cv_gpm_soname="$with_gpm" else -echo "$as_me:4640: checking for soname of gpm library" >&5 +echo "$as_me:5114: checking for soname of gpm library" >&5 echo $ECHO_N "checking for soname of gpm library... $ECHO_C" >&6 if test "${cf_cv_gpm_soname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4655,26 +5129,26 @@ if (Gpm_Open(0,0)) Gpm_Close(); CF_EOF cf_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" - if { (eval echo "$as_me:4658: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4661: \$? = $ac_status" >&5 + echo "$as_me:5135: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:4663: \"$ac_link\"") >&5 + if { (eval echo "$as_me:5137: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4666: \$? = $ac_status" >&5 + echo "$as_me:5140: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_gpm_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep libgpm.` test -z "$cf_cv_gpm_soname" && cf_cv_gpm_soname=unknown fi fi -rm -f conftest* +rm -rf conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:4677: result: $cf_cv_gpm_soname" >&5 +echo "$as_me:5151: result: $cf_cv_gpm_soname" >&5 echo "${ECHO_T}$cf_cv_gpm_soname" >&6 fi @@ -4685,12 +5159,13 @@ EOF SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" + TEST_LIBS="-lgpm $TEST_LIBS" fi cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF -echo "$as_me:4693: checking for Gpm_Wgetch in -lgpm" >&5 +echo "$as_me:5168: checking for Gpm_Wgetch in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Wgetch in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4698,7 +5173,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4701 "configure" +#line 5176 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4717,16 +5192,16 @@ Gpm_Wgetch (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4720: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5195: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4723: \$? = $ac_status" >&5 + echo "$as_me:5198: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4726: \"$ac_try\"") >&5 + { (eval echo "$as_me:5201: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4729: \$? = $ac_status" >&5 + echo "$as_me:5204: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Wgetch=yes else @@ -4737,11 +5212,11 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4740: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 +echo "$as_me:5215: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Wgetch" >&6 if test $ac_cv_lib_gpm_Gpm_Wgetch = yes; then -echo "$as_me:4744: checking if GPM is weakly bound to curses library" >&5 +echo "$as_me:5219: checking if GPM is weakly bound to curses library" >&5 echo $ECHO_N "checking if GPM is weakly bound to curses library... $ECHO_C" >&6 if test "${cf_cv_check_gpm_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4765,31 +5240,31 @@ CF_EOF # to rely on the static library, noting that some packagers may not # include it. LIBS="-static -lgpm -dynamic $LIBS" - if { (eval echo "$as_me:4768: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5243: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4771: \$? = $ac_status" >&5 + echo "$as_me:5246: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:4773: \"$ac_link\"") >&5 + if { (eval echo "$as_me:5248: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4776: \$? = $ac_status" >&5 + echo "$as_me:5251: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_check_gpm_wgetch=`nm conftest$ac_exeext | egrep '\' | egrep '\<[vVwW]\>'` test -n "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=yes test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -f conftest* + rm -rf conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:4788: result: $cf_cv_check_gpm_wgetch" >&5 +echo "$as_me:5263: result: $cf_cv_check_gpm_wgetch" >&5 echo "${ECHO_T}$cf_cv_check_gpm_wgetch" >&6 if test "$cf_cv_check_gpm_wgetch" != yes ; then - { echo "$as_me:4792: WARNING: GPM library is already linked with curses - read the FAQ" >&5 + { echo "$as_me:5267: WARNING: GPM library is already linked with curses - read the FAQ" >&5 echo "$as_me: WARNING: GPM library is already linked with curses - read the FAQ" >&2;} fi @@ -4799,7 +5274,7 @@ fi # not everyone has "test -c" if test -c /dev/sysmouse 2>/dev/null ; then -echo "$as_me:4802: checking if you want to use sysmouse" >&5 +echo "$as_me:5277: checking if you want to use sysmouse" >&5 echo $ECHO_N "checking if you want to use sysmouse... $ECHO_C" >&6 # Check whether --with-sysmouse or --without-sysmouse was given. @@ -4811,7 +5286,7 @@ else fi; if test "$cf_with_sysmouse" != no ; then cat >conftest.$ac_ext <<_ACEOF -#line 4814 "configure" +#line 5289 "configure" #include "confdefs.h" #include @@ -4834,16 +5309,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5312: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4840: \$? = $ac_status" >&5 + echo "$as_me:5315: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4843: \"$ac_try\"") >&5 + { (eval echo "$as_me:5318: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4846: \$? = $ac_status" >&5 + echo "$as_me:5321: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_with_sysmouse=yes else @@ -4853,7 +5328,7 @@ cf_with_sysmouse=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4856: result: $cf_with_sysmouse" >&5 +echo "$as_me:5331: result: $cf_with_sysmouse" >&5 echo "${ECHO_T}$cf_with_sysmouse" >&6 test "$cf_with_sysmouse" = yes && cat >>confdefs.h <<\EOF #define USE_SYSMOUSE 1 @@ -4871,7 +5346,7 @@ if test X"$CXX_G_OPT" = X"" ; then test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' fi -echo "$as_me:4874: checking for default loader flags" >&5 +echo "$as_me:5349: checking for default loader flags" >&5 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) LD_MODEL='' ;; @@ -4880,26 +5355,26 @@ debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; shared) LD_MODEL='' ;; esac -echo "$as_me:4883: result: $LD_MODEL" >&5 +echo "$as_me:5358: result: $LD_MODEL" >&5 echo "${ECHO_T}$LD_MODEL" >&6 case $DFT_LWR_MODEL in shared) -echo "$as_me:4889: checking if rpath option should be used" >&5 +echo "$as_me:5364: checking if rpath option should be used" >&5 echo $ECHO_N "checking if rpath option should be used... $ECHO_C" >&6 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" - cf_cv_ld_rpath=$enableval + cf_cv_enable_rpath=$enableval else - cf_cv_ld_rpath=no + cf_cv_enable_rpath=no fi; -echo "$as_me:4899: result: $cf_cv_ld_rpath" >&5 -echo "${ECHO_T}$cf_cv_ld_rpath" >&6 +echo "$as_me:5374: result: $cf_cv_enable_rpath" >&5 +echo "${ECHO_T}$cf_cv_enable_rpath" >&6 -echo "$as_me:4902: checking if shared libraries should be relinked during install" >&5 +echo "$as_me:5377: checking if shared libraries should be relinked during install" >&5 echo $ECHO_N "checking if shared libraries should be relinked during install... $ECHO_C" >&6 # Check whether --enable-relink or --disable-relink was given. @@ -4909,19 +5384,100 @@ if test "${enable_relink+set}" = set; then else cf_cv_do_relink=yes fi; -echo "$as_me:4912: result: $cf_cv_do_relink" >&5 +echo "$as_me:5387: result: $cf_cv_do_relink" >&5 echo "${ECHO_T}$cf_cv_do_relink" >&6 ;; esac +LD_RPATH_OPT= +echo "$as_me:5393: 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 + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[2-9].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +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:5424: result: $LD_RPATH_OPT" >&5 +echo "${ECHO_T}$LD_RPATH_OPT" >&6 + +case "x$LD_RPATH_OPT" in #(vi +x-R*) + echo "$as_me:5429: 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" + LIBS="${LD_RPATH_OPT}$libdir $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 5434 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5446: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5449: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5452: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5455: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_space=no +else + echo "$as_me: failed program was:" >&5 +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:5465: result: $cf_rpath_space" >&5 +echo "${ECHO_T}$cf_rpath_space" >&6 + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; +esac + LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" - echo "$as_me:4924: checking if release/abi version should be used for shared libs" >&5 + echo "$as_me:5480: checking if release/abi version should be used for shared libs" >&5 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 # Check whether --with-shlib-version or --without-shlib-version was given. @@ -4936,7 +5492,7 @@ if test "${with_shlib_version+set}" = set; then cf_cv_shlib_version=$withval ;; *) - { { echo "$as_me:4939: error: option value must be one of: rel, abi, auto or no" >&5 + { { echo "$as_me:5495: error: option value must be one of: rel, abi, auto or no" >&5 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} { (exit 1); exit 1; }; } ;; @@ -4945,7 +5501,7 @@ echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} else cf_cv_shlib_version=auto fi; - echo "$as_me:4948: result: $cf_cv_shlib_version" >&5 + echo "$as_me:5504: result: $cf_cv_shlib_version" >&5 echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no @@ -4954,14 +5510,14 @@ echo "${ECHO_T}$cf_cv_shlib_version" >&6 CC_SHARED_OPTS= if test "$GCC" = yes then - echo "$as_me:4957: checking which $CC option to use" >&5 + echo "$as_me:5513: checking which $CC option to use" >&5 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat >conftest.$ac_ext <<_ACEOF -#line 4964 "configure" +#line 5520 "configure" #include "confdefs.h" #include int @@ -4973,16 +5529,16 @@ int x = 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4976: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5532: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4979: \$? = $ac_status" >&5 + echo "$as_me:5535: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4982: \"$ac_try\"") >&5 + { (eval echo "$as_me:5538: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4985: \$? = $ac_status" >&5 + echo "$as_me:5541: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -4991,18 +5547,24 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done - echo "$as_me:4994: result: $CC_SHARED_OPTS" >&5 + echo "$as_me:5550: result: $CC_SHARED_OPTS" >&5 echo "${ECHO_T}$CC_SHARED_OPTS" >&6 CFLAGS="$cf_save_CFLAGS" fi cf_cv_shlib_version_infix=no - case $cf_cv_system_name in - beos*) + case $cf_cv_system_name in #(vi + aix[56]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; - cygwin*) + cygwin*) #(vi CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}' cf_cv_shlib_version=cygdll @@ -5021,13 +5583,13 @@ EOF CF_EOF chmod +x mk_shared_lib.sh ;; - darwin*) + darwin*) #(vi EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes - echo "$as_me:5030: checking if ld -search_paths_first works" >&5 + echo "$as_me:5592: checking if ld -search_paths_first works" >&5 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5036,7 +5598,7 @@ else cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF -#line 5039 "configure" +#line 5601 "configure" #include "confdefs.h" int @@ -5048,16 +5610,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5051: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5613: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5054: \$? = $ac_status" >&5 + echo "$as_me:5616: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5057: \"$ac_try\"") >&5 + { (eval echo "$as_me:5619: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5060: \$? = $ac_status" >&5 + echo "$as_me:5622: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ldflags_search_paths_first=yes else @@ -5068,13 +5630,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS=$cf_save_LDFLAGS fi -echo "$as_me:5071: result: $cf_cv_ldflags_search_paths_first" >&5 +echo "$as_me:5633: result: $cf_cv_ldflags_search_paths_first" >&5 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) + hpux*) #(vi # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -5087,15 +5649,9 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - if test "$GCC" = yes; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" - else - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" - fi + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -5106,14 +5662,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) + linux*|gnu*|k*bsd*-gnu) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5125,14 +5680,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - openbsd[2-9].*) + openbsd[2-9].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" @@ -5143,20 +5697,19 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - nto-qnx*|openbsd*|freebsd[12].*) + nto-qnx*|openbsd*|freebsd[12].*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) + freebsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5166,15 +5719,14 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $@` -o $@' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@' ;; - netbsd*) + netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -5192,37 +5744,33 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@' else - MK_SHARED_LIB='${LD} -Bshareable -o $@' + MK_SHARED_LIB='${LD} -shared -Bshareable -o $@' fi ;; - osf*|mls+*) + osf*|mls+*) #(vi # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`' - case $host_os in + case $host_os in #(vi osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@' - if test "$cf_cv_ld_rpath" = yes ; then + if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -5230,7 +5778,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) + sunos4*) #(vi # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5238,16 +5786,15 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${LD} -assert pure-text -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) + solaris2*) #(vi # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5258,13 +5805,49 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi if test "$GCC" != yes; then - CC_SHARED_OPTS='-xcode=pic32' + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +#line 5813 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello\n"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5825: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5828: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5831: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5834: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@' fi ;; - sysv5uw7*|unix_sv*) + sysv5uw7*|unix_sv*) #(vi # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5281,11 +5864,11 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $@') + *'-o $@') #(vi test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) - { echo "$as_me:5288: WARNING: ignored --with-shlib-version" >&5 + { echo "$as_me:5871: WARNING: ignored --with-shlib-version" >&5 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac @@ -5293,62 +5876,278 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} esac if test -n "$cf_ld_rpath_opt" ; then - echo "$as_me:5296: 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" - LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" - cat >conftest.$ac_ext <<_ACEOF -#line 5301 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5313: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5316: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5319: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5322: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_rpath_space=no -else - echo "$as_me: failed program was:" >&5 -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:5332: result: $cf_rpath_space" >&5 -echo "${ECHO_T}$cf_rpath_space" >&6 - test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi if test "$CC_SHARED_OPTS" = "unknown"; then for model in $cf_list_models; do if test "$model" = "shared"; then - { { echo "$as_me:5341: error: Shared libraries are not supported in this version" >&5 + { { echo "$as_me:5885: error: Shared libraries are not supported in this version" >&5 echo "$as_me: error: Shared libraries are not supported in this version" >&2;} { (exit 1); exit 1; }; } fi done fi +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + +echo "$as_me:5895: 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 + cf_disable_rpath_hack=yes + else + cf_disable_rpath_hack=no + fi +else + enableval=yes + cf_disable_rpath_hack=no + +fi; +echo "$as_me:5912: 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:5916: 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:5919: 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:5926: 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 +else + if test -n "$cf_ldd_prog"; then + ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:5941: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +cf_ldd_prog=$ac_cv_prog_cf_ldd_prog +if test -n "$cf_ldd_prog"; then + echo "$as_me:5949: result: $cf_ldd_prog" >&5 +echo "${ECHO_T}$cf_ldd_prog" >&6 +else + echo "$as_me:5952: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$cf_ldd_prog" && break +done +test -n "$cf_ldd_prog" || cf_ldd_prog="no" + + cf_rpath_list="/usr/lib /lib" + if test "$cf_ldd_prog" != no + then + cf_rpath_oops= + +cat >conftest.$ac_ext <<_ACEOF +#line 5966 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5978: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5981: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5984: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5987: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` + cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u` +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + # If we passed the link-test, but get a "not found" on a given library, + # this could be due to inept reconfiguration of gcc to make it only + # partly honor /usr/local/lib (or whatever). Sometimes this behavior + # is intentional, e.g., installing gcc in /usr/bin and suppressing the + # /usr/local libraries. + if test -n "$cf_rpath_oops" + then + for cf_rpath_src in $cf_rpath_oops + do + for cf_rpath_dir in \ + /usr/local \ + /usr/pkg \ + /opt/sfw + do + if test -f $cf_rpath_dir/lib/$cf_rpath_src + then + test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 + +echo "${as_me:-configure}:6015: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 + + LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" + break + fi + done + done + fi + fi + + test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6027: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6031: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 + +cf_rpath_dst= +for cf_rpath_src in $LDFLAGS +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 + +echo "${as_me:-configure}:6068: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +LDFLAGS=$cf_rpath_dst + +test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6081: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 + +echo "${as_me:-configure}:6085: testing ...checking LIBS $LIBS ..." 1>&5 + +cf_rpath_dst= +for cf_rpath_src in $LIBS +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 + +echo "${as_me:-configure}:6122: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +LIBS=$cf_rpath_dst + +test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 + +echo "${as_me:-configure}:6135: testing ...checked LIBS $LIBS ..." 1>&5 + + test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6139: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +fi + +fi + +fi + ############################################################################### ### use option --disable-overwrite to leave out the link to -lcurses -echo "$as_me:5351: checking if you wish to install ncurses overwriting curses" >&5 +echo "$as_me:6150: checking if you wish to install ncurses overwriting curses" >&5 echo $ECHO_N "checking if you wish to install ncurses overwriting curses... $ECHO_C" >&6 # Check whether --enable-overwrite or --disable-overwrite was given. @@ -5358,10 +6157,10 @@ if test "${enable_overwrite+set}" = set; then else if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi fi; -echo "$as_me:5361: result: $with_overwrite" >&5 +echo "$as_me:6160: result: $with_overwrite" >&5 echo "${ECHO_T}$with_overwrite" >&6 -echo "$as_me:5364: checking if external terminfo-database is used" >&5 +echo "$as_me:6163: checking if external terminfo-database is used" >&5 echo $ECHO_N "checking if external terminfo-database is used... $ECHO_C" >&6 # Check whether --enable-database or --disable-database was given. @@ -5371,7 +6170,7 @@ if test "${enable_database+set}" = set; then else use_database=yes fi; -echo "$as_me:5374: result: $use_database" >&5 +echo "$as_me:6173: result: $use_database" >&5 echo "${ECHO_T}$use_database" >&6 case $host_os in #(vi @@ -5384,8 +6183,8 @@ os2*) #(vi esac case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; esac if test "$use_database" != no ; then @@ -5393,18 +6192,18 @@ if test "$use_database" != no ; then #define USE_DATABASE 1 EOF - echo "$as_me:5396: checking which terminfo source-file will be installed" >&5 + echo "$as_me:6195: checking which terminfo source-file will be installed" >&5 echo $ECHO_N "checking which terminfo source-file will be installed... $ECHO_C" >&6 -# Check whether --enable-database or --disable-database was given. -if test "${enable_database+set}" = set; then - enableval="$enable_database" +# Check whether --with-database or --without-database was given. +if test "${with_database+set}" = set; then + withval="$with_database" TERMINFO_SRC=$withval fi; - echo "$as_me:5404: result: $TERMINFO_SRC" >&5 + echo "$as_me:6203: result: $TERMINFO_SRC" >&5 echo "${ECHO_T}$TERMINFO_SRC" >&6 - echo "$as_me:5407: checking whether to use hashed database instead of directory/tree" >&5 + echo "$as_me:6206: checking whether to use hashed database instead of directory/tree" >&5 echo $ECHO_N "checking whether to use hashed database instead of directory/tree... $ECHO_C" >&6 # Check whether --with-hashed-db or --without-hashed-db was given. @@ -5414,13 +6213,13 @@ if test "${with_hashed_db+set}" = set; then else with_hashed_db=no fi; - echo "$as_me:5417: result: $with_hashed_db" >&5 + echo "$as_me:6216: result: $with_hashed_db" >&5 echo "${ECHO_T}$with_hashed_db" >&6 else with_hashed_db=no fi -echo "$as_me:5423: checking for list of fallback descriptions" >&5 +echo "$as_me:6222: checking for list of fallback descriptions" >&5 echo $ECHO_N "checking for list of fallback descriptions... $ECHO_C" >&6 # Check whether --with-fallbacks or --without-fallbacks was given. @@ -5430,11 +6229,11 @@ if test "${with_fallbacks+set}" = set; then else with_fallback= fi; -echo "$as_me:5433: result: $with_fallback" >&5 +echo "$as_me:6232: result: $with_fallback" >&5 echo "${ECHO_T}$with_fallback" >&6 FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'` -echo "$as_me:5437: checking if you want modern xterm or antique" >&5 +echo "$as_me:6236: checking if you want modern xterm or antique" >&5 echo $ECHO_N "checking if you want modern xterm or antique... $ECHO_C" >&6 # Check whether --with-xterm-new or --without-xterm-new was given. @@ -5448,7 +6247,7 @@ case $with_xterm_new in no) with_xterm_new=xterm-old;; *) with_xterm_new=xterm-new;; esac -echo "$as_me:5451: result: $with_xterm_new" >&5 +echo "$as_me:6250: result: $with_xterm_new" >&5 echo "${ECHO_T}$with_xterm_new" >&6 WHICH_XTERM=$with_xterm_new @@ -5458,7 +6257,7 @@ if test "$use_database" = no ; then MAKE_TERMINFO="#" else -echo "$as_me:5461: checking for list of terminfo directories" >&5 +echo "$as_me:6260: checking for list of terminfo directories" >&5 echo $ECHO_N "checking for list of terminfo directories... $ECHO_C" >&6 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given. @@ -5466,9 +6265,9 @@ if test "${with_terminfo_dirs+set}" = set; then withval="$with_terminfo_dirs" else - withval=${TERMINFO_DIRS-${datadir}/terminfo} + withval=${TERMINFO_DIRS:-${datadir}/terminfo} fi; -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5498,7 +6297,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5501: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:6300: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5511,13 +6310,13 @@ IFS="$ac_save_ifs" eval 'TERMINFO_DIRS="$cf_dst_path"' -echo "$as_me:5514: result: $TERMINFO_DIRS" >&5 +echo "$as_me:6313: result: $TERMINFO_DIRS" >&5 echo "${ECHO_T}$TERMINFO_DIRS" >&6 test -n "$TERMINFO_DIRS" && cat >>confdefs.h <&5 +echo "$as_me:6319: checking for default terminfo directory" >&5 echo $ECHO_N "checking for default terminfo directory... $ECHO_C" >&6 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given. @@ -5525,7 +6324,7 @@ if test "${with_default_terminfo_dir+set}" = set; then withval="$with_default_terminfo_dir" else - withval="${TERMINFO-${datadir}/terminfo}" + withval="${TERMINFO:-${datadir}/terminfo}" fi; if test -n "${datadir}/terminfo" ; then if test "x$prefix" != xNONE; then @@ -5553,7 +6352,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5556: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:6355: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5562,7 +6361,7 @@ esac fi TERMINFO="$withval" -echo "$as_me:5565: result: $TERMINFO" >&5 +echo "$as_me:6364: result: $TERMINFO" >&5 echo "${ECHO_T}$TERMINFO" >&6 cat >>confdefs.h <&5 +echo "$as_me:6374: checking if big-core option selected" >&5 echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6 # Check whether --enable-big-core or --disable-big-core was given. @@ -5584,7 +6383,7 @@ else with_big_core=no else cat >conftest.$ac_ext <<_ACEOF -#line 5587 "configure" +#line 6386 "configure" #include "confdefs.h" #include @@ -5598,15 +6397,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:5601: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6400: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5604: \$? = $ac_status" >&5 + echo "$as_me:6403: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5606: \"$ac_try\"") >&5 + { (eval echo "$as_me:6405: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5609: \$? = $ac_status" >&5 + echo "$as_me:6408: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_big_core=yes else @@ -5618,7 +6417,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi; -echo "$as_me:5621: result: $with_big_core" >&5 +echo "$as_me:6420: result: $with_big_core" >&5 echo "${ECHO_T}$with_big_core" >&6 test "$with_big_core" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_BIG_CORE 1 @@ -5627,7 +6426,7 @@ EOF ### ISO C only guarantees 512-char strings, we have tables which load faster ### when constructed using "big" strings. More than the C compiler, the awk ### program is a limit on most vendor UNIX systems. Check that we can build. -echo "$as_me:5630: checking if big-strings option selected" >&5 +echo "$as_me:6429: checking if big-strings option selected" >&5 echo $ECHO_N "checking if big-strings option selected... $ECHO_C" >&6 # Check whether --enable-big-strings or --disable-big-strings was given. @@ -5636,29 +6435,29 @@ if test "${enable_big_strings+set}" = set; then with_big_strings=$enableval else - case x$AWK in #(vi - x) - eval with_big_strings=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval with_big_strings=yes - else - eval with_big_strings=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval with_big_strings=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval with_big_strings=yes + else + eval with_big_strings=no + fi + ;; + esac fi; -echo "$as_me:5654: result: $with_big_strings" >&5 +echo "$as_me:6453: result: $with_big_strings" >&5 echo "${ECHO_T}$with_big_strings" >&6 USE_BIG_STRINGS=0 test "$with_big_strings" = "yes" && USE_BIG_STRINGS=1 ### use option --enable-termcap to compile in the termcap fallback support -echo "$as_me:5661: checking if you want termcap-fallback support" >&5 +echo "$as_me:6460: checking if you want termcap-fallback support" >&5 echo $ECHO_N "checking if you want termcap-fallback support... $ECHO_C" >&6 # Check whether --enable-termcap or --disable-termcap was given. @@ -5668,13 +6467,13 @@ if test "${enable_termcap+set}" = set; then else with_termcap=no fi; -echo "$as_me:5671: result: $with_termcap" >&5 +echo "$as_me:6470: result: $with_termcap" >&5 echo "${ECHO_T}$with_termcap" >&6 if test "$with_termcap" != "yes" ; then if test "$use_database" = no ; then if test -z "$with_fallback" ; then - { { echo "$as_me:5677: error: You have disabled the database w/o specifying fallbacks" >&5 + { { echo "$as_me:6476: error: You have disabled the database w/o specifying fallbacks" >&5 echo "$as_me: error: You have disabled the database w/o specifying fallbacks" >&2;} { (exit 1); exit 1; }; } fi @@ -5686,7 +6485,7 @@ EOF else if test "$with_ticlib" != no ; then - { { echo "$as_me:5689: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 + { { echo "$as_me:6488: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 echo "$as_me: error: Options --with-ticlib and --enable-termcap cannot be combined" >&2;} { (exit 1); exit 1; }; } fi @@ -5695,7 +6494,7 @@ cat >>confdefs.h <<\EOF #define USE_TERMCAP 1 EOF -echo "$as_me:5698: checking for list of termcap files" >&5 +echo "$as_me:6497: checking for list of termcap files" >&5 echo $ECHO_N "checking for list of termcap files... $ECHO_C" >&6 # Check whether --with-termpath or --without-termpath was given. @@ -5703,9 +6502,9 @@ if test "${with_termpath+set}" = set; then withval="$with_termpath" else - withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} + withval=${TERMPATH:-/etc/termcap:/usr/share/misc/termcap} fi; -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5735,7 +6534,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5738: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:6537: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5748,14 +6547,14 @@ IFS="$ac_save_ifs" eval 'TERMPATH="$cf_dst_path"' -echo "$as_me:5751: result: $TERMPATH" >&5 +echo "$as_me:6550: result: $TERMPATH" >&5 echo "${ECHO_T}$TERMPATH" >&6 test -n "$TERMPATH" && cat >>confdefs.h <&5 +echo "$as_me:6557: checking if fast termcap-loader is needed" >&5 echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6 # Check whether --enable-getcap or --disable-getcap was given. @@ -5765,13 +6564,13 @@ if test "${enable_getcap+set}" = set; then else with_getcap=no fi; -echo "$as_me:5768: result: $with_getcap" >&5 +echo "$as_me:6567: result: $with_getcap" >&5 echo "${ECHO_T}$with_getcap" >&6 test "$with_getcap" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP 1 EOF -echo "$as_me:5774: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "$as_me:6573: checking if translated termcaps will be cached in ~/.terminfo" >&5 echo $ECHO_N "checking if translated termcaps will be cached in ~/.terminfo... $ECHO_C" >&6 # Check whether --enable-getcap-cache or --disable-getcap-cache was given. @@ -5781,7 +6580,7 @@ if test "${enable_getcap_cache+set}" = set; then else with_getcap_cache=no fi; -echo "$as_me:5784: result: $with_getcap_cache" >&5 +echo "$as_me:6583: result: $with_getcap_cache" >&5 echo "${ECHO_T}$with_getcap_cache" >&6 test "$with_getcap_cache" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP_CACHE 1 @@ -5790,7 +6589,7 @@ EOF fi ### Use option --disable-home-terminfo to completely remove ~/.terminfo -echo "$as_me:5793: checking if ~/.terminfo is wanted" >&5 +echo "$as_me:6592: checking if ~/.terminfo is wanted" >&5 echo $ECHO_N "checking if ~/.terminfo is wanted... $ECHO_C" >&6 # Check whether --enable-home-terminfo or --disable-home-terminfo was given. @@ -5800,13 +6599,13 @@ if test "${enable_home_terminfo+set}" = set; then else with_home_terminfo=yes fi; -echo "$as_me:5803: result: $with_home_terminfo" >&5 +echo "$as_me:6602: result: $with_home_terminfo" >&5 echo "${ECHO_T}$with_home_terminfo" >&6 test "$with_home_terminfo" = "yes" && cat >>confdefs.h <<\EOF #define USE_HOME_TERMINFO 1 EOF -echo "$as_me:5809: checking if you want to use restricted environment when running as root" >&5 +echo "$as_me:6608: checking if you want to use restricted environment when running as root" >&5 echo $ECHO_N "checking if you want to use restricted environment when running as root... $ECHO_C" >&6 # Check whether --enable-root-environ or --disable-root-environ was given. @@ -5816,7 +6615,7 @@ if test "${enable_root_environ+set}" = set; then else with_root_environ=yes fi; -echo "$as_me:5819: result: $with_root_environ" >&5 +echo "$as_me:6618: result: $with_root_environ" >&5 echo "${ECHO_T}$with_root_environ" >&6 test "$with_root_environ" = yes && cat >>confdefs.h <<\EOF #define USE_ROOT_ENVIRON 1 @@ -5830,13 +6629,13 @@ for ac_func in \ unlink do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:5833: checking for $ac_func" >&5 +echo "$as_me:6632: 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 5839 "configure" +#line 6638 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -5867,16 +6666,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5870: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6669: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5873: \$? = $ac_status" >&5 + echo "$as_me:6672: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5876: \"$ac_try\"") >&5 + { (eval echo "$as_me:6675: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5879: \$? = $ac_status" >&5 + echo "$as_me:6678: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -5886,7 +6685,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5889: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6688: 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 <&5 +echo "$as_me:6705: 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 5912 "configure" +#line 6711 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -5940,16 +6739,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5943: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6742: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5946: \$? = $ac_status" >&5 + echo "$as_me:6745: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5949: \"$ac_try\"") >&5 + { (eval echo "$as_me:6748: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5952: \$? = $ac_status" >&5 + echo "$as_me:6751: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -5959,7 +6758,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5962: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6761: 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 <&5 + echo "$as_me:6772: checking if link/symlink functions work" >&5 echo $ECHO_N "checking if link/symlink functions work... $ECHO_C" >&6 if test "${cf_cv_link_funcs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5983,7 +6782,7 @@ else eval 'ac_cv_func_'$cf_func'=error' else cat >conftest.$ac_ext <<_ACEOF -#line 5986 "configure" +#line 6785 "configure" #include "confdefs.h" #include @@ -6013,15 +6812,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:6016: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6019: \$? = $ac_status" >&5 + echo "$as_me:6818: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6021: \"$ac_try\"") >&5 + { (eval echo "$as_me:6820: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6024: \$? = $ac_status" >&5 + echo "$as_me:6823: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" @@ -6039,7 +6838,7 @@ fi test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no fi -echo "$as_me:6042: result: $cf_cv_link_funcs" >&5 +echo "$as_me:6841: result: $cf_cv_link_funcs" >&5 echo "${ECHO_T}$cf_cv_link_funcs" >&6 test "$ac_cv_func_link" = yes && cat >>confdefs.h <<\EOF #define HAVE_LINK 1 @@ -6057,7 +6856,7 @@ with_symlinks=no # soft links (symbolic links) are useful for some systems where hard links do # not work, or to make it simpler to copy terminfo trees around. if test "$ac_cv_func_symlink" = yes ; then - echo "$as_me:6060: checking if tic should use symbolic links" >&5 + echo "$as_me:6859: checking if tic should use symbolic links" >&5 echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 # Check whether --enable-symlinks or --disable-symlinks was given. @@ -6067,21 +6866,21 @@ if test "${enable_symlinks+set}" = set; then else with_symlinks=no fi; - echo "$as_me:6070: result: $with_symlinks" >&5 + echo "$as_me:6869: result: $with_symlinks" >&5 echo "${ECHO_T}$with_symlinks" >&6 fi # If we have hard links and did not choose to use soft links instead, there is # no reason to make this choice optional - use the hard links. if test "$with_symlinks" = no ; then - echo "$as_me:6077: checking if tic should use hard links" >&5 + echo "$as_me:6876: checking if tic should use hard links" >&5 echo $ECHO_N "checking if tic should use hard links... $ECHO_C" >&6 if test "$ac_cv_func_link" = yes ; then with_links=yes else with_links=no fi - echo "$as_me:6084: result: $with_links" >&5 + echo "$as_me:6883: result: $with_links" >&5 echo "${ECHO_T}$with_links" >&6 fi @@ -6094,7 +6893,7 @@ test "$with_symlinks" = yes && cat >>confdefs.h <<\EOF EOF ### use option --enable-broken-linker to force on use of broken-linker support -echo "$as_me:6097: checking if you want broken-linker support code" >&5 +echo "$as_me:6896: checking if you want broken-linker support code" >&5 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. @@ -6102,9 +6901,9 @@ if test "${enable_broken_linker+set}" = set; then enableval="$enable_broken_linker" with_broken_linker=$enableval else - with_broken_linker=${BROKEN_LINKER-no} + with_broken_linker=${BROKEN_LINKER:-no} fi; -echo "$as_me:6107: result: $with_broken_linker" >&5 +echo "$as_me:6906: result: $with_broken_linker" >&5 echo "${ECHO_T}$with_broken_linker" >&6 BROKEN_LINKER=0 @@ -6124,14 +6923,14 @@ EOF BROKEN_LINKER=1 test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 -echo "${as_me-configure}:6127: testing cygwin linker is broken anyway ..." 1>&5 +echo "${as_me:-configure}:6926: testing cygwin linker is broken anyway ..." 1>&5 ;; esac fi ### use option --enable-bsdpad to have tputs process BSD-style prefix padding -echo "$as_me:6134: checking if tputs should process BSD-style prefix padding" >&5 +echo "$as_me:6933: checking if tputs should process BSD-style prefix padding" >&5 echo $ECHO_N "checking if tputs should process BSD-style prefix padding... $ECHO_C" >&6 # Check whether --enable-bsdpad or --disable-bsdpad was given. @@ -6141,7 +6940,7 @@ if test "${enable_bsdpad+set}" = set; then else with_bsdpad=no fi; -echo "$as_me:6144: result: $with_bsdpad" >&5 +echo "$as_me:6943: result: $with_bsdpad" >&5 echo "${ECHO_T}$with_bsdpad" >&6 test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF #define BSD_TPUTS 1 @@ -6158,66 +6957,22 @@ NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -echo "$as_me:6161: checking if $CC -U and -D options work together" >&5 -echo $ECHO_N "checking if $CC -U and -D options work together... $ECHO_C" >&6 -if test "${cf_cv_cc_u_d_options+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" - cat >conftest.$ac_ext <<_ACEOF -#line 6170 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifndef U_D_OPTIONS -make an undefined-error -#endif -#ifdef D_U_OPTIONS -make a defined-error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6189: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6192: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6195: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6198: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_cc_u_d_options=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cf_cv_cc_u_d_options=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save_CPPFLAGS" - -fi -echo "$as_me:6212: result: $cf_cv_cc_u_d_options" >&5 -echo "${ECHO_T}$cf_cv_cc_u_d_options" >&6 - cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L +cf_xopen_source= case $host_os in #(vi -aix[45]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" +aix[456]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; +darwin[0-8].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -6225,24 +6980,27 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[56].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; -linux*|gnu*|k*bsd*-gnu) #(vi +linux*|gnu*|mint*|k*bsd*-gnu) #(vi -echo "$as_me:6238: checking if we must define _GNU_SOURCE" >&5 +echo "$as_me:6996: 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 6245 "configure" +#line 7003 "configure" #include "confdefs.h" #include int @@ -6257,16 +7015,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6260: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7018: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6263: \$? = $ac_status" >&5 + echo "$as_me:7021: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6266: \"$ac_try\"") >&5 + { (eval echo "$as_me:7024: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6269: \$? = $ac_status" >&5 + echo "$as_me:7027: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -6275,7 +7033,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 6278 "configure" +#line 7036 "configure" #include "confdefs.h" #include int @@ -6290,16 +7048,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6293: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7051: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6296: \$? = $ac_status" >&5 + echo "$as_me:7054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6299: \"$ac_try\"") >&5 + { (eval echo "$as_me:7057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6302: \$? = $ac_status" >&5 + echo "$as_me:7060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -6314,7 +7072,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6317: result: $cf_cv_gnu_source" >&5 +echo "$as_me:7075: 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" @@ -6329,26 +7087,29 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[45]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" +solaris2.1[0-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[1-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__" ;; *) - echo "$as_me:6344: checking if we should define _XOPEN_SOURCE" >&5 + echo "$as_me:7105: 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 6351 "configure" +#line 7112 "configure" #include "confdefs.h" #include int @@ -6363,16 +7124,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6366: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7127: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6369: \$? = $ac_status" >&5 + echo "$as_me:7130: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6372: \"$ac_try\"") >&5 + { (eval echo "$as_me:7133: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6375: \$? = $ac_status" >&5 + echo "$as_me:7136: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -6381,7 +7142,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 6384 "configure" +#line 7145 "configure" #include "confdefs.h" #include int @@ -6396,16 +7157,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6399: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7160: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6402: \$? = $ac_status" >&5 + echo "$as_me:7163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6405: \"$ac_try\"") >&5 + { (eval echo "$as_me:7166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6408: \$? = $ac_status" >&5 + echo "$as_me:7169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -6420,23 +7181,98 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6423: result: $cf_cv_xopen_source" >&5 +echo "$as_me:7184: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then -# remove _XOPEN_SOURCE symbol from $CFLAGS CFLAGS=`echo "$CFLAGS" | \ - sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` -# remove _XOPEN_SOURCE symbol from $CPPFLAGS CPPFLAGS=`echo "$CPPFLAGS" | \ - sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" fi cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE @@ -6444,26 +7280,24 @@ cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" -# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ - sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ - sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:6457: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:7291: 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}:6463: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:7297: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 6466 "configure" +#line 7300 "configure" #include "confdefs.h" #include int @@ -6478,16 +7312,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6481: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7315: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6484: \$? = $ac_status" >&5 + echo "$as_me:7318: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6487: \"$ac_try\"") >&5 + { (eval echo "$as_me:7321: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6490: \$? = $ac_status" >&5 + echo "$as_me:7324: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -6508,7 +7342,7 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 6511 "configure" +#line 7345 "configure" #include "confdefs.h" #include int @@ -6523,16 +7357,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6526: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7360: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6529: \$? = $ac_status" >&5 + echo "$as_me:7363: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6532: \"$ac_try\"") >&5 + { (eval echo "$as_me:7366: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6535: \$? = $ac_status" >&5 + echo "$as_me:7369: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6543,15 +7377,15 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me-configure}:6546: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:7380: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "${as_me-configure}:6551: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:7385: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 6554 "configure" +#line 7388 "configure" #include "confdefs.h" #include int @@ -6566,16 +7400,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6569: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7403: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6572: \$? = $ac_status" >&5 + echo "$as_me:7406: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6575: \"$ac_try\"") >&5 + { (eval echo "$as_me:7409: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6578: \$? = $ac_status" >&5 + echo "$as_me:7412: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6591,33 +7425,188 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6594: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:7428: 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 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[^ ]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + fi ;; esac +if test -n "$cf_xopen_source" ; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + # Work around breakage on OS X -echo "$as_me:6613: checking if SIGWINCH is defined" >&5 +echo "$as_me:7602: 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 6620 "configure" +#line 7609 "configure" #include "confdefs.h" #include @@ -6632,23 +7621,23 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6635: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7624: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6638: \$? = $ac_status" >&5 + echo "$as_me:7627: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6641: \"$ac_try\"") >&5 + { (eval echo "$as_me:7630: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6644: \$? = $ac_status" >&5 + echo "$as_me:7633: \$? = $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 6651 "configure" +#line 7640 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -6666,16 +7655,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6669: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7658: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6672: \$? = $ac_status" >&5 + echo "$as_me:7661: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6675: \"$ac_try\"") >&5 + { (eval echo "$as_me:7664: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6678: \$? = $ac_status" >&5 + echo "$as_me:7667: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_define_sigwinch=maybe else @@ -6689,11 +7678,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6692: result: $cf_cv_define_sigwinch" >&5 +echo "$as_me:7681: 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:6696: checking for actual SIGWINCH definition" >&5 +echo "$as_me:7685: 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 @@ -6704,7 +7693,7 @@ cf_sigwinch=32 while test $cf_sigwinch != 1 do cat >conftest.$ac_ext <<_ACEOF -#line 6707 "configure" +#line 7696 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -6726,16 +7715,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6729: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7718: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6732: \$? = $ac_status" >&5 + echo "$as_me:7721: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6735: \"$ac_try\"") >&5 + { (eval echo "$as_me:7724: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6738: \$? = $ac_status" >&5 + echo "$as_me:7727: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_fixup_sigwinch=$cf_sigwinch break @@ -6749,7 +7738,7 @@ cf_sigwinch=`expr $cf_sigwinch - 1` done fi -echo "$as_me:6752: result: $cf_cv_fixup_sigwinch" >&5 +echo "$as_me:7741: result: $cf_cv_fixup_sigwinch" >&5 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6 if test "$cf_cv_fixup_sigwinch" != unknown ; then @@ -6759,13 +7748,13 @@ fi # Checks for CODESET support. - echo "$as_me:6762: checking for nl_langinfo and CODESET" >&5 + echo "$as_me:7751: 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 6768 "configure" +#line 7757 "configure" #include "confdefs.h" #include int @@ -6777,16 +7766,16 @@ char* cs = nl_langinfo(CODESET); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6780: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7769: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6783: \$? = $ac_status" >&5 + echo "$as_me:7772: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6786: \"$ac_try\"") >&5 + { (eval echo "$as_me:7775: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6789: \$? = $ac_status" >&5 + echo "$as_me:7778: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else @@ -6797,7 +7786,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6800: result: $am_cv_langinfo_codeset" >&5 +echo "$as_me:7789: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then @@ -6811,7 +7800,7 @@ EOF NCURSES_OK_WCHAR_T= NCURSES_OK_WINT_T= -echo "$as_me:6814: checking if you want wide-character code" >&5 +echo "$as_me:7803: checking if you want wide-character code" >&5 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. @@ -6821,7 +7810,7 @@ if test "${enable_widec+set}" = set; then else with_widec=no fi; -echo "$as_me:6824: result: $with_widec" >&5 +echo "$as_me:7813: result: $with_widec" >&5 echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" @@ -6829,10 +7818,15 @@ if test "$with_widec" = yes ; then #define USE_WIDEC_SUPPORT 1 EOF -echo "$as_me:6832: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 + case "$CFLAGS $CPPFLAGS" in #(vi + *-D_XOPEN_SOURCE=500) #(vi + ;; + *) + +echo "$as_me:7826: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 6835 "configure" +#line 7829 "configure" #include "confdefs.h" #include @@ -6848,16 +7842,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6851: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7845: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6854: \$? = $ac_status" >&5 + echo "$as_me:7848: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6857: \"$ac_try\"") >&5 + { (eval echo "$as_me:7851: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6860: \$? = $ac_status" >&5 + echo "$as_me:7854: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=no else @@ -6866,16 +7860,16 @@ cat conftest.$ac_ext >&5 cf_result=yes fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:6869: result: $cf_result" >&5 +echo "$as_me:7863: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" elif test "x" != "x" ; then - echo "$as_me:6875: checking checking for compatible value versus " >&5 + echo "$as_me:7869: checking checking for compatible value versus " >&5 echo $ECHO_N "checking checking for compatible value versus ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 6878 "configure" +#line 7872 "configure" #include "confdefs.h" #include @@ -6891,16 +7885,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6894: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7888: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6897: \$? = $ac_status" >&5 + echo "$as_me:7891: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6900: \"$ac_try\"") >&5 + { (eval echo "$as_me:7894: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6903: \$? = $ac_status" >&5 + echo "$as_me:7897: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes else @@ -6909,7 +7903,7 @@ cat conftest.$ac_ext >&5 cf_result=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:6912: result: $cf_result" >&5 + echo "$as_me:7906: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = no ; then # perhaps we can override it - try... @@ -6917,19 +7911,22 @@ echo "${ECHO_T}$cf_result" >&6 fi fi + ;; + esac + # with_overwrite=no NCURSES_CH_T=cchar_t for ac_func in putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:6926: checking for $ac_func" >&5 +echo "$as_me:7923: 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 6932 "configure" +#line 7929 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -6960,16 +7957,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6963: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7960: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6966: \$? = $ac_status" >&5 + echo "$as_me:7963: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6969: \"$ac_try\"") >&5 + { (eval echo "$as_me:7966: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6972: \$? = $ac_status" >&5 + echo "$as_me:7969: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -6979,7 +7976,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6982: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:7979: 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 <&5 +echo "$as_me:7991: 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 @@ -6999,7 +7996,7 @@ else cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7002 "configure" +#line 7999 "configure" #include "confdefs.h" #include @@ -7012,16 +8009,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7015: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8012: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7018: \$? = $ac_status" >&5 + echo "$as_me:8015: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7021: \"$ac_try\"") >&5 + { (eval echo "$as_me:8018: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7024: \$? = $ac_status" >&5 + echo "$as_me:8021: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_utf8_lib=yes else @@ -7033,10 +8030,12 @@ cat conftest.$ac_ext >&5 cf_cv_header_path_utf8= cf_cv_library_path_utf8= -echo "${as_me-configure}:7036: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:8033: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 + +cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7039 "configure" +#line 8038 "configure" #include "confdefs.h" #include @@ -7049,34 +8048,110 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7052: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8051: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7055: \$? = $ac_status" >&5 + echo "$as_me:8054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7058: \"$ac_try\"") >&5 + { (eval echo "$as_me:8057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7061: \$? = $ac_status" >&5 + echo "$as_me:8060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cf_cv_find_linkage_utf8=yes + + 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 - cf_cv_find_linkage_utf8=no +LIBS="-lutf8 $cf_save_LIBS" -echo "${as_me-configure}:7070: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 +cat >conftest.$ac_ext <<_ACEOF +#line 8074 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8087: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8090: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8093: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8096: \$? = $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}:8113: testing find linkage for utf8 library ..." 1>&5 + +echo "${as_me:-configure}:8115: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" - cf_search="" +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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /usr" test -d /usr/include && cf_search="$cf_search /usr/include" test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" @@ -7098,7 +8173,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr/local" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /usr/local" test -d /usr/local/include && cf_search="$cf_search /usr/local/include" test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" @@ -7109,7 +8184,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/opt" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /opt" test -d /opt/include && cf_search="$cf_search /opt/include" test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" @@ -7120,7 +8195,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "$HOME" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $HOME" test -d $HOME/include && cf_search="$cf_search $HOME/include" test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" @@ -7143,16 +8218,18 @@ test -d "$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}:7151: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8228: 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 7155 "configure" +#line 8232 "configure" #include "confdefs.h" #include @@ -7165,21 +8242,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7168: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8245: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7171: \$? = $ac_status" >&5 + echo "$as_me:8248: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7174: \"$ac_try\"") >&5 + { (eval echo "$as_me:8251: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7177: \$? = $ac_status" >&5 + echo "$as_me:8254: \$? = $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}:7182: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8259: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=maybe cf_test_CPPFLAGS="$CPPFLAGS" @@ -7197,17 +8274,44 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_find_linkage_utf8" = maybe ; then -echo "${as_me-configure}:7200: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:8277: 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_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$,,'` + +test "$cf_library_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /usr" test -d /usr/lib && cf_search="$cf_search /usr/lib" test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" @@ -7229,7 +8333,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr/local" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" @@ -7240,7 +8344,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/opt" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /opt" test -d /opt/lib && cf_search="$cf_search /opt/lib" test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" @@ -7251,7 +8355,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "$HOME" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $HOME" test -d $HOME/lib && cf_search="$cf_search $HOME/lib" test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" @@ -7260,18 +8364,20 @@ test -d "$HOME" && \ test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" } +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}:7268: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8374: 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 7274 "configure" +#line 8380 "configure" #include "confdefs.h" #include @@ -7284,21 +8390,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7287: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8393: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7290: \$? = $ac_status" >&5 + echo "$as_me:8396: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7293: \"$ac_try\"") >&5 + { (eval echo "$as_me:8399: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7296: \$? = $ac_status" >&5 + echo "$as_me:8402: \$? = $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}:7301: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8407: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" @@ -7315,7 +8421,6 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done - LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -7327,6 +8432,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext 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 @@ -7336,7 +8446,7 @@ fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:7339: result: $cf_cv_utf8_lib" >&5 +echo "$as_me:8449: 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 @@ -7364,13 +8474,13 @@ if test -n "$cf_cv_header_path_utf8" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; 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 7373 "configure" +#line 8483 "configure" #include "confdefs.h" #include int @@ -7382,16 +8492,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7385: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8495: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7388: \$? = $ac_status" >&5 + echo "$as_me:8498: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7391: \"$ac_try\"") >&5 + { (eval echo "$as_me:8501: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7394: \$? = $ac_status" >&5 + echo "$as_me:8504: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -7408,13 +8518,13 @@ 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}:7411: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:8521: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + 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" + 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 @@ -7442,7 +8552,7 @@ if test -n "$cf_cv_library_path_utf8" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:8555: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -7450,7 +8560,7 @@ echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ... done fi - LIBS="-lutf8 $LIBS" + LIBS="$cf_cv_library_file_utf8 $LIBS" fi if test "$cf_cv_utf8_lib" != no ; then @@ -7459,14 +8569,14 @@ fi fi # This is needed on Tru64 5.0 to declare mbstate_t -echo "$as_me:7462: checking if we must include wchar.h to declare mbstate_t" >&5 +echo "$as_me:8572: 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 7469 "configure" +#line 8579 "configure" #include "confdefs.h" #include @@ -7484,23 +8594,23 @@ mbstate_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7487: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8597: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7490: \$? = $ac_status" >&5 + echo "$as_me:8600: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7493: \"$ac_try\"") >&5 + { (eval echo "$as_me:8603: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7496: \$? = $ac_status" >&5 + echo "$as_me:8606: \$? = $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 7503 "configure" +#line 8613 "configure" #include "confdefs.h" #include @@ -7519,16 +8629,16 @@ mbstate_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7522: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8632: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7525: \$? = $ac_status" >&5 + echo "$as_me:8635: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7528: \"$ac_try\"") >&5 + { (eval echo "$as_me:8638: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7531: \$? = $ac_status" >&5 + echo "$as_me:8641: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_mbstate_t=yes else @@ -7540,7 +8650,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7543: result: $cf_cv_mbstate_t" >&5 +echo "$as_me:8653: result: $cf_cv_mbstate_t" >&5 echo "${ECHO_T}$cf_cv_mbstate_t" >&6 if test "$cf_cv_mbstate_t" = yes ; then @@ -7557,14 +8667,14 @@ if test "$cf_cv_mbstate_t" = unknown ; then fi # This is needed on Tru64 5.0 to declare wchar_t -echo "$as_me:7560: checking if we must include wchar.h to declare wchar_t" >&5 +echo "$as_me:8670: 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 7567 "configure" +#line 8677 "configure" #include "confdefs.h" #include @@ -7582,23 +8692,23 @@ wchar_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7585: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8695: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7588: \$? = $ac_status" >&5 + echo "$as_me:8698: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7591: \"$ac_try\"") >&5 + { (eval echo "$as_me:8701: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7594: \$? = $ac_status" >&5 + echo "$as_me:8704: \$? = $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 7601 "configure" +#line 8711 "configure" #include "confdefs.h" #include @@ -7617,16 +8727,16 @@ wchar_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7620: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8730: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7623: \$? = $ac_status" >&5 + echo "$as_me:8733: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7626: \"$ac_try\"") >&5 + { (eval echo "$as_me:8736: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7629: \$? = $ac_status" >&5 + echo "$as_me:8739: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wchar_t=yes else @@ -7638,7 +8748,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7641: result: $cf_cv_wchar_t" >&5 +echo "$as_me:8751: result: $cf_cv_wchar_t" >&5 echo "${ECHO_T}$cf_cv_wchar_t" >&6 if test "$cf_cv_wchar_t" = yes ; then @@ -7660,14 +8770,14 @@ if test "$cf_cv_wchar_t" != unknown ; then fi # This is needed on Tru64 5.0 to declare wint_t -echo "$as_me:7663: checking if we must include wchar.h to declare wint_t" >&5 +echo "$as_me:8773: 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 7670 "configure" +#line 8780 "configure" #include "confdefs.h" #include @@ -7685,23 +8795,23 @@ wint_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7688: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8798: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7691: \$? = $ac_status" >&5 + echo "$as_me:8801: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7694: \"$ac_try\"") >&5 + { (eval echo "$as_me:8804: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7697: \$? = $ac_status" >&5 + echo "$as_me:8807: \$? = $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 7704 "configure" +#line 8814 "configure" #include "confdefs.h" #include @@ -7720,16 +8830,16 @@ wint_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7723: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7726: \$? = $ac_status" >&5 + echo "$as_me:8836: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7729: \"$ac_try\"") >&5 + { (eval echo "$as_me:8839: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7732: \$? = $ac_status" >&5 + echo "$as_me:8842: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wint_t=yes else @@ -7741,7 +8851,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7744: result: $cf_cv_wint_t" >&5 +echo "$as_me:8854: result: $cf_cv_wint_t" >&5 echo "${ECHO_T}$cf_cv_wint_t" >&6 if test "$cf_cv_wint_t" = yes ; then @@ -7780,7 +8890,7 @@ case $cf_cv_abi_version in ;; esac -echo "$as_me:7783: checking whether to enable _LP64 definition in curses.h" >&5 +echo "$as_me:8893: checking whether to enable _LP64 definition in curses.h" >&5 echo $ECHO_N "checking whether to enable _LP64 definition in curses.h... $ECHO_C" >&6 # Check whether --enable-lp64 or --disable-lp64 was given. @@ -7790,7 +8900,7 @@ if test "${enable_lp64+set}" = set; then else with_lp64=$default_with_lp64 fi; -echo "$as_me:7793: result: $with_lp64" >&5 +echo "$as_me:8903: result: $with_lp64" >&5 echo "${ECHO_T}$with_lp64" >&6 if test "$with_lp64" = yes ; then @@ -7806,7 +8916,7 @@ if test "${enable_largefile+set}" = set; then fi; if test "$enable_largefile" != no; then - echo "$as_me:7809: checking for special C compiler options needed for large files" >&5 + echo "$as_me:8919: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7818,7 +8928,7 @@ else # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF -#line 7821 "configure" +#line 8931 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7838,16 +8948,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7841: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8951: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7844: \$? = $ac_status" >&5 + echo "$as_me:8954: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7847: \"$ac_try\"") >&5 + { (eval echo "$as_me:8957: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7850: \$? = $ac_status" >&5 + echo "$as_me:8960: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7857,16 +8967,16 @@ fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext -if { (eval echo "$as_me:7860: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8970: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7863: \$? = $ac_status" >&5 + echo "$as_me:8973: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7866: \"$ac_try\"") >&5 + { (eval echo "$as_me:8976: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7869: \$? = $ac_status" >&5 + echo "$as_me:8979: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else @@ -7880,13 +8990,13 @@ rm -f conftest.$ac_objext rm -f conftest.$ac_ext fi fi -echo "$as_me:7883: result: $ac_cv_sys_largefile_CC" >&5 +echo "$as_me:8993: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:7889: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + echo "$as_me:8999: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7894,7 +9004,7 @@ else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF -#line 7897 "configure" +#line 9007 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7914,16 +9024,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7917: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9027: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7920: \$? = $ac_status" >&5 + echo "$as_me:9030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7923: \"$ac_try\"") >&5 + { (eval echo "$as_me:9033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7926: \$? = $ac_status" >&5 + echo "$as_me:9036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7932,7 +9042,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 7935 "configure" +#line 9045 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include @@ -7953,16 +9063,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9066: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7959: \$? = $ac_status" >&5 + echo "$as_me:9069: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7962: \"$ac_try\"") >&5 + { (eval echo "$as_me:9072: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7965: \$? = $ac_status" >&5 + echo "$as_me:9075: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else @@ -7973,7 +9083,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:7976: result: $ac_cv_sys_file_offset_bits" >&5 +echo "$as_me:9086: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then @@ -7982,8 +9092,8 @@ cat >>confdefs.h <&5 +rm -rf conftest* + echo "$as_me:9096: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7991,7 +9101,7 @@ else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF -#line 7994 "configure" +#line 9104 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8011,16 +9121,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8014: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9124: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8017: \$? = $ac_status" >&5 + echo "$as_me:9127: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8020: \"$ac_try\"") >&5 + { (eval echo "$as_me:9130: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8023: \$? = $ac_status" >&5 + echo "$as_me:9133: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8029,7 +9139,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8032 "configure" +#line 9142 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include @@ -8050,16 +9160,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9163: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8056: \$? = $ac_status" >&5 + echo "$as_me:9166: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8059: \"$ac_try\"") >&5 + { (eval echo "$as_me:9169: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8062: \$? = $ac_status" >&5 + echo "$as_me:9172: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else @@ -8070,7 +9180,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8073: result: $ac_cv_sys_large_files" >&5 +echo "$as_me:9183: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then @@ -8079,11 +9189,11 @@ cat >>confdefs.h <&5 + echo "$as_me:9196: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8091,7 +9201,7 @@ else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF -#line 8094 "configure" +#line 9204 "configure" #include "confdefs.h" #include int @@ -8103,16 +9213,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8106: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9216: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8109: \$? = $ac_status" >&5 + echo "$as_me:9219: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8112: \"$ac_try\"") >&5 + { (eval echo "$as_me:9222: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8115: \$? = $ac_status" >&5 + echo "$as_me:9225: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8121,7 +9231,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8124 "configure" +#line 9234 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include @@ -8134,16 +9244,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8137: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9247: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8140: \$? = $ac_status" >&5 + echo "$as_me:9250: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8143: \"$ac_try\"") >&5 + { (eval echo "$as_me:9253: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8146: \$? = $ac_status" >&5 + echo "$as_me:9256: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else @@ -8154,7 +9264,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8157: result: $ac_cv_sys_largefile_source" >&5 +echo "$as_me:9267: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then @@ -8163,18 +9273,18 @@ cat >>confdefs.h <&5 +echo "$as_me:9281: checking for fseeko" >&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8177 "configure" +#line 9287 "configure" #include "confdefs.h" #include int @@ -8186,16 +9296,16 @@ return fseeko && fseeko (stdin, 0, 0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8189: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9299: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8192: \$? = $ac_status" >&5 + echo "$as_me:9302: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8195: \"$ac_try\"") >&5 + { (eval echo "$as_me:9305: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8198: \$? = $ac_status" >&5 + echo "$as_me:9308: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else @@ -8205,7 +9315,7 @@ ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:8208: result: $ac_cv_func_fseeko" >&5 +echo "$as_me:9318: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then @@ -8226,14 +9336,14 @@ fi test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " - echo "$as_me:8229: checking whether to use struct dirent64" >&5 + echo "$as_me:9339: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8236 "configure" +#line 9346 "configure" #include "confdefs.h" #include @@ -8254,16 +9364,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8257: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9367: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8260: \$? = $ac_status" >&5 + echo "$as_me:9370: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8263: \"$ac_try\"") >&5 + { (eval echo "$as_me:9373: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8266: \$? = $ac_status" >&5 + echo "$as_me:9376: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else @@ -8274,7 +9384,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8277: result: $cf_cv_struct_dirent64" >&5 +echo "$as_me:9387: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 @@ -8283,7 +9393,7 @@ EOF fi ### use option --disable-tparm-varargs to make tparm() conform to X/Open -echo "$as_me:8286: checking if you want tparm not to use X/Open fixed-parameter list" >&5 +echo "$as_me:9396: checking if you want tparm not to use X/Open fixed-parameter list" >&5 echo $ECHO_N "checking if you want tparm not to use X/Open fixed-parameter list... $ECHO_C" >&6 # Check whether --enable-tparm-varargs or --disable-tparm-varargs was given. @@ -8293,14 +9403,14 @@ if test "${enable_tparm_varargs+set}" = set; then else with_tparm_varargs=yes fi; -echo "$as_me:8296: result: $with_tparm_varargs" >&5 +echo "$as_me:9406: result: $with_tparm_varargs" >&5 echo "${ECHO_T}$with_tparm_varargs" >&6 NCURSES_TPARM_VARARGS=0 test "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1 ### use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw if test "$with_ticlib" != no ; then -echo "$as_me:8303: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 +echo "$as_me:9413: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 echo $ECHO_N "checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library... $ECHO_C" >&6 # Check whether --enable-tic-depends or --disable-tic-depends was given. @@ -8310,14 +9420,14 @@ if test "${enable_tic_depends+set}" = set; then else with_tic_depends=yes fi; -echo "$as_me:8313: result: $with_tic_depends" >&5 +echo "$as_me:9423: result: $with_tic_depends" >&5 echo "${ECHO_T}$with_tic_depends" >&6 else with_tic_depends=no fi ### use option --with-bool to override bool's type -echo "$as_me:8320: checking for type of bool" >&5 +echo "$as_me:9430: checking for type of bool" >&5 echo $ECHO_N "checking for type of bool... $ECHO_C" >&6 # Check whether --with-bool or --without-bool was given. @@ -8327,10 +9437,10 @@ if test "${with_bool+set}" = set; then else NCURSES_BOOL=auto fi; -echo "$as_me:8330: result: $NCURSES_BOOL" >&5 +echo "$as_me:9440: result: $NCURSES_BOOL" >&5 echo "${ECHO_T}$NCURSES_BOOL" >&6 -echo "$as_me:8333: checking for alternate terminal capabilities file" >&5 +echo "$as_me:9443: checking for alternate terminal capabilities file" >&5 echo $ECHO_N "checking for alternate terminal capabilities file... $ECHO_C" >&6 # Check whether --with-caps or --without-caps was given. @@ -8341,11 +9451,11 @@ else TERMINFO_CAPS=Caps fi; test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps -echo "$as_me:8344: result: $TERMINFO_CAPS" >&5 +echo "$as_me:9454: result: $TERMINFO_CAPS" >&5 echo "${ECHO_T}$TERMINFO_CAPS" >&6 ### use option --with-chtype to override chtype's type -echo "$as_me:8348: checking for type of chtype" >&5 +echo "$as_me:9458: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 # Check whether --with-chtype or --without-chtype was given. @@ -8355,11 +9465,11 @@ if test "${with_chtype+set}" = set; then else NCURSES_CHTYPE=auto fi; -echo "$as_me:8358: result: $NCURSES_CHTYPE" >&5 +echo "$as_me:9468: result: $NCURSES_CHTYPE" >&5 echo "${ECHO_T}$NCURSES_CHTYPE" >&6 ### use option --with-ospeed to override ospeed's type -echo "$as_me:8362: checking for type of ospeed" >&5 +echo "$as_me:9472: checking for type of ospeed" >&5 echo $ECHO_N "checking for type of ospeed... $ECHO_C" >&6 # Check whether --with-ospeed or --without-ospeed was given. @@ -8369,11 +9479,11 @@ if test "${with_ospeed+set}" = set; then else NCURSES_OSPEED=short fi; -echo "$as_me:8372: result: $NCURSES_OSPEED" >&5 +echo "$as_me:9482: result: $NCURSES_OSPEED" >&5 echo "${ECHO_T}$NCURSES_OSPEED" >&6 ### use option --with-mmask-t to override mmask_t's type -echo "$as_me:8376: checking for type of mmask_t" >&5 +echo "$as_me:9486: checking for type of mmask_t" >&5 echo $ECHO_N "checking for type of mmask_t... $ECHO_C" >&6 # Check whether --with-mmask-t or --without-mmask-t was given. @@ -8383,11 +9493,25 @@ if test "${with_mmask_t+set}" = set; then else NCURSES_MMASK_T=auto fi; -echo "$as_me:8386: result: $NCURSES_MMASK_T" >&5 +echo "$as_me:9496: result: $NCURSES_MMASK_T" >&5 echo "${ECHO_T}$NCURSES_MMASK_T" >&6 +### use option --with-ccharw-max to override CCHARW_MAX size +echo "$as_me:9500: checking for size CCHARW_MAX" >&5 +echo $ECHO_N "checking for size CCHARW_MAX... $ECHO_C" >&6 + +# Check whether --with-ccharw-max or --without-ccharw-max was given. +if test "${with_ccharw_max+set}" = set; then + withval="$with_ccharw_max" + NCURSES_CCHARW_MAX="$withval" +else + NCURSES_CCHARW_MAX=5 +fi; +echo "$as_me:9510: result: $NCURSES_CCHARW_MAX" >&5 +echo "${ECHO_T}$NCURSES_CCHARW_MAX" >&6 + ### Enable compiling-in rcs id's -echo "$as_me:8390: checking if RCS identifiers should be compiled-in" >&5 +echo "$as_me:9514: checking if RCS identifiers should be compiled-in" >&5 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. @@ -8397,7 +9521,7 @@ if test "${with_rcs_ids+set}" = set; then else with_rcs_ids=no fi; -echo "$as_me:8400: result: $with_rcs_ids" >&5 +echo "$as_me:9524: result: $with_rcs_ids" >&5 echo "${ECHO_T}$with_rcs_ids" >&6 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 @@ -8405,7 +9529,7 @@ EOF ############################################################################### -echo "$as_me:8408: checking format of man-pages" >&5 +echo "$as_me:9532: checking format of man-pages" >&5 echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6 # Check whether --with-manpage-format or --without-manpage-format was given. @@ -8433,7 +9557,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[01]* $cf_dir/cat*/$cf_example.[01]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -8494,14 +9618,14 @@ unknown) ;; esac -echo "$as_me:8497: result: $MANPAGE_FORMAT" >&5 +echo "$as_me:9621: result: $MANPAGE_FORMAT" >&5 echo "${ECHO_T}$MANPAGE_FORMAT" >&6 if test -n "$cf_unknown" ; then - { echo "$as_me:8500: WARNING: Unexpected manpage-format $cf_unknown" >&5 + { echo "$as_me:9624: WARNING: Unexpected manpage-format $cf_unknown" >&5 echo "$as_me: WARNING: Unexpected manpage-format $cf_unknown" >&2;} fi -echo "$as_me:8504: checking for manpage renaming" >&5 +echo "$as_me:9628: checking for manpage renaming" >&5 echo $ECHO_N "checking for manpage renaming... $ECHO_C" >&6 # Check whether --with-manpage-renames or --without-manpage-renames was given. @@ -8529,7 +9653,7 @@ if test "$MANPAGE_RENAMES" != no ; then if test -f $srcdir/man/$MANPAGE_RENAMES ; then MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES elif test ! -f $MANPAGE_RENAMES ; then - { { echo "$as_me:8532: error: not a filename: $MANPAGE_RENAMES" >&5 + { { echo "$as_me:9656: error: not a filename: $MANPAGE_RENAMES" >&5 echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} { (exit 1); exit 1; }; } fi @@ -8543,10 +9667,10 @@ echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} fi fi -echo "$as_me:8546: result: $MANPAGE_RENAMES" >&5 +echo "$as_me:9670: result: $MANPAGE_RENAMES" >&5 echo "${ECHO_T}$MANPAGE_RENAMES" >&6 -echo "$as_me:8549: checking if manpage aliases will be installed" >&5 +echo "$as_me:9673: checking if manpage aliases will be installed" >&5 echo $ECHO_N "checking if manpage aliases will be installed... $ECHO_C" >&6 # Check whether --with-manpage-aliases or --without-manpage-aliases was given. @@ -8557,18 +9681,21 @@ else MANPAGE_ALIASES=yes fi; -echo "$as_me:8560: result: $MANPAGE_ALIASES" >&5 +echo "$as_me:9684: result: $MANPAGE_ALIASES" >&5 echo "${ECHO_T}$MANPAGE_ALIASES" >&6 -if test "$LN_S" = "ln -s"; then +case "x$LN_S" in #(vi +xln*) #(vi cf_use_symlinks=yes -else + ;; +*) cf_use_symlinks=no -fi + ;; +esac MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then -echo "$as_me:8571: checking if manpage symlinks should be used" >&5 +echo "$as_me:9698: checking if manpage symlinks should be used" >&5 echo $ECHO_N "checking if manpage symlinks should be used... $ECHO_C" >&6 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. @@ -8581,17 +9708,17 @@ fi; if test "$$cf_use_symlinks" = no; then if test "$MANPAGE_SYMLINKS" = yes ; then - { echo "$as_me:8584: WARNING: cannot make symlinks" >&5 + { echo "$as_me:9711: WARNING: cannot make symlinks" >&5 echo "$as_me: WARNING: cannot make symlinks" >&2;} MANPAGE_SYMLINKS=no fi fi -echo "$as_me:8590: result: $MANPAGE_SYMLINKS" >&5 +echo "$as_me:9717: result: $MANPAGE_SYMLINKS" >&5 echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6 fi -echo "$as_me:8594: checking for manpage tbl" >&5 +echo "$as_me:9721: checking for manpage tbl" >&5 echo $ECHO_N "checking for manpage tbl... $ECHO_C" >&6 # Check whether --with-manpage-tbl or --without-manpage-tbl was given. @@ -8602,7 +9729,7 @@ else MANPAGE_TBL=no fi; -echo "$as_me:8605: result: $MANPAGE_TBL" >&5 +echo "$as_me:9732: result: $MANPAGE_TBL" >&5 echo "${ECHO_T}$MANPAGE_TBL" >&6 if test "$prefix" = "NONE" ; then @@ -8635,7 +9762,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) #(vi +*gzip*) cf_so_strip="gz" cf_compress=gzip ;; @@ -8658,14 +9785,12 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" - INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR-/tmp}/man\$\$ +TMP=\${TMPDIR:=/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\$1 @@ -8703,7 +9828,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - \$MKDIRS \$cf_subdir\$section + mkdir -p \$cf_subdir\$section fi fi @@ -8718,12 +9843,12 @@ cat >>$cf_man_alias <<-CF_EOF2 s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g CF_EOF - for cf_name in captoinfo clear infocmp infotocap tic toe tput + for cf_name in captoinfo clear infocmp infotocap tabs tic toe tput tset do cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name, + s,@$cf_NAME@,$cf_name,g CF_EOF done @@ -8852,8 +9977,21 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -8913,7 +10051,7 @@ chmod 755 $cf_edit_man ############################################################################### ### Note that some functions (such as const) are normally disabled anyway. -echo "$as_me:8916: checking if you want to build with function extensions" >&5 +echo "$as_me:10054: checking if you want to build with function extensions" >&5 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. @@ -8923,7 +10061,7 @@ if test "${enable_ext_funcs+set}" = set; then else with_ext_funcs=yes fi; -echo "$as_me:8926: result: $with_ext_funcs" >&5 +echo "$as_me:10064: result: $with_ext_funcs" >&5 echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 @@ -8941,6 +10079,10 @@ EOF cat >>confdefs.h <<\EOF #define HAVE_RESIZE_TERM 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_TERM_ENTRY_H 1 EOF cat >>confdefs.h <<\EOF @@ -8955,12 +10097,62 @@ EOF #define NCURSES_EXT_FUNCS 1 EOF + GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 + GENERATED_EXT_FUNCS= +fi + +echo "$as_me:10106: checking if you want to build with experimental SCREEN extensions" >&5 +echo $ECHO_N "checking if you want to build with experimental SCREEN extensions... $ECHO_C" >&6 + +# Check whether --enable-sp-funcs or --disable-sp-funcs was given. +if test "${enable_sp_funcs+set}" = set; then + enableval="$enable_sp_funcs" + with_sp_funcs=$enableval +else + with_sp_funcs=no +fi; +echo "$as_me:10116: result: $with_sp_funcs" >&5 +echo "${ECHO_T}$with_sp_funcs" >&6 +if test "$with_sp_funcs" = yes ; then + NCURSES_SP_FUNCS=1 + cat >>confdefs.h <<\EOF +#define NCURSES_SP_FUNCS 1 +EOF + + GENERATED_SP_FUNCS=generated +else + NCURSES_SP_FUNCS=0 + GENERATED_SP_FUNCS= +fi + +echo "$as_me:10130: checking if you want to build with experimental terminal-driver" >&5 +echo $ECHO_N "checking if you want to build with experimental terminal-driver... $ECHO_C" >&6 + +# Check whether --enable-term-driver or --disable-term-driver was given. +if test "${enable_term_driver+set}" = set; then + enableval="$enable_term_driver" + with_term_driver=$enableval +else + with_term_driver=no +fi; +echo "$as_me:10140: result: $with_term_driver" >&5 +echo "${ECHO_T}$with_term_driver" >&6 +if test "$with_term_driver" = yes ; then + cat >>confdefs.h <<\EOF +#define USE_TERM_DRIVER 1 +EOF + + if test "$with_sp_funcs" != yes ; then + { { echo "$as_me:10148: error: The term-driver option relies upon sp-funcs" >&5 +echo "$as_me: error: The term-driver option relies upon sp-funcs" >&2;} + { (exit 1); exit 1; }; } + fi fi ### use option --enable-const to turn on use of const beyond that in XSI. -echo "$as_me:8963: checking for extended use of const keyword" >&5 +echo "$as_me:10155: checking for extended use of const keyword" >&5 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. @@ -8970,7 +10162,7 @@ if test "${enable_const+set}" = set; then else with_ext_const=no fi; -echo "$as_me:8973: result: $with_ext_const" >&5 +echo "$as_me:10165: result: $with_ext_const" >&5 echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then @@ -8978,7 +10170,7 @@ if test "$with_ext_const" = yes ; then fi ### use option --enable-ext-colors to turn on use of colors beyond 16. -echo "$as_me:8981: checking if you want to use extended colors" >&5 +echo "$as_me:10173: checking if you want to use extended colors" >&5 echo $ECHO_N "checking if you want to use extended colors... $ECHO_C" >&6 # Check whether --enable-ext-colors or --disable-ext-colors was given. @@ -8988,12 +10180,12 @@ if test "${enable_ext_colors+set}" = set; then else with_ext_colors=no fi; -echo "$as_me:8991: result: $with_ext_colors" >&5 +echo "$as_me:10183: result: $with_ext_colors" >&5 echo "${ECHO_T}$with_ext_colors" >&6 NCURSES_EXT_COLORS=0 if test "$with_ext_colors" = yes ; then if test "$with_widec" != yes ; then - { { echo "$as_me:8996: error: This option applies only to wide-character library" >&5 + { { echo "$as_me:10188: error: This option applies only to wide-character library" >&5 echo "$as_me: error: This option applies only to wide-character library" >&2;} { (exit 1); exit 1; }; } else @@ -9004,7 +10196,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9007: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:10199: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9019,7 +10211,7 @@ EOF fi ### use option --enable-ext-mouse to modify coding to support 5-button mice -echo "$as_me:9022: checking if you want to use extended mouse encoding" >&5 +echo "$as_me:10214: checking if you want to use extended mouse encoding" >&5 echo $ECHO_N "checking if you want to use extended mouse encoding... $ECHO_C" >&6 # Check whether --enable-ext-mouse or --disable-ext-mouse was given. @@ -9029,7 +10221,7 @@ if test "${enable_ext_mouse+set}" = set; then else with_ext_mouse=no fi; -echo "$as_me:9032: result: $with_ext_mouse" >&5 +echo "$as_me:10224: result: $with_ext_mouse" >&5 echo "${ECHO_T}$with_ext_mouse" >&6 NCURSES_MOUSE_VERSION=1 if test "$with_ext_mouse" = yes ; then @@ -9040,7 +10232,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9043: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:10235: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9048,7 +10240,7 @@ fi fi -echo "$as_me:9051: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "$as_me:10243: checking if you want \$NCURSES_NO_PADDING code" >&5 echo $ECHO_N "checking if you want \$NCURSES_NO_PADDING code... $ECHO_C" >&6 # Check whether --enable-no-padding or --disable-no-padding was given. @@ -9058,19 +10250,19 @@ if test "${enable_no_padding+set}" = set; then else with_no_padding=$with_ext_funcs fi; -echo "$as_me:9061: result: $with_no_padding" >&5 +echo "$as_me:10253: result: $with_no_padding" >&5 echo "${ECHO_T}$with_no_padding" >&6 test "$with_no_padding" = yes && cat >>confdefs.h <<\EOF #define NCURSES_NO_PADDING 1 EOF -echo "$as_me:9067: checking for ANSI C header files" >&5 +echo "$as_me:10259: 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 9073 "configure" +#line 10265 "configure" #include "confdefs.h" #include #include @@ -9078,13 +10270,13 @@ else #include _ACEOF -if { (eval echo "$as_me:9081: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10273: \"$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:9087: \$? = $ac_status" >&5 + echo "$as_me:10279: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9106,7 +10298,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 9109 "configure" +#line 10301 "configure" #include "confdefs.h" #include @@ -9117,14 +10309,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* 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 9127 "configure" +#line 10319 "configure" #include "confdefs.h" #include @@ -9135,7 +10327,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -9145,7 +10337,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 9148 "configure" +#line 10340 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -9171,15 +10363,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9174: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10366: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9177: \$? = $ac_status" >&5 + echo "$as_me:10369: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9179: \"$ac_try\"") >&5 + { (eval echo "$as_me:10371: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9182: \$? = $ac_status" >&5 + echo "$as_me:10374: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -9192,7 +10384,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:9195: result: $ac_cv_header_stdc" >&5 +echo "$as_me:10387: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -9208,28 +10400,28 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:9211: checking for $ac_header" >&5 +echo "$as_me:10403: 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 9217 "configure" +#line 10409 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9223: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10415: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9226: \$? = $ac_status" >&5 + echo "$as_me:10418: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9229: \"$ac_try\"") >&5 + { (eval echo "$as_me:10421: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9232: \$? = $ac_status" >&5 + echo "$as_me:10424: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -9239,7 +10431,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9242: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:10434: 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 <&5 +echo "$as_me:10444: checking for signed char" >&5 echo $ECHO_N "checking for signed char... $ECHO_C" >&6 if test "${ac_cv_type_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9258 "configure" +#line 10450 "configure" #include "confdefs.h" $ac_includes_default int @@ -9270,16 +10462,16 @@ if (sizeof (signed char)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9273: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10465: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9276: \$? = $ac_status" >&5 + echo "$as_me:10468: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9279: \"$ac_try\"") >&5 + { (eval echo "$as_me:10471: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9282: \$? = $ac_status" >&5 + echo "$as_me:10474: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signed_char=yes else @@ -9289,10 +10481,10 @@ ac_cv_type_signed_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9292: result: $ac_cv_type_signed_char" >&5 +echo "$as_me:10484: result: $ac_cv_type_signed_char" >&5 echo "${ECHO_T}$ac_cv_type_signed_char" >&6 -echo "$as_me:9295: checking size of signed char" >&5 +echo "$as_me:10487: checking size of signed char" >&5 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6 if test "${ac_cv_sizeof_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9301,7 +10493,7 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line 9304 "configure" +#line 10496 "configure" #include "confdefs.h" $ac_includes_default int @@ -9313,21 +10505,21 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9316: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10508: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9319: \$? = $ac_status" >&5 + echo "$as_me:10511: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9322: \"$ac_try\"") >&5 + { (eval echo "$as_me:10514: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9325: \$? = $ac_status" >&5 + echo "$as_me:10517: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 9330 "configure" +#line 10522 "configure" #include "confdefs.h" $ac_includes_default int @@ -9339,16 +10531,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9342: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10534: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9345: \$? = $ac_status" >&5 + echo "$as_me:10537: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9348: \"$ac_try\"") >&5 + { (eval echo "$as_me:10540: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9351: \$? = $ac_status" >&5 + echo "$as_me:10543: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else @@ -9364,7 +10556,7 @@ cat conftest.$ac_ext >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 9367 "configure" +#line 10559 "configure" #include "confdefs.h" $ac_includes_default int @@ -9376,16 +10568,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9379: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10571: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9382: \$? = $ac_status" >&5 + echo "$as_me:10574: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9385: \"$ac_try\"") >&5 + { (eval echo "$as_me:10577: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9388: \$? = $ac_status" >&5 + echo "$as_me:10580: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else @@ -9401,7 +10593,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line 9404 "configure" +#line 10596 "configure" #include "confdefs.h" $ac_includes_default int @@ -9413,16 +10605,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9416: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10608: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9419: \$? = $ac_status" >&5 + echo "$as_me:10611: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9422: \"$ac_try\"") >&5 + { (eval echo "$as_me:10614: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9425: \$? = $ac_status" >&5 + echo "$as_me:10617: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else @@ -9435,12 +10627,12 @@ done ac_cv_sizeof_signed_char=$ac_lo else if test "$cross_compiling" = yes; then - { { echo "$as_me:9438: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:10630: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 9443 "configure" +#line 10635 "configure" #include "confdefs.h" $ac_includes_default int @@ -9456,15 +10648,15 @@ fclose (f); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9459: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10651: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9462: \$? = $ac_status" >&5 + echo "$as_me:10654: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9464: \"$ac_try\"") >&5 + { (eval echo "$as_me:10656: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9467: \$? = $ac_status" >&5 + echo "$as_me:10659: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_signed_char=`cat conftest.val` else @@ -9480,7 +10672,7 @@ else ac_cv_sizeof_signed_char=0 fi fi -echo "$as_me:9483: result: $ac_cv_sizeof_signed_char" >&5 +echo "$as_me:10675: result: $ac_cv_sizeof_signed_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6 cat >>confdefs.h <&5 +echo "$as_me:10686: checking if you want to use signed Boolean array in term.h" >&5 echo $ECHO_N "checking if you want to use signed Boolean array in term.h... $ECHO_C" >&6 # Check whether --enable-signed-char or --disable-signed-char was given. @@ -9501,12 +10693,12 @@ if test "${enable_signed_char+set}" = set; then else with_signed_char=no fi; -echo "$as_me:9504: result: $with_signed_char" >&5 +echo "$as_me:10696: result: $with_signed_char" >&5 echo "${ECHO_T}$with_signed_char" >&6 test "$with_signed_char" != yes && NCURSES_SBOOL="char" ### use option --enable-sigwinch to turn on use of SIGWINCH logic -echo "$as_me:9509: checking if you want SIGWINCH handler" >&5 +echo "$as_me:10701: checking if you want SIGWINCH handler" >&5 echo $ECHO_N "checking if you want SIGWINCH handler... $ECHO_C" >&6 # Check whether --enable-sigwinch or --disable-sigwinch was given. @@ -9516,14 +10708,14 @@ if test "${enable_sigwinch+set}" = set; then else with_sigwinch=$with_ext_funcs fi; -echo "$as_me:9519: result: $with_sigwinch" >&5 +echo "$as_me:10711: result: $with_sigwinch" >&5 echo "${ECHO_T}$with_sigwinch" >&6 test "$with_sigwinch" = yes && cat >>confdefs.h <<\EOF #define USE_SIGWINCH 1 EOF ### use option --enable-tcap-names to allow user to define new capabilities -echo "$as_me:9526: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "$as_me:10718: checking if you want user-definable terminal capabilities like termcap" >&5 echo $ECHO_N "checking if you want user-definable terminal capabilities like termcap... $ECHO_C" >&6 # Check whether --enable-tcap-names or --disable-tcap-names was given. @@ -9533,7 +10725,7 @@ if test "${enable_tcap_names+set}" = set; then else with_tcap_names=$with_ext_funcs fi; -echo "$as_me:9536: result: $with_tcap_names" >&5 +echo "$as_me:10728: result: $with_tcap_names" >&5 echo "${ECHO_T}$with_tcap_names" >&6 NCURSES_XNAMES=0 test "$with_tcap_names" = yes && NCURSES_XNAMES=1 @@ -9541,7 +10733,7 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 ############################################################################### # These options are relatively safe to experiment with. -echo "$as_me:9544: checking if you want all development code" >&5 +echo "$as_me:10736: checking if you want all development code" >&5 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. @@ -9551,11 +10743,11 @@ if test "${with_develop+set}" = set; then else with_develop=no fi; -echo "$as_me:9554: result: $with_develop" >&5 +echo "$as_me:10746: result: $with_develop" >&5 echo "${ECHO_T}$with_develop" >&6 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -echo "$as_me:9558: checking if you want hard-tabs code" >&5 +echo "$as_me:10750: checking if you want hard-tabs code" >&5 echo $ECHO_N "checking if you want hard-tabs code... $ECHO_C" >&6 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. @@ -9565,14 +10757,14 @@ if test "${enable_hard_tabs+set}" = set; then else enable_hard_tabs=$with_develop fi; -echo "$as_me:9568: result: $enable_hard_tabs" >&5 +echo "$as_me:10760: result: $enable_hard_tabs" >&5 echo "${ECHO_T}$enable_hard_tabs" >&6 test "$enable_hard_tabs" = yes && cat >>confdefs.h <<\EOF #define USE_HARD_TABS 1 EOF ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -echo "$as_me:9575: checking if you want limited support for xmc" >&5 +echo "$as_me:10767: checking if you want limited support for xmc" >&5 echo $ECHO_N "checking if you want limited support for xmc... $ECHO_C" >&6 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. @@ -9582,7 +10774,7 @@ if test "${enable_xmc_glitch+set}" = set; then else enable_xmc_glitch=$with_develop fi; -echo "$as_me:9585: result: $enable_xmc_glitch" >&5 +echo "$as_me:10777: result: $enable_xmc_glitch" >&5 echo "${ECHO_T}$enable_xmc_glitch" >&6 test "$enable_xmc_glitch" = yes && cat >>confdefs.h <<\EOF #define USE_XMC_SUPPORT 1 @@ -9591,7 +10783,7 @@ EOF ############################################################################### # These are just experimental, probably should not be in a package: -echo "$as_me:9594: checking if you do not want to assume colors are white-on-black" >&5 +echo "$as_me:10786: checking if you do not want to assume colors are white-on-black" >&5 echo $ECHO_N "checking if you do not want to assume colors are white-on-black... $ECHO_C" >&6 # Check whether --enable-assumed-color or --disable-assumed-color was given. @@ -9601,14 +10793,14 @@ if test "${enable_assumed_color+set}" = set; then else with_assumed_color=yes fi; -echo "$as_me:9604: result: $with_assumed_color" >&5 +echo "$as_me:10796: result: $with_assumed_color" >&5 echo "${ECHO_T}$with_assumed_color" >&6 test "$with_assumed_color" = yes && cat >>confdefs.h <<\EOF #define USE_ASSUMED_COLOR 1 EOF ### use option --enable-hashmap to turn on use of hashmap scrolling logic -echo "$as_me:9611: checking if you want hashmap scrolling-optimization code" >&5 +echo "$as_me:10803: checking if you want hashmap scrolling-optimization code" >&5 echo $ECHO_N "checking if you want hashmap scrolling-optimization code... $ECHO_C" >&6 # Check whether --enable-hashmap or --disable-hashmap was given. @@ -9618,14 +10810,14 @@ if test "${enable_hashmap+set}" = set; then else with_hashmap=yes fi; -echo "$as_me:9621: result: $with_hashmap" >&5 +echo "$as_me:10813: result: $with_hashmap" >&5 echo "${ECHO_T}$with_hashmap" >&6 test "$with_hashmap" = yes && cat >>confdefs.h <<\EOF #define USE_HASHMAP 1 EOF ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -echo "$as_me:9628: checking if you want colorfgbg code" >&5 +echo "$as_me:10820: checking if you want colorfgbg code" >&5 echo $ECHO_N "checking if you want colorfgbg code... $ECHO_C" >&6 # Check whether --enable-colorfgbg or --disable-colorfgbg was given. @@ -9635,16 +10827,33 @@ if test "${enable_colorfgbg+set}" = set; then else with_colorfgbg=no fi; -echo "$as_me:9638: result: $with_colorfgbg" >&5 +echo "$as_me:10830: result: $with_colorfgbg" >&5 echo "${ECHO_T}$with_colorfgbg" >&6 test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF #define USE_COLORFGBG 1 EOF +### use option --enable-interop to turn on use of bindings used for interop +echo "$as_me:10837: checking if you want interop bindings" >&5 +echo $ECHO_N "checking if you want interop bindings... $ECHO_C" >&6 + +# Check whether --enable-interop or --disable-interop was given. +if test "${enable_interop+set}" = set; then + enableval="$enable_interop" + with_exp_interop=$enableval +else + with_exp_interop=no +fi; +echo "$as_me:10847: result: $with_exp_interop" >&5 +echo "${ECHO_T}$with_exp_interop" >&6 + +NCURSES_INTEROP_FUNCS=0 +test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 + # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. -echo "$as_me:9647: checking if you want to link with the pthread library" >&5 +echo "$as_me:10856: checking if you want to link with the pthread library" >&5 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 # Check whether --with-pthread or --without-pthread was given. @@ -9654,27 +10863,27 @@ if test "${with_pthread+set}" = set; then else with_pthread=no fi; -echo "$as_me:9657: result: $with_pthread" >&5 +echo "$as_me:10866: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" != no ; then - echo "$as_me:9661: checking for pthread.h" >&5 + echo "$as_me:10870: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9667 "configure" +#line 10876 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:9671: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10880: \"$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:9677: \$? = $ac_status" >&5 + echo "$as_me:10886: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9693,7 +10902,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:9696: result: $ac_cv_header_pthread_h" >&5 +echo "$as_me:10905: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 if test $ac_cv_header_pthread_h = yes; then @@ -9701,12 +10910,12 @@ if test $ac_cv_header_pthread_h = yes; then #define HAVE_PTHREADS_H 1 EOF - echo "$as_me:9704: checking if we can link with the pthread library" >&5 + echo "$as_me:10913: checking if we can link with the pthread library" >&5 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6 cf_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 9709 "configure" +#line 10918 "configure" #include "confdefs.h" #include @@ -9722,16 +10931,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9725: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10934: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9728: \$? = $ac_status" >&5 + echo "$as_me:10937: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9731: \"$ac_try\"") >&5 + { (eval echo "$as_me:10940: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9734: \$? = $ac_status" >&5 + echo "$as_me:10943: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_pthread=yes else @@ -9741,7 +10950,7 @@ with_pthread=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:9744: result: $with_pthread" >&5 + echo "$as_me:10953: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" = yes ; then @@ -9751,7 +10960,7 @@ echo "${ECHO_T}$with_pthread" >&6 EOF else - { { echo "$as_me:9754: error: Cannot link with pthread library" >&5 + { { echo "$as_me:10963: error: Cannot link with pthread library" >&5 echo "$as_me: error: Cannot link with pthread library" >&2;} { (exit 1); exit 1; }; } fi @@ -9760,28 +10969,109 @@ fi fi -echo "$as_me:9763: checking if you want to use weak-symbols for pthreads" >&5 +if test "x$with_pthread" != xno; then + echo "$as_me:10973: checking for pthread_kill" >&5 +echo $ECHO_N "checking for pthread_kill... $ECHO_C" >&6 +if test "${ac_cv_func_pthread_kill+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 10979 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_kill (); below. */ +#include +/* 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 pthread_kill (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_pthread_kill) || defined (__stub___pthread_kill) +choke me +#else +f = pthread_kill; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11010: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11013: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11016: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11019: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_pthread_kill=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_pthread_kill=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11029: result: $ac_cv_func_pthread_kill" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_kill" >&6 +if test $ac_cv_func_pthread_kill = yes; then + + echo "$as_me:11033: checking if you want to allow EINTR in wgetch with pthreads" >&5 +echo $ECHO_N "checking if you want to allow EINTR in wgetch with pthreads... $ECHO_C" >&6 + +# Check whether --enable-pthreads-eintr or --disable-pthreads-eintr was given. +if test "${enable_pthreads_eintr+set}" = set; then + enableval="$enable_pthreads_eintr" + use_pthreads_eintr=$enableval +else + use_pthreads_eintr=no +fi; + echo "$as_me:11043: result: $use_pthreads_eintr" >&5 +echo "${ECHO_T}$use_pthreads_eintr" >&6 + if test $use_pthreads_eintr = yes ; then + cat >>confdefs.h <<\EOF +#define USE_PTHREADS_EINTR 1 +EOF + + fi +fi + + echo "$as_me:11053: checking if you want to use weak-symbols for pthreads" >&5 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 # Check whether --enable-weak-symbols or --disable-weak-symbols was given. if test "${enable_weak_symbols+set}" = set; then enableval="$enable_weak_symbols" - use_weak_symbols=$withval + use_weak_symbols=$enableval else use_weak_symbols=no fi; -echo "$as_me:9773: result: $use_weak_symbols" >&5 + echo "$as_me:11063: result: $use_weak_symbols" >&5 echo "${ECHO_T}$use_weak_symbols" >&6 -if test "$use_weak_symbols" = yes ; then + if test "$use_weak_symbols" = yes ; then -echo "$as_me:9777: checking if $CC supports weak symbols" >&5 +echo "$as_me:11067: checking if $CC supports weak symbols" >&5 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 if test "${cf_cv_weak_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9784 "configure" +#line 11074 "configure" #include "confdefs.h" #include @@ -9807,16 +11097,16 @@ weak_symbol(fopen); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9810: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11100: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9813: \$? = $ac_status" >&5 + echo "$as_me:11103: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9816: \"$ac_try\"") >&5 + { (eval echo "$as_me:11106: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9819: \$? = $ac_status" >&5 + echo "$as_me:11109: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_weak_symbols=yes else @@ -9827,18 +11117,19 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9830: result: $cf_cv_weak_symbols" >&5 +echo "$as_me:11120: result: $cf_cv_weak_symbols" >&5 echo "${ECHO_T}$cf_cv_weak_symbols" >&6 -else - cf_cv_weak_symbols=no -fi + else + cf_cv_weak_symbols=no + fi -if test $cf_cv_weak_symbols = yes ; then - cat >>confdefs.h <<\EOF + if test $cf_cv_weak_symbols = yes ; then + cat >>confdefs.h <<\EOF #define USE_WEAK_SYMBOLS 1 EOF + fi fi PTHREAD= @@ -9857,7 +11148,7 @@ fi # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. -echo "$as_me:9860: checking if you want experimental reentrant code" >&5 +echo "$as_me:11151: checking if you want experimental reentrant code" >&5 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 # Check whether --enable-reentrant or --disable-reentrant was given. @@ -9867,21 +11158,23 @@ if test "${enable_reentrant+set}" = set; then else with_reentrant=no fi; -echo "$as_me:9870: result: $with_reentrant" >&5 +echo "$as_me:11161: result: $with_reentrant" >&5 echo "${ECHO_T}$with_reentrant" >&6 if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then + if test $cf_cv_weak_symbols = yes ; then # remove pthread library from $LIBS LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + TEST_LIBS="-lpthread $TEST_LIBS" + TEST_LIBS2="-lpthread $TEST_LIBS2" + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi cat >>confdefs.h <<\EOF #define USE_REENTRANT 1 EOF @@ -9891,7 +11184,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9894: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:11187: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9904,7 +11197,29 @@ else NCURSES_SIZE_T=short fi -echo "$as_me:9907: checking if you want experimental safe-sprintf code" >&5 +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + echo "$as_me:11202: checking for prefix used to wrap public variables" >&5 +echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 + +# Check whether --with-wrap-prefix or --without-wrap-prefix was given. +if test "${with_wrap_prefix+set}" = set; then + withval="$with_wrap_prefix" + NCURSES_WRAP_PREFIX=$withval +else + NCURSES_WRAP_PREFIX=_nc_ +fi; + echo "$as_me:11212: result: $NCURSES_WRAP_PREFIX" >&5 +echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 +else + NCURSES_WRAP_PREFIX=_nc_ +fi + +cat >>confdefs.h <&5 echo $ECHO_N "checking if you want experimental safe-sprintf code... $ECHO_C" >&6 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given. @@ -9914,7 +11229,7 @@ if test "${enable_safe_sprintf+set}" = set; then else with_safe_sprintf=no fi; -echo "$as_me:9917: result: $with_safe_sprintf" >&5 +echo "$as_me:11232: result: $with_safe_sprintf" >&5 echo "${ECHO_T}$with_safe_sprintf" >&6 test "$with_safe_sprintf" = yes && cat >>confdefs.h <<\EOF #define USE_SAFE_SPRINTF 1 @@ -9923,7 +11238,7 @@ EOF ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic # when hashmap is used scroll hints are useless if test "$with_hashmap" = no ; then -echo "$as_me:9926: checking if you want to experiment without scrolling-hints code" >&5 +echo "$as_me:11241: checking if you want to experiment without scrolling-hints code" >&5 echo $ECHO_N "checking if you want to experiment without scrolling-hints code... $ECHO_C" >&6 # Check whether --enable-scroll-hints or --disable-scroll-hints was given. @@ -9933,7 +11248,7 @@ if test "${enable_scroll_hints+set}" = set; then else with_scroll_hints=yes fi; -echo "$as_me:9936: result: $with_scroll_hints" >&5 +echo "$as_me:11251: result: $with_scroll_hints" >&5 echo "${ECHO_T}$with_scroll_hints" >&6 test "$with_scroll_hints" = yes && cat >>confdefs.h <<\EOF #define USE_SCROLL_HINTS 1 @@ -9941,7 +11256,7 @@ EOF fi -echo "$as_me:9944: checking if you want experimental wgetch-events code" >&5 +echo "$as_me:11259: checking if you want experimental wgetch-events code" >&5 echo $ECHO_N "checking if you want experimental wgetch-events code... $ECHO_C" >&6 # Check whether --enable-wgetch-events or --disable-wgetch-events was given. @@ -9951,7 +11266,7 @@ if test "${enable_wgetch_events+set}" = set; then else with_wgetch_events=no fi; -echo "$as_me:9954: result: $with_wgetch_events" >&5 +echo "$as_me:11269: result: $with_wgetch_events" >&5 echo "${ECHO_T}$with_wgetch_events" >&6 test "$with_wgetch_events" = yes && cat >>confdefs.h <<\EOF #define NCURSES_WGETCH_EVENTS 1 @@ -9960,7 +11275,7 @@ EOF ############################################################################### ### use option --disable-echo to suppress full display compiling commands -echo "$as_me:9963: checking if you want to display full commands during build" >&5 +echo "$as_me:11278: checking if you want to display full commands during build" >&5 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -9977,11 +11292,11 @@ else test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent" fi -echo "$as_me:9980: result: $with_echo" >&5 +echo "$as_me:11295: result: $with_echo" >&5 echo "${ECHO_T}$with_echo" >&6 ### use option --enable-warnings to turn on all gcc warnings -echo "$as_me:9984: checking if you want to see compiler warnings" >&5 +echo "$as_me:11299: checking if you want to see compiler warnings" >&5 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. @@ -9989,10 +11304,11 @@ if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval fi; -echo "$as_me:9992: result: $with_warnings" >&5 +echo "$as_me:11307: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "x$with_warnings" = "xyes"; then + ADAFLAGS="$ADAFLAGS -gnatg" INTEL_COMPILER=no @@ -10000,12 +11316,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:10003: checking if this is really Intel C compiler" >&5 + echo "$as_me:11319: 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 10008 "configure" +#line 11324 "configure" #include "confdefs.h" int @@ -10022,16 +11338,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10025: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11341: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10028: \$? = $ac_status" >&5 + echo "$as_me:11344: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10031: \"$ac_try\"") >&5 + { (eval echo "$as_me:11347: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10034: \$? = $ac_status" >&5 + echo "$as_me:11350: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -10042,14 +11358,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:10045: result: $INTEL_COMPILER" >&5 + echo "$as_me:11361: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <&5 + { echo "$as_me:11385: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ - wd1682 \ wd1683 \ wd1684 \ wd193 \ - wd279 \ wd593 \ + wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:10087: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11401: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10090: \$? = $ac_status" >&5 + echo "$as_me:11404: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10092: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11406: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -10098,13 +11412,13 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:10101: checking for $CC warning options..." >&5 + { echo "$as_me:11415: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS="-W -Wall" + EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" - for cf_opt in \ + for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ @@ -10118,12 +11432,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:10121: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11435: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10124: \$? = $ac_status" >&5 + echo "$as_me:11438: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10126: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11440: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -10134,7 +11448,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:11451: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -10145,7 +11459,7 @@ echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION .. done CFLAGS="$cf_save_CFLAGS" fi -rm -f conftest* +rm -rf conftest* if test "$cf_with_cxx" = yes ; then @@ -10154,12 +11468,12 @@ INTEL_CPLUSPLUS=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:10157: checking if this is really Intel C++ compiler" >&5 + echo "$as_me:11471: 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="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 10162 "configure" +#line 11476 "configure" #include "confdefs.h" int @@ -10176,16 +11490,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10179: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11493: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10182: \$? = $ac_status" >&5 + echo "$as_me:11496: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10185: \"$ac_try\"") >&5 + { (eval echo "$as_me:11499: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10188: \$? = $ac_status" >&5 + echo "$as_me:11502: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_CPLUSPLUS=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -10196,7 +11510,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$cf_save_CFLAGS" - echo "$as_me:10199: result: $INTEL_CPLUSPLUS" >&5 + echo "$as_me:11513: result: $INTEL_CPLUSPLUS" >&5 echo "${ECHO_T}$INTEL_CPLUSPLUS" >&6 ;; esac @@ -10210,7 +11524,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat > conftest.$ac_ext <&5 + { echo "$as_me:11545: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-Wall" @@ -10245,12 +11559,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -$cf_opt" - if { (eval echo "$as_me:10248: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11562: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10251: \$? = $ac_status" >&5 + echo "$as_me:11565: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10253: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11567: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" fi @@ -10259,7 +11573,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GXX" = yes then - { echo "$as_me:10262: checking for $CXX warning options..." >&5 + { echo "$as_me:11576: checking for $CXX warning options..." >&5 echo "$as_me: checking for $CXX warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-W -Wall" @@ -10288,23 +11602,23 @@ echo "$as_me: checking for $CXX warning options..." >&6;} Wundef $cf_gxx_extra_warnings Wno-unused do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -Werror -$cf_opt" - if { (eval echo "$as_me:10291: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11605: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10294: \$? = $ac_status" >&5 + echo "$as_me:11608: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10296: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11610: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" else - test -n "$verbose" && echo "$as_me:10300: result: ... no -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11614: result: ... no -$cf_opt" >&5 echo "${ECHO_T}... no -$cf_opt" >&6 fi done CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -f conftest* +rm -rf conftest* ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -10333,10 +11647,10 @@ cat > conftest.i <&5 + { echo "$as_me:11650: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <&5 + + if { (eval echo "$as_me:11702: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10380: \$? = $ac_status" >&5 + echo "$as_me:11705: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10382: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:11707: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <&5 +echo "$as_me:11743: checking if you want to enable runtime assertions" >&5 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. @@ -10401,7 +11750,7 @@ if test "${enable_assertions+set}" = set; then else with_assertions=no fi; -echo "$as_me:10404: result: $with_assertions" >&5 +echo "$as_me:11753: result: $with_assertions" >&5 echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then @@ -10413,13 +11762,15 @@ EOF CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + + ADAFLAGS="$ADAFLAGS -gnata" + fi fi ### use option --disable-leaks to suppress "permanent" leaks, for testing -echo "$as_me:10422: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:11773: 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. @@ -10435,7 +11786,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:10438: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:11789: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -10461,8 +11812,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10477,6 +11828,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10492,8 +11853,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10505,7 +11866,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10519,23 +11880,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:10522: checking for dmalloc.h" >&5 + echo "$as_me:11883: 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 10528 "configure" +#line 11889 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10532: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:11893: \"$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:10538: \$? = $ac_status" >&5 + echo "$as_me:11899: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10554,11 +11915,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10557: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:11918: 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:10561: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:11922: 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 @@ -10566,7 +11927,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10569 "configure" +#line 11930 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10585,16 +11946,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10588: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11949: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10591: \$? = $ac_status" >&5 + echo "$as_me:11952: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10594: \"$ac_try\"") >&5 + { (eval echo "$as_me:11955: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10597: \$? = $ac_status" >&5 + echo "$as_me:11958: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -10605,7 +11966,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10608: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:11969: 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 <&5 +echo "$as_me:11984: 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. @@ -10636,7 +11997,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:10639: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:12000: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -10662,8 +12023,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10678,6 +12039,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10693,8 +12064,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10706,7 +12077,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10720,23 +12091,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:10723: checking for dbmalloc.h" >&5 + echo "$as_me:12094: 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 10729 "configure" +#line 12100 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10733: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:12104: \"$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:10739: \$? = $ac_status" >&5 + echo "$as_me:12110: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10755,11 +12126,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10758: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:12129: 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:10762: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:12133: 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 @@ -10767,7 +12138,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10770 "configure" +#line 12141 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10786,16 +12157,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10789: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12160: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10792: \$? = $ac_status" >&5 + echo "$as_me:12163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10795: \"$ac_try\"") >&5 + { (eval echo "$as_me:12166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10798: \$? = $ac_status" >&5 + echo "$as_me:12169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -10806,7 +12177,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10809: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:12180: 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 <&5 +echo "$as_me:12195: 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. @@ -10837,7 +12208,7 @@ EOF else with_valgrind= fi; -echo "$as_me:10840: result: ${with_valgrind:-no}" >&5 +echo "$as_me:12211: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in #(vi @@ -10863,8 +12234,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10879,6 +12250,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10894,8 +12275,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10907,7 +12288,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10920,22 +12301,26 @@ fi ;; esac -echo "$as_me:10923: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:12304: 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. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - with_no_leaks=yes + if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi else : ${with_no_leaks:=no} fi; -echo "$as_me:10933: result: $with_no_leaks" >&5 +echo "$as_me:12314: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 +EOF + + cat >>confdefs.h <<\EOF +#define YY_NO_LEAKS 1 EOF fi @@ -10975,7 +12360,7 @@ case "$CFLAGS $CPPFLAGS" in ;; esac -echo "$as_me:10978: checking whether to add trace feature to all models" >&5 +echo "$as_me:12363: checking whether to add trace feature to all models" >&5 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 # Check whether --with-trace or --without-trace was given. @@ -10985,7 +12370,7 @@ if test "${with_trace+set}" = set; then else cf_with_trace=$cf_all_traces fi; -echo "$as_me:10988: result: $cf_with_trace" >&5 +echo "$as_me:12373: result: $cf_with_trace" >&5 echo "${ECHO_T}$cf_with_trace" >&6 if test "$cf_with_trace" = yes ; then @@ -11008,8 +12393,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -11024,6 +12409,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -11039,8 +12434,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -11052,7 +12447,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -11066,13 +12461,17 @@ else fi ### Checks for libraries. -echo "$as_me:11069: checking for gettimeofday" >&5 +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) +echo "$as_me:12468: checking for gettimeofday" >&5 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 if test "${ac_cv_func_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11075 "configure" +#line 12474 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday (); below. */ @@ -11103,16 +12502,16 @@ f = gettimeofday; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11106: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12505: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11109: \$? = $ac_status" >&5 + echo "$as_me:12508: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11112: \"$ac_try\"") >&5 + { (eval echo "$as_me:12511: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11115: \$? = $ac_status" >&5 + echo "$as_me:12514: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gettimeofday=yes else @@ -11122,7 +12521,7 @@ ac_cv_func_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:11125: result: $ac_cv_func_gettimeofday" >&5 +echo "$as_me:12524: result: $ac_cv_func_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 if test $ac_cv_func_gettimeofday = yes; then cat >>confdefs.h <<\EOF @@ -11131,7 +12530,7 @@ EOF else -echo "$as_me:11134: checking for gettimeofday in -lbsd" >&5 +echo "$as_me:12533: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11139,7 +12538,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11142 "configure" +#line 12541 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11158,16 +12557,16 @@ gettimeofday (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11161: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12560: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11164: \$? = $ac_status" >&5 + echo "$as_me:12563: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11167: \"$ac_try\"") >&5 + { (eval echo "$as_me:12566: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11170: \$? = $ac_status" >&5 + echo "$as_me:12569: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else @@ -11178,26 +12577,28 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11181: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "$as_me:12580: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF - LIBS="$LIBS -lbsd" + LIBS="-lbsd $LIBS" fi fi + ;; +esac -echo "$as_me:11193: checking if -lm needed for math functions" >&5 +echo "$as_me:12594: 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 11200 "configure" +#line 12601 "configure" #include "confdefs.h" #include @@ -11212,16 +12613,16 @@ double x = rand(); printf("result = %g\n", sin(x)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11215: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12616: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11218: \$? = $ac_status" >&5 + echo "$as_me:12619: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11221: \"$ac_try\"") >&5 + { (eval echo "$as_me:12622: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11224: \$? = $ac_status" >&5 + echo "$as_me:12625: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_need_libm=no else @@ -11231,7 +12632,7 @@ cf_cv_need_libm=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:11234: result: $cf_cv_need_libm" >&5 +echo "$as_me:12635: result: $cf_cv_need_libm" >&5 echo "${ECHO_T}$cf_cv_need_libm" >&6 if test "$cf_cv_need_libm" = yes then @@ -11239,13 +12640,13 @@ MATH_LIB=-lm fi ### Checks for header files. -echo "$as_me:11242: checking for ANSI C header files" >&5 +echo "$as_me:12643: 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 11248 "configure" +#line 12649 "configure" #include "confdefs.h" #include #include @@ -11253,13 +12654,13 @@ else #include _ACEOF -if { (eval echo "$as_me:11256: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:12657: \"$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:11262: \$? = $ac_status" >&5 + echo "$as_me:12663: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11281,7 +12682,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 11284 "configure" +#line 12685 "configure" #include "confdefs.h" #include @@ -11292,14 +12693,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* 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 11302 "configure" +#line 12703 "configure" #include "confdefs.h" #include @@ -11310,7 +12711,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -11320,7 +12721,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 11323 "configure" +#line 12724 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -11346,15 +12747,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:11349: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12750: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11352: \$? = $ac_status" >&5 + echo "$as_me:12753: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:11354: \"$ac_try\"") >&5 + { (eval echo "$as_me:12755: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11357: \$? = $ac_status" >&5 + echo "$as_me:12758: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -11367,7 +12768,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:11370: result: $ac_cv_header_stdc" >&5 +echo "$as_me:12771: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -11380,13 +12781,13 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:11383: checking for $ac_hdr that defines DIR" >&5 +echo "$as_me:12784: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 11389 "configure" +#line 12790 "configure" #include "confdefs.h" #include #include <$ac_hdr> @@ -11401,16 +12802,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11404: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12805: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11407: \$? = $ac_status" >&5 + echo "$as_me:12808: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11410: \"$ac_try\"") >&5 + { (eval echo "$as_me:12811: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11413: \$? = $ac_status" >&5 + echo "$as_me:12814: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -11420,7 +12821,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11423: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:12824: 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 <&5 + echo "$as_me:12837: checking for opendir in -ldir" >&5 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 if test "${ac_cv_lib_dir_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11441,7 +12842,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11444 "configure" +#line 12845 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11460,16 +12861,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11463: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12864: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11466: \$? = $ac_status" >&5 + echo "$as_me:12867: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11469: \"$ac_try\"") >&5 + { (eval echo "$as_me:12870: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11472: \$? = $ac_status" >&5 + echo "$as_me:12873: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dir_opendir=yes else @@ -11480,14 +12881,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11483: result: $ac_cv_lib_dir_opendir" >&5 +echo "$as_me:12884: result: $ac_cv_lib_dir_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" fi else - echo "$as_me:11490: checking for opendir in -lx" >&5 + echo "$as_me:12891: checking for opendir in -lx" >&5 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 if test "${ac_cv_lib_x_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11495,7 +12896,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11498 "configure" +#line 12899 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11514,16 +12915,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11517: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12918: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11520: \$? = $ac_status" >&5 + echo "$as_me:12921: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11523: \"$ac_try\"") >&5 + { (eval echo "$as_me:12924: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11526: \$? = $ac_status" >&5 + echo "$as_me:12927: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_x_opendir=yes else @@ -11534,7 +12935,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11537: result: $ac_cv_lib_x_opendir" >&5 +echo "$as_me:12938: result: $ac_cv_lib_x_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 if test $ac_cv_lib_x_opendir = yes; then LIBS="$LIBS -lx" @@ -11542,13 +12943,13 @@ fi fi -echo "$as_me:11545: checking whether time.h and sys/time.h may both be included" >&5 +echo "$as_me:12946: 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 11551 "configure" +#line 12952 "configure" #include "confdefs.h" #include #include @@ -11564,16 +12965,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11567: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12968: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11570: \$? = $ac_status" >&5 + echo "$as_me:12971: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11573: \"$ac_try\"") >&5 + { (eval echo "$as_me:12974: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11576: \$? = $ac_status" >&5 + echo "$as_me:12977: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else @@ -11583,7 +12984,7 @@ ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11586: result: $ac_cv_header_time" >&5 +echo "$as_me:12987: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then @@ -11593,90 +12994,287 @@ EOF fi -echo "$as_me:11596: checking for regular-expression headers" >&5 +cf_regex_func=no + +cf_regex_libs="regex re" +case $host_os in #(vi +mingw*) + cf_regex_libs="regex.dll $cf_regex_libs" + ;; +esac + +echo "$as_me:13006: checking for regcomp" >&5 +echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 +if test "${ac_cv_func_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13012 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char regcomp (); below. */ +#include +/* 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 regcomp (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_regcomp) || defined (__stub___regcomp) +choke me +#else +f = regcomp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13043: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13046: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13049: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13052: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_regcomp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:13062: result: $ac_cv_func_regcomp" >&5 +echo "${ECHO_T}$ac_cv_func_regcomp" >&6 +if test $ac_cv_func_regcomp = yes; then + cf_regex_func=regcomp +else + + for cf_regex_lib in $cf_regex_libs + do + as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` +echo "$as_me:13071: checking for regcomp in -l$cf_regex_lib" >&5 +echo $ECHO_N "checking for regcomp in -l$cf_regex_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_regex_lib $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 13079 "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 regcomp (); +int +main () +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13098: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13101: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13104: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13107: \$? = $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:13118: 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 + + LIBS="-l$cf_regex_lib $LIBS" + cf_regex_func=regcomp + break +fi + + done + +fi + +if test "$cf_regex_func" = no ; then + echo "$as_me:13132: checking for compile" >&5 +echo $ECHO_N "checking for compile... $ECHO_C" >&6 +if test "${ac_cv_func_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13138 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char compile (); below. */ +#include +/* 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 compile (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_compile) || defined (__stub___compile) +choke me +#else +f = compile; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13169: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13172: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13175: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13178: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_compile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_compile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:13188: result: $ac_cv_func_compile" >&5 +echo "${ECHO_T}$ac_cv_func_compile" >&6 +if test $ac_cv_func_compile = yes; then + cf_regex_func=compile +else + + echo "$as_me:13194: checking for compile in -lgen" >&5 +echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6 +if test "${ac_cv_lib_gen_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgen $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 13202 "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 compile (); +int +main () +{ +compile (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13221: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13224: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13227: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13230: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gen_compile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gen_compile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:13241: result: $ac_cv_lib_gen_compile" >&5 +echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6 +if test $ac_cv_lib_gen_compile = yes; then + + LIBS="-lgen $LIBS" + cf_regex_func=compile +fi + +fi + +fi + +if test "$cf_regex_func" = no ; then + { echo "$as_me:13254: WARNING: cannot find regular expression library" >&5 +echo "$as_me: WARNING: cannot find regular expression library" >&2;} +fi + +echo "$as_me:13258: checking for regular-expression headers" >&5 echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 -if test "${cf_cv_regex+set}" = set; then +if test "${cf_cv_regex_hdrs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 11603 "configure" -#include "confdefs.h" -#include -#include -int -main () -{ - - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11621: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11624: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11627: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11630: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_regex="regex.h" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -#line 11638 "configure" -#include "confdefs.h" -#include -int -main () -{ - - char *p = compile("", "", "", 0); - int x = step("", ""); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11653: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11656: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11659: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11662: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_regex="regexp.h" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" +cf_cv_regex_hdrs=no +case $cf_regex_func in #(vi +compile) #(vi + for cf_regex_hdr in regexp.h regexpr.h + do cat >conftest.$ac_ext <<_ACEOF -#line 11672 "configure" +#line 13270 "configure" #include "confdefs.h" -#include +#include <$cf_regex_hdr> int main () { - char *p = compile("", "", ""); + char *p = compile("", "", "", 0); int x = step("", ""); ; @@ -11684,43 +13282,90 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11687: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13285: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11690: \$? = $ac_status" >&5 + echo "$as_me:13288: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11693: \"$ac_try\"") >&5 + { (eval echo "$as_me:13291: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11696: \$? = $ac_status" >&5 + echo "$as_me:13294: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cf_cv_regex="regexpr.h" + + cf_cv_regex_hdrs=$cf_regex_hdr + break + else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -LIBS="$cf_save_LIBS" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done + ;; +*) + for cf_regex_hdr in regex.h + do + cat >conftest.$ac_ext <<_ACEOF +#line 13311 "configure" +#include "confdefs.h" +#include +#include <$cf_regex_hdr> +int +main () +{ + + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13329: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13332: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13335: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13338: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_regex_hdrs=$cf_regex_hdr + break + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done + ;; +esac fi +echo "$as_me:13354: result: $cf_cv_regex_hdrs" >&5 +echo "${ECHO_T}$cf_cv_regex_hdrs" >&6 -echo "$as_me:11712: result: $cf_cv_regex" >&5 -echo "${ECHO_T}$cf_cv_regex" >&6 -case $cf_cv_regex in - regex.h) cat >>confdefs.h <<\EOF +case $cf_cv_regex_hdrs in #(vi + no) { echo "$as_me:13358: WARNING: no regular expression header found" >&5 +echo "$as_me: WARNING: no regular expression header found" >&2;} ;; #(vi + regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF - ;; - regexp.h) cat >>confdefs.h <<\EOF + ;; #(vi + regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF - ;; - regexpr.h) cat >>confdefs.h <<\EOF + ;; #(vi + regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; @@ -11745,23 +13390,23 @@ wctype.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:11748: checking for $ac_header" >&5 +echo "$as_me:13393: 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 11754 "configure" +#line 13399 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:11758: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:13403: \"$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:11764: \$? = $ac_status" >&5 + echo "$as_me:13409: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11780,7 +13425,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:11783: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:13428: 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 < to declare fd_set if test "$ISC" = yes ; then -echo "$as_me:11797: checking for main in -lcposix" >&5 +echo "$as_me:13442: checking for main in -lcposix" >&5 echo $ECHO_N "checking for main in -lcposix... $ECHO_C" >&6 if test "${ac_cv_lib_cposix_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11802,7 +13447,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11805 "configure" +#line 13450 "configure" #include "confdefs.h" int @@ -11814,16 +13459,16 @@ main (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11817: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13462: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11820: \$? = $ac_status" >&5 + echo "$as_me:13465: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11823: \"$ac_try\"") >&5 + { (eval echo "$as_me:13468: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11826: \$? = $ac_status" >&5 + echo "$as_me:13471: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cposix_main=yes else @@ -11834,7 +13479,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11837: result: $ac_cv_lib_cposix_main" >&5 +echo "$as_me:13482: result: $ac_cv_lib_cposix_main" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_main" >&6 if test $ac_cv_lib_cposix_main = yes; then cat >>confdefs.h <&5 + echo "$as_me:13493: checking for bzero in -linet" >&5 echo $ECHO_N "checking for bzero in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_bzero+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11853,7 +13498,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11856 "configure" +#line 13501 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11872,16 +13517,16 @@ bzero (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11875: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13520: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11878: \$? = $ac_status" >&5 + echo "$as_me:13523: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11881: \"$ac_try\"") >&5 + { (eval echo "$as_me:13526: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11884: \$? = $ac_status" >&5 + echo "$as_me:13529: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_bzero=yes else @@ -11892,21 +13537,21 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11895: result: $ac_cv_lib_inet_bzero" >&5 +echo "$as_me:13540: result: $ac_cv_lib_inet_bzero" >&5 echo "${ECHO_T}$ac_cv_lib_inet_bzero" >&6 if test $ac_cv_lib_inet_bzero = yes; then - LIBS="$LIBS -linet" + LIBS="-linet $LIBS" fi fi -echo "$as_me:11902: checking if sys/time.h works with sys/select.h" >&5 +echo "$as_me:13547: 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 11909 "configure" +#line 13554 "configure" #include "confdefs.h" #include @@ -11926,16 +13571,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11929: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13574: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11932: \$? = $ac_status" >&5 + echo "$as_me:13577: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11935: \"$ac_try\"") >&5 + { (eval echo "$as_me:13580: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11938: \$? = $ac_status" >&5 + echo "$as_me:13583: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sys_time_select=yes else @@ -11947,7 +13592,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11950: result: $cf_cv_sys_time_select" >&5 +echo "$as_me:13595: 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 @@ -11961,7 +13606,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:11964: checking for $CC option to accept ANSI C" >&5 +echo "$as_me:13609: 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 @@ -11969,7 +13614,7 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line 11972 "configure" +#line 13617 "configure" #include "confdefs.h" #include #include @@ -12018,16 +13663,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:12021: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13666: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12024: \$? = $ac_status" >&5 + echo "$as_me:13669: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12027: \"$ac_try\"") >&5 + { (eval echo "$as_me:13672: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12030: \$? = $ac_status" >&5 + echo "$as_me:13675: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -12044,21 +13689,21 @@ fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:12047: result: none needed" >&5 + echo "$as_me:13692: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:12050: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:13695: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac -echo "$as_me:12055: checking for an ANSI C-conforming const" >&5 +echo "$as_me:13700: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12061 "configure" +#line 13706 "configure" #include "confdefs.h" int @@ -12116,16 +13761,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12119: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13764: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12122: \$? = $ac_status" >&5 + echo "$as_me:13767: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12125: \"$ac_try\"") >&5 + { (eval echo "$as_me:13770: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12128: \$? = $ac_status" >&5 + echo "$as_me:13773: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else @@ -12135,7 +13780,7 @@ ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12138: result: $ac_cv_c_const" >&5 +echo "$as_me:13783: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then @@ -12145,7 +13790,7 @@ EOF fi -echo "$as_me:12148: checking for inline" >&5 +echo "$as_me:13793: 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 @@ -12153,7 +13798,7 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line 12156 "configure" +#line 13801 "configure" #include "confdefs.h" #ifndef __cplusplus static $ac_kw int static_foo () {return 0; } @@ -12162,16 +13807,16 @@ $ac_kw int foo () {return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12165: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13810: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12168: \$? = $ac_status" >&5 + echo "$as_me:13813: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12171: \"$ac_try\"") >&5 + { (eval echo "$as_me:13816: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12174: \$? = $ac_status" >&5 + echo "$as_me:13819: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else @@ -12182,7 +13827,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:12185: result: $ac_cv_c_inline" >&5 +echo "$as_me:13830: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; @@ -12205,8 +13850,8 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - echo "$as_me:12208: checking if gcc supports options to tune inlining" >&5 -echo $ECHO_N "checking if gcc supports options to tune inlining... $ECHO_C" >&6 + echo "$as_me:13853: checking if $CC supports options to tune inlining" >&5 +echo $ECHO_N "checking if $CC supports options to tune inlining... $ECHO_C" >&6 if test "${cf_cv_gcc_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12214,7 +13859,7 @@ else cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=1200" cat >conftest.$ac_ext <<_ACEOF -#line 12217 "configure" +#line 13862 "configure" #include "confdefs.h" inline int foo(void) { return 1; } int @@ -12226,16 +13871,16 @@ ${cf_cv_main_return:-return} foo() } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13874: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12232: \$? = $ac_status" >&5 + echo "$as_me:13877: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12235: \"$ac_try\"") >&5 + { (eval echo "$as_me:13880: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12238: \$? = $ac_status" >&5 + echo "$as_me:13883: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gcc_inline=yes else @@ -12247,7 +13892,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS=$cf_save_CFLAGS fi -echo "$as_me:12250: result: $cf_cv_gcc_inline" >&5 +echo "$as_me:13895: result: $cf_cv_gcc_inline" >&5 echo "${ECHO_T}$cf_cv_gcc_inline" >&6 if test "$cf_cv_gcc_inline" = yes ; then @@ -12267,8 +13912,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -12283,6 +13928,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -12298,8 +13953,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -12311,7 +13966,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -12323,7 +13978,7 @@ fi fi fi -echo "$as_me:12326: checking for signal global datatype" >&5 +echo "$as_me:13981: 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 @@ -12335,7 +13990,7 @@ else "int" do cat >conftest.$ac_ext <<_ACEOF -#line 12338 "configure" +#line 13993 "configure" #include "confdefs.h" #include @@ -12358,16 +14013,16 @@ signal(SIGINT, handler); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12361: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14016: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12364: \$? = $ac_status" >&5 + echo "$as_me:14019: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12367: \"$ac_try\"") >&5 + { (eval echo "$as_me:14022: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12370: \$? = $ac_status" >&5 + echo "$as_me:14025: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sig_atomic_t=$cf_type else @@ -12381,7 +14036,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12384: result: $cf_cv_sig_atomic_t" >&5 +echo "$as_me:14039: 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 <&5 +echo "$as_me:14047: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 if test "${cf_cv_typeof_chtype+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12399,7 +14054,7 @@ else cf_cv_typeof_chtype=long else cat >conftest.$ac_ext <<_ACEOF -#line 12402 "configure" +#line 14057 "configure" #include "confdefs.h" #define WANT_BITS 31 @@ -12434,15 +14089,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12437: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14092: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12440: \$? = $ac_status" >&5 + echo "$as_me:14095: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12442: \"$ac_try\"") >&5 + { (eval echo "$as_me:14097: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12445: \$? = $ac_status" >&5 + echo "$as_me:14100: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_typeof_chtype=`cat cf_test.out` else @@ -12457,7 +14112,7 @@ fi fi -echo "$as_me:12460: result: $cf_cv_typeof_chtype" >&5 +echo "$as_me:14115: result: $cf_cv_typeof_chtype" >&5 echo "${ECHO_T}$cf_cv_typeof_chtype" >&6 cat >>confdefs.h <&5 +echo "$as_me:14127: checking if unsigned literals are legal" >&5 echo $ECHO_N "checking if unsigned literals are legal... $ECHO_C" >&6 if test "${cf_cv_unsigned_literals+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12479 "configure" +#line 14134 "configure" #include "confdefs.h" int @@ -12488,16 +14143,16 @@ long x = 1L + 1UL + 1U + 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12491: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14146: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12494: \$? = $ac_status" >&5 + echo "$as_me:14149: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12497: \"$ac_try\"") >&5 + { (eval echo "$as_me:14152: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12500: \$? = $ac_status" >&5 + echo "$as_me:14155: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_unsigned_literals=yes else @@ -12509,7 +14164,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12512: result: $cf_cv_unsigned_literals" >&5 +echo "$as_me:14167: result: $cf_cv_unsigned_literals" >&5 echo "${ECHO_T}$cf_cv_unsigned_literals" >&6 cf_cv_1UL="1" @@ -12525,14 +14180,14 @@ test "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t="" ### Checks for external-data -echo "$as_me:12528: checking if external errno is declared" >&5 +echo "$as_me:14183: checking if external errno is declared" >&5 echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12535 "configure" +#line 14190 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -12550,16 +14205,16 @@ int x = (int) errno } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12553: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14208: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12556: \$? = $ac_status" >&5 + echo "$as_me:14211: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12559: \"$ac_try\"") >&5 + { (eval echo "$as_me:14214: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12562: \$? = $ac_status" >&5 + echo "$as_me:14217: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_dcl_errno=yes else @@ -12570,7 +14225,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12573: result: $cf_cv_dcl_errno" >&5 +echo "$as_me:14228: result: $cf_cv_dcl_errno" >&5 echo "${ECHO_T}$cf_cv_dcl_errno" >&6 if test "$cf_cv_dcl_errno" = no ; then @@ -12585,14 +14240,14 @@ fi # It's possible (for near-UNIX clones) that the data doesn't exist -echo "$as_me:12588: checking if external errno exists" >&5 +echo "$as_me:14243: checking if external errno exists" >&5 echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6 if test "${cf_cv_have_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12595 "configure" +#line 14250 "configure" #include "confdefs.h" #undef errno @@ -12607,16 +14262,16 @@ errno = 2 } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12610: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14265: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12613: \$? = $ac_status" >&5 + echo "$as_me:14268: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12616: \"$ac_try\"") >&5 + { (eval echo "$as_me:14271: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12619: \$? = $ac_status" >&5 + echo "$as_me:14274: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_errno=yes else @@ -12627,7 +14282,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12630: result: $cf_cv_have_errno" >&5 +echo "$as_me:14285: result: $cf_cv_have_errno" >&5 echo "${ECHO_T}$cf_cv_have_errno" >&6 if test "$cf_cv_have_errno" = yes ; then @@ -12640,7 +14295,7 @@ EOF fi -echo "$as_me:12643: checking if data-only library module links" >&5 +echo "$as_me:14298: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12648,20 +14303,20 @@ else rm -f conftest.a cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:14309: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12657: \$? = $ac_status" >&5 + echo "$as_me:14312: \$? = $ac_status" >&5 (exit $ac_status); } ; then mv conftest.o data.o && \ - ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null + ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:14332: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12680: \$? = $ac_status" >&5 + echo "$as_me:14335: \$? = $ac_status" >&5 (exit $ac_status); }; then mv conftest.o func.o && \ - ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null + ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&5 >/dev/null @@ -12690,7 +14345,7 @@ EOF cf_cv_link_dataonly=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 12693 "configure" +#line 14348 "configure" #include "confdefs.h" int main() @@ -12701,15 +14356,15 @@ else _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12704: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14359: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12707: \$? = $ac_status" >&5 + echo "$as_me:14362: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12709: \"$ac_try\"") >&5 + { (eval echo "$as_me:14364: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12712: \$? = $ac_status" >&5 + echo "$as_me:14367: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else @@ -12724,7 +14379,7 @@ fi fi -echo "$as_me:12727: result: $cf_cv_link_dataonly" >&5 +echo "$as_me:14382: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then @@ -12759,13 +14414,13 @@ vsnprintf \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:12762: checking for $ac_func" >&5 +echo "$as_me:14417: 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 12768 "configure" +#line 14423 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -12796,16 +14451,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12799: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14454: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12802: \$? = $ac_status" >&5 + echo "$as_me:14457: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12805: \"$ac_try\"") >&5 + { (eval echo "$as_me:14460: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12808: \$? = $ac_status" >&5 + echo "$as_me:14463: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -12815,7 +14470,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12818: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:14473: 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 <&5 +echo "$as_me:14485: checking for terminal-capability database functions" >&5 echo $ECHO_N "checking for terminal-capability database functions... $ECHO_C" >&6 if test "${cf_cv_cgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12837 "configure" +#line 14492 "configure" #include "confdefs.h" #include @@ -12854,16 +14509,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12857: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14512: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12860: \$? = $ac_status" >&5 + echo "$as_me:14515: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12863: \"$ac_try\"") >&5 + { (eval echo "$as_me:14518: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12866: \$? = $ac_status" >&5 + echo "$as_me:14521: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cgetent=yes else @@ -12875,7 +14530,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12878: result: $cf_cv_cgetent" >&5 +echo "$as_me:14533: result: $cf_cv_cgetent" >&5 echo "${ECHO_T}$cf_cv_cgetent" >&6 test "$cf_cv_cgetent" = yes && cat >>confdefs.h <<\EOF #define HAVE_BSD_CGETENT 1 @@ -12883,14 +14538,14 @@ EOF fi -echo "$as_me:12886: checking for isascii" >&5 +echo "$as_me:14541: checking for isascii" >&5 echo $ECHO_N "checking for isascii... $ECHO_C" >&6 if test "${cf_cv_have_isascii+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12893 "configure" +#line 14548 "configure" #include "confdefs.h" #include int @@ -12902,16 +14557,16 @@ int x = isascii(' ') } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12905: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14560: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12908: \$? = $ac_status" >&5 + echo "$as_me:14563: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12911: \"$ac_try\"") >&5 + { (eval echo "$as_me:14566: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12914: \$? = $ac_status" >&5 + echo "$as_me:14569: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_isascii=yes else @@ -12922,17 +14577,17 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12925: result: $cf_cv_have_isascii" >&5 +echo "$as_me:14580: result: $cf_cv_have_isascii" >&5 echo "${ECHO_T}$cf_cv_have_isascii" >&6 test "$cf_cv_have_isascii" = yes && cat >>confdefs.h <<\EOF #define HAVE_ISASCII 1 EOF if test "$ac_cv_func_sigaction" = yes; then -echo "$as_me:12932: checking whether sigaction needs _POSIX_SOURCE" >&5 +echo "$as_me:14587: checking whether sigaction needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether sigaction needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 12935 "configure" +#line 14590 "configure" #include "confdefs.h" #include @@ -12946,16 +14601,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12949: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14604: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12952: \$? = $ac_status" >&5 + echo "$as_me:14607: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12955: \"$ac_try\"") >&5 + { (eval echo "$as_me:14610: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12958: \$? = $ac_status" >&5 + echo "$as_me:14613: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=no else @@ -12963,7 +14618,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 12966 "configure" +#line 14621 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -12978,16 +14633,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12981: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14636: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12984: \$? = $ac_status" >&5 + echo "$as_me:14639: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12987: \"$ac_try\"") >&5 + { (eval echo "$as_me:14642: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12990: \$? = $ac_status" >&5 + echo "$as_me:14645: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=yes cat >>confdefs.h <<\EOF @@ -13002,11 +14657,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:13005: result: $sigact_bad" >&5 +echo "$as_me:14660: result: $sigact_bad" >&5 echo "${ECHO_T}$sigact_bad" >&6 fi -echo "$as_me:13009: checking if nanosleep really works" >&5 +echo "$as_me:14664: checking if nanosleep really works" >&5 echo $ECHO_N "checking if nanosleep really works... $ECHO_C" >&6 if test "${cf_cv_func_nanosleep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13016,7 +14671,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_nanosleep=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 13019 "configure" +#line 14674 "configure" #include "confdefs.h" #include @@ -13041,15 +14696,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13044: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14699: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13047: \$? = $ac_status" >&5 + echo "$as_me:14702: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13049: \"$ac_try\"") >&5 + { (eval echo "$as_me:14704: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13052: \$? = $ac_status" >&5 + echo "$as_me:14707: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_nanosleep=yes else @@ -13061,7 +14716,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:13064: result: $cf_cv_func_nanosleep" >&5 +echo "$as_me:14719: result: $cf_cv_func_nanosleep" >&5 echo "${ECHO_T}$cf_cv_func_nanosleep" >&6 test "$cf_cv_func_nanosleep" = "yes" && cat >>confdefs.h <<\EOF @@ -13075,23 +14730,23 @@ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:13078: checking for $ac_header" >&5 +echo "$as_me:14733: 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 13084 "configure" +#line 14739 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13088: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14743: \"$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:13094: \$? = $ac_status" >&5 + echo "$as_me:14749: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13110,7 +14765,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13113: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:14768: 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 <&5 +echo "$as_me:14783: 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 13134 "configure" +#line 14789 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13138: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14793: \"$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:13144: \$? = $ac_status" >&5 + echo "$as_me:14799: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13160,7 +14815,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13163: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:14818: 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 <&5 + echo "$as_me:14836: checking whether termios.h needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 13184 "configure" +#line 14839 "configure" #include "confdefs.h" #include int @@ -13193,16 +14848,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13196: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14851: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13199: \$? = $ac_status" >&5 + echo "$as_me:14854: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13202: \"$ac_try\"") >&5 + { (eval echo "$as_me:14857: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13205: \$? = $ac_status" >&5 + echo "$as_me:14860: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=no else @@ -13210,7 +14865,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13213 "configure" +#line 14868 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -13224,16 +14879,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13227: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14882: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13230: \$? = $ac_status" >&5 + echo "$as_me:14885: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13233: \"$ac_try\"") >&5 + { (eval echo "$as_me:14888: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13236: \$? = $ac_status" >&5 + echo "$as_me:14891: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=unknown else @@ -13248,19 +14903,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:13251: result: $termios_bad" >&5 + echo "$as_me:14906: result: $termios_bad" >&5 echo "${ECHO_T}$termios_bad" >&6 fi fi -echo "$as_me:13256: checking for tcgetattr" >&5 +echo "$as_me:14911: checking for tcgetattr" >&5 echo $ECHO_N "checking for tcgetattr... $ECHO_C" >&6 if test "${cf_cv_have_tcgetattr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13263 "configure" +#line 14918 "configure" #include "confdefs.h" #include @@ -13288,16 +14943,16 @@ tcgetattr(1, &foo); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13291: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14946: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13294: \$? = $ac_status" >&5 + echo "$as_me:14949: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13297: \"$ac_try\"") >&5 + { (eval echo "$as_me:14952: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13300: \$? = $ac_status" >&5 + echo "$as_me:14955: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_tcgetattr=yes else @@ -13307,20 +14962,20 @@ cf_cv_have_tcgetattr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13310: result: $cf_cv_have_tcgetattr" >&5 +echo "$as_me:14965: result: $cf_cv_have_tcgetattr" >&5 echo "${ECHO_T}$cf_cv_have_tcgetattr" >&6 test "$cf_cv_have_tcgetattr" = yes && cat >>confdefs.h <<\EOF #define HAVE_TCGETATTR 1 EOF -echo "$as_me:13316: checking for vsscanf function or workaround" >&5 +echo "$as_me:14971: checking for vsscanf function or workaround" >&5 echo $ECHO_N "checking for vsscanf function or workaround... $ECHO_C" >&6 if test "${cf_cv_func_vsscanf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13323 "configure" +#line 14978 "configure" #include "confdefs.h" #include @@ -13336,16 +14991,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13339: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14994: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13342: \$? = $ac_status" >&5 + echo "$as_me:14997: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13345: \"$ac_try\"") >&5 + { (eval echo "$as_me:15000: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13348: \$? = $ac_status" >&5 + echo "$as_me:15003: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vsscanf else @@ -13353,7 +15008,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13356 "configure" +#line 15011 "configure" #include "confdefs.h" #include @@ -13375,16 +15030,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13378: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15033: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13381: \$? = $ac_status" >&5 + echo "$as_me:15036: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13384: \"$ac_try\"") >&5 + { (eval echo "$as_me:15039: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13387: \$? = $ac_status" >&5 + echo "$as_me:15042: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vfscanf else @@ -13392,7 +15047,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13395 "configure" +#line 15050 "configure" #include "confdefs.h" #include @@ -13414,16 +15069,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13417: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15072: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13420: \$? = $ac_status" >&5 + echo "$as_me:15075: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13423: \"$ac_try\"") >&5 + { (eval echo "$as_me:15078: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13426: \$? = $ac_status" >&5 + echo "$as_me:15081: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=_doscan else @@ -13438,7 +15093,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13441: result: $cf_cv_func_vsscanf" >&5 +echo "$as_me:15096: result: $cf_cv_func_vsscanf" >&5 echo "${ECHO_T}$cf_cv_func_vsscanf" >&6 case $cf_cv_func_vsscanf in #(vi @@ -13456,21 +15111,21 @@ EOF ;; esac -echo "$as_me:13459: checking for working mkstemp" >&5 +echo "$as_me:15114: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -rm -f conftest* +rm -rf conftest* if test "$cross_compiling" = yes; then - echo "$as_me:13467: checking for mkstemp" >&5 + echo "$as_me:15122: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13473 "configure" +#line 15128 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -13501,16 +15156,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13504: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15159: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13507: \$? = $ac_status" >&5 + echo "$as_me:15162: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13510: \"$ac_try\"") >&5 + { (eval echo "$as_me:15165: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13513: \$? = $ac_status" >&5 + echo "$as_me:15168: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -13520,12 +15175,12 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13523: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:15178: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13528 "configure" +#line 15183 "configure" #include "confdefs.h" #include @@ -13563,15 +15218,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13566: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15221: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13569: \$? = $ac_status" >&5 + echo "$as_me:15224: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13571: \"$ac_try\"") >&5 + { (eval echo "$as_me:15226: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13574: \$? = $ac_status" >&5 + echo "$as_me:15229: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -13586,9 +15241,9 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:13589: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:15244: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 -if test "$cf_cv_func_mkstemp" = yes ; then +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF #define HAVE_MKSTEMP 1 EOF @@ -13604,21 +15259,21 @@ else fi if test "$cross_compiling" = yes ; then - { echo "$as_me:13607: WARNING: cross compiling: assume setvbuf params not reversed" >&5 + { echo "$as_me:15262: WARNING: cross compiling: assume setvbuf params not reversed" >&5 echo "$as_me: WARNING: cross compiling: assume setvbuf params not reversed" >&2;} else - echo "$as_me:13610: checking whether setvbuf arguments are reversed" >&5 + echo "$as_me:15265: checking whether setvbuf arguments are reversed" >&5 echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6 if test "${ac_cv_func_setvbuf_reversed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:13616: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:15271: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 13621 "configure" +#line 15276 "configure" #include "confdefs.h" #include /* If setvbuf has the reversed format, exit 0. */ @@ -13635,15 +15290,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13638: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15293: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13641: \$? = $ac_status" >&5 + echo "$as_me:15296: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13643: \"$ac_try\"") >&5 + { (eval echo "$as_me:15298: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13646: \$? = $ac_status" >&5 + echo "$as_me:15301: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setvbuf_reversed=yes else @@ -13656,7 +15311,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f core core.* *.core fi -echo "$as_me:13659: result: $ac_cv_func_setvbuf_reversed" >&5 +echo "$as_me:15314: result: $ac_cv_func_setvbuf_reversed" >&5 echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6 if test $ac_cv_func_setvbuf_reversed = yes; then @@ -13667,13 +15322,13 @@ EOF fi fi -echo "$as_me:13670: checking return type of signal handlers" >&5 +echo "$as_me:15325: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13676 "configure" +#line 15331 "configure" #include "confdefs.h" #include #include @@ -13695,16 +15350,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13698: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15353: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13701: \$? = $ac_status" >&5 + echo "$as_me:15356: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13704: \"$ac_try\"") >&5 + { (eval echo "$as_me:15359: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13707: \$? = $ac_status" >&5 + echo "$as_me:15362: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else @@ -13714,21 +15369,21 @@ ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13717: result: $ac_cv_type_signal" >&5 +echo "$as_me:15372: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 +echo "$as_me:15379: checking for type sigaction_t" >&5 echo $ECHO_N "checking for type sigaction_t... $ECHO_C" >&6 if test "${cf_cv_type_sigaction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13731 "configure" +#line 15386 "configure" #include "confdefs.h" #include @@ -13741,16 +15396,16 @@ sigaction_t x } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13744: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15399: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13747: \$? = $ac_status" >&5 + echo "$as_me:15402: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13750: \"$ac_try\"") >&5 + { (eval echo "$as_me:15405: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13753: \$? = $ac_status" >&5 + echo "$as_me:15408: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_sigaction=yes else @@ -13761,13 +15416,13 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13764: result: $cf_cv_type_sigaction" >&5 +echo "$as_me:15419: result: $cf_cv_type_sigaction" >&5 echo "${ECHO_T}$cf_cv_type_sigaction" >&6 test "$cf_cv_type_sigaction" = yes && cat >>confdefs.h <<\EOF #define HAVE_TYPE_SIGACTION 1 EOF -echo "$as_me:13770: checking declaration of size-change" >&5 +echo "$as_me:15425: checking declaration of size-change" >&5 echo $ECHO_N "checking declaration of size-change... $ECHO_C" >&6 if test "${cf_cv_sizechange+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13782,7 +15437,7 @@ do CPPFLAGS="$cf_save_CPPFLAGS" test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" cat >conftest.$ac_ext <<_ACEOF -#line 13785 "configure" +#line 15440 "configure" #include "confdefs.h" #include #ifdef HAVE_TERMIOS_H @@ -13826,16 +15481,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13829: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15484: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13832: \$? = $ac_status" >&5 + echo "$as_me:15487: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13835: \"$ac_try\"") >&5 + { (eval echo "$as_me:15490: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13838: \$? = $ac_status" >&5 + echo "$as_me:15493: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sizechange=yes else @@ -13854,7 +15509,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:13857: result: $cf_cv_sizechange" >&5 +echo "$as_me:15512: result: $cf_cv_sizechange" >&5 echo "${ECHO_T}$cf_cv_sizechange" >&6 if test "$cf_cv_sizechange" != no ; then cat >>confdefs.h <<\EOF @@ -13871,13 +15526,13 @@ EOF esac fi -echo "$as_me:13874: checking for memmove" >&5 +echo "$as_me:15529: checking for memmove" >&5 echo $ECHO_N "checking for memmove... $ECHO_C" >&6 if test "${ac_cv_func_memmove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13880 "configure" +#line 15535 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memmove (); below. */ @@ -13908,16 +15563,16 @@ f = memmove; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13911: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15566: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13914: \$? = $ac_status" >&5 + echo "$as_me:15569: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13917: \"$ac_try\"") >&5 + { (eval echo "$as_me:15572: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13920: \$? = $ac_status" >&5 + echo "$as_me:15575: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memmove=yes else @@ -13927,19 +15582,19 @@ ac_cv_func_memmove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13930: result: $ac_cv_func_memmove" >&5 +echo "$as_me:15585: result: $ac_cv_func_memmove" >&5 echo "${ECHO_T}$ac_cv_func_memmove" >&6 if test $ac_cv_func_memmove = yes; then : else -echo "$as_me:13936: checking for bcopy" >&5 +echo "$as_me:15591: checking for bcopy" >&5 echo $ECHO_N "checking for bcopy... $ECHO_C" >&6 if test "${ac_cv_func_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13942 "configure" +#line 15597 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bcopy (); below. */ @@ -13970,16 +15625,16 @@ f = bcopy; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13973: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15628: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13976: \$? = $ac_status" >&5 + echo "$as_me:15631: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13979: \"$ac_try\"") >&5 + { (eval echo "$as_me:15634: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13982: \$? = $ac_status" >&5 + echo "$as_me:15637: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_bcopy=yes else @@ -13989,11 +15644,11 @@ ac_cv_func_bcopy=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13992: result: $ac_cv_func_bcopy" >&5 +echo "$as_me:15647: result: $ac_cv_func_bcopy" >&5 echo "${ECHO_T}$ac_cv_func_bcopy" >&6 if test $ac_cv_func_bcopy = yes; then - echo "$as_me:13996: checking if bcopy does overlapping moves" >&5 + echo "$as_me:15651: checking if bcopy does overlapping moves" >&5 echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6 if test "${cf_cv_good_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14003,7 +15658,7 @@ else cf_cv_good_bcopy=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14006 "configure" +#line 15661 "configure" #include "confdefs.h" int main() { @@ -14017,15 +15672,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14020: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15675: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14023: \$? = $ac_status" >&5 + echo "$as_me:15678: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14025: \"$ac_try\"") >&5 + { (eval echo "$as_me:15680: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14028: \$? = $ac_status" >&5 + echo "$as_me:15683: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_good_bcopy=yes else @@ -14038,7 +15693,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14041: result: $cf_cv_good_bcopy" >&5 +echo "$as_me:15696: result: $cf_cv_good_bcopy" >&5 echo "${ECHO_T}$cf_cv_good_bcopy" >&6 else @@ -14059,7 +15714,7 @@ EOF fi -echo "$as_me:14062: checking if poll really works" >&5 +echo "$as_me:15717: checking if poll really works" >&5 echo $ECHO_N "checking if poll really works... $ECHO_C" >&6 if test "${cf_cv_working_poll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14069,7 +15724,7 @@ if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14072 "configure" +#line 15727 "configure" #include "confdefs.h" #include @@ -14090,15 +15745,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15748: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14096: \$? = $ac_status" >&5 + echo "$as_me:15751: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14098: \"$ac_try\"") >&5 + { (eval echo "$as_me:15753: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14101: \$? = $ac_status" >&5 + echo "$as_me:15756: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_working_poll=yes else @@ -14110,15 +15765,505 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14113: result: $cf_cv_working_poll" >&5 +echo "$as_me:15768: result: $cf_cv_working_poll" >&5 echo "${ECHO_T}$cf_cv_working_poll" >&6 test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_WORKING_POLL 1 EOF +echo "$as_me:15774: checking for va_copy" >&5 +echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 +if test "${cf_cv_have_va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 15781 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + static va_list dst; + static va_list src; + va_copy(dst, src) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:15798: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:15801: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:15804: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15807: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_va_copy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_va_copy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:15817: result: $cf_cv_have_va_copy" >&5 +echo "${ECHO_T}$cf_cv_have_va_copy" >&6 + +test "$cf_cv_have_va_copy" = yes && cat >>confdefs.h <<\EOF +#define HAVE_VA_COPY 1 +EOF + +echo "$as_me:15824: checking for __va_copy" >&5 +echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6 +if test "${cf_cv_have___va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 15831 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + static va_list dst; + static va_list src; + __va_copy(dst, src) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:15848: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:15851: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:15854: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15857: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have___va_copy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have___va_copy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:15867: result: $cf_cv_have___va_copy" >&5 +echo "${ECHO_T}$cf_cv_have___va_copy" >&6 + +test "$cf_cv_have___va_copy" = yes && cat >>confdefs.h <<\EOF +#define HAVE___VA_COPY 1 +EOF + +echo "$as_me:15874: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 15880 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:15895: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:15898: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:15901: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15904: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_pid_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:15914: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <&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 15935 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:15939: \"$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:15945: \$? = $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:15964: 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 <&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 15983 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* 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 $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:16014: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16017: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:16020: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16023: \$? = $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:16033: 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 <&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6 +if test "${ac_cv_func_fork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_fork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* By Rüdiger Kuhlmann. */ + #include + #if HAVE_UNISTD_H + # include + #endif + /* Some systems only have a dummy stub for fork() */ + int main () + { + if (fork() < 0) + $ac_main_return (1); + $ac_main_return (0); + } +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:16068: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16071: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:16073: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16076: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_fork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:16088: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6 + +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { echo "$as_me:16102: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + echo "$as_me:16107: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 +if test "${ac_cv_func_vfork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_vfork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +#line 16116 "configure" +#include "confdefs.h" +/* Thanks to Paul Eggert for this test. */ +#include +#include +#include +#if HAVE_UNISTD_H +# include +#endif +#if HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + $ac_main_return( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:16213: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16216: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:16218: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16221: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_vfork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_vfork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:16233: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=ac_cv_func_vfork + { echo "$as_me:16239: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_VFORK 1 +EOF + +else + +cat >>confdefs.h <<\EOF +#define vfork fork +EOF + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_FORK 1 +EOF + +fi + # special check for test/ditto.c -echo "$as_me:14121: checking for openpty in -lutil" >&5 +echo "$as_me:16266: 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 @@ -14126,7 +16271,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14129 "configure" +#line 16274 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -14145,16 +16290,16 @@ openpty (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14148: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16293: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14151: \$? = $ac_status" >&5 + echo "$as_me:16296: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14154: \"$ac_try\"") >&5 + { (eval echo "$as_me:16299: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14157: \$? = $ac_status" >&5 + echo "$as_me:16302: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_util_openpty=yes else @@ -14165,7 +16310,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:14168: result: $ac_cv_lib_util_openpty" >&5 +echo "$as_me:16313: 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 @@ -14173,7 +16318,7 @@ else cf_cv_lib_util=no fi -echo "$as_me:14176: checking for openpty header" >&5 +echo "$as_me:16321: 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 @@ -14184,7 +16329,7 @@ else for cf_header in pty.h libutil.h util.h do cat >conftest.$ac_ext <<_ACEOF -#line 14187 "configure" +#line 16332 "configure" #include "confdefs.h" #include <$cf_header> @@ -14201,16 +16346,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14204: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16349: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14207: \$? = $ac_status" >&5 + echo "$as_me:16352: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14210: \"$ac_try\"") >&5 + { (eval echo "$as_me:16355: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14213: \$? = $ac_status" >&5 + echo "$as_me:16358: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_openpty=$cf_header @@ -14228,7 +16373,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" fi -echo "$as_me:14231: result: $cf_cv_func_openpty" >&5 +echo "$as_me:16376: result: $cf_cv_func_openpty" >&5 echo "${ECHO_T}$cf_cv_func_openpty" >&6 if test "$cf_cv_func_openpty" != no ; then @@ -14274,13 +16419,13 @@ if test -n "$with_hashed_db/include" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; 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 14283 "configure" +#line 16428 "configure" #include "confdefs.h" #include int @@ -14292,16 +16437,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14295: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16440: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14298: \$? = $ac_status" >&5 + echo "$as_me:16443: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14301: \"$ac_try\"") >&5 + { (eval echo "$as_me:16446: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14304: \$? = $ac_status" >&5 + echo "$as_me:16449: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -14318,13 +16463,13 @@ 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}:14321: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:16466: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + 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" + 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 @@ -14352,7 +16497,7 @@ if test -n "$with_hashed_db/lib" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me-configure}:14355: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:16500: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -14363,23 +16508,23 @@ fi fi esac -echo "$as_me:14366: checking for db.h" >&5 +echo "$as_me:16511: checking for db.h" >&5 echo $ECHO_N "checking for db.h... $ECHO_C" >&6 if test "${ac_cv_header_db_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14372 "configure" +#line 16517 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:14376: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:16521: \"$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:14382: \$? = $ac_status" >&5 + echo "$as_me:16527: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -14398,11 +16543,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:14401: result: $ac_cv_header_db_h" >&5 +echo "$as_me:16546: result: $ac_cv_header_db_h" >&5 echo "${ECHO_T}$ac_cv_header_db_h" >&6 if test $ac_cv_header_db_h = yes; then -echo "$as_me:14405: checking for version of db" >&5 +echo "$as_me:16550: checking for version of db" >&5 echo $ECHO_N "checking for version of db... $ECHO_C" >&6 if test "${cf_cv_hashed_db_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14413,10 +16558,10 @@ cf_cv_hashed_db_version=unknown for cf_db_version in 1 2 3 4 5 do -echo "${as_me-configure}:14416: testing checking for db version $cf_db_version ..." 1>&5 +echo "${as_me:-configure}:16561: testing checking for db version $cf_db_version ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 14419 "configure" +#line 16564 "configure" #include "confdefs.h" $ac_includes_default @@ -14446,16 +16591,16 @@ DBT *foo = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14449: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16594: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14452: \$? = $ac_status" >&5 + echo "$as_me:16597: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14455: \"$ac_try\"") >&5 + { (eval echo "$as_me:16600: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14458: \$? = $ac_status" >&5 + echo "$as_me:16603: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_hashed_db_version=$cf_db_version @@ -14469,16 +16614,16 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:14472: result: $cf_cv_hashed_db_version" >&5 +echo "$as_me:16617: result: $cf_cv_hashed_db_version" >&5 echo "${ECHO_T}$cf_cv_hashed_db_version" >&6 if test "$cf_cv_hashed_db_version" = unknown ; then - { { echo "$as_me:14476: error: Cannot determine version of db" >&5 + { { echo "$as_me:16621: error: Cannot determine version of db" >&5 echo "$as_me: error: Cannot determine version of db" >&2;} { (exit 1); exit 1; }; } else -echo "$as_me:14481: checking for db libraries" >&5 +echo "$as_me:16626: checking for db libraries" >&5 echo $ECHO_N "checking for db libraries... $ECHO_C" >&6 if test "${cf_cv_hashed_db_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14492,10 +16637,10 @@ do LIBS="-l$cf_db_libs $LIBS" fi -echo "${as_me-configure}:14495: testing checking for library "$cf_db_libs" ..." 1>&5 +echo "${as_me:-configure}:16640: testing checking for library "$cf_db_libs" ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 14498 "configure" +#line 16643 "configure" #include "confdefs.h" $ac_includes_default @@ -14550,16 +16695,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14553: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16698: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14556: \$? = $ac_status" >&5 + echo "$as_me:16701: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14559: \"$ac_try\"") >&5 + { (eval echo "$as_me:16704: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14562: \$? = $ac_status" >&5 + echo "$as_me:16707: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test -n "$cf_db_libs" ; then @@ -14579,11 +16724,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi -echo "$as_me:14582: result: $cf_cv_hashed_db_libs" >&5 +echo "$as_me:16727: result: $cf_cv_hashed_db_libs" >&5 echo "${ECHO_T}$cf_cv_hashed_db_libs" >&6 if test "$cf_cv_hashed_db_libs" = unknown ; then - { { echo "$as_me:14586: error: Cannot determine library for db" >&5 + { { echo "$as_me:16731: error: Cannot determine library for db" >&5 echo "$as_me: error: Cannot determine library for db" >&2;} { (exit 1); exit 1; }; } elif test "$cf_cv_hashed_db_libs" != default ; then @@ -14593,7 +16738,7 @@ fi else - { { echo "$as_me:14596: error: Cannot find db.h" >&5 + { { echo "$as_me:16741: error: Cannot find db.h" >&5 echo "$as_me: error: Cannot find db.h" >&2;} { (exit 1); exit 1; }; } @@ -14608,7 +16753,7 @@ fi # Just in case, check if the C compiler has a bool type. -echo "$as_me:14611: checking if we should include stdbool.h" >&5 +echo "$as_me:16756: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -14616,7 +16761,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 14619 "configure" +#line 16764 "configure" #include "confdefs.h" int @@ -14628,23 +16773,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14631: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16776: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14634: \$? = $ac_status" >&5 + echo "$as_me:16779: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14637: \"$ac_try\"") >&5 + { (eval echo "$as_me:16782: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14640: \$? = $ac_status" >&5 + echo "$as_me:16785: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14647 "configure" +#line 16792 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -14660,16 +16805,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16808: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14666: \$? = $ac_status" >&5 + echo "$as_me:16811: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14669: \"$ac_try\"") >&5 + { (eval echo "$as_me:16814: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14672: \$? = $ac_status" >&5 + echo "$as_me:16817: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -14683,13 +16828,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:14686: result: yes" >&5 +then echo "$as_me:16831: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:14688: result: no" >&5 +else echo "$as_me:16833: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:14692: checking for builtin bool type" >&5 +echo "$as_me:16837: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_cc_bool_type+set}" = set; then @@ -14697,7 +16842,7 @@ if test "${cf_cv_cc_bool_type+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 14700 "configure" +#line 16845 "configure" #include "confdefs.h" #include @@ -14712,16 +16857,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14715: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16860: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14718: \$? = $ac_status" >&5 + echo "$as_me:16863: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14721: \"$ac_try\"") >&5 + { (eval echo "$as_me:16866: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14724: \$? = $ac_status" >&5 + echo "$as_me:16869: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cc_bool_type=1 else @@ -14734,9 +16879,9 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_cc_bool_type" = 1 -then echo "$as_me:14737: result: yes" >&5 +then echo "$as_me:16882: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:14739: result: no" >&5 +else echo "$as_me:16884: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14758,16 +16903,16 @@ os2*) #(vi cf_stdcpp_libname=stdc++ ;; esac -echo "$as_me:14761: checking for library $cf_stdcpp_libname" >&5 +echo "$as_me:16906: checking for library $cf_stdcpp_libname" >&5 echo $ECHO_N "checking for library $cf_stdcpp_libname... $ECHO_C" >&6 if test "${cf_cv_libstdcpp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + LIBS="-l$cf_stdcpp_libname $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14770 "configure" +#line 16915 "configure" #include "confdefs.h" #include @@ -14783,16 +16928,16 @@ strstreambuf foo(buf, sizeof(buf)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14786: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16931: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14789: \$? = $ac_status" >&5 + echo "$as_me:16934: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14792: \"$ac_try\"") >&5 + { (eval echo "$as_me:16937: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14795: \$? = $ac_status" >&5 + echo "$as_me:16940: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_libstdcpp=yes else @@ -14804,12 +16949,12 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" fi -echo "$as_me:14807: result: $cf_cv_libstdcpp" >&5 +echo "$as_me:16952: result: $cf_cv_libstdcpp" >&5 echo "${ECHO_T}$cf_cv_libstdcpp" >&6 -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CXXLIBS="-l$cf_stdcpp_libname $CXXLIBS" fi - echo "$as_me:14812: checking whether $CXX understands -c and -o together" >&5 + echo "$as_me:16957: checking whether $CXX understands -c and -o together" >&5 echo $ECHO_N "checking whether $CXX understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CXX_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14825,29 +16970,29 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CXX -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:14828: \"$ac_try\"") >&5 +if { (eval echo "$as_me:16973: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14831: \$? = $ac_status" >&5 + echo "$as_me:16976: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:14833: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:16978: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14836: \$? = $ac_status" >&5 + echo "$as_me:16981: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CXX_c_o=yes else eval cf_cv_prog_CXX_c_o=no fi -rm -f conftest* +rm -rf conftest* fi if test $cf_cv_prog_CXX_c_o = yes; then - echo "$as_me:14847: result: yes" >&5 + echo "$as_me:16992: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:14850: result: no" >&5 + echo "$as_me:16995: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14867,12 +17012,12 @@ os2*) #(vi ;; esac if test "$GXX" = yes; then - echo "$as_me:14870: checking for lib$cf_gpp_libname" >&5 + echo "$as_me:17015: checking for lib$cf_gpp_libname" >&5 echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6 cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" + LIBS="-l$cf_gpp_libname $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14875 "configure" +#line 17020 "configure" #include "confdefs.h" #include <$cf_gpp_libname/builtin.h> @@ -14886,19 +17031,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14889: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17034: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14892: \$? = $ac_status" >&5 + echo "$as_me:17037: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14895: \"$ac_try\"") >&5 + { (eval echo "$as_me:17040: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14898: \$? = $ac_status" >&5 + echo "$as_me:17043: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CXXLIBS="-l$cf_gpp_libname $CXXLIBS" if test "$cf_gpp_libname" = cpp ; then cat >>confdefs.h <<\EOF #define HAVE_GPP_BUILTIN_H 1 @@ -14914,7 +17059,7 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14917 "configure" +#line 17062 "configure" #include "confdefs.h" #include @@ -14928,19 +17073,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14931: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17076: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14934: \$? = $ac_status" >&5 + echo "$as_me:17079: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14937: \"$ac_try\"") >&5 + { (eval echo "$as_me:17082: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14940: \$? = $ac_status" >&5 + echo "$as_me:17085: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CXXLIBS="-l$cf_gpp_libname $CXXLIBS" cat >>confdefs.h <<\EOF #define HAVE_BUILTIN_H 1 EOF @@ -14954,7 +17099,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" - echo "$as_me:14957: result: $cf_cxx_library" >&5 + echo "$as_me:17102: result: $cf_cxx_library" >&5 echo "${ECHO_T}$cf_cxx_library" >&6 fi @@ -14970,7 +17115,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return -echo "$as_me:14973: checking how to run the C++ preprocessor" >&5 +echo "$as_me:17118: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then @@ -14987,18 +17132,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 14990 "configure" +#line 17135 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:14995: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17140: \"$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:15001: \$? = $ac_status" >&5 + echo "$as_me:17146: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15021,17 +17166,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 15024 "configure" +#line 17169 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:15028: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17173: \"$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:15034: \$? = $ac_status" >&5 + echo "$as_me:17179: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15068,7 +17213,7 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:15071: result: $CXXCPP" >&5 +echo "$as_me:17216: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes @@ -15078,18 +17223,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 15081 "configure" +#line 17226 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:15086: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17231: \"$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:15092: \$? = $ac_status" >&5 + echo "$as_me:17237: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15112,17 +17257,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 15115 "configure" +#line 17260 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:15119: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17264: \"$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:15125: \$? = $ac_status" >&5 + echo "$as_me:17270: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15150,7 +17295,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:15153: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 + { { echo "$as_me:17298: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -15165,23 +17310,23 @@ ac_main_return=return for ac_header in iostream typeinfo do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:15168: checking for $ac_header" >&5 +echo "$as_me:17313: 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 15174 "configure" +#line 17319 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:15178: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17323: \"$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:15184: \$? = $ac_status" >&5 + echo "$as_me:17329: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15200,7 +17345,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:15203: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:17348: 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 <&5 + echo "$as_me:17359: checking if iostream uses std-namespace" >&5 echo $ECHO_N "checking if iostream uses std-namespace... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 15217 "configure" +#line 17362 "configure" #include "confdefs.h" #include @@ -15231,16 +17376,16 @@ cerr << "testing" << endl; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15234: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17379: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15237: \$? = $ac_status" >&5 + echo "$as_me:17382: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15240: \"$ac_try\"") >&5 + { (eval echo "$as_me:17385: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15243: \$? = $ac_status" >&5 + echo "$as_me:17388: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_iostream_namespace=yes else @@ -15249,7 +17394,7 @@ cat conftest.$ac_ext >&5 cf_iostream_namespace=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:15252: result: $cf_iostream_namespace" >&5 + echo "$as_me:17397: result: $cf_iostream_namespace" >&5 echo "${ECHO_T}$cf_iostream_namespace" >&6 if test "$cf_iostream_namespace" = yes ; then cat >>confdefs.h <<\EOF @@ -15259,7 +17404,7 @@ EOF fi fi -echo "$as_me:15262: checking if we should include stdbool.h" >&5 +echo "$as_me:17407: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -15267,7 +17412,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 15270 "configure" +#line 17415 "configure" #include "confdefs.h" int @@ -15279,23 +17424,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15282: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17427: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15285: \$? = $ac_status" >&5 + echo "$as_me:17430: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15288: \"$ac_try\"") >&5 + { (eval echo "$as_me:17433: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15291: \$? = $ac_status" >&5 + echo "$as_me:17436: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 15298 "configure" +#line 17443 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -15311,16 +17456,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15314: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17459: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15317: \$? = $ac_status" >&5 + echo "$as_me:17462: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15320: \"$ac_try\"") >&5 + { (eval echo "$as_me:17465: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15323: \$? = $ac_status" >&5 + echo "$as_me:17468: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -15334,13 +17479,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:15337: result: yes" >&5 +then echo "$as_me:17482: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:15339: result: no" >&5 +else echo "$as_me:17484: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:15343: checking for builtin bool type" >&5 +echo "$as_me:17488: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_builtin_bool+set}" = set; then @@ -15348,7 +17493,7 @@ if test "${cf_cv_builtin_bool+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 15351 "configure" +#line 17496 "configure" #include "confdefs.h" #include @@ -15363,16 +17508,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15366: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17511: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15369: \$? = $ac_status" >&5 + echo "$as_me:17514: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15372: \"$ac_try\"") >&5 + { (eval echo "$as_me:17517: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15375: \$? = $ac_status" >&5 + echo "$as_me:17520: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_builtin_bool=1 else @@ -15385,13 +17530,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_builtin_bool" = 1 -then echo "$as_me:15388: result: yes" >&5 +then echo "$as_me:17533: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:15390: result: no" >&5 +else echo "$as_me:17535: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:15394: checking for size of bool" >&5 +echo "$as_me:17539: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15402,7 +17547,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15405 "configure" +#line 17550 "configure" #include "confdefs.h" #include @@ -15444,15 +17589,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15447: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17592: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15450: \$? = $ac_status" >&5 + echo "$as_me:17595: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15452: \"$ac_try\"") >&5 + { (eval echo "$as_me:17597: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15455: \$? = $ac_status" >&5 + echo "$as_me:17600: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -15470,18 +17615,18 @@ fi fi rm -f cf_test.out -echo "$as_me:15473: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:17618: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:15479: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:17624: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi -echo "$as_me:15484: checking for special defines needed for etip.h" >&5 +echo "$as_me:17629: checking for special defines needed for etip.h" >&5 echo $ECHO_N "checking for special defines needed for etip.h... $ECHO_C" >&6 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" @@ -15493,7 +17638,7 @@ do test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" cat >conftest.$ac_ext <<_ACEOF -#line 15496 "configure" +#line 17641 "configure" #include "confdefs.h" #include @@ -15507,16 +17652,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15510: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17655: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15513: \$? = $ac_status" >&5 + echo "$as_me:17658: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15516: \"$ac_try\"") >&5 + { (eval echo "$as_me:17661: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15519: \$? = $ac_status" >&5 + echo "$as_me:17664: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$cf_math" && cat >>confdefs.h <&5 +echo "$as_me:17685: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 CXXFLAGS="$cf_save_CXXFLAGS" if test -n "$CXX"; then -echo "$as_me:15545: checking if $CXX accepts parameter initialization" >&5 +echo "$as_me:17690: checking if $CXX accepts parameter initialization" >&5 echo $ECHO_N "checking if $CXX accepts parameter initialization... $ECHO_C" >&6 if test "${cf_cv_cpp_param_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15559,7 +17704,7 @@ ac_main_return=return cf_cv_cpp_param_init=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15562 "configure" +#line 17707 "configure" #include "confdefs.h" class TEST { @@ -15578,15 +17723,15 @@ void main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15581: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17726: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15584: \$? = $ac_status" >&5 + echo "$as_me:17729: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15586: \"$ac_try\"") >&5 + { (eval echo "$as_me:17731: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15589: \$? = $ac_status" >&5 + echo "$as_me:17734: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_param_init=yes else @@ -15605,7 +17750,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:15608: result: $cf_cv_cpp_param_init" >&5 +echo "$as_me:17753: result: $cf_cv_cpp_param_init" >&5 echo "${ECHO_T}$cf_cv_cpp_param_init" >&6 fi test "$cf_cv_cpp_param_init" = yes && cat >>confdefs.h <<\EOF @@ -15614,7 +17759,7 @@ EOF if test -n "$CXX"; then -echo "$as_me:15617: checking if $CXX accepts static_cast" >&5 +echo "$as_me:17762: checking if $CXX accepts static_cast" >&5 echo $ECHO_N "checking if $CXX accepts static_cast... $ECHO_C" >&6 if test "${cf_cv_cpp_static_cast+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15628,7 +17773,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat >conftest.$ac_ext <<_ACEOF -#line 15631 "configure" +#line 17776 "configure" #include "confdefs.h" class NCursesPanel @@ -15672,16 +17817,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15675: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17820: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15678: \$? = $ac_status" >&5 + echo "$as_me:17823: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15681: \"$ac_try\"") >&5 + { (eval echo "$as_me:17826: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15684: \$? = $ac_status" >&5 + echo "$as_me:17829: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_static_cast=yes else @@ -15699,7 +17844,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:15702: result: $cf_cv_cpp_static_cast" >&5 +echo "$as_me:17847: result: $cf_cv_cpp_static_cast" >&5 echo "${ECHO_T}$cf_cv_cpp_static_cast" >&6 fi @@ -15709,12 +17854,12 @@ test "$cf_cv_cpp_static_cast" = yes && cat >>confdefs.h <<\EOF EOF CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' + CXX_ARFLAGS='$(ARFLAGS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-ar -o' + CXX_ARFLAGS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -15723,7 +17868,7 @@ EOF solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-xar -o' + CXX_ARFLAGS='-xar -o' fi ;; esac @@ -15747,7 +17892,7 @@ else else if test "$cf_cv_header_stdbool_h" = 1 ; then -echo "$as_me:15750: checking for size of bool" >&5 +echo "$as_me:17895: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15758,7 +17903,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15761 "configure" +#line 17906 "configure" #include "confdefs.h" #include @@ -15800,15 +17945,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15803: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17948: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15806: \$? = $ac_status" >&5 + echo "$as_me:17951: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15808: \"$ac_try\"") >&5 + { (eval echo "$as_me:17953: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15811: \$? = $ac_status" >&5 + echo "$as_me:17956: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -15826,25 +17971,25 @@ fi fi rm -f cf_test.out -echo "$as_me:15829: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:17974: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:15835: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:17980: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi else - echo "$as_me:15841: checking for fallback type of bool" >&5 + echo "$as_me:17986: checking for fallback type of bool" >&5 echo $ECHO_N "checking for fallback type of bool... $ECHO_C" >&6 case "$host_cpu" in #(vi i?86) cf_cv_type_of_bool=char ;; #(vi *) cf_cv_type_of_bool=int ;; esac - echo "$as_me:15847: result: $cf_cv_type_of_bool" >&5 + echo "$as_me:17992: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 fi fi @@ -15871,19 +18016,20 @@ fi if test -f "${srcdir}/Ada95/Makefile.in" ; then -if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - { echo "$as_me:15876: WARNING: libtool does not support Ada - disabling feature" >&5 + if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + { echo "$as_me:18021: WARNING: libtool does not support Ada - disabling feature" >&5 echo "$as_me: WARNING: libtool does not support Ada - disabling feature" >&2;} - cf_with_ada=no - fi -fi + cf_with_ada=no + fi + fi + + if test "$cf_with_ada" != "no" ; then -if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 -echo "$as_me:15886: checking for $ac_word" >&5 +echo "$as_me:18032: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15898,7 +18044,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_gnat_exists="yes" -echo "$as_me:15901: found $ac_dir/$ac_word" >&5 +echo "$as_me:18047: found $ac_dir/$ac_word" >&5 break done @@ -15907,10 +18053,10 @@ fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$as_me:15910: result: $gnat_exists" >&5 + echo "$as_me:18056: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else - echo "$as_me:15913: result: no" >&5 + echo "$as_me:18059: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15918,34 +18064,79 @@ if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else -echo "$as_me:15921: checking for gnat version" >&5 +echo "$as_me:18067: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 -cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ - sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:15925: result: $cf_gnat_version" >&5 +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[0-9].[0-9][0-9]*' |\ + sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` +echo "$as_me:18072: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 -case $cf_gnat_version in - 3.1[1-9]*|3.[2-9]*|[4-9].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; +case $cf_gnat_version in #(vi +3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + { echo "$as_me:18080: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 +echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} + cf_cv_prog_gnat_correct=no + ;; esac -case $cf_gnat_version in - 3.[1-9]*|[4-9].*) - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; + +echo "$as_me:18086: checking if GNAT supports generics" >&5 +echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[1-9]*|[4-9].*) #(vi + cf_gnat_generics=yes + ;; +*) + cf_gnat_generics=no + ;; esac +echo "$as_me:18096: result: $cf_gnat_generics" >&5 +echo "${ECHO_T}$cf_gnat_generics" >&6 + +if test "$cf_gnat_generics" = yes +then + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" +else + cf_compile_generics= + cf_generic_objects= +fi + +echo "$as_me:18108: checking if GNAT supports project files" >&5 +echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[0-9]*) #(vi + cf_gnat_projects=no + ;; +*) + case $cf_cv_system_name in #(vi + cygwin*) #(vi + cf_gnat_projects=no + ;; + *) + cf_gnat_projects=yes + ;; + esac + ;; +esac +echo "$as_me:18125: result: $cf_gnat_projects" >&5 +echo "${ECHO_T}$cf_gnat_projects" >&6 + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:15948: checking for $ac_word" >&5 +echo "$as_me:18139: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15960,7 +18151,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_M4_exists="yes" -echo "$as_me:15963: found $ac_dir/$ac_word" >&5 +echo "$as_me:18154: found $ac_dir/$ac_word" >&5 break done @@ -15969,10 +18160,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:15972: result: $M4_exists" >&5 + echo "$as_me:18163: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:15975: result: no" >&5 + echo "$as_me:18166: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15981,10 +18172,10 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:15984: checking if GNAT works" >&5 + echo "$as_me:18175: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 -rm -f conftest* +rm -rf conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_prog_gnat_correct=no fi -rm -f conftest* +rm -rf conftest* - echo "$as_me:16012: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:18203: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - echo "$as_me:16019: checking if GNAT pragma Unreferenced works" >&5 + if test "$cf_cv_prog_gnat_correct" = yes; then + + ADAFLAGS="$ADAFLAGS -O3 -gnatpn" + +echo "$as_me:18212: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 +if test "${cf_cv_pragma_unreferenced+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -rm -f conftest* +rm -rf conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_pragma_unreferenced=no fi -rm -f conftest* +rm -rf conftest* - echo "$as_me:16046: result: $cf_cv_pragma_unreferenced" >&5 +fi +echo "$as_me:18243: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 - # if the pragma is supported, use it (needed in the Trace code). - if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE - else - PRAGMA_UNREF=FALSE - fi +# if the pragma is supported, use it (needed in the Trace code). +if test $cf_cv_pragma_unreferenced = yes ; then + PRAGMA_UNREF=TRUE +else + PRAGMA_UNREF=FALSE +fi + +echo "$as_me:18253: checking for ada-compiler" >&5 +echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. if test "${with_ada_compiler+set}" = set; then @@ -16061,15 +18261,21 @@ else cf_ada_compiler=gnatmake fi; - cf_ada_package=terminal_interface +echo "$as_me:18264: result: $cf_ada_compiler" >&5 +echo "${ECHO_T}$cf_ada_compiler" >&6 + + cf_ada_package=terminal_interface + +echo "$as_me:18269: checking for ada-include" >&5 +echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. if test "${with_ada_include+set}" = set; then withval="$with_ada_include" else - withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}" -fi; if test -n "$prefix/lib/ada/adainclude" ; then + withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}" +fi; if test -n "$prefix/share/ada/adainclude" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -16096,7 +18302,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:16099: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18305: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -16105,12 +18311,18 @@ esac fi ADA_INCLUDE="$withval" +echo "$as_me:18314: result: $ADA_INCLUDE" >&5 +echo "${ECHO_T}$ADA_INCLUDE" >&6 + +echo "$as_me:18317: checking for ada-objects" >&5 +echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 + # Check whether --with-ada-objects or --without-ada-objects was given. if test "${with_ada_objects+set}" = set; then withval="$with_ada_objects" else - withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}" + withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}" fi; if test -n "$prefix/lib/ada/adalib" ; then if test "x$prefix" != xNONE; then @@ -16138,7 +18350,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:16141: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18353: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -16147,10 +18359,38 @@ esac fi ADA_OBJECTS="$withval" -fi -fi +echo "$as_me:18362: result: $ADA_OBJECTS" >&5 +echo "${ECHO_T}$ADA_OBJECTS" >&6 + +echo "$as_me:18365: checking if an Ada95 shared-library should be built" >&5 +echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 + +# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. +if test "${with_ada_sharedlib+set}" = set; then + withval="$with_ada_sharedlib" + with_ada_sharedlib=$withval else - cf_with_ada=no + with_ada_sharedlib=no +fi; +echo "$as_me:18375: result: $with_ada_sharedlib" >&5 +echo "${ECHO_T}$with_ada_sharedlib" >&6 + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + + fi + fi +else + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -16163,7 +18403,7 @@ fi ### chooses to split module lists into libraries. ### ### (see CF_LIB_RULES). -echo "$as_me:16166: checking for library subsets" >&5 +echo "$as_me:18406: checking for library subsets" >&5 echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 LIB_SUBSETS= @@ -16178,6 +18418,7 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" + if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -16185,17 +18426,32 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" + +# Most term-driver calls are to tinfo, but some like init_pair are to the +# base library (so it resides in base). +if test "$with_term_driver" != no ; then + LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" + case $cf_cv_system_name in #(vi + *mingw32*) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" + ;; + *) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" + ;; + esac +fi + test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" -echo "$as_me:16191: result: $LIB_SUBSETS" >&5 +echo "$as_me:18447: result: $LIB_SUBSETS" >&5 echo "${ECHO_T}$LIB_SUBSETS" >&6 ### Construct the list of include-directories to be generated -CPPFLAGS="-I. -I../include $CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then - CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -16209,7 +18465,7 @@ elif test "$includedir" != "/usr/include"; then fi fi -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -16226,7 +18482,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:16229: checking default library suffix" >&5 +echo "$as_me:18485: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -16237,46 +18493,50 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:16240: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:18496: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:16243: checking default library-dependency suffix" >&5 +echo "$as_me:18499: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 - case $DFT_LWR_MODEL in - libtool) + case $DFT_LWR_MODEL in #(vi + libtool) #(vi DFT_LIB_SUFFIX='.la' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - normal) + normal) #(vi DFT_LIB_SUFFIX='.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - debug) + debug) #(vi DFT_LIB_SUFFIX='_g.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - profile) + profile) #(vi DFT_LIB_SUFFIX='_p.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + DFT_LIB_SUFFIX='.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + cygwin*) #(vi DFT_LIB_SUFFIX='.dll' DFT_DEP_SUFFIX='.dll.a' ;; - darwin*) + darwin*) #(vi DFT_LIB_SUFFIX='.dylib' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - *) + *) #(vi DFT_LIB_SUFFIX='.sl' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; @@ -16289,10 +18549,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:16292: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:18552: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:16295: checking default object directory" >&5 +echo "$as_me:18555: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -16308,51 +18568,55 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:16311: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:18571: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 # libtool thinks it can make c++ shared libraries (perhaps only g++) if test "$cf_with_cxx" = yes ; then -echo "$as_me:16316: checking c++ library-dependency suffix" >&5 +echo "$as_me:18576: checking c++ library-dependency suffix" >&5 echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 if test "$with_libtool" != "no"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else - case normal in - libtool) + case normal in #(vi + libtool) #(vi CXX_LIB_SUFFIX='.la' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - normal) + normal) #(vi CXX_LIB_SUFFIX='.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - debug) + debug) #(vi CXX_LIB_SUFFIX='_g.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - profile) + profile) #(vi CXX_LIB_SUFFIX='_p.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + CXX_LIB_SUFFIX='.a' + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + cygwin*) #(vi CXX_LIB_SUFFIX='.dll' CXX_DEP_SUFFIX='.dll.a' ;; - darwin*) + darwin*) #(vi CXX_LIB_SUFFIX='.dylib' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi CXX_LIB_SUFFIX='.so' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - *) + *) #(vi CXX_LIB_SUFFIX='.sl' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; @@ -16366,7 +18630,7 @@ else test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && CXX_DEP_SUFFIX="${LIB_SUFFIX}${CXX_DEP_SUFFIX}" fi -echo "$as_me:16369: result: $CXX_LIB_SUFFIX" >&5 +echo "$as_me:18633: result: $CXX_LIB_SUFFIX" >&5 echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 fi @@ -16431,6 +18695,8 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" + TICS_LIST="$SHLIB_LIST $TEST_ARGS" + SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -16480,7 +18746,7 @@ normal|debug|profile) if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[45]*) #( vi + OS/2*|os2*|aix[4]*|solaris2.1[0-9]|darwin*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -16491,7 +18757,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[45]*) #( from ld manpage + aix[456]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -16516,15 +18782,93 @@ else esac fi +if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" +then + echo "$as_me:18787: checking if linker supports switching between static/dynamic" >&5 +echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6 + + rm -f libconftest.a + cat >conftest.$ac_ext < +int cf_ldflags_static(FILE *fp) { return fflush(fp); } +EOF + if { (eval echo "$as_me:18796: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:18799: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&5 >/dev/null + fi + rm -f conftest.* + + cf_save_LIBS="$LIBS" + + LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 18810 "configure" +#include "confdefs.h" + +#line 18813 "configure" +#include +int cf_ldflags_static(FILE *fp); + +int +main () +{ + + return cf_ldflags_static(stdin); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:18828: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:18831: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:18834: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:18837: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_ldflags_static=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_ldflags_static=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + rm -f libconftest.* + LIBS="$cf_save_LIBS" + + echo "$as_me:18850: result: $cf_ldflags_static" >&5 +echo "${ECHO_T}$cf_ldflags_static" >&6 + + if test $cf_ldflags_static != yes + then + LDFLAGS_STATIC= + LDFLAGS_SHARED= + fi +else + LDFLAGS_STATIC= + LDFLAGS_SHARED= +fi + ;; esac -echo "$as_me:16522: checking where we will install curses.h" >&5 +echo "$as_me:18866: checking where we will install curses.h" >&5 echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='${prefix}/include/ncurses'${LIB_SUFFIX} -echo "$as_me:16527: result: $includedir" >&5 +echo "$as_me:18871: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 ### Resolve a conflict between normal and wide-curses by forcing applications @@ -16532,10 +18876,11 @@ echo "${ECHO_T}$includedir" >&6 if test "$with_overwrite" != no ; then if test "$NCURSES_LIBUTF8" = 1 ; then NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' - { echo "$as_me:16535: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 + { echo "$as_me:18879: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} fi fi +WITH_OVERWRITE=$with_overwrite # used to separate tack out of the tree NCURSES_TREE= @@ -16548,7 +18893,7 @@ EOF ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. -echo "$as_me:16551: checking for src modules" >&5 +echo "$as_me:18896: checking for src modules" >&5 echo $ECHO_N "checking for src modules... $ECHO_C" >&6 # dependencies and linker-arguments for test-programs @@ -16611,25 +18956,34 @@ EOF fi fi done -echo "$as_me:16614: result: $cf_cv_src_modules" >&5 +echo "$as_me:18959: result: $cf_cv_src_modules" >&5 echo "${ECHO_T}$cf_cv_src_modules" >&6 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" TEST_ARG2="-L${LIB_2ND} $TEST_ARG2" -SRC_SUBDIRS="man include" +SRC_SUBDIRS= +if test "x$cf_with_manpages" != xno ; then + SRC_SUBDIRS="$SRC_SUBDIRS man" +fi +SRC_SUBDIRS="$SRC_SUBDIRS include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS test" +if test "x$cf_with_tests" != "xno" ; then + SRC_SUBDIRS="$SRC_SUBDIRS test" +fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src" + if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" + fi fi SUB_MAKEFILES= @@ -16639,15 +18993,16 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done fi if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" + SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi DIRS_TO_MAKE="lib" @@ -16679,8 +19034,12 @@ do test ! -d $cf_dir && mkdir $cf_dir done +# symbols that differ when compiling Ada95 by itself. +NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' + +# values to use as strings cat >>confdefs.h <>confdefs.h <&5 -echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 -if test -n "$LDFLAGS" ; then -echo "$as_me:16766: result: maybe" >&5 -echo "${ECHO_T}maybe" >&6 -test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me-configure}:16770: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 - -test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me-configure}:16774: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -case "$EXTRA_LDFLAGS" in #(vi --Wl,-rpath,*) #(vi - cf_rpath_hack="-Wl,-rpath," - ;; --R\ *) - cf_rpath_hack="-R " - ;; --R*) - cf_rpath_hack="-R" - ;; -*) - cf_rpath_hack= - ;; -esac -if test -n "$cf_rpath_hack" ; then - cf_rpath_dst= - for cf_rpath_src in $LDFLAGS - do - test -n "$verbose" && echo " Filtering $cf_rpath_src" 1>&6 - -echo "${as_me-configure}:16796: testing Filtering $cf_rpath_src ..." 1>&5 - - case $cf_rpath_src in #(vi - -L*) #(vi - if test "$cf_rpath_hack" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` - fi - test -n "$verbose" && echo " ...Filter $cf_rpath_tmp" 1>&6 - -echo "${as_me-configure}:16807: testing ...Filter $cf_rpath_tmp ..." 1>&5 - - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" - done - LDFLAGS=$cf_rpath_dst - test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me-configure}:16817: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 - - test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me-configure}:16821: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -fi -else -echo "$as_me:16825: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi - ### Define substitutions for header files to avoid name-pollution if test "$cf_cv_have_tcgetattr" = yes ; then @@ -16849,9 +19147,80 @@ else fi ################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" +test "$use_database" = yes && \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" + SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" -ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" +SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi + +# Extract the first word of "tic", so it can be a program name with args. +set dummy tic; ac_word=$2 +echo "$as_me:19165: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_TIC_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $TIC_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_TIC_PATH="$TIC_PATH" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH:/usr/local/ncurses/bin" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_TIC_PATH="$ac_dir/$ac_word" + echo "$as_me:19182: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_TIC_PATH" && ac_cv_path_TIC_PATH="unknown" + ;; +esac +fi +TIC_PATH=$ac_cv_path_TIC_PATH + +if test -n "$TIC_PATH"; then + echo "$as_me:19194: result: $TIC_PATH" >&5 +echo "${ECHO_T}$TIC_PATH" >&6 +else + echo "$as_me:19197: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$FALLBACK_LIST" +then + if test "$TIC_PATH" = unknown + then + { echo "$as_me:19205: WARNING: no tic program found for fallbacks" >&5 +echo "$as_me: WARNING: no tic program found for fallbacks" >&2;} + fi +fi + +if test "x$cf_with_tests" != xno ; then + MAKE_TESTS= +else + MAKE_TESTS="#" +fi + +SUB_SCRIPTS= +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + SUB_SCRIPTS="mk-dlls.sh" + ;; +esac + +ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_SCRIPTS $SUB_MAKEFILES Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16932,7 +19301,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:16935: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:19304: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -17058,13 +19427,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:17111: error: ambiguous option: $1 + { { echo "$as_me:19480: 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;} @@ -17127,7 +19496,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:17130: error: unrecognized option: $1 + -*) { { echo "$as_me:19499: 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;} @@ -17146,7 +19515,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20080325, executed with +This file was extended by $as_me 2.52.20101002, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -17170,10 +19539,12 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" +LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -17181,13 +19552,15 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" +TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -17205,7 +19578,10 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" +cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" +cf_with_manpages="$cf_with_manpages" +cf_with_tests="$cf_with_tests" host="$host" target="$target" @@ -17218,13 +19594,15 @@ do # Handling of arguments. "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; + "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; + "$SUB_SCRIPTS" ) CONFIG_FILES="$CONFIG_FILES $SUB_SCRIPTS" ;; "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:17227: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:19605: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -17349,7 +19727,12 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@LN_S@,$LN_S,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t s,@SET_MAKE@,$SET_MAKE,;t t +s,@CTAGS@,$CTAGS,;t t +s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t @@ -17359,7 +19742,7 @@ s,@LD@,$LD,;t t s,@ac_ct_LD@,$ac_ct_LD,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@AR_OPTS@,$AR_OPTS,;t t +s,@ARFLAGS@,$ARFLAGS,;t t s,@DESTDIR@,$DESTDIR,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@BUILD_CPP@,$BUILD_CPP,;t t @@ -17370,7 +19753,9 @@ s,@BUILD_LIBS@,$BUILD_LIBS,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t s,@cf_list_models@,$cf_list_models,;t t +s,@LIBTOOL_VERSION@,$LIBTOOL_VERSION,;t t s,@LIBTOOL@,$LIBTOOL,;t t +s,@LT_UNDEF@,$LT_UNDEF,;t t s,@LIBTOOL_CXX@,$LIBTOOL_CXX,;t t s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t s,@LIB_CREATE@,$LIB_CREATE,;t t @@ -17392,6 +19777,7 @@ s,@CC_G_OPT@,$CC_G_OPT,;t t s,@CXX_G_OPT@,$CXX_G_OPT,;t t s,@LD_MODEL@,$LD_MODEL,;t t s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t +s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t s,@LINK_PROGS@,$LINK_PROGS,;t t @@ -17400,8 +19786,8 @@ s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@cf_ldd_prog@,$cf_ldd_prog,;t t s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t -s,@PATHSEP@,$PATHSEP,;t t s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t s,@WHICH_XTERM@,$WHICH_XTERM,;t t s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t @@ -17423,19 +19809,26 @@ s,@NCURSES_TPARM_VARARGS@,$NCURSES_TPARM_VARARGS,;t t s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t +s,@NCURSES_CCHARW_MAX@,$NCURSES_CCHARW_MAX,;t t s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t +s,@GENERATED_EXT_FUNCS@,$GENERATED_EXT_FUNCS,;t t +s,@NCURSES_SP_FUNCS@,$NCURSES_SP_FUNCS,;t t +s,@GENERATED_SP_FUNCS@,$GENERATED_SP_FUNCS,;t t s,@NCURSES_CONST@,$NCURSES_CONST,;t t s,@NCURSES_EXT_COLORS@,$NCURSES_EXT_COLORS,;t t s,@NCURSES_MOUSE_VERSION@,$NCURSES_MOUSE_VERSION,;t t s,@NCURSES_SBOOL@,$NCURSES_SBOOL,;t t s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t +s,@NCURSES_INTEROP_FUNCS@,$NCURSES_INTEROP_FUNCS,;t t s,@PTHREAD@,$PTHREAD,;t t s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t s,@cf_cv_enable_opaque@,$cf_cv_enable_opaque,;t t s,@NCURSES_OPAQUE@,$NCURSES_OPAQUE,;t t s,@NCURSES_SIZE_T@,$NCURSES_SIZE_T,;t t +s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@EXTRA_CXXFLAGS@,$EXTRA_CXXFLAGS,;t t s,@ADA_TRACE@,$ADA_TRACE,;t t @@ -17446,23 +19839,27 @@ s,@cf_cv_1UL@,$cf_cv_1UL,;t t s,@cf_cv_typeof_mmask_t@,$cf_cv_typeof_mmask_t,;t t s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;t t s,@TEST_LIBS@,$TEST_LIBS,;t t +s,@TEST_LIBS2@,$TEST_LIBS2,;t t s,@CXXCPP@,$CXXCPP,;t t s,@CXXLDFLAGS@,$CXXLDFLAGS,;t t s,@CXX_AR@,$CXX_AR,;t t -s,@CXX_AR_OPTS@,$CXX_AR_OPTS,;t t +s,@CXX_ARFLAGS@,$CXX_ARFLAGS,;t t s,@CXXLIBS@,$CXXLIBS,;t t s,@USE_CXX_BOOL@,$USE_CXX_BOOL,;t t s,@gnat_exists@,$gnat_exists,;t t -s,@M4_exists@,$M4_exists,;t t -s,@cf_ada_make@,$cf_ada_make,;t t -s,@cf_ada_compiler@,$cf_ada_compiler,;t t -s,@cf_ada_package@,$cf_ada_package,;t t -s,@ADAFLAGS@,$ADAFLAGS,;t t s,@cf_compile_generics@,$cf_compile_generics,;t t s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t +s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t +s,@M4_exists@,$M4_exists,;t t +s,@cf_ada_make@,$cf_ada_make,;t t s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t +s,@cf_ada_compiler@,$cf_ada_compiler,;t t +s,@cf_ada_package@,$cf_ada_package,;t t s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t +s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t +s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t s,@ACPPFLAGS@,$ACPPFLAGS,;t t s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t @@ -17490,9 +19887,14 @@ s,@TEST_ARG2@,$TEST_ARG2,;t t s,@TEST_DEP2@,$TEST_DEP2,;t t s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;t t +s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t s,@HAVE_TCGETATTR@,$HAVE_TCGETATTR,;t t s,@HAVE_TERMIO_H@,$HAVE_TERMIO_H,;t t s,@HAVE_TERMIOS_H@,$HAVE_TERMIOS_H,;t t +s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t +s,@cross_compiling@,$cross_compiling,;t t +s,@TIC_PATH@,$TIC_PATH,;t t +s,@MAKE_TESTS@,$MAKE_TESTS,;t t CEOF EOF @@ -17607,7 +20009,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:17610: creating $ac_file" >&5 + { echo "$as_me:20012: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -17625,7 +20027,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:17628: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20030: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -17638,7 +20040,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:17641: error: cannot find input file: $f" >&5 + { { echo "$as_me:20043: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -17704,7 +20106,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:17707: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:20109: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -17715,7 +20117,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:17718: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20120: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -17728,7 +20130,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:17731: error: cannot find input file: $f" >&5 + { { echo "$as_me:20133: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -17786,7 +20188,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:17789: $ac_file is unchanged" >&5 + { echo "$as_me:20191: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -17828,7 +20230,6 @@ done; } done EOF cat >>$CONFIG_STATUS <<\EOF - # # CONFIG_COMMANDS section. # @@ -17838,16 +20239,19 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue case $ac_dest in default ) +if test "x$cf_with_tests" != xno ; then for cf_dir in test do if test ! -d $srcdir/$cf_dir; then continue elif test -f $srcdir/$cf_dir/programs; then - $AWK -f $srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile + $AWK -f $srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile fi done +fi + case $cf_cv_system_name in #(vi OS/2*|os2*) #(vi LIB_PREFIX='' @@ -17862,6 +20266,23 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi +if test -n "$TINFO_SUFFIX" ; then + case $TINFO_SUFFIX in + tw*) + TINFO_NAME="${TINFO_NAME}tw" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` + ;; + t*) + TINFO_NAME="${TINFO_NAME}t" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` + ;; + w*) + TINFO_NAME="${TINFO_NAME}w" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` + ;; + esac +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -17873,40 +20294,44 @@ do for cf_item in $cf_LIST_MODELS do - case $cf_item in - libtool) + case $cf_item in #(vi + libtool) #(vi cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) + normal) #(vi cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) + debug) #(vi cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) + profile) #(vi cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + cf_suffix='.a' + cf_depsuf=$cf_suffix + ;; + cygwin*) #(vi cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) + darwin*) #(vi cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) + *) #(vi cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -17927,6 +20352,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${REL_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -17943,6 +20376,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -18020,40 +20461,44 @@ do cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - case $cf_item in - libtool) + case $cf_item in #(vi + libtool) #(vi cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) + normal) #(vi cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) + debug) #(vi cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) + profile) #(vi cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + cf_suffix='.a' + cf_depsuf=$cf_suffix + ;; + cygwin*) #(vi cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) + darwin*) #(vi cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) + *) #(vi cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -18123,6 +20568,16 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in + tw*) + cf_libname=`echo $cf_libname | sed 's/tw$//'` + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_dir_suffix=tw + ;; + t*) + cf_libname=`echo $cf_libname | sed 's/t$//'` + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_dir_suffix=t + ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -18140,17 +20595,19 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink-no} \ + ReLink=${cf_cv_do_relink:-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ + libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -18234,18 +20691,28 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile <>Ada95/src/Makefile +fi +fi ;; esac done @@ -18392,4 +20865,4 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -${MAKE-make} preinstall +${MAKE:-make} preinstall diff --git a/configure.in b/configure.in index 2b4422a439d..48b2139f0c6 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2009,2010 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 * @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $ +dnl $Id: configure.in,v 1.514 2010/11/28 00:12:45 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.454 $) +AC_REVISION($Revision: 1.514 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -122,6 +122,13 @@ AC_ARG_WITH(ada, [cf_with_ada=yes]) AC_MSG_RESULT($cf_with_ada) +AC_MSG_CHECKING(if you want to install manpages) +AC_ARG_WITH(manpages, + [ --without-manpages suppress install of manpages], + [cf_with_manpages=$withval], + [cf_with_manpages=yes]) +AC_MSG_RESULT($cf_with_manpages) + AC_MSG_CHECKING(if you want to build programs such as tic) AC_ARG_WITH(progs, [ --without-progs suppress build with programs (e.g., tic)], @@ -129,6 +136,13 @@ AC_ARG_WITH(progs, [cf_with_progs=yes]) AC_MSG_RESULT($cf_with_progs) +AC_MSG_CHECKING(if you want to build test-programs) +AC_ARG_WITH(tests, + [ --without-tests suppress build with test-programs], + [cf_with_tests=$withval], + [cf_with_tests=yes]) +AC_MSG_RESULT($cf_with_tests) + AC_MSG_CHECKING(if you wish to install curses.h) AC_ARG_WITH(curses-h, [ --without-curses-h install curses.h as ncurses.h only], @@ -148,10 +162,35 @@ CF_PROG_AWK CF_PROG_EGREP CF_PROG_INSTALL CF_PROG_LINT -AC_PROG_LN_S +CF_PROG_LN_S AC_SYS_LONG_FILE_NAMES +# if we find pkg-config, check if we should install the ".pc" files. +CF_PKG_CONFIG + +if test "$PKG_CONFIG" != no ; then + AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) + AC_MSG_RESULT($enable_pc_files) + else + AC_MSG_RESULT(no) + AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR) + enable_pc_files=no + fi +fi +AC_SUBST(PKG_CONFIG_LIBDIR) + AC_MSG_CHECKING(if we should assume mixed-case filenames) AC_ARG_ENABLE(mixed-case, [ --enable-mixed-case tic should assume mixed-case filenames], @@ -176,7 +215,7 @@ dnl These are standard among *NIX systems, but not when cross-compiling AC_CHECK_TOOL(RANLIB, ranlib, ':') AC_CHECK_TOOL(LD, ld, ld) AC_CHECK_TOOL(AR, ar, ar) -CF_SUBST(archiver options,AR_OPTS,rv) +CF_AR_FLAGS dnl Special option for use by system-builders: the install-prefix is used to dnl adjust the location into which the actual install is done, so that an @@ -327,6 +366,7 @@ if test "$with_gpm" != no ; then SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" + CF_ADD_LIB(gpm,TEST_LIBS) fi AC_DEFINE(HAVE_LIBGPM) CF_CHECK_GPM_WGETCH @@ -380,6 +420,11 @@ if test "$CC_SHARED_OPTS" = "unknown"; then done fi +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + CF_DISABLE_RPATH_HACK +fi + ############################################################################### CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) @@ -413,7 +458,7 @@ if test "$use_database" != no ; then AC_DEFINE(USE_DATABASE) AC_MSG_CHECKING(which terminfo source-file will be installed) - AC_ARG_ENABLE(database, + AC_ARG_WITH(database, [ --with-database=XXX specify terminfo source to install], [TERMINFO_SRC=$withval]) AC_MSG_RESULT($TERMINFO_SRC) @@ -618,7 +663,7 @@ AC_MSG_CHECKING(if you want broken-linker support code) AC_ARG_ENABLE(broken_linker, [ --enable-broken_linker compile with broken-linker support code], [with_broken_linker=$enableval], - [with_broken_linker=${BROKEN_LINKER-no}]) + [with_broken_linker=${BROKEN_LINKER:-no}]) AC_MSG_RESULT($with_broken_linker) BROKEN_LINKER=0 @@ -655,7 +700,7 @@ NCURSES_WCHAR_T=0 NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -CF_XOPEN_SOURCE +CF_XOPEN_SOURCE(500) # Work around breakage on OS X CF_SIGWINCH @@ -676,7 +721,15 @@ AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" AC_DEFINE(USE_WIDEC_SUPPORT) - CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) + + case "$CFLAGS $CPPFLAGS" in #(vi + *-D_XOPEN_SOURCE=500) #(vi + ;; + *) + CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) + ;; + esac + # with_overwrite=no NCURSES_CH_T=cchar_t AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs) @@ -797,6 +850,15 @@ AC_ARG_WITH(mmask-t, [NCURSES_MMASK_T=auto]) AC_MSG_RESULT($NCURSES_MMASK_T) +### use option --with-ccharw-max to override CCHARW_MAX size +AC_MSG_CHECKING(for size CCHARW_MAX) +AC_ARG_WITH(ccharw-max, + [ --with-ccharw-max=XXX override size CCHARW_MAX], + [NCURSES_CCHARW_MAX="$withval"], + [NCURSES_CCHARW_MAX=5]) +AC_MSG_RESULT($NCURSES_CCHARW_MAX) +AC_SUBST(NCURSES_CCHARW_MAX) + ### Enable compiling-in rcs id's AC_MSG_CHECKING(if RCS identifiers should be compiled-in) AC_ARG_WITH(rcs-ids, @@ -807,7 +869,7 @@ AC_MSG_RESULT($with_rcs_ids) test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) ############################################################################### -CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) +CF_MAN_PAGES([ captoinfo clear infocmp infotocap tabs tic toe tput tset ]) ############################################################################### CF_HELP_MESSAGE(Extensions:) @@ -825,13 +887,47 @@ if test "$with_ext_funcs" = yes ; then AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_RESIZE_TERM) + AC_DEFINE(HAVE_TERM_ENTRY_H) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) AC_DEFINE(HAVE_WRESIZE) AC_DEFINE(NCURSES_EXT_FUNCS) + GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 + GENERATED_EXT_FUNCS= fi AC_SUBST(NCURSES_EXT_FUNCS) +AC_SUBST(GENERATED_EXT_FUNCS) + +AC_MSG_CHECKING(if you want to build with experimental SCREEN extensions) +AC_ARG_ENABLE(sp-funcs, + [ --enable-sp-funcs enable experimental SCREEN-extensions], + [with_sp_funcs=$enableval], + [with_sp_funcs=no]) +AC_MSG_RESULT($with_sp_funcs) +if test "$with_sp_funcs" = yes ; then + NCURSES_SP_FUNCS=1 + AC_DEFINE(NCURSES_SP_FUNCS) + GENERATED_SP_FUNCS=generated +else + NCURSES_SP_FUNCS=0 + GENERATED_SP_FUNCS= +fi +AC_SUBST(NCURSES_SP_FUNCS) +AC_SUBST(GENERATED_SP_FUNCS) + +AC_MSG_CHECKING(if you want to build with experimental terminal-driver) +AC_ARG_ENABLE(term-driver, + [ --enable-term-driver enable experimental terminal-driver], + [with_term_driver=$enableval], + [with_term_driver=no]) +AC_MSG_RESULT($with_term_driver) +if test "$with_term_driver" = yes ; then + AC_DEFINE(USE_TERM_DRIVER) + if test "$with_sp_funcs" != yes ; then + AC_MSG_ERROR(The term-driver option relies upon sp-funcs) + fi +fi ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) @@ -973,30 +1069,55 @@ test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment AC_MSG_CHECKING(if you want colorfgbg code) AC_ARG_ENABLE(colorfgbg, - [ --enable-colorfgbg compile with $COLORFGBG code], + [ --enable-colorfgbg compile-in experimental $COLORFGBG code], [with_colorfgbg=$enableval], [with_colorfgbg=no]) AC_MSG_RESULT($with_colorfgbg) test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) +### use option --enable-interop to turn on use of bindings used for interop +AC_MSG_CHECKING(if you want interop bindings) +AC_ARG_ENABLE(interop, + [ --enable-interop compile-in experimental interop bindings], + [with_exp_interop=$enableval], + [with_exp_interop=no]) +AC_MSG_RESULT($with_exp_interop) + +NCURSES_INTEROP_FUNCS=0 +test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 +AC_SUBST(NCURSES_INTEROP_FUNCS) + # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. CF_WITH_PTHREAD -AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) -AC_ARG_ENABLE(weak-symbols, - [ --enable-weak-symbols enable weak-symbols for pthreads], - [use_weak_symbols=$withval], - [use_weak_symbols=no]) -AC_MSG_RESULT($use_weak_symbols) -if test "$use_weak_symbols" = yes ; then - CF_WEAK_SYMBOLS -else - cf_cv_weak_symbols=no -fi +if test "x$with_pthread" != xno; then + AC_CHECK_FUNC(pthread_kill,[ + AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads) + AC_ARG_ENABLE(pthreads-eintr, + [ --enable-pthreads-eintr enable EINTR in wgetch with pthreads], + [use_pthreads_eintr=$enableval], + [use_pthreads_eintr=no]) + AC_MSG_RESULT($use_pthreads_eintr) + if test $use_pthreads_eintr = yes ; then + AC_DEFINE(USE_PTHREADS_EINTR) + fi]) -if test $cf_cv_weak_symbols = yes ; then - AC_DEFINE(USE_WEAK_SYMBOLS) + AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) + AC_ARG_ENABLE(weak-symbols, + [ --enable-weak-symbols enable weak-symbols for pthreads], + [use_weak_symbols=$enableval], + [use_weak_symbols=no]) + AC_MSG_RESULT($use_weak_symbols) + if test "$use_weak_symbols" = yes ; then + CF_WEAK_SYMBOLS + else + cf_cv_weak_symbols=no + fi + + if test $cf_cv_weak_symbols = yes ; then + AC_DEFINE(USE_WEAK_SYMBOLS) + fi fi PTHREAD= @@ -1024,11 +1145,13 @@ if test "$with_reentrant" = yes ; then cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then - CF_REMOVE_LIB(LIBS,$LIBS,pthread) - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + if test $cf_cv_weak_symbols = yes ; then + CF_REMOVE_LIB(LIBS,$LIBS,pthread) + CF_ADD_LIB(pthread,TEST_LIBS) + CF_ADD_LIB(pthread,TEST_LIBS2) + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi AC_DEFINE(USE_REENTRANT) CF_NCURSES_ABI_6 else @@ -1042,6 +1165,20 @@ AC_SUBST(cf_cv_enable_opaque) AC_SUBST(NCURSES_OPAQUE) AC_SUBST(NCURSES_SIZE_T) +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + AC_MSG_CHECKING(for prefix used to wrap public variables) + AC_ARG_WITH(wrap-prefix, + [ --with-wrap-prefix=XXX override prefix used for public variables], + [NCURSES_WRAP_PREFIX=$withval], + [NCURSES_WRAP_PREFIX=_nc_]) + AC_MSG_RESULT($NCURSES_WRAP_PREFIX) +else + NCURSES_WRAP_PREFIX=_nc_ +fi +AC_SUBST(NCURSES_WRAP_PREFIX) +AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX") + AC_MSG_CHECKING(if you want experimental safe-sprintf code) AC_ARG_ENABLE(safe-sprintf, [ --enable-safe-sprintf compile with experimental safe-sprintf code], @@ -1097,7 +1234,7 @@ AC_ARG_ENABLE(warnings, AC_MSG_RESULT($with_warnings) if test "x$with_warnings" = "xyes"; then - ADAFLAGS="$ADAFLAGS -gnatg" + CF_ADD_ADAFLAGS(-gnatg) CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) if test "$cf_with_cxx" = yes ; then CF_GXX_WARNINGS(Wno-unused) @@ -1119,7 +1256,7 @@ then AC_DEFINE(NDEBUG) CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + CF_ADD_ADAFLAGS(-gnata) fi fi @@ -1165,12 +1302,18 @@ fi AC_SUBST(ADA_TRACE) ### Checks for libraries. +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY),[ AC_CHECK_LIB(bsd, gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY) - LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday + CF_ADD_LIB(bsd))])dnl CLIX: bzero, select, gettimeofday + ;; +esac CF_MATH_LIB(MATH_LIB,sin(x)) AC_SUBST(MATH_LIB) @@ -1204,7 +1347,7 @@ wctype.h \ # Note: even non-Posix ISC needs to declare fd_set if test "$ISC" = yes ; then AC_CHECK_LIB(cposix,main) - AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()' + AC_CHECK_LIB(inet,bzero,CF_ADD_LIB(inet))dnl also 'select()' fi CF_SYS_TIME_SELECT @@ -1287,6 +1430,8 @@ CF_TYPE_SIGACTION CF_SIZECHANGE CF_FUNC_MEMMOVE CF_FUNC_POLL +CF_VA_COPY +AC_FUNC_VFORK # special check for test/ditto.c CF_FUNC_OPENPTY @@ -1294,10 +1439,11 @@ if test "$cf_cv_func_openpty" != no ; then AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>) AC_DEFINE(USE_XTERM_PTY) if test "$cf_cv_lib_util" = yes ; then - TEST_LIBS="-lutil $TEST_LIBS" + CF_ADD_LIB(util,TEST_LIBS) fi fi AC_SUBST(TEST_LIBS) +AC_SUBST(TEST_LIBS2) if test "$with_hashed_db" != no ; then AC_DEFINE(USE_HASHED_DB) @@ -1354,12 +1500,12 @@ cerr << "testing" << endl; CF_CPP_STATIC_CAST CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' + CXX_ARFLAGS='$(ARFLAGS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-ar -o' + CXX_ARFLAGS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -1368,13 +1514,13 @@ cerr << "testing" << endl; solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-xar -o' + CXX_ARFLAGS='-xar -o' fi ;; esac AC_SUBST(CXXLDFLAGS) AC_SUBST(CXX_AR) - AC_SUBST(CXX_AR_OPTS) + AC_SUBST(CXX_ARFLAGS) else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -1435,99 +1581,34 @@ if test -f "${srcdir}/Ada95/Makefile.in" ; then dnl libtool does not know anything about GNAT, though a change made in 1998 dnl provided for it "someday". Disable the ada subtree if we are using dnl libtool -TD 20070714 -if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - AC_MSG_WARN(libtool does not support Ada - disabling feature) - cf_with_ada=no - fi -fi + if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + AC_MSG_WARN(libtool does not support Ada - disabling feature) + cf_with_ada=no + fi + fi dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. -if test "$cf_with_ada" != "no" ; then -cf_ada_make=gnatmake -AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) -if test "$ac_cv_prog_gnat_exists" = no; then - cf_ada_make= + if test "$cf_with_ada" != "no" ; then + CF_PROG_GNAT + if test "$cf_cv_prog_gnat_correct" = yes; then + CF_ADD_ADAFLAGS(-O3 -gnatpn) + + CF_GNAT_PRAGMA_UNREF + + CF_WITH_ADA_COMPILER + + cf_ada_package=terminal_interface + AC_SUBST(cf_ada_package) + + CF_WITH_ADA_INCLUDE + CF_WITH_ADA_OBJECTS + CF_WITH_ADA_SHAREDLIB + fi + fi else - CF_GNAT_VERSION - AC_CHECK_PROG(M4_exists, m4, yes, no) - if test "$ac_cv_prog_M4_exists" = no; then - cf_cv_prog_gnat_correct=no - echo Ada95 binding required program m4 not found. Ada95 binding disabled. - fi - if test "$cf_cv_prog_gnat_correct" = yes; then - AC_MSG_CHECKING(if GNAT works) - CF_GNAT_TRY_RUN([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is -begin - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) - AC_MSG_RESULT($cf_cv_prog_gnat_correct) - fi -fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - - AC_MSG_CHECKING(if GNAT pragma Unreferenced works) - CF_GNAT_TRY_LINK([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is - test : Integer; - pragma Unreferenced (test); -begin - test := 1; - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no]) - AC_MSG_RESULT($cf_cv_pragma_unreferenced) - - # if the pragma is supported, use it (needed in the Trace code). - if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE - else - PRAGMA_UNREF=FALSE - fi - - AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], - [cf_ada_compiler=$withval], - [cf_ada_compiler=gnatmake]) - - cf_ada_package=terminal_interface - - AC_SUBST(cf_ada_make) - AC_SUBST(cf_ada_compiler) - AC_SUBST(cf_ada_package) - AC_SUBST(ADAFLAGS) - AC_SUBST(cf_compile_generics) - AC_SUBST(cf_generic_objects) - AC_SUBST(PRAGMA_UNREF) - - CF_WITH_PATH(ada-include, - [ --with-ada-include=DIR Ada includes are in DIR], - ADA_INCLUDE, - PREFIX/lib/ada/adainclude, - [$]prefix/lib/ada/adainclude) - AC_SUBST(ADA_INCLUDE) - - CF_WITH_PATH(ada-objects, - [ --with-ada-objects=DIR Ada objects are in DIR], - ADA_OBJECTS, - PREFIX/lib/ada/adalib, - [$]prefix/lib/ada/adalib) - AC_SUBST(ADA_OBJECTS) - -fi -fi -else - cf_with_ada=no + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -1554,6 +1635,7 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" + if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -1561,6 +1643,21 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" + +# Most term-driver calls are to tinfo, but some like init_pair are to the +# base library (so it resides in base). +if test "$with_term_driver" != no ; then + LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" + case $cf_cv_system_name in #(vi + *mingw32*) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" + ;; + *) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" + ;; + esac +fi + test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" @@ -1656,6 +1753,8 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" + TICS_LIST="$SHLIB_LIST $TEST_ARGS" + SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -1723,6 +1822,7 @@ if test "$NCURSES_LIBUTF8" = 1 ; then AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h) fi fi +WITH_OVERWRITE=$with_overwrite AC_SUBST(WITH_OVERWRITE) AC_SUBST(TICS_LIST) @@ -1742,40 +1842,88 @@ AC_DEFINE(HAVE_SLK_COLOR) CF_SRC_MODULES($modules_to_build) if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" + SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi CF_DIRS_TO_MAKE -AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') +# symbols that differ when compiling Ada95 by itself. +NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' +AC_SUBST(NCURSES_SHLIB2) + +# values to use as strings +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR') AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}") ### Now that we're done running tests, add the compiler-warnings, if any CF_ADD_CFLAGS($EXTRA_CFLAGS) -### If we're building with rpath, try to link non-standard libs that way too. -if test "$DFT_LWR_MODEL" = "shared"; then - CF_RPATH_HACK -fi - ### Define substitutions for header files to avoid name-pollution CF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0) CF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0) CF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0) ################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" +test "$use_database" = yes && \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" + SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" +SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi +AC_SUBST(MAKE_PC_FILES) +AC_SUBST(cross_compiling) + +AC_PATH_PROG(TIC_PATH,tic,unknown,$PATH:/usr/local/ncurses/bin) +if test -n "$FALLBACK_LIST" +then + if test "$TIC_PATH" = unknown + then + AC_MSG_WARN(no tic program found for fallbacks) + fi +fi +AC_SUBST(TIC_PATH) + +if test "x$cf_with_tests" != xno ; then + MAKE_TESTS= +else + MAKE_TESTS="#" +fi +AC_SUBST(MAKE_TESTS) + +SUB_SCRIPTS= +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + SUB_SCRIPTS="mk-dlls.sh" + ;; +esac + AC_OUTPUT( \ include/MKterm.h.awk \ include/curses.head:include/curses.h.in \ + include/ncurses_dll.h \ include/termcap.h \ include/unctrl.h \ + $SUB_SCRIPTS \ $SUB_MAKEFILES \ Makefile,[ -CF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test) +if test "x$cf_with_tests" != xno ; then + CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK"], test) +fi CF_LIB_RULES($SRC_SUBDIRS) + +if test "x$cf_with_ada" != xno ; then +if test -z "$USE_OLD_MAKERULES" ; then + $AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile +fi +fi ],[ ### Special initialization commands, used to pass information from the ### configuration-run into config.status @@ -1785,10 +1933,12 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" +LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -1796,13 +1946,15 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" +TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -1820,9 +1972,12 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" +cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" +cf_with_manpages="$cf_with_manpages" +cf_with_tests="$cf_with_tests" host="$host" target="$target" ],cat)dnl -${MAKE-make} preinstall +${MAKE:-make} preinstall diff --git a/dist.mk b/dist.mk index 551d773313f..1929e9707de 100644 --- a/dist.mk +++ b/dist.mk @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998-2010,2011 Free 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 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.671 2008/11/02 00:58:38 tom Exp $ +# $Id: dist.mk,v 1.800 2011/02/25 22:11:00 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -36,8 +36,8 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 -NCURSES_MINOR = 7 -NCURSES_PATCH = 20081102 +NCURSES_MINOR = 8 +NCURSES_PATCH = 20110226 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) @@ -57,8 +57,7 @@ GNATHTML= `type -p gnathtml || type -p gnathtml.pl` # has the effect of lengthening the text portion of the page -- so man2html # would remove some text. The man program on Redhat 6.1 appears to work with # man2html if we set the top/bottom margins to 6 (the default is 7). Newer -# versions of 'man' on Linux leave no margin (and make it harder to sync with -# pages). +# versions of 'man' leave no margin (and make it harder to sync with pages). MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html' ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml diff --git a/doc/html/Ada95.html b/doc/html/Ada95.html new file mode 100644 index 00000000000..e744da7278c --- /dev/null +++ b/doc/html/Ada95.html @@ -0,0 +1,184 @@ + + + + +Ada95 Binding for ncurses + + + + +

Ada95 Binding for ncurses

+by Jürgen Pfeifer. + +
+

General Remarks

+
    +
  • This document describes Version 01.00 of the binding.
  • +
  • The functionality is modeled to be compatible with the ncurses +package, a clone of the SVr4 curses model.
    +I did the development on an Intel box running the latest stable release of +Linux, ncurses and the most recent released +GNU Ada Translator +gnat versions. For any older versions of ncurses and gnat +it is not guaranteed to work.
  • +
  • You must have the m4 macroprocessor to build this package. +If you don't have this program, you can get the FSF version +here.
  • +
  • Ada programs are supposed to be readable. One of my +favorite methods to make code readable is to use expressive +names for the identifiers. You can find a list of a mapping +of the cryptic curses names to the Ada names in this table.
  • +
  • This is not a typical one-to-one interface mapping. It is +close to one-to-one on the functional level. Each (n)curses function +has it's counterpart with a more or less similar formal parameter list +in the binding. It is not one-to-one with respect to the datatypes. +I tried to make records out of the flat chtype and similar structures, +so you don't have to do bit operations to mark an attributed character +as bold. Just make the boolean member bold of the record +true. The binding also hides the structures like WINDOW, PANEL, MENU, FORM +etc. ! It's a pure functional API.
  • +
  • I try to do as much error checking as possible and feasible +in the binding. I will raise an Ada exception when something +went wrong in the low-level curses. This has the effect that - at least +first time in my life - (n)curses programs have now a very rigid error +checking, but - thanks to Ada - you don't have to code the orgiastic +error checking style of C.
  • +
  • Support for wide characters is currently not in the binding, as it +is not really in ncurses at this point in time.
  • +
+ +

Limitations

+
    +
  • I provide no SCREEN datatype and functions to set a new screen. +If you need this (mostly for debugging I guess), write a small +C routine doing all this and import it into your Ada program.
  • +
  • I provide no functions to switch on/off curses tracing options. +Same suggestion as above.
  • +
  • Although Ada95 is an OO Language, this binding doesn't provide +an OO abstraction of the (n)curses functionality. As mentioned above +it's a thin binding for the (n)curses functions. But without any +doubt it would be nice to build on top of this an OO abstraction +of (n)curses functionality.
    +The only exception is the method how fieldtypes are represented in +this Binding. We provide an abstract tagged type Field_Type from +which the various fieldtypes are derived.
  • +
  • I currently do not support the link_fieldtype functionality of the +forms subsystem.
  • +
  • The *_IO packages are currently output only.
  • +
+ +

Hierarchy of packages

+ +If you want to navigate through the html pages of the package specs, click here. +

Implementation Details

+

Behind the abstraction

+All the new types like Window, Panel, +Menu, Form etc. are just +opaque representations of the pointers to the corresponding +low level (n)curses structures like +WINDOW *, PANEL *, +MENU * or FORM *. +So you can safely pass them to C routines that expect a pointer +to one of those structures. +

Extended ripoffline() usage

+The official documentation of (n)curses says, that the line parameter +determines only whether or not exactly one line is +stolen from the top or bottom of the screen. So essentially only the +sign of the parameter is evaluated. ncurses has internally implemented +it in a way, that uses the line parameter also to control the amount of +lines to steal. This mechanism is used in the Rip_Off_Lines +routine of the binding. +

How user defined field types work

+TBD +

Enumeration fields handling

+The (n)curses documentation says, that the String arrays to be passed to +an TYPE_ENUM fieldtype must not be automatic variables. This is not true +in this binding, because it is internally arranged to safely copy these +values. +

Using other Ada compilers

+This should basically not be a problem. +

Port to other curses implementations

+Basically it should not be too hard to make all this run on a regular SVr4 +implementation of curses. The problems are probably these:
+
    +
  • ncurses has some additional features which are presented in this binding. You +have two choices to deal with this: +
      +
    • Emulate the feature in this binding
    • +
    • Raise an exception for non implemented features
    • +
    +Most likely you will follow a mixed approach. Some features are easy to simulate, +others will be hard if not impossible.
  • +
+I'm quite sure I forgot something. + + diff --git a/doc/html/ada/files.htm b/doc/html/ada/files.htm new file mode 100644 index 00000000000..a3bad641f82 --- /dev/null +++ b/doc/html/ada/files.htm @@ -0,0 +1,6 @@ + + + +

Files

+[T] + diff --git a/doc/html/ada/files/T.htm b/doc/html/ada/files/T.htm new file mode 100644 index 00000000000..d9d6950b818 --- /dev/null +++ b/doc/html/ada/files/T.htm @@ -0,0 +1,78 @@ + +T + +

Files - T

+[index] + diff --git a/doc/html/ada/funcs.htm b/doc/html/ada/funcs.htm new file mode 100644 index 00000000000..9a2da6189da --- /dev/null +++ b/doc/html/ada/funcs.htm @@ -0,0 +1,27 @@ + + + +

Functions/Procedures

+[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] + diff --git a/doc/html/ada/funcs/A.htm b/doc/html/ada/funcs/A.htm new file mode 100644 index 00000000000..9c7069d53b2 --- /dev/null +++ b/doc/html/ada/funcs/A.htm @@ -0,0 +1,24 @@ + +A + +

Functions - A

+[index] + diff --git a/doc/html/ada/funcs/B.htm b/doc/html/ada/funcs/B.htm new file mode 100644 index 00000000000..59c58866e93 --- /dev/null +++ b/doc/html/ada/funcs/B.htm @@ -0,0 +1,21 @@ + +B + +

Functions - B

+[index] + diff --git a/doc/html/ada/funcs/C.htm b/doc/html/ada/funcs/C.htm new file mode 100644 index 00000000000..04646263841 --- /dev/null +++ b/doc/html/ada/funcs/C.htm @@ -0,0 +1,56 @@ + +C + +

Functions - C

+[index] + diff --git a/doc/html/ada/funcs/D.htm b/doc/html/ada/funcs/D.htm new file mode 100644 index 00000000000..4003553b2b8 --- /dev/null +++ b/doc/html/ada/funcs/D.htm @@ -0,0 +1,47 @@ + +D + +

Functions - D

+[index] + diff --git a/doc/html/ada/funcs/E.htm b/doc/html/ada/funcs/E.htm new file mode 100644 index 00000000000..ad3f2565a45 --- /dev/null +++ b/doc/html/ada/funcs/E.htm @@ -0,0 +1,18 @@ + +E + +

Functions - E

+[index] + diff --git a/doc/html/ada/funcs/F.htm b/doc/html/ada/funcs/F.htm new file mode 100644 index 00000000000..9400d341981 --- /dev/null +++ b/doc/html/ada/funcs/F.htm @@ -0,0 +1,55 @@ + +F + +

Functions - F

+[index] + diff --git a/doc/html/ada/funcs/G.htm b/doc/html/ada/funcs/G.htm new file mode 100644 index 00000000000..486c3b0b1e8 --- /dev/null +++ b/doc/html/ada/funcs/G.htm @@ -0,0 +1,96 @@ + +G + +

Functions - G

+[index] + diff --git a/doc/html/ada/funcs/H.htm b/doc/html/ada/funcs/H.htm new file mode 100644 index 00000000000..bf0256ee261 --- /dev/null +++ b/doc/html/ada/funcs/H.htm @@ -0,0 +1,22 @@ + +H + +

Functions - H

+[index] + diff --git a/doc/html/ada/funcs/I.htm b/doc/html/ada/funcs/I.htm new file mode 100644 index 00000000000..7813c747c3f --- /dev/null +++ b/doc/html/ada/funcs/I.htm @@ -0,0 +1,51 @@ + +I + +

Functions - I

+[index] + diff --git a/doc/html/ada/funcs/K.htm b/doc/html/ada/funcs/K.htm new file mode 100644 index 00000000000..aece9503646 --- /dev/null +++ b/doc/html/ada/funcs/K.htm @@ -0,0 +1,14 @@ + +K + +

Functions - K

+[index] + diff --git a/doc/html/ada/funcs/L.htm b/doc/html/ada/funcs/L.htm new file mode 100644 index 00000000000..b7d63ddf47e --- /dev/null +++ b/doc/html/ada/funcs/L.htm @@ -0,0 +1,20 @@ + +L + +

Functions - L

+[index] + diff --git a/doc/html/ada/funcs/M.htm b/doc/html/ada/funcs/M.htm new file mode 100644 index 00000000000..9d095f2a0a8 --- /dev/null +++ b/doc/html/ada/funcs/M.htm @@ -0,0 +1,51 @@ + +M + +

Functions - M

+[index] + diff --git a/doc/html/ada/funcs/N.htm b/doc/html/ada/funcs/N.htm new file mode 100644 index 00000000000..df8df6781f0 --- /dev/null +++ b/doc/html/ada/funcs/N.htm @@ -0,0 +1,35 @@ + +N + +

Functions - N

+[index] + diff --git a/doc/html/ada/funcs/O.htm b/doc/html/ada/funcs/O.htm new file mode 100644 index 00000000000..e624243342a --- /dev/null +++ b/doc/html/ada/funcs/O.htm @@ -0,0 +1,12 @@ + +O + +

Functions - O

+[index] + diff --git a/doc/html/ada/funcs/P.htm b/doc/html/ada/funcs/P.htm new file mode 100644 index 00000000000..f781d9c0ebe --- /dev/null +++ b/doc/html/ada/funcs/P.htm @@ -0,0 +1,59 @@ + +P + +

Functions - P

+[index] + diff --git a/doc/html/ada/funcs/Q.htm b/doc/html/ada/funcs/Q.htm new file mode 100644 index 00000000000..d4874689bdb --- /dev/null +++ b/doc/html/ada/funcs/Q.htm @@ -0,0 +1,8 @@ + +Q + +

Functions - Q

+[index] + diff --git a/doc/html/ada/funcs/R.htm b/doc/html/ada/funcs/R.htm new file mode 100644 index 00000000000..cd10c6f3cea --- /dev/null +++ b/doc/html/ada/funcs/R.htm @@ -0,0 +1,39 @@ + +R + +

Functions - R

+[index] + diff --git a/doc/html/ada/funcs/S.htm b/doc/html/ada/funcs/S.htm new file mode 100644 index 00000000000..b3a542df629 --- /dev/null +++ b/doc/html/ada/funcs/S.htm @@ -0,0 +1,191 @@ + +S + +

Functions - S

+[index] + diff --git a/doc/html/ada/funcs/T.htm b/doc/html/ada/funcs/T.htm new file mode 100644 index 00000000000..22401c4b388 --- /dev/null +++ b/doc/html/ada/funcs/T.htm @@ -0,0 +1,38 @@ + +T + +

Functions - T

+[index] + diff --git a/doc/html/ada/funcs/U.htm b/doc/html/ada/funcs/U.htm new file mode 100644 index 00000000000..100f90e2f22 --- /dev/null +++ b/doc/html/ada/funcs/U.htm @@ -0,0 +1,23 @@ + +U + +

Functions - U

+[index] + diff --git a/doc/html/ada/funcs/V.htm b/doc/html/ada/funcs/V.htm new file mode 100644 index 00000000000..b926d7cd507 --- /dev/null +++ b/doc/html/ada/funcs/V.htm @@ -0,0 +1,11 @@ + +V + +

Functions - V

+[index] + diff --git a/doc/html/ada/funcs/W.htm b/doc/html/ada/funcs/W.htm new file mode 100644 index 00000000000..d27242a9733 --- /dev/null +++ b/doc/html/ada/funcs/W.htm @@ -0,0 +1,53 @@ + +W + +

Functions - W

+[index] + diff --git a/doc/html/ada/index.htm b/doc/html/ada/index.htm new file mode 100644 index 00000000000..4a13484de69 --- /dev/null +++ b/doc/html/ada/index.htm @@ -0,0 +1,39 @@ + + +Source Browser + + +<H2 ALIGN=CENTER>Files</H2> +<A HREF="files/T.htm">[T]</A> +<HR> +<H2 ALIGN=CENTER>Functions/Procedures</H2> +<A HREF="funcs/A.htm">[A]</A> +<A HREF="funcs/B.htm">[B]</A> +<A HREF="funcs/C.htm">[C]</A> +<A HREF="funcs/D.htm">[D]</A> +<A HREF="funcs/E.htm">[E]</A> +<A HREF="funcs/F.htm">[F]</A> +<A HREF="funcs/G.htm">[G]</A> +<A HREF="funcs/H.htm">[H]</A> +<A HREF="funcs/I.htm">[I]</A> +<A HREF="funcs/K.htm">[K]</A> +<A HREF="funcs/L.htm">[L]</A> +<A HREF="funcs/M.htm">[M]</A> +<A HREF="funcs/N.htm">[N]</A> +<A HREF="funcs/O.htm">[O]</A> +<A HREF="funcs/P.htm">[P]</A> +<A HREF="funcs/Q.htm">[Q]</A> +<A HREF="funcs/R.htm">[R]</A> +<A HREF="funcs/S.htm">[S]</A> +<A HREF="funcs/T.htm">[T]</A> +<A HREF="funcs/U.htm">[U]</A> +<A HREF="funcs/V.htm">[V]</A> +<A HREF="funcs/W.htm">[W]</A> + + + + + + + + diff --git a/doc/html/ada/main.htm b/doc/html/ada/main.htm new file mode 100644 index 00000000000..701fe7d1437 --- /dev/null +++ b/doc/html/ada/main.htm @@ -0,0 +1,69 @@ + + + +

[No frame version is here]

Files

+[T] +

Functions/Procedures

+[A] +[B] +[C] +[D] +[E] +[F] +[G] +[H] +[I] +[K] +[L] +[M] +[N] +[O] +[P] +[Q] +[R] +[S] +[T] +[U] +[V] +[W] +
+You should start your browsing with one of these files: + + diff --git a/doc/html/ada/table.html b/doc/html/ada/table.html new file mode 100644 index 00000000000..ce8d91f4eb6 --- /dev/null +++ b/doc/html/ada/table.html @@ -0,0 +1,341 @@ + + + +Correspondence between ncurses C and Ada functions + + +

Correspondence between ncurses C and Ada functions

+

Sorted by C function name

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
C nameAda nameman page
_nc_freeall()Curses_Free_Allcurs_trace.3x
_tracef()Trace_Putcurs_trace.3x
assume_default_colors()Assume_Default_Colorsdefault_colors.3x
baudrate()Baudratecurs_termattrs.3x
beep()Beepcurs_beep.3x
bottom_panel()Bottompanel.3x
box()Boxcurs_border.3x
can_change_color()Can_Change_Colorcurs_color.3x
cbreak()Set_Cbreak_Modecurs_inopts.3x
clearok()Clear_On_Next_Updatecurs_outopts.3x
color_content()Color_Contentcurs_color.3x
copywin()Copycurs_overlay.3x
current_field()Currentform_page.3x
current_item()Currentmitem_current.3x
curs_set()Set_Cursor_Visibilitycurs_kernel.3x
curscrCurrent_Windowcurs_initscr.3x
curses_version()Curses_Versioncurs_extend.3x
data_ahead()Data_Aheadform_data.3x
data_behind()Data_Behindform_data.3x
def_prog_mode()Save_Curses_Modecurs_kernel.3x
define_key()Define_Keydefine_key.3x
del_panel()Deletepanel.3x
delay_output()Delay_Outputcurs_util.3x
delwin()Deletecurs_window.3x
derwin()Derived_Windowcurs_window.3x
doupdate()Update_Screencurs_refresh.3x
dup_field()Duplicateform_field_new.3x
dupwin()Duplicatecurs_window.3x
dynamic_field_info()Dynamic_Infoform_field_info.3x
echo()Set_Echo_Modecurs_inopts.3x
endwin()End_Windowscurs_initscr.3x
erasechar()Erase_Charactercurs_termattrs.3x
field_back()Backgroundform_field_attributes.3x
field_back()Backgroundform_field_attributes.3x
field_buffer()Get_Bufferform_field_buffer.3x
field_count()Field_Countform_field.3x
field_fore()Foregroundform_field_attributes.3x
field_fore()Foregroundform_field_attributes.3x
field_index()Get_Indexform_page.3x
field_info()Infoform_field_info.3x
field_init()Get_Field_Init_Hookform_hook.3x
field_just()Get_Justificationform_field_just.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts_on()Switch_Optionsform_field_opts.3x
field_pad()Pad_Characterform_field_attributes.3x
field_status()Changedform_field_buffer.3x
field_term()Get_Field_Term_Hookform_hook.3x
field_type()Get_Typeform_field_validation.3x
field_userptrGet_User_Dataform_field_userptr.3x
field_userptrGet_User_Dataform_field_userptr.3x
flash()Flash_Screencurs_beep.3x
flushinp()Flush_Inputcurs_util.3x
form_driver()Driverform_driver.3x
form_fields()Fieldsform_field.3x
form_init()Get_Form_Init_Hookform_hook.3x
form_opts()Get_Optionsform_opts.3x
form_opts()Get_Optionsform_opts.3x
form_opts_on()Switch_Optionsform_opts.3x
form_page()Pageform_page.3x
form_sub()Get_Sub_Windowform_win.3x
form_term()Get_Form_Term_Hookform_hook.3x
form_userptrGet_User_Dataform_userptr.3x
form_userptrGet_User_Dataform_userptr.3x
form_win()Get_Windowform_win.3x
free_field()Deleteform_field_new.3x
free_form()Deleteform_new.3x
free_item()Deletemitem_new.3x
free_menu()Deletemenu_new.3x
getbegyx()Get_Window_Positioncurs_getyx.3x
getmaxyx()Get_Sizecurs_getyx.3x
getmouse()Get_Mousecurs_mouse.3x
getparyx()Get_Origin_Relative_To_Parentcurs_getyx.3x
getyx()Get_Cursor_Positioncurs_getyx.3x
halfdelay()Half_Delaycurs_inopts.3x
has_colors()Has_Colorscurs_color.3x
has_ic()Has_Insert_Charactercurs_termattrs.3x
has_il()Has_Insert_Linecurs_termattrs.3x
has_key()Has_Keycurs_getch.3x
hide_panel()Hidepanel.3x
idcok()Use_Insert_Delete_Charactercurs_outopts.3x
idlok()Use_Insert_Delete_Linecurs_outopts.3x
immedok()Immediate_Update_Modecurs_outopts.3x
init_color()Init_Colorcurs_color.3x
init_pair()Init_Paircurs_color.3x
initscr()Init_Screencurs_initscr.3x
initscr()Init_Windowscurs_initscr.3x
intrflush()Set_Flush_On_Interrupt_Modecurs_inopts.3x
is_linetouched()Is_Touchedcurs_touch.3x
is_wintouched()Is_Touchedcurs_touch.3x
isendwin()Is_End_Windowcurs_initscr.3x
item_count()Item_Countmenu_items.3x
item_description();Descriptionmitem_name.3x
item_index()Get_Indexmitem_current.3x
item_init()Get_Item_Init_Hookmenu_hook.3x
item_name()Namemitem_name.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts_on()Switch_Optionsmitem_opts.3x
item_term()Get_Item_Term_Hookmenu_hook.3x
item_userptrGet_User_Datamitem_userptr.3x
item_userptrGet_User_Datamitem_userptr.3x
item_value()Valuemitem_value.3x
item_visible()Visiblemitem_visible.3x
keyname()Key_Namecurs_util.3x
keyname()Key_Namecurs_util.3x
keyok()Enable_Keykeyok.3x
keypad()Set_KeyPad_Modecurs_inopts.3x
killchar()Kill_Charactercurs_termattrs.3x
leaveok()Leave_Cursor_After_Updatecurs_outopts.3x
link_field()Linkform_field_new.3x
longname()Long_Namecurs_termattrs.3x
longname()Long_Namecurs_termattrs.3x
menu_back()Backgroundmenu_attributes.3x
menu_back()Backgroundmenu_attributes.3x
menu_driver()Drivermenu_driver.3x
menu_fore()Foregroundmenu_attributes.3x
menu_fore()Foregroundmenu_attributes.3x
menu_format()Formatmenu_format.3x
menu_grey()Greymenu_attributes.3x
menu_grey()Greymenu_attributes.3x
menu_init()Get_Menu_Init_Hookmenu_hook.3x
menu_items()Itemsmenu_items.3x
menu_mark()Markmenu_mark.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts_on()Switch_Optionsmenu_opts.3x
menu_pad()Pad_Charactermenu_attributes.3x
menu_pattern()Patternmenu_pattern.3x
menu_requestname.3xmenu_driver.3x
menu_spacing()Spacingmenu_spacing.3x
menu_sub()Get_Sub_Windowmenu_win.3x
menu_term()Get_Menu_Term_Hookmenu_hook.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_win()Get_Windowmenu_win.3x
meta()Set_Meta_Modecurs_inopts.3x
mouseinterval()Mouse_Intervalcurs_mouse.3x
mousemask()Start_Mousecurs_mouse.3x
move_field()Moveform_field.3x
move_panel()Movepanel.3x
mvderwin()Move_Derived_Windowcurs_window.3x
mvwaddch()Addcurs_addch.3x
mvwaddchnstr()Addcurs_addchstr.3x
mvwaddnstr()Addcurs_addstr.3x
mvwchgat()Change_Attributescurs_attr.3x
mvwdelch()Delete_Charactercurs_delch.3x
mvwgetnstr()Getcurs_getstr.3x
mvwin()Move_Windowcurs_window.3x
mvwinch()Peekcurs_inch.3x
mvwinchnstr()Peekcurs_inchstr.3x
mvwinnstr()Peekcurs_instr.3x
mvwinsch()Insertcurs_insch.3x
mvwinsnstr()Insertcurs_insstr.3x
napms()Nap_Milli_Secondscurs_kernel.3x
new_field()Createform_field_new.3x
new_field()New_Fieldform_field_new.3x
new_form()Createform_new.3x
new_form()New_Formform_new.3x
new_item()Createmitem_new.3x
new_item()New_Itemmitem_new.3x
new_menu()Createmenu_new.3x
new_page()Is_New_Pageform_new_page.3x
new_panel()Createpanel.3x
new_panel()New_Panelpanel.3x
newpad()New_Padcurs_pad.3x
newwin()Createcurs_window.3x
nl()Set_NL_Modecurs_outopts.3x
nodelay()Set_NoDelay_Modecurs_inopts.3x
notimeout()Set_Escape_Time_Modecurs_inopts.3x
overlay()Overlaycurs_overlay.3x
overwrite()Overwritecurs_overlay.3x
pair_content()Pair_Contentcurs_color.3x
panel_above()Abovepanel.3x
panel_below()Belowpanel.3x
panel_hidden()Is_Hiddenpanel.3x
panel_userptrGet_User_Datapanel.3x
panel_userptrGet_User_Datapanel.3x
panel_window()Get_Windowpanel.3x
panel_window()Panel_Windowpanel.3x
pechochar()Add_Character_To_Pad_And_Echo_Itcurs_pad.3x
pnoutrefresh()Refresh_Without_Updatecurs_pad.3x
pos_form_cursor()Position_Cursorform_cursor.3x
pos_menu_cursor()Position_Cursormenu_cursor.3x
post_form()Postform_post.3x
post_menu()Postmenu_post.3x
prefresh()Refreshcurs_pad.3x
qiflush()Set_Queue_Interrupt_Modecurs_inopts.3x
raw()Set_Raw_Modecurs_inopts.3x
redrawwin()Redrawcurs_refresh.3x
replace_panel()Replacepanel.3x
reset_prog_mode()Reset_Curses_Modecurs_kernel.3x
resetty();Reset_Terminal_Statecurs_kernel.3x
ripoffline()Rip_Off_Linescurs_kernel.3x
savetty()Save_Terminal_Statecurs_kernel.3x
scale_form()Scaleform_win.3x
scale_menu()Scalemenu_win.3x
scr_dump()Screen_Dump_To_Filecurs_scr_dump.3x
scr_init()Screen_Init_From_Filecurs_scr_dump.3x
scr_restore()Screen_Restore_From_Filecurs_scr_dump.3x
scr_set()Screen_Set_Filecurs_scr_dump.3x
scrollok()Allow_Scrollingcurs_outopts.3x
set_current_field()Set_Currentform_page.3x
set_current_item()Set_Currentmitem_current.3x
set_field_back()Set_Backgroundform_field_attributes.3x
set_field_buffer()Set_Bufferform_field_buffer.3x
set_field_fore()Set_Foregroundform_field_attributes.3x
set_field_init()Set_Field_Init_Hookform_hook.3x
set_field_just()Set_Justificationform_field_just.3x
set_field_max()Set_Maximum_Sizeform_field_buffer.3x
set_field_opts()Set_Optionsform_field_opts.3x
set_field_pad()Set_Pad_Characterform_field_attributes.3x
set_field_status()Set_Statusform_field_buffer.3x
set_field_term()Set_Field_Term_Hookform_hook.3x
set_field_type()Set_Typeform_fieldtype.3x
set_field_userptrSet_User_Dataform_field_userptr.3x
set_form_fields()Redefineform_field.3x
set_form_fields()Set_Fieldsform_field.3x
set_form_init()Set_Form_Init_Hookform_hook.3x
set_form_opts()Set_Optionsform_opts.3x
set_form_page()Set_Pageform_page.3x
set_form_sub()Set_Sub_Windowform_win.3x
set_form_term()Set_Form_Term_Hookform_hook.3x
set_form_userptrSet_User_Dataform_userptr.3x
set_form_win()Set_Windowform_win.3x
set_item_init()Set_Item_Init_Hookmenu_hook.3x
set_item_opts()Set_Optionsmitem_opts.3x
set_item_term()Set_Item_Term_Hookmenu_hook.3x
set_item_userptrSet_User_Datamitem_userptr.3x
set_item_value()Set_Valuemitem_value.3x
set_menu_back()Set_Backgroundmenu_attributes.3x
set_menu_fore()Set_Foregroundmenu_attributes.3x
set_menu_format()Set_Formatmenu_format.3x
set_menu_grey()Set_Greymenu_attributes.3x
set_menu_init()Set_Menu_Init_Hookmenu_hook.3x
set_menu_items()Redefinemenu_items.3x
set_menu_mark()Set_Markmenu_mark.3x
set_menu_opts()Set_Optionsmenu_opts.3x
set_menu_pad()Set_Pad_Charactermenu_attributes.3x
set_menu_pattern()Set_Patternmenu_pattern.3x
set_menu_spacing()Set_Spacingmenu_spacing.3x
set_menu_sub()Set_Sub_Windowmenu_win.3x
set_menu_term()Set_Menu_Term_Hookmenu_hook.3x
set_menu_userptrSet_User_Datamenu_userptr.3x
set_menu_win()Set_Windowmenu_win.3x
set_new_page()Set_New_Pageform_new_page.3x
set_panel_userptrSet_User_Datapanel.3x
set_top_row()Set_Top_Rowmitem_current.3x
show_panel()Showpanel.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attron()Switch_Soft_Label_Key_Attributescurs_slk.3x
slk_attrset()Set_Soft_Label_Key_Attributescurs_slk.3x
slk_clear()Clear_Soft_Label_Keyscurs_slk.3x
slk_color()Set_Soft_Label_Key_Colorcurs_slk.3x
slk_init()Init_Soft_Label_Keyscurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_noutrefresh()Refresh_Soft_Label_Keys_Without_Updatecurs_slk.3x
slk_refresh()Refresh_Soft_Label_Keycurs_slk.3x
slk_restore()Restore_Soft_Label_Keyscurs_slk.3x
slk_set()Set_Soft_Label_Keycurs_slk.3x
slk_touch()Touch_Soft_Label_Keyscurs_slk.3x
standout()Standoutcurs_attr.3x
start_color()Start_Colorcurs_color.3x
stdscrStandard_Windowcurs_initscr.3x
subpad()Sub_Padcurs_pad.3x
subwin()Sub_Windowcurs_window.3x
syncok()Set_Synch_Modecurs_window.3x
termattrs()Supported_Attributescurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
top_panel()Toppanel.3x
top_row()Top_Rowmitem_current.3x
touchline()Touchcurs_touch.3x
touchwin()Touchcurs_touch.3x
trace()Trace_oncurs_trace.3x
unctrl()Un_Controlcurs_util.3x
unctrl()Un_Controlcurs_util.3x
ungetch()Undo_Keystrokecurs_getch.3x
ungetmouse()Unget_Mousecurs_mouse.3x
untouchwin()Untouchcurs_touch.3x
update_panels()Update_Panelspanel.3x
use_default_colors()Use_Default_Colorsdefault_colors.3x
use_extended_names()Use_Extended_Namescurs_extend.3x
waddch()Addcurs_addch.3x
waddchnstr()Addcurs_addchstr.3x
waddnstr()Addcurs_addstr.3x
wattr_get()Get_Character_Attributescurs_attr.3x
wattr_get()Get_Character_Attributecurs_attr.3x
wattron()Switch_Character_Attributecurs_attr.3x
wattrset()Set_Character_Attributescurs_attr.3x
wbkgd()Change_Backgroundcurs_bkgd.3x
wbkgdget()Get_Backgroundcurs_bkgd.3x
wbkgdset()Set_Backgroundcurs_bkgd.3x
wborder()Bordercurs_border.3x
wchgat()Change_Attributescurs_attr.3x
wclear()Clearcurs_clear.3x
wclrtobot()Clear_To_End_Of_Screencurs_clear.3x
wclrtoeol()Clear_To_End_Of_Linecurs_clear.3x
wcolor_set()Set_Colorcurs_attr.3x
wdelch()Delete_Charactercurs_delch.3x
wdeleteln()Delete_Linecurs_deleteln.3x
wechochar()Add_With_Immediate_Echocurs_addch.3x
wenclose()Enclosed_In_Windowcurs_mouse.3x
werase()Erasecurs_clear.3x
wgetch()Get_Keystrokecurs_getch.3x
wgetnstr()Getcurs_getstr.3x
whline()Horizontal_Linecurs_border.3x
winch()Peekcurs_inch.3x
winchnstr()Peekcurs_inchstr.3x
winnstr()Peekcurs_instr.3x
winsch()Insertcurs_insch.3x
winsdelln()Insert_Delete_Linescurs_deleteln.3x
winsertln()Insert_Linecurs_deleteln.3x
winsnstr()Insertcurs_insstr.3x
wmove()Move_Cursorcurs_move.3x
wnoutrefresh()Refresh_Without_Updatecurs_refresh.3x
wredrawln()Redrawcurs_refresh.3x
wrefresh()Refreshcurs_refresh.3x
wresize()Resizewresize.3x
wscrl()Scrollcurs_scroll.3x
wsetscrreg()Set_Scroll_Regioncurs_outopts.3x
wsyncdown()Synchronize_Downwardscurs_window.3x
wsyncup()Synchronize_Upwardscurs_window.3x
wtimeout()Set_Timeout_Modecurs_inopts.3x
wtouchln()Change_Line_Statuscurs_touch.3x
wvline()Vertical_Linecurs_border.3x
diff --git a/doc/html/ada/terminal_interface-curses-aux__adb.htm b/doc/html/ada/terminal_interface-curses-aux__adb.htm new file mode 100644 index 00000000000..fda608af7f7 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-aux__adb.htm @@ -0,0 +1,122 @@ + +terminal_interface-curses-aux.adb + +

File : terminal_interface-curses-aux.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Aux                       --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package body Terminal_Interface.Curses.Aux is
+   --
+   --  Some helpers
+   procedure Fill_String (Cp  : chars_ptr;
+                          Str : out String)
+   is
+      --  Fill the string with the characters referenced by the
+      --  chars_ptr.
+      --
+      Len : Natural;
+   begin
+      if Cp /= Null_Ptr then
+         Len := Natural (Strlen (Cp));
+         if Str'Length < Len then
+            raise Constraint_Error;
+         end if;
+         declare
+            S : String (1 .. Len);
+         begin
+            S := Value (Cp);
+            Str (Str'First .. (Str'First + Len - 1)) := S (S'Range);
+         end;
+      else
+         Len := 0;
+      end if;
+
+      if Len < Str'Length then
+         Str ((Str'First + Len) .. Str'Last) := (others => ' ');
+      end if;
+
+   end Fill_String;
+
+   function Fill_String (Cp : chars_ptr) return String
+   is
+      Len : Natural;
+   begin
+      if Cp /= Null_Ptr then
+         Len := Natural (Strlen (Cp));
+         if Len = 0 then
+            return "";
+         else
+            declare
+               S : String (1 .. Len);
+            begin
+               Fill_String (Cp, S);
+               return S;
+            end;
+         end if;
+      else
+         return "";
+      end if;
+   end Fill_String;
+
+   procedure Eti_Exception (Code : Eti_Error)
+   is
+   begin
+      case Code is
+         when E_Ok              => null;
+         when E_System_Error    => raise Eti_System_Error;
+         when E_Bad_Argument    => raise Eti_Bad_Argument;
+         when E_Posted          => raise Eti_Posted;
+         when E_Connected       => raise Eti_Connected;
+         when E_Bad_State       => raise Eti_Bad_State;
+         when E_No_Room         => raise Eti_No_Room;
+         when E_Not_Posted      => raise Eti_Not_Posted;
+         when E_Unknown_Command => raise Eti_Unknown_Command;
+         when E_No_Match        => raise Eti_No_Match;
+         when E_Not_Selectable  => raise Eti_Not_Selectable;
+         when E_Not_Connected   => raise Eti_Not_Connected;
+         when E_Request_Denied  => raise Eti_Request_Denied;
+         when E_Invalid_Field   => raise Eti_Invalid_Field;
+         when E_Current         => raise Eti_Current;
+      end case;
+   end Eti_Exception;
+
+end Terminal_Interface.Curses.Aux;
+
diff --git a/doc/html/ada/terminal_interface-curses-aux__ads.htm b/doc/html/ada/terminal_interface-curses-aux__ads.htm new file mode 100644 index 00000000000..043fe97ebe9 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-aux__ads.htm @@ -0,0 +1,130 @@ + +terminal_interface-curses-aux.ads + +

File : terminal_interface-curses-aux.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                       Terminal_Interface.Curses.Aux                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2007,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.17 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+--  curses binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+with Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Unchecked_Conversion;
+
+package Terminal_Interface.Curses.Aux is
+   pragma Preelaborate (Terminal_Interface.Curses.Aux);
+
+   use type Interfaces.C.int;
+
+   subtype C_Int      is Interfaces.C.int;
+   subtype C_Short    is Interfaces.C.short;
+   subtype C_Long_Int is Interfaces.C.long;
+   subtype C_Size_T   is Interfaces.C.size_t;
+   subtype C_UInt     is Interfaces.C.unsigned;
+   subtype C_ULong    is Interfaces.C.unsigned_long;
+   subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr;
+   type    C_Void_Ptr is new System.Address;
+   type    C_Chtype   is new C_ULong;
+   type    C_AttrType is new C_ULong;
+
+   --  This is how those constants are defined in ncurses. I see them also
+   --  exactly like this in all ETI implementations I ever tested. So it
+   --  could be that this is quite general, but please check with your curses.
+   --  This is critical, because curses sometime mixes boolean returns with
+   --  returning an error status.
+   Curses_Ok    : constant C_Int := 0;
+   Curses_Err   : constant C_Int := -1;
+
+   Curses_True  : constant C_Int := 1;
+   Curses_False : constant C_Int := 0;
+
+   --  Eti_Error: type for error codes returned by the menu and form subsystem
+   subtype Eti_Error is C_Int range -14 .. 0;
+
+   E_Ok               : constant Eti_Error := 0;
+   E_System_Error     : constant Eti_Error := -1;
+   E_Bad_Argument     : constant Eti_Error := -2;
+   E_Posted           : constant Eti_Error := -3;
+   E_Connected        : constant Eti_Error := -4;
+   E_Bad_State        : constant Eti_Error := -5;
+   E_No_Room          : constant Eti_Error := -6;
+   E_Not_Posted       : constant Eti_Error := -7;
+   E_Unknown_Command  : constant Eti_Error := -8;
+   E_No_Match         : constant Eti_Error := -9;
+   E_Not_Selectable   : constant Eti_Error := -10;
+   E_Not_Connected    : constant Eti_Error := -11;
+   E_Request_Denied   : constant Eti_Error := -12;
+   E_Invalid_Field    : constant Eti_Error := -13;
+   E_Current          : constant Eti_Error := -14;
+
+   procedure Eti_Exception (Code : Eti_Error);
+   --  Dispatch the error code and raise the appropriate exception
+   --
+   --
+   --  Some helpers
+   function Chtype_To_AttrChar is new
+     Unchecked_Conversion (Source => C_Chtype,
+                           Target => Attributed_Character);
+   function AttrChar_To_Chtype is new
+     Unchecked_Conversion (Source => Attributed_Character,
+                           Target => C_Chtype);
+
+   function AttrChar_To_AttrType is new
+     Unchecked_Conversion (Source => Attributed_Character,
+                           Target => C_AttrType);
+
+   function AttrType_To_AttrChar is new
+     Unchecked_Conversion (Source => C_AttrType,
+                           Target => Attributed_Character);
+
+   procedure Fill_String (Cp  : chars_ptr;
+                          Str : out String);
+   --  Fill the Str parameter with the string denoted by the chars_ptr
+   --  C-Style string.
+
+   function Fill_String (Cp : chars_ptr) return String;
+   --  Same but as function.
+
+end Terminal_Interface.Curses.Aux;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm new file mode 100644 index 00000000000..172fcee4d1c --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm @@ -0,0 +1,72 @@ + +terminal_interface-curses-forms-field_types-alpha.adb + +

File : terminal_interface-curses-forms-field_types-alpha.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.10 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Alpha_Field)
+   is
+      C_Alpha_Field_Type : C_Field_Type;
+      pragma Import (C, C_Alpha_Field_Type, "TYPE_ALPHA");
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_Alpha_Field_Type;
+                             Arg1 : C_Int) return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+   begin
+      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width));
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm new file mode 100644 index 00000000000..9a861b53b59 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm @@ -0,0 +1,59 @@ + +terminal_interface-curses-forms-field_types-alpha.ads + +

File : terminal_interface-curses-forms-field_types-alpha.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface.Curses.Forms.Field_Types.Alpha is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha);
+
+   type Alpha_Field is new Field_Type
+     with record
+        Minimum_Field_Width : Natural := 0;
+     end record;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Alpha_Field);
+   pragma Inline (Set_Field_Type);
+
+end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm new file mode 100644 index 00000000000..d47c8790b60 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm @@ -0,0 +1,72 @@ + +terminal_interface-curses-forms-field_types-alphanumeric.adb + +

File : terminal_interface-curses-forms-field_types-alphanumeric.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.10 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : AlphaNumeric_Field)
+   is
+      C_AlphaNumeric_Field_Type : C_Field_Type;
+      pragma Import (C, C_AlphaNumeric_Field_Type, "TYPE_ALNUM");
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_AlphaNumeric_Field_Type;
+                             Arg1 : C_Int) return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+   begin
+      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width));
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm new file mode 100644 index 00000000000..fb13c7c4299 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm @@ -0,0 +1,60 @@ + +terminal_interface-curses-forms-field_types-alphanumeric.ads + +

File : terminal_interface-curses-forms-field_types-alphanumeric.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
+   pragma Preelaborate
+     (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric);
+
+   type AlphaNumeric_Field is new Field_Type
+     with record
+        Minimum_Field_Width : Natural := 0;
+     end record;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : AlphaNumeric_Field);
+   pragma Inline (Set_Field_Type);
+
+end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm new file mode 100644 index 00000000000..587c3936928 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm @@ -0,0 +1,87 @@ + +terminal_interface-curses-forms-field_types-enumeration-ada.adb + +

File : terminal_interface-curses-forms-field_types-enumeration-ada.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998,2004 Free 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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.10 @
+--  @Date: 2004/08/21 21:37:00 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
+
+   function Create (Set            : Type_Set := Mixed_Case;
+                    Case_Sensitive : Boolean  := False;
+                    Must_Be_Unique : Boolean  := False)
+                    return Enumeration_Field
+   is
+      I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1);
+      J : Positive := 1;
+   begin
+      I.Case_Sensitive := Case_Sensitive;
+      I.Match_Must_Be_Unique := Must_Be_Unique;
+
+      for E in T'Range loop
+         I.Names (J) := new String'(T'Image (E));
+         --  The Image attribute defaults to upper case, so we have to handle
+         --  only the other ones...
+         if Set /= Upper_Case then
+            I.Names (J).all := To_Lower (I.Names (J).all);
+            if Set = Mixed_Case then
+               I.Names (J)(I.Names (J).all'First) :=
+                 To_Upper (I.Names (J)(I.Names (J).all'First));
+            end if;
+         end if;
+         J := J + 1;
+      end loop;
+
+      return Create (I, True);
+   end Create;
+
+   function Value (Fld : Field;
+                   Buf : Buffer_Number := Buffer_Number'First) return T
+   is
+   begin
+      return T'Value (Get_Buffer (Fld, Buf));
+   end Value;
+
+end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm new file mode 100644 index 00000000000..cd2b4d61a2d --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm @@ -0,0 +1,65 @@ + +terminal_interface-curses-forms-field_types-enumeration-ada.ads + +

File : terminal_interface-curses-forms-field_types-enumeration-ada.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.10 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type T is (<>);
+
+package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
+   pragma Preelaborate
+     (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada);
+
+   function Create (Set            : Type_Set := Mixed_Case;
+                    Case_Sensitive : Boolean  := False;
+                    Must_Be_Unique : Boolean  := False)
+                    return Enumeration_Field;
+
+   function Value (Fld : Field;
+                   Buf : Buffer_Number := Buffer_Number'First) return T;
+   --  Translate the content of the fields buffer - indicated by the
+   --  buffer number - into an enumeration value. If the buffer is empty
+   --  or the content is invalid, a Constraint_Error is raises.
+
+end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm new file mode 100644 index 00000000000..5866a704053 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm @@ -0,0 +1,125 @@ + +terminal_interface-curses-forms-field_types-enumeration.adb + +

File : terminal_interface-curses-forms-field_types-enumeration.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.Enumeration         --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.8 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Unchecked_Deallocation;
+with Interfaces.C; use Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
+
+   function Create (Info               : Enumeration_Info;
+                    Auto_Release_Names : Boolean := False)
+                    return Enumeration_Field
+   is
+      procedure Release_String is
+        new Ada.Unchecked_Deallocation (String,
+                                        String_Access);
+      E : Enumeration_Field;
+      L : constant size_t := 1 + size_t (Info.C);
+      S : String_Access;
+   begin
+      E.Case_Sensitive       := Info.Case_Sensitive;
+      E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique;
+      E.Arr := new chars_ptr_array (size_t (1) .. L);
+      for I in 1 .. Positive (L - 1) loop
+         if Info.Names (I) = null then
+            raise Form_Exception;
+         end if;
+         E.Arr (size_t (I)) := New_String (Info.Names (I).all);
+         if Auto_Release_Names then
+            S := Info.Names (I);
+            Release_String (S);
+         end if;
+      end loop;
+      E.Arr (L) := Null_Ptr;
+      return E;
+   end Create;
+
+   procedure Release (Enum : in out Enumeration_Field)
+   is
+      I : size_t := 0;
+      P : chars_ptr;
+   begin
+      loop
+         P := Enum.Arr (I);
+         exit when P = Null_Ptr;
+         Free (P);
+         Enum.Arr (I) := Null_Ptr;
+         I := I + 1;
+      end loop;
+      Enum.Arr := null;
+   end Release;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Enumeration_Field)
+   is
+      C_Enum_Type : C_Field_Type;
+      pragma Import (C, C_Enum_Type, "TYPE_ENUM");
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_Enum_Type;
+                             Arg1 : chars_ptr_array;
+                             Arg2 : C_Int;
+                             Arg3 : C_Int) return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+   begin
+      if Typ.Arr = null then
+         raise Form_Exception;
+      end if;
+      Res := Set_Fld_Type (Arg1 => Typ.Arr.all,
+                           Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)),
+                           Arg3 => C_Int (Boolean'Pos
+                                          (Typ.Match_Must_Be_Unique)));
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ, C_Choice_Router);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm new file mode 100644 index 00000000000..bb0abeba717 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm @@ -0,0 +1,104 @@ + +terminal_interface-curses-forms-field_types-enumeration.ads + +

File : terminal_interface-curses-forms-field_types-enumeration.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--           Terminal_Interface.Curses.Forms.Field_Types.Enumeration        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C.Strings;
+
+package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
+   pragma Preelaborate
+     (Terminal_Interface.Curses.Forms.Field_Types.Enumeration);
+
+   type String_Access is access String;
+
+   --  Type_Set is used by the child package Ada
+   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
+
+   type Enum_Array is array (Positive range <>)
+     of String_Access;
+
+   type Enumeration_Info (C : Positive) is
+      record
+         Names                : Enum_Array (1 .. C);
+         Case_Sensitive       : Boolean := False;
+         Match_Must_Be_Unique : Boolean := False;
+      end record;
+
+   type Enumeration_Field is new Field_Type with private;
+
+   function Create (Info : Enumeration_Info;
+                    Auto_Release_Names : Boolean := False)
+                    return Enumeration_Field;
+   --  Make an fieldtype from the info. Enumerations are special, because
+   --  they normally don't copy the enum values into a private store, so
+   --  we have to care for the lifetime of the info we provide.
+   --  The Auto_Release_Names flag may be used to automatically releases
+   --  the strings in the Names array of the Enumeration_Info.
+
+   function Make_Enumeration_Type (Info : Enumeration_Info;
+                                   Auto_Release_Names : Boolean := False)
+                                   return Enumeration_Field renames Create;
+
+   procedure Release (Enum : in out Enumeration_Field);
+   --  But we may want to release the field to release the memory allocated
+   --  by it internally. After that the Enumeration field is no longer usable.
+
+   --  The next type defintions are all ncurses extensions. They are typically
+   --  not available in other curses implementations.
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Enumeration_Field);
+   pragma Inline (Set_Field_Type);
+
+private
+   type CPA_Access is access Interfaces.C.Strings.chars_ptr_array;
+
+   type Enumeration_Field is new Field_Type with
+      record
+         Case_Sensitive       : Boolean := False;
+         Match_Must_Be_Unique : Boolean := False;
+         Arr                  : CPA_Access := null;
+      end record;
+
+end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm new file mode 100644 index 00000000000..dbe6f6d038b --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm @@ -0,0 +1,76 @@ + +terminal_interface-curses-forms-field_types-intfield.adb + +

File : terminal_interface-curses-forms-field_types-intfield.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.10 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.IntField is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Integer_Field)
+   is
+      C_Integer_Field_Type : C_Field_Type;
+      pragma Import (C, C_Integer_Field_Type, "TYPE_INTEGER");
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_Integer_Field_Type;
+                             Arg1 : C_Int;
+                             Arg2 : C_Long_Int;
+                             Arg3 : C_Long_Int) return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+   begin
+      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
+                           Arg2 => C_Long_Int (Typ.Lower_Limit),
+                           Arg3 => C_Long_Int (Typ.Upper_Limit));
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.IntField;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm new file mode 100644 index 00000000000..86239785354 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm @@ -0,0 +1,61 @@ + +terminal_interface-curses-forms-field_types-intfield.ads + +

File : terminal_interface-curses-forms-field_types-intfield.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface.Curses.Forms.Field_Types.IntField is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField);
+
+   type Integer_Field is new Field_Type with
+      record
+         Precision   : Natural;
+         Lower_Limit : Integer;
+         Upper_Limit : Integer;
+      end record;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Integer_Field);
+   pragma Inline (Set_Field_Type);
+
+end Terminal_Interface.Curses.Forms.Field_Types.IntField;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm new file mode 100644 index 00000000000..e5a598773fb --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm @@ -0,0 +1,72 @@ + +terminal_interface-curses-forms-field_types-ipv4_address.adb + +

File : terminal_interface-curses-forms-field_types-ipv4_address.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.10 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Internet_V4_Address_Field)
+   is
+      C_IPV4_Field_Type : C_Field_Type;
+      pragma Import (C, C_IPV4_Field_Type, "TYPE_IPV4");
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_IPV4_Field_Type)
+                             return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+   begin
+      Res := Set_Fld_Type;
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm new file mode 100644 index 00000000000..8f9e0510b02 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm @@ -0,0 +1,57 @@ + +terminal_interface-curses-forms-field_types-ipv4_address.ads + +

File : terminal_interface-curses-forms-field_types-ipv4_address.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
+   pragma Preelaborate
+     (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address);
+
+   type Internet_V4_Address_Field is new Field_Type with null record;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Internet_V4_Address_Field);
+   pragma Inline (Set_Field_Type);
+
+end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm new file mode 100644 index 00000000000..472e248a3f0 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm @@ -0,0 +1,79 @@ + +terminal_interface-curses-forms-field_types-numeric.adb + +

File : terminal_interface-curses-forms-field_types-numeric.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--            Terminal_Interface.Curses.Forms.Field_Types.Numeric           --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Numeric_Field)
+   is
+      type Double is new Interfaces.C.double;
+
+      C_Numeric_Field_Type : C_Field_Type;
+      pragma Import (C, C_Numeric_Field_Type, "TYPE_NUMERIC");
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_Numeric_Field_Type;
+                             Arg1 : C_Int;
+                             Arg2 : Double;
+                             Arg3 : Double) return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+   begin
+      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
+                           Arg2 => Double (Typ.Lower_Limit),
+                           Arg3 => Double (Typ.Upper_Limit));
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm new file mode 100644 index 00000000000..e3f37a27be0 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm @@ -0,0 +1,61 @@ + +terminal_interface-curses-forms-field_types-numeric.ads + +

File : terminal_interface-curses-forms-field_types-numeric.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--             Terminal_Interface.Curses.Forms.Field_Types.Numeric          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface.Curses.Forms.Field_Types.Numeric is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric);
+
+   type Numeric_Field is new Field_Type with
+      record
+         Precision   : Natural;
+         Lower_Limit : Float;
+         Upper_Limit : Float;
+      end record;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Numeric_Field);
+   pragma Inline (Set_Field_Type);
+
+end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm new file mode 100644 index 00000000000..c1e149a8ad6 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm @@ -0,0 +1,77 @@ + +terminal_interface-curses-forms-field_types-regexp.adb + +

File : terminal_interface-curses-forms-field_types-regexp.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--             Terminal_Interface.Curses.Forms.Field_Types.RegExp           --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.9 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C; use Interfaces.C;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Regular_Expression_Field)
+   is
+      type Char_Ptr is access all Interfaces.C.char;
+
+      C_Regexp_Field_Type : C_Field_Type;
+      pragma Import (C, C_Regexp_Field_Type, "TYPE_REGEXP");
+
+      function Set_Ftyp (F    : Field := Fld;
+                         Cft  : C_Field_Type := C_Regexp_Field_Type;
+                         Arg1 : Char_Ptr) return C_Int;
+      pragma Import (C, Set_Ftyp, "set_field_type");
+
+      Txt : char_array (0 .. Typ.Regular_Expression.all'Length);
+      Len : size_t;
+      Res : Eti_Error;
+   begin
+      To_C (Typ.Regular_Expression.all, Txt, Len);
+      Res := Set_Ftyp (Arg1 => Txt (Txt'First)'Access);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Wrap_Builtin (Fld, Typ);
+   end Set_Field_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm new file mode 100644 index 00000000000..dd273dcb161 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm @@ -0,0 +1,61 @@ + +terminal_interface-curses-forms-field_types-regexp.ads + +

File : terminal_interface-curses-forms-field_types-regexp.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Field_Types.RegExp          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp);
+
+   type String_Access is access String;
+
+   type Regular_Expression_Field is new Field_Type with
+      record
+         Regular_Expression : String_Access;
+      end record;
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : Regular_Expression_Field);
+   pragma Inline (Set_Field_Type);
+
+end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm new file mode 100644 index 00000000000..170de3c8883 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm @@ -0,0 +1,116 @@ + +terminal_interface-curses-forms-field_types-user-choice.adb + +

File : terminal_interface-curses-forms-field_types-user-choice.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--          Terminal_Interface.Curses.Forms.Field_Types.User.Choice         --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.15 @
+--  @Date: 2008/07/26 18:48:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Unchecked_Conversion;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
+
+   pragma Warnings (Off);
+   function To_Argument_Access is new Ada.Unchecked_Conversion
+     (System.Address, Argument_Access);
+   pragma Warnings (On);
+
+   function Generic_Next (Fld : Field;
+                          Usr : System.Address) return C_Int
+   is
+      Result : Boolean;
+      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
+        User_Defined_Field_Type_With_Choice_Access
+        (To_Argument_Access (Usr).Typ);
+   begin
+      Result := Next (Fld, Udf.all);
+      return C_Int (Boolean'Pos (Result));
+   end Generic_Next;
+
+   function Generic_Prev (Fld : Field;
+                          Usr : System.Address) return C_Int
+   is
+      Result : Boolean;
+      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
+        User_Defined_Field_Type_With_Choice_Access
+        (To_Argument_Access (Usr).Typ);
+   begin
+      Result := Previous (Fld, Udf.all);
+      return C_Int (Boolean'Pos (Result));
+   end Generic_Prev;
+
+   --  -----------------------------------------------------------------------
+   --
+   function C_Generic_Choice return C_Field_Type
+   is
+      Res : Eti_Error;
+      T   : C_Field_Type;
+   begin
+      if M_Generic_Choice = Null_Field_Type then
+         T := New_Fieldtype (Generic_Field_Check'Access,
+                             Generic_Char_Check'Access);
+         if T = Null_Field_Type then
+            raise Form_Exception;
+         else
+            Res := Set_Fieldtype_Arg (T,
+                                      Make_Arg'Access,
+                                      Copy_Arg'Access,
+                                      Free_Arg'Access);
+            if Res /= E_Ok then
+               Eti_Exception (Res);
+            end if;
+
+            Res := Set_Fieldtype_Choice (T,
+                                         Generic_Next'Access,
+                                         Generic_Prev'Access);
+            if Res /= E_Ok then
+               Eti_Exception (Res);
+            end if;
+         end if;
+         M_Generic_Choice := T;
+      end if;
+      pragma Assert (M_Generic_Choice /= Null_Field_Type);
+      return M_Generic_Choice;
+   end C_Generic_Choice;
+
+end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm new file mode 100644 index 00000000000..7f39ab4abed --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm @@ -0,0 +1,100 @@ + +terminal_interface-curses-forms-field_types-user-choice.ads + +

File : terminal_interface-curses-forms-field_types-user-choice.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--           Terminal_Interface.Curses.Forms.Field_Types.User.Choice        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  @Date: 2008/07/26 18:49:20 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C;
+
+package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
+   pragma Preelaborate
+     (Terminal_Interface.Curses.Forms.Field_Types.User.Choice);
+
+   subtype C_Int is Interfaces.C.int;
+
+   type User_Defined_Field_Type_With_Choice is abstract new
+     User_Defined_Field_Type with null record;
+   --  This is the root of the mechanism we use to create field types in
+   --  Ada95 that allow the prev/next mechanism. You should your own type
+   --  derive from this one and implement the Field_Check, Character_Check
+   --  Next and Previous functions for your own type.
+
+   type User_Defined_Field_Type_With_Choice_Access is access all
+     User_Defined_Field_Type_With_Choice'Class;
+
+   function Next
+     (Fld : Field;
+      Typ : User_Defined_Field_Type_With_Choice) return Boolean
+      is abstract;
+   --  If True is returned, the function successfully generated a next
+   --  value into the fields buffer.
+
+   function Previous
+     (Fld : Field;
+      Typ : User_Defined_Field_Type_With_Choice) return Boolean
+      is abstract;
+   --  If True is returned, the function successfully generated a previous
+   --  value into the fields buffer.
+
+   --  +----------------------------------------------------------------------
+   --  | Private Part.
+   --  |
+private
+   function C_Generic_Choice return C_Field_Type;
+
+   function Generic_Next (Fld : Field;
+                          Usr : System.Address) return C_Int;
+   pragma Convention (C, Generic_Next);
+   --  This is the generic next Choice_Function for the low-level fieldtype
+   --  representing all the User_Defined_Field_Type derivates. It routes
+   --  the call to the Next implementation for the type.
+
+   function Generic_Prev (Fld : Field;
+                          Usr : System.Address) return C_Int;
+   pragma Convention (C, Generic_Prev);
+   --  This is the generic prev Choice_Function for the low-level fieldtype
+   --  representing all the User_Defined_Field_Type derivates. It routes
+   --  the call to the Previous implementation for the type.
+
+end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm new file mode 100644 index 00000000000..26fa221d020 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm @@ -0,0 +1,139 @@ + +terminal_interface-curses-forms-field_types-user.adb + +

File : terminal_interface-curses-forms-field_types-user.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Field_Types.User            --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.16 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Unchecked_Conversion;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Field_Types.User is
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : User_Defined_Field_Type)
+   is
+      function Allocate_Arg (T : User_Defined_Field_Type'Class)
+                             return Argument_Access;
+
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cft  : C_Field_Type := C_Generic_Type;
+                             Arg1 : Argument_Access)
+                             return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+      Res : Eti_Error;
+
+      function Allocate_Arg (T : User_Defined_Field_Type'Class)
+                             return Argument_Access
+      is
+         Ptr : constant Field_Type_Access
+             := new User_Defined_Field_Type'Class'(T);
+      begin
+         return new Argument'(Usr => System.Null_Address,
+                              Typ => Ptr,
+                              Cft => Null_Field_Type);
+      end Allocate_Arg;
+
+   begin
+      Res := Set_Fld_Type (Arg1 => Allocate_Arg (Typ));
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Field_Type;
+
+   pragma Warnings (Off);
+   function To_Argument_Access is new Ada.Unchecked_Conversion
+     (System.Address, Argument_Access);
+   pragma Warnings (On);
+
+   function Generic_Field_Check (Fld : Field;
+                                 Usr : System.Address) return C_Int
+   is
+      Result : Boolean;
+      Udf    : constant User_Defined_Field_Type_Access :=
+        User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ);
+   begin
+      Result := Field_Check (Fld, Udf.all);
+      return C_Int (Boolean'Pos (Result));
+   end Generic_Field_Check;
+
+   function Generic_Char_Check (Ch  : C_Int;
+                                Usr : System.Address) return C_Int
+   is
+      Result : Boolean;
+      Udf    : constant User_Defined_Field_Type_Access :=
+        User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ);
+   begin
+      Result := Character_Check (Character'Val (Ch), Udf.all);
+      return C_Int (Boolean'Pos (Result));
+   end Generic_Char_Check;
+
+   --  -----------------------------------------------------------------------
+   --
+   function C_Generic_Type return C_Field_Type
+   is
+      Res : Eti_Error;
+      T   : C_Field_Type;
+   begin
+      if M_Generic_Type = Null_Field_Type then
+         T := New_Fieldtype (Generic_Field_Check'Access,
+                             Generic_Char_Check'Access);
+         if T = Null_Field_Type then
+            raise Form_Exception;
+         else
+            Res := Set_Fieldtype_Arg (T,
+                                      Make_Arg'Access,
+                                      Copy_Arg'Access,
+                                      Free_Arg'Access);
+            if Res /= E_Ok then
+               Eti_Exception (Res);
+            end if;
+         end if;
+         M_Generic_Type := T;
+      end if;
+      pragma Assert (M_Generic_Type /= Null_Field_Type);
+      return M_Generic_Type;
+   end C_Generic_Type;
+
+end Terminal_Interface.Curses.Forms.Field_Types.User;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm new file mode 100644 index 00000000000..bfbae59ebfd --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm @@ -0,0 +1,101 @@ + +terminal_interface-curses-forms-field_types-user.ads + +

File : terminal_interface-curses-forms-field_types-user.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Forms.Field_Types.User           --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.13 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C;
+
+package Terminal_Interface.Curses.Forms.Field_Types.User is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User);
+   subtype C_Int is Interfaces.C.int;
+
+   type User_Defined_Field_Type is abstract new Field_Type with null record;
+   --  This is the root of the mechanism we use to create field types in
+   --  Ada95. You should your own type derive from this one and implement
+   --  the Field_Check and Character_Check functions for your own type.
+
+   type User_Defined_Field_Type_Access is access all
+     User_Defined_Field_Type'Class;
+
+   function Field_Check
+     (Fld : Field;
+      Typ : User_Defined_Field_Type) return Boolean
+      is abstract;
+   --  If True is returned, the field is considered valid, otherwise it is
+   --  invalid.
+
+   function Character_Check
+     (Ch  : Character;
+      Typ : User_Defined_Field_Type) return Boolean
+      is abstract;
+   --  If True is returned, the character is considered as valid for the
+   --  field, otherwise as invalid.
+
+   procedure Set_Field_Type (Fld : Field;
+                             Typ : User_Defined_Field_Type);
+   --  This should work for all types derived from User_Defined_Field_Type.
+   --  No need to reimplement it for your derived type.
+
+   --  +----------------------------------------------------------------------
+   --  | Private Part.
+   --  | Used by the Choice child package.
+private
+   function C_Generic_Type   return C_Field_Type;
+
+   function Generic_Field_Check (Fld : Field;
+                                 Usr : System.Address) return C_Int;
+   pragma Convention (C, Generic_Field_Check);
+   --  This is the generic Field_Check_Function for the low-level fieldtype
+   --  representing all the User_Defined_Field_Type derivates. It routes
+   --  the call to the Field_Check implementation for the type.
+
+   function Generic_Char_Check (Ch  : C_Int;
+                                Usr : System.Address) return C_Int;
+   pragma Convention (C, Generic_Char_Check);
+   --  This is the generic Char_Check_Function for the low-level fieldtype
+   --  representing all the User_Defined_Field_Type derivates. It routes
+   --  the call to the Character_Check implementation for the type.
+
+end Terminal_Interface.Curses.Forms.Field_Types.User;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm new file mode 100644 index 00000000000..0f11e4faaa1 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm @@ -0,0 +1,302 @@ + +terminal_interface-curses-forms-field_types.adb + +

File : terminal_interface-curses-forms-field_types.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Forms.Field_Types              --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.21 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+with Ada.Unchecked_Deallocation;
+with Ada.Unchecked_Conversion;
+--  |
+--  |=====================================================================
+--  | man page form_fieldtype.3x
+--  |=====================================================================
+--  |
+package body Terminal_Interface.Curses.Forms.Field_Types is
+
+   use type System.Address;
+
+   pragma Warnings (Off);
+   function To_Argument_Access is new Ada.Unchecked_Conversion
+     (System.Address, Argument_Access);
+   pragma Warnings (On);
+
+   function Get_Fieldtype (F : Field) return C_Field_Type;
+   pragma Import (C, Get_Fieldtype, "field_type");
+
+   function Get_Arg (F : Field) return System.Address;
+   pragma Import (C, Get_Arg, "field_arg");
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_validation.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   function Get_Type (Fld : Field) return Field_Type_Access
+   is
+      Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
+      Arg : Argument_Access;
+   begin
+      if Low_Level = Null_Field_Type then
+         return null;
+      else
+         if Low_Level = M_Builtin_Router or else
+           Low_Level = M_Generic_Type or else
+           Low_Level = M_Choice_Router or else
+           Low_Level = M_Generic_Choice then
+            Arg := To_Argument_Access (Get_Arg (Fld));
+            if Arg = null then
+               raise Form_Exception;
+            else
+               return Arg.Typ;
+            end if;
+         else
+            raise Form_Exception;
+         end if;
+      end if;
+   end Get_Type;
+
+   function Make_Arg (Args : System.Address) return System.Address
+   is
+      --  Actually args is a double indirected pointer to the arguments
+      --  of a C variable argument list. In theory it is now quite
+      --  complicated to write portable routine that reads the arguments,
+      --  because one has to know the growth direction of the stack and
+      --  the sizes of the individual arguments.
+      --  Fortunately we are only interested in the first argument (#0),
+      --  we know its size and for the first arg we don't care about
+      --  into which stack direction we have to proceed. We simply
+      --  resolve the double indirection and thats it.
+      type V is access all System.Address;
+      function To_Access is new Ada.Unchecked_Conversion (System.Address,
+                                                          V);
+   begin
+      return To_Access (To_Access (Args).all).all;
+   end Make_Arg;
+
+   function Copy_Arg (Usr : System.Address) return System.Address
+   is
+   begin
+      return Usr;
+   end Copy_Arg;
+
+   procedure Free_Arg (Usr : System.Address)
+   is
+      procedure Free_Type is new Ada.Unchecked_Deallocation
+        (Field_Type'Class, Field_Type_Access);
+      procedure Freeargs is new Ada.Unchecked_Deallocation
+        (Argument, Argument_Access);
+
+      To_Be_Free : Argument_Access := To_Argument_Access (Usr);
+      Low_Level  : C_Field_Type;
+   begin
+      if To_Be_Free /= null then
+         if To_Be_Free.Usr /= System.Null_Address then
+            Low_Level := To_Be_Free.Cft;
+            if Low_Level.Freearg /= null then
+               Low_Level.Freearg (To_Be_Free.Usr);
+            end if;
+         end if;
+         if To_Be_Free.Typ /= null then
+            Free_Type (To_Be_Free.Typ);
+         end if;
+         Freeargs (To_Be_Free);
+      end if;
+   end Free_Arg;
+
+   procedure Wrap_Builtin (Fld : Field;
+                           Typ : Field_Type'Class;
+                           Cft : C_Field_Type := C_Builtin_Router)
+   is
+      Usr_Arg   : constant System.Address := Get_Arg (Fld);
+      Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
+      Arg : Argument_Access;
+      Res : Eti_Error;
+      function Set_Fld_Type (F    : Field := Fld;
+                             Cf   : C_Field_Type := Cft;
+                             Arg1 : Argument_Access) return C_Int;
+      pragma Import (C, Set_Fld_Type, "set_field_type");
+
+   begin
+      pragma Assert (Low_Level /= Null_Field_Type);
+      if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then
+         raise Form_Exception;
+      else
+         Arg := new Argument'(Usr => System.Null_Address,
+                              Typ => new Field_Type'Class'(Typ),
+                              Cft => Get_Fieldtype (Fld));
+         if Usr_Arg /= System.Null_Address then
+            if Low_Level.Copyarg /= null then
+               Arg.Usr := Low_Level.Copyarg (Usr_Arg);
+            else
+               Arg.Usr := Usr_Arg;
+            end if;
+         end if;
+
+         Res := Set_Fld_Type (Arg1 => Arg);
+         if Res /= E_Ok then
+            Eti_Exception (Res);
+         end if;
+      end if;
+   end Wrap_Builtin;
+
+   function Field_Check_Router (Fld : Field;
+                                Usr : System.Address) return C_Int
+   is
+      Arg  : constant Argument_Access := To_Argument_Access (Usr);
+   begin
+      pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type
+                     and then Arg.Typ /= null);
+      if Arg.Cft.Fcheck /= null then
+         return Arg.Cft.Fcheck (Fld, Arg.Usr);
+      else
+         return 1;
+      end if;
+   end Field_Check_Router;
+
+   function Char_Check_Router (Ch  : C_Int;
+                               Usr : System.Address) return C_Int
+   is
+      Arg  : constant Argument_Access := To_Argument_Access (Usr);
+   begin
+      pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type
+                     and then Arg.Typ /= null);
+      if Arg.Cft.Ccheck /= null then
+         return Arg.Cft.Ccheck (Ch, Arg.Usr);
+      else
+         return 1;
+      end if;
+   end Char_Check_Router;
+
+   function Next_Router (Fld : Field;
+                         Usr : System.Address) return C_Int
+   is
+      Arg  : constant Argument_Access := To_Argument_Access (Usr);
+   begin
+      pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type
+                     and then Arg.Typ /= null);
+      if Arg.Cft.Next /= null then
+         return Arg.Cft.Next (Fld, Arg.Usr);
+      else
+         return 1;
+      end if;
+   end Next_Router;
+
+   function Prev_Router (Fld : Field;
+                         Usr : System.Address) return C_Int
+   is
+      Arg  : constant Argument_Access := To_Argument_Access (Usr);
+   begin
+      pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type
+                     and then Arg.Typ /= null);
+      if Arg.Cft.Prev /= null then
+         return Arg.Cft.Prev (Fld, Arg.Usr);
+      else
+         return 1;
+      end if;
+   end Prev_Router;
+
+   --  -----------------------------------------------------------------------
+   --
+   function C_Builtin_Router return C_Field_Type
+   is
+      Res : Eti_Error;
+      T   : C_Field_Type;
+   begin
+      if M_Builtin_Router = Null_Field_Type then
+         T := New_Fieldtype (Field_Check_Router'Access,
+                             Char_Check_Router'Access);
+         if T = Null_Field_Type then
+            raise Form_Exception;
+         else
+            Res := Set_Fieldtype_Arg (T,
+                                      Make_Arg'Access,
+                                      Copy_Arg'Access,
+                                      Free_Arg'Access);
+            if Res /= E_Ok then
+               Eti_Exception (Res);
+            end if;
+         end if;
+         M_Builtin_Router := T;
+      end if;
+      pragma Assert (M_Builtin_Router /= Null_Field_Type);
+      return M_Builtin_Router;
+   end C_Builtin_Router;
+
+   --  -----------------------------------------------------------------------
+   --
+   function C_Choice_Router return C_Field_Type
+   is
+      Res : Eti_Error;
+      T   : C_Field_Type;
+   begin
+      if M_Choice_Router = Null_Field_Type then
+         T := New_Fieldtype (Field_Check_Router'Access,
+                             Char_Check_Router'Access);
+         if T = Null_Field_Type then
+            raise Form_Exception;
+         else
+            Res := Set_Fieldtype_Arg (T,
+                                      Make_Arg'Access,
+                                      Copy_Arg'Access,
+                                      Free_Arg'Access);
+            if Res /= E_Ok then
+               Eti_Exception (Res);
+            end if;
+
+            Res := Set_Fieldtype_Choice (T,
+                                         Next_Router'Access,
+                                         Prev_Router'Access);
+            if Res /= E_Ok then
+               Eti_Exception (Res);
+            end if;
+         end if;
+         M_Choice_Router := T;
+      end if;
+      pragma Assert (M_Choice_Router /= Null_Field_Type);
+      return M_Choice_Router;
+   end C_Choice_Router;
+
+end Terminal_Interface.Curses.Forms.Field_Types;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm new file mode 100644 index 00000000000..18fb83c09e2 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm @@ -0,0 +1,245 @@ + +terminal_interface-curses-forms-field_types.ads + +

File : terminal_interface-curses-forms-field_types.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Forms.Field_Types              --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.15 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C;
+
+package Terminal_Interface.Curses.Forms.Field_Types is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types);
+   use type Interfaces.C.int;
+   subtype C_Int is Interfaces.C.int;
+
+   --  |=====================================================================
+   --  | Man page form_fieldtype.3x
+   --  |=====================================================================
+
+   type Field_Type is abstract tagged null record;
+   --  Abstract base type for all field types. A concrete field type
+   --  is an extension that adds some data elements describing formats or
+   --  boundary values for the type and validation routines.
+   --  For the builtin low-level fieldtypes, the validation routines are
+   --  already defined by the low-level C library.
+   --  The builtin types like Alpha or AlphaNumeric etc. are defined in
+   --  child packages of this package. You may use one of them as example
+   --  how to create you own child packages for low-level field types that
+   --  you may have already written in C.
+
+   type Field_Type_Access is access all Field_Type'Class;
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Set_Field_Type (Fld      : Field;
+                             Fld_Type : Field_Type) is abstract;
+   --  AKA: set_field_type()
+   --  But: we hide the vararg mechanism of the C interface. You always
+   --       have to pass a single Field_Type parameter.
+
+   --  ---------------------------------------------------------------------
+
+   --  |=====================================================================
+   --  | Man page form_field_validation.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_2"#2|
+   function Get_Type (Fld : Field) return Field_Type_Access;
+   --  AKA: field_type()
+   --  AKA: field_arg()
+   --  In Ada95 we can combine these. If you try to retrieve the field type
+   --  that is not defined as extension of the abstract tagged type above,
+   --  you will raise a Form_Exception.
+   --  This is not inlined
+
+   --  +----------------------------------------------------------------------
+   --  | Private Part.
+   --  | Most of this is used by the implementations of the child packages.
+   --  |
+private
+   type Makearg_Function is access
+     function (Args : System.Address) return System.Address;
+   pragma Convention (C, Makearg_Function);
+
+   type Copyarg_Function is access
+     function (Usr : System.Address) return System.Address;
+   pragma Convention (C, Copyarg_Function);
+
+   type Freearg_Function is access
+     procedure (Usr : System.Address);
+   pragma Convention (C, Freearg_Function);
+
+   type Field_Check_Function is access
+     function (Fld : Field; Usr : System.Address) return C_Int;
+   pragma Convention (C, Field_Check_Function);
+
+   type Char_Check_Function is access
+     function (Ch : C_Int; Usr : System.Address) return C_Int;
+   pragma Convention (C, Char_Check_Function);
+
+   type Choice_Function is access
+     function (Fld : Field; Usr : System.Address) return C_Int;
+   pragma Convention (C, Choice_Function);
+
+   --  +----------------------------------------------------------------------
+   --  | This must be in sync with the FIELDTYPE structure in form.h
+   --  |
+   type Low_Level_Field_Type is
+      record
+         Status :              Interfaces.C.short;
+         Ref_Count :           Interfaces.C.long;
+         Left, Right :         System.Address;
+         Makearg :             Makearg_Function;
+         Copyarg :             Copyarg_Function;
+         Freearg :             Freearg_Function;
+         Fcheck :              Field_Check_Function;
+         Ccheck :              Char_Check_Function;
+         Next, Prev :          Choice_Function;
+      end record;
+   pragma Convention (C, Low_Level_Field_Type);
+   type C_Field_Type is access all Low_Level_Field_Type;
+
+   Null_Field_Type   : constant C_Field_Type := null;
+
+   --  +----------------------------------------------------------------------
+   --  | This four low-level fieldtypes are the ones associated with
+   --  | fieldtypes handled by this binding. Any other low-level fieldtype
+   --  | will result in a Form_Exception is function Get_Type.
+   --  |
+   M_Generic_Type   : C_Field_Type := null;
+   M_Generic_Choice : C_Field_Type := null;
+   M_Builtin_Router : C_Field_Type := null;
+   M_Choice_Router  : C_Field_Type := null;
+
+   --  Two wrapper functions to access those low-level fieldtypes defined
+   --  in this package.
+   function C_Builtin_Router return C_Field_Type;
+   function C_Choice_Router  return C_Field_Type;
+
+   procedure Wrap_Builtin (Fld : Field;
+                           Typ : Field_Type'Class;
+                           Cft : C_Field_Type := C_Builtin_Router);
+   --  This procedure has to be called by the Set_Field_Type implementation
+   --  for builtin low-level fieldtypes to replace it by an Ada95
+   --  conformant Field_Type object.
+   --  The parameter Cft must be C_Builtin_Router for regular low-level
+   --  fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for
+   --  low-level fieldtypes witch choice functions (like TYP_ENUM).
+   --  Any other value will raise a Form_Exception.
+
+   function Make_Arg (Args : System.Address) return System.Address;
+   pragma Convention (C, Make_Arg);
+   --  This is the Makearg_Function for the internal low-level types
+   --  introduced by this binding.
+
+   function Copy_Arg (Usr : System.Address) return System.Address;
+   pragma Convention (C, Copy_Arg);
+   --  This is the Copyarg_Function for the internal low-level types
+   --  introduced by this binding.
+
+   procedure Free_Arg (Usr : System.Address);
+   pragma Convention (C, Free_Arg);
+   --  This is the Freearg_Function for the internal low-level types
+   --  introduced by this binding.
+
+   function Field_Check_Router (Fld : Field;
+                                Usr : System.Address) return C_Int;
+   pragma Convention (C, Field_Check_Router);
+   --  This is the Field_Check_Function for the internal low-level types
+   --  introduced to wrap the low-level types by a Field_Type derived
+   --  type. It routes the call to the corresponding low-level validation
+   --  function.
+
+   function Char_Check_Router (Ch : C_Int;
+                               Usr : System.Address) return C_Int;
+   pragma Convention (C, Char_Check_Router);
+   --  This is the Char_Check_Function for the internal low-level types
+   --  introduced to wrap the low-level types by a Field_Type derived
+   --  type. It routes the call to the corresponding low-level validation
+   --  function.
+
+   function Next_Router (Fld : Field;
+                         Usr : System.Address) return C_Int;
+   pragma Convention (C, Next_Router);
+   --  This is the Choice_Function for the internal low-level types
+   --  introduced to wrap the low-level types by a Field_Type derived
+   --  type. It routes the call to the corresponding low-level next_choice
+   --  function.
+
+   function Prev_Router (Fld : Field;
+                         Usr : System.Address) return C_Int;
+   pragma Convention (C, Prev_Router);
+   --  This is the Choice_Function for the internal low-level types
+   --  introduced to wrap the low-level types by a Field_Type derived
+   --  type. It routes the call to the corresponding low-level prev_choice
+   --  function.
+
+   --  This is the Argument structure maintained by all low-level field types
+   --  introduced by this binding.
+   type Argument is record
+      Typ : Field_Type_Access;   --  the Field_Type creating this record
+      Usr : System.Address;      --  original arg for builtin low-level types
+      Cft : C_Field_Type;        --  the original low-level type
+   end record;
+   type Argument_Access is access all Argument;
+
+   --  +----------------------------------------------------------------------
+   --  |
+   --  | Some Imports of libform routines to deal with low-level fieldtypes.
+   --  |
+   function New_Fieldtype (Fcheck : Field_Check_Function;
+                           Ccheck : Char_Check_Function)
+     return C_Field_Type;
+   pragma Import (C, New_Fieldtype, "new_fieldtype");
+
+   function Set_Fieldtype_Arg (Cft : C_Field_Type;
+                               Mak : Makearg_Function := Make_Arg'Access;
+                               Cop : Copyarg_Function := Copy_Arg'Access;
+                               Fre : Freearg_Function := Free_Arg'Access)
+     return C_Int;
+   pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg");
+
+   function Set_Fieldtype_Choice (Cft : C_Field_Type;
+                                  Next, Prev : Choice_Function)
+     return C_Int;
+   pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice");
+
+end Terminal_Interface.Curses.Forms.Field_Types;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm new file mode 100644 index 00000000000..a04a469fec1 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm @@ -0,0 +1,91 @@ + +terminal_interface-curses-forms-field_user_data.adb + +

File : terminal_interface-curses-forms-field_user_data.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Forms.Field_User_Data            --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.13 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use  Terminal_Interface.Curses.Aux;
+
+--  |
+--  |=====================================================================
+--  | man page form_field_userptr.3x
+--  |=====================================================================
+--  |
+package body Terminal_Interface.Curses.Forms.Field_User_Data is
+   --  |
+   --  |
+   --  |
+   use type Interfaces.C.int;
+
+   procedure Set_User_Data (Fld  : Field;
+                            Data : User_Access)
+   is
+      function Set_Field_Userptr (Fld : Field;
+                                  Usr : User_Access) return C_Int;
+      pragma Import (C, Set_Field_Userptr, "set_field_userptr");
+
+      Res : constant Eti_Error := Set_Field_Userptr (Fld, Data);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_User_Data;
+   --  |
+   --  |
+   --  |
+   function Get_User_Data (Fld  : Field) return User_Access
+   is
+      function Field_Userptr (Fld : Field) return User_Access;
+      pragma Import (C, Field_Userptr, "field_userptr");
+   begin
+      return Field_Userptr (Fld);
+   end Get_User_Data;
+
+   procedure Get_User_Data (Fld  : Field;
+                            Data : out User_Access)
+   is
+   begin
+      Data := Get_User_Data (Fld);
+   end Get_User_Data;
+
+end Terminal_Interface.Curses.Forms.Field_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm new file mode 100644 index 00000000000..072378017b0 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm @@ -0,0 +1,75 @@ + +terminal_interface-curses-forms-field_user_data.ads + +

File : terminal_interface-curses-forms-field_user_data.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Forms.Field_User_Data            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.16 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Forms.Field_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data);
+
+   --  |=====================================================================
+   --  | Man page form_field_userptr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Set_User_Data (Fld  : Field;
+                            Data : User_Access);
+   --  AKA: set_field_userptr
+   pragma Inline (Set_User_Data);
+
+   --  #1A NAME="AFU_2"#2|
+   procedure Get_User_Data (Fld  : Field;
+                            Data : out User_Access);
+   --  AKA: field_userptr
+
+   --  #1A NAME="AFU_3"#2|
+   function Get_User_Data (Fld  : Field) return User_Access;
+   --  AKA: field_userptr
+   --  Sama as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Forms.Field_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm new file mode 100644 index 00000000000..3b91c7b9636 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm @@ -0,0 +1,92 @@ + +terminal_interface-curses-forms-form_user_data.adb + +

File : terminal_interface-curses-forms-form_user_data.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Forms.Form_User_Data            --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.13 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+--  |
+--  |=====================================================================
+--  | man page form__userptr.3x
+--  |=====================================================================
+--  |
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms.Form_User_Data is
+
+   use type Interfaces.C.int;
+
+   --  |
+   --  |
+   --  |
+   procedure Set_User_Data (Frm  : Form;
+                            Data : User_Access)
+   is
+      function Set_Form_Userptr (Frm  : Form;
+                                 Data : User_Access)  return C_Int;
+      pragma Import (C, Set_Form_Userptr, "set_form_userptr");
+
+      Res : constant Eti_Error := Set_Form_Userptr (Frm, Data);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_User_Data;
+   --  |
+   --  |
+   --  |
+   function Get_User_Data (Frm  : Form) return User_Access
+   is
+      function Form_Userptr (Frm : Form) return User_Access;
+      pragma Import (C, Form_Userptr, "form_userptr");
+   begin
+      return Form_Userptr (Frm);
+   end Get_User_Data;
+
+   procedure Get_User_Data (Frm  : Form;
+                            Data : out User_Access)
+   is
+   begin
+      Data := Get_User_Data (Frm);
+   end Get_User_Data;
+
+end Terminal_Interface.Curses.Forms.Form_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm new file mode 100644 index 00000000000..bc0be4c0c3c --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm @@ -0,0 +1,75 @@ + +terminal_interface-curses-forms-form_user_data.ads + +

File : terminal_interface-curses-forms-form_user_data.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Forms.Form_User_Data            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.15 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Forms.Form_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data);
+
+   --  |=====================================================================
+   --  | Man page form_userptr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Set_User_Data (Frm  : Form;
+                            Data : User_Access);
+   --  AKA: set_form_userptr
+   pragma Inline (Set_User_Data);
+
+   --  #1A NAME="AFU_2"#2|
+   procedure Get_User_Data (Frm  : Form;
+                            Data : out User_Access);
+   --  AKA: form_userptr
+
+   --  #1A NAME="AFU_3"#2|
+   function Get_User_Data (Frm  : Form) return User_Access;
+   --  AKA: form_userptr
+   --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Forms.Form_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms__adb.htm b/doc/html/ada/terminal_interface-curses-forms__adb.htm new file mode 100644 index 00000000000..5506d45a54f --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms__adb.htm @@ -0,0 +1,1167 @@ + +terminal_interface-curses-forms.adb + +

File : terminal_interface-curses-forms.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Forms                     --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.27 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Unchecked_Deallocation;
+with Ada.Unchecked_Conversion;
+
+with Interfaces.C; use Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Interfaces.C.Pointers;
+
+with Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Forms is
+
+   use Terminal_Interface.Curses.Aux;
+
+   type C_Field_Array is array (Natural range <>) of aliased Field;
+   package F_Array is new
+     Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field);
+
+------------------------------------------------------------------------------
+   --  |
+   --  |
+   --  |
+   --  subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
+
+   function FOS_2_CInt is new
+     Ada.Unchecked_Conversion (Field_Option_Set,
+                               C_Int);
+
+   function CInt_2_FOS is new
+     Ada.Unchecked_Conversion (C_Int,
+                               Field_Option_Set);
+
+   function FrmOS_2_CInt is new
+     Ada.Unchecked_Conversion (Form_Option_Set,
+                               C_Int);
+
+   function CInt_2_FrmOS is new
+     Ada.Unchecked_Conversion (C_Int,
+                               Form_Option_Set);
+
+   procedure Request_Name (Key  : Form_Request_Code;
+                                Name : out String)
+   is
+      function Form_Request_Name (Key : C_Int) return chars_ptr;
+      pragma Import (C, Form_Request_Name, "form_request_name");
+   begin
+      Fill_String (Form_Request_Name (C_Int (Key)), Name);
+   end Request_Name;
+
+   function Request_Name (Key : Form_Request_Code) return String
+   is
+      function Form_Request_Name (Key : C_Int) return chars_ptr;
+      pragma Import (C, Form_Request_Name, "form_request_name");
+   begin
+      return Fill_String (Form_Request_Name (C_Int (Key)));
+   end Request_Name;
+------------------------------------------------------------------------------
+   --  |
+   --  |
+   --  |
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_new.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   function Create (Height       : Line_Count;
+                    Width        : Column_Count;
+                    Top          : Line_Position;
+                    Left         : Column_Position;
+                    Off_Screen   : Natural := 0;
+                    More_Buffers : Buffer_Number := Buffer_Number'First)
+                    return Field
+   is
+      function Newfield (H, W, T, L, O, M : C_Int) return Field;
+      pragma Import (C, Newfield, "new_field");
+      Fld : constant Field := Newfield (C_Int (Height), C_Int (Width),
+                                        C_Int (Top), C_Int (Left),
+                                        C_Int (Off_Screen),
+                                        C_Int (More_Buffers));
+   begin
+      if Fld = Null_Field then
+         raise Form_Exception;
+      end if;
+      return Fld;
+   end Create;
+--  |
+--  |
+--  |
+   procedure Delete (Fld : in out Field)
+   is
+      function Free_Field (Fld : Field) return C_Int;
+      pragma Import (C, Free_Field, "free_field");
+
+      Res : Eti_Error;
+   begin
+      Res := Free_Field (Fld);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Fld := Null_Field;
+   end Delete;
+   --  |
+   --  |
+   --  |
+   function Duplicate (Fld  : Field;
+                       Top  : Line_Position;
+                       Left : Column_Position) return Field
+   is
+      function Dup_Field (Fld  : Field;
+                          Top  : C_Int;
+                          Left : C_Int) return Field;
+      pragma Import (C, Dup_Field, "dup_field");
+
+      F : constant Field := Dup_Field (Fld,
+                                       C_Int (Top),
+                                       C_Int (Left));
+   begin
+      if F = Null_Field then
+         raise Form_Exception;
+      end if;
+      return F;
+   end Duplicate;
+   --  |
+   --  |
+   --  |
+   function Link (Fld  : Field;
+                  Top  : Line_Position;
+                  Left : Column_Position) return Field
+   is
+      function Lnk_Field (Fld  : Field;
+                          Top  : C_Int;
+                          Left : C_Int) return Field;
+      pragma Import (C, Lnk_Field, "link_field");
+
+      F : constant Field := Lnk_Field (Fld,
+                                       C_Int (Top),
+                                       C_Int (Left));
+   begin
+      if F = Null_Field then
+         raise Form_Exception;
+      end if;
+      return F;
+   end Link;
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_just.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Justification (Fld  : Field;
+                                Just : Field_Justification := None)
+   is
+      function Set_Field_Just (Fld  : Field;
+                               Just : C_Int) return C_Int;
+      pragma Import (C, Set_Field_Just, "set_field_just");
+
+      Res : constant Eti_Error :=
+        Set_Field_Just (Fld,
+                        C_Int (Field_Justification'Pos (Just)));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Justification;
+   --  |
+   --  |
+   --  |
+   function Get_Justification (Fld : Field) return Field_Justification
+   is
+      function Field_Just (Fld : Field) return C_Int;
+      pragma Import (C, Field_Just, "field_just");
+   begin
+      return Field_Justification'Val (Field_Just (Fld));
+   end Get_Justification;
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_buffer.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Buffer
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
+      Str    : String)
+   is
+      type Char_Ptr is access all Interfaces.C.char;
+      function Set_Fld_Buffer (Fld    : Field;
+                                 Bufnum : C_Int;
+                                 S      : Char_Ptr)
+        return C_Int;
+      pragma Import (C, Set_Fld_Buffer, "set_field_buffer");
+
+      Txt : char_array (0 .. Str'Length);
+      Len : size_t;
+      Res : Eti_Error;
+   begin
+      To_C (Str, Txt, Len);
+      Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Buffer;
+   --  |
+   --  |
+   --  |
+   procedure Get_Buffer
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
+      Str    : out String)
+   is
+      function Field_Buffer (Fld : Field;
+                             B   : C_Int) return chars_ptr;
+      pragma Import (C, Field_Buffer, "field_buffer");
+   begin
+      Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str);
+   end Get_Buffer;
+
+   function Get_Buffer
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First) return String
+   is
+      function Field_Buffer (Fld : Field;
+                             B   : C_Int) return chars_ptr;
+      pragma Import (C, Field_Buffer, "field_buffer");
+   begin
+      return Fill_String (Field_Buffer (Fld, C_Int (Buffer)));
+   end Get_Buffer;
+   --  |
+   --  |
+   --  |
+   procedure Set_Status (Fld    : Field;
+                         Status : Boolean := True)
+   is
+      function Set_Fld_Status (Fld : Field;
+                               St  : C_Int) return C_Int;
+      pragma Import (C, Set_Fld_Status, "set_field_status");
+
+      Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status));
+   begin
+      if Res /= E_Ok then
+         raise Form_Exception;
+      end if;
+   end Set_Status;
+   --  |
+   --  |
+   --  |
+   function Changed (Fld : Field) return Boolean
+   is
+      function Field_Status (Fld : Field) return C_Int;
+      pragma Import (C, Field_Status, "field_status");
+
+      Res : constant C_Int := Field_Status (Fld);
+   begin
+      if Res = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Changed;
+   --  |
+   --  |
+   --  |
+   procedure Set_Maximum_Size (Fld : Field;
+                               Max : Natural := 0)
+   is
+      function Set_Field_Max (Fld : Field;
+                              M   : C_Int) return C_Int;
+      pragma Import (C, Set_Field_Max, "set_max_field");
+
+      Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Maximum_Size;
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_opts.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Options (Fld     : Field;
+                          Options : Field_Option_Set)
+   is
+      function Set_Field_Opts (Fld : Field;
+                               Opt : C_Int) return C_Int;
+      pragma Import (C, Set_Field_Opts, "set_field_opts");
+
+      Opt : constant C_Int := FOS_2_CInt (Options);
+      Res : Eti_Error;
+   begin
+      Res := Set_Field_Opts (Fld, Opt);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Options;
+   --  |
+   --  |
+   --  |
+   procedure Switch_Options (Fld     : Field;
+                             Options : Field_Option_Set;
+                             On      : Boolean := True)
+   is
+      function Field_Opts_On (Fld : Field;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Field_Opts_On, "field_opts_on");
+      function Field_Opts_Off (Fld : Field;
+                               Opt : C_Int) return C_Int;
+      pragma Import (C, Field_Opts_Off, "field_opts_off");
+
+      Err : Eti_Error;
+      Opt : constant C_Int := FOS_2_CInt (Options);
+   begin
+      if On then
+         Err := Field_Opts_On (Fld, Opt);
+      else
+         Err := Field_Opts_Off (Fld, Opt);
+      end if;
+      if Err /= E_Ok then
+         Eti_Exception (Err);
+      end if;
+   end Switch_Options;
+   --  |
+   --  |
+   --  |
+   procedure Get_Options (Fld     : Field;
+                          Options : out Field_Option_Set)
+   is
+      function Field_Opts (Fld : Field) return C_Int;
+      pragma Import (C, Field_Opts, "field_opts");
+
+      Res : constant C_Int := Field_Opts (Fld);
+   begin
+      Options := CInt_2_FOS (Res);
+   end Get_Options;
+   --  |
+   --  |
+   --  |
+   function Get_Options (Fld : Field := Null_Field)
+                         return Field_Option_Set
+   is
+      Fos : Field_Option_Set;
+   begin
+      Get_Options (Fld, Fos);
+      return Fos;
+   end Get_Options;
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_attributes.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Foreground
+     (Fld   : Field;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Set_Field_Fore (Fld  : Field;
+                               Attr : C_Chtype) return C_Int;
+      pragma Import (C, Set_Field_Fore, "set_field_fore");
+
+      Ch : constant Attributed_Character := (Ch    => Character'First,
+                                             Color => Color,
+                                             Attr  => Fore);
+      Res : constant Eti_Error :=
+        Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Foreground;
+   --  |
+   --  |
+   --  |
+   procedure Foreground (Fld  : Field;
+                         Fore : out Character_Attribute_Set)
+   is
+      function Field_Fore (Fld : Field) return C_Chtype;
+      pragma Import (C, Field_Fore, "field_fore");
+   begin
+      Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
+   end Foreground;
+
+   procedure Foreground (Fld   : Field;
+                         Fore  : out Character_Attribute_Set;
+                         Color : out Color_Pair)
+   is
+      function Field_Fore (Fld : Field) return C_Chtype;
+      pragma Import (C, Field_Fore, "field_fore");
+   begin
+      Fore  := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
+      Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color;
+   end Foreground;
+   --  |
+   --  |
+   --  |
+   procedure Set_Background
+     (Fld   : Field;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Set_Field_Back (Fld  : Field;
+                               Attr : C_Chtype) return C_Int;
+      pragma Import (C, Set_Field_Back, "set_field_back");
+
+      Ch : constant Attributed_Character := (Ch    => Character'First,
+                                             Color => Color,
+                                             Attr  => Back);
+      Res : constant Eti_Error :=
+        Set_Field_Back (Fld, AttrChar_To_Chtype (Ch));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Background;
+   --  |
+   --  |
+   --  |
+   procedure Background (Fld  : Field;
+                         Back : out Character_Attribute_Set)
+   is
+      function Field_Back (Fld : Field) return C_Chtype;
+      pragma Import (C, Field_Back, "field_back");
+   begin
+      Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
+   end Background;
+
+   procedure Background (Fld   : Field;
+                         Back  : out Character_Attribute_Set;
+                         Color : out Color_Pair)
+   is
+      function Field_Back (Fld : Field) return C_Chtype;
+      pragma Import (C, Field_Back, "field_back");
+   begin
+      Back  := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
+      Color := Chtype_To_AttrChar (Field_Back (Fld)).Color;
+   end Background;
+   --  |
+   --  |
+   --  |
+   procedure Set_Pad_Character (Fld : Field;
+                                Pad : Character := Space)
+   is
+      function Set_Field_Pad (Fld : Field;
+                              Ch  : C_Int) return C_Int;
+      pragma Import (C, Set_Field_Pad, "set_field_pad");
+
+      Res : constant Eti_Error := Set_Field_Pad (Fld,
+                                                 C_Int (Character'Pos (Pad)));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Pad_Character;
+   --  |
+   --  |
+   --  |
+   procedure Pad_Character (Fld : Field;
+                            Pad : out Character)
+   is
+      function Field_Pad (Fld : Field) return C_Int;
+      pragma Import (C, Field_Pad, "field_pad");
+   begin
+      Pad := Character'Val (Field_Pad (Fld));
+   end Pad_Character;
+   --  |
+   --  |=====================================================================
+   --  | man page form_field_info.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Info (Fld                : Field;
+                   Lines              : out Line_Count;
+                   Columns            : out Column_Count;
+                   First_Row          : out Line_Position;
+                   First_Column       : out Column_Position;
+                   Off_Screen         : out Natural;
+                   Additional_Buffers : out Buffer_Number)
+   is
+      type C_Int_Access is access all C_Int;
+      function Fld_Info (Fld : Field;
+                         L, C, Fr, Fc, Os, Ab : C_Int_Access)
+                         return C_Int;
+      pragma Import (C, Fld_Info, "field_info");
+
+      L, C, Fr, Fc, Os, Ab : aliased C_Int;
+      Res : constant Eti_Error := Fld_Info (Fld,
+                                            L'Access, C'Access,
+                                            Fr'Access, Fc'Access,
+                                            Os'Access, Ab'Access);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      else
+         Lines              := Line_Count (L);
+         Columns            := Column_Count (C);
+         First_Row          := Line_Position (Fr);
+         First_Column       := Column_Position (Fc);
+         Off_Screen         := Natural (Os);
+         Additional_Buffers := Buffer_Number (Ab);
+      end if;
+   end Info;
+--  |
+--  |
+--  |
+   procedure Dynamic_Info (Fld     : Field;
+                           Lines   : out Line_Count;
+                           Columns : out Column_Count;
+                           Max     : out Natural)
+   is
+      type C_Int_Access is access all C_Int;
+      function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int;
+      pragma Import (C, Dyn_Info, "dynamic_field_info");
+
+      L, C, M : aliased C_Int;
+      Res : constant Eti_Error := Dyn_Info (Fld,
+                                            L'Access, C'Access,
+                                            M'Access);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      else
+         Lines   := Line_Count (L);
+         Columns := Column_Count (C);
+         Max     := Natural (M);
+      end if;
+   end Dynamic_Info;
+   --  |
+   --  |=====================================================================
+   --  | man page form_win.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Window (Frm : Form;
+                         Win : Window)
+   is
+      function Set_Form_Win (Frm : Form;
+                             Win : Window) return C_Int;
+      pragma Import (C, Set_Form_Win, "set_form_win");
+
+      Res : constant Eti_Error := Set_Form_Win (Frm, Win);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Window;
+   --  |
+   --  |
+   --  |
+   function Get_Window (Frm : Form) return Window
+   is
+      function Form_Win (Frm : Form) return Window;
+      pragma Import (C, Form_Win, "form_win");
+
+      W : constant Window := Form_Win (Frm);
+   begin
+      return W;
+   end Get_Window;
+   --  |
+   --  |
+   --  |
+   procedure Set_Sub_Window (Frm : Form;
+                             Win : Window)
+   is
+      function Set_Form_Sub (Frm : Form;
+                             Win : Window) return C_Int;
+      pragma Import (C, Set_Form_Sub, "set_form_sub");
+
+      Res : constant Eti_Error := Set_Form_Sub (Frm, Win);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Sub_Window;
+   --  |
+   --  |
+   --  |
+   function Get_Sub_Window (Frm : Form) return Window
+   is
+      function Form_Sub (Frm : Form) return Window;
+      pragma Import (C, Form_Sub, "form_sub");
+
+      W : constant Window := Form_Sub (Frm);
+   begin
+      return W;
+   end Get_Sub_Window;
+   --  |
+   --  |
+   --  |
+   procedure Scale (Frm     : Form;
+                    Lines   : out Line_Count;
+                    Columns : out Column_Count)
+   is
+      type C_Int_Access is access all C_Int;
+      function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int;
+      pragma Import (C, M_Scale, "scale_form");
+
+      X, Y : aliased C_Int;
+      Res  : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Lines := Line_Count (Y);
+      Columns := Column_Count (X);
+   end Scale;
+   --  |
+   --  |=====================================================================
+   --  | man page menu_hook.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Field_Init_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function)
+   is
+      function Set_Field_Init (Frm  : Form;
+                               Proc : Form_Hook_Function) return C_Int;
+      pragma Import (C, Set_Field_Init, "set_field_init");
+
+      Res : constant Eti_Error := Set_Field_Init (Frm, Proc);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Field_Init_Hook;
+   --  |
+   --  |
+   --  |
+   procedure Set_Field_Term_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function)
+   is
+      function Set_Field_Term (Frm  : Form;
+                               Proc : Form_Hook_Function) return C_Int;
+      pragma Import (C, Set_Field_Term, "set_field_term");
+
+      Res : constant Eti_Error := Set_Field_Term (Frm, Proc);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Field_Term_Hook;
+   --  |
+   --  |
+   --  |
+   procedure Set_Form_Init_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function)
+   is
+      function Set_Form_Init (Frm  : Form;
+                              Proc : Form_Hook_Function) return C_Int;
+      pragma Import (C, Set_Form_Init, "set_form_init");
+
+      Res : constant Eti_Error := Set_Form_Init (Frm, Proc);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Form_Init_Hook;
+   --  |
+   --  |
+   --  |
+   procedure Set_Form_Term_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function)
+   is
+      function Set_Form_Term (Frm  : Form;
+                              Proc : Form_Hook_Function) return C_Int;
+      pragma Import (C, Set_Form_Term, "set_form_term");
+
+      Res : constant Eti_Error := Set_Form_Term (Frm, Proc);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Form_Term_Hook;
+   --  |
+   --  |=====================================================================
+   --  | man page form_fields.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Redefine (Frm  : Form;
+                       Flds : Field_Array_Access)
+   is
+      function Set_Frm_Fields (Frm   : Form;
+                               Items : System.Address) return C_Int;
+      pragma Import (C, Set_Frm_Fields, "set_form_fields");
+
+      Res : Eti_Error;
+   begin
+      pragma Assert (Flds (Flds'Last) = Null_Field);
+      if Flds (Flds'Last) /= Null_Field then
+         raise Form_Exception;
+      else
+         Res := Set_Frm_Fields (Frm, Flds (Flds'First)'Address);
+         if  Res /= E_Ok then
+            Eti_Exception (Res);
+         end if;
+      end if;
+   end Redefine;
+   --  |
+   --  |
+   --  |
+   function Fields (Frm   : Form;
+                    Index : Positive) return Field
+   is
+      use F_Array;
+
+      function C_Fields (Frm : Form) return Pointer;
+      pragma Import (C, C_Fields, "form_fields");
+
+      P : Pointer := C_Fields (Frm);
+   begin
+      if P = null or else Index > Field_Count (Frm) then
+         raise Form_Exception;
+      else
+         P := P + ptrdiff_t (C_Int (Index) - 1);
+         return P.all;
+      end if;
+   end Fields;
+   --  |
+   --  |
+   --  |
+   function Field_Count (Frm : Form) return Natural
+   is
+      function Count (Frm : Form) return C_Int;
+      pragma Import (C, Count, "field_count");
+   begin
+      return Natural (Count (Frm));
+   end Field_Count;
+   --  |
+   --  |
+   --  |
+   procedure Move (Fld    : Field;
+                   Line   : Line_Position;
+                   Column : Column_Position)
+   is
+      function Move (Fld : Field; L, C : C_Int) return C_Int;
+      pragma Import (C, Move, "move_field");
+
+      Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Move;
+   --  |
+   --  |=====================================================================
+   --  | man page form_new.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   function Create (Fields : Field_Array_Access) return Form
+   is
+      function NewForm (Fields : System.Address) return Form;
+      pragma Import (C, NewForm, "new_form");
+
+      M   : Form;
+   begin
+      pragma Assert (Fields (Fields'Last) = Null_Field);
+      if Fields (Fields'Last) /= Null_Field then
+         raise Form_Exception;
+      else
+         M := NewForm (Fields (Fields'First)'Address);
+         if M = Null_Form then
+            raise Form_Exception;
+         end if;
+         return M;
+      end if;
+   end Create;
+   --  |
+   --  |
+   --  |
+   procedure Delete (Frm : in out Form)
+   is
+      function Free (Frm : Form) return C_Int;
+      pragma Import (C, Free, "free_form");
+
+      Res : constant Eti_Error := Free (Frm);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Frm := Null_Form;
+   end Delete;
+   --  |
+   --  |=====================================================================
+   --  | man page form_opts.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Options (Frm     : Form;
+                          Options : Form_Option_Set)
+   is
+      function Set_Form_Opts (Frm : Form;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Set_Form_Opts, "set_form_opts");
+
+      Opt : constant C_Int := FrmOS_2_CInt (Options);
+      Res : Eti_Error;
+   begin
+      Res := Set_Form_Opts (Frm, Opt);
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Options;
+   --  |
+   --  |
+   --  |
+   procedure Switch_Options (Frm     : Form;
+                             Options : Form_Option_Set;
+                             On      : Boolean := True)
+   is
+      function Form_Opts_On (Frm : Form;
+                             Opt : C_Int) return C_Int;
+      pragma Import (C, Form_Opts_On, "form_opts_on");
+      function Form_Opts_Off (Frm : Form;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Form_Opts_Off, "form_opts_off");
+
+      Err : Eti_Error;
+      Opt : constant C_Int := FrmOS_2_CInt (Options);
+   begin
+      if On then
+         Err := Form_Opts_On (Frm, Opt);
+      else
+         Err := Form_Opts_Off (Frm, Opt);
+      end if;
+      if Err /= E_Ok then
+         Eti_Exception (Err);
+      end if;
+   end Switch_Options;
+   --  |
+   --  |
+   --  |
+   procedure Get_Options (Frm     : Form;
+                          Options : out Form_Option_Set)
+   is
+      function Form_Opts (Frm : Form) return C_Int;
+      pragma Import (C, Form_Opts, "form_opts");
+
+      Res : constant C_Int := Form_Opts (Frm);
+   begin
+      Options := CInt_2_FrmOS (Res);
+   end Get_Options;
+   --  |
+   --  |
+   --  |
+   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set
+   is
+      Fos : Form_Option_Set;
+   begin
+      Get_Options (Frm, Fos);
+      return Fos;
+   end Get_Options;
+   --  |
+   --  |=====================================================================
+   --  | man page form_post.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Post (Frm  : Form;
+                   Post : Boolean := True)
+   is
+      function M_Post (Frm : Form) return C_Int;
+      pragma Import (C, M_Post, "post_form");
+      function M_Unpost (Frm : Form) return C_Int;
+      pragma Import (C, M_Unpost, "unpost_form");
+
+      Res : Eti_Error;
+   begin
+      if Post then
+         Res := M_Post (Frm);
+      else
+         Res := M_Unpost (Frm);
+      end if;
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Post;
+   --  |
+   --  |=====================================================================
+   --  | man page form_cursor.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Position_Cursor (Frm : Form)
+   is
+      function Pos_Form_Cursor (Frm : Form) return C_Int;
+      pragma Import (C, Pos_Form_Cursor, "pos_form_cursor");
+
+      Res : constant Eti_Error := Pos_Form_Cursor (Frm);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Position_Cursor;
+   --  |
+   --  |=====================================================================
+   --  | man page form_data.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   function Data_Ahead (Frm : Form) return Boolean
+   is
+      function Ahead (Frm : Form) return C_Int;
+      pragma Import (C, Ahead, "data_ahead");
+
+      Res : constant C_Int := Ahead (Frm);
+   begin
+      if Res = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Data_Ahead;
+   --  |
+   --  |
+   --  |
+   function Data_Behind (Frm : Form) return Boolean
+   is
+      function Behind (Frm : Form) return C_Int;
+      pragma Import (C, Behind, "data_behind");
+
+      Res : constant C_Int := Behind (Frm);
+   begin
+      if Res = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Data_Behind;
+   --  |
+   --  |=====================================================================
+   --  | man page form_driver.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   function Driver (Frm : Form;
+                    Key : Key_Code) return Driver_Result
+   is
+      function Frm_Driver (Frm : Form; Key : C_Int) return C_Int;
+      pragma Import (C, Frm_Driver, "form_driver");
+
+      R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key));
+   begin
+      if R /= E_Ok then
+         if R = E_Unknown_Command then
+            return Unknown_Request;
+         elsif R = E_Invalid_Field then
+            return Invalid_Field;
+         elsif R = E_Request_Denied then
+            return Request_Denied;
+         else
+            Eti_Exception (R);
+            return Form_Ok;
+         end if;
+      else
+         return Form_Ok;
+      end if;
+   end Driver;
+   --  |
+   --  |=====================================================================
+   --  | man page form_page.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_Current (Frm : Form;
+                          Fld : Field)
+   is
+      function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int;
+      pragma Import (C, Set_Current_Fld, "set_current_field");
+
+      Res : constant Eti_Error := Set_Current_Fld (Frm, Fld);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Current;
+   --  |
+   --  |
+   --  |
+   function Current (Frm : Form) return Field
+   is
+      function Current_Fld (Frm : Form) return Field;
+      pragma Import (C, Current_Fld, "current_field");
+
+      Fld : constant Field := Current_Fld (Frm);
+   begin
+      if Fld = Null_Field then
+         raise Form_Exception;
+      end if;
+      return Fld;
+   end Current;
+   --  |
+   --  |
+   --  |
+   procedure Set_Page (Frm  : Form;
+                       Page : Page_Number := Page_Number'First)
+   is
+      function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int;
+      pragma Import (C, Set_Frm_Page, "set_form_page");
+
+      Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Page;
+   --  |
+   --  |
+   --  |
+   function Page (Frm : Form) return Page_Number
+   is
+      function Get_Page (Frm : Form) return C_Int;
+      pragma Import (C, Get_Page, "form_page");
+
+      P : constant C_Int := Get_Page (Frm);
+   begin
+      if P < 0 then
+         raise Form_Exception;
+      else
+         return Page_Number (P);
+      end if;
+   end Page;
+
+   function Get_Index (Fld : Field) return Positive
+   is
+      function Get_Fieldindex (Fld : Field) return C_Int;
+      pragma Import (C, Get_Fieldindex, "field_index");
+
+      Res : constant C_Int := Get_Fieldindex (Fld);
+   begin
+      if Res = Curses_Err then
+         raise Form_Exception;
+      end if;
+      return Positive (Natural (Res) + Positive'First);
+   end Get_Index;
+
+   --  |
+   --  |=====================================================================
+   --  | man page form_new_page.3x
+   --  |=====================================================================
+   --  |
+   --  |
+   --  |
+   procedure Set_New_Page (Fld      : Field;
+                           New_Page : Boolean := True)
+   is
+      function Set_Page (Fld : Field; Flg : C_Int) return C_Int;
+      pragma Import (C, Set_Page, "set_new_page");
+
+      Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_New_Page;
+   --  |
+   --  |
+   --  |
+   function Is_New_Page (Fld : Field) return Boolean
+   is
+      function Is_New (Fld : Field) return C_Int;
+      pragma Import (C, Is_New, "new_page");
+
+      Res : constant C_Int := Is_New (Fld);
+   begin
+      if Res = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Is_New_Page;
+
+   procedure Free (FA          : in out Field_Array_Access;
+                   Free_Fields : Boolean := False)
+   is
+      procedure Release is new Ada.Unchecked_Deallocation
+        (Field_Array, Field_Array_Access);
+   begin
+      if FA /= null and then Free_Fields then
+         for I in FA'First .. (FA'Last - 1) loop
+            if FA (I) /= Null_Field then
+               Delete (FA (I));
+            end if;
+         end loop;
+      end if;
+      Release (FA);
+   end Free;
+
+   --  |=====================================================================
+
+   function Default_Field_Options return Field_Option_Set
+   is
+   begin
+      return Get_Options (Null_Field);
+   end Default_Field_Options;
+
+   function Default_Form_Options return Form_Option_Set
+   is
+   begin
+      return Get_Options (Null_Form);
+   end Default_Form_Options;
+
+end Terminal_Interface.Curses.Forms;
+
diff --git a/doc/html/ada/terminal_interface-curses-forms__ads.htm b/doc/html/ada/terminal_interface-curses-forms__ads.htm new file mode 100644 index 00000000000..9143203016d --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-forms__ads.htm @@ -0,0 +1,786 @@ + +terminal_interface-curses-forms.ads + +

File : terminal_interface-curses-forms.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Form                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.30 @
+--  @Date: 2009/12/26 17:31:35 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+--  form binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+with Ada.Characters.Latin_1;
+
+package Terminal_Interface.Curses.Forms is
+   pragma Preelaborate (Terminal_Interface.Curses.Forms);
+   pragma Linker_Options ("-lform");
+   pragma Linker_Options ("-lncurses");
+
+   Space : Character renames Ada.Characters.Latin_1.Space;
+
+   type Field        is private;
+   type Form         is private;
+
+   Null_Field        : constant Field;
+   Null_Form         : constant Form;
+
+   type Field_Justification is (None,
+                                Left,
+                                Center,
+                                Right);
+
+   pragma Warnings (Off);
+   type Field_Option_Set is
+      record
+         Visible     : Boolean;
+         Active      : Boolean;
+         Public      : Boolean;
+         Edit        : Boolean;
+         Wrap        : Boolean;
+         Blank       : Boolean;
+         Auto_Skip   : Boolean;
+         Null_Ok     : Boolean;
+         Pass_Ok     : Boolean;
+         Static      : Boolean;
+      end record;
+   pragma Convention (C, Field_Option_Set);
+
+   for Field_Option_Set use
+      record
+         Visible     at 0 range  0 ..  0;
+         Active      at 0 range  1 ..  1;
+         Public      at 0 range  2 ..  2;
+         Edit        at 0 range  3 ..  3;
+         Wrap        at 0 range  4 ..  4;
+         Blank       at 0 range  5 ..  5;
+         Auto_Skip   at 0 range  6 ..  6;
+         Null_Ok     at 0 range  7 ..  7;
+         Pass_Ok     at 0 range  8 ..  8;
+         Static      at 0 range  9 ..  9;
+      end record;
+   for Field_Option_Set'Size use 32;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.Dnl
+
+   pragma Warnings (On);
+
+   function Default_Field_Options return Field_Option_Set;
+   --  The initial defaults for the field options.
+   pragma Inline (Default_Field_Options);
+
+   pragma Warnings (Off);
+   type Form_Option_Set is
+      record
+         NL_Overload : Boolean;
+         BS_Overload : Boolean;
+      end record;
+   pragma Convention (C, Form_Option_Set);
+
+   for Form_Option_Set use
+      record
+         NL_Overload at 0 range  0 ..  0;
+         BS_Overload at 0 range  1 ..  1;
+      end record;
+   for Form_Option_Set'Size use 32;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.Dnl
+
+   pragma Warnings (On);
+
+   function Default_Form_Options return Form_Option_Set;
+   --  The initial defaults for the form options.
+   pragma Inline (Default_Form_Options);
+
+   type Buffer_Number is new Natural;
+
+   type Field_Array is array (Positive range <>) of aliased Field;
+   pragma Convention (C, Field_Array);
+
+   type Field_Array_Access is access Field_Array;
+
+   procedure Free (FA          : in out Field_Array_Access;
+                   Free_Fields : Boolean := False);
+   --  Release the memory for an allocated field array
+   --  If Free_Fields is True, call Delete() for all the fields in
+   --  the array.
+
+   subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);
+
+   --  The prefix F_ stands for "Form Request"
+   F_Next_Page                : constant Form_Request_Code := Key_Max + 1;
+   F_Previous_Page            : constant Form_Request_Code := Key_Max + 2;
+   F_First_Page               : constant Form_Request_Code := Key_Max + 3;
+   F_Last_Page                : constant Form_Request_Code := Key_Max + 4;
+
+   F_Next_Field               : constant Form_Request_Code := Key_Max + 5;
+   F_Previous_Field           : constant Form_Request_Code := Key_Max + 6;
+   F_First_Field              : constant Form_Request_Code := Key_Max + 7;
+   F_Last_Field               : constant Form_Request_Code := Key_Max + 8;
+   F_Sorted_Next_Field        : constant Form_Request_Code := Key_Max + 9;
+   F_Sorted_Previous_Field    : constant Form_Request_Code := Key_Max + 10;
+   F_Sorted_First_Field       : constant Form_Request_Code := Key_Max + 11;
+   F_Sorted_Last_Field        : constant Form_Request_Code := Key_Max + 12;
+   F_Left_Field               : constant Form_Request_Code := Key_Max + 13;
+   F_Right_Field              : constant Form_Request_Code := Key_Max + 14;
+   F_Up_Field                 : constant Form_Request_Code := Key_Max + 15;
+   F_Down_Field               : constant Form_Request_Code := Key_Max + 16;
+
+   F_Next_Char                : constant Form_Request_Code := Key_Max + 17;
+   F_Previous_Char            : constant Form_Request_Code := Key_Max + 18;
+   F_Next_Line                : constant Form_Request_Code := Key_Max + 19;
+   F_Previous_Line            : constant Form_Request_Code := Key_Max + 20;
+   F_Next_Word                : constant Form_Request_Code := Key_Max + 21;
+   F_Previous_Word            : constant Form_Request_Code := Key_Max + 22;
+   F_Begin_Field              : constant Form_Request_Code := Key_Max + 23;
+   F_End_Field                : constant Form_Request_Code := Key_Max + 24;
+   F_Begin_Line               : constant Form_Request_Code := Key_Max + 25;
+   F_End_Line                 : constant Form_Request_Code := Key_Max + 26;
+   F_Left_Char                : constant Form_Request_Code := Key_Max + 27;
+   F_Right_Char               : constant Form_Request_Code := Key_Max + 28;
+   F_Up_Char                  : constant Form_Request_Code := Key_Max + 29;
+   F_Down_Char                : constant Form_Request_Code := Key_Max + 30;
+
+   F_New_Line                 : constant Form_Request_Code := Key_Max + 31;
+   F_Insert_Char              : constant Form_Request_Code := Key_Max + 32;
+   F_Insert_Line              : constant Form_Request_Code := Key_Max + 33;
+   F_Delete_Char              : constant Form_Request_Code := Key_Max + 34;
+   F_Delete_Previous          : constant Form_Request_Code := Key_Max + 35;
+   F_Delete_Line              : constant Form_Request_Code := Key_Max + 36;
+   F_Delete_Word              : constant Form_Request_Code := Key_Max + 37;
+   F_Clear_EOL                : constant Form_Request_Code := Key_Max + 38;
+   F_Clear_EOF                : constant Form_Request_Code := Key_Max + 39;
+   F_Clear_Field              : constant Form_Request_Code := Key_Max + 40;
+   F_Overlay_Mode             : constant Form_Request_Code := Key_Max + 41;
+   F_Insert_Mode              : constant Form_Request_Code := Key_Max + 42;
+
+   --  Vertical Scrolling
+   F_ScrollForward_Line       : constant Form_Request_Code := Key_Max + 43;
+   F_ScrollBackward_Line      : constant Form_Request_Code := Key_Max + 44;
+   F_ScrollForward_Page       : constant Form_Request_Code := Key_Max + 45;
+   F_ScrollBackward_Page      : constant Form_Request_Code := Key_Max + 46;
+   F_ScrollForward_HalfPage   : constant Form_Request_Code := Key_Max + 47;
+   F_ScrollBackward_HalfPage  : constant Form_Request_Code := Key_Max + 48;
+
+   --  Horizontal Scrolling
+   F_HScrollForward_Char      : constant Form_Request_Code := Key_Max + 49;
+   F_HScrollBackward_Char     : constant Form_Request_Code := Key_Max + 50;
+   F_HScrollForward_Line      : constant Form_Request_Code := Key_Max + 51;
+   F_HScrollBackward_Line     : constant Form_Request_Code := Key_Max + 52;
+   F_HScrollForward_HalfLine  : constant Form_Request_Code := Key_Max + 53;
+   F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;
+
+   F_Validate_Field           : constant Form_Request_Code := Key_Max + 55;
+   F_Next_Choice              : constant Form_Request_Code := Key_Max + 56;
+   F_Previous_Choice          : constant Form_Request_Code := Key_Max + 57;
+
+   --  For those who like the old 'C' style request names
+   REQ_NEXT_PAGE    : Form_Request_Code renames F_Next_Page;
+   REQ_PREV_PAGE    : Form_Request_Code renames F_Previous_Page;
+   REQ_FIRST_PAGE   : Form_Request_Code renames F_First_Page;
+   REQ_LAST_PAGE    : Form_Request_Code renames F_Last_Page;
+
+   REQ_NEXT_FIELD   : Form_Request_Code renames F_Next_Field;
+   REQ_PREV_FIELD   : Form_Request_Code renames F_Previous_Field;
+   REQ_FIRST_FIELD  : Form_Request_Code renames F_First_Field;
+   REQ_LAST_FIELD   : Form_Request_Code renames F_Last_Field;
+   REQ_SNEXT_FIELD  : Form_Request_Code renames F_Sorted_Next_Field;
+   REQ_SPREV_FIELD  : Form_Request_Code renames F_Sorted_Previous_Field;
+   REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
+   REQ_SLAST_FIELD  : Form_Request_Code renames F_Sorted_Last_Field;
+   REQ_LEFT_FIELD   : Form_Request_Code renames F_Left_Field;
+   REQ_RIGHT_FIELD  : Form_Request_Code renames F_Right_Field;
+   REQ_UP_FIELD     : Form_Request_Code renames F_Up_Field;
+   REQ_DOWN_FIELD   : Form_Request_Code renames F_Down_Field;
+
+   REQ_NEXT_CHAR    : Form_Request_Code renames F_Next_Char;
+   REQ_PREV_CHAR    : Form_Request_Code renames F_Previous_Char;
+   REQ_NEXT_LINE    : Form_Request_Code renames F_Next_Line;
+   REQ_PREV_LINE    : Form_Request_Code renames F_Previous_Line;
+   REQ_NEXT_WORD    : Form_Request_Code renames F_Next_Word;
+   REQ_PREV_WORD    : Form_Request_Code renames F_Previous_Word;
+   REQ_BEG_FIELD    : Form_Request_Code renames F_Begin_Field;
+   REQ_END_FIELD    : Form_Request_Code renames F_End_Field;
+   REQ_BEG_LINE     : Form_Request_Code renames F_Begin_Line;
+   REQ_END_LINE     : Form_Request_Code renames F_End_Line;
+   REQ_LEFT_CHAR    : Form_Request_Code renames F_Left_Char;
+   REQ_RIGHT_CHAR   : Form_Request_Code renames F_Right_Char;
+   REQ_UP_CHAR      : Form_Request_Code renames F_Up_Char;
+   REQ_DOWN_CHAR    : Form_Request_Code renames F_Down_Char;
+
+   REQ_NEW_LINE     : Form_Request_Code renames F_New_Line;
+   REQ_INS_CHAR     : Form_Request_Code renames F_Insert_Char;
+   REQ_INS_LINE     : Form_Request_Code renames F_Insert_Line;
+   REQ_DEL_CHAR     : Form_Request_Code renames F_Delete_Char;
+   REQ_DEL_PREV     : Form_Request_Code renames F_Delete_Previous;
+   REQ_DEL_LINE     : Form_Request_Code renames F_Delete_Line;
+   REQ_DEL_WORD     : Form_Request_Code renames F_Delete_Word;
+   REQ_CLR_EOL      : Form_Request_Code renames F_Clear_EOL;
+   REQ_CLR_EOF      : Form_Request_Code renames F_Clear_EOF;
+   REQ_CLR_FIELD    : Form_Request_Code renames F_Clear_Field;
+   REQ_OVL_MODE     : Form_Request_Code renames F_Overlay_Mode;
+   REQ_INS_MODE     : Form_Request_Code renames F_Insert_Mode;
+
+   REQ_SCR_FLINE    : Form_Request_Code renames F_ScrollForward_Line;
+   REQ_SCR_BLINE    : Form_Request_Code renames F_ScrollBackward_Line;
+   REQ_SCR_FPAGE    : Form_Request_Code renames F_ScrollForward_Page;
+   REQ_SCR_BPAGE    : Form_Request_Code renames F_ScrollBackward_Page;
+   REQ_SCR_FHPAGE   : Form_Request_Code renames F_ScrollForward_HalfPage;
+   REQ_SCR_BHPAGE   : Form_Request_Code renames F_ScrollBackward_HalfPage;
+
+   REQ_SCR_FCHAR    : Form_Request_Code renames F_HScrollForward_Char;
+   REQ_SCR_BCHAR    : Form_Request_Code renames F_HScrollBackward_Char;
+   REQ_SCR_HFLINE   : Form_Request_Code renames F_HScrollForward_Line;
+   REQ_SCR_HBLINE   : Form_Request_Code renames F_HScrollBackward_Line;
+   REQ_SCR_HFHALF   : Form_Request_Code renames F_HScrollForward_HalfLine;
+   REQ_SCR_HBHALF   : Form_Request_Code renames F_HScrollBackward_HalfLine;
+
+   REQ_VALIDATION   : Form_Request_Code renames F_Validate_Field;
+   REQ_NEXT_CHOICE  : Form_Request_Code renames F_Next_Choice;
+   REQ_PREV_CHOICE  : Form_Request_Code renames F_Previous_Choice;
+
+   procedure Request_Name (Key  : Form_Request_Code;
+                           Name : out String);
+
+   function  Request_Name (Key : Form_Request_Code) return String;
+   --  Same as function
+   pragma Inline (Request_Name);
+
+   ------------------
+   --  Exceptions  --
+   ------------------
+   Form_Exception : exception;
+
+   --  |=====================================================================
+   --  | Man page form_field_new.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   function Create (Height       : Line_Count;
+                    Width        : Column_Count;
+                    Top          : Line_Position;
+                    Left         : Column_Position;
+                    Off_Screen   : Natural := 0;
+                    More_Buffers : Buffer_Number := Buffer_Number'First)
+                    return Field;
+   --  AKA: new_field()
+   --  An overloaded Create is defined later. Pragma Inline appears there.
+
+   --  #1A NAME="AFU_2"#2|
+   function New_Field (Height       : Line_Count;
+                       Width        : Column_Count;
+                       Top          : Line_Position;
+                       Left         : Column_Position;
+                       Off_Screen   : Natural := 0;
+                       More_Buffers : Buffer_Number := Buffer_Number'First)
+                       return Field renames Create;
+   --  AKA: new_field()
+   pragma Inline (New_Field);
+
+   --  #1A NAME="AFU_3"#2|
+   procedure Delete (Fld : in out Field);
+   --  AKA: free_field()
+   --  Reset Fld to Null_Field
+   --  An overloaded Delete is defined later. Pragma Inline appears there.
+
+   --  #1A NAME="AFU_4"#2|
+   function Duplicate (Fld  : Field;
+                       Top  : Line_Position;
+                       Left : Column_Position) return Field;
+   --  AKA: dup_field()
+   pragma Inline (Duplicate);
+
+   --  #1A NAME="AFU_5"#2|
+   function Link (Fld  : Field;
+                  Top  : Line_Position;
+                  Left : Column_Position) return Field;
+   --  AKA: link_field()
+   pragma Inline (Link);
+
+   --  |=====================================================================
+   --  | Man page form_field_just.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_6"#2|
+   procedure Set_Justification (Fld  : Field;
+                                Just : Field_Justification := None);
+   --  AKA: set_field_just()
+   pragma Inline (Set_Justification);
+
+   --  #1A NAME="AFU_7"#2|
+   function Get_Justification (Fld : Field) return Field_Justification;
+   --  AKA: field_just()
+   pragma Inline (Get_Justification);
+
+   --  |=====================================================================
+   --  | Man page form_field_buffer.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_8"#2|
+   procedure Set_Buffer
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
+      Str    : String);
+   --  AKA: set_field_buffer()
+   --  Not inlined
+
+   --  #1A NAME="AFU_9"#2|
+   procedure Get_Buffer
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First;
+      Str    : out String);
+   --  AKA: field_buffer()
+
+   function Get_Buffer
+     (Fld    : Field;
+      Buffer : Buffer_Number := Buffer_Number'First) return String;
+   --  AKA: field_buffer()
+   --  Same but as function
+   pragma Inline (Get_Buffer);
+
+   --  #1A NAME="AFU_10"#2|
+   procedure Set_Status (Fld    : Field;
+                         Status : Boolean := True);
+   --  AKA: set_field_status()
+   pragma Inline (Set_Status);
+
+   --  #1A NAME="AFU_11"#2|
+   function Changed (Fld : Field) return Boolean;
+   --  AKA: field_status()
+   pragma Inline (Changed);
+
+   --  #1A NAME="AFU_12"#2|
+   procedure Set_Maximum_Size (Fld : Field;
+                               Max : Natural := 0);
+   --  AKA: set_field_max()
+   pragma Inline (Set_Maximum_Size);
+
+   --  |=====================================================================
+   --  | Man page form_field_opts.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_13"#2|
+   procedure Set_Options (Fld     : Field;
+                          Options : Field_Option_Set);
+   --  AKA: set_field_opts()
+   --  An overloaded version is defined later. Pragma Inline appears there
+
+   --  #1A NAME="AFU_14"#2|
+   procedure Switch_Options (Fld     : Field;
+                             Options : Field_Option_Set;
+                             On      : Boolean := True);
+   --  AKA: field_opts_on()
+   --  AKA: field_opts_off()
+   --  An overloaded version is defined later. Pragma Inline appears there
+
+   --  #1A NAME="AFU_15"#2|
+   procedure Get_Options (Fld     : Field;
+                          Options : out Field_Option_Set);
+   --  AKA: field_opts()
+
+   --  #1A NAME="AFU_16"#2|
+   function Get_Options (Fld : Field := Null_Field)
+                         return Field_Option_Set;
+   --  AKA: field_opts()
+   --  An overloaded version is defined later. Pragma Inline appears there
+
+   --  |=====================================================================
+   --  | Man page form_field_attributes.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_17"#2|
+   procedure Set_Foreground
+     (Fld   : Field;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: set_field_fore()
+   pragma Inline (Set_Foreground);
+
+   --  #1A NAME="AFU_18"#2|
+   procedure Foreground (Fld  : Field;
+                         Fore : out Character_Attribute_Set);
+   --  AKA: field_fore()
+
+   --  #1A NAME="AFU_19"#2|
+   procedure Foreground (Fld   : Field;
+                         Fore  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+   --  AKA: field_fore()
+   pragma Inline (Foreground);
+
+   --  #1A NAME="AFU_20"#2|
+   procedure Set_Background
+     (Fld   : Field;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: set_field_back()
+   pragma Inline (Set_Background);
+
+   --  #1A NAME="AFU_21"#2|
+   procedure Background (Fld  : Field;
+                         Back : out Character_Attribute_Set);
+   --  AKA: field_back()
+
+   --  #1A NAME="AFU_22"#2|
+   procedure Background (Fld   : Field;
+                         Back  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+   --  AKA: field_back()
+   pragma Inline (Background);
+
+   --  #1A NAME="AFU_23"#2|
+   procedure Set_Pad_Character (Fld : Field;
+                                Pad : Character := Space);
+   --  AKA: set_field_pad()
+   pragma Inline (Set_Pad_Character);
+
+   --  #1A NAME="AFU_24"#2|
+   procedure Pad_Character (Fld : Field;
+                            Pad : out Character);
+   --  AKA: field_pad()
+   pragma Inline (Pad_Character);
+
+   --  |=====================================================================
+   --  | Man page form_field_info.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_25"#2|
+   procedure Info (Fld                : Field;
+                   Lines              : out Line_Count;
+                   Columns            : out Column_Count;
+                   First_Row          : out Line_Position;
+                   First_Column       : out Column_Position;
+                   Off_Screen         : out Natural;
+                   Additional_Buffers : out Buffer_Number);
+   --  AKA: field_info()
+   pragma Inline (Info);
+
+   --  #1A NAME="AFU_26"#2|
+   procedure Dynamic_Info (Fld     : Field;
+                           Lines   : out Line_Count;
+                           Columns : out Column_Count;
+                           Max     : out Natural);
+   --  AKA: dynamic_field_info()
+   pragma Inline (Dynamic_Info);
+
+   --  |=====================================================================
+   --  | Man page form_win.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_27"#2|
+   procedure Set_Window (Frm : Form;
+                         Win : Window);
+   --  AKA: set_form_win()
+   pragma Inline (Set_Window);
+
+   --  #1A NAME="AFU_28"#2|
+   function Get_Window (Frm : Form) return Window;
+   --  AKA: form_win()
+   pragma Inline (Get_Window);
+
+   --  #1A NAME="AFU_29"#2|
+   procedure Set_Sub_Window (Frm : Form;
+                             Win : Window);
+   --  AKA: set_form_sub()
+   pragma Inline (Set_Sub_Window);
+
+   --  #1A NAME="AFU_30"#2|
+   function Get_Sub_Window (Frm : Form) return Window;
+   --  AKA: form_sub()
+   pragma Inline (Get_Sub_Window);
+
+   --  #1A NAME="AFU_31"#2|
+   procedure Scale (Frm     : Form;
+                    Lines   : out Line_Count;
+                    Columns : out Column_Count);
+   --  AKA: scale_form()
+   pragma Inline (Scale);
+
+   --  |=====================================================================
+   --  | Man page form_hook.3x
+   --  |=====================================================================
+
+   type Form_Hook_Function is access procedure (Frm : Form);
+   pragma Convention (C, Form_Hook_Function);
+
+   --  #1A NAME="AFU_32"#2|
+   procedure Set_Field_Init_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function);
+   --  AKA: set_field_init()
+   pragma Inline (Set_Field_Init_Hook);
+
+   --  #1A NAME="AFU_33"#2|
+   procedure Set_Field_Term_Hook (Frm  : Form;
+                                  Proc : Form_Hook_Function);
+   --  AKA: set_field_term()
+   pragma Inline (Set_Field_Term_Hook);
+
+   --  #1A NAME="AFU_34"#2|
+   procedure Set_Form_Init_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function);
+   --  AKA: set_form_init()
+   pragma Inline (Set_Form_Init_Hook);
+
+   --  #1A NAME="AFU_35"#2|
+   procedure Set_Form_Term_Hook (Frm  : Form;
+                                 Proc : Form_Hook_Function);
+   --  AKA: set_form_term()
+   pragma Inline (Set_Form_Term_Hook);
+
+   --  #1A NAME="AFU_36"#2|
+   function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
+   --  AKA: field_init()
+   pragma Import (C, Get_Field_Init_Hook, "field_init");
+
+   --  #1A NAME="AFU_37"#2|
+   function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
+   --  AKA: field_term()
+   pragma Import (C, Get_Field_Term_Hook, "field_term");
+
+   --  #1A NAME="AFU_38"#2|
+   function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
+   --  AKA: form_init()
+   pragma Import (C, Get_Form_Init_Hook, "form_init");
+
+   --  #1A NAME="AFU_39"#2|
+   function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
+   --  AKA: form_term()
+   pragma Import (C, Get_Form_Term_Hook, "form_term");
+
+   --  |=====================================================================
+   --  | Man page form_field.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_40"#2|
+   procedure Redefine (Frm  : Form;
+                       Flds : Field_Array_Access);
+   --  AKA: set_form_fields()
+   pragma Inline (Redefine);
+
+   --  #1A NAME="AFU_41"#2|
+   procedure Set_Fields (Frm  : Form;
+                         Flds : Field_Array_Access) renames Redefine;
+   --  AKA: set_form_fields()
+   --  pragma Inline (Set_Fields);
+
+   --  #1A NAME="AFU_42"#2|
+   function Fields (Frm   : Form;
+                    Index : Positive) return Field;
+   --  AKA: form_fields()
+   pragma Inline (Fields);
+
+   --  #1A NAME="AFU_43"#2|
+   function Field_Count (Frm : Form) return Natural;
+   --  AKA: field_count()
+   pragma Inline (Field_Count);
+
+   --  #1A NAME="AFU_44"#2|
+   procedure Move (Fld    : Field;
+                   Line   : Line_Position;
+                   Column : Column_Position);
+   --  AKA: move_field()
+   pragma Inline (Move);
+
+   --  |=====================================================================
+   --  | Man page form_new.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_45"#2|
+   function Create (Fields : Field_Array_Access) return Form;
+   --  AKA: new_form()
+   pragma Inline (Create);
+
+   --  #1A NAME="AFU_46"#2|
+   function New_Form (Fields : Field_Array_Access) return Form
+     renames Create;
+   --  AKA: new_form()
+   --  pragma Inline (New_Form);
+
+   --  #1A NAME="AFU_47"#2|
+   procedure Delete (Frm : in out Form);
+   --  AKA: free_form()
+   --  Reset Frm to Null_Form
+   pragma Inline (Delete);
+
+   --  |=====================================================================
+   --  | Man page form_opts.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_48"#2|
+   procedure Set_Options (Frm     : Form;
+                          Options : Form_Option_Set);
+   --  AKA: set_form_opts()
+   pragma Inline (Set_Options);
+
+   --  #1A NAME="AFU_49"#2|
+   procedure Switch_Options (Frm     : Form;
+                             Options : Form_Option_Set;
+                             On      : Boolean := True);
+   --  AKA: form_opts_on()
+   --  AKA: form_opts_off()
+   pragma Inline (Switch_Options);
+
+   --  #1A NAME="AFU_50"#2|
+   procedure Get_Options (Frm     : Form;
+                          Options : out Form_Option_Set);
+   --  AKA: form_opts()
+
+   --  #1A NAME="AFU_51"#2|
+   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
+   --  AKA: form_opts()
+   pragma Inline (Get_Options);
+
+   --  |=====================================================================
+   --  | Man page form_post.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_52"#2|
+   procedure Post (Frm  : Form;
+                   Post : Boolean := True);
+   --  AKA: post_form()
+   --  AKA: unpost_form()
+   pragma Inline (Post);
+
+   --  |=====================================================================
+   --  | Man page form_cursor.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_53"#2|
+   procedure Position_Cursor (Frm : Form);
+   --  AKA: pos_form_cursor()
+   pragma Inline (Position_Cursor);
+
+   --  |=====================================================================
+   --  | Man page form_data.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_54"#2|
+   function Data_Ahead (Frm : Form) return Boolean;
+   --  AKA: data_ahead()
+   pragma Inline (Data_Ahead);
+
+   --  #1A NAME="AFU_55"#2|
+   function Data_Behind (Frm : Form) return Boolean;
+   --  AKA: data_behind()
+   pragma Inline (Data_Behind);
+
+   --  |=====================================================================
+   --  | Man page form_driver.3x
+   --  |=====================================================================
+
+   type Driver_Result is (Form_Ok,
+                          Request_Denied,
+                          Unknown_Request,
+                          Invalid_Field);
+
+   --  #1A NAME="AFU_56"#2|
+   function Driver (Frm : Form;
+                    Key : Key_Code) return Driver_Result;
+   --  AKA: form_driver()
+   --  Driver not inlined
+
+   --  |=====================================================================
+   --  | Man page form_page.3x
+   --  |=====================================================================
+
+   type Page_Number is new Natural;
+
+   --  #1A NAME="AFU_57"#2|
+   procedure Set_Current (Frm : Form;
+                          Fld : Field);
+   --  AKA: set_current_field()
+   pragma Inline (Set_Current);
+
+   --  #1A NAME="AFU_58"#2|
+   function Current (Frm : Form) return Field;
+   --  AKA: current_field()
+   pragma Inline (Current);
+
+   --  #1A NAME="AFU_59"#2|
+   procedure Set_Page (Frm  : Form;
+                       Page : Page_Number := Page_Number'First);
+   --  AKA: set_form_page()
+   pragma Inline (Set_Page);
+
+   --  #1A NAME="AFU_60"#2|
+   function Page (Frm : Form) return Page_Number;
+   --  AKA: form_page()
+   pragma Inline (Page);
+
+   --  #1A NAME="AFU_61"#2|
+   function Get_Index (Fld : Field) return Positive;
+   --  AKA: field_index()
+   --  Please note that in this binding we start the numbering of fields
+   --  with 1. So this is number is one more than you get from the low
+   --  level call.
+   pragma Inline (Get_Index);
+
+   --  |=====================================================================
+   --  | Man page form_new_page.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_62"#2|
+   procedure Set_New_Page (Fld      : Field;
+                           New_Page : Boolean := True);
+   --  AKA: set_new_page()
+   pragma Inline (Set_New_Page);
+
+   --  #1A NAME="AFU_63"#2|
+   function Is_New_Page (Fld : Field) return Boolean;
+   --  AKA: new_page()
+   pragma Inline (Is_New_Page);
+
+   --  |=====================================================================
+   --  | Man page form_requestname.3x
+   --  |=====================================================================
+   --  Not Implemented: form_request_name, form_request_by_name
+
+------------------------------------------------------------------------------
+private
+   type Field is new System.Storage_Elements.Integer_Address;
+   type Form  is new System.Storage_Elements.Integer_Address;
+
+   Null_Field : constant Field := 0;
+   Null_Form  : constant Form  := 0;
+
+end Terminal_Interface.Curses.Forms;
+
diff --git a/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm new file mode 100644 index 00000000000..c9583dd3a1b --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm @@ -0,0 +1,83 @@ + +terminal_interface-curses-menus-item_user_data.adb + +

File : terminal_interface-curses-menus-item_user_data.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Menus.Item_User_Data             --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Menus.Item_User_Data is
+
+   use type Interfaces.C.int;
+
+   procedure Set_User_Data (Itm  : Item;
+                            Data : User_Access)
+   is
+      function Set_Item_Userptr (Itm  : Item;
+                                 Addr : User_Access)  return C_Int;
+      pragma Import (C, Set_Item_Userptr, "set_item_userptr");
+
+      Res : constant Eti_Error := Set_Item_Userptr (Itm, Data);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_User_Data;
+
+   function Get_User_Data (Itm  : Item) return User_Access
+   is
+      function Item_Userptr (Itm : Item) return User_Access;
+      pragma Import (C, Item_Userptr, "item_userptr");
+   begin
+      return Item_Userptr (Itm);
+   end Get_User_Data;
+
+   procedure Get_User_Data (Itm  : Item;
+                            Data : out User_Access)
+   is
+   begin
+      Data := Get_User_Data (Itm);
+   end Get_User_Data;
+
+end Terminal_Interface.Curses.Menus.Item_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm new file mode 100644 index 00000000000..8614e20a26c --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm @@ -0,0 +1,80 @@ + +terminal_interface-curses-menus-item_user_data.ads + +

File : terminal_interface-curses-menus-item_user_data.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Menus.Item_User_Data             --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.17 @
+--  @Date: 2009/12/26 17:31:35 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Menus.Item_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data);
+
+   --  The binding uses the same user pointer for menu items
+   --  as the low level C implementation. So you can safely
+   --  read or write the user pointer also with the C routines
+   --
+   --  |=====================================================================
+   --  | Man page mitem_userptr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Set_User_Data (Itm  : Item;
+                            Data : User_Access);
+   --  AKA: set_item_userptr
+   pragma Inline (Set_User_Data);
+
+   --  #1A NAME="AFU_2"#2|
+   procedure Get_User_Data (Itm  : Item;
+                            Data : out User_Access);
+   --  AKA: item_userptr
+
+   --  #1A NAME="AFU_3"#2|
+   function Get_User_Data (Itm  : Item) return User_Access;
+   --  AKA: item_userptr
+   --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Menus.Item_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm new file mode 100644 index 00000000000..9c4e92f245c --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm @@ -0,0 +1,82 @@ + +terminal_interface-curses-menus-menu_user_data.adb + +

File : terminal_interface-curses-menus-menu_user_data.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Menus.Menu_User_Data             --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.13 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.Menus.Menu_User_Data is
+
+   use type Interfaces.C.int;
+
+   procedure Set_User_Data (Men  : Menu;
+                            Data : User_Access)
+   is
+      function Set_Menu_Userptr (Men  : Menu;
+                                 Data : User_Access)  return C_Int;
+      pragma Import (C, Set_Menu_Userptr, "set_menu_userptr");
+
+      Res : constant Eti_Error := Set_Menu_Userptr (Men, Data);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_User_Data;
+
+   function Get_User_Data (Men  : Menu) return User_Access
+   is
+      function Menu_Userptr (Men : Menu) return User_Access;
+      pragma Import (C, Menu_Userptr, "menu_userptr");
+   begin
+      return Menu_Userptr (Men);
+   end Get_User_Data;
+
+   procedure Get_User_Data (Men  : Menu;
+                            Data : out User_Access)
+   is
+   begin
+      Data := Get_User_Data (Men);
+   end Get_User_Data;
+
+end Terminal_Interface.Curses.Menus.Menu_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm new file mode 100644 index 00000000000..72276413b1e --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm @@ -0,0 +1,75 @@ + +terminal_interface-curses-menus-menu_user_data.ads + +

File : terminal_interface-curses-menus-menu_user_data.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Menus.Menu_User_Data             --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.15 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Menus.Menu_User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data);
+
+   --  |=====================================================================
+   --  | Man page menu_userptr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Set_User_Data (Men  : Menu;
+                            Data : User_Access);
+   --  AKA: set_menu_userptr
+   pragma Inline (Set_User_Data);
+
+   --  #1A NAME="AFU_2"#2|
+   procedure Get_User_Data (Men  : Menu;
+                            Data : out User_Access);
+   --  AKA: menu_userptr
+
+   --  #1A NAME="AFU_3"#2|
+   function Get_User_Data (Men  : Menu) return User_Access;
+   --  AKA: menu_userptr
+   --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Menus.Menu_User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-menus__adb.htm b/doc/html/ada/terminal_interface-curses-menus__adb.htm new file mode 100644 index 00000000000..73ec35a06e4 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-menus__adb.htm @@ -0,0 +1,1028 @@ + +terminal_interface-curses-menus.adb + +

File : terminal_interface-curses-menus.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Menus                     --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.27 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Unchecked_Deallocation;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+with Interfaces.C; use Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Interfaces.C.Pointers;
+
+with Ada.Unchecked_Conversion;
+
+package body Terminal_Interface.Curses.Menus is
+
+   type C_Item_Array is array (Natural range <>) of aliased Item;
+   package I_Array is new
+     Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item);
+
+   use type System.Bit_Order;
+   subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
+
+   function MOS_2_CInt is new
+     Ada.Unchecked_Conversion (Menu_Option_Set,
+                               C_Int);
+
+   function CInt_2_MOS is new
+     Ada.Unchecked_Conversion (C_Int,
+                               Menu_Option_Set);
+
+   function IOS_2_CInt is new
+     Ada.Unchecked_Conversion (Item_Option_Set,
+                               C_Int);
+
+   function CInt_2_IOS is new
+     Ada.Unchecked_Conversion (C_Int,
+                               Item_Option_Set);
+
+------------------------------------------------------------------------------
+   procedure Request_Name (Key  : Menu_Request_Code;
+                           Name : out String)
+   is
+      function Request_Name (Key : C_Int) return chars_ptr;
+      pragma Import (C, Request_Name, "menu_request_name");
+   begin
+      Fill_String (Request_Name (C_Int (Key)), Name);
+   end Request_Name;
+
+   function Request_Name (Key : Menu_Request_Code) return String
+   is
+      function Request_Name (Key : C_Int) return chars_ptr;
+      pragma Import (C, Request_Name, "menu_request_name");
+   begin
+      return Fill_String (Request_Name (C_Int (Key)));
+   end Request_Name;
+
+   function Create (Name        : String;
+                    Description : String := "") return Item
+   is
+      type Char_Ptr is access all Interfaces.C.char;
+      function Newitem (Name, Desc : Char_Ptr) return Item;
+      pragma Import (C, Newitem, "new_item");
+
+      type Name_String is new char_array (0 .. Name'Length);
+      type Name_String_Ptr is access Name_String;
+      pragma Controlled (Name_String_Ptr);
+
+      type Desc_String is new char_array (0 .. Description'Length);
+      type Desc_String_Ptr is access Desc_String;
+      pragma Controlled (Desc_String_Ptr);
+
+      Name_Str : constant Name_String_Ptr := new Name_String;
+      Desc_Str : constant Desc_String_Ptr := new Desc_String;
+      Name_Len, Desc_Len : size_t;
+      Result : Item;
+   begin
+      To_C (Name, Name_Str.all, Name_Len);
+      To_C (Description, Desc_Str.all, Desc_Len);
+      Result := Newitem (Name_Str.all (Name_Str.all'First)'Access,
+                         Desc_Str.all (Desc_Str.all'First)'Access);
+      if Result = Null_Item then
+         raise Eti_System_Error;
+      end if;
+      return Result;
+   end Create;
+
+   procedure Delete (Itm : in out Item)
+   is
+      function Descname (Itm  : Item) return chars_ptr;
+      pragma Import (C, Descname, "item_description");
+      function Itemname (Itm  : Item) return chars_ptr;
+      pragma Import (C, Itemname, "item_name");
+
+      function Freeitem (Itm : Item) return C_Int;
+      pragma Import (C, Freeitem, "free_item");
+
+      Res : Eti_Error;
+      Ptr : chars_ptr;
+   begin
+      Ptr := Descname (Itm);
+      if Ptr /= Null_Ptr then
+         Interfaces.C.Strings.Free (Ptr);
+      end if;
+      Ptr := Itemname (Itm);
+      if Ptr /= Null_Ptr then
+         Interfaces.C.Strings.Free (Ptr);
+      end if;
+      Res := Freeitem (Itm);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Itm := Null_Item;
+   end Delete;
+-------------------------------------------------------------------------------
+   procedure Set_Value (Itm   : Item;
+                        Value : Boolean := True)
+   is
+      function Set_Item_Val (Itm : Item;
+                             Val : C_Int) return C_Int;
+      pragma Import (C, Set_Item_Val, "set_item_value");
+
+      Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Value;
+
+   function Value (Itm : Item) return Boolean
+   is
+      function Item_Val (Itm : Item) return C_Int;
+      pragma Import (C, Item_Val, "item_value");
+   begin
+      if Item_Val (Itm) = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Value;
+
+-------------------------------------------------------------------------------
+   function Visible (Itm : Item) return Boolean
+   is
+      function Item_Vis (Itm : Item) return C_Int;
+      pragma Import (C, Item_Vis, "item_visible");
+   begin
+      if Item_Vis (Itm) = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Visible;
+-------------------------------------------------------------------------------
+   procedure Set_Options (Itm     : Item;
+                          Options : Item_Option_Set)
+   is
+      function Set_Item_Opts (Itm : Item;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Set_Item_Opts, "set_item_opts");
+
+      Opt : constant C_Int := IOS_2_CInt (Options);
+      Res : Eti_Error;
+   begin
+      Res := Set_Item_Opts (Itm, Opt);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Options;
+
+   procedure Switch_Options (Itm     : Item;
+                             Options : Item_Option_Set;
+                             On      : Boolean := True)
+   is
+      function Item_Opts_On (Itm : Item;
+                             Opt : C_Int) return C_Int;
+      pragma Import (C, Item_Opts_On, "item_opts_on");
+      function Item_Opts_Off (Itm : Item;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Item_Opts_Off, "item_opts_off");
+
+      Opt : constant C_Int := IOS_2_CInt (Options);
+      Err : Eti_Error;
+   begin
+      if On then
+         Err := Item_Opts_On (Itm, Opt);
+      else
+         Err := Item_Opts_Off (Itm, Opt);
+      end if;
+      if Err /= E_Ok then
+         Eti_Exception (Err);
+      end if;
+   end Switch_Options;
+
+   procedure Get_Options (Itm     : Item;
+                          Options : out Item_Option_Set)
+   is
+      function Item_Opts (Itm : Item) return C_Int;
+      pragma Import (C, Item_Opts, "item_opts");
+
+      Res : constant C_Int := Item_Opts (Itm);
+   begin
+      Options := CInt_2_IOS (Res);
+   end Get_Options;
+
+   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set
+   is
+      Ios : Item_Option_Set;
+   begin
+      Get_Options (Itm, Ios);
+      return Ios;
+   end Get_Options;
+-------------------------------------------------------------------------------
+   procedure Name (Itm  : Item;
+                   Name : out String)
+   is
+      function Itemname (Itm : Item) return chars_ptr;
+      pragma Import (C, Itemname, "item_name");
+   begin
+      Fill_String (Itemname (Itm), Name);
+   end Name;
+
+   function Name (Itm : Item) return String
+   is
+      function Itemname (Itm : Item) return chars_ptr;
+      pragma Import (C, Itemname, "item_name");
+   begin
+      return Fill_String (Itemname (Itm));
+   end Name;
+
+   procedure Description (Itm         : Item;
+                          Description : out String)
+   is
+      function Descname (Itm  : Item) return chars_ptr;
+      pragma Import (C, Descname, "item_description");
+   begin
+      Fill_String (Descname (Itm), Description);
+   end Description;
+
+   function Description (Itm : Item) return String
+   is
+      function Descname (Itm  : Item) return chars_ptr;
+      pragma Import (C, Descname, "item_description");
+   begin
+      return Fill_String (Descname (Itm));
+   end Description;
+-------------------------------------------------------------------------------
+   procedure Set_Current (Men : Menu;
+                          Itm : Item)
+   is
+      function Set_Curr_Item (Men : Menu;
+                              Itm : Item) return C_Int;
+      pragma Import (C, Set_Curr_Item, "set_current_item");
+
+      Res : constant Eti_Error := Set_Curr_Item (Men, Itm);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Current;
+
+   function Current (Men : Menu) return Item
+   is
+      function Curr_Item (Men : Menu) return Item;
+      pragma Import (C, Curr_Item, "current_item");
+
+      Res : constant Item := Curr_Item (Men);
+   begin
+      if Res = Null_Item then
+         raise Menu_Exception;
+      end if;
+      return Res;
+   end Current;
+
+   procedure Set_Top_Row (Men  : Menu;
+                          Line : Line_Position)
+   is
+      function Set_Toprow (Men  : Menu;
+                           Line : C_Int) return C_Int;
+      pragma Import (C, Set_Toprow, "set_top_row");
+
+      Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Top_Row;
+
+   function Top_Row (Men : Menu) return Line_Position
+   is
+      function Toprow (Men : Menu) return C_Int;
+      pragma Import (C, Toprow, "top_row");
+
+      Res : constant C_Int := Toprow (Men);
+   begin
+      if Res = Curses_Err then
+         raise Menu_Exception;
+      end if;
+      return Line_Position (Res);
+   end Top_Row;
+
+   function Get_Index (Itm : Item) return Positive
+   is
+      function Get_Itemindex (Itm : Item) return C_Int;
+      pragma Import (C, Get_Itemindex, "item_index");
+
+      Res : constant C_Int := Get_Itemindex (Itm);
+   begin
+      if Res = Curses_Err then
+         raise Menu_Exception;
+      end if;
+      return Positive (Natural (Res) + Positive'First);
+   end Get_Index;
+-------------------------------------------------------------------------------
+   procedure Post (Men  : Menu;
+                   Post : Boolean := True)
+   is
+      function M_Post (Men : Menu) return C_Int;
+      pragma Import (C, M_Post, "post_menu");
+      function M_Unpost (Men : Menu) return C_Int;
+      pragma Import (C, M_Unpost, "unpost_menu");
+
+      Res : Eti_Error;
+   begin
+      if Post then
+         Res := M_Post (Men);
+      else
+         Res := M_Unpost (Men);
+      end if;
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Post;
+-------------------------------------------------------------------------------
+   procedure Set_Options (Men     : Menu;
+                          Options : Menu_Option_Set)
+   is
+      function Set_Menu_Opts (Men : Menu;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Set_Menu_Opts, "set_menu_opts");
+
+      Opt : constant C_Int := MOS_2_CInt (Options);
+      Res : Eti_Error;
+   begin
+      Res := Set_Menu_Opts (Men, Opt);
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Options;
+
+   procedure Switch_Options (Men     : Menu;
+                             Options : Menu_Option_Set;
+                             On      : Boolean := True)
+   is
+      function Menu_Opts_On (Men : Menu;
+                             Opt : C_Int) return C_Int;
+      pragma Import (C, Menu_Opts_On, "menu_opts_on");
+      function Menu_Opts_Off (Men : Menu;
+                              Opt : C_Int) return C_Int;
+      pragma Import (C, Menu_Opts_Off, "menu_opts_off");
+
+      Opt : constant C_Int := MOS_2_CInt (Options);
+      Err : Eti_Error;
+   begin
+      if On then
+         Err := Menu_Opts_On  (Men, Opt);
+      else
+         Err := Menu_Opts_Off (Men, Opt);
+      end if;
+      if Err /= E_Ok then
+         Eti_Exception (Err);
+      end if;
+   end Switch_Options;
+
+   procedure Get_Options (Men     : Menu;
+                          Options : out Menu_Option_Set)
+   is
+      function Menu_Opts (Men : Menu) return C_Int;
+      pragma Import (C, Menu_Opts, "menu_opts");
+
+      Res : constant C_Int := Menu_Opts (Men);
+   begin
+      Options := CInt_2_MOS (Res);
+   end Get_Options;
+
+   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set
+   is
+      Mos : Menu_Option_Set;
+   begin
+      Get_Options (Men, Mos);
+      return Mos;
+   end Get_Options;
+-------------------------------------------------------------------------------
+   procedure Set_Window (Men : Menu;
+                         Win : Window)
+   is
+      function Set_Menu_Win (Men : Menu;
+                             Win : Window) return C_Int;
+      pragma Import (C, Set_Menu_Win, "set_menu_win");
+
+      Res : constant Eti_Error := Set_Menu_Win (Men, Win);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Window;
+
+   function Get_Window (Men : Menu) return Window
+   is
+      function Menu_Win (Men : Menu) return Window;
+      pragma Import (C, Menu_Win, "menu_win");
+
+      W : constant Window := Menu_Win (Men);
+   begin
+      return W;
+   end Get_Window;
+
+   procedure Set_Sub_Window (Men : Menu;
+                             Win : Window)
+   is
+      function Set_Menu_Sub (Men : Menu;
+                             Win : Window) return C_Int;
+      pragma Import (C, Set_Menu_Sub, "set_menu_sub");
+
+      Res : constant Eti_Error := Set_Menu_Sub (Men, Win);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Sub_Window;
+
+   function Get_Sub_Window (Men : Menu) return Window
+   is
+      function Menu_Sub (Men : Menu) return Window;
+      pragma Import (C, Menu_Sub, "menu_sub");
+
+      W : constant Window := Menu_Sub (Men);
+   begin
+      return W;
+   end Get_Sub_Window;
+
+   procedure Scale (Men     : Menu;
+                    Lines   : out Line_Count;
+                    Columns : out Column_Count)
+   is
+      type C_Int_Access is access all C_Int;
+      function M_Scale (Men    : Menu;
+                        Yp, Xp : C_Int_Access) return C_Int;
+      pragma Import (C, M_Scale, "scale_menu");
+
+      X, Y : aliased C_Int;
+      Res  : constant Eti_Error := M_Scale (Men, Y'Access, X'Access);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Lines := Line_Count (Y);
+      Columns := Column_Count (X);
+   end Scale;
+-------------------------------------------------------------------------------
+   procedure Position_Cursor (Men : Menu)
+   is
+      function Pos_Menu_Cursor (Men : Menu) return C_Int;
+      pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor");
+
+      Res : constant Eti_Error := Pos_Menu_Cursor (Men);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Position_Cursor;
+
+-------------------------------------------------------------------------------
+   procedure Set_Mark (Men  : Menu;
+                       Mark : String)
+   is
+      type Char_Ptr is access all Interfaces.C.char;
+      function Set_Mark (Men  : Menu;
+                         Mark : Char_Ptr) return C_Int;
+      pragma Import (C, Set_Mark, "set_menu_mark");
+
+      Txt : char_array (0 .. Mark'Length);
+      Len : size_t;
+      Res : Eti_Error;
+   begin
+      To_C (Mark, Txt, Len);
+      Res := Set_Mark (Men, Txt (Txt'First)'Access);
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Mark;
+
+   procedure Mark (Men  : Menu;
+                   Mark : out String)
+   is
+      function Get_Menu_Mark (Men : Menu) return chars_ptr;
+      pragma Import (C, Get_Menu_Mark, "menu_mark");
+   begin
+      Fill_String (Get_Menu_Mark (Men), Mark);
+   end Mark;
+
+   function Mark (Men : Menu) return String
+   is
+      function Get_Menu_Mark (Men : Menu) return chars_ptr;
+      pragma Import (C, Get_Menu_Mark, "menu_mark");
+   begin
+      return Fill_String (Get_Menu_Mark (Men));
+   end Mark;
+
+-------------------------------------------------------------------------------
+   procedure Set_Foreground
+     (Men   : Menu;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Set_Menu_Fore (Men  : Menu;
+                              Attr : C_Chtype) return C_Int;
+      pragma Import (C, Set_Menu_Fore, "set_menu_fore");
+
+      Ch : constant Attributed_Character := (Ch    => Character'First,
+                                             Color => Color,
+                                             Attr  => Fore);
+      Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Foreground;
+
+   procedure Foreground (Men  : Menu;
+                         Fore : out Character_Attribute_Set)
+   is
+      function Menu_Fore (Men : Menu) return C_Chtype;
+      pragma Import (C, Menu_Fore, "menu_fore");
+   begin
+      Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
+   end Foreground;
+
+   procedure Foreground (Men   : Menu;
+                         Fore  : out Character_Attribute_Set;
+                         Color : out Color_Pair)
+   is
+      function Menu_Fore (Men : Menu) return C_Chtype;
+      pragma Import (C, Menu_Fore, "menu_fore");
+   begin
+      Fore  := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
+      Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color;
+   end Foreground;
+
+   procedure Set_Background
+     (Men   : Menu;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Set_Menu_Back (Men  : Menu;
+                              Attr : C_Chtype) return C_Int;
+      pragma Import (C, Set_Menu_Back, "set_menu_back");
+
+      Ch : constant Attributed_Character := (Ch    => Character'First,
+                                             Color => Color,
+                                             Attr  => Back);
+      Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Background;
+
+   procedure Background (Men  : Menu;
+                         Back : out Character_Attribute_Set)
+   is
+      function Menu_Back (Men : Menu) return C_Chtype;
+      pragma Import (C, Menu_Back, "menu_back");
+   begin
+      Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
+   end Background;
+
+   procedure Background (Men   : Menu;
+                         Back  : out Character_Attribute_Set;
+                         Color : out Color_Pair)
+   is
+      function Menu_Back (Men : Menu) return C_Chtype;
+      pragma Import (C, Menu_Back, "menu_back");
+   begin
+      Back  := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
+      Color := Chtype_To_AttrChar (Menu_Back (Men)).Color;
+   end Background;
+
+   procedure Set_Grey (Men   : Menu;
+                       Grey  : Character_Attribute_Set := Normal_Video;
+                       Color : Color_Pair := Color_Pair'First)
+   is
+      function Set_Menu_Grey (Men  : Menu;
+                              Attr : C_Chtype) return C_Int;
+      pragma Import (C, Set_Menu_Grey, "set_menu_grey");
+
+      Ch : constant Attributed_Character := (Ch    => Character'First,
+                                             Color => Color,
+                                             Attr  => Grey);
+
+      Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Grey;
+
+   procedure Grey (Men  : Menu;
+                   Grey : out Character_Attribute_Set)
+   is
+      function Menu_Grey (Men : Menu) return C_Chtype;
+      pragma Import (C, Menu_Grey, "menu_grey");
+   begin
+      Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
+   end Grey;
+
+   procedure Grey (Men  : Menu;
+                   Grey : out Character_Attribute_Set;
+                   Color : out Color_Pair)
+   is
+      function Menu_Grey (Men : Menu) return C_Chtype;
+      pragma Import (C, Menu_Grey, "menu_grey");
+   begin
+      Grey  := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
+      Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color;
+   end Grey;
+
+   procedure Set_Pad_Character (Men : Menu;
+                                Pad : Character := Space)
+   is
+      function Set_Menu_Pad (Men : Menu;
+                             Ch  : C_Int) return C_Int;
+      pragma Import (C, Set_Menu_Pad, "set_menu_pad");
+
+      Res : constant Eti_Error := Set_Menu_Pad (Men,
+                                                C_Int (Character'Pos (Pad)));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Pad_Character;
+
+   procedure Pad_Character (Men : Menu;
+                            Pad : out Character)
+   is
+      function Menu_Pad (Men : Menu) return C_Int;
+      pragma Import (C, Menu_Pad, "menu_pad");
+   begin
+      Pad := Character'Val (Menu_Pad (Men));
+   end Pad_Character;
+-------------------------------------------------------------------------------
+   procedure Set_Spacing (Men   : Menu;
+                          Descr : Column_Position := 0;
+                          Row   : Line_Position   := 0;
+                          Col   : Column_Position := 0)
+   is
+      function Set_Spacing (Men     : Menu;
+                            D, R, C : C_Int) return C_Int;
+      pragma Import (C, Set_Spacing, "set_menu_spacing");
+
+      Res : constant Eti_Error := Set_Spacing (Men,
+                                               C_Int (Descr),
+                                               C_Int (Row),
+                                               C_Int (Col));
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Spacing;
+
+   procedure Spacing (Men   : Menu;
+                      Descr : out Column_Position;
+                      Row   : out Line_Position;
+                      Col   : out Column_Position)
+   is
+      type C_Int_Access is access all C_Int;
+      function Get_Spacing (Men     : Menu;
+                            D, R, C : C_Int_Access) return C_Int;
+      pragma Import (C, Get_Spacing, "menu_spacing");
+
+      D, R, C : aliased C_Int;
+      Res : constant Eti_Error := Get_Spacing (Men,
+                                               D'Access,
+                                               R'Access,
+                                               C'Access);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      else
+         Descr := Column_Position (D);
+         Row   := Line_Position (R);
+         Col   := Column_Position (C);
+      end if;
+   end Spacing;
+-------------------------------------------------------------------------------
+   function Set_Pattern (Men  : Menu;
+                         Text : String) return Boolean
+   is
+      type Char_Ptr is access all Interfaces.C.char;
+      function Set_Pattern (Men     : Menu;
+                            Pattern : Char_Ptr) return C_Int;
+      pragma Import (C, Set_Pattern, "set_menu_pattern");
+
+      S   : char_array (0 .. Text'Length);
+      L   : size_t;
+      Res : Eti_Error;
+   begin
+      To_C (Text, S, L);
+      Res := Set_Pattern (Men, S (S'First)'Access);
+      case Res is
+         when E_No_Match => return False;
+         when E_Ok       => return True;
+         when others =>
+            Eti_Exception (Res);
+            return False;
+      end case;
+   end Set_Pattern;
+
+   procedure Pattern (Men  : Menu;
+                      Text : out String)
+   is
+      function Get_Pattern (Men : Menu) return chars_ptr;
+      pragma Import (C, Get_Pattern, "menu_pattern");
+   begin
+      Fill_String (Get_Pattern (Men), Text);
+   end Pattern;
+-------------------------------------------------------------------------------
+   procedure Set_Format (Men     : Menu;
+                         Lines   : Line_Count;
+                         Columns : Column_Count)
+   is
+      function Set_Menu_Fmt (Men : Menu;
+                             Lin : C_Int;
+                             Col : C_Int) return C_Int;
+      pragma Import (C, Set_Menu_Fmt, "set_menu_format");
+
+      Res : constant Eti_Error := Set_Menu_Fmt (Men,
+                                                C_Int (Lines),
+                                                C_Int (Columns));
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Format;
+
+   procedure Format (Men     : Menu;
+                     Lines   : out Line_Count;
+                     Columns : out Column_Count)
+   is
+      type C_Int_Access is access all C_Int;
+      function Menu_Fmt (Men  : Menu;
+                         Y, X : C_Int_Access) return C_Int;
+      pragma Import (C, Menu_Fmt, "menu_format");
+
+      L, C : aliased C_Int;
+      Res  : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      else
+         Lines   := Line_Count (L);
+         Columns := Column_Count (C);
+      end if;
+   end Format;
+-------------------------------------------------------------------------------
+   procedure Set_Item_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
+   is
+      function Set_Item_Init (Men  : Menu;
+                              Proc : Menu_Hook_Function) return C_Int;
+      pragma Import (C, Set_Item_Init, "set_item_init");
+
+      Res : constant Eti_Error := Set_Item_Init (Men, Proc);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Item_Init_Hook;
+
+   procedure Set_Item_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
+   is
+      function Set_Item_Term (Men  : Menu;
+                              Proc : Menu_Hook_Function) return C_Int;
+      pragma Import (C, Set_Item_Term, "set_item_term");
+
+      Res : constant Eti_Error := Set_Item_Term (Men, Proc);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Item_Term_Hook;
+
+   procedure Set_Menu_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
+   is
+      function Set_Menu_Init (Men  : Menu;
+                              Proc : Menu_Hook_Function) return C_Int;
+      pragma Import (C, Set_Menu_Init, "set_menu_init");
+
+      Res : constant Eti_Error := Set_Menu_Init (Men, Proc);
+   begin
+      if  Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Menu_Init_Hook;
+
+   procedure Set_Menu_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function)
+   is
+      function Set_Menu_Term (Men  : Menu;
+                              Proc : Menu_Hook_Function) return C_Int;
+      pragma Import (C, Set_Menu_Term, "set_menu_term");
+
+      Res : constant Eti_Error := Set_Menu_Term (Men, Proc);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+   end Set_Menu_Term_Hook;
+
+   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function
+   is
+      function Item_Init (Men : Menu) return Menu_Hook_Function;
+      pragma Import (C, Item_Init, "item_init");
+   begin
+      return Item_Init (Men);
+   end Get_Item_Init_Hook;
+
+   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function
+   is
+      function Item_Term (Men : Menu) return Menu_Hook_Function;
+      pragma Import (C, Item_Term, "item_term");
+   begin
+      return Item_Term (Men);
+   end Get_Item_Term_Hook;
+
+   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function
+   is
+      function Menu_Init (Men : Menu) return Menu_Hook_Function;
+      pragma Import (C, Menu_Init, "menu_init");
+   begin
+      return Menu_Init (Men);
+   end Get_Menu_Init_Hook;
+
+   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function
+   is
+      function Menu_Term (Men : Menu) return Menu_Hook_Function;
+      pragma Import (C, Menu_Term, "menu_term");
+   begin
+      return Menu_Term (Men);
+   end Get_Menu_Term_Hook;
+-------------------------------------------------------------------------------
+   procedure Redefine (Men   : Menu;
+                       Items : Item_Array_Access)
+   is
+      function Set_Items (Men   : Menu;
+                          Items : System.Address) return C_Int;
+      pragma Import (C, Set_Items, "set_menu_items");
+
+      Res : Eti_Error;
+   begin
+      pragma Assert (Items (Items'Last) = Null_Item);
+      if Items (Items'Last) /= Null_Item then
+         raise Menu_Exception;
+      else
+         Res := Set_Items (Men, Items.all'Address);
+         if  Res /= E_Ok then
+            Eti_Exception (Res);
+         end if;
+      end if;
+   end Redefine;
+
+   function Item_Count (Men : Menu) return Natural
+   is
+      function Count (Men : Menu) return C_Int;
+      pragma Import (C, Count, "item_count");
+   begin
+      return Natural (Count (Men));
+   end Item_Count;
+
+   function Items (Men   : Menu;
+                   Index : Positive) return Item
+   is
+      use I_Array;
+
+      function C_Mitems (Men : Menu) return Pointer;
+      pragma Import (C, C_Mitems, "menu_items");
+
+      P : Pointer := C_Mitems (Men);
+   begin
+      if P = null or else Index > Item_Count (Men) then
+         raise Menu_Exception;
+      else
+         P := P + ptrdiff_t (C_Int (Index) - 1);
+         return P.all;
+      end if;
+   end Items;
+
+-------------------------------------------------------------------------------
+   function Create (Items : Item_Array_Access) return Menu
+   is
+      function Newmenu (Items : System.Address) return Menu;
+      pragma Import (C, Newmenu, "new_menu");
+
+      M   : Menu;
+   begin
+      pragma Assert (Items (Items'Last) = Null_Item);
+      if Items (Items'Last) /= Null_Item then
+         raise Menu_Exception;
+      else
+         M := Newmenu (Items.all'Address);
+         if M = Null_Menu then
+            raise Menu_Exception;
+         end if;
+         return M;
+      end if;
+   end Create;
+
+   procedure Delete (Men : in out Menu)
+   is
+      function Free (Men : Menu) return C_Int;
+      pragma Import (C, Free, "free_menu");
+
+      Res : constant Eti_Error := Free (Men);
+   begin
+      if Res /= E_Ok then
+         Eti_Exception (Res);
+      end if;
+      Men := Null_Menu;
+   end Delete;
+
+------------------------------------------------------------------------------
+   function Driver (Men : Menu;
+                    Key : Key_Code) return Driver_Result
+   is
+      function Driver (Men : Menu;
+                       Key : C_Int) return C_Int;
+      pragma Import (C, Driver, "menu_driver");
+
+      R : constant Eti_Error := Driver (Men, C_Int (Key));
+   begin
+      if R /= E_Ok then
+         case R is
+            when E_Unknown_Command  => return Unknown_Request;
+            when E_No_Match         => return No_Match;
+            when E_Request_Denied |
+                 E_Not_Selectable   => return Request_Denied;
+            when others =>
+               Eti_Exception (R);
+         end case;
+      end if;
+      return Menu_Ok;
+   end Driver;
+
+   procedure Free (IA         : in out Item_Array_Access;
+                   Free_Items : Boolean := False)
+   is
+      procedure Release is new Ada.Unchecked_Deallocation
+        (Item_Array, Item_Array_Access);
+   begin
+      if IA /= null and then Free_Items then
+         for I in IA'First .. (IA'Last - 1) loop
+            if IA (I) /= Null_Item then
+               Delete (IA (I));
+            end if;
+         end loop;
+      end if;
+      Release (IA);
+   end Free;
+
+-------------------------------------------------------------------------------
+   function Default_Menu_Options return Menu_Option_Set
+   is
+   begin
+      return Get_Options (Null_Menu);
+   end Default_Menu_Options;
+
+   function Default_Item_Options return Item_Option_Set
+   is
+   begin
+      return Get_Options (Null_Item);
+   end Default_Item_Options;
+-------------------------------------------------------------------------------
+
+end Terminal_Interface.Curses.Menus;
+
diff --git a/doc/html/ada/terminal_interface-curses-menus__ads.htm b/doc/html/ada/terminal_interface-curses-menus__ads.htm new file mode 100644 index 00000000000..82782336a6e --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-menus__ads.htm @@ -0,0 +1,681 @@ + +terminal_interface-curses-menus.ads + +

File : terminal_interface-curses-menus.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Menu                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2007,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.28 @
+--  @Date: 2009/12/26 18:35:22 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+--  menu binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+with Ada.Characters.Latin_1;
+
+package Terminal_Interface.Curses.Menus is
+   pragma Preelaborate (Terminal_Interface.Curses.Menus);
+   pragma Linker_Options ("-lmenu");
+   pragma Linker_Options ("-lncurses");
+
+   Space : Character renames Ada.Characters.Latin_1.Space;
+
+   type Item is private;
+   type Menu is private;
+
+   ---------------------------
+   --  Interface constants  --
+   ---------------------------
+   Null_Item : constant Item;
+   Null_Menu : constant Menu;
+
+   subtype Menu_Request_Code is Key_Code
+     range (Key_Max + 1) .. (Key_Max + 17);
+
+   --  The prefix M_ stands for "Menu Request"
+   M_Left_Item       : constant Menu_Request_Code := Key_Max + 1;
+   M_Right_Item      : constant Menu_Request_Code := Key_Max + 2;
+   M_Up_Item         : constant Menu_Request_Code := Key_Max + 3;
+   M_Down_Item       : constant Menu_Request_Code := Key_Max + 4;
+   M_ScrollUp_Line   : constant Menu_Request_Code := Key_Max + 5;
+   M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6;
+   M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7;
+   M_ScrollUp_Page   : constant Menu_Request_Code := Key_Max + 8;
+   M_First_Item      : constant Menu_Request_Code := Key_Max + 9;
+   M_Last_Item       : constant Menu_Request_Code := Key_Max + 10;
+   M_Next_Item       : constant Menu_Request_Code := Key_Max + 11;
+   M_Previous_Item   : constant Menu_Request_Code := Key_Max + 12;
+   M_Toggle_Item     : constant Menu_Request_Code := Key_Max + 13;
+   M_Clear_Pattern   : constant Menu_Request_Code := Key_Max + 14;
+   M_Back_Pattern    : constant Menu_Request_Code := Key_Max + 15;
+   M_Next_Match      : constant Menu_Request_Code := Key_Max + 16;
+   M_Previous_Match  : constant Menu_Request_Code := Key_Max + 17;
+
+   --  For those who like the old 'C' names for the request codes
+   REQ_LEFT_ITEM     : Menu_Request_Code renames M_Left_Item;
+   REQ_RIGHT_ITEM    : Menu_Request_Code renames M_Right_Item;
+   REQ_UP_ITEM       : Menu_Request_Code renames M_Up_Item;
+   REQ_DOWN_ITEM     : Menu_Request_Code renames M_Down_Item;
+   REQ_SCR_ULINE     : Menu_Request_Code renames M_ScrollUp_Line;
+   REQ_SCR_DLINE     : Menu_Request_Code renames M_ScrollDown_Line;
+   REQ_SCR_DPAGE     : Menu_Request_Code renames M_ScrollDown_Page;
+   REQ_SCR_UPAGE     : Menu_Request_Code renames M_ScrollUp_Page;
+   REQ_FIRST_ITEM    : Menu_Request_Code renames M_First_Item;
+   REQ_LAST_ITEM     : Menu_Request_Code renames M_Last_Item;
+   REQ_NEXT_ITEM     : Menu_Request_Code renames M_Next_Item;
+   REQ_PREV_ITEM     : Menu_Request_Code renames M_Previous_Item;
+   REQ_TOGGLE_ITEM   : Menu_Request_Code renames M_Toggle_Item;
+   REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern;
+   REQ_BACK_PATTERN  : Menu_Request_Code renames M_Back_Pattern;
+   REQ_NEXT_MATCH    : Menu_Request_Code renames M_Next_Match;
+   REQ_PREV_MATCH    : Menu_Request_Code renames M_Previous_Match;
+
+   procedure Request_Name (Key  : Menu_Request_Code;
+                           Name : out String);
+
+   function  Request_Name (Key : Menu_Request_Code) return String;
+   --  Same as function
+
+   ------------------
+   --  Exceptions  --
+   ------------------
+
+   Menu_Exception : exception;
+   --
+   --  Menu options
+   --
+   pragma Warnings (Off);
+   type Menu_Option_Set is
+      record
+         One_Valued        : Boolean;
+         Show_Descriptions : Boolean;
+         Row_Major_Order   : Boolean;
+         Ignore_Case       : Boolean;
+         Show_Matches      : Boolean;
+         Non_Cyclic        : Boolean;
+      end record;
+   pragma Convention (C, Menu_Option_Set);
+
+   for Menu_Option_Set use
+      record
+         One_Valued        at 0 range  0 ..  0;
+         Show_Descriptions at 0 range  1 ..  1;
+         Row_Major_Order   at 0 range  2 ..  2;
+         Ignore_Case       at 0 range  3 ..  3;
+         Show_Matches      at 0 range  4 ..  4;
+         Non_Cyclic        at 0 range  5 ..  5;
+      end record;
+   for Menu_Option_Set'Size use 32;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.
+   pragma Warnings (On);
+
+   function Default_Menu_Options return Menu_Option_Set;
+   --  Initial default options for a menu.
+   pragma Inline (Default_Menu_Options);
+   --
+   --  Item options
+   --
+   pragma Warnings (Off);
+   type Item_Option_Set is
+      record
+         Selectable  : Boolean;
+      end record;
+   pragma Convention (C, Item_Option_Set);
+
+   for Item_Option_Set use
+      record
+         Selectable  at 0 range  0 ..  0;
+      end record;
+   for Item_Option_Set'Size use 32;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.
+   pragma Warnings (On);
+
+   function Default_Item_Options return Item_Option_Set;
+   --  Initial default options for an item.
+   pragma Inline (Default_Item_Options);
+
+   --
+   --  Item Array
+   --
+   type Item_Array is array (Positive range <>) of aliased Item;
+   pragma Convention (C, Item_Array);
+
+   type Item_Array_Access is access Item_Array;
+
+   procedure Free (IA         : in out Item_Array_Access;
+                   Free_Items : Boolean := False);
+   --  Release the memory for an allocated item array
+   --  If Free_Items is True, call Delete() for all the items in
+   --  the array.
+
+   --  |=====================================================================
+   --  | Man page mitem_new.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   function Create (Name        : String;
+                    Description : String := "") return Item;
+   --  AKA: new_item()
+   --  Not inlined.
+
+   --  #1A NAME="AFU_2"#2|
+   function New_Item (Name        : String;
+                      Description : String := "") return Item
+     renames Create;
+   --  AKA: new_item()
+
+   --  #1A NAME="AFU_3"#2|
+   procedure Delete (Itm : in out Item);
+   --  AKA: free_item()
+   --  Resets Itm to Null_Item
+
+   --  |=====================================================================
+   --  | Man page mitem_value.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_4"#2|
+   procedure Set_Value (Itm   : Item;
+                        Value : Boolean := True);
+   --  AKA: set_item_value()
+   pragma Inline (Set_Value);
+
+   --  #1A NAME="AFU_5"#2|
+   function Value (Itm : Item) return Boolean;
+   --  AKA: item_value()
+   pragma Inline (Value);
+
+   --  |=====================================================================
+   --  | Man page mitem_visible.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_6"#2|
+   function Visible (Itm : Item) return Boolean;
+   --  AKA: item_visible()
+   pragma Inline (Visible);
+
+   --  |=====================================================================
+   --  | Man page mitem_opts.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_7"#2|
+   procedure Set_Options (Itm     : Item;
+                          Options : Item_Option_Set);
+   --  AKA: set_item_opts()
+   --  An overloaded Set_Options is defined later. Pragma Inline appears there
+
+   --  #1A NAME="AFU_8"#2|
+   procedure Switch_Options (Itm     : Item;
+                             Options : Item_Option_Set;
+                             On      : Boolean := True);
+   --  AKA: item_opts_on()
+   --  AKA: item_opts_off()
+   --  An overloaded Switch_Options is defined later.
+   --  Pragma Inline appears there
+
+   --  #1A NAME="AFU_9"#2|
+   procedure Get_Options (Itm     : Item;
+                          Options : out Item_Option_Set);
+   --  AKA: item_opts()
+
+   --  #1A NAME="AFU_10"#2|
+   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
+   --  AKA: item_opts()
+   --  An overloaded Get_Options is defined later. Pragma Inline appears there
+
+   --  |=====================================================================
+   --  | Man page mitem_name.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_11"#2|
+   procedure Name (Itm  : Item;
+                   Name : out String);
+   --  AKA: item_name()
+   function  Name (Itm : Item) return String;
+   --  AKA: item_name()
+   --  Implemented as function
+   pragma Inline (Name);
+
+   --  #1A NAME="AFU_12"#2|
+   procedure Description (Itm         : Item;
+                          Description : out String);
+   --  AKA: item_description();
+
+   function  Description (Itm : Item) return String;
+   --  AKA: item_description();
+   --  Implemented as function
+   pragma Inline (Description);
+
+   --  |=====================================================================
+   --  | Man page mitem_current.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_13"#2|
+   procedure Set_Current (Men : Menu;
+                          Itm : Item);
+   --  AKA: set_current_item()
+   pragma Inline (Set_Current);
+
+   --  #1A NAME="AFU_14"#2|
+   function Current (Men : Menu) return Item;
+   --  AKA: current_item()
+   pragma Inline (Current);
+
+   --  #1A NAME="AFU_15"#2|
+   procedure Set_Top_Row (Men  : Menu;
+                          Line : Line_Position);
+   --  AKA: set_top_row()
+   pragma Inline (Set_Top_Row);
+
+   --  #1A NAME="AFU_16"#2|
+   function Top_Row (Men : Menu) return Line_Position;
+   --  AKA: top_row()
+   pragma Inline (Top_Row);
+
+   --  #1A NAME="AFU_17"#2|
+   function Get_Index (Itm : Item) return Positive;
+   --  AKA: item_index()
+   --  Please note that in this binding we start the numbering of items
+   --  with 1. So this is number is one more than you get from the low
+   --  level call.
+   pragma Inline (Get_Index);
+
+   --  |=====================================================================
+   --  | Man page menu_post.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_18"#2|
+   procedure Post (Men  : Menu;
+                   Post : Boolean := True);
+   --  AKA: post_menu()
+   --  AKA: unpost_menu()
+   pragma Inline (Post);
+
+   --  |=====================================================================
+   --  | Man page menu_opts.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_19"#2|
+   procedure Set_Options (Men     : Menu;
+                          Options : Menu_Option_Set);
+   --  AKA: set_menu_opts()
+   pragma Inline (Set_Options);
+
+   --  #1A NAME="AFU_20"#2|
+   procedure Switch_Options (Men     : Menu;
+                             Options : Menu_Option_Set;
+                             On      : Boolean := True);
+   --  AKA: menu_opts_on()
+   --  AKA: menu_opts_off()
+   pragma Inline (Switch_Options);
+
+   --  #1A NAME="AFU_21"#2|
+   procedure Get_Options (Men     : Menu;
+                          Options : out Menu_Option_Set);
+   --  AKA: menu_opts()
+
+   --  #1A NAME="AFU_22"#2|
+   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
+   --  AKA: menu_opts()
+   pragma Inline (Get_Options);
+
+   --  |=====================================================================
+   --  | Man page menu_win.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_23"#2|
+   procedure Set_Window (Men : Menu;
+                         Win : Window);
+   --  AKA: set_menu_win()
+   pragma Inline (Set_Window);
+
+   --  #1A NAME="AFU_24"#2|
+   function Get_Window (Men : Menu) return Window;
+   --  AKA: menu_win()
+   pragma Inline (Get_Window);
+
+   --  #1A NAME="AFU_25"#2|
+   procedure Set_Sub_Window (Men : Menu;
+                             Win : Window);
+   --  AKA: set_menu_sub()
+   pragma Inline (Set_Sub_Window);
+
+   --  #1A NAME="AFU_26"#2|
+   function Get_Sub_Window (Men : Menu) return Window;
+   --  AKA: menu_sub()
+   pragma Inline (Get_Sub_Window);
+
+   --  #1A NAME="AFU_27"#2|
+   procedure Scale (Men     : Menu;
+                    Lines   : out Line_Count;
+                    Columns : out Column_Count);
+   --  AKA: scale_menu()
+   pragma Inline (Scale);
+
+   --  |=====================================================================
+   --  | Man page menu_cursor.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_28"#2|
+   procedure Position_Cursor (Men : Menu);
+   --  AKA: pos_menu_cursor()
+   pragma Inline (Position_Cursor);
+
+   --  |=====================================================================
+   --  | Man page menu_mark.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_29"#2|
+   procedure Set_Mark (Men  : Menu;
+                       Mark : String);
+   --  AKA: set_menu_mark()
+   pragma Inline (Set_Mark);
+
+   --  #1A NAME="AFU_30"#2|
+   procedure Mark (Men  : Menu;
+                   Mark : out String);
+   --  AKA: menu_mark()
+
+   function  Mark (Men : Menu) return String;
+   --  AKA: menu_mark()
+   --  Implemented as function
+   pragma Inline (Mark);
+
+   --  |=====================================================================
+   --  | Man page menu_attributes.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_31"#2|
+   procedure Set_Foreground
+     (Men   : Menu;
+      Fore  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: set_menu_fore()
+   pragma Inline (Set_Foreground);
+
+   --  #1A NAME="AFU_32"#2|
+   procedure Foreground (Men   : Menu;
+                         Fore  : out Character_Attribute_Set);
+   --  AKA: menu_fore()
+
+   --  #1A NAME="AFU_33"#2|
+   procedure Foreground (Men   : Menu;
+                         Fore  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+   --  AKA: menu_fore()
+   pragma Inline (Foreground);
+
+   --  #1A NAME="AFU_34"#2|
+   procedure Set_Background
+     (Men   : Menu;
+      Back  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: set_menu_back()
+   pragma Inline (Set_Background);
+
+   --  #1A NAME="AFU_35"#2|
+   procedure Background (Men  : Menu;
+                         Back : out Character_Attribute_Set);
+   --  AKA: menu_back()
+   --  #1A NAME="AFU_36"#2|
+
+   procedure Background (Men   : Menu;
+                         Back  : out Character_Attribute_Set;
+                         Color : out Color_Pair);
+   --  AKA: menu_back()
+   pragma Inline (Background);
+
+   --  #1A NAME="AFU_37"#2|
+   procedure Set_Grey
+     (Men   : Menu;
+      Grey  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: set_menu_grey()
+   pragma Inline (Set_Grey);
+
+   --  #1A NAME="AFU_38"#2|
+   procedure Grey (Men  : Menu;
+                   Grey : out Character_Attribute_Set);
+   --  AKA: menu_grey()
+
+   --  #1A NAME="AFU_39"#2|
+   procedure Grey
+     (Men   : Menu;
+      Grey  : out Character_Attribute_Set;
+      Color : out Color_Pair);
+   --  AKA: menu_grey()
+   pragma Inline (Grey);
+
+   --  #1A NAME="AFU_40"#2|
+   procedure Set_Pad_Character (Men : Menu;
+                                Pad : Character := Space);
+   --  AKA: set_menu_pad()
+   pragma Inline (Set_Pad_Character);
+
+   --  #1A NAME="AFU_41"#2|
+   procedure Pad_Character (Men : Menu;
+                            Pad : out Character);
+   --  AKA: menu_pad()
+   pragma Inline (Pad_Character);
+
+   --  |=====================================================================
+   --  | Man page menu_spacing.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_42"#2|
+   procedure Set_Spacing (Men   : Menu;
+                          Descr : Column_Position := 0;
+                          Row   : Line_Position   := 0;
+                          Col   : Column_Position := 0);
+   --  AKA: set_menu_spacing()
+   pragma Inline (Set_Spacing);
+
+   --  #1A NAME="AFU_43"#2|
+   procedure Spacing (Men   : Menu;
+                      Descr : out Column_Position;
+                      Row   : out Line_Position;
+                      Col   : out Column_Position);
+   --  AKA: menu_spacing()
+   pragma Inline (Spacing);
+
+   --  |=====================================================================
+   --  | Man page menu_pattern.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_44"#2|
+   function Set_Pattern (Men  : Menu;
+                         Text : String) return Boolean;
+   --  AKA: set_menu_pattern()
+   --  Return TRUE if the pattern matches, FALSE otherwise
+   pragma Inline (Set_Pattern);
+
+   --  #1A NAME="AFU_45"#2|
+   procedure Pattern (Men  : Menu;
+                      Text : out String);
+   --  AKA: menu_pattern()
+   pragma Inline (Pattern);
+
+   --  |=====================================================================
+   --  | Man page menu_format.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_46"#2|
+   procedure Set_Format (Men     : Menu;
+                         Lines   : Line_Count;
+                         Columns : Column_Count);
+   --  Not implemented: 0 argument for Lines or Columns;
+   --  instead use Format to get the current sizes
+   --      The  default  format  is  16  rows,  1  column.    Calling
+   --      set_menu_format  with a null menu pointer will change this
+   --      default.  A zero row or column argument to set_menu_format
+   --      is  interpreted  as  a  request  not to change the current
+   --      value.
+   --  AKA: set_menu_format()
+   pragma Inline (Set_Format);
+
+   --  #1A NAME="AFU_47"#2|
+   procedure Format (Men     : Menu;
+                     Lines   : out Line_Count;
+                     Columns : out Column_Count);
+   --  AKA: menu_format()
+   pragma Inline (Format);
+
+   --  |=====================================================================
+   --  | Man page menu_hook.3x
+   --  |=====================================================================
+
+   type Menu_Hook_Function is access procedure (Men : Menu);
+   pragma Convention (C, Menu_Hook_Function);
+
+   --  #1A NAME="AFU_48"#2|
+   procedure Set_Item_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
+   --  AKA: set_item_init()
+   pragma Inline (Set_Item_Init_Hook);
+
+   --  #1A NAME="AFU_49"#2|
+   procedure Set_Item_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
+   --  AKA: set_item_term()
+   pragma Inline (Set_Item_Term_Hook);
+
+   --  #1A NAME="AFU_50"#2|
+   procedure Set_Menu_Init_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
+   --  AKA: set_menu_init()
+   pragma Inline (Set_Menu_Init_Hook);
+
+   --  #1A NAME="AFU_51"#2|
+   procedure Set_Menu_Term_Hook (Men  : Menu;
+                                 Proc : Menu_Hook_Function);
+   --  AKA: set_menu_term()
+   pragma Inline (Set_Menu_Term_Hook);
+
+   --  #1A NAME="AFU_52"#2|
+   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
+   --  AKA: item_init()
+   pragma Inline (Get_Item_Init_Hook);
+
+   --  #1A NAME="AFU_53"#2|
+   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
+   --  AKA: item_term()
+   pragma Inline (Get_Item_Term_Hook);
+
+   --  #1A NAME="AFU_54"#2|
+   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
+   --  AKA: menu_init()
+   pragma Inline (Get_Menu_Init_Hook);
+
+   --  #1A NAME="AFU_55"#2|
+   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
+   --  AKA: menu_term()
+   pragma Inline (Get_Menu_Term_Hook);
+
+   --  |=====================================================================
+   --  | Man page menu_items.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_56"#2|
+   procedure Redefine (Men   : Menu;
+                       Items : Item_Array_Access);
+   --  AKA: set_menu_items()
+   pragma Inline (Redefine);
+
+   procedure Set_Items (Men   : Menu;
+                        Items : Item_Array_Access) renames Redefine;
+   --  pragma Inline (Set_Items);
+
+   --  #1A NAME="AFU_57"#2|
+   function Items (Men   : Menu;
+                   Index : Positive) return Item;
+   --  AKA: menu_items()
+   pragma Inline (Items);
+
+   --  #1A NAME="AFU_58"#2|
+   function Item_Count (Men : Menu) return Natural;
+   --  AKA: item_count()
+   pragma Inline (Item_Count);
+
+   --  |=====================================================================
+   --  | Man page menu_new.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_59"#2|
+   function Create (Items : Item_Array_Access) return Menu;
+   --  AKA: new_menu()
+   --  Not inlined
+
+   function New_Menu (Items : Item_Array_Access) return Menu renames Create;
+
+   --  #1A NAME="AFU_60"#2|
+   procedure Delete (Men : in out Menu);
+   --  AKA: free_menu()
+   --  Reset Men to Null_Menu
+   --  Not inlined
+
+   --  |=====================================================================
+   --  | Man page menu_driver.3x
+   --  |=====================================================================
+
+   type Driver_Result is (Menu_Ok,
+                          Request_Denied,
+                          Unknown_Request,
+                          No_Match);
+
+   --  #1A NAME="AFU_61"#2|
+   function Driver (Men : Menu;
+                    Key : Key_Code) return Driver_Result;
+   --  AKA: menu_driver()
+   --  Driver is not inlined
+
+   --  #1A NAME="AFU_62"#2|
+   --  Not Implemented: menu_request_name, menu_request_by_name
+-------------------------------------------------------------------------------
+private
+   type Item   is new System.Storage_Elements.Integer_Address;
+   type Menu   is new System.Storage_Elements.Integer_Address;
+
+   Null_Item : constant Item := 0;
+   Null_Menu : constant Menu := 0;
+
+end Terminal_Interface.Curses.Menus;
+
diff --git a/doc/html/ada/terminal_interface-curses-mouse__adb.htm b/doc/html/ada/terminal_interface-curses-mouse__adb.htm new file mode 100644 index 00000000000..453572020d6 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-mouse__adb.htm @@ -0,0 +1,223 @@ + +terminal_interface-curses-mouse.adb + +

File : terminal_interface-curses-mouse.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                     Terminal_Interface.Curses.Mouse                      --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.24 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+with Interfaces.C; use Interfaces.C;
+use Interfaces;
+
+package body Terminal_Interface.Curses.Mouse is
+
+   use type System.Bit_Order;
+
+   function Has_Mouse return Boolean
+   is
+      function Mouse_Avail return C_Int;
+      pragma Import (C, Mouse_Avail, "has_mouse");
+   begin
+      if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
+         return True;
+      else
+         return False;
+      end if;
+   end Has_Mouse;
+
+   function Get_Mouse return Mouse_Event
+   is
+      type Event_Access is access all Mouse_Event;
+
+      function Getmouse (Ev : Event_Access) return C_Int;
+      pragma Import (C, Getmouse, "getmouse");
+
+      Event : aliased Mouse_Event;
+   begin
+      if Getmouse (Event'Access) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+      return Event;
+   end Get_Mouse;
+
+   procedure Register_Reportable_Event (Button : Mouse_Button;
+                                        State  : Button_State;
+                                        Mask   : in out Event_Mask)
+   is
+      Button_Nr : constant Natural := Mouse_Button'Pos (Button);
+      State_Nr  : constant Natural := Button_State'Pos (State);
+   begin
+      if Button in Modifier_Keys and then State /= Pressed then
+         raise Curses_Exception;
+      else
+         if Button in Real_Buttons then
+            Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr);
+         else
+            Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4));
+         end if;
+      end if;
+   end Register_Reportable_Event;
+
+   procedure Register_Reportable_Events (Button : Mouse_Button;
+                                         State  : Button_States;
+                                         Mask   : in out Event_Mask)
+   is
+   begin
+      for S in Button_States'Range loop
+         if State (S) then
+            Register_Reportable_Event (Button, S, Mask);
+         end if;
+      end loop;
+   end Register_Reportable_Events;
+
+   function Start_Mouse (Mask : Event_Mask := All_Events)
+                         return Event_Mask
+   is
+      function MMask (M : Event_Mask;
+                      O : access Event_Mask) return Event_Mask;
+      pragma Import (C, MMask, "mousemask");
+      R   : Event_Mask;
+      Old : aliased Event_Mask;
+   begin
+      R := MMask (Mask, Old'Access);
+      if R = No_Events then
+         Beep;
+      end if;
+      return Old;
+   end Start_Mouse;
+
+   procedure End_Mouse (Mask : Event_Mask := No_Events)
+   is
+   begin
+      if Mask /= No_Events then
+         Beep;
+      end if;
+   end End_Mouse;
+
+   procedure Dispatch_Event (Mask   : Event_Mask;
+                             Button : out Mouse_Button;
+                             State  : out Button_State);
+
+   procedure Dispatch_Event (Mask   : Event_Mask;
+                             Button : out Mouse_Button;
+                             State  : out Button_State) is
+      L : Event_Mask;
+   begin
+      Button := Alt;  --  preset to non real button;
+      if (Mask and BUTTON1_EVENTS) /= 0 then
+         Button := Left;
+      elsif (Mask and BUTTON2_EVENTS) /= 0 then
+         Button := Middle;
+      elsif (Mask and BUTTON3_EVENTS) /= 0 then
+         Button := Right;
+      elsif (Mask and BUTTON4_EVENTS) /= 0 then
+         Button := Button4;
+      end if;
+      if Button in Real_Buttons then
+         L := 2 ** (6 * Mouse_Button'Pos (Button));
+         for I in Button_State'Range loop
+            if (Mask and L) /= 0 then
+               State := I;
+               exit;
+            end if;
+            L := 2 * L;
+         end loop;
+      else
+         State := Pressed;
+         if (Mask and BUTTON_CTRL) /= 0 then
+            Button := Control;
+         elsif (Mask and BUTTON_SHIFT) /= 0 then
+            Button := Shift;
+         elsif (Mask and BUTTON_ALT) /= 0 then
+            Button := Alt;
+         end if;
+      end if;
+   end Dispatch_Event;
+
+   procedure Get_Event (Event  : Mouse_Event;
+                        Y      : out Line_Position;
+                        X      : out Column_Position;
+                        Button : out Mouse_Button;
+                        State  : out Button_State)
+   is
+      Mask  : constant Event_Mask := Event.Bstate;
+   begin
+      X := Column_Position (Event.X);
+      Y := Line_Position   (Event.Y);
+      Dispatch_Event (Mask, Button, State);
+   end Get_Event;
+
+   procedure Unget_Mouse (Event : Mouse_Event)
+   is
+      function Ungetmouse (Ev : Mouse_Event) return C_Int;
+      pragma Import (C, Ungetmouse, "ungetmouse");
+   begin
+      if Ungetmouse (Event) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Unget_Mouse;
+
+   function Enclosed_In_Window (Win    : Window := Standard_Window;
+                                Event  : Mouse_Event) return Boolean
+   is
+      function Wenclose (Win : Window; Y : C_Int; X : C_Int)
+                         return Curses_Bool;
+      pragma Import (C, Wenclose, "wenclose");
+   begin
+      if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X))
+        = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Enclosed_In_Window;
+
+   function Mouse_Interval (Msec : Natural := 200) return Natural
+   is
+      function Mouseinterval (Msec : C_Int) return C_Int;
+      pragma Import (C, Mouseinterval, "mouseinterval");
+   begin
+      return Natural (Mouseinterval (C_Int (Msec)));
+   end Mouse_Interval;
+
+end Terminal_Interface.Curses.Mouse;
+
diff --git a/doc/html/ada/terminal_interface-curses-mouse__ads.htm b/doc/html/ada/terminal_interface-curses-mouse__ads.htm new file mode 100644 index 00000000000..d77ff4c509f --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-mouse__ads.htm @@ -0,0 +1,235 @@ + +terminal_interface-curses-mouse.ads + +

File : terminal_interface-curses-mouse.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Mouse                     --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.28 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+--  mouse binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+
+package Terminal_Interface.Curses.Mouse is
+   pragma Preelaborate (Terminal_Interface.Curses.Mouse);
+
+   --  |=====================================================================
+   --  | Man page curs_mouse.3x
+   --  |=====================================================================
+   --  Please note, that in ncurses-1.9.9e documentation mouse support
+   --  is still marked as experimental. So also this binding will change
+   --  if the ncurses methods change.
+   --
+   --  mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates
+   --  in the parent package.
+   --
+   --  Not implemented:
+   --  REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event
+   --  or Start_Mouse)
+   type Event_Mask is private;
+   No_Events  : constant Event_Mask;
+   All_Events : constant Event_Mask;
+
+   type Mouse_Button is (Left,     -- aka: Button 1
+                         Middle,   -- aka: Button 2
+                         Right,    -- aka: Button 3
+                         Button4,  -- aka: Button 4
+                         Control,  -- Control Key
+                         Shift,    -- Shift Key
+                         Alt);     -- ALT Key
+
+   subtype Real_Buttons  is Mouse_Button range Left .. Button4;
+   subtype Modifier_Keys is Mouse_Button range Control .. Alt;
+
+   type Button_State is (Released,
+                         Pressed,
+                         Clicked,
+                         Double_Clicked,
+                         Triple_Clicked);
+
+   type Button_States is array (Button_State) of Boolean;
+   pragma Pack (Button_States);
+
+   All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True,
+                                           others => False);
+   All_States : constant Button_States := (others => True);
+
+   type Mouse_Event is private;
+
+   --  |=====================================================================
+   --  | Man page curs_mouse.3x
+   --  |=====================================================================
+
+   function Has_Mouse return Boolean;
+   --  Return true if a mouse device is supported, false otherwise.
+
+   procedure Register_Reportable_Event
+     (Button : Mouse_Button;
+      State  : Button_State;
+      Mask   : in out Event_Mask);
+   --  Stores the event described by the button and the state in the mask.
+   --  Before you call this the first time, you should init the mask
+   --  with the Empty_Mask constant
+   pragma Inline (Register_Reportable_Event);
+
+   procedure Register_Reportable_Events
+     (Button : Mouse_Button;
+      State  : Button_States;
+      Mask   : in out Event_Mask);
+   --  Register all events described by the Button and the State bitmap.
+   --  Before you call this the first time, you should init the mask
+   --  with the Empty_Mask constant
+
+   --  #1A NAME="AFU_1"#2|
+   --  There is one difference to mousmask(): we return the value of the
+   --  old mask, that means the event mask value before this call.
+   --  Not Implemented: The library version
+   --  returns a Mouse_Mask that tells which events are reported.
+   function Start_Mouse (Mask : Event_Mask := All_Events)
+                         return Event_Mask;
+   --  AKA: mousemask()
+   pragma Inline (Start_Mouse);
+
+   procedure End_Mouse (Mask : Event_Mask := No_Events);
+   --  Terminates the mouse, restores the specified event mask
+   pragma Inline (End_Mouse);
+
+   --  #1A NAME="AFU_2"#2|
+   function Get_Mouse return Mouse_Event;
+   --  AKA: getmouse()
+   pragma Inline (Get_Mouse);
+
+   procedure Get_Event (Event  : Mouse_Event;
+                        Y      : out Line_Position;
+                        X      : out Column_Position;
+                        Button : out Mouse_Button;
+                        State  : out Button_State);
+   --  !!! Warning: X and Y are screen coordinates. Due to ripped of lines they
+   --  may not be identical to window coordinates.
+   --  Not Implemented: Get_Event only reports one event, the C library
+   --  version supports multiple events, e.g. {click-1, click-3}
+   pragma Inline (Get_Event);
+
+   --  #1A NAME="AFU_3"#2|
+   procedure Unget_Mouse (Event : Mouse_Event);
+   --  AKA: ungetmouse()
+   pragma Inline (Unget_Mouse);
+
+   --  #1A NAME="AFU_4"#2|
+   function Enclosed_In_Window (Win    : Window := Standard_Window;
+                                Event  : Mouse_Event) return Boolean;
+   --  AKA: wenclose()
+   --  But : use event instead of screen coordinates.
+   pragma Inline (Enclosed_In_Window);
+
+   --  #1A NAME="AFU_5"#2|
+   function Mouse_Interval (Msec : Natural := 200) return Natural;
+   --  AKA: mouseinterval()
+   pragma Inline (Mouse_Interval);
+
+private
+   type Event_Mask is new Interfaces.C.unsigned_long;
+
+   type Mouse_Event is
+      record
+         Id      : Integer range Integer (Interfaces.C.short'First) ..
+                                 Integer (Interfaces.C.short'Last);
+         X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
+                                 Integer (Interfaces.C.int'Last);
+         Bstate  : Event_Mask;
+      end record;
+   pragma Convention (C, Mouse_Event);
+
+   for Mouse_Event use
+      record
+         Id      at 0 range   0 ..  15;
+         X       at 0 range  32 ..  63;
+         Y       at 0 range  64 ..  95;
+         Z       at 0 range  96 .. 127;
+         Bstate  at 0 range 128 .. 159;
+      end record;
+      --  Please note: this rep. clause is generated and may be
+      --               different on your system.
+
+   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
+   --  This constant may be different on your system.
+
+   BUTTON1_RELEASED          : constant Event_Mask := 8#00000000001#;
+   BUTTON1_PRESSED           : constant Event_Mask := 8#00000000002#;
+   BUTTON1_CLICKED           : constant Event_Mask := 8#00000000004#;
+   BUTTON1_DOUBLE_CLICKED    : constant Event_Mask := 8#00000000010#;
+   BUTTON1_TRIPLE_CLICKED    : constant Event_Mask := 8#00000000020#;
+   BUTTON1_RESERVED_EVENT    : constant Event_Mask := 8#00000000040#;
+   BUTTON2_RELEASED          : constant Event_Mask := 8#00000000100#;
+   BUTTON2_PRESSED           : constant Event_Mask := 8#00000000200#;
+   BUTTON2_CLICKED           : constant Event_Mask := 8#00000000400#;
+   BUTTON2_DOUBLE_CLICKED    : constant Event_Mask := 8#00000001000#;
+   BUTTON2_TRIPLE_CLICKED    : constant Event_Mask := 8#00000002000#;
+   BUTTON2_RESERVED_EVENT    : constant Event_Mask := 8#00000004000#;
+   BUTTON3_RELEASED          : constant Event_Mask := 8#00000010000#;
+   BUTTON3_PRESSED           : constant Event_Mask := 8#00000020000#;
+   BUTTON3_CLICKED           : constant Event_Mask := 8#00000040000#;
+   BUTTON3_DOUBLE_CLICKED    : constant Event_Mask := 8#00000100000#;
+   BUTTON3_TRIPLE_CLICKED    : constant Event_Mask := 8#00000200000#;
+   BUTTON3_RESERVED_EVENT    : constant Event_Mask := 8#00000400000#;
+   BUTTON4_RELEASED          : constant Event_Mask := 8#00001000000#;
+   BUTTON4_PRESSED           : constant Event_Mask := 8#00002000000#;
+   BUTTON4_CLICKED           : constant Event_Mask := 8#00004000000#;
+   BUTTON4_DOUBLE_CLICKED    : constant Event_Mask := 8#00010000000#;
+   BUTTON4_TRIPLE_CLICKED    : constant Event_Mask := 8#00020000000#;
+   BUTTON4_RESERVED_EVENT    : constant Event_Mask := 8#00040000000#;
+   BUTTON_CTRL               : constant Event_Mask := 8#00100000000#;
+   BUTTON_SHIFT              : constant Event_Mask := 8#00200000000#;
+   BUTTON_ALT                : constant Event_Mask := 8#00400000000#;
+   REPORT_MOUSE_POSITION     : constant Event_Mask := 8#01000000000#;
+   ALL_MOUSE_EVENTS          : constant Event_Mask := 8#00777777777#;
+   BUTTON1_EVENTS            : constant Event_Mask := 8#00000000077#;
+   BUTTON2_EVENTS            : constant Event_Mask := 8#00000007700#;
+   BUTTON3_EVENTS            : constant Event_Mask := 8#00000770000#;
+   BUTTON4_EVENTS            : constant Event_Mask := 8#00077000000#;
+
+   No_Events  : constant Event_Mask := 0;
+   All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
+
+end Terminal_Interface.Curses.Mouse;
+
diff --git a/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm b/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm new file mode 100644 index 00000000000..60ef8092adb --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm @@ -0,0 +1,84 @@ + +terminal_interface-curses-panels-user_data.adb + +

File : terminal_interface-curses-panels-user_data.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Panels.User_Data               --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C;
+with Terminal_Interface.Curses.Aux;
+use  Terminal_Interface.Curses.Aux;
+with Terminal_Interface.Curses.Panels;
+use  Terminal_Interface.Curses.Panels;
+
+package body Terminal_Interface.Curses.Panels.User_Data is
+
+   use type Interfaces.C.int;
+
+   procedure Set_User_Data (Pan  : Panel;
+                            Data : User_Access)
+   is
+      function Set_Panel_Userptr (Pan  : Panel;
+                                  Addr : User_Access) return C_Int;
+      pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
+   begin
+      if Set_Panel_Userptr (Pan, Data) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Set_User_Data;
+
+   function Get_User_Data (Pan  : Panel) return User_Access
+   is
+      function Panel_Userptr (Pan : Panel) return User_Access;
+      pragma Import (C, Panel_Userptr, "panel_userptr");
+   begin
+      return Panel_Userptr (Pan);
+   end Get_User_Data;
+
+   procedure Get_User_Data (Pan  : Panel;
+                            Data : out User_Access)
+   is
+   begin
+      Data := Get_User_Data (Pan);
+   end Get_User_Data;
+
+end Terminal_Interface.Curses.Panels.User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm b/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm new file mode 100644 index 00000000000..0fd9c5b376f --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm @@ -0,0 +1,75 @@ + +terminal_interface-curses-panels-user_data.ads + +

File : terminal_interface-curses-panels-user_data.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Panels.User_Data               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.15 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access all User;
+package Terminal_Interface.Curses.Panels.User_Data is
+   pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data);
+
+   --  |=====================================================================
+   --  | Man page panel.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Set_User_Data (Pan  : Panel;
+                            Data : User_Access);
+   --  AKA: set_panel_userptr
+   pragma Inline (Set_User_Data);
+
+   --  #1A NAME="AFU_2"#2|
+   procedure Get_User_Data (Pan  : Panel;
+                            Data : out User_Access);
+   --  AKA: panel_userptr
+
+   --  #1A NAME="AFU_3"#2|
+   function Get_User_Data (Pan  : Panel) return User_Access;
+   --  AKA: panel_userptr
+   --  Same as function
+   pragma Inline (Get_User_Data);
+
+end Terminal_Interface.Curses.Panels.User_Data;
+
diff --git a/doc/html/ada/terminal_interface-curses-panels__adb.htm b/doc/html/ada/terminal_interface-curses-panels__adb.htm new file mode 100644 index 00000000000..a7cb4d03da2 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-panels__adb.htm @@ -0,0 +1,171 @@ + +terminal_interface-curses-panels.adb + +

File : terminal_interface-curses-panels.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Panels                    --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2004,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.14 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+with Interfaces.C;
+
+package body Terminal_Interface.Curses.Panels is
+
+   use type Interfaces.C.int;
+
+   function Create (Win : Window) return Panel
+   is
+      function Newpanel (Win : Window) return Panel;
+      pragma Import (C, Newpanel, "new_panel");
+
+      Pan : Panel;
+   begin
+      Pan := Newpanel (Win);
+      if Pan = Null_Panel then
+         raise Panel_Exception;
+      end if;
+      return Pan;
+   end Create;
+
+   procedure Bottom (Pan : Panel)
+   is
+      function Bottompanel (Pan : Panel) return C_Int;
+      pragma Import (C, Bottompanel, "bottom_panel");
+   begin
+      if Bottompanel (Pan) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Bottom;
+
+   procedure Top (Pan : Panel)
+   is
+      function Toppanel (Pan : Panel) return C_Int;
+      pragma Import (C, Toppanel, "top_panel");
+   begin
+      if Toppanel (Pan) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Top;
+
+   procedure Show (Pan : Panel)
+   is
+      function Showpanel (Pan : Panel) return C_Int;
+      pragma Import (C, Showpanel, "show_panel");
+   begin
+      if Showpanel (Pan) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Show;
+
+   procedure Hide (Pan : Panel)
+   is
+      function Hidepanel (Pan : Panel) return C_Int;
+      pragma Import (C, Hidepanel, "hide_panel");
+   begin
+      if Hidepanel (Pan) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Hide;
+
+   function Get_Window (Pan : Panel) return Window
+   is
+      function Panel_Win (Pan : Panel) return Window;
+      pragma Import (C, Panel_Win, "panel_window");
+
+      Win : constant Window := Panel_Win (Pan);
+   begin
+      if Win = Null_Window then
+         raise Panel_Exception;
+      end if;
+      return Win;
+   end Get_Window;
+
+   procedure Replace (Pan : Panel;
+                      Win : Window)
+   is
+      function Replace_Pan (Pan : Panel;
+                            Win : Window) return C_Int;
+      pragma Import (C, Replace_Pan, "replace_panel");
+   begin
+      if Replace_Pan (Pan, Win) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Replace;
+
+   procedure Move (Pan    : Panel;
+                   Line   : Line_Position;
+                   Column : Column_Position)
+   is
+      function Move (Pan    : Panel;
+                     Line   : C_Int;
+                     Column : C_Int) return C_Int;
+      pragma Import (C, Move, "move_panel");
+   begin
+      if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+   end Move;
+
+   function Is_Hidden (Pan : Panel) return Boolean
+   is
+      function Panel_Hidden (Pan : Panel) return C_Int;
+      pragma Import (C, Panel_Hidden, "panel_hidden");
+   begin
+      if Panel_Hidden (Pan) = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Is_Hidden;
+
+   procedure Delete (Pan : in out Panel)
+   is
+      function Del_Panel (Pan : Panel) return C_Int;
+      pragma Import (C, Del_Panel, "del_panel");
+   begin
+      if Del_Panel (Pan) = Curses_Err then
+         raise Panel_Exception;
+      end if;
+      Pan := Null_Panel;
+   end Delete;
+
+end Terminal_Interface.Curses.Panels;
+
diff --git a/doc/html/ada/terminal_interface-curses-panels__ads.htm b/doc/html/ada/terminal_interface-curses-panels__ads.htm new file mode 100644 index 00000000000..5f140196e8f --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-panels__ads.htm @@ -0,0 +1,153 @@ + +terminal_interface-curses-panels.ads + +

File : terminal_interface-curses-panels.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Panels                    --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.20 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with System;
+
+package Terminal_Interface.Curses.Panels is
+   pragma Preelaborate (Terminal_Interface.Curses.Panels);
+   pragma Linker_Options ("-lpanel");
+   pragma Linker_Options ("-lncurses");
+
+   type Panel is private;
+
+   ---------------------------
+   --  Interface constants  --
+   ---------------------------
+   Null_Panel : constant Panel;
+
+   -------------------
+   --  Exceptions   --
+   -------------------
+
+   Panel_Exception : exception;
+
+   --  |=====================================================================
+   --  | Man page panel.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   function Create (Win : Window) return Panel;
+   --  AKA: new_panel()
+   pragma Inline (Create);
+
+   --  #1A NAME="AFU_2"#2|
+   function New_Panel (Win : Window) return Panel renames Create;
+   --  AKA: new_panel()
+   --  pragma Inline (New_Panel);
+
+   --  #1A NAME="AFU_3"#2|
+   procedure Bottom (Pan : Panel);
+   --  AKA: bottom_panel()
+   pragma Inline (Bottom);
+
+   --  #1A NAME="AFU_4"#2|
+   procedure Top (Pan : Panel);
+   --  AKA: top_panel()
+   pragma Inline (Top);
+
+   --  #1A NAME="AFU_5"#2|
+   procedure Show (Pan : Panel);
+   --  AKA: show_panel()
+   pragma Inline (Show);
+
+   --  #1A NAME="AFU_6"#2|
+   procedure Update_Panels;
+   --  AKA: update_panels()
+   pragma Import (C, Update_Panels, "update_panels");
+
+   --  #1A NAME="AFU_7"#2|
+   procedure Hide (Pan : Panel);
+   --  AKA: hide_panel()
+   pragma Inline (Hide);
+
+   --  #1A NAME="AFU_8"#2|
+   function Get_Window (Pan : Panel) return Window;
+   --  AKA: panel_window()
+   pragma Inline (Get_Window);
+
+   --  #1A NAME="AFU_9"#2|
+   function Panel_Window (Pan : Panel) return Window renames Get_Window;
+   --  pragma Inline (Panel_Window);
+
+   --  #1A NAME="AFU_10"#2|
+   procedure Replace (Pan : Panel;
+                      Win : Window);
+   --  AKA: replace_panel()
+   pragma Inline (Replace);
+
+   --  #1A NAME="AFU_11"#2|
+   procedure Move (Pan    : Panel;
+                   Line   : Line_Position;
+                   Column : Column_Position);
+   --  AKA: move_panel()
+   pragma Inline (Move);
+
+   --  #1A NAME="AFU_12"#2|
+   function Is_Hidden (Pan : Panel) return Boolean;
+   --  AKA: panel_hidden()
+   pragma Inline (Is_Hidden);
+
+   --  #1A NAME="AFU_13"#2|
+   function Above (Pan : Panel) return Panel;
+   --  AKA: panel_above()
+   pragma Import (C, Above, "panel_above");
+
+   --  #1A NAME="AFU_14"#2|
+   function Below (Pan : Panel) return Panel;
+   --  AKA: panel_below()
+   pragma Import (C, Below, "panel_below");
+
+   --  #1A NAME="AFU_15"#2|
+   procedure Delete (Pan : in out Panel);
+   --  AKA: del_panel()
+   pragma Inline (Delete);
+
+private
+      type Panel is new System.Storage_Elements.Integer_Address;
+      Null_Panel : constant Panel := 0;
+
+end Terminal_Interface.Curses.Panels;
+
diff --git a/doc/html/ada/terminal_interface-curses-putwin__adb.htm b/doc/html/ada/terminal_interface-curses-putwin__adb.htm new file mode 100644 index 00000000000..8f1f98704ca --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-putwin__adb.htm @@ -0,0 +1,83 @@ + +terminal_interface-curses-putwin.adb + +

File : terminal_interface-curses-putwin.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                    Terminal_Interface.Curses.PutWin                      --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), 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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.3 @
+--  Binding Version 01.00
+
+with Ada.Streams.Stream_IO.C_Streams;
+with Interfaces.C_Streams;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+
+package body Terminal_Interface.Curses.PutWin is
+
+   package ICS renames Interfaces.C_Streams;
+   package ACS renames Ada.Streams.Stream_IO.C_Streams;
+   use type C_Int;
+
+   procedure Put_Window (Win  : Window;
+                         File : Ada.Streams.Stream_IO.File_Type) is
+      function putwin (Win : Window; f : ICS.FILEs) return C_Int;
+      pragma Import (C, putwin, "putwin");
+
+      R : constant C_Int := putwin (Win, ACS.C_Stream (File));
+   begin
+      if R /= Curses_Ok then
+         raise Curses_Exception;
+      end if;
+   end Put_Window;
+
+   function Get_Window (File : Ada.Streams.Stream_IO.File_Type)
+                        return Window is
+      function getwin (f : ICS.FILEs) return Window;
+      pragma Import (C, getwin, "getwin");
+
+      W : constant Window := getwin (ACS.C_Stream (File));
+   begin
+      if W = Null_Window then
+         raise Curses_Exception;
+      else
+         return W;
+      end if;
+   end Get_Window;
+
+end Terminal_Interface.Curses.PutWin;
+
diff --git a/doc/html/ada/terminal_interface-curses-putwin__ads.htm b/doc/html/ada/terminal_interface-curses-putwin__ads.htm new file mode 100644 index 00000000000..0bf60e6baff --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-putwin__ads.htm @@ -0,0 +1,56 @@ + +terminal_interface-curses-putwin.ads + +

File : terminal_interface-curses-putwin.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                    Terminal_Interface.Curses.PutWin                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), 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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.3 @
+--  Binding Version 01.00
+
+with Ada.Streams.Stream_IO;
+
+package Terminal_Interface.Curses.PutWin is
+
+   procedure Put_Window (Win  : Window;
+                         File : Ada.Streams.Stream_IO.File_Type);
+
+   function Get_Window (File  : Ada.Streams.Stream_IO.File_Type) return Window;
+
+end Terminal_Interface.Curses.PutWin;
+
diff --git a/doc/html/ada/terminal_interface-curses-termcap__adb.htm b/doc/html/ada/terminal_interface-curses-termcap__adb.htm new file mode 100644 index 00000000000..a3f27e51226 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-termcap__adb.htm @@ -0,0 +1,169 @@ + +terminal_interface-curses-termcap.adb + +

File : terminal_interface-curses-termcap.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                    Terminal_Interface.Curses.Termcap                     --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+with Interfaces.C; use Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+
+package body Terminal_Interface.Curses.Termcap is
+
+   function Get_Entry (Name : String) return Boolean
+   is
+      function tgetent (name : char_array; val : char_array)
+                        return C_Int;
+      pragma Import (C, tgetent, "tgetent");
+      NameTxt : char_array (0 .. Name'Length);
+      Length  : size_t;
+      ignored : constant char_array (0 .. 0) := (0 => nul);
+      result  : C_Int;
+   begin
+      To_C (Name, NameTxt, Length);
+      result := tgetent (char_array (ignored), NameTxt);
+      if result = -1 then
+         raise Curses_Exception;
+      else
+         return Boolean'Val (result);
+      end if;
+   end Get_Entry;
+
+------------------------------------------------------------------------------
+   function Get_Flag (Name : String) return Boolean
+   is
+      function tgetflag (id : char_array) return C_Int;
+      pragma Import (C, tgetflag, "tgetflag");
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+   begin
+      To_C (Name, Txt, Length);
+      if tgetflag (Txt) = 0 then
+         return False;
+      else
+         return True;
+      end if;
+   end Get_Flag;
+
+------------------------------------------------------------------------------
+   procedure Get_Number (Name   : String;
+                         Value  : out Integer;
+                         Result : out Boolean)
+   is
+      function tgetnum (id : char_array) return C_Int;
+      pragma Import (C, tgetnum, "tgetnum");
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+   begin
+      To_C (Name, Txt, Length);
+      Value := Integer (tgetnum (Txt));
+      if Value = -1 then
+         Result := False;
+      else
+         Result :=  True;
+      end if;
+   end Get_Number;
+
+------------------------------------------------------------------------------
+   procedure Get_String (Name   : String;
+                         Value  : out String;
+                         Result : out Boolean)
+   is
+      function tgetstr (id  : char_array;
+                        buf : char_array) return chars_ptr;
+      pragma Import (C, tgetstr, "tgetstr");
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+      Txt2   : chars_ptr;
+      type t is new char_array (0 .. 1024); --  does it need to be 1024?
+      Return_Buffer : constant t := (others => nul);
+   begin
+      To_C (Name, Txt, Length);
+      Txt2 := tgetstr (Txt, char_array (Return_Buffer));
+      if Txt2 = Null_Ptr then
+         Result := False;
+      else
+         Value := Fill_String (Txt2);
+         Result := True;
+      end if;
+   end Get_String;
+
+   function Get_String (Name : String) return Boolean
+   is
+      function tgetstr (Id  : char_array;
+                        buf : char_array) return chars_ptr;
+      pragma Import (C, tgetstr, "tgetstr");
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+      Txt2   : chars_ptr;
+      type t is new char_array (0 .. 1024); --  does it need to be 1024?
+      Phony_Txt : constant t := (others => nul);
+   begin
+      To_C (Name, Txt, Length);
+      Txt2 := tgetstr (Txt, char_array (Phony_Txt));
+      if Txt2 = Null_Ptr then
+         return False;
+      else
+         return True;
+      end if;
+   end Get_String;
+
+------------------------------------------------------------------------------
+   function TGoto (Cap : String;
+                   Col : Column_Position;
+                   Row : Line_Position) return Termcap_String is
+      function tgoto (cap : char_array;
+                      col : C_Int;
+                      row : C_Int) return chars_ptr;
+      pragma Import (C, tgoto);
+      Txt    : char_array (0 .. Cap'Length);
+      Length : size_t;
+   begin
+      To_C (Cap, Txt, Length);
+      return Termcap_String (Fill_String
+                             (tgoto (Txt, C_Int (Col), C_Int (Row))));
+   end TGoto;
+
+end Terminal_Interface.Curses.Termcap;
+
diff --git a/doc/html/ada/terminal_interface-curses-termcap__ads.htm b/doc/html/ada/terminal_interface-curses-termcap__ads.htm new file mode 100644 index 00000000000..51621b62699 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-termcap__ads.htm @@ -0,0 +1,86 @@ + +terminal_interface-curses-termcap.ads + +

File : terminal_interface-curses-termcap.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                     Terminal_Interface.Curses.Termcap                    --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), 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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.3 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+package Terminal_Interface.Curses.Termcap is
+   pragma Preelaborate (Terminal_Interface.Curses.Termcap);
+
+   --  |=====================================================================
+   --  | Man page curs_termcap.3x
+   --  |=====================================================================
+   --  Not implemented:  tputs (see curs_terminfo)
+
+   type Termcap_String is new String;
+
+   --  |
+   function TGoto (Cap : String;
+                   Col : Column_Position;
+                   Row : Line_Position) return Termcap_String;
+   --  AKA: tgoto()
+
+   --  |
+   function Get_Entry (Name : String) return Boolean;
+   --  AKA: tgetent()
+
+   --  |
+   function Get_Flag (Name : String) return Boolean;
+   --  AKA: tgetflag()
+
+   --  |
+   procedure Get_Number (Name   : String;
+                         Value  : out Integer;
+                         Result : out Boolean);
+   --  AKA: tgetnum()
+
+   --  |
+   procedure Get_String (Name   : String;
+                         Value  : out String;
+                         Result : out Boolean);
+   function Get_String (Name : String) return Boolean;
+   --  Returns True if the string is found.
+   --  AKA: tgetstr()
+
+end Terminal_Interface.Curses.Termcap;
+
diff --git a/doc/html/ada/terminal_interface-curses-terminfo__adb.htm b/doc/html/ada/terminal_interface-curses-terminfo__adb.htm new file mode 100644 index 00000000000..e2759a3a973 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-terminfo__adb.htm @@ -0,0 +1,167 @@ + +terminal_interface-curses-terminfo.adb + +

File : terminal_interface-curses-terminfo.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                    Terminal_Interface.Curses.Terminfo                    --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.6 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+with Interfaces.C; use Interfaces.C;
+with Interfaces.C.Strings; use Interfaces.C.Strings;
+with Ada.Unchecked_Conversion;
+
+package body Terminal_Interface.Curses.Terminfo is
+
+   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean;
+
+   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is
+      type Weird_Address is new System.Storage_Elements.Integer_Address;
+      Invalid_Pointer : constant Weird_Address := -1;
+      function To_Weird is new Ada.Unchecked_Conversion
+        (Source => chars_ptr, Target => Weird_Address);
+   begin
+      if To_Weird (P) = Invalid_Pointer then
+         return True;
+      else
+         return False;
+      end if;
+   end Is_MinusOne_Pointer;
+   pragma Inline (Is_MinusOne_Pointer);
+
+------------------------------------------------------------------------------
+   function Get_Flag (Name : String) return Boolean
+   is
+      function tigetflag (id : char_array) return Curses_Bool;
+      pragma Import (C, tigetflag);
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+   begin
+      To_C (Name, Txt, Length);
+      if tigetflag (Txt) = Curses_Bool (Curses_True) then
+         return True;
+      else
+         return False;
+      end if;
+   end Get_Flag;
+
+------------------------------------------------------------------------------
+   procedure Get_String (Name   : String;
+                         Value  : out Terminfo_String;
+                         Result : out Boolean)
+   is
+      function tigetstr (id : char_array) return chars_ptr;
+      pragma Import (C, tigetstr, "tigetstr");
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+      Txt2 : chars_ptr;
+   begin
+      To_C (Name, Txt, Length);
+      Txt2 := tigetstr (Txt);
+      if Txt2 = Null_Ptr then
+         Result := False;
+      elsif Is_MinusOne_Pointer (Txt2) then
+         raise Curses_Exception;
+      else
+         Value  := Terminfo_String (Fill_String (Txt2));
+         Result := True;
+      end if;
+   end Get_String;
+
+------------------------------------------------------------------------------
+   function Has_String (Name : String) return Boolean
+   is
+      function tigetstr (id : char_array) return chars_ptr;
+      pragma Import (C, tigetstr, "tigetstr");
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+      Txt2 : chars_ptr;
+   begin
+      To_C (Name, Txt, Length);
+      Txt2 := tigetstr (Txt);
+      if Txt2 = Null_Ptr then
+         return False;
+      elsif Is_MinusOne_Pointer (Txt2) then
+         raise Curses_Exception;
+      else
+         return True;
+      end if;
+   end Has_String;
+
+------------------------------------------------------------------------------
+   function Get_Number (Name : String) return Integer is
+      function tigetstr (s : char_array) return C_Int;
+      pragma Import (C, tigetstr);
+      Txt    : char_array (0 .. Name'Length);
+      Length : size_t;
+   begin
+      To_C (Name, Txt, Length);
+      return Integer (tigetstr (Txt));
+   end Get_Number;
+
+------------------------------------------------------------------------------
+   procedure Put_String (Str    : Terminfo_String;
+                         affcnt : Natural := 1;
+                         putc   : putctype := null) is
+      function tputs (str    : char_array;
+                      affcnt : C_Int;
+                      putc   : putctype) return C_Int;
+      function putp (str : char_array) return C_Int;
+      pragma Import (C, tputs);
+      pragma Import (C, putp);
+      Txt    : char_array (0 .. Str'Length);
+      Length : size_t;
+      Err : C_Int;
+   begin
+      To_C (String (Str), Txt, Length);
+      if putc = null then
+         Err := putp (Txt);
+      else
+         Err := tputs (Txt, C_Int (affcnt), putc);
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Put_String;
+
+end Terminal_Interface.Curses.Terminfo;
+
diff --git a/doc/html/ada/terminal_interface-curses-terminfo__ads.htm b/doc/html/ada/terminal_interface-curses-terminfo__ads.htm new file mode 100644 index 00000000000..72edda4f627 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-terminfo__ads.htm @@ -0,0 +1,87 @@ + +terminal_interface-curses-terminfo.ads + +

File : terminal_interface-curses-terminfo.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                     Terminal_Interface.Curses.Terminfo                   --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), 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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.3 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+with Interfaces.C;
+
+package Terminal_Interface.Curses.Terminfo is
+   pragma Preelaborate (Terminal_Interface.Curses.Terminfo);
+
+   --  |=====================================================================
+   --  | Man page curs_terminfo.3x
+   --  |=====================================================================
+   --  Not implemented:  setupterm, setterm, set_curterm, del_curterm,
+   --                    restartterm, tparm, putp, vidputs,  vidattr,
+   --                    mvcur
+
+   type Terminfo_String is new String;
+
+   --  |
+   procedure Get_String (Name   : String;
+                         Value  : out Terminfo_String;
+                         Result : out Boolean);
+   function Has_String (Name : String) return Boolean;
+   --  AKA: tigetstr()
+
+   --  |
+   function Get_Flag (Name : String) return Boolean;
+   --  AKA: tigetflag()
+
+   --  |
+   function Get_Number (Name : String) return Integer;
+   --  AKA: tigetnum()
+
+   type putctype is access function (c : Interfaces.C.int)
+                                    return Interfaces.C.int;
+   pragma Convention (C, putctype);
+
+   --  |
+   procedure Put_String (Str    : Terminfo_String;
+                         affcnt : Natural := 1;
+                         putc   : putctype := null);
+   --  AKA: tputs()
+
+end Terminal_Interface.Curses.Terminfo;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm new file mode 100644 index 00000000000..104b9496243 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm @@ -0,0 +1,134 @@ + +terminal_interface-curses-text_io-aux.adb + +

File : terminal_interface-curses-text_io-aux.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                   Terminal_Interface.Curses.Text_IO.Aux                  --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.13 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package body Terminal_Interface.Curses.Text_IO.Aux is
+
+   procedure Put_Buf
+     (Win    : Window;
+      Buf    : String;
+      Width  : Field;
+      Signal : Boolean := True;
+      Ljust  : Boolean := False)
+   is
+      L   : Field;
+      Len : Field;
+      W   : Field := Width;
+      LC  : Line_Count;
+      CC  : Column_Count;
+      Y   : Line_Position;
+      X   : Column_Position;
+
+      procedure Output (From, To : Field);
+
+      procedure Output (From, To : Field)
+      is
+      begin
+         if Len > 0 then
+            if W = 0 then
+               W := Len;
+            end if;
+            if Len > W then
+               --  LRM A10.6 (7) says this
+               W := Len;
+            end if;
+
+            pragma Assert (Len <= W);
+            Get_Size (Win, LC, CC);
+            if Column_Count (Len) > CC then
+               if Signal then
+                  raise Layout_Error;
+               else
+                  return;
+               end if;
+            else
+               if Len < W and then not Ljust then
+                  declare
+                     Filler : constant String (1 .. (W - Len))
+                       := (others => ' ');
+                  begin
+                     Put (Win, Filler);
+                  end;
+               end if;
+               Get_Cursor_Position (Win, Y, X);
+               if (X + Column_Position (Len)) > CC then
+                  New_Line (Win);
+               end if;
+               Put (Win, Buf (From .. To));
+               if Len < W and then Ljust then
+                  declare
+                     Filler : constant String (1 .. (W - Len))
+                       := (others => ' ');
+                  begin
+                     Put (Win, Filler);
+                  end;
+               end if;
+            end if;
+         end if;
+      end Output;
+
+   begin
+      pragma Assert (Win /= Null_Window);
+      if Ljust then
+         L := 1;
+         for I in 1 .. Buf'Length loop
+            exit when Buf (L) = ' ';
+            L := L + 1;
+         end loop;
+         Len := L - 1;
+         Output (1, Len);
+      else  -- input buffer is not left justified
+         L := Buf'Length;
+         for I in 1 .. Buf'Length loop
+            exit when Buf (L) = ' ';
+            L := L - 1;
+         end loop;
+         Len := Buf'Length - L;
+         Output (L + 1, Buf'Length);
+      end if;
+   end Put_Buf;
+
+end Terminal_Interface.Curses.Text_IO.Aux;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm new file mode 100644 index 00000000000..6a8ff2c7f32 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm @@ -0,0 +1,61 @@ + +terminal_interface-curses-text_io-aux.ads + +

File : terminal_interface-curses-text_io-aux.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                   Terminal_Interface.Curses.Text_IO.Aux                  --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.14 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+private package Terminal_Interface.Curses.Text_IO.Aux is
+   --  pragma Preelaborate (Aux);
+
+   --  This routine is called from the Text_IO output routines for numeric
+   --  and enumeration types.
+   --
+   procedure Put_Buf
+     (Win    : Window;               -- The output window
+      Buf    : String;               -- The buffer containing the text
+      Width  : Field;                -- The width of the output field
+      Signal : Boolean := True;      -- If true, we raise Layout_Error
+      Ljust  : Boolean := False);    -- The Buf is left justified
+
+end Terminal_Interface.Curses.Text_IO.Aux;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm new file mode 100644 index 00000000000..8f94a9571d5 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm @@ -0,0 +1,79 @@ + +terminal_interface-curses-text_io-complex_io.adb + +

File : terminal_interface-curses-text_io-complex_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Complex_IO               --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Terminal_Interface.Curses.Text_IO.Float_IO;
+
+package body Terminal_Interface.Curses.Text_IO.Complex_IO is
+
+   package FIO is new
+     Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base);
+
+   procedure Put
+     (Win  : Window;
+      Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
+   is
+   begin
+      Put (Win, '(');
+      FIO.Put (Win, Item.Re, Fore, Aft, Exp);
+      Put (Win, ',');
+      FIO.Put (Win, Item.Im, Fore, Aft, Exp);
+      Put (Win, ')');
+   end Put;
+
+   procedure Put
+     (Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
+   is
+   begin
+      Put (Get_Window, Item, Fore, Aft, Exp);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Complex_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm new file mode 100644 index 00000000000..ce215b59c88 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm @@ -0,0 +1,76 @@ + +terminal_interface-curses-text_io-complex_io.ads + +

File : terminal_interface-curses-text_io-complex_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Complex_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Numerics.Generic_Complex_Types;
+
+generic
+   with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>);
+
+package Terminal_Interface.Curses.Text_IO.Complex_IO is
+
+   use Complex_Types;
+
+   Default_Fore : Field := 2;
+   Default_Aft  : Field := Real'Digits - 1;
+   Default_Exp  : Field := 3;
+
+   procedure Put
+     (Win  : Window;
+      Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+   procedure Put
+     (Item : Complex;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Complex_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm new file mode 100644 index 00000000000..0e021444688 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm @@ -0,0 +1,81 @@ + +terminal_interface-curses-text_io-decimal_io.adb + +

File : terminal_interface-curses-text_io-decimal_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Terminal_Interface.Curses.Text_IO.Aux;
+
+package body Terminal_Interface.Curses.Text_IO.Decimal_IO is
+
+   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
+   package DIO is new Ada.Text_IO.Decimal_IO (Num);
+
+   procedure Put
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
+   is
+      Buf : String (1 .. Field'Last);
+      Len : Field := Fore + 1 + Aft;
+   begin
+      if Exp > 0 then
+         Len := Len + 1 + Exp;
+      end if;
+      DIO.Put (Buf, Item, Aft, Exp);
+      Aux.Put_Buf (Win, Buf, Len, False);
+   end Put;
+
+   procedure Put
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp) is
+   begin
+      Put (Get_Window, Item, Fore, Aft, Exp);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Decimal_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm new file mode 100644 index 00000000000..b19c151d7e2 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm @@ -0,0 +1,72 @@ + +terminal_interface-curses-text_io-decimal_io.ads + +

File : terminal_interface-curses-text_io-decimal_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type Num is delta <> digits <>;
+
+package Terminal_Interface.Curses.Text_IO.Decimal_IO is
+
+   Default_Fore : Field := Num'Fore;
+   Default_Aft  : Field := Num'Aft;
+   Default_Exp  : Field := 0;
+
+   procedure Put
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+   procedure Put
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Decimal_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm new file mode 100644 index 00000000000..070e480a09e --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm @@ -0,0 +1,86 @@ + +terminal_interface-curses-text_io-enumeration_io.adb + +

File : terminal_interface-curses-text_io-enumeration_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Ada.Characters.Handling; use Ada.Characters.Handling;
+with Terminal_Interface.Curses.Text_IO.Aux;
+
+package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is
+
+   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
+   package EIO is new Ada.Text_IO.Enumeration_IO (Enum);
+
+   procedure Put
+     (Win   : Window;
+      Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting)
+   is
+      Buf  : String (1 .. Field'Last);
+      Tset : Ada.Text_IO.Type_Set;
+   begin
+      if Set /= Mixed_Case then
+         Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set));
+      else
+         Tset := Ada.Text_IO.Lower_Case;
+      end if;
+      EIO.Put (Buf, Item, Tset);
+      if Set = Mixed_Case then
+         Buf (Buf'First) := To_Upper (Buf (Buf'First));
+      end if;
+      Aux.Put_Buf (Win, Buf, Width, True, True);
+   end Put;
+
+   procedure Put
+     (Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting)
+   is
+   begin
+      Put (Get_Window, Item, Width, Set);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm new file mode 100644 index 00000000000..b3d316ade6e --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm @@ -0,0 +1,69 @@ + +terminal_interface-curses-text_io-enumeration_io.ads + +

File : terminal_interface-curses-text_io-enumeration_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type Enum is (<>);
+
+package Terminal_Interface.Curses.Text_IO.Enumeration_IO is
+
+   Default_Width : Field := 0;
+   Default_Setting : Type_Set := Mixed_Case;
+
+   procedure Put
+     (Win   : Window;
+      Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting);
+
+   procedure Put
+     (Item  : Enum;
+      Width : Field := Default_Width;
+      Set   : Type_Set := Default_Setting);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm new file mode 100644 index 00000000000..578da53890d --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm @@ -0,0 +1,81 @@ + +terminal_interface-curses-text_io-fixed_io.adb + +

File : terminal_interface-curses-text_io-fixed_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Terminal_Interface.Curses.Text_IO.Aux;
+
+package body Terminal_Interface.Curses.Text_IO.Fixed_IO is
+
+   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
+   package FIXIO is new Ada.Text_IO.Fixed_IO (Num);
+
+   procedure Put
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
+   is
+      Buf : String (1 .. Field'Last);
+      Len : Field := Fore + 1 + Aft;
+   begin
+      if Exp > 0 then
+         Len := Len + 1 + Exp;
+      end if;
+      FIXIO.Put (Buf, Item, Aft, Exp);
+      Aux.Put_Buf (Win, Buf, Len, False);
+   end Put;
+
+   procedure Put
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp) is
+   begin
+      Put (Get_Window, Item, Fore, Aft, Exp);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Fixed_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm new file mode 100644 index 00000000000..315a0cbaa75 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm @@ -0,0 +1,72 @@ + +terminal_interface-curses-text_io-fixed_io.ads + +

File : terminal_interface-curses-text_io-fixed_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type Num is delta <>;
+
+package Terminal_Interface.Curses.Text_IO.Fixed_IO is
+
+   Default_Fore : Field := Num'Fore;
+   Default_Aft  : Field := Num'Aft;
+   Default_Exp  : Field := 0;
+
+   procedure Put
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+   procedure Put
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Fixed_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm new file mode 100644 index 00000000000..db86cfcc7bb --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm @@ -0,0 +1,82 @@ + +terminal_interface-curses-text_io-float_io.adb + +

File : terminal_interface-curses-text_io-float_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Text_IO.Float_IO                --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Terminal_Interface.Curses.Text_IO.Aux;
+
+package body Terminal_Interface.Curses.Text_IO.Float_IO is
+
+   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
+   package FIO is new Ada.Text_IO.Float_IO (Num);
+
+   procedure Put
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
+   is
+      Buf : String (1 .. Field'Last);
+      Len : Field := Fore + 1 + Aft;
+   begin
+      if Exp > 0 then
+         Len := Len + 1 + Exp;
+      end if;
+      FIO.Put (Buf, Item, Aft, Exp);
+      Aux.Put_Buf (Win, Buf, Len, False);
+   end Put;
+
+   procedure Put
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp)
+   is
+   begin
+      Put (Get_Window, Item, Fore, Aft, Exp);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Float_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm new file mode 100644 index 00000000000..6b6e30a2812 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm @@ -0,0 +1,72 @@ + +terminal_interface-curses-text_io-float_io.ads + +

File : terminal_interface-curses-text_io-float_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Text_IO.Float_IO                --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type Num is digits <>;
+
+package Terminal_Interface.Curses.Text_IO.Float_IO is
+
+   Default_Fore : Field := 2;
+   Default_Aft  : Field := Num'Digits - 1;
+   Default_Exp  : Field := 3;
+
+   procedure Put
+     (Win  : Window;
+      Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+   procedure Put
+     (Item : Num;
+      Fore : Field := Default_Fore;
+      Aft  : Field := Default_Aft;
+      Exp  : Field := Default_Exp);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Float_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm new file mode 100644 index 00000000000..17c2f49447f --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm @@ -0,0 +1,76 @@ + +terminal_interface-curses-text_io-integer_io.adb + +

File : terminal_interface-curses-text_io-integer_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Integer_IO               --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Terminal_Interface.Curses.Text_IO.Aux;
+
+package body Terminal_Interface.Curses.Text_IO.Integer_IO is
+
+   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
+   package IIO is new Ada.Text_IO.Integer_IO (Num);
+
+   procedure Put
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
+   is
+      Buf : String (1 .. Field'Last);
+   begin
+      IIO.Put (Buf, Item, Base);
+      Aux.Put_Buf (Win, Buf, Width);
+   end Put;
+
+   procedure Put
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
+   is
+   begin
+      Put (Get_Window, Item, Width, Base);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Integer_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm new file mode 100644 index 00000000000..930bff14f29 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm @@ -0,0 +1,69 @@ + +terminal_interface-curses-text_io-integer_io.ads + +

File : terminal_interface-curses-text_io-integer_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Integer_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type Num is range <>;
+
+package Terminal_Interface.Curses.Text_IO.Integer_IO is
+
+   Default_Width : Field := Num'Width;
+   Default_Base  : Number_Base := 10;
+
+   procedure Put
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
+
+   procedure Put
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Integer_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm new file mode 100644 index 00000000000..1ef76a739db --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm @@ -0,0 +1,76 @@ + +terminal_interface-curses-text_io-modular_io.adb + +

File : terminal_interface-curses-text_io-modular_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Modular_IO               --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.11 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Terminal_Interface.Curses.Text_IO.Aux;
+
+package body Terminal_Interface.Curses.Text_IO.Modular_IO is
+
+   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
+   package MIO is new Ada.Text_IO.Modular_IO (Num);
+
+   procedure Put
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
+   is
+      Buf : String (1 .. Field'Last);
+   begin
+      MIO.Put (Buf, Item, Base);
+      Aux.Put_Buf (Win, Buf, Width);
+   end Put;
+
+   procedure Put
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base)
+   is
+   begin
+      Put (Get_Window, Item, Width, Base);
+   end Put;
+
+end Terminal_Interface.Curses.Text_IO.Modular_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm new file mode 100644 index 00000000000..227dd9bff97 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm @@ -0,0 +1,69 @@ + +terminal_interface-curses-text_io-modular_io.ads + +

File : terminal_interface-curses-text_io-modular_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Text_IO.Modular_IO               --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.12 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+generic
+   type Num is mod <>;
+
+package Terminal_Interface.Curses.Text_IO.Modular_IO is
+
+   Default_Width : Field := Num'Width;
+   Default_Base  : Number_Base := 10;
+
+   procedure Put
+     (Win   : Window;
+      Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
+
+   procedure Put
+     (Item  : Num;
+      Width : Field := Default_Width;
+      Base  : Number_Base := Default_Base);
+
+private
+   pragma Inline (Put);
+
+end Terminal_Interface.Curses.Text_IO.Modular_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io__adb.htm new file mode 100644 index 00000000000..fdeafd3c121 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io__adb.htm @@ -0,0 +1,343 @@ + +terminal_interface-curses-text_io.adb + +

File : terminal_interface-curses-text_io.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                     Terminal_Interface.Curses.Text_IO                    --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2006,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.19 @
+--  @Date: 2009/12/26 17:40:46 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package body Terminal_Interface.Curses.Text_IO is
+
+   Default_Window : Window := Null_Window;
+
+   procedure Set_Window (Win : Window)
+   is
+   begin
+      Default_Window := Win;
+   end Set_Window;
+
+   function Get_Window return Window
+   is
+   begin
+      if Default_Window = Null_Window then
+         return Standard_Window;
+      else
+         return Default_Window;
+      end if;
+   end Get_Window;
+   pragma Inline (Get_Window);
+
+   procedure Flush (Win : Window)
+   is
+   begin
+      Refresh (Win);
+   end Flush;
+
+   procedure Flush
+   is
+   begin
+      Flush (Get_Window);
+   end Flush;
+
+   --------------------------------------------
+   -- Specification of line and page lengths --
+   --------------------------------------------
+
+   --  There are no set routines in this package. I assume, that you allocate
+   --  the window with an appropriate size.
+   --  A scroll-window is interpreted as an page with unbounded page length,
+   --  i.e. it returns the conventional 0 as page length.
+
+   function Line_Length (Win : Window) return Count
+   is
+      N_Lines : Line_Count;
+      N_Cols  : Column_Count;
+   begin
+      Get_Size (Win, N_Lines, N_Cols);
+      --  if Natural (N_Cols) > Natural (Count'Last) then
+      --     raise Layout_Error;
+      --  end if;
+      return Count (N_Cols);
+   end Line_Length;
+
+   function Line_Length return Count
+   is
+   begin
+      return Line_Length (Get_Window);
+   end Line_Length;
+
+   function Page_Length (Win : Window) return Count
+   is
+      N_Lines : Line_Count;
+      N_Cols  : Column_Count;
+   begin
+      if Scrolling_Allowed (Win) then
+         return 0;
+      else
+         Get_Size (Win, N_Lines, N_Cols);
+         --  if Natural (N_Lines) > Natural (Count'Last) then
+         --     raise Layout_Error;
+         --  end if;
+         return Count (N_Lines);
+      end if;
+   end Page_Length;
+
+   function Page_Length return Count
+   is
+   begin
+      return Page_Length (Get_Window);
+   end Page_Length;
+
+   ------------------------------------
+   -- Column, Line, and Page Control --
+   ------------------------------------
+   procedure New_Line (Win : Window; Spacing : Positive_Count := 1)
+   is
+      P_Size : constant Count := Page_Length (Win);
+   begin
+      if not Spacing'Valid then
+         raise Constraint_Error;
+      end if;
+
+      for I in 1 .. Spacing loop
+         if P_Size > 0 and then Line (Win) >= P_Size then
+            New_Page (Win);
+         else
+            Add (Win, ASCII.LF);
+         end if;
+      end loop;
+   end New_Line;
+
+   procedure New_Line (Spacing : Positive_Count := 1)
+   is
+   begin
+      New_Line (Get_Window, Spacing);
+   end New_Line;
+
+   procedure New_Page (Win : Window)
+   is
+   begin
+      Clear (Win);
+   end New_Page;
+
+   procedure New_Page
+   is
+   begin
+      New_Page (Get_Window);
+   end New_Page;
+
+   procedure Set_Col (Win : Window;  To : Positive_Count)
+   is
+      Y  : Line_Position;
+      X1 : Column_Position;
+      X2 : Column_Position;
+      N  : Natural;
+   begin
+      if not To'Valid then
+         raise Constraint_Error;
+      end if;
+
+      Get_Cursor_Position (Win, Y, X1);
+      N  := Natural (To); N := N - 1;
+      X2 := Column_Position (N);
+      if X1 > X2 then
+         New_Line (Win, 1);
+         X1 := 0;
+      end if;
+      if X1 < X2 then
+         declare
+            Filler : constant String (Integer (X1) .. (Integer (X2) - 1))
+              := (others => ' ');
+         begin
+            Put (Win, Filler);
+         end;
+      end if;
+   end Set_Col;
+
+   procedure Set_Col (To : Positive_Count)
+   is
+   begin
+      Set_Col (Get_Window, To);
+   end Set_Col;
+
+   procedure Set_Line (Win : Window; To : Positive_Count)
+   is
+      Y1 : Line_Position;
+      Y2 : Line_Position;
+      X  : Column_Position;
+      N  : Natural;
+   begin
+      if not To'Valid then
+         raise Constraint_Error;
+      end if;
+
+      Get_Cursor_Position (Win, Y1, X);
+      N  := Natural (To); N := N - 1;
+      Y2 := Line_Position (N);
+      if Y2 < Y1 then
+         New_Page (Win);
+         Y1 := 0;
+      end if;
+      if Y1 < Y2 then
+         New_Line (Win, Positive_Count (Y2 - Y1));
+      end if;
+   end Set_Line;
+
+   procedure Set_Line (To : Positive_Count)
+   is
+   begin
+      Set_Line (Get_Window, To);
+   end Set_Line;
+
+   function Col (Win : Window) return Positive_Count
+   is
+      Y : Line_Position;
+      X : Column_Position;
+      N : Natural;
+   begin
+      Get_Cursor_Position (Win, Y, X);
+      N := Natural (X); N := N + 1;
+      --  if N > Natural (Count'Last) then
+      --     raise Layout_Error;
+      --  end if;
+      return Positive_Count (N);
+   end Col;
+
+   function Col return Positive_Count
+   is
+   begin
+      return Col (Get_Window);
+   end Col;
+
+   function Line (Win : Window) return Positive_Count
+   is
+      Y : Line_Position;
+      X : Column_Position;
+      N : Natural;
+   begin
+      Get_Cursor_Position (Win, Y, X);
+      N := Natural (Y); N := N + 1;
+      --  if N > Natural (Count'Last) then
+      --     raise Layout_Error;
+      --  end if;
+      return Positive_Count (N);
+   end Line;
+
+   function Line return Positive_Count
+   is
+   begin
+      return Line (Get_Window);
+   end Line;
+
+   -----------------------
+   -- Characters Output --
+   -----------------------
+
+   procedure Put (Win  : Window; Item : Character)
+   is
+      P_Size : constant Count := Page_Length (Win);
+      Y : Line_Position;
+      X : Column_Position;
+      L : Line_Count;
+      C : Column_Count;
+   begin
+      if P_Size > 0 then
+         Get_Cursor_Position (Win, Y, X);
+         Get_Size (Win, L, C);
+         if (Y + 1) = L and then (X + 1) = C then
+            New_Page (Win);
+         end if;
+      end if;
+      Add (Win, Item);
+   end Put;
+
+   procedure Put (Item : Character)
+   is
+   begin
+      Put (Get_Window, Item);
+   end Put;
+
+   --------------------
+   -- Strings-Output --
+   --------------------
+
+   procedure Put (Win  : Window; Item : String)
+   is
+      P_Size : constant Count := Page_Length (Win);
+      Y : Line_Position;
+      X : Column_Position;
+      L : Line_Count;
+      C : Column_Count;
+   begin
+      if P_Size > 0 then
+         Get_Cursor_Position (Win, Y, X);
+         Get_Size (Win, L, C);
+         if (Y + 1) = L and then (X + 1 + Item'Length) >= C then
+            New_Page (Win);
+         end if;
+      end if;
+      Add (Win, Item);
+   end Put;
+
+   procedure Put (Item : String)
+   is
+   begin
+      Put (Get_Window, Item);
+   end Put;
+
+   procedure Put_Line
+     (Win  : Window;
+      Item : String)
+   is
+   begin
+      Put (Win, Item);
+      New_Line (Win, 1);
+   end Put_Line;
+
+   procedure Put_Line
+     (Item : String)
+   is
+   begin
+      Put_Line (Get_Window, Item);
+   end Put_Line;
+
+end Terminal_Interface.Curses.Text_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-text_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io__ads.htm new file mode 100644 index 00000000000..3d1daf34bd3 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-text_io__ads.htm @@ -0,0 +1,142 @@ + +terminal_interface-curses-text_io.ads + +

File : terminal_interface-curses-text_io.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                     Terminal_Interface.Curses.Text_IO                    --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2003,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.14 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Ada.Text_IO;
+with Ada.IO_Exceptions;
+
+package Terminal_Interface.Curses.Text_IO is
+
+   use type Ada.Text_IO.Count;
+   subtype Count is Ada.Text_IO.Count;
+   subtype Positive_Count is Count range 1 .. Count'Last;
+
+   subtype Field is Ada.Text_IO.Field;
+   subtype Number_Base is Integer range 2 .. 16;
+
+   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
+
+   --  For most of the routines you will see a version without a Window
+   --  type parameter. They will operate on a default window, which can
+   --  be set by the user. It is initially equal to Standard_Window.
+
+   procedure Set_Window (Win : Window);
+   --  Set Win as the default window
+
+   function Get_Window return Window;
+   --  Get the current default window
+
+   procedure Flush (Win : Window);
+   procedure Flush;
+
+   --------------------------------------------
+   -- Specification of line and page lengths --
+   --------------------------------------------
+
+   --  There are no set routines in this package. I assume, that you allocate
+   --  the window with an appropriate size.
+   --  A scroll-window is interpreted as an page with unbounded page length,
+   --  i.e. it returns the conventional 0 as page length.
+
+   function Line_Length (Win : Window) return Count;
+   function Line_Length return Count;
+
+   function Page_Length (Win : Window) return Count;
+   function Page_Length return Count;
+
+   ------------------------------------
+   -- Column, Line, and Page Control --
+   ------------------------------------
+   procedure New_Line (Win : Window; Spacing : Positive_Count := 1);
+   procedure New_Line (Spacing : Positive_Count := 1);
+
+   procedure New_Page (Win : Window);
+   procedure New_Page;
+
+   procedure Set_Col (Win : Window;  To : Positive_Count);
+   procedure Set_Col (To : Positive_Count);
+
+   procedure Set_Line (Win : Window; To : Positive_Count);
+   procedure Set_Line (To : Positive_Count);
+
+   function Col (Win : Window) return Positive_Count;
+   function Col return Positive_Count;
+
+   function Line (Win : Window) return Positive_Count;
+   function Line return Positive_Count;
+
+   -----------------------
+   -- Characters-Output --
+   -----------------------
+
+   procedure Put (Win  : Window; Item : Character);
+   procedure Put (Item : Character);
+
+   --------------------
+   -- Strings-Output --
+   --------------------
+
+   procedure Put (Win  : Window; Item : String);
+   procedure Put (Item : String);
+
+   procedure Put_Line
+     (Win  : Window;
+      Item : String);
+
+   procedure Put_Line
+     (Item : String);
+
+   --  Exceptions
+
+   Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
+   Mode_Error   : exception renames Ada.IO_Exceptions.Mode_Error;
+   Name_Error   : exception renames Ada.IO_Exceptions.Name_Error;
+   Use_Error    : exception renames Ada.IO_Exceptions.Use_Error;
+   Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
+   End_Error    : exception renames Ada.IO_Exceptions.End_Error;
+   Data_Error   : exception renames Ada.IO_Exceptions.Data_Error;
+   Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
+
+end Terminal_Interface.Curses.Text_IO;
+
diff --git a/doc/html/ada/terminal_interface-curses-trace__adb.htm b/doc/html/ada/terminal_interface-curses-trace__adb.htm new file mode 100644 index 00000000000..b766f28071b --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-trace__adb.htm @@ -0,0 +1,83 @@ + +terminal_interface-curses-trace.adb + +

File : terminal_interface-curses-trace.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Trace                     --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000-2004,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.6 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with Interfaces.C; use Interfaces.C;
+with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
+with Ada.Unchecked_Conversion;
+
+package body Terminal_Interface.Curses.Trace is
+
+   type C_TraceType is new C_UInt;
+
+   function TraceAda_To_TraceC is new
+     Ada.Unchecked_Conversion (Source => Trace_Attribute_Set,
+                               Target => C_TraceType);
+
+   procedure Trace_On (x : Trace_Attribute_Set) is
+      procedure traceC (y : C_TraceType);
+      pragma Import (C, traceC, "trace");
+   begin
+      traceC (TraceAda_To_TraceC (x));
+   end Trace_On;
+
+   --  75. (12) A C function that takes a variable number of arguments can
+   --      correspond to several Ada subprograms, taking various specific
+   --      numbers and types of parameters.
+
+   procedure Trace_Put (str : String) is
+      procedure tracef (format : char_array; s : char_array);
+      pragma Import (C, tracef, "_tracef");
+      Txt    : char_array (0 .. str'Length);
+      Length : size_t;
+      formatstr : constant String := "%s" &  ASCII.NUL;
+      formattxt : char_array (0 .. formatstr'Length);
+   begin
+      To_C (formatstr, formattxt, Length);
+      To_C (str, Txt, Length);
+      tracef (formattxt, Txt);
+   end Trace_Put;
+
+end Terminal_Interface.Curses.Trace;
+
diff --git a/doc/html/ada/terminal_interface-curses-trace__ads.htm b/doc/html/ada/terminal_interface-curses-trace__ads.htm new file mode 100644 index 00000000000..ef569c276c8 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses-trace__ads.htm @@ -0,0 +1,118 @@ + +terminal_interface-curses-trace.ads + +

File : terminal_interface-curses-trace.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Trace                     --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+--                                                                          --
+-- Permission is hereby granted, free of charge, to any person obtaining a  --
+-- copy of this software and associated documentation files (the            --
+-- "Software"), 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: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
+--  Version Control:
+--  @Revision: 1.1 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+
+package Terminal_Interface.Curses.Trace is
+   pragma Preelaborate (Terminal_Interface.Curses.Trace);
+
+   pragma Warnings (Off);
+   type Trace_Attribute_Set is
+      record
+         Times            : Boolean;
+         Tputs            : Boolean;
+         Update           : Boolean;
+         Cursor_Move      : Boolean;
+         Character_Output : Boolean;
+         Calls            : Boolean;
+         Virtual_Puts     : Boolean;
+         Input_Events     : Boolean;
+         TTY_State        : Boolean;
+         Internal_Calls   : Boolean;
+         Character_Calls  : Boolean;
+         Termcap_TermInfo : Boolean;
+      end record;
+   pragma Convention (C, Trace_Attribute_Set);
+
+   for Trace_Attribute_Set use
+      record
+         Times            at 0 range  0 ..  0;
+         Tputs            at 0 range  1 ..  1;
+         Update           at 0 range  2 ..  2;
+         Cursor_Move      at 0 range  3 ..  3;
+         Character_Output at 0 range  4 ..  4;
+         Calls            at 0 range  5 ..  5;
+         Virtual_Puts     at 0 range  6 ..  6;
+         Input_Events     at 0 range  7 ..  7;
+         TTY_State        at 0 range  8 ..  8;
+         Internal_Calls   at 0 range  9 ..  9;
+         Character_Calls  at 0 range 10 .. 10;
+         Termcap_TermInfo at 0 range 11 .. 11;
+      end record;
+   for Trace_Attribute_Set'Size use 32;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.
+
+   pragma Warnings (On);
+
+   Trace_Disable  : constant Trace_Attribute_Set := (others => False);
+
+   Trace_Ordinary : constant Trace_Attribute_Set :=
+     (Times            => True,
+      Tputs            => True,
+      Update           => True,
+      Cursor_Move      => True,
+      Character_Output => True,
+      others           => False);
+   Trace_Maximum : constant Trace_Attribute_Set := (others => True);
+
+------------------------------------------------------------------------------
+
+   --  |=====================================================================
+   --  | Man page curs_trace.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_1"#2|
+   procedure Trace_On (x : Trace_Attribute_Set);
+   --  The debugging library has trace.
+
+   --  #1A NAME="AFU_2"#2|
+   procedure Trace_Put (str : String);
+   --  AKA: _tracef()
+
+   Current_Trace_Setting : Trace_Attribute_Set;
+   pragma Import (C, Current_Trace_Setting, "_nc_tracing");
+
+end Terminal_Interface.Curses.Trace;
+
diff --git a/doc/html/ada/terminal_interface-curses__adb.htm b/doc/html/ada/terminal_interface-curses__adb.htm new file mode 100644 index 00000000000..4c676de93f9 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses__adb.htm @@ -0,0 +1,2562 @@ + +terminal_interface-curses.adb + +

File : terminal_interface-curses.adb


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                        Terminal_Interface.Curses                         --
+--                                                                          --
+--                                 B O D Y                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-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            --
+-- "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: Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.6 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+with System;
+
+with Terminal_Interface.Curses.Aux;
+with Interfaces.C;                  use Interfaces.C;
+with Interfaces.C.Strings;          use Interfaces.C.Strings;
+with Ada.Characters.Handling;       use Ada.Characters.Handling;
+with Ada.Strings.Fixed;
+
+package body Terminal_Interface.Curses is
+
+   use Aux;
+   use type System.Bit_Order;
+
+   package ASF renames Ada.Strings.Fixed;
+
+   type chtype_array is array (size_t range <>)
+      of aliased Attributed_Character;
+   pragma Convention (C, chtype_array);
+
+------------------------------------------------------------------------------
+   function Key_Name (Key : Real_Key_Code) return String
+   is
+      function Keyname (K : C_Int) return chars_ptr;
+      pragma Import (C, Keyname, "keyname");
+
+      Ch : Character;
+   begin
+      if Key <= Character'Pos (Character'Last) then
+         Ch := Character'Val (Key);
+         if Is_Control (Ch) then
+            return Un_Control (Attributed_Character'(Ch    => Ch,
+                                                     Color => Color_Pair'First,
+                                                     Attr  => Normal_Video));
+         elsif Is_Graphic (Ch) then
+            declare
+               S : String (1 .. 1);
+            begin
+               S (1) := Ch;
+               return S;
+            end;
+         else
+            return "";
+         end if;
+      else
+         return Fill_String (Keyname (C_Int (Key)));
+      end if;
+   end Key_Name;
+
+   procedure Key_Name (Key  :  Real_Key_Code;
+                       Name : out String)
+   is
+   begin
+      ASF.Move (Key_Name (Key), Name);
+   end Key_Name;
+
+------------------------------------------------------------------------------
+   procedure Init_Screen
+   is
+      function Initscr return Window;
+      pragma Import (C, Initscr, "initscr");
+
+      W : Window;
+   begin
+      W := Initscr;
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+   end Init_Screen;
+
+   procedure End_Windows
+   is
+      function Endwin return C_Int;
+      pragma Import (C, Endwin, "endwin");
+   begin
+      if Endwin = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end End_Windows;
+
+   function Is_End_Window return Boolean
+   is
+      function Isendwin return Curses_Bool;
+      pragma Import (C, Isendwin, "isendwin");
+   begin
+      if Isendwin = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Is_End_Window;
+------------------------------------------------------------------------------
+   procedure Move_Cursor (Win    : Window := Standard_Window;
+                          Line   : Line_Position;
+                          Column : Column_Position)
+   is
+      function Wmove (Win    : Window;
+                      Line   : C_Int;
+                      Column : C_Int
+                     ) return C_Int;
+      pragma Import (C, Wmove, "wmove");
+   begin
+      if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Move_Cursor;
+------------------------------------------------------------------------------
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Attributed_Character)
+   is
+      function Waddch (W  : Window;
+                       Ch : C_Chtype) return C_Int;
+      pragma Import (C, Waddch, "waddch");
+   begin
+      if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Add;
+
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Character)
+   is
+   begin
+      Add (Win,
+           Attributed_Character'(Ch    => Ch,
+                                 Color => Color_Pair'First,
+                                 Attr  => Normal_Video));
+   end Add;
+
+   procedure Add
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Attributed_Character)
+   is
+      function mvwaddch (W  : Window;
+                         Y  : C_Int;
+                         X  : C_Int;
+                         Ch : C_Chtype) return C_Int;
+      pragma Import (C, mvwaddch, "mvwaddch");
+   begin
+      if mvwaddch (Win, C_Int (Line),
+                   C_Int (Column),
+                   AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Add;
+
+   procedure Add
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Character)
+   is
+   begin
+      Add (Win,
+           Line,
+           Column,
+           Attributed_Character'(Ch    => Ch,
+                                 Color => Color_Pair'First,
+                                 Attr  => Normal_Video));
+   end Add;
+
+   procedure Add_With_Immediate_Echo
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character)
+   is
+      function Wechochar (W  : Window;
+                          Ch : C_Chtype) return C_Int;
+      pragma Import (C, Wechochar, "wechochar");
+   begin
+      if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Add_With_Immediate_Echo;
+
+   procedure Add_With_Immediate_Echo
+     (Win : Window := Standard_Window;
+      Ch  : Character)
+   is
+   begin
+      Add_With_Immediate_Echo
+        (Win,
+         Attributed_Character'(Ch    => Ch,
+                               Color => Color_Pair'First,
+                               Attr  => Normal_Video));
+   end Add_With_Immediate_Echo;
+------------------------------------------------------------------------------
+   function Create (Number_Of_Lines       : Line_Count;
+                    Number_Of_Columns     : Column_Count;
+                    First_Line_Position   : Line_Position;
+                    First_Column_Position : Column_Position) return Window
+   is
+      function Newwin (Number_Of_Lines       : C_Int;
+                       Number_Of_Columns     : C_Int;
+                       First_Line_Position   : C_Int;
+                       First_Column_Position : C_Int) return Window;
+      pragma Import (C, Newwin, "newwin");
+
+      W : Window;
+   begin
+      W := Newwin (C_Int (Number_Of_Lines),
+                   C_Int (Number_Of_Columns),
+                   C_Int (First_Line_Position),
+                   C_Int (First_Column_Position));
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+      return W;
+   end Create;
+
+   procedure Delete (Win : in out Window)
+   is
+      function Wdelwin (W : Window) return C_Int;
+      pragma Import (C, Wdelwin, "delwin");
+   begin
+      if Wdelwin (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+      Win := Null_Window;
+   end Delete;
+
+   function Sub_Window
+     (Win                   : Window := Standard_Window;
+      Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window
+   is
+      function Subwin
+        (Win                   : Window;
+         Number_Of_Lines       : C_Int;
+         Number_Of_Columns     : C_Int;
+         First_Line_Position   : C_Int;
+         First_Column_Position : C_Int) return Window;
+      pragma Import (C, Subwin, "subwin");
+
+      W : Window;
+   begin
+      W := Subwin (Win,
+                   C_Int (Number_Of_Lines),
+                   C_Int (Number_Of_Columns),
+                   C_Int (First_Line_Position),
+                   C_Int (First_Column_Position));
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+      return W;
+   end Sub_Window;
+
+   function Derived_Window
+     (Win                   : Window := Standard_Window;
+      Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window
+   is
+      function Derwin
+        (Win                   : Window;
+         Number_Of_Lines       : C_Int;
+         Number_Of_Columns     : C_Int;
+         First_Line_Position   : C_Int;
+         First_Column_Position : C_Int) return Window;
+      pragma Import (C, Derwin, "derwin");
+
+      W : Window;
+   begin
+      W := Derwin (Win,
+                   C_Int (Number_Of_Lines),
+                   C_Int (Number_Of_Columns),
+                   C_Int (First_Line_Position),
+                   C_Int (First_Column_Position));
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+      return W;
+   end Derived_Window;
+
+   function Duplicate (Win : Window) return Window
+   is
+      function Dupwin (Win : Window) return Window;
+      pragma Import (C, Dupwin, "dupwin");
+
+      W : constant Window := Dupwin (Win);
+   begin
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+      return W;
+   end Duplicate;
+
+   procedure Move_Window (Win    : Window;
+                          Line   : Line_Position;
+                          Column : Column_Position)
+   is
+      function Mvwin (Win    : Window;
+                      Line   : C_Int;
+                      Column : C_Int) return C_Int;
+      pragma Import (C, Mvwin, "mvwin");
+   begin
+      if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Move_Window;
+
+   procedure Move_Derived_Window (Win    : Window;
+                                  Line   : Line_Position;
+                                  Column : Column_Position)
+   is
+      function Mvderwin (Win    : Window;
+                         Line   : C_Int;
+                         Column : C_Int) return C_Int;
+      pragma Import (C, Mvderwin, "mvderwin");
+   begin
+      if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Move_Derived_Window;
+
+   procedure Set_Synch_Mode (Win  : Window  := Standard_Window;
+                             Mode : Boolean := False)
+   is
+      function Syncok (Win  : Window;
+                       Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Syncok, "syncok");
+   begin
+      if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Synch_Mode;
+------------------------------------------------------------------------------
+   procedure Add (Win : Window := Standard_Window;
+                  Str : String;
+                  Len : Integer := -1)
+   is
+      function Waddnstr (Win : Window;
+                         Str : char_array;
+                         Len : C_Int := -1) return C_Int;
+      pragma Import (C, Waddnstr, "waddnstr");
+
+      Txt    : char_array (0 .. Str'Length);
+      Length : size_t;
+   begin
+      To_C (Str, Txt, Length);
+      if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Add;
+
+   procedure Add
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Str    : String;
+      Len    : Integer := -1)
+   is
+   begin
+      Move_Cursor (Win, Line, Column);
+      Add (Win, Str, Len);
+   end Add;
+------------------------------------------------------------------------------
+   procedure Add
+     (Win : Window := Standard_Window;
+      Str : Attributed_String;
+      Len : Integer := -1)
+   is
+      function Waddchnstr (Win : Window;
+                           Str : chtype_array;
+                           Len : C_Int := -1) return C_Int;
+      pragma Import (C, Waddchnstr, "waddchnstr");
+
+      Txt : chtype_array (0 .. Str'Length);
+   begin
+      for Length in 1 .. size_t (Str'Length) loop
+         Txt (Length - 1) := Str (Natural (Length));
+      end loop;
+      Txt (Str'Length) := Default_Character;
+      if Waddchnstr (Win,
+                     Txt,
+                     C_Int (Len)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Add;
+
+   procedure Add
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Str    : Attributed_String;
+      Len    : Integer := -1)
+   is
+   begin
+      Move_Cursor (Win, Line, Column);
+      Add (Win, Str, Len);
+   end Add;
+------------------------------------------------------------------------------
+   procedure Border
+     (Win                       : Window := Standard_Window;
+      Left_Side_Symbol          : Attributed_Character := Default_Character;
+      Right_Side_Symbol         : Attributed_Character := Default_Character;
+      Top_Side_Symbol           : Attributed_Character := Default_Character;
+      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
+      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
+      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character)
+   is
+      function Wborder (W   : Window;
+                        LS  : C_Chtype;
+                        RS  : C_Chtype;
+                        TS  : C_Chtype;
+                        BS  : C_Chtype;
+                        ULC : C_Chtype;
+                        URC : C_Chtype;
+                        LLC : C_Chtype;
+                        LRC : C_Chtype) return C_Int;
+      pragma Import (C, Wborder, "wborder");
+   begin
+      if Wborder (Win,
+                  AttrChar_To_Chtype (Left_Side_Symbol),
+                  AttrChar_To_Chtype (Right_Side_Symbol),
+                  AttrChar_To_Chtype (Top_Side_Symbol),
+                  AttrChar_To_Chtype (Bottom_Side_Symbol),
+                  AttrChar_To_Chtype (Upper_Left_Corner_Symbol),
+                  AttrChar_To_Chtype (Upper_Right_Corner_Symbol),
+                  AttrChar_To_Chtype (Lower_Left_Corner_Symbol),
+                  AttrChar_To_Chtype (Lower_Right_Corner_Symbol)
+                  ) = Curses_Err
+      then
+         raise Curses_Exception;
+      end if;
+   end Border;
+
+   procedure Box
+     (Win               : Window := Standard_Window;
+      Vertical_Symbol   : Attributed_Character := Default_Character;
+      Horizontal_Symbol : Attributed_Character := Default_Character)
+   is
+   begin
+      Border (Win,
+              Vertical_Symbol, Vertical_Symbol,
+              Horizontal_Symbol, Horizontal_Symbol);
+   end Box;
+
+   procedure Horizontal_Line
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character)
+   is
+      function Whline (W   : Window;
+                       Ch  : C_Chtype;
+                       Len : C_Int) return C_Int;
+      pragma Import (C, Whline, "whline");
+   begin
+      if Whline (Win,
+                 AttrChar_To_Chtype (Line_Symbol),
+                 C_Int (Line_Size)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Horizontal_Line;
+
+   procedure Vertical_Line
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character)
+   is
+      function Wvline (W   : Window;
+                       Ch  : C_Chtype;
+                       Len : C_Int) return C_Int;
+      pragma Import (C, Wvline, "wvline");
+   begin
+      if Wvline (Win,
+                 AttrChar_To_Chtype (Line_Symbol),
+                 C_Int (Line_Size)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Vertical_Line;
+
+------------------------------------------------------------------------------
+   function Get_Keystroke (Win : Window := Standard_Window)
+     return Real_Key_Code
+   is
+      function Wgetch (W : Window) return C_Int;
+      pragma Import (C, Wgetch, "wgetch");
+
+      C : constant C_Int := Wgetch (Win);
+   begin
+      if C = Curses_Err then
+         return Key_None;
+      else
+         return Real_Key_Code (C);
+      end if;
+   end Get_Keystroke;
+
+   procedure Undo_Keystroke (Key : Real_Key_Code)
+   is
+      function Ungetch (Ch : C_Int) return C_Int;
+      pragma Import (C, Ungetch, "ungetch");
+   begin
+      if Ungetch (C_Int (Key)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Undo_Keystroke;
+
+   function Has_Key (Key : Special_Key_Code) return Boolean
+   is
+      function Haskey (Key : C_Int) return C_Int;
+      pragma Import (C, Haskey, "has_key");
+   begin
+      if Haskey (C_Int (Key)) = Curses_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Has_Key;
+
+   function Is_Function_Key (Key : Special_Key_Code) return Boolean
+   is
+      L : constant Special_Key_Code  := Special_Key_Code (Natural (Key_F0) +
+        Natural (Function_Key_Number'Last));
+   begin
+      if (Key >= Key_F0) and then (Key <= L) then
+         return True;
+      else
+         return False;
+      end if;
+   end Is_Function_Key;
+
+   function Function_Key (Key : Real_Key_Code)
+                          return Function_Key_Number
+   is
+   begin
+      if Is_Function_Key (Key) then
+         return Function_Key_Number (Key - Key_F0);
+      else
+         raise Constraint_Error;
+      end if;
+   end Function_Key;
+
+   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code
+   is
+   begin
+      return Real_Key_Code (Natural (Key_F0) + Natural (Key));
+   end Function_Key_Code;
+------------------------------------------------------------------------------
+   procedure Standout (Win : Window  := Standard_Window;
+                       On  : Boolean := True)
+   is
+      function wstandout (Win : Window) return C_Int;
+      pragma Import (C, wstandout, "wstandout");
+      function wstandend (Win : Window) return C_Int;
+      pragma Import (C, wstandend, "wstandend");
+
+      Err : C_Int;
+   begin
+      if On then
+         Err := wstandout (Win);
+      else
+         Err := wstandend (Win);
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Standout;
+
+   procedure Switch_Character_Attribute
+     (Win  : Window := Standard_Window;
+      Attr : Character_Attribute_Set := Normal_Video;
+      On   : Boolean := True)
+   is
+      function Wattron (Win    : Window;
+                        C_Attr : C_AttrType) return C_Int;
+      pragma Import (C, Wattron, "wattr_on");
+      function Wattroff (Win    : Window;
+                         C_Attr : C_AttrType) return C_Int;
+      pragma Import (C, Wattroff, "wattr_off");
+      --  In Ada we use the On Boolean to control whether or not we want to
+      --  switch on or off the attributes in the set.
+      Err : C_Int;
+      AC  : constant Attributed_Character := (Ch    => Character'First,
+                                              Color => Color_Pair'First,
+                                              Attr  => Attr);
+   begin
+      if On then
+         Err := Wattron  (Win, AttrChar_To_AttrType (AC));
+      else
+         Err := Wattroff (Win, AttrChar_To_AttrType (AC));
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Switch_Character_Attribute;
+
+   procedure Set_Character_Attributes
+     (Win   : Window := Standard_Window;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Wattrset (Win    : Window;
+                         C_Attr : C_AttrType) return C_Int;
+      pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set
+   begin
+      if Wattrset (Win,
+                   AttrChar_To_AttrType (Attributed_Character'
+                                         (Ch    => Character'First,
+                                          Color => Color,
+                                          Attr  => Attr))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Character_Attributes;
+
+   function Get_Character_Attribute (Win : Window := Standard_Window)
+                                     return Character_Attribute_Set
+   is
+      function Wattrget (Win : Window;
+                         Atr : access C_AttrType;
+                         Col : access C_Short;
+                         Opt : System.Address) return C_Int;
+      pragma Import (C, Wattrget, "wattr_get");
+
+      Attr : aliased C_AttrType;
+      Col  : aliased C_Short;
+      Res  : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
+                                         System.Null_Address);
+      Ch   : Attributed_Character;
+   begin
+      if Res = Curses_Ok then
+         Ch := AttrType_To_AttrChar (Attr);
+         return Ch.Attr;
+      else
+         raise Curses_Exception;
+      end if;
+   end Get_Character_Attribute;
+
+   function Get_Character_Attribute (Win : Window := Standard_Window)
+                                     return Color_Pair
+   is
+      function Wattrget (Win : Window;
+                         Atr : access C_AttrType;
+                         Col : access C_Short;
+                         Opt : System.Address) return C_Int;
+      pragma Import (C, Wattrget, "wattr_get");
+
+      Attr : aliased C_AttrType;
+      Col  : aliased C_Short;
+      Res  : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
+                                         System.Null_Address);
+      Ch   : Attributed_Character;
+   begin
+      if Res = Curses_Ok then
+         Ch := AttrType_To_AttrChar (Attr);
+         return Ch.Color;
+      else
+         raise Curses_Exception;
+      end if;
+   end Get_Character_Attribute;
+
+   procedure Set_Color (Win  : Window := Standard_Window;
+                        Pair : Color_Pair)
+   is
+      function Wset_Color (Win   : Window;
+                           Color : C_Short;
+                           Opts  : C_Void_Ptr) return C_Int;
+      pragma Import (C, Wset_Color, "wcolor_set");
+   begin
+      if Wset_Color (Win,
+                     C_Short (Pair),
+                     C_Void_Ptr (System.Null_Address)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Color;
+
+   procedure Change_Attributes
+     (Win   : Window := Standard_Window;
+      Count : Integer := -1;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Wchgat (Win   : Window;
+                       Cnt   : C_Int;
+                       Attr  : C_AttrType;
+                       Color : C_Short;
+                       Opts  : System.Address := System.Null_Address)
+                       return C_Int;
+      pragma Import (C, Wchgat, "wchgat");
+
+      Ch : constant Attributed_Character :=
+        (Ch => Character'First, Color => Color_Pair'First, Attr => Attr);
+   begin
+      if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch),
+                 C_Short (Color)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Change_Attributes;
+
+   procedure Change_Attributes
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position := Line_Position'First;
+      Column : Column_Position := Column_Position'First;
+      Count  : Integer := -1;
+      Attr   : Character_Attribute_Set := Normal_Video;
+      Color  : Color_Pair := Color_Pair'First)
+   is
+   begin
+      Move_Cursor (Win, Line, Column);
+      Change_Attributes (Win, Count, Attr, Color);
+   end Change_Attributes;
+------------------------------------------------------------------------------
+   procedure Beep
+   is
+      function Beeper return C_Int;
+      pragma Import (C, Beeper, "beep");
+   begin
+      if Beeper = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Beep;
+
+   procedure Flash_Screen
+   is
+      function Flash return C_Int;
+      pragma Import (C, Flash, "flash");
+   begin
+      if Flash = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Flash_Screen;
+------------------------------------------------------------------------------
+   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True)
+   is
+      function Cbreak return C_Int;
+      pragma Import (C, Cbreak, "cbreak");
+      function NoCbreak return C_Int;
+      pragma Import (C, NoCbreak, "nocbreak");
+
+      Err : C_Int;
+   begin
+      if SwitchOn then
+         Err := Cbreak;
+      else
+         Err := NoCbreak;
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Cbreak_Mode;
+
+   procedure Set_Raw_Mode (SwitchOn : Boolean := True)
+   is
+      function Raw return C_Int;
+      pragma Import (C, Raw, "raw");
+      function NoRaw return C_Int;
+      pragma Import (C, NoRaw, "noraw");
+
+      Err : C_Int;
+   begin
+      if SwitchOn then
+         Err := Raw;
+      else
+         Err := NoRaw;
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Raw_Mode;
+
+   procedure Set_Echo_Mode (SwitchOn : Boolean := True)
+   is
+      function Echo return C_Int;
+      pragma Import (C, Echo, "echo");
+      function NoEcho return C_Int;
+      pragma Import (C, NoEcho, "noecho");
+
+      Err : C_Int;
+   begin
+      if SwitchOn then
+         Err := Echo;
+      else
+         Err := NoEcho;
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Echo_Mode;
+
+   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
+                            SwitchOn : Boolean := True)
+   is
+      function Meta (W : Window; Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Meta, "meta");
+   begin
+      if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Meta_Mode;
+
+   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
+                              SwitchOn : Boolean := True)
+   is
+      function Keypad (W : Window; Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Keypad, "keypad");
+   begin
+      if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_KeyPad_Mode;
+
+   function Get_KeyPad_Mode (Win : Window := Standard_Window)
+                             return Boolean
+   is
+      function Is_Keypad (W : Window) return Curses_Bool;
+      pragma Import (C, Is_Keypad, "is_keypad");
+   begin
+      return (Is_Keypad (Win) /= Curses_Bool_False);
+   end Get_KeyPad_Mode;
+
+   procedure Half_Delay (Amount : Half_Delay_Amount)
+   is
+      function Halfdelay (Amount : C_Int) return C_Int;
+      pragma Import (C, Halfdelay, "halfdelay");
+   begin
+      if Halfdelay (C_Int (Amount)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Half_Delay;
+
+   procedure Set_Flush_On_Interrupt_Mode
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := True)
+   is
+      function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Intrflush, "intrflush");
+   begin
+      if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Flush_On_Interrupt_Mode;
+
+   procedure Set_Queue_Interrupt_Mode
+     (Win   : Window := Standard_Window;
+      Flush : Boolean := True)
+   is
+      procedure Qiflush;
+      pragma Import (C, Qiflush, "qiflush");
+      procedure No_Qiflush;
+      pragma Import (C, No_Qiflush, "noqiflush");
+   begin
+      if Win = Null_Window then
+         raise Curses_Exception;
+      end if;
+      if Flush then
+         Qiflush;
+      else
+         No_Qiflush;
+      end if;
+   end Set_Queue_Interrupt_Mode;
+
+   procedure Set_NoDelay_Mode
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False)
+   is
+      function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Nodelay, "nodelay");
+   begin
+      if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_NoDelay_Mode;
+
+   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
+                               Mode   : Timeout_Mode;
+                               Amount : Natural)
+   is
+      procedure Wtimeout (Win : Window; Amount : C_Int);
+      pragma Import (C, Wtimeout, "wtimeout");
+
+      Time : C_Int;
+   begin
+      case Mode is
+         when Blocking     => Time := -1;
+         when Non_Blocking => Time := 0;
+         when Delayed      =>
+            if Amount = 0 then
+               raise Constraint_Error;
+            end if;
+            Time := C_Int (Amount);
+      end case;
+      Wtimeout (Win, Time);
+   end Set_Timeout_Mode;
+
+   procedure Set_Escape_Timer_Mode
+     (Win       : Window := Standard_Window;
+      Timer_Off : Boolean := False)
+   is
+      function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Notimeout, "notimeout");
+   begin
+      if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off)))
+        = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Escape_Timer_Mode;
+
+------------------------------------------------------------------------------
+   procedure Set_NL_Mode (SwitchOn : Boolean := True)
+   is
+      function NL return C_Int;
+      pragma Import (C, NL, "nl");
+      function NoNL return C_Int;
+      pragma Import (C, NoNL, "nonl");
+
+      Err : C_Int;
+   begin
+      if SwitchOn then
+         Err := NL;
+      else
+         Err := NoNL;
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_NL_Mode;
+
+   procedure Clear_On_Next_Update
+     (Win      : Window := Standard_Window;
+      Do_Clear : Boolean := True)
+   is
+      function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int;
+      pragma Import (C, Clear_Ok, "clearok");
+   begin
+      if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Clear_On_Next_Update;
+
+   procedure Use_Insert_Delete_Line
+     (Win    : Window := Standard_Window;
+      Do_Idl : Boolean := True)
+   is
+      function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int;
+      pragma Import (C, IDL_Ok, "idlok");
+   begin
+      if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Use_Insert_Delete_Line;
+
+   procedure Use_Insert_Delete_Character
+     (Win    : Window := Standard_Window;
+      Do_Idc : Boolean := True)
+   is
+      procedure IDC_Ok (W : Window; Flag : Curses_Bool);
+      pragma Import (C, IDC_Ok, "idcok");
+   begin
+      IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc)));
+   end Use_Insert_Delete_Character;
+
+   procedure Leave_Cursor_After_Update
+     (Win      : Window := Standard_Window;
+      Do_Leave : Boolean := True)
+   is
+      function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int;
+      pragma Import (C, Leave_Ok, "leaveok");
+   begin
+      if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Leave_Cursor_After_Update;
+
+   procedure Immediate_Update_Mode
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False)
+   is
+      procedure Immedok (Win : Window; Mode : Curses_Bool);
+      pragma Import (C, Immedok, "immedok");
+   begin
+      Immedok (Win, Curses_Bool (Boolean'Pos (Mode)));
+   end Immediate_Update_Mode;
+
+   procedure Allow_Scrolling
+     (Win  : Window  := Standard_Window;
+      Mode : Boolean := False)
+   is
+      function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int;
+      pragma Import (C, Scrollok, "scrollok");
+   begin
+      if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Allow_Scrolling;
+
+   function Scrolling_Allowed (Win : Window := Standard_Window)
+                               return Boolean
+   is
+      function Is_Scroll_Ok (W : Window) return Curses_Bool;
+      pragma Import (C, Is_Scroll_Ok, "is_scrollok");
+   begin
+      return (Is_Scroll_Ok (Win) /= Curses_Bool_False);
+   end Scrolling_Allowed;
+
+   procedure Set_Scroll_Region
+     (Win         : Window := Standard_Window;
+      Top_Line    : Line_Position;
+      Bottom_Line : Line_Position)
+   is
+      function Wsetscrreg (Win : Window;
+                           Lin : C_Int;
+                           Col : C_Int) return C_Int;
+      pragma Import (C, Wsetscrreg, "wsetscrreg");
+   begin
+      if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line))
+        = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Scroll_Region;
+------------------------------------------------------------------------------
+   procedure Update_Screen
+   is
+      function Do_Update return C_Int;
+      pragma Import (C, Do_Update, "doupdate");
+   begin
+      if Do_Update = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Update_Screen;
+
+   procedure Refresh (Win : Window := Standard_Window)
+   is
+      function Wrefresh (W : Window) return C_Int;
+      pragma Import (C, Wrefresh, "wrefresh");
+   begin
+      if Wrefresh (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Refresh;
+
+   procedure Refresh_Without_Update
+     (Win : Window := Standard_Window)
+   is
+      function Wnoutrefresh (W : Window) return C_Int;
+      pragma Import (C, Wnoutrefresh, "wnoutrefresh");
+   begin
+      if Wnoutrefresh (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Refresh_Without_Update;
+
+   procedure Redraw (Win : Window := Standard_Window)
+   is
+      function Redrawwin (Win : Window) return C_Int;
+      pragma Import (C, Redrawwin, "redrawwin");
+   begin
+      if Redrawwin (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Redraw;
+
+   procedure Redraw
+     (Win        : Window := Standard_Window;
+      Begin_Line : Line_Position;
+      Line_Count : Positive)
+   is
+      function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int)
+                          return C_Int;
+      pragma Import (C, Wredrawln, "wredrawln");
+   begin
+      if Wredrawln (Win,
+                    C_Int (Begin_Line),
+                    C_Int (Line_Count)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Redraw;
+
+------------------------------------------------------------------------------
+   procedure Erase (Win : Window := Standard_Window)
+   is
+      function Werase (W : Window) return C_Int;
+      pragma Import (C, Werase, "werase");
+   begin
+      if Werase (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Erase;
+
+   procedure Clear (Win : Window := Standard_Window)
+   is
+      function Wclear (W : Window) return C_Int;
+      pragma Import (C, Wclear, "wclear");
+   begin
+      if Wclear (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Clear;
+
+   procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window)
+   is
+      function Wclearbot (W : Window) return C_Int;
+      pragma Import (C, Wclearbot, "wclrtobot");
+   begin
+      if Wclearbot (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Clear_To_End_Of_Screen;
+
+   procedure Clear_To_End_Of_Line (Win : Window := Standard_Window)
+   is
+      function Wcleareol (W : Window) return C_Int;
+      pragma Import (C, Wcleareol, "wclrtoeol");
+   begin
+      if Wcleareol (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Clear_To_End_Of_Line;
+------------------------------------------------------------------------------
+   procedure Set_Background
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character)
+   is
+      procedure WBackground (W : Window; Ch : C_Chtype);
+      pragma Import (C, WBackground, "wbkgdset");
+   begin
+      WBackground (Win, AttrChar_To_Chtype (Ch));
+   end Set_Background;
+
+   procedure Change_Background
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character)
+   is
+      function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int;
+      pragma Import (C, WChangeBkgd, "wbkgd");
+   begin
+      if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Change_Background;
+
+   function Get_Background (Win : Window := Standard_Window)
+     return Attributed_Character
+   is
+      function Wgetbkgd (Win : Window) return C_Chtype;
+      pragma Import (C, Wgetbkgd, "getbkgd");
+   begin
+      return Chtype_To_AttrChar (Wgetbkgd (Win));
+   end Get_Background;
+------------------------------------------------------------------------------
+   procedure Change_Lines_Status (Win   : Window := Standard_Window;
+                                  Start : Line_Position;
+                                  Count : Positive;
+                                  State : Boolean)
+   is
+      function Wtouchln (Win : Window;
+                         Sta : C_Int;
+                         Cnt : C_Int;
+                         Chg : C_Int) return C_Int;
+      pragma Import (C, Wtouchln, "wtouchln");
+   begin
+      if Wtouchln (Win, C_Int (Start), C_Int (Count),
+                   C_Int (Boolean'Pos (State))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Change_Lines_Status;
+
+   procedure Touch (Win : Window := Standard_Window)
+   is
+      Y : Line_Position;
+      X : Column_Position;
+   begin
+      Get_Size (Win, Y, X);
+      Change_Lines_Status (Win, 0, Positive (Y), True);
+   end Touch;
+
+   procedure Untouch (Win : Window := Standard_Window)
+   is
+      Y : Line_Position;
+      X : Column_Position;
+   begin
+      Get_Size (Win, Y, X);
+      Change_Lines_Status (Win, 0, Positive (Y), False);
+   end Untouch;
+
+   procedure Touch (Win   : Window := Standard_Window;
+                    Start : Line_Position;
+                    Count : Positive)
+   is
+   begin
+      Change_Lines_Status (Win, Start, Count, True);
+   end Touch;
+
+   function Is_Touched
+     (Win  : Window := Standard_Window;
+      Line : Line_Position) return Boolean
+   is
+      function WLineTouched (W : Window; L : C_Int) return Curses_Bool;
+      pragma Import (C, WLineTouched, "is_linetouched");
+   begin
+      if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Is_Touched;
+
+   function Is_Touched
+     (Win : Window := Standard_Window) return Boolean
+   is
+      function WWinTouched (W : Window) return Curses_Bool;
+      pragma Import (C, WWinTouched, "is_wintouched");
+   begin
+      if WWinTouched (Win) = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Is_Touched;
+------------------------------------------------------------------------------
+   procedure Copy
+     (Source_Window            : Window;
+      Destination_Window       : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position;
+      Non_Destructive_Mode     : Boolean := True)
+   is
+      function Copywin (Src : Window;
+                        Dst : Window;
+                        Str : C_Int;
+                        Slc : C_Int;
+                        Dtr : C_Int;
+                        Dlc : C_Int;
+                        Dbr : C_Int;
+                        Drc : C_Int;
+                        Ndm : C_Int) return C_Int;
+      pragma Import (C, Copywin, "copywin");
+   begin
+      if Copywin (Source_Window,
+                  Destination_Window,
+                  C_Int (Source_Top_Row),
+                  C_Int (Source_Left_Column),
+                  C_Int (Destination_Top_Row),
+                  C_Int (Destination_Left_Column),
+                  C_Int (Destination_Bottom_Row),
+                  C_Int (Destination_Right_Column),
+                  Boolean'Pos (Non_Destructive_Mode)
+                ) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Copy;
+
+   procedure Overwrite
+     (Source_Window      : Window;
+      Destination_Window : Window)
+   is
+      function Overwrite (Src : Window; Dst : Window) return C_Int;
+      pragma Import (C, Overwrite, "overwrite");
+   begin
+      if Overwrite (Source_Window, Destination_Window) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Overwrite;
+
+   procedure Overlay
+     (Source_Window      : Window;
+      Destination_Window : Window)
+   is
+      function Overlay (Src : Window; Dst : Window) return C_Int;
+      pragma Import (C, Overlay, "overlay");
+   begin
+      if Overlay (Source_Window, Destination_Window) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Overlay;
+
+------------------------------------------------------------------------------
+   procedure Insert_Delete_Lines
+     (Win   : Window := Standard_Window;
+      Lines : Integer       := 1) -- default is to insert one line above
+   is
+      function Winsdelln (W : Window; N : C_Int) return C_Int;
+      pragma Import (C, Winsdelln, "winsdelln");
+   begin
+      if Winsdelln (Win, C_Int (Lines)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Insert_Delete_Lines;
+
+   procedure Delete_Line (Win : Window := Standard_Window)
+   is
+   begin
+      Insert_Delete_Lines (Win, -1);
+   end Delete_Line;
+
+   procedure Insert_Line (Win : Window := Standard_Window)
+   is
+   begin
+      Insert_Delete_Lines (Win, 1);
+   end Insert_Line;
+------------------------------------------------------------------------------
+
+   procedure Get_Size
+     (Win               : Window := Standard_Window;
+      Number_Of_Lines   : out Line_Count;
+      Number_Of_Columns : out Column_Count)
+   is
+      function GetMaxY (W : Window) return C_Int;
+      pragma Import (C, GetMaxY, "getmaxy");
+
+      function GetMaxX (W : Window) return C_Int;
+      pragma Import (C, GetMaxX, "getmaxx");
+
+      Y : constant C_Int := GetMaxY (Win)
+                          + C_Int (Offset_XY);
+      X : constant C_Int := GetMaxX (Win)
+                          + C_Int (Offset_XY);
+   begin
+      Number_Of_Lines   := Line_Count (Y);
+      Number_Of_Columns := Column_Count (X);
+   end Get_Size;
+
+   procedure Get_Window_Position
+     (Win             : Window := Standard_Window;
+      Top_Left_Line   : out Line_Position;
+      Top_Left_Column : out Column_Position)
+   is
+      function GetBegY (W : Window) return C_Int;
+      pragma Import (C, GetBegY, "getbegy");
+
+      function GetBegX (W : Window) return C_Int;
+      pragma Import (C, GetBegX, "getbegx");
+
+      Y : constant C_Short := C_Short (GetBegY (Win));
+      X : constant C_Short := C_Short (GetBegX (Win));
+   begin
+      Top_Left_Line   := Line_Position (Y);
+      Top_Left_Column := Column_Position (X);
+   end Get_Window_Position;
+
+   procedure Get_Cursor_Position
+     (Win    :  Window := Standard_Window;
+      Line   : out Line_Position;
+      Column : out Column_Position)
+   is
+      function GetCurY (W : Window) return C_Int;
+      pragma Import (C, GetCurY, "getcury");
+
+      function GetCurX (W : Window) return C_Int;
+      pragma Import (C, GetCurX, "getcurx");
+
+      Y : constant C_Short := C_Short (GetCurY (Win));
+      X : constant C_Short := C_Short (GetCurX (Win));
+   begin
+      Line   := Line_Position (Y);
+      Column := Column_Position (X);
+   end Get_Cursor_Position;
+
+   procedure Get_Origin_Relative_To_Parent
+     (Win                :  Window;
+      Top_Left_Line      : out Line_Position;
+      Top_Left_Column    : out Column_Position;
+      Is_Not_A_Subwindow : out Boolean)
+   is
+      function GetParY (W : Window) return C_Int;
+      pragma Import (C, GetParY, "getpary");
+
+      function GetParX (W : Window) return C_Int;
+      pragma Import (C, GetParX, "getparx");
+
+      Y : constant C_Int := GetParY (Win);
+      X : constant C_Int := GetParX (Win);
+   begin
+      if Y = -1 then
+         Top_Left_Line   := Line_Position'Last;
+         Top_Left_Column := Column_Position'Last;
+         Is_Not_A_Subwindow := True;
+      else
+         Top_Left_Line   := Line_Position (Y);
+         Top_Left_Column := Column_Position (X);
+         Is_Not_A_Subwindow := False;
+      end if;
+   end Get_Origin_Relative_To_Parent;
+------------------------------------------------------------------------------
+   function New_Pad (Lines   : Line_Count;
+                     Columns : Column_Count) return Window
+   is
+      function Newpad (Lines : C_Int; Columns : C_Int) return Window;
+      pragma Import (C, Newpad, "newpad");
+
+      W : Window;
+   begin
+      W := Newpad (C_Int (Lines), C_Int (Columns));
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+      return W;
+   end New_Pad;
+
+   function Sub_Pad
+     (Pad                   : Window;
+      Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window
+   is
+      function Subpad
+        (Pad                   : Window;
+         Number_Of_Lines       : C_Int;
+         Number_Of_Columns     : C_Int;
+         First_Line_Position   : C_Int;
+         First_Column_Position : C_Int) return Window;
+      pragma Import (C, Subpad, "subpad");
+
+      W : Window;
+   begin
+      W := Subpad (Pad,
+                   C_Int (Number_Of_Lines),
+                   C_Int (Number_Of_Columns),
+                   C_Int (First_Line_Position),
+                   C_Int (First_Column_Position));
+      if W = Null_Window then
+         raise Curses_Exception;
+      end if;
+      return W;
+   end Sub_Pad;
+
+   procedure Refresh
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position)
+   is
+      function Prefresh
+        (Pad                      : Window;
+         Source_Top_Row           : C_Int;
+         Source_Left_Column       : C_Int;
+         Destination_Top_Row      : C_Int;
+         Destination_Left_Column  : C_Int;
+         Destination_Bottom_Row   : C_Int;
+         Destination_Right_Column : C_Int) return C_Int;
+      pragma Import (C, Prefresh, "prefresh");
+   begin
+      if Prefresh (Pad,
+                   C_Int (Source_Top_Row),
+                   C_Int (Source_Left_Column),
+                   C_Int (Destination_Top_Row),
+                   C_Int (Destination_Left_Column),
+                   C_Int (Destination_Bottom_Row),
+                   C_Int (Destination_Right_Column)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Refresh;
+
+   procedure Refresh_Without_Update
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position)
+   is
+      function Pnoutrefresh
+        (Pad                      : Window;
+         Source_Top_Row           : C_Int;
+         Source_Left_Column       : C_Int;
+         Destination_Top_Row      : C_Int;
+         Destination_Left_Column  : C_Int;
+         Destination_Bottom_Row   : C_Int;
+         Destination_Right_Column : C_Int) return C_Int;
+      pragma Import (C, Pnoutrefresh, "pnoutrefresh");
+   begin
+      if Pnoutrefresh (Pad,
+                       C_Int (Source_Top_Row),
+                       C_Int (Source_Left_Column),
+                       C_Int (Destination_Top_Row),
+                       C_Int (Destination_Left_Column),
+                       C_Int (Destination_Bottom_Row),
+                       C_Int (Destination_Right_Column)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Refresh_Without_Update;
+
+   procedure Add_Character_To_Pad_And_Echo_It
+     (Pad : Window;
+      Ch  : Attributed_Character)
+   is
+      function Pechochar (Pad : Window; Ch : C_Chtype)
+                          return C_Int;
+      pragma Import (C, Pechochar, "pechochar");
+   begin
+      if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Add_Character_To_Pad_And_Echo_It;
+
+   procedure Add_Character_To_Pad_And_Echo_It
+     (Pad : Window;
+      Ch  : Character)
+   is
+   begin
+      Add_Character_To_Pad_And_Echo_It
+        (Pad,
+         Attributed_Character'(Ch    => Ch,
+                               Color => Color_Pair'First,
+                               Attr  => Normal_Video));
+   end Add_Character_To_Pad_And_Echo_It;
+------------------------------------------------------------------------------
+   procedure Scroll (Win    : Window := Standard_Window;
+                     Amount : Integer := 1)
+   is
+      function Wscrl (Win : Window; N : C_Int) return C_Int;
+      pragma Import (C, Wscrl, "wscrl");
+
+   begin
+      if Wscrl (Win, C_Int (Amount)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Scroll;
+
+------------------------------------------------------------------------------
+   procedure Delete_Character (Win : Window := Standard_Window)
+   is
+      function Wdelch (Win : Window) return C_Int;
+      pragma Import (C, Wdelch, "wdelch");
+   begin
+      if Wdelch (Win) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Delete_Character;
+
+   procedure Delete_Character
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position)
+   is
+      function Mvwdelch (Win : Window;
+                         Lin : C_Int;
+                         Col : C_Int) return C_Int;
+      pragma Import (C, Mvwdelch, "mvwdelch");
+   begin
+      if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Delete_Character;
+------------------------------------------------------------------------------
+   function Peek (Win : Window := Standard_Window)
+     return Attributed_Character
+   is
+      function Winch (Win : Window) return C_Chtype;
+      pragma Import (C, Winch, "winch");
+   begin
+      return Chtype_To_AttrChar (Winch (Win));
+   end Peek;
+
+   function Peek
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position) return Attributed_Character
+   is
+      function Mvwinch (Win : Window;
+                        Lin : C_Int;
+                        Col : C_Int) return C_Chtype;
+      pragma Import (C, Mvwinch, "mvwinch");
+   begin
+      return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column)));
+   end Peek;
+------------------------------------------------------------------------------
+   procedure Insert (Win : Window := Standard_Window;
+                     Ch  : Attributed_Character)
+   is
+      function Winsch (Win : Window; Ch : C_Chtype) return C_Int;
+      pragma Import (C, Winsch, "winsch");
+   begin
+      if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Insert;
+
+   procedure Insert
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Attributed_Character)
+   is
+      function Mvwinsch (Win : Window;
+                         Lin : C_Int;
+                         Col : C_Int;
+                         Ch  : C_Chtype) return C_Int;
+      pragma Import (C, Mvwinsch, "mvwinsch");
+   begin
+      if Mvwinsch (Win,
+                   C_Int (Line),
+                   C_Int (Column),
+                   AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Insert;
+------------------------------------------------------------------------------
+   procedure Insert (Win : Window := Standard_Window;
+                     Str : String;
+                     Len : Integer := -1)
+   is
+      function Winsnstr (Win : Window;
+                         Str : char_array;
+                         Len : Integer := -1) return C_Int;
+      pragma Import (C, Winsnstr, "winsnstr");
+
+      Txt    : char_array (0 .. Str'Length);
+      Length : size_t;
+   begin
+      To_C (Str, Txt, Length);
+      if Winsnstr (Win, Txt, Len) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Insert;
+
+   procedure Insert
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Str    : String;
+      Len    : Integer := -1)
+   is
+      function Mvwinsnstr (Win    : Window;
+                           Line   : C_Int;
+                           Column : C_Int;
+                           Str    : char_array;
+                           Len    : C_Int) return C_Int;
+      pragma Import (C, Mvwinsnstr, "mvwinsnstr");
+
+      Txt    : char_array (0 .. Str'Length);
+      Length : size_t;
+   begin
+      To_C (Str, Txt, Length);
+      if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len))
+        = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Insert;
+------------------------------------------------------------------------------
+   procedure Peek (Win :  Window := Standard_Window;
+                   Str : out String;
+                   Len :  Integer := -1)
+   is
+      function Winnstr (Win : Window;
+                        Str : char_array;
+                        Len : C_Int) return C_Int;
+      pragma Import (C, Winnstr, "winnstr");
+
+      N   : Integer := Len;
+      Txt : char_array (0 .. Str'Length);
+      Cnt : Natural;
+   begin
+      if N < 0 then
+         N := Str'Length;
+      end if;
+      if N > Str'Length then
+         raise Constraint_Error;
+      end if;
+      Txt (0) := Interfaces.C.char'First;
+      if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+      To_Ada (Txt, Str, Cnt, True);
+      if Cnt < Str'Length then
+         Str ((Str'First + Cnt) .. Str'Last) := (others => ' ');
+      end if;
+   end Peek;
+
+   procedure Peek
+     (Win    :  Window := Standard_Window;
+      Line   :  Line_Position;
+      Column :  Column_Position;
+      Str    : out String;
+      Len    :  Integer := -1)
+   is
+   begin
+      Move_Cursor (Win, Line, Column);
+      Peek (Win, Str, Len);
+   end Peek;
+------------------------------------------------------------------------------
+   procedure Peek
+     (Win :  Window := Standard_Window;
+      Str : out Attributed_String;
+      Len :  Integer := -1)
+   is
+      function Winchnstr (Win : Window;
+                          Str : chtype_array;             -- out
+                          Len : C_Int) return C_Int;
+      pragma Import (C, Winchnstr, "winchnstr");
+
+      N   : Integer := Len;
+      Txt : constant chtype_array (0 .. Str'Length)
+          := (0 => Default_Character);
+      Cnt : Natural := 0;
+   begin
+      if N < 0 then
+         N := Str'Length;
+      end if;
+      if N > Str'Length then
+         raise Constraint_Error;
+      end if;
+      if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+      for To in Str'Range loop
+         exit when Txt (size_t (Cnt)) = Default_Character;
+         Str (To) := Txt (size_t (Cnt));
+         Cnt := Cnt + 1;
+      end loop;
+      if Cnt < Str'Length then
+         Str ((Str'First + Cnt) .. Str'Last) :=
+           (others => (Ch => ' ',
+                       Color => Color_Pair'First,
+                       Attr => Normal_Video));
+      end if;
+   end Peek;
+
+   procedure Peek
+     (Win    :  Window := Standard_Window;
+      Line   :  Line_Position;
+      Column :  Column_Position;
+      Str    : out Attributed_String;
+      Len    : Integer := -1)
+   is
+   begin
+      Move_Cursor (Win, Line, Column);
+      Peek (Win, Str, Len);
+   end Peek;
+------------------------------------------------------------------------------
+   procedure Get (Win :  Window := Standard_Window;
+                  Str : out String;
+                  Len :  Integer := -1)
+   is
+      function Wgetnstr (Win : Window;
+                         Str : char_array;
+                         Len : C_Int) return C_Int;
+      pragma Import (C, Wgetnstr, "wgetnstr");
+
+      N   : Integer := Len;
+      Txt : char_array (0 .. Str'Length);
+      Cnt : Natural;
+   begin
+      if N < 0 then
+         N := Str'Length;
+      end if;
+      if N > Str'Length then
+         raise Constraint_Error;
+      end if;
+      Txt (0) := Interfaces.C.char'First;
+      if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+      To_Ada (Txt, Str, Cnt, True);
+      if Cnt < Str'Length then
+         Str ((Str'First + Cnt) .. Str'Last) := (others => ' ');
+      end if;
+   end Get;
+
+   procedure Get
+     (Win    :  Window := Standard_Window;
+      Line   :  Line_Position;
+      Column :  Column_Position;
+      Str    : out String;
+      Len    :  Integer := -1)
+   is
+   begin
+      Move_Cursor (Win, Line, Column);
+      Get (Win, Str, Len);
+   end Get;
+------------------------------------------------------------------------------
+   procedure Init_Soft_Label_Keys
+     (Format : Soft_Label_Key_Format := Three_Two_Three)
+   is
+      function Slk_Init (Fmt : C_Int) return C_Int;
+      pragma Import (C, Slk_Init, "slk_init");
+   begin
+      if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Init_Soft_Label_Keys;
+
+   procedure Set_Soft_Label_Key (Label : Label_Number;
+                                 Text  : String;
+                                 Fmt   : Label_Justification := Left)
+   is
+      function Slk_Set (Label : C_Int;
+                        Txt   : char_array;
+                        Fmt   : C_Int) return C_Int;
+      pragma Import (C, Slk_Set, "slk_set");
+
+      Txt : char_array (0 .. Text'Length);
+      Len : size_t;
+   begin
+      To_C (Text, Txt, Len);
+      if Slk_Set (C_Int (Label), Txt,
+                  C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Soft_Label_Key;
+
+   procedure Refresh_Soft_Label_Keys
+   is
+      function Slk_Refresh return C_Int;
+      pragma Import (C, Slk_Refresh, "slk_refresh");
+   begin
+      if Slk_Refresh = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Refresh_Soft_Label_Keys;
+
+   procedure Refresh_Soft_Label_Keys_Without_Update
+   is
+      function Slk_Noutrefresh return C_Int;
+      pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh");
+   begin
+      if Slk_Noutrefresh = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Refresh_Soft_Label_Keys_Without_Update;
+
+   procedure Get_Soft_Label_Key (Label : Label_Number;
+                                 Text  : out String)
+   is
+      function Slk_Label (Label : C_Int) return chars_ptr;
+      pragma Import (C, Slk_Label, "slk_label");
+   begin
+      Fill_String (Slk_Label (C_Int (Label)), Text);
+   end Get_Soft_Label_Key;
+
+   function Get_Soft_Label_Key (Label : Label_Number) return String
+   is
+      function Slk_Label (Label : C_Int) return chars_ptr;
+      pragma Import (C, Slk_Label, "slk_label");
+   begin
+      return Fill_String (Slk_Label (C_Int (Label)));
+   end Get_Soft_Label_Key;
+
+   procedure Clear_Soft_Label_Keys
+   is
+      function Slk_Clear return C_Int;
+      pragma Import (C, Slk_Clear, "slk_clear");
+   begin
+      if Slk_Clear = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Clear_Soft_Label_Keys;
+
+   procedure Restore_Soft_Label_Keys
+   is
+      function Slk_Restore return C_Int;
+      pragma Import (C, Slk_Restore, "slk_restore");
+   begin
+      if Slk_Restore = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Restore_Soft_Label_Keys;
+
+   procedure Touch_Soft_Label_Keys
+   is
+      function Slk_Touch return C_Int;
+      pragma Import (C, Slk_Touch, "slk_touch");
+   begin
+      if Slk_Touch = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Touch_Soft_Label_Keys;
+
+   procedure Switch_Soft_Label_Key_Attributes
+     (Attr : Character_Attribute_Set;
+      On   : Boolean := True)
+   is
+      function Slk_Attron (Ch : C_Chtype) return C_Int;
+      pragma Import (C, Slk_Attron, "slk_attron");
+      function Slk_Attroff (Ch : C_Chtype) return C_Int;
+      pragma Import (C, Slk_Attroff, "slk_attroff");
+
+      Err : C_Int;
+      Ch  : constant Attributed_Character := (Ch    => Character'First,
+                                              Attr  => Attr,
+                                              Color => Color_Pair'First);
+   begin
+      if On then
+         Err := Slk_Attron  (AttrChar_To_Chtype (Ch));
+      else
+         Err := Slk_Attroff (AttrChar_To_Chtype (Ch));
+      end if;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Switch_Soft_Label_Key_Attributes;
+
+   procedure Set_Soft_Label_Key_Attributes
+     (Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First)
+   is
+      function Slk_Attrset (Ch : C_Chtype) return C_Int;
+      pragma Import (C, Slk_Attrset, "slk_attrset");
+
+      Ch : constant Attributed_Character := (Ch    => Character'First,
+                                             Attr  => Attr,
+                                             Color => Color);
+   begin
+      if Slk_Attrset (AttrChar_To_Chtype (Ch)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Soft_Label_Key_Attributes;
+
+   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set
+   is
+      function Slk_Attr return C_Chtype;
+      pragma Import (C, Slk_Attr, "slk_attr");
+
+      Attr : constant C_Chtype := Slk_Attr;
+   begin
+      return Chtype_To_AttrChar (Attr).Attr;
+   end Get_Soft_Label_Key_Attributes;
+
+   function Get_Soft_Label_Key_Attributes return Color_Pair
+   is
+      function Slk_Attr return C_Chtype;
+      pragma Import (C, Slk_Attr, "slk_attr");
+
+      Attr : constant C_Chtype := Slk_Attr;
+   begin
+      return Chtype_To_AttrChar (Attr).Color;
+   end Get_Soft_Label_Key_Attributes;
+
+   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair)
+   is
+      function Slk_Color (Color : C_Short) return C_Int;
+      pragma Import (C, Slk_Color, "slk_color");
+   begin
+      if Slk_Color (C_Short (Pair)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Set_Soft_Label_Key_Color;
+
+------------------------------------------------------------------------------
+   procedure Enable_Key (Key    : Special_Key_Code;
+                         Enable : Boolean := True)
+   is
+      function Keyok (Keycode : C_Int;
+                      On_Off  : Curses_Bool) return C_Int;
+      pragma Import (C, Keyok, "keyok");
+   begin
+      if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable)))
+        = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Enable_Key;
+------------------------------------------------------------------------------
+   procedure Define_Key (Definition : String;
+                         Key        : Special_Key_Code)
+   is
+      function Defkey (Def : char_array;
+                       Key : C_Int) return C_Int;
+      pragma Import (C, Defkey, "define_key");
+
+      Txt    : char_array (0 .. Definition'Length);
+      Length : size_t;
+   begin
+      To_C (Definition, Txt, Length);
+      if Defkey (Txt, C_Int (Key)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Define_Key;
+------------------------------------------------------------------------------
+   procedure Un_Control (Ch  : Attributed_Character;
+                         Str : out String)
+   is
+      function Unctrl (Ch : C_Chtype) return chars_ptr;
+      pragma Import (C, Unctrl, "unctrl");
+   begin
+      Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str);
+   end Un_Control;
+
+   function Un_Control (Ch : Attributed_Character) return String
+   is
+      function Unctrl (Ch : C_Chtype) return chars_ptr;
+      pragma Import (C, Unctrl, "unctrl");
+   begin
+      return Fill_String (Unctrl (AttrChar_To_Chtype (Ch)));
+   end Un_Control;
+
+   procedure Delay_Output (Msecs : Natural)
+   is
+      function Delayoutput (Msecs : C_Int) return C_Int;
+      pragma Import (C, Delayoutput, "delay_output");
+   begin
+      if Delayoutput (C_Int (Msecs)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Delay_Output;
+
+   procedure Flush_Input
+   is
+      function Flushinp return C_Int;
+      pragma Import (C, Flushinp, "flushinp");
+   begin
+      if Flushinp = Curses_Err then  -- docu says that never happens, but...
+         raise Curses_Exception;
+      end if;
+   end Flush_Input;
+------------------------------------------------------------------------------
+   function Baudrate return Natural
+   is
+      function Baud return C_Int;
+      pragma Import (C, Baud, "baudrate");
+   begin
+      return Natural (Baud);
+   end Baudrate;
+
+   function Erase_Character return Character
+   is
+      function Erasechar return C_Int;
+      pragma Import (C, Erasechar, "erasechar");
+   begin
+      return Character'Val (Erasechar);
+   end Erase_Character;
+
+   function Kill_Character return Character
+   is
+      function Killchar return C_Int;
+      pragma Import (C, Killchar, "killchar");
+   begin
+      return Character'Val (Killchar);
+   end Kill_Character;
+
+   function Has_Insert_Character return Boolean
+   is
+      function Has_Ic return Curses_Bool;
+      pragma Import (C, Has_Ic, "has_ic");
+   begin
+      if Has_Ic = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Has_Insert_Character;
+
+   function Has_Insert_Line return Boolean
+   is
+      function Has_Il return Curses_Bool;
+      pragma Import (C, Has_Il, "has_il");
+   begin
+      if Has_Il = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Has_Insert_Line;
+
+   function Supported_Attributes return Character_Attribute_Set
+   is
+      function Termattrs return C_Chtype;
+      pragma Import (C, Termattrs, "termattrs");
+
+      Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs);
+   begin
+      return Ch.Attr;
+   end Supported_Attributes;
+
+   procedure Long_Name (Name : out String)
+   is
+      function Longname return chars_ptr;
+      pragma Import (C, Longname, "longname");
+   begin
+      Fill_String (Longname, Name);
+   end Long_Name;
+
+   function Long_Name return String
+   is
+      function Longname return chars_ptr;
+      pragma Import (C, Longname, "longname");
+   begin
+      return Fill_String (Longname);
+   end Long_Name;
+
+   procedure Terminal_Name (Name : out String)
+   is
+      function Termname return chars_ptr;
+      pragma Import (C, Termname, "termname");
+   begin
+      Fill_String (Termname, Name);
+   end Terminal_Name;
+
+   function Terminal_Name return String
+   is
+      function Termname return chars_ptr;
+      pragma Import (C, Termname, "termname");
+   begin
+      return Fill_String (Termname);
+   end Terminal_Name;
+------------------------------------------------------------------------------
+   procedure Init_Pair (Pair : Redefinable_Color_Pair;
+                        Fore : Color_Number;
+                        Back : Color_Number)
+   is
+      function Initpair (Pair : C_Short;
+                         Fore : C_Short;
+                         Back : C_Short) return C_Int;
+      pragma Import (C, Initpair, "init_pair");
+   begin
+      if Integer (Pair) >= Number_Of_Color_Pairs then
+         raise Constraint_Error;
+      end if;
+      if Integer (Fore) >= Number_Of_Colors or else
+         Integer (Back) >= Number_Of_Colors then
+         raise Constraint_Error;
+      end if;
+      if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back))
+        = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Init_Pair;
+
+   procedure Pair_Content (Pair : Color_Pair;
+                           Fore : out Color_Number;
+                           Back : out Color_Number)
+   is
+      type C_Short_Access is access all C_Short;
+      function Paircontent (Pair : C_Short;
+                            Fp   : C_Short_Access;
+                            Bp   : C_Short_Access) return C_Int;
+      pragma Import (C, Paircontent, "pair_content");
+
+      F, B : aliased C_Short;
+   begin
+      if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then
+         raise Curses_Exception;
+      else
+         Fore := Color_Number (F);
+         Back := Color_Number (B);
+      end if;
+   end Pair_Content;
+
+   function Has_Colors return Boolean
+   is
+      function Hascolors return Curses_Bool;
+      pragma Import (C, Hascolors, "has_colors");
+   begin
+      if Hascolors = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Has_Colors;
+
+   procedure Init_Color (Color : Color_Number;
+                         Red   : RGB_Value;
+                         Green : RGB_Value;
+                         Blue  : RGB_Value)
+   is
+      function Initcolor (Col   : C_Short;
+                          Red   : C_Short;
+                          Green : C_Short;
+                          Blue  : C_Short) return C_Int;
+      pragma Import (C, Initcolor, "init_color");
+   begin
+      if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green),
+                    C_Short (Blue)) = Curses_Err then
+            raise Curses_Exception;
+      end if;
+   end Init_Color;
+
+   function Can_Change_Color return Boolean
+   is
+      function Canchangecolor return Curses_Bool;
+      pragma Import (C, Canchangecolor, "can_change_color");
+   begin
+      if Canchangecolor = Curses_Bool_False then
+         return False;
+      else
+         return True;
+      end if;
+   end Can_Change_Color;
+
+   procedure Color_Content (Color :  Color_Number;
+                            Red   : out RGB_Value;
+                            Green : out RGB_Value;
+                            Blue  : out RGB_Value)
+   is
+      type C_Short_Access is access all C_Short;
+
+      function Colorcontent (Color : C_Short; R, G, B : C_Short_Access)
+                             return C_Int;
+      pragma Import (C, Colorcontent, "color_content");
+
+      R, G, B : aliased C_Short;
+   begin
+      if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) =
+        Curses_Err then
+         raise Curses_Exception;
+      else
+         Red   := RGB_Value (R);
+         Green := RGB_Value (G);
+         Blue  := RGB_Value (B);
+      end if;
+   end Color_Content;
+
+------------------------------------------------------------------------------
+   procedure Save_Curses_Mode (Mode : Curses_Mode)
+   is
+      function Def_Prog_Mode return C_Int;
+      pragma Import (C, Def_Prog_Mode, "def_prog_mode");
+      function Def_Shell_Mode return C_Int;
+      pragma Import (C, Def_Shell_Mode, "def_shell_mode");
+
+      Err : C_Int;
+   begin
+      case Mode is
+         when Curses => Err := Def_Prog_Mode;
+         when Shell  => Err := Def_Shell_Mode;
+      end case;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Save_Curses_Mode;
+
+   procedure Reset_Curses_Mode (Mode : Curses_Mode)
+   is
+      function Reset_Prog_Mode return C_Int;
+      pragma Import (C, Reset_Prog_Mode, "reset_prog_mode");
+      function Reset_Shell_Mode return C_Int;
+      pragma Import (C, Reset_Shell_Mode, "reset_shell_mode");
+
+      Err : C_Int;
+   begin
+      case Mode is
+         when Curses => Err := Reset_Prog_Mode;
+         when Shell  => Err := Reset_Shell_Mode;
+      end case;
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Reset_Curses_Mode;
+
+   procedure Save_Terminal_State
+   is
+      function Savetty return C_Int;
+      pragma Import (C, Savetty, "savetty");
+   begin
+      if Savetty = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Save_Terminal_State;
+
+   procedure Reset_Terminal_State
+   is
+      function Resetty return C_Int;
+      pragma Import (C, Resetty, "resetty");
+   begin
+      if Resetty = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Reset_Terminal_State;
+
+   procedure Rip_Off_Lines (Lines : Integer;
+                            Proc  : Stdscr_Init_Proc)
+   is
+      function Ripoffline (Lines : C_Int;
+                           Proc  : Stdscr_Init_Proc) return C_Int;
+      pragma Import (C, Ripoffline, "_nc_ripoffline");
+   begin
+      if Ripoffline (C_Int (Lines), Proc) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Rip_Off_Lines;
+
+   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility)
+   is
+      function Curs_Set (Curs : C_Int) return C_Int;
+      pragma Import (C, Curs_Set, "curs_set");
+
+      Res : C_Int;
+   begin
+      Res := Curs_Set (Cursor_Visibility'Pos (Visibility));
+      if Res /= Curses_Err then
+         Visibility := Cursor_Visibility'Val (Res);
+      end if;
+   end Set_Cursor_Visibility;
+
+   procedure Nap_Milli_Seconds (Ms : Natural)
+   is
+      function Napms (Ms : C_Int) return C_Int;
+      pragma Import (C, Napms, "napms");
+   begin
+      if Napms (C_Int (Ms)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Nap_Milli_Seconds;
+------------------------------------------------------------------------------
+
+   function Standard_Window return Window
+   is
+      Result : Window;
+      pragma Import (C, Result, "stdscr");
+   begin
+      return Result;
+   end Standard_Window;
+
+   function Current_Window return Window
+   is
+      Result : Window;
+      pragma Import (C, Result, "curscr");
+   begin
+      return Result;
+   end Current_Window;
+
+   function Lines return Line_Count
+   is
+      Result : C_Int;
+      pragma Import (C, Result, "LINES");
+   begin
+      return Line_Count (Result);
+   end Lines;
+
+   function Columns return Column_Count
+   is
+      Result : C_Int;
+      pragma Import (C, Result, "COLS");
+   begin
+      return Column_Count (Result);
+   end Columns;
+
+   function Tab_Size return Natural
+   is
+      Result : C_Int;
+      pragma Import (C, Result, "TABSIZE");
+   begin
+      return Natural (Result);
+   end Tab_Size;
+
+   function Number_Of_Colors return Natural
+   is
+      Result : C_Int;
+      pragma Import (C, Result, "COLORS");
+   begin
+      return Natural (Result);
+   end Number_Of_Colors;
+
+   function Number_Of_Color_Pairs return Natural
+   is
+      Result : C_Int;
+      pragma Import (C, Result, "COLOR_PAIRS");
+   begin
+      return Natural (Result);
+   end Number_Of_Color_Pairs;
+
+------------------------------------------------------------------------------
+   procedure Transform_Coordinates
+     (W      : Window := Standard_Window;
+      Line   : in out Line_Position;
+      Column : in out Column_Position;
+      Dir    : Transform_Direction := From_Screen)
+   is
+      type Int_Access is access all C_Int;
+      function Transform (W    : Window;
+                          Y, X : Int_Access;
+                          Dir  : Curses_Bool) return C_Int;
+      pragma Import (C, Transform, "wmouse_trafo");
+
+      X : aliased C_Int := C_Int (Column);
+      Y : aliased C_Int := C_Int (Line);
+      D : Curses_Bool := Curses_Bool_False;
+      R : C_Int;
+   begin
+      if Dir = To_Screen then
+         D := 1;
+      end if;
+      R := Transform (W, Y'Access, X'Access, D);
+      if R = Curses_False then
+         raise Curses_Exception;
+      else
+         Line   := Line_Position (Y);
+         Column := Column_Position (X);
+      end if;
+   end Transform_Coordinates;
+------------------------------------------------------------------------------
+   procedure Use_Default_Colors is
+      function C_Use_Default_Colors return C_Int;
+      pragma Import (C, C_Use_Default_Colors, "use_default_colors");
+      Err : constant C_Int := C_Use_Default_Colors;
+   begin
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Use_Default_Colors;
+
+   procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
+                                    Back : Color_Number := Default_Color)
+   is
+      function C_Assume_Default_Colors (Fore : C_Int;
+                                        Back : C_Int) return C_Int;
+      pragma Import (C, C_Assume_Default_Colors, "assume_default_colors");
+
+      Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore),
+                                                       C_Int (Back));
+   begin
+      if Err = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Assume_Default_Colors;
+------------------------------------------------------------------------------
+   function Curses_Version return String
+   is
+      function curses_versionC return chars_ptr;
+      pragma Import (C, curses_versionC, "curses_version");
+      Result : constant chars_ptr := curses_versionC;
+   begin
+      return Fill_String (Result);
+   end Curses_Version;
+------------------------------------------------------------------------------
+   procedure Curses_Free_All is
+      procedure curses_freeall;
+      pragma Import (C, curses_freeall, "_nc_freeall");
+   begin
+      --  Use this only for testing: you cannot use curses after calling it,
+      --  so it has to be the "last" thing done before exiting the program.
+      --  This will not really free ALL of memory used by curses.  That is
+      --  because it cannot free the memory used for stdout's setbuf.  The
+      --  _nc_free_and_exit() procedure can do that, but it can be invoked
+      --  safely only from C - and again, that only as the "last" thing done
+      --  before exiting the program.
+      curses_freeall;
+   end Curses_Free_All;
+------------------------------------------------------------------------------
+   function Use_Extended_Names (Enable : Boolean) return Boolean
+   is
+      function use_extended_namesC (e : Curses_Bool) return C_Int;
+      pragma Import (C, use_extended_namesC, "use_extended_names");
+
+      Res : constant C_Int :=
+         use_extended_namesC (Curses_Bool (Boolean'Pos (Enable)));
+   begin
+      if Res = C_Int (Curses_Bool_False) then
+         return False;
+      else
+         return True;
+      end if;
+   end Use_Extended_Names;
+------------------------------------------------------------------------------
+   procedure Screen_Dump_To_File (Filename : String)
+   is
+      function scr_dump (f : char_array) return C_Int;
+      pragma Import (C, scr_dump, "scr_dump");
+      Txt    : char_array (0 .. Filename'Length);
+      Length : size_t;
+   begin
+      To_C (Filename, Txt, Length);
+      if Curses_Err = scr_dump (Txt) then
+         raise Curses_Exception;
+      end if;
+   end Screen_Dump_To_File;
+
+   procedure Screen_Restore_From_File (Filename : String)
+   is
+      function scr_restore (f : char_array) return C_Int;
+      pragma Import (C, scr_restore, "scr_restore");
+      Txt    : char_array (0 .. Filename'Length);
+      Length : size_t;
+   begin
+      To_C (Filename, Txt, Length);
+      if Curses_Err = scr_restore (Txt)  then
+         raise Curses_Exception;
+      end if;
+   end Screen_Restore_From_File;
+
+   procedure Screen_Init_From_File (Filename : String)
+   is
+      function scr_init (f : char_array) return C_Int;
+      pragma Import (C, scr_init, "scr_init");
+      Txt    : char_array (0 .. Filename'Length);
+      Length : size_t;
+   begin
+      To_C (Filename, Txt, Length);
+      if Curses_Err = scr_init (Txt) then
+         raise Curses_Exception;
+      end if;
+   end Screen_Init_From_File;
+
+   procedure Screen_Set_File (Filename : String)
+   is
+      function scr_set (f : char_array) return C_Int;
+      pragma Import (C, scr_set, "scr_set");
+      Txt    : char_array (0 .. Filename'Length);
+      Length : size_t;
+   begin
+      To_C (Filename, Txt, Length);
+      if Curses_Err = scr_set (Txt) then
+         raise Curses_Exception;
+      end if;
+   end Screen_Set_File;
+------------------------------------------------------------------------------
+   procedure Resize (Win               : Window := Standard_Window;
+                     Number_Of_Lines   : Line_Count;
+                     Number_Of_Columns : Column_Count) is
+      function wresize (win     : Window;
+                        lines   : C_Int;
+                        columns : C_Int) return C_Int;
+      pragma Import (C, wresize);
+   begin
+      if wresize (Win,
+                  C_Int (Number_Of_Lines),
+                  C_Int (Number_Of_Columns)) = Curses_Err then
+         raise Curses_Exception;
+      end if;
+   end Resize;
+------------------------------------------------------------------------------
+
+end Terminal_Interface.Curses;
+
diff --git a/doc/html/ada/terminal_interface-curses__ads.htm b/doc/html/ada/terminal_interface-curses__ads.htm new file mode 100644 index 00000000000..09750abedd7 --- /dev/null +++ b/doc/html/ada/terminal_interface-curses__ads.htm @@ -0,0 +1,1935 @@ + +terminal_interface-curses.ads + +

File : terminal_interface-curses.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                         Terminal_Interface.Curses                        --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 1998-2007,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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.42 @
+--  @Date: 2009/12/26 17:38:58 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+--  curses binding.
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System.Storage_Elements;
+with Interfaces.C;   --  We need this for some assertions.
+
+package Terminal_Interface.Curses is
+   pragma Preelaborate (Terminal_Interface.Curses);
+   pragma Linker_Options ("-lncurses");
+
+   NC_Major_Version : constant := 5; --  Major version of the library
+   NC_Minor_Version : constant := 8; --  Minor version of the library
+   NC_Version : constant String := "5.8";  --  Version of library
+
+   type Window is private;
+   Null_Window : constant Window;
+
+   type Line_Position   is new Natural; --  line coordinate
+   type Column_Position is new Natural; --  column coordinate
+
+   subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
+   --  Type to count lines. We do not allow null windows, so must be positive
+   subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
+   --  Type to count columns. We do not allow null windows, so must be positive
+
+   type Key_Code is new Integer;
+   --  That is anything including real characters, special keys and logical
+   --  request codes.
+
+   --  FIXME: The "-1" should be Curses_Err
+   subtype Real_Key_Code is Key_Code range -1 .. 8#777#;
+   --  This are the codes that potentially represent a real keystroke.
+   --  Not all codes may be possible on a specific terminal. To check the
+   --  availability of a special key, the Has_Key function is provided.
+
+   subtype Special_Key_Code is Real_Key_Code
+     range 8#400# .. Real_Key_Code'Last;
+   --  Type for a function- or special key number
+
+   subtype Normal_Key_Code is Real_Key_Code range
+     Character'Pos (Character'First) .. Character'Pos (Character'Last);
+   --  This are the codes for regular (incl. non-graphical) characters.
+
+   --  Constants for function- and special keys
+   --
+   Key_None                       : constant Special_Key_Code := 8#400#;
+   Key_Code_Yes                   : constant Special_Key_Code := 8#400#;
+   Key_Min                        : constant Special_Key_Code := 8#401#;
+   Key_Break                      : constant Special_Key_Code := 8#401#;
+   Key_Cursor_Down                : constant Special_Key_Code := 8#402#;
+   Key_Cursor_Up                  : constant Special_Key_Code := 8#403#;
+   Key_Cursor_Left                : constant Special_Key_Code := 8#404#;
+   Key_Cursor_Right               : constant Special_Key_Code := 8#405#;
+   Key_Home                       : constant Special_Key_Code := 8#406#;
+   Key_Backspace                  : constant Special_Key_Code := 8#407#;
+   Key_F0                         : constant Special_Key_Code := 8#410#;
+   Key_F1                         : constant Special_Key_Code := 8#411#;
+   Key_F2                         : constant Special_Key_Code := 8#412#;
+   Key_F3                         : constant Special_Key_Code := 8#413#;
+   Key_F4                         : constant Special_Key_Code := 8#414#;
+   Key_F5                         : constant Special_Key_Code := 8#415#;
+   Key_F6                         : constant Special_Key_Code := 8#416#;
+   Key_F7                         : constant Special_Key_Code := 8#417#;
+   Key_F8                         : constant Special_Key_Code := 8#420#;
+   Key_F9                         : constant Special_Key_Code := 8#421#;
+   Key_F10                        : constant Special_Key_Code := 8#422#;
+   Key_F11                        : constant Special_Key_Code := 8#423#;
+   Key_F12                        : constant Special_Key_Code := 8#424#;
+   Key_F13                        : constant Special_Key_Code := 8#425#;
+   Key_F14                        : constant Special_Key_Code := 8#426#;
+   Key_F15                        : constant Special_Key_Code := 8#427#;
+   Key_F16                        : constant Special_Key_Code := 8#430#;
+   Key_F17                        : constant Special_Key_Code := 8#431#;
+   Key_F18                        : constant Special_Key_Code := 8#432#;
+   Key_F19                        : constant Special_Key_Code := 8#433#;
+   Key_F20                        : constant Special_Key_Code := 8#434#;
+   Key_F21                        : constant Special_Key_Code := 8#435#;
+   Key_F22                        : constant Special_Key_Code := 8#436#;
+   Key_F23                        : constant Special_Key_Code := 8#437#;
+   Key_F24                        : constant Special_Key_Code := 8#440#;
+   Key_Delete_Line                : constant Special_Key_Code := 8#510#;
+   Key_Insert_Line                : constant Special_Key_Code := 8#511#;
+   Key_Delete_Char                : constant Special_Key_Code := 8#512#;
+   Key_Insert_Char                : constant Special_Key_Code := 8#513#;
+   Key_Exit_Insert_Mode           : constant Special_Key_Code := 8#514#;
+   Key_Clear_Screen               : constant Special_Key_Code := 8#515#;
+   Key_Clear_End_Of_Screen        : constant Special_Key_Code := 8#516#;
+   Key_Clear_End_Of_Line          : constant Special_Key_Code := 8#517#;
+   Key_Scroll_1_Forward           : constant Special_Key_Code := 8#520#;
+   Key_Scroll_1_Backward          : constant Special_Key_Code := 8#521#;
+   Key_Next_Page                  : constant Special_Key_Code := 8#522#;
+   Key_Previous_Page              : constant Special_Key_Code := 8#523#;
+   Key_Set_Tab                    : constant Special_Key_Code := 8#524#;
+   Key_Clear_Tab                  : constant Special_Key_Code := 8#525#;
+   Key_Clear_All_Tabs             : constant Special_Key_Code := 8#526#;
+   Key_Enter_Or_Send              : constant Special_Key_Code := 8#527#;
+   Key_Soft_Reset                 : constant Special_Key_Code := 8#530#;
+   Key_Reset                      : constant Special_Key_Code := 8#531#;
+   Key_Print                      : constant Special_Key_Code := 8#532#;
+   Key_Bottom                     : constant Special_Key_Code := 8#533#;
+   Key_Upper_Left_Of_Keypad       : constant Special_Key_Code := 8#534#;
+   Key_Upper_Right_Of_Keypad      : constant Special_Key_Code := 8#535#;
+   Key_Center_Of_Keypad           : constant Special_Key_Code := 8#536#;
+   Key_Lower_Left_Of_Keypad       : constant Special_Key_Code := 8#537#;
+   Key_Lower_Right_Of_Keypad      : constant Special_Key_Code := 8#540#;
+   Key_Back_Tab                   : constant Special_Key_Code := 8#541#;
+   Key_Beginning                  : constant Special_Key_Code := 8#542#;
+   Key_Cancel                     : constant Special_Key_Code := 8#543#;
+   Key_Close                      : constant Special_Key_Code := 8#544#;
+   Key_Command                    : constant Special_Key_Code := 8#545#;
+   Key_Copy                       : constant Special_Key_Code := 8#546#;
+   Key_Create                     : constant Special_Key_Code := 8#547#;
+   Key_End                        : constant Special_Key_Code := 8#550#;
+   Key_Exit                       : constant Special_Key_Code := 8#551#;
+   Key_Find                       : constant Special_Key_Code := 8#552#;
+   Key_Help                       : constant Special_Key_Code := 8#553#;
+   Key_Mark                       : constant Special_Key_Code := 8#554#;
+   Key_Message                    : constant Special_Key_Code := 8#555#;
+   Key_Move                       : constant Special_Key_Code := 8#556#;
+   Key_Next                       : constant Special_Key_Code := 8#557#;
+   Key_Open                       : constant Special_Key_Code := 8#560#;
+   Key_Options                    : constant Special_Key_Code := 8#561#;
+   Key_Previous                   : constant Special_Key_Code := 8#562#;
+   Key_Redo                       : constant Special_Key_Code := 8#563#;
+   Key_Reference                  : constant Special_Key_Code := 8#564#;
+   Key_Refresh                    : constant Special_Key_Code := 8#565#;
+   Key_Replace                    : constant Special_Key_Code := 8#566#;
+   Key_Restart                    : constant Special_Key_Code := 8#567#;
+   Key_Resume                     : constant Special_Key_Code := 8#570#;
+   Key_Save                       : constant Special_Key_Code := 8#571#;
+   Key_Shift_Begin                : constant Special_Key_Code := 8#572#;
+   Key_Shift_Cancel               : constant Special_Key_Code := 8#573#;
+   Key_Shift_Command              : constant Special_Key_Code := 8#574#;
+   Key_Shift_Copy                 : constant Special_Key_Code := 8#575#;
+   Key_Shift_Create               : constant Special_Key_Code := 8#576#;
+   Key_Shift_Delete_Char          : constant Special_Key_Code := 8#577#;
+   Key_Shift_Delete_Line          : constant Special_Key_Code := 8#600#;
+   Key_Select                     : constant Special_Key_Code := 8#601#;
+   Key_Shift_End                  : constant Special_Key_Code := 8#602#;
+   Key_Shift_Clear_End_Of_Line    : constant Special_Key_Code := 8#603#;
+   Key_Shift_Exit                 : constant Special_Key_Code := 8#604#;
+   Key_Shift_Find                 : constant Special_Key_Code := 8#605#;
+   Key_Shift_Help                 : constant Special_Key_Code := 8#606#;
+   Key_Shift_Home                 : constant Special_Key_Code := 8#607#;
+   Key_Shift_Insert_Char          : constant Special_Key_Code := 8#610#;
+   Key_Shift_Cursor_Left          : constant Special_Key_Code := 8#611#;
+   Key_Shift_Message              : constant Special_Key_Code := 8#612#;
+   Key_Shift_Move                 : constant Special_Key_Code := 8#613#;
+   Key_Shift_Next_Page            : constant Special_Key_Code := 8#614#;
+   Key_Shift_Options              : constant Special_Key_Code := 8#615#;
+   Key_Shift_Previous_Page        : constant Special_Key_Code := 8#616#;
+   Key_Shift_Print                : constant Special_Key_Code := 8#617#;
+   Key_Shift_Redo                 : constant Special_Key_Code := 8#620#;
+   Key_Shift_Replace              : constant Special_Key_Code := 8#621#;
+   Key_Shift_Cursor_Right         : constant Special_Key_Code := 8#622#;
+   Key_Shift_Resume               : constant Special_Key_Code := 8#623#;
+   Key_Shift_Save                 : constant Special_Key_Code := 8#624#;
+   Key_Shift_Suspend              : constant Special_Key_Code := 8#625#;
+   Key_Shift_Undo                 : constant Special_Key_Code := 8#626#;
+   Key_Suspend                    : constant Special_Key_Code := 8#627#;
+   Key_Undo                       : constant Special_Key_Code := 8#630#;
+   Key_Mouse                      : constant Special_Key_Code := 8#631#;
+   Key_Resize                     : constant Special_Key_Code := 8#632#;
+
+   Key_Max                        : constant Special_Key_Code
+     := Special_Key_Code'Last;
+
+   subtype User_Key_Code is Key_Code
+     range (Key_Max + 129) .. Key_Code'Last;
+   --  This is reserved for user defined key codes. The range between Key_Max
+   --  and the first user code is reserved for subsystems like menu and forms.
+
+   --  For those who like to use the original key names we produce them were
+   --  they differ from the original. Please note that they may differ in
+   --  lower/upper case.
+   KEY_DOWN         : Special_Key_Code renames Key_Cursor_Down;
+   KEY_UP           : Special_Key_Code renames Key_Cursor_Up;
+   KEY_LEFT         : Special_Key_Code renames Key_Cursor_Left;
+   KEY_RIGHT        : Special_Key_Code renames Key_Cursor_Right;
+   KEY_DL           : Special_Key_Code renames Key_Delete_Line;
+   KEY_IL           : Special_Key_Code renames Key_Insert_Line;
+   KEY_DC           : Special_Key_Code renames Key_Delete_Char;
+   KEY_IC           : Special_Key_Code renames Key_Insert_Char;
+   KEY_EIC          : Special_Key_Code renames Key_Exit_Insert_Mode;
+   KEY_CLEAR        : Special_Key_Code renames Key_Clear_Screen;
+   KEY_EOS          : Special_Key_Code renames Key_Clear_End_Of_Screen;
+   KEY_EOL          : Special_Key_Code renames Key_Clear_End_Of_Line;
+   KEY_SF           : Special_Key_Code renames Key_Scroll_1_Forward;
+   KEY_SR           : Special_Key_Code renames Key_Scroll_1_Backward;
+   KEY_NPAGE        : Special_Key_Code renames Key_Next_Page;
+   KEY_PPAGE        : Special_Key_Code renames Key_Previous_Page;
+   KEY_STAB         : Special_Key_Code renames Key_Set_Tab;
+   KEY_CTAB         : Special_Key_Code renames Key_Clear_Tab;
+   KEY_CATAB        : Special_Key_Code renames Key_Clear_All_Tabs;
+   KEY_ENTER        : Special_Key_Code renames Key_Enter_Or_Send;
+   KEY_SRESET       : Special_Key_Code renames Key_Soft_Reset;
+   KEY_LL           : Special_Key_Code renames Key_Bottom;
+   KEY_A1           : Special_Key_Code renames Key_Upper_Left_Of_Keypad;
+   KEY_A3           : Special_Key_Code renames Key_Upper_Right_Of_Keypad;
+   KEY_B2           : Special_Key_Code renames Key_Center_Of_Keypad;
+   KEY_C1           : Special_Key_Code renames Key_Lower_Left_Of_Keypad;
+   KEY_C3           : Special_Key_Code renames Key_Lower_Right_Of_Keypad;
+   KEY_BTAB         : Special_Key_Code renames Key_Back_Tab;
+   KEY_BEG          : Special_Key_Code renames Key_Beginning;
+   KEY_SBEG         : Special_Key_Code renames Key_Shift_Begin;
+   KEY_SCANCEL      : Special_Key_Code renames Key_Shift_Cancel;
+   KEY_SCOMMAND     : Special_Key_Code renames Key_Shift_Command;
+   KEY_SCOPY        : Special_Key_Code renames Key_Shift_Copy;
+   KEY_SCREATE      : Special_Key_Code renames Key_Shift_Create;
+   KEY_SDC          : Special_Key_Code renames Key_Shift_Delete_Char;
+   KEY_SDL          : Special_Key_Code renames Key_Shift_Delete_Line;
+   KEY_SEND         : Special_Key_Code renames Key_Shift_End;
+   KEY_SEOL         : Special_Key_Code renames Key_Shift_Clear_End_Of_Line;
+   KEY_SEXIT        : Special_Key_Code renames Key_Shift_Exit;
+   KEY_SFIND        : Special_Key_Code renames Key_Shift_Find;
+   KEY_SHELP        : Special_Key_Code renames Key_Shift_Help;
+   KEY_SHOME        : Special_Key_Code renames Key_Shift_Home;
+   KEY_SIC          : Special_Key_Code renames Key_Shift_Insert_Char;
+   KEY_SLEFT        : Special_Key_Code renames Key_Shift_Cursor_Left;
+   KEY_SMESSAGE     : Special_Key_Code renames Key_Shift_Message;
+   KEY_SMOVE        : Special_Key_Code renames Key_Shift_Move;
+   KEY_SNEXT        : Special_Key_Code renames Key_Shift_Next_Page;
+   KEY_SOPTIONS     : Special_Key_Code renames Key_Shift_Options;
+   KEY_SPREVIOUS    : Special_Key_Code renames Key_Shift_Previous_Page;
+   KEY_SPRINT       : Special_Key_Code renames Key_Shift_Print;
+   KEY_SREDO        : Special_Key_Code renames Key_Shift_Redo;
+   KEY_SREPLACE     : Special_Key_Code renames Key_Shift_Replace;
+   KEY_SRIGHT       : Special_Key_Code renames Key_Shift_Cursor_Right;
+   KEY_SRSUME       : Special_Key_Code renames Key_Shift_Resume;
+   KEY_SSAVE        : Special_Key_Code renames Key_Shift_Save;
+   KEY_SSUSPEND     : Special_Key_Code renames Key_Shift_Suspend;
+   KEY_SUNDO        : Special_Key_Code renames Key_Shift_Undo;
+
+------------------------------------------------------------------------------
+
+   type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
+   for Color_Number'Size use Interfaces.C.short'Size;
+   --  (n)curses uses a short for the color index
+   --  The model is, that a Color_Number is an index into an array of
+   --  (potentially) definable colors. Some of those indices are
+   --  predefined (see below), although they may not really exist.
+
+   Default_Color    : constant Color_Number := -1;
+   Black            : constant Color_Number := 0;
+   Red              : constant Color_Number := 1;
+   Green            : constant Color_Number := 2;
+   Yellow           : constant Color_Number := 3;
+   Blue             : constant Color_Number := 4;
+   Magenta          : constant Color_Number := 5;
+   Cyan             : constant Color_Number := 6;
+   White            : constant Color_Number := 7;
+
+   type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
+   for RGB_Value'Size use Interfaces.C.short'Size;
+   --  Some system may allow to redefine a color by setting RGB values.
+
+   type Color_Pair is range 0 .. 255;
+   for Color_Pair'Size use 8;
+   subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
+   --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
+   --  is fixed (Black & White). A color pair is simply a combination of
+   --  two colors described by Color_Numbers, one for the foreground and
+   --  the other for the background
+
+   type Character_Attribute_Set is
+      record
+         Stand_Out               : Boolean;
+         Under_Line              : Boolean;
+         Reverse_Video           : Boolean;
+         Blink                   : Boolean;
+         Dim_Character           : Boolean;
+         Bold_Character          : Boolean;
+         Alternate_Character_Set : Boolean;
+         Invisible_Character     : Boolean;
+         Protected_Character     : Boolean;
+         Horizontal              : Boolean;
+         Left                    : Boolean;
+         Low                     : Boolean;
+         Right                   : Boolean;
+         Top                     : Boolean;
+         Vertical                : Boolean;
+      end record;
+   pragma Convention (C, Character_Attribute_Set);
+
+   for Character_Attribute_Set use
+      record
+         Stand_Out               at 0 range  0 ..  0;
+         Under_Line              at 0 range  1 ..  1;
+         Reverse_Video           at 0 range  2 ..  2;
+         Blink                   at 0 range  3 ..  3;
+         Dim_Character           at 0 range  4 ..  4;
+         Bold_Character          at 0 range  5 ..  5;
+         Alternate_Character_Set at 0 range  6 ..  6;
+         Invisible_Character     at 0 range  7 ..  7;
+         Protected_Character     at 0 range  8 ..  8;
+         Horizontal              at 0 range  9 ..  9;
+         Left                    at 0 range 10 .. 10;
+         Low                     at 0 range 11 .. 11;
+         Right                   at 0 range 12 .. 12;
+         Top                     at 0 range 13 .. 13;
+         Vertical                at 0 range 14 .. 14;
+      end record;
+   for Character_Attribute_Set'Size use 16;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.
+   --  (n)curses uses all but the lowest 16 Bits for Attributes.
+
+   Normal_Video : constant Character_Attribute_Set := (others => False);
+
+   type Attributed_Character is
+      record
+         Attr  : Character_Attribute_Set;
+         Color : Color_Pair;
+         Ch    : Character;
+      end record;
+   pragma Convention (C, Attributed_Character);
+   --  This is the counterpart for the chtype in C.
+
+   for Attributed_Character use
+      record
+         Ch    at 0 range  0 ..  7;
+         Color at 0 range  8 .. 15;
+         Attr  at 0 range 16 .. 31;
+      end record;
+   for Attributed_Character'Size use 32;
+      --  Please note: this rep. clause is generated and may be
+      --               different on your system.
+
+   Default_Character : constant Attributed_Character
+     := (Ch    => Character'First,
+         Color => Color_Pair'First,
+         Attr  => (others => False));  --  preelaboratable Normal_Video
+
+   type Attributed_String is array (Positive range <>) of Attributed_Character;
+   pragma Pack (Attributed_String);
+   --  In this binding we allow strings of attributed characters.
+
+   ------------------
+   --  Exceptions  --
+   ------------------
+   Curses_Exception     : exception;
+   Wrong_Curses_Version : exception;
+
+   --  Those exceptions are raised by the ETI (Extended Terminal Interface)
+   --  subpackets for Menu and Forms handling.
+   --
+   Eti_System_Error    : exception;
+   Eti_Bad_Argument    : exception;
+   Eti_Posted          : exception;
+   Eti_Connected       : exception;
+   Eti_Bad_State       : exception;
+   Eti_No_Room         : exception;
+   Eti_Not_Posted      : exception;
+   Eti_Unknown_Command : exception;
+   Eti_No_Match        : exception;
+   Eti_Not_Selectable  : exception;
+   Eti_Not_Connected   : exception;
+   Eti_Request_Denied  : exception;
+   Eti_Invalid_Field   : exception;
+   Eti_Current         : exception;
+
+   --------------------------------------------------------------------------
+   --  External C variables
+   --  Conceptually even in C this are kind of constants, but they are
+   --  initialized and sometimes changed by the library routines at runtime
+   --  depending on the type of terminal. I believe the best way to model
+   --  this is to use functions.
+   --------------------------------------------------------------------------
+
+   function Lines            return Line_Count;
+   pragma Inline (Lines);
+
+   function Columns          return Column_Count;
+   pragma Inline (Columns);
+
+   function Tab_Size         return Natural;
+   pragma Inline (Tab_Size);
+
+   function Number_Of_Colors return Natural;
+   pragma Inline (Number_Of_Colors);
+
+   function Number_Of_Color_Pairs return Natural;
+   pragma Inline (Number_Of_Color_Pairs);
+
+   type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))
+        of Attributed_Character;
+   ACS_Map : C_ACS_Map;
+   pragma Import (C, ACS_Map, "acs_map");
+   --
+   --
+   --  Constants for several characters from the Alternate Character Set
+   --  You must use these constants as indices into the ACS_Map array
+   --  to get the corresponding attributed character at runtime.
+   --
+   ACS_Upper_Left_Corner    : constant Character := 'l';
+   ACS_Lower_Left_Corner    : constant Character := 'm';
+   ACS_Upper_Right_Corner   : constant Character := 'k';
+   ACS_Lower_Right_Corner   : constant Character := 'j';
+   ACS_Left_Tee             : constant Character := 't';
+   ACS_Right_Tee            : constant Character := 'u';
+   ACS_Bottom_Tee           : constant Character := 'v';
+   ACS_Top_Tee              : constant Character := 'w';
+   ACS_Horizontal_Line      : constant Character := 'q';
+   ACS_Vertical_Line        : constant Character := 'x';
+   ACS_Plus_Symbol          : constant Character := 'n';
+   ACS_Scan_Line_1          : constant Character := 'o';
+   ACS_Scan_Line_9          : constant Character := 's';
+   ACS_Diamond              : constant Character := Character'Val (96);
+   ACS_Checker_Board        : constant Character := 'a';
+   ACS_Degree               : constant Character := 'f';
+   ACS_Plus_Minus           : constant Character := 'g';
+   ACS_Bullet               : constant Character := '~';
+   ACS_Left_Arrow           : constant Character := ',';
+   ACS_Right_Arrow          : constant Character := '+';
+   ACS_Down_Arrow           : constant Character := '.';
+   ACS_Up_Arrow             : constant Character := '-';
+   ACS_Board_Of_Squares     : constant Character := 'h';
+   ACS_Lantern              : constant Character := 'i';
+   ACS_Solid_Block          : constant Character := '0';
+   ACS_Scan_Line_3          : constant Character := 'p';
+   ACS_Scan_Line_7          : constant Character := 'r';
+   ACS_Less_Or_Equal        : constant Character := 'y';
+   ACS_Greater_Or_Equal     : constant Character := 'z';
+   ACS_PI                   : constant Character := '{';
+   ACS_Not_Equal            : constant Character := '|';
+   ACS_Sterling             : constant Character := '}';
+
+   --  |=====================================================================
+   --  | Man page curs_initscr.3x
+   --  |=====================================================================
+   --  | Not implemented: newterm, set_term, delscreen
+
+   --  #1A NAME="AFU_1"#2|
+   function Standard_Window return Window;
+   --  AKA: stdscr
+   pragma Inline (Standard_Window);
+
+   --  #1A NAME="AFU_2"#2|
+   function Current_Window return Window;
+   --  AKA: curscr
+   pragma Inline (Current_Window);
+
+   --  #1A NAME="AFU_3"#2|
+   procedure Init_Screen;
+
+   --  #1A NAME="AFU_4"#2|
+   procedure Init_Windows renames Init_Screen;
+   --  AKA: initscr()
+   pragma Inline (Init_Screen);
+   --  pragma Inline (Init_Windows);
+
+   --  #1A NAME="AFU_5"#2|
+   procedure End_Windows;
+   --  AKA: endwin()
+   procedure End_Screen renames End_Windows;
+   pragma Inline (End_Windows);
+   --  pragma Inline (End_Screen);
+
+   --  #1A NAME="AFU_6"#2|
+   function Is_End_Window return Boolean;
+   --  AKA: isendwin()
+   pragma Inline (Is_End_Window);
+
+   --  |=====================================================================
+   --  | Man page curs_move.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_7"#2|
+   procedure Move_Cursor (Win    : Window := Standard_Window;
+                          Line   : Line_Position;
+                          Column : Column_Position);
+   --  AKA: wmove()
+   --  AKA: move()
+   pragma Inline (Move_Cursor);
+
+   --  |=====================================================================
+   --  | Man page curs_addch.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_8"#2|
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Attributed_Character);
+   --  AKA: waddch()
+   --  AKA: addch()
+
+   procedure Add (Win : Window := Standard_Window;
+                  Ch  : Character);
+   --  Add a single character at the current logical cursor position to
+   --  the window. Use the current windows attributes.
+
+   --  #1A NAME="AFU_9"#2|
+   procedure Add
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Attributed_Character);
+   --  AKA: mvwaddch()
+   --  AKA: mvaddch()
+
+   procedure Add
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position;
+      Ch     : Character);
+   --  Move to the position and add a single character into the window
+   --  There are more Add routines, so the Inline pragma follows later
+
+   --  #1A NAME="AFU_10"#2|
+   procedure Add_With_Immediate_Echo
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character);
+   --  AKA: wechochar()
+   --  AKA: echochar()
+
+   procedure Add_With_Immediate_Echo
+     (Win : Window := Standard_Window;
+      Ch  : Character);
+   --  Add a character and do an immediate refresh of the screen.
+   pragma Inline (Add_With_Immediate_Echo);
+
+   --  |=====================================================================
+   --  | Man page curs_window.3x
+   --  |=====================================================================
+   --  Not Implemented: wcursyncup
+
+   --  #1A NAME="AFU_11"#2|
+   function Create
+     (Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window;
+   --  Not Implemented: Default Number_Of_Lines, Number_Of_Columns
+   --  the C version lets them be 0, see the man page.
+   --  AKA: newwin()
+   pragma Inline (Create);
+
+   function New_Window
+     (Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window
+     renames Create;
+   --  pragma Inline (New_Window);
+
+   --  #1A NAME="AFU_12"#2|
+   procedure Delete (Win : in out Window);
+   --  AKA: delwin()
+   --  Reset Win to Null_Window
+   pragma Inline (Delete);
+
+   --  #1A NAME="AFU_13"#2|
+   function Sub_Window
+     (Win                   : Window := Standard_Window;
+      Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window;
+   --  AKA: subwin()
+   pragma Inline (Sub_Window);
+
+   --  #1A NAME="AFU_14"#2|
+   function Derived_Window
+     (Win                   : Window := Standard_Window;
+      Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window;
+   --  AKA: derwin()
+   pragma Inline (Derived_Window);
+
+   --  #1A NAME="AFU_15"#2|
+   function Duplicate (Win : Window) return Window;
+   --  AKA: dupwin()
+   pragma Inline (Duplicate);
+
+   --  #1A NAME="AFU_16"#2|
+   procedure Move_Window (Win    : Window;
+                          Line   : Line_Position;
+                          Column : Column_Position);
+   --  AKA: mvwin()
+   pragma Inline (Move_Window);
+
+   --  #1A NAME="AFU_17"#2|
+   procedure Move_Derived_Window (Win    : Window;
+                                  Line   : Line_Position;
+                                  Column : Column_Position);
+   --  AKA: mvderwin()
+   pragma Inline (Move_Derived_Window);
+
+   --  #1A NAME="AFU_18"#2|
+   procedure Synchronize_Upwards (Win : Window);
+   --  AKA: wsyncup()
+   pragma Import (C, Synchronize_Upwards, "wsyncup");
+
+   --  #1A NAME="AFU_19"#2|
+   procedure Synchronize_Downwards (Win : Window);
+   --  AKA: wsyncdown()
+   pragma Import (C, Synchronize_Downwards, "wsyncdown");
+
+   --  #1A NAME="AFU_20"#2|
+   procedure Set_Synch_Mode (Win  : Window := Standard_Window;
+                             Mode : Boolean := False);
+   --  AKA: syncok()
+   pragma Inline (Set_Synch_Mode);
+
+   --  |=====================================================================
+   --  | Man page curs_addstr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_21"#2|
+   procedure Add (Win : Window := Standard_Window;
+                  Str : String;
+                  Len : Integer := -1);
+   --  AKA: waddnstr()
+   --  AKA: waddstr()
+   --  AKA: addnstr()
+   --  AKA: addstr()
+
+   --  #1A NAME="AFU_22"#2|
+   procedure Add (Win    : Window := Standard_Window;
+                  Line   : Line_Position;
+                  Column : Column_Position;
+                  Str    : String;
+                  Len    : Integer := -1);
+   --  AKA: mvwaddnstr()
+   --  AKA: mvwaddstr()
+   --  AKA: mvaddnstr()
+   --  AKA: mvaddstr()
+
+   --  |=====================================================================
+   --  | Man page curs_addchstr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_23"#2|
+   procedure Add (Win : Window := Standard_Window;
+                  Str : Attributed_String;
+                  Len : Integer := -1);
+   --  AKA: waddchnstr()
+   --  AKA: waddchstr()
+   --  AKA: addchnstr()
+   --  AKA: addchstr()
+
+   --  #1A NAME="AFU_24"#2|
+   procedure Add (Win    : Window := Standard_Window;
+                  Line   : Line_Position;
+                  Column : Column_Position;
+                  Str    : Attributed_String;
+                  Len    : Integer := -1);
+   --  AKA: mvwaddchnstr()
+   --  AKA: mvwaddchstr()
+   --  AKA: mvaddchnstr()
+   --  AKA: mvaddchstr()
+   pragma Inline (Add);
+
+   --  |=====================================================================
+   --  | Man page curs_border.3x
+   --  |=====================================================================
+   --  | Not implemented: mvhline,  mvwhline, mvvline, mvwvline
+   --  | use Move_Cursor then Horizontal_Line or Vertical_Line
+
+   --  #1A NAME="AFU_25"#2|
+   procedure Border
+     (Win                       : Window := Standard_Window;
+      Left_Side_Symbol          : Attributed_Character := Default_Character;
+      Right_Side_Symbol         : Attributed_Character := Default_Character;
+      Top_Side_Symbol           : Attributed_Character := Default_Character;
+      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
+      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
+      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
+      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character
+     );
+   --  AKA: wborder()
+   --  AKA: border()
+   pragma Inline (Border);
+
+   --  #1A NAME="AFU_26"#2|
+   procedure Box
+     (Win               : Window := Standard_Window;
+      Vertical_Symbol   : Attributed_Character := Default_Character;
+      Horizontal_Symbol : Attributed_Character := Default_Character);
+   --  AKA: box()
+   pragma Inline (Box);
+
+   --  #1A NAME="AFU_27"#2|
+   procedure Horizontal_Line
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character);
+   --  AKA: whline()
+   --  AKA: hline()
+   pragma Inline (Horizontal_Line);
+
+   --  #1A NAME="AFU_28"#2|
+   procedure Vertical_Line
+     (Win         : Window := Standard_Window;
+      Line_Size   : Natural;
+      Line_Symbol : Attributed_Character := Default_Character);
+   --  AKA: wvline()
+   --  AKA: vline()
+   pragma Inline (Vertical_Line);
+
+   --  |=====================================================================
+   --  | Man page curs_getch.3x
+   --  |=====================================================================
+   --  Not implemented: mvgetch, mvwgetch
+
+   --  #1A NAME="AFU_29"#2|
+   function Get_Keystroke (Win : Window := Standard_Window)
+                           return Real_Key_Code;
+   --  AKA: wgetch()
+   --  AKA: getch()
+   --  Get a character from the keyboard and echo it - if enabled - to the
+   --  window.
+   --  If for any reason (i.e. a timeout) we couldn't get a character the
+   --  returned keycode is Key_None.
+   pragma Inline (Get_Keystroke);
+
+   --  #1A NAME="AFU_30"#2|
+   procedure Undo_Keystroke (Key : Real_Key_Code);
+   --  AKA: ungetch()
+   pragma Inline (Undo_Keystroke);
+
+   --  #1A NAME="AFU_31"#2|
+   function Has_Key (Key : Special_Key_Code) return Boolean;
+   --  AKA: has_key()
+   pragma Inline (Has_Key);
+
+   --  |
+   --  | Some helper functions
+   --  |
+   function Is_Function_Key (Key : Special_Key_Code) return Boolean;
+   --  Return True if the Key is a function key (i.e. one of F0 .. F63)
+   pragma Inline (Is_Function_Key);
+
+   subtype Function_Key_Number is Integer range 0 .. 63;
+   --  (n)curses allows for 64 function keys.
+
+   function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
+   --  Return the number of the function key. If the code is not a
+   --  function key, a CONSTRAINT_ERROR will be raised.
+   pragma Inline (Function_Key);
+
+   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
+   --  Return the key code for a given function-key number.
+   pragma Inline (Function_Key_Code);
+
+   --  |=====================================================================
+   --  | Man page curs_attr.3x
+   --  |=====================================================================
+   --  | Not implemented attr_off,  wattr_off,
+   --  |  attr_on, wattr_on, attr_set, wattr_set
+
+   --  PAIR_NUMBER
+   --  PAIR_NUMBER(c) is the same as c.Color
+
+   --  #1A NAME="AFU_32"#2|
+   procedure Standout (Win : Window  := Standard_Window;
+                       On  : Boolean := True);
+   --  AKA: wstandout()
+   --  AKA: wstandend()
+
+   --  #1A NAME="AFU_33"#2|
+   procedure Switch_Character_Attribute
+     (Win  : Window := Standard_Window;
+      Attr : Character_Attribute_Set := Normal_Video;
+      On   : Boolean := True); --  if False we switch Off.
+   --  Switches those Attributes set to true in the list.
+   --  AKA: wattron()
+   --  AKA: wattroff()
+   --  AKA: attron()
+   --  AKA: attroff()
+
+   --  #1A NAME="AFU_34"#2|
+   procedure Set_Character_Attributes
+     (Win   : Window := Standard_Window;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: wattrset()
+   --  AKA: attrset()
+   pragma Inline (Set_Character_Attributes);
+
+   --  #1A NAME="AFU_35"#2|
+   function Get_Character_Attribute
+     (Win : Window := Standard_Window) return Character_Attribute_Set;
+   --  AKA: wattr_get()
+   --  AKA: attr_get()
+
+   --  #1A NAME="AFU_36"#2|
+   function Get_Character_Attribute
+     (Win : Window := Standard_Window) return Color_Pair;
+   --  AKA: wattr_get()
+   pragma Inline (Get_Character_Attribute);
+
+   --  #1A NAME="AFU_37"#2|
+   procedure Set_Color (Win  : Window := Standard_Window;
+                        Pair : Color_Pair);
+   --  AKA: wcolor_set()
+   --  AKA: color_set()
+   pragma Inline (Set_Color);
+
+   --  #1A NAME="AFU_38"#2|
+   procedure Change_Attributes
+     (Win   : Window := Standard_Window;
+      Count : Integer := -1;
+      Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: wchgat()
+   --  AKA: chgat()
+
+   --  #1A NAME="AFU_39"#2|
+   procedure Change_Attributes
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position := Line_Position'First;
+      Column : Column_Position := Column_Position'First;
+      Count  : Integer := -1;
+      Attr   : Character_Attribute_Set := Normal_Video;
+      Color  : Color_Pair := Color_Pair'First);
+   --  AKA: mvwchgat()
+   --  AKA: mvchgat()
+   pragma Inline (Change_Attributes);
+
+   --  |=====================================================================
+   --  | Man page curs_beep.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_40"#2|
+   procedure Beep;
+   --  AKA: beep()
+   pragma Inline (Beep);
+
+   --  #1A NAME="AFU_41"#2|
+   procedure Flash_Screen;
+   --  AKA: flash()
+   pragma Inline (Flash_Screen);
+
+   --  |=====================================================================
+   --  | Man page curs_inopts.3x
+   --  |=====================================================================
+
+   --  | Not implemented : typeahead
+   --
+   --  #1A NAME="AFU_42"#2|
+   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True);
+   --  AKA: cbreak()
+   --  AKA: nocbreak()
+   pragma Inline (Set_Cbreak_Mode);
+
+   --  #1A NAME="AFU_43"#2|
+   procedure Set_Raw_Mode (SwitchOn : Boolean := True);
+   --  AKA: raw()
+   --  AKA: noraw()
+   pragma Inline (Set_Raw_Mode);
+
+   --  #1A NAME="AFU_44"#2|
+   procedure Set_Echo_Mode (SwitchOn : Boolean := True);
+   --  AKA: echo()
+   --  AKA: noecho()
+   pragma Inline (Set_Echo_Mode);
+
+   --  #1A NAME="AFU_45"#2|
+   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
+                            SwitchOn : Boolean := True);
+   --  AKA: meta()
+   pragma Inline (Set_Meta_Mode);
+
+   --  #1A NAME="AFU_46"#2|
+   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
+                              SwitchOn : Boolean := True);
+   --  AKA: keypad()
+   pragma Inline (Set_KeyPad_Mode);
+
+   function Get_KeyPad_Mode (Win : Window := Standard_Window)
+                             return Boolean;
+   --  This has no pendant in C. There you've to look into the WINDOWS
+   --  structure to get the value. Bad practice, not repeated in Ada.
+
+   type Half_Delay_Amount is range 1 .. 255;
+
+   --  #1A NAME="AFU_47"#2|
+   procedure Half_Delay (Amount : Half_Delay_Amount);
+   --  AKA: halfdelay()
+   pragma Inline (Half_Delay);
+
+   --  #1A NAME="AFU_48"#2|
+   procedure Set_Flush_On_Interrupt_Mode
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := True);
+   --  AKA: intrflush()
+   pragma Inline (Set_Flush_On_Interrupt_Mode);
+
+   --  #1A NAME="AFU_49"#2|
+   procedure Set_Queue_Interrupt_Mode
+     (Win   : Window := Standard_Window;
+      Flush : Boolean := True);
+   --  AKA: qiflush()
+   --  AKA: noqiflush()
+   pragma Inline (Set_Queue_Interrupt_Mode);
+
+   --  #1A NAME="AFU_50"#2|
+   procedure Set_NoDelay_Mode
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False);
+   --  AKA: nodelay()
+   pragma Inline (Set_NoDelay_Mode);
+
+   type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
+
+   --  #1A NAME="AFU_51"#2|
+   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
+                               Mode   : Timeout_Mode;
+                               Amount : Natural); --  in Milliseconds
+   --  AKA: wtimeout()
+   --  AKA: timeout()
+   --  Instead of overloading the semantic of the sign of amount, we
+   --  introduce the Timeout_Mode parameter. This should improve
+   --  readability. For Blocking and Non_Blocking, the Amount is not
+   --  evaluated.
+   --  We don't inline this procedure.
+
+   --  #1A NAME="AFU_52"#2|
+   procedure Set_Escape_Timer_Mode
+     (Win       : Window := Standard_Window;
+      Timer_Off : Boolean := False);
+   --  AKA: notimeout()
+   pragma Inline (Set_Escape_Timer_Mode);
+
+   --  |=====================================================================
+   --  | Man page curs_outopts.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_53"#2|
+   procedure Set_NL_Mode (SwitchOn : Boolean := True);
+   --  AKA: nl()
+   --  AKA: nonl()
+   pragma Inline (Set_NL_Mode);
+
+   --  #1A NAME="AFU_54"#2|
+   procedure Clear_On_Next_Update
+     (Win      : Window := Standard_Window;
+      Do_Clear : Boolean := True);
+   --  AKA: clearok()
+   pragma Inline (Clear_On_Next_Update);
+
+   --  #1A NAME="AFU_55"#2|
+   procedure Use_Insert_Delete_Line
+     (Win    : Window := Standard_Window;
+      Do_Idl : Boolean := True);
+   --  AKA: idlok()
+   pragma Inline (Use_Insert_Delete_Line);
+
+   --  #1A NAME="AFU_56"#2|
+   procedure Use_Insert_Delete_Character
+     (Win    : Window := Standard_Window;
+      Do_Idc : Boolean := True);
+   --  AKA: idcok()
+   pragma Inline (Use_Insert_Delete_Character);
+
+   --  #1A NAME="AFU_57"#2|
+   procedure Leave_Cursor_After_Update
+     (Win      : Window := Standard_Window;
+      Do_Leave : Boolean := True);
+   --  AKA: leaveok()
+   pragma Inline (Leave_Cursor_After_Update);
+
+   --  #1A NAME="AFU_58"#2|
+   procedure Immediate_Update_Mode
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False);
+   --  AKA: immedok()
+   pragma Inline (Immediate_Update_Mode);
+
+   --  #1A NAME="AFU_59"#2|
+   procedure Allow_Scrolling
+     (Win  : Window := Standard_Window;
+      Mode : Boolean := False);
+   --  AKA: scrollok()
+   pragma Inline (Allow_Scrolling);
+
+   function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
+   --  There is no such function in the C interface.
+   pragma Inline (Scrolling_Allowed);
+
+   --  #1A NAME="AFU_60"#2|
+   procedure Set_Scroll_Region
+     (Win         : Window := Standard_Window;
+      Top_Line    : Line_Position;
+      Bottom_Line : Line_Position);
+   --  AKA: wsetscrreg()
+   --  AKA: setscrreg()
+   pragma Inline (Set_Scroll_Region);
+
+   --  |=====================================================================
+   --  | Man page curs_refresh.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_61"#2|
+   procedure Update_Screen;
+   --  AKA: doupdate()
+   pragma Inline (Update_Screen);
+
+   --  #1A NAME="AFU_62"#2|
+   procedure Refresh (Win : Window := Standard_Window);
+   --  AKA: wrefresh()
+   --  There is an overloaded Refresh for Pads.
+   --  The Inline pragma appears there
+   --  AKA: refresh()
+
+   --  #1A NAME="AFU_63"#2|
+   procedure Refresh_Without_Update
+     (Win : Window := Standard_Window);
+   --  AKA: wnoutrefresh()
+   --  There is an overloaded Refresh_Without_Update for Pads.
+   --  The Inline pragma appears there
+
+   --  #1A NAME="AFU_64"#2|
+   procedure Redraw (Win : Window := Standard_Window);
+   --  AKA: redrawwin()
+
+   --  #1A NAME="AFU_65"#2|
+   procedure Redraw (Win        : Window := Standard_Window;
+                     Begin_Line : Line_Position;
+                     Line_Count : Positive);
+   --  AKA: wredrawln()
+   pragma Inline (Redraw);
+
+   --  |=====================================================================
+   --  | Man page curs_clear.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_66"#2|
+   procedure Erase (Win : Window := Standard_Window);
+   --  AKA: werase()
+   --  AKA: erase()
+   pragma Inline (Erase);
+
+   --  #1A NAME="AFU_67"#2|
+   procedure Clear
+     (Win : Window := Standard_Window);
+   --  AKA: wclear()
+   --  AKA: clear()
+   pragma Inline (Clear);
+
+   --  #1A NAME="AFU_68"#2|
+   procedure Clear_To_End_Of_Screen
+     (Win : Window := Standard_Window);
+   --  AKA: wclrtobot()
+   --  AKA: clrtobot()
+   pragma Inline (Clear_To_End_Of_Screen);
+
+   --  #1A NAME="AFU_69"#2|
+   procedure Clear_To_End_Of_Line
+     (Win : Window := Standard_Window);
+   --  AKA: wclrtoeol()
+   --  AKA: clrtoeol()
+   pragma Inline (Clear_To_End_Of_Line);
+
+   --  |=====================================================================
+   --  | Man page curs_bkgd.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_70"#2|
+   --  TODO: we could have Set_Background(Window; Character_Attribute_Set)
+   --  because in C it is common to see bkgdset(A_BOLD) or
+   --  bkgdset(COLOR_PAIR(n))
+   procedure Set_Background
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character);
+   --  AKA: wbkgdset()
+   --  AKA: bkgdset()
+   pragma Inline (Set_Background);
+
+   --  #1A NAME="AFU_71"#2|
+   procedure Change_Background
+     (Win : Window := Standard_Window;
+      Ch  : Attributed_Character);
+   --  AKA: wbkgd()
+   --  AKA: bkgd()
+   pragma Inline (Change_Background);
+
+   --  #1A NAME="AFU_72"#2|
+   --  ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
+   function Get_Background (Win : Window := Standard_Window)
+     return Attributed_Character;
+   --  AKA: wbkgdget()
+   --  AKA: bkgdget()
+   pragma Inline (Get_Background);
+
+   --  |=====================================================================
+   --  | Man page curs_touch.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_73"#2|
+   procedure Untouch (Win : Window := Standard_Window);
+   --  AKA: untouchwin()
+   pragma Inline (Untouch);
+
+   --  #1A NAME="AFU_74"#2|
+   procedure Touch (Win : Window := Standard_Window);
+   --  AKA: touchwin()
+
+   --  #1A NAME="AFU_75"#2|
+   procedure Touch (Win   : Window := Standard_Window;
+                    Start : Line_Position;
+                    Count : Positive);
+   --  AKA: touchline()
+   pragma Inline (Touch);
+
+   --  #1A NAME="AFU_76"#2|
+   procedure Change_Lines_Status (Win   : Window := Standard_Window;
+                                  Start : Line_Position;
+                                  Count : Positive;
+                                  State : Boolean);
+   --  AKA: wtouchln()
+   pragma Inline (Change_Lines_Status);
+
+   --  #1A NAME="AFU_77"#2|
+   function Is_Touched (Win  : Window := Standard_Window;
+                        Line : Line_Position) return Boolean;
+   --  AKA: is_linetouched()
+
+   --  #1A NAME="AFU_78"#2|
+   function Is_Touched (Win : Window := Standard_Window) return Boolean;
+   --  AKA: is_wintouched()
+   pragma Inline (Is_Touched);
+
+   --  |=====================================================================
+   --  | Man page curs_overlay.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_79"#2|
+   procedure Copy
+     (Source_Window            : Window;
+      Destination_Window       : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position;
+      Non_Destructive_Mode     : Boolean := True);
+   --  AKA: copywin()
+   pragma Inline (Copy);
+
+   --  #1A NAME="AFU_80"#2|
+   procedure Overwrite (Source_Window      : Window;
+                        Destination_Window : Window);
+   --  AKA: overwrite()
+   pragma Inline (Overwrite);
+
+   --  #1A NAME="AFU_81"#2|
+   procedure Overlay (Source_Window      : Window;
+                      Destination_Window : Window);
+   --  AKA: overlay()
+   pragma Inline (Overlay);
+
+   --  |=====================================================================
+   --  | Man page curs_deleteln.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_82"#2|
+   procedure Insert_Delete_Lines
+     (Win   : Window  := Standard_Window;
+      Lines : Integer := 1); --  default is to insert one line above
+   --  AKA: winsdelln()
+   --  AKA: insdelln()
+   pragma Inline (Insert_Delete_Lines);
+
+   --  #1A NAME="AFU_83"#2|
+   procedure Delete_Line (Win : Window := Standard_Window);
+   --  AKA: wdeleteln()
+   --  AKA: deleteln()
+   pragma Inline (Delete_Line);
+
+   --  #1A NAME="AFU_84"#2|
+   procedure Insert_Line (Win : Window := Standard_Window);
+   --  AKA: winsertln()
+   --  AKA: insertln()
+   pragma Inline (Insert_Line);
+
+   --  |=====================================================================
+   --  | Man page curs_getyx.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_85"#2|
+   procedure Get_Size
+     (Win               : Window := Standard_Window;
+      Number_Of_Lines   : out Line_Count;
+      Number_Of_Columns : out Column_Count);
+   --  AKA: getmaxyx()
+   pragma Inline (Get_Size);
+
+   --  #1A NAME="AFU_86"#2|
+   procedure Get_Window_Position
+     (Win             : Window := Standard_Window;
+      Top_Left_Line   : out Line_Position;
+      Top_Left_Column : out Column_Position);
+   --  AKA: getbegyx()
+   pragma Inline (Get_Window_Position);
+
+   --  #1A NAME="AFU_87"#2|
+   procedure Get_Cursor_Position
+     (Win    : Window := Standard_Window;
+      Line   : out Line_Position;
+      Column : out Column_Position);
+   --  AKA: getyx()
+   pragma Inline (Get_Cursor_Position);
+
+   --  #1A NAME="AFU_88"#2|
+   procedure Get_Origin_Relative_To_Parent
+     (Win                : Window;
+      Top_Left_Line      : out Line_Position;
+      Top_Left_Column    : out Column_Position;
+      Is_Not_A_Subwindow : out Boolean);
+   --  AKA: getparyx()
+   --  Instead of placing -1 in the coordinates as return, we use a boolean
+   --  to return the info that the window has no parent.
+   pragma Inline (Get_Origin_Relative_To_Parent);
+
+   --  |=====================================================================
+   --  | Man page curs_pad.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_89"#2|
+   function New_Pad (Lines   : Line_Count;
+                     Columns : Column_Count) return Window;
+   --  AKA: newpad()
+   pragma Inline (New_Pad);
+
+   --  #1A NAME="AFU_90"#2|
+   function Sub_Pad
+     (Pad                   : Window;
+      Number_Of_Lines       : Line_Count;
+      Number_Of_Columns     : Column_Count;
+      First_Line_Position   : Line_Position;
+      First_Column_Position : Column_Position) return Window;
+   --  AKA: subpad()
+   pragma Inline (Sub_Pad);
+
+   --  #1A NAME="AFU_91"#2|
+   procedure Refresh
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position);
+   --  AKA: prefresh()
+   pragma Inline (Refresh);
+
+   --  #1A NAME="AFU_92"#2|
+   procedure Refresh_Without_Update
+     (Pad                      : Window;
+      Source_Top_Row           : Line_Position;
+      Source_Left_Column       : Column_Position;
+      Destination_Top_Row      : Line_Position;
+      Destination_Left_Column  : Column_Position;
+      Destination_Bottom_Row   : Line_Position;
+      Destination_Right_Column : Column_Position);
+   --  AKA: pnoutrefresh()
+   pragma Inline (Refresh_Without_Update);
+
+   --  #1A NAME="AFU_93"#2|
+   procedure Add_Character_To_Pad_And_Echo_It
+     (Pad : Window;
+      Ch  : Attributed_Character);
+   --  AKA: pechochar()
+
+   procedure Add_Character_To_Pad_And_Echo_It
+     (Pad : Window;
+      Ch  : Character);
+   pragma Inline (Add_Character_To_Pad_And_Echo_It);
+
+   --  |=====================================================================
+   --  | Man page curs_scroll.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_94"#2|
+   procedure Scroll (Win    : Window  := Standard_Window;
+                     Amount : Integer := 1);
+   --  AKA: wscrl()
+   --  AKA: scroll()
+   --  AKA: scrl()
+   pragma Inline (Scroll);
+
+   --  |=====================================================================
+   --  | Man page curs_delch.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_95"#2|
+   procedure Delete_Character (Win : Window := Standard_Window);
+   --  AKA: wdelch()
+   --  AKA: delch()
+
+   --  #1A NAME="AFU_96"#2|
+   procedure Delete_Character
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position);
+   --  AKA: mvwdelch()
+   --  AKA: mvdelch()
+   pragma Inline (Delete_Character);
+
+   --  |=====================================================================
+   --  | Man page curs_inch.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_97"#2|
+   function Peek (Win : Window := Standard_Window)
+     return Attributed_Character;
+   --  AKA: inch()
+   --  AKA: winch()
+
+   --  #1A NAME="AFU_98"#2|
+   function Peek
+     (Win    : Window := Standard_Window;
+      Line   : Line_Position;
+      Column : Column_Position) return Attributed_Character;
+   --  AKA: mvwinch()
+   --  AKA: mvinch()
+   --  More Peek's follow, pragma Inline appears later.
+
+   --  |=====================================================================
+   --  | Man page curs_insch.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_99"#2|
+   procedure Insert (Win : Window := Standard_Window;
+                     Ch  : Attributed_Character);
+   --  AKA: winsch()
+   --  AKA: insch()
+
+   --  #1A NAME="AFU_100"#2|
+   procedure Insert (Win    : Window := Standard_Window;
+                     Line   : Line_Position;
+                     Column : Column_Position;
+                     Ch     : Attributed_Character);
+   --  AKA: mvwinsch()
+   --  AKA: mvinsch()
+
+   --  |=====================================================================
+   --  | Man page curs_insstr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_101"#2|
+   procedure Insert (Win : Window := Standard_Window;
+                     Str : String;
+                     Len : Integer := -1);
+   --  AKA: winsnstr()
+   --  AKA: winsstr()
+   --  AKA: insnstr()
+   --  AKA: insstr()
+
+   --  #1A NAME="AFU_102"#2|
+   procedure Insert (Win    : Window := Standard_Window;
+                     Line   : Line_Position;
+                     Column : Column_Position;
+                     Str    : String;
+                     Len    : Integer := -1);
+   --  AKA: mvwinsnstr()
+   --  AKA: mvwinsstr()
+   --  AKA: mvinsnstr()
+   --  AKA: mvinsstr()
+   pragma Inline (Insert);
+
+   --  |=====================================================================
+   --  | Man page curs_instr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_103"#2|
+   procedure Peek (Win : Window := Standard_Window;
+                   Str : out String;
+                   Len : Integer := -1);
+   --  AKA: winnstr()
+   --  AKA: winstr()
+   --  AKA: innstr()
+   --  AKA: instr()
+
+   --  #1A NAME="AFU_104"#2|
+   procedure Peek (Win    : Window := Standard_Window;
+                   Line   : Line_Position;
+                   Column : Column_Position;
+                   Str    : out String;
+                   Len    : Integer := -1);
+   --  AKA: mvwinnstr()
+   --  AKA: mvwinstr()
+   --  AKA: mvinnstr()
+   --  AKA: mvinstr()
+
+   --  |=====================================================================
+   --  | Man page curs_inchstr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_105"#2|
+   procedure Peek (Win : Window := Standard_Window;
+                   Str : out Attributed_String;
+                   Len : Integer := -1);
+   --  AKA: winchnstr()
+   --  AKA: winchstr()
+   --  AKA: inchnstr()
+   --  AKA: inchstr()
+
+   --  #1A NAME="AFU_106"#2|
+   procedure Peek (Win    : Window := Standard_Window;
+                   Line   : Line_Position;
+                   Column : Column_Position;
+                   Str    : out Attributed_String;
+                   Len    : Integer := -1);
+   --  AKA: mvwinchnstr()
+   --  AKA: mvwinchstr()
+   --  AKA: mvinchnstr()
+   --  AKA: mvinchstr()
+   --  We don't inline the Peek procedures
+
+   --  |=====================================================================
+   --  | Man page curs_getstr.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_107"#2|
+   procedure Get (Win : Window := Standard_Window;
+                  Str : out String;
+                  Len : Integer := -1);
+   --  AKA: wgetnstr()
+   --  AKA: wgetstr()
+   --  AKA: getnstr()
+   --  AKA: getstr()
+   --  actually getstr is not supported because that results in buffer
+   --  overflows.
+
+   --  #1A NAME="AFU_108"#2|
+   procedure Get (Win    : Window := Standard_Window;
+                  Line   : Line_Position;
+                  Column : Column_Position;
+                  Str    : out String;
+                  Len    : Integer := -1);
+   --  AKA: mvwgetnstr()
+   --  AKA: mvwgetstr()
+   --  AKA: mvgetnstr()
+   --  AKA: mvgetstr()
+   --  Get is not inlined
+
+   --  |=====================================================================
+   --  | Man page curs_slk.3x
+   --  |=====================================================================
+
+   --  Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
+
+   type Soft_Label_Key_Format is (Three_Two_Three,
+                                  Four_Four,
+                                  PC_Style,              --  ncurses specific
+                                  PC_Style_With_Index);  --  "
+   type Label_Number is new Positive range 1 .. 12;
+   type Label_Justification is (Left, Centered, Right);
+
+   --  #1A NAME="AFU_109"#2|
+   procedure Init_Soft_Label_Keys
+     (Format : Soft_Label_Key_Format := Three_Two_Three);
+   --  AKA: slk_init()
+   pragma Inline (Init_Soft_Label_Keys);
+
+   --  #1A NAME="AFU_110"#2|
+   procedure Set_Soft_Label_Key (Label : Label_Number;
+                                 Text  : String;
+                                 Fmt   : Label_Justification := Left);
+   --  AKA: slk_set()
+   --  We don't inline this procedure
+
+   --  #1A NAME="AFU_111"#2|
+   procedure Refresh_Soft_Label_Keys;
+   --  AKA: slk_refresh()
+   pragma Inline (Refresh_Soft_Label_Keys);
+
+   --  #1A NAME="AFU_112"#2|
+   procedure Refresh_Soft_Label_Keys_Without_Update;
+   --  AKA: slk_noutrefresh()
+   pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
+
+   --  #1A NAME="AFU_113"#2|
+   procedure Get_Soft_Label_Key (Label : Label_Number;
+                                 Text  : out String);
+   --  AKA: slk_label()
+
+   --  #1A NAME="AFU_114"#2|
+   function Get_Soft_Label_Key (Label : Label_Number) return String;
+   --  AKA: slk_label()
+   --  Same as function
+   pragma Inline (Get_Soft_Label_Key);
+
+   --  #1A NAME="AFU_115"#2|
+   procedure Clear_Soft_Label_Keys;
+   --  AKA: slk_clear()
+   pragma Inline (Clear_Soft_Label_Keys);
+
+   --  #1A NAME="AFU_116"#2|
+   procedure Restore_Soft_Label_Keys;
+   --  AKA: slk_restore()
+   pragma Inline (Restore_Soft_Label_Keys);
+
+   --  #1A NAME="AFU_117"#2|
+   procedure Touch_Soft_Label_Keys;
+   --  AKA: slk_touch()
+   pragma Inline (Touch_Soft_Label_Keys);
+
+   --  #1A NAME="AFU_118"#2|
+   procedure Switch_Soft_Label_Key_Attributes
+     (Attr : Character_Attribute_Set;
+      On   : Boolean := True);
+   --  AKA: slk_attron()
+   --  AKA: slk_attroff()
+   pragma Inline (Switch_Soft_Label_Key_Attributes);
+
+   --  #1A NAME="AFU_119"#2|
+   procedure Set_Soft_Label_Key_Attributes
+     (Attr  : Character_Attribute_Set := Normal_Video;
+      Color : Color_Pair := Color_Pair'First);
+   --  AKA: slk_attrset()
+   pragma Inline (Set_Soft_Label_Key_Attributes);
+
+   --  #1A NAME="AFU_120"#2|
+   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
+   --  AKA: slk_attr()
+
+   --  #1A NAME="AFU_121"#2|
+   function Get_Soft_Label_Key_Attributes return Color_Pair;
+   --  AKA: slk_attr()
+   pragma Inline (Get_Soft_Label_Key_Attributes);
+
+   --  #1A NAME="AFU_122"#2|
+   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair);
+   --  AKA: slk_color()
+   pragma Inline (Set_Soft_Label_Key_Color);
+
+   --  |=====================================================================
+   --  | Man page keybound.3x
+   --  |=====================================================================
+   --  Not Implemented: keybound
+
+   --  |=====================================================================
+   --  | Man page keyok.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_123"#2|
+   procedure Enable_Key (Key    : Special_Key_Code;
+                         Enable : Boolean := True);
+   --  AKA: keyok()
+   pragma Inline (Enable_Key);
+
+   --  |=====================================================================
+   --  | Man page define_key.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_124"#2|
+   procedure Define_Key (Definition : String;
+                         Key        : Special_Key_Code);
+   --  AKA: define_key()
+   pragma Inline (Define_Key);
+
+   --  |=====================================================================
+   --  | Man page curs_util.3x
+   --  |=====================================================================
+
+   --  | Not implemented : filter, use_env
+   --  | putwin, getwin are in the child package PutWin
+   --
+
+   --  #1A NAME="AFU_125"#2|
+   procedure Key_Name (Key  : Real_Key_Code;
+                       Name : out String);
+   --  AKA: keyname()
+   --  The external name for a real keystroke.
+
+   --  #1A NAME="AFU_126"#2|
+   function Key_Name (Key  : Real_Key_Code) return String;
+   --  AKA: keyname()
+   --  Same as function
+   --  We don't inline this routine
+
+   --  #1A NAME="AFU_127"#2|
+   procedure Un_Control (Ch  : Attributed_Character;
+                         Str : out String);
+   --  AKA: unctrl()
+
+   --  #1A NAME="AFU_128"#2|
+   function Un_Control (Ch  : Attributed_Character) return String;
+   --  AKA: unctrl()
+   --  Same as function
+   pragma Inline (Un_Control);
+
+   --  #1A NAME="AFU_129"#2|
+   procedure Delay_Output (Msecs : Natural);
+   --  AKA: delay_output()
+   pragma Inline (Delay_Output);
+
+   --  #1A NAME="AFU_130"#2|
+   procedure Flush_Input;
+   --  AKA: flushinp()
+   pragma Inline (Flush_Input);
+
+   --  |=====================================================================
+   --  | Man page curs_termattrs.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_131"#2|
+   function Baudrate return Natural;
+   --  AKA: baudrate()
+   pragma Inline (Baudrate);
+
+   --  #1A NAME="AFU_132"#2|
+   function Erase_Character return Character;
+   --  AKA: erasechar()
+   pragma Inline (Erase_Character);
+
+   --  #1A NAME="AFU_133"#2|
+   function Kill_Character return Character;
+   --  AKA: killchar()
+   pragma Inline (Kill_Character);
+
+   --  #1A NAME="AFU_134"#2|
+   function Has_Insert_Character return Boolean;
+   --  AKA: has_ic()
+   pragma Inline (Has_Insert_Character);
+
+   --  #1A NAME="AFU_135"#2|
+   function Has_Insert_Line return Boolean;
+   --  AKA: has_il()
+   pragma Inline (Has_Insert_Line);
+
+   --  #1A NAME="AFU_136"#2|
+   function Supported_Attributes return Character_Attribute_Set;
+   --  AKA: termattrs()
+   pragma Inline (Supported_Attributes);
+
+   --  #1A NAME="AFU_137"#2|
+   procedure Long_Name (Name : out String);
+   --  AKA: longname()
+
+   --  #1A NAME="AFU_138"#2|
+   function Long_Name return String;
+   --  AKA: longname()
+   --  Same as function
+   pragma Inline (Long_Name);
+
+   --  #1A NAME="AFU_139"#2|
+   procedure Terminal_Name (Name : out String);
+   --  AKA: termname()
+
+   --  #1A NAME="AFU_140"#2|
+   function Terminal_Name return String;
+   --  AKA: termname()
+   --  Same as function
+   pragma Inline (Terminal_Name);
+
+   --  |=====================================================================
+   --  | Man page curs_color.3x
+   --  |=====================================================================
+
+   --  COLOR_PAIR
+   --  COLOR_PAIR(n) in C is the same as
+   --  Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
+   --  In C you often see something like c = c | COLOR_PAIR(n);
+   --  This is equivalent to c.Color := n;
+
+   --  #1A NAME="AFU_141"#2|
+   procedure Start_Color;
+   --  AKA: start_color()
+   pragma Import (C, Start_Color, "start_color");
+
+   --  #1A NAME="AFU_142"#2|
+   procedure Init_Pair (Pair : Redefinable_Color_Pair;
+                        Fore : Color_Number;
+                        Back : Color_Number);
+   --  AKA: init_pair()
+   pragma Inline (Init_Pair);
+
+   --  #1A NAME="AFU_143"#2|
+   procedure Pair_Content (Pair : Color_Pair;
+                           Fore : out Color_Number;
+                           Back : out Color_Number);
+   --  AKA: pair_content()
+   pragma Inline (Pair_Content);
+
+   --  #1A NAME="AFU_144"#2|
+   function Has_Colors return Boolean;
+   --  AKA: has_colors()
+   pragma Inline (Has_Colors);
+
+   --  #1A NAME="AFU_145"#2|
+   procedure Init_Color (Color : Color_Number;
+                         Red   : RGB_Value;
+                         Green : RGB_Value;
+                         Blue  : RGB_Value);
+   --  AKA: init_color()
+   pragma Inline (Init_Color);
+
+   --  #1A NAME="AFU_146"#2|
+   function Can_Change_Color return Boolean;
+   --  AKA: can_change_color()
+   pragma Inline (Can_Change_Color);
+
+   --  #1A NAME="AFU_147"#2|
+   procedure Color_Content (Color : Color_Number;
+                            Red   : out RGB_Value;
+                            Green : out RGB_Value;
+                            Blue  : out RGB_Value);
+   --  AKA: color_content()
+   pragma Inline (Color_Content);
+
+   --  |=====================================================================
+   --  | Man page curs_kernel.3x
+   --  |=====================================================================
+   --  | Not implemented: getsyx, setsyx
+   --
+   type Curses_Mode is (Curses, Shell);
+
+   --  #1A NAME="AFU_148"#2|
+   procedure Save_Curses_Mode (Mode : Curses_Mode);
+   --  AKA: def_prog_mode()
+   --  AKA: def_shell_mode()
+   pragma Inline (Save_Curses_Mode);
+
+   --  #1A NAME="AFU_149"#2|
+   procedure Reset_Curses_Mode (Mode : Curses_Mode);
+   --  AKA: reset_prog_mode()
+   --  AKA: reset_shell_mode()
+   pragma Inline (Reset_Curses_Mode);
+
+   --  #1A NAME="AFU_150"#2|
+   procedure Save_Terminal_State;
+   --  AKA: savetty()
+   pragma Inline (Save_Terminal_State);
+
+   --  #1A NAME="AFU_151"#2|
+   procedure Reset_Terminal_State;
+   --  AKA: resetty();
+   pragma Inline (Reset_Terminal_State);
+
+   type Stdscr_Init_Proc is access
+      function (Win     : Window;
+                Columns : Column_Count) return Integer;
+   pragma Convention (C, Stdscr_Init_Proc);
+   --  N.B.: the return value is actually ignored, but it seems to be
+   --        a good practice to return 0 if you think all went fine
+   --        and -1 otherwise.
+
+   --  #1A NAME="AFU_152"#2|
+   procedure Rip_Off_Lines (Lines : Integer;
+                            Proc  : Stdscr_Init_Proc);
+   --  AKA: ripoffline()
+   --  N.B.: to be more precise, this uses a ncurses specific enhancement of
+   --        ripoffline(), in which the Lines argument absolute value is the
+   --        number of lines to be ripped of. The official ripoffline() only
+   --        uses the sign of Lines to rip of a single line from bottom or top.
+   pragma Inline (Rip_Off_Lines);
+
+   type Cursor_Visibility is (Invisible, Normal, Very_Visible);
+
+   --  #1A NAME="AFU_153"#2|
+   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
+   --  AKA: curs_set()
+   pragma Inline (Set_Cursor_Visibility);
+
+   --  #1A NAME="AFU_154"#2|
+   procedure Nap_Milli_Seconds (Ms : Natural);
+   --  AKA: napms()
+   pragma Inline (Nap_Milli_Seconds);
+
+   --  |=====================================================================
+   --  | Some useful helpers.
+   --  |=====================================================================
+   type Transform_Direction is (From_Screen, To_Screen);
+   procedure Transform_Coordinates
+     (W      : Window := Standard_Window;
+      Line   : in out Line_Position;
+      Column : in out Column_Position;
+      Dir    : Transform_Direction := From_Screen);
+   --  This procedure transforms screen coordinates into coordinates relative
+   --  to the window and vice versa, depending on the Dir parameter.
+   --  Screen coordinates are the position informations on the physical device.
+   --  An Curses_Exception will be raised if Line and Column are not in the
+   --  Window or if you pass the Null_Window as argument.
+   --  We don't inline this procedure
+
+   --  |=====================================================================
+   --  | Man page default_colors.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_155"#2|
+   procedure Use_Default_Colors;
+   --  AKA: use_default_colors()
+   pragma Inline (Use_Default_Colors);
+
+   --  #1A NAME="AFU_156"#2|
+   procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
+                                    Back : Color_Number := Default_Color);
+   --  AKA: assume_default_colors()
+   pragma Inline (Assume_Default_Colors);
+
+   --  |=====================================================================
+   --  | Man page curs_extend.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_157"#2|
+   function Curses_Version return String;
+   --  AKA: curses_version()
+
+   --  #1A NAME="AFU_158"#2|
+   --  The returnvalue is the previous setting of the flag
+   function Use_Extended_Names (Enable : Boolean) return Boolean;
+   --  AKA: use_extended_names()
+
+   --  |=====================================================================
+   --  | Man page curs_trace.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_159"#2|
+   procedure Curses_Free_All;
+   --  AKA: _nc_freeall()
+
+   --  |=====================================================================
+   --  | Man page curs_scr_dump.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_160"#2|
+   procedure Screen_Dump_To_File (Filename : String);
+   --  AKA: scr_dump()
+
+   --  #1A NAME="AFU_161"#2|
+   procedure Screen_Restore_From_File (Filename : String);
+   --  AKA: scr_restore()
+
+   --  #1A NAME="AFU_162"#2|
+   procedure Screen_Init_From_File (Filename : String);
+   --  AKA: scr_init()
+
+   --  #1A NAME="AFU_163"#2|
+   procedure Screen_Set_File (Filename : String);
+   --  AKA: scr_set()
+
+   --  |=====================================================================
+   --  | Man page curs_print.3x
+   --  |=====================================================================
+   --  Not implemented: mcprint
+
+   --  |=====================================================================
+   --  | Man page curs_printw.3x
+   --  |=====================================================================
+   --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw,
+   --                   vw_printw
+   --  Please use the Ada style Text_IO child packages for formatted
+   --  printing. It doesn't make a lot of sense to map the printf style
+   --  C functions to Ada.
+
+   --  |=====================================================================
+   --  | Man page curs_scanw.3x
+   --  |=====================================================================
+   --  Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
+
+   --  |=====================================================================
+   --  | Man page resizeterm.3x
+   --  |=====================================================================
+   --  Not Implemented: resizeterm
+
+   --  |=====================================================================
+   --  | Man page wresize.3x
+   --  |=====================================================================
+
+   --  #1A NAME="AFU_164"#2|
+   procedure Resize (Win               : Window := Standard_Window;
+                     Number_Of_Lines   : Line_Count;
+                     Number_Of_Columns : Column_Count);
+   --  AKA: wresize()
+
+private
+   type Window is new System.Storage_Elements.Integer_Address;
+   Null_Window : constant Window := 0;
+
+   --  The next constants are generated and may be different on your
+   --  architecture.
+   --
+   Sizeof_bool        : constant Natural :=  1; --  bool
+   Offset_XY          : constant Natural :=  1; --  int
+
+   type Curses_Bool is mod 2 ** Interfaces.C.char'Size;
+   Curses_Bool_False : constant Curses_Bool := 0;
+
+end Terminal_Interface.Curses;
+
diff --git a/doc/html/ada/terminal_interface__ads.htm b/doc/html/ada/terminal_interface__ads.htm new file mode 100644 index 00000000000..6d7cdf1d2fe --- /dev/null +++ b/doc/html/ada/terminal_interface__ads.htm @@ -0,0 +1,53 @@ + +terminal_interface.ads + +

File : terminal_interface.ads


+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                            Terminal_Interface                            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+------------------------------------------------------------------------------
+-- Copyright (c) 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            --
+-- "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:  Juergen Pfeifer, 1996
+--  Version Control:
+--  @Revision: 1.14 @
+--  @Date: 2006/06/25 14:30:22 @
+--  Binding Version 01.00
+------------------------------------------------------------------------------
+package Terminal_Interface is
+   pragma Pure (Terminal_Interface);
+--
+--  Everything is in the child units
+--
+end Terminal_Interface;
+
diff --git a/doc/html/announce.html b/doc/html/announce.html index 234c703145a..1cd9651501a 100644 --- a/doc/html/announce.html +++ b/doc/html/announce.html @@ -1,8 +1,8 @@ - + - - -Announcing ncurses 5.7 - - - - -

Announcing ncurses 5.7

+ + + -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

+ Announcing ncurses 5.8 + + + -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and encouraged the keepers of -Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to -ncurses.

+ +

Announcing ncurses 5.8

The ncurses (new curses) + library is a free software emulation of curses in System V + Release 4.0, and more. It uses terminfo format, supports pads and + color and multiple highlights and forms characters and + function-key mapping, and has all the other SYSV-curses + enhancements over BSD curses. -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

+

In mid-June 1995, the maintainer of 4.4BSD curses declared + that he considered 4.4BSD curses obsolete, and encouraged the + keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to + switch over to ncurses.

-The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

+

The ncurses code was developed under GNU/Linux. It has been in + use for some time with OpenBSD as the system curses library, and + on FreeBSD and NetBSD as an external package. It should port + easily to any ANSI/POSIX-conforming UNIX. It has even been ported + to OS/2 Warp!

-The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . +

The distribution includes the library and support utilities, + including a terminfo compiler tic(1), a decompiler infocmp(1), + clear(1), tput(1), tset(1), and a termcap conversion tool + captoinfo(1). Full manual pages are provided for the library and + tools.

-

Release Notes

+

The ncurses distribution is available via anonymous FTP at the + GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
-This release is designed to be upward compatible from ncurses 5.0 through 5.6; -very few applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.6 release. -

-Interface changes: -

-New features and improvements: -
    -
  • library -
      -
    • new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are - reentrant, but most require either a window-level or - screen-level mutex.
      - (This is API-compatible, - but not ABI-compatible with the normal library). +

      Release Notes

      This release is designed to be upward + compatible from ncurses 5.0 through 5.7; very few applications + will require recompilation, depending on the platform. These are + the highlights from the change-log since ncurses 5.7 release. -
    • add NCURSES_OPAQUE symbol to curses.h, will - use to make structs opaque in selected configurations. +

      Interface changes

      -
    • add NCURSES_EXT_FUNCS and - NCURSES_EXT_COLORS symbols to curses.h to make - it simpler to tell if the extended functions and/or colors - are declared. +
        +
      • turn on _XOPEN_CURSES definition in + curses.h.
      • -
      • add wresize() to C++ binding +
      • change _nc_has_mouse to + has_mouse, reflect its use in C++ and Ada95.
      • -
      • eliminate fixed-buffer vsprintf() calls in C++ binding. +
      • add is_pad and is_subwin + functions for opaque access to the WINDOW structure.
      • -
      • add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. +
      • add tiparm, based on review of X/Open Curses + Issue 7.
      • +
      -
    • adapt mouse-handling code from menu library in form-library +

      New features and improvements

      -
    • improve tracing for form library, showing created forms, - fields, etc. +

      Library Improvements

      -
    • make $NCURSES_NO_PADDING feature work for termcap interface . +
        +
      • add a terminal driver for Windows console, which supports a + MinGW port to Windows.
      • -
      • add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. +
      • add extended functions which specify the + SCREEN pointer for several curses functions which + use the global SP.
      • -
      • several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x -
      +
    • improve the NCURSES_NO_UTF8_ACS feature by + adding a check for an extended terminfo capability + U8.
    • -
    • programs: -
        -
      • modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. +
      • improve performance of tigetstr, etc., by + using hashing code from tic.
      • -
      • several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. +
      • add WACS_xxx definitions to wide-character + configuration for thick- and double-lines.
      • -
      • add adacurses-config to the Ada95 install. +
      • modify init_pair to allow caller to create extra color + pairs beyond the color_pairs limit, which use default + colors.
      • +
      -
    • modify tic -f option to format spaces as - \s to prevent them from being lost when that - is read back in unformatted strings. +

      Improvements to Programs

      -
    • The tack program is now distributed separately - from ncurses. -
    +
      +
    • add tabs program.
    • -
    • terminal database -
        -
      • added entries: -
          -
        • Eterm-256color, - Eterm-88color and - rxvt-88color -
        • aterm -
        • konsole-256color -
        • mrxvt -
        • screen.mlterm -
        • screen.rxvt -
        • teraterm4.59 is now the primary primary - teraterm entry, renamed original to - teraterm2.3 -
        • 9term terminal -
        • Newbury Data entries -
        -
      • updated/improved entries: -
          -
        • gnome to version 2.22.3 -
        • h19, z100 -
        • konsole to version 1.6.6 -
        • mlterm, mlterm+pcfkeys -
        • xterm, and building-blocks for function-keys - to xterm patch #230. -
        -
      -
    -Major bug fixes: -
      -
    • add logic to tic for cancelling strings in user-defined - capabilities - (this is needed for - current konsole terminfo entry). +
    • modify tic's -I/-C dump to reformat acsc strings into + canonical form (sorted, unique mapping).
    • -
    • modify mk-1st.awk so the generated makefile rules for - linking or installing shared libraries do not first remove the - library, in case it is in use, e.g., libncurses.so by - /bin/sh. +
    • add checks in tic for inconsistent cursor-movement + controls, and for inconsistent printer-controls.
    • -
    • correct check for notimeout() in wgetch(). +
    • add special case to _nc_infotocap (used by tic + and infocmp) to recognize the + setaf/setab strings from + xterm+256color and xterm+88color, and + provide a reduced version which works with termcap.
    • +
    -
  • fix a sign-extension bug in infocmp's repair_acsc() function. +

    Terminal Database

    -
  • change winnstr() to stop at the end of the line. +
      +
    • added entries: -
    • make Ada95 demo_panels() example work. +
        +
      • bterm terminfo entry, based on bogl + 0.1.18
      • -
      • fix for adding a non-spacing character at the beginning of a line. +
      • cons25-debian entry
      • -
      • fill in extended-color pair to make colors work - for wide-characters using extended-colors. +
      • eterm-color entry
      • -
      • improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. +
      • linux-16color
      • -
      • modify win_wchnstr() to ensure that only a base cell - is returned for each multi-column character. +
      • mlterm+256color entry, for mlterm + 3.0.0
      • -
      • improve waddch() and winsch() handling of - EILSEQ from mbrtowc() by using unctrl() - to display illegal bytes rather than trying to append further bytes - to make up a valid sequence. +
      • several screen-bce.xxx entries
      • -
      • restore curs_set() state after - endwin()/refresh() +
      • screen.Eterm terminfo entry
      • -
      • modify keyname() to use "^X" form only if - meta() has been called, or if keyname() - is called without initializing curses, e.g., via - initscr() or newterm(). +
      • vwmterm entry
      • -
      • modify unctrl() to check codes in 128-255 range versus - isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. +
      • xterm-utf8 entry as a demo of the + U8 feature
      • +
      +
    • -
    • improve resizeterm() by moving ripped-off lines, and - repainting the soft-keys. +
    • updated/improved entries: -
    • modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. +
        +
      • use extended capabilities: -
      • use NCURSES_MOUSE_MASK() in definition of - BUTTON_RELEASE(), etc., to make those work properly - with the --enable-ext-mouse configuration - -
      • correct some functions in Ada95 binding which were using return - value from C where none was returned. - -
      • reviewed/fixed issues reported by Coverity and Klocwork tools. -
      - -Portability: -
        -
      • configure script:
          -
        • new options: -
          +
        • add U8 feature to denote entries for + terminal emulators which do not support VT100 SI/SO + when processing UTF-8 encoding
        • -
          --disable-big-strings -
          control whether static string tables are generated as single - large strings (to improve startup performance), or as array - of individual strings. +
        • add XT capability to entries for + terminals that support both xterm-style mouse- and + title-controls, for screen which + special-cases TERM beginning with xterm or + rxvt
        • +
        +
      • -
        --disable-relink -
        control whether shared libraries are relinked (during install) - when rpath is enabled. +
      • improvements based on new checks in tic:
      • -
        --disable-tic-depends -
        make explicit whether tic library depends on ncurses/ncursesw - library. +
      • +
          +
        • fill in no-parameter forms of cursor-movement where + a parameterized form is available
        • -
          --enable-mixed-case -
          override the configure script's check if the filesystem - supports mixed-case filenames. - This allows one to control how the terminal database - maps to the filesystem. - For filesystems that do not support mixed-case, the library - uses generate 2-character (hexadecimal) codes for the - lower-level of the filesystem terminfo database +
        • fill in missing cursor controls where the form of + the controls is ANSI
        • -
          --enable-reentrant -
          builds a different flavor of the ncurses library (ncursest) - which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded support). +
        • add parameterized cursor-controls to + linux-basic
        • -
          --enable-weak-symbols -
          use weak-symbols for linking to the POSIX thread library, - and use the same soname for the ncurses shared library - as the normal library (caveat: the ABI is for the threaded - library, which makes global data accessed via functions). +
        • modify nsterm, xnuppc and + tek4115 to make + sgr/sgr0 consistent
        • -
          --with-pthread -
          build with the POSIX thread library (tested with AIX, - Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). +
        • change several terminfo entries to make consistent + use of ANSI clear-all-tabs
        • +
        +
      • -
        --with-ticlib -
        build/install the tic-support functions in a separate library +
      • extend ansi.sys pfkey + capability from kf1-kf10 to kf1-kf48, moving function key + definitions from emx-base for + consistency.
      • - +
      • correct missing final 'p' in pfkey + capability of ansi.sys-old.
      • -
      • improved options: -
        +
      • rename atari and st52 + terminfo entries to atari-old, st52-old, use newer entries + from FreeMiNT.
      • -
        --enable-ext-colors -
        requires the wide-character configuration. +
      • repurpose gnome terminfo entries as + vte, retaining gnome variants for + compatibility, but generally deprecating those since the + VTE library is what actually defines the behavior of + "gnome", etc., since 2003.
      • -
        --with-chtype -
        ignore option value "unsigned" is always added to - the type in curses.h; do the same for --with-mmask-t. +
      • improve interix smso terminfo + capability by using reverse rather than bold.
      • -
        --with-dmalloc -
        build-fix for redefinition of strndup. +
      • correct initc capability of + linux-c-nc end-of-range, make similar change + for dg+ccc and dgunix+ccc.
      • -
        --with-hashed-db -
        accepts a parameter which is the install-prefix of a given - Berkeley Database. +
      • update minix terminfo entry.
      • -
        --with-hashed-db -
        the $LIBS environment variable overrides the search for the db - library. +
      • updated nsterm* entries.
      • -
        --without-hashed-db -
        assumed when "--disable-database" is used. +
      • remove unnecessary kcan assignment to + ^C from putty.
      • -
        +
      • suppress ncv in screen and + konsole-base entries, allowing underline.
      • -
      +
    • change ncv and op capabilities in + sun-color terminfo entry to match Sun's entry + for this.
    • -
    • other configure/build issues: -
        -
      • build-fixes for LynxOS -
      • modify shared-library rules to allow FreeBSD 3.x to use rpath. -
      • build-fix for FreeBSD "contemporary" TTY interface. -
      • build-fixes for AIX with libtool. -
      • build-fixes for Darwin and libtool. -
      • modify BeOS-specific ifdef's to build on Haiku. -
      • corrected gcc options for building shared libraries on Solaris - and IRIX64. -
      • change shared-library configuration for OpenBSD, make rpath work. -
      • build-fixes for using libutf8, e.g., on OpenBSD 3.7 -
      • add "-e" option in ncurses/Makefile.in when generating source-files - to force earlier exit if the build environment fails unexpectedly. -
      • add support for shared libraries for QNX. -
      • change delimiter in MKlib_gen.sh from '%' to '@', to - avoid substitution by IBM xlc to '#' as part of its extensions to - digraphs. -
      +
    • fix typo in rmso for tek4106 + entry.
    • -
    • library: -
        -
      • rewrite wrapper for wcrtomb(), making it work on - Solaris. This is used in the form library to determine the length - of the buffer needed by field_buffer. -
      • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding - type for data manipulated by signal handlers. -
      • set locale in misc/ncurses-config.in since it uses a range -
      • disable GPM mouse support when $TERM does not happen to contain - "linux", since Gpm_Open() no longer limits its assertion to terminals - that it might handle, e.g., within "screen" in xterm. -
      • reset mouse file-descriptor when unloading GPM library. -
      +
    • improve acsc string for vt52, + show arrow keys.
    • -
    • test programs: -
        -
      • update test programs to build/work with various UNIX curses for - comparisons. -
      -
    +
  • add hard-reset for rs2 to + wsvt25 to help ensure that reset ends the + alternate character set.
  • -

    Features of Ncurses

    +
  • add ccc and initc + capabilities to xterm-16color.
  • +
+ + -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: +

Major bug fixes

-
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
+
    +
  • ncurses library -The ncurses package also has many useful extensions over SVr4: +
      +
    • wide character support -
        -
      • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -and most EXTENDED features). -It includes many function calls not supported under SVr4 curses -(but portability of all -calls is documented so you can use the SVr4 subset only). -
      • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
      • Ada95 and C++ bindings. -
      • Support for mouse event reporting with X Window xterm -and FreeBSD and OS/2 console windows. -
      • Extended mouse support via Alessandro Rubini's gpm package. -
      • The function wresize() allows you to resize windows, preserving -their data. -
      • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
      • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
      • Support for 256-color terminals, such as modern xterm, when configured -using the --enable-ext-colors option. -
      • Support for 16-color terminals, such as aixterm and modern xterm. -
      • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
      • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
      • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
      • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
      • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
      • A BSD-like tset(1) utility is provided. -
      • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
      • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
      • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
      • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
      • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
      • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
      • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
      • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
      +
        +
      • modify length returned by getcchar to + count the trailing null which is documented in + X/Open.
      • -

        State of the Package

        +
      • fix an infinite recursion when adding a + legacy-coding 8-bit value using + insch.
      • -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

        +

      • improve a workaround in adding wide-characters, + when a control character is found. The library uses + unctrl to obtain a printable version of + the control character, but was not passing color or + video attributes.
      • -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -
        -
        cdk -
        Curses Development Kit -
        -http://invisible-island.net/cdk/ -
        -http://www.vexus.ca/products/CDK/ -
        ded -
        directory-editor -
        -http://invisible-island.net/ded/ -
        dialog -
        the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
        -http://invisible-island.net/dialog/ -
        lynx -
        the character-screen WWW browser -
        -http://lynx.isc.org/release/ -
        Midnight Commander -
        file manager -
        -http://www.ibiblio.org/mc/ -
        mutt -
        mail utility -
        -http://www.mutt.org/ -
        ncftp -
        file-transfer utility -
        -http://www.ncftp.com/ -
        nvi -
        New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
        -http://www.bostic.com/vi/ -
        -
        pinfo -
        Lynx-like info browser. -https://alioth.debian.org/projects/pinfo/ -
        tin -
        newsreader, supporting color, MIME -http://www.tin.org/ -
        -as well as some that use ncurses for the terminfo support alone: -
        -
        minicom -
        terminal emulator -
        - -http://alioth.debian.org/projects/minicom/ -
        vile -
        vi-like-emacs -
        -http://invisible-island.net/vile/ -
        -

        +

      • modify waddch_literal, updating + line-pointer after a multicolumn character is found to + not fit on the current row, and wrapping is done. Since + the line-pointer was not updated, the wrapped + multicolumn character was written to the beginning of + the current row.
      • -The ncurses distribution includes a selection of test programs (including -a few games). +
      • fixes in wins_nwstr and related + functions to ensure that special characters, i.e., + control characters are handled properly with the + wide-character configuration.
      • -

        Who's Who and What's What

        +
      • correct internal _nc_insert_ch to use + _nc_insert_wch when inserting wide + characters, since the wins_wch function + that it used did not update the cursor position.
      • +
      +
    • -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

      +

    • mouse -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -
      +          
        +
      • add check if Gpm_Open returns a -2, + e.g., for "xterm". This is normally suppressed but can + be overridden using $NCURSES_GPM_TERMS. + Ensure that Gpm_Close is called in this + case.
      • + +
      • add check in mouse-driver to disable connection if + GPM returns a zero, indicating that the connection is + closed.
      • + +
      • modify getmouse to act as its + documentation implied, returning on each call the + preceding event until none are left. When no more + events remain, it will return ERR.
      • +
      +
    • + +
    • miscellaneous + +
        +
      • improve handling of color-pairs embedded in + attributes for the extended-colors configuration.
      • + +
      • add check for failure to open hashed-database + needed for db4.6.
      • + +
      • modify use of $CC environment variable + which is defined by X/Open as a curses feature, to + ignore it if it is not a single character.
      • + +
      • modify declaration of cur_term when + broken-linker is used, but enable-reentrant is not, to + match pre-5.7.
      • + +
      • correct limit-checks in derwin.
      • + +
      • remove old check in mvderwin which + prevented moving a derived window whose origin happened + to coincide with its parent's origin.
      • + +
      • correct limit-checks in newwin, to + ensure that windows have nonzero size.
      • + +
      • modify set_curterm to make + broken-linker configuration work with changes from + 20090228.
      • + +
      • modify wgetch to ensure it checks + SIGWINCH when it gets an error in + non-blocking mode.
      • + +
      • correct limit-check in wredrawln, + accounting for begy/begx + values.
      • + +
      • fix a null-pointer check in + _nc_format_slks in lib_slk.c, from + 20070704 changes.
      • + +
      • correct translation of "^" in + _nc_infotocap, used to transform terminfo + to termcap strings.
      • + +
      • modify _nc_wgetch to check for a -1 in + the fifo, e.g., after a SIGWINCH, and + discard that value, to avoid confusing + application.
      • +
      +
    • +
    +
  • + +
  • other libraries + +
      +
    • correct transfer of multicolumn characters in multirow + field_buffer, which stopped at the end of the + first row due to filling of unused entries in a cchar_t + array with nulls.
    • + +
    • correct buffer-size after internal resizing of + wide-character set_field_buffer, broken in + 20081018 changes.
    • + +
    • correct layout of working window used to extract data + in wide-character configured by + set_field_buffer
    • +
    +
  • +
+ +

Portability

+ +
    +
  • configure script: + +
      +
    • new options: + +
      +
      --disable-libtool-version
      + +
      use the "-version-number" feature which was added + in libtool 1.5. The default value for the option uses + the newer feature, which makes libraries generated + using libtool compatible with the standard builds of + ncurses.
      + +
      --disable-rpath-hack
      + +
      disable a feature which adds rpath options for + libraries in unusual places.
      + +
      --enable-interop
      + +
      integrate changes for generic/interop support to + form-library.
      + +
      --enable-pc-files
      + +
      generate ".pc" files for each of the libraries, and + install them in pkg-config's library + directory.
      + +
      --enable-pthreads-eintr
      + +
      control whether to allow EINTR to + interrupt a read operation in wgetch. This + applies only to the pthread configuration
      + +
      --enable-sp-funcs
      + +
      compile-in support for extended functions which + accept a SCREEN pointer, reducing the need + for juggling the global SP value with + set_term and delscreen.
      + +
      --enable-term-driver
      + +
      compile with terminal-driver. That is used in the + MinGW port, and (being somewhat more complicated) is an + experimental alternative to the conventional termlib + internals. Currently, it requires the sp-funcs feature + to be enabled.
      + +
      --with-ncurses-wrap-prefix
      + +
      allows setting the prefix for functions used to + wrap global variables to something other than + "_nc_".
      + +
      --with-pkg-config=[DIR]
      + +
      check for pkg-config, optionally + specifying its path.
      + +
      --without-manpages
      + +
      tells the configure script to suppress the install + of ncurses' manpages.
      + +
      --without-tests
      + +
      suppress building test programs.
      +
      +
    • + +
    • improved options: + +
        +
      • correct logic for --with-database, + which was coded as an enable-type switch.
      • + +
      • omit the opaque-functions from + lib_gen.o when + --disable-ext-funcs is used.
      • +
      +
    • +
    +
  • + +
  • packaging: + +
      +
    • *-config scripts: + +
        +
      • modify adacurses-config to look for + ".ali" files in the adalib directory.
      • + +
      • correct install for the Ada95 tree, which omitted + libAdaCurses.a used in + adacurses-config.
      • + +
      • change install for adacurses-config to + provide additional flavors such as + adacursesw-config, for ncursesw.
      • + +
      • modify scripts to generate + ncurses*-config and pc-files to add + dependency for tinfo library.
      • + +
      • use ncurses*-config scripts if + available for test/configure.
      • + +
      • correct name for termlib in + ncurses*-config, e.g., if it is renamed to + provide a single file for ncurses/ncursesw + libraries.
      • + +
      • generate manpages for the *-config scripts, adapted + from help2man.
      • + +
      • modify install-rule for manpages so that *-config + manpages will install when building with + --srcdir.
      • + +
      • build-fixes for OpenSolaris aka Solaris 11, for + wide-character configuration as well as for rpath + feature in *-config scripts.
      • + +
      • use $includedir symbol in + misc/ncurses-config.in, add + --includedir option.
      • + +
      • improve install-rules for pc-files.
      • + +
      • create the pkg-config library + directory if needed.
      • + +
      • fix typo "==" where "=" + is needed in ncurses-config.in and + gen-pkgconfig.in files.
      • + +
      • modify gen-pkgconfig.in to eliminate a + dependency on rpath when deciding whether to add + $LIBS to --libs output; that + should be shown for the ncurses and tinfo libraries + without taking rpath into account.
      • + +
      • modify handling of $PKG_CONFIG_LIBDIR + to use only the first item in a possibly + colon-separated list.
      • +
      +
    • + +
    • other packaging issues + +
        +
      • add make-tar.sh scripts to Ada95 and + test subdirectories to help with making those + separately distributable.
      • + +
      • add Ada95/configure script, to use in + tar-file created by + Ada95/make-tar.sh.
      • + +
      • remove tar-copy.sh and related + configure/Makefile chunks, since the Ada95 + binding is now installed using rules in + Ada95/src.
      • +
      +
    • +
    +
  • + +
  • cross-compiling: + +
      +
    • improve configure checks for location of tic and + infocmp programs used for installing database and for + generating fallback data, e.g., for cross-compiling.
    • + +
    • modify #define's for build-compiler to suppress cchar_t + symbol from compile of make_hash and + make_keys, improving cross-compilation of + ncursesw.
    • + +
    • simplify include-dependencies of make_hash + and make_keys, to reduce the need for setting + BUILD_CPPFLAGS in cross-compiling when the build- and + target-machines differ.
    • + +
    • correct cross-compiling configure check for + CF_MKSTEMP macro, by adding a check cache + variable set by AC_CHECK_FUNC.
    • +
    +
  • + +
  • library dependencies: + +
      +
    • revise wadd_wch and + wecho_wchar to eliminate dependency on + unctrl.
    • + +
    • adjust configure script so that "t" is not added to + library suffix when weak-symbols are used, allowing the + pthread configuration to more closely match the non-thread + naming.
    • +
    +
  • + +
  • building the Ada95 tree: + +
      +
    • changes to use gnatmake project files in the Ada95 + tree.
    • + +
    • add/use configure check to turn on project rules for + Ada95/src.
    • + +
    • old gnatmake (3.15) does not produce libraries using + project-file; work around by adding script to generate + alternate makefile.
    • + +
    • add configure --with-ada-sharedlib option, for the + test_make rule.
    • + +
    • move Ada95-related logic into aclocal.m4, since + additional checks will be needed to distinguish old/new + implementations of gnat.
    • + +
    • add test_make / test_clean / test_install rules in + Ada95/src
    • + +
    • change install-path for adainclude directory to + /usr/share/ada (was /usr/lib/ada).
    • +
    +
  • + +
  • other configure/build issues: + +
      +
    • make CCHARW_MAX value configurable, noting + that changing this would change the size of + cchar_t, and would be ABI-incompatible.
    • + +
    • improve comparison of program-names when checking for + linked flavors such as "reset" by ignoring the executable + suffix.
    • + +
    • drop mkdirs.sh, use + "mkdir -p".
    • + +
    • drop misc/ncu-indent and + misc/jpf-indent; they are provided by an + external package cindent.
    • + +
    • change makefiles to use $ARFLAGS rather + than $AR_OPTS, provide a configure check to + detect whether a "-" is needed before "ar" options.
    • + +
    • modify CF_DISABLE_LEAKS configure macro so + that the --enable-leaks option is not the same as + --disable-leaks.
    • + +
    • improve configure script macros + CF_HEADER_PATH and + CF_LIBRARY_PATH by adding CFLAGS, + CPPFLAGS and LDFLAGS, + LIBS values to the search-lists.
    • + +
    • improve configure macros CF_GCC_VERSION + and CF_GCC_WARNINGS to work with gcc 4.x's c89 + alias, which gives warning messages for cases where older + versions would produce an error.
    • + +
    • modify CF_WITH_LIBTOOL configure check to + allow unreleased libtool version numbers (e.g. which + include alphabetic chars, as well as digits, after the + final '.').
    • + +
    • improve use of symbolic links in makefiles by using + "-f" option if it is supported, to eliminate + temporary removal of the target
    • + +
    • add a configure-time check to pick a suitable value for + CC_SHARED_OPTS for Solaris.
    • + +
    • add -shared option to MK_SHARED_LIB when + -Bsharable is used, for *BSD's, without which "main" might + be one of the shared library's dependencies.
    • + +
    • modify configure script to allow building shared + libraries with gcc on AIX 5 or 6.
    • + +
    • suppress configure check for static/dynamic linker + flags for gcc on Solaris 10, since gcc is confused by + absence of static libc, and does not switch back to dynamic + mode before finishing the libraries.
    • + +
    • suppress configure check for static/dynamic linker + flags for gcc on Darwin.
    • + +
    • modify misc/run_tic.in to create parent + directory, in case this is a new install of hashed + database.
    • + +
    • modify configure check for tic program, used for + fallbacks, to a warning if not found. This makes it simpler + to use additonal scripts to bootstrap the fallbacks code + using tic from the build tree.
    • +
    +
  • + +
  • test programs: + +
      +
    • add test/demo_terminfo, for comparison with + demo_termcap.
    • + +
    • improve test/ncurses.c 'F' test, show combining + characters in color.
    • + +
    • fix logic for 'V' in test/ncurses.c tests f/F.
    • + +
    • improve test/ncurses.c 'a test to put mouse droppings + in the proper window.
    • + +
    • modify ncurses 'F' test to demo wborder_set with + colored lines.
    • + +
    • modify ncurses 'f' test to demo wborder with colored + lines.
    • + +
    • improve test/ncurses.c 'a' test, using unctrl more + consistently to display meta-characters.
    • + +
    • correct use of key_name in test/ncurses.c + 'A' test, which only displays wide-characters, not + key-codes since 20070612.
    • + +
    • add test/clip_printw.c to illustrate how to use printw + without wrapping.
    • + +
    • modify test-programs, e.g,. test/view.c, to address + subtle differences between Tru64/Solaris and HPUX/AIX + getcchar return values.
    • + +
    • add some test programs (and make these use the same + special keys by sharing linedata.h functions): + test/test_addstr.c test/test_addwstr.c test/test_addchstr.c + test/test_add_wchstr.c
    • + +
    • add test/xterm-256color.dat
    • + +
    • modify test programs to allow them to be built with + NetBSD curses.
    • + +
    • fixes for test programs to build/work on HPUX and AIX, + etc.
    • +
    +
  • +
+ +

Features of Ncurses

The ncurses package is fully + compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are + documented).
  • + +
  • Full support for SVr4 curses features including keyboard + mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys.
  • + +
  • An emulation of the SVr4 panels library, supporting a stack + of windows with backing store, is included.
  • + +
  • An emulation of the SVr4 menus library, supporting a + uniform but flexible interface for menu programming, is + included.
  • + +
  • An emulation of the SVr4 form library, supporting data + collection through on-screen forms, is included.
  • + +
  • Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses.
  • + +
  • The utilities have options to allow you to filter terminfo + entries for use with less capable + curses/terminfo versions such + as the HP/UX and AIX ports.
  • +
The ncurses package also has many useful extensions over + SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the + X/OPEN curses specification, XSI curses (that is, it implements + all BASE level features, and most EXTENDED features). It + includes many function calls not supported under SVr4 curses + (but portability of all calls is documented so you can use the + SVr4 subset only).
  • + +
  • Unlike SVr3 curses, ncurses can write to the + rightmost-bottommost corner of the screen if your terminal has + an insert-character capability.
  • + +
  • Ada95 and C++ bindings.
  • + +
  • Support for mouse event reporting with X Window xterm and + FreeBSD and OS/2 console windows.
  • + +
  • Extended mouse support via Alessandro Rubini's gpm + package.
  • + +
  • The function wresize allows you to resize + windows, preserving their data.
  • + +
  • The function use_default_colors allows you to + use the terminal's default colors for the default color pair, + achieving the effect of transparent colors.
  • + +
  • The functions keyok and + define_key allow you to better control the use of + function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code.
  • + +
  • Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors + option.
  • + +
  • Support for 16-color terminals, such as aixterm + and modern xterm.
  • + +
  • Better cursor-movement optimization. The package now + features a cursor-local-movement computation more efficient + than either BSD's or System V's.
  • + +
  • Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables + it to make optimal use of hardware scrolling, line-insertion, + and line-deletion for screen-line movements. This algorithm is + more powerful than the 4.4BSD curses quickch + routine.
  • + +
  • Real support for terminals with the magic-cookie glitch. + The screen-update code will refrain from drawing a highlight if + the magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space + character. It will automatically shift highlight boundaries + when doing so would make it possible to draw the highlight + without changing the visual appearance of the screen.
  • + +
  • It is possible to generate the library with a list of + pre-loaded fallback entries linked to it so that it can serve + those terminal types even when no terminfo tree or termcap file + is accessible (this may be useful for support of + screen-oriented programs that must run in single-user + mode).
  • + +
  • The tic(1)/captoinfo utility provided with ncurses has the + ability to translate many termcaps from the XENIX, IBM and + AT&T extension sets.
  • + +
  • A BSD-like tset(1) utility is provided.
  • + +
  • The ncurses library and utilities will automatically read + terminfo entries from $HOME/.terminfo if it exists, and compile + to that directory if it exists and the user has no write access + to the system directory. This feature makes it easier for users + to have personal terminfo entries without giving up access to + the system terminfo directory.
  • + +
  • You may specify a path of directories to search for + compiled descriptions with the environment variable + TERMINFO_DIRS (this generalizes the feature provided by + TERMINFO under stock System V.)
  • + +
  • In terminfo source files, use capabilities may refer not + just to other entries in the same source file (as in System V) + but also to compiled entries in either the system terminfo + directory or the user's $HOME/.terminfo directory.
  • + +
  • A script (capconvert) is provided to help + BSD users transition from termcap to terminfo. It gathers the + information in a TERMCAP environment variable and/or a + ~/.termcap local entries file and converts it to an equivalent + local terminfo tree under $HOME/.terminfo.
  • + +
  • Automatic fallback to the /etc/termcap file can be compiled + in when it is not possible to build a terminfo tree. This + feature is neither fast nor cheap, you don't want to use it + unless you have to, but it's there.
  • + +
  • The table-of-entries utility toe makes it + easy for users to see exactly what terminal types are available + on the system.
  • + +
  • The library meets the XSI requirement that every macro + entry point have a corresponding function which may be linked + (and will be prototype-checked) if the macro definition is + disabled with #undef.
  • + +
  • An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface.
  • +
+ +

State of the Package

Numerous bugs present in earlier + versions have been fixed; the library is far more reliable than + it used to be. Bounds checking in many `dangerous' entry points + has been improved. The code is now type-safe according to gcc + -Wall. The library has been checked for malloc leaks and arena + corruption by the Purify memory-allocation tester. + +

The ncurses code has been tested with a wide variety of + applications including (versions starting with those noted):

+ +
+
cdk
+ +
Curses Development Kit
+ http://invisible-island.net/cdk/
+ + http://www.vexus.ca/products/CDK/
+ +
ded
+ +
directory-editor
+ http://invisible-island.net/ded/
+ +
dialog
+ +
the underlying application used in Slackware's setup, and + the basis for similar applications on GNU/Linux.
+ http://invisible-island.net/dialog/
+ +
lynx
+ +
the character-screen WWW browser
+ http://lynx.isc.org/release/
+ +
Midnight Commander
+ +
file manager
+ http://www.midnight-commander.org/
+ +
mutt
+ +
mail utility
+ http://www.mutt.org/
+ +
ncftp
+ +
file-transfer utility
+ http://www.ncftp.com/
+ +
nvi
+ +
New vi versions 1.50 are able to use ncurses versions 1.9.7 + and later.
+ https://sites.google.com/a/bostic.com/keithbostic/nvi
+
+ +
pinfo
+ +
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
+ +
tin
+ +
newsreader, supporting color, MIME http://www.tin.org/
+
as well as some that use ncurses for the terminfo support + alone: + +
+
minicom
+ +
terminal emulator
+ http://alioth.debian.org/projects/minicom/
+ +
vile
+ +
vi-like-emacs
+ http://invisible-island.net/vile/
+
+ +

The ncurses distribution includes a selection of test programs + (including a few games).

+ +

Who's Who and What's What

Zeyd Ben-Halim started it from + a previous package pcurses, written by Pavel Curtis. Eric S. + Raymond continued development. Jürgen Pfeifer wrote most of + the form and menu libraries. Ongoing work is being done by + Thomas Dickey. + Thomas Dickey acts as the maintainer for the Free Software + Foundation, which holds the copyright on ncurses. Contact the + current maintainers at bug-ncurses@gnu.org. + +

To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line:

+
              subscribe <name>@<host.domain>
-
+ -This list is open to anyone interested in helping with the development and -testing of this package.

+

This list is open to anyone interested in helping with the + development and testing of this package.

-Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . +

Beta versions of ncurses and patches to the current release + are made available at ftp://invisible-island.net/ncurses/ .

-

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. +

Future Plans

-

Other Related Resources

+
    +
  • Extended-level XPG4 conformance, with internationalization + support.
  • -The distribution provides a newer version of the terminfo-format -terminal description file once maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file, and provides several user-definable extensions -beyond the X/Open specification.

    +

  • Ports to more systems, including DOS and Windows.
  • +
We need people to help with these projects. If you are + interested in working on them, please join the ncurses list. -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - +

Other Related Resources

The distribution provides a newer + version of the terminfo-format terminal description file once + maintained by Eric + Raymond . Unlike the older version, the termcap and + terminfo data are provided in the same file, and provides several + user-definable extensions beyond the X/Open specification. + +

You can find lots of information on terminal-related topics + not covered in the terminfo file at + Richard Shuford's archive .

+ + diff --git a/doc/html/hackguide.html b/doc/html/hackguide.html index 97d1369170c..417f4c9855e 100644 --- a/doc/html/hackguide.html +++ b/doc/html/hackguide.html @@ -1,8 +1,8 @@ - + + + +Welcome to ncurses + + + + + +

Welcome to ncurses

+From this index page you have access to these further documents +

+We also have HTML versions of all the ncurses manpages. + + diff --git a/doc/html/man/adacurses-config.1.html b/doc/html/man/adacurses-config.1.html new file mode 100644 index 00000000000..0bce33efdb9 --- /dev/null +++ b/doc/html/man/adacurses-config.1.html @@ -0,0 +1,96 @@ + + + + +ADACURSES 1 User Commands + + + + +

ADACURSES 1 User Commands

+
+
+
+ADACURSES(1)                 User Commands                 ADACURSES(1)
+
+
+
+
+
+

NAME

+       adacurses-config - helper script for AdaCurses libraries
+
+
+
+

SYNOPSIS

+       adacurses-config [options]
+
+
+
+

DESCRIPTION

+       This  is  a  shell  script which simplifies configuring an
+       application  to  use  the  AdaCurses  library  binding  to
+       ncurses.
+
+
+
+

OPTIONS

+       --cflags
+              echos  the gnat (Ada compiler) flags needed to com-
+              pile with adacurses
+
+       --libs echos  the  gnat  libraries  needed  to  link  with
+              adacurses
+
+       --version
+              echos the release+patchdate version of adacurses
+
+       --help prints this message
+
+
+
+

SEE ALSO

+       curses(3x)
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                           ADACURSES(1)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html new file mode 100644 index 00000000000..05f36871ed2 --- /dev/null +++ b/doc/html/man/captoinfo.1m.html @@ -0,0 +1,229 @@ + + + + +captoinfo 1m + + + + +

captoinfo 1m

+
+
+
+captoinfo(1m)                                             captoinfo(1m)
+
+
+
+
+
+

NAME

+       captoinfo  - convert a termcap description into a terminfo
+       description
+
+
+
+

SYNOPSIS

+       captoinfo [-vn width]  [-V] [-1] [-w width] file . . .
+
+
+
+

DESCRIPTION

+       captoinfo looks  in  each  given  text  file  for  termcap
+       descriptions.   For each one found, an equivalent terminfo
+       description is written to  standard  output.   Termcap  tc
+       capabilities are translated directly to terminfo use capa-
+       bilities.
+
+       If no file is given, then the environment variable TERMCAP
+       is  used  for the filename or entry.  If TERMCAP is a full
+       pathname to a file, only the terminal whose name is speci-
+       fied  in  the  environment variable TERM is extracted from
+       that file.  If the environment  variable  TERMCAP  is  not
+       set, then the file /usr/share/terminfo is read.
+
+       -v   print  out  tracing  information on standard error as
+            the program runs.
+
+       -V   print out the version of the program in use on  stan-
+            dard error and exit.
+
+       -1   cause  the fields to print out one to a line.  Other-
+            wise, the fields will be printed several to a line to
+            a maximum width of 60 characters.
+
+       -w   change the output to width characters.
+
+
+
+

FILES

+       /usr/share/terminfo Compiled      terminal     description
+                           database.
+
+
+
+

TRANSLATIONS FROM NONSTANDARD CAPABILITIES

+       Some obsolete nonstandard capabilities will  automatically
+       be  translated  into  standard  (SVr4/XSI Curses) terminfo
+       capabilities by captoinfo.  Whenever one  of  these  auto-
+       matic  translations  is  done,  the  program will issue an
+       notification to stderr, inviting the user to check that it
+       has  not  mistakenly  translated  a completely unknown and
+       random capability and/or syntax error.
+
+
+       Nonstd   Std    From           Terminfo
+        name    name                 capability
+       -----------------------------------------------
+       BO       mr     AT&T    enter_reverse_mode
+       CI       vi     AT&T    cursor_invisible
+       CV       ve     AT&T    cursor_normal
+       DS       mh     AT&T    enter_dim_mode
+       EE       me     AT&T    exit_attribute_mode
+       FE       LF     AT&T    label_on
+       FL       LO     AT&T    label_off
+       XS       mk     AT&T    enter_secure_mode
+       EN       @7     XENIX   key_end
+       GE       ae     XENIX   exit_alt_charset_mode
+       GS       as     XENIX   enter_alt_charset_mode
+
+       HM       kh     XENIX   key_home
+       LD       kL     XENIX   key_dl
+       PD       kN     XENIX   key_npage
+       PN       po     XENIX   prtr_off
+       PS       pf     XENIX   prtr_on
+       PU       kP     XENIX   key_ppage
+       RT       @8     XENIX   kent
+       UP       ku     XENIX   kcuu1
+       KA       k;     Tek     key_f10
+       KB       F1     Tek     key_f11
+       KC       F2     Tek     key_f12
+       KD       F3     Tek     key_f13
+       KE       F4     Tek     key_f14
+       KF       F5     Tek     key_f15
+       BC       Sb     Tek     set_background
+       FC       Sf     Tek     set_foreground
+       HS       mh     Iris    enter_dim_mode
+
+       XENIX termcap also used to have a set of  extension  capa-
+       bilities  for forms drawing, designed to take advantage of
+       the IBM PC high-half graphics.  They were as follows:
+
+
+       Cap          Graphic
+       -----------------------------
+       G2    upper left
+       G3    lower left
+       G1    upper right
+       G4    lower right
+       GR    pointing right
+       GL    pointing left
+       GU    pointing up
+       GD    pointing down
+       GH    horizontal line
+       GV    vertical line
+       GC    intersection
+       G6    upper left
+       G7    lower left
+       G5    upper right
+       G8    lower right
+       Gr    tee pointing right
+       Gr    tee pointing left
+       Gu    tee pointing up
+       Gd    tee pointing down
+       Gh    horizontal line
+       Gv    vertical line
+       Gc    intersection
+       GG    acs magic cookie count
+
+       If the single-line capabilities occur in  an  entry,  they
+       will  automatically  be composed into an acsc string.  The
+       double-line capabilities and GG are discarded with a warn-
+       ing message.
+
+       IBM's AIX has a terminfo facility descended from SVr1 ter-
+       minfo but incompatible with the SVr4 format.  The  follow-
+       ing AIX extensions are automatically translated:
+
+        IBM    XSI
+       -------------
+       ksel    kslt
+       kbtab   kcbt
+       font0   s0ds
+       font1   s1ds
+       font2   s2ds
+
+       font3   s3ds
+
+       Additionally,  the  AIX  box1 capability will be automati-
+       cally translated to an acsc string.
+
+       Hewlett-Packard's terminfo library supports  two  nonstan-
+       dard  terminfo  capabilities  meml  (memory lock) and memu
+       (memory unlock).  These will be discarded with  a  warning
+       message.
+
+
+
+

NOTES

+       This  utility is actually a link to tic(1m), running in -I
+       mode.  You can use other tic options such as -f and  -x.
+
+       The trace option is not identical to SVr4's.  Under  SVr4,
+       instead  of  following  the  -v  with a trace level n, you
+       repeat it n times.
+
+
+
+

SEE ALSO

+       infocmp(1m), curses(3x), terminfo(5)
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+

AUTHOR

+       Eric S. Raymond <esr@snark.thyrsus.com> and
+       Thomas E. Dickey <dickey@invisible-island.net>
+
+
+
+                                                          captoinfo(1m)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html new file mode 100644 index 00000000000..2edf5a9aa97 --- /dev/null +++ b/doc/html/man/clear.1.html @@ -0,0 +1,84 @@ + + + + +clear 1 + + + + +

clear 1

+
+
+
+clear(1)                                                       clear(1)
+
+
+
+
+
+

NAME

+       clear - clear the terminal screen
+
+
+
+

SYNOPSIS

+       clear
+
+
+
+

DESCRIPTION

+       clear clears your screen if this is possible.  It looks in
+       the environment for the terminal type and then in the ter-
+       minfo database to figure out how to clear the screen.
+
+       clear  ignores  any  command-line  parameters  that may be
+       present.
+
+
+
+

SEE ALSO

+       tput(1), terminfo(5)
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                               clear(1)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_add_wch.3x.html b/doc/html/man/curs_add_wch.3x.html new file mode 100644 index 00000000000..77ed34d591b --- /dev/null +++ b/doc/html/man/curs_add_wch.3x.html @@ -0,0 +1,232 @@ + + + + +curs_add_wch 3x + + + + +

curs_add_wch 3x

+
+
+
+curs_add_wch(3x)                                       curs_add_wch(3x)
+
+
+
+
+
+

NAME

+       add_wch,   wadd_wch,  mvadd_wch,  mvwadd_wch,  echo_wchar,
+       wecho_wchar - add a complex character and rendition  to  a
+       curses window, then advance the cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int add_wch( const cchar_t *wch );
+       int wadd_wch( WINDOW *win, const cchar_t *wch );
+       int mvadd_wch( int y, int x, const cchar_t *wch );
+       int  mvwadd_wch(  WINDOW *win, int y, int x, const cchar_t
+       *wch );
+       int echo_wchar( const cchar_t *wch );
+       int wecho_wchar( WINDOW *win, const cchar_t *wch );
+
+
+
+

DESCRIPTION

+       The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions
+       put the complex character wch into the given window at its
+       current position, which is then advanced.  These functions
+       perform  wrapping and special-character processing as fol-
+       lows:
+
+       o   If wch refers to a spacing character, then any  previ-
+           ous  character  at  that  location  is removed.  A new
+           character specified by wch is placed at that  location
+           with  rendition  specified  by  wch.   The cursor then
+           advances to the next spacing character on the  screen.
+
+       o   If wch refers to a non-spacing character, all previous
+           characters at that location are preserved.   The  non-
+           spacing  characters  of  wch  are added to the spacing
+           complex character, and the rendition specified by  wch
+           is ignored.
+
+       o   If  the  character  part  of  wch  is  a tab, newline,
+           backspace or other control character,  the  window  is
+           updated  and the cursor moves as if addch were called.
+
+       The echo_wchar function is functionally  equivalent  to  a
+       call to add_wch followed by a call to refresh.  Similarly,
+       the wecho_wchar is functionally equivalent to  a  call  to
+       wadd_wch  followed  by  a call to wrefresh.  The knowledge
+       that only a single character is being output is taken into
+       consideration and, for non-control characters, a consider-
+       able performance gain might be seen by  using  the  *echo*
+       functions instead of their equivalents.
+
+   Line Graphics
+       Like  addch(3x),  addch_wch  accepts symbols which make it
+       simple to draw lines and  other  frequently  used  special
+       characters.   These  symbols  correspond to the same VT100
+       line-drawing set as addch(3x).
+
+
+       Name              Unicode    Default   Description
+       ----------------------------------------------------------------
+       WACS_BLOCK        0x25ae     #         solid square block
+       WACS_BOARD        0x2592     #         board of squares
+       WACS_BTEE         0x2534     +         bottom tee
+       WACS_BULLET       0x00b7     o         bullet
+
+       WACS_CKBOARD      0x2592     :         checker board (stipple)
+       WACS_DARROW       0x2193     v         arrow pointing down
+       WACS_DEGREE       0x00b0     '         degree symbol
+       WACS_DIAMOND      0x25c6     +         diamond
+       WACS_GEQUAL       0x2265     >         greater-than-or-equal-to
+       WACS_HLINE        0x2500     -         horizontal line
+       WACS_LANTERN      0x2603     #         lantern symbol
+       WACS_LARROW       0x2190     <         arrow pointing left
+       WACS_LEQUAL       0x2264     <         less-than-or-equal-to
+       WACS_LLCORNER     0x2514     +         lower left-hand corner
+       WACS_LRCORNER     0x2518     +         lower right-hand corner
+       WACS_LTEE         0x2524     +         left tee
+       WACS_NEQUAL       0x2260     !         not-equal
+       WACS_PI           0x03c0     *         greek pi
+       WACS_PLMINUS      0x00b1     #         plus/minus
+       WACS_PLUS         0x253c     +         plus
+       WACS_RARROW       0x2192     >         arrow pointing right
+       WACS_RTEE         0x251c     +         right tee
+       WACS_S1           0x23ba     -         scan line 1
+       WACS_S3           0x23bb     -         scan line 3
+       WACS_S7           0x23bc     -         scan line 7
+       WACS_S9           0x23bd     _         scan line 9
+       WACS_STERLING     0x00a3     f         pound-sterling symbol
+       WACS_TTEE         0x252c     +         top tee
+       WACS_UARROW       0x2191     ^         arrow pointing up
+       WACS_ULCORNER     0x250c     +         upper left-hand corner
+       WACS_URCORNER     0x2510     +         upper right-hand corner
+       WACS_VLINE        0x2502     |         vertical line
+
+       The wide-character configuration of ncurses  also  defines
+       symbols for thick- and double-lines:
+
+
+       Name              Unicode   Default   Description
+       ---------------------------------------------------------------------
+       WACS_T_ULCORNER   0x250f    +         thick upper left corner
+       WACS_T_LLCORNER   0x2517    +         thick lower left corner
+       WACS_T_URCORNER   0x2513    +         thick upper right corner
+       WACS_T_LRCORNER   0x251b    +         thick lower right corner
+       WACS_T_LTEE       0x252b    +         thick tee pointing right
+       WACS_T_RTEE       0x2523    +         thick tee pointing left
+       WACS_T_BTEE       0x253b    +         thick tee pointing up
+       WACS_T_TTEE       0x2533    +         thick tee pointing down
+       WACS_T_HLINE      0x2501    -         thick horizontal line
+       WACS_T_VLINE      0x2503    |         thick vertical line
+       WACS_T_PLUS       0x254b    +         thick large plus or crossover
+       WACS_D_ULCORNER   0x2554    +         double upper left corner
+       WACS_D_LLCORNER   0x255a    +         double lower left corner
+       WACS_D_URCORNER   0x2557    +         double upper right corner
+       WACS_D_LRCORNER   0x255d    +         double lower right corner
+       WACS_D_RTEE       0x2563    +         double tee pointing left
+       WACS_D_LTEE       0x2560    +         double tee pointing right
+       WACS_D_BTEE       0x2569    +         double tee pointing up
+       WACS_D_TTEE       0x2566    +         double tee pointing down
+       WACS_D_HLINE      0x2550    -         double horizontal line
+       WACS_D_VLINE      0x2551    |         double vertical line
+       WACS_D_PLUS       0x256c    +         double large plus or crossover
+
+
+
+

RETURN VALUES

+       All routines return the integer ERR upon failure and OK on
+       success.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that add_wch, mvadd_wch, mvwadd_wch,  and  echo_wchar
+       may be macros.
+
+
+
+

PORTABILITY

+       All  of  these  functions  are described in the XSI Curses
+       standard, Issue 4.  The defaults specified for  line-draw-
+       ing characters apply in the POSIX locale.
+
+       X/Open Curses makes it clear that the WACS_ symbols should
+       be defined as a pointer to cchar_t data, e.g., in the dis-
+       cussion of border_set.  A few implementations are problem-
+       atic:
+
+       o   NetBSD curses defines the symbols as a wchar_t  within
+           a cchar_t.
+
+       o   HPUX  curses  equates  some of the ACS_ symbols to the
+           analogous WACS_ symbols as if the  ACS_  symbols  were
+           wide  characters.   The  misdefined  symbols  are  the
+           arrows and other symbols which are not used for  line-
+           drawing.
+
+       X/Open  Curses  does not define symbols for thick- or dou-
+       ble-lines.   SVr4  curses  implementations  defined  their
+       line-drawing  symbols  in  terms  of intermediate symbols.
+       This implementation extends those symbols,  providing  new
+       definitions which are not in the SVr4 implementations.
+
+
+
+

SEE ALSO

+       curses(3x), curs_addch(3x), curs_attr(3x), curs_clear(3x),
+       curs_outopts(3x), curs_refresh(3x), putwc(3)
+
+
+
+                                                       curs_add_wch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_add_wchstr.3x.html b/doc/html/man/curs_add_wchstr.3x.html new file mode 100644 index 00000000000..0f676ce3a15 --- /dev/null +++ b/doc/html/man/curs_add_wchstr.3x.html @@ -0,0 +1,131 @@ + + + + +curs_add_wchstr 3x + + + + +

curs_add_wchstr 3x

+
+
+
+curs_add_wchstr(3x)                                 curs_add_wchstr(3x)
+
+
+
+
+
+

NAME

+       add_wchstr,    add_wchnstr,   wadd_wchstr,   wadd_wchnstr,
+       mvadd_wchstr, mvadd_wchnstr, mvwadd_wchstr, mvwadd_wchnstr
+       - add an array of complex characters (and attributes) to a
+       curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int add_wchstr(const cchar_t *wchstr);
+       int add_wchnstr(const cchar_t *wchstr, int n);
+       int wadd_wchstr(WINDOW * win, const cchar_t *wchstr);
+       int wadd_wchnstr(WINDOW * win, const cchar_t *wchstr, int n);
+       int mvadd_wchstr(int y, int x, const cchar_t *wchstr);
+       int mvadd_wchnstr(int y, int x, const cchar_t *wchstr, int n);
+       int mvwadd_wchstr(WINDOW *win, int y, int x, const cchar_t *wchstr);
+       int mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wchstr, int n);
+
+
+
+

DESCRIPTION

+       These routines copy the array of complex characters wchstr
+       into  the  window image structure at and after the current
+       cursor position.  The four routines with  n  as  the  last
+       argument  copy  at  most n elements, but no more than will
+       fit on the line.  If n=-1 then the whole array is  copied,
+       to  the  maximum number of characters that will fit on the
+       line.
+
+       The window cursor is not advanced.   These  routines  work
+       faster than waddnstr.  On the other hand, they do not per-
+       form checking (such as for the newline, backspace, or car-
+       riage  return characters), they do not advance the current
+       cursor position, they do not expand other control  charac-
+       ters  to  ^-escapes,  and  they  truncate the string if it
+       crosses the right margin, rather than wrapping  it  around
+       to the new line.
+
+       These  routines  end  successfully  on encountering a null
+       cchar_t, or when they have filled the current line.  If  a
+       complex  character cannot completely fit at the end of the
+       current line, the remaining columns are  filled  with  the
+       background character and rendition.
+
+
+
+

NOTES

+       All functions except wadd_wchnstr may be macros.
+
+
+
+

RETURN VALUES

+       All routines return the integer ERR upon failure and OK on
+       success.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

PORTABILITY

+       All these entry points are described  in  the  XSI  Curses
+       standard, Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x), curs_addchstr(3x), curs_addwstr(3x)
+
+
+
+                                                    curs_add_wchstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_addch.3x.html b/doc/html/man/curs_addch.3x.html new file mode 100644 index 00000000000..af567118c69 --- /dev/null +++ b/doc/html/man/curs_addch.3x.html @@ -0,0 +1,220 @@ + + + + +curs_addch 3x + + + + +

curs_addch 3x

+
+
+
+curs_addch(3x)                                           curs_addch(3x)
+
+
+
+
+
+

NAME

+       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
+       add a character (with attributes) to a curses window, then
+       advance the cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addch(const chtype ch);
+       int waddch(WINDOW *win, const chtype ch);
+       int mvaddch(int y, int x, const chtype ch);
+       int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
+       int echochar(const chtype ch);
+       int wechochar(WINDOW *win, const chtype ch);
+
+
+
+

DESCRIPTION

+       The  addch,  waddch, mvaddch and mvwaddch routines put the
+       character ch into the given window at its  current  window
+       position,  which  is then advanced.  They are analogous to
+       putchar in stdio(3).  If the advance is at the right  mar-
+       gin,  the  cursor  automatically wraps to the beginning of
+       the next line.  At the bottom  of  the  current  scrolling
+       region,  if  scrollok  is enabled, the scrolling region is
+       scrolled up one line.
+
+       If ch is a tab, newline, or backspace, the cursor is moved
+       appropriately within the window.  Backspace moves the cur-
+       sor one character left; at the left edge of  a  window  it
+       does  nothing.   Newline  does  a clrtoeol, then moves the
+       cursor to  the  window  left  margin  on  the  next  line,
+       scrolling  the  window if on the last line.  Tabs are con-
+       sidered to be at every eighth column.   The  tab  interval
+       may be altered by setting the TABSIZE variable.
+
+       If ch is any control character other than tab, newline, or
+       backspace, it is drawn  in  ^X  notation.   Calling  winch
+       after adding a control character does not return the char-
+       acter itself, but instead returns the ^-representation  of
+       the control character.
+
+       Video attributes can be combined with a character argument
+       passed to addch or related functions by logical-ORing them
+       into  the  character.   (Thus, text, including attributes,
+       can be copied from one place to  another  using  inch  and
+       addch.)   See  the curs_attr(3x) page for values of prede-
+       fined video attribute constants that can be usefully OR'ed
+       into characters.
+
+       The  echochar  and  wechochar routines are equivalent to a
+       call to addch followed by a call to refresh, or a call  to
+       waddch followed by a call to wrefresh.  The knowledge that
+       only a single character is being output is used  and,  for
+       non-control  characters,  a  considerable performance gain
+       may be seen by  using  these  routines  instead  of  their
+       equivalents.
+
+   Line Graphics
+       The  following  variables  may be used to add line drawing
+       characters to the screen with routines of the  addch  fam-
+       ily.   The  default  character listed below is used if the
+       acsc  capability  does  not  define  a   terminal-specific
+       replacement  for  it.   The  names  are  taken  from VT100
+       nomenclature.
+
+
+       Name           Default   Description
+       --------------------------------------------------
+       ACS_BLOCK      #         solid square block
+       ACS_BOARD      #         board of squares
+       ACS_BTEE       +         bottom tee
+       ACS_BULLET     o         bullet
+       ACS_CKBOARD    :         checker board (stipple)
+       ACS_DARROW     v         arrow pointing down
+       ACS_DEGREE     '         degree symbol
+       ACS_DIAMOND    +         diamond
+       ACS_GEQUAL     >         greater-than-or-equal-to
+       ACS_HLINE      -         horizontal line
+       ACS_LANTERN    #         lantern symbol
+       ACS_LARROW     <         arrow pointing left
+       ACS_LEQUAL     <         less-than-or-equal-to
+       ACS_LLCORNER   +         lower left-hand corner
+       ACS_LRCORNER   +         lower right-hand corner
+       ACS_LTEE       +         left tee
+       ACS_NEQUAL     !         not-equal
+       ACS_PI         *         greek pi
+       ACS_PLMINUS    #         plus/minus
+       ACS_PLUS       +         plus
+       ACS_RARROW     >         arrow pointing right
+       ACS_RTEE       +         right tee
+       ACS_S1         -         scan line 1
+       ACS_S3         -         scan line 3
+       ACS_S7         -         scan line 7
+       ACS_S9         _         scan line 9
+       ACS_STERLING   f         pound-sterling symbol
+       ACS_TTEE       +         top tee
+       ACS_UARROW     ^         arrow pointing up
+       ACS_ULCORNER   +         upper left-hand corner
+       ACS_URCORNER   +         upper right-hand corner
+       ACS_VLINE      |         vertical line
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and OK on
+       success  (the  SVr4 manuals specify only "an integer value
+       other than ERR") upon successful completion, unless other-
+       wise noted in the preceding routine descriptions.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note  that  addch,  mvaddch, mvwaddch, and echochar may be
+       macros.
+
+
+
+

PORTABILITY

+       All these functions are described in the XSI Curses  stan-
+       dard,  Issue  4.  The defaults specified for forms-drawing
+       characters apply in the POSIX locale.
+
+       X/Open Curses states that the ACS_  definitions  are  char
+       constants.   For  the  wide-character  implementation (see
+       curs_add_wch), there are analogous WACS_ definitions which
+       are cchar_t constants.
+
+       Some  ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL,
+       ACS_PI, ACS_NEQUAL, ACS_STERLING) were not  documented  in
+       any  publicly  released  System V.  However, many publicly
+       available terminfos include acsc strings  in  which  their
+       key  characters  (pryz{|}) are embedded, and a second-hand
+       list of their character descriptions has  come  to  light.
+       The   ACS-prefixed   names  for  them  were  invented  for
+       ncurses(3x).
+
+       The TABSIZE variable is implemented in  some  versions  of
+       curses, but is not part of X/Open curses.
+
+       If  ch  is  a  carriage return, the cursor is moved to the
+       beginning of the current row of the window.  This is  true
+       of other implementations, but is not documented.
+
+
+
+

SEE ALSO

+       curses(3x),  curs_attr(3x), curs_clear(3x), curs_inch(3x),
+       curs_outopts(3x),  curs_refresh(3x),   curs_variables(3x),
+       putc(3).
+
+       Comparable  functions  in  the  wide-character  (ncursesw)
+       library are described in curs_add_wch(3x).
+
+
+
+                                                         curs_addch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_addchstr.3x.html b/doc/html/man/curs_addchstr.3x.html new file mode 100644 index 00000000000..e8861399946 --- /dev/null +++ b/doc/html/man/curs_addchstr.3x.html @@ -0,0 +1,133 @@ + + + + +curs_addchstr 3x + + + + +

curs_addchstr 3x

+
+
+
+curs_addchstr(3x)                                     curs_addchstr(3x)
+
+
+
+
+
+

NAME

+       addchstr, addchnstr, waddchstr, waddchnstr, mvaddchstr,
+       mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a string of
+       characters (and attributes) to a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addchstr(const chtype *chstr);
+       int addchnstr(const chtype *chstr, int n);
+       int waddchstr(WINDOW *win, const chtype *chstr);
+       int waddchnstr(WINDOW *win, const chtype *chstr, int n);
+       int mvaddchstr(int y, int x, const chtype *chstr);
+       int mvaddchnstr(int y, int x, const chtype *chstr, int n);
+       int  mvwaddchstr(WINDOW  *win,  int y, int x, const chtype
+       *chstr);
+       int mvwaddchnstr(WINDOW *win, int y, int x,  const  chtype
+       *chstr, int n);
+
+
+
+

DESCRIPTION

+       These  routines copy chstr into the window image structure
+       at and after the current cursor position.  The  four  rou-
+       tines with n as the last argument copy at most n elements,
+       but no more than will fit on the line.  If n=-1  then  the
+       whole  string  is copied, to the maximum number of charac-
+       ters that will fit on the line.
+
+       The window cursor is not advanced, and these routines work
+       faster than waddnstr.  On the other hand, they do not per-
+       form any kind  of  checking  (such  as  for  the  newline,
+       backspace, or carriage return characters), they do not ad-
+       vance the current cursor position, they do not expand oth-
+       er  control characters to ^-escapes, and they truncate the
+       string if it crosses the right margin, rather  than  wrap-
+       ping it around to the new line.
+
+
+
+

RETURN VALUES

+       All routines return the integer ERR upon failure and OK on
+       success (the SVr4 manuals specify only "an  integer  value
+       other than ERR") upon successful completion, unless other-
+       wise noted in the preceding routine descriptions.
+
+       X/Open does not define any error conditions.  This  imple-
+       mentation returns an error if the window pointer is null.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that all routines except waddchnstr may be macros.
+
+
+
+

PORTABILITY

+       These  entry  points are described in the XSI Curses stan-
+       dard, Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x).
+
+       Comparable functions in the wide-character (ncursesw)  li-
+       brary are described in curs_add_wchstr(3x).
+
+
+
+                                                      curs_addchstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_addstr.3x.html b/doc/html/man/curs_addstr.3x.html new file mode 100644 index 00000000000..d89503cc8bc --- /dev/null +++ b/doc/html/man/curs_addstr.3x.html @@ -0,0 +1,125 @@ + + + + +curs_addstr 3x + + + + +

curs_addstr 3x

+
+
+
+curs_addstr(3x)                                         curs_addstr(3x)
+
+
+
+
+
+

NAME

+       addstr, addnstr, waddstr, waddnstr, mvaddstr, mvaddnstr,
+       mvwaddstr, mvwaddnstr - add a string of characters to a
+       curses window and advance cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addstr(const char *str);
+       int addnstr(const char *str, int n);
+       int waddstr(WINDOW *win, const char *str);
+       int waddnstr(WINDOW *win, const char *str, int n);
+       int mvaddstr(int y, int x, const char *str);
+       int mvaddnstr(int y, int x, const char *str, int n);
+       int mvwaddstr(WINDOW *win, int y, int x, const char *str);
+       int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);
+
+
+
+

DESCRIPTION

+       These routines write the characters of the (null-terminat-
+       ed) character string str on the given window.  It is simi-
+       lar  to  calling  waddch  once  for  each character in the
+       string.  The four routines with n  as  the  last  argument
+       write  at  most n characters.  If n is -1, then the entire
+       string will be added, up to the maximum number of  charac-
+       ters  that  will  fit  on the line, or until a terminating
+       null is reached.
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and OK on
+       success  (the  SVr4 manuals specify only "an integer value
+       other than ERR") upon successful completion.
+
+       X/Open does not define any error conditions.  This  imple-
+       mentation  returns  an error if the window pointer is null
+       or if the string pointer is null or if  the  corresponding
+       calls to waddch return an error.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note  that  all  of  these  routines  except  waddstr  and
+       waddnstr may be macros.
+
+
+
+

PORTABILITY

+       All these entry points are described  in  the  XSI  Curses
+       standard,  Issue  4.  The XSI errors EILSEQ and EOVERFLOW,
+       associated with extended-level conformance,  are  not  yet
+       detected.
+
+
+
+

SEE ALSO

+       curses(3x), curs_addch(3x).
+
+
+
+                                                        curs_addstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_addwstr.3x.html b/doc/html/man/curs_addwstr.3x.html new file mode 100644 index 00000000000..99ab802ec68 --- /dev/null +++ b/doc/html/man/curs_addwstr.3x.html @@ -0,0 +1,124 @@ + + + + +curs_addwstr 3x + + + + +

curs_addwstr 3x

+
+
+
+curs_addwstr(3x)                                       curs_addwstr(3x)
+
+
+
+
+
+

NAME

+       addwstr, addnwstr, waddwstr, waddnwstr, mvaddwstr,
+       mvaddnwstr, mvwaddwstr, mvwaddnwstr - add a string of wide
+       characters to a curses window and advance cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addwstr(const wchar_t *wstr);
+       int addnwstr(const wchar_t *wstr, int n);
+       int waddwstr(WINDOW *win, const wchar_t *wstr);
+       int waddnwstr(WINDOW *win, const wchar_t *wstr, int n);
+       int mvaddwstr(int y, int x, const wchar_t *wstr);
+       int mvaddnwstr(int y, int x, const wchar_t *wstr, int n);
+       int mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *wstr);
+       int mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
+
+
+
+

DESCRIPTION

+       These routines write the characters of the (null-terminat-
+       ed) wchar_t character string wstr on the given window.  It
+       is  similar  to constructing a cchar_t for each wchar_t in
+       the  string,  then  calling  wadd_wch  for  the  resulting
+       cchar_t.
+
+       The mv routines perform cursor movement once, before writ-
+       ing any characters.  Thereafter, the cursor is advanced as
+       a side-effect of writing to the window.
+
+       The  four  routines  with  n as the last argument write at
+       most n wchar_t characters.  If n is -1,  then  the  entire
+       string  will be added, up to the maximum number of charac-
+       ters that will fit on the line,  or  until  a  terminating
+       null is reached.
+
+
+
+

RETURN VALUES

+       All routines return the integer ERR upon failure and OK on
+       success.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that all of these routines except  waddnwstr  may  be
+       macros.
+
+
+
+

PORTABILITY

+       All  these  entry  points  are described in the XSI Curses
+       standard, Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x), curs_add_wch(3x)
+
+
+
+                                                       curs_addwstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_attr.3x.html b/doc/html/man/curs_attr.3x.html new file mode 100644 index 00000000000..23a157332e7 --- /dev/null +++ b/doc/html/man/curs_attr.3x.html @@ -0,0 +1,267 @@ + + + + +curs_attr 3x + + + + +

curs_attr 3x

+
+
+
+curs_attr(3x)                                             curs_attr(3x)
+
+
+
+
+
+

NAME

+       attroff, wattroff, attron, wattron, attrset, wattrset,
+       color_set, wcolor_set, standend, wstandend, standout,
+       wstandout, attr_get, wattr_get, attr_off, wattr_off,
+       attr_on, wattr_on, attr_set, wattr_set, chgat, wchgat,
+       mvchgat, mvwchgat, PAIR_NUMBER - curses character and
+       window attribute control routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int attroff(int attrs);
+       int wattroff(WINDOW *win, int attrs);
+       int attron(int attrs);
+       int wattron(WINDOW *win, int attrs);
+       int attrset(int attrs);
+       int wattrset(WINDOW *win, int attrs);
+       int color_set(short color_pair_number, void* opts);
+       int wcolor_set(WINDOW *win, short color_pair_number,
+             void* opts);
+       int standend(void);
+       int wstandend(WINDOW *win);
+       int standout(void);
+       int wstandout(WINDOW *win);
+       int attr_get(attr_t *attrs, short *pair, void *opts);
+       int wattr_get(WINDOW *win, attr_t *attrs, short *pair,
+              void *opts);
+       int attr_off(attr_t attrs, void *opts);
+       int wattr_off(WINDOW *win, attr_t attrs, void *opts);
+       int attr_on(attr_t attrs, void *opts);
+       int wattr_on(WINDOW *win, attr_t attrs, void *opts);
+       int attr_set(attr_t attrs, short pair, void *opts);
+       int wattr_set(WINDOW *win, attr_t attrs, short pair,  void
+       *opts);
+       int chgat(int n, attr_t attr, short color,
+             const void *opts)
+       int wchgat(WINDOW *win, int n, attr_t attr,
+             short color, const void *opts)
+       int mvchgat(int y, int x, int n, attr_t attr,
+             short color, const void *opts)
+       int mvwchgat(WINDOW *win, int y, int x, int n,
+             attr_t attr, short color, const void *opts)
+
+
+
+

DESCRIPTION

+       These  routines  manipulate  the current attributes of the
+       named window.  The current attributes of a window apply to
+       all characters that are written into the window with wadd-
+       ch, waddstr and wprintw.  Attributes are a property of the
+       character,   and  move  with  the  character  through  any
+       scrolling and insert/delete line/character operations.  To
+       the  extent  possible,  they  are displayed as appropriate
+       modifications to the graphic rendition of  characters  put
+       on the screen.
+
+       The  routine  attrset  sets  the current attributes of the
+       given window to attrs.  The routine attroff turns off  the
+       named  attributes  without turning any other attributes on
+       or off.  The routine attron turns on the named  attributes
+       without affecting any others.  The routine standout is the
+       same as attron(A_STANDOUT).  The routine standend  is  the
+       same as attrset(A_NORMAL) or attrset(0), that is, it turns
+       off all attributes.
+
+       The attrset and related routines do  not  affect  the  at-
+       tributes  used  when  erasing portions of the window.  See
+       curs_bkgd(3x) for functions which  modify  the  attributes
+       used for erasing and clearing.
+
+       The  routine color_set sets the current color of the given
+       window to the foreground/background combination  described
+       by  the  color_pair_number. The parameter opts is reserved
+       for future use, applications must supply a null pointer.
+
+       The routine wattr_get returns the  current  attribute  and
+       color pair for the given window; attr_get returns the cur-
+       rent attribute and color pair for stdscr.   The  remaining
+       attr_*  functions  operate  exactly like the corresponding
+       attr* functions, except that they take arguments  of  type
+       attr_t rather than int.
+
+       The routine chgat changes the attributes of a given number
+       of characters starting at the current cursor  location  of
+       stdscr.   It  does not update the cursor and does not per-
+       form wrapping.  A character count of -1  or  greater  than
+       the  remaining window width means to change attributes all
+       the way to the end of the current line.  The wchgat  func-
+       tion generalizes this to any window; the mvwchgat function
+       does a cursor move before acting.  In these functions, the
+       color  argument is a color-pair index (as in the first ar-
+       gument of init_pair, see curs_color(3x)).  The opts  argu-
+       ment is not presently used, but is reserved for the future
+       (leave it NULL).
+
+   Attributes
+       The following video attributes, defined in <curses.h>, can
+       be passed to the routines attron, attroff, and attrset, or
+       OR'd with the characters passed to addch.
+
+
+        A_NORMAL        Normal display (no highlight)
+        A_STANDOUT      Best highlighting mode of the terminal.
+        A_UNDERLINE     Underlining
+        A_REVERSE       Reverse video
+        A_BLINK         Blinking
+        A_DIM           Half bright
+        A_BOLD          Extra bright or bold
+        A_PROTECT       Protected mode
+        A_INVIS         Invisible or blank mode
+        A_ALTCHARSET    Alternate character set
+        A_CHARTEXT      Bit-mask to extract a character
+        COLOR_PAIR(n)   Color-pair number n
+
+       The following macro is the reverse of COLOR_PAIR(n):
+
+       PAIR_NUMBER(attrs) Returns the pair number associated
+                          with the COLOR_PAIR(n) attribute.
+
+       The return values of many of these routines are not  mean-
+       ingful (they are implemented as macro-expanded assignments
+       and simply return their argument).  The SVr4  manual  page
+       claims (falsely) that these routines always return 1.
+
+
+
+

NOTES

+       Note  that  attroff,  wattroff,  attron, wattron, attrset,
+       wattrset, standend and standout may be macros.
+
+       COLOR_PAIR values can only be OR'd with attributes if  the
+       pair  number  is  less  than 256.  The alternate functions
+       such as color_set can pass a color  pair  value  directly.
+       However,  ncurses  ABI 4 and 5 simply OR this value within
+       the alternate functions.  You must use ncurses  ABI  6  to
+       support more than 256 color pairs.
+
+
+
+

PORTABILITY

+       These  functions are supported in the XSI Curses standard,
+       Issue 4.  The standard  defined  the  dedicated  type  for
+       highlights,  attr_t,  which is not defined in SVr4 curses.
+       The functions taking attr_t arguments  are  not  supported
+       under SVr4.
+
+       The XSI Curses standard states that whether the tradition-
+       al functions  attron/attroff/attrset  can  manipulate  at-
+       tributes  other  than  A_BLINK,  A_BOLD, A_DIM, A_REVERSE,
+       A_STANDOUT, or A_UNDERLINE is "unspecified".   Under  this
+       implementation  as  well  as  SVr4 curses, these functions
+       correctly manipulate all other  highlights  (specifically,
+       A_ALTCHARSET, A_PROTECT, and A_INVIS).
+
+       XSI  Curses added the new entry points, attr_get, attr_on,
+       attr_off, attr_set, wattr_on, wattr_off,  wattr_get,  wat-
+       tr_set.   These  are intended to work with a new series of
+       highlight macros prefixed with WA_.
+
+       Older versions of this library did not force an update  of
+       the  screen when changing the attributes.  Use touchwin to
+       force the screen to match the updated attributes.
+
+
+        WA_NORMAL       Normal display (no highlight)
+        WA_STANDOUT     Best highlighting mode of the terminal.
+        WA_UNDERLINE    Underlining
+        WA_REVERSE      Reverse video
+        WA_BLINK        Blinking
+        WA_DIM          Half bright
+        WA_BOLD         Extra bright or bold
+        WA_ALTCHARSET   Alternate character set
+
+       The XSI curses standard specifies that each pair of corre-
+       sponding  A_  and WA_-using functions operates on the same
+       current-highlight information.
+
+       The XSI standard extended conformance level adds new high-
+       lights A_HORIZONTAL, A_LEFT, A_LOW, A_RIGHT, A_TOP, A_VER-
+       TICAL (and corresponding WA_ macros for each)  which  this
+       implementation does not yet support.
+
+
+
+

RETURN VALUE

+       All  routines  return the integer OK on success, or ERR on
+       failure.
+
+       X/Open does not define any error conditions.
+
+       This implementation returns an error if the window pointer
+       is  null.  The wcolor_set function returns an error if the
+       color  pair  parameter  is  outside  the   range   0..COL-
+       OR_PAIRS-1.   This  implementation  also provides getattrs
+       for compatibility with older versions of curses.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

SEE ALSO

+       curses(3x),        curs_addch(3x),        curs_addstr(3x),
+       curs_bkgd(3x), curs_printw(3x), curs_variables(3x)
+
+
+
+                                                          curs_attr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_beep.3x.html b/doc/html/man/curs_beep.3x.html new file mode 100644 index 00000000000..e450ce29bfb --- /dev/null +++ b/doc/html/man/curs_beep.3x.html @@ -0,0 +1,106 @@ + + + + +curs_beep 3x + + + + +

curs_beep 3x

+
+
+
+curs_beep(3x)                                             curs_beep(3x)
+
+
+
+
+
+

NAME

+       beep, flash - curses bell and screen flash routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int beep(void);
+       int flash(void);
+
+
+
+

DESCRIPTION

+       The beep and flash routines are used to alert the terminal
+       user.  The routine beep sounds an  audible  alarm  on  the
+       terminal,  if  possible;  otherwise  it flashes the screen
+       (visible bell).  The routine flash flashes the screen, and
+       if  that  is  not  possible, sounds the alert.  If neither
+       alert is possible, nothing happens.  Nearly all  terminals
+       have  an  audible  alert (bell or beep), but only some can
+       flash the screen.
+
+
+
+

RETURN VALUE

+       These routines return OK if they  succeed  in  beeping  or
+       flashing, ERR otherwise.
+
+
+
+

EXTENSIONS

+       SVr4's  beep  and flash routines always returned OK, so it
+       was not possible to tell when the beep or flash failed.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue  4.  Like SVr4, it specifies that they always return
+       OK.
+
+
+
+

SEE ALSO

+       curses(3x)
+
+
+
+                                                          curs_beep(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_bkgd.3x.html b/doc/html/man/curs_bkgd.3x.html new file mode 100644 index 00000000000..56f5cb91c5c --- /dev/null +++ b/doc/html/man/curs_bkgd.3x.html @@ -0,0 +1,131 @@ + + + + +curs_bkgd 3x + + + + +

curs_bkgd 3x

+
+
+
+curs_bkgd(3x)                                             curs_bkgd(3x)
+
+
+
+
+
+

NAME

+       bkgdset,  wbkgdset,  bkgd,  wbkgd, getbkgd - curses window
+       background manipulation routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       void bkgdset(chtype ch);
+       void wbkgdset(WINDOW *win, chtype ch);
+       int bkgd(chtype ch);
+       int wbkgd(WINDOW *win, chtype ch);
+       chtype getbkgd(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The bkgdset and wbkgdset  routines  manipulate  the  back-
+       ground  of  the  named window.  The window background is a
+       chtype consisting of any combination of attributes  (i.e.,
+       rendition)  and  a  character.   The attribute part of the
+       background is combined (OR'ed) with all non-blank  charac-
+       ters  that  are written into the window with waddch.  Both
+       the character and attribute parts of  the  background  are
+       combined   with  the  blank  characters.   The  background
+       becomes a property of the character  and  moves  with  the
+       character   through   any   scrolling   and  insert/delete
+       line/character operations.
+
+       To the extent  possible  on  a  particular  terminal,  the
+       attribute  part  of  the  background  is  displayed as the
+       graphic rendition of the character put on the screen.
+
+       The bkgd and wbkgd functions set the  background  property
+       of  the  current  or  specified window and then apply this
+       setting to every character position in that window:
+
+              The rendition of every character on the  screen  is
+              changed to the new background rendition.
+
+              Wherever  the  former background character appears,
+              it is changed to the new background character.
+
+       The getbkgd function returns the  given  window's  current
+       background character/attribute pair.
+
+
+
+

RETURN VALUE

+       The  routines  bkgd  and wbkgd return the integer OK.  The
+       SVr4.0 manual says "or a non-negative integer  if  immedok
+       is set", but this appears to be an error.
+
+
+
+

NOTES

+       Note that bkgdset and bkgd may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  It specifies that bkgd and wbkgd return  ERR  on
+       failure, but gives no failure conditions.
+
+
+
+

SEE ALSO

+       curses(3x),   curs_addch(3x),   curs_attr(3x),   curs_out-
+       opts(3x)
+
+
+
+                                                          curs_bkgd(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_bkgrnd.3x.html b/doc/html/man/curs_bkgrnd.3x.html new file mode 100644 index 00000000000..5dc6fdb16a2 --- /dev/null +++ b/doc/html/man/curs_bkgrnd.3x.html @@ -0,0 +1,128 @@ + + + + +curs_bkgrnd 3x + + + + +

curs_bkgrnd 3x

+
+
+
+curs_bkgrnd(3x)                                         curs_bkgrnd(3x)
+
+
+
+
+
+

NAME

+       bkgrnd,  wbkgrnd,  bkgrndset, wbkgrndset, getbkgrnd, wget-
+       bkgrnd - curses  window  complex  background  manipulation
+       routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int bkgrnd( const cchar_t *wch);
+       int wbkgrnd( WINDOW *win, const cchar_t *wch);
+       void bkgrndset(const cchar_t *wch );
+       void wbkgrndset(WINDOW *win, const cchar_t *wch);
+       int getbkgrnd(cchar_t *wch);
+       int wgetbkgrnd(WINDOW *win, cchar_t *wch);
+
+
+
+

DESCRIPTION

+       The bkgrndset and wbkgrndset routines manipulate the back-
+       ground of the named window.  The window  background  is  a
+       cchar_t consisting of any combination of attributes (i.e.,
+       rendition) and a complex character.  The attribute part of
+       the  background  is  combined  (OR'ed)  with all non-blank
+       characters that are written into the window  with  waddch.
+       Both  the  character and attribute parts of the background
+       are combined with the blank  characters.   The  background
+       becomes  a  property  of  the character and moves with the
+       character  through   any   scrolling   and   insert/delete
+       line/character operations.
+
+       To  the  extent  possible  on  a  particular terminal, the
+       attribute part of  the  background  is  displayed  as  the
+       graphic rendition of the character put on the screen.
+
+       The  bkgrnd and wbkgrnd functions set the background prop-
+       erty of the current or specified  window  and  then  apply
+       this setting to every character position in that window:
+
+              The  rendition  of every character on the screen is
+              changed to the new background rendition.
+
+              Wherever the former background  character  appears,
+              it is changed to the new background character.
+
+       The  getbkgrnd function returns the given window's current
+       background character/attribute pair via the wch pointer.
+
+
+
+

NOTES

+       Note that bkgrnd, bkgrndset, and getbkgrnd may be macros.
+
+
+
+

RETURN VALUES

+       The bkgrndset and wbkgrndset  routines  do  not  return  a
+       value.
+
+       Upon successful completion, the other functions return OK.
+       Otherwise, they return ERR.   A  null  window  pointer  is
+       treated as an error.
+
+
+
+

SEE ALSO

+       curses(3x), curs_bkgd(3x)
+
+
+
+                                                        curs_bkgrnd(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_border.3x.html b/doc/html/man/curs_border.3x.html new file mode 100644 index 00000000000..880d59bca20 --- /dev/null +++ b/doc/html/man/curs_border.3x.html @@ -0,0 +1,162 @@ + + + + +curs_border 3x + + + + +

curs_border 3x

+
+
+
+curs_border(3x)                                         curs_border(3x)
+
+
+
+
+
+

NAME

+       border, wborder, box, hline, whline, vline, wvline,
+       mvhline, mvwhline, mvvline, mvwvline - create curses
+       borders, horizontal and vertical lines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int border(chtype ls, chtype rs, chtype ts, chtype bs,
+          chtype tl, chtype tr, chtype bl, chtype br);
+       int wborder(WINDOW *win, chtype ls, chtype rs,
+          chtype ts, chtype bs, chtype tl, chtype tr,
+          chtype bl, chtype br);
+       int box(WINDOW *win, chtype verch, chtype horch);
+       int hline(chtype ch, int n);
+       int whline(WINDOW *win, chtype ch, int n);
+       int vline(chtype ch, int n);
+       int wvline(WINDOW *win, chtype ch, int n);
+       int mvhline(int y, int x, chtype ch, int n);
+       int mvwhline(WINDOW *, int y, int x, chtype ch, int n);
+       int mvvline(int y, int x, chtype ch, int n);
+       int mvwvline(WINDOW *, int y, int x, chtype ch, int n);
+
+
+
+

DESCRIPTION

+       The border, wborder and box routines draw a box around the
+       edges of a window.  Other than the window,  each  argument
+       is a character with attributes:
+
+              ls - left side,
+              rs - right side,
+              ts - top side,
+              bs - bottom side,
+              tl - top left-hand corner,
+              tr - top right-hand corner,
+              bl - bottom left-hand corner, and
+              br - bottom right-hand corner.
+
+       If  any of these arguments is zero, then the corresponding
+       default values (defined in curses.h) are used instead:
+
+              ACS_VLINE,
+              ACS_VLINE,
+              ACS_HLINE,
+              ACS_HLINE,
+              ACS_ULCORNER,
+              ACS_URCORNER,
+              ACS_LLCORNER,
+              ACS_LRCORNER.
+
+       box(win, verch, horch) is a shorthand  for  the  following
+       call:  wborder(win,  verch,  verch, horch, horch, 0, 0, 0,
+       0).
+
+       The hline and whline functions draw a horizontal (left  to
+       right)  line using ch starting at the current cursor posi-
+       tion in the window.  The current cursor  position  is  not
+       changed.   The  line  is  at most n characters long, or as
+       many as fit into the window.
+
+       The vline and wvline functions draw  a  vertical  (top  to
+       bottom) line using ch starting at the current cursor posi-
+       tion in the window.  The current cursor  position  is  not
+       changed.   The  line  is  at most n characters long, or as
+       many as fit into the window.
+
+
+
+

RETURN VALUE

+       All routines return the integer  OK.   The  SVr4.0  manual
+       says  "or  a  non-negative integer if immedok is set", but
+       this appears to be an error.
+
+       X/Open does not define any error conditions.  This  imple-
+       mentation returns an error if the window pointer is null.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       The  borders  generated by these functions are inside bor-
+       ders (this is also true of SVr4 curses, though the fact is
+       not documented).
+
+       Note that border and box may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  ERR  on
+       failure, but specifies no error conditions.
+
+
+
+

SEE ALSO

+       curses(3x), curs_outopts(3x).
+
+
+
+                                                        curs_border(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_border_set.3x.html b/doc/html/man/curs_border_set.3x.html new file mode 100644 index 00000000000..c64a816c173 --- /dev/null +++ b/doc/html/man/curs_border_set.3x.html @@ -0,0 +1,184 @@ + + + + +curs_border_set 3x + + + + +

curs_border_set 3x

+
+
+
+curs_border_set(3x)                                 curs_border_set(3x)
+
+
+
+
+
+

NAME

+       border_set, wborder_set, box_set, hline_set, whline_set,
+       mvhline_set, mvwhline_set, vline_set, wvline_set,
+       mvvline_set, mvwvline_set - create curses borders or lines
+       using complex characters and renditions
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int border_set(
+          const cchar_t *ls, const cchar_t *rs,
+          const cchar_t *ts, const cchar_t *bs,
+          const cchar_t *tl, const cchar_t *tr,
+          const cchar_t *bl, const cchar_t *br );
+       int wborder_set(
+          WINDOW *win,
+          const cchar_t *ls, const cchar_t *rs,
+          const cchar_t *ts, const cchar_t *bs,
+          const cchar_t *tl, const cchar_t *tr,
+          const cchar_t *bl, const cchar_t *br);
+       int box_set(
+          WINDOW *win,
+          const cchar_t *verch,
+          const cchar_t *horch);
+       int hline_set(
+          const cchar_t *wch, int n);
+       int whline_set(
+          WINDOW *win,
+          const cchar_t *wch, int n);
+       int mvhline_set(
+          int y, int x,
+          const cchar_t *wch, int n);
+       int mvwhline_set(
+          WINDOW *win,
+          int y, int x,
+          const cchar_t *wch, int n);
+       int vline_set(
+          const cchar_t *wch, int n);
+       int wvline_set(
+          WINDOW *win,
+          const cchar_t *wch, int n);
+       int mvvline_set(
+          int y, int x,
+          const cchar_t *wch, int n);
+       int mvwvline_set(
+          WINDOW *win,
+          int y, int x,
+          const cchar_t *wch, int n);
+
+
+
+

DESCRIPTION

+       The border_set and wborder_set  functions  draw  a  border
+       around  the  edges  of  the  current  or specified window.
+       These functions do not change the cursor position, and  do
+       not wrap.
+
+       Other  than the window, each argument is a complex charac-
+       ter with attributes:
+              ls - left side,
+              rs - right side,
+              ts - top side,
+              bs - bottom side,
+              tl - top left-hand corner,
+              tr - top right-hand corner,
+              bl - bottom left-hand corner, and
+              br - bottom right-hand corner.
+
+       If any of these arguments is zero, then the  corresponding
+       default values (defined in curses.h) are used instead:
+              WACS_VLINE,
+              WACS_VLINE,
+              WACS_HLINE,
+              WACS_HLINE,
+              WACS_ULCORNER,
+              WACS_URCORNER,
+              WACS_LLCORNER, and
+              WACS_LRCORNER.
+
+       box_set(win, verch, horch); is a shorthand for the follow-
+       ing call:
+
+       wborder_set(win, verch, verch,
+           horch, horch, NULL, NULL, NULL, NULL);
+
+       The *line_set functions use wch to draw a line starting at
+       the current cursor position in the window.  The line is at
+       most n characters long or as many as fit into the  window.
+       The current cursor position is not changed.
+
+       The  hline_set,  mvhline_set, mvwhline_set, and whline_set
+       functions draw a line proceeding toward the last column of
+       the same line.
+
+       The  vline_set,  mvvline_set, mvwvline_set, and wvline_set
+       functions draw a line proceeding toward the last  line  of
+       the window.
+
+
+
+

NOTES

+       Note that border_set, hline_set, mvhline_set, mvvline_set,
+       mvwhline_set, mvwvline_set, and vline_set may be macros.
+
+
+
+

RETURN VALUES

+       Upon successful completion,  these  functions  return  OK.
+       Otherwise, they return ERR.
+
+       Functions  using  a window parameter return an error if it
+       is null.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

SEE ALSO

+       ncurses(3x), curs_add_wch(3x), curs_border(3x),  curs_out-
+       opts(3x)
+
+
+
+                                                    curs_border_set(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_clear.3x.html b/doc/html/man/curs_clear.3x.html new file mode 100644 index 00000000000..ca581c2b0b1 --- /dev/null +++ b/doc/html/man/curs_clear.3x.html @@ -0,0 +1,146 @@ + + + + +curs_clear 3x + + + + +

curs_clear 3x

+
+
+
+curs_clear(3x)                                           curs_clear(3x)
+
+
+
+
+
+

NAME

+       erase, werase, clear, wclear, clrtobot, wclrtobot,
+       clrtoeol, wclrtoeol - clear all or part of a curses window
+
+
+
+

SYNOPSIS

+       # include <curses.h>
+
+       int erase(void);
+       int werase(WINDOW *win);
+       int clear(void);
+       int wclear(WINDOW *win);
+       int clrtobot(void);
+       int wclrtobot(WINDOW *win);
+       int clrtoeol(void);
+       int wclrtoeol(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The erase and werase routines copy blanks to  every  posi-
+       tion in the window, clearing the screen.
+
+       The  clear  and wclear routines are like erase and werase,
+       but they also call clearok, so that the screen is  cleared
+       completely  on  the  next call to wrefresh for that window
+       and repainted from scratch.
+
+       The clrtobot and wclrtobot routines erase from the  cursor
+       to the end of screen.  That is, they erase all lines below
+       the cursor in the window.  Also, the current line  to  the
+       right of the cursor, inclusive, is erased.
+
+       The clrtoeol and wclrtoeol routines erase the current line
+       to the right of the cursor, inclusive, to the end  of  the
+       current line.
+
+       Blanks created by erasure have the current background ren-
+       dition (as set by wbkgdset) merged into them.
+
+
+
+

RETURN VALUE

+       All routines return the integer OK on success and  ERR  on
+       failure.   The SVr4.0 manual says "or a non-negative inte-
+       ger if immedok is set", but this appears to be an error.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion, functions using a window pointer parameter return an
+       error if it is null.
+
+
+
+

NOTES

+       Note that erase, werase, clear, wclear, clrtobot, and clr-
+       toeol may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  ERR  on
+       failure, but specifies no error conditions.
+
+       Some  historic  curses  implementations had, as an undocu-
+       mented feature,  the  ability  to  do  the  equivalent  of
+       clearok(...,  1)  by saying touchwin(stdscr) or clear(std-
+       scr).  This will not work under ncurses.
+
+       This implementation, and others such as Solaris, sets  the
+       current  position  to  0,0  after erasing via werase() and
+       wclear().  That fact is not documented in other  implemen-
+       tations, and may not be true of implementations which were
+       not derived from SVr4 source.
+
+       Not obvious from  the  description,  most  implementations
+       clear  the screen after wclear even for a subwindow or de-
+       rived window.  If you do not want to clear the screen dur-
+       ing the next wrefresh, use werase instead.
+
+
+
+

SEE ALSO

+       curses(3x), curs_outopts(3x), curs_refresh(3x), curs_vari-
+       ables(3x)
+
+
+
+                                                         curs_clear(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html new file mode 100644 index 00000000000..39a73184fcc --- /dev/null +++ b/doc/html/man/curs_color.3x.html @@ -0,0 +1,285 @@ + + + + +curs_color 3x + + + + +

curs_color 3x

+
+
+
+curs_color(3x)                                           curs_color(3x)
+
+
+
+
+
+

NAME

+       start_color, init_pair, init_color, has_colors,
+       can_change_color, color_content, pair_content, COLOR_PAIR
+       - curses color manipulation routines
+
+
+
+

SYNOPSIS

+       # include <curses.h>
+
+       int start_color(void);
+       int init_pair(short pair, short f, short b);
+       int init_color(short color, short r, short g, short b);
+       bool has_colors(void);
+       bool can_change_color(void);
+       int  color_content(short  color, short *r, short *g, short
+       *b);
+       int pair_content(short pair, short *f, short *b);
+
+
+
+

DESCRIPTION

+   Overview
+       curses support color attributes on terminals with that ca-
+       pability.   To  use  these  routines  start_color  must be
+       called, usually right after initscr.   Colors  are  always
+       used  in pairs (referred to as color-pairs).  A color-pair
+       consists of a foreground  color  (for  characters)  and  a
+       background color (for the blank field on which the charac-
+       ters are displayed).  A programmer  initializes  a  color-
+       pair  with  the routine init_pair.  After it has been ini-
+       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
+       can be used as a new video attribute.
+
+       If  a  terminal  is capable of redefining colors, the pro-
+       grammer can use the routine init_color to change the defi-
+       nition   of   a   color.    The  routines  has_colors  and
+       can_change_color  return  TRUE  or  FALSE,  depending   on
+       whether  the  terminal  has color capabilities and whether
+       the programmer can change the colors.   The  routine  col-
+       or_content  allows  a programmer to extract the amounts of
+       red, green, and blue components in an  initialized  color.
+       The  routine  pair_content allows a programmer to find out
+       how a given color-pair is currently defined.
+
+   Routine Descriptions
+       The start_color routine requires no arguments.  It must be
+       called  if  the programmer wants to use colors, and before
+       any other color manipulation routine  is  called.   It  is
+       good  practice  to  call this routine right after initscr.
+       start_color initializes eight basic  colors  (black,  red,
+       green,  yellow,  blue,  magenta, cyan, and white), and two
+       global variables,  COLORS  and  COLOR_PAIRS  (respectively
+       defining  the maximum number of colors and color-pairs the
+       terminal can support).  It also restores the colors on the
+       terminal to the values they had when the terminal was just
+       turned on.
+
+       The init_pair routine changes the definition of  a  color-
+       pair.   It takes three arguments: the number of the color-
+       pair to be changed, the foreground color number,  and  the
+       background color number.  For portable applications:
+
+       o   The  value of the first argument must be between 1 and
+           COLOR_PAIRS-1, except that if default colors are  used
+           (see  use_default_colors)  the upper limit is adjusted
+           to allow for extra pairs which use a default color  in
+           foreground and/or background.
+
+       o   The  value  of  the second and third arguments must be
+           between 0 and COLORS.  Color pair 0 is assumed  to  be
+           white  on black, but is actually whatever the terminal
+           implements before color is initialized.  It cannot  be
+           modified by the application.
+
+       If  the  color-pair was previously initialized, the screen
+       is refreshed and all occurrences of  that  color-pair  are
+       changed to the new definition.
+
+       As  an  extension,  ncurses allows you to set color pair 0
+       via the assume_default_colors routine, or to  specify  the
+       use  of  default colors (color number -1) if you first in-
+       voke the use_default_colors routine.
+
+       The init_color routine changes the definition of a  color.
+       It  takes  four  arguments:  the number of the color to be
+       changed followed by three RGB values (for the  amounts  of
+       red,  green, and blue components).  The value of the first
+       argument must be between 0 and COLORS.  (See  the  section
+       Colors  for  the  default  color index.)  Each of the last
+       three arguments must be a value between 0 and 1000.   When
+       init_color  is  used, all occurrences of that color on the
+       screen immediately change to the new definition.
+
+       The has_colors routine requires no arguments.  It  returns
+       TRUE  if the terminal can manipulate colors; otherwise, it
+       returns FALSE.  This routine facilitates writing terminal-
+       independent  programs.   For example, a programmer can use
+       it to decide whether to use color or some other video  at-
+       tribute.
+
+       The  can_change_color  routine  requires no arguments.  It
+       returns TRUE if  the  terminal  supports  colors  and  can
+       change  their  definitions; other, it returns FALSE.  This
+       routine facilitates writing terminal-independent programs.
+
+       The color_content routine gives programmers a way to  find
+       the intensity of the red, green, and blue (RGB) components
+       in a color.  It requires four arguments: the color number,
+       and  three addresses of shorts for storing the information
+       about the amounts of red, green, and  blue  components  in
+       the  given color.  The value of the first argument must be
+       between 0 and COLORS.  The values that are stored  at  the
+       addresses  pointed  to by the last three arguments are be-
+       tween 0 (no component) and 1000 (maximum amount of  compo-
+       nent).
+
+       The  pair_content  routine  allows programmers to find out
+       what colors a given color-pair consists of.   It  requires
+       three  arguments: the color-pair number, and two addresses
+       of shorts for storing the foreground  and  the  background
+       color  numbers.   The  value of the first argument must be
+       between 1 and COLOR_PAIRS-1.  The values that  are  stored
+       at  the addresses pointed to by the second and third argu-
+       ments are between 0 and COLORS.
+
+   Colors
+       In <curses.h> the following macros are defined.  These are
+       the  default colors.  curses also assumes that COLOR_BLACK
+       is the default background color for all terminals.
+
+             COLOR_BLACK
+             COLOR_RED
+             COLOR_GREEN
+             COLOR_YELLOW
+             COLOR_BLUE
+             COLOR_MAGENTA
+             COLOR_CYAN
+             COLOR_WHITE
+
+
+
+

RETURN VALUE

+       The routines can_change_color()  and  has_colors()  return
+       TRUE or FALSE.
+
+       All other routines return the integer ERR upon failure and
+       an OK (SVr4 specifies only "an integer  value  other  than
+       ERR") upon successful completion.
+
+       X/Open  defines  no error conditions.  This implementation
+       will return ERR on attempts to use  color  values  outside
+       the range 0 to COLORS-1 (except for the default colors ex-
+       tension), or use color pairs outside the range 0  to  COL-
+       OR_PAIRS-1.   Color  values  used in init_color must be in
+       the range 0 to 1000.  An error is returned from all  func-
+       tions  if the terminal has not been initialized.  An error
+       is returned from secondary functions such as init_pair  if
+       start_color was not called.
+
+          init_color
+               returns  an error if the terminal does not support
+               this feature, e.g., if the initialize_color  capa-
+               bility is absent from the terminal description.
+
+          start_color
+               returns  an error if the color table cannot be al-
+               located.
+
+
+
+

NOTES

+       In the ncurses implementation, there is a  separate  color
+       activation flag, color palette, color pairs table, and as-
+       sociated COLORS and COLOR_PAIRS counts  for  each  screen;
+       the  start_color function only affects the current screen.
+       The SVr4/XSI interface is not really designed with this in
+       mind,  and  historical  implementations  may  use a single
+       shared color palette.
+
+       Note that setting an implicit background color via a color
+       pair  affects  only character cells that a character write
+       operation explicitly touches.  To  change  the  background
+       color  used  when parts of a window are blanked by erasing
+       or scrolling operations, see curs_bkgd(3x).
+
+       Several caveats apply on 386 and 486  machines  with  VGA-
+       compatible graphics:
+
+       o   COLOR_YELLOW  is  actually  brown.  To get yellow, use
+           COLOR_YELLOW combined with the A_BOLD attribute.
+
+       o   The A_BLINK attribute should in theory cause the back-
+           ground  to  go  bright.  This often fails to work, and
+           even some cards for which it mostly works (such as the
+           Paradise  and compatibles) do the wrong thing when you
+           try to set a bright "yellow"  background  (you  get  a
+           blinking yellow foreground instead).
+
+       o   Color RGB values are not settable.
+
+
+
+

PORTABILITY

+       This  implementation  satisfies XSI Curses's minimum maxi-
+       mums for COLORS and COLOR_PAIRS.
+
+       The init_pair routine accepts  negative  values  of  fore-
+       ground   and  background  color  to  support  the  use_de-
+       fault_colors extension, but only if that routine has  been
+       first invoked.
+
+       The  assumption that COLOR_BLACK is the default background
+       color for all terminals can  be  modified  using  the  as-
+       sume_default_colors extension.
+
+       This  implementation  checks  the  pointers, e.g., for the
+       values returned by  color_content  and  pair_content,  and
+       will treat those as optional parameters when null.
+
+
+
+

SEE ALSO

+       curses(3x),  curs_initscr(3x),  curs_attr(3x),  curs_vari-
+       ables(3x), default_colors(3x)
+
+
+
+                                                         curs_color(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_delch.3x.html b/doc/html/man/curs_delch.3x.html new file mode 100644 index 00000000000..174b17d8e62 --- /dev/null +++ b/doc/html/man/curs_delch.3x.html @@ -0,0 +1,112 @@ + + + + +curs_delch 3x + + + + +

curs_delch 3x

+
+
+
+curs_delch(3x)                                           curs_delch(3x)
+
+
+
+
+
+

NAME

+       delch,  wdelch, mvdelch, mvwdelch - delete character under
+       the cursor in a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int delch(void);
+       int wdelch(WINDOW *win);
+       int mvdelch(int y, int x);
+       int mvwdelch(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       These routines delete the character under the cursor;  all
+       characters to the right of the cursor on the same line are
+       moved to the left one position and the last  character  on
+       the line is filled with a blank.  The cursor position does
+       not change (after moving to y, x,  if  specified).   (This
+       does  not  imply use of the hardware delete character fea-
+       ture.)
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and an OK
+       (SVr4  specifies  only  "an integer value other than ERR")
+       upon successful completion.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that delch, mvdelch, and mvwdelch may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue  4.   The standard specifies that they return ERR on
+       failure, but specifies no error conditions.
+
+
+
+

SEE ALSO

+       curses(3x)
+
+
+
+                                                         curs_delch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_deleteln.3x.html b/doc/html/man/curs_deleteln.3x.html new file mode 100644 index 00000000000..5015849dd09 --- /dev/null +++ b/doc/html/man/curs_deleteln.3x.html @@ -0,0 +1,126 @@ + + + + +curs_deleteln 3x + + + + +

curs_deleteln 3x

+
+
+
+curs_deleteln(3x)                                     curs_deleteln(3x)
+
+
+
+
+
+

NAME

+       deleteln,  wdeleteln,  insdelln, winsdelln, insertln, win-
+       sertln - delete and insert lines in a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int deleteln(void);
+       int wdeleteln(WINDOW *win);
+       int insdelln(int n);
+       int winsdelln(WINDOW *win, int n);
+       int insertln(void);
+       int winsertln(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The deleteln and wdeleteln routines delete the line  under
+       the cursor in the window; all lines below the current line
+       are moved up one line.  The bottom line of the  window  is
+       cleared.  The cursor position does not change.
+
+       The  insdelln  and  winsdelln  routines,  for  positive n,
+       insert n lines into the specified window above the current
+       line.   The  n  bottom  lines  are  lost.  For negative n,
+       delete n lines (starting with the one under  the  cursor),
+       and  move  the remaining lines up.  The bottom n lines are
+       cleared.  The current cursor position remains the same.
+
+       The insertln and winsertln routines insert  a  blank  line
+       above the current line and the bottom line is lost.
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and an OK
+       (SVr4 specifies only "an integer value  other  than  ERR")
+       upon successful completion.
+
+       X/Open  defines  no error conditions.  In this implementa-
+       tion, if  the  window  parameter  is  null,  an  error  is
+       returned.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  ERR  on
+       failure, but specifies no error conditions.
+
+
+
+

NOTES

+       Note that all but winsdelln may be macros.
+
+       These  routines  do  not require a hardware line delete or
+       insert feature in the terminal.  In fact,  they  will  not
+       use  hardware  line  delete/insert unless idlok(..., TRUE)
+       has been set on the current window.
+
+
+
+

SEE ALSO

+       curses(3x)
+
+
+
+                                                      curs_deleteln(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_extend.3x.html b/doc/html/man/curs_extend.3x.html new file mode 100644 index 00000000000..a90ccd717f5 --- /dev/null +++ b/doc/html/man/curs_extend.3x.html @@ -0,0 +1,111 @@ + + + + +curs_extend 3x + + + + +

curs_extend 3x

+
+
+
+curs_extend(3x)                                         curs_extend(3x)
+
+
+
+
+
+

NAME

+       curses_version,  use_extended_names - miscellaneous curses
+       extensions
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       const char * curses_version(void);
+       int use_extended_names(bool enable);
+
+
+
+

DESCRIPTION

+       These functions are extensions to the curses library which
+       do not fit easily into other categories.
+
+       Use  curses_version() to get the version number, including
+       patch level of the library, e.g., 5.0.19991023
+
+       The use_extended_names()  function  controls  whether  the
+       calling  application  is  able to use user-defined or non-
+       standard names which may be  compiled  into  the  terminfo
+       description, i.e., via the terminfo or termcap interfaces.
+       Normally these names are  available  for  use,  since  the
+       essential  decision  is made by using the -x option of tic
+       to compile extended terminal definitions.  However you can
+       disable  this  feature  to ensure compatibility with other
+       implementations of curses.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       curs_getch(3x),       curs_mouse(3x),      curs_print(3x),
+       curs_util(3x),  default_colors(3x),  define_key(3x),  key-
+       bound(3x), keyok(3x), resizeterm(3x), wresize(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey.
+
+
+
+                                                        curs_extend(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_get_wch.3x.html b/doc/html/man/curs_get_wch.3x.html new file mode 100644 index 00000000000..0b2373e6b74 --- /dev/null +++ b/doc/html/man/curs_get_wch.3x.html @@ -0,0 +1,155 @@ + + + + +curs_get_wch 3x + + + + +

curs_get_wch 3x

+
+
+
+curs_get_wch(3x)                                       curs_get_wch(3x)
+
+
+
+
+
+

NAME

+       get_wch,  wget_wch, mvget_wch, mvwget_wch, unget_wch - get
+       (or push back) a wide character from curses terminal  key-
+       board
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int get_wch(wint_t *wch);
+       int wget_wch(WINDOW *win, wint_t *wch);
+       int mvget_wch(int y, int x, wint_t *wch);
+       int mvwget_wch(WINDOW *win, int y, int x, wint_t *wch);
+       int unget_wch(const wchar_t wch);
+
+
+
+

DESCRIPTION

+       The get_wch, wget_wch, mvget_wch, and mvwget_wch functions
+       read a character from the  terminal  associated  with  the
+       current  or  specified  window.   In  no-delay mode, if no
+       input is waiting, the value ERR  is  returned.   In  delay
+       mode,  the  program  waits  until  the  system passes text
+       through to the  program.   Depending  on  the  setting  of
+       cbreak,  this  is  after  one  character (cbreak mode), or
+       after the first newline (nocbreak  mode).   In  half-delay
+       mode,  the  program waits until the user types a character
+       or the specified timeout interval has elapsed.
+
+       Unless noecho has been set, these routines echo the  char-
+       acter into the designated window.
+
+       If  the window is not a pad and has been moved or modified
+       since the last call to wrefresh, wrefresh will  be  called
+       before another character is read.
+
+       If  keypad  is  enabled,  these  functions  respond to the
+       pressing of a function key by setting the  object  pointed
+       to  by  wch  to  the  corresponding  KEY_ value defined in
+       <curses.h> and returning  KEY_CODE_YES.   If  a  character
+       (such as escape) that could be the beginning of a function
+       key is received, curses sets a timer.  If the remainder of
+       the  sequence  does  arrive  within  the  designated time,
+       curses passes through  the  character;  otherwise,  curses
+       returns  the  function  key  value.  For this reason, many
+       terminals experience a  delay  between  the  time  a  user
+       presses the escape key and the time the escape is returned
+       to the program.
+
+       The unget_wch function pushes the wide character wch  back
+       onto the head of the input queue, so the wide character is
+       returned by the next call to get_wch.  The pushback of one
+       character  is  guaranteed.  If the program calls unget_wch
+       too many times without an intervening call to get_wch, the
+       operation may fail.
+
+
+
+

NOTES

+       The  header  file  <curses.h>  automatically  includes the
+       header file <stdio.h>.
+
+       Applications should not define the escape key by itself as
+       a single-character function.
+
+       When  using  get_wch,  wget_wch, mvget_wch, or mvwget_wch,
+       applications should not use nocbreak mode and echo mode at
+       the  same  time.  Depending on the state of the tty driver
+       when each character is  typed,  the  program  may  produce
+       undesirable results.
+
+       All functions except wget_wch and unget_wch may be macros.
+
+
+
+

RETURN VALUES

+       When  get_wch,  wget_wch,  mvget_wch, and mvwget_wch func-
+       tions successfully report the pressing of a function  key,
+       they return KEY_CODE_YES.  When they successfully report a
+       wide character, they return OK.   Otherwise,  they  return
+       ERR.
+
+       Upon  successful completion, unget_wch returns OK.  Other-
+       wise, the function returns ERR.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

SEE ALSO

+       curses(3x),       curs_getch(3x),        curs_ins_wch(3x),
+       curs_inopts(3x), curs_move(3x), curs_refresh(3x)
+
+
+
+                                                       curs_get_wch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_get_wstr.3x.html b/doc/html/man/curs_get_wstr.3x.html new file mode 100644 index 00000000000..5775678fe04 --- /dev/null +++ b/doc/html/man/curs_get_wstr.3x.html @@ -0,0 +1,166 @@ + + + + +curs_get_wstr 3x + + + + +

curs_get_wstr 3x

+
+
+
+curs_get_wstr(3x)                                     curs_get_wstr(3x)
+
+
+
+
+
+

NAME

+       get_wstr, getn_wstr, wget_wstr, wgetn_wstr, mvget_wstr,
+       mvgetn_wstr, mvwget_wstr, mvwgetn_wstr - get an array of
+       wide characters from a curses terminal keyboard
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int get_wstr(wint_t *wstr);
+       int getn_wstr(wint_t *wstr, int n);
+       int wget_wstr(WINDOW *win, wint_t *wstr);
+       int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
+       int mvget_wstr(int y, int x, wint_t *wstr);
+       int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
+       int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr);
+       int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
+
+
+
+

DESCRIPTION

+       The  effect  of get_wstr is as though a series of calls to
+       get_wch were made, until a newline, other end-of-line,  or
+       end-of-file condition is processed.  An end-of-file condi-
+       tion is represented by WEOF, as defined in <wchar.h>.  The
+       newline  and end-of-line conditions are represented by the
+       \n wchar_t value.  In all instances, the end of the string
+       is  terminated  by a null wchar_t.  The routine places re-
+       sulting values in the area pointed to by wstr.
+
+       The user's erase and kill characters are interpreted.   If
+       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
+       KEY_BACKSPACE are both considered equivalent to the user's
+       kill character.
+
+       Characters  input are echoed only if echo is currently on.
+       In that case, backspace is echoed as deletion of the  pre-
+       vious character (typically a left motion).
+
+       The  effect of wget_wstr is as though a series of calls to
+       wget_wch were made.
+
+       The effect of mvget_wstr is as though a call to  move  and
+       then a series of calls to get_wch were made.
+
+       The effect of mvwget_wstr is as though a call to wmove and
+       then a series of calls to wget_wch were made.
+
+       The getn_wstr, mvgetn_wstr, mvwgetn_wstr,  and  wgetn_wstr
+       functions  are  identical  to  the  get_wstr,  mvget_wstr,
+       mvwget_wstr, and wget_wstr functions, respectively, except
+       that  the *n_* versions read at most n characters, letting
+       the application prevent overflow of the input buffer.
+
+
+
+

NOTES

+       Using get_wstr, mvget_wstr, mvwget_wstr, or  wget_wstr  to
+       read  a  line  that overflows the array pointed to by wstr
+       causes  undefined  results.    The   use   of   getn_wstr,
+       mvgetn_wstr, mvwgetn_wstr, or wgetn_wstr, respectively, is
+       recommended.
+
+       These functions cannot return KEY_ values because there is
+       no  way  to  distinguish a KEY_ value from a valid wchar_t
+       value.
+
+       All of these routines except wgetn_wstr may be macros.
+
+
+
+

RETURN VALUES

+       All of these functions return OK upon  successful  comple-
+       tion.  Otherwise, they return ERR.
+
+       Functions  using  a window parameter return an error if it
+       is null.
+
+              wgetn_wstr
+                   returns an error if  the  associated  call  to
+                   wget_wch failed.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

PORTABILITY

+       These  functions are described in The Single Unix Specifi-
+       cation, Version 2.  No error conditions are defined.  This
+       implementation  returns ERR if the window pointer is null,
+       or if the lower-level wget_wch call returns  an  ERR.   In
+       the  latter  case,  an  ERR  return  without other data is
+       treated as an end-of-file condition, and the returned  ar-
+       ray contains a WEOF followed by a null wchar_t.
+
+       X/Open  curses  documents these functions to pass an array
+       of wchar_t, but all of the vendors  implement  this  using
+       wint_t.
+
+
+
+

SEE ALSO

+       Functions: curses(3x), curs_get_wch(3x), curs_getstr(3x).
+
+
+
+                                                      curs_get_wstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_getcchar.3x.html b/doc/html/man/curs_getcchar.3x.html new file mode 100644 index 00000000000..22cb819fbd3 --- /dev/null +++ b/doc/html/man/curs_getcchar.3x.html @@ -0,0 +1,158 @@ + + + + +curs_getcchar 3x + + + + +

curs_getcchar 3x

+
+
+
+curs_getcchar(3x)                                     curs_getcchar(3x)
+
+
+
+
+
+

NAME

+       getcchar,  setcchar - Get a wide character string and ren-
+       dition from a cchar_t or set a cchar_t from a wide-charac-
+       ter string
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int getcchar(
+               const cchar_t *wcval,
+               wchar_t *wch,
+               attr_t *attrs,
+               short *color_pair,
+               void *opts );
+
+       int setcchar(
+               cchar_t *wcval,
+               const wchar_t *wch,
+               const attr_t attrs,
+               short color_pair,
+               void *opts );
+
+
+
+

DESCRIPTION

+       The  getcchar  function  gets  a wide-character string and
+       rendition from a cchar_t argument.  When wch is not a null
+       pointer, the getcchar function does the following:
+
+       o   Extracts information from a cchar_t value wcval
+
+       o   Stores   the  character  attributes  in  the  location
+           pointed to by attrs
+
+       o   Stores the color-pair in the location  pointed  to  by
+           color_pair
+
+       o   Stores  the  wide-character  string, characters refer-
+           enced by wcval, into the array pointed to by wch.
+
+       When wch is a null pointer, the getcchar function does the
+       following:
+
+       o   Obtains  the  number  of wide characters pointed to by
+           wcval
+
+       o   Does not  change  the  data  referenced  by  attrs  or
+           color_pair
+
+       The  setcchar function initializes the location pointed to
+       by wcval by using:
+
+       o   The character attributes in attrs
+
+       o   The color pair in color_pair
+
+       o   The wide-character string  pointed  to  by  wch.   The
+           string  must  be L'\0' terminated, contain at most one
+           spacing character, which must be the first.
+
+           Up to CCHARW_MAX-1 nonspacing characters  may  follow.
+           Additional nonspacing characters are ignored.
+
+           The  string  may  contain  a  single control character
+           instead.  In that case, no nonspacing  characters  are
+           allowed.
+
+
+
+

NOTES

+       The  opts argument is reserved for future use.  Currently,
+       an application must provide a null pointer as opts.
+
+       The wcval argument may be a value generated by a  call  to
+       setcchar  or by a function that has a cchar_t output argu-
+       ment.  If wcval is constructed by  any  other  means,  the
+       effect is unspecified.
+
+
+
+

RETURN VALUES

+       When wch is a null pointer, getcchar returns the number of
+       wide characters referenced by wcval, including one  for  a
+       trailing null.
+
+       When  wch  is not a null pointer, getcchar returns OK upon
+       successful completion, and ERR otherwise.
+
+       Upon successful completion, setcchar returns  OK.   Other-
+       wise, it returns ERR.
+
+
+
+

SEE ALSO

+       Functions:   curs_attr(3x),   curs_color(3x),  curses(3x),
+       wcwidth(3).
+
+
+
+                                                      curs_getcchar(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_getch.3x.html b/doc/html/man/curs_getch.3x.html new file mode 100644 index 00000000000..2bdcdc423a2 --- /dev/null +++ b/doc/html/man/curs_getch.3x.html @@ -0,0 +1,359 @@ + + + + +curs_getch 3x + + + + +

curs_getch 3x

+
+
+
+curs_getch(3x)                                           curs_getch(3x)
+
+
+
+
+
+

NAME

+       getch, wgetch, mvgetch, mvwgetch, ungetch, has_key - get
+       (or push back) characters from curses terminal keyboard
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int getch(void);
+       int wgetch(WINDOW *win);
+       int mvgetch(int y, int x);
+       int mvwgetch(WINDOW *win, int y, int x);
+       int ungetch(int ch);
+       int has_key(int ch);
+
+
+
+

DESCRIPTION

+       The getch, wgetch, mvgetch and mvwgetch, routines  read  a
+       character  from the window.  In no-delay mode, if no input
+       is waiting, the value ERR is returned.  In delay mode, the
+       program  waits until the system passes text through to the
+       program.  Depending on the setting of cbreak, this is  af-
+       ter  one  character (cbreak mode), or after the first new-
+       line (nocbreak mode).  In  half-delay  mode,  the  program
+       waits  until a character is typed or the specified timeout
+       has been reached.
+
+       Unless noecho has been set, then the character  will  also
+       be echoed into the designated window according to the fol-
+       lowing rules: if the character is the current erase  char-
+       acter,  left  arrow, or backspace, the cursor is moved one
+       space to the left and that screen position is erased as if
+       delch had been called.  If the character value is any oth-
+       er KEY_ define, the user is  alerted  with  a  beep  call.
+       Otherwise the character is simply output to the screen.
+
+       If the window is not a pad, and it has been moved or modi-
+       fied since the last call to  wrefresh,  wrefresh  will  be
+       called before another character is read.
+
+       If  keypad is TRUE, and a function key is pressed, the to-
+       ken for that function key is returned instead of  the  raw
+       characters.   Possible function keys are defined in <curs-
+       es.h> as macros with values outside  the  range  of  8-bit
+       characters  whose  names begin with KEY_. Thus, a variable
+       intended to hold the return value of a function  key  must
+       be of short size or larger.
+
+       When a character that could be the beginning of a function
+       key is received (which, on modern terminals, means an  es-
+       cape character), curses sets a timer.  If the remainder of
+       the sequence does not come in within the designated  time,
+       the  character  is passed through; otherwise, the function
+       key value is returned.  For this  reason,  many  terminals
+       experience a delay between the time a user presses the es-
+       cape key and the escape is returned to the program.
+
+       The ungetch routine places ch back onto the input queue to
+       be returned by the next call to wgetch.  There is just one
+       input queue for all windows.
+
+
+   Function Keys
+       The following function keys, defined in <curses.h>,  might
+       be  returned  by  getch  if keypad has been enabled.  Note
+       that not all of these are  necessarily  supported  on  any
+       particular terminal.
+
+
+            Name            Key name
+            KEY_BREAK       Break key
+            KEY_DOWN        The four arrow keys ...
+            KEY_UP
+            KEY_LEFT
+            KEY_RIGHT
+            KEY_HOME        Home key (upward+left arrow)
+            KEY_BACKSPACE   Backspace
+            KEY_F0          Function keys; space for 64 keys
+                            is reserved.
+            KEY_F(n)        For 0 <= n <= 63
+            KEY_DL          Delete line
+            KEY_IL          Insert line
+            KEY_DC          Delete character
+            KEY_IC          Insert char or enter insert mode
+            KEY_EIC         Exit insert char mode
+            KEY_CLEAR       Clear screen
+            KEY_EOS         Clear to end of screen
+            KEY_EOL         Clear to end of line
+            KEY_SF          Scroll 1 line forward
+            KEY_SR          Scroll 1 line backward (reverse)
+            KEY_NPAGE       Next page
+            KEY_PPAGE       Previous page
+            KEY_STAB        Set tab
+            KEY_CTAB        Clear tab
+            KEY_CATAB       Clear all tabs
+            KEY_ENTER       Enter or send
+            KEY_SRESET      Soft (partial) reset
+            KEY_RESET       Reset or hard reset
+            KEY_PRINT       Print or copy
+            KEY_LL          Home down or bottom (lower left)
+            KEY_A1          Upper left of keypad
+            KEY_A3          Upper right of keypad
+            KEY_B2          Center of keypad
+            KEY_C1          Lower left of keypad
+            KEY_C3          Lower right of keypad
+            KEY_BTAB        Back tab key
+            KEY_BEG         Beg(inning) key
+            KEY_CANCEL      Cancel key
+            KEY_CLOSE       Close key
+            KEY_COMMAND     Cmd (command) key
+            KEY_COPY        Copy key
+            KEY_CREATE      Create key
+            KEY_END         End key
+            KEY_EXIT        Exit key
+            KEY_FIND        Find key
+            KEY_HELP        Help key
+            KEY_MARK        Mark key
+            KEY_MESSAGE     Message key
+            KEY_MOUSE       Mouse event read
+            KEY_MOVE        Move key
+            KEY_NEXT        Next object key
+            KEY_OPEN        Open key
+            KEY_OPTIONS     Options key
+            KEY_PREVIOUS    Previous object key
+            KEY_REDO        Redo key
+            KEY_REFERENCE   Ref(erence) key
+            KEY_REFRESH     Refresh key
+            KEY_REPLACE     Replace key
+            KEY_RESIZE      Screen resized
+            KEY_RESTART     Restart key
+            KEY_RESUME      Resume key
+
+            KEY_SAVE        Save key
+            KEY_SBEG        Shifted beginning key
+            KEY_SCANCEL     Shifted cancel key
+            KEY_SCOMMAND    Shifted command key
+            KEY_SCOPY       Shifted copy key
+            KEY_SCREATE     Shifted create key
+            KEY_SDC         Shifted delete char key
+            KEY_SDL         Shifted delete line key
+            KEY_SELECT      Select key
+            KEY_SEND        Shifted end key
+            KEY_SEOL        Shifted clear line key
+            KEY_SEXIT       Shifted exit key
+            KEY_SFIND       Shifted find key
+            KEY_SHELP       Shifted help key
+            KEY_SHOME       Shifted home key
+            KEY_SIC         Shifted input key
+            KEY_SLEFT       Shifted left arrow key
+            KEY_SMESSAGE    Shifted message key
+            KEY_SMOVE       Shifted move key
+            KEY_SNEXT       Shifted next key
+            KEY_SOPTIONS    Shifted options key
+            KEY_SPREVIOUS   Shifted prev key
+            KEY_SPRINT      Shifted print key
+            KEY_SREDO       Shifted redo key
+            KEY_SREPLACE    Shifted replace key
+            KEY_SRIGHT      Shifted right arrow
+            KEY_SRSUME      Shifted resume key
+            KEY_SSAVE       Shifted save key
+            KEY_SSUSPEND    Shifted suspend key
+            KEY_SUNDO       Shifted undo key
+            KEY_SUSPEND     Suspend key
+            KEY_UNDO        Undo key
+
+       Keypad is arranged like this:
+
+
+                         +-----+------+-------+
+                         | A1  |  up  |  A3   |
+                         +-----+------+-------+
+                         |left |  B2  | right |
+                         +-----+------+-------+
+                         | C1  | down |  C3   |
+                         +-----+------+-------+
+       The has_key routine takes a key value from the above list,
+       and returns TRUE or FALSE according to whether the current
+       terminal type recognizes a key with that value.  Note that
+       a  few  values  do  not  correspond  to  a real key, e.g.,
+       KEY_RESIZE and KEY_MOUSE.  See resizeterm(3x) for more de-
+       tails  about  KEY_RESIZE, and curs_mouse(3x) for a discus-
+       sion of KEY_MOUSE.
+
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon  failure  and  an
+       integer value other than ERR (OK in the case of ungetch())
+       upon successful completion.
+
+              ungetch
+                   returns an error if there is no more  room  in
+                   the FIFO.
+
+              wgetch
+                   returns  an  error  if  the  window pointer is
+                   null, or if its timeout expires without having
+                   any data.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Use of the escape key by a programmer for a single charac-
+       ter function is discouraged, as it will cause a  delay  of
+       up to one second while the keypad code looks for a follow-
+       ing function-key sequence.
+
+       Note that some keys may be the same as commonly used  con-
+       trol keys, e.g., KEY_ENTER versus control/M, KEY_BACKSPACE
+       versus control/H.  Some curses implementations may  differ
+       according  to  whether  they treat these control keys spe-
+       cially (and ignore the terminfo), or use the terminfo def-
+       initions.   Ncurses  uses  the terminfo definition.  If it
+       says  that  KEY_ENTER  is  control/M,  getch  will  return
+       KEY_ENTER when you press control/M.
+
+       Generally,  KEY_ENTER denotes the character(s) sent by the
+       Enter key on the numeric keypad:
+
+       o   the terminal description lists the most useful keys,
+
+       o   the Enter key on the regular keyboard is already  han-
+           dled by the standard ASCII characters for carriage-re-
+           turn and line-feed,
+
+       o   depending on whether nl or nonl was  called,  pressing
+           "Enter"  on  the  regular keyboard may return either a
+           carriage-return or line-feed, and finally
+
+       o   "Enter or send" is the standard description  for  this
+           key.
+
+       When  using  getch, wgetch, mvgetch, or mvwgetch, nocbreak
+       mode (nocbreak) and echo mode (echo) should not be used at
+       the  same  time.  Depending on the state of the tty driver
+       when each character is typed, the program may produce  un-
+       desirable results.
+
+       Note that getch, mvgetch, and mvwgetch may be macros.
+
+       Historically, the set of keypad macros was largely defined
+       by the extremely function-key-rich keyboard  of  the  AT&T
+       7300,  aka  3B1,  aka Safari 4.  Modern personal computers
+       usually have only a small subset of these.   IBM  PC-style
+       consoles   typically  support  little  more  than  KEY_UP,
+       KEY_DOWN,   KEY_LEFT,   KEY_RIGHT,   KEY_HOME,    KEY_END,
+       KEY_NPAGE, KEY_PPAGE, and function keys 1 through 12.  The
+       Ins key is usually mapped to KEY_IC.
+
+
+
+

PORTABILITY

+       The *get* functions are described in the XSI Curses  stan-
+       dard,  Issue  4.   They  read single-byte characters only.
+       The standard specifies that they return  ERR  on  failure,
+       but specifies no error conditions.
+
+       The  echo  behavior of these functions on input of KEY_ or
+       backspace characters was not specified in the  SVr4  docu-
+       mentation.  This description is adopted from the XSI Curs-
+       es standard.
+
+       The behavior of getch and friends in the presence of  han-
+       dled  signals  is  unspecified  in the SVr4 and XSI Curses
+       documentation.  Under historical  curses  implementations,
+       it  varied depending on whether the operating system's im-
+       plementation  of  handled  signal  receipt  interrupts   a
+       read(2)  call in progress or not, and also (in some imple-
+       mentations) depending on whether an input timeout or  non-
+       blocking mode has been set.
+
+       Programmers concerned about portability should be prepared
+       for either of two cases: (a) signal receipt does  not  in-
+       terrupt  getch;  (b)  signal  receipt interrupts getch and
+       causes it to return ERR with errno set  to  EINTR.   Under
+       the  ncurses  implementation, handled signals never inter-
+       rupt getch.
+
+       The has_key function is unique to ncurses.   We  recommend
+       that  any  code  using it be conditionalized on the NCURS-
+       ES_VERSION feature macro.
+
+
+
+

SEE ALSO

+       curses(3x),       curs_inopts(3x),       curs_outopts(3x),
+       curs_mouse(3x),   curs_move(3x),   curs_refresh(3x),   re-
+       sizeterm(3x).
+
+       Comparable functions in the wide-character (ncursesw)  li-
+       brary are described in curs_get_wch(3x).
+
+
+
+                                                         curs_getch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_getstr.3x.html b/doc/html/man/curs_getstr.3x.html new file mode 100644 index 00000000000..222f00bc700 --- /dev/null +++ b/doc/html/man/curs_getstr.3x.html @@ -0,0 +1,155 @@ + + + + +curs_getstr 3x + + + + +

curs_getstr 3x

+
+
+
+curs_getstr(3x)                                         curs_getstr(3x)
+
+
+
+
+
+

NAME

+       getstr, getnstr, wgetstr, wgetnstr, mvgetstr, mvgetnstr,
+       mvwgetstr, mvwgetnstr - accept character strings from
+       curses terminal keyboard
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int getstr(char *str);
+       int getnstr(char *str, int n);
+       int wgetstr(WINDOW *win, char *str);
+       int wgetnstr(WINDOW *win, char *str, int n);
+       int mvgetstr(int y, int x, char *str);
+       int mvwgetstr(WINDOW *win, int y, int x, char *str);
+       int mvgetnstr(int y, int x, char *str, int n);
+       int mvwgetnstr(WINDOW *, int y, int x, char *str, int n);
+
+
+
+

DESCRIPTION

+       The  function getstr is equivalent to a series of calls to
+       getch, until a newline or carriage return is received (the
+       terminating  character  is  not  included  in the returned
+       string).  The resulting value is placed in the area point-
+       ed to by the character pointer str.
+
+       wgetnstr  reads  at  most  n characters, thus preventing a
+       possible overflow of the input buffer.  Any attempt to en-
+       ter more characters (other than the terminating newline or
+       carriage return) causes a beep.  Function keys also  cause
+       a  beep  and are ignored.  The getnstr function reads from
+       the stdscr default window.
+
+       The user's erase and kill characters are interpreted.   If
+       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
+       KEY_BACKSPACE are both considered equivalent to the user's
+       kill character.
+
+       Characters  input are echoed only if echo is currently on.
+       In that case, backspace is echoed as deletion of the  pre-
+       vious character (typically a left motion).
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and an OK
+       (SVr4 specifies only "an integer value  other  than  ERR")
+       upon successful completion.
+
+       X/Open defines no error conditions.
+
+       In this implementation, these functions return an error if
+       the window pointer is null,  or  if  its  timeout  expires
+       without having any data.
+
+       This  implementation  provides an extension as well.  If a
+       SIGWINCH interrupts the function, it will  return  KEY_RE-
+       SIZE rather than OK or ERR.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that getstr, mvgetstr, and mvwgetstr may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  They  read  single-byte  characters  only.   The
+       standard  does  not define any error conditions.  This im-
+       plementation returns ERR if the window pointer is null, or
+       if the lower-level wgetch call returns an ERR.
+
+       SVr3  and early SVr4 curses implementations did not reject
+       function keys; the SVr4.0 documentation claimed that "spe-
+       cial  keys"  (such  as  function keys, "home" key, "clear"
+       key, etc.) are "interpreted", without giving details.   It
+       lied.   In  fact,  the  `character'  value appended to the
+       string by those implementations was  predictable  but  not
+       useful  (being,  in  fact, the low-order eight bits of the
+       key's KEY_ value).
+
+       The functions  getnstr,  mvgetnstr,  and  mvwgetnstr  were
+       present but not documented in SVr4.
+
+
+
+

SEE ALSO

+       curses(3x), curs_getch(3x), curs_variables(3x).
+
+
+
+                                                        curs_getstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_getyx.3x.html b/doc/html/man/curs_getyx.3x.html new file mode 100644 index 00000000000..7a3771641a7 --- /dev/null +++ b/doc/html/man/curs_getyx.3x.html @@ -0,0 +1,131 @@ + + + + +curs_getyx 3x + + + + +

curs_getyx 3x

+
+
+
+curs_getyx(3x)                                           curs_getyx(3x)
+
+
+
+
+
+

NAME

+       getyx,  getparyx,  getbegyx,  getmaxyx - get curses cursor
+       and window coordinates
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       void getyx(WINDOW *win, int y, int x);
+       void getparyx(WINDOW *win, int y, int x);
+       void getbegyx(WINDOW *win, int y, int x);
+       void getmaxyx(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       The getyx macro places the current cursor position of  the
+       given window in the two integer variables y and x.
+
+       If  win  is  a  subwindow,  the  getparyx macro places the
+       beginning coordinates of the  subwindow  relative  to  the
+       parent  window into two integer variables y and x.  Other-
+       wise, -1 is placed into y and x.
+
+       Like getyx, the getbegyx and  getmaxyx  macros  store  the
+       current  beginning  coordinates  and size of the specified
+       window.
+
+
+
+

RETURN VALUE

+       The return values of these  macros  are  undefined  (i.e.,
+       they  should not be used as the right-hand side of assign-
+       ment statements).
+
+
+
+

NOTES

+       All of these interfaces are macros.  A "&" is  not  neces-
+       sary before the variables y and x.
+
+
+
+

PORTABILITY

+       The  getyx,  getparyx,  getbegyx  and  getmaxyx macros are
+       described in the XSI Curses standard, Issue 4.
+
+       This implementation also provides functions getbegx, getb-
+       egy,  getcurx, getcury, getmaxx, getmaxy, getparx and get-
+       pary for compatibility with older versions of curses.
+
+       Although X/Open Curses does not address this, many  imple-
+       mentations  provide  members  of the WINDOW structure con-
+       taining values corresponding to these  macros.   For  best
+       portability,  do  not  rely  on  using the data in WINDOW,
+       since some implementations  make  WINDOW  opaque  (do  not
+       allow direct use of its members).
+
+       Besides  the problem of opaque structures, the data stored
+       in like-named members may not have like-values in  differ-
+       ent  implementations.   For  example, the WINDOW._maxx and
+       WINDOW._maxy  values  in  ncurses  have  (at  least  since
+       release 1.8.1) differed by one from some other implementa-
+       tions.  The difference is hidden by  means  of  the  macro
+       getmaxyx.
+
+
+
+

SEE ALSO

+       curses(3x), curs_legacy(3x), curs_opaque(3x)
+
+
+
+                                                         curs_getyx(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_in_wch.3x.html b/doc/html/man/curs_in_wch.3x.html new file mode 100644 index 00000000000..1535e51be22 --- /dev/null +++ b/doc/html/man/curs_in_wch.3x.html @@ -0,0 +1,109 @@ + + + + +curs_in_wch 3x + + + + +

curs_in_wch 3x

+
+
+
+curs_in_wch(3x)                                         curs_in_wch(3x)
+
+
+
+
+
+

NAME

+       in_wch,  mvin_wch,  mvwin_wch, win_wch - extract a complex
+       character and rendition from a window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int in_wch(cchar_t *wcval);
+       int mvin_wch(int y, int x, cchar_t *wcval);
+       int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
+       int win_wch(WINDOW *win, cchar_t *wcval);
+
+
+
+

DESCRIPTION

+       These functions extract the complex character  and  rendi-
+       tion  from  the  current position in the named window into
+       the cchar_t object referenced by wcval.
+
+
+
+

RETURN VALUE

+       No errors are defined in the XSI  Curses  standard.   This
+       implementation  checks  for  null pointers, returns ERR in
+       that case.  Also, the mv routines check for  error  moving
+       the  cursor,  returning  ERR in that case.  Otherwise they
+       return OK
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that all of these routines may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x), curs_inch(3x).
+
+
+
+                                                        curs_in_wch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_in_wchstr.3x.html b/doc/html/man/curs_in_wchstr.3x.html new file mode 100644 index 00000000000..e394e9063ce --- /dev/null +++ b/doc/html/man/curs_in_wchstr.3x.html @@ -0,0 +1,124 @@ + + + + +curs_in_wchstr 3x + + + + +

curs_in_wchstr 3x

+
+
+
+curs_in_wchstr(3x)                                   curs_in_wchstr(3x)
+
+
+
+
+
+

NAME

+       in_wchstr, in_wchnstr, win_wchstr, win_wchnstr,
+       mvin_wchstr, mvin_wchnstr, mvwin_wchstr, mvwin_wchnstr -
+       get an array of complex characters and renditions from a
+       curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int in_wchstr(cchar_t *wchstr);
+       int in_wchnstr(cchar_t *wchstr, int n);
+       int win_wchstr(WINDOW *win, cchar_t *wchstr);
+       int win_wchnstr(WINDOW *win, cchar_t *wchstr, int n);
+       int mvin_wchstr(int y, int x, cchar_t *wchstr);
+       int mvin_wchnstr(int y, int x, cchar_t *wchstr, int n);
+       int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr);
+       int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n);
+
+
+
+

DESCRIPTION

+       These functions return an array of complex  characters  in
+       wchstr,  starting  at  the  current cursor position in the
+       named window.  Attributes (rendition) are stored with  the
+       characters.
+
+       The  in_wchnstr, mvin_wchnstr, mvwin_wchnstr and win_wchn-
+       str fill the array with at most n cchar_t elements.
+
+
+
+

NOTES

+       Note that all routines except win_wchnstr may be macros.
+
+       Reading a line that overflows the array pointed to by wch-
+       str  with in_wchstr, mvin_wchstr, mvwin_wchstr or win_wch-
+       str  causes  undefined  results.  Therefore,  the  use  of
+       in_wchnstr, mvin_wchnstr, mvwin_wchnstr, or win_wchnstr is
+       recommended.
+
+
+
+

RETURN VALUES

+       Upon successful completion,  these  functions  return  OK.
+       Otherwise, they return ERR.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

PORTABILITY

+       The  XSI  Curses defines no error conditions.  This imple-
+       mentation checks for null pointers, returning ERR in  that
+       case.
+
+
+
+

SEE ALSO

+       Functions:  curses(3x),  curs_in_wch(3x),  curs_instr(3x),
+       curs_inwstr(3x) curs_inchstr(3x)
+
+
+
+                                                     curs_in_wchstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_inch.3x.html b/doc/html/man/curs_inch.3x.html new file mode 100644 index 00000000000..43c6159317c --- /dev/null +++ b/doc/html/man/curs_inch.3x.html @@ -0,0 +1,118 @@ + + + + +curs_inch 3x + + + + +

curs_inch 3x

+
+
+
+curs_inch(3x)                                             curs_inch(3x)
+
+
+
+
+
+

NAME

+       inch,  winch,  mvinch,  mvwinch  -  get  a  character  and
+       attributes from a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       chtype inch(void);
+       chtype winch(WINDOW *win);
+       chtype mvinch(int y, int x);
+       chtype mvwinch(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       These routines return the character, of  type  chtype,  at
+       the   current  position  in  the  named  window.   If  any
+       attributes are set for that  position,  their  values  are
+       OR'ed  into  the  value  returned.   Constants  defined in
+       <curses.h> can be used with the & (logical  AND)  operator
+       to extract the character or attributes alone.
+
+   Attributes
+       The  following  bit-masks  may  be  AND-ed with characters
+       returned by winch.
+
+       A_CHARTEXT     Bit-mask to extract character
+       A_ATTRIBUTES   Bit-mask to extract attributes
+       A_COLOR        Bit-mask to extract color-pair field information
+
+
+
+

RETURN VALUE

+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that all of these routines may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x).
+
+       Comparable  functions  in  the  wide-character  (ncursesw)
+       library are described in curs_in_wch(3x).
+
+
+
+                                                          curs_inch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_inchstr.3x.html b/doc/html/man/curs_inchstr.3x.html new file mode 100644 index 00000000000..73a78fc9c5c --- /dev/null +++ b/doc/html/man/curs_inchstr.3x.html @@ -0,0 +1,133 @@ + + + + +curs_inchstr 3x + + + + +

curs_inchstr 3x

+
+
+
+curs_inchstr(3x)                                       curs_inchstr(3x)
+
+
+
+
+
+

NAME

+       inchstr, inchnstr, winchstr, winchnstr, mvinchstr,
+       mvinchnstr, mvwinchstr, mvwinchnstr - get a string of
+       characters (and attributes) from a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int inchstr(chtype *chstr);
+       int inchnstr(chtype *chstr, int n);
+       int winchstr(WINDOW *win, chtype *chstr);
+       int winchnstr(WINDOW *win, chtype *chstr, int n);
+       int mvinchstr(int y, int x, chtype *chstr);
+       int mvinchnstr(int y, int x, chtype *chstr, int n);
+       int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);
+       int  mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr,
+       int n);
+
+
+
+

DESCRIPTION

+       These routines return a NULL-terminated  array  of  chtype
+       quantities, starting at the current cursor position in the
+       named window and ending at the right margin of the window.
+       The  four  functions with n as the last argument, return a
+       leading substring at most n characters long (exclusive  of
+       the  trailing (chtype)0).  Constants defined in <curses.h>
+       can be used with the & (logical AND) operator  to  extract
+       the  character or the attribute alone from any position in
+       the chstr [see curs_inch(3x)].
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon  failure  and  an
+       integer  value  other  than ERR upon successful completion
+       (the number of  characters  retrieved,  exclusive  of  the
+       trailing 0).
+
+       No  error  conditions are defined.  If the chstr parameter
+       is null, no data is returned, and the return value is  ze-
+       ro.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note  that  all  routines  except winchnstr may be macros.
+       SVr4 does not document whether the result string is  zero-
+       terminated;  it  does  not document whether a length limit
+       argument includes any trailing 0; and it does not document
+       the meaning of the return value.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  It is no more specific than the SVr4  documenta-
+       tion on the trailing 0.  It does specify that the success-
+       ful return of the functions is OK.
+
+
+
+

SEE ALSO

+       curses(3x), curs_inch(3x).
+
+       Comparable functions in the wide-character (ncursesw)  li-
+       brary are described in curs_in_wchstr(3x).
+
+
+
+                                                       curs_inchstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_initscr.3x.html b/doc/html/man/curs_initscr.3x.html new file mode 100644 index 00000000000..5c4364d80e4 --- /dev/null +++ b/doc/html/man/curs_initscr.3x.html @@ -0,0 +1,167 @@ + + + + +curs_initscr 3x + + + + +

curs_initscr 3x

+
+
+
+curs_initscr(3x)                                       curs_initscr(3x)
+
+
+
+
+
+

NAME

+       initscr, newterm, endwin, isendwin, set_term, delscreen -
+       curses screen initialization and manipulation routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       WINDOW *initscr(void);
+       int endwin(void);
+       bool isendwin(void);
+       SCREEN *newterm(char *type, FILE *outfd, FILE *infd);
+       SCREEN *set_term(SCREEN *new);
+       void delscreen(SCREEN* sp);
+
+
+
+

DESCRIPTION

+       initscr is normally the first curses routine to call  when
+       initializing  a program.  A few special routines sometimes
+       need to be called before it; these are  slk_init,  filter,
+       ripoffline,  use_env.  For multiple-terminal applications,
+       newterm may be called before initscr.
+
+       The initscr code determines the terminal type and initial-
+       izes  all curses data structures.  initscr also causes the
+       first call to refresh to clear the screen.  If errors  oc-
+       cur,  initscr writes an appropriate error message to stan-
+       dard error and exits; otherwise, a pointer is returned  to
+       stdscr.
+
+       A  program  that  outputs to more than one terminal should
+       use the newterm  routine  for  each  terminal  instead  of
+       initscr.  A program that needs to inspect capabilities, so
+       it can continue to run in a line-oriented mode if the ter-
+       minal cannot support a screen-oriented program, would also
+       use newterm.  The routine newterm should  be  called  once
+       for each terminal.  It returns a variable of type SCREEN *
+       which should be saved as a  reference  to  that  terminal.
+       The  arguments  are the type of the terminal to be used in
+       place of $TERM, a file pointer for output to the terminal,
+       and  another  file pointer for input from the terminal (if
+       type is NULL, $TERM will be used).  The program must  also
+       call  endwin  for  each terminal being used before exiting
+       from curses.  If newterm is called more than once for  the
+       same  terminal, the first terminal referred to must be the
+       last one for which endwin is called.
+
+       A program should always call endwin before exiting or  es-
+       caping  from  curses  mode  temporarily.  This routine re-
+       stores tty modes, moves the cursor to the lower  left-hand
+       corner  of  the  screen  and  resets the terminal into the
+       proper non-visual mode.  Calling refresh or doupdate after
+       a  temporary  escape  causes  the program to resume visual
+       mode.
+
+       The isendwin routine  returns  TRUE  if  endwin  has  been
+       called without any subsequent calls to wrefresh, and FALSE
+       otherwise.
+
+       The set_term routine is used to switch  between  different
+       terminals.   The screen reference new becomes the new cur-
+       rent terminal.  The previous terminal is returned  by  the
+       routine.   This  is  the  only  routine  which manipulates
+       SCREEN pointers; all other routines affect only  the  cur-
+       rent terminal.
+
+       The  delscreen  routine  frees storage associated with the
+       SCREEN data structure.  The endwin  routine  does  not  do
+       this, so delscreen should be called after endwin if a par-
+       ticular SCREEN is no longer needed.
+
+
+
+

RETURN VALUE

+       endwin returns the integer ERR upon failure  and  OK  upon
+       successful completion.
+
+       Routines that return pointers always return NULL on error.
+
+       X/Open  defines  no error conditions.  In this implementa-
+       tion endwin returns an error if the terminal was not  ini-
+       tialized.
+
+
+
+

NOTES

+       Note that initscr and newterm may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  It specifies that portable applications must not
+       call initscr more than once.
+
+       Old versions of curses, e.g., BSD 4.4, may have returned a
+       null pointer from  initscr  when  an  error  is  detected,
+       rather  than  exiting.   It is safe but redundant to check
+       the return value of initscr in XSI Curses.
+
+
+
+

SEE ALSO

+       curses(3x),       curs_kernel(3x),       curs_refresh(3x),
+       curs_slk(3x), curs_util(3x), curs_variables(3x).
+
+
+
+                                                       curs_initscr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_inopts.3x.html b/doc/html/man/curs_inopts.3x.html new file mode 100644 index 00000000000..d85164234c5 --- /dev/null +++ b/doc/html/man/curs_inopts.3x.html @@ -0,0 +1,261 @@ + + + + +curs_inopts 3x + + + + +

curs_inopts 3x

+
+
+
+curs_inopts(3x)                                         curs_inopts(3x)
+
+
+
+
+
+

NAME

+       cbreak, nocbreak, echo, noecho, halfdelay, intrflush,
+       keypad, meta, nodelay, notimeout, raw, noraw, noqiflush,
+       qiflush, timeout, wtimeout, typeahead - curses input
+       options
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int cbreak(void);
+       int nocbreak(void);
+       int echo(void);
+       int noecho(void);
+       int halfdelay(int tenths);
+       int intrflush(WINDOW *win, bool bf);
+       int keypad(WINDOW *win, bool bf);
+       int meta(WINDOW *win, bool bf);
+       int nodelay(WINDOW *win, bool bf);
+       int raw(void);
+       int noraw(void);
+       void noqiflush(void);
+       void qiflush(void);
+       int notimeout(WINDOW *win, bool bf);
+       void timeout(int delay);
+       void wtimeout(WINDOW *win, int delay);
+       int typeahead(int fd);
+
+
+
+

DESCRIPTION

+       Normally, the tty driver buffers typed characters until  a
+       newline  or  carriage return is typed.  The cbreak routine
+       disables line buffering and erase/kill  character-process-
+       ing  (interrupt  and flow control characters are unaffect-
+       ed), making  characters  typed  by  the  user  immediately
+       available  to  the  program.  The nocbreak routine returns
+       the terminal to normal (cooked) mode.
+
+       Initially the terminal may or may not be in  cbreak  mode,
+       as the mode is inherited; therefore, a program should call
+       cbreak or nocbreak explicitly.  Most interactive  programs
+       using  curses set the cbreak mode.  Note that cbreak over-
+       rides raw.  [See curs_getch(3x) for a  discussion  of  how
+       these routines interact with echo and noecho.]
+
+       The  echo  and  noecho routines control whether characters
+       typed by the user are echoed by getch as they  are  typed.
+       Echoing by the tty driver is always disabled, but initial-
+       ly getch is in echo mode, so characters typed are  echoed.
+       Authors  of  most  interactive programs prefer to do their
+       own echoing in a controlled area of the screen, or not  to
+       echo  at  all,  so they disable echoing by calling noecho.
+       [See curs_getch(3x) for a discussion of how these routines
+       interact with cbreak and nocbreak.]
+
+       The  halfdelay  routine is used for half-delay mode, which
+       is similar to cbreak mode in that characters typed by  the
+       user  are  immediately available to the program.  However,
+       after blocking for tenths tenths of seconds,  ERR  is  re-
+       turned  if  nothing  has  been typed.  The value of tenths
+       must be a number between 1 and 255.  Use nocbreak to leave
+       half-delay mode.
+
+       If  the intrflush option is enabled, (bf is TRUE), when an
+       interrupt key  is  pressed  on  the  keyboard  (interrupt,
+       break,  quit)  all  output in the tty driver queue will be
+       flushed, giving the effect of faster response to  the  in-
+       terrupt, but causing curses to have the wrong idea of what
+       is on the screen.  Disabling (bf  is  FALSE),  the  option
+       prevents  the flush.  The default for the option is inher-
+       ited from the tty driver settings.  The window argument is
+       ignored.
+
+       The  keypad option enables the keypad of the user's termi-
+       nal.  If enabled (bf is TRUE), the user can press a  func-
+       tion  key (such as an arrow key) and wgetch returns a sin-
+       gle value representing the function key, as  in  KEY_LEFT.
+       If  disabled (bf is FALSE), curses does not treat function
+       keys specially and the program has to interpret the escape
+       sequences  itself.   If  the keypad in the terminal can be
+       turned on (made to transmit) and off (made to work  local-
+       ly),  turning on this option causes the terminal keypad to
+       be turned on when wgetch is called.  The default value for
+       keypad is false.
+
+       Initially, whether the terminal returns 7 or 8 significant
+       bits on input depends on the control mode of the tty driv-
+       er  [see  termio(7)].  To force 8 bits to be returned, in-
+       voke meta(win, TRUE); this is equivalent, under POSIX,  to
+       setting  the CS8 flag on the terminal.  To force 7 bits to
+       be returned, invoke meta(win, FALSE); this is  equivalent,
+       under POSIX, to setting the CS7 flag on the terminal.  The
+       window argument, win, is always ignored.  If the  terminfo
+       capabilities  smm (meta_on) and rmm (meta_off) are defined
+       for the  terminal,  smm  is  sent  to  the  terminal  when
+       meta(win,  TRUE)  is called and rmm is sent when meta(win,
+       FALSE) is called.
+
+       The nodelay option causes getch to be a non-blocking call.
+       If  no input is ready, getch returns ERR.  If disabled (bf
+       is FALSE), getch waits until a key is pressed.
+
+       While interpreting an input escape sequence, wgetch sets a
+       timer  while  waiting  for the next character.  If notime-
+       out(win, TRUE) is called,  then  wgetch  does  not  set  a
+       timer.  The purpose of the timeout is to differentiate be-
+       tween sequences received from a  function  key  and  those
+       typed by a user.
+
+       The  raw and noraw routines place the terminal into or out
+       of raw mode.  Raw mode is similar to cbreak mode, in  that
+       characters typed are immediately passed through to the us-
+       er program.  The differences are that in raw mode, the in-
+       terrupt,  quit,  suspend,  and flow control characters are
+       all passed through uninterpreted, instead of generating  a
+       signal.   The  behavior  of the BREAK key depends on other
+       bits in the tty driver that are not set by curses.
+
+       When the noqiflush routine is used, normal flush of  input
+       and  output queues associated with the INTR, QUIT and SUSP
+       characters will not be done [see termio(7)].  When qiflush
+       is  called,  the queues will be flushed when these control
+       characters are read.  You may want to call noqiflush()  in
+       a  signal handler if you want output to continue as though
+       the interrupt had not occurred, after the handler exits.
+
+       The timeout and wtimeout routines  set  blocking  or  non-
+       blocking  read  for a given window.  If delay is negative,
+       blocking read is used (i.e., waits  indefinitely  for  in-
+       put).   If  delay  is zero, then non-blocking read is used
+       (i.e., read returns ERR if no input is waiting).  If delay
+       is  positive, then read blocks for delay milliseconds, and
+       returns ERR if there is still no input.  Hence, these rou-
+       tines  provide the same functionality as nodelay, plus the
+       additional capability of being able to block for only  de-
+       lay milliseconds (where delay is positive).
+
+       The  curses library does ``line-breakout optimization'' by
+       looking for  typeahead  periodically  while  updating  the
+       screen.   If  input is found, and it is coming from a tty,
+       the current update is postponed until refresh or  doupdate
+       is  called again.  This allows faster response to commands
+       typed in advance.  Normally, the input FILE pointer passed
+       to  newterm,  or  stdin in the case that initscr was used,
+       will be used to do this typeahead checking.  The typeahead
+       routine  specifies  that  the  file descriptor fd is to be
+       used to check for typeahead instead.  If fd is -1, then no
+       typeahead checking is done.
+
+
+
+

RETURN VALUE

+       All  routines that return an integer return ERR upon fail-
+       ure and OK (SVr4 specifies only "an  integer  value  other
+       than  ERR")  upon  successful completion, unless otherwise
+       noted in the preceding routine descriptions.
+
+       X/Open does not define any error conditions.  In this  im-
+       plementation,  functions  with a window parameter will re-
+       turn an error if it is null.  Any function will  also  re-
+       turn an error if the terminal was not initialized.  Also,
+
+              halfdelay
+                   returns  an  error if its parameter is outside
+                   the range 1..255.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+       The  ncurses  library obeys the XPG4 standard and the his-
+       torical practice of the AT&T  curses  implementations,  in
+       that  the  echo bit is cleared when curses initializes the
+       terminal state.  BSD curses differed from  this  slightly;
+       it left the echo bit on at initialization, but the BSD raw
+       call turned it off as a side-effect.  For best  portabili-
+       ty,  set  echo or noecho explicitly just after initializa-
+       tion, even if your program remains in cooked mode.
+
+
+
+

NOTES

+       Note that echo, noecho, halfdelay, intrflush, meta,  node-
+       lay,  notimeout, noqiflush, qiflush, timeout, and wtimeout
+       may be macros.
+
+       The noraw and nocbreak calls follow historical practice in
+       that  they  attempt  to  restore to normal (`cooked') mode
+       from raw and cbreak modes respectively.  Mixing  raw/noraw
+       and  cbreak/nocbreak  calls  leads  to  tty driver control
+       states that are hard to predict or understand; it  is  not
+       recommended.
+
+
+
+

SEE ALSO

+       curses(3x), curs_getch(3x), curs_initscr(3x), termio(7)
+
+
+
+                                                        curs_inopts(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_ins_wch.3x.html b/doc/html/man/curs_ins_wch.3x.html new file mode 100644 index 00000000000..2b3714c55dd --- /dev/null +++ b/doc/html/man/curs_ins_wch.3x.html @@ -0,0 +1,104 @@ + + + + +curs_ins_wch 3x + + + + +

curs_ins_wch 3x

+
+
+
+curs_ins_wch(3x)                                       curs_ins_wch(3x)
+
+
+
+
+
+

NAME

+       ins_wch,  mvins_wch,  mvwins_wch, wins_wch - insert a com-
+       plex character and rendition into a window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int ins_wch(const cchar_t *wch);
+       int wins_wch(WINDOW *win, const cchar_t *wch);
+       int mvins_wch(int y, int x, const cchar_t *wch);
+       int mvwins_wch(WINDOW *win, int y, int  x,  const  cchar_t
+       *wch);
+
+
+
+

DESCRIPTION

+       These routines, insert the complex character wch with ren-
+       dition before the character under the cursor.  All charac-
+       ters to the right of the cursor are moved one space to the
+       right, with the possibility of the rightmost character  on
+       the  line  being  lost.   The insertion operation does not
+       change the cursor position.
+
+
+
+

RETURN VALUE

+       If successful, these functions return OK.   If  not,  they
+       return ERR.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

ERRORS

+       No errors are defined.
+
+
+
+

SEE ALSO

+       curses(3x), curs_insch(3x).
+
+
+
+                                                       curs_ins_wch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_ins_wstr.3x.html b/doc/html/man/curs_ins_wstr.3x.html new file mode 100644 index 00000000000..5f7cee6142c --- /dev/null +++ b/doc/html/man/curs_ins_wstr.3x.html @@ -0,0 +1,129 @@ + + + + +curs_ins_wstr 3x + + + + +

curs_ins_wstr 3x

+
+
+
+curs_ins_wstr(3x)                                     curs_ins_wstr(3x)
+
+
+
+
+
+

NAME

+       ins_wstr, ins_nwstr, wins_wstr, wins_nwstr, mvins_wstr,
+       mvins_nwstr, mvwins_wstr, mvwins_nwstr - insert a wide-
+       character string into a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int ins_wstr(const wchar_t *wstr);
+       int ins_nwstr(const wchar_t *wstr, int n);
+       int wins_wstr(WINDOW *win, const wchar_t *wstr);
+       int wins_nwstr(WINDOW *win, const wchar_t *wstr, int n);
+       int mvins_wstr(int y, int x, const wchar_t *wstr);
+       int mvins_nwstr(int y, int x, const wchar_t *wstr, int n);
+       int mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr);
+       int mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
+
+
+
+

DESCRIPTION

+       These  routines insert a wchar_t character string (as many
+       characters as will fit on the line) before  the  character
+       under the cursor.  All characters to the right of the cur-
+       sor are shifted right, with the possibility of the  right-
+       most  characters  on  the line being lost.  No wrapping is
+       performed.  The cursor position  does  not  change  (after
+       moving  to  y, x, if specified).  The four routines with n
+       as the last argument insert a leading substring of at most
+       n  wchar_t  characters.   If  n is less than 1, the entire
+       string is inserted.
+
+       If a character in wstr is a tab, newline, carriage  return
+       or backspace, the cursor is moved appropriately within the
+       window.  A newline also does  a  clrtoeol  before  moving.
+       Tabs  are  considered  to be at every eighth column.  If a
+       character in wstr is  another  control  character,  it  is
+       drawn  in the ^X notation.  Calling win_wch after adding a
+       control character (and moving to it,  if  necessary)  does
+       not  return  the  control character, but instead returns a
+       character in the ^-representation of the  control  charac-
+       ter.
+
+
+
+

NOTES

+       Note that all but wins_nwstr may be macros.
+
+       If the first character in the string is a nonspacing char-
+       acter, these functions will fail.   XSI  does  not  define
+       what  will happen if a nonspacing character follows a con-
+       trol character.
+
+
+
+

RETURN VALUES

+       Upon successful completion,  these  functions  return  OK.
+       Otherwise, they return ERR.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

SEE ALSO

+       curses(3x),        curs_insstr(3x),       curs_in_wch(3x),
+       curs_ins_wch(3x).
+
+
+
+                                                      curs_ins_wstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_insch.3x.html b/doc/html/man/curs_insch.3x.html new file mode 100644 index 00000000000..f8c833eb5c8 --- /dev/null +++ b/doc/html/man/curs_insch.3x.html @@ -0,0 +1,117 @@ + + + + +curs_insch 3x + + + + +

curs_insch 3x

+
+
+
+curs_insch(3x)                                           curs_insch(3x)
+
+
+
+
+
+

NAME

+       insch,  winsch,  mvinsch,  mvwinsch  -  insert a character
+       before cursor in a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int insch(chtype ch);
+       int winsch(WINDOW *win, chtype ch);
+       int mvinsch(int y, int x, chtype ch);
+       int mvwinsch(WINDOW *win, int y, int x, chtype ch);
+
+
+
+

DESCRIPTION

+       These routines insert the character ch before the  charac-
+       ter  under the cursor.  All characters to the right of the
+       cursor are moved one space to the right, with  the  possi-
+       bility  of the rightmost character on the line being lost.
+       The insertion operation does not change the  cursor  posi-
+       tion.
+
+
+
+

RETURN VALUE

+       All  routines that return an integer return ERR upon fail-
+       ure and OK (SVr4 specifies only "an  integer  value  other
+       than  ERR")  upon  successful completion, unless otherwise
+       noted in the preceding routine descriptions.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       These routines do not necessarily imply use of a  hardware
+       insert character feature.
+
+       Note that insch, mvinsch, and mvwinsch may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x).
+
+       Comparable  functions  in  the  wide-character  (ncursesw)
+       library are described in curs_ins_wch(3x).
+
+
+
+                                                         curs_insch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_insstr.3x.html b/doc/html/man/curs_insstr.3x.html new file mode 100644 index 00000000000..7a616489e6d --- /dev/null +++ b/doc/html/man/curs_insstr.3x.html @@ -0,0 +1,131 @@ + + + + +curs_insstr 3x + + + + +

curs_insstr 3x

+
+
+
+curs_insstr(3x)                                         curs_insstr(3x)
+
+
+
+
+
+

NAME

+       insstr,  insnstr,  winsstr, winsnstr, mvinsstr, mvinsnstr,
+       mvwinsstr, mvwinsnstr - insert string before cursor  in  a
+       curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int insstr(const char *str);
+       int insnstr(const char *str, int n);
+       int winsstr(WINDOW *win, const char *str);
+       int winsnstr(WINDOW *win, const char *str, int n);
+       int mvinsstr(int y, int x, const char *str);
+       int mvinsnstr(int y, int x, const char *str, int n);
+       int mvwinsstr(WINDOW *win, int y, int x, const char *str);
+       int mvwinsnstr(WINDOW *win, int y, int x, const char *str,
+       int n);
+
+
+
+

DESCRIPTION

+       These routines insert a character string (as many  charac-
+       ters  as  will fit on the line) before the character under
+       the cursor.  All characters to the right of the cursor are
+       shifted  right with the possibility of the rightmost char-
+       acters on the line being lost.  The cursor  position  does
+       not  change  (after  moving  to  y, x, if specified).  The
+       functions with n as the last  argument  insert  a  leading
+       substring  of  at  most  n  characters.  If n<=0, then the
+       entire string is inserted.
+
+       Special characters are handled as in addch.
+
+
+
+

RETURN VALUE

+       All routines that return an integer return ERR upon  fail-
+       ure  and  OK  (SVr4 specifies only "an integer value other
+       than ERR") upon successful  completion,  unless  otherwise
+       noted in the preceding routine descriptions.
+
+       X/Open  defines  no error conditions.  In this implementa-
+       tion, if the window parameter is null or the str parameter
+       is null, an error is returned.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that all but winsnstr may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4, which adds const qualifiers to the arguments.
+
+       The Single  Unix  Specification,  Version  2  states  that
+       insnstr  and  winsnstr perform wrapping.  This is probably
+       an error, since it makes this group of functions inconsis-
+       tent.   Also,  no  implementation of curses documents this
+       inconsistency.
+
+
+
+

SEE ALSO

+       curses(3x), curs_util(3x), curs_clear(3x), curs_inch(3x).
+
+
+
+                                                        curs_insstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_instr.3x.html b/doc/html/man/curs_instr.3x.html new file mode 100644 index 00000000000..0f32d58eae6 --- /dev/null +++ b/doc/html/man/curs_instr.3x.html @@ -0,0 +1,123 @@ + + + + +curs_instr 3x + + + + +

curs_instr 3x

+
+
+
+curs_instr(3x)                                           curs_instr(3x)
+
+
+
+
+
+

NAME

+       instr,  innstr, winstr, winnstr, mvinstr, mvinnstr, mvwin-
+       str, mvwinnstr - get a string of characters from a  curses
+       window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int instr(char *str);
+       int innstr(char *str, int n);
+       int winstr(WINDOW *win, char *str);
+       int winnstr(WINDOW *win, char *str, int n);
+       int mvinstr(int y, int x, char *str);
+       int mvinnstr(int y, int x, char *str, int n);
+       int mvwinstr(WINDOW *win, int y, int x, char *str);
+       int  mvwinnstr(WINDOW  *win,  int y, int x, char *str, int
+       n);
+
+
+
+

DESCRIPTION

+       These routines return  a  string  of  characters  in  str,
+       extracted  starting  at the current cursor position in the
+       named window.  Attributes are stripped  from  the  charac-
+       ters.   The  four  functions  with  n as the last argument
+       return a leading  substring  at  most  n  characters  long
+       (exclusive of the trailing NUL).
+
+
+
+

RETURN VALUE

+       All  of the functions return ERR upon failure, or the num-
+       ber of characters actually read into the string.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion, if the window parameter is null or the str parameter
+       is null, a zero is returned.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

NOTES

+       Note that all routines except winnstr may be macros.
+
+
+
+

PORTABILITY

+       SVr4 does not document whether a length limit includes  or
+       excludes the trailing NUL.
+
+       The  ncurses library extends the XSI description by allow-
+       ing a negative value for n.  In this case,  the  functions
+       return the string ending at the right margin.
+
+
+
+

SEE ALSO

+       curses(3x).
+
+
+
+                                                         curs_instr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_inwstr.3x.html b/doc/html/man/curs_inwstr.3x.html new file mode 100644 index 00000000000..223c398de20 --- /dev/null +++ b/doc/html/man/curs_inwstr.3x.html @@ -0,0 +1,115 @@ + + + + +curs_inwstr 3x + + + + +

curs_inwstr 3x

+
+
+
+curs_inwstr(3x)                                         curs_inwstr(3x)
+
+
+
+
+
+

NAME

+       inwstr,  innwstr,  winwstr, winnwstr, mvinwstr, mvinnwstr,
+       mvwinwstr, mvwinnwstr - get a string of wchar_t characters
+       from a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int inwstr(wchar_t *str);
+       int innwstr(wchar_t *str, int n);
+       int winwstr(WINDOW *win, wchar_t *str);
+       int winnwstr(WINDOW *win, wchar_t *str, int n);
+       int mvinwstr(int y, int x, wchar_t *str);
+       int mvinnwstr(int y, int x, wchar_t *str, int n);
+       int mvwinwstr(WINDOW *win, int y, int x, wchar_t *str);
+       int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *str, int n);
+
+
+
+

DESCRIPTION

+       These  routines  return  a string of wchar_t characters in
+       wstr, extracted starting at the current cursor position in
+       the  named window.  Attributes are stripped from the char-
+       acters.  The four functions with n as  the  last  argument
+       return a leading substring at most n bytes long (exclusive
+       of the trailing NUL).  Transfer stops at the  end  of  the
+       current  line,  or  when  n  bytes have been stored at the
+       location referenced by wstr.
+
+       If the size n is not large  enough  to  store  a  complete
+       character, an error is generated.
+
+
+
+

NOTES

+       Note that all routines except winnwstr may be macros.
+
+
+
+

RETURN VALUES

+       All routines return ERR upon failure. Upon successful com-
+       pletion, the *inwstr routines return OK, and the  *innwstr
+       routines  return  the  number  of characters read into the
+       string.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

SEE ALSO

+       curses(3x), curs_instr(3x), curs_in_wchstr(3x)
+
+
+
+                                                        curs_inwstr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_kernel.3x.html b/doc/html/man/curs_kernel.3x.html new file mode 100644 index 00000000000..a2e247cea51 --- /dev/null +++ b/doc/html/man/curs_kernel.3x.html @@ -0,0 +1,206 @@ + + + + +curs_kernel 3x + + + + +

curs_kernel 3x

+
+
+
+curs_kernel(3x)                                         curs_kernel(3x)
+
+
+
+
+
+

NAME

+       def_prog_mode, def_shell_mode, reset_prog_mode,
+       reset_shell_mode, resetty, savetty, getsyx, setsyx,
+       ripoffline, curs_set, napms - low-level curses routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int def_prog_mode(void);
+       int def_shell_mode(void);
+       int reset_prog_mode(void);
+       int reset_shell_mode(void);
+       int resetty(void);
+       int savetty(void);
+       void getsyx(int y, int x);
+       void setsyx(int y, int x);
+       int ripoffline(int line, int (*init)(WINDOW *, int));
+       int curs_set(int visibility);
+       int napms(int ms);
+
+
+
+

DESCRIPTION

+       The  following  routines  give low-level access to various
+       curses capabilities.  These routines  typically  are  used
+       inside library routines.
+
+       The  def_prog_mode  and  def_shell_mode  routines save the
+       current terminal modes as the  "program"  (in  curses)  or
+       "shell"   (not  in  curses)  state  for  use  by  the  re-
+       set_prog_mode and reset_shell_mode routines.  This is done
+       automatically by initscr.  There is one such save area for
+       each screen context allocated by newterm().
+
+       The reset_prog_mode and reset_shell_mode routines  restore
+       the  terminal  to "program" (in curses) or "shell" (out of
+       curses) state.  These are  done  automatically  by  endwin
+       and,  after  an  endwin, by doupdate, so they normally are
+       not called.
+
+       The resetty and savetty  routines  save  and  restore  the
+       state  of  the  terminal modes.  savetty saves the current
+       state in a buffer and resetty restores the state  to  what
+       it was at the last call to savetty.
+
+       The  getsyx routine returns the current coordinates of the
+       virtual screen cursor in y and x.  If leaveok is currently
+       TRUE,  then -1,-1 is returned.  If lines have been removed
+       from the top of the screen, using ripoffline, y and x  in-
+       clude  these lines; therefore, y and x should be used only
+       as arguments for setsyx.
+
+       The setsyx routine sets the virtual screen cursor to y, x.
+       If y and x are both -1, then leaveok is set.  The two rou-
+       tines getsyx and setsyx are designed to be used by  a  li-
+       brary  routine,  which manipulates curses windows but does
+       not want to change the current position of  the  program's
+       cursor.   The library routine would call getsyx at the be-
+       ginning, do its manipulation of  its  own  windows,  do  a
+       wnoutrefresh  on  its  windows, call setsyx, and then call
+       doupdate.
+
+       The ripoffline routine provides access to the same facili-
+       ty  that  slk_init  [see  curs_slk(3x)] uses to reduce the
+       size of the screen.   ripoffline  must  be  called  before
+       initscr or newterm is called.  If line is positive, a line
+       is removed from the top of stdscr; if line is negative,  a
+       line is removed from the bottom.  When this is done inside
+       initscr, the routine init (supplied by the user) is called
+       with  two arguments: a window pointer to the one-line win-
+       dow that has been allocated and an integer with the number
+       of columns in the window.  Inside this initialization rou-
+       tine, the integer variables LINES  and  COLS  (defined  in
+       <curses.h>) are not guaranteed to be accurate and wrefresh
+       or doupdate must not be called.  It is allowable  to  call
+       wnoutrefresh during the initialization routine.
+
+       ripoffline  can  be called up to five times before calling
+       initscr or newterm.
+
+       The curs_set routine sets the cursor state  to  invisible,
+       normal, or very visible for visibility equal to 0, 1, or 2
+       respectively.  If the terminal supports the visibility re-
+       quested, the previous cursor state is returned; otherwise,
+       ERR is returned.
+
+       The napms routine is used to sleep for ms milliseconds.
+
+
+
+

RETURN VALUE

+       Except for curs_set, these routines always return OK.
+
+       curs_set returns the previous cursor state, or ERR if  the
+       requested visibility is not supported.
+
+       X/Open  defines  no error conditions.  In this implementa-
+       tion
+
+              def_prog_mode, def_shell_mode, reset_prog_mode, re-
+              set_shell_mode
+                   return  an  error if the terminal was not ini-
+                   tialized, or if the I/O  call  to  obtain  the
+                   terminal settings fails.
+
+              ripoffline
+                   returns  an  error  if  the  maximum number of
+                   ripped-off lines exceeds the maximum (NRIPS  =
+                   5).
+
+
+
+

NOTES

+       Note  that getsyx is a macro, so & is not necessary before
+       the variables y and x.
+
+       Older SVr4  man  pages  warn  that  the  return  value  of
+       curs_set  "is  currently  incorrect".  This implementation
+       gets it right, but it may be unwise to count on  the  cor-
+       rectness of the return value anywhere else.
+
+       Both  ncurses  and  SVr4  will  call curs_set in endwin if
+       curs_set has been called to make  the  cursor  other  than
+       normal,  i.e., either invisible or very visible.  There is
+       no way for ncurses to determine the initial  cursor  state
+       to restore that.
+
+
+
+

PORTABILITY

+       The  functions  setsyx and getsyx are not described in the
+       XSI Curses standard, Issue 4.  All other functions are  as
+       described in XSI Curses.
+
+       The SVr4 documentation describes setsyx and getsyx as hav-
+       ing return type int.  This  is  misleading,  as  they  are
+       macros with no documented semantics for the return value.
+
+
+
+

SEE ALSO

+       curses(3x),  curs_initscr(3x),  curs_outopts(3x), curs_re-
+       fresh(3x),  curs_scr_dump(3x),  curs_slk(3x),   curs_vari-
+       ables(3x).
+
+
+
+                                                        curs_kernel(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_legacy.3x.html b/doc/html/man/curs_legacy.3x.html new file mode 100644 index 00000000000..5a86252fbcb --- /dev/null +++ b/doc/html/man/curs_legacy.3x.html @@ -0,0 +1,121 @@ + + + + +curs_legacy 3x + + + + +

curs_legacy 3x

+
+
+
+curs_legacy(3x)                                         curs_legacy(3x)
+
+
+
+
+
+

NAME

+       getattrs  -  get  curses  cursor  and  window coordinates,
+       attributes
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int getattrs(WINDOW *win);
+       int getbegx(WINDOW *win);
+       int getbegy(WINDOW *win);
+       int getcurx(WINDOW *win);
+       int getcury(WINDOW *win);
+       int getmaxx(WINDOW *win);
+       int getmaxy(WINDOW *win);
+       int getparx(WINDOW *win);
+       int getpary(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The getbegy and getbegx functions return the same data  as
+       getbegyx.
+
+       The  getcury and getcurx functions return the same data as
+       getyx.
+
+       The getmaxy and getmaxx functions return the same data  as
+       getmaxyx.
+
+       The  getpary and getparx functions return the same data as
+       getparyx.
+
+
+
+

RETURN VALUE

+       These functions return an integer, or ERR  if  the  window
+       parameter is null.
+
+
+
+

NOTES

+       All  of  these interfaces are provided as macros and func-
+       tions.  The macros are suppressed (and only the  functions
+       provided)  when  NCURSES_OPAQUE  is defined.  The standard
+       forms such as getyx must be implemented as macros, and (in
+       this implementation) are defined in terms of the functions
+       described here, to avoid reliance on internal  details  of
+       the WINDOW structure.
+
+
+
+

PORTABILITY

+       These functions were supported on Version 7, BSD or System
+       V implementations.
+
+
+
+

SEE ALSO

+       curses(3x), curs_getyx(3x), curs_opaque(3x)
+
+
+
+                                                        curs_legacy(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_memleaks.3x.html b/doc/html/man/curs_memleaks.3x.html new file mode 100644 index 00000000000..540ea935a4c --- /dev/null +++ b/doc/html/man/curs_memleaks.3x.html @@ -0,0 +1,111 @@ + + + + +curs_memleaks 3x + + + + +

curs_memleaks 3x

+
+
+
+curs_memleaks(3x)                                     curs_memleaks(3x)
+
+
+
+
+
+

NAME

+       _nc_freeall _nc_free_and_exit - curses memory-leak
+       checking
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       void _nc_freeall(void);
+       void _nc_free_and_exit(int);
+
+
+
+

DESCRIPTION

+       These functions are used to simplify  analysis  of  memory
+       leaks  in  the  ncurses  library.   They  are normally not
+       available; they must be configured  into  the  library  at
+       build  time  using  the --disable-leaks option.  That com-
+       piles-in code that frees memory that normally would not be
+       freed.
+
+       Any  implementation of curses must not free the memory as-
+       sociated with a screen, since (even after calling endwin),
+       it  must be available for use in the next call to refresh.
+       There are also chunks of memory held for performance  rea-
+       sons.   That  makes it hard to analyze curses applications
+       for memory leaks.  To work around this, one  can  build  a
+       debugging version of the ncurses library which frees those
+       chunks which it can, and provides these functions to  free
+       all of the memory allocated by the ncurses library.
+
+       The  _nc_free_and_exit function is the preferred one since
+       some of the memory which is freed may be required for  the
+       application  to  continue  running.   Its parameter is the
+       code to pass to the exit routine.
+
+
+
+

RETURN VALUE

+       These functions do not return a value.
+
+
+
+

PORTABILITY

+       These functions are not part of the XSI interface.
+
+
+
+

SEE ALSO

+       curses(3x).
+
+
+
+                                                      curs_memleaks(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_mouse.3x.html b/doc/html/man/curs_mouse.3x.html new file mode 100644 index 00000000000..d640680c201 --- /dev/null +++ b/doc/html/man/curs_mouse.3x.html @@ -0,0 +1,318 @@ + + + + +curs_mouse 3x + + + + +

curs_mouse 3x

+
+
+
+curs_mouse(3x)                                           curs_mouse(3x)
+
+
+
+
+
+

NAME

+       has_mouse, getmouse, ungetmouse, mousemask, wenclose,
+       mouse_trafo, wmouse_trafo, mouseinterval - mouse interface
+       through curses
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       typedef unsigned long mmask_t;
+
+       typedef struct
+       {
+           short id;         /* ID to distinguish multiple devices */
+           int x, y, z;      /* event coordinates */
+           mmask_t bstate;   /* button state bits */
+       }
+       MEVENT;
+       bool has_mouse(void);
+       int getmouse(MEVENT *event);
+       int ungetmouse(MEVENT *event);
+       mmask_t mousemask(mmask_t newmask, mmask_t *oldmask);
+       bool wenclose(const WINDOW *win, int y, int x);
+       bool mouse_trafo(int* pY, int* pX, bool to_screen);
+       bool wmouse_trafo(const WINDOW* win, int* pY, int* pX,
+            bool to_screen);
+       int mouseinterval(int erval);
+
+
+
+

DESCRIPTION

+       These  functions provide an interface to mouse events from
+       ncurses(3x).  Mouse events are  represented  by  KEY_MOUSE
+       pseudo-key values in the wgetch input stream.
+
+       To  make mouse events visible, use the mousemask function.
+       This will set the mouse events to  be  reported.   By  de-
+       fault,  no  mouse  events are reported.  The function will
+       return a mask to indicate which  of  the  specified  mouse
+       events  can be reported; on complete failure it returns 0.
+       If oldmask is non-NULL, this function fills the  indicated
+       location  with  the  previous  value of the given window's
+       mouse event mask.
+
+       As a side effect, setting a zero mousemask  may  turn  off
+       the  mouse pointer; setting a nonzero mask may turn it on.
+       Whether this happens is device-dependent.
+
+       Here are the mouse event type masks which may be defined:
+
+
+       Name                     Description
+       ---------------------------------------------------------------------
+       BUTTON1_PRESSED          mouse button 1 down
+       BUTTON1_RELEASED         mouse button 1 up
+       BUTTON1_CLICKED          mouse button 1 clicked
+       BUTTON1_DOUBLE_CLICKED   mouse button 1 double clicked
+       BUTTON1_TRIPLE_CLICKED   mouse button 1 triple clicked
+       ---------------------------------------------------------------------
+       BUTTON2_PRESSED          mouse button 2 down
+       BUTTON2_RELEASED         mouse button 2 up
+       BUTTON2_CLICKED          mouse button 2 clicked
+       BUTTON2_DOUBLE_CLICKED   mouse button 2 double clicked
+
+
+       BUTTON2_TRIPLE_CLICKED   mouse button 2 triple clicked
+       ---------------------------------------------------------------------
+       BUTTON3_PRESSED          mouse button 3 down
+       BUTTON3_RELEASED         mouse button 3 up
+       BUTTON3_CLICKED          mouse button 3 clicked
+       BUTTON3_DOUBLE_CLICKED   mouse button 3 double clicked
+       BUTTON3_TRIPLE_CLICKED   mouse button 3 triple clicked
+       ---------------------------------------------------------------------
+       BUTTON4_PRESSED          mouse button 4 down
+       BUTTON4_RELEASED         mouse button 4 up
+       BUTTON4_CLICKED          mouse button 4 clicked
+       BUTTON4_DOUBLE_CLICKED   mouse button 4 double clicked
+       BUTTON4_TRIPLE_CLICKED   mouse button 4 triple clicked
+       ---------------------------------------------------------------------
+       BUTTON5_PRESSED          mouse button 5 down
+       BUTTON5_RELEASED         mouse button 5 up
+       BUTTON5_CLICKED          mouse button 5 clicked
+       BUTTON5_DOUBLE_CLICKED   mouse button 5 double clicked
+       BUTTON5_TRIPLE_CLICKED   mouse button 5 triple clicked
+       ---------------------------------------------------------------------
+       BUTTON_SHIFT             shift was down during button state change
+       BUTTON_CTRL              control was down during button state change
+       BUTTON_ALT               alt was down during button state change
+       ALL_MOUSE_EVENTS         report all button state changes
+       REPORT_MOUSE_POSITION    report mouse movement
+       ---------------------------------------------------------------------
+
+       Once a class of mouse events have been made visible  in  a
+       window, calling the wgetch function on that window may re-
+       turn KEY_MOUSE as an indicator that a mouse event has been
+       queued.   To read the event data and pop the event off the
+       queue, call getmouse.  This function will return OK  if  a
+       mouse  event  is actually visible in the given window, ERR
+       otherwise.  When getmouse returns OK, the  data  deposited
+       as  y  and  x  in  the event structure coordinates will be
+       screen-relative character-cell coordinates.  The  returned
+       state  mask  will have exactly one bit set to indicate the
+       event type.  The corresponding data in the queue is marked
+       invalid.   A subsequent call to getmouse will retrieve the
+       next older item from the queue.
+
+       The ungetmouse function behaves  analogously  to  ungetch.
+       It  pushes a KEY_MOUSE event onto the input queue, and as-
+       sociates with that event the given state data and  screen-
+       relative character-cell coordinates.
+
+       The  wenclose  function  tests  whether  a  given  pair of
+       screen-relative character-cell coordinates is enclosed  by
+       a  given  window, returning TRUE if it is and FALSE other-
+       wise.  It is useful for determining  what  subset  of  the
+       screen windows enclose the location of a mouse event.
+
+       The wmouse_trafo function transforms a given pair of coor-
+       dinates from stdscr-relative  coordinates  to  coordinates
+       relative to the given window or vice versa.  Please remem-
+       ber, that stdscr-relative coordinates are not always iden-
+       tical  to window-relative coordinates due to the mechanism
+       to reserve lines on top or bottom of the screen for  other
+       purposes (see the ripoffline() and slk_init calls, for ex-
+       ample).  If the parameter to_screen is TRUE, the  pointers
+       pY, pX must reference the coordinates of a location inside
+       the window win.  They are converted to window-relative co-
+       ordinates  and returned through the pointers.  If the con-
+       version was successful, the function returns TRUE.  If one
+       of  the  parameters was NULL or the location is not inside
+       the window, FALSE is returned.  If to_screen is FALSE, the
+       pointers  pY,  pX  must  reference window-relative coordi-
+       nates.  They are converted to stdscr-relative  coordinates
+       if  the  window win encloses this point.  In this case the
+       function returns TRUE.  If one of the parameters  is  NULL
+       or  the point is not inside the window, FALSE is returned.
+       Please notice, that the referenced  coordinates  are  only
+       replaced  by  the converted coordinates if the transforma-
+       tion was successful.
+
+       The mouse_trafo function performs the same translation  as
+       wmouse_trafo, using stdscr for win.
+
+       The mouseinterval function sets the maximum time (in thou-
+       sands of a second) that can elapse between press  and  re-
+       lease  events  for  them to be recognized as a click.  Use
+       mouseinterval(0) to disable click resolution.  This  func-
+       tion returns the previous interval value.  Use mouseinter-
+       val(-1) to obtain the interval without altering  it.   The
+       default is one sixth of a second.
+
+       The  has_mouse  function  returns TRUE if the mouse driver
+       has been successfully initialized.
+
+       Note that mouse events will be ignored when  input  is  in
+       cooked mode, and will cause an error beep when cooked mode
+       is being simulated in a window by a function such as  get-
+       str that expects a linefeed for input-loop termination.
+
+
+
+

RETURN VALUE

+       getmouse  and ungetmouse return the integer ERR upon fail-
+       ure or OK upon successful completion.
+
+              getmouse
+                   returns an error.  If no mouse driver was ini-
+                   tialized, or if the mask parameter is zero, it
+                   also returns an error if no more events remain
+                   in the queue.
+
+              ungetmouse
+                   returns an error if the FIFO is full.
+
+       mousemask returns the mask of reportable events.
+
+       mouseinterval  returns the previous interval value, unless
+       the terminal was not initialized.  In that  case,  it  re-
+       turns the maximum interval value (166).
+
+       wenclose  and wmouse_trafo are boolean functions returning
+       TRUE or FALSE depending on their test result.
+
+
+
+

PORTABILITY

+       These calls were designed for  ncurses(3x),  and  are  not
+       found in SVr4 curses, 4.4BSD curses, or any other previous
+       version of curses.
+
+       The feature macro NCURSES_MOUSE_VERSION is provided so the
+       preprocessor  can  be  used to test whether these features
+       are present.  If the interface is changed,  the  value  of
+       NCURSES_MOUSE_VERSION  will  be incremented.  These values
+       for NCURSES_MOUSE_VERSION may be specified when  configur-
+       ing ncurses:
+
+              1  has  definitions  for reserved events.  The mask
+                 uses 28 bits.
+
+              2  adds definitions for button 5, removes the defi-
+                 nitions  for  reserved events.  The mask uses 29
+                 bits.
+
+       The order of the MEVENT structure members is  not  guaran-
+       teed.   Additional fields may be added to the structure in
+       the future.
+
+       Under ncurses(3x), these calls are implemented  using  ei-
+       ther  xterm's built-in mouse-tracking API or platform-spe-
+       cific drivers including
+              Alessandro Rubini's gpm server
+              FreeBSD sysmouse
+              OS/2 EMX
+       If you  are  using  an  unsupported  configuration,  mouse
+       events  will not be visible to ncurses(3x) (and the mouse-
+       mask function will always return 0).
+
+       If the terminfo entry contains a XM string, this  is  used
+       in  the xterm mouse driver to control the way the terminal
+       is initialized for mouse operation.  The default, if XM is
+       not found, corresponds to private mode 1000 of xterm:
+              \E[?1000%?%p1%{1}%=%th%el%;
+       The z member in the event structure is not presently used.
+       It is intended for use with touch screens  (which  may  be
+       pressure-sensitive)   or   with   3D-mice/trackballs/power
+       gloves.
+
+
+
+

BUGS

+       Mouse events under xterm will not in fact be ignored  dur-
+       ing  cooked  mode, if they have been enabled by mousemask.
+       Instead, the xterm mouse report sequence  will  appear  in
+       the string read.
+
+       Mouse events under xterm will not be detected correctly in
+       a window with its keypad bit off, since  they  are  inter-
+       preted  as  a  variety of function key.  Your terminfo de-
+       scription should have kmous set to "\E[M"  (the  beginning
+       of  the response from xterm for mouse clicks).  Other val-
+       ues for kmous are permitted, but under  the  same  assump-
+       tion, i.e., it is the beginning of the response.
+
+       Because  there  are  no  standard  terminal responses that
+       would serve to identify terminals which support the  xterm
+       mouse  protocol,  ncurses assumes that if your $TERM envi-
+       ronment variable contains "xterm", or kmous is defined  in
+       the terminal description, then the terminal may send mouse
+       events.
+
+
+
+

SEE ALSO

+       curses(3x),  curs_kernel(3x),   curs_slk(3x),   curs_vari-
+       ables(3x).
+
+
+
+                                                         curs_mouse(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_move.3x.html b/doc/html/man/curs_move.3x.html new file mode 100644 index 00000000000..d78178d35d7 --- /dev/null +++ b/doc/html/man/curs_move.3x.html @@ -0,0 +1,105 @@ + + + + +curs_move 3x + + + + +

curs_move 3x

+
+
+
+curs_move(3x)                                             curs_move(3x)
+
+
+
+
+
+

NAME

+       move, wmove - move curses window cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int move(int y, int x);
+       int wmove(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       These  routines move the cursor associated with the window
+       to line y and column x.  This routine does  not  move  the
+       physical  cursor  of the terminal until refresh is called.
+       The position specified is relative to the upper  left-hand
+       corner of the window, which is (0,0).
+
+
+
+

RETURN VALUE

+       These routines return ERR upon failure and OK (SVr4 speci-
+       fies only "an integer value other than ERR") upon success-
+       ful completion.
+
+       Specifically,  they  return an error if the window pointer
+       is null, or if the position is outside the window.
+
+
+
+

NOTES

+       Note that move may be a macro.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3x), curs_refresh(3x)
+
+
+
+                                                          curs_move(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_opaque.3x.html b/doc/html/man/curs_opaque.3x.html new file mode 100644 index 00000000000..6d01f2e5b1c --- /dev/null +++ b/doc/html/man/curs_opaque.3x.html @@ -0,0 +1,161 @@ + + + + +curs_opaque 3x + + + + +

curs_opaque 3x

+
+
+
+curs_opaque(3x)                                         curs_opaque(3x)
+
+
+
+
+
+

NAME

+       is_cleared, is_idlok, is_idcok, is_immedok, is_keypad,
+       is_leaveok, is_nodelay, is_notimeout, is_pad, is_scrollok,
+       is_subwin, is_syncok - curses window properties
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       bool is_cleared(const WINDOW *win);
+       bool is_idcok(const WINDOW *win);
+       bool is_idlok(const WINDOW *win);
+       bool is_immedok(const WINDOW *win);
+       bool is_keypad(const WINDOW *win);
+       bool is_leaveok(const WINDOW *win);
+       bool is_nodelay(const WINDOW *win);
+       bool is_notimeout(const WINDOW *win);
+       bool is_pad(const WINDOW *win);
+       bool is_scrollok(const WINDOW *win);
+       bool is_subwin(const WINDOW *win);
+       bool is_syncok(const WINDOW *win);
+       WINDOW * wgetparent(const WINDOW *win);
+       int wgetscrreg(const WINDOW *win, int *top, int *bottom);
+
+
+
+

DESCRIPTION

+       This  implementation provides functions which return prop-
+       erties set in the WINDOW  structure,  allowing  it  to  be
+       ``opaque'' if the symbol NCURSES_OPAQUE is defined:
+
+       is_cleared
+            returns the value set in clearok
+
+       is_idcok
+            returns the value set in idcok
+
+       is_idlok
+            returns the value set in idlok
+
+       is_immedok
+            returns the value set in immedok
+
+       is_keypad
+            returns the value set in keypad
+
+       is_leaveok
+            returns the value set in leaveok
+
+       is_nodelay
+            returns the value set in nodelay
+
+       is_notimeout
+            returns the value set in notimeout
+
+       is_pad
+            returns  TRUE if the window is a pad i.e., created by
+            newpad
+
+       is_scrollok
+            returns the value set in scrollok
+
+       is_subwin
+            returns TRUE if the window is a subwindow, i.e., cre-
+            ated by subwin or derwin
+
+       is_syncok
+            returns the value set in syncok
+
+       wgetparent
+            returns  the parent WINDOW pointer for subwindows, or
+            NULL for windows having no parent.
+
+       wgetscrreg
+            returns the top and bottom  rows  for  the  scrolling
+            margin as set in wsetscrreg.
+
+
+
+

RETURN VALUE

+       These functions all return TRUE or FALSE, except as noted.
+
+
+
+

NOTES

+       Both a macro and a function are provided for each name.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is  recommended that any code depending on ncurses ex-
+       tensions be conditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       curses(3x), curs_inopts(3x),  curs_outopts(3x),  curs_win-
+       dow(3x)
+
+
+
+                                                        curs_opaque(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_outopts.3x.html b/doc/html/man/curs_outopts.3x.html new file mode 100644 index 00000000000..9be94d9b78f --- /dev/null +++ b/doc/html/man/curs_outopts.3x.html @@ -0,0 +1,234 @@ + + + + +curs_outopts 3x + + + + +

curs_outopts 3x

+
+
+
+curs_outopts(3x)                                       curs_outopts(3x)
+
+
+
+
+
+

NAME

+       clearok, idlok, idcok, immedok, leaveok, setscrreg,
+       wsetscrreg, scrollok, nl, nonl - curses output options
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int clearok(WINDOW *win, bool bf);
+       int idlok(WINDOW *win, bool bf);
+       void idcok(WINDOW *win, bool bf);
+       void immedok(WINDOW *win, bool bf);
+       int leaveok(WINDOW *win, bool bf);
+       int setscrreg(int top, int bot);
+       int wsetscrreg(WINDOW *win, int top, int bot);
+       int scrollok(WINDOW *win, bool bf);
+       int nl(void);
+       int nonl(void);
+
+
+
+

DESCRIPTION

+       These routines set options that change the style of output
+       within  curses.   All  options are initially FALSE, unless
+       otherwise stated.  It is not necessary to turn  these  op-
+       tions off before calling endwin.
+
+       If  clearok is called with TRUE as argument, the next call
+       to wrefresh with this window will clear  the  screen  com-
+       pletely  and  redraw the entire screen from scratch.  This
+       is useful when the contents of the screen  are  uncertain,
+       or  in  some  cases for a more pleasing visual effect.  If
+       the win argument to clearok is the global variable curscr,
+       the  next  call  to  wrefresh  with  any window causes the
+       screen to be cleared and repainted from scratch.
+
+       If idlok is called with TRUE as  second  argument,  curses
+       considers using the hardware insert/delete line feature of
+       terminals so equipped.  Calling idlok with FALSE as second
+       argument  disables  use  of  line  insertion and deletion.
+       This option should be  enabled  only  if  the  application
+       needs  insert/delete  line, for example, for a screen edi-
+       tor.  It is disabled by default because insert/delete line
+       tends  to  be  visually annoying when used in applications
+       where it is not really needed.  If insert/delete line can-
+       not  be  used,  curses redraws the changed portions of all
+       lines.
+
+       If idcok is called with FALSE as second  argument,  curses
+       no longer considers using the hardware insert/delete char-
+       acter feature of terminals so equipped.  Use of  character
+       insert/delete  is  enabled by default.  Calling idcok with
+       TRUE as second argument re-enables use of character inser-
+       tion and deletion.
+
+       If  immedok is called with TRUE as argument, any change in
+       the window image, such as the ones caused by waddch, wclr-
+       tobot,  wscrl,  etc.,  automatically  cause a call to wre-
+       fresh.  However, it may degrade performance  considerably,
+       due  to repeated calls to wrefresh.  It is disabled by de-
+       fault.
+
+       Normally, the hardware cursor is left at the  location  of
+       the window cursor being refreshed.  The leaveok option al-
+       lows the cursor to be left wherever the update happens  to
+       leave  it.  It is useful for applications where the cursor
+       is not used, since it reduces the need for cursor motions.
+
+       The setscrreg and wsetscrreg routines allow  the  applica-
+       tion  programmer  to  set a software scrolling region in a
+       window.  The top and bot parameters are the  line  numbers
+       of  the  top  and  bottom  margin of the scrolling region.
+       (Line 0 is the top line of the window.)   If  this  option
+       and  scrollok are enabled, an attempt to move off the bot-
+       tom margin line causes all lines in the  scrolling  region
+       to  scroll  one  line  in the direction of the first line.
+       Only the text of the window is scrolled.  (Note that  this
+       has nothing to do with the use of a physical scrolling re-
+       gion capability in the terminal, like that in  the  VT100.
+       If  idlok  is  enabled  and  the  terminal  has  either  a
+       scrolling region or insert/delete  line  capability,  they
+       will probably be used by the output routines.)
+
+       The  scrollok option controls what happens when the cursor
+       of a window is  moved  off  the  edge  of  the  window  or
+       scrolling  region,  either as a result of a newline action
+       on the bottom line, or typing the last  character  of  the
+       last line.  If disabled, (bf is FALSE), the cursor is left
+       on the bottom line.  If enabled, (bf is TRUE), the  window
+       is  scrolled  up  one  line (Note that to get the physical
+       scrolling effect on the terminal, it is also necessary  to
+       call idlok).
+
+       The  nl  and  nonl routines control whether the underlying
+       display device translates the return key into  newline  on
+       input,  and  whether it translates newline into return and
+       line-feed on output (in either case, the call  addch('\n')
+       does the equivalent of return and line feed on the virtual
+       screen).  Initially, these translations do occur.  If  you
+       disable  them using nonl, curses will be able to make bet-
+       ter use of the line-feed capability, resulting  in  faster
+       cursor  motion.   Also, curses will then be able to detect
+       the return key.
+
+
+
+

RETURN VALUE

+       The functions setscrreg and wsetscrreg return OK upon suc-
+       cess and ERR upon failure.  All other routines that return
+       an integer always return OK.
+
+       X/Open does not define any error conditions.
+
+       In this implementation, those functions that have a window
+       pointer  will  return  an  error  if the window pointer is
+       null.
+
+              wclrtoeol
+                   returns an error if  the  cursor  position  is
+                   about to wrap.
+
+              wsetscrreg
+                   returns  an error if the scrolling region lim-
+                   its extend outside the window.
+
+       X/Open does not define any error conditions.  This  imple-
+       mentation returns an error if the window pointer is null.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.
+
+       The XSI Curses standard is ambiguous on  the  question  of
+       whether  raw()  should  disable the CRLF translations con-
+       trolled by nl() and nonl().  BSD curses did turn off these
+       translations;  AT&T  curses (at least as late as SVr1) did
+       not.  We choose to do so, on the theory that a  programmer
+       requesting  raw  input wants a clean (ideally 8-bit clean)
+       connection that the operating system will not alter.
+
+       Some historic curses implementations had,  as  an  undocu-
+       mented  feature,  the  ability  to  do  the  equivalent of
+       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
+       scr).  This will not work under ncurses.
+
+       Earlier  System  V  curses  implementations specified that
+       with scrollok enabled, any window modification  triggering
+       a  scroll also forced a physical refresh.  XSI Curses does
+       not require this, and ncurses avoids doing it  to  perform
+       better vertical-motion optimization at wrefresh time.
+
+       The  XSI  Curses standard does not mention that the cursor
+       should be made invisible  as  a  side-effect  of  leaveok.
+       SVr4  curses  documentation  does  this, but the code does
+       not.  Use curs_set to make the cursor invisible.
+
+
+
+

NOTES

+       Note that clearok, leaveok, scrollok, idcok, nl, nonl  and
+       setscrreg may be macros.
+
+       The immedok routine is useful for windows that are used as
+       terminal emulators.
+
+
+
+

SEE ALSO

+       curses(3x),        curs_addch(3x),         curs_clear(3x),
+       curs_initscr(3x),    curs_scroll(3x),    curs_refresh(3x),
+       curs_variables(3x).
+
+
+
+                                                       curs_outopts(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_overlay.3x.html b/doc/html/man/curs_overlay.3x.html new file mode 100644 index 00000000000..69ed0fcaafa --- /dev/null +++ b/doc/html/man/curs_overlay.3x.html @@ -0,0 +1,122 @@ + + + + +curs_overlay 3x + + + + +

curs_overlay 3x

+
+
+
+curs_overlay(3x)                                       curs_overlay(3x)
+
+
+
+
+
+

NAME

+       overlay, overwrite, copywin - overlay and manipulate
+       overlapped curses windows
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int overlay(const WINDOW *srcwin, WINDOW *dstwin);
+       int overwrite(const WINDOW *srcwin, WINDOW *dstwin);
+       int copywin(const  WINDOW  *srcwin,  WINDOW  *dstwin,  int
+       sminrow,
+             int smincol, int dminrow, int dmincol, int dmaxrow,
+             int dmaxcol, int overlay);
+
+
+
+

DESCRIPTION

+       The  overlay  and overwrite routines overlay srcwin on top
+       of dstwin.  scrwin and dstwin are not required to  be  the
+       same  size;  only  text  where  the two windows overlap is
+       copied.  The difference is that overlay is non-destructive
+       (blanks are not copied) whereas overwrite is destructive.
+
+       The  copywin  routine provides a finer granularity of con-
+       trol over the overlay and overwrite routines.  Like in the
+       prefresh routine, a rectangle is specified in the destina-
+       tion window, (dminrow, dmincol)  and  (dmaxrow,  dmaxcol),
+       and  the  upper-left-corner coordinates of the source win-
+       dow, (sminrow, smincol).  If the argument overlay is true,
+       then copying is non-destructive, as in overlay.
+
+
+
+

RETURN VALUE

+       Routines  that  return an integer return ERR upon failure,
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR") upon successful completion.
+
+       X/Open  defines  no error conditions.  In this implementa-
+       tion, copywin, overlay and overwrite return  an  error  if
+       either of the window pointers are null, or if some part of
+       the window would be placed off-screen.
+
+
+
+

NOTES

+       Note that overlay and overwrite may be macros.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue 4 describes these functions
+       (adding the const qualifiers).  It further specifies their
+       behavior in the presence of characters with multibyte ren-
+       ditions (not yet supported in this implementation).
+
+
+
+

SEE ALSO

+       curses(3x), curs_pad(3x), curs_refresh(3x)
+
+
+
+                                                       curs_overlay(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_pad.3x.html b/doc/html/man/curs_pad.3x.html new file mode 100644 index 00000000000..ca16cf4603d --- /dev/null +++ b/doc/html/man/curs_pad.3x.html @@ -0,0 +1,184 @@ + + + + +curs_pad 3x + + + + +

curs_pad 3x

+
+
+
+curs_pad(3x)                                               curs_pad(3x)
+
+
+
+
+
+

NAME

+       newpad, subpad, prefresh, pnoutrefresh, pechochar,
+       pecho_wchar - create and display curses pads
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       WINDOW *newpad(int nlines, int ncols);
+       WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
+             int begin_y, int begin_x);
+       int prefresh(WINDOW *pad, int pminrow, int pmincol,
+             int sminrow, int smincol, int smaxrow, int smaxcol);
+       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
+             int sminrow, int smincol, int smaxrow, int smaxcol);
+       int pechochar(WINDOW *pad, chtype ch);
+       int pecho_wchar(WINDOW *pad, const cchar_t *wch);
+
+
+
+

DESCRIPTION

+       The newpad routine creates and returns a pointer to a  new
+       pad data structure with the given number of lines, nlines,
+       and columns, ncols.  A pad is like a window,  except  that
+       it is not restricted by the screen size, and is not neces-
+       sarily associated with a particular part  of  the  screen.
+       Pads can be used when a large window is needed, and only a
+       part of the window will be on the screen at one time.  Au-
+       tomatic refreshes of pads (e.g., from scrolling or echoing
+       of input) do not occur.  It is not legal to call  wrefresh
+       with  a  pad  as  an  argument;  the  routines prefresh or
+       pnoutrefresh should be called instead.   Note  that  these
+       routines require additional parameters to specify the part
+       of the pad to be displayed and the location on the  screen
+       to be used for the display.
+
+       The subpad routine creates and returns a pointer to a sub-
+       window within a  pad  with  the  given  number  of  lines,
+       nlines,  and  columns,  ncols.   Unlike subwin, which uses
+       screen coordinates, the window is  at  position  (begin_x,
+       begin_y)  on the pad.  The window is made in the middle of
+       the window orig, so that changes made to one window affect
+       both windows.  During the use of this routine, it will of-
+       ten be necessary to call touchwin or touchline on orig be-
+       fore calling prefresh.
+
+       The  prefresh  and  pnoutrefresh routines are analogous to
+       wrefresh and wnoutrefresh except that they relate to  pads
+       instead  of windows.  The additional parameters are needed
+       to indicate what part of the pad and screen are  involved.
+       The pminrow and pmincol parameters specify the upper left-
+       hand corner of the rectangle to be displayed in  the  pad.
+       The  sminrow,  smincol,  smaxrow,  and  smaxcol parameters
+       specify the edges of the rectangle to be displayed on  the
+       screen.   The  lower right-hand corner of the rectangle to
+       be displayed in the pad is calculated from the screen  co-
+       ordinates,  since  the  rectangles  must be the same size.
+       Both rectangles must be entirely  contained  within  their
+       respective  structures.  Negative values of pminrow, pmin-
+       col, sminrow, or smincol are treated as if they were zero.
+
+       The pechochar routine is functionally equivalent to a call
+       to  addch  followed by a call to refresh, a call to waddch
+       followed by a call to wrefresh, or a call to  waddch  fol-
+       lowed  by  a  call to prefresh.  The knowledge that only a
+       single character is being output is taken into  considera-
+       tion  and, for non-control characters, a considerable per-
+       formance gain might be seen by using  these  routines  in-
+       stead of their equivalents.  In the case of pechochar, the
+       last location of the pad on the screen is reused  for  the
+       arguments to prefresh.
+
+       The  pecho_wchar  function is the analogous wide-character
+       form of pechochar.  It outputs one character to a pad  and
+       immediately  refreshes the pad.  It does this by a call to
+       wadd_wch followed by a call to prefresh.
+
+
+
+

RETURN VALUE

+       Routines that return an integer return  ERR  upon  failure
+       and  OK  (SVr4 only specifies "an integer value other than
+       ERR") upon successful completion.
+
+       Routines that return pointers return NULL  on  error,  and
+       set errno to ENOMEM.
+
+       X/Open  does not define any error conditions.  In this im-
+       plementation
+
+              prefresh and pnoutrefresh
+                   return an error if the window pointer is null,
+                   or if the window is not really a pad or if the
+                   area to refresh extends off-screen or  if  the
+                   minimum coordinates are greater than the maxi-
+                   mum.
+
+              pechochar
+                   returns an error if the window is not really a
+                   pad,  and the associated call to wechochar re-
+                   turns an error.
+
+              pecho_wchar
+                   returns an error if the window is not really a
+                   pad,  and  the  associated call to wecho_wchar
+                   returns an error.
+
+
+
+

NOTES

+       Note that pechochar may be a macro.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.
+
+
+
+

SEE ALSO

+       curses(3x),  curs_refresh(3x),  curs_touch(3x),  curs_add-
+       ch(3x).
+
+
+
+                                                           curs_pad(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_print.3x.html b/doc/html/man/curs_print.3x.html new file mode 100644 index 00000000000..11b64a7f550 --- /dev/null +++ b/doc/html/man/curs_print.3x.html @@ -0,0 +1,121 @@ + + + + +curs_print 3x + + + + +

curs_print 3x

+
+
+
+curs_print(3x)                                           curs_print(3x)
+
+
+
+
+
+

NAME

+       mcprint - ship binary data to printer
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int mcprint(char *data, int len);
+
+
+
+

DESCRIPTION

+       This  function  uses the mc5p or mc4 and mc5 capabilities,
+       if they are present, to  ship  given  data  to  a  printer
+       attached to the terminal.
+
+       Note  that  the mcprint code has no way to do flow control
+       with the printer or to know how  much  buffering  it  has.
+       Your  application  is  responsible for keeping the rate of
+       writes to the printer below its continuous throughput rate
+       (typically  about  half  of its nominal cps rating).  Dot-
+       matrix printers and 6-page-per-minute lasers can typically
+       handle  80cps,  so a good conservative rule of thumb is to
+       sleep for a second after shipping each 80-character line.
+
+
+
+

RETURN VALUE

+       The mcprint function returns ERR if  the  write  operation
+       aborted for some reason.  In this case, errno will contain
+       either an error associated with write(2)  or  one  of  the
+       following:
+
+       ENODEV
+            Capabilities for printer redirection do not exist.
+
+       ENOMEM
+            Couldn't  allocate  sufficient  memory  to buffer the
+            printer write.
+
+       When mcprint succeeds, it returns the number of characters
+       actually sent to the printer.
+
+
+
+

PORTABILITY

+       The  mcprint call was designed for ncurses(3x), and is not
+       found in SVr4 curses, 4.4BSD curses, or any other previous
+       version of curses.
+
+
+
+

BUGS

+       Padding  in the mc5p, mc4 and mc5 capabilities will not be
+       interpreted.
+
+
+
+

SEE ALSO

+       curses(3x)
+
+
+
+                                                         curs_print(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_printw.3x.html b/doc/html/man/curs_printw.3x.html new file mode 100644 index 00000000000..f845852dec4 --- /dev/null +++ b/doc/html/man/curs_printw.3x.html @@ -0,0 +1,126 @@ + + + + +curs_printw 3x + + + + +

curs_printw 3x

+
+
+
+curs_printw(3x)                                         curs_printw(3x)
+
+
+
+
+
+

NAME

+       printw, wprintw, mvprintw, mvwprintw, vwprintw, vw_printw
+       - print formatted output in curses windows
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int printw(const char *fmt, ...);
+       int wprintw(WINDOW *win, const char *fmt, ...);
+       int mvprintw(int y, int x, const char *fmt, ...);
+       int mvwprintw(WINDOW *win, int y, int x, const char  *fmt,
+       ...);
+       int  vwprintw(WINDOW  *win,  const char *fmt, va_list var-
+       glist);
+       int vw_printw(WINDOW *win, const char *fmt,  va_list  var-
+       glist);
+
+
+
+

DESCRIPTION

+       The  printw,  wprintw, mvprintw and mvwprintw routines are
+       analogous to  printf  [see  printf(3)].   In  effect,  the
+       string that would be output by printf is output instead as
+       though waddstr were used on the given window.
+
+       The vwprintw  and  wv_printw  routines  are  analogous  to
+       vprintf  [see  printf(3)]  and  perform  a wprintw using a
+       variable argument list.  The third argument is a  va_list,
+       a   pointer   to  a  list  of  arguments,  as  defined  in
+       <stdarg.h>.
+
+
+
+

RETURN VALUE

+       Routines that return an integer return  ERR  upon  failure
+       and  OK  (SVr4 only specifies "an integer value other than
+       ERR") upon successful completion.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion,  an  error  may  be  returned  if it cannot allocate
+       enough memory for the buffer used to format  the  results.
+       It will return an error if the window pointer is null.
+
+       Functions  with a "mv" prefix first perform a cursor move-
+       ment using wmove, and return an error if the  position  is
+       outside the window, or if the window pointer is null.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.  The function vwprintw is marked TO  BE  WITHDRAWN,
+       and  is  to  be replaced by a function vw_printw using the
+       <stdarg.h> interface.  The Single Unix Specification, Ver-
+       sion  2  states  that  vw_printw  is preferred to vwprintw
+       since the latter  requires  including  <varargs.h>,  which
+       cannot  be  used in the same file as <stdarg.h>.  This im-
+       plementation uses <stdarg.h> for both, because that header
+       is included in <curses.h>.
+
+
+
+

SEE ALSO

+       curses(3x), printf(3), vprintf(3)
+
+
+
+                                                        curs_printw(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_refresh.3x.html b/doc/html/man/curs_refresh.3x.html new file mode 100644 index 00000000000..78988f5070e --- /dev/null +++ b/doc/html/man/curs_refresh.3x.html @@ -0,0 +1,170 @@ + + + + +curs_refresh 3x + + + + +

curs_refresh 3x

+
+
+
+curs_refresh(3x)                                       curs_refresh(3x)
+
+
+
+
+
+

NAME

+       doupdate, redrawwin, refresh, wnoutrefresh, wredrawln,
+       wrefresh - refresh curses windows and lines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int refresh(void);
+       int wrefresh(WINDOW *win);
+       int wnoutrefresh(WINDOW *win);
+       int doupdate(void);
+       int redrawwin(WINDOW *win);
+       int wredrawln(WINDOW *win, int beg_line, int num_lines);
+
+
+
+

DESCRIPTION

+       The refresh and wrefresh  routines  (or  wnoutrefresh  and
+       doupdate)  must be called to get actual output to the ter-
+       minal, as other routines  merely  manipulate  data  struc-
+       tures.   The  routine  wrefresh copies the named window to
+       the physical terminal screen, taking into account what  is
+       already there to do optimizations.  The refresh routine is
+       the same, using stdscr  as  the  default  window.   Unless
+       leaveok  has been enabled, the physical cursor of the ter-
+       minal is left at the location of the cursor for that  win-
+       dow.
+
+       The  wnoutrefresh and doupdate routines allow multiple up-
+       dates with more efficiency than wrefresh alone.  In  addi-
+       tion  to  all the window structures, curses keeps two data
+       structures representing the terminal  screen:  a  physical
+       screen,  describing  what is actually on the screen, and a
+       virtual screen, describing what the  programmer  wants  to
+       have on the screen.
+
+       The  routine wrefresh works by first calling wnoutrefresh,
+       which copies the named window to the virtual  screen,  and
+       then  calling  doupdate, which compares the virtual screen
+       to the physical screen and does the actual update.  If the
+       programmer wishes to output several windows at once, a se-
+       ries of calls to wrefresh results in alternating calls  to
+       wnoutrefresh  and doupdate, causing several bursts of out-
+       put to the screen.  By first calling wnoutrefresh for each
+       window, it is then possible to call doupdate once, result-
+       ing in only one burst of output, with fewer total  charac-
+       ters transmitted and less CPU time used.  If the win argu-
+       ment to wrefresh is the global variable curscr, the screen
+       is immediately cleared and repainted from scratch.
+
+       The phrase "copies the named window to the virtual screen"
+       above is ambiguous.  What actually  happens  is  that  all
+       touched  (changed)  lines  in the window are copied to the
+       virtual screen.  This affects programs that  use  overlap-
+       ping  windows;  it  means that if two windows overlap, you
+       can refresh them in either order and  the  overlap  region
+       will be modified only when it is explicitly changed.  (But
+       see the section on PORTABILITY below for a  warning  about
+       exploiting this behavior.)
+
+       The wredrawln routine indicates to curses that some screen
+       lines are corrupted and should be thrown away before  any-
+       thing  is  written  over  them.   It touches the indicated
+       lines (marking them  changed).   The  routine  redrawwin()
+       touches the entire window.
+
+
+
+

RETURN VALUE

+       Routines  that  return an integer return ERR upon failure,
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR") upon successful completion.
+
+       X/Open  does not define any error conditions.  In this im-
+       plementation
+
+              wnoutrefresh
+                   returns an error  if  the  window  pointer  is
+                   null, or if the window is really a pad.
+
+              wredrawln
+                   returns  an  error  if  the associated call to
+                   touchln returns an error.
+
+
+
+

NOTES

+       Note that refresh and redrawwin may be macros.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.
+
+       Whether  wnoutrefresh()  copies  to the virtual screen the
+       entire contents of a window or just its  changed  portions
+       has never been well-documented in historic curses versions
+       (including SVr4).  It might be unwise to  rely  on  either
+       behavior  in  programs  that  might have to be linked with
+       other curses implementations.  Instead, you can do an  ex-
+       plicit  touchwin() before the wnoutrefresh() call to guar-
+       antee an entire-contents copy anywhere.
+
+
+
+

SEE ALSO

+       curses(3x), curs_outopts(3x) curs_variables(3x).
+
+
+
+                                                       curs_refresh(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_scanw.3x.html b/doc/html/man/curs_scanw.3x.html new file mode 100644 index 00000000000..40cb95234f9 --- /dev/null +++ b/doc/html/man/curs_scanw.3x.html @@ -0,0 +1,133 @@ + + + + +curs_scanw 3x + + + + +

curs_scanw 3x

+
+
+
+curs_scanw(3x)                                           curs_scanw(3x)
+
+
+
+
+
+

NAME

+       scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw - con-
+       vert formatted input from a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int scanw(char *fmt, ...);
+       int wscanw(WINDOW *win, char *fmt, ...);
+       int mvscanw(int y, int x, char *fmt, ...);
+       int mvwscanw(WINDOW *win, int y, int x, char *fmt, ...);
+       int vw_scanw(WINDOW *win, char *fmt, va_list varglist);
+       int vwscanw(WINDOW *win, char *fmt, va_list varglist);
+
+
+
+

DESCRIPTION

+       The scanw, wscanw and mvscanw routines  are  analogous  to
+       scanf  [see scanf(3)].  The effect of these routines is as
+       though wgetstr were called on the window, and the  result-
+       ing line used as input for sscanf(3).  Fields which do not
+       map to a variable in the fmt field are lost.
+
+       The vwscanw and vw_scanw routines are analogous to vscanf.
+       They perform a wscanw using a variable argument list.  The
+       third argument is a va_list, a pointer to a list of  argu-
+       ments, as defined in <stdarg.h>.
+
+
+
+

RETURN VALUE

+       vwscanw returns ERR on failure and an integer equal to the
+       number of fields scanned on success.
+
+       Applications may use the  return  value  from  the  scanw,
+       wscanw,  mvscanw  and  mvwscanw  routines to determine the
+       number of fields which were mapped in the call.
+
+       Functions with a "mv" prefix first perform a cursor  move-
+       ment  using  wmove, and return an error if the position is
+       outside the window, or if the window pointer is null.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   The  function  vwscanw is marked TO BE WITHDRAWN,
+       and is to be replaced by a  function  vw_scanw  using  the
+       <stdarg.h> interface.  The Single Unix Specification, Ver-
+       sion 2 states that vw_scanw  is preferred to vwscanw since
+       the latter requires including <varargs.h>, which cannot be
+       used in the same file as <stdarg.h>.  This  implementation
+       uses  <stdarg.h> for both, because that header is included
+       in <curses.h>.
+
+       Both XSI and The  Single  Unix  Specification,  Version  2
+       state  that  these  functions return ERR or OK.  Since the
+       underlying scanf can return the number of  items  scanned,
+       and the SVr4 code was documented to use this feature, this
+       is probably an editing error which was introduced in  XSI,
+       rather  than  being done intentionally.  Portable applica-
+       tions should only test if the return value is  ERR,  since
+       the  OK value (zero) is likely to be misleading.  One pos-
+       sible way to get useful results would be  to  use  a  "%n"
+       conversion  at the end of the format string to ensure that
+       something was processed.
+
+
+
+

SEE ALSO

+       curses(3x), curs_getstr(3x), curs_printw(3x), scanf(3)
+
+
+
+                                                         curs_scanw(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_scr_dump.3x.html b/doc/html/man/curs_scr_dump.3x.html new file mode 100644 index 00000000000..d2931e13473 --- /dev/null +++ b/doc/html/man/curs_scr_dump.3x.html @@ -0,0 +1,137 @@ + + + + +curs_scr_dump 3x + + + + +

curs_scr_dump 3x

+
+
+
+curs_scr_dump(3x)                                     curs_scr_dump(3x)
+
+
+
+
+
+

NAME

+       scr_dump, scr_restore, scr_init, scr_set - read (write) a
+       curses screen from (to) a file
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int scr_dump(const char *filename);
+       int scr_restore(const char *filename);
+       int scr_init(const char *filename);
+       int scr_set(const char *filename);
+
+
+
+

DESCRIPTION

+       The scr_dump routine dumps the  current  contents  of  the
+       virtual screen to the file filename.
+
+       The  scr_restore  routine  sets  the virtual screen to the
+       contents of filename, which must have been  written  using
+       scr_dump.   The  next call to doupdate restores the screen
+       to the way it looked in the dump file.
+
+       The scr_init routine reads in the contents of filename and
+       uses  them  to initialize the curses data structures about
+       what the terminal currently has on its screen.  If the da-
+       ta is determined to be valid, curses bases its next update
+       of the screen on this information rather than clearing the
+       screen  and starting from scratch.  scr_init is used after
+       initscr or a system call to share the screen with  another
+       process  which  has done a scr_dump after its endwin call.
+       The data is declared invalid if the terminfo  capabilities
+       rmcup and nrrmc exist; also if the terminal has been writ-
+       ten to since the preceding scr_dump call.
+
+       The scr_set routine is a combination  of  scr_restore  and
+       scr_init.   It  tells  the program that the information in
+       filename is what is currently on the screen, and also what
+       the  program  wants on the screen.  This can be thought of
+       as a screen inheritance function.
+
+       To read (write) a window from (to) a file, use the  getwin
+       and putwin routines [see curs_util(3x)].
+
+
+
+

RETURN VALUE

+       All  routines  return  the integer ERR upon failure and OK
+       upon success.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion,  each  will  return  an  error if the file cannot be
+       opened.
+
+
+
+

NOTES

+       Note  that  scr_init,  scr_set,  and  scr_restore  may  be
+       macros.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard, Issue 4, describes these func-
+       tions (adding the const qualifiers).
+
+       The SVr4 docs merely say under scr_init that the dump data
+       is  also  considered invalid "if the time-stamp of the tty
+       is old" but do not define "old".
+
+
+
+

SEE ALSO

+       curses(3x),      curs_initscr(3x),       curs_refresh(3x),
+       curs_util(3x), system(3)
+
+
+
+                                                      curs_scr_dump(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_scroll.3x.html b/doc/html/man/curs_scroll.3x.html new file mode 100644 index 00000000000..856b9f55804 --- /dev/null +++ b/doc/html/man/curs_scroll.3x.html @@ -0,0 +1,131 @@ + + + + +curs_scroll 3x + + + + +

curs_scroll 3x

+
+
+
+curs_scroll(3x)                                         curs_scroll(3x)
+
+
+
+
+
+

NAME

+       scroll, scrl, wscrl - scroll a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int scroll(WINDOW *win);
+       int scrl(int n);
+       int wscrl(WINDOW *win, int n);
+
+
+
+

DESCRIPTION

+       The  scroll  routine scrolls the window up one line.  This
+       involves moving the lines in the  window  data  structure.
+       As  an optimization, if the scrolling region of the window
+       is the entire screen, the physical screen may be  scrolled
+       at the same time.
+
+       For  positive  n,  the  scrl and wscrl routines scroll the
+       window up n lines (line i+n becomes i);  otherwise  scroll
+       the  window  down n lines.  This involves moving the lines
+       in the window character image structure.  The current cur-
+       sor position is not changed.
+
+       For these functions to work, scrolling must be enabled via
+       scrollok.
+
+
+
+

RETURN VALUE

+       These routines return ERR upon failure, and OK (SVr4  only
+       specifies "an integer value other than ERR") upon success-
+       ful completion.
+
+       X/Open defines no error conditions.
+
+       This implementation returns an error if the window pointer
+       is  null,  or  if  scrolling is not enabled in the window,
+       e.g., with scrollok.
+
+
+
+

NOTES

+       Note that scrl and scroll may be macros.
+
+       The SVr4 documentation says that the optimization of phys-
+       ically  scrolling  immediately if the scroll region is the
+       entire screen "is"  performed,  not  "may  be"  performed.
+       This  implementation  deliberately does not guarantee that
+       this will occur, to leave open the possibility of  smarter
+       optimization  of  multiple  scroll actions on the next up-
+       date.
+
+       Neither the SVr4 nor the XSI documentation specify whether
+       the current attribute or current color-pair of blanks gen-
+       erated by the scroll function is zeroed.  Under  this  im-
+       plementation it is.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+
+
+

SEE ALSO

+       curses(3x), curs_outopts(3x)
+
+
+
+                                                        curs_scroll(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_slk.3x.html b/doc/html/man/curs_slk.3x.html new file mode 100644 index 00000000000..54e4f7a04d7 --- /dev/null +++ b/doc/html/man/curs_slk.3x.html @@ -0,0 +1,235 @@ + + + + +curs_slk 3x + + + + +

curs_slk 3x

+
+
+
+curs_slk(3x)                                               curs_slk(3x)
+
+
+
+
+
+

NAME

+       slk_init, slk_set, slk_wset, slk_refresh, slk_noutrefresh,
+       slk_label, slk_clear, slk_restore, slk_touch, slk_attron,
+       slk_attrset, slk_attroff, slk_attr_on, slk_attr_set,
+       slk_attr_off, slk_attr, slk_color - curses soft label
+       routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int slk_init(int fmt);
+       int slk_set(int labnum, const char *label, int fmt);
+       int slk_refresh(void);
+       int slk_noutrefresh(void);
+       char *slk_label(int labnum);
+       int slk_clear(void);
+       int slk_restore(void);
+       int slk_touch(void);
+       int slk_attron(const chtype attrs);
+       int slk_attroff(const chtype attrs);
+       int slk_attrset(const chtype attrs);
+       int slk_attr_on(attr_t attrs, void* opts);
+       int slk_attr_off(const attr_t attrs, void * opts);
+       int  slk_attr_set(const  attr_t  attrs,  short color_pair,
+       void* opts);
+       attr_t slk_attr(void);
+       int slk_color(short color_pair);
+       int slk_wset(int labnum, const wchar_t *label, int fmt);
+
+
+
+

DESCRIPTION

+       The slk* functions manipulate the set of soft function-key
+       labels  that exist on many terminals.  For those terminals
+       that do not have soft labels, curses takes over the bottom
+       line  of stdscr, reducing the size of stdscr and the vari-
+       able LINES.  curses standardizes on eight labels of up  to
+       eight  characters  each.  In addition to this, the ncurses
+       implementation supports a mode where it simulates  12  la-
+       bels  of  up  to five characters each.  This is useful for
+       today's PC-like enduser devices.  ncurses  simulates  this
+       mode  by  taking over up to two lines at the bottom of the
+       screen; it does not try to use any  hardware  support  for
+       this mode.
+
+       The  slk_init  routine  must  be  called before initscr or
+       newterm is called.  If initscr eventually uses a line from
+       stdscr to emulate the soft labels, then fmt determines how
+       the labels are arranged on the screen:
+
+              0  indicates a 3-2-3 arrangement of the labels.
+
+              1  indicates a 4-4 arrangement
+
+              2  indicates the PC-like 4-4-4 mode.
+
+              3  is again the PC-like 4-4-4 mode, but in addition
+                 an  index line is generated, helping the user to
+                 identify the key numbers easily.
+
+       The slk_set routine (and  the  slk_wset  routine  for  the
+       wide-character library) has three parameters:
+
+              labnum
+                   is  the  label number, from 1 to 8 (12 for fmt
+                   in slk_init is 2 or 3);
+
+              label
+                   is be the string to put on the  label,  up  to
+                   eight  (five  for  fmt  in slk_init is 2 or 3)
+                   characters in length.  A null string or a null
+                   pointer sets up a blank label.
+
+              fmt  is  either  0, 1, or 2, indicating whether the
+                   label is to be  left-justified,  centered,  or
+                   right-justified,  respectively, within the la-
+                   bel.
+
+       The slk_refresh and slk_noutrefresh routines correspond to
+       the wrefresh and wnoutrefresh routines.
+
+       The  slk_label routine returns the current label for label
+       number labnum, with leading and trailing blanks stripped.
+
+       The slk_clear routine clears  the  soft  labels  from  the
+       screen.
+
+       The  slk_restore  routine  restores the soft labels to the
+       screen after a slk_clear has been performed.
+
+       The slk_touch routine forces all the  soft  labels  to  be
+       output the next time a slk_noutrefresh is performed.
+
+       The slk_attron, slk_attrset, slk_attroff and slk_attr rou-
+       tines correspond to attron, attrset, attroff and attr_get.
+       They  have  an effect only if soft labels are simulated on
+       the bottom line of the screen.  The default highlight  for
+       soft keys is A_STANDOUT (as in System V curses, which does
+       not document this fact).
+
+       The slk_color routine corresponds to color_set.  It has an
+       effect  only  if  soft  labels are simulated on the bottom
+       line of the screen.
+
+
+
+

RETURN VALUE

+       These routines return ERR upon failure and OK (SVr4 speci-
+       fies only "an integer value other than ERR") upon success-
+       ful completion.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion
+
+              slk_attr
+                   returns the attribute used for the soft keys.
+
+              slk_attroff, slk_attron, slk_clear,
+              slk_noutrefresh, slk_refresh, slk_touch
+                   return an error if the terminal or  the  soft-
+                   keys were not initialized.
+
+              slk_attrset
+                   returns  an error if the terminal or the soft-
+                   keys were not initialized.
+
+              slk_attr_set
+                   returns an error if the terminal or the  soft-
+                   keys  were  not initialized, or the color pair
+                   is outside the range 0..COLOR_PAIRS-1, or opts
+                   is not null.
+
+              slk_color
+                   returns  an error if the terminal or the soft-
+                   keys were not initialized, or the  color  pair
+                   is outside the range 0..COLOR_PAIRS-1.
+
+              slk_init
+                   returns  an  error  if the format parameter is
+                   outside the range 0..3.
+
+              slk_label
+                   returns NULL on error.
+
+              slk_set
+                   returns an error if the terminal or the  soft-
+                   keys  were  not initialized, or the labnum pa-
+                   rameter is outside the range of label  counts,
+                   or  if  the  format  parameter  is outside the
+                   range 0..2, or if memory for the labels cannot
+                   be allocated.
+
+
+
+

NOTES

+       Most applications would use slk_noutrefresh because a wre-
+       fresh is likely to follow soon.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue 4,  describes  these  func-
+       tions.   It changes the argument type of the attribute-ma-
+       nipulation functions slk_attron, slk_attroff,  slk_attrset
+       to be attr_t, and adds const qualifiers.  The format codes
+       2 and 3 for slk_init() and the function slk_attr are  spe-
+       cific to ncurses.
+
+
+
+

SEE ALSO

+       curses(3x),   curs_attr(3x),   curs_initscr(3x),  curs_re-
+       fresh(3x), curs_variables(3x).
+
+
+
+                                                           curs_slk(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_sp_funcs.3x.html b/doc/html/man/curs_sp_funcs.3x.html new file mode 100644 index 00000000000..a11947a74ab --- /dev/null +++ b/doc/html/man/curs_sp_funcs.3x.html @@ -0,0 +1,285 @@ + + + + +curs_sp_funcs 3x + + + + +

curs_sp_funcs 3x

+
+
+
+curs_sp_funcs(3x)                                     curs_sp_funcs(3x)
+
+
+
+
+
+

NAME

+       new_prescr - curses screen-pointer extension
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int assume_default_colors_sp(SCREEN*, int, int);
+       int baudrate_sp(SCREEN*);
+       int beep_sp(SCREEN*);
+       bool can_change_color_sp(SCREEN*);
+       int cbreak_sp(SCREEN*);
+       int color_content_sp(SCREEN*, short, short*, short*, short*);
+       int curs_set_sp(SCREEN*, int);
+       int define_key_sp(SCREEN*, const char *, int);
+       int def_prog_mode_sp(SCREEN*);
+       int def_shell_mode_sp(SCREEN*);
+       int delay_output_sp(SCREEN*, int);
+       int doupdate_sp(SCREEN*);
+       int echo_sp(SCREEN*);
+       int endwin_sp(SCREEN*);
+       int erasechar_sp(SCREEN*);
+       int filter_sp(SCREEN*);
+       int flash_sp(SCREEN*);
+       int flushinp_sp(SCREEN*);
+       int get_escdelay_sp(SCREEN*);
+       int getmouse_sp(SCREEN*, MEVENT*);
+       WINDOW* getwin_sp(SCREEN*, FILE*);
+       int halfdelay_sp(SCREEN*);
+       bool has_colors_sp(SCREEN*);
+       bool has_ic_sp(SCREEN*);
+       bool has_il_sp(SCREEN*);
+       int has_key_sp(SCREEN*, int);
+       bool has_mouse_sp(SCREEN*);
+       int init_color_sp(SCREEN*, short, short, short, short);
+       int init_pair_sp(SCREEN*, short, short, short);
+       int intrflush_sp(SCREEN*, WINDOW*, bool);
+       bool isendwin_sp(SCREEN*);
+       bool is_term_resized_sp(SCREEN*, int, int);
+       char* keybound_sp(SCREEN*, int, int);
+       int key_defined_sp(SCREEN*, const char *);
+       NCURSES_CONST char * keyname_sp(SCREEN*, int);
+       int keyok_sp(SCREEN*, int, bool);
+       char killchar_sp(SCREEN*);
+       int mcprint_sp(SCREEN*, char *, int);
+       int mouseinterval_sp(SCREEN*, int);
+       mmask_t mousemask_sp(SCREEN*, mmask_t, mmask_t *);
+       int mvcur_sp(SCREEN*, int, int, int, int);
+       int napms_sp(SCREEN*, int);
+       WINDOW* newpad_sp(SCREEN*, int, int);
+       SCREEN* new_prescr(void);
+       SCREEN* newterm_sp(SCREEN*, NCURSES_CONST char *, FILE *, FILE *);
+       WINDOW* newwin_sp(SCREEN*, int, int, int, int);
+       int nl_sp(SCREEN*);
+       int nocbreak_sp(SCREEN*);
+       int noecho_sp(SCREEN*);
+       int nofilter_sp(SCREEN*);
+       int nonl_sp(SCREEN*);
+       void noqiflush_sp(SCREEN*);
+       int noraw_sp(SCREEN*);
+       int pair_content_sp(SCREEN*, short, short*, short*);
+       void qiflush_sp(SCREEN*);
+       int raw_sp(SCREEN*);
+       int reset_prog_mode_sp(SCREEN*);
+       int reset_shell_mode_sp(SCREEN*);
+       int resetty_sp(SCREEN*);
+       int resize_term_sp(SCREEN*, int, int);
+       int resizeterm_sp(SCREEN*, int, int);
+       int restartterm_sp(SCREEN*, NCURSES_CONST char*, int, int *);
+       int ripoffline_sp(SCREEN*, int, int (*)(WINDOW*, int));
+       int savetty_sp(SCREEN*);
+       int scr_init_sp(SCREEN*, const char *);
+       int scr_restore_sp(SCREEN*, const char *);
+       int scr_set_sp(SCREEN*, const char *);
+       TERMINAL* set_curterm_sp(SCREEN*, TERMINAL*);
+       int set_escdelay_sp(SCREEN*, int);
+       int set_tabsize_sp(SCREEN*, int);
+       int slk_attroff_sp(SCREEN*, const chtype);
+       int slk_attron_sp(SCREEN*, const chtype);
+       int slk_attr_set_sp(SCREEN*, const attr_t, short, void*);
+       int slk_attrset_sp(SCREEN*, const chtype);
+       int slk_attr_sp((SCREEN*);
+       int slk_clear_sp(SCREEN*);
+       int slk_color_sp(SCREEN*, short);
+       int slk_init_sp(SCREEN*, int);
+       int slk_label_sp(SCREEN*, int);
+       int slk_noutrefresh_sp(SCREEN*);
+       int slk_refresh_sp(SCREEN*);
+       int slk_restore_sp(SCREEN*);
+       int slk_set_sp(SCREEN*, int, const char *, int);
+       int slk_touch_sp(SCREEN*);
+       int start_color_sp(SCREEN*);
+       attr_t term_attrs_sp(SCREEN*);
+       chtype termattrs_sp(SCREEN*);
+       char* termname_sp(SCREEN*);
+       int typeahead_sp(SCREEN*, int);
+       NCURSES_CONST char* unctrl_sp(SCREEN*, chtype);
+       int ungetch_sp(SCREEN*, int);
+       int ungetmouse_sp(SCREEN*,MEVENT *);
+       int unget_wch_sp(SCREEN*, const wchar_t);
+       int use_default_colors_sp(SCREEN*);
+       void use_env_sp(SCREEN*, bool);
+       int use_legacy_coding_sp(SCREEN*, int);
+       int vid_attr_sp(SCREEN*, attr_t, short, void *);
+       int vidattr_sp(SCREEN*, chtype);
+       int vid_puts_sp(SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC);
+       int vidputs_sp(SCREEN*, chtype, NCURSES_SP_OUTC);
+       wchar_t* wunctrl_sp(SCREEN*, cchar_t *);
+
+       #include <form.h>
+
+       int new_form_sp(SCREEN*, FIELD **);
+
+       #include <menu.h>
+
+       int new_menu_sp(SCREEN*, ITEM **);
+
+       #include <panel.h>
+
+       int ceiling_panel(SCREEN*);
+       PANEL* ground_panel(SCREEN*);
+       int update_panels_sp(SCREEN*);
+
+       #include <term.h>
+
+       int del_curterm_sp(SCREEN*, TERMINAL *);
+       int putp_sp(SCREEN*, const char *);
+       int tgetflag_sp(SCREEN*, char *, const char *);
+       int tgetent_sp(SCREEN*, char *, const char *);
+       int tgetnum_sp(SCREEN*, NCURSES_CONST char *);
+       char* tgetstr_sp(SCREEN*, NCURSES_CONST char *, char **);
+       int tigetflag_sp(SCREEN*, NCURSES_CONST char *);
+       int tigetnum_sp(SCREEN*, NCURSES_CONST char *);
+       char* tigetstr_sp(SCREEN*, NCURSES_CONST char *);
+       int tputs_sp(SCREEN*, const char *, int, NCURSES_SP_OUTC);
+
+
+
+

DESCRIPTION

+       This  implementation can be configured to provide a set of
+       functions which improve the  ability  to  manage  multiple
+       screens.  This feature can be added to any of the configu-
+       rations supported by  ncurses;  it  adds  new  entrypoints
+       without  changing the meaning of any of the existing ones.
+
+
+   IMPROVED FUNCTIONS
+       Most of the functions are new versions of  existing  func-
+       tions.  A parameter is added at the front of the parameter
+       list.  It is a SCREEN pointer.
+
+       The existing functions all use the current  screen,  which
+       is  a  static  variable.   The  extended functions use the
+       specified screen, thereby reducing the number of variables
+       which must be modified to update multiple screens.
+
+   NEW FUNCTIONS
+       Here are the new functions:
+
+       ceiling_panel
+            this  returns  a  pointer to the topmost panel in the
+            given screen.
+
+       ground_panel
+            this returns a pointer to the  lowest  panel  in  the
+            given screen.
+
+       new_prescr
+            when  creating  a new screen, the library uses static
+            variables  which   have   been   preset,   e.g.,   by
+            use_env(3x), filter(3x), etc.  With the screen-point-
+            er extension, there are situations where it must cre-
+            ate  a  current  screen before the unextended library
+            does.  The new_prescr function is used internally  to
+            handle these cases.  It is also provided as an entry-
+            point to allow applications to customize the  library
+            initialization.
+
+
+
+

NOTES

+       This extension introduces some new names:
+
+       NCURSES_SP_FUNCS
+            This  is  set  to the library patch-level number.  In
+            the unextended library, this is zero (0), to make  it
+            useful for checking if the extension is provided.
+
+       NCURSES_SP_NAME
+            The  new  functions  are named using the macro NCURS-
+            ES_SP_NAME, which hides  the  actual  implementation.
+            Currently this adds a "_sp" suffix to the name of the
+            unextended function.  This manual  page  indexes  the
+            extensions showing the full name.  However the proper
+            usage of these functions uses the macro,  to  provide
+            for the possibility of changing the naming convention
+            for specific library configurations.
+
+       NCURSES_SP_OUTC
+            This is a new function-pointer type  to  use  in  the
+            screen-pointer  functions  where  an  NCURSES_OUTC is
+            used in the unextended library.
+
+       NCURSES_OUTC
+            This is a function-pointer type used  for  the  cases
+            where  a  function  passes  characters  to the output
+            stream, e.g., vidputs(3x).
+
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on  ncurses  ex-
+       tensions be conditioned using NCURSES_SP_FUNCS.
+
+
+
+

SEE ALSO

+       curses(3x), curs_opaque(3x), curs_threads(3x).
+
+
+
+                                                      curs_sp_funcs(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_termattrs.3x.html b/doc/html/man/curs_termattrs.3x.html new file mode 100644 index 00000000000..960cc2a4a7c --- /dev/null +++ b/doc/html/man/curs_termattrs.3x.html @@ -0,0 +1,161 @@ + + + + +curs_termattrs 3x + + + + +

curs_termattrs 3x

+
+
+
+curs_termattrs(3x)                                   curs_termattrs(3x)
+
+
+
+
+
+

NAME

+       baudrate, erasechar, erasewchar, has_ic, has_il, killchar,
+       killwchar, longname,  term_attrs,  termattrs,  termname  -
+       curses environment query routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int baudrate(void);
+       char erasechar(void);
+       int erasewchar(wchar_t *ch);
+       bool has_ic(void);
+       bool has_il(void);
+       char killchar(void);
+       int killwchar(wchar_t *ch);
+       char *longname(void);
+       attr_t term_attrs(void);
+       chtype termattrs(void);
+       char *termname(void);
+
+
+
+

DESCRIPTION

+       The  baudrate routine returns the output speed of the ter-
+       minal.  The number returned is in  bits  per  second,  for
+       example 9600, and is an integer.
+
+       The  erasechar  routine  returns  the user's current erase
+       character.
+
+       The erasewchar routine stores the current erase  character
+       in  the  location referenced by ch.  If no erase character
+       has been defined, the routine fails and the location  ref-
+       erenced by ch is not changed.
+
+       The has_ic routine is true if the terminal has insert- and
+       delete- character capabilities.
+
+       The has_il routine is true if the terminal has insert- and
+       delete-line  capabilities,  or  can  simulate  them  using
+       scrolling regions.  This might be used to determine if  it
+       would  be  appropriate to turn on physical scrolling using
+       scrollok.
+
+       The killchar routine returns the user's current line  kill
+       character.
+
+       The killwchar routine stores the current line-kill charac-
+       ter in the location referenced by  ch.   If  no  line-kill
+       character  has  been  defined,  the  routine fails and the
+       location referenced by ch is not changed.
+
+       The longname routine returns a pointer to  a  static  area
+       containing  a verbose description of the current terminal.
+       The maximum length of a verbose description is 128 charac-
+       ters.   It  is  defined  only after the call to initscr or
+       newterm.  The area is overwritten by each call to  newterm
+       and  is  not  restored by set_term, so the value should be
+       saved between calls to newterm if longname is going to  be
+       used with multiple terminals.
+
+       If  a  given  terminal  does not support a video attribute
+       that an application program is trying to use,  curses  may
+       substitute  a  different  video  attribute  for  it.   The
+       termattrs and term_attrs functions return a logical OR  of
+       all  video  attributes  supported by the terminal using A_
+       and WA_ constants respectively.  This information is  use-
+       ful  when a curses program needs complete control over the
+       appearance of the screen.
+
+       The termname routine returns the  terminal  name  used  by
+       setupterm.
+
+
+
+

RETURN VALUE

+       longname and termname return NULL on error.
+
+       Routines  that  return  an integer return ERR upon failure
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR") upon successful completion.
+
+
+
+

NOTES

+       Note that termattrs may be a macro.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.  It changes the return type of termattrs to the new
+       type  attr_t.  Most versions of curses truncate the result
+       returned by termname to 14 characters.
+
+
+
+

SEE ALSO

+       curses(3x), curs_initscr(3x), curs_outopts(3x)
+
+
+
+                                                     curs_termattrs(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_termcap.3x.html b/doc/html/man/curs_termcap.3x.html new file mode 100644 index 00000000000..f62fc0ca997 --- /dev/null +++ b/doc/html/man/curs_termcap.3x.html @@ -0,0 +1,191 @@ + + + + +curs_termcap 3x + + + + +

curs_termcap 3x

+
+
+
+curs_termcap(3x)                                       curs_termcap(3x)
+
+
+
+
+
+

NAME

+       PC, UP, BC, ospeed, tgetent, tgetflag, tgetnum, tgetstr,
+       tgoto, tputs - direct curses interface to the terminfo
+       capability database
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       #include <term.h>
+
+       extern char PC;
+       extern char * UP;
+       extern char * BC;
+       extern short ospeed;
+
+       int tgetent(char *bp, const char *name);
+       int tgetflag(char *id);
+       int tgetnum(char *id);
+       char *tgetstr(char *id, char **area);
+       char *tgoto(const char *cap, int col, int row);
+       int tputs(const char *str, int affcnt, int (*putc)(int));
+
+
+
+

DESCRIPTION

+       These  routines  are included as a conversion aid for pro-
+       grams that use the termcap library.  Their parameters  are
+       the  same and the routines are emulated using the terminfo
+       database.  Thus, they can only be used to query the  capa-
+       bilities  of  entries  for which a terminfo entry has been
+       compiled.
+
+       The tgetent routine loads the entry for name.  It  returns
+       1  on  success, 0 if there is no such entry, and -1 if the
+       terminfo database could not be found.  The  emulation  ig-
+       nores the buffer pointer bp.
+
+       The tgetflag routine gets the boolean entry for id, or ze-
+       ro if it is not available.
+
+       The tgetnum routine gets the numeric entry for id,  or  -1
+       if it is not available.
+
+       The  tgetstr  routine  returns the string entry for id, or
+       zero if it is not available.  Use tputs to output the  re-
+       turned  string.   The  return value will also be copied to
+       the buffer pointed to by area, and the area value will  be
+       updated to point past the null ending this value.
+
+       Only the first two characters of the id parameter of tget-
+       flag, tgetnum and tgetstr are compared in lookups.
+
+       The tgoto routine instantiates  the  parameters  into  the
+       given  capability.   The output from this routine is to be
+       passed to tputs.
+
+       The tputs routine is described  on  the  curs_terminfo(3x)
+       manual page.  It can retrieve capabilities by either term-
+       cap or terminfo name.
+
+       The variables PC, UP and BC are set by tgetent to the ter-
+       minfo   entry's   data   for   pad_char,   cursor_up   and
+       backspace_if_not_bs, respectively.   UP  is  not  used  by
+       ncurses.  PC is used in the tdelay_output function.  BC is
+       used in the tgoto emulation.  The variable ospeed  is  set
+       by ncurses in a system-specific coding to reflect the ter-
+       minal speed.
+
+
+
+

RETURN VALUE

+       Except where explicitly noted, routines that return an in-
+       teger  return ERR upon failure and OK (SVr4 only specifies
+       "an integer value other than ERR") upon successful comple-
+       tion.
+
+       Routines that return pointers return NULL on error.
+
+
+
+

BUGS

+       If you call tgetstr to fetch ca or any other parameterized
+       string, be aware that it will be returned in terminfo  no-
+       tation, not the older and not-quite-compatible termcap no-
+       tation.  This will not cause problems if all you  do  with
+       it  is  call  tgoto  or tparm, which both expand terminfo-
+       style strings as terminfo.  (The tgoto function,  if  con-
+       figured  to  support  termcap, will check if the string is
+       indeed terminfo-style by looking for  "%p"  parameters  or
+       "$<..>"  delays,  and invoke a termcap-style parser if the
+       string does not appear to be terminfo).
+
+       Because terminfo conventions for representing  padding  in
+       string  capabilities  differ  from termcap's, tputs("50");
+       will put out a literal "50" rather than  busy-waiting  for
+       50 milliseconds.  Cope with it.
+
+       Note  that termcap has nothing analogous to terminfo's sgr
+       string.  One consequence of this is that termcap  applica-
+       tions  assume me (terminfo sgr0) does not reset the alter-
+       nate character set.  This implementation checks  for,  and
+       modifies the data shown to the termcap interface to accom-
+       modate termcap's limitation in this respect.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   However,  they are marked TO BE WITHDRAWN and may
+       be removed in future versions.
+
+       Neither the XSI Curses standard nor  the  SVr4  man  pages
+       documented  the return values of tgetent correctly, though
+       all three were in fact returned ever since SVr1.  In  par-
+       ticular,  an  omission in the XSI Curses documentation has
+       been misinterpreted to mean that  tgetent  returns  OK  or
+       ERR.  Because the purpose of these functions is to provide
+       compatibility with the termcap library, that is  a  defect
+       in XCurses, Issue 4, Version 2 rather than in ncurses.
+
+       External  variables  are  provided  for support of certain
+       termcap applications.  However, termcap applications'  use
+       of those variables is poorly documented, e.g., not distin-
+       guishing between input and output.   In  particular,  some
+       applications are reported to declare and/or modify ospeed.
+
+
+
+

SEE ALSO

+       curses(3x), terminfo(5), term_variables(3x), putc(3).
+
+
+
+                                                       curs_termcap(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_terminfo.3x.html b/doc/html/man/curs_terminfo.3x.html new file mode 100644 index 00000000000..9a640e9f8bc --- /dev/null +++ b/doc/html/man/curs_terminfo.3x.html @@ -0,0 +1,363 @@ + + + + +curs_terminfo 3x + + + + +

curs_terminfo 3x

+
+
+
+curs_terminfo(3x)                                     curs_terminfo(3x)
+
+
+
+
+
+

NAME

+       del_curterm, mvcur, putp, restartterm, set_curterm,
+       setterm, setupterm, tigetflag, tigetnum, tigetstr, tiparm,
+       tparm, tputs, vid_attr, vid_puts, vidattr, vidputs -
+       curses interfaces to terminfo database
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       #include <term.h>
+
+       int setupterm(char *term, int fildes, int *errret);
+       int setterm(char *term);
+       TERMINAL *set_curterm(TERMINAL *nterm);
+       int del_curterm(TERMINAL *oterm);
+       int restartterm(char *term, int fildes, int *errret);
+       char *tparm(char *str, ...);
+       int tputs(const char *str, int affcnt, int (*putc)(int));
+       int putp(const char *str);
+       int vidputs(chtype attrs, int (*putc)(int));
+       int vidattr(chtype attrs);
+       int vid_puts(attr_t attrs, short pair, void *opts, int (*putc)(char));
+       int vid_attr(attr_t attrs, short pair, void *opts);
+       int mvcur(int oldrow, int oldcol, int newrow, int newcol);
+       int tigetflag(char *capname);
+       int tigetnum(char *capname);
+       char *tigetstr(char *capname);
+       char *tiparm(const char *str, ...);
+
+
+
+

DESCRIPTION

+       These low-level routines must be called by  programs  that
+       have to deal directly with the terminfo database to handle
+       certain terminal capabilities, such as  programming  func-
+       tion  keys.   For all other functionality, curses routines
+       are more suitable and their use is recommended.
+
+       Initially, setupterm should  be  called.   Note  that  se-
+       tupterm  is  automatically  called by initscr and newterm.
+       This  defines  the  set  of  terminal-dependent  variables
+       [listed in terminfo(5)].  The terminfo variables lines and
+       columns are initialized by setupterm as follows:
+
+              If use_env(FALSE) has been called, values for lines
+              and columns specified in terminfo are used.
+
+              Otherwise,  if  the environment variables LINES and
+              COLUMNS exist, their values are used.  If these en-
+              vironment variables do not exist and the program is
+              running in a window, the  current  window  size  is
+              used.   Otherwise,  if the environment variables do
+              not exist, the values for lines and columns  speci-
+              fied in the terminfo database are used.
+
+       The  header  files  curses.h and term.h should be included
+       (in this order) to get the definitions for these  strings,
+       numbers,  and  flags.   Parameterized  strings  should  be
+       passed through tparm to instantiate  them.   All  terminfo
+       strings  [including the output of tparm] should be printed
+       with tputs or putp.  Call the reset_shell_mode to  restore
+       the  tty modes before exiting [see curs_kernel(3x)].  Pro-
+       grams  which  use  cursor  addressing  should  output  en-
+       ter_ca_mode  upon  startup  and should output exit_ca_mode
+       before exiting.  Programs desiring  shell  escapes  should
+       call
+
+       reset_shell_mode  and output exit_ca_mode before the shell
+       is called and should output  enter_ca_mode  and  call  re-
+       set_prog_mode after returning from the shell.
+
+       The setupterm routine reads in the terminfo database, ini-
+       tializing the terminfo structures, but does not set up the
+       output virtualization structures used by curses.  The ter-
+       minal type is the character string term; if term is  null,
+       the  environment  variable TERM is used.  All output is to
+       file descriptor fildes which is  initialized  for  output.
+       If  errret  is  not null, then setupterm returns OK or ERR
+       and stores a status value in the integer pointed to by er-
+       rret.   A  return value of OK combined with status of 1 in
+       errret is normal.  If ERR is returned, examine errret:
+
+              1    means that the terminal is hardcopy, cannot be
+                   used for curses applications.
+
+              0    means that the terminal could not be found, or
+                   that it is a generic type, having  too  little
+                   information for curses applications to run.
+
+              -1   means  that the terminfo database could not be
+                   found.
+
+       If errret is null, setupterm prints an error message  upon
+       finding an error and exits.  Thus, the simplest call is:
+
+             setupterm((char *)0, 1, (int *)0);,
+
+       which  uses  all the defaults and sends the output to std-
+       out.
+
+       The setterm routine is being replaced by  setupterm.   The
+       call:
+
+             setupterm(term, 1, (int *)0)
+
+       provides  the  same  functionality  as setterm(term).  The
+       setterm routine is included here  for  BSD  compatibility,
+       and is not recommended for new programs.
+
+       The  set_curterm  routine  sets  the  variable cur_term to
+       nterm, and makes all of the terminfo boolean, numeric, and
+       string  variables  use  the values from nterm.  It returns
+       the old value of cur_term.
+
+       The del_curterm routine frees  the  space  pointed  to  by
+       oterm and makes it available for further use.  If oterm is
+       the same as cur_term, references to any  of  the  terminfo
+       boolean,  numeric, and string variables thereafter may re-
+       fer to invalid memory locations  until  another  setupterm
+       has been called.
+
+       The  restartterm  routine  is  similar  to  setupterm  and
+       initscr, except that it is called after  restoring  memory
+       to  a  previous  state (for example, when reloading a game
+       saved as a core image dump).  It assumes that the  windows
+       and the input and output options are the same as when mem-
+       ory was saved, but the terminal type and baud rate may  be
+       different.   Accordingly, it saves various tty state bits,
+       calls setupterm, and then restores the bits.
+
+       The tparm routine instantiates the string str with parame-
+       ters  pi.  A pointer is returned to the result of str with
+       the parameters applied.
+
+       tiparm is a newer form  of  tparm  which  uses  <stdarg.h>
+       rather  than  a fixed-parameter list.  Its numeric parame-
+       ters are integers (int) rather than longs.
+
+       The tputs  routine  applies  padding  information  to  the
+       string  str  and  outputs  it.  The str must be a terminfo
+       string variable or the return value from  tparm,  tgetstr,
+       or tgoto.  affcnt is the number of lines affected, or 1 if
+       not applicable.  putc is a putchar-like routine  to  which
+       the characters are passed, one at a time.
+
+       The  putp routine calls tputs(str, 1, putchar).  Note that
+       the output of putp always  goes  to  stdout,  not  to  the
+       fildes specified in setupterm.
+
+       The vidputs routine displays the string on the terminal in
+       the video attribute mode attrs, which is  any  combination
+       of  the  attributes  listed in curses(3x).  The characters
+       are passed to the putchar-like routine putc.
+
+       The vidattr routine is like the  vidputs  routine,  except
+       that it outputs through putchar.
+
+       The  vid_attr  and vid_puts routines correspond to vidattr
+       and vidputs, respectively.  They use a  set  of  arguments
+       for  representing  the  video attributes plus color, i.e.,
+       one of type attr_t for the attributes and one of short for
+       the color_pair number.  The vid_attr and vid_puts routines
+       are designed to use the attribute constants with  the  WA_
+       prefix.   The  opts  argument  is reserved for future use.
+       Currently, applications must provide a  null  pointer  for
+       that argument.
+
+       The  mvcur  routine  provides low-level cursor motion.  It
+       takes effect immediately (rather  than  at  the  next  re-
+       fresh).
+
+       The  tigetflag,  tigetnum and tigetstr routines return the
+       value of the capability corresponding to the terminfo cap-
+       name passed to them, such as xenl.
+
+       The  tigetflag  routine returns the value -1 if capname is
+       not a boolean capability, or 0 if it is canceled or absent
+       from the terminal description.
+
+       The  tigetnum  routine  returns the value -2 if capname is
+       not a numeric capability, or -1 if it is canceled  or  ab-
+       sent from the terminal description.
+
+       The  tigetstr routine returns the value (char *)-1 if cap-
+       name is not a string capability, or 0 if it is canceled or
+       absent from the terminal description.
+
+       The capname for each capability is given in the table col-
+       umn entitled capname code in the capabilities  section  of
+       terminfo(5).
+
+              char *boolnames[], *boolcodes[], *boolfnames[]
+
+              char *numnames[], *numcodes[], *numfnames[]
+
+              char *strnames[], *strcodes[], *strfnames[]
+
+       These  null-terminated  arrays  contain  the capnames, the
+       termcap codes, and the full C names, for each of the  ter-
+       minfo variables.
+
+
+
+

RETURN VALUE

+       Routines  that  return  an integer return ERR upon failure
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR")  upon  successful completion, unless otherwise noted
+       in the preceding routine descriptions.
+
+       Routines that return pointers always return NULL on error.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion
+
+              del_curterm
+                   returns  an error if its terminal parameter is
+                   null.
+
+              putp calls tputs, returning the same error-codes.
+
+              restartterm
+                   returns an error if the associated call to se-
+                   tupterm returns an error.
+
+              setupterm
+                   returns  an error if it cannot allocate enough
+                   memory, or create the initial windows (stdscr,
+                   curscr,  newscr).   Other error conditions are
+                   documented above.
+
+              tputs
+                   returns an error if the  string  parameter  is
+                   null.   It  does not detect I/O errors: X/Open
+                   states that tputs ignores the return value  of
+                   the output function putc.
+
+
+
+

NOTES

+       The  setupterm routine should be used in place of setterm.
+       It may be useful when you want to test for terminal  capa-
+       bilities  without  committing to the allocation of storage
+       involved in initscr.
+
+       Note that vidattr and vidputs may be macros.
+
+
+
+

PORTABILITY

+       The function setterm is not described by X/Open  and  must
+       be  considered  non-portable.   All other functions are as
+       described by X/Open.
+
+       setupterm copies the terminal name to the  array  ttytype.
+       This  is not part of X/Open Curses, but is assumed by some
+       applications.
+
+       In System V Release 4, set_curterm has an int return  type
+       and  returns  OK  or ERR.  We have chosen to implement the
+       X/Open Curses semantics.
+
+       In System V Release 4, the third argument of tputs has the
+       type int (*putc)(char).
+
+       At least one implementation of X/Open Curses (Solaris) re-
+       turns a value other than OK/ERR from tputs.  That  returns
+       the length of the string, and does no error-checking.
+
+       X/Open  Curses prototypes tparm with a fixed number of pa-
+       rameters, rather than a variable argument list.  This  im-
+       plementation  uses  a  variable  argument list, but can be
+       configured to use the fixed-parameter list.  Portable  ap-
+       plications  should  provide 9 parameters after the format;
+       zeroes are fine for this purpose.
+
+       In response to comments by Thomas E. Dickey, X/Open Curses
+       Issue 7 proposed the tiparam function in mid-2009.
+
+       X/Open  notes  that  after calling mvcur, the curses state
+       may not match the actual terminal state, and that  an  ap-
+       plication  should  touch and refresh the window before re-
+       suming normal curses calls.  Both ncurses and System V Re-
+       lease 4 curses implement mvcur using the SCREEN data allo-
+       cated in either initscr or newterm.  So though it is docu-
+       mented  as  a  terminfo function, mvcur is really a curses
+       function which is not well specified.
+
+       X/Open states that the old  location  must  be  given  for
+       mvcur.   This implementation allows the caller to use -1's
+       for the old ordinates.  In that case, the old location  is
+       unknown.
+
+       Extended  terminal  capability  names, e.g., as defined by
+       tic -x, are not stored in the  arrays  described  in  this
+       section.
+
+
+
+

SEE ALSO

+       curses(3x),  curs_initscr(3x), curs_kernel(3x), curs_term-
+       cap(3x), curs_variables(3x), term_variables(3x),  putc(3),
+       terminfo(5)
+
+
+
+                                                      curs_terminfo(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_threads.3x.html b/doc/html/man/curs_threads.3x.html new file mode 100644 index 00000000000..394544a3b76 --- /dev/null +++ b/doc/html/man/curs_threads.3x.html @@ -0,0 +1,634 @@ + + + + +curs_threads 3x + + + + +

curs_threads 3x

+
+
+
+curs_threads(3x)                                       curs_threads(3x)
+
+
+
+
+
+

NAME

+       use_screen, use_window - curses thread support
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);
+       typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);
+       int get_escdelay(void);
+       int set_escdelay(int size);
+       int set_tabsize(int size);
+       int  use_screen(SCREEN  *scr, NCURSES_WINDOW_CB func, void
+       *data);
+       int use_window(WINDOW *win, NCURSES_SCREEN_CB  func,  void
+       *data);
+
+
+
+

DESCRIPTION

+       This  implementation can be configured to provide rudimen-
+       tary support for multi-threaded applications.  This  makes
+       a  different set of libraries, e.g., libncursest since the
+       binary interfaces are different.
+
+       Rather than modify the interfaces to pass a thread  speci-
+       fier  to  each function, it adds a few functions which can
+       be used in any configuration which hide the mutex's needed
+       to  prevent  concurrent  use  of the global variables when
+       configured for threading.
+
+       In addition to forcing access to  members  of  the  WINDOW
+       structure  to  be  via functions (see curs_opaque(3x)), it
+       makes functions of the common global variables, e.g., COL-
+       ORS,  COLOR_PAIRS,  COLS, ESCDELAY, LINES, TABSIZE curscr,
+       newscr and ttytype.  Those  variables  are  maintained  as
+       read-only values, stored in the SCREEN structure.
+
+       Even  this is not enough to make a thread-safe application
+       using curses.  A multi-threaded application would  be  ex-
+       pected  to  have threads updating separate windows (within
+       the same device), or updating on separate screens (on dif-
+       ferent  devices).  Also, a few of the global variables are
+       considered writable by some applications.   The  functions
+       described here address these special situations.
+
+       The  ESCDELAY and TABSIZE global variables are modified by
+       some applications.  To modify them in  any  configuration,
+       use  the  set_escdelay  or  set_tabsize  functions.  Other
+       global variables are not modifiable.
+
+       The get_escdelay function returns the value for ESCDELAY.
+
+       The use_window and  use_screen  functions  provide  coarse
+       granularity mutexes for their respective WINDOW and SCREEN
+       parameters, and call a user-supplied function, passing  it
+       a  data  parameter, and returning the value from the user-
+       supplied function to the application.
+
+   USAGE
+       All of the ncurses library functions assume that  the  lo-
+       cale  is  not altered during operation.  In addition, they
+       use data which is maintained within a hierarchy of scopes.
+
+          o   global data, e.g., used in the  low-level  terminfo
+              or termcap interfaces.
+
+          o   terminal  data,  e.g.,  associated  with  a call to
+              set_curterm.  The  terminal  data  are  initialized
+              when screens are created.
+
+          o   screen  data,  e.g.,  associated  with  a  call  to
+              newterm or initscr.
+
+          o   window data, e.g., associated with a call to newwin
+              or  subwin.   Windows  are associated with screens.
+              Pads are not necessarily associated with a particu-
+              lar screen.
+
+              Most  curses  applications  operate  on one or more
+              windows within a single screen.
+
+          o   reentrant, i.e., it uses only the  data  passed  as
+              parameters.
+
+       This table lists the scope of data used for each symbol in
+       the ncurses library  when  it  is  configured  to  support
+       threading:
+
+      Symbol                  Scope
+      -------------------------------------------------------------
+      BC                      global
+      COLORS                  screen (readonly)
+      COLOR_PAIR              reentrant
+      COLOR_PAIRS             screen (readonly)
+      COLS                    screen (readonly)
+      ESCDELAY                screen (readonly, see set_escdelay)
+      LINES                   screen (readonly)
+      PAIR_NUMBER             reentrant
+      PC                      global
+      SP                      global
+      TABSIZE                 screen (readonly)
+      UP                      global
+      acs_map                 screen (readonly)
+      add_wch                 window (stdscr)
+      add_wchnstr             window (stdscr)
+      add_wchstr              window (stdscr)
+      addch                   window (stdscr)
+      addchnstr               window (stdscr)
+      addchstr                window (stdscr)
+      addnstr                 window (stdscr)
+      addnwstr                window (stdscr)
+      addstr                  window (stdscr)
+      addwstr                 window (stdscr)
+      assume_default_colors   screen
+      attr_get                window (stdscr)
+      attr_off                window (stdscr)
+      attr_on                 window (stdscr)
+      attr_set                window (stdscr)
+      attroff                 window (stdscr)
+      attron                  window (stdscr)
+      attrset                 window (stdscr)
+      baudrate                screen
+      beep                    screen
+      bkgd                    window (stdscr)
+      bkgdset                 window (stdscr)
+      bkgrnd                  window (stdscr)
+      bkgrndset               window (stdscr)
+      boolcodes               global (readonly)
+      boolfnames              global (readonly)
+      boolnames               global (readonly)
+      border                  window (stdscr)
+
+      border_set              window (stdscr)
+      box                     window (stdscr)
+      box_set                 window (stdscr)
+      can_change_color        terminal
+      cbreak                  screen
+      chgat                   window (stdscr)
+      clear                   window (stdscr)
+      clearok                 window
+      clrtobot                window (stdscr)
+      clrtoeol                window (stdscr)
+      color_content           screen
+      color_set               window (stdscr)
+      copywin                 window locks(source, target)
+      cur_term                terminal
+      curs_set                screen
+      curscr                  screen (readonly)
+      curses_version          global (readonly)
+      def_prog_mode           terminal
+      def_shell_mode          terminal
+      define_key              screen
+      del_curterm             screen
+      delay_output            screen
+      delch                   window (stdscr)
+      deleteln                window (stdscr)
+      delscreen               global locks(screenlist, screen)
+      delwin                  global locks(windowlist)
+      derwin                  screen
+      doupdate                screen
+      dupwin                  screen locks(window)
+      echo                    screen
+      echo_wchar              window (stdscr)
+      echochar                window (stdscr)
+      endwin                  screen
+      erase                   window (stdscr)
+      erasechar               window (stdscr)
+      erasewchar              window (stdscr)
+      filter                  global
+      flash                   terminal
+      flushinp                screen
+      get_wch                 screen (input-operation)
+      get_wstr                screen (input-operation)
+      getattrs                window
+      getbegx                 window
+      getbegy                 window
+      getbkgd                 window
+      getbkgrnd               window
+      getcchar                reentrant
+      getch                   screen (input-operation)
+      getcurx                 window
+      getcury                 window
+      getmaxx                 window
+      getmaxy                 window
+      getmouse                screen (input-operation)
+      getn_wstr               screen (input-operation)
+      getnstr                 screen (input-operation)
+      getparx                 window
+      getpary                 window
+      getstr                  screen (input-operation)
+      getwin                  screen (input-operation)
+      halfdelay               screen
+      has_colors              terminal
+      has_ic                  terminal
+      has_il                  terminal
+      has_key                 screen
+      hline                   window (stdscr)
+      hline_set               window (stdscr)
+
+      idcok                   window
+      idlok                   window
+      immedok                 window
+      in_wch                  window (stdscr)
+      in_wchnstr              window (stdscr)
+      in_wchstr               window (stdscr)
+      inch                    window (stdscr)
+      inchnstr                window (stdscr)
+      inchstr                 window (stdscr)
+      init_color              screen
+      init_pair               screen
+      initscr                 global locks(screenlist)
+      innstr                  window (stdscr)
+      innwstr                 window (stdscr)
+      ins_nwstr               window (stdscr)
+      ins_wch                 window (stdscr)
+      ins_wstr                window (stdscr)
+      insch                   window (stdscr)
+      insdelln                window (stdscr)
+      insertln                window (stdscr)
+      insnstr                 window (stdscr)
+      insstr                  window (stdscr)
+      instr                   window (stdscr)
+      intrflush               terminal
+      inwstr                  window (stdscr)
+      is_cleared              window
+      is_idcok                window
+      is_idlok                window
+      is_immedok              window
+      is_keypad               window
+      is_leaveok              window
+      is_linetouched          window
+      is_nodelay              window
+      is_notimeout            window
+      is_scrollok             window
+      is_syncok               window
+      is_term_resized         terminal
+      is_wintouched           window
+      isendwin                screen
+      key_defined             screen
+      key_name                global (static data)
+      keybound                screen
+      keyname                 global (static data)
+      keyok                   screen
+      keypad                  window
+      killchar                terminal
+      killwchar               terminal
+      leaveok                 window
+      longname                screen
+      mcprint                 terminal
+      meta                    screen
+      mouse_trafo             window (stdscr)
+      mouseinterval           screen
+      mousemask               screen
+      move                    window (stdscr)
+      mvadd_wch               window (stdscr)
+      mvadd_wchnstr           window (stdscr)
+      mvadd_wchstr            window (stdscr)
+      mvaddch                 window (stdscr)
+      mvaddchnstr             window (stdscr)
+      mvaddchstr              window (stdscr)
+      mvaddnstr               window (stdscr)
+      mvaddnwstr              window (stdscr)
+      mvaddstr                window (stdscr)
+      mvaddwstr               window (stdscr)
+      mvchgat                 window (stdscr)
+
+      mvcur                   screen
+      mvdelch                 window (stdscr)
+      mvderwin                window (stdscr)
+      mvget_wch               screen (input-operation)
+      mvget_wstr              screen (input-operation)
+      mvgetch                 screen (input-operation)
+      mvgetn_wstr             screen (input-operation)
+      mvgetnstr               screen (input-operation)
+      mvgetstr                screen (input-operation)
+      mvhline                 window (stdscr)
+      mvhline_set             window (stdscr)
+      mvin_wch                window (stdscr)
+      mvin_wchnstr            window (stdscr)
+      mvin_wchstr             window (stdscr)
+      mvinch                  window (stdscr)
+      mvinchnstr              window (stdscr)
+      mvinchstr               window (stdscr)
+      mvinnstr                window (stdscr)
+      mvinnwstr               window (stdscr)
+      mvins_nwstr             window (stdscr)
+      mvins_wch               window (stdscr)
+      mvins_wstr              window (stdscr)
+      mvinsch                 window (stdscr)
+      mvinsnstr               window (stdscr)
+      mvinsstr                window (stdscr)
+      mvinstr                 window (stdscr)
+      mvinwstr                window (stdscr)
+      mvprintw                window (stdscr)
+      mvscanw                 screen
+      mvvline                 window (stdscr)
+      mvvline_set             window (stdscr)
+      mvwadd_wch              window
+      mvwadd_wchnstr          window
+      mvwadd_wchstr           window
+      mvwaddch                window
+      mvwaddchnstr            window
+      mvwaddchstr             window
+      mvwaddnstr              window
+      mvwaddnwstr             window
+      mvwaddstr               window
+      mvwaddwstr              window
+      mvwchgat                window
+      mvwdelch                window
+      mvwget_wch              screen (input-operation)
+      mvwget_wstr             screen (input-operation)
+      mvwgetch                screen (input-operation)
+      mvwgetn_wstr            screen (input-operation)
+      mvwgetnstr              screen (input-operation)
+      mvwgetstr               screen (input-operation)
+      mvwhline                window
+      mvwhline_set            window
+      mvwin                   window
+      mvwin_wch               window
+      mvwin_wchnstr           window
+      mvwin_wchstr            window
+      mvwinch                 window
+      mvwinchnstr             window
+      mvwinchstr              window
+      mvwinnstr               window
+      mvwinnwstr              window
+      mvwins_nwstr            window
+      mvwins_wch              window
+      mvwins_wstr             window
+      mvwinsch                window
+      mvwinsnstr              window
+      mvwinsstr               window
+
+      mvwinstr                window
+      mvwinwstr               window
+      mvwprintw               window
+      mvwscanw                screen
+      mvwvline                window
+      mvwvline_set            window
+      napms                   reentrant
+      newpad                  global locks(windowlist)
+      newscr                  screen (readonly)
+      newterm                 global locks(screenlist)
+      newwin                  global locks(windowlist)
+      nl                      screen
+      nocbreak                screen
+      nodelay                 window
+      noecho                  screen
+      nofilter                global
+      nonl                    screen
+      noqiflush               terminal
+      noraw                   screen
+      notimeout               window
+      numcodes                global (readonly)
+      numfnames               global (readonly)
+      numnames                global (readonly)
+      ospeed                  global
+      overlay                 window locks(source, target)
+      overwrite               window locks(source, target)
+      pair_content            screen
+      pecho_wchar             screen
+      pechochar               screen
+      pnoutrefresh            screen
+      prefresh                screen
+      printw                  window
+      putp                    global
+      putwin                  window
+      qiflush                 terminal
+      raw                     screen
+      redrawwin               window
+      refresh                 screen
+      reset_prog_mode         screen
+      reset_shell_mode        screen
+      resetty                 terminal
+      resize_term             screen locks(windowlist)
+      resizeterm              screen
+      restartterm             screen
+      ripoffline              global (static data)
+      savetty                 terminal
+      scanw                   screen
+      scr_dump                screen
+      scr_init                screen
+      scr_restore             screen
+      scr_set                 screen
+      scrl                    window (stdscr)
+      scroll                  window
+      scrollok                window
+      set_curterm             screen
+      set_escdelay            screen
+      set_tabsize             screen
+      set_term                global locks(screenlist, screen)
+      setcchar                reentrant
+      setscrreg               window (stdscr)
+      setupterm               global
+      slk_attr                screen
+      slk_attr_off            screen
+      slk_attr_on             screen
+      slk_attr_set            screen
+      slk_attroff             screen
+
+      slk_attron              screen
+      slk_attrset             screen
+      slk_clear               screen
+      slk_color               screen
+      slk_init                screen
+      slk_label               screen
+      slk_noutrefresh         screen
+      slk_refresh             screen
+      slk_restore             screen
+      slk_set                 screen
+      slk_touch               screen
+      slk_wset                screen
+      standend                window
+      standout                window
+      start_color             screen
+      stdscr                  screen (readonly)
+      strcodes                global (readonly)
+      strfnames               global (readonly)
+      strnames                global (readonly)
+      subpad                  window
+      subwin                  window
+      syncok                  window
+      term_attrs              screen
+      termattrs               screen
+      termname                terminal
+      tgetent                 global
+      tgetflag                global
+      tgetnum                 global
+      tgetstr                 global
+      tgoto                   global
+      tigetflag               terminal
+      tigetnum                terminal
+      tigetstr                terminal
+      timeout                 window (stdscr)
+      touchline               window
+      touchwin                window
+      tparm                   global (static data)
+      tputs                   screen
+      trace                   global (static data)
+      ttytype                 screen (readonly)
+      typeahead               screen
+      unctrl                  screen
+      unget_wch               screen (input-operation)
+      ungetch                 screen (input-operation)
+      ungetmouse              screen (input-operation)
+      untouchwin              window
+      use_default_colors      screen
+      use_env                 global (static data)
+      use_extended_names      global (static data)
+      use_legacy_coding       screen
+      use_screen              global locks(screenlist, screen)
+      use_window              global locks(windowlist, window)
+      vid_attr                screen
+      vid_puts                screen
+      vidattr                 screen
+      vidputs                 screen
+      vline                   window (stdscr)
+      vline_set               window (stdscr)
+      vw_printw               window
+      vw_scanw                screen
+      vwprintw                window
+      vwscanw                 screen
+      wadd_wch                window
+      wadd_wchnstr            window
+      wadd_wchstr             window
+      waddch                  window
+
+      waddchnstr              window
+      waddchstr               window
+      waddnstr                window
+      waddnwstr               window
+      waddstr                 window
+      waddwstr                window
+      wattr_get               window
+      wattr_off               window
+      wattr_on                window
+      wattr_set               window
+      wattroff                window
+      wattron                 window
+      wattrset                window
+      wbkgd                   window
+      wbkgdset                window
+      wbkgrnd                 window
+      wbkgrndset              window
+      wborder                 window
+      wborder_set             window
+      wchgat                  window
+      wclear                  window
+      wclrtobot               window
+      wclrtoeol               window
+      wcolor_set              window
+      wcursyncup              screen (affects window plus parents)
+      wdelch                  window
+      wdeleteln               window
+      wecho_wchar             window
+      wechochar               window
+      wenclose                window
+      werase                  window
+      wget_wch                screen (input-operation)
+      wget_wstr               screen (input-operation)
+      wgetbkgrnd              window
+      wgetch                  screen (input-operation)
+      wgetn_wstr              screen (input-operation)
+      wgetnstr                screen (input-operation)
+      wgetparent              window
+      wgetscrreg              window
+      wgetstr                 screen (input-operation)
+      whline                  window
+      whline_set              window
+      win_wch                 window
+      win_wchnstr             window
+      win_wchstr              window
+      winch                   window
+      winchnstr               window
+      winchstr                window
+      winnstr                 window
+      winnwstr                window
+      wins_nwstr              window
+      wins_wch                window
+      wins_wstr               window
+      winsch                  window
+      winsdelln               window
+      winsertln               window
+      winsnstr                window
+      winsstr                 window
+      winstr                  window
+      winwstr                 window
+      wmouse_trafo            window
+      wmove                   window
+      wnoutrefresh            screen
+      wprintw                 window
+      wredrawln               window
+      wrefresh                screen
+
+      wresize                 window locks(windowlist)
+      wscanw                  screen
+      wscrl                   window
+      wsetscrreg              window
+      wstandend               window
+      wstandout               window
+      wsyncdown               screen (affects window plus parents)
+      wsyncup                 screen (affects window plus parents)
+      wtimeout                window
+      wtouchln                window
+      wunctrl                 global (static data)
+      wvline                  window
+      wvline_set              window
+
+
+
+

RETURN VALUE

+       These functions all return TRUE or FALSE, except as noted.
+
+
+
+

NOTES

+       Both a macro and a function are provided for each name.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is  recommended that any code depending on ncurses ex-
+       tensions be conditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       curses(3x), curs_opaque(3x), curs_variables(3x).
+
+
+
+                                                       curs_threads(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_touch.3x.html b/doc/html/man/curs_touch.3x.html new file mode 100644 index 00000000000..9ba1bc6c21a --- /dev/null +++ b/doc/html/man/curs_touch.3x.html @@ -0,0 +1,144 @@ + + + + +curs_touch 3x + + + + +

curs_touch 3x

+
+
+
+curs_touch(3x)                                           curs_touch(3x)
+
+
+
+
+
+

NAME

+       touchwin, touchline, untouchwin, wtouchln, is_linetouched,
+       is_wintouched - curses refresh control routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int touchwin(WINDOW *win);
+       int touchline(WINDOW *win, int start, int count);
+       int untouchwin(WINDOW *win);
+       int wtouchln(WINDOW *win, int y, int n, int changed);
+       bool is_linetouched(WINDOW *win, int line);
+       bool is_wintouched(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The touchwin and touchline routines throw away  all  opti-
+       mization  information about which parts of the window have
+       been touched, by pretending that  the  entire  window  has
+       been  drawn  on.   This  is sometimes necessary when using
+       overlapping windows, since a change to one window  affects
+       the other window, but the records of which lines have been
+       changed in the other window do  not  reflect  the  change.
+       The  routine touchline only pretends that count lines have
+       been changed, beginning with line start.
+
+       The untouchwin routine marks all lines in  the  window  as
+       unchanged since the last call to wrefresh.
+
+       The wtouchln routine makes n lines in the window, starting
+       at line y, look as if they have (changed=1)  or  have  not
+       (changed=0) been changed since the last call to wrefresh.
+
+       The  is_linetouched and is_wintouched routines return TRUE
+       if the specified line/window was modified since  the  last
+       call  to  wrefresh; otherwise they return FALSE.  In addi-
+       tion, is_linetouched returns ERR if line is not valid  for
+       the given window.
+
+
+
+

RETURN VALUE

+       All  routines  return  the integer ERR upon failure and an
+       integer value other than ERR upon  successful  completion,
+       unless  otherwise  noted in the preceding routine descrip-
+       tions.
+
+       X/Open does not define any error conditions.  In this  im-
+       plementation
+
+              is_linetouched
+                   returns  an  error  if  the  window pointer is
+                   null, or if the line  number  is  outside  the
+                   window.   Note  that ERR is distinct from TRUE
+                   and FALSE, which are the normal return  values
+                   of this function.
+
+              wtouchln
+                   returns  an  error  if  the  window pointer is
+                   null, or if the line  number  is  outside  the
+                   window.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+       Some historic curses implementations had,  as  an  undocu-
+       mented  feature,  the  ability  to  do  the  equivalent of
+       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
+       scr).  This will not work under ncurses.
+
+
+
+

NOTES

+       Note that all routines except wtouchln may be macros.
+
+
+
+

SEE ALSO

+       curses(3x), curs_refresh(3x), curs_variables(3x).
+
+
+
+                                                         curs_touch(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_trace.3x.html b/doc/html/man/curs_trace.3x.html new file mode 100644 index 00000000000..3705fdabf4a --- /dev/null +++ b/doc/html/man/curs_trace.3x.html @@ -0,0 +1,186 @@ + + + + +curs_trace 3x + + + + +

curs_trace 3x

+
+
+
+curs_trace(3x)                                           curs_trace(3x)
+
+
+
+
+
+

NAME

+       _tracef, _tracedump, _traceattr, _traceattr2,
+       _nc_tracebits, _tracecchar_t, _tracecchar_t2, _tracechar,
+       _tracechtype, _tracechtype2, _tracemouse, trace - curses
+       debugging routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       void _tracef(const char *format, ...);
+       void _tracedump(const char *label, WINDOW *win);
+       char *_traceattr(attr_t attr);
+       char *_traceattr2(int buffer, chtype ch);
+       char *_nc_tracebits(void);
+       char * _tracecchar_t(const cchar_t *string);
+       char * _tracecchar_t2(int buffer, const cchar_t *string);
+       char *_tracechar(int ch);
+       char *_tracechtype(chtype ch);
+       char *_tracechtype2(int buffer, chtype ch);
+       char *_tracemouse(const MEVENT *event);
+       void trace(const unsigned int param);
+
+
+
+

DESCRIPTION

+       The trace routines are used for debugging the ncurses  li-
+       braries, as well as applications which use the ncurses li-
+       braries.  These functions are normally available only with
+       the  debugging library libncurses_g.a, but may be compiled
+       into any model (shared, static, profile) by  defining  the
+       symbol  TRACE.   Additionally,  some  functions  are  only
+       available with the wide-character configuration of the li-
+       braries.
+
+       The  principal  parts of this interface are the trace rou-
+       tine which selectively enables different tracing features,
+       and the _tracef routine which writes formatted data to the
+       trace file.
+
+       Calling trace with a  nonzero  parameter  opens  the  file
+       trace  in the current directory for output.  The parameter
+       is formed by OR'ing values from the list of TRACE_xxx def-
+       initions in <curses.h>.  These include:
+
+       TRACE_DISABLE
+            turn off tracing.
+
+       TRACE_TIMES
+            trace user and system times of updates.
+
+       TRACE_TPUTS
+            trace tputs calls.
+
+       TRACE_UPDATE
+            trace update actions, old & new screens.
+
+       TRACE_MOVE
+            trace cursor movement and scrolling.
+
+       TRACE_CHARPUT
+            trace all character outputs.
+
+       TRACE_ORDINARY
+            trace  all  update  actions.   The old and new screen
+            contents are written to the trace file for  each  re-
+            fresh.
+
+       TRACE_CALLS
+            trace all curses calls.  The parameters for each call
+            are traced, as well as return values.
+
+       TRACE_VIRTPUT
+            trace virtual character puts, i.e., calls to addch.
+
+       TRACE_IEVENT
+            trace low-level input processing, including timeouts.
+
+       TRACE_BITS
+            trace state of TTY control bits.
+
+       TRACE_ICALLS
+            trace internal/nested calls.
+
+       TRACE_CCALLS
+            trace per-character calls.
+
+       TRACE_DATABASE
+            trace read/write of terminfo/termcap data.
+
+       TRACE_ATTRS
+            trace changes to video attributes and colors.
+
+       TRACE_MAXIMUM
+            maximum trace level,  enables  all  of  the  separate
+            trace features.
+
+       Some  tracing  features are enabled whenever the trace pa-
+       rameter is nonzero.  Some features overlap.  The  specific
+       names are used as a guideline.
+
+       These  functions check the NCURSES_TRACE environment vari-
+       able, to set the tracing feature as if trace was called:
+              filter,  initscr,  new_prescr,  newterm,  nofilter,
+              ripoffline, setupterm, slk_init, tgetent
+
+
+
+
+

RETURN VALUE

+       Routines  which  return a value are designed to be used as
+       parameters to the _tracef routine.
+
+
+
+

PORTABILITY

+       These functions are not part of the XSI  interface.   Some
+       other  curses  implementations  are known to have similar,
+       undocumented features, but they are  not  compatible  with
+       ncurses.
+
+
+
+

SEE ALSO

+       curses(3x).
+
+
+
+                                                         curs_trace(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_util.3x.html b/doc/html/man/curs_util.3x.html new file mode 100644 index 00000000000..8181efa432f --- /dev/null +++ b/doc/html/man/curs_util.3x.html @@ -0,0 +1,266 @@ + + + + +curs_util 3x + + + + +

curs_util 3x

+
+
+
+curs_util(3x)                                             curs_util(3x)
+
+
+
+
+
+

NAME

+       delay_output, filter, flushinp, getwin, key_name, keyname,
+       nofilter, putwin, unctrl, use_env, wunctrl - miscellaneous
+       curses utility routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       char *unctrl(chtype c);
+       wchar_t *wunctrl(cchar_t *c);
+       char *keyname(int c);
+       char *key_name(wchar_t w);
+       void filter(void);
+       void nofilter(void);
+       void use_env(bool f);
+       int putwin(WINDOW *win, FILE *filep);
+       WINDOW *getwin(FILE *filep);
+       int delay_output(int ms);
+       int flushinp(void);
+
+
+
+

DESCRIPTION

+       The  unctrl  routine returns a character string which is a
+       printable representation of the character c, ignoring  at-
+       tributes.   Control characters are displayed in the ^X no-
+       tation.  Printing characters are  displayed  as  is.   The
+       corresponding  wunctrl  returns a printable representation
+       of a wide character.
+
+       The keyname routine returns a character string correspond-
+       ing to the key c:
+
+          o   Printable  characters  are displayed as themselves,
+              e.g., a one-character string containing the key.
+
+          o   Control characters are displayed in  the  ^X  nota-
+              tion.
+
+          o   DEL (character 127) is displayed as ^?.
+
+          o   Values above 128 are either meta characters (if the
+              screen has not been initialized,  or  if  meta  has
+              been  called  with  a TRUE parameter), shown in the
+              M-X notation, or are displayed as  themselves.   In
+              the  latter  case, the values may not be printable;
+              this follows the X/Open specification.
+
+          o   Values above 256 may be the names of the  names  of
+              function keys.
+
+          o   Otherwise  (if  there is no corresponding name) the
+              function returns null, to denote an error.   X/Open
+              also  lists  an  "UNKNOWN  KEY" return value, which
+              some implementations return rather than null.
+
+       The corresponding key_name returns a character string cor-
+       responding  to  the wide-character value w.  The two func-
+       tions do not return the same set of  strings;  the  latter
+       returns null where the former would display a meta charac-
+       ter.
+
+       The filter routine, if used, must be called before initscr
+       or  newterm  are called.  The effect is that, during those
+       calls, LINES is set to 1;  the  capabilities  clear,  cup,
+       cud,  cud1,  cuu1,  cuu,  vpa  are  disabled; and the home
+       string is set to the value of cr.
+
+       The nofilter routine cancels the  effect  of  a  preceding
+       filter  call.   That  allows  the  caller  to initialize a
+       screen on a different device, using a different  value  of
+       $TERM.   The  limitation arises because the filter routine
+       modifies the in-memory copy of the terminal information.
+
+       The use_env routine, if used, is called before initscr  or
+       newterm  are  called.   When called with FALSE as an argu-
+       ment, the values of lines and  columns  specified  in  the
+       terminfo  database will be used, even if environment vari-
+       ables LINES and COLUMNS (used by default) are set,  or  if
+       curses  is  running in a window (in which case default be-
+       havior would be to  use  the  window  size  if  LINES  and
+       COLUMNS  are not set).  Note that setting LINES or COLUMNS
+       overrides the corresponding size  which  may  be  obtained
+       from the operating system.
+
+       The  putwin routine writes all data associated with window
+       win into the file to which filep points.  This information
+       can be later retrieved using the getwin function.
+
+       The getwin routine reads window related data stored in the
+       file by putwin.  The routine then creates and  initializes
+       a new window using that data.  It returns a pointer to the
+       new window.
+
+       The delay_output routine inserts an ms  millisecond  pause
+       in  output.   This  routine should not be used extensively
+       because padding characters are  used  rather  than  a  CPU
+       pause.   If  no  padding character is specified, this uses
+       napms to perform the delay.
+
+       The flushinp routine throws away any  typeahead  that  has
+       been  typed  by  the user and has not yet been read by the
+       program.
+
+
+
+

RETURN VALUE

+       Except for flushinp, routines that return an  integer  re-
+       turn  ERR upon failure and OK (SVr4 specifies only "an in-
+       teger value other than ERR") upon successful completion.
+
+       Routines that return pointers return NULL on error.
+
+       X/Open does not define any error conditions.  In this  im-
+       plementation
+
+          flushinp
+               returns  an error if the terminal was not initial-
+               ized.
+
+          meta returns an error if the terminal was not  initial-
+               ized.
+
+          putwin
+               returns  an  error  if the associated fwrite calls
+               return an error.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   It  states  that unctrl and wunctrl will return a
+       null pointer if unsuccessful, but does not define any  er-
+       ror conditions.  This implementation checks for three cas-
+       es:
+
+          o   the parameter is a 7-bit US-ASCII  code.   This  is
+              the case that X/Open Curses documented.
+
+          o   the  parameter  is in the range 128-159, i.e., a C1
+              control code.  If use_legacy_coding has been called
+              with  a  2 parameter, unctrl returns the parameter,
+              i.e., a one-character string with the parameter  as
+              the first character.  Otherwise, it returns ``~@'',
+              ``~A'', etc., analogous to ``^@'', ``^A'', C0  con-
+              trols.
+
+              X/Open  Curses does not document whether unctrl can
+              be called before initializing curses.  This  imple-
+              mentation  permits  that,  and  returns the ``~@'',
+              etc., values in that case.
+
+          o   parameter values outside the 0 to 255 range.   unc-
+              trl returns a null pointer.
+
+       The SVr4 documentation describes the action of filter only
+       in the vaguest terms.  The  description  here  is  adapted
+       from  the  XSI Curses standard (which erroneously fails to
+       describe the disabling of cuu).
+
+       The strings returned by unctrl in this implementation  are
+       determined  at  compile time, showing C1 controls from the
+       upper-128 codes with a `~' prefix rather than `^'.   Other
+       implementations  have different conventions.  For example,
+       they may show both sets of control  characters  with  `^',
+       and  strip the parameter to 7 bits.  Or they may ignore C1
+       controls and treat all of the upper-128  codes  as  print-
+       able.  This implementation uses 8 bits but does not modify
+       the string to reflect locale.  The use_legacy_coding func-
+       tion allows the caller to change the output of unctrl.
+
+       Likewise,  the  meta  function allows the caller to change
+       the output of keyname, i.e., it determines whether to  use
+       the  `M-' prefix for ``meta'' keys (codes in the range 128
+       to 255).  Both use_legacy_coding and meta succeed only af-
+       ter  curses  is initialized.  X/Open Curses does not docu-
+       ment the treatment of codes 128  to  159.   When  treating
+       them as ``meta'' keys (or if keyname is called before ini-
+       tializing curses),  this  implementation  returns  strings
+       ``M-^@'', ``M-^A'', etc.
+
+       The  keyname function may return the names of user-defined
+       string capabilities which are defined in the terminfo  en-
+       try  via  the -x option of tic.  This implementation auto-
+       matically assigns at  run-time  keycodes  to  user-defined
+       strings  which  begin  with  "k".   The  keycodes start at
+       KEY_MAX, but are not guaranteed to be the same  value  for
+       different  runs because user-defined codes are merged from
+       all terminal descriptions which  have  been  loaded.   The
+       use_extended_names  function controls whether this data is
+       loaded when the terminal description is read  by  the  li-
+       brary.
+
+       The  nofilter  routine is specific to ncurses.  It was not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is  recommended that any code depending on ncurses ex-
+       tensions be conditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       legacy_coding(3x), curses(3x), curs_initscr(3x), curs_ker-
+       nel(3x),   curs_scr_dump(3x),   curs_variables(3x),  lega-
+       cy_coding(3x).
+
+
+
+                                                          curs_util(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_variables.3x.html b/doc/html/man/curs_variables.3x.html new file mode 100644 index 00000000000..3cca3feef6a --- /dev/null +++ b/doc/html/man/curs_variables.3x.html @@ -0,0 +1,164 @@ + + + + +curs_variables 3x + + + + +

curs_variables 3x

+
+
+
+curs_variables(3x)                                   curs_variables(3x)
+
+
+
+
+
+

NAME

+       COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES, TABSIZE,
+       curscr, newscr, stdscr - curses global variables
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int COLOR_PAIRS;
+       int COLORS;
+       int COLS;
+       int ESCDELAY;
+       int LINES;
+       int TABSIZE;
+       WINDOW * curscr;
+       WINDOW * newscr;
+       WINDOW * stdscr;
+
+
+
+

DESCRIPTION

+       This page summarizes variables provided by the curses  li-
+       brary.   A more complete description is given in the curs-
+       es(3x) manual page.
+
+       Depending on the configuration, these may be actual  vari-
+       ables,  or  macros  (see  curs_threads(3x))  which provide
+       read-only access to curses's state.  In either  case,  ap-
+       plications should treat them as read-only to avoid confus-
+       ing the library.
+
+   COLOR_PAIRS
+       After initializing curses, this variable contains the num-
+       ber of color pairs which the terminal can support.  Usual-
+       ly the number of color pairs  will  be  the  product  COL-
+       ORS*COLORS, however this is not always true:
+
+       o   a  few  terminals  use HLS colors, which do not follow
+           this rule
+
+       o   terminals supporting a large number of colors are lim-
+           ited  by  the number of color pairs that can be repre-
+           sented in a signed short value.
+
+   COLORS
+       After initializing curses, this variable contains the num-
+       ber of colors which the terminal can support.
+
+   COLS
+       After  initializing  curses,  this  variable  contains the
+       width of the screen, i.e., the number of columns.
+
+   ESCDELAY
+       This variable holds the number of milliseconds to wait af-
+       ter reading an escape character, to distinguish between an
+       individual escape character entered on the  keyboard  from
+       escape  sequences  sent  by cursor- and function-keys (see
+       curses(3x).
+
+   LINES
+       After initializing  curses,  this  variable  contains  the
+       height of the screen, i.e., the number of lines.
+
+   TABSIZE
+       This  variable  holds  the  number  of columns used by the
+       curses library when converting a tab character  to  spaces
+       as it adds the tab to a window (see curs_addch(3x).
+
+   The Current Screen
+       This implementation of curses uses a special window curscr
+       to record its updates to the terminal screen.
+
+   The New Screen
+       This implementation of curses uses a special window newscr
+       to  hold  updates  to  the terminal screen before applying
+       them to curscr.
+
+   The Standard Screen
+       Upon initializing curses, a default window called  stdscr,
+       which  is  the  size  of  the terminal screen, is created.
+       Many curses functions use this window.
+
+
+
+

NOTES

+       The   curses   library   is   initialized   using   either
+       initscr(3x), or newterm(3x).
+
+       If  curses  is  configured to use separate curses/terminfo
+       libraries, most of these variables reside  in  the  curses
+       library.
+
+
+
+

PORTABILITY

+       ESCDELAY  and TABSIZE are extensions, not provided in most
+       other implementations of curses.
+
+
+
+

SEE ALSO

+       curses(3x), curs_threads(3x), term_variables(3x),  termin-
+       fo(3x), terminfo(5).
+
+
+
+                                                     curs_variables(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/curs_window.3x.html b/doc/html/man/curs_window.3x.html new file mode 100644 index 00000000000..d3d4ef4ae6e --- /dev/null +++ b/doc/html/man/curs_window.3x.html @@ -0,0 +1,216 @@ + + + + +curs_window 3x + + + + +

curs_window 3x

+
+
+
+curs_window(3x)                                         curs_window(3x)
+
+
+
+
+
+

NAME

+       newwin, delwin, mvwin, subwin, derwin, mvderwin, dupwin,
+       wsyncup, syncok, wcursyncup, wsyncdown - create curses
+       windows
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       WINDOW *newwin(int nlines, int ncols, int begin_y,
+             int begin_x);
+       int delwin(WINDOW *win);
+       int mvwin(WINDOW *win, int y, int x);
+       WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
+             int begin_y, int begin_x);
+       WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
+             int begin_y, int begin_x);
+       int mvderwin(WINDOW *win, int par_y, int par_x);
+       WINDOW *dupwin(WINDOW *win);
+       void wsyncup(WINDOW *win);
+       int syncok(WINDOW *win, bool bf);
+       void wcursyncup(WINDOW *win);
+       void wsyncdown(WINDOW *win);
+
+
+
+

DESCRIPTION

+       Calling newwin creates and returns a pointer to a new win-
+       dow with the given number of lines and columns.  The upper
+       left-hand  corner of the window is at line begin_y, column
+       begin_x.  If either nlines or ncols is zero, they  default
+       to  LINES - begin_y and COLS - begin_x.  A new full-screen
+       window is created by calling newwin(0,0,0,0).
+
+       Calling delwin deletes the named window, freeing all memo-
+       ry associated with it (it does not actually erase the win-
+       dow's screen image).  Subwindows must  be  deleted  before
+       the main window can be deleted.
+
+       Calling mvwin moves the window so that the upper left-hand
+       corner is at position (x, y).  If the move would cause the
+       window to be off the screen, it is an error and the window
+       is not moved.  Moving subwindows is allowed, but should be
+       avoided.
+
+       Calling subwin creates and returns a pointer to a new win-
+       dow with the given number of lines, nlines,  and  columns,
+       ncols.   The  window  is at position (begin_y, begin_x) on
+       the screen.  (This position is relative to the screen, and
+       not to the window orig.)  The window is made in the middle
+       of the window orig, so that changes  made  to  one  window
+       will  affect  both  windows.   The subwindow shares memory
+       with the window orig.  When using this routine, it is nec-
+       essary  to call touchwin or touchline on orig before call-
+       ing wrefresh on the subwindow.
+
+       Calling derwin is the same as calling subwin, except  that
+       begin_y and begin_x are relative to the origin of the win-
+       dow orig rather than the screen.  There is  no  difference
+       between the subwindows and the derived windows.
+
+       Calling mvderwin moves a derived window (or subwindow) in-
+       side its parent window.  The screen-relative parameters of
+       the  window are not changed.  This routine is used to dis-
+       play different parts of the  parent  window  at  the  same
+       physical position on the screen.
+
+       Calling  dupwin  creates  an exact duplicate of the window
+       win.
+
+       Calling wsyncup touches all locations in ancestors of  win
+       that  are changed in win.  If syncok is called with second
+       argument TRUE then wsyncup is called automatically whenev-
+       er there is a change in the window.
+
+       The  wsyncdown  routine  touches each location in win that
+       has been touched in any of  its  ancestor  windows.   This
+       routine  is  called by wrefresh, so it should almost never
+       be necessary to call it manually.
+
+       The routine wcursyncup updates the current cursor position
+       of  all the ancestors of the window to reflect the current
+       cursor position of the window.
+
+
+
+

RETURN VALUE

+       Routines that return an integer return the integer ERR up-
+       on  failure  and OK (SVr4 only specifies "an integer value
+       other than ERR") upon successful completion.
+
+       Routines that return pointers return NULL on error.
+
+       X/Open defines no error conditions.  In  this  implementa-
+       tion
+
+              delwin
+                   returns  an  error  if  the  window pointer is
+                   null, or if the window is the parent of anoth-
+                   er window.
+
+                   This  implementation  also maintains a list of
+                   windows, and checks that the pointer passed to
+                   delwin  is  one  that it created, returning an
+                   error if it was not..
+
+              mvderwin
+                   returns an error  if  the  window  pointer  is
+                   null,  or  if some part of the window would be
+                   placed off-screen.
+
+              mvwin
+                   returns an error  if  the  window  pointer  is
+                   null,  or if the window is really a pad, or if
+                   some part of the window would be  placed  off-
+                   screen.
+
+              syncok
+                   returns  an  error  if  the  window pointer is
+                   null.
+
+
+
+

NOTES

+       If many small changes are made to the window, the  wsyncup
+       option could degrade performance.
+
+       Note that syncok may be a macro.
+
+
+
+

BUGS

+       The  subwindow  functions (subwin, derwin, mvderwin, wsyn-
+       cup, wsyncdown, wcursyncup, syncok) are flaky, incomplete-
+       ly implemented, and not well tested.
+
+       The  System  V  curses documentation is very unclear about
+       what wsyncup and wsyncdown actually do.  It seems to imply
+       that  they  are only supposed to touch exactly those lines
+       that are affected by ancestor changes.  The language here,
+       and  the  behavior  of  the curses implementation, is pat-
+       terned on the XPG4 curses standard.  The weaker XPG4  spec
+       may result in slower updates.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+
+
+

SEE ALSO

+       curses(3x), curs_refresh(3x),  curs_touch(3x),  curs_vari-
+       ables(3x)
+
+
+
+                                                        curs_window(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/default_colors.3x.html b/doc/html/man/default_colors.3x.html new file mode 100644 index 00000000000..f0e44e2fc60 --- /dev/null +++ b/doc/html/man/default_colors.3x.html @@ -0,0 +1,180 @@ + + + + +default_colors 3x + + + + +

default_colors 3x

+
+
+
+default_colors(3x)                                   default_colors(3x)
+
+
+
+
+
+

NAME

+       use_default_colors, assume_default_colors - use terminal's
+       default colors
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int use_default_colors(void);
+       int assume_default_colors(int fg, int bg);
+
+
+
+

DESCRIPTION

+       The use_default_colors() and assume_default_colors() func-
+       tions are extensions to the curses library.  They are used
+       with terminals that support ISO 6429 color, or equivalent.
+       These terminals allow the application to reset color to an
+       unspecified default value (e.g., with SGR 39 or SGR 49).
+
+       Applications that paint  a  colored  background  over  the
+       whole  screen  do not take advantage of SGR 39 and SGR 49.
+       Some applications are designed to work  with  the  default
+       background,  using  colors  only  for  text.  For example,
+       there are several implementations of the ls program  which
+       use  colors to denote different file types or permissions.
+       These "color ls" programs do not  necessarily  modify  the
+       background  color, typically using only the setaf terminfo
+       capability  to  set  the  foreground  color.   Full-screen
+       applications  that  use default colors can achieve similar
+       visual effects.
+
+       The first function, use_default_colors() tells the  curses
+       library  to  assign terminal default foreground/background
+       colors to color number  -1.  So  init_pair(x,COLOR_RED,-1)
+       will  initialize  pair  x as red on default background and
+       init_pair(x,-1,COLOR_BLUE)  will  initialize  pair  x   as
+       default foreground on blue.
+
+       The  other,  assume_default_colors() is a refinement which
+       tells which colors to paint for color pair 0.  This  func-
+       tion  recognizes  a special color number -1, which denotes
+       the default terminal color.
+
+       The following are equivalent:
+              use_default_colors();
+              assume_default_colors(-1,-1);
+
+       These are ncurses extensions.  For other curses  implemen-
+       tations,  color  number -1 does not mean anything, just as
+       for ncurses before a successful call  of  use_default_col-
+       ors() or assume_default_colors().
+
+       Other  curses  implementations do not allow an application
+       to modify color pair 0.  They assume that  the  background
+       is COLOR_BLACK, but do not ensure that the color pair 0 is
+       painted to match the assumption.  If your application does
+       not use either use_default_colors() or assume_default_col-
+       ors() ncurses will paint a white  foreground  (text)  with
+       black background for color pair 0.
+
+
+
+

RETURN VALUE

+       These functions return the integer ERR upon failure and OK
+       on success.  They will fail if either  the  terminal  does
+       not  support  the orig_pair or orig_colors capability.  If
+       the initialize_pair capability is not found,  this  causes
+       an error as well.
+
+
+
+

NOTES

+       Associated  with  this  extension,  the init_pair function
+       accepts negative arguments to specify  default  foreground
+       or background colors.
+
+       The  use_default_colors()  function  was  added to support
+       ded.  This is a full-screen application which uses  curses
+       to  manage only part of the screen.  The bottom portion of
+       the screen, which is of adjustable size, is left uncolored
+       to  display the results from shell commands.  The top por-
+       tion of the screen colors filenames using  a  scheme  like
+       the  "color  ls" programs.  Attempting to manage the back-
+       ground color of the screen for this application would give
+       unsatisfactory  results  for  a  variety of reasons.  This
+       extension was devised after noting that color  xterm  (and
+       similar  programs)  provides a background color which does
+       not necessarily correspond to  any  of  the  ANSI  colors.
+       While  a special terminfo entry could be constructed using
+       nine colors, there was no mechanism provided within curses
+       to  account for the related orig_pair and back_color_erase
+       capabilities.
+
+       The assume_default_colors() function was added to solve  a
+       different  problem:  support  for applications which would
+       use  environment  variables  and  other  configuration  to
+       bypass  curses'  notion  of the terminal's default colors,
+       setting specific values.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       curs_color(3x), ded(1).
+
+
+
+

AUTHOR

+       Thomas  Dickey  (from  an analysis of the requirements for
+       color xterm for XFree86 3.1.2C, February 1996).
+
+
+
+                                                     default_colors(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/define_key.3x.html b/doc/html/man/define_key.3x.html new file mode 100644 index 00000000000..8556833bd01 --- /dev/null +++ b/doc/html/man/define_key.3x.html @@ -0,0 +1,111 @@ + + + + +define_key 3x + + + + +

define_key 3x

+
+
+
+define_key(3x)                                           define_key(3x)
+
+
+
+
+
+

NAME

+       define_key - define a keycode
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int define_key(const char *definition, int keycode);
+
+
+
+

DESCRIPTION

+       This is an extension to the curses library.  It permits an
+       application to define keycodes  with  their  corresponding
+       control  strings,  so that the ncurses library will inter-
+       pret them just as it would the  predefined  codes  in  the
+       terminfo database.
+
+       If  the  given string is null, any existing definition for
+       the keycode is removed.  Similarly, if the  given  keycode
+       is  negative  or  zero,  any existing string for the given
+       definition is removed.
+
+
+
+

RETURN VALUE

+       The keycode must be greater than zero, and the string non-
+       null, otherwise ERR is returned.  ERR may also be returned
+       if there is insufficient memory to allocate  the  data  to
+       store  the  definition.   If  no  error is detected, OK is
+       returned.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       keyok(3x), key_defined(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey.
+
+
+
+                                                         define_key(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html new file mode 100644 index 00000000000..38f14c49e80 --- /dev/null +++ b/doc/html/man/form.3x.html @@ -0,0 +1,258 @@ + + + + +form 3x + + + + +

form 3x

+
+
+
+form(3x)                                                       form(3x)
+
+
+
+
+
+

NAME

+       form - curses extension for programming forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+
+
+
+

DESCRIPTION

+       The  form library provides terminal-independent facilities
+       for composing form screens  on  character-cell  terminals.
+       The  library  includes:  field  routines, which create and
+       modify form fields; and form routines, which group  fields
+       into forms, display forms on the screen, and handle inter-
+       action with the user.
+
+       The form library uses the curses libraries.   To  use  the
+       form library, link with the options -lform -lcurses.
+
+       Your program should set up the locale, e.g.,
+
+            setlocale(LC_ALL, "");
+
+       so that input/output processing will work.
+
+       A  curses  initialization  routine such as initscr must be
+       called before using any of these functions.
+
+   Current Default Values for Field Attributes
+       The form library  maintains  a  default  value  for  field
+       attributes.   You  can  get or set this default by calling
+       the appropriate set_ or  retrieval  routine  with  a  NULL
+       field pointer.  Changing this default with a set_ function
+       affects future field creations, but does  not  change  the
+       rendering of fields already created.
+
+   Routine Name Index
+       The  following  table lists each form routine and the name
+       of the manual page on which it is described.
+
+       curses Routine Name    Manual Page Name
+       -------------------------------------------------
+       current_field          form_page(3x)
+       data_ahead             form_data(3x)
+       data_behind            form_data(3x)
+       dup_field              form_field_new(3x)
+       dynamic_field_info     form_field_info(3x)
+       field_arg              form_field_validation(3x)
+       field_back             form_field_attributes(3x)
+       field_buffer           form_field_buffer(3x)
+       field_count            form_field(3x)
+       field_fore             form_field_attributes(3x)
+       field_index            form_page(3x)
+       field_info             form_field_info(3x)
+       field_init             form_hook(3x)
+       field_just             form_field_just(3x)
+       field_opts             form_field_opts(3x)
+       field_opts_off         form_field_opts(3x)
+       field_opts_on          form_field_opts(3x)
+       field_pad              form_field_attributes(3x)
+       field_status           form_field_buffer(3x)
+       field_term             form_hook(3x)
+       field_type             form_field_validation(3x)
+
+       field_userptr          form_field_userptr(3x)
+       form_driver            form_driver(3x)
+       form_fields            form_field(3x)
+       form_init              form_hook(3x)
+       form_opts              form_opts(3x)
+       form_opts_off          form_opts(3x)
+       form_opts_on           form_opts(3x)
+       form_page              form_page(3x)
+       form_request_by_name   form_requestname(3x)
+       form_request_name      form_requestname(3x)
+       form_sub               form_win(3x)
+       form_term              form_hook(3x)
+       form_userptr           form_userptr(3x)
+       form_win               form_win(3x)
+       free_field             form_field_new(3x)
+       free_fieldtype         form_fieldtype(3x)
+       free_form              form_new(3x)
+       link_field             form_field_new(3x)
+       link_fieldtype         form_fieldtype(3x)
+       move_field             form_field(3x)
+       new_field              form_field_new(3x)
+       new_fieldtype          form_fieldtype(3x)
+       new_form               form_new(3x)
+       new_page               form_new_page(3x)
+       pos_form_cursor        form_cursor(3x)
+       post_form              form_post(3x)
+       scale_form             form_win(3x)
+       set_current_field      form_page(3x)
+       set_field_back         form_field_attributes(3x)
+       set_field_buffer       form_field_buffer(3x)
+       set_field_fore         form_field_attributes(3x)
+       set_field_init         form_hook(3x)
+       set_field_just         form_field_just(3x)
+       set_field_opts         form_field_opts(3x)
+       set_field_pad          form_field_attributes(3x)
+       set_field_status       form_field_buffer(3x)
+       set_field_term         form_hook(3x)
+       set_field_type         form_field_validation(3x)
+       set_field_userptr      form_field_userptr(3x)
+       set_fieldtype_arg      form_fieldtype(3x)
+       set_fieldtype_choice   form_fieldtype(3x)
+       set_form_fields        form_field(3x)
+       set_form_init          form_hook(3x)
+       set_form_opts          form_field_opts(3x)
+       set_form_page          form_page(3x)
+       set_form_sub           form_win(3x)
+       set_form_term          form_hook(3x)
+       set_form_userptr       form_userptr(3x)
+       set_form_win           form_win(3x)
+       set_max_field          form_field_buffer(3x)
+       set_new_page           form_new_page(3x)
+       unpost_form            form_post(3x)
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL  on  error,  and
+       set  errno  to  the  corresponding  error-code returned by
+       functions returning an integer.  Routines that  return  an
+       integer return one of the following error codes:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+       E_INVALID_FIELD
+            Contents of a field are not valid.
+
+       E_NOT_CONNECTED
+            No fields are connected to the form.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_NO_ROOM
+            Form is too large for its window.
+
+       E_POSTED
+            The form is already posted.
+
+       E_REQUEST_DENIED
+            The form driver could not process the request.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_UNKNOWN_COMMAND
+            The form driver code saw an unknown request code.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       files <curses.h> and <eti.h>.
+
+       In  your  library  list,  libform.a should be before libn-
+       curses.a; that is, you want to say `-lform -lncurses', not
+       the  other  way  around (which would give you a link error
+       using most linkers).
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.  Manual pages and adaptation for ncurses
+       by Eric S. Raymond.
+
+
+
+

SEE ALSO

+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                               form(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_cursor.3x.html b/doc/html/man/form_cursor.3x.html new file mode 100644 index 00000000000..04de65a5b47 --- /dev/null +++ b/doc/html/man/form_cursor.3x.html @@ -0,0 +1,118 @@ + + + + +form_cursor 3x + + + + +

form_cursor 3x

+
+
+
+form_cursor(3x)                                         form_cursor(3x)
+
+
+
+
+
+

NAME

+       form_cursor - position a form window cursor
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int pos_form_cursor(FORM *form);
+
+
+
+

DESCRIPTION

+       The  function  pos_form_cursor  restores the cursor to the
+       position required for the forms driver  to  continue  pro-
+       cessing  requests.   This  is useful after curses routines
+       have been called to do screen-painting in  response  to  a
+       form operation.
+
+
+
+

RETURN VALUE

+       This routine returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                        form_cursor(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_data.3x.html b/doc/html/man/form_data.3x.html new file mode 100644 index 00000000000..f181a9a3716 --- /dev/null +++ b/doc/html/man/form_data.3x.html @@ -0,0 +1,104 @@ + + + + +form_data 3x + + + + +

form_data 3x

+
+
+
+form_data(3x)                                             form_data(3x)
+
+
+
+
+
+

NAME

+       form_data - test for off-screen data in given forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       bool data_ahead(const FORM *form);
+       bool data_behind(const FORM *form);
+
+
+
+

DESCRIPTION

+       The  function data_ahead tests whether there is off-screen
+       data ahead in the given form.   It  returns  TRUE  (1)  or
+       FALSE (0).
+
+       The function data_behind tests whether there is off-screen
+       data behind in the given form.  It  returns  TRUE  (1)  or
+       FALSE (0).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          form_data(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_driver.3x.html b/doc/html/man/form_driver.3x.html new file mode 100644 index 00000000000..ab9a263787d --- /dev/null +++ b/doc/html/man/form_driver.3x.html @@ -0,0 +1,375 @@ + + + + +form_driver 3x + + + + +

form_driver 3x

+
+
+
+form_driver(3x)                                         form_driver(3x)
+
+
+
+
+
+

NAME

+       form_driver - command-processing loop of the form system
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int form_driver(FORM *form, int c);
+
+
+
+

DESCRIPTION

+       Once a form has been posted (displayed), you should funnel
+       input events to it through form_driver.  This routine  has
+       three major input cases:
+
+       o   The  input  is  a form navigation request.  Navigation
+           request codes are constants defined in <form.h>, which
+           are   distinct  from  the  key-  and  character  codes
+           returned by wgetch.
+
+       o   The input is a printable character.  Printable charac-
+           ters  (which  must  be  positive,  less  than 256) are
+           checked according to the program's locale settings.
+
+       o   The input is the KEY_MOUSE special key associated with
+           an mouse event.
+
+       The form driver requests are as follows:
+
+       REQ_NEXT_PAGE
+            Move to the next page.
+
+       REQ_PREV_PAGE
+            Move to the previous page.
+
+       REQ_FIRST_PAGE
+            Move to the first page.
+
+       REQ_LAST_PAGE
+            Move to the last field.
+
+
+       REQ_NEXT_FIELD
+            Move to the next field.
+
+       REQ_PREV_FIELD
+            Move to the previous field.
+
+       REQ_FIRST_FIELD
+            Move to the first field.
+
+       REQ_LAST_FIELD
+            Move to the last field.
+
+       REQ_SNEXT_FIELD
+            Move to the sorted next field.
+
+       REQ_SPREV_FIELD
+            Move to the sorted previous field.
+
+       REQ_SFIRST_FIELD
+            Move to the sorted first field.
+
+       REQ_SLAST_FIELD
+            Move to the sorted last field.
+
+       REQ_LEFT_FIELD
+            Move left to a field.
+
+       REQ_RIGHT_FIELD
+            Move right to a field.
+
+       REQ_UP_FIELD
+            Move up to a field.
+
+       REQ_DOWN_FIELD
+            Move down to a field.
+
+
+       REQ_NEXT_CHAR
+            Move to the next char.
+
+       REQ_PREV_CHAR
+            Move to the previous char.
+
+       REQ_NEXT_LINE
+            Move to the next line.
+
+       REQ_PREV_LINE
+            Move to the previous line.
+
+       REQ_NEXT_WORD
+            Move to the next word.
+
+       REQ_PREV_WORD
+            Move to the previous word.
+
+       REQ_BEG_FIELD
+            Move to the beginning of the field.
+
+       REQ_END_FIELD
+            Move to the end of the field.
+
+       REQ_BEG_LINE
+            Move to the beginning of the line.
+
+       REQ_END_LINE
+            Move to the end of the line.
+
+       REQ_LEFT_CHAR
+            Move left in the field.
+
+       REQ_RIGHT_CHAR
+            Move right in the field.
+
+       REQ_UP_CHAR
+            Move up in the field.
+
+       REQ_DOWN_CHAR
+            Move down in the field.
+
+
+       REQ_NEW_LINE
+            Insert or overlay a new line.
+
+       REQ_INS_CHAR
+            Insert a blank at the cursor.
+
+       REQ_INS_LINE
+            Insert a blank line at the cursor.
+
+       REQ_DEL_CHAR
+            Delete character at the cursor.
+
+       REQ_DEL_PREV
+            Delete character before the cursor.
+
+       REQ_DEL_LINE
+            Delete line at the cursor.
+
+       REQ_DEL_WORD
+            Delete blank-delimited word at the cursor.
+
+       REQ_CLR_EOL
+            Clear to end of line from cursor.
+
+       REQ_CLR_EOF
+            Clear to end of field from cursor.
+
+       REQ_CLR_FIELD
+            Clear the entire field.
+
+       REQ_OVL_MODE
+            Enter overlay mode.
+
+       REQ_INS_MODE
+            Enter insert mode.
+
+
+       REQ_SCR_FLINE
+            Scroll the field forward a line.
+
+       REQ_SCR_BLINE
+            Scroll the field backward a line.
+
+       REQ_SCR_FPAGE
+            Scroll the field forward a page.
+
+       REQ_SCR_BPAGE
+            Scroll the field backward a page.
+
+       REQ_SCR_FHPAGE
+            Scroll the field forward half a page.
+
+       REQ_SCR_BHPAGE
+            Scroll the field backward half a page.
+
+
+       REQ_SCR_FCHAR
+            Scroll the field forward a character.
+
+       REQ_SCR_BCHAR
+            Scroll the field backward a character.
+
+       REQ_SCR_HFLINE
+            Horizontal scroll the field forward a line.
+
+       REQ_SCR_HBLINE
+            Horizontal scroll the field backward a line.
+
+       REQ_SCR_HFHALF
+            Horizontal scroll the field forward half a line.
+
+       REQ_SCR_HBHALF
+            Horizontal scroll the field backward half a line.
+
+
+       REQ_VALIDATION
+            Validate field.
+
+       REQ_NEXT_CHOICE
+            Display next field choice.
+
+       REQ_PREV_CHOICE
+            Display previous field choice.
+
+       If  the  second  argument  is  a  printable character, the
+       driver places it in the current position  in  the  current
+       field.   If  it is one of the forms requests listed above,
+       that request is executed.
+
+   MOUSE HANDLING
+       If the second argument is the KEY_MOUSE special  key,  the
+       associated mouse event is translated into one of the above
+       pre-defined requests.  Currently only clicks in  the  user
+       window  (e.g., inside the form display area or the decora-
+       tion window) are handled.
+
+       If you click above the display region of the form:
+
+          a REQ_PREV_FIELD is generated for a single click,
+
+          a REQ_PREV_PAGE is generated for a double-click and
+
+          a REQ_FIRST_FIELD is generated for a triple-click.
+
+       If you click below the display region of the form:
+
+          a REQ_NEXT_FIELD is generated for a single click,
+
+          a REQ_NEXT_PAGE is generated for a double-click and
+
+          a REQ_LAST_FIELD is generated for a triple-click.
+
+       If you click at an field inside the display  area  of  the
+       form:
+
+          o   the form cursor is positioned to that field.
+
+          o   If  you  double-click  a  field, the form cursor is
+              positioned to that field and  E_UNKNOWN_COMMAND  is
+              returned.  This return value makes sense, because a
+              double click usually means that  an  field-specific
+              action  should be returned.  It is exactly the pur-
+              pose of this return value to signal that an  appli-
+              cation specific command should be executed.
+
+          o   If   a   translation   into  a  request  was  done,
+              form_driver returns the result of this request.
+
+       If you clicked outside the user window or the mouse  event
+       could   not   be   translated   into  a  form  request  an
+       E_REQUEST_DENIED is returned.
+
+   APPLICATION-DEFINED COMMANDS
+       If the second argument is neither printable nor one of the
+       above  pre-defined form requests, the driver assumes it is
+       an application-specific command and returns E_UNKNOWN_COM-
+       MAND.  Application-defined commands should be defined rel-
+       ative to MAX_COMMAND, the  maximum  value  of  these  pre-
+       defined requests.
+
+
+
+

RETURN VALUE

+       form_driver returns one of the following error codes:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_INVALID_FIELD
+            Contents of field is invalid.
+
+       E_REQUEST_DENIED
+            The form driver could not process the request.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_UNKNOWN_COMMAND
+            The form driver code saw an unknown request code.
+
+
+
+

SEE ALSO

+       curses(3x), form(3x), form_variables(3x), getch(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       files <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                        form_driver(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field.3x.html b/doc/html/man/form_field.3x.html new file mode 100644 index 00000000000..0e7f8214088 --- /dev/null +++ b/doc/html/man/form_field.3x.html @@ -0,0 +1,142 @@ + + + + +form_field 3x + + + + +

form_field 3x

+
+
+
+form_field(3x)                                           form_field(3x)
+
+
+
+
+
+

NAME

+       form_field - make and break connections between fields and
+       forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_fields(FORM *form, FIELD **fields);
+       FIELD **form_fields(const FORM *form);
+       int field_count(const FORM *form);
+       int move_field(FIELD *field, int frow, int fcol);
+
+
+
+

DESCRIPTION

+       The function set_form_fields  changes  the  field  pointer
+       array  of the given form.  The array must be terminated by
+       a NULL.
+
+       The function form_fields returns the field  array  of  the
+       given form.
+
+       The  function  field_count  returns the count of fields in
+       form.
+
+       The function move_field moves the given field (which  must
+       be disconnected) to a specified location on the screen.
+
+
+
+

RETURN VALUES

+       The  function  form_fields returns a pointer (which may be
+       NULL).  It does not set errno.
+
+       The function field_count returns ERR if the form parameter
+       is NULL.
+
+       The functions set_form_fields and move_field return one of
+       the following codes on error:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+       E_POSTED
+            The form is already posted.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       The   SVr4   forms  library  documentation  specifies  the
+       field_count error value as -1 (which is the value of ERR).
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                         form_field(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_attributes.3x.html b/doc/html/man/form_field_attributes.3x.html new file mode 100644 index 00000000000..36b93e5d8a0 --- /dev/null +++ b/doc/html/man/form_field_attributes.3x.html @@ -0,0 +1,130 @@ + + + + +form_field_attributes 3x + + + + +

form_field_attributes 3x

+
+
+
+form_field_attributes(3x)                     form_field_attributes(3x)
+
+
+
+
+
+

NAME

+       form_field_attributes  -  color  and attribute control for
+       form fields
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_fore(FIELD *field, chtype attr);
+       chtype field_fore(const FIELD *field);
+       int set_field_back(FIELD *field, chtype attr);
+       chtype field_back(const FIELD *field);
+       int set_field_pad(FIELD *field, int pad);
+       int field_pad(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The function set_field_fore sets the foreground  attribute
+       of  field. This is the highlight used to display the field
+       contents.  The function field_fore returns the  foreground
+       attribute.  The default is A_STANDOUT.
+
+       The  function set_field_back sets the background attribute
+       of form. This is the highlight used to display the  extent
+       fields  in  the form.  The function field_back returns the
+       background attribute.  The default is A_NORMAL.
+
+       The function set_field_pad sets the character used to fill
+       the  field.   The  function  field_pad  returns  the given
+       form's pad character.  The default is a blank.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                              form_field_attributes(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_buffer.3x.html b/doc/html/man/form_field_buffer.3x.html new file mode 100644 index 00000000000..fe6b531f44d --- /dev/null +++ b/doc/html/man/form_field_buffer.3x.html @@ -0,0 +1,179 @@ + + + + +form_field_buffer 3x + + + + +

form_field_buffer 3x

+
+
+
+form_field_buffer(3x)                             form_field_buffer(3x)
+
+
+
+
+
+

NAME

+       form_field_buffer - field buffer control
+
+
+
+

SYNOPSIS

+       #include <form.h>
+
+       int  set_field_buffer(FIELD  *field,  int  buf, const char
+       *value);
+       char *field_buffer(const FIELD *field, int buffer);
+       int set_field_status(FIELD *field, bool status);
+       bool field_status(const FIELD *field);
+       int set_max_field(FIELD *field, int max);
+
+
+
+

DESCRIPTION

+       The function set_field_buffer sets the numbered buffer  of
+       the given field to contain a given string:
+
+          o   Buffer 0 is the displayed value of the field.
+
+          o   Other numbered buffers may be allocated by applica-
+              tions   through   the   nbuf   argument   of   (see
+              form_field_new(3x))  but are not manipulated by the
+              forms library.
+
+       The function field_buffer returns a pointer  to  the  con-
+       tents of the given numbered buffer:
+
+          o   The  buffer  contents  always have the same length,
+              and are padded with trailing spaces  as  needed  to
+              ensure this length is the same.
+
+          o   The buffer may contain leading spaces, depending on
+              how it was set.
+
+          o   The buffer contents are set with  set_field_buffer,
+              or  as  a  side effect of any editing operations on
+              the corresponding field.
+
+          o   Editing operations are based on  the  window  which
+              displays the field, rather than a string.  The win-
+              dow contains  only  printable  characters,  and  is
+              filled  with blanks.  If you want the raw data, you
+              must write your own routine that copies  the  value
+              out  of  the  buffer  and  removes  the leading and
+              trailing spaces.
+
+          o   Because editing operations change  the  content  of
+              the  buffer to correspond to the window, you should
+              not rely on using buffers for long-term storage  of
+              form data.
+
+       The  function  set_field_status sets the associated status
+       flag of field; field_status gets the current  value.   The
+       status  flag  is set to a nonzero value whenever the field
+       changes.
+
+       The function set_max_field sets the  maximum  size  for  a
+       dynamic  field.   An  argument  of 0 turns off any maximum
+       size threshold for that field.
+
+
+
+

RETURN VALUE

+       The field_buffer function returns NULL on error.  It  sets
+       errno according to their success:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       The field_status function returns TRUE or FALSE.
+
+       The remaining routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file
+
+       When  configured for wide characters, field_buffer returns
+       a pointer to temporary storage (allocated and freed by the
+       library).   The  application  should not attempt to modify
+       the  data.   It  will  be  freed  on  the  next  call   to
+       field_buffer to return the same buffer.  <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                  form_field_buffer(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_info.3x.html b/doc/html/man/form_field_info.3x.html new file mode 100644 index 00000000000..eec55563190 --- /dev/null +++ b/doc/html/man/form_field_info.3x.html @@ -0,0 +1,129 @@ + + + + +form_field_info 3x + + + + +

form_field_info 3x

+
+
+
+form_field_info(3x)                                 form_field_info(3x)
+
+
+
+
+
+

NAME

+       form_field_info - retrieve field characteristics
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int field_info(const FIELD *field, int *rows, int *cols,
+                     int *frow, int *fcol, int *nrow, int *nbuf);
+       int  dynamic_field_info(const FIELD *field, int *rows, int
+       *cols, int *max);
+
+
+
+

DESCRIPTION

+       The  function  field_info  returns  the  sizes  and  other
+       attributes  passed  in  to the field at its creation time.
+       The attributes are: height, width, row of upper-left  cor-
+       ner,  column of upper-left corner, number off-screen rows,
+       and number of working buffers.
+
+       The function dynamic_field_info returns the actual size of
+       the  field,  and  its maximum possible size.  If the field
+       has no size limit, the location  addressed  by  the  third
+       argument will be set to 0.  A field can be made dynamic by
+       turning off the O_STATIC option with field_opts_off.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+       A null (zero pointer) is accepted for any  of  the  return
+       values,  to  ignore  that  value.  Not all implementations
+       allow this, e.g., Solaris 2.7 does not.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                    form_field_info(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_just.3x.html b/doc/html/man/form_field_just.3x.html new file mode 100644 index 00000000000..62dab7569dc --- /dev/null +++ b/doc/html/man/form_field_just.3x.html @@ -0,0 +1,119 @@ + + + + +form_field_just 3x + + + + +

form_field_just 3x

+
+
+
+form_field_just(3x)                                 form_field_just(3x)
+
+
+
+
+
+

NAME

+       form_field_just - retrieve field characteristics
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_just(FIELD *field, int justification);
+       int field_just(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The   function   set_field_just   sets  the  justification
+       attribute of a field; field_just returns a field's  justi-
+       fication attribute.  The attribute may be one of NO_JUSTI-
+       FICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
+
+
+
+

RETURN VALUE

+       The function field_just returns one of:  NO_JUSTIFICATION,
+       JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
+
+       The function set_field_just returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                    form_field_just(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_new.3x.html b/doc/html/man/form_field_new.3x.html new file mode 100644 index 00000000000..66b8d80669a --- /dev/null +++ b/doc/html/man/form_field_new.3x.html @@ -0,0 +1,150 @@ + + + + +form_field_new 3x + + + + +

form_field_new 3x

+
+
+
+form_field_new(3x)                                   form_field_new(3x)
+
+
+
+
+
+

NAME

+       form_field_new - create and destroy form fields
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       FIELD *new_field(int height, int width,
+                        int toprow, int leftcol,
+                        int offscreen, int nbuffers);
+       FIELD *dup_field(FIELD *field, int toprow, int leftcol);
+       FIELD *link_field(FIELD *field, int toprow, int leftcol);
+       int free_field(FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function new_field allocates a new field and initial-
+       izes it from the parameters given: height, width,  row  of
+       upper-left  corner,  column  of  upper-left corner, number
+       off-screen rows, and number of additional working buffers.
+
+       The function dup_field duplicates a field at a  new  loca-
+       tion.   Most attributes (including current contents, size,
+       validation type, buffer count, growth threshold,  justifi-
+       cation,  foreground,  background,  pad character, options,
+       and user pointer) are copied.  Field status and the  field
+       page bit are not copied.
+
+       The  function  link_field acts like dup_field, but the new
+       field shares buffers with its parent.  Attribute  data  is
+       separate.
+
+       The  function  free_field  de-allocates storage associated
+       with a field.
+
+
+
+

RETURN VALUE

+       The function, new_field, dup_field, link_field return NULL
+       on error.  They set errno according to their success:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_SYSTEM_ERROR
+            System error occurred, e.g., malloc failure.
+
+       The function free_field returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_CONNECTED
+            field is connected.
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       It  may be unwise to count on the set of attributes copied
+       by dup_field being portable; the System  V  forms  library
+       documents are not very explicit about what gets copied and
+       what does not.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                     form_field_new(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_opts.3x.html b/doc/html/man/form_field_opts.3x.html new file mode 100644 index 00000000000..5463815aa61 --- /dev/null +++ b/doc/html/man/form_field_opts.3x.html @@ -0,0 +1,168 @@ + + + + +form_field_opts 3x + + + + +

form_field_opts 3x

+
+
+
+form_field_opts(3x)                                 form_field_opts(3x)
+
+
+
+
+
+

NAME

+       form_field_opts - set and get field options
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_opts(FIELD *field, Field_Options opts);
+       int field_opts_on(FIELD *field, Field_Options opts);
+       int field_opts_off(FIELD *field, Field_Options opts);
+       Field_Options field_opts(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_field_opts  sets  all the given field's
+       option bits (field  option  bits  may  be  logically-OR'ed
+       together).
+
+       The function field_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function field_opts_off turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The function field_opts returns the field's current option
+       bits.
+
+       The following options are defined (all are on by default):
+
+       O_VISIBLE
+            The field is displayed.  If this option is off,  dis-
+            play of the field is suppressed.
+
+       O_ACTIVE
+            The  field  is  visited  during  processing.  If this
+            option is off, the field will  not  be  reachable  by
+            navigation  keys.  Please  notice  that  an invisible
+            field appears to be inactive also.
+
+       O_PUBLIC
+            The field contents are displayed as data is entered.
+
+       O_EDIT
+            The field can be edited.
+
+       O_WRAP
+            Words that do not fit on a line are  wrapped  to  the
+            next line.  Words are blank-separated.
+
+       O_BLANK
+            The  field is cleared whenever a character is entered
+            at the first position.
+
+       O_AUTOSKIP
+            Skip to the next field when this one fills.
+
+       O_NULLOK
+            Allow a blank field.
+
+       O_STATIC
+            Field buffers are fixed  to  field's  original  size.
+            Turn this option off to create a dynamic field.
+
+       O_PASSOK
+            Validate field only if modified by user.
+
+
+
+

RETURN VALUE

+       Except  for  field_opts,  each  routine returns one of the
+       following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_CURRENT
+            The field is the current field.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                    form_field_opts(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_userptr.3x.html b/doc/html/man/form_field_userptr.3x.html new file mode 100644 index 00000000000..787e672f0a3 --- /dev/null +++ b/doc/html/man/form_field_userptr.3x.html @@ -0,0 +1,112 @@ + + + + +form_field_userptr 3x + + + + +

form_field_userptr 3x

+
+
+
+form_field_userptr(3x)                           form_field_userptr(3x)
+
+
+
+
+
+

NAME

+       form_field_userptr  -  associate  application  data with a
+       form field
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_userptr(FIELD *field, void*userptr);
+       void *field_userptr(const FIELD *field);
+
+
+
+

DESCRIPTION

+       Every form field has a field that  can  be  used  to  hold
+       application-specific  data  (that is, the form-driver code
+       leaves it alone).  These functions get and set that field.
+
+
+
+

RETURN VALUE

+       The function field_userptr returns a pointer (which may be
+       NULL).  It does not set errno.
+
+       The function set_field_userptr returns E_OK (success).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer is a void pointer.  We chose not to leave
+       it as a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                 form_field_userptr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_field_validation.3x.html b/doc/html/man/form_field_validation.3x.html new file mode 100644 index 00000000000..e810402edcf --- /dev/null +++ b/doc/html/man/form_field_validation.3x.html @@ -0,0 +1,195 @@ + + + + +form_field_validation 3x + + + + +

form_field_validation 3x

+
+
+
+form_field_validation(3x)                     form_field_validation(3x)
+
+
+
+
+
+

NAME

+       form_field_validation - data type validation for fields
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_type(FIELD *field, FIELDTYPE *type, ...);
+       FIELDTYPE *field_type(const FIELD *field);
+       void *field_arg(const FIELD *field);
+
+       FIELDTYPE *TYPE_ALNUM;
+       FIELDTYPE *TYPE_ALPHA;
+       FIELDTYPE *TYPE_ENUM;
+       FIELDTYPE *TYPE_INTEGER;
+       FIELDTYPE *TYPE_NUMERIC;
+       FIELDTYPE *TYPE_REGEXP;
+       FIELDTYPE *TYPE_IPV4;
+
+
+
+

DESCRIPTION

+       The  function  set_field_type  declares  a data type for a
+       given form field.  This is the type checked by  validation
+       functions.  The predefined types are as follows:
+
+       TYPE_ALNUM
+            Alphanumeric  data.  Requires a third int argument, a
+            minimum field width.
+
+       TYPE_ALPHA
+            Character data.  Requires a  third  int  argument,  a
+            minimum field width.
+
+       TYPE_ENUM
+            Accept one of a specified set of strings.  Requires a
+            third (char **) argument pointing to a string list; a
+            fourth  int flag argument to enable case-sensitivity;
+            and a fifth int flag argument  specifying  whether  a
+            partial  match  must be a unique one (if this flag is
+            off, a prefix matches the first of any  set  of  more
+            than  one  list  elements  with  that prefix). Please
+            notice that the string list is copied. So you may use
+            a  list  that  lives  in  automatic  variables on the
+            stack.
+
+       TYPE_INTEGER
+            Integer data, parsable  to  an  integer  by  atoi(3).
+            Requires  a third int argument controlling the preci-
+            sion, a fourth  long  argument  constraining  minimum
+            value,  and  a fifth long constraining maximum value.
+            If the maximum value is less than  or  equal  to  the
+            minimum value, the range is simply ignored. On return
+            the field buffer is formatted according to the printf
+            format   specification   ".*ld",  where  the  '*'  is
+            replaced by the precision argument.  For  details  of
+            the precision handling see printf's man-page.
+
+       TYPE_NUMERIC
+            Numeric   data   (may  have  a  decimal-point  part).
+            Requires a third int argument controlling the  preci-
+            sion,  a  fourth double argument constraining minimum
+            value, and a fifth double constraining maximum value.
+            If  your  system  supports locales, the decimal point
+            character to be used must be  the  one  specified  by
+            your  locale.   If  the maximum value is less than or
+            equal to the  minimum  value,  the  range  is  simply
+            ignored.  On  return  the  field  buffer is formatted
+            according to the printf format  specification  ".*f",
+            where  the '*' is replaced by the precision argument.
+            For details of the precision  handling  see  printf's
+            man-page.
+
+       TYPE_REGEXP
+            Regular  expression data.  Requires a regular expres-
+            sion (char *) third argument; the data  is  valid  if
+            the  regular  expression matches it.  Regular expres-
+            sions are in  the  format  of  regcomp  and  regexec.
+            Please  notice that the regular expression must match
+            the whole field. If you have  for  example  an  eight
+            character wide field, a regular expression "^[0-9]*$"
+            always means that you have to fill  all  eight  posi-
+            tions with digits. If you want to allow fewer digits,
+            you may use for example "^[0-9]* *$"  which  is  good
+            for  trailing  spaces  (up  to an empty field), or "^
+            *[0-9]* *$" which is good for  leading  and  trailing
+            spaces around the digits.
+
+       TYPE_IPV4
+            An Internet Protocol Version 4 address. This requires
+            no additional argument. It is checked whether or  not
+            the  buffer  has  the form a.b.c.d, where a,b,c and d
+            are numbers between 0 and 255. Trailing blanks in the
+            buffer  are  ignored. The address itself is not vali-
+            dated. Please note that this is an ncurses extension.
+            This  field type may not be available in other curses
+            implementations.
+
+       It is possible to  set  up  new  programmer-defined  field
+       types.  See the form_fieldtype(3x) manual page.
+
+
+
+

RETURN VALUE

+       The  functions  field_type  and  field_arg  return NULL on
+       error. The function set_field_type returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x), form_variables(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                              form_field_validation(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_fieldtype.3x.html b/doc/html/man/form_fieldtype.3x.html new file mode 100644 index 00000000000..7f195ee37a8 --- /dev/null +++ b/doc/html/man/form_fieldtype.3x.html @@ -0,0 +1,190 @@ + + + + +form_fieldtype 3x + + + + +

form_fieldtype 3x

+
+
+
+form_fieldtype(3x)                                   form_fieldtype(3x)
+
+
+
+
+
+

NAME

+       form_fieldtype - define validation-field types
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       FIELDTYPE *new_fieldtype(
+           bool (* const field_check)(FIELD *, const void *),
+           bool (* const char_check)(int, const void *));
+       int free_fieldtype(FIELDTYPE *fieldtype);
+       int set_fieldtype_arg(
+           FIELDTYPE *fieldtype,
+           void *(* const make_arg)(va_list *),
+           void *(* const copy_arg)(const void *),
+           void  (* const free_arg)(void *));
+       int set_fieldtype_choice(
+           FIELDTYPE *fieldtype,
+           bool (* const next_choice)(FIELD *, const void *),
+           bool (* const prev_choice)(FIELD *, const void *));
+       FIELDTYPE *link_fieldtype(FIELDTYPE *type1,
+                                 FIELDTYPE *type2);
+
+
+
+

DESCRIPTION

+       The function new_fieldtype creates a new field type usable
+       for data validation.  You supply it  with  field_check,  a
+       predicate  to check the validity of an entered data string
+       whenever the user attempts to leave a field.   The  (FIELD
+       *)  argument  is passed in so the validation predicate can
+       see the field's buffer, sizes and  other  attributes;  the
+       second  argument  is  an  argument-block  structure, about
+       which more below.
+
+       You also supply new_fieldtype with char_check, a  function
+       to  validate input characters as they are entered; it will
+       be passed the character to be checked and a pointer to  an
+       argument-block structure.
+
+       The  function free_fieldtype frees the space allocated for
+       a given validation type.
+
+       The function set_fieldtype_arg associates  three  storage-
+       management  functions  with  a  field  type.  The make_arg
+       function is automatically applied to the list of arguments
+       you  give  set_field_type  when  attaching validation to a
+       field; its job is to bundle these into an allocated  argu-
+       ment-block  object which can later be passed to validation
+       predicated.  The other two hook arguments should copy  and
+       free  argument-block structures.  They will be used by the
+       forms-driver code.  You must supply the make_arg function,
+       the  other two are optional, you may supply NULL for them.
+       In this case it is assumed that make_arg does not allocate
+       memory  but simply loads the argument into a single scalar
+       value.
+
+       The function link_fieldtype creates a new field type  from
+       the  two  given  types.   They are connected by an logical
+       'OR'.
+
+       The   form    driver    requests    REQ_NEXT_CHOICE    and
+       REQ_PREV_CHOICE assume that the possible values of a field
+       form an ordered set, and provide the forms user with a way
+       to  move  through the set.  The set_fieldtype_choice func-
+       tion allows forms  programmers  to  define  successor  and
+       predecessor functions for the field type.  These functions
+       take the field pointer and an argument-block structure  as
+       arguments.
+
+
+
+

RETURN VALUE

+       The  pointer-valued  routines  return NULL on error.  They
+       set errno according to their success:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_SYSTEM_ERROR
+            System error occurred, e.g., malloc failure.
+
+       The  integer-valued  routines  return one of the following
+       codes on error:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+       E_CURRENT
+            The field is the current field.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+       All of the (char *) arguments of  these  functions  should
+       actually  be (void *).  The type has been left uncorrected
+       for strict compatibility with System V.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                     form_fieldtype(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_hook.3x.html b/doc/html/man/form_hook.3x.html new file mode 100644 index 00000000000..369c164b996 --- /dev/null +++ b/doc/html/man/form_hook.3x.html @@ -0,0 +1,138 @@ + + + + +form_hook 3x + + + + +

form_hook 3x

+
+
+
+form_hook(3x)                                             form_hook(3x)
+
+
+
+
+
+

NAME

+       form_hook - set hooks for automatic invocation by applica-
+       tions
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_init(FORM *form, Form_Hook func);
+       Form_Hook field_init(const FORM *form);
+       int set_field_term(FORM *form, Form_Hook func);
+       Form_Hook field_term(const FORM *form);
+       int set_form_init(FORM *form, Form_Hook func);
+       Form_Hook form_init(const FORM *form);
+       int set_form_term(FORM *form, Form_Hook func);
+       Form_Hook form_term(const FORM *form);
+
+
+
+

DESCRIPTION

+       These functions make it possible to set hook functions  to
+       be called at various points in the automatic processing of
+       input event codes by form_driver.
+
+       The function set_field_init sets a hook to  be  called  at
+       form-post  time  and  each time the selected field changes
+       (after the change).  field_init returns the current  field
+       init hook, if any (NULL if there is no such hook).
+
+       The  function  set_field_term  sets a hook to be called at
+       form-unpost time and each time the selected field  changes
+       (before the change).  field_term returns the current field
+       term hook, if any (NULL if there is no such hook).
+
+       The function set_form_init sets a hook  to  be  called  at
+       form-post  time  and  just  after a page change once it is
+       posted.  form_init returns the current form init hook,  if
+       any (NULL if there is no such hook).
+
+       The  function  set_form_term  sets  a hook to be called at
+       form-unpost time and just before a page change once it  is
+       posted.   form_init returns the current form term hook, if
+       any (NULL if there is no such hook).
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.  Other
+       routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          form_hook(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_new.3x.html b/doc/html/man/form_new.3x.html new file mode 100644 index 00000000000..d73547a5f06 --- /dev/null +++ b/doc/html/man/form_new.3x.html @@ -0,0 +1,132 @@ + + + + +form_new 3x + + + + +

form_new 3x

+
+
+
+form_new(3x)                                               form_new(3x)
+
+
+
+
+
+

NAME

+       form_new - create and destroy forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       FORM *new_form(FIELD **fields);
+       int free_form(FORM *form);
+
+
+
+

DESCRIPTION

+       The  function  new_form  creates a new form connected to a
+       specified field pointer array (which must  be  NULL-termi-
+       nated).
+
+       The  function  free_form  disconnects  form from its field
+       array and frees the storage allocated for the form.
+
+
+
+

RETURN VALUE

+       The function new_form returns  NULL  on  error.   It  sets
+       errno according to the function's success:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+       E_SYSTEM_ERROR
+            System error occurred, e.g., malloc failure.
+
+       The function free_form returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The form has already been posted.
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                           form_new(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_new_page.3x.html b/doc/html/man/form_new_page.3x.html new file mode 100644 index 00000000000..be9d1154cee --- /dev/null +++ b/doc/html/man/form_new_page.3x.html @@ -0,0 +1,119 @@ + + + + +form_new_page 3x + + + + +

form_new_page 3x

+
+
+
+form_new_page(3x)                                     form_new_page(3x)
+
+
+
+
+
+

NAME

+       form_new_page - form pagination functions
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_new_page(FIELD *field, bool new_page_flag);
+       bool new_page(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_new_page  sets or resets a flag marking
+       the given field as the beginning of  a  new  page  on  its
+       form.
+
+       The  function  new_page  is  a  predicate which tests if a
+       given field marks a page beginning on its form.
+
+
+
+

RETURN VALUE

+       The function new_page returns TRUE or FALSE.
+
+       The function set_new_page return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_CONNECTED
+            The given field is already connected to a form.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                      form_new_page(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_opts.3x.html b/doc/html/man/form_opts.3x.html new file mode 100644 index 00000000000..78d57fd7374 --- /dev/null +++ b/doc/html/man/form_opts.3x.html @@ -0,0 +1,134 @@ + + + + +form_opts 3x + + + + +

form_opts 3x

+
+
+
+form_opts(3x)                                             form_opts(3x)
+
+
+
+
+
+

NAME

+       form_opts - set and get form options
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_opts(FORM *form, Field_Options opts);
+       int form_opts_on(FORM *form, Field_Options opts);
+       int form_opts_off(FORM *form, Field_Options opts);
+       Field_Options form_opts(const FORM *form);
+
+
+
+

DESCRIPTION

+       The  function  set_form_opts  sets  all  the  given form's
+       option bits  (form  option  bits  may  be  logically-OR'ed
+       together).
+
+       The  function form_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function form_opts_off  turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The  function  form_opts returns the form's current option
+       bits.
+
+       The following options are defined (all are on by default):
+
+       O_NL_OVERLOAD
+            Overload the REQ_NEW_LINE  forms  driver  request  so
+            that  calling  it  at  the end of a field goes to the
+            next field.
+
+       O_BS_OVERLOAD
+            Overload the REQ_DEL_PREV  forms  driver  request  so
+            that  calling  it at the beginning of a field goes to
+            the previous field.
+
+
+
+

RETURN VALUE

+       Except for form_opts, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          form_opts(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_page.3x.html b/doc/html/man/form_page.3x.html new file mode 100644 index 00000000000..2168af1ffae --- /dev/null +++ b/doc/html/man/form_page.3x.html @@ -0,0 +1,139 @@ + + + + +form_page 3x + + + + +

form_page 3x

+
+
+
+form_page(3x)                                             form_page(3x)
+
+
+
+
+
+

NAME

+       form_page - set and get form page number
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_current_field(FORM *form, FIELD *field);
+       FIELD *current_field(const FORM *);
+       int set_form_page(FORM *form, int n);
+       int form_page(const FORM *form);
+       int field_index(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_current field sets the current field of
+       the given form; current_field returns the current field of
+       the given form.
+
+       The  function  set_form_page  sets  the form's page number
+       (goes to page n of the form).
+
+       The function form_page returns  the  form's  current  page
+       number.
+
+       The function field_index returns the index of the field in
+       the field array of the form it is connected to. It returns
+       ERR  if  the  argument is the null pointer or the field is
+       not connected.
+
+
+
+

RETURN VALUE

+       Except for form_page, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_INVALID_FIELD
+            Contents of a field are not valid.
+
+       E_REQUEST_DENIED
+            The form driver could not process the request.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          form_page(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_post.3x.html b/doc/html/man/form_post.3x.html new file mode 100644 index 00000000000..1e7e71432e9 --- /dev/null +++ b/doc/html/man/form_post.3x.html @@ -0,0 +1,136 @@ + + + + +form_post 3x + + + + +

form_post 3x

+
+
+
+form_post(3x)                                             form_post(3x)
+
+
+
+
+
+

NAME

+       form_post  -  write or erase forms from associated subwin-
+       dows
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int post_form(FORM *form);
+       int unpost_form(FORM *form);
+
+
+
+

DESCRIPTION

+       The function post_form displays a form to  its  associated
+       subwindow.   To trigger physical display of the subwindow,
+       use  refresh  or  some  equivalent  curses  routine   (the
+       implicit  doupdate  triggered  by  an curses input request
+       will do).
+
+       The function unpost_form erases form from  its  associated
+       subwindow.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the form.
+
+       E_NO_ROOM
+            Form is too large for its window.
+
+       E_POSTED
+            The form has already been posted.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          form_post(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_requestname.3x.html b/doc/html/man/form_requestname.3x.html new file mode 100644 index 00000000000..8400063f3a9 --- /dev/null +++ b/doc/html/man/form_requestname.3x.html @@ -0,0 +1,112 @@ + + + + +form_requestname 3x + + + + +

form_requestname 3x

+
+
+
+form_requestname(3x)                               form_requestname(3x)
+
+
+
+
+
+

NAME

+       form_requestname - handle printable form request names
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       const char *form_request_name(int request);
+       int form_request_by_name(const char *name);
+
+
+
+

DESCRIPTION

+       The  function form_request_name returns the printable name
+       of a form request code.
+       The function form_request_by_name searches in the name-ta-
+       ble  for  a  request  with  the given name and returns its
+       request code. Otherwise E_NO_MATCH is returned.
+
+
+
+

RETURN VALUE

+       form_request_name returns NULL on error and sets errno  to
+       E_BAD_ARGUMENT.
+       form_request_by_name returns E_NO_MATCH on error.  It does
+       not set errno.
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is recommended that any code depending on them be con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                   form_requestname(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_userptr.3x.html b/doc/html/man/form_userptr.3x.html new file mode 100644 index 00000000000..189fca2961a --- /dev/null +++ b/doc/html/man/form_userptr.3x.html @@ -0,0 +1,112 @@ + + + + +form_userptr 3x + + + + +

form_userptr 3x

+
+
+
+form_userptr(3x)                                       form_userptr(3x)
+
+
+
+
+
+

NAME

+       form_userptr - associate application data with a form item
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_userptr(FORM *form, void *userptr);
+       void* form_userptr(const FORM *form);
+
+
+
+

DESCRIPTION

+       Every  form  and  every  form item has a field that can be
+       used to hold application-specific data (that is, the form-
+       driver code leaves it alone).  These functions get and set
+       the form user pointer field.
+
+
+
+

RETURN VALUE

+       The function form_userptr returns a pointer (which may  be
+       NULL).  It does not set errno.
+
+       The function set_form_userptr returns E_OK (success).
+
+
+
+

SEE ALSO

+       curses(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer is a void pointer.  We chose not to leave
+       it as a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                       form_userptr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_variables.3x.html b/doc/html/man/form_variables.3x.html new file mode 100644 index 00000000000..5d252d97e28 --- /dev/null +++ b/doc/html/man/form_variables.3x.html @@ -0,0 +1,118 @@ + + + + +form_variables 3x + + + + +

form_variables 3x

+
+
+
+form_variables(3x)                                   form_variables(3x)
+
+
+
+
+
+

NAME

+       TYPE_ALNUM, TYPE_ALPHA, TYPE_ENUM, TYPE_INTEGER,
+       TYPE_IPV4, TYPE_NUMERIC, TYPE_REGEXP - form system global
+       variables
+
+
+
+

SYNOPSIS

+       #include <form.h>
+
+       FIELDTYPE * TYPE_ALNUM;
+       FIELDTYPE * TYPE_ALPHA;
+       FIELDTYPE * TYPE_ENUM;
+       FIELDTYPE * TYPE_INTEGER;
+       FIELDTYPE * TYPE_IPV4;
+       FIELDTYPE * TYPE_NUMERIC;
+       FIELDTYPE * TYPE_REGEXP;
+
+
+
+

DESCRIPTION

+       These  are  building blocks for the form library, defining
+       fields that can be created using set_fieldtype(3x).   Each
+       provides  functions  for  field- and character-validation,
+       according to the given datatype.
+
+   TYPE_ALNUM
+       This holds alphanumeric data.
+
+   TYPE_ALPHA
+       This holds alphabetic data.
+
+   TYPE_ENUM
+       This holds an enumerated type.
+
+   TYPE_INTEGER
+       This holds a decimal integer.
+
+   TYPE_IPV4
+       This holds an IPv4 internet address, e.g., "127.0.0.1".
+
+   TYPE_NUMERIC
+       This holds a decimal number, with optional sign and  deci-
+       mal point.
+
+   TYPE_REGEXP
+       This holds a regular expression.
+
+
+
+

PORTABILITY

+       The  TYPE_IPV4  variable  is  an extension not provided by
+       older implementations of the form library.
+
+
+
+

SEE ALSO

+       form(3x).
+
+
+
+                                                     form_variables(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/form_win.3x.html b/doc/html/man/form_win.3x.html new file mode 100644 index 00000000000..9baa68f82c1 --- /dev/null +++ b/doc/html/man/form_win.3x.html @@ -0,0 +1,139 @@ + + + + +form_win 3x + + + + +

form_win 3x

+
+
+
+form_win(3x)                                               form_win(3x)
+
+
+
+
+
+

NAME

+       form_win  - make and break form window and subwindow asso-
+       ciations
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_win(FORM *form, WINDOW *win);
+       WINDOW *form_win(const FORM *form);
+       int set_form_sub(FORM *form, WINDOW *sub);
+       WINDOW *form_sub(const FORM *form);
+       int scale_form(const FORM *form, int *rows, int *columns);
+
+
+
+

DESCRIPTION

+       Every form has an associated pair of curses windows.   The
+       form  window displays any title and border associated with
+       the window; the form subwindow displays the items  of  the
+       form that are currently available for selection.
+
+       The first four functions get and set those windows.  It is
+       not necessary to set either window; by default, the driver
+       code uses stdscr for both.
+
+       In  the set_ functions, window argument of NULL is treated
+       as though it were stsdcr.  A  form  argument  of  NULL  is
+       treated  as  a  request  to change the system default form
+       window or subwindow.
+
+       The function scale_form returns the minimum size  required
+       for the subwindow of form.
+
+
+
+

RETURN VALUE

+       Routines  that return pointers return NULL on error.  Rou-
+       tines that return an integer return one of  the  following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_POSTED
+            The form has already been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the form.
+
+
+
+

SEE ALSO

+       curses(3x), curs_variables(3x), form(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                           form_win(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/index.html b/doc/html/man/index.html new file mode 100644 index 00000000000..64a832f213e --- /dev/null +++ b/doc/html/man/index.html @@ -0,0 +1,67 @@ + + + + +NCURSES – Manual Pages + + + +
+ + + diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html new file mode 100644 index 00000000000..c68f477552a --- /dev/null +++ b/doc/html/man/infocmp.1m.html @@ -0,0 +1,444 @@ + + + + +infocmp 1m + + + + +

infocmp 1m

+
+
+
+infocmp(1m)                                                 infocmp(1m)
+
+
+
+
+
+

NAME

+       infocmp - compare or print out terminfo descriptions
+
+
+
+

SYNOPSIS

+       infocmp [-1CEFGILTUVcdegilnpqrtux]
+             [-v n] [-s d| i| l| c] [-R subset]
+             [-w width] [-A directory] [-B directory]
+             [termname...]
+
+
+
+

DESCRIPTION

+       infocmp  can  be  used  to compare a binary terminfo entry
+       with other terminfo entries, rewrite a  terminfo  descrip-
+       tion  to  take  advantage  of  the use= terminfo field, or
+       print out a terminfo  description  from  the  binary  file
+       (term) in a variety of formats.  In all cases, the boolean
+       fields will be printed  first,  followed  by  the  numeric
+       fields, followed by the string fields.
+
+   Default Options
+       If  no options are specified and zero or one termnames are
+       specified, the -I option will be assumed.   If  more  than
+       one  termname is specified, the -d option will be assumed.
+
+   Comparison Options [-d] [-c] [-n]
+       infocmp compares the terminfo  description  of  the  first
+       terminal  termname  with each of the descriptions given by
+       the entries for the  other  terminal's  termnames.   If  a
+       capability  is  defined for only one of the terminals, the
+       value returned will depend on the type of the  capability:
+       F  for  boolean  variables,  -1 for integer variables, and
+       NULL for string variables.
+
+       The -d option produces a list of each capability  that  is
+       different  between  two entries.  This option is useful to
+       show the difference between two entries, created  by  dif-
+       ferent people, for the same or similar terminals.
+
+       The  -c  option produces a list of each capability that is
+       common between two entries.  Capabilities that are not set
+       are  ignored.  This option can be used as a quick check to
+       see if the -u option is worth using.
+
+       The -n option produces a list of each capability  that  is
+       in neither entry.  If no termnames are given, the environ-
+       ment variable TERM will be used for both of the termnames.
+       This  can  be used as a quick check to see if anything was
+       left out of a description.
+
+   Source Listing Options [-I] [-L] [-C] [-r]
+       The -I, -L, and -C options will produce a  source  listing
+       for each terminal named.
+
+      -I   use the terminfo names
+      -L   use the long C variable name listed in <term.h>
+      -C   use the termcap names
+      -r   when using -C, put out all capabilities in termcap form
+
+       If  no  termnames are given, the environment variable TERM
+       will be used for the terminal name.
+
+       The source produced by the -C option may be used  directly
+       as  a termcap entry, but not all parameterized strings can
+       be changed to the termcap format.  infocmp will attempt to
+       convert  most  of  the parameterized information, and any-
+       thing not converted will be plainly marked in  the  output
+       and commented out.  These should be edited by hand.
+
+       All  padding  information  for  strings  will be collected
+       together and placed at the beginning of the  string  where
+       termcap  expects  it.  Mandatory padding (padding informa-
+       tion with a trailing '/') will become optional.
+
+       All termcap variables no longer supported by terminfo, but
+       which are derivable from other terminfo variables, will be
+       output.  Not all terminfo capabilities will be translated;
+       only  those variables which were part of termcap will nor-
+       mally be output.  Specifying the -r option will  take  off
+       this  restriction,  allowing all capabilities to be output
+       in termcap form.
+
+       Note that because padding is collected to the beginning of
+       the  capability,  not all capabilities are output.  Manda-
+       tory padding is not supported.   Because  termcap  strings
+       are  not as flexible, it is not always possible to convert
+       a terminfo string capability into  an  equivalent  termcap
+       format.   A subsequent conversion of the termcap file back
+       into terminfo format will not  necessarily  reproduce  the
+       original terminfo source.
+
+       Some  common  terminfo  parameter sequences, their termcap
+       equivalents, and some terminal types which  commonly  have
+       such sequences, are:
+
+     terminfo                    termcap   Representative Terminals
+     ---------------------------------------------------------------
+     %p1%c                       %.        adm
+     %p1%d                       %d        hp, ANSI standard, vt100
+     %p1%'x'%+%c                 %+x       concept
+     %i                          %iq       ANSI standard, vt100
+     %p1%?%'x'%>%t%p1%'y'%+%;    %>xy      concept
+     %p2 is printed before %p1   %r        hp
+
+   Use= Option [-u]
+       The  -u  option  produces a terminfo source description of
+       the first terminal termname which is relative to  the  sum
+       of  the  descriptions  given  by the entries for the other
+       terminals termnames.  It does this by analyzing  the  dif-
+       ferences   between   the  first  termname  and  the  other
+       termnames and producing a description with use= fields for
+       the  other  terminals.   In this manner, it is possible to
+       retrofit  generic  terminfo  entries  into  a   terminal's
+       description.  Or, if two similar terminals exist, but were
+       coded at different times or by different  people  so  that
+       each description is a full description, using infocmp will
+       show what can be done to change one description to be rel-
+       ative to the other.
+
+       A capability will get printed with an at-sign (@) if it no
+       longer exists in the first termname, but one of the  other
+       termname  entries contains a value for it.  A capability's
+       value gets printed if the value in the first  termname  is
+       not  found in any of the other termname entries, or if the
+       first of the other termname entries that has this capabil-
+       ity  gives  a different value for the capability than that
+       in the first termname.
+
+       The order of the other termname  entries  is  significant.
+       Since  the terminfo compiler tic does a left-to-right scan
+       of the capabilities, specifying two use= entries that con-
+       tain differing entries for the same capabilities will pro-
+       duce different results depending on  the  order  that  the
+       entries  are  given in.  infocmp will flag any such incon-
+       sistencies between the other termname entries as they  are
+       found.
+
+       Alternatively,  specifying a capability after a use= entry
+       that contains that capability will cause the second speci-
+       fication  to  be  ignored.   Using  infocmp  to recreate a
+       description can be a useful check to make sure that every-
+       thing  was  specified  correctly  in  the  original source
+       description.
+
+       Another error  that  does  not  cause  incorrect  compiled
+       files,  but will slow down the compilation time, is speci-
+       fying extra use= fields  that  are  superfluous.   infocmp
+       will  flag  any  other  termname use= fields that were not
+       needed.
+
+   Changing Databases [-A directory] [-B directory]
+       The location of the compiled terminfo  database  is  taken
+       from  the environment variable TERMINFO .  If the variable
+       is not defined, or the terminal is not found in that loca-
+       tion,  the  system  terminfo  database, in /usr/share/ter-
+       minfo, will be used.  The options -A and -B may be used to
+       override  this  location.  The -A option will set TERMINFO
+       for the first termname and the -B option will set TERMINFO
+       for  the  other  termnames.   With this, it is possible to
+       compare descriptions for a terminal  with  the  same  name
+       located  in  two  different databases.  This is useful for
+       comparing descriptions for the same  terminal  created  by
+       different people.
+
+   Other Options
+       -1   causes  the  fields  to be printed out one to a line.
+            Otherwise, the fields will be printed  several  to  a
+            line to a maximum width of 60 characters.
+
+       -a   tells  infocmp  to  retain commented-out capabilities
+            rather than discarding them.  Capabilities  are  com-
+            mented by prefixing them with a period.
+
+       -E   Dump  the  capabilities  of  the  given  terminal  as
+            tables, needed in the C initializer  for  a  TERMTYPE
+            structure  (the  terminal capability structure in the
+            <term.h>).  This option is useful for preparing  ver-
+            sions  of  the  curses  library hardwired for a given
+            terminal type.  The tables are all  declared  static,
+            and  are  named according to the type and the name of
+            the corresponding terminal entry.
+
+            Before ncurses 5.0, the split between the -e  and  -E
+            options  was  not  needed;  but  support for extended
+            names required making the arrays of terminal capabil-
+            ities separate from the TERMTYPE structure.
+
+       -e   Dump  the  capabilities  of the given terminal as a C
+            initializer for a TERMTYPE  structure  (the  terminal
+            capability  structure  in the <term.h>).  This option
+            is  useful  for  preparing  versions  of  the  curses
+            library hardwired for a given terminal type.
+
+       -F   compare  terminfo  files.  This assumes that two fol-
+            lowing  arguments  are  filenames.   The  files   are
+            searched  for  pairwise matches between entries, with
+            two entries considered to match if any of their names
+            do.   The  report  printed  to  standard output lists
+            entries with  no  matches  in  the  other  file,  and
+            entries  with  more than one match.  For entries with
+            exactly one match it includes  a  difference  report.
+            Normally,  to  reduce  the  volume of the report, use
+            references are not resolved before looking  for  dif-
+            ferences, but resolution can be forced by also speci-
+            fying -r.
+
+       -f   Display  complex  terminfo  strings   which   contain
+            if/then/else/endif expressions indented for readabil-
+            ity.
+
+       -G   Display constant literals in decimal form rather than
+            their character equivalents.
+
+       -g   Display  constant  character  literals in quoted form
+            rather than their decimal equivalents.
+
+       -i   Analyze the initialization (is1, is2, is3), and reset
+            (rs1,  rs2,  rs3),  strings  in  the entry.  For each
+            string, the code tries to analyze it into actions  in
+            terms of the other capabilities in the entry, certain
+            X3.64/ISO 6429/ECMA-48 capabilities, and certain  DEC
+            VT-series  private  modes (the set of recognized spe-
+            cial sequences has  been  selected  for  completeness
+            over  the  existing  terminfo database).  Each report
+            line consists of the capability name, followed  by  a
+            colon and space, followed by a printable expansion of
+            the capability string with sections  matching  recog-
+            nized  actions  translated into {}-bracketed descrip-
+            tions.  Here  is  a  list  of  the  DEC/ANSI  special
+            sequences recognized: i.
+
+                  Action        Meaning
+                  -----------------------------------------
+                  RIS           full reset
+                  SC            save cursor
+                  RC            restore cursor
+                  LL            home-down
+                  RSR           reset scroll region
+                  -----------------------------------------
+                  DECSTR        soft reset (VT320)
+                  S7C1T         7-bit controls (VT220)
+                  -----------------------------------------
+                  ISO DEC G0    enable DEC graphics for G0
+                  ISO UK G0     enable UK chars for G0
+                  ISO US G0     enable US chars for G0
+                  ISO DEC G1    enable DEC graphics for G1
+                  ISO UK G1     enable UK chars for G1
+                  ISO US G1     enable US chars for G1
+                  -----------------------------------------
+                  DECPAM        application keypad mode
+                  DECPNM        normal keypad mode
+                  DECANSI       enter ANSI mode
+                  -----------------------------------------
+                  ECMA[+-]AM    keyboard action mode
+                  ECMA[+-]IRM   insert replace mode
+                  ECMA[+-]SRM   send receive mode
+                  ECMA[+-]LNM   linefeed mode
+                  -----------------------------------------
+                  DEC[+-]CKM    application cursor keys
+                  DEC[+-]ANM    set VT52 mode
+                  DEC[+-]COLM   132-column mode
+
+                  DEC[+-]SCLM   smooth scroll
+                  DEC[+-]SCNM   reverse video mode
+                  DEC[+-]OM     origin mode
+                  DEC[+-]AWM    wraparound mode
+                  DEC[+-]ARM    auto-repeat mode
+
+            It  also  recognizes  a  SGR  action corresponding to
+            ANSI/ISO 6429/ECMA Set Graphics Rendition,  with  the
+            values  NORMAL,  BOLD, UNDERLINE, BLINK, and REVERSE.
+            All but NORMAL may be prefixed with `+' (turn on)  or
+            `-' (turn off).
+
+       An SGR0 designates an empty highlight sequence (equivalent
+       to {SGR:NORMAL}).
+
+       -l   Set output format to terminfo.
+
+       -p   Ignore padding specifications when comparing strings.
+
+       -q   Make  the comparison listing shorter by omitting sub-
+            headings, and using "-" for absent capabilities,  "@"
+            for canceled rather than "NULL".
+
+       -Rsubset
+            Restrict  output  to  a given subset.  This option is
+            for use with archaic versions of terminfo like  those
+            on  SVr1,  Ultrix,  or  HP/UX that do not support the
+            full set of SVR4/XSI Curses  terminfo;  and  variants
+            such as AIX that have their own extensions incompati-
+            ble with SVr4/XSI.  Available  terminfo  subsets  are
+            "SVr1",  "Ultrix",  "HP",  and "AIX"; see terminfo(5)
+            for details.  You can also choose  the  subset  "BSD"
+            which  selects only capabilities with termcap equiva-
+            lents recognized by 4.4BSD.
+
+       -s [d|i|l|c]
+            The -s option  sorts  the  fields  within  each  type
+            according to the argument below:
+
+            d    leave  fields  in the order that they are stored
+                 in the terminfo database.
+
+            i    sort by terminfo name.
+
+            l    sort by the long C variable name.
+
+            c    sort by the termcap name.
+
+            If the -s option is not given, the fields printed out
+            will  be  sorted  alphabetically by the terminfo name
+            within each type, except in the case of the -C or the
+            -L options, which cause the sorting to be done by the
+            termcap name or the long  C  variable  name,  respec-
+            tively.
+
+       -T   eliminates  size-restrictions  on the generated text.
+            This is mainly useful for testing and analysis, since
+            the compiled descriptions are limited (e.g., 1023 for
+            termcap, 4096 for terminfo).
+
+       -t   tells  tic  to  discard  commented-out  capabilities.
+            Normally  when  translating from terminfo to termcap,
+            untranslatable capabilities are commented-out.
+
+       -U   tells infocmp to  not  post-process  the  data  after
+            parsing  the  source  file.   This feature helps when
+            comparing the actual contents of  two  source  files,
+            since  it  excludes the inferences that infocmp makes
+            to fill in missing data.
+
+       -V   reports the version of ncurses which was used in this
+            program, and exits.
+
+       -v n prints  out  tracing information on standard error as
+            the program runs.  Higher values of n induce  greater
+            verbosity.
+
+       -w width
+            changes the output to width characters.
+
+       -x   print   information  for  user-defined  capabilities.
+            These are extensions to the terminfo repertoire which
+            can be loaded using the -x option of tic.
+
+
+
+

FILES

+       /usr/share/terminfo Compiled      terminal     description
+                           database.
+
+
+
+

EXTENSIONS

+       The -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q
+       and -t options are not supported in SVr4 curses.
+
+       The -r option's notion of `termcap' capabilities is System
+       V Release 4's.  Actual BSD curses  versions  will  have  a
+       more  restricted  set.  To see only the 4.4BSD set, use -r
+       -RBSD.
+
+
+
+

BUGS

+       The -F option of infocmp(1m) should be a toe(1m) mode.
+
+
+
+

SEE ALSO

+       captoinfo(1m),    infotocap(1m),     tic(1m),     toe(1m),
+       curses(3x), terminfo(5).
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+

AUTHOR

+       Eric S. Raymond <esr@snark.thyrsus.com> and
+       Thomas E. Dickey <dickey@invisible-island.net>
+
+
+
+                                                            infocmp(1m)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html new file mode 100644 index 00000000000..a8c7267ad68 --- /dev/null +++ b/doc/html/man/infotocap.1m.html @@ -0,0 +1,115 @@ + + + + +infotocap 1m + + + + +

infotocap 1m

+
+
+
+infotocap(1m)                                             infotocap(1m)
+
+
+
+
+
+

NAME

+       infotocap  - convert a terminfo description into a termcap
+       description
+
+
+
+

SYNOPSIS

+       infotocap [-vn width]  [-V] [-1] [-w width] file . . .
+
+
+
+

DESCRIPTION

+       infotocap looks in  each  given  text  file  for  terminfo
+       descriptions.   For  each  terminfo  description found, an
+       equivalent termcap description is written to standard out-
+       put.  Terminfo use capabilities are translated directly to
+       termcap tc capabilities.
+
+       -v   print out tracing information on  standard  error  as
+            the program runs.
+
+       -V   print  out the version of the program in use on stan-
+            dard error and exit.
+
+       -1   cause the fields to print out one to a line.   Other-
+            wise, the fields will be printed several to a line to
+            a maximum width of 60 characters.
+
+       -w   change the output to width characters.
+
+
+
+

FILES

+       /usr/share/terminfo Compiled     terminal      description
+                           database.
+
+
+
+

NOTES

+       This  utility  is  actually  a  link to tic, running in -C
+       mode.  You can use other tic options such as -f and  -x.
+
+
+
+

SEE ALSO

+       curses(3x), tic(1m), infocmp(1m), terminfo(5)
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+

AUTHOR

+       Eric S. Raymond <esr@snark.thyrsus.com> and
+       Thomas E. Dickey <dickey@invisible-island.net>
+
+
+
+                                                          infotocap(1m)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/key_defined.3x.html b/doc/html/man/key_defined.3x.html new file mode 100644 index 00000000000..ee6126b9bd7 --- /dev/null +++ b/doc/html/man/key_defined.3x.html @@ -0,0 +1,103 @@ + + + + +key_defined 3x + + + + +

key_defined 3x

+
+
+
+key_defined(3x)                                         key_defined(3x)
+
+
+
+
+
+

NAME

+       key_defined - check if a keycode is defined
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int key_defined(const char *definition);
+
+
+
+

DESCRIPTION

+       This is an extension to the curses library.  It permits an
+       application to determine if a string is currently bound to
+       any keycode.
+
+
+
+

RETURN VALUE

+       If  the  string  is bound to a keycode, its value (greater
+       than zero) is returned.  If no keycode is bound,  zero  is
+       returned.   If  the  string  conflicts with longer strings
+       which are bound to keys, -1 is returned.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       define_key(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey.
+
+
+
+                                                        key_defined(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/keybound.3x.html b/doc/html/man/keybound.3x.html new file mode 100644 index 00000000000..5b54466bd90 --- /dev/null +++ b/doc/html/man/keybound.3x.html @@ -0,0 +1,105 @@ + + + + +keybound 3x + + + + +

keybound 3x

+
+
+
+keybound(3x)                                               keybound(3x)
+
+
+
+
+
+

NAME

+       keybound - return definition of keycode
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       char * keybound(int keycode, int count);
+
+
+
+

DESCRIPTION

+       This is an extension to the curses library.  It permits an
+       application to determine the string which  is  defined  in
+       the terminfo for specific keycodes.
+
+
+
+

RETURN VALUE

+       The keycode parameter must be greater than zero, else NULL
+       is returned.  If it does not correspond to a defined  key,
+       then  NULL  is  returned.   The count parameter is used to
+       allow the application to iterate through multiple  defini-
+       tions,  counting from zero.  When successful, the function
+       returns a string which must be freed by the caller.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       define_key(3x), keyok(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey.
+
+
+
+                                                           keybound(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/keyok.3x.html b/doc/html/man/keyok.3x.html new file mode 100644 index 00000000000..d2b0be1719c --- /dev/null +++ b/doc/html/man/keyok.3x.html @@ -0,0 +1,105 @@ + + + + +keyok 3x + + + + +

keyok 3x

+
+
+
+keyok(3x)                                                     keyok(3x)
+
+
+
+
+
+

NAME

+       keyok - enable or disable a keycode
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int keyok(int keycode, bool enable);
+
+
+
+

DESCRIPTION

+       This is an extension to the curses library.  It permits an
+       application to disable specific keycodes, rather than  use
+       the  keypad  function  to disable all keycodes.  Keys that
+       have been disabled can be re-enabled.
+
+
+
+

RETURN VALUE

+       The keycode  must  be  greater  than  zero,  else  ERR  is
+       returned.   If  it  does  not correspond to a defined key,
+       then ERR is returned.  If the enable  parameter  is  true,
+       then  the  key  must  have  been disabled, and vice versa.
+       Otherwise, the function returns OK.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       define_key(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey.
+
+
+
+                                                              keyok(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/legacy_coding.3x.html b/doc/html/man/legacy_coding.3x.html new file mode 100644 index 00000000000..03eea8b6cc2 --- /dev/null +++ b/doc/html/man/legacy_coding.3x.html @@ -0,0 +1,118 @@ + + + + +legacy_coding 3x + + + + +

legacy_coding 3x

+
+
+
+legacy_coding(3x)                                     legacy_coding(3x)
+
+
+
+
+
+

NAME

+       use_legacy_coding - use terminal's default colors
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int use_legacy_coding(int level);
+
+
+
+

DESCRIPTION

+       The  use_legacy_coding()  function  is an extension to the
+       curses library.  It allows the caller to change the result
+       of  unctrl, and suppress related checks within the library
+       that would normally cause  nonprinting  characters  to  be
+       rendered in visible form.  This affects only 8-bit charac-
+       ters.
+
+       The level parameter controls the result:
+
+              0    the library functions normally, rendering non-
+                   printing characters as described in unctrl.
+
+              1    the  library ignores isprintf for codes in the
+                   range 160-255.
+
+              2    the library ignores isprintf for codes in  the
+                   range 128-255.  It also modifies the output of
+                   unctrl, showing codes in the range 128-159  as
+                   is.
+
+
+
+

RETURN VALUE

+       If  the  screen  has  not  been  initialized, or the level
+       parameter is out of range, the function returns ERR.  Oth-
+       erwise, it returns the previous level: 0, 1 or 2.
+
+
+
+

PORTABILITY

+       This routine is specific to ncurses.  It was not supported
+       on Version 7, BSD or System V implementations.  It is rec-
+       ommended  that any code depending on ncurses extensions be
+       conditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       unctrl.
+
+
+
+

AUTHOR

+       Thomas Dickey (to support lynx's font-switching feature).
+
+
+
+                                                      legacy_coding(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html new file mode 100644 index 00000000000..1e6d95a2f03 --- /dev/null +++ b/doc/html/man/menu.3x.html @@ -0,0 +1,241 @@ + + + + +menu 3x + + + + +

menu 3x

+
+
+
+menu(3x)                                                       menu(3x)
+
+
+
+
+
+

NAME

+       menu - curses extension for programming menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+
+
+
+

DESCRIPTION

+       The  menu library provides terminal-independent facilities
+       for composing menu systems  on  character-cell  terminals.
+       The library includes: item routines, which create and mod-
+       ify menu items; and menu routines, which group items  into
+       menus, display menus on the screen, and handle interaction
+       with the user.
+
+       The menu library uses the curses libraries, and  a  curses
+       initialization  routine  such  as  initscr  must be called
+       before using any of these  functions.   To  use  the  menu
+       library, link with the options -lmenu -lcurses.
+
+   Current Default Values for Item Attributes
+       The  menu  library  maintains  a  default  value  for item
+       attributes.  You can get or set this  default  by  calling
+       the  appropriate  get_  or  set_  routine with a NULL item
+       pointer.  Changing  this  default  with  a  set_  function
+       affects  future  item  creations,  but does not change the
+       rendering of items already created.
+
+   Routine Name Index
+       The following table lists each menu routine and  the  name
+       of the manual page on which it is described.
+
+       curses Routine Name    Manual Page Name
+       --------------------------------------------
+       current_item           mitem_current(3x)
+       free_item              mitem_new(3x)
+       free_menu              menu_new(3x)
+       item_count             menu_items(3x)
+       item_description       mitem_name(3x)
+       item_index             mitem_current(3x)
+       item_init              menu_hook(3x)
+       item_name              mitem_name(3x)
+       item_opts              mitem_opts(3x)
+       item_opts_off          mitem_opts(3x)
+       item_opts_on           mitem_opts(3x)
+       item_term              menu_hook(3x)
+       item_userptr           mitem_userptr(3x)
+       item_value             mitem_value(3x)
+       item_visible           mitem_visible(3x)
+       menu_back              menu_attributes(3x)
+       menu_driver            menu_driver(3x)
+       menu_fore              menu_attributes(3x)
+       menu_format            menu_format(3x)
+       menu_grey              menu_attributes(3x)
+       menu_init              menu_hook(3x)
+       menu_items             menu_items(3x)
+       menu_mark              menu_mark(3x)
+       menu_opts              menu_opts(3x)
+       menu_opts_off          menu_opts(3x)
+       menu_opts_on           menu_opts(3x)
+       menu_pad               menu_attributes(3x)
+       menu_pattern           menu_pattern(3x)
+
+       menu_request_by_name   menu_requestname(3x)
+       menu_request_name      menu_requestname(3x)
+       menu_spacing           menu_spacing(3x)
+       menu_sub               menu_win(3x)
+       menu_term              menu_hook(3x)
+       menu_userptr           menu_userptr(3x)
+       menu_win               menu_win(3x)
+       new_item               mitem_new(3x)
+       new_menu               menu_new(3x)
+       pos_menu_cursor        menu_cursor(3x)
+       post_menu              menu_post(3x)
+       scale_menu             menu_win(3x)
+       set_current_item       mitem_current(3x)
+       set_item_init          menu_hook(3x)
+       set_item_opts          mitem_opts(3x)
+       set_item_term          menu_hook(3x)
+       set_item_userptr       mitem_userptr(3x)
+       set_item_value         mitem_value(3x)
+       set_menu_back          menu_attributes(3x)
+       set_menu_fore          menu_attributes(3x)
+       set_menu_format        menu_format(3x)
+       set_menu_grey          menu_attributes(3x)
+       set_menu_init          menu_hook(3x)
+       set_menu_items         menu_items(3x)
+       set_menu_mark          menu_mark(3x)
+       set_menu_opts          mitem_opts(3x)
+       set_menu_pad           menu_attributes(3x)
+       set_menu_pattern       menu_pattern(3x)
+       set_menu_spacing       menu_spacing(3x)
+       set_menu_sub           menu_win(3x)
+       set_menu_term          menu_hook(3x)
+       set_menu_userptr       menu_userptr(3x)
+       set_menu_win           menu_win(3x)
+       set_top_row            mitem_current(3x)
+       top_row                mitem_current(3x)
+       unpost_menu            menu_post(3x)
+
+
+
+

RETURN VALUE

+       Routines  that return pointers return NULL on error.  Rou-
+       tines that return an integer return one of  the  following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NO_MATCH
+            Character failed to match.
+
+       E_NO_ROOM
+            Menu is too large for its window.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+       E_NOT_SELECTABLE
+            The designated item cannot be selected.
+
+       E_POSTED
+            The menu is already posted.
+
+       E_REQUEST_DENIED
+            The menu driver could not process the request.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_UNKNOWN_COMMAND
+            The menu driver code saw an unknown request code.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "menu_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       files <curses.h> and <eti.h>.
+
+       In  your  library  list,  libmenu.a should be before libn-
+       curses.a; that is, you want to say `-lmenu -lncurses', not
+       the  other  way  around  (which would usually give a link-
+       error).
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.  Manual pages and adaptation for ncurses
+       by Eric S. Raymond.
+
+
+
+

SEE ALSO

+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                               menu(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_attributes.3x.html b/doc/html/man/menu_attributes.3x.html new file mode 100644 index 00000000000..c02a4ab38de --- /dev/null +++ b/doc/html/man/menu_attributes.3x.html @@ -0,0 +1,139 @@ + + + + +menu_attributes 3x + + + + +

menu_attributes 3x

+
+
+
+menu_attributes(3x)                                 menu_attributes(3x)
+
+
+
+
+
+

NAME

+       menu_attributes - color and attribute control for menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_fore(MENU *menu, chtype attr);
+       chtype menu_fore(const MENU *menu);
+       int set_menu_back(MENU *menu, chtype attr);
+       chtype menu_back(const MENU *menu);
+       int set_menu_grey(MENU *menu, chtype attr);
+       chtype menu_grey(const MENU *menu);
+       int set_menu_pad(MENU *menu, int pad);
+       int menu_pad(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  set_menu_fore sets the foreground attribute
+       of menu. This is the  highlight  used  for  selected  menu
+       items.   menu_fore  returns the foreground attribute.  The
+       default is A_REVERSE.
+
+       The function set_menu_back sets the  background  attribute
+       of  menu.  This  is the highlight used for selectable (but
+       not  currently  selected)  menu   items.    The   function
+       menu_back  returns  the background attribute.  The default
+       is A_NORMAL.
+
+       The function set_menu_grey  sets  the  grey  attribute  of
+       menu.  This  is  the highlight used for un-selectable menu
+       items in menus that permit more than one  selection.   The
+       function   menu_grey  returns  the  grey  attribute.   The
+       default is A_UNDERLINE.
+
+       The function set_menu_pad sets the character used to  fill
+       the space between the name and description parts of a menu
+       item.  menu_pad returns the given  menu's  pad  character.
+       The default is a blank.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3x) and related pages whose names begin "menu_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                    menu_attributes(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_cursor.3x.html b/doc/html/man/menu_cursor.3x.html new file mode 100644 index 00000000000..be4f4299880 --- /dev/null +++ b/doc/html/man/menu_cursor.3x.html @@ -0,0 +1,117 @@ + + + + +menu_cursor 3x + + + + +

menu_cursor 3x

+
+
+
+menu_cursor(3x)                                         menu_cursor(3x)
+
+
+
+
+
+

NAME

+       menu_cursor - position a menu's cursor
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int pos_menu_cursor(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  pos_menu_cursor  restores the cursor to the
+       current position associated with the menu's selected item.
+       This  is  useful after curses routines have been called to
+       do screen-painting in response to a menu select.
+
+
+
+

RETURN VALUE

+       This routine returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                        menu_cursor(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_driver.3x.html b/doc/html/man/menu_driver.3x.html new file mode 100644 index 00000000000..f2b6c16c715 --- /dev/null +++ b/doc/html/man/menu_driver.3x.html @@ -0,0 +1,255 @@ + + + + +menu_driver 3x + + + + +

menu_driver 3x

+
+
+
+menu_driver(3x)                                         menu_driver(3x)
+
+
+
+
+
+

NAME

+       menu_driver - command-processing loop of the menu system
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int menu_driver(MENU *menu, int c);
+
+
+
+

DESCRIPTION

+       Once a menu has been posted (displayed), you should funnel
+       input events to it through menu_driver.  This routine  has
+       three major input cases:
+
+       o   The  input  is  a form navigation request.  Navigation
+           request codes are constants defined in <form.h>, which
+           are   distinct  from  the  key-  and  character  codes
+           returned by wgetch.
+
+       o   The input is a printable character.  Printable charac-
+           ters  (which  must  be  positive,  less  than 256) are
+           checked according to the program's locale settings.
+
+       o   The input is the KEY_MOUSE special key associated with
+           an mouse event.
+
+       The menu driver requests are as follows:
+
+       REQ_LEFT_ITEM
+            Move left to an item.
+
+       REQ_RIGHT_ITEM
+            Move right to an item.
+
+       REQ_UP_ITEM
+            Move up to an item.
+
+       REQ_DOWN_ITEM
+            Move down to an item.
+
+       REQ_SCR_ULINE
+            Scroll up a line.
+
+       REQ_SCR_DLINE
+            Scroll down a line.
+
+       REQ_SCR_DPAGE
+            Scroll down a page.
+
+       REQ_SCR_UPAGE
+            Scroll up a page.
+
+       REQ_FIRST_ITEM
+            Move to the first item.
+
+       REQ_LAST_ITEM
+            Move to the last item.
+
+       REQ_NEXT_ITEM
+            Move to the next item.
+
+       REQ_PREV_ITEM
+            Move to the previous item.
+
+       REQ_TOGGLE_ITEM
+            Select/deselect an item.
+
+       REQ_CLEAR_PATTERN
+            Clear the menu pattern buffer.
+
+       REQ_BACK_PATTERN
+            Delete   the  previous  character  from  the  pattern
+            buffer.
+
+       REQ_NEXT_MATCH
+            Move to the next item matching the pattern match.
+
+       REQ_PREV_MATCH
+            Move to the previous item matching the pattern match.
+
+       If  the second argument is a printable character, the code
+       appends it to the pattern buffer and attempts to  move  to
+       the  next  item  matching the new pattern.  If there is no
+       such match, menu_driver returns E_NO_MATCH and deletes the
+       appended character from the buffer.
+
+       If  the  second  argument  is one of the above pre-defined
+       requests, the corresponding action is performed.
+
+   MOUSE HANDLING
+       If the second argument is the KEY_MOUSE special  key,  the
+       associated mouse event is translated into one of the above
+       pre-defined requests.  Currently only clicks in  the  user
+       window  (e.g., inside the menu display area or the decora-
+       tion window) are handled.
+
+       If you click above the display region of the menu:
+
+       o   a REQ_SCR_ULINE is generated for a single click,
+
+       o   a REQ_SCR_UPAGE is generated for a double-click and
+
+       o   a REQ_FIRST_ITEM is generated for a triple-click.
+
+       If you click below the display region of the menu:
+
+       o   a REQ_SCR_DLINE is generated for a single click,
+
+       o   a REQ_SCR_DPAGE is generated for a double-click and
+
+       o   a REQ_LAST_ITEM is generated for a triple-click.
+
+       If you click at an item inside the  display  area  of  the
+       menu:
+
+       o   the menu cursor is positioned to that item.
+
+       o   If  you double-click an item a REQ_TOGGLE_ITEM is gen-
+           erated and E_UNKNOWN_COMMAND is returned.  This return
+           value  makes  sense,  because  a  double click usually
+           means that an item-specific action should be returned.
+           It is exactly the purpose of this return value to sig-
+           nal that an application  specific  command  should  be
+           executed.
+
+       o   If  a translation into a request was done, menu_driver
+           returns the result of this request.
+
+       If you clicked outside the user window or the mouse  event
+       could   not   be   translated   into  a  menu  request  an
+       E_REQUEST_DENIED is returned.
+
+   APPLICATION-DEFINED COMMANDS
+       If the second argument is neither printable nor one of the
+       above  pre-defined  menu  requests or KEY_MOUSE, the drive
+       assumes it is an application-specific command and  returns
+       E_UNKNOWN_COMMAND.  Application-defined commands should be
+       defined relative to  MAX_COMMAND,  the  maximum  value  of
+       these pre-defined requests.
+
+
+
+

RETURN VALUE

+       menu_driver return one of the following error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+       E_UNKNOWN_COMMAND
+            The menu driver code saw an unknown request code.
+
+       E_NO_MATCH
+            Character failed to match.
+
+       E_REQUEST_DENIED
+            The menu driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x), getch(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       files <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were  not supported on Version 7 or BSD versions. The sup-
+       port for mouse events is ncurses specific.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                        menu_driver(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_format.3x.html b/doc/html/man/menu_format.3x.html new file mode 100644 index 00000000000..c419406c35e --- /dev/null +++ b/doc/html/man/menu_format.3x.html @@ -0,0 +1,133 @@ + + + + +menu_format 3x + + + + +

menu_format 3x

+
+
+
+menu_format(3x)                                         menu_format(3x)
+
+
+
+
+
+

NAME

+       menu_format - set and get menu sizes
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_format(MENU *menu, int rows, int cols);
+       void menu_format(const MENU *menu, int *rows, int *cols);
+
+
+
+

DESCRIPTION

+       The function set_menu_format sets the maximum display size
+       of the given menu.  If this size is too small  to  display
+       all  menu items, the menu will be made scrollable. If this
+       size is larger than the menus subwindow and the  subwindow
+       is  too  small to display all menu items, post_menu() will
+       fail.
+
+       The  default  format  is  16  rows,  1  column.    Calling
+       set_menu_format  with a null menu pointer will change this
+       default.  A zero row or column argument to set_menu_format
+       is  interpreted  as  a  request  not to change the current
+       value.
+
+       The function menu_format  returns  the  maximum-size  con-
+       straints  for the given menu into the storage addressed by
+       rows and cols.
+
+
+
+

RETURN VALUE

+       These routines returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu is already posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                        menu_format(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_hook.3x.html b/doc/html/man/menu_hook.3x.html new file mode 100644 index 00000000000..6a57ac7f8c7 --- /dev/null +++ b/doc/html/man/menu_hook.3x.html @@ -0,0 +1,138 @@ + + + + +menu_hook 3x + + + + +

menu_hook 3x

+
+
+
+menu_hook(3x)                                             menu_hook(3x)
+
+
+
+
+
+

NAME

+       menu_hook - set hooks for automatic invocation by applica-
+       tions
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_init(MENU *menu, Menu_Hook func);
+       Menu_Hook item_init(const MENU *menu);
+       int set_item_term(MENU *menu, Menu_Hook func);
+       Menu_Hook item_term(const MENU *menu);
+       int set_menu_init(MENU *menu, Menu_Hook func);
+       Menu_Hook menu_init(const MENU *menu);
+       int set_menu_term(MENU *menu, Menu_Hook func);
+       Menu_Hook menu_term(const MENU *menu);
+
+
+
+

DESCRIPTION

+       These functions make it possible to set hook functions  to
+       be called at various points in the automatic processing of
+       input event codes by menu_driver.
+
+       The function set_item_init sets a hook  to  be  called  at
+       menu-post  time  and  each  time the selected item changes
+       (after the change).  item_init returns  the  current  item
+       init hook, if any (NULL if there is no such hook).
+
+       The  function  set_item_term  sets  a hook to be called at
+       menu-unpost time and each time the selected  item  changes
+       (before  the  change).  item_term returns the current item
+       term hook, if any (NULL if there is no such hook).
+
+       The function set_menu_init sets a hook  to  be  called  at
+       menu-post  time  and  just  after  the top row on the menu
+       changes once it is posted.  menu_init returns the  current
+       menu init hook, if any (NULL if there is no such hook).
+
+       The  function  set_menu_term  sets  a hook to be called at
+       menu-unpost time and just before the top row on  the  menu
+       changes  once it is posted.  menu_term returns the current
+       menu term hook, if any (NULL if there is no such hook).
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.  Other
+       routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          menu_hook(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_items.3x.html b/doc/html/man/menu_items.3x.html new file mode 100644 index 00000000000..322247a6811 --- /dev/null +++ b/doc/html/man/menu_items.3x.html @@ -0,0 +1,138 @@ + + + + +menu_items 3x + + + + +

menu_items 3x

+
+
+
+menu_items(3x)                                           menu_items(3x)
+
+
+
+
+
+

NAME

+       menu_items  - make and break connections between items and
+       menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_items(MENU *menu, ITEM **items);
+       ITEM **menu_items(const MENU *menu);
+       int item_count(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The function set_menu_items changes the item pointer array
+       of  the  given  menu.   The  array must be terminated by a
+       NULL.
+
+       The function menu_items returns  the  item  array  of  the
+       given menu.
+
+       The  function  item_count  returns  the  count of items in
+       menu.
+
+
+
+

RETURN VALUES

+       The function menu_items returns a pointer  (which  may  be
+       NULL).  It does not set errno.
+
+       The  function  item_count  returns ERR (the general curses
+       error return value) if its menu parameter is NULL.
+
+       The function set_menu_items returns one of  the  following
+       codes on error:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+       E_POSTED
+            The menu is already posted.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The  SVr4  menu  library   documentation   specifies   the
+       item_count error value as -1 (which is the value of ERR).
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                         menu_items(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_mark.3x.html b/doc/html/man/menu_mark.3x.html new file mode 100644 index 00000000000..bdeaec69584 --- /dev/null +++ b/doc/html/man/menu_mark.3x.html @@ -0,0 +1,131 @@ + + + + +menu_mark 3x + + + + +

menu_mark 3x

+
+
+
+menu_mark(3x)                                             menu_mark(3x)
+
+
+
+
+
+

NAME

+       menu_mark - get and set the menu mark string
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_mark(MENU *menu, const char *mark);
+       const char *menu_mark(const MENU *menu);
+
+
+
+

DESCRIPTION

+       In  order  to make menu selections visible on older termi-
+       nals without highlighting or color  capability,  the  menu
+       library  marks  selected  items  in  a  menu with a prefix
+       string.
+
+       The function set_menu_mark sets the mark  string  for  the
+       given  menu.   Calling set_menu_mark with a null menu item
+       will abolish the mark  string.   Note  that  changing  the
+       length  of  the  mark  string for a menu while the menu is
+       posted is likely to produce unhelpful behavior.
+
+       The default string is "-" (a dash). Calling  set_menu_mark
+       with a non-NULL menu argument will change this default.
+
+       The  function menu_mark returns the menu's mark string (or
+       NULL if there is none).
+
+
+
+

RETURN VALUE

+       The function menu_mark returns a  pointer  (which  may  be
+       NULL).  It does not set errno.
+
+       The  function set_menu_mark may return the following error
+       codes:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          menu_mark(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_new.3x.html b/doc/html/man/menu_new.3x.html new file mode 100644 index 00000000000..fde5fcc17ed --- /dev/null +++ b/doc/html/man/menu_new.3x.html @@ -0,0 +1,129 @@ + + + + +menu_new 3x + + + + +

menu_new 3x

+
+
+
+menu_new(3x)                                               menu_new(3x)
+
+
+
+
+
+

NAME

+       menu_new - create and destroy menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       MENU *new_menu(ITEM **items);
+       int free_menu(MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  new_menu  creates a new menu connected to a
+       specified item pointer array (which  must  be  NULL-termi-
+       nated).
+
+       The  function  free_menu  disconnects  menu  from its item
+       array and frees the storage allocated for the menu.
+
+
+
+

RETURN VALUE

+       The function new_menu returns  NULL  on  error.   It  sets
+       errno according to the function's failure:
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+       E_SYSTEM_ERROR
+            System error occurred, e.g., malloc failure.
+
+       The function free_menu returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_POSTED
+            The menu has already been posted.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                           menu_new(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_opts.3x.html b/doc/html/man/menu_opts.3x.html new file mode 100644 index 00000000000..7853d4e62bc --- /dev/null +++ b/doc/html/man/menu_opts.3x.html @@ -0,0 +1,148 @@ + + + + +menu_opts 3x + + + + +

menu_opts 3x

+
+
+
+menu_opts(3x)                                             menu_opts(3x)
+
+
+
+
+
+

NAME

+       menu_opts - set and get menu options
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_opts(MENU *menu, Menu_Options opts);
+       int menu_opts_on(MENU *menu, Menu_Options opts);
+       int menu_opts_off(MENU *menu, Menu_Options opts);
+       Menu_Options menu_opts(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  set_menu_opts  sets  all  the  given menu's
+       option bits  (menu  option  bits  may  be  logically-OR'ed
+       together).
+
+       The  function menu_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function menu_opts_off  turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The  function  menu_opts returns the menu's current option
+       bits.
+
+       The following options are defined (all are on by default):
+
+       O_ONEVALUE
+            Only one item can be selected for this menu.
+
+       O_SHOWDESC
+            Display  the  item  descriptions  when  the  menu  is
+            posted.
+
+       O_ROWMAJOR
+            Display the menu in row-major order.
+
+       O_IGNORECASE
+            Ignore the case when pattern-matching.
+
+       O_SHOWMATCH
+            Move  the  cursor  to within the item name while pat-
+            tern-matching.
+
+       O_NONCYCLIC
+            Don't  wrap  around  next-item   and   previous-item,
+            requests to the other end of the menu.
+
+
+
+

RETURN VALUE

+       Except for menu_opts, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_POSTED
+            The menu is already posted.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                          menu_opts(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_pattern.3x.html b/doc/html/man/menu_pattern.3x.html new file mode 100644 index 00000000000..88e6cdb9534 --- /dev/null +++ b/doc/html/man/menu_pattern.3x.html @@ -0,0 +1,138 @@ + + + + +menu_pattern 3x + + + + +

menu_pattern 3x

+
+
+
+menu_pattern(3x)                                       menu_pattern(3x)
+
+
+
+
+
+

NAME

+       menu_pattern - get and set a menu's pattern buffer
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_pattern(MENU *menu, const char *pattern);
+       char *menu_pattern(const MENU *menu);
+
+
+
+

DESCRIPTION

+       Every  menu  has  an  associated pattern match buffer.  As
+       input events that are printable characters come  in,  they
+       are  appended to this match buffer and tested for a match,
+       as described in menu_driver(3x).
+
+       The function set_menu_pattern sets the pattern buffer  for
+       the  given menu and tries to find the first matching item.
+       If it succeeds, that item becomes  current;  if  not,  the
+       current item does not change.
+
+       The  function  menu_pattern  returns the pattern buffer of
+       the given menu.
+
+
+
+

RETURN VALUE

+       The function menu_pattern returns a pointer, which is NULL
+       if the menu parameter is NULL.  Otherwise, it is a pointer
+       to a string which is empty if no pattern has been set.  It
+       does not set errno.
+
+       The  function  set_menu_pattern  may  return the following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_CONNECTED
+            No items are connected to menu.
+
+       E_NO_MATCH
+            Character failed to match.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                       menu_pattern(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_post.3x.html b/doc/html/man/menu_post.3x.html new file mode 100644 index 00000000000..b8715f23069 --- /dev/null +++ b/doc/html/man/menu_post.3x.html @@ -0,0 +1,138 @@ + + + + +menu_post 3x + + + + +

menu_post 3x

+
+
+
+menu_post(3x)                                             menu_post(3x)
+
+
+
+
+
+

NAME

+       menu_post  -  write or erase menus from associated subwin-
+       dows
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int post_menu(MENU *menu);
+       int unpost_menu(MENU *menu);
+
+
+
+

DESCRIPTION

+       The function post_menu displays a menu to  its  associated
+       subwindow.   To trigger physical display of the subwindow,
+       use  refresh  or  some  equivalent  curses  routine   (the
+       implicit  doupdate  triggered  by  an curses input request
+       will do). post_menu resets the  selection  status  of  all
+       items.
+
+       The  function  unpost_menu erases menu from its associated
+       subwindow.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu has already been posted.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NO_ROOM
+            Menu is too large for its window. You should consider
+            to use set_menu_format() to solve the problem.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                          menu_post(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_requestname.3x.html b/doc/html/man/menu_requestname.3x.html new file mode 100644 index 00000000000..54926fd2d1c --- /dev/null +++ b/doc/html/man/menu_requestname.3x.html @@ -0,0 +1,112 @@ + + + + +menu_requestname 3x + + + + +

menu_requestname 3x

+
+
+
+menu_requestname(3x)                               menu_requestname(3x)
+
+
+
+
+
+

NAME

+       menu_requestname - handle printable menu request names
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       const char *menu_request_name(int request);
+       int menu_request_by_name(const char *name);
+
+
+
+

DESCRIPTION

+       The  function menu_request_name returns the printable name
+       of a menu request code.
+       The function menu_request_by_name searches in the name-ta-
+       ble  for  a  request  with  the given name and returns its
+       request code.  Otherwise E_NO_MATCH is returned.
+
+
+
+

RETURN VALUE

+       menu_request_name returns NULL on error and sets errno  to
+       E_BAD_ARGUMENT.
+       menu_request_by_name returns E_NO_MATCH on error.  It does
+       not set errno.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is recommended that any code depending on them be con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                   menu_requestname(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_spacing.3x.html b/doc/html/man/menu_spacing.3x.html new file mode 100644 index 00000000000..82e857562fd --- /dev/null +++ b/doc/html/man/menu_spacing.3x.html @@ -0,0 +1,129 @@ + + + + +menu_spacing 3x + + + + +

menu_spacing 3x

+
+
+
+menu_spacing(3x)                                       menu_spacing(3x)
+
+
+
+
+
+

NAME

+       menu_spacing - Control spacing between menu items.
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_spacing(MENU *menu,
+                            int spc_description,
+                            int spc_rows,
+                            int spc_columns);
+       int menu_spacing(const MENU *menu,
+                        int* spc_description,
+                        int* spc_rows,
+                        int* spc_columns);
+
+
+
+

DESCRIPTION

+       The function set_menu_spacing sets the spacing information
+       for the menu.  Its parameter spc_description controls  the
+       number of spaces between an item name and an item descrip-
+       tion.  It must not be larger than TABSIZE.  The menu  sys-
+       tem  puts in the middle of this spacing area the pad char-
+       acter.  The remaining parts are filled with  spaces.   The
+       spc_rows  parameter  controls  the number of rows that are
+       used for an item.  It must not be larger than 3.  The menu
+       system  inserts  the  blank lines between item rows, these
+       lines will contain the pad character  in  the  appropriate
+       positions.   The spc_columns parameter controls the number
+       of blanks between columns of items.  It must not be larger
+       than  TABSIZE.   A  value  of 0 for all the spacing values
+       resets them to the default, which is 1 for all of them.
+       The function menu_spacing passes back the spacing info for
+       the  menu.   If  a  pointer is NULL, this specific info is
+       simply not returned.
+
+
+
+

RETURN VALUE

+       Both routines return E_OK  on  success.   set_menu_spacing
+       may  return E_POSTED if the menu is posted, or E_BAD_ARGU-
+       MENT if one of the spacing values is out of range.
+
+
+
+

SEE ALSO

+       curses(3x), curs_variables(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is recommended that any code depending on them be con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                       menu_spacing(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_userptr.3x.html b/doc/html/man/menu_userptr.3x.html new file mode 100644 index 00000000000..be4f7d0d555 --- /dev/null +++ b/doc/html/man/menu_userptr.3x.html @@ -0,0 +1,112 @@ + + + + +menu_userptr 3x + + + + +

menu_userptr 3x

+
+
+
+menu_userptr(3x)                                       menu_userptr(3x)
+
+
+
+
+
+

NAME

+       menu_userptr - associate application data with a menu item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_userptr(MENU *menu, void *userptr);
+       void *menu_userptr(const MENU *menu);
+
+
+
+

DESCRIPTION

+       Every  menu  and  every  menu item has a field that can be
+       used to hold application-specific data (that is, the menu-
+       driver code leaves it alone).  These functions get and set
+       the menu user pointer field.
+
+
+
+

RETURN VALUE

+       menu_userptr returns a pointer (which may  be  NULL).   It
+       does not set errno.
+
+       set_menu_userptr returns E_OK (success).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer is a void pointer.  We chose not to leave
+       it as a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                       menu_userptr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/menu_win.3x.html b/doc/html/man/menu_win.3x.html new file mode 100644 index 00000000000..64e685edfb1 --- /dev/null +++ b/doc/html/man/menu_win.3x.html @@ -0,0 +1,139 @@ + + + + +menu_win 3x + + + + +

menu_win 3x

+
+
+
+menu_win(3x)                                               menu_win(3x)
+
+
+
+
+
+

NAME

+       menu_win  - make and break menu window and subwindow asso-
+       ciations
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_win(MENU *menu, WINDOW *win);
+       WINDOW *menu_win(const MENU *menu);
+       int set_menu_sub(MENU *menu, WINDOW *sub);
+       WINDOW *menu_sub(const MENU *menu);
+       int scale_menu(const MENU *menu, int *rows, int *columns);
+
+
+
+

DESCRIPTION

+       Every menu has an associated pair of curses windows.   The
+       menu  window displays any title and border associated with
+       the window; the menu subwindow displays the items  of  the
+       menu that are currently available for selection.
+
+       The first four functions get and set those windows.  It is
+       not necessary to set either window; by default, the driver
+       code uses stdscr for both.
+
+       In  the set_ functions, window argument of NULL is treated
+       as though it were stsdcr.  A  menu  argument  of  NULL  is
+       treated  as  a  request  to change the system default menu
+       window or subwindow.
+
+       The function scale_menu returns the minimum size  required
+       for the subwindow of menu.
+
+
+
+

RETURN VALUE

+       Routines  that return pointers return NULL on error.  Rou-
+       tines that return an integer return one of  the  following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_POSTED
+            The menu has already been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       curses(3x), curs_variables(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                           menu_win(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_current.3x.html b/doc/html/man/mitem_current.3x.html new file mode 100644 index 00000000000..d496682c722 --- /dev/null +++ b/doc/html/man/mitem_current.3x.html @@ -0,0 +1,146 @@ + + + + +mitem_current 3x + + + + +

mitem_current 3x

+
+
+
+mitem_current(3x)                                     mitem_current(3x)
+
+
+
+
+
+

NAME

+       mitem_current - set and get current_menu_item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_current_item(MENU *menu, const ITEM *item);
+       ITEM *current_item(const MENU *menu);
+       int set_top_row(MENU *menu, int row);
+       int top_row(const MENU *menu);
+       int item_index(const ITEM *item);
+
+
+
+

DESCRIPTION

+       The  function  set_current_item sets the current item (the
+       item on  which  the  menu  cursor  is  positioned).   cur-
+       rent_item  returns  a  pointer  to the current item in the
+       given menu.
+
+       The function set_top_row sets the top row of the  menu  to
+       show  the  given  row  (the top row is initially 0, and is
+       reset to this value whenever the O_ROWMAJOR option is tog-
+       gled).   The  item  leftmost on the given row becomes cur-
+       rent.  The function top_row returns the number of the  top
+       menu row being displayed.
+
+       The function item_index returns the (zero-origin) index of
+       item in the menu's item pointer list.
+
+
+
+

RETURN VALUE

+       current_item returns a pointer (which may  be  NULL).   It
+       does not set errno.
+
+       top_row  and  item_index  return  ERR  (the general curses
+       error value) if their menu parameter is NULL.
+
+       set_current_item and set_top_row return one of the follow-
+       ing:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       The  SVr4 menu library documentation specifies the top_row
+       and index_item error value as -1 (which is  the  value  of
+       ERR).
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                      mitem_current(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_name.3x.html b/doc/html/man/mitem_name.3x.html new file mode 100644 index 00000000000..e596bbf2fab --- /dev/null +++ b/doc/html/man/mitem_name.3x.html @@ -0,0 +1,107 @@ + + + + +mitem_name 3x + + + + +

mitem_name 3x

+
+
+
+mitem_name(3x)                                           mitem_name(3x)
+
+
+
+
+
+

NAME

+       mitem_name - get menu item name and description fields
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       const char *item_name(const ITEM *item);
+       const char *item_description(const ITEM *item);
+
+
+
+

DESCRIPTION

+       The  function item_name returns the name part of the given
+       item.
+       The function item_description returns the description part
+       of the given item.
+
+
+
+

RETURN VALUE

+       These routines return a pointer (which may be NULL).  They
+       do not set errno.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                         mitem_name(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_new.3x.html b/doc/html/man/mitem_new.3x.html new file mode 100644 index 00000000000..4b6e1f378ba --- /dev/null +++ b/doc/html/man/mitem_new.3x.html @@ -0,0 +1,134 @@ + + + + +mitem_new 3x + + + + +

mitem_new 3x

+
+
+
+mitem_new(3x)                                             mitem_new(3x)
+
+
+
+
+
+

NAME

+       mitem_new - create and destroy menu items
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       ITEM *new_item(const char *name, const char *description);
+       int free_item(ITEM *item);
+
+
+
+

DESCRIPTION

+       The function new_item allocates a new item and initializes
+       it from the name and description pointers.  Please  notice
+       that  the  item  stores  only the pointers to the name and
+       description. Those pointers must be valid during the life-
+       time of the item. So you should be very careful with names
+       or descriptions allocated on the stack of some routines.
+       The function free_item de-allocates an item. Please notice
+       that  it  is  the  responsibility  of  the  application to
+       release the memory for the name or the description of  the
+       item.
+
+
+
+

RETURN VALUE

+       The  function  new_item  returns  NULL  on error.  It sets
+       errno according to the function's failure:
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_SYSTEM_ERROR
+            System error occurred, e.g., malloc failure.
+
+       The function free_item returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_CONNECTED
+            Item is connected to a menu.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                          mitem_new(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_opts.3x.html b/doc/html/man/mitem_opts.3x.html new file mode 100644 index 00000000000..27d44a5b0f9 --- /dev/null +++ b/doc/html/man/mitem_opts.3x.html @@ -0,0 +1,126 @@ + + + + +mitem_opts 3x + + + + +

mitem_opts 3x

+
+
+
+mitem_opts(3x)                                           mitem_opts(3x)
+
+
+
+
+
+

NAME

+       mitem_opts - set and get menu item options
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_opts(ITEM *item, Item_Options opts);
+       int item_opts_on(ITEM *item, Item_Options opts);
+       int item_opts_off(ITEM *item, Item_Options opts);
+       Item_Options item_opts(const ITEM *item);
+
+
+
+

DESCRIPTION

+       The  function  set_item_opts  sets  all  the  given item's
+       option bits  (menu  option  bits  may  be  logically-OR'ed
+       together).
+
+       The  function item_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function item_opts_off  turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The  function  item_opts returns the item's current option
+       bits.
+
+       There is only one defined option bit  mask,  O_SELECTABLE.
+       When this is on, the item may be selected during menu pro-
+       cessing.  This option defaults to on.
+
+
+
+

RETURN VALUE

+       Except for item_opts, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+                                                         mitem_opts(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_userptr.3x.html b/doc/html/man/mitem_userptr.3x.html new file mode 100644 index 00000000000..5cc957efc98 --- /dev/null +++ b/doc/html/man/mitem_userptr.3x.html @@ -0,0 +1,112 @@ + + + + +mitem_userptr 3x + + + + +

mitem_userptr 3x

+
+
+
+mitem_userptr(3x)                                     mitem_userptr(3x)
+
+
+
+
+
+

NAME

+       mitem_userptr  -  associate  application  data with a menu
+       item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_userptr(ITEM *item, void *userptr);
+       void *item_userptr(const ITEM *item);
+
+
+
+

DESCRIPTION

+       Every menu item has a field  that  can  be  used  to  hold
+       application-specific  data  (that is, the menu-driver code
+       leaves it alone).  These functions get and set that field.
+
+
+
+

RETURN VALUE

+       The function  item_userptr  returns  a  pointer  (possibly
+       NULL).  It does not set errno.
+
+       The set_item_userptr always returns E_OK (success).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer is a void pointer.  We chose not to leave
+       it as a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                      mitem_userptr(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_value.3x.html b/doc/html/man/mitem_value.3x.html new file mode 100644 index 00000000000..e68a2b0a3b1 --- /dev/null +++ b/doc/html/man/mitem_value.3x.html @@ -0,0 +1,117 @@ + + + + +mitem_value 3x + + + + +

mitem_value 3x

+
+
+
+mitem_value(3x)                                         mitem_value(3x)
+
+
+
+
+
+

NAME

+       mitem_value - set and get menu item values
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_value(ITEM *item, bool value);
+       bool item_value(const ITEM *item);
+
+
+
+

DESCRIPTION

+       If  you  turn  off  the menu option O_ONEVALUE (e.g., with
+       set_menu_opts or menu_opts_off;  see  menu_opts(3x)),  the
+       menu becomes multi-valued; that is, more than one item may
+       simultaneously be selected.
+
+       In a multi_valued menu, you  can  used  set_item_value  to
+       select the given menu item (second argument TRUE) or dese-
+       lect it (second argument FALSE).
+
+
+
+

RETURN VALUE

+       The function set_item_value returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_REQUEST_DENIED
+            The menu driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                        mitem_value(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/mitem_visible.3x.html b/doc/html/man/mitem_visible.3x.html new file mode 100644 index 00000000000..52cdbdbe2b1 --- /dev/null +++ b/doc/html/man/mitem_visible.3x.html @@ -0,0 +1,100 @@ + + + + +mitem_visible 3x + + + + +

mitem_visible 3x

+
+
+
+mitem_visible(3x)                                     mitem_visible(3x)
+
+
+
+
+
+

NAME

+       mitem_visible - check visibility of a menu item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       bool item_visible(const ITEM *item);
+
+
+
+

DESCRIPTION

+       A  menu  item  is  visible  when it is in the portion of a
+       posted menu that is mapped onto the screen (if the menu is
+       scrollable,  in  particular,  this portion will be smaller
+       than the whole menu).
+
+
+
+

SEE ALSO

+       curses(3x), menu(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+                                                      mitem_visible(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html new file mode 100644 index 00000000000..57f28a07111 --- /dev/null +++ b/doc/html/man/ncurses.3x.html @@ -0,0 +1,1267 @@ + + + + +ncurses 3x + + + + +

ncurses 3x

+
+
+
+ncurses(3x)                                                 ncurses(3x)
+
+
+
+
+
+

NAME

+       ncurses - CRT screen handling and optimization package
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+
+
+

DESCRIPTION

+       The  ncurses  library  routines  give the user a terminal-
+       independent method of updating character screens with rea-
+       sonable   optimization.    This  implementation  is  ``new
+       curses'' (ncurses) and is  the  approved  replacement  for
+       4.4BSD  classic curses, which has been discontinued.  This
+       describes ncurses version 5.8 (patch 20110226).
+
+       The ncurses library emulates the curses library of  System
+       V  Release  4  UNIX,  and  XPG4 (X/Open Portability Guide)
+       curses (also known as XSI curses).  XSI stands for  X/Open
+       System  Interfaces  Extension.   The  ncurses  library  is
+       freely redistributable in source form.   Differences  from
+       the  SVr4  curses  are summarized under the EXTENSIONS and
+       PORTABILITY sections below and described in detail in  the
+       respective  EXTENSIONS,  PORTABILITY  and BUGS sections of
+       individual man pages.
+
+       The ncurses library also provides many useful  extensions,
+       i.e.,  features  which  cannot  be implemented by a simple
+       add-on library but which require access to  the  internals
+       of the library.
+
+       A  program  using  these  routines must be linked with the
+       -lncurses option, or (if it has been generated)  with  the
+       debugging  library  -lncurses_g.   (Your system integrator
+       may also have installed these libraries  under  the  names
+       -lcurses and -lcurses_g.)  The ncurses_g library generates
+       trace logs (in a file called 'trace' in the current direc-
+       tory)  that describe curses actions.  See also the section
+       on ALTERNATE CONFIGURATIONS.
+
+       The ncurses package supports: overall screen,  window  and
+       pad manipulation; output to windows and pads; reading ter-
+       minal input; control over terminal and  curses  input  and
+       output  options; environment query routines; color manipu-
+       lation; use of soft label keys; terminfo capabilities; and
+       access to low-level terminal-manipulation routines.
+
+       The  library uses the locale which the calling program has
+       initialized.  That is normally done with setlocale:
+
+             setlocale(LC_ALL, "");
+
+       If the locale is not initialized, the library assumes that
+       characters  are  printable  as in ISO-8859-1, to work with
+       certain legacy programs.  You should initialize the locale
+       and  not  rely on specific details of the library when the
+       locale has not been setup.
+
+       The function initscr or newterm must be called to initial-
+       ize the library before any of the other routines that deal
+       with windows and screens are  used.   The  routine  endwin
+       must be called before exiting.
+
+       To  get  character-at-a-time  input  without echoing (most
+       interactive, screen oriented programs want this), the fol-
+       lowing sequence should be used:
+
+             initscr(); cbreak(); noecho();
+
+       Most programs would additionally use the sequence:
+
+             nonl();
+             intrflush(stdscr, FALSE);
+             keypad(stdscr, TRUE);
+
+       Before  a curses program is run, the tab stops of the ter-
+       minal should be set and  its  initialization  strings,  if
+       defined,  must  be  output.  This can be done by executing
+       the tput init command after the shell environment variable
+       TERM  has  been  exported.  tset(1) is usually responsible
+       for doing this.  [See terminfo(5) for further details.]
+
+       The ncurses library permits manipulation  of  data  struc-
+       tures,  called  windows,  which  can be thought of as two-
+       dimensional arrays of characters representing all or  part
+       of a CRT screen.  A default window called stdscr, which is
+       the size of the terminal screen, is supplied.  Others  may
+       be created with newwin.
+
+       Note  that  curses  does  not  handle overlapping windows,
+       that's done by the panel(3x) library.  This means that you
+       can either use stdscr or divide the screen into tiled win-
+       dows and not using stdscr at all.   Mixing  the  two  will
+       result in unpredictable, and undesired, effects.
+
+       Windows are referred to by variables declared as WINDOW *.
+       These  data  structures  are  manipulated  with   routines
+       described  here and elsewhere in the ncurses manual pages.
+       Among those, the most basic routines are move  and  addch.
+       More  general versions of these routines are included with
+       names beginning with w, allowing the  user  to  specify  a
+       window.   The routines not beginning with w affect stdscr.
+
+       After using routines to manipulate a  window,  refresh  is
+       called,  telling curses to make the user's CRT screen look
+       like stdscr.  The characters in a window are  actually  of
+       type  chtype, (character and attribute data) so that other
+       information about the character may also  be  stored  with
+       each character.
+
+       Special  windows  called  pads  may  also  be manipulated.
+       These are windows which are not constrained to the size of
+       the  screen and whose contents need not be completely dis-
+       played.  See curs_pad(3x) for more information.
+
+       In addition to drawing characters  on  the  screen,  video
+       attributes  and colors may be supported, causing the char-
+       acters to show up in such modes as underlined, in  reverse
+       video,  or in color on terminals that support such display
+       enhancements.  Line drawing characters may be specified to
+       be  output.   On  input,  curses is also able to translate
+       arrow and function keys  that  transmit  escape  sequences
+       into  single  values.   The video attributes, line drawing
+       characters,  and  input  values  use  names,  defined   in
+       <curses.h>, such as A_REVERSE, ACS_HLINE, and KEY_LEFT.
+
+       If the environment variables LINES and COLUMNS are set, or
+       if the program is executing in a window environment,  line
+       and  column  information  in the environment will override
+       information read by terminfo.  This would affect a program
+       running  in an AT&T 630 layer, for example, where the size
+       of a screen is changeable (see ENVIRONMENT).
+
+       If the environment variable TERMINFO is defined, any  pro-
+       gram  using  curses checks for a local terminal definition
+       before checking in the standard place.   For  example,  if
+       TERM is set to att4424, then the compiled terminal defini-
+       tion is found in
+
+             /usr/share/terminfo/a/att4424.
+
+       (The a is copied from the first letter of att4424 to avoid
+       creation  of  huge  directories.)  However, if TERMINFO is
+       set to $HOME/myterms, curses first checks
+
+             $HOME/myterms/a/att4424,
+
+       and if that fails, it then checks
+
+             /usr/share/terminfo/a/att4424.
+
+       This is useful for developing experimental definitions  or
+       when write permission in /usr/share/terminfo is not avail-
+       able.
+
+       The integer  variables  LINES  and  COLS  are  defined  in
+       <curses.h>  and will be filled in by initscr with the size
+       of the screen.  The constants TRUE and FALSE have the val-
+       ues 1 and 0, respectively.
+
+       The  curses  routines  also  define  the WINDOW * variable
+       curscr which is used for certain low-level operations like
+       clearing  and  redrawing a screen containing garbage.  The
+       curscr can be used in only a few routines.
+
+   Routine and Argument Names
+       Many curses routines have two or more versions.  The  rou-
+       tines prefixed with w require a window argument.  The rou-
+       tines prefixed with p require a pad argument.  Those with-
+       out a prefix generally use stdscr.
+
+       The routines prefixed with mv require a y and x coordinate
+       to move to before performing the appropriate action.   The
+       mv  routines  imply  a call to move before the call to the
+       other routine.  The coordinate y always refers to the  row
+       (of  the  window), and x always refers to the column.  The
+       upper left-hand corner is always (0,0), not (1,1).
+
+       The routines prefixed with mvw take both a window argument
+       and  x  and  y coordinates.  The window argument is always
+       specified before the coordinates.
+
+       In each case, win is the window affected, and pad  is  the
+       pad affected; win and pad are always pointers to type WIN-
+       DOW.
+
+       Option setting routines require a Boolean flag bf with the
+       value  TRUE  or FALSE; bf is always of type bool.  Most of
+       the data types used in the library routines, such as  WIN-
+       DOW,  SCREEN,  bool, and chtype are defined in <curses.h>.
+       Types used for the terminfo routines such as TERMINAL  are
+       defined in <term.h>.
+
+       This  manual  page describes functions which may appear in
+       any configuration of the library.  There  are  two  common
+       configurations of the library:
+
+              ncurses
+                   the  "normal"  library,  which  handles  8-bit
+                   characters.  The normal (8-bit) library stores
+                   characters  combined with attributes in chtype
+                   data.
+
+                   Attributes alone (no corresponding  character)
+                   may  be  stored  in  chtype  or the equivalent
+                   attr_t data.  In  either  case,  the  data  is
+                   stored in something like an integer.
+
+                   Each  cell  (row  and  column)  in a WINDOW is
+                   stored as a chtype.
+
+              ncursesw
+                   the so-called "wide"  library,  which  handles
+                   multibyte   characters  (see  the  section  on
+                   ALTERNATE CONFIGURATIONS).  The "wide" library
+                   includes  all  of  the calls from the "normal"
+                   library.  It adds about one third  more  calls
+                   using data types which store multibyte charac-
+                   ters:
+
+                   cchar_t
+                        corresponds to chtype.  However it  is  a
+                        structure,  because  more  data is stored
+                        than can fit into an integer.  The  char-
+                        acters are large enough to require a full
+                        integer value - and  there  may  be  more
+                        than  one  character per cell.  The video
+                        attributes and color are stored in  sepa-
+                        rate fields of the structure.
+
+                        Each cell (row and column) in a WINDOW is
+                        stored as a cchar_t.
+
+                   wchar_t
+                        stores a "wide" character.  Like  chtype,
+                        this may be an integer.
+
+                   wint_t
+                        stores  a wchar_t or WEOF - not the same,
+                        though both may have the same size.
+
+                   The  "wide"  library  provides  new  functions
+                   which  are analogous to functions in the "nor-
+                   mal" library.  There is  a  naming  convention
+                   which  relates  many  of the normal/wide vari-
+                   ants: a "_w" is inserted into the  name.   For
+                   example, waddch becomes wadd_wch.
+
+
+   Routine Name Index
+       The following table lists each curses routine and the name
+       of the manual page on which  it  is  described.   Routines
+       flagged  with  `*'  are ncurses-specific, not described by
+       XPG4 or present in SVr4.
+
+
+              curses Routine Name     Manual Page Name
+              --------------------------------------------
+              COLOR_PAIR              curs_color(3x)
+              PAIR_NUMBER             curs_attr(3x)
+              _nc_free_and_exit       curs_memleaks(3x)*
+
+              _nc_freeall             curs_memleaks(3x)*
+              _nc_tracebits           curs_trace(3x)*
+              _traceattr              curs_trace(3x)*
+              _traceattr2             curs_trace(3x)*
+              _tracechar              curs_trace(3x)*
+              _tracechtype            curs_trace(3x)*
+              _tracechtype2           curs_trace(3x)*
+              _tracedump              curs_trace(3x)*
+              _tracef                 curs_trace(3x)*
+              _tracemouse             curs_trace(3x)*
+              add_wch                 curs_add_wch(3x)
+              add_wchnstr             curs_add_wchstr(3x)
+              add_wchstr              curs_add_wchstr(3x)
+              addch                   curs_addch(3x)
+              addchnstr               curs_addchstr(3x)
+              addchstr                curs_addchstr(3x)
+              addnstr                 curs_addstr(3x)
+              addnwstr                curs_addwstr(3x)
+              addstr                  curs_addstr(3x)
+              addwstr                 curs_addwstr(3x)
+              assume_default_colors   default_colors(3x)*
+              attr_get                curs_attr(3x)
+              attr_off                curs_attr(3x)
+              attr_on                 curs_attr(3x)
+              attr_set                curs_attr(3x)
+              attroff                 curs_attr(3x)
+              attron                  curs_attr(3x)
+              attrset                 curs_attr(3x)
+              baudrate                curs_termattrs(3x)
+              beep                    curs_beep(3x)
+              bkgd                    curs_bkgd(3x)
+              bkgdset                 curs_bkgd(3x)
+              bkgrnd                  curs_bkgrnd(3x)
+              bkgrndset               curs_bkgrnd(3x)
+              border                  curs_border(3x)
+              border_set              curs_border_set(3x)
+              box                     curs_border(3x)
+              box_set                 curs_border_set(3x)
+              can_change_color        curs_color(3x)
+              cbreak                  curs_inopts(3x)
+              chgat                   curs_attr(3x)
+              clear                   curs_clear(3x)
+              clearok                 curs_outopts(3x)
+              clrtobot                curs_clear(3x)
+              clrtoeol                curs_clear(3x)
+              color_content           curs_color(3x)
+              color_set               curs_attr(3x)
+              copywin                 curs_overlay(3x)
+              curs_set                curs_kernel(3x)
+              curses_version          curs_extend(3x)*
+              def_prog_mode           curs_kernel(3x)
+              def_shell_mode          curs_kernel(3x)
+              define_key              define_key(3x)*
+              del_curterm             curs_terminfo(3x)
+              delay_output            curs_util(3x)
+              delch                   curs_delch(3x)
+              deleteln                curs_deleteln(3x)
+              delscreen               curs_initscr(3x)
+              delwin                  curs_window(3x)
+              derwin                  curs_window(3x)
+              doupdate                curs_refresh(3x)
+              dupwin                  curs_window(3x)
+              echo                    curs_inopts(3x)
+              echo_wchar              curs_add_wch(3x)
+              echochar                curs_addch(3x)
+
+              endwin                  curs_initscr(3x)
+              erase                   curs_clear(3x)
+              erasechar               curs_termattrs(3x)
+              erasewchar              curs_termattrs(3x)
+              filter                  curs_util(3x)
+              flash                   curs_beep(3x)
+              flushinp                curs_util(3x)
+              get_wch                 curs_get_wch(3x)
+              get_wstr                curs_get_wstr(3x)
+              getattrs                curs_attr(3x)
+              getbegx                 curs_legacy(3x)*
+              getbegy                 curs_legacy(3x)*
+              getbegyx                curs_getyx(3x)
+              getbkgd                 curs_bkgd(3x)
+              getbkgrnd               curs_bkgrnd(3x)
+              getcchar                curs_getcchar(3x)
+              getch                   curs_getch(3x)
+              getcurx                 curs_legacy(3x)*
+              getcury                 curs_legacy(3x)*
+              getmaxx                 curs_legacy(3x)*
+              getmaxy                 curs_legacy(3x)*
+              getmaxyx                curs_getyx(3x)
+              getmouse                curs_mouse(3x)*
+              getn_wstr               curs_get_wstr(3x)
+              getnstr                 curs_getstr(3x)
+              getparx                 curs_legacy(3x)*
+              getpary                 curs_legacy(3x)*
+              getparyx                curs_getyx(3x)
+              getstr                  curs_getstr(3x)
+              getsyx                  curs_kernel(3x)
+              getwin                  curs_util(3x)
+              getyx                   curs_getyx(3x)
+              halfdelay               curs_inopts(3x)
+              has_colors              curs_color(3x)
+              has_ic                  curs_termattrs(3x)
+              has_il                  curs_termattrs(3x)
+              has_key                 curs_getch(3x)*
+              hline                   curs_border(3x)
+              hline_set               curs_border_set(3x)
+              idcok                   curs_outopts(3x)
+              idlok                   curs_outopts(3x)
+              immedok                 curs_outopts(3x)
+              in_wch                  curs_in_wch(3x)
+              in_wchnstr              curs_in_wchstr(3x)
+              in_wchstr               curs_in_wchstr(3x)
+              inch                    curs_inch(3x)
+              inchnstr                curs_inchstr(3x)
+              inchstr                 curs_inchstr(3x)
+              init_color              curs_color(3x)
+              init_pair               curs_color(3x)
+              initscr                 curs_initscr(3x)
+              innstr                  curs_instr(3x)
+              innwstr                 curs_inwstr(3x)
+              ins_nwstr               curs_ins_wstr(3x)
+              ins_wch                 curs_ins_wch(3x)
+              ins_wstr                curs_ins_wstr(3x)
+              insch                   curs_insch(3x)
+              insdelln                curs_deleteln(3x)
+              insertln                curs_deleteln(3x)
+              insnstr                 curs_insstr(3x)
+              insstr                  curs_insstr(3x)
+              instr                   curs_instr(3x)
+              intrflush               curs_inopts(3x)
+              inwstr                  curs_inwstr(3x)
+              is_cleared              curs_opaque(3x)*
+
+              is_idcok                curs_opaque(3x)*
+              is_idlok                curs_opaque(3x)*
+              is_immedok              curs_opaque(3x)*
+              is_keypad               curs_opaque(3x)*
+              is_leaveok              curs_opaque(3x)*
+              is_linetouched          curs_touch(3x)
+              is_nodelay              curs_opaque(3x)*
+              is_notimeout            curs_opaque(3x)*
+              is_scrollok             curs_opaque(3x)*
+              is_syncok               curs_opaque(3x)*
+              is_term_resized         resizeterm(3x)*
+              is_wintouched           curs_touch(3x)
+              isendwin                curs_initscr(3x)
+              key_defined             key_defined(3x)*
+              key_name                curs_util(3x)
+              keybound                keybound(3x)*
+              keyname                 curs_util(3x)
+              keyok                   keyok(3x)*
+              keypad                  curs_inopts(3x)
+              killchar                curs_termattrs(3x)
+              killwchar               curs_termattrs(3x)
+              leaveok                 curs_outopts(3x)
+              longname                curs_termattrs(3x)
+              mcprint                 curs_print(3x)*
+              meta                    curs_inopts(3x)
+              mouse_trafo             curs_mouse(3x)*
+              mouseinterval           curs_mouse(3x)*
+              mousemask               curs_mouse(3x)*
+              move                    curs_move(3x)
+              mvadd_wch               curs_add_wch(3x)
+              mvadd_wchnstr           curs_add_wchstr(3x)
+              mvadd_wchstr            curs_add_wchstr(3x)
+              mvaddch                 curs_addch(3x)
+              mvaddchnstr             curs_addchstr(3x)
+              mvaddchstr              curs_addchstr(3x)
+              mvaddnstr               curs_addstr(3x)
+              mvaddnwstr              curs_addwstr(3x)
+              mvaddstr                curs_addstr(3x)
+              mvaddwstr               curs_addwstr(3x)
+              mvchgat                 curs_attr(3x)
+              mvcur                   curs_terminfo(3x)
+              mvdelch                 curs_delch(3x)
+              mvderwin                curs_window(3x)
+              mvget_wch               curs_get_wch(3x)
+              mvget_wstr              curs_get_wstr(3x)
+              mvgetch                 curs_getch(3x)
+              mvgetn_wstr             curs_get_wstr(3x)
+              mvgetnstr               curs_getstr(3x)
+              mvgetstr                curs_getstr(3x)
+              mvhline                 curs_border(3x)
+              mvhline_set             curs_border_set(3x)
+              mvin_wch                curs_in_wch(3x)
+              mvin_wchnstr            curs_in_wchstr(3x)
+              mvin_wchstr             curs_in_wchstr(3x)
+              mvinch                  curs_inch(3x)
+              mvinchnstr              curs_inchstr(3x)
+              mvinchstr               curs_inchstr(3x)
+              mvinnstr                curs_instr(3x)
+              mvinnwstr               curs_inwstr(3x)
+              mvins_nwstr             curs_ins_wstr(3x)
+              mvins_wch               curs_ins_wch(3x)
+              mvins_wstr              curs_ins_wstr(3x)
+              mvinsch                 curs_insch(3x)
+              mvinsnstr               curs_insstr(3x)
+              mvinsstr                curs_insstr(3x)
+
+              mvinstr                 curs_instr(3x)
+              mvinwstr                curs_inwstr(3x)
+              mvprintw                curs_printw(3x)
+              mvscanw                 curs_scanw(3x)
+              mvvline                 curs_border(3x)
+              mvvline_set             curs_border_set(3x)
+              mvwadd_wch              curs_add_wch(3x)
+              mvwadd_wchnstr          curs_add_wchstr(3x)
+              mvwadd_wchstr           curs_add_wchstr(3x)
+              mvwaddch                curs_addch(3x)
+              mvwaddchnstr            curs_addchstr(3x)
+              mvwaddchstr             curs_addchstr(3x)
+              mvwaddnstr              curs_addstr(3x)
+              mvwaddnwstr             curs_addwstr(3x)
+              mvwaddstr               curs_addstr(3x)
+              mvwaddwstr              curs_addwstr(3x)
+              mvwchgat                curs_attr(3x)
+              mvwdelch                curs_delch(3x)
+              mvwget_wch              curs_get_wch(3x)
+              mvwget_wstr             curs_get_wstr(3x)
+              mvwgetch                curs_getch(3x)
+              mvwgetn_wstr            curs_get_wstr(3x)
+              mvwgetnstr              curs_getstr(3x)
+              mvwgetstr               curs_getstr(3x)
+              mvwhline                curs_border(3x)
+              mvwhline_set            curs_border_set(3x)
+              mvwin                   curs_window(3x)
+              mvwin_wch               curs_in_wch(3x)
+              mvwin_wchnstr           curs_in_wchstr(3x)
+              mvwin_wchstr            curs_in_wchstr(3x)
+              mvwinch                 curs_inch(3x)
+              mvwinchnstr             curs_inchstr(3x)
+              mvwinchstr              curs_inchstr(3x)
+              mvwinnstr               curs_instr(3x)
+              mvwinnwstr              curs_inwstr(3x)
+              mvwins_nwstr            curs_ins_wstr(3x)
+              mvwins_wch              curs_ins_wch(3x)
+              mvwins_wstr             curs_ins_wstr(3x)
+              mvwinsch                curs_insch(3x)
+              mvwinsnstr              curs_insstr(3x)
+              mvwinsstr               curs_insstr(3x)
+              mvwinstr                curs_instr(3x)
+              mvwinwstr               curs_inwstr(3x)
+              mvwprintw               curs_printw(3x)
+              mvwscanw                curs_scanw(3x)
+              mvwvline                curs_border(3x)
+              mvwvline_set            curs_border_set(3x)
+              napms                   curs_kernel(3x)
+              newpad                  curs_pad(3x)
+              newterm                 curs_initscr(3x)
+              newwin                  curs_window(3x)
+              nl                      curs_outopts(3x)
+              nocbreak                curs_inopts(3x)
+              nodelay                 curs_inopts(3x)
+              noecho                  curs_inopts(3x)
+              nofilter                curs_util(3x)*
+              nonl                    curs_outopts(3x)
+              noqiflush               curs_inopts(3x)
+              noraw                   curs_inopts(3x)
+              notimeout               curs_inopts(3x)
+              overlay                 curs_overlay(3x)
+              overwrite               curs_overlay(3x)
+              pair_content            curs_color(3x)
+              pechochar               curs_pad(3x)
+              pnoutrefresh            curs_pad(3x)
+
+              prefresh                curs_pad(3x)
+              printw                  curs_printw(3x)
+              putp                    curs_terminfo(3x)
+              putwin                  curs_util(3x)
+              qiflush                 curs_inopts(3x)
+              raw                     curs_inopts(3x)
+              redrawwin               curs_refresh(3x)
+              refresh                 curs_refresh(3x)
+              reset_prog_mode         curs_kernel(3x)
+              reset_shell_mode        curs_kernel(3x)
+              resetty                 curs_kernel(3x)
+              resizeterm              resizeterm(3x)*
+              restartterm             curs_terminfo(3x)
+              ripoffline              curs_kernel(3x)
+              savetty                 curs_kernel(3x)
+              scanw                   curs_scanw(3x)
+              scr_dump                curs_scr_dump(3x)
+              scr_init                curs_scr_dump(3x)
+              scr_restore             curs_scr_dump(3x)
+              scr_set                 curs_scr_dump(3x)
+              scrl                    curs_scroll(3x)
+              scroll                  curs_scroll(3x)
+              scrollok                curs_outopts(3x)
+              set_curterm             curs_terminfo(3x)
+              set_term                curs_initscr(3x)
+              setcchar                curs_getcchar(3x)
+              setscrreg               curs_outopts(3x)
+              setsyx                  curs_kernel(3x)
+              setterm                 curs_terminfo(3x)
+              setupterm               curs_terminfo(3x)
+              slk_attr                curs_slk(3x)*
+              slk_attr_off            curs_slk(3x)
+              slk_attr_on             curs_slk(3x)
+              slk_attr_set            curs_slk(3x)
+              slk_attroff             curs_slk(3x)
+              slk_attron              curs_slk(3x)
+              slk_attrset             curs_slk(3x)
+              slk_clear               curs_slk(3x)
+              slk_color               curs_slk(3x)
+              slk_init                curs_slk(3x)
+              slk_label               curs_slk(3x)
+              slk_noutrefresh         curs_slk(3x)
+              slk_refresh             curs_slk(3x)
+              slk_restore             curs_slk(3x)
+              slk_set                 curs_slk(3x)
+              slk_touch               curs_slk(3x)
+              standend                curs_attr(3x)
+              standout                curs_attr(3x)
+              start_color             curs_color(3x)
+              subpad                  curs_pad(3x)
+              subwin                  curs_window(3x)
+              syncok                  curs_window(3x)
+              term_attrs              curs_termattrs(3x)
+              termattrs               curs_termattrs(3x)
+              termname                curs_termattrs(3x)
+              tgetent                 curs_termcap(3x)
+              tgetflag                curs_termcap(3x)
+              tgetnum                 curs_termcap(3x)
+              tgetstr                 curs_termcap(3x)
+              tgoto                   curs_termcap(3x)
+              tigetflag               curs_terminfo(3x)
+              tigetnum                curs_terminfo(3x)
+              tigetstr                curs_terminfo(3x)
+              timeout                 curs_inopts(3x)
+              touchline               curs_touch(3x)
+
+              touchwin                curs_touch(3x)
+              tparm                   curs_terminfo(3x)
+              tputs                   curs_termcap(3x)
+              tputs                   curs_terminfo(3x)
+              trace                   curs_trace(3x)*
+              typeahead               curs_inopts(3x)
+              unctrl                  curs_util(3x)
+              unget_wch               curs_get_wch(3x)
+              ungetch                 curs_getch(3x)
+              ungetmouse              curs_mouse(3x)*
+              untouchwin              curs_touch(3x)
+              use_default_colors      default_colors(3x)*
+              use_env                 curs_util(3x)
+              use_extended_names      curs_extend(3x)*
+              use_legacy_coding       legacy_coding(3x)*
+              vid_attr                curs_terminfo(3x)
+              vid_puts                curs_terminfo(3x)
+              vidattr                 curs_terminfo(3x)
+              vidputs                 curs_terminfo(3x)
+              vline                   curs_border(3x)
+              vline_set               curs_border_set(3x)
+              vw_printw               curs_printw(3x)
+              vw_scanw                curs_scanw(3x)
+              vwprintw                curs_printw(3x)
+              vwscanw                 curs_scanw(3x)
+              wadd_wch                curs_add_wch(3x)
+              wadd_wchnstr            curs_add_wchstr(3x)
+              wadd_wchstr             curs_add_wchstr(3x)
+              waddch                  curs_addch(3x)
+              waddchnstr              curs_addchstr(3x)
+              waddchstr               curs_addchstr(3x)
+              waddnstr                curs_addstr(3x)
+              waddnwstr               curs_addwstr(3x)
+              waddstr                 curs_addstr(3x)
+              waddwstr                curs_addwstr(3x)
+              wattr_get               curs_attr(3x)
+              wattr_off               curs_attr(3x)
+              wattr_on                curs_attr(3x)
+              wattr_set               curs_attr(3x)
+              wattroff                curs_attr(3x)
+              wattron                 curs_attr(3x)
+              wattrset                curs_attr(3x)
+              wbkgd                   curs_bkgd(3x)
+              wbkgdset                curs_bkgd(3x)
+              wbkgrnd                 curs_bkgrnd(3x)
+              wbkgrndset              curs_bkgrnd(3x)
+              wborder                 curs_border(3x)
+              wborder_set             curs_border_set(3x)
+              wchgat                  curs_attr(3x)
+              wclear                  curs_clear(3x)
+              wclrtobot               curs_clear(3x)
+              wclrtoeol               curs_clear(3x)
+              wcolor_set              curs_attr(3x)
+              wcursyncup              curs_window(3x)
+              wdelch                  curs_delch(3x)
+              wdeleteln               curs_deleteln(3x)
+              wecho_wchar             curs_add_wch(3x)
+              wechochar               curs_addch(3x)
+              wenclose                curs_mouse(3x)*
+              werase                  curs_clear(3x)
+              wget_wch                curs_get_wch(3x)
+              wget_wstr               curs_get_wstr(3x)
+              wgetbkgrnd              curs_bkgrnd(3x)
+              wgetch                  curs_getch(3x)
+              wgetn_wstr              curs_get_wstr(3x)
+
+              wgetnstr                curs_getstr(3x)
+              wgetstr                 curs_getstr(3x)
+              whline                  curs_border(3x)
+              whline_set              curs_border_set(3x)
+              win_wch                 curs_in_wch(3x)
+              win_wchnstr             curs_in_wchstr(3x)
+              win_wchstr              curs_in_wchstr(3x)
+              winch                   curs_inch(3x)
+              winchnstr               curs_inchstr(3x)
+              winchstr                curs_inchstr(3x)
+              winnstr                 curs_instr(3x)
+              winnwstr                curs_inwstr(3x)
+              wins_nwstr              curs_ins_wstr(3x)
+              wins_wch                curs_ins_wch(3x)
+              wins_wstr               curs_ins_wstr(3x)
+              winsch                  curs_insch(3x)
+              winsdelln               curs_deleteln(3x)
+              winsertln               curs_deleteln(3x)
+              winsnstr                curs_insstr(3x)
+              winsstr                 curs_insstr(3x)
+              winstr                  curs_instr(3x)
+              winwstr                 curs_inwstr(3x)
+              wmouse_trafo            curs_mouse(3x)*
+              wmove                   curs_move(3x)
+              wnoutrefresh            curs_refresh(3x)
+              wprintw                 curs_printw(3x)
+              wredrawln               curs_refresh(3x)
+              wrefresh                curs_refresh(3x)
+              wresize                 wresize(3x)*
+              wscanw                  curs_scanw(3x)
+              wscrl                   curs_scroll(3x)
+              wsetscrreg              curs_outopts(3x)
+              wstandend               curs_attr(3x)
+              wstandout               curs_attr(3x)
+              wsyncdown               curs_window(3x)
+              wsyncup                 curs_window(3x)
+              wtimeout                curs_inopts(3x)
+              wtouchln                curs_touch(3x)
+              wunctrl                 curs_util(3x)
+              wvline                  curs_border(3x)
+              wvline_set              curs_border_set(3x)
+
+
+
+

RETURN VALUE

+       Routines that return an integer return  ERR  upon  failure
+       and  an  integer value other than ERR upon successful com-
+       pletion, unless otherwise noted in  the  routine  descrip-
+       tions.
+
+       All  macros  return  the  value  of  the w version, except
+       setscrreg, wsetscrreg, getyx, getbegyx, and getmaxyx.  The
+       return  values  of setscrreg, wsetscrreg, getyx, getbegyx,
+       and getmaxyx are undefined (i.e., these should not be used
+       as the right-hand side of assignment statements).
+
+       Routines that return pointers return NULL on error.
+
+
+
+

ENVIRONMENT

+       The following environment symbols are useful for customiz-
+       ing the runtime behavior of the ncurses library.  The most
+       important ones have been already discussed in detail.
+
+       BAUDRATE
+            The  debugging library checks this environment symbol
+            when the application has redirected output to a file.
+            The  symbol's numeric value is used for the baudrate.
+            If no value is found, ncurses uses 9600.  This allows
+            testers  to construct repeatable test-cases that take
+            into account costs that depend on baudrate.
+
+       CC   When set, change occurrences of the command_character
+            (i.e.,  the  cmdch capability) of the loaded terminfo
+            entries to the value of this symbol.  Very  few  ter-
+            minfo entries provide this feature.
+
+            Because  this  name is also used in development envi-
+            ronments to represent the C compiler's name,  ncurses
+            ignores it if it does not happen to be a single char-
+            acter.
+
+       COLUMNS
+            Specify  the  width  of  the  screen  in  characters.
+            Applications  running in a windowing environment usu-
+            ally are able to obtain the width of  the  window  in
+            which  they  are  executing.   If neither the COLUMNS
+            value nor the terminal's screen  size  is  available,
+            ncurses  uses  the size which may be specified in the
+            terminfo database (i.e., the cols capability).
+
+            It is important that your application use  a  correct
+            size  for  the  screen.   This is not always possible
+            because your application may be  running  on  a  host
+            which  does not honor NAWS (Negotiations About Window
+            Size), or because  you  are  temporarily  running  as
+            another  user.  However, setting COLUMNS and/or LINES
+            overrides  the  library's  use  of  the  screen  size
+            obtained from the operating system.
+
+            Either  COLUMNS  or  LINES  symbols  may be specified
+            independently.  This is mainly useful  to  circumvent
+            legacy  misfeatures  of  terminal descriptions, e.g.,
+            xterm which commonly specifies a 65 line screen.  For
+            best  results, lines and cols should not be specified
+            in a terminal description for terminals which are run
+            as emulations.
+
+            Use the use_env function to disable all use of exter-
+            nal environment (including system calls) to determine
+            the screen size.
+
+       ESCDELAY
+            Specifies  the total time, in milliseconds, for which
+            ncurses will await  a  character  sequence,  e.g.,  a
+            function  key.  The default value, 1000 milliseconds,
+            is enough for most uses.  However, it is made a vari-
+            able to accommodate unusual applications.
+
+            The most common instance where you may wish to change
+            this value is to work with slow hosts, e.g.,  running
+            on  a  network.   If  the host cannot read characters
+            rapidly enough, it will have the same  effect  as  if
+            the  terminal did not send characters rapidly enough.
+            The library will still see a timeout.
+
+            Note that xterm mouse events are built up from  char-
+            acter  sequences  received  from  the xterm.  If your
+            application makes heavy use of multiple-clicking, you
+            may  wish  to lengthen this default value because the
+            timeout applies to the composed multi-click event  as
+            well as the individual clicks.
+
+            In  addition to the environment variable, this imple-
+            mentation provides a global variable  with  the  same
+            name.  Portable applications should not rely upon the
+            presence of ESCDELAY in either form, but setting  the
+            environment  variable rather than the global variable
+            does not create problems when compiling  an  applica-
+            tion.
+
+       HOME Tells  ncurses where your home directory is.  That is
+            where  it  may  read  and  write  auxiliary  terminal
+            descriptions:
+
+            $HOME/.termcap
+            $HOME/.terminfo
+
+       LINES
+            Like  COLUMNS,  specify  the  height of the screen in
+            characters.  See COLUMNS for a detailed  description.
+
+       MOUSE_BUTTONS_123
+            This applies only to the OS/2 EMX port.  It specifies
+            the order of buttons on the mouse.   OS/2  numbers  a
+            3-button mouse inconsistently from other platforms:
+
+            1 = left
+            2 = right
+            3 = middle.
+
+            This symbol lets you customize the mouse.  The symbol
+            must be three numeric digits 1-3 in any order,  e.g.,
+            123  or  321.   If  it is not specified, ncurses uses
+            132.
+
+       NCURSES_ASSUMED_COLORS
+            Override the compiled-in assumption that  the  termi-
+            nal's   default   colors   are   white-on-black  (see
+            default_colors(3x)).  You may set the foreground  and
+            background  color  values with this environment vari-
+            able by proving a  2-element  list:  foreground,back-
+            ground.   For  example, to tell ncurses to not assume
+            anything about the colors, set this to  "-1,-1".   To
+            make  it  green-on-black, set it to "2,0".  Any posi-
+            tive value from zero to the terminfo max_colors value
+            is allowed.
+
+       NCURSES_GPM_TERMS
+            This  applies  only  to ncurses configured to use the
+            GPM interface.
+
+            If present, the environment variable is a list of one
+            or  more  terminal names against which the TERM envi-
+            ronment variable is matched.  Setting it to an  empty
+            value  disables the GPM interface; using the built-in
+            support for xterm, etc.
+
+            If the environment variable is absent,  ncurses  will
+            attempt to open GPM if TERM contains "linux".
+
+       NCURSES_NO_HARD_TABS
+            Ncurses  may  use tabs as part of the cursor movement
+            optimization.  In some cases,  your  terminal  driver
+            may  not handle these properly.  Set this environment
+            variable to disable the feature.  You can also adjust
+            your stty settings to avoid the problem.
+
+       NCURSES_NO_MAGIC_COOKIES
+            Some  terminals  use  a  magic-cookie  feature  which
+            requires special handling to  make  highlighting  and
+            other  video  attributes  display  properly.  You can
+            suppress the highlighting entirely for  these  termi-
+            nals by setting this environment variable.
+
+       NCURSES_NO_PADDING
+            Most  of  the  terminal  descriptions in the terminfo
+            database are written for real  "hardware"  terminals.
+            Many  people  use  terminal  emulators which run in a
+            windowing environment and use  curses-based  applica-
+            tions.   Terminal  emulators can duplicate all of the
+            important aspects of a hardware terminal, but they do
+            not  have the same limitations.  The chief limitation
+            of a hardware terminal from the  standpoint  of  your
+            application is the management of dataflow, i.e., tim-
+            ing.  Unless a hardware terminal is interfaced into a
+            terminal  concentrator  (which does flow control), it
+            (or your application) must manage dataflow,  prevent-
+            ing  overruns.   The  cheapest  solution (no hardware
+            cost) is for your program to do this by pausing after
+            operations  that  the  terminal  does slowly, such as
+            clearing the display.
+
+            As a result, many  terminal  descriptions  (including
+            the  vt100)  have delay times embedded.  You may wish
+            to use these descriptions, but not want  to  pay  the
+            performance penalty.
+
+            Set  the NCURSES_NO_PADDING symbol to disable all but
+            mandatory padding.  Mandatory padding is  used  as  a
+            part of special control sequences such as flash.
+
+       NCURSES_NO_SETBUF
+            Normally  ncurses enables buffered output during ter-
+            minal initialization.   This  is  done  (as  in  SVr4
+            curses)  for  performance  reasons.  For testing pur-
+            poses, both of ncurses and certain applications, this
+            feature    is    made    optional.     Setting    the
+            NCURSES_NO_SETBUF variable disables output buffering,
+            leaving  the  output  in  the  original (usually line
+            buffered) mode.
+
+       NCURSES_NO_UTF8_ACS
+            During initialization, the ncurses library checks for
+            special  cases where VT100 line-drawing (and the cor-
+            responding  alternate  character  set   capabilities)
+            described  in  the  terminfo are known to be missing.
+            Specifically, when running in  a  UTF-8  locale,  the
+            Linux  console  emulator  and  the GNU screen program
+            ignore these.  Ncurses checks  the  TERM  environment
+            variable  for  these.   For  other special cases, you
+            should set this  environment  variable.   Doing  this
+            tells  ncurses to use Unicode values which correspond
+            to the VT100 line-drawing glyphs.  That works for the
+            special cases cited, and is likely to work for termi-
+            nal emulators.
+
+            When setting this variable, you should set  it  to  a
+            nonzero  value.   Setting it to zero (or to a nonnum-
+            ber) disables  the  special  check  for  "linux"  and
+            "screen".
+
+            As   an  alternative  to  the  environment  variable,
+            ncurses checks for an  extended  terminfo  capability
+            U8.   This  is a numeric capability which can be com-
+            piled using tic -x.  For example
+
+            # linux console, if patched to provide working
+            # VT100 shift-in/shift-out, with corresponding font.
+            linux-vt100|linux console with VT100 line-graphics,
+                                 U8#0, use=linux,
+
+            # uxterm with vt100Graphics resource set to false
+            xterm-utf8|xterm relying on UTF-8 line-graphics,
+                                 U8#1, use=xterm,
+
+            The name "U8" is chosen to be two characters, to per-
+            mit  it  to be used by applications that use ncurses'
+            termcap interface.
+
+       NCURSES_TRACE
+            During initialization, the ncurses debugging  library
+            checks  the  NCURSES_TRACE symbol.  If it is defined,
+            to a numeric value, ncurses calls the trace function,
+            using that value as the argument.
+
+            The  argument  values, which are defined in curses.h,
+            provide several types of information.   When  running
+            with  traces enabled, your application will write the
+            file trace to the current directory.
+
+       TERM Denotes your terminal type.  Each  terminal  type  is
+            distinct, though many are similar.
+
+       TERMCAP
+            If the ncurses library has been configured with term-
+            cap support, ncurses  will  check  for  a  terminal's
+            description in termcap form if it is not available in
+            the terminfo database.
+
+            The  TERMCAP  symbol  contains  either   a   terminal
+            description  (with  newlines stripped out), or a file
+            name telling where the  information  denoted  by  the
+            TERM  symbol  exists.   In  either  case,  setting it
+            directs ncurses to ignore the usual  place  for  this
+            information, e.g., /etc/termcap.
+
+       TERMINFO
+            Overrides the directory in which ncurses searches for
+            your terminal description.  This is the simplest, but
+            not  the  only way to change the list of directories.
+            The complete list of directories in order follows:
+
+            o   the last directory to  which  ncurses  wrote,  if
+                any, is searched first
+
+            o   the directory specified by the TERMINFO symbol
+
+            o   $HOME/.terminfo
+
+            o   directories listed in the TERMINFO_DIRS symbol
+
+            o   one  or  more directories whose names are config-
+                ured and compiled into the ncurses library, e.g.,
+                /usr/share/terminfo
+
+       TERMINFO_DIRS
+            Specifies  a list of directories to search for termi-
+            nal descriptions.  The list is  separated  by  colons
+            (i.e.,  ":") on Unix, semicolons on OS/2 EMX.  All of
+            the terminal descriptions are in terminfo form, which
+            makes  a  subdirectory  named for the first letter of
+            the terminal names therein.
+
+       TERMPATH
+            If TERMCAP does not hold a  file  name  then  ncurses
+            checks  the TERMPATH symbol.  This is a list of file-
+            names separated by spaces or colons  (i.e.,  ":")  on
+            Unix, semicolons on OS/2 EMX.  If the TERMPATH symbol
+            is not set, ncurses looks in the files  /etc/termcap,
+            /usr/share/misc/termcap  and  $HOME/.termcap, in that
+            order.
+
+       The library may be configured to disregard  the  following
+       variables  when  the current user is the superuser (root),
+       or if the application uses setuid or  setgid  permissions:
+       $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
+
+
+
+

ALTERNATE CONFIGURATIONS

+       Several  different  configurations are possible, depending
+       on  the  configure  script  options  used  when   building
+       ncurses.   There  are a few main options whose effects are
+       visible to the applications developer using ncurses:
+
+       --disable-overwrite
+            The standard include for ncurses is as noted in  SYN-
+            OPSIS:
+
+            #include <curses.h>
+
+            This  option is used to avoid filename conflicts when
+            ncurses is not the main implementation of  curses  of
+            the  computer.   If  ncurses  is  installed disabling
+            overwrite, it puts its  headers  in  a  subdirectory,
+            e.g.,
+
+            #include <ncurses/curses.h>
+
+            It  also  omits a symbolic link which would allow you
+            to use -lcurses to build executables.
+
+       --enable-widec
+            The configure script renames the library and (if  the
+            --disable-overwrite  option  is used) puts the header
+            files  in  a  different  subdirectory.   All  of  the
+            library  names  have  a  "w"  appended to them, i.e.,
+            instead of
+
+            -lncurses
+
+            you link with
+
+            -lncursesw
+
+            You must also define _XOPEN_SOURCE_EXTENDED when com-
+            piling  for  the  wide-character  library  to use the
+            extended (wide-character)  functions.   The  curses.h
+            file   which  is  installed  for  the  wide-character
+            library is designed to be compatible with the  normal
+            library's header.  Only the size of the WINDOW struc-
+            ture differs, and very few applications require  more
+            than  a  pointer  to  WINDOWs.   If  the  headers are
+            installed  allowing  overwrite,  the   wide-character
+            library's  headers should be installed last, to allow
+            applications to be built using  either  library  from
+            the same set of headers.
+
+       --with-shared
+
+       --with-normal
+
+       --with-debug
+
+       --with-profile
+            The  shared  and normal (static) library names differ
+            by   their   suffixes,   e.g.,   libncurses.so    and
+            libncurses.a.   The debug and profiling libraries add
+            a "_g" and a "_p" to  the  root  names  respectively,
+            e.g., libncurses_g.a and libncurses_p.a.
+
+       --with-trace
+            The  trace  function  normally  resides  in the debug
+            library, but it is sometimes useful to configure this
+            in  the  shared  library.   Configure  scripts should
+            check for the function's existence rather than assum-
+            ing it is always in the debug library.
+
+
+
+

FILES

+       /usr/share/tabset
+            directory  containing  initialization  files  for the
+            terminal capability database /usr/share/terminfo ter-
+            minal capability database
+
+
+
+

SEE ALSO

+       terminfo(5)  and  related  pages whose names begin "curs_"
+       for detailed routine descriptions.
+       curs_variables(3x)
+
+
+
+

EXTENSIONS

+       The  ncurses  library  can  be  compiled  with  an  option
+       (-DUSE_GETCAP) that falls back to the old-style /etc/term-
+       cap file if the terminal setup code cannot find a terminfo
+       entry  corresponding  to TERM.  Use of this feature is not
+       recommended, as it essentially includes an entire  termcap
+       compiler  in the ncurses startup code, at significant cost
+       in core and startup cycles.
+
+       The ncurses  library  includes  facilities  for  capturing
+       mouse  events on certain terminals (including xterm).  See
+       the curs_mouse(3x) manual page for details.
+
+       The ncurses library includes facilities for responding  to
+       window  resizing  events,  e.g., when running in an xterm.
+       See the resizeterm(3x) and wresize(3x)  manual  pages  for
+       details.   In addition, the library may be configured with
+       a SIGWINCH handler.
+
+       The ncurses library extends the fixed set of function  key
+       capabilities  of  terminals  by  allowing  the application
+       designer to define additional key  sequences  at  runtime.
+       See the define_key(3x) key_defined(3x), and keyok(3x) man-
+       ual pages for details.
+
+       The ncurses library can exploit the capabilities of termi-
+       nals  which  implement the ISO-6429 SGR 39 and SGR 49 con-
+       trols, which allow an application to reset the terminal to
+       its  original  foreground and background colors.  From the
+       users' perspective, the application is able to  draw  col-
+       ored  text  on  a  background  whose color is set indepen-
+       dently, providing better  control  over  color  contrasts.
+       See the default_colors(3x) manual page for details.
+
+       The  ncurses  library  includes  a  function for directing
+       application output to a printer attached to  the  terminal
+       device.  See the curs_print(3x) manual page for details.
+
+
+
+

PORTABILITY

+       The  ncurses  library is intended to be BASE-level confor-
+       mant with XSI Curses.  The EXTENDED XSI Curses functional-
+       ity (including color support) is supported.
+
+       A  small  number of local differences (that is, individual
+       differences between the XSI Curses and ncurses calls)  are
+       described  in  PORTABILITY  sections  of  the  library man
+       pages.
+
+       This implementation also contains several extensions:
+
+       o   The routine has_key is not part of  XPG4,  nor  is  it
+           present  in  SVr4.  See the curs_getch(3x) manual page
+           for details.
+
+       o   The routine slk_attr is not part of XPG4,  nor  is  it
+           present in SVr4.  See the curs_slk(3x) manual page for
+           details.
+
+       o   The routines getmouse, mousemask, ungetmouse, mousein-
+           terval, and wenclose relating to mouse interfacing are
+           not part of XPG4, nor are they present in  SVr4.   See
+           the curs_mouse(3x) manual page for details.
+
+       o   The  routine  mcprint  was not present in any previous
+           curses implementation.  See the curs_print(3x)  manual
+           page for details.
+
+       o   The  routine  wresize  is  not part of XPG4, nor is it
+           present in SVr4.  See the wresize(3x) manual page  for
+           details.
+
+       o   The  WINDOW structure's internal details can be hidden
+           from application programs.   See  curs_opaque(3x)  for
+           the discussion of is_scrollok, etc.
+
+       o   This implementation can be configured to provide rudi-
+           mentary support for multi-threaded applications.   See
+           curs_threads(3x) for details.
+
+       o   This  implementation can also be configured to provide
+           a set of functions which improve the ability to manage
+           multiple  screens.  See curs_sp_funcs(3x) for details.
+
+       In historic curses versions, delays embedded in the  capa-
+       bilities cr, ind, cub1, ff and tab activated corresponding
+       delay bits in the UNIX tty driver.   In  this  implementa-
+       tion,  all  padding  is  done  by sending NUL bytes.  This
+       method is slightly more expensive, but narrows the  inter-
+       face  to  the  UNIX kernel significantly and increases the
+       package's portability correspondingly.
+
+
+
+

NOTES

+       The header  file  <curses.h>  automatically  includes  the
+       header files <stdio.h> and <unctrl.h>.
+
+       If  standard  output from a ncurses program is re-directed
+       to something which is not a tty, screen  updates  will  be
+       directed to standard error.  This was an undocumented fea-
+       ture of AT&T System V Release 3 curses.
+
+
+
+

AUTHORS

+       Zeyd M. Ben-Halim, Eric  S.  Raymond,  Thomas  E.  Dickey.
+       Based on pcurses by Pavel Curtis.
+
+
+
+                                                            ncurses(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/ncurses5-config.1.html b/doc/html/man/ncurses5-config.1.html new file mode 100644 index 00000000000..4ead0ebc8c4 --- /dev/null +++ b/doc/html/man/ncurses5-config.1.html @@ -0,0 +1,133 @@ + + + + +ncurses5-config 1 + + + + +

ncurses5-config 1

+
+
+
+ncurses5-config(1)                                   ncurses5-config(1)
+
+
+
+
+
+

NAME

+       ncurses5-config - helper script for ncurses libraries
+
+
+
+

SYNOPSIS

+       ncurses5-config [options]
+
+
+
+

DESCRIPTION

+       This is a shell script which simplifies configuring appli-
+       cations against a particular set of ncurses libraries.
+
+
+
+

OPTIONS

+       --prefix
+              echos the package-prefix of ncurses
+
+       --exec-prefix
+              echos the executable-prefix of ncurses
+
+       --cflags
+              echos the C compiler flags needed to  compile  with
+              ncurses
+
+       --libs echos the libraries needed to link with ncurses
+
+       --version
+              echos the release+patchdate version of ncurses
+
+       --abi-version
+              echos the ABI version of ncurses
+
+       --mouse-version
+              echos the mouse-interface version of ncurses
+
+       --bindir
+              echos the directory containing ncurses programs
+
+       --datadir
+              echos the directory containing ncurses data
+
+       --includedir
+              echos the directory containing ncurses header files
+
+       --libdir
+              echos the directory containing ncurses libraries
+
+       --mandir
+              echos the directory containing ncurses manpages
+
+       --terminfo
+              echos the $TERMINFO terminfo database path, e.g.,
+              /usr/share/terminfo
+
+       --terminfo-dirs
+              echos the $TERMINFO_DIRS directory list, e.g.,
+              /usr/local/ncurses/lib/terminfo:/usr/share/terminfo
+
+       --termpath
+              echos  the  $TERMPATH  termcap list, if support for
+              termcap is configured.
+
+       --help prints this message
+
+
+
+

SEE ALSO

+       curses(3x)
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                     ncurses5-config(1)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html new file mode 100644 index 00000000000..216839e3157 --- /dev/null +++ b/doc/html/man/panel.3x.html @@ -0,0 +1,241 @@ + + + + +panel 3x + + + + +

panel 3x

+
+
+
+panel(3x)                                                     panel(3x)
+
+
+
+
+
+

NAME

+       panel - panel stack extension for curses
+
+
+
+

SYNOPSIS

+       #include <panel.h>
+
+       cc [flags] sourcefiles -lpanel -lncurses
+
+       PANEL *new_panel(WINDOW *win)
+       int bottom_panel(PANEL *pan)
+       int top_panel(PANEL *pan)
+       int show_panel(PANEL *pan)
+       void update_panels();
+       int hide_panel(PANEL *pan)
+       WINDOW *panel_window(const PANEL *pan)
+       int replace_panel(PANEL *pan, WINDOW *window)
+       int move_panel(PANEL *pan, int starty, int startx)
+       int panel_hidden(const PANEL *pan)
+       PANEL *panel_above(const PANEL *pan)
+       PANEL *panel_below(const PANEL *pan)
+       int set_panel_userptr(PANEL *pan, const void *ptr)
+       const void *panel_userptr(const PANEL *pan)
+       int del_panel(PANEL *pan)
+
+
+
+

DESCRIPTION

+       Panels  are  curses(3x)  windows with the added feature of
+       depth.  Panel functions allow the use of  stacked  windows
+       and  ensure  the  proper  portions  of each window and the
+       curses stdscr window are hidden or displayed  when  panels
+       are  added,  moved,  modified or removed.  The set of cur-
+       rently visible panels is the stack of panels.  The  stdscr
+       window  is  beneath all panels, and is not considered part
+       of the stack.
+
+       A window is associated with every panel.  The  panel  rou-
+       tines  enable  you to create, move, hide, and show panels,
+       as well as position a panel at any desired location in the
+       stack.
+
+       Panel routines are a functional layer added to curses(3x),
+       make only high-level curses calls, and work anywhere  ter-
+       minfo curses does.
+
+
+
+

FUNCTIONS

+       new_panel(win)
+              allocates   a   PANEL structure, associates it with
+              win, places the panel  on  the  top  of  the  stack
+              (causes   it  to   be   displayed  above  any other
+              panel) and returns a pointer to the new panel.
+
+       update_panels()
+              refreshes the virtual screen to reflect  the  rela-
+              tions between the panels in the stack, but does not
+              call doupdate() to  refresh  the  physical  screen.
+              Use this function and not wrefresh or wnoutrefresh.
+              update_panels may be called more than once before a
+              call  to doupdate(), but doupdate() is the function
+              responsible for updating the physical screen.
+
+       del_panel(pan)
+              removes the given panel from the  stack and deallo-
+              cates  the  PANEL structure (but not its associated
+              window).
+
+       hide_panel(pan)
+              removes the given panel from the  panel  stack  and
+              thus hides it from view. The PANEL structure is not
+              lost, merely removed from the stack.
+
+       panel_hidden(pan)
+              returns TRUE if the panel is in  the  panel  stack,
+              FALSE  if  it  is  not.   If  the  panel  is a null
+              pointer, return ERR.
+
+       show_panel(pan)
+              makes a hidden panel visible by placing it  on  top
+              of the panels in the panel stack. See COMPATIBILITY
+              below.
+
+       top_panel(pan)
+              puts the given visible panel on top of  all  panels
+              in the stack.  See COMPATIBILITY below.
+
+       bottom_panel(pan)
+              puts panel at the bottom of all panels.
+
+       move_panel(pan,starty,startx)
+              moves the given panel window so that its upper-left
+              corner is at starty, startx.  It  does  not  change
+              the position of the panel in the stack.  Be sure to
+              use this function, not mvwin(),  to  move  a  panel
+              window.
+
+       replace_panel(pan,window)
+              replaces  the  current  window of panel with window
+              (useful, for example if you want to resize a panel;
+              if you're using ncurses, you can call replace_panel
+              on the output of wresize(3x)).  It does not  change
+              the position of the panel in the stack.
+
+       panel_above(pan)
+              returns  a  pointer to the panel above pan.  If the
+              panel argument is (PANEL *)0, it returns a  pointer
+              to the bottom panel in the stack.
+
+       panel_below(pan)
+              returns  a pointer to the panel just below pan.  If
+              the panel argument is  (PANEL  *)0,  it  returns  a
+              pointer to the top panel in the stack.
+
+       set_panel_userptr(pan,ptr)
+              sets the panel's user pointer.
+
+       panel_userptr(pan)
+              returns the user pointer for a given panel.
+
+       panel_window(pan)
+              returns a pointer to the window of the given panel.
+
+
+
+

DIAGNOSTICS

+       Each routine that returns a pointer  returns  NULL  if  an
+       error  occurs.  Each  routine  that  returns  an int value
+       returns OK if it executes successfully and ERR if not.
+
+
+
+

COMPATIBILITY

+       Reasonable care has been taken to   ensure   compatibility
+       with   the   native   panel  facility introduced in SVr3.2
+       (inspection  of  the  SVr4  manual  pages   suggests   the
+       programming  interface  is  unchanged).   The  PANEL  data
+       structures are merely  similar. The   programmer  is  cau-
+       tioned not to directly use PANEL fields.
+
+       The  functions  show_panel() and top_panel() are identical
+       in this implementation, and work equally  well  with  dis-
+       played or hidden panels.  In the native System V implemen-
+       tation, show_panel() is intended for making a hidden panel
+       visible  (at  the  top  of  the  stack) and top_panel() is
+       intended for making an already-visible panel move  to  the
+       top  of  the  stack.  You are cautioned to use the correct
+       function  to  ensure  compatibility  with   native   panel
+       libraries.
+
+
+
+

NOTE

+       In  your  library  list, libpanel.a should be before libn-
+       curses.a; that is, you want to  say  `-lpanel  -lncurses',
+       not the other way around (which would usually give a link-
+       error).
+
+
+
+

FILES

+       panel.h interface for the panels library
+
+       libpanel.a the panels library itself
+
+
+
+

SEE ALSO

+       curses(3x), curs_variables(3x),
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+

AUTHOR

+       Originally  written  by   Warren   Tucker   <wht@n4hgf.mt-
+       park.ga.us>,  primarily  to  assist  in porting u386mon to
+       systems without a native panels library.   Repackaged  for
+       ncurses by Zeyd ben-Halim.
+
+
+
+                                                              panel(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/resizeterm.3x.html b/doc/html/man/resizeterm.3x.html new file mode 100644 index 00000000000..d675ee3acd0 --- /dev/null +++ b/doc/html/man/resizeterm.3x.html @@ -0,0 +1,141 @@ + + + + +resizeterm 3x + + + + +

resizeterm 3x

+
+
+
+resizeterm(3x)                                           resizeterm(3x)
+
+
+
+
+
+

NAME

+       is_term_resized,  resize_term,  resizeterm  -  change  the
+       curses terminal size
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       bool is_term_resized(int lines, int columns);
+       int resize_term(int lines, int columns);
+       int resizeterm(int lines, int columns);
+
+
+
+

DESCRIPTION

+       This is an extension to the curses library.   It  provides
+       callers  with  a hook into the ncurses data to resize win-
+       dows, primarily for use by programs running in an X Window
+       terminal  (e.g.,  xterm).  The function resizeterm resizes
+       the standard and current windows to the  specified  dimen-
+       sions,  and  adjusts  other  bookkeeping  data used by the
+       ncurses library that record the window dimensions.
+
+       Most  of  the  work  is  done  by   the   inner   function
+       resize_term.  The outer function resizeterm adds bookkeep-
+       ing for the SIGWINCH handler.  When resizing the  windows,
+       resize_term  blank-fills the areas that are extended.  The
+       calling application should fill in these areas with appro-
+       priate  data.  The resize_term function attempts to resize
+       all windows.  However, due to the  calling  convention  of
+       pads,  it  is  not  possible to resize these without addi-
+       tional interaction with the application.
+
+       A support function is_term_resized  is  provided  so  that
+       applications  can  check if the resize_term function would
+       modify the window structures.  It returns TRUE if the win-
+       dows would be modified, and FALSE otherwise.
+
+
+
+

RETURN VALUE

+       Except  as  notes,  these  function return the integer ERR
+       upon failure and OK on success.  They will fail if  either
+       of the dimensions are less than or equal to zero, or if an
+       error occurs while (re)allocating memory for the windows.
+
+
+
+

NOTES

+       While these functions are intended to be used to support a
+       signal  handler (i.e., for SIGWINCH), care should be taken
+       to avoid invoking them in a context where malloc or  real-
+       loc  may  have been interrupted, since it uses those func-
+       tions.
+
+       If ncurses is configured to supply its own  SIGWINCH  han-
+       dler, the resizeterm function ungetch's a KEY_RESIZE which
+       will be read on the next call to getch.  This is  used  to
+       alert an application that the screen size has changed, and
+       that it should repaint special features such as pads  that
+       cannot be done automatically.
+
+       If  the  environment  variables  LINES or COLUMNS are set,
+       this overrides  the  library's  use  of  the  window  size
+       obtained  from the operating system.  Thus, even if a SIG-
+       WINCH is received, no screen size change may be  recorded.
+       In that case, no KEY_RESIZE is queued for the next call to
+       getch; an ERR will be returned instead.
+
+
+
+

SEE ALSO

+       curs_variables(3x), wresize(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey (from an equivalent function written in 1988
+       for BSD curses).
+
+
+
+                                                         resizeterm(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html new file mode 100644 index 00000000000..7fb8d39db56 --- /dev/null +++ b/doc/html/man/tabs.1.html @@ -0,0 +1,171 @@ + + + + +tabs 1 + + + + +

tabs 1

+
+
+
+tabs(1)                                                         tabs(1)
+
+
+
+
+
+

NAME

+       tabs - set tabs on a terminal
+
+
+
+

SYNOPSIS

+       tabs [-v[n]] [-ahuUV] file...
+
+
+
+

DESCRIPTION

+       The  tabs  program clears and sets tab-stops on the termi-
+       nal.  This uses the terminfo  clear_all_tabs  and  set_tab
+       capabilities.   If  either  is  absent,  tabs is unable to
+       clear/set tab-stops.  The terminal should be configured to
+       use hard tabs, e.g.,
+
+              stty tab0
+
+
+
+

OPTIONS

+   General Options
+       -Tname
+            Tell tabs which terminal type to use.  If this option
+            is not given, tabs will  use  the  $TERM  environment
+            variable.   If  that  is  not  set,  it  will use the
+            ansi+tabs entry.
+
+       -d   The debugging option shows a ruler line, followed  by
+            two  data  lines.   The  first  data  line  shows the
+            expected tab-stops marked with asterisks.  The second
+            data  line  shows  the  actual tab-stops, marked with
+            asterisks.
+
+       -n   This option tells tabs to check the options  and  run
+            any  debugging option, but not to modify the terminal
+            settings.
+
+       The tabs program processes a single  list  of  tab  stops.
+       The  last  option  to be processed which defines a list is
+       the one that determines the list to be processed.
+
+   Implicit Lists
+       Use a single number as an option, e.g., "-5" to  set  tabs
+       at  the  given  interval  (in  this case 1, 6, 11, 16, 21,
+       etc.).  Tabs are repeated up to the right  margin  of  the
+       screen.
+
+       Use "-0" to clear all tabs.
+
+       Use "-8" to set tabs to the standard interval.
+
+   Explicit Lists
+       An  explicit  list  can be defined after the options (this
+       does not use a "-").  The values in the list  must  be  in
+       increasing numeric order, and greater than zero.  They are
+       separated by a comma or a blank, for example,
+
+              tabs 1,6,11,16,21
+              tabs 1 6 11 16 21
+       Use a '+' to treat a number as an  increment  relative  to
+       the previous value, e.g.,
+
+              tabs 1,+5,+5,+5,+5
+       which is equivalent to the 1,6,11,16,21 example.
+
+   Predefined Tab-Stops
+       X/Open defines several predefined lists of tab stops.
+
+       -a   Assembler, IBM S/370, first format
+
+       -a2  Assembler, IBM S/370, second format
+
+       -c   COBOL, normal format
+
+       -c2  COBOL compact format
+
+       -c3  COBOL compact format extended
+
+       -f   FORTRAN
+
+       -p   PL/I
+
+       -s   SNOBOL
+
+       -u   UNIVAC 1100 Assembler
+
+
+
+

PORTABILITY

+       X/Open  describes  a  +m option, to set a terminal's left-
+       margin.  Very few of the entries in the terminal  database
+       provide this capability.
+
+       The  -d  (debug) and -n (no-op) options are extensions not
+       provided by other implementations.
+
+       Documentation for other implementations states that  there
+       is  a limit on the number of tab stops.  While some termi-
+       nals may not accept an arbitrary number of tab stops, this
+       implementation  will  attempt  to  set tab stops up to the
+       right margin of the screen, if the given list  happens  to
+       be that long.
+
+
+
+

SEE ALSO

+       tset(1), infocmp(1m), curses(3x), terminfo(5).
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                                tabs(1)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/term.5.html b/doc/html/man/term.5.html new file mode 100644 index 00000000000..73ecbb297d7 --- /dev/null +++ b/doc/html/man/term.5.html @@ -0,0 +1,308 @@ + + + + +term 5 + + + + +

term 5

+
+
+
+term(5)                                                         term(5)
+
+
+
+
+
+

NAME

+       term - format of compiled term file.
+
+
+
+

SYNOPSIS

+       term
+
+
+
+

DESCRIPTION

+   STORAGE LOCATION
+       Compiled terminfo descriptions are placed under the direc-
+       tory /usr/share/terminfo.   Two  configurations  are  sup-
+       ported (when building the ncurses libraries):
+
+       directory tree
+            A  two-level  scheme is used to avoid a linear search
+            of a  huge  UNIX  system  directory:  /usr/share/ter-
+            minfo/c/name  where name is the name of the terminal,
+            and c is the first character of name.  Thus, act4 can
+            be  found  in  the  file  /usr/share/terminfo/a/act4.
+            Synonyms for the same  terminal  are  implemented  by
+            multiple links to the same compiled file.
+
+       hashed database
+            Using  Berkeley  database,  two  types of records are
+            stored: the terminfo  data  in  the  same  format  as
+            stored  in  a directory tree with the terminfo's pri-
+            mary name as  a  key,  and  records  containing  only
+            aliases pointing to the primary name.
+
+            If built to write hashed databases, ncurses can still
+            read terminfo  databases  organized  as  a  directory
+            tree,  but  cannot  write  entries into the directory
+            tree.  It can  write  (or  rewrite)  entries  in  the
+            hashed database.
+
+            ncurses  distinguishes  the two cases in the TERMINFO
+            and TERMINFO_DIRS environment variable by assuming  a
+            directory  tree  for  entries  that  correspond to an
+            existing directory, and hashed database otherwise.
+
+   STORAGE FORMAT
+       The format has been chosen so that it will be the same  on
+       all  hardware.   An  8 or more bit byte is assumed, but no
+       assumptions about byte  ordering  or  sign  extension  are
+       made.
+
+       The  compiled  file  is  created with the tic program, and
+       read by the routine setupterm.  The file is  divided  into
+       six parts: the header, terminal names, boolean flags, num-
+       bers, strings, and string table.
+
+       The header section begins the file.  This section contains
+       six  short  integers in the format described below.  These
+       integers are
+
+            (1) the magic number (octal 0432);
+
+            (2) the size, in bytes, of the names section;
+
+            (3) the number of bytes in the boolean section;
+
+            (4) the number of short integers in the numbers  sec-
+            tion;
+
+            (5)  the  number  of  offsets (short integers) in the
+            strings section;
+
+            (6) the size, in bytes, of the string table.
+
+       Short integers are stored in two 8-bit bytes.   The  first
+       byte  contains  the least significant 8 bits of the value,
+       and the second byte contains the most significant 8  bits.
+       (Thus,  the  value  represented is 256*second+first.)  The
+       value -1 is represented by the two bytes 0377, 0377; other
+       negative  values  are  illegal. This value generally means
+       that the corresponding capability  is  missing  from  this
+       terminal.   Note that this format corresponds to the hard-
+       ware  of  the  VAX  and  PDP-11  (that  is,  little-endian
+       machines).  Machines where this does not correspond to the
+       hardware must read the integers as two bytes  and  compute
+       the little-endian value.
+
+       The  terminal  names  section comes next.  It contains the
+       first line of the terminfo description, listing the  vari-
+       ous  names  for the terminal, separated by the `|' charac-
+       ter.  The section is terminated with an ASCII NUL  charac-
+       ter.
+
+       The  boolean flags have one byte for each flag.  This byte
+       is either 0 or 1 as the flag is present  or  absent.   The
+       capabilities are in the same order as the file <term.h>.
+
+       Between the boolean section and the number section, a null
+       byte will be inserted, if necessary, to  ensure  that  the
+       number  section begins on an even byte (this is a relic of
+       the  PDP-11's  word-addressed   architecture,   originally
+       designed  in  to  avoid  IOT traps induced by addressing a
+       word on an odd byte boundary).   All  short  integers  are
+       aligned on a short word boundary.
+
+       The numbers section is similar to the flags section.  Each
+       capability takes up two bytes, and is stored as a  little-
+       endian short integer.  If the value represented is -1, the
+       capability is taken to be missing.
+
+       The strings section is also similar.  Each  capability  is
+       stored  as  a short integer, in the format above.  A value
+       of -1 means the capability  is  missing.   Otherwise,  the
+       value  is  taken  as  an  offset from the beginning of the
+       string table.  Special characters in ^X or \c notation are
+       stored  in their interpreted form, not the printing repre-
+       sentation.  Padding information $<nn> and parameter infor-
+       mation %x are stored intact in uninterpreted form.
+
+       The  final  section  is the string table.  It contains all
+       the values of string capabilities referenced in the string
+       section.  Each string is null terminated.
+
+   EXTENDED STORAGE FORMAT
+       The  previous  section describes the conventional terminfo
+       binary format.  With some minor variations of the  offsets
+       (see  PORTABILITY),  the same binary format is used in all
+       modern UNIX systems.  Each system uses a predefined set of
+       boolean, number or string capabilities.
+
+       The  ncurses  libraries  and applications support extended
+       terminfo binary format, allowing users to define capabili-
+       ties  which are loaded at runtime.  This extension is made
+       possible by using the fact that the other  implementations
+       stop  reading the terminfo data when they have reached the
+       end of the size given in the header.  ncurses  checks  the
+       size,  and  if it exceeds that due to the predefined data,
+       continues to parse according to its own scheme.
+
+       First, it reads the extended header (5 short integers):
+
+            (1)  count of extended boolean capabilities
+
+            (2)  count of extended numeric capabilities
+
+            (3)  count of extended string capabilities
+
+            (4)  size of the extended string table in bytes.
+
+            (5)  last offset of  the  extended  string  table  in
+                 bytes.
+
+       Using  the  counts and sizes, ncurses allocates arrays and
+       reads data for the extended capabilties in the same  order
+       as the header information.
+
+       The extended string table contains values for string capa-
+       bilities.  After the end of these values, it contains  the
+       names  for  each  of  the  extended capabilities in order,
+       e.g., booleans, then numbers and finally strings.
+
+
+
+

PORTABILITY

+       Note that it is possible for setupterm to expect a differ-
+       ent  set  of capabilities than are actually present in the
+       file.  Either the database may  have  been  updated  since
+       setupterm has been recompiled (resulting in extra unrecog-
+       nized entries in the file) or the program  may  have  been
+       recompiled  more  recently  than  the database was updated
+       (resulting in missing  entries).   The  routine  setupterm
+       must  be prepared for both possibilities - this is why the
+       numbers and sizes are included.   Also,  new  capabilities
+       must  always  be added at the end of the lists of boolean,
+       number, and string capabilities.
+
+       Despite the consistent use of  little-endian  for  numbers
+       and  the  otherwise self-describing format, it is not wise
+       to count on portability of binary terminfo entries between
+       commercial  UNIX  versions.  The problem is that there are
+       at least three versions of terminfo (under HP-UX, AIX, and
+       OSF/1)  which  diverged from System V terminfo after SVr1,
+       and have added extension capabilities to the string  table
+       that  (in the binary format) collide with System V and XSI
+       Curses extensions.  See terminfo(5) for  detailed  discus-
+       sion of terminfo source compatibility issues.
+
+
+
+

EXAMPLE

+       As  an  example, here is a hex dump of the description for
+       the Lear-Siegler ADM-3, a  popular  though  rather  stupid
+       early terminal:
+
+       adm3a|lsi adm3a,
+               am,
+               cols#80, lines#24,
+               bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J,
+               cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
+               home=^^, ind=^J,
+
+       0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
+       0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
+       0020  ff ff 18 00 ff ff 00 00  02 00 ff ff ff ff 04 00  ........ ........
+       0030  ff ff ff ff ff ff ff ff  0a 00 25 00 27 00 ff ff  ........ ..%.'...
+       0040  29 00 ff ff ff ff 2b 00  ff ff 2d 00 ff ff ff ff  ).....+. ..-.....
+       0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
+       0120  ff ff ff ff ff ff 2f 00  07 00 0d 00 1a 24 3c 31  ....../. .....$<1
+       0130  3e 00 1b 3d 25 70 31 25  7b 33 32 7d 25 2b 25 63  >..=%p1% {32}%+%c
+       0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
+       0150  00 08 00 0c 00 0b 00 0a  00                       ........ .
+
+
+
+
+

LIMITS

+       Some  limitations:  total  compiled  entries cannot exceed
+       4096 bytes.  The name field cannot exceed 128 bytes.
+
+
+
+

FILES

+       /usr/share/terminfo/*/*  compiled terminal capability data
+       base
+
+
+
+

SEE ALSO

+       curses(3x), terminfo(5).
+
+
+
+

AUTHORS

+       Thomas E. Dickey
+       extended terminfo format for ncurses 5.0
+       hashed database support for ncurses 5.6
+
+       Eric S. Raymond
+
+
+
+                                                                term(5)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/term.7.html b/doc/html/man/term.7.html new file mode 100644 index 00000000000..4c944a1c5bc --- /dev/null +++ b/doc/html/man/term.7.html @@ -0,0 +1,251 @@ + + + + +term 7 + + + + +

term 7

+
+
+
+term(7)                                                         term(7)
+
+
+
+
+
+

NAME

+       term - conventions for naming terminal types
+
+
+
+

DESCRIPTION

+       The  environment variable TERM should normally contain the
+       type name of the terminal, console or display-device  type
+       you  are  using.   This  information  is  critical for all
+       screen-oriented  programs,  including  your   editor   and
+       mailer.
+
+       A  default  TERM  value will be set on a per-line basis by
+       either  /etc/inittab  (e.g.,  System-V-like   UNIXes)   or
+       /etc/ttys  (BSD  UNIXes).  This will nearly always suffice
+       for workstation and microcomputer consoles.
+
+       If you use a dialup line, the type of device  attached  to
+       it  may vary.  Older UNIX systems pre-set a very dumb ter-
+       minal type like `dumb' or `dialup' on dialup lines.  Newer
+       ones may pre-set `vt100', reflecting the prevalence of DEC
+       VT100-compatible terminals  and  personal-computer  emula-
+       tors.
+
+       Modern  telnets  pass  your TERM environment variable from
+       the local side to the remote one.  There can  be  problems
+       if  the  remote terminfo or termcap entry for your type is
+       not compatible with yours, but this situation is rare  and
+       can  almost  always  be  avoided  by  explicitly exporting
+       `vt100' (assuming you are in fact using  a  VT100-superset
+       console, terminal, or terminal emulator.)
+
+       In any case, you are free to override the system TERM set-
+       ting to your taste in your  shell  profile.   The  tset(1)
+       utility  may  be  of  assistance; you can give it a set of
+       rules for deducing or requesting a terminal type based  on
+       the tty device and baud rate.
+
+       Setting your own TERM value may also be useful if you have
+       created a custom  entry  incorporating  options  (such  as
+       visual  bell  or reverse-video) which you wish to override
+       the system default type for your line.
+
+       Terminal type descriptions are stored as files of capabil-
+       ity data underneath /usr/share/terminfo.  To browse a list
+       of all terminal names recognized by the system, do
+
+            toe | more
+
+       from your shell.  These capability files are in  a  binary
+       format optimized for retrieval speed (unlike the old text-
+       based termcap format they replace); to examine  an  entry,
+       you  must  use the infocmp(1m) command.  Invoke it as fol-
+       lows:
+
+            infocmp entry_name
+
+       where entry_name is the name of the type you wish to exam-
+       ine  (and the name of its capability file the subdirectory
+       of /usr/share/terminfo named for its first letter).   This
+       command  dumps  a  capability  file  in  the  text  format
+       described by terminfo(5).
+
+       The first line of  a  terminfo(5)  description  gives  the
+       names by which terminfo knows a terminal, separated by `|'
+       (pipe-bar) characters with the last name field  terminated
+       by  a  comma.   The first name field is the type's primary
+       name, and is the one to use when setting TERM.   The  last
+       name  field  (if  distinct  from  the first) is actually a
+       description of the terminal type (it may  contain  blanks;
+       the others must be single words).  Name fields between the
+       first and last (if present) are aliases for the  terminal,
+       usually historical names retained for compatibility.
+
+       There are some conventions for how to choose terminal pri-
+       mary names that help keep  them  informative  and  unique.
+       Here is a step-by-step guide to naming terminals that also
+       explains how to parse them:
+
+       First, choose a root name.  The root  will  consist  of  a
+       lower-case  letter followed by up to seven lower-case let-
+       ters or digits.  You need to avoid using punctuation char-
+       acters  in  root  names,  because they are used and inter-
+       preted as filenames and shell meta-characters (such as  !,
+       $,  *, ?, etc.) embedded in them may cause odd and unhelp-
+       ful behavior.  The slash (/), or any other character  that
+       may  be  interpreted by anyone's file system (\, $, [, ]),
+       is especially dangerous (terminfo is platform-independent,
+       and  choosing  names with special characters could someday
+       make life difficult for users of a future port).  The  dot
+       (.)  character  is  relatively safe as long as there is at
+       most one per root name; some historical terminfo names use
+       it.
+
+       The  root  name for a terminal or workstation console type
+       should almost always begin with a vendor prefix  (such  as
+       hp  for Hewlett-Packard, wy for Wyse, or att for AT&T ter-
+       minals), or a common name of the terminal line (vt for the
+       VT  series of terminals from DEC, or sun for Sun Microsys-
+       tems workstation consoles, or regent for the  ADDS  Regent
+       series.   You  can list the terminfo tree to see what pre-
+       fixes are already in common use.   The  root  name  prefix
+       should  be  followed  when  appropriate by a model number;
+       thus vt100, hp2621, wy50.
+
+       The root name for a PC-Unix console type should be the  OS
+       name,  i.e., linux, bsdos, freebsd, netbsd.  It should not
+       be console or any other generic that might cause confusion
+       in  a  multi-platform environment!  If a model number fol-
+       lows, it should indicate either the OS  release  level  or
+       the console driver release level.
+
+       The  root  name  for a terminal emulator (assuming it does
+       not fit one of the standard ANSI or vt100 types) should be
+       the program name or a readily recognizable abbreviation of
+       it (i.e., versaterm, ctrm).
+
+       Following the root name, you may add any reasonable number
+       of hyphen-separated feature suffixes.
+
+       2p   Has two pages of memory.  Likewise 4p, 8p, etc.
+
+       mc   Magic-cookie.   Some  terminals (notably older Wyses)
+            can only support one attribute  without  magic-cookie
+            lossage.   Their  base  entry  is usually paired with
+            another that has this suffix and uses  magic  cookies
+            to support multiple attributes.
+
+       -am  Enable auto-margin (right-margin wraparound).
+
+       -m   Mono mode - suppress color support.
+
+       -na  No  arrow keys - termcap ignores arrow keys which are
+            actually there on the terminal, so the user  can  use
+            the arrow keys locally.
+
+       -nam No auto-margin - suppress am capability.
+
+       -nl  No labels - suppress soft labels.
+
+       -nsl No status line - suppress status line.
+
+       -pp  Has a printer port which is used.
+
+       -rv  Terminal in reverse video mode (black on white).
+
+       -s   Enable status line.
+
+       -vb  Use visible bell (flash) rather than beep.
+
+       -w   Wide; terminal is in 132 column mode.
+
+       Conventionally,   if  your  terminal  type  is  a  variant
+       intended to specify a line height, that suffix  should  go
+       first.  So, for a hypothetical FuBarCo model 2317 terminal
+       in 30-line mode with reverse video,  best  form  would  be
+       fubar-30-rv (rather than, say, `fubar-rv-30').
+
+       Terminal types that are written not as standalone entries,
+       but rather as components to be plugged into other  entries
+       via  use capabilities, are distinguished by using embedded
+       plus signs rather than dashes.
+
+       Commands which use a  terminal  type  to  control  display
+       often  accept  a  -T  option  that accepts a terminal name
+       argument.  Such programs should  fall  back  on  the  TERM
+       environment variable when no -T option is specified.
+
+
+
+

PORTABILITY

+       For  maximum  compatibility  with  older  System V UNIXes,
+       names and aliases should be unique  within  the  first  14
+       characters.
+
+
+
+

FILES

+       /usr/share/terminfo/?/*
+            compiled terminal capability data base
+
+       /etc/inittab
+            tty line initialization (AT&T-like UNIXes)
+
+       /etc/ttys
+            tty line initialization (BSD-like UNIXes)
+
+
+
+

SEE ALSO

+       curses(3x), terminfo(5), term(5).
+
+
+
+                                                                term(7)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/term_variables.3x.html b/doc/html/man/term_variables.3x.html new file mode 100644 index 00000000000..bc1f9baba8b --- /dev/null +++ b/doc/html/man/term_variables.3x.html @@ -0,0 +1,165 @@ + + + + +term_variables 3x + + + + +

term_variables 3x

+
+
+
+term_variables(3x)                                   term_variables(3x)
+
+
+
+
+
+

NAME

+       SP, acs_map, boolcodes, boolfnames, boolnames, cur_term,
+       numcodes, numfnames, numnames, strcodes, strfnames,
+       strnames, ttytype - curses terminfo global variables
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       #include <term.h>
+
+       chtype acs_map[];
+       NCURSES_CONST char * const * boolcodes;
+       NCURSES_CONST char * const * boolfnames;
+       NCURSES_CONST char * const * boolnames;
+       TERMINAL * cur_term;
+       NCURSES_CONST char * const * numcodes;
+       NCURSES_CONST char * const * numfnames;
+       NCURSES_CONST char * const * numnames;
+       NCURSES_CONST char * const * strcodes;
+       NCURSES_CONST char * const * strfnames;
+       NCURSES_CONST char * const * strnames;
+       char ttytype[];
+
+
+
+

DESCRIPTION

+       This  page summarizes variables provided by the curses li-
+       brary's low-level terminfo interface.  A more complete de-
+       scription is given in the curs_terminfo(3x) manual page.
+
+       Depending  on the configuration, these may be actual vari-
+       ables, or  macros  (see  curs_threads(3x))  which  provide
+       read-only  access  to curses's state.  In either case, ap-
+       plications should treat them as read-only to avoid confus-
+       ing the library.
+
+   Alternate Character Set Mapping
+       After  initializing the curses or terminfo interfaces, the
+       acs_map array holds information used  to  translate  cells
+       with  the  A_ALTCHARSET  video attribute into line-drawing
+       characters.
+
+       The encoding of the information in this array has  changed
+       periodically.   Application developers need only know that
+       it is used for the "ACS_" constants in <curses.h>.
+
+       The comparable data for the wide-character  library  is  a
+       private variable.
+
+   Current Terminal Data
+       After  initializing the curses or terminfo interfaces, the
+       cur_term contains data describing  the  current  terminal.
+       This variable is also set as a side-effect of set_term(3x)
+       and delscreen(3x).
+
+       It is possible to save a value of cur_term for  subsequent
+       use  as  a  parameter  to  set_term, for switching between
+       screens.  Alternatively, one can  save  the  return  value
+       from newterm or setupterm to reuse in set_term.
+
+   Terminfo Names
+       The  tic(1)  and infocmp(1) programs use lookup tables for
+       the long and short names of terminfo capabilities, as well
+       as  the  corresponding  names  for  termcap  capabilities.
+       These are available  to  other  applications,  though  the
+       hash-tables are not available.
+
+       The  long  terminfo  capability  names  use a "l" (ell) in
+       their names: boolfnames numfnames strfnames
+
+       These are the short names for terminfo capabilities: bool-
+       names, numnames, and strnames.
+
+       These  are  the  corresponding  names used for termcap de-
+       scriptions: boolcodes, numcodes, and strcodes.
+
+   Terminal Type
+       On initialization of the curses  or  terminfo  interfaces,
+       setupterm copies the terminal name to the array ttytype.
+
+
+
+

NOTES

+       The  low-level terminfo interface is initialized using se-
+       tupterm(3x).  The upper-level curses  interface  uses  the
+       low-level terminfo interface, internally.
+
+
+
+

PORTABILITY

+       X/Open  Curses  does  not describe any of these except for
+       cur_term.  (The inclusion of cur_term  appears  to  be  an
+       oversight, since other comparable low-level information is
+       omitted by X/Open).
+
+       Other implementations may have comparable variables.  Some
+       implementations  provide the variables in their libraries,
+       but omit them from the header files.
+
+
+
+

SEE ALSO

+       curses(3x), curs_terminfo(3x),  curs_threads(3x),  termin-
+       fo(3x), terminfo(5).
+
+
+
+                                                     term_variables(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html new file mode 100644 index 00000000000..445f3c54b72 --- /dev/null +++ b/doc/html/man/terminfo.5.html @@ -0,0 +1,2375 @@ + + + + +terminfo 5 File Formats + + + + +

terminfo 5 File Formats

+
+
+
+terminfo(5)                   File Formats                  terminfo(5)
+
+
+
+
+
+

NAME

+       terminfo - terminal capability data base
+
+
+
+

SYNOPSIS

+       /usr/share/terminfo/*/*
+
+
+
+

DESCRIPTION

+       Terminfo  is  a  data  base  describing terminals, used by
+       screen-oriented programs  such  as  nvi(1),  rogue(1)  and
+       libraries  such  as curses(3x).  Terminfo describes termi-
+       nals by giving a set of capabilities which they  have,  by
+       specifying how to perform screen operations, and by speci-
+       fying padding requirements and  initialization  sequences.
+       This describes ncurses version 5.8 (patch 20110226).
+
+       Entries in terminfo consist of a sequence of `,' separated
+       fields (embedded commas may be escaped with a backslash or
+       notated  as \054).  White space after the `,' separator is
+       ignored.  The first entry  for  each  terminal  gives  the
+       names  which  are known for the terminal, separated by `|'
+       characters.  The first  name  given  is  the  most  common
+       abbreviation  for the terminal, the last name given should
+       be a long name fully identifying  the  terminal,  and  all
+       others  are  understood as synonyms for the terminal name.
+       All names but the last should be in lower case and contain
+       no  blanks;  the last name may well contain upper case and
+       blanks for readability.
+
+       Lines beginning with a `#' in the first column are treated
+       as  comments.  While comment lines are legal at any point,
+       the output of captoinfo and infotocap  (aliases  for  tic)
+       will move comments so they occur only between entries.
+
+       Newlines  and  leading  tabs  may  be  used for formatting
+       entries for readability.  These are  removed  from  parsed
+       entries.   The  infocmp -f option relies on this to format
+       if-then-else expressions: the result can be read by tic.
+
+       Terminal names (except for the last, verbose entry) should
+       be chosen using the following conventions.  The particular
+       piece of hardware making up the  terminal  should  have  a
+       root  name, thus ``hp2621''.  This name should not contain
+       hyphens.  Modes that the hardware can be in, or user pref-
+       erences,  should  be indicated by appending a hyphen and a
+       mode suffix.  Thus, a vt100 in 132 column  mode  would  be
+       vt100-w.  The following suffixes should be used where pos-
+       sible:
+
+
+      Suffix                  Meaning                   Example
+      -nn      Number of lines on the screen            aaa-60
+      -np      Number of pages of memory                c100-4p
+      -am      With automargins (usually the default)   vt100-am
+      -m       Mono mode; suppress color                ansi-m
+      -mc      Magic cookie; spaces when highlighting   wy30-mc
+      -na      No arrow keys (leave them in local)      c100-na
+      -nam     Without automatic margins                vt100-nam
+      -nl      No status line                           att4415-nl
+      -ns      No status line                           hp2626-ns
+      -rv      Reverse video                            c100-rv
+      -s       Enable status line                       vt100-s
+
+      -vb      Use visible bell instead of beep         wy370-vb
+      -w       Wide mode (> 80 columns, usually 132)    vt100-w
+
+       For more on terminal naming conventions, see  the  term(7)
+       manual page.
+
+   Capabilities
+       The  following  is  a  complete  table of the capabilities
+       included in a terminfo description block and available  to
+       terminfo-using code.  In each line of the table,
+
+       The  variable  is the name by which the programmer (at the
+       terminfo level) accesses the capability.
+
+       The capname is the short name used  in  the  text  of  the
+       database,  and  is used by a person updating the database.
+       Whenever possible, capnames are chosen to be the  same  as
+       or similar to the ANSI X3.64-1979 standard (now superseded
+       by ECMA-48, which uses identical or very  similar  names).
+       Semantics are also intended to match those of the specifi-
+       cation.
+
+       The termcap code is the old termcap capability name  (some
+       capabilities are new, and have names which termcap did not
+       originate).
+
+       Capability names have no hard length limit, but an  infor-
+       mal  limit  of  5 characters has been adopted to keep them
+       short and to allow the tabs in the  source  file  Caps  to
+       line up nicely.
+
+       Finally,  the  description  field  attempts  to convey the
+       semantics of the capability.  You may find some  codes  in
+       the description field:
+
+       (P)    indicates that padding may be specified
+
+       #[1-9] in  the description field indicates that the string
+              is passed through tparm with parms as given (#i).
+
+       (P*)   indicates that padding may vary  in  proportion  to
+              the number of lines affected
+
+       (#i)   indicates the ith parameter.
+
+
+       These are the boolean capabilities:
+
+
+               Variable          Cap-  TCap      Description
+               Booleans          name  Code
+       auto_left_margin          bw    bw    cub1 wraps from col-
+                                             umn 0 to last column
+       auto_right_margin         am    am    terminal has auto-
+                                             matic margins
+       back_color_erase          bce   ut    screen erased with
+                                             background color
+       can_change                ccc   cc    terminal can re-
+                                             define existing col-
+                                             ors
+       ceol_standout_glitch      xhp   xs    standout not erased
+                                             by overwriting (hp)
+       col_addr_glitch           xhpa  YA    only positive motion
+                                             for hpa/mhpa caps
+
+
+       cpi_changes_res           cpix  YF    changing character
+                                             pitch changes reso-
+                                             lution
+       cr_cancels_micro_mode     crxm  YB    using cr turns off
+                                             micro mode
+       dest_tabs_magic_smso      xt    xt    tabs destructive,
+                                             magic so char
+                                             (t1061)
+       eat_newline_glitch        xenl  xn    newline ignored
+                                             after 80 cols (con-
+                                             cept)
+       erase_overstrike          eo    eo    can erase over-
+                                             strikes with a blank
+       generic_type              gn    gn    generic line type
+       hard_copy                 hc    hc    hardcopy terminal
+       hard_cursor               chts  HC    cursor is hard to
+                                             see
+       has_meta_key              km    km    Has a meta key
+                                             (i.e., sets 8th-bit)
+       has_print_wheel           daisy YC    printer needs opera-
+                                             tor to change char-
+                                             acter set
+       has_status_line           hs    hs    has extra status
+                                             line
+       hue_lightness_saturation  hls   hl    terminal uses only
+                                             HLS color notation
+                                             (Tektronix)
+       insert_null_glitch        in    in    insert mode distin-
+                                             guishes nulls
+       lpi_changes_res           lpix  YG    changing line pitch
+                                             changes resolution
+       memory_above              da    da    display may be
+                                             retained above the
+                                             screen
+       memory_below              db    db    display may be
+                                             retained below the
+                                             screen
+       move_insert_mode          mir   mi    safe to move while
+                                             in insert mode
+       move_standout_mode        msgr  ms    safe to move while
+                                             in standout mode
+       needs_xon_xoff            nxon  nx    padding will not
+                                             work, xon/xoff
+                                             required
+       no_esc_ctlc               xsb   xb    beehive (f1=escape,
+                                             f2=ctrl C)
+       no_pad_char               npc   NP    pad character does
+                                             not exist
+       non_dest_scroll_region    ndscr ND    scrolling region is
+                                             non-destructive
+       non_rev_rmcup             nrrmc NR    smcup does not
+                                             reverse rmcup
+       over_strike               os    os    terminal can over-
+                                             strike
+       prtr_silent               mc5i  5i    printer will not
+                                             echo on screen
+       row_addr_glitch           xvpa  YD    only positive motion
+                                             for vpa/mvpa caps
+       semi_auto_right_margin    sam   YE    printing in last
+                                             column causes cr
+       status_line_esc_ok        eslok es    escape can be used
+                                             on the status line
+       tilde_glitch              hz    hz    cannot print ~'s
+                                             (hazeltine)
+
+
+       transparent_underline     ul    ul    underline character
+                                             overstrikes
+       xon_xoff                  xon   xo    terminal uses
+                                             xon/xoff handshaking
+
+       These are the numeric capabilities:
+
+
+            Variable         Cap-     TCap       Description
+             Numeric         name     Code
+       columns               cols     co     number of columns in
+                                             a line
+       init_tabs             it       it     tabs initially every
+                                             # spaces
+       label_height          lh       lh     rows in each label
+       label_width           lw       lw     columns in each
+                                             label
+       lines                 lines    li     number of lines on
+                                             screen or page
+       lines_of_memory       lm       lm     lines of memory if >
+                                             line. 0 means varies
+       magic_cookie_glitch   xmc      sg     number of blank
+                                             characters left by
+                                             smso or rmso
+       max_attributes        ma       ma     maximum combined
+                                             attributes terminal
+                                             can handle
+       max_colors            colors   Co     maximum number of
+                                             colors on screen
+       max_pairs             pairs    pa     maximum number of
+                                             color-pairs on the
+                                             screen
+       maximum_windows       wnum     MW     maximum number of
+                                             defineable windows
+       no_color_video        ncv      NC     video attributes
+                                             that cannot be used
+                                             with colors
+       num_labels            nlab     Nl     number of labels on
+                                             screen
+       padding_baud_rate     pb       pb     lowest baud rate
+                                             where padding needed
+       virtual_terminal      vt       vt     virtual terminal
+                                             number (CB/unix)
+       width_status_line     wsl      ws     number of columns in
+                                             status line
+
+       The following numeric  capabilities  are  present  in  the
+       SVr4.0  term  structure, but are not yet documented in the
+       man page.  They came in with SVr4's printer support.
+
+
+             Variable         Cap-    TCap       Description
+             Numeric          name    Code
+       bit_image_entwining    bitwin  Yo     number of passes for
+                                             each bit-image row
+       bit_image_type         bitype  Yp     type of bit-image
+                                             device
+       buffer_capacity        bufsz   Ya     numbers of bytes
+                                             buffered before
+                                             printing
+       buttons                btns    BT     number of buttons on
+                                             mouse
+       dot_horz_spacing       spinh   Yc     spacing of dots hor-
+                                             izontally in dots
+                                             per inch
+
+       dot_vert_spacing       spinv   Yb     spacing of pins ver-
+                                             tically in pins per
+                                             inch
+       max_micro_address      maddr   Yd     maximum value in
+                                             micro_..._address
+       max_micro_jump         mjump   Ye     maximum value in
+                                             parm_..._micro
+       micro_col_size         mcs     Yf     character step size
+                                             when in micro mode
+       micro_line_size        mls     Yg     line step size when
+                                             in micro mode
+       number_of_pins         npins   Yh     numbers of pins in
+                                             print-head
+       output_res_char        orc     Yi     horizontal resolu-
+                                             tion in units per
+                                             line
+       output_res_horz_inch   orhi    Yk     horizontal resolu-
+                                             tion in units per
+                                             inch
+       output_res_line        orl     Yj     vertical resolution
+                                             in units per line
+       output_res_vert_inch   orvi    Yl     vertical resolution
+                                             in units per inch
+       print_rate             cps     Ym     print rate in char-
+                                             acters per second
+       wide_char_size         widcs   Yn     character step size
+                                             when in double wide
+                                             mode
+
+       These are the string capabilities:
+
+
+               Variable          Cap-   TCap     Description
+                String           name   Code
+       acs_chars                 acsc   ac   graphics charset
+                                             pairs, based on
+                                             vt100
+       back_tab                  cbt    bt   back tab (P)
+       bell                      bel    bl   audible signal
+                                             (bell) (P)
+       carriage_return           cr     cr   carriage return (P*)
+                                             (P*)
+       change_char_pitch         cpi    ZA   Change number of
+                                             characters per inch
+                                             to #1
+       change_line_pitch         lpi    ZB   Change number of
+                                             lines per inch to #1
+       change_res_horz           chr    ZC   Change horizontal
+                                             resolution to #1
+       change_res_vert           cvr    ZD   Change vertical res-
+                                             olution to #1
+       change_scroll_region      csr    cs   change region to
+                                             line #1 to line #2
+                                             (P)
+       char_padding              rmp    rP   like ip but when in
+                                             insert mode
+       clear_all_tabs            tbc    ct   clear all tab stops
+                                             (P)
+       clear_margins             mgc    MC   clear right and left
+                                             soft margins
+       clear_screen              clear  cl   clear screen and
+                                             home cursor (P*)
+       clr_bol                   el1    cb   Clear to beginning
+                                             of line
+
+
+       clr_eol                   el     ce   clear to end of line
+                                             (P)
+       clr_eos                   ed     cd   clear to end of
+                                             screen (P*)
+       column_address            hpa    ch   horizontal position
+                                             #1, absolute (P)
+       command_character         cmdch  CC   terminal settable
+                                             cmd character in
+                                             prototype !?
+       create_window             cwin   CW   define a window #1
+                                             from #2,#3 to #4,#5
+       cursor_address            cup    cm   move to row #1
+                                             columns #2
+       cursor_down               cud1   do   down one line
+       cursor_home               home   ho   home cursor (if no
+                                             cup)
+       cursor_invisible          civis  vi   make cursor invisi-
+                                             ble
+       cursor_left               cub1   le   move left one space
+       cursor_mem_address        mrcup  CM   memory relative cur-
+                                             sor addressing, move
+                                             to row #1 columns #2
+       cursor_normal             cnorm  ve   make cursor appear
+                                             normal (undo
+                                             civis/cvvis)
+       cursor_right              cuf1   nd   non-destructive
+                                             space (move right
+                                             one space)
+       cursor_to_ll              ll     ll   last line, first
+                                             column (if no cup)
+       cursor_up                 cuu1   up   up one line
+       cursor_visible            cvvis  vs   make cursor very
+                                             visible
+       define_char               defc   ZE   Define a character
+                                             #1, #2 dots wide,
+                                             descender #3
+       delete_character          dch1   dc   delete character
+                                             (P*)
+       delete_line               dl1    dl   delete line (P*)
+       dial_phone                dial   DI   dial number #1
+       dis_status_line           dsl    ds   disable status line
+       display_clock             dclk   DK   display clock
+       down_half_line            hd     hd   half a line down
+       ena_acs                   enacs  eA   enable alternate
+                                             char set
+       enter_alt_charset_mode    smacs  as   start alternate
+                                             character set (P)
+       enter_am_mode             smam   SA   turn on automatic
+                                             margins
+       enter_blink_mode          blink  mb   turn on blinking
+       enter_bold_mode           bold   md   turn on bold (extra
+                                             bright) mode
+       enter_ca_mode             smcup  ti   string to start pro-
+                                             grams using cup
+       enter_delete_mode         smdc   dm   enter delete mode
+       enter_dim_mode            dim    mh   turn on half-bright
+                                             mode
+       enter_doublewide_mode     swidm  ZF   Enter double-wide
+                                             mode
+       enter_draft_quality       sdrfq  ZG   Enter draft-quality
+                                             mode
+       enter_insert_mode         smir   im   enter insert mode
+       enter_italics_mode        sitm   ZH   Enter italic mode
+       enter_leftward_mode       slm    ZI   Start leftward car-
+                                             riage motion
+
+       enter_micro_mode          smicm  ZJ   Start micro-motion
+                                             mode
+       enter_near_letter_quality snlq   ZK   Enter NLQ mode
+       enter_normal_quality      snrmq  ZL   Enter normal-quality
+                                             mode
+       enter_protected_mode      prot   mp   turn on protected
+                                             mode
+       enter_reverse_mode        rev    mr   turn on reverse
+                                             video mode
+       enter_secure_mode         invis  mk   turn on blank mode
+                                             (characters invisi-
+                                             ble)
+       enter_shadow_mode         sshm   ZM   Enter shadow-print
+                                             mode
+       enter_standout_mode       smso   so   begin standout mode
+       enter_subscript_mode      ssubm  ZN   Enter subscript mode
+       enter_superscript_mode    ssupm  ZO   Enter superscript
+                                             mode
+       enter_underline_mode      smul   us   begin underline mode
+       enter_upward_mode         sum    ZP   Start upward car-
+                                             riage motion
+       enter_xon_mode            smxon  SX   turn on xon/xoff
+                                             handshaking
+       erase_chars               ech    ec   erase #1 characters
+                                             (P)
+       exit_alt_charset_mode     rmacs  ae   end alternate char-
+                                             acter set (P)
+       exit_am_mode              rmam   RA   turn off automatic
+                                             margins
+       exit_attribute_mode       sgr0   me   turn off all
+                                             attributes
+       exit_ca_mode              rmcup  te   strings to end pro-
+                                             grams using cup
+       exit_delete_mode          rmdc   ed   end delete mode
+       exit_doublewide_mode      rwidm  ZQ   End double-wide mode
+       exit_insert_mode          rmir   ei   exit insert mode
+       exit_italics_mode         ritm   ZR   End italic mode
+       exit_leftward_mode        rlm    ZS   End left-motion mode
+       exit_micro_mode           rmicm  ZT   End micro-motion
+                                             mode
+       exit_shadow_mode          rshm   ZU   End shadow-print
+                                             mode
+       exit_standout_mode        rmso   se   exit standout mode
+       exit_subscript_mode       rsubm  ZV   End subscript mode
+       exit_superscript_mode     rsupm  ZW   End superscript mode
+       exit_underline_mode       rmul   ue   exit underline mode
+       exit_upward_mode          rum    ZX   End reverse charac-
+                                             ter motion
+       exit_xon_mode             rmxon  RX   turn off xon/xoff
+                                             handshaking
+       fixed_pause               pause  PA   pause for 2-3 sec-
+                                             onds
+       flash_hook                hook   fh   flash switch hook
+       flash_screen              flash  vb   visible bell (may
+                                             not move cursor)
+       form_feed                 ff     ff   hardcopy terminal
+                                             page eject (P*)
+       from_status_line          fsl    fs   return from status
+                                             line
+       goto_window               wingo  WG   go to window #1
+       hangup                    hup    HU   hang-up phone
+       init_1string              is1    i1   initialization
+                                             string
+       init_2string              is2    is   initialization
+                                             string
+
+       init_3string              is3    i3   initialization
+                                             string
+       init_file                 if     if   name of initializa-
+                                             tion file
+       init_prog                 iprog  iP   path name of program
+                                             for initialization
+       initialize_color          initc  Ic   initialize color #1
+                                             to (#2,#3,#4)
+       initialize_pair           initp  Ip   Initialize color
+                                             pair #1 to
+                                             fg=(#2,#3,#4),
+                                             bg=(#5,#6,#7)
+       insert_character          ich1   ic   insert character (P)
+       insert_line               il1    al   insert line (P*)
+       insert_padding            ip     ip   insert padding after
+                                             inserted character
+       key_a1                    ka1    K1   upper left of keypad
+       key_a3                    ka3    K3   upper right of key-
+                                             pad
+       key_b2                    kb2    K2   center of keypad
+       key_backspace             kbs    kb   backspace key
+       key_beg                   kbeg   @1   begin key
+       key_btab                  kcbt   kB   back-tab key
+       key_c1                    kc1    K4   lower left of keypad
+       key_c3                    kc3    K5   lower right of key-
+                                             pad
+       key_cancel                kcan   @2   cancel key
+       key_catab                 ktbc   ka   clear-all-tabs key
+       key_clear                 kclr   kC   clear-screen or
+                                             erase key
+       key_close                 kclo   @3   close key
+       key_command               kcmd   @4   command key
+       key_copy                  kcpy   @5   copy key
+       key_create                kcrt   @6   create key
+       key_ctab                  kctab  kt   clear-tab key
+       key_dc                    kdch1  kD   delete-character key
+       key_dl                    kdl1   kL   delete-line key
+       key_down                  kcud1  kd   down-arrow key
+       key_eic                   krmir  kM   sent by rmir or smir
+                                             in insert mode
+       key_end                   kend   @7   end key
+       key_enter                 kent   @8   enter/send key
+       key_eol                   kel    kE   clear-to-end-of-line
+                                             key
+       key_eos                   ked    kS   clear-to-end-of-
+                                             screen key
+       key_exit                  kext   @9   exit key
+       key_f0                    kf0    k0   F0 function key
+       key_f1                    kf1    k1   F1 function key
+       key_f10                   kf10   k;   F10 function key
+       key_f11                   kf11   F1   F11 function key
+       key_f12                   kf12   F2   F12 function key
+       key_f13                   kf13   F3   F13 function key
+       key_f14                   kf14   F4   F14 function key
+       key_f15                   kf15   F5   F15 function key
+       key_f16                   kf16   F6   F16 function key
+       key_f17                   kf17   F7   F17 function key
+       key_f18                   kf18   F8   F18 function key
+       key_f19                   kf19   F9   F19 function key
+       key_f2                    kf2    k2   F2 function key
+       key_f20                   kf20   FA   F20 function key
+       key_f21                   kf21   FB   F21 function key
+       key_f22                   kf22   FC   F22 function key
+       key_f23                   kf23   FD   F23 function key
+       key_f24                   kf24   FE   F24 function key
+
+       key_f25                   kf25   FF   F25 function key
+       key_f26                   kf26   FG   F26 function key
+       key_f27                   kf27   FH   F27 function key
+       key_f28                   kf28   FI   F28 function key
+       key_f29                   kf29   FJ   F29 function key
+       key_f3                    kf3    k3   F3 function key
+       key_f30                   kf30   FK   F30 function key
+       key_f31                   kf31   FL   F31 function key
+       key_f32                   kf32   FM   F32 function key
+       key_f33                   kf33   FN   F33 function key
+       key_f34                   kf34   FO   F34 function key
+       key_f35                   kf35   FP   F35 function key
+       key_f36                   kf36   FQ   F36 function key
+       key_f37                   kf37   FR   F37 function key
+       key_f38                   kf38   FS   F38 function key
+       key_f39                   kf39   FT   F39 function key
+       key_f4                    kf4    k4   F4 function key
+       key_f40                   kf40   FU   F40 function key
+       key_f41                   kf41   FV   F41 function key
+       key_f42                   kf42   FW   F42 function key
+       key_f43                   kf43   FX   F43 function key
+       key_f44                   kf44   FY   F44 function key
+       key_f45                   kf45   FZ   F45 function key
+       key_f46                   kf46   Fa   F46 function key
+       key_f47                   kf47   Fb   F47 function key
+       key_f48                   kf48   Fc   F48 function key
+       key_f49                   kf49   Fd   F49 function key
+       key_f5                    kf5    k5   F5 function key
+       key_f50                   kf50   Fe   F50 function key
+       key_f51                   kf51   Ff   F51 function key
+       key_f52                   kf52   Fg   F52 function key
+       key_f53                   kf53   Fh   F53 function key
+       key_f54                   kf54   Fi   F54 function key
+       key_f55                   kf55   Fj   F55 function key
+       key_f56                   kf56   Fk   F56 function key
+       key_f57                   kf57   Fl   F57 function key
+       key_f58                   kf58   Fm   F58 function key
+       key_f59                   kf59   Fn   F59 function key
+       key_f6                    kf6    k6   F6 function key
+       key_f60                   kf60   Fo   F60 function key
+       key_f61                   kf61   Fp   F61 function key
+       key_f62                   kf62   Fq   F62 function key
+       key_f63                   kf63   Fr   F63 function key
+       key_f7                    kf7    k7   F7 function key
+       key_f8                    kf8    k8   F8 function key
+       key_f9                    kf9    k9   F9 function key
+       key_find                  kfnd   @0   find key
+       key_help                  khlp   %1   help key
+       key_home                  khome  kh   home key
+       key_ic                    kich1  kI   insert-character key
+       key_il                    kil1   kA   insert-line key
+       key_left                  kcub1  kl   left-arrow key
+       key_ll                    kll    kH   lower-left key (home
+                                             down)
+       key_mark                  kmrk   %2   mark key
+       key_message               kmsg   %3   message key
+       key_move                  kmov   %4   move key
+       key_next                  knxt   %5   next key
+       key_npage                 knp    kN   next-page key
+       key_open                  kopn   %6   open key
+       key_options               kopt   %7   options key
+       key_ppage                 kpp    kP   previous-page key
+       key_previous              kprv   %8   previous key
+       key_print                 kprt   %9   print key
+       key_redo                  krdo   %0   redo key
+
+       key_reference             kref   &1   reference key
+       key_refresh               krfr   &2   refresh key
+       key_replace               krpl   &3   replace key
+       key_restart               krst   &4   restart key
+       key_resume                kres   &5   resume key
+       key_right                 kcuf1  kr   right-arrow key
+       key_save                  ksav   &6   save key
+       key_sbeg                  kBEG   &9   shifted begin key
+       key_scancel               kCAN   &0   shifted cancel key
+       key_scommand              kCMD   *1   shifted command key
+       key_scopy                 kCPY   *2   shifted copy key
+       key_screate               kCRT   *3   shifted create key
+       key_sdc                   kDC    *4   shifted delete-char-
+                                             acter key
+       key_sdl                   kDL    *5   shifted delete-line
+                                             key
+       key_select                kslt   *6   select key
+       key_send                  kEND   *7   shifted end key
+       key_seol                  kEOL   *8   shifted clear-to-
+                                             end-of-line key
+       key_sexit                 kEXT   *9   shifted exit key
+       key_sf                    kind   kF   scroll-forward key
+       key_sfind                 kFND   *0   shifted find key
+       key_shelp                 kHLP   #1   shifted help key
+       key_shome                 kHOM   #2   shifted home key
+       key_sic                   kIC    #3   shifted insert-char-
+                                             acter key
+       key_sleft                 kLFT   #4   shifted left-arrow
+                                             key
+       key_smessage              kMSG   %a   shifted message key
+       key_smove                 kMOV   %b   shifted move key
+       key_snext                 kNXT   %c   shifted next key
+       key_soptions              kOPT   %d   shifted options key
+       key_sprevious             kPRV   %e   shifted previous key
+       key_sprint                kPRT   %f   shifted print key
+       key_sr                    kri    kR   scroll-backward key
+       key_sredo                 kRDO   %g   shifted redo key
+       key_sreplace              kRPL   %h   shifted replace key
+       key_sright                kRIT   %i   shifted right-arrow
+                                             key
+       key_srsume                kRES   %j   shifted resume key
+       key_ssave                 kSAV   !1   shifted save key
+       key_ssuspend              kSPD   !2   shifted suspend key
+       key_stab                  khts   kT   set-tab key
+       key_sundo                 kUND   !3   shifted undo key
+       key_suspend               kspd   &7   suspend key
+       key_undo                  kund   &8   undo key
+       key_up                    kcuu1  ku   up-arrow key
+       keypad_local              rmkx   ke   leave 'key-
+                                             board_transmit' mode
+       keypad_xmit               smkx   ks   enter 'key-
+                                             board_transmit' mode
+       lab_f0                    lf0    l0   label on function
+                                             key f0 if not f0
+       lab_f1                    lf1    l1   label on function
+                                             key f1 if not f1
+       lab_f10                   lf10   la   label on function
+                                             key f10 if not f10
+       lab_f2                    lf2    l2   label on function
+                                             key f2 if not f2
+       lab_f3                    lf3    l3   label on function
+                                             key f3 if not f3
+       lab_f4                    lf4    l4   label on function
+                                             key f4 if not f4
+
+
+       lab_f5                    lf5    l5   label on function
+                                             key f5 if not f5
+       lab_f6                    lf6    l6   label on function
+                                             key f6 if not f6
+       lab_f7                    lf7    l7   label on function
+                                             key f7 if not f7
+       lab_f8                    lf8    l8   label on function
+                                             key f8 if not f8
+       lab_f9                    lf9    l9   label on function
+                                             key f9 if not f9
+       label_format              fln    Lf   label format
+       label_off                 rmln   LF   turn off soft labels
+       label_on                  smln   LO   turn on soft labels
+       meta_off                  rmm    mo   turn off meta mode
+       meta_on                   smm    mm   turn on meta mode
+                                             (8th-bit on)
+       micro_column_address      mhpa   ZY   Like column_address
+                                             in micro mode
+       micro_down                mcud1  ZZ   Like cursor_down in
+                                             micro mode
+       micro_left                mcub1  Za   Like cursor_left in
+                                             micro mode
+       micro_right               mcuf1  Zb   Like cursor_right in
+                                             micro mode
+       micro_row_address         mvpa   Zc   Like row_address #1
+                                             in micro mode
+       micro_up                  mcuu1  Zd   Like cursor_up in
+                                             micro mode
+       newline                   nel    nw   newline (behave like
+                                             cr followed by lf)
+       order_of_pins             porder Ze   Match software bits
+                                             to print-head pins
+       orig_colors               oc     oc   Set all color pairs
+                                             to the original ones
+       orig_pair                 op     op   Set default pair to
+                                             its original value
+       pad_char                  pad    pc   padding char
+                                             (instead of null)
+       parm_dch                  dch    DC   delete #1 characters
+                                             (P*)
+       parm_delete_line          dl     DL   delete #1 lines (P*)
+       parm_down_cursor          cud    DO   down #1 lines (P*)
+       parm_down_micro           mcud   Zf   Like parm_down_cur-
+                                             sor in micro mode
+       parm_ich                  ich    IC   insert #1 characters
+                                             (P*)
+       parm_index                indn   SF   scroll forward #1
+                                             lines (P)
+       parm_insert_line          il     AL   insert #1 lines (P*)
+       parm_left_cursor          cub    LE   move #1 characters
+                                             to the left (P)
+       parm_left_micro           mcub   Zg   Like parm_left_cur-
+                                             sor in micro mode
+       parm_right_cursor         cuf    RI   move #1 characters
+                                             to the right (P*)
+       parm_right_micro          mcuf   Zh   Like parm_right_cur-
+                                             sor in micro mode
+       parm_rindex               rin    SR   scroll back #1 lines
+                                             (P)
+       parm_up_cursor            cuu    UP   up #1 lines (P*)
+       parm_up_micro             mcuu   Zi   Like parm_up_cursor
+                                             in micro mode
+       pkey_key                  pfkey  pk   program function key
+                                             #1 to type string #2
+
+
+       pkey_local                pfloc  pl   program function key
+                                             #1 to execute string
+                                             #2
+       pkey_xmit                 pfx    px   program function key
+                                             #1 to transmit
+                                             string #2
+       plab_norm                 pln    pn   program label #1 to
+                                             show string #2
+       print_screen              mc0    ps   print contents of
+                                             screen
+       prtr_non                  mc5p   pO   turn on printer for
+                                             #1 bytes
+       prtr_off                  mc4    pf   turn off printer
+       prtr_on                   mc5    po   turn on printer
+       pulse                     pulse  PU   select pulse dialing
+       quick_dial                qdial  QD   dial number #1 with-
+                                             out checking
+       remove_clock              rmclk  RC   remove clock
+       repeat_char               rep    rp   repeat char #1 #2
+                                             times (P*)
+       req_for_input             rfi    RF   send next input char
+                                             (for ptys)
+       reset_1string             rs1    r1   reset string
+       reset_2string             rs2    r2   reset string
+       reset_3string             rs3    r3   reset string
+       reset_file                rf     rf   name of reset file
+       restore_cursor            rc     rc   restore cursor to
+                                             position of last
+                                             save_cursor
+       row_address               vpa    cv   vertical position #1
+                                             absolute (P)
+       save_cursor               sc     sc   save current cursor
+                                             position (P)
+       scroll_forward            ind    sf   scroll text up (P)
+       scroll_reverse            ri     sr   scroll text down (P)
+       select_char_set           scs    Zj   Select character
+                                             set, #1
+       set_attributes            sgr    sa   define video
+                                             attributes #1-#9
+                                             (PG9)
+       set_background            setb   Sb   Set background color
+                                             #1
+       set_bottom_margin         smgb   Zk   Set bottom margin at
+                                             current line
+       set_bottom_margin_parm    smgbp  Zl   Set bottom margin at
+                                             line #1 or (if smgtp
+                                             is not given) #2
+                                             lines from bottom
+       set_clock                 sclk   SC   set clock, #1 hrs #2
+                                             mins #3 secs
+       set_color_pair            scp    sp   Set current color
+                                             pair to #1
+       set_foreground            setf   Sf   Set foreground color
+                                             #1
+       set_left_margin           smgl   ML   set left soft margin
+                                             at current column.
+                                             See smgl. (ML is not
+                                             in BSD termcap).
+       set_left_margin_parm      smglp  Zm   Set left (right)
+                                             margin at column #1
+       set_right_margin          smgr   MR   set right soft mar-
+                                             gin at current col-
+                                             umn
+       set_right_margin_parm     smgrp  Zn   Set right margin at
+                                             column #1
+
+       set_tab                   hts    st   set a tab in every
+                                             row, current columns
+       set_top_margin            smgt   Zo   Set top margin at
+                                             current line
+       set_top_margin_parm       smgtp  Zp   Set top (bottom)
+                                             margin at row #1
+       set_window                wind   wi   current window is
+                                             lines #1-#2 cols
+                                             #3-#4
+       start_bit_image           sbim   Zq   Start printing bit
+                                             image graphics
+       start_char_set_def        scsd   Zr   Start character set
+                                             definition #1, with
+                                             #2 characters in the
+                                             set
+       stop_bit_image            rbim   Zs   Stop printing bit
+                                             image graphics
+       stop_char_set_def         rcsd   Zt   End definition of
+                                             character set #1
+       subscript_characters      subcs  Zu   List of subscript-
+                                             able characters
+       superscript_characters    supcs  Zv   List of superscript-
+                                             able characters
+       tab                       ht     ta   tab to next 8-space
+                                             hardware tab stop
+       these_cause_cr            docr   Zw   Printing any of
+                                             these characters
+                                             causes CR
+       to_status_line            tsl    ts   move to status line,
+                                             column #1
+       tone                      tone   TO   select touch tone
+                                             dialing
+       underline_char            uc     uc   underline char and
+                                             move past it
+       up_half_line              hu     hu   half a line up
+       user0                     u0     u0   User string #0
+       user1                     u1     u1   User string #1
+       user2                     u2     u2   User string #2
+       user3                     u3     u3   User string #3
+       user4                     u4     u4   User string #4
+       user5                     u5     u5   User string #5
+       user6                     u6     u6   User string #6
+       user7                     u7     u7   User string #7
+       user8                     u8     u8   User string #8
+       user9                     u9     u9   User string #9
+       wait_tone                 wait   WA   wait for dial-tone
+       xoff_character            xoffc  XF   XOFF character
+       xon_character             xonc   XN   XON character
+       zero_motion               zerom  Zx   No motion for subse-
+                                             quent character
+
+       The  following  string  capabilities  are  present  in the
+       SVr4.0 term structure, but were originally not  documented
+       in the man page.
+
+
+               Variable          Cap-     TCap    Description
+                String           name     Code
+       alt_scancode_esc          scesa    S8   Alternate escape
+                                               for scancode emu-
+                                               lation
+       bit_image_carriage_return bicr     Yv   Move to beginning
+                                               of same row
+       bit_image_newline         binel    Zz   Move to next row
+                                               of the bit image
+
+       bit_image_repeat          birep    Xy   Repeat bit image
+                                               cell #1 #2 times
+       char_set_names            csnm     Zy   Produce #1'th item
+                                               from list of char-
+                                               acter set names
+       code_set_init             csin     ci   Init sequence for
+                                               multiple codesets
+       color_names               colornm  Yw   Give name for
+                                               color #1
+       define_bit_image_region   defbi    Yx   Define rectan-
+                                               gualar bit image
+                                               region
+       device_type               devt     dv   Indicate lan-
+                                               guage/codeset sup-
+                                               port
+       display_pc_char           dispc    S1   Display PC charac-
+                                               ter #1
+       end_bit_image_region      endbi    Yy   End a bit-image
+                                               region
+       enter_pc_charset_mode     smpch    S2   Enter PC character
+                                               display mode
+       enter_scancode_mode       smsc     S4   Enter PC scancode
+                                               mode
+       exit_pc_charset_mode      rmpch    S3   Exit PC character
+                                               display mode
+       exit_scancode_mode        rmsc     S5   Exit PC scancode
+                                               mode
+       get_mouse                 getm     Gm   Curses should get
+                                               button events,
+                                               parameter #1 not
+                                               documented.
+       key_mouse                 kmous    Km   Mouse event has
+                                               occurred
+       mouse_info                minfo    Mi   Mouse status
+                                               information
+       pc_term_options           pctrm    S6   PC terminal
+                                               options
+       pkey_plab                 pfxl     xl   Program function
+                                               key #1 to type
+                                               string #2 and show
+                                               string #3
+       req_mouse_pos             reqmp    RQ   Request mouse
+                                               position
+       scancode_escape           scesc    S7   Escape for scan-
+                                               code emulation
+       set0_des_seq              s0ds     s0   Shift to codeset 0
+                                               (EUC set 0, ASCII)
+       set1_des_seq              s1ds     s1   Shift to codeset 1
+       set2_des_seq              s2ds     s2   Shift to codeset 2
+       set3_des_seq              s3ds     s3   Shift to codeset 3
+       set_a_background          setab    AB   Set background
+                                               color to #1, using
+                                               ANSI escape
+       set_a_foreground          setaf    AF   Set foreground
+                                               color to #1, using
+                                               ANSI escape
+       set_color_band            setcolor Yz   Change to ribbon
+                                               color #1
+       set_lr_margin             smglr    ML   Set both left and
+                                               right margins to
+                                               #1, #2.  (ML is
+                                               not in BSD term-
+                                               cap).
+       set_page_length           slines   YZ   Set page length to
+                                               #1 lines
+
+       set_tb_margin             smgtb    MT   Sets both top and
+                                               bottom margins to
+                                               #1, #2
+
+        The XSI Curses  standard  added  these.   They  are  some
+        post-4.1  versions  of System V curses, e.g., Solaris 2.5
+        and IRIX 6.x.  The ncurses termcap  names  for  them  are
+        invented; according to the XSI Curses standard, they have
+        no termcap names.  If your compiled terminfo entries  use
+        these,  they  may  not be binary-compatible with System V
+        terminfo entries after SVr4.1; beware!
+
+
+                Variable         Cap-   TCap     Description
+                 String          name   Code
+        enter_horizontal_hl_mode ehhlm  Xh   Enter horizontal
+                                             highlight mode
+        enter_left_hl_mode       elhlm  Xl   Enter left highlight
+                                             mode
+        enter_low_hl_mode        elohlm Xo   Enter low highlight
+                                             mode
+        enter_right_hl_mode      erhlm  Xr   Enter right high-
+                                             light mode
+        enter_top_hl_mode        ethlm  Xt   Enter top highlight
+                                             mode
+        enter_vertical_hl_mode   evhlm  Xv   Enter vertical high-
+                                             light mode
+        set_a_attributes         sgr1   sA   Define second set of
+                                             video attributes
+                                             #1-#6
+        set_pglen_inch           slengthsL   YI Set page length
+                                             to #1 hundredth of
+                                             an inch
+
+   A Sample Entry
+       The following entry, describing an ANSI-standard terminal,
+       is  representative  of  what a terminfo entry for a modern
+       terminal typically looks like.
+
+     ansi|ansi/pc-term compatible with color,
+             mc5i,
+             colors#8, ncv#3, pairs#64,
+             cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
+             cuu=\E[%p1%dA, dch=\E[%p1%dP, dl=\E[%p1%dM,
+             ech=\E[%p1%dX, el1=\E[1K, hpa=\E[%p1%dG, ht=\E[I,
+             ich=\E[%p1%d@, il=\E[%p1%dL, indn=\E[%p1%dS, .indn=\E[%p1%dT,
+             kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,
+             kcuf1=\E[C, kcuu1=\E[A, kf1=\E[M, kf10=\E[V,
+             kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P,
+             kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U,
+             kich1=\E[L, mc4=\E[4i, mc5=\E[5i, nel=\r\E[S,
+             op=\E[37;40m, rep=%p1%c\E[%p2%{1}%-%db,
+             rin=\E[%p1%dT, s0ds=\E(B, s1ds=\E)B, s2ds=\E*B,
+             s3ds=\E+B, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
+             setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
+             setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
+             sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
+             sgr0=\E[0;10m, tbc=\E[2g, u6=\E[%d;%dR, u7=\E[6n,
+             u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%p1%dd,
+
+       Entries may continue onto multiple lines by placing  white
+       space  at  the  beginning  of  each line except the first.
+       Comments may be included on lines  beginning  with  ``#''.
+       Capabilities in terminfo are of three types: Boolean capa-
+       bilities which indicate that the terminal has some partic-
+       ular  feature, numeric capabilities giving the size of the
+       terminal or the size  of  particular  delays,  and  string
+       capabilities,  which  give a sequence which can be used to
+       perform particular terminal operations.
+
+
+   Types of Capabilities
+       All capabilities have names.  For instance, the fact  that
+       ANSI-standard  terminals  have automatic margins (i.e., an
+       automatic return and line-feed when the end of a  line  is
+       reached)  is  indicated  by  the capability am.  Hence the
+       description of ansi includes am.  Numeric capabilities are
+       followed  by  the character `#' and then a positive value.
+       Thus cols, which indicates the number of columns the  ter-
+       minal  has,  gives  the  value  `80' for ansi.  Values for
+       numeric capabilities may be specified in decimal, octal or
+       hexadecimal,  using the C programming language conventions
+       (e.g., 255, 0377 and 0xff or 0xFF).
+
+       Finally, string valued capabilities, such as el (clear  to
+       end of line sequence) are given by the two-character code,
+       an `=', and then a string ending  at  the  next  following
+       `,'.
+
+       A  number  of  escape sequences are provided in the string
+       valued capabilities for easy encoding of characters there.
+       Both  \E  and  \e map to an ESCAPE character, ^x maps to a
+       control-x for any appropriate x, and the sequences  \n  \l
+       \r  \t  \b  \f  \s give a newline, line-feed, return, tab,
+       backspace, form-feed, and space.  Other escapes include \^
+       for  ^, \\ for \, \, for comma, \: for :, and \0 for null.
+       (\0 will produce \200, which does not terminate  a  string
+       but behaves as a null character on most terminals, provid-
+       ing CS7 is specified.  See stty(1).)  Finally,  characters
+       may be given as three octal digits after a \.
+
+       A  delay  in  milliseconds may appear anywhere in a string
+       capability, enclosed in $<..> brackets, as in  el=\EK$<5>,
+       and  padding  characters  are supplied by tputs to provide
+       this delay.  The delay must be a number with at  most  one
+       decimal place of precision; it may be followed by suffixes
+       `*' or '/' or both.  A  `*'  indicates  that  the  padding
+       required  is  proportional to the number of lines affected
+       by the  operation,  and  the  amount  given  is  the  per-
+       affected-unit  padding  required.   (In the case of insert
+       character,  the  factor  is  still  the  number  of  lines
+       affected.)   Normally,  padding  is advisory if the device
+       has the xon capability; it is used  for  cost  computation
+       but  does not trigger delays.  A `/' suffix indicates that
+       the padding is mandatory and forces a delay of  the  given
+       number  of  milliseconds  even on devices for which xon is
+       present to indicate flow control.
+
+       Sometimes individual capabilities must be  commented  out.
+       To  do this, put a period before the capability name.  For
+       example, see the second ind in the example above.
+
+
+   Fetching Compiled Descriptions
+       If the environment variable TERMINFO is set, it is  inter-
+       preted  as the pathname of a directory containing the com-
+       piled description you are working on.  Only that directory
+       is searched.
+
+       If  TERMINFO  is  not set, the ncurses version of the ter-
+       minfo reader code  will  instead  look  in  the  directory
+       $HOME/.terminfo  for  a compiled description.  If it fails
+       to find one  there,  and  the  environment  variable  TER-
+       MINFO_DIRS  is set, it will interpret the contents of that
+       variable as a list of colon- separated directories  to  be
+       searched  (an  empty  entry is interpreted as a command to
+       search /usr/share/terminfo).  If no description  is  found
+       in  any of the TERMINFO_DIRS directories, the fetch fails.
+
+       If neither TERMINFO nor TERMINFO_DIRS  is  set,  the  last
+       place   tried  will  be  the  system  terminfo  directory,
+       /usr/share/terminfo.
+
+       (Neither the  $HOME/.terminfo  lookups  nor  TERMINFO_DIRS
+       extensions   are  supported  under  stock  System  V  ter-
+       minfo/curses.)
+
+
+   Preparing Descriptions
+       We now outline how to prepare descriptions  of  terminals.
+       The  most  effective way to prepare a terminal description
+       is by imitating the description of a similar  terminal  in
+       terminfo  and  to  build up a description gradually, using
+       partial descriptions with vi or some other screen-oriented
+       program  to  check that they are correct.  Be aware that a
+       very unusual terminal may expose deficiencies in the abil-
+       ity  of  the  terminfo  file to describe it or bugs in the
+       screen-handling code of the test program.
+
+       To get the padding for insert line right (if the  terminal
+       manufacturer did not document it) a severe test is to edit
+       a large file at 9600 baud, delete 16 or so lines from  the
+       middle  of  the screen, then hit the `u' key several times
+       quickly.  If the terminal messes up, more padding is  usu-
+       ally  needed.  A similar test can be used for insert char-
+       acter.
+
+
+   Basic Capabilities
+       The number of columns on each line  for  the  terminal  is
+       given  by the cols numeric capability.  If the terminal is
+       a CRT, then the number of lines on the screen is given  by
+       the lines capability.  If the terminal wraps around to the
+       beginning of the next line when it reaches the right  mar-
+       gin, then it should have the am capability.  If the termi-
+       nal can clear its screen, leaving the cursor in  the  home
+       position,  then this is given by the clear string capabil-
+       ity.  If the terminal overstrikes (rather than clearing  a
+       position  when  a character is struck over) then it should
+       have the os capability.  If the  terminal  is  a  printing
+       terminal,  with no soft copy unit, give it both hc and os.
+       (os applies to storage scope terminals, such as  TEKTRONIX
+       4010  series, as well as hard copy and APL terminals.)  If
+       there is a code to move the cursor to the left edge of the
+       current row, give this as cr.  (Normally this will be car-
+       riage return, control M.)  If there is a code  to  produce
+       an audible signal (bell, beep, etc) give this as bel.
+
+       If  there is a code to move the cursor one position to the
+       left (such as backspace) that capability should  be  given
+       as  cub1.   Similarly, codes to move to the right, up, and
+       down should be given as cuf1, cuu1, and cud1.  These local
+       cursor  motions  should not alter the text they pass over,
+       for example, you would not normally use  `cuf1= '  because
+       the space would erase the character moved over.
+
+       A  very  important  point  here  is  that the local cursor
+       motions encoded in terminfo are undefined at the left  and
+       top  edges  of  a  CRT  terminal.   Programs  should never
+       attempt to backspace around the left edge,  unless  bw  is
+       given, and never attempt to go up locally off the top.  In
+       order to scroll text up, a program will go to  the  bottom
+       left corner of the screen and send the ind (index) string.
+
+       To scroll text down, a program goes to the top left corner
+       of  the  screen  and  sends the ri (reverse index) string.
+       The strings ind and ri are undefined  when  not  on  their
+       respective corners of the screen.
+
+       Parameterized versions of the scrolling sequences are indn
+       and rin which have the same semantics as ind and ri except
+       that  they take one parameter, and scroll that many lines.
+       They are also undefined except at the appropriate edge  of
+       the screen.
+
+       The  am  capability tells whether the cursor sticks at the
+       right edge of the screen when text  is  output,  but  this
+       does not necessarily apply to a cuf1 from the last column.
+       The only local motion which is defined from the left  edge
+       is  if  bw  is  given, then a cub1 from the left edge will
+       move to the right edge of the previous row.  If bw is  not
+       given,  the effect is undefined.  This is useful for draw-
+       ing a box around the edge of the screen, for example.   If
+       the  terminal has switch selectable automatic margins, the
+       terminfo file usually assumes that this is on;  i.e.,  am.
+       If  the  terminal  has  a command which moves to the first
+       column of the next line, that command can be given as  nel
+       (newline).   It  does not matter if the command clears the
+       remainder of the current line, so if the terminal  has  no
+       cr  and lf it may still be possible to craft a working nel
+       out of one or both of them.
+
+       These  capabilities  suffice  to  describe  hard-copy  and
+       "glass-tty"  terminals.   Thus  the  model  33 teletype is
+       described as
+
+       33|tty33|tty|model 33 teletype,
+            bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,
+
+       while the Lear Siegler ADM-3 is described as
+
+       adm3|3|lsi adm3,
+            am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
+            ind=^J, lines#24,
+
+
+   Parameterized Strings
+       Cursor addressing and other strings  requiring  parameters
+       in  the  terminal  are described by a parameterized string
+       capability, with printf(3) like escapes  %x  in  it.   For
+       example,  to  address  the  cursor,  the cup capability is
+       given, using two parameters: the row and column to address
+       to.  (Rows and columns are numbered from zero and refer to
+       the physical screen visible to the user, not to any unseen
+       memory.)   If  the  terminal  has  memory  relative cursor
+       addressing, that can be indicated by mrcup.
+
+       The parameter mechanism uses a stack and special  %  codes
+       to  manipulate  it.  Typically a sequence will push one of
+       the parameters onto the stack and then print  it  in  some
+       format.   Print  (e.g.,  "%d")  is  a special case.  Other
+       operations, including "%t"  pop  their  operand  from  the
+       stack.  It is noted that more complex operations are often
+       necessary, e.g., in the sgr string.
+
+       The % encodings have the following meanings:
+
+
+       %%   outputs `%'
+
+       %[[:]flags][width[.precision]][doxXs]
+            as in printf, flags are [-+#] and space.  Use  a  `:'
+            to  allow the next character to be a `-' flag, avoid-
+            ing interpreting "%-" as an operator.
+
+       %c   print pop() like %c in printf
+
+       %s   print pop() like %s in printf
+
+       %p[1-9]
+            push i'th parameter
+
+       %P[a-z]
+            set dynamic variable [a-z] to pop()
+
+       %g[a-z]
+            get dynamic variable [a-z] and push it
+
+       %P[A-Z]
+            set static variable [a-z] to pop()
+
+       %g[A-Z]
+            get static variable [a-z] and push it
+
+            The terms  "static"  and  "dynamic"  are  misleading.
+            Historically,  these are simply two different sets of
+            variables, whose values are not reset  between  calls
+            to  tparm.   However,  that fact is not documented in
+            other implementations.  Relying on it will  adversely
+            impact portability to other implementations.
+
+       %'c' char constant c
+
+       %{nn}
+            integer constant nn
+
+       %l   push strlen(pop)
+
+       %+ %- %* %/ %m
+            arithmetic (%m is mod): push(pop() op pop())
+
+       %& %| %^
+            bit operations (AND, OR and exclusive-OR): push(pop()
+            op pop())
+
+       %= %> %<
+            logical operations: push(pop() op pop())
+
+       %A, %O
+            logical AND and OR operations (for conditionals)
+
+       %! %~
+            unary  operations  (logical  and   bit   complement):
+            push(op pop())
+
+       %i   add 1 to first two parameters (for ANSI terminals)
+
+       %? expr %t thenpart %e elsepart %;
+            This  forms  an  if-then-else.   The  %e  elsepart is
+            optional.  Usually the %? expr part  pushes  a  value
+            onto  the stack, and %t pops it from the stack, test-
+            ing if it is nonzero (true).  If it is zero  (false),
+            control passes to the %e (else) part.
+
+            It is possible to form else-if's a la Algol 68:
+            %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;
+
+            where ci are conditions, bi are bodies.
+
+            Use the -f option of tic or infocmp to see the struc-
+            ture  of if-then-else's.  Some strings, e.g., sgr can
+            be very complicated when written on one line.  The -f
+            option  splits  the  string into lines with the parts
+            indented.
+
+       Binary operations are in postfix form with the operands in
+       the  usual  order.   That  is,  to  get  x-5 one would use
+       "%gx%{5}%-".  %P and %g variables  are  persistent  across
+       escape-string evaluations.
+
+       Consider the HP2645, which, to get to row 3 and column 12,
+       needs to be sent \E&a12c03Y  padded  for  6  milliseconds.
+       Note  that  the  order of the rows and columns is inverted
+       here, and that the row and column are printed as two  dig-
+       its.  Thus its cup capability is "cup=6\E&%p2%2dc%p1%2dY".
+
+       The Microterm ACT-IV needs the current row and column sent
+       preceded  by  a ^T, with the row and column simply encoded
+       in binary, "cup=^T%p1%c%p2%c".  Terminals which  use  "%c"
+       need  to  be  able  to backspace the cursor (cub1), and to
+       move the cursor up one line on the screen (cuu1).  This is
+       necessary  because it is not always safe to transmit \n ^D
+       and \r, as the system may change or  discard  them.   (The
+       library  routines  dealing  with terminfo set tty modes so
+       that tabs are never expanded, so \t is safe to send.  This
+       turns out to be essential for the Ann Arbor 4080.)
+
+       A final example is the LSI ADM-3a, which uses row and col-
+       umn  offset  by  a  blank  character,  thus  "cup=\E=%p1%'
+       '%+%c%p2%'  '%+%c".   After sending `\E=', this pushes the
+       first parameter, pushes the ASCII value for a space  (32),
+       adds  them  (pushing  the sum on the stack in place of the
+       two previous values) and outputs that value as  a  charac-
+       ter.   Then  the  same  is  done for the second parameter.
+       More complex arithmetic is possible using the stack.
+
+
+   Cursor Motions
+       If the terminal has a fast way to home the cursor (to very
+       upper  left  corner  of  screen) then this can be given as
+       home; similarly a fast way of getting to the  lower  left-
+       hand  corner can be given as ll; this may involve going up
+       with cuu1 from the home position,  but  a  program  should
+       never  do this itself (unless ll does) because it can make
+       no assumption about the effect of moving up from the  home
+       position.   Note  that  the  home  position is the same as
+       addressing to (0,0): to the top left corner of the screen,
+       not  of  memory.   (Thus, the \EH sequence on HP terminals
+       cannot be used for home.)
+
+       If the terminal has row or column absolute cursor address-
+       ing,  these  can be given as single parameter capabilities
+       hpa (horizontal position absolute) and vpa (vertical posi-
+       tion absolute).  Sometimes these are shorter than the more
+       general two parameter sequence (as with  the  hp2645)  and
+       can   be   used  in  preference  to  cup.   If  there  are
+       parameterized local motions (e.g., move n  spaces  to  the
+       right) these can be given as cud, cub, cuf, and cuu with a
+       single parameter  indicating  how  many  spaces  to  move.
+       These  are  primarily useful if the terminal does not have
+       cup, such as the TEKTRONIX 4025.
+
+       If the terminal needs to be in a special mode when running
+       a program that uses these capabilities, the codes to enter
+       and exit this mode can be given as smcup and rmcup.   This
+       arises,  for example, from terminals like the Concept with
+       more than one page of memory.  If the  terminal  has  only
+       memory  relative cursor addressing and not screen relative
+       cursor addressing, a one screen-sized window must be fixed
+       into  the terminal for cursor addressing to work properly.
+       This is also used for the TEKTRONIX 4025, where smcup sets
+       the  command character to be the one used by terminfo.  If
+       the smcup sequence will not restore the  screen  after  an
+       rmcup sequence is output (to the state prior to outputting
+       rmcup), specify nrrmc.
+
+
+   Area Clears
+       If the terminal can clear from the current position to the
+       end  of  the  line,  leaving  the cursor where it is, this
+       should be given as el.  If the terminal can clear from the
+       beginning  of  the line to the current position inclusive,
+       leaving the cursor where it is, this should  be  given  as
+       el1.   If the terminal can clear from the current position
+       to the end of the display, then this should  be  given  as
+       ed.   Ed  is only defined from the first column of a line.
+       (Thus, it can be simulated by a request to delete a  large
+       number of lines, if a true ed is not available.)
+
+
+   Insert/delete line and vertical motions
+       If  the terminal can open a new blank line before the line
+       where the cursor is, this should be given as il1; this  is
+       done  only  from the first position of a line.  The cursor
+       must then appear on the newly blank line.  If the terminal
+       can  delete  the  line  which  the cursor is on, then this
+       should be given as dl1; this is done only from  the  first
+       position  on  the line to be deleted.  Versions of il1 and
+       dl1 which take a single parameter  and  insert  or  delete
+       that many lines can be given as il and dl.
+
+       If  the terminal has a settable scrolling region (like the
+       vt100) the command to set this can be described  with  the
+       csr  capability,  which  takes two parameters: the top and
+       bottom lines of the scrolling region.  The cursor position
+       is, alas, undefined after using this command.
+
+       It  is possible to get the effect of insert or delete line
+       using csr on a properly chosen region; the sc and rc (save
+       and  restore  cursor)  commands may be useful for ensuring
+       that your synthesized insert/delete string does  not  move
+       the  cursor.  (Note that the ncurses(3x) library does this
+       synthesis  automatically,  so   you   need   not   compose
+       insert/delete strings for an entry with csr).
+
+       Yet another way to construct insert and delete might be to
+       use a combination of index with  the  memory-lock  feature
+       found  on some terminals (like the HP-700/90 series, which
+       however also has insert/delete).
+
+       Inserting lines at the top or bottom  of  the  screen  can
+       also  be  done using ri or ind on many terminals without a
+       true insert/delete line, and is often faster even on  ter-
+       minals with those features.
+
+       The  boolean  non_dest_scroll_region should be set if each
+       scrolling window is effectively a view port on  a  screen-
+       sized  canvas.   To  test  for  this  capability, create a
+       scrolling region in the middle of the screen, write  some-
+       thing  to  the  bottom line, move the cursor to the top of
+       the region, and do ri followed by dl1 or ind.  If the data
+       scrolled  off  the  bottom  of  the  region  by the ri re-
+       appears, then scrolling is non-destructive.  System V  and
+       XSI  Curses  expect that ind, ri, indn, and rin will simu-
+       late destructive scrolling; their  documentation  cautions
+       you  not  to  define csr unless this is true.  This curses
+       implementation is more liberal and will do explicit erases
+       after scrolling if ndstr is defined.
+
+       If the terminal has the ability to define a window as part
+       of memory, which all commands affect, it should  be  given
+       as the parameterized string wind.  The four parameters are
+       the starting and ending lines in memory and  the  starting
+       and ending columns in memory, in that order.
+
+       If  the terminal can retain display memory above, then the
+       da capability should be given; if display  memory  can  be
+       retained  below,  then db should be given.  These indicate
+       that deleting a line  or  scrolling  may  bring  non-blank
+       lines  up  from  below  or that scrolling back with ri may
+       bring down non-blank lines.
+
+
+   Insert/Delete Character
+       There are two basic kinds of  intelligent  terminals  with
+       respect  to insert/delete character which can be described
+       using terminfo.  The most common  insert/delete  character
+       operations  affect only the characters on the current line
+       and shift characters off the  end  of  the  line  rigidly.
+       Other  terminals,  such  as the Concept 100 and the Perkin
+       Elmer Owl, make a distinction between  typed  and  untyped
+       blanks  on  the  screen, shifting upon an insert or delete
+       only to an untyped blank on the  screen  which  is  either
+       eliminated,  or  expanded  to two untyped blanks.  You can
+       determine the kind of terminal you have  by  clearing  the
+       screen  and  then typing text separated by cursor motions.
+       Type "abc    def" using local cursor motions (not  spaces)
+       between the "abc" and the "def".  Then position the cursor
+       before the "abc" and put the terminal in insert mode.   If
+       typing  characters  causes  the  rest of the line to shift
+       rigidly and characters to fall off the end, then your ter-
+       minal  does  not  distinguish  between  blanks and untyped
+       positions.  If the "abc" shifts over to  the  "def"  which
+       then  move together around the end of the current line and
+       onto the next as you insert, you have the second  type  of
+       terminal,  and should give the capability in, which stands
+       for "insert null".  While these are two logically separate
+       attributes  (one  line  versus multi-line insert mode, and
+       special treatment of untyped spaces) we have seen no  ter-
+       minals whose insert mode cannot be described with the sin-
+       gle attribute.
+
+       Terminfo can describe both terminals which have an  insert
+       mode, and terminals which send a simple sequence to open a
+       blank position on the current  line.   Give  as  smir  the
+       sequence  to  get  into  insert  mode.   Give  as rmir the
+       sequence to leave insert  mode.   Now  give  as  ich1  any
+       sequence  needed  to  be  sent  just  before  sending  the
+       character to be inserted.   Most  terminals  with  a  true
+       insert  mode  will  not  give ich1; terminals which send a
+       sequence to open a screen position should give it here.
+
+       If your terminal has both, insert mode is usually  prefer-
+       able  to  ich1.   Technically,  you  should  not give both
+       unless the terminal actually requires both to be  used  in
+       combination.   Accordingly,  some  non-curses applications
+       get confused if both are present; the symptom  is  doubled
+       characters in an update using insert.  This requirement is
+       now rare; most ich sequences do not require previous smir,
+       and most smir insert modes do not require ich1 before each
+       character.  Therefore, the  new  curses  actually  assumes
+       this  is the case and uses either rmir/smir or ich/ich1 as
+       appropriate (but not both).  If you have to write an entry
+       to  be  used under new curses for a terminal old enough to
+       need both, include the rmir/smir sequences in ich1.
+
+       If post insert padding is needed, give this as a number of
+       milliseconds  in ip (a string option).  Any other sequence
+       which may need to be sent after  an  insert  of  a  single
+       character may also be given in ip.  If your terminal needs
+       both to be placed into an `insert mode' and a special code
+       to  precede  each  inserted character, then both smir/rmir
+       and ich1 can be given, and both will  be  used.   The  ich
+       capability, with one parameter, n, will repeat the effects
+       of ich1 n times.
+
+       If padding is necessary between characters typed while not
+       in  insert  mode,  give  this  as a number of milliseconds
+       padding in rmp.
+
+       It is occasionally  necessary  to  move  around  while  in
+       insert  mode  to delete characters on the same line (e.g.,
+       if there is a tab after the insertion position).  If  your
+       terminal  allows  motion while in insert mode you can give
+       the capability mir to speed up  inserting  in  this  case.
+       Omitting  mir  will  affect  only  speed.   Some terminals
+       (notably Datamedia's) must not have mir because of the way
+       their insert mode works.
+
+       Finally,  you  can specify dch1 to delete a single charac-
+       ter, dch with one parameter, n, to  delete  n  characters,
+       and  delete mode by giving smdc and rmdc to enter and exit
+       delete mode (any mode the terminal needs to be  placed  in
+       for dch1 to work).
+
+       A  command to erase n characters (equivalent to outputting
+       n blanks without moving the cursor) can be  given  as  ech
+       with one parameter.
+
+
+   Highlighting, Underlining, and Visible Bells
+       If  your  terminal  has  one  or  more  kinds  of  display
+       attributes, these can be represented in a number  of  dif-
+       ferent ways.  You should choose one display form as stand-
+       out mode, representing a good, high contrast, easy-on-the-
+       eyes,  format  for  highlighting  error messages and other
+       attention getters.  (If you have a choice,  reverse  video
+       plus  half-bright  is  good, or reverse video alone.)  The
+       sequences to enter and exit standout  mode  are  given  as
+       smso  and  rmso, respectively.  If the code to change into
+       or out of standout mode  leaves  one  or  even  two  blank
+       spaces  on the screen, as the TVI 912 and Teleray 1061 do,
+       then xmc should be given to tell how many spaces are left.
+
+       Codes  to  begin  underlining  and  end underlining can be
+       given as smul and rmul respectively.  If the terminal  has
+       a  code  to  underline  the current character and move the
+       cursor one space to the right, such as the Microterm Mime,
+       this can be given as uc.
+
+       Other  capabilities  to  enter  various highlighting modes
+       include blink (blinking) bold (bold or extra  bright)  dim
+       (dim  or  half-bright)  invis (blanking or invisible text)
+       prot (protected) rev (reverse video) sgr0  (turn  off  all
+       attribute  modes)  smacs  (enter  alternate  character set
+       mode) and  rmacs  (exit  alternate  character  set  mode).
+       Turning  on  any of these modes singly may or may not turn
+       off other modes.
+
+       If there is a sequence to set  arbitrary  combinations  of
+       modes,  this should be given as sgr (set attributes), tak-
+       ing 9 parameters.  Each parameter is either 0 or  nonzero,
+       as the corresponding attribute is on or off.  The 9 param-
+       eters are, in order: standout, underline, reverse,  blink,
+       dim,  bold,  blank, protect, alternate character set.  Not
+       all modes need be supported by sgr, only those  for  which
+       corresponding separate attribute commands exist.
+
+       For example, the DEC vt220 supports most of the modes:
+
+
+            tparm parameter   attribute    escape sequence
+
+            none              none         \E[0m
+            p1                standout     \E[0;1;7m
+            p2                underline    \E[0;4m
+            p3                reverse      \E[0;7m
+            p4                blink        \E[0;5m
+            p5                dim          not available
+            p6                bold         \E[0;1m
+            p7                invis        \E[0;8m
+            p8                protect      not used
+            p9                altcharset   ^O (off) ^N (on)
+
+       We  begin each escape sequence by turning off any existing
+       modes, since there is no quick way  to  determine  whether
+       they are active.  Standout is set up to be the combination
+       of reverse and bold.  The vt220  terminal  has  a  protect
+       mode,  though  it  is  not commonly used in sgr because it
+       protects characters on the screen  from  the  host's  era-
+       sures.   The  altcharset mode also is different in that it
+       is either ^O or ^N, depending on whether it is off or  on.
+       If  all  modes  are  turned  on, the resulting sequence is
+       \E[0;1;4;5;7;8m^N.
+
+       Some sequences are common to different modes.   For  exam-
+       ple,  ;7  is output when either p1 or p3 is true, that is,
+       if either standout or reverse modes are turned on.
+
+       Writing out the above sequences, along with  their  depen-
+       dencies yields
+
+
+          sequence   when to output      terminfo translation
+
+          \E[0       always              \E[0
+          ;1         if p1 or p6         %?%p1%p6%|%t;1%;
+          ;4         if p2               %?%p2%|%t;4%;
+          ;5         if p4               %?%p4%|%t;5%;
+
+          ;7         if p1 or p3         %?%p1%p3%|%t;7%;
+          ;8         if p7               %?%p7%|%t;8%;
+          m          always              m
+          ^N or ^O   if p9 ^N, else ^O   %?%p9%t^N%e^O%;
+
+       Putting this all together into the sgr sequence gives:
+
+           sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
+               %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
+
+       Remember  that  if  you specify sgr, you must also specify
+       sgr0.  Also, some implementations rely on sgr being  given
+       if  sgr0  is, Not all terminfo entries necessarily have an
+       sgr string, however.  Many terminfo  entries  are  derived
+       from  termcap  entries which have no sgr string.  The only
+       drawback to adding an sgr  string  is  that  termcap  also
+       assumes  that  sgr0  does not exit alternate character set
+       mode.
+
+       Terminals with the ``magic cookie'' glitch  (xmc)  deposit
+       special   ``cookies''   when   they  receive  mode-setting
+       sequences, which affect the display algorithm rather  than
+       having  extra  bits  for  each character.  Some terminals,
+       such as the HP 2621,  automatically  leave  standout  mode
+       when  they  move to a new line or the cursor is addressed.
+       Programs using standout mode  should  exit  standout  mode
+       before  moving the cursor or sending a newline, unless the
+       msgr capability, asserting that it  is  safe  to  move  in
+       standout mode, is present.
+
+       If  the terminal has a way of flashing the screen to indi-
+       cate an error quietly (a bell replacement) then  this  can
+       be given as flash; it must not move the cursor.
+
+       If  the  cursor  needs to be made more visible than normal
+       when it is not on the bottom line (to make, for example, a
+       non-blinking  underline  into  an  easier to find block or
+       blinking underline) give this sequence as cvvis.  If there
+       is  a  way  to  make the cursor completely invisible, give
+       that as civis.  The capability cnorm should be given which
+       undoes the effects of both of these modes.
+
+       If your terminal correctly generates underlined characters
+       (with no special codes needed) even  though  it  does  not
+       overstrike,  then you should give the capability ul.  If a
+       character overstriking another leaves both  characters  on
+       the screen, specify the capability os.  If overstrikes are
+       erasable with a blank, then this should  be  indicated  by
+       giving eo.
+
+
+   Keypad and Function Keys
+       If the terminal has a keypad that transmits codes when the
+       keys are pressed, this information  can  be  given.   Note
+       that it is not possible to handle terminals where the key-
+       pad only works in local (this applies, for example, to the
+       unshifted  HP  2621  keys).   If  the keypad can be set to
+       transmit or not transmit, give these  codes  as  smkx  and
+       rmkx.  Otherwise the keypad is assumed to always transmit.
+       The codes sent by the left arrow, right arrow,  up  arrow,
+       down  arrow,  and  home keys can be given as kcub1, kcuf1,
+       kcuu1, kcud1, and khome respectively.  If there are  func-
+       tion  keys  such  as f0, f1, ..., f10, the codes they send
+       can be given as kf0, kf1, ..., kf10.  If these  keys  have
+       labels  other  than the default f0 through f10, the labels
+       can  be  given  as  lf0,  lf1,  ...,  lf10.    The   codes
+       transmitted  by  certain  other special keys can be given:
+       kll (home down), kbs (backspace), ktbc (clear  all  tabs),
+       kctab  (clear  the  tab  stop in this column), kclr (clear
+       screen or  erase  key),  kdch1  (delete  character),  kdl1
+       (delete line), krmir (exit insert mode), kel (clear to end
+       of line), ked (clear to  end  of  screen),  kich1  (insert
+       character  or  enter insert mode), kil1 (insert line), knp
+       (next  page),  kpp  (previous  page),  kind  (scroll  for-
+       ward/down), kri (scroll backward/up), khts (set a tab stop
+       in this column).  In addition, if the keypad has a 3 by  3
+       array  of  keys  including  the four arrow keys, the other
+       five keys can be given as ka1, ka3,  kb2,  kc1,  and  kc3.
+       These  keys are useful when the effects of a 3 by 3 direc-
+       tional pad are needed.
+
+       Strings to program function keys can be  given  as  pfkey,
+       pfloc,  and pfx.  A string to program screen labels should
+       be specified as pln.  Each  of  these  strings  takes  two
+       parameters:  the function key number to program (from 0 to
+       10) and the string to program it with.  Function key  num-
+       bers  out  of  this  range may program undefined keys in a
+       terminal dependent manner.   The  difference  between  the
+       capabilities  is  that pfkey causes pressing the given key
+       to be the same as the user typing the given string;  pfloc
+       causes the string to be executed by the terminal in local;
+       and pfx causes the string to be transmitted  to  the  com-
+       puter.
+
+       The capabilities nlab, lw and lh define the number of pro-
+       grammable screen labels and their width  and  height.   If
+       there  are  commands  to  turn the labels on and off, give
+       them in smln and rmln.  smln is normally output after  one
+       or more pln sequences to make sure that the change becomes
+       visible.
+
+
+   Tabs and Initialization
+       If the terminal has hardware tabs, the command to  advance
+       to  the  next tab stop can be given as ht (usually control
+       I).  A ``back-tab'' command which moves  leftward  to  the
+       preceding tab stop can be given as cbt.  By convention, if
+       the teletype modes indicate that tabs are  being  expanded
+       by  the  computer  rather than being sent to the terminal,
+       programs should not  use  ht  or  cbt  even  if  they  are
+       present,  since  the user may not have the tab stops prop-
+       erly set.  If the terminal has  hardware  tabs  which  are
+       initially  set every n spaces when the terminal is powered
+       up, the numeric parameter it is given, showing the  number
+       of  spaces  the tabs are set to.  This is normally used by
+       the tset command to determine whether to set the mode  for
+       hardware  tab expansion, and whether to set the tab stops.
+       If the terminal has tab stops that can be  saved  in  non-
+       volatile  memory, the terminfo description can assume that
+       they are properly set.
+
+       Other capabilities include is1, is2, and is3,  initializa-
+       tion  strings  for the terminal, iprog, the path name of a
+       program to be run to initialize the terminal, and if,  the
+       name  of  a  file  containing long initialization strings.
+       These strings are expected to set the terminal into  modes
+       consistent  with  the  rest  of  the terminfo description.
+       They are normally sent to the terminal, by the init option
+       of  the  tput  program,  each time the user logs in.  They
+       will be printed in the following order:
+
+              run the program
+                     iprog
+
+              output is1 is2
+
+              set the margins using
+                     mgc, smgl and smgr
+
+              set tabs using
+                     tbc and hts
+
+              print the file
+                     if
+
+              and finally
+                     output is3.
+
+       Most initialization is done with  is2.   Special  terminal
+       modes can be set up without duplicating strings by putting
+       the common sequences in is2 and special cases in  is1  and
+       is3.
+
+       A set of sequences that does a harder reset from a totally
+       unknown state can be given as rs1, rs2, rf and rs3, analo-
+       gous  to  is1  ,  is2  ,  if  and is3 respectively.  These
+       strings are output by the reset  program,  which  is  used
+       when  the terminal gets into a wedged state.  Commands are
+       normally placed in rs1, rs2 rs3 and rf only if  they  pro-
+       duce  annoying effects on the screen and are not necessary
+       when logging in.  For example,  the  command  to  set  the
+       vt100  into  80-column mode would normally be part of is2,
+       but it causes an annoying glitch of the screen and is  not
+       normally  needed  since the terminal is usually already in
+       80 column mode.
+
+       The reset program writes strings including iprog, etc., in
+       the  same  order  as  the  init  program, using rs1, etc.,
+       instead of is1, etc.  If any of rs1, rs2, rs3, or rf reset
+       capability  strings  are  missing, the reset program falls
+       back  upon  the  corresponding  initialization  capability
+       string.
+
+       If there are commands to set and clear tab stops, they can
+       be given as tbc (clear all tab stops) and hts (set  a  tab
+       stop  in the current column of every row).  If a more com-
+       plex sequence is needed  to  set  the  tabs  than  can  be
+       described  by  this,  the sequence can be placed in is2 or
+       if.
+
+   Delays and Padding
+       Many older and slower  terminals  do  not  support  either
+       XON/XOFF or DTR handshaking, including hard copy terminals
+       and some very archaic CRTs (including,  for  example,  DEC
+       VT100s).   These may require padding characters after cer-
+       tain cursor motions and screen changes.
+
+       If the terminal uses xon/xoff handshaking for flow control
+       (that  is, it automatically emits ^S back to the host when
+       its input buffers are close to full), set xon.  This capa-
+       bility  suppresses  the emission of padding.  You can also
+       set it for memory-mapped console devices effectively  that
+       do  not  have  a  speed limit.  Padding information should
+       still be included so that routines can make  better  deci-
+       sions about relative costs, but actual pad characters will
+       not be transmitted.
+
+       If pb (padding baud rate) is given, padding is  suppressed
+       at  baud rates below the value of pb.  If the entry has no
+       padding baud rate, then whether padding is emitted or  not
+       is completely controlled by xon.
+
+       If  the terminal requires other than a null (zero) charac-
+       ter as a pad, then this can be given  as  pad.   Only  the
+       first character of the pad string is used.
+
+
+   Status Lines
+       Some  terminals  have  an extra `status line' which is not
+       normally used by software (and thus  not  counted  in  the
+       terminal's lines capability).
+
+       The  simplest  case  is  a  status  line  which is cursor-
+       addressable but not part of the main scrolling  region  on
+       the  screen;  the  Heathkit  H19 has a status line of this
+       kind, as would a 24-line VT100 with  a  23-line  scrolling
+       region  set up on initialization.  This situation is indi-
+       cated by the hs capability.
+
+       Some terminals with status lines need special sequences to
+       access  the  status  line.   These  may  be expressed as a
+       string with single parameter tsl which takes the cursor to
+       a  given zero-origin column on the status line.  The capa-
+       bility fsl must return to the main-screen cursor positions
+       before  the  last  tsl.   You may need to embed the string
+       values of sc (save cursor) and rc (restore cursor) in  tsl
+       and fsl to accomplish this.
+
+       The  status  line is normally assumed to be the same width
+       as the width of the terminal.  If this is untrue, you  can
+       specify it with the numeric capability wsl.
+
+       A  command to erase or blank the status line may be speci-
+       fied as dsl.
+
+       The  boolean  capability  eslok  specifies   that   escape
+       sequences, tabs, etc., work ordinarily in the status line.
+
+       The ncurses implementation does not yet use any  of  these
+       capabilities.   They are documented here in case they ever
+       become important.
+
+
+   Line Graphics
+       Many terminals have alternate character  sets  useful  for
+       forms-drawing.   Terminfo  and curses build in support for
+       the drawing characters supported by the VT100,  with  some
+       characters  from  the  AT&T  4410v1 added.  This alternate
+       character set may be specified by the acsc capability.
+
+
+       Glyph                      ACS            Ascii      VT100
+       Name                       Name           Default    Name
+       UK pound sign              ACS_STERLING   f          }
+       arrow pointing down        ACS_DARROW     v          .
+       arrow pointing left        ACS_LARROW     <          ,
+       arrow pointing right       ACS_RARROW     >          +
+       arrow pointing up          ACS_UARROW     ^          -
+       board of squares           ACS_BOARD      #          h
+       bullet                     ACS_BULLET     o          ~
+       checker board (stipple)    ACS_CKBOARD    :          a
+       degree symbol              ACS_DEGREE     \          f
+       diamond                    ACS_DIAMOND    +          `
+       greater-than-or-equal-to   ACS_GEQUAL     >          z
+       greek pi                   ACS_PI         *          {
+       horizontal line            ACS_HLINE      -          q
+       lantern symbol             ACS_LANTERN    #          i
+       large plus or crossover    ACS_PLUS       +          n
+       less-than-or-equal-to      ACS_LEQUAL     <          y
+
+       lower left corner          ACS_LLCORNER   +          m
+       lower right corner         ACS_LRCORNER   +          j
+       not-equal                  ACS_NEQUAL     !          |
+       plus/minus                 ACS_PLMINUS    #          g
+       scan line 1                ACS_S1         ~          o
+       scan line 3                ACS_S3         -          p
+       scan line 7                ACS_S7         -          r
+       scan line 9                ACS_S9         _          s
+       solid square block         ACS_BLOCK      #          0
+       tee pointing down          ACS_TTEE       +          w
+       tee pointing left          ACS_RTEE       +          u
+       tee pointing right         ACS_LTEE       +          t
+       tee pointing up            ACS_BTEE       +          v
+       upper left corner          ACS_ULCORNER   +          l
+       upper right corner         ACS_URCORNER   +          k
+       vertical line              ACS_VLINE      |          x
+
+       The best way to define a new device's graphics set  is  to
+       add  a  column  to a copy of this table for your terminal,
+       giving  the  character   which   (when   emitted   between
+       smacs/rmacs  switches) will be rendered as the correspond-
+       ing graphic.  Then read off the VT100/your terminal  char-
+       acter  pairs  right  to left in sequence; these become the
+       ACSC string.
+
+
+   Color Handling
+       Most color terminals are either `Tektronix-like'  or  `HP-
+       like'.   Tektronix-like terminals have a predefined set of
+       N colors (where N usually 8), and can  set  character-cell
+       foreground and background characters independently, mixing
+       them into N * N color-pairs.  On  HP-like  terminals,  the
+       use must set each color pair up separately (foreground and
+       background are  not  independently  settable).   Up  to  M
+       color-pairs  may  be  set  up  from  2*M different colors.
+       ANSI-compatible terminals are Tektronix-like.
+
+       Some basic color capabilities are independent of the color
+       method.  The numeric capabilities colors and pairs specify
+       the maximum numbers of colors and color-pairs that can  be
+       displayed  simultaneously.   The op (original pair) string
+       resets foreground and background colors to  their  default
+       values  for the terminal.  The oc string resets all colors
+       or color-pairs to their default values for  the  terminal.
+       Some  terminals  (including  many  PC  terminal emulators)
+       erase screen  areas  with  the  current  background  color
+       rather  than the power-up default background; these should
+       have the boolean capability bce.
+
+       To change the current foreground or background color on  a
+       Tektronix-type  terminal,  use setaf (set ANSI foreground)
+       and setab (set ANSI background) or setf  (set  foreground)
+       and  setb (set background).  These take one parameter, the
+       color  number.   The  SVr4  documentation  describes  only
+       setaf/setab;  the  XPG4  draft  says that "If the terminal
+       supports ANSI escape sequences to set background and fore-
+       ground,  they  should be coded as setaf and setab, respec-
+       tively.  If the terminal supports other  escape  sequences
+       to  set background and foreground, they should be coded as
+       setf and setb, respectively.  The vidputs()  function  and
+       the  refresh  functions  use  setaf  and setab if they are
+       defined."
+
+       The setaf/setab and setf/setb capabilities take  a  single
+       numeric argument each.  Argument values 0-7 of setaf/setab
+       are portably defined as follows (the middle column is  the
+       symbolic #define available in the header for the curses or
+       ncurses libraries).  The terminal hardware is free to  map
+       these  as  it  likes,  but  the RGB values indicate normal
+       locations in color space.
+
+
+             Color       #define       Value       RGB
+             black     COLOR_BLACK       0     0, 0, 0
+             red       COLOR_RED         1     max,0,0
+             green     COLOR_GREEN       2     0,max,0
+             yellow    COLOR_YELLOW      3     max,max,0
+             blue      COLOR_BLUE        4     0,0,max
+             magenta   COLOR_MAGENTA     5     max,0,max
+             cyan      COLOR_CYAN        6     0,max,max
+             white     COLOR_WHITE       7     max,max,max
+
+       The argument values of setf/setb  historically  correspond
+       to a different mapping, i.e.,
+
+             Color       #define       Value       RGB
+             black     COLOR_BLACK       0     0, 0, 0
+             blue      COLOR_BLUE        1     0,0,max
+             green     COLOR_GREEN       2     0,max,0
+             cyan      COLOR_CYAN        3     0,max,max
+             red       COLOR_RED         4     max,0,0
+             magenta   COLOR_MAGENTA     5     max,0,max
+             yellow    COLOR_YELLOW      6     max,max,0
+             white     COLOR_WHITE       7     max,max,max
+       It is important to not confuse the two sets of color capa-
+       bilities; otherwise red/blue will be interchanged  on  the
+       display.
+
+       On  an  HP-like terminal, use scp with a color-pair number
+       parameter to set which color pair is current.
+
+       On a Tektronix-like terminal, the capability  ccc  may  be
+       present  to  indicate that colors can be modified.  If so,
+       the initc capability will take a color number (0 to colors
+       -  1)and  three  more parameters which describe the color.
+       These three parameters default to being interpreted as RGB
+       (Red,  Green, Blue) values.  If the boolean capability hls
+       is present, they are instead as HLS (Hue, Lightness, Satu-
+       ration) indices.  The ranges are terminal-dependent.
+
+       On  an  HP-like  terminal, initp may give a capability for
+       changing a color-pair value.  It will take  seven  parame-
+       ters;  a  color-pair  number (0 to max_pairs - 1), and two
+       triples describing first background  and  then  foreground
+       colors.   These  parameters  must be (Red, Green, Blue) or
+       (Hue, Lightness, Saturation) depending on hls.
+
+       On some color terminals, colors collide  with  highlights.
+       You can register these collisions with the ncv capability.
+       This is a bit-mask of attributes not to be used when  col-
+       ors  are  enabled.  The correspondence with the attributes
+       understood by curses is as follows:
+
+
+                      Attribute      Bit   Decimal
+                      A_STANDOUT     0     1
+                      A_UNDERLINE    1     2
+                      A_REVERSE      2     4
+                      A_BLINK        3     8
+                      A_DIM          4     16
+                      A_BOLD         5     32
+                      A_INVIS        6     64
+                      A_PROTECT      7     128
+                      A_ALTCHARSET   8     256
+
+       For example,  on  many  IBM  PC  consoles,  the  underline
+       attribute  collides  with the foreground color blue and is
+       not available in color mode.  These  should  have  an  ncv
+       capability of 2.
+
+       SVr4  curses  does nothing with ncv, ncurses recognizes it
+       and optimizes the output in favor of colors.
+
+
+   Miscellaneous
+       If the terminal requires other than a null (zero)  charac-
+       ter  as  a  pad,  then this can be given as pad.  Only the
+       first character of the pad string is used.  If the  termi-
+       nal does not have a pad character, specify npc.  Note that
+       ncurses implements  the  termcap-compatible  PC  variable;
+       though  the  application  may  set this value to something
+       other than a null, ncurses will test  npc  first  and  use
+       napms if the terminal has no pad character.
+
+       If  the terminal can move up or down half a line, this can
+       be indicated with hu  (half-line  up)  and  hd  (half-line
+       down).  This is primarily useful for superscripts and sub-
+       scripts on hard-copy terminals.  If a  hard-copy  terminal
+       can  eject  to  the next page (form feed), give this as ff
+       (usually control L).
+
+       If there is a command to repeat a given character a  given
+       number  of times (to save time transmitting a large number
+       of identical characters) this can be  indicated  with  the
+       parameterized  string  rep.   The  first  parameter is the
+       character to be repeated and the second is the  number  of
+       times  to repeat it.  Thus, tparm(repeat_char, 'x', 10) is
+       the same as `xxxxxxxxxx'.
+
+       If the terminal has a settable command character, such  as
+       the  TEKTRONIX  4025, this can be indicated with cmdch.  A
+       prototype command character is chosen which is used in all
+       capabilities.   This character is given in the cmdch capa-
+       bility to identify it.  The following convention  is  sup-
+       ported  on  some  UNIX  systems:  The environment is to be
+       searched for a CC variable, and if found, all  occurrences
+       of the prototype character are replaced with the character
+       in the environment variable.
+
+       Terminal descriptions that do  not  represent  a  specific
+       kind of known terminal, such as switch, dialup, patch, and
+       network, should include the  gn  (generic)  capability  so
+       that  programs  can  complain that they do not know how to
+       talk to the terminal.  (This capability does not apply  to
+       virtual   terminal   descriptions  for  which  the  escape
+       sequences are known.)
+
+       If the terminal has a ``meta key'' which acts as  a  shift
+       key,  setting  the  8th  bit of any character transmitted,
+       this fact can be indicated with km.   Otherwise,  software
+       will assume that the 8th bit is parity and it will usually
+       be cleared.  If strings exist to turn this  ``meta  mode''
+       on and off, they can be given as smm and rmm.
+
+       If  the terminal has more lines of memory than will fit on
+       the screen at once, the number of lines of memory  can  be
+       indicated  with  lm.   A  value of lm#0 indicates that the
+       number of lines is not fixed, but that there is still more
+       memory than fits on the screen.
+
+       If the terminal is one of those supported by the UNIX vir-
+       tual terminal protocol, the terminal number can  be  given
+       as vt.
+
+       Media copy strings which control an auxiliary printer con-
+       nected to the terminal can be given as mc0: print the con-
+       tents  of  the screen, mc4: turn off the printer, and mc5:
+       turn on the printer.  When the printer  is  on,  all  text
+       sent  to  the terminal will be sent to the printer.  It is
+       undefined whether the text is also displayed on the termi-
+       nal screen when the printer is on.  A variation mc5p takes
+       one parameter, and leaves the printer on for as many char-
+       acters  as  the  value  of  the  parameter, then turns the
+       printer off.  The parameter should not  exceed  255.   All
+       text,  including  mc4,  is  transparently  passed  to  the
+       printer while an mc5p is in effect.
+
+
+   Glitches and Braindamage
+       Hazeltine terminals, which do not allow `~' characters  to
+       be displayed should indicate hz.
+
+       Terminals which ignore a line-feed immediately after an am
+       wrap, such as the Concept and vt100, should indicate xenl.
+
+       If  el  is  required  to  get  rid of standout (instead of
+       merely writing normal text on top of it),  xhp  should  be
+       given.
+
+       Teleray  terminals,  where  tabs turn all characters moved
+       over to blanks, should  indicate  xt  (destructive  tabs).
+       Note:    the    variable    indicating    this    is   now
+       `dest_tabs_magic_smso'; in older  versions,  it  was  tel-
+       eray_glitch.  This glitch is also taken to mean that it is
+       not possible to position the cursor on top  of  a  ``magic
+       cookie'', that to erase standout mode it is instead neces-
+       sary to use delete and insert line.  The ncurses implemen-
+       tation ignores this glitch.
+
+       The  Beehive Superbee, which is unable to correctly trans-
+       mit the escape or control C characters, has xsb,  indicat-
+       ing  that the f1 key is used for escape and f2 for control
+       C.  (Only certain Superbees have this  problem,  depending
+       on  the  ROM.)  Note that in older terminfo versions, this
+       capability  was  called  `beehive_glitch';   it   is   now
+       `no_esc_ctl_c'.
+
+       Other  specific  terminal  problems  may  be  corrected by
+       adding more capabilities of the form xx.
+
+
+   Similar Terminals
+       If there are two very similar terminals, one (the variant)
+       can  be  defined  as  being just like the other (the base)
+       with certain exceptions.  In the definition of  the  vari-
+       ant,  the string capability use can be given with the name
+       of the base terminal.  The capabilities given  before  use
+       override  those  in  the base type named by use.  If there
+       are multiple use capabilities, they are merged in  reverse
+       order.   That is, the rightmost use reference is processed
+       first, then the one to its left, and so forth.   Capabili-
+       ties  given explicitly in the entry override those brought
+       in by use references.
+
+       A capability can be canceled by placing xx@ to the left of
+       the  use  reference that imports it, where xx is the capa-
+       bility.  For example, the entry
+
+                   2621-nl, smkx@, rmkx@, use=2621,
+
+       defines a 2621-nl that does not  have  the  smkx  or  rmkx
+       capabilities,  and hence does not turn on the function key
+       labels when in visual mode.  This is useful for  different
+       modes for a terminal, or for different user preferences.
+
+
+   Pitfalls of Long Entries
+       Long  terminfo  entries  are  unlikely to be a problem; to
+       date, no entry has even  approached  terminfo's  4096-byte
+       string-table maximum.  Unfortunately, the termcap transla-
+       tions are much more strictly limited (to 1023 bytes), thus
+       termcap  translations  of  long terminfo entries can cause
+       problems.
+
+       The man pages for 4.3BSD and older versions  of  tgetent()
+       instruct  the  user to allocate a 1024-byte buffer for the
+       termcap entry.  The  entry  gets  null-terminated  by  the
+       termcap library, so that makes the maximum safe length for
+       a termcap entry 1k-1 (1023) bytes.  Depending on what  the
+       application  and  the termcap library being used does, and
+       where in the termcap file the terminal type that tgetent()
+       is searching for is, several bad things can happen.
+
+       Some  termcap libraries print a warning message or exit if
+       they find an entry that's longer than 1023  bytes;  others
+       do  not;  others truncate the entries to 1023 bytes.  Some
+       application programs allocate more than the recommended 1K
+       for the termcap entry; others do not.
+
+       Each termcap entry has two important sizes associated with
+       it: before "tc" expansion, and after "tc" expansion.  "tc"
+       is  the  capability that tacks on another termcap entry to
+       the end of the current one, to add  on  its  capabilities.
+       If  a termcap entry does not use the "tc" capability, then
+       of course the two lengths are the same.
+
+       The "before tc expansion" length  is  the  most  important
+       one,  because it affects more than just users of that par-
+       ticular terminal.  This is the length of the entry  as  it
+       exists in /etc/termcap, minus the backslash-newline pairs,
+       which tgetent() strips out while reading it.  Some termcap
+       libraries  strip  off  the final newline, too (GNU termcap
+       does not).  Now suppose:
+
+       *    a termcap entry before expansion is  more  than  1023
+            bytes long,
+
+       *    and the application has only allocated a 1k buffer,
+
+       *    and  the  termcap library (like the one in BSD/OS 1.1
+            and GNU) reads the whole entry into  the  buffer,  no
+            matter  what its length, to see if it is the entry it
+            wants,
+
+       *    and tgetent() is searching for a terminal  type  that
+            either is the long entry, appears in the termcap file
+            after the long entry, or does not appear in the  file
+            at  all  (so  that  tgetent() has to search the whole
+            termcap file).
+
+       Then tgetent() will overwrite memory, perhaps  its  stack,
+       and  probably core dump the program.  Programs like telnet
+       are particularly vulnerable;  modern  telnets  pass  along
+       values  like the terminal type automatically.  The results
+       are almost as undesirable with  a  termcap  library,  like
+       SunOS  4.1.3  and Ultrix 4.4, that prints warning messages
+       when it reads an overly long termcap entry.  If a  termcap
+       library  truncates  long  entries,  like  OSF/1 3.0, it is
+       immune to dying here but will return  incorrect  data  for
+       the terminal.
+
+       The "after tc expansion" length will have a similar effect
+       to the above, but only for people who actually set TERM to
+       that  terminal type, since tgetent() only does "tc" expan-
+       sion once it is found the terminal  type  it  was  looking
+       for, not while searching.
+
+       In summary, a termcap entry that is longer than 1023 bytes
+       can cause, on various combinations  of  termcap  libraries
+       and  applications,  a  core  dump,  warnings, or incorrect
+       operation.  If it is too long even before "tc"  expansion,
+       it will have this effect even for users of some other ter-
+       minal types and users whose TERM variable does not have  a
+       termcap entry.
+
+       When in -C (translate to termcap) mode, the ncurses imple-
+       mentation of tic(1m) issues warning messages when the pre-
+       tc  length  of  a termcap translation is too long.  The -c
+       (check) option also checks resolved (after  tc  expansion)
+       lengths.
+
+   Binary Compatibility
+       It  is not wise to count on portability of binary terminfo
+       entries between commercial UNIX versions.  The problem  is
+       that  there  are  at least two versions of terminfo (under
+       HP-UX and AIX) which diverged from System V terminfo after
+       SVr1,  and have added extension capabilities to the string
+       table that (in the binary format) collide  with  System  V
+       and XSI Curses extensions.
+
+
+
+

EXTENSIONS

+       Some  SVr4  curses  implementations,  and  all previous to
+       SVr4, do not interpret the %A and %O operators in  parame-
+       ter strings.
+
+       SVr4/XPG4  do  not  specify whether msgr licenses movement
+       while in an alternate-character-set mode (such modes  may,
+       among  other  things,  map CR and NL to characters that do
+       not trigger local motions).   The  ncurses  implementation
+       ignores  msgr  in ALTCHARSET mode.  This raises the possi-
+       bility that an XPG4  implementation  making  the  opposite
+       interpretation  may need terminfo entries made for ncurses
+       to have msgr turned off.
+
+       The ncurses library handles insert-character  and  insert-
+       character modes in a slightly non-standard way to get bet-
+       ter update efficiency.  See  the  Insert/Delete  Character
+       subsection above.
+
+       The   parameter   substitutions  for  set_clock  and  dis-
+       play_clock are not documented in SVr4 or  the  XSI  Curses
+       standard.  They are deduced from the documentation for the
+       AT&T 505 terminal.
+
+       Be careful assigning the kmous  capability.   The  ncurses
+       wants  to  interpret it as KEY_MOUSE, for use by terminals
+       and emulators like xterm that  can  return  mouse-tracking
+       information in the keyboard-input stream.
+
+       Different  commercial ports of terminfo and curses support
+       different subsets of the XSI Curses standard and (in  some
+       cases) different extension sets.  Here is a summary, accu-
+       rate as of October 1995:
+
+       SVR4, Solaris, ncurses -- These support all SVr4 capabili-
+       ties.
+
+       SGI  --  Supports  the  SVr4  set,  adds  one undocumented
+       extended string capability (set_pglen).
+
+       SVr1, Ultrix -- These support a restricted subset of  ter-
+       minfo  capabilities.   The booleans end with xon_xoff; the
+       numerics with  width_status_line;  and  the  strings  with
+       prtr_non.
+
+       HP/UX  --  Supports  the  SVr1  subset,  plus the SVr[234]
+       numerics num_labels, label_height, label_width, plus func-
+       tion  keys  11  through  63, plus plab_norm, label_on, and
+       label_off, plus some incompatible extensions in the string
+       table.
+
+       AIX  --  Supports  the  SVr1 subset, plus function keys 11
+       through 63, plus a number  of  incompatible  string  table
+       extensions.
+
+       OSF  -- Supports both the SVr4 set and the AIX extensions.
+
+
+
+

FILES

+       /usr/share/terminfo/?/*  files     containing     terminal
+                                descriptions
+
+
+
+

SEE ALSO

+       tic(1m),   infocmp(1m),  curses(3x),  printf(3),  term(5).
+       term_variables(3x).
+
+
+
+

AUTHORS

+       Zeyd M. Ben-Halim, Eric  S.  Raymond,  Thomas  E.  Dickey.
+       Based on pcurses by Pavel Curtis.
+
+
+
+                                                            terminfo(5)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html new file mode 100644 index 00000000000..9b246b5d237 --- /dev/null +++ b/doc/html/man/tic.1m.html @@ -0,0 +1,330 @@ + + + + +tic 1m + + + + +

tic 1m

+
+
+
+tic(1m)                                                         tic(1m)
+
+
+
+
+
+

NAME

+       tic - the terminfo entry-description compiler
+
+
+
+

SYNOPSIS

+       tic  [-1CGILNTUVacfgrstx]  [-e names] [-o dir] [-R subset]
+       [-v[n]] [-w[n]] file
+
+
+
+

DESCRIPTION

+       The command tic translates a  terminfo  file  from  source
+       format  into compiled format.  The compiled format is nec-
+       essary for use with the library routines in ncurses(3x).
+
+       The results are normally placed  in  the  system  terminfo
+       directory  /usr/share/terminfo.   There  are  two  ways to
+       change this behavior.
+
+       First, you may override the system default by setting  the
+       variable  TERMINFO  in  your  shell environment to a valid
+       (existing) directory name.
+
+       Secondly, if tic cannot get access to  /usr/share/terminfo
+       or  your  TERMINFO  directory,  it looks for the directory
+       $HOME/.terminfo; if that directory exists,  the  entry  is
+       placed there.
+
+       Libraries that read terminfo entries are expected to check
+       for a TERMINFO directory first, look at $HOME/.terminfo if
+       TERMINFO  is  not set, and finally look in /usr/share/ter-
+       minfo.
+
+       -1     restricts the output to a single column
+
+       -a     tells  tic  to  retain  commented-out  capabilities
+              rather than discarding them.  Capabilities are com-
+              mented by prefixing them with a period.  This  sets
+              the  -x option, because it treats the commented-out
+              entries as user-defined names.  If  the  source  is
+              termcap,  accept  the 2-character names required by
+              version 6.  Otherwise these are ignored.
+
+       -C     Force source translation to termcap format.   Note:
+              this  differs  from the -C option of infocmp(1m) in
+              that it does not merely translate capability names,
+              but  also  translates  terminfo  strings to termcap
+              format.  Capabilities that are not translatable are
+              left  in  the  entry under their terminfo names but
+              commented out with two preceding dots.
+
+       -c     tells tic to only check file for errors,  including
+              syntax  problems and bad use links.  If you specify
+              -C (-I) with this option, the code will print warn-
+              ings about entries which, after use resolution, are
+              more than 1023 (4096) bytes long.  Due to  a  fixed
+              buffer  length  in  older  termcap libraries (and a
+              documented limit in terminfo),  these  entries  may
+              cause core dumps.
+
+       -e names
+              Limit  writes  and  translations  to  the following
+              comma-separated list of terminals.  If any name  or
+              alias of a terminal matches one of the names in the
+              list, the entry will be written  or  translated  as
+              normal.   Otherwise no output will be generated for
+              it.  The option value is interpreted as a file con-
+              taining  the  list  if  it  contains a '/'.  (Note:
+              depending on how tic was compiled, this option  may
+              require -I or -C.)
+
+       -f     Display  complex  terminfo  strings  which  contain
+              if/then/else/endif expressions indented  for  read-
+              ability.
+
+       -G     Display  constant  literals  in decimal form rather
+              than their character equivalents.
+
+       -g     Display constant character literals in quoted  form
+              rather than their decimal equivalents.
+
+       -I     Force source translation to terminfo format.
+
+       -L     Force  source  translation to terminfo format using
+              the long C variable names listed in <term.h>
+
+       -N     Disable smart defaults.  Normally, when translating
+              from termcap to terminfo, the compiler makes a num-
+              ber of assumptions about  the  defaults  of  string
+              capabilities  reset1_string,  carriage_return, cur-
+              sor_left, cursor_down,  scroll_forward,  tab,  new-
+              line,  key_backspace,  key_left, and key_down, then
+              attempts to use obsolete  termcap  capabilities  to
+              deduce correct values.  It also normally suppresses
+              output of obsolete termcap capabilities such as bs.
+              This  option forces a more literal translation that
+              also preserves the obsolete capabilities.
+
+       -odir  Write compiled entries to given  directory.   Over-
+              rides the TERMINFO environment variable.
+
+       -Rsubset
+              Restrict  output to a given subset.  This option is
+              for use with  archaic  versions  of  terminfo  like
+              those on SVr1, Ultrix, or HP/UX that do not support
+              the full set of SVR4/XSI Curses terminfo; and  out-
+              right broken ports like AIX 3.x that have their own
+              extensions incompatible with  SVr4/XSI.   Available
+              subsets  are  "SVr1",  "Ultrix",  "HP",  "BSD"  and
+              "AIX"; see terminfo(5) for details.
+
+       -r     Force entry resolution (so there are  no  remaining
+              tc  capabilities)  even  when  doing translation to
+              termcap format.  This may  be  needed  if  you  are
+              preparing  a  termcap  file  for  a termcap library
+              (such as GNU termcap through  version  1.3  or  BSD
+              termcap through 4.3BSD) that does not handle multi-
+              ple tc capabilities per entry.
+
+       -s     Summarize the compile by showing the directory into
+              which  entries  are  written,  and  the  number  of
+              entries which are compiled.
+
+       -T     eliminates size-restrictions on the generated text.
+              This  is  mainly  useful  for testing and analysis,
+              since the compiled descriptions are limited  (e.g.,
+              1023 for termcap, 4096 for terminfo).
+
+       -t     tells  tic  to  discard commented-out capabilities.
+              Normally when translating from terminfo to termcap,
+              untranslatable capabilities are commented-out.
+
+       -U   tells  tic to not post-process the data after parsing
+            the source file.  Normally, it infers data  which  is
+            commonly  missing in older terminfo data, or in term-
+            caps.
+
+       -V   reports the version of ncurses which was used in this
+            program, and exits.
+
+       -vn  specifies  that  (verbose) output be written to stan-
+            dard error trace information showing tic's  progress.
+            The  optional  parameter  n is a number from 1 to 10,
+            inclusive, indicating the desired level of detail  of
+            information.   If  n is omitted, the default level is
+            1.  If n is specified and greater than 1,  the  level
+            of detail is increased.
+
+       -wn  specifies  the width of the output.  The parameter is
+            optional.  If it is omitted, it defaults to 60.
+
+       -x   Treat unknown capabilities as user-defined.  That is,
+            if  you  supply  a capability name which tic does not
+            recognize, it will infer its type (boolean, number or
+            string)  from  the  syntax and make an extended table
+            entry  for  that.   User-defined  capability  strings
+            whose  name begins with ``k'' are treated as function
+            keys.
+
+       file contains one or more terminfo  terminal  descriptions
+            in source format [see terminfo(5)].  Each description
+            in the file describes the capabilities of a  particu-
+            lar terminal.
+
+       The debug flag levels are as follows:
+
+       1      Names of files created and linked
+
+       2      Information related to the ``use'' facility
+
+       3      Statistics from the hashing algorithm
+
+       5      String-table memory allocations
+
+       7      Entries into the string-table
+
+       8      List of tokens encountered by scanner
+
+       9      All values computed in construction of the hash ta-
+              ble
+
+       If the debug level n is not given, it is taken to be  one.
+
+       All but one of the capabilities recognized by tic are doc-
+       umented in terminfo(5).  The exception is the use capabil-
+       ity.
+
+       When  a  use=entry-name  field is discovered in a terminal
+       entry currently being compiled, tic reads  in  the  binary
+       from  /usr/share/terminfo to complete the entry.  (Entries
+       created from file will be used first.  If the  environment
+       variable  TERMINFO  is  set,  that  directory  is searched
+       instead of /usr/share/terminfo.)  tic duplicates the capa-
+       bilities  in  entry-name  for  the current entry, with the
+       exception  of  those  capabilities  that  explicitly   are
+       defined in the current entry.
+
+       When    an   entry,   e.g.,   entry_name_1,   contains   a
+       use=entry_name_2  field,  any  canceled  capabilities   in
+       entry_name_2  must also appear in entry_name_1 before use=
+       for these capabilities to be canceled in entry_name_1.
+
+       If the environment variable TERMINFO is set, the  compiled
+       results are placed there instead of /usr/share/terminfo.
+
+       Total compiled entries cannot exceed 4096 bytes.  The name
+       field cannot exceed 512 bytes.  Terminal  names  exceeding
+       the  maximum  alias  length (32 characters on systems with
+       long filenames, 14 characters otherwise) will be truncated
+       to  the maximum alias length and a warning message will be
+       printed.
+
+
+
+

COMPATIBILITY

+       There is some evidence that historic  tic  implementations
+       treated  description  fields with no whitespace in them as
+       additional aliases or short names.  This tic does  not  do
+       that,  but  it  does  warn  when description fields may be
+       treated that way and check them for dangerous  characters.
+
+
+
+

EXTENSIONS

+       Unlike the stock SVr4 tic command, this implementation can
+       actually compile termcap sources.   In  fact,  entries  in
+       terminfo  and  termcap  syntax  can  be  mixed in a single
+       source file.  See terminfo(5)  for  the  list  of  termcap
+       names taken to be equivalent to terminfo names.
+
+       The  SVr4  manual  pages  are  not clear on the resolution
+       rules for use capabilities.  This  implementation  of  tic
+       will find use targets anywhere in the source file, or any-
+       where in the file tree rooted at TERMINFO (if TERMINFO  is
+       defined),  or  in the user's $HOME/.terminfo directory (if
+       it exists), or (finally) anywhere  in  the  system's  file
+       tree of compiled entries.
+
+       The  error  messages from this tic have the same format as
+       GNU C error messages, and can be  parsed  by  GNU  Emacs's
+       compile facility.
+
+       The  -C,  -G,  -I, -N, -R, -T, -V, -a, -e, -f, -g, -o, -r,
+       -s, -t and -x options are not supported under  SVr4.   The
+       SVr4 -c mode does not report bad use links.
+
+       System  V does not compile entries to or read entries from
+       your $HOME/.terminfo directory unless TERMINFO is  explic-
+       itly set to it.
+
+
+
+

FILES

+       /usr/share/terminfo/?/*
+            Compiled terminal description database.
+
+
+
+

SEE ALSO

+       infocmp(1m),    captoinfo(1m),   infotocap(1m),   toe(1m),
+       curses(3x), terminfo(5).
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+

AUTHOR

+       Eric S. Raymond <esr@snark.thyrsus.com> and
+       Thomas E. Dickey <dickey@invisible-island.net>
+
+
+
+                                                                tic(1m)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html new file mode 100644 index 00000000000..b948480e0c9 --- /dev/null +++ b/doc/html/man/toe.1m.html @@ -0,0 +1,126 @@ + + + + +toe 1m + + + + +

toe 1m

+
+
+
+toe(1m)                                                         toe(1m)
+
+
+
+
+
+

NAME

+       toe - table of (terminfo) entries
+
+
+
+

SYNOPSIS

+       toe [-v[n]] [-ahuUV] file...
+
+
+
+

DESCRIPTION

+       With no options, toe lists all available terminal types by
+       primary name with descriptions.   File  arguments  specify
+       the  directories  to  be scanned; if no such arguments are
+       given, your default terminfo directory is scanned.  If you
+       also  specify  the  -h  option, a directory header will be
+       issued as each directory is entered.
+
+       There are other options intended for use by terminfo  file
+       maintainers:
+
+       -a     report  on  all  of  the  terminal  databases which
+              ncurses would search, rather than  only  the  first
+              one that it finds.
+
+       -u file
+              says  to  write  a  report  to the standard output,
+              listing dependencies in the given  terminfo/termcap
+              source  file.  The report condenses the `use' rela-
+              tion: each line consists of the primary name  of  a
+              terminal  that  has use capabilities, followed by a
+              colon, followed by the whitespace-separated primary
+              names  of  all  terminals  which occur in those use
+              capabilities, followed by a newline
+
+       -U file
+              says to write a  report  to  the  standard  output,
+              listing  reverse  dependencies  in  the  given ter-
+              minfo/termcap source file.  The report reverses the
+              `use'  relation:  each line consists of the primary
+              name of a terminal that occurs in use capabilities,
+              followed  by  a  colon, followed by the whitespace-
+              separated primary  names  of  all  terminals  which
+              depend on it, followed by a newline.
+
+       -vn    specifies that (verbose) output be written to stan-
+              dard error, showing toe's progress.   The  optional
+              parameter  n  is a number from 1 to 10, interpreted
+              as for tic(1m).
+
+       -V     reports the version of ncurses which  was  used  in
+              this program, and exits.
+
+
+
+

FILES

+       /usr/share/terminfo/?/*
+            Compiled terminal description database.
+
+
+
+

SEE ALSO

+       tic(1m),    infocmp(1m),   captoinfo(1m),   infotocap(1m),
+       curses(3x), terminfo(5).
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                                toe(1m)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html new file mode 100644 index 00000000000..e702f7bacef --- /dev/null +++ b/doc/html/man/tput.1.html @@ -0,0 +1,343 @@ + + + + +tput 1 + + + + +

tput 1

+
+
+
+tput(1)                                                         tput(1)
+
+
+
+
+
+

NAME

+       tput,  reset  -  initialize  a  terminal or query terminfo
+       database
+
+
+
+

SYNOPSIS

+       tput [-Ttype] capname [parms ... ]
+       tput [-Ttype] init
+       tput [-Ttype] reset
+       tput [-Ttype] longname
+       tput -S  <<
+       tput -V
+
+
+
+

DESCRIPTION

+       The tput utility uses the terminfo database  to  make  the
+       values  of terminal-dependent capabilities and information
+       available to the shell (see sh(1)), to initialize or reset
+       the  terminal,  or  return  the long name of the requested
+       terminal type.  The result depends upon  the  capability's
+       type:
+
+              string
+                   tput writes the string to the standard output.
+                   No trailing newline is supplied.
+
+              integer
+                   tput writes the decimal value to the  standard
+                   output, with a trailing newline.
+
+              boolean
+                   tput  simply sets the exit code (0 for TRUE if
+                   the terminal has the capability, 1  for  FALSE
+                   if  it  does  not),  and writes nothing to the
+                   standard output.
+
+       Before using a value returned on the standard output,  the
+       application  should  test  the  exit  code  (e.g., $?, see
+       sh(1)) to be sure it is 0.  (See the EXIT CODES and  DIAG-
+       NOSTICS  sections.)   For  a complete list of capabilities
+       and the capname associated with each, see terminfo(5).
+
+       -Ttype indicates the  type  of  terminal.   Normally  this
+              option is unnecessary, because the default is taken
+              from the environment variable TERM.  If -T is spec-
+              ified,  then  the shell variables LINES and COLUMNS
+              will be ignored,and the operating system  will  not
+              be queried for the actual screen size.
+
+       capname
+              indicates   the   capability   from   the  terminfo
+              database.  When termcap support is compiled in, the
+              termcap name for the capability is also accepted.
+
+       parms  If  the  capability  is a string that takes parame-
+              ters, the arguments parms will be instantiated into
+              the string.
+
+              Most  parameters  are numbers.  Only a few terminfo
+              capabilities require string parameters; tput uses a
+              table to decide which to pass as strings.  Normally
+              tput uses tparm (3x) to perform  the  substitution.
+              If no parameters are given for the capability, tput
+              writes   the   string   without   performing    the
+              substitution.
+
+       -S     allows  more  than one capability per invocation of
+              tput.  The capabilities must be passed to tput from
+              the standard input instead of from the command line
+              (see example).  Only one  capname  is  allowed  per
+              line.   The  -S option changes the meaning of the 0
+              and 1 boolean and string exit codes (see  the  EXIT
+              CODES section).
+
+              Again, tput uses a table and the presence of param-
+              eters in its input to decide whether to  use  tparm
+              (3x), and how to interpret the parameters.
+
+       -V     reports  the  version  of ncurses which was used in
+              this program, and exits.
+
+       init   If the terminfo database is present  and  an  entry
+              for the user's terminal exists (see -Ttype, above),
+              the following will occur:
+
+              (1)    if present,  the  terminal's  initialization
+                     strings  will  be  output as detailed in the
+                     terminfo(5) section on Tabs and  Initializa-
+                     tion,
+
+              (2)    any  delays (e.g., newline) specified in the
+                     entry will be set in the tty driver,
+
+              (3)    tabs expansion will  be  turned  on  or  off
+                     according to the specification in the entry,
+                     and
+
+              (4)    if tabs are not expanded, standard tabs will
+                     be set (every 8 spaces).
+
+              If an entry does not contain the information needed
+              for any of the four above activities, that activity
+              will silently be skipped.
+
+       reset  Instead  of putting out initialization strings, the
+              terminal's reset strings will be output if  present
+              (rs1,  rs2, rs3, rf).  If the reset strings are not
+              present, but initialization strings are,  the  ini-
+              tialization  strings  will  be  output.  Otherwise,
+              reset acts identically to init.
+
+       longname
+              If the terminfo database is present  and  an  entry
+              for  the user's terminal exists (see -Ttype above),
+              then the long name of the terminal will be put out.
+              The long name is the last name in the first line of
+              the terminal's description in the terminfo database
+              [see term(5)].
+
+       If  tput  is  invoked  by a link named reset, this has the
+       same effect as tput reset.  See tset for comparison, which
+       has similar behavior.
+
+
+
+

EXAMPLES

+       tput init
+            Initialize the terminal according to the type of ter-
+            minal in the environmental variable TERM.  This  com-
+            mand  should be included in everyone's .profile after
+            the environmental variable TERM has been exported, as
+            illustrated on the profile(5) manual page.
+
+       tput -T5620 reset
+            Reset  an  AT&T 5620 terminal, overriding the type of
+            terminal in the environmental variable TERM.
+
+       tput cup 0 0
+            Send the sequence to move the cursor to row 0, column
+            0 (the upper left corner of the screen, usually known
+            as the "home" cursor position).
+
+       tput clear
+            Echo the clear-screen sequence for the current termi-
+            nal.
+
+       tput cols
+            Print the number of columns for the current terminal.
+
+       tput -T450 cols
+            Print the number of columns for the 450 terminal.
+
+       bold=`tput smso` offbold=`tput rmso`
+            Set the shell variables bold, to begin stand-out mode
+            sequence, and offbold, to end standout mode sequence,
+            for the current terminal.  This might be followed  by
+            a  prompt:  echo  "${bold}Please  type  in your name:
+            ${offbold}\c"
+
+       tput hc
+            Set exit code to indicate if the current terminal  is
+            a hard copy terminal.
+
+       tput cup 23 4
+            Send  the sequence to move the cursor to row 23, col-
+            umn 4.
+
+       tput cup
+            Send the terminfo string for cursor-movement, with no
+            parameters substituted.
+
+       tput longname
+            Print  the  long  name from the terminfo database for
+            the type of terminal specified in  the  environmental
+            variable TERM.
+
+            tput -S <<!
+            > clear
+            > cup 10 10
+            > bold
+            > !
+
+            This  example shows tput processing several capabili-
+            ties in one invocation.  It clears the screen,  moves
+            the  cursor  to  position  10,  10  and turns on bold
+            (extra bright) mode.  The list is  terminated  by  an
+            exclamation mark (!) on a line by itself.
+
+
+
+

FILES

+       /usr/share/terminfo
+              compiled terminal description database
+
+       /usr/share/tabset/*
+              tab settings for some terminals, in a format appro-
+              priate  to  be  output  to  the  terminal   (escape
+              sequences  that  set  margins  and  tabs); for more
+              information, see the "Tabs and Initialization" sec-
+              tion of terminfo(5)
+
+
+
+

EXIT CODES

+       If the -S option is used, tput checks for errors from each
+       line, and if any errors are found, will set the exit  code
+       to  4  plus the number of lines with errors.  If no errors
+       are found, the exit code is 0.   No  indication  of  which
+       line failed can be given so exit code 1 will never appear.
+       Exit codes 2, 3, and 4 retain their usual  interpretation.
+       If the -S option is not used, the exit code depends on the
+       type of capname:
+
+            boolean
+                   a value of 0 is set for TRUE and 1 for  FALSE.
+
+            string a  value of 0 is set if the capname is defined
+                   for this terminal type (the value  of  capname
+                   is  returned on standard output); a value of 1
+                   is set if capname is not defined for this ter-
+                   minal  type  (nothing  is  written to standard
+                   output).
+
+            integer
+                   a value of 0 is always  set,  whether  or  not
+                   capname is defined for this terminal type.  To
+                   determine if capname is defined for this  ter-
+                   minal type, the user must test the value writ-
+                   ten to standard output.  A value of  -1  means
+                   that  capname is not defined for this terminal
+                   type.
+
+            other  reset or init may fail to find  their  respec-
+                   tive  files.   In  that case, the exit code is
+                   set to 4 + errno.
+
+       Any other exit code indicates an error; see  the  DIAGNOS-
+       TICS section.
+
+
+
+

DIAGNOSTICS

+       tput prints the following error messages and sets the cor-
+       responding exit codes.
+
+
+       exit code   error message
+       ---------------------------------------------------------------------
+       0           (capname is a numeric variable that is not specified  in
+                   the  terminfo(5)  database  for this terminal type, e.g.
+                   tput -T450 lines and tput -T2621 xmc)
+       1           no error message is printed, see the EXIT CODES section.
+       2           usage error
+       3           unknown terminal type or no terminfo database
+       4           unknown terminfo capability capname
+       >4          error occurred in -S
+       ---------------------------------------------------------------------
+
+
+
+

PORTABILITY

+       The longname and -S options, and  the  parameter-substitu-
+       tion  features  used in the cup example, are not supported
+       in BSD curses or in AT&T/USL curses before SVr4.
+
+       X/Open documents only the operands  for  clear,  init  and
+       reset.   In this implementation, clear is part of the cap-
+       name support.  Other implementations of tput on SVr4-based
+       systems such as Solaris, IRIX64 and HPUX as well as others
+       such  as  AIX  and  Tru64  provide  support  for   capname
+       operands.  A few platforms such as FreeBSD and NetBSD rec-
+       ognize termcap names rather than terminfo capability names
+       in their respective tput commands.
+
+
+
+

SEE ALSO

+       clear(1), stty(1), tabs(1), terminfo(5).
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                                tput(1)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html new file mode 100644 index 00000000000..fe3d63ffb59 --- /dev/null +++ b/doc/html/man/tset.1.html @@ -0,0 +1,334 @@ + + + + +tset 1 + + + + +

tset 1

+
+
+
+tset(1)                                                         tset(1)
+
+
+
+
+
+

NAME

+       tset, reset - terminal initialization
+
+
+
+

SYNOPSIS

+       tset  [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping]
+       [terminal]
+       reset [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping]
+       [terminal]
+
+
+
+

DESCRIPTION

+       Tset  initializes  terminals.   Tset  first determines the
+       type of terminal that you are using.   This  determination
+       is done as follows, using the first terminal type found.
+
+       1. The terminal argument specified on the command line.
+
+       2. The value of the TERM environmental variable.
+
+       3.  (BSD  systems only.) The terminal type associated with
+       the standard error output device in  the  /etc/ttys  file.
+       (On  System-V-like  UNIXes  and systems using that conven-
+       tion, getty does this job by setting TERM according to the
+       type passed to it by /etc/inittab.)
+
+       4. The default terminal type, ``unknown''.
+
+       If  the  terminal  type  was not specified on the command-
+       line, the -m option mappings are  then  applied  (see  the
+       section  TERMINAL  TYPE  MAPPING  for  more  information).
+       Then, if the terminal type begins  with  a  question  mark
+       (``?''), the user is prompted for confirmation of the ter-
+       minal type.  An empty  response  confirms  the  type,  or,
+       another  type  can be entered to specify a new type.  Once
+       the terminal type has been determined, the terminfo  entry
+       for  the  terminal  is retrieved.  If no terminfo entry is
+       found for the type, the user is prompted for another  ter-
+       minal type.
+
+       Once  the  terminfo  entry  is retrieved, the window size,
+       backspace, interrupt and line kill characters (among  many
+       other things) are set and the terminal and tab initializa-
+       tion strings  are  sent  to  the  standard  error  output.
+       Finally,  if the erase, interrupt and line kill characters
+       have changed, or are not  set  to  their  default  values,
+       their  values  are displayed to the standard error output.
+       Use the -c or -w option to select only the  window  sizing
+       versus  the  other  initialization.   If neither option is
+       given, both are assumed.
+
+       When invoked as reset, tset sets cooked  and  echo  modes,
+       turns  off cbreak and raw modes, turns on newline transla-
+       tion and resets any  unset  special  characters  to  their
+       default  values  before  doing the terminal initialization
+       described above.  This is  useful  after  a  program  dies
+       leaving  a  terminal  in an abnormal state.  Note, you may
+       have to type
+
+           <LF>reset<LF>
+
+       (the line-feed character is normally control-J) to get the
+       terminal to work, as carriage-return may no longer work in
+       the abnormal state.  Also, the  terminal  will  often  not
+       echo the command.
+
+       The options are as follows:
+
+       -c   Set  control  characters and modes.  -e Set the erase
+            character to ch.
+
+       -I   Do  not  send  the  terminal  or  tab  initialization
+            strings to the terminal.
+
+       -i   Set the interrupt character to ch.
+
+       -k   Set the line kill character to ch.
+
+       -m   Specify  a  mapping  from  a port type to a terminal.
+            See the section TERMINAL TYPE MAPPING for more infor-
+            mation.
+
+       -Q   Do  not  display  any values for the erase, interrupt
+            and line kill characters.  Normally tset displays the
+            values  for  control characters which differ from the
+            system's default values.
+
+       -q   The terminal type is displayed to the  standard  out-
+            put,  and the terminal is not initialized in any way.
+            The option `-' by itself is equivalent but archaic.
+
+       -r   Print the terminal type to the standard error output.
+
+       -s   Print  the  sequence  of shell commands to initialize
+            the environment variable TERM to the standard output.
+            See  the section SETTING THE ENVIRONMENT for details.
+
+       -V   reports the version of ncurses which was used in this
+            program, and exits.
+
+       -w   Resize  the  window  to  match  the  size deduced via
+            setupterm.   Normally  this  has  no  effect,  unless
+            setupterm is not able to detect the window size.
+
+       The arguments for the -e, -i, and -k options may either be
+       entered as actual characters or by using the  `hat'  nota-
+       tion,  i.e.,  control-h  may  be  specified  as  ``^H'' or
+       ``^h''.
+
+
+
+

SETTING THE ENVIRONMENT

+       It is often desirable  to  enter  the  terminal  type  and
+       information  about  the  terminal's  capabilities into the
+       shell's environment.  This is done using the -s option.
+
+       When the -s option is specified, the commands to enter the
+       information  into  the  shell's environment are written to
+       the standard output.  If the SHELL environmental  variable
+       ends in ``csh'', the commands are for csh, otherwise, they
+       are for sh.  Note, the csh  commands  set  and  unset  the
+       shell  variable  noglob,  leaving it unset.  The following
+       line in the .login or .profile files will  initialize  the
+       environment correctly:
+
+           eval `tset -s options ... `
+
+
+
+

TERMINAL TYPE MAPPING

+       When the terminal is not hardwired into the system (or the
+       current system information is incorrect) the terminal type
+       derived  from the /etc/ttys file or the TERM environmental
+       variable is often something generic like network,  dialup,
+       or  unknown.   When tset is used in a startup script it is
+       often desirable to provide information about the  type  of
+       terminal used on such ports.
+
+       The  purpose  of  the -m option is to map from some set of
+       conditions to a terminal type, that is, to tell tset  ``If
+       I'm  on this port at a particular speed, guess that I'm on
+       that kind of terminal''.
+
+       The argument to the -m option consists of an optional port
+       type, an optional operator, an optional baud rate specifi-
+       cation, an optional colon (``:'') character and a terminal
+       type.   The port type is a string (delimited by either the
+       operator or the colon character).  The operator may be any
+       combination of ``>'', ``<'', ``@'', and ``!''; ``>'' means
+       greater than, ``<'' means less than, ``@'' means equal  to
+       and ``!'' inverts the sense of the test.  The baud rate is
+       specified as a number and is compared with  the  speed  of
+       the  standard  error  output  (which should be the control
+       terminal).  The terminal type is a string.
+
+       If the terminal type is not specified on the command line,
+       the  -m mappings are applied to the terminal type.  If the
+       port type and baud rate match the  mapping,  the  terminal
+       type  specified  in the mapping replaces the current type.
+       If more than one mapping is specified, the first  applica-
+       ble mapping is used.
+
+       For    example,    consider    the    following   mapping:
+       dialup>9600:vt100.  The port type is dialup , the operator
+       is  >, the baud rate specification is 9600, and the termi-
+       nal type is vt100.  The result of this mapping is to spec-
+       ify that if the terminal type is dialup, and the baud rate
+       is greater than 9600 baud, a terminal type of  vt100  will
+       be used.
+
+       If no baud rate is specified, the terminal type will match
+       any baud rate.  If no port type is specified, the terminal
+       type   will   match   any  port  type.   For  example,  -m
+       dialup:vt100  -m  :?xterm  will  cause  any  dialup  port,
+       regardless of baud rate, to match the terminal type vt100,
+       and any non-dialup port type to match  the  terminal  type
+       ?xterm.   Note,  because of the leading question mark, the
+       user will be queried on a default port as to whether  they
+       are actually using an xterm terminal.
+
+       No  whitespace  characters  are permitted in the -m option
+       argument.  Also, to avoid problems  with  meta-characters,
+       it  is  suggested  that  the  entire -m option argument be
+       placed within single quote characters, and that csh  users
+       insert  a  backslash character (``\'') before any exclama-
+       tion marks (``!'').
+
+
+
+

HISTORY

+       The tset command appeared in BSD 3.0.  The ncurses  imple-
+       mentation  was lightly adapted from the 4.4BSD sources for
+       a terminfo environment by Eric S. Raymond <esr@snark.thyr-
+       sus.com>.
+
+
+
+

COMPATIBILITY

+       The  tset  utility has been provided for backward-compati-
+       bility with BSD environments (under  most  modern  UNIXes,
+       /etc/inittab  and  getty(1) can set TERM appropriately for
+       each dial-up line; this  obviates  what  was  tset's  most
+       important  use).   This implementation behaves like 4.4BSD
+       tset, with a few exceptions specified here.
+
+       The -S option of BSD tset no longer works;  it  prints  an
+       error message to stderr and dies.  The -s option only sets
+       TERM, not TERMCAP.  Both these  changes  are  because  the
+       TERMCAP  variable  is  no longer supported under terminfo-
+       based ncurses, which makes tset -S useless (we made it die
+       noisily rather than silently induce lossage).
+
+       There  was  an  undocumented  4.4BSD feature that invoking
+       tset via a link named `TSET` (or via any other name begin-
+       ning  with  an  upper-case letter) set the terminal to use
+       upper-case only.  This feature has been omitted.
+
+       The -A, -E, -h, -u and -v options were  deleted  from  the
+       tset  utility  in 4.4BSD.  None of them were documented in
+       4.3BSD and all are of limited utility at  best.   The  -a,
+       -d, and -p options are similarly not documented or useful,
+       but were retained as they appear to be in widespread  use.
+       It  is  strongly recommended that any usage of these three
+       options be changed to use the -m option instead.   The  -n
+       option  remains, but has no effect.  The -adnp options are
+       therefore omitted from the usage summary above.
+
+       It is still permissible to specify  the  -e,  -i,  and  -k
+       options  without arguments, although it is strongly recom-
+       mended that such usage be fixed to explicitly specify  the
+       character.
+
+       As  of  4.4BSD,  executing tset as reset no longer implies
+       the -Q option.  Also, the interaction between the - option
+       and the terminal argument in some historic implementations
+       of tset has been removed.
+
+
+
+

ENVIRONMENT

+       The tset command uses these environment variables:
+
+       SHELL
+            tells tset whether to initialize TERM using sh or csh
+            syntax.
+
+       TERM Denotes  your  terminal  type.  Each terminal type is
+            distinct, though many are similar.
+
+       TERMCAP
+            may denote the location of a termcap database.  If it
+            is not an absolute pathname, e.g., begins with a `/',
+            tset removes the variable from the environment before
+            looking for the terminal description.
+
+
+
+

FILES

+       /etc/ttys
+            system  port  name  to terminal type mapping database
+            (BSD versions only).
+
+       /usr/share/terminfo
+            terminal capability database
+
+
+
+

SEE ALSO

+       csh(1), sh(1), stty(1),  curs_terminfo(3x),  tty(4),  ter-
+       minfo(5), ttys(5), environ(7)
+
+       This describes ncurses version 5.8 (patch 20110226).
+
+
+
+                                                                tset(1)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/man/wresize.3x.html b/doc/html/man/wresize.3x.html new file mode 100644 index 00000000000..dff5834db79 --- /dev/null +++ b/doc/html/man/wresize.3x.html @@ -0,0 +1,108 @@ + + + + +wresize 3x + + + + +

wresize 3x

+
+
+
+wresize(3x)                                                 wresize(3x)
+
+
+
+
+
+

NAME

+       wresize - resize a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int wresize(WINDOW *win, int lines, int columns);
+
+
+
+

DESCRIPTION

+       This  is  an  extension to the curses library.  It reallo-
+       cates storage for an ncurses window to adjust  its  dimen-
+       sions  to  the  specified  values.  If either dimension is
+       larger than the  current  values,  the  window's  data  is
+       filled with blanks that have the current background rendi-
+       tion (as set by wbkgdset) merged into them.
+
+
+
+

RETURN VALUE

+       The function returns the integer ERR upon failure  and  OK
+       on success.  It will fail if either of the dimensions less
+       than or equal  to  zero,  or  if  an  error  occurs  while
+       (re)allocating memory for the window.
+
+
+
+

NOTES

+       The only restriction placed on the dimensions is that they
+       be greater than zero.  The dimensions are not compared  to
+       curses   screen   dimensions  to  simplify  the  logic  of
+       resizeterm.  The caller  must  ensure  that  the  window's
+       dimensions fit within the actual screen dimensions.
+
+
+
+

SEE ALSO

+       resizeterm(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey (from an equivalent function written in 1988
+       for BSD curses).
+
+
+
+                                                            wresize(3x)
+
+
+
+Man(1) output converted with +man2html +
+ + diff --git a/doc/html/ncurses-intro.html b/doc/html/ncurses-intro.html index 451e7ab4d32..fc529f293e2 100644 --- a/doc/html/ncurses-intro.html +++ b/doc/html/ncurses-intro.html @@ -1,8 +1,8 @@ - + term.h and comp_captab.c disagree about the <--\n"); - printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); - printf("#endif\n\n"); - - free(hash_table); - return EXIT_SUCCESS; + return ptr; } -#endif diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 3325a0ddae6..8204d75a819 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -51,9 +51,8 @@ #include #include -#include -MODULE_ID("$Id: comp_parse.c,v 1.69 2008/08/16 21:58:16 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -92,16 +91,18 @@ force_bar(char *dst, char *src) } return src; } +#define ForceBar(dst, src) ((strchr(src, '|') == 0) ? force_bar(dst, src) : src) NCURSES_EXPORT(bool) _nc_entry_match(char *n1, char *n2) /* do any of the aliases in a pair of terminal names match? */ { char *pstart, *qstart, *pend, *qend; - char nc1[MAX_NAME_SIZE + 2], nc2[MAX_NAME_SIZE + 2]; + char nc1[MAX_NAME_SIZE + 2]; + char nc2[MAX_NAME_SIZE + 2]; - n1 = force_bar(nc1, n1); - n2 = force_bar(nc2, n2); + n1 = ForceBar(nc1, n1); + n2 = ForceBar(nc2, n2); for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) @@ -273,7 +274,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) unresolved++; total_unresolved++; - _nc_curr_line = lookline; + _nc_curr_line = (int) lookline; _nc_warning("resolution of use=%s failed", lookfor); qp->uses[i].link = 0; } @@ -375,7 +376,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) if (_nc_check_termtype != 0) { _nc_curr_col = -1; for_entry_list(qp) { - _nc_curr_line = qp->startline; + _nc_curr_line = (int) qp->startline; _nc_set_type(_nc_first_name(qp->tterm.term_names)); _nc_check_termtype2(&qp->tterm, literal); } @@ -473,7 +474,6 @@ _nc_leaks_tic(void) { _nc_alloc_entry_leaks(); _nc_captoinfo_leaks(); - _nc_comp_captab_leaks(); _nc_comp_scan_leaks(); #if BROKEN_LINKER || USE_REENTRANT _nc_names_leaks(); diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 5ad750f930d..8725b2edb7e 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,10 +48,9 @@ #include #include -#include #include -MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -61,19 +60,13 @@ MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") #define iswhite(ch) (ch == ' ' || ch == '\t') -NCURSES_EXPORT_VAR(int) -_nc_syntax = 0; /* termcap or terminfo? */ -NCURSES_EXPORT_VAR(long) -_nc_curr_file_pos = 0; /* file offset of current line */ -NCURSES_EXPORT_VAR(long) -_nc_comment_start = 0; /* start of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_comment_end = 0; /* end of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_start_line = 0; /* start line of current entry */ +NCURSES_EXPORT_VAR (int) _nc_syntax = 0; /* termcap or terminfo? */ +NCURSES_EXPORT_VAR (long) _nc_curr_file_pos = 0; /* file offset of current line */ +NCURSES_EXPORT_VAR (long) _nc_comment_start = 0; /* start of comment range before name */ +NCURSES_EXPORT_VAR (long) _nc_comment_end = 0; /* end of comment range before name */ +NCURSES_EXPORT_VAR (long) _nc_start_line = 0; /* start line of current entry */ -NCURSES_EXPORT_VAR(struct token) -_nc_curr_token = +NCURSES_EXPORT_VAR (struct token) _nc_curr_token = { 0, 0, 0 }; @@ -91,8 +84,7 @@ static int pushtype; /* type of pushback token */ static char *pushname; #if NCURSES_EXT_FUNCS -NCURSES_EXPORT_VAR(bool) -_nc_disable_period = FALSE; /* used by tic -a option */ +NCURSES_EXPORT_VAR (bool) _nc_disable_period = FALSE; /* used by tic -a option */ #endif /***************************************************************************** @@ -211,6 +203,10 @@ next_char(void) if (fgets(result + used, (int) (allocated - used), yyin) != 0) { bufstart = result; if (used == 0) { + if (_nc_curr_line == 0 + && IS_TIC_MAGIC(result)) { + _nc_err_abort("This is a compiled terminal description, not a source"); + } _nc_curr_line++; _nc_curr_col = 0; } @@ -431,7 +427,7 @@ _nc_get_token(bool silent) && !strchr(terminfo_punct, (char) ch)) { if (!silent) _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'", - terminfo_punct, unctrl((chtype) ch)); + terminfo_punct, unctrl(UChar(ch))); _nc_panic_mode(separator); goto start_token; } @@ -487,7 +483,6 @@ _nc_get_token(bool silent) if (OkToAdd()) { AddCh(ch); } else { - ch = EOF; break; } } @@ -596,7 +591,7 @@ _nc_get_token(bool silent) case '@': if ((ch = next_char()) != separator && !silent) _nc_warning("Missing separator after `%s', have %s", - tok_buf, unctrl((chtype) ch)); + tok_buf, unctrl(UChar(ch))); _nc_curr_token.tk_name = tok_buf; type = CANCEL; break; @@ -617,7 +612,7 @@ _nc_get_token(bool silent) _nc_warning("Missing separator"); } _nc_curr_token.tk_name = tok_buf; - _nc_curr_token.tk_valnumber = number; + _nc_curr_token.tk_valnumber = (int) number; type = NUMBER; break; @@ -637,7 +632,7 @@ _nc_get_token(bool silent) /* just to get rid of the compiler warning */ type = UNDEF; if (!silent) - _nc_warning("Illegal character - '%s'", unctrl((chtype) ch)); + _nc_warning("Illegal character - '%s'", unctrl(UChar(ch))); } } /* end else (first_column == FALSE) */ } /* end else (ch != EOF) */ @@ -730,48 +725,47 @@ _nc_trans_string(char *ptr, char *last) int count = 0; int number = 0; int i, c; - chtype ch, last_ch = '\0'; + int last_ch = '\0'; bool ignored = FALSE; bool long_warning = FALSE; - while ((ch = c = next_char()) != (chtype) separator && c != EOF) { + while ((c = next_char()) != separator && c != EOF) { if (ptr >= (last - 1)) { if (c != EOF) { while ((c = next_char()) != separator && c != EOF) { ; } - ch = c; } break; } if ((_nc_syntax == SYN_TERMCAP) && c == '\n') break; - if (ch == '^' && last_ch != '%') { - ch = c = next_char(); + if (c == '^' && last_ch != '%') { + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (!(is7bits(ch) && isprint(ch))) { - _nc_warning("Illegal ^ character - '%s'", unctrl(ch)); + if (!(is7bits(c) && isprint(c))) { + _nc_warning("Illegal ^ character - '%s'", unctrl(UChar(c))); } - if (ch == '?') { + if (c == '?') { *(ptr++) = '\177'; if (_nc_tracing) _nc_warning("Allow ^? as synonym for \\177"); } else { - if ((ch &= 037) == 0) - ch = 128; - *(ptr++) = (char) (ch); + if ((c &= 037) == 0) + c = 128; + *(ptr++) = (char) (c); } - } else if (ch == '\\') { - ch = c = next_char(); + } else if (c == '\\') { + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (ch >= '0' && ch <= '7') { - number = ch - '0'; + if (c >= '0' && c <= '7') { + number = c - '0'; for (i = 0; i < 2; i++) { - ch = c = next_char(); + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); @@ -848,31 +842,31 @@ _nc_trans_string(char *ptr, char *last) default: _nc_warning("Illegal character '%s' in \\ sequence", - unctrl(ch)); + unctrl(UChar(c))); /* FALLTHRU */ case '|': - *(ptr++) = (char) ch; - } /* endswitch (ch) */ - } /* endelse (ch < '0' || ch > '7') */ + *(ptr++) = (char) c; + } /* endswitch (c) */ + } /* endelse (c < '0' || c > '7') */ } - /* end else if (ch == '\\') */ - else if (ch == '\n' && (_nc_syntax == SYN_TERMINFO)) { + /* end else if (c == '\\') */ + else if (c == '\n' && (_nc_syntax == SYN_TERMINFO)) { /* * Newlines embedded in a terminfo string are ignored, provided * that the next line begins with whitespace. */ ignored = TRUE; } else { - *(ptr++) = (char) ch; + *(ptr++) = (char) c; } if (!ignored) { if (_nc_curr_col <= 1) { - push_back((char) ch); - ch = '\n'; + push_back((char) c); + c = '\n'; break; } - last_ch = ch; + last_ch = c; count++; } ignored = FALSE; @@ -885,7 +879,7 @@ _nc_trans_string(char *ptr, char *last) *ptr = '\0'; - return (ch); + return (c); } /* diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c index fdc2bb09ead..82665cb54be 100644 --- a/ncurses/tinfo/db_iterator.c +++ b/ncurses/tinfo/db_iterator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2006-2007,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 * @@ -38,7 +38,7 @@ #include -MODULE_ID("$Id: db_iterator.c,v 1.6 2007/04/22 00:00:26 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.9 2010/12/25 23:00:25 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -104,7 +104,7 @@ next_list_item(const char *source, int *offset) if (source != 0) { FreeIfNeeded(ThisDbList); ThisDbList = strdup(source); - ThisDbSize = strlen(source); + ThisDbSize = (int) strlen(source); } if (ThisDbList != 0 && ThisDbSize && *offset < ThisDbSize) { @@ -118,11 +118,10 @@ next_list_item(const char *source, int *offset) * again, using the data at the offset. */ if (marker == 0) { - *offset += strlen(result) + 1; - marker = result + *offset; + *offset += (int) strlen(result); } else { *marker++ = 0; - *offset = marker - ThisDbList; + *offset = (int) (marker - ThisDbList); } if (*result == 0 && result != (ThisDbList + ThisDbSize)) result = system_db; diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c index cf2a8337b87..b1e14a803f3 100644 --- a/ncurses/tinfo/entries.c +++ b/ncurses/tinfo/entries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2006-2009,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 * @@ -28,6 +28,7 @@ /**************************************************************************** * Author: Thomas E. Dickey * + * and: Juergen Pfeifer * ****************************************************************************/ #include @@ -35,9 +36,8 @@ #include #include -#include -MODULE_ID("$Id: entries.c,v 1.8 2008/09/27 13:11:10 tom Exp $") +MODULE_ID("$Id: entries.c,v 1.17 2010/01/23 17:57:43 tom Exp $") /**************************************************************************** * @@ -119,6 +119,12 @@ _nc_leaks_tinfo(void) #if NO_LEAKS _nc_free_tparm(); _nc_tgetent_leaks(); + + if (TerminalOf(CURRENT_SCREEN) != 0) { + del_curterm(TerminalOf(CURRENT_SCREEN)); + } + + _nc_comp_captab_leaks(); _nc_free_entries(_nc_head); _nc_get_type(0); _nc_first_name(0); @@ -131,6 +137,12 @@ _nc_leaks_tinfo(void) if ((s = _nc_home_terminfo()) != 0) free(s); + +#ifdef TRACE + trace(0); + _nc_trace_buf(-1, 0); +#endif + #endif /* NO_LEAKS */ returnVoid; } diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c index fa0fff1b83f..ad056ba4545 100644 --- a/ncurses/tinfo/free_ttype.c +++ b/ncurses/tinfo/free_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1999-2010,2011 Free 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,9 +41,8 @@ #include #include -#include -MODULE_ID("$Id: free_ttype.c,v 1.13 2006/06/25 10:46:02 tom Exp $") +MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $") NCURSES_EXPORT(void) _nc_free_termtype(TERMTYPE *ptr) @@ -70,6 +69,7 @@ use_extended_names(bool flag) { int oldflag = _nc_user_definable; + START_TRACE(); T((T_CALLED("use_extended_names(%d)"), flag)); _nc_user_definable = flag; returnBool(oldflag); diff --git a/ncurses/tinfo/hashed_db.c b/ncurses/tinfo/hashed_db.c index 3fc04eae3cc..bf7a968ee96 100644 --- a/ncurses/tinfo/hashed_db.c +++ b/ncurses/tinfo/hashed_db.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2006 * + * Author: Thomas E. Dickey 2006-on * ****************************************************************************/ #include @@ -36,7 +36,7 @@ #if USE_HASHED_DB -MODULE_ID("$Id: hashed_db.c,v 1.13 2006/08/19 19:48:38 tom Exp $") +MODULE_ID("$Id: hashed_db.c,v 1.14 2008/12/13 20:59:02 tom Exp $") #if HASHED_DB_API >= 2 static DBC *cursor; @@ -49,27 +49,30 @@ NCURSES_EXPORT(DB *) _nc_db_open(const char *path, bool modify) { DB *result = 0; + int code; #if HASHED_DB_API >= 4 db_create(&result, NULL, 0); - result->open(result, - NULL, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644); + if ((code = result->open(result, + NULL, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644)) != 0) { + result = 0; + } #elif HASHED_DB_API >= 3 db_create(&result, NULL, 0); - result->open(result, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644); + if ((code = result->open(result, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644)) != 0) { + result = 0; + } #elif HASHED_DB_API >= 2 - int code; - if ((code = db_open(path, DB_HASH, modify ? DB_CREATE : DB_RDONLY, @@ -77,21 +80,22 @@ _nc_db_open(const char *path, bool modify) (DB_ENV *) 0, (DB_INFO *) 0, &result)) != 0) { - T(("cannot open %s: %s", path, strerror(code))); result = 0; - } else { - T(("opened %s", path)); } #else - result = dbopen(path, - modify ? (O_CREAT | O_RDWR) : O_RDONLY, - 0644, - DB_HASH, - NULL); - if (result != 0) { - T(("opened %s", path)); + if ((result = dbopen(path, + modify ? (O_CREAT | O_RDWR) : O_RDONLY, + 0644, + DB_HASH, + NULL)) == 0) { + code = errno; } #endif + if (result != 0) { + T(("opened %s", path)); + } else { + T(("cannot open %s: %s", path, strerror(code))); + } return result; } diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c index 4521c4a8da6..69d69f95bf7 100644 --- a/ncurses/tinfo/home_terminfo.c +++ b/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: home_terminfo.c,v 1.11 2008/08/03 23:43:11 tom Exp $") +MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $") /* ncurses extension...fall back on user's private directory */ @@ -53,7 +53,7 @@ _nc_home_terminfo(void) if (use_terminfo_vars()) { if (MyBuffer == 0) { if ((home = getenv("HOME")) != 0) { - unsigned want = (strlen(home) + sizeof(PRIVATE_INFO)); + size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); MyBuffer = typeMalloc(char, want); if (MyBuffer == 0) _nc_err_abort(MSG_NO_MEMORY); diff --git a/ncurses/tinfo/init_keytry.c b/ncurses/tinfo/init_keytry.c index 2f6fe4f6fad..ea47b382b49 100644 --- a/ncurses/tinfo/init_keytry.c +++ b/ncurses/tinfo/init_keytry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2009,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 * @@ -27,16 +27,9 @@ ****************************************************************************/ #include - -#include -/* keypad_xmit, keypad_local, meta_on, meta_off */ -/* cursor_visible,cursor_normal,cursor_invisible */ - #include /* struct tinfo_fkeys */ -#include - -MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") +MODULE_ID("$Id: init_keytry.c,v 1.17 2010/04/24 22:29:56 tom Exp $") /* ** _nc_init_keytry() @@ -50,7 +43,7 @@ MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") * than cur_term. */ #undef CUR -#define CUR (sp->_term)->type. +#define CUR SP_TERMTYPE #if BROKEN_LINKER #undef _nc_tinfo_fkeys @@ -73,7 +66,7 @@ _nc_tinfo_fkeysf(void) NCURSES_EXPORT(void) _nc_init_keytry(SCREEN *sp) { - size_t n; + unsigned n; /* The sp->_keytry value is initialized in newterm(), where the sp * structure is created, because we can not tell where keypad() or @@ -97,12 +90,13 @@ _nc_init_keytry(SCREEN *sp) { TERMTYPE *tp = &(sp->_term->type); for (n = STRCOUNT; n < NUM_STRINGS(tp); ++n) { - const char *name = ExtStrname(tp, n, strnames); + const char *name = ExtStrname(tp, (int) n, strnames); char *value = tp->Strings[n]; if (name != 0 && *name == 'k' && value != 0 - && key_defined(value) == 0) { + && NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx + value) == 0) { (void) _nc_add_to_try(&(sp->_keytry), value, n - STRCOUNT + KEY_MAX); diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index 919e47287a7..d8fdedca843 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,17 +30,21 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ #include -#include /* ena_acs, acs_chars */ -MODULE_ID("$Id: lib_acs.c,v 1.36 2008/08/16 19:22:55 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_acs.c,v 1.43 2010/12/25 23:00:45 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map -NCURSES_EXPORT_VAR(chtype *) -_nc_acs_map(void) +NCURSES_EXPORT(chtype *) +NCURSES_PUBLIC_VAR(acs_map) (void) { if (MyBuffer == 0) MyBuffer = typeCalloc(chtype, ACS_LEN); @@ -48,17 +52,35 @@ _nc_acs_map(void) } #undef MyBuffer #else -NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = +NCURSES_EXPORT_VAR (chtype) acs_map[ACS_LEN] = { 0 }; #endif +#ifdef USE_TERM_DRIVER +NCURSES_EXPORT(chtype) +NCURSES_SP_NAME(_nc_acs_char) (NCURSES_SP_DCLx int c) +{ + chtype *map; + if (c < 0 || c >= ACS_LEN) + return (chtype) 0; + map = (SP_PARM != 0) ? SP_PARM->_acs_map : +#if BROKEN_LINKER || USE_REENTRANT + _nc_prescreen.real_acs_map +#else + acs_map +#endif + ; + return map[c]; +} +#endif /* USE_TERM_DRIVER */ + NCURSES_EXPORT(void) -_nc_init_acs(void) +NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) { chtype *fake_map = acs_map; - chtype *real_map = SP != 0 ? SP->_acs_map : fake_map; + chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map; int j; T(("initializing ACS map")); @@ -71,9 +93,9 @@ _nc_init_acs(void) if (real_map != fake_map) { for (j = 1; j < ACS_LEN; ++j) { real_map[j] = 0; - fake_map[j] = A_ALTCHARSET | j; - if (SP) - SP->_screen_acs_map[j] = FALSE; + fake_map[j] = A_ALTCHARSET | (chtype) j; + if (SP_PARM) + SP_PARM->_screen_acs_map[j] = FALSE; } } else { for (j = 1; j < ACS_LEN; ++j) { @@ -118,7 +140,34 @@ _nc_init_acs(void) real_map['{'] = '*'; /* should be greek pi */ real_map['|'] = '!'; /* should be not-equal */ real_map['}'] = 'f'; /* should be pound-sterling symbol */ + /* thick-line-drawing */ + real_map['L'] = '+'; /* upper left corner */ + real_map['M'] = '+'; /* lower left corner */ + real_map['K'] = '+'; /* upper right corner */ + real_map['J'] = '+'; /* lower right corner */ + real_map['T'] = '+'; /* tee pointing left */ + real_map['U'] = '+'; /* tee pointing right */ + real_map['V'] = '+'; /* tee pointing up */ + real_map['W'] = '+'; /* tee pointing down */ + real_map['Q'] = '-'; /* horizontal line */ + real_map['X'] = '|'; /* vertical line */ + real_map['N'] = '+'; /* large plus or crossover */ + /* double-line-drawing */ + real_map['C'] = '+'; /* upper left corner */ + real_map['D'] = '+'; /* lower left corner */ + real_map['B'] = '+'; /* upper right corner */ + real_map['A'] = '+'; /* lower right corner */ + real_map['G'] = '+'; /* tee pointing left */ + real_map['F'] = '+'; /* tee pointing right */ + real_map['H'] = '+'; /* tee pointing up */ + real_map['I'] = '+'; /* tee pointing down */ + real_map['R'] = '-'; /* horizontal line */ + real_map['Y'] = '|'; /* vertical line */ + real_map['E'] = '+'; /* large plus or crossover */ +#ifdef USE_TERM_DRIVER + CallDriver_2(SP_PARM, initacs, real_map, fake_map); +#else if (ena_acs != NULL) { TPUTS_TRACE("ena_acs"); putp(ena_acs); @@ -140,7 +189,7 @@ _nc_init_acs(void) size_t i; for (i = 1; i < ACS_LEN; ++i) { if (real_map[i] == 0) { - real_map[i] = i; + real_map[i] = (chtype) i; if (real_map != fake_map) { if (SP != 0) SP->_screen_acs_map[i] = TRUE; @@ -191,4 +240,13 @@ _nc_init_acs(void) _nc_unlock_global(tracef); } #endif /* TRACE */ +#endif } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_init_acs(void) +{ + NCURSES_SP_NAME(_nc_init_acs) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index b9cdfda9acc..9302f022b89 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -38,7 +38,6 @@ */ #include -#include /* cur_term, pad_char */ #include /* ospeed */ #if defined(__FreeBSD__) #include @@ -80,7 +79,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.27 2008/06/28 15:19:24 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.31 2010/12/19 01:50:50 tom Exp $") /* * int @@ -195,11 +194,11 @@ _nc_ospeed(int BaudRate) } NCURSES_EXPORT(int) -baudrate(void) +NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) { int result; - T((T_CALLED("baudrate()"))); + T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); /* * In debugging, allow the environment symbol to override when we're @@ -207,32 +206,41 @@ baudrate(void) * that take into account costs that depend on baudrate. */ #ifdef TRACE - if (!isatty(fileno(SP ? SP->_ofp : stdout)) + if (IsValidTIScreen(SP_PARM) + && !isatty(fileno(SP_PARM ? SP_PARM->_ofp : stdout)) && getenv("BAUDRATE") != 0) { int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; - ospeed = _nc_ospeed(ret); + ospeed = (NCURSES_OSPEED) _nc_ospeed(ret); returnCode(ret); } #endif - if (cur_term != 0) { + if (IsValidTIScreen(SP_PARM)) { #ifdef USE_OLD_TTY - result = cfgetospeed(&cur_term->Nttyb); + result = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); ospeed = _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS - ospeed = cfgetospeed(&cur_term->Nttyb); + ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); #else - ospeed = cur_term->Nttyb.sg_ospeed; + ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif - cur_term->_baudrate = result; + TerminalOf(SP_PARM)->_baudrate = result; } else { result = ERR; } returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +baudrate(void) +{ + return NCURSES_SP_NAME(baudrate) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 626578d5c08..86e130e7852 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -37,69 +37,141 @@ */ #include -#include /* TTY, cur_term */ #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.18 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.30 2010/12/19 01:38:45 tom Exp $") #undef CUR #define CUR termp->type. -#if BROKEN_LINKER || USE_REENTRANT +#if BROKEN_LINKER && !USE_REENTRANT +NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; +#elif BROKEN_LINKER || USE_REENTRANT + +NCURSES_EXPORT(TERMINAL *) +NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_DCL0) +{ + return ((0 != TerminalOf(SP_PARM)) ? TerminalOf(SP_PARM) : CurTerm); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(TERMINAL *) +_nc_get_cur_term(void) +{ + return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(TERMINAL *) NCURSES_PUBLIC_VAR(cur_term) (void) { - return (SP != 0 && SP->_term != 0) ? SP->_term : _nc_prescreen._cur_term; +#if NCURSES_SP_FUNCS + return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); +#else + return NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG); +#endif } + #else NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; #endif NCURSES_EXPORT(TERMINAL *) -set_curterm(TERMINAL * termp) +NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) { TERMINAL *oldterm; - T((T_CALLED("set_curterm(%p)"), termp)); + T((T_CALLED("set_curterm(%p)"), (void *) termp)); _nc_lock_global(curses); oldterm = cur_term; - if (SP) - SP->_term = termp; -#if BROKEN_LINKER || USE_REENTRANT - _nc_prescreen._cur_term = termp; -#else + if (SP_PARM) + SP_PARM->_term = termp; +#if BROKEN_LINKER && !USE_REENTRANT cur_term = termp; +#else + CurTerm = termp; #endif if (termp != 0) { - ospeed = _nc_ospeed(termp->_baudrate); +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); + if (TCB->drv->isTerminfo && termp->type.Strings) { + PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); + } + TCB->csp = SP_PARM; +#else + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } +#endif } _nc_unlock_global(curses); - T((T_RETURN("%p"), oldterm)); + T((T_RETURN("%p"), (void *) oldterm)); return (oldterm); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(TERMINAL *) +set_curterm(TERMINAL * termp) +{ + return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) +{ + int rc = ERR; + + T((T_CALLED("del_curterm(%p, %p)"), (void *) SP_PARM, (void *) termp)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; +#endif + TERMINAL *cur = ( +#if BROKEN_LINKER && !USE_REENTRANT + cur_term +#elif BROKEN_LINKER || USE_REENTRANT + NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG) +#else + cur_term +#endif + ); + + _nc_free_termtype(&(termp->type)); + if (termp == cur) + NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0); + + FreeIfNeeded(termp->_termname); +#if USE_HOME_TERMINFO + if (_nc_globals.home_terminfo != 0) + FreeAndNull(_nc_globals.home_terminfo); +#endif +#ifdef USE_TERM_DRIVER + if (TCB->drv) + TCB->drv->release(TCB); +#endif + free(termp); + + rc = OK; + } + returnCode(rc); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) del_curterm(TERMINAL * termp) { int rc = ERR; - T((T_CALLED("del_curterm(%p)"), termp)); - _nc_lock_global(curses); - if (termp != 0) { - _nc_free_termtype(&(termp->type)); - FreeIfNeeded(termp->_termname); - free(termp); - if (termp == cur_term) - set_curterm(0); - rc = OK; - } + rc = NCURSES_SP_NAME(del_curterm) (CURRENT_SCREEN, termp); _nc_unlock_global(curses); - returnCode(rc); + return (rc); } +#endif diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index e84209d4022..195ddf978ab 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -41,7 +42,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.61 2010/05/15 22:06:56 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -51,17 +52,17 @@ MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(stdscr) (void) { - return SP ? SP->_stdscr : 0; + return CURRENT_SCREEN ? StdScreen(CURRENT_SCREEN) : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(curscr) (void) { - return SP ? SP->_curscr : 0; + return CURRENT_SCREEN ? CurScreen(CURRENT_SCREEN) : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(newscr) (void) { - return SP ? SP->_newscr : 0; + return CURRENT_SCREEN ? NewScreen(CURRENT_SCREEN) : 0; } #else NCURSES_EXPORT_VAR(WINDOW *) stdscr = 0; @@ -93,7 +94,7 @@ _nc_screen(void) NCURSES_EXPORT(int) _nc_alloc_screen(void) { - return ((my_screen = typeCalloc(SCREEN, 1)) != 0); + return ((my_screen = _nc_alloc_screen_sp()) != 0); } NCURSES_EXPORT(void) @@ -103,6 +104,7 @@ _nc_set_screen(SCREEN *sp) } #else + NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ #endif /* *INDENT-OFF* */ @@ -140,7 +142,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* tgetent_index */ 0, /* tgetent_sequence */ +#ifndef USE_SP_WINDOWLIST 0, /* _nc_windowlist */ +#endif #if USE_HOME_TERMINFO NULL, /* home_terminfo */ @@ -151,6 +155,10 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* safeprint_rows */ #endif +#ifdef USE_TERM_DRIVER + 0, /* term_driver */ +#endif + #ifdef TRACE FALSE, /* init_trace */ CHARS_0s, /* trace_fname */ @@ -174,7 +182,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { { CHARS_0s, CHARS_0s }, /* traceatr_color_buf */ 0, /* traceatr_color_sel */ -1, /* traceatr_color_last */ - +#if !defined(USE_PTHREADS) && USE_REENTRANT + 0, /* nested_tracef */ +#endif #endif /* TRACE */ #ifdef USE_PTHREADS PTHREAD_MUTEX_INITIALIZER, /* mutex_curses */ @@ -183,6 +193,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* nested_tracef */ 0, /* use_pthreads */ #endif +#if USE_PTHREADS_EINTR + 0, /* read_thread */ +#endif }; #define STACK_FRAME_0 { { 0 }, 0 } @@ -196,8 +209,10 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { TRUE, /* use_env */ FALSE, /* filter_mode */ A_NORMAL, /* previous_attr */ +#ifndef USE_SP_RIPOFF RIPOFF_0s, /* ripoff */ NULL, /* rsp */ +#endif { /* tparm_state */ #ifdef TRACE NULL, /* tname */ @@ -221,10 +236,13 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { #if NCURSES_NO_PADDING FALSE, /* flag to set if padding disabled */ #endif + 0, /* _outch */ #if BROKEN_LINKER || USE_REENTRANT NULL, /* real_acs_map */ 0, /* LINES */ 0, /* COLS */ + 8, /* TABSIZE */ + 1000, /* ESCDELAY */ 0, /* cur_term */ #ifdef TRACE 0L, /* _outchars */ @@ -234,6 +252,22 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { }; /* *INDENT-ON* */ +/* + * wgetch() and other functions with a WINDOW* parameter may use a SCREEN* + * internally, and it is useful to allow those to be invoked without switching + * SCREEN's, e.g., for multi-threaded applications. + */ +NCURSES_EXPORT(SCREEN *) +_nc_screen_of(WINDOW *win) +{ + SCREEN *sp = 0; + + if (win != 0) { + sp = WINDOW_EXT(win, screen); + } + return (sp); +} + /******************************************************************************/ #ifdef USE_PTHREADS static void @@ -314,7 +348,9 @@ _nc_mutex_unlock(pthread_mutex_t * obj) return 0; return pthread_mutex_unlock(obj); } +#endif /* USE_PTHREADS */ +#if defined(USE_PTHREADS) || USE_PTHREADS_EINTR #if USE_WEAK_SYMBOLS /* * NB: sigprocmask(2) is global but pthread_sigmask(3p) diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index 0dc66bd9b91..d1b9b8d966d 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-2003 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,25 +42,53 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_has_cap.c,v 1.4 2003/10/25 19:43:55 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.9 2009/10/24 22:15:47 tom Exp $") +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + + T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); + + if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { + code = ((insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)) ? TRUE : FALSE; + } + + returnCode(code); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_ic(void) { - T((T_CALLED("has_ic()"))); - returnCode(cur_term && - (insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); + return NCURSES_SP_NAME(has_ic) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); + if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { + code = ((insert_line || parm_insert_line) + && (delete_line || parm_delete_line)) ? TRUE : FALSE; + } + + returnCode(code); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_il(void) { - T((T_CALLED("has_il()"))); - returnCode(cur_term - && (insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); + return NCURSES_SP_NAME(has_il) (CURRENT_SCREEN); } +#endif diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 89dc1e80ea8..37f70842907 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 2002 * + * and: Thomas E. Dickey 2002 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -46,9 +47,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_kernel.c,v 1.24 2004/05/08 17:11:21 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.31 2010/12/19 01:21:19 tom Exp $") static int _nc_vdisable(void) @@ -59,7 +59,7 @@ _nc_vdisable(void) #endif #if defined(_PC_VDISABLE) if (value == -1) { - value = fpathconf(0, _PC_VDISABLE); + value = (int) fpathconf(0, _PC_VDISABLE); if (value == -1) { value = 0377; } @@ -79,23 +79,33 @@ _nc_vdisable(void) */ NCURSES_EXPORT(char) -erasechar(void) +NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) { int result = ERR; - T((T_CALLED("erasechar()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("erasechar(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - result = cur_term->Ottyb.c_cc[VERASE]; + result = termp->Ottyb.c_cc[VERASE]; if (result == _nc_vdisable()) result = ERR; #else - result = cur_term->Ottyb.sg_erase; + result = termp->Ottyb.sg_erase; #endif } - returnCode(result); + returnChar((char) result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char) +erasechar(void) +{ + return NCURSES_SP_NAME(erasechar) (CURRENT_SCREEN); +} +#endif + /* * killchar() * @@ -104,23 +114,33 @@ erasechar(void) */ NCURSES_EXPORT(char) -killchar(void) +NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) { int result = ERR; - T((T_CALLED("killchar()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("killchar(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - result = cur_term->Ottyb.c_cc[VKILL]; + result = termp->Ottyb.c_cc[VKILL]; if (result == _nc_vdisable()) result = ERR; #else - result = cur_term->Ottyb.sg_kill; + result = termp->Ottyb.sg_kill; #endif } - returnCode(result); + returnChar((char) result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char) +killchar(void) +{ + return NCURSES_SP_NAME(killchar) (CURRENT_SCREEN); +} +#endif + /* * flushinp() * @@ -129,26 +149,36 @@ killchar(void) */ NCURSES_EXPORT(int) -flushinp(void) +NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0) { - T((T_CALLED("flushinp()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("flushinp(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - tcflush(cur_term->Filedes, TCIFLUSH); + tcflush(termp->Filedes, TCIFLUSH); #else errno = 0; do { - ioctl(cur_term->Filedes, TIOCFLUSH, 0); + ioctl(termp->Filedes, TIOCFLUSH, 0); } while (errno == EINTR); #endif - if (SP) { - SP->_fifohead = -1; - SP->_fifotail = 0; - SP->_fifopeek = 0; + if (SP_PARM) { + SP_PARM->_fifohead = -1; + SP_PARM->_fifotail = 0; + SP_PARM->_fifopeek = 0; } returnCode(OK); } returnCode(ERR); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +flushinp(void) +{ + return NCURSES_SP_NAME(flushinp) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c index 1301ee51694..14903175b32 100644 --- a/ncurses/tinfo/lib_longname.c +++ b/ncurses/tinfo/lib_longname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -40,8 +42,38 @@ #include -MODULE_ID("$Id: lib_longname.c,v 1.9 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $") +#if USE_REENTRANT +NCURSES_EXPORT(char *) +NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0) +{ + static char empty[] = + {'\0'}; + char *ptr; + + T((T_CALLED("longname(%p)"), (void *) SP_PARM)); + + if (SP_PARM) { + for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype); + ptr > SP_PARM->_ttytype; + ptr--) + if (*ptr == '|') + returnPtr(ptr + 1); + returnPtr(SP_PARM->_ttytype); + } + return empty; +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +longname(void) +{ + return NCURSES_SP_NAME(longname) (CURRENT_SCREEN); +} +#endif + +#else NCURSES_EXPORT(char *) longname(void) { @@ -49,9 +81,11 @@ longname(void) T((T_CALLED("longname()"))); - for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) + for (ptr = ttytype + strlen(ttytype); + ptr > ttytype; + ptr--) if (*ptr == '|') returnPtr(ptr + 1); - returnPtr(ttytype); } +#endif diff --git a/ncurses/tinfo/lib_napms.c b/ncurses/tinfo/lib_napms.c index 417b3b4b4db..1e6abda10d0 100644 --- a/ncurses/tinfo/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -49,13 +51,17 @@ #endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.17 2008/05/03 21:34:13 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.20 2009/11/07 20:37:30 tom Exp $") NCURSES_EXPORT(int) -napms(int ms) +NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) { + (void) SP_PARM; T((T_CALLED("napms(%d)"), ms)); +#ifdef USE_TERM_DRIVER + CallDriver_1(SP_PARM, nap, ms); +#else /* !USE_TERM_DRIVER */ #if HAVE_NANOSLEEP { struct timespec request, remaining; @@ -69,6 +75,15 @@ napms(int ms) #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif +#endif /* !USE_TERM_DRIVER */ returnCode(OK); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +napms(int ms) +{ + return NCURSES_SP_NAME(napms) (CURRENT_SCREEN, ms); +} +#endif diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index f3b1485bf11..654bf940aa1 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,53 +42,67 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_options.c,v 1.58 2008/08/16 21:20:48 Werner.Fink Exp $") - -static int _nc_curs_set(SCREEN *, int); -static int _nc_meta(SCREEN *, bool); +MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { - T((T_CALLED("idlok(%p,%d)"), win, flag)); + int res = ERR; + T((T_CALLED("idlok(%p,%d)"), (void *) win, flag)); if (win) { - _nc_idlok = win->_idlok = (flag && (has_il() || change_scroll_region)); - returnCode(OK); - } else - returnCode(ERR); + SCREEN *sp = _nc_screen_of(win); + if (sp && IsTermInfo(sp)) { + sp->_nc_sp_idlok = + win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG) + || change_scroll_region)); + res = OK; + } + } + returnCode(res); } NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { - T((T_CALLED("idcok(%p,%d)"), win, flag)); - - if (win) - _nc_idcok = win->_idcok = (flag && has_ic()); + T((T_CALLED("idcok(%p,%d)"), (void *) win, flag)); + if (win) { + SCREEN *sp = _nc_screen_of(win); + sp->_nc_sp_idcok = win->_idcok = (flag && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)); + } returnVoid; } NCURSES_EXPORT(int) -halfdelay(int t) +NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { - T((T_CALLED("halfdelay(%d)"), t)); + T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); - if (t < 1 || t > 255 || SP == 0) + if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) returnCode(ERR); - cbreak(); - SP->_cbreak = t + 1; + NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); + SP_PARM->_cbreak = t + 1; returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +halfdelay(int t) +{ + return NCURSES_SP_NAME(halfdelay) (CURRENT_SCREEN, t); +} +#endif + NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { - T((T_CALLED("nodelay(%p,%d)"), win, flag)); + T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag)); if (win) { if (flag == TRUE) @@ -102,7 +117,7 @@ nodelay(WINDOW *win, bool flag) NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { - T((T_CALLED("notimeout(%p,%d)"), win, f)); + T((T_CALLED("notimeout(%p,%d)"), (void *) win, f)); if (win) { win->_notimeout = f; @@ -114,7 +129,7 @@ notimeout(WINDOW *win, bool f) NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { - T((T_CALLED("wtimeout(%p,%d)"), win, delay)); + T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay)); if (win) { win->_delay = delay; @@ -125,11 +140,11 @@ wtimeout(WINDOW *win, int delay) NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { - T((T_CALLED("keypad(%p,%d)"), win, flag)); + T((T_CALLED("keypad(%p,%d)"), (void *) win, flag)); if (win) { win->_use_keypad = flag; - returnCode(_nc_keypad(SP, flag)); + returnCode(_nc_keypad(_nc_screen_of(win), flag)); } else returnCode(ERR); } @@ -137,38 +152,106 @@ keypad(WINDOW *win, bool flag) NCURSES_EXPORT(int) meta(WINDOW *win GCC_UNUSED, bool flag) { - int result; + int result = ERR; + SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win); /* Ok, we stay relaxed and don't signal an error if win is NULL */ - T((T_CALLED("meta(%p,%d)"), win, flag)); - result = _nc_meta(SP, flag); + T((T_CALLED("meta(%p,%d)"), (void *) win, flag)); + + /* Ok, we stay relaxed and don't signal an error if win is NULL */ + + if (sp != 0) { + sp->_use_meta = flag; +#ifdef USE_TERM_DRIVER + if (IsTermInfo(sp)) { + if (flag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + } + } +#else + if (flag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + } +#endif + result = OK; + } returnCode(result); } /* curs_set() moved here to narrow the kernel interface */ NCURSES_EXPORT(int) -curs_set(int vis) +NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) { - int result; + int code = ERR; + T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis)); - T((T_CALLED("curs_set(%d)"), vis)); - result = _nc_curs_set(SP, vis); - returnCode(result); + if (SP_PARM != 0 && vis >= 0 && vis <= 2) { + int cursor = SP_PARM->_cursor; + bool bBuiltIn = !IsTermInfo(SP_PARM); + if (vis == cursor) { + code = cursor; + } else { + if (!bBuiltIn) { + switch (vis) { + case 2: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_visible", + cursor_visible); + break; + case 1: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_normal", + cursor_normal); + break; + case 0: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_invisible", + cursor_invisible); + break; + } + } else + code = ERR; + if (code != ERR) + code = (cursor == -1 ? 1 : cursor); + SP_PARM->_cursor = vis; + } + } + returnCode(code); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -typeahead(int fd) +curs_set(int vis) { - T((T_CALLED("typeahead(%d)"), fd)); - if (SP != 0) { - SP->_checkfd = fd; + return (NCURSES_SP_NAME(curs_set) (CURRENT_SCREEN, vis)); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) +{ + T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); + if (IsValidTIScreen(SP_PARM)) { + SP_PARM->_checkfd = fd; returnCode(OK); } else { returnCode(ERR); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +typeahead(int fd) +{ + return NCURSES_SP_NAME(typeahead) (CURRENT_SCREEN, fd); +} +#endif + /* ** has_key() ** @@ -189,43 +272,50 @@ has_key_internal(int keycode, TRIES * tp) || has_key_internal(keycode, tp->sibling)); } +#ifdef USE_TERM_DRIVER +NCURSES_EXPORT(int) +TINFO_HAS_KEY(SCREEN *sp, int keycode) +{ + return IsValidTIScreen(sp) ? + has_key_internal(keycode, sp->_keytry) : 0; +} +#else +NCURSES_EXPORT(int) +NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode) +{ + T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode)); + returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) has_key(int keycode) { - T((T_CALLED("has_key(%d)"), keycode)); - returnCode(SP != 0 ? has_key_internal(keycode, SP->_keytry) : FALSE); + return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode); } +#endif +#endif #endif /* NCURSES_EXT_FUNCS */ -/* - * Internal entrypoints use SCREEN* parameter to obtain capabilities rather - * than cur_term. - */ -#undef CUR -#define CUR (sp->_term)->type. - -static int -_nc_putp(const char *name GCC_UNUSED, const char *value) +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx + const char *name, const char *value) { - int rc = ERR; - - if (value) { - TPUTS_TRACE(name); - rc = putp(value); - } - return rc; -} - -static int -_nc_putp_flush(const char *name, const char *value) -{ - int rc = _nc_putp(name, value); + int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); if (rc != ERR) { _nc_flush(); } return rc; } +#if 0 && NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_putp_flush(const char *name, const char *value) +{ + return NCURSES_SP_NAME(_nc_putp_flush) (CURRENT_SCREEN, name, value); +} +#endif + /* Turn the keypad on/off * * Note: we flush the output because changing this mode causes some terminals @@ -245,12 +335,12 @@ _nc_keypad(SCREEN *sp, bool flag) * has wgetch() reading in more than one thread. putp() and below * may use SP explicitly. */ - if (_nc_use_pthreads && sp != SP) { + if (_nc_use_pthreads && sp != CURRENT_SCREEN) { SCREEN *save_sp; /* cannot use use_screen(), since that is not in tinfo library */ _nc_lock_global(curses); - save_sp = SP; + save_sp = CURRENT_SCREEN; _nc_set_screen(sp); rc = _nc_keypad(sp, flag); _nc_set_screen(save_sp); @@ -258,10 +348,19 @@ _nc_keypad(SCREEN *sp, bool flag) } else #endif { +#ifdef USE_TERM_DRIVER + rc = CallDriver_1(sp, kpad, flag); + if (rc == OK) + sp->_keypad_on = flag; +#else if (flag) { - (void) _nc_putp_flush("keypad_xmit", keypad_xmit); + (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "keypad_xmit", + keypad_xmit); } else if (!flag && keypad_local) { - (void) _nc_putp_flush("keypad_local", keypad_local); + (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "keypad_local", + keypad_local); } if (flag && !sp->_tried) { @@ -270,58 +369,8 @@ _nc_keypad(SCREEN *sp, bool flag) } sp->_keypad_on = flag; rc = OK; +#endif } } return (rc); } - -static int -_nc_curs_set(SCREEN *sp, int vis) -{ - int result = ERR; - - T((T_CALLED("curs_set(%d)"), vis)); - if (sp != 0 && vis >= 0 && vis <= 2) { - int cursor = sp->_cursor; - - if (vis == cursor) { - result = cursor; - } else { - switch (vis) { - case 2: - result = _nc_putp_flush("cursor_visible", cursor_visible); - break; - case 1: - result = _nc_putp_flush("cursor_normal", cursor_normal); - break; - case 0: - result = _nc_putp_flush("cursor_invisible", cursor_invisible); - break; - } - if (result != ERR) - result = (cursor == -1 ? 1 : cursor); - sp->_cursor = vis; - } - } - returnCode(result); -} - -static int -_nc_meta(SCREEN *sp, bool flag) -{ - int result = ERR; - - /* Ok, we stay relaxed and don't signal an error if win is NULL */ - - if (SP != 0) { - SP->_use_meta = flag; - - if (flag) { - _nc_putp("meta_on", meta_on); - } else { - _nc_putp("meta_off", meta_off); - } - result = OK; - } - return result; -} diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index 975b46d8577..c7bd3a62fa8 100644 --- a/ncurses/tinfo/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,23 +29,31 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_print.c,v 1.16 2006/11/26 00:26:34 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $") NCURSES_EXPORT(int) -mcprint(char *data, int len) +NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ { + int result; char *mybuf, *switchon; - size_t onsize, offsize, res; + size_t onsize, offsize; + size_t need; errno = 0; - if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { + if (!HasTInfoTerminal(SP_PARM) + || len <= 0 + || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; return (ERR); } @@ -60,8 +68,10 @@ mcprint(char *data, int len) offsize = strlen(prtr_off); } + need = onsize + (size_t) len + offsize; + if (switchon == 0 - || (mybuf = typeMalloc(char, onsize + len + offsize + 1)) == 0) { + || (mybuf = typeMalloc(char, need + 1)) == 0) { errno = ENOMEM; return (ERR); } @@ -78,15 +88,24 @@ mcprint(char *data, int len) * data has actually been shipped to the terminal. If the write(2) * operation is truly atomic we're protected from this. */ - res = write(cur_term->Filedes, mybuf, onsize + len + offsize); + result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need); /* * By giving up our scheduler slot here we increase the odds that the * kernel will ship the contiguous clist items from the last write * immediately. */ +#ifndef __MINGW32__ (void) sleep(0); - +#endif free(mybuf); - return (res); + return (result); } + +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +mcprint(char *data, int len) +{ + return NCURSES_SP_NAME(mcprint) (CURRENT_SCREEN, data, len); +} +#endif diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index 58e71889af1..b524a1bb55b 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1998 on * + * and: Thomas E. Dickey 1998-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -47,9 +48,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -61,7 +61,7 @@ MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #ifdef __EMX__ #include -#define _nc_setmode(mode) setmode(SP->_ifd, mode) +#define _nc_setmode(mode) setmode(SP_PARM->_ifd, mode) #else #define _nc_setmode(mode) /* nothing */ #endif @@ -77,188 +77,235 @@ MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #endif /* TRACE */ NCURSES_EXPORT(int) -raw(void) +NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("raw()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("raw(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("raw"); _nc_setmode(O_BINARY); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~(ICANON | ISIG | IEXTEN); - buf.c_iflag &= ~(COOKED_INPUT); + buf.c_lflag &= (unsigned) ~(ICANON | ISIG | IEXTEN); + buf.c_iflag &= (unsigned) ~(COOKED_INPUT); buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= RAW; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_raw = TRUE; - SP->_cbreak = 1; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_raw = TRUE; + SP_PARM->_cbreak = 1; + termp->Nttyb = buf; } AFTER("raw"); } returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -cbreak(void) +raw(void) +{ + return NCURSES_SP_NAME(raw) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("cbreak()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("cbreak(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("cbreak"); _nc_setmode(O_BINARY); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~ICANON; - buf.c_iflag &= ~ICRNL; + buf.c_lflag &= (unsigned) ~ICANON; + buf.c_iflag &= (unsigned) ~ICRNL; buf.c_lflag |= ISIG; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= CBREAK; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_cbreak = 1; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_cbreak = 1; + termp->Nttyb = buf; } AFTER("cbreak"); } returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +cbreak(void) +{ + return NCURSES_SP_NAME(cbreak) (CURRENT_SCREEN); +} +#endif + /* * Note: * this implementation may be wrong. See the comment under intrflush(). */ NCURSES_EXPORT(void) -qiflush(void) +NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("qiflush()"))); - - if (cur_term != 0) { + T((T_CALLED("qiflush(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("qiflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~(NOFLSH); - result = _nc_set_tty_mode(&buf); + buf.c_lflag &= (unsigned) ~(NOFLSH); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif if (result == OK) - cur_term->Nttyb = buf; + termp->Nttyb = buf; AFTER("qiflush"); } returnVoid; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +qiflush(void) +{ + NCURSES_SP_NAME(qiflush) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(int) -noraw(void) +NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("noraw()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("noraw(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("noraw"); _nc_setmode(O_TEXT); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= ISIG | ICANON | - (cur_term->Ottyb.c_lflag & IEXTEN); + (termp->Ottyb.c_lflag & IEXTEN); buf.c_iflag |= COOKED_INPUT; #else buf.sg_flags &= ~(RAW | CBREAK); #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_raw = FALSE; - SP->_cbreak = 0; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_raw = FALSE; + SP_PARM->_cbreak = 0; + termp->Nttyb = buf; } AFTER("noraw"); } returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -nocbreak(void) +noraw(void) +{ + return NCURSES_SP_NAME(noraw) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("nocbreak()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("nocbreak(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("nocbreak"); _nc_setmode(O_TEXT); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= ICANON; buf.c_iflag |= ICRNL; #else buf.sg_flags &= ~CBREAK; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_cbreak = 0; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_cbreak = 0; + termp->Nttyb = buf; } AFTER("nocbreak"); } returnCode(result); } -/* - * Note: - * this implementation may be wrong. See the comment under intrflush(). - */ +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +nocbreak(void) +{ + return NCURSES_SP_NAME(nocbreak) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(void) -noqiflush(void) +NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("noqiflush()"))); - - if (cur_term != 0) { + T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("noqiflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= NOFLSH; - result = _nc_set_tty_mode(&buf); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif - if (result == OK) { - cur_term->Nttyb = buf; - } + if (result == OK) + termp->Nttyb = buf; AFTER("noqiflush"); } returnVoid; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +noqiflush(void) +{ + NCURSES_SP_NAME(noqiflush) (CURRENT_SCREEN); +} +#endif + /* * This call does the same thing as the qiflush()/noqiflush() pair. We know * for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the other hand, @@ -267,30 +314,41 @@ noqiflush(void) * curs_inopts(3x) is too exact to be coincidence. */ NCURSES_EXPORT(int) -intrflush(WINDOW *win GCC_UNUSED, bool flag) +NCURSES_SP_NAME(intrflush) (NCURSES_SP_DCLx WINDOW *win GCC_UNUSED, bool flag) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("intrflush(%d)"), flag)); + T((T_CALLED("intrflush(%p,%d)"), (void *) SP_PARM, flag)); + if (SP_PARM == 0) + returnCode(ERR); - if (cur_term != 0) { + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("intrflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS if (flag) - buf.c_lflag &= ~(NOFLSH); + buf.c_lflag &= (unsigned) ~(NOFLSH); else buf.c_lflag |= (NOFLSH); - result = _nc_set_tty_mode(&buf); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif if (result == OK) { - cur_term->Nttyb = buf; + termp->Nttyb = buf; } AFTER("intrflush"); } returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +intrflush(WINDOW *win GCC_UNUSED, bool flag) +{ + return NCURSES_SP_NAME(intrflush) (CURRENT_SCREEN, win, flag); +} +#endif diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 8cfaf12c534..5fcf2ae3fc3 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,7 +42,6 @@ #include #include /* for MAX_NAME_SIZE */ -#include #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -51,9 +51,7 @@ #include #endif -#include /* lines, columns, cur_term */ - -MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.135 2011/02/06 01:04:21 tom Exp $") /**************************************************************************** * @@ -109,61 +107,96 @@ MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") * Wrap global variables in this module. */ #if USE_REENTRANT + NCURSES_EXPORT(char *) NCURSES_PUBLIC_VAR(ttytype) (void) { static char empty[] = ""; - return cur_term ? cur_term->type.term_names : empty; + char *result = empty; + +#if NCURSES_SP_FUNCS + if (CURRENT_SCREEN) { + TERMINAL *termp = TerminalOf(CURRENT_SCREEN); + if (termp != 0) { + result = termp->type.term_names; + } + } +#else + if (cur_term != 0) { + result = cur_term->type.term_names; + } +#endif + return result; } + NCURSES_EXPORT(int *) -_nc_ptr_Lines(void) +_nc_ptr_Lines(SCREEN *sp) { - return ptrLines(); + return ptrLines(sp); } + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(LINES) (void) { - return *_nc_ptr_Lines(); + return *_nc_ptr_Lines(CURRENT_SCREEN); } + NCURSES_EXPORT(int *) -_nc_ptr_Cols(void) +_nc_ptr_Cols(SCREEN *sp) { - return ptrCols(); + return ptrCols(sp); } + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(COLS) (void) { - return *_nc_ptr_Cols(); + return *_nc_ptr_Cols(CURRENT_SCREEN); } + +NCURSES_EXPORT(int *) +_nc_ptr_Tabsize(SCREEN *sp) +{ + return ptrTabsize(sp); +} + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(TABSIZE) (void) { - return SP ? SP->_TABSIZE : 8; + return *_nc_ptr_Tabsize(CURRENT_SCREEN); } #else NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; NCURSES_EXPORT_VAR(int) LINES = 0; NCURSES_EXPORT_VAR(int) COLS = 0; -NCURSES_EXPORT_VAR(int) TABSIZE = 0; +NCURSES_EXPORT_VAR(int) TABSIZE = 8; #endif #if NCURSES_EXT_FUNCS NCURSES_EXPORT(int) -set_tabsize(int value) +NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value) { int code = OK; #if USE_REENTRANT - if (SP) { - SP->_TABSIZE = value; + if (SP_PARM) { + SP_PARM->_TABSIZE = value; } else { code = ERR; } #else + (void) SP_PARM; TABSIZE = value; #endif return code; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +set_tabsize(int value) +{ + return NCURSES_SP_NAME(set_tabsize) (CURRENT_SCREEN, value); +} #endif +#endif /* NCURSES_EXT_FUNCS */ #if USE_SIGWINCH /* @@ -188,42 +221,71 @@ _nc_handle_sigwinch(SCREEN *sp) #endif NCURSES_EXPORT(void) -use_env(bool f) +NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f) { - T((T_CALLED("use_env()"))); + T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f)); +#if NCURSES_SP_FUNCS + if (IsPreScreen(SP_PARM)) { + SP_PARM->_use_env = f; + } +#else _nc_prescreen.use_env = f; +#endif returnVoid; } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_get_screensize(SCREEN *sp, int *linep, int *colp) +use_env(bool f) +{ + T((T_CALLED("use_env(%d)"), (int) f)); + _nc_prescreen.use_env = f; + returnVoid; +} +#endif + +NCURSES_EXPORT(void) +_nc_get_screensize(SCREEN *sp, +#ifdef USE_TERM_DRIVER + TERMINAL * termp, +#endif + int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ { +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB; + int my_tabsize; + + assert(termp != 0 && linep != 0 && colp != 0); + TCB = (TERMINAL_CONTROL_BLOCK *) termp; + + my_tabsize = TCB->info.tabsize; + TCB->drv->size(TCB, linep, colp); + +#if USE_REENTRANT + if (sp != 0) { + sp->_TABSIZE = my_tabsize; + } +#else + (void) sp; + TABSIZE = my_tabsize; +#endif + T(("TABSIZE = %d", my_tabsize)); +#else /* !USE_TERM_DRIVER */ TERMINAL *termp = cur_term; int my_tabsize; /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); - if (!_nc_prescreen.use_env) { - *linep = (int) lines; - *colp = (int) columns; - } else { /* usually want to query LINES and COLUMNS from environment */ + *linep = (int) lines; + *colp = (int) columns; + + if (_nc_prescreen.use_env) { int value; - *linep = *colp = 0; - - /* first, look for environment variables */ - if ((value = _nc_getenv_num("LINES")) > 0) { - *linep = value; - } - if ((value = _nc_getenv_num("COLUMNS")) > 0) { - *colp = value; - } - T(("screen size: environment LINES = %d COLUMNS = %d", *linep, *colp)); - #ifdef __EMX__ - if (*linep <= 0 || *colp <= 0) { + { int screendata[2]; _scrsize(screendata); *colp = screendata[0]; @@ -233,33 +295,41 @@ _nc_get_screensize(SCREEN *sp, int *linep, int *colp) } #endif #if HAVE_SIZECHANGE - /* if that didn't work, maybe we can try asking the OS */ - if (*linep <= 0 || *colp <= 0) { - if (isatty(cur_term->Filedes)) { - STRUCT_WINSIZE size; + /* try asking the OS */ + if (isatty(cur_term->Filedes)) { + STRUCT_WINSIZE size; - errno = 0; - do { - if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) < 0 - && errno != EINTR) - goto failure; - } while - (errno == EINTR); - - /* - * Solaris lets users override either dimension with an - * environment variable. - */ - if (*linep <= 0) - *linep = (sp != 0 && sp->_filtered) ? 1 : WINSIZE_ROWS(size); - if (*colp <= 0) + errno = 0; + do { + if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) >= 0) { + *linep = ((sp != 0 && sp->_filtered) + ? 1 + : WINSIZE_ROWS(size)); *colp = WINSIZE_COLS(size); - } - /* FALLTHRU */ - failure:; + T(("SYS screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + break; + } + } while + (errno == EINTR); } #endif /* HAVE_SIZECHANGE */ + /* + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. + */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); + } + /* if we can't get dynamic info about the size, use static */ if (*linep <= 0) { *linep = (int) lines; @@ -298,19 +368,31 @@ _nc_get_screensize(SCREEN *sp, int *linep, int *colp) TABSIZE = my_tabsize; #endif T(("TABSIZE = %d", TABSIZE)); +#endif /* USE_TERM_DRIVER */ } #if USE_SIZECHANGE NCURSES_EXPORT(void) _nc_update_screensize(SCREEN *sp) { - TERMINAL *termp = cur_term; - int old_lines = lines; int new_lines; - int old_cols = columns; int new_cols; - _nc_get_screensize(sp, &new_lines, &new_cols); +#ifdef USE_TERM_DRIVER + int old_lines; + int old_cols; + + assert(sp != 0); + + CallDriver_2(sp, getsize, &old_lines, &old_cols); + +#else + TERMINAL *termp = cur_term; + int old_lines = lines; + int old_cols = columns; +#endif + + TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols); /* * See is_term_resized() and resizeterm(). @@ -320,7 +402,7 @@ _nc_update_screensize(SCREEN *sp) if (sp != 0 && sp->_resize != 0) { if ((new_lines != old_lines) || (new_cols != old_cols)) - sp->_resize(new_lines, new_cols); + sp->_resize(NCURSES_SP_ARGx new_lines, new_cols); sp->_sig_winch = FALSE; } } @@ -353,8 +435,8 @@ _nc_update_screensize(SCREEN *sp) * Return 1 if entry found, 0 if not found, -1 if database not accessible, * just like tgetent(). */ -static int -grab_entry(const char *const tn, TERMTYPE *const tp) +int +_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) { char filename[PATH_MAX]; int status = _nc_read_entry(tn, filename, tp); @@ -381,28 +463,27 @@ grab_entry(const char *const tn, TERMTYPE *const tp) #endif /* -** do_prototype() -** ** Take the real command character out of the CC environment variable ** and substitute it in for the prototype given in 'command_character'. */ -static void -do_prototype(TERMINAL * termp) +void +_nc_tinfo_cmdch(TERMINAL * termp, char proto) { unsigned i; char CC; - char proto; char *tmp; - if ((tmp = getenv("CC")) != 0) { - if ((CC = *tmp) != 0) { - proto = *command_character; - - for_each_string(i, &(termp->type)) { - for (tmp = termp->type.Strings[i]; *tmp; tmp++) { - if (*tmp == proto) - *tmp = CC; - } + /* + * Only use the character if the string is a single character, + * since it is fairly common for developers to set the C compiler + * name as an environment variable - using the same symbol. + */ + if ((tmp = getenv("CC")) != 0 && strlen(tmp) == 1) { + CC = *tmp; + for_each_string(i, &(termp->type)) { + for (tmp = termp->type.Strings[i]; *tmp; tmp++) { + if (*tmp == proto) + *tmp = CC; } } } @@ -465,39 +546,64 @@ _nc_unicode_locale(void) NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL * termp) { + const char *env_name = "NCURSES_NO_UTF8_ACS"; char *env; + int value; + int result = 0; - if ((env = getenv("NCURSES_NO_UTF8_ACS")) != 0) { - return atoi(env); + if ((env = getenv(env_name)) != 0) { + result = _nc_getenv_num(env_name); + } else if ((value = tigetnum("U8")) >= 0) { + result = value; /* use extension feature */ } else if ((env = getenv("TERM")) != 0) { - if (strstr(env, "linux")) - return 1; /* always broken */ - if (strstr(env, "screen") != 0 - && ((env = getenv("TERMCAP")) != 0 - && strstr(env, "screen") != 0) - && strstr(env, "hhII00") != 0) { + if (strstr(env, "linux")) { + result = 1; /* always broken */ + } else if (strstr(env, "screen") != 0 + && ((env = getenv("TERMCAP")) != 0 + && strstr(env, "screen") != 0) + && strstr(env, "hhII00") != 0) { if (CONTROL_N(enter_alt_charset_mode) || CONTROL_O(enter_alt_charset_mode) || CONTROL_N(set_attributes) || - CONTROL_O(set_attributes)) - return 1; + CONTROL_O(set_attributes)) { + result = 1; + } } } - return 0; + return result; } -/* - * This entrypoint is called from tgetent() to allow a special case of reusing - * the same TERMINAL data (see comment). - */ NCURSES_EXPORT(int) -_nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) +TINFO_SETUP_TERM(TERMINAL ** tp, + NCURSES_CONST char *tname, + int Filedes, + int *errret, + bool reuse) { - TERMINAL *termp; +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = 0; +#else int status; +#endif + TERMINAL *termp; + SCREEN *sp = 0; + int code = ERR; START_TRACE(); - T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); + +#ifdef USE_TERM_DRIVER + T((T_CALLED("_nc_setupterm_ex(%p,%s,%d,%p)"), + (void *) tp, _nc_visbuf(tname), Filedes, (void *) errret)); + + if (tp == 0) { + ret_error0(TGETENT_ERR, + "Invalid parameter, internal error.\n"); + } else + termp = *tp; +#else + termp = cur_term; + T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, (void *) errret)); +#endif if (tname == 0) { tname = getenv("TERM"); @@ -538,22 +644,37 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) * properly with this feature). */ if (reuse - && (termp = cur_term) != 0 + && (termp != 0) && termp->Filedes == Filedes && termp->_termname != 0 && !strcmp(termp->_termname, tname) && _nc_name_match(termp->type.term_names, tname, "|")) { T(("reusing existing terminal information and mode-settings")); + code = OK; } else { - +#ifdef USE_TERM_DRIVER + termp = (TERMINAL *) typeCalloc(TERMINAL_CONTROL_BLOCK, 1); +#else termp = typeCalloc(TERMINAL, 1); - +#endif if (termp == 0) { ret_error0(TGETENT_ERR, "Not enough memory to create terminal structure.\n"); } +#ifdef USE_TERM_DRIVER + INIT_TERM_DRIVER(); + TCB = (TERMINAL_CONTROL_BLOCK *) termp; + code = _nc_globals.term_driver(TCB, tname, errret); + if (code == OK) { + termp->Filedes = (short) Filedes; + termp->_termname = strdup(tname); + } else { + ret_error0(TGETENT_ERR, + "Could not find any driver to handle this terminal.\n"); + } +#else #if USE_DATABASE || USE_TERMCAP - status = grab_entry(tname, &termp->type); + status = _nc_setup_tinfo(tname, &termp->type); #else status = TGETENT_NO; #endif @@ -581,13 +702,13 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) ttytype[NAMESIZE - 1] = '\0'; #endif - termp->Filedes = Filedes; + termp->Filedes = (short) Filedes; termp->_termname = strdup(tname); set_curterm(termp); - if (command_character && getenv("CC")) - do_prototype(termp); + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); /* * If an application calls setupterm() rather than initscr() or @@ -599,25 +720,95 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) def_prog_mode(); baudrate(); } + code = OK; +#endif } +#ifdef USE_TERM_DRIVER + *tp = termp; + NCURSES_SP_NAME(set_curterm) (sp, termp); + TCB->drv->init(TCB); +#else + sp = SP; +#endif + /* * We should always check the screensize, just in case. */ - _nc_get_screensize(SP, ptrLines(), ptrCols()); + TINFO_GET_SIZE(sp, termp, ptrLines(sp), ptrCols(sp)); if (errret) *errret = TGETENT_YES; +#ifndef USE_TERM_DRIVER if (generic_type) { ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); } if (hard_copy) { ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); } - returnCode(OK); +#endif + returnCode(code); } +#if NCURSES_SP_FUNCS +/* + * In case of handling multiple screens, we need to have a screen before + * initialization in setupscreen takes place. This is to extend the substitute + * for some of the stuff in _nc_prescreen, especially for slk and ripoff + * handling which should be done per screen. + */ +NCURSES_EXPORT(SCREEN *) +new_prescr(void) +{ + static SCREEN *sp; + + START_TRACE(); + T((T_CALLED("new_prescr()"))); + + if (sp == 0) { + sp = _nc_alloc_screen_sp(); + if (sp != 0) { + sp->rsp = sp->rippedoff; + sp->_filtered = _nc_prescreen.filter_mode; + sp->_use_env = _nc_prescreen.use_env; +#if NCURSES_NO_PADDING + sp->_no_padding = _nc_prescreen._no_padding; +#endif + sp->slk_format = 0; + sp->_slk = 0; + sp->_prescreen = TRUE; + SP_PRE_INIT(sp); +#if USE_REENTRANT + sp->_TABSIZE = _nc_prescreen._TABSIZE; + sp->_ESCDELAY = _nc_prescreen._ESCDELAY; +#endif + } + } + returnSP(sp); +} +#endif + +#ifdef USE_TERM_DRIVER +/* + * This entrypoint is called from tgetent() to allow a special case of reusing + * the same TERMINAL data (see comment). + */ +NCURSES_EXPORT(int) +_nc_setupterm(NCURSES_CONST char *tname, + int Filedes, + int *errret, + bool reuse) +{ + int res; + TERMINAL *termp; + res = TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse); + if (ERR != res) + NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN_PRE, termp); + return res; +} +#endif + /* * setupterm(termname, Filedes, errret) * diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 2d245ffbb61..e9dae85bdd9 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * * * * some of the code in here was contributed by: * * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) * @@ -43,9 +44,11 @@ #include #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_termcap.c,v 1.63 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.73 2010/12/25 19:27:12 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -76,16 +79,26 @@ NCURSES_EXPORT_VAR(char *) BC = 0; ***************************************************************************/ NCURSES_EXPORT(int) -tgetent(char *bufp, const char *name) +NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) { - int errcode; + int rc = ERR; int n; bool found_cache = FALSE; +#ifdef USE_TERM_DRIVER + TERMINAL *termp = 0; +#endif START_TRACE(); T((T_CALLED("tgetent()"))); - _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE); + TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name, + STDOUT_FILENO, &rc, TRUE); + +#ifdef USE_TERM_DRIVER + if (termp == 0 || + !((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo) + return (rc); +#endif /* * In general we cannot tell if the fixed sgr0 is still used by the @@ -109,9 +122,9 @@ tgetent(char *bufp, const char *name) /* * Also free the terminfo data that we loaded (much bigger leak). */ - if (LAST_TRM != 0 && LAST_TRM != cur_term) { + if (LAST_TRM != 0 && LAST_TRM != TerminalOf(SP_PARM)) { TERMINAL *trm = LAST_TRM; - del_curterm(LAST_TRM); + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; @@ -131,7 +144,7 @@ tgetent(char *bufp, const char *name) } CacheInx = best; } - LAST_TRM = cur_term; + LAST_TRM = TerminalOf(SP_PARM); LAST_SEQ = ++CacheSeq; PC = 0; @@ -139,7 +152,7 @@ tgetent(char *bufp, const char *name) BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ - if (errcode == 1) { + if (rc == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) @@ -153,7 +166,7 @@ tgetent(char *bufp, const char *name) if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; - if ((FIX_SGR0 = _nc_trim_sgr0(&(cur_term->type))) != 0) { + if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); @@ -164,8 +177,8 @@ tgetent(char *bufp, const char *name) LAST_BUF = bufp; LAST_USE = TRUE; - SetNoPadding(SP); - (void) baudrate(); /* sets ospeed as a side-effect */ + SetNoPadding(SP_PARM); + (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -174,9 +187,28 @@ tgetent(char *bufp, const char *name) #endif*/ } - returnCode(errcode); + returnCode(rc); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetent(char *bufp, const char *name) +{ + return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name); +} +#endif + +#if 0 +static bool +same_tcname(const char *a, const char *b) +{ + fprintf(stderr, "compare(%s,%s)\n", a, b); + return !strncmp(a, b, 2); +} +#else +#define same_tcname(a,b) !strncmp(a,b,2) +#endif + /*************************************************************************** * * tgetflag(str) @@ -187,24 +219,48 @@ tgetent(char *bufp, const char *name) ***************************************************************************/ NCURSES_EXPORT(int) -tgetflag(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) { - unsigned i; + int result = 0; /* Solaris returns zero for missing flag */ + int i, j; - T((T_CALLED("tgetflag(%s)"), id)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolcodes); - if (!strncmp(id, capname, 2)) { - /* setupterm forces invalid booleans to false */ - returnCode(tp->Booleans[i]); + T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, BOOLEAN, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + /* note: setupterm forces invalid booleans to false */ + result = tp->Booleans[j]; + } } - returnCode(0); /* Solaris does this */ + returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetflag(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetnum(str) @@ -215,25 +271,48 @@ tgetflag(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(int) -tgetnum(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) { - unsigned i; + int result = ABSENT_NUMERIC; + int i, j; - T((T_CALLED("tgetnum(%s)"), id)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_number(i, tp) { - const char *capname = ExtNumname(tp, i, numcodes); - if (!strncmp(id, capname, 2)) { - if (!VALID_NUMERIC(tp->Numbers[i])) - returnCode(ABSENT_NUMERIC); - returnCode(tp->Numbers[i]); + T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, NUMBER, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_number(i, tp) { + const char *capname = ExtNumname(tp, i, numcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + if (VALID_NUMERIC(tp->Numbers[j])) + result = tp->Numbers[j]; + } } - returnCode(ABSENT_NUMERIC); + returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetnum(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetstr(str, area) @@ -244,40 +323,62 @@ tgetnum(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(char *) -tgetstr(NCURSES_CONST char *id, char **area) +NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) { - unsigned i; char *result = NULL; + int i, j; - T((T_CALLED("tgetstr(%s,%p)"), id, area)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_string(i, tp) { - const char *capname = ExtStrname(tp, i, strcodes); - if (!strncmp(id, capname, 2)) { - result = tp->Strings[i]; - TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); - /* setupterm forces canceled strings to null */ - if (VALID_STRING(result)) { - if (result == exit_attribute_mode - && FIX_SGR0 != 0) { - result = FIX_SGR0; - TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); - } - if (area != 0 - && *area != 0) { - (void) strcpy(*area, result); - result = *area; - *area += strlen(*area) + 1; - } + T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, STRING, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_string(i, tp) { + const char *capname = ExtStrname(tp, i, strcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } + } + } +#endif + if (j >= 0) { + result = tp->Strings[j]; + TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); + /* setupterm forces canceled strings to null */ + if (VALID_STRING(result)) { + if (result == exit_attribute_mode + && FIX_SGR0 != 0) { + result = FIX_SGR0; + TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); + } + if (area != 0 + && *area != 0) { + (void) strcpy(*area, result); + result = *area; + *area += strlen(*area) + 1; } - break; } } } returnPtr(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +tgetstr(NCURSES_CONST char *id, char **area) +{ + return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area); +} +#endif + #if NO_LEAKS NCURSES_EXPORT(void) _nc_tgetent_leaks(void) diff --git a/ncurses/tinfo/lib_termname.c b/ncurses/tinfo/lib_termname.c index 713d0be8c36..e3f6827ee01 100644 --- a/ncurses/tinfo/lib_termname.c +++ b/ncurses/tinfo/lib_termname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,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 * @@ -28,17 +28,31 @@ #include -MODULE_ID("$Id: lib_termname.c,v 1.8 2003/12/27 18:23:01 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT(char *) -termname(void) +NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0) { char *name = 0; - T((T_CALLED("termname()"))); + T((T_CALLED("termname(%p)"), (void *) SP_PARM)); +#if NCURSES_SP_FUNCS + if (TerminalOf(SP_PARM) != 0) { + name = TerminalOf(SP_PARM)->_termname; + } +#else if (cur_term != 0) name = cur_term->_termname; +#endif returnPtr(name); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +termname(void) +{ + return NCURSES_SP_NAME(termname) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index df460f953ea..e41234210c8 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,75 +29,159 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ #include -#include #include -MODULE_ID("$Id: lib_ti.c,v 1.23 2003/05/24 21:10:28 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.29 2010/01/23 17:57:43 tom Exp $") +#if 0 +static bool +same_name(const char *a, const char *b) +{ + fprintf(stderr, "compare(%s,%s)\n", a, b); + return !strcmp(a, b); +} +#else +#define same_name(a,b) !strcmp(a,b) +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + int result = ABSENT_BOOLEAN; + int i, j; + + T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolnames); + if (same_name(str, capname)) { + j = i; + break; + } + } + } +#endif + if (j >= 0) { + /* note: setupterm forces invalid booleans to false */ + result = tp->Booleans[j]; + } + } + + returnCode(result); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetflag(NCURSES_CONST char *str) { - unsigned i; + return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str); +} +#endif - T((T_CALLED("tigetflag(%s)"), str)); +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + int i, j; + int result = CANCELLED_NUMERIC; /* Solaris returns a -1 on error */ - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolnames); - if (!strcmp(str, capname)) { - /* setupterm forces invalid booleans to false */ - returnCode(tp->Booleans[i]); + T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_number(i, tp) { + const char *capname = ExtNumname(tp, i, numnames); + if (same_name(str, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + if (VALID_NUMERIC(tp->Numbers[j])) + result = tp->Numbers[j]; + else + result = ABSENT_NUMERIC; + } } - returnCode(ABSENT_BOOLEAN); + returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetnum(NCURSES_CONST char *str) { - unsigned i; + return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str); +} +#endif - T((T_CALLED("tigetnum(%s)"), str)); +NCURSES_EXPORT(char *) +NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + char *result = CANCELLED_STRING; + int i, j; - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_number(i, tp) { - const char *capname = ExtNumname(tp, i, numnames); - if (!strcmp(str, capname)) { - if (!VALID_NUMERIC(tp->Numbers[i])) - returnCode(ABSENT_NUMERIC); - returnCode(tp->Numbers[i]); + T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, STRING, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_string(i, tp) { + const char *capname = ExtStrname(tp, i, strnames); + if (same_name(str, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + /* note: setupterm forces cancelled strings to null */ + result = tp->Strings[j]; + } } - returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ + returnPtr(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(char *) tigetstr(NCURSES_CONST char *str) { - unsigned i; - - T((T_CALLED("tigetstr(%s)"), str)); - - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_string(i, tp) { - const char *capname = ExtStrname(tp, i, strnames); - if (!strcmp(str, capname)) { - /* setupterm forces cancelled strings to null */ - returnPtr(tp->Strings[i]); - } - } - } - - returnPtr(CANCELLED_STRING); + return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str); } +#endif diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index ba2a8404030..7cd12f7f684 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,10 +40,9 @@ #include #include -#include #include -MODULE_ID("$Id: lib_tparm.c,v 1.76 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.82 2011/01/15 22:19:12 tom Exp $") /* * char * @@ -140,7 +139,7 @@ save_text(const char *fmt, const char *s, int len) { size_t s_len = strlen(s); if (len > (int) s_len) - s_len = len; + s_len = (size_t) len; get_space(s_len + 1); @@ -451,12 +450,13 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) } static NCURSES_INLINE char * -tparam_internal(const char *string, va_list ap) +tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) { char *p_is_s[NUM_PARM]; TPARM_ARG param[NUM_PARM]; - int popcount; + int popcount = 0; int number; + int num_args; int len; int level; int x, y; @@ -479,7 +479,13 @@ tparam_internal(const char *string, va_list ap) if (TPS(fmt_buff) == 0) return NULL; - for (i = 0; i < max(popcount, number); i++) { + if (number > NUM_PARM) + number = NUM_PARM; + if (popcount > NUM_PARM) + popcount = NUM_PARM; + num_args = max(popcount, number); + + for (i = 0; i < num_args; i++) { /* * A few caps (such as plab_norm) have string-valued parms. * We'll have to assume that the caller knows the difference, since @@ -489,8 +495,11 @@ tparam_internal(const char *string, va_list ap) */ if (p_is_s[i] != 0) { p_is_s[i] = va_arg(ap, char *); - } else { + param[i] = 0; + } else if (use_TPARM_ARG) { param[i] = va_arg(ap, TPARM_ARG); + } else { + param[i] = (TPARM_ARG) va_arg(ap, int); } } @@ -508,7 +517,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } } #ifdef TRACE @@ -517,7 +526,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i] != 0) save_text(", %s", _nc_visbuf(p_is_s[i]), 0); else - save_number(", %d", param[i], 0); + save_number(", %d", (int) param[i], 0); } _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff)); TPS(out_used) = 0; @@ -564,7 +573,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } break; @@ -772,7 +781,7 @@ tparm_varargs(NCURSES_CONST char *string,...) #ifdef TRACE TPS(tname) = "tparm"; #endif /* TRACE */ - result = tparam_internal(string, ap); + result = tparam_internal(TRUE, string, ap); va_end(ap); return result; } @@ -793,3 +802,19 @@ tparm_proto(NCURSES_CONST char *string, return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9); } #endif /* NCURSES_TPARM_VARARGS */ + +NCURSES_EXPORT(char *) +tiparm(const char *string,...) +{ + va_list ap; + char *result; + + _nc_tparm_err = 0; + va_start(ap, string); +#ifdef TRACE + TPS(tname) = "tiparm"; +#endif /* TRACE */ + result = tparam_internal(FALSE, string, ap); + va_end(ap); + return result; +} diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index a8b7276895a..dc70f3e0b0b 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,12 +42,16 @@ */ #include + +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #include -#include /* padding_baud_rate, xon_xoff */ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.66 2008/06/28 13:12:15 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -69,63 +74,136 @@ _nc_set_no_padding(SCREEN *sp) } #endif -static int (*my_outch) (int c) = _nc_outch; +#if NCURSES_SP_FUNCS +#define SetOutCh(func) if (SP_PARM) SP_PARM->_outch = func; else _nc_prescreen._outch = func +#define GetOutCh() (SP_PARM ? SP_PARM->_outch : _nc_prescreen._outch) +#else +#define SetOutCh(func) static_outch = func +#define GetOutCh() static_outch +static NCURSES_SP_OUTC static_outch = NCURSES_SP_NAME(_nc_outch); +#endif NCURSES_EXPORT(int) -delay_output(int ms) +NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) { - T((T_CALLED("delay_output(%d)"), ms)); + T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms)); + + if (!HasTInfoTerminal(SP_PARM)) + returnCode(ERR); if (no_pad_char) { - _nc_flush(); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); napms(ms); } else { + NCURSES_SP_OUTC my_outch = GetOutCh(); register int nullcount; nullcount = (ms * _nc_baudrate(ospeed)) / (BAUDBYTE * 1000); for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--) - my_outch(PC); - if (my_outch == _nc_outch) - _nc_flush(); + my_outch(NCURSES_SP_ARGx PC); + if (my_outch == NCURSES_SP_NAME(_nc_outch)) + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); } returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +delay_output(int ms) +{ + return NCURSES_SP_NAME(delay_output) (CURRENT_SCREEN, ms); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) +{ + (void) fflush(NC_OUTPUT(SP_PARM)); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_flush(void) { - (void) fflush(NC_OUTPUT); + NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN); } +#endif NCURSES_EXPORT(int) -_nc_outch(int ch) +NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) { + int rc = OK; + COUNT_OUTCHARS(1); - if (SP != 0 - && SP->_cleanup) { - char tmp = ch; + if (HasTInfoTerminal(SP_PARM) + && SP_PARM != 0 + && SP_PARM->_cleanup) { + char tmp = (char) ch; /* * POSIX says write() is safe in a signal handler, but the * buffered I/O is not. */ - write(fileno(NC_OUTPUT), &tmp, 1); + if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1) + rc = ERR; } else { - putc(ch, NC_OUTPUT); + if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF) + rc = ERR; } - return OK; + return rc; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outch(int ch) +{ + return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string) +{ + return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + string, 1, NCURSES_SP_NAME(_nc_outch)); +} + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx + const char *name GCC_UNUSED, + const char *string) +{ + int rc = ERR; + + if (string != 0) { + TPUTS_TRACE(name); + rc = NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx string); + } + return rc; +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) putp(const char *string) { - return tputs(string, 1, _nc_outch); + return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string); } NCURSES_EXPORT(int) -tputs(const char *string, int affcnt, int (*outc) (int)) +_nc_putp(const char *name, const char *string) { + return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, string); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx + const char *string, + int affcnt, + NCURSES_SP_OUTC outc) +{ + NCURSES_SP_OUTC my_outch = GetOutCh(); bool always_delay; bool normal_delay; int number; @@ -137,7 +215,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) char addrbuf[32]; if (USE_TRACEF(TRACE_TPUTS)) { - if (outc == _nc_outch) + if (outc == NCURSES_SP_NAME(_nc_outch)) (void) strcpy(addrbuf, "_nc_outch"); else (void) sprintf(addrbuf, "%p", outc); @@ -152,10 +230,19 @@ tputs(const char *string, int affcnt, int (*outc) (int)) } #endif /* TRACE */ + if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM)) + return ERR; + if (!VALID_STRING(string)) return ERR; - if (cur_term == 0) { + if ( +#if NCURSES_SP_FUNCS + (SP_PARM != 0 && SP_PARM->_term == 0) +#else + cur_term == 0 +#endif + ) { always_delay = FALSE; normal_delay = TRUE; } else { @@ -164,7 +251,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) !xon_xoff && padding_baud_rate #if NCURSES_NO_PADDING - && !GetNoPadding(SP) + && !GetNoPadding(SP_PARM) #endif && (_nc_baudrate(ospeed) >= padding_baud_rate); } @@ -198,24 +285,24 @@ tputs(const char *string, int affcnt, int (*outc) (int)) } #endif /* BSD_TPUTS */ - my_outch = outc; /* redirect delay_output() */ + SetOutCh(outc); /* redirect delay_output() */ while (*string) { if (*string != '$') - (*outc) (*string); + (*outc) (NCURSES_SP_ARGx *string); else { string++; if (*string != '<') { - (*outc) ('$'); + (*outc) (NCURSES_SP_ARGx '$'); if (*string) - (*outc) (*string); + (*outc) (NCURSES_SP_ARGx *string); } else { bool mandatory; string++; if ((!isdigit(UChar(*string)) && *string != '.') || !strchr(string, '>')) { - (*outc) ('$'); - (*outc) ('<'); + (*outc) (NCURSES_SP_ARGx '$'); + (*outc) (NCURSES_SP_ARGx '<'); continue; } @@ -250,7 +337,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) && (always_delay || normal_delay || mandatory)) - delay_output(number / 10); + NCURSES_SP_NAME(delay_output) (NCURSES_SP_ARGx number / 10); } /* endelse (*string == '<') */ } /* endelse (*string == '$') */ @@ -270,6 +357,25 @@ tputs(const char *string, int affcnt, int (*outc) (int)) delay_output(trailpad / 10); #endif /* BSD_TPUTS */ - my_outch = _nc_outch; + SetOutCh(my_outch); return OK; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outc_wrapper(SCREEN *sp, int c) +{ + if (0 == sp) { + return (ERR); + } else { + return sp->jump(c); + } +} + +NCURSES_EXPORT(int) +tputs(const char *string, int affcnt, int (*outc) (int)) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx string, affcnt, _nc_outc_wrapper); +} +#endif diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index a2b38a3327f..663a0689809 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -36,159 +36,246 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_ttyflags.c,v 1.18 2008/08/03 22:10:44 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_ttyflags.c,v 1.27 2010/12/25 23:43:58 tom Exp $") NCURSES_EXPORT(int) -_nc_get_tty_mode(TTY * buf) +NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; - if (buf == 0) { + if (buf == 0 || SP_PARM == 0) { result = ERR; } else { - if (cur_term == 0) { + TERMINAL *termp = TerminalOf(SP_PARM); + + if (0 == termp) { result = ERR; } else { +#ifdef USE_TERM_DRIVER + result = CallDriver_2(SP_PARM, sgmode, FALSE, buf); +#else for (;;) { - if (GET_TTY(cur_term->Filedes, buf) != 0) { + if (GET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; result = ERR; } break; } +#endif } if (result == ERR) memset(buf, 0, sizeof(*buf)); TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", - cur_term ? cur_term->Filedes : -1, + termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -_nc_set_tty_mode(TTY * buf) +_nc_get_tty_mode(TTY * buf) +{ + return NCURSES_SP_NAME(_nc_get_tty_mode) (CURRENT_SCREEN, buf); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; - if (buf == 0) { + if (buf == 0 || SP_PARM == 0) { result = ERR; } else { - if (cur_term == 0) { + TERMINAL *termp = TerminalOf(SP_PARM); + + if (0 == termp) { result = ERR; } else { +#ifdef USE_TERM_DRIVER + result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); +#else for (;;) { - if (SET_TTY(cur_term->Filedes, buf) != 0) { + if (SET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; - if ((errno == ENOTTY) && (SP != 0)) - SP->_notty = TRUE; + if ((errno == ENOTTY) && (SP_PARM != 0)) + SP_PARM->_notty = TRUE; result = ERR; } break; } +#endif } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", - cur_term ? cur_term->Filedes : -1, + termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -def_shell_mode(void) +_nc_set_tty_mode(TTY * buf) +{ + return NCURSES_SP_NAME(_nc_set_tty_mode) (CURRENT_SCREEN, buf); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) { int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_shell_mode()"))); + T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM)); - if (cur_term != 0) { + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, FALSE, TRUE); +#else /* * If XTABS was on, remove the tab and backtab capabilities. */ - if (_nc_get_tty_mode(&cur_term->Ottyb) == OK) { + if (_nc_get_tty_mode(&termp->Ottyb) == OK) { #ifdef TERMIOS - if (cur_term->Ottyb.c_oflag & OFLAGS_TABS) + if (termp->Ottyb.c_oflag & OFLAGS_TABS) tab = back_tab = NULL; #else - if (cur_term->Ottyb.sg_flags & XTABS) + if (termp->Ottyb.sg_flags & XTABS) tab = back_tab = NULL; #endif rc = OK; } +#endif } returnCode(rc); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -def_prog_mode(void) +def_shell_mode(void) +{ + return NCURSES_SP_NAME(def_shell_mode) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) { int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_prog_mode()"))); + T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM)); - if (cur_term != 0) { + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, TRUE, TRUE); +#else /* * Turn off the XTABS bit in the tty structure if it was on. */ - if (_nc_get_tty_mode(&cur_term->Nttyb) == OK) { + if (_nc_get_tty_mode(&termp->Nttyb) == OK) { #ifdef TERMIOS - cur_term->Nttyb.c_oflag &= ~OFLAGS_TABS; + termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); #else - cur_term->Nttyb.sg_flags &= ~XTABS; + termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif rc = OK; } +#endif } returnCode(rc); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +def_prog_mode(void) +{ + return NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) +{ + int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); + + T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, TRUE, FALSE); +#else + if (_nc_set_tty_mode(&termp->Nttyb) == OK) { + if (SP_PARM) { + if (SP_PARM->_keypad_on) + _nc_keypad(SP_PARM, TRUE); + NC_BUFFERED(SP_PARM, TRUE); + } + rc = OK; + } +#endif + } + returnCode(rc); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_prog_mode(void) { - T((T_CALLED("reset_prog_mode()"))); + return NCURSES_SP_NAME(reset_prog_mode) (CURRENT_SCREEN); +} +#endif - if (cur_term != 0) { - if (_nc_set_tty_mode(&cur_term->Nttyb) == OK) { - if (SP) { - if (SP->_keypad_on) - _nc_keypad(SP, TRUE); - NC_BUFFERED(TRUE); - } - returnCode(OK); +NCURSES_EXPORT(int) +NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) +{ + int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); + + T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, FALSE, FALSE); +#else + if (SP_PARM) { + _nc_keypad(SP_PARM, FALSE); + _nc_flush(); + NC_BUFFERED(SP_PARM, FALSE); } + rc = _nc_set_tty_mode(&termp->Ottyb); +#endif } - returnCode(ERR); + returnCode(rc); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_shell_mode(void) { - T((T_CALLED("reset_shell_mode()"))); - - if (cur_term != 0) { - if (SP) { - _nc_keypad(SP, FALSE); - _nc_flush(); - NC_BUFFERED(FALSE); - } - returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); - } - returnCode(ERR); + return NCURSES_SP_NAME(reset_shell_mode) (CURRENT_SCREEN); } +#endif static TTY * -saved_tty(void) +saved_tty(NCURSES_SP_DCL0) { TTY *result = 0; - if (SP != 0) { - result = &(SP->_saved_tty); + if (SP_PARM != 0) { + result = (TTY *) & (SP_PARM->_saved_tty); } else { if (_nc_prescreen.saved_tty == 0) { _nc_prescreen.saved_tty = typeCalloc(TTY, 1); @@ -204,17 +291,31 @@ saved_tty(void) */ NCURSES_EXPORT(int) -savetty(void) +NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0) { - T((T_CALLED("savetty()"))); - - returnCode(_nc_get_tty_mode(saved_tty())); + T((T_CALLED("savetty(%p)"), (void *) SP_PARM)); + returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +savetty(void) +{ + return NCURSES_SP_NAME(savetty) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0) +{ + T((T_CALLED("resetty(%p)"), (void *) SP_PARM)); + returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) resetty(void) { - T((T_CALLED("resetty()"))); - - returnCode(_nc_set_tty_mode(saved_tty())); + return NCURSES_SP_NAME(resetty) (CURRENT_SCREEN); } +#endif diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c new file mode 100644 index 00000000000..15c281def50 --- /dev/null +++ b/ncurses/tinfo/make_hash.c @@ -0,0 +1,294 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + ****************************************************************************/ + +/* + * make_hash.c --- build-time program for constructing comp_captab.c + * + */ + +#include + +#include +#include + +#include + +MODULE_ID("$Id: make_hash.c,v 1.3 2010/05/22 18:02:50 tom Exp $") + +/* + * _nc_make_hash_table() + * + * Takes the entries in table[] and hashes them into hash_table[] + * by name. There are CAPTABSIZE entries in table[] and HASHTABSIZE + * slots in hash_table[]. + * + */ + +#undef MODULE_ID +#define MODULE_ID(id) /*nothing */ +#include + +/* + * int hash_function(string) + * + * Computes the hashing function on the given string. + * + * The current hash function is the sum of each consectutive pair + * of characters, taken as two-byte integers, mod HASHTABSIZE. + * + */ + +static int +hash_function(const char *string) +{ + long sum = 0; + + while (*string) { + sum += (long) (*string + (*(string + 1) << 8)); + string++; + } + + return (int) (sum % HASHTABSIZE); +} + +static void +_nc_make_hash_table(struct name_table_entry *table, + HashValue * hash_table) +{ + short i; + int hashvalue; + int collisions = 0; + + for (i = 0; i < HASHTABSIZE; i++) { + hash_table[i] = -1; + } + for (i = 0; i < CAPTABSIZE; i++) { + hashvalue = hash_function(table[i].nte_name); + + if (hash_table[hashvalue] >= 0) + collisions++; + + if (hash_table[hashvalue] != 0) + table[i].nte_link = hash_table[hashvalue]; + hash_table[hashvalue] = i; + } + + printf("/* %d collisions out of %d entries */\n", collisions, CAPTABSIZE); +} + +/* + * This filter reads from standard input a list of tab-delimited columns, + * (e.g., from Caps.filtered) computes the hash-value of a specified column and + * writes the hashed tables to standard output. + * + * By compiling the hash table at build time, we're able to make the entire + * set of terminfo and termcap tables readonly (and also provide some runtime + * performance enhancement). + */ + +#define MAX_COLUMNS BUFSIZ /* this _has_ to be worst-case */ + +static char ** +parse_columns(char *buffer) +{ + static char **list; + + int col = 0; + + if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) + return (0); + + if (*buffer != '#') { + while (*buffer != '\0') { + char *s; + for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++) + /*EMPTY */ ; + if (s != buffer) { + char mark = *s; + *s = '\0'; + if ((s - buffer) > 1 + && (*buffer == '"') + && (s[-1] == '"')) { /* strip the quotes */ + assert(s > buffer + 1); + s[-1] = '\0'; + buffer++; + } + list[col] = buffer; + col++; + if (mark == '\0') + break; + while (*++s && isspace(UChar(*s))) + /*EMPTY */ ; + buffer = s; + } else + break; + } + } + return col ? list : 0; +} + +int +main(int argc, char **argv) +{ + struct name_table_entry *name_table = typeCalloc(struct + name_table_entry, CAPTABSIZE); + HashValue *hash_table = typeCalloc(HashValue, HASHTABSIZE); + const char *root_name = ""; + int column = 0; + int bigstring = 0; + int n; + char buffer[BUFSIZ]; + + static const char *typenames[] = + {"BOOLEAN", "NUMBER", "STRING"}; + + short BoolCount = 0; + short NumCount = 0; + short StrCount = 0; + + /* The first argument is the column-number (starting with 0). + * The second is the root name of the tables to generate. + */ + if (argc <= 3 + || (column = atoi(argv[1])) <= 0 + || (column >= MAX_COLUMNS) + || *(root_name = argv[2]) == 0 + || (bigstring = atoi(argv[3])) < 0 + || name_table == 0 + || hash_table == 0) { + fprintf(stderr, "usage: make_hash column root_name bigstring\n"); + exit(EXIT_FAILURE); + } + + /* + * Read the table into our arrays. + */ + for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) { + char **list, *nlp = strchr(buffer, '\n'); + if (nlp) + *nlp = '\0'; + list = parse_columns(buffer); + if (list == 0) /* blank or comment */ + continue; + name_table[n].nte_link = -1; /* end-of-hash */ + name_table[n].nte_name = strdup(list[column]); + if (!strcmp(list[2], "bool")) { + name_table[n].nte_type = BOOLEAN; + name_table[n].nte_index = BoolCount++; + } else if (!strcmp(list[2], "num")) { + name_table[n].nte_type = NUMBER; + name_table[n].nte_index = NumCount++; + } else if (!strcmp(list[2], "str")) { + name_table[n].nte_type = STRING; + name_table[n].nte_index = StrCount++; + } else { + fprintf(stderr, "Unknown type: %s\n", list[2]); + exit(EXIT_FAILURE); + } + n++; + } + _nc_make_hash_table(name_table, hash_table); + + /* + * Write the compiled tables to standard output + */ + if (bigstring) { + int len = 0; + int nxt; + + printf("static const char %s_names_text[] = \\\n", root_name); + for (n = 0; n < CAPTABSIZE; n++) { + nxt = (int) strlen(name_table[n].nte_name) + 5; + if (nxt + len > 72) { + printf("\\\n"); + len = 0; + } + printf("\"%s\\0\" ", name_table[n].nte_name); + len += nxt; + } + printf(";\n\n"); + + len = 0; + printf("static name_table_data const %s_names_data[] =\n", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n", + len, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + len += (int) strlen(name_table[n].nte_name) + 1; + } + printf("};\n\n"); + printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name); + } else { + + printf("static struct name_table_entry %s _nc_%s_table[] =\n", + bigstring ? "" : "const", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + sprintf(buffer, "\"%s\"", + name_table[n].nte_name); + printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n", + buffer, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + } + printf("};\n\n"); + } + + printf("static const HashValue _nc_%s_hash_table[%d] =\n", + root_name, + HASHTABSIZE + 1); + printf("{\n"); + for (n = 0; n < HASHTABSIZE; n++) { + printf("\t%3d,\n", hash_table[n]); + } + printf("\t0\t/* base-of-table */\n"); + printf("};\n\n"); + + printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n", + BoolCount, NumCount, StrCount); + printf("#error\t--> term.h and comp_captab.c disagree about the <--\n"); + printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); + printf("#endif\n\n"); + + free(hash_table); + return EXIT_SUCCESS; +} diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c index c084f87fb94..a7854e3fe60 100644 --- a/ncurses/tinfo/make_keys.c +++ b/ncurses/tinfo/make_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,18 +37,18 @@ */ #define USE_TERMLIB 1 -#include +#include -MODULE_ID("$Id: make_keys.c,v 1.14 2008/08/03 21:57:22 tom Exp $") +MODULE_ID("$Id: make_keys.c,v 1.19 2010/06/05 22:08:00 tom Exp $") #include -#define UNKNOWN (SIZEOF(strnames) + SIZEOF(strfnames)) +#define UNKNOWN (unsigned) (SIZEOF(strnames) + SIZEOF(strfnames)) -static size_t +static unsigned lookup(const char *name) { - size_t n; + unsigned n; bool found = FALSE; for (n = 0; strnames[n] != 0; n++) { if (!strcmp(name, strnames[n])) { @@ -73,7 +73,7 @@ make_keys(FILE *ifp, FILE *ofp) char buffer[BUFSIZ]; char from[256]; char to[256]; - int maxlen = 16; + unsigned maxlen = 16; int scanned; while (fgets(buffer, sizeof(buffer), ifp) != 0) { @@ -85,14 +85,14 @@ make_keys(FILE *ifp, FILE *ofp) scanned = sscanf(buffer, "%255s %255s", to, from); if (scanned == 2) { - int code = lookup(from); + unsigned code = lookup(from); if (code == UNKNOWN) continue; - if ((int) strlen(from) > maxlen) - maxlen = strlen(from); - fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n", + if (strlen(from) > maxlen) + maxlen = (unsigned) strlen(from); + fprintf(ofp, "\t{ %4u, %-*.*s },\t/* %s */\n", code, - maxlen, maxlen, + (int) maxlen, (int) maxlen, to, from); } diff --git a/ncurses/tinfo/name_match.c b/ncurses/tinfo/name_match.c index d576901fa2e..a9ac6427888 100644 --- a/ncurses/tinfo/name_match.c +++ b/ncurses/tinfo/name_match.c @@ -31,10 +31,9 @@ ****************************************************************************/ #include -#include #include -MODULE_ID("$Id: name_match.c,v 1.17 2008/08/03 19:49:33 tom Exp $") +MODULE_ID("$Id: name_match.c,v 1.18 2008/11/16 00:19:59 juergen Exp $") /* * _nc_first_name(char *names) diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c index cf7a5f409d7..ddbc25204fe 100644 --- a/ncurses/tinfo/parse_entry.c +++ b/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -46,9 +46,8 @@ #include #include -#include -MODULE_ID("$Id: parse_entry.c,v 1.69 2008/08/16 21:52:03 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -84,13 +83,13 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) case NUMBER: first = tp->ext_Booleans; last = tp->ext_Numbers + first; - offset = tp->ext_Booleans + tp->ext_Numbers; + offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); tindex = tp->num_Numbers; break; case STRING: - first = tp->ext_Booleans + tp->ext_Numbers; + first = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); last = tp->ext_Strings + first; - offset = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings; + offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings); tindex = tp->num_Strings; break; case CANCEL: @@ -137,27 +136,31 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) break; } } + +#define for_each_value(max) \ + for (last = (unsigned) (max - 1); last > tindex; last--) + if (!found) { switch (token_type) { case BOOLEAN: - tp->ext_Booleans += 1; - tp->num_Booleans += 1; + tp->ext_Booleans++; + tp->num_Booleans++; tp->Booleans = typeRealloc(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans); - for (last = tp->num_Booleans - 1; last > tindex; last--) + for_each_value(tp->num_Booleans) tp->Booleans[last] = tp->Booleans[last - 1]; break; case NUMBER: - tp->ext_Numbers += 1; - tp->num_Numbers += 1; + tp->ext_Numbers++; + tp->num_Numbers++; tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers); - for (last = tp->num_Numbers - 1; last > tindex; last--) + for_each_value(tp->num_Numbers) tp->Numbers[last] = tp->Numbers[last - 1]; break; case STRING: - tp->ext_Strings += 1; - tp->num_Strings += 1; + tp->ext_Strings++; + tp->num_Strings++; tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings); - for (last = tp->num_Strings - 1; last > tindex; last--) + for_each_value(tp->num_Strings) tp->Strings[last] = tp->Strings[last - 1]; break; } @@ -170,7 +173,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) temp.nte_name = tp->ext_Names[offset]; temp.nte_type = token_type; - temp.nte_index = tindex; + temp.nte_index = (short) tindex; temp.nte_link = -1; return &temp; @@ -379,16 +382,14 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) && !strcmp("ma", _nc_curr_token.tk_name)) { /* tell max_attributes from arrow_key_map */ entry_ptr = _nc_find_type_entry("ma", NUMBER, - _nc_get_table(_nc_syntax - != 0)); + _nc_syntax != 0); assert(entry_ptr != 0); } else if (token_type == STRING && !strcmp("MT", _nc_curr_token.tk_name)) { /* map terminfo's string MT to MT */ entry_ptr = _nc_find_type_entry("MT", STRING, - _nc_get_table(_nc_syntax - != 0)); + _nc_syntax != 0); assert(entry_ptr != 0); } else if (token_type == BOOLEAN @@ -444,7 +445,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) case NUMBER: entryp->tterm.Numbers[entry_ptr->nte_index] = - _nc_curr_token.tk_valnumber; + (short) _nc_curr_token.tk_valnumber; break; case STRING: @@ -510,9 +511,9 @@ NCURSES_EXPORT(int) _nc_capcmp(const char *s, const char *t) /* compare two string capabilities, stripping out padding */ { - if (!s && !t) + if (!VALID_STRING(s) && !VALID_STRING(t)) return (0); - else if (!s || !t) + else if (!VALID_STRING(s) || !VALID_STRING(t)) return (1); for (;;) { @@ -667,7 +668,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) else if (PRESENT(backspace_if_not_bs)) cursor_left = backspace_if_not_bs; } - /* vi doesn't use "do", but it does seems to use nl (or '\n') instead */ + /* vi doesn't use "do", but it does seem to use nl (or '\n') instead */ if (WANTED(cursor_down)) { if (PRESENT(linefeed_if_not_lf)) cursor_down = linefeed_if_not_lf; @@ -772,7 +773,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) * isn't from mytinfo... */ if (PRESENT(other_non_function_keys)) { - char *base = other_non_function_keys; + char *base; char *bp, *cp, *dp; struct name_table_entry const *from_ptr; struct name_table_entry const *to_ptr; @@ -788,7 +789,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) for (base = other_non_function_keys; (cp = strchr(base, ',')) != 0; base = cp + 1) { - size_t len = cp - base; + size_t len = (unsigned) (cp - base); for (ap = ko_xlate; ap->from; ap++) { if (len == strlen(ap->from) @@ -840,7 +841,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) } else *dp++ = *bp; } - *dp++ = '\0'; + *dp = '\0'; tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2); } diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index b4ea61ca194..e38b9cbe49d 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,9 +40,8 @@ #include #include -#include -MODULE_ID("$Id: read_entry.c,v 1.102 2008/08/03 19:33:04 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.108 2011/02/26 15:36:06 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -57,7 +56,7 @@ convert_shorts(char *buf, short *Numbers, int count) else if (IS_NEG2(buf + 2 * i)) Numbers[i] = CANCELLED_NUMERIC; else - Numbers[i] = LOW_MSB(buf + 2 * i); + Numbers[i] = (short) LOW_MSB(buf + 2 * i); TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i])); } } @@ -99,9 +98,9 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) if (have > 0) { if ((int) want > have) - want = have; + want = (unsigned) have; memcpy(dst, src + *offset, want); - *offset += want; + *offset += (int) want; } else { want = 0; } @@ -155,7 +154,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) return (TGETENT_NO); } - want = str_size + name_size + 1; + want = (unsigned) (str_size + name_size + 1); if (str_size) { /* try to allocate space for the string table */ if (str_count * 2 >= (int) sizeof(buf) @@ -173,14 +172,14 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) want = min(MAX_NAME_SIZE, (unsigned) name_size); ptr->str_table = string_table; ptr->term_names = string_table; - if ((have = Read(ptr->term_names, want)) != want) { + if ((have = (unsigned) Read(ptr->term_names, want)) != want) { memset(ptr->term_names + have, 0, want - have); } ptr->term_names[want] = '\0'; string_table += (want + 1); if (have > MAX_NAME_SIZE) - offset = (have - MAX_NAME_SIZE); + offset = (int) (have - MAX_NAME_SIZE); /* grab the booleans */ if ((ptr->Booleans = TYPE_CALLOC(NCURSES_SBOOL, @@ -234,7 +233,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) int ext_str_count = LOW_MSB(buf + 4); int ext_str_size = LOW_MSB(buf + 6); int ext_str_limit = LOW_MSB(buf + 8); - unsigned need = (ext_bool_count + ext_num_count + ext_str_count); + unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count); int base = 0; if (need >= sizeof(buf) @@ -247,9 +246,9 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) || ext_str_limit < 0) return (TGETENT_NO); - ptr->num_Booleans = BOOLCOUNT + ext_bool_count; - ptr->num_Numbers = NUMCOUNT + ext_num_count; - ptr->num_Strings = STRCOUNT + ext_str_count; + ptr->num_Booleans = UShort(BOOLCOUNT + ext_bool_count); + ptr->num_Numbers = UShort(NUMCOUNT + ext_num_count); + ptr->num_Strings = UShort(STRCOUNT + ext_str_count); ptr->Booleans = typeRealloc(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans); ptr->Numbers = typeRealloc(short, ptr->num_Numbers, ptr->Numbers); @@ -261,7 +260,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-booleans @%d", ext_bool_count, offset)); - if ((ptr->ext_Booleans = ext_bool_count) != 0) { + if ((ptr->ext_Booleans = UShort(ext_bool_count)) != 0) { if (Read(ptr->Booleans + BOOLCOUNT, (unsigned) ext_bool_count) != ext_bool_count) return (TGETENT_NO); @@ -270,7 +269,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-numbers @%d", ext_num_count, offset)); - if ((ptr->ext_Numbers = ext_num_count) != 0) { + if ((ptr->ext_Numbers = UShort(ext_num_count)) != 0) { if (!read_shorts(buf, ext_num_count)) return (TGETENT_NO); TR(TRACE_DATABASE, ("Before converting extended-numbers")); @@ -279,21 +278,22 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset)); if ((ext_str_count || need) - && !read_shorts(buf, ext_str_count + need)) + && !read_shorts(buf, ext_str_count + (int) need)) return (TGETENT_NO); TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d", ext_str_limit, offset)); if (ext_str_limit) { - if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0) - return (TGETENT_NO); + ptr->ext_str_table = typeMalloc(char, (size_t) ext_str_limit); + if (ptr->ext_str_table == 0) + return (TGETENT_NO); if (Read(ptr->ext_str_table, (unsigned) ext_str_limit) != ext_str_limit) return (TGETENT_NO); TR(TRACE_DATABASE, ("first extended-string is %s", _nc_visbuf(ptr->ext_str_table))); } - if ((ptr->ext_Strings = ext_str_count) != 0) { + if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) { TR(TRACE_DATABASE, ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d", str_count, ext_str_count)); @@ -305,7 +305,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) _nc_visbuf(ptr->Strings[i + str_count]))); ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count]; if (VALID_STRING(ptr->Strings[i + STRCOUNT])) - base += (strlen(ptr->Strings[i + STRCOUNT]) + 1); + base += (int) (strlen(ptr->Strings[i + STRCOUNT]) + 1); TR(TRACE_DATABASE, ("... to [%d] %s", i + STRCOUNT, _nc_visbuf(ptr->Strings[i + STRCOUNT]))); @@ -314,7 +314,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) if (need) { if (ext_str_count >= (MAX_ENTRY_SIZE * 2)) - return (TGETENT_NO); + return (TGETENT_NO); if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0) return (TGETENT_NO); TR(TRACE_DATABASE, @@ -364,16 +364,18 @@ NCURSES_EXPORT(int) _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) /* return 1 if read, 0 if not found or garbled */ { - int code, fd = -1; + FILE *fp = 0; + int code; int limit; char buffer[MAX_ENTRY_SIZE + 1]; if (_nc_access(filename, R_OK) < 0 - || (fd = open(filename, O_RDONLY | O_BINARY)) < 0) { + || (fp = fopen(filename, "rb")) == 0) { T(("cannot open terminfo %s (errno=%d)", filename, errno)); code = TGETENT_NO; } else { - if ((limit = read(fd, buffer, sizeof(buffer))) > 0) { + if ((limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp)) + > 0) { T(("read terminfo %s", filename)); if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) { @@ -382,7 +384,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) } else { code = TGETENT_NO; } - close(fd); + fclose(fp); } return (code); @@ -404,26 +406,22 @@ _nc_read_tic_entry(char *filename, /* * If we are looking in a directory, assume the entry is a file under that, * according to the normal rules. - * - * FIXME - add caseless-filename fixup. */ - if (_nc_is_dir_path(path)) { - unsigned need = 4 + strlen(path) + strlen(name); + unsigned need = (unsigned) (LEAF_LEN + 3 + strlen(path) + strlen(name)); + if (need <= limit) + (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); - if (need <= limit) { - (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); - result = _nc_read_file_entry(filename, tp); - } - } + if (_nc_is_dir_path(path)) + result = _nc_read_file_entry(filename, tp); #if USE_HASHED_DB else { static const char suffix[] = DBM_SUFFIX; DB *capdbp; unsigned lens = sizeof(suffix) - 1; unsigned size = strlen(path); - unsigned need = lens + size; + unsigned test = lens + size; - if (need <= limit) { + if (test < limit) { if (size >= lens && !strcmp(path + size - lens, suffix)) (void) strcpy(filename, path); @@ -515,6 +513,7 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) { int code = TGETENT_NO; + sprintf(filename, "%.*s", PATH_MAX - 1, name); if (strlen(name) == 0 || strcmp(name, ".") == 0 || strcmp(name, "..") == 0 diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index d94d1a42466..b39a5bebaa4 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -56,9 +56,8 @@ #include #include #include -#include -MODULE_ID("$Id: read_termcap.c,v 1.71 2006/07/29 12:06:51 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.74 2010/01/23 17:57:43 tom Exp $") #if !PURE_TERMINFO @@ -79,6 +78,15 @@ get_termpath(void) return result; } +/* + * Note: + * getcap(), cgetent(), etc., are BSD functions. A copy of those was added to + * this file in November 1995, derived from the BSD4.4 Lite sources. + * + * The initial adaptation uses 518 lines from that source. + * The current source (in 2009) uses 183 lines of BSD4.4 Lite (441 ignoring + * whitespace). + */ #if USE_GETCAP #if HAVE_BSD_CGETENT @@ -107,11 +115,7 @@ static int _nc_nfcmp(const char *, char *); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgment: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/ncurses/tinfo/setbuf.c b/ncurses/tinfo/setbuf.c index ba910e8983a..a2e2660c866 100644 --- a/ncurses/tinfo/setbuf.c +++ b/ncurses/tinfo/setbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ /* @@ -40,7 +42,7 @@ #include -MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") +MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -98,11 +100,20 @@ MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") * buffer. So we disable this by default (there may yet be a workaround). */ NCURSES_EXPORT(void) -_nc_set_buffer(FILE *ofp, bool buffered) +NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) { + int Cols; + int Lines; + + if (0 == SP_PARM) + return; + + Cols = *(ptrCols(SP_PARM)); + Lines = *(ptrLines(SP_PARM)); + /* optional optimization hack -- do before any output to ofp */ #if HAVE_SETVBUF || HAVE_SETBUFFER - if (SP->_buffered != buffered) { + if (SP_PARM->_buffered != buffered) { unsigned buf_len; char *buf_ptr; @@ -114,11 +125,11 @@ _nc_set_buffer(FILE *ofp, bool buffered) setmode(ofp, O_BINARY); #endif if (buffered != 0) { - buf_len = min(LINES * (COLS + 6), 2800); - if ((buf_ptr = SP->_setbuf) == 0) { + buf_len = (unsigned) min(Lines * (Cols + 6), 2800); + if ((buf_ptr = SP_PARM->_setbuf) == 0) { if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) return; - SP->_setbuf = buf_ptr; + SP_PARM->_setbuf = buf_ptr; /* Don't try to free this! */ } #if !USE_SETBUF_0 @@ -144,7 +155,15 @@ _nc_set_buffer(FILE *ofp, bool buffered) (void) setbuffer(ofp, buf_ptr, (int) buf_len); #endif - SP->_buffered = buffered; + SP_PARM->_buffered = buffered; } #endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_set_buffer(FILE *ofp, bool buffered) +{ + NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered); +} +#endif diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c new file mode 100644 index 00000000000..5b3b55a4519 --- /dev/null +++ b/ncurses/tinfo/tinfo_driver.c @@ -0,0 +1,1337 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,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"), 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: Juergen Pfeifer * + * * + ****************************************************************************/ + +#include +#define CUR ((TERMINAL*)TCB)->type. +#include + +#if HAVE_NANOSLEEP +#include +#if HAVE_SYS_TIME_H +#include /* needed for MacOS X DP3 */ +#endif +#endif + +#if HAVE_SIZECHANGE +# if !defined(sun) || !TERMIOS +# if HAVE_SYS_IOCTL_H +# include +# endif +# endif +#endif + +MODULE_ID("$Id: tinfo_driver.c,v 1.13 2010/12/20 01:47:09 tom Exp $") + +/* + * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, + * Solaris, IRIX) define TIOCGWINSZ and struct winsize. + */ +#ifdef TIOCGSIZE +# define IOCTL_WINSIZE TIOCGSIZE +# define STRUCT_WINSIZE struct ttysize +# define WINSIZE_ROWS(n) (int)n.ts_lines +# define WINSIZE_COLS(n) (int)n.ts_cols +#else +# ifdef TIOCGWINSZ +# define IOCTL_WINSIZE TIOCGWINSZ +# define STRUCT_WINSIZE struct winsize +# define WINSIZE_ROWS(n) (int)n.ws_row +# define WINSIZE_COLS(n) (int)n.ws_col +# endif +#endif + +/* + * These should be screen structure members. They need to be globals for + * historical reasons. So we assign them in start_color() and also in + * set_term()'s screen-switching logic. + */ +#if USE_REENTRANT +NCURSES_EXPORT(int) +NCURSES_PUBLIC_VAR(COLOR_PAIRS) (void) +{ + return CURRENT_SCREEN ? CURRENT_SCREEN->_pair_count : -1; +} +NCURSES_EXPORT(int) +NCURSES_PUBLIC_VAR(COLORS) (void) +{ + return CURRENT_SCREEN ? CURRENT_SCREEN->_color_count : -1; +} +#else +NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; +NCURSES_EXPORT_VAR(int) COLORS = 0; +#endif + +#define TCBMAGIC NCDRV_MAGIC(NCDRV_TINFO) +#define AssertTCB() assert(TCB!=0 && TCB->magic==TCBMAGIC) +#define SetSP() assert(TCB->csp!=0); sp = TCB->csp + +/* + * This routine needs to do all the work to make curscr look + * like newscr. + */ +static int +drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + AssertTCB(); + return TINFO_DOUPDATE(TCB->csp); +} + +#define ret_error(code, fmt, arg) if (errret) {\ + *errret = code;\ + return(FALSE); \ + } else {\ + fprintf(stderr, fmt, arg);\ + exit(EXIT_FAILURE);\ + } + +#define ret_error0(code, msg) if (errret) {\ + *errret = code;\ + return(FALSE);\ + } else {\ + fprintf(stderr, msg);\ + exit(EXIT_FAILURE);\ + } + +static bool +drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) +{ + bool result = FALSE; + int status; + TERMINAL *termp; + SCREEN *sp; + + assert(TCB != 0 && tname != 0); + termp = (TERMINAL *) TCB; + sp = TCB->csp; + TCB->magic = TCBMAGIC; + +#if (USE_DATABASE || USE_TERMCAP) + status = _nc_setup_tinfo(tname, &termp->type); +#else + status = TGETENT_NO; +#endif + + /* try fallback list if entry on disk */ + if (status != TGETENT_YES) { + const TERMTYPE *fallback = _nc_fallback(tname); + + if (fallback) { + termp->type = *fallback; + status = TGETENT_YES; + } + } + + if (status != TGETENT_YES) { + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp); + if (status == TGETENT_ERR) { + ret_error0(status, "terminals database is inaccessible\n"); + } else if (status == TGETENT_NO) { + ret_error(status, "'%s': unknown terminal type.\n", tname); + } + } + result = TRUE; +#if !USE_REENTRANT + strncpy(ttytype, termp->type.term_names, NAMESIZE - 1); + ttytype[NAMESIZE - 1] = '\0'; +#endif + + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); + + if (generic_type) { + ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); + } + if (hard_copy) { + ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); + } + + return result; +} + +static int +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bool beepFlag) +{ + SCREEN *sp; + int res = ERR; + + AssertTCB(); + SetSP(); + + /* FIXME: should make sure that we are not in altchar mode */ + if (beepFlag) { + if (bell) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); + NCURSES_SP_NAME(_nc_flush) (sp); + } else if (flash_screen) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "flash_screen", + flash_screen); + NCURSES_SP_NAME(_nc_flush) (sp); + } + } else { + if (flash_screen) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "flash_screen", + flash_screen); + NCURSES_SP_NAME(_nc_flush) (sp); + } else if (bell) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); + NCURSES_SP_NAME(_nc_flush) (sp); + } + } + return res; +} + +/* + * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly + * to maintain compatibility with a pre-ANSI scheme. The same scheme is + * also used in the FreeBSD syscons. + */ +static int +toggled_colors(int c) +{ + if (c < 16) { + static const int table[] = + {0, 4, 2, 6, 1, 5, 3, 7, + 8, 12, 10, 14, 9, 13, 11, 15}; + c = table[c]; + } + return c; +} + +static int +drv_print(TERMINAL_CONTROL_BLOCK * TCB, char *data, int len) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +#if NCURSES_EXT_FUNCS + return NCURSES_SP_NAME(mcprint) (TCB->csp, data, len); +#else + return ERR; +#endif +} + +static int +drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, int fg, int bg) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + if (sp != 0 && orig_pair && orig_colors && (initialize_pair != 0)) { +#if NCURSES_EXT_FUNCS + sp->_default_color = isDefaultColor(fg) || isDefaultColor(bg); + sp->_has_sgr_39_49 = (NCURSES_SP_NAME(tigetflag) (NCURSES_SP_ARGx + "AX") + == TRUE); + sp->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK); + sp->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK); + if (sp->_color_pairs != 0) { + bool save = sp->_default_color; + sp->_default_color = TRUE; + NCURSES_SP_NAME(init_pair) (NCURSES_SP_ARGx + 0, + (short)fg, + (short)bg); + sp->_default_color = save; + } +#endif + code = OK; + } + return (code); +} + +static void +drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + bool fore, + int color, + NCURSES_SP_OUTC outc) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (fore) { + if (set_a_foreground) { + TPUTS_TRACE("set_a_foreground"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_a_foreground, color), 1, outc); + } else { + TPUTS_TRACE("set_foreground"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_foreground, + toggled_colors(color)), 1, outc); + } + } else { + if (set_a_background) { + TPUTS_TRACE("set_a_background"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_a_background, color), 1, outc); + } else { + TPUTS_TRACE("set_background"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_background, + toggled_colors(color)), 1, outc); + } + } +} + +static bool +drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (orig_pair != 0) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair); + result = TRUE; + } + return result; +} + +static bool +drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (orig_colors != 0) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors); + result = TRUE; + } + return result; +} + +static int +drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) +{ + SCREEN *sp; + bool useEnv = TRUE; + + AssertTCB(); + sp = TCB->csp; /* can be null here */ + + if (sp) { + useEnv = sp->_use_env; + } else + useEnv = _nc_prescreen.use_env; + + /* figure out the size of the screen */ + T(("screen size: terminfo lines = %d columns = %d", lines, columns)); + + *linep = (int) lines; + *colp = (int) columns; + + if (useEnv) { + int value; + +#ifdef __EMX__ + { + int screendata[2]; + _scrsize(screendata); + *colp = screendata[0]; + *linep = screendata[1]; + T(("EMX screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + } +#endif +#if HAVE_SIZECHANGE + /* try asking the OS */ + { + TERMINAL *termp = (TERMINAL *) TCB; + if (isatty(termp->Filedes)) { + STRUCT_WINSIZE size; + + errno = 0; + do { + if (ioctl(termp->Filedes, IOCTL_WINSIZE, &size) >= 0) { + *linep = ((sp != 0 && sp->_filtered) + ? 1 + : WINSIZE_ROWS(size)); + *colp = WINSIZE_COLS(size); + T(("SYS screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + break; + } + } while + (errno == EINTR); + } + } +#endif /* HAVE_SIZECHANGE */ + + /* + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. + */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); + } + + /* if we can't get dynamic info about the size, use static */ + if (*linep <= 0) { + *linep = (int) lines; + } + if (*colp <= 0) { + *colp = (int) columns; + } + + /* the ultimate fallback, assume fixed 24x80 size */ + if (*linep <= 0) { + *linep = 24; + } + if (*colp <= 0) { + *colp = 80; + } + + /* + * Put the derived values back in the screen-size caps, so + * tigetnum() and tgetnum() will do the right thing. + */ + lines = (short) (*linep); + columns = (short) (*colp); + } + + T(("screen size is %dx%d", *linep, *colp)); + return OK; +} + +static int +drv_getsize(TERMINAL_CONTROL_BLOCK * TCB, int *l, int *c) +{ + AssertTCB(); + assert(l != 0 && c != 0); + *l = lines; + *c = columns; + return OK; +} + +static int +drv_setsize(TERMINAL_CONTROL_BLOCK * TCB, int l, int c) +{ + AssertTCB(); + lines = (short) l; + columns = (short) c; + return OK; +} + +static int +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +{ + SCREEN *sp = TCB->csp; + TERMINAL *_term = (TERMINAL *) TCB; + int result = OK; + + AssertTCB(); + if (setFlag) { + for (;;) { + if (SET_TTY(_term->Filedes, buf) != 0) { + if (errno == EINTR) + continue; + if (errno == ENOTTY) { + if (sp) + sp->_notty = TRUE; + } + result = ERR; + } + break; + } + } else { + for (;;) { + if (GET_TTY(_term->Filedes, buf) != 0) { + if (errno == EINTR) + continue; + result = ERR; + } + break; + } + } + return result; +} + +static int +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + if (progFlag) /* prog mode */ + { + if (defFlag) { + /* def_prog_mode */ + /* + * Turn off the XTABS bit in the tty structure if it was on. + */ + if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { +#ifdef TERMIOS + _term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS; +#else + _term->Nttyb.sg_flags &= (unsigned) ~XTABS; +#endif + code = OK; + } + } else { + /* reset_prog_mode */ + if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + NC_BUFFERED(sp, TRUE); + } + code = OK; + } + } + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + /* + * If XTABS was on, remove the tab and backtab capabilities. + */ + if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { +#ifdef TERMIOS + if (_term->Ottyb.c_oflag & OFLAGS_TABS) + tab = back_tab = NULL; +#else + if (_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; +#endif + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + NC_BUFFERED(sp, FALSE); + } + code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + } + } + return (code); +} + +static void +drv_wrap(SCREEN *sp) +{ + if (sp) { + sp->_mouse_wrap(sp); + NCURSES_SP_NAME(_nc_screen_wrap) (sp); + NCURSES_SP_NAME(_nc_mvcur_wrap) (sp); /* wrap up cursor addressing */ + } +} + +static void +drv_release(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ +} + +# define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) + +static void +drv_screen_init(SCREEN *sp) +{ + TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp); + + AssertTCB(); + + /* + * Check for mismatched graphic-rendition capabilities. Most SVr4 + * terminfo trees contain entries that have rmul or rmso equated to + * sgr0 (Solaris curses copes with those entries). We do this only + * for curses, since many termcap applications assume that + * smso/rmso and smul/rmul are paired, and will not function + * properly if we remove rmso or rmul. Curses applications + * shouldn't be looking at this detail. + */ + sp->_use_rmso = SGR0_TEST(exit_standout_mode); + sp->_use_rmul = SGR0_TEST(exit_underline_mode); + + /* + * Check whether we can optimize scrolling under dumb terminals in + * case we do not have any of these capabilities, scrolling + * optimization will be useless. + */ + sp->_scrolling = ((scroll_forward && scroll_reverse) || + ((parm_rindex || + parm_insert_line || + insert_line) && + (parm_index || + parm_delete_line || + delete_line))); + + NCURSES_SP_NAME(baudrate) (sp); + + NCURSES_SP_NAME(_nc_mvcur_init) (sp); + /* initialize terminal to a sane state */ + NCURSES_SP_NAME(_nc_screen_init) (sp); +} + +static void +drv_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + TERMINAL *trm; + + AssertTCB(); + + trm = (TERMINAL *) TCB; + sp = TCB->csp; + + TCB->info.initcolor = initialize_color; + TCB->info.canchange = can_change; + TCB->info.hascolor = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs) + && (((set_foreground != NULL) + && (set_background != NULL)) + || ((set_a_foreground != NULL) + && (set_a_background != NULL)) + || set_color_pair)) ? TRUE : FALSE); + + TCB->info.caninit = !(exit_ca_mode && non_rev_rmcup); + + TCB->info.maxpairs = VALID_NUMERIC(max_pairs) ? max_pairs : 0; + TCB->info.maxcolors = VALID_NUMERIC(max_colors) ? max_colors : 0; + TCB->info.numlabels = VALID_NUMERIC(num_labels) ? num_labels : 0; + TCB->info.labelwidth = VALID_NUMERIC(label_width) ? label_width : 0; + TCB->info.labelheight = VALID_NUMERIC(label_height) ? label_height : 0; + TCB->info.nocolorvideo = VALID_NUMERIC(no_color_video) ? no_color_video + : 0; + TCB->info.tabsize = VALID_NUMERIC(init_tabs) ? (int) init_tabs : 8; + + TCB->info.defaultPalette = hue_lightness_saturation ? _nc_hls_palette : _nc_cga_palette; + + /* + * If an application calls setupterm() rather than initscr() or + * newterm(), we will not have the def_prog_mode() call in + * _nc_setupscreen(). Do it now anyway, so we can initialize the + * baudrate. + */ + if (isatty(trm->Filedes)) { + TCB->drv->mode(TCB, TRUE, TRUE); + } +} + +#define MAX_PALETTE 8 +#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE) + +static void +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, short pair, short f, short b) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if ((initialize_pair != NULL) && InPalette(f) && InPalette(b)) { + const color_t *tp = InfoOf(sp).defaultPalette; + + TR(TRACE_ATTRS, + ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)", + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); + + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "initialize_pair", + TPARM_7(initialize_pair, + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); + } +} + +static int +default_fg(SCREEN *sp) +{ +#if NCURSES_EXT_FUNCS + return (sp != 0) ? sp->_default_fg : COLOR_WHITE; +#else + return COLOR_WHITE; +#endif +} + +static int +default_bg(SCREEN *sp) +{ +#if NCURSES_EXT_FUNCS + return sp != 0 ? sp->_default_bg : COLOR_BLACK; +#else + return COLOR_BLACK; +#endif +} + +static void +drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + short color, short r, short g, short b) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (initialize_color != NULL) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "initialize_color", + TPARM_4(initialize_color, color, r, g, b)); + } +} + +static void +drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, + short old_pair, + short pair, + bool reverse, + NCURSES_SP_OUTC outc) +{ + SCREEN *sp = TCB->csp; + NCURSES_COLOR_T fg = COLOR_DEFAULT; + NCURSES_COLOR_T bg = COLOR_DEFAULT; + NCURSES_COLOR_T old_fg, old_bg; + + AssertTCB(); + if (sp == 0) + return; + + if (pair < 0 || pair >= COLOR_PAIRS) { + return; + } else if (pair != 0) { + if (set_color_pair) { + TPUTS_TRACE("set_color_pair"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_color_pair, pair), 1, outc); + return; + } else if (sp != 0) { + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, + &bg); + } + } + + if (old_pair >= 0 + && sp != 0 + && NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + old_pair, + &old_fg, + &old_bg) !=ERR) { + if ((isDefaultColor(fg) && !isDefaultColor(old_fg)) + || (isDefaultColor(bg) && !isDefaultColor(old_bg))) { +#if NCURSES_EXT_FUNCS + /* + * A minor optimization - but extension. If "AX" is specified in + * the terminal description, treat it as screen's indicator of ECMA + * SGR 39 and SGR 49, and assume the two sequences are independent. + */ + if (sp->_has_sgr_39_49 + && isDefaultColor(old_bg) + && !isDefaultColor(old_fg)) { + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc); + } else if (sp->_has_sgr_39_49 + && isDefaultColor(old_fg) + && !isDefaultColor(old_bg)) { + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc); + } else +#endif + drv_rescol(TCB); + } + } else { + drv_rescol(TCB); + if (old_pair < 0) + return; + } + +#if NCURSES_EXT_FUNCS + if (isDefaultColor(fg)) + fg = (NCURSES_COLOR_T) default_fg(sp); + if (isDefaultColor(bg)) + bg = (NCURSES_COLOR_T) default_bg(sp); +#endif + + if (reverse) { + NCURSES_COLOR_T xx = fg; + fg = bg; + bg = xx; + } + + TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, + fg, bg)); + + if (!isDefaultColor(fg)) { + drv_setcolor(TCB, TRUE, fg, outc); + } + if (!isDefaultColor(bg)) { + drv_setcolor(TCB, FALSE, bg, outc); + } +} + +#define xterm_kmous "\033[M" +static void +init_xterm_mouse(SCREEN *sp) +{ + sp->_mouse_type = M_XTERM; + sp->_mouse_xtermcap = NCURSES_SP_NAME(tigetstr) (NCURSES_SP_ARGx "XM"); + if (!VALID_STRING(sp->_mouse_xtermcap)) + sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;"; +} + +static void +drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + /* we know how to recognize mouse events under "xterm" */ + if (sp != 0) { + if (key_mouse != 0) { + if (!strcmp(key_mouse, xterm_kmous) + || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { + init_xterm_mouse(sp); + } + } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { + if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK) + init_xterm_mouse(sp); + } + } +} + +static int +drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) +{ + int rc = 0; + SCREEN *sp; + + AssertTCB(); + SetSP(); + +#if USE_SYSMOUSE + if ((sp->_mouse_type == M_SYSMOUSE) + && (sp->_sysmouse_head < sp->_sysmouse_tail)) { + rc = TW_MOUSE; + } else +#endif + { + rc = TCBOf(sp)->drv->twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); +#if USE_SYSMOUSE + if ((sp->_mouse_type == M_SYSMOUSE) + && (sp->_sysmouse_head < sp->_sysmouse_tail) + && (rc == 0) + && (errno == EINTR)) { + rc |= TW_MOUSE; + } +#endif + } + return rc; +} + +static int +drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew) +{ + SCREEN *sp = TCB->csp; + AssertTCB(); + return TINFO_MVCUR(sp, yold, xold, ynew, xnew); +} + +static void +drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (labnum > 0 && labnum <= num_labels) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "plab_norm", + TPARM_2(plab_norm, labnum, text)); + } +} + +static void +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, bool OnFlag) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (OnFlag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off); + } +} + +static chtype +drv_conattr(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp = TCB->csp; + chtype attrs = A_NORMAL; + + AssertTCB(); + if (enter_alt_charset_mode) + attrs |= A_ALTCHARSET; + + if (enter_blink_mode) + attrs |= A_BLINK; + + if (enter_bold_mode) + attrs |= A_BOLD; + + if (enter_dim_mode) + attrs |= A_DIM; + + if (enter_reverse_mode) + attrs |= A_REVERSE; + + if (enter_standout_mode) + attrs |= A_STANDOUT; + + if (enter_protected_mode) + attrs |= A_PROTECT; + + if (enter_secure_mode) + attrs |= A_INVIS; + + if (enter_underline_mode) + attrs |= A_UNDERLINE; + + if (sp && sp->_coloron) + attrs |= A_COLOR; + + return (attrs); +} + +static void +drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + AssertTCB(); + + clear_screen = 0; + cursor_down = parm_down_cursor = 0; + cursor_address = 0; + cursor_up = parm_up_cursor = 0; + row_address = 0; + cursor_home = carriage_return; +} + +static void +drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + assert(sp != 0); + if (ena_acs != NULL) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs); + } +#if NCURSES_EXT_FUNCS + /* + * Linux console "supports" the "PC ROM" character set by the coincidence + * that smpch/rmpch and smacs/rmacs have the same values. ncurses has + * no codepage support (see SCO Merge for an example). Outside of the + * values defined in acsc, there are no definitions for the "PC ROM" + * character set (assumed by some applications to be codepage 437), but we + * allow those applications to use those codepoints. + * + * test/blue.c uses this feature. + */ +#define PCH_KLUDGE(a,b) (a != 0 && b != 0 && !strcmp(a,b)) + if (PCH_KLUDGE(enter_pc_charset_mode, enter_alt_charset_mode) && + PCH_KLUDGE(exit_pc_charset_mode, exit_alt_charset_mode)) { + size_t i; + for (i = 1; i < ACS_LEN; ++i) { + if (real_map[i] == 0) { + real_map[i] = i; + if (real_map != fake_map) { + if (sp != 0) + sp->_screen_acs_map[i] = TRUE; + } + } + } + } +#endif + + if (acs_chars != NULL) { + size_t i = 0; + size_t length = strlen(acs_chars); + + while (i + 1 < length) { + if (acs_chars[i] != 0 && UChar(acs_chars[i]) < ACS_LEN) { + real_map[UChar(acs_chars[i])] = UChar(acs_chars[i + 1]) | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[UChar(acs_chars[i])] = TRUE; + } + i += 2; + } + } +#ifdef TRACE + /* Show the equivalent mapping, noting if it does not match the + * given attribute, whether by re-ordering or duplication. + */ + if (USE_TRACEF(TRACE_CALLS)) { + size_t n, m; + char show[ACS_LEN * 2 + 1]; + for (n = 1, m = 0; n < ACS_LEN; n++) { + if (real_map[n] != 0) { + show[m++] = (char) n; + show[m++] = (char) ChCharOf(real_map[n]); + } + } + show[m] = 0; + if (acs_chars == NULL || strcmp(acs_chars, show)) + _tracef("%s acs_chars %s", + (acs_chars == NULL) ? "NULL" : "READ", + _nc_visbuf(acs_chars)); + _tracef("%s acs_chars %s", + (acs_chars == NULL) + ? "NULL" + : (strcmp(acs_chars, show) + ? "DIFF" + : "SAME"), + _nc_visbuf(show)); + + _nc_unlock_global(tracef); + } +#endif /* TRACE */ +} + +#define ENSURE_TINFO(sp) (TCBOf(sp)->drv->isTerminfo) + +NCURSES_EXPORT(void) +_nc_cookie_init(SCREEN *sp) +{ + bool support_cookies = USE_XMC_SUPPORT; + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) (sp->_term); + + if (sp == 0 || !ENSURE_TINFO(sp)) + return; + +#if USE_XMC_SUPPORT + /* + * If we have no magic-cookie support compiled-in, or if it is suppressed + * in the environment, reset the support-flag. + */ + if (magic_cookie_glitch >= 0) { + if (getenv("NCURSES_NO_MAGIC_COOKIE") != 0) { + support_cookies = FALSE; + } + } +#endif + + if (!support_cookies && magic_cookie_glitch >= 0) { + T(("will disable attributes to work w/o magic cookies")); + } + + if (magic_cookie_glitch > 0) { /* tvi, wyse */ + + sp->_xmc_triggers = sp->_ok_attributes & ( + A_STANDOUT | + A_UNDERLINE | + A_REVERSE | + A_BLINK | + A_DIM | + A_BOLD | + A_INVIS | + A_PROTECT + ); +#if 0 + /* + * We "should" treat colors as an attribute. The wyse350 (and its + * clones) appear to be the only ones that have both colors and magic + * cookies. + */ + if (has_colors()) { + sp->_xmc_triggers |= A_COLOR; + } +#endif + sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD); + + T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress))); + /* + * Supporting line-drawing may be possible. But make the regular + * video attributes work first. + */ + acs_chars = ABSENT_STRING; + ena_acs = ABSENT_STRING; + enter_alt_charset_mode = ABSENT_STRING; + exit_alt_charset_mode = ABSENT_STRING; +#if USE_XMC_SUPPORT + /* + * To keep the cookie support simple, suppress all of the optimization + * hooks except for clear_screen and the cursor addressing. + */ + if (support_cookies) { + clr_eol = ABSENT_STRING; + clr_eos = ABSENT_STRING; + set_attributes = ABSENT_STRING; + } +#endif + } else if (magic_cookie_glitch == 0) { /* hpterm */ + } + + /* + * If magic cookies are not supported, cancel the strings that set + * video attributes. + */ + if (!support_cookies && magic_cookie_glitch >= 0) { + magic_cookie_glitch = ABSENT_NUMERIC; + set_attributes = ABSENT_STRING; + enter_blink_mode = ABSENT_STRING; + enter_bold_mode = ABSENT_STRING; + enter_dim_mode = ABSENT_STRING; + enter_reverse_mode = ABSENT_STRING; + enter_standout_mode = ABSENT_STRING; + enter_underline_mode = ABSENT_STRING; + } + + /* initialize normal acs before wide, since we use mapping in the latter */ +#if !USE_WIDEC_SUPPORT + if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) { + acs_chars = NULL; + ena_acs = NULL; + enter_alt_charset_mode = NULL; + exit_alt_charset_mode = NULL; + set_attributes = NULL; + } +#endif +} + +static int +drv_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return _nc_timed_wait(sp, mode, milliseconds, timeleft EVENTLIST_2nd(evl)); +} + +static int +drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + unsigned char c2 = 0; + int n; + + AssertTCB(); + assert(buf); + SetSP(); + +# if USE_PTHREADS_EINTR + if ((pthread_self) && (pthread_kill) && (pthread_equal)) + _nc_globals.read_thread = pthread_self(); +# endif + n = read(sp->_ifd, &c2, 1); +#if USE_PTHREADS_EINTR + _nc_globals.read_thread = 0; +#endif + *buf = (int) c2; + return n; +} + +static int +drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ +#if HAVE_NANOSLEEP + { + struct timespec request, remaining; + request.tv_sec = ms / 1000; + request.tv_nsec = (ms % 1000) * 1000000; + while (nanosleep(&request, &remaining) == -1 + && errno == EINTR) { + request = remaining; + } + } +#else + _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); +#endif + return OK; +} + +static int +__nc_putp(SCREEN *sp, const char *name GCC_UNUSED, const char *value) +{ + int rc = ERR; + + if (value) { + rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); + } + return rc; +} + +static int +__nc_putp_flush(SCREEN *sp, const char *name, const char *value) +{ + int rc = __nc_putp(sp, name, value); + if (rc != ERR) { + NCURSES_SP_NAME(_nc_flush) (sp); + } + return rc; +} + +static int +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag) +{ + int ret = ERR; + SCREEN *sp; + + AssertTCB(); + + sp = TCB->csp; + + if (sp) { + if (flag) { + (void) __nc_putp_flush(sp, "keypad_xmit", keypad_xmit); + } else if (!flag && keypad_local) { + (void) __nc_putp_flush(sp, "keypad_local", keypad_local); + } + if (flag && !sp->_tried) { + _nc_init_keytry(sp); + sp->_tried = TRUE; + } + ret = OK; + } + + return ret; +} + +static int +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) +{ + SCREEN *sp; + int code = ERR; + int count = 0; + char *s; + + AssertTCB(); + SetSP(); + + if (c >= 0) { + unsigned ch = (unsigned) c; + if (flag) { + while ((s = _nc_expand_try(sp->_key_ok, ch, &count, 0)) != 0 + && _nc_remove_key(&(sp->_key_ok), ch)) { + code = _nc_add_to_try(&(sp->_keytry), s, ch); + free(s); + count = 0; + if (code != OK) + break; + } + } else { + while ((s = _nc_expand_try(sp->_keytry, ch, &count, 0)) != 0 + && _nc_remove_key(&(sp->_keytry), ch)) { + code = _nc_add_to_try(&(sp->_key_ok), s, ch); + free(s); + count = 0; + if (code != OK) + break; + } + } + } + return (code); +} + +static bool +drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key) +{ + bool res = FALSE; + + AssertTCB(); + if (TCB->csp) + res = TINFO_HAS_KEY(TCB->csp, key) == 0 ? FALSE : TRUE; + + return res; +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = { + TRUE, + drv_CanHandle, /* CanHandle */ + drv_init, /* init */ + drv_release, /* release */ + drv_size, /* size */ + drv_sgmode, /* sgmode */ + drv_conattr, /* conattr */ + drv_mvcur, /* hwcur */ + drv_mode, /* mode */ + drv_rescol, /* rescol */ + drv_rescolors, /* rescolors */ + drv_setcolor, /* color */ + drv_dobeepflash, /* doBeepOrFlash */ + drv_initpair, /* initpair */ + drv_initcolor, /* initcolor */ + drv_do_color, /* docolor */ + drv_initmouse, /* initmouse */ + drv_testmouse, /* testmouse */ + drv_setfilter, /* setfilter */ + drv_hwlabel, /* hwlabel */ + drv_hwlabelOnOff, /* hwlabelOnOff */ + drv_doupdate, /* update */ + drv_defaultcolors, /* defaultcolors */ + drv_print, /* print */ + drv_getsize, /* getsize */ + drv_setsize, /* setsize */ + drv_initacs, /* initacs */ + drv_screen_init, /* scinit */ + drv_wrap, /* scexit */ + drv_twait, /* twait */ + drv_read, /* read */ + drv_nap, /* nap */ + drv_kpad, /* kpad */ + drv_keyok, /* kyOk */ + drv_kyExist /* kyExist */ +}; diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index 80c8f77fbeb..1f99208667e 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2005-2007,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 * @@ -35,9 +35,8 @@ #include #include -#include -MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $") #undef CUR #define CUR tp-> @@ -100,8 +99,8 @@ rewrite_sgr(char *s, char *attr) { if (PRESENT(s)) { if (PRESENT(attr)) { - unsigned len_s = strlen(s); - unsigned len_a = strlen(attr); + size_t len_s = strlen(s); + size_t len_a = strlen(attr); if (len_s > len_a && !strncmp(attr, s, len_a)) { unsigned n; @@ -124,8 +123,8 @@ similar_sgr(char *a, char *b) bool result = FALSE; int csi_a = is_csi(a); int csi_b = is_csi(b); - unsigned len_a; - unsigned len_b; + size_t len_a; + size_t len_b; TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s", _nc_visbuf2(1, a), @@ -170,13 +169,13 @@ chop_out(char *string, unsigned i, unsigned j) * Returns the number of chars from 'full' that we matched. If any mismatch * occurs, return zero. */ -static int +static unsigned compare_part(const char *part, const char *full) { const char *next_part; const char *next_full; - int used_full = 0; - int used_delay = 0; + unsigned used_full = 0; + unsigned used_delay = 0; while (*part != 0) { if (*part != *full) { @@ -199,7 +198,7 @@ compare_part(const char *part, const char *full) next_part = skip_delay(part); next_full = skip_delay(full); if (next_part != part && next_full != full) { - used_delay += (next_full - full); + used_delay += (unsigned) (next_full - full); full = next_full; part = next_part; continue; @@ -261,10 +260,11 @@ _nc_trim_sgr0(TERMTYPE *tp) k = strlen(exit_alt_charset_mode); if (j > k) { for (i = 0; i <= (j - k); ++i) { - int k2 = compare_part(exit_alt_charset_mode, off + i); + unsigned k2 = compare_part(exit_alt_charset_mode, + off + i); if (k2 != 0) { found = TRUE; - chop_out(off, i, i + k2); + chop_out(off, (unsigned) i, (unsigned) (i + k2)); break; } } @@ -274,18 +274,18 @@ _nc_trim_sgr0(TERMTYPE *tp) * SGR 10 would reset to normal font. */ if (!found) { - if ((i = is_csi(off)) != 0 + if ((i = (size_t) is_csi(off)) != 0 && off[strlen(off) - 1] == 'm') { TR(TRACE_DATABASE, ("looking for SGR 10 in %s", _nc_visbuf(off))); tmp = skip_zero(off + i); if (tmp[0] == '1' && skip_zero(tmp + 1) != tmp + 1) { - i = tmp - off; + i = (size_t) (tmp - off); if (off[i - 1] == ';') i--; - j = skip_zero(tmp + 1) - off; - i = chop_out(off, i, j); + j = (size_t) (skip_zero(tmp + 1) - off); + (void) chop_out(off, (unsigned) i, (unsigned) j); found = TRUE; } } @@ -293,10 +293,10 @@ _nc_trim_sgr0(TERMTYPE *tp) if (!found && (tmp = strstr(end, off)) != 0 && strcmp(end, off) != 0) { - i = tmp - end; + i = (size_t) (tmp - end); j = strlen(off); tmp = strdup(end); - chop_out(tmp, i, j); + chop_out(tmp, (unsigned) i, (unsigned) j); free(off); result = tmp; } diff --git a/ncurses/tinfo/use_screen.c b/ncurses/tinfo/use_screen.c index 6c3b12fb923..6a0297cebd5 100644 --- a/ncurses/tinfo/use_screen.c +++ b/ncurses/tinfo/use_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: use_screen.c,v 1.6 2008/06/07 19:16:56 tom Exp $") +MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $") NCURSES_EXPORT(int) use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) @@ -40,14 +40,14 @@ use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) SCREEN *save_SP; int code = OK; - T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data)); + T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data)); /* * FIXME - add a flag so a given thread can check if _it_ has already * recurred through this point, return an error if so. */ _nc_lock_global(curses); - save_SP = SP; + save_SP = CURRENT_SCREEN; set_term(screen); code = func(screen, data); diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index b53bb210230..a86c11267e9 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -42,7 +42,6 @@ #include #include -#include #ifndef S_ISDIR #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) @@ -54,7 +53,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.72 2008/08/03 19:24:00 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.78 2010/12/25 23:23:08 tom Exp $") static int total_written; @@ -137,10 +136,12 @@ make_db_path(char *dst, const char *src, unsigned limit) if (_nc_is_dir_path(dst)) { rc = -1; } else { + static const char suffix[] = DBM_SUFFIX; unsigned have = strlen(dst); - if (have > 3 && strcmp(dst + have - 3, DBM_SUFFIX)) { - if (have + 3 <= limit) - strcat(dst, DBM_SUFFIX); + unsigned need = strlen(suffix); + if (have > need && strcmp(dst + have - need, suffix)) { + if (have + need <= limit) + strcat(dst, suffix); else rc = -1; } @@ -171,7 +172,11 @@ make_db_root(const char *path) struct stat statbuf; if ((rc = stat(path, &statbuf)) < 0) { - rc = mkdir(path, 0777); + rc = mkdir(path +#if !defined(__MINGW32__) + ,0777 +#endif + ); } else if (_nc_access(path, R_OK | W_OK | X_OK) < 0) { rc = -1; /* permission denied */ } else if (!(S_ISDIR(statbuf.st_mode))) { @@ -338,6 +343,7 @@ _nc_write_entry(TERMTYPE *const tp) while (*other_names != '\0') { ptr = other_names++; + assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; @@ -357,7 +363,7 @@ _nc_write_entry(TERMTYPE *const tp) start_time = 0; } - if (strlen(first_name) >= sizeof(filename) - 3) + if (strlen(first_name) >= sizeof(filename) - (2 + LEAF_LEN)) _nc_warning("terminal name too long."); sprintf(filename, LEAF_FMT "/%s", first_name[0], first_name); @@ -385,14 +391,13 @@ _nc_write_entry(TERMTYPE *const tp) } while (*other_names != '\0') { ptr = other_names++; - assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; if (*other_names != '\0') *(other_names++) = '\0'; - if (strlen(ptr) > sizeof(linkname) - 3) { + if (strlen(ptr) > sizeof(linkname) - (2 + LEAF_LEN)) { _nc_warning("terminal alias %s too long.", ptr); continue; } @@ -414,8 +419,12 @@ _nc_write_entry(TERMTYPE *const tp) { int code; #if USE_SYMLINKS - strcpy(symlinkname, "../"); - strncat(symlinkname, filename, sizeof(symlinkname) - 4); + if (first_name[0] == linkname[0]) + strncpy(symlinkname, first_name, sizeof(symlinkname) - 1); + else { + strcpy(symlinkname, "../"); + strncat(symlinkname, filename, sizeof(symlinkname) - 4); + } symlinkname[sizeof(symlinkname) - 1] = '\0'; #endif /* USE_SYMLINKS */ #if HAVE_REMOVE @@ -460,26 +469,26 @@ _nc_write_entry(TERMTYPE *const tp) #endif /* USE_HASHED_DB */ } -static unsigned +static size_t fake_write(char *dst, unsigned *offset, - unsigned limit, + size_t limit, char *src, - unsigned want, - unsigned size) + size_t want, + size_t size) { - int have = (limit - *offset); + size_t have = (limit - *offset); want *= size; if (have > 0) { - if ((int) want > have) + if (want > have) want = have; memcpy(dst + *offset, src, want); - *offset += want; + *offset += (unsigned) want; } else { want = 0; } - return (int) (want / size); + return (want / size); } #define Write(buf, size, count) fake_write(buffer, offset, limit, (char *) buf, count, size) @@ -487,15 +496,16 @@ fake_write(char *dst, #undef LITTLE_ENDIAN /* BSD/OS defines this as a feature macro */ #define HI(x) ((x) / 256) #define LO(x) ((x) % 256) -#define LITTLE_ENDIAN(p, x) (p)[0] = LO(x), (p)[1] = HI(x) +#define LITTLE_ENDIAN(p, x) (p)[0] = (unsigned char)LO(x), \ + (p)[1] = (unsigned char)HI(x) #define WRITE_STRING(str) (Write(str, sizeof(char), strlen(str) + 1) == strlen(str) + 1) static int -compute_offsets(char **Strings, unsigned strmax, short *offsets) +compute_offsets(char **Strings, size_t strmax, short *offsets) { - size_t nextfree = 0; - unsigned i; + int nextfree = 0; + size_t i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -503,8 +513,8 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } else if (Strings[i] == CANCELLED_STRING) { offsets[i] = -2; } else { - offsets[i] = nextfree; - nextfree += strlen(Strings[i]) + 1; + offsets[i] = (short) nextfree; + nextfree += (int) strlen(Strings[i]) + 1; TRACE_OUT(("put Strings[%d]=%s(%d)", (int) i, _nc_visbuf(Strings[i]), (int) nextfree)); } @@ -513,9 +523,9 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, unsigned count) +convert_shorts(unsigned char *buf, short *Numbers, size_t count) { - unsigned i; + size_t i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; @@ -524,7 +534,7 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) buf[2 * i + 1] = 0377; } else { LITTLE_ENDIAN(buf + 2 * i, Numbers[i]); - TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i])); + TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i])); } } } @@ -536,8 +546,8 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) static unsigned extended_Booleans(TERMTYPE *tp) { - unsigned short result = 0; - unsigned short i; + unsigned result = 0; + unsigned i; for (i = 0; i < tp->ext_Booleans; ++i) { if (tp->Booleans[BOOLCOUNT + i] == TRUE) @@ -549,8 +559,8 @@ extended_Booleans(TERMTYPE *tp) static unsigned extended_Numbers(TERMTYPE *tp) { - unsigned short result = 0; - unsigned short i; + unsigned result = 0; + unsigned i; for (i = 0; i < tp->ext_Numbers; ++i) { if (tp->Numbers[NUMCOUNT + i] != ABSENT_NUMERIC) @@ -567,7 +577,7 @@ extended_Strings(TERMTYPE *tp) for (i = 0; i < tp->ext_Strings; ++i) { if (tp->Strings[STRCOUNT + i] != ABSENT_STRING) - result = (i + 1); + result = (unsigned short) (i + 1); } return result; } @@ -597,7 +607,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) size_t namelen, boolmax, nummax, strmax; char zero = '\0'; size_t i; - short nextfree; + int nextfree; short offsets[MAX_ENTRY_SIZE / 2]; unsigned char buf[MAX_ENTRY_SIZE]; unsigned last_bool = BOOLWRITE; @@ -690,7 +700,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) #if NCURSES_XNAMES if (extended_object(tp)) { - unsigned extcnt = NUM_EXT_NAMES(tp); + unsigned extcnt = (unsigned) NUM_EXT_NAMES(tp); if (even_boundary(nextfree)) return (ERR); diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 743b1f64f1a..a726901d4a3 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -46,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -56,26 +57,26 @@ NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ NCURSES_EXPORT(const char *) NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void) { - return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace; + return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace; } NCURSES_EXPORT(long) NCURSES_PUBLIC_VAR(_nc_outchars) (void) { - return SP ? SP->_outchars : _nc_prescreen._outchars; + return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars; } NCURSES_EXPORT(void) _nc_set_tputs_trace(const char *s) { - if (SP) - SP->_tputs_trace = s; + if (CURRENT_SCREEN) + CURRENT_SCREEN->_tputs_trace = s; else _nc_prescreen._tputs_trace = s; } NCURSES_EXPORT(void) _nc_count_outchars(long increment) { - if (SP) - SP->_outchars += increment; + if (CURRENT_SCREEN) + CURRENT_SCREEN->_outchars += increment; else _nc_prescreen._outchars += increment; } @@ -95,7 +96,7 @@ trace(const unsigned int tracelevel) const char *mode = _nc_globals.init_trace ? "ab" : "wb"; if (TracePath[0] == '\0') { - int size = sizeof(TracePath) - 12; + size_t size = sizeof(TracePath) - 12; if (getcwd(TracePath, size) == 0) { perror("curses: Can't get working directory"); exit(EXIT_FAILURE); @@ -121,7 +122,7 @@ trace(const unsigned int tracelevel) */ #if HAVE_SETVBUF /* ANSI */ (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); -#elif HAVE_SETBUF /* POSIX */ +#elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif _tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)", @@ -183,7 +184,11 @@ _nc_va_tracef(const char *fmt, va_list ap) # if USE_WEAK_SYMBOLS if ((pthread_self)) # endif +#ifdef __MINGW32__ + fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p); +#else fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self()); +#endif #endif if (before || after) { int n; @@ -219,6 +224,14 @@ _nc_retrace_bool(NCURSES_BOOL code) return code; } +/* Trace 'char' return-values */ +NCURSES_EXPORT(char) +_nc_retrace_char(char code) +{ + T((T_RETURN("%c"), code)); + return code; +} + /* Trace 'int' return-values */ NCURSES_EXPORT(int) _nc_retrace_int(int code) @@ -271,7 +284,7 @@ _nc_retrace_void_ptr(void *code) NCURSES_EXPORT(SCREEN *) _nc_retrace_sp(SCREEN *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } @@ -279,7 +292,7 @@ _nc_retrace_sp(SCREEN *code) NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index 45a03cea05f..35ba0d3e679 100644 --- a/ncurses/trace/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,6 +30,7 @@ * Author: Thomas Dickey 1996-on * * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -37,9 +38,12 @@ */ #include -#include /* acs_chars */ -MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_traceatr.c,v 1.74 2011/01/22 19:48:01 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -128,11 +132,11 @@ _traceattr2(int bufnum, chtype newmode) for (n = 0; n < SIZEOF(names); n++) { if ((newmode & names[n].val) != 0) { if (result[1] != '\0') - result = _nc_trace_bufcat(bufnum, "|"); + (void) _nc_trace_bufcat(bufnum, "|"); result = _nc_trace_bufcat(bufnum, names[n].name); if (names[n].val == A_COLOR) { - short pairnum = PAIR_NUMBER(newmode); + short pairnum = (short) PairNumber(newmode); #ifdef USE_TERMLIB /* pair_content lives in libncurses */ (void) sprintf(temp, "{%d}", pairnum); @@ -172,6 +176,14 @@ _traceattr(attr_t newmode) } /* Trace 'int' return-values */ +NCURSES_EXPORT(int) +_nc_retrace_int_attr_t(attr_t code) +{ + T((T_RETURN("%s"), _traceattr(code))); + return (int) code; +} + +/* Trace 'attr_t' return-values */ NCURSES_EXPORT(attr_t) _nc_retrace_attr_t(attr_t code) { @@ -186,6 +198,9 @@ _nc_altcharset_name(attr_t attr, chtype ch) unsigned int val; const char *name; } ALT_NAMES; +#if NCURSES_SP_FUNCS + SCREEN *sp = CURRENT_SCREEN; +#endif static const ALT_NAMES names[] = { {'l', "ACS_ULCORNER"}, /* upper left corner */ @@ -225,23 +240,26 @@ _nc_altcharset_name(attr_t attr, chtype ch) const char *result = 0; +#if NCURSES_SP_FUNCS + (void) sp; +#endif if ((attr & A_ALTCHARSET) && (acs_chars != 0)) { char *cp; char *found = 0; - const ALT_NAMES *sp; + const ALT_NAMES *strp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (ChCharOf(cp[1]) == ChCharOf(ch)) { + if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = ChCharOf(*found); - for (sp = names; sp->val; sp++) - if (sp->val == ch) { - result = sp->name; + ch = ChCharOf(UChar(*found)); + for (strp = names; strp->val; strp++) + if (strp->val == ch) { + result = strp->name; break; } } @@ -260,7 +278,9 @@ _tracechtype2(int bufnum, chtype ch) if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) { (void) _nc_trace_bufcat(bufnum, found); } else - (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch))); + (void) _nc_trace_bufcat(bufnum, + _nc_tracechar(CURRENT_SCREEN, + (int) ChCharOf(ch))); if (ChAttrOf(ch) != A_NORMAL) { (void) _nc_trace_bufcat(bufnum, " | "); @@ -313,14 +333,17 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) (void) _nc_trace_bufcat(bufnum, "{ "); for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { PUTC_ch = ch->chars[PUTC_i]; - if (PUTC_ch == L'\0') + if (PUTC_ch == L'\0') { + if (PUTC_i == 0) + (void) _nc_trace_bufcat(bufnum, "\\000"); break; - PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + } + PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) { if (PUTC_ch != L'\0') { /* it could not be a multibyte sequence */ (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(SP, + _nc_tracechar(CURRENT_SCREEN, UChar(ch->chars[PUTC_i]))); } break; @@ -329,7 +352,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) if (n) (void) _nc_trace_bufcat(bufnum, ", "); (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(SP, + _nc_tracechar(CURRENT_SCREEN, UChar(PUTC_buf[n]))); } } diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c index cc441b391e5..d19d0e420ac 100644 --- a/ncurses/trace/lib_tracebits.c +++ b/ncurses/trace/lib_tracebits.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2011 Free 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,9 +33,8 @@ ****************************************************************************/ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_tracebits.c,v 1.17 2008/08/03 16:09:26 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.19 2011/01/09 00:23:03 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -262,5 +261,5 @@ _nc_tracebits(void) return _nc_trace_ttymode(&(cur_term->Nttyb)); } #else -EMPTY_MODULE(_nc_tracebits) +EMPTY_MODULE(_nc_empty_lib_tracebits) #endif /* TRACE */ diff --git a/ncurses/trace/lib_tracechr.c b/ncurses/trace/lib_tracechr.c index 79cf03b4870..a1f9f5aa270 100644 --- a/ncurses/trace/lib_tracechr.c +++ b/ncurses/trace/lib_tracechr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_tracechr.c,v 1.19 2008/08/03 15:39:29 tom Exp $") +MODULE_ID("$Id: lib_tracechr.c,v 1.20 2009/04/18 22:48:29 tom Exp $") #ifdef TRACE @@ -52,7 +52,7 @@ _nc_tracechar(SCREEN *sp, int ch) : _nc_globals.tracechr_buf); if (ch > KEY_MIN || ch < 0) { - name = _nc_keyname(sp, ch); + name = safe_keyname(SP_PARM, ch); if (name == 0 || *name == '\0') name = "NULL"; (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -64,7 +64,7 @@ _nc_tracechar(SCREEN *sp, int ch) */ (void) sprintf(MyBuffer, "%#03o", ch); } else { - name = _nc_unctrl(sp, (chtype) ch); + name = safe_unctrl(SP_PARM, (chtype) ch); if (name == 0 || *name == 0) name = "null"; /* shouldn't happen */ (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -75,7 +75,7 @@ _nc_tracechar(SCREEN *sp, int ch) NCURSES_EXPORT(char *) _tracechar(int ch) { - return _nc_tracechar(SP, ch); + return _nc_tracechar(CURRENT_SCREEN, ch); } #else EMPTY_MODULE(_nc_lib_tracechr) diff --git a/ncurses/trace/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c index 58732a06c24..c7fcbf2e0d5 100644 --- a/ncurses/trace/lib_tracedmp.c +++ b/ncurses/trace/lib_tracedmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ #include #include -MODULE_ID("$Id: lib_tracedmp.c,v 1.31 2008/08/16 19:30:56 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.32 2009/04/18 21:01:38 tom Exp $") #ifdef TRACE @@ -68,7 +68,7 @@ _tracedump(const char *name, WINDOW *win) if (width < win->_maxx) ++width; if (++width + 1 > (int) my_length) { - my_length = 2 * (width + 1); + my_length = (unsigned) (2 * (width + 1)); my_buffer = typeRealloc(char, my_length, my_buffer); } @@ -82,7 +82,7 @@ _tracedump(const char *name, WINDOW *win) * we map those to '.' and '?' respectively. */ for (j = 0; j < width; ++j) { - chtype test = CharOf(win->_line[n].text[j]); + chtype test = (chtype) CharOf(win->_line[n].text[j]); ep[j] = (char) ((UChar(test) == test #if USE_WIDEC_SUPPORT && (win->_line[n].text[j].chars[1] == 0) @@ -111,7 +111,7 @@ _tracedump(const char *name, WINDOW *win) if (multicolumn) { ep = my_buffer; for (j = 0; j < width; ++j) { - int test = WidecExt(win->_line[n].text[j]); + chtype test = WidecExt(win->_line[n].text[j]); if (test) { ep[j] = (char) (test + '0'); } else { @@ -153,7 +153,7 @@ _tracedump(const char *name, WINDOW *win) for (i = 0; i < 4; ++i) { const char *hex = " 123456789ABCDEF"; - attr_t mask = (0xf << ((i + 4) * 4)); + attr_t mask = (attr_t) (0xf << ((i + 4) * 4)); haveattrs = FALSE; for (j = 0; j < width; ++j) diff --git a/ncurses/trace/lib_tracemse.c b/ncurses/trace/lib_tracemse.c index 74cc177d51b..1afd15d2e78 100644 --- a/ncurses/trace/lib_tracemse.c +++ b/ncurses/trace/lib_tracemse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,23 +38,16 @@ #include -MODULE_ID("$Id: lib_tracemse.c,v 1.15 2008/08/03 15:39:29 tom Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.18 2011/01/22 19:48:08 tom Exp $") #ifdef TRACE #define my_buffer sp->tracemse_buf -NCURSES_EXPORT(char *) -_nc_tracemouse(SCREEN *sp, MEVENT const *ep) +static char * +_trace_mmask_t(SCREEN *sp, mmask_t code) { - (void) sprintf(my_buffer, TRACEMSE_FMT, - ep->id, - ep->x, - ep->y, - ep->z, - (unsigned long) ep->bstate); - -#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(my_buffer, s), ", ") +#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ") SHOW(BUTTON1_RELEASED, "release-1"); SHOW(BUTTON1_PRESSED, "press-1"); @@ -110,14 +103,37 @@ _nc_tracemouse(SCREEN *sp, MEVENT const *ep) if (my_buffer[strlen(my_buffer) - 1] == ' ') my_buffer[strlen(my_buffer) - 2] = '\0'; + + return (my_buffer); +} + +NCURSES_EXPORT(char *) +_nc_tracemouse(SCREEN *sp, MEVENT const *ep) +{ + (void) sprintf(my_buffer, TRACEMSE_FMT, + ep->id, + ep->x, + ep->y, + ep->z, + (unsigned long) ep->bstate); + + (void) _trace_mmask_t(sp, ep->bstate); (void) strcat(my_buffer, "}"); return (my_buffer); } +NCURSES_EXPORT(mmask_t) +_nc_retrace_mmask_t(SCREEN *sp, mmask_t code) +{ + *my_buffer = '\0'; + T((T_RETURN("{%s}"), _trace_mmask_t(sp, code))); + return code; +} + NCURSES_EXPORT(char *) _tracemouse(MEVENT const *ep) { - return _nc_tracemouse(SP, ep); + return _nc_tracemouse(CURRENT_SCREEN, ep); } #else /* !TRACE */ diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c index 6345acc035f..46baba4796b 100644 --- a/ncurses/trace/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,9 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.14 2008/08/03 15:13:56 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $") + +#ifdef TRACE #define MyList _nc_globals.tracebuf_ptr #define MySize _nc_globals.tracebuf_used @@ -47,7 +49,7 @@ _nc_trace_alloc(int bufnum, size_t want) if (bufnum >= 0) { if ((size_t) (bufnum + 1) > MySize) { - size_t need = (bufnum + 1) * 2; + size_t need = (size_t) (bufnum + 1) * 2; if ((MyList = typeRealloc(TRACEBUF, need, MyList)) != 0) { while (need > MySize) MyList[MySize++].text = 0; @@ -112,3 +114,6 @@ _nc_trace_bufcat(int bufnum, const char *value) } return buffer; } +#else +EMPTY_MODULE(_nc_empty_trace_buf) +#endif /* TRACE */ diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c index f813aba1582..d3380131eca 100644 --- a/ncurses/trace/trace_tries.c +++ b/ncurses/trace/trace_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2009,2011 Free 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,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1999 * + * Author: Thomas E. Dickey 1999 * ****************************************************************************/ /* * trace_tries.c - Tracing/Debugging buffers (keycode tries-trees) @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: trace_tries.c,v 1.13 2008/08/03 15:43:30 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.16 2011/01/09 00:23:27 tom Exp $") #ifdef TRACE #define my_buffer _nc_globals.tracetry_buf @@ -46,7 +46,7 @@ recur_tries(TRIES * tree, unsigned level) { if (level > my_length) { my_length = (level + 1) * 4; - my_buffer = (unsigned char *) realloc(my_buffer, my_length); + my_buffer = (unsigned char *) _nc_doalloc(my_buffer, my_length); } while (tree != 0) { @@ -67,12 +67,12 @@ NCURSES_EXPORT(void) _nc_trace_tries(TRIES * tree) { my_buffer = typeMalloc(unsigned char, my_length = 80); - _tracef("BEGIN tries %p", tree); + _tracef("BEGIN tries %p", (void *) tree); recur_tries(tree, 0); - _tracef(". . . tries %p", tree); + _tracef(". . . tries %p", (void *) tree); free(my_buffer); } #else -EMPTY_MODULE(_nc_trace_tries) +EMPTY_MODULE(_nc_empty_trace_tries) #endif diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c index 9b0b5920d81..38a48730ccd 100644 --- a/ncurses/trace/trace_xnames.c +++ b/ncurses/trace/trace_xnames.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2000,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 * @@ -34,12 +34,11 @@ */ #include -#include -MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $") NCURSES_EXPORT(void) -_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED) +_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) { #ifdef TRACE #if NCURSES_XNAMES diff --git a/ncurses/trace/varargs.c b/ncurses/trace/varargs.c index f4ee46710ab..541173d2745 100644 --- a/ncurses/trace/varargs.c +++ b/ncurses/trace/varargs.c @@ -34,7 +34,7 @@ #include -MODULE_ID("$Id: varargs.c,v 1.7 2008/08/03 15:42:49 tom Exp $") +MODULE_ID("$Id: varargs.c,v 1.8 2008/11/16 00:19:59 juergen Exp $") #ifdef TRACE @@ -44,7 +44,7 @@ typedef enum { atUnknown = 0, atInteger, atFloat, atPoint, atString } ARGTYPE; -#define VA_INT(type) ival = va_arg(ap, type) +#define VA_INT(type) ival = (int) va_arg(ap, type) #define VA_FLT(type) fval = va_arg(ap, type) #define VA_PTR(type) pval = (char *)va_arg(ap, type) #define VA_STR(type) sval = va_arg(ap, type) diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index bf9fb147200..66da4f4beca 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,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 * @@ -42,7 +42,9 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.32 2008/08/04 23:07:39 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $") + +#define NUM_VISBUFS 4 #define NormalLen(len) (size_t) (((size_t)(len) + 1) * 4) #define WideLen(len) (size_t) (((size_t)(len) + 1) * 4 * MB_CUR_MAX) @@ -92,7 +94,7 @@ _nc_vischar(char *tp, unsigned c) static const char * _nc_visbuf2n(int bufnum, const char *buf, int len) { - const char *vbuf; + const char *vbuf = 0; char *tp; int c; @@ -108,9 +110,16 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, NormalLen(len)); #else { - static char *mybuf[4]; - mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); - vbuf = tp = mybuf[bufnum]; + static char *mybuf[NUM_VISBUFS]; + if (bufnum < 0) { + for (c = 0; c < NUM_VISBUFS; ++c) { + FreeAndNull(mybuf[c]); + } + tp = 0; + } else { + mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); + vbuf = tp = mybuf[bufnum]; + } } #endif if (tp != 0) { @@ -119,7 +128,7 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) tp = _nc_vischar(tp, UChar(c)); } *tp++ = D_QUOTE; - *tp++ = '\0'; + *tp = '\0'; } else { vbuf = ("(_nc_visbuf2n failed)"); } @@ -177,7 +186,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, WideLen(len)); #else { - static char *mybuf[2]; + static char *mybuf[NUM_VISBUFS]; mybuf[bufnum] = typeRealloc(char, WideLen(len), mybuf[bufnum]); vbuf = tp = mybuf[bufnum]; } @@ -196,7 +205,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) } } *tp++ = D_QUOTE; - *tp++ = '\0'; + *tp = '\0'; } else { vbuf = ("(_nc_viswbuf2n failed)"); } @@ -229,7 +238,9 @@ _nc_viswibuf(const wint_t *buf) static unsigned mylen; unsigned n; - for (n = 0; buf[n] != 0; ++n) ; + for (n = 0; buf[n] != 0; ++n) { + ; /* empty */ + } if (mylen < ++n) { mylen = n + 80; if (mybuf != 0) @@ -237,8 +248,10 @@ _nc_viswibuf(const wint_t *buf) else mybuf = typeMalloc(wchar_t, mylen); } - for (n = 0; buf[n] != 0; ++n) + for (n = 0; buf[n] != 0; ++n) { mybuf[n] = (wchar_t) buf[n]; + } + mybuf[n] = L'\0'; return _nc_viswbuf2(0, mybuf); } @@ -274,12 +287,12 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } } - result = _nc_trace_bufcat(bufnum, l_brace); - result = _nc_trace_bufcat(bufnum, d_quote); + (void) _nc_trace_bufcat(bufnum, l_brace); + (void) _nc_trace_bufcat(bufnum, d_quote); for (j = first; j <= last; ++j) { found = _nc_altcharset_name(attr, (chtype) CharOf(buf[j])); if (found != 0) { - result = _nc_trace_bufcat(bufnum, found); + (void) _nc_trace_bufcat(bufnum, found); attr &= ~A_ALTCHARSET; } else #if USE_WIDEC_SUPPORT @@ -291,15 +304,19 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) int k; PUTC_ch = buf[j].chars[PUTC_i]; - if (PUTC_ch == L'\0') + if (PUTC_ch == L'\0') { + if (PUTC_i == 0) + (void) _nc_trace_bufcat(bufnum, "\\000"); break; - PUTC_n = (int) wcrtomb(PUTC_buf, buf[j].chars[PUTC_i], &PUT_st); + } + PUTC_n = (int) wcrtomb(PUTC_buf, + buf[j].chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) break; for (k = 0; k < PUTC_n; k++) { char temp[80]; _nc_vischar(temp, UChar(PUTC_buf[k])); - result = _nc_trace_bufcat(bufnum, temp); + (void) _nc_trace_bufcat(bufnum, temp); } } } @@ -311,10 +328,10 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } #endif /* USE_WIDEC_SUPPORT */ } - result = _nc_trace_bufcat(bufnum, d_quote); + (void) _nc_trace_bufcat(bufnum, d_quote); if (attr != A_NORMAL) { - result = _nc_trace_bufcat(bufnum, " | "); - result = _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); + (void) _nc_trace_bufcat(bufnum, " | "); + (void) _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); } result = _nc_trace_bufcat(bufnum, r_brace); first = last + 1; diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh index bf9acf21aa4..7a5f5993c48 100755 --- a/ncurses/tty/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -1,6 +1,6 @@ #! /bin/sh ############################################################################## -# Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -27,9 +27,9 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1997 +# Author: Thomas E. Dickey, 1997-on # -# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $ +# $Id: MKexpanded.sh,v 1.17 2010/01/23 17:57:43 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -52,8 +52,13 @@ trap "rm -f $TMP" 0 1 2 5 15 cat < -#include + +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #if NCURSES_EXPANDED EOF @@ -68,29 +73,59 @@ cat >$TMP </dev/null | sed -e '1,/^IGNORE$/d' +$preprocessor $TMP 2>/dev/null | \ + sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#if_/#if /' cat < -MODULE_ID("$Id: hardscroll.c,v 1.42 2008/08/03 23:49:30 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.47 2010/04/24 23:46:47 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) # undef screen_lines -# define screen_lines MAXLINES -NCURSES_EXPORT_VAR(int) -oldnums[MAXLINES]; -# define OLDNUM(n) oldnums[n] +# define screen_lines(sp) MAXLINES +NCURSES_EXPORT_VAR (int) + oldnums[MAXLINES]; +# define OLDNUM(sp,n) oldnums[n] # define _tracef printf # undef TR # define TR(n, a) if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); } -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; #else /* no debug */ /* OLDNUM(n) indicates which line will be shifted to the position n. if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from somewhere. */ -NCURSES_EXPORT_VAR(int *) -_nc_oldnums = 0; /* obsolete: keep for ABI compat */ +NCURSES_EXPORT_VAR (int *) + _nc_oldnums = 0; /* obsolete: keep for ABI compat */ # if USE_HASHMAP -# define oldnums SP->_oldnum_list -# define OLDNUM(n) oldnums[n] +# define oldnums(sp) (sp)->_oldnum_list +# define OLDNUM(sp,n) oldnums(sp)[n] # else /* !USE_HASHMAP */ -# define OLDNUM(n) newscr->_line[n].oldindex +# define OLDNUM(sp,n) NewScreen(sp)->_line[n].oldindex # endif /* !USE_HASHMAP */ -#define OLDNUM_SIZE SP->_oldnum_size +#define OLDNUM_SIZE(sp) (sp)->_oldnum_size #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */ NCURSES_EXPORT(void) -_nc_scroll_optimize(void) +NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) /* scroll optimization to transform curscr to newscr */ { int i; int start, end, shift; - TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize"))); + TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), (void *) SP_PARM)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) #if USE_HASHMAP /* get enough storage */ - if (OLDNUM_SIZE < screen_lines) { - int *new_oldnums = typeRealloc(int, screen_lines, oldnums); + if (OLDNUM_SIZE(SP_PARM) < screen_lines(SP_PARM)) { + int *new_oldnums = typeRealloc(int, + (size_t) screen_lines(SP_PARM), + oldnums(SP_PARM)); if (!new_oldnums) return; - oldnums = new_oldnums; - OLDNUM_SIZE = screen_lines; + oldnums(SP_PARM) = new_oldnums; + OLDNUM_SIZE(SP_PARM) = screen_lines(SP_PARM); } /* calculate the indices */ - _nc_hash_map(); + NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG); #endif #endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */ #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) { - _nc_linedump(); + NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_ARG); _nc_unlock_global(tracef); } #endif /* TRACE */ /* pass 1 - from top to bottom scrolling up */ - for (i = 0; i < screen_lines;) { - while (i < screen_lines && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) <= i)) + for (i = 0; i < screen_lines(SP_PARM);) { + while (i < screen_lines(SP_PARM) + && (OLDNUM(SP_PARM, i) == _NEWINDEX || OLDNUM(SP_PARM, i) <= i)) i++; - if (i >= screen_lines) + if (i >= screen_lines(SP_PARM)) break; - shift = OLDNUM(i) - i; /* shift > 0 */ + shift = OLDNUM(SP_PARM, i) - i; /* shift > 0 */ start = i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(SP_PARM) + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) i++; end = i - 1 + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { + if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx + shift, + start, + end, + screen_lines(SP_PARM) - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -238,23 +246,33 @@ _nc_scroll_optimize(void) } /* pass 2 - from bottom to top scrolling down */ - for (i = screen_lines - 1; i >= 0;) { - while (i >= 0 && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) >= i)) + for (i = screen_lines(SP_PARM) - 1; i >= 0;) { + while (i >= 0 + && (OLDNUM(SP_PARM, i) == _NEWINDEX + || OLDNUM(SP_PARM, i) >= i)) { i--; + } if (i < 0) break; - shift = OLDNUM(i) - i; /* shift < 0 */ + shift = OLDNUM(SP_PARM, i) - i; /* shift < 0 */ end = i; i--; - while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) + while (i >= 0 + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) { i--; + } start = i + 1 - (-shift); TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { + if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx + shift, + start, + end, + screen_lines(SP_PARM) - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -263,24 +281,41 @@ _nc_scroll_optimize(void) TR(TRACE_ICALLS, (T_RETURN(""))); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_scroll_optimize(void) +{ + NCURSES_SP_NAME(_nc_scroll_optimize) (CURRENT_SCREEN); +} +#endif + #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) NCURSES_EXPORT(void) -_nc_linedump(void) +NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0) /* dump the state of the real and virtual oldnum fields */ { int n; char *buf = 0; - size_t want = (screen_lines + 1) * 4; + size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4; if ((buf = typeMalloc(char, want)) != 0) { - (void) strcpy(buf, "virt"); - for (n = 0; n < screen_lines; n++) - (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n)); - TR(TRACE_UPDATE | TRACE_MOVE, (buf)); + *buf = '\0'; + for (n = 0; n < screen_lines(SP_PARM); n++) + (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(SP_PARM, n)); + TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf)); free(buf); } } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_linedump(void) +{ + NCURSES_SP_NAME(_nc_linedump) (CURRENT_SCREEN); +} +#endif + #endif /* defined(TRACE) || defined(SCROLLDEBUG) */ #ifdef SCROLLDEBUG diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index 9b60df62d5c..b670e1b9691 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -68,9 +68,12 @@ AUTHOR *****************************************************************************/ #include -#include /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $") #ifdef HASHDEBUG @@ -83,25 +86,25 @@ MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") int oldnums[MAXLINES], reallines[MAXLINES]; static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH]; static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; -# define OLDNUM(n) oldnums[n] -# define OLDTEXT(n) oldtext[n] -# define NEWTEXT(m) newtext[m] -# define PENDING(n) 1 +# define OLDNUM(sp,n) oldnums[n] +# define OLDTEXT(sp,n) oldtext[n] +# define NEWTEXT(sp,m) newtext[m] +# define PENDING(sp,n) 1 #else /* !HASHDEBUG */ -# define OLDNUM(n) SP->_oldnum_list[n] -# define OLDTEXT(n) curscr->_line[n].text -# define NEWTEXT(m) newscr->_line[m].text -# define TEXTWIDTH (curscr->_maxx+1) -# define PENDING(n) (newscr->_line[n].firstchar != _NOCHANGE) +# define OLDNUM(sp,n) (sp)->_oldnum_list[n] +# define OLDTEXT(sp,n) CurScreen(sp)->_line[n].text +# define NEWTEXT(sp,m) NewScreen(sp)->_line[m].text +# define TEXTWIDTH(sp) (CurScreen(sp)->_maxx + 1) +# define PENDING(sp,n) (NewScreen(sp)->_line[n].firstchar != _NOCHANGE) #endif /* !HASHDEBUG */ -#define oldhash (SP->oldhash) -#define newhash (SP->newhash) -#define hashtab (SP->hashtab) -#define lines_alloc (SP->hashtab_len) +#define oldhash(sp) ((sp)->oldhash) +#define newhash(sp) ((sp)->newhash) +#define hashtab(sp) ((sp)->hashtab) +#define lines_alloc(sp) ((sp)->hashtab_len) #if USE_WIDEC_SUPPORT #define HASH_VAL(ch) (ch.chars[0]) @@ -112,26 +115,26 @@ static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_INLINE unsigned long -hash(NCURSES_CH_T * text) +hash(SCREEN *sp, NCURSES_CH_T * text) { int i; NCURSES_CH_T ch; unsigned long result = 0; - for (i = TEXTWIDTH; i > 0; i--) { + for (i = TEXTWIDTH(sp); i > 0; i--) { ch = *text++; - result += (result << 5) + HASH_VAL(ch); + result += (result << 5) + (unsigned long) HASH_VAL(ch); } return result; } /* approximate update cost */ static int -update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) +update_cost(SCREEN *sp, NCURSES_CH_T * from, NCURSES_CH_T * to) { int cost = 0; int i; - for (i = TEXTWIDTH; i > 0; i--, from++, to++) + for (i = TEXTWIDTH(sp); i > 0; i--, from++, to++) if (!(CharEq(*from, *to))) cost++; @@ -139,7 +142,7 @@ update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) } static int -update_cost_from_blank(NCURSES_CH_T * to) +update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) { int cost = 0; int i; @@ -148,7 +151,7 @@ update_cost_from_blank(NCURSES_CH_T * to) if (back_color_erase) SetPair(blank, GetPair(stdscr->_nc_bkgd)); - for (i = TEXTWIDTH; i > 0; i--, to++) + for (i = TEXTWIDTH(sp); i > 0; i--, to++) if (!(CharEq(blank, *to))) cost++; @@ -160,14 +163,14 @@ update_cost_from_blank(NCURSES_CH_T * to) * effective. 'blank' indicates whether the line 'to' would become blank. */ static NCURSES_INLINE bool -cost_effective(const int from, const int to, const bool blank) +cost_effective(SCREEN *sp, const int from, const int to, const bool blank) { int new_from; if (from == to) return FALSE; - new_from = OLDNUM(from); + new_from = OLDNUM(sp, from); if (new_from == _NEWINDEX) new_from = from; @@ -175,16 +178,17 @@ cost_effective(const int from, const int to, const bool blank) * On the left side of >= is the cost before moving; * on the right side -- cost after moving. */ - return (((blank ? update_cost_from_blank(NEWTEXT(to)) - : update_cost(OLDTEXT(to), NEWTEXT(to))) - + update_cost(OLDTEXT(new_from), NEWTEXT(from))) - >= ((new_from == from ? update_cost_from_blank(NEWTEXT(from)) - : update_cost(OLDTEXT(new_from), NEWTEXT(from))) - + update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE; + return (((blank ? update_cost_from_blank(sp, NEWTEXT(sp, to)) + : update_cost(sp, OLDTEXT(sp, to), NEWTEXT(sp, to))) + + update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) + >= ((new_from == from ? update_cost_from_blank(sp, NEWTEXT(sp, from)) + : update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) + + update_cost(sp, OLDTEXT(sp, from), NEWTEXT(sp, to)))) + ? TRUE : FALSE; } static void -grow_hunks(void) +grow_hunks(SCREEN *sp) { int start, end, shift; int back_limit, forward_limit; /* limits for cells to fill */ @@ -200,35 +204,36 @@ grow_hunks(void) back_ref_limit = 0; i = 0; - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) i++; - for (; i < screen_lines; i = next_hunk) { + for (; i < screen_lines(sp); i = next_hunk) { start = i; - shift = OLDNUM(i) - i; + shift = OLDNUM(sp, i) - i; /* get forward limit */ i = start + 1; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(sp) + && OLDNUM(sp, i) != _NEWINDEX + && OLDNUM(sp, i) - i == shift) i++; end = i; - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) i++; next_hunk = i; forward_limit = i; - if (i >= screen_lines || OLDNUM(i) >= i) + if (i >= screen_lines(sp) || OLDNUM(sp, i) >= i) forward_ref_limit = i; else - forward_ref_limit = OLDNUM(i); + forward_ref_limit = OLDNUM(sp, i); i = start - 1; /* grow back */ if (shift < 0) back_limit = back_ref_limit + (-shift); while (i >= back_limit) { - if (newhash[i] == oldhash[i + shift] - || cost_effective(i + shift, i, shift < 0)) { - OLDNUM(i) = i + shift; + if (newhash(sp)[i] == oldhash(sp)[i + shift] + || cost_effective(sp, i + shift, i, shift < 0)) { + OLDNUM(sp, i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (backward continuation)", i, i + shift)); @@ -246,9 +251,9 @@ grow_hunks(void) if (shift > 0) forward_limit = forward_ref_limit - shift; while (i < forward_limit) { - if (newhash[i] == oldhash[i + shift] - || cost_effective(i + shift, i, shift > 0)) { - OLDNUM(i) = i + shift; + if (newhash(sp)[i] == oldhash(sp)[i + shift] + || cost_effective(sp, i + shift, i, shift > 0)) { + OLDNUM(sp, i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (forward continuation)", i, i + shift)); @@ -268,51 +273,54 @@ grow_hunks(void) } NCURSES_EXPORT(void) -_nc_hash_map(void) +NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) { - HASHMAP *sp; + HASHMAP *hsp; register int i; int start, shift, size; - if (screen_lines > lines_alloc) { - if (hashtab) - free(hashtab); - hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2); - if (!hashtab) { - if (oldhash) { - FreeAndNull(oldhash); + if (screen_lines(SP_PARM) > lines_alloc(SP_PARM)) { + if (hashtab(SP_PARM)) + free(hashtab(SP_PARM)); + hashtab(SP_PARM) = typeMalloc(HASHMAP, + ((size_t) screen_lines(SP_PARM) + 1) * 2); + if (!hashtab(SP_PARM)) { + if (oldhash(SP_PARM)) { + FreeAndNull(oldhash(SP_PARM)); } - lines_alloc = 0; + lines_alloc(SP_PARM) = 0; return; } - lines_alloc = screen_lines; + lines_alloc(SP_PARM) = screen_lines(SP_PARM); } - if (oldhash && newhash) { + if (oldhash(SP_PARM) && newhash(SP_PARM)) { /* re-hash only changed lines */ - for (i = 0; i < screen_lines; i++) { - if (PENDING(i)) - newhash[i] = hash(NEWTEXT(i)); + for (i = 0; i < screen_lines(SP_PARM); i++) { + if (PENDING(SP_PARM, i)) + newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); } } else { /* re-hash all */ - if (oldhash == 0) - oldhash = typeCalloc(unsigned long, (unsigned) screen_lines); - if (newhash == 0) - newhash = typeCalloc(unsigned long, (unsigned) screen_lines); - if (!oldhash || !newhash) + if (oldhash(SP_PARM) == 0) + oldhash(SP_PARM) = typeCalloc(unsigned long, + (size_t) screen_lines(SP_PARM)); + if (newhash(SP_PARM) == 0) + newhash(SP_PARM) = typeCalloc(unsigned long, + (size_t) screen_lines(SP_PARM)); + if (!oldhash(SP_PARM) || !newhash(SP_PARM)) return; /* malloc failure */ - for (i = 0; i < screen_lines; i++) { - newhash[i] = hash(NEWTEXT(i)); - oldhash[i] = hash(OLDTEXT(i)); + for (i = 0; i < screen_lines(SP_PARM); i++) { + newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } } #ifdef HASH_VERIFY - for (i = 0; i < screen_lines; i++) { - if (newhash[i] != hash(NEWTEXT(i))) + for (i = 0; i < screen_lines(SP_PARM); i++) { + if (newhash(SP_PARM)[i] != hash(SP_PARM, NEWTEXT(SP_PARM, i))) fprintf(stderr, "error in newhash[%d]\n", i); - if (oldhash[i] != hash(OLDTEXT(i))) + if (oldhash(SP_PARM)[i] != hash(SP_PARM, OLDTEXT(SP_PARM, i))) fprintf(stderr, "error in oldhash[%d]\n", i); } #endif @@ -320,28 +328,30 @@ _nc_hash_map(void) /* * Set up and count line-hash values. */ - memset(hashtab, '\0', sizeof(*hashtab) * (screen_lines + 1) * 2); - for (i = 0; i < screen_lines; i++) { - unsigned long hashval = oldhash[i]; + memset(hashtab(SP_PARM), '\0', + sizeof(*(hashtab(SP_PARM))) + * ((size_t) screen_lines(SP_PARM) + 1) * 2); + for (i = 0; i < screen_lines(SP_PARM); i++) { + unsigned long hashval = oldhash(SP_PARM)[i]; - for (sp = hashtab; sp->hashval; sp++) - if (sp->hashval == hashval) + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->hashval == hashval) break; - sp->hashval = hashval; /* in case this is a new entry */ - sp->oldcount++; - sp->oldindex = i; + hsp->hashval = hashval; /* in case this is a new entry */ + hsp->oldcount++; + hsp->oldindex = i; } - for (i = 0; i < screen_lines; i++) { - unsigned long hashval = newhash[i]; + for (i = 0; i < screen_lines(SP_PARM); i++) { + unsigned long hashval = newhash(SP_PARM)[i]; - for (sp = hashtab; sp->hashval; sp++) - if (sp->hashval == hashval) + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->hashval == hashval) break; - sp->hashval = hashval; /* in case this is a new entry */ - sp->newcount++; - sp->newindex = i; + hsp->hashval = hashval; /* in case this is a new entry */ + hsp->newcount++; + hsp->newindex = i; - OLDNUM(i) = _NEWINDEX; /* initialize old indices array */ + OLDNUM(SP_PARM, i) = _NEWINDEX; /* initialize old indices array */ } /* @@ -351,16 +361,16 @@ _nc_hash_map(void) * extending hunks by cost_effective. Otherwise, it does not * have any side effects. */ - for (sp = hashtab; sp->hashval; sp++) - if (sp->oldcount == 1 && sp->newcount == 1 - && sp->oldindex != sp->newindex) { + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->oldcount == 1 && hsp->newcount == 1 + && hsp->oldindex != hsp->newindex) { TR(TRACE_UPDATE | TRACE_MOVE, ("new line %d is hash-identical to old line %d (unique)", - sp->newindex, sp->oldindex)); - OLDNUM(sp->newindex) = sp->oldindex; + hsp->newindex, hsp->oldindex)); + OLDNUM(SP_PARM, hsp->newindex) = hsp->oldindex; } - grow_hunks(); + grow_hunks(SP_PARM); /* * Eliminate bad or impossible shifts -- this includes removing @@ -368,58 +378,83 @@ _nc_hash_map(void) * those which are to be moved too far, they are likely to destroy * more than carry. */ - for (i = 0; i < screen_lines;) { - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + for (i = 0; i < screen_lines(SP_PARM);) { + while (i < screen_lines(SP_PARM) && OLDNUM(SP_PARM, i) == _NEWINDEX) i++; - if (i >= screen_lines) + if (i >= screen_lines(SP_PARM)) break; start = i; - shift = OLDNUM(i) - i; + shift = OLDNUM(SP_PARM, i) - i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(SP_PARM) + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) i++; size = i - start; if (size < 3 || size + min(size / 8, 2) < abs(shift)) { while (start < i) { - OLDNUM(start) = _NEWINDEX; + OLDNUM(SP_PARM, start) = _NEWINDEX; start++; } } } /* After clearing invalid hunks, try grow the rest. */ - grow_hunks(); + grow_hunks(SP_PARM); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_hash_map(void) +{ + NCURSES_SP_NAME(_nc_hash_map) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_DCLx int i) +{ + if (oldhash(SP_PARM)) + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_make_oldhash(int i) { - if (oldhash) - oldhash[i] = hash(OLDTEXT(i)); + NCURSES_SP_NAME(_nc_make_oldhash) (CURRENT_SCREEN, i); } +#endif NCURSES_EXPORT(void) -_nc_scroll_oldhash(int n, int top, int bot) +NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_DCLx int n, int top, int bot) { size_t size; int i; - if (!oldhash) + if (!oldhash(SP_PARM)) return; - size = sizeof(*oldhash) * (bot - top + 1 - abs(n)); + size = sizeof(*(oldhash(SP_PARM))) * (size_t) (bot - top + 1 - abs(n)); if (n > 0) { - memmove(oldhash + top, oldhash + top + n, size); + memmove(oldhash(SP_PARM) + top, oldhash(SP_PARM) + top + n, size); for (i = bot; i > bot - n; i--) - oldhash[i] = hash(OLDTEXT(i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } else { - memmove(oldhash + top - n, oldhash + top, size); + memmove(oldhash(SP_PARM) + top - n, oldhash(SP_PARM) + top, size); for (i = top; i < top - n; i++) - oldhash[i] = hash(OLDTEXT(i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_scroll_oldhash(int n, int top, int bot) +{ + NCURSES_SP_NAME(_nc_scroll_oldhash) (CURRENT_SCREEN, n, top, bot); +} +#endif + #ifdef HASHDEBUG static void usage(void) diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 8e66fa3bf64..ad41f8dd72d 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -109,8 +110,8 @@ * LONG_DIST and (b) further inward from the right or left edge than LONG_DIST, * we'll consider nonlocal. */ -#define NOT_LOCAL(fy, fx, ty, tx) ((tx > LONG_DIST) \ - && (tx < screen_columns - 1 - LONG_DIST) \ +#define NOT_LOCAL(sp, fy, fx, ty, tx) ((tx > LONG_DIST) \ + && (tx < screen_columns(sp) - 1 - LONG_DIST) \ && (abs(ty-fy) + abs(tx-fx) > LONG_DIST)) /**************************************************************************** @@ -152,13 +153,21 @@ */ #include -#include #include -MODULE_ID("$Id: lib_mvcur.c,v 1.113 2008/08/16 19:30:58 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define WANT_CHAR(y, x) SP->_newscr->_line[y].text[x] /* desired state */ -#define BAUDRATE cur_term->_baudrate /* bits per second */ +MODULE_ID("$Id: lib_mvcur.c,v 1.126 2011/01/22 19:48:21 tom Exp $") + +#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ + +#if NCURSES_SP_FUNCS +#define BAUDRATE(sp) sp->_term->_baudrate /* bits per second */ +#else +#define BAUDRATE(sp) cur_term->_baudrate /* bits per second */ +#endif #if defined(MAIN) || defined(NCURSES_TEST) #include @@ -169,7 +178,7 @@ static float diff; #define OPT_SIZE 512 -static int normalized_cost(const char *const cap, int affcnt); +static int normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt); /**************************************************************************** * @@ -179,34 +188,34 @@ static int normalized_cost(const char *const cap, int affcnt); #ifdef TRACE static int -trace_cost_of(const char *capname, const char *cap, int affcnt) +trace_cost_of(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) { - int result = _nc_msec_cost(cap, affcnt); + int result = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("CostOf %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define CostOf(cap,affcnt) trace_cost_of(#cap,cap,affcnt); +#define CostOf(cap,affcnt) trace_cost_of(NCURSES_SP_ARGx #cap, cap, affcnt) static int -trace_normalized_cost(const char *capname, const char *cap, int affcnt) +trace_normalized_cost(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) { - int result = normalized_cost(cap, affcnt); + int result = normalized_cost(NCURSES_SP_ARGx cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define NormalizedCost(cap,affcnt) trace_normalized_cost(#cap,cap,affcnt); +#define NormalizedCost(cap,affcnt) trace_normalized_cost(NCURSES_SP_ARGx #cap, cap, affcnt) #else -#define CostOf(cap,affcnt) _nc_msec_cost(cap,affcnt); -#define NormalizedCost(cap,affcnt) normalized_cost(cap,affcnt); +#define CostOf(cap,affcnt) NCURSES_SP_NAME(_nc_msec_cost)(NCURSES_SP_ARGx cap, affcnt) +#define NormalizedCost(cap,affcnt) normalized_cost(NCURSES_SP_ARGx cap, affcnt) #endif NCURSES_EXPORT(int) -_nc_msec_cost(const char *const cap, int affcnt) +NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcnt) /* compute the cost of a given operation */ { if (cap == 0) @@ -222,53 +231,68 @@ _nc_msec_cost(const char *const cap, int affcnt) for (cp += 2; *cp != '>'; cp++) { if (isdigit(UChar(*cp))) - number = number * 10 + (*cp - '0'); + number = number * 10 + (float) (*cp - '0'); else if (*cp == '*') - number *= affcnt; + number *= (float) affcnt; else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) - number += (*cp - '0') / 10.0; + number += (float) ((*cp - '0') / 10.0); } #if NCURSES_NO_PADDING - if (!GetNoPadding(SP)) + if (!GetNoPadding(SP_PARM)) #endif cum_cost += number * 10; - } else - cum_cost += SP->_char_padding; + } else if (SP_PARM) { + cum_cost += (float) SP_PARM->_char_padding; + } } return ((int) cum_cost); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_msec_cost(const char *const cap, int affcnt) +{ + return NCURSES_SP_NAME(_nc_msec_cost) (CURRENT_SCREEN, cap, affcnt); +} +#endif + static int -normalized_cost(const char *const cap, int affcnt) +normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt) /* compute the effective character-count for an operation (round up) */ { - int cost = _nc_msec_cost(cap, affcnt); + int cost = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); if (cost != INFINITY) - cost = (cost + SP->_char_padding - 1) / SP->_char_padding; + cost = (cost + SP_PARM->_char_padding - 1) / SP_PARM->_char_padding; return cost; } static void -reset_scroll_region(void) +reset_scroll_region(NCURSES_SP_DCL0) /* Set the scroll-region to a known state (the default) */ { if (change_scroll_region) { - TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, screen_lines - 1)); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "change_scroll_region", + TPARM_2(change_scroll_region, + 0, screen_lines(SP_PARM) - 1)); } } NCURSES_EXPORT(void) -_nc_mvcur_resume(void) +NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0) /* what to do at initialization time and after each shellout */ { + if (SP_PARM && !IsTermInfo(SP_PARM)) + return; + /* initialize screen for cursor access */ if (enter_ca_mode) { - TPUTS_TRACE("enter_ca_mode"); - putp(enter_ca_mode); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "enter_ca_mode", + enter_ca_mode); } /* @@ -280,53 +304,63 @@ _nc_mvcur_resume(void) * they know the screen size. This is useful when you're running * a vt100 emulation through xterm. */ - reset_scroll_region(); - SP->_cursrow = SP->_curscol = -1; + reset_scroll_region(NCURSES_SP_ARG); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; /* restore cursor shape */ - if (SP->_cursor != -1) { - int cursor = SP->_cursor; - SP->_cursor = -1; - curs_set(cursor); + if (SP_PARM->_cursor != -1) { + int cursor = SP_PARM->_cursor; + SP_PARM->_cursor = -1; + NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx cursor); } } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_init(void) +_nc_mvcur_resume(void) +{ + NCURSES_SP_NAME(_nc_mvcur_resume) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) /* initialize the cost structure */ { - if (isatty(fileno(SP->_ofp))) - SP->_char_padding = ((BAUDBYTE * 1000 * 10) - / (BAUDRATE > 0 ? BAUDRATE : 9600)); + if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp))) + SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10) + / (BAUDRATE(SP_PARM) > 0 + ? BAUDRATE(SP_PARM) + : 9600)); else - SP->_char_padding = 1; /* must be nonzero */ - if (SP->_char_padding <= 0) - SP->_char_padding = 1; /* must be nonzero */ - TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP->_char_padding)); + SP_PARM->_char_padding = 1; /* must be nonzero */ + if (SP_PARM->_char_padding <= 0) + SP_PARM->_char_padding = 1; /* must be nonzero */ + TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP_PARM->_char_padding)); /* non-parameterized local-motion strings */ - SP->_cr_cost = CostOf(carriage_return, 0); - SP->_home_cost = CostOf(cursor_home, 0); - SP->_ll_cost = CostOf(cursor_to_ll, 0); + SP_PARM->_cr_cost = CostOf(carriage_return, 0); + SP_PARM->_home_cost = CostOf(cursor_home, 0); + SP_PARM->_ll_cost = CostOf(cursor_to_ll, 0); #if USE_HARD_TABS if (getenv("NCURSES_NO_HARD_TABS") == 0) { - SP->_ht_cost = CostOf(tab, 0); - SP->_cbt_cost = CostOf(back_tab, 0); + SP_PARM->_ht_cost = CostOf(tab, 0); + SP_PARM->_cbt_cost = CostOf(back_tab, 0); } else { - SP->_ht_cost = INFINITY; - SP->_cbt_cost = INFINITY; + SP_PARM->_ht_cost = INFINITY; + SP_PARM->_cbt_cost = INFINITY; } #endif /* USE_HARD_TABS */ - SP->_cub1_cost = CostOf(cursor_left, 0); - SP->_cuf1_cost = CostOf(cursor_right, 0); - SP->_cud1_cost = CostOf(cursor_down, 0); - SP->_cuu1_cost = CostOf(cursor_up, 0); + SP_PARM->_cub1_cost = CostOf(cursor_left, 0); + SP_PARM->_cuf1_cost = CostOf(cursor_right, 0); + SP_PARM->_cud1_cost = CostOf(cursor_down, 0); + SP_PARM->_cuu1_cost = CostOf(cursor_up, 0); - SP->_smir_cost = CostOf(enter_insert_mode, 0); - SP->_rmir_cost = CostOf(exit_insert_mode, 0); - SP->_ip_cost = 0; + SP_PARM->_smir_cost = CostOf(enter_insert_mode, 0); + SP_PARM->_rmir_cost = CostOf(exit_insert_mode, 0); + SP_PARM->_ip_cost = 0; if (insert_padding) { - SP->_ip_cost = CostOf(insert_padding, 0); + SP_PARM->_ip_cost = CostOf(insert_padding, 0); } /* @@ -335,7 +369,7 @@ _nc_mvcur_init(void) * can treat it like absolute screen addressing. This seems to be true * for all cursor_mem_address terminal types in the terminfo database. */ - SP->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; + SP_PARM->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; /* * Parametrized local-motion strings. This static cost computation @@ -361,40 +395,43 @@ _nc_mvcur_init(void) * All these averages depend on the assumption that all parameter values * are equally probable. */ - SP->_cup_cost = CostOf(TPARM_2(SP->_address_cursor, 23, 23), 1); - SP->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); - SP->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); - SP->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); - SP->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); - SP->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); - SP->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); + SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1); + SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); + SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); + SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); + SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); + SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); /* non-parameterized screen-update strings */ - SP->_ed_cost = NormalizedCost(clr_eos, 1); - SP->_el_cost = NormalizedCost(clr_eol, 1); - SP->_el1_cost = NormalizedCost(clr_bol, 1); - SP->_dch1_cost = NormalizedCost(delete_character, 1); - SP->_ich1_cost = NormalizedCost(insert_character, 1); + SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1); + SP_PARM->_el_cost = NormalizedCost(clr_eol, 1); + SP_PARM->_el1_cost = NormalizedCost(clr_bol, 1); + SP_PARM->_dch1_cost = NormalizedCost(delete_character, 1); + SP_PARM->_ich1_cost = NormalizedCost(insert_character, 1); /* * If this is a bce-terminal, we want to bias the choice so we use clr_eol * rather than spaces at the end of a line. */ if (back_color_erase) - SP->_el_cost = 0; + SP_PARM->_el_cost = 0; /* parameterized screen-update strings */ - SP->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); - SP->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); - SP->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); - SP->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); + SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); + SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); + SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); + SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); - SP->_cup_ch_cost = NormalizedCost(TPARM_2(SP->_address_cursor, 23, 23), 1); - SP->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); - SP->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); - SP->_inline_cost = min(SP->_cup_ch_cost, - min(SP->_hpa_ch_cost, - SP->_cuf_ch_cost)); + SP_PARM->_cup_ch_cost = NormalizedCost( + TPARM_2(SP_PARM->_address_cursor, + 23, 23), + 1); + SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); + SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost, + min(SP_PARM->_hpa_ch_cost, + SP_PARM->_cuf_ch_cost)); /* * If save_cursor is used within enter_ca_mode, we should not use it for @@ -411,30 +448,42 @@ _nc_mvcur_init(void) } /* - * A different, possibly better way to arrange this would be to set - * SP->_endwin = TRUE at window initialization time and let this be + * A different, possibly better way to arrange this would be to set the + * SCREEN's _endwin to TRUE at window initialization time and let this be * called by doupdate's return-from-shellout code. */ - _nc_mvcur_resume(); + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_wrap(void) +_nc_mvcur_init(void) +{ + NCURSES_SP_NAME(_nc_mvcur_init) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0) /* wrap up cursor-addressing mode */ { /* leave cursor at screen bottom */ - mvcur(-1, -1, screen_lines - 1, 0); + TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0); + + if (!SP_PARM || !IsTermInfo(SP_PARM)) + return; /* set cursor to normal mode */ - if (SP->_cursor != -1) { - int cursor = SP->_cursor; - curs_set(1); - SP->_cursor = cursor; + if (SP_PARM->_cursor != -1) { + int cursor = SP_PARM->_cursor; + NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx 1); + SP_PARM->_cursor = cursor; } if (exit_ca_mode) { - TPUTS_TRACE("exit_ca_mode"); - putp(exit_ca_mode); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "exit_ca_mode", + exit_ca_mode); } /* * Reset terminal's tab counter. There's a long-time bug that @@ -444,9 +493,17 @@ _nc_mvcur_wrap(void) * escape sequences that reset things as column positions. * Utter a \r to reset this invisibly. */ - _nc_outch('\r'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_mvcur_wrap(void) +{ + NCURSES_SP_NAME(_nc_mvcur_wrap) (CURRENT_SCREEN); +} +#endif + /**************************************************************************** * * Optimized cursor movement @@ -459,7 +516,7 @@ _nc_mvcur_wrap(void) static NCURSES_INLINE int repeated_append(string_desc * target, int total, int num, int repeat, const char *src) { - size_t need = repeat * strlen(src); + size_t need = (size_t) repeat * strlen(src); if (need < target->s_size) { while (repeat-- > 0) { @@ -486,8 +543,13 @@ repeated_append(string_desc * target, int total, int num, int repeat, const char #define LASTTAB(fr) ((fr > 0) ? ((fr - 1) / init_tabs) * init_tabs : -1) static int -relative_move(string_desc * target, int from_y, int from_x, int to_y, int - to_x, bool ovw) +relative_move(NCURSES_SP_DCLx + string_desc * target, + int from_y, + int from_x, + int to_y, + int to_x, + bool ovw) /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */ { string_desc save; @@ -500,38 +562,38 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (row_address != 0 && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) { - vcost = SP->_vpa_cost; + vcost = SP_PARM->_vpa_cost; } if (to_y > from_y) { n = (to_y - from_y); if (parm_down_cursor - && SP->_cud_cost < vcost + && SP_PARM->_cud_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_down_cursor, n))) { - vcost = SP->_cud_cost; + vcost = SP_PARM->_cud_cost; } if (cursor_down - && (*cursor_down != '\n' || SP->_nl) - && (n * SP->_cud1_cost < vcost)) { + && (*cursor_down != '\n' || SP_PARM->_nl) + && (n * SP_PARM->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP->_cud1_cost, n, cursor_down); + SP_PARM->_cud1_cost, n, cursor_down); } } else { /* (to_y < from_y) */ n = (from_y - to_y); if (parm_up_cursor - && SP->_cuu_cost < vcost + && SP_PARM->_cuu_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_up_cursor, n))) { - vcost = SP->_cuu_cost; + vcost = SP_PARM->_cuu_cost; } - if (cursor_up && (n * SP->_cuu1_cost < vcost)) { + if (cursor_up && (n * SP_PARM->_cuu1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP->_cuu1_cost, n, cursor_up); + SP_PARM->_cuu1_cost, n, cursor_up); } } @@ -550,17 +612,17 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (column_address && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(column_address, to_x))) { - hcost = SP->_hpa_cost; + hcost = SP_PARM->_hpa_cost; } if (to_x > from_x) { n = to_x - from_x; if (parm_right_cursor - && SP->_cuf_cost < hcost + && SP_PARM->_cuf_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_right_cursor, n))) { - hcost = SP->_cuf_cost; + hcost = SP_PARM->_cuf_cost; } if (cursor_right) { @@ -575,7 +637,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int for (fr = from_x; (nxt = NEXTTAB(fr)) <= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP->_ht_cost, 1, tab); + SP_PARM->_ht_cost, 1, tab); if (lhcost == INFINITY) break; } @@ -599,7 +661,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int && n < (int) check.s_size && vcost == 0 && str[0] == '\0') { - int wanted = CharOf(WANT_CHAR(to_y, from_x)); + int wanted = CharOf(WANT_CHAR(SP_PARM, to_y, from_x)); if (is8bits(wanted) && isdigit(wanted)) ovw = FALSE; } @@ -616,8 +678,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) { - NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i); - if (!SameAttrOf(ch, SCREEN_ATTRS(SP)) + NCURSES_CH_T ch = WANT_CHAR(SP_PARM, to_y, from_x + i); + if (!SameAttrOf(ch, SCREEN_ATTRS(SP_PARM)) #if USE_WIDEC_SUPPORT || !Charable(ch) #endif @@ -631,13 +693,13 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) - *check.s_tail++ = (char) CharOf(WANT_CHAR(to_y, + *check.s_tail++ = (char) CharOf(WANT_CHAR(SP_PARM, to_y, from_x + i)); *check.s_tail = '\0'; - check.s_size -= n; - lhcost += n * SP->_char_padding; + check.s_size -= (size_t) n; + lhcost += n * SP_PARM->_char_padding; } else { - lhcost = repeated_append(&check, lhcost, SP->_cuf1_cost, + lhcost = repeated_append(&check, lhcost, SP_PARM->_cuf1_cost, n, cursor_right); } @@ -650,10 +712,10 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int n = from_x - to_x; if (parm_left_cursor - && SP->_cub_cost < hcost + && SP_PARM->_cub_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_left_cursor, n))) { - hcost = SP->_cub_cost; + hcost = SP_PARM->_cub_cost; } if (cursor_left) { @@ -667,7 +729,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int for (fr = from_x; (nxt = LASTTAB(fr)) >= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP->_cbt_cost, 1, back_tab); + SP_PARM->_cbt_cost, + 1, back_tab); if (lhcost == INFINITY) break; } @@ -676,7 +739,9 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int } #endif /* USE_HARD_TABS */ - lhcost = repeated_append(&check, lhcost, SP->_cub1_cost, n, cursor_left); + lhcost = repeated_append(&check, lhcost, + SP_PARM->_cub1_cost, + n, cursor_left); if (lhcost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), str)) { @@ -705,7 +770,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int */ static NCURSES_INLINE int -onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) +onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) /* onscreen move from (yold, xold) to (ynew, xnew) */ { string_desc result; @@ -723,9 +788,9 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) #define InitResult _nc_str_init(&result, buffer, sizeof(buffer)) /* tactic #0: use direct cursor addressing */ - if (_nc_safe_strcpy(InitResult, TPARM_2(SP->_address_cursor, ynew, xnew))) { + if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) { tactic = 0; - usecost = SP->_cup_cost; + usecost = SP_PARM->_cup_cost; #if defined(TRACE) || defined(NCURSES_TEST) if (!(_nc_optimize_enable & OPTIMIZE_MVCUR)) @@ -740,7 +805,7 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) * (like, say, local-movement \n getting mapped to some obscure * character because A_ALTCHARSET is on). */ - if (yold == -1 || xold == -1 || NOT_LOCAL(yold, xold, ynew, xnew)) { + if (yold == -1 || xold == -1 || NOT_LOCAL(SP_PARM, yold, xold, ynew, xnew)) { #if defined(MAIN) || defined(NCURSES_TEST) if (!profiling) { (void) fputs("nonlocal\n", stderr); @@ -754,8 +819,10 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) #ifndef NO_OPTIMIZE /* tactic #1: use local movement */ if (yold != -1 && xold != -1 - && ((newcost = relative_move(NullResult, yold, xold, ynew, xnew, - ovw)) != INFINITY) + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold, xold, + ynew, xnew, ovw)) != INFINITY) && newcost < usecost) { tactic = 1; usecost = newcost; @@ -763,42 +830,51 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) /* tactic #2: use carriage-return + local movement */ if (yold != -1 && carriage_return - && ((newcost = relative_move(NullResult, yold, 0, ynew, xnew, ovw)) - != INFINITY) - && SP->_cr_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_cr_cost + newcost < usecost) { tactic = 2; - usecost = SP->_cr_cost + newcost; + usecost = SP_PARM->_cr_cost + newcost; } /* tactic #3: use home-cursor + local movement */ if (cursor_home - && ((newcost = relative_move(NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY) - && SP->_home_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + 0, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_home_cost + newcost < usecost) { tactic = 3; - usecost = SP->_home_cost + newcost; + usecost = SP_PARM->_home_cost + newcost; } /* tactic #4: use home-down + local movement */ if (cursor_to_ll - && ((newcost = relative_move(NullResult, screen_lines - 1, 0, ynew, - xnew, ovw)) != INFINITY) - && SP->_ll_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + screen_lines(SP_PARM) - 1, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_ll_cost + newcost < usecost) { tactic = 4; - usecost = SP->_ll_cost + newcost; + usecost = SP_PARM->_ll_cost + newcost; } /* * tactic #5: use left margin for wrap to right-hand side, * unless strange wrap behavior indicated by xenl might hose us. */ - t5_cr_cost = (xold > 0 ? SP->_cr_cost : 0); + t5_cr_cost = (xold > 0 ? SP_PARM->_cr_cost : 0); if (auto_left_margin && !eat_newline_glitch && yold > 0 && cursor_left - && ((newcost = relative_move(NullResult, yold - 1, screen_columns - - 1, ynew, xnew, ovw)) != INFINITY) - && t5_cr_cost + SP->_cub1_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold - 1, screen_columns(SP_PARM) - 1, + ynew, xnew, ovw)) != INFINITY) + && t5_cr_cost + SP_PARM->_cub1_cost + newcost < usecost) { tactic = 5; - usecost = t5_cr_cost + SP->_cub1_cost + newcost; + usecost = t5_cr_cost + SP_PARM->_cub1_cost + newcost; } /* @@ -808,26 +884,39 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) InitResult; switch (tactic) { case 1: - (void) relative_move(&result, yold, xold, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold, xold, + ynew, xnew, ovw); break; case 2: (void) _nc_safe_strcpy(&result, carriage_return); - (void) relative_move(&result, yold, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold, 0, + ynew, xnew, ovw); break; case 3: (void) _nc_safe_strcpy(&result, cursor_home); - (void) relative_move(&result, 0, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, 0, 0, + ynew, xnew, ovw); break; case 4: (void) _nc_safe_strcpy(&result, cursor_to_ll); - (void) relative_move(&result, screen_lines - 1, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + screen_lines(SP_PARM) - 1, 0, + ynew, xnew, ovw); break; case 5: if (xold > 0) (void) _nc_safe_strcat(&result, carriage_return); (void) _nc_safe_strcat(&result, cursor_left); - (void) relative_move(&result, yold - 1, screen_columns - 1, ynew, - xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold - 1, screen_columns(SP_PARM) - 1, + ynew, xnew, ovw); break; } #endif /* !NO_OPTIMIZE */ @@ -845,25 +934,26 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) if (usecost != INFINITY) { TPUTS_TRACE("mvcur"); - tputs(buffer, 1, _nc_outch); - SP->_cursrow = ynew; - SP->_curscol = xnew; + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + buffer, 1, NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_cursrow = ynew; + SP_PARM->_curscol = xnew; return (OK); } else return (ERR); } NCURSES_EXPORT(int) -mvcur(int yold, int xold, int ynew, int xnew) +TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { NCURSES_CH_T oldattr; int code; - TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"), - yold, xold, ynew, xnew)); + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), + (void *) SP_PARM, yold, xold, ynew, xnew)); - if (SP == 0) { + if (SP_PARM == 0) { code = ERR; } else if (yold == ynew && xold == xnew) { code = OK; @@ -874,9 +964,9 @@ mvcur(int yold, int xold, int ynew, int xnew) * column position implied by wraparound or the lack thereof and * rolling up the screen to get ynew on the screen. */ - if (xnew >= screen_columns) { - ynew += xnew / screen_columns; - xnew %= screen_columns; + if (xnew >= screen_columns(SP_PARM)) { + ynew += xnew / screen_columns(SP_PARM); + xnew %= screen_columns(SP_PARM); } /* @@ -884,38 +974,40 @@ mvcur(int yold, int xold, int ynew, int xnew) * character set -- these have a strong tendency to screw up the CR & * LF used for local character motions! */ - oldattr = SCREEN_ATTRS(SP); + oldattr = SCREEN_ATTRS(SP_PARM); if ((AttrOf(oldattr) & A_ALTCHARSET) || (AttrOf(oldattr) && !move_standout_mode)) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(A_NORMAL, 0); + (void) VIDATTR(SP_PARM, A_NORMAL, 0); } - if (xold >= screen_columns) { + if (xold >= screen_columns(SP_PARM)) { int l; - if (SP->_nl) { - l = (xold + 1) / screen_columns; + if (SP_PARM->_nl) { + l = (xold + 1) / screen_columns(SP_PARM); yold += l; - if (yold >= screen_lines) - l -= (yold - screen_lines - 1); + if (yold >= screen_lines(SP_PARM)) + l -= (yold - screen_lines(SP_PARM) - 1); if (l > 0) { if (carriage_return) { - TPUTS_TRACE("carriage_return"); - putp(carriage_return); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "carriage_return", + carriage_return); } else - _nc_outch('\r'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); xold = 0; while (l > 0) { if (newline) { - TPUTS_TRACE("newline"); - putp(newline); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "newline", + newline); } else - _nc_outch('\n'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n'); l--; } } @@ -929,27 +1021,35 @@ mvcur(int yold, int xold, int ynew, int xnew) } } - if (yold > screen_lines - 1) - yold = screen_lines - 1; - if (ynew > screen_lines - 1) - ynew = screen_lines - 1; + if (yold > screen_lines(SP_PARM) - 1) + yold = screen_lines(SP_PARM) - 1; + if (ynew > screen_lines(SP_PARM) - 1) + ynew = screen_lines(SP_PARM) - 1; /* destination location is on screen now */ - code = onscreen_mvcur(yold, xold, ynew, xnew, TRUE); + code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE); /* * Restore attributes if we disabled them before moving. */ - if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP))) { + if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP_PARM))) { TR(TRACE_CHARPUT, ("turning on (%#lx) %s after move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(AttrOf(oldattr), GetPair(oldattr)); + (void) VIDATTR(SP_PARM, AttrOf(oldattr), GetPair(oldattr)); } } returnCode(code); } +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +mvcur(int yold, int xold, int ynew, int xnew) +{ + return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew); +} +#endif + #if defined(TRACE) || defined(NCURSES_TEST) NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; #endif @@ -1212,25 +1312,25 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) speeds[i], overhead, totalest); } } else if (buf[0] == 'c') { - (void) printf("char padding: %d\n", SP->_char_padding); - (void) printf("cr cost: %d\n", SP->_cr_cost); - (void) printf("cup cost: %d\n", SP->_cup_cost); - (void) printf("home cost: %d\n", SP->_home_cost); - (void) printf("ll cost: %d\n", SP->_ll_cost); + (void) printf("char padding: %d\n", CURRENT_SCREEN->_char_padding); + (void) printf("cr cost: %d\n", CURRENT_SCREEN->_cr_cost); + (void) printf("cup cost: %d\n", CURRENT_SCREEN->_cup_cost); + (void) printf("home cost: %d\n", CURRENT_SCREEN->_home_cost); + (void) printf("ll cost: %d\n", CURRENT_SCREEN->_ll_cost); #if USE_HARD_TABS - (void) printf("ht cost: %d\n", SP->_ht_cost); - (void) printf("cbt cost: %d\n", SP->_cbt_cost); + (void) printf("ht cost: %d\n", CURRENT_SCREEN->_ht_cost); + (void) printf("cbt cost: %d\n", CURRENT_SCREEN->_cbt_cost); #endif /* USE_HARD_TABS */ - (void) printf("cub1 cost: %d\n", SP->_cub1_cost); - (void) printf("cuf1 cost: %d\n", SP->_cuf1_cost); - (void) printf("cud1 cost: %d\n", SP->_cud1_cost); - (void) printf("cuu1 cost: %d\n", SP->_cuu1_cost); - (void) printf("cub cost: %d\n", SP->_cub_cost); - (void) printf("cuf cost: %d\n", SP->_cuf_cost); - (void) printf("cud cost: %d\n", SP->_cud_cost); - (void) printf("cuu cost: %d\n", SP->_cuu_cost); - (void) printf("hpa cost: %d\n", SP->_hpa_cost); - (void) printf("vpa cost: %d\n", SP->_vpa_cost); + (void) printf("cub1 cost: %d\n", CURRENT_SCREEN->_cub1_cost); + (void) printf("cuf1 cost: %d\n", CURRENT_SCREEN->_cuf1_cost); + (void) printf("cud1 cost: %d\n", CURRENT_SCREEN->_cud1_cost); + (void) printf("cuu1 cost: %d\n", CURRENT_SCREEN->_cuu1_cost); + (void) printf("cub cost: %d\n", CURRENT_SCREEN->_cub_cost); + (void) printf("cuf cost: %d\n", CURRENT_SCREEN->_cuf_cost); + (void) printf("cud cost: %d\n", CURRENT_SCREEN->_cud_cost); + (void) printf("cuu cost: %d\n", CURRENT_SCREEN->_cuu_cost); + (void) printf("hpa cost: %d\n", CURRENT_SCREEN->_hpa_cost); + (void) printf("vpa cost: %d\n", CURRENT_SCREEN->_vpa_cost); } else if (buf[0] == 'x' || buf[0] == 'q') break; else diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 06c8411caa4..70f805a2ad5 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -46,7 +46,7 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.37 2008/05/03 16:24:56 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.41 2010/05/15 21:31:12 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -59,16 +59,20 @@ static const char * signal_name(int sig) { switch (sig) { +#ifdef SIGALRM case SIGALRM: return "SIGALRM"; +#endif #ifdef SIGCONT case SIGCONT: return "SIGCONT"; #endif case SIGINT: return "SIGINT"; +#ifdef SIGQUIT case SIGQUIT: return "SIGQUIT"; +#endif case SIGTERM: return "SIGTERM"; #ifdef SIGTSTP @@ -136,6 +140,7 @@ signal_name(int sig) static void tstp(int dummy GCC_UNUSED) { + SCREEN *sp = CURRENT_SCREEN; sigset_t mask, omask; sigaction_t act, oact; @@ -154,11 +159,11 @@ tstp(int dummy GCC_UNUSED) * parent was stopped before us, and we would likely pick up the * settings already modified by the shell. */ - if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */ + if (sp != 0 && !sp->_endwin) /* don't do this if we're not in curses */ #if HAVE_TCGETPGRP if (tcgetpgrp(STDIN_FILENO) == getpgrp()) #endif - def_prog_mode(); + NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG); /* * Block window change and timer signals. The latter @@ -166,7 +171,9 @@ tstp(int dummy GCC_UNUSED) * to repaint the screen. */ (void) sigemptyset(&mask); +#ifdef SIGALRM (void) sigaddset(&mask, SIGALRM); +#endif #if USE_SIGWINCH (void) sigaddset(&mask, SIGWINCH); #endif @@ -185,7 +192,7 @@ tstp(int dummy GCC_UNUSED) * End window mode, which also resets the terminal state to the * original (pre-curses) modes. */ - endwin(); + NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); /* Unblock SIGTSTP. */ (void) sigemptyset(&mask); @@ -212,19 +219,19 @@ tstp(int dummy GCC_UNUSED) T(("SIGCONT received")); sigaction(SIGTSTP, &oact, NULL); - flushinp(); + NCURSES_SP_NAME(flushinp) (NCURSES_SP_ARG); /* * If the user modified the tty state while suspended, he wants * those changes to stick. So save the new "default" terminal state. */ - def_shell_mode(); + NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG); /* * This relies on the fact that doupdate() will restore the * program-mode tty state, and issue enter_ca_mode if need be. */ - doupdate(); + NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG); /* Reset the signals. */ (void) sigprocmask(SIG_SETMASK, &omask, NULL); @@ -234,6 +241,8 @@ tstp(int dummy GCC_UNUSED) static void cleanup(int sig) { + SCREEN *sp = CURRENT_SCREEN; + /* * Actually, doing any sort of I/O from within an signal handler is * "unsafe". But we'll _try_ to clean up the screen and terminal @@ -241,7 +250,10 @@ cleanup(int sig) */ if (!_nc_globals.cleanup_nested++ && (sig == SIGINT - || sig == SIGQUIT)) { +#ifdef SIGQUIT + || sig == SIGQUIT +#endif + )) { #if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t act; sigemptyset(&act.sa_mask); @@ -257,12 +269,12 @@ cleanup(int sig) if (scan->_ofp != 0 && isatty(fileno(scan->_ofp))) { scan->_cleanup = TRUE; - scan->_outch = _nc_outch; + scan->_outch = NCURSES_SP_NAME(_nc_outch); } set_term(scan); - endwin(); - if (SP) - SP->_endwin = FALSE; /* in case we have an atexit! */ + NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); + if (sp) + sp->_endwin = FALSE; /* in case we have an atexit! */ } } } @@ -274,6 +286,13 @@ static void sigwinch(int sig GCC_UNUSED) { _nc_globals.have_sigwinch = 1; +# if USE_PTHREADS_EINTR + if (_nc_globals.read_thread) { + if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) + pthread_kill(_nc_globals.read_thread, SIGWINCH); + _nc_globals.read_thread = 0; + } +# endif } #endif /* USE_SIGWINCH */ diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 16d12edbbe3..329ec29a019 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -65,10 +65,12 @@ # include # endif #endif - +#ifdef __MINGW32__ +# include +#endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.59 2008/08/30 20:08:19 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $") static long _nc_gettime(TimeType * t0, bool first) @@ -124,15 +126,27 @@ _nc_eventlist_timeout(_nc_eventlist * evl) } #endif /* NCURSES_WGETCH_EVENTS */ +#if (USE_FUNC_POLL || HAVE_SELECT) +# define MAYBE_UNUSED +#else +# define MAYBE_UNUSED GCC_UNUSED +#endif + +#if (USE_FUNC_POLL || HAVE_SELECT) +# define MAYBE_UNUSED +#else +# define MAYBE_UNUSED GCC_UNUSED +#endif + /* * Wait a specified number of milliseconds, returning nonzero if the timer * didn't expire before there is activity on the specified file descriptors. * The file-descriptors are specified by the mode: - * 0 - none (absolute time) - * 1 - ncurses' normal input-descriptor - * 2 - mouse descriptor, if any - * 3 - either input or mouse. - * + * TW_NONE 0 - none (absolute time) + * TW_INPUT 1 - ncurses' normal input-descriptor + * TW_MOUSE 2 - mouse descriptor, if any + * TW_ANY 3 - either input or mouse. + * TW_EVENT 4 - * Experimental: if NCURSES_WGETCH_EVENTS is defined, (mode & 4) determines * whether to pay attention to evl argument. If set, the smallest of * millisecond and of timeout of evl is taken. @@ -143,16 +157,18 @@ _nc_eventlist_timeout(_nc_eventlist * evl) * descriptors. */ NCURSES_EXPORT(int) -_nc_timed_wait(SCREEN *sp, - int mode, +_nc_timed_wait(SCREEN *sp MAYBE_UNUSED, + int mode MAYBE_UNUSED, int milliseconds, int *timeleft EVENTLIST_2nd(_nc_eventlist * evl)) { - int fd; int count; - int result = 0; + int result = TW_NONE; TimeType t0; +#if (USE_FUNC_POLL || HAVE_SELECT) + int fd; +#endif #ifdef NCURSES_WGETCH_EVENTS int timeout_is_event = 0; @@ -174,7 +190,7 @@ _nc_timed_wait(SCREEN *sp, milliseconds, mode)); #ifdef NCURSES_WGETCH_EVENTS - if (mode & 4) { + if (mode & TW_EVENT) { int event_delay = _nc_eventlist_timeout(evl); if (event_delay >= 0 @@ -193,7 +209,7 @@ _nc_timed_wait(SCREEN *sp, count = 0; #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) + if ((mode & TW_EVENT) && evl) evl->result_flags = 0; #endif @@ -201,23 +217,23 @@ _nc_timed_wait(SCREEN *sp, memset(fd_list, 0, sizeof(fd_list)); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) + if ((mode & TW_EVENT) && evl) fds = typeMalloc(struct pollfd, MIN_FDS + evl->count); #endif - if (mode & 1) { + if (mode & TW_INPUT) { fds[count].fd = sp->_ifd; fds[count].events = POLLIN; count++; } - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0) { fds[count].fd = fd; fds[count].events = POLLIN; count++; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -234,7 +250,7 @@ _nc_timed_wait(SCREEN *sp, result = poll(fds, (unsigned) count, milliseconds); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { int c; if (!result) @@ -276,8 +292,8 @@ _nc_timed_wait(SCREEN *sp, * * FIXME: this assumes mode&1 if milliseconds < 0 (see lib_getch.c). */ - result = 0; - if (mode & 1) { + result = TW_NONE; + if (mode & TW_INPUT) { int step = (milliseconds < 0) ? 0 : 5000; bigtime_t d; bigtime_t useconds = milliseconds * 1000; @@ -313,17 +329,17 @@ _nc_timed_wait(SCREEN *sp, */ FD_ZERO(&set); - if (mode & 1) { + if (mode & TW_INPUT) { FD_SET(sp->_ifd, &set); count = sp->_ifd + 1; } - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0) { FD_SET(fd, &set); count = max(fd, count) + 1; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -346,7 +362,7 @@ _nc_timed_wait(SCREEN *sp, } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { evl->result_flags = 0; for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -370,7 +386,7 @@ _nc_timed_wait(SCREEN *sp, returntime = _nc_gettime(&t0, FALSE); if (milliseconds >= 0) - milliseconds -= (returntime - starttime); + milliseconds -= (int) (returntime - starttime); #ifdef NCURSES_WGETCH_EVENTS if (evl) { @@ -428,22 +444,22 @@ _nc_timed_wait(SCREEN *sp, } } #elif defined(__BEOS__) - result = 1; /* redundant, but simple */ + result = TW_INPUT; /* redundant, but simple */ #elif HAVE_SELECT - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0 && FD_ISSET(fd, &set)) - result |= 2; - if ((mode & 1) + result |= TW_MOUSE; + if ((mode & TW_INPUT) && FD_ISSET(sp->_ifd, &set)) - result |= 1; + result |= TW_INPUT; #endif } else result = 0; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl && evl->result_flags) - result |= 4; + if ((mode & TW_EVENT) && evl && evl->result_flags) + result |= TW_EVENT; #endif return (result); diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index ac2a74f08e0..9656b3c70ee 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996 on * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -63,11 +64,16 @@ */ #include -#include -MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) +MODULE_ID("$Id: lib_vidattr.c,v 1.61 2010/06/05 22:22:04 tom Exp $") + +#define doPut(mode) \ + TPUTS_TRACE(#mode); \ + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -78,40 +84,49 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") /* if there is no current screen, assume we *can* do color */ #define SetColorsIf(why,old_attr) \ if (can_color && (why)) { \ - int old_pair = PAIR_NUMBER(old_attr); \ + int old_pair = PairNumber(old_attr); \ TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \ if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - _nc_do_color(old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \ + (short) old_pair, \ + (short) pair, \ + reverse, outc); \ } \ } #define PreviousAttr _nc_prescreen.previous_attr NCURSES_EXPORT(int) -vidputs(chtype newmode, int (*outc) (int)) +NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx + chtype newmode, + NCURSES_SP_OUTC outc) { attr_t turn_on, turn_off; int pair; bool reverse = FALSE; - bool can_color = (SP == 0 || SP->_coloron); + bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); + bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); #else #define fix_pair0 FALSE #endif newmode &= A_ATTRIBUTES; - T((T_CALLED("vidputs(%s)"), _traceattr(newmode))); + + T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); + + if (!IsTermInfo(SP_PARM)) + returnCode(ERR); /* this allows us to go on whether or not newterm() has been called */ - if (SP) - PreviousAttr = AttrOf(SCREEN_ATTRS(SP)); + if (SP_PARM) + PreviousAttr = AttrOf(SCREEN_ATTRS(SP_PARM)); TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(PreviousAttr))); - if ((SP != 0) + if ((SP_PARM != 0) && (magic_cookie_glitch > 0)) { #if USE_XMC_SUPPORT static const chtype table[] = @@ -135,7 +150,7 @@ vidputs(chtype newmode, int (*outc) (int)) * the terminfo max_attributes value. */ for (n = 0; n < SIZEOF(table); ++n) { - if ((table[n] & SP->_ok_attributes) == 0) { + if ((table[n] & SP_PARM->_ok_attributes) == 0) { newmode &= ~table[n]; } else if ((table[n] & newmode) != 0) { if (used++ >= limit) { @@ -148,7 +163,7 @@ vidputs(chtype newmode, int (*outc) (int)) } } #else - newmode &= ~(SP->_xmc_suppress); + newmode &= ~(SP_PARM->_xmc_suppress); #endif TR(TRACE_ATTRS, ("suppressed attribute is %s", _traceattr(newmode))); } @@ -172,7 +187,7 @@ vidputs(chtype newmode, int (*outc) (int)) * A_ALTCHARSET (256) down 2 to line up. We use the NCURSES_BITS * macro so this will work properly for the wide-character layout. */ - unsigned value = no_color_video; + unsigned value = (unsigned) no_color_video; attr_t mask = NCURSES_BITS((value & 63) | ((value & 192) << 1) | ((value & 256) >> 2), 8); @@ -188,7 +203,7 @@ vidputs(chtype newmode, int (*outc) (int)) if (newmode == PreviousAttr) returnCode(OK); - pair = PAIR_NUMBER(newmode); + pair = PairNumber(newmode); if (reverse) { newmode &= ~A_REVERSE; @@ -208,10 +223,10 @@ vidputs(chtype newmode, int (*outc) (int)) if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -222,16 +237,18 @@ vidputs(chtype newmode, int (*outc) (int)) } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - tputs(tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + tparm(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), + 1, outc); PreviousAttr &= ALL_BUT_COLOR; } SetColorsIf((pair != 0) || fix_pair0, PreviousAttr); @@ -241,11 +258,11 @@ vidputs(chtype newmode, int (*outc) (int)) TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -282,28 +299,53 @@ vidputs(chtype newmode, int (*outc) (int)) if (reverse) newmode |= A_REVERSE; - if (SP) - SetAttr(SCREEN_ATTRS(SP), newmode); + if (SP_PARM) + SetAttr(SCREEN_ATTRS(SP_PARM), newmode); else PreviousAttr = newmode; returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +vidputs(chtype newmode, NCURSES_OUTC outc) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, + newmode, + _nc_outc_wrapper); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode) +{ + T((T_CALLED("vidattr(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx + newmode, + NCURSES_SP_NAME(_nc_outch))); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) vidattr(chtype newmode) { - T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); - - returnCode(vidputs(newmode, _nc_outch)); + return NCURSES_SP_NAME(vidattr) (CURRENT_SCREEN, newmode); } +#endif NCURSES_EXPORT(chtype) -termattrs(void) +NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) { chtype attrs = A_NORMAL; - T((T_CALLED("termattrs()"))); + T((T_CALLED("termattrs(%p)"), (void *) SP_PARM)); +#ifdef USE_TERM_DRIVER + if (HasTerminal(SP_PARM)) + attrs = CallDriver(SP_PARM, conattr); +#else + if (enter_alt_charset_mode) attrs |= A_ALTCHARSET; @@ -331,8 +373,17 @@ termattrs(void) if (enter_underline_mode) attrs |= A_UNDERLINE; - if (SP->_coloron) + if (SP_PARM->_coloron) attrs |= A_COLOR; - returnChar(attrs); +#endif + returnChtype(attrs); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(chtype) +termattrs(void) +{ + return NCURSES_SP_NAME(termattrs) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 6a3a0c8e934..f0d2369c18d 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /*----------------------------------------------------------------- @@ -38,12 +39,16 @@ * * The routine doupdate() and its dependents. * All physical output is concentrated here (except _nc_outch() - * in lib_tputs.c). + * in lib_tputs.c). * *-----------------------------------------------------------------*/ #include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #if defined __HAIKU__ && defined __BEOS__ #undef __BEOS__ #endif @@ -76,9 +81,8 @@ #endif #include -#include -MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -91,7 +95,7 @@ MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") */ #define CHECK_INTERVAL 5 -#define FILL_BCE() (SP->_coloron && !SP->_default_color && !back_color_erase) +#define FILL_BCE(sp) (sp->_coloron && !sp->_default_color && !back_color_erase) static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_CH_T normal = NewChar(BLANK_TEXT); @@ -103,13 +107,23 @@ static NCURSES_CH_T normal = NewChar(BLANK_TEXT); */ /* #define POSITION_DEBUG */ -static NCURSES_INLINE NCURSES_CH_T ClrBlank(WINDOW *win); +static NCURSES_INLINE NCURSES_CH_T ClrBlank(NCURSES_SP_DCLx WINDOW *win); + +#if NCURSES_SP_FUNCS +static int ClrBottom(SCREEN *, int total); +static void ClearScreen(SCREEN *, NCURSES_CH_T blank); +static void ClrUpdate(SCREEN *); +static void DelChar(SCREEN *, int count); +static void InsStr(SCREEN *, NCURSES_CH_T * line, int count); +static void TransformLine(SCREEN *, int const lineno); +#else static int ClrBottom(int total); static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); static void InsStr(NCURSES_CH_T * line, int count); static void TransformLine(int const lineno); +#endif #ifdef POSITION_DEBUG /**************************************************************************** @@ -119,7 +133,7 @@ static void TransformLine(int const lineno); ****************************************************************************/ static void -position_check(int expected_y, int expected_x, char *legend) +position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) /* check to see if the real cursor position matches the virtual */ { char buf[20]; @@ -129,10 +143,10 @@ position_check(int expected_y, int expected_x, char *legend) if (!_nc_tracing || (expected_y < 0 && expected_x < 0)) return; - _nc_flush(); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); memset(buf, '\0', sizeof(buf)); - putp("\033[6n"); /* only works on ANSI-compatibles */ - _nc_flush(); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx "\033[6n"); /* only works on ANSI-compatibles */ + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); *(s = buf) = 0; do { int ask = sizeof(buf) - 1 - (s - buf); @@ -152,8 +166,12 @@ position_check(int expected_y, int expected_x, char *legend) if (expected_y < 0) expected_y = y - 1; if (y - 1 != expected_y || x - 1 != expected_x) { - beep(); - tputs(tparm("\033[%d;%dH", expected_y + 1, expected_x + 1), 1, _nc_outch); + NCURSES_SP_NAME(beep) (NCURSES_SP_ARG); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + tparm("\033[%d;%dH", + expected_y + 1, + expected_x + 1), + 1, NCURSES_SP_NAME(_nc_outch)); _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", y - 1, x - 1, expected_y, expected_x, legend); } else { @@ -162,7 +180,7 @@ position_check(int expected_y, int expected_x, char *legend) } } #else -#define position_check(expected_y, expected_x, legend) /* nothing */ +#define position_check(sp, expected_y, expected_x, legend) /* nothing */ #endif /* POSITION_DEBUG */ /**************************************************************************** @@ -172,19 +190,22 @@ position_check(int expected_y, int expected_x, char *legend) ****************************************************************************/ static NCURSES_INLINE void -GoTo(int const row, int const col) +GoTo(NCURSES_SP_DCLx int const row, int const col) { - TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", - row, col, SP->_cursrow, SP->_curscol)); + TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)", + (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); - position_check(SP->_cursrow, SP->_curscol, "GoTo"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo"); - mvcur(SP->_cursrow, SP->_curscol, row, col); - position_check(SP->_cursrow, SP->_curscol, "GoTo2"); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + row, col); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo2"); } static NCURSES_INLINE void -PutAttrChar(CARG_CH_T ch) +PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) { int chlen = 1; NCURSES_CH_T my_ch; @@ -194,7 +215,7 @@ PutAttrChar(CARG_CH_T ch) TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)", _tracech_t(ch), - SP->_cursrow, SP->_curscol)); + SP_PARM->_cursrow, SP_PARM->_curscol)); #if USE_WIDEC_SUPPORT /* * If this is not a valid character, there is nothing more to do. @@ -224,12 +245,12 @@ PutAttrChar(CARG_CH_T ch) */ if (is8bits(CharOf(CHDEREF(ch))) && (isprint(CharOf(CHDEREF(ch))) - || (SP->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) - || (SP->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) + || (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) + || (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) || (AttrOf(attr) & A_ALTCHARSET && ((CharOfD(ch) < ACS_LEN - && SP->_acs_map != 0 - && SP->_acs_map[CharOfD(ch)] != 0) + && SP_PARM->_acs_map != 0 + && SP_PARM->_acs_map[CharOfD(ch)] != 0) || (CharOfD(ch) >= 128))))) { ; } else { @@ -241,7 +262,7 @@ PutAttrChar(CARG_CH_T ch) #endif if ((AttrOf(attr) & A_ALTCHARSET) - && SP->_acs_map != 0 + && SP_PARM->_acs_map != 0 && CharOfD(ch) < ACS_LEN) { my_ch = CHDEREF(ch); /* work around const param */ #if USE_WIDEC_SUPPORT @@ -251,8 +272,8 @@ PutAttrChar(CARG_CH_T ch) * character, and uses the wide-character mapping when we expect the * normal one to be broken (by mis-design ;-). */ - if (SP->_screen_acs_fix - && SP->_screen_acs_map[CharOf(my_ch)]) { + if (SP_PARM->_screen_acs_fix + && SP_PARM->_screen_acs_map[CharOf(my_ch)]) { RemAttr(attr, A_ALTCHARSET); my_ch = _nc_wacs[CharOf(my_ch)]; } @@ -265,9 +286,9 @@ PutAttrChar(CARG_CH_T ch) */ if (AttrOf(attr) & A_ALTCHARSET) { int j = CharOfD(ch); - chtype temp = UChar(SP->_acs_map[j]); + chtype temp = UChar(SP_PARM->_acs_map[j]); - if (!(SP->_screen_acs_map[j])) { + if (!(SP_PARM->_screen_acs_map[j])) { RemAttr(attr, A_ALTCHARSET); if (temp == 0) temp = ' '; @@ -282,28 +303,28 @@ PutAttrChar(CARG_CH_T ch) ch = CHREF(tilde); } - UpdateAttrs(attr); + UpdateAttrs(SP_PARM, attr); #if !USE_WIDEC_SUPPORT /* FIXME - we do this special case for signal handling, should see how to * make it work for wide characters. */ - if (SP->_outch != 0) { - SP->_outch(UChar(ch)); + if (SP_PARM->_outch != 0) { + SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch)); } else #endif { - PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ + PUTC(CHDEREF(ch), SP_PARM->_ofp); /* macro's fastest... */ COUNT_OUTCHARS(1); } - SP->_curscol += chlen; + SP_PARM->_curscol += chlen; if (char_padding) { TPUTS_TRACE("char_padding"); - putp(char_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx char_padding); } } static bool -check_pending(void) +check_pending(NCURSES_SP_DCL0) /* check for pending input */ { bool have_pending = FALSE; @@ -313,13 +334,13 @@ check_pending(void) * have the refreshing slow down drastically (or stop) if there's an * unread character available. */ - if (SP->_fifohold != 0) + if (SP_PARM->_fifohold != 0) return FALSE; - if (SP->_checkfd >= 0) { + if (SP_PARM->_checkfd >= 0) { #if USE_FUNC_POLL struct pollfd fds[1]; - fds[0].fd = SP->_checkfd; + fds[0].fd = SP_PARM->_checkfd; fds[0].events = POLLIN; if (poll(fds, 1, 0) > 0) { have_pending = TRUE; @@ -347,43 +368,52 @@ check_pending(void) ktimeout.tv_usec = 0; FD_ZERO(&fdset); - FD_SET(SP->_checkfd, &fdset); - if (select(SP->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { + FD_SET(SP_PARM->_checkfd, &fdset); + if (select(SP_PARM->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { have_pending = TRUE; } #endif } if (have_pending) { - SP->_fifohold = 5; - _nc_flush(); + SP_PARM->_fifohold = 5; + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); } return FALSE; } /* put char at lower right corner */ static void -PutCharLR(const ARG_CH_T ch) +PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) { if (!auto_right_margin) { /* we can put the char directly */ - PutAttrChar(ch); + PutAttrChar(NCURSES_SP_ARGx ch); } else if (enter_am_mode && exit_am_mode) { /* we can suppress automargin */ TPUTS_TRACE("exit_am_mode"); - putp(exit_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_am_mode); - PutAttrChar(ch); - SP->_curscol--; - position_check(SP->_cursrow, SP->_curscol, "exit_am_mode"); + PutAttrChar(NCURSES_SP_ARGx ch); + SP_PARM->_curscol--; + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "exit_am_mode"); TPUTS_TRACE("enter_am_mode"); - putp(enter_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_am_mode); } else if ((enter_insert_mode && exit_insert_mode) || insert_character || parm_ich) { - GoTo(screen_lines - 1, screen_columns - 2); - PutAttrChar(ch); - GoTo(screen_lines - 1, screen_columns - 2); - InsStr(newscr->_line[screen_lines - 1].text + screen_columns - 2, 1); + GoTo(NCURSES_SP_ARGx + screen_lines(SP_PARM) - 1, + screen_columns(SP_PARM) - 2); + PutAttrChar(NCURSES_SP_ARGx ch); + GoTo(NCURSES_SP_ARGx + screen_lines(SP_PARM) - 1, + screen_columns(SP_PARM) - 2); + InsStr(NCURSES_SP_ARGx + NewScreen(SP_PARM)->_line[screen_lines(SP_PARM) - 1].text + + screen_columns(SP_PARM) - 2, 1); } } @@ -391,7 +421,7 @@ PutCharLR(const ARG_CH_T ch) * Wrap the cursor position, i.e., advance to the beginning of the next line. */ static void -wrap_cursor(void) +wrap_cursor(NCURSES_SP_DCL0) { if (eat_newline_glitch) { /* @@ -407,40 +437,45 @@ wrap_cursor(void) * it's safe to just tell the code that the cursor is in hyperspace and * let the next mvcur() call straighten things out. */ - SP->_curscol = -1; - SP->_cursrow = -1; + SP_PARM->_curscol = -1; + SP_PARM->_cursrow = -1; } else if (auto_right_margin) { - SP->_curscol = 0; - SP->_cursrow++; + SP_PARM->_curscol = 0; + SP_PARM->_cursrow++; /* * We've actually moved - but may have to work around problems with * video attributes not working. */ - if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP))) { + if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP_PARM))) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before wrapping", - (unsigned long) AttrOf(SCREEN_ATTRS(SP)), - _traceattr(AttrOf(SCREEN_ATTRS(SP))))); - (void) VIDATTR(A_NORMAL, 0); + (unsigned long) AttrOf(SCREEN_ATTRS(SP_PARM)), + _traceattr(AttrOf(SCREEN_ATTRS(SP_PARM))))); + (void) VIDATTR(SP_PARM, A_NORMAL, 0); } } else { - SP->_curscol--; + SP_PARM->_curscol--; } - position_check(SP->_cursrow, SP->_curscol, "wrap_cursor"); + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "wrap_cursor"); } static NCURSES_INLINE void -PutChar(const ARG_CH_T ch) +PutChar(NCURSES_SP_DCLx const ARG_CH_T ch) /* insert character, handling automargin stuff */ { - if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1) - PutCharLR(ch); - else - PutAttrChar(ch); + if (SP_PARM->_cursrow == screen_lines(SP_PARM) - 1 && + SP_PARM->_curscol == screen_columns(SP_PARM) - 1) { + PutCharLR(NCURSES_SP_ARGx ch); + } else { + PutAttrChar(NCURSES_SP_ARGx ch); + } - if (SP->_curscol >= screen_columns) - wrap_cursor(); + if (SP_PARM->_curscol >= screen_columns(SP_PARM)) + wrap_cursor(NCURSES_SP_ARG); - position_check(SP->_cursrow, SP->_curscol, "PutChar"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "PutChar"); } /* @@ -450,19 +485,21 @@ PutChar(const ARG_CH_T ch) * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. */ static NCURSES_INLINE bool -can_clear_with(ARG_CH_T ch) +can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) { - if (!back_color_erase && SP->_coloron) { + if (!back_color_erase && SP_PARM->_coloron) { #if NCURSES_EXT_FUNCS int pair; - if (!SP->_default_color) + if (!SP_PARM->_default_color) return FALSE; - if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK) + if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK) return FALSE; if ((pair = GetPair(CHDEREF(ch))) != 0) { short fg, bg; - pair_content(pair, &fg, &bg); + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, &bg); if (fg != C_MASK || bg != C_MASK) return FALSE; } @@ -488,7 +525,7 @@ can_clear_with(ARG_CH_T ch) * This code is optimized using ech and rep. */ static int -EmitRange(const NCURSES_CH_T * ntext, int num) +EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) { int i; @@ -500,13 +537,13 @@ EmitRange(const NCURSES_CH_T * ntext, int num) NCURSES_CH_T ntext0; while (num > 1 && !CharEq(ntext[0], ntext[1])) { - PutChar(CHREF(ntext[0])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[0])); ntext++; num--; } ntext0 = ntext[0]; if (num == 1) { - PutChar(CHREF(ntext0)); + PutChar(NCURSES_SP_ARGx CHREF(ntext0)); return 0; } runcount = 2; @@ -523,10 +560,11 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * which it would be marginally advantageous. */ if (erase_chars - && runcount > SP->_ech_cost + SP->_cup_ch_cost - && can_clear_with(CHREF(ntext0))) { - UpdateAttrs(ntext0); - putp(TPARM_1(erase_chars, runcount)); + && runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost + && can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) { + UpdateAttrs(SP_PARM, ntext0); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_1(erase_chars, runcount)); /* * If this is the last part of the given interval, @@ -534,27 +572,34 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * last update on the line. */ if (runcount < num) { - GoTo(SP->_cursrow, SP->_curscol + runcount); + GoTo(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol + runcount); } else { return 1; /* cursor stays in the middle */ } - } else if (repeat_char && runcount > SP->_rep_cost) { - bool wrap_possible = (SP->_curscol + runcount >= screen_columns); + } else if (repeat_char && runcount > SP_PARM->_rep_cost) { + bool wrap_possible = (SP_PARM->_curscol + runcount >= + screen_columns(SP_PARM)); int rep_count = runcount; if (wrap_possible) rep_count--; - UpdateAttrs(ntext0); - tputs(TPARM_2(repeat_char, CharOf(ntext0), rep_count), - rep_count, _nc_outch); - SP->_curscol += rep_count; + UpdateAttrs(SP_PARM, ntext0); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(repeat_char, + CharOf(ntext0), + rep_count), + rep_count, + NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_curscol += rep_count; if (wrap_possible) - PutChar(CHREF(ntext0)); + PutChar(NCURSES_SP_ARGx CHREF(ntext0)); } else { for (i = 0; i < runcount; i++) - PutChar(CHREF(ntext[i])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); } ntext += runcount; num -= runcount; @@ -563,7 +608,7 @@ EmitRange(const NCURSES_CH_T * ntext, int num) } for (i = 0; i < num; i++) - PutChar(CHREF(ntext[i])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); return 0; } @@ -576,39 +621,43 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * Returns: same as EmitRange */ static int -PutRange(const NCURSES_CH_T * otext, +PutRange(NCURSES_SP_DCLx + const NCURSES_CH_T * otext, const NCURSES_CH_T * ntext, int row, int first, int last) { int i, j, same; - TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)", - otext, ntext, row, first, last)); + TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)", + (void *) SP_PARM, + (const void *) otext, + (const void *) ntext, + row, first, last)); if (otext != ntext - && (last - first + 1) > SP->_inline_cost) { + && (last - first + 1) > SP_PARM->_inline_cost) { for (j = first, same = 0; j <= last; j++) { if (!same && isWidecExt(otext[j])) continue; if (CharEq(otext[j], ntext[j])) { same++; } else { - if (same > SP->_inline_cost) { - EmitRange(ntext + first, j - same - first); - GoTo(row, first = j); + if (same > SP_PARM->_inline_cost) { + EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); + GoTo(NCURSES_SP_ARGx row, first = j); } same = 0; } } - i = EmitRange(ntext + first, j - same - first); + i = EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); /* * Always return 1 for the next GoTo() after a PutRange() if we found * identical characters at end of interval */ return (same == 0 ? i : 1); } - return EmitRange(ntext + first, last - first + 1); + return EmitRange(NCURSES_SP_ARGx ntext + first, last - first + 1); } /* leave unbracketed here so 'indent' works */ @@ -618,7 +667,7 @@ PutRange(const NCURSES_CH_T * otext, if_USE_SCROLL_HINTS(win->_line[row].oldindex = row) NCURSES_EXPORT(int) -doupdate(void) +TINFO_DOUPDATE(NCURSES_SP_DCL0) { int i; int nonempty; @@ -626,30 +675,49 @@ doupdate(void) struct tms before, after; #endif /* USE_TRACE_TIMES */ - T((T_CALLED("doupdate()"))); + T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM)); - if (curscr == 0 - || newscr == 0) +#if !USE_REENTRANT + /* + * It is "legal" but unlikely that an application could assign a new + * value to one of the standard windows. Check for that possibility + * and try to recover. + * + * We do not allow applications to assign new values in the reentrant + * model. + */ +#define SyncScreens(internal,exported) \ + if (internal == 0) internal = exported; \ + if (internal != exported) exported = internal + + SyncScreens(CurScreen(SP_PARM), curscr); + SyncScreens(NewScreen(SP_PARM), newscr); + SyncScreens(StdScreen(SP_PARM), stdscr); +#endif + + if (CurScreen(SP_PARM) == 0 + || NewScreen(SP_PARM) == 0 + || StdScreen(SP_PARM) == 0) returnCode(ERR); #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { - if (curscr->_clear) + if (CurScreen(SP_PARM)->_clear) _tracef("curscr is clear"); else - _tracedump("curscr", curscr); - _tracedump("newscr", newscr); + _tracedump("curscr", CurScreen(SP_PARM)); + _tracedump("newscr", NewScreen(SP_PARM)); _nc_unlock_global(tracef); } #endif /* TRACE */ _nc_signal_handler(FALSE); - if (SP->_fifohold) - SP->_fifohold--; + if (SP_PARM->_fifohold) + SP_PARM->_fifohold--; #if USE_SIZECHANGE - if (SP->_endwin || _nc_handle_sigwinch(SP)) { + if (SP_PARM->_endwin || _nc_handle_sigwinch(SP_PARM)) { /* * This is a transparent extension: XSI does not address it, * and applications need not know that ncurses can do it. @@ -658,20 +726,20 @@ doupdate(void) * (this can happen in an xterm, for example), and resize the * ncurses data structures accordingly. */ - _nc_update_screensize(SP); + _nc_update_screensize(SP_PARM); } #endif - if (SP->_endwin) { + if (SP_PARM->_endwin) { T(("coming back from shell mode")); - reset_prog_mode(); + NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG); - _nc_mvcur_resume(); - _nc_screen_resume(); - SP->_mouse_resume(SP); + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); + SP_PARM->_mouse_resume(SP_PARM); - SP->_endwin = FALSE; + SP_PARM->_endwin = FALSE; } #if USE_TRACE_TIMES /* zero the metering machinery */ @@ -695,11 +763,11 @@ doupdate(void) int j, k; attr_t rattr = A_NORMAL; - for (i = 0; i < screen_lines; i++) { - for (j = 0; j < screen_columns; j++) { + for (i = 0; i < screen_lines(SP_PARM); i++) { + for (j = 0; j < screen_columns(SP_PARM); j++) { bool failed = FALSE; - NCURSES_CH_T *thisline = newscr->_line[i].text; - attr_t thisattr = AttrOf(thisline[j]) & SP->_xmc_triggers; + NCURSES_CH_T *thisline = NewScreen(SP_PARM)->_line[i].text; + attr_t thisattr = AttrOf(thisline[j]) & SP_PARM->_xmc_triggers; attr_t turnon = thisattr & ~rattr; /* is an attribute turned on here? */ @@ -717,8 +785,8 @@ doupdate(void) * there's enough room to set the attribute before the first * non-blank in the run. */ -#define SAFE(a) (!((a) & SP->_xmc_triggers)) - if (ISBLANK(thisline[j]) && SAFE(turnon)) { +#define SAFE(scr,a) (!((a) & (scr)->_xmc_triggers)) + if (ISBLANK(thisline[j]) && SAFE(SP_PARM, turnon)) { RemAttr(thisline[j], turnon); continue; } @@ -727,14 +795,14 @@ doupdate(void) for (k = 1; k <= magic_cookie_glitch; k++) { if (j - k < 0 || !ISBLANK(thisline[j - k]) - || !SAFE(AttrOf(thisline[j - k]))) { + || !SAFE(SP_PARM, AttrOf(thisline[j - k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at start in %d,%d%s%s", i, j - k, (ISBLANK(thisline[j - k]) ? "" : ":nonblank"), - (SAFE(AttrOf(thisline[j - k])) + (SAFE(SP_PARM, AttrOf(thisline[j - k])) ? "" : ":unsafe"))); break; @@ -745,10 +813,11 @@ doupdate(void) int m, n = j; /* find end of span, if it's onscreen */ - for (m = i; m < screen_lines; m++) { - for (; n < screen_columns; n++) { - attr_t testattr = AttrOf(newscr->_line[m].text[n]); - if ((testattr & SP->_xmc_triggers) == rattr) { + for (m = i; m < screen_lines(SP_PARM); m++) { + for (; n < screen_columns(SP_PARM); n++) { + attr_t testattr = + AttrOf(NewScreen(SP_PARM)->_line[m].text[n]); + if ((testattr & SP_PARM->_xmc_triggers) == rattr) { end_onscreen = TRUE; TR(TRACE_ATTRS, ("Range attributed with %s ends at (%d, %d)", @@ -764,7 +833,8 @@ doupdate(void) foundit:; if (end_onscreen) { - NCURSES_CH_T *lastline = newscr->_line[m].text; + NCURSES_CH_T *lastline = + NewScreen(SP_PARM)->_line[m].text; /* * If there are safely-attributed blanks at the end of @@ -773,15 +843,15 @@ doupdate(void) */ while (n >= 0 && ISBLANK(lastline[n]) - && SAFE(AttrOf(lastline[n]))) { + && SAFE(SP_PARM, AttrOf(lastline[n]))) { RemAttr(lastline[n--], turnon); } /* check that there's enough room at end of span */ for (k = 1; k <= magic_cookie_glitch; k++) { - if (n + k >= screen_columns + if (n + k >= screen_columns(SP_PARM) || !ISBLANK(lastline[n + k]) - || !SAFE(AttrOf(lastline[n + k]))) { + || !SAFE(SP_PARM, AttrOf(lastline[n + k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at end in %d,%d%s%s", @@ -789,7 +859,7 @@ doupdate(void) (ISBLANK(lastline[n + k]) ? "" : ":nonblank"), - (SAFE(AttrOf(lastline[n + k])) + (SAFE(SP_PARM, AttrOf(lastline[n + k])) ? "" : ":unsafe"))); break; @@ -806,12 +876,12 @@ doupdate(void) _traceattr(turnon), i, j)); /* turn off new attributes over span */ - for (p = i; p < screen_lines; p++) { - for (; q < screen_columns; q++) { + for (p = i; p < screen_lines(SP_PARM); p++) { + for (; q < screen_columns(SP_PARM); q++) { attr_t testattr = AttrOf(newscr->_line[p].text[q]); - if ((testattr & SP->_xmc_triggers) == rattr) + if ((testattr & SP_PARM->_xmc_triggers) == rattr) goto foundend; - RemAttr(newscr->_line[p].text[q], turnon); + RemAttr(NewScreen(SP_PARM)->_line[p].text[q], turnon); } q = 0; } @@ -837,7 +907,7 @@ doupdate(void) /* show altered highlights after magic-cookie check */ if (USE_TRACEF(TRACE_UPDATE)) { _tracef("After magic-cookie check..."); - _tracedump("newscr", newscr); + _tracedump("newscr", NewScreen(SP_PARM)); _nc_unlock_global(tracef); } #endif /* TRACE */ @@ -845,23 +915,23 @@ doupdate(void) #endif /* USE_XMC_SUPPORT */ nonempty = 0; - if (curscr->_clear || newscr->_clear) { /* force refresh ? */ - ClrUpdate(); - curscr->_clear = FALSE; /* reset flag */ - newscr->_clear = FALSE; /* reset flag */ + if (CurScreen(SP_PARM)->_clear || NewScreen(SP_PARM)->_clear) { /* force refresh ? */ + ClrUpdate(NCURSES_SP_ARG); + CurScreen(SP_PARM)->_clear = FALSE; /* reset flag */ + NewScreen(SP_PARM)->_clear = FALSE; /* reset flag */ } else { int changedlines = CHECK_INTERVAL; - if (check_pending()) + if (check_pending(NCURSES_SP_ARG)) goto cleanup; - nonempty = min(screen_lines, newscr->_maxy + 1); + nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); - if (SP->_scrolling) { - _nc_scroll_optimize(); + if (SP_PARM->_scrolling) { + NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG); } - nonempty = ClrBottom(nonempty); + nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); TR(TRACE_UPDATE, ("Transforming lines, nonempty %d", nonempty)); for (i = 0; i < nonempty; i++) { @@ -869,7 +939,7 @@ doupdate(void) * Here is our line-breakout optimization. */ if (changedlines == CHECK_INTERVAL) { - if (check_pending()) + if (check_pending(NCURSES_SP_ARG)) goto cleanup; changedlines = 0; } @@ -880,35 +950,35 @@ doupdate(void) * is normally set by _nc_scroll_window in the * vertical-movement optimization code, */ - if (newscr->_line[i].firstchar != _NOCHANGE - || curscr->_line[i].firstchar != _NOCHANGE) { - TransformLine(i); + if (NewScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE + || CurScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE) { + TransformLine(NCURSES_SP_ARGx i); changedlines++; } /* mark line changed successfully */ - if (i <= newscr->_maxy) { - MARK_NOCHANGE(newscr, i); + if (i <= NewScreen(SP_PARM)->_maxy) { + MARK_NOCHANGE(NewScreen(SP_PARM), i); } - if (i <= curscr->_maxy) { - MARK_NOCHANGE(curscr, i); + if (i <= CurScreen(SP_PARM)->_maxy) { + MARK_NOCHANGE(CurScreen(SP_PARM), i); } } } /* put everything back in sync */ - for (i = nonempty; i <= newscr->_maxy; i++) { - MARK_NOCHANGE(newscr, i); + for (i = nonempty; i <= NewScreen(SP_PARM)->_maxy; i++) { + MARK_NOCHANGE(NewScreen(SP_PARM), i); } - for (i = nonempty; i <= curscr->_maxy; i++) { - MARK_NOCHANGE(curscr, i); + for (i = nonempty; i <= CurScreen(SP_PARM)->_maxy; i++) { + MARK_NOCHANGE(CurScreen(SP_PARM), i); } - if (!newscr->_leaveok) { - curscr->_curx = newscr->_curx; - curscr->_cury = newscr->_cury; + if (!NewScreen(SP_PARM)->_leaveok) { + CurScreen(SP_PARM)->_curx = NewScreen(SP_PARM)->_curx; + CurScreen(SP_PARM)->_cury = NewScreen(SP_PARM)->_cury; - GoTo(curscr->_cury, curscr->_curx); + GoTo(NCURSES_SP_ARGx CurScreen(SP_PARM)->_cury, CurScreen(SP_PARM)->_curx); } cleanup: @@ -921,10 +991,10 @@ doupdate(void) #if USE_XMC_SUPPORT if (magic_cookie_glitch != 0) #endif - UpdateAttrs(normal); + UpdateAttrs(SP_PARM, normal); - _nc_flush(); - WINDOW_ATTRS(curscr) = WINDOW_ATTRS(newscr); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + WINDOW_ATTRS(CurScreen(SP_PARM)) = WINDOW_ATTRS(NewScreen(SP_PARM)); #if USE_TRACE_TIMES (void) times(&after); @@ -940,6 +1010,14 @@ doupdate(void) returnCode(OK); } +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +doupdate(void) +{ + return TINFO_DOUPDATE(CURRENT_SCREEN); +} +#endif + /* * ClrBlank(win) * @@ -951,14 +1029,14 @@ doupdate(void) * in the wbkgd() call. Assume 'stdscr' for this case. */ #define BCE_ATTRS (A_NORMAL|A_COLOR) -#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd) +#define BCE_BKGD(sp,win) (((win) == CurScreen(sp) ? StdScreen(sp) : (win))->_nc_bkgd) static NCURSES_INLINE NCURSES_CH_T -ClrBlank(WINDOW *win) +ClrBlank(NCURSES_SP_DCLx WINDOW *win) { NCURSES_CH_T blank = blankchar; if (back_color_erase) - AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS)); + AddAttr(blank, (AttrOf(BCE_BKGD(SP_PARM, win)) & BCE_ATTRS)); return blank; } @@ -970,23 +1048,24 @@ ClrBlank(WINDOW *win) */ static void -ClrUpdate(void) +ClrUpdate(NCURSES_SP_DCL0) { - int i; - NCURSES_CH_T blank = ClrBlank(stdscr); - int nonempty = min(screen_lines, newscr->_maxy + 1); - TR(TRACE_UPDATE, (T_CALLED("ClrUpdate"))); + if (0 != SP_PARM) { + int i; + NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); + int nonempty = min(screen_lines(SP_PARM), + NewScreen(SP_PARM)->_maxy + 1); - ClearScreen(blank); + ClearScreen(NCURSES_SP_ARGx blank); - TR(TRACE_UPDATE, ("updating screen from scratch")); + TR(TRACE_UPDATE, ("updating screen from scratch")); - nonempty = ClrBottom(nonempty); - - for (i = 0; i < nonempty; i++) - TransformLine(i); + nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); + for (i = 0; i < nonempty; i++) + TransformLine(NCURSES_SP_ARGx i); + } TR(TRACE_UPDATE, (T_RETURN(""))); } @@ -997,35 +1076,36 @@ ClrUpdate(void) */ static void -ClrToEOL(NCURSES_CH_T blank, bool needclear) +ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) { int j; - if (curscr != 0 - && SP->_cursrow >= 0) { - for (j = SP->_curscol; j < screen_columns; j++) { - if (j >= 0) { - NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]); + if (SP_PARM != 0) { + if (CurScreen(SP_PARM) != 0 + && SP_PARM->_cursrow >= 0) { + for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) { + if (j >= 0) { + NCURSES_CH_T *cp = + &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]); - if (!CharEq(*cp, blank)) { - *cp = blank; - needclear = TRUE; + if (!CharEq(*cp, blank)) { + *cp = blank; + needclear = TRUE; + } } } } - } else { - needclear = TRUE; } - if (needclear) { - UpdateAttrs(blank); + if (needclear && (SP_PARM != 0)) { + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); - if (clr_eol && SP->_el_cost <= (screen_columns - SP->_curscol)) { - putp(clr_eol); + if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) { + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } else { - int count = (screen_columns - SP->_curscol); + int count = (screen_columns(SP_PARM) - SP_PARM->_curscol); while (count-- > 0) - PutChar(CHREF(blank)); + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } } @@ -1037,23 +1117,29 @@ ClrToEOL(NCURSES_CH_T blank, bool needclear) */ static void -ClrToEOS(NCURSES_CH_T blank) +ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank) { int row, col; - row = SP->_cursrow; - col = SP->_curscol; + if (0 == SP_PARM) + return; - UpdateAttrs(blank); + row = SP_PARM->_cursrow; + col = SP_PARM->_curscol; + + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eos"); - tputs(clr_eos, screen_lines - row, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + clr_eos, + screen_lines(SP_PARM) - row, + NCURSES_SP_NAME(_nc_outch)); - while (col < screen_columns) - curscr->_line[row].text[col++] = blank; + while (col < screen_columns(SP_PARM)) + CurScreen(SP_PARM)->_line[row].text[col++] = blank; - for (row++; row < screen_lines; row++) { - for (col = 0; col < screen_columns; col++) - curscr->_line[row].text[col] = blank; + for (row++; row < screen_lines(SP_PARM); row++) { + for (col = 0; col < screen_columns(SP_PARM); col++) + CurScreen(SP_PARM)->_line[row].text[col] = blank; } } @@ -1065,26 +1151,26 @@ ClrToEOS(NCURSES_CH_T blank) * screen, checking if each is blank, and one or more are changed. */ static int -ClrBottom(int total) +ClrBottom(NCURSES_SP_DCLx int total) { int row; int col; int top = total; - int last = min(screen_columns, newscr->_maxx + 1); - NCURSES_CH_T blank = newscr->_line[total - 1].text[last - 1]; + int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1); + NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1]; bool ok; - if (clr_eos && can_clear_with(CHREF(blank))) { + if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { for (row = total - 1; row >= 0; row--) { for (col = 0, ok = TRUE; ok && col < last; col++) { - ok = (CharEq(newscr->_line[row].text[col], blank)); + ok = (CharEq(NewScreen(SP_PARM)->_line[row].text[col], blank)); } if (!ok) break; for (col = 0; ok && col < last; col++) { - ok = (CharEq(curscr->_line[row].text[col], blank)); + ok = (CharEq(CurScreen(SP_PARM)->_line[row].text[col], blank)); } if (!ok) top = row; @@ -1092,11 +1178,11 @@ ClrBottom(int total) /* don't use clr_eos for just one line if clr_eol available */ if (top < total) { - GoTo(top, 0); - ClrToEOS(blank); - if (SP->oldhash && SP->newhash) { - for (row = top; row < screen_lines; row++) - SP->oldhash[row] = SP->newhash[row]; + GoTo(NCURSES_SP_ARGx top, 0); + ClrToEOS(NCURSES_SP_ARGx blank); + if (SP_PARM->oldhash && SP_PARM->newhash) { + for (row = top; row < screen_lines(SP_PARM); row++) + SP_PARM->oldhash[row] = SP_PARM->newhash[row]; } } } @@ -1105,22 +1191,22 @@ ClrBottom(int total) #if USE_XMC_SUPPORT #if USE_WIDEC_SUPPORT -#define check_xmc_transition(a, b) \ - ((((a)->attr ^ (b)->attr) & ~((a)->attr) & SP->_xmc_triggers) != 0) -#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b)) +#define check_xmc_transition(sp, a, b) \ + ((((a)->attr ^ (b)->attr) & ~((a)->attr) & (sp)->_xmc_triggers) != 0) +#define xmc_turn_on(sp,a,b) check_xmc_transition(sp,&(a), &(b)) #else -#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) +#define xmc_turn_on(sp,a,b) ((((a)^(b)) & ~(a) & (sp)->_xmc_triggers) != 0) #endif -#define xmc_new(r,c) newscr->_line[r].text[c] -#define xmc_turn_off(a,b) xmc_turn_on(b,a) +#define xmc_new(sp,r,c) NewScreen(sp)->_line[r].text[c] +#define xmc_turn_off(sp,a,b) xmc_turn_on(sp,b,a) #endif /* USE_XMC_SUPPORT */ /* ** TransformLine(lineno) ** ** Transform the given line in curscr to the one in newscr, using -** Insert/Delete Character if _nc_idcok && has_ic(). +** Insert/Delete Character if idcok && has_ic(). ** ** firstChar = position of first different character in line ** oLastChar = position of last different character in old line @@ -1135,19 +1221,19 @@ ClrBottom(int total) */ static void -TransformLine(int const lineno) +TransformLine(NCURSES_SP_DCLx int const lineno) { int firstChar, oLastChar, nLastChar; - NCURSES_CH_T *newLine = newscr->_line[lineno].text; - NCURSES_CH_T *oldLine = curscr->_line[lineno].text; + NCURSES_CH_T *newLine = NewScreen(SP_PARM)->_line[lineno].text; + NCURSES_CH_T *oldLine = CurScreen(SP_PARM)->_line[lineno].text; int n; bool attrchanged = FALSE; - TR(TRACE_UPDATE, (T_CALLED("TransformLine(%d)"), lineno)); + TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno)); /* copy new hash value to old one */ - if (SP->oldhash && SP->newhash) - SP->oldhash[lineno] = SP->newhash[lineno]; + if (SP_PARM->oldhash && SP_PARM->newhash) + SP_PARM->oldhash[lineno] = SP_PARM->newhash[lineno]; /* * If we have colors, there is the possibility of having two color pairs @@ -1155,19 +1241,20 @@ TransformLine(int const lineno) * for this case, and update the old line with the new line's colors when * they are equivalent. */ - if (SP->_coloron) { + if (SP_PARM->_coloron) { int oldPair; int newPair; - for (n = 0; n < screen_columns; n++) { + for (n = 0; n < screen_columns(SP_PARM); n++) { if (!CharEq(newLine[n], oldLine[n])) { oldPair = GetPair(oldLine[n]); newPair = GetPair(newLine[n]); if (oldPair != newPair && unColor(oldLine[n]) == unColor(newLine[n])) { - if (oldPair < COLOR_PAIRS - && newPair < COLOR_PAIRS - && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) { + if (oldPair < SP_PARM->_pair_limit + && newPair < SP_PARM->_pair_limit + && (SP_PARM->_color_pairs[oldPair] == + SP_PARM->_color_pairs[newPair])) { SetPair(oldLine[n], GetPair(newLine[n])); } } @@ -1177,7 +1264,7 @@ TransformLine(int const lineno) if (ceol_standout_glitch && clr_eol) { firstChar = 0; - while (firstChar < screen_columns) { + while (firstChar < screen_columns(SP_PARM)) { if (!SameAttrOf(newLine[firstChar], oldLine[firstChar])) { attrchanged = TRUE; break; @@ -1189,9 +1276,13 @@ TransformLine(int const lineno) firstChar = 0; if (attrchanged) { /* we may have to disregard the whole line */ - GoTo(lineno, firstChar); - ClrToEOL(ClrBlank(curscr), FALSE); - PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1)); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + ClrToEOL(NCURSES_SP_ARGx + ClrBlank(NCURSES_SP_ARGx + CurScreen(SP_PARM)), FALSE); + PutRange(NCURSES_SP_ARGx + oldLine, newLine, lineno, 0, + screen_columns(SP_PARM) - 1); #if USE_XMC_SUPPORT /* @@ -1206,8 +1297,8 @@ TransformLine(int const lineno) * following operation. */ } else if (magic_cookie_glitch > 0) { - GoTo(lineno, firstChar); - for (n = 0; n < screen_columns; n++) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); + for (n = 0; n < screen_columns(SP_PARM); n++) { int m = n + magic_cookie_glitch; /* check for turn-on: @@ -1216,26 +1307,30 @@ TransformLine(int const lineno) */ if (ISBLANK(newLine[n]) && ((n > 0 - && xmc_turn_on(newLine[n - 1], newLine[n])) + && xmc_turn_on(SP_PARM, newLine[n - 1], newLine[n])) || (n == 0 && lineno > 0 - && xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1), + && xmc_turn_on(SP_PARM, + xmc_new(SP_PARM, lineno - 1, + screen_columns(SP_PARM) - 1), newLine[n])))) { n = m; } - PutChar(CHREF(newLine[n])); + PutChar(NCURSES_SP_ARGx CHREF(newLine[n])); /* check for turn-off: * If we are writing an attributed non-blank, where the * next cell is blank, and not attributed. */ if (!ISBLANK(newLine[n]) - && ((n + 1 < screen_columns - && xmc_turn_off(newLine[n], newLine[n + 1])) - || (n + 1 >= screen_columns - && lineno + 1 < screen_lines - && xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) { + && ((n + 1 < screen_columns(SP_PARM) + && xmc_turn_off(SP_PARM, newLine[n], newLine[n + 1])) + || (n + 1 >= screen_columns(SP_PARM) + && lineno + 1 < screen_lines(SP_PARM) + && xmc_turn_off(SP_PARM, + newLine[n], + xmc_new(SP_PARM, lineno + 1, 0))))) { n = m; } @@ -1246,38 +1341,42 @@ TransformLine(int const lineno) /* it may be cheap to clear leading whitespace with clr_bol */ blank = newLine[0]; - if (clr_bol && can_clear_with(CHREF(blank))) { + if (clr_bol && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { int oFirstChar, nFirstChar; - for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++) + for (oFirstChar = 0; + oFirstChar < screen_columns(SP_PARM); + oFirstChar++) if (!CharEq(oldLine[oFirstChar], blank)) break; - for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++) + for (nFirstChar = 0; + nFirstChar < screen_columns(SP_PARM); + nFirstChar++) if (!CharEq(newLine[nFirstChar], blank)) break; if (nFirstChar == oFirstChar) { firstChar = nFirstChar; /* find the first differing character */ - while (firstChar < screen_columns + while (firstChar < screen_columns(SP_PARM) && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } else if (oFirstChar > nFirstChar) { firstChar = nFirstChar; } else { /* oFirstChar < nFirstChar */ firstChar = oFirstChar; - if (SP->_el1_cost < nFirstChar - oFirstChar) { - if (nFirstChar >= screen_columns - && SP->_el_cost <= SP->_el1_cost) { - GoTo(lineno, 0); - UpdateAttrs(blank); + if (SP_PARM->_el1_cost < nFirstChar - oFirstChar) { + if (nFirstChar >= screen_columns(SP_PARM) + && SP_PARM->_el_cost <= SP_PARM->_el1_cost) { + GoTo(NCURSES_SP_ARGx lineno, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); - putp(clr_eol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } else { - GoTo(lineno, nFirstChar - 1); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx lineno, nFirstChar - 1); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_bol"); - putp(clr_bol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_bol); } while (firstChar < nFirstChar) @@ -1286,64 +1385,81 @@ TransformLine(int const lineno) } } else { /* find the first differing character */ - while (firstChar < screen_columns + while (firstChar < screen_columns(SP_PARM) && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } /* if there wasn't one, we're done */ - if (firstChar >= screen_columns) { + if (firstChar >= screen_columns(SP_PARM)) { TR(TRACE_UPDATE, (T_RETURN(""))); return; } - blank = newLine[screen_columns - 1]; + blank = newLine[screen_columns(SP_PARM) - 1]; - if (!can_clear_with(CHREF(blank))) { + if (!can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { /* find the last differing character */ - nLastChar = screen_columns - 1; + nLastChar = screen_columns(SP_PARM) - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], oldLine[nLastChar])) nLastChar--; if (nLastChar >= firstChar) { - GoTo(lineno, firstChar); - PutRange(oldLine, newLine, lineno, firstChar, nLastChar); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); + (unsigned) (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } TR(TRACE_UPDATE, (T_RETURN(""))); return; } /* find last non-blank character on old line */ - oLastChar = screen_columns - 1; + oLastChar = screen_columns(SP_PARM) - 1; while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank)) oLastChar--; /* find last non-blank character on new line */ - nLastChar = screen_columns - 1; + nLastChar = screen_columns(SP_PARM) - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank)) nLastChar--; if ((nLastChar == firstChar) - && (SP->_el_cost < (oLastChar - nLastChar))) { - GoTo(lineno, firstChar); + && (SP_PARM->_el_cost < (oLastChar - nLastChar))) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); if (!CharEq(newLine[firstChar], blank)) - PutChar(CHREF(newLine[firstChar])); - ClrToEOL(blank, FALSE); + PutChar(NCURSES_SP_ARGx CHREF(newLine[firstChar])); + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else if ((nLastChar != oLastChar) && (!CharEq(newLine[nLastChar], oldLine[oLastChar]) - || !(_nc_idcok && has_ic()))) { - GoTo(lineno, firstChar); - if ((oLastChar - nLastChar) > SP->_el_cost) { - if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar)) - GoTo(lineno, nLastChar + 1); - ClrToEOL(blank, FALSE); + || !(SP_PARM->_nc_sp_idcok + && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)))) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); + if ((oLastChar - nLastChar) > SP_PARM->_el_cost) { + if (PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + nLastChar)) { + GoTo(NCURSES_SP_ARGx lineno, nLastChar + 1); + } + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { n = max(nLastChar, oLastChar); - PutRange(oldLine, newLine, lineno, firstChar, n); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + n); } } else { int nLastNonblank = nLastChar; @@ -1364,8 +1480,13 @@ TransformLine(int const lineno) n = min(oLastChar, nLastChar); if (n >= firstChar) { - GoTo(lineno, firstChar); - PutRange(oldLine, newLine, lineno, firstChar, n); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + n); } if (oLastChar < nLastChar) { @@ -1376,21 +1497,26 @@ TransformLine(int const lineno) --oLastChar; } #endif - GoTo(lineno, n + 1); + GoTo(NCURSES_SP_ARGx lineno, n + 1); if ((nLastChar < nLastNonblank) - || InsCharCost(nLastChar - oLastChar) > (m - n)) { - PutRange(oldLine, newLine, lineno, n + 1, m); + || InsCharCost(SP_PARM, nLastChar - oLastChar) > (m - n)) { + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + n + 1, + m); } else { - InsStr(&newLine[n + 1], nLastChar - oLastChar); + InsStr(NCURSES_SP_ARGx &newLine[n + 1], nLastChar - oLastChar); } } else if (oLastChar > nLastChar) { - GoTo(lineno, n + 1); - if (DelCharCost(oLastChar - nLastChar) - > SP->_el_cost + nLastNonblank - (n + 1)) { - if (PutRange(oldLine, newLine, lineno, + GoTo(NCURSES_SP_ARGx lineno, n + 1); + if (DelCharCost(SP_PARM, oLastChar - nLastChar) + > SP_PARM->_el_cost + nLastNonblank - (n + 1)) { + if (PutRange(NCURSES_SP_ARGx oldLine, newLine, lineno, n + 1, nLastNonblank)) - GoTo(lineno, nLastNonblank + 1); - ClrToEOL(blank, FALSE); + GoTo(NCURSES_SP_ARGx lineno, nLastNonblank + 1); + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { /* * The delete-char sequence will @@ -1400,18 +1526,18 @@ TransformLine(int const lineno) * setting the video attributes from * the last character on the row. */ - UpdateAttrs(blank); - DelChar(oLastChar - nLastChar); + UpdateAttrs(SP_PARM, blank); + DelChar(NCURSES_SP_ARGx oLastChar - nLastChar); } } } } /* update the code's internal representation */ - if (screen_columns > firstChar) + if (screen_columns(SP_PARM) > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (screen_columns - firstChar) * sizeof(NCURSES_CH_T)); + (unsigned) (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T)); TR(TRACE_UPDATE, (T_RETURN(""))); return; } @@ -1424,7 +1550,7 @@ TransformLine(int const lineno) */ static void -ClearScreen(NCURSES_CH_T blank) +ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) { int i, j; bool fast_clear = (clear_screen || clr_eos || clr_eol); @@ -1432,9 +1558,13 @@ ClearScreen(NCURSES_CH_T blank) TR(TRACE_UPDATE, ("ClearScreen() called")); #if NCURSES_EXT_FUNCS - if (SP->_coloron - && !SP->_default_color) { - _nc_do_color(GET_SCREEN_PAIR(SP), 0, FALSE, _nc_outch); + if (SP_PARM->_coloron + && !SP_PARM->_default_color) { + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx + (short) GET_SCREEN_PAIR(SP_PARM), + 0, + FALSE, + NCURSES_SP_NAME(_nc_outch)); if (!back_color_erase) { fast_clear = FALSE; } @@ -1443,42 +1573,46 @@ ClearScreen(NCURSES_CH_T blank) if (fast_clear) { if (clear_screen) { - UpdateAttrs(blank); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clear_screen"); - putp(clear_screen); - SP->_cursrow = SP->_curscol = 0; - position_check(SP->_cursrow, SP->_curscol, "ClearScreen"); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clear_screen); + SP_PARM->_cursrow = SP_PARM->_curscol = 0; + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "ClearScreen"); } else if (clr_eos) { - SP->_cursrow = SP->_curscol = -1; - GoTo(0, 0); - - UpdateAttrs(blank); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; + GoTo(NCURSES_SP_ARGx 0, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eos"); - tputs(clr_eos, screen_lines, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + clr_eos, + screen_lines(SP_PARM), + NCURSES_SP_NAME(_nc_outch)); } else if (clr_eol) { - SP->_cursrow = SP->_curscol = -1; - - UpdateAttrs(blank); - for (i = 0; i < screen_lines; i++) { - GoTo(i, 0); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; + UpdateAttrs(SP_PARM, blank); + for (i = 0; i < screen_lines(SP_PARM); i++) { + GoTo(NCURSES_SP_ARGx i, 0); TPUTS_TRACE("clr_eol"); - putp(clr_eol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } - GoTo(0, 0); + GoTo(NCURSES_SP_ARGx 0, 0); } } else { - UpdateAttrs(blank); - for (i = 0; i < screen_lines; i++) { - GoTo(i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + UpdateAttrs(SP_PARM, blank); + for (i = 0; i < screen_lines(SP_PARM); i++) { + GoTo(NCURSES_SP_ARGx i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } - GoTo(0, 0); + GoTo(NCURSES_SP_ARGx 0, 0); } - for (i = 0; i < screen_lines; i++) { - for (j = 0; j < screen_columns; j++) - curscr->_line[i].text[j] = blank; + for (i = 0; i < screen_lines(SP_PARM); i++) { + for (j = 0; j < screen_columns(SP_PARM); j++) + CurScreen(SP_PARM)->_line[i].text[j] = blank; } TR(TRACE_UPDATE, ("screen cleared")); @@ -1492,49 +1626,54 @@ ClearScreen(NCURSES_CH_T blank) */ static void -InsStr(NCURSES_CH_T * line, int count) +InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) { - TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count)); + TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", + (void *) SP_PARM, + (void *) line, count)); /* Prefer parm_ich as it has the smallest cost - no need to shift * the whole line on each character. */ /* The order must match that of InsCharCost. */ if (parm_ich) { TPUTS_TRACE("parm_ich"); - tputs(TPARM_1(parm_ich, count), count, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(parm_ich, count), + count, + NCURSES_SP_NAME(_nc_outch)); while (count) { - PutAttrChar(CHREF(*line)); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); line++; count--; } } else if (enter_insert_mode && exit_insert_mode) { TPUTS_TRACE("enter_insert_mode"); - putp(enter_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_insert_mode); while (count) { - PutAttrChar(CHREF(*line)); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - putp(insert_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); } line++; count--; } TPUTS_TRACE("exit_insert_mode"); - putp(exit_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); } else { while (count) { TPUTS_TRACE("insert_character"); - putp(insert_character); - PutAttrChar(CHREF(*line)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_character); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - putp(insert_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); } line++; count--; } } - position_check(SP->_cursrow, SP->_curscol, "InsStr"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "InsStr"); } /* @@ -1545,22 +1684,25 @@ InsStr(NCURSES_CH_T * line, int count) */ static void -DelChar(int count) +DelChar(NCURSES_SP_DCLx int count) { int n; - TR(TRACE_UPDATE, ("DelChar(%d) called, position = (%ld,%ld)", - count, - (long) newscr->_cury, - (long) newscr->_curx)); + TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)", + (void *) SP_PARM, count, + (long) NewScreen(SP_PARM)->_cury, + (long) NewScreen(SP_PARM)->_curx)); if (parm_dch) { TPUTS_TRACE("parm_dch"); - tputs(TPARM_1(parm_dch, count), count, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(parm_dch, count), + count, + NCURSES_SP_NAME(_nc_outch)); } else { for (n = 0; n < count; n++) { TPUTS_TRACE("delete_character"); - putp(delete_character); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_character); } } } @@ -1599,54 +1741,66 @@ DelChar(int count) /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */ static int -scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) +scroll_csr_forward(NCURSES_SP_DCLx + int n, + int top, + int bot, + int miny, + int maxy, + NCURSES_CH_T blank) { int i; if (n == 1 && scroll_forward && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("scroll_forward"); - putp(scroll_forward); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); } else if (n == 1 && delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } else if (parm_index && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_index"); - tputs(TPARM_2(parm_index, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_index, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (parm_delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_delete_line"); - tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_delete_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (scroll_forward && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_forward"); - putp(scroll_forward); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); } } else if (delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE()) { + if (FILL_BCE(SP_PARM)) { int j; for (i = 0; i < n; i++) { - GoTo(bot - i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + GoTo(NCURSES_SP_ARGx bot - i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } #endif @@ -1656,55 +1810,66 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T bla /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */ /* n > 0 */ static int -scroll_csr_backward(int n, int top, int bot, int miny, int maxy, +scroll_csr_backward(NCURSES_SP_DCLx + int n, + int top, + int bot, + int miny, + int maxy, NCURSES_CH_T blank) { int i; if (n == 1 && scroll_reverse && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("scroll_reverse"); - putp(scroll_reverse); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); } else if (n == 1 && insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } else if (parm_rindex && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_rindex"); - tputs(TPARM_2(parm_rindex, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_rindex, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (parm_insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_insert_line"); - tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_insert_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (scroll_reverse && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_reverse"); - putp(scroll_reverse); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); } } else if (insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE()) { + if (FILL_BCE(SP_PARM)) { int j; for (i = 0; i < n; i++) { - GoTo(top + i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + GoTo(NCURSES_SP_ARGx top + i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } #endif @@ -1714,40 +1879,46 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, /* scroll by using delete_line at del and insert_line at ins */ /* n > 0 */ static int -scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) +scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) { int i; if (!((parm_delete_line || delete_line) && (parm_insert_line || insert_line))) return ERR; - GoTo(del, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx del, 0); + UpdateAttrs(SP_PARM, blank); if (n == 1 && delete_line) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } else if (parm_delete_line) { TPUTS_TRACE("parm_delete_line"); - tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_delete_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else { /* if (delete_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } } - GoTo(ins, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx ins, 0); + UpdateAttrs(SP_PARM, blank); if (n == 1 && insert_line) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } else if (parm_insert_line) { TPUTS_TRACE("parm_insert_line"); - tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_insert_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else { /* if (insert_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } } @@ -1763,15 +1934,25 @@ scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) * save/restore cursor capabilities if the terminal has them. */ NCURSES_EXPORT(int) -_nc_scrolln(int n, int top, int bot, int maxy) +NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx + int n, + int top, + int bot, + int maxy) /* scroll region from top to bot by n lines */ { - NCURSES_CH_T blank = ClrBlank(stdscr); + NCURSES_CH_T blank; int i; bool cursor_saved = FALSE; int res; - TR(TRACE_MOVE, ("mvcur_scrolln(%d, %d, %d, %d)", n, top, bot, maxy)); + TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", + (void *) SP_PARM, n, top, bot, maxy)); + + if (!IsValidScreen(SP_PARM)) + return (ERR); + + blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); #if USE_XMC_SUPPORT /* @@ -1787,34 +1968,36 @@ _nc_scrolln(int n, int top, int bot, int maxy) * Explicitly clear if stuff pushed off top of region might * be saved by the terminal. */ - res = scroll_csr_forward(n, top, bot, 0, maxy, blank); + res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { if ((((n == 1 && scroll_forward) || parm_index) - && (SP->_cursrow == bot || SP->_cursrow == bot - 1)) + && (SP_PARM->_cursrow == bot || SP_PARM->_cursrow == bot - 1)) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - putp(save_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); } TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, top, bot)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - putp(restore_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); } else { - SP->_cursrow = SP->_curscol = -1; + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - res = scroll_csr_forward(n, top, bot, top, bot, blank); + res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, maxy)); - SP->_cursrow = SP->_curscol = -1; + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, 0, maxy)); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - if (res == ERR && _nc_idlok) - res = scroll_idl(n, top, bot - n + 1, blank); + if (res == ERR && SP_PARM->_nc_sp_idlok) + res = scroll_idl(NCURSES_SP_ARGx n, top, bot - n + 1, blank); /* * Clear the newly shifted-in text. @@ -1823,44 +2006,49 @@ _nc_scrolln(int n, int top, int bot, int maxy) && (non_dest_scroll_region || (memory_below && bot == maxy))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); if (bot == maxy && clr_eos) { - GoTo(bot - n + 1, 0); - ClrToEOS(blank2); + GoTo(NCURSES_SP_ARGx bot - n + 1, 0); + ClrToEOS(NCURSES_SP_ARGx blank2); } else { for (i = 0; i < n; i++) { - GoTo(bot - i, 0); - ClrToEOL(blank2, FALSE); + GoTo(NCURSES_SP_ARGx bot - i, 0); + ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); } } } } else { /* (n < 0) - scroll down (backward) */ - res = scroll_csr_backward(-n, top, bot, 0, maxy, blank); + res = scroll_csr_backward(NCURSES_SP_ARGx -n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { - if (top != 0 && (SP->_cursrow == top || SP->_cursrow == top - 1) + if (top != 0 + && (SP_PARM->_cursrow == top || + SP_PARM->_cursrow == top - 1) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - putp(save_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); } TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, top, bot)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - putp(restore_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); } else { - SP->_cursrow = SP->_curscol = -1; + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - res = scroll_csr_backward(-n, top, bot, top, bot, blank); + res = scroll_csr_backward(NCURSES_SP_ARGx + -n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, maxy)); - SP->_cursrow = SP->_curscol = -1; + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, 0, maxy)); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - if (res == ERR && _nc_idlok) - res = scroll_idl(-n, bot + n + 1, top, blank); + if (res == ERR && SP_PARM->_nc_sp_idlok) + res = scroll_idl(NCURSES_SP_ARGx -n, bot + n + 1, top, blank); /* * Clear the newly shifted-in text. @@ -1869,8 +2057,8 @@ _nc_scrolln(int n, int top, int bot, int maxy) && (non_dest_scroll_region || (memory_above && top == 0))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); for (i = 0; i < -n; i++) { - GoTo(i + top, 0); - ClrToEOL(blank2, FALSE); + GoTo(NCURSES_SP_ARGx i + top, 0); + ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); } } } @@ -1878,99 +2066,163 @@ _nc_scrolln(int n, int top, int bot, int maxy) if (res == ERR) return (ERR); - _nc_scroll_window(curscr, n, top, bot, blank); + _nc_scroll_window(CurScreen(SP_PARM), n, + (NCURSES_SIZE_T) top, + (NCURSES_SIZE_T) bot, + blank); /* shift hash values too - they can be reused */ - _nc_scroll_oldhash(n, top, bot); + NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_ARGx n, top, bot); return (OK); } -NCURSES_EXPORT(void) -_nc_screen_resume(void) +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_scrolln(int n, int top, int bot, int maxy) { + return NCURSES_SP_NAME(_nc_scrolln) (CURRENT_SCREEN, n, top, bot, maxy); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0) +{ + assert(SP_PARM); + /* make sure terminal is in a sane known state */ - SetAttr(SCREEN_ATTRS(SP), A_NORMAL); - newscr->_clear = TRUE; + SetAttr(SCREEN_ATTRS(SP_PARM), A_NORMAL); + NewScreen(SP_PARM)->_clear = TRUE; /* reset color pairs and definitions */ - if (SP->_coloron || SP->_color_defs) - _nc_reset_colors(); + if (SP_PARM->_coloron || SP_PARM->_color_defs) + NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); /* restore user-defined colors, if any */ - if (SP->_color_defs < 0) { + if (SP_PARM->_color_defs < 0) { int n; - SP->_color_defs = -(SP->_color_defs); - for (n = 0; n < SP->_color_defs; ++n) { - if (SP->_color_table[n].init) { - init_color(n, - SP->_color_table[n].r, - SP->_color_table[n].g, - SP->_color_table[n].b); + SP_PARM->_color_defs = -(SP_PARM->_color_defs); + for (n = 0; n < SP_PARM->_color_defs; ++n) { + if (SP_PARM->_color_table[n].init) { + NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx + (short) n, + SP_PARM->_color_table[n].r, + SP_PARM->_color_table[n].g, + SP_PARM->_color_table[n].b); } } } if (exit_attribute_mode) - putp(exit_attribute_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_attribute_mode); else { /* turn off attributes */ if (exit_alt_charset_mode) - putp(exit_alt_charset_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_alt_charset_mode); if (exit_standout_mode) - putp(exit_standout_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_standout_mode); if (exit_underline_mode) - putp(exit_underline_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_underline_mode); } if (exit_insert_mode) - putp(exit_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); if (enter_am_mode && exit_am_mode) - putp(auto_right_margin ? enter_am_mode : exit_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + (auto_right_margin + ? enter_am_mode + : exit_am_mode)); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_screen_resume(void) +{ + NCURSES_SP_NAME(_nc_screen_resume) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_screen_init) (NCURSES_SP_DCL0) +{ + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_screen_init(void) { - _nc_screen_resume(); + NCURSES_SP_NAME(_nc_screen_init) (CURRENT_SCREEN); } +#endif /* wrap up screen handling */ NCURSES_EXPORT(void) -_nc_screen_wrap(void) +NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0) { - UpdateAttrs(normal); + if (SP_PARM == 0) + return; + + UpdateAttrs(SP_PARM, normal); #if NCURSES_EXT_FUNCS - if (SP->_coloron - && !SP->_default_color) { + if (SP_PARM->_coloron + && !SP_PARM->_default_color) { static const NCURSES_CH_T blank = NewChar(BLANK_TEXT); - SP->_default_color = TRUE; - _nc_do_color(-1, 0, FALSE, _nc_outch); - SP->_default_color = FALSE; + SP_PARM->_default_color = TRUE; + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx + -1, + 0, + FALSE, + NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_default_color = FALSE; - mvcur(SP->_cursrow, SP->_curscol, screen_lines - 1, 0); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + screen_lines(SP_PARM) - 1, + 0); - ClrToEOL(blank, TRUE); + ClrToEOL(NCURSES_SP_ARGx blank, TRUE); } #endif - if (SP->_color_defs) { - _nc_reset_colors(); + if (SP_PARM->_color_defs) { + NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_screen_wrap(void) +{ + NCURSES_SP_NAME(_nc_screen_wrap) (CURRENT_SCREEN); +} +#endif + #if USE_XMC_SUPPORT NCURSES_EXPORT(void) -_nc_do_xmc_glitch(attr_t previous) +NCURSES_SP_NAME(_nc_do_xmc_glitch) (NCURSES_SP_DCLx attr_t previous) { - attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP))); + if (SP_PARM != 0) { + attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP_PARM))); - while (chg != 0) { - if (chg & 1) { - SP->_curscol += magic_cookie_glitch; - if (SP->_curscol >= SP->_columns) - wrap_cursor(); - TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol)); + while (chg != 0) { + if (chg & 1) { + SP_PARM->_curscol += magic_cookie_glitch; + if (SP_PARM->_curscol >= SP_PARM->_columns) + wrap_cursor(NCURSES_SP_ARG); + TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", + SP_PARM->_cursrow, SP_PARM->_curscol)); + } + chg >>= 1; } - chg >>= 1; } } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_do_xmc_glitch(attr_t previous) +{ + NCURSES_SP_NAME(_nc_do_xmc_glitch) (CURRENT_SCREEN, previous); +} +#endif + #endif /* USE_XMC_SUPPORT */ diff --git a/ncurses/wcwidth.h b/ncurses/wcwidth.h new file mode 100644 index 00000000000..61e822ad679 --- /dev/null +++ b/ncurses/wcwidth.h @@ -0,0 +1,309 @@ +/* + * This is an implementation of wcwidth() and wcswidth() (defined in + * IEEE Std 1002.1-2001) for Unicode. + * + * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html + * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html + * + * In fixed-width output devices, Latin characters all occupy a single + * "cell" position of equal width, whereas ideographic CJK characters + * occupy two such cells. Interoperability between terminal-line + * applications and (teletype-style) character terminals using the + * UTF-8 encoding requires agreement on which character should advance + * the cursor by how many cell positions. No established formal + * standards exist at present on which Unicode character shall occupy + * how many cell positions on character terminals. These routines are + * a first attempt of defining such behavior based on simple rules + * applied to data provided by the Unicode Consortium. + * + * For some graphical characters, the Unicode standard explicitly + * defines a character-cell width via the definition of the East Asian + * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. + * In all these cases, there is no ambiguity about which width a + * terminal shall use. For characters in the East Asian Ambiguous (A) + * class, the width choice depends purely on a preference of backward + * compatibility with either historic CJK or Western practice. + * Choosing single-width for these characters is easy to justify as + * the appropriate long-term solution, as the CJK practice of + * displaying these characters as double-width comes from historic + * implementation simplicity (8-bit encoded characters were displayed + * single-width and 16-bit ones double-width, even for Greek, + * Cyrillic, etc.) and not any typographic considerations. + * + * Much less clear is the choice of width for the Not East Asian + * (Neutral) class. Existing practice does not dictate a width for any + * of these characters. It would nevertheless make sense + * typographically to allocate two character cells to characters such + * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be + * represented adequately with a single-width glyph. The following + * routines at present merely assign a single-cell width to all + * neutral characters, in the interest of simplicity. This is not + * entirely satisfactory and should be reconsidered before + * establishing a formal standard in this area. At the moment, the + * decision which Not East Asian (Neutral) characters should be + * represented by double-width glyphs cannot yet be answered by + * applying a simple rule from the Unicode database content. Setting + * up a proper standard for the behavior of UTF-8 character terminals + * will require a careful analysis not only of each Unicode character, + * but also of each presentation form, something the author of these + * routines has avoided to do so far. + * + * http://www.unicode.org/unicode/reports/tr11/ + * + * Markus Kuhn -- 2007-05-26 (Unicode 5.0) + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted. The author + * disclaims all warranties with regard to this software. + * + * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + */ + +#include + +struct interval { + int first; + int last; +}; + +/* auxiliary function for binary search in interval table */ +static int bisearch(wchar_t ucs, const struct interval *table, int max) { + int min = 0; + int mid; + + if (ucs < table[0].first || ucs > table[max].last) + return 0; + while (max >= min) { + mid = (min + max) / 2; + if (ucs > table[mid].last) + min = mid + 1; + else if (ucs < table[mid].first) + max = mid - 1; + else + return 1; + } + + return 0; +} + + +/* The following two functions define the column width of an ISO 10646 + * character as follows: + * + * - The null character (U+0000) has a column width of 0. + * + * - Other C0/C1 control characters and DEL will lead to a return + * value of -1. + * + * - Non-spacing and enclosing combining characters (general + * category code Mn or Me in the Unicode database) have a + * column width of 0. + * + * - SOFT HYPHEN (U+00AD) has a column width of 1. + * + * - Other format characters (general category code Cf in the Unicode + * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. + * + * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) + * have a column width of 0. + * + * - Spacing characters in the East Asian Wide (W) or East Asian + * Full-width (F) category as defined in Unicode Technical + * Report #11 have a column width of 2. + * + * - All remaining characters (including all printable + * ISO 8859-1 and WGL4 characters, Unicode control characters, + * etc.) have a column width of 1. + * + * This implementation assumes that wchar_t characters are encoded + * in ISO 10646. + */ + +int mk_wcwidth(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of non-spacing characters */ + /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ + static const struct interval combining[] = { + { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, + { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, + { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, + { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, + { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, + { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, + { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, + { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, + { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, + { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, + { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, + { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, + { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, + { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, + { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, + { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, + { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, + { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, + { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, + { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, + { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, + { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, + { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, + { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, + { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, + { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, + { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, + { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, + { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, + { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, + { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, + { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, + { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, + { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, + { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, + { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, + { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, + { 0xE0100, 0xE01EF } + }; + + /* test for 8-bit control characters */ + if (ucs == 0) + return 0; + if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) + return -1; + + /* binary search in table of non-spacing characters */ + if (bisearch(ucs, combining, + sizeof(combining) / sizeof(struct interval) - 1)) + return 0; + + /* if we arrive here, ucs is not a combining or C0/C1 control character */ + + return 1 + + (ucs >= 0x1100 && + (ucs <= 0x115f || /* Hangul Jamo init. consonants */ + ucs == 0x2329 || ucs == 0x232a || + (ucs >= 0x2e80 && ucs <= 0xa4cf && + ucs != 0x303f) || /* CJK ... Yi */ + (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ + (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ + (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */ + (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ + (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ + (ucs >= 0xffe0 && ucs <= 0xffe6) || + (ucs >= 0x20000 && ucs <= 0x2fffd) || + (ucs >= 0x30000 && ucs <= 0x3fffd))); +} + + +int mk_wcswidth(const wchar_t *pwcs, size_t n) +{ + int w, width = 0; + + for (;*pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth(*pwcs)) < 0) + return -1; + else + width += w; + + return width; +} + + +/* + * The following functions are the same as mk_wcwidth() and + * mk_wcswidth(), except that spacing characters in the East Asian + * Ambiguous (A) category as defined in Unicode Technical Report #11 + * have a column width of 2. This variant might be useful for users of + * CJK legacy encodings who want to migrate to UCS without changing + * the traditional terminal character-width behaviour. It is not + * otherwise recommended for general use. + */ +int mk_wcwidth_cjk(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of East Asian Ambiguous + * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ + static const struct interval ambiguous[] = { + { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, + { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 }, + { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 }, + { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 }, + { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED }, + { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA }, + { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, + { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, + { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 }, + { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 }, + { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 }, + { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, + { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, + { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, + { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, + { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB }, + { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB }, + { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 }, + { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 }, + { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 }, + { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, + { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, + { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, + { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 }, + { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC }, + { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, + { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, + { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 }, + { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 }, + { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 }, + { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 }, + { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B }, + { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, + { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 }, + { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E }, + { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 }, + { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 }, + { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F }, + { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 }, + { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF }, + { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B }, + { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 }, + { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 }, + { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 }, + { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 }, + { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 }, + { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 }, + { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 }, + { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, + { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F }, + { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF }, + { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } + }; + + /* binary search in table of non-spacing characters */ + if (bisearch(ucs, ambiguous, + sizeof(ambiguous) / sizeof(struct interval) - 1)) + return 2; + + return mk_wcwidth(ucs); +} + + +int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) +{ + int w, width = 0; + + for (;*pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth_cjk(*pwcs)) < 0) + return -1; + else + width += w; + + return width; +} diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index 93b41bb4930..a8491fcbf57 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2004-2009,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 * @@ -35,39 +35,387 @@ #include -MODULE_ID("$Id: lib_add_wch.c,v 1.6 2006/12/02 21:19:17 tom Exp $") +#if HAVE_WCTYPE_H +#include +#endif + +MODULE_ID("$Id: lib_add_wch.c,v 1.11 2010/12/19 01:32:55 tom Exp $") + +/* clone/adapt lib_addch.c */ +static const cchar_t blankchar = NewChar(BLANK_TEXT); + +/* + * Ugly microtweaking alert. Everything from here to end of module is + * likely to be speed-critical -- profiling data sure says it is! + * Most of the important screen-painting functions are shells around + * wadd_wch(). So we make every effort to reduce function-call overhead + * by inlining stuff, even at the cost of making wrapped copies for + * export. Also we supply some internal versions that don't call the + * window sync hook, for use by string-put functions. + */ + +/* Return bit mask for clearing color pair number if given ch has color */ +#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0)) + +static NCURSES_INLINE cchar_t +render_char(WINDOW *win, cchar_t ch) +/* compute a rendition of the given char correct for the current context */ +{ + attr_t a = WINDOW_ATTRS(win); + int pair = GetPair(ch); + + if (ISBLANK(ch) + && AttrOf(ch) == A_NORMAL + && pair == 0) { + /* color/pair in attrs has precedence over bkgrnd */ + ch = win->_nc_bkgd; + SetAttr(ch, a | AttrOf(win->_nc_bkgd)); + if ((pair = GET_WINDOW_PAIR(win)) == 0) + pair = GetPair(win->_nc_bkgd); + SetPair(ch, pair); + } else { + /* color in attrs has precedence over bkgrnd */ + a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a); + /* color in ch has precedence */ + if (pair == 0) { + if ((pair = GET_WINDOW_PAIR(win)) == 0) + pair = GetPair(win->_nc_bkgd); + } + AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); + SetPair(ch, pair); + } + + TR(TRACE_VIRTPUT, + ("render_char bkg %s (%d), attrs %s (%d) -> ch %s (%d)", + _tracech_t2(1, CHREF(win->_nc_bkgd)), + GetPair(win->_nc_bkgd), + _traceattr(WINDOW_ATTRS(win)), + GET_WINDOW_PAIR(win), + _tracech_t2(3, CHREF(ch)), + GetPair(ch))); + + return (ch); +} + +/* check if position is legal; if not, return error */ +#ifndef NDEBUG /* treat this like an assertion */ +#define CHECK_POSITION(win, x, y) \ + if (y > win->_maxy \ + || x > win->_maxx \ + || y < 0 \ + || x < 0) { \ + TR(TRACE_VIRTPUT, ("Alert! Win=%p _curx = %d, _cury = %d " \ + "(_maxx = %d, _maxy = %d)", win, x, y, \ + win->_maxx, win->_maxy)); \ + return(ERR); \ + } +#else +#define CHECK_POSITION(win, x, y) /* nothing */ +#endif + +static bool +newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos) +{ + bool result = FALSE; + + if (*ypos >= win->_regtop && *ypos == win->_regbottom) { + *ypos = win->_regbottom; + result = TRUE; + } else { + *ypos = (NCURSES_SIZE_T) (*ypos + 1); + } + return result; +} + +/* + * The _WRAPPED flag is useful only for telling an application that we've just + * wrapped the cursor. We don't do anything with this flag except set it when + * wrapping, and clear it whenever we move the cursor. If we try to wrap at + * the lower-right corner of a window, we cannot move the cursor (since that + * wouldn't be legal). So we return an error (which is what SVr4 does). + * Unlike SVr4, we can successfully add a character to the lower-right corner + * (Solaris 2.6 does this also, however). + */ +static int +wrap_to_next_line(WINDOW *win) +{ + win->_flags |= _WRAPPED; + if (newline_forces_scroll(win, &(win->_cury))) { + win->_curx = win->_maxx; + if (!win->_scroll) + return (ERR); + scroll(win); + } + win->_curx = 0; + return (OK); +} + +static int wadd_wch_literal(WINDOW *, cchar_t); +/* + * Fill the given number of cells with blanks using the current background + * rendition. This saves/restores the current x-position. + */ +static void +fill_cells(WINDOW *win, int count) +{ + cchar_t blank = blankchar; + int save_x = win->_curx; + int save_y = win->_cury; + + while (count-- > 0) { + if (wadd_wch_literal(win, blank) == ERR) + break; + } + win->_curx = (NCURSES_SIZE_T) save_x; + win->_cury = (NCURSES_SIZE_T) save_y; +} + +static int +wadd_wch_literal(WINDOW *win, cchar_t ch) +{ + int x; + int y; + struct ldat *line; + + x = win->_curx; + y = win->_cury; + + CHECK_POSITION(win, x, y); + + ch = render_char(win, ch); + + line = win->_line + y; + + CHANGED_CELL(line, x); + + /* + * Non-spacing characters are added to the current cell. + * + * Spacing characters that are wider than one column require some display + * adjustments. + */ + { + int len = wcwidth(CharOf(ch)); + int i; + int j; + wchar_t *chars; + + if (len == 0) { /* non-spacing */ + if ((x > 0 && y >= 0) + || (win->_maxx >= 0 && win->_cury >= 1)) { + if (x > 0 && y >= 0) + chars = (win->_line[y].text[x - 1].chars); + else + chars = (win->_line[y - 1].text[win->_maxx].chars); + for (i = 0; i < CCHARW_MAX; ++i) { + if (chars[i] == 0) { + TR(TRACE_VIRTPUT, + ("added non-spacing %d: %x", + x, (int) CharOf(ch))); + chars[i] = CharOf(ch); + break; + } + } + } + goto testwrapping; + } else if (len > 1) { /* multi-column characters */ + /* + * Check if the character will fit on the current line. If it does + * not fit, fill in the remainder of the line with blanks. and + * move to the next line. + */ + if (len > win->_maxx + 1) { + TR(TRACE_VIRTPUT, ("character will not fit")); + return ERR; + } else if (x + len > win->_maxx + 1) { + int count = win->_maxx + 1 - x; + TR(TRACE_VIRTPUT, ("fill %d remaining cells", count)); + fill_cells(win, count); + if (wrap_to_next_line(win) == ERR) + return ERR; + x = win->_curx; + y = win->_cury; + line = win->_line + y; + } + /* + * Check for cells which are orphaned by adding this character, set + * those to blanks. + * + * FIXME: this actually could fill j-i cells, more complicated to + * setup though. + */ + for (i = 0; i < len; ++i) { + if (isWidecBase(win->_line[y].text[x + i])) { + break; + } else if (isWidecExt(win->_line[y].text[x + i])) { + for (j = i; x + j <= win->_maxx; ++j) { + if (!isWidecExt(win->_line[y].text[x + j])) { + TR(TRACE_VIRTPUT, ("fill %d orphan cells", j)); + fill_cells(win, j); + break; + } + } + break; + } + } + /* + * Finally, add the cells for this character. + */ + for (i = 0; i < len; ++i) { + cchar_t value = ch; + SetWidecExt(value, i); + TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)", + i + 1, len, + win->_begy + y, win->_begx + x)); + line->text[x] = value; + CHANGED_CELL(line, x); + ++x; + } + goto testwrapping; + } + } + + /* + * Single-column characters. + */ + line->text[x++] = ch; + /* + * This label is used only for wide-characters. + */ + testwrapping: + + TR(TRACE_VIRTPUT, ("cell (%ld, %ld..%d) = %s", + (long) win->_cury, (long) win->_curx, x - 1, + _tracech_t(CHREF(ch)))); + + if (x > win->_maxx) { + return wrap_to_next_line(win); + } + win->_curx = (NCURSES_SIZE_T) x; + return OK; +} + +static NCURSES_INLINE int +wadd_wch_nosync(WINDOW *win, cchar_t ch) +/* the workhorse function -- add a character to the given window */ +{ + NCURSES_SIZE_T x, y; + wchar_t *s; + int tabsize = 8; +#if USE_REENTRANT + SCREEN *sp = _nc_screen_of(win); +#endif + + /* + * If we are using the alternate character set, forget about locale. + * Otherwise, if the locale * claims the code is printable, treat it that + * way. + */ + if ((AttrOf(ch) & A_ALTCHARSET) + || iswprint((wint_t) CharOf(ch))) + return wadd_wch_literal(win, ch); + + /* + * Handle carriage control and other codes that are not printable, or are + * known to expand to more than one character according to unctrl(). + */ + x = win->_curx; + y = win->_cury; + + switch (CharOf(ch)) { + case '\t': +#if USE_REENTRANT + tabsize = *ptrTabsize(sp); +#else + tabsize = TABSIZE; +#endif + x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize))); + /* + * Space-fill the tab on the bottom line so that we'll get the + * "correct" cursor position. + */ + if ((!win->_scroll && (y == win->_regbottom)) + || (x <= win->_maxx)) { + cchar_t blank = blankchar; + AddAttr(blank, AttrOf(ch)); + while (win->_curx < x) { + if (wadd_wch_literal(win, blank) == ERR) + return (ERR); + } + break; + } else { + wclrtoeol(win); + win->_flags |= _WRAPPED; + if (newline_forces_scroll(win, &y)) { + x = win->_maxx; + if (win->_scroll) { + scroll(win); + x = 0; + } + } else { + x = 0; + } + } + break; + case '\n': + wclrtoeol(win); + if (newline_forces_scroll(win, &y)) { + if (win->_scroll) + scroll(win); + else + return (ERR); + } + /* FALLTHRU */ + case '\r': + x = 0; + win->_flags &= ~_WRAPPED; + break; + case '\b': + if (x == 0) + return (OK); + x--; + win->_flags &= ~_WRAPPED; + break; + default: + if ((s = wunctrl(&ch)) != 0) { + while (*s) { + cchar_t sch; + SetChar(sch, *s++, AttrOf(ch)); + if_EXT_COLORS(SetPair(sch, GetPair(ch))); + if (wadd_wch_literal(win, sch) == ERR) + return ERR; + } + return OK; + } + return ERR; + } + + win->_curx = x; + win->_cury = y; + + return OK; +} + +/* + * The versions below call _nc_synchook(). We wanted to avoid this in the + * version exported for string puts; they'll call _nc_synchook once at end + * of run. + */ + +/* These are actual entry points */ NCURSES_EXPORT(int) wadd_wch(WINDOW *win, const cchar_t *wch) { - PUTC_DATA; - int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, - _tracech_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), + (void *) win, + _tracecchar_t(wch))); - if (win != 0) { - PUTC_INIT; - for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { - attr_t attrs = (wch->attr & A_ATTRIBUTES); - - if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') - break; - if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { - code = ERR; - if (is8bits(PUTC_ch)) - code = waddch(win, UChar(PUTC_ch) | attrs); - break; - } - for (n = 0; n < PUTC_n; n++) { - if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { - break; - } - } - if (code == ERR) - break; - } + if (win && (wadd_wch_nosync(win, *wch) != ERR)) { + _nc_synchook(win); + code = OK; } TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); @@ -77,37 +425,19 @@ wadd_wch(WINDOW *win, const cchar_t *wch) NCURSES_EXPORT(int) wecho_wchar(WINDOW *win, const cchar_t *wch) { - PUTC_DATA; - int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win, - _tracech_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), + (void *) win, + _tracecchar_t(wch))); - if (win != 0) { - PUTC_INIT; - for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { - attr_t attrs = (wch->attr & A_ATTRIBUTES); - - if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') - break; - if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { - code = ERR; - if (is8bits(PUTC_ch)) - code = waddch(win, UChar(PUTC_ch) | attrs); - break; - } - for (n = 0; n < PUTC_n; n++) { - if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { - break; - } - } - if (code == ERR) - break; - } - wrefresh(win); + if (win && (wadd_wch_nosync(win, *wch) != ERR)) { + bool save_immed = win->_immed; + win->_immed = TRUE; + _nc_synchook(win); + win->_immed = save_immed; + code = OK; } - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); return (code); } diff --git a/ncurses/widechar/lib_box_set.c b/ncurses/widechar/lib_box_set.c index 35fce46d8d4..585c94963b0 100644 --- a/ncurses/widechar/lib_box_set.c +++ b/ncurses/widechar/lib_box_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2003,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_box_set.c,v 1.4 2003/12/06 18:02:13 tom Exp $") +MODULE_ID("$Id: lib_box_set.c,v 1.5 2009/10/24 22:36:56 tom Exp $") NCURSES_EXPORT(int) wborder_set(WINDOW *win, @@ -53,7 +53,7 @@ wborder_set(WINDOW *win, NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, + (void *) win, _tracech_t2(1, ls), _tracech_t2(2, rs), _tracech_t2(3, ts), diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index b4a0c37a285..c61c79529db 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,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 * @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.12 2007/05/12 19:03:06 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.20 2010/12/25 23:46:26 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -50,15 +50,15 @@ setcchar(cchar_t *wcval, short color_pair, const void *opts) { - int i; - int len; + unsigned i; + unsigned len; int code = OK; TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), - wcval, _nc_viswbuf(wch), + (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); - len = wcslen(wch); + len = (unsigned) wcslen(wch); if (opts != NULL || (len > 1 && wcwidth(wch[0]) < 0)) { code = ERR; @@ -80,7 +80,7 @@ setcchar(cchar_t *wcval, memset(wcval, 0, sizeof(*wcval)); if (len != 0) { - SetAttr(*wcval, attrs | COLOR_PAIR(color_pair)); + SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair)); SetPair(CHDEREF(wcval), color_pair); memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, @@ -104,20 +104,28 @@ getcchar(const cchar_t *wcval, int code = ERR; TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), - wcval, wch, attrs, color_pair, opts)); + (const void *) wcval, + (void *) wch, + (void *) attrs, + (void *) color_pair, + opts)); if (opts == NULL) { - len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) - ? wp - wcval->chars - : CCHARW_MAX; + len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? (int) (wp - wcval->chars) + : CCHARW_MAX); if (wch == NULL) { - code = len; + /* + * If the value is a null, set the length to 1. + * If the value is not a null, return the length plus 1 for null. + */ + code = (len < CCHARW_MAX) ? (len + 1) : CCHARW_MAX; } else if (attrs == 0 || color_pair == 0) { code = ERR; } else if (len >= 0) { *attrs = AttrOf(*wcval) & A_ATTRIBUTES; - *color_pair = GetPair(*wcval); + *color_pair = (short) GetPair(*wcval); wmemcpy(wch, wcval->chars, (unsigned) len); wch[len] = L'\0'; code = OK; diff --git a/ncurses/widechar/lib_erasewchar.c b/ncurses/widechar/lib_erasewchar.c index 7d6455370ff..a4ee93ffa42 100644 --- a/ncurses/widechar/lib_erasewchar.c +++ b/ncurses/widechar/lib_erasewchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002,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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") +MODULE_ID("$Id: lib_erasewchar.c,v 1.2 2010/07/24 11:35:12 tom Exp $") /* * erasewchar() @@ -42,7 +42,7 @@ MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") */ NCURSES_EXPORT(int) -erasewchar(wchar_t * wch) +erasewchar(wchar_t *wch) { int value; int result = ERR; @@ -63,7 +63,7 @@ erasewchar(wchar_t * wch) */ NCURSES_EXPORT(int) -killwchar(wchar_t * wch) +killwchar(wchar_t *wch) { int value; int result = ERR; diff --git a/ncurses/widechar/lib_get_wch.c b/ncurses/widechar/lib_get_wch.c index 6cf3129f2d1..32033df2ff9 100644 --- a/ncurses/widechar/lib_get_wch.c +++ b/ncurses/widechar/lib_get_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -40,22 +40,7 @@ #include #include -MODULE_ID("$Id: lib_get_wch.c,v 1.17 2008/08/16 19:22:55 tom Exp $") - -#if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) -#define count_mbytes(buffer,length,state) mblen(buffer,length) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbtowc(&wch, buffer, length) -#define state_unused -#elif HAVE_MBRTOWC && HAVE_MBRLEN -#define reset_mbytes(state) init_mb(state) -#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbrtowc(&wch, buffer, length, &state) -#else -make an error -#endif +MODULE_ID("$Id: lib_get_wch.c,v 1.22 2010/08/28 21:00:35 tom Exp $") NCURSES_EXPORT(int) wget_wch(WINDOW *win, wint_t *result) @@ -65,13 +50,13 @@ wget_wch(WINDOW *win, wint_t *result) char buffer[(MB_LEN_MAX * 9) + 1]; /* allow some redundant shifts */ int status; size_t count = 0; - unsigned long value; + int value = 0; wchar_t wch; #ifndef state_unused mbstate_t state; #endif - T((T_CALLED("wget_wch(%p)"), win)); + T((T_CALLED("wget_wch(%p)"), (void *) win)); /* * We can get a stream of single-byte characters and KEY_xxx codes from @@ -95,12 +80,12 @@ wget_wch(WINDOW *win, wint_t *result) * whether the improvement would be worth the effort. */ if (count != 0) { - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); code = ERR; } break; } else if (count + 1 >= sizeof(buffer)) { - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); code = ERR; break; } else { @@ -111,7 +96,7 @@ wget_wch(WINDOW *win, wint_t *result) reset_mbytes(state); if (check_mbytes(wch, buffer, count, state) != status) { code = ERR; /* the two calls should match */ - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); } value = wch; break; @@ -121,8 +106,8 @@ wget_wch(WINDOW *win, wint_t *result) } else { code = ERR; } - *result = value; + *result = (wint_t) value; _nc_unlock_global(curses); - T(("result %#lo", value)); + T(("result %#o", value)); returnCode(code); } diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c index baa70a5a53f..0b450211b2c 100644 --- a/ncurses/widechar/lib_get_wstr.c +++ b/ncurses/widechar/lib_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-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 * @@ -38,9 +38,8 @@ */ #include -#include -MODULE_ID("$Id: lib_get_wstr.c,v 1.10 2008/08/16 19:25:33 tom Exp $") +MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -96,7 +95,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen) wint_t ch; int y, x, code; - T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), (void *) win, (void *) str, maxlen)); if (!win) returnCode(ERR); diff --git a/ncurses/widechar/lib_hline_set.c b/ncurses/widechar/lib_hline_set.c index 43175de8346..da92b834f1c 100644 --- a/ncurses/widechar/lib_hline_set.c +++ b/ncurses/widechar/lib_hline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") +MODULE_ID("$Id: lib_hline_set.c,v 1.4 2010/12/19 01:45:03 tom Exp $") NCURSES_EXPORT(int) -whline_set(WINDOW *win, const cchar_t * ch, int n) +whline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T start; - NCURSES_SIZE_T end; + int start; + int end; - T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/ncurses/widechar/lib_in_wch.c b/ncurses/widechar/lib_in_wch.c index 5cd92e382de..b2396508ba2 100644 --- a/ncurses/widechar/lib_in_wch.c +++ b/ncurses/widechar/lib_in_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2006,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_in_wch.c,v 1.4 2006/09/03 15:41:22 tom Exp $") +MODULE_ID("$Id: lib_in_wch.c,v 1.5 2009/10/24 22:37:55 tom Exp $") NCURSES_EXPORT(int) win_wch(WINDOW *win, cchar_t *wcval) @@ -47,7 +47,7 @@ win_wch(WINDOW *win, cchar_t *wcval) int row, col; int code = OK; - TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval)); if (win != 0 && wcval != 0) { getyx(win, row, col); diff --git a/ncurses/widechar/lib_in_wchnstr.c b/ncurses/widechar/lib_in_wchnstr.c index e9f0646ea66..57cc2ca6e73 100644 --- a/ncurses/widechar/lib_in_wchnstr.c +++ b/ncurses/widechar/lib_in_wchnstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004-2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2007,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 * @@ -39,14 +39,14 @@ #include -MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $") +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.8 2009/10/24 22:37:48 tom Exp $") NCURSES_EXPORT(int) win_wchnstr(WINDOW *win, cchar_t *wchstr, int n) { int code = OK; - T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); + T((T_CALLED("win_wchnstr(%p,%p,%d)"), (void *) win, (void *) wchstr, n)); if (win != 0 && wchstr != 0) { NCURSES_CH_T *src; diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index c3d0420e53b..1eee8a3ec01 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2003,2005 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,39 +39,44 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.8 2005/12/03 20:24:19 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $") /* * Insert the given character, updating the current location to simplify * inserting a string. */ -static int +NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *win, const cchar_t *wch) { int cells = wcwidth(CharOf(CHDEREF(wch))); int cell; + int code = OK; - if (cells <= 0) - cells = 1; + if (cells < 0) { + code = winsch(win, (chtype) CharOf(CHDEREF(wch))); + } else { + if (cells == 0) + cells = 1; - if (win->_curx <= win->_maxx) { - struct ldat *line = &(win->_line[win->_cury]); - NCURSES_CH_T *end = &(line->text[win->_curx]); - NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); - NCURSES_CH_T *temp2 = temp1 - cells; + if (win->_curx <= win->_maxx) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - cells; - CHANGED_TO_EOL(line, win->_curx, win->_maxx); - while (temp1 > end) - *temp1-- = *temp2--; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; - *temp1 = _nc_render(win, *wch); - for (cell = 1; cell < cells; ++cell) { - SetWidecExt(temp1[cell], cell); + *temp1 = _nc_render(win, *wch); + for (cell = 1; cell < cells; ++cell) { + SetWidecExt(temp1[cell], cell); + } + + win->_curx++; } - - win->_curx++; } - return OK; + return code; } NCURSES_EXPORT(int) @@ -81,7 +86,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) NCURSES_SIZE_T ox; int code = ERR; - T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); + T((T_CALLED("wins_wch(%p, %s)"), (void *) win, _tracecchar_t(wch))); if (win != 0) { oy = win->_cury; @@ -104,20 +109,23 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T ox; const wchar_t *cp; - T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n)); + T((T_CALLED("wins_nwstr(%p,%s,%d)"), + (void *) win, _nc_viswbufn(wstr, n), n)); if (win != 0 && wstr != 0) { if (n < 1) - n = wcslen(wstr); + n = (int) wcslen(wstr); code = OK; if (n > 0) { + SCREEN *sp = _nc_screen_of(win); + oy = win->_cury; ox = win->_curx; for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { int len = wcwidth(*cp); - if (len != 1 || !is8bits(*cp)) { + if ((len >= 0 && len != 1) || !is7bits(*cp)) { cchar_t tmp_cchar; wchar_t tmp_wchar = *cp; memset(&tmp_cchar, 0, sizeof(tmp_cchar)); @@ -129,7 +137,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) code = _nc_insert_wch(win, &tmp_cchar); } else { /* tabs, other ASCII stuff */ - code = _nc_insert_ch(win, (chtype) (*cp)); + code = _nc_insert_ch(sp, win, (chtype) (*cp)); } if (code != OK) break; diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c index 2207a5f5d19..4cf7182ae06 100644 --- a/ncurses/widechar/lib_inwstr.c +++ b/ncurses/widechar/lib_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2004 Free Software Foundation, Inc. * + * Copyright (c) 2002-2004,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_inwstr.c,v 1.4 2004/10/23 20:41:28 tom Exp $") +MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) @@ -50,7 +50,7 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n) cchar_t *text; wchar_t wch; - T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); + T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n)); if (wstr != 0) { if (win) { getyx(win, row, col); @@ -93,7 +93,7 @@ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; - T((T_CALLED("winwstr(%p,%p)"), win, wstr)); + T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) result = ERR; returnCode(result); diff --git a/ncurses/widechar/lib_pecho_wchar.c b/ncurses/widechar/lib_pecho_wchar.c index e6127757431..b6da7a86569 100644 --- a/ncurses/widechar/lib_pecho_wchar.c +++ b/ncurses/widechar/lib_pecho_wchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004 Free Software Foundation, Inc. * + * Copyright (c) 2004,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 * @@ -32,12 +32,12 @@ #include -MODULE_ID("$Id: lib_pecho_wchar.c,v 1.1 2004/01/03 21:42:01 tom Exp $") +MODULE_ID("$Id: lib_pecho_wchar.c,v 1.2 2009/10/24 22:43:32 tom Exp $") NCURSES_EXPORT(int) -pecho_wchar(WINDOW *pad, const cchar_t * wch) +pecho_wchar(WINDOW *pad, const cchar_t *wch) { - T((T_CALLED("pecho_wchar(%p, %s)"), pad, _tracech_t(wch))); + T((T_CALLED("pecho_wchar(%p, %s)"), (void *) pad, _tracech_t(wch))); if (pad == 0) returnCode(ERR); diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c index bb2c4a084b1..7a626a9eee8 100644 --- a/ncurses/widechar/lib_unget_wch.c +++ b/ncurses/widechar/lib_unget_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.10 2008/06/07 14:50:37 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.14 2010/07/24 11:35:21 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -55,24 +55,24 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state) const wchar_t *tempp = temp; temp[0] = source; temp[1] = 0; - result = wcsrtombs(NULL, &tempp, 0, state); + result = (int) wcsrtombs(NULL, &tempp, 0, state); } else { - result = wcrtomb(target, source, state); + result = (int) wcrtomb(target, source, state); } if (!isEILSEQ(result) && (result == 0)) result = 1; - return result; + return (size_t) result; } NCURSES_EXPORT(int) -unget_wch(const wchar_t wch) +NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) { int result = OK; mbstate_t state; size_t length; int n; - T((T_CALLED("unget_wch(%#lx)"), (unsigned long) wch)); + T((T_CALLED("unget_wch(%p, %#lx)"), (void *) SP_PARM, (unsigned long) wch)); init_mb(state); length = _nc_wcrtomb(0, wch, &state); @@ -83,10 +83,12 @@ unget_wch(const wchar_t wch) if ((string = (char *) malloc(length)) != 0) { init_mb(state); - wcrtomb(string, wch, &state); + /* ignore the result, since we already validated the character */ + IGNORE_RC((int) wcrtomb(string, wch, &state)); for (n = (int) (length - 1); n >= 0; --n) { - if (_nc_ungetch(SP, string[n]) != OK) { + if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx + UChar(string[n])) !=OK) { result = ERR; break; } @@ -101,3 +103,11 @@ unget_wch(const wchar_t wch) returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +unget_wch(const wchar_t wch) +{ + return NCURSES_SP_NAME(unget_wch) (CURRENT_SCREEN, wch); +} +#endif diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c index 1dc679e6d90..e4cf093a1f6 100644 --- a/ncurses/widechar/lib_vid_attr.c +++ b/ncurses/widechar/lib_vid_attr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -31,11 +31,14 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) +MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $") + +#define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -50,14 +53,22 @@ MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - _nc_do_color(old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \ + old_pair, pair, \ + reverse, outc); \ } \ } -#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= COLOR_PAIR(pair) +#define set_color(mode, pair) \ + mode &= ALL_BUT_COLOR; \ + mode |= (attr_t) ColorPair(pair) NCURSES_EXPORT(int) -vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) +NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx + attr_t newmode, + short pair, + void *opts GCC_UNUSED, + NCURSES_SP_OUTC outc) { #if NCURSES_EXT_COLORS static attr_t previous_attr = A_NORMAL; @@ -65,9 +76,9 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) attr_t turn_on, turn_off; bool reverse = FALSE; - bool can_color = (SP == 0 || SP->_coloron); + bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); + bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); #else #define fix_pair0 FALSE #endif @@ -76,18 +87,18 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); /* this allows us to go on whether or not newterm() has been called */ - if (SP) { - previous_attr = AttrOf(SCREEN_ATTRS(SP)); - previous_pair = GetPair(SCREEN_ATTRS(SP)); + if (SP_PARM) { + previous_attr = AttrOf(SCREEN_ATTRS(SP_PARM)); + previous_pair = GetPair(SCREEN_ATTRS(SP_PARM)); } TR(TRACE_ATTRS, ("previous attribute was %s, %d", _traceattr(previous_attr), previous_pair)); #if !USE_XMC_SUPPORT - if ((SP != 0) + if ((SP_PARM != 0) && (magic_cookie_glitch > 0)) - newmode &= ~(SP->_xmc_suppress); + newmode &= ~(SP_PARM->_xmc_suppress); #endif /* @@ -144,10 +155,10 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -159,16 +170,18 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - tputs(TPARM_9(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), + 1, outc); previous_attr &= ALL_BUT_COLOR; previous_pair = 0; } @@ -179,11 +192,11 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -221,9 +234,9 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) if (reverse) newmode |= A_REVERSE; - if (SP) { - SetAttr(SCREEN_ATTRS(SP), newmode); - SetPair(SCREEN_ATTRS(SP), pair); + if (SP_PARM) { + SetAttr(SCREEN_ATTRS(SP_PARM), newmode); + SetPair(SCREEN_ATTRS(SP_PARM), pair); } else { previous_attr = newmode; previous_pair = pair; @@ -233,29 +246,60 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) #else T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); set_color(newmode, pair); - returnCode(vidputs(newmode, outc)); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, outc)); #endif } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +vid_puts(attr_t newmode, + short pair, + void *opts GCC_UNUSED, + NCURSES_OUTC outc) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vid_puts) (CURRENT_SCREEN, + newmode, + pair, + opts, + _nc_outc_wrapper); +} +#endif + #undef vid_attr NCURSES_EXPORT(int) +NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx + attr_t newmode, + short pair, + void *opts) +{ + T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); + returnCode(NCURSES_SP_NAME(vid_puts) (NCURSES_SP_ARGx + newmode, + pair, + opts, + NCURSES_SP_NAME(_nc_outch))); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) vid_attr(attr_t newmode, short pair, void *opts) { - T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); - returnCode(vid_puts(newmode, pair, opts, _nc_outch)); + return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts); } +#endif /* * This implementation uses the same mask values for A_xxx and WA_xxx, so * we can use termattrs() for part of the logic. */ NCURSES_EXPORT(attr_t) -term_attrs(void) +NCURSES_SP_NAME(term_attrs) (NCURSES_SP_DCL0) { attr_t attrs; T((T_CALLED("term_attrs()"))); - attrs = termattrs(); + attrs = SP_PARM ? NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG) : 0; /* these are only supported for wide-character mode */ if (enter_horizontal_hl_mode) @@ -273,3 +317,11 @@ term_attrs(void) returnAttr(attrs); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(attr_t) +term_attrs(void) +{ + return NCURSES_SP_NAME(term_attrs) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/widechar/lib_vline_set.c b/ncurses/widechar/lib_vline_set.c index af42df1f24a..917caac44b4 100644 --- a/ncurses/widechar/lib_vline_set.c +++ b/ncurses/widechar/lib_vline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") +MODULE_ID("$Id: lib_vline_set.c,v 1.4 2010/12/19 01:50:50 tom Exp $") NCURSES_EXPORT(int) -wvline_set(WINDOW *win, const cchar_t * ch, int n) +wvline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T row, col; - NCURSES_SIZE_T end; + int row, col; + int end; - T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { NCURSES_CH_T wch; diff --git a/ncurses/widechar/lib_wacs.c b/ncurses/widechar/lib_wacs.c index fe893b4d2f8..5a16e457e09 100644 --- a/ncurses/widechar/lib_wacs.c +++ b/ncurses/widechar/lib_wacs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -31,9 +31,8 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: lib_wacs.c,v 1.7 2006/12/17 15:16:17 tom Exp $") +MODULE_ID("$Id: lib_wacs.c,v 1.10 2010/12/19 01:43:19 tom Exp $") NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; @@ -42,7 +41,7 @@ _nc_init_wacs(void) { /* *INDENT-OFF* */ static const struct { - int map; + unsigned map; int value[2]; } table[] = { /* VT100 symbols */ @@ -80,6 +79,30 @@ _nc_init_wacs(void) { '{', { '*', 0x03c0 }}, /* greek pi */ { '|', { '!', 0x2260 }}, /* not-equal */ { '}', { 'f', 0x00a3 }}, /* pound-sterling symbol */ + /* thick-line-drawing */ + { 'L', { '+', 0x250f }}, /* upper left corner */ + { 'M', { '+', 0x2517 }}, /* lower left corner */ + { 'K', { '+', 0x2513 }}, /* upper right corner */ + { 'J', { '+', 0x251b }}, /* lower right corner */ + { 'T', { '+', 0x2523 }}, /* tee pointing left */ + { 'U', { '+', 0x252b }}, /* tee pointing right */ + { 'V', { '+', 0x253b }}, /* tee pointing up */ + { 'W', { '+', 0x2533 }}, /* tee pointing down */ + { 'Q', { '-', 0x2501 }}, /* horizontal line */ + { 'X', { '|', 0x2503 }}, /* vertical line */ + { 'N', { '+', 0x254b }}, /* large plus or crossover */ + /* double-line-drawing */ + { 'C', { '+', 0x2554 }}, /* upper left corner */ + { 'D', { '+', 0x255a }}, /* lower left corner */ + { 'B', { '+', 0x2557 }}, /* upper right corner */ + { 'A', { '+', 0x255d }}, /* lower right corner */ + { 'G', { '+', 0x2563 }}, /* tee pointing left */ + { 'F', { '+', 0x2560 }}, /* tee pointing right */ + { 'H', { '+', 0x2569 }}, /* tee pointing up */ + { 'I', { '+', 0x2566 }}, /* tee pointing down */ + { 'R', { '-', 0x2550 }}, /* horizontal line */ + { 'Y', { '|', 0x2551 }}, /* vertical line */ + { 'E', { '+', 0x256c }}, /* large plus or crossover */ }; /* *INDENT-ON* */ diff --git a/ncurses/widechar/lib_wunctrl.c b/ncurses/widechar/lib_wunctrl.c index be2259acdcf..50958e44c7b 100644 --- a/ncurses/widechar/lib_wunctrl.c +++ b/ncurses/widechar/lib_wunctrl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,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 * @@ -35,21 +35,31 @@ #include -MODULE_ID("$Id: lib_wunctrl.c,v 1.12 2007/06/12 20:22:32 tom Exp $") +MODULE_ID("$Id: lib_wunctrl.c,v 1.14 2010/12/19 01:42:15 tom Exp $") NCURSES_EXPORT(wchar_t *) -wunctrl(cchar_t *wc) +NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc) { - static wchar_t str[CCHARW_MAX + 1], *sp; + static wchar_t str[CCHARW_MAX + 1], *wsp; if (Charable(*wc)) { - const char *p = unctrl((unsigned) _nc_to_char((wint_t) CharOf(*wc))); + const char *p = + NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx + (unsigned) _nc_to_char((wint_t)CharOf(*wc))); - for (sp = str; *p; ++p) { - *sp++ = _nc_to_widechar(*p); + for (wsp = str; *p; ++p) { + *wsp++ = (wchar_t) _nc_to_widechar(*p); } - *sp = 0; + *wsp = 0; return str; } else return wc->chars; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(wchar_t *) +wunctrl(cchar_t *wc) +{ + return NCURSES_SP_NAME(wunctrl) (CURRENT_SCREEN, wc); +} +#endif diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c new file mode 100644 index 00000000000..e1ef3401de3 --- /dev/null +++ b/ncurses/win32con/gettimeofday.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * Copyright (c) 2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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. * + ****************************************************************************/ + +#define WINVER 0x0501 + +#include + +#include + +MODULE_ID("$Id: gettimeofday.c,v 1.2 2010/01/16 15:18:51 tom Exp $") + +#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ + +int +gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) +{ + union { + FILETIME ft; + long long since1601; /* time since 1 Jan 1601 in 100ns units */ + } data; + + GetSystemTimeAsFileTime(&data.ft); + tv->tv_usec = (long) ((data.since1601 / 10LL) % 1000000LL); + tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL); + return (0); +} diff --git a/ncurses/win32con/wcwidth.c b/ncurses/win32con/wcwidth.c new file mode 100644 index 00000000000..cdef64a23c0 --- /dev/null +++ b/ncurses/win32con/wcwidth.c @@ -0,0 +1,50 @@ +/**************************************************************************** + * Copyright (c) 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"), 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. * + ****************************************************************************/ +#include + +MODULE_ID("$Id: wcwidth.c,v 1.2 2010/08/07 20:52:43 tom Exp $") + +#if USE_WIDEC_SUPPORT +#define mk_wcwidth(ucs) _nc_wcwidth(ucs) +#define mk_wcswidth(pwcs, n) _nc_wcswidth(pwcs, n) +#define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) +#define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) + +extern int mk_wcwidth(wchar_t); +extern int mk_wcswidth(const wchar_t *, size_t); +extern int mk_wcwidth_cjk(wchar_t); +extern int mk_wcswidth_cjk(const wchar_t *, size_t); + +#include +#else +void _nc_empty_wcwidth(void); +void +_nc_empty_wcwidth(void) +{ +} +#endif diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c new file mode 100644 index 00000000000..c214639cd4d --- /dev/null +++ b/ncurses/win32con/win_driver.c @@ -0,0 +1,1241 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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: Juergen Pfeifer * + * * + ****************************************************************************/ + +/* + * TODO - GetMousePos(POINT * result) from ntconio.c + * TODO - implement nodelay + */ + +#include +#define CUR my_term.type. + +MODULE_ID("$Id: win_driver.c,v 1.10 2010/12/25 19:28:21 tom Exp $") + +#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) + +#define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC) +#define SetSP() assert(TCB->csp!=0); sp = TCB->csp + +#define GenMap(vKey,key) MAKELONG(key, vKey) + +static const LONG keylist[] = +{ + GenMap(VK_PRIOR, KEY_PPAGE), + GenMap(VK_NEXT, KEY_NPAGE), + GenMap(VK_END, KEY_END), + GenMap(VK_HOME, KEY_HOME), + GenMap(VK_LEFT, KEY_LEFT), + GenMap(VK_UP, KEY_UP), + GenMap(VK_RIGHT, KEY_RIGHT), + GenMap(VK_DOWN, KEY_DOWN), + GenMap(VK_DELETE, KEY_DC), + GenMap(VK_INSERT, KEY_IC) +}; +#define N_INI ((int)(sizeof(keylist)/sizeof(keylist[0]))) +#define FKEYS 24 +#define MAPSIZE (FKEYS + N_INI) +#define NUMPAIRS 64 + +typedef struct props { + CONSOLE_SCREEN_BUFFER_INFO SBI; + bool progMode; + DWORD map[MAPSIZE]; + DWORD rmap[MAPSIZE]; + WORD pairs[NUMPAIRS]; +} Properties; + +#define PropOf(TCB) ((Properties*)TCB->prop) + +int +_nc_mingw_ioctl(int fd GCC_UNUSED, + long int request GCC_UNUSED, + struct termios *arg GCC_UNUSED) +{ + return 0; + endwin(); + fprintf(stderr, "TERMINFO currently not supported on Windows.\n"); + exit(1); +} + +static WORD +MapColor(bool fore, int color) +{ + static const int _cmap[] = + {0, 4, 2, 6, 1, 5, 3, 7}; + int a; + if (color < 0 || color > 7) + a = fore ? 7 : 0; + else + a = _cmap[color]; + if (!fore) + a = a << 4; + return (WORD) a; +} + +static WORD +MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, chtype ch) +{ + if (ch & A_COLOR) { + int p; + SCREEN *sp; + + AssertTCB(); + SetSP(); + p = PairNumber(ch); + if (p > 0 && p < NUMPAIRS && TCB != 0 && sp != 0) { + WORD a; + a = PropOf(TCB)->pairs[p]; + res = (res & 0xff00) | a; + } + } + + if (ch & A_REVERSE) + res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4))); + + if (ch & A_STANDOUT) + res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4)) + | BACKGROUND_INTENSITY); + + if (ch & A_BOLD) + res |= FOREGROUND_INTENSITY; + + if (ch & A_DIM) + res |= BACKGROUND_INTENSITY; + + return res; +} + +static BOOL +con_write(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) +{ + CHAR_INFO ci[n]; + COORD loc, siz; + SMALL_RECT rec; + int i; + chtype ch; + SCREEN *sp; + + AssertTCB(); + + if (TCB == 0 || InvalidConsoleHandle(TCB->hdl)) + return FALSE; + + SetSP(); + + for (i = 0; i < n; i++) { + ch = str[i]; + ci[i].Char.AsciiChar = ChCharOf(ch); + ci[i].Attributes = MapAttr(TCB, + PropOf(TCB)->SBI.wAttributes, + ChAttrOf(ch)); + if (ChAttrOf(ch) & A_ALTCHARSET) { + if (sp->_acs_map) + ci[i].Char.AsciiChar = + ChCharOf(NCURSES_SP_NAME(_nc_acs_char) (sp, ChCharOf(ch))); + } + } + + loc.X = (short) 0; + loc.Y = (short) 0; + siz.X = (short) n; + siz.Y = 1; + + rec.Left = (short) x; + rec.Top = (short) y; + rec.Right = (short) (x + n - 1); + rec.Bottom = rec.Top; + + return WriteConsoleOutput(TCB->hdl, ci, siz, loc, &rec); +} + +#define MARK_NOCHANGE(win,row) \ + win->_line[row].firstchar = _NOCHANGE; \ + win->_line[row].lastchar = _NOCHANGE + +static int +drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + int y, nonempty, n, x0, x1, Width, Height; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + Width = screen_columns(sp); + Height = screen_lines(sp); + nonempty = min(Height, NewScreen(sp)->_maxy + 1); + + if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { + int x; + chtype empty[Width]; + + for (x = 0; x < Width; x++) + empty[x] = ' '; + + for (y = 0; y < nonempty; y++) { + con_write(TCB, y, 0, empty, Width); + memcpy(empty, + CurScreen(sp)->_line[y].text, + Width * sizeof(chtype)); + } + CurScreen(sp)->_clear = FALSE; + NewScreen(sp)->_clear = FALSE; + touchwin(NewScreen(sp)); + } + + for (y = 0; y < nonempty; y++) { + x0 = NewScreen(sp)->_line[y].firstchar; + if (x0 != _NOCHANGE) { + x1 = NewScreen(sp)->_line[y].lastchar; + n = x1 - x0 + 1; + if (n > 0) { + memcpy(CurScreen(sp)->_line[y].text + x0, + NewScreen(sp)->_line[y].text + x0, + n * sizeof(chtype)); + con_write(TCB, + y, + x0, + ((chtype *) CurScreen(sp)->_line[y].text) + x0, n); + + /* mark line changed successfully */ + if (y <= NewScreen(sp)->_maxy) { + MARK_NOCHANGE(NewScreen(sp), y); + } + if (y <= CurScreen(sp)->_maxy) { + MARK_NOCHANGE(CurScreen(sp), y); + } + } + } + } + + /* put everything back in sync */ + for (y = nonempty; y <= NewScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(NewScreen(sp), y); + } + for (y = nonempty; y <= CurScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(CurScreen(sp), y); + } + + if (!NewScreen(sp)->_leaveok) { + CurScreen(sp)->_curx = NewScreen(sp)->_curx; + CurScreen(sp)->_cury = NewScreen(sp)->_cury; + + TCB->drv->hwcur(TCB, 0, 0, CurScreen(sp)->_cury, CurScreen(sp)->_curx); + } + SetConsoleActiveScreenBuffer(TCB->hdl); + return OK; +} + +static bool +drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, + const char *tname, + int *errret GCC_UNUSED) +{ + bool code = FALSE; + + T((T_CALLED("win32con::drv_CanHandle(%p)"), TCB)); + + assert(TCB != 0); + assert(tname != 0); + + TCB->magic = WINMAGIC; + if (*tname == 0 || *tname == 0) { + code = TRUE; + } else { + TERMINAL my_term; + int status; + + code = FALSE; +#if (USE_DATABASE || USE_TERMCAP) + status = _nc_setup_tinfo(tname, &my_term.type); +#else + status = TGETENT_NO; +#endif + if (status != TGETENT_YES) { + const TERMTYPE *fallback = _nc_fallback(tname); + + if (fallback) { + my_term.type = *fallback; + status = TGETENT_YES; + } else if (!strcmp(tname, "unknown")) { + code = TRUE; + } + } + if (status == TGETENT_YES) { + if (generic_type || hard_copy) + code = TRUE; + } + } + + if (code) { + if ((TCB->term.type.Booleans) == 0) { + _nc_init_entry(&(TCB->term.type)); + } + } + + returnBool(code); +} + +static int +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, + bool beepFlag GCC_UNUSED) +{ + SCREEN *sp; + int res = ERR; + + AssertTCB(); + SetSP(); + + return res; +} + +static int +drv_print(TERMINAL_CONTROL_BLOCK * TCB, + char *data GCC_UNUSED, + int len GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return ERR; +} + +static int +drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, + int fg GCC_UNUSED, + int bg GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + return (code); +} + +static void +drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + bool fore, + int color, + int (*outc) (SCREEN *, int) GCC_UNUSED) +{ + AssertTCB(); + + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + WORD a = MapColor(fore, color); + a = ((PropOf(TCB)->SBI.wAttributes) & (fore ? 0xfff8 : 0xff8f)) | a; + SetConsoleTextAttribute(TCB->hdl, a); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + } +} + +static bool +drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool res = FALSE; + + AssertTCB(); + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + WORD a = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; + SetConsoleTextAttribute(TCB->hdl, a); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + res = TRUE; + } + return res; +} + +static bool +drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return result; +} + +static int +drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *Lines, int *Cols) +{ + AssertTCB(); + + if (TCB == NULL || Lines == NULL || Cols == NULL || InvalidConsoleHandle(TCB->hdl)) + return ERR; + + *Lines = (int) (PropOf(TCB)->SBI.dwSize.Y); + *Cols = (int) (PropOf(TCB)->SBI.dwSize.X); + return OK; +} + +static int +drv_setsize(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, + int l GCC_UNUSED, + int c GCC_UNUSED) +{ + AssertTCB(); + return ERR; +} + +static int +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +{ + DWORD dwFlag = 0; + tcflag_t iflag; + tcflag_t lflag; + + AssertTCB(); + + if (TCB == 0 || buf == NULL) + return ERR; + + if (setFlag) { + iflag = buf->c_iflag; + lflag = buf->c_lflag; + + GetConsoleMode(TCB->inp, &dwFlag); + + if (lflag & ICANON) + dwFlag |= ENABLE_LINE_INPUT; + else + dwFlag &= ~ENABLE_LINE_INPUT; + + if (lflag & ECHO) + dwFlag |= ENABLE_ECHO_INPUT; + else + dwFlag &= ~ENABLE_ECHO_INPUT; + + if (iflag & BRKINT) + dwFlag |= ENABLE_PROCESSED_INPUT; + else + dwFlag &= ~ENABLE_PROCESSED_INPUT; + + dwFlag |= ENABLE_MOUSE_INPUT; + + buf->c_iflag = iflag; + buf->c_lflag = lflag; + SetConsoleMode(TCB->inp, dwFlag); + TCB->term.Nttyb = *buf; + } else { + iflag = TCB->term.Nttyb.c_iflag; + lflag = TCB->term.Nttyb.c_lflag; + GetConsoleMode(TCB->inp, &dwFlag); + + if (dwFlag & ENABLE_LINE_INPUT) + lflag |= ICANON; + else + lflag &= ~ICANON; + + if (dwFlag & ENABLE_ECHO_INPUT) + lflag |= ECHO; + else + lflag &= ~ECHO; + + if (dwFlag & ENABLE_PROCESSED_INPUT) + iflag |= BRKINT; + else + iflag &= ~BRKINT; + + TCB->term.Nttyb.c_iflag = iflag; + TCB->term.Nttyb.c_lflag = lflag; + + *buf = TCB->term.Nttyb; + } + return OK; +} + +static int +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + PropOf(TCB)->progMode = progFlag; + SetConsoleActiveScreenBuffer(progFlag ? TCB->hdl : TCB->out); + + if (progFlag) /* prog mode */ { + if (defFlag) { + if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { + _term->Nttyb.c_oflag &= ~OFLAGS_TABS; + code = OK; + } + } else { + /* reset_prog_mode */ + if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + NC_BUFFERED(sp, TRUE); + } + code = OK; + } + } + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + NC_BUFFERED(sp, FALSE); + } + code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + } + } + + return (code); +} + +static void +drv_screen_init(SCREEN *sp GCC_UNUSED) +{ +} + +static void +drv_wrap(SCREEN *sp GCC_UNUSED) +{ +} + +static int +rkeycompare(const void *el1, const void *el2) +{ + WORD key1 = (LOWORD((*((const LONG *) el1)))) & 0x7fff; + WORD key2 = (LOWORD((*((const LONG *) el2)))) & 0x7fff; + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +keycompare(const void *el1, const void *el2) +{ + WORD key1 = HIWORD((*((const LONG *) el1))); + WORD key2 = HIWORD((*((const LONG *) el2))); + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +MapKey(TERMINAL_CONTROL_BLOCK * TCB, WORD vKey) +{ + WORD nKey = 0; + void *res; + LONG key = GenMap(vKey, 0); + int code = -1; + + AssertTCB(); + + res = bsearch(&key, + PropOf(TCB)->map, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + keycompare); + if (res) { + key = *((LONG *) res); + nKey = LOWORD(key); + code = (int) (nKey & 0x7fff); + if (nKey & 0x8000) + code = -code; + } + return code; +} + +static void +drv_release(TERMINAL_CONTROL_BLOCK * TCB) +{ + T((T_CALLED("win32con::drv_release(%p)"), TCB)); + + AssertTCB(); + if (TCB->prop) + free(TCB->prop); + + returnVoid; +} + +static void +drv_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + DWORD num_buttons; + + T((T_CALLED("win32con::drv_init(%p)"), TCB)); + + AssertTCB(); + + if (TCB) { + BOOL b = AllocConsole(); + WORD a; + int i; + + if (!b) + b = AttachConsole(ATTACH_PARENT_PROCESS); + + TCB->inp = GetStdHandle(STD_INPUT_HANDLE); + TCB->out = GetStdHandle(STD_OUTPUT_HANDLE); + + if (getenv("NCGDB")) + TCB->hdl = TCB->out; + else + TCB->hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + CONSOLE_TEXTMODE_BUFFER, + NULL); + + if (!InvalidConsoleHandle(TCB->hdl)) { + TCB->prop = typeCalloc(Properties, 1); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + } + + TCB->info.initcolor = TRUE; + TCB->info.canchange = FALSE; + TCB->info.hascolor = TRUE; + TCB->info.caninit = TRUE; + + TCB->info.maxpairs = NUMPAIRS; + TCB->info.maxcolors = 8; + TCB->info.numlabels = 0; + TCB->info.labelwidth = 0; + TCB->info.labelheight = 0; + TCB->info.nocolorvideo = 1; + TCB->info.tabsize = 8; + + if (GetNumberOfConsoleMouseButtons(&num_buttons)) { + T(("mouse has %ld buttons", num_buttons)); + TCB->info.numbuttons = num_buttons; + } else { + TCB->info.numbuttons = 1; + } + + TCB->info.defaultPalette = _nc_cga_palette; + + for (i = 0; i < (N_INI + FKEYS); i++) { + if (i < N_INI) + PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = keylist[i]; + else + PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = + GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI))); + } + qsort(PropOf(TCB)->map, + (size_t) (MAPSIZE), + sizeof(keylist[0]), + keycompare); + qsort(PropOf(TCB)->rmap, + (size_t) (MAPSIZE), + sizeof(keylist[0]), + rkeycompare); + + a = MapColor(true, COLOR_WHITE) | MapColor(false, COLOR_BLACK); + for (i = 0; i < NUMPAIRS; i++) + PropOf(TCB)->pairs[i] = a; + } + returnVoid; +} + +static void +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, + short pair, + short f, + short b) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if ((pair > 0) && (pair < NUMPAIRS) && (f >= 0) && (f < 8) + && (b >= 0) && (b < 8)) { + PropOf(TCB)->pairs[pair] = MapColor(true, f) | MapColor(false, b); + } +} + +static void +drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + short color GCC_UNUSED, + short r GCC_UNUSED, + short g GCC_UNUSED, + short b GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, + short old_pair GCC_UNUSED, + short pair GCC_UNUSED, + bool reverse GCC_UNUSED, + int (*outc) (SCREEN *, int) GCC_UNUSED +) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + sp->_mouse_type = M_TERM_DRIVER; +} + +static int +drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) +{ + int rc = 0; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (sp->_drv_mouse_head < sp->_drv_mouse_tail) { + rc = TW_MOUSE; + } else { + rc = TCBOf(sp)->drv->twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); + } + + return rc; +} + +static int +drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, + int yold GCC_UNUSED, int xold GCC_UNUSED, + int y, int x) +{ + int ret = ERR; + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + COORD loc; + loc.X = (short) x; + loc.Y = (short) y; + SetConsoleCursorPosition(TCB->hdl, loc); + ret = OK; + } + return ret; +} + +static void +drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, + int labnum GCC_UNUSED, + char *text GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, + bool OnFlag GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static chtype +drv_conattr(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ + chtype res = A_NORMAL; + res |= (A_BOLD | A_DIM | A_REVERSE | A_STANDOUT | A_COLOR); + return res; +} + +static void +drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, + chtype *real_map GCC_UNUSED, + chtype *fake_map GCC_UNUSED) +{ +#define DATA(a,b) { a, b } + static struct { + int acs_code; + int use_code; + } table[] = { + DATA('a', 0xb1), /* ACS_CKBOARD */ + DATA('f', 0xf8), /* ACS_DEGREE */ + DATA('g', 0xf1), /* ACS_PLMINUS */ + DATA('j', 0xd9), /* ACS_LRCORNER */ + DATA('l', 0xda), /* ACS_ULCORNER */ + DATA('k', 0xbf), /* ACS_URCORNER */ + DATA('m', 0xc0), /* ACS_LLCORNER */ + DATA('n', 0xc5), /* ACS_PLUS */ + DATA('q', 0xc4), /* ACS_HLINE */ + DATA('t', 0xc3), /* ACS_LTEE */ + DATA('u', 0xb4), /* ACS_RTEE */ + DATA('v', 0xc1), /* ACS_BTEE */ + DATA('w', 0xc2), /* ACS_TTEE */ + DATA('x', 0xb3), /* ACS_VLINE */ + DATA('y', 0xf3), /* ACS_LEQUAL */ + DATA('z', 0xf2), /* ACS_GEQUAL */ + DATA('0', 0xdb), /* ACS_BLOCK */ + DATA('{', 0xe3), /* ACS_PI */ + DATA('}', 0x9c), /* ACS_STERLING */ + DATA(',', 0xae), /* ACS_LARROW */ + DATA('+', 0xaf), /* ACS_RARROW */ + DATA('~', 0xf9), /* ACS_BULLET */ + }; +#undef DATA + unsigned n; + + SCREEN *sp; + AssertTCB(); + SetSP(); + + for (n = 0; n < SIZEOF(table); ++n) { + real_map[table[n].acs_code] = table[n].use_code | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[table[n].acs_code] = TRUE; + } +} + +static ULONGLONG +tdiff(FILETIME fstart, FILETIME fend) +{ + ULARGE_INTEGER ustart; + ULARGE_INTEGER uend; + ULONGLONG diff; + + ustart.LowPart = fstart.dwLowDateTime; + ustart.HighPart = fstart.dwHighDateTime; + uend.LowPart = fend.dwLowDateTime; + uend.HighPart = fend.dwHighDateTime; + + diff = (uend.QuadPart - ustart.QuadPart) / 10000; + return diff; +} + +static int +Adjust(int milliseconds, int diff) +{ + if (milliseconds == INFINITY) + return milliseconds; + milliseconds -= diff; + if (milliseconds < 0) + milliseconds = 0; + return milliseconds; +} + +#define BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | \ + FROM_LEFT_2ND_BUTTON_PRESSED | \ + FROM_LEFT_3RD_BUTTON_PRESSED | \ + FROM_LEFT_4TH_BUTTON_PRESSED | \ + RIGHTMOST_BUTTON_PRESSED) + +static int +decode_mouse(TERMINAL_CONTROL_BLOCK * TCB, int mask) +{ + SCREEN *sp; + int result = 0; + + AssertTCB(); + SetSP(); + + if (mask & FROM_LEFT_1ST_BUTTON_PRESSED) + result |= BUTTON1_PRESSED; + if (mask & FROM_LEFT_2ND_BUTTON_PRESSED) + result |= BUTTON2_PRESSED; + if (mask & FROM_LEFT_3RD_BUTTON_PRESSED) + result |= BUTTON3_PRESSED; + if (mask & FROM_LEFT_4TH_BUTTON_PRESSED) + result |= BUTTON4_PRESSED; + + if (mask & RIGHTMOST_BUTTON_PRESSED) { + switch (TCB->info.numbuttons) { + case 1: + result |= BUTTON1_PRESSED; + break; + case 2: + result |= BUTTON2_PRESSED; + break; + case 3: + result |= BUTTON3_PRESSED; + break; + case 4: + result |= BUTTON4_PRESSED; + break; + } + } + + return result; +} + +static int +drv_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead = 0, rc = -1; + int code = 0; + FILETIME fstart; + FILETIME fend; + int diff; + bool isImmed = (milliseconds == 0); + +#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead) + + AssertTCB(); + SetSP(); + + TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d", + milliseconds, mode)); + + if (milliseconds < 0) + milliseconds = INFINITY; + + memset(&inp_rec, 0, sizeof(inp_rec)); + + while (true) { + GetSystemTimeAsFileTime(&fstart); + rc = WaitForSingleObject(TCB->inp, milliseconds); + GetSystemTimeAsFileTime(&fend); + diff = (int) tdiff(fstart, fend); + milliseconds = Adjust(milliseconds, diff); + + if (!isImmed && milliseconds == 0) + break; + + if (rc == WAIT_OBJECT_0) { + if (mode) { + b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead); + if (b && nRead > 0) { + b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead); + if (b && nRead > 0) { + switch (inp_rec.EventType) { + case KEY_EVENT: + if (mode & TW_INPUT) { + WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar; + + if (inp_rec.Event.KeyEvent.bKeyDown) { + if (0 == ch) { + int nKey = MapKey(TCB, vk); + if ((nKey < 0) || FALSE == sp->_keypad_on) { + CONSUME(); + continue; + } + } + code = TW_INPUT; + goto end; + } else { + CONSUME(); + } + } + continue; + case MOUSE_EVENT: + if (decode_mouse(TCB, + (inp_rec.Event.MouseEvent.dwButtonState + & BUTTON_MASK)) == 0) { + CONSUME(); + } else if (mode & TW_MOUSE) { + code = TW_MOUSE; + goto end; + } + continue; + default: + SetConsoleActiveScreenBuffer(!PropOf(TCB)->progMode ? + TCB->hdl : TCB->out); + continue; + } + } + } + } + continue; + } else { + if (rc != WAIT_TIMEOUT) { + code = -1; + break; + } else { + code = 0; + break; + } + } + } + end: + + TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec", + code, errno, milliseconds)); + + if (timeleft) + *timeleft = milliseconds; + + return code; +} + +static bool +handle_mouse(TERMINAL_CONTROL_BLOCK * TCB, MOUSE_EVENT_RECORD mer) +{ + SCREEN *sp; + MEVENT work; + bool result = FALSE; + + AssertTCB(); + SetSP(); + + sp->_drv_mouse_old_buttons = sp->_drv_mouse_new_buttons; + sp->_drv_mouse_new_buttons = mer.dwButtonState & BUTTON_MASK; + + /* + * We're only interested if the button is pressed or released. + * FIXME: implement continuous event-tracking. + */ + if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) { + + memset(&work, 0, sizeof(work)); + + if (sp->_drv_mouse_new_buttons) { + + work.bstate |= decode_mouse(TCB, sp->_drv_mouse_new_buttons); + + } else { + + /* cf: BUTTON_PRESSED, BUTTON_RELEASED */ + work.bstate |= (decode_mouse(TCB, sp->_drv_mouse_old_buttons) >> 1); + + result = TRUE; + } + + work.x = mer.dwMousePosition.X; + work.y = mer.dwMousePosition.Y; + + sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work; + sp->_drv_mouse_tail += 1; + } + + return result; +} + +static int +drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + int n = 1; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead; + WORD vk; + WORD sc; + + AssertTCB(); + assert(buf); + SetSP(); + + memset(&inp_rec, 0, sizeof(inp_rec)); + + T((T_CALLED("win32con::drv_read(%p)"), TCB)); + while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) { + if (b && nRead > 0) { + if (inp_rec.EventType == KEY_EVENT) { + if (!inp_rec.Event.KeyEvent.bKeyDown) + continue; + *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar; + vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + sc = inp_rec.Event.KeyEvent.wVirtualScanCode; + if (*buf == 0) { + if (sp->_keypad_on) { + *buf = MapKey(TCB, vk); + if (0 > (*buf)) + continue; + else + break; + } else + continue; + } else { /* *buf != 0 */ + break; + } + } else if (inp_rec.EventType == MOUSE_EVENT) { + if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) { + *buf = KEY_MOUSE; + break; + } + } + continue; + } + } + returnCode(n); +} + +static int +drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ + Sleep(ms); + return OK; +} + +static bool +drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int keycode) +{ + SCREEN *sp; + WORD nKey; + void *res; + bool found = FALSE; + LONG key = GenMap(0, (WORD) keycode); + + AssertTCB(); + SetSP(); + + AssertTCB(); + + res = bsearch(&key, + PropOf(TCB)->rmap, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + rkeycompare); + if (res) { + key = *((LONG *) res); + nKey = LOWORD(key); + if (!(nKey & 0x8000)) + found = TRUE; + } + return found; +} + +static int +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + if (sp) { + code = OK; + } + return code; +} + +static int +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, bool flag) +{ + int code = ERR; + SCREEN *sp; + WORD nKey; + WORD vKey; + void *res; + LONG key = GenMap(0, (WORD) keycode); + + AssertTCB(); + SetSP(); + + if (sp) { + res = bsearch(&key, + PropOf(TCB)->rmap, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + rkeycompare); + if (res) { + key = *((LONG *) res); + vKey = HIWORD(key); + nKey = (LOWORD(key)) & 0x7fff; + if (!flag) + nKey |= 0x8000; + *(LONG *) res = GenMap(vKey, nKey); + } + } + return code; +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_WIN_DRIVER = { + FALSE, + drv_CanHandle, /* CanHandle */ + drv_init, /* init */ + drv_release, /* release */ + drv_size, /* size */ + drv_sgmode, /* sgmode */ + drv_conattr, /* conattr */ + drv_mvcur, /* hwcur */ + drv_mode, /* mode */ + drv_rescol, /* rescol */ + drv_rescolors, /* rescolors */ + drv_setcolor, /* color */ + drv_dobeepflash, /* DoBeepFlash */ + drv_initpair, /* initpair */ + drv_initcolor, /* initcolor */ + drv_do_color, /* docolor */ + drv_initmouse, /* initmouse */ + drv_testmouse, /* testmouse */ + drv_setfilter, /* setfilter */ + drv_hwlabel, /* hwlabel */ + drv_hwlabelOnOff, /* hwlabelOnOff */ + drv_doupdate, /* update */ + drv_defaultcolors, /* defaultcolors */ + drv_print, /* print */ + drv_size, /* getsize */ + drv_setsize, /* setsize */ + drv_initacs, /* initacs */ + drv_screen_init, /* scinit */ + drv_wrap, /* scexit */ + drv_twait, /* twait */ + drv_read, /* read */ + drv_nap, /* nap */ + drv_kpad, /* kpad */ + drv_keyok, /* kyOk */ + drv_kyExist /* kyExist */ +}; diff --git a/panel/Makefile.in b/panel/Makefile.in index 89dbeeac900..f0f0a4922bd 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $ +# $Id: Makefile.in,v 1.58 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ @@ -64,6 +65,7 @@ LIBTOOL_COMPILE = @LIB_COMPILE@ LIBTOOL_LINK = @LIB_LINK@ LIBTOOL_INSTALL = @LIB_INSTALL@ LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ +LT_UNDEF = @LT_UNDEF@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ @@ -71,11 +73,14 @@ INSTALL_PROG = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ -AR_OPTS = @AR_OPTS@ +ARFLAGS = @ARFLAGS@ AWK = @AWK@ LD = @LD@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -125,7 +130,7 @@ sources: $(AUTO_SRC) $(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - sh $(srcdir)/../mkdirs.sh $@ + mkdir -p $@ # make a copy to simplify include-paths while still keeping panel's include # file in this directory. @@ -133,15 +138,15 @@ $(DESTDIR)$(libdir) : -rm -f $@ cp $(srcdir)/panel.h $@ -PANEL_PRIV_H = \ +HEADER_DEPS = \ $(srcdir)/panel.priv.h \ $(srcdir)/panel.h tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace diff --git a/panel/llib-lpanel b/panel/llib-lpanel index de49c234eca..85371ec73e0 100644 --- a/panel/llib-lpanel +++ b/panel/llib-lpanel @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997,2002,2005 * + * Author: Thomas E. Dickey 1997,2005,2010 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include "panel.priv.h" +#include #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,6 +77,11 @@ void _nc_Touchline( /* ./p_above.c */ +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -84,6 +89,11 @@ PANEL *panel_above( /* ./p_below.c */ +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -157,6 +167,11 @@ int top_panel( /* ./p_update.c */ +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + #undef update_panels void update_panels(void) { /* void */ } diff --git a/panel/llib-lpanelt b/panel/llib-lpanelt new file mode 100644 index 00000000000..8fcd42c9b6d --- /dev/null +++ b/panel/llib-lpanelt @@ -0,0 +1,197 @@ +/**************************************************************************** + * Copyright (c) 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"), 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 2010 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include + +#undef _nc_retrace_panel +PANEL *_nc_retrace_panel( + PANEL *pan) + { return(*(PANEL **)0); } + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/panel/llib-lpaneltw b/panel/llib-lpaneltw new file mode 100644 index 00000000000..1d3cd8d84c8 --- /dev/null +++ b/panel/llib-lpaneltw @@ -0,0 +1,197 @@ +/**************************************************************************** + * Copyright (c) 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"), 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 2010 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include + +#undef _nc_retrace_panel +PANEL *_nc_retrace_panel( + PANEL *pan) + { return(*(PANEL **)0); } + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/panel/llib-lpanelw b/panel/llib-lpanelw index 48bd1e0db5a..503b34345ba 100644 --- a/panel/llib-lpanelw +++ b/panel/llib-lpanelw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 2002-2005,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 * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2002,2005 * + * Author: Thomas E. Dickey 2002-2005,2010 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include "panel.priv.h" +#include #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,6 +77,11 @@ void _nc_Touchline( /* ./p_above.c */ +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -84,6 +89,11 @@ PANEL *panel_above( /* ./p_below.c */ +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -157,6 +167,11 @@ int top_panel( /* ./p_update.c */ +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + #undef update_panels void update_panels(void) { /* void */ } diff --git a/panel/modules b/panel/modules index d0f7a796678..cd3f545630f 100644 --- a/panel/modules +++ b/panel/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.9 2006/12/24 00:53:17 tom Exp $ +# $Id: modules,v 1.10 2010/01/23 16:31:16 tom Exp $ ############################################################################## -# Copyright (c) 1998,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-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"), # @@ -32,20 +32,20 @@ @ base # Library objects -panel lib $(srcdir) $(PANEL_PRIV_H) -p_above lib $(srcdir) $(PANEL_PRIV_H) -p_below lib $(srcdir) $(PANEL_PRIV_H) -p_bottom lib $(srcdir) $(PANEL_PRIV_H) -p_delete lib $(srcdir) $(PANEL_PRIV_H) -p_hide lib $(srcdir) $(PANEL_PRIV_H) -p_hidden lib $(srcdir) $(PANEL_PRIV_H) -p_move lib $(srcdir) $(PANEL_PRIV_H) -p_new lib $(srcdir) $(PANEL_PRIV_H) -p_replace lib $(srcdir) $(PANEL_PRIV_H) -p_show lib $(srcdir) $(PANEL_PRIV_H) -p_top lib $(srcdir) $(PANEL_PRIV_H) -p_update lib $(srcdir) $(PANEL_PRIV_H) -p_user lib $(srcdir) $(PANEL_PRIV_H) -p_win lib $(srcdir) $(PANEL_PRIV_H) +panel lib $(srcdir) $(HEADER_DEPS) +p_above lib $(srcdir) $(HEADER_DEPS) +p_below lib $(srcdir) $(HEADER_DEPS) +p_bottom lib $(srcdir) $(HEADER_DEPS) +p_delete lib $(srcdir) $(HEADER_DEPS) +p_hide lib $(srcdir) $(HEADER_DEPS) +p_hidden lib $(srcdir) $(HEADER_DEPS) +p_move lib $(srcdir) $(HEADER_DEPS) +p_new lib $(srcdir) $(HEADER_DEPS) +p_replace lib $(srcdir) $(HEADER_DEPS) +p_show lib $(srcdir) $(HEADER_DEPS) +p_top lib $(srcdir) $(HEADER_DEPS) +p_update lib $(srcdir) $(HEADER_DEPS) +p_user lib $(srcdir) $(HEADER_DEPS) +p_win lib $(srcdir) $(HEADER_DEPS) # vile:makemode diff --git a/panel/p_above.c b/panel/p_above.c index 32495f627f2..8bbf1bc21ce 100644 --- a/panel/p_above.c +++ b/panel/p_above.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,24 +29,56 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_above.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $") +MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $") + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(PANEL *) +ground_panel(SCREEN * sp) +{ + T((T_CALLED("ground_panel(%p)"), sp)); + if (sp) + { + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + + if (_nc_bottom_panel) /* this is the pseudo panel */ + returnPanel(_nc_bottom_panel->above); + else + returnPanel(0); + } + else + { + if (0 == CURRENT_SCREEN) + returnPanel(0); + else + returnPanel(ground_panel(CURRENT_SCREEN)); + } +} +#endif NCURSES_EXPORT(PANEL *) panel_above(const PANEL * pan) { - T((T_CALLED("panel_above(%p)"), pan)); - if (!pan) + PANEL *result; + + T((T_CALLED("panel_above(%p)"), (const void *)pan)); + if (pan) + result = pan->above; + else { +#if NCURSES_SP_FUNCS + result = ground_panel(CURRENT_SCREEN); +#else /* if top and bottom are equal, we have no or only the pseudo panel; if not, we return the panel above the pseudo panel */ - returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above); + result = EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above; +#endif } - else - returnPanel(pan->above); + returnPanel(result); } diff --git a/panel/p_below.c b/panel/p_below.c index c4b241015f5..f276ef959da 100644 --- a/panel/p_below.c +++ b/panel/p_below.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,26 +29,57 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_below.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $") +MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $") +#if NCURSES_SP_FUNCS NCURSES_EXPORT(PANEL *) -panel_below(const PANEL * pan) +ceiling_panel(SCREEN * sp) { - T((T_CALLED("panel_below(%p)"), pan)); - if (!pan) + T((T_CALLED("ceiling_panel(%p)"), sp)); + if (sp) { + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + /* if top and bottom are equal, we have no or only the pseudo panel */ returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel); } else { - /* we must not return the pseudo panel */ - returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below); + if (0 == CURRENT_SCREEN) + returnPanel(0); + else + returnPanel(ceiling_panel(CURRENT_SCREEN)); } } +#endif + +NCURSES_EXPORT(PANEL *) +panel_below(const PANEL * pan) +{ + PANEL *result; + + T((T_CALLED("panel_below(%p)"), (const void *)pan)); + if (pan) + { + GetHook(pan); + /* we must not return the pseudo panel */ + result = Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below; + } + else + { +#if NCURSES_SP_FUNCS + result = ceiling_panel(CURRENT_SCREEN); +#else + /* if top and bottom are equal, we have no or only the pseudo panel */ + result = EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel; +#endif + } + returnPanel(result); +} diff --git a/panel/p_bottom.c b/panel/p_bottom.c index b861fd9b2ce..db814415375 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_bottom.c @@ -36,16 +37,17 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.13 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) bottom_panel(PANEL * pan) { int err = OK; - T((T_CALLED("bottom_panel(%p)"), pan)); + T((T_CALLED("bottom_panel(%p)"), (void *)pan)); if (pan) { + GetHook(pan); if (!Is_Bottom(pan)) { diff --git a/panel/p_delete.c b/panel/p_delete.c index 24ee26b4ff2..39b055377c1 100644 --- a/panel/p_delete.c +++ b/panel/p_delete.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1999,2008 * ****************************************************************************/ /* p_delete.c @@ -36,19 +37,22 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $") +MODULE_ID("$Id: p_delete.c,v 1.10 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) del_panel(PANEL * pan) { int err = OK; - T((T_CALLED("del_panel(%p)"), pan)); + T((T_CALLED("del_panel(%p)"), (void *)pan)); if (pan) { dBug(("--> del_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); - free((void *)pan); + { + GetHook(pan); + HIDE_PANEL(pan, err, OK); + free((void *)pan); + } } else err = ERR; diff --git a/panel/p_hidden.c b/panel/p_hidden.c index 624c07dae0b..01b69b91d91 100644 --- a/panel/p_hidden.c +++ b/panel/p_hidden.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_hidden.c @@ -36,13 +37,18 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.9 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(int) panel_hidden(const PANEL * pan) { - T((T_CALLED("panel_hidden(%p)"), pan)); - if (!pan) - returnCode(ERR); - returnCode(IS_LINKED(pan) ? FALSE : TRUE); + int rc = ERR; + + T((T_CALLED("panel_hidden(%p)"), (const void *)pan)); + if (pan) + { + GetHook(pan); + rc = (IS_LINKED(pan) ? FALSE : TRUE); + } + returnCode(rc); } diff --git a/panel/p_hide.c b/panel/p_hide.c index 08d8853a201..7b780d464e1 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,23 +36,27 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $") +MODULE_ID("$Id: p_hide.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) hide_panel(register PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("hide_panel(%p)"), pan)); - if (!pan) - returnCode(ERR); + T((T_CALLED("hide_panel(%p)"), (void *)pan)); - dBug(("--> hide_panel %s", USER_PTR(pan->user))); - dStack("", 1, pan); + if (pan) + { + GetHook(pan); - HIDE_PANEL(pan, err, ERR); + dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dStack("", 1, pan); - dStack("", 9, pan); + HIDE_PANEL(pan, err, ERR); + err = OK; + + dStack("", 9, pan); + } returnCode(err); } diff --git a/panel/p_move.c b/panel/p_move.c index 3818e8cba86..adae6458322 100644 --- a/panel/p_move.c +++ b/panel/p_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2009 * ****************************************************************************/ /* p_move.c @@ -36,21 +37,24 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $") +MODULE_ID("$Id: p_move.c,v 1.11 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(int) move_panel(PANEL * pan, int starty, int startx) { - T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx)); + int rc = ERR; - if (!pan) - returnCode(ERR); + T((T_CALLED("move_panel(%p,%d,%d)"), (void *)pan, starty, startx)); - if (IS_LINKED(pan)) + if (pan) { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); + GetHook(pan); + if (IS_LINKED(pan)) + { + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); + } + rc = mvwin(pan->win, starty, startx); } - - returnCode(mvwin(pan->win, starty, startx)); + returnCode(rc); } diff --git a/panel/p_new.c b/panel/p_new.c index 2719316888e..235336c22f5 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -38,7 +38,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.10 2008/08/04 18:25:48 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.16 2010/01/23 21:22:16 tom Exp $") #ifdef TRACE static char *stdscr_id; @@ -50,20 +50,27 @@ static char *new_id; Establish the pseudo panel for stdscr if necessary. --------------------------------------------------------------------------*/ static PANEL * -root_panel(void) +root_panel(NCURSES_SP_DCL0) { +#if NCURSES_SP_FUNCS + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + +#elif NO_LEAKS + struct panelhook *ph = _nc_panelhook(); +#endif + if (_nc_stdscr_pseudo_panel == (PANEL *) 0) { - assert(stdscr && !_nc_bottom_panel && !_nc_top_panel); + assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel); #if NO_LEAKS - _nc_panelhook()->destroy = del_panel; + ph->destroy = del_panel; #endif - _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL)); + _nc_stdscr_pseudo_panel = typeMalloc(PANEL, 1); if (_nc_stdscr_pseudo_panel != 0) { PANEL *pan = _nc_stdscr_pseudo_panel; - WINDOW *win = stdscr; + WINDOW *win = SP_PARM->_stdscr; pan->win = win; pan->below = (PANEL *) 0; @@ -86,16 +93,18 @@ new_panel(WINDOW *win) { PANEL *pan = (PANEL *) 0; - T((T_CALLED("new_panel(%p)"), win)); + GetWindowHook(win); + + T((T_CALLED("new_panel(%p)"), (void *)win)); if (!win) returnPanel(pan); if (!_nc_stdscr_pseudo_panel) - (void)root_panel(); + (void)root_panel(NCURSES_SP_ARG); assert(_nc_stdscr_pseudo_panel); - if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL)))) + if (!(win->_flags & _ISPAD) && (pan = typeMalloc(PANEL, 1))) { pan->win = win; pan->above = (PANEL *) 0; diff --git a/panel/p_replace.c b/panel/p_replace.c index 5d0d295c8b1..d3733ed22e2 100644 --- a/panel/p_replace.c +++ b/panel/p_replace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,23 +36,25 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $") +MODULE_ID("$Id: p_replace.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) replace_panel(PANEL * pan, WINDOW *win) { - T((T_CALLED("replace_panel(%p,%p)"), pan, win)); + int rc = ERR; - if (!pan) - returnCode(ERR); + T((T_CALLED("replace_panel(%p,%p)"), (void *)pan, (void *)win)); - if (IS_LINKED(pan)) + if (pan) { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); + GetHook(pan); + if (IS_LINKED(pan)) + { + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); + } + pan->win = win; + rc = OK; } - - pan->win = win; - - returnCode(OK); + returnCode(rc); } diff --git a/panel/p_show.c b/panel/p_show.c index 35eee237b95..d5b09bd9426 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,34 +36,37 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.13 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) show_panel(PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("show_panel(%p)"), pan)); + T((T_CALLED("show_panel(%p)"), (void *)pan)); - if (!pan) - returnCode(ERR); + if (pan) + { + GetHook(pan); - if (Is_Top(pan)) - returnCode(OK); + if (Is_Top(pan)) + returnCode(OK); - dBug(("--> show_panel %s", USER_PTR(pan->user))); + dBug(("--> show_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); + HIDE_PANEL(pan, err, OK); - dStack("", 1, pan); - assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + dStack("", 1, pan); + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); - _nc_top_panel->above = pan; - pan->below = _nc_top_panel; - pan->above = (PANEL *) 0; - _nc_top_panel = pan; + _nc_top_panel->above = pan; + pan->below = _nc_top_panel; + pan->above = (PANEL *) 0; + _nc_top_panel = pan; - dStack("", 9, pan); + err = OK; - returnCode(OK); + dStack("", 9, pan); + } + returnCode(err); } diff --git a/panel/p_top.c b/panel/p_top.c index 8bd1d9fb3fe..fdcdee9afcd 100644 --- a/panel/p_top.c +++ b/panel/p_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_top.c,v 1.5 2005/02/19 16:42:23 tom Exp $") +MODULE_ID("$Id: p_top.c,v 1.6 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) top_panel(PANEL * pan) { - T((T_CALLED("top_panel(%p)"), pan)); + T((T_CALLED("top_panel(%p)"), (void *)pan)); returnCode(show_panel(pan)); } diff --git a/panel/p_update.c b/panel/p_update.c index 5967718160f..a2f45063cf5 100644 --- a/panel/p_update.c +++ b/panel/p_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_update.c @@ -36,28 +37,42 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $") +MODULE_ID("$Id: p_update.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(void) -update_panels(void) +NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) { PANEL *pan; - T((T_CALLED("update_panels()"))); + T((T_CALLED("update_panels(%p)"), (void *)SP_PARM)); dBug(("--> update_panels")); - pan = _nc_bottom_panel; - while (pan && pan->above) - { - PANEL_UPDATE(pan, pan->above); - pan = pan->above; - } - pan = _nc_bottom_panel; - while (pan) + if (SP_PARM) { - Wnoutrefresh(pan); - pan = pan->above; + GetScreenHook(SP_PARM); + + pan = _nc_bottom_panel; + while (pan && pan->above) + { + PANEL_UPDATE(pan, pan->above); + pan = pan->above; + } + + pan = _nc_bottom_panel; + while (pan) + { + Wnoutrefresh(pan); + pan = pan->above; + } } returnVoid; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +update_panels(void) +{ + NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); +} +#endif diff --git a/panel/p_user.c b/panel/p_user.c index ffa25f85ae1..deb5bdf7e4c 100644 --- a/panel/p_user.c +++ b/panel/p_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,12 +36,12 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_user.c,v 1.6 2005/02/19 16:52:44 tom Exp $") +MODULE_ID("$Id: p_user.c,v 1.8 2010/01/23 23:18:35 tom Exp $") NCURSES_EXPORT(int) set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) { - T((T_CALLED("set_panel_userptr(%p,%p)"), pan, uptr)); + T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); if (!pan) returnCode(ERR); pan->user = uptr; @@ -51,6 +51,6 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) NCURSES_EXPORT(NCURSES_CONST void *) panel_userptr(const PANEL * pan) { - T((T_CALLED("panel_userptr(%p)"), pan)); + T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); returnCVoidPtr(pan ? pan->user : (NCURSES_CONST void *)0); } diff --git a/panel/p_win.c b/panel/p_win.c index e7d2cea8e3f..6643d5c2671 100644 --- a/panel/p_win.c +++ b/panel/p_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_win.c,v 1.5 2005/02/19 16:44:16 tom Exp $") +MODULE_ID("$Id: p_win.c,v 1.6 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(WINDOW *) panel_window(const PANEL * pan) { - T((T_CALLED("panel_window(%p)"), pan)); + T((T_CALLED("panel_window(%p)"), (const void *)pan)); returnWin(pan ? pan->win : (WINDOW *)0); } diff --git a/panel/panel.c b/panel/panel.c index 16a8083d64b..96cbbab7740 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,12 +29,14 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1996-1999,2008 * + * and: Thomas E. Dickey * ****************************************************************************/ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") +MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $") /*+------------------------------------------------------------------------- _nc_retrace_panel (pan) @@ -43,7 +45,7 @@ MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") NCURSES_EXPORT(PANEL *) _nc_retrace_panel(PANEL * pan) { - T((T_RETURN("%p"), pan)); + T((T_RETURN("%p"), (void *)pan)); return pan; } #endif @@ -91,6 +93,8 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) { char s80[80]; + GetPanelHook(pan); + sprintf(s80, fmt, num, pan); _tracef("%s b=%s t=%s", s80, (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--", diff --git a/panel/panel.h b/panel/panel.h index 1e02091d97f..6ed2061d1ff 100644 --- a/panel/panel.h +++ b/panel/panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,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 * @@ -29,9 +29,10 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1996-1999,2008 * ****************************************************************************/ -/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */ +/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */ /* panel.h -- interface file for panels library */ @@ -68,6 +69,13 @@ extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); +extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); + +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); +#endif + #if defined(__cplusplus) } #endif diff --git a/panel/panel.priv.h b/panel/panel.priv.h index 4fb8144e1b7..ce4f98937fc 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 +26,7 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */ +/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 @@ -39,9 +39,11 @@ #include #include -#include "curses.priv.h" +struct screen; /* forward declaration */ + +#include "curses.priv.h" /* includes nc_panel.h */ #include "panel.h" -#include + #if USE_RCS_IDS # define MODULE_ID(id) static const char Ident[] = id; @@ -83,14 +85,38 @@ # define Touchline(pan,start,count) touchline((pan)->win,start,count) #endif -#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel -#define _nc_top_panel _nc_panelhook()->top_panel -#define _nc_bottom_panel _nc_panelhook()->bottom_panel +#if NCURSES_SP_FUNCS +#define GetScreenHook(sp) \ + struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp) +#define GetPanelHook(pan) \ + GetScreenHook(_nc_screen_of((pan)->win)) +#define GetWindowHook(win) \ + SCREEN* sp = _nc_screen_of(win); \ + GetScreenHook(sp) +#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); \ + GetScreenHook(sp) -#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel) -#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p))) -#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) -#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) +#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel) +#define _nc_top_panel ((ph)->top_panel) +#define _nc_bottom_panel ((ph)->bottom_panel) + +#else /* !NCURSES_SP_FUNCS */ + +#define GetScreenHook(sp) /* nothing */ +#define GetPanelHook(pan) /* nothing */ +#define GetWindowHook(win) /* nothing */ +#define GetHook(pan) /* nothing */ + +#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel +#define _nc_top_panel _nc_panelhook()->top_panel +#define _nc_bottom_panel _nc_panelhook()->bottom_panel + +#endif /* NCURSES_SP_FUNCS */ + +#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel) +#define Is_Bottom(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p))) +#define Is_Top(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p))) +#define Is_Pseudo(p) (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel)) /*+------------------------------------------------------------------------- IS_LINKED(pan) - check to see if panel is in the stack @@ -122,7 +148,7 @@ ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\ iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\ iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\ - assert((ix1<=ix2) && (iy1<=iy2));\ + assert((ix1<=ix2) && (iy1<=iy2)) /*+------------------------------------------------------------------------- @@ -136,12 +162,12 @@ { PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\ while(pan2) {\ if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\ - int y,ix1,ix2,iy1,iy2;\ - COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\ + int y, ix1, ix2, iy1, iy2;\ + COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\ for(y = iy1; y <= iy2; y++) {\ if (is_linetouched(pan->win,y - PSTARTY(pan))) {\ struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\ - CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\ + CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\ }\ }\ }\ @@ -180,4 +206,9 @@ err = err_if_unlinked;\ } +#if NCURSES_SP_FUNCS +/* These may become later renamed and part of panel.h and the public API */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); +#endif + #endif /* NCURSES_PANEL_PRIV_H */ diff --git a/progs/Makefile.in b/progs/Makefile.in index 886fd5be246..bdb8a0f0489 100644 --- a/progs/Makefile.in +++ b/progs/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $ +# $Id: Makefile.in,v 1.85 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile CF_MFLAGS = @cf_cv_makeflags@ @@ -76,6 +77,9 @@ transform = @program_transform_name@ AWK = @AWK@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -124,7 +128,7 @@ AUTO_SRC = \ transform.h # tic relies on direct access to the terminfo database -GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x +GET_PROGS = infocmp$x clear$x tabs$x tput$x tset$x toe$x PUT_PROGS = @MAKE_TERMINFO@ tic$x PROGS = $(PUT_PROGS) $(GET_PROGS) @@ -159,6 +163,7 @@ actual_infocmp = `echo infocmp$x| $(TRANSFORM)` actual_infotocap = `echo infotocap$x| $(TRANSFORM)` actual_init = `echo init$x| $(TRANSFORM)` actual_reset = `echo reset$x| $(TRANSFORM)` +actual_tabs = `echo tabs$x| $(TRANSFORM)` actual_tic = `echo tic$x| $(TRANSFORM)` actual_toe = `echo toe$x| $(TRANSFORM)` actual_tput = `echo tput$x| $(TRANSFORM)` @@ -171,10 +176,16 @@ define_init = `echo init| $(TRANSFORM)` define_reset = `echo reset| $(TRANSFORM)` transform.h : - echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@ - echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ - echo "#define PROG_RESET \"$(define_reset)\"" >>$@ - echo "#define PROG_INIT \"$(define_init)\"" >>$@ + echo "#ifndef __TRANSFORM_H" >$@ + echo "#define __TRANSFORM_H 1" >>$@ + echo "#include " >>$@ + echo "extern bool same_program(const char *, const char *);" >>$@ + -sh -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi' + echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >>$@ + echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ + echo "#define PROG_RESET \"$(define_reset)\"" >>$@ + echo "#define PROG_INIT \"$(define_init)\"" >>$@ + echo "#endif /* __TRANSFORM_H */" >>$@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ $(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x $(DESTDIR)$(bindir)/$(actual_tic) @@ -187,6 +198,7 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) $(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp) $(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x $(DESTDIR)$(bindir)/$(actual_clear) + $(LIBTOOL_INSTALL) $(INSTALL_PROG) tabs$x $(DESTDIR)$(bindir)/$(actual_tabs) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x $(DESTDIR)$(bindir)/$(actual_tput) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x $(DESTDIR)$(bindir)/$(actual_tset) @echo "linking $(actual_reset) to $(actual_tset)" @@ -200,12 +212,13 @@ uninstall.progs: @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear) + -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tabs) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset) -@rm -f $(DESTDIR)$(bindir)/$(actual_reset) $(DESTDIR)$(bindir) : - sh $(srcdir)/../mkdirs.sh $@ + mkdir -p $@ # # Utilities normally built by make all start here @@ -213,7 +226,8 @@ $(DESTDIR)$(bindir) : DEPS_TIC = \ $(MODEL)/tic$o \ - $(MODEL)/dump_entry$o + $(MODEL)/dump_entry$o \ + $(MODEL)/transform$o tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@ @@ -230,8 +244,15 @@ DEPS_CLEAR = \ clear$x: $(DEPS_CLEAR) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@ +DEPS_TABS = \ + $(MODEL)/tabs$o + +tabs$x: $(DEPS_TABS) $(DEPS_TABS) + @ECHO_LINK@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@ + DEPS_TPUT = \ - $(MODEL)/tput$o + $(MODEL)/tput$o \ + $(MODEL)/transform$o tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@ @@ -244,7 +265,8 @@ infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@ DEPS_TSET = \ - $(MODEL)/tset$o + $(MODEL)/tset$o \ + $(MODEL)/transform$o tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@ @@ -257,10 +279,10 @@ termsort.c: $(srcdir)/MKtermsort.sh # tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace @@ -289,6 +311,7 @@ lint: @MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tabs.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS) diff --git a/progs/dump_entry.c b/progs/dump_entry.c index bd2422008bf..485bbbd91d6 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.88 2008/08/04 12:36:12 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.89 2010/05/01 22:04:08 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -1040,7 +1040,7 @@ dump_entry(TERMTYPE *tterm, save_sgr = set_attributes; - if (((len = FMT_ENTRY()) > critlen) + if ((FMT_ENTRY() > critlen) && limited) { save_tterm = *tterm; @@ -1049,7 +1049,7 @@ dump_entry(TERMTYPE *tterm, critlen); suppress_untranslatable = TRUE; } - if ((len = FMT_ENTRY()) > critlen) { + if (FMT_ENTRY() > critlen) { /* * We pick on sgr because it's a nice long string capability that * is really just an optimization hack. Another good candidate is @@ -1075,7 +1075,7 @@ dump_entry(TERMTYPE *tterm, critlen); } changed = TRUE; - if ((len = FMT_ENTRY()) <= critlen) + if (FMT_ENTRY() <= critlen) break; } } @@ -1086,7 +1086,7 @@ dump_entry(TERMTYPE *tterm, critlen); changed = TRUE; } - if (!changed || ((len = FMT_ENTRY()) > critlen)) { + if (!changed || (FMT_ENTRY() > critlen)) { if (purged_acs(tterm)) { acs_chars = ABSENT_STRING; SHOW_WHY("# (acsc removed to fit entry within %d bytes)\n", @@ -1094,7 +1094,7 @@ dump_entry(TERMTYPE *tterm, changed = TRUE; } } - if (!changed || ((len = FMT_ENTRY()) > critlen)) { + if (!changed || (FMT_ENTRY() > critlen)) { int oldversion = tversion; tversion = V_BSD; @@ -1130,7 +1130,7 @@ dump_entry(TERMTYPE *tterm, } else if (!version_filter(STRING, STR_IDX(acs_chars))) { save_tterm = *tterm; if (purged_acs(tterm)) { - len = FMT_ENTRY(); + (void) FMT_ENTRY(); } *tterm = save_tterm; } diff --git a/progs/infocmp.c b/progs/infocmp.c index 84989ffc63d..2af9cb50b1d 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.103 2008/08/16 22:04:56 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.105 2010/05/01 22:04:08 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -894,8 +894,6 @@ file_comparison(int argc, char *argv[]) (void) printf("The following entries are equivalent:\n"); for (qp = heads[0]; qp; qp = qp->next) { - rp = qp->crosslinks[0]; - if (qp->ncrosslinks == 1) { rp = qp->crosslinks[0]; @@ -1255,6 +1253,15 @@ terminal_env(void) * ***************************************************************************/ +#if NO_LEAKS +#define MAIN_LEAKS() \ + free(myargv); \ + free(tfile); \ + free(tname) +#else +#define MAIN_LEAKS() /* nothing */ +#endif + int main(int argc, char *argv[]) { @@ -1514,6 +1521,7 @@ main(int argc, char *argv[]) #else (void) fprintf(stderr, "%s: terminfo files not supported\n", _nc_progname); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); #endif } else { @@ -1526,7 +1534,6 @@ main(int argc, char *argv[]) status = _nc_read_entry(tname[termcount], tfile[termcount], &entries[termcount].tterm); - directory = TERMINFO; /* for error message */ } if (status <= 0) { @@ -1534,6 +1541,7 @@ main(int argc, char *argv[]) "%s: couldn't open terminfo file %s.\n", _nc_progname, tfile[termcount]); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); } repair_acsc(&entries[termcount].tterm); @@ -1642,11 +1650,7 @@ main(int argc, char *argv[]) else file_comparison(argc - optind, argv + optind); -#if NO_LEAKS - free(myargv); - free(tfile); - free(tname); -#endif + MAIN_LEAKS(); ExitProgram(EXIT_SUCCESS); } diff --git a/progs/modules b/progs/modules index 3b4f3b60236..55d7a9fb969 100644 --- a/progs/modules +++ b/progs/modules @@ -1,7 +1,7 @@ -# $Id: modules,v 1.13 2006/12/24 00:53:21 tom Exp $ +# $Id: modules,v 1.17 2010/01/23 17:47:23 tom Exp $ # Program modules (some are in ncurses lib!) ############################################################################## -# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -34,10 +34,12 @@ @ base clear progs $(srcdir) $(HEADER_DEPS) tic progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h -toe progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h +toe progs $(srcdir) $(HEADER_DEPS) $(INCDIR)/hashed_db.h dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c infocmp progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h -tput progs $(srcdir) $(HEADER_DEPS) transform.h termsort.c +tabs progs $(srcdir) $(HEADER_DEPS) +tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h termsort.c tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h +transform progs $(srcdir) $(HEADER_DEPS) transform.h # vile:makemode diff --git a/progs/tabs.c b/progs/tabs.c new file mode 100644 index 00000000000..b59c9086d8d --- /dev/null +++ b/progs/tabs.c @@ -0,0 +1,510 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,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"), 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 2008 * + ****************************************************************************/ + +/* + * tabs.c -- set terminal hard-tabstops + */ + +#define USE_LIBTINFO +#include + +MODULE_ID("$Id: tabs.c,v 1.19 2010/10/23 22:26:01 tom Exp $") + +static void usage(void) GCC_NORETURN; + +static int max_cols; + +static int +putch(int c) +{ + return putchar(c); +} + +static void +do_tabs(int *tab_list) +{ + int last = 1; + int stop; + + putchar('\r'); + while ((stop = *tab_list++) > 0) { + if (last < stop) { + while (last++ < stop) { + if (last > max_cols) + break; + putchar(' '); + } + } + if (stop <= max_cols) { + tputs(tparm(set_tab, stop), 1, putch); + last = stop; + } else { + break; + } + } + putchar('\n'); +} + +static int * +decode_tabs(const char *tab_list) +{ + int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols); + int n = 0; + int value = 0; + int prior = 0; + int ch; + + if (result != 0) { + while ((ch = *tab_list++) != '\0') { + if (isdigit(UChar(ch))) { + value *= 10; + value += (ch - '0'); + } else if (ch == ',') { + result[n] = value + prior; + if (n > 0 && result[n] <= result[n - 1]) { + fprintf(stderr, + "tab-stops are not in increasing order: %d %d\n", + value, result[n - 1]); + free(result); + result = 0; + break; + } + ++n; + value = 0; + prior = 0; + } else if (ch == '+') { + if (n) + prior = result[n - 1]; + } + } + } + + if (result != 0) { + /* + * If there is only one value, then it is an option such as "-8". + */ + if ((n == 0) && (value > 0)) { + int step = value; + while (n < max_cols - 1) { + result[n++] = value; + value += step; + } + } + + /* + * Add the last value, if any. + */ + result[n++] = value + prior; + result[n] = 0; + } + return result; +} + +static void +print_ruler(int *tab_list) +{ + int last = 0; + int stop; + int n; + + /* first print a readable ruler */ + for (n = 0; n < max_cols; n += 10) { + int ch = 1 + (n / 10); + char buffer[20]; + sprintf(buffer, "----+----%c", + ((ch < 10) + ? (ch + '0') + : (ch + 'A' - 10))); + printf("%.*s", ((max_cols - n) > 10) ? 10 : (max_cols - n), buffer); + } + putchar('\n'); + + /* now, print '*' for each stop */ + for (n = 0, last = 0; (tab_list[n] > 0) && (last < max_cols); ++n) { + stop = tab_list[n]; + while (++last < stop) { + if (last <= max_cols) { + putchar('-'); + } else { + break; + } + } + if (last <= max_cols) { + putchar('*'); + last = stop; + } else { + break; + } + } + while (++last <= max_cols) + putchar('-'); + putchar('\n'); +} + +/* + * Write an '*' on each tabstop, to demonstrate whether it lines up with the + * ruler. + */ +static void +write_tabs(int *tab_list) +{ + int stop; + + while ((stop = *tab_list++) > 0 && stop <= max_cols) { + fputs((stop == 1) ? "*" : "\t*", stdout); + }; + /* also show a tab _past_ the stops */ + if (stop < max_cols) + fputs("\t+", stdout); + putchar('\n'); +} + +/* + * Trim leading/trailing blanks, as well as blanks after a comma. + * Convert embedded blanks to commas. + */ +static char * +trimmed_tab_list(const char *source) +{ + char *result = strdup(source); + int ch, j, k, last; + + if (result != 0) { + for (j = k = last = 0; result[j] != 0; ++j) { + ch = UChar(result[j]); + if (isspace(ch)) { + if (last == '\0') { + continue; + } else if (isdigit(last) || last == ',') { + ch = ','; + } + } else if (ch == ',') { + ; + } else { + if (last == ',') + result[k++] = (char) last; + result[k++] = (char) ch; + } + last = ch; + } + result[k] = '\0'; + } + return result; +} + +static bool +comma_is_needed(const char *source) +{ + bool result = FALSE; + + if (source != 0) { + unsigned len = strlen(source); + if (len != 0) + result = (source[len - 1] != ','); + } else { + result = FALSE; + } + return result; +} + +/* + * Add a command-line parameter to the tab-list. It can be blank- or comma- + * separated (or a mixture). For simplicity, empty tabs are ignored, e.g., + * tabs 1,,6,11 + * tabs 1,6,11 + * are treated the same. + */ +static const char * +add_to_tab_list(char **append, const char *value) +{ + char *result = *append; + char *copied = trimmed_tab_list(value); + + if (copied != 0 && *copied != '\0') { + const char *comma = ","; + unsigned need = 1 + strlen(copied); + + if (*copied == ',') + comma = ""; + else if (!comma_is_needed(*append)) + comma = ""; + + need += strlen(comma); + if (*append != 0) + need += strlen(*append); + + result = malloc(need); + if (result != 0) { + *result = '\0'; + if (*append != 0) { + strcpy(result, *append); + free(*append); + } + strcat(result, comma); + strcat(result, copied); + } + + *append = result; + } + return result; +} + +/* + * Check for illegal characters in the tab-list. + */ +static bool +legal_tab_list(const char *program, const char *tab_list) +{ + bool result = TRUE; + + if (tab_list != 0 && *tab_list != '\0') { + if (comma_is_needed(tab_list)) { + int n, ch; + for (n = 0; tab_list[n] != '\0'; ++n) { + ch = UChar(tab_list[n]); + if (!(isdigit(ch) || ch == ',' || ch == '+')) { + fprintf(stderr, + "%s: unexpected character found '%c'\n", + program, ch); + result = FALSE; + break; + } + } + } else { + fprintf(stderr, "%s: trailing comma found '%s'\n", program, tab_list); + result = FALSE; + } + } else { + fprintf(stderr, "%s: no tab-list given\n", program); + result = FALSE; + } + return result; +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: tabs [options] [tabstop-list]" + ,"" + ,"Options:" + ," -0 reset tabs" + ," -8 set tabs to standard interval" + ," -a Assembler, IBM S/370, first format" + ," -a2 Assembler, IBM S/370, second format" + ," -c COBOL, normal format" + ," -c2 COBOL compact format" + ," -c3 COBOL compact format extended" + ," -d debug (show ruler with expected/actual tab positions)" + ," -f FORTRAN" + ," -n no-op (do not modify terminal settings)" + ," -p PL/I" + ," -s SNOBOL" + ," -u UNIVAC 1100 Assembler" + ," -T name use terminal type 'name'" + ,"" + ,"A tabstop-list is an ordered list of column numbers, e.g., 1,11,21" + ,"or 1,+10,+10 which is the same." + }; + unsigned n; + + fflush(stdout); + for (n = 0; n < SIZEOF(msg); ++n) { + fprintf(stderr, "%s\n", msg[n]); + } + ExitProgram(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + int rc = EXIT_FAILURE; + bool debug = FALSE; + bool no_op = FALSE; + int n, ch; + NCURSES_CONST char *term_name = 0; + const char *mar_list = 0; /* ignored */ + char *append = 0; + const char *tab_list = 0; + + if ((term_name = getenv("TERM")) == 0) + term_name = "ansi+tabs"; + + /* cannot use getopt, since some options are two-character */ + for (n = 1; n < argc; ++n) { + char *option = argv[n]; + switch (option[0]) { + case '-': + while ((ch = *++option) != '\0') { + switch (ch) { + case 'a': + switch (*option) { + case '\0': + tab_list = "1,10,16,36,72"; + /* Assembler, IBM S/370, first format */ + break; + case '2': + tab_list = "1,10,16,40,72"; + /* Assembler, IBM S/370, second format */ + break; + default: + usage(); + } + break; + case 'c': + switch (*option) { + case '\0': + tab_list = "1,8,12,16,20,55"; + /* COBOL, normal format */ + break; + case '2': + tab_list = "1,6,10,14,49"; + /* COBOL compact format */ + break; + case '3': + tab_list = "1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67"; + /* COBOL compact format extended */ + break; + default: + usage(); + } + break; + case 'd': /* ncurses extension */ + debug = TRUE; + break; + case 'f': + tab_list = "1,7,11,15,19,23"; + /* FORTRAN */ + break; + case 'n': /* ncurses extension */ + no_op = TRUE; + break; + case 'p': + tab_list = "1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61"; + /* PL/I */ + break; + case 's': + tab_list = "1,10,55"; + /* SNOBOL */ + break; + case 'u': + tab_list = "1,12,20,44"; + /* UNIVAC 1100 Assembler */ + break; + case 'T': + ++n; + if (*++option != '\0') { + term_name = option; + } else { + term_name = argv[n++]; + } + option += ((int) strlen(option)) - 1; + continue; + default: + if (isdigit(UChar(*option))) { + tab_list = option; + ++n; + } else { + usage(); + } + option += ((int) strlen(option)) - 1; + break; + } + } + break; + case '+': + while ((ch = *++option) != '\0') { + switch (ch) { + case 'm': + mar_list = option; + break; + default: + /* special case of relative stops separated by spaces? */ + if (option == argv[n] + 1) { + tab_list = add_to_tab_list(&append, argv[n]); + } + break; + } + } + break; + default: + if (append != 0) { + if (tab_list != (const char *) append) { + /* one of the predefined options was used */ + free(append); + append = 0; + } + } + tab_list = add_to_tab_list(&append, option); + break; + } + } + + setupterm(term_name, STDOUT_FILENO, (int *) 0); + + max_cols = (columns > 0) ? columns : 80; + + if (!VALID_STRING(clear_all_tabs)) { + fprintf(stderr, + "%s: terminal type '%s' cannot reset tabs\n", + argv[0], term_name); + } else if (!VALID_STRING(set_tab)) { + fprintf(stderr, + "%s: terminal type '%s' cannot set tabs\n", + argv[0], term_name); + } else if (legal_tab_list(argv[0], tab_list)) { + int *list = decode_tabs(tab_list); + + if (!no_op) + tputs(clear_all_tabs, 1, putch); + + if (list != 0) { + if (!no_op) + do_tabs(list); + if (debug) { + fflush(stderr); + printf("tabs %s\n", tab_list); + print_ruler(list); + write_tabs(list); + } + free(list); + } else if (debug) { + fflush(stderr); + printf("tabs %s\n", tab_list); + } + rc = EXIT_SUCCESS; + } + if (append != 0) + free(append); + ExitProgram(rc); +} diff --git a/progs/tic.c b/progs/tic.c index 82bc3ea0d78..8e89095fc67 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.137 2008/09/13 16:59:24 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.147 2011/02/12 18:39:08 tom Exp $") const char *_nc_progname = "tic"; @@ -342,8 +342,15 @@ stripped(char *src) while (isspace(UChar(*src))) src++; if (*src != '\0') { - char *dst = strcpy((char *) malloc(strlen(src) + 1), src); - size_t len = strlen(dst); + char *dst; + size_t len; + + if ((dst = strdup(src)) == NULL) + failed("strdup"); + + assert(dst != 0); + + len = strlen(dst); while (--len != 0 && isspace(UChar(dst[len]))) dst[len] = '\0'; return dst; @@ -495,11 +502,11 @@ main(int argc, char *argv[]) _nc_progname = _nc_rootname(argv[0]); - if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) { + if ((infodump = same_program(_nc_progname, PROG_CAPTOINFO)) != FALSE) { outform = F_TERMINFO; sortmode = S_TERMINFO; } - if ((capdump = (strcmp(_nc_progname, PROG_INFOTOCAP) == 0)) != FALSE) { + if ((capdump = same_program(_nc_progname, PROG_INFOTOCAP)) != FALSE) { outform = F_TERMCAP; sortmode = S_TERMCAP; } @@ -757,6 +764,7 @@ main(int argc, char *argv[]) put_translate(fgetc(tmp_fp)); } + repair_acsc(&qp->tterm); dump_entry(&qp->tterm, suppress_untranslatable, limited, numbers, NULL); for (j = 0; j < (int) qp->nuses; j++) @@ -923,6 +931,156 @@ keypad_index(const char *string) return result; } +/* + * list[] is down, up, left, right + * "left" may be ^H rather than \E[D + * "down" may be ^J rather than \E[B + * But up/right are generally consistently escape sequences for ANSI terminals. + */ +static void +check_ansi_cursor(char *list[4]) +{ + int j, k; + int want; + size_t prefix = 0; + size_t suffix; + bool skip[4]; + bool repeated = FALSE; + + for (j = 0; j < 4; ++j) { + skip[j] = FALSE; + for (k = 0; k < j; ++k) { + if (j != k + && !strcmp(list[j], list[k])) { + char *value = _nc_tic_expand(list[k], TRUE, 0); + _nc_warning("repeated cursor control %s\n", value); + repeated = TRUE; + } + } + } + if (!repeated) { + char *up = list[1]; + + if (UChar(up[0]) == '\033') { + if (up[1] == '[') { + prefix = 2; + } else { + prefix = 1; + } + } else if (UChar(up[0]) == UChar('\233')) { + prefix = 1; + } + if (prefix) { + suffix = prefix; + while (up[suffix] && isdigit(UChar(up[suffix]))) + ++suffix; + } + if (prefix && up[suffix] == 'A') { + skip[1] = TRUE; + if (!strcmp(list[0], "\n")) + skip[0] = TRUE; + if (!strcmp(list[2], "\b")) + skip[2] = TRUE; + + for (j = 0; j < 4; ++j) { + if (skip[j] || strlen(list[j]) == 1) + continue; + if (memcmp(list[j], up, prefix)) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent prefix for %s\n", value); + continue; + } + if (strlen(list[j]) < suffix) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent length for %s, expected %d\n", + value, (int) suffix + 1); + continue; + } + want = "BADC"[j]; + if (list[j][suffix] != want) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent suffix for %s, expected %c, have %c\n", + value, want, list[j][suffix]); + } + } + } + } +} + +#define EXPECTED(name) if (!PRESENT(name)) _nc_warning("expected " #name) + +static void +check_cursor(TERMTYPE *tp) +{ + int count; + char *list[4]; + + /* if we have a parameterized form, then the non-parameterized is easy */ + ANDMISSING(parm_down_cursor, cursor_down); + ANDMISSING(parm_up_cursor, cursor_up); + ANDMISSING(parm_left_cursor, cursor_left); + ANDMISSING(parm_right_cursor, cursor_right); + + /* Given any of a set of cursor movement, the whole set should be present. + * Technically this is not true (we could use cursor_address to fill in + * unsupported controls), but it is likely. + */ + count = 0; + if (PRESENT(parm_down_cursor)) { + list[count++] = parm_down_cursor; + } + if (PRESENT(parm_up_cursor)) { + list[count++] = parm_up_cursor; + } + if (PRESENT(parm_left_cursor)) { + list[count++] = parm_left_cursor; + } + if (PRESENT(parm_right_cursor)) { + list[count++] = parm_right_cursor; + } + if (count == 4) { + check_ansi_cursor(list); + } else if (count != 0) { + EXPECTED(parm_down_cursor); + EXPECTED(parm_up_cursor); + EXPECTED(parm_left_cursor); + EXPECTED(parm_right_cursor); + } + + count = 0; + if (PRESENT(cursor_down)) { + list[count++] = cursor_down; + } + if (PRESENT(cursor_up)) { + list[count++] = cursor_up; + } + if (PRESENT(cursor_left)) { + list[count++] = cursor_left; + } + if (PRESENT(cursor_right)) { + list[count++] = cursor_right; + } + if (count == 4) { + check_ansi_cursor(list); + } else if (count != 0) { + count = 0; + if (PRESENT(cursor_down) && strcmp(cursor_down, "\n")) + ++count; + if (PRESENT(cursor_left) && strcmp(cursor_left, "\b")) + ++count; + if (PRESENT(cursor_up) && strlen(cursor_up) > 1) + ++count; + if (PRESENT(cursor_right) && strlen(cursor_right) > 1) + ++count; + if (count) { + EXPECTED(cursor_down); + EXPECTED(cursor_up); + EXPECTED(cursor_left); + EXPECTED(cursor_right); + } + } +} + #define MAX_KP 5 /* * Do a quick sanity-check for vt100-style keypads to see if the 5-key keypad @@ -1032,6 +1190,32 @@ check_keypad(TERMTYPE *tp) } } +static void +check_printer(TERMTYPE *tp) +{ + PAIRED(enter_doublewide_mode, exit_doublewide_mode); + PAIRED(enter_italics_mode, exit_italics_mode); + PAIRED(enter_leftward_mode, exit_leftward_mode); + PAIRED(enter_micro_mode, exit_micro_mode); + PAIRED(enter_shadow_mode, exit_shadow_mode); + PAIRED(enter_subscript_mode, exit_subscript_mode); + PAIRED(enter_superscript_mode, exit_superscript_mode); + PAIRED(enter_upward_mode, exit_upward_mode); + + ANDMISSING(start_char_set_def, stop_char_set_def); + + /* if we have a parameterized form, then the non-parameterized is easy */ + ANDMISSING(set_bottom_margin_parm, set_bottom_margin); + ANDMISSING(set_left_margin_parm, set_left_margin); + ANDMISSING(set_right_margin_parm, set_right_margin); + ANDMISSING(set_top_margin_parm, set_top_margin); + + ANDMISSING(parm_down_micro, micro_down); + ANDMISSING(parm_left_micro, micro_left); + ANDMISSING(parm_right_micro, micro_right); + ANDMISSING(parm_up_micro, micro_up); +} + /* * Returns the expected number of parameters for the given capability. */ @@ -1268,6 +1452,8 @@ similar_sgr(int num, char *a, char *b) } else if (delaying) { a = skip_delay(a); b = skip_delay(b); + } else if ((*b == '0' || (*b == ';')) && *a == 'm') { + b++; } else { a++; } @@ -1343,7 +1529,7 @@ show_where(unsigned level) if (_nc_tracing >= DEBUG_LEVEL(level)) { char my_name[256]; _nc_get_type(my_name); - fprintf(stderr, "\"%s\", line %d, '%s' ", + _tracef("\"%s\", line %d, '%s'", _nc_get_source(), _nc_curr_line, my_name); } @@ -1411,7 +1597,9 @@ check_termtype(TERMTYPE *tp, bool literal) check_acs(tp); check_colors(tp); + check_cursor(tp); check_keypad(tp); + check_printer(tp); /* * These may be mismatched because the terminal description relies on @@ -1432,6 +1620,11 @@ check_termtype(TERMTYPE *tp, bool literal) ANDMISSING(change_scroll_region, save_cursor); ANDMISSING(change_scroll_region, restore_cursor); + /* + * If we can clear tabs, we should be able to initialize them. + */ + ANDMISSING(clear_all_tabs, set_tab); + if (PRESENT(set_attributes)) { char *zero = 0; diff --git a/progs/toe.c b/progs/toe.c index 8af6f371b77..6f45992f712 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: toe.c,v 1.51 2008/08/16 21:53:25 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.52 2010/05/01 22:04:08 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -61,6 +61,13 @@ ExitProgram(int code) } #endif +static void +failed(const char *msg) +{ + perror(msg); + ExitProgram(EXIT_FAILURE); +} + #if USE_HASHED_DB static bool make_db_name(char *dst, const char *src, unsigned limit) @@ -184,10 +191,10 @@ typelist(int eargc, char *eargv[], DIRENT *entry; cwd_buf = typeRealloc(char, cwd_len, cwd_buf); - if (cwd_buf == 0) { - perror("realloc cwd_buf"); - continue; - } + if (cwd_buf == 0) + failed("realloc cwd_buf"); + + assert(cwd_buf != 0); strncpy(name_1, subdir->d_name, len)[len] = '\0'; if (isDotname(name_1)) @@ -480,6 +487,10 @@ main(int argc, char *argv[]) } if (!pass) { eargv = typeCalloc(char *, count + 1); + if (eargv == 0) + failed("realloc eargv"); + + assert(eargv != 0); } else { code = typelist((int) count, eargv, header, deschook); while (count-- > 0) diff --git a/progs/tput.c b/progs/tput.c index 022d4940c2a..2e67cfecbef 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -47,7 +47,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.42 2008/07/13 11:05:12 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.46 2010/01/09 16:53:24 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -86,8 +86,8 @@ usage(void) static void check_aliases(const char *name) { - is_init = (strcmp(name, PROG_INIT) == 0); - is_reset = (strcmp(name, PROG_RESET) == 0); + is_init = same_program(name, PROG_INIT); + is_reset = same_program(name, PROG_RESET); } /* @@ -153,6 +153,9 @@ tput(int argc, char *argv[]) int i, j, c; int status; FILE *f; +#if !PURE_TERMINFO + bool termcap = FALSE; +#endif if ((name = argv[0]) == 0) name = ""; @@ -265,35 +268,40 @@ tput(int argc, char *argv[]) return 0; } #if !PURE_TERMINFO - { - const struct name_table_entry *np; - - if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0) - switch (np->nte_type) { - case BOOLEAN: - if (bool_from_termcap[np->nte_index]) - name = boolnames[np->nte_index]; - break; - - case NUMBER: - if (num_from_termcap[np->nte_index]) - name = numnames[np->nte_index]; - break; - - case STRING: - if (str_from_termcap[np->nte_index]) - name = strnames[np->nte_index]; - break; - } - } + retry: #endif - if ((status = tigetflag(name)) != -1) { return exit_code(BOOLEAN, status); } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); return exit_code(NUMBER, 0); } else if ((s = tigetstr(name)) == CANCELLED_STRING) { +#if !PURE_TERMINFO + if (!termcap) { + const struct name_table_entry *np; + + termcap = TRUE; + if ((np = _nc_find_entry(name, _nc_get_hash_table(termcap))) != 0) { + switch (np->nte_type) { + case BOOLEAN: + if (bool_from_termcap[np->nte_index]) + name = boolnames[np->nte_index]; + break; + + case NUMBER: + if (num_from_termcap[np->nte_index]) + name = numnames[np->nte_index]; + break; + + case STRING: + if (str_from_termcap[np->nte_index]) + name = strnames[np->nte_index]; + break; + } + goto retry; + } + } +#endif quit(4, "unknown terminfo capability '%s'", name); } else if (s != ABSENT_STRING) { if (argc > 1) { diff --git a/progs/transform.c b/progs/transform.c new file mode 100644 index 00000000000..75f4573357c --- /dev/null +++ b/progs/transform.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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 * + ****************************************************************************/ +#include +#include + +#include + +MODULE_ID("$Id: transform.c,v 1.2 2010/09/04 21:16:17 tom Exp $") + +#ifdef SUFFIX_IGNORED +static void +trim_suffix(const char *a, unsigned *len) +{ + const char ignore[] = SUFFIX_IGNORED; + + if (sizeof(ignore) != 0) { + bool trim = FALSE; + unsigned need = (sizeof(ignore) - 1); + + if (*len > need) { + unsigned first = *len - need; + unsigned n; + trim = TRUE; + for (n = first; n < *len; ++n) { + if (tolower(UChar(a[n])) != tolower(UChar(ignore[n - first]))) { + trim = FALSE; + break; + } + } + if (trim) { + *len -= need; + } + } + } +} +#else +#define trim_suffix(a, len) /* nothing */ +#endif + +bool +same_program(const char *a, const char *b) +{ + unsigned len_a = strlen(a); + unsigned len_b = strlen(b); + + trim_suffix(a, &len_a); + trim_suffix(b, &len_b); + + return (len_a == len_b) && (strncmp(a, b, len_a) == 0); +} diff --git a/progs/tset.c b/progs/tset.c index 6a4d2d61c3d..084e41d6db2 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -32,6 +32,22 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ +/* + * Notes: + * The initial adaptation from 4.4BSD Lite sources in September 1995 used 686 + * lines from that version, and made changes/additions for 150 lines. There + * was no reformatting, so with/without ignoring whitespace, the amount of + * change is the same. + * + * Comparing with current (2009) source, excluding this comment: + * a) 209 lines match identically to the 4.4BSD Lite sources, with 771 lines + * changed/added. + * a) Ignoring whitespace, the current version still uses 516 lines from the + * 4.4BSD Lite sources, with 402 lines changed/added. + * + * Raymond's original comment on this follows... + */ + /* * tset.c - terminal initialization utility * @@ -52,11 +68,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -107,7 +119,7 @@ char *ttyname(int fd); #include #include -MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.82 2010/05/01 21:42:46 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -129,7 +141,9 @@ MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") # endif #endif +#ifndef environ extern char **environ; +#endif #undef CTRL #define CTRL(x) ((x) & 0x1f) @@ -385,9 +399,13 @@ add_mapping(const char *port, char *arg) char *base = 0; copy = strdup(arg); - mapp = (MAP *) malloc(sizeof(MAP)); + mapp = typeMalloc(MAP, 1); if (copy == 0 || mapp == 0) failed("malloc"); + + assert(copy != 0); + assert(mapp != 0); + mapp->next = 0; if (maplist == 0) cur = maplist = mapp; @@ -1247,12 +1265,12 @@ main(int argc, char **argv) ospeed = (NCURSES_OSPEED) mode.sg_ospeed; #endif - if (!strcmp(_nc_progname, PROG_RESET)) { + if (same_program(_nc_progname, PROG_RESET)) { isreset = TRUE; reset_mode(); } - ttype = get_termcap_entry(*argv); + (void) get_termcap_entry(*argv); if (!noset) { tcolumns = columns; diff --git a/test/Makefile.in b/test/Makefile.in new file mode 100644 index 00000000000..9fde0adbe8b --- /dev/null +++ b/test/Makefile.in @@ -0,0 +1,131 @@ +# $Id: Makefile.in,v 1.108 2010/11/28 16:39:40 tom Exp $ +############################################################################## +# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "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 1996-on +# +# Makefile for ncurses tests. + +# turn off _all_ suffix rules; we'll generate our own +.SUFFIXES: + +SHELL = /bin/sh +VPATH = @srcdir@ + +@SET_MAKE@ + +destdir = +x = @EXEEXT@ +o = .@OBJEXT@ + +MODEL = ../@DFT_OBJ_SUBDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +libdir = @libdir@ +includedir = @includedir@ + +BINDIR = $(DESTDIR)$(bindir) +LIBDIR = $(DESTDIR)$(libdir) +INCLUDEDIR = $(DESTDIR)$(includedir) + +LIBTOOL = @LIBTOOL@ +LIBTOOL_CLEAN = @LIB_CLEAN@ +LIBTOOL_COMPILE = @LIB_COMPILE@ +LIBTOOL_LINK = @LIB_LINK@ + +INSTALL = @INSTALL@ +INSTALL_PROG = @INSTALL_PROGRAM@ +transform = @program_transform_name@ +TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/' + +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + +CC = @CC@ +CPP = @CPP@ + +CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@ +CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H @CPPFLAGS@ + +CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +CFLAGS_LIBTOOL = $(CCFLAGS) +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +REL_VERSION = @cf_cv_rel_version@ +ABI_VERSION = @cf_cv_abi_version@ +LOCAL_LIBDIR = @top_builddir@/lib +LOCAL_LIBS = @TEST_DEPS@ +MATH_LIB = @MATH_LIB@ +TEST_LIBS = @TEST_LIBS@ + +LD = @LD@ +LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CFLAGS) + +LDFLAGS = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@ + +LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL) +LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL) +LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG) +LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) +LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@ + +TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ + +# use these for linking with all of the libraries +LIBS_DEFAULT = $(TEST_ARGS) @LIBS@ $(TEST_LIBS) $(MATH_LIB) +LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_DEFAULT) + +# use these for linking with the (n)curses library and possibly pthreads +LIBS_THREADS = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-lform.*-lpanel[^ ]*//'` $(TEST_LIBS) $(MATH_LIB) @PTHREAD@ +LDFLAGS_THREADS = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_THREADS) + +# use these for linking with the (n)curses library +LIBS_CURSES = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-lform.*-lpanel[^ ]*//'` $(TEST_LIBS) $(MATH_LIB) +LDFLAGS_CURSES = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_CURSES) + +# use these for linking with the tinfo library if we have it, or curses library if not +LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LIBS@ $(TEST_LIBS) $(MATH_LIB) +LDFLAGS_TINFO = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO) + +LINT = @LINT@ +LINT_OPTS = @LINT_OPTS@ +LINT_LIBS = -lform -lmenu -lpanel -lncurses @LIBS@ + +HEADER_DEPS = \ + ../include/curses.h \ + ../include/term.h + +# The rest is generated from the "programs" and "modules" files... diff --git a/test/README b/test/README new file mode 100644 index 00000000000..8a016ec824d --- /dev/null +++ b/test/README @@ -0,0 +1,800 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 1998-2010,2011 Free 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: README,v 1.44 2011/02/26 00:09:25 tom Exp $ +------------------------------------------------------------------------------- + +The programs in this directory are designed to test your newest toy :-) +Check the sources for any further details. + +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 + +The bs and knight games demonstrate processing of mouse events under xterm. +This directory also contains: + +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 +TYPE_ALPHA test: demo_forms ncurses +TYPE_ENUM test: demo_forms +TYPE_INTEGER test: demo_forms +TYPE_IPV4 test: demo_forms +TYPE_NUMERIC test: demo_forms +TYPE_REGEXP test: demo_forms +current_field test: demo_forms edit_field ncurses +data_ahead test: demo_forms +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_count test: demo_forms +field_fore test: demo_forms +field_index test: demo_forms +field_info test: ncurses +field_init - +field_just - +field_opts test: demo_forms ncurses +field_opts_off test: cardfile demo_forms +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 +form_driver test: cardfile demo_forms edit_field ncurses +form_fields test: cardfile demo_forms +form_init - +form_opts - +form_opts_off - +form_opts_on - +form_page test: demo_forms +form_request_by_name - +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 +free_fieldtype test: ncurses +free_form test: cardfile demo_forms ncurses +link_field - +link_fieldtype - +move_field - +new_field test: cardfile demo_forms ncurses +new_fieldtype test: ncurses +new_form test: cardfile demo_forms ncurses +new_form_sp - +new_page test: demo_forms +pos_form_cursor - +post_form test: cardfile demo_forms 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_buffer test: cardfile demo_forms edit_field ncurses +set_field_fore test: demo_forms +set_field_init - +set_field_just test: cardfile demo_forms +set_field_opts test: demo_forms ncurses +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_fieldtype_arg - +set_fieldtype_choice - +set_form_fields - +set_form_init - +set_form_opts - +set_form_page - +set_form_sub test: cardfile demo_forms ncurses +set_form_term - +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 + +libmenu: +------- +current_item test: demo_menus ncurses +free_item test: ncurses +free_menu test: demo_menus ncurses +item_count test: demo_menus +item_description - +item_index test: demo_menus ncurses +item_init - +item_name test: demo_menus ncurses +item_opts - +item_opts_off - +item_opts_on - +item_term - +item_userptr - +item_value test: demo_menus ncurses +item_visible - +menu_back - +menu_driver test: demo_menus ncurses +menu_fore - +menu_format - +menu_grey - +menu_init - +menu_items test: demo_menus ncurses +menu_mark test: demo_menus +menu_opts - +menu_opts_off test: demo_menus ncurses +menu_opts_on test: demo_menus +menu_pad - +menu_pattern test: demo_menus +menu_request_by_name - +menu_request_name - +menu_spacing test: demo_menus +menu_sub test: demo_menus +menu_term - +menu_userptr - +menu_win test: demo_menus ncurses +new_item test: demo_menus ncurses +new_menu test: demo_menus ncurses +new_menu_sp - +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_opts - +set_item_term - +set_item_userptr - +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_items - +set_menu_mark test: demo_menus +set_menu_opts - +set_menu_pad - +set_menu_pattern - +set_menu_spacing - +set_menu_sub test: demo_menus ncurses +set_menu_term - +set_menu_userptr - +set_menu_win test: demo_menus ncurses +set_top_row - +top_row - +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 +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 +SP lib: form +TABSIZE test: test_opaque +UP - +acs_map test: 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 +add_wchnstr test: test_add_wchstr +add_wchstr test: test_add_wchstr view +addch test: blue bs echochar hashtest ncurses 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 +assume_default_colors test: ncurses +assume_default_colors_sp - +attr_get test: ncurses +attr_off test: ncurses +attr_on test: 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 +beep_sp lib: ncurses +bkgd test: background cardfile demo_forms ncurses savescreen tclock view +bkgdset test: background ncurses testaddch +bkgrnd test: ncurses +bkgrndset test: ncurses +boolcodes test: demo_termcap test_arrays progs: dump_entry +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_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 +chgat test: chgat +clear test: blue bs gdc ncurses 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 +color_content_sp - +color_set test: color_set ncurses +copywin test: ncurses testcurs +cur_term test: demo_terminfo dots dots_mvcur lrtest 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 +def_prog_mode test: bs ncurses +def_prog_mode_sp lib: ncurses +def_shell_mode - +def_shell_mode_sp lib: ncurses +define_key test: demo_altkeys demo_defkey foldkeys +define_key_sp - +del_curterm lib: ncurses +del_curterm_sp lib: ncurses +delay_output test: newdemo +delay_output_sp - +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 +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_sp lib: ncurses +dupwin test: edit_field +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_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 - +filter test: filter +filter_sp - +flash test: cardfile lrtest ncurses tclock testcurs +flash_sp - +flushinp test: ncurses newdemo testcurs +flushinp_sp lib: ncurses +get_escdelay - +get_escdelay_sp - +get_wch - +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 +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 +getmouse_sp - +getn_wstr test: test_get_wstr +getnstr test: filter ncurses test_getstr +getparx test: movewindow +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 +has_colors_sp lib: ncurses +has_ic test: lrtest +has_ic_sp lib: ncurses +has_il - +has_il_sp lib: ncurses +has_key - +has_key_sp lib: ncurses +has_mouse - +has_mouse_sp - +hline test: gdc ncurses +hline_set - +idcok test: test_opaque +idlok test: ncurses test_opaque testscanw view +immedok test: test_opaque +in_wch test: inch_wide +in_wchnstr test: inch_wide +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_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 +innstr test: test_instr +innwstr test: test_inwstr +ins_nwstr test: ins_wide +ins_wch test: ins_wide +ins_wstr test: ins_wide +insch test: ins_wide inserts +insdelln test: insdelln +insertln test: insdelln +insnstr test: inserts +insstr test: inserts +instr test: test_instr +intrflush test: demo_forms movewindow +intrflush_sp - +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_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_subwin - +is_syncok test: test_opaque +is_term_resized - +is_term_resized_sp - +is_wintouched lib: ncurses +isendwin - +isendwin_sp - +key_defined test: demo_defkey foldkeys +key_defined_sp lib: ncurses +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 testcurs view progs: tic +keyname_sp lib: ncurses +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 - +leaveok test: hanoi test_opaque +longname test: testcurs progs: tput +mcprint - +mcprint_sp - +meta test: key_names keynames ncurses +mouse_trafo - +mouseinterval - +mouseinterval_sp - +mousemask test: bs demo_forms demo_menus knight movewindow ncurses +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 +mvadd_wch test: ncurses test_add_wchstr test_addwstr +mvadd_wchnstr test: test_add_wchstr +mvadd_wchstr test: test_add_wchstr +mvaddch test: bs gdc hanoi lrtest ncurses rain tclock test_add_wchstr test_addchstr test_addstr test_addwstr xmas +mvaddchnstr test: gdc test_addchstr +mvaddchstr test: test_addchstr +mvaddnstr test: test_addstr +mvaddnwstr test: test_addwstr +mvaddstr test: bs demo_forms gdc hanoi knight ncurses rain tclock test_addstr testcurs xmas +mvaddwstr test: test_addwstr +mvchgat test: chgat +mvcur test: dots_mvcur redraw +mvcur_sp lib: ncurses +mvdelch - +mvderwin test: movewindow +mvget_wch - +mvget_wstr test: test_get_wstr +mvgetch - +mvgetn_wstr test: test_get_wstr +mvgetnstr test: test_getstr +mvgetstr test: test_getstr +mvhline test: ncurses +mvhline_set test: ncurses +mvin_wch test: inch_wide +mvin_wchnstr test: inch_wide +mvin_wchstr test: inch_wide +mvinch test: inchs +mvinchnstr test: gdc inchs +mvinchstr test: inchs +mvinnstr test: test_instr +mvinnwstr test: test_inwstr +mvins_nwstr test: ins_wide +mvins_wch test: ins_wide +mvins_wstr test: ins_wide +mvinsch test: ins_wide inserts +mvinsnstr test: inserts +mvinsstr test: inserts +mvinstr test: test_instr +mvinwstr test: test_inwstr +mvprintw test: bs demo_menus firework hanoi ncurses 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 +mvwaddchnstr test: test_addchstr +mvwaddchstr test: inchs test_addchstr +mvwaddnstr test: newdemo test_addstr testcurs +mvwaddnwstr test: test_addwstr +mvwaddstr test: ditto firstlast ins_wide inserts knight ncurses newdemo test_addstr test_addwstr test_instr testcurs xmas +mvwaddwstr test: test_addwstr test_inwstr +mvwchgat test: chgat +mvwdelch test: ncurses +mvwget_wch - +mvwget_wstr test: test_get_wstr +mvwgetch test: inch_wide inchs test_get_wstr test_getstr test_instr test_inwstr test_opaque +mvwgetn_wstr test: test_get_wstr +mvwgetnstr test: test_getstr +mvwgetstr test: test_getstr +mvwhline test: movewindow +mvwhline_set - +mvwin test: cardfile demo_menus movewindow testcurs xmas +mvwin_wch test: inch_wide +mvwin_wchnstr test: inch_wide +mvwin_wchstr test: inch_wide +mvwinch test: inchs newdemo testcurs +mvwinchnstr test: inchs +mvwinchstr test: inchs +mvwinnstr test: test_instr testcurs +mvwinnwstr test: test_inwstr +mvwins_nwstr test: ins_wide +mvwins_wch test: ins_wide +mvwins_wstr test: ins_wide +mvwinsch test: ins_wide inserts +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 +mvwscanw test: testcurs +mvwvline test: ins_wide inserts movewindow 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 +newpad_sp lib: ncurses +newscr lib: ncurses +newterm test: demo_altkeys ditto dots_mvcur filter foldkeys gdc key_names keynames +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_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 +noecho_sp lib: ncurses +nofilter - +nofilter_sp - +nonl test: bs demo_forms hashtest movewindow ncurses view worm xmas +nonl_sp lib: ncurses +noqiflush - +noqiflush_sp - +noraw test: demo_forms demo_menus ncurses testcurs +noraw_sp lib: ncurses +notimeout test: 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 +overlay test: ncurses testcurs xmas +overwrite test: ncurses savescreen +pair_content test: background color_set +pair_content_sp lib: ncurses +pecho_wchar - +pechochar - +pnoutrefresh test: edit_field ncurses +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 lib: ncurses +putwin test: ncurses +qiflush - +qiflush_sp - +raw test: demo_forms ncurses redraw testcurs +raw_sp lib: ncurses +redrawwin test: redraw +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 +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 +resetty - +resetty_sp - +resize_term test: view +resize_term_sp - +resizeterm - +resizeterm_sp lib: ncurses +restartterm - +restartterm_sp - +ripoffline test: demo_menus ncurses +ripoffline_sp - +savetty - +savetty_sp - +scanw test: testcurs testscanw +scr_dump test: savescreen +scr_init test: savescreen +scr_init_sp - +scr_restore test: savescreen +scr_restore_sp - +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 - +set_escdelay test: test_opaque +set_escdelay_sp lib: ncurses +set_tabsize test: test_opaque +set_tabsize_sp - +set_term lib: ncurses +setcchar test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view +setscrreg test: view +setupterm test: demo_termcap demo_terminfo dots progs: clear tabs tput tset +slk_attr - +slk_attr_off - +slk_attr_on - +slk_attr_set test: ncurses +slk_attr_set_sp - +slk_attr_sp - +slk_attroff lib: ncurses +slk_attroff_sp - +slk_attron lib: ncurses +slk_attron_sp - +slk_attrset test: ncurses +slk_attrset_sp - +slk_clear test: ncurses +slk_clear_sp - +slk_color test: ncurses +slk_color_sp - +slk_init test: ncurses +slk_init_sp - +slk_label test: ncurses +slk_label_sp - +slk_noutrefresh test: 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_sp - +slk_touch test: 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_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 +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 +subpad test: testcurs +subwin test: movewindow ncurses newdemo testcurs +syncok test: test_opaque +term_attrs test: ncurses +term_attrs_sp - +termattrs test: ncurses testcurs +termattrs_sp lib: ncurses +termname test: testcurs +termname_sp lib: ncurses +tgetent test: demo_termcap railroad +tgetent_sp - +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: tput +tigetflag_sp - +tigetnum test: demo_terminfo ncurses progs: tput +tigetnum_sp - +tigetstr test: blue demo_defkey demo_terminfo foldkeys testcurs progs: tput +tigetstr_sp - +timeout test: 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 progs: clear tabs tset +tputs_sp lib: ncurses +trace test: demo_menus hanoi hashtest lrtest ncurses testcurs view worm +ttytype lib: ncurses +typeahead test: testcurs +typeahead_sp lib: ncurses +unctrl test: ncurses redraw test_add_wchstr test_addchstr testcurs +unctrl_sp lib: ncurses +unget_wch - +unget_wch_sp - +ungetch test: bs knight +ungetch_sp lib: ncurses +ungetmouse - +ungetmouse_sp - +untouchwin lib: form +use_default_colors test: filter firework gdc hanoi knight ncurses rain tclock worm xmas +use_default_colors_sp - +use_env progs: tput +use_env_sp - +use_extended_names test: demo_terminfo progs: infocmp tic +use_legacy_coding - +use_legacy_coding_sp - +use_screen test: ditto +use_window test: rain worm +vid_attr - +vid_attr_sp - +vid_puts - +vid_puts_sp - +vidattr - +vidattr_sp lib: ncurses +vidputs - +vidputs_sp lib: ncurses +vline test: gdc ncurses +vline_set - +vw_printw test: clip_printw +vw_scanw - +vwprintw test: movewindow +vwscanw lib: ncurses +wadd_wch test: inch_wide test_add_wchstr test_addwstr +wadd_wchnstr test: 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 +waddchnstr test: test_addchstr +waddchstr test: test_addchstr +waddnstr test: 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 - +wattr_off lib: ncurses +wattr_on lib: ncurses +wattr_set - +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 +wbkgdset test: demo_panels ins_wide inserts ncurses test_add_wchstr test_addchstr test_addstr test_addwstr +wbkgrnd lib: ncurses +wbkgrndset lib: ncurses +wborder test: ncurses +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 +wcolor_set lib: ncurses +wcursyncup lib: form +wdelch test: ncurses testcurs +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 +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 +wgetn_wstr test: ncurses test_get_wstr +wgetnstr test: ncurses test_getstr +wgetparent test: test_opaque +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_wchstr test: inch_wide +winch test: inchs knight testcurs +winchnstr test: inchs +winchstr test: inchs +winnstr test: demo_altkeys demo_defkey foldkeys test_instr +winnwstr test: test_inwstr +wins_nwstr test: ins_wide +wins_wch test: ins_wide +wins_wstr test: ins_wide +winsch test: ins_wide inserts testcurs +winsdelln test: insdelln +winsertln test: insdelln testcurs +winsnstr test: inserts +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 +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 +wscanw test: testcurs +wscrl test: ncurses testcurs +wsetscrreg test: ncurses testcurs +wstandend test: ncurses test_opaque xmas +wstandout test: ncurses test_opaque xmas +wsyncdown test: movewindow +wsyncup lib: form +wtimeout test: ncurses +wtouchln lib: ncurses +wunctrl lib: ncurses +wunctrl_sp - +wvline test: testcurs +wvline_set lib: ncurses + +libpanel: +-------- +bottom_panel test: demo_panels ncurses +ceiling_panel - +del_panel test: demo_panels ncurses +ground_panel - +hide_panel test: demo_panels ncurses +move_panel test: demo_panels ncurses +new_panel test: cardfile demo_panels ncurses +panel_above test: demo_panels +panel_below test: demo_panels +panel_hidden test: demo_panels +panel_userptr test: demo_panels ncurses +panel_window test: cardfile demo_panels ncurses +replace_panel test: demo_panels +set_panel_userptr test: demo_panels ncurses +show_panel test: demo_panels ncurses +top_panel test: cardfile demo_panels ncurses +update_panels test: cardfile demo_panels ncurses +update_panels_sp - diff --git a/test/aclocal.m4 b/test/aclocal.m4 new file mode 100644 index 00000000000..41641b507f5 --- /dev/null +++ b/test/aclocal.m4 @@ -0,0 +1,3111 @@ +dnl*************************************************************************** +dnl Copyright (c) 2003-2010,2011 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl $Id: aclocal.m4,v 1.49 2011/01/15 23:47:10 tom Exp $ +dnl +dnl Author: Thomas E. Dickey +dnl +dnl Macros used in NCURSES test programs auto-configuration script. +dnl +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 +dnl --------------------------------------------------------------------------- +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 +dnl ------------- +dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. +dnl +dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, +dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily +dnl confused by the quotes (which require backslashes to keep them usable). +AC_DEFUN([CF_ADD_CFLAGS], +[ +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + CFLAGS="$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" +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" +fi + +AC_SUBST(EXTRA_CPPFLAGS) + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 +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, +dnl but old versions (and some misinstalled ones) need that. To make things +dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to +dnl the include-path). +AC_DEFUN([CF_ADD_INCDIR], +[ +if test -n "$1" ; then + for cf_add_incdir in $1 + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + AC_TRY_COMPILE([#include ], + [printf("Hello")], + [], + [cf_have_incdir=yes]) + CPPFLAGS=$cf_save_CPPFLAGS + fi + fi + fi + + if test "$cf_have_incdir" = no ; then + CF_VERBOSE(adding $cf_add_incdir to include-path) + ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -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 + fi + done + done +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 +dnl ---------- +dnl Add a library, used to enforce consistency. +dnl +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 ------------- +dnl Adds to the library-path +dnl +dnl Some machines have trouble with multiple -L options. +dnl +dnl $1 is the (list of) directory(s) to add +dnl $2 is the optional name of the variable to update (default LDFLAGS) +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 +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl ----------- +dnl Add one or more libraries, used to enforce consistency. +dnl +dnl $1 = libraries to add, with the "-l", etc. +dnl $2 = variable to update (default $LIBS) +AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIB_AFTER version: 2 updated: 2010/11/08 20:33:46 +dnl ---------------- +dnl Add a given library after another, e.g., following the one it satisfies a +dnl dependency for. +dnl +dnl $1 = the first library +dnl $2 = its dependency +AC_DEFUN([CF_ADD_LIB_AFTER],[ +CF_VERBOSE(...before $LIBS) +LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s,$1 ,$1 $2 ," -e 's/ / /g'` +CF_VERBOSE(...after $LIBS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 +dnl ------------------ +dnl Append to a search-list for a nonstandard header/lib-file +dnl $1 = the variable to return as result +dnl $2 = the package name +dnl $3 = the subdirectory, e.g., bin, include or lib +dnl $4 = the directory under which we will test for subdirectories +dnl $5 = a directory that we do not want $4 to match +AC_DEFUN([CF_ADD_SUBDIR_PATH], +[ +test "$4" != "$5" && \ +test -d "$4" && \ +ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { + test -n "$verbose" && echo " ... testing for $3-directories under $4" + test -d $4/$3 && $1="[$]$1 $4/$3" + test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" + test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" + test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" + test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" +} +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 +dnl ---------------- +dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' +dnl in the sharutils 4.2 distribution. +AC_DEFUN([CF_ANSI_CC_CHECK], +[ +AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + -Ae \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +do + CF_ADD_CFLAGS($cf_arg) + AC_TRY_COMPILE( +[ +#ifndef CC_HAS_PROTOS +#if !defined(__STDC__) || (__STDC__ != 1) +choke me +#endif +#endif +],[ + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);};], + [cf_cv_ansi_cc="$cf_arg"; break]) +done +CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" +]) + +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + CF_ADD_CFLAGS($cf_cv_ansi_cc) +else + AC_DEFINE(CC_HAS_PROTOS) +fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 +dnl --------------- +dnl For programs that must use an ANSI compiler, obtain compiler options that +dnl will make it recognize prototypes. We'll do preprocessor checks in other +dnl macros, since tools such as unproto can fake prototypes, but only part of +dnl the preprocessor. +AC_DEFUN([CF_ANSI_CC_REQD], +[AC_REQUIRE([CF_ANSI_CC_CHECK]) +if test "$cf_cv_ansi_cc" = "no"; then + AC_MSG_ERROR( +[Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto]) +fi +])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. +AC_DEFUN([CF_ARG_DISABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 +dnl ------------- +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 ------------- +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus +dnl values. +dnl +dnl Parameters: +dnl $1 = option name +dnl $2 = help-string +dnl $3 = action to perform if option is not default +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 +ifelse([$3],,[ :]dnl +,[ $3]) ifelse([$4],,,[ + else + $4]) + fi],[enableval=$5 ifelse([$4],,,[ + $4 +])dnl + ])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 +dnl -------------- +dnl Check if we're accidentally using a cache from a different machine. +dnl Derive the system name, as a check for reusing the autoconf cache. +dnl +dnl If we've packaged config.guess and config.sub, run that (since it does a +dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow +dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM +dnl which is useful in cross-compiles. +dnl +dnl Note: we would use $ac_config_sub, but that is one of the places where +dnl autoconf 2.5x broke compatibility with autoconf 2.13 +AC_DEFUN([CF_CHECK_CACHE], +[ +if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then + ifelse([$1],,[AC_CANONICAL_HOST],[$1]) + system_name="$host_os" +else + system_name="`(uname -s -r) 2>/dev/null`" + if test -z "$system_name" ; then + system_name="`(hostname) 2>/dev/null`" + fi +fi +test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") +AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) + +test -z "$system_name" && system_name="$cf_cv_system_name" +test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) + +if test ".$system_name" != ".$cf_cv_system_name" ; then + AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) + AC_MSG_ERROR("Please remove config.cache and try again.") +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58 +dnl --------------- +dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from +dnl a build-configuration such as imake. These have the pitfall that they +dnl often contain compiler-specific options which we cannot use, mixed with +dnl preprocessor options that we usually can. +AC_DEFUN([CF_CHECK_CFLAGS], +[ +CF_VERBOSE(checking additions to CFLAGS) +cf_check_cflags="$CFLAGS" +cf_check_cppflags="$CPPFLAGS" +CF_ADD_CFLAGS($1,yes) +if test "$cf_check_cflags" != "$CFLAGS" ; then +AC_TRY_LINK([#include ],[printf("Hello world");],, + [CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS) + if test "$cf_check_cppflags" != "$CPPFLAGS" ; then + CF_VERBOSE(but keeping change to \$CPPFLAGS) + fi + CFLAGS="$cf_check_flags"]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_ACS_MAP version: 6 updated: 2010/10/23 15:54:49 +dnl ----------------- +dnl Check for likely values of acs_map[]: +AC_DEFUN([CF_CURSES_ACS_MAP], +[ +AC_REQUIRE([CF_NCURSES_WRAP_PREFIX])dnl +AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[ +cf_cv_curses_acs_map=unknown +for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map +do +AC_TRY_LINK([ +#include <${cf_cv_ncurses_header:-curses.h}> +],[ +$name['k'] = ACS_PLUS +],[cf_cv_curses_acs_map=$name; break]) +done +]) + +test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map) +]) +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_CHECK_DATA version: 4 updated: 2011/01/15 16:39:24 +dnl -------------------- +dnl Check if curses.h defines the given data/variable. +dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG. +AC_DEFUN([CF_CURSES_CHECK_DATA], +[ +AC_MSG_CHECKING(for data $1 declaration in ${cf_cv_ncurses_header:-curses.h}) + +AC_TRY_COMPILE(CF__CURSES_HEAD,[ +void *foo = &($1) +],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) + AC_DEFINE_UNQUOTED($cf_result) +else + AC_MSG_CHECKING(for data $1 in library) + # BSD linkers insist on making weak linkage, but resolve at runtime. + AC_TRY_RUN(CF__CURSES_HEAD +[ +extern char $1; +int main(void) +{ + void *foo = &($1); + ${cf_cv_main_return:-return}(foo == 0); +}],[cf_result=yes],[cf_result=no],[ + # cross-compiling + AC_TRY_LINK(CF__CURSES_HEAD +[extern char $1;],[ + do { + void *foo = &($1); + ${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) + AC_DEFINE_UNQUOTED($cf_result) + fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_CHECK_TYPE version: 3 updated: 2010/10/23 15:54:49 +dnl -------------------- +dnl Check if curses.h defines the given type +AC_DEFUN([CF_CURSES_CHECK_TYPE], +[ +AC_MSG_CHECKING(for type $1 in ${cf_cv_ncurses_header:-curses.h}) +AC_TRY_COMPILE([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}>],[ +$1 foo +],cf_result=yes,cf_result=no) +AC_MSG_RESULT($cf_result) +if test $cf_result = yes ; then + CF_UPPER(cf_result,have_type_$1) + AC_DEFINE_UNQUOTED($cf_result) +else + AC_DEFINE_UNQUOTED($1,$2) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27 +dnl ---------------- +dnl Tie together the configure-script macros for curses. It may be ncurses, +dnl but unless asked, we do not make a special search for ncurses. However, +dnl still check for the ncurses version number, for use in other macros. +AC_DEFUN([CF_CURSES_CONFIG], +[ +CF_CURSES_CPPFLAGS +CF_NCURSES_VERSION +CF_CURSES_LIBS +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11 +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 + test -d /usr/include/curses_colr && \ + cf_cv_curses_incdir="-I/usr/include/curses_colr" + ;; +sunos3*|sunos4*) + test -d /usr/5lib && \ + test -d /usr/5include && \ + cf_cv_curses_incdir="-I/usr/5include" + ;; +esac +]) +test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir" + +CF_CURSES_HEADER +CF_TERM_HEADER +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_FUNCS version: 15 updated: 2010/10/23 15:52:32 +dnl --------------- +dnl Curses-functions are a little complicated, since a lot of them are macros. +AC_DEFUN([CF_CURSES_FUNCS], +[ +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +AC_REQUIRE([CF_XOPEN_CURSES]) +AC_REQUIRE([CF_CURSES_TERM_H]) +for cf_func in $1 +do + CF_UPPER(cf_tr_func,$cf_func) + AC_MSG_CHECKING(for ${cf_func}) + CF_MSG_LOG(${cf_func}) + AC_CACHE_VAL(cf_cv_func_$cf_func,[ + eval cf_result='$ac_cv_func_'$cf_func + if test ".$cf_result" != ".no"; then + AC_TRY_LINK(CF__CURSES_HEAD, + [ +#ifndef ${cf_func} +long foo = (long)(&${cf_func}); +${cf_cv_main_return:-return}(foo == 0); +#endif + ], + [cf_result=yes], + [cf_result=no]) + fi + eval 'cf_cv_func_'$cf_func'=$cf_result' + ]) + # use the computed/retrieved cache-value: + eval 'cf_result=$cf_cv_func_'$cf_func + AC_MSG_RESULT($cf_result) + if test $cf_result != no; then + AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func}) + fi +done +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16 +dnl ---------------- +dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common +dnl variations of ncurses' installs. +dnl +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/curses.h \ + $1/ncurses.h]) \ + curses.h \ + ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h]) +do +AC_TRY_COMPILE([#include <${cf_header}>], + [initscr(); tgoto("?", 0,0)], + [cf_cv_ncurses_header=$cf_header; break],[]) +done +]) + +if test "$cf_cv_ncurses_header" = none ; then + AC_MSG_ERROR(No curses header-files found) +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. +AC_CHECK_HEADERS($cf_cv_ncurses_header) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_LIBS version: 31 updated: 2010/10/23 15:54:49 +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. +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) +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 + AC_CHECK_LIB(cur_colr,initscr,[ + CF_ADD_LIBS(-lcur_colr) + ac_cv_func_initscr=yes + ],[ + 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" + ac_cv_func_initscr=yes + ])]) + ;; +linux*) # Suse Linux does not follow /usr/lib convention + CF_ADD_LIBDIR(/lib) + ;; +sunos3*|sunos4*) + if test -d /usr/5lib ; then + CF_ADD_LIBDIR(/usr/5lib) + CF_ADD_LIBS(-lcurses -ltermcap) + fi + ac_cv_func_initscr=yes + ;; +esac + +if test ".$ac_cv_func_initscr" != .yes ; then + cf_save_LIBS="$LIBS" + cf_term_lib="" + cf_curs_lib="" + + if test ".${cf_cv_ncurses_version:-no}" != .no + then + cf_check_list="ncurses curses cursesX" + else + cf_check_list="cursesX curses ncurses" + fi + + # Check for library containing tgoto. Do this before curses library + # because it may be needed to link the test-case for initscr. + AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ + for cf_term_lib in $cf_check_list termcap termlib unknown + do + AC_CHECK_LIB($cf_term_lib,tgoto,[break]) + done + ]) + + # Check for library containing initscr + test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" + for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown + do + AC_CHECK_LIB($cf_curs_lib,initscr,[break]) + done + 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: 8 updated: 2010/10/23 15:54:49 +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, +dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4 +dnl running with Solaris 2.5.1). +AC_DEFUN([CF_CURSES_TERM_H], +[ +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl + +AC_CACHE_CHECK(for term.h, cf_cv_term_header,[ + +# If we found , look for , but always look +# for if we do not find the variant. +for cf_header in \ + `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \ + term.h +do + AC_TRY_COMPILE([ +#include <${cf_cv_ncurses_header:-curses.h}> +#include <${cf_header}>], + [WINDOW *x], + [cf_cv_term_header=$cf_header + break], + [cf_cv_term_header=no]) +done + +case $cf_cv_term_header in #(vi +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 + AC_TRY_COMPILE([ +#include <${cf_cv_ncurses_header:-curses.h}> +#ifdef NCURSES_VERSION +#include <${cf_header}> +#else +make an error +#endif], + [WINDOW *x], + [cf_cv_term_header=$cf_header + break], + [cf_cv_term_header=no]) + done + ;; +esac +]) + +case $cf_cv_term_header in #(vi +term.h) #(vi + AC_DEFINE(HAVE_TERM_H) + ;; +ncurses/term.h) #(vi + AC_DEFINE(HAVE_NCURSES_TERM_H) + ;; +ncursesw/term.h) + AC_DEFINE(HAVE_NCURSESW_TERM_H) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59 +dnl ------------------ +dnl Check for likely values of wacs_map[]. +AC_DEFUN([CF_CURSES_WACS_MAP], +[ +AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[ + cf_cv_curses_wacs_map=unknown + for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char + do + AC_TRY_LINK([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}>], + [void *foo = &($name['k'])], + [cf_cv_curses_wacs_map=$name + break]) + done]) + +test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_CURSES_WACS_SYMBOLS version: 1 updated: 2011/01/15 11:28:59 +dnl ---------------------- +dnl Do a check to see if the WACS_xxx constants are defined compatibly with +dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx +dnl constants is broken since those constants do not point to cchar_t's. +AC_DEFUN([CF_CURSES_WACS_SYMBOLS], +[ +AC_REQUIRE([CF_CURSES_WACS_MAP]) + +AC_CACHE_CHECK(for wide alternate character constants, cf_cv_curses_wacs_symbols,[ +cf_cv_curses_wacs_symbols=no +if test "$cf_cv_curses_wacs_map" != unknown +then + AC_TRY_LINK([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}>], + [cchar_t *foo = WACS_PLUS; + $cf_cv_curses_wacs_map['k'] = *WACS_PLUS], + [cf_cv_curses_wacs_symbols=yes]) +else + AC_TRY_LINK([ +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}>], + [cchar_t *foo = WACS_PLUS], + [cf_cv_curses_wacs_symbols=yes]) +fi +]) + +test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 +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: 11 updated: 2009/12/13 13:16: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. +dnl +dnl Sets: +dnl ECHO_LT - symbol to control if libtool is verbose +dnl ECHO_LD - symbol to prefix "cc -o" lines +dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) +dnl SHOW_CC - symbol to put before explicit "cc -c" lines +dnl ECHO_CC - symbol to put before any "cc" line +dnl +AC_DEFUN([CF_DISABLE_ECHO],[ +AC_MSG_CHECKING(if you want to see long compiling messages) +CF_ARG_DISABLE(echo, + [ --disable-echo display "compiling" commands], + [ + 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='' +]) +AC_MSG_RESULT($enableval) +AC_SUBST(ECHO_LT) +AC_SUBST(ECHO_LD) +AC_SUBST(RULE_CC) +AC_SUBST(SHOW_CC) +AC_SUBST(ECHO_CC) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 +dnl ---------------- +dnl Combine no-leak checks with the libraries or tools that are used for the +dnl checks. +AC_DEFUN([CF_DISABLE_LEAKS],[ + +AC_REQUIRE([CF_WITH_DMALLOC]) +AC_REQUIRE([CF_WITH_DBMALLOC]) +AC_REQUIRE([CF_WITH_VALGRIND]) + +AC_MSG_CHECKING(if you want to perform memory-leak testing) +AC_ARG_ENABLE(leaks, + [ --disable-leaks test: free permanent memory, analyze leaks], + [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], + : ${with_no_leaks:=no}) +AC_MSG_RESULT($with_no_leaks) + +if test "$with_no_leaks" = yes ; then + AC_DEFINE(NO_LEAKS) + AC_DEFINE(YY_NO_LEAKS) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03 +dnl ------------------ +dnl Configure-option to enable gcc warnings +AC_DEFUN([CF_ENABLE_WARNINGS],[ +if ( test "$GCC" = yes || test "$GXX" = yes ) +then +AC_MSG_CHECKING(if you want to turn on gcc warnings) +CF_ARG_ENABLE(warnings, + [ --enable-warnings test: turn on gcc compiler warnings], + [with_warnings=yes], + [with_warnings=no]) +AC_MSG_RESULT($with_warnings) +if test "$with_warnings" = "yes" +then + CF_GCC_ATTRIBUTES + CF_GCC_WARNINGS +fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 +dnl --------------- +dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We +dnl prefer a standard location, and use -L options only if we do not find the +dnl library in the standard library location(s). +dnl $1 = library name +dnl $2 = library class, usually the same as library name +dnl $3 = includes +dnl $4 = code fragment to compile/link +dnl $5 = corresponding function-name +dnl $6 = flag, nonnull if failure should not cause an error-exit +dnl +dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had +dnl to use a -L option. +AC_DEFUN([CF_FIND_LIBRARY], +[ + eval 'cf_cv_have_lib_'$1'=no' + cf_libdir="" + AC_CHECK_FUNC($5, + eval 'cf_cv_have_lib_'$1'=yes',[ + cf_save_LIBS="$LIBS" + AC_MSG_CHECKING(for $5 in -l$1) + LIBS="-l$1 $LIBS" + AC_TRY_LINK([$3],[$4], + [AC_MSG_RESULT(yes) + eval 'cf_cv_have_lib_'$1'=yes' + ], + [AC_MSG_RESULT(no) + CF_LIBRARY_PATH(cf_search,$2) + for cf_libdir in $cf_search + do + AC_MSG_CHECKING(for -l$1 in $cf_libdir) + LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" + AC_TRY_LINK([$3],[$4], + [AC_MSG_RESULT(yes) + eval 'cf_cv_have_lib_'$1'=yes' + break], + [AC_MSG_RESULT(no) + LIBS="$cf_save_LIBS"]) + done + ]) + ]) +eval 'cf_found_library=[$]cf_cv_have_lib_'$1 +ifelse($6,,[ +if test $cf_found_library = no ; then + AC_MSG_ERROR(Cannot link $1 library) +fi +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 +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. +dnl See also CF_ADD_SEARCHPATH. +dnl +dnl Parameters (4-on are optional): +dnl $1 = headers for library entrypoint +dnl $2 = code fragment for library entrypoint +dnl $3 = the library name without the "-l" option or ".so" suffix. +dnl $4 = action to perform if successful (default: update CPPFLAGS, etc) +dnl $5 = action to perform if not successful +dnl $6 = module name, if not the same as the library name +dnl $7 = extra libraries +dnl +dnl Sets these variables: +dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found +dnl $cf_cv_header_path_$3 - include-directory if needed +dnl $cf_cv_library_path_$3 - library-directory if needed +dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 +AC_DEFUN([CF_FIND_LINKAGE],[ + +# 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_$3= +cf_cv_library_path_$3= + +CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) + +cf_save_LIBS="$LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib +],[ + +LIBS="-l$3 $7 $cf_save_LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib + cf_cv_library_file_$3="-l$3" +],[ + 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) +]) + +LIBS="$cf_save_LIBS" + +if test "$cf_cv_find_linkage_$3" = yes ; then +ifelse([$4],,[ + CF_ADD_INCDIR($cf_cv_header_path_$3) + CF_ADD_LIBDIR($cf_cv_library_path_$3) + CF_ADD_LIB($3) +],[$4]) +else +ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_FUNC_CURSES_VERSION version: 5 updated: 2010/10/23 15:54:49 +dnl ---------------------- +dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS. +dnl It's a character string "SVR4", not documented. +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() +{ + char temp[1024]; + sprintf(temp, "%s\n", curses_version()); + ${cf_cv_main_return:-return}(0); +}] +,[cf_cv_func_curses_version=yes] +,[cf_cv_func_curses_version=no] +,[cf_cv_func_curses_version=unknown]) +rm -f core]) +test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION) +]) +dnl --------------------------------------------------------------------------- +dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 +dnl ----------------- +dnl Test for availability of useful gcc __attribute__ directives to quiet +dnl compiler warnings. Though useful, not all are supported -- and contrary +dnl to documentation, unrecognized directives cause older compilers to barf. +AC_DEFUN([CF_GCC_ATTRIBUTES], +[ +if test "$GCC" = yes +then +cat > conftest.i < conftest.$ac_ext <&AC_FD_CC + + case $cf_attribute in #(vi + printf) #(vi + cf_printf_attribute=yes + cat >conftest.h <conftest.h <conftest.h <>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h +fi +rm -rf conftest* +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31 +dnl -------------- +dnl Find version of gcc +AC_DEFUN([CF_GCC_VERSION],[ +AC_REQUIRE([AC_PROG_CC]) +GCC_VERSION=none +if test "$GCC" = yes ; then + AC_MSG_CHECKING(version of $CC) + GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + test -z "$GCC_VERSION" && GCC_VERSION=unknown + AC_MSG_RESULT($GCC_VERSION) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32 +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 -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 +dnl is enabled for ncurses using "--enable-const". +dnl -pedantic +dnl +dnl Parameter: +dnl $1 is an optional list of gcc warning flags that a particular +dnl application might want to use, e.g., "no-unused" for +dnl -Wno-unused +dnl Special: +dnl If $with_ext_const is "yes", add a check for -Wwrite-strings +dnl +AC_DEFUN([CF_GCC_WARNINGS], +[ +AC_REQUIRE([CF_GCC_VERSION]) +CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) + +cat > conftest.$ac_ext <],[ +#ifndef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_gnu_source=no], + [cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" + AC_TRY_COMPILE([#include ],[ +#ifdef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_gnu_source=no], + [cf_cv_gnu_source=yes]) + CPPFLAGS="$cf_save" + ]) +]) +test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 +dnl -------------- +dnl Construct a search-list of directories for a nonstandard header-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name +AC_DEFUN([CF_HEADER_PATH], +[ +$1= + +# 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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) + cf_header_path_list="$cf_header_path_list [$]$1" + ;; + esac + done +fi + +# add the variations for the package we are looking for +CF_SUBDIR_PATH($1,$2,include) + +test "$includedir" != NONE && \ +test "$includedir" != "/usr/include" && \ +test -d "$includedir" && { + test -d $includedir && $1="[$]$1 $includedir" + test -d $includedir/$2 && $1="[$]$1 $includedir/$2" +} + +test "$oldincludedir" != NONE && \ +test "$oldincludedir" != "/usr/include" && \ +test -d "$oldincludedir" && { + test -d $oldincludedir && $1="[$]$1 $oldincludedir" + test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" +} + +$1="[$]$1 $cf_header_path_list" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42 +dnl ----------------- +dnl If we do not have a given script, look for it in the parent directory. +AC_DEFUN([CF_INHERIT_SCRIPT], +[ +test -f $1 || ( test -f ../$1 && cp ../$1 ./ ) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 +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 +dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. +dnl +dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to +dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from +dnl the wrappers for gcc and g++ warnings. +dnl +dnl $1 = GCC (default) or GXX +dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $3 = CFLAGS (default) or CXXFLAGS +AC_DEFUN([CF_INTEL_COMPILER],[ +ifelse([$2],,INTEL_COMPILER,[$2])=no + +if test "$ifelse([$1],,[$1],GCC)" = yes ; then + case $host_os in + 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" + AC_TRY_COMPILE([],[ +#ifdef __INTEL_COMPILER +#else +make an error +#endif +],[ifelse([$2],,INTEL_COMPILER,[$2])=yes +cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" +],[]) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) + ;; + esac +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 +dnl --------------- +dnl Construct a search-list of directories for a nonstandard library-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name +AC_DEFUN([CF_LIBRARY_PATH], +[ +$1= +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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) + cf_library_path_list="$cf_library_path_list [$]$1" + ;; + esac + done +fi + +CF_SUBDIR_PATH($1,$2,lib) + +$1="$cf_library_path_list [$]$1" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 +dnl ------------ +dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have +dnl a monocase filesystem. +AC_DEFUN([CF_MAKE_TAGS],[ +AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) + +AC_CHECK_PROGS(CTAGS, exctags ctags) +AC_CHECK_PROGS(ETAGS, exetags etags) + +AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) + +if test "$cf_cv_mixedcase" = yes ; then + AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +else + MAKE_UPPER_TAGS="#" +fi + +if test "$MAKE_LOWER_TAGS" = yes ; then + MAKE_LOWER_TAGS= +else + MAKE_LOWER_TAGS="#" +fi + +AC_SUBST(CTAGS) +AC_SUBST(ETAGS) + +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 ----------- +dnl Checks for libraries. At least one UNIX system, Apple Macintosh +dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler +dnl AC_CHECK_LIB(m,sin), because that fails for C++. +AC_DEFUN([CF_MATH_LIB], +[ +AC_CACHE_CHECK(if -lm needed for math functions, + cf_cv_need_libm,[ + AC_TRY_LINK([ + #include + #include + ], + [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], + [cf_cv_need_libm=no], + [cf_cv_need_libm=yes])]) +if test "$cf_cv_need_libm" = yes +then +ifelse($1,,[ + CF_ADD_LIB(m) +],[$1=-lm]) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_MIN_GETCCHAR version: 3 updated: 2010/10/23 15:54:49 +dnl --------------- +dnl CF_MIN_GETCCHAR +dnl Check whether getcchar's return value counts the trailing null in a wchar_t +dnl string, or not. X/Open says it does, but Tru64 and Solaris do not do this. +AC_DEFUN([CF_MIN_GETCCHAR],[ +AC_CACHE_CHECK(if getcchar counts trailing null,cf_cv_min_getcchar,[ +AC_TRY_RUN([ +#include +#include +#include <${cf_cv_ncurses_header:-curses.h}> + +int main() +{ + wchar_t data[2]; + cchar_t temp[2]; + int count; + data[0] = L'\0'; + setcchar(temp, data, 0, 0, (void *)0); + count = getcchar(temp, (wchar_t *)0, (attr_t *)0, (short *)0, (void *)0); + ${cf_cv_main_return:-return}(count != 0); +}], + [cf_cv_min_getcchar=no], + [cf_cv_min_getcchar=yes], + [cf_cv_min_getcchar=yes]) +]) +if test "$cf_cv_min_getcchar" = yes ; then + AC_DEFINE(MIN_GETCCHAR,1) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55 +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. +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*|*-mingw32*|*-uwin*) #(vi + cf_cv_mixedcase=no + ;; + *) + cf_cv_mixedcase=yes + ;; + esac +else + rm -f conftest CONFTEST + echo test >conftest + if test -f CONFTEST ; then + cf_cv_mixedcase=no + else + cf_cv_mixedcase=yes + fi + rm -f conftest CONFTEST +fi +]) +test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 +dnl ---------- +dnl Write a debug message to config.log, along with the line number in the +dnl configure script. +AC_DEFUN([CF_MSG_LOG],[ +echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 +dnl ------------------- +dnl Check if we can compile with ncurses' header file +dnl $1 is the cache variable to set +dnl $2 is the header-file to include +dnl $3 is the root name (ncurses or ncursesw) +AC_DEFUN([CF_NCURSES_CC_CHECK],[ + AC_TRY_COMPILE([ +]ifelse($3,ncursesw,[ +#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 <$2>],[ +#ifdef NCURSES_VERSION +]ifelse($3,ncursesw,[ +#ifndef WACS_BSSB + make an error +#endif +])[ +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + ] + ,[$1=$2] + ,[$1=no]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30 +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 +dnl $1 is the root library name (default: "ncurses") +AC_DEFUN([CF_NCURSES_CONFIG], +[ +cf_ncuconfig_root=ifelse($1,,ncurses,$1) + +echo "Looking for ${cf_ncuconfig_root}-config" +AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none) + +if test "$NCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$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) + +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 +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38 +dnl ------------------- +dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting +dnl the CPPFLAGS variable so we can include its header. +dnl +dnl The header files may be installed as either curses.h, or ncurses.h (would +dnl be obsolete, except that some packagers prefer this name to distinguish it +dnl from a "native" curses implementation). If not installed for overwrite, +dnl the curses.h file would be in an ncurses subdirectory (e.g., +dnl /usr/include/ncurses), but someone may have installed overwriting the +dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd +dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in +dnl the header. +dnl +dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header +dnl is already in the include-path, don't even bother with this, since we cannot +dnl easily determine which file it is. In this case, it has to be . +dnl +dnl The optional parameter gives the root name of the library, in case it is +dnl not installed as the default curses library. That is how the +dnl wide-character version of ncurses is installed. +AC_DEFUN([CF_NCURSES_CPPFLAGS], +[AC_REQUIRE([CF_WITH_CURSES_DIR]) + +AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl +cf_ncuhdr_root=ifelse($1,,ncurses,$1) + +test -n "$cf_cv_curses_dir" && \ +test "$cf_cv_curses_dir" != "no" && { \ + CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) +} + +AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ + cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" + ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" + for cf_header in $cf_header_list + do + CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) + test "$cf_cv_ncurses_h" != no && break + done +]) + +CF_NCURSES_HEADER +CF_TERM_HEADER + +# some applications need this, but should check for NCURSES_VERSION +AC_DEFINE(NCURSES) + +CF_NCURSES_VERSION +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_EXT_FUNCS version: 3 updated: 2010/11/13 19:43:23 +dnl -------------------- +dnl Since 2007/11/17, ncurses has defined NCURSES_EXT_FUNCS; earlier versions +dnl may provide these functions. Define the symbol if it is not defined, and +dnl if it is valid. +AC_DEFUN([CF_NCURSES_EXT_FUNCS], +[ +AC_CACHE_CHECK(for ncurses extended functions,cf_cv_ncurses_ext_funcs,[ +AC_TRY_COMPILE([ +#include <${cf_cv_ncurses_header:-curses.h}>], +[ +int x = NCURSES_EXT_FUNCS +],[cf_cv_ncurses_ext_funcs=defined],[ +AC_TRY_LINK([ +#include <${cf_cv_ncurses_header:-curses.h}>], +[ + (void) assume_default_colors (0, 0); + (void) curses_version (); + (void) define_key (0, 0); + (void) is_term_resized (0, 0); + (void) key_defined (0); + (void) keybound (0, 0); + (void) keyok (0, 0); + (void) resize_term (0, 0); + (void) resizeterm (0, 0); + (void) use_default_colors (); + (void) use_extended_names (0); + (void) wresize (0, 0, 0);], + [cf_cv_ncurses_ext_funcs=yes], + [cf_cv_ncurses_ext_funcs=no]) +]) +]) +test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54 +dnl ----------------- +dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common +dnl variations of ncurses' installs. +dnl +dnl See also CF_CURSES_HEADER, which sets the same cache variable. +AC_DEFUN([CF_NCURSES_HEADER],[ + +if test "$cf_cv_ncurses_h" != no ; then + cf_cv_ncurses_header=$cf_cv_ncurses_h +else + +AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ + test -n "$verbose" && echo + CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) + test -n "$verbose" && echo search path $cf_search + cf_save2_CPPFLAGS="$CPPFLAGS" + for cf_incdir in $cf_search + do + CF_ADD_INCDIR($cf_incdir) + for cf_header in \ + ncurses.h \ + curses.h + do + CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) + if test "$cf_cv_ncurses_h2" != no ; then + cf_cv_ncurses_h2=$cf_incdir/$cf_header + test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG + break + fi + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG + done + CPPFLAGS="$cf_save2_CPPFLAGS" + test "$cf_cv_ncurses_h2" != no && break + done + test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) + ]) + + CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) + cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` + if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then + cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header + fi + CF_ADD_INCDIR($cf_1st_incdir) + +fi + +# Set definitions to allow ifdef'ing for ncurses.h + +case $cf_cv_ncurses_header in # (vi +*ncurses.h) + AC_DEFINE(HAVE_NCURSES_H) + ;; +esac + +case $cf_cv_ncurses_header in # (vi +ncurses/curses.h|ncurses/ncurses.h) + AC_DEFINE(HAVE_NCURSES_NCURSES_H) + ;; +ncursesw/curses.h|ncursesw/ncurses.h) + AC_DEFINE(HAVE_NCURSESW_NCURSES_H) + ;; +esac + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38 +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. +dnl Some distributions have gpm linked with (bsd) curses, which makes it +dnl unusable with ncurses. However, we don't want to link with gpm unless +dnl ncurses has a dependency, since gpm is normally set up as a shared library, +dnl and the linker will record a dependency. +dnl +dnl The optional parameter gives the root name of the library, in case it is +dnl not installed as the default curses library. That is how the +dnl wide-character version of ncurses is installed. +AC_DEFUN([CF_NCURSES_LIBS], +[AC_REQUIRE([CF_NCURSES_CPPFLAGS]) + +cf_nculib_root=ifelse($1,,ncurses,$1) + # 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" +AC_CHECK_LIB(gpm,Gpm_Open, + [AC_CHECK_LIB(gpm,initscr, + [LIBS="$cf_ncurses_SAVE"], + [cf_ncurses_LIBS="-lgpm"])]) + +case $host_os in #(vi +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 + AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) + fi + ;; +esac + +CF_ADD_LIBS($cf_ncurses_LIBS) + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + CF_ADD_LIBS(-l$cf_nculib_root) +else + CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, + [#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr()], + initscr) +fi + +if test -n "$cf_ncurses_LIBS" ; then + AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) + cf_ncurses_SAVE="$LIBS" + for p in $cf_ncurses_LIBS ; do + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], + [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + LIBS="$cf_ncurses_SAVE"]) +fi + +CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) +AC_DEFINE_UNQUOTED($cf_nculib_ROOT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49 +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 +dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. +AC_DEFUN([CF_NCURSES_VERSION], +[ +AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl +AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + AC_TRY_RUN([ +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +}],[ + cf_cv_ncurses_version=`cat $cf_tempfile`],,[ + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" + AC_TRY_EVAL(cf_try) + if test -f conftest.out ; then + cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi +]) + rm -f $cf_tempfile +]) +test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NCURSES_WRAP_PREFIX version: 1 updated: 2009/03/28 16:08:10 +dnl ---------------------- +dnl Check for ncurses "wrap-prefix" used for public variables which have been +dnl wrapped with a function to help with concurrency control. +AC_DEFUN([CF_NCURSES_WRAP_PREFIX], +[ +AC_MSG_CHECKING(for ncurses wrap-prefix) +AC_ARG_WITH(ncurses-wrap-prefix, + [ --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables], + [NCURSES_WRAP_PREFIX=$withval], + [NCURSES_WRAP_PREFIX=_nc_]) +AC_MSG_RESULT($NCURSES_WRAP_PREFIX) + +AC_SUBST(NCURSES_WRAP_PREFIX) +]) +dnl --------------------------------------------------------------------------- +dnl CF_NETBSD_FORM_H version: 1 updated: 2011/01/15 14:59:18 +dnl ---------------- +dnl Check for NetBSD's form.h, which is incompatible with SVr4 and ncurses. +dnl Some workarounds are needed in client programs to allow them to compile. +AC_DEFUN([CF_NETBSD_FORM_H],[ +AC_CACHE_CHECK(for NetBSD form.h,cf_cv_netbsd_form_h,[ +AC_TRY_COMPILE([ +#include <${cf_cv_ncurses_header:-curses.h}> +#include +],[ + FORM *form; + int y = current_field(form)->cursor_ypos; + int x = current_field(form)->cursor_xpos; +],[cf_cv_netbsd_form_h=yes +],[cf_cv_netbsd_form_h=no]) +]) + +test "$cf_cv_netbsd_form_h" = yes && AC_DEFINE(HAVE_NETBSD_FORM_H) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NETBSD_MENU_H version: 1 updated: 2011/01/15 14:59:18 +dnl ---------------- +dnl Check for NetBSD's menu.h, which is incompatible with SVr4 and ncurses. +dnl Some workarounds are needed in client programs to allow them to compile. +AC_DEFUN([CF_NETBSD_MENU_H],[ +AC_CACHE_CHECK(for NetBSD menu.h,cf_cv_netbsd_menu_h,[ +AC_TRY_COMPILE([ +#include <${cf_cv_ncurses_header:-curses.h}> +#include +],[ + MENU *menu; + int y = menu->max_item_width; +],[cf_cv_netbsd_menu_h=yes +],[cf_cv_netbsd_menu_h=no]) +]) + +test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 +dnl ------------------ +dnl see CF_WITH_NO_LEAKS +AC_DEFUN([CF_NO_LEAKS_OPTION],[ +AC_MSG_CHECKING(if you want to use $1 for testing) +AC_ARG_WITH($1, + [$2], + [AC_DEFINE($3)ifelse([$4],,[ + $4 +]) + : ${with_cflags:=-g} + : ${with_no_leaks:=yes} + with_$1=yes], + [with_$1=]) +AC_MSG_RESULT(${with_$1:-no}) + +case .$with_cflags in #(vi +.*-g*) + case .$CFLAGS in #(vi + .*-g*) #(vi + ;; + *) + CF_ADD_CFLAGS([-g]) + ;; + esac + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 +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 +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" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".[$]$1" in #(vi +.\[$]\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX + ;; +.\[$]{*prefix}*) #(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) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PDCURSES_X11 version: 11 updated: 2011/01/15 18:45:38 +dnl --------------- +dnl Configure for PDCurses' X11 library +AC_DEFUN([CF_PDCURSES_X11],[ +AC_REQUIRE([CF_X_ATHENA]) + +AC_PATH_PROGS(XCURSES_CONFIG,xcurses-config,none) + +if test "$XCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`" +CF_ADD_LIBS(`$XCURSES_CONFIG --libs`) + +cf_cv_lib_XCurses=yes + +else + +LDFLAGS="$LDFLAGS $X_LIBS" +CF_CHECK_CFLAGS($X_CFLAGS) +AC_CHECK_LIB(X11,XOpenDisplay, + [CF_ADD_LIBS(-lX11)],, + [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS]) +AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[ +CF_ADD_LIBS(-lXCurses) +AC_TRY_LINK([ +#include +char *XCursesProgramName = "test"; +],[XCursesExit();], +[cf_cv_lib_XCurses=yes], +[cf_cv_lib_XCurses=no]) +]) + +fi + +if test $cf_cv_lib_XCurses = yes ; then + AC_DEFINE(UNIX) + AC_DEFINE(XCURSES) + AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES)) +else + AC_MSG_ERROR(Cannot link with XCurses) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09 +dnl ------------- +dnl Check for the package-config program, unless disabled by command-line. +AC_DEFUN([CF_PKG_CONFIG], +[ +AC_MSG_CHECKING(if you want to use pkg-config) +AC_ARG_WITH(pkg-config, + [ --with-pkg-config{=path} enable/disable use of pkg-config], + [cf_pkg_config=$withval], + [cf_pkg_config=yes]) +AC_MSG_RESULT($cf_pkg_config) + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + AC_PATH_PROG(PKG_CONFIG, pkg-config, none) + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + CF_PATH_SYNTAX(PKG_CONFIG) +fi + +AC_SUBST(PKG_CONFIG) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 +dnl ----------------- +dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. +dnl +dnl POSIX.1-1990 _POSIX_SOURCE +dnl POSIX.1-1990 and _POSIX_SOURCE and +dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 +dnl Bindings Option +dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L +dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L +dnl X/Open 2000 _POSIX_C_SOURCE=200112L +dnl +dnl Parameters: +dnl $1 is the nominal value for _POSIX_C_SOURCE +AC_DEFUN([CF_POSIX_C_SOURCE], +[ +cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) + +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" + +CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) +CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) + +AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ + CF_MSG_LOG(if the symbol is already defined go no further) + AC_TRY_COMPILE([#include ],[ +#ifndef _POSIX_C_SOURCE +make an error +#endif], + [cf_cv_posix_c_source=no], + [cf_want_posix_source=no + case .$cf_POSIX_C_SOURCE in #(vi + .[[12]]??*) #(vi + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" + ;; + .2) #(vi + 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 + AC_TRY_COMPILE([#include ],[ +#ifdef _POSIX_SOURCE +make an error +#endif],[], + cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") + fi + CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CF_MSG_LOG(if the second compile does not leave our definition intact error) + AC_TRY_COMPILE([#include ],[ +#ifndef _POSIX_C_SOURCE +make an error +#endif],, + [cf_cv_posix_c_source=no]) + CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" + ]) +]) + +if test "$cf_cv_posix_c_source" != no ; then + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS" + CF_ADD_CFLAGS($cf_cv_posix_c_source) +fi + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PRG_RULES version: 1 updated: 2006/06/03 11:45:08 +dnl ------------ +dnl Append definitions and rules for the given programs to the subdirectory +dnl Makefiles, and the recursion rule for the top-level Makefile. +dnl +dnl parameters +dnl $1 = script to run +dnl $2 = list of subdirectories +dnl +dnl variables +dnl $AWK +AC_DEFUN([CF_PRG_RULES], +[ +for cf_dir in $2 +do + if test ! -d $srcdir/$cf_dir; then + continue + elif test -f $srcdir/$cf_dir/programs; then + $AWK -f $1 $srcdir/$cf_dir/programs >>$cf_dir/Makefile + fi +done + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30 +dnl -------------- +dnl Check if C (preprocessor) -U and -D options are processed in the order +dnl given rather than by type of option. Some compilers insist on apply all +dnl of the -U options after all of the -D options. Others allow mixing them, +dnl and may predefine symbols that conflict with those we define. +AC_DEFUN([CF_PROG_CC_U_D], +[ +AC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[ + cf_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" + AC_TRY_COMPILE([],[ +#ifndef U_D_OPTIONS +make an undefined-error +#endif +#ifdef D_U_OPTIONS +make a defined-error +#endif + ],[ + cf_cv_cc_u_d_options=yes],[ + cf_cv_cc_u_d_options=no]) + CPPFLAGS="$cf_save_CPPFLAGS" +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 +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 +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%^.*/%%'` + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 +dnl ------------ +AC_DEFUN([CF_PROG_LINT], +[ +AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) +AC_SUBST(LINT_OPTS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 +dnl ---------------- +dnl Remove all -U and -D options that refer to the given symbol from a list +dnl of C compiler options. This works around the problem that not all +dnl compilers process -U and -D options from left-to-right, so a -U option +dnl cannot be used to cancel the effect of a preceding -D option. +dnl +dnl $1 = target (which could be the same as the source variable) +dnl $2 = source (including '$') +dnl $3 = symbol to remove +define([CF_REMOVE_DEFINE], +[ +$1=`echo "$2" | \ + sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SIG_ATOMIC_T version: 2 updated: 2005/09/18 17:27:12 +dnl --------------- +dnl signal handler, but there are some gcc depedencies in that recommendation. +dnl Try anyway. +AC_DEFUN([CF_SIG_ATOMIC_T], +[ +AC_MSG_CHECKING(for signal global datatype) +AC_CACHE_VAL(cf_cv_sig_atomic_t,[ + for cf_type in \ + "volatile sig_atomic_t" \ + "sig_atomic_t" \ + "int" + do + AC_TRY_COMPILE([ +#include +#include +#include + +extern $cf_type x; +$cf_type x; +static void handler(int sig) +{ + x = 5; +}], + [signal(SIGINT, handler); + x = 1], + [cf_cv_sig_atomic_t=$cf_type], + [cf_cv_sig_atomic_t=no]) + test "$cf_cv_sig_atomic_t" != no && break + done + ]) +AC_MSG_RESULT($cf_cv_sig_atomic_t) +test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 +dnl -------------- +dnl Construct a search-list for a nonstandard header/lib-file +dnl $1 = the variable to return as result +dnl $2 = the package name +dnl $3 = the subdirectory, e.g., bin, include or lib +AC_DEFUN([CF_SUBDIR_PATH], +[ +$1= + +CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) +CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) +CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40 +dnl ------------------ +dnl Check if we can include with ; this breaks on +dnl older SCO configurations. +AC_DEFUN([CF_SYS_TIME_SELECT], +[ +AC_MSG_CHECKING(if sys/time.h works with sys/select.h) +AC_CACHE_VAL(cf_cv_sys_time_select,[ +AC_TRY_COMPILE([ +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +],[],[cf_cv_sys_time_select=yes], + [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) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49 +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 + 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 +AC_TRY_COMPILE([#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> +],[int x = auto_left_margin],[ + cf_cv_term_header="$cf_test"],[ + cf_cv_term_header=unknown + ]) + test "$cf_cv_term_header" != unknown && break +done +]) + +# Set definitions to allow ifdef'ing to accommodate subdirectories + +case $cf_cv_term_header in # (vi +*term.h) + AC_DEFINE(HAVE_TERM_H) + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + AC_DEFINE(HAVE_NCURSES_TERM_H) + ;; +ncursesw/term.h) + AC_DEFINE(HAVE_NCURSESW_TERM_H) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_TRY_PKG_CONFIG version: 4 updated: 2010/06/14 17:42:30 +dnl ----------------- +dnl This is a simple wrapper to use for pkg-config, for libraries which may be +dnl available in that form. +dnl +dnl $1 = package name +dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS +dnl $3 = logic to use if pkg-config does not have the package +AC_DEFUN([CF_TRY_PKG_CONFIG],[ +AC_REQUIRE([CF_PKG_CONFIG]) + +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then + CF_VERBOSE(found package $1) + cf_pkgconfig_incs="`$PKG_CONFIG --cflags $1 2>/dev/null`" + cf_pkgconfig_libs="`$PKG_CONFIG --libs $1 2>/dev/null`" + CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs) + CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs) + CF_ADD_CFLAGS($cf_pkgconfig_incs) + CF_ADD_LIBS($cf_pkgconfig_libs) + ifelse([$2],,:,[$2]) +else + ifelse([$3],,:,[$3]) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 +dnl -------- +dnl Make an uppercase version of a variable +dnl $1=uppercase($2) +AC_DEFUN([CF_UPPER], +[ +$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 +dnl ----------- +dnl Check for multibyte support, and if not found, utf8 compatibility library +AC_DEFUN([CF_UTF8_LIB], +[ +AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ + cf_save_LIBS="$LIBS" + AC_TRY_LINK([ +#include ],[putwc(0,0);], + [cf_cv_utf8_lib=yes], + [CF_FIND_LINKAGE([ +#include ],[putwc(0,0);],utf8, + [cf_cv_utf8_lib=add-on], + [cf_cv_utf8_lib=no]) +])]) + +# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between +# ncurses/ncursesw: +if test "$cf_cv_utf8_lib" = "add-on" ; then + AC_DEFINE(HAVE_LIBUTF8_H) + CF_ADD_INCDIR($cf_cv_header_path_utf8) + CF_ADD_LIBDIR($cf_cv_library_path_utf8) + CF_ADD_LIBS($cf_cv_library_file_utf8) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 +dnl ---------- +dnl Use AC_VERBOSE w/o the warnings +AC_DEFUN([CF_VERBOSE], +[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG +CF_MSG_LOG([$1]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57 +dnl ------------- +dnl Check if type wide-character type $1 is declared, and if so, which header +dnl file is needed. The second parameter is used to set a shell variable when +dnl the type is not found. The first parameter sets a shell variable for the +dnl opposite sense. +AC_DEFUN([CF_WCHAR_TYPE], +[ +# This is needed on Tru64 5.0 to declare $1 +AC_CACHE_CHECK(if we must include wchar.h to declare $1,cf_cv_$1,[ +AC_TRY_COMPILE([ +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif], + [$1 state], + [cf_cv_$1=no], + [AC_TRY_COMPILE([ +#include +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif], + [$1 value], + [cf_cv_$1=yes], + [cf_cv_$1=unknown])])]) + +if test "$cf_cv_$1" = yes ; then + AC_DEFINE(NEED_WCHAR_H) + NEED_WCHAR_H=1 +fi + +ifelse([$2],,,[ +# if we do not find $1 in either place, use substitution to provide a fallback. +if test "$cf_cv_$1" = unknown ; then + $2=1 +fi +]) +ifelse($3,,,[ +# if we find $1 in either place, use substitution to provide a fallback. +if test "$cf_cv_$1" != unknown ; then + $3=1 +fi +]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38 +dnl ------------------ +dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses +dnl libraries. +AC_DEFUN([CF_WITH_CURSES_DIR],[ + +AC_MSG_CHECKING(for specific curses-directory) +AC_ARG_WITH(curses-dir, + [ --with-curses-dir=DIR directory in which (n)curses is installed], + [cf_cv_curses_dir=$withval], + [cf_cv_curses_dir=no]) +AC_MSG_RESULT($cf_cv_curses_dir) + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + CF_PATH_SYNTAX(withval) + if test -d "$cf_cv_curses_dir" + then + CF_ADD_INCDIR($cf_cv_curses_dir/include) + CF_ADD_LIBDIR($cf_cv_curses_dir/lib) + fi +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 +dnl ---------------- +dnl Configure-option for dbmalloc. The optional parameter is used to override +dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. +AC_DEFUN([CF_WITH_DBMALLOC],[ +CF_NO_LEAKS_OPTION(dbmalloc, + [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], + [USE_DBMALLOC]) + +if test "$with_dbmalloc" = yes ; then + AC_CHECK_HEADER(dbmalloc.h, + [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 +dnl --------------- +dnl Configure-option for dmalloc. The optional parameter is used to override +dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. +AC_DEFUN([CF_WITH_DMALLOC],[ +CF_NO_LEAKS_OPTION(dmalloc, + [ --with-dmalloc test: use Gray Watson's dmalloc library], + [USE_DMALLOC]) + +if test "$with_dmalloc" = yes ; then + AC_CHECK_HEADER(dmalloc.h, + [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21 +dnl ---------------- +AC_DEFUN([CF_WITH_VALGRIND],[ +CF_NO_LEAKS_OPTION(valgrind, + [ --with-valgrind test: use valgrind], + [USE_VALGRIND]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_XOPEN_CURSES version: 10 updated: 2010/10/23 15:54:49 +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. +dnl +dnl The getbegyx() check is needed for HPUX, which omits legacy macros such +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_TRY_LINK([ +#include +#include <${cf_cv_ncurses_header:-curses.h}>],[ +#if defined(NCURSES_VERSION_PATCH) +if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403) + 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 +#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=yes], + [cf_cv_need_xopen_extension=unknown])])]) +test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 +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, +dnl without losing the common non-POSIX features. +dnl +dnl Parameters: +dnl $1 is the nominal value for _XOPEN_SOURCE +dnl $2 is the nominal value for _POSIX_C_SOURCE +AC_DEFUN([CF_XOPEN_SOURCE],[ + +cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) +cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) +cf_xopen_source= + +case $host_os in #(vi +aix[[456]]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +darwin[[0-8]].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" + ;; +freebsd*|dragonfly*) #(vi + # 5.x headers associate + # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L + # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L + cf_POSIX_C_SOURCE=200112L + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + ;; +hpux*) #(vi + cf_xopen_source="-D_HPUX_SOURCE" + ;; +irix[[56]].*) #(vi + cf_xopen_source="-D_SGI_SOURCE" + ;; +linux*|gnu*|mint*|k*bsd*-gnu) #(vi + CF_GNU_SOURCE + ;; +mirbsd*) #(vi + # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks + ;; +netbsd*) #(vi + # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + ;; +openbsd*) #(vi + # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw + ;; +osf[[45]]*) #(vi + cf_xopen_source="-D_OSF_SOURCE" + ;; +nto-qnx*) #(vi + cf_xopen_source="-D_QNX_SOURCE" + ;; +sco*) #(vi + # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer + ;; +solaris2.1[[0-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[[1-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__" + ;; +*) + AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ + AC_TRY_COMPILE([#include ],[ +#ifndef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_xopen_source=no], + [cf_save="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + AC_TRY_COMPILE([#include ],[ +#ifdef _XOPEN_SOURCE +make an error +#endif], + [cf_cv_xopen_source=no], + [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) + CPPFLAGS="$cf_save" + ]) +]) + if test "$cf_cv_xopen_source" != no ; then + CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) + CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_ADD_CFLAGS($cf_temp_xopen_source) + fi + CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) + ;; +esac + +if test -n "$cf_xopen_source" ; then + CF_ADD_CFLAGS($cf_xopen_source) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_X_ATHENA version: 20 updated: 2010/11/09 05:18:02 +dnl ----------- +dnl Check for Xaw (Athena) libraries +dnl +dnl Sets $cf_x_athena according to the flavor of Xaw which is used. +AC_DEFUN([CF_X_ATHENA], +[ +cf_x_athena=${cf_x_athena:-Xaw} + +AC_MSG_CHECKING(if you want to link with Xaw 3d library) +withval= +AC_ARG_WITH(Xaw3d, + [ --with-Xaw3d link with Xaw 3d library]) +if test "$withval" = yes ; then + cf_x_athena=Xaw3d + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if you want to link with neXT Athena library) +withval= +AC_ARG_WITH(neXtaw, + [ --with-neXtaw link with neXT Athena library]) +if test "$withval" = yes ; then + cf_x_athena=neXtaw + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +AC_MSG_CHECKING(if you want to link with Athena-Plus library) +withval= +AC_ARG_WITH(XawPlus, + [ --with-XawPlus link with Athena-Plus library]) +if test "$withval" = yes ; then + cf_x_athena=XawPlus + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +cf_x_athena_lib="" + +if test "$PKG_CONFIG" != none ; then + cf_athena_list= + test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6" + for cf_athena_pkg in \ + $cf_athena_list \ + ${cf_x_athena} \ + ${cf_x_athena}-devel \ + lib${cf_x_athena} \ + lib${cf_x_athena}-devel + do + CF_TRY_PKG_CONFIG($cf_athena_pkg,[ + cf_x_athena_lib="$cf_pkgconfig_libs" + CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena) + AC_DEFINE_UNQUOTED($cf_x_athena_LIBS) + +AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[ +AC_TRY_LINK([ +#include +],[ +int check = XmuCompareISOLatin1("big", "small") +],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])]) + + if test "$cf_cv_xaw_compat" = no + then + # workaround for broken ".pc" files... + case "$cf_x_athena_lib" in #(vi + *-lXmu*) #(vi + ;; + *) + CF_VERBOSE(work around broken package) + CF_TRY_PKG_CONFIG(xmu,,[CF_ADD_LIB_AFTER(-lXt,-lXmu)]) + ;; + esac + fi + + break]) + done +fi + +if test -z "$cf_x_athena_lib" ; then + CF_X_EXT + CF_X_TOOLKIT + CF_X_ATHENA_CPPFLAGS($cf_x_athena) + CF_X_ATHENA_LIBS($cf_x_athena) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_X_ATHENA_CPPFLAGS version: 5 updated: 2010/05/26 17:35:30 +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], +[ +cf_x_athena_root=ifelse([$1],,Xaw,[$1]) +cf_x_athena_inc="" + +for cf_path in default \ + /usr/contrib/X11R6 \ + /usr/contrib/X11R5 \ + /usr/lib/X11R5 \ + /usr/local +do + if test -z "$cf_x_athena_inc" ; then + cf_save="$CPPFLAGS" + cf_test=X11/$cf_x_athena_root/SimpleMenu.h + if test $cf_path != default ; then + CPPFLAGS="$cf_save -I$cf_path/include" + AC_MSG_CHECKING(for $cf_test in $cf_path) + else + AC_MSG_CHECKING(for $cf_test) + fi + AC_TRY_COMPILE([ +#include +#include <$cf_test>],[], + [cf_result=yes], + [cf_result=no]) + AC_MSG_RESULT($cf_result) + if test "$cf_result" = yes ; then + cf_x_athena_inc=$cf_path + 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]) +elif test "$cf_x_athena_inc" != default ; then + CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc" +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_X_ATHENA_LIBS version: 9 updated: 2010/06/02 05:03:05 +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_LIBS], +[AC_REQUIRE([CF_X_TOOLKIT]) +cf_x_athena_root=ifelse([$1],,Xaw,[$1]) +cf_x_athena_lib="" + +for cf_path in default \ + /usr/contrib/X11R6 \ + /usr/contrib/X11R5 \ + /usr/lib/X11R5 \ + /usr/local +do + for cf_lib in \ + "-l$cf_x_athena_root -lXmu" \ + "-l$cf_x_athena_root -lXpm -lXmu" \ + "-l${cf_x_athena_root}_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_lib) + AC_MSG_CHECKING(for $cf_lib in $cf_path) + else + CF_ADD_LIBS($cf_lib) + AC_MSG_CHECKING(for $cf_test in $cf_lib) + fi + AC_TRY_LINK([],[$cf_test()], + [cf_result=yes], + [cf_result=no]) + AC_MSG_RESULT($cf_result) + if test "$cf_result" = yes ; then + cf_x_athena_lib="$cf_lib" + break + fi + LIBS="$cf_save" + fi + done +done + +if test -z "$cf_x_athena_lib" ; then + AC_MSG_ERROR( +[Unable to successfully link Athena library (-l$cf_x_athena_root) with test program]) +fi + +CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena) +AC_DEFINE_UNQUOTED($cf_x_athena_LIBS) +]) +dnl --------------------------------------------------------------------------- +dnl CF_X_EXT version: 3 updated: 2010/06/02 05:03:05 +dnl -------- +AC_DEFUN([CF_X_EXT],[ +CF_TRY_PKG_CONFIG(Xext,,[ + AC_CHECK_LIB(Xext,XextCreateExtension, + [CF_ADD_LIB(Xext)])]) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_X_TOOLKIT version: 20 updated: 2010/11/19 05:43:04 +dnl ------------ +dnl Check for X Toolkit libraries +dnl +AC_DEFUN([CF_X_TOOLKIT], +[ +AC_REQUIRE([AC_PATH_XTRA]) +AC_REQUIRE([CF_CHECK_CACHE]) + +cf_have_X_LIBS=no + +CF_TRY_PKG_CONFIG(xt,[ + + case "x$LIBS" in #(vi + *-lX11*) #(vi + ;; + *) +# 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([ +#include +],[ + int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0); + int rc2 = XClearWindow((Display*) 0, (Window) 0); + int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0); + int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0); +],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])]) + if test "$cf_cv_xt_x11_compat" = no + then + CF_VERBOSE(work around broken X11 dependency) + # 2010/11/19 - good enough until a working Xt on Xcb is delivered. + CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)]) + fi + ;; + esac + +AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[ +AC_TRY_LINK([ +#include +],[int num = IceConnectionNumber(0) +],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])]) + + 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 + ;; + *) + CF_VERBOSE(work around broken ICE dependency) + CF_TRY_PKG_CONFIG(ice, + [CF_TRY_PKG_CONFIG(sm)], + [CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)]) + ;; + esac + ;; + esac + fi + + cf_have_X_LIBS=yes +],[ + + LDFLAGS="$X_LIBS $LDFLAGS" + CF_CHECK_CFLAGS($X_CFLAGS) + + AC_CHECK_FUNC(XOpenDisplay,,[ + AC_CHECK_LIB(X11,XOpenDisplay, + [CF_ADD_LIB(X11)],, + [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) + + AC_CHECK_FUNC(XtAppInitialize,,[ + AC_CHECK_LIB(Xt, XtAppInitialize, + [AC_DEFINE(HAVE_LIBXT) + cf_have_X_LIBS=Xt + LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],, + [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) +]) + +if test $cf_have_X_LIBS = no ; then + AC_MSG_WARN( +[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.]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49 +dnl --------------- +dnl Define a reusable chunk which includes and when they +dnl are both available. +define([CF__CURSES_HEAD],[ +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif +]) diff --git a/test/background.c b/test/background.c new file mode 100644 index 00000000000..afbe5f53603 --- /dev/null +++ b/test/background.c @@ -0,0 +1,95 @@ +/**************************************************************************** + * Copyright (c) 2003,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"), 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: background.c,v 1.3 2006/06/03 16:43:08 tom Exp $ + */ + +#include + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + short f, b; + + initscr(); + cbreak(); + noecho(); + + if (has_colors()) { + start_color(); + + pair_content(0, &f, &b); + printw("pair 0 contains (%d,%d)\n", f, b); + getch(); + + printw("Initializing pair 1 to red/black\n"); + init_pair(1, COLOR_RED, COLOR_BLACK); + bkgdset(' ' | COLOR_PAIR(1)); + printw("RED/BLACK\n"); + getch(); + + printw("Initializing pair 2 to white/blue\n"); + init_pair(2, COLOR_WHITE, COLOR_BLUE); + bkgdset(' ' | COLOR_PAIR(2)); + printw("WHITE/BLUE\n"); + getch(); + + printw("Resetting colors to pair 0\n"); + bkgdset(' ' | COLOR_PAIR(0)); + printw("Default Colors\n"); + getch(); + + printw("Resetting colors to pair 1\n"); + bkgdset(' ' | COLOR_PAIR(1)); + printw("RED/BLACK\n"); + getch(); + + printw("Setting screen to pair 0\n"); + bkgd(' ' | COLOR_PAIR(0)); + getch(); + + printw("Setting screen to pair 1\n"); + bkgd(' ' | COLOR_PAIR(1)); + getch(); + + printw("Setting screen to pair 2\n"); + bkgd(' ' | COLOR_PAIR(2)); + getch(); + + printw("Setting screen to pair 0\n"); + bkgd(' ' | COLOR_PAIR(0)); + getch(); + + } else { + printw("This demo requires a color terminal"); + getch(); + } + endwin(); + + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/blue.c b/test/blue.c new file mode 100644 index 00000000000..dfe6abf1b42 --- /dev/null +++ b/test/blue.c @@ -0,0 +1,465 @@ +/**************************************************************************** + * Copyright (c) 1998-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 * + * "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. * + ****************************************************************************/ +/***************************************************************************** + * * + * B l u e M o o n * + * ================= * + * V2.2 * + * A patience game by T.A.Lister * + * Integral screen support by Eric S. Raymond * + * * + *****************************************************************************/ + +/* + * 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.33 2009/10/24 21:03:35 tom Exp $ + */ + +#include + +#include + +#define NOCARD (-1) + +#define ACE 0 +#define KING 12 +#define SUIT_LENGTH 13 + +#define HEARTS 0 +#define SPADES 1 +#define DIAMONDS 2 +#define CLUBS 3 +#define NSUITS 4 + +#define GRID_WIDTH 14 /* 13+1 */ +#define GRID_LENGTH 56 /* 4*(13+1) */ +#define PACK_SIZE 52 + +#define BASEROW 1 +#define PROMPTROW 11 + +#define RED_ON_WHITE 1 +#define BLACK_ON_WHITE 2 +#define BLUE_ON_WHITE 3 + +static RETSIGTYPE die(int onsig) GCC_NORETURN; + +static int deck_size = PACK_SIZE; /* initial deck */ +static int deck[PACK_SIZE]; + +static int grid[GRID_LENGTH]; /* card layout grid */ +static int freeptr[4]; /* free card space pointers */ + +static int deal_number = 0; + +static chtype ranks[SUIT_LENGTH][2] = +{ + {' ', 'A'}, + {' ', '2'}, + {' ', '3'}, + {' ', '4'}, + {' ', '5'}, + {' ', '6'}, + {' ', '7'}, + {' ', '8'}, + {' ', '9'}, + {'1', '0'}, + {' ', 'J'}, + {' ', 'Q'}, + {' ', '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 + +#define PC_COLORS(value,pair) (OR_COLORS(value,pair) | A_ALTCHARSET) + +static chtype letters[4] = +{ + 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 */ +}; + +#if defined(__i386__) && defined(A_ALTCHARSET) && HAVE_TIGETSTR +static chtype glyphs[] = +{ + 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 */ +}; +#define USE_CP437 1 +#else +#define USE_CP437 0 +#endif /* __i386__ */ + +static chtype *suits = letters; /* this may change to glyphs below */ + +static RETSIGTYPE +die(int onsig) +{ + (void) signal(onsig, SIG_IGN); + endwin(); + ExitProgram(EXIT_SUCCESS); +} + +static void +init_vars(void) +{ + int i; + + deck_size = PACK_SIZE; + for (i = 0; i < PACK_SIZE; i++) + deck[i] = i; + for (i = 0; i < 4; i++) + freeptr[i] = i * GRID_WIDTH; +} + +static void +shuffle(int size) +{ + int i, j, numswaps, swapnum, temp; + + numswaps = size * 10; /* an arbitrary figure */ + + for (swapnum = 0; swapnum < numswaps; swapnum++) { + i = rand() % size; + j = rand() % size; + temp = deck[i]; + deck[i] = deck[j]; + deck[j] = temp; + } +} + +static void +deal_cards(void) +{ + int ptr, card = 0, value, csuit, crank, suit, aces[4]; + + memset(aces, 0, sizeof(aces)); + for (suit = HEARTS; suit <= CLUBS; suit++) { + ptr = freeptr[suit]; + grid[ptr++] = NOCARD; /* 1st card space is blank */ + while ((ptr % GRID_WIDTH) != 0) { + value = deck[card++]; + crank = value % SUIT_LENGTH; + csuit = value / SUIT_LENGTH; + if (crank == ACE) + aces[csuit] = ptr; + grid[ptr++] = value; + } + } + + if (deal_number == 1) /* shift the aces down to the 1st column */ + for (suit = HEARTS; suit <= CLUBS; suit++) { + grid[suit * GRID_WIDTH] = suit * SUIT_LENGTH; + grid[aces[suit]] = NOCARD; + freeptr[suit] = aces[suit]; + } +} + +static void +printcard(int value) +{ + (void) addch(' '); + if (value == NOCARD) + (void) addstr(" "); + else { + addch(ranks[value % SUIT_LENGTH][0] | COLOR_PAIR(BLUE_ON_WHITE)); + addch(ranks[value % SUIT_LENGTH][1] | COLOR_PAIR(BLUE_ON_WHITE)); + addch(suits[value / SUIT_LENGTH]); + } + (void) addch(' '); +} + +static void +display_cards(int deal) +{ + int row, card; + + clear(); + (void) printw( + "Blue Moon 2.1 - by Tim Lister & Eric Raymond - Deal %d.\n", + deal); + for (row = HEARTS; row <= CLUBS; row++) { + move(BASEROW + row + row + 2, 1); + for (card = 0; card < GRID_WIDTH; card++) + printcard(grid[row * GRID_WIDTH + card]); + } + + move(PROMPTROW + 2, 0); + refresh(); +#define P(x) (void)printw("%s\n", x) + P(" This 52-card solitaire starts with the entire deck shuffled and dealt"); + P("out in four rows. The aces are then moved to the left end of the layout,"); + P("making 4 initial free spaces. You may move to a space only the card that"); + P("matches the left neighbor in suit, and is one greater in rank. Kings are"); + P("high, so no cards may be placed to their right (they create dead spaces)."); + P(" When no moves can be made, cards still out of sequence are reshuffled"); + P("and dealt face up after the ends of the partial sequences, leaving a card"); + P("space after each sequence, so that each row looks like a partial sequence"); + P("followed by a space, followed by enough cards to make a row of 14. "); + P(" A moment's reflection will show that this game cannot take more than 13"); + P("deals. A good score is 1-3 deals, 4-7 is average, 8 or more is poor. "); +#undef P + refresh(); +} + +static int +find(int card) +{ + int i; + + if ((card < 0) || (card >= PACK_SIZE)) + return (NOCARD); + for (i = 0; i < GRID_LENGTH; i++) + if (grid[i] == card) + return i; + return (NOCARD); +} + +static void +movecard(int src, int dst) +{ + grid[dst] = grid[src]; + grid[src] = NOCARD; + + move(BASEROW + (dst / GRID_WIDTH) * 2 + 2, (dst % GRID_WIDTH) * 5 + 1); + printcard(grid[dst]); + + move(BASEROW + (src / GRID_WIDTH) * 2 + 2, (src % GRID_WIDTH) * 5 + 1); + printcard(grid[src]); + + refresh(); +} + +static void +play_game(void) +{ + int dead = 0, i, j; + char c; + int selection[4], card; + + while (dead < 4) { + dead = 0; + for (i = 0; i < 4; i++) { + card = grid[freeptr[i] - 1]; + + if (((card % SUIT_LENGTH) == KING) + || + (card == NOCARD)) + selection[i] = NOCARD; + else + selection[i] = find(card + 1); + + if (selection[i] == NOCARD) + dead++; + }; + + if (dead < 4) { + char live[NSUITS + 1], *lp = live; + + for (i = 0; i < 4; i++) { + if (selection[i] != NOCARD) { + move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3, + (selection[i] % GRID_WIDTH) * 5); + (void) printw(" %c ", (*lp++ = (char) ('a' + i))); + } + }; + *lp = '\0'; + + if (strlen(live) == 1) { + move(PROMPTROW, 0); + (void) printw( + "Making forced moves... "); + refresh(); + (void) sleep(1); + c = live[0]; + } else { + char buf[BUFSIZ]; + + (void) sprintf(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(' '); + } while + (((c = (char) getch()) < 'a' || c > 'd') + && (c != 'r') + && (c != 'q')); + } + + for (j = 0; j < 4; j++) + if (selection[j] != NOCARD) { + move(BASEROW + (selection[j] / GRID_WIDTH) * 2 + 3, + (selection[j] % GRID_WIDTH) * 5); + (void) printw(" "); + } + + if (c == 'r') + display_cards(deal_number); + else if (c == 'q') + die(SIGINT); + else { + i = c - 'a'; + if (selection[i] == NOCARD) + beep(); + else { + movecard(selection[i], freeptr[i]); + freeptr[i] = selection[i]; + } + } + } + } + + move(PROMPTROW, 0); + (void) standout(); + (void) printw("Finished deal %d - type any character to continue...", deal_number); + (void) standend(); + (void) getch(); +} + +static int +collect_discards(void) +{ + int row, col, cardno = 0, finish, gridno; + + for (row = HEARTS; row <= CLUBS; row++) { + finish = 0; + for (col = 1; col < GRID_WIDTH; col++) { + gridno = row * GRID_WIDTH + col; + + if ((grid[gridno] != (grid[gridno - 1] + 1)) && (finish == 0)) { + finish = 1; + freeptr[row] = gridno; + }; + + if ((finish != 0) && (grid[gridno] != NOCARD)) + deck[cardno++] = grid[gridno]; + } + } + return cardno; +} + +static void +game_finished(int deal) +{ + clear(); + (void) printw("You finished the game in %d deals. This is ", deal); + (void) standout(); + if (deal < 2) + (void) addstr("excellent"); + else if (deal < 4) + (void) addstr("good"); + else if (deal < 8) + (void) addstr("average"); + else + (void) addstr("poor"); + (void) standend(); + (void) addstr(". "); + refresh(); +} + +int +main(int argc, char *argv[]) +{ + CATCHALL(die); + + setlocale(LC_ALL, ""); + + initscr(); + + /* + * 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) + srand((unsigned) atoi(argv[1])); + else + srand((unsigned) time((time_t *) 0)); + + init_vars(); + + do { + deal_number++; + shuffle(deck_size); + deal_cards(); + display_cards(deal_number); + play_game(); + } + while + ((deck_size = collect_discards()) != 0); + + game_finished(deal_number); + + die(SIGINT); + /*NOTREACHED */ +} + +/* blue.c ends here */ diff --git a/test/bs.6 b/test/bs.6 new file mode 100644 index 00000000000..657f538d716 --- /dev/null +++ b/test/bs.6 @@ -0,0 +1,71 @@ +.\"*************************************************************************** +.\" Copyright (c) 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 * +.\" "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: bs.6,v 1.2 2006/04/22 22:42:44 tom Exp $ +.TH BATTLESHIPS 6 "Aug 23, 1989" +.SH NAME +bs \- battleships game +.SH SYNOPSIS +battle [ -b | -s ] [ -c ] +.SH DESCRIPTION +This program allows you to play the familiar Battleships game against the +computer on a 10x10 board. The interface is visual and largely +self-explanatory; you place your ships and pick your shots by moving the +cursor around the `sea' with the rogue/hack motion keys hjklyubn. +.PP +Note that when selecting a ship to place, you must type the capital letter +(these are, after all, capital ships). During ship placement, the `r' command +may be used to ignore the current position and randomly place your currently +selected ship. The `R' command will place all remaining ships randomly. The ^L +command (form feed, ASCII 12) will force a screen redraw). +.PP +The command-line arguments control game modes. + +.nf + -b selects a `blitz' variant + -s selects a `salvo' variant + -c permits ships to be placed adjacently +.fi + +The `blitz' variant allows a side to shoot for as long as it continues to +score hits. +.PP +The `salvo' game allows a player one shot per turn for each of his/her ships +still afloat. This puts a premium scoring hits early and knocking out some +ships and also makes much harder the situation where you face a superior force +with only your PT-boat. +.PP +Normally, ships must be separated by at least one square of open water. The +-c option disables this check and allows them to close-pack. +.PP +The algorithm the computer uses once it has found a ship to sink is provably +optimal. The dispersion criterion for the random-fire algorithm may not be. +.SH AUTHORS +Originally written by one Bruce Holloway in 1986. Salvo mode added by Chuck A. +DeGaul (cbosgd!cad). Visual user interface, `closepack' option, code rewrite +and manual page by Eric S. Raymond August 1989. diff --git a/test/bs.c b/test/bs.c new file mode 100644 index 00000000000..ee7f2271d6b --- /dev/null +++ b/test/bs.c @@ -0,0 +1,1257 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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. * + ****************************************************************************/ +/* + * bs.c - original author: Bruce Holloway + * salvo option by: Chuck A DeGaul + * with improved user interface, autoconfiguration and code cleanup + * by Eric S. Raymond + * v1.2 with color support and minor portability fixes, November 1990 + * v2.0 featuring strict ANSI/POSIX conformance, November 1993. + * v2.1 with ncurses mouse support, September 1995 + * + * $Id: bs.c,v 1.52 2010/11/13 20:07:52 tom Exp $ + */ + +#include + +#include + +#ifndef SIGIOT +#define SIGIOT SIGABRT +#endif + +static int getcoord(int); + +/* + * Constants for tuning the random-fire algorithm. It prefers moves that + * diagonal-stripe the board with a stripe separation of srchstep. If + * no such preferred moves are found, srchstep is decremented. + */ +#define BEGINSTEP 3 /* initial value of srchstep */ + +/* miscellaneous constants */ +#define SHIPTYPES 5 +#define OTHER (1-turn) +#define PLAYER 0 +#define COMPUTER 1 +#define MARK_HIT 'H' +#define MARK_MISS 'o' +#define CTRLC '\003' /* used as terminate command */ +#define FF '\014' /* used as redraw command */ + +/* coordinate handling */ +#define BWIDTH 10 +#define BDEPTH 10 + +/* display symbols */ +#define SHOWHIT '*' +#define SHOWSPLASH ' ' +#define IS_SHIP(c) (isupper(UChar(c)) ? TRUE : FALSE) + +/* how to position us on player board */ +#define PYBASE 3 +#define PXBASE 3 +#define PY(y) (PYBASE + (y)) +#define PX(x) (PXBASE + (x)*3) +#define pgoto(y, x) (void)move(PY(y), PX(x)) + +/* how to position us on cpu board */ +#define CYBASE 3 +#define CXBASE 48 +#define CY(y) (CYBASE + (y)) +#define CX(x) (CXBASE + (x)*3) +#define CYINV(y) ((y) - CYBASE) +#define CXINV(x) (((x) - CXBASE) / 3) +#define cgoto(y, x) (void)move(CY(y), CX(x)) + +#define ONBOARD(x, y) (x >= 0 && x < BWIDTH && y >= 0 && y < BDEPTH) + +/* other board locations */ +#define COLWIDTH 80 +#define PROMPTLINE 21 /* prompt line */ +#define SYBASE CYBASE + BDEPTH + 3 /* move key diagram */ +#define SXBASE 63 +#define MYBASE SYBASE - 1 /* diagram caption */ +#define MXBASE 64 +#define HYBASE SYBASE - 1 /* help area */ +#define HXBASE 0 + +/* this will need to be changed if BWIDTH changes */ +static char numbers[] = " 0 1 2 3 4 5 6 7 8 9"; + +static char carrier[] = "Aircraft Carrier"; +static char battle[] = "Battleship"; +static char sub[] = "Submarine"; +static char destroy[] = "Destroyer"; +static char ptboat[] = "PT Boat"; + +static char name[40]; +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] = +{1, 1, 0, -1, -1, -1, 0, 1}; +static int yincr[8] = +{0, 1, 1, 1, 0, -1, -1, -1}; + +/* current ship position and direction */ +static int curx = (BWIDTH / 2); +static int cury = (BDEPTH / 2); + +typedef struct { + char *name; /* name of the ship type */ + int hits; /* how many times has this ship been hit? */ + char symbol; /* symbol for game purposes */ + int length; /* length of ship */ + int x, y; /* coordinates of ship start point */ + int dir; /* direction of `bow' */ + bool placed; /* has it been placed on the board? */ +} ship_t; + +static bool checkplace(int b, ship_t * ss, int vis); + +#define SHIPIT(name, symbol, length) { name, 0, symbol, length, 0,0, 0, FALSE } + +static ship_t plyship[SHIPTYPES] = +{ + SHIPIT(carrier, 'A', 5), + SHIPIT(battle, 'B', 4), + SHIPIT(destroy, 'D', 3), + SHIPIT(sub, 'S', 3), + SHIPIT(ptboat, 'P', 2), +}; + +static ship_t cpuship[SHIPTYPES] = +{ + SHIPIT(carrier, 'A', 5), + SHIPIT(battle, 'B', 4), + SHIPIT(destroy, 'D', 3), + SHIPIT(sub, 'S', 3), + SHIPIT(ptboat, 'P', 2), +}; + +/* "Hits" board, and main board. */ +static char hits[2][BWIDTH][BDEPTH]; +static char board[2][BWIDTH][BDEPTH]; + +static int turn; /* 0=player, 1=computer */ +static int plywon = 0, cpuwon = 0; /* How many games has each won? */ + +static int salvo, blitz, closepack; + +#define PR (void)addstr + +static RETSIGTYPE uninitgame(int sig) GCC_NORETURN; + +static RETSIGTYPE +uninitgame(int sig GCC_UNUSED) +/* end the game, either normally or due to signal */ +{ + clear(); + (void) refresh(); + (void) reset_shell_mode(); + (void) echo(); + (void) endwin(); + ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS); +} + +static void +announceopts(void) +/* announce which game options are enabled */ +{ + if (salvo || blitz || closepack) { + (void) printw("Playing optional game ("); + if (salvo) + (void) printw("salvo, "); + else + (void) printw("nosalvo, "); + if (blitz) + (void) printw("blitz "); + else + (void) printw("noblitz, "); + if (closepack) + (void) printw("closepack)"); + else + (void) printw("noclosepack)"); + } else + (void) printw( + "Playing standard game (noblitz, nosalvo, noclosepack)"); +} + +static void +intro(void) +{ + char *tmpname; + + srand((unsigned) (time(0L) + getpid())); /* Kick the random number generator */ + + CATCHALL(uninitgame); + + if ((tmpname = getlogin()) != 0) { + (void) strcpy(name, tmpname); + name[0] = (char) toupper(UChar(name[0])); + } else + (void) strcpy(name, dftname); + + (void) initscr(); + keypad(stdscr, TRUE); + (void) def_prog_mode(); + (void) nonl(); + (void) cbreak(); + (void) noecho(); + +#ifdef PENGUIN + (void) clear(); + MvAddStr(4, 29, "Welcome to Battleship!"); + (void) move(8, 0); + PR(" \\\n"); + PR(" \\ \\ \\\n"); + PR(" \\ \\ \\ \\ \\_____________\n"); + PR(" \\ \\ \\_____________ \\ \\/ |\n"); + PR(" \\ \\/ \\ \\/ |\n"); + PR(" \\/ \\_____/ |__\n"); + PR(" ________________/ |\n"); + PR(" \\ S.S. Penguin |\n"); + PR(" \\ /\n"); + PR(" \\___________________________________________________/\n"); + + MvAddStr(22, 27, "Hit any key to continue..."); + (void) refresh(); + (void) getch(); +#endif /* PENGUIN */ + +#ifdef A_COLOR + start_color(); + + init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK); + init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK); + init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK); + init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK); + init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); + init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); + init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK); + init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); +#endif /* A_COLOR */ + +#ifdef NCURSES_MOUSE_VERSION + (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); +#endif /* NCURSES_MOUSE_VERSION */ +} + +/* VARARGS1 */ +static void +prompt(int n, NCURSES_CONST char *f, const char *s) +/* print a message at the prompt line */ +{ + (void) move(PROMPTLINE + n, 0); + (void) clrtoeol(); + (void) printw(f, s); + (void) refresh(); +} + +static void +error(NCURSES_CONST char *s) +{ + (void) move(PROMPTLINE + 2, 0); + (void) clrtoeol(); + if (s) { + (void) addstr(s); + (void) beep(); + } +} + +static void +placeship(int b, ship_t * ss, int vis) +{ + int l; + + for (l = 0; l < ss->length; ++l) { + int newx = ss->x + l * xincr[ss->dir]; + int newy = ss->y + l * yincr[ss->dir]; + + board[b][newx][newy] = ss->symbol; + if (vis) { + pgoto(newy, newx); + (void) addch((chtype) ss->symbol); + } + } + ss->hits = 0; +} + +static int +rnd(int n) +{ + return (((rand() & 0x7FFF) % n)); +} + +static void +randomplace(int b, ship_t * ss) +/* generate a valid random ship placement into px,py */ +{ + + 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)); + } while + (!checkplace(b, ss, FALSE)); +} + +static void +initgame(void) +{ + int i, j, unplaced; + ship_t *ss; + + (void) clear(); + MvAddStr(0, 35, "BATTLESHIPS"); + (void) move(PROMPTLINE + 2, 0); + announceopts(); + + memset(board, 0, sizeof(char) * BWIDTH * BDEPTH * 2); + memset(hits, 0, sizeof(char) * BWIDTH * BDEPTH * 2); + for (i = 0; i < SHIPTYPES; i++) { + ss = cpuship + i; + + ss->x = + ss->y = + ss->dir = + ss->hits = 0; + ss->placed = FALSE; + + ss = plyship + i; + + ss->x = + ss->y = + ss->dir = + ss->hits = 0; + ss->placed = FALSE; + } + + /* draw empty boards */ + MvAddStr(PYBASE - 2, PXBASE + 5, "Main Board"); + MvAddStr(PYBASE - 1, PXBASE - 3, numbers); + for (i = 0; i < BDEPTH; ++i) { + MvAddCh(PYBASE + i, PXBASE - 3, (chtype) (i + 'A')); +#ifdef A_COLOR + if (has_colors()) + attron(COLOR_PAIR(COLOR_BLUE)); +#endif /* A_COLOR */ + (void) 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')); + } + MvAddStr(PYBASE + BDEPTH, PXBASE - 3, numbers); + MvAddStr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board"); + MvAddStr(CYBASE - 1, CXBASE - 3, numbers); + for (i = 0; i < BDEPTH; ++i) { + MvAddCh(CYBASE + i, CXBASE - 3, (chtype) (i + 'A')); +#ifdef A_COLOR + if (has_colors()) + attron(COLOR_PAIR(COLOR_BLUE)); +#endif /* A_COLOR */ + (void) 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')); + } + + MvAddStr(CYBASE + BDEPTH, CXBASE - 3, numbers); + + MvPrintw(HYBASE, HXBASE, + "To position your ships: move the cursor to a spot, then"); + MvPrintw(HYBASE + 1, HXBASE, + "type the first letter of a ship type to select it, then"); + MvPrintw(HYBASE + 2, HXBASE, + "type a direction ([hjkl] or [4862]), indicating how the"); + MvPrintw(HYBASE + 3, HXBASE, + "ship should be pointed. You may also type a ship letter"); + MvPrintw(HYBASE + 4, HXBASE, + "followed by `r' to position it randomly, or type `R' to"); + MvPrintw(HYBASE + 5, HXBASE, + "place all remaining ships randomly."); + + MvAddStr(MYBASE, MXBASE, "Aiming keys:"); + MvAddStr(SYBASE, SXBASE, "y k u 7 8 9"); + MvAddStr(SYBASE + 1, SXBASE, " \\|/ \\|/ "); + MvAddStr(SYBASE + 2, SXBASE, "h-+-l 4-+-6"); + MvAddStr(SYBASE + 3, SXBASE, " /|\\ /|\\ "); + MvAddStr(SYBASE + 4, SXBASE, "b j n 1 2 3"); + + /* have the computer place ships */ + for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++) { + randomplace(COMPUTER, ss); + placeship(COMPUTER, ss, FALSE); + } + + ss = (ship_t *) NULL; + do { + char c, docked[SHIPTYPES + 2], *cp = docked; + + /* figure which ships still wait to be placed */ + *cp++ = 'R'; + for (i = 0; i < SHIPTYPES; i++) + if (!plyship[i].placed) + *cp++ = plyship[i].symbol; + *cp = '\0'; + + /* get a command letter */ + prompt(1, "Type one of [%s] to pick a ship.", docked + 1); + do { + c = (char) getcoord(PLAYER); + } while + (!strchr(docked, c)); + + if (c == 'R') + (void) ungetch('R'); + else { + /* map that into the corresponding symbol */ + for (ss = plyship; ss < plyship + SHIPTYPES; ss++) + if (ss->symbol == c) + break; + + prompt(1, "Type one of [hjklrR] to place your %s.", ss->name); + pgoto(cury, curx); + } + + do { + c = (char) getch(); + } while + (!(strchr("hjklrR", c) || c == FF)); + + if (c == FF) { + (void) clearok(stdscr, TRUE); + (void) refresh(); + } else if (c == 'r') { + assert(ss != 0); + prompt(1, "Random-placing your %s", ss->name); + randomplace(PLAYER, ss); + placeship(PLAYER, ss, TRUE); + error((char *) NULL); + ss->placed = TRUE; + } else if (c == 'R') { + prompt(1, "Placing the rest of your fleet at random...", ""); + for (ss = plyship; ss < plyship + SHIPTYPES; ss++) + if (!ss->placed) { + randomplace(PLAYER, ss); + placeship(PLAYER, ss, TRUE); + ss->placed = TRUE; + } + error((char *) NULL); + } else if (strchr("hjkl8462", c)) { + assert(ss != 0); + ss->x = curx; + ss->y = cury; + + switch (c) { + case 'k': + case '8': + ss->dir = N; + break; + case 'j': + case '2': + ss->dir = S; + break; + case 'h': + case '4': + ss->dir = W; + break; + case 'l': + case '6': + ss->dir = E; + break; + } + + if (checkplace(PLAYER, ss, TRUE)) { + placeship(PLAYER, ss, TRUE); + error((char *) NULL); + ss->placed = TRUE; + } + } + + for (unplaced = i = 0; i < SHIPTYPES; i++) + unplaced += !plyship[i].placed; + } while + (unplaced); + + turn = rnd(2); + + MvPrintw(HYBASE, HXBASE, + "To fire, move the cursor to your chosen aiming point "); + MvPrintw(HYBASE + 1, HXBASE, + "and strike any key other than a motion key. "); + MvPrintw(HYBASE + 2, HXBASE, + " "); + MvPrintw(HYBASE + 3, HXBASE, + " "); + MvPrintw(HYBASE + 4, HXBASE, + " "); + MvPrintw(HYBASE + 5, HXBASE, + " "); + + (void) prompt(0, "Press any key to start...", ""); + (void) getch(); +} + +static int +getcoord(int atcpu) +{ + int ny, nx, c; + + if (atcpu) + cgoto(cury, curx); + else + pgoto(cury, curx); + (void) refresh(); + for (;;) { + if (atcpu) { + MvPrintw(CYBASE + BDEPTH + 1, CXBASE + 11, "(%d, %c)", + curx, 'A' + cury); + cgoto(cury, curx); + } else { + MvPrintw(PYBASE + BDEPTH + 1, PXBASE + 11, "(%d, %c)", + curx, 'A' + cury); + pgoto(cury, curx); + } + + switch (c = getch()) { + case 'k': + case '8': + case KEY_UP: + ny = cury + BDEPTH - 1; + nx = curx; + break; + case 'j': + case '2': + case KEY_DOWN: + ny = cury + 1; + nx = curx; + break; + case 'h': + case '4': + case KEY_LEFT: + ny = cury; + nx = curx + BWIDTH - 1; + break; + case 'l': + case '6': + case KEY_RIGHT: + ny = cury; + nx = curx + 1; + break; + case 'y': + case '7': + case KEY_A1: + ny = cury + BDEPTH - 1; + nx = curx + BWIDTH - 1; + break; + case 'b': + case '1': + case KEY_C1: + ny = cury + 1; + nx = curx + BWIDTH - 1; + break; + case 'u': + case '9': + case KEY_A3: + ny = cury + BDEPTH - 1; + nx = curx + 1; + break; + case 'n': + case '3': + case KEY_C3: + ny = cury + 1; + nx = curx + 1; + break; + case FF: + nx = curx; + ny = cury; + (void) clearok(stdscr, TRUE); + (void) refresh(); + break; +#ifdef NCURSES_MOUSE_VERSION + case KEY_MOUSE: + { + MEVENT myevent; + + getmouse(&myevent); + if (atcpu + && myevent.y >= CY(0) && myevent.y <= CY(BDEPTH) + && myevent.x >= CX(0) && myevent.x <= CX(BDEPTH)) { + curx = CXINV(myevent.x); + cury = CYINV(myevent.y); + return (' '); + } else { + beep(); + continue; + } + } + /* no fall through */ +#endif /* NCURSES_MOUSE_VERSION */ + + default: + if (atcpu) + MvAddStr(CYBASE + BDEPTH + 1, CXBASE + 11, " "); + else + MvAddStr(PYBASE + BDEPTH + 1, PXBASE + 11, " "); + return (c); + } + + curx = nx % BWIDTH; + cury = ny % BDEPTH; + } +} + +static bool +collidecheck(int b, int y, int x) +/* is this location on the selected zboard adjacent to a ship? */ +{ + bool collide; + + /* anything on the square */ + if ((collide = IS_SHIP(board[b][x][y])) != FALSE) + return (collide); + + /* anything on the neighbors */ + if (!closepack) { + int i; + + for (i = 0; i < 8; i++) { + int xend, yend; + + yend = y + yincr[i]; + xend = x + xincr[i]; + if (ONBOARD(xend, yend) + && IS_SHIP(board[b][xend][yend])) { + collide = TRUE; + break; + } + } + } + return (collide); +} + +static bool +checkplace(int b, ship_t * ss, int vis) +{ + int l, xend, yend; + + /* first, check for board edges */ + xend = ss->x + (ss->length - 1) * xincr[ss->dir]; + yend = ss->y + (ss->length - 1) * yincr[ss->dir]; + if (!ONBOARD(xend, yend)) { + if (vis) + switch (rnd(3)) { + case 0: + error("Ship is hanging from the edge of the world"); + break; + case 1: + error("Try fitting it on the board"); + break; + case 2: + error("Figure I won't find it if you put it there?"); + break; + } + return (FALSE); + } + + for (l = 0; l < ss->length; ++l) { + if (collidecheck(b, ss->y + l * yincr[ss->dir], ss->x + l * xincr[ss->dir])) { + if (vis) + switch (rnd(3)) { + case 0: + error("There's already a ship there"); + break; + case 1: + error("Collision alert! Aaaaaagh!"); + break; + case 2: + error("Er, Admiral, what about the other ship?"); + break; + } + return (FALSE); + } + } + return (TRUE); +} + +static int +awinna(void) +{ + int i, j; + ship_t *ss; + + for (i = 0; i < 2; ++i) { + ss = (i) ? cpuship : plyship; + for (j = 0; j < SHIPTYPES; ++j, ++ss) + if (ss->length > ss->hits) + break; + if (j == SHIPTYPES) + return (OTHER); + } + return (-1); +} + +static ship_t * +hitship(int x, int y) +/* register a hit on the targeted ship */ +{ + ship_t *sb, *ss; + char sym; + int oldx, oldy; + + getyx(stdscr, oldy, oldx); + sb = (turn) ? plyship : cpuship; + if ((sym = board[OTHER][x][y]) == 0) + return ((ship_t *) NULL); + for (ss = sb; ss < sb + SHIPTYPES; ++ss) + if (ss->symbol == sym) { + if (++ss->hits < ss->length) /* still afloat? */ + return ((ship_t *) NULL); + else { /* sunk! */ + int i, 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]; + + for (i = -1; i <= ss->length; ++i) { + int x1, y1; + + x1 = bx + i * xincr[ss->dir]; + y1 = by + i * yincr[ss->dir]; + if (ONBOARD(x1, y1)) { + hits[turn][x1][y1] = MARK_MISS; + if (turn % 2 == PLAYER) { + cgoto(y1, x1); +#ifdef A_COLOR + if (has_colors()) + attron(COLOR_PAIR(COLOR_GREEN)); +#endif /* A_COLOR */ + (void) addch(MARK_MISS); +#ifdef A_COLOR + (void) attrset(0); +#endif /* A_COLOR */ + } else { + pgoto(y1, x1); + (void) addch(SHOWSPLASH); + } + } + } + } + + for (i = 0; i < ss->length; ++i) { + int x1 = ss->x + i * xincr[ss->dir]; + int y1 = ss->y + i * yincr[ss->dir]; + + hits[turn][x1][y1] = ss->symbol; + if (turn % 2 == PLAYER) { + cgoto(y1, x1); + (void) addch((chtype) (ss->symbol)); + } else { + pgoto(y1, x1); +#ifdef A_COLOR + if (has_colors()) + attron(COLOR_PAIR(COLOR_RED)); +#endif /* A_COLOR */ + (void) addch(SHOWHIT); +#ifdef A_COLOR + (void) attrset(0); +#endif /* A_COLOR */ + } + } + + (void) move(oldy, oldx); + return (ss); + } + } + (void) move(oldy, oldx); + return ((ship_t *) NULL); +} + +static bool +plyturn(void) +{ + ship_t *ss; + bool hit; + NCURSES_CONST char *m = NULL; + + prompt(1, "Where do you want to shoot? ", ""); + for (;;) { + (void) getcoord(COMPUTER); + if (hits[PLAYER][curx][cury]) { + prompt(1, "You shelled this spot already! Try again.", ""); + beep(); + } else + break; + } + hit = IS_SHIP(board[COMPUTER][curx][cury]); + hits[PLAYER][curx][cury] = (char) (hit ? MARK_HIT : MARK_MISS); + cgoto(cury, curx); +#ifdef A_COLOR + if (has_colors()) { + if (hit) + attron(COLOR_PAIR(COLOR_RED)); + else + attron(COLOR_PAIR(COLOR_GREEN)); + } +#endif /* A_COLOR */ + (void) addch((chtype) hits[PLAYER][curx][cury]); +#ifdef A_COLOR + (void) attrset(0); +#endif /* A_COLOR */ + + prompt(1, "You %s.", hit ? "scored a hit" : "missed"); + if (hit && (ss = hitship(curx, cury))) { + switch (rnd(5)) { + case 0: + m = " You sank my %s!"; + break; + case 1: + m = " I have this sinking feeling about my %s...."; + break; + case 2: + m = " My %s has gone to Davy Jones's locker!"; + break; + case 3: + m = " Glub, glub -- my %s is headed for the bottom!"; + break; + case 4: + m = " You'll pick up survivors from my %s, I hope...!"; + break; + } + (void) printw(m, ss->name); + (void) beep(); + } + return (hit); +} + +static int +sgetc(const char *s) +{ + const char *s1; + int ch; + + (void) refresh(); + for (;;) { + ch = getch(); + if (islower(ch)) + ch = toupper(ch); + if (ch == CTRLC) + uninitgame(0); + for (s1 = s; *s1 && ch != *s1; ++s1) + continue; + if (*s1) { + (void) addch((chtype) ch); + (void) refresh(); + return (ch); + } + } +} + +static void +randomfire(int *px, int *py) +/* random-fire routine -- implements simple diagonal-striping strategy */ +{ + static int turncount = 0; + static int srchstep = BEGINSTEP; + static int huntoffs; /* Offset on search strategy */ + int ypossible[BWIDTH * BDEPTH], xpossible[BWIDTH * BDEPTH], nposs; + int ypreferred[BWIDTH * BDEPTH], xpreferred[BWIDTH * BDEPTH], npref; + int x, y, i; + + if (turncount++ == 0) + huntoffs = rnd(srchstep); + + /* first, list all possible moves */ + nposs = npref = 0; + for (x = 0; x < BWIDTH; x++) + for (y = 0; y < BDEPTH; y++) + if (!hits[COMPUTER][x][y]) { + xpossible[nposs] = x; + ypossible[nposs] = y; + nposs++; + if (((x + huntoffs) % srchstep) != (y % srchstep)) { + xpreferred[npref] = x; + ypreferred[npref] = y; + npref++; + } + } + + if (npref) { + i = rnd(npref); + + *px = xpreferred[i]; + *py = ypreferred[i]; + } else if (nposs) { + i = rnd(nposs); + + *px = xpossible[i]; + *py = ypossible[i]; + + if (srchstep > 1) + --srchstep; + } else { + error("No moves possible?? Help!"); + ExitProgram(EXIT_FAILURE); + /*NOTREACHED */ + } +} + +#define S_MISS 0 +#define S_HIT 1 +#define S_SUNK -1 + +static int +cpufire(int x, int y) +/* fire away at given location */ +{ + bool hit, sunk; + ship_t *ss = NULL; + + hit = board[PLAYER][x][y] ? MARK_HIT : MARK_MISS; + hits[COMPUTER][x][y] = (char) hit; + MvPrintw(PROMPTLINE, 0, + "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" : + "miss"); + if ((sunk = (hit && (ss = hitship(x, y)))) != 0) + (void) printw(" I've sunk your %s", ss->name); + (void) clrtoeol(); + + pgoto(y, x); +#ifdef A_COLOR + if (has_colors()) { + if (hit) + attron(COLOR_PAIR(COLOR_RED)); + else + attron(COLOR_PAIR(COLOR_GREEN)); + } +#endif /* A_COLOR */ + (void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH)); +#ifdef A_COLOR + (void) attrset(0); +#endif /* A_COLOR */ + + return hit ? (sunk ? S_SUNK : S_HIT) : S_MISS; +} + +/* + * This code implements a fairly irregular FSM, so please forgive the rampant + * unstructuredness below. The five labels are states which need to be held + * between computer turns. + * + * The FSM is not externally reset to RANDOM_FIRE if the player wins. Instead, + * the other states check for "impossible" conditions which signify a new + * game, then if found transition to RANDOM_FIRE. + */ +static bool +cputurn(void) +{ +#define POSSIBLE(x, y) (ONBOARD(x, y) && !hits[COMPUTER][x][y]) +#define RANDOM_FIRE 0 +#define RANDOM_HIT 1 +#define HUNT_DIRECT 2 +#define FIRST_PASS 3 +#define REVERSE_JUMP 4 +#define SECOND_PASS 5 + static int next = RANDOM_FIRE; + static bool used[4]; + static ship_t ts; + int navail, x, y, d, n; + int hit = S_MISS; + + switch (next) { + case RANDOM_FIRE: /* last shot was random and missed */ + refire: + randomfire(&x, &y); + if (!(hit = cpufire(x, y))) + next = RANDOM_FIRE; + else { + ts.x = x; + ts.y = y; + ts.hits = 1; + next = (hit == S_SUNK) ? RANDOM_FIRE : RANDOM_HIT; + } + break; + + case RANDOM_HIT: /* last shot was random and hit */ + used[E / 2] = used[S / 2] = used[W / 2] = used[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++) { + x = ts.x + xincr[d * 2]; + y = ts.y + yincr[d * 2]; + if (!used[d] && POSSIBLE(x, y)) + navail++; + else + used[d] = TRUE; + } + if (navail == 0) /* no valid places for shots adjacent... */ + goto refire; /* ...so we must random-fire */ + else { + n = rnd(navail) + 1; + for (d = 0; used[d]; d++) ; + /* used[d] is first that == 0 */ + for (; n > 1; n--) + while (used[++d]) ; + /* used[d] is next that == 0 */ + + assert(d < 4); + assert(used[d] == FALSE); + + used[d] = TRUE; + x = ts.x + xincr[d * 2]; + y = ts.y + yincr[d * 2]; + + assert(POSSIBLE(x, y)); + + if (!(hit = cpufire(x, y))) + next = HUNT_DIRECT; + else { + ts.x = x; + ts.y = y; + ts.dir = d * 2; + ts.hits++; + next = (hit == S_SUNK) ? RANDOM_FIRE : FIRST_PASS; + } + } + break; + + case FIRST_PASS: /* we have a start and a direction now */ + x = ts.x + xincr[ts.dir]; + y = ts.y + yincr[ts.dir]; + if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { + ts.x = x; + ts.y = y; + ts.hits++; + next = (hit == S_SUNK) ? RANDOM_FIRE : FIRST_PASS; + } else + next = REVERSE_JUMP; + break; + + case REVERSE_JUMP: /* nail down the ship's other end */ + d = (ts.dir + 4) % 8; + x = ts.x + ts.hits * xincr[d]; + y = ts.y + ts.hits * yincr[d]; + if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { + ts.x = x; + ts.y = y; + ts.dir = d; + ts.hits++; + next = (hit == S_SUNK) ? RANDOM_FIRE : SECOND_PASS; + } else + next = RANDOM_FIRE; + break; + + case SECOND_PASS: /* continue shooting after reversing */ + x = ts.x + xincr[ts.dir]; + y = ts.y + yincr[ts.dir]; + if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { + ts.x = x; + ts.y = y; + ts.hits++; + next = (hit == S_SUNK) ? RANDOM_FIRE : SECOND_PASS; + break; + } else + next = RANDOM_FIRE; + break; + } + + /* pause between shots in salvo */ + if (salvo) { + (void) refresh(); + (void) sleep(1); + } +#ifdef DEBUG + MvPrintw(PROMPTLINE + 2, 0, + "New state %d, x=%d, y=%d, d=%d", + next, x, y, d); +#endif /* DEBUG */ + return ((hit) ? TRUE : FALSE); +} + +static int +playagain(void) +{ + int j; + ship_t *ss; + + 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); + } + + if (awinna()) + ++cpuwon; + else + ++plywon; + j = 18 + (int) strlen(name); + if (plywon >= 10) + ++j; + if (cpuwon >= 10) + ++j; + MvPrintw(1, (COLWIDTH - j) / 2, + "%s: %d Computer: %d", name, plywon, cpuwon); + + prompt(2, (awinna())? "Want to be humiliated again, %s [yn]? " + : "Going to give me a chance for revenge, %s [yn]? ", name); + return (sgetc("YN") == 'Y'); +} + +static void +do_options(int c, char *op[]) +{ + register int i; + + if (c > 1) { + for (i = 1; i < c; i++) { + switch (op[i][0]) { + default: + case '?': + (void) fprintf(stderr, "Usage: battle [-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"); + (void) fprintf(stderr, "\t-c : ships may be adjacent\n"); + ExitProgram(EXIT_FAILURE); + break; + case '-': + switch (op[i][1]) { + case 'b': + blitz = 1; + if (salvo == 1) { + (void) fprintf(stderr, + "Bad Arg: -b and -s are mutually exclusive\n"); + ExitProgram(EXIT_FAILURE); + } + break; + case 's': + salvo = 1; + if (blitz == 1) { + (void) fprintf(stderr, + "Bad Arg: -s and -b are mutually exclusive\n"); + ExitProgram(EXIT_FAILURE); + } + break; + case 'c': + closepack = 1; + break; + default: + (void) fprintf(stderr, + "Bad arg: type \"%s ?\" for usage message\n", + op[0]); + ExitProgram(EXIT_FAILURE); + } + } + } + } +} + +static int +scount(int who) +{ + register int i, shots; + register ship_t *sp; + + if (who) + sp = cpuship; /* count cpu shots */ + else + sp = plyship; /* count player shots */ + + for (i = 0, shots = 0; i < SHIPTYPES; i++, sp++) { + if (sp->hits >= sp->length) + continue; /* dead ship */ + else + shots++; + } + return (shots); +} + +int +main(int argc, char *argv[]) +{ + setlocale(LC_ALL, ""); + + do_options(argc, argv); + + intro(); + do { + initgame(); + while (awinna() == -1) { + if (!blitz) { + if (!salvo) { + if (turn) + (void) cputurn(); + else + (void) plyturn(); + } else { + register int i; + + i = scount(turn); + while (i--) { + if (turn) { + if (cputurn() && awinna() != -1) + i = 0; + } else { + if (plyturn() && awinna() != -1) + i = 0; + } + } + } + } else + while ((turn ? cputurn() : plyturn()) && awinna() == -1) + continue; + turn = OTHER; + } + } while + (playagain()); + uninitgame(0); + /*NOTREACHED */ +} + +/* bs.c ends here */ diff --git a/test/bulgarian-utf8.txt b/test/bulgarian-utf8.txt new file mode 100644 index 00000000000..046c059c81d --- /dev/null +++ b/test/bulgarian-utf8.txt @@ -0,0 +1,6 @@ +Показване на помощна Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ -- 1 +Създаване на дÑлове -- 2 +Избор на дÑл и форматиране -- 3 +ЗапиÑване в Ð¸Ð·Ð±Ñ€Ð°Ð½Ð¸Ñ Ð´Ñл -- 4 +ИнÑталиране на LILO -- 5 +Изход от програмата -- 6 diff --git a/test/cardfile.c b/test/cardfile.c new file mode 100644 index 00000000000..f9557bd64c7 --- /dev/null +++ b/test/cardfile.c @@ -0,0 +1,621 @@ +/**************************************************************************** + * Copyright (c) 1999-2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: cardfile.c,v 1.38 2010/11/14 00:58:45 tom Exp $ + * + * File format: text beginning in column 1 is a title; other text is content. + */ + +#include + +#if USE_LIBFORM && USE_LIBPANEL + +#include +#include + +#define VISIBLE_CARDS 10 +#define OFFSET_CARD 2 +#define pair_1 1 +#define pair_2 2 + +#define isVisible(cardp) ((cardp)->panel != 0) + +enum { + MY_CTRL_x = MAX_FORM_COMMAND + ,MY_CTRL_N + ,MY_CTRL_P + ,MY_CTRL_Q + ,MY_CTRL_W +}; + +typedef struct _card { + struct _card *link; + PANEL *panel; + FORM *form; + char *title; + char *content; +} CARD; + +static CARD *all_cards; +static bool try_color = FALSE; +static char default_name[] = "cardfile.dat"; + +#if !HAVE_STRDUP +#define strdup my_strdup +static char * +strdup(const char *s) +{ + char *p = typeMalloc(char, strlen(s) + 1); + if (p) + strcpy(p, s); + return (p); +} +#endif /* not HAVE_STRDUP */ + +static const char * +skip(const char *buffer) +{ + while (isspace(UChar(*buffer))) + buffer++; + return buffer; +} + +static void +trim(char *buffer) +{ + size_t n = strlen(buffer); + while (n-- && isspace(UChar(buffer[n]))) + buffer[n] = 0; +} + +/*******************************************************************************/ + +static CARD * +add_title(const char *title) +{ + CARD *card, *p, *q; + + for (p = all_cards, q = 0; p != 0; q = p, p = p->link) { + int cmp = strcmp(p->title, title); + if (cmp == 0) + return p; + if (cmp > 0) + break; + } + + card = typeCalloc(CARD, 1); + card->title = strdup(title); + card->content = strdup(""); + + if (q == 0) { + card->link = all_cards; + all_cards = card; + } else { + card->link = q->link; + q->link = card; + } + + return card; +} + +static void +add_content(CARD * card, const char *content) +{ + size_t total, offset; + + content = skip(content); + if ((total = strlen(content)) != 0) { + 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++, " "); + } else { + offset = 0; + if (card->content != 0) + free(card->content); + card->content = typeMalloc(char, total + 1); + } + if (card->content) + strcpy(card->content + offset, content); + } +} + +static CARD * +new_card(void) +{ + CARD *card = add_title(""); + add_content(card, ""); + return card; +} + +static CARD * +find_card(char *title) +{ + CARD *card; + + for (card = all_cards; card != 0; card = card->link) + if (!strcmp(card->title, title)) + break; + + return card; +} + +static void +read_data(char *fname) +{ + FILE *fp; + CARD *card = 0; + char buffer[BUFSIZ]; + + if ((fp = fopen(fname, "r")) != 0) { + while (fgets(buffer, sizeof(buffer), fp)) { + trim(buffer); + if (isspace(UChar(*buffer))) { + if (card == 0) + card = add_title(""); + add_content(card, buffer); + } else if ((card = find_card(buffer)) == 0) { + card = add_title(buffer); + } + } + fclose(fp); + } +} + +/*******************************************************************************/ + +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) { + for (p = all_cards; p != 0; p = p->link) { + FIELD **f = form_fields(p->form); + for (n = 0; f[n] != 0; n++) { + char *s = field_buffer(f[n], 0); + if (s != 0 + && (s = strdup(s)) != 0) { + trim(s); + fprintf(fp, "%s%s\n", n ? "\t" : "", s); + free(s); + } + } + } + fclose(fp); + } +} + +/*******************************************************************************/ + +/* + * Count the cards + */ +static int +count_cards(void) +{ + CARD *p; + int count = 0; + + for (p = all_cards; p != 0; p = p->link) + count++; + + return count; +} + +/* + * Shuffle the panels to keep them in a natural hierarchy. + */ +static void +order_cards(CARD * first, int depth) +{ + if (first) { + if (depth && first->link) + order_cards(first->link, depth - 1); + if (isVisible(first)) + top_panel(first->panel); + } +} + +/* + * Return the next card in the list + */ +static CARD * +next_card(CARD * now) +{ + if (now->link != 0) { + CARD *tst = now->link; + if (isVisible(tst)) + now = tst; + else + (void) next_card(tst); + } + return now; +} + +/* + * Return the previous card in the list + */ +static CARD * +prev_card(CARD * now) +{ + CARD *p; + for (p = all_cards; p != 0; p = p->link) { + if (p->link == now) { + if (!isVisible(p)) + p = prev_card(p); + return p; + } + } + return now; +} + +/* + * Returns the first card in the list that we will display. + */ +static CARD * +first_card(CARD * now) +{ + if (!isVisible(now)) + now = next_card(now); + return now; +} + +/*******************************************************************************/ + +static int +form_virtualize(WINDOW *w) +{ + int c = wgetch(w); + + switch (c) { + case CTRL('W'): + return (MY_CTRL_W); + case CTRL('N'): + return (MY_CTRL_N); + case CTRL('P'): + return (MY_CTRL_P); + case QUIT: + case ESCAPE: + return (MY_CTRL_Q); + + case KEY_BACKSPACE: + return (REQ_DEL_PREV); + case KEY_DC: + return (REQ_DEL_CHAR); + case KEY_LEFT: + return (REQ_LEFT_CHAR); + case KEY_RIGHT: + return (REQ_RIGHT_CHAR); + + case KEY_DOWN: + case KEY_NEXT: + return (REQ_NEXT_FIELD); + case KEY_UP: + case KEY_PREVIOUS: + return (REQ_PREV_FIELD); + + default: + return (c); + } +} + +static FIELD ** +make_fields(CARD * p, int form_high, int form_wide) +{ + FIELD **f = typeCalloc(FIELD *, 3); + + f[0] = new_field(1, form_wide, 0, 0, 0, 0); + set_field_back(f[0], A_REVERSE); + set_field_buffer(f[0], 0, p->title); + field_opts_off(f[0], O_BLANK); + + f[1] = new_field(form_high - 1, form_wide, 1, 0, 0, 0); + set_field_buffer(f[1], 0, p->content); + set_field_just(f[1], JUSTIFY_LEFT); + field_opts_off(f[1], O_BLANK); + + f[2] = 0; + return f; +} + +static void +show_legend(void) +{ + erase(); + move(LINES - 3, 0); + addstr("^Q/ESC -- exit form ^W -- writes data to file\n"); + addstr("^N -- go to next card ^P -- go to previous card\n"); + addstr("Arrow keys move left/right within a field, up/down between fields"); +} + +#if (defined(KEY_RESIZE) && HAVE_WRESIZE) || NO_LEAKS +static void +free_form_fields(FIELD ** f) +{ + int n; + + for (n = 0; f[n] != 0; ++n) { + free_field(f[n]); + } + free(f); +} +#endif + +/*******************************************************************************/ + +static void +cardfile(char *fname) +{ + WINDOW *win; + CARD *p; + CARD *top_card; + int visible_cards; + int panel_wide; + int panel_high; + int form_wide; + int form_high; + int y; + int x; + int ch = ERR; + int finished = FALSE; + + show_legend(); + + /* decide how many cards we can display */ + visible_cards = count_cards(); + while ( + (panel_wide = COLS - (visible_cards * OFFSET_CARD)) < 10 || + (panel_high = LINES - (visible_cards * OFFSET_CARD) - 5) < 5) { + --visible_cards; + } + form_wide = panel_wide - 2; + form_high = panel_high - 2; + y = (visible_cards - 1) * OFFSET_CARD; + x = 0; + + /* make a panel for each CARD */ + for (p = all_cards; p != 0; p = p->link) { + + if ((win = newwin(panel_high, panel_wide, y, x)) == 0) + break; + + wbkgd(win, COLOR_PAIR(pair_2)); + keypad(win, TRUE); + p->panel = new_panel(win); + box(win, 0, 0); + + p->form = new_form(make_fields(p, form_high, form_wide)); + set_form_win(p->form, win); + set_form_sub(p->form, derwin(win, form_high, form_wide, 1, 1)); + post_form(p->form); + + y -= OFFSET_CARD; + x += OFFSET_CARD; + } + + top_card = first_card(all_cards); + order_cards(top_card, visible_cards); + + while (!finished) { + update_panels(); + doupdate(); + + ch = form_virtualize(panel_window(top_card->panel)); + switch (form_driver(top_card->form, ch)) { + case E_OK: + break; + case E_UNKNOWN_COMMAND: + switch (ch) { + case MY_CTRL_Q: + finished = TRUE; + break; + case MY_CTRL_P: + top_card = prev_card(top_card); + order_cards(top_card, visible_cards); + break; + case MY_CTRL_N: + top_card = next_card(top_card); + order_cards(top_card, visible_cards); + break; + case MY_CTRL_W: + form_driver(top_card->form, REQ_VALIDATION); + write_data(fname); + break; +#if defined(KEY_RESIZE) && HAVE_WRESIZE + case KEY_RESIZE: + /* resizeterm already did "something" reasonable, but it cannot + * know much about layout. So let's make it nicer. + */ + panel_wide = COLS - (visible_cards * OFFSET_CARD); + panel_high = LINES - (visible_cards * OFFSET_CARD) - 5; + + form_wide = panel_wide - 2; + form_high = panel_high - 2; + + y = (visible_cards - 1) * OFFSET_CARD; + x = 0; + + show_legend(); + for (p = all_cards; p != 0; p = p->link) { + FIELD **oldf = form_fields(p->form); + WINDOW *olds = form_sub(p->form); + + if (!isVisible(p)) + continue; + win = form_win(p->form); + + /* move and resize the card as needed + * FIXME: if the windows are shrunk too much, this won't do + */ + mvwin(win, y, x); + wresize(win, panel_high, panel_wide); + + /* reconstruct each form. Forms are not resizable, and + * there appears to be no good way to reload the text in + * a resized window. + */ + werase(win); + + unpost_form(p->form); + free_form(p->form); + + p->form = new_form(make_fields(p, form_high, form_wide)); + set_form_win(p->form, win); + set_form_sub(p->form, derwin(win, form_high, form_wide, + 1, 1)); + post_form(p->form); + + free_form_fields(oldf); + delwin(olds); + + box(win, 0, 0); + + y -= OFFSET_CARD; + x += OFFSET_CARD; + } + break; +#endif + default: + beep(); + break; + } + break; + default: + flash(); + break; + } + } +#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); + + unpost_form(p->form); /* ...so we can free it */ + free_form(p->form); /* this also disconnects the fields */ + + free_form_fields(f); + + del_panel(p->panel); + } + free(p->title); + free(p->content); + free(p); + } +#endif +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: view [options] file" + ,"" + ,"Options:" + ," -c use color if terminal supports it" + }; + 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 n; + + setlocale(LC_ALL, ""); + + while ((n = getopt(argc, argv, "c")) != -1) { + switch (n) { + case 'c': + try_color = TRUE; + break; + default: + usage(); + } + } + + initscr(); + cbreak(); + noecho(); + + if (try_color) { + if (has_colors()) { + start_color(); + init_pair(pair_1, COLOR_WHITE, COLOR_BLUE); + init_pair(pair_2, COLOR_WHITE, COLOR_CYAN); + bkgd(COLOR_PAIR(pair_1)); + } else { + try_color = FALSE; + } + } + + if (optind + 1 == argc) { + for (n = 1; n < argc; n++) + read_data(argv[n]); + if (count_cards() == 0) + new_card(); + cardfile(argv[1]); + } else { + read_data(default_name); + if (count_cards() == 0) + new_card(); + cardfile(default_name); + } + + endwin(); + + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the curses form and panel libraries\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/cardfile.dat b/test/cardfile.dat new file mode 100644 index 00000000000..deb4b76a7d8 --- /dev/null +++ b/test/cardfile.dat @@ -0,0 +1,13 @@ +title 1 + Some text for title1 + and some more text +title 2 + The quicker brown fox ran all over the lazy dog. +put a card before the first two + This is an example of a simple cardfile. +show a fourth card + The fourth card + has a large amount of data, + more than the other cards. + At least, that is what I thought it should do, since I want to see how well + the forms package handles justification. diff --git a/test/chgat.c b/test/chgat.c new file mode 100644 index 00000000000..53ecfd7cedf --- /dev/null +++ b/test/chgat.c @@ -0,0 +1,375 @@ +/**************************************************************************** + * Copyright (c) 2006-2009,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"), 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: chgat.c,v 1.11 2010/05/01 19:12:26 tom Exp $ + * + * test-driver for chgat/wchgat/mvchgat/mvwchgat + */ + +#include + +#if HAVE_CHGAT + +#define SHOW(n) ((n) == ERR ? "ERR" : "OK") +#define COLOR_DEFAULT (-1) + +#if defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH < 20060715 +#define touch_if_needed(win, row) touchline(win, row, 1) +#else +#define touch_if_needed(win, row) /* nothing */ +#endif + +typedef struct { + unsigned c; + unsigned v; + short pair; + unsigned attr; + int count; + int ch; + const char *c_msg; + const char *v_msg; + int y_val; + int x_val; + int y_beg, x_beg; + int y_max, x_max; +} STATUS; + +static const char * +color_params(unsigned state, short *pair) +{ + /* *INDENT-OFF* */ + static struct { + short pair; + short fg, bg; + const char *msg; + } table[] = { + { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, + { 1, COLOR_RED, COLOR_BLACK, "red/black" }, + { 2, COLOR_WHITE, COLOR_BLUE, "white/blue" }, + }; + /* *INDENT-ON* */ + + static bool first = TRUE; + const char *result = 0; + + if (has_colors()) { + if (first) { + unsigned n; + + start_color(); + for (n = 0; n < SIZEOF(table); ++n) { + init_pair(table[n].pair, table[n].fg, table[n].bg); + } + } + if (state < SIZEOF(table)) { + *pair = table[state].pair; + result = table[state].msg; + } + } + return result; +} + +static const char * +video_params(unsigned state, unsigned *attr) +{ + /* *INDENT-OFF* */ + static struct { + unsigned attr; + const char *msg; + } table[] = { + { A_NORMAL, "normal" }, + { A_BOLD, "bold" }, + { A_REVERSE, "reverse" }, + { A_UNDERLINE, "underline" }, + { A_BLINK, "blink" }, + }; + /* *INDENT-ON* */ + + const char *result = 0; + + if (state < SIZEOF(table)) { + *attr = table[state].attr; + result = table[state].msg; + } + return result; +} + +/* fill the window with a test-pattern */ +static void +fill_window(WINDOW *win) +{ + int y, x; + int y0 = -1, x0 = -1; + + getyx(win, y, x); + wmove(win, 0, 0); + while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) { + int y1, x1; + getyx(win, y1, x1); + if (y1 == y0 && x1 == x0) + break; + x0 = x1; + y0 = y1; + } + wmove(win, y, x); +} + +static void +show_status(WINDOW *win, STATUS * sp) +{ + int y, x; + + getyx(win, y, x); + wmove(win, 0, 0); + wprintw(win, "Count %d", sp->count); + if (sp->v_msg != 0) + wprintw(win, " Video %s", sp->v_msg); + if (sp->c_msg != 0) + wprintw(win, " Color %s", sp->c_msg); + wclrtoeol(win); + wmove(win, y, x); +} + +static void +do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) +{ + WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, + sp->y_beg + 1, sp->x_beg + 1); + + if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { + WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); + + if (win2 != 0) { + box(win1, 0, 0); + wrefresh(win1); + func(win2); + + delwin(win2); + } else { + beep(); + } + delwin(win1); + touchwin(win); + } else { + beep(); + } +} + +static void +init_status(WINDOW *win, STATUS * sp) +{ + memset(sp, 0, sizeof(*sp)); + sp->c = 99; + sp->v = 99; + sp->ch = ' '; + + keypad(win, TRUE); + fill_window(win); + + getbegyx(win, sp->y_beg, sp->x_beg); + getmaxyx(win, sp->y_max, sp->x_max); +} + +static void +show_help(WINDOW *win) +{ + static const char *table[] = + { + "Basic commands:" + ,"Use h/j/k/l or arrow keys to move the cursor." + ,"Set the count parameter for chgat by entering digits 0-9." + ,"" + ,"Other commands:" + ,"space toggles through the set of video attributes and colors." + ,"t touches (forces repaint) of the current line." + ,". calls *chgat at the current position with the given count." + ,", calls *chgat at the window beginning with the given count." + ,"= resets count to zero." + ,"- negates count." + ,"? shows this help-window" + ,"" + ,"" + }; + + 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(); +} + +static void +update_status(WINDOW *win, STATUS * sp) +{ + switch (sp->ch) { + case ' ': /* next test-iteration */ + if (has_colors()) { + if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { + sp->c_msg = color_params(sp->c = 0, &(sp->pair)); + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + sp->v_msg = video_params(sp->v = 0, &(sp->attr)); + } + } + } else { + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + sp->v_msg = video_params(sp->v = 0, &(sp->attr)); + } + } + sp->count = 0; + show_status(win, sp); + break; + case KEY_LEFT: + case 'h': + if (sp->x_val > 0) + wmove(win, sp->y_val, --(sp->x_val)); + break; + case KEY_DOWN: + case 'j': + if (sp->y_val < sp->y_max) + wmove(win, ++(sp->y_val), sp->x_val); + break; + case KEY_UP: + case 'k': + if (sp->y_val > 0) + wmove(win, --(sp->y_val), sp->x_val); + break; + case KEY_RIGHT: + case 'l': + if (sp->x_val < sp->x_max) + wmove(win, sp->y_val, ++(sp->x_val)); + break; + case 't': + touchline(win, sp->y_val, 1); + break; + case '=': + sp->count = 0; + show_status(win, sp); + break; + case '-': + sp->count = -(sp->count); + show_status(win, sp); + break; + case '?': + do_subwindow(win, sp, show_help); + break; + default: + if (isdigit(sp->ch)) { + sp->count = (sp->count * 10) + (sp->ch - '0'); + show_status(win, sp); + } else { + beep(); + } + break; + } +} + +static void +test_wchgat(WINDOW *win) +{ + STATUS st; + + init_status(win, &st); + + do { + switch (st.ch) { + case '.': /* change from current position */ + wchgat(win, st.count, st.attr, st.pair, (void *) 0); + touch_if_needed(win, st.y_val); + break; + case ',': /* change from beginning of window */ + mvwchgat(win, 0, 0, st.count, st.attr, st.pair, (void *) 0); + touch_if_needed(win, 0); + wmove(win, st.y_val, st.x_val); + break; + case 'w': + do_subwindow(win, &st, test_wchgat); + break; + case 'q': + return; + default: + update_status(win, &st); + break; + } + } while ((st.ch = wgetch(win)) != ERR); +} + +static void +test_chgat(void) +{ + STATUS st; + + init_status(stdscr, &st); + + do { + switch (st.ch) { + case '.': /* change from current position */ + chgat(st.count, st.attr, st.pair, (void *) 0); + touch_if_needed(stdscr, st.y_val); + break; + case ',': /* change from beginning of window */ + mvchgat(0, 0, st.count, st.attr, st.pair, (void *) 0); + touch_if_needed(stdscr, 0); + move(st.y_val, st.x_val); + break; + case 'w': + do_subwindow(stdscr, &st, test_wchgat); + break; + case 'q': + return; + default: + update_status(stdscr, &st); + break; + } + } while ((st.ch = getch()) != ERR); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + initscr(); + cbreak(); + noecho(); + + test_chgat(); + endwin(); + + ExitProgram(EXIT_SUCCESS); +} + +#else +int +main(void) +{ + printf("This program requires the curses chgat function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/clip_printw.c b/test/clip_printw.c new file mode 100644 index 00000000000..5b279e9eb31 --- /dev/null +++ b/test/clip_printw.c @@ -0,0 +1,380 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,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"), 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: clip_printw.c,v 1.7 2010/11/13 20:48:48 tom Exp $ + * + * demonstrate how to use printw without wrapping. + */ + +#include + +#ifdef HAVE_VW_PRINTW + +#define SHOW(n) ((n) == ERR ? "ERR" : "OK") +#define COLOR_DEFAULT (-1) + +typedef struct { + unsigned c; + unsigned v; + int status; + int pair; + attr_t attr; + int count; + int ch; + const char *c_msg; + const char *v_msg; + int y_val; + int x_val; + int y_beg, x_beg; + int y_max, x_max; +} STATUS; + +static int +clip_wprintw(WINDOW *win, NCURSES_CONST char *fmt,...) +{ + int y0, x0, y1, x1, width; + WINDOW *sub; + va_list ap; + int rc; + + /* + * Allocate a single-line derived window extending from the current + * cursor position to the end of the current line in the given window. + * Disable scrolling in the derived window. + */ + getyx(win, y0, x0); + width = getmaxx(win) - x0; + sub = derwin(win, 1, width, y0, x0); + scrollok(sub, FALSE); + + /* + * Print the text. + */ + va_start(ap, fmt); + rc = vw_printw(sub, fmt, ap); + va_end(ap); + + getyx(sub, y1, x1); + delwin(sub); + + wmove(win, y1 + y0, x1 + x0); + + return rc; +} + +static const char * +color_params(unsigned state, int *pair) +{ + /* *INDENT-OFF* */ + static struct { + int pair; + int fg, bg; + const char *msg; + } table[] = { + { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, + { 1, COLOR_RED, COLOR_BLACK, "red/black" }, + { 2, COLOR_WHITE, COLOR_BLUE, "white/blue" }, + }; + /* *INDENT-ON* */ + + static bool first = TRUE; + const char *result = 0; + + if (has_colors()) { + if (first) { + unsigned n; + + start_color(); + for (n = 0; n < SIZEOF(table); ++n) { + init_pair((short) table[n].pair, + (short) table[n].fg, + (short) table[n].bg); + } + } + if (state < SIZEOF(table)) { + *pair = table[state].pair; + result = table[state].msg; + } + } + return result; +} + +static const char * +video_params(unsigned state, attr_t *attr) +{ + /* *INDENT-OFF* */ + static struct { + attr_t attr; + const char *msg; + } table[] = { + { A_NORMAL, "normal" }, + { A_BOLD, "bold" }, + { A_REVERSE, "reverse" }, + { A_UNDERLINE, "underline" }, + { A_BLINK, "blink" }, + }; + /* *INDENT-ON* */ + + const char *result = 0; + + if (state < SIZEOF(table)) { + *attr = table[state].attr; + result = table[state].msg; + } + return result; +} + +/* fill the window with a test-pattern */ +static void +fill_window(WINDOW *win) +{ + int y, x; + int y0 = -1, x0 = -1; + + getyx(win, y, x); + wmove(win, 0, 0); + while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) { + int y1, x1; + getyx(win, y1, x1); + if (y1 == y0 && x1 == x0) + break; + x0 = x1; + y0 = y1; + } + wmove(win, y, x); +} + +static void +show_status(WINDOW *win, STATUS * sp) +{ + int y, x; + + getyx(win, y, x); + wmove(win, 0, 0); + wprintw(win, "Count %d", sp->count); + if (sp->v_msg != 0) + wprintw(win, " Video %s", sp->v_msg); + if (sp->c_msg != 0) + wprintw(win, " Color %s", sp->c_msg); + wprintw(win, " (%d)", sp->status); + wclrtoeol(win); + wmove(win, y, x); +} + +static void +do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) +{ + WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, + sp->y_beg + 1, sp->x_beg + 1); + + if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { + WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); + + if (win2 != 0) { + box(win1, 0, 0); + wrefresh(win1); + func(win2); + + delwin(win2); + } else { + beep(); + } + delwin(win1); + touchwin(win); + } else { + beep(); + } +} + +static void +init_status(WINDOW *win, STATUS * sp) +{ + memset(sp, 0, sizeof(*sp)); + sp->c = 99; + sp->v = 99; + sp->ch = ' '; + + keypad(win, TRUE); + fill_window(win); + + getbegyx(win, sp->y_beg, sp->x_beg); + getmaxyx(win, sp->y_max, sp->x_max); +} + +static void +show_help(WINDOW *win) +{ + static const char *table[] = + { + "Basic commands:" + ,"Use h/j/k/l or arrow keys to move the cursor." + ,"Set the count parameter for clip_wprintw by entering digits 0-9." + ,"" + ,"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." + ,"= resets count to zero." + ,"? shows this help-window" + ,"" + }; + + 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(); +} + +static void +update_status(WINDOW *win, STATUS * sp) +{ + switch (sp->ch) { + case ' ': /* next test-iteration */ + if (has_colors()) { + if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { + sp->c_msg = color_params(sp->c = 0, &(sp->pair)); + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + sp->v_msg = video_params(sp->v = 0, &(sp->attr)); + } + } + } else { + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + sp->v_msg = video_params(sp->v = 0, &(sp->attr)); + } + } + sp->count = 0; + show_status(win, sp); + break; + case KEY_LEFT: + case 'h': + if (sp->x_val > 0) + wmove(win, sp->y_val, --(sp->x_val)); + break; + case KEY_DOWN: + case 'j': + if (sp->y_val < sp->y_max) + wmove(win, ++(sp->y_val), sp->x_val); + break; + case KEY_UP: + case 'k': + if (sp->y_val > 0) + wmove(win, --(sp->y_val), sp->x_val); + break; + case KEY_RIGHT: + case 'l': + if (sp->x_val < sp->x_max) + wmove(win, sp->y_val, ++(sp->x_val)); + break; + case 't': + touchline(win, sp->y_val, 1); + break; + case '=': + sp->count = 0; + show_status(win, sp); + break; + case '?': + do_subwindow(win, sp, show_help); + break; + default: + if (isdigit(sp->ch)) { + sp->count = (sp->count * 10) + (sp->ch - '0'); + show_status(win, sp); + } else { + beep(); + } + break; + } +} + +static void +test_clipping(WINDOW *win) +{ + STATUS st; + char fmt[80]; + char *buffer; + unsigned j, need; + + init_status(win, &st); + + do { + switch (st.ch) { + case '.': /* change from current position */ + (void) wattrset(win, st.attr | (chtype) COLOR_PAIR(st.pair)); + if (st.count > 0) { + need = (unsigned) st.count + 1; + sprintf(fmt, "%%c%%%ds%%c", st.count); + } else { + need = (unsigned) getmaxx(win) - 1; + strcpy(fmt, "%c%s%c"); + } + if ((buffer = typeMalloc(char, need)) != 0) { + for (j = 0; j < need; ++j) { + buffer[j] = (char) ('A' + (j % 26)); + } + buffer[need - 1] = '\0'; + st.status = clip_wprintw(win, fmt, '[', buffer, ']'); + } + break; + case 'w': + do_subwindow(win, &st, test_clipping); + break; + case 'q': + return; + default: + update_status(win, &st); + break; + } + } while ((st.ch = wgetch(win)) != ERR); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + initscr(); + cbreak(); + noecho(); + + test_clipping(stdscr); + endwin(); + + ExitProgram(EXIT_SUCCESS); +} + +#else +int +main(void) +{ + printf("This program requires the curses vw_printw function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/color_set.c b/test/color_set.c new file mode 100644 index 00000000000..2e981cba9f1 --- /dev/null +++ b/test/color_set.c @@ -0,0 +1,92 @@ +/**************************************************************************** + * Copyright (c) 2003-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 * + * "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_set.c,v 1.6 2008/02/10 00:18:01 tom Exp $ + */ + +#include + +#if HAVE_COLOR_SET + +#define SHOW(n) ((n) == ERR ? "ERR" : "OK") + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + short f, b; + int i; + + initscr(); + cbreak(); + noecho(); + + if (has_colors()) { + start_color(); + + pair_content(0, &f, &b); + printw("pair 0 contains (%d,%d)\n", f, b); + getch(); + + printw("Initializing pair 1 to red/black\n"); + init_pair(1, COLOR_RED, COLOR_BLACK); + i = color_set(1, NULL); + printw("RED/BLACK (%s)\n", SHOW(i)); + getch(); + + printw("Initializing pair 2 to white/blue\n"); + init_pair(2, COLOR_WHITE, COLOR_BLUE); + i = color_set(2, NULL); + printw("WHITE/BLUE (%s)\n", SHOW(i)); + getch(); + + printw("Resetting colors to pair 0\n"); + i = color_set(0, NULL); + printw("Default Colors (%s)\n", SHOW(i)); + getch(); + + printw("Resetting colors to pair 1\n"); + i = color_set(1, NULL); + printw("RED/BLACK (%s)\n", SHOW(i)); + getch(); + + } else { + printw("This demo requires a color terminal"); + getch(); + } + endwin(); + + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the curses color_set function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/configure b/test/configure new file mode 100755 index 00000000000..ab87e4eaed5 --- /dev/null +++ b/test/configure @@ -0,0 +1,15873 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52.20101001. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="ncurses.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:894: 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" + fi +done + +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:905: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:913: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:929: 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:933: 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:939: 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:941: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:943: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:962: 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:964: 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 + +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 + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:988: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin" + +test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ ) + +test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ ) + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:1020: 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 +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +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:1030: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1034: 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 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:1043: 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:1047: 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:1052: 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/'` +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:1060: 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 +else + ac_cv_host_alias=$host_alias +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:1069: 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:1074: 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/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + system_name="$host_os" +else + system_name="`(uname -s -r) 2>/dev/null`" + if test -z "$system_name" ; then + system_name="`(hostname) 2>/dev/null`" + fi +fi +test -n "$system_name" && cat >>confdefs.h <&6 +else + cf_cv_system_name="$system_name" +fi + +test -z "$system_name" && system_name="$cf_cv_system_name" +test -n "$cf_cv_system_name" && echo "$as_me:1099: 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:1103: 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:1105: 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 + +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +echo "$as_me:1123: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:1143: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:1147: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +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 +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:1161: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1176: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1184: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1187: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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:1196: 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 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1211: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1219: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1222: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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:1235: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1250: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1258: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1261: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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:1270: 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 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1285: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1293: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1296: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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:1309: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1329: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1351: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1354: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + 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:1365: 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 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1380: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1388: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1391: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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:1404: 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 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:1419: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1427: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1430: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1442: 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:1447:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1450: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1453: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1455: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1458: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1460: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1463: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1467 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +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:1483: 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:1486: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1489: \$? = $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 +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1512: 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:1518: 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:1523: 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:1529: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1532: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1539: 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;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1547: 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:1554: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1556: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1559: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1561: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1564: \$? = $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 +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1580: 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:1586: 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:1592: 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 1598 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1613: \$? = $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 + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1625: 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:1632: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1636: 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 1642 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1660: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1663: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1666: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1678: 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:1684: 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 1690 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1705: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1708: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1711: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1721: 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 +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1751: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1754: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1757: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1769 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1785: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1788: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1791: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1801 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1816: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1819: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1822: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -rf conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +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 + +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:1856: 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 + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # 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 1877 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1882: \"$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:1888: \$? = $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 + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +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 1911 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1915: \"$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:1921: \$? = $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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:1958: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # 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 1968 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1973: \"$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:1979: \$? = $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 + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +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 2002 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2006: \"$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:2012: \$? = $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 + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:2040: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +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 + +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:2056: 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 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AWK="$ac_prog" +echo "$as_me:2071: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:2079: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:2082: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# 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:2101: 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 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if $as_executable_p "$ac_dir/$ac_prog"; then + if test $ac_prog = install && + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:2150: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +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%^.*/%%'` + ;; +esac + +for ac_prog in tdlint lint alint splint lclint +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:2175: 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 +else + if test -n "$LINT"; then + ac_cv_prog_LINT="$LINT" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_LINT="$ac_prog" +echo "$as_me:2190: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +LINT=$ac_cv_prog_LINT +if test -n "$LINT"; then + echo "$as_me:2198: result: $LINT" >&5 +echo "${ECHO_T}$LINT" >&6 +else + echo "$as_me:2201: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LINT" && break +done + +echo "$as_me:2208: 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*|*-mingw32*|*-uwin*) #(vi + cf_cv_mixedcase=no + ;; + *) + cf_cv_mixedcase=yes + ;; + esac +else + rm -f conftest CONFTEST + echo test >conftest + if test -f CONFTEST ; then + cf_cv_mixedcase=no + else + cf_cv_mixedcase=yes + fi + rm -f conftest CONFTEST +fi + +fi +echo "$as_me:2235: result: $cf_cv_mixedcase" >&5 +echo "${ECHO_T}$cf_cv_mixedcase" >&6 +test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF +#define MIXEDCASE_FILENAMES 1 +EOF + +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:2245: 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 +else + if test -n "$CTAGS"; then + ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CTAGS="$ac_prog" +echo "$as_me:2260: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CTAGS=$ac_cv_prog_CTAGS +if test -n "$CTAGS"; then + echo "$as_me:2268: result: $CTAGS" >&5 +echo "${ECHO_T}$CTAGS" >&6 +else + echo "$as_me:2271: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CTAGS" && break +done + +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:2282: 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 +else + if test -n "$ETAGS"; then + ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ETAGS="$ac_prog" +echo "$as_me:2297: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ETAGS=$ac_cv_prog_ETAGS +if test -n "$ETAGS"; then + echo "$as_me:2305: result: $ETAGS" >&5 +echo "${ECHO_T}$ETAGS" >&6 +else + echo "$as_me:2308: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ETAGS" && break +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:2317: 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 +else + if test -n "$MAKE_LOWER_TAGS"; then + ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE_LOWER_TAGS="yes" +echo "$as_me:2332: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" +fi +fi +MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS +if test -n "$MAKE_LOWER_TAGS"; then + echo "$as_me:2341: result: $MAKE_LOWER_TAGS" >&5 +echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 +else + echo "$as_me:2344: 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:2351: 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 +else + if test -n "$MAKE_UPPER_TAGS"; then + ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE_UPPER_TAGS="yes" +echo "$as_me:2366: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" +fi +fi +MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS +if test -n "$MAKE_UPPER_TAGS"; then + echo "$as_me:2375: result: $MAKE_UPPER_TAGS" >&5 +echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 +else + echo "$as_me:2378: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +else + MAKE_UPPER_TAGS=no +fi + +if test "$MAKE_UPPER_TAGS" = yes ; then + MAKE_UPPER_TAGS= +else + MAKE_UPPER_TAGS="#" +fi + +if test "$MAKE_LOWER_TAGS" = yes ; then + MAKE_LOWER_TAGS= +else + MAKE_LOWER_TAGS="#" +fi + +echo "$as_me:2398: 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 2405 "configure" +#include "confdefs.h" + + #include + #include + +int +main () +{ +double x = rand(); printf("result = %g\n", sin(x)) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2420: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2423: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2426: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2429: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_need_libm=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_need_libm=yes +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:2439: result: $cf_cv_need_libm" >&5 +echo "${ECHO_T}$cf_cv_need_libm" >&6 +if test "$cf_cv_need_libm" = yes +then +MATH_LIB=-lm +fi + +CC_G_OPT="-g" +CC_SHARED_OPTS=unknown +CPPFLAGS="$CPPFLAGS" +DFT_DEP_SUFFIX="" +DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` +DFT_UPR_MODEL="NORMAL" +LD="ld" +LDFLAGS_SHARED="" +LDFLAGS_STATIC="" +LD_MODEL="" +LD_SHARED_OPTS="" +LIBTOOL="" +LIB_CLEAN="" +LIB_COMPILE="" +LIB_LINK='${CC}' +LINK_TESTS="" +LOCAL_LDFLAGS="" +PTHREAD="-lm" +TEST_ARGS="" +TEST_DEPS="" +TEST_LIBS="" +TINFO_ARGS='$(LIBS_CURSES)' +cf_cv_abi_version="" +cf_cv_rel_version="" + +cf_cv_screen=curses +cf_cv_libtype= + +echo "$as_me:2474: checking for ${CC:-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 +if test "${cf_cv_ansi_cc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cf_cv_ansi_cc=no +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc +# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) +for cf_arg in "-DCC_HAS_PROTOS" \ + "" \ + -qlanglvl=ansi \ + -std1 \ + -Ae \ + "-Aa -D_HPUX_SOURCE" \ + -Xc +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 #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + cat >conftest.$ac_ext <<_ACEOF +#line 2578 "configure" +#include "confdefs.h" + +#ifndef CC_HAS_PROTOS +#if !defined(__STDC__) || (__STDC__ != 1) +choke me +#endif +#endif + +int +main () +{ + + int test (int i, double x); + struct s1 {int (*f) (int a);}; + struct s2 {int (*f) (double a);}; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2599: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2602: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2605: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2608: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ansi_cc="$cf_arg"; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +CFLAGS="$cf_save_CFLAGS" +CPPFLAGS="$cf_save_CPPFLAGS" + +fi +echo "$as_me:2621: result: $cf_cv_ansi_cc" >&5 +echo "${ECHO_T}$cf_cv_ansi_cc" >&6 + +if test "$cf_cv_ansi_cc" != "no"; then +if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_cv_ansi_cc +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +else + cat >>confdefs.h <<\EOF +#define CC_HAS_PROTOS 1 +EOF + +fi +fi + +if test "$cf_cv_ansi_cc" = "no"; then + { { echo "$as_me:2714: error: Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto" >&5 +echo "$as_me: error: Your compiler does not appear to recognize prototypes. +You have the following choices: + a. adjust your compiler options + b. get an up-to-date compiler + c. use a wrapper such as unproto" >&2;} + { (exit 1); exit 1; }; } +fi + +if test "$GCC" = yes +then +cat > conftest.i <&5 +echo "$as_me: checking for $CC __attribute__ directives..." >&6;} +cat > conftest.$ac_ext <&5 + + case $cf_attribute in #(vi + printf) #(vi + cf_printf_attribute=yes + cat >conftest.h <conftest.h <conftest.h <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2800: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:2802: result: ... $cf_attribute" >&5 +echo "${ECHO_T}... $cf_attribute" >&6 + cat conftest.h >>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h +fi +rm -rf conftest* +fi + +cf_XOPEN_SOURCE=500 +cf_POSIX_C_SOURCE=199506L +cf_xopen_source= + +case $host_os in #(vi +aix[456]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +darwin[0-8].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" + ;; +freebsd*|dragonfly*) #(vi + # 5.x headers associate + # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L + # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L + cf_POSIX_C_SOURCE=200112L + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + ;; +hpux*) #(vi + cf_xopen_source="-D_HPUX_SOURCE" + ;; +irix[56].*) #(vi + cf_xopen_source="-D_SGI_SOURCE" + ;; +linux*|gnu*|mint*|k*bsd*-gnu) #(vi + +echo "$as_me:2870: 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 2877 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2892: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2895: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2898: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2901: \$? = $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 2910 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2925: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2928: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2931: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2934: \$? = $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_cv_gnu_source=yes +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:2949: 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" + + ;; +mirbsd*) #(vi + # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks + ;; +netbsd*) #(vi + # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + ;; +openbsd*) #(vi + # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw + ;; +osf[45]*) #(vi + cf_xopen_source="-D_OSF_SOURCE" + ;; +nto-qnx*) #(vi + cf_xopen_source="-D_QNX_SOURCE" + ;; +sco*) #(vi + # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer + ;; +solaris2.1[0-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[1-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__" + ;; +*) + echo "$as_me:2979: 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 2986 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3004: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3007: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3010: \$? = $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" + cat >conftest.$ac_ext <<_ACEOF +#line 3019 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _XOPEN_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3034: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3037: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3040: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3043: \$? = $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_cv_xopen_source=$cf_XOPEN_SOURCE +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:3058: result: $cf_cv_xopen_source" >&5 +echo "${ECHO_T}$cf_cv_xopen_source" >&6 + if test "$cf_cv_xopen_source" != no ; then + +CFLAGS=`echo "$CFLAGS" | \ + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + fi + +cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE + +cf_save_CFLAGS="$CFLAGS" +cf_save_CPPFLAGS="$CPPFLAGS" + +cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` + +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:3165: 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}:3171: testing if the symbol is already defined go no further ..." 1>&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 3174 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _POSIX_C_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3189: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3192: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3195: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3198: \$? = $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 + cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" + ;; + .2) #(vi + 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 3219 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifdef _POSIX_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3234: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3237: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3240: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3243: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" +fi +rm -f conftest.$ac_objext conftest.$ac_ext + fi + +echo "${as_me:-configure}:3254: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 + + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + +echo "${as_me:-configure}:3259: testing if the second compile does not leave our definition intact error ..." 1>&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 3262 "configure" +#include "confdefs.h" +#include +int +main () +{ + +#ifndef _POSIX_C_SOURCE +make an error +#endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3277: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3280: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3283: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3286: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_posix_c_source=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:3302: 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 + CFLAGS="$cf_trim_CFLAGS" + CPPFLAGS="$cf_trim_CPPFLAGS" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + + ;; +esac + +if test -n "$cf_xopen_source" ; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + +echo "$as_me:3474: 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 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line 3482 "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:3531: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3534: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3537: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3540: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:3557: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:3560: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:3565: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3571 "configure" +#include "confdefs.h" + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3629: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3632: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3635: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3638: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:3648: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\EOF +#define const +EOF + +fi + +echo "$as_me:3658: 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 +else + + for cf_type in \ + "volatile sig_atomic_t" \ + "sig_atomic_t" \ + "int" + do + cat >conftest.$ac_ext <<_ACEOF +#line 3670 "configure" +#include "confdefs.h" + +#include +#include +#include + +extern $cf_type x; +$cf_type x; +static void handler(int sig) +{ + x = 5; +} +int +main () +{ +signal(SIGINT, handler); + x = 1 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3693: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3696: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3699: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3702: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_sig_atomic_t=$cf_type +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_sig_atomic_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + test "$cf_cv_sig_atomic_t" != no && break + done + +fi + +echo "$as_me:3716: 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 <&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 + + ECHO_LT='--silent' + ECHO_LD='@echo linking $@;' + RULE_CC='@echo compiling $<' + SHOW_CC='@echo compiling $@' + ECHO_CC='@' + + else + + ECHO_LT='' + ECHO_LD='' + RULE_CC='' + SHOW_CC='' + ECHO_CC='' + + fi +else + enableval=yes + + ECHO_LT='' + ECHO_LD='' + RULE_CC='' + SHOW_CC='' + ECHO_CC='' + +fi; +echo "$as_me:3756: result: $enableval" >&5 +echo "${ECHO_T}$enableval" >&6 + +GCC_VERSION=none +if test "$GCC" = yes ; then + echo "$as_me:3761: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + test -z "$GCC_VERSION" && GCC_VERSION=unknown + echo "$as_me:3765: result: $GCC_VERSION" >&5 +echo "${ECHO_T}$GCC_VERSION" >&6 +fi + +if ( test "$GCC" = yes || test "$GXX" = yes ) +then +echo "$as_me:3771: 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 + with_warnings=yes + else + with_warnings=no + fi +else + enableval=no + with_warnings=no + +fi; +echo "$as_me:3788: result: $with_warnings" >&5 +echo "${ECHO_T}$with_warnings" >&6 +if test "$with_warnings" = "yes" +then + +if test "$GCC" = yes +then +cat > conftest.i <&5 +echo "$as_me: checking for $CC __attribute__ directives..." >&6;} +cat > conftest.$ac_ext <&5 + + case $cf_attribute in #(vi + printf) #(vi + cf_printf_attribute=yes + cat >conftest.h <conftest.h <conftest.h <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3866: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:3868: result: ... $cf_attribute" >&5 +echo "${ECHO_T}... $cf_attribute" >&6 + cat conftest.h >>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h +fi +rm -rf conftest* +fi + +INTEL_COMPILER=no + +if test "$GCC" = yes ; then + case $host_os in + linux*|gnu*) + echo "$as_me:3908: 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 3913 "configure" +#include "confdefs.h" + +int +main () +{ + +#ifdef __INTEL_COMPILER +#else +make an error +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3930: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3933: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3936: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3939: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + INTEL_COMPILER=yes +cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" + +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:3950: result: $INTEL_COMPILER" >&5 +echo "${ECHO_T}$INTEL_COMPILER" >&6 + ;; + esac +fi + +cat > conftest.$ac_ext <&5 +echo "$as_me: checking for $CC warning options..." >&6;} + cf_save_CFLAGS="$CFLAGS" + EXTRA_CFLAGS="-Wall" + for cf_opt in \ + wd1419 \ + wd1683 \ + wd1684 \ + wd193 \ + wd593 \ + wd279 \ + wd810 \ + wd869 \ + wd981 + do + CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" + if { (eval echo "$as_me:3990: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3993: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:3995: 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 +then + { echo "$as_me:4004: checking for $CC warning options..." >&5 +echo "$as_me: checking for $CC warning options..." >&6;} + cf_save_CFLAGS="$CFLAGS" + EXTRA_CFLAGS= + cf_warn_CONST="" + test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" + for cf_opt in W Wall \ + Wbad-function-cast \ + Wcast-align \ + Wcast-qual \ + Winline \ + Wmissing-declarations \ + Wmissing-prototypes \ + Wnested-externs \ + Wpointer-arith \ + Wshadow \ + Wstrict-prototypes \ + Wundef $cf_warn_CONST + do + CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" + if { (eval echo "$as_me:4024: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4027: \$? = $ac_status" >&5 + (exit $ac_status); }; then + test -n "$verbose" && echo "$as_me:4029: result: ... -$cf_opt" >&5 +echo "${ECHO_T}... -$cf_opt" >&6 + case $cf_opt in #(vi + Wcast-qual) #(vi + CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" + ;; + Winline) #(vi + case $GCC_VERSION in + [34].*) + test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 + +echo "${as_me:-configure}:4040: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 + + continue;; + esac + ;; + esac + EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" + fi + done + CFLAGS="$cf_save_CFLAGS" +fi +rm -rf conftest* + +fi +fi + +echo "$as_me:4056: 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. +if test "${with_dmalloc+set}" = set; then + withval="$with_dmalloc" + cat >>confdefs.h <<\EOF +#define USE_DMALLOC 1 +EOF + + : ${with_cflags:=-g} + : ${with_no_leaks:=yes} + with_dmalloc=yes +else + with_dmalloc= +fi; +echo "$as_me:4072: result: ${with_dmalloc:-no}" >&5 +echo "${ECHO_T}${with_dmalloc:-no}" >&6 + +case .$with_cflags in #(vi +.*-g*) + case .$CFLAGS in #(vi + .*-g*) #(vi + ;; + *) + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + ;; + esac + ;; +esac + +if test "$with_dmalloc" = yes ; then + echo "$as_me:4166: 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 4172 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:4176: \"$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:4182: \$? = $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 + ac_cv_header_dmalloc_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_dmalloc_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:4201: 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:4205: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldmalloc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 4213 "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 dmalloc_debug (); +int +main () +{ +dmalloc_debug (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4232: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4235: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4238: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4241: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dmalloc_dmalloc_debug=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dmalloc_dmalloc_debug=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:4252: 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 <&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. +if test "${with_dbmalloc+set}" = set; then + withval="$with_dbmalloc" + cat >>confdefs.h <<\EOF +#define USE_DBMALLOC 1 +EOF + + : ${with_cflags:=-g} + : ${with_no_leaks:=yes} + with_dbmalloc=yes +else + with_dbmalloc= +fi; +echo "$as_me:4283: result: ${with_dbmalloc:-no}" >&5 +echo "${ECHO_T}${with_dbmalloc:-no}" >&6 + +case .$with_cflags in #(vi +.*-g*) + case .$CFLAGS in #(vi + .*-g*) #(vi + ;; + *) + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + ;; + esac + ;; +esac + +if test "$with_dbmalloc" = yes ; then + echo "$as_me:4377: 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 4383 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:4387: \"$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:4393: \$? = $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 + ac_cv_header_dbmalloc_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_dbmalloc_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:4412: 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:4416: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldbmalloc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 4424 "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 debug_malloc (); +int +main () +{ +debug_malloc (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4443: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4446: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4449: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4452: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dbmalloc_debug_malloc=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dbmalloc_debug_malloc=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:4463: 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 <&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. +if test "${with_valgrind+set}" = set; then + withval="$with_valgrind" + cat >>confdefs.h <<\EOF +#define USE_VALGRIND 1 +EOF + + : ${with_cflags:=-g} + : ${with_no_leaks:=yes} + with_valgrind=yes +else + with_valgrind= +fi; +echo "$as_me:4494: result: ${with_valgrind:-no}" >&5 +echo "${ECHO_T}${with_valgrind:-no}" >&6 + +case .$with_cflags in #(vi +.*-g*) + case .$CFLAGS in #(vi + .*-g*) #(vi + ;; + *) + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + ;; + esac + ;; +esac + +echo "$as_me:4587: 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. +if test "${enable_leaks+set}" = set; then + enableval="$enable_leaks" + if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi +else + : ${with_no_leaks:=no} +fi; +echo "$as_me:4597: result: $with_no_leaks" >&5 +echo "${ECHO_T}$with_no_leaks" >&6 + +if test "$with_no_leaks" = yes ; then + cat >>confdefs.h <<\EOF +#define NO_LEAKS 1 +EOF + + cat >>confdefs.h <<\EOF +#define YY_NO_LEAKS 1 +EOF + +fi + +echo "$as_me:4611: 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. +if test "${with_curses_dir+set}" = set; then + withval="$with_curses_dir" + cf_cv_curses_dir=$withval +else + cf_cv_curses_dir=no +fi; +echo "$as_me:4621: 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" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$withval" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:4652: 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" + then + +if test -n "$cf_cv_curses_dir/include" ; then + for cf_add_incdir in $cf_cv_curses_dir/include + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 4685 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4697: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4700: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4703: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4706: \$? = $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}:4723: 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 + 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 + +echo "${as_me:-configure}:4757: testing adding $cf_add_libdir to library-path ..." 1>&5 + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + fi +fi + +# Check whether --with-5lib or --without-5lib was given. +if test "${with_5lib+set}" = set; then + withval="$with_5lib" + LIBS="-L/usr/5lib $LIBS" + CPPFLAGS="$CPPFLAGS -I/usr/5include" +fi; + +# Check whether --with-ncursesw or --without-ncursesw was given. +if test "${with_ncursesw+set}" = set; then + withval="$with_ncursesw" + cf_cv_screen=ncursesw +else + +# Check whether --with-ncurses or --without-ncurses was given. +if test "${with_ncurses+set}" = set; then + withval="$with_ncurses" + cf_cv_screen=ncurses +else + +# Check whether --with-pdcurses or --without-pdcurses was given. +if test "${with_pdcurses+set}" = set; then + withval="$with_pdcurses" + cf_cv_screen=pdcurses +fi; +fi; +fi; + +case $cf_cv_screen in +curses) + +echo "$as_me:4798: 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 + test -d /usr/include/curses_colr && \ + cf_cv_curses_incdir="-I/usr/include/curses_colr" + ;; +sunos3*|sunos4*) + test -d /usr/5lib && \ + test -d /usr/5include && \ + cf_cv_curses_incdir="-I/usr/5include" + ;; +esac + +fi +echo "$as_me:4818: 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" + +echo "$as_me:4822: 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 \ + curses.h \ + ncurses.h ncurses/curses.h ncurses/ncurses.h +do +cat >conftest.$ac_ext <<_ACEOF +#line 4834 "configure" +#include "confdefs.h" +#include <${cf_header}> +int +main () +{ +initscr(); tgoto("?", 0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4846: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4849: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4852: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4855: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_header=$cf_header; 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:4866: 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:4870: error: No curses header-files found" >&5 +echo "$as_me: error: No curses header-files found" >&2;} + { (exit 1); exit 1; }; } +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. + +for ac_header in $cf_cv_ncurses_header +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:4880: 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 4886 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:4890: \"$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:4896: \$? = $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:4915: 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 <&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 + 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 4943 "configure" +#include "confdefs.h" +#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> + +int +main () +{ +int x = auto_left_margin + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4958: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4961: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4964: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4967: \$? = $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:4983: 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) + cat >>confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + 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 + +echo "$as_me:5012: 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 +else + + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + if test "$cross_compiling" = yes; then + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" + { (eval echo "$as_me:5038: \"$cf_try\"") >&5 + (eval $cf_try) 2>&5 + ac_status=$? + echo "$as_me:5041: \$? = $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%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi + +else + cat >conftest.$ac_ext <<_ACEOF +#line 5051 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:5076: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5079: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:5081: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5084: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_ncurses_version=`cat $cf_tempfile` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f $cf_tempfile + +fi +echo "$as_me:5098: 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:5104: 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 5107 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr(); tgoto("?", 0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5119: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5122: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5125: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5128: \$? = $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 +echo "$as_me:5137: 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:5143: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmytinfo $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5151 "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 tgoto (); +int +main () +{ +tgoto (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5170: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5173: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5176: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5179: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mytinfo_tgoto=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_mytinfo_tgoto=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5190: 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 + LIBS="-lmytinfo $LIBS" +fi + + ;; +hpux10.*) #(vi + echo "$as_me:5198: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcur_colr $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5206 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5225: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5228: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5231: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5234: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_cur_colr_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_cur_colr_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5245: 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 + + LIBS="-lcur_colr $LIBS" + ac_cv_func_initscr=yes + +else + + echo "$as_me:5254: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lHcurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5262 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5281: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5284: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5287: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5290: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Hcurses_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_Hcurses_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5301: 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. + LIBS="-lHcurses $LIBS" + CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES" + ac_cv_func_initscr=yes + +fi + +fi + + ;; +linux*) # Suse Linux does not follow /usr/lib convention + +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 + +echo "${as_me:-configure}:5336: testing adding $cf_add_libdir to library-path ..." 1>&5 + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + ;; +sunos3*|sunos4*) + 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 + +echo "${as_me:-configure}:5367: testing adding $cf_add_libdir to library-path ..." 1>&5 + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + LIBS="-lcurses -ltermcap $LIBS" + fi + ac_cv_func_initscr=yes + ;; +esac + +if test ".$ac_cv_func_initscr" != .yes ; then + cf_save_LIBS="$LIBS" + cf_term_lib="" + cf_curs_lib="" + + if test ".${cf_cv_ncurses_version:-no}" != .no + then + cf_check_list="ncurses curses cursesX" + else + cf_check_list="cursesX curses ncurses" + fi + + # Check for library containing tgoto. Do this before curses library + # because it may be needed to link the test-case for initscr. + echo "$as_me:5395: 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 5401 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char tgoto (); below. */ +#include +/* 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 tgoto (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5432: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5435: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5438: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5441: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_tgoto=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_tgoto=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5451: 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 +else + + for cf_term_lib in $cf_check_list termcap termlib unknown + do + as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh` +echo "$as_me:5460: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$cf_term_lib $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5468 "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 tgoto (); +int +main () +{ +tgoto (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5487: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5490: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5493: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5496: \$? = $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:5507: 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 + + # Check for library containing initscr + test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" + 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:5522: 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 5530 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5549: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5552: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5555: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5558: \$? = $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:5569: 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 + test $cf_curs_lib = unknown && { { echo "$as_me:5576: error: no curses library found" >&5 +echo "$as_me: error: no curses library found" >&2;} + { (exit 1); exit 1; }; } + + LIBS="-l$cf_curs_lib $cf_save_LIBS" + if test "$cf_term_lib" = unknown ; then + echo "$as_me:5582: 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 5585 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5597: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5600: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5603: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5606: \$? = $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 + echo "$as_me:5615: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 + test $cf_result = no && { { echo "$as_me:5617: error: Cannot link curses library" >&5 +echo "$as_me: error: Cannot link curses library" >&2;} + { (exit 1); exit 1; }; } + elif test "$cf_curs_lib" = "$cf_term_lib" ; then + : + elif test "$cf_term_lib" != predefined ; then + echo "$as_me:5623: 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 5626 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr(); tgoto((char *)0, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5638: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5641: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5644: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5647: \$? = $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 -l$cf_term_lib $cf_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 5656 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5668: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5671: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5674: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5677: \$? = $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=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:5689: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 + fi +fi +fi + +echo "$as_me:5695: 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 + +cat >conftest.$ac_ext <<_ACEOF +#line 5702 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include + +int +main () +{ + + 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:5721: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5724: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5727: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5730: \$? = $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:5742: 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 + +echo "$as_me:5749: 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 5756 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include + +int +main () +{ + + MENU *menu; + int y = menu->max_item_width; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5777: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5780: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5783: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_netbsd_menu_h=yes + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_netbsd_menu_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:5795: result: $cf_cv_netbsd_menu_h" >&5 +echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6 + +test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF +#define HAVE_NETBSD_MENU_H 1 +EOF + + ;; +ncurses) + +cf_ncuconfig_root=ncurses + +echo "Looking for ${cf_ncuconfig_root}-config" +for ac_prog in ${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:5812: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NCURSES_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word" + echo "$as_me:5829: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG + +if test -n "$NCURSES_CONFIG"; then + echo "$as_me:5840: result: $NCURSES_CONFIG" >&5 +echo "${ECHO_T}$NCURSES_CONFIG" >&6 +else + echo "$as_me:5843: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NCURSES_CONFIG" && break +done +test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none" + +if test "$NCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" +LIBS="`$NCURSES_CONFIG --libs` $LIBS" + +# even with config script, some packages use no-override for curses.h + +echo "$as_me:5858: 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/curses.h \ + ncurses/ncurses.h \ + curses.h \ + ncurses.h +do +cat >conftest.$ac_ext <<_ACEOF +#line 5872 "configure" +#include "confdefs.h" +#include <${cf_header}> +int +main () +{ +initscr(); tgoto("?", 0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5884: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5887: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5890: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5893: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_header=$cf_header; 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:5904: 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:5908: error: No curses header-files found" >&5 +echo "$as_me: error: No curses header-files found" >&2;} + { (exit 1); exit 1; }; } +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. + +for ac_header in $cf_cv_ncurses_header +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:5918: 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 5924 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:5928: \"$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:5934: \$? = $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:5953: 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 <>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <conftest.$ac_ext <<_ACEOF +#line 6006 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6018: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6021: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6024: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6027: \$? = $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}:6044: 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 + fi + done + done +fi + +} + +echo "$as_me:6061: 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 +else + + cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" + ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" + for cf_header in $cf_header_list + do + + cat >conftest.$ac_ext <<_ACEOF +#line 6073 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main () +{ + +#ifdef NCURSES_VERSION + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6097: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6100: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6103: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6106: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + test "$cf_cv_ncurses_h" != no && break + done + +fi +echo "$as_me:6121: 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:6128: 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 +else + + test -n "$verbose" && echo + +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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" + test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + + 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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" + test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" + test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" + test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" + test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" + test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$includedir" != NONE && \ +test "$includedir" != "/usr/include" && \ +test -d "$includedir" && { + test -d $includedir && cf_search="$cf_search $includedir" + test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" +} + +test "$oldincludedir" != NONE && \ +test "$oldincludedir" != "/usr/include" && \ +test -d "$oldincludedir" && { + test -d $oldincludedir && cf_search="$cf_search $oldincludedir" + test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" +} + +cf_search="$cf_search $cf_header_path_list" + + test -n "$verbose" && echo search path $cf_search + cf_save2_CPPFLAGS="$CPPFLAGS" + for cf_incdir in $cf_search + do + +if test -n "$cf_incdir" ; then + for cf_add_incdir in $cf_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 6268 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6280: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6283: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6286: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6289: \$? = $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}:6306: 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 + fi + done + done +fi + + for cf_header in \ + ncurses.h \ + curses.h + do + + cat >conftest.$ac_ext <<_ACEOF +#line 6327 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main () +{ + +#ifdef NCURSES_VERSION + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6351: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6354: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6357: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6360: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h2=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h2=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + if test "$cf_cv_ncurses_h2" != no ; then + cf_cv_ncurses_h2=$cf_incdir/$cf_header + test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 + break + fi + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 + done + CPPFLAGS="$cf_save2_CPPFLAGS" + test "$cf_cv_ncurses_h2" != no && break + done + test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6381: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:6386: 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%/[^/]*$%%'` + cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` + if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then + cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header + fi + +if test -n "$cf_1st_incdir" ; then + for cf_add_incdir in $cf_1st_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 6419 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6431: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6434: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6437: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6440: \$? = $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}:6457: 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 + fi + done + done +fi + +fi + +# Set definitions to allow ifdef'ing for ncurses.h + +case $cf_cv_ncurses_header in # (vi +*ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_H 1 +EOF + + ;; +esac + +case $cf_cv_ncurses_header in # (vi +ncurses/curses.h|ncurses/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_NCURSES_H 1 +EOF + + ;; +ncursesw/curses.h|ncursesw/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSESW_NCURSES_H 1 +EOF + + ;; +esac + +echo "$as_me:6500: 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 + 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 6518 "configure" +#include "confdefs.h" +#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> + +int +main () +{ +int x = auto_left_margin + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6533: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6536: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6539: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6542: \$? = $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:6558: 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) + cat >>confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + 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 + +# some applications need this, but should check for NCURSES_VERSION +cat >>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +echo "$as_me:6592: 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 +else + + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + if test "$cross_compiling" = yes; then + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" + { (eval echo "$as_me:6618: \"$cf_try\"") >&5 + (eval $cf_try) 2>&5 + ac_status=$? + echo "$as_me:6621: \$? = $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%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi + +else + cat >conftest.$ac_ext <<_ACEOF +#line 6631 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:6656: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6659: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:6661: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6664: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_ncurses_version=`cat $cf_tempfile` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f $cf_tempfile + +fi +echo "$as_me:6678: 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 + # 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:6690: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6698 "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 Gpm_Open (); +int +main () +{ +Gpm_Open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6717: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6720: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6723: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6726: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_Gpm_Open=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_Gpm_Open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6737: 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:6740: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6748 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6767: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6770: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6773: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6776: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6787: 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" +else + cf_ncurses_LIBS="-lgpm" +fi + +fi + +case $host_os in #(vi +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:6802: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmytinfo $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 6810 "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 tgoto (); +int +main () +{ +tgoto (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6829: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6832: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6835: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6838: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mytinfo_tgoto=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_mytinfo_tgoto=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:6849: 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" +fi + + fi + ;; +esac + +LIBS="$cf_ncurses_LIBS $LIBS" + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + LIBS="-l$cf_nculib_root $LIBS" +else + + eval 'cf_cv_have_lib_'$cf_nculib_root'=no' + cf_libdir="" + echo "$as_me:6868: 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 6874 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char initscr (); below. */ +#include +/* 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 (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6905: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6908: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6911: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6914: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:6924: 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:6931: 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 6935 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:6947: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:6950: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:6953: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6956: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:6958: 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:6965: result: no" >&5 +echo "${ECHO_T}no" >&6 + +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$,,'` + +test "$cf_library_path" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" + test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" +} + + cf_library_path_list="$cf_library_path_list $cf_search" + ;; + esac + done +fi + +cf_search= + +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" + test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" + test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" + test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" + test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" + test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" +} + +cf_search="$cf_library_path_list $cf_search" + + for cf_libdir in $cf_search + do + echo "$as_me:7055: 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 7059 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7071: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7074: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7077: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7080: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7082: 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:7089: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_save_LIBS" +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 + +eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root + +if test $cf_found_library = no ; then + { { echo "$as_me:7104: error: Cannot link $cf_nculib_root library" >&5 +echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +if test -n "$cf_ncurses_LIBS" ; then + echo "$as_me:7112: 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 + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + cat >conftest.$ac_ext <<_ACEOF +#line 7122 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +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:7134: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7137: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7140: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7143: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7145: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:7150: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_ncurses_SAVE" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <&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 7177 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7190: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7193: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7196: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7199: \$? = $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}:7211: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 + +cf_save_LIBS="$LIBS" + +cat >conftest.$ac_ext <<_ACEOF +#line 7216 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7229: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7232: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7235: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7238: \$? = $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 7252 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7265: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7268: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7271: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7274: \$? = $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}:7291: testing find linkage for utf8 library ..." 1>&5 + +echo "${as_me:-configure}:7293: 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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" + test -d /usr/include/utf8/include && cf_search="$cf_search /usr/include/utf8/include" + test -d /usr/utf8/include && cf_search="$cf_search /usr/utf8/include" + test -d /usr/utf8/include/utf8 && cf_search="$cf_search /usr/utf8/include/utf8" +} + +test "$prefix" != "NONE" && \ +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 "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" + test -d /usr/local/include/utf8/include && cf_search="$cf_search /usr/local/include/utf8/include" + test -d /usr/local/utf8/include && cf_search="$cf_search /usr/local/utf8/include" + test -d /usr/local/utf8/include/utf8 && cf_search="$cf_search /usr/local/utf8/include/utf8" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" + test -d /opt/include/utf8/include && cf_search="$cf_search /opt/include/utf8/include" + test -d /opt/utf8/include && cf_search="$cf_search /opt/utf8/include" + test -d /opt/utf8/include/utf8 && cf_search="$cf_search /opt/utf8/include/utf8" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" + test -d $HOME/include/utf8/include && cf_search="$cf_search $HOME/include/utf8/include" + test -d $HOME/utf8/include && cf_search="$cf_search $HOME/utf8/include" + test -d $HOME/utf8/include/utf8 && cf_search="$cf_search $HOME/utf8/include/utf8" +} + +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}:7406: 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 7410 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7423: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7426: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7429: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7432: \$? = $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}:7437: 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}:7455: 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$,,'` + +test "$cf_library_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" + test -d /usr/lib/utf8/lib && cf_search="$cf_search /usr/lib/utf8/lib" + test -d /usr/utf8/lib && cf_search="$cf_search /usr/utf8/lib" + test -d /usr/utf8/lib/utf8 && cf_search="$cf_search /usr/utf8/lib/utf8" +} + +test "$prefix" != "NONE" && \ +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" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" + test -d /usr/local/lib/utf8/lib && cf_search="$cf_search /usr/local/lib/utf8/lib" + test -d /usr/local/utf8/lib && cf_search="$cf_search /usr/local/utf8/lib" + test -d /usr/local/utf8/lib/utf8 && cf_search="$cf_search /usr/local/utf8/lib/utf8" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" + test -d /opt/lib/utf8/lib && cf_search="$cf_search /opt/lib/utf8/lib" + test -d /opt/utf8/lib && cf_search="$cf_search /opt/utf8/lib" + test -d /opt/utf8/lib/utf8 && cf_search="$cf_search /opt/utf8/lib/utf8" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" + test -d $HOME/lib/utf8/lib && cf_search="$cf_search $HOME/lib/utf8/lib" + test -d $HOME/utf8/lib && cf_search="$cf_search $HOME/utf8/lib" + test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" +} + +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}:7552: 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 7558 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:7571: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7574: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7577: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7580: \$? = $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}:7585: 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 + + 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 + +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:7627: 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 7661 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7673: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7676: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7679: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7682: \$? = $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}:7699: 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 + 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}:7733: testing adding $cf_add_libdir to library-path ..." 1>&5 + + LDFLAGS="-L$cf_add_libdir $LDFLAGS" + fi + fi + done +fi + + LIBS="$cf_cv_library_file_utf8 $LIBS" +fi + +cf_ncuconfig_root=ncursesw + +echo "Looking for ${cf_ncuconfig_root}-config" +for ac_prog in ${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:7751: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $NCURSES_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word" + echo "$as_me:7768: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG + +if test -n "$NCURSES_CONFIG"; then + echo "$as_me:7779: result: $NCURSES_CONFIG" >&5 +echo "${ECHO_T}$NCURSES_CONFIG" >&6 +else + echo "$as_me:7782: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NCURSES_CONFIG" && break +done +test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none" + +if test "$NCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" +LIBS="`$NCURSES_CONFIG --libs` $LIBS" + +# even with config script, some packages use no-override for curses.h + +echo "$as_me:7797: 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/curses.h \ + ncursesw/ncurses.h \ + curses.h \ + ncurses.h +do +cat >conftest.$ac_ext <<_ACEOF +#line 7811 "configure" +#include "confdefs.h" +#include <${cf_header}> +int +main () +{ +initscr(); tgoto("?", 0,0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7823: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7826: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7829: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7832: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_header=$cf_header; 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:7843: 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:7847: error: No curses header-files found" >&5 +echo "$as_me: error: No curses header-files found" >&2;} + { (exit 1); exit 1; }; } +fi + +# cheat, to get the right #define's for HAVE_NCURSES_H, etc. + +for ac_header in $cf_cv_ncurses_header +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:7857: 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 7863 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:7867: \"$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:7873: \$? = $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:7892: 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 <>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <conftest.$ac_ext <<_ACEOF +#line 7945 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:7957: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:7960: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:7963: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7966: \$? = $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}:7983: 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 + fi + done + done +fi + +} + +echo "$as_me:8000: 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 +else + + cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" + ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" + for cf_header in $cf_header_list + do + + cat >conftest.$ac_ext <<_ACEOF +#line 8012 "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 () +{ + +#ifdef NCURSES_VERSION + +#ifndef WACS_BSSB + make an error +#endif + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8044: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8047: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8050: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8053: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + test "$cf_cv_ncurses_h" != no && break + done + +fi +echo "$as_me:8068: 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:8075: 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 +else + + test -n "$verbose" && echo + +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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" + test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" + test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + + 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 "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr" + test -d /usr/include && cf_search="$cf_search /usr/include" + test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" + test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" + test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" + test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" + test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /usr/local" + test -d /usr/local/include && cf_search="$cf_search /usr/local/include" + test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" + test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" + test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under /opt" + test -d /opt/include && cf_search="$cf_search /opt/include" + test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" + test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" + test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for include-directories under $HOME" + test -d $HOME/include && cf_search="$cf_search $HOME/include" + test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" + test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" + test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" +} + +test "$includedir" != NONE && \ +test "$includedir" != "/usr/include" && \ +test -d "$includedir" && { + test -d $includedir && cf_search="$cf_search $includedir" + test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" +} + +test "$oldincludedir" != NONE && \ +test "$oldincludedir" != "/usr/include" && \ +test -d "$oldincludedir" && { + test -d $oldincludedir && cf_search="$cf_search $oldincludedir" + test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" +} + +cf_search="$cf_search $cf_header_path_list" + + test -n "$verbose" && echo search path $cf_search + cf_save2_CPPFLAGS="$CPPFLAGS" + for cf_incdir in $cf_search + do + +if test -n "$cf_incdir" ; then + for cf_add_incdir in $cf_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 8215 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8227: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8230: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8233: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8236: \$? = $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}:8253: 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 + fi + done + done +fi + + for cf_header in \ + ncurses.h \ + curses.h + do + + cat >conftest.$ac_ext <<_ACEOF +#line 8274 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main () +{ + +#ifdef NCURSES_VERSION + +printf("%s\n", NCURSES_VERSION); +#else +#ifdef __NCURSES_H +printf("old\n"); +#else + make an error +#endif +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8298: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8301: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8304: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8307: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_h2=$cf_header + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_h2=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + + if test "$cf_cv_ncurses_h2" != no ; then + cf_cv_ncurses_h2=$cf_incdir/$cf_header + test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 + break + fi + test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 + done + CPPFLAGS="$cf_save2_CPPFLAGS" + test "$cf_cv_ncurses_h2" != no && break + done + test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8328: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:8333: 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%/[^/]*$%%'` + cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` + if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then + cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header + fi + +if test -n "$cf_1st_incdir" ; then + for cf_add_incdir in $cf_1st_incdir + 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 + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + cat >conftest.$ac_ext <<_ACEOF +#line 8366 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello") + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8378: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8381: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8384: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8387: \$? = $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}:8404: 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 + fi + done + done +fi + +fi + +# Set definitions to allow ifdef'ing for ncurses.h + +case $cf_cv_ncurses_header in # (vi +*ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_H 1 +EOF + + ;; +esac + +case $cf_cv_ncurses_header in # (vi +ncurses/curses.h|ncurses/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSES_NCURSES_H 1 +EOF + + ;; +ncursesw/curses.h|ncursesw/ncurses.h) + cat >>confdefs.h <<\EOF +#define HAVE_NCURSESW_NCURSES_H 1 +EOF + + ;; +esac + +echo "$as_me:8447: 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 + 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 8465 "configure" +#include "confdefs.h" +#include +#include <${cf_cv_ncurses_header:-curses.h}> +#include <$cf_test> + +int +main () +{ +int x = auto_left_margin + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:8480: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:8483: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:8486: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8489: \$? = $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:8505: 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) + cat >>confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +esac + +case $cf_cv_term_header in # (vi +ncurses/term.h) #(vi + 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 + +# some applications need this, but should check for NCURSES_VERSION +cat >>confdefs.h <<\EOF +#define NCURSES 1 +EOF + +echo "$as_me:8539: 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 +else + + cf_cv_ncurses_version=no + cf_tempfile=out$$ + rm -f $cf_tempfile + if test "$cross_compiling" = yes; then + + # This will not work if the preprocessor splits the line after the + # Autoconf token. The 'unproto' program does that. + cat > conftest.$ac_ext < +#undef Autoconf +#ifdef NCURSES_VERSION +Autoconf NCURSES_VERSION +#else +#ifdef __NCURSES_H +Autoconf "old" +#endif +; +#endif +EOF + cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" + { (eval echo "$as_me:8565: \"$cf_try\"") >&5 + (eval $cf_try) 2>&5 + ac_status=$? + echo "$as_me:8568: \$? = $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%".*%%'` + test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" + rm -f conftest.out + fi + +else + cat >conftest.$ac_ext <<_ACEOF +#line 8578 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include +int main() +{ + FILE *fp = fopen("$cf_tempfile", "w"); +#ifdef NCURSES_VERSION +# ifdef NCURSES_VERSION_PATCH + fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); +# else + fprintf(fp, "%s\n", NCURSES_VERSION); +# endif +#else +# ifdef __NCURSES_H + fprintf(fp, "old\n"); +# else + make an error +# endif +#endif + ${cf_cv_main_return:-return}(0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:8603: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8606: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:8608: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8611: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_ncurses_version=`cat $cf_tempfile` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + rm -f $cf_tempfile + +fi +echo "$as_me:8625: 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 + # 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:8637: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 8645 "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 Gpm_Open (); +int +main () +{ +Gpm_Open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8664: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8667: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8670: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8673: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_Gpm_Open=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_Gpm_Open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:8684: 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:8687: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgpm $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 8695 "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 (); +int +main () +{ +initscr (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8714: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8717: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8720: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8723: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gpm_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gpm_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:8734: 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" +else + cf_ncurses_LIBS="-lgpm" +fi + +fi + +case $host_os in #(vi +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:8749: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmytinfo $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 8757 "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 tgoto (); +int +main () +{ +tgoto (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8776: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8779: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8782: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8785: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mytinfo_tgoto=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_mytinfo_tgoto=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:8796: 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" +fi + + fi + ;; +esac + +LIBS="$cf_ncurses_LIBS $LIBS" + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + LIBS="-l$cf_nculib_root $LIBS" +else + + eval 'cf_cv_have_lib_'$cf_nculib_root'=no' + cf_libdir="" + echo "$as_me:8815: 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 8821 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char initscr (); below. */ +#include +/* 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 (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8852: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8855: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8858: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8861: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_initscr=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_initscr=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:8871: 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:8878: 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 8882 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8894: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8897: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8900: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8903: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:8905: 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:8912: result: no" >&5 +echo "${ECHO_T}no" >&6 + +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$,,'` + +test "$cf_library_path" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" + test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" + test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" +} + + cf_library_path_list="$cf_library_path_list $cf_search" + ;; + esac + done +fi + +cf_search= + +test "/usr" != "$prefix" && \ +test -d "/usr" && \ +(test $prefix = NONE || test "/usr" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr" + test -d /usr/lib && cf_search="$cf_search /usr/lib" + test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" + test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" + test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$prefix" != "NONE" && \ +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/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" + test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" + test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/usr/local" != "$prefix" && \ +test -d "/usr/local" && \ +(test $prefix = NONE || test "/usr/local" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" + test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" + test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" + test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" + test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "/opt" != "$prefix" && \ +test -d "/opt" && \ +(test $prefix = NONE || test "/opt" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under /opt" + test -d /opt/lib && cf_search="$cf_search /opt/lib" + test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" + test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" + test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" +} + +test "$HOME" != "$prefix" && \ +test -d "$HOME" && \ +(test $prefix = NONE || test "$HOME" != "$prefix") && { + test -n "$verbose" && echo " ... testing for lib-directories under $HOME" + test -d $HOME/lib && cf_search="$cf_search $HOME/lib" + test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" + test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" + test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" +} + +cf_search="$cf_library_path_list $cf_search" + + for cf_libdir in $cf_search + do + echo "$as_me:9002: 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 9006 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +initscr() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9018: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9021: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9024: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9027: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:9029: 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:9036: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_save_LIBS" +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 + +eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root + +if test $cf_found_library = no ; then + { { echo "$as_me:9051: error: Cannot link $cf_nculib_root library" >&5 +echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +if test -n "$cf_ncurses_LIBS" ; then + echo "$as_me:9059: 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 + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + cat >conftest.$ac_ext <<_ACEOF +#line 9069 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +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:9081: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9084: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9087: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9090: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:9092: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:9097: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_ncurses_SAVE" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <&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. +if test "${with_pkg_config+set}" = set; then + withval="$with_pkg_config" + cf_pkg_config=$withval +else + cf_pkg_config=yes +fi; +echo "$as_me:9125: result: $cf_pkg_config" >&5 +echo "${ECHO_T}$cf_pkg_config" >&6 + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + # 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:9135: 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 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:9152: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none" + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:9164: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:9167: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$PKG_CONFIG" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:9205: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 +echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi + +echo "$as_me:9213: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib dll; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +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 9310 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:9314: \"$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:9320: \$? = $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 + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 9353 "configure" +#include "confdefs.h" +#include +int +main () +{ +XtMalloc (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9365: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9368: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9371: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9374: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib dll; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$as_me:9412: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # 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:9422: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +cat >>confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 +EOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + echo "$as_me:9446: 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 9450 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9462: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9465: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9468: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9471: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_nospace=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +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:9481: 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 9487 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9499: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9502: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9505: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9508: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_space=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +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:9518: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$as_me:9522: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 + fi + fi + LIBS=$ac_xsave_LIBS + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat >conftest.$ac_ext <<_ACEOF +#line 9542 "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 XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9561: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9564: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9567: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9570: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:9576: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 9584 "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 dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9603: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9606: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9609: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9612: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:9623: 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:9630: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 9638 "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 dnet_ntoa (); +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9657: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9660: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9663: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9666: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:9677: 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" +fi + + fi +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # 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:9696: 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 9702 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. */ +#include +/* 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 gethostbyname (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9733: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9736: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9739: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9742: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:9752: 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:9756: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 9764 "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 gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9783: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9786: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9789: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9792: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:9803: 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:9810: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 9818 "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 gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9837: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9840: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9843: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9846: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_bsd_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:9857: 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" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # 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:9873: 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 9879 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. */ +#include +/* 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 connect (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9910: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9913: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9916: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9919: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:9929: 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:9933: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 9941 "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 connect (); +int +main () +{ +connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9960: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9963: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9966: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9969: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_connect=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_socket_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:9980: 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" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + echo "$as_me:9989: 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 9995 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove (); below. */ +#include +/* 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 remove (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10026: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10029: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10032: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10035: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_remove=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_remove=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:10045: 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:10049: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 10057 "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 remove (); +int +main () +{ +remove (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10076: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10079: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10082: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10085: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_posix_remove=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_posix_remove=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10096: 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" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo "$as_me:10105: 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 10111 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat (); below. */ +#include +/* 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 shmat (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10142: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10145: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10148: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10151: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shmat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_shmat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:10161: 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:10165: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 10173 "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 shmat (); +int +main () +{ +shmat (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10192: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10195: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10198: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10201: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ipc_shmat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_ipc_shmat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10212: 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" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # 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:10230: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 10238 "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 IceConnectionNumber (); +int +main () +{ +IceConnectionNumber (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10257: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10260: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10263: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10266: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ICE_IceConnectionNumber=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10277: 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" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + +cf_x_athena=${cf_x_athena:-Xaw} + +echo "$as_me:10289: 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= + +# Check whether --with-Xaw3d or --without-Xaw3d was given. +if test "${with_Xaw3d+set}" = set; then + withval="$with_Xaw3d" + +fi; +if test "$withval" = yes ; then + cf_x_athena=Xaw3d + echo "$as_me:10300: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:10303: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +echo "$as_me:10307: 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= + +# Check whether --with-neXtaw or --without-neXtaw was given. +if test "${with_neXtaw+set}" = set; then + withval="$with_neXtaw" + +fi; +if test "$withval" = yes ; then + cf_x_athena=neXtaw + echo "$as_me:10318: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:10321: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +echo "$as_me:10325: 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= + +# Check whether --with-XawPlus or --without-XawPlus was given. +if test "${with_XawPlus+set}" = set; then + withval="$with_XawPlus" + +fi; +if test "$withval" = yes ; then + cf_x_athena=XawPlus + echo "$as_me:10336: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:10339: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +cf_x_athena_lib="" + +if test "$PKG_CONFIG" != none ; then + cf_athena_list= + test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6" + for cf_athena_pkg in \ + $cf_athena_list \ + ${cf_x_athena} \ + ${cf_x_athena}-devel \ + lib${cf_x_athena} \ + lib${cf_x_athena}-devel + do + +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}:10359: 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}:10365: 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}:10369: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + + cf_x_athena_lib="$cf_pkgconfig_libs" + +cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <&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 10466 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + +int check = XmuCompareISOLatin1("big", "small") + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10482: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10485: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10488: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10491: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_xaw_compat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_xaw_compat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:10501: 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 + ;; + *) + test -n "$verbose" && echo " work around broken package" 1>&6 + +echo "${as_me:-configure}:10513: 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}:10518: 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}:10524: 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}:10528: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + : +else + +test -n "$verbose" && echo " ...before $LIBS" 1>&6 + +echo "${as_me:-configure}:10614: testing ...before $LIBS ..." 1>&5 + +LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/ / /g'` +test -n "$verbose" && echo " ...after $LIBS" 1>&6 + +echo "${as_me:-configure}:10619: testing ...after $LIBS ..." 1>&5 + +fi + + ;; + esac + fi + + break +else + : +fi + + done +fi + +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}:10640: 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}:10646: 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}:10650: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + : +else + + echo "$as_me:10734: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXext $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 10742 "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 XextCreateExtension (); +int +main () +{ +XextCreateExtension (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10761: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10764: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10767: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10770: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xext_XextCreateExtension=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_Xext_XextCreateExtension=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:10781: 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 + LIBS="-lXext $LIBS" +fi + +fi + +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}:10794: 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}:10800: 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}:10804: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + + case "x$LIBS" in #(vi + *-lX11*) #(vi + ;; + *) +# we have an "xt" package, but it may omit Xt's dependency on X11 +echo "$as_me:10891: 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 10898 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0); + int rc2 = XClearWindow((Display*) 0, (Window) 0); + int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0); + int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:10917: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:10920: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:10923: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:10926: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_xt_x11_compat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_xt_x11_compat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:10936: 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}:10942: 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}:10949: 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}:10955: 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}:10959: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + : +else + +test -n "$verbose" && echo " ...before $LIBS" 1>&6 + +echo "${as_me:-configure}:11045: 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}:11050: testing ...after $LIBS ..." 1>&5 + +fi + + fi + ;; + esac + +echo "$as_me:11058: 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 11065 "configure" +#include "confdefs.h" + +#include + +int +main () +{ +int num = IceConnectionNumber(0) + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11080: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11083: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11086: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11089: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_xt_ice_compat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_xt_ice_compat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11099: 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 + ;; + *) + test -n "$verbose" && echo " work around broken ICE dependency" 1>&6 + +echo "${as_me:-configure}:11113: 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}:11118: 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}:11124: 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}:11128: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + +if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then + test -n "$verbose" && echo " found package sm" 1>&6 + +echo "${as_me:-configure}:11213: 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}:11219: 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}:11223: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + LIBS="$cf_pkgconfig_libs $LIBS" + : +else + : +fi + +else + +test -n "$verbose" && echo " ...before $LIBS" 1>&6 + +echo "${as_me:-configure}:11313: 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}:11318: testing ...after $LIBS ..." 1>&5 + +fi + + ;; + esac + ;; + esac + fi + + cf_have_X_LIBS=yes + +else + + LDFLAGS="$X_LIBS $LDFLAGS" + +test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 + +echo "${as_me:-configure}:11336: testing checking additions to CFLAGS ..." 1>&5 + +cf_check_cflags="$CFLAGS" +cf_check_cppflags="$CPPFLAGS" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 + +echo "${as_me:-configure}:11407: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + 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}:11415: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + 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}:11423: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +if test "$cf_check_cflags" != "$CFLAGS" ; then +cat >conftest.$ac_ext <<_ACEOF +#line 11430 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello world"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11442: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11445: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11448: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11451: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 + +echo "${as_me:-configure}:11459: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 + + if test "$cf_check_cppflags" != "$CPPFLAGS" ; then + test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 + +echo "${as_me:-configure}:11464: testing but keeping change to \$CPPFLAGS ..." 1>&5 + + fi + CFLAGS="$cf_check_flags" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + + echo "$as_me:11472: 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 11478 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char XOpenDisplay (); below. */ +#include +/* 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 XOpenDisplay (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11509: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11512: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11515: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11518: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_XOpenDisplay=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_XOpenDisplay=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11528: 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:11534: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 11542 "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 XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11561: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11564: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11567: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11570: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_X11_XOpenDisplay=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_X11_XOpenDisplay=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:11581: 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 + LIBS="-lX11 $LIBS" +fi + +fi + + echo "$as_me:11589: 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 11595 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char XtAppInitialize (); below. */ +#include +/* 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 XtAppInitialize (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11626: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11629: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11632: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11635: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_XtAppInitialize=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_XtAppInitialize=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11645: 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:11651: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 11659 "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 XtAppInitialize (); +int +main () +{ +XtAppInitialize (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11678: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11681: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11684: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11687: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xt_XtAppInitialize=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_Xt_XtAppInitialize=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:11698: 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 + cat >>confdefs.h <<\EOF +#define HAVE_LIBXT 1 +EOF + + cf_have_X_LIBS=Xt + LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS" +fi + +fi + +fi + +if test $cf_have_X_LIBS = no ; then + { echo "$as_me:11714: 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 +test program. You will have to check and add the proper libraries by hand +to makefile." >&2;} +fi + +cf_x_athena_root=$cf_x_athena +cf_x_athena_inc="" + +for cf_path in default \ + /usr/contrib/X11R6 \ + /usr/contrib/X11R5 \ + /usr/lib/X11R5 \ + /usr/local +do + if test -z "$cf_x_athena_inc" ; then + cf_save="$CPPFLAGS" + 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:11736: 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:11739: checking for $cf_test" >&5 +echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6 + fi + cat >conftest.$ac_ext <<_ACEOF +#line 11743 "configure" +#include "confdefs.h" + +#include +#include <$cf_test> +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:11757: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:11760: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:11763: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11766: \$? = $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:11775: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 + if test "$cf_result" = yes ; then + cf_x_athena_inc=$cf_path + break + else + CPPFLAGS="$cf_save" + fi + fi +done + +if test -z "$cf_x_athena_inc" ; then + { echo "$as_me:11787: 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;} +elif test "$cf_x_athena_inc" != default ; then + CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc" +fi + +cf_x_athena_root=$cf_x_athena +cf_x_athena_lib="" + +for cf_path in default \ + /usr/contrib/X11R6 \ + /usr/contrib/X11R5 \ + /usr/lib/X11R5 \ + /usr/local +do + for cf_lib in \ + "-l$cf_x_athena_root -lXmu" \ + "-l$cf_x_athena_root -lXpm -lXmu" \ + "-l${cf_x_athena_root}_s -lXmu_s" + do + if test -z "$cf_x_athena_lib" ; then + cf_save="$LIBS" + cf_test=XawSimpleMenuAddGlobalActions + if test $cf_path != default ; then + LIBS="-L$cf_path/lib $cf_lib $LIBS" + echo "$as_me:11812: checking for $cf_lib in $cf_path" >&5 +echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6 + else + LIBS="$cf_lib $LIBS" + echo "$as_me:11816: checking for $cf_test in $cf_lib" >&5 +echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6 + fi + cat >conftest.$ac_ext <<_ACEOF +#line 11820 "configure" +#include "confdefs.h" + +int +main () +{ +$cf_test() + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11832: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11835: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11838: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11841: \$? = $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 + echo "$as_me:11850: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 + if test "$cf_result" = yes ; then + cf_x_athena_lib="$cf_lib" + break + fi + LIBS="$cf_save" + fi + done +done + +if test -z "$cf_x_athena_lib" ; then + { { echo "$as_me:11862: 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_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $XCURSES_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word" + echo "$as_me:11896: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG + +if test -n "$XCURSES_CONFIG"; then + echo "$as_me:11907: result: $XCURSES_CONFIG" >&5 +echo "${ECHO_T}$XCURSES_CONFIG" >&6 +else + echo "$as_me:11910: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$XCURSES_CONFIG" && break +done +test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none" + +if test "$XCURSES_CONFIG" != none ; then + +CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`" +LIBS="`$XCURSES_CONFIG --libs` $LIBS" + +cf_cv_lib_XCurses=yes + +else + +LDFLAGS="$LDFLAGS $X_LIBS" + +test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 + +echo "${as_me:-configure}:11931: testing checking additions to CFLAGS ..." 1>&5 + +cf_check_cflags="$CFLAGS" +cf_check_cppflags="$CPPFLAGS" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 + +echo "${as_me:-configure}:12002: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + 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}:12010: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + 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}:12018: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +if test "$cf_check_cflags" != "$CFLAGS" ; then +cat >conftest.$ac_ext <<_ACEOF +#line 12025 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello world"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12037: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12040: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12043: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12046: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 + +echo "${as_me:-configure}:12054: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 + + if test "$cf_check_cppflags" != "$CPPFLAGS" ; then + test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 + +echo "${as_me:-configure}:12059: testing but keeping change to \$CPPFLAGS ..." 1>&5 + + fi + CFLAGS="$cf_check_flags" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +echo "$as_me:12067: 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 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 12075 "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 XOpenDisplay (); +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12094: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12097: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12100: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12103: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_X11_XOpenDisplay=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_X11_XOpenDisplay=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:12114: 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 + LIBS="-lX11 $LIBS" +fi + +echo "$as_me:12120: 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 + +LIBS="-lXCurses $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 12128 "configure" +#include "confdefs.h" + +#include +char *XCursesProgramName = "test"; + +int +main () +{ +XCursesExit(); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12143: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12146: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12149: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12152: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_lib_XCurses=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_lib_XCurses=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:12163: result: $cf_cv_lib_XCurses" >&5 +echo "${ECHO_T}$cf_cv_lib_XCurses" >&6 + +fi + +if test $cf_cv_lib_XCurses = yes ; then + cat >>confdefs.h <<\EOF +#define UNIX 1 +EOF + + cat >>confdefs.h <<\EOF +#define XCURSES 1 +EOF + + echo "$as_me:12177: 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 12183 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:12187: \"$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:12193: \$? = $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 + ac_cv_header_xcurses_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_xcurses_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:12212: 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 + cat >>confdefs.h <<\EOF +#define HAVE_XCURSES 1 +EOF + +fi + +else + { { echo "$as_me:12222: error: Cannot link with XCurses" >&5 +echo "$as_me: error: Cannot link with XCurses" >&2;} + { (exit 1); exit 1; }; } +fi + + ;; +esac + +case $cf_cv_screen in #(vi +pdcurses) #(vi + ;; +*) + # look for curses-related libraries + +as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh` +echo "$as_me:12237: 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 12245 "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 new_panel (); +int +main () +{ +new_panel (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12264: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12267: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12270: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12273: \$? = $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:12284: 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 <&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="-lmenu$cf_cv_libtype $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 12304 "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 (); +int +main () +{ +menu_driver (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12323: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12326: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12329: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12332: \$? = $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:12343: 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 <&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="-lform$cf_cv_libtype $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 12363 "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 form_driver (); +int +main () +{ +form_driver (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12382: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12385: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12388: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12391: \$? = $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:12402: 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 <&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 12431 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:12435: \"$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:12441: \$? = $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:12460: 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 <&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 12479 "configure" +#include "confdefs.h" +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:12501: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:12504: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:12507: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12510: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_signal=int +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:12520: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <&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 12533 "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:12541: \"$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:12547: \$? = $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 + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +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 12569 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -rf conftest* + +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 12587 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -rf conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line 12608 "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + $ac_main_return(2); + $ac_main_return (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:12634: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12637: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:12639: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12642: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:12655: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo "$as_me:12665: 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 12671 "configure" +#include "confdefs.h" +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:12687: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:12690: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:12693: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12696: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:12706: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +for ac_header in \ +getopt.h \ +locale.h \ +stdarg.h \ +sys/ioctl.h \ +sys/select.h \ +sys/time.h \ +termios.h \ +unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:12728: 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 12734 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:12738: \"$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:12744: \$? = $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:12763: 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 <&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 12793 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* 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 $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12824: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12827: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12830: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12833: \$? = $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:12843: 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 <&5 +echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6 +if test "${cf_cv_need_xopen_extension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 12860 "configure" +#include "confdefs.h" + +#include +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +#if defined(NCURSES_VERSION_PATCH) +if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403) + make an error +#endif +#endif + 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:12882: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12885: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12888: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12891: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_need_xopen_extension=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cat >conftest.$ac_ext <<_ACEOF +#line 12898 "configure" +#include "confdefs.h" + +#define _XOPEN_SOURCE_EXTENDED +#include +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +#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) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:12920: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:12923: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:12926: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12929: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_need_xopen_extension=yes +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 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:12941: 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:12945: 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 +else + +# If we found , look for , but always look +# for if we do not find the variant. +for cf_header in \ + `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \ + term.h +do + cat >conftest.$ac_ext <<_ACEOF +#line 12958 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#include <${cf_header}> +int +main () +{ +WINDOW *x + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:12972: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:12975: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:12978: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:12981: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_term_header=$cf_header + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_term_header=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +case $cf_cv_term_header in #(vi +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 13000 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +#ifdef NCURSES_VERSION +#include <${cf_header}> +#else +make an error +#endif +int +main () +{ +WINDOW *x + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:13018: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:13021: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:13024: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13027: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_term_header=$cf_header + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_term_header=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + ;; +esac + +fi +echo "$as_me:13042: result: $cf_cv_term_header" >&5 +echo "${ECHO_T}$cf_cv_term_header" >&6 + +case $cf_cv_term_header in #(vi +term.h) #(vi + cat >>confdefs.h <<\EOF +#define HAVE_TERM_H 1 +EOF + + ;; +ncurses/term.h) #(vi + 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 + +for cf_func in \ +chgat \ +color_set \ +filter \ +getbegx \ +getcurx \ +getmaxx \ +getnstr \ +getparx \ +getwin \ +mvvline \ +mvwvline \ +napms \ +putwin \ +resize_term \ +resizeterm \ +ripoffline \ +scr_dump \ +setupterm \ +slk_color \ +slk_init \ +termattrs \ +tgetent \ +tigetnum \ +tigetstr \ +typeahead \ +use_default_colors \ +vw_printw \ +vsscanf \ +wchgat \ +winsstr \ +wresize \ +wsyncdown \ + +do + +cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + echo "$as_me:13104: checking for ${cf_func}" >&5 +echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6 + +echo "${as_me:-configure}:13107: testing ${cf_func} ..." 1>&5 + + if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + eval cf_result='$ac_cv_func_'$cf_func + if test ".$cf_result" != ".no"; then + cat >conftest.$ac_ext <<_ACEOF +#line 13116 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +int +main () +{ + +#ifndef ${cf_func} +long foo = (long)(&${cf_func}); +${cf_cv_main_return:-return}(foo == 0); +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13147: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13150: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13153: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13156: \$? = $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 + fi + eval 'cf_cv_func_'$cf_func'=$cf_result' + +fi + + # use the computed/retrieved cache-value: + eval 'cf_result=$cf_cv_func_'$cf_func + echo "$as_me:13172: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 + if test $cf_result != no; then + cat >>confdefs.h <&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 13189 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +int x = NCURSES_EXT_FUNCS + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:13204: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:13207: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:13210: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13213: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_ext_funcs=defined +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line 13221 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + + (void) assume_default_colors (0, 0); + (void) curses_version (); + (void) define_key (0, 0); + (void) is_term_resized (0, 0); + (void) key_defined (0); + (void) keybound (0, 0); + (void) keyok (0, 0); + (void) resize_term (0, 0); + (void) resizeterm (0, 0); + (void) use_default_colors (); + (void) use_extended_names (0); + (void) wresize (0, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13246: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13249: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13252: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13255: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_ncurses_ext_funcs=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_ncurses_ext_funcs=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:13269: 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 +#define NCURSES_EXT_FUNCS 1 +EOF + +echo "$as_me:13275: 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 13282 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + + static wchar_t src_wchar[2]; + static cchar_t dst_cchar; + setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13299: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13302: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13305: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13308: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_widechar_funcs=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_widechar_funcs=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi +echo "$as_me:13319: result: $cf_cv_widechar_funcs" >&5 +echo "${ECHO_T}$cf_cv_widechar_funcs" >&6 +if test "$cf_cv_widechar_funcs" != no ; then + cat >>confdefs.h <<\EOF +#define USE_WIDEC_SUPPORT 1 +EOF + +else + cat >>confdefs.h <<\EOF +#define USE_WIDEC_SUPPORT 0 +EOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:13339: 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 13345 "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:13351: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:13354: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:13357: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13360: \$? = $ac_status" >&5 + (exit $ac_status); }; }; 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.$ac_objext conftest.$ac_ext +fi +echo "$as_me:13370: 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 <&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13386 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:13401: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:13404: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:13407: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13410: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_pid_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:13420: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <&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 13441 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:13445: \"$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:13451: \$? = $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:13470: 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 <&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 13489 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* 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 $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13520: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13523: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13526: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13529: \$? = $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:13539: 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 <&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6 +if test "${ac_cv_func_fork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_fork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* By Rüdiger Kuhlmann. */ + #include + #if HAVE_UNISTD_H + # include + #endif + /* Some systems only have a dummy stub for fork() */ + int main () + { + if (fork() < 0) + $ac_main_return (1); + $ac_main_return (0); + } +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:13574: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13577: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:13579: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13582: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_fork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:13594: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6 + +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { echo "$as_me:13608: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + echo "$as_me:13613: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 +if test "${ac_cv_func_vfork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_vfork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +#line 13622 "configure" +#include "confdefs.h" +/* Thanks to Paul Eggert for this test. */ +#include +#include +#include +#if HAVE_UNISTD_H +# include +#endif +#if HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + $ac_main_return( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:13719: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13722: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:13724: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13727: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_vfork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_vfork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:13739: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=ac_cv_func_vfork + { echo "$as_me:13745: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_VFORK 1 +EOF + +else + +cat >>confdefs.h <<\EOF +#define vfork fork +EOF + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_FORK 1 +EOF + +fi + +echo "$as_me:13770: 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 13777 "configure" +#include "confdefs.h" + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:13797: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:13800: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:13803: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13806: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_sys_time_select=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_sys_time_select=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi + +echo "$as_me:13818: 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:13824: 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 +else + +if test "$cross_compiling" = yes; then + cf_cv_func_curses_version=unknown +else + cat >conftest.$ac_ext <<_ACEOF +#line 13834 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> +int main() +{ + char temp[1024]; + sprintf(temp, "%s\n", curses_version()); + ${cf_cv_main_return:-return}(0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:13847: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13850: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:13852: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13855: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_func_curses_version=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_cv_func_curses_version=no + +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f core +fi +echo "$as_me:13870: 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:13876: 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. +if test "${with_ncurses_wrap_prefix+set}" = set; then + withval="$with_ncurses_wrap_prefix" + NCURSES_WRAP_PREFIX=$withval +else + NCURSES_WRAP_PREFIX=_nc_ +fi; +echo "$as_me:13886: result: $NCURSES_WRAP_PREFIX" >&5 +echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 + +echo "$as_me:13889: 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 +else + +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 13899 "configure" +#include "confdefs.h" + +#include <${cf_cv_ncurses_header:-curses.h}> + +int +main () +{ + +$name['k'] = ACS_PLUS + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13915: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13918: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13921: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13924: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_curses_acs_map=$name; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +done + +fi +echo "$as_me:13935: result: $cf_cv_curses_acs_map" >&5 +echo "${ECHO_T}$cf_cv_curses_acs_map" >&6 + +test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <&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 +else + + cf_cv_curses_wacs_map=unknown + for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char + do + cat >conftest.$ac_ext <<_ACEOF +#line 13952 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +void *foo = &($name['k']) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13968: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13971: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13974: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13977: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_curses_wacs_map=$name + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done +fi +echo "$as_me:13988: result: $cf_cv_curses_wacs_map" >&5 +echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6 + +test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <&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 +else + +cf_cv_curses_wacs_symbols=no +if test "$cf_cv_curses_wacs_map" != unknown +then + cat >conftest.$ac_ext <<_ACEOF +#line 14005 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +cchar_t *foo = WACS_PLUS; + $cf_cv_curses_wacs_map['k'] = *WACS_PLUS + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:14022: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:14025: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:14028: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14031: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_curses_wacs_symbols=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +#line 14041 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +cchar_t *foo = WACS_PLUS + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:14057: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:14060: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:14063: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14066: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_curses_wacs_symbols=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi + +fi +echo "$as_me:14077: result: $cf_cv_curses_wacs_symbols" >&5 +echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6 + +test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF +#define CURSES_WACS_SYMBOLS 1 +EOF + +echo "$as_me:14084: 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 14087 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +attr_t foo + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14105: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14108: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14111: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14114: \$? = $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:14123: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <>confdefs.h <&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 14148 "configure" +#include "confdefs.h" + +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +mbstate_t state + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14166: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14169: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14172: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14175: \$? = $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 14182 "configure" +#include "confdefs.h" + +#include +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +mbstate_t value + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14201: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14204: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14207: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14210: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_mbstate_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_mbstate_t=unknown +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:14222: result: $cf_cv_mbstate_t" >&5 +echo "${ECHO_T}$cf_cv_mbstate_t" >&6 + +if test "$cf_cv_mbstate_t" = yes ; then + cat >>confdefs.h <<\EOF +#define NEED_WCHAR_H 1 +EOF + + NEED_WCHAR_H=1 +fi + +# if we do not find mbstate_t in either place, use substitution to provide a fallback. +if test "$cf_cv_mbstate_t" = unknown ; then + NCURSES_MBSTATE_T=1 +fi + +# if we find mbstate_t in either place, use substitution to provide a fallback. +if test "$cf_cv_mbstate_t" != unknown ; then + NCURSES_OK_MBSTATE_T=1 +fi + +# This is needed on Tru64 5.0 to declare wchar_t +echo "$as_me:14244: 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 14251 "configure" +#include "confdefs.h" + +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +wchar_t state + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14269: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14272: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14275: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14278: \$? = $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 14285 "configure" +#include "confdefs.h" + +#include +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +wchar_t value + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14304: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14307: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14310: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14313: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_wchar_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_wchar_t=unknown +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:14325: result: $cf_cv_wchar_t" >&5 +echo "${ECHO_T}$cf_cv_wchar_t" >&6 + +if test "$cf_cv_wchar_t" = yes ; then + cat >>confdefs.h <<\EOF +#define NEED_WCHAR_H 1 +EOF + + NEED_WCHAR_H=1 +fi + +# if we do not find wchar_t in either place, use substitution to provide a fallback. +if test "$cf_cv_wchar_t" = unknown ; then + NCURSES_WCHAR_T=1 +fi + +# if we find wchar_t in either place, use substitution to provide a fallback. +if test "$cf_cv_wchar_t" != unknown ; then + NCURSES_OK_WCHAR_T=1 +fi + +# This is needed on Tru64 5.0 to declare wint_t +echo "$as_me:14347: 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 14354 "configure" +#include "confdefs.h" + +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +wint_t state + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14372: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14375: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14378: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14381: \$? = $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 14388 "configure" +#include "confdefs.h" + +#include +#include +#include +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +int +main () +{ +wint_t value + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14407: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14410: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14413: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14416: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_wint_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_wint_t=unknown +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:14428: result: $cf_cv_wint_t" >&5 +echo "${ECHO_T}$cf_cv_wint_t" >&6 + +if test "$cf_cv_wint_t" = yes ; then + cat >>confdefs.h <<\EOF +#define NEED_WCHAR_H 1 +EOF + + NEED_WCHAR_H=1 +fi + +# if we do not find wint_t in either place, use substitution to provide a fallback. +if test "$cf_cv_wint_t" = unknown ; then + NCURSES_WINT_T=1 +fi + +# if we find wint_t in either place, use substitution to provide a fallback. +if test "$cf_cv_wint_t" != unknown ; then + NCURSES_OK_WINT_T=1 +fi + +if test "$NCURSES_OK_MBSTATE_T" = 0 ; then + +echo "$as_me:14451: 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 14454 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +mbstate_t foo + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14472: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14475: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14478: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14481: \$? = $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:14490: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <>confdefs.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 14514 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +wchar_t foo + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14532: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14535: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14538: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14541: \$? = $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:14550: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <>confdefs.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 14574 "configure" +#include "confdefs.h" + +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED +#endif +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ + +wint_t foo + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14592: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14595: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14598: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14601: \$? = $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:14610: result: $cf_result" >&5 +echo "${ECHO_T}$cf_result" >&6 +if test $cf_result = yes ; then + +cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` + + cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 + +cat >conftest.$ac_ext <<_ACEOF +#line 14633 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +int +main () +{ + +void *foo = &(boolnames) + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14661: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14664: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14667: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14670: \$? = $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:14679: 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___%` + + cat >>confdefs.h <&5 +echo $ECHO_N "checking for data boolnames 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 14698 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +extern char boolnames; +int +main () +{ + + do { + void *foo = &(boolnames); + ${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:14730: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:14733: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:14736: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14739: \$? = $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 14751 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +extern char boolnames; +int main(void) +{ + void *foo = &(boolnames); + ${cf_cv_main_return:-return}(foo == 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:14776: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:14779: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:14781: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14784: \$? = $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:14795: 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___%` + + cat >>confdefs.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 14812 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +int +main () +{ + +void *foo = &(boolfnames) + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:14840: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:14843: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:14846: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14849: \$? = $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:14858: 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 <&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 14877 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +extern char boolfnames; +int +main () +{ + + do { + void *foo = &(boolfnames); + ${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:14909: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:14912: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:14915: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14918: \$? = $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 14930 "configure" +#include "confdefs.h" + +#ifdef HAVE_XCURSES +#include +char * XCursesProgramName = "test"; +#else +#include <${cf_cv_ncurses_header:-curses.h}> +#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif +#endif + +extern char boolfnames; +int main(void) +{ + void *foo = &(boolfnames); + ${cf_cv_main_return:-return}(foo == 0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:14955: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:14958: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:14960: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:14963: \$? = $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:14974: 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___%` + + cat >>confdefs.h <confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +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:15071: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:15247: 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;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:15266: 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;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me 2.52.20101001, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "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:15314: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +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,@LINT@,$LINT,;t t +s,@LINT_OPTS@,$LINT_OPTS,;t t +s,@CTAGS@,$CTAGS,;t t +s,@ETAGS@,$ETAGS,;t t +s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t +s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t +s,@MATH_LIB@,$MATH_LIB,;t t +s,@CC_G_OPT@,$CC_G_OPT,;t t +s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t +s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t +s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t +s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t +s,@LD@,$LD,;t t +s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t +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,@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,@PTHREAD@,$PTHREAD,;t t +s,@TEST_ARGS@,$TEST_ARGS,;t t +s,@TEST_DEPS@,$TEST_DEPS,;t t +s,@TEST_LIBS@,$TEST_LIBS,;t t +s,@TINFO_ARGS@,$TINFO_ARGS,;t t +s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t +s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t +s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t +s,@ECHO_LT@,$ECHO_LT,;t t +s,@ECHO_LD@,$ECHO_LD,;t t +s,@RULE_CC@,$RULE_CC,;t t +s,@SHOW_CC@,$SHOW_CC,;t t +s,@ECHO_CC@,$ECHO_CC,;t t +s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t +s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@X_CFLAGS@,$X_CFLAGS,;t t +s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t +s,@X_LIBS@,$X_LIBS,;t t +s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t +s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # 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 + if test -z "$ac_sed_cmds"; then + 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" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:15576: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:15594: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:15607: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_iB='\([ ]\),\1#\2define\3' +ac_iC=' ' +ac_iD='\4,;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:15673: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:15684: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:15697: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into a list of #define's. We won't use it as a sed +# script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to +# be either 'cat' or 'sort'. +cat confdefs.h | uniq >conftest.vals + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +echo ' rm -f conftest.frag' >> $CONFIG_STATUS +while grep . conftest.vals >/dev/null +do + # Write chunks of a limited-size here document to conftest.frag. + echo ' cat >> conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS + echo 'CEOF' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +# Run sed to substitute the contents of conftest.frag into $tmp/in at the +# marker @DEFS@. +echo ' cat >> conftest.edit < $tmp/out +rm -f $tmp/in +mv $tmp/out $tmp/in +rm -f conftest.edit conftest.frag +' >> $CONFIG_STATUS + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + 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:15755: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +EOF +cat >>$CONFIG_STATUS <<\EOF +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + default ) + +for cf_dir in . +do + if test ! -d $srcdir/$cf_dir; then + continue + elif test -f $srcdir/$cf_dir/programs; then + $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile + fi +done + + cat >>Makefile <>Makefile <>Makefile <>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/test/configure.in b/test/configure.in new file mode 100644 index 00000000000..c9070b6770b --- /dev/null +++ b/test/configure.in @@ -0,0 +1,320 @@ +dnl*************************************************************************** +dnl Copyright (c) 1998-2010,2011 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 * +dnl "Software"), to deal in the Software without restriction, including * +dnl without limitation the rights to use, copy, modify, merge, publish, * +dnl distribute, distribute with modifications, sublicense, and/or sell * +dnl copies of the Software, and to permit persons to whom the Software is * +dnl furnished to do so, subject to the following conditions: * +dnl * +dnl The above copyright notice and this permission notice shall be included * +dnl in all copies or substantial portions of the Software. * +dnl * +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * +dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * +dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +dnl * +dnl Except as contained in this notice, the name(s) of the above copyright * +dnl holders shall not be used in advertising or otherwise to promote the * +dnl sale, use or other dealings in this Software without prior written * +dnl authorization. * +dnl*************************************************************************** +dnl +dnl Author: Thomas E. Dickey 1996, etc. +dnl +dnl $Id: configure.in,v 1.89 2011/01/15 19:41:30 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) +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 --------------------------------------------------------------------------- +AC_PREREQ(2.13.20020210) +AC_INIT(ncurses.c) +AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin) + +CF_INHERIT_SCRIPT(config.guess) +CF_INHERIT_SCRIPT(config.sub) +CF_CHECK_CACHE + +AC_ARG_PROGRAM + +AC_PROG_MAKE_SET +AC_PROG_CC +AC_PROG_CPP +AC_PROG_AWK +CF_PROG_INSTALL +CF_PROG_LINT +CF_MAKE_TAGS + +CF_MATH_LIB(MATH_LIB,sin(x)) +AC_SUBST(MATH_LIB) + +dnl Things that we don't need (or must override) if we're not building ncurses +CC_G_OPT="-g" AC_SUBST(CC_G_OPT) +CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS) +CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS) +DFT_DEP_SUFFIX="" AC_SUBST(DFT_DEP_SUFFIX) +DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR) +DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL) +LD="ld" AC_SUBST(LD) +LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED) +LDFLAGS_STATIC="" AC_SUBST(LDFLAGS_STATIC) +LD_MODEL="" AC_SUBST(LD_MODEL) +LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS) +LIBTOOL="" AC_SUBST(LIBTOOL) +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) +PTHREAD="-lm" AC_SUBST(PTHREAD) +TEST_ARGS="" AC_SUBST(TEST_ARGS) +TEST_DEPS="" AC_SUBST(TEST_DEPS) +TEST_LIBS="" AC_SUBST(TEST_LIBS) +TINFO_ARGS='$(LIBS_CURSES)' AC_SUBST(TINFO_ARGS) +cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version) +cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version) + +cf_cv_screen=curses +cf_cv_libtype= + +AC_EXEEXT +AC_OBJEXT + +CF_ANSI_CC_REQD +CF_GCC_ATTRIBUTES +CF_XOPEN_SOURCE +AC_C_CONST +CF_SIG_ATOMIC_T + +CF_DISABLE_ECHO +CF_ENABLE_WARNINGS + +CF_DISABLE_LEAKS +CF_WITH_CURSES_DIR + +dnl SunOS 4.x +AC_ARG_WITH(5lib, + [ --with-5lib use SunOS sysv-libraries], + [LIBS="-L/usr/5lib $LIBS" + CPPFLAGS="$CPPFLAGS -I/usr/5include"]) + +dnl --------------------------------------------------------------------------- +dnl NcursesW, installed in conventional location +AC_ARG_WITH(ncursesw, + [ --with-ncursesw use wide ncurses-libraries (installed)], + [cf_cv_screen=ncursesw],[ + +dnl Ncurses, installed in conventional location +AC_ARG_WITH(ncurses, + [ --with-ncurses use ncurses-libraries (installed)], + [cf_cv_screen=ncurses],[ + +AC_ARG_WITH(pdcurses, + [ --with-pdcurses compile/link with pdcurses X11 library], + [cf_cv_screen=pdcurses])])]) + +case $cf_cv_screen in +curses) + CF_CURSES_CONFIG + CF_NETBSD_FORM_H + CF_NETBSD_MENU_H + ;; +ncurses) + CF_NCURSES_CONFIG + ;; +ncursesw) + cf_cv_libtype=w + CF_UTF8_LIB + CF_NCURSES_CONFIG(ncursesw) + ;; +pdcurses) #(vi + CF_PDCURSES_X11 + ;; +esac + +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 + ;; +*) + # look for curses-related libraries + AC_CHECK_LIB(panel$cf_cv_libtype,new_panel) + AC_CHECK_LIB(menu$cf_cv_libtype,menu_driver) + AC_CHECK_LIB(form$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 \ + ) + ;; +esac + +AC_TYPE_SIGNAL + +AC_STDC_HEADERS +AC_HEADER_TIME +AC_CHECK_HEADERS( \ +getopt.h \ +locale.h \ +stdarg.h \ +sys/ioctl.h \ +sys/select.h \ +sys/time.h \ +termios.h \ +unistd.h \ +) + +AC_CHECK_FUNCS( \ +gettimeofday \ +mblen \ +mbrlen \ +mbrtowc \ +mbsrtowcs \ +mbstowcs \ +mbtowc \ +strdup \ +wcsrtombs \ +wcstombs \ +) + +CF_CURSES_FUNCS( \ +chgat \ +color_set \ +filter \ +getbegx \ +getcurx \ +getmaxx \ +getnstr \ +getparx \ +getwin \ +mvvline \ +mvwvline \ +napms \ +putwin \ +resize_term \ +resizeterm \ +ripoffline \ +scr_dump \ +setupterm \ +slk_color \ +slk_init \ +termattrs \ +tgetent \ +tigetnum \ +tigetstr \ +typeahead \ +use_default_colors \ +vw_printw \ +vsscanf \ +wchgat \ +winsstr \ +wresize \ +wsyncdown \ +) + +CF_NCURSES_EXT_FUNCS + +AC_CACHE_CHECK(for wide-character functions,cf_cv_widechar_funcs,[ +AC_TRY_LINK([ +#include <${cf_cv_ncurses_header:-curses.h}>], +[ + static wchar_t src_wchar[2]; + static cchar_t dst_cchar; + setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0); + ], + [cf_cv_widechar_funcs=yes], + [cf_cv_widechar_funcs=no]) +]) +if test "$cf_cv_widechar_funcs" != no ; then + AC_DEFINE(USE_WIDEC_SUPPORT,1) +else + AC_DEFINE(USE_WIDEC_SUPPORT,0) +fi + +AC_FUNC_VFORK +CF_SYS_TIME_SELECT +CF_FUNC_CURSES_VERSION +CF_CURSES_ACS_MAP +CF_CURSES_WACS_MAP +CF_CURSES_WACS_SYMBOLS + +CF_CURSES_CHECK_TYPE(attr_t,long) + +CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T, NCURSES_OK_MBSTATE_T) +CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T) +CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T) + +if test "$NCURSES_OK_MBSTATE_T" = 0 ; then + CF_CURSES_CHECK_TYPE(mbstate_t,long) +fi + +if test "$NCURSES_OK_WCHAR_T" = 0 ; then + CF_CURSES_CHECK_TYPE(wchar_t,long) +fi + +if test "$NCURSES_OK_WINT_T" = 0 ; then + CF_CURSES_CHECK_TYPE(wint_t,long) +fi + +CF_CURSES_CHECK_DATA(boolnames) +CF_CURSES_CHECK_DATA(boolfnames) + +TEST_ARGS="$LIBS" +LIBS= + +dnl --------------------------------------------------------------------------- + +AC_OUTPUT(Makefile,[ +CF_PRG_RULES([$srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD"], .) + cat >>Makefile <>Makefile <>Makefile < + +#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#define MY_LOGFILE "demo_altkeys.log" +#define MY_KEYS (KEY_MAX + 1) + +/* + * Log the most recently-written line to our logfile + */ +static void +log_last_line(WINDOW *win) +{ + FILE *fp; + int y, x, n; + char temp[256]; + + if ((fp = fopen(MY_LOGFILE, "a")) != 0) { + int need = sizeof(temp) - 1; + if (need > COLS) + need = COLS; + getyx(win, y, x); + wmove(win, y - 1, 0); + n = winnstr(win, temp, need); + while (n-- > 0) { + if (isspace(UChar(temp[n]))) + temp[n] = '\0'; + else + break; + } + wmove(win, y, x); + fprintf(fp, "%s\n", temp); + fclose(fp); + } +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + int n; + int ch; +#if HAVE_GETTIMEOFDAY + int secs, msecs; + struct timeval current, previous; +#endif + + 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 */ + + scrollok(stdscr, TRUE); + keypad(stdscr, TRUE); + move(0, 0); + + /* we do the define_key() calls after keypad(), since the first call to + * keypad() initializes the corresponding data. + */ + for (n = 0; n < 255; ++n) { + char temp[10]; + sprintf(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); + define_key(temp, n + MY_KEYS); + free(temp); + free(value); + } + } + +#if HAVE_GETTIMEOFDAY + gettimeofday(&previous, 0); +#endif + + while ((ch = getch()) != ERR) { + bool escaped = (ch >= MY_KEYS); + const char *name = keyname(escaped ? (ch - MY_KEYS) : ch); + +#if HAVE_GETTIMEOFDAY + gettimeofday(¤t, 0); + secs = (int) (current.tv_sec - previous.tv_sec); + msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000); + if (msecs < 0) { + msecs += 1000; + --secs; + } + if (msecs >= 1000) { + secs += msecs / 1000; + msecs %= 1000; + } + printw("%6d.%03d ", secs, msecs); + previous = current; +#endif + printw("Keycode %d, name %s%s\n", + ch, + escaped ? "ESC-" : "", + name != 0 ? name : ""); + log_last_line(stdscr); + clrtoeol(); + if (ch == 'q') + break; + } + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/demo_defkey.c b/test/demo_defkey.c new file mode 100644 index 00000000000..ac6dc2df79e --- /dev/null +++ b/test/demo_defkey.c @@ -0,0 +1,282 @@ +/**************************************************************************** + * Copyright (c) 2002-2007,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 * + * "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_defkey.c,v 1.20 2010/11/14 00:59:35 tom Exp $ + * + * Demonstrate the define_key() function. + * Thomas Dickey - 2002/11/23 + */ + +#include + +#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS + +#define MY_LOGFILE "demo_defkey.log" + +/* + * Log the most recently-written line to our logfile + */ +static void +log_last_line(WINDOW *win) +{ + FILE *fp; + int y, x, n; + char temp[256]; + + if ((fp = fopen(MY_LOGFILE, "a")) != 0) { + int need = sizeof(temp) - 1; + if (need > COLS) + need = COLS; + getyx(win, y, x); + wmove(win, y - 1, 0); + n = winnstr(win, temp, need); + while (n-- > 0) { + if (isspace(UChar(temp[n]))) + temp[n] = '\0'; + else + break; + } + wmove(win, y, x); + fprintf(fp, "%s\n", temp); + fclose(fp); + } +} + +/* + * Convert a character to visible form. + */ +static char * +visichar(int ch) +{ + static char temp[10]; + + ch = UChar(ch); + assert(ch >= 0 && ch < 256); + if (ch == '\\') { + strcpy(temp, "\\\\"); + } else if (ch == '\033') { + strcpy(temp, "\\E"); + } else if (ch < ' ') { + sprintf(temp, "\\%03o", ch); + } else if (ch >= 127) { + sprintf(temp, "\\%03o", ch); + } else { + sprintf(temp, "%c", ch); + } + return temp; +} + +/* + * Convert a string to visible form. + */ +static char * +visible(const char *string) +{ + char *result = 0; + size_t need = 1; + int pass; + int n; + + if (string != 0 && *string != '\0') { + for (pass = 0; pass < 2; ++pass) { + for (n = 0; string[n] != '\0'; ++n) { + char temp[80]; + strcpy(temp, visichar(string[n])); + if (pass) + strcat(result, temp); + else + need += strlen(temp); + } + if (!pass) + result = typeCalloc(char, need); + } + } else { + result = typeCalloc(char, 1); + } + return result; +} + +static void +really_define_key(WINDOW *win, const char *new_string, int code) +{ + int rc; + const char *code_name = keyname(code); + char *old_string; + char *vis_string = 0; + char temp[80]; + + if (code_name == 0) { + sprintf(temp, "Keycode %d", code); + code_name = temp; + } + + if ((old_string = keybound(code, 0)) != 0) { + wprintw(win, "%s is %s\n", + code_name, + vis_string = visible(old_string)); + } else { + wprintw(win, "%s is not bound\n", + code_name); + } + log_last_line(win); + + if (vis_string != 0) { + free(vis_string); + vis_string = 0; + } + + vis_string = visible(new_string); + if ((rc = key_defined(new_string)) > 0) { + wprintw(win, "%s was bound to %s\n", vis_string, keyname(rc)); + log_last_line(win); + } else if (new_string != 0 && rc < 0) { + wprintw(win, "%s conflicts with longer strings\n", vis_string); + log_last_line(win); + } + rc = define_key(new_string, code); + if (rc == ERR) { + wprintw(win, "%s unchanged\n", code_name); + log_last_line(win); + } else if (new_string != 0) { + wprintw(win, "%s is now bound to %s\n", + vis_string, + code_name); + log_last_line(win); + } else if (old_string != 0) { + wprintw(win, "%s deleted\n", code_name); + log_last_line(win); + } + if (vis_string != 0) + free(vis_string); + if (old_string != 0) + free(old_string); +} + +static void +duplicate(WINDOW *win, NCURSES_CONST char *name, int code) +{ + char *value = tigetstr(name); + + if (value != 0) { + const char *prefix = 0; + char temp[BUFSIZ]; + + if (!strncmp(value, "\033[", 2)) { + prefix = "\033O"; + } else if (!strncmp(value, "\033O", 2)) { + prefix = "\033["; + } + if (prefix != 0) { + sprintf(temp, "%s%s", prefix, value + 2); + really_define_key(win, temp, code); + } + } +} + +static void +redefine(WINDOW *win, char *string, int code) +{ + really_define_key(win, string, code); +} + +static void +remove_definition(WINDOW *win, int code) +{ + really_define_key(win, 0, code); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + char *fkeys[12]; + int n; + int ch; + WINDOW *win; + + unlink(MY_LOGFILE); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + printw("This demo is best on xterm: it reverses the definitions for f1-f12,\n"); + printw("adds duplicate definitions for cursor application and normal modes,\n"); + printw("and removes any definitions for the mini keypad. Type any of those:\n"); + refresh(); + + win = newwin(LINES - 3, COLS, 3, 0); + scrollok(win, TRUE); + keypad(win, TRUE); + wmove(win, 0, 0); + + /* we do the define_key() calls after keypad(), since the first call to + * keypad() initializes the corresponding data. + */ + for (n = 0; n < 12; ++n) { + char name[10]; + sprintf(name, "kf%d", n + 1); + fkeys[n] = tigetstr(name); + } + for (n = 0; n < 12; ++n) { + redefine(win, fkeys[11 - n], KEY_F(n + 1)); + } + + duplicate(win, "kcub1", KEY_LEFT); + duplicate(win, "kcuu1", KEY_UP); + duplicate(win, "kcud1", KEY_DOWN); + duplicate(win, "kcuf1", KEY_RIGHT); + + remove_definition(win, KEY_A1); + remove_definition(win, KEY_A3); + remove_definition(win, KEY_B2); + remove_definition(win, KEY_C1); + remove_definition(win, KEY_C3); + + really_define_key(win, "\033O", 1023); + + while ((ch = wgetch(win)) != ERR) { + const char *name = keyname(ch); + wprintw(win, "Keycode %d, name %s\n", + ch, + name != 0 ? name : ""); + log_last_line(win); + wclrtoeol(win); + if (ch == 'q') + break; + } + endwin(); + ExitProgram(EXIT_FAILURE); +} +#else +int +main(void) +{ + printf("This program requires the ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/demo_forms.c b/test/demo_forms.c new file mode 100644 index 00000000000..afa4ed32c22 --- /dev/null +++ b/test/demo_forms.c @@ -0,0 +1,550 @@ +/**************************************************************************** + * Copyright (c) 2003-2010,2011 Free 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_forms.c,v 1.38 2011/01/15 18:15:11 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 - +field_term - +form_init - +form_opts - +form_opts_off - +form_opts_on - +form_request_by_name - +form_term - +form_userptr - +free_fieldtype - +link_field - +link_fieldtype - +move_field - +new_page - +pos_form_cursor - +set_field_init - +set_field_term - +set_fieldtype_arg - +set_fieldtype_choice - +set_form_fields - +set_form_init - +set_form_opts - +set_form_page - +set_form_term - +set_form_userptr - +set_max_field - +*/ + +#include + +#if USE_LIBFORM + +#include + +static int d_option = 0; +static int j_value = 0; +static int m_value = 0; +static int o_value = 0; +static char *t_value = 0; + +static FIELD * +make_label(int frow, int fcol, NCURSES_CONST char *label) +{ + FIELD *f = new_field(1, (int) strlen(label), frow, fcol, 0, 0); + + if (f) { + set_field_buffer(f, 0, label); + set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE)); + } + return (f); +} + +/* + * Define each field with an extra one, for reflecting "actual" text. + */ +static FIELD * +make_field(int frow, int fcol, int rows, int cols) +{ + FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1); + + if (f) { + FieldAttrs *ptr; + + set_field_back(f, A_UNDERLINE); + /* + * If -j and -d options are combined, -j loses. It is documented in + * "Character User Interface Programming", page 12-15 that setting + * O_STATIC off makes the form library ignore justification. + */ + set_field_just(f, j_value); + if (d_option) { + if (has_colors()) { + set_field_fore(f, COLOR_PAIR(2)); + set_field_back(f, A_UNDERLINE | COLOR_PAIR(3)); + } else { + set_field_fore(f, A_BOLD); + } + /* + * The field_opts_off() call dumps core with Solaris curses, + * but that is a known bug in Solaris' form library -TD + */ + field_opts_off(f, O_STATIC); + set_max_field(f, m_value); + } + + /* + * The userptr is used in edit_field.c's inactive_field(). + */ + ptr = (FieldAttrs *) field_userptr(f); + if (ptr == 0) { + ptr = typeCalloc(FieldAttrs, 1); + ptr->background = field_back(f); + } + set_field_userptr(f, (void *) ptr); + if (t_value) + set_field_buffer(f, 0, t_value); + } + return (f); +} + +static void +display_form(FORM * f) +{ + WINDOW *w; + int rows, cols; + + scale_form(f, &rows, &cols); + + /* + * Put the form at the upper-left corner of the display, with just a box + * around it. + */ + if ((w = newwin(rows + 2, cols + 4, 0, 0)) != (WINDOW *) 0) { + set_form_win(f, w); + set_form_sub(f, derwin(w, rows, cols, 1, 2)); + box(w, 0, 0); + keypad(w, TRUE); + } + + if (post_form(f) != E_OK) + wrefresh(w); +} + +static void +erase_form(FORM * f) +{ + WINDOW *w = form_win(f); + WINDOW *s = form_sub(f); + + unpost_form(f); + werase(w); + wrefresh(w); + delwin(s); + delwin(w); +} + +static void +show_insert_mode(bool insert_mode) +{ + MvAddStr(5, 57, (insert_mode + ? "form_status: insert " + : "form_status: overlay")); +} + +#define O_SELECTABLE (O_ACTIVE | O_VISIBLE) + +static FIELD * +another_field(FORM * form, FIELD * field) +{ + FIELD **f = form_fields(form); + FIELD *result = 0; + int n; + + for (n = 0; f[n] != 0; ++n) { + if (f[n] != field) { + result = f[n]; + field_opts_on(result, O_SELECTABLE); + break; + } + } + return result; +} + +static int +my_form_driver(FORM * form, int c) +{ + static bool insert_mode = TRUE; + FIELD *field; + + switch (c) { + case MY_QUIT: + if (form_driver(form, REQ_VALIDATION) == E_OK) + return (TRUE); + break; + case MY_HELP: + help_edit_field(); + break; + case MY_EDT_MODE: + if ((field = current_field(form)) != 0) { + set_current_field(form, another_field(form, field)); + if ((unsigned) field_opts(field) & O_EDIT) { + field_opts_off(field, O_EDIT); + set_field_status(field, 0); + } else { + field_opts_on(field, O_EDIT); + } + set_current_field(form, field); + } + break; + case MY_INS_MODE: + /* there should be a form_status() function, but there is none */ + if (!insert_mode) { + if (form_driver(form, REQ_INS_MODE) == E_OK) { + insert_mode = TRUE; + } + } else { + if (form_driver(form, REQ_OVL_MODE) == E_OK) { + insert_mode = FALSE; + } + } + show_insert_mode(insert_mode); + refresh(); + break; + default: + beep(); + break; + } + return (FALSE); +} + +static void +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; + + if (has_colors()) { + wbkgd(win, COLOR_PAIR(1)); + } + werase(win); + form_getyx(form, currow, curcol); + wprintw(win, "Cursor: %d,%d", currow, curcol); + if (data_ahead(form)) + waddstr(win, " ahead"); + if (data_behind(form)) + waddstr(win, " behind"); + waddch(win, '\n'); + if ((field = current_field(form)) != 0) { + wprintw(win, "Page %d%s, Field %d/%d%s:", + form_page(form), + new_page(field) ? "*" : "", + field_index(field), field_count(form), + field_arg(field) ? "(arg)" : ""); + if ((type = field_type(field)) != 0) { + if (type == TYPE_ALNUM) + waddstr(win, "ALNUM"); + else if (type == TYPE_ALPHA) + waddstr(win, "ALPHA"); + else if (type == TYPE_ENUM) + waddstr(win, "ENUM"); + else if (type == TYPE_INTEGER) + waddstr(win, "INTEGER"); +#ifdef NCURSES_VERSION + else if (type == TYPE_IPV4) + waddstr(win, "IPV4"); +#endif + else if (type == TYPE_NUMERIC) + waddstr(win, "NUMERIC"); + else if (type == TYPE_REGEXP) + waddstr(win, "REGEXP"); + else + waddstr(win, "other"); + } + + if ((unsigned) field_opts(field) & O_EDIT) + waddstr(win, " editable"); + else + waddstr(win, " readonly"); + + if (field_status(field)) + waddstr(win, " modified"); + + if (dynamic_field_info(field, &field_rows, &field_cols, &field_max) + != ERR) { + wprintw(win, " size %dx%d (max %d)", + field_rows, field_cols, field_max); + } + + waddch(win, ' '); + (void) wattrset(win, field_fore(field)); + waddstr(win, "fore"); + wattroff(win, field_fore(field)); + + waddch(win, '/'); + + (void) wattrset(win, field_back(field)); + waddstr(win, "back"); + wattroff(win, field_back(field)); + + wprintw(win, ", pad '%c'", + field_pad(field)); + + waddstr(win, "\n"); + for (nbuf = 0; nbuf <= 2; ++nbuf) { + if ((buffer = field_buffer(field, nbuf)) != 0) { + wprintw(win, "buffer %d:", nbuf); + (void) wattrset(win, A_REVERSE); + waddstr(win, buffer); + wattroff(win, A_REVERSE); + waddstr(win, "\n"); + } + } + } + wrefresh(win); +} + +static void +demo_forms(void) +{ + WINDOW *w; + FORM *form; + FIELD *f[100]; /* FIXME memset to zero */ + int finished = 0, c; + unsigned n = 0; + int pg; + WINDOW *also; + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + + help_edit_field(); + + MvAddStr(4, 57, "Forms Entry Test"); + show_insert_mode(TRUE); + + refresh(); + + /* describe the form */ + memset(f, 0, sizeof(f)); + for (pg = 0; pg < 4; ++pg) { + char label[80]; + sprintf(label, "Sample Form Page %d", pg + 1); + f[n++] = make_label(0, 15, label); + set_new_page(f[n - 1], TRUE); + + switch (pg) { + default: + f[n++] = make_label(2, 0, "Last Name"); + f[n++] = make_field(3, 0, 1, 18); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + + f[n++] = make_label(2, 20, "First Name"); + f[n++] = make_field(3, 20, 1, 12); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + + f[n++] = make_label(2, 34, "Middle Name"); + f[n++] = make_field(3, 34, 1, 12); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + break; + case 1: + f[n++] = make_label(2, 0, "Last Name"); + f[n++] = make_field(3, 0, 1, 18); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + + f[n++] = make_label(2, 20, "First Name"); + f[n++] = make_field(3, 20, 1, 12); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + + f[n++] = make_label(2, 34, "MI"); + f[n++] = make_field(3, 34, 1, 1); + set_field_pad(f[n - 1], '?'); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + break; + case 2: + f[n++] = make_label(2, 0, "Host Name"); + f[n++] = make_field(3, 0, 1, 18); + set_field_type(f[n - 1], TYPE_ALNUM, 1); + +#ifdef NCURSES_VERSION + f[n++] = make_label(2, 20, "IP Address"); + f[n++] = make_field(3, 20, 1, 12); + set_field_type(f[n - 1], TYPE_IPV4, 1); +#endif + + break; + + case 3: + f[n++] = make_label(2, 0, "Four digits"); + f[n++] = make_field(3, 0, 1, 18); + set_field_type(f[n - 1], TYPE_INTEGER, 4, 0, 0); + + f[n++] = make_label(2, 20, "Numeric"); + f[n++] = make_field(3, 20, 1, 12); + set_field_type(f[n - 1], TYPE_NUMERIC, 3, -10000.0, 100000000.0); + + break; + } + + f[n++] = make_label(5, 0, "Comments"); + f[n++] = make_field(6, 0, 4, 46); + set_field_buffer(f[n - 1], 0, "HELLO\nWORLD!"); + set_field_buffer(f[n - 1], 1, "Hello\nWorld!"); + } + + f[n] = (FIELD *) 0; + + if ((form = new_form(f)) != 0) { + + display_form(form); + + w = form_win(form); + also = newwin(getmaxy(stdscr) - getmaxy(w), COLS, getmaxy(w), 0); + show_current_field(also, form); + + while (!finished) { + switch (edit_field(form, &c)) { + case E_OK: + break; + case E_UNKNOWN_COMMAND: + finished = my_form_driver(form, c); + break; + default: + beep(); + break; + } + show_current_field(also, form); + } + + erase_form(form); + + free_form(form); + } + for (c = 0; f[c] != 0; c++) { + void *ptr = field_userptr(f[c]); + free(ptr); + free_field(f[c]); + } + noraw(); + nl(); + +#ifdef NCURSES_MOUSE_VERSION + mousemask(0, (mmask_t *) 0); +#endif +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: demo_forms [options]" + ,"" + ," -d make fields dynamic" + ," -j value justify (1=left, 2=center, 3=right)" + ," -m value set maximum size of dynamic fields" + ," -o value specify number of offscreen rows in new_field()" + ," -t value specify text to fill fields initially" + }; + unsigned int j; + for (j = 0; j < SIZEOF(tbl); ++j) + fprintf(stderr, "%s\n", tbl[j]); + exit(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + int ch; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "dj:m:o:t:")) != -1) { + switch (ch) { + case 'd': + d_option = TRUE; + break; + case 'j': + j_value = atoi(optarg); + if (j_value < NO_JUSTIFICATION + || j_value > JUSTIFY_RIGHT) + usage(); + break; + case 'm': + m_value = atoi(optarg); + break; + case 'o': + o_value = atoi(optarg); + break; + case 't': + t_value = optarg; + break; + default: + usage(); + + } + } + + initscr(); + cbreak(); + noecho(); + raw(); + nonl(); /* lets us read ^M's */ + intrflush(stdscr, FALSE); + keypad(stdscr, TRUE); + + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + init_pair(2, COLOR_GREEN, COLOR_BLACK); + init_pair(3, COLOR_CYAN, COLOR_BLACK); + bkgd(COLOR_PAIR(1)); + refresh(); + } + + demo_forms(); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the curses form library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/demo_keyok.c b/test/demo_keyok.c new file mode 100644 index 00000000000..8724d9819ea --- /dev/null +++ b/test/demo_keyok.c @@ -0,0 +1,82 @@ +/**************************************************************************** + * Copyright (c) 2002-2003,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"), 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_keyok.c,v 1.5 2006/11/04 20:09:51 tom Exp $ + * + * Demonstrate the keyok() function. + * Thomas Dickey - 2002/11/23 + */ + +#include + +#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + int lastch = ERR; + int ch; + WINDOW *win; + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + printw("Typing any function key will disable it, but typing it twice in\n"); + printw("a row will turn it back on (just for a demo)."); + refresh(); + + win = newwin(LINES - 2, COLS, 2, 0); + scrollok(win, TRUE); + keypad(win, TRUE); + wmove(win, 0, 0); + + while ((ch = wgetch(win)) != ERR) { + const char *name = keyname(ch); + wprintw(win, "Keycode %d, name %s\n", + ch, + name != 0 ? name : ""); + wclrtoeol(win); + wrefresh(win); + if (ch >= KEY_MIN) { + keyok(ch, FALSE); + lastch = ch; + } else if (lastch >= KEY_MIN) { + keyok(lastch, TRUE); + } + } + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/demo_menus.c b/test/demo_menus.c new file mode 100644 index 00000000000..4f758079e79 --- /dev/null +++ b/test/demo_menus.c @@ -0,0 +1,902 @@ +/**************************************************************************** + * Copyright (c) 2005-2010,2011 Free 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_menus.c,v 1.32 2011/01/15 20:02:47 tom Exp $ + * + * Demonstrate a variety of functions from the menu library. + * Thomas Dickey - 2005/4/9 + */ +/* +item_description - +item_init - +item_opts - +item_opts_off - +item_opts_on - +item_term - +item_userptr - +item_visible - +menu_back - +menu_fore - +menu_format - +menu_grey - +menu_init - +menu_opts - +menu_pad - +menu_request_by_name - +menu_request_name - +menu_sub - +menu_term - +menu_userptr - +set_current_item - +set_item_init - +set_item_opts - +set_item_term - +set_item_userptr - +set_menu_grey - +set_menu_init - +set_menu_items - +set_menu_opts - +set_menu_pad - +set_menu_pattern - +set_menu_spacing - +set_menu_term - +set_menu_userptr - +set_top_row - +top_row - +*/ + +#include + +#if USE_LIBMENU + +#include + +#include +#include + +#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 { + eBanner = -1 + ,eFile + ,eSelect +#ifdef TRACE + ,eTrace +#endif + ,eMAX +} MenuNo; + +#define okMenuNo(n) (((n) > eBanner) && ((n) < eMAX)) + +#define MENU_Y 1 + +static MENU *mpBanner; +static MENU *mpFile; +static MENU *mpSelect; + +static bool loaded_file = FALSE; + +#if !HAVE_STRDUP +#define strdup my_strdup +static char * +strdup(char *s) +{ + char *p = typeMalloc(char, strlen(s) + 1); + if (p) + strcpy(p, s); + return (p); +} +#endif /* not HAVE_STRDUP */ + +/* Common function to allow ^T to toggle trace-mode in the middle of a test + * so that trace-files can be made smaller. + */ +static int +wGetchar(WINDOW *win) +{ + int c; +#ifdef TRACE + while ((c = wgetch(win)) == CTRL('T')) { + if (_nc_tracing) { + save_trace = _nc_tracing; + Trace(("TOGGLE-TRACING OFF")); + _nc_tracing = 0; + } else { + _nc_tracing = save_trace; + } + trace(_nc_tracing); + if (_nc_tracing) + Trace(("TOGGLE-TRACING ON")); + } +#else + c = wgetch(win); +#endif + return c; +} +#define Getchar() wGetchar(stdscr) + +static int +menu_virtualize(int c) +{ + int result; + + if (c == '\n' || c == KEY_EXIT) + result = (MAX_COMMAND + 1); + else if (c == 'u') + result = (REQ_SCR_ULINE); + else if (c == 'd') + result = (REQ_SCR_DLINE); + else if (c == 'b' || c == KEY_NPAGE) + result = (REQ_SCR_UPAGE); + else if (c == 'f' || c == KEY_PPAGE) + result = (REQ_SCR_DPAGE); + else if (c == 'l' || c == KEY_LEFT || c == KEY_BTAB) + result = (REQ_LEFT_ITEM); + else if (c == 'n' || c == KEY_DOWN) + result = (REQ_NEXT_ITEM); + else if (c == 'p' || c == KEY_UP) + result = (REQ_PREV_ITEM); + else if (c == 'r' || c == KEY_RIGHT || c == '\t') + result = (REQ_RIGHT_ITEM); + else if (c == ' ') + result = (REQ_TOGGLE_ITEM); + else { + if (c != KEY_MOUSE) + beep(); + result = (c); + } + return result; +} + +static int +menu_getc(MENU * m) +{ + return wGetchar(menu_win(m)); +} + +static int +menu_offset(MenuNo number) +{ + int result = 0; + + if (okMenuNo(number)) { + int spc_desc, spc_rows, spc_cols; + +#ifdef NCURSES_VERSION + menu_spacing(mpBanner, &spc_desc, &spc_rows, &spc_cols); +#else + spc_rows = 0; +#endif + + /* FIXME: MENU.itemlen seems the only way to get actual width of items */ + result = (number - (eBanner + 1)) * (menu_itemwidth(mpBanner) + spc_rows); + } + return result; +} + +static MENU * +menu_create(ITEM ** items, int count, int ncols, MenuNo number) +{ + MENU *result; + WINDOW *menuwin; + int mrows, mcols; + int y = okMenuNo(number) ? MENU_Y : 0; + int x = menu_offset(number); + int margin = (y == MENU_Y) ? 1 : 0; + int maxcol = (ncols + x) < COLS ? ncols : (COLS - x - 1); + int maxrow = (count + 1) / ncols; + + if ((maxrow + y) >= (LINES - 4)) + maxrow = LINES - 4 - y; + + result = new_menu(items); + + if (has_colors()) { + set_menu_fore(result, COLOR_PAIR(1)); + set_menu_back(result, COLOR_PAIR(2)); + } + + set_menu_format(result, maxrow, maxcol); + scale_menu(result, &mrows, &mcols); + + 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); + if (margin) + box(menuwin, 0, 0); + + set_menu_sub(result, derwin(menuwin, mrows, mcols, margin, margin)); + + post_menu(result); + + return result; +} + +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; + + count = item_count(m); + Trace(("menu_destroy %p count %d", (void *) m, count)); + if ((count > 0) && (m == mpSelect)) { + blob = item_name(*items); + } + + unpost_menu(m); + free_menu(m); + + /* free the extra data allocated in build_select_menu() */ + if ((count > 0) && (m == mpSelect)) { + if (blob && loaded_file) { + Trace(("freeing blob %p", blob)); + free((char *) blob); + } + free(items); + } +#ifdef TRACE + if ((count > 0) && (m == mpTrace)) { + ITEM **ip = items; + while (*ip) + free(*ip++); + } +#endif + } +} + +/* force the given menu to appear */ +static void +menu_display(MENU * m) +{ + touchwin(menu_win(m)); + wrefresh(menu_win(m)); +} + +/*****************************************************************************/ + +static void +build_file_menu(MenuNo number) +{ + static CONST_MENUS char *labels[] = + { + "Exit", + (char *) 0 + }; + static ITEM *items[SIZEOF(labels)]; + + ITEM **ip = items; + CONST_MENUS char **ap; + + for (ap = labels; *ap; ap++) + *ip++ = new_item(*ap, ""); + *ip = (ITEM *) 0; + + mpFile = menu_create(items, SIZEOF(labels) - 1, 1, number); +} + +static int +perform_file_menu(int cmd) +{ + return menu_driver(mpFile, cmd); +} + +/*****************************************************************************/ + +static void +build_select_menu(MenuNo number, char *filename) +{ + static CONST_MENUS char *labels[] = + { + "Lions", + "Tigers", + "Bears", + "(Oh my!)", + "Newts", + "Platypi", + "Lemurs", + "(Oh really?!)", + "Leopards", + "Panthers", + "Pumas", + "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", + "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs, Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", + (char *) 0 + }; + static ITEM **items; + + ITEM **ip; + CONST_MENUS char **ap = 0; + CONST_MENUS char **myList = 0; + unsigned count = 0; + + if (filename != 0) { + struct stat sb; + if (stat(filename, &sb) == 0 + && (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); + CONST_MENUS char **list = typeCalloc(CONST_MENUS char *, size + 1); + + items = typeCalloc(ITEM *, size + 1); + Trace(("build_select_menu blob=%p, items=%p", + (void *) blob, + (void *) items)); + if (blob != 0 && list != 0) { + FILE *fp = fopen(filename, "r"); + if (fp != 0) { + if (fread(blob, sizeof(char), size, fp) == size) { + bool mark = TRUE; + for (j = k = 0; j < size; ++j) { + if (mark) { + list[k++] = blob + j; + mark = FALSE; + } + if (blob[j] == '\n') { + blob[j] = '\0'; + if (k > 0 && *list[k - 1] == '\0') + --k; + mark = TRUE; + } else if (blob[j] == '\t') { + blob[j] = ' '; /* menu items are printable */ + } + } + list[k] = 0; + count = k; + ap = myList = list; + } + fclose(fp); + } + loaded_file = TRUE; + } + } + } + if (ap == 0) { + count = SIZEOF(labels) - 1; + items = typeCalloc(ITEM *, count + 1); + ap = labels; + } + + ip = items; + while (*ap != 0) + *ip++ = new_item(*ap++, ""); + *ip = 0; + + mpSelect = menu_create(items, (int) count, 1, number); + if (myList != 0) + free(myList); +} + +static int +perform_select_menu(int cmd) +{ + return menu_driver(mpSelect, cmd); +} + +/*****************************************************************************/ + +#ifdef TRACE +#define T_TBL(name) { #name, name } +static struct { + const char *name; + unsigned mask; +} t_tbl[] = { + + T_TBL(TRACE_DISABLE), + T_TBL(TRACE_TIMES), + T_TBL(TRACE_TPUTS), + T_TBL(TRACE_UPDATE), + T_TBL(TRACE_MOVE), + T_TBL(TRACE_CHARPUT), + T_TBL(TRACE_ORDINARY), + T_TBL(TRACE_CALLS), + T_TBL(TRACE_VIRTPUT), + T_TBL(TRACE_IEVENT), + T_TBL(TRACE_BITS), + T_TBL(TRACE_ICALLS), + T_TBL(TRACE_CCALLS), + T_TBL(TRACE_DATABASE), + T_TBL(TRACE_ATTRS), + T_TBL(TRACE_MAXIMUM), + { + (char *) 0, 0 + } +}; + +static void +build_trace_menu(MenuNo number) +{ + static ITEM *items[SIZEOF(t_tbl)]; + + ITEM **ip = items; + int n; + + for (n = 0; t_tbl[n].name != 0; n++) + *ip++ = new_item(t_tbl[n].name, ""); + *ip = (ITEM *) 0; + + mpTrace = menu_create(items, SIZEOF(t_tbl) - 1, 2, number); +} + +static char * +tracetrace(unsigned tlevel) +{ + static char *buf; + 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); + } + sprintf(buf, "0x%02x = {", tlevel); + if (tlevel == 0) { + sprintf(buf + strlen(buf), "%s, ", t_tbl[0].name); + } 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, ", "); + } + } + if (buf[strlen(buf) - 2] == ',') + buf[strlen(buf) - 2] = '\0'; + return (strcat(buf, "}")); +} + +/* fake a dynamically reconfigurable menu using the 0th entry to deselect + * the others + */ +static bool +update_trace_menu(MENU * m) +{ + ITEM **items; + ITEM *i, **p; + bool changed = FALSE; + + items = menu_items(m); + i = current_item(m); + if (i == items[0]) { + if (item_value(i)) { + for (p = items + 1; *p != 0; p++) + if (item_value(*p)) { + set_item_value(*p, FALSE); + changed = TRUE; + } + } + } + return changed; +} + +static int +perform_trace_menu(int cmd) +/* interactively set the trace level */ +{ + ITEM **ip; + unsigned newtrace; + int result; + + for (ip = menu_items(mpTrace); *ip; ip++) { + unsigned mask = t_tbl[item_index(*ip)].mask; + if (mask == 0) + set_item_value(*ip, _nc_tracing == 0); + else if ((mask & _nc_tracing) == mask) + set_item_value(*ip, TRUE); + } + + result = menu_driver(mpTrace, cmd); + + if (result == E_OK) { + if (update_trace_menu(mpTrace) || cmd == REQ_TOGGLE_ITEM) { + newtrace = 0; + for (ip = menu_items(mpTrace); *ip; ip++) { + if (item_value(*ip)) + newtrace |= t_tbl[item_index(*ip)].mask; + } + trace(newtrace); + Trace(("trace level interactively set to %s", tracetrace(_nc_tracing))); + + MvPrintw(LINES - 2, 0, + "Trace level is %s\n", tracetrace(_nc_tracing)); + refresh(); + } + } + return result; +} +#endif /* TRACE */ + +/*****************************************************************************/ + +static int +menu_number(void) +{ + return item_index(current_item(mpBanner)) - (eBanner + 1); +} + +static MENU * +current_menu(void) +{ + MENU *result; + + switch (menu_number()) { + case eFile: + result = mpFile; + break; + case eSelect: + result = mpSelect; + break; +#ifdef TRACE + case eTrace: + result = mpTrace; + break; +#endif + default: + result = 0; + break; + } + return result; +} + +static void +build_menus(char *filename) +{ + static CONST_MENUS char *labels[] = + { + "File", + "Select", +#ifdef TRACE + "Trace", +#endif + (char *) 0 + }; + static ITEM *items[SIZEOF(labels)]; + + ITEM **ip = items; + CONST_MENUS char **ap; + + for (ap = labels; *ap; ap++) + *ip++ = new_item(*ap, ""); + *ip = (ITEM *) 0; + + mpBanner = menu_create(items, SIZEOF(labels) - 1, SIZEOF(labels) - 1, eBanner); + set_menu_mark(mpBanner, ">"); + + build_file_menu(eFile); + build_select_menu(eSelect, filename); +#ifdef TRACE + build_trace_menu(eTrace); +#endif +} + +static int +move_menu(MENU * menu, MENU * current, int by_y, int by_x) +{ + WINDOW *top_win = menu_win(menu); + WINDOW *sub_win = menu_sub(menu); + int y0, x0; + int y1, x1; + int result; + + getbegyx(top_win, y0, x0); + y0 += by_y; + x0 += by_x; + + getbegyx(sub_win, y1, x1); + y1 += by_y; + x1 += by_x; + + if ((result = mvwin(top_win, y0, x0)) != ERR) { +#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH < 20060218) + sub_win->_begy = y1; + sub_win->_begx = x1; +#else + mvwin(sub_win, y1, x1); +#endif + if (menu == current) { + touchwin(top_win); + wnoutrefresh(top_win); + } + } + return result; +} + +/* + * Move the menus around on the screen, to test mvwin(). + */ +static void +move_menus(MENU * current, int by_y, int by_x) +{ + if (move_menu(mpBanner, current, by_y, by_x) != ERR) { + erase(); + wnoutrefresh(stdscr); + move_menu(mpFile, current, by_y, by_x); + move_menu(mpSelect, current, by_y, by_x); +#ifdef TRACE + move_menu(mpTrace, current, by_y, by_x); +#endif + doupdate(); + } +} + +static void +show_status(int ch, MENU * menu) +{ + move(LINES - 1, 0); + printw("key %s, menu %d, mark %s, match %s", + keyname(ch), + menu_number(), + menu_mark(menu), + menu_pattern(menu)); + clrtoeol(); + refresh(); +} + +static void +perform_menus(void) +{ + MENU *this_menu; + MENU *last_menu = mpFile; + int code = E_UNKNOWN_COMMAND; + int cmd; + int ch = ERR; + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + + menu_display(last_menu); + + for (;;) { + + if (ch != ERR) + show_status(ch, last_menu); + + ch = menu_getc(mpBanner); + + /* + * Provide for moving the menu around in the screen using shifted + * cursor keys. + */ + switch (ch) { + case KEY_SF: + move_menus(last_menu, 1, 0); + continue; + case KEY_SR: + move_menus(last_menu, -1, 0); + continue; + case KEY_SLEFT: + move_menus(last_menu, 0, -1); + continue; + case KEY_SRIGHT: + move_menus(last_menu, 0, 1); + continue; + } + cmd = menu_virtualize(ch); + + switch (cmd) { + /* + * The banner menu acts solely to select one of the other menus. + * Move between its items, wrapping at the left/right limits. + */ + case REQ_LEFT_ITEM: + case REQ_RIGHT_ITEM: + code = menu_driver(mpBanner, cmd); + if (code == E_REQUEST_DENIED) { + if (menu_number() > 0) + code = menu_driver(mpBanner, REQ_FIRST_ITEM); + else + code = menu_driver(mpBanner, REQ_LAST_ITEM); + } + break; + default: + switch (menu_number()) { + case eFile: + code = perform_file_menu(cmd); + break; + case eSelect: + code = perform_select_menu(cmd); + break; +#ifdef TRACE + case eTrace: + code = perform_trace_menu(cmd); + break; +#endif + } + + if ((code == E_REQUEST_DENIED) && (cmd == KEY_MOUSE)) { + code = menu_driver(mpBanner, cmd); + } + + break; + } + + if (code == E_OK) { + this_menu = current_menu(); + if (this_menu != last_menu) { + move(1, 0); + clrtobot(); + box(menu_win(this_menu), 0, 0); + refresh(); + + /* force the current menu to appear */ + menu_display(this_menu); + + last_menu = this_menu; + } + } + wrefresh(menu_win(last_menu)); + if (code == E_UNKNOWN_COMMAND + || code == E_NOT_POSTED) { + if (menu_number() == eFile) + break; + beep(); + } + if (code == E_REQUEST_DENIED) + beep(); + continue; + } + +#ifdef NCURSES_MOUSE_VERSION + mousemask(0, (mmask_t *) 0); +#endif +} + +static void +destroy_menus(void) +{ + menu_destroy(mpFile); + menu_destroy(mpSelect); +#ifdef TRACE + menu_destroy(mpTrace); +#endif + menu_destroy(mpBanner); +} + +#if HAVE_RIPOFFLINE +static int +rip_footer(WINDOW *win, int cols) +{ + wbkgd(win, A_REVERSE); + werase(win); + wmove(win, 0, 0); + wprintw(win, "footer: %d columns", cols); + wnoutrefresh(win); + return OK; +} + +static int +rip_header(WINDOW *win, int cols) +{ + wbkgd(win, A_REVERSE); + werase(win); + wmove(win, 0, 0); + wprintw(win, "header: %d columns", cols); + wnoutrefresh(win); + return OK; +} +#endif /* HAVE_RIPOFFLINE */ + +static void +usage(void) +{ + static const char *const tbl[] = + { + "Usage: demo_menus [options]" + ,"" + ,"Options:" +#if HAVE_RIPOFFLINE + ," -f rip-off footer line (can repeat)" + ," -h rip-off header line (can repeat)" +#endif +#ifdef TRACE + ," -t mask specify default trace-level (may toggle with ^T)" +#endif + }; + 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[]) +{ + int c; + + setlocale(LC_ALL, ""); + + while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) { + switch (c) { +#if HAVE_RIPOFFLINE + case 'f': + ripoffline(-1, rip_footer); + break; + case 'h': + ripoffline(1, rip_header); + break; +#endif /* HAVE_RIPOFFLINE */ +#ifdef TRACE + case 't': + trace(strtoul(optarg, 0, 0)); + break; +#endif + default: + usage(); + } + } + + initscr(); + noraw(); + cbreak(); + noecho(); + + if (has_colors()) { + start_color(); + init_pair(1, COLOR_RED, COLOR_BLACK); + init_pair(2, COLOR_BLUE, COLOR_WHITE); + } + build_menus(argc > 1 ? argv[1] : 0); + perform_menus(); + destroy_menus(); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the curses menu library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/demo_panels.c b/test/demo_panels.c new file mode 100644 index 00000000000..ce6beb703ce --- /dev/null +++ b/test/demo_panels.c @@ -0,0 +1,816 @@ +/**************************************************************************** + * Copyright (c) 2007-2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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_panels.c,v 1.37 2010/05/01 22:19:02 tom Exp $ + * + * Demonstrate a variety of functions from the panel library. + */ + +#include + +#if USE_LIBPANEL + +#include + +#define LAST_POS '@' +#define TEMP_POS '>' + +typedef void (*InitPanel) (void); +typedef void (*FillPanel) (PANEL *); + +static bool use_colors = FALSE; +static bool unboxed = FALSE; +static FILE *log_in; +static FILE *log_out; + +static void +close_input(void) +{ + if (log_in != 0) { + fclose(log_in); + log_in = 0; + } +} + +static void +close_output(void) +{ + if (log_out != 0) { + fclose(log_out); + log_out = 0; + } +} + +static WINDOW * +statusline(void) +{ + WINDOW *result = stdscr; + + wmove(result, LINES - 1, 0); + wclrtoeol(result); + return result; +} + +static void +pflush(void) +{ + update_panels(); + doupdate(); +} + +static void +saywhat(NCURSES_CONST char *text) +{ + WINDOW *win = statusline(); + if (text != 0 && *text != '\0') { + waddstr(win, text); + waddstr(win, "; "); + } + waddstr(win, "press any key to continue"); +} + +static void +show_position(NCURSES_CONST char *text, + NCURSES_CONST char *also, + int which, + int ypos, + int xpos) +{ + WINDOW *win = statusline(); + + wprintw(win, "%s for panel %d now %d,%d%s", text, which, ypos, xpos, also); + wmove(stdscr, ypos, xpos); +} + +static int +get_position(NCURSES_CONST char *text, + NCURSES_CONST char *also, + int which, + int *xpos, + int *ypos) +{ + int result = 0; + int x1, y1; + char cmd; + + getyx(stdscr, y1, x1); + (void) statusline(); + + show_position(text, also, which, y1, x1); + + if (log_in != 0) { + if (fscanf(log_in, "%c%d,%d\n", &cmd, &y1, &x1) == 3) { + switch (cmd) { + case LAST_POS: + result = 1; + (void) wgetch(stdscr); + break; + case TEMP_POS: + result = 0; + wrefresh(stdscr); + napms(100); + break; + default: + result = -1; + break; + } + } else { + result = -1; + } + } else { + + switch (wgetch(stdscr)) { + case QUIT: + case ESCAPE: + case ERR: + result = -1; + break; + case ' ': + result = 1; + break; + case KEY_UP: + if (y1 > 0) { + --y1; + } else { + beep(); + } + break; + case KEY_DOWN: + if (y1 < getmaxy(stdscr)) { + ++y1; + } else { + beep(); + } + break; + case KEY_LEFT: + if (x1 > 0) { + --x1; + } else { + beep(); + } + break; + case KEY_RIGHT: + if (x1 < getmaxx(stdscr)) { + ++x1; + } else { + beep(); + } + break; + } + } + + wmove(stdscr, y1, x1); + *ypos = y1; + *xpos = x1; + + if (result >= 0) { + if (log_out) + fprintf(log_out, "%c%d,%d\n", + ((result > 0) + ? LAST_POS + : TEMP_POS), + y1, x1); + } + return result; +} + +static PANEL * +mkpanel(short color, int rows, int cols, int tly, int tlx) +{ + WINDOW *win; + PANEL *pan = 0; + char *userdata = typeMalloc(char, 3); + + if ((win = newwin(rows, cols, tly, tlx)) != 0) { + keypad(win, TRUE); + if ((pan = new_panel(win)) == 0) { + delwin(win); + } else if (use_colors) { + short fg = (short) ((color == COLOR_BLUE) + ? COLOR_WHITE + : COLOR_BLACK); + short bg = color; + + init_pair(color, fg, bg); + wbkgdset(win, (chtype) (COLOR_PAIR(color) | ' ')); + } else if (!unboxed) { + wbkgdset(win, A_BOLD | ' '); + } + } + sprintf(userdata, "p%d", color % 8); + set_panel_userptr(pan, (NCURSES_CONST void *) userdata); + return pan; +} + +static void +my_remove_panel(PANEL ** pans, int which) +{ + if (pans[which] != 0) { + PANEL *pan = pans[which]; + WINDOW *win = panel_window(pan); + char *user = (char *) panel_userptr(pan); + + free(user); + del_panel(pan); + delwin(win); + + pans[which] = 0; + } +} + +#undef MIN +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define ABS(a) ((a) < 0 ? -(a) : (a)) + +static void +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); + short bg = pair; + int x0, y0, x1, y1; + + init_pair(pair, fg, bg); + + /* remove the old panel, if any */ + my_remove_panel(pans, which); + + /* get the position of one corner */ + wmove(stdscr, getmaxy(stdscr) / 2, getmaxx(stdscr) / 2); + getyx(stdscr, y0, x0); + while ((code = get_position("First corner", "", which, &x0, &y0)) == 0) { + ; + } + + if (code > 0) { + char also[80]; + sprintf(also, " (first %d,%d)", y0, x0); + /* get the position of the opposite corner */ + while ((code = get_position("Opposite corner", + also, which, &x1, &y1)) == 0) { + ; + } + + 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); + /* finish */ + myFill(pan); + pans[which] = pan; + pflush(); + wmove(stdscr, y1, x1); + } + } +} + +static void +my_move_panel(PANEL ** pans, int which, bool continuous) +{ + if (pans[which] != 0) { + int code; + int y0, x0; + int y1, x1; + WINDOW *win = panel_window(pans[which]); + char also[80]; + + getbegyx(win, y0, x0); + sprintf(also, " (start %d,%d)", y0, x0); + wmove(stdscr, y0, x0); + while ((code = get_position("Move panel", also, which, &x1, &y1)) == 0) { + if (continuous) { + move_panel(pans[which], y1, x1); + pflush(); + } + } + if (code > 0) { + move_panel(pans[which], y1, x1); + } + } +} + +static void +my_resize_panel(PANEL ** pans, int which, FillPanel myFill) +{ + if (pans[which] != 0) { + int code; + int y0, x0; + int y1, x1; + WINDOW *win = panel_window(pans[which]); + char also[80]; + + getbegyx(win, y0, x0); + sprintf(also, " (start %d,%d)", y0, x0); + wmove(stdscr, y0, x0); + while ((code = get_position("Resize panel", + also, which, &x1, &y1)) == 0) { + ; + } + if (code > 0) { + WINDOW *next = newwin(ABS(y1 - y0) + 1, + ABS(x1 - x0) + 1, + MIN(y0, y1), + MIN(x0, x1)); + if (next != 0) { + keypad(next, TRUE); + if (use_colors) { + wbkgdset(next, (chtype) (COLOR_PAIR(which) | ' ')); + } else if (!unboxed) { + wbkgdset(next, A_BOLD | ' '); + } + replace_panel(pans[which], next); + myFill(pans[which]); + delwin(win); + } + } + } +} + +static void +init_panel(void) +{ + register int y, x; + + for (y = 0; y < LINES - 1; y++) { + for (x = 0; x < COLS; x++) + wprintw(stdscr, "%d", (y + x) % 10); + } +} + +static void +fill_panel(PANEL * pan) +{ + WINDOW *win = panel_window(pan); + const char *userptr = (const char *) panel_userptr(pan); + int num = (userptr && *userptr) ? userptr[1] : '?'; + int y, x; + + wmove(win, 1, 1); + wprintw(win, "-pan%c-", num); + wclrtoeol(win); + box(win, 0, 0); + for (y = 2; y < getmaxy(win) - 1; y++) { + for (x = 1; x < getmaxx(win) - 1; x++) { + wmove(win, y, x); + waddch(win, UChar(num)); + } + } +} + +static void +fill_unboxed(PANEL * pan) +{ + WINDOW *win = panel_window(pan); + const char *userptr = (const char *) panel_userptr(pan); + int num = (userptr && *userptr) ? userptr[1] : '?'; + int y, x; + + for (y = 0; y < getmaxy(win); y++) { + for (x = 0; x < getmaxx(win); x++) { + wmove(win, y, x); + waddch(win, UChar(num)); + } + } +} + +#if USE_WIDEC_SUPPORT +static void +make_fullwidth_digit(cchar_t *target, int digit) +{ + wchar_t source[2]; + + source[0] = digit + 0xff10; + source[1] = 0; + setcchar(target, source, A_NORMAL, 0, 0); +} + +static void +init_wide_panel(void) +{ + int digit; + cchar_t temp[10]; + + for (digit = 0; digit < 10; ++digit) + make_fullwidth_digit(&temp[digit], digit); + + do { + int y, x; + getyx(stdscr, y, x); + digit = (y + x / 2) % 10; + } while (add_wch(&temp[digit]) != ERR); +} + +static void +fill_wide_panel(PANEL * pan) +{ + WINDOW *win = panel_window(pan); + int num = ((const char *) panel_userptr(pan))[1]; + int y, x; + + wmove(win, 1, 1); + wprintw(win, "-pan%c-", num); + wclrtoeol(win); + box(win, 0, 0); + for (y = 2; y < getmaxy(win) - 1; y++) { + for (x = 1; x < getmaxx(win) - 1; x++) { + wmove(win, y, x); + waddch(win, UChar(num)); + } + } +} +#endif + +#define MAX_PANELS 5 + +static int +which_panel(PANEL * px[MAX_PANELS + 1], PANEL * pan) +{ + int result = 0; + int j; + + for (j = 1; j <= MAX_PANELS; ++j) { + if (px[j] == pan) { + result = j; + break; + } + } + return result; +} + +static void +show_panels(PANEL * px[MAX_PANELS + 1]) +{ + static const char *help[] = + { + "", + "Commands are letter/digit pairs. Digits are the panel number.", + "", + " b - put the panel on the bottom of the stack", + " c - create the panel", + " d - delete the panel", + " h - hide the panel", + " 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" + }; + + struct { + bool valid; + bool hidden; + PANEL *above; + PANEL *below; + } table[MAX_PANELS + 1]; + + WINDOW *win; + PANEL *pan; + int j; + + memset(table, 0, sizeof(table)); + for (j = 1; j <= MAX_PANELS; ++j) { + table[j].valid = (px[j] != 0); + if (table[j].valid) { + table[j].hidden = panel_hidden(px[j]); + table[j].above = panel_above(px[j]); + table[j].below = panel_below(px[j]); + } + } + + if ((win = newwin(LINES - 1, COLS, 0, 0)) != 0) { + keypad(win, TRUE); + if ((pan = new_panel(win)) != 0) { + werase(win); + MvWPrintw(win, 0, 0, "Panels:\n"); + for (j = 1; j <= MAX_PANELS; ++j) { + if (table[j].valid) { + wprintw(win, " %d:", j); + if (table[j].hidden) { + waddstr(win, " hidden"); + } else { + if (table[j].above) { + wprintw(win, " above %d", + which_panel(px, table[j].above)); + } + if (table[j].below) { + wprintw(win, "%s below %d", + table[j].above ? "," : "", + which_panel(px, table[j].below)); + } + } + waddch(win, '\n'); + } + } + for (j = 0; j < (int) SIZEOF(help); ++j) { + if (wprintw(win, "%s\n", help[j]) == ERR) + break; + } + wgetch(win); + del_panel(pan); + pflush(); + } + delwin(win); + } +} + +#define wrapper(func) \ +static int my_##func(PANEL *pan) \ +{ \ + int code = ERR; \ + if (pan != 0) { \ + code = func(pan); \ + } \ + return code; \ +} +/* *INDENT-OFF* */ +wrapper(bottom_panel) +wrapper(hide_panel) +wrapper(show_panel) +wrapper(top_panel) +/* *INDENT-ON* */ + +static void +do_panel(PANEL * px[MAX_PANELS + 1], + NCURSES_CONST char *cmd, + FillPanel myFill) +{ + int which = cmd[1] - '0'; + + if (which < 1 || which > MAX_PANELS) { + beep(); + return; + } + + if (log_in != 0) { + pflush(); + } + + saywhat(cmd); + switch (*cmd) { + case 'b': + my_bottom_panel(px[which]); + break; + case 'c': + my_create_panel(px, which, myFill); + break; + case 'd': + my_remove_panel(px, which); + break; + case 'h': + my_hide_panel(px[which]); + break; + case 'm': + my_move_panel(px, which, FALSE); + break; + case 'M': + my_move_panel(px, which, TRUE); + break; + case 'r': + my_resize_panel(px, which, myFill); + break; + case 's': + my_show_panel(px[which]); + break; + case 't': + my_top_panel(px[which]); + break; + } +} + +static bool +ok_letter(int ch) +{ + return isalpha(UChar(ch)) && strchr("bcdhmMrst", ch) != 0; +} + +static bool +ok_digit(int ch) +{ + return isdigit(UChar(ch)) && (ch >= '1') && (ch - '0' <= MAX_PANELS); +} + +/* + * A command consists of one or more letter/digit pairs separated by a space. + * Digits are limited to 1..MAX_PANELS. + * + * End the command with a newline. Reject other characters. + */ +static bool +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); + win = statusline(); + waddstr(win, "Command:"); + buffer[length = 0] = '\0'; + + if (log_in != 0) { + if (fgets(buffer, limit - 3, log_in) != 0) { + length = (int) strlen(buffer); + while (length > 0 && isspace(UChar(buffer[length - 1]))) + buffer[--length] = '\0'; + waddstr(win, buffer); + } else { + close_input(); + } + (void) wgetch(win); + } else { + c0 = 0; + for (;;) { + ch = wgetch(win); + if (ch == ERR || ch == QUIT || ch == ESCAPE) { + buffer[0] = '\0'; + break; + } else if (ch == CTRL('L')) { + wrefresh(curscr); + } else if (ch == '\n' || ch == KEY_ENTER) { + break; + } else if (ch == '?') { + show_panels(px); + } else if (length + 3 < limit) { + if (ch >= KEY_MIN) { + beep(); + } else if (ok_letter(UChar(ch))) { + if (isalpha(UChar(c0))) { + beep(); + } else if (isdigit(UChar(c0))) { + wprintw(win, " %c", ch); + buffer[length++] = ' '; + buffer[length++] = (char) (c0 = ch); + } else { + wprintw(win, "%c", ch); + buffer[length++] = (char) (c0 = ch); + } + } else if (ok_digit(ch)) { + if (isalpha(UChar(c0))) { + wprintw(win, "%c", ch); + buffer[length++] = (char) (c0 = ch); + } else { + beep(); + } + } else if (ch == ' ') { + if (isdigit(UChar(c0))) { + wprintw(win, "%c", ch); + buffer[length++] = (char) (c0 = ch); + } else { + beep(); + } + } else { + beep(); + } + } else { + beep(); + } + } + } + + wmove(stdscr, y0, x0); + + buffer[length] = '\0'; + if (log_out && length) { + fprintf(log_out, "%s\n", buffer); + } + return (length != 0); +} + +static void +demo_panels(InitPanel myInit, FillPanel myFill) +{ + int itmp; + PANEL *px[MAX_PANELS + 1]; + char buffer[BUFSIZ]; + + scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */ + refresh(); + + myInit(); + memset(px, 0, sizeof(px)); + + while (get_command(px, buffer, sizeof(buffer))) { + int limit = (int) strlen(buffer); + for (itmp = 0; itmp < limit; itmp += 3) { + do_panel(px, buffer + itmp, myFill); + } + pflush(); + } +#if NO_LEAKS + for (itmp = 1; itmp <= MAX_PANELS; ++itmp) { + my_remove_panel(px, itmp); + } +#endif +} + +static void +usage(void) +{ + static const char *const tbl[] = + { + "Usage: demo_panels [options]" + ,"" + ,"Options:" + ," -i file read commands from file" + ," -o file record commands in file" + ," -m do not use colors" +#if USE_WIDEC_SUPPORT + ," -w use wide-characters in panels and background" +#endif + ," -x do not enclose panels in boxes" + }; + 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[]) +{ + int c; + bool monochrome = FALSE; + InitPanel myInit = init_panel; + FillPanel myFill = fill_panel; + + setlocale(LC_ALL, ""); + + while ((c = getopt(argc, argv, "i:o:mwx")) != -1) { + switch (c) { + case 'i': + log_in = fopen(optarg, "r"); + break; + case 'o': + log_out = fopen(optarg, "w"); + break; + case 'm': + monochrome = TRUE; + break; +#if USE_WIDEC_SUPPORT + case 'w': + myInit = init_wide_panel; + myFill = fill_wide_panel; + break; +#endif + case 'x': + unboxed = TRUE; + break; + default: + usage(); + } + } + if (unboxed) + myFill = fill_unboxed; + + initscr(); + cbreak(); + noecho(); + keypad(stdscr, TRUE); + + use_colors = monochrome ? FALSE : has_colors(); + if (use_colors) + start_color(); + + demo_panels(myInit, myFill); + endwin(); + + close_input(); + close_output(); + + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the curses panel library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/demo_termcap.c b/test/demo_termcap.c new file mode 100644 index 00000000000..a3733c67d1c --- /dev/null +++ b/test/demo_termcap.c @@ -0,0 +1,311 @@ +/**************************************************************************** + * Copyright (c) 2005-2010,2011 Free 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: demo_termcap.c,v 1.14 2011/01/15 21:41:27 tom Exp $ + * + * A simple demo of the termcap interface. + */ +#define USE_TINFO +#include + +#if HAVE_TGETENT + +#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) +#define USE_CODE_LISTS 1 +#else +#define USE_CODE_LISTS 0 +#endif + +#define FCOLS 8 +#define FNAME(type) "%s %-*s = ", #type, FCOLS + +#if USE_CODE_LISTS +static bool b_opt = FALSE; +static bool n_opt = FALSE; +static bool s_opt = FALSE; +#endif + +#define isCapName(c) (isgraph(c) && strchr("^#=:\\", c) == 0) + +static void +dumpit(NCURSES_CONST char *cap) +{ + /* + * One of the limitations of the termcap interface is that the library + * cannot determine the size of the buffer passed via tgetstr(), nor the + * amount of space remaining. This demo simply reuses the whole buffer + * for each call; a normal termcap application would try to use the buffer + * to hold all of the strings extracted from the terminal entry. + */ + char area[1024], *ap = area; + char *str; + int num; + + if ((str = tgetstr(cap, &ap)) != 0) { + /* + * 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"); + } else if ((num = tgetnum(cap)) >= 0) { + printf(FNAME(num), cap); + printf(" %d\n", num); + } else if (tgetflag(cap) > 0) { + printf(FNAME(flg), cap); + printf("%s\n", "true"); + } + fflush(stdout); +} + +static void +brute_force(const char *name) +{ + char buffer[1024]; + + printf("Terminal type %s\n", name); + if (tgetent(buffer, name) >= 0) { + char cap[3]; + int c1, c2; + + cap[2] = 0; + for (c1 = 0; c1 < 256; ++c1) { + cap[0] = (char) c1; + if (isCapName(c1)) { + for (c2 = 0; c2 < 256; ++c2) { + cap[1] = (char) c2; + if (isCapName(c2)) { + dumpit(cap); + } + } + } + } + } +} + +#if USE_CODE_LISTS +static void +demo_terminfo(NCURSES_CONST char *name) +{ + unsigned n; + NCURSES_CONST char *cap; + + printf("Terminal type \"%s\"\n", name); +#if HAVE_SETUPTERM + setupterm(name, 1, (int *) 0); +#else + setterm(name); +#endif + + if (b_opt) { + for (n = 0;; ++n) { + cap = boolcodes[n]; + if (cap == 0) + break; + dumpit(cap); + } + } + + if (n_opt) { + for (n = 0;; ++n) { + cap = numcodes[n]; + if (cap == 0) + break; + dumpit(cap); + } + } + + if (s_opt) { + for (n = 0;; ++n) { + cap = strcodes[n]; + if (cap == 0) + break; + dumpit(cap); + } + } +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: demo_terminfo [options] [terminal]", + "", + "If no options are given, print all (boolean, numeric, string)", + "capabilities for the given terminal, using short names.", + "", + "Options:", + " -a try all names, print capabilities found", + " -b print boolean-capabilities", + " -n print numeric-capabilities", + " -r COUNT repeat for given count", + " -s print string-capabilities", + }; + unsigned n; + for (n = 0; n < SIZEOF(msg); ++n) { + fprintf(stderr, "%s\n", msg[n]); + } + ExitProgram(EXIT_FAILURE); +} +#endif + +int +main(int argc, char *argv[]) +{ + int n; + char *name; + bool a_opt = FALSE; + +#if USE_CODE_LISTS + int repeat; + int r_opt = 1; + + while ((n = getopt(argc, argv, "abnr:s")) != -1) { + switch (n) { + case 'a': + a_opt = TRUE; + break; + case 'b': + b_opt = TRUE; + break; + case 'n': + n_opt = TRUE; + break; + case 'r': + if ((r_opt = atoi(optarg)) <= 0) + usage(); + break; + case 's': + s_opt = TRUE; + break; + default: + usage(); + break; + } + } + + if (!(b_opt || n_opt || s_opt)) { + b_opt = TRUE; + n_opt = TRUE; + s_opt = TRUE; + } +#else + a_opt = TRUE; +#endif + + if (a_opt) { + 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); + } + } +#if USE_CODE_LISTS + else { + for (repeat = 0; repeat < r_opt; ++repeat) { + if (optind < argc) { + for (n = optind; n < argc; ++n) { + demo_terminfo(argv[n]); + } + } else if ((name = getenv("TERM")) != 0) { + demo_terminfo(name); + } else { + static char dumb[] = "dumb"; + demo_terminfo(dumb); + } + } + } +#endif + + ExitProgram(EXIT_SUCCESS); +} + +#else +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + printf("This program requires termcap\n"); + exit(EXIT_FAILURE); +} +#endif diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c new file mode 100644 index 00000000000..2ee5b4c4085 --- /dev/null +++ b/test/demo_terminfo.c @@ -0,0 +1,317 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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_terminfo.c,v 1.9 2010/11/28 00:15:27 tom Exp $ + * + * A simple demo of the terminfo interface. + */ +#define USE_TINFO +#include + +#ifdef NCURSES_VERSION +#if !(defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H) +#undef NCURSES_XNAMES +#define NCURSES_XNAMES 0 +#endif +#if NCURSES_XNAMES +#include +#endif +#endif + +#if HAVE_TIGETSTR +#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) + +static bool b_opt = FALSE; +static bool f_opt = FALSE; +static bool n_opt = FALSE; +static bool s_opt = FALSE; +static bool x_opt = FALSE; + +#define FCOLS 8 +#define FNAME(type) "%s %-*s = ", #type, FCOLS + +static void +dumpit(NCURSES_CONST char *cap) +{ + /* + * One of the limitations of the termcap interface is that the library + * cannot determine the size of the buffer passed via tgetstr(), nor the + * amount of space remaining. This demo simply reuses the whole buffer + * for each call; a normal termcap application would try to use the buffer + * to hold all of the strings extracted from the terminal entry. + */ + const char *str; + int num; + + if ((str = tigetstr(cap)) != 0 && (str != (char *) -1)) { + /* + * 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"); + } else if ((num = tigetnum(cap)) >= 0) { + printf(FNAME(num), cap); + printf(" %d\n", num); + } else if ((num = tigetflag(cap)) >= 0) { + printf(FNAME(flg), cap); + printf("%s\n", num ? "true" : "false"); + } + fflush(stdout); +} + +static void +demo_terminfo(char *name) +{ + unsigned n; + NCURSES_CONST char *cap; + + printf("Terminal type \"%s\"\n", name); + setupterm(name, 1, (int *) 0); + + if (b_opt) { + for (n = 0;; ++n) { + cap = f_opt ? boolfnames[n] : boolnames[n]; + if (cap == 0) + break; + dumpit(cap); + } + } + + if (n_opt) { + for (n = 0;; ++n) { + cap = f_opt ? numfnames[n] : numnames[n]; + if (cap == 0) + break; + dumpit(cap); + } + } + + if (s_opt) { + for (n = 0;; ++n) { + cap = f_opt ? strfnames[n] : strnames[n]; + if (cap == 0) + break; + dumpit(cap); + } + } +#ifdef NCURSES_VERSION + if (x_opt) { + int mod; + if (f_opt) { +#if NCURSES_XNAMES + TERMTYPE *term = &(cur_term->type); + 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)); + } + for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) { + dumpit(ExtNumname(term, (int) n, numnames)); + } + for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) { + dumpit(ExtStrname(term, (int) n, strnames)); + } + } +#endif + } else { + char temp[10]; + static const char *xterm_keys[] = + { + "kDC", "kDN", "kEND", "kHOM", "kIC", + "kLFT", "kNXT", "kPRV", "kRIT", "kUP", + }; + for (n = 0; n < SIZEOF(xterm_keys); ++n) { + for (mod = 0; mod < 8; ++mod) { + if (mod == 0) + strcpy(temp, xterm_keys[n]); + else + sprintf(temp, "%s%d", xterm_keys[n], mod); + dumpit(temp); + } + } + } + } +#endif + +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: demo_terminfo [options] [terminal]", + "", + "If no options are given, print all (boolean, numeric, string)", + "capabilities for the given terminal, using short names.", + "", + "Options:", + " -b print boolean-capabilities", + " -f print full names", + " -n print numeric-capabilities", + " -r COUNT repeat for given count", + " -s print string-capabilities", +#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; + int repeat; + char *name; + int r_opt = 1; + + while ((n = getopt(argc, argv, "bfnr:sx")) != -1) { + switch (n) { + case 'b': + b_opt = TRUE; + break; + case 'f': + f_opt = TRUE; + break; + case 'n': + n_opt = TRUE; + break; + case 'r': + if ((r_opt = atoi(optarg)) <= 0) + usage(); + break; + case 's': + s_opt = TRUE; + break; +#ifdef NCURSES_VERSION + case 'x': + x_opt = TRUE; + use_extended_names(TRUE); + break; +#endif + default: + usage(); + break; + } + } + + if (!(b_opt || n_opt || s_opt || x_opt)) { + b_opt = TRUE; + n_opt = TRUE; + s_opt = TRUE; + } + + for (repeat = 0; repeat < r_opt; ++repeat) { + if (optind < argc) { + for (n = optind; n < argc; ++n) { + demo_terminfo(argv[n]); + } + } else if ((name = getenv("TERM")) != 0) { + demo_terminfo(name); + } else { + static char dumb[] = "dumb"; + demo_terminfo(dumb); + } + } + + 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/ditto.c b/test/ditto.c new file mode 100644 index 00000000000..636a6eeceb6 --- /dev/null +++ b/test/ditto.c @@ -0,0 +1,441 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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 (1998-on) + * + * $Id: ditto.c,v 1.40 2010/11/14 01:06:47 tom Exp $ + * + * The program illustrates how to set up multiple screens from a single + * program. + * + * If openpty() is supported, the command line parameters are titles for + * the windows showing each screen's data. + * + * If openpty() is not supported, you must invoke the program by specifying + * another terminal on the same machine by specifying its device, e.g., + * ditto /dev/ttyp1 + */ +#include +#include + +#ifdef USE_PTHREADS +#include +#endif + +#ifdef USE_XTERM_PTY +#include USE_OPENPTY_HEADER +#endif + +#define MAX_FIFO 256 + +#define THIS_FIFO(n) ((n) % MAX_FIFO) +#define NEXT_FIFO(n) THIS_FIFO((n) + 1) + +typedef struct { + unsigned long sequence; + int head; + int tail; + int data[MAX_FIFO]; +} FIFO; + +typedef struct { + unsigned long sequence; +} PEEK; + +/* + * Data "owned" for a single screen. Each screen is divided into windows that + * show the text read from each terminal. Input from a given screen will also + * be read into one window per screen. + */ +typedef struct { + FILE *input; + FILE *output; + SCREEN *screen; /* this screen - curses internal data */ + int which1; /* this screen's index in DITTO[] array */ + int length; /* length of windows[] and peeks[] */ + char **titles; /* per-window titles */ + WINDOW **windows; /* display data from each screen */ + PEEK *peeks; /* indices for each screen's fifo */ + FIFO fifo; /* fifo for this screen */ +#ifdef USE_PTHREADS + pthread_t thread; +#endif +} DITTO; + +/* + * Structure used to pass multiple parameters via the use_screen() + * single-parameter interface. + */ +typedef struct { + int source; /* which screen did character come from */ + int target; /* which screen is character going to */ + DITTO *ditto; /* data for all screens */ +} DDATA; + +static void +failed(const char *s) +{ + perror(s); + ExitProgram(EXIT_FAILURE); +} + +static void +usage(void) +{ + fprintf(stderr, "usage: ditto [terminal1 ...]\n"); + ExitProgram(EXIT_FAILURE); +} + +/* Add to the head of the fifo, checking for overflow. */ +static void +put_fifo(FIFO * fifo, int value) +{ + int next = NEXT_FIFO(fifo->head); + if (next == fifo->tail) + fifo->tail = NEXT_FIFO(fifo->tail); + fifo->data[next] = value; + fifo->head = next; + fifo->sequence += 1; +} + +/* Get data from the tail (oldest part) of the fifo, returning -1 if no data. + * Since each screen can peek into the fifo, we do not update the tail index, + * but modify the peek-index. + * + * FIXME - test/workaround for case where fifo gets more than a buffer + * ahead of peek. + */ +static int +peek_fifo(FIFO * fifo, PEEK * peek) +{ + int result = -1; + if (peek->sequence < fifo->sequence) { + result = fifo->data[THIS_FIFO(peek->sequence)]; + peek->sequence += 1; + } + return result; +} + +static FILE * +open_tty(char *path) +{ + FILE *fp; +#ifdef USE_XTERM_PTY + int amaster; + int aslave; + char slave_name[1024]; + char s_option[sizeof(slave_name) + 80]; + + if (openpty(&amaster, &aslave, slave_name, 0, 0) != 0 + || strlen(slave_name) > sizeof(slave_name) - 1) + failed("openpty"); + if (strrchr(slave_name, '/') == 0) { + errno = EISDIR; + failed(slave_name); + } + sprintf(s_option, "-S%s/%d", slave_name, aslave); + if (fork()) { + execlp("xterm", "xterm", s_option, "-title", path, (char *) 0); + _exit(0); + } + fp = fdopen(amaster, "r+"); + if (fp == 0) + failed(path); +#else + struct stat sb; + + if (stat(path, &sb) < 0) + failed(path); + if ((sb.st_mode & S_IFMT) != S_IFCHR) { + errno = ENOTTY; + failed(path); + } + fp = fopen(path, "r+"); + if (fp == 0) + failed(path); + printf("opened %s\n", path); +#endif + assert(fp != 0); + return fp; +} + +static void +init_screen( +#if HAVE_USE_WINDOW + SCREEN *sp GCC_UNUSED, +#endif + void *arg) +{ + DITTO *target = (DITTO *) arg; + int high, wide; + int k; + + cbreak(); + noecho(); + scrollok(stdscr, TRUE); + box(stdscr, 0, 0); + + target->windows = typeCalloc(WINDOW *, (size_t) target->length); + target->peeks = typeCalloc(PEEK, (size_t) target->length); + + high = (LINES - 2) / target->length; + wide = (COLS - 2); + for (k = 0; k < target->length; ++k) { + WINDOW *outer = newwin(high, wide, 1 + (high * k), 1); + WINDOW *inner = derwin(outer, high - 2, wide - 2, 1, 1); + + box(outer, 0, 0); + MvWAddStr(outer, 0, 2, target->titles[k]); + wnoutrefresh(outer); + + scrollok(inner, TRUE); + keypad(inner, TRUE); +#ifndef USE_PTHREADS + nodelay(inner, TRUE); +#endif + + target->windows[k] = inner; + } + doupdate(); +} + +static void +open_screen(DITTO * target, char **source, int length, int which1) +{ + if (which1 != 0) { + target->input = + target->output = open_tty(source[which1]); + } else { + target->input = stdin; + target->output = stdout; + } + + target->which1 = which1; + target->titles = source; + target->length = length; + target->fifo.head = -1; + target->screen = newterm((char *) 0, /* assume $TERM is the same */ + target->output, + target->input); + + if (target->screen == 0) + failed("newterm"); + + (void) USING_SCREEN(target->screen, init_screen, target); +} + +static int +close_screen( +#if HAVE_USE_WINDOW + SCREEN *sp GCC_UNUSED, +#endif + void *arg GCC_UNUSED) +{ +#if HAVE_USE_WINDOW + (void) sp; +#endif + (void) arg; + return endwin(); +} + +/* + * Read data from the 'source' screen. + */ +static int +read_screen( +#if HAVE_USE_WINDOW + SCREEN *sp GCC_UNUSED, +#endif + void *arg) +{ + DDATA *data = (DDATA *) arg; + DITTO *ditto = &(data->ditto[data->source]); + WINDOW *win = ditto->windows[data->source]; + int ch = wgetch(win); + + if (ch > 0 && ch < 256) + put_fifo(&(ditto->fifo), ch); + else + ch = ERR; + + return ch; +} + +/* + * Write all of the data that's in fifos for the 'target' screen. + */ +static int +write_screen( +#if HAVE_USE_WINDOW + SCREEN *sp GCC_UNUSED, +#endif + void *arg GCC_UNUSED) +{ + DDATA *data = (DDATA *) arg; + DITTO *ditto = &(data->ditto[data->target]); + bool changed = FALSE; + int which; + + for (which = 0; which < ditto->length; ++which) { + WINDOW *win = ditto->windows[which]; + FIFO *fifo = &(data->ditto[which].fifo); + PEEK *peek = &(ditto->peeks[which]); + int ch; + + while ((ch = peek_fifo(fifo, peek)) > 0) { + changed = TRUE; + + waddch(win, (chtype) ch); + wnoutrefresh(win); + } + } + + if (changed) + doupdate(); + return OK; +} + +static void +show_ditto(DITTO * data, int count, DDATA * ddata) +{ + int n; + + (void) data; + for (n = 0; n < count; n++) { + ddata->target = n; + USING_SCREEN(data[n].screen, write_screen, (void *) ddata); + } +} + +#ifdef USE_PTHREADS +static void * +handle_screen(void *arg) +{ + DDATA ddata; + int ch; + + memset(&ddata, 0, sizeof(ddata)); + ddata.ditto = (DITTO *) arg; + ddata.source = ddata.ditto->which1; + ddata.ditto -= ddata.source; /* -> base of array */ + + for (;;) { + ch = read_screen(ddata.ditto->screen, &ddata); + if (ch == CTRL('D')) { + int later = (ddata.source ? ddata.source : -1); + int j; + + for (j = ddata.ditto->length - 1; j > 0; --j) { + if (j != later) { + pthread_cancel(ddata.ditto[j].thread); + } + } + if (later > 0) { + pthread_cancel(ddata.ditto[later].thread); + } + break; + } + show_ditto(ddata.ditto, ddata.ditto->length, &ddata); + } + return NULL; +} +#endif + +int +main(int argc, char *argv[]) +{ + int j; + DITTO *data; +#ifndef USE_PTHREADS + int count; +#endif + + if (argc <= 1) + usage(); + + if ((data = typeCalloc(DITTO, (size_t) argc)) == 0) + failed("calloc data"); + + assert(data != 0); + + for (j = 0; j < argc; j++) { + open_screen(&data[j], argv, argc, j); + } + +#ifdef USE_PTHREADS + /* + * For multi-threaded operation, set up a reader for each of the screens. + * That uses blocking I/O rather than polling for input, so no calls to + * napms() are needed. + */ + for (j = 0; j < argc; j++) { + (void) pthread_create(&(data[j].thread), NULL, handle_screen, &data[j]); + } + pthread_join(data[1].thread, NULL); +#else + /* + * Loop, reading characters from any of the inputs and writing to all + * of the screens. + */ + for (count = 0;; ++count) { + DDATA ddata; + int ch; + int which = (count % argc); + + napms(20); + + ddata.source = which; + ddata.ditto = data; + + ch = USING_SCREEN(data[which].screen, read_screen, &ddata); + if (ch == CTRL('D')) { + break; + } else if (ch != ERR) { + show_ditto(data, argc, &ddata); + } + } +#endif + + /* + * Cleanup and exit + */ + for (j = argc - 1; j >= 0; j--) { + USING_SCREEN(data[j].screen, close_screen, 0); + fprintf(data[j].output, "**Closed\r\n"); + + /* + * Closing before a delscreen() helps ncurses determine that there + * is no valid output buffer, and can remove the setbuf() data. + */ + fflush(data[j].output); + fclose(data[j].output); + delscreen(data[j].screen); + } + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/dots.c b/test/dots.c new file mode 100644 index 00000000000..2533c7e3b49 --- /dev/null +++ b/test/dots.c @@ -0,0 +1,164 @@ +/**************************************************************************** + * Copyright (c) 1999-2009,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"), 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 1999 + * + * $Id: dots.c,v 1.22 2010/11/14 01:00:02 tom Exp $ + * + * A simple demo of the terminfo interface. + */ +#define USE_TINFO +#include + +#if HAVE_SETUPTERM + +#include + +#define valid(s) ((s != 0) && s != (char *)-1) + +static bool interrupted = FALSE; +static long total_chars = 0; +static time_t started; + +static int +outc(TPUTS_ARG c) +{ + int rc = c; + + if (interrupted) { + char tmp = (char) c; + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = EOF; + } else { + rc = putc(c, stdout); + } + return rc; +} + +static bool +outs(char *s) +{ + if (valid(s)) { + tputs(s, 1, outc); + return TRUE; + } + return FALSE; +} + +static void +cleanup(void) +{ + outs(exit_attribute_mode); + if (!outs(orig_colors)) + outs(orig_pair); + outs(clear_screen); + outs(cursor_normal); + + printf("\n\n%ld total chars, 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.); +} + +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + int x, y, z, p; + double r; + double c; + + CATCHALL(onsig); + + srand((unsigned) time(0)); + setupterm((char *) 0, 1, (int *) 0); + outs(clear_screen); + outs(cursor_invisible); + if (max_colors > 1) { + if (!valid(set_a_foreground) + || !valid(set_a_background) + || (!valid(orig_colors) && !valid(orig_pair))) + max_colors = -1; + } + + r = (double) (lines - 4); + c = (double) (columns - 4); + started = time((time_t *) 0); + + while (!interrupted) { + x = (int) (c * ranf()) + 2; + y = (int) (r * ranf()) + 2; + p = (ranf() > 0.9) ? '*' : ' '; + + tputs(tparm3(cursor_address, y, x), 1, outc); + if (max_colors > 0) { + z = (int) (ranf() * max_colors); + if (ranf() > 0.01) { + tputs(tparm2(set_a_foreground, z), 1, outc); + } else { + tputs(tparm2(set_a_background, z), 1, outc); + napms(1); + } + } else if (valid(exit_attribute_mode) + && valid(enter_reverse_mode)) { + if (ranf() <= 0.01) { + outs((ranf() > 0.6) + ? enter_reverse_mode + : exit_attribute_mode); + napms(1); + } + } + outc(p); + fflush(stdout); + ++total_chars; + } + cleanup(); + 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/dots_mvcur.c b/test/dots_mvcur.c new file mode 100644 index 00000000000..558683d56fd --- /dev/null +++ b/test/dots_mvcur.c @@ -0,0 +1,174 @@ +/**************************************************************************** + * Copyright (c) 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 * + * "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 - 2007 + * + * $Id: dots_mvcur.c,v 1.6 2010/11/14 01:00:44 tom Exp $ + * + * A simple demo of the terminfo interface, and mvcur. + */ +#define USE_TINFO +#include + +#if HAVE_SETUPTERM + +#include + +#define valid(s) ((s != 0) && s != (char *)-1) + +static bool interrupted = FALSE; +static long total_chars = 0; +static time_t started; + +static int +outc(TPUTS_ARG c) +{ + int rc = c; + + if (interrupted) { + char tmp = (char) c; + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = EOF; + } else { + if (putc(c, stdout) == EOF) + rc = EOF; + } + return rc; +} + +static bool +outs(char *s) +{ + if (valid(s)) { + tputs(s, 1, outc); + return TRUE; + } + return FALSE; +} + +static void +cleanup(void) +{ + outs(exit_attribute_mode); + if (!outs(orig_colors)) + outs(orig_pair); + outs(clear_screen); + outs(cursor_normal); + + printf("\n\n%ld total chars, 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.); +} + +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + int x0 = 1, y0 = 1; + int x, y, z, p; + double r; + double c; + SCREEN *sp; + + CATCHALL(onsig); + + srand((unsigned) time(0)); + sp = newterm((char *) 0, stdout, stdin); + outs(clear_screen); + outs(cursor_home); + outs(cursor_invisible); + if (max_colors > 1) { + if (!valid(set_a_foreground) + || !valid(set_a_background) + || (!valid(orig_colors) && !valid(orig_pair))) + max_colors = -1; + } + + r = (double) (lines - 4); + c = (double) (columns - 4); + started = time((time_t *) 0); + + while (!interrupted) { + x = (int) (c * ranf()) + 2; + y = (int) (r * ranf()) + 2; + p = (ranf() > 0.9) ? '*' : ' '; + + if (mvcur(y0, x0, y, x) != ERR) { + x0 = x; + y0 = y; + } + + if (max_colors > 0) { + z = (int) (ranf() * max_colors); + if (ranf() > 0.01) { + tputs(tparm2(set_a_foreground, z), 1, outc); + } else { + tputs(tparm2(set_a_background, z), 1, outc); + napms(1); + } + } else if (valid(exit_attribute_mode) + && valid(enter_reverse_mode)) { + if (ranf() <= 0.01) { + outs((ranf() > 0.6) + ? enter_reverse_mode + : exit_attribute_mode); + napms(1); + } + } + outc(p); + fflush(stdout); + ++total_chars; + } + cleanup(); + endwin(); + delscreen(sp); + 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/echochar.c b/test/echochar.c new file mode 100644 index 00000000000..829d1f2b429 --- /dev/null +++ b/test/echochar.c @@ -0,0 +1,159 @@ +/**************************************************************************** + * Copyright (c) 2006-2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: echochar.c,v 1.8 2010/11/14 01:00:44 tom Exp $ + * + * Demonstrate the echochar function (compare to dots.c). + * Thomas Dickey - 2006/11/4 + */ + +#include + +#include + +#define valid(s) ((s != 0) && s != (char *)-1) + +static bool interrupted = FALSE; +static long total_chars = 0; +static time_t started; + +static void +cleanup(void) +{ + endwin(); + + printf("\n\n%ld total chars, 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 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); + } + attron(COLOR_PAIR(pair)); +} + +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + int ch, x, y, z, p; + double r; + double c; + bool use_colors; + bool opt_r = FALSE; + char *my_pairs = 0; + int last_fg = 0; + int last_bg = 0; + + while ((ch = getopt(argc, argv, "r")) != -1) { + switch (ch) { + case 'r': + opt_r = TRUE; + break; + default: + fprintf(stderr, "usage: echochar [-r]\n"); + ExitProgram(EXIT_FAILURE); + } + } + + CATCHALL(onsig); + initscr(); + + use_colors = has_colors(); + if (use_colors) { + start_color(); + if (COLOR_PAIRS > 0) { + my_pairs = typeCalloc(char, (size_t) COLOR_PAIRS); + } + use_colors = (my_pairs != 0); + } + + srand((unsigned) time(0)); + + curs_set(0); + + r = (double) (LINES - 4); + c = (double) (COLS - 4); + started = time((time_t *) 0); + + while (!interrupted) { + x = (int) (c * ranf()) + 2; + y = (int) (r * ranf()) + 2; + p = (ranf() > 0.9) ? '*' : ' '; + + move(y, x); + if (use_colors > 0) { + z = (int) (ranf() * COLORS); + if (ranf() > 0.01) { + set_color(my_pairs, z, last_bg); + last_fg = z; + } else { + set_color(my_pairs, last_fg, z); + last_bg = z; + napms(1); + } + } else { + if (ranf() <= 0.01) { + if (ranf() > 0.6) + attron(A_REVERSE); + else + attroff(A_REVERSE); + napms(1); + } + } + if (opt_r) { + addch(UChar(p)); + refresh(); + } else { + echochar(UChar(p)); + } + ++total_chars; + } + cleanup(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/edit_field.c b/test/edit_field.c new file mode 100644 index 00000000000..8a664e8ca9a --- /dev/null +++ b/test/edit_field.c @@ -0,0 +1,465 @@ +/**************************************************************************** + * Copyright (c) 2003-2008,2011 Free 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: edit_field.c,v 1.17 2011/01/15 18:15:11 tom Exp $ + * + * A wrapper for form_driver() which keeps track of the user's editing changes + * for each field, and makes the result available as a null-terminated string + * in field_buffer(field,1). + * + * Thomas Dickey - 2003/4/26. + */ + +#include + +#if USE_LIBFORM + +#include + +static struct { + int code; + int result; + const char *help; +} commands[] = { + + { + CTRL('A'), REQ_NEXT_CHOICE, "" + }, + { + CTRL('B'), REQ_PREV_WORD, "go to previous word" + }, + { + CTRL('C'), REQ_CLR_EOL, "clear to end of line" + }, + { + CTRL('D'), REQ_DOWN_FIELD, "move downward to field" + }, + { + CTRL('E'), REQ_END_FIELD, "go to end of field" + }, + { + CTRL('F'), REQ_NEXT_PAGE, "go to next page" + }, + { + CTRL('G'), REQ_DEL_WORD, "delete current word" + }, + { + CTRL('H'), REQ_DEL_PREV, "delete previous character" + }, + { + CTRL('I'), REQ_INS_CHAR, "insert character" + }, + { + CTRL('K'), REQ_CLR_EOF, "clear to end of field" + }, + { + CTRL('L'), REQ_LEFT_FIELD, "go to field to left" + }, + { + CTRL('M'), REQ_NEW_LINE, "insert/overlay new line" + }, + { + CTRL('N'), REQ_NEXT_FIELD, "go to next field" + }, + { + CTRL('O'), REQ_INS_LINE, "insert blank line at cursor" + }, + { + CTRL('P'), REQ_PREV_FIELD, "go to previous field" + }, + { + CTRL('Q'), MY_QUIT, "exit form" + }, + { + CTRL('R'), REQ_RIGHT_FIELD, "go to field to right" + }, + { + CTRL('S'), REQ_BEG_FIELD, "go to beginning of field" + }, + { + CTRL('T'), MY_EDT_MODE, "toggle O_EDIT mode, clear field status", + }, + { + CTRL('U'), REQ_UP_FIELD, "move upward to field" + }, + { + CTRL('V'), REQ_DEL_CHAR, "delete character" + }, + { + CTRL('W'), REQ_NEXT_WORD, "go to next word" + }, + { + CTRL('X'), REQ_CLR_FIELD, "clear field" + }, + { + CTRL('Y'), REQ_DEL_LINE, "delete line" + }, + { + CTRL('Z'), REQ_PREV_CHOICE, "" + }, + { + CTRL('['), MY_QUIT, "exit form" + }, + { + CTRL(']'), MY_INS_MODE, "toggle REQ_INS_MODE/REQ_OVL_MODE", + }, + { + KEY_F(1), MY_HELP, "show this screen", + }, + { + KEY_BACKSPACE, REQ_DEL_PREV, "delete previous character" + }, + { + KEY_DOWN, REQ_DOWN_CHAR, "move down 1 character" + }, + { + KEY_END, REQ_LAST_FIELD, "go to last field" + }, + { + KEY_HOME, REQ_FIRST_FIELD, "go to first field" + }, + { + KEY_LEFT, REQ_LEFT_CHAR, "move left 1 character" + }, + { + KEY_LL, REQ_LAST_FIELD, "go to last field" + }, + { + KEY_NEXT, REQ_NEXT_FIELD, "go to next field" + }, + { + KEY_NPAGE, REQ_NEXT_PAGE, "go to next page" + }, + { + KEY_PPAGE, REQ_PREV_PAGE, "go to previous page" + }, + { + KEY_PREVIOUS, REQ_PREV_FIELD, "go to previous field" + }, + { + KEY_RIGHT, REQ_RIGHT_CHAR, "move right 1 character" + }, + { + KEY_UP, REQ_UP_CHAR, "move up 1 character" + } +}; + +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); + unsigned n; + int ch = ERR; + + begin_popup(); + + keypad(help, TRUE); + keypad(data, TRUE); + waddstr(data, "Defined form edit/traversal keys:\n"); + for (n = 0; n < SIZEOF(commands); ++n) { + const char *name; +#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); + } + 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(); +} + +static int +offset_in_field(FORM * form) +{ + FIELD *field = current_field(form); + int currow, curcol; + + form_getyx(form, currow, curcol); + return curcol + currow * field->dcols; +} + +static void +inactive_field(FIELD * f) +{ + FieldAttrs *ptr = (FieldAttrs *) field_userptr(f); + set_field_back(f, ptr->background); +} + +int +edit_field(FORM * form, int *result) +{ + int ch = wgetch(form_win(form)); + int status; + FIELD *before; + unsigned n; + char lengths[80]; + int length; + char *buffer; + int before_row; + int before_col; + int before_off = offset_in_field(form); + + form_getyx(form, before_row, before_col); + before = current_field(form); + set_field_back(before, A_NORMAL); + if (ch <= KEY_MAX) { + set_field_back(before, A_REVERSE); + } else if (ch <= MAX_FORM_COMMAND) { + inactive_field(before); + } + + *result = ch; + for (n = 0; n < SIZEOF(commands); ++n) { + if (commands[n].code == ch) { + *result = commands[n].result; + break; + } + } + + status = form_driver(form, *result); + + if (status == E_OK) { + bool modified = TRUE; + + length = 0; + if ((buffer = field_buffer(before, 1)) != 0) + length = atoi(buffer); + if (length < before_off) + length = before_off; + switch (*result) { + case REQ_CLR_EOF: + length = before_off; + break; + case REQ_CLR_EOL: + if (before_row + 1 == before->rows) + length = before_off; + break; + case REQ_CLR_FIELD: + length = 0; + break; + case REQ_DEL_CHAR: + if (length > before_off) + --length; + break; + case REQ_DEL_PREV: + if (length > 0) { + if (before_col > 0) { + --length; + } else if (before_row > 0) { + length -= before->cols + before_col; + } + } + break; + case REQ_NEW_LINE: + length += before->cols; + break; +#if 0 + /* FIXME: finish these */ + case REQ_DEL_LINE: /* delete line */ + case REQ_DEL_WORD: /* delete word at cursor */ + case REQ_INS_CHAR: /* insert blank char at cursor */ + case REQ_INS_LINE: /* insert blank line at cursor */ + case REQ_INS_MODE: /* begin insert mode */ + case REQ_OVL_MODE: /* begin overlay mode */ +#endif + /* ignore all of the motion commands */ + case REQ_SCR_BCHAR: /* FALLTHRU */ + case REQ_SCR_BHPAGE: /* FALLTHRU */ + case REQ_SCR_BLINE: /* FALLTHRU */ + case REQ_SCR_BPAGE: /* FALLTHRU */ + case REQ_SCR_FCHAR: /* FALLTHRU */ + case REQ_SCR_FHPAGE: /* FALLTHRU */ + case REQ_SCR_FLINE: /* FALLTHRU */ + case REQ_SCR_FPAGE: /* FALLTHRU */ + case REQ_SCR_HBHALF: /* FALLTHRU */ + case REQ_SCR_HBLINE: /* FALLTHRU */ + case REQ_SCR_HFHALF: /* FALLTHRU */ + case REQ_SCR_HFLINE: /* FALLTHRU */ + case REQ_BEG_FIELD: /* FALLTHRU */ + case REQ_BEG_LINE: /* FALLTHRU */ + case REQ_DOWN_CHAR: /* FALLTHRU */ + case REQ_DOWN_FIELD: /* FALLTHRU */ + case REQ_END_FIELD: /* FALLTHRU */ + case REQ_END_LINE: /* FALLTHRU */ + case REQ_FIRST_FIELD: /* FALLTHRU */ + case REQ_FIRST_PAGE: /* FALLTHRU */ + case REQ_LAST_FIELD: /* FALLTHRU */ + case REQ_LAST_PAGE: /* FALLTHRU */ + case REQ_LEFT_CHAR: /* FALLTHRU */ + case REQ_LEFT_FIELD: /* FALLTHRU */ + case REQ_NEXT_CHAR: /* FALLTHRU */ + case REQ_NEXT_CHOICE: /* FALLTHRU */ + case REQ_NEXT_FIELD: /* FALLTHRU */ + case REQ_NEXT_LINE: /* FALLTHRU */ + case REQ_NEXT_PAGE: /* FALLTHRU */ + case REQ_NEXT_WORD: /* FALLTHRU */ + case REQ_PREV_CHAR: /* FALLTHRU */ + case REQ_PREV_CHOICE: /* FALLTHRU */ + case REQ_PREV_FIELD: /* FALLTHRU */ + case REQ_PREV_LINE: /* FALLTHRU */ + case REQ_PREV_PAGE: /* FALLTHRU */ + case REQ_PREV_WORD: /* FALLTHRU */ + case REQ_RIGHT_CHAR: /* FALLTHRU */ + case REQ_RIGHT_FIELD: /* FALLTHRU */ + case REQ_SFIRST_FIELD: /* FALLTHRU */ + case REQ_SLAST_FIELD: /* FALLTHRU */ + case REQ_SNEXT_FIELD: /* FALLTHRU */ + case REQ_SPREV_FIELD: /* FALLTHRU */ + case REQ_UP_CHAR: /* FALLTHRU */ + case REQ_UP_FIELD: /* FALLTHRU */ + case REQ_VALIDATION: /* FALLTHRU */ + modified = FALSE; + break; + + default: + modified = FALSE; + if (ch >= MIN_FORM_COMMAND) { + beep(); + } else if (isprint(ch)) { + modified = TRUE; + } + break; + } + + /* + * If we do not force a re-validation, then field_buffer 0 will + * be lagging by one character. + */ + if (modified && form_driver(form, REQ_VALIDATION) == E_OK && *result + < MIN_FORM_COMMAND) + ++length; + + sprintf(lengths, "%d", length); + set_field_buffer(before, 1, lengths); + } + + if (current_field(form) != before) + inactive_field(before); + return status; +} +#else + +extern void no_edit_field(void); + +void +no_edit_field(void) +{ +} + +#endif diff --git a/test/edit_field.h b/test/edit_field.h new file mode 100644 index 00000000000..eacade37fb8 --- /dev/null +++ b/test/edit_field.h @@ -0,0 +1,53 @@ +/**************************************************************************** + * Copyright (c) 2003-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 * + * "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: edit_field.h,v 1.6 2008/12/20 19:23:18 tom Exp $ + * + * Interface of edit_field.c + */ + +#ifndef EDIT_FORM_H_incl +#define EDIT_FORM_H_incl 1 + +#include + +#define EDIT_FIELD(c) (MAX_FORM_COMMAND + c) + +#define MY_HELP EDIT_FIELD('h') +#define MY_QUIT EDIT_FIELD('q') +#define MY_EDT_MODE EDIT_FIELD('e') +#define MY_INS_MODE EDIT_FIELD('t') + +typedef struct { + chtype background; +} FieldAttrs; + +extern void help_edit_field(void); +extern int edit_field(FORM * form, int *result); + +#endif /* EDIT_FORM_H_incl */ diff --git a/test/filter.c b/test/filter.c new file mode 100644 index 00000000000..489136e8f63 --- /dev/null +++ b/test/filter.c @@ -0,0 +1,164 @@ +/**************************************************************************** + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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 1998 + * + * $Id: filter.c,v 1.13 2010/11/13 20:55:54 tom Exp $ + */ +#include + +#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. + * + * Ncurses differs slightly from SVr4 curses. The latter does not flush its + * state when exiting program mode, so the attributes on the command lines of + * this program 'bleed' onto the executed commands. Rather than use the + * reset_shell_mode() and reset_prog_mode() functions, we could invoke endwin() + * and refresh(), but that does not work any better. + */ + +static int +new_command(char *buffer, int length, attr_t underline) +{ + int code; + + attron(A_BOLD); + printw("Command: "); + 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. + */ +#ifdef KEY_EVENT + if (code == KEY_EVENT) + strcpy(buffer, "# event!"); +#endif +#ifdef KEY_RESIZE + if (code == KEY_RESIZE) { + strcpy(buffer, "# resize!"); + getch(); + } +#endif + attroff(underline); + attroff(A_BOLD); + printw("\n"); + + return code; +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: filter [options]" + ,"" + ,"Options:" + ," -i use initscr() rather than newterm()" + }; + 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 ch; + char buffer[80]; + attr_t underline; + bool i_option = FALSE; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "i")) != -1) { + switch (ch) { + case 'i': + i_option = TRUE; + break; + default: + usage(); + } + } + + printf("starting filter program using %s...\n", + i_option ? "initscr" : "newterm"); + filter(); + if (i_option) { + initscr(); + } else { + (void) newterm((char *) 0, stdout, stdin); + } + cbreak(); + keypad(stdscr, TRUE); + + if (has_colors()) { + int background = COLOR_BLACK; + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() != ERR) + background = -1; +#endif + init_pair(1, COLOR_CYAN, (short) background); + underline = COLOR_PAIR(1); + } else { + underline = A_UNDERLINE; + } + + while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR + && strlen(buffer) != 0) { + reset_shell_mode(); + printf("\n"); + fflush(stdout); + system(buffer); + reset_prog_mode(); + touchwin(stdscr); + erase(); + refresh(); + } + printw("done"); + refresh(); + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the filter function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif /* HAVE_FILTER */ diff --git a/test/firework.c b/test/firework.c new file mode 100644 index 00000000000..2c409d835a2 --- /dev/null +++ b/test/firework.c @@ -0,0 +1,196 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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: firework.c,v 1.27 2010/11/13 20:58:25 tom Exp $ + */ +#include + +#include + +static short my_bg = COLOR_BLACK; + +static void +cleanup(void) +{ + curs_set(1); + endwin(); +} + +static RETSIGTYPE +onsig(int n GCC_UNUSED) +{ + cleanup(); + ExitProgram(EXIT_FAILURE); +} + +static void +showit(void) +{ + int ch; + napms(120); + if ((ch = getch()) != ERR) { +#ifdef KEY_RESIZE + if (ch == KEY_RESIZE) { + erase(); + } else +#endif + if (ch == 'q') { + cleanup(); + ExitProgram(EXIT_SUCCESS); + } else if (ch == 's') { + nodelay(stdscr, FALSE); + } else if (ch == ' ') { + nodelay(stdscr, TRUE); + } + } +} + +static short +get_colour(chtype *bold) +{ + int attr; + attr = (rand() % 16) + 1; + + *bold = A_NORMAL; + if (attr > 8) { + *bold = A_BOLD; + attr &= 7; + } + return (short) (attr); +} + +static +void +explode(int row, int col) +{ + chtype bold; + erase(); + MvPrintw(row, col, "-"); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + (void) attrset(COLOR_PAIR(1) | bold); + MvPrintw(row - 1, col - 1, " - "); + MvPrintw(row + 0, col - 1, "-+-"); + MvPrintw(row + 1, col - 1, " - "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + (void) attrset(COLOR_PAIR(1) | bold); + MvPrintw(row - 2, col - 2, " --- "); + MvPrintw(row - 1, col - 2, "-+++-"); + MvPrintw(row + 0, col - 2, "-+#+-"); + MvPrintw(row + 1, col - 2, "-+++-"); + MvPrintw(row + 2, col - 2, " --- "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + (void) attrset(COLOR_PAIR(1) | bold); + MvPrintw(row - 2, col - 2, " +++ "); + MvPrintw(row - 1, col - 2, "++#++"); + MvPrintw(row + 0, col - 2, "+# #+"); + MvPrintw(row + 1, col - 2, "++#++"); + MvPrintw(row + 2, col - 2, " +++ "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + (void) attrset(COLOR_PAIR(1) | bold); + MvPrintw(row - 2, col - 2, " # "); + MvPrintw(row - 1, col - 2, "## ##"); + MvPrintw(row + 0, col - 2, "# #"); + MvPrintw(row + 1, col - 2, "## ##"); + MvPrintw(row + 2, col - 2, " # "); + showit(); + + init_pair(1, get_colour(&bold), my_bg); + (void) attrset(COLOR_PAIR(1) | bold); + MvPrintw(row - 2, col - 2, " # # "); + MvPrintw(row - 1, col - 2, "# #"); + MvPrintw(row + 0, col - 2, " "); + MvPrintw(row + 1, col - 2, "# #"); + MvPrintw(row + 2, col - 2, " # # "); + showit(); +} + +int +main( + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + int start, end, row, diff, flag = 0, direction; + unsigned seed; + + CATCHALL(onsig); + + initscr(); + noecho(); + cbreak(); + keypad(stdscr, TRUE); + nodelay(stdscr, TRUE); + + if (has_colors()) { + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + my_bg = -1; +#endif + } + curs_set(0); + + seed = (unsigned) time((time_t *) 0); + srand(seed); + for (;;) { + do { + start = rand() % (COLS - 3); + end = rand() % (COLS - 3); + start = (start < 2) ? 2 : start; + end = (end < 2) ? 2 : end; + direction = (start > end) ? -1 : 1; + diff = abs(start - end); + } while (diff < 2 || diff >= LINES - 2); + (void) attrset(A_NORMAL); + for (row = 0; row < diff; row++) { + MvPrintw(LINES - row, start + (row * direction), + (direction < 0) ? "\\" : "/"); + if (flag++) { + showit(); + erase(); + flag = 0; + } + } + if (flag++) { + showit(); + flag = 0; + } + seed = (unsigned) time((time_t *) 0); + srand(seed); + explode(LINES - row, start + (diff * direction)); + erase(); + showit(); + } +} diff --git a/test/firstlast.c b/test/firstlast.c new file mode 100644 index 00000000000..f5328c722cf --- /dev/null +++ b/test/firstlast.c @@ -0,0 +1,123 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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. * + ****************************************************************************/ +/* + * 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 $ + */ + +#include + +static void +fill(WINDOW *w, const char *str) +{ + const char *s; + int x0 = -1, y0 = -1; + int x1, y1; + + for (;;) { + for (s = str; *s; s++) { + getyx(w, y1, x1); + if (waddch(w, UChar(*s)) == ERR + || (x1 == x0 && y1 == y0)) { + wmove(w, 0, 0); + return; + } + x0 = x1; + y0 = y1; + } + } +} + +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + WINDOW *large, *small; + initscr(); + noecho(); + + large = newwin(20, 60, 2, 10); + small = newwin(10, 30, 7, 25); + + /* test 1 - addch */ + fill(large, "LargeWindow"); + + refresh(); + wrefresh(large); + wrefresh(small); + + MvWAddStr(small, 5, 5, " Test String "); + wrefresh(small); + getch(); + + touchwin(large); + wrefresh(large); + + MvWAddStr(small, 5, 5, " Test <***************> String "); + wrefresh(small); + + /* DIFFERENCE! */ + getch(); + + /* test 2: erase */ + erase(); + refresh(); + getch(); + + /* test 3: clrtoeol */ + werase(small); + wrefresh(small); + touchwin(large); + wrefresh(large); + wmove(small, 5, 0); + waddstr(small, " clrtoeol>"); + wclrtoeol(small); + wrefresh(small); + + /* DIFFERENCE! */ ; + getch(); + + /* test 4: clrtobot */ + werase(small); + wrefresh(small); + touchwin(large); + wrefresh(large); + wmove(small, 5, 3); + waddstr(small, " clrtobot>"); + wclrtobot(small); + wrefresh(small); + + /* DIFFERENCE! */ + getch(); + + endwin(); + + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/foldkeys.c b/test/foldkeys.c new file mode 100644 index 00000000000..a5e25e30bb8 --- /dev/null +++ b/test/foldkeys.c @@ -0,0 +1,264 @@ +/**************************************************************************** + * Copyright (c) 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"), 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, 2006 + * + * $Id: foldkeys.c,v 1.4 2010/11/14 01:00:53 tom Exp $ + * + * Demonstrate a method for altering key definitions at runtime. + * + * This program reads the key definitions, merging those which have xterm-style + * modifiers into their equivalents which have no modifiers. It does this + * merging only for the keys which are defined in the terminal description. + */ + +#include + +#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#define MY_LOGFILE "demo_foldkeys.log" +#define MY_KEYS (KEY_MAX + 1) + +/* + * Log the most recently-written line to our logfile + */ +static void +log_last_line(WINDOW *win) +{ + FILE *fp; + int y, x, n; + char temp[256]; + + if ((fp = fopen(MY_LOGFILE, "a")) != 0) { + int need = sizeof(temp) - 1; + if (need > COLS) + need = COLS; + getyx(win, y, x); + wmove(win, y - 1, 0); + n = winnstr(win, temp, need); + while (n-- > 0) { + if (isspace(UChar(temp[n]))) + temp[n] = '\0'; + else + break; + } + wmove(win, y, x); + fprintf(fp, "%s\n", temp); + fclose(fp); + } +} + +/* + * ncurses has no API for telling what the actual last key-code is. That is + * a secret because the codes past KEY_MAX are computed at run-time and may + * differ depending on the previous calls to newterm(), etc. It is unlikely + * that one could have more than a thousand key definitions... + */ +#define MAX_KEYS 2000 + +typedef struct { + const char *name; + const char *value; + int code; + int state; +} KeyInfo; + +static void +demo_foldkeys(void) +{ + KeyInfo info[MAX_KEYS]; + int info_len = 0; + int merged = 0; + int code; + int j, k; + + /* + * Tell ncurses that we want to use function keys. That will make it add + * any user-defined keys that appear in the terminfo. + */ + keypad(stdscr, TRUE); + + /* + * List the predefined keys using the strnames[] array. + */ + for (code = 0; code < STRCOUNT; ++code) { + NCURSES_CONST char *name = strnames[code]; + NCURSES_CONST char *value = tigetstr(name); + if (value != 0 && value != (NCURSES_CONST char *) -1) { + info[info_len].name = strnames[code]; + info[info_len].code = key_defined(value); + info[info_len].value = value; + info[info_len].state = 0; + if (info[info_len].code > 0) + ++info_len; + } + } + + /* + * We can get the names for user-defined keys from keyname(). It returns + * a name like KEY_foo for the predefined keys, which tigetstr() does not + * understand. + */ + for (code = KEY_MAX; code < MAX_KEYS; ++code) { + NCURSES_CONST char *name = keyname(code); + if (name != 0) { + info[info_len].name = name; + info[info_len].code = code; + info[info_len].value = tigetstr(name); + info[info_len].state = 0; + ++info_len; + } + } + printw("Initially %d key definitions\n", info_len); + + /* + * Look for keys that have xterm-style modifiers. + */ + for (j = 0; j < info_len; ++j) { + int first, second; + char final[2]; + char *value; + if (info[j].state == 0 + && sscanf(info[j].value, + "\033[%d;%d%c", + &first, + &second, + final) == 3 + && *final != ';' + && (value = strdup(info[j].value)) != 0) { + sprintf(value, "\033[%d%c", first, *final); + for (k = 0; k < info_len; ++k) { + if (info[k].state == 0 + && !strcmp(info[k].value, value)) { + info[j].state = 1; + break; + } + } + if (info[j].state == 0) { + sprintf(value, "\033O%c", *final); + for (k = 0; k < info_len; ++k) { + if (info[k].state == 0 + && !strcmp(info[k].value, value)) { + info[j].state = 1; + break; + } + } + } + if (info[j].state == 1) { + if ((define_key(info[j].value, info[k].code)) != ERR) { + printw("map %s to %s\n", info[j].value, info[k].value); + keyok(info[j].code, FALSE); + ++merged; + } else { + printw("? cannot define_key %d:%s\n", j, info[j].value); + } + } else { + printw("? cannot merge %d:%s\n", j, info[j].value); + } + free(value); + } + } + printw("Merged to %d key definitions\n", info_len - merged); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + int ch; +#if HAVE_GETTIMEOFDAY + int secs, msecs; + struct timeval current, previous; +#endif + + 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 */ + + scrollok(stdscr, TRUE); + keypad(stdscr, TRUE); + move(0, 0); + + demo_foldkeys(); + +#if HAVE_GETTIMEOFDAY + gettimeofday(&previous, 0); +#endif + + while ((ch = getch()) != ERR) { + bool escaped = (ch >= MY_KEYS); + const char *name = keyname(escaped ? (ch - MY_KEYS) : ch); + +#if HAVE_GETTIMEOFDAY + gettimeofday(¤t, 0); + secs = (int) (current.tv_sec - previous.tv_sec); + msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000); + if (msecs < 0) { + msecs += 1000; + --secs; + } + if (msecs >= 1000) { + secs += msecs / 1000; + msecs %= 1000; + } + printw("%6d.%03d ", secs, msecs); + previous = current; +#endif + printw("Keycode %d, name %s%s\n", + ch, + escaped ? "ESC-" : "", + name != 0 ? name : ""); + log_last_line(stdscr); + clrtoeol(); + if (ch == 'q') + break; + } + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/gdc.6 b/test/gdc.6 new file mode 100644 index 00000000000..ed3a4f103ff --- /dev/null +++ b/test/gdc.6 @@ -0,0 +1,64 @@ +.\"*************************************************************************** +.\" Copyright (c) 1998-2003,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"), 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: gdc.6,v 1.3 2006/04/22 23:02:15 tom Exp $ +.TH GDC 6 +.SH NAME +gdc \- grand digital clock (curses) +.SH SYNOPSIS +.B gdc +[-n] [ +[-s] [ +.I n +] +.SH DESCRIPTION +.I Gdc +runs a digital clock made of reverse-video blanks on a terminal screen. +If the terminal supports color, the clock is drawn in red. +You can make the clock stop, pause or resume by pressing a ``q'', +``s'' or space, respectively. +.SH OPTIONS +.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 +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. +.PP +With an optional numeric argument +.I num +it stops after +.I num +seconds. +Normally it runs "forever" (counting down from 2 billion seconds). +.SH AUTHOR +Amos Shapir, modified for curses by John Lupien. +Improvements for ncurses by Thomas Dickey. diff --git a/test/gdc.c b/test/gdc.c new file mode 100644 index 00000000000..f3018cd8d33 --- /dev/null +++ b/test/gdc.c @@ -0,0 +1,351 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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. * + ****************************************************************************/ +/* + * Grand digital clock for curses compatible terminals + * Usage: gdc [-s] [n] -- run for n seconds (default infinity) + * Flags: -s: scroll + * + * modified 10-18-89 for curses (jrl) + * 10-18-89 added signal handling + * + * $Id: gdc.c,v 1.34 2010/11/13 21:01:23 tom Exp $ + */ + +#include + +#include + +#define YBASE 10 +#define XBASE 10 +#define XLENGTH 54 +#define YDEPTH 5 + +#define PAIR_DIGITS 1 +#define PAIR_OTHERS 2 +#define PAIR_FRAMES 3 + +static short disp[11] = +{ + 075557, 011111, 071747, 071717, 055711, + 074717, 074757, 071111, 075757, 075717, 002020 +}; +static long older[6], next[6], newer[6], mask; + +static int sigtermed = 0; +static bool redirected = FALSE; +static bool hascolor = FALSE; + +static RETSIGTYPE +sighndl(int signo) +{ + signal(signo, sighndl); + sigtermed = signo; + if (redirected) { + endwin(); + ExitProgram(EXIT_FAILURE); + } +} + +static void +drawbox(bool scrolling) +{ + chtype bottom[XLENGTH + 1]; + int n; + + if (hascolor) + (void) attrset(COLOR_PAIR(PAIR_FRAMES)); + + MvAddCh(YBASE - 1, XBASE - 1, ACS_ULCORNER); + hline(ACS_HLINE, XLENGTH); + MvAddCh(YBASE - 1, XBASE + XLENGTH, ACS_URCORNER); + + MvAddCh(YBASE + YDEPTH, XBASE - 1, ACS_LLCORNER); + if ((mvinchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH)) != ERR) { + for (n = 0; n < XLENGTH; n++) { + if (!scrolling) + bottom[n] &= ~A_COLOR; + bottom[n] = ACS_HLINE | (bottom[n] & (A_ATTRIBUTES | A_COLOR)); + } + (void) mvaddchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH); + } + MvAddCh(YBASE + YDEPTH, XBASE + XLENGTH, ACS_LRCORNER); + + move(YBASE, XBASE - 1); + vline(ACS_VLINE, YDEPTH); + + move(YBASE, XBASE + XLENGTH); + vline(ACS_VLINE, YDEPTH); + + if (hascolor) + (void) attrset(COLOR_PAIR(PAIR_OTHERS)); +} + +static void +standt(int on) +{ + if (on) { + if (hascolor) { + attron(COLOR_PAIR(PAIR_DIGITS)); + } else { + attron(A_STANDOUT); + } + } else { + if (hascolor) { + attron(COLOR_PAIR(PAIR_OTHERS)); + } else { + attroff(A_STANDOUT); + } + } +} + +static void +set(int t, int n) +{ + int i, m; + + m = 7 << n; + for (i = 0; i < 5; i++) { + next[i] |= ((disp[t] >> ((4 - i) * 3)) & 07) << n; + mask |= (next[i] ^ older[i]) & m; + } + if (mask & m) + mask |= m; +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: gdc [options] [count]" + ,"" + ,"Options:" + ," -n redirect input to /dev/null" + ," -s scroll each number into place, rather than flipping" + ,"" + ,"If you specify a count, gdc runs for that number of seconds" + }; + unsigned j; + for (j = 0; j < SIZEOF(msg); j++) + fprintf(stderr, "%s\n", msg[j]); + ExitProgram(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + time_t now; + struct tm *tm; + long t, a; + int i, j, s, k; + int count = 0; + FILE *ofp = stdout; + FILE *ifp = stdin; + bool scrol = FALSE; + + setlocale(LC_ALL, ""); + + CATCHALL(sighndl); + + while ((k = getopt(argc, argv, "sn")) != -1) { + switch (k) { + case 's': + scrol = TRUE; + break; + case 'n': + ifp = fopen("/dev/null", "r"); + redirected = TRUE; + break; + default: + usage(); + } + } + if (optind < argc) { + count = atoi(argv[optind++]); + assert(count >= 0); + } + 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); + } + + } else { + initscr(); + } + cbreak(); + noecho(); + nodelay(stdscr, 1); + curs_set(0); + + hascolor = has_colors(); + + if (hascolor) { + short bg = COLOR_BLACK; + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + bg = -1; +#endif + init_pair(PAIR_DIGITS, COLOR_BLACK, COLOR_RED); + init_pair(PAIR_OTHERS, COLOR_RED, bg); + init_pair(PAIR_FRAMES, COLOR_WHITE, bg); + (void) attrset(COLOR_PAIR(PAIR_OTHERS)); + } + + restart: + for (j = 0; j < 5; j++) + older[j] = newer[j] = next[j] = 0; + + clear(); + drawbox(FALSE); + + do { + char buf[30]; + + time(&now); + tm = localtime(&now); + + mask = 0; + set(tm->tm_sec % 10, 0); + set(tm->tm_sec / 10, 4); + set(tm->tm_min % 10, 10); + set(tm->tm_min / 10, 14); + set(tm->tm_hour % 10, 20); + set(tm->tm_hour / 10, 24); + set(10, 7); + set(10, 17); + + for (k = 0; k < 6; k++) { + if (scrol) { + for (i = 0; i < 5; i++) + newer[i] = (newer[i] & ~mask) | (newer[i + 1] & mask); + newer[5] = (newer[5] & ~mask) | (next[k] & mask); + } else + newer[k] = (newer[k] & ~mask) | (next[k] & mask); + next[k] = 0; + for (s = 1; s >= 0; s--) { + standt(s); + for (i = 0; i < 6; i++) { + if ((a = (newer[i] ^ older[i]) & (s ? newer : older)[i]) + != 0) { + for (j = 0, t = 1 << 26; t; t >>= 1, j++) { + if (a & t) { + if (!(a & (t << 1))) { + move(YBASE + i, XBASE + 2 * j); + } + addstr(" "); + } + } + } + if (!s) { + older[i] = newer[i]; + } + } + if (!s) { + if (scrol) + drawbox(TRUE); + refresh(); + /* + * If we're scrolling, space out the refreshes to fake + * movement. That's 7 frames, or 6 intervals, which would + * be 166 msec if we spread it out over a second. It looks + * better (but will work on a slow terminal, e.g., less + * than 9600bd) to squeeze that into a half-second, and use + * half of 170 msec to ensure that the program doesn't eat + * a lot of time when asking what time it is, at the top of + * this loop -T.Dickey + */ + if (scrol) + napms(85); + } + } + } + + /* this depends on the detailed format of ctime(3) */ + (void) strcpy(buf, ctime(&now)); + (void) strcpy(buf + 10, buf + 19); + MvAddStr(16, 30, buf); + + move(6, 0); + drawbox(FALSE); + refresh(); + + /* + * If we're not scrolling, wait 1000 msec (1 sec). Use napms() rather + * than sleep() because the latter does odd things on some systems, + * e.g., suspending output as well. + */ + if (scrol) + napms(500); + else + napms(1000); + + /* + * This is a safe way to check if we're interrupted - making the signal + * handler set a flag that we can check. Since we're running + * nodelay(), the wgetch() call returns immediately, and in particular + * will return an error if interrupted. This works only if we can + * read from the input, of course. + */ + switch (wgetch(stdscr)) { + case 'q': + count = 1; + break; + case 's': + nodelay(stdscr, FALSE); + break; + case ' ': + nodelay(stdscr, TRUE); + break; +#ifdef KEY_RESIZE + case KEY_RESIZE: +#endif + case '?': + goto restart; + case ERR: + if (sigtermed) { + (void) standend(); + endwin(); + fprintf(stderr, "gdc terminated by signal %d\n", sigtermed); + ExitProgram(EXIT_FAILURE); + } + /* FALLTHRU */ + default: + continue; + } + } while (--count); + (void) standend(); + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/hanoi.c b/test/hanoi.c new file mode 100644 index 00000000000..3366e93a331 --- /dev/null +++ b/test/hanoi.c @@ -0,0 +1,338 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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. * + ****************************************************************************/ +/* + * Name: Towers of Hanoi. + * + * Desc: + * This is a playable copy of towers of hanoi. + * Its sole purpose is to demonstrate my Amiga Curses package. + * This program should compile on any system that has Curses. + * 'hanoi' will give a manual game with 7 playing pieces. + * 'hanoi n' will give a manual game with n playing pieces. + * 'hanoi n a' will give an auto solved game with n playing pieces. + * + * Author: Simon J Raybould (sie@fulcrum.bt.co.uk). + * (This version has been slightly modified by the ncurses maintainers.) + * + * Date: 05.Nov.90 + * + * $Id: hanoi.c,v 1.31 2010/11/14 01:01:07 tom Exp $ + */ + +#include + +#define NPEGS 3 /* This is not configurable !! */ +#define MINTILES 3 +#define MAXTILES 9 +#define DEFAULTTILES 7 +#define TOPLINE 6 +#define BASELINE 16 +#define STATUSLINE (LINES-3) +#define LEFTPEG 19 +#define MIDPEG 39 +#define RIGHTPEG 59 + +#define LENTOIND(x) (((x)-1)/2) +#define OTHER(a,b) (3-((a)+(b))) + +struct Peg { + size_t Length[MAXTILES]; + int Count; +}; + +static struct Peg Pegs[NPEGS]; +static int PegPos[] = +{ + LEFTPEG, + MIDPEG, + RIGHTPEG +}; +static short TileColour[] = +{ + COLOR_GREEN, /* Length 3 */ + COLOR_MAGENTA, /* Length 5 */ + COLOR_RED, /* Length 7 */ + COLOR_BLUE, /* Length 9 */ + COLOR_CYAN, /* Length 11 */ + COLOR_YELLOW, /* Length 13 */ + COLOR_GREEN, /* Length 15 */ + COLOR_MAGENTA, /* Length 17 */ + COLOR_RED, /* Length 19 */ +}; +static int NMoves = 0; +static bool AutoFlag = FALSE; + +static void InitTiles(int NTiles); +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 NTiles, 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); + } +#ifdef TRACE + trace(TRACE_MAXIMUM); +#endif + 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(NTiles); + 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) +{ + if (From >= NPEGS) + return TRUE; + if (From < 0) + return TRUE; + if (To >= NPEGS) + return TRUE; + if (To < 0) + return TRUE; + if (From == To) + return TRUE; + if (!Pegs[From].Count) + return TRUE; + if (Pegs[To].Count && + Pegs[From].Length[Pegs[From].Count - 1] > + Pegs[To].Length[Pegs[To].Count - 1]) + return TRUE; + return FALSE; +} + +static void +InitTiles(int NTiles) +{ + int Size, SlotNo; + + for (Size = NTiles * 2 + 1, SlotNo = 0; Size >= 3; Size -= 2) + Pegs[0].Length[SlotNo++] = (size_t) Size; + + Pegs[0].Count = NTiles; + Pegs[1].Count = 0; + Pegs[2].Count = 0; +} + +static void +DisplayTiles(void) +{ + int Line, peg, SlotNo; + char TileBuf[BUFSIZ]; + + erase(); + MvAddStr(1, 24, "T O W E R S O F H A N O I"); + MvAddStr(3, 34, "SJR 1990"); + MvPrintw(19, 5, "Moves : %d", NMoves); + (void) attrset(A_REVERSE); + MvAddStr(BASELINE, 8, + " "); + + for (Line = TOPLINE; Line < BASELINE; Line++) { + MvAddCh(Line, LEFTPEG, ' '); + MvAddCh(Line, MIDPEG, ' '); + MvAddCh(Line, RIGHTPEG, ' '); + } + MvAddCh(BASELINE, LEFTPEG, '1'); + MvAddCh(BASELINE, MIDPEG, '2'); + MvAddCh(BASELINE, RIGHTPEG, '3'); + (void) attrset(A_NORMAL); + + /* Draw tiles */ + for (peg = 0; peg < NPEGS; peg++) { + for (SlotNo = 0; SlotNo < Pegs[peg].Count; SlotNo++) { + size_t len = Pegs[peg].Length[SlotNo]; + if (len < sizeof(TileBuf) - 1 && len < (size_t) PegPos[peg]) { + memset(TileBuf, ' ', len); + TileBuf[len] = '\0'; + if (has_colors()) + (void) attrset(COLOR_PAIR(LENTOIND(len))); + else + (void) attrset(A_REVERSE); + MvAddStr(BASELINE - (SlotNo + 1), + (PegPos[peg] - (int) len / 2), + TileBuf); + } + } + } + (void) attrset(A_NORMAL); + refresh(); +} + +static int +GetMove(int *From, int *To) +{ + MvAddStr(STATUSLINE, 0, "Next move ('q' to quit) from "); + clrtoeol(); + refresh(); + if ((*From = getch()) == 'q') + return TRUE; + *From -= ('0' + 1); + addstr(" to "); + clrtoeol(); + refresh(); + + if ((*To = getch()) == 'q') + return TRUE; + *To -= ('0' + 1); + refresh(); + if (!AutoFlag) + napms(500); + + move(STATUSLINE, 0); + clrtoeol(); + refresh(); + return FALSE; +} + +static void +MakeMove(int From, int To) +{ + Pegs[From].Count--; + Pegs[To].Length[Pegs[To].Count] = Pegs[From].Length[Pegs[From].Count]; + Pegs[To].Count++; + NMoves++; + DisplayTiles(); +} + +static void +AutoMove(int From, int To, int Num) +{ + if (Num == 1) { + MakeMove(From, To); + napms(500); + return; + } + AutoMove(From, OTHER(From, To), Num - 1); + MakeMove(From, To); + napms(500); + AutoMove(OTHER(From, To), To, Num - 1); +} + +static int +Solved(int NumTiles) +{ + int i; + + for (i = 1; i < NPEGS; i++) + if (Pegs[i].Count == NumTiles) + return TRUE; + return FALSE; +} + +static void +Usage(void) +{ + fprintf(stderr, "Usage: hanoi [] [a]\n"); + fprintf(stderr, + "The 'a' option causes the tower to be solved automatically\n"); +} diff --git a/test/hashtest.c b/test/hashtest.c new file mode 100644 index 00000000000..919a1091e84 --- /dev/null +++ b/test/hashtest.c @@ -0,0 +1,247 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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. * + ****************************************************************************/ +/* + * hashtest.c -- test hash mapping + * + * Generate timing statistics for vertical-motion optimization. + * + * $Id: hashtest.c,v 1.31 2010/11/13 23:43:15 tom Exp $ + */ + +#include + +#define LO_CHAR ' ' +#define HI_CHAR '~' + +static bool continuous = FALSE; +static bool reverse_loops = FALSE; +static bool single_step = FALSE; +static bool extend_corner = FALSE; +static int foot_lines = 0; +static int head_lines = 0; + +static void +cleanup(void) +{ + move(LINES - 1, 0); + clrtoeol(); + refresh(); + endwin(); +} + +static RETSIGTYPE +finish(int sig GCC_UNUSED) +{ + cleanup(); + ExitProgram(EXIT_FAILURE); +} + +static void +genlines(int base) +{ + int i, j; + +#if USE_TRACE + if (base == 'a') + Trace(("Resetting screen")); + else + Trace(("Painting `%c' screen", base)); +#endif + + /* Do this so writes to lower-right corner don't cause a spurious + * scrolling operation. This _shouldn't_ break the scrolling + * optimization, since that's computed in the refresh() call. + */ + scrollok(stdscr, FALSE); + + move(0, 0); + for (i = 0; i < head_lines; i++) + for (j = 0; j < COLS; j++) + addch(UChar((j % 8 == 0) ? ('A' + j / 8) : '-')); + + move(head_lines, 0); + for (i = head_lines; i < LINES - foot_lines; i++) { + chtype c = (chtype) ((base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) + + LO_CHAR); + int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1; + for (j = 0; j < hi; j++) + 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) : '-')); + } + + scrollok(stdscr, TRUE); + if (single_step) { + move(LINES - 1, 0); + getch(); + } else + refresh(); +} + +static void +one_cycle(int ch) +{ + if (continuous) { + genlines(ch); + } else if (ch != 'a') { + genlines('a'); + genlines(ch); + } +} + +static void +run_test(bool optimized GCC_UNUSED) +{ + char ch; + int lo = continuous ? LO_CHAR : 'a' - LINES; + int hi = continuous ? HI_CHAR : 'a' + LINES; + + if (lo < LO_CHAR) + lo = LO_CHAR; + if (hi > HI_CHAR) + hi = HI_CHAR; + +#if defined(TRACE) || defined(NCURSES_TEST) + if (optimized) { + Trace(("With hash mapping")); + _nc_optimize_enable |= OPTIMIZE_HASHMAP; + } else { + Trace(("Without hash mapping")); + _nc_optimize_enable &= ~OPTIMIZE_HASHMAP; + } +#endif + + if (reverse_loops) + for (ch = (char) hi; ch >= lo; ch--) + one_cycle(ch); + else + for (ch = (char) lo; ch <= hi; ch++) + one_cycle(ch); +} + +static void +usage(void) +{ + static const char *const tbl[] = + { + "Usage: hashtest [options]" + ,"" + ,"Options:" + ," -c continuous (don't reset between refresh's)" + ," -f num leave 'num' lines constant for footer" + ," -h num leave 'num' lines constant for header" + ," -l num repeat test 'num' times" + ," -n test the normal optimizer" + ," -o test the hashed optimizer" + ," -r reverse the loops" + ," -s single-step" + ," -x assume lower-right corner extension" + }; + 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[]) +{ + int c; + int test_loops = 1; + int test_normal = FALSE; + int test_optimize = FALSE; + + setlocale(LC_ALL, ""); + + while ((c = getopt(argc, argv, "cf:h:l:norsx")) != -1) { + switch (c) { + case 'c': + continuous = TRUE; + break; + case 'f': + foot_lines = atoi(optarg); + break; + case 'h': + head_lines = atoi(optarg); + break; + case 'l': + test_loops = atoi(optarg); + assert(test_loops >= 0); + break; + case 'n': + test_normal = TRUE; + break; + case 'o': + test_optimize = TRUE; + break; + case 'r': + reverse_loops = TRUE; + break; + case 's': + single_step = TRUE; + break; + case 'x': + extend_corner = TRUE; + break; + default: + usage(); + } + } + if (!test_normal && !test_optimize) { + test_normal = TRUE; + test_optimize = TRUE; + } +#if USE_TRACE + trace(TRACE_TIMES); +#endif + + CATCHALL(finish); /* arrange interrupts to terminate */ + + (void) initscr(); /* initialize the curses library */ + 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 */ + scrollok(stdscr, TRUE); + + while (test_loops-- > 0) { + if (test_normal) + run_test(FALSE); + if (test_optimize) + run_test(TRUE); + } + + cleanup(); /* we're done */ + ExitProgram(EXIT_SUCCESS); +} +/* hashtest.c ends here */ diff --git a/test/inch_wide.c b/test/inch_wide.c new file mode 100644 index 00000000000..3d31f1787fa --- /dev/null +++ b/test/inch_wide.c @@ -0,0 +1,279 @@ +/**************************************************************************** + * Copyright (c) 2007,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"), 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: inch_wide.c,v 1.7 2010/05/01 19:13:46 tom Exp $ + */ +/* + int in_wch(cchar_t *wcval); + int mvin_wch(int y, int x, cchar_t *wcval); + int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval); + int win_wch(WINDOW *win, cchar_t *wcval); + int in_wchstr(cchar_t *wchstr); + int in_wchnstr(cchar_t *wchstr, int n); + int win_wchstr(WINDOW *win, cchar_t *wchstr); + int win_wchnstr(WINDOW *win, cchar_t *wchstr, int n); + int mvin_wchstr(int y, int x, cchar_t *wchstr); + int mvin_wchnstr(int y, int x, cchar_t *wchstr, int n); + int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr); + int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n); +*/ + +#include + +#if USE_WIDEC_SUPPORT + +#define BASE_Y 7 +#define MAX_COLS 1024 + +static bool +Quit(int ch) +{ + return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +static int +test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +{ + 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]; + + if (argv[level] == 0) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((j = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(j)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) { + switch (j) { + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) + txt_y++; + else + beep(); + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) + txt_y--; + else + beep(); + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) + txt_x--; + else + beep(); + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) + txt_x++; + else + beep(); + break; + case 'w': + test_inchs(level + 1, argv, chrwin, strwin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + default: + beep(); + break; + } + + MvWPrintw(chrwin, 0, 0, "char:"); + wclrtoeol(chrwin); + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + if (win_wch(txtwin, &ch) != ERR) { + if (wadd_wch(chrwin, &ch) != ERR) { + for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { + if (mvwin_wch(txtwin, txt_y, j, &ch) != ERR) { + if (wadd_wch(chrwin, &ch) == ERR) { + break; + } + } else { + break; + } + } + } + } + } else { + move(txt_y, txt_x); + if (in_wch(&ch) != ERR) { + if (wadd_wch(chrwin, &ch) != ERR) { + for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { + if (mvin_wch(txt_y, j, &ch) != ERR) { + if (wadd_wch(chrwin, &ch) == ERR) { + break; + } + } else { + break; + } + } + } + } + } + wnoutrefresh(chrwin); + + MvWPrintw(strwin, 0, 0, "text:"); + wclrtobot(strwin); + + limit = getmaxx(strwin) - 5; + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + if (win_wchstr(txtwin, text) != ERR) { + (void) mvwadd_wchstr(strwin, 0, 5, text); + } + + wmove(txtwin, txt_y, txt_x); + if (win_wchnstr(txtwin, text, limit) != ERR) { + (void) mvwadd_wchstr(strwin, 1, 5, text); + } + + if (mvwin_wchstr(txtwin, txt_y, txt_x, text) != ERR) { + (void) mvwadd_wchstr(strwin, 2, 5, text); + } + + if (mvwin_wchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) { + (void) mvwadd_wchstr(strwin, 3, 5, text); + } + } else { + move(txt_y, txt_x); + if (in_wchstr(text) != ERR) { + (void) mvwadd_wchstr(strwin, 0, 5, text); + } + + move(txt_y, txt_x); + if (in_wchnstr(text, limit) != ERR) { + (void) mvwadd_wchstr(strwin, 1, 5, text); + } + + if (mvin_wchstr(txt_y, txt_x, text) != ERR) { + (void) mvwadd_wchstr(strwin, 2, 5, text); + } + + if (mvin_wchnstr(txt_y, txt_x, text, limit) != ERR) { + (void) mvwadd_wchstr(strwin, 3, 5, text); + } + } + + wnoutrefresh(strwin); + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +int +main(int argc, char *argv[]) +{ + WINDOW *chrbox; + WINDOW *chrwin; + WINDOW *strwin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(chrbox, 0, 0); + wnoutrefresh(chrbox); + + chrwin = derwin(chrbox, 1, COLS - 2, 1, 1); + strwin = derwin(chrbox, 4, COLS - 2, 2, 1); + + test_inchs(1, argv, chrwin, strwin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/inchs.c b/test/inchs.c new file mode 100644 index 00000000000..f07a2bdabd0 --- /dev/null +++ b/test/inchs.c @@ -0,0 +1,272 @@ +/**************************************************************************** + * Copyright (c) 2007,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"), 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: inchs.c,v 1.11 2010/11/13 23:41:23 tom Exp $ + * + * Author: Thomas E Dickey + */ +/* + chtype inch(void); + chtype winch(WINDOW *win); + chtype mvinch(int y, int x); + chtype mvwinch(WINDOW *win, int y, int x); + int inchstr(chtype *chstr); + int inchnstr(chtype *chstr, int n); + int winchstr(WINDOW *win, chtype *chstr); + int winchnstr(WINDOW *win, chtype *chstr, int n); + int mvinchstr(int y, int x, chtype *chstr); + int mvinchnstr(int y, int x, chtype *chstr, int n); + int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr); + int mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr, int n); +*/ + +#include + +#define BASE_Y 7 +#define MAX_COLS 1024 + +static bool +Quit(int ch) +{ + return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +static int +test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +{ + 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) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((j = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(j)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) { + switch (j) { + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) + txt_y++; + else + beep(); + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) + txt_y--; + else + beep(); + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) + txt_x--; + else + beep(); + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) + txt_x++; + else + beep(); + break; + case 'w': + test_inchs(level + 1, argv, chrwin, strwin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + default: + beep(); + break; + } + + MvWPrintw(chrwin, 0, 0, "char:"); + wclrtoeol(chrwin); + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + + if ((ch = (int) winch(txtwin)) != ERR) { + if (waddch(chrwin, (chtype) ch) != ERR) { + for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { + if ((ch = (int) mvwinch(txtwin, txt_y, j)) != ERR) { + if (waddch(chrwin, (chtype) ch) == ERR) { + break; + } + } else { + break; + } + } + } + } + } else { + move(txt_y, txt_x); + + if ((ch = (int) inch()) != ERR) { + if (waddch(chrwin, (chtype) ch) != ERR) { + for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { + if ((ch = (int) mvinch(txt_y, j)) != ERR) { + if (waddch(chrwin, (chtype) ch) == ERR) { + break; + } + } else { + break; + } + } + } + } + } + wnoutrefresh(chrwin); + + MvWPrintw(strwin, 0, 0, "text:"); + wclrtobot(strwin); + + limit = getmaxx(strwin) - 5; + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + if (winchstr(txtwin, text) != ERR) { + MvWAddChStr(strwin, 0, 5, text); + } + + wmove(txtwin, txt_y, txt_x); + if (winchnstr(txtwin, text, limit) != ERR) { + MvWAddChStr(strwin, 1, 5, text); + } + + if (mvwinchstr(txtwin, txt_y, txt_x, text) != ERR) { + MvWAddChStr(strwin, 2, 5, text); + } + + if (mvwinchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) { + MvWAddChStr(strwin, 3, 5, text); + } + } else { + move(txt_y, txt_x); + if (inchstr(text) != ERR) { + MvWAddChStr(strwin, 0, 5, text); + } + + move(txt_y, txt_x); + if (inchnstr(text, limit) != ERR) { + MvWAddChStr(strwin, 1, 5, text); + } + + if (mvinchstr(txt_y, txt_x, text) != ERR) { + MvWAddChStr(strwin, 2, 5, text); + } + + if (mvinchnstr(txt_y, txt_x, text, limit) != ERR) { + MvWAddChStr(strwin, 3, 5, text); + } + } + + wnoutrefresh(strwin); + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +int +main(int argc, char *argv[]) +{ + WINDOW *chrbox; + WINDOW *chrwin; + WINDOW *strwin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(chrbox, 0, 0); + wnoutrefresh(chrbox); + + chrwin = derwin(chrbox, 1, COLS - 2, 1, 1); + strwin = derwin(chrbox, 4, COLS - 2, 2, 1); + + test_inchs(1, argv, chrwin, strwin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/ins_wide.c b/test/ins_wide.c new file mode 100644 index 00000000000..87deb1a14d5 --- /dev/null +++ b/test/ins_wide.c @@ -0,0 +1,508 @@ +/**************************************************************************** + * Copyright (c) 2002-2009,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"), 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: ins_wide.c,v 1.15 2010/12/12 00:20:14 tom Exp $ + * + * Demonstrate the wins_wstr() and wins_wch functions. + * Thomas Dickey - 2002/11/23 + * + * Note: to provide inputs for *ins_wch(), we use setcchar(). A quirk of the + * X/Open definition for that function is that the string contains no + * characters with negative width. Any control character (such as tab) falls + * into that category. So it follows that *ins_wch() cannot render a tab + * character because there is no legal way to construct a cchar_t containing + * one. X/Open does not document this, and it would be logical to assume that + * *ins_wstr() has the same limitation, but it uses a wchar_t string directly, + * and does not document how tabs are handled. + */ + +#include + +#if USE_WIDEC_SUPPORT + +#define WIDE_LINEDATA +#include + +/* definitions to make it simpler to compare with inserts.c */ +#define InsNStr ins_nwstr +#define InsStr ins_wstr +#define MvInsNStr (void) mvins_nwstr +#define MvInsStr (void) mvins_wstr +#define MvWInsNStr (void) mvwins_nwstr +#define MvWInsStr (void) mvwins_wstr +#define WInsNStr wins_nwstr +#define WInsStr wins_wstr + +#define MY_TABSIZE 8 + +typedef enum { + oDefault = 0, + oMove = 1, + oWindow = 2, + oMoveWindow = 3 +} Options; + +static bool m_opt = FALSE; +static bool w_opt = FALSE; +static int n_opt = -1; + +static void +legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) +{ + const char *showstate; + + switch (state) { + default: + case oDefault: + showstate = ""; + break; + case oMove: + showstate = " (mvXXX)"; + break; + case oWindow: + showstate = " (winXXX)"; + break; + case oMoveWindow: + showstate = " (mvwinXXX)"; + break; + } + + wmove(win, 0, 0); + wprintw(win, + "The Strings/Chars displays should match. Enter any characters, except:\n"); + 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); + waddwstr(win, buffer); + waddstr(win, ">"); +} + +static int +ColOf(wchar_t *buffer, int length, int margin) +{ + int n; + int result; + + for (n = 0, result = margin + 1; n < length; ++n) { + int ch = buffer[n]; + switch (ch) { + case '\n': + /* actually newline should clear the remainder of the line + * and move to the next line - but that seems a little awkward + * in this example. + */ + case '\r': + result = 0; + break; + case '\b': + if (result > 0) + --result; + break; + case '\t': + result += (MY_TABSIZE - (result % MY_TABSIZE)); + break; + case '\177': + result += 2; + break; + default: + result += wcwidth(ch); + if (ch < 32) + ++result; + break; + } + } + return result; +} + +static int +ConvertCh(chtype source, cchar_t *target) +{ + wchar_t tmp_wchar[2]; + + tmp_wchar[0] = (wchar_t) source; + tmp_wchar[1] = 0; + if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) { + beep(); + return FALSE; + } + return TRUE; +} + +static int +MvWInsCh(WINDOW *win, int y, int x, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = mvwins_wch(win, y, x, &tmp_cchar); + } else { + code = mvwinsch(win, y, x, ch); + } + return code; +} + +static int +MvInsCh(int y, int x, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = mvins_wch(y, x, &tmp_cchar); + } else { + code = mvinsch(y, x, ch); + } + return code; +} + +static int +WInsCh(WINDOW *win, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = wins_wch(win, &tmp_cchar); + } else { + code = winsch(win, ch); + } + return code; +} + +static int +InsCh(chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = ins_wch(&tmp_cchar); + } else { + code = insch(ch); + } + return code; +} + +#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) +static void +test_inserts(int level) +{ + static bool first = TRUE; + + int ch; + int limit; + int row = 1; + int col; + int row2, col2; + int length; + wchar_t buffer[BUFSIZ]; + WINDOW *look = 0; + WINDOW *work = 0; + WINDOW *show = 0; + int margin = (2 * MY_TABSIZE) - 1; + Options option = ((m_opt ? oMove : oDefault) + | ((w_opt || (level > 0)) ? oWindow : oDefault)); + + if (first) { + static char cmd[80]; + setlocale(LC_ALL, ""); + + putenv(strcpy(cmd, "TABSIZE=8")); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + keypad(stdscr, TRUE); + } + + limit = LINES - 5; + if (level > 0) { + look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); + work = newwin(limit - 2, COLS - (2 * level), 1, level); + show = newwin(4, COLS, limit + 1, 0); + box(look, 0, 0); + wnoutrefresh(look); + limit -= 2; + } else { + work = stdscr; + show = derwin(stdscr, 4, COLS, limit + 1, 0); + } + keypad(work, TRUE); + + for (col = margin + 1; col < COLS; col += MY_TABSIZE) + MvWVLine(work, row, col, '.', limit - 2); + + MvWVLine(work, row, margin, ACS_VLINE, limit - 2); + MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); + limit /= 2; + + MvWAddStr(work, 1, 2, "String"); + MvWAddStr(work, limit + 1, 2, "Chars"); + wnoutrefresh(work); + + buffer[length = 0] = '\0'; + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + + /* + * Show the characters inserted in color, to distinguish from those that + * are shifted. + */ + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + wbkgdset(work, COLOR_PAIR(1) | ' '); + } + + while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { + wmove(work, row, margin + 1); + switch (ch) { + case key_RECUR: + test_inserts(level + 1); + + touchwin(look); + touchwin(work); + touchwin(show); + + wnoutrefresh(look); + wnoutrefresh(work); + wnoutrefresh(show); + + doupdate(); + break; + case key_NEWLINE: + if (row < limit) { + ++row; + /* put the whole string in, all at once */ + col2 = margin + 1; + switch (option) { + case oDefault: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (move(row, col2) != ERR) { + InsNStr(buffer + col, LEN(col)); + } + } + } else { + if (move(row, col2) != ERR) { + InsStr(buffer); + } + } + break; + case oMove: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvInsNStr(row, col2, buffer + col, LEN(col)); + } + } else { + MvInsStr(row, col2, buffer); + } + break; + case oWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (wmove(work, row, col2) != ERR) { + WInsNStr(work, buffer + col, LEN(col)); + } + } + } else { + if (wmove(work, row, col2) != ERR) { + WInsStr(work, buffer); + } + } + break; + case oMoveWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvWInsNStr(work, row, col2, buffer + col, LEN(col)); + } + } else { + MvWInsStr(work, row, col2, buffer); + } + break; + } + + /* do the corresponding single-character insertion */ + row2 = limit + row; + for (col = 0; col < length; ++col) { + col2 = ColOf(buffer, col, margin); + switch (option) { + case oDefault: + if (move(row2, col2) != ERR) { + InsCh((chtype) buffer[col]); + } + break; + case oMove: + MvInsCh(row2, col2, (chtype) buffer[col]); + break; + case oWindow: + if (wmove(work, row2, col2) != ERR) { + WInsCh(work, (chtype) buffer[col]); + } + break; + case oMoveWindow: + MvWInsCh(work, row2, col2, (chtype) buffer[col]); + break; + } + } + } else { + beep(); + } + break; + default: + buffer[length++] = ch; + buffer[length] = '\0'; + + /* put the string in, one character at a time */ + col = ColOf(buffer, length - 1, margin); + switch (option) { + case oDefault: + if (move(row, col) != ERR) { + InsStr(buffer + length - 1); + } + break; + case oMove: + MvInsStr(row, col, buffer + length - 1); + break; + case oWindow: + if (wmove(work, row, col) != ERR) { + WInsStr(work, buffer + length - 1); + } + break; + case oMoveWindow: + MvWInsStr(work, row, col, buffer + length - 1); + break; + } + + /* do the corresponding single-character insertion */ + switch (option) { + case oDefault: + if (move(limit + row, col) != ERR) { + InsCh((chtype) ch); + } + break; + case oMove: + MvInsCh(limit + row, col, (chtype) ch); + break; + case oWindow: + if (wmove(work, limit + row, col) != ERR) { + WInsCh(work, (chtype) ch); + } + break; + case oMoveWindow: + MvWInsCh(work, limit + row, col, (chtype) ch); + break; + } + + wnoutrefresh(work); + + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + break; + } + } + if (level > 0) { + delwin(show); + delwin(work); + delwin(look); + } +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: inserts [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" + ," -w use window-parameter even when stdscr would be implied" + }; + 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; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { + switch (ch) { + case 'f': + init_linedata(optarg); + break; + case 'm': + m_opt = TRUE; + break; + case 'n': + n_opt = atoi(optarg); + if (n_opt == 0) + n_opt = -1; + break; + case 'w': + w_opt = TRUE; + break; + default: + usage(); + break; + } + } + if (optind < argc) + usage(); + + test_inserts(0); + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/insdelln.c b/test/insdelln.c new file mode 100644 index 00000000000..d5034a44596 --- /dev/null +++ b/test/insdelln.c @@ -0,0 +1,387 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,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"), 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: insdelln.c,v 1.5 2010/11/13 23:39:38 tom Exp $ + * + * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln + */ + +#include + +#define SHOW(n) ((n) == ERR ? "ERR" : "OK") +#define COLOR_DEFAULT (-1) + +typedef struct { + unsigned c; + unsigned v; + int pair; + unsigned attr; + int count; + int ch; + const char *c_msg; + const char *v_msg; + int y_val; + int x_val; + int y_beg, x_beg; + int y_max, x_max; +} STATUS; + +static const char * +color_params(unsigned state, int *pair) +{ + /* *INDENT-OFF* */ + static struct { + short pair; + short fg, bg; + const char *msg; + } table[] = { + { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, + { 1, COLOR_RED, COLOR_BLACK, "red/black" }, + { 2, COLOR_WHITE, COLOR_BLUE, "white/blue" }, + }; + /* *INDENT-ON* */ + + static bool first = TRUE; + const char *result = 0; + + if (has_colors()) { + if (first) { + unsigned n; + + start_color(); + for (n = 0; n < SIZEOF(table); ++n) { + init_pair(table[n].pair, table[n].fg, table[n].bg); + } + } + if (state < SIZEOF(table)) { + *pair = table[state].pair; + result = table[state].msg; + } + } + return result; +} + +static const char * +video_params(unsigned state, unsigned *attr) +{ + /* *INDENT-OFF* */ + static struct { + unsigned attr; + const char *msg; + } table[] = { + { A_NORMAL, "normal" }, + { A_BOLD, "bold" }, + { A_REVERSE, "reverse" }, + { A_UNDERLINE, "underline" }, + { A_BLINK, "blink" }, + }; + /* *INDENT-ON* */ + + const char *result = 0; + + if (state < SIZEOF(table)) { + *attr = table[state].attr; + result = table[state].msg; + } + return result; +} + +/* fill the window with a test-pattern */ +static void +fill_window(WINDOW *win) +{ + int y, x; + int y0 = -1, x0 = -1; + + getyx(win, y, x); + wmove(win, 0, 0); + while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) { + int y1, x1; + getyx(win, y1, x1); + if (y1 == y0 && x1 == x0) + break; + x0 = x1; + y0 = y1; + } + wmove(win, y, x); +} + +static void +show_status(WINDOW *win, STATUS * sp) +{ + int y, x; + + getyx(win, y, x); + wmove(win, 0, 0); + wprintw(win, "Count %d", sp->count); + if (sp->v_msg != 0) + wprintw(win, " Video %s", sp->v_msg); + if (sp->c_msg != 0) + wprintw(win, " Color %s", sp->c_msg); + wclrtoeol(win); + wmove(win, y, x); +} + +static void +reshow_status(WINDOW *win, STATUS * sp) +{ + fill_window(win); + show_status(win, sp); +} + +static void +do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) +{ + WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, + sp->y_beg + 1, sp->x_beg + 1); + + if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { + WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); + + if (win2 != 0) { + box(win1, 0, 0); + wrefresh(win1); + func(win2); + + delwin(win2); + } else { + beep(); + } + delwin(win1); + touchwin(win); + } else { + beep(); + } +} + +static void +init_status(WINDOW *win, STATUS * sp) +{ + memset(sp, 0, sizeof(*sp)); + sp->c = 99; + sp->v = 99; + sp->ch = ' '; + + keypad(win, TRUE); + fill_window(win); + + getbegyx(win, sp->y_beg, sp->x_beg); + getmaxyx(win, sp->y_max, sp->x_max); +} + +static void +show_help(WINDOW *win) +{ + static const char *table[] = + { + "Basic commands:" + ,"Use h/j/k/l or arrow keys to move the cursor." + ,"Set the count parameter for insert/delete by entering digits 0-9." + ,"" + ,"Other commands:" + ,"space toggles through the set of video attributes and colors." + ,"t touches (forces repaint) of the current line." + ,"i calls insertln at the current position with the given count." + ,"d calls deleteln at the window beginning with the given count." + ,"I calls insdelln at the window beginning with the given count." + ,"D calls insdelln at the window beginning with the given -count." + ,"f refills the window with test-pattern using current attributes." + ,"w recur to test windows other than stdscr" + ,"q quit" + ,"= resets count to zero." + ,"? shows this help-window" + ,"" + ,"" + }; + + 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(); +} + +static void +update_status(WINDOW *win, STATUS * sp) +{ + switch (sp->ch) { + case ' ': /* next test-iteration */ + if (has_colors()) { + if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { + sp->c_msg = color_params(sp->c = 0, &(sp->pair)); + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + sp->v_msg = video_params(sp->v = 0, &(sp->attr)); + } + } + } else { + if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { + sp->v_msg = video_params(sp->v = 0, &(sp->attr)); + } + } + sp->count = 0; + show_status(win, sp); + break; + case KEY_LEFT: + case 'h': + if (sp->x_val > 0) + wmove(win, sp->y_val, --(sp->x_val)); + break; + case KEY_DOWN: + case 'j': + if (sp->y_val < sp->y_max) + wmove(win, ++(sp->y_val), sp->x_val); + break; + case KEY_UP: + case 'k': + if (sp->y_val > 0) + wmove(win, --(sp->y_val), sp->x_val); + break; + case KEY_RIGHT: + case 'l': + if (sp->x_val < sp->x_max) + wmove(win, sp->y_val, ++(sp->x_val)); + break; + case 't': + touchline(win, sp->y_val, 1); + break; + case '=': + sp->count = 0; + show_status(win, sp); + break; + case '?': + do_subwindow(win, sp, show_help); + break; + default: + if (isdigit(sp->ch)) { + sp->count = (sp->count * 10) + (sp->ch - '0'); + show_status(win, sp); + } else { + beep(); + } + break; + } +} + +static void +test_winsdelln(WINDOW *win) +{ + STATUS st; + int n; + + init_status(win, &st); + + do { + (void) wattrset(win, st.attr | (attr_t) COLOR_PAIR(st.pair)); + switch (st.ch) { + case 'i': + for (n = 0; n < st.count; ++n) + winsertln(win); + break; + case 'd': + for (n = 0; n < st.count; ++n) + wdeleteln(win); + break; + case 'I': + winsdelln(win, st.count); + break; + case 'D': + winsdelln(win, -st.count); + break; + case 'f': + fill_window(win); + reshow_status(win, &st); + break; + case 'w': + do_subwindow(win, &st, test_winsdelln); + break; + case 'q': + return; + default: + update_status(win, &st); + break; + } + } while ((st.ch = wgetch(win)) != ERR); +} + +static void +test_insdelln(void) +{ + STATUS st; + int n; + + init_status(stdscr, &st); + + do { + (void) attrset(st.attr | (attr_t) COLOR_PAIR(st.pair)); + switch (st.ch) { + case 'i': + for (n = 0; n < st.count; ++n) + insertln(); + break; + case 'd': + for (n = 0; n < st.count; ++n) + deleteln(); + break; + case 'I': + insdelln(st.count); + break; + case 'D': + insdelln(-st.count); + break; + case 'f': + fill_window(stdscr); + reshow_status(stdscr, &st); + break; + case 'w': + do_subwindow(stdscr, &st, test_winsdelln); + break; + case 'q': + return; + default: + update_status(stdscr, &st); + break; + } + } while ((st.ch = getch()) != ERR); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + initscr(); + cbreak(); + noecho(); + + test_insdelln(); + endwin(); + + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/inserts.c b/test/inserts.c new file mode 100644 index 00000000000..a12fa401128 --- /dev/null +++ b/test/inserts.c @@ -0,0 +1,438 @@ +/**************************************************************************** + * Copyright (c) 2002-2009,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"), 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: inserts.c,v 1.23 2010/12/12 00:19:55 tom Exp $ + * + * Demonstrate the winsstr() and winsch functions. + * Thomas Dickey - 2002/10/19 + */ + +#include + +#if HAVE_WINSSTR + +#include + +#define InsNStr insnstr +#define InsStr insstr +#define MvInsNStr (void) mvinsnstr +#define MvInsStr (void) mvinsstr +#define MvWInsNStr (void) mvwinsnstr +#define MvWInsStr (void) mvwinsstr +#define WInsNStr winsnstr +#define WInsStr winsstr + +#define InsCh insch +#define MvInsCh (void) mvinsch +#define MvWInsCh (void) mvwinsch +#define WInsCh winsch + +#define MY_TABSIZE 8 + +typedef enum { + oDefault = 0, + oMove = 1, + oWindow = 2, + oMoveWindow = 3 +} Options; + +static bool m_opt = FALSE; +static bool w_opt = FALSE; +static int n_opt = -1; + +static void +legend(WINDOW *win, int level, Options state, char *buffer, int length) +{ + const char *showstate; + + switch (state) { + default: + case oDefault: + showstate = ""; + break; + case oMove: + showstate = " (mvXXX)"; + break; + case oWindow: + showstate = " (winXXX)"; + break; + case oMoveWindow: + showstate = " (mvwinXXX)"; + break; + } + + wmove(win, 0, 0); + wprintw(win, + "The Strings/Chars displays should match. Enter any characters, except:\n"); + 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 <%s>", level, + showstate, length, buffer); +} + +static int +ColOf(char *buffer, int length, int margin) +{ + int n; + int result; + + for (n = 0, result = margin + 1; n < length; ++n) { + int ch = UChar(buffer[n]); + switch (ch) { + case '\n': + /* actually newline should clear the remainder of the line + * and move to the next line - but that seems a little awkward + * in this example. + */ + case '\r': + result = 0; + break; + case '\b': + if (result > 0) + --result; + break; + case '\t': + result += (MY_TABSIZE - (result % MY_TABSIZE)); + break; + case '\177': + result += 2; + break; + default: + ++result; + if (ch < 32) + ++result; + break; + } + } + return result; +} + +#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) +static void +test_inserts(int level) +{ + static bool first = TRUE; + + int ch; + int limit; + int row = 1; + int col; + int row2, col2; + int length; + char buffer[BUFSIZ]; + WINDOW *look = 0; + WINDOW *work = 0; + WINDOW *show = 0; + int margin = (2 * MY_TABSIZE) - 1; + 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")); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + keypad(stdscr, TRUE); + } + + limit = LINES - 5; + if (level > 0) { + look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); + work = newwin(limit - 2, COLS - (2 * level), 1, level); + show = newwin(4, COLS, limit + 1, 0); + box(look, 0, 0); + wnoutrefresh(look); + limit -= 2; + } else { + work = stdscr; + show = derwin(stdscr, 4, COLS, limit + 1, 0); + } + keypad(work, TRUE); + + for (col = margin + 1; col < COLS; col += MY_TABSIZE) + MvWVLine(work, row, col, '.', limit - 2); + + MvWVLine(work, row, margin, ACS_VLINE, limit - 2); + MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); + limit /= 2; + + MvWAddStr(work, 1, 2, "String"); + MvWAddStr(work, limit + 1, 2, "Chars"); + wnoutrefresh(work); + + buffer[length = 0] = '\0'; + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + + /* + * Show the characters inserted in color, to distinguish from those that + * are shifted. + */ + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + wbkgdset(work, COLOR_PAIR(1) | ' '); + } + + while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { + wmove(work, row, margin + 1); + switch (ch) { + case key_RECUR: + test_inserts(level + 1); + + touchwin(look); + touchwin(work); + touchwin(show); + + wnoutrefresh(look); + wnoutrefresh(work); + wnoutrefresh(show); + + doupdate(); + break; + case key_NEWLINE: + if (row < limit) { + ++row; + /* put the whole string in, all at once */ + col2 = margin + 1; + switch (option) { + case oDefault: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (move(row, col2) != ERR) { + InsNStr(buffer + col, LEN(col)); + } + } + } else { + if (move(row, col2) != ERR) { + InsStr(buffer); + } + } + break; + case oMove: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvInsNStr(row, col2, buffer + col, LEN(col)); + } + } else { + MvInsStr(row, col2, buffer); + } + break; + case oWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (wmove(work, row, col2) != ERR) { + WInsNStr(work, buffer + col, LEN(col)); + } + } + } else { + if (wmove(work, row, col2) != ERR) { + WInsStr(work, buffer); + } + } + break; + case oMoveWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvWInsNStr(work, row, col2, buffer + col, LEN(col)); + } + } else { + MvWInsStr(work, row, col2, buffer); + } + break; + } + + /* do the corresponding single-character insertion */ + row2 = limit + row; + for (col = 0; col < length; ++col) { + col2 = ColOf(buffer, col, margin); + switch (option) { + case oDefault: + if (move(row2, col2) != ERR) { + InsCh(UChar(buffer[col])); + } + break; + case oMove: + MvInsCh(row2, col2, UChar(buffer[col])); + break; + case oWindow: + if (wmove(work, row2, col2) != ERR) { + WInsCh(work, UChar(buffer[col])); + } + break; + case oMoveWindow: + MvWInsCh(work, row2, col2, UChar(buffer[col])); + break; + } + } + } else { + beep(); + } + break; + default: + if (ch <= 0 || ch > 255) { + beep(); + break; + } + buffer[length++] = (char) ch; + buffer[length] = '\0'; + + /* put the string in, one character at a time */ + col = ColOf(buffer, length - 1, margin); + switch (option) { + case oDefault: + if (move(row, col) != ERR) { + InsStr(buffer + length - 1); + } + break; + case oMove: + MvInsStr(row, col, buffer + length - 1); + break; + case oWindow: + if (wmove(work, row, col) != ERR) { + WInsStr(work, buffer + length - 1); + } + break; + case oMoveWindow: + MvWInsStr(work, row, col, buffer + length - 1); + break; + } + + /* do the corresponding single-character insertion */ + switch (option) { + case oDefault: + if (move(limit + row, col) != ERR) { + InsCh(UChar(ch)); + } + break; + case oMove: + MvInsCh(limit + row, col, UChar(ch)); + break; + case oWindow: + if (wmove(work, limit + row, col) != ERR) { + WInsCh(work, UChar(ch)); + } + break; + case oMoveWindow: + MvWInsCh(work, limit + row, col, UChar(ch)); + break; + } + + wnoutrefresh(work); + + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + break; + } + } + if (level > 0) { + delwin(show); + delwin(work); + delwin(look); + } +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: inserts [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" + ," -w use window-parameter even when stdscr would be implied" + }; + 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; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { + switch (ch) { + case 'f': + init_linedata(optarg); + break; + case 'm': + m_opt = TRUE; + break; + case 'n': + n_opt = atoi(optarg); + if (n_opt == 0) + n_opt = -1; + break; + case 'w': + w_opt = TRUE; + break; + default: + usage(); + break; + } + } + if (optind < argc) + usage(); + + test_inserts(0); + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the winsstr function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif /* HAVE_WINSSTR */ diff --git a/test/key_names.c b/test/key_names.c new file mode 100644 index 00000000000..ba45656d50a --- /dev/null +++ b/test/key_names.c @@ -0,0 +1,93 @@ +/**************************************************************************** + * Copyright (c) 2007,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 * + * "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: key_names.c,v 1.4 2008/10/11 20:22:37 tom Exp $ + */ + +#include + +#if USE_WIDEC_SUPPORT + +static void +usage(void) +{ + fprintf(stderr, "Usage: key_names [-m] [-s]\n"); + ExitProgram(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + int n; + + bool do_setup = FALSE; + bool do_meta = FALSE; + + setlocale(LC_ALL, ""); + + while ((n = getopt(argc, argv, "ms")) != -1) { + switch (n) { + case 'm': + do_meta = TRUE; + break; + case 's': + do_setup = TRUE; + break; + default: + usage(); + /* NOTREACHED */ + } + } + + if (do_setup) { + /* + * Get the terminfo entry into memory, and tell ncurses that we want to + * use function keys. That will make it add any user-defined keys that + * appear in the terminfo. + */ + newterm(getenv("TERM"), stderr, stdin); + keypad(stdscr, TRUE); + if (do_meta) + meta(stdscr, TRUE); + endwin(); + } + for (n = -1; n < KEY_MAX + 512; n++) { + const char *result = key_name(n); + if (result != 0) + printf("%d(%5o):%s\n", n, n, result); + } + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/keynames.c b/test/keynames.c new file mode 100644 index 00000000000..26cfa87b4fb --- /dev/null +++ b/test/keynames.c @@ -0,0 +1,83 @@ +/**************************************************************************** + * Copyright (c) 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 * + * "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: keynames.c,v 1.9 2008/10/11 20:22:37 tom Exp $ + */ + +#include + +static void +usage(void) +{ + fprintf(stderr, "Usage: keynames [-m] [-s]\n"); + ExitProgram(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + int n; + bool do_setup = FALSE; + bool do_meta = FALSE; + + setlocale(LC_ALL, ""); + + while ((n = getopt(argc, argv, "ms")) != -1) { + switch (n) { + case 'm': + do_meta = TRUE; + break; + case 's': + do_setup = TRUE; + break; + default: + usage(); + /* NOTREACHED */ + } + } + + if (do_setup) { + /* + * Get the terminfo entry into memory, and tell ncurses that we want to + * use function keys. That will make it add any user-defined keys that + * appear in the terminfo. + */ + newterm(getenv("TERM"), stderr, stdin); + keypad(stdscr, TRUE); + if (do_meta) + meta(stdscr, TRUE); + endwin(); + } + + for (n = -1; n < KEY_MAX + 512; n++) { + const char *result = keyname(n); + if (result != 0) + printf("%d(%5o):%s\n", n, n, result); + } + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/knight.c b/test/knight.c new file mode 100644 index 00000000000..d9f81facace --- /dev/null +++ b/test/knight.c @@ -0,0 +1,727 @@ +/**************************************************************************** + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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. * + ****************************************************************************/ +/* + * Knight's Tour - a brain game + * + * The original of this game was anonymous. It had an unbelievably bogus + * interface, you actually had to enter square coordinates! Redesign by + * Eric S. Raymond July 22 1995. Mouse support + * added September 20th 1995. + * + * $Id: knight.c,v 1.31 2010/11/13 20:44:21 tom Exp $ + */ + +#include + +/* board size */ +#define BDEPTH 8 +#define BWIDTH 8 + +/* where to start the instructions */ +#define INSTRY 2 +#define INSTRX 35 + +/* corner of board */ +#define BOARDY 2 +#define BOARDX 0 + +/* notification line */ +#define NOTIFYY 21 + +/* virtual color values */ +#define TRAIL_COLOR 1 +#define PLUS_COLOR 2 +#define MINUS_COLOR 3 + +#define CX(x) (2 + 4 * (x)) +#define CY(y) (1 + 2 * (y)) +#define cellmove(y, x) wmove(boardwin, CY(y), CX(x)) +#define CXINV(x) (((x) - 1) / 4) +#define CYINV(y) (((y) - 2) / 2) + +typedef struct { + short x, y; +} cell; + +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 */ +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 */ +/* *INDENT-OFF* */ +static const struct { + int y; + int x; +} offsets[] = { + { 2, 1 }, + { 1, 2 }, + { -1, 2 }, + { -2, 1 }, + { -2, -1 }, + { -1, -2 }, + { 1, -2 }, + { 2, -1 }, +}; +/* *INDENT-ON* */ + +static void +init_program(void) +{ + setlocale(LC_ALL, ""); + + srand((unsigned) getpid()); + initscr(); + cbreak(); /* immediate char return */ + noecho(); /* no immediate echo */ + boardwin = newwin(BDEPTH * 2 + 1, BWIDTH * 4 + 1, BOARDY, BOARDX); + helpwin = newwin(0, 0, INSTRY, INSTRX); + msgwin = newwin(1, INSTRX - 1, NOTIFYY, 0); + scrollok(msgwin, TRUE); + keypad(boardwin, TRUE); + + if (has_colors()) { + int bg = COLOR_BLACK; + + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + bg = -1; +#endif + + (void) init_pair(TRAIL_COLOR, (short) COLOR_CYAN, (short) bg); + (void) init_pair(PLUS_COLOR, (short) COLOR_RED, (short) bg); + (void) init_pair(MINUS_COLOR, (short) COLOR_GREEN, (short) bg); + + trail |= COLOR_PAIR(TRAIL_COLOR); + plus |= COLOR_PAIR(PLUS_COLOR); + minus |= COLOR_PAIR(MINUS_COLOR); + } +#ifdef NCURSES_MOUSE_VERSION + (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); +#endif /* NCURSES_MOUSE_VERSION */ + + oldch = minus; +} + +static void +help1(void) +/* game explanation -- initial help screen */ +{ + (void) waddstr(helpwin, "Knight's move is a solitaire puzzle. Your\n"); + (void) waddstr(helpwin, "objective is to visit each square of the \n"); + (void) waddstr(helpwin, "chessboard exactly once by making knight's\n"); + (void) waddstr(helpwin, "moves (one square right or left followed \n"); + (void) waddstr(helpwin, "by two squares up or down, or two squares \n"); + (void) waddstr(helpwin, "right or left followed by one square up or\n"); + (void) waddstr(helpwin, "down). You may start anywhere.\n\n"); + + (void) waddstr(helpwin, "Use arrow keys to move the cursor around.\n"); + (void) waddstr(helpwin, "When you want to move your knight to the \n"); + (void) waddstr(helpwin, "cursor location, press or Enter.\n"); + (void) waddstr(helpwin, "Illegal moves will be rejected with an \n"); + (void) waddstr(helpwin, "audible beep.\n\n"); + (void) waddstr(helpwin, "The program will detect if you solve the\n"); + (void) waddstr(helpwin, "puzzle; also inform you when you run out\n"); + (void) waddstr(helpwin, "of legal moves.\n\n"); + + MvWAddStr(helpwin, NOTIFYY - INSTRY, 0, + "Press `?' to go to keystroke help."); +} + +static void +help2(void) +/* keystroke help screen */ +{ + (void) waddstr(helpwin, "Possible moves are shown with `-'.\n\n"); + + (void) waddstr(helpwin, "You can move around with the arrow keys or\n"); + (void) waddstr(helpwin, "with the rogue/hack movement keys. Other\n"); + (void) waddstr(helpwin, "commands allow you to undo moves or redraw.\n"); + (void) waddstr(helpwin, "Your mouse may work; try left-button to\n"); + (void) waddstr(helpwin, "move to the square under the pointer.\n\n"); + + (void) waddstr(helpwin, "x,q -- exit y k u 7 8 9\n"); + (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"); + + (void) waddstr(helpwin, "\nYou can place your knight on the selected\n"); + (void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n"); + (void) waddstr(helpwin, "center key. Use F/B to review the path.\n"); + + MvWAddStr(helpwin, NOTIFYY - INSTRY, 0, + "Press `?' to go to game explanation"); +} + +static void +show_help(bool * keyhelp) +{ + werase(helpwin); + if (*keyhelp) { + help1(); + *keyhelp = FALSE; + } else { + help2(); + *keyhelp = TRUE; + } + wrefresh(helpwin); +} + +static bool +chksqr(int r1, int c1) +{ + if ((r1 < 0) || (r1 > BDEPTH - 1)) + return (FALSE); + if ((c1 < 0) || (c1 > BWIDTH - 1)) + return (FALSE); + return ((!board[r1][c1]) ? TRUE : FALSE); +} + +static bool +chkmoves(int rw, int col) +/* check to see if valid moves are available */ +{ + unsigned n; + + for (n = 0; n < SIZEOF(offsets); n++) + if (chksqr(rw + offsets[n].y, col + offsets[n].x)) + return (TRUE); + return (FALSE); +} + +static void +dosquares(void) +{ + int i, j; + + MvAddStr(0, 20, "KNIGHT'S MOVE -- a logical solitaire"); + + move(BOARDY, BOARDX); + waddch(boardwin, ACS_ULCORNER); + for (j = 0; j < 7; j++) { + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_TTEE); + } + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_URCORNER); + + for (i = 1; i < BDEPTH; i++) { + move(BOARDY + i * 2 - 1, BOARDX); + waddch(boardwin, ACS_VLINE); + for (j = 0; j < BWIDTH; j++) { + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ACS_VLINE); + } + move(BOARDY + i * 2, BOARDX); + waddch(boardwin, ACS_LTEE); + for (j = 0; j < BWIDTH - 1; j++) { + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_PLUS); + } + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_RTEE); + } + + move(BOARDY + i * 2 - 1, BOARDX); + waddch(boardwin, ACS_VLINE); + for (j = 0; j < BWIDTH; j++) { + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ' '); + waddch(boardwin, ACS_VLINE); + } + + move(BOARDY + i * 2, BOARDX); + waddch(boardwin, ACS_LLCORNER); + for (j = 0; j < BWIDTH - 1; j++) { + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_BTEE); + } + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_HLINE); + waddch(boardwin, ACS_LRCORNER); +} + +static void +mark_possibles(int prow, int pcol, 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); + waddch(boardwin, mark); + } + } +} + +static void +find_next_move(int *y, int *x) +{ + unsigned j, k; + int found = -1; + int first = -1; + int next = 0; + int oldy, oldx; + int newy, newx; + + 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 (first < 0) + first = (int) k; + if (newy == *y + && newx == *x) { + found = (int) k; + } else if (found >= 0) { + next = (int) k; + break; + } + } + } + if (found < 0) + next = first; + if (next >= 0) { + *y = oldy + offsets[next].y; + *x = oldx + offsets[next].x; + } + } else { + beep(); + } +} + +static void +unmarkcell(int row, int column) +{ + cellmove(row, column); + waddch(boardwin, '\b'); + waddch(boardwin, ' '); + waddch(boardwin, minus); + waddch(boardwin, ' '); +} + +static void +markcell(chtype tchar, int row, int column) +{ + cellmove(row, column); + waddch(boardwin, '\b'); + waddch(boardwin, tchar); + waddch(boardwin, tchar); + waddch(boardwin, tchar); +} + +static void +drawmove(chtype tchar, int oldy, int oldx, int row, int column) +/* place the stars, update board & currents */ +{ + if (movecount <= 1) { + int i, j; + + for (i = 0; i < BDEPTH; i++) { + for (j = 0; j < BWIDTH; j++) { + if (movecount == 0) { + unmarkcell(i, j); + } else { + cellmove(i, j); + if (winch(boardwin) == minus) + waddch(boardwin, movecount ? ' ' : minus); + } + } + } + } else { + markcell(tchar, oldy, oldx); + mark_possibles(oldy, oldx, ' '); + } + + if (row >= 0 && column >= 0) { + markcell(trail, row, column); + mark_possibles(row, column, minus); + board[row][column] = TRUE; + } + + wprintw(msgwin, "\nMove %d", movecount); + if (trialcount != movecount) + wprintw(msgwin, " (%d tries)", trialcount); + wclrtoeol(msgwin); +} + +static int +iabs(int num) +{ + if (num < 0) + return (-num); + else + return (num); +} + +static bool +evalmove(int row, int column) +/* evaluate move */ +{ + if (movecount == 1) + return (TRUE); + else if (board[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); + + if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1))) { + waddstr(msgwin, "\nThat's not a legal knight's move."); + return (FALSE); + } + } + + return (TRUE); +} + +static int +completed(void) +{ + int i, j, count = 0; + + for (i = 0; i < BDEPTH; i++) + for (j = 0; j < BWIDTH; j++) + if (board[i][j] != 0) + count += 1; + return (count == (BWIDTH * BDEPTH) ? -1 : count); +} + +static void +no_previous_move(void) +{ + waddstr(msgwin, "\nNo previous move."); + beep(); +} + +static void +play(void) +/* play the game */ +{ + bool keyhelp; /* TRUE if keystroke help is up */ + int i, j, count; + int lastcol = 0; /* last location visited */ + int lastrow = 0; + int ny = 0, nx = 0; + int review = 0; /* review history */ + int rw = 0, col = 0; /* current row and column */ + + do { + /* clear screen and draw board */ + werase(boardwin); + werase(helpwin); + werase(msgwin); + dosquares(); + help1(); + wnoutrefresh(stdscr); + wnoutrefresh(helpwin); + wnoutrefresh(msgwin); + wnoutrefresh(boardwin); + doupdate(); + + movecount = 0; + for (i = 0; i < BDEPTH; i++) { + for (j = 0; j < BWIDTH; j++) { + board[i][j] = FALSE; + unmarkcell(i, j); + } + } + memset(history, 0, sizeof(history)); + history[0].y = history[0].x = -1; + history[1].y = history[1].x = -1; + lastrow = lastcol = -2; + movecount = 1; + trialcount = 1; + keyhelp = FALSE; + show_help(&keyhelp); + + for (;;) { + if (rw != lastrow || col != lastcol) { + if (lastrow >= 0 && lastcol >= 0) { + cellmove(lastrow, lastcol); + if (board[lastrow][lastcol]) + waddch(boardwin, trail); + else + waddch(boardwin, oldch); + } + + cellmove(rw, col); + oldch = winch(boardwin); + + lastrow = rw; + lastcol = col; + } + cellmove(rw, col); + waddch(boardwin, plus); + cellmove(rw, col); + + wrefresh(msgwin); + + switch (wgetch(boardwin)) { + case 'k': + case '8': + case KEY_UP: + ny = rw + BDEPTH - 1; + nx = col; + break; + case 'j': + case '2': + case KEY_DOWN: + ny = rw + 1; + nx = col; + break; + case 'h': + case '4': + case KEY_LEFT: + ny = rw; + nx = col + BWIDTH - 1; + break; + case 'l': + case '6': + case KEY_RIGHT: + ny = rw; + nx = col + 1; + break; + case 'y': + case '7': + case KEY_A1: + ny = rw + BDEPTH - 1; + nx = col + BWIDTH - 1; + break; + case 'b': + case '1': + case KEY_C1: + ny = rw + 1; + nx = col + BWIDTH - 1; + break; + case 'u': + case '9': + case KEY_A3: + ny = rw + BDEPTH - 1; + nx = col + 1; + break; + case 'n': + case '3': + case KEY_C3: + ny = rw + 1; + nx = col + 1; + break; + +#ifdef NCURSES_MOUSE_VERSION + case KEY_MOUSE: + { + MEVENT myevent; + + getmouse(&myevent); + if (myevent.y >= CY(0) && myevent.y <= CY(BDEPTH) + && myevent.x >= CX(0) && myevent.x <= CX(BWIDTH)) { + nx = CXINV(myevent.x); + ny = CYINV(myevent.y); + ungetch('\n'); + break; + } else { + beep(); + continue; + } + } +#endif /* NCURSES_MOUSE_VERSION */ + + case KEY_B2: + case '\n': + case ' ': + review = 0; + if (evalmove(rw, col)) { + drawmove(trail, + history[movecount - 1].y, + history[movecount - 1].x, + rw, col); + history[movecount].y = (short) rw; + history[movecount].x = (short) col; + movecount++; + trialcount++; + + if (!chkmoves(rw, col)) { + if (completed() < 0) { + waddstr(msgwin, "\nYou won."); + } else { + waddstr(msgwin, + "\nNo further moves are possible."); + } + } + } else { + beep(); + } + break; + + case KEY_UNDO: + case KEY_BACKSPACE: + case '\b': + review = 0; + if (movecount <= 0) { + no_previous_move(); + } else if (movecount <= 1) { + ny = history[movecount].y; + nx = history[movecount].x; + if (nx < 0 || ny < 0) { + ny = lastrow; + nx = lastcol; + } + movecount = 0; + board[ny][nx] = FALSE; + oldch = minus; + drawmove(' ', ny, nx, -1, -1); + movecount = 1; + trialcount = 1; + no_previous_move(); + } else { + int oldy = history[movecount - 1].y; + int oldx = history[movecount - 1].x; + + if (!board[rw][col]) { + cellmove(rw, col); + waddch(boardwin, ' '); + } + + board[oldy][oldx] = FALSE; + --movecount; + ny = history[movecount - 1].y; + nx = history[movecount - 1].x; + if (nx < 0 || ny < 0) { + ny = oldy; + nx = oldx; + } + drawmove(' ', oldy, oldx, ny, nx); + + /* avoid problems if we just changed the current cell */ + cellmove(lastrow, lastcol); + oldch = winch(boardwin); + } + break; + + case 'a': + nx = col; + ny = rw; + find_next_move(&ny, &nx); + break; + + case 'F': + if (review > 0) { + review--; + ny = history[movecount - review - 1].y; + nx = history[movecount - review - 1].x; + } else { + beep(); + } + break; + + case 'B': + if (review < movecount - 2) { + review++; + ny = history[movecount - review - 1].y; + nx = history[movecount - review - 1].x; + } else { + beep(); + } + break; + + case KEY_REDO: + case '\f': + case 'r': + clearok(curscr, TRUE); + wnoutrefresh(stdscr); + wnoutrefresh(boardwin); + wnoutrefresh(msgwin); + wnoutrefresh(helpwin); + doupdate(); + break; + + case 'q': + case 'x': + goto dropout; + + case '?': + show_help(&keyhelp); + break; + + default: + beep(); + break; + } + + col = nx % BWIDTH; + rw = ny % BDEPTH; + } + + dropout: + if ((count = completed()) < 0) + wprintw(msgwin, "\nYou won. Care to try again? "); + else + wprintw(msgwin, "\n%d squares filled. Try again? ", count); + wclrtoeol(msgwin); + } while + (tolower(wgetch(msgwin)) == 'y'); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + init_program(); + + play(); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} + +/* knight.c ends here */ diff --git a/test/linedata.h b/test/linedata.h new file mode 100644 index 00000000000..2510ee72f64 --- /dev/null +++ b/test/linedata.h @@ -0,0 +1,100 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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. * + ****************************************************************************/ + +#define isQUIT(c) ((c) == QUIT || (c) == ESCAPE) + +#define key_RECUR CTRL('W') +#define key_NEWLINE CTRL('N') +#define key_BACKSPACE '\b' + +static FILE *linedata; + +static void +failed(const char *s) +{ + perror(s); + ExitProgram(EXIT_FAILURE); +} + +static void +init_linedata(const char *name) +{ + if ((linedata = fopen(name, "r")) == 0) { + failed(name); + } +} + +static int +read_linedata(WINDOW *work) +{ + int result; + if (linedata != 0) { + result = fgetc(linedata); + if (result == EOF) { + fclose(linedata); + linedata = 0; + result = read_linedata(work); + } else { + wrefresh(work); + if (result == '\n') { + result = key_NEWLINE; + } + } + } else { +#ifdef WIDE_LINEDATA + wint_t ch; + int code; + + result = ERR; + while ((code = wget_wch(work, &ch)) != ERR) { + + if (code == KEY_CODE_YES) { + switch (ch) { + case KEY_DOWN: + result = key_NEWLINE; + break; + case KEY_BACKSPACE: + result = key_BACKSPACE; + break; + default: + beep(); + continue; + } + } else if (code != ERR) { + result = (int) ch; + break; + } else { + break; + } + } +#else + result = wgetch(work); +#endif + } + return result; +} diff --git a/test/linux-color.dat b/test/linux-color.dat new file mode 100644 index 00000000000..528b3f0b61b --- /dev/null +++ b/test/linux-color.dat @@ -0,0 +1,48 @@ +############################################################################## +# Copyright (c) 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"), # +# 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: linux-color.dat,v 1.2 2006/04/22 21:40:00 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 */ +scale:255 +0: 0 0 0 +1: 170 0 0 +2: 0 170 0 +3: 170 85 0 +4: 0 0 170 +5: 170 0 170 +6: 0 170 170 +7: 170 170 170 +8: 85 85 85 +9: 255 85 85 +10: 85 255 85 +11: 255 255 85 +12: 85 85 255 +13: 255 85 255 +14: 85 255 255 +15: 255 255 255 diff --git a/test/listused.sh b/test/listused.sh new file mode 100755 index 00000000000..1c3fe0a64d5 --- /dev/null +++ b/test/listused.sh @@ -0,0 +1,183 @@ +#!/bin/sh +############################################################################## +# Copyright (c) 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"), # +# 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: listused.sh,v 1.8 2010/09/18 15:15:15 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 +# these options: +# --disable-macros +# --enable-sp-funcs +# --enable-widec +# Static libraries are used, to provide some filtering based on internal usage +# of the different symbols. + +# keep the sorting independent of locale: +if test "${LANGUAGE+set}" = set; then LANGUAGE=C; export LANGUAGE; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi + +NM_OPTS= + +if test ! -d ../objects ; then + echo "? need objects to run this script" + exit 1 +elif test ! -d ../lib ; then + echo "? need libraries to run this script" + exit 1 +fi + +PROGS= +for name in `(echo "test:";sort modules; echo "progs:";sort ../progs/modules) |sed -e 's/[ ].*//' -e '/^[#@]/d'` +do + case $name in + *:) + PROGS="$PROGS $name" + ;; + *) + NAME=../objects/${name}.o + if test -f $NAME + then + PROGS="$PROGS $NAME" + fi + ;; + esac +done + +# For each library - +for lib in ../lib/*.a +do + LIB=`basename $lib .a` + case $LIB in + *_*|*+*) + continue + ;; + esac + + tmp=`echo $LIB|sed -e 's/w$//'` + echo + echo "${tmp}:" + echo $tmp |sed -e 's/./-/g' + # Construct a list of public externals provided by the library. + WANT=`nm $NM_OPTS $lib |\ + sed -e 's/^[^ ]*//' \ + -e 's/^ *//' \ + -e '/^[ a-z] /d' \ + -e '/:$/d' \ + -e '/^$/d' \ + -e '/^U /d' \ + -e 's/^[A-Z] //' \ + -e '/^_/d' |\ + sort -u` + # List programs which use that external. + for name in $WANT + do + HAVE= + tags= + last= + for prog in $PROGS + do + case $prog in + *:) + tags=$prog + ;; + *) + TEST=`nm $NM_OPTS $prog |\ + sed -e 's/^[^ ]*//' \ + -e 's/^ *//' \ + -e '/^[ a-z] /d' \ + -e '/:$/d' \ + -e '/^$/d' \ + -e 's/^[A-Z] //' \ + -e '/^_/d' \ + -e 's/^'${name}'$/_/' \ + -e '/^[^_]/d'` + if test -n "$TEST" + then + have=`basename $prog .o` + if test -n "$HAVE" + then + if test "$last" = "$tags" + then + HAVE="$HAVE $have" + else + HAVE="$HAVE $tags $have" + fi + else + HAVE="$tags $have" + fi + last="$tags" + fi + ;; + esac + done + # if we did not find a program using it directly, see if it + # is used within a library. + if test -z "$HAVE" + then + for tmp in ../lib/*.a + do + case $tmp in + *_*|*+*) + continue + ;; + esac + TEST=`nm $NM_OPTS $tmp |\ + sed -e 's/^[^ ]*//' \ + -e 's/^ *//' \ + -e '/^[ a-z] /d' \ + -e '/:$/d' \ + -e '/^$/d' \ + -e '/^[A-TV-Z] /d' \ + -e 's/^[A-Z] //' \ + -e '/^_/d' \ + -e 's/^'${name}'$/_/' \ + -e '/^[^_]/d'` + if test -n "$TEST" + then + tmp=`basename $tmp .a |sed -e 's/w$//'` + HAVE=`echo $tmp | sed -e 's/lib/lib: /'` + break + fi + done + fi + test -z "$HAVE" && HAVE="-" + lenn=`expr 39 - length $name` + lenn=`expr $lenn / 8` + tabs= + while test $lenn != 0 + do + tabs="${tabs} " + lenn=`expr $lenn - 1` + done + echo "${name}${tabs}${HAVE}" + done +done diff --git a/test/lrtest.c b/test/lrtest.c new file mode 100644 index 00000000000..da12034ce08 --- /dev/null +++ b/test/lrtest.c @@ -0,0 +1,182 @@ +/**************************************************************************** + * Copyright (c) 1998-2005,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"), 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. * + ****************************************************************************/ +/* + * Test lower-right-hand corner access + * + * originally by Eric S. Raymond , written for animation + * and resizing -T.Dickey + * + * 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 $ + */ + +#include + +typedef struct { + int y, x, mode, dir, inc; + chtype value; +} MARK; + +/* + * Make a couple of markers go 'round the border to demonstrate that we can + * really write to all positions properly. + */ +static void +show(MARK *m) +{ + MvAddCh(m->y, m->x, m->value); + if (m->mode == 0) { /* along the x-direction */ + m->x += m->inc; + if (m->x >= COLS) { + m->x = COLS - 1; + m->inc = -m->dir * m->inc; + m->y += m->inc; + m->mode = 1; + } else if (m->x < 0) { + m->x = 0; + m->inc = -m->dir * m->inc; + m->y += m->inc; + m->mode = 1; + } + } else { /* along the y-direction */ + m->y += m->inc; + if (m->y >= LINES) { + m->y = LINES - 1; + m->inc = m->dir * m->inc; + m->x += m->inc; + m->mode = 0; + } else if (m->y < 0) { + m->y = 0; + m->inc = m->dir * m->inc; + m->x += m->inc; + m->mode = 0; + } + } +} + +int +main( + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + static MARK marks[] = + { + {0, 0, 0, -1, 1, '+' | A_BOLD}, + {0, 0, 1, 1, 2, 'X'}, + {0, 0, 1, -1, 3, 'Y'}, + {0, 8, 0, -1, 1, '+' | A_BOLD}, + {0, 9, 0, -1, 1, '+' | A_BOLD}, + {1, 0, 1, 1, 1, '*' | A_REVERSE}, + {2, 0, 1, 1, 1, '*' | A_REVERSE} + }; + + setlocale(LC_ALL, ""); + + initscr(); + noecho(); + cbreak(); + nodelay(stdscr, TRUE); + curs_set(0); + +#ifdef KEY_RESIZE + keypad(stdscr, TRUE); + restart: +#endif + move(LINES / 2 - 1, 4); + if (!(has_ic() +#if HAVE_SETUPTERM + /* see PutCharLR() */ + || auto_right_margin + || (enter_am_mode && exit_am_mode) +#endif + )) { + addstr("Your terminal lacks the capabilities needed to address the\n"); + move(LINES / 2, 4); + addstr("lower-right-hand corner of the screen.\n"); + } else { + addstr("This is a test of access to the lower right corner.\n"); + move(LINES / 2, 4); + addstr("If the top of the box is missing, the test failed.\n"); + move(LINES / 2 + 1, 4); + addstr("Please report this (with a copy of your terminfo entry).\n"); + move(LINES / 2 + 2, 4); + addstr("to the ncurses maintainers, at bug-ncurses@gnu.org.\n"); + } + + for (;;) { + int ch; + unsigned n; + + box(stdscr, 0, 0); + for (n = 0; n < SIZEOF(marks); n++) { + show(&marks[n]); + } + + if ((ch = getch()) > 0) { + if (ch == 'q') + break; + else if (ch == 's') + nodelay(stdscr, FALSE); + else if (ch == ' ') + nodelay(stdscr, TRUE); +#ifdef TRACE + else if (ch == 'T') + trace(0); + else if (ch == 't') + trace(TRACE_CALLS | TRACE_ICALLS | TRACE_UPDATE); +#endif +#ifdef KEY_RESIZE + else if (ch == KEY_RESIZE) { + for (n = 0; n < SIZEOF(marks); n++) { + if (marks[n].mode == 0) { /* moving along x-direction */ + if (marks[n].y) + marks[n].y = LINES - 1; + } else { + if (marks[n].x) + marks[n].x = COLS - 1; + } + } + flash(); + erase(); + wrefresh(curscr); + goto restart; + } +#endif + } + napms(50); + refresh(); + } + + curs_set(1); + endwin(); + ExitProgram(EXIT_SUCCESS); +} + +/* lrtest.c ends here */ diff --git a/test/make-tar.sh b/test/make-tar.sh new file mode 100755 index 00000000000..f468e2321bf --- /dev/null +++ b/test/make-tar.sh @@ -0,0 +1,83 @@ +#!/bin/sh +# $Id: make-tar.sh,v 1.4 2010/11/06 18:31:46 tom Exp $ +############################################################################## +# Copyright (c) 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"), # +# 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. # +############################################################################## +# Construct a tar-file containing only the test tree as well as its associated +# scripts. The reason for doing that is to simplify distributing the test +# programs as a separate package. + +TARGET=`pwd` + +: ${ROOTNAME:=ncurses-test} +: ${DESTDIR:=$TARGET} +: ${TMPDIR:=/tmp} + +# This can be run from either the test subdirectory, or from the top-level +# source directory. We will put the tar file in the original directory. +test -d ./test && cd ./test + +BUILD=$TMPDIR/make-tar$$ +trap "cd /; rm -rf $BUILD; exit 0" 0 1 2 5 15 + +umask 077 +if ! ( mkdir $BUILD ) +then + echo "? cannot make build directory $BUILD" +fi + +umask 022 +mkdir $BUILD/$ROOTNAME + +cp -p -r * $BUILD/$ROOTNAME/ || exit + +# Add the config.* utility scripts from the top-level directory. +for i in . .. +do + for j in config.guess config.sub install-sh tar-copy.sh + do + test -f $i/$j && cp -p $i/$j $BUILD/$ROOTNAME/ + done +done + +cd $BUILD || exit + +# There is no need for this script in the tar file. +rm -f $ROOTNAME/make-tar.sh + +# Remove build-artifacts. +find . -name RCS -exec rm -rf {} \; +find . -name "*.gz" -exec rm -rf {} \; + +# Make the files writable... +chmod -R u+w . + +tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz +cd $DESTDIR + +pwd +ls -l $ROOTNAME.tar.gz diff --git a/test/mk-test.awk b/test/mk-test.awk new file mode 100644 index 00000000000..df560ebfa64 --- /dev/null +++ b/test/mk-test.awk @@ -0,0 +1,132 @@ +# $Id: mk-test.awk,v 1.12 2010/11/06 23:06:48 tom Exp $ +############################################################################## +# Copyright (c) 2006-2007,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"), # +# 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 +# +# generate Makefile for ncurses tests. +BEGIN { + first = 1; + count = 0; + } +/^#/ { + next; + } +/^$/ { + next; + } + { + if (first) { + print "# generated by mk-test.awk\n"; + first = 0; + } + progs[count] = $1; + flags[count] = $2; + using[count] = $3; + files[count] = ""; + for (n = 4; n <= NF; ++n) { + files[count] = sprintf("%s $(MODEL)/%s$o", files[count], $n); + } + count = count + 1; + } +END { + for (n = 0; n < count; ++n) { + if (n == 0) { + printf "TESTS\t= "; + } else { + printf "\t "; + } + printf "$(destdir)%s$x", progs[n]; + if (n < count - 1) { + printf " \\"; + } + print ""; + } + print "" + print "all: $(TESTS)" + print "" + print "sources:" + print "" + print "tags:" + print " $(CTAGS) *.[ch]" + print "" + print "# no libraries here" + print "libs \\" + print "install.libs \\" + print "uninstall.libs:" + print "" + 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 " dst=`echo $$src | $(TRANSFORM)`; \\" + print " $(INSTALL_PROG) $$src $(BINDIR)/$$dst; \\" + print " done'" + print "" + print "uninstall \\" + print "uninstall.test:" + print " $(SHELL) -c 'for src in $(TESTS); do \\" + print " dst=`echo $$src | $(TRANSFORM)`; \\" + print " rm -f $(BINDIR)/$$dst; \\" + print " done'" + } else { + print "install \\" + print "install.test \\" + print "uninstall \\" + print "uninstall.test:" + } + print "" + print "mostlyclean ::" + print " -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace" + 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 "" + print "distclean :: clean" + print " -rm -f Makefile ncurses_cfg.h config.status config.log" + print "" + print "realclean :: distclean" + 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 " mkdir -p $@" + + + if (ECHO_LINK != "") { + ECHO_LINK="@ echo linking $@ ... ;" + } + for (n = 0; n < count; ++n) { + print ""; + printf "$(destdir)%s$x:%s %s\n", progs[n], files[n], using[n]; + printf "\t%s$(LINK) -o $@%s %s\n", ECHO_LINK, files[n], flags[n]; + } + + } diff --git a/test/modules b/test/modules new file mode 100644 index 00000000000..67c019e7716 --- /dev/null +++ b/test/modules @@ -0,0 +1,96 @@ +# $Id: modules,v 1.43 2010/01/23 17:51:38 tom Exp $ +############################################################################## +# Copyright (c) 1998-2009,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"), # +# 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 1997-on +# +# Test-Program modules + +@ base +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) +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_panels progs $(srcdir) $(HEADER_DEPS) ../include/panel.h +demo_termcap progs $(srcdir) $(HEADER_DEPS) +demo_terminfo progs $(srcdir) $(HEADER_DEPS) +ditto progs $(srcdir) $(HEADER_DEPS) +dots progs $(srcdir) $(HEADER_DEPS) +dots_mvcur progs $(srcdir) $(HEADER_DEPS) +echochar progs $(srcdir) $(HEADER_DEPS) +edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h +filter progs $(srcdir) $(HEADER_DEPS) +firework progs $(srcdir) $(HEADER_DEPS) +firstlast progs $(srcdir) $(HEADER_DEPS) +foldkeys progs $(srcdir) $(HEADER_DEPS) +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) +ins_wide progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h +insdelln progs $(srcdir) $(HEADER_DEPS) +inserts progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h +key_names progs $(srcdir) $(HEADER_DEPS) +keynames progs $(srcdir) $(HEADER_DEPS) +knight progs $(srcdir) $(HEADER_DEPS) +lrtest progs $(srcdir) $(HEADER_DEPS) +movewindow progs $(srcdir) $(HEADER_DEPS) +ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h +newdemo progs $(srcdir) $(HEADER_DEPS) +railroad progs $(srcdir) $(HEADER_DEPS) +rain progs $(srcdir) $(HEADER_DEPS) +redraw progs $(srcdir) $(HEADER_DEPS) +savescreen 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 +test_addstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h +test_addwstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h +test_arrays progs $(srcdir) $(HEADER_DEPS) +test_get_wstr progs $(srcdir) $(HEADER_DEPS) +test_getstr progs $(srcdir) $(HEADER_DEPS) +test_instr progs $(srcdir) $(HEADER_DEPS) +test_inwstr progs $(srcdir) $(HEADER_DEPS) +test_opaque progs $(srcdir) $(HEADER_DEPS) +testaddch progs $(srcdir) $(HEADER_DEPS) +testcurs progs $(srcdir) $(HEADER_DEPS) +testscanw progs $(srcdir) $(HEADER_DEPS) +view progs $(srcdir) $(HEADER_DEPS) +worm progs $(srcdir) $(HEADER_DEPS) +xmas progs $(srcdir) $(HEADER_DEPS) + +# vile:makemode diff --git a/test/movewindow.c b/test/movewindow.c new file mode 100644 index 00000000000..e55a694a084 --- /dev/null +++ b/test/movewindow.c @@ -0,0 +1,639 @@ +/**************************************************************************** + * Copyright (c) 2006-2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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: movewindow.c,v 1.24 2010/11/13 23:34:55 tom Exp $ + * + * Demonstrate move functions for windows and derived windows from the curses + * library. + * + * Thomas Dickey - 2006/2/11 + */ +/* +derwin +mvderwin +subwin +mvwin + */ + +#include +#include + +#ifdef HAVE_XCURSES +#undef derwin +#endif + +#ifdef NCURSES_VERSION +#define CONST_FMT const +#else +#define CONST_FMT /* nothing */ +#endif + +#undef LINE_MAX + +#define LINE_MIN 2 +#define LINE_MAX (LINES - 2) +#define COL_MIN 2 +#define COL_MAX (COLS - 2) + +typedef struct { + int y, x; +} PAIR; + +typedef struct { + WINDOW *parent; /* need this since WINDOW->_parent is not portable */ + 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 unsigned num_windows; +static FRAME *all_windows; + +static void +message(int lineno, CONST_FMT char *fmt, va_list argp) +{ + int y, x; + + getyx(stdscr, y, x); + move(lineno, 0); + clrtoeol(); + +#ifdef HAVE_XCURSES + { + char buffer[1024]; + vsprintf(buffer, fmt, argp); + addstr(buffer); + } +#else + vwprintw(stdscr, fmt, argp); +#endif + + move(y, x); + refresh(); +} + +static void +head_line(CONST_FMT char *fmt,...) +{ + va_list argp; + + va_start(argp, fmt); + message(0, fmt, argp); + va_end(argp); +} + +static void +tail_line(CONST_FMT char *fmt,...) +{ + va_list argp; + + va_start(argp, fmt); + message(LINES - 1, fmt, argp); + va_end(argp); +} + +/* + * Arrow keys move cursor, return location at current on non-arrow key. + */ +static PAIR * +selectcell(WINDOW *parent, int uli, int ulj, int lri, int lrj) +{ + static PAIR res; /* result cell */ + int si = lri - uli + 1; /* depth of the select area */ + int sj = lrj - ulj + 1; /* width of the select area */ + int i = 0, j = 0; /* offsets into the select area */ + + res.y = uli; + res.x = ulj; + for (;;) { + tail_line("Upper left [%2d,%2d] Lower right [%2d,%2d] -> %d,%d", + uli, ulj, + lri, lrj, + uli + i, ulj + j); + wmove(parent, uli + i, ulj + j); + + switch (wgetch(parent)) { + case KEY_UP: + i += si - 1; + break; + case KEY_DOWN: + i++; + break; + case KEY_LEFT: + j += sj - 1; + break; + case KEY_RIGHT: + j++; + break; + case QUIT: + case ESCAPE: + return ((PAIR *) 0); +#ifdef NCURSES_MOUSE_VERSION + case KEY_MOUSE: + { + MEVENT event; + + getmouse(&event); + if (event.y > uli && event.x > ulj) { + i = event.y - uli; + j = event.x - ulj; + } else { + beep(); + break; + } + } + /* FALLTHRU */ +#endif + default: + res.y = uli + i; + res.x = ulj + j; + return (&res); + } + i %= si; + j %= sj; + } +} + +/* + * Ask user for a window definition. + */ +static bool +getwindow(WINDOW *parent, PAIR * ul, PAIR * lr) +{ + int min_col = (parent == stdscr) ? COL_MIN : 0; + int max_col = (parent == stdscr) ? COL_MAX : getmaxx(parent); + int min_line = (parent == stdscr) ? LINE_MIN : 0; + int max_line = (parent == stdscr) ? LINE_MAX : getmaxy(parent); + PAIR *tmp; + bool result = FALSE; + + head_line("Use arrows to move cursor, anything else to mark corner 1"); + if ((tmp = selectcell(parent, min_line, min_col, max_line, max_col)) != 0) { + *ul = *tmp; + MvWAddCh(parent, ul->y, ul->x, '*'); + + head_line("Use arrows to move cursor, anything else to mark corner 2"); + if ((tmp = selectcell(parent, ul->y, ul->x, max_line, max_col)) != 0) { + *lr = *tmp; + MvWAddCh(parent, lr->y, lr->x, '*'); + wmove(parent, lr->y, lr->x); + wsyncdown(parent); + wrefresh(parent); + result = (lr->y != ul->y && lr->x != ul->x); + } + } + head_line("done"); + return result; +} + +/* + * Draw a box inside the given window. + */ +static void +box_inside(WINDOW *win) +{ + int y0, x0; + int y1, x1; + + getyx(win, y0, x0); + getmaxyx(win, y1, x1); + + MvWHLine(win, 0, 0, ACS_HLINE, x1); + MvWHLine(win, y1 - 1, 0, ACS_HLINE, x1); + + MvWVLine(win, 0, 0, ACS_VLINE, y1); + MvWVLine(win, 0, x1 - 1, ACS_VLINE, y1); + + MvWAddCh(win, 0, 0, ACS_ULCORNER); + MvWAddCh(win, y1 - 1, 0, ACS_LLCORNER); + MvWAddCh(win, 0, x1 - 1, ACS_URCORNER); + MvWAddCh(win, y1 - 1, x1 - 1, ACS_LRCORNER); + + wsyncdown(win); + wmove(win, y0, x0); + wrefresh(win); +} + +/* + * Add a window to our list. + */ +static void +add_window(WINDOW *parent, WINDOW *child) +{ + static unsigned have = 0; + unsigned need = ((num_windows + 1) | 31) + 1; + + keypad(child, TRUE); + if (need > have) { + all_windows = typeRealloc(FRAME, need, all_windows); + } + all_windows[num_windows].parent = parent; + all_windows[num_windows].child = child; + num_windows++; +} + +static int +window2num(WINDOW *win) +{ + int n; + int result = -1; + for (n = 0; n < (int) num_windows; ++n) { + if (win == all_windows[n].child) { + result = n; + break; + } + } + return result; +} + +static WINDOW * +parent_of(WINDOW *win) +{ + WINDOW *result = 0; + int n = window2num(win); + if (n >= 0) + result = all_windows[n].parent; + return result; +} + +static void +repaint_one(WINDOW *win) +{ + touchwin(win); + wnoutrefresh(win); +} + +static void +refresh_all(WINDOW *win) +{ + unsigned n; + + for (n = 0; n < num_windows; ++n) { + if (all_windows[n].child != win) { + repaint_one(all_windows[n].child); + } + } + + repaint_one(win); + doupdate(); +} + +static WINDOW * +next_window(WINDOW *win) +{ + WINDOW *result = win; + int n = window2num(win); + + if (n++ >= 0) { + result = all_windows[(unsigned) n % num_windows].child; + wmove(result, 0, 0); + wrefresh(result); + } + return result; +} + +static WINDOW * +prev_window(WINDOW *win) +{ + WINDOW *result = win; + int n = window2num(win); + + if (n-- >= 0) { + if (n < 0) + n = (int) (num_windows - 1); + result = all_windows[(unsigned) n % num_windows].child; + wmove(result, 0, 0); + wrefresh(result); + } + return result; +} + +static void +recur_move_window(WINDOW *parent, int dy, int dx) +{ + unsigned n; + + for (n = 0; n < num_windows; ++n) { + if (all_windows[n].parent == parent) { + int y0, x0; + + getbegyx(all_windows[n].child, y0, x0); + mvwin(all_windows[n].child, y0 + dy, x0 + dx); + recur_move_window(all_windows[n].child, dy, dx); + } + } +} + +/* + * test mvwin(). + */ +static bool +move_window(WINDOW *win, bool recur) +{ + WINDOW *parent = parent_of(win); + bool result = FALSE; + + if (parent != 0) { + bool top = (parent == stdscr); + int min_col = top ? COL_MIN : 0; + int max_col = top ? COL_MAX : getmaxx(parent); + int min_line = top ? LINE_MIN : 0; + int max_line = top ? LINE_MAX : getmaxy(parent); + PAIR *tmp; + + head_line("Select new position for %swindow", top ? "" : "sub"); + + if ((tmp = selectcell(parent, + min_line, min_col, + max_line, max_col)) != 0) { + int y0, x0; + getbegyx(parent, y0, x0); + /* + * Note: Moving a subwindow has the effect of moving a viewport + * around the screen. The parent window retains the contents of + * the subwindow in the original location, but the viewport will + * show the contents (again) at the new location. So it will look + * odd when testing. + */ + if (mvwin(win, y0 + tmp->y, x0 + tmp->x) != ERR) { + if (recur) { + recur_move_window(win, tmp->y, tmp->x); + } + refresh_all(win); + doupdate(); + result = TRUE; + } + } + } + return result; +} + +/* + * test mvderwin(). + */ +static bool +move_subwin(WINDOW *win) +{ + WINDOW *parent = parent_of(win); + bool result = FALSE; + + if (parent != 0) { + bool top = (parent == stdscr); + if (!top) { + int min_col = top ? COL_MIN : 0; + int max_col = top ? COL_MAX : getmaxx(parent); + int min_line = top ? LINE_MIN : 0; + int max_line = top ? LINE_MAX : getmaxy(parent); + PAIR *tmp; + + head_line("Select new position for subwindow"); + + if ((tmp = selectcell(parent, + min_line, min_col, + max_line, max_col)) != 0) { + int y0, x0; + getbegyx(parent, y0, x0); + if (mvderwin(win, y0 + tmp->y, x0 + tmp->x) != ERR) { + refresh_all(win); + doupdate(); + result = TRUE; + } + } + } + } + return result; +} + +static void +fill_window(WINDOW *win, chtype ch) +{ + int y, x; + int y0, x0; + int y1, x1; + + getyx(win, y0, x0); + getmaxyx(win, y1, x1); + for (y = 0; y < y1; ++y) { + for (x = 0; x < x1; ++x) { + MvWAddCh(win, y, x, ch); + } + } + wsyncdown(win); + wmove(win, y0, x0); + wrefresh(win); +} + +#define lines_of(ul,lr) (lr.y - ul.y + 1) +#define cols_of(ul,lr) (lr.x - ul.x + 1) +#define pair_of(ul) ul.y, ul.x + +static WINDOW * +create_my_window(WINDOW *current) +{ + PAIR ul, lr; + WINDOW *result = 0; + + if (getwindow(stdscr, &ul, &lr)) { + result = newwin(lines_of(ul, lr), cols_of(ul, lr), pair_of(ul)); + if (result != 0) { + fill_window(result, 'c'); + add_window(stdscr, result); + } + } + if (result == 0) + result = current; + return result; +} + +static WINDOW * +create_my_derwin(WINDOW *parent) +{ + PAIR ul, lr; + WINDOW *result = 0; + + if (getwindow(parent, &ul, &lr)) { + result = derwin(parent, lines_of(ul, lr), cols_of(ul, lr), pair_of(ul)); + if (result != 0) { + fill_window(result, 'd'); + add_window(parent, result); + } + } + if (result == 0) + result = parent; + return result; +} + +static WINDOW * +create_my_subwin(WINDOW *parent) +{ + PAIR ul, lr; + WINDOW *result = 0; + + if (getwindow(parent, &ul, &lr)) { + result = subwin(parent, + lines_of(ul, lr), + cols_of(ul, lr), + ul.y + getbegy(parent), + ul.x + getbegx(parent)); + if (result != 0) { + fill_window(result, 's'); + add_window(parent, result); + } + } + if (result == 0) + result = parent; + return result; +} + +static void +show_help(WINDOW *current) +{ + /* *INDENT-OFF* */ + static struct { + int key; + CONST_FMT char * msg; + } help[] = { + { '?', "Show this screen" }, + { 'b', "Draw a box inside the current window" }, + { 'c', "Create a new window" }, + { 'd', "Create a new derived window" }, + { 'f', "Fill the current window with the next character" }, + { 'm', "Move the current window" }, + { 'M', "Move the current window (and its children)" }, + { 'q', "Quit" }, + { 's', "Create a new subwindow" }, + { 't', "Move the current subwindow (moves content)" }, + { CTRL('L'), "Repaint all windows, doing current one last" }, + { CTRL('N'), "Cursor to next window" }, + { CTRL('P'), "Cursor to previous window" }, + }; + /* *INDENT-ON* */ + + WINDOW *mywin = newwin(LINES, COLS, 0, 0); + int row; + + 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); + } + box_inside(mywin); + wmove(mywin, 1, 1); + wgetch(mywin); + delwin(mywin); + refresh_all(current); +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + WINDOW *current_win; + int ch; + bool done = FALSE; + + initscr(); + cbreak(); + noecho(); + nonl(); + intrflush(stdscr, FALSE); + + add_window(0, current_win = stdscr); + +#ifdef NCURSES_MOUSE_VERSION + (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); +#endif /* NCURSES_MOUSE_VERSION */ + + while (!done && (ch = wgetch(current_win)) != ERR) { + switch (ch) { + case '?': + show_help(current_win); + break; + case 'b': + box_inside(current_win); + break; + case 'c': + current_win = create_my_window(current_win); + break; + case 'd': + current_win = create_my_derwin(current_win); + break; + case 'f': + fill_window(current_win, (chtype) wgetch(current_win)); + break; + case 'm': + case 'M': + if (!move_window(current_win, (ch == 'M'))) { + tail_line("error"); + continue; + } + break; + case 'q': + done = TRUE; + break; + case 's': + current_win = create_my_subwin(current_win); + break; + case 't': + if (!move_subwin(current_win)) { + tail_line("error"); + continue; + } + break; + case CTRL('L'): + refresh_all(current_win); + break; + case CTRL('N'): + current_win = next_window(current_win); + break; + case CTRL('P'): + current_win = prev_window(current_win); + break; +#if 0 + /* want to allow cursor to move around the current window too */ + /* want to test the resizing of windows and subwindows too */ + /* want to allow deleting a window also */ +#endif + default: + tail_line("unrecognized key (use '?' for help)"); + beep(); + continue; + } + tail_line("size [%d,%d] begin [%d,%d] parent [%d,%d]", + getmaxy(current_win), + getmaxx(current_win), + getbegy(current_win), + getbegx(current_win), + getpary(current_win), + getparx(current_win)); + wmove(current_win, 0, 0); + } + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/ncurses.c b/test/ncurses.c new file mode 100644 index 00000000000..5a422cf1a8c --- /dev/null +++ b/test/ncurses.c @@ -0,0 +1,6847 @@ +/**************************************************************************** + * Copyright (c) 1998-2010,2011 Free 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. * + ****************************************************************************/ +/**************************************************************************** + +NAME + ncurses.c --- ncurses library exerciser + +SYNOPSIS + ncurses + +DESCRIPTION + An interactive test module for the ncurses library. + +AUTHOR + Author: Eric S. Raymond 1993 + Thomas E. Dickey (beginning revision 1.27 in 1996). + +$Id: ncurses.c,v 1.365 2011/01/22 19:48:33 tom Exp $ + +***************************************************************************/ + +#include + +#ifdef __hpux +#undef mvwdelch /* HPUX 11.23 macro will not compile */ +#endif + +#if HAVE_GETTIMEOFDAY +#if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT +#include +#endif +#if HAVE_SYS_SELECT_H +#include +#endif +#endif + +#if USE_LIBPANEL +#include +#endif + +#if USE_LIBMENU +#include +#endif + +#if USE_LIBFORM +#include +#endif + +#ifdef NCURSES_VERSION + +#define NCURSES_CONST_PARAM const void + +#ifdef TRACE +static unsigned save_trace = TRACE_ORDINARY | TRACE_ICALLS | TRACE_CALLS; +extern unsigned _nc_tracing; +#endif + +#else + +#define NCURSES_CONST_PARAM char + +#define mmask_t chtype /* not specified in XSI */ + +#ifndef ACS_S3 +#ifdef CURSES_ACS_ARRAY +#define ACS_S3 (CURSES_ACS_ARRAY['p']) /* scan line 3 */ +#define ACS_S7 (CURSES_ACS_ARRAY['r']) /* scan line 7 */ +#define ACS_LEQUAL (CURSES_ACS_ARRAY['y']) /* less/equal */ +#define ACS_GEQUAL (CURSES_ACS_ARRAY['z']) /* greater/equal */ +#define ACS_PI (CURSES_ACS_ARRAY['{']) /* Pi */ +#define ACS_NEQUAL (CURSES_ACS_ARRAY['|']) /* not equal */ +#define ACS_STERLING (CURSES_ACS_ARRAY['}']) /* UK pound sign */ +#else +#define ACS_S3 (A_ALTCHARSET + 'p') /* scan line 3 */ +#define ACS_S7 (A_ALTCHARSET + 'r') /* scan line 7 */ +#define ACS_LEQUAL (A_ALTCHARSET + 'y') /* less/equal */ +#define ACS_GEQUAL (A_ALTCHARSET + 'z') /* greater/equal */ +#define ACS_PI (A_ALTCHARSET + '{') /* Pi */ +#define ACS_NEQUAL (A_ALTCHARSET + '|') /* not equal */ +#define ACS_STERLING (A_ALTCHARSET + '}') /* UK pound sign */ +#endif +#endif /* ACS_S3 */ + +#ifndef WACS_S3 +#ifdef CURSES_WACS_ARRAY +#define WACS_S3 (&(CURSES_WACS_ARRAY['p'])) /* scan line 3 */ +#define WACS_S7 (&(CURSES_WACS_ARRAY['r'])) /* scan line 7 */ +#define WACS_LEQUAL (&(CURSES_WACS_ARRAY['y'])) /* less/equal */ +#define WACS_GEQUAL (&(CURSES_WACS_ARRAY['z'])) /* greater/equal */ +#define WACS_PI (&(CURSES_WACS_ARRAY['{'])) /* Pi */ +#define WACS_NEQUAL (&(CURSES_WACS_ARRAY['|'])) /* not equal */ +#define WACS_STERLING (&(CURSES_WACS_ARRAY['}'])) /* UK pound sign */ +#endif +#endif + +#endif + +#if HAVE_WCSRTOMBS +#define count_wchars(src, len, state) wcsrtombs(0, &src, len, state) +#define trans_wchars(dst, src, len, state) wcsrtombs(dst, &src, len, state) +#define reset_wchars(state) init_mb(state) +#elif HAVE_WCSTOMBS && HAVE_MBTOWC && HAVE_MBLEN +#define count_wchars(src, len, state) wcstombs(0, src, len) +#define trans_wchars(dst, src, len, state) wcstombs(dst, src, len) +#define reset_wchars(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) +#define state_unused +#endif + +#if HAVE_MBSRTOWCS +#define count_mbytes(src, len, state) mbsrtowcs(0, &src, len, state) +#define trans_mbytes(dst, src, len, state) mbsrtowcs(dst, &src, len, state) +#define reset_mbytes(state) init_mb(state) +#elif HAVE_MBSTOWCS && HAVE_MBTOWC && HAVE_MBLEN +#define count_mbytes(src, len, state) mbstowcs(0, src, len) +#define trans_mbytes(dst, src, len, state) mbstowcs(dst, src, len) +#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) +#define state_unused +#endif + +#define ToggleAcs(temp,real) temp = ((temp == real) ? 0 : 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 */ + +#undef max_pairs +static int max_pairs; /* ...and the number of color pairs */ + +typedef struct { + short red; + short green; + short blue; +} RGB_DATA; + +static RGB_DATA *all_colors; + +static void main_menu(bool); + +/* 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); + touchwin(curscr); + wrefresh(curscr); +} + +static bool +isQuit(int c) +{ + return ((c) == QUIT || (c) == ESCAPE); +} +#define case_QUIT QUIT: case ESCAPE + +/* Common function to allow ^T to toggle trace-mode in the middle of a test + * so that trace-files can be made smaller. + */ +static int +wGetchar(WINDOW *win) +{ + int c; +#ifdef TRACE + while ((c = wgetch(win)) == CTRL('T')) { + if (_nc_tracing) { + save_trace = _nc_tracing; + Trace(("TOGGLE-TRACING OFF")); + _nc_tracing = 0; + } else { + _nc_tracing = save_trace; + } + trace(_nc_tracing); + if (_nc_tracing) + Trace(("TOGGLE-TRACING ON")); + } +#else + c = wgetch(win); +#endif + return c; +} +#define Getchar() wGetchar(stdscr) + +/* 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; + bool done = FALSE; + + echo(); + getyx(win, y0, x0); + (void) wattrset(win, A_REVERSE); + + x = (int) strlen(buffer); + while (!done) { + if (x > (int) strlen(buffer)) + x = (int) strlen(buffer); + wmove(win, y0, x0); + wprintw(win, "%-*s", limit, buffer); + wmove(win, y0, x0 + x); + switch (ch = wGetchar(win)) { + case '\n': + case KEY_ENTER: + done = TRUE; + break; + case CTRL('U'): + *buffer = '\0'; + break; + case '\b': + case KEY_BACKSPACE: + case KEY_DC: + if (x > 0) { + int j; + for (j = --x; (buffer[j] = buffer[j + 1]) != '\0'; ++j) { + ; + } + } else { + beep(); + } + break; + case KEY_LEFT: + if (x > 0) { + --x; + } else { + flash(); + } + break; + case KEY_RIGHT: + ++x; + break; + default: + if (!isprint(ch) || ch >= KEY_MIN) { + beep(); + } else if ((int) strlen(buffer) < limit) { + int j; + for (j = (int) strlen(buffer) + 1; j > x; --j) { + buffer[j] = buffer[j - 1]; + } + buffer[x++] = (char) ch; + } else { + flash(); + } + } + } + + wattroff(win, A_REVERSE); + wmove(win, y0, x0); + noecho(); +} + +#if USE_WIDEC_SUPPORT +static wchar_t +fullwidth_of(int ch) +{ + return (ch + 0xff10 - '0'); +} + +static void +make_fullwidth_text(wchar_t *target, const char *source) +{ + int ch; + while ((ch = *source++) != 0) { + *target++ = fullwidth_of(ch); + } + *target = 0; +} + +static void +make_narrow_text(wchar_t *target, const char *source) +{ + int ch; + while ((ch = *source++) != 0) { + *target++ = ch; + } + *target = 0; +} + +#if USE_LIBPANEL +static void +make_fullwidth_digit(cchar_t *target, int digit) +{ + wchar_t source[2]; + + source[0] = fullwidth_of(digit + '0'); + source[1] = 0; + setcchar(target, source, A_NORMAL, 0, 0); +} +#endif + +static int +wGet_wchar(WINDOW *win, wint_t *result) +{ + int c; +#ifdef TRACE + while ((c = wget_wch(win, result)) == CTRL('T')) { + if (_nc_tracing) { + save_trace = _nc_tracing; + Trace(("TOGGLE-TRACING OFF")); + _nc_tracing = 0; + } else { + _nc_tracing = save_trace; + } + trace(_nc_tracing); + if (_nc_tracing) + Trace(("TOGGLE-TRACING ON")); + } +#else + c = wget_wch(win, result); +#endif + return c; +} +#define Get_wchar(result) wGet_wchar(stdscr, result) + +/* replaces wgetn_wstr(), since we want to be able to edit values */ +static void +wGet_wstring(WINDOW *win, wchar_t *buffer, int limit) +{ + int y0, x0, x; + wint_t ch; + bool done = FALSE; + bool fkey = FALSE; + + echo(); + getyx(win, y0, x0); + (void) wattrset(win, A_REVERSE); + + x = (int) wcslen(buffer); + while (!done) { + if (x > (int) wcslen(buffer)) + x = (int) wcslen(buffer); + + /* clear the "window' */ + wmove(win, y0, x0); + wprintw(win, "%*s", limit, " "); + + /* write the existing buffer contents */ + wmove(win, y0, x0); + waddnwstr(win, buffer, limit); + + /* positions the cursor past character 'x' */ + wmove(win, y0, x0); + waddnwstr(win, buffer, x); + + switch (wGet_wchar(win, &ch)) { + case KEY_CODE_YES: + fkey = TRUE; + switch (ch) { + case KEY_ENTER: + ch = '\n'; + fkey = FALSE; + break; + case KEY_BACKSPACE: + case KEY_DC: + ch = '\b'; + fkey = FALSE; + break; + case KEY_LEFT: + case KEY_RIGHT: + break; + default: + ch = (wint_t) -1; + break; + } + break; + case OK: + fkey = FALSE; + break; + default: + ch = (wint_t) -1; + fkey = TRUE; + break; + } + + switch (ch) { + case '\n': + done = TRUE; + break; + case CTRL('U'): + *buffer = '\0'; + break; + case '\b': + if (x > 0) { + int j; + for (j = --x; (buffer[j] = buffer[j + 1]) != '\0'; ++j) { + ; + } + } else { + beep(); + } + break; + case KEY_LEFT: + if (x > 0) { + --x; + } else { + beep(); + } + break; + case KEY_RIGHT: + ++x; + break; + default: + if (fkey) { + beep(); + } else if ((int) wcslen(buffer) < limit) { + int j; + for (j = (int) wcslen(buffer) + 1; j > x; --j) { + buffer[j] = buffer[j - 1]; + } + buffer[x++] = (wchar_t) ch; + } else { + beep(); + } + } + } + + wattroff(win, A_REVERSE); + wmove(win, y0, x0); + noecho(); +} + +#endif + +static void +Pause(void) +{ + move(LINES - 1, 0); + addstr("Press any key to continue... "); + (void) Getchar(); +} + +static void +Cannot(const char *what) +{ + printw("\nThis %s terminal %s\n\n", getenv("TERM"), what); + Pause(); +} + +static void +ShellOut(bool message) +{ + if (message) + addstr("Shelling out..."); + def_prog_mode(); + endwin(); +#ifdef __MINGW32__ + system("cmd.exe"); +#else + system("sh"); +#endif + if (message) + addstr("returned from shellout.\n"); + refresh(); +} + +#ifdef NCURSES_MOUSE_VERSION +/* + * This function is the same as _tracemouse(), but we cannot count on that + * being available in the non-debug library. + */ +static const char * +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); + +#define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");} + + SHOW(BUTTON1_RELEASED, "release-1"); + SHOW(BUTTON1_PRESSED, "press-1"); + SHOW(BUTTON1_CLICKED, "click-1"); + SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1"); + SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1"); +#if NCURSES_MOUSE_VERSION == 1 + SHOW(BUTTON1_RESERVED_EVENT, "reserved-1"); +#endif + + SHOW(BUTTON2_RELEASED, "release-2"); + SHOW(BUTTON2_PRESSED, "press-2"); + SHOW(BUTTON2_CLICKED, "click-2"); + SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2"); + SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2"); +#if NCURSES_MOUSE_VERSION == 1 + SHOW(BUTTON2_RESERVED_EVENT, "reserved-2"); +#endif + + SHOW(BUTTON3_RELEASED, "release-3"); + SHOW(BUTTON3_PRESSED, "press-3"); + SHOW(BUTTON3_CLICKED, "click-3"); + SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3"); + SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3"); +#if NCURSES_MOUSE_VERSION == 1 + SHOW(BUTTON3_RESERVED_EVENT, "reserved-3"); +#endif + + SHOW(BUTTON4_RELEASED, "release-4"); + SHOW(BUTTON4_PRESSED, "press-4"); + SHOW(BUTTON4_CLICKED, "click-4"); + SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4"); + SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4"); +#if NCURSES_MOUSE_VERSION == 1 + SHOW(BUTTON4_RESERVED_EVENT, "reserved-4"); +#endif + +#if NCURSES_MOUSE_VERSION == 2 + SHOW(BUTTON5_RELEASED, "release-5"); + SHOW(BUTTON5_PRESSED, "press-5"); + SHOW(BUTTON5_CLICKED, "click-5"); + SHOW(BUTTON5_DOUBLE_CLICKED, "doubleclick-5"); + SHOW(BUTTON5_TRIPLE_CLICKED, "tripleclick-5"); +#endif + + SHOW(BUTTON_CTRL, "ctrl"); + SHOW(BUTTON_SHIFT, "shift"); + SHOW(BUTTON_ALT, "alt"); + SHOW(ALL_MOUSE_EVENTS, "all-events"); + SHOW(REPORT_MOUSE_POSITION, "position"); + +#undef SHOW + + if (buf[strlen(buf) - 1] == ' ') + buf[strlen(buf) - 2] = '\0'; + (void) strcat(buf, "}"); + return (buf); +} + +static void +show_mouse(WINDOW *win) +{ + int y, x; + MEVENT event; + bool outside; + bool show_loc; + + getmouse(&event); + outside = !wenclose(win, event.y, event.x); + + if (outside) { + (void) wstandout(win); + waddstr(win, "KEY_MOUSE"); + (void) wstandend(win); + } else { + waddstr(win, "KEY_MOUSE"); + } + wprintw(win, ", %s", mouse_decode(&event)); + + if (outside) + win = stdscr; + + show_loc = wmouse_trafo(win, &event.y, &event.x, FALSE); + + if (show_loc) { + getyx(win, y, x); + wmove(win, event.y, event.x); + waddch(win, '*'); + wmove(win, y, x); + } + + if (outside) + wnoutrefresh(win); +} +#endif /* NCURSES_MOUSE_VERSION */ + +/**************************************************************************** + * + * Character input test + * + ****************************************************************************/ + +#define NUM_GETCH_FLAGS 256 +typedef bool GetchFlags[NUM_GETCH_FLAGS]; + +static void +setup_getch(WINDOW *win, GetchFlags flags) +{ + keypad(win, flags['k']); /* should be redundant, but for testing */ + meta(win, flags['m']); /* force this to a known state */ + if (flags['e']) + echo(); + else + noecho(); +} + +static void +init_getch(WINDOW *win, GetchFlags flags) +{ + memset(flags, FALSE, NUM_GETCH_FLAGS); + flags[UChar('k')] = (win == stdscr); + flags[UChar('m')] = TRUE; + + setup_getch(win, flags); +} + +static void +wgetch_help(WINDOW *win, GetchFlags flags) +{ + static const char *help[] = + { + "e -- toggle echo mode" + ,"g -- triggers a getstr test" + ,"k -- toggle keypad/literal mode" + ,"m -- toggle meta (7-bit/8-bit) mode" + ,"^q -- quit" + ,"s -- shell out\n" + ,"w -- create a new window" +#ifdef SIGTSTP + ,"z -- suspend this process" +#endif + }; + int y, x; + unsigned chk = ((SIZEOF(help) + 1) / 2); + unsigned n; + + getyx(win, y, x); + move(0, 0); + printw("Type any key to see its %s value. Also:\n", + flags['k'] ? "keypad" : "literal"); + for (n = 0; n < SIZEOF(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)); + if (flg) + (void) standout(); + MvPrintw(row, col, "%s", help[n]); + if (col == 0) + clrtoeol(); + if (flg) + (void) standend(); + } + wrefresh(stdscr); + wmove(win, y, x); +} + +static void +wgetch_wrap(WINDOW *win, int first_y) +{ + int last_y = getmaxy(win) - 1; + int y = getcury(win) + 1; + + if (y >= last_y) + y = first_y; + wmove(win, y, 0); + wclrtoeol(win); +} + +#if defined(KEY_RESIZE) && HAVE_WRESIZE +typedef struct { + WINDOW *text; + WINDOW *frame; +} WINSTACK; + +static WINSTACK *winstack = 0; +static unsigned len_winstack = 0; + +static void +forget_boxes(void) +{ + if (winstack != 0) { + free(winstack); + } + winstack = 0; + len_winstack = 0; +} + +static void +remember_boxes(unsigned level, WINDOW *txt_win, WINDOW *box_win) +{ + unsigned need = (level + 1) * 2; + + assert(level < (unsigned) COLS); + + if (winstack == 0) { + len_winstack = 20; + winstack = typeMalloc(WINSTACK, len_winstack); + } else if (need >= len_winstack) { + len_winstack = need; + winstack = typeRealloc(WINSTACK, len_winstack, winstack); + } + winstack[level].text = txt_win; + winstack[level].frame = box_win; +} + +#if USE_SOFTKEYS && (defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH < 20071229) && NCURSES_EXT_FUNCS +static void +slk_repaint(void) +{ + /* this chunk is now done in resize_term() */ + slk_touch(); + slk_clear(); + slk_noutrefresh(); +} + +#else +#define slk_repaint() /* nothing */ +#endif + +#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE +/* + * For wgetch_test(), we create pairs of windows - one for a box, one for text. + * Resize both and paint the box in the parent. + */ +static void +resize_boxes(unsigned level, WINDOW *win) +{ + unsigned n; + int base = 5; + int high = LINES - base; + int wide = COLS; + + touchwin(stdscr); + wnoutrefresh(stdscr); + + slk_repaint(); + + for (n = 0; n < level; ++n) { + wresize(winstack[n].frame, high, wide); + wresize(winstack[n].text, high - 2, wide - 2); + high -= 2; + wide -= 2; + werase(winstack[n].text); + box(winstack[n].frame, 0, 0); + wnoutrefresh(winstack[n].frame); + wprintw(winstack[n].text, + "size %dx%d\n", + getmaxy(winstack[n].text), + getmaxx(winstack[n].text)); + wnoutrefresh(winstack[n].text); + if (winstack[n].text == win) + break; + } + doupdate(); +} +#endif /* resize_boxes */ +#else +#define forget_boxes() /* nothing */ +#define remember_boxes(level,text,frame) /* nothing */ +#endif + +static void +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); + wtimeout(win, delay); + getyx(win, first_y, first_x); + + wgetch_help(win, flags); + wsetscrreg(win, first_y, getmaxy(win) - 1); + scrollok(win, TRUE); + + for (;;) { + while ((c = wGetchar(win)) == ERR) { + incount++; + if (blocking) { + (void) wprintw(win, "%05d: input error", incount); + break; + } else { + (void) wprintw(win, "%05d: input timed out", incount); + } + wgetch_wrap(win, first_y); + } + if (c == ERR && blocking) { + wprintw(win, "ERR"); + wgetch_wrap(win, first_y); + } else if (isQuit(c)) { + break; + } else if (c == 'e') { + flags[UChar('e')] = !flags[UChar('e')]; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'g') { + waddstr(win, "getstr test: "); + echo(); + wgetnstr(win, buf, sizeof(buf) - 1); + noecho(); + wprintw(win, "I saw %d characters:\n\t`%s'.", (int) strlen(buf), buf); + wclrtoeol(win); + wgetch_wrap(win, first_y); + } else if (c == 'k') { + flags[UChar('k')] = !flags[UChar('k')]; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'm') { + flags[UChar('m')] = !flags[UChar('m')]; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 's') { + ShellOut(TRUE); + } else if (c == 'w') { + int high = getmaxy(win) - 1 - first_y + 1; + int wide = getmaxx(win) - first_x; + int old_y, old_x; + int new_y = first_y + getbegy(win); + int new_x = first_x + getbegx(win); + + getyx(win, old_y, old_x); + if (high > 2 && wide > 2) { + WINDOW *wb = newwin(high, wide, new_y, new_x); + WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); + + box(wb, 0, 0); + wrefresh(wb); + wmove(wi, 0, 0); + remember_boxes(level, wi, wb); + wgetch_test(level + 1, wi, delay); + delwin(wi); + delwin(wb); + + wgetch_help(win, flags); + wmove(win, old_y, old_x); + touchwin(win); + wrefresh(win); + doupdate(); + } +#ifdef SIGTSTP + } else if (c == 'z') { + kill(getpid(), SIGTSTP); +#endif + } else { + wprintw(win, "Key pressed: %04o ", c); +#ifdef NCURSES_MOUSE_VERSION + if (c == KEY_MOUSE) { + show_mouse(win); + } else +#endif /* NCURSES_MOUSE_VERSION */ + if (c >= KEY_MIN) { +#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE + if (c == KEY_RESIZE) { + resize_boxes(level, win); + } +#endif + (void) waddstr(win, keyname(c)); + } else if (c >= 0x80) { + unsigned c2 = (unsigned) c; +#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES)) + /* at least Solaris SVR4 curses breaks unctrl(128), etc. */ + c2 &= 0x7f; +#endif + if (isprint(c)) + (void) wprintw(win, "%c", UChar(c)); + else if (c2 != UChar(c)) + (void) wprintw(win, "M-%s", unctrl(c2)); + else + (void) wprintw(win, "%s", unctrl(c2)); + waddstr(win, " (high-half character)"); + } else { + if (isprint(c)) + (void) wprintw(win, "%c (ASCII printable character)", c); + else + (void) wprintw(win, "%s (ASCII control character)", + unctrl(UChar(c))); + } + wgetch_wrap(win, first_y); + } + } + + wtimeout(win, -1); + + if (!level) + init_getch(win, flags); +} + +static int +begin_getch_test(void) +{ + char buf[BUFSIZ]; + int delay; + + refresh(); + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + + (void) printw("Delay in 10ths of a second ( for blocking input)? "); + echo(); + getnstr(buf, sizeof(buf) - 1); + noecho(); + nonl(); + + if (isdigit(UChar(buf[0]))) { + delay = atoi(buf) * 100; + } else { + delay = -1; + } + raw(); + move(5, 0); + return delay; +} + +static void +finish_getch_test(void) +{ +#ifdef NCURSES_MOUSE_VERSION + mousemask(0, (mmask_t *) 0); +#endif + erase(); + noraw(); + nl(); + endwin(); +} + +static void +getch_test(void) +{ + int delay = begin_getch_test(); + + slk_restore(); + wgetch_test(0, stdscr, delay); + forget_boxes(); + finish_getch_test(); + slk_clear(); +} + +#if USE_WIDEC_SUPPORT +/* + * For wget_wch_test(), we create pairs of windows - one for a box, one for text. + * Resize both and paint the box in the parent. + */ +#if defined(KEY_RESIZE) && HAVE_WRESIZE +static void +resize_wide_boxes(unsigned level, WINDOW *win) +{ + unsigned n; + int base = 5; + int high = LINES - base; + int wide = COLS; + + touchwin(stdscr); + wnoutrefresh(stdscr); + + slk_repaint(); + + for (n = 0; n < level; ++n) { + wresize(winstack[n].frame, high, wide); + wresize(winstack[n].text, high - 2, wide - 2); + high -= 2; + wide -= 2; + werase(winstack[n].text); + box_set(winstack[n].frame, 0, 0); + wnoutrefresh(winstack[n].frame); + wprintw(winstack[n].text, + "size %dx%d\n", + getmaxy(winstack[n].text), + getmaxx(winstack[n].text)); + wnoutrefresh(winstack[n].text); + if (winstack[n].text == win) + break; + } + doupdate(); +} +#endif /* KEY_RESIZE */ + +static char * +wcstos(const wchar_t *src) +{ + int need; + char *result = 0; + const wchar_t *tmp = src; +#ifndef state_unused + mbstate_t state; +#endif + + reset_wchars(state); + if ((need = (int) count_wchars(tmp, 0, &state)) > 0) { + unsigned have = (unsigned) need; + if ((result = typeCalloc(char, have + 1)) != 0) { + tmp = src; + if (trans_wchars(result, tmp, have, &state) != have) { + free(result); + result = 0; + } + } + } + return result; +} + +static void +wget_wch_test(unsigned level, WINDOW *win, int delay) +{ + wchar_t wchar_buf[BUFSIZ]; + wint_t wint_buf[BUFSIZ]; + int first_y, first_x; + wint_t c; + int incount = 0; + GetchFlags flags; + bool blocking = (delay < 0); + int code; + char *temp; + + init_getch(win, flags); + wtimeout(win, delay); + getyx(win, first_y, first_x); + + wgetch_help(win, flags); + wsetscrreg(win, first_y, getmaxy(win) - 1); + scrollok(win, TRUE); + + for (;;) { + while ((code = wGet_wchar(win, &c)) == ERR) { + incount++; + if (blocking) { + (void) wprintw(win, "%05d: input error", incount); + break; + } else { + (void) wprintw(win, "%05d: input timed out", incount); + } + wgetch_wrap(win, first_y); + } + if (code == ERR && blocking) { + wprintw(win, "ERR"); + wgetch_wrap(win, first_y); + } else if (isQuit((int) c)) { + break; + } else if (c == 'e') { + flags[UChar('e')] = !flags[UChar('e')]; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'g') { + waddstr(win, "getstr test: "); + echo(); + code = wgetn_wstr(win, wint_buf, sizeof(wint_buf) - 1); + noecho(); + if (code == ERR) { + wprintw(win, "wgetn_wstr returns an error."); + } else { + int n; + for (n = 0; (wchar_buf[n] = (wchar_t) wint_buf[n]) != 0; ++n) { + ; + } + if ((temp = wcstos(wchar_buf)) != 0) { + wprintw(win, "I saw %d characters:\n\t`%s'.", + (int) wcslen(wchar_buf), temp); + free(temp); + } else { + wprintw(win, "I saw %d characters (cannot convert).", + (int) wcslen(wchar_buf)); + } + } + wclrtoeol(win); + wgetch_wrap(win, first_y); + } else if (c == 'k') { + flags[UChar('k')] = !flags[UChar('k')]; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 'm') { + flags[UChar('m')] = !flags[UChar('m')]; + setup_getch(win, flags); + wgetch_help(win, flags); + } else if (c == 's') { + ShellOut(TRUE); + } else if (c == 'w') { + int high = getmaxy(win) - 1 - first_y + 1; + int wide = getmaxx(win) - first_x; + int old_y, old_x; + int new_y = first_y + getbegy(win); + int new_x = first_x + getbegx(win); + + getyx(win, old_y, old_x); + if (high > 2 && wide > 2) { + WINDOW *wb = newwin(high, wide, new_y, new_x); + WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); + + box_set(wb, 0, 0); + wrefresh(wb); + wmove(wi, 0, 0); + remember_boxes(level, wi, wb); + wget_wch_test(level + 1, wi, delay); + delwin(wi); + delwin(wb); + + wgetch_help(win, flags); + wmove(win, old_y, old_x); + touchwin(win); + wrefresh(win); + } +#ifdef SIGTSTP + } else if (c == 'z') { + kill(getpid(), SIGTSTP); +#endif + } else { + wprintw(win, "Key pressed: %04o ", (int) c); +#ifdef NCURSES_MOUSE_VERSION + if (c == KEY_MOUSE) { + show_mouse(win); + } else +#endif /* NCURSES_MOUSE_VERSION */ + if (code == KEY_CODE_YES) { +#if defined(KEY_RESIZE) && HAVE_WRESIZE + if (c == KEY_RESIZE) { + resize_wide_boxes(level, win); + } +#endif + (void) waddstr(win, keyname((wchar_t) c)); + } else { + (void) waddstr(win, key_name((wchar_t) c)); + if (c < 256 && iscntrl(c)) { + (void) wprintw(win, " (control character)"); + } else { + (void) wprintw(win, " = %#x (printable character)", + (unsigned) c); + } + } + wgetch_wrap(win, first_y); + } + } + + wtimeout(win, -1); + + if (!level) + init_getch(win, flags); +} + +static void +get_wch_test(void) +{ + int delay = begin_getch_test(); + + slk_restore(); + wget_wch_test(0, stdscr, delay); + forget_boxes(); + finish_getch_test(); + slk_clear(); +} +#endif + +/**************************************************************************** + * + * Character attributes test + * + ****************************************************************************/ + +#if HAVE_SETUPTERM || HAVE_TGETENT +#define get_ncv() TIGETNUM("ncv","NC") +#define get_xmc() TIGETNUM("xmc","sg") +#else +#define get_ncv() -1 +#define get_xmc() -1 +#endif + +#if !HAVE_TERMATTRS +static chtype +my_termattrs(void) +{ + static int first = TRUE; + static chtype result = 0; + + if (first) { +#if !HAVE_TIGETSTR + char buffer[4096]; + char parsed[4096]; + char *area_pointer = parsed; + + tgetent(buffer, getenv("TERM")); +#endif + + if (TIGETSTR("smso", "so")) + result |= A_STANDOUT; + if (TIGETSTR("smul", "us")) + result |= A_UNDERLINE; + if (TIGETSTR("rev", "mr")) + result |= A_REVERSE; + if (TIGETSTR("blink", "mb")) + result |= A_BLINK; + if (TIGETSTR("dim", "mh")) + result |= A_DIM; + if (TIGETSTR("bold", "md")) + result |= A_BOLD; + if (TIGETSTR("smacs", "ac")) + result |= A_ALTCHARSET; + + first = FALSE; + } + return result; +} +#define termattrs() my_termattrs() +#endif + +#define MAX_ATTRSTRING 31 +#define LEN_ATTRSTRING 26 + +static char attr_test_string[MAX_ATTRSTRING + 1]; + +static void +attr_legend(WINDOW *helpwin) +{ + int row = 1; + int col = 1; + + MvWPrintw(helpwin, row++, col, + "ESC to exit."); + MvWPrintw(helpwin, row++, col, + "^L repaints."); + ++row; + MvWPrintw(helpwin, row++, col, + "Modify the test strings:"); + MvWPrintw(helpwin, row++, col, + " A digit sets gaps on each side of displayed attributes"); + MvWPrintw(helpwin, row++, col, + " shifts the text left/right. "); + ++row; + MvWPrintw(helpwin, row++, col, + "Toggles:"); + if (use_colors) { + MvWPrintw(helpwin, row++, col, + " f/F/b/F toggle foreground/background background color"); + MvWPrintw(helpwin, row++, col, + " t/T toggle text/background color attribute"); + } + MvWPrintw(helpwin, row++, col, + " a/A toggle ACS (alternate character set) mapping"); + MvWPrintw(helpwin, row, col, + " v/V toggle video attribute to combine with each line"); +} + +static void +show_color_attr(int fg, int bg, int tx) +{ + if (use_colors) { + printw(" Colors (fg %d, bg %d", fg, bg); + if (tx >= 0) + printw(", text %d", tx); + printw("),"); + } +} + +static bool +cycle_color_attr(int ch, short *fg, short *bg, short *tx) +{ + bool error = FALSE; + + if (use_colors) { + switch (ch) { + case 'f': + *fg = (short) (*fg + 1); + break; + case 'F': + *fg = (short) (*fg - 1); + break; + case 'b': + *bg = (short) (*bg + 1); + break; + case 'B': + *bg = (short) (*bg - 1); + break; + case 't': + *tx = (short) (*tx + 1); + break; + case 'T': + *tx = (short) (*tx - 1); + break; + default: + beep(); + error = TRUE; + break; + } + if (*fg >= COLORS) + *fg = (short) min_colors; + if (*fg < min_colors) + *fg = (short) (COLORS - 1); + if (*bg >= COLORS) + *bg = (short) min_colors; + if (*bg < min_colors) + *bg = (short) (COLORS - 1); + if (*tx >= COLORS) + *tx = -1; + if (*tx < -1) + *tx = (short) (COLORS - 1); + } else { + beep(); + error = TRUE; + } + return error; +} + +static void +adjust_attr_string(int adjust) +{ + int first = ((int) UChar(attr_test_string[0])) + adjust; + int last = first + LEN_ATTRSTRING; + + if (first >= ' ' && last <= '~') { /* 32..126 */ + int j, k; + for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) { + attr_test_string[j] = (char) k; + if (((k + 1 - first) % 5) == 0) { + if (++j >= MAX_ATTRSTRING) + break; + attr_test_string[j] = ' '; + } + } + while (j < MAX_ATTRSTRING) + attr_test_string[j++] = ' '; + attr_test_string[j] = '\0'; + } else { + beep(); + } +} + +static void +init_attr_string(void) +{ + attr_test_string[0] = 'a'; + adjust_attr_string(0); +} + +static int +show_attr(int row, int skip, bool arrow, chtype attr, const char *name) +{ + int ncv = get_ncv(); + chtype test = attr & (chtype) (~A_ALTCHARSET); + + if (arrow) + MvPrintw(row, 5, "-->"); + MvPrintw(row, 8, "%s mode:", name); + MvPrintw(row, 24, "|"); + if (skip) + printw("%*s", skip, " "); + /* + * Just for testing, write text using the alternate character set one + * character at a time (to pass its rendition directly), and use the + * string operation for the other attributes. + */ + if (attr & A_ALTCHARSET) { + const char *s; + chtype ch; + + for (s = attr_test_string; *s != '\0'; ++s) { + ch = UChar(*s); + addch(ch | attr); + } + } else { + (void) attrset(attr); + addstr(attr_test_string); + attroff(attr); + } + if (skip) + printw("%*s", skip, " "); + printw("|"); + if (test != A_NORMAL) { + if (!(termattrs() & test)) { + printw(" (N/A)"); + } else { + if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) { + static const chtype table[] = + { + A_STANDOUT, + A_UNDERLINE, + A_REVERSE, + A_BLINK, + A_DIM, + A_BOLD, +#ifdef A_INVIS + A_INVIS, +#endif + A_PROTECT, + A_ALTCHARSET + }; + unsigned n; + bool found = FALSE; + for (n = 0; n < SIZEOF(table); n++) { + if ((table[n] & attr) != 0 + && ((1 << n) & ncv) != 0) { + found = TRUE; + break; + } + } + if (found) + printw(" (NCV)"); + } + if ((termattrs() & test) != test) + printw(" (Part)"); + } + } + return row + 2; +} +/* *INDENT-OFF* */ +static const struct { + chtype attr; + NCURSES_CONST char * name; +} attrs_to_test[] = { + { A_STANDOUT, "STANDOUT" }, + { A_REVERSE, "REVERSE" }, + { A_BOLD, "BOLD" }, + { A_UNDERLINE, "UNDERLINE" }, + { A_DIM, "DIM" }, + { A_BLINK, "BLINK" }, + { A_PROTECT, "PROTECT" }, +#ifdef A_INVIS + { A_INVIS, "INVISIBLE" }, +#endif + { A_NORMAL, "NORMAL" }, +}; +/* *INDENT-ON* */ + +static bool +attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc) +{ + bool result = TRUE; + bool error = FALSE; + WINDOW *helpwin; + + do { + int ch = Getchar(); + + error = FALSE; + if (ch < 256 && isdigit(ch)) { + *skip = (ch - '0'); + } else { + switch (ch) { + case CTRL('L'): + Repaint(); + break; + case '?': + if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { + box(helpwin, 0, 0); + attr_legend(helpwin); + wGetchar(helpwin); + delwin(helpwin); + } + break; + case 'a': + *ac = 0; + break; + case 'A': + *ac = A_ALTCHARSET; + break; + case 'v': + if (*kc == 0) + *kc = SIZEOF(attrs_to_test) - 1; + else + *kc -= 1; + break; + case 'V': + *kc += 1; + if (*kc >= SIZEOF(attrs_to_test)) + *kc = 0; + break; + case '<': + adjust_attr_string(-1); + break; + case '>': + adjust_attr_string(1); + break; + case case_QUIT: + result = FALSE; + break; + default: + error = cycle_color_attr(ch, fg, bg, tx); + break; + } + } + } while (error); + return result; +} + +static void +attr_test(void) +/* test text attributes */ +{ + int n; + int skip = get_xmc(); + short fg = COLOR_BLACK; /* color pair 0 is special */ + short bg = COLOR_BLACK; + short tx = -1; + int ac = 0; + unsigned j, k; + + if (skip < 0) + skip = 0; + + n = skip; /* make it easy */ + k = SIZEOF(attrs_to_test) - 1; + init_attr_string(); + + do { + int row = 2; + chtype normal = A_NORMAL | BLANK; + chtype extras = (chtype) ac; + + if (use_colors) { + short pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK); + if (pair != 0) { + pair = 1; + if (init_pair(pair, fg, bg) == ERR) { + beep(); + } else { + normal |= (chtype) COLOR_PAIR(pair); + } + } + if (tx >= 0) { + pair = 2; + if (init_pair(pair, tx, bg) == ERR) { + beep(); + } else { + extras |= (chtype) COLOR_PAIR(pair); + } + } + } + bkgd(normal); + bkgdset(normal); + erase(); + + box(stdscr, 0, 0); + MvAddStr(0, 20, "Character attribute test display"); + + for (j = 0; j < SIZEOF(attrs_to_test); ++j) { + bool arrow = (j == k); + row = show_attr(row, n, arrow, + extras | + attrs_to_test[j].attr | + attrs_to_test[k].attr, + attrs_to_test[j].name); + } + + MvPrintw(row, 8, + "This terminal does %shave the magic-cookie glitch", + get_xmc() > -1 ? "" : "not "); + MvPrintw(row + 1, 8, "Enter '?' for help."); + show_color_attr(fg, bg, tx); + printw(" ACS (%d)", ac != 0); + + refresh(); + } while (attr_getc(&n, &fg, &bg, &tx, &ac, &k)); + + bkgdset(A_NORMAL | BLANK); + erase(); + endwin(); +} + +#if USE_WIDEC_SUPPORT +static wchar_t wide_attr_test_string[MAX_ATTRSTRING + 1]; + +static void +wide_adjust_attr_string(int adjust) +{ + int first = ((int) UChar(wide_attr_test_string[0])) + adjust; + int last = first + LEN_ATTRSTRING; + + if (first >= ' ' && last <= '~') { /* 32..126 */ + int j, k; + for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) { + wide_attr_test_string[j] = k; + if (((k + 1 - first) % 5) == 0) { + if (++j >= MAX_ATTRSTRING) + break; + wide_attr_test_string[j] = ' '; + } + } + while (j < MAX_ATTRSTRING) + wide_attr_test_string[j++] = ' '; + wide_attr_test_string[j] = '\0'; + } else { + beep(); + } +} + +static void +wide_init_attr_string(void) +{ + wide_attr_test_string[0] = 'a'; + wide_adjust_attr_string(0); +} + +static void +set_wide_background(short pair) +{ + cchar_t normal; + wchar_t blank[2]; + + blank[0] = ' '; + blank[1] = 0; + setcchar(&normal, blank, A_NORMAL, pair, 0); + bkgrnd(&normal); + bkgrndset(&normal); +} + +static attr_t +get_wide_background(void) +{ + attr_t result = A_NORMAL; + attr_t attr; + cchar_t ch; + short pair; + wchar_t wch[10]; + + if (getbkgrnd(&ch) != ERR) { + if (getcchar(&ch, wch, &attr, &pair, 0) != ERR) { + result = attr; + } + } + return result; +} + +static int +wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const char *name) +{ + int ncv = get_ncv(); + chtype test = attr & ~WA_ALTCHARSET; + + if (arrow) + MvPrintw(row, 5, "-->"); + MvPrintw(row, 8, "%s mode:", name); + MvPrintw(row, 24, "|"); + if (skip) + printw("%*s", skip, " "); + + /* + * Just for testing, write text using the alternate character set one + * character at a time (to pass its rendition directly), and use the + * string operation for the other attributes. + */ + if (attr & WA_ALTCHARSET) { + const wchar_t *s; + cchar_t ch; + + for (s = wide_attr_test_string; *s != L'\0'; ++s) { + wchar_t fill[2]; + fill[0] = *s; + fill[1] = L'\0'; + setcchar(&ch, fill, attr, pair, 0); + add_wch(&ch); + } + } else { + attr_t old_attr; + short old_pair; + + (void) attr_get(&old_attr, &old_pair, 0); + (void) attr_set(attr, pair, 0); + addwstr(wide_attr_test_string); + (void) attr_set(old_attr, old_pair, 0); + } + if (skip) + printw("%*s", skip, " "); + printw("|"); + if (test != A_NORMAL) { + if (!(term_attrs() & test)) { + printw(" (N/A)"); + } else { + if (ncv > 0 && (get_wide_background() & A_COLOR)) { + static const attr_t table[] = + { + WA_STANDOUT, + WA_UNDERLINE, + WA_REVERSE, + WA_BLINK, + WA_DIM, + WA_BOLD, + WA_INVIS, + WA_PROTECT, + WA_ALTCHARSET + }; + unsigned n; + bool found = FALSE; + for (n = 0; n < SIZEOF(table); n++) { + if ((table[n] & attr) != 0 + && ((1 << n) & ncv) != 0) { + found = TRUE; + break; + } + } + if (found) + printw(" (NCV)"); + } + if ((term_attrs() & test) != test) + printw(" (Part)"); + } + } + return row + 2; +} + +static bool +wide_attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc) +{ + bool result = TRUE; + bool error = FALSE; + WINDOW *helpwin; + + do { + int ch = Getchar(); + + error = FALSE; + if (ch < 256 && isdigit(ch)) { + *skip = (ch - '0'); + } else { + switch (ch) { + case CTRL('L'): + Repaint(); + break; + case '?': + if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { + box_set(helpwin, 0, 0); + attr_legend(helpwin); + wGetchar(helpwin); + delwin(helpwin); + } + break; + case 'a': + *ac = 0; + break; + case 'A': + *ac = A_ALTCHARSET; + break; + case 'v': + if (*kc == 0) + *kc = SIZEOF(attrs_to_test) - 1; + else + *kc -= 1; + break; + case 'V': + *kc += 1; + if (*kc >= SIZEOF(attrs_to_test)) + *kc = 0; + break; + case '<': + wide_adjust_attr_string(-1); + break; + case '>': + wide_adjust_attr_string(1); + break; + case case_QUIT: + result = FALSE; + break; + default: + error = cycle_color_attr(ch, fg, bg, tx); + break; + } + } + } while (error); + return result; +} + +static void +wide_attr_test(void) +/* test text attributes using wide-character calls */ +{ + int n; + int skip = get_xmc(); + short fg = COLOR_BLACK; /* color pair 0 is special */ + short bg = COLOR_BLACK; + short tx = -1; + int ac = 0; + unsigned j, k; + + if (skip < 0) + skip = 0; + + n = skip; /* make it easy */ + k = SIZEOF(attrs_to_test) - 1; + wide_init_attr_string(); + + do { + int row = 2; + short pair = 0; + short extras = 0; + + if (use_colors) { + pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK); + if (pair != 0) { + pair = 1; + if (init_pair(pair, fg, bg) == ERR) { + beep(); + } + } + extras = pair; + if (tx >= 0) { + extras = 2; + if (init_pair(extras, tx, bg) == ERR) { + beep(); + } + } + } + set_wide_background(pair); + erase(); + + box_set(stdscr, 0, 0); + MvAddStr(0, 20, "Character attribute test display"); + + for (j = 0; j < SIZEOF(attrs_to_test); ++j) { + row = wide_show_attr(row, n, j == k, + ((attr_t) ac | + attrs_to_test[j].attr | + attrs_to_test[k].attr), + extras, + attrs_to_test[j].name); + } + + MvPrintw(row, 8, + "This terminal does %shave the magic-cookie glitch", + get_xmc() > -1 ? "" : "not "); + MvPrintw(row + 1, 8, "Enter '?' for help."); + show_color_attr(fg, bg, tx); + printw(" ACS (%d)", ac != 0); + + refresh(); + } while (wide_attr_getc(&n, &fg, &bg, &tx, &ac, &k)); + + set_wide_background(0); + erase(); + endwin(); +} +#endif + +/**************************************************************************** + * + * Color support tests + * + ****************************************************************************/ + +static NCURSES_CONST char *the_color_names[] = +{ + "black", + "red", + "green", + "yellow", + "blue", + "magenta", + "cyan", + "white", + "BLACK", + "RED", + "GREEN", + "YELLOW", + "BLUE", + "MAGENTA", + "CYAN", + "WHITE" +}; + +static void +show_color_name(int y, int x, int color, bool wide) +{ + if (move(y, x) != ERR) { + char temp[80]; + int width = 8; + + if (wide) { + sprintf(temp, "%02d", color); + width = 4; + } else if (color >= 8) { + sprintf(temp, "[%02d]", color); + } else if (color < 0) { + strcpy(temp, "default"); + } else { + strcpy(temp, the_color_names[color]); + } + printw("%-*.*s", width, width, temp); + } +} + +static void +color_legend(WINDOW *helpwin, bool wide) +{ + int row = 1; + int col = 1; + + MvWPrintw(helpwin, row++, col, + "ESC to exit."); + ++row; + MvWPrintw(helpwin, row++, col, + "Use up/down arrow to scroll through the display if it is"); + MvWPrintw(helpwin, row++, col, + "longer than one screen. Control/N and Control/P can be used"); + MvWPrintw(helpwin, row++, col, + "in place of up/down arrow. Use pageup/pagedown to scroll a"); + MvWPrintw(helpwin, row++, col, + "full screen; control/B and control/F can be used here."); + ++row; + MvWPrintw(helpwin, row++, col, + "Toggles:"); + MvWPrintw(helpwin, row++, col, + " a/A toggle altcharset off/on"); + MvWPrintw(helpwin, row++, col, + " b/B toggle bold off/on"); + MvWPrintw(helpwin, row++, col, + " n/N toggle text/number on/off"); + MvWPrintw(helpwin, row++, col, + " r/R toggle reverse on/off"); + MvWPrintw(helpwin, row++, col, + " w/W toggle width between 8/16 colors"); +#if USE_WIDEC_SUPPORT + if (wide) { + MvWPrintw(helpwin, row++, col, + "Wide characters:"); + MvWPrintw(helpwin, row, col, + " x/X toggle text between ASCII and wide-character"); + } +#else + (void) wide; +#endif +} + +#define set_color_test(name, value) if (name != value) { name = value; base_row = 0; } + +/* generate a color test pattern */ +static void +color_test(void) +{ + short i; + int top = 0, width; + int base_row = 0; + int grid_top = top + 3; + int page_size = (LINES - grid_top); + int pairs_max = PAIR_NUMBER(A_COLOR) + 1; + int row_limit; + int per_row; + char numbered[80]; + const char *hello; + bool done = FALSE; + bool opt_acsc = FALSE; + bool opt_bold = FALSE; + bool opt_revs = FALSE; + bool opt_nums = FALSE; + bool opt_wide = FALSE; + WINDOW *helpwin; + + if (COLORS * COLORS == COLOR_PAIRS) { + int limit = (COLORS - min_colors) * (COLORS - min_colors); + if (pairs_max > limit) + pairs_max = limit; + } else { + if (pairs_max > COLOR_PAIRS) + pairs_max = COLOR_PAIRS; + } + + while (!done) { + int shown = 0; + + /* this assumes an 80-column line */ + if (opt_wide) { + width = 4; + hello = "Test"; + per_row = (COLORS > 8) ? 16 : 8; + } else { + width = 8; + hello = "Hello"; + per_row = 8; + } + per_row -= min_colors; + + row_limit = (pairs_max + per_row - 1) / per_row; + + move(0, 0); + (void) printw("There are %d color pairs and %d colors%s\n", + pairs_max, COLORS, + min_colors ? " besides 'default'" : ""); + + clrtobot(); + MvPrintw(top + 1, 0, + "%dx%d matrix of foreground/background colors, bold *%s*\n", + row_limit, + per_row, + 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); + + /* show a grid of colors, with color names/ numbers on the left */ + for (i = (short) (base_row * per_row); i < pairs_max; i++) { + int row = grid_top + (i / per_row) - base_row; + int col = (i % per_row + 1) * width; + short pair = i; + +#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors) +#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors) + if (row >= 0 && move(row, col) != ERR) { + short fg = InxToFG(i); + short bg = InxToBG(i); + + init_pair(pair, fg, bg); + attron((attr_t) COLOR_PAIR(pair)); + if (opt_acsc) + attron((attr_t) A_ALTCHARSET); + if (opt_bold) + attron((attr_t) A_BOLD); + if (opt_revs) + attron((attr_t) A_REVERSE); + + if (opt_nums) { + sprintf(numbered, "{%02X}", 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); + } + ++shown; + } else if (shown) { + break; + } + } + + switch (wGetchar(stdscr)) { + case 'a': + opt_acsc = FALSE; + break; + case 'A': + opt_acsc = TRUE; + break; + case 'b': + opt_bold = FALSE; + break; + case 'B': + opt_bold = TRUE; + break; + case 'n': + opt_nums = FALSE; + break; + case 'N': + opt_nums = TRUE; + break; + case 'r': + opt_revs = FALSE; + break; + case 'R': + opt_revs = TRUE; + break; + case case_QUIT: + done = TRUE; + continue; + case 'w': + set_color_test(opt_wide, FALSE); + break; + case 'W': + set_color_test(opt_wide, TRUE); + break; + case CTRL('p'): + case KEY_UP: + if (base_row <= 0) { + beep(); + } else { + base_row -= 1; + } + break; + case CTRL('n'): + case KEY_DOWN: + if (base_row + page_size >= row_limit) { + beep(); + } else { + base_row += 1; + } + break; + case CTRL('b'): + case KEY_PREVIOUS: + case KEY_PPAGE: + if (base_row <= 0) { + beep(); + } else { + base_row -= (page_size - 1); + if (base_row < 0) + base_row = 0; + } + break; + case CTRL('f'): + case KEY_NEXT: + case KEY_NPAGE: + if (base_row + page_size >= row_limit) { + beep(); + } else { + base_row += page_size - 1; + if (base_row + page_size >= row_limit) { + base_row = row_limit - page_size - 1; + } + } + break; + case '?': + if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { + box(helpwin, 0, 0); + color_legend(helpwin, FALSE); + wGetchar(helpwin); + delwin(helpwin); + } + break; + default: + beep(); + continue; + } + } + + erase(); + endwin(); +} + +#if USE_WIDEC_SUPPORT +/* generate a color test pattern */ +static void +wide_color_test(void) +{ + int 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 row_limit; + int per_row; + char numbered[80]; + const char *hello; + bool done = FALSE; + bool opt_acsc = FALSE; + bool opt_bold = FALSE; + bool opt_revs = FALSE; + bool opt_wide = FALSE; + bool opt_nums = FALSE; + bool opt_xchr = FALSE; + wchar_t buffer[10]; + WINDOW *helpwin; + + if (COLORS * COLORS == COLOR_PAIRS) { + int limit = (COLORS - min_colors) * (COLORS - min_colors); + if (pairs_max > limit) + pairs_max = limit; + } else { + if (pairs_max > COLOR_PAIRS) + pairs_max = COLOR_PAIRS; + } + + while (!done) { + int shown = 0; + + /* this assumes an 80-column line */ + if (opt_wide) { + width = 4; + hello = "Test"; + per_row = (COLORS > 8) ? 16 : 8; + } else { + width = 8; + hello = "Hello"; + per_row = 8; + } + per_row -= min_colors; + + if (opt_xchr) { + make_fullwidth_text(buffer, hello); + width *= 2; + per_row /= 2; + } else { + make_narrow_text(buffer, hello); + } + + row_limit = (pairs_max + per_row - 1) / per_row; + + move(0, 0); + (void) printw("There are %d color pairs and %d colors%s\n", + pairs_max, COLORS, + min_colors ? " besides 'default'" : ""); + + clrtobot(); + MvPrintw(top + 1, 0, + "%dx%d matrix of foreground/background colors, bold *%s*\n", + row_limit, + per_row, + 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); + + /* 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; + short pair = (short) i; + + if (row >= 0 && move(row, col) != ERR) { + init_pair(pair, InxToFG(i), InxToBG(i)); + color_set(pair, NULL); + if (opt_acsc) + attr_on((attr_t) A_ALTCHARSET, NULL); + if (opt_bold) + attr_on((attr_t) A_BOLD, NULL); + if (opt_revs) + attr_on((attr_t) A_REVERSE, NULL); + + if (opt_nums) { + sprintf(numbered, "{%02X}", i); + if (opt_xchr) { + make_fullwidth_text(buffer, numbered); + } else { + make_narrow_text(buffer, numbered); + } + } + 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); + } + ++shown; + } else if (shown) { + break; + } + } + + switch (wGetchar(stdscr)) { + case 'a': + opt_acsc = FALSE; + break; + case 'A': + opt_acsc = TRUE; + break; + case 'b': + opt_bold = FALSE; + break; + case 'B': + opt_bold = TRUE; + break; + case 'n': + opt_nums = FALSE; + break; + case 'N': + opt_nums = TRUE; + break; + case 'r': + opt_revs = FALSE; + break; + case 'R': + opt_revs = TRUE; + break; + case case_QUIT: + done = TRUE; + continue; + case 'w': + set_color_test(opt_wide, FALSE); + break; + case 'W': + set_color_test(opt_wide, TRUE); + break; + case 'x': + opt_xchr = FALSE; + break; + case 'X': + opt_xchr = TRUE; + break; + case CTRL('p'): + case KEY_UP: + if (base_row <= 0) { + beep(); + } else { + base_row -= 1; + } + break; + case CTRL('n'): + case KEY_DOWN: + if (base_row + page_size >= row_limit) { + beep(); + } else { + base_row += 1; + } + break; + case CTRL('b'): + case KEY_PREVIOUS: + case KEY_PPAGE: + if (base_row <= 0) { + beep(); + } else { + base_row -= (page_size - 1); + if (base_row < 0) + base_row = 0; + } + break; + case CTRL('f'): + case KEY_NEXT: + case KEY_NPAGE: + if (base_row + page_size >= row_limit) { + beep(); + } else { + base_row += page_size - 1; + if (base_row + page_size >= row_limit) { + base_row = row_limit - page_size - 1; + } + } + break; + case '?': + if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { + box(helpwin, 0, 0); + color_legend(helpwin, TRUE); + wGetchar(helpwin); + delwin(helpwin); + } + break; + default: + beep(); + continue; + } + } + + erase(); + endwin(); +} +#endif /* USE_WIDEC_SUPPORT */ + +static void +change_color(short current, int field, int value, int usebase) +{ + short red, green, blue; + + color_content(current, &red, &green, &blue); + + switch (field) { + case 0: + red = (short) (usebase ? (red + value) : value); + break; + case 1: + green = (short) (usebase ? (green + value) : value); + break; + case 2: + blue = (short) (usebase ? (blue + value) : value); + break; + } + + if (init_color(current, red, green, blue) == ERR) + beep(); +} + +static void +init_all_colors(void) +{ + short c; + + for (c = 0; c < COLORS; ++c) + init_color(c, + all_colors[c].red, + all_colors[c].green, + all_colors[c].blue); +} + +#define scaled_rgb(n) ((255 * (n)) / 1000) + +static void +color_edit(void) +/* display the color test pattern, without trying to edit colors */ +{ + int i; + int current = 0; + int this_c = 0, value = 0, field = 0; + int last_c; + int top_color = 0; + int page_size = (LINES - 6); + + init_all_colors(); + refresh(); + + for (i = 0; i < max_colors; i++) + init_pair((short) i, (short) COLOR_WHITE, (short) i); + + MvPrintw(LINES - 2, 0, "Number: %d", value); + + do { + short red, green, blue; + + attron(A_BOLD); + MvAddStr(0, 20, "Color RGB Value Editing"); + attroff(A_BOLD); + + for (i = (short) top_color; + (i - top_color < page_size) + && (i < max_colors); i++) { + char numeric[80]; + + sprintf(numeric, "[%d]", i); + MvPrintw(2 + i - top_color, 0, "%c %-8s:", + (i == current ? '>' : ' '), + (i < (int) SIZEOF(the_color_names) + ? the_color_names[i] : numeric)); + (void) attrset((attr_t) COLOR_PAIR(i)); + addstr(" "); + (void) attrset(A_NORMAL); + + color_content((short) i, &red, &green, &blue); + addstr(" R = "); + if (current == i && field == 0) + attron(A_STANDOUT); + printw("%04d", red); + if (current == i && field == 0) + (void) attrset(A_NORMAL); + addstr(", G = "); + if (current == i && field == 1) + attron(A_STANDOUT); + printw("%04d", green); + if (current == i && field == 1) + (void) attrset(A_NORMAL); + addstr(", B = "); + if (current == i && field == 2) + attron(A_STANDOUT); + printw("%04d", blue); + if (current == i && field == 2) + (void) attrset(A_NORMAL); + (void) attrset(A_NORMAL); + printw(" ( %3d %3d %3d )", + scaled_rgb(red), + scaled_rgb(green), + scaled_rgb(blue)); + } + + MvAddStr(LINES - 3, 0, + "Use up/down to select a color, left/right to change fields."); + MvAddStr(LINES - 2, 0, + "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); + + move(2 + current - top_color, 0); + + last_c = this_c; + this_c = Getchar(); + if (this_c < 256 && isdigit(this_c) && !isdigit(last_c)) + value = 0; + + switch (this_c) { + case CTRL('b'): + case KEY_PPAGE: + if (current > 0) + current -= (page_size - 1); + else + beep(); + break; + + case CTRL('f'): + case KEY_NPAGE: + if (current < (max_colors - 1)) + current += (page_size - 1); + else + beep(); + break; + + case CTRL('p'): + case KEY_UP: + current = (current == 0 ? (max_colors - 1) : current - 1); + break; + + case CTRL('n'): + case KEY_DOWN: + current = (current == (max_colors - 1) ? 0 : current + 1); + break; + + case KEY_RIGHT: + field = (field == 2 ? 0 : field + 1); + break; + + case KEY_LEFT: + field = (field == 0 ? 2 : field - 1); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + value = value * 10 + (this_c - '0'); + break; + + case '+': + change_color((short) current, field, value, 1); + break; + + case '-': + change_color((short) current, field, -value, 1); + break; + + case '=': + change_color((short) current, field, value, 0); + break; + + case '?': + erase(); + P(" RGB Value Editing Help"); + P(""); + P("You are in the RGB value editor. Use the arrow keys to select one of"); + P("the fields in one of the RGB triples of the current colors; the one"); + P("currently selected will be reverse-video highlighted."); + P(""); + P("To change a field, enter the digits of the new value; they are echoed"); + P("as entered. Finish by typing `='. The change will take effect instantly."); + P("To increment or decrement a value, use the same procedure, but finish"); + P("with a `+' or `-'."); + P(""); + P("Press 'm' to invoke the top-level menu with the current color settings."); + P("To quit, do ESC"); + + Pause(); + erase(); + break; + + case 'm': + endwin(); + main_menu(FALSE); + for (i = 0; i < max_colors; i++) + init_pair((short) i, (short) COLOR_WHITE, (short) i); + refresh(); + break; + + case case_QUIT: + break; + + default: + beep(); + break; + } + + if (current < 0) + current = 0; + if (current >= max_colors) + current = max_colors - 1; + if (current < top_color) + top_color = current; + if (current - top_color >= page_size) + top_color = current - (page_size - 1); + + MvPrintw(LINES - 1, 0, "Number: %d", value); + clrtoeol(); + } while + (!isQuit(this_c)); + + erase(); + + /* + * ncurses does not reset each color individually when calling endwin(). + */ + init_all_colors(); + + endwin(); +} + +/**************************************************************************** + * + * Alternate character-set stuff + * + ****************************************************************************/ +/* *INDENT-OFF* */ +static struct { + chtype attr; + const char *name; +} attrs_to_cycle[] = { + { A_NORMAL, "normal" }, + { A_BOLD, "bold" }, + { A_BLINK, "blink" }, + { A_REVERSE, "reverse" }, + { A_UNDERLINE, "underline" }, +}; +/* *INDENT-ON* */ + +static bool +cycle_attr(int ch, unsigned *at_code, chtype *attr) +{ + bool result = TRUE; + + switch (ch) { + case 'v': + if ((*at_code += 1) >= SIZEOF(attrs_to_cycle)) + *at_code = 0; + break; + case 'V': + if (*at_code == 0) + *at_code = SIZEOF(attrs_to_cycle) - 1; + else + *at_code -= 1; + break; + default: + result = FALSE; + break; + } + if (result) + *attr = attrs_to_cycle[*at_code].attr; + return result; +} + +static bool +cycle_colors(int ch, int *fg, int *bg, short *pair) +{ + bool result = FALSE; + + if (use_colors) { + result = TRUE; + switch (ch) { + case 'F': + if ((*fg -= 1) < 0) + *fg = COLORS - 1; + break; + case 'f': + if ((*fg += 1) >= COLORS) + *fg = 0; + break; + case 'B': + if ((*bg -= 1) < 0) + *bg = COLORS - 1; + break; + case 'b': + if ((*bg += 1) >= COLORS) + *bg = 0; + break; + default: + result = FALSE; + break; + } + if (result) { + *pair = (short) (*fg != COLOR_BLACK || *bg != COLOR_BLACK); + if (*pair != 0) { + *pair = 1; + if (init_pair(*pair, (short) *fg, (short) *bg) == ERR) { + result = FALSE; + } + } + } + } + return result; +} + +/**************************************************************************** + * + * Soft-key label test + * + ****************************************************************************/ + +#if USE_SOFTKEYS + +#define SLK_HELP 17 +#define SLK_WORK (SLK_HELP + 3) + +static void +slk_help(void) +{ + static const char *table[] = + { + "Available commands are:" + ,"" + ,"^L -- repaint this message and activate soft keys" + ,"a/d -- activate/disable soft keys" + ,"c -- set centered format for labels" + ,"l -- set left-justified format for labels" + ,"r -- set right-justified format for labels" + ,"[12345678] -- set label; labels are numbered 1 through 8" + ,"e -- erase stdscr (should not erase labels)" + ,"s -- test scrolling of shortened screen" + ,"v/V -- cycle through video attributes" +#if HAVE_SLK_COLOR + ,"F/f/B/b -- cycle through foreground/background colors" +#endif + ,"ESC -- return to main menu" + ,"" + ,"Note: if activating the soft keys causes your terminal to scroll up" + ,"one line, your terminal auto-scrolls when anything is written to the" + ,"last screen position. The ncurses code does not yet handle this" + ,"gracefully." + }; + unsigned j; + + move(2, 0); + for (j = 0; j < SIZEOF(table); ++j) { + P(table[j]); + } + refresh(); +} + +#if HAVE_SLK_COLOR +static void +call_slk_color(int fg, int bg) +{ + init_pair(1, (short) bg, (short) fg); + slk_color(1); + MvPrintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg); + clrtoeol(); + slk_touch(); + slk_noutrefresh(); + refresh(); +} +#endif + +static void +slk_test(void) +/* exercise the soft keys */ +{ + int c, fmt = 1; + char buf[9]; + char *s; + chtype attr = A_NORMAL; + unsigned at_code = 0; +#if HAVE_SLK_COLOR + int fg = COLOR_BLACK; + int bg = COLOR_WHITE; + short pair = 0; +#endif + + c = CTRL('l'); +#if HAVE_SLK_COLOR + if (use_colors) { + call_slk_color(fg, bg); + } +#endif + + do { + move(0, 0); + switch (c) { + case CTRL('l'): + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Soft Key Exerciser"); + attroff(A_BOLD); + + slk_help(); + /* fall through */ + + case 'a': + slk_restore(); + break; + + case 'e': + wclear(stdscr); + break; + + case 's': + MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: "); + while ((c = Getchar()) != 'Q' && (c != ERR)) + addch((chtype) c); + break; + + case 'd': + slk_clear(); + break; + + case 'l': + fmt = 0; + break; + + case 'c': + fmt = 1; + break; + + case 'r': + fmt = 2; + break; + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + MvAddStr(SLK_WORK, 0, "Please enter the label value: "); + strcpy(buf, ""); + if ((s = slk_label(c - '0')) != 0) { + strncpy(buf, s, 8); + } + wGetstring(stdscr, buf, 8); + slk_set((c - '0'), buf, fmt); + slk_refresh(); + move(SLK_WORK, 0); + clrtobot(); + break; + + case case_QUIT: + goto done; + +#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE + case KEY_RESIZE: + wnoutrefresh(stdscr); + break; +#endif + + default: + if (cycle_attr(c, &at_code, &attr)) { + slk_attrset(attr); + slk_touch(); + slk_noutrefresh(); + break; + } +#if HAVE_SLK_COLOR + if (cycle_colors(c, &fg, &bg, &pair)) { + if (use_colors) { + call_slk_color(fg, bg); + } else { + beep(); + } + break; + } +#endif + beep(); + break; + } + } while (!isQuit(c = Getchar())); + + done: + slk_clear(); + erase(); + endwin(); +} + +#if USE_WIDEC_SUPPORT +#define SLKLEN 8 +static void +wide_slk_test(void) +/* exercise the soft keys */ +{ + int c, fmt = 1; + wchar_t buf[SLKLEN + 1]; + char *s; + chtype attr = A_NORMAL; + unsigned at_code = 0; + int fg = COLOR_BLACK; + int bg = COLOR_WHITE; + short pair = 0; + + c = CTRL('l'); + if (use_colors) { + call_slk_color(fg, bg); + } + do { + move(0, 0); + switch (c) { + case CTRL('l'): + erase(); + attr_on(WA_BOLD, NULL); + MvAddStr(0, 20, "Soft Key Exerciser"); + attr_off(WA_BOLD, NULL); + + slk_help(); + /* fall through */ + + case 'a': + slk_restore(); + break; + + case 'e': + wclear(stdscr); + break; + + case 's': + MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: "); + while ((c = Getchar()) != 'Q' && (c != ERR)) + addch((chtype) c); + break; + + case 'd': + slk_clear(); + break; + + case 'l': + fmt = 0; + break; + + case 'c': + fmt = 1; + break; + + case 'r': + fmt = 2; + break; + + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + MvAddStr(SLK_WORK, 0, "Please enter the label value: "); + *buf = 0; + if ((s = slk_label(c - '0')) != 0) { + 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) { + const char *base = s; + reset_mbytes(state); + test = count_mbytes(base, 0, &state); + if (test == (size_t) -1) { + temp[--used] = 0; + } else if (test > want) { + temp[--used] = 0; + } else { + reset_mbytes(state); + trans_mbytes(buf, base, want, &state); + break; + } + } + free(temp); + } + wGet_wstring(stdscr, buf, SLKLEN); + slk_wset((c - '0'), buf, fmt); + slk_refresh(); + move(SLK_WORK, 0); + clrtobot(); + break; + + case case_QUIT: + goto done; + + case 'F': + if (use_colors) { + fg = (short) ((fg + 1) % COLORS); + call_slk_color(fg, bg); + } + break; + case 'B': + if (use_colors) { + bg = (short) ((bg + 1) % COLORS); + call_slk_color(fg, bg); + } + break; +#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE + case KEY_RESIZE: + wnoutrefresh(stdscr); + break; +#endif + default: + if (cycle_attr(c, &at_code, &attr)) { + slk_attr_set(attr, (fg || bg), NULL); + slk_touch(); + slk_noutrefresh(); + break; + } +#if HAVE_SLK_COLOR + if (cycle_colors(c, &fg, &bg, &pair)) { + if (use_colors) { + call_slk_color(fg, bg); + } else { + beep(); + } + break; + } +#endif + beep(); + break; + } + } while (!isQuit(c = Getchar())); + + done: + slk_clear(); + erase(); + endwin(); +} +#endif +#endif /* SLK_INIT */ + +/* ISO 6429: codes 0x80 to 0x9f may be control characters that cause the + * terminal to perform functions. The remaining codes can be graphic. + */ +static void +show_upper_chars(unsigned first, int repeat, attr_t attr, short pair) +{ + bool C1 = (first == 128); + unsigned code; + unsigned last = first + 31; + int reply; + + erase(); + attron(A_BOLD); + MvPrintw(0, 20, "Display of %s Character Codes %d to %d", + C1 ? "C1" : "GR", first, last); + attroff(A_BOLD); + refresh(); + + for (code = first; code <= last; code++) { + int count = repeat; + int row = 2 + ((int) (code - first) % 16); + int col = ((int) (code - first) / 16) * COLS / 2; + char tmp[80]; + sprintf(tmp, "%3u (0x%x)", code, code); + MvPrintw(row, col, "%*s: ", COLS / 4, tmp); + + do { + if (C1) + nodelay(stdscr, TRUE); + echochar(colored_chtype(code, attr, pair)); + if (C1) { + /* (yes, this _is_ crude) */ + while ((reply = Getchar()) != ERR) { + addch(UChar(reply)); + napms(10); + } + nodelay(stdscr, FALSE); + } + } while (--count > 0); + } +} + +#define PC_COLS 4 + +static void +show_pc_chars(int repeat, attr_t attr, short pair) +{ + unsigned code; + + erase(); + attron(A_BOLD); + MvPrintw(0, 20, "Display of PC Character Codes"); + attroff(A_BOLD); + refresh(); + + for (code = 0; code < 16; ++code) { + MvPrintw(2, (int) code * PC_COLS + 8, "%X", code); + } + for (code = 0; code < 256; code++) { + int count = repeat; + int row = 3 + (int) (code / 16) + (code >= 128); + int col = 8 + (int) (code % 16) * PC_COLS; + if ((code % 16) == 0) + MvPrintw(row, 0, "0x%02x:", code); + move(row, col); + do { + switch (code) { + case '\n': + case '\r': + case '\b': + case '\f': + case '\033': + case 0x9b: + /* + * Skip the ones that do not work. + */ + break; + default: + addch(colored_chtype(code, A_ALTCHARSET | attr, pair)); + break; + } + } while (--count > 0); + } +} + +static void +show_box_chars(int repeat, attr_t attr, short pair) +{ + (void) repeat; + + attr |= (attr_t) COLOR_PAIR(pair); + + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the ACS Line-Drawing Set"); + attroff(A_BOLD); + refresh(); + /* *INDENT-OFF* */ + wborder(stdscr, + colored_chtype(ACS_VLINE, attr, pair), + colored_chtype(ACS_VLINE, attr, pair), + colored_chtype(ACS_HLINE, attr, pair), + colored_chtype(ACS_HLINE, attr, pair), + colored_chtype(ACS_ULCORNER, attr, pair), + colored_chtype(ACS_URCORNER, attr, pair), + colored_chtype(ACS_LLCORNER, attr, pair), + colored_chtype(ACS_LRCORNER, attr, pair)); + MvHLine(LINES / 2, 0, colored_chtype(ACS_HLINE, attr, pair), COLS); + MvVLine(0, COLS / 2, colored_chtype(ACS_VLINE, attr, pair), LINES); + MvAddCh(0, COLS / 2, colored_chtype(ACS_TTEE, attr, pair)); + MvAddCh(LINES / 2, COLS / 2, colored_chtype(ACS_PLUS, attr, pair)); + MvAddCh(LINES - 1, COLS / 2, colored_chtype(ACS_BTEE, attr, 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 +show_1_acs(int n, int repeat, const char *name, chtype code) +{ + const int height = 16; + int row = 2 + (n % height); + int col = (n / height) * COLS / 2; + + MvPrintw(row, col, "%*s : ", COLS / 4, name); + do { + addch(code); + } while (--repeat > 0); + return n + 1; +} + +static void +show_acs_chars(int repeat, attr_t attr, short pair) +/* display the ACS character set */ +{ + int n; + +#define BOTH(name) #name, colored_chtype(name, attr, (chtype) pair) + + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the ACS Character Set"); + attroff(A_BOLD); + refresh(); + + n = show_1_acs(0, repeat, BOTH(ACS_ULCORNER)); + n = show_1_acs(n, repeat, BOTH(ACS_URCORNER)); + n = show_1_acs(n, repeat, BOTH(ACS_LLCORNER)); + n = show_1_acs(n, repeat, BOTH(ACS_LRCORNER)); + + n = show_1_acs(n, repeat, BOTH(ACS_LTEE)); + n = show_1_acs(n, repeat, BOTH(ACS_RTEE)); + n = show_1_acs(n, repeat, BOTH(ACS_TTEE)); + n = show_1_acs(n, repeat, BOTH(ACS_BTEE)); + + n = show_1_acs(n, repeat, BOTH(ACS_HLINE)); + n = show_1_acs(n, repeat, BOTH(ACS_VLINE)); + + /* + * HPUX's ACS definitions are broken here. Just give up. + */ +#if !(defined(__hpux) && !defined(NCURSES_VERSION)) + n = show_1_acs(n, repeat, BOTH(ACS_LARROW)); + n = show_1_acs(n, repeat, BOTH(ACS_RARROW)); + n = show_1_acs(n, repeat, BOTH(ACS_UARROW)); + n = show_1_acs(n, repeat, BOTH(ACS_DARROW)); + + n = show_1_acs(n, repeat, BOTH(ACS_BLOCK)); + n = show_1_acs(n, repeat, BOTH(ACS_BOARD)); + n = show_1_acs(n, repeat, BOTH(ACS_LANTERN)); + n = show_1_acs(n, repeat, BOTH(ACS_BULLET)); + n = show_1_acs(n, repeat, BOTH(ACS_CKBOARD)); + n = show_1_acs(n, repeat, BOTH(ACS_DEGREE)); + n = show_1_acs(n, repeat, BOTH(ACS_DIAMOND)); + n = show_1_acs(n, repeat, BOTH(ACS_PLMINUS)); + n = show_1_acs(n, repeat, BOTH(ACS_PLUS)); + + n = show_1_acs(n, repeat, BOTH(ACS_GEQUAL)); + n = show_1_acs(n, repeat, BOTH(ACS_NEQUAL)); + n = show_1_acs(n, repeat, BOTH(ACS_LEQUAL)); + + n = show_1_acs(n, repeat, BOTH(ACS_STERLING)); + n = show_1_acs(n, repeat, BOTH(ACS_PI)); + n = show_1_acs(n, repeat, BOTH(ACS_S1)); + n = show_1_acs(n, repeat, BOTH(ACS_S3)); + n = show_1_acs(n, repeat, BOTH(ACS_S7)); + (void) show_1_acs(n, repeat, BOTH(ACS_S9)); +#endif +} + +static void +acs_display(void) +{ + int c = 'a'; + char *term = getenv("TERM"); + const char *pch_kludge = ((term != 0 && strstr(term, "linux")) + ? "p=PC, " + : ""); + chtype attr = A_NORMAL; + int digit = 0; + int repeat = 1; + int fg = COLOR_BLACK; + int bg = COLOR_BLACK; + unsigned at_code = 0; + short pair = 0; + void (*last_show_acs) (int, attr_t, short) = 0; + + do { + switch (c) { + case CTRL('L'): + Repaint(); + break; + case 'a': + ToggleAcs(last_show_acs, show_acs_chars); + break; + case 'p': + if (*pch_kludge) + ToggleAcs(last_show_acs, show_pc_chars); + else + beep(); + break; + case 'x': + ToggleAcs(last_show_acs, show_box_chars); + break; + case '0': + case '1': + case '2': + case '3': + digit = (c - '0'); + last_show_acs = 0; + break; + case '-': + if (digit > 0) { + --digit; + last_show_acs = 0; + } else { + beep(); + } + break; + case '+': + if (digit < 3) { + ++digit; + last_show_acs = 0; + } else { + beep(); + } + break; + case '>': + if (repeat < (COLS / 4)) + ++repeat; + break; + case '<': + if (repeat > 1) + --repeat; + break; + default: + if (cycle_attr(c, &at_code, &attr) + || cycle_colors(c, &fg, &bg, &pair)) { + break; + } else { + beep(); + } + break; + } + if (last_show_acs != 0) + last_show_acs(repeat, attr, pair); + else + show_upper_chars((unsigned) (digit * 32 + 128), repeat, attr, pair); + + MvPrintw(LINES - 3, 0, + "Note: ANSI terminals may not display C1 characters."); + MvPrintw(LINES - 2, 0, + "Select: a=ACS, x=box, %s0=C1, 1-3,+/- non-ASCII, repeat, ESC=quit", + pch_kludge); + if (use_colors) { + MvPrintw(LINES - 1, 0, + "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.", + attrs_to_cycle[at_code].name, + fg, bg); + } else { + MvPrintw(LINES - 1, 0, + "v/V cycles through video attributes (%s).", + attrs_to_cycle[at_code].name); + } + refresh(); + } while (!isQuit(c = Getchar())); + + Pause(); + erase(); + endwin(); +} + +#if USE_WIDEC_SUPPORT +static cchar_t * +merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair) +{ + int count; + + *dst = *src; + do { + TEST_CCHAR(src, count, { + attr |= (test_attrs & A_ALTCHARSET); + setcchar(dst, test_wch, attr, pair, NULL); + } + , { + ; + }); + } while (0); + return dst; +} + +static void +show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair) +{ + cchar_t temp; + wchar_t code; + int last = first + 31; + + erase(); + attron(A_BOLD); + MvPrintw(0, 20, "Display of Character Codes %d to %d", first, last); + attroff(A_BOLD); + + for (code = first; (int) code <= last; code++) { + int row = 2 + ((code - first) % 16); + int col = ((code - first) / 16) * COLS / 2; + wchar_t codes[10]; + char tmp[80]; + int count = repeat; + int y, x; + + memset(&codes, 0, sizeof(codes)); + codes[0] = code; + sprintf(tmp, "%3ld (0x%lx)", (long) code, (long) code); + MvPrintw(row, col, "%*s: ", COLS / 4, tmp); + setcchar(&temp, codes, attr, pair, 0); + do { + /* + * Give non-spacing characters something to combine with. If we + * don't, they'll bunch up in a heap on the space after the ":". + * Mark them with reverse-video to make them simpler to find on + * the display. + */ + if (wcwidth(code) == 0) { + addch((chtype) space | + (A_REVERSE ^ attr) | + (attr_t) COLOR_PAIR(pair)); + } + /* + * This could use add_wch(), but is done for comparison with the + * normal 'f' test (and to make a test-case for echo_wchar()). + * The screen will flicker because the erase() at the top of the + * function is met by the builtin refresh() in echo_wchar(). + */ + echo_wchar(&temp); + /* + * The repeat-count may make text wrap - avoid that. + */ + getyx(stdscr, y, x); + if (x >= col + (COLS / 2) - 2) + break; + } while (--count > 0); + } +} + +static int +show_1_wacs(int n, int repeat, const char *name, const cchar_t *code) +{ + const int height = 16; + int row = 2 + (n % height); + int col = (n / height) * COLS / 2; + + MvPrintw(row, col, "%*s : ", COLS / 4, name); + while (--repeat >= 0) { + add_wch(code); + } + return n + 1; +} + +#define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair) + +static void +show_wacs_chars(int repeat, attr_t attr, short pair) +/* display the wide-ACS character set */ +{ + cchar_t temp; + + int n; + +/*#define BOTH2(name) #name, &(name) */ +#define BOTH2(name) #name, MERGE_ATTR(name) + + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + + n = show_1_wacs(0, repeat, BOTH2(WACS_ULCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_URCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LLCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LRCORNER)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_LTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_RTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_TTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BTEE)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_HLINE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_VLINE)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET)); + n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD)); + 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)); + +#ifdef CURSES_WACS_ARRAY + n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL)); + n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING)); + n = show_1_wacs(n, repeat, BOTH2(WACS_PI)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S1)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S3)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S7)); + (void) show_1_wacs(n, repeat, BOTH2(WACS_S9)); +#endif +} + +#ifdef WACS_D_PLUS +static void +show_wacs_chars_double(int repeat, attr_t attr, short pair) +/* display the wide-ACS character set */ +{ + cchar_t temp; + + int n; + +/*#define BOTH2(name) #name, &(name) */ +#define BOTH2(name) #name, MERGE_ATTR(name) + + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + + n = show_1_wacs(0, repeat, BOTH2(WACS_D_ULCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_URCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_LLCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_LRCORNER)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_D_LTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_RTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_TTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_BTEE)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_D_HLINE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_D_VLINE)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET)); + n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD)); + 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)); + +#ifdef CURSES_WACS_ARRAY + n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL)); + n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING)); + n = show_1_wacs(n, repeat, BOTH2(WACS_PI)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S1)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S3)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S7)); + (void) show_1_wacs(n, repeat, BOTH2(WACS_S9)); +#endif +} +#endif + +#ifdef WACS_T_PLUS +static void +show_wacs_chars_thick(int repeat, attr_t attr, short pair) +/* display the wide-ACS character set */ +{ + cchar_t temp; + + int n; + +/*#define BOTH2(name) #name, &(name) */ +#define BOTH2(name) #name, MERGE_ATTR(name) + + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + + n = show_1_wacs(0, repeat, BOTH2(WACS_T_ULCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_URCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_LLCORNER)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_LRCORNER)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_T_LTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_RTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_TTEE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_BTEE)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_T_HLINE)); + n = show_1_wacs(n, repeat, BOTH2(WACS_T_VLINE)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW)); + n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN)); + n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET)); + n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD)); + 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)); + +#ifdef CURSES_WACS_ARRAY + n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL)); + n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL)); + n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL)); + + n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING)); + n = show_1_wacs(n, repeat, BOTH2(WACS_PI)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S1)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S3)); + n = show_1_wacs(n, repeat, BOTH2(WACS_S7)); + (void) show_1_wacs(n, repeat, BOTH2(WACS_S9)); +#endif +} +#endif + +#undef MERGE_ATTR + +#define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair) + +static void +show_wbox_chars(int repeat, attr_t attr, short pair) +{ + cchar_t temp[8]; + + (void) repeat; + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the Wide-ACS Line-Drawing Set"); + attroff(A_BOLD); + refresh(); + + wborder_set(stdscr, + MERGE_ATTR(0, WACS_VLINE), + MERGE_ATTR(1, WACS_VLINE), + MERGE_ATTR(2, WACS_HLINE), + MERGE_ATTR(3, WACS_HLINE), + MERGE_ATTR(4, WACS_ULCORNER), + MERGE_ATTR(5, WACS_URCORNER), + MERGE_ATTR(6, WACS_LLCORNER), + MERGE_ATTR(7, WACS_LRCORNER)); + /* *INDENT-OFF* */ + (void) mvhline_set(LINES / 2, 0, MERGE_ATTR(0, WACS_HLINE), COLS); + (void) mvvline_set(0, COLS / 2, MERGE_ATTR(0, WACS_VLINE), LINES); + (void) mvadd_wch(0, COLS / 2, MERGE_ATTR(0, WACS_TTEE)); + (void) mvadd_wch(LINES / 2, COLS / 2, MERGE_ATTR(0, WACS_PLUS)); + (void) mvadd_wch(LINES - 1, COLS / 2, MERGE_ATTR(0, WACS_BTEE)); + (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 + +static int +show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair) +{ + const int height = 16; + int row = 2 + (n % height); + int col = (n / height) * COLS / 2; + char temp[80]; + + MvPrintw(row, col, "%*s : ", COLS / 4, name); + (void) attr_set(attr, pair, 0); + addstr(strcpy(temp, code)); + (void) attr_set(A_NORMAL, 0, 0); + return n + 1; +} + +#define SHOW_UTF8(n, name, code) show_2_wacs(n, name, code, attr, pair) + +static void +show_utf8_chars(int repeat, attr_t attr, short pair) +{ + int n; + + (void) repeat; + erase(); + attron(A_BOLD); + MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); + attroff(A_BOLD); + refresh(); + /* *INDENT-OFF* */ + n = SHOW_UTF8(0, "WACS_ULCORNER", "\342\224\214"); + n = SHOW_UTF8(n, "WACS_URCORNER", "\342\224\220"); + n = SHOW_UTF8(n, "WACS_LLCORNER", "\342\224\224"); + n = SHOW_UTF8(n, "WACS_LRCORNER", "\342\224\230"); + + n = SHOW_UTF8(n, "WACS_LTEE", "\342\224\234"); + n = SHOW_UTF8(n, "WACS_RTEE", "\342\224\244"); + n = SHOW_UTF8(n, "WACS_TTEE", "\342\224\254"); + n = SHOW_UTF8(n, "WACS_BTEE", "\342\224\264"); + + n = SHOW_UTF8(n, "WACS_HLINE", "\342\224\200"); + n = SHOW_UTF8(n, "WACS_VLINE", "\342\224\202"); + + n = SHOW_UTF8(n, "WACS_LARROW", "\342\206\220"); + n = SHOW_UTF8(n, "WACS_RARROW", "\342\206\222"); + n = SHOW_UTF8(n, "WACS_UARROW", "\342\206\221"); + n = SHOW_UTF8(n, "WACS_DARROW", "\342\206\223"); + + n = SHOW_UTF8(n, "WACS_BLOCK", "\342\226\256"); + n = SHOW_UTF8(n, "WACS_BOARD", "\342\226\222"); + n = SHOW_UTF8(n, "WACS_LANTERN", "\342\230\203"); + n = SHOW_UTF8(n, "WACS_BULLET", "\302\267"); + n = SHOW_UTF8(n, "WACS_CKBOARD", "\342\226\222"); + n = SHOW_UTF8(n, "WACS_DEGREE", "\302\260"); + n = SHOW_UTF8(n, "WACS_DIAMOND", "\342\227\206"); + n = SHOW_UTF8(n, "WACS_PLMINUS", "\302\261"); + n = SHOW_UTF8(n, "WACS_PLUS", "\342\224\274"); + n = SHOW_UTF8(n, "WACS_GEQUAL", "\342\211\245"); + n = SHOW_UTF8(n, "WACS_NEQUAL", "\342\211\240"); + n = SHOW_UTF8(n, "WACS_LEQUAL", "\342\211\244"); + + n = SHOW_UTF8(n, "WACS_STERLING", "\302\243"); + n = SHOW_UTF8(n, "WACS_PI", "\317\200"); + n = SHOW_UTF8(n, "WACS_S1", "\342\216\272"); + n = SHOW_UTF8(n, "WACS_S3", "\342\216\273"); + 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) +{ + int c = 'a'; + int digit = 0; + int repeat = 1; + int space = ' '; + chtype attr = A_NORMAL; + int fg = COLOR_BLACK; + int bg = COLOR_BLACK; + unsigned at_code = 0; + short pair = 0; + void (*last_show_wacs) (int, attr_t, short) = 0; + + do { + switch (c) { + case CTRL('L'): + Repaint(); + break; + case 'a': + ToggleAcs(last_show_wacs, show_wacs_chars); + break; +#ifdef WACS_D_PLUS + case 'd': + ToggleAcs(last_show_wacs, show_wacs_chars_double); + break; +#endif +#ifdef WACS_T_PLUS + case 't': + ToggleAcs(last_show_wacs, show_wacs_chars_thick); + break; +#endif + case 'x': + ToggleAcs(last_show_wacs, show_wbox_chars); + break; + case 'u': + ToggleAcs(last_show_wacs, show_utf8_chars); + break; + default: + if (c < 256 && isdigit(c)) { + digit = (c - '0'); + last_show_wacs = 0; + } else if (c == '+') { + ++digit; + last_show_wacs = 0; + } else if (c == '-' && digit > 0) { + --digit; + last_show_wacs = 0; + } else if (c == '>' && repeat < (COLS / 4)) { + ++repeat; + } else if (c == '<' && repeat > 1) { + --repeat; + } else if (c == '_') { + space = (space == ' ') ? '_' : ' '; + last_show_wacs = 0; + } else if (cycle_attr(c, &at_code, &attr) + || cycle_colors(c, &fg, &bg, &pair)) { + if (last_show_wacs != 0) + break; + } else { + beep(); + break; + } + break; + } + if (last_show_wacs != 0) + last_show_wacs(repeat, attr, pair); + else + show_upper_widechars(digit * 32 + 128, repeat, space, attr, pair); + + MvPrintw(LINES - 3, 0, + "Select: a/d/t WACS, x box, u UTF-8, 0-9,+/- non-ASCII, repeat, ESC=quit"); + if (use_colors) { + MvPrintw(LINES - 2, 0, + "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.", + attrs_to_cycle[at_code].name, + fg, bg); + } else { + MvPrintw(LINES - 2, 0, + "v/V cycles through video attributes (%s).", + attrs_to_cycle[at_code].name); + } + refresh(); + } while (!isQuit(c = Getchar())); + + Pause(); + erase(); + endwin(); +} + +#endif + +/* + * Graphic-rendition test (adapted from vttest) + */ +static void +test_sgr_attributes(void) +{ + int pass; + + for (pass = 0; pass < 2; pass++) { + chtype normal = ((pass == 0 ? A_NORMAL : A_REVERSE)) | BLANK; + + /* Use non-default colors if possible to exercise bce a little */ + if (use_colors) { + init_pair(1, COLOR_WHITE, COLOR_BLUE); + normal |= COLOR_PAIR(1); + } + bkgdset(normal); + erase(); + MvPrintw(1, 20, "Graphic rendition test pattern:"); + + MvPrintw(4, 1, "vanilla"); + +#define set_sgr(mask) bkgdset((normal^(mask))); + set_sgr(A_BOLD); + MvPrintw(4, 40, "bold"); + + set_sgr(A_UNDERLINE); + MvPrintw(6, 6, "underline"); + + set_sgr(A_BOLD | A_UNDERLINE); + MvPrintw(6, 45, "bold underline"); + + set_sgr(A_BLINK); + MvPrintw(8, 1, "blink"); + + set_sgr(A_BLINK | A_BOLD); + MvPrintw(8, 40, "bold blink"); + + set_sgr(A_UNDERLINE | A_BLINK); + MvPrintw(10, 6, "underline blink"); + + set_sgr(A_BOLD | A_UNDERLINE | A_BLINK); + MvPrintw(10, 45, "bold underline blink"); + + set_sgr(A_REVERSE); + MvPrintw(12, 1, "negative"); + + set_sgr(A_BOLD | A_REVERSE); + MvPrintw(12, 40, "bold negative"); + + set_sgr(A_UNDERLINE | A_REVERSE); + MvPrintw(14, 6, "underline negative"); + + set_sgr(A_BOLD | A_UNDERLINE | A_REVERSE); + MvPrintw(14, 45, "bold underline negative"); + + set_sgr(A_BLINK | A_REVERSE); + MvPrintw(16, 1, "blink negative"); + + set_sgr(A_BOLD | A_BLINK | A_REVERSE); + MvPrintw(16, 40, "bold blink negative"); + + set_sgr(A_UNDERLINE | A_BLINK | A_REVERSE); + MvPrintw(18, 6, "underline blink negative"); + + set_sgr(A_BOLD | A_UNDERLINE | A_BLINK | A_REVERSE); + MvPrintw(18, 45, "bold underline blink negative"); + + bkgdset(normal); + MvPrintw(LINES - 2, 1, "%s background. ", pass == 0 ? "Dark" : + "Light"); + clrtoeol(); + Pause(); + } + + bkgdset(A_NORMAL | BLANK); + erase(); + endwin(); +} + +/**************************************************************************** + * + * Windows and scrolling tester. + * + ****************************************************************************/ + +#define BOTLINES 4 /* number of line stolen from screen bottom */ + +typedef struct { + int y, x; +} pair; + +#define FRAME struct frame +FRAME +{ + FRAME *next, *last; + bool do_scroll; + bool do_keypad; + WINDOW *wind; +}; + +#if defined(NCURSES_VERSION) +#if (NCURSES_VERSION_PATCH < 20070331) && NCURSES_EXT_FUNCS +#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 +#define is_scrollok(win) FALSE +#endif + +static WINDOW * +frame_win(FRAME * curp) +{ + return (curp != 0) ? curp->wind : stdscr; +} + +/* We need to know if these flags are actually set, so don't look in FRAME. + * These names are known to work with SVr4 curses as well as ncurses. The + * _use_keypad name does not work with Solaris 8. + */ +static bool +HaveKeypad(FRAME * curp) +{ + WINDOW *win = frame_win(curp); + (void) win; + return is_keypad(win); +} + +static bool +HaveScroll(FRAME * curp) +{ + WINDOW *win = frame_win(curp); + (void) win; + return is_scrollok(win); +} + +static void +newwin_legend(FRAME * curp) +{ + 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 + }, +#if HAVE_WRESIZE + { + "^X = resize", 0 + }, +#endif + { + "^Q%s = exit", 3 + } + }; + 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++) { + switch (legend[n].code) { + default: + strcpy(buf, legend[n].msg); + break; + case 1: + sprintf(buf, legend[n].msg, do_keypad ? "yes" : "no"); + break; + case 2: + sprintf(buf, legend[n].msg, do_scroll ? "yes" : "no"); + break; + case 3: + sprintf(buf, legend[n].msg, do_keypad ? "/ESC" : ""); + break; + } + x = getcurx(stdscr); + addstr((COLS < (x + 3 + (int) strlen(buf))) ? "\n" : (n ? ", " : "")); + addstr(buf); + } + clrtoeol(); +} + +static void +transient(FRAME * curp, NCURSES_CONST char *msg) +{ + newwin_legend(curp); + if (msg) { + MvAddStr(LINES - 1, 0, msg); + refresh(); + napms(1000); + } + + move(LINES - 1, 0); + printw("%s characters are echoed, window should %sscroll.", + HaveKeypad(curp) ? "Non-arrow" : "All other", + HaveScroll(curp) ? "" : "not "); + clrtoeol(); +} + +static void +newwin_report(FRAME * curp) +/* report on the cursor's current position, then restore it */ +{ + WINDOW *win = frame_win(curp); + int y, x; + + if (win != stdscr) + transient(curp, (char *) 0); + getyx(win, y, x); + move(LINES - 1, COLS - 17); + printw("Y = %2d X = %2d", y, x); + if (win != stdscr) + refresh(); + else + wmove(win, y, x); +} + +static pair * +selectcell(int uli, int ulj, int lri, int lrj) +/* arrows keys move cursor, return location at current on non-arrow key */ +{ + static pair res; /* result cell */ + int si = lri - uli + 1; /* depth of the select area */ + int sj = lrj - ulj + 1; /* width of the select area */ + int i = 0, j = 0; /* offsets into the select area */ + + res.y = uli; + res.x = ulj; + for (;;) { + move(uli + i, ulj + j); + newwin_report((FRAME *) 0); + + switch (Getchar()) { + case KEY_UP: + i += si - 1; + break; + case KEY_DOWN: + i++; + break; + case KEY_LEFT: + j += sj - 1; + break; + case KEY_RIGHT: + j++; + break; + case case_QUIT: + return ((pair *) 0); +#ifdef NCURSES_MOUSE_VERSION + case KEY_MOUSE: + { + MEVENT event; + + getmouse(&event); + if (event.y > uli && event.x > ulj) { + i = event.y - uli; + j = event.x - ulj; + } else { + beep(); + break; + } + } + /* FALLTHRU */ +#endif + default: + res.y = uli + i; + res.x = ulj + j; + return (&res); + } + i %= si; + j %= sj; + } +} + +static void +outerbox(pair ul, pair lr, bool onoff) +/* draw or erase a box *outside* the given pair of corners */ +{ + MvAddCh(ul.y - 1, lr.x - 1, onoff ? ACS_ULCORNER : ' '); + MvAddCh(ul.y - 1, lr.x + 1, onoff ? ACS_URCORNER : ' '); + MvAddCh(lr.y + 1, lr.x + 1, onoff ? ACS_LRCORNER : ' '); + MvAddCh(lr.y + 1, ul.x - 1, onoff ? ACS_LLCORNER : ' '); + move(ul.y - 1, ul.x); + hline(onoff ? ACS_HLINE : ' ', lr.x - ul.x + 1); + move(ul.y, ul.x - 1); + vline(onoff ? ACS_VLINE : ' ', lr.y - ul.y + 1); + move(lr.y + 1, ul.x); + hline(onoff ? ACS_HLINE : ' ', lr.x - ul.x + 1); + move(ul.y, lr.x + 1); + vline(onoff ? ACS_VLINE : ' ', lr.y - ul.y + 1); +} + +static WINDOW * +getwindow(void) +/* Ask user for a window definition */ +{ + WINDOW *rwindow; + pair ul, lr, *tmp; + + move(0, 0); + clrtoeol(); + addstr("Use arrows to move cursor, anything else to mark corner 1"); + refresh(); + if ((tmp = selectcell(2, 1, LINES - BOTLINES - 2, COLS - 2)) == (pair *) 0) + return ((WINDOW *) 0); + memcpy(&ul, tmp, sizeof(pair)); + MvAddCh(ul.y - 1, ul.x - 1, ACS_ULCORNER); + move(0, 0); + clrtoeol(); + addstr("Use arrows to move cursor, anything else to mark corner 2"); + refresh(); + if ((tmp = selectcell(ul.y, ul.x, LINES - BOTLINES - 2, COLS - 2)) == + (pair *) 0) + return ((WINDOW *) 0); + memcpy(&lr, tmp, sizeof(pair)); + + rwindow = subwin(stdscr, lr.y - ul.y + 1, lr.x - ul.x + 1, ul.y, ul.x); + + outerbox(ul, lr, TRUE); + refresh(); + + wrefresh(rwindow); + + move(0, 0); + clrtoeol(); + return (rwindow); +} + +static void +newwin_move(FRAME * curp, int dy, int dx) +{ + WINDOW *win = frame_win(curp); + int cur_y, cur_x; + int max_y, max_x; + + getyx(win, cur_y, cur_x); + getmaxyx(win, max_y, max_x); + if ((cur_x += dx) < 0) + cur_x = 0; + else if (cur_x >= max_x) + cur_x = max_x - 1; + if ((cur_y += dy) < 0) + cur_y = 0; + else if (cur_y >= max_y) + cur_y = max_y - 1; + wmove(win, cur_y, cur_x); +} + +static FRAME * +delete_framed(FRAME * fp, bool showit) +{ + FRAME *np = 0; + + if (fp != 0) { + fp->last->next = fp->next; + fp->next->last = fp->last; + + if (showit) { + werase(fp->wind); + wrefresh(fp->wind); + } + delwin(fp->wind); + + np = (fp == fp->next) ? 0 : fp->next; + free(fp); + } + return np; +} + +static void +acs_and_scroll(void) +/* Demonstrate windows */ +{ + int c; + FRAME *current = (FRAME *) 0, *neww; + WINDOW *usescr; +#if HAVE_PUTWIN && HAVE_GETWIN + FILE *fp; +#endif + +#define DUMPFILE "screendump" + +#ifdef NCURSES_MOUSE_VERSION + mousemask(BUTTON1_CLICKED, (mmask_t *) 0); +#endif + c = CTRL('C'); + raw(); + do { + transient((FRAME *) 0, (char *) 0); + switch (c) { + case CTRL('C'): + if ((neww = typeCalloc(FRAME, 1)) == 0) { + goto breakout; + } + if ((neww->wind = getwindow()) == (WINDOW *) 0) { + free(neww); + goto breakout; + } + + if (current == 0) { /* First element, */ + neww->next = neww; /* so point it at itself */ + neww->last = neww; + } else { + neww->next = current->next; + neww->last = current; + neww->last->next = neww; + neww->next->last = neww; + } + current = neww; + /* SVr4 curses sets the keypad on all newly-created windows to + * false. Someone reported that PDCurses makes new windows inherit + * this flag. Remove the following 'keypad()' call to test this + */ + keypad(current->wind, TRUE); + current->do_keypad = HaveKeypad(current); + current->do_scroll = HaveScroll(current); + break; + + case CTRL('N'): /* go to next window */ + if (current) + current = current->next; + break; + + case CTRL('P'): /* go to previous window */ + if (current) + current = current->last; + break; + + case CTRL('F'): /* scroll current window forward */ + if (current) + wscrl(frame_win(current), 1); + break; + + case CTRL('B'): /* scroll current window backwards */ + if (current) + wscrl(frame_win(current), -1); + break; + + case CTRL('K'): /* toggle keypad mode for current */ + if (current) { + current->do_keypad = !current->do_keypad; + keypad(current->wind, current->do_keypad); + } + break; + + case CTRL('S'): + if (current) { + current->do_scroll = !current->do_scroll; + scrollok(current->wind, current->do_scroll); + } + break; + +#if HAVE_PUTWIN && HAVE_GETWIN + case CTRL('W'): /* save and delete window */ + if ((current != 0) && (current == current->next)) { + transient(current, "Will not save/delete ONLY window"); + break; + } else if ((fp = fopen(DUMPFILE, "w")) == (FILE *) 0) { + transient(current, "Can't open screen dump file"); + } else { + (void) putwin(frame_win(current), fp); + (void) fclose(fp); + + current = delete_framed(current, TRUE); + } + break; + + case CTRL('R'): /* restore window */ + if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) { + transient(current, "Can't open screen dump file"); + } else { + if ((neww = typeCalloc(FRAME, 1)) != 0) { + + neww->next = current ? current->next : 0; + neww->last = current; + neww->last->next = neww; + neww->next->last = neww; + + neww->wind = getwin(fp); + + wrefresh(neww->wind); + } + (void) fclose(fp); + } + break; +#endif + +#if HAVE_WRESIZE + case CTRL('X'): /* resize window */ + if (current) { + pair *tmp, ul, lr; + int i, mx, my; + + move(0, 0); + clrtoeol(); + addstr("Use arrows to move cursor, anything else to mark new corner"); + refresh(); + + getbegyx(current->wind, ul.y, ul.x); + + tmp = selectcell(ul.y, ul.x, LINES - BOTLINES - 2, COLS - 2); + if (tmp == (pair *) 0) { + beep(); + break; + } + + getmaxyx(current->wind, lr.y, lr.x); + lr.y += (ul.y - 1); + lr.x += (ul.x - 1); + outerbox(ul, lr, FALSE); + wnoutrefresh(stdscr); + + /* strictly cosmetic hack for the test */ + getmaxyx(current->wind, my, mx); + if (my > tmp->y - ul.y) { + getyx(current->wind, lr.y, lr.x); + wmove(current->wind, tmp->y - ul.y + 1, 0); + wclrtobot(current->wind); + wmove(current->wind, lr.y, lr.x); + } + if (mx > tmp->x - ul.x) + 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)); + (void) wresize(current->wind, lr.y - ul.y + 0, lr.x - ul.x + 0); + + getbegyx(current->wind, ul.y, ul.x); + getmaxyx(current->wind, lr.y, lr.x); + lr.y += (ul.y - 1); + lr.x += (ul.x - 1); + outerbox(ul, lr, TRUE); + wnoutrefresh(stdscr); + + wnoutrefresh(current->wind); + move(0, 0); + clrtoeol(); + doupdate(); + } + 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; + case KEY_DOWN: + newwin_move(current, 1, 0); + break; + case KEY_LEFT: + newwin_move(current, 0, -1); + break; + case KEY_RIGHT: + newwin_move(current, 0, 1); + break; + + case KEY_BACKSPACE: + /* FALLTHROUGH */ + case KEY_DC: + { + int y, x; + getyx(frame_win(current), y, x); + if (--x < 0) { + if (--y < 0) + break; + x = getmaxx(frame_win(current)) - 1; + } + (void) mvwdelch(frame_win(current), y, x); + } + break; + + case '\r': + c = '\n'; + /* FALLTHROUGH */ + + default: + if (current) + waddch(current->wind, (chtype) c); + else + beep(); + break; + } + newwin_report(current); + usescr = frame_win(current); + wrefresh(usescr); + } while + (!isQuit(c = wGetchar(usescr)) + && (c != ERR)); + + breakout: + while (current != 0) + current = delete_framed(current, FALSE); + + scrollok(stdscr, TRUE); /* reset to driver's default */ +#ifdef NCURSES_MOUSE_VERSION + mousemask(0, (mmask_t *) 0); +#endif + noraw(); + erase(); + endwin(); +} + +/**************************************************************************** + * + * Panels tester + * + ****************************************************************************/ + +#if USE_LIBPANEL +static int nap_msec = 1; + +static NCURSES_CONST char *mod[] = +{ + "test ", + "TEST ", + "(**) ", + "*()* ", + "<--> ", + "LAST " +}; + +/*+------------------------------------------------------------------------- + wait_a_while(msec) +--------------------------------------------------------------------------*/ +static void +wait_a_while(int msec GCC_UNUSED) +{ +#if HAVE_NAPMS + if (nap_msec == 1) + wGetchar(stdscr); + else + napms(nap_msec); +#else + if (nap_msec == 1) + wGetchar(stdscr); + else if (msec > 1000) + sleep((unsigned) msec / 1000); + else + sleep(1); +#endif +} /* end of wait_a_while */ + +/*+------------------------------------------------------------------------- + saywhat(text) +--------------------------------------------------------------------------*/ +static void +saywhat(NCURSES_CONST char *text) +{ + wmove(stdscr, LINES - 1, 0); + wclrtoeol(stdscr); + if (text != 0 && *text != '\0') { + waddstr(stdscr, text); + waddstr(stdscr, "; "); + } + waddstr(stdscr, "press any key to continue"); +} /* end of saywhat */ + +/*+------------------------------------------------------------------------- + mkpanel(rows,cols,tly,tlx) - alloc a win and panel and associate them +--------------------------------------------------------------------------*/ +static PANEL * +mkpanel(short color, int rows, int cols, int tly, int tlx) +{ + WINDOW *win; + PANEL *pan = 0; + + if ((win = newwin(rows, cols, tly, tlx)) != 0) { + if ((pan = new_panel(win)) == 0) { + delwin(win); + } else if (use_colors) { + short fg = (short) ((color == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK); + short bg = color; + + init_pair(color, fg, bg); + wbkgdset(win, (attr_t) (COLOR_PAIR(color) | ' ')); + } else { + wbkgdset(win, A_BOLD | ' '); + } + } + return pan; +} /* end of mkpanel */ + +/*+------------------------------------------------------------------------- + rmpanel(pan) +--------------------------------------------------------------------------*/ +static void +rmpanel(PANEL * pan) +{ + WINDOW *win = panel_window(pan); + del_panel(pan); + delwin(win); +} /* end of rmpanel */ + +/*+------------------------------------------------------------------------- + pflush() +--------------------------------------------------------------------------*/ +static void +pflush(void) +{ + update_panels(); + doupdate(); +} /* end of pflush */ + +/*+------------------------------------------------------------------------- + fill_panel(win) +--------------------------------------------------------------------------*/ +static void +init_panel(void) +{ + register int y, x; + + for (y = 0; y < LINES - 1; y++) { + for (x = 0; x < COLS; x++) + wprintw(stdscr, "%d", (y + x) % 10); + } +} + +static void +fill_panel(PANEL * pan) +{ + WINDOW *win = panel_window(pan); + const char *userptr = (const char *) panel_userptr(pan); + int num = (userptr && *userptr) ? userptr[1] : '?'; + int y, x; + + wmove(win, 1, 1); + wprintw(win, "-pan%c-", num); + wclrtoeol(win); + box(win, 0, 0); + for (y = 2; y < getmaxy(win) - 1; y++) { + for (x = 1; x < getmaxx(win) - 1; x++) { + wmove(win, y, x); + waddch(win, UChar(num)); + } + } +} + +#if USE_WIDEC_SUPPORT +static void +init_wide_panel(void) +{ + int digit; + cchar_t temp[10]; + + for (digit = 0; digit < 10; ++digit) + make_fullwidth_digit(&temp[digit], digit); + + do { + int y, x; + getyx(stdscr, y, x); + digit = (y + x / 2) % 10; + } while (add_wch(&temp[digit]) != ERR); +} + +static void +fill_wide_panel(PANEL * pan) +{ + WINDOW *win = panel_window(pan); + const char *userptr = (const char *) panel_userptr(pan); + int num = (userptr && *userptr) ? userptr[1] : '?'; + int y, x; + + wmove(win, 1, 1); + wprintw(win, "-pan%c-", num); + wclrtoeol(win); + box(win, 0, 0); + for (y = 2; y < getmaxy(win) - 1; y++) { + for (x = 1; x < getmaxx(win) - 1; x++) { + wmove(win, y, x); + waddch(win, UChar(num)); + } + } +} +#endif + +#define MAX_PANELS 5 + +static void +canned_panel(PANEL * px[MAX_PANELS + 1], NCURSES_CONST char *cmd) +{ + int which = cmd[1] - '0'; + + saywhat(cmd); + switch (*cmd) { + case 'h': + hide_panel(px[which]); + break; + case 's': + show_panel(px[which]); + break; + case 't': + top_panel(px[which]); + break; + case 'b': + bottom_panel(px[which]); + break; + case 'd': + rmpanel(px[which]); + break; + } + pflush(); + wait_a_while(nap_msec); +} + +static void +demo_panels(void (*InitPanel) (void), void (*FillPanel) (PANEL *)) +{ + int count; + int itmp; + PANEL *px[MAX_PANELS + 1]; + + scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */ + refresh(); + + InitPanel(); + for (count = 0; count < 5; count++) { + px[1] = mkpanel(COLOR_RED, + LINES / 2 - 2, + COLS / 8 + 1, + 0, + 0); + set_panel_userptr(px[1], (NCURSES_CONST void *) "p1"); + + px[2] = mkpanel(COLOR_GREEN, + LINES / 2 + 1, + COLS / 7, + LINES / 4, + COLS / 10); + set_panel_userptr(px[2], (NCURSES_CONST void *) "p2"); + + px[3] = mkpanel(COLOR_YELLOW, + LINES / 4, + COLS / 10, + LINES / 2, + COLS / 9); + set_panel_userptr(px[3], (NCURSES_CONST void *) "p3"); + + px[4] = mkpanel(COLOR_BLUE, + LINES / 2 - 2, + COLS / 8, + LINES / 2 - 2, + COLS / 3); + set_panel_userptr(px[4], (NCURSES_CONST void *) "p4"); + + px[5] = mkpanel(COLOR_MAGENTA, + LINES / 2 - 2, + COLS / 8, + LINES / 2, + COLS / 2 - 2); + set_panel_userptr(px[5], (NCURSES_CONST void *) "p5"); + + FillPanel(px[1]); + FillPanel(px[2]); + FillPanel(px[3]); + FillPanel(px[4]); + FillPanel(px[5]); + + hide_panel(px[4]); + hide_panel(px[5]); + pflush(); + saywhat(""); + wait_a_while(nap_msec); + + saywhat("h3 s1 s2 s4 s5"); + move_panel(px[1], 0, 0); + hide_panel(px[3]); + show_panel(px[1]); + show_panel(px[2]); + show_panel(px[4]); + show_panel(px[5]); + pflush(); + wait_a_while(nap_msec); + + canned_panel(px, "s1"); + canned_panel(px, "s2"); + + saywhat("m2"); + move_panel(px[2], LINES / 3 + 1, COLS / 8); + pflush(); + wait_a_while(nap_msec); + + canned_panel(px, "s3"); + + saywhat("m3"); + move_panel(px[3], LINES / 4 + 1, COLS / 15); + pflush(); + wait_a_while(nap_msec); + + canned_panel(px, "b3"); + canned_panel(px, "s4"); + canned_panel(px, "s5"); + canned_panel(px, "t3"); + canned_panel(px, "t1"); + canned_panel(px, "t2"); + canned_panel(px, "t3"); + canned_panel(px, "t4"); + + for (itmp = 0; itmp < 6; itmp++) { + WINDOW *w4 = panel_window(px[4]); + WINDOW *w5 = panel_window(px[5]); + + saywhat("m4"); + wmove(w4, LINES / 8, 1); + waddstr(w4, mod[itmp]); + move_panel(px[4], LINES / 6, itmp * (COLS / 8)); + wmove(w5, LINES / 6, 1); + waddstr(w5, mod[itmp]); + pflush(); + wait_a_while(nap_msec); + + saywhat("m5"); + wmove(w4, LINES / 6, 1); + waddstr(w4, mod[itmp]); + move_panel(px[5], LINES / 3 - 1, (itmp * 10) + 6); + wmove(w5, LINES / 8, 1); + waddstr(w5, mod[itmp]); + pflush(); + wait_a_while(nap_msec); + } + + saywhat("m4"); + move_panel(px[4], LINES / 6, itmp * (COLS / 8)); + pflush(); + wait_a_while(nap_msec); + + canned_panel(px, "t5"); + canned_panel(px, "t2"); + canned_panel(px, "t1"); + canned_panel(px, "d2"); + canned_panel(px, "h3"); + canned_panel(px, "d1"); + canned_panel(px, "d4"); + canned_panel(px, "d5"); + canned_panel(px, "d3"); + + wait_a_while(nap_msec); + if (nap_msec == 1) + break; + nap_msec = 100L; + } + + erase(); + endwin(); +} +#endif /* USE_LIBPANEL */ + +/**************************************************************************** + * + * Pad tester + * + ****************************************************************************/ + +#define GRIDSIZE 3 + +static bool pending_pan = FALSE; +static bool show_panner_legend = TRUE; + +static int +panner_legend(int line) +{ + static const char *const legend[] = + { + "Use arrow keys (or U,D,L,R) to pan, ESC to quit, ! to shell-out.", + "Use +,- (or j,k) to grow/shrink the panner vertically.", + "Use <,> (or h,l) to grow/shrink the panner horizontally.", + "Number repeats. Toggle legend:? filler:a timer:t scrollmark:s." + }; + int n = ((int) SIZEOF(legend) - (LINES - line)); + if (n >= 0) { + if (move(line, 0) != ERR) { + if (show_panner_legend) + printw("%s", legend[n]); + clrtoeol(); + return show_panner_legend; + } + } + return FALSE; +} + +static void +panner_h_cleanup(int from_y, int from_x, int to_x) +{ + if (!panner_legend(from_y)) + do_h_line(from_y, from_x, ' ', to_x); +} + +static void +panner_v_cleanup(int from_y, int from_x, int to_y) +{ + if (!panner_legend(from_y)) + do_v_line(from_y, from_x, ' ', to_y); +} + +static void +fill_pad(WINDOW *panpad, bool pan_lines) +{ + int y, x; + unsigned gridcount = 0; + + wmove(panpad, 0, 0); + for (y = 0; y < getmaxy(panpad); y++) { + for (x = 0; x < getmaxx(panpad); x++) { + if (y % GRIDSIZE == 0 && x % GRIDSIZE == 0) { + if (y == 0 && x == 0) + waddch(panpad, pan_lines ? ACS_ULCORNER : '+'); + else if (y == 0) + waddch(panpad, pan_lines ? ACS_TTEE : '+'); + else if (y == 0 || x == 0) + waddch(panpad, pan_lines ? ACS_LTEE : '+'); + else + waddch(panpad, (chtype) ((pan_lines ? 'a' : 'A') + + (int) (gridcount++ % 26))); + } else if (y % GRIDSIZE == 0) + waddch(panpad, pan_lines ? ACS_HLINE : '-'); + else if (x % GRIDSIZE == 0) + waddch(panpad, pan_lines ? ACS_VLINE : '|'); + else + waddch(panpad, ' '); + } + } +} + +static void +panner(WINDOW *pad, + int top_x, int top_y, int porty, int portx, + int (*pgetc) (WINDOW *)) +{ +#if HAVE_GETTIMEOFDAY + struct timeval before, after; + bool timing = TRUE; +#endif + bool pan_lines = FALSE; + bool scrollers = TRUE; + int basex = 0; + int basey = 0; + int pxmax, pymax, lowend, highend, c; + + getmaxyx(pad, pymax, pxmax); + scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */ + + c = KEY_REFRESH; + do { +#ifdef NCURSES_VERSION + /* + * During shell-out, the user may have resized the window. Adjust + * the port size of the pad to accommodate this. Ncurses automatically + * resizes all of the normal windows to fit on the new screen. + */ + if (top_x > COLS) + top_x = COLS; + if (portx > COLS) + portx = COLS; + if (top_y > LINES) + top_y = LINES; + if (porty > LINES) + porty = LINES; +#endif + switch (c) { + case KEY_REFRESH: + erase(); + + /* FALLTHRU */ + case '?': + if (c == '?') + show_panner_legend = !show_panner_legend; + panner_legend(LINES - 4); + panner_legend(LINES - 3); + panner_legend(LINES - 2); + panner_legend(LINES - 1); + break; + case 'a': + pan_lines = !pan_lines; + fill_pad(pad, pan_lines); + pending_pan = FALSE; + break; + +#if HAVE_GETTIMEOFDAY + case 't': + timing = !timing; + if (!timing) + panner_legend(LINES - 1); + break; +#endif + case 's': + scrollers = !scrollers; + break; + + /* Move the top-left corner of the pad, keeping the bottom-right + * corner fixed. + */ + case 'h': /* increase-columns: move left edge to left */ + if (top_x <= 0) + beep(); + else { + panner_v_cleanup(top_y, top_x, porty); + top_x--; + } + break; + + case 'j': /* decrease-lines: move top-edge down */ + if (top_y >= porty) + beep(); + else { + panner_h_cleanup(top_y - 1, top_x - (top_x > 0), portx); + top_y++; + } + break; + + case 'k': /* increase-lines: move top-edge up */ + if (top_y <= 0) + beep(); + else { + top_y--; + panner_h_cleanup(top_y, top_x, portx); + } + break; + + case 'l': /* decrease-columns: move left-edge to right */ + if (top_x >= portx) + beep(); + else { + panner_v_cleanup(top_y - (top_y > 0), top_x - 1, porty); + top_x++; + } + break; + + /* Move the bottom-right corner of the pad, keeping the top-left + * corner fixed. + */ + case KEY_IC: /* increase-columns: move right-edge to right */ + if (portx >= pxmax || portx >= COLS) + beep(); + else { + panner_v_cleanup(top_y - (top_y > 0), portx - 1, porty); + ++portx; + } + break; + + case KEY_IL: /* increase-lines: move bottom-edge down */ + if (porty >= pymax || porty >= LINES) + beep(); + else { + panner_h_cleanup(porty - 1, top_x - (top_x > 0), portx); + ++porty; + } + break; + + case KEY_DC: /* decrease-columns: move bottom edge up */ + if (portx <= top_x) + beep(); + else { + portx--; + panner_v_cleanup(top_y - (top_y > 0), portx, porty); + } + break; + + case KEY_DL: /* decrease-lines */ + if (porty <= top_y) + beep(); + else { + porty--; + panner_h_cleanup(porty, top_x - (top_x > 0), portx); + } + break; + + case KEY_LEFT: /* pan leftwards */ + if (basex > 0) + basex--; + else + beep(); + break; + + case KEY_RIGHT: /* pan rightwards */ + if (basex + portx - (pymax > porty) < pxmax) + basex++; + else + beep(); + break; + + case KEY_UP: /* pan upwards */ + if (basey > 0) + basey--; + else + beep(); + break; + + case KEY_DOWN: /* pan downwards */ + if (basey + porty - (pxmax > portx) < pymax) + basey++; + else + beep(); + break; + + case 'H': + case KEY_HOME: + case KEY_FIND: + basey = 0; + break; + + case 'E': + case KEY_END: + case KEY_SELECT: + basey = pymax - porty; + if (basey < 0) + basey = 0; + break; + + default: + beep(); + break; + } + + MvAddCh(top_y - 1, top_x - 1, ACS_ULCORNER); + do_v_line(top_y, top_x - 1, ACS_VLINE, porty); + do_h_line(top_y - 1, top_x, ACS_HLINE, portx); + + if (scrollers && (pxmax > portx - 1)) { + int length = (portx - top_x - 1); + float ratio = ((float) length) / ((float) pxmax); + + lowend = (int) ((float) top_x + ((float) basex * ratio)); + highend = (int) ((float) top_x + ((float) (basex + length) * ratio)); + + do_h_line(porty - 1, top_x, ACS_HLINE, lowend); + if (highend < portx) { + attron(A_REVERSE); + do_h_line(porty - 1, lowend, ' ', highend + 1); + attroff(A_REVERSE); + do_h_line(porty - 1, highend + 1, ACS_HLINE, portx); + } + } else + do_h_line(porty - 1, top_x, ACS_HLINE, portx); + + if (scrollers && (pymax > porty - 1)) { + int length = (porty - top_y - 1); + float ratio = ((float) length) / ((float) pymax); + + lowend = (int) ((float) top_y + ((float) basey * ratio)); + highend = (int) ((float) top_y + ((float) (basey + length) * ratio)); + + do_v_line(top_y, portx - 1, ACS_VLINE, lowend); + if (highend < porty) { + attron(A_REVERSE); + do_v_line(lowend, portx - 1, ' ', highend + 1); + attroff(A_REVERSE); + do_v_line(highend + 1, portx - 1, ACS_VLINE, porty); + } + } else + do_v_line(top_y, portx - 1, ACS_VLINE, porty); + + MvAddCh(top_y - 1, portx - 1, ACS_URCORNER); + MvAddCh(porty - 1, top_x - 1, ACS_LLCORNER); + MvAddCh(porty - 1, portx - 1, ACS_LRCORNER); + + if (!pending_pan) { +#if HAVE_GETTIMEOFDAY + gettimeofday(&before, 0); +#endif + wnoutrefresh(stdscr); + + pnoutrefresh(pad, + basey, basex, + top_y, top_x, + porty - (pxmax > portx) - 1, + portx - (pymax > porty) - 1); + + doupdate(); +#if HAVE_GETTIMEOFDAY +#define TIMEVAL2S(data) ((double) data.tv_sec + ((double) data.tv_usec / 1.0e6)) + if (timing) { + double elapsed; + gettimeofday(&after, 0); + elapsed = (TIMEVAL2S(after) - TIMEVAL2S(before)); + move(LINES - 1, COLS - 12); + printw("Secs: %2.03f", elapsed); + refresh(); + } +#endif + } + + } while + ((c = pgetc(pad)) != KEY_EXIT); + + scrollok(stdscr, TRUE); /* reset to driver's default */ +} + +static int +padgetch(WINDOW *win) +{ + static int count; + static int last; + int c; + + if ((pending_pan = (count > 0)) != FALSE) { + count--; + pending_pan = (count != 0); + } else { + for (;;) { + switch (c = wGetchar(win)) { + case '!': + ShellOut(FALSE); + /* FALLTHRU */ + case CTRL('r'): + endwin(); + refresh(); + c = KEY_REFRESH; + break; + case CTRL('l'): + c = KEY_REFRESH; + break; + case 'U': + c = KEY_UP; + break; + case 'D': + c = KEY_DOWN; + break; + case 'R': + c = KEY_RIGHT; + break; + case 'L': + c = KEY_LEFT; + break; + case '+': + c = KEY_IL; + break; + case '-': + c = KEY_DL; + break; + case '>': + c = KEY_IC; + break; + case '<': + c = KEY_DC; + break; + case ERR: /* FALLTHRU */ + case case_QUIT: + count = 0; + c = KEY_EXIT; + break; + default: + if (c >= '0' && c <= '9') { + count = count * 10 + (c - '0'); + continue; + } + break; + } + last = c; + break; + } + if (count > 0) + count--; + } + return (last); +} + +#define PAD_HIGH 200 +#define PAD_WIDE 200 + +static void +demo_pad(void) +/* Demonstrate pads. */ +{ + WINDOW *panpad = newpad(PAD_HIGH, PAD_WIDE); + + if (panpad == 0) { + Cannot("cannot create requested pad"); + return; + } + + fill_pad(panpad, FALSE); + + panner_legend(LINES - 4); + panner_legend(LINES - 3); + panner_legend(LINES - 2); + panner_legend(LINES - 1); + + keypad(panpad, TRUE); + + /* Make the pad (initially) narrow enough that a trace file won't wrap. + * 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); + + delwin(panpad); + endwin(); + erase(); +} + +/**************************************************************************** + * + * Tests from John Burnell's PDCurses tester + * + ****************************************************************************/ + +static void +Continue(WINDOW *win) +{ + noecho(); + wmove(win, 10, 1); + MvWAddStr(win, 10, 1, " Press any key to continue"); + wrefresh(win); + wGetchar(win); +} + +static void +flushinp_test(WINDOW *win) +/* Input test, adapted from John Burnell's PDCurses tester */ +{ + int w, h, bx, by, sw, sh, i; + + WINDOW *subWin; + wclear(win); + + getmaxyx(win, h, w); + getbegyx(win, by, bx); + sw = w / 3; + sh = h / 3; + if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == 0) + return; + +#ifdef A_COLOR + if (use_colors) { + init_pair(2, COLOR_CYAN, COLOR_BLUE); + wbkgd(subWin, COLOR_PAIR(2) | ' '); + } +#endif + (void) wattrset(subWin, A_BOLD); + box(subWin, ACS_VLINE, ACS_HLINE); + MvWAddStr(subWin, 2, 1, "This is a subwindow"); + wrefresh(win); + + /* + * This used to set 'nocbreak()'. However, Alexander Lukyanov says that + * it only happened to "work" on SVr4 because that implementation does not + * emulate nocbreak+noecho mode, whereas ncurses does. To get the desired + * test behavior, we're using 'cbreak()', which will allow a single + * character to return without needing a newline. - T.Dickey 1997/10/11. + */ + cbreak(); + MvWAddStr(win, 0, 1, "This is a test of the flushinp() call."); + + MvWAddStr(win, 2, 1, "Type random keys for 5 seconds."); + MvWAddStr(win, 3, 1, + "These should be discarded (not echoed) after the subwindow goes away."); + wrefresh(win); + + for (i = 0; i < 5; i++) { + MvWPrintw(subWin, 1, 1, "Time = %d", i); + wrefresh(subWin); + napms(1000); + flushinp(); + } + + delwin(subWin); + werase(win); + flash(); + wrefresh(win); + napms(1000); + + MvWAddStr(win, 2, 1, + "If you were still typing when the window timer expired,"); + MvWAddStr(win, 3, 1, + "or else you typed nothing at all while it was running,"); + MvWAddStr(win, 4, 1, + "test was invalid. You'll see garbage or nothing at all. "); + MvWAddStr(win, 6, 1, "Press a key"); + wmove(win, 9, 10); + wrefresh(win); + echo(); + wGetchar(win); + flushinp(); + MvWAddStr(win, 12, 0, + "If you see any key other than what you typed, flushinp() is broken."); + Continue(win); + + wmove(win, 9, 10); + wdelch(win); + wrefresh(win); + wmove(win, 12, 0); + clrtoeol(); + waddstr(win, + "What you typed should now have been deleted; if not, wdelch() failed."); + Continue(win); + + cbreak(); +} + +/**************************************************************************** + * + * Menu test + * + ****************************************************************************/ + +#if USE_LIBMENU + +#define MENU_Y 8 +#define MENU_X 8 + +static int +menu_virtualize(int c) +{ + if (c == '\n' || c == KEY_EXIT) + return (MAX_COMMAND + 1); + else if (c == 'u') + return (REQ_SCR_ULINE); + else if (c == 'd') + return (REQ_SCR_DLINE); + else if (c == 'b' || c == KEY_NPAGE) + return (REQ_SCR_UPAGE); + else if (c == 'f' || c == KEY_PPAGE) + return (REQ_SCR_DPAGE); + else if (c == 'n' || c == KEY_DOWN) + return (REQ_NEXT_ITEM); + else if (c == 'p' || c == KEY_UP) + return (REQ_PREV_ITEM); + else if (c == ' ') + return (REQ_TOGGLE_ITEM); + else { + if (c != KEY_MOUSE) + beep(); + return (c); + } +} + +static CONST_MENUS char *animals[] = +{ + "Lions", + "Tigers", + "Bears", + "(Oh my!)", + "Newts", + "Platypi", + "Lemurs", + "(Oh really?!)", + "Leopards", + "Panthers", + "Pumas", + "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", + "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs, Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", + (char *) 0 +}; + +static void +menu_test(void) +{ + MENU *m; + ITEM *items[SIZEOF(animals)]; + ITEM **ip = items; + CONST_MENUS char **ap; + int mrows, mcols, c; + WINDOW *menuwin; + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + MvAddStr(0, 0, "This is the menu test:"); + MvAddStr(2, 0, " Use up and down arrow to move the select bar."); + MvAddStr(3, 0, " 'n' and 'p' act like arrows."); + MvAddStr(4, 0, + " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); + MvAddStr(5, 0, " Press return to exit."); + refresh(); + + for (ap = animals; *ap; ap++) { + if ((*ip = new_item(*ap, "")) != 0) + ++ip; + } + *ip = (ITEM *) 0; + + m = new_menu(items); + + set_menu_format(m, (SIZEOF(animals) + 1) / 2, 1); + scale_menu(m, &mrows, &mcols); + + menuwin = newwin(mrows + 2, mcols + 2, MENU_Y, MENU_X); + set_menu_win(m, menuwin); + keypad(menuwin, TRUE); + box(menuwin, 0, 0); + + set_menu_sub(m, derwin(menuwin, mrows, mcols, 1, 1)); + + post_menu(m); + + while ((c = menu_driver(m, menu_virtualize(wGetchar(menuwin)))) != E_UNKNOWN_COMMAND) { + if (c == E_NOT_POSTED) + break; + if (c == E_REQUEST_DENIED) + beep(); + continue; + } + + MvPrintw(LINES - 2, 0, + "You chose: %s\n", item_name(current_item(m))); + (void) addstr("Press any key to continue..."); + wGetchar(stdscr); + + unpost_menu(m); + delwin(menuwin); + + free_menu(m); + for (ip = items; *ip; ip++) + free_item(*ip); +#ifdef NCURSES_MOUSE_VERSION + mousemask(0, (mmask_t *) 0); +#endif +} + +#ifdef TRACE +#define T_TBL(name) { #name, name } +static struct { + const char *name; + unsigned mask; +} t_tbl[] = { + + T_TBL(TRACE_DISABLE), + T_TBL(TRACE_TIMES), + T_TBL(TRACE_TPUTS), + T_TBL(TRACE_UPDATE), + T_TBL(TRACE_MOVE), + T_TBL(TRACE_CHARPUT), + T_TBL(TRACE_ORDINARY), + T_TBL(TRACE_CALLS), + T_TBL(TRACE_VIRTPUT), + T_TBL(TRACE_IEVENT), + T_TBL(TRACE_BITS), + T_TBL(TRACE_ICALLS), + T_TBL(TRACE_CCALLS), + T_TBL(TRACE_DATABASE), + T_TBL(TRACE_ATTRS), + T_TBL(TRACE_MAXIMUM), + { + (char *) 0, 0 + } +}; + +static char * +tracetrace(unsigned tlevel) +{ + static char *buf; + 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); + } + sprintf(buf, "0x%02x = {", tlevel); + if (tlevel == 0) { + sprintf(buf + strlen(buf), "%s, ", t_tbl[0].name); + } 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, ", "); + } + } + if (buf[strlen(buf) - 2] == ',') + buf[strlen(buf) - 2] = '\0'; + return (strcat(buf, "}")); +} + +/* fake a dynamically reconfigurable menu using the 0th entry to deselect + * the others + */ +static int +run_trace_menu(MENU * m) +{ + ITEM **items; + ITEM *i, **p; + + for (;;) { + bool changed = FALSE; + switch (menu_driver(m, menu_virtualize(wGetchar(menu_win(m))))) { + case E_UNKNOWN_COMMAND: + return FALSE; + default: + items = menu_items(m); + i = current_item(m); + if (i == items[0]) { + if (item_value(i)) { + for (p = items + 1; *p != 0; p++) + if (item_value(*p)) { + set_item_value(*p, FALSE); + changed = TRUE; + } + } + } else { + for (p = items + 1; *p != 0; p++) + if (item_value(*p)) { + set_item_value(items[0], FALSE); + changed = TRUE; + break; + } + } + if (!changed) + return TRUE; + } + } +} + +static void +trace_set(void) +/* interactively set the trace level */ +{ + MENU *m; + ITEM *items[SIZEOF(t_tbl)]; + ITEM **ip = items; + int mrows, mcols; + unsigned newtrace; + int n; + WINDOW *menuwin; + + MvAddStr(0, 0, "Interactively set trace level:"); + MvAddStr(2, 0, " Press space bar to toggle a selection."); + MvAddStr(3, 0, " Use up and down arrow to move the select bar."); + MvAddStr(4, 0, " Press return to set the trace level."); + MvPrintw(6, 0, "(Current trace level is %s)", tracetrace(_nc_tracing)); + + refresh(); + + for (n = 0; t_tbl[n].name != 0; n++) { + if ((*ip = new_item(t_tbl[n].name, "")) != 0) { + ++ip; + } + } + *ip = (ITEM *) 0; + + m = new_menu(items); + + set_menu_format(m, 0, 2); + scale_menu(m, &mrows, &mcols); + + menu_opts_off(m, O_ONEVALUE); + menuwin = newwin(mrows + 2, mcols + 2, MENU_Y, MENU_X); + set_menu_win(m, menuwin); + keypad(menuwin, TRUE); + box(menuwin, 0, 0); + + set_menu_sub(m, derwin(menuwin, mrows, mcols, 1, 1)); + + post_menu(m); + + for (ip = menu_items(m); *ip; ip++) { + unsigned mask = t_tbl[item_index(*ip)].mask; + if (mask == 0) + set_item_value(*ip, _nc_tracing == 0); + else if ((mask & _nc_tracing) == mask) + set_item_value(*ip, TRUE); + } + + while (run_trace_menu(m)) + continue; + + newtrace = 0; + for (ip = menu_items(m); *ip; ip++) + if (item_value(*ip)) + newtrace |= t_tbl[item_index(*ip)].mask; + trace(newtrace); + Trace(("trace level interactively set to %s", tracetrace(_nc_tracing))); + + MvPrintw(LINES - 2, 0, + "Trace level is %s\n", tracetrace(_nc_tracing)); + (void) addstr("Press any key to continue..."); + wGetchar(stdscr); + + unpost_menu(m); + delwin(menuwin); + + free_menu(m); + for (ip = items; *ip; ip++) + free_item(*ip); +} +#endif /* TRACE */ +#endif /* USE_LIBMENU */ + +/**************************************************************************** + * + * Forms test + * + ****************************************************************************/ +#if USE_LIBFORM +static FIELD * +make_label(int frow, int fcol, NCURSES_CONST char *label) +{ + FIELD *f = new_field(1, (int) strlen(label), frow, fcol, 0, 0); + + if (f) { + set_field_buffer(f, 0, label); + set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE)); + } + return (f); +} + +static FIELD * +make_field(int frow, int fcol, int rows, int cols, bool secure) +{ + FIELD *f = new_field(rows, cols, frow, fcol, 0, secure ? 1 : 0); + + if (f) { + set_field_back(f, A_UNDERLINE); + set_field_userptr(f, (void *) 0); + } + return (f); +} + +static void +display_form(FORM * f) +{ + WINDOW *w; + int rows, cols; + + scale_form(f, &rows, &cols); + + if ((w = newwin(rows + 2, cols + 4, 0, 0)) != (WINDOW *) 0) { + set_form_win(f, w); + set_form_sub(f, derwin(w, rows, cols, 1, 2)); + box(w, 0, 0); + keypad(w, TRUE); + } + + if (post_form(f) != E_OK) + wrefresh(w); +} + +static void +erase_form(FORM * f) +{ + WINDOW *w = form_win(f); + WINDOW *s = form_sub(f); + + unpost_form(f); + werase(w); + wrefresh(w); + delwin(s); + delwin(w); +} + +static int +edit_secure(FIELD * me, int c) +{ + int rows, cols, frow, fcol, nrow, nbuf; + + if (field_info(me, &rows, &cols, &frow, &fcol, &nrow, &nbuf) == E_OK + && nbuf > 0) { + char *source = field_buffer(me, 1); + char temp[80]; + long len; + + strcpy(temp, source ? source : ""); + len = (long) (char *) field_userptr(me); + if (c <= KEY_MAX) { + if (isgraph(c) && (len + 1) < (int) sizeof(temp)) { + temp[len++] = (char) c; + temp[len] = 0; + set_field_buffer(me, 1, temp); + c = '*'; + } else { + c = 0; + } + } else { + switch (c) { + case REQ_BEG_FIELD: + case REQ_CLR_EOF: + case REQ_CLR_EOL: + case REQ_DEL_LINE: + case REQ_DEL_WORD: + case REQ_DOWN_CHAR: + case REQ_END_FIELD: + case REQ_INS_CHAR: + case REQ_INS_LINE: + case REQ_LEFT_CHAR: + case REQ_NEW_LINE: + case REQ_NEXT_WORD: + case REQ_PREV_WORD: + case REQ_RIGHT_CHAR: + case REQ_UP_CHAR: + c = 0; /* we don't want to do inline editing */ + break; + case REQ_CLR_FIELD: + if (len) { + temp[0] = 0; + set_field_buffer(me, 1, temp); + } + break; + case REQ_DEL_CHAR: + case REQ_DEL_PREV: + if (len) { + temp[--len] = 0; + set_field_buffer(me, 1, temp); + } + break; + } + } + set_field_userptr(me, (void *) len); + } + return c; +} + +static int +form_virtualize(FORM * f, WINDOW *w) +{ + /* *INDENT-OFF* */ + static const struct { + int code; + int result; + } lookup[] = { + { CTRL('A'), REQ_NEXT_CHOICE }, + { CTRL('B'), REQ_PREV_WORD }, + { CTRL('C'), REQ_CLR_EOL }, + { CTRL('D'), REQ_DOWN_FIELD }, + { CTRL('E'), REQ_END_FIELD }, + { CTRL('F'), REQ_NEXT_PAGE }, + { CTRL('G'), REQ_DEL_WORD }, + { CTRL('H'), REQ_DEL_PREV }, + { CTRL('I'), REQ_INS_CHAR }, + { CTRL('K'), REQ_CLR_EOF }, + { CTRL('L'), REQ_LEFT_FIELD }, + { CTRL('M'), REQ_NEW_LINE }, + { CTRL('N'), REQ_NEXT_FIELD }, + { CTRL('O'), REQ_INS_LINE }, + { CTRL('P'), REQ_PREV_FIELD }, + { CTRL('R'), REQ_RIGHT_FIELD }, + { CTRL('S'), REQ_BEG_FIELD }, + { CTRL('U'), REQ_UP_FIELD }, + { CTRL('V'), REQ_DEL_CHAR }, + { CTRL('W'), REQ_NEXT_WORD }, + { CTRL('X'), REQ_CLR_FIELD }, + { CTRL('Y'), REQ_DEL_LINE }, + { CTRL('Z'), REQ_PREV_CHOICE }, + { ESCAPE, MAX_FORM_COMMAND + 1 }, + { KEY_BACKSPACE, REQ_DEL_PREV }, + { KEY_DOWN, REQ_DOWN_CHAR }, + { KEY_END, REQ_LAST_FIELD }, + { KEY_HOME, REQ_FIRST_FIELD }, + { KEY_LEFT, REQ_LEFT_CHAR }, + { KEY_LL, REQ_LAST_FIELD }, + { KEY_NEXT, REQ_NEXT_FIELD }, + { KEY_NPAGE, REQ_NEXT_PAGE }, + { KEY_PPAGE, REQ_PREV_PAGE }, + { KEY_PREVIOUS, REQ_PREV_FIELD }, + { KEY_RIGHT, REQ_RIGHT_CHAR }, + { KEY_UP, REQ_UP_CHAR }, + { QUIT, MAX_FORM_COMMAND + 1 } + }; + /* *INDENT-ON* */ + + static int mode = REQ_INS_MODE; + int c = wGetchar(w); + unsigned n; + FIELD *me = current_field(f); + bool current = TRUE; + + if (c == CTRL(']')) { + if (mode == REQ_INS_MODE) { + mode = REQ_OVL_MODE; + } else { + mode = REQ_INS_MODE; + } + c = mode; + } else { + for (n = 0; n < SIZEOF(lookup); n++) { + if (lookup[n].code == c) { + c = lookup[n].result; + break; + } + } + } + MvPrintw(0, COLS - 6, "(%s)", mode == REQ_INS_MODE ? "INS" : "OVL"); + + /* + * Force the field that the user is typing into to be in reverse video, + * while the other fields are shown underlined. + */ + switch (c) { + case REQ_BEG_FIELD: + case REQ_CLR_EOF: + case REQ_CLR_EOL: + case REQ_CLR_FIELD: + case REQ_DEL_CHAR: + case REQ_DEL_LINE: + case REQ_DEL_PREV: + case REQ_DEL_WORD: + case REQ_END_FIELD: + case REQ_INS_CHAR: + case REQ_INS_LINE: + case REQ_LEFT_CHAR: + case REQ_LEFT_FIELD: + case REQ_NEXT_WORD: + case REQ_RIGHT_CHAR: + current = TRUE; + break; + default: + current = (c < KEY_MAX); + break; + } + if (current) { + c = edit_secure(me, c); + set_field_back(me, A_REVERSE); + } else { + c = edit_secure(me, c); + set_field_back(me, A_UNDERLINE); + } + return c; +} + +static int +my_form_driver(FORM * form, int c) +{ + if (c == (MAX_FORM_COMMAND + 1) + && form_driver(form, REQ_VALIDATION) == E_OK) + return (TRUE); + else { + beep(); + return (FALSE); + } +} + +#ifdef NCURSES_VERSION +#define FIELDCHECK_CB(func) bool func(FIELD * fld, const void * data GCC_UNUSED) +#define CHAR_CHECK_CB(func) bool func(int ch, const void *data GCC_UNUSED) +#else +#define FIELDCHECK_CB(func) int func(FIELD * fld, char * data GCC_UNUSED) +#define CHAR_CHECK_CB(func) int func(int ch, char *data GCC_UNUSED) +#endif + +/* + * Allow a middle initial, optionally with a '.' to end it. + */ +static +FIELDCHECK_CB(mi_field_check) +{ + char *s = field_buffer(fld, 0); + int state = 0; + int n; + + for (n = 0; s[n] != '\0'; ++n) { + switch (state) { + case 0: + if (s[n] == '.') { + if (n != 1) + return FALSE; + state = 2; + } else if (isspace(UChar(s[n]))) { + state = 2; + } + break; + case 2: + if (!isspace(UChar(s[n]))) + return FALSE; + break; + } + } + + /* force the form to display a leading capital */ + if (islower(UChar(s[0]))) { + s[0] = (char) toupper(UChar(s[0])); + set_field_buffer(fld, 0, s); + } + return TRUE; +} + +static +CHAR_CHECK_CB(mi_char_check) +{ + return ((isalpha(ch) || ch == '.') ? TRUE : FALSE); +} + +/* + * Passwords should be at least 6 characters. + */ +static +FIELDCHECK_CB(pw_field_check) +{ + char *s = field_buffer(fld, 0); + int n; + + for (n = 0; s[n] != '\0'; ++n) { + if (isspace(UChar(s[n]))) { + if (n < 6) + return FALSE; + } + } + return TRUE; +} + +static +CHAR_CHECK_CB(pw_char_check) +{ + return (isgraph(ch) ? TRUE : FALSE); +} + +static void +demo_forms(void) +{ + 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; + unsigned n = 0; + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif + + move(18, 0); + addstr("Defined edit/traversal keys: ^Q/ESC- exit form\n"); + addstr("^N -- go to next field ^P -- go to previous field\n"); + addstr("Home -- go to first field End -- go to last field\n"); + addstr("^L -- go to field to left ^R -- go to field to right\n"); + addstr("^U -- move upward to field ^D -- move downward to field\n"); + addstr("^W -- go to next word ^B -- go to previous word\n"); + addstr("^S -- go to start of field ^E -- go to end of field\n"); + addstr("^H -- delete previous char ^Y -- delete line\n"); + addstr("^G -- delete current word ^C -- clear to end of line\n"); + addstr("^K -- clear to end of field ^X -- clear field\n"); + addstr("Arrow keys move within a field as you would expect. ^] toggles overlay mode."); + + MvAddStr(4, 57, "Forms Entry Test"); + + refresh(); + + /* describe the form */ + memset(f, 0, sizeof(f)); + f[n++] = make_label(0, 15, "Sample Form"); + + f[n++] = make_label(2, 0, "Last Name"); + f[n++] = make_field(3, 0, 1, 18, FALSE); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + + f[n++] = make_label(2, 20, "First Name"); + f[n++] = make_field(3, 20, 1, 12, FALSE); + set_field_type(f[n - 1], TYPE_ALPHA, 1); + + f[n++] = make_label(2, 34, "Middle Name"); + f[n++] = make_field(3, 34, 1, 12, FALSE); + set_field_type(f[n - 1], fty_middle); + + f[n++] = make_label(5, 0, "Comments"); + f[n++] = make_field(6, 0, 4, 46, FALSE); + + f[n++] = make_label(5, 20, "Password:"); + secure = + f[n++] = make_field(5, 30, 1, 9, TRUE); + set_field_type(f[n - 1], fty_passwd); + f[n] = (FIELD *) 0; + + if ((form = new_form(f)) != 0) { + + display_form(form); + + w = form_win(form); + raw(); + nonl(); /* lets us read ^M's */ + while (!finished) { + switch (form_driver(form, c = form_virtualize(form, w))) { + case E_OK: + MvAddStr(5, 57, field_buffer(secure, 1)); + clrtoeol(); + refresh(); + break; + case E_UNKNOWN_COMMAND: + finished = my_form_driver(form, c); + break; + default: + beep(); + break; + } + } + + erase_form(form); + + free_form(form); + } + for (c = 0; f[c] != 0; c++) + free_field(f[c]); + free_fieldtype(fty_middle); + free_fieldtype(fty_passwd); + noraw(); + nl(); + +#ifdef NCURSES_MOUSE_VERSION + mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); +#endif +} +#endif /* USE_LIBFORM */ + +/**************************************************************************** + * + * Overlap test + * + ****************************************************************************/ + +static void +fillwin(WINDOW *win, char ch) +{ + int y, x; + int y1, x1; + + getmaxyx(win, y1, x1); + for (y = 0; y < y1; y++) { + wmove(win, y, 0); + for (x = 0; x < x1; x++) + waddch(win, UChar(ch)); + } +} + +static void +crosswin(WINDOW *win, char ch) +{ + int y, x; + int y1, x1; + + 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)))) { + wmove(win, y, x); + waddch(win, UChar(ch)); + } + } +} + +#define OVERLAP_FLAVORS 5 + +static void +overlap_helpitem(int state, int item, char *message) +{ + int row = (item / 2); + int col = ((item % 2) ? COLS / 2 : 0); + + move(LINES - 6 + row, col); + printw("%c%c = %s", state == row ? '>' : ' ', 'a' + item, message); + clrtoeol(); +} + +static void +overlap_test_1_attr(WINDOW *win, int flavor, int col) +{ + short cpair = (short) (1 + (flavor * 2) + col); + + switch (flavor) { + case 0: + (void) wattrset(win, A_NORMAL); + break; + case 1: + (void) wattrset(win, A_BOLD); + break; + case 2: + init_pair(cpair, COLOR_BLUE, COLOR_WHITE); + (void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_NORMAL); + break; + case 3: + init_pair(cpair, COLOR_WHITE, COLOR_BLUE); + (void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_BOLD); + break; + } +} + +static void +overlap_test_2_attr(WINDOW *win, int flavor, int col) +{ + short cpair = (short) (9 + (flavor * 2) + col); + + switch (flavor) { + case 0: + /* no effect */ + break; + case 1: + /* no effect */ + break; + case 2: + init_pair(cpair, COLOR_RED, COLOR_GREEN); + wbkgdset(win, colored_chtype(' ', A_BLINK, cpair)); + break; + case 3: + wbkgdset(win, ' ' | A_NORMAL); + break; + } +} + +static int +overlap_help(int state, int flavors[OVERLAP_FLAVORS]) +{ + int row; + int col; + int item; + const char *ths, *tht; + char msg[80]; + + if (state < 0) + state += OVERLAP_FLAVORS; + state = state % 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: + flavors[row] = 0; + sprintf(msg, "refresh %s, then %s, then doupdate.", ths, tht); + break; + case 1: + if (use_colors) { + flavors[row] %= 4; + } else { + flavors[row] %= 2; + } + 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); + break; + case 1: + sprintf(msg, "draw box in window %s.", ths); + break; + case 2: + sprintf(msg, "set background of window %s.", ths); + break; + case 3: + sprintf(msg, "reset background of window %s.", ths); + break; + } + break; + case 3: + 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); + break; + case 1: + sprintf(msg, "copywin(FALSE) %s onto %s.", ths, tht); + break; + case 2: + sprintf(msg, "copywin(TRUE) %s onto %s.", ths, tht); + break; + case 3: + sprintf(msg, "overlay %s onto %s.", ths, tht); + break; + } + break; + } + overlap_helpitem(state, item, msg); + (void) wattrset(stdscr, A_NORMAL); + wbkgdset(stdscr, ' ' | A_NORMAL); + } + move(LINES - 1, 0); + printw("^Q/ESC = terminate test. Up/down/space select test variations (%d %d).", + state, flavors[state]); + + return state; +} + +static void +overlap_test_0(WINDOW *a, WINDOW *b) +{ + touchwin(a); + touchwin(b); + wnoutrefresh(a); + wnoutrefresh(b); + doupdate(); +} + +static void +overlap_test_1(int flavor, int col, WINDOW *a, char fill) +{ + overlap_test_1_attr(a, flavor, col); + fillwin(a, fill); + (void) wattrset(a, A_NORMAL); +} + +static void +overlap_test_2(int flavor, int col, WINDOW *a, char fill) +{ + overlap_test_2_attr(a, flavor, col); + switch (flavor) { + case 0: + crosswin(a, fill); + break; + case 1: + box(a, 0, 0); + break; + case 2: + /* done in overlap_test_2_attr */ + break; + case 3: + /* done in overlap_test_2_attr */ + break; + } +} + +static void +overlap_test_3(WINDOW *a) +{ + wclear(a); + wmove(a, 0, 0); +} + +static void +overlap_test_4(int flavor, WINDOW *a, WINDOW *b) +{ + switch (flavor) { + case 0: + overwrite(a, b); + break; + case 1: + copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), FALSE); + break; + case 2: + copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), TRUE); + break; + case 3: + overlay(a, b); + break; + } +} + +/* test effects of overlapping windows */ +static void +overlap_test(void) +{ + int ch; + int state, flavor[OVERLAP_FLAVORS]; + + WINDOW *win1 = newwin(9, 20, 3, 3); + WINDOW *win2 = newwin(9, 20, 9, 16); + + 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"); + + memset(flavor, 0, sizeof(flavor)); + state = overlap_help(0, flavor); + + while (!isQuit(ch = Getchar())) + switch (ch) { + case 'a': /* refresh window A first, then B */ + overlap_test_0(win1, win2); + break; + + case 'b': /* refresh window B first, then A */ + overlap_test_0(win2, win1); + break; + + case 'c': /* fill window A so it's visible */ + overlap_test_1(flavor[1], 0, win1, 'A'); + break; + + case 'd': /* fill window B so it's visible */ + overlap_test_1(flavor[1], 1, win2, 'B'); + break; + + case 'e': /* cross test pattern in window A */ + overlap_test_2(flavor[2], 0, win1, 'A'); + break; + + case 'f': /* cross test pattern in window A */ + overlap_test_2(flavor[2], 1, win2, 'B'); + break; + + case 'g': /* clear window A */ + overlap_test_3(win1); + break; + + case 'h': /* clear window B */ + overlap_test_3(win2); + break; + + case 'i': /* overwrite A onto B */ + overlap_test_4(flavor[4], win1, win2); + break; + + case 'j': /* overwrite B onto A */ + overlap_test_4(flavor[4], win2, win1); + break; + + 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 '?': + state = overlap_help(state, flavor); + break; + + default: + beep(); + break; + } + + delwin(win2); + delwin(win1); + erase(); + curs_set(1); + endwin(); +} + +/**************************************************************************** + * + * Main sequence + * + ****************************************************************************/ + +static bool +do_single_test(const char c) +/* perform a single specified test */ +{ + switch (c) { + case 'a': + getch_test(); + break; + +#if USE_WIDEC_SUPPORT + case 'A': + get_wch_test(); + break; +#endif + + case 'b': + attr_test(); + break; + +#if USE_WIDEC_SUPPORT + case 'B': + wide_attr_test(); + break; +#endif + + case 'c': + if (!use_colors) + Cannot("does not support color."); + else + color_test(); + break; + +#if USE_WIDEC_SUPPORT + case 'C': + if (!use_colors) + Cannot("does not support color."); + else + wide_color_test(); + 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(); + break; + +#if USE_SOFTKEYS + case 'e': + slk_test(); + break; + +#if USE_WIDEC_SUPPORT + case 'E': + wide_slk_test(); + break; +#endif +#endif + + case 'f': + acs_display(); + break; + +#if USE_WIDEC_SUPPORT + case 'F': + wide_acs_display(); + break; +#endif + +#if USE_LIBPANEL + case 'o': + demo_panels(init_panel, fill_panel); + break; +#endif + +#if USE_WIDEC_SUPPORT && USE_LIBPANEL + case 'O': + demo_panels(init_wide_panel, fill_wide_panel); + break; +#endif + + case 'g': + acs_and_scroll(); + break; + + case 'i': + flushinp_test(stdscr); + break; + + case 'k': + test_sgr_attributes(); + break; + +#if USE_LIBMENU + case 'm': + menu_test(); + break; +#endif + + case 'p': + demo_pad(); + break; + +#if USE_LIBFORM + case 'r': + demo_forms(); + break; +#endif + + case 's': + overlap_test(); + break; + +#if USE_LIBMENU && defined(TRACE) + case 't': + trace_set(); + break; +#endif + + case '?': + break; + + default: + return FALSE; + } + + return TRUE; +} + +static void +usage(void) +{ + static const char *const tbl[] = + { + "Usage: ncurses [options]" + ,"" + ,"Options:" +#ifdef NCURSES_VERSION + ," -a f,b set default-colors (assumed white-on-black)" + ," -d use default-colors if terminal supports them" +#endif +#if USE_SOFTKEYS + ," -e fmt specify format for soft-keys test (e)" +#endif +#if HAVE_RIPOFFLINE + ," -f rip-off footer line (can repeat)" + ," -h rip-off header line (can repeat)" +#endif + ," -m do not use colors" + ," -p file rgb values to use in 'd' rather than ncurses's builtin" +#if USE_LIBPANEL + ," -s msec specify nominal time for panel-demo (default: 1, to hold)" +#endif +#ifdef TRACE + ," -t mask specify default trace-level (may toggle with ^T)" +#endif + }; + size_t n; + for (n = 0; n < SIZEOF(tbl); n++) + fprintf(stderr, "%s\n", tbl[n]); + ExitProgram(EXIT_FAILURE); +} + +static void +set_terminal_modes(void) +{ + noraw(); + cbreak(); + noecho(); + scrollok(stdscr, TRUE); + idlok(stdscr, TRUE); + keypad(stdscr, TRUE); +} + +#ifdef SIGUSR1 +static RETSIGTYPE +announce_sig(int sig) +{ + (void) fprintf(stderr, "Handled signal %d\r\n", sig); +} +#endif + +#if HAVE_RIPOFFLINE +static int +rip_footer(WINDOW *win, int cols) +{ + wbkgd(win, A_REVERSE); + werase(win); + wmove(win, 0, 0); + wprintw(win, "footer: window %p, %d columns", (void *) win, cols); + wnoutrefresh(win); + return OK; +} + +static int +rip_header(WINDOW *win, int cols) +{ + wbkgd(win, A_REVERSE); + werase(win); + wmove(win, 0, 0); + wprintw(win, "header: window %p, %d columns", (void *) win, cols); + wnoutrefresh(win); + return OK; +} +#endif /* HAVE_RIPOFFLINE */ + +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"); +#endif + (void) puts("c = color test pattern"); +#if USE_WIDEC_SUPPORT + (void) puts("C = color test pattern using wide-character calls"); +#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"); +#endif + (void) puts("g = display windows and scrolling"); + (void) puts("i = test of flushinp()"); + (void) puts("k = display character attributes"); +#if USE_LIBMENU + (void) puts("m = menu code test"); +#endif +#if USE_LIBPANEL + (void) puts("o = exercise panels library"); +#if USE_WIDEC_SUPPORT + (void) puts("O = exercise panels with wide-characters"); +#endif +#endif + (void) puts("p = exercise pad features"); + (void) puts("q = quit"); +#if USE_LIBFORM + (void) puts("r = exercise forms code"); +#endif + (void) puts("s = overlapping-refresh test"); +#if USE_LIBMENU && defined(TRACE) + (void) puts("t = set trace level"); +#endif + (void) puts("? = repeat this command summary"); + + (void) fputs("> ", stdout); + (void) fflush(stdout); /* necessary under SVr4 curses */ + + /* + * This used to be an 'fgets()' call (until 1996/10). However with + * some runtime libraries, mixing stream I/O and 'read()' causes the + * input stream to be flushed when switching between the two. + */ + command = 0; + for (;;) { + char ch = '\0'; + if (read(fileno(stdin), &ch, 1) <= 0) { + if (command == 0) + command = 'q'; + break; + } else if (command == 0 && !isspace(UChar(ch))) { + command = ch; + } else if (ch == '\n' || ch == '\r') { + if ((command == 'd') && !top) { + (void) fputs("Do not nest test-d\n", stdout); + command = 0; + } + if (command != 0) + break; + (void) fputs("> ", stdout); + (void) fflush(stdout); + } + } + + if (do_single_test(command)) { + /* + * This may be overkill; it's intended to reset everything back + * to the initial terminal modes so that tests don't get in + * each other's way. + */ + flushinp(); + set_terminal_modes(); + reset_prog_mode(); + clear(); + refresh(); + endwin(); + if (command == '?') { + (void) puts("This is the ncurses capability tester."); + (void) + puts("You may select a test from the main menu by typing the"); + (void) + puts("key letter of the choice (the letter to left of the =)"); + (void) + puts("at the > prompt. Type `q' to exit."); + } + continue; + } + } while + (command != 'q'); +} + +/*+------------------------------------------------------------------------- + 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 + int default_fg = COLOR_WHITE; + int default_bg = COLOR_BLACK; + bool assumed_colors = FALSE; + bool default_colors = FALSE; +#endif + char *palette_file = 0; + bool monochrome = FALSE; + + setlocale(LC_ALL, ""); + + while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) { + switch (c) { +#ifdef NCURSES_VERSION + case 'a': + assumed_colors = TRUE; + sscanf(optarg, "%d,%d", &default_fg, &default_bg); + break; + case 'd': + default_colors = TRUE; + break; +#endif + case 'e': + my_e_param = atoi(optarg); +#ifdef NCURSES_VERSION + if (my_e_param > 3) /* allow extended layouts */ + usage(); +#else + if (my_e_param > 1) + usage(); +#endif + break; +#if HAVE_RIPOFFLINE + case 'f': + ripoffline(-1, rip_footer); + break; + case 'h': + ripoffline(1, rip_header); + break; +#endif /* HAVE_RIPOFFLINE */ + case 'm': + monochrome = TRUE; + break; + case 'p': + palette_file = optarg; + break; +#if USE_LIBPANEL + case 's': + nap_msec = (int) atol(optarg); + break; +#endif +#ifdef TRACE + case 't': + save_trace = (unsigned) strtol(optarg, 0, 0); + break; +#endif + default: + usage(); + } + } + + /* + * If there's no menus (unlikely for ncurses!), then we'll have to set + * tracing on initially, just in case the user wants to test something that + * doesn't involve wGetchar. + */ +#ifdef TRACE + /* enable debugging */ +#if !USE_LIBMENU + trace(save_trace); +#else + if (!isatty(fileno(stdin))) + trace(save_trace); +#endif /* USE_LIBMENU */ +#endif /* TRACE */ + +#if USE_SOFTKEYS + /* tell it we're going to play with soft keys */ + slk_init(my_e_param); +#endif + +#ifdef SIGUSR1 + /* set up null signal catcher so we can see what interrupts to getch do */ + signal(SIGUSR1, announce_sig); +#endif + + /* we must initialize the curses data structure only once */ + initscr(); + bkgdset(BLANK); + + /* tests, in general, will want these modes */ + use_colors = monochrome ? FALSE : has_colors(); + + if (use_colors) { + start_color(); +#ifdef NCURSES_VERSION_PATCH + max_colors = COLORS; /* was > 16 ? 16 : COLORS */ +#if HAVE_USE_DEFAULT_COLORS + if (default_colors) { + use_default_colors(); + min_colors = -1; + } +#if NCURSES_VERSION_PATCH >= 20000708 + if (assumed_colors) + assume_default_colors(default_fg, default_bg); +#endif +#endif +#else /* normal SVr4 curses */ + max_colors = COLORS; /* was > 8 ? 8 : COLORS */ +#endif + max_pairs = COLOR_PAIRS; /* was > 256 ? 256 : COLOR_PAIRS */ + + if (can_change_color()) { + short cp; + all_colors = typeMalloc(RGB_DATA, (unsigned) max_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)) { + all_colors[c].red = (short) ((red * 1000) / scale); + all_colors[c].green = (short) ((green * 1000) / scale); + all_colors[c].blue = (short) ((blue * 1000) / scale); + } + } + fclose(fp); + } + } + } + } + set_terminal_modes(); + def_prog_mode(); + + /* + * Return to terminal mode, so we're guaranteed of being able to + * select terminal commands even if the capabilities are wrong. + */ + endwin(); + +#if HAVE_CURSES_VERSION + (void) printf("Welcome to %s. Press ? for help.\n", curses_version()); +#elif defined(NCURSES_VERSION_MAJOR) && defined(NCURSES_VERSION_MINOR) && defined(NCURSES_VERSION_PATCH) + (void) printf("Welcome to ncurses %d.%d.%d. Press ? for help.\n", + NCURSES_VERSION_MAJOR, + NCURSES_VERSION_MINOR, + NCURSES_VERSION_PATCH); +#else + (void) puts("Welcome to ncurses. Press ? for help."); +#endif + + main_menu(TRUE); + + ExitProgram(EXIT_SUCCESS); +} + +/* ncurses.c ends here */ diff --git a/test/ncurses_tst.hin b/test/ncurses_tst.hin new file mode 100644 index 00000000000..1d77cbd3fee --- /dev/null +++ b/test/ncurses_tst.hin @@ -0,0 +1,56 @@ +/**************************************************************************** + * Copyright (c) 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 * + * "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 1998 * + ****************************************************************************/ +/* + * $Id: ncurses_tst.hin,v 1.2 1998/02/11 12:14:05 tom Exp $ + * + * This is a template-file used to generate the "ncurses_cfg.h" file. + * + * Rather than list every definition, the configuration script substitutes + * the definitions that it finds using 'sed'. You need a patch (971222) + * to autoconf 2.12 to do this. + */ +#ifndef NC_CONFIG_H +#define NC_CONFIG_H +@DEFS@ + + /* The C compiler may not treat these properly but C++ has to */ +#ifdef __cplusplus +#undef const +#undef inline +#else +#if defined(lint) || defined(TRACE) +#undef inline +#define inline /* nothing */ +#endif +#endif + +#endif /* NC_CONFIG_H */ diff --git a/test/newdemo.c b/test/newdemo.c new file mode 100644 index 00000000000..75626a9051e --- /dev/null +++ b/test/newdemo.c @@ -0,0 +1,358 @@ +/* + * newdemo.c - A demo program using PDCurses. The program illustrate + * the use of colours for text output. + * + * $Id: newdemo.c,v 1.35 2010/12/12 00:19:15 tom Exp $ + */ + +#include + +#include + +/* + * The Australian map + */ +static CONST_MENUS char *AusMap[16] = +{ + " A A ", + " N.T. AAAAA AAAA ", + " AAAAAAAAAAA AAAAAAAA ", + " AAAAAAAAAAAAAAAAAAAAAAAAA Qld.", + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", + " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ", + " AAAAAAAAAAAAAAAAAAAAAAAAA N.S.W.", + "W.A. AAAAAAAAA AAAAAA Vic.", + " AAA S.A. AA", + " A Tas.", + "" +}; + +/* + * Funny messages + */ +#define NMESSAGES 6 + +static const char *messages[] = +{ + "Hello from the Land Down Under", + "The Land of crocs. and a big Red Rock", + "Where the sunflower runs along the highways", + "the dusty red roads lead one to loneliness", + "Blue sky in the morning and", + "freezing nights and twinkling stars", + "" +}; + +/* + * Trap interrupt + */ +static RETSIGTYPE +trap(int sig GCC_UNUSED) +{ + endwin(); + ExitProgram(EXIT_FAILURE); +} + +/* + * Wait for user + */ +static int +WaitForUser(WINDOW *win) +{ + time_t t; + chtype key; + + nodelay(win, TRUE); + t = time((time_t *) 0); + while (1) { + if ((int) (key = (chtype) wgetch(win)) != ERR) { + if (key == 'q' || key == 'Q') + return 1; + else + return 0; + } + if (time((time_t *) 0) - t > 5) + return 0; + } +} + +static void +set_colors(WINDOW *win, int pair, int foreground, int background) +{ + if (has_colors()) { + if (pair > COLOR_PAIRS) + pair = COLOR_PAIRS; + init_pair((short) pair, (short) foreground, (short) background); + (void) wattrset(win, (attr_t) COLOR_PAIR(pair)); + } +} + +static chtype +use_colors(WINDOW *win, int pair, chtype attrs) +{ + if (has_colors()) { + if (pair > COLOR_PAIRS) + pair = COLOR_PAIRS; + attrs |= (chtype) COLOR_PAIR(pair); + } + (void) wattrset(win, attrs); + return attrs; +} + +/* + * Test sub windows + */ +static int +SubWinTest(WINDOW *win) +{ + int w, h, sw, sh, bx, by; + WINDOW *swin1, *swin2, *swin3; + + getmaxyx(win, h, w); + getbegyx(win, by, bx); + sw = w / 3; + sh = h / 3; + if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL) + return 1; + if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL) + return 1; + if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL) + return 1; + + set_colors(swin1, 8, COLOR_RED, COLOR_BLUE); + werase(swin1); + MvWAddStr(swin1, 0, 3, "Sub-window 1"); + wrefresh(swin1); + + set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA); + werase(swin2); + MvWAddStr(swin2, 0, 3, "Sub-window 2"); + wrefresh(swin2); + + set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN); + werase(swin3); + MvWAddStr(swin3, 0, 3, "Sub-window 3"); + wrefresh(swin3); + + delwin(swin1); + delwin(swin2); + delwin(swin3); + WaitForUser(win); + return 0; +} + +static int +bounce(int n, int *dir, int len) +{ + if (*dir > 0) + ++n; + else + --n; + if (n <= 1 || n >= len - 2) + *dir = *dir ? 0 : 1; + return n; +} + +/* + * Bouncing balls + */ +static int +BouncingBalls(WINDOW *win) +{ + int w, h; + int x1, y1, xd1, yd1; + int x2, y2, xd2, yd2; + int x3, y3, xd3, yd3; + + getmaxyx(win, h, w); + + x1 = 2 + rand() % (w - 4); + y1 = 2 + rand() % (h - 4); + x2 = 2 + rand() % (w - 4); + y2 = 2 + rand() % (h - 4); + x3 = 2 + rand() % (w - 4); + y3 = 2 + rand() % (h - 4); + + xd1 = 1; + yd1 = 1; + xd2 = 1; + yd2 = 0; + xd3 = 0; + yd3 = 1; + + nodelay(win, TRUE); + + while (wgetch(win) == ERR) { + x1 = bounce(x1, &xd1, w); + y1 = bounce(y1, &yd1, h); + x2 = bounce(x2, &xd2, w); + y2 = bounce(y2, &yd2, h); + x3 = bounce(x3, &xd3, w); + y3 = bounce(y3, &yd3, h); + + set_colors(win, 11, COLOR_RED, COLOR_BLUE); + MvWAddCh(win, y1, x1, 'O'); + + set_colors(win, 12, COLOR_BLUE, COLOR_RED); + MvWAddCh(win, y2, x2, '*'); + + set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE); + MvWAddCh(win, y3, x3, '@'); + + wmove(win, 0, 0); + wrefresh(win); + delay_output(100); + } + return 0; +} + +/* + * Main driver + */ +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + WINDOW *win; + int w, x, y, i, j, k; + char buffer[200]; + const char *message; + int width, height; + chtype save[80]; + chtype c; + + setlocale(LC_ALL, ""); + + CATCHALL(trap); + + initscr(); + if (has_colors()) + start_color(); + cbreak(); + curs_set(0); + width = 48; + height = 14; /* Create a drawing window */ + win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); + if (win == NULL) { + endwin(); + ExitProgram(EXIT_FAILURE); + } + + while (1) { + set_colors(win, 1, COLOR_WHITE, COLOR_BLUE); + werase(win); + + set_colors(win, 2, COLOR_RED, COLOR_RED); + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + /* Do ramdom output of a character */ + use_colors(win, 1, A_NORMAL); + c = 'a'; + for (i = 0; i < 5000; ++i) { + x = rand() % (width - 2) + 1; + y = rand() % (height - 2) + 1; + MvWAddCh(win, y, x, c); + wrefresh(win); + nodelay(win, TRUE); + if (wgetch(win) != ERR) + break; + if (i == 2000) { + c = 'b'; + set_colors(win, 3, COLOR_CYAN, COLOR_YELLOW); + } + } + + SubWinTest(win); + /* Erase and draw green window */ + set_colors(win, 4, COLOR_YELLOW, COLOR_GREEN); + wbkgd(win, use_colors(win, 4, A_BOLD)); + werase(win); + wrefresh(win); + /* Draw RED bounding box */ + use_colors(win, 2, A_NORMAL); + box(win, ' ', ' '); + wrefresh(win); + /* Display Australia map */ + use_colors(win, 4, A_BOLD); + i = 0; + while (*AusMap[i]) { + MvWAddStr(win, i + 1, 8, AusMap[i]); + wrefresh(win); + delay_output(50); + ++i; + } + + set_colors(win, 5, COLOR_BLUE, COLOR_WHITE); + use_colors(win, 5, A_BLINK); + MvWAddStr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix"); + wrefresh(win); + + /* Draw running messages */ + set_colors(win, 6, COLOR_YELLOW, COLOR_WHITE); + message = messages[j = 0]; + i = 1; + w = width - 2; + strcpy(buffer, message); + while (j < NMESSAGES) { + while ((int) strlen(buffer) < w) { + strcat(buffer, " ... "); + strcat(buffer, messages[++j % NMESSAGES]); + } + + if (i < w) + (void) mvwaddnstr(win, height / 2, w - i, buffer, i); + else + (void) mvwaddnstr(win, height / 2, 1, buffer, w); + + wrefresh(win); + nodelay(win, TRUE); + if (wgetch(win) != ERR) { + flushinp(); + break; + } + if (i++ >= w) { + for (k = 0; (buffer[k] = buffer[k + 1]) != '\0'; k++) ; + } + delay_output(100); + } + + j = 0; + /* Draw running As across in RED */ + set_colors(win, 7, COLOR_RED, COLOR_GREEN); + memset(save, ' ', sizeof(save)); + for (i = 2; i < width - 4; ++i) { + k = (int) mvwinch(win, 4, i); + if (k == ERR) + break; + save[j++] = c = (chtype) k; + c &= A_CHARTEXT; + MvWAddCh(win, 4, i, c); + } + wrefresh(win); + + /* Put a message up wait for a key */ + i = height - 2; + use_colors(win, 5, A_NORMAL); + MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit "); + wrefresh(win); + + if (WaitForUser(win) == 1) + break; + + j = 0; /* Restore the old line */ + for (i = 2; i < width - 4; ++i) + MvWAddCh(win, 4, i, save[j++]); + wrefresh(win); + + BouncingBalls(win); + /* Put a message up wait for a key */ + i = height - 2; + use_colors(win, 5, A_NORMAL); + MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit "); + wrefresh(win); + if (WaitForUser(win) == 1) + break; + } + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/programs b/test/programs new file mode 100644 index 00000000000..bfcc134eb9c --- /dev/null +++ b/test/programs @@ -0,0 +1,93 @@ +# $Id: programs,v 1.19 2009/09/12 19:44:01 tom Exp $ +############################################################################## +# Copyright (c) 2006-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 "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 +# +# programs used for ncurses tests +background $(LDFLAGS_CURSES) $(LOCAL_LIBS) background +blue $(LDFLAGS_CURSES) $(LOCAL_LIBS) blue +bs $(LDFLAGS_CURSES) $(LOCAL_LIBS) bs +cardfile $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) cardfile +chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat +clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw +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_keyok $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_keyok +demo_menus $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_menus +demo_panels $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_panels +demo_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_termcap +demo_terminfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_terminfo +ditto $(LDFLAGS_THREADS) $(LOCAL_LIBS) ditto +dots $(LDFLAGS_TINFO) $(LOCAL_LIBS) dots +dots_mvcur $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_mvcur +echochar $(LDFLAGS_CURSES) $(LOCAL_LIBS) echochar +filter $(LDFLAGS_CURSES) $(LOCAL_LIBS) filter +firework $(LDFLAGS_CURSES) $(LOCAL_LIBS) firework +firstlast $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) firstlast +foldkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) foldkeys +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 +ins_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) ins_wide +insdelln $(LDFLAGS_CURSES) $(LOCAL_LIBS) insdelln +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 +lrtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) lrtest +movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow +ncurses $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) ncurses +newdemo $(LDFLAGS_CURSES) $(LOCAL_LIBS) newdemo +railroad $(LDFLAGS_TINFO) $(LOCAL_LIBS) railroad +rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain +redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw +savescreen $(LDFLAGS_CURSES) $(LOCAL_LIBS) savescreen +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_instr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_instr +test_inwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_inwstr +test_opaque $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_opaque +testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch +testcurs $(LDFLAGS_CURSES) $(LOCAL_LIBS) testcurs +testscanw $(LDFLAGS_CURSES) $(LOCAL_LIBS) testscanw +view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view +worm $(LDFLAGS_THREADS) $(LOCAL_LIBS) worm +xmas $(LDFLAGS_CURSES) $(LOCAL_LIBS) xmas + +# vile:makemode diff --git a/test/railroad.c b/test/railroad.c new file mode 100644 index 00000000000..973ec46a38d --- /dev/null +++ b/test/railroad.c @@ -0,0 +1,254 @@ +/**************************************************************************** + * Copyright (c) 2000-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 * + * "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 - 2000 + * + * $Id: railroad.c,v 1.19 2009/10/24 21:37:56 tom Exp $ + * + * A simple demo of the termcap interface. + */ +#define USE_TINFO +#include + +#if HAVE_TGETENT + +static char *wipeit; +static char *moveit; +static int length; +static int height; + +static char *finisC; +static char *finisS; +static char *finisU; + +static char *startC; +static char *startS; +static char *startU; + +static char *backup; + +static bool interrupted = FALSE; + +static int +outc(TPUTS_ARG c) +{ + int rc = OK; + + if (interrupted) { + char tmp = (char) c; + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = ERR; + } else { + if (putc(c, stdout) == EOF) + rc = ERR; + } + return rc; +} + +static void +PutChar(int ch) +{ + putchar(ch); + fflush(stdout); + napms(moveit ? 10 : 50); /* not really termcap... */ +} + +static void +Backup(void) +{ + tputs(backup != 0 ? backup : "\b", 1, outc); +} + +static void +MyShowCursor(int flag) +{ + if (startC != 0 && finisC != 0) { + tputs(flag ? startC : finisC, 1, outc); + } +} + +static void +StandOut(int flag) +{ + if (startS != 0 && finisS != 0) { + tputs(flag ? startS : finisS, 1, outc); + } +} + +static void +Underline(int flag) +{ + if (startU != 0 && finisU != 0) { + tputs(flag ? startU : finisU, 1, outc); + } +} + +static void +ShowSign(char *string) +{ + char *base = string; + int ch, first, last; + + if (moveit != 0) { + tputs(tgoto(moveit, 0, height - 1), 1, outc); + tputs(wipeit, 1, outc); + } + + while (*string != 0) { + ch = *string; + if (ch != ' ') { + if (moveit != 0) { + for (first = length - 2; first >= (string - base); first--) { + if (first < length - 1) { + tputs(tgoto(moveit, first + 1, height - 1), 1, outc); + PutChar(' '); + } + tputs(tgoto(moveit, first, height - 1), 1, outc); + PutChar(ch); + } + } else { + last = ch; + if (isalpha(ch)) { + first = isupper(ch) ? 'A' : 'a'; + } else if (isdigit(ch)) { + first = '0'; + } else { + first = ch; + } + if (first < last) { + Underline(1); + while (first < last) { + PutChar(first); + Backup(); + first++; + } + Underline(0); + } + } + if (moveit != 0) + Backup(); + } + StandOut(1); + PutChar(ch); + StandOut(0); + fflush(stdout); + string++; + } + if (moveit != 0) + tputs(wipeit, 1, outc); + putchar('\n'); +} + +static void +cleanup(void) +{ + Underline(0); + StandOut(0); + MyShowCursor(1); +} + +static void +onsig(int n GCC_UNUSED) +{ + interrupted = TRUE; + cleanup(); + ExitProgram(EXIT_FAILURE); +} + +static void +railroad(char **args) +{ + NCURSES_CONST char *name = getenv("TERM"); + char buffer[1024]; + char area[1024], *ap = area; + + if (name == 0) + name = "dumb"; + if (tgetent(buffer, name) >= 0) { + + wipeit = tgetstr("ce", &ap); + height = tgetnum("li"); + length = tgetnum("co"); + moveit = tgetstr("cm", &ap); + + if (wipeit == 0 + || moveit == 0 + || height <= 0 + || length <= 0) { + wipeit = 0; + moveit = 0; + height = 0; + length = 0; + } + + startS = tgetstr("so", &ap); + finisS = tgetstr("se", &ap); + + startU = tgetstr("us", &ap); + finisU = tgetstr("ue", &ap); + + backup = tgetstr("le", &ap); + + startC = tgetstr("ve", &ap); + finisC = tgetstr("vi", &ap); + + MyShowCursor(0); + + CATCHALL(onsig); + + while (*args) { + ShowSign(*args++); + } + MyShowCursor(1); + } +} + +int +main(int argc, char *argv[]) +{ + if (argc > 1) { + railroad(argv + 1); + } else { + static char world[] = "Hello World"; + static char *hello[] = + {world, 0}; + railroad(hello); + } + ExitProgram(EXIT_SUCCESS); +} + +#else +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + printf("This program requires termcap\n"); + exit(EXIT_FAILURE); +} +#endif diff --git a/test/rain.c b/test/rain.c new file mode 100644 index 00000000000..5f0cbfa301a --- /dev/null +++ b/test/rain.c @@ -0,0 +1,390 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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: rain.c,v 1.38 2010/11/13 20:11:46 tom Exp $ + */ +#include + +/* rain 11/3/1980 EPS/CITHEP */ + +#ifdef USE_PTHREADS +#include +#endif + +WANT_USE_WINDOW(); + +#define MAX_THREADS 10 +#define MAX_DROP 5 + +struct DATA; + +typedef void (*DrawPart) (struct DATA *); + +typedef struct DATA { + int y, x; +#ifdef USE_PTHREADS + DrawPart func; + int state; +#endif +} DATA; + +#ifdef USE_PTHREADS +pthread_cond_t cond_next_drop; +pthread_mutex_t mutex_next_drop; +static int used_threads; + +typedef struct { + pthread_t myself; + long counter; +} STATS; + +static STATS drop_threads[MAX_THREADS]; +#endif + +static void +onsig(int n GCC_UNUSED) +{ + curs_set(1); + endwin(); + ExitProgram(EXIT_FAILURE); +} + +static double +ranf(void) +{ + long r = (rand() & 077777); + return ((double) r / 32768.); +} + +static int +random_x(void) +{ + return (int) (((double) (COLS - 4) * ranf()) + 2); +} + +static int +random_y(void) +{ + return (int) (((double) (LINES - 4) * ranf()) + 2); +} + +static int +next_j(int j) +{ + if (j == 0) + j = MAX_DROP - 1; + else + --j; + if (has_colors()) { + int z = (int) (3 * ranf()); + chtype color = (chtype) COLOR_PAIR(z); + if (z) + color |= A_BOLD; + (void) attrset(color); + } + return j; +} + +static void +part1(DATA * drop) +{ + MvAddCh(drop->y, drop->x, '.'); +} + +static void +part2(DATA * drop) +{ + MvAddCh(drop->y, drop->x, 'o'); +} + +static void +part3(DATA * drop) +{ + MvAddCh(drop->y, drop->x, 'O'); +} + +static void +part4(DATA * drop) +{ + MvAddCh(drop->y - 1, drop->x, '-'); + MvAddStr(drop->y, drop->x - 1, "|.|"); + MvAddCh(drop->y + 1, drop->x, '-'); +} + +static void +part5(DATA * drop) +{ + MvAddCh(drop->y - 2, drop->x, '-'); + MvAddStr(drop->y - 1, drop->x - 1, "/ \\"); + MvAddStr(drop->y, drop->x - 2, "| O |"); + MvAddStr(drop->y + 1, drop->x - 1, "\\ /"); + MvAddCh(drop->y + 2, drop->x, '-'); +} + +static void +part6(DATA * drop) +{ + MvAddCh(drop->y - 2, drop->x, ' '); + MvAddStr(drop->y - 1, drop->x - 1, " "); + MvAddStr(drop->y, drop->x - 2, " "); + MvAddStr(drop->y + 1, drop->x - 1, " "); + MvAddCh(drop->y + 2, drop->x, ' '); +} + +#ifdef USE_PTHREADS +static void +napsome(void) +{ + napms(60); +} + +/* + * This runs inside the use_window() mutex. + */ +static int +really_draw(WINDOW *win, void *arg) +{ + DATA *data = (DATA *) arg; + + (void) win; + next_j(data->state); + data->func(data); + refresh(); + return OK; +} + +static void +draw_part(void (*func) (DATA *), int state, DATA * data) +{ + data->func = func; + data->state = state; + use_window(stdscr, really_draw, (void *) data); + napsome(); +} + +/* + * Tell the threads that one of them can start work on a new raindrop. + * They may all be busy if we're sending requests too rapidly. + */ +static int +put_next_drop(void) +{ + pthread_cond_signal(&cond_next_drop); + pthread_mutex_unlock(&mutex_next_drop); + + return 0; +} + +/* + * Wait until we're assigned the task of drawing a new raindrop. + */ +static int +get_next_drop(void) +{ + pthread_mutex_lock(&mutex_next_drop); + pthread_cond_wait(&cond_next_drop, &mutex_next_drop); + + return TRUE; +} + +static void * +draw_drop(void *arg) +{ + DATA mydata; + int mystats; + + /* + * Find myself in the list of threads so we can count the number of loops. + */ + for (mystats = 0; mystats < MAX_THREADS; ++mystats) { +#ifdef __MINGW32__ + if (drop_threads[mystats].myself.p == pthread_self().p) +#else + if (drop_threads[mystats].myself == pthread_self()) +#endif + break; + } + + do { + if (mystats < MAX_THREADS) + drop_threads[mystats].counter++; + + /* + * Make a copy of caller's data. We're cheating for the cases after + * the first loop since we still have a pointer into the main thread + * to the data which it uses for setting up this thread (but it has + * been modified to use different coordinates). + */ + mydata = *(DATA *) arg; + + draw_part(part1, 0, &mydata); + draw_part(part2, 1, &mydata); + draw_part(part3, 2, &mydata); + draw_part(part4, 3, &mydata); + draw_part(part5, 4, &mydata); + draw_part(part6, 0, &mydata); + } while (get_next_drop()); + + return NULL; +} + +/* + * The description of pthread_create() is misleading, since it implies that + * threads will exit cleanly after their function returns. + * + * Since they do not (and the number of threads is limited by system + * resources), make a limited number of threads, and signal any that are + * waiting when we want a thread past that limit. + */ +static int +start_drop(DATA * data) +{ + int rc; + + if (!used_threads) { + /* mutex and condition for signalling thread */ + pthread_mutex_init(&mutex_next_drop, NULL); + pthread_cond_init(&cond_next_drop, NULL); + } + + if (used_threads < MAX_THREADS) { + rc = pthread_create(&(drop_threads[used_threads].myself), + NULL, + draw_drop, + data); + ++used_threads; + } else { + rc = put_next_drop(); + } + return rc; +} +#endif + +static int +get_input(void) +{ + return USING_WINDOW(stdscr, wgetch); +} + +int +main(int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + bool done = FALSE; + DATA drop; +#ifndef USE_PTHREADS + DATA last[MAX_DROP]; +#endif + int j = 0; + + setlocale(LC_ALL, ""); + + CATCHALL(onsig); + + initscr(); + if (has_colors()) { + int bg = COLOR_BLACK; + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + bg = -1; +#endif + init_pair(1, COLOR_BLUE, (short) bg); + init_pair(2, COLOR_CYAN, (short) bg); + } + nl(); + noecho(); + curs_set(0); + timeout(0); + +#ifndef USE_PTHREADS + for (j = MAX_DROP; --j >= 0;) { + last[j].x = random_x(); + last[j].y = random_y(); + } + j = 0; +#endif + + while (!done) { + drop.x = random_x(); + drop.y = random_y(); + +#ifdef USE_PTHREADS + if (start_drop(&drop) != 0) { + beep(); + } +#else + /* + * The non-threaded code draws parts of each drop on each loop. + */ + part1(&drop); + + part2(&last[j]); + + j = next_j(j); + part3(&last[j]); + + j = next_j(j); + part4(&last[j]); + + j = next_j(j); + part5(&last[j]); + + j = next_j(j); + part6(&last[j]); + + last[j] = drop; +#endif + + switch (get_input()) { + case ('q'): + case ('Q'): + done = TRUE; + break; + case 's': + nodelay(stdscr, FALSE); + break; + case ' ': + nodelay(stdscr, TRUE); + break; +#ifdef KEY_RESIZE + case (KEY_RESIZE): + break; +#endif + } + napms(50); + } + curs_set(1); + endwin(); +#ifdef USE_PTHREADS + printf("Counts per thread:\n"); + for (j = 0; j < MAX_THREADS; ++j) + printf(" %d:%ld\n", j, drop_threads[j].counter); +#endif + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/redraw.c b/test/redraw.c new file mode 100644 index 00000000000..f62c098b794 --- /dev/null +++ b/test/redraw.c @@ -0,0 +1,171 @@ +/**************************************************************************** + * Copyright (c) 2006-2007,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"), 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: redraw.c,v 1.5 2010/05/01 22:04:08 tom Exp $ + * + * Demonstrate the redrawwin() and wredrawln() functions. + * Thomas Dickey - 2006/11/4 + */ + +#include + +static void +trash(int beg_x, int max_x, int cur_x) +{ + int x; + + for (x = cur_x; x > beg_x; --x) { + putchar('\b'); + } + for (x = beg_x; x < max_x; ++x) { + if (x < cur_x) + putchar('<'); + else if (x == cur_x) + putchar('='); + else if (x > cur_x) + putchar('>'); + } + for (x = max_x; x > cur_x; --x) { + putchar('\b'); + } +} + +static void +test_redraw(WINDOW *win) +{ + WINDOW *win1; + WINDOW *win2; + bool done = FALSE; + int ch, y, x; + int max_y, max_x; + int beg_y, beg_x; + + assert(win != 0); + + scrollok(win, TRUE); + keypad(win, TRUE); + getmaxyx(win, max_y, max_x); + getbegyx(win, beg_y, beg_x); + while (!done) { + ch = wgetch(win); + getyx(win, y, x); + switch (ch) { + case 'q': + /* FALLTHRU */ + case ESCAPE: + done = TRUE; + break; + case 'w': + win1 = newwin(max_y, max_x, + beg_y, beg_x); + win2 = newwin(max_y - 2, max_x - 2, + beg_y + 1, beg_x + 1); + box(win1, 0, 0); + wrefresh(win1); + + test_redraw(win2); + + delwin(win2); + delwin(win1); + + touchwin(win); + break; + + case '!': + /* + * redrawwin() and wredrawln() do not take into account the + * possibility that the cursor may have moved. That makes them + * cumbersome for using with a shell command. So we simply + * trash the current line of the window using backspace/overwrite. + */ + trash(beg_x, max_x, x + beg_x); + break; + +#ifdef NCURSES_VERSION + case '@': + /* + * For a shell command, we can work around the problem noted above + * using mvcur(). It is ifdef'd for NCURSES, since X/Open does + * not define the case where the old location is unknown. + */ + system("date"); + mvcur(-1, -1, y, x); + break; +#endif + + case CTRL('W'): + redrawwin(win); + break; + + case CTRL('L'): + wredrawln(win, y, 1); + break; + + case KEY_UP: + if (y > 0) + wmove(win, y - 1, x); + break; + + case KEY_DOWN: + if (y < max_y) + wmove(win, y + 1, x); + break; + + case KEY_LEFT: + if (x > 0) + wmove(win, y, x - 1); + break; + + case KEY_RIGHT: + if (x < max_x) + wmove(win, y, x + 1); + break; + + default: + if (ch > KEY_MIN) { + waddstr(win, keyname(ch)); + } else { + waddstr(win, unctrl(UChar(ch))); + } + break; + } + wnoutrefresh(win); + doupdate(); + } +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + initscr(); + raw(); + noecho(); + test_redraw(stdscr); + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/savescreen.c b/test/savescreen.c new file mode 100644 index 00000000000..111882d0b55 --- /dev/null +++ b/test/savescreen.c @@ -0,0 +1,342 @@ +/**************************************************************************** + * Copyright (c) 2007-2010,2011 Free 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: savescreen.c,v 1.15 2011/01/15 18:15:11 tom Exp $ + * + * Demonstrate save/restore functions from the curses library. + * Thomas Dickey - 2007/7/14 + */ + +#include + +#if HAVE_SCR_DUMP + +#include +#include + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +static bool use_init = FALSE; + +static int +fexists(const char *name) +{ + struct stat sb; + return (stat(name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFREG); +} + +static void +setup_next(void) +{ + curs_set(1); + reset_shell_mode(); +} + +static void +cleanup(char *files[]) +{ + int n; + + for (n = 0; files[n] != 0; ++n) { + unlink(files[n]); + } +} + +static int +load_screen(char *filename) +{ + int result; + + if (use_init) { + if ((result = scr_init(filename)) != ERR) + result = scr_restore(filename); + } else { + result = scr_set(filename); + } + return result; +} + +/* + * scr_restore() or scr_set() operates on curscr. If we read a character using + * getch() that will refresh stdscr, wiping out the result. To avoid that, + * copy the data back from curscr to stdscr. + */ +static void +after_load(void) +{ + overwrite(curscr, stdscr); + doupdate(); +} + +static void +show_what(int which, int last) +{ + int y, x; + time_t now = time((time_t *) 0); + + getyx(stdscr, y, x); + + move(0, 0); + printw("Saved %d of %d - %s", which, last + 1, ctime(&now)); + + move(y, x); + + refresh(); +} + +static int +get_command(int which, int last) +{ + int ch; + + timeout(100); + + do { + show_what(which, last); + ch = getch(); + } while (ch == ERR); + + return ch; +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: savescreen [-r] files", + "", + "Options:", + " -i use scr_init/scr_restore rather than scr_set", + " -r replay the screen-dump files" + }; + 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 ch; + int which = 0; + int last; + bool replaying = FALSE; + bool done = FALSE; + char **files; + + while ((ch = getopt(argc, argv, "ir")) != -1) { + switch (ch) { + case 'i': + use_init = TRUE; + break; + case 'r': + replaying = TRUE; + break; + default: + usage(); + break; + } + } + + files = argv + optind; + last = argc - optind - 1; + + if (replaying) { + while (last >= 0 && !fexists(files[last])) + --last; + } + + initscr(); + cbreak(); + 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 (replaying) { + + /* + * Use the last file as the initial/current screen. + */ + if (last < 0) { + endwin(); + printf("No screen-dumps given\n"); + ExitProgram(EXIT_FAILURE); + } + + which = last; + if (load_screen(files[which]) == ERR) { + endwin(); + printf("Cannot load screen-dump %s\n", files[which]); + ExitProgram(EXIT_FAILURE); + } + after_load(); + + while (!done && (ch = getch()) != ERR) { + switch (ch) { + case 'n': + /* + * If we got a "next" here, skip to the final screen before + * moving to the next process. + */ + setup_next(); + which = last; + done = TRUE; + break; + case 'q': + endwin(); + cleanup(files); + done = TRUE; + break; + case KEY_BACKSPACE: + case '\b': + if (--which < 0) + which = last; + break; + case ' ': + if (++which > last) + which = 0; + break; + default: + beep(); + continue; + } + + if (ch == 'q') { + ; + } else if (scr_restore(files[which]) == ERR) { + endwin(); + printf("Cannot load screen-dump %s\n", files[which]); + cleanup(files); + ExitProgram(EXIT_FAILURE); + } else { + wrefresh(curscr); + } + } + } 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); + + while (!done) { + switch (get_command(which, last)) { + case 'n': + 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)); + } + } else { + beep(); + } + break; + case KEY_LEFT: + case 'h': + if (--x < 0) + x = COLS - 1; + break; + case KEY_DOWN: + case 'j': + if (++y >= LINES) + y = 1; + break; + case KEY_UP: + case 'k': + if (--y < 1) + y = LINES - 1; + break; + case KEY_RIGHT: + case 'l': + if (++x >= COLS) + x = 0; + break; + } + if (!done) { + time_t now = time((time_t *) 0); + + move(0, 0); + addstr(ctime(&now)); + move(y, x); + addch('#' | A_REVERSE); + move(y, x); + } + } + } + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(int argc, char *argv[]) +{ + printf("This program requires the screen-dump functions\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/savescreen.sh b/test/savescreen.sh new file mode 100755 index 00000000000..e49aa173506 --- /dev/null +++ b/test/savescreen.sh @@ -0,0 +1,56 @@ +#!/bin/sh +############################################################################## +# Copyright (c) 2007,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 "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: savescreen.sh,v 1.4 2009/10/10 17:08:45 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. +PARAMS= +NFILES=4 +PREFIX=savescreen-$$ +n=0 +BEGINS=$PREFIX-$n.tmp +while test $n != $NFILES +do + LATEST=$PREFIX-$n.tmp + PARAMS="$PARAMS $LATEST" + n=`expr $n + 1` +done + +./savescreen $PARAMS +if test -f $BEGINS +then + while test -f $BEGINS + do + ./savescreen -r $PARAMS + test $? != 0 && break + done +else + echo "No screens were saved" +fi diff --git a/test/tclock.c b/test/tclock.c new file mode 100644 index 00000000000..fdcb446b58a --- /dev/null +++ b/test/tclock.c @@ -0,0 +1,258 @@ +/* $Id: tclock.c,v 1.29 2010/11/14 01:04:52 tom Exp $ */ + +#include + +#include + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +/* + tclock - analog/digital clock for curses. + If it gives you joy, then + (a) I'm glad + (b) you need to get out more :-) + + This program is copyright Howard Jones, September 1994 + (ha.jones@ic.ac.uk). It may be freely distributed as + long as this copyright message remains intact, and any + modifications are clearly marked as such. [In fact, if + you modify it, I wouldn't mind the modifications back, + especially if they add any nice features. A good one + would be a precalc table for the 60 hand positions, so + that the floating point stuff can be ditched. As I said, + it was a 20 hackup minute job.] + + COMING SOON: tfishtank. Be the envy of your mac-owning + colleagues. +*/ + +/* To compile: cc -o tclock tclock.c -lcurses -lm */ + +#ifndef PI +#define PI 3.141592654 +#endif + +#define sign(_x) (_x<0?-1:1) + +#define ASPECT 2.2 +#define ROUND(value) ((int)((value) + 0.5)) + +#define A2X(angle,radius) ROUND(ASPECT * radius * sin(angle)) +#define A2Y(angle,radius) ROUND(radius * cos(angle)) + +/* Plot a point */ +static void +plot(int x, int y, char col) +{ + MvAddCh(y, x, (chtype) col); +} + +/* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */ +static void +dline(int pair, int from_x, int from_y, int x2, int y2, char ch) +{ + int dx, dy; + int ax, ay; + int sx, sy; + int x, y; + int d; + + if (has_colors()) + (void) attrset((attr_t) COLOR_PAIR(pair)); + + dx = x2 - from_x; + dy = y2 - from_y; + + ax = abs(dx * 2); + ay = abs(dy * 2); + + sx = sign(dx); + sy = sign(dy); + + x = from_x; + y = from_y; + + if (ax > ay) { + d = ay - (ax / 2); + + while (1) { + plot(x, y, ch); + if (x == x2) + return; + + if (d >= 0) { + y += sy; + d -= ax; + } + x += sx; + d += ay; + } + } else { + d = ax - (ay / 2); + + while (1) { + plot(x, y, ch); + if (y == y2) + return; + + if (d >= 0) { + x += sx; + d -= ay; + } + y += sy; + d += ax; + } + } +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + int i, cx, cy; + double cr, mradius, hradius, mangle, hangle; + double sangle, sradius, hours; + int hdx, hdy; + int mdx, mdy; + int sdx, sdy; + int ch; + int lastbeep = -1; + bool odd = FALSE; + time_t tim; + struct tm *t; + char szChar[10]; + char *text; + short my_bg = COLOR_BLACK; +#if HAVE_GETTIMEOFDAY + struct timeval current; + double fraction = 0.0; +#endif + + setlocale(LC_ALL, ""); + + initscr(); + noecho(); + cbreak(); + nodelay(stdscr, TRUE); + curs_set(0); + + if (has_colors()) { + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + my_bg = -1; +#endif + init_pair(1, COLOR_RED, my_bg); + init_pair(2, COLOR_MAGENTA, my_bg); + init_pair(3, COLOR_GREEN, my_bg); + init_pair(4, COLOR_WHITE, COLOR_BLUE); + } +#ifdef KEY_RESIZE + keypad(stdscr, TRUE); + restart: +#endif + cx = (COLS - 1) / 2; /* 39 */ + cy = LINES / 2; /* 12 */ + if (cx / ASPECT < cy) + cr = cx / ASPECT; + else + cr = cy; + sradius = (5 * cr) / 6; /* 10 */ + mradius = (3 * cr) / 4; /* 9 */ + hradius = cr / 2; /* 6 */ + + for (i = 0; i < 12; i++) { + sangle = (i + 1) * (2.0 * PI) / 12.0; + sdx = A2X(sangle, sradius); + sdy = A2Y(sangle, sradius); + sprintf(szChar, "%d", i + 1); + + MvAddStr(cy - sdy, cx + sdx, szChar); + } + + MvAddStr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994"); + + sradius = (4 * sradius) / 5; + for (;;) { + napms(100); + + tim = time(0); + t = localtime(&tim); + + hours = (t->tm_hour + (t->tm_min / 60.0)); + if (hours > 12.0) + hours -= 12.0; + + mangle = ((t->tm_min + (t->tm_sec / 60.0)) * (2 * PI) / 60.0); + mdx = A2X(mangle, mradius); + mdy = A2Y(mangle, mradius); + + hangle = ((hours) * (2.0 * PI) / 12.0); + hdx = A2X(hangle, hradius); + hdy = A2Y(hangle, hradius); + +#if HAVE_GETTIMEOFDAY + gettimeofday(¤t, 0); + fraction = ((double) current.tv_usec / 1.0e6); +#endif + sangle = ((t->tm_sec + fraction) * (2.0 * PI) / 60.0); + sdx = A2X(sangle, sradius); + sdy = A2Y(sangle, sradius); + + dline(3, cx, cy, cx + mdx, cy - mdy, '#'); + + (void) attrset(A_REVERSE); + dline(2, cx, cy, cx + hdx, cy - hdy, '.'); + attroff(A_REVERSE); + + if (has_colors()) + (void) attrset(COLOR_PAIR(1)); + + dline(1, cx, cy, cx + sdx, cy - sdy, 'O'); + + if (has_colors()) + (void) attrset(COLOR_PAIR(0)); + + text = ctime(&tim); + MvPrintw(2, 0, "%.*s", (int) (strlen(text) - 1), text); + refresh(); + if ((t->tm_sec % 5) == 0 + && t->tm_sec != lastbeep) { + lastbeep = t->tm_sec; + if (has_colors()) { + odd = !odd; + bkgd((chtype) (odd ? COLOR_PAIR(4) : COLOR_PAIR(0))); + } + beep(); + } + + if ((ch = getch()) != ERR) { +#ifdef KEY_RESIZE + if (ch == KEY_RESIZE) { + flash(); + erase(); + wrefresh(curscr); + goto restart; + } +#endif + break; + } + + dline(0, cx, cy, cx + hdx, cy - hdy, ' '); + dline(0, cx, cy, cx + mdx, cy - mdy, ' '); + dline(0, cx, cy, cx + sdx, cy - sdy, ' '); + + } + + curs_set(1); + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/test.priv.h b/test/test.priv.h new file mode 100644 index 00000000000..8070c7131f1 --- /dev/null +++ b/test/test.priv.h @@ -0,0 +1,767 @@ +/**************************************************************************** + * Copyright (c) 1998-2010,2011 Free 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 1996-on * + ****************************************************************************/ +/* $Id: test.priv.h,v 1.102 2011/01/15 23:50:33 tom Exp $ */ + +#ifndef __TEST_PRIV_H +#define __TEST_PRIV_H 1 + +#include + +/* + * Fix ifdef's that look for the form/menu/panel libraries, if we are building + * with wide-character ncurses. + */ +#ifdef HAVE_LIBFORMW +#define HAVE_LIBFORMW 1 +#define HAVE_LIBFORM 1 +#endif + +#ifdef HAVE_LIBMENUW +#define HAVE_LIBMENUW 1 +#define HAVE_LIBMENU 1 +#endif + +#ifdef HAVE_LIBPANELW +#define HAVE_LIBPANELW 1 +#define HAVE_LIBPANEL 1 +#endif + +/* + * Fallback definitions to accommodate broken compilers. + */ +#ifndef HAVE_CURSES_VERSION +#define HAVE_CURSES_VERSION 0 +#endif + +#ifndef HAVE_CHGAT +#define HAVE_CHGAT 0 +#endif + +#ifndef HAVE_COLOR_SET +#define HAVE_COLOR_SET 0 +#endif + +#ifndef HAVE_FILTER +#define HAVE_FILTER 0 +#endif + +#ifndef HAVE_FORM_H +#define HAVE_FORM_H 0 +#endif + +#ifndef HAVE_GETBEGX +#define HAVE_GETBEGX 0 +#endif + +#ifndef HAVE_GETCURX +#define HAVE_GETCURX 0 +#endif + +#ifndef HAVE_GETMAXX +#define HAVE_GETMAXX 0 +#endif + +#ifndef HAVE_GETOPT_H +#define HAVE_GETOPT_H 0 +#endif + +#ifndef HAVE_GETPARX +#define HAVE_GETPARX 0 +#endif + +#ifndef HAVE_GETWIN +#define HAVE_GETWIN 0 +#endif + +#ifndef HAVE_LIBFORM +#define HAVE_LIBFORM 0 +#endif + +#ifndef HAVE_LIBMENU +#define HAVE_LIBMENU 0 +#endif + +#ifndef HAVE_LIBPANEL +#define HAVE_LIBPANEL 0 +#endif + +#ifndef HAVE_LOCALE_H +#define HAVE_LOCALE_H 0 +#endif + +#ifndef HAVE_MENU_H +#define HAVE_MENU_H 0 +#endif + +#ifndef HAVE_MVVLINE +#define HAVE_MVVLINE 0 +#endif + +#ifndef HAVE_MVWVLINE +#define HAVE_MVWVLINE 0 +#endif + +#ifndef HAVE_NAPMS +#define HAVE_NAPMS 1 +#endif + +#ifndef HAVE_NC_ALLOC_H +#define HAVE_NC_ALLOC_H 0 +#endif + +#ifndef HAVE_PANEL_H +#define HAVE_PANEL_H 0 +#endif + +#ifndef HAVE_PUTWIN +#define HAVE_PUTWIN 0 +#endif + +#ifndef HAVE_RESIZE_TERM +#define HAVE_RESIZE_TERM 0 +#endif + +#ifndef HAVE_RIPOFFLINE +#define HAVE_RIPOFFLINE 0 +#endif + +#ifndef HAVE_SETUPTERM +#define HAVE_SETUPTERM 0 +#endif + +#ifndef HAVE_SLK_COLOR +#define HAVE_SLK_COLOR 0 +#endif + +#ifndef HAVE_SLK_INIT +#define HAVE_SLK_INIT 0 +#endif + +#ifndef HAVE_TERMATTRS +#define HAVE_TERMATTRS 0 +#endif + +#ifndef HAVE_TERMNAME +#define HAVE_TERMNAME 0 +#endif + +#ifndef HAVE_TGETENT +#define HAVE_TGETENT 0 +#endif + +#ifndef HAVE_TIGETNUM +#define HAVE_TIGETNUM 0 +#endif + +#ifndef HAVE_TIGETSTR +#define HAVE_TIGETSTR 0 +#endif + +#ifndef HAVE_TYPEAHEAD +#define HAVE_TYPEAHEAD 0 +#endif + +#ifndef HAVE_WINSSTR +#define HAVE_WINSSTR 0 +#endif + +#ifndef HAVE_USE_DEFAULT_COLORS +#define HAVE_USE_DEFAULT_COLORS 0 +#endif + +#ifndef HAVE_WRESIZE +#define HAVE_WRESIZE 0 +#endif + +#ifndef NCURSES_EXT_FUNCS +#define NCURSES_EXT_FUNCS 0 +#endif + +#ifndef NEED_PTEM_H +#define NEED_PTEM_H 0 +#endif + +#ifndef NEED_WCHAR_H +#define NEED_WCHAR_H 0 +#endif + +#ifndef NO_LEAKS +#define NO_LEAKS 0 +#endif + +#include +#include +#include +#include +#include + +#if HAVE_UNISTD_H +#include +#endif + +#include /* include before curses.h to work around glibc bug */ + +#if NEED_WCHAR_H +#include +#ifdef HAVE_LIBUTF8_H +#include +#endif +#endif + +#if defined(HAVE_XCURSES) +#include +#elif defined(HAVE_NCURSESW_NCURSES_H) +#include +#elif defined(HAVE_NCURSES_NCURSES_H) +#include +#else +#include +#endif + +#if defined(HAVE_XCURSES) || defined(PDCURSES) +/* no other headers */ +#undef HAVE_SETUPTERM /* nonfunctional */ +#define HAVE_SETUPTERM 0 +#undef HAVE_TGETENT /* nonfunctional */ +#define HAVE_TGETENT 0 +#undef HAVE_TIGETSTR /* nonfunctional */ +#define HAVE_TIGETSTR 0 +#elif defined(HAVE_NCURSESW_TERM_H) +#include +#elif defined(HAVE_NCURSES_TERM_H) +#include +#elif defined(HAVE_TERM_H) +#include +#endif + +/* + * Not all curses.h implementations include unctrl.h, + * Solaris 10 xpg4 for example. + */ +#if defined(NCURSES_VERSION) || defined(_XOPEN_CURSES) +#if defined(HAVE_NCURSESW_NCURSES_H) +#include +#elif defined(HAVE_NCURSES_NCURSES_H) +#include +#else +#include +#endif +#endif + +#if HAVE_GETOPT_H +#include +#else +/* 'getopt()' may be prototyped in , but declaring its variables + * doesn't hurt. + */ +extern char *optarg; +extern int optind; +#endif /* HAVE_GETOPT_H */ + +#if HAVE_LOCALE_H +#include +#else +#define setlocale(name,string) /* nothing */ +#endif + +#include +#include + +#ifndef GCC_NORETURN +#define GCC_NORETURN /* nothing */ +#endif +#ifndef GCC_PRINTFLIKE +#define GCC_PRINTFLIKE(a,b) /* nothing */ +#endif +#ifndef GCC_UNUSED +#define GCC_UNUSED /* nothing */ +#endif + +#ifndef HAVE_GETNSTR +#define getnstr(s,n) getstr(s) +#endif + +#ifndef USE_SOFTKEYS +#if HAVE_SLK_INIT +#define USE_SOFTKEYS 1 +#else +#define USE_SOFTKEYS 0 +#endif +#endif + +#if !USE_SOFTKEYS +#define slk_init() /* nothing */ +#define slk_restore() /* nothing */ +#define slk_clear() /* nothing */ +#endif + +#ifndef HAVE_WSYNCDOWN +#define wsyncdown(win) /* nothing */ +#endif + +#ifndef USE_WIDEC_SUPPORT +#if (defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5)) && defined(WACS_ULCORNER) +#define USE_WIDEC_SUPPORT 1 +#else +#define USE_WIDEC_SUPPORT 0 +#endif +#endif + +#if HAVE_PANEL_H && HAVE_LIBPANEL +#define USE_LIBPANEL 1 +#else +#define USE_LIBPANEL 0 +#endif + +#if HAVE_MENU_H && HAVE_LIBMENU +#define USE_LIBMENU 1 +#else +#define USE_LIBMENU 0 +#endif + +#if HAVE_FORM_H && HAVE_LIBFORM +#define USE_LIBFORM 1 +#else +#define USE_LIBFORM 0 +#endif + +/* 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 +#else +#define form_getyx(form, y, x) y = (form)->currow, x = (form)->curcol +#endif + +/* workaround, to build against NetBSD's variant of the form library */ +#ifdef HAVE_NETBSD_MENU_H +#define menu_itemwidth(menu) (menu)->max_item_width +#else +#define menu_itemwidth(menu) (menu)->itemlen +#endif + +#ifndef HAVE_TYPE_ATTR_T +#if !USE_WIDEC_SUPPORT && !defined(attr_t) +#define attr_t chtype +#endif +#endif + +#undef NCURSES_CH_T +#if !USE_WIDEC_SUPPORT +#define NCURSES_CH_T chtype +#else +#define NCURSES_CH_T cchar_t +#endif + +#ifndef NCURSES_OPAQUE +#define NCURSES_OPAQUE 0 +#endif + +#ifndef CCHARW_MAX +#define CCHARW_MAX 5 +#endif + +#if defined(NCURSES_VERSION) && defined(CURSES_WACS_ARRAY) && !defined(CURSES_WACS_SYMBOLS) +#define CURSES_WACS_SYMBOLS +#endif + +#if defined(CURSES_WACS_ARRAY) && !defined(CURSES_WACS_SYMBOLS) +/* NetBSD 5.1 defines these incorrectly */ +#undef WACS_RARROW +#undef WACS_LARROW +#undef WACS_UARROW +#undef WACS_DARROW +#undef WACS_BLOCK +#undef WACS_DIAMOND +#undef WACS_CKBOARD +#undef WACS_DEGREE +#undef WACS_PLMINUS +#undef WACS_BOARD +#undef WACS_LANTERN +#undef WACS_LRCORNER +#undef WACS_URCORNER +#undef WACS_ULCORNER +#undef WACS_LLCORNER +#undef WACS_PLUS +#undef WACS_HLINE +#undef WACS_S1 +#undef WACS_S9 +#undef WACS_LTEE +#undef WACS_RTEE +#undef WACS_BTEE +#undef WACS_TTEE +#undef WACS_VLINE +#undef WACS_BULLET +#undef WACS_S3 +#undef WACS_S7 +#undef WACS_LEQUAL +#undef WACS_GEQUAL +#undef WACS_PI +#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['}']) +#endif + +#undef CTRL +#define CTRL(x) ((x) & 0x1f) + +#define QUIT CTRL('Q') +#define ESCAPE CTRL('[') + +#ifndef KEY_MIN +#define KEY_MIN 256 /* not defined in Solaris 8 */ +#endif + +#ifdef DECL_CURSES_DATA_BOOLNAMES +extern char *boolnames[], *boolcodes[], *boolfnames[]; +extern char *numnames[], *numcodes[], *numfnames[]; +extern char *strnames[], *strcodes[], *strfnames[]; +#endif + +#define colored_chtype(ch, attr, pair) \ + ((chtype) (ch) | (chtype) (attr) | (chtype) COLOR_PAIR(pair)) + +/* + * Workaround for HPUX + */ +#if defined(__hpux) && !defined(NCURSES_VERSION) +#define getbegx(w) __getbegx(w) +#define getbegy(w) __getbegy(w) +#define getcurx(w) __getcurx(w) +#define getcury(w) __getcury(w) +#define getmaxx(w) __getmaxx(w) +#define getmaxy(w) __getmaxy(w) +#define getparx(w) __getparx(w) +#define getpary(w) __getpary(w) +#endif + +/* + * Workaround in case getcchar() returns a positive value when the source + * string produces only a L'\0'. + */ +#define TEST_CCHAR(s, count, then_stmt, else_stmt) \ + if ((count = getcchar(s, NULL, NULL, NULL, NULL)) > 0) { \ + wchar_t test_wch[CCHARW_MAX + 2]; \ + attr_t test_attrs; \ + short test_pair; \ + \ + if (getcchar( s, test_wch, &test_attrs, &test_pair, NULL) == OK \ + && test_wch[0] != L'\0') { \ + then_stmt \ + } else { \ + else_stmt \ + } \ + } else { \ + else_stmt \ + } +/* + * 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) +#endif + +#if !defined(getbegx) && !HAVE_GETBEGX +#define getbegx(win) ((win)?(win)->_begx:ERR) +#define getbegy(win) ((win)?(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) +#endif + +/* + * Solaris 10 xpg4: +#define __m_getparx(w) ((w)->_parent == (WINDOW *) 0 ? -1 \ + : (w)->_begx - (w)->_parent->_begx) + */ +#if !defined(getparx) && !HAVE_GETPARX +#ifdef __m_getparx +#define getparx(win) __m_getparx(win) +#define getpary(win) __m_getpary(win) +#else +#define getparx(win) ((win)?((win)->_parx + 1):ERR) +#define getpary(win) ((win)?((win)->_pary + 1):ERR) +#endif +#endif + +#if !defined(mvwvline) && !HAVE_MVWVLINE +#define mvwvline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : wvline(w,ch,n)) +#define mvwhline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : whline(w,ch,n)) +#endif + +#if !defined(mvvline) && !HAVE_MVVLINE +#define mvvline(y,x,ch,n) (move(y,x) == ERR ? ERR : vline(ch,n)) +#define mvhline(y,x,ch,n) (move(y,x) == ERR ? ERR : hline(ch,n)) +#endif + +/* + * Try to accommodate curses implementations that have no terminfo support. + */ +#if HAVE_TIGETNUM +#define TIGETNUM(ti,tc) tigetnum(ti) +#else +#define TIGETNUM(ti,tc) tgetnum(tc) +#endif + +#if HAVE_TIGETSTR +#define TIGETSTR(ti,tc) tigetstr(ti) +#else +#define TIGETSTR(ti,tc) tgetstr(tc,&area_pointer) +#endif + +/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list + * (which is incompatible with legacy usage, doesn't solve any problems). + */ +#define tparm3(a,b,c) tparm(a,b,c,0,0,0,0,0,0,0) +#define tparm2(a,b) tparm(a,b,0,0,0,0,0,0,0,0) + +#define UChar(c) ((unsigned char)(c)) + +#define SIZEOF(table) (sizeof(table)/sizeof(table[0])) + +#if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H +#include +#if HAVE_NC_FREEALL && defined(USE_TINFO) +#undef ExitProgram +#define ExitProgram(code) _nc_free_tinfo(code) +#endif +#else +#define typeMalloc(type,n) (type *) malloc((n) * sizeof(type)) +#define typeCalloc(type,elts) (type *) calloc((elts), sizeof(type)) +#define typeRealloc(type,n,p) (type *) realloc(p, (n) * sizeof(type)) +#endif + +#ifndef ExitProgram +#define ExitProgram(code) exit(code) +#endif + +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif + +#ifdef __MINGW32__ +#include +/* conflicts in test/firstlast.c */ +#undef large +#undef small + +#endif + +/* 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 +#define NCURSES_CONST /* nothing */ +#endif + +/* out-of-band values for representing absent capabilities */ +#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */ +#define ABSENT_NUMERIC (-1) +#define ABSENT_STRING (char *)0 + +/* out-of-band values for representing cancels */ +#define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */ +#define CANCELLED_NUMERIC (-2) +#define CANCELLED_STRING (char *)(-1) + +#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */ +#define VALID_NUMERIC(s) ((s) >= 0) +#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) + +#define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~" + +#define CATCHALL(handler) { \ + int nsig; \ + for (nsig = SIGHUP; nsig < SIGTERM; ++nsig) \ + if (nsig != SIGKILL) \ + signal(nsig, handler); \ + } + +/* + * Workaround for clean(er) compile with Solaris's legacy curses. + * The same would be needed for HPUX 10.20 + */ +#ifndef TPUTS_ARG +#if defined(sun) && !defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH) +#define TPUTS_ARG char +extern char *tgoto(char *, int, int); /* available, but not prototyped */ +#else +#define TPUTS_ARG int +#endif +#endif + +/* + * Workarounds for Solaris's X/Open curses + */ +#if defined(sun) && defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH) +#if !defined(KEY_MIN) && defined(__KEY_MIN) +#define KEY_MIN __KEY_MIN +#endif +#if !defined(KEY_MAX) && defined(__KEY_MIN) +#define KEY_MAX __KEY_MAX +#endif +#endif + +/* + * Workaround to build with Sun's default SVr4 curses. + */ +#ifdef NCURSES_VERSION +#ifndef HAVE_VW_PRINTW +#define HAVE_VW_PRINTW 1 +#endif +#endif + +/* + * ncurses provides arrays of capability names; X/Open discarded these SVr4 + * features. Some implementations continue to provide them (see the test + * configure script). + */ +#ifdef NCURSES_VERSION +#ifndef HAVE_CURSES_DATA_BOOLNAMES +#define HAVE_CURSES_DATA_BOOLNAMES 1 +#endif +#endif + +/* + * ncurses uses const in some places where X/Open does (or did) not allow. + */ +#ifdef NCURSES_VERSION +#define CONST_MENUS const +#else +#define CONST_MENUS /* nothing */ +#endif + +#ifndef HAVE_USE_WINDOW +#if !defined(NCURSES_VERSION_PATCH) || (NCURSES_VERSION_PATCH < 20070915) || !NCURSES_EXT_FUNCS +#define HAVE_USE_WINDOW 0 +#else +#define HAVE_USE_WINDOW 1 +#endif +#endif + +/* + * Simplify setting up demo of threading with these macros. + */ + +#if !HAVE_USE_WINDOW +typedef int (*NCURSES_WINDOW_CB) (WINDOW *, void *); +typedef int (*NCURSES_SCREEN_CB) (SCREEN *, void *); +#endif + +#if HAVE_USE_WINDOW +#define USING_WINDOW(w,func) use_window(w, (NCURSES_WINDOW_CB) func, w) +#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_WINDOW2(w,func,data) func(w,data) +#define WANT_USE_WINDOW() extern void _nc_want_use_window(void) +#endif + +#if HAVE_USE_WINDOW +#define USING_SCREEN(s,func,data) use_screen(s, (NCURSES_SCREEN_CB) func, data) +#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void) +#else +#define USING_SCREEN(s,func,data) func(data) +#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void) +#endif + +#ifdef TRACE +#define Trace(p) _tracef p +#define USE_TRACE 1 +#else +#define Trace(p) /* nothing */ +#define USE_TRACE 0 +#endif + +#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 + +/* + * Workaround for defective implementation of gcc attribute warn_unused_result + */ +#if defined(__GNUC__) && defined(_FORTIFY_SOURCE) +#define IGNORE_RC(func) errno = func +#else +#define IGNORE_RC(func) (void) func +#endif /* gcc workarounds */ + +#define init_mb(state) memset(&state, 0, sizeof(state)) + +#endif /* __TEST_PRIV_H */ diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c new file mode 100644 index 00000000000..a48f2c49e1c --- /dev/null +++ b/test/test_add_wchstr.c @@ -0,0 +1,589 @@ +/**************************************************************************** + * Copyright (c) 2009,2010,2011 Free 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_add_wchstr.c,v 1.15 2011/01/15 18:15:11 tom Exp $ + * + * Demonstrate the waddwchstr() and wadd_wch functions. + * Thomas Dickey - 2009/9/12 + * + * Note: to provide inputs for *add_wch(), we use setcchar(). A quirk of the + * X/Open definition for that function is that the string contains no + * characters with negative width. Any control character (such as tab) falls + * into that category. So it follows that *add_wch() cannot render a tab + * character because there is no legal way to construct a cchar_t containing + * one. X/Open does not document this, and it would be logical to assume that + * *addwchstr() has the same limitation, but it uses a wchar_t string directly, + * and does not document how tabs are handled. + */ + +#include + +#if USE_WIDEC_SUPPORT + +#define WIDE_LINEDATA +#include + +#undef MvAddCh +#undef MvAddStr +#undef MvWAddCh +#undef MvWAddStr + +/* definitions to make it simpler to compare with test_addstr.c */ +#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 WAddNStr wadd_wchnstr +#define WAddStr wadd_wchstr + +#define MY_TABSIZE 8 + +typedef enum { + oDefault = 0, + oMove = 1, + oWindow = 2, + oMoveWindow = 3 +} Options; + +static bool m_opt = FALSE; +static bool pass_ctls = FALSE; +static bool w_opt = FALSE; +static int n_opt = -1; + +static cchar_t *temp_buffer; +static size_t temp_length; + +#define TempBuffer(source_len, source_cast) \ + if (source != 0) { \ + const char *temp; \ + size_t need = source_len + 1; \ + wchar_t have[2]; \ + int n = 0; \ + \ + if (need > temp_length) { \ + temp_length = need * 2; \ + temp_buffer = typeRealloc(cchar_t, temp_length, temp_buffer); \ + } \ + have[0] = 0; \ + have[1] = 0; \ + do { \ + have[0] = source_cast; \ + if (!pass_ctls \ + && have[0] != 0 \ + && have[0] < 256 \ + && (temp = unctrl((chtype) have[0])) != 0 \ + && strlen(temp) > 1) { \ + while (*temp != '\0') { \ + have[0] = *temp++; \ + setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \ + } \ + } else { \ + setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \ + } \ + } while (have[0] != 0); \ + } else if (temp_buffer != 0) { \ + free(temp_buffer); \ + temp_buffer = 0; \ + temp_length = 0; \ + } \ + return temp_buffer; + +static size_t +ChWLen(const wchar_t *source) +{ + size_t result = wcslen(source); + + if (!pass_ctls) { + size_t adjust = 0; + size_t n; + const char *s; + + for (n = 0; n < result; ++n) { + if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) { + adjust += (strlen(s) - 1); + } + } + result += adjust; + } + return result; +} + +static cchar_t * +ChStr(const char *source) +{ + TempBuffer(strlen(source), UChar(*source++)); +} + +static cchar_t * +ChWStr(const wchar_t *source) +{ + TempBuffer(ChWLen(source), *source++); +} + +static void +legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) +{ + const char *showstate; + + switch (state) { + default: + case oDefault: + showstate = ""; + break; + case oMove: + showstate = " (mvXXX)"; + break; + case oWindow: + showstate = " (winXXX)"; + break; + case oMoveWindow: + showstate = " (mvwinXXX)"; + break; + } + + wmove(win, 0, 0); + wprintw(win, + "The Strings/Chars displays should match. Enter any characters, except:\n"); + 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 added %d characters <", level, + showstate, length); + waddwstr(win, buffer); + waddstr(win, ">"); +} + +static int +ColOf(wchar_t *buffer, int length, int margin) +{ + int n; + int result; + + for (n = 0, result = margin + 1; n < length; ++n) { + int ch = buffer[n]; + switch (ch) { + case '\n': + /* actually newline should clear the remainder of the line + * and move to the next line - but that seems a little awkward + * in this example. + */ + case '\r': + result = 0; + break; + case '\b': + if (result > 0) + --result; + break; + case '\t': + result += (MY_TABSIZE - (result % MY_TABSIZE)); + break; + case '\177': + result += 2; + break; + default: + result += wcwidth(ch); + if (ch < 32) + ++result; + break; + } + } + return result; +} + +static int +ConvertCh(chtype source, cchar_t *target) +{ + wchar_t tmp_wchar[2]; + + tmp_wchar[0] = (wchar_t) source; + tmp_wchar[1] = 0; + if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) { + beep(); + return FALSE; + } + return TRUE; +} + +static int +MvWAddCh(WINDOW *win, int y, int x, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = mvwadd_wch(win, y, x, &tmp_cchar); + } else { + code = mvwaddch(win, y, x, ch); + } + return code; +} + +static int +MvAddCh(int y, int x, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = mvadd_wch(y, x, &tmp_cchar); + } else { + code = mvaddch(y, x, ch); + } + return code; +} + +static int +WAddCh(WINDOW *win, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = wadd_wch(win, &tmp_cchar); + } else { + code = waddch(win, ch); + } + return code; +} + +static int +AddCh(chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = add_wch(&tmp_cchar); + } else { + code = addch(ch); + } + return code; +} + +#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) +static void +test_add_wchstr(int level) +{ + static bool first = TRUE; + + int ch; + int limit; + int row = 1; + int col; + int row2, col2; + int length; + wchar_t buffer[BUFSIZ]; + WINDOW *look = 0; + WINDOW *work = 0; + WINDOW *show = 0; + int margin = (2 * MY_TABSIZE) - 1; + Options option = ((m_opt ? oMove : oDefault) + | ((w_opt || (level > 0)) ? oWindow : oDefault)); + + if (first) { + static char cmd[80]; + setlocale(LC_ALL, ""); + + putenv(strcpy(cmd, "TABSIZE=8")); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + keypad(stdscr, TRUE); + } + + limit = LINES - 5; + if (level > 0) { + look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); + work = newwin(limit - 2, COLS - (2 * level), 1, level); + show = newwin(4, COLS, limit + 1, 0); + box(look, 0, 0); + wnoutrefresh(look); + limit -= 2; + } else { + work = stdscr; + show = derwin(stdscr, 4, COLS, limit + 1, 0); + } + keypad(work, TRUE); + + for (col = margin + 1; col < COLS; col += MY_TABSIZE) + MvWVLine(work, row, col, '.', limit - 2); + + MvWVLine(work, row, margin, ACS_VLINE, limit - 2); + 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")); + wnoutrefresh(work); + + buffer[length = 0] = '\0'; + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + + /* + * Show the characters added in color, to distinguish from those that + * are shifted. + */ + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + wbkgdset(work, COLOR_PAIR(1) | ' '); + } + + while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { + wmove(work, row, margin + 1); + switch (ch) { + case key_RECUR: + test_add_wchstr(level + 1); + + touchwin(look); + touchwin(work); + touchwin(show); + + wnoutrefresh(look); + wnoutrefresh(work); + wnoutrefresh(show); + + doupdate(); + break; + case key_NEWLINE: + if (row < limit) { + ++row; + /* put the whole string in, all at once */ + col2 = margin + 1; + switch (option) { + case oDefault: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (move(row, col2) != ERR) { + AddNStr(ChWStr(buffer + col), LEN(col)); + } + } + } else { + if (move(row, col2) != ERR) { + AddStr(ChWStr(buffer)); + } + } + break; + case oMove: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvAddNStr(row, col2, ChWStr(buffer + col), LEN(col)); + } + } else { + MvAddStr(row, col2, ChWStr(buffer)); + } + break; + case oWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (wmove(work, row, col2) != ERR) { + WAddNStr(work, ChWStr(buffer + col), LEN(col)); + } + } + } else { + if (wmove(work, row, col2) != ERR) { + WAddStr(work, ChWStr(buffer)); + } + } + break; + case oMoveWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvWAddNStr(work, row, col2, ChWStr(buffer + + col), LEN(col)); + } + } else { + MvWAddStr(work, row, col2, ChWStr(buffer)); + } + break; + } + + /* do the corresponding single-character add */ + row2 = limit + row; + for (col = 0; col < length; ++col) { + col2 = ColOf(buffer, col, margin); + switch (option) { + case oDefault: + if (move(row2, col2) != ERR) { + AddCh((chtype) buffer[col]); + } + break; + case oMove: + MvAddCh(row2, col2, (chtype) buffer[col]); + break; + case oWindow: + if (wmove(work, row2, col2) != ERR) { + WAddCh(work, (chtype) buffer[col]); + } + break; + case oMoveWindow: + MvWAddCh(work, row2, col2, (chtype) buffer[col]); + break; + } + } + } else { + beep(); + } + break; + default: + buffer[length++] = ch; + buffer[length] = '\0'; + + /* put the string in, one character at a time */ + col = ColOf(buffer, length - 1, margin); + switch (option) { + case oDefault: + if (move(row, col) != ERR) { + AddStr(ChWStr(buffer + length - 1)); + } + break; + case oMove: + MvAddStr(row, col, ChWStr(buffer + length - 1)); + break; + case oWindow: + if (wmove(work, row, col) != ERR) { + WAddStr(work, ChWStr(buffer + length - 1)); + } + break; + case oMoveWindow: + MvWAddStr(work, row, col, ChWStr(buffer + length - 1)); + break; + } + + /* do the corresponding single-character add */ + switch (option) { + case oDefault: + if (move(limit + row, col) != ERR) { + AddCh((chtype) ch); + } + break; + case oMove: + MvAddCh(limit + row, col, (chtype) ch); + break; + case oWindow: + if (wmove(work, limit + row, col) != ERR) { + WAddCh(work, (chtype) ch); + } + break; + case oMoveWindow: + MvWAddCh(work, limit + row, col, (chtype) ch); + break; + } + + wnoutrefresh(work); + + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + break; + } + } + if (level > 0) { + delwin(show); + delwin(work); + delwin(look); + } +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: test_add_wchstr [options]" + ,"" + ,"Options:" + ," -f FILE read data from given file" + ," -n NUM limit string-adds to NUM bytes on ^N replay" + ," -m perform wmove/move separately from add-functions" + ," -p pass-thru control characters without using unctrl()" + ," -w use window-parameter even when stdscr would be implied" + }; + 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; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) { + switch (ch) { + case 'f': + init_linedata(optarg); + break; + case 'm': + m_opt = TRUE; + break; + case 'n': + n_opt = atoi(optarg); + if (n_opt == 0) + n_opt = -1; + break; + case 'p': + pass_ctls = TRUE; + break; + case 'w': + w_opt = TRUE; + break; + default: + usage(); + break; + } + } + if (optind < argc) + usage(); + + test_add_wchstr(0); + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/test_addchstr.c b/test/test_addchstr.c new file mode 100644 index 00000000000..815ccc595bf --- /dev/null +++ b/test/test_addchstr.c @@ -0,0 +1,511 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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_addchstr.c,v 1.13 2010/12/12 01:28:24 tom Exp $ + * + * Demonstrate the waddchstr() and waddch functions. + * Thomas Dickey - 2009/9/12 + */ + +#include + +#include + +#undef MvAddStr +#undef MvWAddStr + +#define AddNStr addchnstr +#define AddStr addchstr +#define MvAddNStr (void) mvaddchnstr +#define MvAddStr (void) mvaddchstr +#define MvWAddNStr (void) mvwaddchnstr +#define MvWAddStr (void) mvwaddchstr +#define WAddNStr waddchnstr +#define WAddStr waddchstr + +#define AddCh addch +#define WAddCh waddch + +#define MY_TABSIZE 8 + +typedef enum { + oDefault = 0, + oMove = 1, + oWindow = 2, + oMoveWindow = 3 +} Options; + +static bool m_opt = FALSE; +static bool pass_ctls = FALSE; +static bool w_opt = FALSE; +static int n_opt = -1; + +static attr_t show_attr; +static chtype *temp_buffer; +static size_t temp_length; + +#define TempBuffer(source_cast) + +static size_t +ChLen(const char *source) +{ + size_t result = strlen(source); + + if (!pass_ctls) { + size_t adjust = 0; + size_t n; + + for (n = 0; n < result; ++n) { + const char *s = unctrl(UChar(source[n])); + if (s != 0) { + adjust += (strlen(s) - 1); + } + } + result += adjust; + } + return result; +} + +static chtype * +ChStr(const char *source) +{ + if (source != 0) { + size_t need = ChLen(source) + 1; + int n = 0; + + if (need > temp_length) { + temp_length = need * 2; + temp_buffer = typeRealloc(chtype, temp_length, temp_buffer); + } + do { + const char *s; + chtype ch = UChar(*source++); + if (!pass_ctls && (s = unctrl(ch)) != 0) { + while (*s != '\0') { + temp_buffer[n++] = UChar(*s++); + } + } else { + temp_buffer[n++] = ch; + } + } while (source[0] != 0); + temp_buffer[n] = 0; + } else if (temp_buffer != 0) { + free(temp_buffer); + temp_buffer = 0; + temp_length = 0; + } + return temp_buffer; +} + +/* color the strings drawn in the workspace */ +static chtype * +ChStr2(const char *source) +{ + size_t len = ChLen(source); + size_t n; + chtype *result = ChStr(source); + for (n = 0; n < len; ++n) { + result[n] |= show_attr; + } + return result; +} + +static void +legend(WINDOW *win, int level, Options state, char *buffer, int length) +{ + const char *showstate; + + switch (state) { + default: + case oDefault: + showstate = ""; + break; + case oMove: + showstate = " (mvXXX)"; + break; + case oWindow: + showstate = " (winXXX)"; + break; + case oMoveWindow: + showstate = " (mvwinXXX)"; + break; + } + + wmove(win, 0, 0); + wprintw(win, + "The Strings/Chars displays should match. Enter any characters, except:\n"); + 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 added %d characters <%s>", level, + showstate, length, buffer); +} + +static int +ColOf(char *buffer, int length, int margin) +{ + int n; + int result; + + for (n = 0, result = margin + 1; n < length; ++n) { + int ch = UChar(buffer[n]); + switch (ch) { + case '\n': + /* actually newline should clear the remainder of the line + * and move to the next line - but that seems a little awkward + * in this example. + */ + case '\r': + result = 0; + break; + case '\b': + if (result > 0) + --result; + break; + case '\t': + result += (MY_TABSIZE - (result % MY_TABSIZE)); + break; + case '\177': + result += 2; + break; + default: + ++result; + if (ch < 32) + ++result; + break; + } + } + return result; +} + +#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) +static void +test_adds(int level) +{ + static bool first = TRUE; + + int ch; + int limit; + int row = 1; + int col; + int row2, col2; + int length; + char buffer[BUFSIZ]; + WINDOW *look = 0; + WINDOW *work = 0; + WINDOW *show = 0; + int margin = (2 * MY_TABSIZE) - 1; + 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")); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + keypad(stdscr, TRUE); + } + + limit = LINES - 5; + if (level > 0) { + look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); + work = newwin(limit - 2, COLS - (2 * level), 1, level); + show = newwin(4, COLS, limit + 1, 0); + box(look, 0, 0); + wnoutrefresh(look); + limit -= 2; + } else { + work = stdscr; + show = derwin(stdscr, 4, COLS, limit + 1, 0); + } + keypad(work, TRUE); + + for (col = margin + 1; col < COLS; col += MY_TABSIZE) + MvWVLine(work, row, col, '.', limit - 2); + + MvWVLine(work, row, margin, ACS_VLINE, limit - 2); + MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); + limit /= 2; + + MvWAddChStr(work, 1, 2, ChStr("String")); + MvWAddChStr(work, limit + 1, 2, ChStr("Chars")); + wnoutrefresh(work); + + buffer[length = 0] = '\0'; + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + + /* + * Show the characters added in color, to distinguish from those that + * are shifted. + */ + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + show_attr = COLOR_PAIR(1); + wbkgdset(work, show_attr | ' '); + } else { + show_attr = A_STANDOUT; + } + + while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { + wmove(work, row, margin + 1); + switch (ch) { + case key_RECUR: + test_adds(level + 1); + + touchwin(look); + touchwin(work); + touchwin(show); + + wnoutrefresh(look); + wnoutrefresh(work); + wnoutrefresh(show); + + doupdate(); + break; + case key_NEWLINE: + if (row < limit) { + ++row; + /* put the whole string in, all at once */ + col2 = margin + 1; + switch (option) { + case oDefault: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (move(row, col2) != ERR) { + AddNStr(ChStr2(buffer + col), LEN(col)); + } + } + } else { + if (move(row, col2) != ERR) { + AddStr(ChStr2(buffer)); + } + } + break; + case oMove: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvAddNStr(row, col2, ChStr2(buffer + col), LEN(col)); + } + } else { + MvAddStr(row, col2, ChStr2(buffer)); + } + break; + case oWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (wmove(work, row, col2) != ERR) { + WAddNStr(work, ChStr2(buffer + col), LEN(col)); + } + } + } else { + if (wmove(work, row, col2) != ERR) { + WAddStr(work, ChStr2(buffer)); + } + } + break; + case oMoveWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvWAddNStr(work, row, col2, ChStr2(buffer + col), + LEN(col)); + } + } else { + MvWAddStr(work, row, col2, ChStr2(buffer)); + } + break; + } + + /* do the corresponding single-character add */ + row2 = limit + row; + for (col = 0; col < length; ++col) { + col2 = ColOf(buffer, col, margin); + switch (option) { + case oDefault: + if (move(row2, col2) != ERR) { + AddCh(UChar(buffer[col])); + } + break; + case oMove: + MvAddCh(row2, col2, UChar(buffer[col])); + break; + case oWindow: + if (wmove(work, row2, col2) != ERR) { + WAddCh(work, UChar(buffer[col])); + } + break; + case oMoveWindow: + MvWAddCh(work, row2, col2, UChar(buffer[col])); + break; + } + } + } else { + beep(); + } + break; + case KEY_BACKSPACE: + ch = '\b'; + /* FALLTHRU */ + default: + if (ch <= 0 || ch > 255) { + beep(); + break; + } + buffer[length++] = (char) ch; + buffer[length] = '\0'; + + /* put the string in, one character at a time */ + col = ColOf(buffer, length - 1, margin); + switch (option) { + case oDefault: + if (move(row, col) != ERR) { + AddStr(ChStr2(buffer + length - 1)); + } + break; + case oMove: + MvAddStr(row, col, ChStr2(buffer + length - 1)); + break; + case oWindow: + if (wmove(work, row, col) != ERR) { + WAddStr(work, ChStr2(buffer + length - 1)); + } + break; + case oMoveWindow: + MvWAddStr(work, row, col, ChStr2(buffer + length - 1)); + break; + } + + /* do the corresponding single-character add */ + switch (option) { + case oDefault: + if (move(limit + row, col) != ERR) { + AddCh(UChar(ch)); + } + break; + case oMove: + MvAddCh(limit + row, col, UChar(ch)); + break; + case oWindow: + if (wmove(work, limit + row, col) != ERR) { + WAddCh(work, UChar(ch)); + } + break; + case oMoveWindow: + MvWAddCh(work, limit + row, col, UChar(ch)); + break; + } + + wnoutrefresh(work); + + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + break; + } + } + if (level > 0) { + delwin(show); + delwin(work); + delwin(look); + } +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: test_addchstr [options]" + ,"" + ,"Options:" + ," -f FILE read data from given file" + ," -n NUM limit string-adds to NUM bytes on ^N replay" + ," -m perform wmove/move separately from add-functions" + ," -p pass-thru control characters without using unctrl()" + ," -w use window-parameter even when stdscr would be implied" + }; + 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; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) { + switch (ch) { + case 'f': + init_linedata(optarg); + break; + case 'm': + m_opt = TRUE; + break; + case 'n': + n_opt = atoi(optarg); + if (n_opt == 0) + n_opt = -1; + break; + case 'p': + pass_ctls = TRUE; + break; + case 'w': + w_opt = TRUE; + break; + default: + usage(); + break; + } + } + if (optind < argc) + usage(); + + test_adds(0); + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/test_addstr.c b/test/test_addstr.c new file mode 100644 index 00000000000..5cc184a2d4b --- /dev/null +++ b/test/test_addstr.c @@ -0,0 +1,424 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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_addstr.c,v 1.6 2010/12/12 00:17:37 tom Exp $ + * + * Demonstrate the waddstr() and waddch functions. + * Thomas Dickey - 2009/9/12 + */ + +#include + +#include + +#define AddNStr addnstr +#define AddStr addstr +#define MvAddNStr (void) mvaddnstr +#define MvWAddNStr (void) mvwaddnstr +#define WAddNStr waddnstr +#define WAddStr waddstr + +#define AddCh addch +#define WAddCh waddch + +#define MY_TABSIZE 8 + +typedef enum { + oDefault = 0, + oMove = 1, + oWindow = 2, + oMoveWindow = 3 +} Options; + +static bool m_opt = FALSE; +static bool w_opt = FALSE; +static int n_opt = -1; + +static void +legend(WINDOW *win, int level, Options state, char *buffer, int length) +{ + const char *showstate; + + switch (state) { + default: + case oDefault: + showstate = ""; + break; + case oMove: + showstate = " (mvXXX)"; + break; + case oWindow: + showstate = " (winXXX)"; + break; + case oMoveWindow: + showstate = " (mvwinXXX)"; + break; + } + + wmove(win, 0, 0); + wprintw(win, + "The Strings/Chars displays should match. Enter any characters, except:\n"); + 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 added %d characters <%s>", level, + showstate, length, buffer); +} + +static int +ColOf(char *buffer, int length, int margin) +{ + int n; + int result; + + for (n = 0, result = margin + 1; n < length; ++n) { + int ch = UChar(buffer[n]); + switch (ch) { + case '\n': + /* actually newline should clear the remainder of the line + * and move to the next line - but that seems a little awkward + * in this example. + */ + case '\r': + result = 0; + break; + case '\b': + if (result > 0) + --result; + break; + case '\t': + result += (MY_TABSIZE - (result % MY_TABSIZE)); + break; + case '\177': + result += 2; + break; + default: + ++result; + if (ch < 32) + ++result; + break; + } + } + return result; +} + +#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) +static void +test_adds(int level) +{ + static bool first = TRUE; + + int ch; + int limit; + int row = 1; + int col; + int row2, col2; + int length; + char buffer[BUFSIZ]; + WINDOW *look = 0; + WINDOW *work = 0; + WINDOW *show = 0; + int margin = (2 * MY_TABSIZE) - 1; + 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")); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + keypad(stdscr, TRUE); + } + + limit = LINES - 5; + if (level > 0) { + look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); + work = newwin(limit - 2, COLS - (2 * level), 1, level); + show = newwin(4, COLS, limit + 1, 0); + box(look, 0, 0); + wnoutrefresh(look); + limit -= 2; + } else { + work = stdscr; + show = derwin(stdscr, 4, COLS, limit + 1, 0); + } + keypad(work, TRUE); + + for (col = margin + 1; col < COLS; col += MY_TABSIZE) + MvWVLine(work, row, col, '.', limit - 2); + + MvWVLine(work, row, margin, ACS_VLINE, limit - 2); + MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); + limit /= 2; + + MvWAddStr(work, 1, 2, "String"); + MvWAddStr(work, limit + 1, 2, "Chars"); + wnoutrefresh(work); + + buffer[length = 0] = '\0'; + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + + /* + * Show the characters added in color, to distinguish from those that + * are shifted. + */ + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + wbkgdset(work, COLOR_PAIR(1) | ' '); + } + + while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { + wmove(work, row, margin + 1); + switch (ch) { + case key_RECUR: + test_adds(level + 1); + + touchwin(look); + touchwin(work); + touchwin(show); + + wnoutrefresh(look); + wnoutrefresh(work); + wnoutrefresh(show); + + doupdate(); + break; + case key_NEWLINE: + if (row < limit) { + ++row; + /* put the whole string in, all at once */ + col2 = margin + 1; + switch (option) { + case oDefault: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (move(row, col2) != ERR) { + AddNStr(buffer + col, LEN(col)); + } + } + } else { + if (move(row, col2) != ERR) { + AddStr(buffer); + } + } + break; + case oMove: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvAddNStr(row, col2, buffer + col, LEN(col)); + } + } else { + MvAddStr(row, col2, buffer); + } + break; + case oWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (wmove(work, row, col2) != ERR) { + WAddNStr(work, buffer + col, LEN(col)); + } + } + } else { + if (wmove(work, row, col2) != ERR) { + WAddStr(work, buffer); + } + } + break; + case oMoveWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvWAddNStr(work, row, col2, buffer + col, LEN(col)); + } + } else { + MvWAddStr(work, row, col2, buffer); + } + break; + } + + /* do the corresponding single-character add */ + row2 = limit + row; + for (col = 0; col < length; ++col) { + col2 = ColOf(buffer, col, margin); + switch (option) { + case oDefault: + if (move(row2, col2) != ERR) { + AddCh(UChar(buffer[col])); + } + break; + case oMove: + MvAddCh(row2, col2, UChar(buffer[col])); + break; + case oWindow: + if (wmove(work, row2, col2) != ERR) { + WAddCh(work, UChar(buffer[col])); + } + break; + case oMoveWindow: + MvWAddCh(work, row2, col2, UChar(buffer[col])); + break; + } + } + } else { + beep(); + } + break; + default: + if (ch <= 0 || ch > 255) { + beep(); + break; + } + buffer[length++] = (char) ch; + buffer[length] = '\0'; + + /* put the string in, one character at a time */ + col = ColOf(buffer, length - 1, margin); + switch (option) { + case oDefault: + if (move(row, col) != ERR) { + AddStr(buffer + length - 1); + } + break; + case oMove: + MvAddStr(row, col, buffer + length - 1); + break; + case oWindow: + if (wmove(work, row, col) != ERR) { + WAddStr(work, buffer + length - 1); + } + break; + case oMoveWindow: + MvWAddStr(work, row, col, buffer + length - 1); + break; + } + + /* do the corresponding single-character add */ + switch (option) { + case oDefault: + if (move(limit + row, col) != ERR) { + AddCh(UChar(ch)); + } + break; + case oMove: + MvAddCh(limit + row, col, UChar(ch)); + break; + case oWindow: + if (wmove(work, limit + row, col) != ERR) { + WAddCh(work, UChar(ch)); + } + break; + case oMoveWindow: + MvWAddCh(work, limit + row, col, UChar(ch)); + break; + } + + wnoutrefresh(work); + + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + break; + } + } + if (level > 0) { + delwin(show); + delwin(work); + delwin(look); + } +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: test_addstr [options]" + ,"" + ,"Options:" + ," -f FILE read data from given file" + ," -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; + 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; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { + switch (ch) { + case 'f': + init_linedata(optarg); + break; + case 'm': + m_opt = TRUE; + break; + case 'n': + n_opt = atoi(optarg); + if (n_opt == 0) + n_opt = -1; + break; + case 'w': + w_opt = TRUE; + break; + default: + usage(); + break; + } + } + if (optind < argc) + usage(); + + test_adds(0); + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/test_addwstr.c b/test/test_addwstr.c new file mode 100644 index 00000000000..92334aee3b1 --- /dev/null +++ b/test/test_addwstr.c @@ -0,0 +1,516 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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_addwstr.c,v 1.6 2010/12/12 00:18:00 tom Exp $ + * + * Demonstrate the waddwstr() and wadd_wch functions. + * Thomas Dickey - 2009/9/12 + * + * Note: to provide inputs for *add_wch(), we use setcchar(). A quirk of the + * X/Open definition for that function is that the string contains no + * characters with negative width. Any control character (such as tab) falls + * into that category. So it follows that *add_wch() cannot render a tab + * character because there is no legal way to construct a cchar_t containing + * one. X/Open does not document this, and it would be logical to assume that + * *addwstr() has the same limitation, but it uses a wchar_t string directly, + * and does not document how tabs are handled. + */ + +#include + +#if USE_WIDEC_SUPPORT + +#define WIDE_LINEDATA +#include + +#undef MvAddCh +#undef MvAddStr +#undef MvWAddCh +#undef MvWAddStr + +/* definitions to make it simpler to compare with inserts.c */ +#define AddNStr addnwstr +#define AddStr addwstr +#define MvAddNStr (void) mvaddnwstr +#define MvAddStr (void) mvaddwstr +#define MvWAddNStr (void) mvwaddnwstr +#define MvWAddStr (void) mvwaddwstr +#define WAddNStr waddnwstr +#define WAddStr waddwstr + +#define MY_TABSIZE 8 + +typedef enum { + oDefault = 0, + oMove = 1, + oWindow = 2, + oMoveWindow = 3 +} Options; + +static bool m_opt = FALSE; +static bool w_opt = FALSE; +static int n_opt = -1; + +static void +legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) +{ + const char *showstate; + + switch (state) { + default: + case oDefault: + showstate = ""; + break; + case oMove: + showstate = " (mvXXX)"; + break; + case oWindow: + showstate = " (winXXX)"; + break; + case oMoveWindow: + showstate = " (mvwinXXX)"; + break; + } + + wmove(win, 0, 0); + wprintw(win, + "The Strings/Chars displays should match. Enter any characters, except:\n"); + 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); + waddwstr(win, buffer); + waddstr(win, ">"); +} + +static int +ColOf(wchar_t *buffer, int length, int margin) +{ + int n; + int result; + + for (n = 0, result = margin + 1; n < length; ++n) { + int ch = buffer[n]; + switch (ch) { + case '\n': + /* actually newline should clear the remainder of the line + * and move to the next line - but that seems a little awkward + * in this example. + */ + case '\r': + result = 0; + break; + case '\b': + if (result > 0) + --result; + break; + case '\t': + result += (MY_TABSIZE - (result % MY_TABSIZE)); + break; + case '\177': + result += 2; + break; + default: + result += wcwidth(ch); + if (ch < 32) + ++result; + break; + } + } + return result; +} + +static int +ConvertCh(chtype source, cchar_t *target) +{ + wchar_t tmp_wchar[2]; + + tmp_wchar[0] = (wchar_t) source; + tmp_wchar[1] = 0; + if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) { + beep(); + return FALSE; + } + return TRUE; +} + +static int +MvWAddCh(WINDOW *win, int y, int x, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = mvwadd_wch(win, y, x, &tmp_cchar); + } else { + code = mvwaddch(win, y, x, ch); + } + return code; +} + +static int +MvAddCh(int y, int x, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = mvadd_wch(y, x, &tmp_cchar); + } else { + code = mvaddch(y, x, ch); + } + return code; +} + +static int +WAddCh(WINDOW *win, chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = wadd_wch(win, &tmp_cchar); + } else { + code = waddch(win, ch); + } + return code; +} + +static int +AddCh(chtype ch) +{ + int code; + cchar_t tmp_cchar; + + if (ConvertCh(ch, &tmp_cchar)) { + code = add_wch(&tmp_cchar); + } else { + code = addch(ch); + } + return code; +} + +#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) +static void +test_inserts(int level) +{ + static bool first = TRUE; + + int ch; + int limit; + int row = 1; + int col; + int row2, col2; + int length; + wchar_t buffer[BUFSIZ]; + WINDOW *look = 0; + WINDOW *work = 0; + WINDOW *show = 0; + int margin = (2 * MY_TABSIZE) - 1; + Options option = ((m_opt ? oMove : oDefault) + | ((w_opt || (level > 0)) ? oWindow : oDefault)); + + if (first) { + static char cmd[80]; + setlocale(LC_ALL, ""); + + putenv(strcpy(cmd, "TABSIZE=8")); + + initscr(); + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + keypad(stdscr, TRUE); + } + + limit = LINES - 5; + if (level > 0) { + look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); + work = newwin(limit - 2, COLS - (2 * level), 1, level); + show = newwin(4, COLS, limit + 1, 0); + box(look, 0, 0); + wnoutrefresh(look); + limit -= 2; + } else { + work = stdscr; + show = derwin(stdscr, 4, COLS, limit + 1, 0); + } + keypad(work, TRUE); + + for (col = margin + 1; col < COLS; col += MY_TABSIZE) + MvWVLine(work, row, col, '.', limit - 2); + + MvWVLine(work, row, margin, ACS_VLINE, limit - 2); + MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); + limit /= 2; + + (void) mvwaddstr(work, 1, 2, "String"); + (void) mvwaddstr(work, limit + 1, 2, "Chars"); + wnoutrefresh(work); + + buffer[length = 0] = '\0'; + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + + /* + * Show the characters inserted in color, to distinguish from those that + * are shifted. + */ + if (has_colors()) { + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + wbkgdset(work, COLOR_PAIR(1) | ' '); + } + + while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { + wmove(work, row, margin + 1); + switch (ch) { + case key_RECUR: + test_inserts(level + 1); + + touchwin(look); + touchwin(work); + touchwin(show); + + wnoutrefresh(look); + wnoutrefresh(work); + wnoutrefresh(show); + + doupdate(); + break; + case key_NEWLINE: + if (row < limit) { + ++row; + /* put the whole string in, all at once */ + col2 = margin + 1; + switch (option) { + case oDefault: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (move(row, col2) != ERR) { + AddNStr(buffer + col, LEN(col)); + } + } + } else { + if (move(row, col2) != ERR) { + AddStr(buffer); + } + } + break; + case oMove: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvAddNStr(row, col2, buffer + col, LEN(col)); + } + } else { + MvAddStr(row, col2, buffer); + } + break; + case oWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + if (wmove(work, row, col2) != ERR) { + WAddNStr(work, buffer + col, LEN(col)); + } + } + } else { + if (wmove(work, row, col2) != ERR) { + WAddStr(work, buffer); + } + } + break; + case oMoveWindow: + if (n_opt > 1) { + for (col = 0; col < length; col += n_opt) { + col2 = ColOf(buffer, col, margin); + MvWAddNStr(work, row, col2, buffer + col, LEN(col)); + } + } else { + MvWAddStr(work, row, col2, buffer); + } + break; + } + + /* do the corresponding single-character insertion */ + row2 = limit + row; + for (col = 0; col < length; ++col) { + col2 = ColOf(buffer, col, margin); + switch (option) { + case oDefault: + if (move(row2, col2) != ERR) { + AddCh((chtype) buffer[col]); + } + break; + case oMove: + MvAddCh(row2, col2, (chtype) buffer[col]); + break; + case oWindow: + if (wmove(work, row2, col2) != ERR) { + WAddCh(work, (chtype) buffer[col]); + } + break; + case oMoveWindow: + MvWAddCh(work, row2, col2, (chtype) buffer[col]); + break; + } + } + } else { + beep(); + } + break; + case KEY_BACKSPACE: + ch = '\b'; + /* FALLTHRU */ + default: + buffer[length++] = ch; + buffer[length] = '\0'; + + /* put the string in, one character at a time */ + col = ColOf(buffer, length - 1, margin); + switch (option) { + case oDefault: + if (move(row, col) != ERR) { + AddStr(buffer + length - 1); + } + break; + case oMove: + MvAddStr(row, col, buffer + length - 1); + break; + case oWindow: + if (wmove(work, row, col) != ERR) { + WAddStr(work, buffer + length - 1); + } + break; + case oMoveWindow: + MvWAddStr(work, row, col, buffer + length - 1); + break; + } + + /* do the corresponding single-character insertion */ + switch (option) { + case oDefault: + if (move(limit + row, col) != ERR) { + AddCh((chtype) ch); + } + break; + case oMove: + MvAddCh(limit + row, col, (chtype) ch); + break; + case oWindow: + if (wmove(work, limit + row, col) != ERR) { + WAddCh(work, (chtype) ch); + } + break; + case oMoveWindow: + MvWAddCh(work, limit + row, col, (chtype) ch); + break; + } + + wnoutrefresh(work); + + legend(show, level, option, buffer, length); + wnoutrefresh(show); + + doupdate(); + break; + } + } + if (level > 0) { + delwin(show); + delwin(work); + delwin(look); + } +} + +static void +usage(void) +{ + static const char *tbl[] = + { + "Usage: inserts [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" + ," -w use window-parameter even when stdscr would be implied" + }; + 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; + + setlocale(LC_ALL, ""); + + while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { + switch (ch) { + case 'f': + init_linedata(optarg); + break; + case 'm': + m_opt = TRUE; + break; + case 'n': + n_opt = atoi(optarg); + if (n_opt == 0) + n_opt = -1; + break; + case 'w': + w_opt = TRUE; + break; + default: + usage(); + break; + } + } + if (optind < argc) + usage(); + + test_inserts(0); + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/test_arrays.c b/test/test_arrays.c new file mode 100644 index 00000000000..e4b9fb1d391 --- /dev/null +++ b/test/test_arrays.c @@ -0,0 +1,99 @@ +/**************************************************************************** + * Copyright (c) 2007,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 * + * "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_arrays.c,v 1.5 2010/11/13 19:57:57 tom Exp $ + * + * Author: Thomas E Dickey + * + * Demonstrate the public arrays from the terminfo library. + +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[]; +extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; + + */ + +#define USE_TINFO +#include + +#if HAVE_TIGETSTR +#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) + +#define DUMP(name) dump_array(#name, name) + +static void +dump_array(const char *name, NCURSES_CONST char *const *list) +{ + int n; + + printf("%s:\n", name); + for (n = 0; list[n] != 0; ++n) { + printf("%5d:%s\n", n, list[n]); + } +} + +int +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) +{ + DUMP(boolnames); + DUMP(boolcodes); + DUMP(boolfnames); + + DUMP(numnames); + DUMP(numcodes); + DUMP(numfnames); + + DUMP(strnames); + DUMP(strcodes); + DUMP(strfnames); + + 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/test_get_wstr.c b/test/test_get_wstr.c new file mode 100644 index 00000000000..dc01b0e69c0 --- /dev/null +++ b/test/test_get_wstr.c @@ -0,0 +1,372 @@ +/**************************************************************************** + * Copyright (c) 2007-2009,2011 Free 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_get_wstr.c,v 1.8 2011/01/15 18:15:11 tom Exp $ + * + * Author: Thomas E Dickey + * + * Demonstrate the get_wstr functions from the curses library. + + int get_wstr(wint_t *wstr); + int getn_wstr(wint_t *wstr, int n); + int wget_wstr(WINDOW *win, wint_t *wstr); + int wgetn_wstr(WINDOW *win, wint_t *wstr, int n); + int mvget_wstr(int y, int x, wint_t *wstr); + int mvgetn_wstr(int y, int x, wint_t *wstr, int n); + int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr); + int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n); + */ + +#include + +#if HAVE_CHGAT +/* NetBSD curses wchgat */ + +#if USE_WIDEC_SUPPORT + +#define BASE_Y 6 +#define MAX_COLS 1024 + +typedef enum { + eGetStr = 0, + eGetNStr, + eMvGetStr, + eMvGetNStr, + eMaxFlavor +} Flavors; + +static bool +Quit(int ch) +{ + return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +static int +Remainder(WINDOW *txtwin) +{ + int result = getmaxx(txtwin) - getcurx(txtwin); + return (result > 0) ? result : 0; +} + +/* + * Show a highlighted line in the place where input will happen. + */ +static void +ShowPrompt(WINDOW *txtwin, int limit) +{ + wchgat(txtwin, limit, A_REVERSE, 0, NULL); + wnoutrefresh(txtwin); +} + +static void +MovePrompt(WINDOW *txtwin, int limit, int y, int x) +{ + wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL); + wmove(txtwin, y, x); + ShowPrompt(txtwin, limit); +} + +static int +ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) +{ + const char *name = "?"; + bool limited = FALSE; + bool wins = (txtwin != stdscr); + int result; + + switch (flavor) { + case eGetStr: + name = wins ? "wget_wstr" : "get_wstr"; + break; + case eGetNStr: + limited = TRUE; + name = wins ? "wgetn_wstr" : "getn_wstr"; + break; + case eMvGetStr: + name = wins ? "mvwget_wstr" : "mvget_wstr"; + break; + case eMvGetNStr: + limited = TRUE; + name = wins ? "mvwgetn_wstr" : "mvgetn_wstr"; + break; + case eMaxFlavor: + break; + } + + wmove(strwin, 0, 0); + werase(strwin); + + if (limited) { + wprintw(strwin, "%s(%d):", name, limit); + } else { + wprintw(strwin, "%s:", name); + } + result = limited ? limit : Remainder(txtwin); + ShowPrompt(txtwin, result); + + wnoutrefresh(strwin); + return result; +} + +static int +test_get_wstr(int level, char **argv, WINDOW *strwin) +{ + WINDOW *txtbox = 0; + WINDOW *txtwin = 0; + FILE *fp; + int ch; + int rc; + int txt_x = 0, txt_y = 0; + int base_y; + int flavor = 0; + int limit = getmaxx(strwin) - 5; + int actual; + wint_t buffer[MAX_COLS]; + + if (argv[level] == 0) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((ch = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(ch)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + wmove(txtwin, txt_y, txt_x); + actual = ShowFlavor(strwin, txtwin, flavor, limit); + while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { + switch (ch) { + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) { + MovePrompt(txtwin, actual, ++txt_y, txt_x); + } else { + beep(); + } + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) { + MovePrompt(txtwin, actual, --txt_y, txt_x); + } else { + beep(); + } + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) { + MovePrompt(txtwin, actual, txt_y, --txt_x); + } else { + beep(); + } + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) { + MovePrompt(txtwin, actual, txt_y, ++txt_x); + } else { + beep(); + } + break; + + case 'w': + test_get_wstr(level + 1, argv, strwin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + + case '-': + if (limit > 0) { + actual = ShowFlavor(strwin, txtwin, flavor, --limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + } else { + beep(); + } + break; + + case '+': + actual = ShowFlavor(strwin, txtwin, flavor, ++limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + break; + + case '<': + if (flavor > 0) { + actual = ShowFlavor(strwin, txtwin, --flavor, limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + } else { + beep(); + } + break; + + case '>': + if (flavor + 1 < eMaxFlavor) { + actual = ShowFlavor(strwin, txtwin, ++flavor, limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + } else { + beep(); + } + break; + + case ':': + actual = ShowFlavor(strwin, txtwin, flavor, limit); + *buffer = '\0'; + rc = ERR; + echo(); + (void) wattrset(txtwin, A_REVERSE); + switch (flavor) { + case eGetStr: + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + rc = wget_wstr(txtwin, buffer); + } else { + move(txt_y, txt_x); + rc = get_wstr(buffer); + } + break; + case eGetNStr: + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + rc = wgetn_wstr(txtwin, buffer, limit); + } else { + move(txt_y, txt_x); + rc = getn_wstr(buffer, limit); + } + break; + case eMvGetStr: + if (txtwin != stdscr) { + rc = mvwget_wstr(txtwin, txt_y, txt_x, buffer); + } else { + rc = mvget_wstr(txt_y, txt_x, buffer); + } + break; + case eMvGetNStr: + if (txtwin != stdscr) { + rc = mvwgetn_wstr(txtwin, txt_y, txt_x, buffer, limit); + } else { + rc = mvgetn_wstr(txt_y, txt_x, buffer, limit); + } + break; + case eMaxFlavor: + break; + } + noecho(); + (void) wattrset(txtwin, A_NORMAL); + wprintw(strwin, "%d", rc); + (void) waddwstr(strwin, (wchar_t *) buffer); + wnoutrefresh(strwin); + break; + default: + beep(); + break; + } + doupdate(); + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +int +main(int argc, char *argv[]) +{ + WINDOW *chrbox; + WINDOW *strwin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(chrbox, 0, 0); + wnoutrefresh(chrbox); + + strwin = derwin(chrbox, 4, COLS - 2, 1, 1); + + test_get_wstr(1, argv, strwin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif +#else +int +main(void) +{ + printf("This program requires the curses chgat function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/test_getstr.c b/test/test_getstr.c new file mode 100644 index 00000000000..a0863937886 --- /dev/null +++ b/test/test_getstr.c @@ -0,0 +1,363 @@ +/**************************************************************************** + * Copyright (c) 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 * + * "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_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $ + * + * Author: Thomas E Dickey + * + * Demonstrate the getstr functions from the curses library. + + int getstr(char *str); + int getnstr(char *str, int n); + int wgetstr(WINDOW *win, char *str); + int wgetnstr(WINDOW *win, char *str, int n); + int mvgetstr(int y, int x, char *str); + int mvwgetstr(WINDOW *win, int y, int x, char *str); + int mvgetnstr(int y, int x, char *str, int n); + int mvwgetnstr(WINDOW *, int y, int x, char *str, int n); + */ + +#include + +#if HAVE_CHGAT +/* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */ + +#define BASE_Y 6 +#define MAX_COLS 1024 + +typedef enum { + eGetStr = 0, + eGetNStr, + eMvGetStr, + eMvGetNStr, + eMaxFlavor +} Flavors; + +static bool +Quit(int ch) +{ + return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +static int +Remainder(WINDOW *txtwin) +{ + int result = getmaxx(txtwin) - getcurx(txtwin); + return (result > 0) ? result : 0; +} + +/* + * Show a highlighted line in the place where input will happen. + */ +static void +ShowPrompt(WINDOW *txtwin, int limit) +{ + wchgat(txtwin, limit, A_REVERSE, 0, NULL); + wnoutrefresh(txtwin); +} + +static void +MovePrompt(WINDOW *txtwin, int limit, int y, int x) +{ + wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL); + wmove(txtwin, y, x); + ShowPrompt(txtwin, limit); +} + +static int +ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) +{ + const char *name = "?"; + bool limited = FALSE; + bool wins = (txtwin != stdscr); + int result; + + switch (flavor) { + case eGetStr: + name = wins ? "wgetstr" : "getstr"; + break; + case eGetNStr: + limited = TRUE; + name = wins ? "wgetnstr" : "getnstr"; + break; + case eMvGetStr: + name = wins ? "mvwgetstr" : "mvgetstr"; + break; + case eMvGetNStr: + limited = TRUE; + name = wins ? "mvwgetnstr" : "mvgetnstr"; + break; + case eMaxFlavor: + break; + } + + wmove(strwin, 0, 0); + werase(strwin); + + if (limited) { + wprintw(strwin, "%s(%d):", name, limit); + } else { + wprintw(strwin, "%s:", name); + } + result = limited ? limit : Remainder(txtwin); + ShowPrompt(txtwin, result); + + wnoutrefresh(strwin); + return result; +} + +static int +test_getstr(int level, char **argv, WINDOW *strwin) +{ + WINDOW *txtbox = 0; + WINDOW *txtwin = 0; + FILE *fp; + int ch; + int rc; + int txt_x = 0, txt_y = 0; + int base_y; + int flavor = 0; + int limit = getmaxx(strwin) - 5; + int actual; + + char buffer[MAX_COLS]; + + if (argv[level] == 0) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((ch = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(ch)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + wmove(txtwin, txt_y, txt_x); + actual = ShowFlavor(strwin, txtwin, flavor, limit); + while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { + switch (ch) { + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) { + MovePrompt(txtwin, actual, ++txt_y, txt_x); + } else { + beep(); + } + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) { + MovePrompt(txtwin, actual, --txt_y, txt_x); + } else { + beep(); + } + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) { + MovePrompt(txtwin, actual, txt_y, --txt_x); + } else { + beep(); + } + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) { + MovePrompt(txtwin, actual, txt_y, ++txt_x); + } else { + beep(); + } + break; + + case 'w': + test_getstr(level + 1, argv, strwin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + + case '-': + if (limit > 0) { + actual = ShowFlavor(strwin, txtwin, flavor, --limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + } else { + beep(); + } + break; + + case '+': + actual = ShowFlavor(strwin, txtwin, flavor, ++limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + break; + + case '<': + if (flavor > 0) { + actual = ShowFlavor(strwin, txtwin, --flavor, limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + } else { + beep(); + } + break; + + case '>': + if (flavor + 1 < eMaxFlavor) { + actual = ShowFlavor(strwin, txtwin, ++flavor, limit); + MovePrompt(txtwin, actual, txt_y, txt_x); + } else { + beep(); + } + break; + + case ':': + actual = ShowFlavor(strwin, txtwin, flavor, limit); + *buffer = '\0'; + rc = ERR; + echo(); + (void) wattrset(txtwin, A_REVERSE); + switch (flavor) { + case eGetStr: + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + rc = wgetstr(txtwin, buffer); + } else { + move(txt_y, txt_x); + rc = getstr(buffer); + } + break; + case eGetNStr: + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + rc = wgetnstr(txtwin, buffer, limit); + } else { + move(txt_y, txt_x); + rc = getnstr(buffer, limit); + } + break; + case eMvGetStr: + if (txtwin != stdscr) { + rc = mvwgetstr(txtwin, txt_y, txt_x, buffer); + } else { + rc = mvgetstr(txt_y, txt_x, buffer); + } + break; + case eMvGetNStr: + if (txtwin != stdscr) { + rc = mvwgetnstr(txtwin, txt_y, txt_x, buffer, limit); + } else { + rc = mvgetnstr(txt_y, txt_x, buffer, limit); + } + break; + case eMaxFlavor: + break; + } + noecho(); + (void) wattrset(txtwin, A_NORMAL); + wprintw(strwin, "%d:%s", rc, buffer); + wnoutrefresh(strwin); + break; + default: + beep(); + break; + } + doupdate(); + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +int +main(int argc, char *argv[]) +{ + WINDOW *chrbox; + WINDOW *strwin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(chrbox, 0, 0); + wnoutrefresh(chrbox); + + strwin = derwin(chrbox, 4, COLS - 2, 1, 1); + + test_getstr(1, argv, strwin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} + +#else +int +main(void) +{ + printf("This program requires the curses chgat function\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/test_instr.c b/test/test_instr.c new file mode 100644 index 00000000000..627db08e2f3 --- /dev/null +++ b/test/test_instr.c @@ -0,0 +1,260 @@ +/**************************************************************************** + * Copyright (c) 2007,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"), 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_instr.c,v 1.5 2010/05/01 19:13:46 tom Exp $ + * + * Author: Thomas E Dickey + * + * Demonstrate the instr functions from the curses library. + + int instr(char *str); + int innstr(char *str, int n); + int winstr(WINDOW *win, char *str); + int winnstr(WINDOW *win, char *str, int n); + int mvinstr(int y, int x, char *str); + int mvinnstr(int y, int x, char *str, int n); + int mvwinstr(WINDOW *win, int y, int x, char *str); + int mvwinnstr(WINDOW *win, int y, int x, char *str, int n); + */ + +#include + +#define BASE_Y 6 +#define MAX_COLS 1024 + +static bool +Quit(int ch) +{ + return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +static void +show_1st(WINDOW *win, int line, char *buffer) +{ + MvWAddStr(win, line, 5, buffer); +} + +static void +showmore(WINDOW *win, int line, char *buffer) +{ + wmove(win, line, 0); + wclrtoeol(win); + show_1st(win, line, buffer); +} + +static int +test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +{ + WINDOW *txtbox = 0; + WINDOW *txtwin = 0; + FILE *fp; + int ch; + int txt_x = 0, txt_y = 0; + int base_y; + int limit = getmaxx(strwin) - 5; + + char buffer[MAX_COLS]; + + if (argv[level] == 0) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((ch = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(ch)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { + switch (ch) { + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) + txt_y++; + else + beep(); + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) + txt_y--; + else + beep(); + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) + txt_x--; + else + beep(); + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) + txt_x++; + else + beep(); + break; + case 'w': + test_inchs(level + 1, argv, chrwin, strwin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + case '-': + if (limit > 0) { + --limit; + } else { + beep(); + } + break; + case '+': + ++limit; + break; + default: + beep(); + break; + } + + MvWPrintw(chrwin, 0, 0, "line:"); + wclrtoeol(chrwin); + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + + if (winstr(txtwin, buffer) != ERR) { + show_1st(chrwin, 0, buffer); + } + if (mvwinstr(txtwin, txt_y, txt_x, buffer) != ERR) { + showmore(chrwin, 1, buffer); + } + } else { + move(txt_y, txt_x); + + if (instr(buffer) != ERR) { + show_1st(chrwin, 0, buffer); + } + if (mvinstr(txt_y, txt_x, buffer) != ERR) { + showmore(chrwin, 1, buffer); + } + } + wnoutrefresh(chrwin); + + MvWPrintw(strwin, 0, 0, "%4d:", limit); + wclrtobot(strwin); + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + if (winnstr(txtwin, buffer, limit) != ERR) { + show_1st(strwin, 0, buffer); + } + + if (mvwinnstr(txtwin, txt_y, txt_x, buffer, limit) != ERR) { + showmore(strwin, 1, buffer); + } + } else { + move(txt_y, txt_x); + if (innstr(buffer, limit) != ERR) { + show_1st(strwin, 0, buffer); + } + + if (mvinnstr(txt_y, txt_x, buffer, limit) != ERR) { + showmore(strwin, 1, buffer); + } + } + + wnoutrefresh(strwin); + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +int +main(int argc, char *argv[]) +{ + WINDOW *chrbox; + WINDOW *chrwin; + WINDOW *strwin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(chrbox, 0, 0); + wnoutrefresh(chrbox); + + chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); + strwin = derwin(chrbox, 2, COLS - 2, 3, 1); + + test_inchs(1, argv, chrwin, strwin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/test_inwstr.c b/test/test_inwstr.c new file mode 100644 index 00000000000..3d2656f3aea --- /dev/null +++ b/test/test_inwstr.c @@ -0,0 +1,269 @@ +/**************************************************************************** + * Copyright (c) 2007,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"), 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_inwstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $ + * + * Author: Thomas E Dickey + * + * Demonstrate the inwstr functions from the curses library. + + int inwstr(wchar_t *str); + int innwstr(wchar_t *str, int n); + int winwstr(WINDOW *win, wchar_t *str); + int winnwstr(WINDOW *win, wchar_t *str, int n); + int mvinwstr(int y, int x, wchar_t *str); + int mvinnwstr(int y, int x, wchar_t *str, int n); + int mvwinwstr(WINDOW *win, int y, int x, wchar_t *str); + int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *str, int n); + */ + +#include + +#if USE_WIDEC_SUPPORT + +#define BASE_Y 6 +#define MAX_COLS 1024 + +static bool +Quit(int ch) +{ + return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +static void +show_1st(WINDOW *win, int line, wchar_t *buffer) +{ + (void) mvwaddwstr(win, line, 5, buffer); +} + +static void +showmore(WINDOW *win, int line, wchar_t *buffer) +{ + wmove(win, line, 0); + wclrtoeol(win); + show_1st(win, line, buffer); +} + +static int +test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) +{ + WINDOW *txtbox = 0; + WINDOW *txtwin = 0; + FILE *fp; + int ch; + int txt_x = 0, txt_y = 0; + int base_y; + int limit = getmaxx(strwin) - 5; + wchar_t buffer[MAX_COLS]; + + if (argv[level] == 0) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((ch = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(ch)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { + switch (ch) { + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) + txt_y++; + else + beep(); + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) + txt_y--; + else + beep(); + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) + txt_x--; + else + beep(); + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) + txt_x++; + else + beep(); + break; + case 'w': + test_inchs(level + 1, argv, chrwin, strwin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + case '-': + if (limit > 0) { + --limit; + } else { + beep(); + } + break; + case '+': + ++limit; + break; + default: + beep(); + break; + } + + MvWPrintw(chrwin, 0, 0, "line:"); + wclrtoeol(chrwin); + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + + if (winwstr(txtwin, buffer) != ERR) { + show_1st(chrwin, 0, buffer); + } + if (mvwinwstr(txtwin, txt_y, txt_x, buffer) != ERR) { + showmore(chrwin, 1, buffer); + } + } else { + move(txt_y, txt_x); + + if (inwstr(buffer) != ERR) { + show_1st(chrwin, 0, buffer); + } + if (mvinwstr(txt_y, txt_x, buffer) != ERR) { + showmore(chrwin, 1, buffer); + } + } + wnoutrefresh(chrwin); + + MvWPrintw(strwin, 0, 0, "%4d:", limit); + wclrtobot(strwin); + + if (txtwin != stdscr) { + wmove(txtwin, txt_y, txt_x); + if (winnwstr(txtwin, buffer, limit) != ERR) { + show_1st(strwin, 0, buffer); + } + + if (mvwinnwstr(txtwin, txt_y, txt_x, buffer, limit) != ERR) { + showmore(strwin, 1, buffer); + } + } else { + move(txt_y, txt_x); + if (innwstr(buffer, limit) != ERR) { + show_1st(strwin, 0, buffer); + } + + if (mvinnwstr(txt_y, txt_x, buffer, limit) != ERR) { + showmore(strwin, 1, buffer); + } + } + + wnoutrefresh(strwin); + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +int +main(int argc, char *argv[]) +{ + WINDOW *chrbox; + WINDOW *chrwin; + WINDOW *strwin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(chrbox, 0, 0); + wnoutrefresh(chrbox); + + chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); + strwin = derwin(chrbox, 2, COLS - 2, 3, 1); + + test_inchs(1, argv, chrwin, strwin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the wide-ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/test_opaque.c b/test/test_opaque.c new file mode 100644 index 00000000000..6ec75fa11a2 --- /dev/null +++ b/test/test_opaque.c @@ -0,0 +1,471 @@ +/**************************************************************************** + * Copyright (c) 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 * + * "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_opaque.c,v 1.9 2009/10/24 21:21:29 tom Exp $ + * + * Author: Thomas E Dickey + * + * Demonstrate the opaque functions from the curses library. + + WINDOW * wgetparent (const WINDOW *); + bool is_cleared(const WINDOW *win); + bool is_idcok(const WINDOW *win); + bool is_idlok(const WINDOW *win); + bool is_immedok(const WINDOW *win); + bool is_keypad(const WINDOW *win); + bool is_leaveok(const WINDOW *win); + bool is_nodelay(const WINDOW *win); + bool is_notimeout(const WINDOW *win); + bool is_scrollok(const WINDOW *win); + bool is_syncok(const WINDOW *win); + int wgetscrreg (const WINDOW *, int *, int *); + */ + +#include + +#define BASE_Y 6 +#define MAX_COLS 1024 + +#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119) && NCURSES_EXT_FUNCS + +static bool +Quit(int ch) +{ + return (ch == 'q' || ch == QUIT || ch == ESCAPE); +} + +typedef bool(*BoolOpaque) (WINDOW *, int); + +static bool +test_opaque_cleared(WINDOW *win, int mode) +{ + if (mode >= 0) { + if (mode) + wclear(win); + } + return is_cleared(win); +} + +static bool +test_opaque_idcok(WINDOW *win, int mode) +{ + if (mode >= 0) { + idcok(win, mode); + } + return is_idcok(win); +} + +static bool +test_opaque_idlok(WINDOW *win, int mode) +{ + if (mode >= 0) { + idlok(win, mode); + } + return is_idlok(win); +} + +static bool +test_opaque_immedok(WINDOW *win, int mode) +{ + if (mode >= 0) { + immedok(win, mode); + } + return is_immedok(win); +} + +static bool +test_opaque_keypad(WINDOW *win, int mode) +{ + if (mode >= 0) { + keypad(win, mode); + } + return is_keypad(win); +} + +static bool +test_opaque_leaveok(WINDOW *win, int mode) +{ + if (mode >= 0) { + leaveok(win, mode); + } + return is_leaveok(win); +} + +static bool +test_opaque_nodelay(WINDOW *win, int mode) +{ + if (mode >= 0) { + nodelay(win, mode); + } + return is_nodelay(win); +} + +static bool +test_opaque_notimeout(WINDOW *win, int mode) +{ + if (mode >= 0) { + notimeout(win, mode); + } + return is_notimeout(win); +} + +static bool +test_opaque_scrollok(WINDOW *win, int mode) +{ + if (mode >= 0) { + scrollok(win, mode); + } + return is_scrollok(win); +} + +static bool +test_opaque_syncok(WINDOW *win, int mode) +{ + if (mode >= 0) { + syncok(win, mode); + } + return is_syncok(win); +} + +static int +status_y(WINDOW *stswin, int cell) +{ + return (cell % getmaxy(stswin)); +} + +static int +status_x(WINDOW *stswin, int cell) +{ + return (15 * (cell / getmaxy(stswin))); +} + +static void +to_keyword(WINDOW *stswin, int cell) +{ + wmove(stswin, status_y(stswin, cell), status_x(stswin, cell)); +} + +static void +to_result(WINDOW *stswin, int cell, bool before) +{ + int y = status_y(stswin, cell); + int x = status_x(stswin, cell) + 11; + if (!before) + ++x; + wmove(stswin, y, x); +} + +static void +show_keyword(WINDOW *stswin, int cell, int active, const char *name) +{ + to_keyword(stswin, cell); + if (active == cell) + (void) wstandout(stswin); + wprintw(stswin, "%s:", name); + if (active == cell) + (void) wstandend(stswin); +} +/* *INDENT-OFF* */ +static struct { + const char *name; + BoolOpaque func; +} bool_funcs[] = { + { "cleared", test_opaque_cleared }, + { "idcok", test_opaque_idcok }, + { "idlok", test_opaque_idlok }, + { "immedok", test_opaque_immedok }, + { "keypad", test_opaque_keypad }, + { "leaveok", test_opaque_leaveok }, + { "nodelay", test_opaque_nodelay }, + { "notimeout", test_opaque_notimeout }, + { "scrollok", test_opaque_scrollok }, + { "syncok", test_opaque_syncok } +}; +/* *INDENT-ON* */ + +/* + * Display and/or allow update for the properties accessed in the opaque + * window. Some may change state after refreshing the window, so we + * distinguish between them using the 'before' parameter. + */ +static int +show_opaque(WINDOW *stswin, WINDOW *txtwin, bool before, int active) +{ + int n; + int top, bottom; + + if (before) { + werase(stswin); + } + for (n = 0; n < (int) SIZEOF(bool_funcs); ++n) { + show_keyword(stswin, n, active, bool_funcs[n].name); + + to_result(stswin, n, before); + wprintw(stswin, "%c", bool_funcs[n].func(txtwin, -1) ? 'T' : 'F'); + } + + show_keyword(stswin, n, active, "wgetparent"); + to_result(stswin, n, TRUE); + wprintw(stswin, "%p", (void *) wgetparent(txtwin)); + + ++n; + show_keyword(stswin, n, active, "wgetscrreg"); + to_result(stswin, n, TRUE); + if (wgetscrreg(txtwin, &top, &bottom) == OK) + wprintw(stswin, "%d,%d", top, bottom); + + wnoutrefresh(stswin); + return active; +} + +static int +test_opaque(int level, char **argv, WINDOW *stswin) +{ + WINDOW *txtbox = 0; + WINDOW *txtwin = 0; + FILE *fp; + int ch; + int txt_x = 0, txt_y = 0; + int base_y; + bool in_status = FALSE; + int active = 0; + + if (argv[level] == 0) { + beep(); + return FALSE; + } + + if (level > 1) { + txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); + box(txtbox, 0, 0); + wnoutrefresh(txtbox); + + txtwin = derwin(txtbox, + getmaxy(txtbox) - 2, + getmaxx(txtbox) - 2, + 1, 1); + base_y = 0; + } else { + txtwin = stdscr; + base_y = BASE_Y; + } + + keypad(txtwin, TRUE); /* enable keyboard mapping */ + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + txt_y = base_y; + txt_x = 0; + wmove(txtwin, txt_y, txt_x); + + if ((fp = fopen(argv[level], "r")) != 0) { + while ((ch = fgetc(fp)) != EOF) { + if (waddch(txtwin, UChar(ch)) != OK) { + break; + } + } + fclose(fp); + } else { + wprintw(txtwin, "Cannot open:\n%s", argv[1]); + } + + for (;;) { + if (in_status) { + to_keyword(stswin, active); + + ch = wgetch(stswin); + show_opaque(stswin, txtwin, TRUE, active); + if (Quit(ch)) + break; + + switch (ch) { + case '\t': + in_status = FALSE; + break; + case KEY_DOWN: + case 'j': + if (active < (int) SIZEOF(bool_funcs) - 1) + active++; + else + beep(); + break; + case KEY_UP: + case 'k': + if (active > 0) + active--; + else + beep(); + break; + case ' ': + bool_funcs[active].func(txtwin, + !bool_funcs[active].func(txtwin, -1)); + break; + default: + beep(); + break; + } + show_opaque(stswin, txtwin, FALSE, in_status ? active : -1); + } else { + ch = mvwgetch(txtwin, txt_y, txt_x); + show_opaque(stswin, txtwin, TRUE, -1); + if (Quit(ch)) + break; + + switch (ch) { + case '\t': + in_status = TRUE; + break; + case KEY_DOWN: + case 'j': + if (txt_y < getmaxy(txtwin) - 1) + txt_y++; + else + beep(); + break; + case KEY_UP: + case 'k': + if (txt_y > base_y) + txt_y--; + else + beep(); + break; + case KEY_LEFT: + case 'h': + if (txt_x > 0) + txt_x--; + else + beep(); + break; + case KEY_RIGHT: + case 'l': + if (txt_x < getmaxx(txtwin) - 1) + txt_x++; + else + beep(); + break; + case 'w': + test_opaque(level + 1, argv, stswin); + if (txtbox != 0) { + touchwin(txtbox); + wnoutrefresh(txtbox); + } else { + touchwin(txtwin); + wnoutrefresh(txtwin); + } + break; + default: + beep(); + napms(100); + break; + } + + show_opaque(stswin, txtwin, FALSE, -1); + } + } + if (level > 1) { + delwin(txtwin); + delwin(txtbox); + } + return TRUE; +} + +static void +test_set_escdelay(void) +{ + set_escdelay((100 + ESCDELAY) / 2); +} + +static void +test_set_tabsize(void) +{ + int y0, x0; + int y, x; + int save_tabsize = TABSIZE; + + (void) cbreak(); /* take input chars one at a time, no wait for \n */ + (void) noecho(); /* don't echo input */ + + for (y = 0; y < LINES; ++y) { + set_tabsize(y + 1); + if (move(y, 0) == ERR) + break; + for (x = 0; x < COLS;) { + addch('\t'); + if (addch('*') == ERR) { + break; + } + getyx(stdscr, y0, x0); + if (y0 != y || x0 == x) { + break; + } + } + } + getch(); + erase(); + + set_tabsize(save_tabsize); +} + +int +main(int argc, char *argv[]) +{ + WINDOW *stsbox; + WINDOW *stswin; + + setlocale(LC_ALL, ""); + + if (argc < 2) { + fprintf(stderr, "usage: %s file\n", argv[0]); + return EXIT_FAILURE; + } + + initscr(); + + test_set_escdelay(); + test_set_tabsize(); + + stsbox = derwin(stdscr, BASE_Y, COLS, 0, 0); + box(stsbox, 0, 0); + wnoutrefresh(stsbox); + + stswin = derwin(stsbox, BASE_Y - 2, COLS - 2, 1, 1); + keypad(stswin, TRUE); + + test_opaque(1, argv, stswin); + + endwin(); + ExitProgram(EXIT_SUCCESS); +} +#else +int +main(void) +{ + printf("This program requires the ncurses library\n"); + ExitProgram(EXIT_FAILURE); +} +#endif diff --git a/test/testaddch.c b/test/testaddch.c new file mode 100644 index 00000000000..7a909e28ab9 --- /dev/null +++ b/test/testaddch.c @@ -0,0 +1,88 @@ +/**************************************************************************** + * Copyright (c) 1998-2006,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 * + * "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. * + ****************************************************************************/ +/* + * This is an example written by Alexander V. Lukyanov , + * to demonstrate an inconsistency between ncurses and SVr4 curses. + * + * $Id: testaddch.c,v 1.7 2009/08/29 19:02:25 tom Exp $ + */ +#include + +static void +attr_addstr(const char *s, chtype a) +{ + while (*s) + addch(((unsigned char) (*s++)) | a); +} + +int +main( + int argc GCC_UNUSED, + char *argv[]GCC_UNUSED) +{ + unsigned i; + chtype back, set, attr; + + setlocale(LC_ALL, ""); + + initscr(); + start_color(); + init_pair(1, COLOR_WHITE, COLOR_BLUE); + init_pair(2, COLOR_WHITE, COLOR_RED); + init_pair(3, COLOR_BLACK, COLOR_MAGENTA); + init_pair(4, COLOR_BLACK, COLOR_GREEN); + init_pair(5, COLOR_BLACK, COLOR_CYAN); + init_pair(6, COLOR_BLACK, COLOR_YELLOW); + init_pair(7, COLOR_BLACK, COLOR_WHITE); + + for (i = 0; i < 8; i++) { + back = (i & 1) ? A_BOLD | 'B' : ' '; + set = (i & 2) ? A_REVERSE : 0; + attr = (i & 4) ? COLOR_PAIR(4) : 0; + + bkgdset(back); + (void) attrset(set); + + attr_addstr("Test string with spaces -> <-\n", attr); + } + addch('\n'); + for (i = 0; i < 8; i++) { + back = (i & 1) ? A_BOLD | 'B' | COLOR_PAIR(1) : ' '; + set = (i & 2) ? A_REVERSE | COLOR_PAIR(2) : 0; + attr = (i & 4) ? COLOR_PAIR(4) : 0; + + bkgdset(back); + (void) attrset(set); + + attr_addstr("Test string with spaces -> <-\n", attr); + } + + getch(); + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/testcurs.c b/test/testcurs.c new file mode 100644 index 00000000000..5cc62f2df30 --- /dev/null +++ b/test/testcurs.c @@ -0,0 +1,737 @@ +/* + * This is a test program for the PDCurses screen package for IBM PC type + * machines. + * + * This program was written by John Burnell (johnb@kea.am.dsir.govt.nz) + * wrs(5/28/93) -- modified to be consistent (perform identically) with either + * PDCurses or under Unix System V, R4 + * + * $Id: testcurs.c,v 1.43 2010/11/13 21:02:28 tom Exp $ + */ + +#include + +#if defined(XCURSES) +char *XCursesProgramName = "testcurs"; +#endif + +static int initTest(WINDOW **); +static void display_menu(int, int); +static void inputTest(WINDOW *); +static void introTest(WINDOW *); +static void outputTest(WINDOW *); +static void padTest(WINDOW *); +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) + +#if !HAVE_STRDUP +#define strdup my_strdup +static char * +strdup(char *s) +{ + char *p = typeMalloc(char, strlen(s) + 1); + if (p) + strcpy(p, s); + return (p); +} +#endif /* not HAVE_STRDUP */ + +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, 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) +{ + int y1 = getmaxy(win); + int x1 = getmaxx(win); + int y0 = y1 < 10 ? y1 : 10; + int x0 = 1; + chtype save; + + save = mvwinch(win, y0, x1 - 1); + + MvWAddStr(win, y0, x0, " Press any key to continue"); + wclrtoeol(win); + getyx(win, y0, x0); + + MvWAddCh(win, y0, x1 - 1, save); + + wmove(win, y0, x0); + raw(); + wgetch(win); +} + +static int +initTest(WINDOW **win) +{ +#ifdef PDCDEBUG + PDC_debug("initTest called\n"); +#endif +#ifdef TRACE + trace(TRACE_MAXIMUM); +#endif + initscr(); +#ifdef PDCDEBUG + PDC_debug("after initscr()\n"); +#endif +#ifdef A_COLOR + if (has_colors()) + start_color(); +#endif + width = 60; + height = 13; /* Create a drawing window */ + *win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); + if (*win == NULL) { + endwin(); + return 0; + } + return 1; +} + +static void +introTest(WINDOW *win) +{ + wmove(win, height / 2 - 5, width / 2); + wvline(win, ACS_VLINE, 10); + wmove(win, height / 2, width / 2 - 10); + whline(win, ACS_HLINE, 20); + Continue(win); + + beep(); + werase(win); + + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + cbreak(); + MvWAddStr(win, 1, 1, + "You should have rectangle in the middle of the screen"); + MvWAddStr(win, 2, 1, "You should have heard a beep"); + Continue(win); + return; +} + +static void +scrollTest(WINDOW *win) +{ + int i; + int half; + int OldY; + NCURSES_CONST char *Message = "The window will now scroll slowly"; + + wclear(win); + OldY = getmaxy(win); + half = OldY / 2; + MvWAddStr(win, OldY - 2, 1, Message); + wrefresh(win); + scrollok(win, TRUE); + for (i = 1; i <= OldY; i++) { + napms(600); + scroll(win); + wrefresh(win); + } + + werase(win); + for (i = 1; i < OldY; i++) { + MvWPrintw(win, i, 1, "Line %d", i); + } + MvWPrintw(win, OldY - 2, 1, "The top of the window will scroll"); + wmove(win, 1, 1); + wsetscrreg(win, 0, half - 1); + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + for (i = 1; i <= half; i++) { + napms(600); + scroll(win); + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + } + + werase(win); + for (i = 1; i < OldY; i++) { + MvWPrintw(win, i, 1, "Line %d", i); + } + MvWPrintw(win, 1, 1, "The bottom of the window will scroll"); + wmove(win, OldY - 2, 1); + wsetscrreg(win, half, --OldY); + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + for (i = half; i <= OldY; i++) { + napms(600); + wscrl(win, -1); + box(win, ACS_VLINE, ACS_HLINE); + wrefresh(win); + } + wsetscrreg(win, 0, OldY); +} + +static void +inputTest(WINDOW *win) +{ + int answered; + int repeat; + int w, h, bx, by, sw, sh, i, c, num; + char buffer[80]; + WINDOW *subWin; + wclear(win); + + getmaxyx(win, h, w); + getbegyx(win, by, bx); + sw = w / 3; + sh = h / 3; + if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL) + return; + +#ifdef A_COLOR + if (has_colors()) { + init_pair(2, COLOR_WHITE, COLOR_RED); + wbkgd(subWin, COLOR_PAIR(2) | A_BOLD); + } else + wbkgd(subWin, A_BOLD); +#else + wbkgd(subWin, A_BOLD); +#endif + box(subWin, ACS_VLINE, ACS_HLINE); + wrefresh(win); + + nocbreak(); + MvWAddStr(win, 2, 1, "Press some keys for 5 seconds"); + MvWAddStr(win, 1, 1, "Pressing ^C should do nothing"); + wrefresh(win); + + werase(subWin); + box(subWin, ACS_VLINE, ACS_HLINE); + for (i = 0; i < 5; i++) { + MvWPrintw(subWin, 1, 1, "Time = %d", i); + wrefresh(subWin); + napms(1000); + flushinp(); + } + + delwin(subWin); + werase(win); + flash(); + wrefresh(win); + napms(500); + + MvWAddStr(win, 2, 1, "Press a key, followed by ENTER"); + wmove(win, 9, 10); + wrefresh(win); + echo(); + noraw(); + wgetch(win); + flushinp(); + + wmove(win, 9, 10); + wdelch(win); + MvWAddStr(win, 4, 1, "The character should now have been deleted"); + Continue(win); + + wclear(win); + MvWAddStr(win, 1, 1, "Press keys (or mouse buttons) to show their names"); + MvWAddStr(win, 2, 1, "Press spacebar to finish"); + wrefresh(win); + + keypad(win, TRUE); + raw(); + noecho(); + +#if HAVE_TYPEAHEAD + typeahead(-1); +#endif + +#if defined(PDCURSES) + mouse_set(ALL_MOUSE_EVENTS); +#endif + + for (;;) { + wmove(win, 3, 5); + c = wgetch(win); + wclrtobot(win); + if (c >= KEY_MIN) + wprintw(win, "Key Pressed: %s", keyname(c)); + else if (isprint(c)) + wprintw(win, "Key Pressed: %c", c); + else + wprintw(win, "Key Pressed: %s", unctrl(UChar(c))); +#if defined(PDCURSES) + if (c == KEY_MOUSE) { + int button = 0; + request_mouse_pos(); + if (BUTTON_CHANGED(1)) + button = 1; + else if (BUTTON_CHANGED(2)) + button = 2; + else if (BUTTON_CHANGED(3)) + button = 3; + else + button = 0; + wmove(win, 4, 18); + wprintw(win, "Button %d: ", button); + if (MOUSE_MOVED) + wprintw(win, "moved: "); + else if ((BUTTON_STATUS(button) & BUTTON_ACTION_MASK) == BUTTON_PRESSED) + wprintw(win, "pressed: "); + else if ((BUTTON_STATUS(button) & BUTTON_ACTION_MASK) == BUTTON_DOUBLE_CLICKED) + wprintw(win, "double: "); + else + wprintw(win, "released: "); + wprintw(win, " Position: Y: %d X: %d", MOUSE_Y_POS, MOUSE_X_POS); + } +#endif + wrefresh(win); + if (c == ' ') + break; + } +#if 0 + nodelay(win, TRUE); + wgetch(win); + nodelay(win, FALSE); +#endif +#if defined(PDCURSES) + mouse_set(0L); +#endif + refresh(); + + repeat = 0; + do { + static const char *fmt[] = + { + "%d %10s", + "%d %[a-zA-Z]s", + "%d %[][a-zA-Z]s", + "%d %[^0-9]" + }; + const char *format = fmt[(unsigned) repeat % SIZEOF(fmt)]; + + wclear(win); + MvWAddStr(win, 3, 2, "The window should have moved"); + MvWAddStr(win, 4, 2, + "This text should have appeared without you pressing a key"); + MvWPrintw(win, 6, 2, + "Scanning with format \"%s\"", format); + mvwin(win, 2 + 2 * (repeat % 4), 1 + 2 * (repeat % 4)); + erase(); + refresh(); + wrefresh(win); + echo(); + noraw(); + num = 0; + *buffer = 0; + answered = mvwscanw(win, 7, 6, strdup(format), &num, buffer); + MvWPrintw(win, 8, 6, + "String: %s Number: %d (%d values read)", + buffer, num, answered); + Continue(win); + ++repeat; + } while (answered > 0); +} + +static void +outputTest(WINDOW *win) +{ + WINDOW *win1; + char Buffer[80]; + chtype ch; + int by, bx; + +#if !HAVE_TIGETSTR +#if HAVE_TGETENT + char tc_buffer[4096]; + char tc_parsed[4096]; + char *area_pointer = tc_parsed; + tgetent(tc_buffer, getenv("TERM")); +#else +#define tgetstr(a,b) 0 +#endif +#endif /* !HAVE_TIGETSTR */ + + nl(); + wclear(win); + MvWAddStr(win, 1, 1, + "You should now have a screen in the upper left corner, and this text should have wrapped"); + mvwin(win, 2, 1); + waddstr(win, "\nThis text should be down\n"); + waddstr(win, "and broken into two here ^"); + Continue(win); + + wclear(win); + wattron(win, A_BOLD); + MvWAddStr(win, 1, 1, "A new window will appear with this text in it"); + MvWAddStr(win, 8, 1, "Press any key to continue"); + wrefresh(win); + wgetch(win); + + getbegyx(win, by, bx); + + if (LINES < 24 || COLS < 75) { + MvWAddStr(win, 5, 1, + "Some tests have been skipped as they require a"); + MvWAddStr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS"); + Continue(win); + } else { + win1 = newwin(10, 50, 14, 25); + if (win1 == NULL) { + endwin(); + return; + } +#ifdef A_COLOR + if (has_colors()) { + init_pair(3, COLOR_BLUE, COLOR_WHITE); + wbkgd(win1, COLOR_PAIR(3)); + } else + wbkgd(win1, A_NORMAL); +#else + wbkgd(win1, A_NORMAL); +#endif + wclear(win1); + MvWAddStr(win1, 5, 1, + "This text should appear; using overlay option"); + copywin(win, win1, 0, 0, 0, 0, 9, 49, TRUE); + +#if defined(PDCURSES) && !defined(XCURSES) + box(win1, 0xb3, 0xc4); +#else + box(win1, ACS_VLINE, ACS_HLINE); +#endif + wmove(win1, 8, 26); + wrefresh(win1); + wgetch(win1); + + wclear(win1); + wattron(win1, A_BLINK); + MvWAddStr(win1, 4, 1, + "This blinking text should appear in only the second window"); + wattroff(win1, A_BLINK); + mvwin(win1, by, bx); + overlay(win, win1); + mvwin(win1, 14, 25); + wmove(win1, 8, 26); + wrefresh(win1); + wgetch(win1); + delwin(win1); + } + + clear(); + wclear(win); + wrefresh(win); + MvWAddStr(win, 6, 2, "This line shouldn't appear"); + MvWAddStr(win, 4, 2, "Only half of the next line is visible"); + MvWAddStr(win, 5, 2, "Only half of the next line is visible"); + wmove(win, 6, 1); + wclrtobot(win); + wmove(win, 5, 20); + wclrtoeol(win); + MvWAddStr(win, 8, 2, "This line also shouldn't appear"); + wmove(win, 8, 1); + wdeleteln(win); + Continue(win); + + wmove(win, 5, 9); + ch = winch(win); + + wclear(win); + wmove(win, 6, 2); + waddstr(win, "The next char should be l: "); + winsch(win, ch); + Continue(win); + +#if HAVE_WINSSTR + (void) mvwinsstr(win, 6, 2, "A1B2C3D4E5"); + Continue(win); +#endif + + wmove(win, 5, 1); + winsertln(win); + MvWAddStr(win, 5, 2, "The lines below should have moved down"); + Continue(win); + + wclear(win); + wmove(win, 2, 2); + wprintw(win, "This is a formatted string in a window: %d %s\n", 42, + "is it"); + MvWAddStr(win, 10, 1, "Enter a string: "); + wrefresh(win); + noraw(); + echo(); + *Buffer = 0; + wscanw(win, "%s", Buffer); + + printw("This is a formatted string in stdscr: %d %s\n", 42, "is it"); + MvAddStr(10, 1, "Enter a string: "); + *Buffer = 0; + scanw("%s", Buffer); + + if (TIGETSTR("cvvis", "vs") != 0) { + wclear(win); + curs_set(2); + MvWAddStr(win, 1, 1, "The cursor should appear as a block (visible)"); + Continue(win); + } + + if (TIGETSTR("civis", "vi") != 0) { + wclear(win); + curs_set(0); + MvWAddStr(win, 1, 1, + "The cursor should have disappeared (invisible)"); + Continue(win); + } + + if (TIGETSTR("cnorm", "ve") != 0) { + wclear(win); + curs_set(1); + MvWAddStr(win, 1, 1, "The cursor should be an underline (normal)"); + Continue(win); + } +#ifdef A_COLOR + if (has_colors()) { + wclear(win); + MvWAddStr(win, 1, 1, "Colors should change after you press a key"); + Continue(win); + init_pair(1, COLOR_RED, COLOR_WHITE); + wrefresh(win); + } +#endif + + werase(win); + +#if HAVE_TERMNAME + MvWAddStr(win, 1, 1, "Information About Your Terminal"); + MvWAddStr(win, 3, 1, termname()); + MvWAddStr(win, 4, 1, longname()); + if (termattrs() & A_BLINK) + MvWAddStr(win, 5, 1, "This terminal supports blinking."); + else + MvWAddStr(win, 5, 1, "This terminal does NOT support blinking."); +#endif + + (void) mvwaddnstr(win, 7, 5, "Have a nice day!ok", 16); + wrefresh(win); + + (void) mvwinnstr(win, 7, 5, Buffer, 18); + MvAddStr(LINES - 2, 10, Buffer); + refresh(); + Continue(win); +} + +#if defined(PDCURSES) && !defined(XCURSES) +static void +resizeTest(WINDOW *dummy GCC_UNUSED) +{ + WINDOW *win1; + + savetty(); + + clear(); + refresh(); +# if defined(OS2) + resize_term(50, 120); +# else + resize_term(50, 80); +# endif + + win1 = newwin(10, 50, 14, 25); + if (win1 == NULL) { + endwin(); + return; + } +#ifdef A_COLOR + if (has_colors()) { + init_pair(3, COLOR_BLUE, COLOR_WHITE); + wattrset(win1, COLOR_PAIR(3)); + } +#endif + wclear(win1); + + MvWAddStr(win1, 1, 1, "The screen may now have 50 lines"); + Continue(win1); + + wclear(win1); + resetty(); + + MvWAddStr(win1, 1, 1, "The screen should now be reset"); + Continue(win1); + + delwin(win1); + + clear(); + refresh(); + +} +#endif + +static void +padTest(WINDOW *dummy GCC_UNUSED) +{ + WINDOW *pad, *spad; + + if ((pad = newpad(50, 100)) != 0) { + wattron(pad, A_REVERSE); + MvWAddStr(pad, 5, 2, "This is a new pad"); + (void) wattrset(pad, A_NORMAL); + MvWAddStr(pad, 8, 0, + "The end of this line should be truncated here:except now"); + MvWAddStr(pad, 11, 1, "This line should not appear.It will now"); + wmove(pad, 10, 1); + wclrtoeol(pad); + MvWAddStr(pad, 10, 1, " Press any key to continue"); + prefresh(pad, 0, 0, 0, 0, 10, 45); + keypad(pad, TRUE); + raw(); + wgetch(pad); + + spad = subpad(pad, 12, 25, 6, 52); + MvWAddStr(spad, 2, 2, "This is a new subpad"); + box(spad, 0, 0); + prefresh(pad, 0, 0, 0, 0, 15, 75); + keypad(pad, TRUE); + raw(); + wgetch(pad); + + MvWAddStr(pad, 35, 2, "This is displayed at line 35 in the pad"); + MvWAddStr(pad, 40, 1, " Press any key to continue"); + prefresh(pad, 30, 0, 0, 0, 10, 45); + keypad(pad, TRUE); + raw(); + wgetch(pad); + + delwin(pad); + } +} + +static void +display_menu(int old_option, int new_option) +{ + int i; + + assert((new_option >= 0) && (new_option < MAX_OPTIONS)); + + (void) attrset(A_NORMAL); + MvAddStr(3, 20, "PDCurses Test Program"); + + for (i = 0; i < (int) MAX_OPTIONS; i++) + MvAddStr(5 + i, 25, command[i].text); + + if ((old_option >= 0) && (old_option < MAX_OPTIONS)) + MvAddStr(5 + old_option, 25, command[old_option].text); + + (void) attrset(A_REVERSE); + MvAddStr(5 + new_option, 25, command[new_option].text); + (void) attrset(A_NORMAL); + MvAddStr(13, 3, + "Use Up and Down Arrows to select - Enter to run - Q to quit"); + refresh(); +} diff --git a/test/testscanw.c b/test/testscanw.c new file mode 100644 index 00000000000..79589c20386 --- /dev/null +++ b/test/testscanw.c @@ -0,0 +1,67 @@ +/**************************************************************************** + * Copyright (c) 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 * + * "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. * + ****************************************************************************/ +/* gleaned from a web-search, shows a bug combining scanw and implicit scroll. + * Date: 1997/03/17 + * From: bayern@morpheus.cis.yale.edu + * + * $Id: testscanw.c,v 1.11 2006/04/01 19:08:03 tom Exp $ + */ +#include + +int +main(int argc, char *argv[]) +{ + long badanswer = 1; + long *response = &badanswer; + + setlocale(LC_ALL, ""); + + initscr(); + scrollok(stdscr, TRUE); + idlok(stdscr, TRUE); + echo(); + +#if 0 + trace(TRACE_UPDATE | TRACE_CALLS); +#endif + while (argc > 1) { + if (isdigit(UChar(*argv[1]))) + move(atoi(argv[1]), 0); + else if (!strcmp(argv[1], "-k")) + keypad(stdscr, TRUE); + argc--, argv++; + } + + while (badanswer) { + printw("Enter a number (0 to quit):\n"); + printw("--> "); + scanw("%20ld", response); /* yes, it's a pointer */ + } + endwin(); + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/tracemunch b/test/tracemunch new file mode 100755 index 00000000000..1ea6f4b6902 --- /dev/null +++ b/test/tracemunch @@ -0,0 +1,161 @@ +#!/usr/bin/perl -w +# $Id: tracemunch,v 1.6 2005/03/12 21:48:23 tom Exp $ +############################################################################## +# Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. # +# # +# Permission is hereby granted, free of charge, to any person obtaining a # +# copy of this software and associated documentation files (the "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. # +############################################################################## +# tracemunch -- compactify ncurses trace logs +# +# 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; + +our $putattr="PutAttrChar\\({{ '(.)' = 0[0-7]+ }}\\) at \\(([0-9]+), ([0-9]+)\\)"; +our $waddnstr="waddnstr\\(0x([0-9a-f]+),\"([^\"]+)\",[0-9]+\\) called {A_NORMAL}"; + +our $win_nums=0; +our $curscr=""; +our $newscr=""; +our $stdscr=""; +our @win_addr; + +sub transaddr +{ + 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]; + } + + return $arg; +} + +while () +{ + 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 () + { + 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 () + { + 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 () { + if (&transaddr($_) eq $anyline) { + $repeatcount++; + } else { + last; + } + } + if ($repeatcount > 1) { + print "${repeatcount} REPEATS OF $anyline"; + } else { + print $anyline + } + redo CLASSIFY if $_; + + } # :CLASSIFY +} + +# tracemunch ends here diff --git a/test/view.c b/test/view.c new file mode 100644 index 00000000000..6e5c2411cf4 --- /dev/null +++ b/test/view.c @@ -0,0 +1,586 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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. * + ****************************************************************************/ +/* + * view.c -- a silly little viewer program + * + * written by Eric S. Raymond December 1994 + * to test the scrolling code in ncurses. + * + * modified by Thomas Dickey July 1995 to demonstrate + * the use of 'resizeterm()', and May 2000 to illustrate wide-character + * handling. + * + * Takes a filename argument. It's a simple file-viewer with various + * scroll-up and scroll-down commands. + * + * n -- scroll one line forward + * p -- scroll one line back + * + * Either command accepts a numeric prefix interpreted as a repeat count. + * Thus, typing `5n' should scroll forward 5 lines in the file. + * + * The way you can tell this is working OK is that, in the trace file, + * there should be one scroll operation plus a small number of line + * updates, as opposed to a whole-page update. This means the physical + * scroll operation worked, and the refresh() code only had to do a + * partial repaint. + * + * $Id: view.c,v 1.81 2010/11/14 01:06:02 tom Exp $ + */ + +#include + +#include + +#undef CTRL /* conflict on AIX 5.2 with */ + +#if HAVE_TERMIOS_H +# include +#else +#if !defined(__MINGW32__) +# include +#endif +#endif + +#if !defined(sun) || !HAVE_TERMIOS_H +# if HAVE_SYS_IOCTL_H +# include +# endif +#endif + +#define my_pair 1 + +/* This is needed to compile 'struct winsize' */ +#if NEED_PTEM_H +#include +#include +#endif + +#if USE_WIDEC_SUPPORT +#if HAVE_MBTOWC && HAVE_MBLEN +#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) +#define count_mbytes(buffer,length,state) mblen(buffer,length) +#define check_mbytes(wch,buffer,length,state) \ + (int) mbtowc(&wch, buffer, length) +#define state_unused +#elif HAVE_MBRTOWC && HAVE_MBRLEN +#define reset_mbytes(state) init_mb(state) +#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) +#define check_mbytes(wch,buffer,length,state) \ + (int) mbrtowc(&wch, buffer, length, &state) +#else +make an error +#endif +#endif /* USE_WIDEC_SUPPORT */ + +static RETSIGTYPE 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 RETSIGTYPE adjust(int sig); +static int interrupted; +#endif + +static bool waiting = FALSE; +static int shift = 0; +static bool try_color = FALSE; + +static char *fname; +static NCURSES_CH_T **vec_lines; +static NCURSES_CH_T **lptr; +static int num_lines; + +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" + ," -n NUM specify maximum number of lines (default 1000)" +#if defined(KEY_RESIZE) + ," -r use old-style sigwinch handler rather than KEY_RESIZE" +#endif +#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); +} + +static int +ch_len(NCURSES_CH_T * src) +{ + int result = 0; +#if USE_WIDEC_SUPPORT + int count; +#endif + +#if USE_WIDEC_SUPPORT + for (;;) { + TEST_CCHAR(src, count, { + ++result; + ++src; + } + , { + break; + }) + } +#else + while (*src++) + result++; +#endif + 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) +{ + unsigned len = (unsigned) strlen(src); + NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1); + unsigned j, k; +#if USE_WIDEC_SUPPORT + wchar_t wstr[CCHARW_MAX + 1]; + wchar_t wch; + int l = 0; + size_t rc; + int width; +#ifndef state_unused + mbstate_t state; +#endif +#endif /* USE_WIDEC_SUPPORT */ + +#if USE_WIDEC_SUPPORT + reset_mbytes(state); +#endif + for (j = k = 0; j < len; j++) { +#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 (width == 0 && l == 0) + wstr[l++] = L' '; + wstr[l++] = wch; +#else + dst[k++] = (chtype) UChar(src[j]); +#endif + } +#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; +#endif + return dst; +} + +int +main(int argc, char *argv[]) +{ + int MAXLINES = 1000; + FILE *fp; + char buf[BUFSIZ]; + int i; + int my_delay = 0; + NCURSES_CH_T **olptr; + int value = 0; + bool done = FALSE; + bool got_number = 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:rtT:")) != -1) { + switch (i) { + case 'c': + try_color = TRUE; + break; + case 'i': + CATCHALL(SIG_IGN); + break; + case 'n': + if ((MAXLINES = atoi(optarg)) < 1 || + (MAXLINES + 2) <= 1) + usage(); + break; +#if CAN_RESIZE + case 'r': + nonposix_resize = TRUE; + break; +#endif +#ifdef TRACE + case 'T': + trace((unsigned) atoi(optarg)); + break; + case 't': + trace(TRACE_CALLS); + break; +#endif + default: + usage(); + } + } + 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 + + /* 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; + + /* convert tabs so that shift will work properly */ + for (s = buf, d = temp, col = 0; (*d = *s) != '\0'; s++) { + 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 */ + 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 */ + 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(COLOR_PAIR(my_pair)); + } else { + try_color = FALSE; + } + } + + lptr = vec_lines; + while (!done) { + int n, c; + + if (!got_number) + show_all(my_label); + + for (;;) { +#if CAN_RESIZE + if (interrupted) { + adjust(0); + my_label = "interrupt"; + } +#endif + waiting = TRUE; + c = getch(); + waiting = FALSE; + 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': + olptr = lptr; + for (i = 0; i < n; i++) + if ((lptr - vec_lines) < (num_lines - LINES + 1)) + lptr++; + else + break; + scrl((int) (lptr - olptr)); + break; + + case KEY_UP: + case 'p': + olptr = lptr; + for (i = 0; i < n; i++) + if (lptr > vec_lines) + lptr--; + else + break; + scrl((int) (lptr - olptr)); + break; + + case 'h': + case KEY_HOME: + lptr = vec_lines; + break; + + case 'e': + case KEY_END: + if (num_lines > LINES) + lptr = vec_lines + num_lines - LINES + 1; + else + lptr = vec_lines; + 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': + done = TRUE; + break; + +#ifdef KEY_RESIZE + case KEY_RESIZE: /* ignore this; ncurses will repaint */ + break; +#endif + case 's': + if (got_number) { + halfdelay(my_delay = n); + } else { + nodelay(stdscr, FALSE); + my_delay = -1; + } + break; + case ' ': + nodelay(stdscr, TRUE); + my_delay = 0; + break; + case ERR: + if (!my_delay) + napms(50); + break; + default: + beep(); + break; + } + if (c >= KEY_MIN || (c > 0 && !isdigit(c))) { + got_number = FALSE; + value = 0; + } + } + + finish(0); /* we're done */ +} + +static RETSIGTYPE +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 RETSIGTYPE +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); + strcpy(temp, ctime(&this_time)); + 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.txt b/test/widechars-utf8.txt new file mode 100644 index 00000000000..43ecd0f7429 --- /dev/null +++ b/test/widechars-utf8.txt @@ -0,0 +1,7 @@ +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. diff --git a/test/worm.c b/test/worm.c new file mode 100644 index 00000000000..98f099cb9cb --- /dev/null +++ b/test/worm.c @@ -0,0 +1,618 @@ +/**************************************************************************** + * Copyright (c) 1998-2007,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 * + * "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. * + ****************************************************************************/ +/* + + @@@ @@@ @@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@ + @@@ @@@ @@@@@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@@@@ + @@@ @@@ @@@@ @@@@ @@@@ @@@@ @@@ @@@@ + @@@ @@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ + @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ + @@@@ @@@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ + @@@@@@@@@@@@ @@@@ @@@@ @@@ @@@ @@@ @@@ + @@@@ @@@@ @@@@@@@@@@@@ @@@ @@@ @@@ @@@ + @@ @@ @@@@@@@@@@ @@@ @@@ @@@ @@@ + + Eric P. Scott + Caltech High Energy Physics + October, 1980 + + Hacks to turn this into a test frame for cursor movement: + Eric S. Raymond + January, 1995 + + July 1995 (esr): worms is now in living color! :-) + +Options: + -f fill screen with copies of 'WORM' at start. + -l set worm length + -n set number of worms + -t make worms leave droppings + -T 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.60 2010/11/13 20:21:21 tom Exp $ +*/ + +#include + +#ifdef USE_PTHREADS +#include +#endif + +WANT_USE_WINDOW(); + +#define MAX_WORMS 40 +#define MAX_LENGTH 1024 + +static chtype flavor[] = +{ + 'O', '*', '#', '$', '%', '0', '@', +}; +static const int xinc[] = +{ + 1, 1, 1, 0, -1, -1, -1, 0 +}, yinc[] = +{ + -1, 0, 1, 1, 1, 0, -1, -1 +}; + +typedef struct worm { + int orientation; + int head; + int *xpos; + int *ypos; + chtype attrs; +#ifdef USE_PTHREADS + pthread_t thread; +#endif +} WORM; + +static unsigned long sequence = 0; +static bool quitting = FALSE; + +static WORM worm[MAX_WORMS]; +static int **refs; +static int last_x, last_y; + +static const char *field; +static int length = 16, number = 3; +static chtype trail = ' '; + +static unsigned pending; +#ifdef TRACE +static int generation, trace_start, trace_end; +#endif /* TRACE */ +/* *INDENT-OFF* */ +static const struct options { + int nopts; + int opts[3]; +} normal[8]={ + { 3, { 7, 0, 1 } }, + { 3, { 0, 1, 2 } }, + { 3, { 1, 2, 3 } }, + { 3, { 2, 3, 4 } }, + { 3, { 3, 4, 5 } }, + { 3, { 4, 5, 6 } }, + { 3, { 5, 6, 7 } }, + { 3, { 6, 7, 0 } } +}, upper[8]={ + { 1, { 1, 0, 0 } }, + { 2, { 1, 2, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 2, { 4, 5, 0 } }, + { 1, { 5, 0, 0 } }, + { 2, { 1, 5, 0 } } +}, left[8]={ + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 2, { 2, 3, 0 } }, + { 1, { 3, 0, 0 } }, + { 2, { 3, 7, 0 } }, + { 1, { 7, 0, 0 } }, + { 2, { 7, 0, 0 } } +}, right[8]={ + { 1, { 7, 0, 0 } }, + { 2, { 3, 7, 0 } }, + { 1, { 3, 0, 0 } }, + { 2, { 3, 4, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 2, { 6, 7, 0 } } +}, lower[8]={ + { 0, { 0, 0, 0 } }, + { 2, { 0, 1, 0 } }, + { 1, { 1, 0, 0 } }, + { 2, { 1, 5, 0 } }, + { 1, { 5, 0, 0 } }, + { 2, { 5, 6, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } } +}, upleft[8]={ + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 1, { 3, 0, 0 } }, + { 2, { 1, 3, 0 } }, + { 1, { 1, 0, 0 } } +}, upright[8]={ + { 2, { 3, 5, 0 } }, + { 1, { 3, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 1, { 5, 0, 0 } } +}, lowleft[8]={ + { 3, { 7, 0, 1 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 1, { 1, 0, 0 } }, + { 2, { 1, 7, 0 } }, + { 1, { 7, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } } +}, lowright[8]={ + { 0, { 0, 0, 0 } }, + { 1, { 7, 0, 0 } }, + { 2, { 5, 7, 0 } }, + { 1, { 5, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } }, + { 0, { 0, 0, 0 } } +}; +/* *INDENT-ON* */ + +static void +cleanup(void) +{ + USING_WINDOW(stdscr, wrefresh); + curs_set(1); + endwin(); +} + +static RETSIGTYPE +onsig(int sig GCC_UNUSED) +{ + cleanup(); + ExitProgram(EXIT_FAILURE); +} + +static double +ranf(void) +{ + long r = (rand() & 077777); + return ((double) r / 32768.); +} + +static int +draw_worm(WINDOW *win, void *data) +{ + WORM *w = (WORM *) data; + const struct options *op; + unsigned mask = (unsigned) (~(1 << (w - worm))); + chtype attrs = w->attrs | ((mask & pending) ? A_REVERSE : 0); + + int x; + int y; + int h; + + bool done = FALSE; + + if ((x = w->xpos[h = w->head]) < 0) { + wmove(win, y = w->ypos[h] = last_y, x = w->xpos[h] = 0); + waddch(win, attrs); + refs[y][x]++; + } else { + y = w->ypos[h]; + } + + if (x > last_x) + x = last_x; + if (y > last_y) + y = last_y; + + if (++h == length) + h = 0; + + if (w->xpos[w->head = h] >= 0) { + int x1, y1; + x1 = w->xpos[h]; + y1 = w->ypos[h]; + if (y1 < LINES + && x1 < COLS + && --refs[y1][x1] == 0) { + wmove(win, y1, x1); + waddch(win, trail); + } + } + + op = &(x == 0 + ? (y == 0 + ? upleft + : (y == last_y + ? lowleft + : left)) + : (x == last_x + ? (y == 0 + ? upright + : (y == last_y + ? lowright + : right)) + : (y == 0 + ? upper + : (y == last_y + ? lower + : normal))))[w->orientation]; + + switch (op->nopts) { + case 0: + done = TRUE; + break; + case 1: + w->orientation = op->opts[0]; + break; + default: + w->orientation = op->opts[(int) (ranf() * (double) op->nopts)]; + break; + } + + if (!done) { + x += xinc[w->orientation]; + y += yinc[w->orientation]; + wmove(win, y, x); + + if (y < 0) + y = 0; + waddch(win, attrs); + + w->ypos[h] = y; + w->xpos[h] = x; + refs[y][x]++; + } + + return done; +} + +#ifdef USE_PTHREADS +static bool +quit_worm(int bitnum) +{ + pending |= (1 << bitnum); + napms(10); /* let the other thread(s) have a chance */ + pending &= ~(1 << bitnum); + return quitting; +} + +static void * +start_worm(void *arg) +{ + unsigned long compare = 0; + Trace(("start_worm")); + while (!quit_worm(((struct worm *) arg) - worm)) { + while (compare < sequence) { + ++compare; +#if HAVE_USE_WINDOW + use_window(stdscr, draw_worm, arg); +#else + draw_worm(stdscr, arg); +#endif + } + } + Trace(("...start_worm (done)")); + return NULL; +} +#endif + +static bool +draw_all_worms(void) +{ + bool done = FALSE; + int n; + struct worm *w; + +#ifdef USE_PTHREADS + static bool first = TRUE; + if (first) { + first = FALSE; + for (n = 0, w = &worm[0]; n < number; n++, w++) { + int rc; + rc = pthread_create(&(w->thread), NULL, start_worm, w); + } + } +#else + for (n = 0, w = &worm[0]; n < number; n++, w++) { + if ( +#if HAVE_USE_WINDOW + USING_WINDOW2(stdscr, draw_worm, w) +#else + draw_worm(stdscr, w) +#endif + ) + done = TRUE; + } +#endif + return done; +} + +static int +get_input(void) +{ + int ch; + ch = USING_WINDOW(stdscr, wgetch); + return ch; +} + +#ifdef KEY_RESIZE +static int +update_refs(WINDOW *win) +{ + int x, y; + + (void) win; + if (last_x != COLS - 1) { + for (y = 0; y <= last_y; y++) { + refs[y] = typeRealloc(int, (size_t) COLS, refs[y]); + for (x = last_x + 1; x < COLS; x++) + refs[y][x] = 0; + } + last_x = COLS - 1; + } + if (last_y != LINES - 1) { + for (y = LINES; y <= last_y; y++) + free(refs[y]); + refs = typeRealloc(int *, (size_t) LINES, refs); + for (y = last_y + 1; y < LINES; y++) { + refs[y] = typeMalloc(int, (size_t) COLS); + for (x = 0; x < COLS; x++) + refs[y][x] = 0; + } + last_y = LINES - 1; + } + return OK; +} +#endif + +int +main(int argc, char *argv[]) +{ + int x, y; + int n; + struct worm *w; + int *ip; + bool done = FALSE; + + setlocale(LC_ALL, ""); + + for (x = 1; x < argc; x++) { + char *p; + p = argv[x]; + if (*p == '-') + p++; + switch (*p) { + case 'f': + field = "WORM"; + break; + case 'l': + if (++x == argc) + goto usage; + if ((length = atoi(argv[x])) < 2 || length > MAX_LENGTH) { + fprintf(stderr, "%s: Invalid length\n", *argv); + ExitProgram(EXIT_FAILURE); + } + break; + case 'n': + if (++x == argc) + goto usage; + if ((number = atoi(argv[x])) < 1 || number > MAX_WORMS) { + fprintf(stderr, "%s: Invalid number of worms\n", *argv); + ExitProgram(EXIT_FAILURE); + } + break; + case 't': + trail = '.'; + break; +#ifdef TRACE + case 'T': + trace_start = atoi(argv[++x]); + trace_end = atoi(argv[++x]); + 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); + } + } + + signal(SIGINT, onsig); + initscr(); + noecho(); + cbreak(); + nonl(); + + curs_set(0); + + last_y = LINES - 1; + last_x = COLS - 1; + +#ifdef A_COLOR + if (has_colors()) { + int bg = COLOR_BLACK; + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + bg = -1; +#endif + +#define SET_COLOR(num, fg) \ + init_pair(num+1, (short) fg, (short) bg); \ + flavor[num] |= COLOR_PAIR(num+1) | A_BOLD + + SET_COLOR(0, COLOR_GREEN); + SET_COLOR(1, COLOR_RED); + SET_COLOR(2, COLOR_CYAN); + SET_COLOR(3, COLOR_WHITE); + SET_COLOR(4, COLOR_MAGENTA); + SET_COLOR(5, COLOR_BLUE); + SET_COLOR(6, COLOR_YELLOW); + } +#endif /* A_COLOR */ + + refs = typeMalloc(int *, (size_t) LINES); + for (y = 0; y < LINES; y++) { + refs[y] = typeMalloc(int, (size_t) COLS); + for (x = 0; x < COLS; x++) { + refs[y][x] = 0; + } + } + +#ifdef BADCORNER + /* if addressing the lower right corner doesn't work in your curses */ + refs[last_y][last_x] = 1; +#endif /* BADCORNER */ + + for (n = number, w = &worm[0]; --n >= 0; w++) { + w->attrs = flavor[(unsigned) n % SIZEOF(flavor)]; + w->orientation = 0; + w->head = 0; + + if (!(ip = typeMalloc(int, (size_t) (length + 1)))) { + fprintf(stderr, "%s: out of memory\n", *argv); + ExitProgram(EXIT_FAILURE); + } + w->xpos = ip; + for (x = length; --x >= 0;) + *ip++ = -1; + if (!(ip = typeMalloc(int, (size_t) (length + 1)))) { + fprintf(stderr, "%s: out of memory\n", *argv); + ExitProgram(EXIT_FAILURE); + } + w->ypos = ip; + for (y = length; --y >= 0;) + *ip++ = -1; + } + if (field) { + const char *p; + p = field; + for (y = last_y; --y >= 0;) { + for (x = COLS; --x >= 0;) { + addch((chtype) (*p++)); + if (!*p) + p = field; + } + } + } + USING_WINDOW(stdscr, 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); + get_input(); + } else if (generation == trace_end) { + trace(0); + get_input(); + } + + generation++; + } +#endif + +#ifdef KEY_RESIZE + if (ch == KEY_RESIZE) { + USING_WINDOW(stdscr, update_refs); + } +#endif + + /* + * Make it simple to put this into single-step mode, or resume + * normal operation -T.Dickey + */ + if (ch == 'q') { + quitting = TRUE; + done = TRUE; + continue; + } else if (ch == 's') { + nodelay(stdscr, FALSE); + } else if (ch == ' ') { + nodelay(stdscr, TRUE); + } + } + + done = draw_all_worms(); + napms(10); + USING_WINDOW(stdscr, wrefresh); + } + + Trace(("Cleanup")); + cleanup(); +#ifdef NO_LEAKS + for (y = 0; y < LINES; y++) { + free(refs[y]); + } + free(refs); + for (n = number, w = &worm[0]; --n >= 0; w++) { + free(w->xpos); + free(w->ypos); + } +#endif +#ifdef USE_PTHREADS + /* + * Do this just in case one of the threads did not really exit. + */ + Trace(("join all threads")); + for (n = 0; n < number; n++) { + pthread_join(worm[n].thread, NULL); + } +#endif + ExitProgram(EXIT_SUCCESS); +} diff --git a/test/xmas.c b/test/xmas.c new file mode 100644 index 00000000000..fc0cc4cbd0e --- /dev/null +++ b/test/xmas.c @@ -0,0 +1,1162 @@ +/******************************************************************************/ +/* asciixmas */ +/* December 1989 Larry Bartz Indianapolis, IN */ +/* */ +/* */ +/* I'm dreaming of an ascii character-based monochrome Christmas, */ +/* Just like the one's I used to know! */ +/* Via a full duplex communications channel, */ +/* At 9600 bits per second, */ +/* Even though it's kinda slow. */ +/* */ +/* I'm dreaming of an ascii character-based monochrome Christmas, */ +/* With ev'ry C program I write! */ +/* May your screen be merry and bright! */ +/* And may all your Christmases be amber or green, */ +/* (for reduced eyestrain and improved visibility)! */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* IMPLEMENTATION */ +/* */ +/* Feel free to modify the defined string FROMWHO to reflect you, your */ +/* organization, your site, whatever. */ +/* */ +/* This really looks a lot better if you can turn off your cursor before */ +/* execution. I wanted to do that here but very few termcap entries or */ +/* terminfo definitions have the appropriate string defined. If you know */ +/* the string(s) for the terminal(s) you use or which your site supports, */ +/* you could call asciixmas from within a shell in which you issue the */ +/* string to the terminal. The cursor is distracting but it doesn't really */ +/* ruin the show. */ +/* */ +/* At our site, we invoke this for our users just after login and the */ +/* determination of terminal type. */ +/* */ +/* */ +/* PORTABILITY */ +/* */ +/* I wrote this using only the very simplest curses functions so that it */ +/* might be the most portable. I was personally able to test on five */ +/* different cpu/UNIX combinations. */ +/* */ +/* */ +/* COMPILE */ +/* */ +/* usually this: */ +/* */ +/* cc -O asciixmas.c -lcurses -o asciixmas -s */ +/* */ +/* */ +/* Zilog S8000 models 11, 21, 31, etc with ZEUS variant of SYSTEM III */ +/* maybe other SYSTEM III also: */ +/* */ +/* cc asciixmas.c -lcurses -ltermlib -o asciixmas -s */ +/* */ +/* as above with optional "peephole optimizer" installed: */ +/* */ +/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */ +/* */ +/* */ +/* Zilog S8000 models 32, 130 with WE32100 chip and SYS V, REL2 */ +/* maybe 3B2 also? */ +/* */ +/* cc -f -O -K sd asciixmas.c -lcurses -o asciixmas -s */ +/* */ +/* */ +/* Pyramid, Sequent, any other "dual universe" types compile and execute */ +/* under either universe. The compile line for the ucb universe (as you */ +/* might expect) is the same as for SYS III UNIX: */ +/* */ +/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */ +/* */ +/* The above compile will also hold true for other BSD systems. (I hope) */ +/* */ +/* */ +/* */ +/* */ +/* For the Scrooges out there among you who don't want this thing to loop */ +/* forever (or until the user hits a key), insert this into your compile */ +/* line just after "cc" : */ +/* */ +/* -DNOLOOP */ +/* */ +/* like so: */ +/* */ +/* cc -DNOLOOP -O asciixmas.c -lcurses -o asciixmas -s */ +/* */ +/* */ +/* */ +/******************************************************************************/ + +/* + * $Id: xmas.c,v 1.27 2010/11/13 20:24:10 tom Exp $ + */ +#include + +#define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)" + +static int my_bg = COLOR_BLACK; +static int y_pos, x_pos; + +static WINDOW *treescrn; +static WINDOW *treescrn2; +static WINDOW *treescrn3; +static WINDOW *treescrn4; +static WINDOW *treescrn5; +static WINDOW *treescrn6; +static WINDOW *treescrn7; +static WINDOW *treescrn8; +static WINDOW *dotdeer0; +static WINDOW *stardeer0; +static WINDOW *lildeer0; +static WINDOW *lildeer1; +static WINDOW *lildeer2; +static WINDOW *lildeer3; +static WINDOW *middeer0; +static WINDOW *middeer1; +static WINDOW *middeer2; +static WINDOW *middeer3; +static WINDOW *bigdeer0; +static WINDOW *bigdeer1; +static WINDOW *bigdeer2; +static WINDOW *bigdeer3; +static WINDOW *bigdeer4; +static WINDOW *lookdeer0; +static WINDOW *lookdeer1; +static WINDOW *lookdeer2; +static WINDOW *lookdeer3; +static WINDOW *lookdeer4; +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 RETSIGTYPE done(int sig) GCC_NORETURN; + +static void +set_color(WINDOW *win, chtype color) +{ + if (has_colors()) { + int n = (int) (color + 1); + if (my_pairs == 0) + my_pairs = typeCalloc(bool, (size_t) (COLORS + 1)); + if (!my_pairs[n]) { + init_pair((short) n, (short) color, (short) my_bg); + my_pairs[n] = TRUE; + } + wattroff(win, A_COLOR); + wattron(win, COLOR_PAIR(n)); + } +} + +static void +unset_color(WINDOW *win) +{ + if (has_colors()) + (void) wattrset(win, COLOR_PAIR(0)); +} + +static void +look_out(int msecs) +{ + napms(msecs); + if (getch() != ERR) { + beep(); + done(0); + } +} + +int +main(int argc GCC_UNUSED, char **argv GCC_UNUSED) +{ + int loopy; + + setlocale(LC_ALL, ""); + + initscr(); + noecho(); + nonl(); + refresh(); + + CATCHALL(done); + + if (has_colors()) { + start_color(); +#if HAVE_USE_DEFAULT_COLORS + if (use_default_colors() == OK) + my_bg = -1; +#endif + } + curs_set(0); + + if ((treescrn = newwin(16, 27, 3, 53)) == 0 || + (treescrn2 = newwin(16, 27, 3, 53)) == 0 || + (treescrn3 = newwin(16, 27, 3, 53)) == 0 || + (treescrn4 = newwin(16, 27, 3, 53)) == 0 || + (treescrn5 = newwin(16, 27, 3, 53)) == 0 || + (treescrn6 = newwin(16, 27, 3, 53)) == 0 || + (treescrn7 = newwin(16, 27, 3, 53)) == 0 || + (treescrn8 = newwin(16, 27, 3, 53)) == 0 || + + (dotdeer0 = newwin(3, 71, 0, 8)) == 0 || + + (stardeer0 = newwin(4, 56, 0, 8)) == 0 || + + (lildeer0 = newwin(7, 53, 0, 8)) == 0 || + (lildeer1 = newwin(2, 4, 0, 0)) == 0 || + (lildeer2 = newwin(2, 4, 0, 0)) == 0 || + (lildeer3 = newwin(2, 4, 0, 0)) == 0 || + + (middeer0 = newwin(15, 42, 0, 8)) == 0 || + (middeer1 = newwin(3, 7, 0, 0)) == 0 || + (middeer2 = newwin(3, 7, 0, 0)) == 0 || + (middeer3 = newwin(3, 7, 0, 0)) == 0 || + + (bigdeer0 = newwin(10, 23, 0, 0)) == 0 || + (bigdeer1 = newwin(10, 23, 0, 0)) == 0 || + (bigdeer2 = newwin(10, 23, 0, 0)) == 0 || + (bigdeer3 = newwin(10, 23, 0, 0)) == 0 || + (bigdeer4 = newwin(10, 23, 0, 0)) == 0 || + + (lookdeer0 = newwin(10, 25, 0, 0)) == 0 || + (lookdeer1 = newwin(10, 25, 0, 0)) == 0 || + (lookdeer2 = newwin(10, 25, 0, 0)) == 0 || + (lookdeer3 = newwin(10, 25, 0, 0)) == 0 || + (lookdeer4 = newwin(10, 25, 0, 0)) == 0 || + + (w_holiday = newwin(1, 26, 3, 27)) == 0 || + + (w_del_msg = newwin(1, 19, 23, 60)) == 0) { + endwin(); + fprintf(stderr, "Cannot create windows - screen too small\n"); + ExitProgram(EXIT_FAILURE); + } + + MvWAddStr(w_del_msg, 0, 0, "Hit any key to quit"); + + MvWAddStr(w_holiday, 0, 0, "H A P P Y H O L I D A Y S"); + + /* set up the windows for our various reindeer */ + + /* lildeer1 */ + MvWAddCh(lildeer1, 0, 0, (chtype) 'V'); + MvWAddCh(lildeer1, 1, 0, (chtype) '@'); + MvWAddCh(lildeer1, 1, 1, (chtype) '<'); + MvWAddCh(lildeer1, 1, 2, (chtype) '>'); + MvWAddCh(lildeer1, 1, 3, (chtype) '~'); + + /* lildeer2 */ + MvWAddCh(lildeer2, 0, 0, (chtype) 'V'); + MvWAddCh(lildeer2, 1, 0, (chtype) '@'); + MvWAddCh(lildeer2, 1, 1, (chtype) '|'); + MvWAddCh(lildeer2, 1, 2, (chtype) '|'); + MvWAddCh(lildeer2, 1, 3, (chtype) '~'); + + /* lildeer3 */ + MvWAddCh(lildeer3, 0, 0, (chtype) 'V'); + MvWAddCh(lildeer3, 1, 0, (chtype) '@'); + MvWAddCh(lildeer3, 1, 1, (chtype) '>'); + MvWAddCh(lildeer3, 1, 2, (chtype) '<'); + MvWAddCh(lildeer2, 1, 3, (chtype) '~'); + + /* middeer1 */ + MvWAddCh(middeer1, 0, 2, (chtype) 'y'); + MvWAddCh(middeer1, 0, 3, (chtype) 'y'); + MvWAddCh(middeer1, 1, 2, (chtype) '0'); + MvWAddCh(middeer1, 1, 3, (chtype) '('); + MvWAddCh(middeer1, 1, 4, (chtype) '='); + MvWAddCh(middeer1, 1, 5, (chtype) ')'); + MvWAddCh(middeer1, 1, 6, (chtype) '~'); + MvWAddCh(middeer1, 2, 3, (chtype) '\\'); + MvWAddCh(middeer1, 2, 4, (chtype) '/'); + + /* middeer2 */ + MvWAddCh(middeer2, 0, 2, (chtype) 'y'); + MvWAddCh(middeer2, 0, 3, (chtype) 'y'); + MvWAddCh(middeer2, 1, 2, (chtype) '0'); + MvWAddCh(middeer2, 1, 3, (chtype) '('); + MvWAddCh(middeer2, 1, 4, (chtype) '='); + MvWAddCh(middeer2, 1, 5, (chtype) ')'); + MvWAddCh(middeer2, 1, 6, (chtype) '~'); + MvWAddCh(middeer2, 2, 3, (chtype) '|'); + MvWAddCh(middeer2, 2, 5, (chtype) '|'); + + /* middeer3 */ + MvWAddCh(middeer3, 0, 2, (chtype) 'y'); + MvWAddCh(middeer3, 0, 3, (chtype) 'y'); + MvWAddCh(middeer3, 1, 2, (chtype) '0'); + MvWAddCh(middeer3, 1, 3, (chtype) '('); + MvWAddCh(middeer3, 1, 4, (chtype) '='); + MvWAddCh(middeer3, 1, 5, (chtype) ')'); + MvWAddCh(middeer3, 1, 6, (chtype) '~'); + MvWAddCh(middeer3, 2, 2, (chtype) '/'); + MvWAddCh(middeer3, 2, 6, (chtype) '\\'); + + /* bigdeer1 */ + MvWAddCh(bigdeer1, 0, 17, (chtype) '\\'); + MvWAddCh(bigdeer1, 0, 18, (chtype) '/'); + MvWAddCh(bigdeer1, 0, 20, (chtype) '\\'); + MvWAddCh(bigdeer1, 0, 21, (chtype) '/'); + MvWAddCh(bigdeer1, 1, 18, (chtype) '\\'); + MvWAddCh(bigdeer1, 1, 20, (chtype) '/'); + MvWAddCh(bigdeer1, 2, 19, (chtype) '|'); + MvWAddCh(bigdeer1, 2, 20, (chtype) '_'); + MvWAddCh(bigdeer1, 3, 18, (chtype) '/'); + MvWAddCh(bigdeer1, 3, 19, (chtype) '^'); + MvWAddCh(bigdeer1, 3, 20, (chtype) '0'); + MvWAddCh(bigdeer1, 3, 21, (chtype) '\\'); + MvWAddCh(bigdeer1, 4, 17, (chtype) '/'); + MvWAddCh(bigdeer1, 4, 18, (chtype) '/'); + MvWAddCh(bigdeer1, 4, 19, (chtype) '\\'); + MvWAddCh(bigdeer1, 4, 22, (chtype) '\\'); + MvWAddStr(bigdeer1, 5, 7, "^~~~~~~~~// ~~U"); + MvWAddStr(bigdeer1, 6, 7, "( \\_____( /"); + MvWAddStr(bigdeer1, 7, 8, "( ) /"); + MvWAddStr(bigdeer1, 8, 9, "\\\\ /"); + MvWAddStr(bigdeer1, 9, 11, "\\>/>"); + + /* bigdeer2 */ + MvWAddCh(bigdeer2, 0, 17, (chtype) '\\'); + MvWAddCh(bigdeer2, 0, 18, (chtype) '/'); + MvWAddCh(bigdeer2, 0, 20, (chtype) '\\'); + MvWAddCh(bigdeer2, 0, 21, (chtype) '/'); + MvWAddCh(bigdeer2, 1, 18, (chtype) '\\'); + MvWAddCh(bigdeer2, 1, 20, (chtype) '/'); + MvWAddCh(bigdeer2, 2, 19, (chtype) '|'); + MvWAddCh(bigdeer2, 2, 20, (chtype) '_'); + MvWAddCh(bigdeer2, 3, 18, (chtype) '/'); + MvWAddCh(bigdeer2, 3, 19, (chtype) '^'); + MvWAddCh(bigdeer2, 3, 20, (chtype) '0'); + MvWAddCh(bigdeer2, 3, 21, (chtype) '\\'); + MvWAddCh(bigdeer2, 4, 17, (chtype) '/'); + MvWAddCh(bigdeer2, 4, 18, (chtype) '/'); + MvWAddCh(bigdeer2, 4, 19, (chtype) '\\'); + MvWAddCh(bigdeer2, 4, 22, (chtype) '\\'); + MvWAddStr(bigdeer2, 5, 7, "^~~~~~~~~// ~~U"); + MvWAddStr(bigdeer2, 6, 7, "(( )____( /"); + MvWAddStr(bigdeer2, 7, 7, "( / |"); + MvWAddStr(bigdeer2, 8, 8, "\\/ |"); + MvWAddStr(bigdeer2, 9, 9, "|> |>"); + + /* bigdeer3 */ + MvWAddCh(bigdeer3, 0, 17, (chtype) '\\'); + MvWAddCh(bigdeer3, 0, 18, (chtype) '/'); + MvWAddCh(bigdeer3, 0, 20, (chtype) '\\'); + MvWAddCh(bigdeer3, 0, 21, (chtype) '/'); + MvWAddCh(bigdeer3, 1, 18, (chtype) '\\'); + MvWAddCh(bigdeer3, 1, 20, (chtype) '/'); + MvWAddCh(bigdeer3, 2, 19, (chtype) '|'); + MvWAddCh(bigdeer3, 2, 20, (chtype) '_'); + MvWAddCh(bigdeer3, 3, 18, (chtype) '/'); + MvWAddCh(bigdeer3, 3, 19, (chtype) '^'); + MvWAddCh(bigdeer3, 3, 20, (chtype) '0'); + MvWAddCh(bigdeer3, 3, 21, (chtype) '\\'); + MvWAddCh(bigdeer3, 4, 17, (chtype) '/'); + MvWAddCh(bigdeer3, 4, 18, (chtype) '/'); + MvWAddCh(bigdeer3, 4, 19, (chtype) '\\'); + MvWAddCh(bigdeer3, 4, 22, (chtype) '\\'); + MvWAddStr(bigdeer3, 5, 7, "^~~~~~~~~// ~~U"); + MvWAddStr(bigdeer3, 6, 6, "( ()_____( /"); + MvWAddStr(bigdeer3, 7, 6, "/ / /"); + MvWAddStr(bigdeer3, 8, 5, "|/ \\"); + MvWAddStr(bigdeer3, 9, 5, "/> \\>"); + + /* bigdeer4 */ + MvWAddCh(bigdeer4, 0, 17, (chtype) '\\'); + MvWAddCh(bigdeer4, 0, 18, (chtype) '/'); + MvWAddCh(bigdeer4, 0, 20, (chtype) '\\'); + MvWAddCh(bigdeer4, 0, 21, (chtype) '/'); + MvWAddCh(bigdeer4, 1, 18, (chtype) '\\'); + MvWAddCh(bigdeer4, 1, 20, (chtype) '/'); + MvWAddCh(bigdeer4, 2, 19, (chtype) '|'); + MvWAddCh(bigdeer4, 2, 20, (chtype) '_'); + MvWAddCh(bigdeer4, 3, 18, (chtype) '/'); + MvWAddCh(bigdeer4, 3, 19, (chtype) '^'); + MvWAddCh(bigdeer4, 3, 20, (chtype) '0'); + MvWAddCh(bigdeer4, 3, 21, (chtype) '\\'); + MvWAddCh(bigdeer4, 4, 17, (chtype) '/'); + MvWAddCh(bigdeer4, 4, 18, (chtype) '/'); + MvWAddCh(bigdeer4, 4, 19, (chtype) '\\'); + MvWAddCh(bigdeer4, 4, 22, (chtype) '\\'); + MvWAddStr(bigdeer4, 5, 7, "^~~~~~~~~// ~~U"); + MvWAddStr(bigdeer4, 6, 6, "( )______( /"); + MvWAddStr(bigdeer4, 7, 5, "(/ \\"); + MvWAddStr(bigdeer4, 8, 0, "v___= ----^"); + + /* lookdeer1 */ + MvWAddStr(lookdeer1, 0, 16, "\\/ \\/"); + MvWAddStr(lookdeer1, 1, 17, "\\Y/ \\Y/"); + MvWAddStr(lookdeer1, 2, 19, "\\=/"); + MvWAddStr(lookdeer1, 3, 17, "^\\o o/^"); + MvWAddStr(lookdeer1, 4, 17, "//( )"); + MvWAddStr(lookdeer1, 5, 7, "^~~~~~~~~// \\O/"); + MvWAddStr(lookdeer1, 6, 7, "( \\_____( /"); + MvWAddStr(lookdeer1, 7, 8, "( ) /"); + MvWAddStr(lookdeer1, 8, 9, "\\\\ /"); + MvWAddStr(lookdeer1, 9, 11, "\\>/>"); + + /* lookdeer2 */ + MvWAddStr(lookdeer2, 0, 16, "\\/ \\/"); + MvWAddStr(lookdeer2, 1, 17, "\\Y/ \\Y/"); + MvWAddStr(lookdeer2, 2, 19, "\\=/"); + MvWAddStr(lookdeer2, 3, 17, "^\\o o/^"); + MvWAddStr(lookdeer2, 4, 17, "//( )"); + MvWAddStr(lookdeer2, 5, 7, "^~~~~~~~~// \\O/"); + MvWAddStr(lookdeer2, 6, 7, "(( )____( /"); + MvWAddStr(lookdeer2, 7, 7, "( / |"); + MvWAddStr(lookdeer2, 8, 8, "\\/ |"); + MvWAddStr(lookdeer2, 9, 9, "|> |>"); + + /* lookdeer3 */ + MvWAddStr(lookdeer3, 0, 16, "\\/ \\/"); + MvWAddStr(lookdeer3, 1, 17, "\\Y/ \\Y/"); + MvWAddStr(lookdeer3, 2, 19, "\\=/"); + MvWAddStr(lookdeer3, 3, 17, "^\\o o/^"); + MvWAddStr(lookdeer3, 4, 17, "//( )"); + MvWAddStr(lookdeer3, 5, 7, "^~~~~~~~~// \\O/"); + MvWAddStr(lookdeer3, 6, 6, "( ()_____( /"); + MvWAddStr(lookdeer3, 7, 6, "/ / /"); + MvWAddStr(lookdeer3, 8, 5, "|/ \\"); + MvWAddStr(lookdeer3, 9, 5, "/> \\>"); + + /* lookdeer4 */ + MvWAddStr(lookdeer4, 0, 16, "\\/ \\/"); + MvWAddStr(lookdeer4, 1, 17, "\\Y/ \\Y/"); + MvWAddStr(lookdeer4, 2, 19, "\\=/"); + MvWAddStr(lookdeer4, 3, 17, "^\\o o/^"); + MvWAddStr(lookdeer4, 4, 17, "//( )"); + MvWAddStr(lookdeer4, 5, 7, "^~~~~~~~~// \\O/"); + MvWAddStr(lookdeer4, 6, 6, "( )______( /"); + MvWAddStr(lookdeer4, 7, 5, "(/ \\"); + MvWAddStr(lookdeer4, 8, 0, "v___= ----^"); + + /***********************************************/ + cbreak(); + nodelay(stdscr, TRUE); + for (;;) { + clear(); + werase(treescrn); + touchwin(w_del_msg); + touchwin(treescrn); + werase(treescrn2); + touchwin(treescrn2); + werase(treescrn8); + touchwin(treescrn8); + refresh(); + look_out(150); + boxit(); + refresh(); + look_out(150); + seas(); + refresh(); + look_out(150); + greet(); + refresh(); + look_out(150); + fromwho(); + refresh(); + look_out(150); + tree(); + look_out(150); + balls(); + look_out(150); + star(); + look_out(150); + strng1(); + strng2(); + strng3(); + strng4(); + strng5(); + + /* set up the windows for our blinking trees */ + /* **************************************** */ + /* treescrn3 */ + + overlay(treescrn, treescrn3); + + /*balls */ + MvWAddCh(treescrn3, 4, 18, ' '); + MvWAddCh(treescrn3, 7, 6, ' '); + MvWAddCh(treescrn3, 8, 19, ' '); + MvWAddCh(treescrn3, 11, 22, ' '); + + /*star */ + MvWAddCh(treescrn3, 0, 12, '*'); + + /*strng1 */ + MvWAddCh(treescrn3, 3, 11, ' '); + + /*strng2 */ + MvWAddCh(treescrn3, 5, 13, ' '); + MvWAddCh(treescrn3, 6, 10, ' '); + + /*strng3 */ + MvWAddCh(treescrn3, 7, 16, ' '); + MvWAddCh(treescrn3, 7, 14, ' '); + + /*strng4 */ + MvWAddCh(treescrn3, 10, 13, ' '); + MvWAddCh(treescrn3, 10, 10, ' '); + MvWAddCh(treescrn3, 11, 8, ' '); + + /*strng5 */ + MvWAddCh(treescrn3, 11, 18, ' '); + MvWAddCh(treescrn3, 12, 13, ' '); + + /* treescrn4 */ + + overlay(treescrn, treescrn4); + + /*balls */ + MvWAddCh(treescrn4, 3, 9, ' '); + MvWAddCh(treescrn4, 4, 16, ' '); + MvWAddCh(treescrn4, 7, 6, ' '); + MvWAddCh(treescrn4, 8, 19, ' '); + MvWAddCh(treescrn4, 11, 2, ' '); + MvWAddCh(treescrn4, 12, 23, ' '); + + /*star */ + (void) wstandout(treescrn4); + MvWAddCh(treescrn4, 0, 12, '*'); + (void) wstandend(treescrn4); + + /*strng1 */ + MvWAddCh(treescrn4, 3, 13, ' '); + + /*strng2 */ + + /*strng3 */ + MvWAddCh(treescrn4, 7, 15, ' '); + MvWAddCh(treescrn4, 8, 11, ' '); + + /*strng4 */ + MvWAddCh(treescrn4, 9, 16, ' '); + MvWAddCh(treescrn4, 10, 12, ' '); + MvWAddCh(treescrn4, 11, 8, ' '); + + /*strng5 */ + MvWAddCh(treescrn4, 11, 18, ' '); + MvWAddCh(treescrn4, 12, 14, ' '); + + /* treescrn5 */ + + overlay(treescrn, treescrn5); + + /*balls */ + MvWAddCh(treescrn5, 3, 15, ' '); + MvWAddCh(treescrn5, 10, 20, ' '); + MvWAddCh(treescrn5, 12, 1, ' '); + + /*star */ + MvWAddCh(treescrn5, 0, 12, '*'); + + /*strng1 */ + MvWAddCh(treescrn5, 3, 11, ' '); + + /*strng2 */ + MvWAddCh(treescrn5, 5, 12, ' '); + + /*strng3 */ + MvWAddCh(treescrn5, 7, 14, ' '); + MvWAddCh(treescrn5, 8, 10, ' '); + + /*strng4 */ + MvWAddCh(treescrn5, 9, 15, ' '); + MvWAddCh(treescrn5, 10, 11, ' '); + MvWAddCh(treescrn5, 11, 7, ' '); + + /*strng5 */ + MvWAddCh(treescrn5, 11, 17, ' '); + MvWAddCh(treescrn5, 12, 13, ' '); + + /* treescrn6 */ + + overlay(treescrn, treescrn6); + + /*balls */ + MvWAddCh(treescrn6, 6, 7, ' '); + MvWAddCh(treescrn6, 7, 18, ' '); + MvWAddCh(treescrn6, 10, 4, ' '); + MvWAddCh(treescrn6, 11, 23, ' '); + + /*star */ + (void) wstandout(treescrn6); + MvWAddCh(treescrn6, 0, 12, '*'); + (void) wstandend(treescrn6); + + /*strng1 */ + + /*strng2 */ + MvWAddCh(treescrn6, 5, 11, ' '); + + /*strng3 */ + MvWAddCh(treescrn6, 7, 13, ' '); + MvWAddCh(treescrn6, 8, 9, ' '); + + /*strng4 */ + MvWAddCh(treescrn6, 9, 14, ' '); + MvWAddCh(treescrn6, 10, 10, ' '); + MvWAddCh(treescrn6, 11, 6, ' '); + + /*strng5 */ + MvWAddCh(treescrn6, 11, 16, ' '); + MvWAddCh(treescrn6, 12, 12, ' '); + + /* treescrn7 */ + + overlay(treescrn, treescrn7); + + /*balls */ + MvWAddCh(treescrn7, 3, 15, ' '); + MvWAddCh(treescrn7, 6, 7, ' '); + MvWAddCh(treescrn7, 7, 18, ' '); + MvWAddCh(treescrn7, 10, 4, ' '); + MvWAddCh(treescrn7, 11, 22, ' '); + + /*star */ + MvWAddCh(treescrn7, 0, 12, '*'); + + /*strng1 */ + MvWAddCh(treescrn7, 3, 12, ' '); + + /*strng2 */ + MvWAddCh(treescrn7, 5, 13, ' '); + MvWAddCh(treescrn7, 6, 9, ' '); + + /*strng3 */ + MvWAddCh(treescrn7, 7, 15, ' '); + MvWAddCh(treescrn7, 8, 11, ' '); + + /*strng4 */ + MvWAddCh(treescrn7, 9, 16, ' '); + MvWAddCh(treescrn7, 10, 12, ' '); + MvWAddCh(treescrn7, 11, 8, ' '); + + /*strng5 */ + MvWAddCh(treescrn7, 11, 18, ' '); + MvWAddCh(treescrn7, 12, 14, ' '); + + look_out(150); + reindeer(); + + touchwin(w_holiday); + wrefresh(w_holiday); + wrefresh(w_del_msg); + + look_out(500); + 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 RETSIGTYPE +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); +} diff --git a/test/xterm-16color.dat b/test/xterm-16color.dat new file mode 100644 index 00000000000..6d47d93cb75 --- /dev/null +++ b/test/xterm-16color.dat @@ -0,0 +1,53 @@ +############################################################################## +# Copyright (c) 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"), # +# 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: xterm-16color.dat,v 1.2 2006/04/22 21:40:00 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 +# manipulate the colors shown in the screen. The 'd' screen is limited to +# 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. +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 +5: 205 0 205 magenta3 +6: 0 205 205 cyan3 +7: 229 229 229 gray90 +8: 127 127 127 gray50 +9: 255 0 0 red +10: 0 255 0 green +11: 255 255 0 yellow +12: 99 184 255 SteelBlue1 +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 new file mode 100644 index 00000000000..3dcaabdf28b --- /dev/null +++ b/test/xterm-256color.dat @@ -0,0 +1,293 @@ +############################################################################## +# Copyright (c) 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 "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: xterm-256color.dat,v 1.1 2009/10/30 22:33:40 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 +# manipulate the colors shown in the screen. The 'd' screen is limited to +# 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. +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 +5: 205 0 205 magenta3 +6: 0 205 205 cyan3 +7: 229 229 229 gray90 +8: 127 127 127 gray50 +9: 255 0 0 red +10: 0 255 0 green +11: 255 255 0 yellow +12: 99 184 255 SteelBlue1 +13: 255 0 255 magenta +14: 0 255 255 cyan +15: 255 255 255 white +16: 0 0 0 +17: 0 0 95 +18: 0 0 135 +19: 0 0 175 +20: 0 0 215 +21: 0 0 255 +22: 0 95 0 +23: 0 95 95 +24: 0 95 135 +25: 0 95 175 +26: 0 95 215 +27: 0 95 255 +28: 0 135 0 +29: 0 135 95 +30: 0 135 135 +31: 0 135 175 +32: 0 135 215 +33: 0 135 255 +34: 0 175 0 +35: 0 175 95 +36: 0 175 135 +37: 0 175 175 +38: 0 175 215 +39: 0 175 255 +40: 0 215 0 +41: 0 215 95 +42: 0 215 135 +43: 0 215 175 +44: 0 215 215 +45: 0 215 255 +46: 0 255 0 +47: 0 255 95 +48: 0 255 135 +49: 0 255 175 +50: 0 255 215 +51: 0 255 255 +52: 95 0 0 +53: 95 0 95 +54: 95 0 135 +55: 95 0 175 +56: 95 0 215 +57: 95 0 255 +58: 95 95 0 +59: 95 95 95 +60: 95 95 135 +61: 95 95 175 +62: 95 95 215 +63: 95 95 255 +64: 95 135 0 +65: 95 135 95 +66: 95 135 135 +67: 95 135 175 +68: 95 135 215 +69: 95 135 255 +70: 95 175 0 +71: 95 175 95 +72: 95 175 135 +73: 95 175 175 +74: 95 175 215 +75: 95 175 255 +76: 95 215 0 +77: 95 215 95 +78: 95 215 135 +79: 95 215 175 +80: 95 215 215 +81: 95 215 255 +82: 95 255 0 +83: 95 255 95 +84: 95 255 135 +85: 95 255 175 +86: 95 255 215 +87: 95 255 255 +88: 135 0 0 +89: 135 0 95 +90: 135 0 135 +91: 135 0 175 +92: 135 0 215 +93: 135 0 255 +94: 135 95 0 +95: 135 95 95 +96: 135 95 135 +97: 135 95 175 +98: 135 95 215 +99: 135 95 255 +100: 135 135 0 +101: 135 135 95 +102: 135 135 135 +103: 135 135 175 +104: 135 135 215 +105: 135 135 255 +106: 135 175 0 +107: 135 175 95 +108: 135 175 135 +109: 135 175 175 +110: 135 175 215 +111: 135 175 255 +112: 135 215 0 +113: 135 215 95 +114: 135 215 135 +115: 135 215 175 +116: 135 215 215 +117: 135 215 255 +118: 135 255 0 +119: 135 255 95 +120: 135 255 135 +121: 135 255 175 +122: 135 255 215 +123: 135 255 255 +124: 175 0 0 +125: 175 0 95 +126: 175 0 135 +127: 175 0 175 +128: 175 0 215 +129: 175 0 255 +130: 175 95 0 +131: 175 95 95 +132: 175 95 135 +133: 175 95 175 +134: 175 95 215 +135: 175 95 255 +136: 175 135 0 +137: 175 135 95 +138: 175 135 135 +139: 175 135 175 +140: 175 135 215 +141: 175 135 255 +142: 175 175 0 +143: 175 175 95 +144: 175 175 135 +145: 175 175 175 +146: 175 175 215 +147: 175 175 255 +148: 175 215 0 +149: 175 215 95 +150: 175 215 135 +151: 175 215 175 +152: 175 215 215 +153: 175 215 255 +154: 175 255 0 +155: 175 255 95 +156: 175 255 135 +157: 175 255 175 +158: 175 255 215 +159: 175 255 255 +160: 215 0 0 +161: 215 0 95 +162: 215 0 135 +163: 215 0 175 +164: 215 0 215 +165: 215 0 255 +166: 215 95 0 +167: 215 95 95 +168: 215 95 135 +169: 215 95 175 +170: 215 95 215 +171: 215 95 255 +172: 215 135 0 +173: 215 135 95 +174: 215 135 135 +175: 215 135 175 +176: 215 135 215 +177: 215 135 255 +178: 215 175 0 +179: 215 175 95 +180: 215 175 135 +181: 215 175 175 +182: 215 175 215 +183: 215 175 255 +184: 215 215 0 +185: 215 215 95 +186: 215 215 135 +187: 215 215 175 +188: 215 215 215 +189: 215 215 255 +190: 215 255 0 +191: 215 255 95 +192: 215 255 135 +193: 215 255 175 +194: 215 255 215 +195: 215 255 255 +196: 255 0 0 +197: 255 0 95 +198: 255 0 135 +199: 255 0 175 +200: 255 0 215 +201: 255 0 255 +202: 255 95 0 +203: 255 95 95 +204: 255 95 135 +205: 255 95 175 +206: 255 95 215 +207: 255 95 255 +208: 255 135 0 +209: 255 135 95 +210: 255 135 135 +211: 255 135 175 +212: 255 135 215 +213: 255 135 255 +214: 255 175 0 +215: 255 175 95 +216: 255 175 135 +217: 255 175 175 +218: 255 175 215 +219: 255 175 255 +220: 255 215 0 +221: 255 215 95 +222: 255 215 135 +223: 255 215 175 +224: 255 215 215 +225: 255 215 255 +226: 255 255 0 +227: 255 255 95 +228: 255 255 135 +229: 255 255 175 +230: 255 255 215 +231: 255 255 255 +232: 8 8 8 +233: 18 18 18 +234: 28 28 28 +235: 38 38 38 +236: 48 48 48 +237: 58 58 58 +238: 68 68 68 +239: 78 78 78 +240: 88 88 88 +241: 98 98 98 +242: 108 108 108 +243: 118 118 118 +244: 128 128 128 +245: 138 138 138 +246: 148 148 148 +247: 158 158 158 +248: 168 168 168 +249: 178 178 178 +250: 188 188 188 +251: 198 198 198 +252: 208 208 208 +253: 218 218 218 +254: 228 228 228 +255: 238 238 238 diff --git a/test/xterm-88color.dat b/test/xterm-88color.dat new file mode 100644 index 00000000000..95a753cdcec --- /dev/null +++ b/test/xterm-88color.dat @@ -0,0 +1,125 @@ +############################################################################## +# Copyright (c) 2005-2006,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 "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: xterm-88color.dat,v 1.3 2009/10/30 22:33:56 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 +# manipulate the colors shown in the screen. The 'd' screen is limited to +# 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. +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 +5: 205 0 205 magenta3 +6: 0 205 205 cyan3 +7: 229 229 229 gray90 +8: 127 127 127 gray50 +9: 255 0 0 red +10: 0 255 0 green +11: 255 255 0 yellow +12: 99 184 255 SteelBlue1 +13: 255 0 255 magenta +14: 0 255 255 cyan +15: 255 255 255 white +16: 0 0 0 +17: 0 0 139 +18: 0 0 205 +19: 0 0 255 +20: 0 139 0 +21: 0 139 139 +22: 0 139 205 +23: 0 139 255 +24: 0 205 0 +25: 0 205 139 +26: 0 205 205 +27: 0 205 255 +28: 0 255 0 +29: 0 255 139 +30: 0 255 205 +31: 0 255 255 +32: 139 0 0 +33: 139 0 139 +34: 139 0 205 +35: 139 0 255 +36: 139 139 0 +37: 139 139 139 +38: 139 139 205 +39: 139 139 255 +40: 139 205 0 +41: 139 205 139 +42: 139 205 205 +43: 139 205 255 +44: 139 255 0 +45: 139 255 139 +46: 139 255 205 +47: 139 255 255 +48: 205 0 0 +49: 205 0 139 +50: 205 0 205 +51: 205 0 255 +52: 205 139 0 +53: 205 139 139 +54: 205 139 205 +55: 205 139 255 +56: 205 205 0 +57: 205 205 139 +58: 205 205 205 +59: 205 205 255 +60: 205 255 0 +61: 205 255 139 +62: 205 255 205 +63: 205 255 255 +64: 255 0 0 +65: 255 0 139 +66: 255 0 205 +67: 255 0 255 +68: 255 139 0 +69: 255 139 139 +70: 255 139 205 +71: 255 139 255 +72: 255 205 0 +73: 255 205 139 +74: 255 205 205 +75: 255 205 255 +76: 255 255 0 +77: 255 255 139 +78: 255 255 205 +79: 255 255 255 +80: 46 46 46 +81: 92 92 92 +82: 113 113 113 +83: 139 139 139 +84: 162 162 162 +85: 185 185 185 +86: 208 208 208 +87: 231 231 231 From e07762606a5bf651a501cb095c98cba90e4a8fe2 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 30 Apr 2011 10:59:17 +0000 Subject: [PATCH 2/4] Import ncurses 5.9. --- ANNOUNCE | 483 +-- Ada95/aclocal.m4 | 177 +- Ada95/configure | 2519 +++++++++------- Ada95/configure.in | 72 +- Ada95/doc/Makefile.in | 81 + Ada95/gen/Makefile.in | 10 +- Ada95/gen/gen.c | 57 +- .../gen/terminal_interface-curses-aux.ads.m4 | 6 +- ..._interface-curses-forms-field_types.ads.m4 | 22 +- .../terminal_interface-curses-mouse.ads.m4 | 14 +- Ada95/gen/terminal_interface-curses.adb.m4 | 14 +- Ada95/gen/terminal_interface-curses.ads.m4 | 30 +- Ada95/include/Makefile.in | 6 +- Ada95/make-tar.sh | 81 +- Ada95/package/AdaCurses-doc.spec | 48 + Ada95/package/AdaCurses.spec | 78 + Ada95/package/debian/compat | 1 + Ada95/package/debian/control | 17 + Ada95/package/debian/copyright | 69 + Ada95/package/debian/docs | 1 + Ada95/package/debian/rules | 97 + Ada95/package/debian/source/format | 1 + Ada95/package/debian/watch | 4 + Ada95/samples/Makefile.in | 42 +- Ada95/samples/explain.txt | 30 +- Ada95/samples/ncurses2-acs_and_scroll.adb | 128 +- Ada95/samples/ncurses2-demo_forms.adb | 32 +- Ada95/samples/ncurses2-demo_pad.adb | 10 +- Ada95/samples/ncurses2-demo_panels.adb | 8 +- Ada95/samples/ncurses2-getopt.adb | 10 +- Ada95/samples/ncurses2-menu_test.adb | 16 +- Ada95/samples/ncurses2-overlap_test.adb | 8 +- Ada95/samples/ncurses2-slk_test.adb | 8 +- Ada95/samples/ncurses2-trace_set.adb | 14 +- Ada95/samples/sample-curses_demo.adb | 12 +- Ada95/samples/sample-explanation.adb | 78 +- Ada95/samples/sample-form_demo-aux.ads | 6 +- Ada95/samples/sample-form_demo.adb | 16 +- Ada95/samples/sample-function_key_setting.adb | 30 +- Ada95/samples/sample-function_key_setting.ads | 6 +- Ada95/samples/sample-header_handler.adb | 10 +- Ada95/samples/sample-helpers.adb | 8 +- Ada95/samples/sample-helpers.ads | 6 +- Ada95/samples/sample-keyboard_handler.adb | 14 +- Ada95/samples/sample-menu_demo-aux.ads | 6 +- Ada95/samples/sample-menu_demo.adb | 14 +- Ada95/samples/sample-text_io_demo.adb | 24 +- Ada95/samples/sample.adb | 10 +- Ada95/src/Makefile.in | 51 +- Ada95/src/c_varargs_to_ada.c | 117 + Ada95/src/c_varargs_to_ada.h | 73 + Ada95/src/library.gpr | 7 +- Ada95/src/ncurses_compat.c | 135 + ...terface-curses-forms-field_types-alpha.adb | 12 +- ...-curses-forms-field_types-alphanumeric.adb | 12 +- ...rses-forms-field_types-enumeration-ada.adb | 10 +- ...e-curses-forms-field_types-enumeration.adb | 18 +- ...face-curses-forms-field_types-intfield.adb | 12 +- ...-curses-forms-field_types-ipv4_address.adb | 14 +- ...rface-curses-forms-field_types-numeric.adb | 12 +- ...erface-curses-forms-field_types-regexp.adb | 10 +- ...e-curses-forms-field_types-user-choice.adb | 26 +- ...e-curses-forms-field_types-user-choice.ads | 14 +- ...nterface-curses-forms-field_types-user.adb | 30 +- ...nterface-curses-forms-field_types-user.ads | 14 +- ...nal_interface-curses-forms-field_types.adb | 113 +- Ada95/src/terminal_interface-curses-forms.adb | 22 +- Ada95/src/terminal_interface-curses-menus.adb | 18 +- .../src/terminal_interface-curses-text_io.adb | 7 +- .../src/terminal_interface-curses-trace.adb_p | 4 +- INSTALL | 29 +- MANIFEST | 21 + NEWS | 90 +- TO-DO | 20 +- aclocal.m4 | 154 +- announce.html.in | 714 +---- configure | 1384 +++++---- configure.in | 27 +- dist.mk | 6 +- doc/html/ada/funcs/A.htm | 28 +- doc/html/ada/funcs/B.htm | 16 +- doc/html/ada/funcs/C.htm | 50 +- doc/html/ada/funcs/D.htm | 46 +- doc/html/ada/funcs/E.htm | 14 +- doc/html/ada/funcs/F.htm | 26 +- doc/html/ada/funcs/G.htm | 96 +- doc/html/ada/funcs/H.htm | 14 +- doc/html/ada/funcs/I.htm | 40 +- doc/html/ada/funcs/K.htm | 6 +- doc/html/ada/funcs/L.htm | 10 +- doc/html/ada/funcs/M.htm | 12 +- doc/html/ada/funcs/N.htm | 12 +- doc/html/ada/funcs/O.htm | 8 +- doc/html/ada/funcs/P.htm | 30 +- doc/html/ada/funcs/R.htm | 38 +- doc/html/ada/funcs/S.htm | 186 +- doc/html/ada/funcs/T.htm | 22 +- doc/html/ada/funcs/U.htm | 20 +- doc/html/ada/funcs/V.htm | 6 +- doc/html/ada/funcs/W.htm | 6 +- .../terminal_interface-curses-aux__adb.htm | 28 +- .../terminal_interface-curses-aux__ads.htm | 14 +- ...ce-curses-forms-field_types-alpha__adb.htm | 24 +- ...es-forms-field_types-alphanumeric__adb.htm | 24 +- ...forms-field_types-enumeration-ada__adb.htm | 14 +- ...forms-field_types-enumeration-ada__ads.htm | 2 +- ...ses-forms-field_types-enumeration__adb.htm | 42 +- ...curses-forms-field_types-intfield__adb.htm | 32 +- ...es-forms-field_types-ipv4_address__adb.htm | 22 +- ...-curses-forms-field_types-numeric__adb.htm | 32 +- ...e-curses-forms-field_types-regexp__adb.htm | 28 +- ...ses-forms-field_types-user-choice__adb.htm | 68 +- ...ses-forms-field_types-user-choice__ads.htm | 20 +- ...ace-curses-forms-field_types-user__adb.htm | 48 +- ...ace-curses-forms-field_types-user__ads.htm | 18 +- ...nterface-curses-forms-field_types__adb.htm | 241 +- ...nterface-curses-forms-field_types__ads.htm | 50 +- .../terminal_interface-curses-forms__adb.htm | 676 ++--- .../terminal_interface-curses-forms__ads.htm | 638 ++-- .../terminal_interface-curses-menus__adb.htm | 672 ++--- .../terminal_interface-curses-menus__ads.htm | 376 +-- .../terminal_interface-curses-mouse__adb.htm | 174 +- .../terminal_interface-curses-mouse__ads.htm | 212 +- .../terminal_interface-curses-putwin__adb.htm | 4 +- ...terminal_interface-curses-termcap__adb.htm | 2 +- ...erminal_interface-curses-terminfo__adb.htm | 6 +- ...inal_interface-curses-text_io-aux__adb.htm | 4 +- ...terminal_interface-curses-text_io__adb.htm | 117 +- ...terminal_interface-curses-text_io__ads.htm | 28 +- .../terminal_interface-curses-trace__adb.htm | 41 +- .../terminal_interface-curses-trace__ads.htm | 68 +- .../ada/terminal_interface-curses__adb.htm | 2168 +++++++------- .../ada/terminal_interface-curses__ads.htm | 1284 ++++---- doc/html/announce.html | 718 +---- doc/html/man/adacurses-config.1.html | 16 +- doc/html/man/captoinfo.1m.html | 2 +- doc/html/man/clear.1.html | 2 +- doc/html/man/form.3x.html | 2 +- doc/html/man/infocmp.1m.html | 2 +- doc/html/man/infotocap.1m.html | 2 +- doc/html/man/menu.3x.html | 2 +- doc/html/man/ncurses.3x.html | 2 +- doc/html/man/ncurses5-config.1.html | 2 +- doc/html/man/panel.3x.html | 2 +- doc/html/man/tabs.1.html | 2 +- doc/html/man/terminfo.5.html | 2 +- doc/html/man/tic.1m.html | 2 +- doc/html/man/toe.1m.html | 2 +- doc/html/man/tput.1.html | 2 +- doc/html/man/tset.1.html | 2 +- include/ncurses_defs | 7 +- man/MKada_config.in | 17 +- misc/ncurses-config.in | 10 +- ncurses/base/lib_newwin.c | 6 +- ncurses/base/lib_slk.c | 16 +- ncurses/widechar/lib_add_wch.c | 6 +- test/aclocal.m4 | 41 +- test/configure | 2593 +++++++++-------- test/configure.in | 3 +- test/make-tar.sh | 68 +- test/package/debian/compat | 1 + test/package/debian/control | 16 + test/package/debian/copyright | 69 + test/package/debian/docs | 1 + test/package/debian/rules | 90 + test/package/debian/source/format | 1 + test/package/debian/watch | 4 + test/package/ncurses-examples.spec | 55 + test/tclock.c | 12 +- test/test.priv.h | 6 +- 170 files changed, 9848 insertions(+), 9411 deletions(-) create mode 100644 Ada95/doc/Makefile.in create mode 100644 Ada95/package/AdaCurses-doc.spec create mode 100644 Ada95/package/AdaCurses.spec create mode 100644 Ada95/package/debian/compat create mode 100644 Ada95/package/debian/control create mode 100644 Ada95/package/debian/copyright create mode 100644 Ada95/package/debian/docs create mode 100755 Ada95/package/debian/rules create mode 100644 Ada95/package/debian/source/format create mode 100644 Ada95/package/debian/watch create mode 100644 Ada95/src/c_varargs_to_ada.c create mode 100644 Ada95/src/c_varargs_to_ada.h create mode 100644 Ada95/src/ncurses_compat.c create mode 100644 test/package/debian/compat create mode 100644 test/package/debian/control create mode 100644 test/package/debian/copyright create mode 100644 test/package/debian/docs create mode 100755 test/package/debian/rules create mode 100644 test/package/debian/source/format create mode 100644 test/package/debian/watch create mode 100644 test/package/ncurses-examples.spec diff --git a/ANNOUNCE b/ANNOUNCE index 269bd2bca2a..11933c5f6d5 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ - Announcing ncurses 5.8 + Announcing ncurses 5.9 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,393 +27,30 @@ Release Notes This release is designed to be upward compatible from ncurses 5.0 - through 5.7; very few applications will require recompilation, + through 5.8; very few applications will require recompilation, depending on the platform. These are the highlights from the - change-log since ncurses 5.7 release. + change-log since ncurses 5.8 release. -Interface changes + This is a bug-fix release, correcting a small number of urgent + problems in the ncurses library from the 5.8 release. - * turn on _XOPEN_CURSES definition in curses.h. - * change _nc_has_mouse to has_mouse, reflect its use in C++ and - Ada95. - * add is_pad and is_subwin functions for opaque access to the WINDOW - structure. - * add tiparm, based on review of X/Open Curses Issue 7. - -New features and improvements - - Library Improvements - - * add a terminal driver for Windows console, which supports a MinGW - port to Windows. - * add extended functions which specify the SCREEN pointer for - several curses functions which use the global SP. - * improve the NCURSES_NO_UTF8_ACS feature by adding a check for an - extended terminfo capability U8. - * improve performance of tigetstr, etc., by using hashing code from - tic. - * add WACS_xxx definitions to wide-character configuration for - thick- and double-lines. - * modify init_pair to allow caller to create extra color pairs - beyond the color_pairs limit, which use default colors. - - Improvements to Programs - - * add tabs program. - * modify tic's -I/-C dump to reformat acsc strings into canonical - form (sorted, unique mapping). - * add checks in tic for inconsistent cursor-movement controls, and - for inconsistent printer-controls. - * add special case to _nc_infotocap (used by tic and infocmp) to - recognize the setaf/setab strings from xterm+256color and - xterm+88color, and provide a reduced version which works with - termcap. - - Terminal Database - - * added entries: - + bterm terminfo entry, based on bogl 0.1.18 - + cons25-debian entry - + eterm-color entry - + linux-16color - + mlterm+256color entry, for mlterm 3.0.0 - + several screen-bce.xxx entries - + screen.Eterm terminfo entry - + vwmterm entry - + xterm-utf8 entry as a demo of the U8 feature - * updated/improved entries: - + use extended capabilities: - o add U8 feature to denote entries for terminal emulators - which do not support VT100 SI/SO when processing UTF-8 - encoding - o add XT capability to entries for terminals that support - both xterm-style mouse- and title-controls, for screen - which special-cases TERM beginning with xterm or rxvt - + improvements based on new checks in tic: - + - o fill in no-parameter forms of cursor-movement where a - parameterized form is available - o fill in missing cursor controls where the form of the - controls is ANSI - o add parameterized cursor-controls to linux-basic - o modify nsterm, xnuppc and tek4115 to make sgr/sgr0 - consistent - o change several terminfo entries to make consistent use - of ANSI clear-all-tabs - + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, - moving function key definitions from emx-base for - consistency. - + correct missing final 'p' in pfkey capability of - ansi.sys-old. - + rename atari and st52 terminfo entries to atari-old, - st52-old, use newer entries from FreeMiNT. - + repurpose gnome terminfo entries as vte, retaining gnome - variants for compatibility, but generally deprecating those - since the VTE library is what actually defines the behavior - of "gnome", etc., since 2003. - + improve interix smso terminfo capability by using reverse - rather than bold. - + correct initc capability of linux-c-nc end-of-range, make - similar change for dg+ccc and dgunix+ccc. - + update minix terminfo entry. - + updated nsterm* entries. - + remove unnecessary kcan assignment to ^C from putty. - + suppress ncv in screen and konsole-base entries, allowing - underline. - + change ncv and op capabilities in sun-color terminfo entry to - match Sun's entry for this. - + fix typo in rmso for tek4106 entry. - + improve acsc string for vt52, show arrow keys. - + add hard-reset for rs2 to wsvt25 to help ensure that reset - ends the alternate character set. - + add ccc and initc capabilities to xterm-16color. - -Major bug fixes - - * ncurses library - + wide character support - o modify length returned by getcchar to count the trailing - null which is documented in X/Open. - o fix an infinite recursion when adding a legacy-coding - 8-bit value using insch. - o improve a workaround in adding wide-characters, when a - control character is found. The library uses unctrl to - obtain a printable version of the control character, but - was not passing color or video attributes. - o modify waddch_literal, updating line-pointer after a - multicolumn character is found to not fit on the current - row, and wrapping is done. Since the line-pointer was - not updated, the wrapped multicolumn character was - written to the beginning of the current row. - o fixes in wins_nwstr and related functions to ensure that - special characters, i.e., control characters are handled - properly with the wide-character configuration. - o correct internal _nc_insert_ch to use _nc_insert_wch - when inserting wide characters, since the wins_wch - function that it used did not update the cursor - position. - + mouse - o add check if Gpm_Open returns a -2, e.g., for "xterm". - This is normally suppressed but can be overridden using - $NCURSES_GPM_TERMS. Ensure that Gpm_Close is called in - this case. - o add check in mouse-driver to disable connection if GPM - returns a zero, indicating that the connection is - closed. - o modify getmouse to act as its documentation implied, - returning on each call the preceding event until none - are left. When no more events remain, it will return - ERR. - + miscellaneous - o improve handling of color-pairs embedded in attributes - for the extended-colors configuration. - o add check for failure to open hashed-database needed for - db4.6. - o modify use of $CC environment variable which is defined - by X/Open as a curses feature, to ignore it if it is not - a single character. - o modify declaration of cur_term when broken-linker is - used, but enable-reentrant is not, to match pre-5.7. - o correct limit-checks in derwin. - o remove old check in mvderwin which prevented moving a - derived window whose origin happened to coincide with - its parent's origin. - o correct limit-checks in newwin, to ensure that windows - have nonzero size. - o modify set_curterm to make broken-linker configuration - work with changes from 20090228. - o modify wgetch to ensure it checks SIGWINCH when it gets - an error in non-blocking mode. - o correct limit-check in wredrawln, accounting for - begy/begx values. - o fix a null-pointer check in _nc_format_slks in - lib_slk.c, from 20070704 changes. - o correct translation of "^" in _nc_infotocap, used to - transform terminfo to termcap strings. - o modify _nc_wgetch to check for a -1 in the fifo, e.g., - after a SIGWINCH, and discard that value, to avoid - confusing application. - * other libraries - + correct transfer of multicolumn characters in multirow - field_buffer, which stopped at the end of the first row due - to filling of unused entries in a cchar_t array with nulls. - + correct buffer-size after internal resizing of wide-character - set_field_buffer, broken in 20081018 changes. - + correct layout of working window used to extract data in - wide-character configured by set_field_buffer - -Portability - - * configure script: - + new options: - - --disable-libtool-version - use the "-version-number" feature which was added - in libtool 1.5. The default value for the option - uses the newer feature, which makes libraries - generated using libtool compatible with the - standard builds of ncurses. - - --disable-rpath-hack - disable a feature which adds rpath options for - libraries in unusual places. - - --enable-interop - integrate changes for generic/interop support to - form-library. - - --enable-pc-files - generate ".pc" files for each of the libraries, and - install them in pkg-config's library directory. - - --enable-pthreads-eintr - control whether to allow EINTR to interrupt a read - operation in wgetch. This applies only to the - pthread configuration - - --enable-sp-funcs - compile-in support for extended functions which - accept a SCREEN pointer, reducing the need for - juggling the global SP value with set_term and - delscreen. - - --enable-term-driver - compile with terminal-driver. That is used in the - MinGW port, and (being somewhat more complicated) - is an experimental alternative to the conventional - termlib internals. Currently, it requires the - sp-funcs feature to be enabled. - - --with-ncurses-wrap-prefix - allows setting the prefix for functions used to - wrap global variables to something other than - "_nc_". - - --with-pkg-config=[DIR] - check for pkg-config, optionally specifying its - path. - - --without-manpages - tells the configure script to suppress the install - of ncurses' manpages. - - --without-tests - suppress building test programs. - - + improved options: - o correct logic for --with-database, which was coded as an - enable-type switch. - o omit the opaque-functions from lib_gen.o when - --disable-ext-funcs is used. - * packaging: - + *-config scripts: - o modify adacurses-config to look for ".ali" files in the - adalib directory. - o correct install for the Ada95 tree, which omitted - libAdaCurses.a used in adacurses-config. - o change install for adacurses-config to provide - additional flavors such as adacursesw-config, for - ncursesw. - o modify scripts to generate ncurses*-config and pc-files - to add dependency for tinfo library. - o use ncurses*-config scripts if available for - test/configure. - o correct name for termlib in ncurses*-config, e.g., if it - is renamed to provide a single file for ncurses/ncursesw - libraries. - o generate manpages for the *-config scripts, adapted from - help2man. - o modify install-rule for manpages so that *-config - manpages will install when building with --srcdir. - o build-fixes for OpenSolaris aka Solaris 11, for - wide-character configuration as well as for rpath - feature in *-config scripts. - o use $includedir symbol in misc/ncurses-config.in, add - --includedir option. - o improve install-rules for pc-files. - o create the pkg-config library directory if needed. - o fix typo "==" where "=" is needed in ncurses-config.in - and gen-pkgconfig.in files. - o modify gen-pkgconfig.in to eliminate a dependency on - rpath when deciding whether to add $LIBS to --libs - output; that should be shown for the ncurses and tinfo - libraries without taking rpath into account. - o modify handling of $PKG_CONFIG_LIBDIR to use only the - first item in a possibly colon-separated list. - + other packaging issues - o add make-tar.sh scripts to Ada95 and test subdirectories - to help with making those separately distributable. - o add Ada95/configure script, to use in tar-file created - by Ada95/make-tar.sh. - o remove tar-copy.sh and related configure/Makefile - chunks, since the Ada95 binding is now installed using - rules in Ada95/src. - * cross-compiling: - + improve configure checks for location of tic and infocmp - programs used for installing database and for generating - fallback data, e.g., for cross-compiling. - + modify #define's for build-compiler to suppress cchar_t - symbol from compile of make_hash and make_keys, improving - cross-compilation of ncursesw. - + simplify include-dependencies of make_hash and make_keys, to - reduce the need for setting BUILD_CPPFLAGS in cross-compiling - when the build- and target-machines differ. - + correct cross-compiling configure check for CF_MKSTEMP macro, - by adding a check cache variable set by AC_CHECK_FUNC. - * library dependencies: - + revise wadd_wch and wecho_wchar to eliminate dependency on - unctrl. - + adjust configure script so that "t" is not added to library - suffix when weak-symbols are used, allowing the pthread - configuration to more closely match the non-thread naming. - * building the Ada95 tree: - + changes to use gnatmake project files in the Ada95 tree. - + add/use configure check to turn on project rules for - Ada95/src. - + old gnatmake (3.15) does not produce libraries using - project-file; work around by adding script to generate - alternate makefile. - + add configure --with-ada-sharedlib option, for the test_make - rule. - + move Ada95-related logic into aclocal.m4, since additional - checks will be needed to distinguish old/new implementations - of gnat. - + add test_make / test_clean / test_install rules in Ada95/src - + change install-path for adainclude directory to - /usr/share/ada (was /usr/lib/ada). - * other configure/build issues: - + make CCHARW_MAX value configurable, noting that changing this - would change the size of cchar_t, and would be - ABI-incompatible. - + improve comparison of program-names when checking for linked - flavors such as "reset" by ignoring the executable suffix. - + drop mkdirs.sh, use "mkdir -p". - + drop misc/ncu-indent and misc/jpf-indent; they are provided - by an external package [3]cindent. - + change makefiles to use $ARFLAGS rather than $AR_OPTS, - provide a configure check to detect whether a "-" is needed - before "ar" options. - + modify CF_DISABLE_LEAKS configure macro so that the - --enable-leaks option is not the same as --disable-leaks. - + improve configure script macros CF_HEADER_PATH and - CF_LIBRARY_PATH by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS - values to the search-lists. - + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS - to work with gcc 4.x's c89 alias, which gives warning - messages for cases where older versions would produce an - error. - + modify CF_WITH_LIBTOOL configure check to allow unreleased - libtool version numbers (e.g. which include alphabetic chars, - as well as digits, after the final '.'). - + improve use of symbolic links in makefiles by using "-f" - option if it is supported, to eliminate temporary removal of - the target - + add a configure-time check to pick a suitable value for - CC_SHARED_OPTS for Solaris. - + add -shared option to MK_SHARED_LIB when -Bsharable is used, - for *BSD's, without which "main" might be one of the shared - library's dependencies. - + modify configure script to allow building shared libraries - with gcc on AIX 5 or 6. - + suppress configure check for static/dynamic linker flags for - gcc on Solaris 10, since gcc is confused by absence of static - libc, and does not switch back to dynamic mode before - finishing the libraries. - + suppress configure check for static/dynamic linker flags for - gcc on Darwin. - + modify misc/run_tic.in to create parent directory, in case - this is a new install of hashed database. - + modify configure check for tic program, used for fallbacks, - to a warning if not found. This makes it simpler to use - additonal scripts to bootstrap the fallbacks code using tic - from the build tree. - * test programs: - + add test/demo_terminfo, for comparison with demo_termcap. - + improve test/ncurses.c 'F' test, show combining characters in - color. - + fix logic for 'V' in test/ncurses.c tests f/F. - + improve test/ncurses.c 'a test to put mouse droppings in the - proper window. - + modify ncurses 'F' test to demo wborder_set with colored - lines. - + modify ncurses 'f' test to demo wborder with colored lines. - + improve test/ncurses.c 'a' test, using unctrl more - consistently to display meta-characters. - + correct use of key_name in test/ncurses.c 'A' test, which - only displays wide-characters, not key-codes since 20070612. - + add test/clip_printw.c to illustrate how to use printw - without wrapping. - + modify test-programs, e.g,. test/view.c, to address subtle - differences between Tru64/Solaris and HPUX/AIX getcchar - return values. - + add some test programs (and make these use the same special - keys by sharing linedata.h functions): test/test_addstr.c - test/test_addwstr.c test/test_addchstr.c - test/test_add_wchstr.c - + add test/xterm-256color.dat - + modify test programs to allow them to be built with NetBSD - curses. - + fixes for test programs to build/work on HPUX and AIX, etc. + It also improves the Ada95 binding: + * fixes a longstanding portability problem with its use of the + [3]set_field_type function. Because that function uses + variable-length argument lists, its interface with gnat does not + work with certain platforms. + * improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. + Those were a proof of concept. For the 5.9 release, those scripts + are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + [4]here. + * additional improvements were made for portability of the ncurses + examples, adding rpm- and dpkg-scripts for test-builds. See + [5]this page for snapshots and other information. Features of Ncurses @@ -532,55 +169,55 @@ Portability cdk Curses Development Kit - [4]http://invisible-island.net/cdk/ - [5]http://www.vexus.ca/products/CDK/ + [6]http://invisible-island.net/cdk/ + [7]http://www.vexus.ca/products/CDK/ ded directory-editor - [6]http://invisible-island.net/ded/ + [8]http://invisible-island.net/ded/ dialog the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [7]http://invisible-island.net/dialog/ + [9]http://invisible-island.net/dialog/ lynx the character-screen WWW browser - [8]http://lynx.isc.org/release/ + [10]http://lynx.isc.org/release/ Midnight Commander file manager - [9]http://www.midnight-commander.org/ + [11]http://www.midnight-commander.org/ mutt mail utility - [10]http://www.mutt.org/ + [12]http://www.mutt.org/ ncftp file-transfer utility - [11]http://www.ncftp.com/ + [13]http://www.ncftp.com/ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [12]https://sites.google.com/a/bostic.com/keithbostic/nvi + [14]https://sites.google.com/a/bostic.com/keithbostic/nvi pinfo Lynx-like info browser. - [13]https://alioth.debian.org/projects/pinfo/ + [15]https://alioth.debian.org/projects/pinfo/ tin - newsreader, supporting color, MIME [14]http://www.tin.org/ + newsreader, supporting color, MIME [16]http://www.tin.org/ as well as some that use ncurses for the terminfo support alone: minicom terminal emulator - [15]http://alioth.debian.org/projects/minicom/ + [17]http://alioth.debian.org/projects/minicom/ vile vi-like-emacs - [16]http://invisible-island.net/vile/ + [18]http://invisible-island.net/vile/ The ncurses distribution includes a selection of test programs (including a few games). @@ -590,9 +227,9 @@ Who's Who and What's What Zeyd Ben-Halim started it from a previous package pcurses, written by Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer wrote most of the form and menu libraries. Ongoing work is being done - by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the + by [19]Thomas Dickey. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. - Contact the current maintainers at [18]bug-ncurses@gnu.org. + Contact the current maintainers at [20]bug-ncurses@gnu.org. To join the ncurses mailing list, please write email to bug-ncurses-request@gnu.org containing the line: @@ -602,7 +239,7 @@ Who's Who and What's What and testing of this package. Beta versions of ncurses and patches to the current release are made - available at [19]ftp://invisible-island.net/ncurses/ . + available at [21]ftp://invisible-island.net/ncurses/ . Future Plans @@ -616,34 +253,36 @@ Future Plans Other Related Resources The distribution provides a newer version of the terminfo-format - terminal description file once maintained by [20]Eric Raymond . Unlike + terminal description file once maintained by [22]Eric Raymond . Unlike the older version, the termcap and terminfo data are provided in the same file, and provides several user-definable extensions beyond the X/Open specification. You can find lots of information on terminal-related topics not - covered in the terminfo file at [21]Richard Shuford's archive . + covered in the terminfo file at [23]Richard Shuford's archive . References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/cindent/cindent.html - 4. http://invisible-island.net/cdk/ - 5. http://www.vexus.ca/products/CDK/ - 6. http://invisible-island.net/ded/ - 7. http://invisible-island.net/dialog/ - 8. http://lynx.isc.org/release/ - 9. http://www.midnight-commander.org/ - 10. http://www.mutt.org/ - 11. http://www.ncftp.com/ - 12. https://sites.google.com/a/bostic.com/keithbostic/nvi - 13. https://alioth.debian.org/projects/pinfo/ - 14. http://www.tin.org/ - 15. http://alioth.debian.org/projects/minicom/ - 16. http://invisible-island.net/vile/ - 17. mailto:dickey@invisible-island.net - 18. mailto:bug-ncurses@gnu.org - 19. ftp://invisible-island.net/ncurses/ - 20. http://www.catb.org/~esr/terminfo/ - 21. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal + 3. http://invisible-island.net/ncurses/man/form_fieldtype.3x + 4. http://invisible-island.net/ncurses/ncurses-Ada95.html + 5. http://invisible-island.net/ncurses/ncurses-examples.html + 6. http://invisible-island.net/cdk/ + 7. http://www.vexus.ca/products/CDK/ + 8. http://invisible-island.net/ded/ + 9. http://invisible-island.net/dialog/ + 10. http://lynx.isc.org/release/ + 11. http://www.midnight-commander.org/ + 12. http://www.mutt.org/ + 13. http://www.ncftp.com/ + 14. https://sites.google.com/a/bostic.com/keithbostic/nvi + 15. https://alioth.debian.org/projects/pinfo/ + 16. http://www.tin.org/ + 17. http://alioth.debian.org/projects/minicom/ + 18. http://invisible-island.net/vile/ + 19. mailto:dickey@invisible-island.net + 20. mailto:bug-ncurses@gnu.org + 21. ftp://invisible-island.net/ncurses/ + 22. http://www.catb.org/~esr/terminfo/ + 23. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 99a89cec0b1..597483b7b6b 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.20 2011/01/22 19:46:50 tom Exp $ +dnl $Id: aclocal.m4,v 1.24 2011/03/31 23:32:36 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -1040,10 +1040,12 @@ rm -rf conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_GENERICS version: 1 updated: 2010/11/13 14:15:18 +dnl CF_GNAT_GENERICS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- AC_DEFUN([CF_GNAT_GENERICS], [ +AC_REQUIRE([CF_GNAT_VERSION]) + AC_MSG_CHECKING(if GNAT supports generics) case $cf_gnat_version in #(vi 3.[[1-9]]*|[[4-9]].*) #(vi @@ -1068,6 +1070,53 @@ AC_SUBST(cf_compile_generics) AC_SUBST(cf_generic_objects) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 +dnl -------------- +dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it +dnl is noted that gnat may compile a tasking unit even for configurations which +dnl fail at runtime. +AC_DEFUN([CF_GNAT_SIGINT],[ +AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ +CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; + +package ConfTest is + + pragma Warnings (Off); -- the next pragma exists since 3.11p + pragma Unreserve_All_Interrupts; + pragma Warnings (On); + + protected Process is + procedure Stop; + function Continue return Boolean; + pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); + private + Done : Boolean := False; + end Process; + +end ConfTest;], +[package body ConfTest is + protected body Process is + procedure Stop is + begin + Done := True; + end Stop; + function Continue return Boolean is + begin + return not Done; + end Continue; + end Process; +end ConfTest;], + [cf_cv_gnat_sigint=yes], + [cf_cv_gnat_sigint=no])]) + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi +AC_SUBST(USE_GNAT_SIGINT) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_GNAT_PRAGMA_UNREF version: 1 updated: 2010/06/19 15:22:18 dnl -------------------- dnl Check if the gnat pragma "Unreferenced" works. @@ -1097,28 +1146,92 @@ fi AC_SUBST(PRAGMA_UNREF) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_PROJECTS version: 1 updated: 2010/11/13 14:15:18 +dnl CF_GNAT_PROJECTS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- +dnl GNAT projects are configured with ".gpr" project files. +dnl GNAT libraries are a further development, using the project feature. AC_DEFUN([CF_GNAT_PROJECTS], [ +AC_REQUIRE([CF_GNAT_VERSION]) + +cf_gnat_libraries=no +cf_gnat_projects=no + AC_MSG_CHECKING(if GNAT supports project files) case $cf_gnat_version in #(vi 3.[[0-9]]*) #(vi - cf_gnat_projects=no ;; *) case $cf_cv_system_name in #(vi cygwin*) #(vi - cf_gnat_projects=no ;; *) - cf_gnat_projects=yes + mkdir conftest.src conftest.bin conftest.lib + cd conftest.src + rm -rf conftest* *~conftest* + cat >>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* ;; esac ;; esac AC_MSG_RESULT($cf_gnat_projects) +if test $cf_gnat_projects = yes +then + AC_MSG_CHECKING(if GNAT supports libraries) + AC_MSG_RESULT($cf_gnat_libraries) +fi + if test "$cf_gnat_projects" = yes then USE_OLD_MAKERULES="#" @@ -1128,11 +1241,19 @@ else USE_GNAT_PROJECTS="#" fi +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + AC_SUBST(USE_OLD_MAKERULES) AC_SUBST(USE_GNAT_PROJECTS) +AC_SUBST(USE_GNAT_LIBRARIES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37 +dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1144,7 +1265,7 @@ dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ -rm -rf conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.ads </dev/null | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` @@ -1914,7 +2032,7 @@ AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ADDON version: 3 updated: 2010/10/23 15:54:49 +dnl CF_NCURSES_ADDON version: 4 updated: 2011/03/27 17:10:13 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ @@ -1939,8 +2057,8 @@ if test "$NCURSES_CONFIG" != none ; then cf_version=`$NCURSES_CONFIG --version` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` -NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.//' -e 's/\..*//'` -NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.[[0-9]]\+\.//'` +NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.//' -e 's/\..*//'` +NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.//'` # ABI version is not available from headers cf_cv_abi_version=`$NCURSES_CONFIG --abi-version` @@ -1956,10 +2074,10 @@ CF_EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then - cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ ]]\+//"` - eval NCURSES_$cf_name=$cf_result - cat conftest.$ac_ext - cat conftest.out + cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ ]][[ ]]*//"` + eval NCURSES_$cf_name=\"$cf_result\" + # cat conftest.$ac_ext + # cat conftest.out fi done @@ -2428,7 +2546,7 @@ case ".[$]$1" in #(vi esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09 +dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. AC_DEFUN([CF_PKG_CONFIG], @@ -2445,7 +2563,7 @@ no) #(vi PKG_CONFIG=none ;; yes) #(vi - AC_PATH_PROG(PKG_CONFIG, pkg-config, none) + AC_PATH_TOOL(PKG_CONFIG, pkg-config, none) ;; *) PKG_CONFIG=$withval @@ -3355,7 +3473,7 @@ if test "$with_pthread" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 +dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 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, @@ -3374,6 +3492,9 @@ case $host_os in #(vi aix[[456]]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; darwin[[0-8]].*) #(vi cf_xopen_source="-D_APPLE_C_SOURCE" ;; diff --git a/Ada95/configure b/Ada95/configure index f35d349a475..4db6f1f932e 100755 --- a/Ada95/configure +++ b/Ada95/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.21 . +# From configure.in Revision: 1.30 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20101001. +# Generated by Autoconf 2.52.20101002. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -657,9 +657,11 @@ Build-Tools Needed to Compile Temporary Applications for Cross-compiling: --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS) --with-build-libs=XXX the build libraries (${BUILD_LIBS}) Options to Specify the Libraries Built/Used: + --with-shared generate shared C-objects (needed for --with-ada-sharedlib) --enable-widec compile with wide-char/UTF-8 code --with-curses-dir=DIR directory in which (n)curses is installed --with-shlib-version=X Specify rel or abi version for shared libs + --enable-rpath-link link sample programs with rpath option Fine-Tuning Your Configuration: --enable-broken_linker compile with broken-linker support code --disable-largefile omit support for large files @@ -755,7 +757,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.20101001. Invocation command line was +generated by GNU Autoconf 2.52.20101002. Invocation command line was $ $0 $@ @@ -879,7 +881,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:882: loading site script $ac_site_file" >&5 + { echo "$as_me:884: 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" @@ -890,7 +892,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:893: loading cache $cache_file" >&5 + { echo "$as_me:895: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -898,7 +900,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:901: creating cache $cache_file" >&5 + { echo "$as_me:903: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -914,21 +916,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:917: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:919: 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:921: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:923: 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:927: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:929: 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:929: former value: $ac_old_val" >&5 + { echo "$as_me:931: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:931: current value: $ac_new_val" >&5 + { echo "$as_me:933: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -947,9 +949,9 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:950: error: changes in the environment can compromise the build" >&5 + { echo "$as_me:952: 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:952: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:954: 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 @@ -970,10 +972,10 @@ esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:973: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:975: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:976: \$? = $ac_status" >&5 + echo "$as_me:978: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else @@ -1003,7 +1005,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1006: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1008: 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 @@ -1013,11 +1015,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:1016: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1018: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1020: checking build system type" >&5 +echo "$as_me:1022: 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 @@ -1026,23 +1028,23 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1029: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1031: 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:1033: error: $ac_config_sub $ac_cv_build_alias failed." >&5 + { { echo "$as_me:1035: 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:1038: result: $ac_cv_build" >&5 +echo "$as_me:1040: 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/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:1045: checking host system type" >&5 +echo "$as_me:1047: 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 @@ -1051,12 +1053,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:1054: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { echo "$as_me:1056: 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:1059: result: $ac_cv_host" >&5 +echo "$as_me:1061: 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/'` @@ -1064,7 +1066,7 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1067: checking target system type" >&5 + echo "$as_me:1069: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1073,12 +1075,12 @@ else test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1076: error: $ac_config_sub $ac_cv_target_alias failed" >&5 + { { echo "$as_me:1078: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1081: result: $ac_cv_target" >&5 +echo "$as_me:1083: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1109,13 +1111,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1112: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1114: 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:1116: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1118: 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:1118: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1120: 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 @@ -1123,7 +1125,7 @@ fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" - { echo "$as_me:1126: WARNING: overriding system type to $withval" >&5 + { echo "$as_me:1128: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval fi; @@ -1133,7 +1135,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location -echo "$as_me:1136: checking for prefix" >&5 +echo "$as_me:1138: checking for prefix" >&5 echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in @@ -1145,11 +1147,11 @@ if test "x$prefix" = "xNONE" ; then ;; esac fi -echo "$as_me:1148: result: $prefix" >&5 +echo "$as_me:1150: result: $prefix" >&5 echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then -echo "$as_me:1152: checking for default include-directory" >&5 +echo "$as_me:1154: checking for default include-directory" >&5 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ @@ -1172,7 +1174,7 @@ do fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done -echo "$as_me:1175: result: $includedir" >&5 +echo "$as_me:1177: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 fi @@ -1186,7 +1188,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:1189: checking for $ac_word" >&5 +echo "$as_me:1191: 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 @@ -1201,7 +1203,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:1204: found $ac_dir/$ac_word" >&5 +echo "$as_me:1206: found $ac_dir/$ac_word" >&5 break done @@ -1209,10 +1211,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1212: result: $CC" >&5 + echo "$as_me:1214: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1215: result: no" >&5 + echo "$as_me:1217: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1221,7 +1223,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:1224: checking for $ac_word" >&5 +echo "$as_me:1226: 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 @@ -1236,7 +1238,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:1239: found $ac_dir/$ac_word" >&5 +echo "$as_me:1241: found $ac_dir/$ac_word" >&5 break done @@ -1244,10 +1246,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1247: result: $ac_ct_CC" >&5 + echo "$as_me:1249: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1250: result: no" >&5 + echo "$as_me:1252: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1260,7 +1262,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:1263: checking for $ac_word" >&5 +echo "$as_me:1265: 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 @@ -1275,7 +1277,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:1278: found $ac_dir/$ac_word" >&5 +echo "$as_me:1280: found $ac_dir/$ac_word" >&5 break done @@ -1283,10 +1285,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1286: result: $CC" >&5 + echo "$as_me:1288: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1289: result: no" >&5 + echo "$as_me:1291: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1295,7 +1297,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:1298: checking for $ac_word" >&5 +echo "$as_me:1300: 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 @@ -1310,7 +1312,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:1313: found $ac_dir/$ac_word" >&5 +echo "$as_me:1315: found $ac_dir/$ac_word" >&5 break done @@ -1318,10 +1320,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1321: result: $ac_ct_CC" >&5 + echo "$as_me:1323: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1324: result: no" >&5 + echo "$as_me:1326: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1334,7 +1336,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:1337: checking for $ac_word" >&5 +echo "$as_me:1339: 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 @@ -1354,7 +1356,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1357: found $ac_dir/$ac_word" >&5 +echo "$as_me:1359: found $ac_dir/$ac_word" >&5 break done @@ -1376,10 +1378,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1379: result: $CC" >&5 + echo "$as_me:1381: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1382: result: no" >&5 + echo "$as_me:1384: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1390,7 +1392,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:1393: checking for $ac_word" >&5 +echo "$as_me:1395: 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 @@ -1405,7 +1407,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:1408: found $ac_dir/$ac_word" >&5 +echo "$as_me:1410: found $ac_dir/$ac_word" >&5 break done @@ -1413,10 +1415,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1416: result: $CC" >&5 + echo "$as_me:1418: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1419: result: no" >&5 + echo "$as_me:1421: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1429,7 +1431,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:1432: checking for $ac_word" >&5 +echo "$as_me:1434: 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 @@ -1444,7 +1446,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:1447: found $ac_dir/$ac_word" >&5 +echo "$as_me:1449: found $ac_dir/$ac_word" >&5 break done @@ -1452,10 +1454,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1455: result: $ac_ct_CC" >&5 + echo "$as_me:1457: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1458: result: no" >&5 + echo "$as_me:1460: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1467,32 +1469,32 @@ fi fi -test -z "$CC" && { { echo "$as_me:1470: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1472: 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:1475:" \ +echo "$as_me:1477:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1478: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:1480: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:1481: \$? = $ac_status" >&5 + echo "$as_me:1483: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1483: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:1485: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:1486: \$? = $ac_status" >&5 + echo "$as_me:1488: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1488: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:1490: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:1491: \$? = $ac_status" >&5 + echo "$as_me:1493: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1495 "configure" +#line 1497 "configure" #include "confdefs.h" int @@ -1508,13 +1510,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:1511: checking for C compiler default output" >&5 +echo "$as_me:1513: 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:1514: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:1516: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1517: \$? = $ac_status" >&5 + echo "$as_me:1519: \$? = $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 @@ -1537,34 +1539,34 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1540: error: C compiler cannot create executables" >&5 +{ { echo "$as_me:1542: 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:1546: result: $ac_file" >&5 +echo "$as_me:1548: 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:1551: checking whether the C compiler works" >&5 +echo "$as_me:1553: 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:1557: \"$ac_try\"") >&5 + { (eval echo "$as_me:1559: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1560: \$? = $ac_status" >&5 + echo "$as_me:1562: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1567: error: cannot run C compiled programs. + { { echo "$as_me:1569: 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;} @@ -1572,24 +1574,24 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1575: result: yes" >&5 +echo "$as_me:1577: 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:1582: checking whether we are cross compiling" >&5 +echo "$as_me:1584: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1584: result: $cross_compiling" >&5 +echo "$as_me:1586: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1587: checking for executable suffix" >&5 +echo "$as_me:1589: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1589: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1591: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1592: \$? = $ac_status" >&5 + echo "$as_me:1594: \$? = $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 @@ -1605,25 +1607,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1608: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1610: 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:1614: result: $ac_cv_exeext" >&5 +echo "$as_me:1616: 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:1620: checking for object suffix" >&5 +echo "$as_me:1622: 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 1626 "configure" +#line 1628 "configure" #include "confdefs.h" int @@ -1635,10 +1637,10 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1638: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1641: \$? = $ac_status" >&5 + echo "$as_me:1643: \$? = $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 @@ -1650,24 +1652,24 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1653: error: cannot compute OBJEXT: cannot compile" >&5 +{ { echo "$as_me:1655: 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:1660: result: $ac_cv_objext" >&5 +echo "$as_me:1662: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1664: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1666: 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 1670 "configure" +#line 1672 "configure" #include "confdefs.h" int @@ -1682,16 +1684,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1687: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1688: \$? = $ac_status" >&5 + echo "$as_me:1690: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1691: \"$ac_try\"") >&5 + { (eval echo "$as_me:1693: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1694: \$? = $ac_status" >&5 + echo "$as_me:1696: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -1703,19 +1705,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1706: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1708: 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:1712: checking whether $CC accepts -g" >&5 +echo "$as_me:1714: 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 1718 "configure" +#line 1720 "configure" #include "confdefs.h" int @@ -1727,16 +1729,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1732: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1733: \$? = $ac_status" >&5 + echo "$as_me:1735: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1736: \"$ac_try\"") >&5 + { (eval echo "$as_me:1738: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1739: \$? = $ac_status" >&5 + echo "$as_me:1741: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -1746,7 +1748,7 @@ ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1749: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1751: 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 @@ -1773,16 +1775,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1776: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1778: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1779: \$? = $ac_status" >&5 + echo "$as_me:1781: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1782: \"$ac_try\"") >&5 + { (eval echo "$as_me:1784: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1785: \$? = $ac_status" >&5 + echo "$as_me:1787: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -1794,7 +1796,7 @@ if { (eval echo "$as_me:1776: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 1797 "configure" +#line 1799 "configure" #include "confdefs.h" #include $ac_declaration @@ -1807,16 +1809,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1810: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1813: \$? = $ac_status" >&5 + echo "$as_me:1815: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1816: \"$ac_try\"") >&5 + { (eval echo "$as_me:1818: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1819: \$? = $ac_status" >&5 + echo "$as_me:1821: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -1826,7 +1828,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 1829 "configure" +#line 1831 "configure" #include "confdefs.h" $ac_declaration int @@ -1838,16 +1840,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1841: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1843: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1844: \$? = $ac_status" >&5 + echo "$as_me:1846: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1847: \"$ac_try\"") >&5 + { (eval echo "$as_me:1849: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1850: \$? = $ac_status" >&5 + echo "$as_me:1852: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -1877,11 +1879,11 @@ ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:1880: checking version of $CC" >&5 + echo "$as_me:1882: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:1884: result: $GCC_VERSION" >&5 + echo "$as_me:1886: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi @@ -1891,7 +1893,7 @@ 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:1894: checking how to run the C preprocessor" >&5 +echo "$as_me:1896: 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 @@ -1912,18 +1914,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 1915 "configure" +#line 1917 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:1920: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:1922: \"$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:1926: \$? = $ac_status" >&5 + echo "$as_me:1928: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -1946,17 +1948,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 1949 "configure" +#line 1951 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:1953: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:1955: \"$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:1959: \$? = $ac_status" >&5 + echo "$as_me:1961: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -1993,7 +1995,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:1996: result: $CPP" >&5 +echo "$as_me:1998: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2003,18 +2005,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 2006 "configure" +#line 2008 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2011: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2013: \"$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:2017: \$? = $ac_status" >&5 + echo "$as_me:2019: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2037,17 +2039,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 2040 "configure" +#line 2042 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2044: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2046: \"$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:2050: \$? = $ac_status" >&5 + echo "$as_me:2052: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2075,7 +2077,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2078: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2080: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2088,14 +2090,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:2091: checking whether $CC needs -traditional" >&5 + echo "$as_me:2093: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line 2098 "configure" +#line 2100 "configure" #include "confdefs.h" #include int Autoconf = TIOCGETP; @@ -2110,7 +2112,7 @@ rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line 2113 "configure" +#line 2115 "configure" #include "confdefs.h" #include int Autoconf = TCGETA; @@ -2123,14 +2125,14 @@ rm -rf conftest* fi fi -echo "$as_me:2126: result: $ac_cv_prog_gcc_traditional" >&5 +echo "$as_me:2128: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo "$as_me:2133: checking whether $CC understands -c and -o together" >&5 +echo "$as_me:2135: checking whether $CC understands -c and -o together" >&5 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CC_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2146,15 +2148,15 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:2149: \"$ac_try\"") >&5 +if { (eval echo "$as_me:2151: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2152: \$? = $ac_status" >&5 + echo "$as_me:2154: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:2154: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:2156: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2157: \$? = $ac_status" >&5 + echo "$as_me:2159: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CC_c_o=yes @@ -2165,19 +2167,19 @@ rm -rf conftest* fi if test $cf_cv_prog_CC_c_o = yes; then - echo "$as_me:2168: result: yes" >&5 + echo "$as_me:2170: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2171: result: no" >&5 + echo "$as_me:2173: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:2175: checking for POSIXized ISC" >&5 +echo "$as_me:2177: checking for POSIXized ISC" >&5 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then - echo "$as_me:2180: result: yes" >&5 + echo "$as_me:2182: result: yes" >&5 echo "${ECHO_T}yes" >&6 ISC=yes # If later tests want to check for ISC. @@ -2191,12 +2193,12 @@ EOF CC="$CC -Xp" fi else - echo "$as_me:2194: result: no" >&5 + echo "$as_me:2196: result: no" >&5 echo "${ECHO_T}no" >&6 ISC= fi -echo "$as_me:2199: checking for ${CC:-cc} option to accept ANSI C" >&5 +echo "$as_me:2201: checking for ${CC:-cc} option to accept ANSI C" >&5 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2300,7 +2302,7 @@ if test -n "$cf_new_extra_cppflags" ; then fi cat >conftest.$ac_ext <<_ACEOF -#line 2303 "configure" +#line 2305 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2321,16 +2323,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2324: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2326: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2327: \$? = $ac_status" >&5 + echo "$as_me:2329: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2330: \"$ac_try\"") >&5 + { (eval echo "$as_me:2332: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2333: \$? = $ac_status" >&5 + echo "$as_me:2335: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else @@ -2343,7 +2345,7 @@ CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$as_me:2346: result: $cf_cv_ansi_cc" >&5 +echo "$as_me:2348: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then @@ -2436,7 +2438,7 @@ fi fi if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2439: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2441: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler @@ -2483,7 +2485,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:2486: checking for $ac_word" >&5 +echo "$as_me:2488: 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 @@ -2498,7 +2500,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:2501: found $ac_dir/$ac_word" >&5 +echo "$as_me:2503: found $ac_dir/$ac_word" >&5 break done @@ -2506,21 +2508,21 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:2509: result: $AWK" >&5 + echo "$as_me:2511: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:2512: result: no" >&5 + echo "$as_me:2514: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done -test -z "$AWK" && { { echo "$as_me:2519: error: No awk program found" >&5 +test -z "$AWK" && { { echo "$as_me:2521: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:2523: checking for egrep" >&5 +echo "$as_me:2525: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2530,11 +2532,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:2533: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:2535: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:2537: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:2539: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -2550,7 +2552,7 @@ echo "$as_me: error: No egrep program found" >&2;} # 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:2553: checking for a BSD compatible install" >&5 +echo "$as_me:2555: 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 @@ -2599,7 +2601,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:2602: result: $INSTALL" >&5 +echo "$as_me:2604: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2610,18 +2612,18 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:2613: checking whether ln -s works" >&5 +echo "$as_me:2615: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:2617: result: yes" >&5 + echo "$as_me:2619: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2620: result: no, using $LN_S" >&5 + echo "$as_me:2622: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi -echo "$as_me:2624: checking if $LN_S -f options work" >&5 +echo "$as_me:2626: checking if $LN_S -f options work" >&5 echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 rm -f conf$$.src conf$$dst @@ -2633,12 +2635,12 @@ else cf_prog_ln_sf=no fi rm -f conf$$.dst conf$$src -echo "$as_me:2636: result: $cf_prog_ln_sf" >&5 +echo "$as_me:2638: result: $cf_prog_ln_sf" >&5 echo "${ECHO_T}$cf_prog_ln_sf" >&6 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" -echo "$as_me:2641: checking for long file names" >&5 +echo "$as_me:2643: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2677,7 +2679,7 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do rm -rf $ac_xdir 2>/dev/null done fi -echo "$as_me:2680: result: $ac_cv_sys_long_file_names" >&5 +echo "$as_me:2682: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then @@ -2689,7 +2691,7 @@ fi # if we find pkg-config, check if we should install the ".pc" files. -echo "$as_me:2692: checking if you want to use pkg-config" >&5 +echo "$as_me:2694: 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. @@ -2699,7 +2701,7 @@ if test "${with_pkg_config+set}" = set; then else cf_pkg_config=yes fi; -echo "$as_me:2702: result: $cf_pkg_config" >&5 +echo "$as_me:2704: result: $cf_pkg_config" >&5 echo "${ECHO_T}$cf_pkg_config" >&6 case $cf_pkg_config in #(vi @@ -2707,9 +2709,10 @@ no) #(vi PKG_CONFIG=none ;; yes) #(vi - # 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:2712: checking for $ac_word" >&5 + 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:2715: 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 @@ -2726,25 +2729,70 @@ 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:2729: found $ac_dir/$ac_word" >&5 + echo "$as_me:2732: found $ac_dir/$ac_word" >&5 break fi done - test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - echo "$as_me:2741: result: $PKG_CONFIG" >&5 + echo "$as_me:2743: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else - echo "$as_me:2744: result: no" >&5 + echo "$as_me:2746: result: no" >&5 echo "${ECHO_T}no" >&6 fi +fi +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:2755: 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 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:2772: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:2784: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:2787: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + ;; *) PKG_CONFIG=$withval @@ -2779,7 +2827,7 @@ case ".$PKG_CONFIG" in #(vi PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:2782: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 + { { echo "$as_me:2830: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -2787,8 +2835,8 @@ esac fi -if test "$PKG_CONFIG" != no ; then - echo "$as_me:2791: checking if we should install .pc files for $PKG_CONFIG" >&5 +if test "$PKG_CONFIG" != none ; then + echo "$as_me:2839: checking if we should install .pc files for $PKG_CONFIG" >&5 echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6 # Leave this as something that can be overridden in the environment. @@ -2805,18 +2853,18 @@ if test "${enable_pc_files+set}" = set; then else enable_pc_files=no fi; - echo "$as_me:2808: result: $enable_pc_files" >&5 + echo "$as_me:2856: result: $enable_pc_files" >&5 echo "${ECHO_T}$enable_pc_files" >&6 else - echo "$as_me:2811: result: no" >&5 + echo "$as_me:2859: result: no" >&5 echo "${ECHO_T}no" >&6 - { echo "$as_me:2813: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 + { echo "$as_me:2861: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} enable_pc_files=no fi fi -echo "$as_me:2819: checking if you want to build test-programs" >&5 +echo "$as_me:2867: checking if you want to build test-programs" >&5 echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 # Check whether --with-tests or --without-tests was given. @@ -2826,10 +2874,10 @@ if test "${with_tests+set}" = set; then else cf_with_tests=yes fi; -echo "$as_me:2829: result: $cf_with_tests" >&5 +echo "$as_me:2877: result: $cf_with_tests" >&5 echo "${ECHO_T}$cf_with_tests" >&6 -echo "$as_me:2832: checking if we should assume mixed-case filenames" >&5 +echo "$as_me:2880: checking if we should assume mixed-case filenames" >&5 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 # Check whether --enable-mixed-case or --disable-mixed-case was given. @@ -2839,11 +2887,11 @@ if test "${enable_mixed_case+set}" = set; then else enable_mixedcase=auto fi; -echo "$as_me:2842: result: $enable_mixedcase" >&5 +echo "$as_me:2890: result: $enable_mixedcase" >&5 echo "${ECHO_T}$enable_mixedcase" >&6 if test "$enable_mixedcase" = "auto" ; then -echo "$as_me:2846: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:2894: 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 @@ -2870,7 +2918,7 @@ else fi fi -echo "$as_me:2873: result: $cf_cv_mixedcase" >&5 +echo "$as_me:2921: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 @@ -2887,7 +2935,7 @@ EOF fi # do this after mixed-case option (tags/TAGS is not as important as tic). -echo "$as_me:2890: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "$as_me:2938: 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 @@ -2907,11 +2955,11 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:2910: result: yes" >&5 + echo "$as_me:2958: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:2914: result: no" >&5 + echo "$as_me:2962: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -2920,7 +2968,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:2923: checking for $ac_word" >&5 +echo "$as_me:2971: 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 @@ -2935,7 +2983,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:2938: found $ac_dir/$ac_word" >&5 +echo "$as_me:2986: found $ac_dir/$ac_word" >&5 break done @@ -2943,10 +2991,10 @@ fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then - echo "$as_me:2946: result: $CTAGS" >&5 + echo "$as_me:2994: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else - echo "$as_me:2949: result: no" >&5 + echo "$as_me:2997: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2957,7 +3005,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:2960: checking for $ac_word" >&5 +echo "$as_me:3008: 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 @@ -2972,7 +3020,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:2975: found $ac_dir/$ac_word" >&5 +echo "$as_me:3023: found $ac_dir/$ac_word" >&5 break done @@ -2980,10 +3028,10 @@ fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then - echo "$as_me:2983: result: $ETAGS" >&5 + echo "$as_me:3031: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else - echo "$as_me:2986: result: no" >&5 + echo "$as_me:3034: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2992,7 +3040,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:2995: checking for $ac_word" >&5 +echo "$as_me:3043: 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 @@ -3007,7 +3055,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:3010: found $ac_dir/$ac_word" >&5 +echo "$as_me:3058: found $ac_dir/$ac_word" >&5 break done @@ -3016,17 +3064,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:3019: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:3067: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:3022: result: no" >&5 + echo "$as_me:3070: 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:3029: checking for $ac_word" >&5 +echo "$as_me:3077: 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 @@ -3041,7 +3089,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:3044: found $ac_dir/$ac_word" >&5 +echo "$as_me:3092: found $ac_dir/$ac_word" >&5 break done @@ -3050,10 +3098,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:3053: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:3101: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:3056: result: no" >&5 + echo "$as_me:3104: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3073,7 +3121,7 @@ else MAKE_LOWER_TAGS="#" fi -echo "$as_me:3076: checking for makeflags variable" >&5 +echo "$as_me:3124: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3087,7 +3135,7 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[ ]*$,,'` case "$cf_result" in .*k) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` @@ -3107,13 +3155,13 @@ CF_EOF rm -f cf_makeflags.tmp fi -echo "$as_me:3110: result: $cf_cv_makeflags" >&5 +echo "$as_me:3158: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:3116: checking for $ac_word" >&5 +echo "$as_me:3164: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3128,7 +3176,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_RANLIB="${ac_tool_prefix}ranlib" -echo "$as_me:3131: found $ac_dir/$ac_word" >&5 +echo "$as_me:3179: found $ac_dir/$ac_word" >&5 break done @@ -3136,10 +3184,10 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:3139: result: $RANLIB" >&5 + echo "$as_me:3187: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else - echo "$as_me:3142: result: no" >&5 + echo "$as_me:3190: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3148,7 +3196,7 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:3151: checking for $ac_word" >&5 +echo "$as_me:3199: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3163,7 +3211,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_RANLIB="ranlib" -echo "$as_me:3166: found $ac_dir/$ac_word" >&5 +echo "$as_me:3214: found $ac_dir/$ac_word" >&5 break done @@ -3172,10 +3220,10 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:3175: result: $ac_ct_RANLIB" >&5 + echo "$as_me:3223: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$as_me:3178: result: no" >&5 + echo "$as_me:3226: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3187,7 +3235,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 -echo "$as_me:3190: checking for $ac_word" >&5 +echo "$as_me:3238: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3202,7 +3250,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_LD="${ac_tool_prefix}ld" -echo "$as_me:3205: found $ac_dir/$ac_word" >&5 +echo "$as_me:3253: found $ac_dir/$ac_word" >&5 break done @@ -3210,10 +3258,10 @@ fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$as_me:3213: result: $LD" >&5 + echo "$as_me:3261: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else - echo "$as_me:3216: result: no" >&5 + echo "$as_me:3264: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3222,7 +3270,7 @@ if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo "$as_me:3225: checking for $ac_word" >&5 +echo "$as_me:3273: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3237,7 +3285,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_LD="ld" -echo "$as_me:3240: found $ac_dir/$ac_word" >&5 +echo "$as_me:3288: found $ac_dir/$ac_word" >&5 break done @@ -3246,10 +3294,10 @@ fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then - echo "$as_me:3249: result: $ac_ct_LD" >&5 + echo "$as_me:3297: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else - echo "$as_me:3252: result: no" >&5 + echo "$as_me:3300: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3261,7 +3309,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:3264: checking for $ac_word" >&5 +echo "$as_me:3312: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3276,7 +3324,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_AR="${ac_tool_prefix}ar" -echo "$as_me:3279: found $ac_dir/$ac_word" >&5 +echo "$as_me:3327: found $ac_dir/$ac_word" >&5 break done @@ -3284,10 +3332,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:3287: result: $AR" >&5 + echo "$as_me:3335: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:3290: result: no" >&5 + echo "$as_me:3338: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3296,7 +3344,7 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:3299: checking for $ac_word" >&5 +echo "$as_me:3347: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3311,7 +3359,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_AR="ar" -echo "$as_me:3314: found $ac_dir/$ac_word" >&5 +echo "$as_me:3362: found $ac_dir/$ac_word" >&5 break done @@ -3320,10 +3368,10 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:3323: result: $ac_ct_AR" >&5 + echo "$as_me:3371: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else - echo "$as_me:3326: result: no" >&5 + echo "$as_me:3374: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3335,7 +3383,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:3338: checking for $ac_word" >&5 +echo "$as_me:3386: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3350,7 +3398,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_AR="${ac_tool_prefix}ar" -echo "$as_me:3353: found $ac_dir/$ac_word" >&5 +echo "$as_me:3401: found $ac_dir/$ac_word" >&5 break done @@ -3358,10 +3406,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:3361: result: $AR" >&5 + echo "$as_me:3409: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:3364: result: no" >&5 + echo "$as_me:3412: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3370,7 +3418,7 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:3373: checking for $ac_word" >&5 +echo "$as_me:3421: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3385,7 +3433,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_AR="ar" -echo "$as_me:3388: found $ac_dir/$ac_word" >&5 +echo "$as_me:3436: found $ac_dir/$ac_word" >&5 break done @@ -3394,10 +3442,10 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:3397: result: $ac_ct_AR" >&5 + echo "$as_me:3445: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else - echo "$as_me:3400: result: no" >&5 + echo "$as_me:3448: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3406,7 +3454,7 @@ else AR="$ac_cv_prog_AR" fi -echo "$as_me:3409: checking for options to update archives" >&5 +echo "$as_me:3457: checking for options to update archives" >&5 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 if test "${cf_cv_ar_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3429,13 +3477,13 @@ else rm -f conftest.a cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:3483: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3438: \$? = $ac_status" >&5 + echo "$as_me:3486: \$? = $ac_status" >&5 (exit $ac_status); } ; then echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null @@ -3446,7 +3494,7 @@ EOF else test -n "$verbose" && echo " cannot compile test-program" 1>&6 -echo "${as_me:-configure}:3449: testing cannot compile test-program ..." 1>&5 +echo "${as_me:-configure}:3497: testing cannot compile test-program ..." 1>&5 break fi @@ -3454,7 +3502,7 @@ echo "${as_me:-configure}:3449: testing cannot compile test-program ..." 1>&5 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext fi -echo "$as_me:3457: result: $cf_cv_ar_flags" >&5 +echo "$as_me:3505: result: $cf_cv_ar_flags" >&5 echo "${ECHO_T}$cf_cv_ar_flags" >&6 if test -n "$ARFLAGS" ; then @@ -3465,7 +3513,7 @@ else ARFLAGS=$cf_cv_ar_flags fi -echo "$as_me:3468: checking if you have specified an install-prefix" >&5 +echo "$as_me:3516: checking if you have specified an install-prefix" >&5 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. @@ -3478,7 +3526,7 @@ if test "${with_install_prefix+set}" = set; then ;; esac fi; -echo "$as_me:3481: result: $DESTDIR" >&5 +echo "$as_me:3529: result: $DESTDIR" >&5 echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### @@ -3506,7 +3554,7 @@ else 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:3509: checking for $ac_word" >&5 +echo "$as_me:3557: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3521,7 +3569,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_BUILD_CC="$ac_prog" -echo "$as_me:3524: found $ac_dir/$ac_word" >&5 +echo "$as_me:3572: found $ac_dir/$ac_word" >&5 break done @@ -3529,10 +3577,10 @@ fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - echo "$as_me:3532: result: $BUILD_CC" >&5 + echo "$as_me:3580: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else - echo "$as_me:3535: result: no" >&5 + echo "$as_me:3583: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3540,12 +3588,12 @@ fi done fi; - echo "$as_me:3543: checking for native build C compiler" >&5 + echo "$as_me:3591: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 - echo "$as_me:3545: result: $BUILD_CC" >&5 + echo "$as_me:3593: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 - echo "$as_me:3548: checking for native build C preprocessor" >&5 + echo "$as_me:3596: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. @@ -3555,10 +3603,10 @@ if test "${with_build_cpp+set}" = set; then else BUILD_CPP='${BUILD_CC} -E' fi; - echo "$as_me:3558: result: $BUILD_CPP" >&5 + echo "$as_me:3606: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 - echo "$as_me:3561: checking for native build C flags" >&5 + echo "$as_me:3609: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. @@ -3566,10 +3614,10 @@ if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; - echo "$as_me:3569: result: $BUILD_CFLAGS" >&5 + echo "$as_me:3617: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 - echo "$as_me:3572: checking for native build C preprocessor-flags" >&5 + echo "$as_me:3620: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. @@ -3577,10 +3625,10 @@ if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; - echo "$as_me:3580: result: $BUILD_CPPFLAGS" >&5 + echo "$as_me:3628: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 - echo "$as_me:3583: checking for native build linker-flags" >&5 + echo "$as_me:3631: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. @@ -3588,10 +3636,10 @@ if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; - echo "$as_me:3591: result: $BUILD_LDFLAGS" >&5 + echo "$as_me:3639: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 - echo "$as_me:3594: checking for native build linker-libraries" >&5 + echo "$as_me:3642: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. @@ -3599,7 +3647,7 @@ if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; - echo "$as_me:3602: result: $BUILD_LIBS" >&5 + echo "$as_me:3650: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. @@ -3609,7 +3657,7 @@ echo "${ECHO_T}$BUILD_LIBS" >&6 : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then - { { echo "$as_me:3612: error: Cross-build requires two compilers. + { { echo "$as_me:3660: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} @@ -3633,23 +3681,38 @@ fi ### Use "--without-normal --with-shared" to allow the default model to be ### shared, for example. cf_list_models="" -echo "$as_me:3636: checking for specified models" >&5 + +echo "$as_me:3685: checking if you want to build shared C-objects" >&5 +echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6 + +# Check whether --with-shared or --without-shared was given. +if test "${with_shared+set}" = set; then + withval="$with_shared" + with_shared=$withval +else + with_shared=no +fi; +echo "$as_me:3695: result: $with_shared" >&5 +echo "${ECHO_T}$with_shared" >&6 +test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" + +echo "$as_me:3699: checking for specified models" >&5 echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal -echo "$as_me:3639: result: $cf_list_models" >&5 +echo "$as_me:3702: result: $cf_list_models" >&5 echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. -echo "$as_me:3644: checking for default model" >&5 +echo "$as_me:3707: checking for default model" >&5 echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` -echo "$as_me:3647: result: $DFT_LWR_MODEL" >&5 +echo "$as_me:3710: result: $DFT_LWR_MODEL" >&5 echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` -echo "$as_me:3652: checking for specific curses-directory" >&5 +echo "$as_me:3715: 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. @@ -3659,7 +3722,7 @@ if test "${with_curses_dir+set}" = set; then else cf_cv_curses_dir=no fi; -echo "$as_me:3662: result: $cf_cv_curses_dir" >&5 +echo "$as_me:3725: 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" ) @@ -3690,7 +3753,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:3693: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:3756: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -3723,7 +3786,7 @@ if test -n "$cf_cv_curses_dir/include" ; then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 3726 "configure" +#line 3789 "configure" #include "confdefs.h" #include int @@ -3735,16 +3798,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3738: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3801: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3741: \$? = $ac_status" >&5 + echo "$as_me:3804: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3744: \"$ac_try\"") >&5 + { (eval echo "$as_me:3807: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3747: \$? = $ac_status" >&5 + echo "$as_me:3810: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -3761,7 +3824,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}:3764: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:3827: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -3795,7 +3858,7 @@ if test -n "$cf_cv_curses_dir/lib" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me:-configure}:3798: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:3861: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -3806,7 +3869,7 @@ fi fi fi -echo "$as_me:3809: checking if you want wide-character code" >&5 +echo "$as_me:3872: checking if you want wide-character code" >&5 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. @@ -3816,11 +3879,11 @@ if test "${enable_widec+set}" = set; then else with_widec=no fi; -echo "$as_me:3819: result: $with_widec" >&5 +echo "$as_me:3882: result: $with_widec" >&5 echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then -echo "$as_me:3823: checking for multibyte character support" >&5 +echo "$as_me:3886: 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 @@ -3828,7 +3891,7 @@ else cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3831 "configure" +#line 3894 "configure" #include "confdefs.h" #include @@ -3841,16 +3904,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3844: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3907: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3847: \$? = $ac_status" >&5 + echo "$as_me:3910: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3850: \"$ac_try\"") >&5 + { (eval echo "$as_me:3913: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3853: \$? = $ac_status" >&5 + echo "$as_me:3916: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_utf8_lib=yes else @@ -3862,12 +3925,12 @@ cat conftest.$ac_ext >&5 cf_cv_header_path_utf8= cf_cv_library_path_utf8= -echo "${as_me:-configure}:3865: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:3928: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3870 "configure" +#line 3933 "configure" #include "confdefs.h" #include @@ -3880,16 +3943,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3883: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3946: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3886: \$? = $ac_status" >&5 + echo "$as_me:3949: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3889: \"$ac_try\"") >&5 + { (eval echo "$as_me:3952: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3892: \$? = $ac_status" >&5 + echo "$as_me:3955: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_find_linkage_utf8=yes @@ -3903,7 +3966,7 @@ cat conftest.$ac_ext >&5 LIBS="-lutf8 $cf_save_LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3906 "configure" +#line 3969 "configure" #include "confdefs.h" #include @@ -3916,16 +3979,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3919: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3982: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3922: \$? = $ac_status" >&5 + echo "$as_me:3985: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3925: \"$ac_try\"") >&5 + { (eval echo "$as_me:3988: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3928: \$? = $ac_status" >&5 + echo "$as_me:3991: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_find_linkage_utf8=yes @@ -3942,9 +4005,9 @@ cat conftest.$ac_ext >&5 test -n "$verbose" && echo " find linkage for utf8 library" 1>&6 -echo "${as_me:-configure}:3945: testing find linkage for utf8 library ..." 1>&5 +echo "${as_me:-configure}:4008: testing find linkage for utf8 library ..." 1>&5 -echo "${as_me:-configure}:3947: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:4010: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" @@ -4057,11 +4120,11 @@ cf_search="$cf_search $cf_header_path_list" 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}:4060: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:4123: 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 4064 "configure" +#line 4127 "configure" #include "confdefs.h" #include @@ -4074,21 +4137,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4077: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4140: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4080: \$? = $ac_status" >&5 + echo "$as_me:4143: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4083: \"$ac_try\"") >&5 + { (eval echo "$as_me:4146: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4086: \$? = $ac_status" >&5 + echo "$as_me:4149: \$? = $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}:4091: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:4154: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=maybe cf_test_CPPFLAGS="$CPPFLAGS" @@ -4106,7 +4169,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_find_linkage_utf8" = maybe ; then -echo "${as_me:-configure}:4109: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:4172: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" @@ -4203,13 +4266,13 @@ cf_search="$cf_library_path_list $cf_search" 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}:4206: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:4269: 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 4212 "configure" +#line 4275 "configure" #include "confdefs.h" #include @@ -4222,21 +4285,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4225: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4288: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4228: \$? = $ac_status" >&5 + echo "$as_me:4291: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4231: \"$ac_try\"") >&5 + { (eval echo "$as_me:4294: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4234: \$? = $ac_status" >&5 + echo "$as_me:4297: \$? = $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}:4239: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:4302: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" @@ -4278,7 +4341,7 @@ fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4281: result: $cf_cv_utf8_lib" >&5 +echo "$as_me:4344: 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 @@ -4312,7 +4375,7 @@ if test -n "$cf_cv_header_path_utf8" ; then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 4315 "configure" +#line 4378 "configure" #include "confdefs.h" #include int @@ -4324,16 +4387,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4327: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4390: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4330: \$? = $ac_status" >&5 + echo "$as_me:4393: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4333: \"$ac_try\"") >&5 + { (eval echo "$as_me:4396: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4336: \$? = $ac_status" >&5 + echo "$as_me:4399: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -4350,7 +4413,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}:4353: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:4416: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -4384,7 +4447,7 @@ if test -n "$cf_cv_library_path_utf8" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me:-configure}:4387: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:4450: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -4402,7 +4465,7 @@ for ac_prog in ${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:4405: checking for $ac_word" >&5 +echo "$as_me:4468: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4419,7 +4482,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_NCURSES_CONFIG="$ac_dir/$ac_word" - echo "$as_me:4422: found $ac_dir/$ac_word" >&5 + echo "$as_me:4485: found $ac_dir/$ac_word" >&5 break fi done @@ -4430,10 +4493,10 @@ fi NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then - echo "$as_me:4433: result: $NCURSES_CONFIG" >&5 + echo "$as_me:4496: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else - echo "$as_me:4436: result: no" >&5 + echo "$as_me:4499: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4448,7 +4511,7 @@ LIBS="`$NCURSES_CONFIG --libs` $LIBS" # even with config script, some packages use no-override for curses.h -echo "$as_me:4451: checking if we have identified curses headers" >&5 +echo "$as_me:4514: 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 @@ -4462,7 +4525,7 @@ for cf_header in \ ncurses.h do cat >conftest.$ac_ext <<_ACEOF -#line 4465 "configure" +#line 4528 "configure" #include "confdefs.h" #include <${cf_header}> int @@ -4474,16 +4537,16 @@ initscr(); tgoto("?", 0,0) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4477: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4480: \$? = $ac_status" >&5 + echo "$as_me:4543: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4483: \"$ac_try\"") >&5 + { (eval echo "$as_me:4546: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4486: \$? = $ac_status" >&5 + echo "$as_me:4549: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_header=$cf_header; break else @@ -4494,11 +4557,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:4497: result: $cf_cv_ncurses_header" >&5 +echo "$as_me:4560: 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:4501: error: No curses header-files found" >&5 + { { echo "$as_me:4564: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi @@ -4508,23 +4571,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:4511: checking for $ac_header" >&5 +echo "$as_me:4574: 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 4517 "configure" +#line 4580 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:4521: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4584: \"$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:4527: \$? = $ac_status" >&5 + echo "$as_me:4590: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4543,7 +4606,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4546: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:4609: 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 <conftest.$ac_ext <<_ACEOF -#line 4599 "configure" +#line 4662 "configure" #include "confdefs.h" #include int @@ -4608,16 +4671,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4611: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4674: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4614: \$? = $ac_status" >&5 + echo "$as_me:4677: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4617: \"$ac_try\"") >&5 + { (eval echo "$as_me:4680: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4620: \$? = $ac_status" >&5 + echo "$as_me:4683: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -4634,7 +4697,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}:4637: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:4700: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -4651,7 +4714,7 @@ fi } -echo "$as_me:4654: checking for $cf_ncuhdr_root header in include-path" >&5 +echo "$as_me:4717: 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 @@ -4663,7 +4726,7 @@ else do cat >conftest.$ac_ext <<_ACEOF -#line 4666 "configure" +#line 4729 "configure" #include "confdefs.h" #define _XOPEN_SOURCE_EXTENDED @@ -4695,16 +4758,16 @@ printf("old\n"); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4698: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4761: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4701: \$? = $ac_status" >&5 + echo "$as_me:4764: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4704: \"$ac_try\"") >&5 + { (eval echo "$as_me:4767: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4707: \$? = $ac_status" >&5 + echo "$as_me:4770: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h=$cf_header @@ -4719,14 +4782,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:4722: result: $cf_cv_ncurses_h" >&5 +echo "$as_me:4785: 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:4729: checking for $cf_ncuhdr_root include-path" >&5 +echo "$as_me:4792: 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 @@ -4866,7 +4929,7 @@ if test -n "$cf_incdir" ; then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 4869 "configure" +#line 4932 "configure" #include "confdefs.h" #include int @@ -4878,16 +4941,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4881: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4944: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4884: \$? = $ac_status" >&5 + echo "$as_me:4947: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4887: \"$ac_try\"") >&5 + { (eval echo "$as_me:4950: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4890: \$? = $ac_status" >&5 + echo "$as_me:4953: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -4904,7 +4967,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}:4907: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:4970: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -4925,7 +4988,7 @@ fi do cat >conftest.$ac_ext <<_ACEOF -#line 4928 "configure" +#line 4991 "configure" #include "confdefs.h" #include <$cf_header> @@ -4949,16 +5012,16 @@ printf("old\n"); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4952: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5015: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4955: \$? = $ac_status" >&5 + echo "$as_me:5018: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4958: \"$ac_try\"") >&5 + { (eval echo "$as_me:5021: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4961: \$? = $ac_status" >&5 + echo "$as_me:5024: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h2=$cf_header @@ -4979,12 +5042,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:4982: error: not found" >&5 + test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5045: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:4987: result: $cf_cv_ncurses_h2" >&5 +echo "$as_me:5050: 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%/[^/]*$%%'` @@ -5017,7 +5080,7 @@ if test -n "$cf_1st_incdir" ; then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 5020 "configure" +#line 5083 "configure" #include "confdefs.h" #include int @@ -5029,16 +5092,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5032: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5095: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5035: \$? = $ac_status" >&5 + echo "$as_me:5098: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5038: \"$ac_try\"") >&5 + { (eval echo "$as_me:5101: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5041: \$? = $ac_status" >&5 + echo "$as_me:5104: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -5055,7 +5118,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}:5058: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:5121: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -5098,7 +5161,7 @@ EOF ;; esac -echo "$as_me:5101: checking for terminfo header" >&5 +echo "$as_me:5164: 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 @@ -5116,7 +5179,7 @@ esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >conftest.$ac_ext <<_ACEOF -#line 5119 "configure" +#line 5182 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> @@ -5131,16 +5194,16 @@ int x = auto_left_margin } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5134: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5197: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5137: \$? = $ac_status" >&5 + echo "$as_me:5200: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5140: \"$ac_try\"") >&5 + { (eval echo "$as_me:5203: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5143: \$? = $ac_status" >&5 + echo "$as_me:5206: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_term_header="$cf_test" @@ -5156,7 +5219,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:5159: result: $cf_cv_term_header" >&5 +echo "$as_me:5222: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories @@ -5190,7 +5253,7 @@ cat >>confdefs.h <<\EOF #define NCURSES 1 EOF -echo "$as_me:5193: checking for ncurses version" >&5 +echo "$as_me:5256: 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 @@ -5216,10 +5279,10 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo "$as_me:5219: \"$cf_try\"") >&5 + { (eval echo "$as_me:5282: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? - echo "$as_me:5222: \$? = $ac_status" >&5 + echo "$as_me:5285: \$? = $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%".*%%'` @@ -5229,7 +5292,7 @@ EOF else cat >conftest.$ac_ext <<_ACEOF -#line 5232 "configure" +#line 5295 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> @@ -5254,15 +5317,15 @@ int main() } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:5257: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5320: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5260: \$? = $ac_status" >&5 + echo "$as_me:5323: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5262: \"$ac_try\"") >&5 + { (eval echo "$as_me:5325: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5265: \$? = $ac_status" >&5 + echo "$as_me:5328: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -5276,7 +5339,7 @@ fi rm -f $cf_tempfile fi -echo "$as_me:5279: result: $cf_cv_ncurses_version" >&5 +echo "$as_me:5342: 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 @@ -5288,7 +5351,7 @@ cf_nculib_root=ncursesw # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" -echo "$as_me:5291: checking for Gpm_Open in -lgpm" >&5 +echo "$as_me:5354: 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 @@ -5296,7 +5359,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 5299 "configure" +#line 5362 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -5315,16 +5378,16 @@ Gpm_Open (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5318: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5381: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5321: \$? = $ac_status" >&5 + echo "$as_me:5384: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5324: \"$ac_try\"") >&5 + { (eval echo "$as_me:5387: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5327: \$? = $ac_status" >&5 + echo "$as_me:5390: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else @@ -5335,10 +5398,10 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:5338: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "$as_me:5401: 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:5341: checking for initscr in -lgpm" >&5 + echo "$as_me:5404: 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 @@ -5346,7 +5409,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 5349 "configure" +#line 5412 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -5365,16 +5428,16 @@ initscr (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5368: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5431: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5371: \$? = $ac_status" >&5 + echo "$as_me:5434: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5374: \"$ac_try\"") >&5 + { (eval echo "$as_me:5437: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5377: \$? = $ac_status" >&5 + echo "$as_me:5440: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_initscr=yes else @@ -5385,7 +5448,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:5388: result: $ac_cv_lib_gpm_initscr" >&5 +echo "$as_me:5451: 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" @@ -5400,7 +5463,7 @@ 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:5403: checking for tgoto in -lmytinfo" >&5 + echo "$as_me:5466: 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 @@ -5408,7 +5471,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 5411 "configure" +#line 5474 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -5427,16 +5490,16 @@ tgoto (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5430: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5493: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5433: \$? = $ac_status" >&5 + echo "$as_me:5496: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5436: \"$ac_try\"") >&5 + { (eval echo "$as_me:5499: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5439: \$? = $ac_status" >&5 + echo "$as_me:5502: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mytinfo_tgoto=yes else @@ -5447,7 +5510,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:5450: result: $ac_cv_lib_mytinfo_tgoto" >&5 +echo "$as_me:5513: 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" @@ -5466,13 +5529,13 @@ else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" - echo "$as_me:5469: checking for initscr" >&5 + echo "$as_me:5532: 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 5475 "configure" +#line 5538 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr (); below. */ @@ -5503,16 +5566,16 @@ f = initscr; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5506: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5569: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5509: \$? = $ac_status" >&5 + echo "$as_me:5572: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5512: \"$ac_try\"") >&5 + { (eval echo "$as_me:5575: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5515: \$? = $ac_status" >&5 + echo "$as_me:5578: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_initscr=yes else @@ -5522,18 +5585,18 @@ ac_cv_func_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5525: result: $ac_cv_func_initscr" >&5 +echo "$as_me:5588: 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:5532: checking for initscr in -l$cf_nculib_root" >&5 + echo "$as_me:5595: 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 5536 "configure" +#line 5599 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int @@ -5545,25 +5608,25 @@ initscr() } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5548: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5611: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5551: \$? = $ac_status" >&5 + echo "$as_me:5614: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5554: \"$ac_try\"") >&5 + { (eval echo "$as_me:5617: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5557: \$? = $ac_status" >&5 + echo "$as_me:5620: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:5559: result: yes" >&5 + echo "$as_me:5622: 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:5566: result: no" >&5 +echo "$as_me:5629: result: no" >&5 echo "${ECHO_T}no" >&6 cf_search= @@ -5653,80 +5716,17 @@ cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do - echo "$as_me:5656: checking for -l$cf_nculib_root in $cf_libdir" >&5 + echo "$as_me:5719: 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 5660 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5672: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5675: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5678: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5681: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:5683: 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:5690: result: no" >&5 -echo "${ECHO_T}no" >&6 - LIBS="$cf_save_LIBS" -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 - -eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root - -if test $cf_found_library = no ; then - { { echo "$as_me:5705: error: Cannot link $cf_nculib_root library" >&5 -echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - -if test -n "$cf_ncurses_LIBS" ; then - echo "$as_me:5713: 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 - q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` - if test "$q" != "$LIBS" ; then - LIBS="$q" - fi - done - cat >conftest.$ac_ext <<_ACEOF #line 5723 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { -initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); +initscr() ; return 0; } @@ -5745,10 +5745,73 @@ if { (eval echo "$as_me:5735: \"$ac_link\"") >&5 (exit $ac_status); }; }; then echo "$as_me:5746: 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:5751: result: no" >&5 +echo "$as_me:5753: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_save_LIBS" +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 + +eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root + +if test $cf_found_library = no ; then + { { echo "$as_me:5768: error: Cannot link $cf_nculib_root library" >&5 +echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +if test -n "$cf_ncurses_LIBS" ; then + echo "$as_me:5776: 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 + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + cat >conftest.$ac_ext <<_ACEOF +#line 5786 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +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:5798: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5801: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5804: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5807: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:5809: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:5814: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi @@ -5772,7 +5835,7 @@ for ac_prog in ${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:5775: checking for $ac_word" >&5 +echo "$as_me:5838: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5789,7 +5852,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_NCURSES_CONFIG="$ac_dir/$ac_word" - echo "$as_me:5792: found $ac_dir/$ac_word" >&5 + echo "$as_me:5855: found $ac_dir/$ac_word" >&5 break fi done @@ -5800,10 +5863,10 @@ fi NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then - echo "$as_me:5803: result: $NCURSES_CONFIG" >&5 + echo "$as_me:5866: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else - echo "$as_me:5806: result: no" >&5 + echo "$as_me:5869: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -5818,7 +5881,7 @@ LIBS="`$NCURSES_CONFIG --libs` $LIBS" # even with config script, some packages use no-override for curses.h -echo "$as_me:5821: checking if we have identified curses headers" >&5 +echo "$as_me:5884: 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 @@ -5832,7 +5895,7 @@ for cf_header in \ ncurses.h do cat >conftest.$ac_ext <<_ACEOF -#line 5835 "configure" +#line 5898 "configure" #include "confdefs.h" #include <${cf_header}> int @@ -5844,16 +5907,16 @@ initscr(); tgoto("?", 0,0) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5847: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5910: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5850: \$? = $ac_status" >&5 + echo "$as_me:5913: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5853: \"$ac_try\"") >&5 + { (eval echo "$as_me:5916: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5856: \$? = $ac_status" >&5 + echo "$as_me:5919: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_header=$cf_header; break else @@ -5864,11 +5927,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:5867: result: $cf_cv_ncurses_header" >&5 +echo "$as_me:5930: 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:5871: error: No curses header-files found" >&5 + { { echo "$as_me:5934: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi @@ -5878,23 +5941,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:5881: checking for $ac_header" >&5 +echo "$as_me:5944: 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 5887 "configure" +#line 5950 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:5891: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:5954: \"$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:5897: \$? = $ac_status" >&5 + echo "$as_me:5960: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -5913,7 +5976,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:5916: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:5979: 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 <conftest.$ac_ext <<_ACEOF -#line 5969 "configure" +#line 6032 "configure" #include "confdefs.h" #include int @@ -5978,16 +6041,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5981: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6044: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5984: \$? = $ac_status" >&5 + echo "$as_me:6047: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5987: \"$ac_try\"") >&5 + { (eval echo "$as_me:6050: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5990: \$? = $ac_status" >&5 + echo "$as_me:6053: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6004,7 +6067,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}:6007: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:6070: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -6021,7 +6084,7 @@ fi } -echo "$as_me:6024: checking for $cf_ncuhdr_root header in include-path" >&5 +echo "$as_me:6087: 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 @@ -6033,7 +6096,7 @@ else do cat >conftest.$ac_ext <<_ACEOF -#line 6036 "configure" +#line 6099 "configure" #include "confdefs.h" #include <$cf_header> @@ -6057,16 +6120,16 @@ printf("old\n"); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6060: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6123: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6063: \$? = $ac_status" >&5 + echo "$as_me:6126: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6066: \"$ac_try\"") >&5 + { (eval echo "$as_me:6129: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6069: \$? = $ac_status" >&5 + echo "$as_me:6132: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h=$cf_header @@ -6081,14 +6144,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:6084: result: $cf_cv_ncurses_h" >&5 +echo "$as_me:6147: 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:6091: checking for $cf_ncuhdr_root include-path" >&5 +echo "$as_me:6154: 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 @@ -6228,7 +6291,7 @@ if test -n "$cf_incdir" ; then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 6231 "configure" +#line 6294 "configure" #include "confdefs.h" #include int @@ -6240,16 +6303,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6243: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6306: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6246: \$? = $ac_status" >&5 + echo "$as_me:6309: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6249: \"$ac_try\"") >&5 + { (eval echo "$as_me:6312: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6252: \$? = $ac_status" >&5 + echo "$as_me:6315: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6266,7 +6329,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}:6269: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:6332: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -6287,7 +6350,7 @@ fi do cat >conftest.$ac_ext <<_ACEOF -#line 6290 "configure" +#line 6353 "configure" #include "confdefs.h" #include <$cf_header> @@ -6311,16 +6374,16 @@ printf("old\n"); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6314: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6377: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6317: \$? = $ac_status" >&5 + echo "$as_me:6380: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6320: \"$ac_try\"") >&5 + { (eval echo "$as_me:6383: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6323: \$? = $ac_status" >&5 + echo "$as_me:6386: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_h2=$cf_header @@ -6341,12 +6404,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:6344: error: not found" >&5 + test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6407: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:6349: result: $cf_cv_ncurses_h2" >&5 +echo "$as_me:6412: 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%/[^/]*$%%'` @@ -6379,7 +6442,7 @@ if test -n "$cf_1st_incdir" ; then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 6382 "configure" +#line 6445 "configure" #include "confdefs.h" #include int @@ -6391,16 +6454,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6394: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6457: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6397: \$? = $ac_status" >&5 + echo "$as_me:6460: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6400: \"$ac_try\"") >&5 + { (eval echo "$as_me:6463: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6403: \$? = $ac_status" >&5 + echo "$as_me:6466: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6417,7 +6480,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}:6420: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:6483: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" @@ -6460,7 +6523,7 @@ EOF ;; esac -echo "$as_me:6463: checking for terminfo header" >&5 +echo "$as_me:6526: 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 @@ -6478,7 +6541,7 @@ esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >conftest.$ac_ext <<_ACEOF -#line 6481 "configure" +#line 6544 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> @@ -6493,16 +6556,16 @@ int x = auto_left_margin } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6496: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6559: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6499: \$? = $ac_status" >&5 + echo "$as_me:6562: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6502: \"$ac_try\"") >&5 + { (eval echo "$as_me:6565: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6505: \$? = $ac_status" >&5 + echo "$as_me:6568: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_term_header="$cf_test" @@ -6518,7 +6581,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:6521: result: $cf_cv_term_header" >&5 +echo "$as_me:6584: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories @@ -6552,7 +6615,7 @@ cat >>confdefs.h <<\EOF #define NCURSES 1 EOF -echo "$as_me:6555: checking for ncurses version" >&5 +echo "$as_me:6618: 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 @@ -6578,10 +6641,10 @@ Autoconf "old" #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo "$as_me:6581: \"$cf_try\"") >&5 + { (eval echo "$as_me:6644: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? - echo "$as_me:6584: \$? = $ac_status" >&5 + echo "$as_me:6647: \$? = $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%".*%%'` @@ -6591,7 +6654,7 @@ EOF else cat >conftest.$ac_ext <<_ACEOF -#line 6594 "configure" +#line 6657 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> @@ -6616,15 +6679,15 @@ int main() } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:6619: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6682: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6622: \$? = $ac_status" >&5 + echo "$as_me:6685: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6624: \"$ac_try\"") >&5 + { (eval echo "$as_me:6687: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6627: \$? = $ac_status" >&5 + echo "$as_me:6690: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` @@ -6638,7 +6701,7 @@ fi rm -f $cf_tempfile fi -echo "$as_me:6641: result: $cf_cv_ncurses_version" >&5 +echo "$as_me:6704: 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 @@ -6650,7 +6713,7 @@ cf_nculib_root=ncurses # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" -echo "$as_me:6653: checking for Gpm_Open in -lgpm" >&5 +echo "$as_me:6716: 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 @@ -6658,7 +6721,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 6661 "configure" +#line 6724 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -6677,16 +6740,16 @@ Gpm_Open (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6680: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6743: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6683: \$? = $ac_status" >&5 + echo "$as_me:6746: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6686: \"$ac_try\"") >&5 + { (eval echo "$as_me:6749: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6689: \$? = $ac_status" >&5 + echo "$as_me:6752: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else @@ -6697,10 +6760,10 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:6700: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "$as_me:6763: 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:6703: checking for initscr in -lgpm" >&5 + echo "$as_me:6766: 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 @@ -6708,7 +6771,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 6711 "configure" +#line 6774 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -6727,16 +6790,16 @@ initscr (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6730: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6793: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6733: \$? = $ac_status" >&5 + echo "$as_me:6796: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6736: \"$ac_try\"") >&5 + { (eval echo "$as_me:6799: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6739: \$? = $ac_status" >&5 + echo "$as_me:6802: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_initscr=yes else @@ -6747,7 +6810,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:6750: result: $ac_cv_lib_gpm_initscr" >&5 +echo "$as_me:6813: 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" @@ -6762,7 +6825,7 @@ 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:6765: checking for tgoto in -lmytinfo" >&5 + echo "$as_me:6828: 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 @@ -6770,7 +6833,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 6773 "configure" +#line 6836 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -6789,16 +6852,16 @@ tgoto (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6792: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6855: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6795: \$? = $ac_status" >&5 + echo "$as_me:6858: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6798: \"$ac_try\"") >&5 + { (eval echo "$as_me:6861: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6801: \$? = $ac_status" >&5 + echo "$as_me:6864: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mytinfo_tgoto=yes else @@ -6809,7 +6872,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:6812: result: $ac_cv_lib_mytinfo_tgoto" >&5 +echo "$as_me:6875: 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" @@ -6828,13 +6891,13 @@ else eval 'cf_cv_have_lib_'$cf_nculib_root'=no' cf_libdir="" - echo "$as_me:6831: checking for initscr" >&5 + echo "$as_me:6894: 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 6837 "configure" +#line 6900 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char initscr (); below. */ @@ -6865,16 +6928,16 @@ f = initscr; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6868: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6931: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6871: \$? = $ac_status" >&5 + echo "$as_me:6934: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6874: \"$ac_try\"") >&5 + { (eval echo "$as_me:6937: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6877: \$? = $ac_status" >&5 + echo "$as_me:6940: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_initscr=yes else @@ -6884,18 +6947,18 @@ ac_cv_func_initscr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6887: result: $ac_cv_func_initscr" >&5 +echo "$as_me:6950: 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:6894: checking for initscr in -l$cf_nculib_root" >&5 + echo "$as_me:6957: 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 6898 "configure" +#line 6961 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int @@ -6907,25 +6970,25 @@ initscr() } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6910: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6973: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6913: \$? = $ac_status" >&5 + echo "$as_me:6976: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6916: \"$ac_try\"") >&5 + { (eval echo "$as_me:6979: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6919: \$? = $ac_status" >&5 + echo "$as_me:6982: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:6921: result: yes" >&5 + echo "$as_me:6984: 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:6928: result: no" >&5 +echo "$as_me:6991: result: no" >&5 echo "${ECHO_T}no" >&6 cf_search= @@ -7015,80 +7078,17 @@ cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do - echo "$as_me:7018: checking for -l$cf_nculib_root in $cf_libdir" >&5 + echo "$as_me:7081: 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 7022 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7034: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7037: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7040: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7043: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:7045: 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:7052: result: no" >&5 -echo "${ECHO_T}no" >&6 - LIBS="$cf_save_LIBS" -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 - -eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root - -if test $cf_found_library = no ; then - { { echo "$as_me:7067: error: Cannot link $cf_nculib_root library" >&5 -echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - -if test -n "$cf_ncurses_LIBS" ; then - echo "$as_me:7075: 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 - q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` - if test "$q" != "$LIBS" ; then - LIBS="$q" - fi - done - cat >conftest.$ac_ext <<_ACEOF #line 7085 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main () { -initscr(); mousemask(0,0); tgoto((char *)0, 0, 0); +initscr() ; return 0; } @@ -7107,10 +7107,73 @@ if { (eval echo "$as_me:7097: \"$ac_link\"") >&5 (exit $ac_status); }; }; then echo "$as_me:7108: 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:7113: result: no" >&5 +echo "$as_me:7115: result: no" >&5 +echo "${ECHO_T}no" >&6 + LIBS="$cf_save_LIBS" +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 + +eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root + +if test $cf_found_library = no ; then + { { echo "$as_me:7130: error: Cannot link $cf_nculib_root library" >&5 +echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +if test -n "$cf_ncurses_LIBS" ; then + echo "$as_me:7138: 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 + q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` + if test "$q" != "$LIBS" ; then + LIBS="$q" + fi + done + cat >conftest.$ac_ext <<_ACEOF +#line 7148 "configure" +#include "confdefs.h" +#include <${cf_cv_ncurses_header:-curses.h}> +int +main () +{ +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:7160: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:7163: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:7166: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:7169: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:7171: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:7176: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi @@ -7132,8 +7195,8 @@ if test "$NCURSES_CONFIG" != none ; then cf_version=`$NCURSES_CONFIG --version` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` -NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9]\+\.//' -e 's/\..*//'` -NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9]\+\.[0-9]\+\.//'` +NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.//' -e 's/\..*//'` +NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.//'` # ABI version is not available from headers cf_cv_abi_version=`$NCURSES_CONFIG --abi-version` @@ -7147,16 +7210,16 @@ cat >conftest.$ac_ext <&5 + { (eval echo "$as_me:7213: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? - echo "$as_me:7153: \$? = $ac_status" >&5 + echo "$as_me:7216: \$? = $ac_status" >&5 (exit $ac_status); } if test -f conftest.out ; then - cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[ ]\+//"` - eval NCURSES_$cf_name=$cf_result - cat conftest.$ac_ext - cat conftest.out + cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[ ][ ]*//"` + eval NCURSES_$cf_name=\"$cf_result\" + # cat conftest.$ac_ext + # cat conftest.out fi done @@ -7168,7 +7231,7 @@ cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} cf_cv_timestamp=`date` -echo "$as_me:7171: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "$as_me:7234: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 case $cf_cv_system_name in #(vi @@ -7191,7 +7254,7 @@ if test X"$CC_G_OPT" = X"" ; then test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT='' fi -echo "$as_me:7194: checking for default loader flags" >&5 +echo "$as_me:7257: checking for default loader flags" >&5 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in normal) LD_MODEL='' ;; @@ -7199,11 +7262,11 @@ debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; shared) LD_MODEL='' ;; esac -echo "$as_me:7202: result: $LD_MODEL" >&5 +echo "$as_me:7265: result: $LD_MODEL" >&5 echo "${ECHO_T}$LD_MODEL" >&6 LD_RPATH_OPT= -echo "$as_me:7206: checking for an rpath option" >&5 +echo "$as_me:7269: 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 @@ -7234,17 +7297,17 @@ solaris2*) #(vi *) ;; esac -echo "$as_me:7237: result: $LD_RPATH_OPT" >&5 +echo "$as_me:7300: result: $LD_RPATH_OPT" >&5 echo "${ECHO_T}$LD_RPATH_OPT" >&6 case "x$LD_RPATH_OPT" in #(vi x-R*) - echo "$as_me:7242: checking if we need a space after rpath option" >&5 + echo "$as_me:7305: 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" LIBS="${LD_RPATH_OPT}$libdir $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7247 "configure" +#line 7310 "configure" #include "confdefs.h" int @@ -7256,16 +7319,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7259: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7322: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7262: \$? = $ac_status" >&5 + echo "$as_me:7325: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7265: \"$ac_try\"") >&5 + { (eval echo "$as_me:7328: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7268: \$? = $ac_status" >&5 + echo "$as_me:7331: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_rpath_space=no else @@ -7275,7 +7338,7 @@ cf_rpath_space=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:7278: result: $cf_rpath_space" >&5 + echo "$as_me:7341: result: $cf_rpath_space" >&5 echo "${ECHO_T}$cf_rpath_space" >&6 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " ;; @@ -7290,7 +7353,7 @@ esac cf_ld_rpath_opt= test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" - echo "$as_me:7293: checking if release/abi version should be used for shared libs" >&5 + echo "$as_me:7356: checking if release/abi version should be used for shared libs" >&5 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 # Check whether --with-shlib-version or --without-shlib-version was given. @@ -7305,7 +7368,7 @@ if test "${with_shlib_version+set}" = set; then cf_cv_shlib_version=$withval ;; *) - { { echo "$as_me:7308: error: option value must be one of: rel, abi, auto or no" >&5 + { { echo "$as_me:7371: error: option value must be one of: rel, abi, auto or no" >&5 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} { (exit 1); exit 1; }; } ;; @@ -7314,7 +7377,7 @@ echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} else cf_cv_shlib_version=auto fi; - echo "$as_me:7317: result: $cf_cv_shlib_version" >&5 + echo "$as_me:7380: result: $cf_cv_shlib_version" >&5 echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no @@ -7323,14 +7386,14 @@ echo "${ECHO_T}$cf_cv_shlib_version" >&6 CC_SHARED_OPTS= if test "$GCC" = yes then - echo "$as_me:7326: checking which $CC option to use" >&5 + echo "$as_me:7389: checking which $CC option to use" >&5 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat >conftest.$ac_ext <<_ACEOF -#line 7333 "configure" +#line 7396 "configure" #include "confdefs.h" #include int @@ -7342,16 +7405,16 @@ int x = 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7345: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7408: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7348: \$? = $ac_status" >&5 + echo "$as_me:7411: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7351: \"$ac_try\"") >&5 + { (eval echo "$as_me:7414: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7354: \$? = $ac_status" >&5 + echo "$as_me:7417: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7360,7 +7423,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done - echo "$as_me:7363: result: $CC_SHARED_OPTS" >&5 + echo "$as_me:7426: result: $CC_SHARED_OPTS" >&5 echo "${ECHO_T}$CC_SHARED_OPTS" >&6 CFLAGS="$cf_save_CFLAGS" fi @@ -7402,7 +7465,7 @@ CF_EOF MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes - echo "$as_me:7405: checking if ld -search_paths_first works" >&5 + echo "$as_me:7468: checking if ld -search_paths_first works" >&5 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7411,7 +7474,7 @@ else cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF -#line 7414 "configure" +#line 7477 "configure" #include "confdefs.h" int @@ -7423,16 +7486,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7426: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7489: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7429: \$? = $ac_status" >&5 + echo "$as_me:7492: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7432: \"$ac_try\"") >&5 + { (eval echo "$as_me:7495: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7435: \$? = $ac_status" >&5 + echo "$as_me:7498: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ldflags_search_paths_first=yes else @@ -7443,7 +7506,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS=$cf_save_LDFLAGS fi -echo "$as_me:7446: result: $cf_cv_ldflags_search_paths_first" >&5 +echo "$as_me:7509: result: $cf_cv_ldflags_search_paths_first" >&5 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" @@ -7623,7 +7686,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 do CFLAGS="$cf_shared_opts $cf_save_CFLAGS" cat >conftest.$ac_ext <<_ACEOF -#line 7626 "configure" +#line 7689 "configure" #include "confdefs.h" #include int @@ -7635,16 +7698,16 @@ printf("Hello\n"); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7638: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7701: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7641: \$? = $ac_status" >&5 + echo "$as_me:7704: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7644: \"$ac_try\"") >&5 + { (eval echo "$as_me:7707: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7647: \$? = $ac_status" >&5 + echo "$as_me:7710: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7681,7 +7744,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) - { echo "$as_me:7684: WARNING: ignored --with-shlib-version" >&5 + { echo "$as_me:7747: WARNING: ignored --with-shlib-version" >&5 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac @@ -7692,6 +7755,29 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi +# The test/sample programs in the original tree link using rpath option. +# Make it optional for packagers. +if test -n "$LOCAL_LDFLAGS" +then + echo "$as_me:7762: checking if you want to link sample programs with rpath option" >&5 +echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6 + +# Check whether --enable-rpath-link or --disable-rpath-link was given. +if test "${enable_rpath_link+set}" = set; then + enableval="$enable_rpath_link" + with_rpath_link=$enableval +else + with_rpath_link=yes +fi; + echo "$as_me:7772: result: $with_rpath_link" >&5 +echo "${ECHO_T}$with_rpath_link" >&6 + if test "$with_rpath_link" = no + then + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= + fi +fi + ############################################################################### case $cf_cv_system_name in @@ -7700,7 +7786,7 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} esac ### use option --enable-broken-linker to force on use of broken-linker support -echo "$as_me:7703: checking if you want broken-linker support code" >&5 +echo "$as_me:7789: checking if you want broken-linker support code" >&5 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. @@ -7710,7 +7796,7 @@ if test "${enable_broken_linker+set}" = set; then else with_broken_linker=${BROKEN_LINKER:-no} fi; -echo "$as_me:7713: result: $with_broken_linker" >&5 +echo "$as_me:7799: result: $with_broken_linker" >&5 echo "${ECHO_T}$with_broken_linker" >&6 BROKEN_LINKER=0 @@ -7730,7 +7816,7 @@ EOF BROKEN_LINKER=1 test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 -echo "${as_me:-configure}:7733: testing cygwin linker is broken anyway ..." 1>&5 +echo "${as_me:-configure}:7819: testing cygwin linker is broken anyway ..." 1>&5 ;; esac @@ -7746,6 +7832,9 @@ case $host_os in #(vi aix[456]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; darwin[0-8].*) #(vi cf_xopen_source="-D_APPLE_C_SOURCE" ;; @@ -7771,14 +7860,14 @@ irix[56].*) #(vi ;; linux*|gnu*|mint*|k*bsd*-gnu) #(vi -echo "$as_me:7774: checking if we must define _GNU_SOURCE" >&5 +echo "$as_me:7863: 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 7781 "configure" +#line 7870 "configure" #include "confdefs.h" #include int @@ -7793,16 +7882,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7796: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7885: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7799: \$? = $ac_status" >&5 + echo "$as_me:7888: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7802: \"$ac_try\"") >&5 + { (eval echo "$as_me:7891: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7805: \$? = $ac_status" >&5 + echo "$as_me:7894: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -7811,7 +7900,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 7814 "configure" +#line 7903 "configure" #include "confdefs.h" #include int @@ -7826,16 +7915,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7829: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7918: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7832: \$? = $ac_status" >&5 + echo "$as_me:7921: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7835: \"$ac_try\"") >&5 + { (eval echo "$as_me:7924: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7838: \$? = $ac_status" >&5 + echo "$as_me:7927: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -7850,7 +7939,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7853: result: $cf_cv_gnu_source" >&5 +echo "$as_me:7942: 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" @@ -7880,14 +7969,14 @@ solaris2.[1-9]) #(vi cf_xopen_source="-D__EXTENSIONS__" ;; *) - echo "$as_me:7883: checking if we should define _XOPEN_SOURCE" >&5 + echo "$as_me:7972: 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 7890 "configure" +#line 7979 "configure" #include "confdefs.h" #include int @@ -7902,16 +7991,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7905: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7994: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7908: \$? = $ac_status" >&5 + echo "$as_me:7997: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7911: \"$ac_try\"") >&5 + { (eval echo "$as_me:8000: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7914: \$? = $ac_status" >&5 + echo "$as_me:8003: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -7920,7 +8009,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 7923 "configure" +#line 8012 "configure" #include "confdefs.h" #include int @@ -7935,16 +8024,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7938: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8027: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7941: \$? = $ac_status" >&5 + echo "$as_me:8030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7944: \"$ac_try\"") >&5 + { (eval echo "$as_me:8033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7947: \$? = $ac_status" >&5 + echo "$as_me:8036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -7959,7 +8048,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7962: result: $cf_cv_xopen_source" >&5 +echo "$as_me:8051: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then @@ -8066,16 +8155,16 @@ 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:8069: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:8158: 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}:8075: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:8164: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 8078 "configure" +#line 8167 "configure" #include "confdefs.h" #include int @@ -8090,16 +8179,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8093: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8182: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8096: \$? = $ac_status" >&5 + echo "$as_me:8185: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8099: \"$ac_try\"") >&5 + { (eval echo "$as_me:8188: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8102: \$? = $ac_status" >&5 + echo "$as_me:8191: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -8120,7 +8209,7 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 8123 "configure" +#line 8212 "configure" #include "confdefs.h" #include int @@ -8135,16 +8224,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8138: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8227: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8141: \$? = $ac_status" >&5 + echo "$as_me:8230: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8144: \"$ac_try\"") >&5 + { (eval echo "$as_me:8233: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8147: \$? = $ac_status" >&5 + echo "$as_me:8236: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -8155,15 +8244,15 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me:-configure}:8158: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:8247: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "${as_me:-configure}:8163: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:8252: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 8166 "configure" +#line 8255 "configure" #include "confdefs.h" #include int @@ -8178,16 +8267,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8181: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8270: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8184: \$? = $ac_status" >&5 + echo "$as_me:8273: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8187: \"$ac_try\"") >&5 + { (eval echo "$as_me:8276: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8190: \$? = $ac_status" >&5 + echo "$as_me:8279: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -8203,7 +8292,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8206: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:8295: 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 @@ -8382,7 +8471,7 @@ if test "${enable_largefile+set}" = set; then fi; if test "$enable_largefile" != no; then - echo "$as_me:8385: checking for special C compiler options needed for large files" >&5 + echo "$as_me:8474: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8394,7 +8483,7 @@ else # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF -#line 8397 "configure" +#line 8486 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8414,16 +8503,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8417: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8506: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8420: \$? = $ac_status" >&5 + echo "$as_me:8509: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8423: \"$ac_try\"") >&5 + { (eval echo "$as_me:8512: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8426: \$? = $ac_status" >&5 + echo "$as_me:8515: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8433,16 +8522,16 @@ fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext -if { (eval echo "$as_me:8436: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8525: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8439: \$? = $ac_status" >&5 + echo "$as_me:8528: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8442: \"$ac_try\"") >&5 + { (eval echo "$as_me:8531: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8445: \$? = $ac_status" >&5 + echo "$as_me:8534: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else @@ -8456,13 +8545,13 @@ rm -f conftest.$ac_objext rm -f conftest.$ac_ext fi fi -echo "$as_me:8459: result: $ac_cv_sys_largefile_CC" >&5 +echo "$as_me:8548: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:8465: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + echo "$as_me:8554: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8470,7 +8559,7 @@ else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF -#line 8473 "configure" +#line 8562 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8490,16 +8579,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8493: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8582: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8496: \$? = $ac_status" >&5 + echo "$as_me:8585: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8499: \"$ac_try\"") >&5 + { (eval echo "$as_me:8588: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8502: \$? = $ac_status" >&5 + echo "$as_me:8591: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8508,7 +8597,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8511 "configure" +#line 8600 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include @@ -8529,16 +8618,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8532: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8621: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8535: \$? = $ac_status" >&5 + echo "$as_me:8624: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8538: \"$ac_try\"") >&5 + { (eval echo "$as_me:8627: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8541: \$? = $ac_status" >&5 + echo "$as_me:8630: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else @@ -8549,7 +8638,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8552: result: $ac_cv_sys_file_offset_bits" >&5 +echo "$as_me:8641: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then @@ -8559,7 +8648,7 @@ EOF fi rm -rf conftest* - echo "$as_me:8562: checking for _LARGE_FILES value needed for large files" >&5 + echo "$as_me:8651: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8567,7 +8656,7 @@ else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF -#line 8570 "configure" +#line 8659 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8587,16 +8676,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8590: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8679: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8593: \$? = $ac_status" >&5 + echo "$as_me:8682: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8596: \"$ac_try\"") >&5 + { (eval echo "$as_me:8685: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8599: \$? = $ac_status" >&5 + echo "$as_me:8688: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8605,7 +8694,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8608 "configure" +#line 8697 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include @@ -8626,16 +8715,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8629: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8718: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8632: \$? = $ac_status" >&5 + echo "$as_me:8721: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8635: \"$ac_try\"") >&5 + { (eval echo "$as_me:8724: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8638: \$? = $ac_status" >&5 + echo "$as_me:8727: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else @@ -8646,7 +8735,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8649: result: $ac_cv_sys_large_files" >&5 +echo "$as_me:8738: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then @@ -8659,7 +8748,7 @@ rm -rf conftest* fi if test "$enable_largefile" != no ; then - echo "$as_me:8662: checking for _LARGEFILE_SOURCE value needed for large files" >&5 + echo "$as_me:8751: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8667,7 +8756,7 @@ else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF -#line 8670 "configure" +#line 8759 "configure" #include "confdefs.h" #include int @@ -8679,16 +8768,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8682: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8771: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8685: \$? = $ac_status" >&5 + echo "$as_me:8774: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8688: \"$ac_try\"") >&5 + { (eval echo "$as_me:8777: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8691: \$? = $ac_status" >&5 + echo "$as_me:8780: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8697,7 +8786,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8700 "configure" +#line 8789 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include @@ -8710,16 +8799,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8713: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8802: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8716: \$? = $ac_status" >&5 + echo "$as_me:8805: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8719: \"$ac_try\"") >&5 + { (eval echo "$as_me:8808: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8722: \$? = $ac_status" >&5 + echo "$as_me:8811: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else @@ -8730,7 +8819,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8733: result: $ac_cv_sys_largefile_source" >&5 +echo "$as_me:8822: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then @@ -8744,13 +8833,13 @@ rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -echo "$as_me:8747: checking for fseeko" >&5 +echo "$as_me:8836: checking for fseeko" >&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8753 "configure" +#line 8842 "configure" #include "confdefs.h" #include int @@ -8762,16 +8851,16 @@ return fseeko && fseeko (stdin, 0, 0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8765: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8854: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8768: \$? = $ac_status" >&5 + echo "$as_me:8857: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8771: \"$ac_try\"") >&5 + { (eval echo "$as_me:8860: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8774: \$? = $ac_status" >&5 + echo "$as_me:8863: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else @@ -8781,7 +8870,7 @@ ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:8784: result: $ac_cv_func_fseeko" >&5 +echo "$as_me:8873: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then @@ -8802,14 +8891,14 @@ fi test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " - echo "$as_me:8805: checking whether to use struct dirent64" >&5 + echo "$as_me:8894: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8812 "configure" +#line 8901 "configure" #include "confdefs.h" #include @@ -8830,16 +8919,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8922: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8836: \$? = $ac_status" >&5 + echo "$as_me:8925: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8839: \"$ac_try\"") >&5 + { (eval echo "$as_me:8928: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8842: \$? = $ac_status" >&5 + echo "$as_me:8931: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else @@ -8850,7 +8939,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8853: result: $cf_cv_struct_dirent64" >&5 +echo "$as_me:8942: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 @@ -8859,7 +8948,7 @@ EOF fi ### Enable compiling-in rcs id's -echo "$as_me:8862: checking if RCS identifiers should be compiled-in" >&5 +echo "$as_me:8951: checking if RCS identifiers should be compiled-in" >&5 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. @@ -8869,7 +8958,7 @@ if test "${with_rcs_ids+set}" = set; then else with_rcs_ids=no fi; -echo "$as_me:8872: result: $with_rcs_ids" >&5 +echo "$as_me:8961: result: $with_rcs_ids" >&5 echo "${ECHO_T}$with_rcs_ids" >&6 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 @@ -8878,7 +8967,7 @@ EOF ############################################################################### ### Note that some functions (such as const) are normally disabled anyway. -echo "$as_me:8881: checking if you want to build with function extensions" >&5 +echo "$as_me:8970: checking if you want to build with function extensions" >&5 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. @@ -8888,7 +8977,7 @@ if test "${enable_ext_funcs+set}" = set; then else with_ext_funcs=yes fi; -echo "$as_me:8891: result: $with_ext_funcs" >&5 +echo "$as_me:8980: result: $with_ext_funcs" >&5 echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 @@ -8905,7 +8994,7 @@ else fi ### use option --enable-const to turn on use of const beyond that in XSI. -echo "$as_me:8908: checking for extended use of const keyword" >&5 +echo "$as_me:8997: checking for extended use of const keyword" >&5 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. @@ -8915,7 +9004,7 @@ if test "${enable_const+set}" = set; then else with_ext_const=no fi; -echo "$as_me:8918: result: $with_ext_const" >&5 +echo "$as_me:9007: result: $with_ext_const" >&5 echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then @@ -8925,7 +9014,7 @@ fi ############################################################################### # These options are relatively safe to experiment with. -echo "$as_me:8928: checking if you want all development code" >&5 +echo "$as_me:9017: checking if you want all development code" >&5 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. @@ -8935,7 +9024,7 @@ if test "${with_develop+set}" = set; then else with_develop=no fi; -echo "$as_me:8938: result: $with_develop" >&5 +echo "$as_me:9027: result: $with_develop" >&5 echo "${ECHO_T}$with_develop" >&6 ############################################################################### @@ -8944,7 +9033,7 @@ echo "${ECHO_T}$with_develop" >&6 # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. -echo "$as_me:8947: checking if you want to link with the pthread library" >&5 +echo "$as_me:9036: checking if you want to link with the pthread library" >&5 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 # Check whether --with-pthread or --without-pthread was given. @@ -8954,27 +9043,27 @@ if test "${with_pthread+set}" = set; then else with_pthread=no fi; -echo "$as_me:8957: result: $with_pthread" >&5 +echo "$as_me:9046: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" != no ; then - echo "$as_me:8961: checking for pthread.h" >&5 + echo "$as_me:9050: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8967 "configure" +#line 9056 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:8971: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:9060: \"$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:8977: \$? = $ac_status" >&5 + echo "$as_me:9066: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -8993,7 +9082,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:8996: result: $ac_cv_header_pthread_h" >&5 +echo "$as_me:9085: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 if test $ac_cv_header_pthread_h = yes; then @@ -9001,12 +9090,12 @@ if test $ac_cv_header_pthread_h = yes; then #define HAVE_PTHREADS_H 1 EOF - echo "$as_me:9004: checking if we can link with the pthread library" >&5 + echo "$as_me:9093: checking if we can link with the pthread library" >&5 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6 cf_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 9009 "configure" +#line 9098 "configure" #include "confdefs.h" #include @@ -9022,16 +9111,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9025: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9114: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9028: \$? = $ac_status" >&5 + echo "$as_me:9117: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9031: \"$ac_try\"") >&5 + { (eval echo "$as_me:9120: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9034: \$? = $ac_status" >&5 + echo "$as_me:9123: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_pthread=yes else @@ -9041,7 +9130,7 @@ with_pthread=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:9044: result: $with_pthread" >&5 + echo "$as_me:9133: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" = yes ; then @@ -9051,7 +9140,7 @@ echo "${ECHO_T}$with_pthread" >&6 EOF else - { { echo "$as_me:9054: error: Cannot link with pthread library" >&5 + { { echo "$as_me:9143: error: Cannot link with pthread library" >&5 echo "$as_me: error: Cannot link with pthread library" >&2;} { (exit 1); exit 1; }; } fi @@ -9060,7 +9149,7 @@ fi fi -echo "$as_me:9063: checking if you want to use weak-symbols for pthreads" >&5 +echo "$as_me:9152: checking if you want to use weak-symbols for pthreads" >&5 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 # Check whether --enable-weak-symbols or --disable-weak-symbols was given. @@ -9070,18 +9159,18 @@ if test "${enable_weak_symbols+set}" = set; then else use_weak_symbols=no fi; -echo "$as_me:9073: result: $use_weak_symbols" >&5 +echo "$as_me:9162: result: $use_weak_symbols" >&5 echo "${ECHO_T}$use_weak_symbols" >&6 if test "$use_weak_symbols" = yes ; then -echo "$as_me:9077: checking if $CC supports weak symbols" >&5 +echo "$as_me:9166: checking if $CC supports weak symbols" >&5 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 if test "${cf_cv_weak_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9084 "configure" +#line 9173 "configure" #include "confdefs.h" #include @@ -9107,16 +9196,16 @@ weak_symbol(fopen); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9110: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9199: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9113: \$? = $ac_status" >&5 + echo "$as_me:9202: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9116: \"$ac_try\"") >&5 + { (eval echo "$as_me:9205: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9119: \$? = $ac_status" >&5 + echo "$as_me:9208: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_weak_symbols=yes else @@ -9127,7 +9216,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9130: result: $cf_cv_weak_symbols" >&5 +echo "$as_me:9219: result: $cf_cv_weak_symbols" >&5 echo "${ECHO_T}$cf_cv_weak_symbols" >&6 else @@ -9153,11 +9242,76 @@ EOF fi fi +# OpenSUSE is installing ncurses6, using reentrant option. +echo "$as_me:9246: checking for _nc_TABSIZE" >&5 +echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6 +if test "${ac_cv_func__nc_TABSIZE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 9252 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _nc_TABSIZE (); below. */ +#include +/* 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_TABSIZE (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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__nc_TABSIZE) || defined (__stub____nc_TABSIZE) +choke me +#else +f = _nc_TABSIZE; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:9283: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:9286: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:9289: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:9292: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func__nc_TABSIZE=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func__nc_TABSIZE=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:9302: result: $ac_cv_func__nc_TABSIZE" >&5 +echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6 +if test $ac_cv_func__nc_TABSIZE = yes; then + assume_reentrant=yes +else + assume_reentrant=no +fi + # Reentrant code has to be opaque; there's little advantage to making ncurses # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. -echo "$as_me:9160: checking if you want experimental reentrant code" >&5 +echo "$as_me:9314: checking if you want experimental reentrant code" >&5 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 # Check whether --enable-reentrant or --disable-reentrant was given. @@ -9165,9 +9319,9 @@ if test "${enable_reentrant+set}" = set; then enableval="$enable_reentrant" with_reentrant=$enableval else - with_reentrant=no + with_reentrant=$assume_reentrant fi; -echo "$as_me:9170: result: $with_reentrant" >&5 +echo "$as_me:9324: result: $with_reentrant" >&5 echo "${ECHO_T}$with_reentrant" >&6 if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 @@ -9176,7 +9330,7 @@ if test "$with_reentrant" = yes ; then # remove pthread library from $LIBS LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` - else + elif test "$assume_reentrant" = no ; then LIB_SUFFIX="t${LIB_SUFFIX}" fi cat >>confdefs.h <<\EOF @@ -9189,7 +9343,7 @@ fi ### Allow using a different wrap-prefix if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then - echo "$as_me:9192: checking for prefix used to wrap public variables" >&5 + echo "$as_me:9346: checking for prefix used to wrap public variables" >&5 echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 # Check whether --with-wrap-prefix or --without-wrap-prefix was given. @@ -9199,7 +9353,7 @@ if test "${with_wrap_prefix+set}" = set; then else NCURSES_WRAP_PREFIX=_nc_ fi; - echo "$as_me:9202: result: $NCURSES_WRAP_PREFIX" >&5 + echo "$as_me:9356: result: $NCURSES_WRAP_PREFIX" >&5 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 else NCURSES_WRAP_PREFIX=_nc_ @@ -9212,7 +9366,7 @@ EOF ############################################################################### ### use option --disable-echo to suppress full display compiling commands -echo "$as_me:9215: checking if you want to display full commands during build" >&5 +echo "$as_me:9369: checking if you want to display full commands during build" >&5 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -9227,11 +9381,11 @@ if test "$with_echo" = yes; then else ECHO_LINK='@ echo linking $@ ... ;' fi -echo "$as_me:9230: result: $with_echo" >&5 +echo "$as_me:9384: result: $with_echo" >&5 echo "${ECHO_T}$with_echo" >&6 ### use option --enable-warnings to turn on all gcc warnings -echo "$as_me:9234: checking if you want to see compiler warnings" >&5 +echo "$as_me:9388: checking if you want to see compiler warnings" >&5 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. @@ -9239,10 +9393,11 @@ if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval fi; -echo "$as_me:9242: result: $with_warnings" >&5 +echo "$as_me:9396: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "x$with_warnings" = "xyes"; then + ADAFLAGS="$ADAFLAGS -gnatg" INTEL_COMPILER=no @@ -9250,12 +9405,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:9253: checking if this is really Intel C compiler" >&5 + echo "$as_me:9408: 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 9258 "configure" +#line 9413 "configure" #include "confdefs.h" int @@ -9272,16 +9427,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9275: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9430: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9278: \$? = $ac_status" >&5 + echo "$as_me:9433: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9281: \"$ac_try\"") >&5 + { (eval echo "$as_me:9436: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9284: \$? = $ac_status" >&5 + echo "$as_me:9439: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -9292,14 +9447,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:9295: result: $INTEL_COMPILER" >&5 + echo "$as_me:9450: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <&5 + { echo "$as_me:9474: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -9332,12 +9487,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:9335: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:9490: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9338: \$? = $ac_status" >&5 + echo "$as_me:9493: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:9340: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:9495: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -9346,7 +9501,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:9349: checking for $CC warning options..." >&5 + { echo "$as_me:9504: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= @@ -9366,12 +9521,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:9369: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:9524: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9372: \$? = $ac_status" >&5 + echo "$as_me:9527: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:9374: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:9529: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -9382,7 +9537,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:9385: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:9540: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -9415,10 +9570,10 @@ cat > conftest.i <&5 + { echo "$as_me:9573: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 + if { (eval echo "$as_me:9625: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9473: \$? = $ac_status" >&5 + echo "$as_me:9628: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:9475: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:9630: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in #(vi @@ -9508,7 +9663,7 @@ rm -rf conftest* fi ### use option --enable-assertions to turn on generation of assertion code -echo "$as_me:9511: checking if you want to enable runtime assertions" >&5 +echo "$as_me:9666: checking if you want to enable runtime assertions" >&5 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. @@ -9518,7 +9673,7 @@ if test "${enable_assertions+set}" = set; then else with_assertions=no fi; -echo "$as_me:9521: result: $with_assertions" >&5 +echo "$as_me:9676: result: $with_assertions" >&5 echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then @@ -9530,7 +9685,9 @@ EOF CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + + ADAFLAGS="$ADAFLAGS -gnata" + fi fi @@ -9570,7 +9727,7 @@ case "$CFLAGS $CPPFLAGS" in ;; esac -echo "$as_me:9573: checking whether to add trace feature to all models" >&5 +echo "$as_me:9730: checking whether to add trace feature to all models" >&5 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 # Check whether --with-trace or --without-trace was given. @@ -9580,7 +9737,7 @@ if test "${with_trace+set}" = set; then else cf_with_trace=$cf_all_traces fi; -echo "$as_me:9583: result: $cf_with_trace" >&5 +echo "$as_me:9740: result: $cf_with_trace" >&5 echo "${ECHO_T}$cf_with_trace" >&6 if test "$cf_with_trace" = yes ; then @@ -9673,13 +9830,13 @@ case $cf_cv_system_name in #(vi *mingw32*) #(vi ;; *) -echo "$as_me:9676: checking for gettimeofday" >&5 +echo "$as_me:9833: checking for gettimeofday" >&5 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 if test "${ac_cv_func_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9682 "configure" +#line 9839 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday (); below. */ @@ -9710,16 +9867,16 @@ f = gettimeofday; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9713: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9870: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9716: \$? = $ac_status" >&5 + echo "$as_me:9873: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9719: \"$ac_try\"") >&5 + { (eval echo "$as_me:9876: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9722: \$? = $ac_status" >&5 + echo "$as_me:9879: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gettimeofday=yes else @@ -9729,7 +9886,7 @@ ac_cv_func_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:9732: result: $ac_cv_func_gettimeofday" >&5 +echo "$as_me:9889: result: $ac_cv_func_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 if test $ac_cv_func_gettimeofday = yes; then cat >>confdefs.h <<\EOF @@ -9738,7 +9895,7 @@ EOF else -echo "$as_me:9741: checking for gettimeofday in -lbsd" >&5 +echo "$as_me:9898: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9746,7 +9903,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 9749 "configure" +#line 9906 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -9765,16 +9922,16 @@ gettimeofday (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9768: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9925: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9771: \$? = $ac_status" >&5 + echo "$as_me:9928: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9774: \"$ac_try\"") >&5 + { (eval echo "$as_me:9931: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9777: \$? = $ac_status" >&5 + echo "$as_me:9934: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else @@ -9785,7 +9942,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:9788: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "$as_me:9945: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then cat >>confdefs.h <<\EOF @@ -9800,13 +9957,13 @@ fi esac ### Checks for header files. -echo "$as_me:9803: checking for ANSI C header files" >&5 +echo "$as_me:9960: 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 9809 "configure" +#line 9966 "configure" #include "confdefs.h" #include #include @@ -9814,13 +9971,13 @@ else #include _ACEOF -if { (eval echo "$as_me:9817: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:9974: \"$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:9823: \$? = $ac_status" >&5 + echo "$as_me:9980: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9842,7 +9999,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 9845 "configure" +#line 10002 "configure" #include "confdefs.h" #include @@ -9860,7 +10017,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 9863 "configure" +#line 10020 "configure" #include "confdefs.h" #include @@ -9881,7 +10038,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 9884 "configure" +#line 10041 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -9907,15 +10064,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9910: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10067: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9913: \$? = $ac_status" >&5 + echo "$as_me:10070: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9915: \"$ac_try\"") >&5 + { (eval echo "$as_me:10072: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9918: \$? = $ac_status" >&5 + echo "$as_me:10075: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -9928,7 +10085,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:9931: result: $ac_cv_header_stdc" >&5 +echo "$as_me:10088: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -9941,13 +10098,13 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:9944: checking for $ac_hdr that defines DIR" >&5 +echo "$as_me:10101: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 9950 "configure" +#line 10107 "configure" #include "confdefs.h" #include #include <$ac_hdr> @@ -9962,16 +10119,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9965: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10122: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9968: \$? = $ac_status" >&5 + echo "$as_me:10125: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9971: \"$ac_try\"") >&5 + { (eval echo "$as_me:10128: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9974: \$? = $ac_status" >&5 + echo "$as_me:10131: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -9981,7 +10138,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9984: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:10141: 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 <&5 + echo "$as_me:10154: checking for opendir in -ldir" >&5 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 if test "${ac_cv_lib_dir_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10002,7 +10159,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10005 "configure" +#line 10162 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10021,16 +10178,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10024: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10181: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10027: \$? = $ac_status" >&5 + echo "$as_me:10184: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10030: \"$ac_try\"") >&5 + { (eval echo "$as_me:10187: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10033: \$? = $ac_status" >&5 + echo "$as_me:10190: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dir_opendir=yes else @@ -10041,14 +10198,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10044: result: $ac_cv_lib_dir_opendir" >&5 +echo "$as_me:10201: result: $ac_cv_lib_dir_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" fi else - echo "$as_me:10051: checking for opendir in -lx" >&5 + echo "$as_me:10208: checking for opendir in -lx" >&5 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 if test "${ac_cv_lib_x_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10056,7 +10213,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10059 "configure" +#line 10216 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10075,16 +10232,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10078: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10235: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10081: \$? = $ac_status" >&5 + echo "$as_me:10238: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10084: \"$ac_try\"") >&5 + { (eval echo "$as_me:10241: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10087: \$? = $ac_status" >&5 + echo "$as_me:10244: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_x_opendir=yes else @@ -10095,7 +10252,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10098: result: $ac_cv_lib_x_opendir" >&5 +echo "$as_me:10255: result: $ac_cv_lib_x_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 if test $ac_cv_lib_x_opendir = yes; then LIBS="$LIBS -lx" @@ -10103,13 +10260,13 @@ fi fi -echo "$as_me:10106: checking whether time.h and sys/time.h may both be included" >&5 +echo "$as_me:10263: 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 10112 "configure" +#line 10269 "configure" #include "confdefs.h" #include #include @@ -10125,16 +10282,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10128: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10285: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10131: \$? = $ac_status" >&5 + echo "$as_me:10288: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10134: \"$ac_try\"") >&5 + { (eval echo "$as_me:10291: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10137: \$? = $ac_status" >&5 + echo "$as_me:10294: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else @@ -10144,7 +10301,7 @@ ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:10147: result: $ac_cv_header_time" >&5 +echo "$as_me:10304: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then @@ -10162,7 +10319,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:10165: checking for $CC option to accept ANSI C" >&5 +echo "$as_me:10322: 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 @@ -10170,7 +10327,7 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line 10173 "configure" +#line 10330 "configure" #include "confdefs.h" #include #include @@ -10219,16 +10376,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:10222: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10379: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10225: \$? = $ac_status" >&5 + echo "$as_me:10382: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10228: \"$ac_try\"") >&5 + { (eval echo "$as_me:10385: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10231: \$? = $ac_status" >&5 + echo "$as_me:10388: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -10245,21 +10402,21 @@ fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:10248: result: none needed" >&5 + echo "$as_me:10405: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:10251: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:10408: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac -echo "$as_me:10256: checking for an ANSI C-conforming const" >&5 +echo "$as_me:10413: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10262 "configure" +#line 10419 "configure" #include "confdefs.h" int @@ -10317,16 +10474,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10320: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10477: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10323: \$? = $ac_status" >&5 + echo "$as_me:10480: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10326: \"$ac_try\"") >&5 + { (eval echo "$as_me:10483: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10329: \$? = $ac_status" >&5 + echo "$as_me:10486: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else @@ -10336,7 +10493,7 @@ ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:10339: result: $ac_cv_c_const" >&5 +echo "$as_me:10496: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then @@ -10348,7 +10505,7 @@ fi ### Checks for external-data -echo "$as_me:10351: checking if data-only library module links" >&5 +echo "$as_me:10508: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10356,20 +10513,20 @@ else rm -f conftest.a cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:10519: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10365: \$? = $ac_status" >&5 + echo "$as_me:10522: \$? = $ac_status" >&5 (exit $ac_status); } ; then mv conftest.o data.o && \ ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:10542: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10388: \$? = $ac_status" >&5 + echo "$as_me:10545: \$? = $ac_status" >&5 (exit $ac_status); }; then mv conftest.o func.o && \ ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null @@ -10398,7 +10555,7 @@ EOF cf_cv_link_dataonly=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 10401 "configure" +#line 10558 "configure" #include "confdefs.h" int main() @@ -10409,15 +10566,15 @@ else _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:10412: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10569: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10415: \$? = $ac_status" >&5 + echo "$as_me:10572: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:10417: \"$ac_try\"") >&5 + { (eval echo "$as_me:10574: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10420: \$? = $ac_status" >&5 + echo "$as_me:10577: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else @@ -10432,7 +10589,7 @@ fi fi -echo "$as_me:10435: result: $cf_cv_link_dataonly" >&5 +echo "$as_me:10592: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then @@ -10445,7 +10602,7 @@ fi ### Checks for library functions. -echo "$as_me:10448: checking for working mkstemp" >&5 +echo "$as_me:10605: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10453,13 +10610,13 @@ else rm -rf conftest* if test "$cross_compiling" = yes; then - echo "$as_me:10456: checking for mkstemp" >&5 + echo "$as_me:10613: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10462 "configure" +#line 10619 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -10490,16 +10647,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10493: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10650: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10496: \$? = $ac_status" >&5 + echo "$as_me:10653: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10499: \"$ac_try\"") >&5 + { (eval echo "$as_me:10656: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10502: \$? = $ac_status" >&5 + echo "$as_me:10659: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -10509,12 +10666,12 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:10512: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:10669: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10517 "configure" +#line 10674 "configure" #include "confdefs.h" #include @@ -10552,15 +10709,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:10555: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10712: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10558: \$? = $ac_status" >&5 + echo "$as_me:10715: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:10560: \"$ac_try\"") >&5 + { (eval echo "$as_me:10717: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10563: \$? = $ac_status" >&5 + echo "$as_me:10720: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -10575,7 +10732,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:10578: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:10735: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF @@ -10584,13 +10741,13 @@ EOF fi -echo "$as_me:10587: checking return type of signal handlers" >&5 +echo "$as_me:10744: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10593 "configure" +#line 10750 "configure" #include "confdefs.h" #include #include @@ -10612,16 +10769,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10615: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10772: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10618: \$? = $ac_status" >&5 + echo "$as_me:10775: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10621: \"$ac_try\"") >&5 + { (eval echo "$as_me:10778: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10624: \$? = $ac_status" >&5 + echo "$as_me:10781: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else @@ -10631,7 +10788,7 @@ ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:10634: result: $ac_cv_type_signal" >&5 +echo "$as_me:10791: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 +echo "$as_me:10808: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10663,7 +10820,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_gnat_exists="yes" -echo "$as_me:10666: found $ac_dir/$ac_word" >&5 +echo "$as_me:10823: found $ac_dir/$ac_word" >&5 break done @@ -10672,10 +10829,10 @@ fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$as_me:10675: result: $gnat_exists" >&5 + echo "$as_me:10832: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else - echo "$as_me:10678: result: no" >&5 + echo "$as_me:10835: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -10683,12 +10840,12 @@ if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else -echo "$as_me:10686: checking for gnat version" >&5 +echo "$as_me:10843: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ grep '[0-9].[0-9][0-9]*' |\ sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:10691: result: $cf_gnat_version" >&5 +echo "$as_me:10848: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 case $cf_gnat_version in #(vi @@ -10696,66 +10853,15 @@ case $cf_gnat_version in #(vi cf_cv_prog_gnat_correct=yes ;; *) - { echo "$as_me:10699: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 + { echo "$as_me:10856: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} cf_cv_prog_gnat_correct=no ;; esac -echo "$as_me:10705: checking if GNAT supports generics" >&5 -echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 -case $cf_gnat_version in #(vi -3.[1-9]*|[4-9].*) #(vi - cf_gnat_generics=yes - ;; -*) - cf_gnat_generics=no - ;; -esac -echo "$as_me:10715: result: $cf_gnat_generics" >&5 -echo "${ECHO_T}$cf_gnat_generics" >&6 - -if test "$cf_gnat_generics" = yes -then - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" -else - cf_compile_generics= - cf_generic_objects= -fi - -echo "$as_me:10727: checking if GNAT supports project files" >&5 -echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 -case $cf_gnat_version in #(vi -3.[0-9]*) #(vi - cf_gnat_projects=no - ;; -*) - case $cf_cv_system_name in #(vi - cygwin*) #(vi - cf_gnat_projects=no - ;; - *) - cf_gnat_projects=yes - ;; - esac - ;; -esac -echo "$as_me:10744: result: $cf_gnat_projects" >&5 -echo "${ECHO_T}$cf_gnat_projects" >&6 - -if test "$cf_gnat_projects" = yes -then - USE_OLD_MAKERULES="#" - USE_GNAT_PROJECTS="" -else - USE_OLD_MAKERULES="" - USE_GNAT_PROJECTS="#" -fi - # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:10758: checking for $ac_word" >&5 +echo "$as_me:10864: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10770,7 +10876,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_M4_exists="yes" -echo "$as_me:10773: found $ac_dir/$ac_word" >&5 +echo "$as_me:10879: found $ac_dir/$ac_word" >&5 break done @@ -10779,10 +10885,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:10782: result: $M4_exists" >&5 + echo "$as_me:10888: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:10785: result: no" >&5 + echo "$as_me:10891: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -10791,10 +10897,10 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:10794: checking if GNAT works" >&5 + echo "$as_me:10900: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 -rm -rf conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_prog_gnat_correct=no fi -rm -rf conftest* +rm -rf conftest* *~conftest* - echo "$as_me:10822: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:10928: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="$ADAFLAGS -O3 -gnatpn" + # make ADAFLAGS consistent with CFLAGS + case "$CFLAGS" in + *-g*) -echo "$as_me:10831: checking if GNAT pragma Unreferenced works" >&5 + ADAFLAGS="$ADAFLAGS -g" + + ;; + esac + case "$CFLAGS" in + *-O*) + + ADAFLAGS="$ADAFLAGS -O3" + + ;; + esac + +echo "$as_me:10951: checking if GNAT supports generics" >&5 +echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[1-9]*|[4-9].*) #(vi + cf_gnat_generics=yes + ;; +*) + cf_gnat_generics=no + ;; +esac +echo "$as_me:10961: result: $cf_gnat_generics" >&5 +echo "${ECHO_T}$cf_gnat_generics" >&6 + +if test "$cf_gnat_generics" = yes +then + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" +else + cf_compile_generics= + cf_generic_objects= +fi + +echo "$as_me:10973: checking if GNAT supports SIGINT" >&5 +echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 +if test "${cf_cv_gnat_sigint+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rm -rf conftest* *~conftest* +cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then + cf_cv_gnat_sigint=yes +else + cf_cv_gnat_sigint=no +fi +rm -rf conftest* *~conftest* + +fi +echo "$as_me:11021: result: $cf_cv_gnat_sigint" >&5 +echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi + +echo "$as_me:11030: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 if test "${cf_cv_pragma_unreferenced+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -rm -rf conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_pragma_unreferenced=no fi -rm -rf conftest* +rm -rf conftest* *~conftest* fi -echo "$as_me:10862: result: $cf_cv_pragma_unreferenced" >&5 +echo "$as_me:11061: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 # if the pragma is supported, use it (needed in the Trace code). @@ -10869,7 +11068,105 @@ else PRAGMA_UNREF=FALSE fi -echo "$as_me:10872: checking for ada-compiler" >&5 +cf_gnat_libraries=no +cf_gnat_projects=no + +echo "$as_me:11074: checking if GNAT supports project files" >&5 +echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[0-9]*) #(vi + ;; +*) + case $cf_cv_system_name in #(vi + cygwin*) #(vi + ;; + *) + mkdir conftest.src conftest.bin conftest.lib + cd conftest.src + rm -rf conftest* *~conftest* + cat >>library.gpr <>confpackage.ads <>confpackage.adb <&5 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* + ;; + esac + ;; +esac +echo "$as_me:11142: result: $cf_gnat_projects" >&5 +echo "${ECHO_T}$cf_gnat_projects" >&6 + +if test $cf_gnat_projects = yes +then + echo "$as_me:11147: checking if GNAT supports libraries" >&5 +echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 + echo "$as_me:11149: result: $cf_gnat_libraries" >&5 +echo "${ECHO_T}$cf_gnat_libraries" >&6 +fi + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi + +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + +echo "$as_me:11169: checking for ada-compiler" >&5 echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. @@ -10880,12 +11177,12 @@ else cf_ada_compiler=gnatmake fi; -echo "$as_me:10883: result: $cf_ada_compiler" >&5 +echo "$as_me:11180: result: $cf_ada_compiler" >&5 echo "${ECHO_T}$cf_ada_compiler" >&6 cf_ada_package=terminal_interface -echo "$as_me:10888: checking for ada-include" >&5 +echo "$as_me:11185: checking for ada-include" >&5 echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. @@ -10921,7 +11218,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:10924: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:11221: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -10930,10 +11227,10 @@ esac fi ADA_INCLUDE="$withval" -echo "$as_me:10933: result: $ADA_INCLUDE" >&5 +echo "$as_me:11230: result: $ADA_INCLUDE" >&5 echo "${ECHO_T}$ADA_INCLUDE" >&6 -echo "$as_me:10936: checking for ada-objects" >&5 +echo "$as_me:11233: checking for ada-objects" >&5 echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 # Check whether --with-ada-objects or --without-ada-objects was given. @@ -10969,7 +11266,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:10972: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:11269: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -10978,10 +11275,10 @@ esac fi ADA_OBJECTS="$withval" -echo "$as_me:10981: result: $ADA_OBJECTS" >&5 +echo "$as_me:11278: result: $ADA_OBJECTS" >&5 echo "${ECHO_T}$ADA_OBJECTS" >&6 -echo "$as_me:10984: checking if an Ada95 shared-library should be built" >&5 +echo "$as_me:11281: checking if an Ada95 shared-library should be built" >&5 echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 # Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. @@ -10991,7 +11288,7 @@ if test "${with_ada_sharedlib+set}" = set; then else with_ada_sharedlib=no fi; -echo "$as_me:10994: result: $with_ada_sharedlib" >&5 +echo "$as_me:11291: result: $with_ada_sharedlib" >&5 echo "${ECHO_T}$with_ada_sharedlib" >&6 ADA_SHAREDLIB='lib$(LIB_NAME).so.1' @@ -11006,7 +11303,15 @@ then fi fi + else + { { echo "$as_me:11307: error: No usable Ada compiler found" >&5 +echo "$as_me: error: No usable Ada compiler found" >&2;} + { (exit 1); exit 1; }; } fi +else + { { echo "$as_me:11312: error: The Ada compiler is needed for this package" >&5 +echo "$as_me: error: The Ada compiler is needed for this package" >&2;} + { (exit 1); exit 1; }; } fi ################################################################################ @@ -11049,7 +11354,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:11052: checking default library suffix" >&5 +echo "$as_me:11357: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -11060,10 +11365,10 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:11063: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:11368: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:11066: checking default library-dependency suffix" >&5 +echo "$as_me:11371: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in #(vi @@ -11116,10 +11421,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:11119: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:11424: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:11122: checking default object directory" >&5 +echo "$as_me:11427: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -11135,7 +11440,7 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:11138: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:11443: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 ### Set up low-level terminfo dependencies for makefiles. @@ -11254,7 +11559,7 @@ TEST_LIBS2= NCURSES_SHLIB2="sh -c" -ADA_SUBDIRS="include gen src" +ADA_SUBDIRS="include gen src doc" if test "x$cf_with_tests" != "xno" ; then ADA_SUBDIRS="$ADA_SUBDIRS samples" fi @@ -11267,7 +11572,10 @@ NCURSES_TREE="#" EXTERNAL_TREE= -ac_config_files="$ac_config_files $SUB_MAKEFILES Makefile" +# match layout used by make-tar.sh +ADAHTML_DIR=../doc/ada + +ac_config_files="$ac_config_files $SUB_MAKEFILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -11348,7 +11656,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:11351: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:11659: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -11480,7 +11788,7 @@ EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:11527: error: ambiguous option: $1 + { { echo "$as_me:11835: 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;} @@ -11543,7 +11851,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:11546: error: unrecognized option: $1 + -*) { { echo "$as_me:11854: 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;} @@ -11562,7 +11870,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20101001, executed with +This file was extended by $as_me 2.52.20101002, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -11610,10 +11918,11 @@ do case "$ac_config_target" in # Handling of arguments. "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; + "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:11616: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:11925: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -11725,6 +12034,7 @@ s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LN_S@,$LN_S,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@CTAGS@,$CTAGS,;t t @@ -11780,17 +12090,19 @@ s,@PTHREAD@,$PTHREAD,;t t s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@ADA_TRACE@,$ADA_TRACE,;t t s,@gnat_exists@,$gnat_exists,;t t -s,@cf_compile_generics@,$cf_compile_generics,;t t -s,@cf_generic_objects@,$cf_generic_objects,;t t -s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t -s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t s,@M4_exists@,$M4_exists,;t t s,@cf_ada_make@,$cf_ada_make,;t t -s,@ADAFLAGS@,$ADAFLAGS,;t t +s,@cf_compile_generics@,$cf_compile_generics,;t t +s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t +s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t +s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t +s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t s,@cf_ada_compiler@,$cf_ada_compiler,;t t s,@cf_ada_package@,$cf_ada_package,;t t s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t @@ -11810,6 +12122,7 @@ s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t s,@NCURSES_TREE@,$NCURSES_TREE,;t t s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t +s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t CEOF EOF @@ -11924,7 +12237,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:11927: creating $ac_file" >&5 + { echo "$as_me:12240: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -11942,7 +12255,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:11945: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:12258: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -11955,7 +12268,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:11958: error: cannot find input file: $f" >&5 + { { echo "$as_me:12271: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -12021,7 +12334,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:12024: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:12337: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -12032,7 +12345,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:12035: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:12348: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -12045,7 +12358,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:12048: error: cannot find input file: $f" >&5 + { { echo "$as_me:12361: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -12103,7 +12416,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:12106: $ac_file is unchanged" >&5 + { echo "$as_me:12419: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ diff --git a/Ada95/configure.in b/Ada95/configure.in index 3b721395482..2b89fd4cf78 100644 --- a/Ada95/configure.in +++ b/Ada95/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 2010 Free Software Foundation, Inc. * +dnl Copyright (c) 2010,2011 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 * @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: configure.in,v 1.21 2010/11/06 22:11:21 tom Exp $ +dnl $Id: configure.in,v 1.30 2011/03/31 22:49:22 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.21 $) +AC_REVISION($Revision: 1.30 $) AC_INIT(gen/gen.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -76,7 +76,7 @@ AC_SYS_LONG_FILE_NAMES # if we find pkg-config, check if we should install the ".pc" files. CF_PKG_CONFIG -if test "$PKG_CONFIG" != no ; then +if test "$PKG_CONFIG" != none ; then AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) # Leave this as something that can be overridden in the environment. @@ -160,6 +160,15 @@ CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:) ### Use "--without-normal --with-shared" to allow the default model to be ### shared, for example. cf_list_models="" + +AC_MSG_CHECKING(if you want to build shared C-objects) +AC_ARG_WITH(shared, + [ --with-shared generate shared C-objects (needed for --with-ada-sharedlib)], + [with_shared=$withval], + [with_shared=no]) +AC_MSG_RESULT($with_shared) +test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" + AC_MSG_CHECKING(for specified models) test -z "$cf_list_models" && cf_list_models=normal AC_MSG_RESULT($cf_list_models) @@ -206,6 +215,23 @@ AC_MSG_RESULT($LD_MODEL) CF_SHARED_OPTS +# The test/sample programs in the original tree link using rpath option. +# Make it optional for packagers. +if test -n "$LOCAL_LDFLAGS" +then + AC_MSG_CHECKING(if you want to link sample programs with rpath option) + AC_ARG_ENABLE(rpath-link, + [ --enable-rpath-link link sample programs with rpath option], + [with_rpath_link=$enableval], + [with_rpath_link=yes]) + AC_MSG_RESULT($with_rpath_link) + if test "$with_rpath_link" = no + then + LOCAL_LDFLAGS= + LOCAL_LDFLAGS2= + fi +fi + ############################################################################### CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) @@ -324,6 +350,9 @@ if test "$with_pthread" = "yes" ; then fi AC_SUBST(PTHREAD) +# OpenSUSE is installing ncurses6, using reentrant option. +AC_CHECK_FUNC(_nc_TABSIZE,[assume_reentrant=yes], [assume_reentrant=no]) + # Reentrant code has to be opaque; there's little advantage to making ncurses # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for @@ -332,13 +361,13 @@ AC_MSG_CHECKING(if you want experimental reentrant code) AC_ARG_ENABLE(reentrant, [ --enable-reentrant compile with experimental reentrant code], [with_reentrant=$enableval], - [with_reentrant=no]) + [with_reentrant=$assume_reentrant]) AC_MSG_RESULT($with_reentrant) if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 if test $cf_cv_weak_symbols = yes ; then CF_REMOVE_LIB(LIBS,$LIBS,pthread) - else + elif test "$assume_reentrant" = no ; then LIB_SUFFIX="t${LIB_SUFFIX}" fi AC_DEFINE(USE_REENTRANT) @@ -386,7 +415,7 @@ AC_ARG_ENABLE(warnings, AC_MSG_RESULT($with_warnings) if test "x$with_warnings" = "xyes"; then - ADAFLAGS="$ADAFLAGS -gnatg" + CF_ADD_ADAFLAGS(-gnatg) CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) fi CF_GCC_ATTRIBUTES @@ -405,7 +434,7 @@ then AC_DEFINE(NDEBUG) CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + CF_ADD_ADAFLAGS(-gnata) fi fi @@ -491,9 +520,23 @@ dnl At the moment we support no other Ada95 compiler. if test "$cf_with_ada" != "no" ; then CF_PROG_GNAT if test "$cf_cv_prog_gnat_correct" = yes; then - CF_ADD_ADAFLAGS(-O3 -gnatpn) + # make ADAFLAGS consistent with CFLAGS + case "$CFLAGS" in + *-g*) + CF_ADD_ADAFLAGS(-g) + ;; + esac + case "$CFLAGS" in + *-O*) + CF_ADD_ADAFLAGS(-O3) + ;; + esac + + CF_GNAT_GENERICS + CF_GNAT_SIGINT CF_GNAT_PRAGMA_UNREF + CF_GNAT_PROJECTS CF_WITH_ADA_COMPILER @@ -503,7 +546,11 @@ if test "$cf_with_ada" != "no" ; then CF_WITH_ADA_INCLUDE CF_WITH_ADA_OBJECTS CF_WITH_ADA_SHAREDLIB + else + AC_MSG_ERROR(No usable Ada compiler found) fi +else + AC_MSG_ERROR(The Ada compiler is needed for this package) fi ################################################################################ @@ -575,7 +622,7 @@ dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib" NCURSES_SHLIB2="sh -c" AC_SUBST(NCURSES_SHLIB2) -ADA_SUBDIRS="include gen src" +ADA_SUBDIRS="include gen src doc" if test "x$cf_with_tests" != "xno" ; then ADA_SUBDIRS="$ADA_SUBDIRS samples" fi @@ -591,8 +638,13 @@ AC_SUBST(NCURSES_TREE) EXTERNAL_TREE= AC_SUBST(EXTERNAL_TREE) +# match layout used by make-tar.sh +ADAHTML_DIR=../doc/ada +AC_SUBST(ADAHTML_DIR) + AC_OUTPUT( \ $SUB_MAKEFILES \ + doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \ Makefile,[ if test -z "$USE_OLD_MAKERULES" ; then $AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile diff --git a/Ada95/doc/Makefile.in b/Ada95/doc/Makefile.in new file mode 100644 index 00000000000..8f33c930a36 --- /dev/null +++ b/Ada95/doc/Makefile.in @@ -0,0 +1,81 @@ +# $Id: Makefile.in,v 1.2 2011/03/26 19:26:17 tom Exp $ +############################################################################## +# Copyright (c) 2011 Free 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 +# +# Makefile for AdaCurses manual pages. + +SHELL = /bin/sh +VPATH = @srcdir@ + +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = @datadir@ +mandir = @mandir@ + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +DFT_ARG_SUFFIX = @DFT_ARG_SUFFIX@ + +THIS = AdaCurses +DOCDIR = $(DESTDIR)$(datadir)/doc/$(THIS) +MANDIR = $(DESTDIR)$(mandir)/man1 + +all \ +sources \ +depend \ +tags : + +$(DOCDIR) \ +$(MANDIR) : + mkdir -p $@ + +install install.man : $(MANDIR) + $(INSTALL_DATA) adacurses${DFT_ARG_SUFFIX}-config.1 $(MANDIR) + +uninstall uninstall.man : + -rm -f $(MANDIR)/adacurses${DFT_ARG_SUFFIX}-config.1 + +# HTML documentation is optional, usually in a separate package. +install.html : $(DOCDIR) + cd $(srcdir) && tar -cf - *.htm* ada | tar -C $(DOCDIR) -xf - + +uninstall.html : + -rm -rf $(DOCDIR) + +mostlyclean : + -rm -f core tags TAGS *~ *.bak *.ln *.atac trace + +clean: mostlyclean + +distclean realclean: clean + -rm -f Makefile *-config.1 diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in index 7292d27d510..10fd6352ce3 100644 --- a/Ada95/gen/Makefile.in +++ b/Ada95/gen/Makefile.in @@ -28,7 +28,7 @@ # # Author: Juergen Pfeifer, 1996 # -# $Id: Makefile.in,v 1.71 2011/01/22 19:47:09 tom Exp $ +# $Id: Makefile.in,v 1.74 2011/03/26 23:36:30 tom Exp $ # .SUFFIXES: @@ -57,7 +57,7 @@ CC = @CC@ HOST_CC = @BUILD_CC@ CFLAGS = @CFLAGS@ -CPPFLAGS = @ACPPFLAGS@ \ +CPPFLAGS = @ACPPFLAGS@ @CPPFLAGS@ \ -DHAVE_CONFIG_H -I$(srcdir) CCFLAGS = $(CPPFLAGS) $(CFLAGS) @@ -88,7 +88,7 @@ PROG_GENERATE = ./generate$x GENERATE = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@' DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' -GNATHTML = `type -p gnathtml || type -p gnathtml.pl` +GNATHTML = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null` GNATHP = www.gnat.com ################################################################################ @@ -305,6 +305,7 @@ $(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \ $(DEL_ADAMODE) >$@ $(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \ + $(GEN_FILES4) \ $(srcdir)/normal.m4 $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ $(srcdir)/$(ABASE)-panels.ads.m4 |\ @@ -377,7 +378,7 @@ distclean :: clean realclean :: distclean -HTML_DIR = ../../doc/html/ada +HTML_DIR = @ADAHTML_DIR@ instab.tmp : table.m4 $(GEN_SRC) @rm -f $@ @@ -405,6 +406,7 @@ $(HTML_DIR)/table.html : instab.tmp @rm -f instab.tmp adahtml: + test -n "$(GNATHTML)" || exit 1 @find $(HTML_DIR) -type f -exec rm -f {} \; @mkdir -p $(HTML_DIR) cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 31391864d1b..30772b0b021 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998,2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ /* Version Control - $Id: gen.c,v 1.54 2010/09/04 21:19:50 tom Exp $ + $Id: gen.c,v 1.59 2011/03/31 23:50:24 tom Exp $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -124,7 +124,10 @@ gen_reps( int len, /* size of the record in bytes */ int bias) { - int i, n, l, cnt = 0, low, high; + const char *unused_name = "Unused"; + int long_bits = (8 * (int)sizeof(unsigned long)); + int len_bits = (8 * len); + int i, j, n, l, cnt = 0, low, high; int width = strlen(RES_NAME) + 3; unsigned long a; unsigned long mask = 0; @@ -144,8 +147,32 @@ gen_reps( printf(" record\n"); for (i = 0; nap[i].name != (char *)0; i++) { + mask |= nap[i].attr; printf(" %-*s : Boolean;\n", width, nap[i].name); } + + /* + * Compute a mask for the unused bits in this target. + */ + mask = ~mask; + /* + * Bits in the biased area are unused by the target. + */ + for (j = 0; j < bias; ++j) + { + mask &= (unsigned long)(~(1L << j)); + } + /* + * Bits past the target's size are really unused. + */ + for (j = len_bits + bias; j < long_bits; ++j) + { + mask &= (unsigned long)(~(1L << j)); + } + if (mask != 0) + { + printf(" %-*s : Boolean;\n", width, unused_name); + } printf(" end record;\n"); printf(" pragma Convention (C, %s);\n\n", name); @@ -155,16 +182,22 @@ gen_reps( for (i = 0; nap[i].name != (char *)0; i++) { a = nap[i].attr; - mask |= a; l = find_pos((char *)&a, sizeof(a), &low, &high); if (l >= 0) printf(" %-*s at 0 range %2d .. %2d;\n", width, nap[i].name, low - bias, high - bias); } + if (mask != 0) + { + l = find_pos((char *)&mask, sizeof(mask), &low, &high); + if (l >= 0) + printf(" %-*s at 0 range %2d .. %2d;\n", width, unused_name, + low - bias, high - bias); + } i = 1; n = cnt; printf(" end record;\n"); - printf(" for %s'Size use %d;\n", name, 8 * len); + printf(" for %s'Size use %d;\n", name, len_bits); printf(" -- Please note: this rep. clause is generated and may be\n"); printf(" -- different on your system."); } @@ -241,7 +274,10 @@ static void gen_attr_set(const char *name) { /* All of the A_xxx symbols are defined in ncurses, but not all are nonzero - * if "configure --enable-widec" is specified. + * if "configure --enable-widec" is not specified. Originally (in + * 1999-2000), the ifdef's also were needed since the proposed bit-layout + * for wide characters allocated 16-bits for A_CHARTEXT, leaving too few + * bits for a few of the A_xxx symbols. */ static const name_attribute_pair nap[] = { @@ -332,6 +368,7 @@ gen_trace(const char *name) {"Internal_Calls", TRACE_ICALLS}, {"Character_Calls", TRACE_CCALLS}, {"Termcap_TermInfo", TRACE_DATABASE}, + {"Attributes_And_Colors", TRACE_ATTRS}, {(char *)0, 0} }; gen_reps(nap, name, sizeof(int), 0); @@ -770,7 +807,7 @@ gen_keydefs(int mode) static void acs_def(const char *name, chtype *a) { - int c = a - &acs_map[0]; + int c = (int)(a - &acs_map[0]); printf(" %-24s : constant Character := ", name); if (isprint(UChar(c)) && (c != '`')) @@ -1278,12 +1315,6 @@ gen_offsets(void) printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n", 12, "_bool", (long)sizeof(bool), "bool"); - /* In ncurses _maxy and _maxx needs an offset for the "public" - * value - */ - printf(" Offset%-*s : constant Natural := %2d; -- %s\n", - 12, "_XY", 1, "int"); - printf("\n"); printf(" type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n", s_bool); } diff --git a/Ada95/gen/terminal_interface-curses-aux.ads.m4 b/Ada95/gen/terminal_interface-curses-aux.ads.m4 index 0f4c0626616..111ec698a49 100644 --- a/Ada95/gen/terminal_interface-curses-aux.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-aux.ads.m4 @@ -10,7 +10,7 @@ include(M4MACRO)dnl -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -38,7 +38,7 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.17 $ +-- $Revision: 1.18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Base_Defs') @@ -64,7 +64,7 @@ include(`Chtype_Def') -- This is how those constants are defined in ncurses. I see them also -- exactly like this in all ETI implementations I ever tested. So it -- could be that this is quite general, but please check with your curses. - -- This is critical, because curses sometime mixes boolean returns with + -- This is critical, because curses sometime mixes Boolean returns with -- returning an error status. Curses_Ok : constant C_Int := CF_CURSES_OK; Curses_Err : constant C_Int := CF_CURSES_ERR; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 index 36314012ed9..b8481d59714 100644 --- a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 @@ -10,7 +10,7 @@ include(M4MACRO)dnl -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -38,7 +38,7 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.15 $ +-- $Revision: 1.16 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -101,15 +101,15 @@ private pragma Convention (C, Freearg_Function); type Field_Check_Function is access - function (Fld : Field; Usr : System.Address) return C_Int; + function (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Field_Check_Function); type Char_Check_Function is access - function (Ch : C_Int; Usr : System.Address) return C_Int; + function (Ch : C_Int; Usr : System.Address) return Curses_Bool; pragma Convention (C, Char_Check_Function); type Choice_Function is access - function (Fld : Field; Usr : System.Address) return C_Int; + function (Fld : Field; Usr : System.Address) return Curses_Bool; pragma Convention (C, Choice_Function); -- +---------------------------------------------------------------------- @@ -117,7 +117,7 @@ private -- | type Low_Level_Field_Type is record - Status : Interfaces.C.short; + Status : Interfaces.C.unsigned_short; Ref_Count : Interfaces.C.long; Left, Right : System.Address; Makearg : Makearg_Function; @@ -159,7 +159,7 @@ private -- Any other value will raise a Form_Exception. function Make_Arg (Args : System.Address) return System.Address; - pragma Convention (C, Make_Arg); + pragma Import (C, Make_Arg, "void_star_make_arg"); -- This is the Makearg_Function for the internal low-level types -- introduced by this binding. @@ -174,7 +174,7 @@ private -- introduced by this binding. function Field_Check_Router (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Field_Check_Router); -- This is the Field_Check_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived @@ -182,7 +182,7 @@ private -- function. function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Char_Check_Router); -- This is the Char_Check_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived @@ -190,7 +190,7 @@ private -- function. function Next_Router (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Next_Router); -- This is the Choice_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived @@ -198,7 +198,7 @@ private -- function. function Prev_Router (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Prev_Router); -- This is the Choice_Function for the internal low-level types -- introduced to wrap the low-level types by a Field_Type derived diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 index d61eb0c7953..a4fb661ef84 100644 --- a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 +++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -10,7 +10,7 @@ include(M4MACRO)dnl -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -38,8 +38,8 @@ include(M4MACRO)dnl ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.28 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.29 $ +-- $Date: 2011/03/19 12:35:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Mouse_Base_Defs') @@ -49,10 +49,6 @@ package Terminal_Interface.Curses.Mouse is pragma Preelaborate (Terminal_Interface.Curses.Mouse); -- MANPAGE(`curs_mouse.3x') - -- Please note, that in ncurses-1.9.9e documentation mouse support - -- is still marked as experimental. So also this binding will change - -- if the ncurses methods change. - -- -- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates -- in the parent package. -- @@ -99,7 +95,7 @@ package Terminal_Interface.Curses.Mouse is State : Button_State; Mask : in out Event_Mask); -- Stores the event described by the button and the state in the mask. - -- Before you call this the first time, you should init the mask + -- Before you call this the first time, you should initialize the mask -- with the Empty_Mask constant pragma Inline (Register_Reportable_Event); @@ -108,7 +104,7 @@ package Terminal_Interface.Curses.Mouse is State : Button_States; Mask : in out Event_Mask); -- Register all events described by the Button and the State bitmap. - -- Before you call this the first time, you should init the mask + -- Before you call this the first time, you should initialize the mask -- with the Empty_Mask constant -- ANCHOR(`mousemask()',`Start_Mouse') diff --git a/Ada95/gen/terminal_interface-curses.adb.m4 b/Ada95/gen/terminal_interface-curses.adb.m4 index a77676cd3cc..1f89a5a3523 100644 --- a/Ada95/gen/terminal_interface-curses.adb.m4 +++ b/Ada95/gen/terminal_interface-curses.adb.m4 @@ -9,7 +9,7 @@ include(M4MACRO)---------------------------------------------------------------- -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -37,8 +37,8 @@ include(M4MACRO)---------------------------------------------------------------- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.6 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.8 $ +-- $Date: 2011/03/22 23:02:14 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with System; @@ -1208,6 +1208,7 @@ package body Terminal_Interface.Curses is X : Column_Position; begin Get_Size (Win, Y, X); + pragma Unreferenced (X); Change_Lines_Status (Win, 0, Positive (Y), True); end Touch; @@ -1217,6 +1218,7 @@ package body Terminal_Interface.Curses is X : Column_Position; begin Get_Size (Win, Y, X); + pragma Unreferenced (X); Change_Lines_Status (Win, 0, Positive (Y), False); end Untouch; @@ -1352,10 +1354,8 @@ package body Terminal_Interface.Curses is function GetMaxX (W : Window) return C_Int; pragma Import (C, GetMaxX, "getmaxx"); - Y : constant C_Int := GetMaxY (Win) - + C_Int (Offset_XY); - X : constant C_Int := GetMaxX (Win) - + C_Int (Offset_XY); + Y : constant C_Int := GetMaxY (Win); + X : constant C_Int := GetMaxX (Win); begin Number_Of_Lines := Line_Count (Y); Number_Of_Columns := Column_Count (X); diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 index deb762896de..28cc9d19877 100644 --- a/Ada95/gen/terminal_interface-curses.ads.m4 +++ b/Ada95/gen/terminal_interface-curses.ads.m4 @@ -9,7 +9,7 @@ include(M4MACRO)---------------------------------------------------------------- -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -37,8 +37,8 @@ include(M4MACRO)---------------------------------------------------------------- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.42 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.44 $ +-- $Date: 2011/03/19 23:05:56 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ include(`Base_Defs') @@ -52,8 +52,8 @@ include(`Version_Info') type Window is private; Null_Window : constant Window; - type Line_Position is new Natural; -- line coordinate - type Column_Position is new Natural; -- column coordinate + type Line_Position is new Integer; -- line coordinate + type Column_Position is new Integer; -- column coordinate subtype Line_Count is Line_Position range 1 .. Line_Position'Last; -- Type to count lines. We do not allow null windows, so must be positive @@ -461,7 +461,7 @@ include(`ACS_Map')dnl -- ALIAS(`getch()') -- Get a character from the keyboard and echo it - if enabled - to the -- window. - -- If for any reason (i.e. a timeout) we couldn't get a character the + -- If for any reason (i.e. a timeout) we could not get a character the -- returned keycode is Key_None. pragma Inline (Get_Keystroke); @@ -659,7 +659,7 @@ include(`ACS_Map')dnl -- introduce the Timeout_Mode parameter. This should improve -- readability. For Blocking and Non_Blocking, the Amount is not -- evaluated. - -- We don't inline this procedure. + -- We do not inline this procedure. -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode') procedure Set_Escape_Timer_Mode @@ -940,7 +940,7 @@ include(`ACS_Map')dnl Top_Left_Column : out Column_Position; Is_Not_A_Subwindow : out Boolean); -- AKA - -- Instead of placing -1 in the coordinates as return, we use a boolean + -- Instead of placing -1 in the coordinates as return, we use a Boolean -- to return the info that the window has no parent. pragma Inline (Get_Origin_Relative_To_Parent); @@ -1122,7 +1122,7 @@ include(`ACS_Map')dnl -- ALIAS(`mvwinchstr()') -- ALIAS(`mvinchnstr()') -- ALIAS(`mvinchstr()') - -- We don't inline the Peek procedures + -- We do not inline the Peek procedures -- MANPAGE(`curs_getstr.3x') @@ -1171,7 +1171,7 @@ include(`ACS_Map')dnl Text : String; Fmt : Label_Justification := Left); -- AKA - -- We don't inline this procedure + -- We do not inline this procedure -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key') procedure Refresh_Soft_Label_Keys; @@ -1273,7 +1273,7 @@ include(`ACS_Map')dnl function Key_Name (Key : Real_Key_Code) return String; -- AKA -- Same as function - -- We don't inline this routine + -- We do not inline this routine -- ANCHOR(`unctrl()',`Un_Control') procedure Un_Control (Ch : Attributed_Character; @@ -1443,7 +1443,7 @@ include(`ACS_Map')dnl -- N.B.: to be more precise, this uses a ncurses specific enhancement of -- ripoffline(), in which the Lines argument absolute value is the -- number of lines to be ripped of. The official ripoffline() only - -- uses the sign of Lines to rip of a single line from bottom or top. + -- uses the sign of Lines to remove a single line from bottom or top. pragma Inline (Rip_Off_Lines); type Cursor_Visibility is (Invisible, Normal, Very_Visible); @@ -1469,10 +1469,10 @@ include(`ACS_Map')dnl Dir : Transform_Direction := From_Screen); -- This procedure transforms screen coordinates into coordinates relative -- to the window and vice versa, depending on the Dir parameter. - -- Screen coordinates are the position informations on the physical device. + -- Screen coordinates are the position information for the physical device. -- An Curses_Exception will be raised if Line and Column are not in the -- Window or if you pass the Null_Window as argument. - -- We don't inline this procedure + -- We do not inline this procedure -- MANPAGE(`default_colors.3x') @@ -1529,7 +1529,7 @@ include(`ACS_Map')dnl -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw, -- vw_printw -- Please use the Ada style Text_IO child packages for formatted - -- printing. It doesn't make a lot of sense to map the printf style + -- printing. It does not make a lot of sense to map the printf style -- C functions to Ada. -- MANPAGE(`curs_scanw.3x') diff --git a/Ada95/include/Makefile.in b/Ada95/include/Makefile.in index a54ab814882..23ab32d6e7b 100644 --- a/Ada95/include/Makefile.in +++ b/Ada95/include/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.2 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.3 2011/03/19 23:39:59 tom Exp $ ############################################################################## -# Copyright (c) 2010 Free Software Foundation, Inc. # +# Copyright (c) 2010,2011 Free 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"), # @@ -65,6 +65,8 @@ depend \ sources \ install :: $(AUTO_SRC) +uninstall :: + ncurses_def.h: $(srcdir)/ncurses_defs $(srcdir)/MKncurses_def.sh AWK=$(AWK) sh $(srcdir)/MKncurses_def.sh $(srcdir)/ncurses_defs >$@ diff --git a/Ada95/make-tar.sh b/Ada95/make-tar.sh index a2498fb3ecb..608bbdff844 100755 --- a/Ada95/make-tar.sh +++ b/Ada95/make-tar.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: make-tar.sh,v 1.6 2010/11/06 19:59:07 tom Exp $ +# $Id: make-tar.sh,v 1.12 2011/03/26 19:07:38 tom Exp $ ############################################################################## -# Copyright (c) 2010 Free Software Foundation, Inc. # +# Copyright (c) 2010,2011 Free 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"), # @@ -31,15 +31,53 @@ # documentation. The reason for doing that is to simplify distributing the # ada binding as a separate package. +CDPATH=: +export CDPATH + TARGET=`pwd` : ${ROOTNAME:=ncurses-Ada95} +: ${PKG_NAME:=AdaCurses} : ${DESTDIR:=$TARGET} : ${TMPDIR:=/tmp} -# This can be run from either the Ada95 subdirectory, or from the top-level +grep_assign() { + grep_assign=`egrep "^$2\>" "$1" | sed -e "s/^$2[ ]*=[ ]*//" -e 's/"//g'` + eval $2=\"$grep_assign\" +} + +grep_patchdate() { + grep_assign ../dist.mk NCURSES_MAJOR + grep_assign ../dist.mk NCURSES_MINOR + grep_assign ../dist.mk NCURSES_PATCH +} + +# The rpm spec-file in the ncurses tree is a template. Fill in the version +# information from dist.mk +edit_specfile() { + sed \ + -e "s/\\/$NCURSES_MAJOR/g" \ + -e "s/\\/$NCURSES_MINOR/g" \ + -e "s/\\/$NCURSES_PATCH/g" $1 >$1.new + chmod u+w $1 + mv $1.new $1 +} + +make_changelog() { + test -f $1 && chmod u+w $1 + cat >$1 <MANIFEST ) cd $BUILD || exit +# Remove build-artifacts. +find . -name RCS -exec rm -rf {} \; +find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null +find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null +find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null + # There is no need for this script in the tar file. rm -f $ROOTNAME/make-tar.sh # Remove build-artifacts. -find . -name RCS -exec rm -rf {} \; find . -name "*.gz" -exec rm -rf {} \; # Make the files writable... @@ -88,3 +149,5 @@ cd $DESTDIR pwd ls -l $ROOTNAME.tar.gz + +# vi:ts=4 sw=4 diff --git a/Ada95/package/AdaCurses-doc.spec b/Ada95/package/AdaCurses-doc.spec new file mode 100644 index 00000000000..eb7e6b8fedb --- /dev/null +++ b/Ada95/package/AdaCurses-doc.spec @@ -0,0 +1,48 @@ +Summary: AdaCurses - Ada95 binding documentation for ncurses +%define AppProgram AdaCurses +%define AppVersion MAJOR.MINOR +%define AppRelease YYYYMMDD +%define AppPackage %{AppProgram}-doc +# $Id: AdaCurses-doc.spec,v 1.1 2011/03/26 19:22:39 tom Exp $ +Name: %{AppPackage} +Version: %{AppVersion} +Release: %{AppRelease} +License: MIT +Group: Applications/Development +URL: ftp://invisible-island.net/%{AppProgram} +Source0: %{AppProgram}-%{AppRelease}.tgz +Packager: Thomas Dickey + +%description +This is the Ada95 binding documentation from the ncurses MAJOR.MINOR +distribution, for patch-date YYYYMMDD. +%prep + +%setup -q -n %{AppProgram}-%{AppRelease} + +%build + +INSTALL_PROGRAM='${INSTALL}' \ + ./configure \ + --target %{_target_platform} \ + --prefix=%{_prefix} \ + --datadir=%{_datadir} \ + --with-ada-sharedlib + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +(cd doc && make install.html DESTDIR=$RPM_BUILD_ROOT ) + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_datadir}/doc/AdaCurses + +%changelog +# each patch should add its ChangeLog entries here + +* Sat Mar 26 2010 Thomas Dickey +- initial version diff --git a/Ada95/package/AdaCurses.spec b/Ada95/package/AdaCurses.spec new file mode 100644 index 00000000000..c98e1047097 --- /dev/null +++ b/Ada95/package/AdaCurses.spec @@ -0,0 +1,78 @@ +Summary: AdaCurses - Ada95 binding for ncurses +%define AppProgram AdaCurses +%define AppVersion MAJOR.MINOR +%define AppRelease YYYYMMDD +# $Id: AdaCurses.spec,v 1.12 2011/04/01 00:08:32 tom Exp $ +Name: %{AppProgram} +Version: %{AppVersion} +Release: %{AppRelease} +License: MIT +Group: Applications/Development +URL: ftp://invisible-island.net/%{AppProgram} +Source0: %{AppProgram}-%{AppRelease}.tgz +Packager: Thomas Dickey + +%description +This is the Ada95 binding from the ncurses MAJOR.MINOR distribution, for +patch-date YYYYMMDD. + +In addition to a library, this package installs sample programs in +"bin/AdaCurses" to avoid conflict with other packages. +%prep + +%setup -q -n %{AppProgram}-%{AppRelease} + +%build + +%define ada_libdir %{_prefix}/lib/ada/adalib + +INSTALL_PROGRAM='${INSTALL}' \ + ./configure \ + --target %{_target_platform} \ + --prefix=%{_prefix} \ + --bindir=%{_bindir} \ + --libdir=%{_libdir} \ + --mandir=%{_mandir} \ + --datadir=%{_datadir} \ + --disable-rpath-link \ + --with-shared \ + --with-ada-sharedlib + +make + +%install +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT + +( cd samples && + make install.examples \ + DESTDIR=$RPM_BUILD_ROOT \ + BINDIR=$RPM_BUILD_ROOT%{_bindir}/%{AppProgram} +) + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_bindir}/adacurses*-config +%{_bindir}/%{AppProgram}/* +%{_libdir}/libAdaCurses.* +%{ada_libdir}/libAdaCurses.* +%{ada_libdir}/terminal_interface* +%{_mandir}/man1/adacurses*-config.1* +%{_datadir}/%{AppProgram}/* +%{_datadir}/ada/adainclude/terminal_interface* + +%changelog +# each patch should add its ChangeLog entries here + +* Thu Mar 31 2010 Thomas Dickey +- use --with-shared option for consistency with --with-ada-sharelib +- ensure that MY_DATADIR is set when installing examples +- add ada_libdir symbol to handle special case where libdir is /usr/lib64 +- use --disable-rpath-link to link sample programs without rpath + +* Fri Mar 25 2010 Thomas Dickey +- initial version diff --git a/Ada95/package/debian/compat b/Ada95/package/debian/compat new file mode 100644 index 00000000000..7ed6ff82de6 --- /dev/null +++ b/Ada95/package/debian/compat @@ -0,0 +1 @@ +5 diff --git a/Ada95/package/debian/control b/Ada95/package/debian/control new file mode 100644 index 00000000000..88af9706d0c --- /dev/null +++ b/Ada95/package/debian/control @@ -0,0 +1,17 @@ +Source: adacurses +Maintainer: Thomas E. Dickey +Section: misc +Priority: optional +Standards-Version: 3.8.4 +Build-Depends: debhelper (>= 5) +Homepage: http://invisible-island.net/adacurses/ + +Package: adacurses +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: AdaCurses - Ada95 binding for ncurses + This package installs as "adacurses" to avoid conflict with other packages. + This is the Ada95 binding from the ncurses distribution. + . + In addition to a library, this package installs sample programs in + "bin/AdaCurses" to avoid conflict with other packages. diff --git a/Ada95/package/debian/copyright b/Ada95/package/debian/copyright new file mode 100644 index 00000000000..e681a6bd58a --- /dev/null +++ b/Ada95/package/debian/copyright @@ -0,0 +1,69 @@ +Upstream source http://invisible-island.net/ncurses/ncurses-examples.html + +Current ncurses maintainer: Thomas Dickey + +------------------------------------------------------------------------------- + Copyright (c) 1998-2010,2011 Free 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. +------------------------------------------------------------------------------- + +Files: install-sh +Copyright: 1994 X Consortium +Licence: other-BSD + 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' diff --git a/Ada95/package/debian/docs b/Ada95/package/debian/docs new file mode 100644 index 00000000000..e845566c06f --- /dev/null +++ b/Ada95/package/debian/docs @@ -0,0 +1 @@ +README diff --git a/Ada95/package/debian/rules b/Ada95/package/debian/rules new file mode 100755 index 00000000000..ad1a35101b1 --- /dev/null +++ b/Ada95/package/debian/rules @@ -0,0 +1,97 @@ +#!/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) + +TARGET_DIR = $(CURDIR)/debian/adacurses +SAMPLE_DIR = $(TARGET_DIR)/usr/bin/AdaCurses + +CFLAGS = + +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=$(DEB_HOST_GNU_TYPE) \ + --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr \ + --disable-rpath-link \ + --with-shared \ + --with-ada-sharedlib + + 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=$(TARGET_DIR) + + # FIXME: it would be nice to make these into separate packages + ( cd samples && $(MAKE) install.examples DESTDIR=$(TARGET_DIR) BINDIR=$(SAMPLE_DIR) ) + ( cd doc && $(MAKE) install.html DESTDIR=$(TARGET_DIR) ) + + 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/Ada95/package/debian/source/format b/Ada95/package/debian/source/format new file mode 100644 index 00000000000..89ae9db8f88 --- /dev/null +++ b/Ada95/package/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/Ada95/package/debian/watch b/Ada95/package/debian/watch new file mode 100644 index 00000000000..4794ae38527 --- /dev/null +++ b/Ada95/package/debian/watch @@ -0,0 +1,4 @@ +version=3 + +opts=passive ftp://invisible-island.net/AdaCurses/AdaCurses-([\d.]+)\.tgz \ + debian uupdate diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in index 3d1554c7211..aa839ffbaf6 100644 --- a/Ada95/samples/Makefile.in +++ b/Ada95/samples/Makefile.in @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2010,2011 Free 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"), # @@ -28,7 +28,7 @@ # # Author: Juergen Pfeifer, 1996 # -# $Id: Makefile.in,v 1.40 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.46 2011/03/28 23:45:08 tom Exp $ # .SUFFIXES: @@ -41,6 +41,8 @@ x = @PROG_EXT@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ +bindir = @bindir@ +datadir = @datadir@ libdir = @libdir@ includedir = @includedir@ @@ -73,6 +75,13 @@ LINK = $(CC) LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ RANLIB = @RANLIB@ +################################################################################ +BINDIR = $(DESTDIR)$(bindir) +DATADIR = $(DESTDIR)$(datadir) +LIBDIR = $(DESTDIR)$(libdir) + +MY_DATADIR = $(DATADIR)/AdaCurses + ################################################################################ ada_srcdir=../src @@ -88,11 +97,11 @@ ALIB = @cf_ada_package@ ABASE = $(ALIB)-curses CARGS =-cargs $(ADAFLAGS) -LARGS =-largs @TEST_ARG2@ $(LD_FLAGS) -L../lib -lAdaCurses @TEST_LIBS2@ +LARGS =-largs -L../lib -lAdaCurses @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@ -PROGS = tour rain ncurses +PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x -all :: tour$x rain$x ncurses$x +all :: $(PROGS) @echo made $@ sources : @@ -107,15 +116,28 @@ uninstall \ uninstall.libs :: @echo made $@ +install.examples :: $(BINDIR) $(PROGS) + $(INSTALL) $(PROGS) $(BINDIR) + +install.examples :: $(MY_DATADIR) + $(INSTALL_DATA) explain.txt $(MY_DATADIR) + +uninstall.examples :: + -cd $(BINDIR) && rm -f $(PROGS) + -rmdir $(BINDIR) + -rm -f $(MY_DATADIR)/explain.txt + -rmdir $(MY_DATADIR) + +$(BINDIR) \ +$(MY_DATADIR) : + mkdir -p $@ + ncurses$x : $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS) -tour$x : explain.msg +tour$x : $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) -explain.msg: $(srcdir)/explain.txt - cp $(srcdir)/explain.txt $@ - rain$x : $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS) @@ -124,7 +146,7 @@ mostlyclean: clean :: mostlyclean rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ - explain.msg trace screendump b~*.ad[bs] + trace screendump b~*.ad[bs] distclean :: clean rm -f Makefile diff --git a/Ada95/samples/explain.txt b/Ada95/samples/explain.txt index 570f617bf92..be2cba154ee 100644 --- a/Ada95/samples/explain.txt +++ b/Ada95/samples/explain.txt @@ -54,13 +54,13 @@ In a menu you can use the following Keys in the whole application: #HELP #HELPKEYS You may scroll with the Cursor Up/Down Keys. -You may leave the help with the Function Key labelled 'Quit'. +You may leave the help with the Function Key labeled 'Quit'. #INHELP You are already in the help system. -You may leave the help with the Function Key labelled 'Quit'. +You may leave the help with the Function Key labeled 'Quit'. #MAIN This is the main menu of the sample program for the ncurses Ada95 -binding. The main intention of the demo is not to demonstate or +binding. The main intention of the demo is not to demonstrate or test all the features of ncurses and it's subsystems, but to provide to you some sample code how to use the binding with Ada95. @@ -86,23 +86,23 @@ descriptions for the items, a marker and a padding character between the item name and the description. #MENU01 This is a demo of the some of the menu layout options. One of them -is the spacing functionality. Just press the Key labelled "Flip" to +is the spacing functionality. Just press the Key labeled "Flip" to flip between the non-spaced and a spaced version of the menu. Please note that this functionality is unique for ncurses and is not found in the SVr4 menu implementation. -This is a menu that sometimes doesn't fit into it's window and +This is a menu that sometimes does not fit into it's window and therefore it becomes a scroll menu. You can also see here very nicely the pattern matching functionality of menus. Type for example a 'J' and you will be positioned to the next item after the current starting with a 'J'. Any more characters you type in make the pattern more specific. With CTRL-A and CTRL-Z -(for more details press the Key labelled "Keys") you can browse +(for more details press the Key labeled "Keys") you can browse through all the items matching the pattern. You may change the format of the menu. Just press one of the keys -labelled "4x1", "4x2" or "4x3" to get a menu with that many rows +labeled "4x1", "4x2" or "4x3" to get a menu with that many rows and columns. With the Keys "O-Row" or "O-Col" (they occupy the same label and @@ -121,7 +121,7 @@ With the Keys "+Desc" or "-Desc" (they occupy the same label and switch on selection) you can change whether or not the descriptions for each item should be displayed. Please not that this key is not visible in the "4x3" layout mode, because in this case the -menu wouldn't fit on a typicall 80x24 screen. +menu would not fit on a typical 80x24 screen. With the Keys "Disab" or "Enab" (they occupy the same label and switch on selection) you can dis- or enable the selectability of @@ -131,13 +131,13 @@ You may press "Flip" to see the effect of ncurses unique menu-spacing. The Keys "4x1", "4x2" and "4x3" will change the format of the menu. Please note that this is a scrolling menu. You may also play with the pattern matching functionality or try to change the format of the menu. -For more details press the Key labelled "Help". +For more details press the Key labeled "Help". #FORM00 This is a demo of the forms package. #FORM-PAD00 Please note that this demo is far from being complete. It really shows only a small part of the functionality of the forms package. Let's hope -the next version will have a richer demo (You wan't to contribute ?). +the next version will have a richer demo (You want to contribute ?). #NOTIMPL Sorry this functionality of the demo is not implemented at the moment. Remember this is a freeware project, so I can use only my very rare @@ -149,13 +149,13 @@ functionality. #CURSES-PAD00 Please note that this demo is far from being complete. It really shows only a small part of the functionality of the curses package. Let's hope -the next version will have a richer demo (You wan't to contribute ?). +the next version will have a richer demo (You want to contribute ?). #MOUSEKEYS In this demo you may use this keys: - - Key labelled "Help" to get a help - - Key labelled "Keys" is what you are reading now - - Key labelled "Quit" to leave the demo + - Key labeled "Help" to get a help + - Key labeled "Keys" is what you are reading now + - Key labeled "Quit" to leave the demo You may click the mouse buttons at any location at the screen and look at the protocol window ! @@ -179,7 +179,7 @@ sourcecode. You may press one of the three well known standard keys of this demo. #ATTRIB-PAD00 Again this is a more than simple demo and just here to give you the -sourcecode. Feel free to contribute more. +source code. Feel free to contribute more. #TEXTIO #TEXTIOKEYS #TEXTIO-PAD00 diff --git a/Ada95/samples/ncurses2-acs_and_scroll.adb b/Ada95/samples/ncurses2-acs_and_scroll.adb index 5d965983b84..00e9afc2607 100644 --- a/Ada95/samples/ncurses2-acs_and_scroll.adb +++ b/Ada95/samples/ncurses2-acs_and_scroll.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.9 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.11 $ +-- $Date: 2011/03/23 00:33:00 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Windows and scrolling tester. @@ -345,7 +345,7 @@ procedure ncurses2.acs_and_scroll is return; when KEY_UP => i := i + si - 1; - -- same as i := i - 1 because of Modulus arithetic, + -- same as i := i - 1 because of Modulus arithmetic, -- on Line_Position, which is a Natural -- the C version uses this form too, interestingly. when KEY_DOWN => @@ -452,19 +452,19 @@ procedure ncurses2.acs_and_scroll is function delete_framed (fp : FrameA; showit : Boolean) return FrameA is np : FrameA; begin - fp.last.next := fp.next; - fp.next.last := fp.last; + fp.all.last.all.next := fp.all.next; + fp.all.next.all.last := fp.all.last; if showit then - Erase (fp.wind); - Refresh (fp.wind); + Erase (fp.all.wind); + Refresh (fp.all.wind); end if; - Delete (fp.wind); + Delete (fp.all.wind); - if fp = fp.next then + if fp = fp.all.next then np := null; else - np := fp.next; + np := fp.all.next; end if; -- TODO free(fp); return np; @@ -494,64 +494,64 @@ begin False, False, Null_Window); begin - neww.wind := getwindow; - if neww.wind = Null_Window then + neww.all.wind := getwindow; + if neww.all.wind = Null_Window then exit; -- was goto breakout; ha ha ha else if current = null then - neww.next := neww; - neww.last := neww; + neww.all.next := neww; + neww.all.last := neww; else - neww.next := current.next; - neww.last := current; - neww.last.next := neww; - neww.next.last := neww; + neww.all.next := current.all.next; + neww.all.last := current; + neww.all.last.all.next := neww; + neww.all.next.all.last := neww; end if; current := neww; - Set_KeyPad_Mode (current.wind, True); - current.do_keypad := HaveKeyPad (current.wind); - current.do_scroll := HaveScroll (current.wind); + Set_KeyPad_Mode (current.all.wind, True); + current.all.do_keypad := HaveKeyPad (current.all.wind); + current.all.do_scroll := HaveScroll (current.all.wind); end if; end; when Character'Pos ('N') mod 16#20# => -- Ctrl('N') if current /= null then - current := current.next; + current := current.all.next; end if; when Character'Pos ('P') mod 16#20# => -- Ctrl('P') if current /= null then - current := current.last; + current := current.all.last; end if; when Character'Pos ('F') mod 16#20# => -- Ctrl('F') - if current /= null and then HaveScroll (current.wind) then - Scroll (current.wind, 1); + if current /= null and then HaveScroll (current.all.wind) then + Scroll (current.all.wind, 1); end if; when Character'Pos ('B') mod 16#20# => -- Ctrl('B') - if current /= null and then HaveScroll (current.wind) then + if current /= null and then HaveScroll (current.all.wind) then -- The C version of Scroll may return ERR which is ignored -- we need to avoid the exception -- with the 'and HaveScroll(current.wind)' - Scroll (current.wind, -1); + Scroll (current.all.wind, -1); end if; when Character'Pos ('K') mod 16#20# => -- Ctrl('K') if current /= null then - current.do_keypad := not current.do_keypad; - Set_KeyPad_Mode (current.wind, current.do_keypad); + current.all.do_keypad := not current.all.do_keypad; + Set_KeyPad_Mode (current.all.wind, current.all.do_keypad); end if; when Character'Pos ('S') mod 16#20# => -- Ctrl('S') if current /= null then - current.do_scroll := not current.do_scroll; - Allow_Scrolling (current.wind, current.do_scroll); + current.all.do_scroll := not current.all.do_scroll; + Allow_Scrolling (current.all.wind, current.all.do_scroll); end if; when Character'Pos ('W') mod 16#20# => -- Ctrl('W') - if current /= current.next then + if current /= current.all.next then Create (f, Name => dumpfile); -- TODO error checking if not Is_Open (f) then raise Curses_Exception; end if; - Put_Window (current.wind, f); + Put_Window (current.all.wind, f); Close (f); current := delete_framed (current, True); end if; @@ -563,15 +563,15 @@ begin Open (f, Mode => In_File, Name => dumpfile); neww := new Frame'(null, null, False, False, Null_Window); - neww.next := current.next; - neww.last := current; - neww.last.next := neww; - neww.next.last := neww; + neww.all.next := current.all.next; + neww.all.last := current; + neww.all.last.all.next := neww; + neww.all.next.all.last := neww; - neww.wind := Get_Window (f); + neww.all.wind := Get_Window (f); Close (f); - Refresh (neww.wind); + Refresh (neww.all.wind); end; when Character'Pos ('X') mod 16#20# => -- Ctrl('X') if current /= null then @@ -587,7 +587,7 @@ begin "to mark new corner"); Refresh; - Get_Window_Position (current.wind, ul.y, ul.x); + Get_Window_Position (current.all.wind, ul.y, ul.x); selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, tmp, tmpbool); @@ -595,43 +595,43 @@ begin -- the C version had a goto. I refuse gotos. Beep; else - Get_Size (current.wind, lr.y, lr.x); + Get_Size (current.all.wind, lr.y, lr.x); lr.y := lr.y + ul.y - 1; lr.x := lr.x + ul.x - 1; Outerbox (ul, lr, False); Refresh_Without_Update; - Get_Size (current.wind, my, mx); + Get_Size (current.all.wind, my, mx); if my > tmp.y - ul.y then - Get_Cursor_Position (current.wind, lr.y, lr.x); - Move_Cursor (current.wind, tmp.y - ul.y + 1, 0); - Clear_To_End_Of_Screen (current.wind); - Move_Cursor (current.wind, lr.y, lr.x); + Get_Cursor_Position (current.all.wind, lr.y, lr.x); + Move_Cursor (current.all.wind, tmp.y - ul.y + 1, 0); + Clear_To_End_Of_Screen (current.all.wind); + Move_Cursor (current.all.wind, lr.y, lr.x); end if; if mx > tmp.x - ul.x then for i in 0 .. my - 1 loop - Move_Cursor (current.wind, i, tmp.x - ul.x + 1); - Clear_To_End_Of_Line (current.wind); + Move_Cursor (current.all.wind, i, tmp.x - ul.x + 1); + Clear_To_End_Of_Line (current.all.wind); end loop; end if; - Refresh_Without_Update (current.wind); + Refresh_Without_Update (current.all.wind); lr := tmp; -- The C version passes invalid args to resize -- which returns an ERR. For Ada we avoid the exception. if lr.y /= ul.y and lr.x /= ul.x then - Resize (current.wind, lr.y - ul.y + 0, + Resize (current.all.wind, lr.y - ul.y + 0, lr.x - ul.x + 0); end if; - Get_Window_Position (current.wind, ul.y, ul.x); - Get_Size (current.wind, lr.y, lr.x); + Get_Window_Position (current.all.wind, ul.y, ul.x); + Get_Size (current.all.wind, lr.y, lr.x); lr.y := lr.y + ul.y - 1; lr.x := lr.x + ul.x - 1; Outerbox (ul, lr, True); Refresh_Without_Update; - Refresh_Without_Update (current.wind); + Refresh_Without_Update (current.all.wind); Move_Cursor (Line => 0, Column => 0); Clear_To_End_Of_Line; Update_Screen; @@ -647,30 +647,30 @@ begin Refresh; end; when Key_Cursor_Up => - newwin_move (current.wind, -1, 0); + newwin_move (current.all.wind, -1, 0); when Key_Cursor_Down => - newwin_move (current.wind, 1, 0); + newwin_move (current.all.wind, 1, 0); when Key_Cursor_Left => - newwin_move (current.wind, 0, -1); + newwin_move (current.all.wind, 0, -1); when Key_Cursor_Right => - newwin_move (current.wind, 0, 1); + newwin_move (current.all.wind, 0, 1); when Key_Backspace | Key_Delete_Char => declare y : Line_Position; x : Column_Position; tmp : Line_Position; begin - Get_Cursor_Position (current.wind, y, x); + Get_Cursor_Position (current.all.wind, y, x); -- x := x - 1; -- I got tricked by the -1 = Max_Natural - 1 result -- y := y - 1; if not (x = 0 and y = 0) then if x = 0 then y := y - 1; - Get_Size (current.wind, tmp, x); + Get_Size (current.all.wind, tmp, x); end if; x := x - 1; - Delete_Character (current.wind, y, x); + Delete_Character (current.all.wind, y, x); end if; end; when others => @@ -678,7 +678,7 @@ begin if current /= null then declare begin - Add (current.wind, Ch => Code_To_Char (c)); + Add (current.all.wind, Ch => Code_To_Char (c)); exception when Curses_Exception => null; -- this happens if we are at the @@ -688,9 +688,9 @@ begin Beep; end if; end case; - newwin_report (current.wind); + newwin_report (current.all.wind); if current /= null then - usescr := current.wind; + usescr := current.all.wind; else usescr := Standard_Window; end if; diff --git a/Ada95/samples/ncurses2-demo_forms.adb b/Ada95/samples/ncurses2-demo_forms.adb index 7137aa0b1e4..1afbb88bf3f 100644 --- a/Ada95/samples/ncurses2-demo_forms.adb +++ b/Ada95/samples/ncurses2-demo_forms.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2006,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.5 $ --- $Date: 2006/06/25 14:24:40 $ +-- $Revision: 1.6 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -451,19 +451,19 @@ begin Refresh; -- describe the form - f (1) := make_label (0, 15, "Sample Form"); - f (2) := make_label (2, 0, "Last Name"); - f (3) := make_field (3, 0, 1, 18, False); - f (4) := make_label (2, 20, "First Name"); - f (5) := make_field (3, 20, 1, 12, False); - f (6) := make_label (2, 34, "Middle Name"); - f (7) := make_field (3, 34, 1, 12, False); - f (8) := make_label (5, 0, "Comments"); - f (9) := make_field (6, 0, 4, 46, False); - f (10) := make_label (5, 20, "Password:"); - f (11) := make_field (5, 30, 1, 9, True); - secure := f (11); - f (12) := Null_Field; + f.all (1) := make_label (0, 15, "Sample Form"); + f.all (2) := make_label (2, 0, "Last Name"); + f.all (3) := make_field (3, 0, 1, 18, False); + f.all (4) := make_label (2, 20, "First Name"); + f.all (5) := make_field (3, 20, 1, 12, False); + f.all (6) := make_label (2, 34, "Middle Name"); + f.all (7) := make_field (3, 34, 1, 12, False); + f.all (8) := make_label (5, 0, "Comments"); + f.all (9) := make_field (6, 0, 4, 46, False); + f.all (10) := make_label (5, 20, "Password:"); + f.all (11) := make_field (5, 30, 1, 9, True); + secure := f.all (11); + f.all (12) := Null_Field; myform := New_Form (f); diff --git a/Ada95/samples/ncurses2-demo_pad.adb b/Ada95/samples/ncurses2-demo_pad.adb index 862b8b70da2..b1b72aec0b6 100644 --- a/Ada95/samples/ncurses2-demo_pad.adb +++ b/Ada95/samples/ncurses2-demo_pad.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.7 $ --- $Date: 2008/07/26 18:47:06 $ +-- $Revision: 1.8 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -121,8 +121,8 @@ procedure ncurses2.demo_pad is retval.seconds := 0; retval.microseconds := 0; else - retval.seconds := Integer (t.tv_sec); - retval.microseconds := Integer (t.tv_usec); + retval.seconds := Integer (t.all.tv_sec); + retval.microseconds := Integer (t.all.tv_usec); end if; return retval; end gettime; diff --git a/Ada95/samples/ncurses2-demo_panels.adb b/Ada95/samples/ncurses2-demo_panels.adb index d2558ed4730..9693e1a13ba 100644 --- a/Ada95/samples/ncurses2-demo_panels.adb +++ b/Ada95/samples/ncurses2-demo_panels.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2004,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.6 $ --- $Date: 2008/08/30 23:35:01 $ +-- $Revision: 1.7 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -139,7 +139,7 @@ procedure ncurses2.demo_panels (nap_mseci : Integer) is procedure fill_panel (pan : Panel) is win : constant Window := Panel_Window (pan); - num : constant Character := Get_User_Data (pan) (2); + num : constant Character := Get_User_Data (pan).all (2); tmp6 : String (1 .. 6) := "-panx-"; maxy : Line_Count; maxx : Column_Count; diff --git a/Ada95/samples/ncurses2-getopt.adb b/Ada95/samples/ncurses2-getopt.adb index 238c43919ea..29f1fee8281 100644 --- a/Ada95/samples/ncurses2-getopt.adb +++ b/Ada95/samples/ncurses2-getopt.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2004,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.7 $ --- $Date: 2008/07/26 18:46:44 $ +-- $Revision: 1.8 $ +-- $Date: 2011/03/19 12:09:51 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- A simplified version of the GNU getopt function @@ -56,7 +56,7 @@ package body ncurses2.getopt is -- also the user is not allowed to modify argv or argc -- Doing so is Erroneous execution. - -- longoptions are not handled. + -- long options are not handled. procedure Qgetopt (retval : out Integer; argc : Integer; @@ -67,7 +67,7 @@ package body ncurses2.getopt is -- ignored for ncurses, must be initialized to 1 by -- the caller Optarg : out stringa - -- a garbage colector would be useful here. + -- a garbage collector would be useful here. ) is package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); diff --git a/Ada95/samples/ncurses2-menu_test.adb b/Ada95/samples/ncurses2-menu_test.adb index a4c4807b281..bce9782372a 100644 --- a/Ada95/samples/ncurses2-menu_test.adb +++ b/Ada95/samples/ncurses2-menu_test.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2004,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2006,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.6 $ --- $Date: 2006/06/25 14:24:40 $ +-- $Revision: 1.8 $ +-- $Date: 2011/03/23 00:39:28 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -46,10 +46,10 @@ with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; procedure ncurses2.menu_test is - function menu_virtualize (c : Key_Code) return Menu_Request_Code; + function menu_virtualize (c : Key_Code) return Key_Code; procedure xAdd (l : Line_Position; c : Column_Position; s : String); - function menu_virtualize (c : Key_Code) return Menu_Request_Code is + function menu_virtualize (c : Key_Code) return Key_Code is begin case c is when Character'Pos (newl) | Key_Exit => @@ -110,7 +110,7 @@ procedure ncurses2.menu_test is c1 : Key_Code; c : Driver_Result; - r : Menu_Request_Code; + r : Key_Code; begin tmp := Start_Mouse; xAdd (0, 0, "This is the menu test:"); @@ -121,9 +121,9 @@ begin Refresh; for i in animals'Range loop - items_a (i) := New_Item (animals (i).all); + items_a.all (i) := New_Item (animals (i).all); end loop; - items_a (animals'Last + 1) := Null_Item; + items_a.all (animals'Last + 1) := Null_Item; m := New_Menu (items_a); diff --git a/Ada95/samples/ncurses2-overlap_test.adb b/Ada95/samples/ncurses2-overlap_test.adb index 37e8d4c2eb5..ddf8a9a31f6 100644 --- a/Ada95/samples/ncurses2-overlap_test.adb +++ b/Ada95/samples/ncurses2-overlap_test.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000,2004 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2004,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.4 $ --- $Date: 2004/08/21 21:37:00 $ +-- $Revision: 1.5 $ +-- $Date: 2011/03/19 12:07:18 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -101,7 +101,7 @@ begin Move_Cursor (Line => 18, Column => 0); Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " & - "then A, then doupdaute"); + "then A, then doupdate"); Add (Ch => newl); Add (Str => "c = fill window A with letter A. d = fill window B " & "with letter B."); diff --git a/Ada95/samples/ncurses2-slk_test.adb b/Ada95/samples/ncurses2-slk_test.adb index 256becf92da..aa368ba5f9c 100644 --- a/Ada95/samples/ncurses2-slk_test.adb +++ b/Ada95/samples/ncurses2-slk_test.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2006,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.8 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.9 $ +-- $Date: 2011/03/19 12:03:08 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -161,7 +161,7 @@ begin when 'x' | 'q' => exit; -- the C version needed a goto, ha ha - -- breaks exit the case not the loop because fall-throuh + -- breaks exit the case not the loop because fall-through -- happens in C! when others => Beep; diff --git a/Ada95/samples/ncurses2-trace_set.adb b/Ada95/samples/ncurses2-trace_set.adb index 1e2716e1e25..7537afe407e 100644 --- a/Ada95/samples/ncurses2-trace_set.adb +++ b/Ada95/samples/ncurses2-trace_set.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.3 $ --- $Date: 2008/07/26 18:46:18 $ +-- $Revision: 1.5 $ +-- $Date: 2011/03/23 00:40:33 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with ncurses2.util; use ncurses2.util; @@ -50,14 +50,14 @@ with Ada.Strings.Bounded; procedure ncurses2.trace_set is - function menu_virtualize (c : Key_Code) return Menu_Request_Code; + function menu_virtualize (c : Key_Code) return Key_Code; function subset (super, sub : Trace_Attribute_Set) return Boolean; function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set; function trace_num (tlevel : Trace_Attribute_Set) return String; function tracetrace (tlevel : Trace_Attribute_Set) return String; function run_trace_menu (m : Menu; count : Integer) return Boolean; - function menu_virtualize (c : Key_Code) return Menu_Request_Code is + function menu_virtualize (c : Key_Code) return Key_Code is begin case c is when Character'Pos (newl) | Key_Exit => @@ -416,9 +416,9 @@ begin Refresh; for n in t_tbl'Range loop - items_a (n) := New_Item (t_tbl (n).name.all); + items_a.all (n) := New_Item (t_tbl (n).name.all); end loop; - items_a (t_tbl'Last + 1) := Null_Item; + items_a.all (t_tbl'Last + 1) := Null_Item; m := New_Menu (items_a); diff --git a/Ada95/samples/sample-curses_demo.adb b/Ada95/samples/sample-curses_demo.adb index 700da7684be..4dd96a721d2 100644 --- a/Ada95/samples/sample-curses_demo.adb +++ b/Ada95/samples/sample-curses_demo.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998,2004 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2004,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.15 $ --- $Date: 2004/08/21 21:37:00 $ +-- $Revision: 1.17 $ +-- $Date: 2011/03/23 00:29:04 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -61,7 +61,7 @@ package body Sample.Curses_Demo is type User_Data_Access is access all User_Data; package PUD is new Panels.User_Data (User_Data, User_Data_Access); -- We use above instantiation of the generic User_Data package to - -- demonstrate and test the use of the user data maechanism. + -- demonstrate and test the use of the user data mechanism. procedure Demo is @@ -122,9 +122,9 @@ package body Sample.Curses_Demo is declare O : Item_Option_Set; begin - Get_Options (Itm (2), O); + Get_Options (Itm.all (2), O); O.Selectable := False; - Set_Options (Itm (2), O); + Set_Options (Itm.all (2), O); end; end if; diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb index 3129dfd76a7..5587099b242 100644 --- a/Ada95/samples/sample-explanation.adb +++ b/Ada95/samples/sample-explanation.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.21 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.26 $ +-- $Date: 2011/03/26 22:33:29 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Poor mans help system. This scans a sequential file for key lines and @@ -58,7 +58,7 @@ package body Sample.Explanation is Help_Keys : constant String := "HELPKEYS"; In_Help : constant String := "INHELP"; - File_Name : constant String := "explain.msg"; + File_Name : constant String := "explain.txt"; F : File_Type; type Help_Line; @@ -86,6 +86,8 @@ package body Sample.Explanation is function Search (Key : String) return Help_Line_Access; procedure Release_Help (Root : in out Help_Line_Access); + function Check_File (Name : String) return Boolean; + procedure Explain (Key : String) is begin @@ -126,7 +128,7 @@ package body Sample.Explanation is Add (W, Key); Add (W, " not found."); Add (W, Character'Val (10)); - Add (W, "Press the Function key labelled 'Quit' key to continue."); + Add (W, "Press the Function key labeled 'Quit' key to continue."); end Unknown_Key; procedure Redo @@ -135,9 +137,9 @@ package body Sample.Explanation is begin if Top_Line /= null then for L in 0 .. (Height - 1) loop - Add (W, L, 0, H.Line.all); - exit when H.Next = null; - H := H.Next; + Add (W, L, 0, H.all.Line.all); + exit when H.all.Next = null; + H := H.all.Next; end loop; else Unknown_Key; @@ -181,12 +183,12 @@ package body Sample.Explanation is L : Line_Position := 0; begin loop - Add (W, L, 0, C.Line.all); + Add (W, L, 0, C.all.Line.all); L := L + 1; - exit when C.Next = null or else L = Height; - C := C.Next; + exit when C.all.Next = null or else L = Height; + C := C.all.Next; end loop; - if C.Next /= null then + if C.all.Next /= null then pragma Assert (L = Height); More := True; else @@ -248,20 +250,20 @@ package body Sample.Explanation is if K in Special_Key_Code'Range then case K is when Key_Cursor_Down => - if Current.Next /= null then + if Current.all.Next /= null then Move_Cursor (W, Height - 1, 0); Scroll (W, 1); - Current := Current.Next; - Top_Line := Top_Line.Next; - Add (W, Current.Line.all); + Current := Current.all.Next; + Top_Line := Top_Line.all.Next; + Add (W, Current.all.Line.all); end if; when Key_Cursor_Up => - if Top_Line.Prev /= null then + if Top_Line.all.Prev /= null then Move_Cursor (W, 0, 0); Scroll (W, -1); - Top_Line := Top_Line.Prev; - Current := Current.Prev; - Add (W, Top_Line.Line.all); + Top_Line := Top_Line.all.Prev; + Current := Current.all.Prev; + Add (W, Top_Line.all.Line.all); end if; when QUIT_CODE => exit; when others => null; @@ -330,8 +332,8 @@ package body Sample.Explanation is Release_Help (Root); Root := Current; else - Tail.Next := Current; - Current.Prev := Tail; + Tail.all.Next := Current; + Current.all.Prev := Tail; end if; Tail := Current; end loop; @@ -347,8 +349,8 @@ package body Sample.Explanation is begin loop exit when Root = null; - Next := Root.Next; - Release_String (Root.Line); + Next := Root.all.Next; + Release_String (Root.all.Line); Release_Help_Line (Root); Root := Next; end loop; @@ -371,7 +373,7 @@ package body Sample.Explanation is begin if H /= null then loop - T := T.Next; + T := T.all.Next; exit when T = null; N := N + 1; end loop; @@ -391,9 +393,9 @@ package body Sample.Explanation is P := New_Panel (W); T := H; loop - Add (W, L + 1, 1, T.Line.all, Integer (Columns - 2)); + Add (W, L + 1, 1, T.all.Line.all, Integer (Columns - 2)); L := L + 1; - T := T.Next; + T := T.all.Next; exit when T = null; end loop; T := H; @@ -403,6 +405,26 @@ package body Sample.Explanation is end if; end Notepad; + function Check_File (Name : String) return Boolean is + The_File : File_Type; + begin + Open (The_File, In_File, Name); + Close (The_File); + return True; + exception + when Name_Error => + return False; + end Check_File; + begin - Open (F, In_File, File_Name); + if Check_File ("/usr/share/AdaCurses/" & File_Name) then + Open (F, In_File, "/usr/share/AdaCurses/" & File_Name); + elsif Check_File (File_Name) then + Open (F, In_File, File_Name); + else + Put_Line (Standard_Error, + "The file explain.txt was not found in the current directory." + ); + raise Name_Error; + end if; end Sample.Explanation; diff --git a/Ada95/samples/sample-form_demo-aux.ads b/Ada95/samples/sample-form_demo-aux.ads index 57e5bc1a2ac..7e7f7cd21e3 100644 --- a/Ada95/samples/sample-form_demo-aux.ads +++ b/Ada95/samples/sample-form_demo-aux.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -49,7 +49,7 @@ package Sample.Form_Demo.Aux is C : out Column_Count; Y : out Line_Position; X : out Column_Position); - -- Calculate the geometry for a panel beeing able to be used to display + -- Calculate the geometry for a panel being able to be used to display -- the menu. function Create (F : Form; diff --git a/Ada95/samples/sample-form_demo.adb b/Ada95/samples/sample-form_demo.adb index e26a5d98a2b..ed84526feae 100644 --- a/Ada95/samples/sample-form_demo.adb +++ b/Ada95/samples/sample-form_demo.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.15 $ --- $Date: 2006/06/25 14:30:22 $ +-- $Revision: 1.16 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -108,16 +108,16 @@ package body Sample.Form_Demo is Notepad ("FORM-PAD00"); Default_Labels; - Set_Field_Type (FA (6), Enum_Field); - Set_Field_Type (FA (7), I_F); - Set_Field_Type (FA (8), Mft); + Set_Field_Type (FA.all (6), Enum_Field); + Set_Field_Type (FA.all (7), I_F); + Set_Field_Type (FA.all (8), Mft); F1 := new User_Data'(Data => 4711); - Fld_U.Set_User_Data (FA (1), F1); + Fld_U.Set_User_Data (FA.all (1), F1); Fh.Drive_Me (Frm); - Fld_U.Get_User_Data (FA (1), F2); + Fld_U.Get_User_Data (FA.all (1), F2); pragma Assert (F1 = F2); pragma Assert (F1.Data = F2.Data); diff --git a/Ada95/samples/sample-function_key_setting.adb b/Ada95/samples/sample-function_key_setting.adb index 0ce3a224c68..4ff70be7bb8 100644 --- a/Ada95/samples/sample-function_key_setting.adb +++ b/Ada95/samples/sample-function_key_setting.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.14 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.15 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; @@ -88,18 +88,18 @@ package body Sample.Function_Key_Setting is begin -- Store the current labels in the environment for I in 1 .. Number_Of_Keys loop - Get_Soft_Label_Key (I, P.Labels (I)); + Get_Soft_Label_Key (I, P.all.Labels (I)); if Reset then Set_Soft_Label_Key (I, " "); end if; end loop; - P.Prev := Top_Of_Stack; + P.all.Prev := Top_Of_Stack; -- now store active help context and notepad - P.Help := Active_Context; - P.Notepad := Active_Notepad; + P.all.Help := Active_Context; + P.all.Notepad := Active_Notepad; -- The notepad must now vanish and the new notepad is empty. - if P.Notepad /= Null_Panel then - Hide (P.Notepad); + if P.all.Notepad /= Null_Panel then + Hide (P.all.Notepad); Update_Panels; end if; Active_Notepad := Null_Panel; @@ -119,14 +119,14 @@ package body Sample.Function_Key_Setting is raise Function_Key_Stack_Error; else for I in 1 .. Number_Of_Keys loop - Set_Soft_Label_Key (I, P.Labels (I), Justification); + Set_Soft_Label_Key (I, P.all.Labels (I), Justification); end loop; pragma Assert (Active_Context /= null); Release_String (Active_Context); - Active_Context := P.Help; + Active_Context := P.all.Help; Refresh_Soft_Label_Keys_Without_Update; - Notepad_To_Context (P.Notepad); - Top_Of_Stack := P.Prev; + Notepad_To_Context (P.all.Notepad); + Top_Of_Stack := P.all.Prev; Release_Environment (P); end if; end Pop_Environment; @@ -150,10 +150,10 @@ package body Sample.Function_Key_Setting is else loop exit when P = null; - if P.Help.all = Key then + if P.all.Help.all = Key then return True; else - P := P.Prev; + P := P.all.Prev; end if; end loop; return False; diff --git a/Ada95/samples/sample-function_key_setting.ads b/Ada95/samples/sample-function_key_setting.ads index 77699136e7e..4188158f05c 100644 --- a/Ada95/samples/sample-function_key_setting.ads +++ b/Ada95/samples/sample-function_key_setting.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -62,7 +62,7 @@ package Sample.Function_Key_Setting is -- Initialize the environment function Context return String; - -- Return the current context identitfier + -- Return the current context identifier function Find_Context (Key : String) return Boolean; -- Look for a context, return true if it is in the stack, diff --git a/Ada95/samples/sample-header_handler.adb b/Ada95/samples/sample-header_handler.adb index 189118d0402..ad60caf4b0c 100644 --- a/Ada95/samples/sample-header_handler.adb +++ b/Ada95/samples/sample-header_handler.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,14 +35,16 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.17 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.19 $ +-- $Date: 2011/03/22 23:54:38 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Calendar; use Ada.Calendar; with Terminal_Interface.Curses.Text_IO.Integer_IO; with Sample.Manifest; use Sample.Manifest; +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO); + -- This package handles the painting of the header line of the screen. -- package body Sample.Header_Handler is @@ -169,7 +171,7 @@ package body Sample.Header_Handler is Pos := Columns - Column_Position (Title'Length); Add (Win, 0, Pos / 2, Title); -- In this phase we must not allow a physical update, because - -- ncurses isn´t properly initialized at this point. + -- ncurses is not properly initialized at this point. Internal_Update_Header_Window (False); return 0; else diff --git a/Ada95/samples/sample-helpers.adb b/Ada95/samples/sample-helpers.adb index e19464c4080..ceef268134a 100644 --- a/Ada95/samples/sample-helpers.adb +++ b/Ada95/samples/sample-helpers.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,13 +35,13 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.13 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.14 $ +-- $Date: 2011/03/19 12:13:21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Sample.Explanation; use Sample.Explanation; --- This package contains some conveniant helper routines used throughout +-- This package contains some convenient helper routines used throughout -- this example. -- package body Sample.Helpers is diff --git a/Ada95/samples/sample-helpers.ads b/Ada95/samples/sample-helpers.ads index f9bec6a5591..28e89bb5707 100644 --- a/Ada95/samples/sample-helpers.ads +++ b/Ada95/samples/sample-helpers.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,12 +35,12 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; --- This package contains some conveniant helper routines used throughout +-- This package contains some convenient helper routines used throughout -- this example. -- package Sample.Helpers is diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb index fdac054d298..1d3f20c74b4 100644 --- a/Ada95/samples/sample-keyboard_handler.adb +++ b/Ada95/samples/sample-keyboard_handler.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.14 $ --- $Date: 2006/06/25 14:30:22 $ +-- $Revision: 1.16 $ +-- $Date: 2011/03/23 00:34:24 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Strings; use Ada.Strings; @@ -111,7 +111,7 @@ package body Sample.Keyboard_Handler is Buffer : String (1 .. Positive (Columns - 11)); Cmdc : String (1 .. 8); begin - Get_Buffer (Fld => FA (2), Str => Buffer); + Get_Buffer (Fld => FA.all (2), Str => Buffer); Trim (Buffer, Left); if Buffer (1) /= ' ' then Cmdc := To_Upper (Buffer (Cmdc'Range)); @@ -157,8 +157,8 @@ package body Sample.Keyboard_Handler is end if; end loop; Enum_Field := Create (Enum_Info, True); - Set_Field_Type (FA (2), Enum_Field); - Set_Background (FA (2), Normal_Video); + Set_Field_Type (FA.all (2), Enum_Field); + Set_Background (FA.all (2), Normal_Video); Fh.Drive_Me (Frm, Lines - 3, 0); Delete (Frm); @@ -174,7 +174,7 @@ package body Sample.Keyboard_Handler is Set_Timeout_Mode (Win, Delayed, 30000); loop K := Get_Keystroke (Win); - if K = Key_None then -- a timeout occured + if K = Key_None then -- a timeout occurred Update_Header_Window; elsif K = 3 and then not In_Command then -- CTRL-C K := Command; diff --git a/Ada95/samples/sample-menu_demo-aux.ads b/Ada95/samples/sample-menu_demo-aux.ads index 50eea900cc9..e82aedf995b 100644 --- a/Ada95/samples/sample-menu_demo-aux.ads +++ b/Ada95/samples/sample-menu_demo-aux.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.10 $ +-- $Revision: 1.11 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -49,7 +49,7 @@ package Sample.Menu_Demo.Aux is C : out Column_Count; Y : out Line_Position; X : out Column_Position); - -- Calculate the geometry for a panel beeing able to be used to display + -- Calculate the geometry for a panel being able to be used to display -- the menu. function Create (M : Menu; diff --git a/Ada95/samples/sample-menu_demo.adb b/Ada95/samples/sample-menu_demo.adb index 38646748713..80cd94b1d4e 100644 --- a/Ada95/samples/sample-menu_demo.adb +++ b/Ada95/samples/sample-menu_demo.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.18 $ --- $Date: 2008/07/26 18:48:30 $ +-- $Revision: 1.19 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -154,7 +154,7 @@ package body Sample.Menu_Demo is O : Item_Option_Set; begin for J in I'Range loop - Get_Options (I (J), O); + Get_Options (I.all (J), O); O.Selectable := True; if Hide_Long then case J is @@ -163,7 +163,7 @@ package body Sample.Menu_Demo is when others => null; end case; end if; - Set_Options (I (J), O); + Set_Options (I.all (J), O); end loop; end; return False; @@ -378,14 +378,14 @@ package body Sample.Menu_Demo is Set_Pad_Character (M, '|'); MUD.Set_User_Data (M, U1); - IUD.Set_User_Data (Itm (1), U3); + IUD.Set_User_Data (Itm.all (1), U3); Mh.Drive_Me (M); MUD.Get_User_Data (M, U2); pragma Assert (U1 = U2 and U1.all = 4711); - IUD.Get_User_Data (Itm (1), U4); + IUD.Get_User_Data (Itm.all (1), U4); pragma Assert (U3 = U4 and U3.all = 4712); Pop_Environment; diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb index 0b385c45907..a458a37cdbd 100644 --- a/Ada95/samples/sample-text_io_demo.adb +++ b/Ada95/samples/sample-text_io_demo.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2006,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,18 +35,24 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.16 $ --- $Date: 2006/06/25 14:30:22 $ +-- $Revision: 1.17 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Numerics.Generic_Elementary_Functions; + with Ada.Numerics.Complex_Types; use Ada.Numerics.Complex_Types; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; +with Terminal_Interface.Curses; +use Terminal_Interface.Curses; + +with Terminal_Interface.Curses.Panels; +use Terminal_Interface.Curses.Panels; + with Terminal_Interface.Curses.Text_IO; use Terminal_Interface.Curses.Text_IO; + with Terminal_Interface.Curses.Text_IO.Integer_IO; with Terminal_Interface.Curses.Text_IO.Float_IO; with Terminal_Interface.Curses.Text_IO.Enumeration_IO; @@ -60,6 +66,14 @@ with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Explanation; use Sample.Explanation; +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Complex_IO); +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Decimal_IO); +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Enumeration_IO); +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Fixed_IO); +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Float_IO); +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO); +pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Modular_IO); + package body Sample.Text_IO_Demo is type Weekday is (Sunday, diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb index 648036f74a0..9b3759f0c53 100644 --- a/Ada95/samples/sample.adb +++ b/Ada95/samples/sample.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.17 $ --- $Date: 2008/09/27 14:42:40 $ +-- $Revision: 1.18 $ +-- $Date: 2011/03/23 00:44:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; @@ -143,7 +143,7 @@ package body Sample is Ud.Set_User_Data (M, D1); I1 := new User_Data'(Data => 1174); - Id.Set_User_Data (I (1), I1); + Id.Set_User_Data (I.all (1), I1); Set_Spacing (Men => M, Row => 2); @@ -156,7 +156,7 @@ package body Sample is pragma Assert (D1 = D2); pragma Assert (D1.Data = D2.Data); - Id.Get_User_Data (I (1), I2); + Id.Get_User_Data (I.all (1), I2); pragma Assert (I1 = I2); pragma Assert (I1.Data = I2.Data); diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in index 4a599acb892..f6c3e75673b 100644 --- a/Ada95/src/Makefile.in +++ b/Ada95/src/Makefile.in @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2010,2011 Free 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"), # @@ -28,7 +28,7 @@ # # Author: Juergen Pfeifer, 1996 # -# $Id: Makefile.in,v 1.53 2010/11/27 22:14:16 tom Exp $ +# $Id: Makefile.in,v 1.60 2011/03/31 09:46:16 tom Exp $ # .SUFFIXES: @@ -44,7 +44,8 @@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ -libdir = ${exec_prefix}/lib +includedir = @includedir@ +libdir = @libdir@ LIBDIR = $(DESTDIR)$(libdir) ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@ @@ -61,7 +62,7 @@ LN_S = @LN_S@ CC = @CC@ CFLAGS = @CFLAGS@ -CPPFLAGS = @ACPPFLAGS@ \ +CPPFLAGS = @ACPPFLAGS@ @CPPFLAGS@ \ -DHAVE_CONFIG_H -I$(srcdir) CCFLAGS = $(CPPFLAGS) $(CFLAGS) @@ -217,11 +218,22 @@ $(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@ ############################################################################### +C_OBJS = c_varargs_to_ada.o ncurses_compat.o + +c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c + $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c + +ncurses_compat.o : $(srcdir)/ncurses_compat.c + $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/ncurses_compat.c + +############################################################################### + +MIXED_OBJS = $(C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@ @USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ @USE_OLD_MAKERULES@ $(BUILD_DIR_LIB) \ -@USE_OLD_MAKERULES@ $(LIBOBJS) @cf_generic_objects@ -@USE_OLD_MAKERULES@ $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@ +@USE_OLD_MAKERULES@ $(MIXED_OBJS) +@USE_OLD_MAKERULES@ $(AR) $(ARFLAGS) $@ $(MIXED_OBJS) $(BUILD_DIR)/static-ali : ; mkdir -p $@ $(BUILD_DIR)/static-obj : ; mkdir -p $@ @@ -233,23 +245,25 @@ STATIC_DIRS = \ @USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ @USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \ +@USE_GNAT_PROJECTS@ $(C_OBJS) \ @USE_GNAT_PROJECTS@ $(STATIC_DIRS) @USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static +@USE_GNAT_PROJECTS@ $(AR) $(ARFLAGS) $@ $(C_OBJS) @USE_GNAT_PROJECTS@ -@USE_GNAT_PROJECTS@install \ -@USE_GNAT_PROJECTS@install.libs :: \ -@USE_GNAT_PROJECTS@ $(ADA_OBJECTS) -@USE_GNAT_PROJECTS@ $(INSTALL_LIB) \ -@USE_GNAT_PROJECTS@ $(BUILD_DIR)/static-ali/*.ali \ -@USE_GNAT_PROJECTS@ $(ADA_OBJECTS) +@USE_GNAT_LIBRARIES@install \ +@USE_GNAT_LIBRARIES@install.libs :: \ +@USE_GNAT_LIBRARIES@ $(ADA_OBJECTS) +@USE_GNAT_LIBRARIES@ $(INSTALL_LIB) \ +@USE_GNAT_LIBRARIES@ $(BUILD_DIR)/static-ali/*.ali \ +@USE_GNAT_LIBRARIES@ $(ADA_OBJECTS) uninstall \ uninstall.libs :: @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) -@USE_GNAT_PROJECTS@uninstall \ -@USE_GNAT_PROJECTS@uninstall.libs :: -@USE_GNAT_PROJECTS@ @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' +@USE_GNAT_LIBRARIES@uninstall \ +@USE_GNAT_LIBRARIES@uninstall.libs :: +@USE_GNAT_LIBRARIES@ @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' $(BUILD_DIR)/dynamic-ali : ; mkdir -p $@ $(BUILD_DIR)/dynamic-obj : ; mkdir -p $@ @@ -259,8 +273,9 @@ SHARED_DIRS = \ $(BUILD_DIR)/dynamic-ali \ $(BUILD_DIR)/dynamic-obj -@MAKE_ADA_SHAREDLIB@all \ +@MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) @MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: $(ABASE)-trace.adb $(SHARED_DIRS) +@MAKE_ADA_SHAREDLIB@ cp $(MIXED_OBJS) $(BUILD_DIR)/dynamic-obj/ @MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic install \ @@ -280,14 +295,14 @@ uninstall.libs :: $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done' @MAKE_ADA_SHAREDLIB@install \ -@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) +@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) $(LIBDIR) @MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ @MAKE_ADA_SHAREDLIB@ $(BUILD_DIR)/dynamic-ali/* \ @MAKE_ADA_SHAREDLIB@ $(ADA_OBJECTS) @MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ @MAKE_ADA_SHAREDLIB@ $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \ @MAKE_ADA_SHAREDLIB@ $(LIBDIR) -@MAKE_ADA_SHAREDLIB@ cd $(LIBDIR) && ln -s $(SHARED_LIBNAME) $(SHARED_SYMLINK) +@MAKE_ADA_SHAREDLIB@ cd $(LIBDIR) && $(LN_S) $(SHARED_LIBNAME) $(SHARED_SYMLINK) @MAKE_ADA_SHAREDLIB@ @MAKE_ADA_SHAREDLIB@uninstall \ @MAKE_ADA_SHAREDLIB@uninstall.libs :: diff --git a/Ada95/src/c_varargs_to_ada.c b/Ada95/src/c_varargs_to_ada.c new file mode 100644 index 00000000000..ed236ddc90d --- /dev/null +++ b/Ada95/src/c_varargs_to_ada.c @@ -0,0 +1,117 @@ +/**************************************************************************** + * Copyright (c) 2011 Free 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: Nicolas Boulenguez, 2011 * + ****************************************************************************/ + +/* + Version Control + $Id: c_varargs_to_ada.c,v 1.4 2011/03/19 19:07:39 tom Exp $ + --------------------------------------------------------------------------*/ +/* + */ + +#include + +int +set_field_type_alnum(FIELD *field, + int minimum_width) +{ + return set_field_type(field, TYPE_ALNUM, minimum_width); +} + +int +set_field_type_alpha(FIELD *field, + int minimum_width) +{ + return set_field_type(field, TYPE_ALPHA, minimum_width); +} + +int +set_field_type_enum(FIELD *field, + char **value_list, + int case_sensitive, + int unique_match) +{ + return set_field_type(field, TYPE_ENUM, value_list, case_sensitive, + unique_match); +} + +int +set_field_type_integer(FIELD *field, + int precision, + long minimum, + long maximum) +{ + return set_field_type(field, TYPE_INTEGER, precision, minimum, maximum); +} + +int +set_field_type_numeric(FIELD *field, + int precision, + double minimum, + double maximum) +{ + return set_field_type(field, TYPE_NUMERIC, precision, minimum, maximum); +} + +int +set_field_type_regexp(FIELD *field, + char *regular_expression) +{ + return set_field_type(field, TYPE_REGEXP, regular_expression); +} + +int +set_field_type_ipv4(FIELD *field) +{ + return set_field_type(field, TYPE_IPV4); +} + +int +set_field_type_user(FIELD *field, + FIELDTYPE *fieldtype, + void *arg) +{ + return set_field_type(field, fieldtype, arg); +} + +void * +void_star_make_arg(va_list *list) +{ + return va_arg(*list, void *); +} + +#ifdef TRACE +void +_traces(const char *fmt, char *arg) +{ + _tracef(fmt, arg); +} +#endif diff --git a/Ada95/src/c_varargs_to_ada.h b/Ada95/src/c_varargs_to_ada.h new file mode 100644 index 00000000000..ee6a7a7c1eb --- /dev/null +++ b/Ada95/src/c_varargs_to_ada.h @@ -0,0 +1,73 @@ +/**************************************************************************** + * Copyright (c) 2011 Free 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: c_varargs_to_ada.h,v 1.3 2011/03/19 19:07:41 tom Exp $ */ + +#ifndef __C_VARARGS_TO_ADA_H +#define __C_VARARGS_TO_ADA_H + +#include + +extern int set_field_type_alnum(FIELD * /* field */ , + int /* minimum_width */ ); + +extern int set_field_type_alpha(FIELD * /* field */ , + int /* minimum_width */ ); + +extern int set_field_type_enum(FIELD * /* field */ , + char ** /* value_list */ , + int /* case_sensitive */ , + int /* unique_match */ ); + +extern int set_field_type_integer(FIELD * /* field */ , + int /* precision */ , + long /* minimum */ , + long /* maximum */ ); + +extern int set_field_type_numeric(FIELD * /* field */ , + int /* precision */ , + double /* minimum */ , + double /* maximum */ ); + +extern int set_field_type_regexp(FIELD * /* field */ , + char * /* regular_expression */ ); + +extern int set_field_type_ipv4(FIELD * /* field */ ); + +extern int set_field_type_user(FIELD * /* field */ , + FIELDTYPE * /* fieldtype */ , + void * /* arg */ ); + +extern void *void_star_make_arg(va_list * /* list */ ); + +#ifdef TRACE +extern void _traces(const char * /* fmt */ + ,char * /* arg */ ); +#endif + +#endif /* __C_VARARGS_TO_ADA_H */ diff --git a/Ada95/src/library.gpr b/Ada95/src/library.gpr index 62d67702b9c..33e4a3c7d7e 100644 --- a/Ada95/src/library.gpr +++ b/Ada95/src/library.gpr @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------ --- Copyright (c) 2010 Free Software Foundation, Inc. -- +-- Copyright (c) 2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- $Id: library.gpr,v 1.5 2010/11/27 22:15:04 tom Exp $ +-- $Id: library.gpr,v 1.7 2011/03/18 23:10:28 Nicolas.Boulenguez Exp $ -- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html -- http://www.adaworld.com/debian/debian-ada-policy.html project Library is @@ -43,6 +43,7 @@ project Library is for Source_Dirs use (Source_Dir & "/src", Source_Dir2, Build_Dir & "/src"); + for Library_Options use ("-lncurses", "-lpanel", "-lmenu", "-lform"); package Compiler is for Default_Switches ("Ada") use ("-g", @@ -51,5 +52,5 @@ project Library is "-gnatVa", -- All validity checks "-gnatwa"); -- Activate all optional errors end Compiler; - + for Languages use ("C", "Ada"); end Library; diff --git a/Ada95/src/ncurses_compat.c b/Ada95/src/ncurses_compat.c new file mode 100644 index 00000000000..b3d0607a5ff --- /dev/null +++ b/Ada95/src/ncurses_compat.c @@ -0,0 +1,135 @@ +/**************************************************************************** + * Copyright (c) 2011 Free 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, 2011 * + ****************************************************************************/ + +/* + Version Control + $Id: ncurses_compat.c,v 1.2 2011/03/28 00:29:04 tom Exp $ + --------------------------------------------------------------------------*/ + +/* + * Provide compatibility with older versions of ncurses. + */ +#include + +#if defined(NCURSES_VERSION_PATCH) + +#if NCURSES_VERSION_PATCH < 20081122 +extern bool has_mouse(void); +extern int _nc_has_mouse(void); + +bool +has_mouse(void) +{ + return (bool) _nc_has_mouse(); +} +#endif + +/* + * These are provided by lib_gen.c: + */ +#if NCURSES_VERSION_PATCH < 20070331 +extern bool (is_keypad) (const WINDOW *); +extern bool (is_scrollok) (const WINDOW *); + +bool +is_keypad(const WINDOW *win) +{ + return ((win)->_use_keypad); +} + +bool + (is_scrollok) (const WINDOW *win) +{ + return ((win)->_scroll); +} +#endif + +#if NCURSES_VERSION_PATCH < 20060107 +extern int (getbegx) (WINDOW *); +extern int (getbegy) (WINDOW *); +extern int (getcurx) (WINDOW *); +extern int (getcury) (WINDOW *); +extern int (getmaxx) (WINDOW *); +extern int (getmaxy) (WINDOW *); +extern int (getparx) (WINDOW *); +extern int (getpary) (WINDOW *); + +int + (getbegy) (WINDOW *win) +{ + return ((win) ? (win)->_begy : ERR); +} + +int + (getbegx) (WINDOW *win) +{ + return ((win) ? (win)->_begx : ERR); +} + +int + (getcury) (WINDOW *win) +{ + return ((win) ? (win)->_cury : ERR); +} + +int + (getcurx) (WINDOW *win) +{ + return ((win) ? (win)->_curx : ERR); +} + +int + (getmaxy) (WINDOW *win) +{ + return ((win) ? ((win)->_maxy + 1) : ERR); +} + +int + (getmaxx) (WINDOW *win) +{ + return ((win) ? ((win)->_maxx + 1) : ERR); +} + +int + (getpary) (WINDOW *win) +{ + return ((win) ? (win)->_pary : ERR); +} + +int + (getparx) (WINDOW *win) +{ + return ((win) ? (win)->_parx : ERR); +} +#endif + +#endif diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb index 8e9d71adaf4..94336201239 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.10 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.11 $ +-- $Date: 2011/03/19 00:45:37 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -46,13 +46,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is procedure Set_Field_Type (Fld : Field; Typ : Alpha_Field) is - C_Alpha_Field_Type : C_Field_Type; - pragma Import (C, C_Alpha_Field_Type, "TYPE_ALPHA"); - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_Alpha_Field_Type; Arg1 : C_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_alpha"); Res : Eti_Error; begin diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb index 4a2f76b8370..53f66801e91 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.10 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.11 $ +-- $Date: 2011/03/19 00:45:37 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -46,13 +46,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is procedure Set_Field_Type (Fld : Field; Typ : AlphaNumeric_Field) is - C_AlphaNumeric_Field_Type : C_Field_Type; - pragma Import (C, C_AlphaNumeric_Field_Type, "TYPE_ALNUM"); - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_AlphaNumeric_Field_Type; Arg1 : C_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_alnum"); Res : Eti_Error; begin diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb index b3eaf447ad8..d38e062aa5e 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998,2004 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2004,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.10 $ --- $Date: 2004/08/21 21:37:00 $ +-- $Revision: 1.11 $ +-- $Date: 2011/03/22 23:36:20 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Handling; use Ada.Characters.Handling; @@ -61,8 +61,8 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is if Set /= Upper_Case then I.Names (J).all := To_Lower (I.Names (J).all); if Set = Mixed_Case then - I.Names (J)(I.Names (J).all'First) := - To_Upper (I.Names (J)(I.Names (J).all'First)); + I.Names (J).all (I.Names (J).all'First) := + To_Upper (I.Names (J).all (I.Names (J).all'First)); end if; end if; J := J + 1; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb index 8c7815f6611..12648e5a1dc 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.8 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; @@ -63,13 +63,13 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is if Info.Names (I) = null then raise Form_Exception; end if; - E.Arr (size_t (I)) := New_String (Info.Names (I).all); + E.Arr.all (size_t (I)) := New_String (Info.Names (I).all); if Auto_Release_Names then S := Info.Names (I); Release_String (S); end if; end loop; - E.Arr (L) := Null_Ptr; + E.Arr.all (L) := Null_Ptr; return E; end Create; @@ -79,10 +79,10 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is P : chars_ptr; begin loop - P := Enum.Arr (I); + P := Enum.Arr.all (I); exit when P = Null_Ptr; Free (P); - Enum.Arr (I) := Null_Ptr; + Enum.Arr.all (I) := Null_Ptr; I := I + 1; end loop; Enum.Arr := null; @@ -91,15 +91,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is procedure Set_Field_Type (Fld : Field; Typ : Enumeration_Field) is - C_Enum_Type : C_Field_Type; - pragma Import (C, C_Enum_Type, "TYPE_ENUM"); - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_Enum_Type; Arg1 : chars_ptr_array; Arg2 : C_Int; Arg3 : C_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_enum"); Res : Eti_Error; begin diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb index 8b934d08955..b6229becefb 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.10 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.11 $ +-- $Date: 2011/03/19 00:45:37 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -46,15 +46,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.IntField is procedure Set_Field_Type (Fld : Field; Typ : Integer_Field) is - C_Integer_Field_Type : C_Field_Type; - pragma Import (C, C_Integer_Field_Type, "TYPE_INTEGER"); - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_Integer_Field_Type; Arg1 : C_Int; Arg2 : C_Long_Int; Arg3 : C_Long_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_integer"); Res : Eti_Error; begin diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb index 2328f4ed0c0..66e052942d3 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.10 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.11 $ +-- $Date: 2011/03/19 00:45:37 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; @@ -46,13 +46,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is procedure Set_Field_Type (Fld : Field; Typ : Internet_V4_Address_Field) is - C_IPV4_Field_Type : C_Field_Type; - pragma Import (C, C_IPV4_Field_Type, "TYPE_IPV4"); - - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_IPV4_Field_Type) + function Set_Fld_Type (F : Field := Fld) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_ipv4"); Res : Eti_Error; begin diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb index 7151bb8b993..b31dfa657a5 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.11 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.12 $ +-- $Date: 2011/03/19 00:45:37 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -49,15 +49,11 @@ package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is is type Double is new Interfaces.C.double; - C_Numeric_Field_Type : C_Field_Type; - pragma Import (C, C_Numeric_Field_Type, "TYPE_NUMERIC"); - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_Numeric_Field_Type; Arg1 : C_Int; Arg2 : Double; Arg3 : Double) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_numeric"); Res : Eti_Error; begin diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb index f4c7c587ad9..55f0255071a 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.9 $ +-- $Revision: 1.10 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; use Interfaces.C; @@ -48,13 +48,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is is type Char_Ptr is access all Interfaces.C.char; - C_Regexp_Field_Type : C_Field_Type; - pragma Import (C, C_Regexp_Field_Type, "TYPE_REGEXP"); - function Set_Ftyp (F : Field := Fld; - Cft : C_Field_Type := C_Regexp_Field_Type; Arg1 : Char_Ptr) return C_Int; - pragma Import (C, Set_Ftyp, "set_field_type"); + pragma Import (C, Set_Ftyp, "set_field_type_regexp"); Txt : char_array (0 .. Typ.Regular_Expression.all'Length); Len : size_t; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb index f26a42cdca1..3a7e6b5aeb2 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,42 +35,40 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.15 $ --- $Date: 2008/07/26 18:48:58 $ +-- $Revision: 1.17 $ +-- $Date: 2011/03/22 10:53:37 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -with Ada.Unchecked_Conversion; +with System.Address_To_Access_Conversions; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is - pragma Warnings (Off); - function To_Argument_Access is new Ada.Unchecked_Conversion - (System.Address, Argument_Access); - pragma Warnings (On); + package Argument_Conversions is + new System.Address_To_Access_Conversions (Argument); function Generic_Next (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_With_Choice_Access := User_Defined_Field_Type_With_Choice_Access - (To_Argument_Access (Usr).Typ); + (Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ); begin Result := Next (Fld, Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Next; function Generic_Prev (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_With_Choice_Access := User_Defined_Field_Type_With_Choice_Access - (To_Argument_Access (Usr).Typ); + (Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ); begin Result := Previous (Fld, Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Prev; -- ----------------------------------------------------------------------- diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads index 1e69f43a915..5b132c9192b 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.12 $ --- $Date: 2008/07/26 18:49:20 $ +-- $Revision: 1.14 $ +-- $Date: 2011/03/19 12:27:47 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -78,17 +78,17 @@ private function C_Generic_Choice return C_Field_Type; function Generic_Next (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Next); -- This is the generic next Choice_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivates. It routes + -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Next implementation for the type. function Generic_Prev (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Prev); -- This is the generic prev Choice_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivates. It routes + -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Previous implementation for the type. end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb index 695f9197193..2dd295db7e7 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,11 +35,11 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.16 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.21 $ +-- $Date: 2011/03/23 00:44:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -with Ada.Unchecked_Conversion; +with System.Address_To_Access_Conversions; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; package body Terminal_Interface.Curses.Forms.Field_Types.User is @@ -54,7 +54,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is Cft : C_Field_Type := C_Generic_Type; Arg1 : Argument_Access) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_user"); Res : Eti_Error; @@ -76,31 +76,31 @@ package body Terminal_Interface.Curses.Forms.Field_Types.User is end if; end Set_Field_Type; - pragma Warnings (Off); - function To_Argument_Access is new Ada.Unchecked_Conversion - (System.Address, Argument_Access); - pragma Warnings (On); + package Argument_Conversions is + new System.Address_To_Access_Conversions (Argument); function Generic_Field_Check (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_Access := - User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ); + User_Defined_Field_Type_Access + (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); begin Result := Field_Check (Fld, Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Field_Check; function Generic_Char_Check (Ch : C_Int; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is Result : Boolean; Udf : constant User_Defined_Field_Type_Access := - User_Defined_Field_Type_Access (To_Argument_Access (Usr).Typ); + User_Defined_Field_Type_Access + (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); begin Result := Character_Check (Character'Val (Ch), Udf.all); - return C_Int (Boolean'Pos (Result)); + return Curses_Bool (Boolean'Pos (Result)); end Generic_Char_Check; -- ----------------------------------------------------------------------- diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads index af45fab4922..7000fce23de 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads +++ b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads @@ -7,7 +7,7 @@ -- S P E C -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.13 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.15 $ +-- $Date: 2011/03/19 12:27:21 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Interfaces.C; @@ -79,17 +79,17 @@ private function C_Generic_Type return C_Field_Type; function Generic_Field_Check (Fld : Field; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Field_Check); -- This is the generic Field_Check_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivates. It routes + -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Field_Check implementation for the type. function Generic_Char_Check (Ch : C_Int; - Usr : System.Address) return C_Int; + Usr : System.Address) return Curses_Bool; pragma Convention (C, Generic_Char_Check); -- This is the generic Char_Check_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivates. It routes + -- representing all the User_Defined_Field_Type derivatives. It routes -- the call to the Character_Check implementation for the type. end Terminal_Interface.Curses.Forms.Field_Types.User; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types.adb b/Ada95/src/terminal_interface-curses-forms-field_types.adb index aef5d3c8a38..5195a20a499 100644 --- a/Ada95/src/terminal_interface-curses-forms-field_types.adb +++ b/Ada95/src/terminal_interface-curses-forms-field_types.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,13 +35,14 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.21 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.25 $ +-- $Date: 2011/03/22 23:22:27 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Ada.Unchecked_Deallocation; -with Ada.Unchecked_Conversion; +with System.Address_To_Access_Conversions; + -- | -- |===================================================================== -- | man page form_fieldtype.3x @@ -51,10 +52,8 @@ package body Terminal_Interface.Curses.Forms.Field_Types is use type System.Address; - pragma Warnings (Off); - function To_Argument_Access is new Ada.Unchecked_Conversion - (System.Address, Argument_Access); - pragma Warnings (On); + package Argument_Conversions is + new System.Address_To_Access_Conversions (Argument); function Get_Fieldtype (F : Field) return C_Field_Type; pragma Import (C, Get_Fieldtype, "field_type"); @@ -80,11 +79,12 @@ package body Terminal_Interface.Curses.Forms.Field_Types is Low_Level = M_Generic_Type or else Low_Level = M_Choice_Router or else Low_Level = M_Generic_Choice then - Arg := To_Argument_Access (Get_Arg (Fld)); + Arg := Argument_Access + (Argument_Conversions.To_Pointer (Get_Arg (Fld))); if Arg = null then raise Form_Exception; else - return Arg.Typ; + return Arg.all.Typ; end if; else raise Form_Exception; @@ -92,24 +92,6 @@ package body Terminal_Interface.Curses.Forms.Field_Types is end if; end Get_Type; - function Make_Arg (Args : System.Address) return System.Address - is - -- Actually args is a double indirected pointer to the arguments - -- of a C variable argument list. In theory it is now quite - -- complicated to write portable routine that reads the arguments, - -- because one has to know the growth direction of the stack and - -- the sizes of the individual arguments. - -- Fortunately we are only interested in the first argument (#0), - -- we know its size and for the first arg we don't care about - -- into which stack direction we have to proceed. We simply - -- resolve the double indirection and thats it. - type V is access all System.Address; - function To_Access is new Ada.Unchecked_Conversion (System.Address, - V); - begin - return To_Access (To_Access (Args).all).all; - end Make_Arg; - function Copy_Arg (Usr : System.Address) return System.Address is begin @@ -123,18 +105,19 @@ package body Terminal_Interface.Curses.Forms.Field_Types is procedure Freeargs is new Ada.Unchecked_Deallocation (Argument, Argument_Access); - To_Be_Free : Argument_Access := To_Argument_Access (Usr); + To_Be_Free : Argument_Access + := Argument_Access (Argument_Conversions.To_Pointer (Usr)); Low_Level : C_Field_Type; begin if To_Be_Free /= null then - if To_Be_Free.Usr /= System.Null_Address then - Low_Level := To_Be_Free.Cft; - if Low_Level.Freearg /= null then - Low_Level.Freearg (To_Be_Free.Usr); + if To_Be_Free.all.Usr /= System.Null_Address then + Low_Level := To_Be_Free.all.Cft; + if Low_Level.all.Freearg /= null then + Low_Level.all.Freearg (To_Be_Free.all.Usr); end if; end if; - if To_Be_Free.Typ /= null then - Free_Type (To_Be_Free.Typ); + if To_Be_Free.all.Typ /= null then + Free_Type (To_Be_Free.all.Typ); end if; Freeargs (To_Be_Free); end if; @@ -151,7 +134,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is function Set_Fld_Type (F : Field := Fld; Cf : C_Field_Type := Cft; Arg1 : Argument_Access) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type"); + pragma Import (C, Set_Fld_Type, "set_field_type_user"); begin pragma Assert (Low_Level /= Null_Field_Type); @@ -162,10 +145,10 @@ package body Terminal_Interface.Curses.Forms.Field_Types is Typ => new Field_Type'Class'(Typ), Cft => Get_Fieldtype (Fld)); if Usr_Arg /= System.Null_Address then - if Low_Level.Copyarg /= null then - Arg.Usr := Low_Level.Copyarg (Usr_Arg); + if Low_Level.all.Copyarg /= null then + Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg); else - Arg.Usr := Usr_Arg; + Arg.all.Usr := Usr_Arg; end if; end if; @@ -177,56 +160,60 @@ package body Terminal_Interface.Curses.Forms.Field_Types is end Wrap_Builtin; function Field_Check_Router (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access := To_Argument_Access (Usr); + Arg : constant Argument_Access + := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin - pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type - and then Arg.Typ /= null); - if Arg.Cft.Fcheck /= null then - return Arg.Cft.Fcheck (Fld, Arg.Usr); + pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type + and then Arg.all.Typ /= null); + if Arg.all.Cft.all.Fcheck /= null then + return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr); else return 1; end if; end Field_Check_Router; function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access := To_Argument_Access (Usr); + Arg : constant Argument_Access + := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin - pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type - and then Arg.Typ /= null); - if Arg.Cft.Ccheck /= null then - return Arg.Cft.Ccheck (Ch, Arg.Usr); + pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type + and then Arg.all.Typ /= null); + if Arg.all.Cft.all.Ccheck /= null then + return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr); else return 1; end if; end Char_Check_Router; function Next_Router (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access := To_Argument_Access (Usr); + Arg : constant Argument_Access + := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin - pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type - and then Arg.Typ /= null); - if Arg.Cft.Next /= null then - return Arg.Cft.Next (Fld, Arg.Usr); + pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type + and then Arg.all.Typ /= null); + if Arg.all.Cft.all.Next /= null then + return Arg.all.Cft.all.Next (Fld, Arg.all.Usr); else return 1; end if; end Next_Router; function Prev_Router (Fld : Field; - Usr : System.Address) return C_Int + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access := To_Argument_Access (Usr); + Arg : constant Argument_Access := + Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin - pragma Assert (Arg /= null and then Arg.Cft /= Null_Field_Type - and then Arg.Typ /= null); - if Arg.Cft.Prev /= null then - return Arg.Cft.Prev (Fld, Arg.Usr); + pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type + and then Arg.all.Typ /= null); + if Arg.all.Cft.all.Prev /= null then + return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr); else return 1; end if; diff --git a/Ada95/src/terminal_interface-curses-forms.adb b/Ada95/src/terminal_interface-curses-forms.adb index 68825fc3dfb..915ed58418e 100644 --- a/Ada95/src/terminal_interface-curses-forms.adb +++ b/Ada95/src/terminal_interface-curses-forms.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.27 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.28 $ +-- $Date: 2011/03/22 23:37:32 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; @@ -736,11 +736,11 @@ package body Terminal_Interface.Curses.Forms is Res : Eti_Error; begin - pragma Assert (Flds (Flds'Last) = Null_Field); - if Flds (Flds'Last) /= Null_Field then + pragma Assert (Flds.all (Flds'Last) = Null_Field); + if Flds.all (Flds'Last) /= Null_Field then raise Form_Exception; else - Res := Set_Frm_Fields (Frm, Flds (Flds'First)'Address); + Res := Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address); if Res /= E_Ok then Eti_Exception (Res); end if; @@ -806,11 +806,11 @@ package body Terminal_Interface.Curses.Forms is M : Form; begin - pragma Assert (Fields (Fields'Last) = Null_Field); - if Fields (Fields'Last) /= Null_Field then + pragma Assert (Fields.all (Fields'Last) = Null_Field); + if Fields.all (Fields'Last) /= Null_Field then raise Form_Exception; else - M := NewForm (Fields (Fields'First)'Address); + M := NewForm (Fields.all (Fields'First)'Address); if M = Null_Form then raise Form_Exception; end if; @@ -1136,8 +1136,8 @@ package body Terminal_Interface.Curses.Forms is begin if FA /= null and then Free_Fields then for I in FA'First .. (FA'Last - 1) loop - if FA (I) /= Null_Field then - Delete (FA (I)); + if FA.all (I) /= Null_Field then + Delete (FA.all (I)); end if; end loop; end if; diff --git a/Ada95/src/terminal_interface-curses-menus.adb b/Ada95/src/terminal_interface-curses-menus.adb index 9fce6de6d9f..a7dca07c287 100644 --- a/Ada95/src/terminal_interface-curses-menus.adb +++ b/Ada95/src/terminal_interface-curses-menus.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.27 $ --- $Date: 2009/12/26 17:38:58 $ +-- $Revision: 1.28 $ +-- $Date: 2011/03/22 23:38:12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; @@ -896,8 +896,8 @@ package body Terminal_Interface.Curses.Menus is Res : Eti_Error; begin - pragma Assert (Items (Items'Last) = Null_Item); - if Items (Items'Last) /= Null_Item then + pragma Assert (Items.all (Items'Last) = Null_Item); + if Items.all (Items'Last) /= Null_Item then raise Menu_Exception; else Res := Set_Items (Men, Items.all'Address); @@ -941,8 +941,8 @@ package body Terminal_Interface.Curses.Menus is M : Menu; begin - pragma Assert (Items (Items'Last) = Null_Item); - if Items (Items'Last) /= Null_Item then + pragma Assert (Items.all (Items'Last) = Null_Item); + if Items.all (Items'Last) /= Null_Item then raise Menu_Exception; else M := Newmenu (Items.all'Address); @@ -997,8 +997,8 @@ package body Terminal_Interface.Curses.Menus is begin if IA /= null and then Free_Items then for I in IA'First .. (IA'Last - 1) loop - if IA (I) /= Null_Item then - Delete (IA (I)); + if IA.all (I) /= Null_Item then + Delete (IA.all (I)); end if; end loop; end if; diff --git a/Ada95/src/terminal_interface-curses-text_io.adb b/Ada95/src/terminal_interface-curses-text_io.adb index 4b29514efbf..e2ca27f208e 100644 --- a/Ada95/src/terminal_interface-curses-text_io.adb +++ b/Ada95/src/terminal_interface-curses-text_io.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.19 $ --- $Date: 2009/12/26 17:40:46 $ +-- $Revision: 1.20 $ +-- $Date: 2011/03/22 23:38:49 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO is @@ -205,6 +205,7 @@ package body Terminal_Interface.Curses.Text_IO is end if; Get_Cursor_Position (Win, Y1, X); + pragma Unreferenced (X); N := Natural (To); N := N - 1; Y2 := Line_Position (N); if Y2 < Y1 then diff --git a/Ada95/src/terminal_interface-curses-trace.adb_p b/Ada95/src/terminal_interface-curses-trace.adb_p index f40d8bf3123..d2117a4cef1 100644 --- a/Ada95/src/terminal_interface-curses-trace.adb_p +++ b/Ada95/src/terminal_interface-curses-trace.adb_p @@ -35,7 +35,7 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- $Revision: 1.6 $ +-- $Revision: 1.7 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ #if ADA_TRACE then @@ -66,7 +66,7 @@ package body Terminal_Interface.Curses.Trace is procedure Trace_Put (str : String) is procedure tracef (format : char_array; s : char_array); - pragma Import (C, tracef, "_tracef"); + pragma Import (C, tracef, "_traces"); Txt : char_array (0 .. str'Length); Length : size_t; formatstr : constant String := "%s" & ASCII.NUL; diff --git a/INSTALL b/INSTALL index 282c2a36543..eb26ab103ef 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.152 2011/02/25 22:10:53 tom Exp $ +-- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -433,7 +433,7 @@ SUMMARY OF CONFIGURE OPTIONS: changes several data references to functions to work around this problem. - NOTE: With ncurses 5.1, this may not be necessary, since we are + NOTE: With ncurses 5.1, this may not be necessary, since we are told that some linkers interpret uninitialized global data as a different type of reference which behaves as described above. We have explicitly initialized all of the global data to work around the @@ -462,7 +462,7 @@ SUMMARY OF CONFIGURE OPTIONS: warning. There will still be warnings due to subtle inconsistencies in the interface, but at a lower level. - NOTE: configuring ncurses with this option may detract from the + NOTE: configuring ncurses with this option may detract from the portability of your applications by encouraging you to use const in places where the XSI curses interface would not allow them. Similar issues arise when porting to SVr4 curses, which uses const in even @@ -483,7 +483,7 @@ SUMMARY OF CONFIGURE OPTIONS: encoded. This applies only to the wide-character (--enable-widec) configuration. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have an array of cchar_t's must be recompiled. @@ -492,7 +492,7 @@ SUMMARY OF CONFIGURE OPTIONS: That allows one to use ncurses with a wheel mouse with xterm or similar X terminal emulators. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have mouse mask mmask_t's must be recompiled. @@ -512,7 +512,7 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-getcap-cache Cache translated termcaps under the directory $HOME/.terminfo - NOTE: this sounds good - it makes ncurses run faster the second time. + NOTE: this sounds good - it makes ncurses run faster the second time. But look where the data comes from - an /etc/termcap containing lots of entries that are not up to date. If you configure with this option and forget to install the terminfo database before running an ncurses @@ -668,6 +668,10 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-sharedlib Build a shared library for Ada95 binding, if the compiler permits. + NOTE: You must also set the --with-shared option on some platforms + for a successful build. You need not use this option when you set + --with-shared, unless you want to use the Ada shared library. + --with-bool=TYPE If --without-cxx is specified, override the type used for the "bool" declared in curses.h (normally the type is automatically chosen to @@ -733,7 +737,8 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-widec is not given) a character. Prior to ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it may be unsigned. Use this option if you need to preserve compatibility with 64-bit - executables. + executables, e.g., by setting "--with-chtype=long" (the configure + script supplies "unsigned"). --with-database=XXX Specify the terminfo source file to install. Usually you will wish @@ -816,7 +821,7 @@ SUMMARY OF CONFIGURE OPTIONS: make install DESTDIR=XXX since the makefiles pass that variable to subordinate makes. - NOTE: a few systems build shared libraries with fixed pathnames; this + NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. --with-libtool[=XXX] @@ -922,7 +927,7 @@ SUMMARY OF CONFIGURE OPTIONS: which you are building, typically using a ".so" suffix, along with symbolic links that refer to the release version. - NOTE: Unless you override the configure script by setting the $CFLAGS + NOTE: Unless you override the configure script by setting the $CFLAGS environment variable, these will not be built with the -g debugging option. @@ -936,6 +941,10 @@ SUMMARY OF CONFIGURE OPTIONS: $LD_LIBRARY_PATH to point to the build tree, e.g., ./misc/shlib make install + NOTE: If you use the --with-ada-sharedlib option, you should also + set this option, to ensure that C-language modules needed for the + Ada binding use appropriate compiler options. + --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. This is normally chosen automatically based on the type of system diff --git a/MANIFEST b/MANIFEST index 5debc64e5f2..421cc678cd6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -6,6 +6,7 @@ ./Ada95/aclocal.m4 ./Ada95/configure ./Ada95/configure.in +./Ada95/doc/Makefile.in ./Ada95/gen/Makefile.in ./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c @@ -32,6 +33,15 @@ ./Ada95/include/ncurses_defs ./Ada95/make-tar.sh ./Ada95/mk-1st.awk +./Ada95/package/AdaCurses-doc.spec +./Ada95/package/AdaCurses.spec +./Ada95/package/debian/compat +./Ada95/package/debian/control +./Ada95/package/debian/copyright +./Ada95/package/debian/docs +./Ada95/package/debian/rules +./Ada95/package/debian/source/format +./Ada95/package/debian/watch ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -118,8 +128,11 @@ ./Ada95/samples/tour.adb ./Ada95/samples/tour.ads ./Ada95/src/Makefile.in +./Ada95/src/c_varargs_to_ada.c +./Ada95/src/c_varargs_to_ada.h ./Ada95/src/library.gpr ./Ada95/src/modules +./Ada95/src/ncurses_compat.c ./Ada95/src/terminal_interface-curses-aux.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -1053,6 +1066,14 @@ ./test/ncurses.c ./test/ncurses_tst.hin ./test/newdemo.c +./test/package/debian/compat +./test/package/debian/control +./test/package/debian/copyright +./test/package/debian/docs +./test/package/debian/rules +./test/package/debian/source/format +./test/package/debian/watch +./test/package/ncurses-examples.spec ./test/programs ./test/railroad.c ./test/rain.c diff --git a/NEWS b/NEWS index 55f3cc74c33..e8f9cefbabd 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1651 2011/02/26 16:54:31 tom Exp $ +-- $Id: NEWS,v 1.1682 2011/04/04 00:02:42 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,94 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20110404 5.9 release for upload to ftp.gnu.org + +20110402 + + various build-fixes for the rpm/dpkg scripts. + + add "--enable-rpath-link" option to Ada95/configure, to allow + packages to suppress the rpath feature which is normally used for + the in-tree build of sample programs. + + corrected definition of libdir variable in Ada95/src/Makefile.in, + needed for rpm script. + + add "--with-shared" option to Ada95/configure script, to allow + making the C-language parts of the binding use appropriate compiler + options if building a shared library with gnat. + +20110329 + > portability fixes for Ada95 binding: + + add configure check to ensure that SIGINT works with gnat. This is + needed for the "rain" sample program. If SIGINT does not work, omit + that sample program. + + correct typo in check of $PKG_CONFIG variable in Ada95/configure + + add ncurses_compat.c, to supply functions used in the Ada95 binding + which were added in 5.7 and later. + + modify sed expression in CF_NCURSES_ADDON to eliminate a dependency + upon GNU sed. + +20110326 + + add special check in Ada95/configure script for ncurses6 reentrant + code. + + regen Ada html documentation. + + build-fix for Ada shared libraries versus the varargs workaround. + + add rpm and dpkg scripts for Ada95 and test directories, for test + builds. + + update test/configure macros CF_CURSES_LIBS, CF_XOPEN_SOURCE and + CF_X_ATHENA_LIBS. + + add configure check to determine if gnat's project feature supports + libraries, i.e., collections of .ali files. + + make all dereferences in Ada95 samples explicit. + + fix typo in comment in lib_add_wch.c (patch by Petr Pavlu). + + add configure check for, ifdef's for math.h which is in a separate + package on Solaris and potentially not installed (report by Petr + Pavlu). + > fixes for Ada95 binding (Nicolas Boulenguez): + + improve type-checking in Ada95 by eliminating a few warning-suppress + pragmas. + + suppress unreferenced warnings. + + make all dereferences in binding explicit. + +20110319 + + regen Ada html documentation. + + change order of -I options from ncurses*-config script when the + --disable-overwrite option was used, so that the subdirectory include + is listed first. + + modify the make-tar.sh scripts to add a MANIFEST and NEWS file. + + modify configure script to provide value for HTML_DIR in + Ada95/gen/Makefile.in, which depends on whether the Ada95 binding is + distributed separately (report by Nicolas Boulenguez). + + modify configure script to add -g and/or -O3 to ADAFLAGS if the + CFLAGS for the build has these options. + + amend change from 20070324, to not add 1 to the result of getmaxx + and getmaxy in the Ada binding (report by Nicolas Boulenguez for + thread in comp.lang.ada). + + build-fix Ada95/samples for gnat 4.5 + + spelling fixes for Ada95/samples/explain.txt + > fixes for Ada95 binding (Nicolas Boulenguez): + + add item in Trace_Attribute_Set corresponding to TRACE_ATTRS. + + add workaround for binding to set_field_type(), which uses varargs. + The original binding from 990220 relied on the prevalent + implementation of varargs which did not support or need va_copy(). + + add dependency on gen/Makefile.in needed for *-panels.ads + + add Library_Options to library.gpr + + add Languages to library.gpr, for gprbuild + +20110307 + + revert changes to limit-checks from 20110122 (Debian #616711). + > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): + + corrected a minor sign error in a field of Low_Level_Field_Type, to + conform to form.h. + + replaced C_Int by Curses_Bool as return type for some callbacks, see + fieldtype(3FORM). + + modify samples/sample-explain.adb to provide explicit message when + explain.txt is not found. + +20110305 + + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes + for compiler warnings (report by Nicolas Boulenguez). + + modify Ada95/gen/gen.c to declare unused bits in generated layouts, + needed to compile when chtype is 64-bits using gnat 4.4.5 + 20110226 5.8 release for upload to ftp.gnu.org 20110226 diff --git a/TO-DO b/TO-DO index ae780b438e3..5df7f47e722 100644 --- a/TO-DO +++ b/TO-DO @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: TO-DO,v 1.56 2011/02/26 16:58:53 tom Exp $ +-- $Id: TO-DO,v 1.57 2011/03/28 00:23:02 tom Exp $ ------------------------------------------------------------------------------- SHORT-TERM TO-DO ITEMS: @@ -66,24 +66,6 @@ Known Problems: + the --with-pthread configuration builds for Cygwin, but does not work properly (test/worm.c shows all of the worms in the same location). -+ the Ada95 tree may require a small fix to build on Cygwin, since the GNAT - port to that platform for 3.4.4 provides an incomplete Interrupts.Names - package. For instance (your gcc version may be different): - /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads - - cut here... -------------------------------------------------------------------------------- ---- a-intnam.ads.orig 2003-10-21 13:41:51.000000000 +0000 -+++ a-intnam.ads 2007-05-05 22:40:02.609375000 +0000 -@@ -44,5 +44,6 @@ - - DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1; - DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2; -+ SIGINT : constant Interrupt_ID := 2; - - end Ada.Interrupts.Names; -------------------------------------------------------------------------------- - + the --enable-rpath configure option builds for the corresponding platforms; however combining it with --with-ticlib and --with-termlib does not always produce libraries that can be run without setting environment variables. diff --git a/aclocal.m4 b/aclocal.m4 index 06a636a7a9b..9a828559d4a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.549 2011/02/21 01:40:21 tom Exp $ +dnl $Id: aclocal.m4,v 1.553 2011/03/31 23:35:38 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -1769,10 +1769,12 @@ rm -rf conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_GENERICS version: 1 updated: 2010/11/13 14:15:18 +dnl CF_GNAT_GENERICS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- AC_DEFUN([CF_GNAT_GENERICS], [ +AC_REQUIRE([CF_GNAT_VERSION]) + AC_MSG_CHECKING(if GNAT supports generics) case $cf_gnat_version in #(vi 3.[[1-9]]*|[[4-9]].*) #(vi @@ -1826,28 +1828,92 @@ fi AC_SUBST(PRAGMA_UNREF) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_PROJECTS version: 1 updated: 2010/11/13 14:15:18 +dnl CF_GNAT_PROJECTS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- +dnl GNAT projects are configured with ".gpr" project files. +dnl GNAT libraries are a further development, using the project feature. AC_DEFUN([CF_GNAT_PROJECTS], [ +AC_REQUIRE([CF_GNAT_VERSION]) + +cf_gnat_libraries=no +cf_gnat_projects=no + AC_MSG_CHECKING(if GNAT supports project files) case $cf_gnat_version in #(vi 3.[[0-9]]*) #(vi - cf_gnat_projects=no ;; *) case $cf_cv_system_name in #(vi cygwin*) #(vi - cf_gnat_projects=no ;; *) - cf_gnat_projects=yes + mkdir conftest.src conftest.bin conftest.lib + cd conftest.src + rm -rf conftest* *~conftest* + cat >>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* ;; esac ;; esac AC_MSG_RESULT($cf_gnat_projects) +if test $cf_gnat_projects = yes +then + AC_MSG_CHECKING(if GNAT supports libraries) + AC_MSG_RESULT($cf_gnat_libraries) +fi + if test "$cf_gnat_projects" = yes then USE_OLD_MAKERULES="#" @@ -1857,11 +1923,66 @@ else USE_GNAT_PROJECTS="#" fi +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + AC_SUBST(USE_OLD_MAKERULES) AC_SUBST(USE_GNAT_PROJECTS) +AC_SUBST(USE_GNAT_LIBRARIES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37 +dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 +dnl -------------- +dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it +dnl is noted that gnat may compile a tasking unit even for configurations which +dnl fail at runtime. +AC_DEFUN([CF_GNAT_SIGINT],[ +AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ +CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; + +package ConfTest is + + pragma Warnings (Off); -- the next pragma exists since 3.11p + pragma Unreserve_All_Interrupts; + pragma Warnings (On); + + protected Process is + procedure Stop; + function Continue return Boolean; + pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); + private + Done : Boolean := False; + end Process; + +end ConfTest;], +[package body ConfTest is + protected body Process is + procedure Stop is + begin + Done := True; + end Stop; + function Continue return Boolean is + begin + return not Done; + end Continue; + end Process; +end ConfTest;], + [cf_cv_gnat_sigint=yes], + [cf_cv_gnat_sigint=no])]) + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi +AC_SUBST(USE_GNAT_SIGINT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1873,7 +1994,7 @@ dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ -rm -rf conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.ads </dev/null | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` diff --git a/announce.html.in b/announce.html.in index da9298a298d..e385204de50 100644 --- a/announce.html.in +++ b/announce.html.in @@ -1,6 +1,6 @@ @@ -66,22 +66,24 @@

OPTIONS

        --cflags
               echos  the gnat (Ada compiler) flags needed to com-
-              pile with adacurses
+              pile with AdaCurses.
 
        --libs echos  the  gnat  libraries  needed  to  link  with
-              adacurses
+              AdaCurses.
 
        --version
-              echos the release+patchdate version of adacurses
+              echos  the release+patchdate version of the ncurses
+              libraries used to configure and build AdaCurses.
 
-       --help prints this message
+       --help prints a  list  of  the  adacurses-config  script's
+              options.
 
 
 

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index 05f36871ed2..aeacdd39cab 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -208,7 +208,7 @@
 

SEE ALSO

        infocmp(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html index 2edf5a9aa97..138806fc487 100644 --- a/doc/html/man/clear.1.html +++ b/doc/html/man/clear.1.html @@ -69,7 +69,7 @@

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html
index 38f14c49e80..86e3317cfc5 100644
--- a/doc/html/man/form.3x.html
+++ b/doc/html/man/form.3x.html
@@ -243,7 +243,7 @@
 
 

SEE ALSO

-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html
index c68f477552a..553e3854858 100644
--- a/doc/html/man/infocmp.1m.html
+++ b/doc/html/man/infocmp.1m.html
@@ -423,7 +423,7 @@
        captoinfo(1m),    infotocap(1m),     tic(1m),     toe(1m),
        curses(3x), terminfo(5).
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html index a8c7267ad68..a143e45fc5e 100644 --- a/doc/html/man/infotocap.1m.html +++ b/doc/html/man/infotocap.1m.html @@ -94,7 +94,7 @@

SEE ALSO

        curses(3x), tic(1m), infocmp(1m), terminfo(5)
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html index 1e6d95a2f03..adfde4cdcca 100644 --- a/doc/html/man/menu.3x.html +++ b/doc/html/man/menu.3x.html @@ -226,7 +226,7 @@

SEE ALSO

-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index 57f28a07111..576b1a15ec4 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -63,7 +63,7 @@
        sonable   optimization.    This  implementation  is  ``new
        curses'' (ncurses) and is  the  approved  replacement  for
        4.4BSD  classic curses, which has been discontinued.  This
-       describes ncurses version 5.8 (patch 20110226).
+       describes ncurses version 5.9 (patch 20110404).
 
        The ncurses library emulates the curses library of  System
        V  Release  4  UNIX,  and  XPG4 (X/Open Portability Guide)
diff --git a/doc/html/man/ncurses5-config.1.html b/doc/html/man/ncurses5-config.1.html
index 4ead0ebc8c4..2169bb90802 100644
--- a/doc/html/man/ncurses5-config.1.html
+++ b/doc/html/man/ncurses5-config.1.html
@@ -118,7 +118,7 @@
 

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html
index 216839e3157..c73e2416272 100644
--- a/doc/html/man/panel.3x.html
+++ b/doc/html/man/panel.3x.html
@@ -218,7 +218,7 @@
 

SEE ALSO

        curses(3x), curs_variables(3x),
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html index 7fb8d39db56..a8781acdcbf 100644 --- a/doc/html/man/tabs.1.html +++ b/doc/html/man/tabs.1.html @@ -156,7 +156,7 @@

SEE ALSO

        tset(1), infocmp(1m), curses(3x), terminfo(5).
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
index 445f3c54b72..0340f50522b 100644
--- a/doc/html/man/terminfo.5.html
+++ b/doc/html/man/terminfo.5.html
@@ -78,7 +78,7 @@
        nals by giving a set of capabilities which they  have,  by
        specifying how to perform screen operations, and by speci-
        fying padding requirements and  initialization  sequences.
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
        Entries in terminfo consist of a sequence of `,' separated
        fields (embedded commas may be escaped with a backslash or
diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html
index 9b246b5d237..9d05671623d 100644
--- a/doc/html/man/tic.1m.html
+++ b/doc/html/man/tic.1m.html
@@ -309,7 +309,7 @@
        infocmp(1m),    captoinfo(1m),   infotocap(1m),   toe(1m),
        curses(3x), terminfo(5).
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html index b948480e0c9..925d3908c7f 100644 --- a/doc/html/man/toe.1m.html +++ b/doc/html/man/toe.1m.html @@ -111,7 +111,7 @@ tic(1m), infocmp(1m), captoinfo(1m), infotocap(1m), curses(3x), terminfo(5). - This describes ncurses version 5.8 (patch 20110226). + This describes ncurses version 5.9 (patch 20110404). diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html index e702f7bacef..c04914f1a2f 100644 --- a/doc/html/man/tput.1.html +++ b/doc/html/man/tput.1.html @@ -328,7 +328,7 @@

SEE ALSO

        clear(1), stty(1), tabs(1), terminfo(5).
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html
index fe3d63ffb59..2b86f9f2174 100644
--- a/doc/html/man/tset.1.html
+++ b/doc/html/man/tset.1.html
@@ -319,7 +319,7 @@
        csh(1), sh(1), stty(1),  curs_terminfo(3x),  tty(4),  ter-
        minfo(5), ttys(5), environ(7)
 
-       This describes ncurses version 5.8 (patch 20110226).
+       This describes ncurses version 5.9 (patch 20110404).
 
 
 
diff --git a/include/ncurses_defs b/include/ncurses_defs
index cab12f842b2..42d5908457c 100644
--- a/include/ncurses_defs
+++ b/include/ncurses_defs
@@ -1,4 +1,4 @@
-# $Id: ncurses_defs,v 1.45 2011/01/15 18:19:51 tom Exp $
+# $Id: ncurses_defs,v 1.46 2011/03/22 09:17:59 tom Exp $
 ##############################################################################
 # Copyright (c) 2000-2010,2011 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -85,6 +85,7 @@ HAVE_LIMITS_H
 HAVE_LINK
 HAVE_LOCALE_H
 HAVE_LONG_FILE_NAMES
+HAVE_MATH_H
 HAVE_MBLEN
 HAVE_MBRLEN
 HAVE_MBRTOWC
@@ -141,8 +142,8 @@ HAVE_TERMATTRS	1
 HAVE_TERMIOS_H
 HAVE_TERMIO_H
 HAVE_TERMNAME	1
-HAVE_TERM_H	1
 HAVE_TERM_ENTRY_H	1
+HAVE_TERM_H	1
 HAVE_TGETENT	1
 HAVE_TIGETNUM	1
 HAVE_TIGETSTR	1
@@ -164,9 +165,9 @@ HAVE_WCTOB
 HAVE_WCTOMB
 HAVE_WCTYPE_H
 HAVE_WINSSTR	1
-HAVE_WSYNCDOWN	1
 HAVE_WORKING_POLL
 HAVE_WRESIZE
+HAVE_WSYNCDOWN	1
 HAVE__DOSCAN
 MIXEDCASE_FILENAMES
 NCURSES_CHAR_EQ
diff --git a/man/MKada_config.in b/man/MKada_config.in
index 487a9a82393..2be3c419ec8 100644
--- a/man/MKada_config.in
+++ b/man/MKada_config.in
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2010 Free Software Foundation, Inc.                        *
+.\" Copyright (c) 2010,2011 Free Software Foundation, Inc.                   *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -26,12 +26,12 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: MKada_config.in,v 1.3 2010/03/06 22:29:06 tom Exp $
+.\" $Id: MKada_config.in,v 1.5 2011/03/26 14:44:51 tom Exp $
 .TH ADACURSES "1" "" "" "User Commands"
 .SH NAME
-adacurses-config \- helper script for AdaCurses libraries
+adacurses\-config \- helper script for AdaCurses libraries
 .SH SYNOPSIS
-.B adacurses-config
+.B adacurses\-config
 [\fIoptions\fR]
 .SH DESCRIPTION
 This is a shell script which simplifies configuring an application to use
@@ -39,16 +39,17 @@ the AdaCurses library binding to ncurses.
 .SH OPTIONS
 .TP
 \fB\-\-cflags\fR
-echos the gnat (Ada compiler) flags needed to compile with adacurses
+echos the gnat (Ada compiler) flags needed to compile with AdaCurses.
 .TP
 \fB\-\-libs\fR
-echos the gnat libraries needed to link with adacurses
+echos the gnat libraries needed to link with AdaCurses.
 .TP
 \fB\-\-version\fR
-echos the release+patchdate version of adacurses
+echos the release+patchdate version of the ncurses libraries used
+to configure and build AdaCurses.
 .TP
 \fB\-\-help\fR
-prints this message
+prints a list of the \fBadacurses\-config\fP script's options.
 .SH "SEE ALSO"
 \fBcurses\fR(3X)
 .PP
diff --git a/misc/ncurses-config.in b/misc/ncurses-config.in
index 06261a747fc..a9c0ac5396a 100644
--- a/misc/ncurses-config.in
+++ b/misc/ncurses-config.in
@@ -1,7 +1,7 @@
 #!@SHELL@
-# $Id: ncurses-config.in,v 1.24 2010/02/06 22:12:16 Miroslav.Lichvar Exp $
+# $Id: ncurses-config.in,v 1.25 2011/03/19 22:43:38 tom Exp $
 ##############################################################################
-# Copyright (c) 2006-2009,2010 Free Software Foundation, Inc.                #
+# Copyright (c) 2006-2010,2011 Free 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"), #
@@ -72,12 +72,12 @@ while test $# -gt 0; do
 	# compile/link
 	--cflags)
 		INCS=
-		if test "${includedir}" != /usr/include ; then
-			INCS="-I${includedir}"
-		fi
 		if test "x@WITH_OVERWRITE@" = xno ; then
 			INCS="$INCS -I${includedir}/${THIS}"
 		fi
+		if test "${includedir}" != /usr/include ; then
+			INCS="$INCS -I${includedir}"
+		fi
 		sed -e 's,^[ ]*,,' -e 's, [ ]*, ,g' -e 's,[ ]*$,,' <<-ENDECHO
 			$INCS
 ENDECHO
diff --git a/ncurses/base/lib_newwin.c b/ncurses/base/lib_newwin.c
index 2b120eac10c..72d8af84b70 100644
--- a/ncurses/base/lib_newwin.c
+++ b/ncurses/base/lib_newwin.c
@@ -43,7 +43,7 @@
 #include 
 #include 
 
-MODULE_ID("$Id: lib_newwin.c,v 1.68 2011/01/22 20:34:15 tom Exp $")
+MODULE_ID("$Id: lib_newwin.c,v 1.69 2011/03/07 21:58:17 tom Exp $")
 
 #define window_is(name) ((sp)->_##name == win)
 
@@ -141,7 +141,7 @@ NCURSES_SP_NAME(newwin) (NCURSES_SP_DCLx
     T((T_CALLED("newwin(%p, %d,%d,%d,%d)"), (void *) SP_PARM, num_lines, num_columns,
        begy, begx));
 
-    if (begy < 0 || begx < 0 || num_lines <= 0 || num_columns <= 0)
+    if (begy < 0 || begx < 0 || num_lines < 0 || num_columns < 0)
 	returnWin(0);
 
     if (num_lines == 0)
@@ -198,7 +198,7 @@ derwin(WINDOW *orig, int num_lines, int num_columns, int begy, int begx)
     /*
      * make sure window fits inside the original one
      */
-    if (begy < 0 || begx < 0 || orig == 0 || num_lines <= 0 || num_columns <= 0)
+    if (begy < 0 || begx < 0 || orig == 0 || num_lines < 0 || num_columns < 0)
 	returnWin(0);
     if (begy + num_lines > orig->_maxy + 1
 	|| begx + num_columns > orig->_maxx + 1)
diff --git a/ncurses/base/lib_slk.c b/ncurses/base/lib_slk.c
index 7a2eecd9e56..84f17ae0370 100644
--- a/ncurses/base/lib_slk.c
+++ b/ncurses/base/lib_slk.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -47,7 +47,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_slk.c,v 1.47 2010/12/25 22:58:58 tom Exp $")
+MODULE_ID("$Id: lib_slk.c,v 1.48 2011/03/05 21:21:52 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define NumLabels    InfoOf(SP_PARM).numlabels
@@ -138,7 +138,7 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
 {
     int i;
     int res = OK;
-    int max_length;
+    size_t max_length;
     SCREEN *sp;
     int numlab;
 
@@ -189,9 +189,9 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
 	== NULL)
 	returnCode(slk_failed(NCURSES_SP_ARG));
 
-    max_length = SP_PARM->_slk->maxlen;
+    max_length = (size_t) SP_PARM->_slk->maxlen;
     for (i = 0; i < SP_PARM->_slk->labcnt; i++) {
-	size_t used = (size_t) max_length + 1;
+	size_t used = max_length + 1;
 
 	SP_PARM->_slk->ent[i].ent_text = (char *) _nc_doalloc(0, used);
 	if (SP_PARM->_slk->ent[i].ent_text == 0)
@@ -202,8 +202,10 @@ _nc_slk_initialize(WINDOW *stwin, int cols)
 	if (SP_PARM->_slk->ent[i].form_text == 0)
 	    returnCode(slk_failed(NCURSES_SP_ARG));
 
-	memset(SP_PARM->_slk->ent[i].form_text, ' ', used - 1);
-	SP_PARM->_slk->ent[i].form_text[used] = '\0';
+	if (used > 1) {
+	    memset(SP_PARM->_slk->ent[i].form_text, ' ', used - 1);
+	}
+	SP_PARM->_slk->ent[i].form_text[used - 1] = '\0';
 
 	SP_PARM->_slk->ent[i].visible = (char) (i < SP_PARM->_slk->maxlab);
     }
diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c
index a8491fcbf57..38d3130a54c 100644
--- a/ncurses/widechar/lib_add_wch.c
+++ b/ncurses/widechar/lib_add_wch.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2004-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 2004-2010,2011 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -39,7 +39,7 @@
 #include 
 #endif
 
-MODULE_ID("$Id: lib_add_wch.c,v 1.11 2010/12/19 01:32:55 tom Exp $")
+MODULE_ID("$Id: lib_add_wch.c,v 1.12 2011/03/22 09:31:15 Petr.Pavlu Exp $")
 
 /* clone/adapt lib_addch.c */
 static const cchar_t blankchar = NewChar(BLANK_TEXT);
@@ -308,7 +308,7 @@ wadd_wch_nosync(WINDOW *win, cchar_t ch)
 
     /*
      * If we are using the alternate character set, forget about locale.
-     * Otherwise, if the locale * claims the code is printable, treat it that
+     * Otherwise, if the locale claims the code is printable, treat it that
      * way.
      */
     if ((AttrOf(ch) & A_ALTCHARSET)
diff --git a/test/aclocal.m4 b/test/aclocal.m4
index 41641b507f5..4e3343144a4 100644
--- a/test/aclocal.m4
+++ b/test/aclocal.m4
@@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written       *
 dnl authorization.                                                           *
 dnl***************************************************************************
 dnl
-dnl $Id: aclocal.m4,v 1.49 2011/01/15 23:47:10 tom Exp $
+dnl $Id: aclocal.m4,v 1.50 2011/03/24 08:28:07 tom Exp $
 dnl
 dnl Author: Thomas E. Dickey
 dnl
@@ -624,7 +624,7 @@ fi
 AC_CHECK_HEADERS($cf_cv_ncurses_header)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 31 updated: 2010/10/23 15:54:49
+dnl CF_CURSES_LIBS version: 33 updated: 2011/03/06 12:37:18
 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.
@@ -655,8 +655,20 @@ hpux10.*) #(vi
         ac_cv_func_initscr=yes
         ])])
     ;;
-linux*) # Suse Linux does not follow /usr/lib convention
-    CF_ADD_LIBDIR(/lib)
+linux*)
+	case `arch 2>/dev/null` in
+	x86_64)
+		if test -d /lib64
+		then
+			CF_ADD_LIBDIR(/lib64)
+		else
+			CF_ADD_LIBDIR(/lib)
+		fi
+		;;
+	*)
+		CF_ADD_LIBDIR(/lib)
+		;;
+	esac
     ;;
 sunos3*|sunos4*)
     if test -d /usr/5lib ; then
@@ -2164,7 +2176,7 @@ else
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09
+dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24
 dnl -------------
 dnl Check for the package-config program, unless disabled by command-line.
 AC_DEFUN([CF_PKG_CONFIG],
@@ -2181,7 +2193,7 @@ no) #(vi
 	PKG_CONFIG=none
 	;;
 yes) #(vi
-	AC_PATH_PROG(PKG_CONFIG, pkg-config, none)
+	AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)
 	;;
 *)
 	PKG_CONFIG=$withval
@@ -2663,7 +2675,7 @@ CF_NO_LEAKS_OPTION(valgrind,
 	[USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_CURSES version: 10 updated: 2010/10/23 15:54:49
+dnl CF_XOPEN_CURSES version: 11 updated: 2011/01/18 18:15:30
 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.
@@ -2678,7 +2690,7 @@ AC_TRY_LINK([
 #include 
 #include <${cf_cv_ncurses_header:-curses.h}>],[
 #if defined(NCURSES_VERSION_PATCH)
-if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
+#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
 	make an error
 #endif
 #endif
@@ -2702,7 +2714,7 @@ if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42
+dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37
 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,
@@ -2721,6 +2733,9 @@ case $host_os in #(vi
 aix[[456]]*) #(vi
 	cf_xopen_source="-D_ALL_SOURCE"
 	;;
+cygwin) #(vi
+	cf_XOPEN_SOURCE=600
+	;;
 darwin[[0-8]].*) #(vi
 	cf_xopen_source="-D_APPLE_C_SOURCE"
 	;;
@@ -2942,7 +2957,7 @@ elif test "$cf_x_athena_inc" != default ; then
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA_LIBS version: 9 updated: 2010/06/02 05:03:05
+dnl CF_X_ATHENA_LIBS version: 10 updated: 2011/02/13 13:31:33
 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.
@@ -2972,7 +2987,11 @@ do
 				CF_ADD_LIBS($cf_lib)
 				AC_MSG_CHECKING(for $cf_test in $cf_lib)
 			fi
-			AC_TRY_LINK([],[$cf_test()],
+			AC_TRY_LINK([
+#include 
+#include 
+],[
+$cf_test((XtAppContext) 0)],
 				[cf_result=yes],
 				[cf_result=no])
 			AC_MSG_RESULT($cf_result)
diff --git a/test/configure b/test/configure
index ab87e4eaed5..2937235eab6 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.20101001.
+# Generated by Autoconf 2.52.20101002.
 #
 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
 # Free Software Foundation, Inc.
@@ -767,7 +767,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.20101001.  Invocation command line was
+generated by GNU Autoconf 2.52.20101002.  Invocation command line was
 
   $ $0 $@
 
@@ -2842,6 +2842,9 @@ case $host_os in #(vi
 aix[456]*) #(vi
 	cf_xopen_source="-D_ALL_SOURCE"
 	;;
+cygwin) #(vi
+	cf_XOPEN_SOURCE=600
+	;;
 darwin[0-8].*) #(vi
 	cf_xopen_source="-D_APPLE_C_SOURCE"
 	;;
@@ -2867,14 +2870,14 @@ irix[56].*) #(vi
 	;;
 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
 
-echo "$as_me:2870: checking if we must define _GNU_SOURCE" >&5
+echo "$as_me:2873: 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 2877 "configure"
+#line 2880 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -2889,16 +2892,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2892: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2895: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2895: \$? = $ac_status" >&5
+  echo "$as_me:2898: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2898: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2901: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2901: \$? = $ac_status" >&5
+  echo "$as_me:2904: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -2907,7 +2910,7 @@ cat conftest.$ac_ext >&5
 cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 	 cat >conftest.$ac_ext <<_ACEOF
-#line 2910 "configure"
+#line 2913 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -2922,16 +2925,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2925: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:2928: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:2928: \$? = $ac_status" >&5
+  echo "$as_me:2931: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2931: \"$ac_try\"") >&5
+  { (eval echo "$as_me:2934: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:2934: \$? = $ac_status" >&5
+  echo "$as_me:2937: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_gnu_source=no
 else
@@ -2946,7 +2949,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:2949: result: $cf_cv_gnu_source" >&5
+echo "$as_me:2952: 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"
 
@@ -2976,14 +2979,14 @@ solaris2.[1-9]) #(vi
 	cf_xopen_source="-D__EXTENSIONS__"
 	;;
 *)
-	echo "$as_me:2979: checking if we should define _XOPEN_SOURCE" >&5
+	echo "$as_me:2982: 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 2986 "configure"
+#line 2989 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -2998,16 +3001,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3004: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3004: \$? = $ac_status" >&5
+  echo "$as_me:3007: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3007: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3010: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3010: \$? = $ac_status" >&5
+  echo "$as_me:3013: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -3016,7 +3019,7 @@ cat conftest.$ac_ext >&5
 cf_save="$CPPFLAGS"
 	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
 	 cat >conftest.$ac_ext <<_ACEOF
-#line 3019 "configure"
+#line 3022 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -3031,16 +3034,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3034: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3037: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3037: \$? = $ac_status" >&5
+  echo "$as_me:3040: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3040: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3043: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3043: \$? = $ac_status" >&5
+  echo "$as_me:3046: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xopen_source=no
 else
@@ -3055,7 +3058,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3058: result: $cf_cv_xopen_source" >&5
+echo "$as_me:3061: result: $cf_cv_xopen_source" >&5
 echo "${ECHO_T}$cf_cv_xopen_source" >&6
 	if test "$cf_cv_xopen_source" != no ; then
 
@@ -3162,16 +3165,16 @@ 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:3165: checking if we should define _POSIX_C_SOURCE" >&5
+echo "$as_me:3168: 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}:3171: testing if the symbol is already defined go no further ..." 1>&5
+echo "${as_me:-configure}:3174: testing if the symbol is already defined go no further ..." 1>&5
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 3174 "configure"
+#line 3177 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -3186,16 +3189,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3189: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3192: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3192: \$? = $ac_status" >&5
+  echo "$as_me:3195: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3195: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3198: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3198: \$? = $ac_status" >&5
+  echo "$as_me:3201: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_posix_c_source=no
 else
@@ -3216,7 +3219,7 @@ cf_want_posix_source=no
 	 esac
 	 if test "$cf_want_posix_source" = yes ; then
 		cat >conftest.$ac_ext <<_ACEOF
-#line 3219 "configure"
+#line 3222 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -3231,16 +3234,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3234: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3237: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3237: \$? = $ac_status" >&5
+  echo "$as_me:3240: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3240: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3243: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3243: \$? = $ac_status" >&5
+  echo "$as_me:3246: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -3251,15 +3254,15 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 	 fi
 
-echo "${as_me:-configure}:3254: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
+echo "${as_me:-configure}:3257: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
 
 	 CFLAGS="$cf_trim_CFLAGS"
 	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
 
-echo "${as_me:-configure}:3259: testing if the second compile does not leave our definition intact error ..." 1>&5
+echo "${as_me:-configure}:3262: testing if the second compile does not leave our definition intact error ..." 1>&5
 
 	 cat >conftest.$ac_ext <<_ACEOF
-#line 3262 "configure"
+#line 3265 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -3274,16 +3277,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3277: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3280: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3280: \$? = $ac_status" >&5
+  echo "$as_me:3283: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3283: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3286: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3286: \$? = $ac_status" >&5
+  echo "$as_me:3289: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -3299,7 +3302,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:3302: result: $cf_cv_posix_c_source" >&5
+echo "$as_me:3305: 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
@@ -3471,7 +3474,7 @@ fi
 
 fi
 
-echo "$as_me:3474: checking for $CC option to accept ANSI C" >&5
+echo "$as_me:3477: 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
@@ -3479,7 +3482,7 @@ else
   ac_cv_prog_cc_stdc=no
 ac_save_CC=$CC
 cat >conftest.$ac_ext <<_ACEOF
-#line 3482 "configure"
+#line 3485 "configure"
 #include "confdefs.h"
 #include 
 #include 
@@ -3528,16 +3531,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:3531: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3534: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3534: \$? = $ac_status" >&5
+  echo "$as_me:3537: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3537: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3540: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3540: \$? = $ac_status" >&5
+  echo "$as_me:3543: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_prog_cc_stdc=$ac_arg
 break
@@ -3554,21 +3557,21 @@ fi
 
 case "x$ac_cv_prog_cc_stdc" in
   x|xno)
-    echo "$as_me:3557: result: none needed" >&5
+    echo "$as_me:3560: result: none needed" >&5
 echo "${ECHO_T}none needed" >&6 ;;
   *)
-    echo "$as_me:3560: result: $ac_cv_prog_cc_stdc" >&5
+    echo "$as_me:3563: result: $ac_cv_prog_cc_stdc" >&5
 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
     CC="$CC $ac_cv_prog_cc_stdc" ;;
 esac
 
-echo "$as_me:3565: checking for an ANSI C-conforming const" >&5
+echo "$as_me:3568: checking for an ANSI C-conforming const" >&5
 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
 if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 3571 "configure"
+#line 3574 "configure"
 #include "confdefs.h"
 
 int
@@ -3626,16 +3629,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3629: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3632: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3632: \$? = $ac_status" >&5
+  echo "$as_me:3635: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3635: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3638: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3638: \$? = $ac_status" >&5
+  echo "$as_me:3641: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_c_const=yes
 else
@@ -3645,7 +3648,7 @@ ac_cv_c_const=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:3648: result: $ac_cv_c_const" >&5
+echo "$as_me:3651: result: $ac_cv_c_const" >&5
 echo "${ECHO_T}$ac_cv_c_const" >&6
 if test $ac_cv_c_const = no; then
 
@@ -3655,7 +3658,7 @@ EOF
 
 fi
 
-echo "$as_me:3658: checking for signal global datatype" >&5
+echo "$as_me:3661: 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
@@ -3667,7 +3670,7 @@ else
 		"int"
 	do
 	cat >conftest.$ac_ext <<_ACEOF
-#line 3670 "configure"
+#line 3673 "configure"
 #include "confdefs.h"
 
 #include 
@@ -3690,16 +3693,16 @@ signal(SIGINT, handler);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3693: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3696: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3696: \$? = $ac_status" >&5
+  echo "$as_me:3699: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3699: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3702: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3702: \$? = $ac_status" >&5
+  echo "$as_me:3705: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sig_atomic_t=$cf_type
 else
@@ -3713,13 +3716,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
 
-echo "$as_me:3716: result: $cf_cv_sig_atomic_t" >&5
+echo "$as_me:3719: 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 <&5
+echo "$as_me:3725: 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.
@@ -3753,22 +3756,22 @@ else
     ECHO_CC=''
 
 fi;
-echo "$as_me:3756: result: $enableval" >&5
+echo "$as_me:3759: result: $enableval" >&5
 echo "${ECHO_T}$enableval" >&6
 
 GCC_VERSION=none
 if test "$GCC" = yes ; then
-	echo "$as_me:3761: checking version of $CC" >&5
+	echo "$as_me:3764: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
 	test -z "$GCC_VERSION" && GCC_VERSION=unknown
-	echo "$as_me:3765: result: $GCC_VERSION" >&5
+	echo "$as_me:3768: result: $GCC_VERSION" >&5
 echo "${ECHO_T}$GCC_VERSION" >&6
 fi
 
 if ( test "$GCC" = yes || test "$GXX" = yes )
 then
-echo "$as_me:3771: checking if you want to turn on gcc warnings" >&5
+echo "$as_me:3774: 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.
@@ -3785,7 +3788,7 @@ else
   with_warnings=no
 
 fi;
-echo "$as_me:3788: result: $with_warnings" >&5
+echo "$as_me:3791: result: $with_warnings" >&5
 echo "${ECHO_T}$with_warnings" >&6
 if test "$with_warnings" = "yes"
 then
@@ -3808,10 +3811,10 @@ cat > conftest.i <&5
+	{ echo "$as_me:3814: checking for $CC __attribute__ directives..." >&5
 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
 cat > conftest.$ac_ext <&5
+		if { (eval echo "$as_me:3866: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3866: \$? = $ac_status" >&5
+  echo "$as_me:3869: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:3868: result: ... $cf_attribute" >&5
+			test -n "$verbose" && echo "$as_me:3871: result: ... $cf_attribute" >&5
 echo "${ECHO_T}... $cf_attribute" >&6
 			cat conftest.h >>confdefs.h
 			case $cf_attribute in #(vi
@@ -3905,12 +3908,12 @@ INTEL_COMPILER=no
 if test "$GCC" = yes ; then
 	case $host_os in
 	linux*|gnu*)
-		echo "$as_me:3908: checking if this is really Intel C compiler" >&5
+		echo "$as_me:3911: 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 3913 "configure"
+#line 3916 "configure"
 #include "confdefs.h"
 
 int
@@ -3927,16 +3930,16 @@ make an error
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3930: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:3933: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3933: \$? = $ac_status" >&5
+  echo "$as_me:3936: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3936: \"$ac_try\"") >&5
+  { (eval echo "$as_me:3939: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:3939: \$? = $ac_status" >&5
+  echo "$as_me:3942: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   INTEL_COMPILER=yes
 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
@@ -3947,14 +3950,14 @@ cat conftest.$ac_ext >&5
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 		CFLAGS="$cf_save_CFLAGS"
-		echo "$as_me:3950: result: $INTEL_COMPILER" >&5
+		echo "$as_me:3953: result: $INTEL_COMPILER" >&5
 echo "${ECHO_T}$INTEL_COMPILER" >&6
 		;;
 	esac
 fi
 
 cat > conftest.$ac_ext <&5
+	{ echo "$as_me:3977: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS="-Wall"
@@ -3987,12 +3990,12 @@ echo "$as_me: checking for $CC warning options..." >&6;}
 		wd981
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:3990: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:3993: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:3993: \$? = $ac_status" >&5
+  echo "$as_me:3996: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:3995: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:3998: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 		fi
@@ -4001,7 +4004,7 @@ echo "${ECHO_T}... -$cf_opt" >&6
 
 elif test "$GCC" = yes
 then
-	{ echo "$as_me:4004: checking for $CC warning options..." >&5
+	{ echo "$as_me:4007: checking for $CC warning options..." >&5
 echo "$as_me: checking for $CC warning options..." >&6;}
 	cf_save_CFLAGS="$CFLAGS"
 	EXTRA_CFLAGS=
@@ -4021,12 +4024,12 @@ echo "$as_me: checking for $CC warning options..." >&6;}
 		Wundef $cf_warn_CONST
 	do
 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:4024: \"$ac_compile\"") >&5
+		if { (eval echo "$as_me:4027: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4027: \$? = $ac_status" >&5
+  echo "$as_me:4030: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:4029: result: ... -$cf_opt" >&5
+			test -n "$verbose" && echo "$as_me:4032: result: ... -$cf_opt" >&5
 echo "${ECHO_T}... -$cf_opt" >&6
 			case $cf_opt in #(vi
 			Wcast-qual) #(vi
@@ -4037,7 +4040,7 @@ echo "${ECHO_T}... -$cf_opt" >&6
 				[34].*)
 					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6
 
-echo "${as_me:-configure}:4040: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
+echo "${as_me:-configure}:4043: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
 
 					continue;;
 				esac
@@ -4053,7 +4056,7 @@ rm -rf conftest*
 fi
 fi
 
-echo "$as_me:4056: checking if you want to use dmalloc for testing" >&5
+echo "$as_me:4059: 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.
@@ -4069,7 +4072,7 @@ EOF
 else
   with_dmalloc=
 fi;
-echo "$as_me:4072: result: ${with_dmalloc:-no}" >&5
+echo "$as_me:4075: result: ${with_dmalloc:-no}" >&5
 echo "${ECHO_T}${with_dmalloc:-no}" >&6
 
 case .$with_cflags in #(vi
@@ -4163,23 +4166,23 @@ fi
 esac
 
 if test "$with_dmalloc" = yes ; then
-	echo "$as_me:4166: checking for dmalloc.h" >&5
+	echo "$as_me:4169: 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 4172 "configure"
+#line 4175 "configure"
 #include "confdefs.h"
 #include 
 _ACEOF
-if { (eval echo "$as_me:4176: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:4179: \"$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:4182: \$? = $ac_status" >&5
+  echo "$as_me:4185: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4198,11 +4201,11 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:4201: result: $ac_cv_header_dmalloc_h" >&5
+echo "$as_me:4204: 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:4205: checking for dmalloc_debug in -ldmalloc" >&5
+echo "$as_me:4208: 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
@@ -4210,7 +4213,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4213 "configure"
+#line 4216 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4229,16 +4232,16 @@ dmalloc_debug ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4232: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4235: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4235: \$? = $ac_status" >&5
+  echo "$as_me:4238: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4238: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4241: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4241: \$? = $ac_status" >&5
+  echo "$as_me:4244: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dmalloc_dmalloc_debug=yes
 else
@@ -4249,7 +4252,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4252: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
+echo "$as_me:4255: 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 <&5
+echo "$as_me:4270: 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.
@@ -4280,7 +4283,7 @@ EOF
 else
   with_dbmalloc=
 fi;
-echo "$as_me:4283: result: ${with_dbmalloc:-no}" >&5
+echo "$as_me:4286: result: ${with_dbmalloc:-no}" >&5
 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
 
 case .$with_cflags in #(vi
@@ -4374,23 +4377,23 @@ fi
 esac
 
 if test "$with_dbmalloc" = yes ; then
-	echo "$as_me:4377: checking for dbmalloc.h" >&5
+	echo "$as_me:4380: 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 4383 "configure"
+#line 4386 "configure"
 #include "confdefs.h"
 #include 
 _ACEOF
-if { (eval echo "$as_me:4387: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:4390: \"$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:4393: \$? = $ac_status" >&5
+  echo "$as_me:4396: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4409,11 +4412,11 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:4412: result: $ac_cv_header_dbmalloc_h" >&5
+echo "$as_me:4415: 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:4416: checking for debug_malloc in -ldbmalloc" >&5
+echo "$as_me:4419: 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
@@ -4421,7 +4424,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldbmalloc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 4424 "configure"
+#line 4427 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -4440,16 +4443,16 @@ debug_malloc ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4443: \"$ac_link\"") >&5
+if { (eval echo "$as_me:4446: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:4446: \$? = $ac_status" >&5
+  echo "$as_me:4449: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4449: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4452: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4452: \$? = $ac_status" >&5
+  echo "$as_me:4455: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dbmalloc_debug_malloc=yes
 else
@@ -4460,7 +4463,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:4463: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
+echo "$as_me:4466: 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 <&5
+echo "$as_me:4481: 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.
@@ -4491,7 +4494,7 @@ EOF
 else
   with_valgrind=
 fi;
-echo "$as_me:4494: result: ${with_valgrind:-no}" >&5
+echo "$as_me:4497: result: ${with_valgrind:-no}" >&5
 echo "${ECHO_T}${with_valgrind:-no}" >&6
 
 case .$with_cflags in #(vi
@@ -4584,7 +4587,7 @@ fi
 	;;
 esac
 
-echo "$as_me:4587: checking if you want to perform memory-leak testing" >&5
+echo "$as_me:4590: 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.
@@ -4594,7 +4597,7 @@ if test "${enable_leaks+set}" = set; then
 else
   : ${with_no_leaks:=no}
 fi;
-echo "$as_me:4597: result: $with_no_leaks" >&5
+echo "$as_me:4600: result: $with_no_leaks" >&5
 echo "${ECHO_T}$with_no_leaks" >&6
 
 if test "$with_no_leaks" = yes ; then
@@ -4608,7 +4611,7 @@ EOF
 
 fi
 
-echo "$as_me:4611: checking for specific curses-directory" >&5
+echo "$as_me:4614: 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.
@@ -4618,7 +4621,7 @@ if test "${with_curses_dir+set}" = set; then
 else
   cf_cv_curses_dir=no
 fi;
-echo "$as_me:4621: result: $cf_cv_curses_dir" >&5
+echo "$as_me:4624: 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" )
@@ -4649,7 +4652,7 @@ case ".$withval" in #(vi
   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:4652: error: expected a pathname, not \"$withval\"" >&5
+  { { echo "$as_me:4655: error: expected a pathname, not \"$withval\"" >&5
 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -4682,7 +4685,7 @@ if test -n "$cf_cv_curses_dir/include" ; then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 4685 "configure"
+#line 4688 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -4694,16 +4697,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4697: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4700: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4700: \$? = $ac_status" >&5
+  echo "$as_me:4703: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4703: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4706: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4706: \$? = $ac_status" >&5
+  echo "$as_me:4709: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -4720,7 +4723,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}:4723: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:4726: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -4754,7 +4757,7 @@ if test -n "$cf_cv_curses_dir/lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:4757: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:4760: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -4795,7 +4798,7 @@ fi;
 case $cf_cv_screen in
 curses)
 
-echo "$as_me:4798: checking for extra include directories" >&5
+echo "$as_me:4801: 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
@@ -4815,11 +4818,11 @@ sunos3*|sunos4*)
 esac
 
 fi
-echo "$as_me:4818: result: $cf_cv_curses_incdir" >&5
+echo "$as_me:4821: 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"
 
-echo "$as_me:4822: checking if we have identified curses headers" >&5
+echo "$as_me:4825: 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
@@ -4831,7 +4834,7 @@ for cf_header in  \
 	ncurses.h ncurses/curses.h ncurses/ncurses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 4834 "configure"
+#line 4837 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -4843,16 +4846,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4846: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4849: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4849: \$? = $ac_status" >&5
+  echo "$as_me:4852: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4852: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4855: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4855: \$? = $ac_status" >&5
+  echo "$as_me:4858: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -4863,11 +4866,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:4866: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:4869: 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:4870: error: No curses header-files found" >&5
+	{ { echo "$as_me:4873: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -4877,23 +4880,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:4880: checking for $ac_header" >&5
+echo "$as_me:4883: 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 4886 "configure"
+#line 4889 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:4890: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:4893: \"$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:4896: \$? = $ac_status" >&5
+  echo "$as_me:4899: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -4912,7 +4915,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:4915: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:4918: 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 <&5
+echo "$as_me:4928: 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
@@ -4940,7 +4943,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 4943 "configure"
+#line 4946 "configure"
 #include "confdefs.h"
 #include 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -4955,16 +4958,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4958: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:4961: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:4961: \$? = $ac_status" >&5
+  echo "$as_me:4964: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4964: \"$ac_try\"") >&5
+  { (eval echo "$as_me:4967: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:4967: \$? = $ac_status" >&5
+  echo "$as_me:4970: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_term_header="$cf_test"
@@ -4980,7 +4983,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:4983: result: $cf_cv_term_header" >&5
+echo "$as_me:4986: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -5009,7 +5012,7 @@ EOF
 	;;
 esac
 
-echo "$as_me:5012: checking for ncurses version" >&5
+echo "$as_me:5015: 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
@@ -5035,10 +5038,10 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:5038: \"$cf_try\"") >&5
+	{ (eval echo "$as_me:5041: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:5041: \$? = $ac_status" >&5
+  echo "$as_me:5044: \$? = $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%".*%%'`
@@ -5048,7 +5051,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 5051 "configure"
+#line 5054 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5073,15 +5076,15 @@ int main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5076: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5079: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5079: \$? = $ac_status" >&5
+  echo "$as_me:5082: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5081: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5084: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5084: \$? = $ac_status" >&5
+  echo "$as_me:5087: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -5095,16 +5098,16 @@ fi
 	rm -f $cf_tempfile
 
 fi
-echo "$as_me:5098: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:5101: 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:5104: checking if we have identified curses libraries" >&5
+echo "$as_me:5107: 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 5107 "configure"
+#line 5110 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -5116,16 +5119,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5119: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5122: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5122: \$? = $ac_status" >&5
+  echo "$as_me:5125: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5125: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5128: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5128: \$? = $ac_status" >&5
+  echo "$as_me:5131: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -5134,13 +5137,13 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-echo "$as_me:5137: result: $cf_result" >&5
+echo "$as_me:5140: 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:5143: checking for tgoto in -lmytinfo" >&5
+    echo "$as_me:5146: 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
@@ -5148,7 +5151,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5151 "configure"
+#line 5154 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5167,16 +5170,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5170: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5173: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5173: \$? = $ac_status" >&5
+  echo "$as_me:5176: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5176: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5179: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5179: \$? = $ac_status" >&5
+  echo "$as_me:5182: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -5187,7 +5190,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5190: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:5193: 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
   LIBS="-lmytinfo $LIBS"
@@ -5195,7 +5198,7 @@ fi
 
     ;;
 hpux10.*) #(vi
-    echo "$as_me:5198: checking for initscr in -lcur_colr" >&5
+    echo "$as_me:5201: 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
@@ -5203,7 +5206,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lcur_colr  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5206 "configure"
+#line 5209 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5222,16 +5225,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5225: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5228: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5228: \$? = $ac_status" >&5
+  echo "$as_me:5231: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5231: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5234: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5234: \$? = $ac_status" >&5
+  echo "$as_me:5237: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_cur_colr_initscr=yes
 else
@@ -5242,7 +5245,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5245: result: $ac_cv_lib_cur_colr_initscr" >&5
+echo "$as_me:5248: 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
 
@@ -5251,7 +5254,7 @@ if test $ac_cv_lib_cur_colr_initscr = yes; then
 
 else
 
-    echo "$as_me:5254: checking for initscr in -lHcurses" >&5
+    echo "$as_me:5257: 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
@@ -5259,7 +5262,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lHcurses  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5262 "configure"
+#line 5265 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5278,16 +5281,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5281: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5284: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5284: \$? = $ac_status" >&5
+  echo "$as_me:5287: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5287: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5290: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5290: \$? = $ac_status" >&5
+  echo "$as_me:5293: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Hcurses_initscr=yes
 else
@@ -5298,7 +5301,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5301: result: $ac_cv_lib_Hcurses_initscr" >&5
+echo "$as_me:5304: 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
 
@@ -5312,7 +5315,40 @@ fi
 fi
 
     ;;
-linux*) # Suse Linux does not follow /usr/lib convention
+linux*)
+	case `arch 2>/dev/null` in
+	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
+
+echo "${as_me:-configure}:5343: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+		else
 
 if test -n "/lib" ; then
   for cf_add_libdir in /lib
@@ -5333,7 +5369,7 @@ if test -n "/lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5336: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5372: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -5341,6 +5377,39 @@ echo "${as_me:-configure}:5336: testing adding $cf_add_libdir to library-path ..
   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
+
+echo "${as_me:-configure}:5403: testing adding $cf_add_libdir to library-path ..." 1>&5
+
+        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
+      fi
+    fi
+  done
+fi
+
+		;;
+	esac
     ;;
 sunos3*|sunos4*)
     if test -d /usr/5lib ; then
@@ -5364,7 +5433,7 @@ if test -n "/usr/5lib" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:5367: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:5436: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -5392,13 +5461,13 @@ if test ".$ac_cv_func_initscr" != .yes ; then
 
     # Check for library containing tgoto.  Do this before curses library
     # because it may be needed to link the test-case for initscr.
-    echo "$as_me:5395: checking for tgoto" >&5
+    echo "$as_me:5464: 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 5401 "configure"
+#line 5470 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char tgoto (); below.  */
@@ -5429,16 +5498,16 @@ f = tgoto;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5432: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5501: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5435: \$? = $ac_status" >&5
+  echo "$as_me:5504: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5438: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5507: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5441: \$? = $ac_status" >&5
+  echo "$as_me:5510: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_tgoto=yes
 else
@@ -5448,7 +5517,7 @@ ac_cv_func_tgoto=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:5451: result: $ac_cv_func_tgoto" >&5
+echo "$as_me:5520: 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
@@ -5457,7 +5526,7 @@ else
         for cf_term_lib in $cf_check_list termcap termlib unknown
         do
             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
-echo "$as_me:5460: checking for tgoto in -l$cf_term_lib" >&5
+echo "$as_me:5529: 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
@@ -5465,7 +5534,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_term_lib  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5468 "configure"
+#line 5537 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5484,16 +5553,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5487: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5556: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5490: \$? = $ac_status" >&5
+  echo "$as_me:5559: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5493: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5562: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5496: \$? = $ac_status" >&5
+  echo "$as_me:5565: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -5504,7 +5573,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5507: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:5576: 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
@@ -5519,7 +5588,7 @@ fi
  	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:5522: checking for initscr in -l$cf_curs_lib" >&5
+echo "$as_me:5591: 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
@@ -5527,7 +5596,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l$cf_curs_lib  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 5530 "configure"
+#line 5599 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -5546,16 +5615,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5549: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5618: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5552: \$? = $ac_status" >&5
+  echo "$as_me:5621: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5555: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5624: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5558: \$? = $ac_status" >&5
+  echo "$as_me:5627: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -5566,23 +5635,23 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:5569: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:5638: 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
-    test $cf_curs_lib = unknown && { { echo "$as_me:5576: error: no curses library found" >&5
+    test $cf_curs_lib = unknown && { { echo "$as_me:5645: error: no curses library found" >&5
 echo "$as_me: error: no curses library found" >&2;}
    { (exit 1); exit 1; }; }
 
     LIBS="-l$cf_curs_lib $cf_save_LIBS"
     if test "$cf_term_lib" = unknown ; then
-        echo "$as_me:5582: checking if we can link with $cf_curs_lib library" >&5
+        echo "$as_me:5651: 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 5585 "configure"
+#line 5654 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -5594,16 +5663,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5597: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5666: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5600: \$? = $ac_status" >&5
+  echo "$as_me:5669: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5603: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5672: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5606: \$? = $ac_status" >&5
+  echo "$as_me:5675: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -5612,18 +5681,18 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-        echo "$as_me:5615: result: $cf_result" >&5
+        echo "$as_me:5684: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
-        test $cf_result = no && { { echo "$as_me:5617: error: Cannot link curses library" >&5
+        test $cf_result = no && { { echo "$as_me:5686: error: Cannot link curses library" >&5
 echo "$as_me: error: Cannot link curses library" >&2;}
    { (exit 1); exit 1; }; }
     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
         :
     elif test "$cf_term_lib" != predefined ; then
-        echo "$as_me:5623: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
+        echo "$as_me:5692: 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 5626 "configure"
+#line 5695 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -5635,16 +5704,16 @@ initscr(); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5638: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5707: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5641: \$? = $ac_status" >&5
+  echo "$as_me:5710: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5644: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5713: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5647: \$? = $ac_status" >&5
+  echo "$as_me:5716: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=no
 else
@@ -5653,7 +5722,7 @@ cat conftest.$ac_ext >&5
 
             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
             cat >conftest.$ac_ext <<_ACEOF
-#line 5656 "configure"
+#line 5725 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -5665,16 +5734,16 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5668: \"$ac_link\"") >&5
+if { (eval echo "$as_me:5737: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:5671: \$? = $ac_status" >&5
+  echo "$as_me:5740: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5674: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5743: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5677: \$? = $ac_status" >&5
+  echo "$as_me:5746: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -5686,20 +5755,20 @@ 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:5689: result: $cf_result" >&5
+        echo "$as_me:5758: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
     fi
 fi
 fi
 
-echo "$as_me:5695: checking for NetBSD form.h" >&5
+echo "$as_me:5764: 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
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 5702 "configure"
+#line 5771 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5718,16 +5787,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5721: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5790: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5724: \$? = $ac_status" >&5
+  echo "$as_me:5793: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5727: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5796: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5730: \$? = $ac_status" >&5
+  echo "$as_me:5799: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_netbsd_form_h=yes
 
@@ -5739,21 +5808,21 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:5742: result: $cf_cv_netbsd_form_h" >&5
+echo "$as_me:5811: 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
 
-echo "$as_me:5749: checking for NetBSD menu.h" >&5
+echo "$as_me:5818: 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 5756 "configure"
+#line 5825 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -5771,16 +5840,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5774: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5843: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5777: \$? = $ac_status" >&5
+  echo "$as_me:5846: \$? = $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:5849: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5783: \$? = $ac_status" >&5
+  echo "$as_me:5852: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_netbsd_menu_h=yes
 
@@ -5792,7 +5861,7 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:5795: result: $cf_cv_netbsd_menu_h" >&5
+echo "$as_me:5864: result: $cf_cv_netbsd_menu_h" >&5
 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
 
 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
@@ -5809,7 +5878,7 @@ for ac_prog in ${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:5812: checking for $ac_word" >&5
+echo "$as_me:5881: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5826,7 +5895,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_NCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:5829: found $ac_dir/$ac_word" >&5
+   echo "$as_me:5898: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -5837,10 +5906,10 @@ fi
 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
 
 if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:5840: result: $NCURSES_CONFIG" >&5
+  echo "$as_me:5909: result: $NCURSES_CONFIG" >&5
 echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "$as_me:5843: result: no" >&5
+  echo "$as_me:5912: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -5855,7 +5924,7 @@ LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
 # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:5858: checking if we have identified curses headers" >&5
+echo "$as_me:5927: 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
@@ -5869,7 +5938,7 @@ for cf_header in  \
 	ncurses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 5872 "configure"
+#line 5941 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -5881,16 +5950,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5884: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:5953: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:5887: \$? = $ac_status" >&5
+  echo "$as_me:5956: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5890: \"$ac_try\"") >&5
+  { (eval echo "$as_me:5959: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:5893: \$? = $ac_status" >&5
+  echo "$as_me:5962: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -5901,11 +5970,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:5904: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:5973: 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:5908: error: No curses header-files found" >&5
+	{ { echo "$as_me:5977: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -5915,23 +5984,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:5918: checking for $ac_header" >&5
+echo "$as_me:5987: 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 5924 "configure"
+#line 5993 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:5928: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:5997: \"$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:5934: \$? = $ac_status" >&5
+  echo "$as_me:6003: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5950,7 +6019,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:5953: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:6022: 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 <conftest.$ac_ext <<_ACEOF
-#line 6006 "configure"
+#line 6075 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -6015,16 +6084,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6018: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6087: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6021: \$? = $ac_status" >&5
+  echo "$as_me:6090: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6024: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6093: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6027: \$? = $ac_status" >&5
+  echo "$as_me:6096: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6041,7 +6110,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}:6044: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6113: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -6058,7 +6127,7 @@ fi
 
 }
 
-echo "$as_me:6061: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:6130: 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
@@ -6070,7 +6139,7 @@ else
 	do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 6073 "configure"
+#line 6142 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -6094,16 +6163,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6097: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6166: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6100: \$? = $ac_status" >&5
+  echo "$as_me:6169: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6103: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6172: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6106: \$? = $ac_status" >&5
+  echo "$as_me:6175: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -6118,14 +6187,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 	done
 
 fi
-echo "$as_me:6121: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:6190: 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:6128: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:6197: 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
@@ -6265,7 +6334,7 @@ if test -n "$cf_incdir" ; then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 6268 "configure"
+#line 6337 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -6277,16 +6346,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6280: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6349: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6283: \$? = $ac_status" >&5
+  echo "$as_me:6352: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6286: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6355: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6289: \$? = $ac_status" >&5
+  echo "$as_me:6358: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6303,7 +6372,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}:6306: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6375: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -6324,7 +6393,7 @@ fi
 		do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 6327 "configure"
+#line 6396 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -6348,16 +6417,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6351: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6420: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6354: \$? = $ac_status" >&5
+  echo "$as_me:6423: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6357: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6426: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6360: \$? = $ac_status" >&5
+  echo "$as_me:6429: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -6378,12 +6447,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:6381: error: not found" >&5
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6450: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:6386: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:6455: 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%/[^/]*$%%'`
@@ -6416,7 +6485,7 @@ if test -n "$cf_1st_incdir" ; then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 6419 "configure"
+#line 6488 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -6428,16 +6497,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6431: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6500: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6434: \$? = $ac_status" >&5
+  echo "$as_me:6503: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6437: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6506: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6440: \$? = $ac_status" >&5
+  echo "$as_me:6509: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -6454,7 +6523,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}:6457: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:6526: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -6497,7 +6566,7 @@ EOF
 	;;
 esac
 
-echo "$as_me:6500: checking for terminfo header" >&5
+echo "$as_me:6569: 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
@@ -6515,7 +6584,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 6518 "configure"
+#line 6587 "configure"
 #include "confdefs.h"
 #include 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -6530,16 +6599,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6533: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:6602: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:6536: \$? = $ac_status" >&5
+  echo "$as_me:6605: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6539: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6608: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6542: \$? = $ac_status" >&5
+  echo "$as_me:6611: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_term_header="$cf_test"
@@ -6555,7 +6624,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:6558: result: $cf_cv_term_header" >&5
+echo "$as_me:6627: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -6589,7 +6658,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:6592: checking for ncurses version" >&5
+echo "$as_me:6661: 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
@@ -6615,10 +6684,10 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:6618: \"$cf_try\"") >&5
+	{ (eval echo "$as_me:6687: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:6621: \$? = $ac_status" >&5
+  echo "$as_me:6690: \$? = $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%".*%%'`
@@ -6628,7 +6697,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 6631 "configure"
+#line 6700 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -6653,15 +6722,15 @@ int main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6656: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6725: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6659: \$? = $ac_status" >&5
+  echo "$as_me:6728: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:6661: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6730: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6664: \$? = $ac_status" >&5
+  echo "$as_me:6733: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -6675,7 +6744,7 @@ fi
 	rm -f $cf_tempfile
 
 fi
-echo "$as_me:6678: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:6747: 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
@@ -6687,7 +6756,7 @@ cf_nculib_root=ncurses
 	# to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:6690: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:6759: 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
@@ -6695,7 +6764,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6698 "configure"
+#line 6767 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6714,16 +6783,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6717: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6786: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6720: \$? = $ac_status" >&5
+  echo "$as_me:6789: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6723: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6792: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6726: \$? = $ac_status" >&5
+  echo "$as_me:6795: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -6734,10 +6803,10 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6737: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:6806: 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:6740: checking for initscr in -lgpm" >&5
+  echo "$as_me:6809: 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
@@ -6745,7 +6814,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6748 "configure"
+#line 6817 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6764,16 +6833,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6767: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6836: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6770: \$? = $ac_status" >&5
+  echo "$as_me:6839: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6773: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6842: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6776: \$? = $ac_status" >&5
+  echo "$as_me:6845: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -6784,7 +6853,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6787: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:6856: 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"
@@ -6799,7 +6868,7 @@ 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:6802: checking for tgoto in -lmytinfo" >&5
+		echo "$as_me:6871: 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
@@ -6807,7 +6876,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 6810 "configure"
+#line 6879 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -6826,16 +6895,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6829: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6898: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6832: \$? = $ac_status" >&5
+  echo "$as_me:6901: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6835: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6904: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6838: \$? = $ac_status" >&5
+  echo "$as_me:6907: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -6846,7 +6915,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:6849: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:6918: 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"
@@ -6865,13 +6934,13 @@ else
 
 	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
 	cf_libdir=""
-	echo "$as_me:6868: checking for initscr" >&5
+	echo "$as_me:6937: 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 6874 "configure"
+#line 6943 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -6902,16 +6971,16 @@ f = initscr;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6905: \"$ac_link\"") >&5
+if { (eval echo "$as_me:6974: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6908: \$? = $ac_status" >&5
+  echo "$as_me:6977: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6911: \"$ac_try\"") >&5
+  { (eval echo "$as_me:6980: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6914: \$? = $ac_status" >&5
+  echo "$as_me:6983: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -6921,18 +6990,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:6924: result: $ac_cv_func_initscr" >&5
+echo "$as_me:6993: 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:6931: checking for initscr in -l$cf_nculib_root" >&5
+		echo "$as_me:7000: 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 6935 "configure"
+#line 7004 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -6944,25 +7013,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6947: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7016: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:6950: \$? = $ac_status" >&5
+  echo "$as_me:7019: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6953: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7022: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:6956: \$? = $ac_status" >&5
+  echo "$as_me:7025: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:6958: result: yes" >&5
+  echo "$as_me:7027: 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:6965: result: no" >&5
+echo "$as_me:7034: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -7052,11 +7121,11 @@ cf_search="$cf_library_path_list $cf_search"
 
 			for cf_libdir in $cf_search
 			do
-				echo "$as_me:7055: checking for -l$cf_nculib_root in $cf_libdir" >&5
+				echo "$as_me:7124: 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 7059 "configure"
+#line 7128 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -7068,25 +7137,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7071: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7140: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7074: \$? = $ac_status" >&5
+  echo "$as_me:7143: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7077: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7146: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7080: \$? = $ac_status" >&5
+  echo "$as_me:7149: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:7082: result: yes" >&5
+  echo "$as_me:7151: 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:7089: result: no" >&5
+echo "$as_me:7158: result: no" >&5
 echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
@@ -7101,7 +7170,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-	{ { echo "$as_me:7104: error: Cannot link $cf_nculib_root library" >&5
+	{ { echo "$as_me:7173: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -7109,7 +7178,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:7112: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+	echo "$as_me:7181: 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
@@ -7119,7 +7188,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
 		fi
 	done
 	cat >conftest.$ac_ext <<_ACEOF
-#line 7122 "configure"
+#line 7191 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -7131,23 +7200,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7134: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7203: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7137: \$? = $ac_status" >&5
+  echo "$as_me:7206: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7140: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7209: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7143: \$? = $ac_status" >&5
+  echo "$as_me:7212: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:7145: result: yes" >&5
+  echo "$as_me:7214: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:7150: result: no" >&5
+echo "$as_me:7219: result: no" >&5
 echo "${ECHO_T}no" >&6
 		 LIBS="$cf_ncurses_SAVE"
 fi
@@ -7166,7 +7235,7 @@ fi
 ncursesw)
 	cf_cv_libtype=w
 
-echo "$as_me:7169: checking for multibyte character support" >&5
+echo "$as_me:7238: 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
@@ -7174,7 +7243,7 @@ else
 
 	cf_save_LIBS="$LIBS"
 	cat >conftest.$ac_ext <<_ACEOF
-#line 7177 "configure"
+#line 7246 "configure"
 #include "confdefs.h"
 
 #include 
@@ -7187,16 +7256,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7190: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7259: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7193: \$? = $ac_status" >&5
+  echo "$as_me:7262: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7196: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7265: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7199: \$? = $ac_status" >&5
+  echo "$as_me:7268: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_utf8_lib=yes
 else
@@ -7208,12 +7277,12 @@ cat conftest.$ac_ext >&5
 cf_cv_header_path_utf8=
 cf_cv_library_path_utf8=
 
-echo "${as_me:-configure}:7211: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7280: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
 
 cf_save_LIBS="$LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 7216 "configure"
+#line 7285 "configure"
 #include "confdefs.h"
 
 #include 
@@ -7226,16 +7295,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7229: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7298: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7232: \$? = $ac_status" >&5
+  echo "$as_me:7301: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7235: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7304: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7238: \$? = $ac_status" >&5
+  echo "$as_me:7307: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_find_linkage_utf8=yes
@@ -7249,7 +7318,7 @@ cat conftest.$ac_ext >&5
 LIBS="-lutf8  $cf_save_LIBS"
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 7252 "configure"
+#line 7321 "configure"
 #include "confdefs.h"
 
 #include 
@@ -7262,16 +7331,16 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7265: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7334: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7268: \$? = $ac_status" >&5
+  echo "$as_me:7337: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7271: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7340: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7274: \$? = $ac_status" >&5
+  echo "$as_me:7343: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_find_linkage_utf8=yes
@@ -7288,9 +7357,9 @@ cat conftest.$ac_ext >&5
 
     test -n "$verbose" && echo "	find linkage for utf8 library" 1>&6
 
-echo "${as_me:-configure}:7291: testing find linkage for utf8 library ..." 1>&5
+echo "${as_me:-configure}:7360: testing find linkage for utf8 library ..." 1>&5
 
-echo "${as_me:-configure}:7293: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7362: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
 
     cf_save_CPPFLAGS="$CPPFLAGS"
     cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7403,11 +7472,11 @@ cf_search="$cf_search $cf_header_path_list"
       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}:7406: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7475: 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 7410 "configure"
+#line 7479 "configure"
 #include "confdefs.h"
 
 #include 
@@ -7420,21 +7489,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7423: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7492: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7426: \$? = $ac_status" >&5
+  echo "$as_me:7495: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7429: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7498: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7432: \$? = $ac_status" >&5
+  echo "$as_me:7501: \$? = $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}:7437: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7506: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
 
             cf_cv_find_linkage_utf8=maybe
             cf_test_CPPFLAGS="$CPPFLAGS"
@@ -7452,7 +7521,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
     if test "$cf_cv_find_linkage_utf8" = maybe ; then
 
-echo "${as_me:-configure}:7455: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
+echo "${as_me:-configure}:7524: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
 
       cf_save_LIBS="$LIBS"
       cf_save_LDFLAGS="$LDFLAGS"
@@ -7549,13 +7618,13 @@ cf_search="$cf_library_path_list $cf_search"
           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}:7552: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7621: 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 7558 "configure"
+#line 7627 "configure"
 #include "confdefs.h"
 
 #include 
@@ -7568,21 +7637,21 @@ putwc(0,0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7571: \"$ac_link\"") >&5
+if { (eval echo "$as_me:7640: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:7574: \$? = $ac_status" >&5
+  echo "$as_me:7643: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7577: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7646: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7580: \$? = $ac_status" >&5
+  echo "$as_me:7649: \$? = $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}:7585: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
+echo "${as_me:-configure}:7654: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
 
                 cf_cv_find_linkage_utf8=yes
                 cf_cv_library_file_utf8="-lutf8"
@@ -7624,7 +7693,7 @@ fi
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:7627: result: $cf_cv_utf8_lib" >&5
+echo "$as_me:7696: 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
@@ -7658,7 +7727,7 @@ if test -n "$cf_cv_header_path_utf8" ; then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 7661 "configure"
+#line 7730 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -7670,16 +7739,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7673: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7742: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7676: \$? = $ac_status" >&5
+  echo "$as_me:7745: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7679: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7748: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7682: \$? = $ac_status" >&5
+  echo "$as_me:7751: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7696,7 +7765,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}:7699: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:7768: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7730,7 +7799,7 @@ if test -n "$cf_cv_library_path_utf8" ; then
       if test "$cf_have_libdir" = no ; then
         test -n "$verbose" && echo "	adding $cf_add_libdir to library-path" 1>&6
 
-echo "${as_me:-configure}:7733: testing adding $cf_add_libdir to library-path ..." 1>&5
+echo "${as_me:-configure}:7802: testing adding $cf_add_libdir to library-path ..." 1>&5
 
         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
       fi
@@ -7748,7 +7817,7 @@ for ac_prog in ${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:7751: checking for $ac_word" >&5
+echo "$as_me:7820: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7765,7 +7834,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_NCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:7768: found $ac_dir/$ac_word" >&5
+   echo "$as_me:7837: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -7776,10 +7845,10 @@ fi
 NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
 
 if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:7779: result: $NCURSES_CONFIG" >&5
+  echo "$as_me:7848: result: $NCURSES_CONFIG" >&5
 echo "${ECHO_T}$NCURSES_CONFIG" >&6
 else
-  echo "$as_me:7782: result: no" >&5
+  echo "$as_me:7851: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -7794,7 +7863,7 @@ LIBS="`$NCURSES_CONFIG --libs` $LIBS"
 
 # even with config script, some packages use no-override for curses.h
 
-echo "$as_me:7797: checking if we have identified curses headers" >&5
+echo "$as_me:7866: 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
@@ -7808,7 +7877,7 @@ for cf_header in  \
 	ncurses.h
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 7811 "configure"
+#line 7880 "configure"
 #include "confdefs.h"
 #include <${cf_header}>
 int
@@ -7820,16 +7889,16 @@ initscr(); tgoto("?", 0,0)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7823: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:7892: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7826: \$? = $ac_status" >&5
+  echo "$as_me:7895: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7829: \"$ac_try\"") >&5
+  { (eval echo "$as_me:7898: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7832: \$? = $ac_status" >&5
+  echo "$as_me:7901: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_header=$cf_header; break
 else
@@ -7840,11 +7909,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:7843: result: $cf_cv_ncurses_header" >&5
+echo "$as_me:7912: 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:7847: error: No curses header-files found" >&5
+	{ { echo "$as_me:7916: error: No curses header-files found" >&5
 echo "$as_me: error: No curses header-files found" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -7854,23 +7923,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:7857: checking for $ac_header" >&5
+echo "$as_me:7926: 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 7863 "configure"
+#line 7932 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:7867: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:7936: \"$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:7873: \$? = $ac_status" >&5
+  echo "$as_me:7942: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -7889,7 +7958,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:7892: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:7961: 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 <conftest.$ac_ext <<_ACEOF
-#line 7945 "configure"
+#line 8014 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -7954,16 +8023,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7957: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8026: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:7960: \$? = $ac_status" >&5
+  echo "$as_me:8029: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7963: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8032: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:7966: \$? = $ac_status" >&5
+  echo "$as_me:8035: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -7980,7 +8049,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}:7983: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8052: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -7997,7 +8066,7 @@ fi
 
 }
 
-echo "$as_me:8000: checking for $cf_ncuhdr_root header in include-path" >&5
+echo "$as_me:8069: 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
@@ -8009,7 +8078,7 @@ else
 	do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 8012 "configure"
+#line 8081 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE_EXTENDED
@@ -8041,16 +8110,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8044: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8113: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8047: \$? = $ac_status" >&5
+  echo "$as_me:8116: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8050: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8119: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8053: \$? = $ac_status" >&5
+  echo "$as_me:8122: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h=$cf_header
 
@@ -8065,14 +8134,14 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 	done
 
 fi
-echo "$as_me:8068: result: $cf_cv_ncurses_h" >&5
+echo "$as_me:8137: 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:8075: checking for $cf_ncuhdr_root include-path" >&5
+echo "$as_me:8144: 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
@@ -8212,7 +8281,7 @@ if test -n "$cf_incdir" ; then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 8215 "configure"
+#line 8284 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -8224,16 +8293,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8227: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8296: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8230: \$? = $ac_status" >&5
+  echo "$as_me:8299: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8233: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8302: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8236: \$? = $ac_status" >&5
+  echo "$as_me:8305: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -8250,7 +8319,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}:8253: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8322: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -8271,7 +8340,7 @@ fi
 		do
 
 	cat >conftest.$ac_ext <<_ACEOF
-#line 8274 "configure"
+#line 8343 "configure"
 #include "confdefs.h"
 
 #include <$cf_header>
@@ -8295,16 +8364,16 @@ printf("old\n");
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8298: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8367: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8301: \$? = $ac_status" >&5
+  echo "$as_me:8370: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8304: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8373: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8307: \$? = $ac_status" >&5
+  echo "$as_me:8376: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_h2=$cf_header
 
@@ -8325,12 +8394,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:8328: error: not found" >&5
+	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8397: error: not found" >&5
 echo "$as_me: error: not found" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:8333: result: $cf_cv_ncurses_h2" >&5
+echo "$as_me:8402: 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%/[^/]*$%%'`
@@ -8363,7 +8432,7 @@ if test -n "$cf_1st_incdir" ; then
 			  cf_save_CPPFLAGS=$CPPFLAGS
 			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 			  cat >conftest.$ac_ext <<_ACEOF
-#line 8366 "configure"
+#line 8435 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -8375,16 +8444,16 @@ printf("Hello")
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8378: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8447: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8381: \$? = $ac_status" >&5
+  echo "$as_me:8450: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8384: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8453: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8387: \$? = $ac_status" >&5
+  echo "$as_me:8456: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -8401,7 +8470,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}:8404: testing adding $cf_add_incdir to include-path ..." 1>&5
+echo "${as_me:-configure}:8473: testing adding $cf_add_incdir to include-path ..." 1>&5
 
 		  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
 
@@ -8444,7 +8513,7 @@ EOF
 	;;
 esac
 
-echo "$as_me:8447: checking for terminfo header" >&5
+echo "$as_me:8516: 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
@@ -8462,7 +8531,7 @@ esac
 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 do
 cat >conftest.$ac_ext <<_ACEOF
-#line 8465 "configure"
+#line 8534 "configure"
 #include "confdefs.h"
 #include 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -8477,16 +8546,16 @@ int x = auto_left_margin
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8480: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:8549: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:8483: \$? = $ac_status" >&5
+  echo "$as_me:8552: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8486: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8555: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8489: \$? = $ac_status" >&5
+  echo "$as_me:8558: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_term_header="$cf_test"
@@ -8502,7 +8571,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:8505: result: $cf_cv_term_header" >&5
+echo "$as_me:8574: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
@@ -8536,7 +8605,7 @@ cat >>confdefs.h <<\EOF
 #define NCURSES 1
 EOF
 
-echo "$as_me:8539: checking for ncurses version" >&5
+echo "$as_me:8608: 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
@@ -8562,10 +8631,10 @@ Autoconf "old"
 #endif
 EOF
 	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:8565: \"$cf_try\"") >&5
+	{ (eval echo "$as_me:8634: \"$cf_try\"") >&5
   (eval $cf_try) 2>&5
   ac_status=$?
-  echo "$as_me:8568: \$? = $ac_status" >&5
+  echo "$as_me:8637: \$? = $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%".*%%'`
@@ -8575,7 +8644,7 @@ EOF
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 8578 "configure"
+#line 8647 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -8600,15 +8669,15 @@ int main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:8603: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8672: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8606: \$? = $ac_status" >&5
+  echo "$as_me:8675: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:8608: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8677: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8611: \$? = $ac_status" >&5
+  echo "$as_me:8680: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
 	cf_cv_ncurses_version=`cat $cf_tempfile`
@@ -8622,7 +8691,7 @@ fi
 	rm -f $cf_tempfile
 
 fi
-echo "$as_me:8625: result: $cf_cv_ncurses_version" >&5
+echo "$as_me:8694: 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
@@ -8634,7 +8703,7 @@ cf_nculib_root=ncursesw
 	# to link gpm.
 cf_ncurses_LIBS=""
 cf_ncurses_SAVE="$LIBS"
-echo "$as_me:8637: checking for Gpm_Open in -lgpm" >&5
+echo "$as_me:8706: 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
@@ -8642,7 +8711,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8645 "configure"
+#line 8714 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8661,16 +8730,16 @@ Gpm_Open ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8664: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8733: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8667: \$? = $ac_status" >&5
+  echo "$as_me:8736: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8670: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8739: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8673: \$? = $ac_status" >&5
+  echo "$as_me:8742: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_Gpm_Open=yes
 else
@@ -8681,10 +8750,10 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8684: result: $ac_cv_lib_gpm_Gpm_Open" >&5
+echo "$as_me:8753: 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:8687: checking for initscr in -lgpm" >&5
+  echo "$as_me:8756: 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
@@ -8692,7 +8761,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgpm  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8695 "configure"
+#line 8764 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8711,16 +8780,16 @@ initscr ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8714: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8783: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8717: \$? = $ac_status" >&5
+  echo "$as_me:8786: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8720: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8789: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8723: \$? = $ac_status" >&5
+  echo "$as_me:8792: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_gpm_initscr=yes
 else
@@ -8731,7 +8800,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8734: result: $ac_cv_lib_gpm_initscr" >&5
+echo "$as_me:8803: 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"
@@ -8746,7 +8815,7 @@ 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:8749: checking for tgoto in -lmytinfo" >&5
+		echo "$as_me:8818: 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
@@ -8754,7 +8823,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmytinfo  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 8757 "configure"
+#line 8826 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -8773,16 +8842,16 @@ tgoto ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8776: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8845: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8779: \$? = $ac_status" >&5
+  echo "$as_me:8848: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8782: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8851: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8785: \$? = $ac_status" >&5
+  echo "$as_me:8854: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_mytinfo_tgoto=yes
 else
@@ -8793,7 +8862,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:8796: result: $ac_cv_lib_mytinfo_tgoto" >&5
+echo "$as_me:8865: 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"
@@ -8812,13 +8881,13 @@ else
 
 	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
 	cf_libdir=""
-	echo "$as_me:8815: checking for initscr" >&5
+	echo "$as_me:8884: 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 8821 "configure"
+#line 8890 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr (); below.  */
@@ -8849,16 +8918,16 @@ f = initscr;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8852: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8921: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8855: \$? = $ac_status" >&5
+  echo "$as_me:8924: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8858: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8927: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8861: \$? = $ac_status" >&5
+  echo "$as_me:8930: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_initscr=yes
 else
@@ -8868,18 +8937,18 @@ ac_cv_func_initscr=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:8871: result: $ac_cv_func_initscr" >&5
+echo "$as_me:8940: 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:8878: checking for initscr in -l$cf_nculib_root" >&5
+		echo "$as_me:8947: 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 8882 "configure"
+#line 8951 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -8891,25 +8960,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8894: \"$ac_link\"") >&5
+if { (eval echo "$as_me:8963: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:8897: \$? = $ac_status" >&5
+  echo "$as_me:8966: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8900: \"$ac_try\"") >&5
+  { (eval echo "$as_me:8969: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:8903: \$? = $ac_status" >&5
+  echo "$as_me:8972: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:8905: result: yes" >&5
+  echo "$as_me:8974: 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:8912: result: no" >&5
+echo "$as_me:8981: result: no" >&5
 echo "${ECHO_T}no" >&6
 
 cf_search=
@@ -8999,11 +9068,11 @@ cf_search="$cf_library_path_list $cf_search"
 
 			for cf_libdir in $cf_search
 			do
-				echo "$as_me:9002: checking for -l$cf_nculib_root in $cf_libdir" >&5
+				echo "$as_me:9071: 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 9006 "configure"
+#line 9075 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9015,25 +9084,25 @@ initscr()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9018: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9087: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9021: \$? = $ac_status" >&5
+  echo "$as_me:9090: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9024: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9093: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9027: \$? = $ac_status" >&5
+  echo "$as_me:9096: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9029: result: yes" >&5
+  echo "$as_me:9098: 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:9036: result: no" >&5
+echo "$as_me:9105: result: no" >&5
 echo "${ECHO_T}no" >&6
 					 LIBS="$cf_save_LIBS"
 fi
@@ -9048,7 +9117,7 @@ fi
 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
 
 if test $cf_found_library = no ; then
-	{ { echo "$as_me:9051: error: Cannot link $cf_nculib_root library" >&5
+	{ { echo "$as_me:9120: error: Cannot link $cf_nculib_root library" >&5
 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -9056,7 +9125,7 @@ fi
 fi
 
 if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:9059: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
+	echo "$as_me:9128: 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
@@ -9066,7 +9135,7 @@ echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS..
 		fi
 	done
 	cat >conftest.$ac_ext <<_ACEOF
-#line 9069 "configure"
+#line 9138 "configure"
 #include "confdefs.h"
 #include <${cf_cv_ncurses_header:-curses.h}>
 int
@@ -9078,23 +9147,23 @@ initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9081: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9150: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9084: \$? = $ac_status" >&5
+  echo "$as_me:9153: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9087: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9156: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9090: \$? = $ac_status" >&5
+  echo "$as_me:9159: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:9092: result: yes" >&5
+  echo "$as_me:9161: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:9097: result: no" >&5
+echo "$as_me:9166: result: no" >&5
 echo "${ECHO_T}no" >&6
 		 LIBS="$cf_ncurses_SAVE"
 fi
@@ -9112,7 +9181,7 @@ fi
 	;;
 pdcurses) #(vi
 
-echo "$as_me:9115: checking if you want to use pkg-config" >&5
+echo "$as_me:9184: 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.
@@ -9122,7 +9191,7 @@ if test "${with_pkg_config+set}" = set; then
 else
   cf_pkg_config=yes
 fi;
-echo "$as_me:9125: result: $cf_pkg_config" >&5
+echo "$as_me:9194: result: $cf_pkg_config" >&5
 echo "${ECHO_T}$cf_pkg_config" >&6
 
 case $cf_pkg_config in #(vi
@@ -9130,9 +9199,10 @@ no) #(vi
 	PKG_CONFIG=none
 	;;
 yes) #(vi
-	# 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:9135: checking for $ac_word" >&5
+	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:9205: 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
@@ -9149,25 +9219,70 @@ 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:9152: found $ac_dir/$ac_word" >&5
+   echo "$as_me:9222: found $ac_dir/$ac_word" >&5
    break
 fi
 done
 
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="none"
   ;;
 esac
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 
 if test -n "$PKG_CONFIG"; then
-  echo "$as_me:9164: result: $PKG_CONFIG" >&5
+  echo "$as_me:9233: result: $PKG_CONFIG" >&5
 echo "${ECHO_T}$PKG_CONFIG" >&6
 else
-  echo "$as_me:9167: result: no" >&5
+  echo "$as_me:9236: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
+fi
+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:9245: 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
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  ac_save_IFS=$IFS; IFS=$ac_path_separator
+ac_dummy="$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=$ac_save_IFS
+  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:9262: found $ac_dir/$ac_word" >&5
+   break
+fi
+done
+
+  test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+  echo "$as_me:9274: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+  echo "$as_me:9277: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
 	;;
 *)
 	PKG_CONFIG=$withval
@@ -9202,7 +9317,7 @@ case ".$PKG_CONFIG" in #(vi
   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
   ;;
 *)
-  { { echo "$as_me:9205: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
+  { { echo "$as_me:9320: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
    { (exit 1); exit 1; }; }
   ;;
@@ -9210,7 +9325,7 @@ esac
 
 fi
 
-echo "$as_me:9213: checking for X" >&5
+echo "$as_me:9328: checking for X" >&5
 echo $ECHO_N "checking for X... $ECHO_C" >&6
 
 # Check whether --with-x or --without-x was given.
@@ -9307,17 +9422,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 9310 "configure"
+#line 9425 "configure"
 #include "confdefs.h"
 #include 
 _ACEOF
-if { (eval echo "$as_me:9314: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:9429: \"$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:9320: \$? = $ac_status" >&5
+  echo "$as_me:9435: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -9350,7 +9465,7 @@ if test "$ac_x_libraries" = no; then
   ac_save_LIBS=$LIBS
   LIBS="-lXt $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
-#line 9353 "configure"
+#line 9468 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -9362,16 +9477,16 @@ XtMalloc (0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9365: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9480: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9368: \$? = $ac_status" >&5
+  echo "$as_me:9483: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9371: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9486: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9374: \$? = $ac_status" >&5
+  echo "$as_me:9489: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
@@ -9409,7 +9524,7 @@ fi
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  echo "$as_me:9412: result: $have_x" >&5
+  echo "$as_me:9527: result: $have_x" >&5
 echo "${ECHO_T}$have_x" >&6
   no_x=yes
 else
@@ -9419,7 +9534,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:9422: result: libraries $x_libraries, headers $x_includes" >&5
+  echo "$as_me:9537: result: libraries $x_libraries, headers $x_includes" >&5
 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
 fi
 
@@ -9443,11 +9558,11 @@ else
     # others require no space.  Words are not sufficient . . . .
     case `(uname -sr) 2>/dev/null` in
     "SunOS 5"*)
-      echo "$as_me:9446: checking whether -R must be followed by a space" >&5
+      echo "$as_me:9561: 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 9450 "configure"
+#line 9565 "configure"
 #include "confdefs.h"
 
 int
@@ -9459,16 +9574,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9462: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9577: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9465: \$? = $ac_status" >&5
+  echo "$as_me:9580: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9468: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9583: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9471: \$? = $ac_status" >&5
+  echo "$as_me:9586: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_nospace=yes
 else
@@ -9478,13 +9593,13 @@ 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:9481: result: no" >&5
+	echo "$as_me:9596: 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 9487 "configure"
+#line 9602 "configure"
 #include "confdefs.h"
 
 int
@@ -9496,16 +9611,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9499: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9614: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9502: \$? = $ac_status" >&5
+  echo "$as_me:9617: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9505: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9620: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9508: \$? = $ac_status" >&5
+  echo "$as_me:9623: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_R_space=yes
 else
@@ -9515,11 +9630,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:9518: result: yes" >&5
+	  echo "$as_me:9633: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 	  X_LIBS="$X_LIBS -R $x_libraries"
 	else
-	  echo "$as_me:9522: result: neither works" >&5
+	  echo "$as_me:9637: result: neither works" >&5
 echo "${ECHO_T}neither works" >&6
 	fi
       fi
@@ -9539,7 +9654,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 9542 "configure"
+#line 9657 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9558,22 +9673,22 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9561: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9676: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9564: \$? = $ac_status" >&5
+  echo "$as_me:9679: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9567: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9682: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9570: \$? = $ac_status" >&5
+  echo "$as_me:9685: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-echo "$as_me:9576: checking for dnet_ntoa in -ldnet" >&5
+echo "$as_me:9691: 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
@@ -9581,7 +9696,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9584 "configure"
+#line 9699 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9600,16 +9715,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9603: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9718: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9606: \$? = $ac_status" >&5
+  echo "$as_me:9721: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9609: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9724: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9612: \$? = $ac_status" >&5
+  echo "$as_me:9727: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_dnet_ntoa=yes
 else
@@ -9620,14 +9735,14 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9623: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "$as_me:9738: 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:9630: checking for dnet_ntoa in -ldnet_stub" >&5
+      echo "$as_me:9745: 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
@@ -9635,7 +9750,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet_stub  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9638 "configure"
+#line 9753 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9654,16 +9769,16 @@ dnet_ntoa ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9657: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9772: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9660: \$? = $ac_status" >&5
+  echo "$as_me:9775: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9663: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9778: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9666: \$? = $ac_status" >&5
+  echo "$as_me:9781: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_dnet_stub_dnet_ntoa=yes
 else
@@ -9674,7 +9789,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9677: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "$as_me:9792: 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"
@@ -9693,13 +9808,13 @@ 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:9696: checking for gethostbyname" >&5
+    echo "$as_me:9811: 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 9702 "configure"
+#line 9817 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname (); below.  */
@@ -9730,16 +9845,16 @@ f = gethostbyname;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9733: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9848: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9736: \$? = $ac_status" >&5
+  echo "$as_me:9851: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9739: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9854: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9742: \$? = $ac_status" >&5
+  echo "$as_me:9857: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_gethostbyname=yes
 else
@@ -9749,11 +9864,11 @@ ac_cv_func_gethostbyname=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9752: result: $ac_cv_func_gethostbyname" >&5
+echo "$as_me:9867: 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:9756: checking for gethostbyname in -lnsl" >&5
+      echo "$as_me:9871: 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
@@ -9761,7 +9876,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9764 "configure"
+#line 9879 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9780,16 +9895,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9783: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9898: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9786: \$? = $ac_status" >&5
+  echo "$as_me:9901: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9789: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9904: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9792: \$? = $ac_status" >&5
+  echo "$as_me:9907: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_nsl_gethostbyname=yes
 else
@@ -9800,14 +9915,14 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9803: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "$as_me:9918: 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:9810: checking for gethostbyname in -lbsd" >&5
+        echo "$as_me:9925: 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
@@ -9815,7 +9930,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lbsd  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9818 "configure"
+#line 9933 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9834,16 +9949,16 @@ gethostbyname ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9837: \"$ac_link\"") >&5
+if { (eval echo "$as_me:9952: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9840: \$? = $ac_status" >&5
+  echo "$as_me:9955: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9843: \"$ac_try\"") >&5
+  { (eval echo "$as_me:9958: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9846: \$? = $ac_status" >&5
+  echo "$as_me:9961: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_bsd_gethostbyname=yes
 else
@@ -9854,7 +9969,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9857: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "$as_me:9972: 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"
@@ -9870,13 +9985,13 @@ 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:9873: checking for connect" >&5
+    echo "$as_me:9988: 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 9879 "configure"
+#line 9994 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect (); below.  */
@@ -9907,16 +10022,16 @@ f = connect;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9910: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10025: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9913: \$? = $ac_status" >&5
+  echo "$as_me:10028: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9916: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10031: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9919: \$? = $ac_status" >&5
+  echo "$as_me:10034: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_connect=yes
 else
@@ -9926,11 +10041,11 @@ ac_cv_func_connect=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:9929: result: $ac_cv_func_connect" >&5
+echo "$as_me:10044: 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:9933: checking for connect in -lsocket" >&5
+      echo "$as_me:10048: 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
@@ -9938,7 +10053,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 9941 "configure"
+#line 10056 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -9957,16 +10072,16 @@ connect ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9960: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10075: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:9963: \$? = $ac_status" >&5
+  echo "$as_me:10078: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9966: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10081: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:9969: \$? = $ac_status" >&5
+  echo "$as_me:10084: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_socket_connect=yes
 else
@@ -9977,7 +10092,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:9980: result: $ac_cv_lib_socket_connect" >&5
+echo "$as_me:10095: 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"
@@ -9986,13 +10101,13 @@ fi
     fi
 
     # Guillermo Gomez says -lposix is necessary on A/UX.
-    echo "$as_me:9989: checking for remove" >&5
+    echo "$as_me:10104: 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 9995 "configure"
+#line 10110 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove (); below.  */
@@ -10023,16 +10138,16 @@ f = remove;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10026: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10141: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10029: \$? = $ac_status" >&5
+  echo "$as_me:10144: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10032: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10147: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10035: \$? = $ac_status" >&5
+  echo "$as_me:10150: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_remove=yes
 else
@@ -10042,11 +10157,11 @@ ac_cv_func_remove=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10045: result: $ac_cv_func_remove" >&5
+echo "$as_me:10160: 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:10049: checking for remove in -lposix" >&5
+      echo "$as_me:10164: 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
@@ -10054,7 +10169,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10057 "configure"
+#line 10172 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10073,16 +10188,16 @@ remove ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10076: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10191: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10079: \$? = $ac_status" >&5
+  echo "$as_me:10194: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10082: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10197: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10085: \$? = $ac_status" >&5
+  echo "$as_me:10200: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_posix_remove=yes
 else
@@ -10093,7 +10208,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10096: result: $ac_cv_lib_posix_remove" >&5
+echo "$as_me:10211: 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"
@@ -10102,13 +10217,13 @@ fi
     fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    echo "$as_me:10105: checking for shmat" >&5
+    echo "$as_me:10220: 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 10111 "configure"
+#line 10226 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat (); below.  */
@@ -10139,16 +10254,16 @@ f = shmat;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10142: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10257: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10145: \$? = $ac_status" >&5
+  echo "$as_me:10260: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10148: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10263: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10151: \$? = $ac_status" >&5
+  echo "$as_me:10266: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_shmat=yes
 else
@@ -10158,11 +10273,11 @@ ac_cv_func_shmat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10161: result: $ac_cv_func_shmat" >&5
+echo "$as_me:10276: 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:10165: checking for shmat in -lipc" >&5
+      echo "$as_me:10280: 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
@@ -10170,7 +10285,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lipc  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10173 "configure"
+#line 10288 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10189,16 +10304,16 @@ shmat ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10192: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10307: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10195: \$? = $ac_status" >&5
+  echo "$as_me:10310: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10198: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10313: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10201: \$? = $ac_status" >&5
+  echo "$as_me:10316: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ipc_shmat=yes
 else
@@ -10209,7 +10324,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10212: result: $ac_cv_lib_ipc_shmat" >&5
+echo "$as_me:10327: 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"
@@ -10227,7 +10342,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:10230: checking for IceConnectionNumber in -lICE" >&5
+  echo "$as_me:10345: 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
@@ -10235,7 +10350,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10238 "configure"
+#line 10353 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10254,16 +10369,16 @@ IceConnectionNumber ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10257: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10372: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10260: \$? = $ac_status" >&5
+  echo "$as_me:10375: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10263: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10378: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10266: \$? = $ac_status" >&5
+  echo "$as_me:10381: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_ICE_IceConnectionNumber=yes
 else
@@ -10274,7 +10389,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10277: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "$as_me:10392: 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"
@@ -10286,7 +10401,7 @@ fi
 
 cf_x_athena=${cf_x_athena:-Xaw}
 
-echo "$as_me:10289: checking if you want to link with Xaw 3d library" >&5
+echo "$as_me:10404: 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=
 
@@ -10297,14 +10412,14 @@ if test "${with_Xaw3d+set}" = set; then
 fi;
 if test "$withval" = yes ; then
 	cf_x_athena=Xaw3d
-	echo "$as_me:10300: result: yes" >&5
+	echo "$as_me:10415: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-	echo "$as_me:10303: result: no" >&5
+	echo "$as_me:10418: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:10307: checking if you want to link with neXT Athena library" >&5
+echo "$as_me:10422: 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=
 
@@ -10315,14 +10430,14 @@ if test "${with_neXtaw+set}" = set; then
 fi;
 if test "$withval" = yes ; then
 	cf_x_athena=neXtaw
-	echo "$as_me:10318: result: yes" >&5
+	echo "$as_me:10433: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-	echo "$as_me:10321: result: no" >&5
+	echo "$as_me:10436: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-echo "$as_me:10325: checking if you want to link with Athena-Plus library" >&5
+echo "$as_me:10440: 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=
 
@@ -10333,10 +10448,10 @@ if test "${with_XawPlus+set}" = set; then
 fi;
 if test "$withval" = yes ; then
 	cf_x_athena=XawPlus
-	echo "$as_me:10336: result: yes" >&5
+	echo "$as_me:10451: result: yes" >&5
 echo "${ECHO_T}yes" >&6
 else
-	echo "$as_me:10339: result: no" >&5
+	echo "$as_me:10454: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -10356,17 +10471,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}:10359: testing found package $cf_athena_pkg ..." 1>&5
+echo "${as_me:-configure}:10474: 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}:10365: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10480: 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}:10369: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10484: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -10456,14 +10571,14 @@ cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxy
 #define $cf_x_athena_LIBS 1
 EOF
 
-echo "$as_me:10459: checking for usable $cf_x_athena/Xmu package" >&5
+echo "$as_me:10574: 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 10466 "configure"
+#line 10581 "configure"
 #include "confdefs.h"
 
 #include 
@@ -10479,16 +10594,16 @@ int check = XmuCompareISOLatin1("big", "small")
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10482: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10597: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10485: \$? = $ac_status" >&5
+  echo "$as_me:10600: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10488: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10603: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10491: \$? = $ac_status" >&5
+  echo "$as_me:10606: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xaw_compat=yes
 else
@@ -10498,7 +10613,7 @@ cf_cv_xaw_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10501: result: $cf_cv_xaw_compat" >&5
+echo "$as_me:10616: result: $cf_cv_xaw_compat" >&5
 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
 
 			if test "$cf_cv_xaw_compat" = no
@@ -10510,22 +10625,22 @@ echo "${ECHO_T}$cf_cv_xaw_compat" >&6
 				*)
 					test -n "$verbose" && echo "	work around broken package" 1>&6
 
-echo "${as_me:-configure}:10513: testing work around broken package ..." 1>&5
+echo "${as_me:-configure}:10628: 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}:10518: testing found package xmu ..." 1>&5
+echo "${as_me:-configure}:10633: 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}:10524: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10639: 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}:10528: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10643: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -10611,12 +10726,12 @@ else
 
 test -n "$verbose" && echo "	...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:10614: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:10729: testing ...before $LIBS ..." 1>&5
 
 LIBS=`echo "$LIBS" | sed -e "s/[ 	][ 	]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
 test -n "$verbose" && echo "	...after  $LIBS" 1>&6
 
-echo "${as_me:-configure}:10619: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:10734: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -10637,17 +10752,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}:10640: testing found package Xext ..." 1>&5
+echo "${as_me:-configure}:10755: 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}:10646: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10761: 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}:10650: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10765: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -10731,7 +10846,7 @@ fi
 	:
 else
 
-	echo "$as_me:10734: checking for XextCreateExtension in -lXext" >&5
+	echo "$as_me:10849: 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
@@ -10739,7 +10854,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXext  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 10742 "configure"
+#line 10857 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -10758,16 +10873,16 @@ XextCreateExtension ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10761: \"$ac_link\"") >&5
+if { (eval echo "$as_me:10876: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10764: \$? = $ac_status" >&5
+  echo "$as_me:10879: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10767: \"$ac_try\"") >&5
+  { (eval echo "$as_me:10882: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10770: \$? = $ac_status" >&5
+  echo "$as_me:10885: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xext_XextCreateExtension=yes
 else
@@ -10778,7 +10893,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:10781: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
+echo "$as_me:10896: 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
   LIBS="-lXext $LIBS"
@@ -10791,17 +10906,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}:10794: testing found package xt ..." 1>&5
+echo "${as_me:-configure}:10909: 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}:10800: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:10915: 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}:10804: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:10919: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -10888,14 +11003,14 @@ fi
 		;;
 	*)
 # we have an "xt" package, but it may omit Xt's dependency on X11
-echo "$as_me:10891: checking for usable X dependency" >&5
+echo "$as_me:11006: 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 10898 "configure"
+#line 11013 "configure"
 #include "confdefs.h"
 
 #include 
@@ -10914,16 +11029,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10917: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11032: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:10920: \$? = $ac_status" >&5
+  echo "$as_me:11035: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10923: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11038: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:10926: \$? = $ac_status" >&5
+  echo "$as_me:11041: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xt_x11_compat=yes
 else
@@ -10933,30 +11048,30 @@ cf_cv_xt_x11_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:10936: result: $cf_cv_xt_x11_compat" >&5
+echo "$as_me:11051: 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}:10942: testing work around broken X11 dependency ..." 1>&5
+echo "${as_me:-configure}:11057: 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}:10949: testing found package x11 ..." 1>&5
+echo "${as_me:-configure}:11064: 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}:10955: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11070: 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}:10959: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11074: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11042,12 +11157,12 @@ else
 
 test -n "$verbose" && echo "	...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:11045: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:11160: 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}:11050: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:11165: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -11055,14 +11170,14 @@ fi
 		;;
 	esac
 
-echo "$as_me:11058: checking for usable X Toolkit package" >&5
+echo "$as_me:11173: 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 11065 "configure"
+#line 11180 "configure"
 #include "confdefs.h"
 
 #include 
@@ -11077,16 +11192,16 @@ int num = IceConnectionNumber(0)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11080: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11195: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11083: \$? = $ac_status" >&5
+  echo "$as_me:11198: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11086: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11201: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11089: \$? = $ac_status" >&5
+  echo "$as_me:11204: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_xt_ice_compat=yes
 else
@@ -11096,7 +11211,7 @@ cf_cv_xt_ice_compat=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11099: result: $cf_cv_xt_ice_compat" >&5
+echo "$as_me:11214: result: $cf_cv_xt_ice_compat" >&5
 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
 
 	if test "$cf_cv_xt_ice_compat" = no
@@ -11110,22 +11225,22 @@ echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
 			*)
 				test -n "$verbose" && echo "	work around broken ICE dependency" 1>&6
 
-echo "${as_me:-configure}:11113: testing work around broken ICE dependency ..." 1>&5
+echo "${as_me:-configure}:11228: 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}:11118: testing found package ice ..." 1>&5
+echo "${as_me:-configure}:11233: 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}:11124: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11239: 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}:11128: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11243: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11210,17 +11325,17 @@ fi
 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
 	test -n "$verbose" && echo "	found package sm" 1>&6
 
-echo "${as_me:-configure}:11213: testing found package sm ..." 1>&5
+echo "${as_me:-configure}:11328: 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}:11219: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
+echo "${as_me:-configure}:11334: 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}:11223: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
+echo "${as_me:-configure}:11338: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
 
 cf_fix_cppflags=no
 cf_new_cflags=
@@ -11310,12 +11425,12 @@ else
 
 test -n "$verbose" && echo "	...before $LIBS" 1>&6
 
-echo "${as_me:-configure}:11313: testing ...before $LIBS ..." 1>&5
+echo "${as_me:-configure}:11428: 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}:11318: testing ...after  $LIBS ..." 1>&5
+echo "${as_me:-configure}:11433: testing ...after  $LIBS ..." 1>&5
 
 fi
 
@@ -11333,7 +11448,7 @@ else
 
 test -n "$verbose" && echo "	checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:11336: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:11451: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -11404,7 +11519,7 @@ done
 if test -n "$cf_new_cflags" ; then
 	test -n "$verbose" && echo "	add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me:-configure}:11407: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:11522: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
@@ -11412,7 +11527,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
 	test -n "$verbose" && echo "	add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me:-configure}:11415: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:11530: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
 	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
@@ -11420,14 +11535,14 @@ 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}:11423: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:11538: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
 if test "$cf_check_cflags" != "$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 11430 "configure"
+#line 11545 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -11439,16 +11554,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11442: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11557: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11445: \$? = $ac_status" >&5
+  echo "$as_me:11560: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11448: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11563: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11451: \$? = $ac_status" >&5
+  echo "$as_me:11566: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -11456,12 +11571,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:11459: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:11574: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
 	 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
 		 test -n "$verbose" && echo "	but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me:-configure}:11464: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:11579: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
 	 fi
 	 CFLAGS="$cf_check_flags"
@@ -11469,13 +11584,13 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-	echo "$as_me:11472: checking for XOpenDisplay" >&5
+	echo "$as_me:11587: 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 11478 "configure"
+#line 11593 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XOpenDisplay (); below.  */
@@ -11506,16 +11621,16 @@ f = XOpenDisplay;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11509: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11624: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11512: \$? = $ac_status" >&5
+  echo "$as_me:11627: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11515: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11630: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11518: \$? = $ac_status" >&5
+  echo "$as_me:11633: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XOpenDisplay=yes
 else
@@ -11525,13 +11640,13 @@ ac_cv_func_XOpenDisplay=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11528: result: $ac_cv_func_XOpenDisplay" >&5
+echo "$as_me:11643: 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:11534: checking for XOpenDisplay in -lX11" >&5
+	echo "$as_me:11649: 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
@@ -11539,7 +11654,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11542 "configure"
+#line 11657 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11558,16 +11673,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11561: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11676: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11564: \$? = $ac_status" >&5
+  echo "$as_me:11679: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11567: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11682: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11570: \$? = $ac_status" >&5
+  echo "$as_me:11685: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
@@ -11578,7 +11693,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11581: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:11696: 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
   LIBS="-lX11 $LIBS"
@@ -11586,13 +11701,13 @@ fi
 
 fi
 
-	echo "$as_me:11589: checking for XtAppInitialize" >&5
+	echo "$as_me:11704: 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 11595 "configure"
+#line 11710 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char XtAppInitialize (); below.  */
@@ -11623,16 +11738,16 @@ f = XtAppInitialize;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11626: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11741: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11629: \$? = $ac_status" >&5
+  echo "$as_me:11744: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11632: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11747: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11635: \$? = $ac_status" >&5
+  echo "$as_me:11750: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_XtAppInitialize=yes
 else
@@ -11642,13 +11757,13 @@ ac_cv_func_XtAppInitialize=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:11645: result: $ac_cv_func_XtAppInitialize" >&5
+echo "$as_me:11760: 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:11651: checking for XtAppInitialize in -lXt" >&5
+	echo "$as_me:11766: 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
@@ -11656,7 +11771,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 11659 "configure"
+#line 11774 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -11675,16 +11790,16 @@ XtAppInitialize ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11678: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11793: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11681: \$? = $ac_status" >&5
+  echo "$as_me:11796: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11684: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11799: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11687: \$? = $ac_status" >&5
+  echo "$as_me:11802: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_Xt_XtAppInitialize=yes
 else
@@ -11695,7 +11810,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:11698: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
+echo "$as_me:11813: 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
   cat >>confdefs.h <<\EOF
@@ -11711,7 +11826,7 @@ fi
 fi
 
 if test $cf_have_X_LIBS = no ; then
-	{ echo "$as_me:11714: WARNING: Unable to successfully link X Toolkit library (-lXt) with
+	{ echo "$as_me:11829: 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
@@ -11733,14 +11848,14 @@ do
 		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:11736: checking for $cf_test in $cf_path" >&5
+			echo "$as_me:11851: 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:11739: checking for $cf_test" >&5
+			echo "$as_me:11854: checking for $cf_test" >&5
 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
 		fi
 		cat >conftest.$ac_ext <<_ACEOF
-#line 11743 "configure"
+#line 11858 "configure"
 #include "confdefs.h"
 
 #include 
@@ -11754,16 +11869,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:11757: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:11872: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:11760: \$? = $ac_status" >&5
+  echo "$as_me:11875: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:11763: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11878: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11766: \$? = $ac_status" >&5
+  echo "$as_me:11881: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -11772,7 +11887,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-		echo "$as_me:11775: result: $cf_result" >&5
+		echo "$as_me:11890: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 		if test "$cf_result" = yes ; then
 			cf_x_athena_inc=$cf_path
@@ -11784,7 +11899,7 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_inc" ; then
-	{ echo "$as_me:11787: WARNING: Unable to successfully find Athena header files with test program" >&5
+	{ echo "$as_me:11902: 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;}
 elif test "$cf_x_athena_inc" != default ; then
 	CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
@@ -11809,36 +11924,40 @@ do
 			cf_test=XawSimpleMenuAddGlobalActions
 			if test $cf_path != default ; then
 				LIBS="-L$cf_path/lib $cf_lib $LIBS"
-				echo "$as_me:11812: checking for $cf_lib in $cf_path" >&5
+				echo "$as_me:11927: checking for $cf_lib in $cf_path" >&5
 echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6
 			else
 				LIBS="$cf_lib $LIBS"
-				echo "$as_me:11816: checking for $cf_test in $cf_lib" >&5
+				echo "$as_me:11931: checking for $cf_test in $cf_lib" >&5
 echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6
 			fi
 			cat >conftest.$ac_ext <<_ACEOF
-#line 11820 "configure"
+#line 11935 "configure"
 #include "confdefs.h"
 
+#include 
+#include 
+
 int
 main ()
 {
-$cf_test()
+
+$cf_test((XtAppContext) 0)
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:11832: \"$ac_link\"") >&5
+if { (eval echo "$as_me:11951: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:11835: \$? = $ac_status" >&5
+  echo "$as_me:11954: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:11838: \"$ac_try\"") >&5
+  { (eval echo "$as_me:11957: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:11841: \$? = $ac_status" >&5
+  echo "$as_me:11960: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -11847,7 +11966,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-			echo "$as_me:11850: result: $cf_result" >&5
+			echo "$as_me:11969: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 			if test "$cf_result" = yes ; then
 				cf_x_athena_lib="$cf_lib"
@@ -11859,7 +11978,7 @@ echo "${ECHO_T}$cf_result" >&6
 done
 
 if test -z "$cf_x_athena_lib" ; then
-	{ { echo "$as_me:11862: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
+	{ { echo "$as_me:11981: 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
@@ -11876,7 +11995,7 @@ for ac_prog in xcurses-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:11879: checking for $ac_word" >&5
+echo "$as_me:11998: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -11893,7 +12012,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_XCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:11896: found $ac_dir/$ac_word" >&5
+   echo "$as_me:12015: found $ac_dir/$ac_word" >&5
    break
 fi
 done
@@ -11904,10 +12023,10 @@ fi
 XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG
 
 if test -n "$XCURSES_CONFIG"; then
-  echo "$as_me:11907: result: $XCURSES_CONFIG" >&5
+  echo "$as_me:12026: result: $XCURSES_CONFIG" >&5
 echo "${ECHO_T}$XCURSES_CONFIG" >&6
 else
-  echo "$as_me:11910: result: no" >&5
+  echo "$as_me:12029: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
@@ -11928,7 +12047,7 @@ LDFLAGS="$LDFLAGS $X_LIBS"
 
 test -n "$verbose" && echo "	checking additions to CFLAGS" 1>&6
 
-echo "${as_me:-configure}:11931: testing checking additions to CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12050: testing checking additions to CFLAGS ..." 1>&5
 
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
@@ -11999,7 +12118,7 @@ done
 if test -n "$cf_new_cflags" ; then
 	test -n "$verbose" && echo "	add to \$CFLAGS $cf_new_cflags" 1>&6
 
-echo "${as_me:-configure}:12002: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
+echo "${as_me:-configure}:12121: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
 
 	CFLAGS="$CFLAGS $cf_new_cflags"
 fi
@@ -12007,7 +12126,7 @@ fi
 if test -n "$cf_new_cppflags" ; then
 	test -n "$verbose" && echo "	add to \$CPPFLAGS $cf_new_cppflags" 1>&6
 
-echo "${as_me:-configure}:12010: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
+echo "${as_me:-configure}:12129: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
 
 	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
 fi
@@ -12015,14 +12134,14 @@ 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}:12018: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
+echo "${as_me:-configure}:12137: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
 
 	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
 fi
 
 if test "$cf_check_cflags" != "$CFLAGS" ; then
 cat >conftest.$ac_ext <<_ACEOF
-#line 12025 "configure"
+#line 12144 "configure"
 #include "confdefs.h"
 #include 
 int
@@ -12034,16 +12153,16 @@ printf("Hello world");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12037: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12156: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12040: \$? = $ac_status" >&5
+  echo "$as_me:12159: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12043: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12162: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12046: \$? = $ac_status" >&5
+  echo "$as_me:12165: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -12051,12 +12170,12 @@ else
 cat conftest.$ac_ext >&5
 test -n "$verbose" && echo "	test-compile failed.  Undoing change to \$CFLAGS" 1>&6
 
-echo "${as_me:-configure}:12054: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
+echo "${as_me:-configure}:12173: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
 
 	 if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
 		 test -n "$verbose" && echo "	but keeping change to \$CPPFLAGS" 1>&6
 
-echo "${as_me:-configure}:12059: testing but keeping change to \$CPPFLAGS ..." 1>&5
+echo "${as_me:-configure}:12178: testing but keeping change to \$CPPFLAGS ..." 1>&5
 
 	 fi
 	 CFLAGS="$cf_check_flags"
@@ -12064,7 +12183,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
-echo "$as_me:12067: checking for XOpenDisplay in -lX11" >&5
+echo "$as_me:12186: 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
@@ -12072,7 +12191,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12075 "configure"
+#line 12194 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12091,16 +12210,16 @@ XOpenDisplay ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12094: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12213: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12097: \$? = $ac_status" >&5
+  echo "$as_me:12216: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12100: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12219: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12103: \$? = $ac_status" >&5
+  echo "$as_me:12222: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_lib_X11_XOpenDisplay=yes
 else
@@ -12111,13 +12230,13 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12114: result: $ac_cv_lib_X11_XOpenDisplay" >&5
+echo "$as_me:12233: 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
   LIBS="-lX11 $LIBS"
 fi
 
-echo "$as_me:12120: checking for XCurses library" >&5
+echo "$as_me:12239: 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
@@ -12125,7 +12244,7 @@ else
 
 LIBS="-lXCurses $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12128 "configure"
+#line 12247 "configure"
 #include "confdefs.h"
 
 #include 
@@ -12140,16 +12259,16 @@ XCursesExit();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12143: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12262: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12146: \$? = $ac_status" >&5
+  echo "$as_me:12265: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12149: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12268: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12152: \$? = $ac_status" >&5
+  echo "$as_me:12271: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_lib_XCurses=yes
 else
@@ -12160,7 +12279,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:12163: result: $cf_cv_lib_XCurses" >&5
+echo "$as_me:12282: result: $cf_cv_lib_XCurses" >&5
 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
 
 fi
@@ -12174,23 +12293,23 @@ EOF
 #define XCURSES 1
 EOF
 
-	echo "$as_me:12177: checking for xcurses.h" >&5
+	echo "$as_me:12296: 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 12183 "configure"
+#line 12302 "configure"
 #include "confdefs.h"
 #include 
 _ACEOF
-if { (eval echo "$as_me:12187: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12306: \"$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:12193: \$? = $ac_status" >&5
+  echo "$as_me:12312: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12209,7 +12328,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:12212: result: $ac_cv_header_xcurses_h" >&5
+echo "$as_me:12331: 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
   cat >>confdefs.h <<\EOF
@@ -12219,7 +12338,7 @@ EOF
 fi
 
 else
-	{ { echo "$as_me:12222: error: Cannot link with XCurses" >&5
+	{ { echo "$as_me:12341: error: Cannot link with XCurses" >&5
 echo "$as_me: error: Cannot link with XCurses" >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -12234,7 +12353,7 @@ pdcurses) #(vi
 	# look for curses-related libraries
 
 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
-echo "$as_me:12237: checking for new_panel in -lpanel$cf_cv_libtype" >&5
+echo "$as_me:12356: 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
@@ -12242,7 +12361,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpanel$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12245 "configure"
+#line 12364 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12261,16 +12380,16 @@ new_panel ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12264: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12383: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12267: \$? = $ac_status" >&5
+  echo "$as_me:12386: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12270: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12389: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12273: \$? = $ac_status" >&5
+  echo "$as_me:12392: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -12281,7 +12400,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12284: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:12403: 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 <&5
+echo "$as_me:12415: 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
@@ -12301,7 +12420,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lmenu$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12304 "configure"
+#line 12423 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12320,16 +12439,16 @@ menu_driver ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12323: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12442: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12326: \$? = $ac_status" >&5
+  echo "$as_me:12445: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12329: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12448: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12332: \$? = $ac_status" >&5
+  echo "$as_me:12451: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -12340,7 +12459,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12343: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:12462: 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 <&5
+echo "$as_me:12474: 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
@@ -12360,7 +12479,7 @@ else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lform$cf_cv_libtype  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
-#line 12363 "configure"
+#line 12482 "configure"
 #include "confdefs.h"
 
 /* Override any gcc2 internal prototype to avoid an error.  */
@@ -12379,16 +12498,16 @@ form_driver ();
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12382: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12501: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12385: \$? = $ac_status" >&5
+  echo "$as_me:12504: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12388: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12507: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12391: \$? = $ac_status" >&5
+  echo "$as_me:12510: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Lib=yes"
 else
@@ -12399,7 +12518,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:12402: result: `eval echo '${'$as_ac_Lib'}'`" >&5
+echo "$as_me:12521: 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 <&5
+echo "$as_me:12544: 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 12431 "configure"
+#line 12550 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:12435: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12554: \"$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:12441: \$? = $ac_status" >&5
+  echo "$as_me:12560: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12457,7 +12576,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:12460: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:12579: 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 <&5
+echo "$as_me:12592: checking return type of signal handlers" >&5
 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
 if test "${ac_cv_type_signal+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12479 "configure"
+#line 12598 "configure"
 #include "confdefs.h"
 #include 
 #include 
@@ -12498,16 +12617,16 @@ int i;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12501: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12620: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12504: \$? = $ac_status" >&5
+  echo "$as_me:12623: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12507: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12626: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12510: \$? = $ac_status" >&5
+  echo "$as_me:12629: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_signal=void
 else
@@ -12517,20 +12636,20 @@ ac_cv_type_signal=int
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12520: result: $ac_cv_type_signal" >&5
+echo "$as_me:12639: result: $ac_cv_type_signal" >&5
 echo "${ECHO_T}$ac_cv_type_signal" >&6
 
 cat >>confdefs.h <&5
+echo "$as_me:12646: 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 12533 "configure"
+#line 12652 "configure"
 #include "confdefs.h"
 #include 
 #include 
@@ -12538,13 +12657,13 @@ else
 #include 
 
 _ACEOF
-if { (eval echo "$as_me:12541: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12660: \"$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:12547: \$? = $ac_status" >&5
+  echo "$as_me:12666: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12566,7 +12685,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 12569 "configure"
+#line 12688 "configure"
 #include "confdefs.h"
 #include 
 
@@ -12584,7 +12703,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 12587 "configure"
+#line 12706 "configure"
 #include "confdefs.h"
 #include 
 
@@ -12605,7 +12724,7 @@ if test $ac_cv_header_stdc = yes; then
   :
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 12608 "configure"
+#line 12727 "configure"
 #include "confdefs.h"
 #include 
 #if ((' ' & 0x0FF) == 0x020)
@@ -12631,15 +12750,15 @@ main ()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:12634: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12753: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12637: \$? = $ac_status" >&5
+  echo "$as_me:12756: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:12639: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12758: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12642: \$? = $ac_status" >&5
+  echo "$as_me:12761: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
@@ -12652,7 +12771,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
 fi
-echo "$as_me:12655: result: $ac_cv_header_stdc" >&5
+echo "$as_me:12774: result: $ac_cv_header_stdc" >&5
 echo "${ECHO_T}$ac_cv_header_stdc" >&6
 if test $ac_cv_header_stdc = yes; then
 
@@ -12662,13 +12781,13 @@ EOF
 
 fi
 
-echo "$as_me:12665: checking whether time.h and sys/time.h may both be included" >&5
+echo "$as_me:12784: 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 12671 "configure"
+#line 12790 "configure"
 #include "confdefs.h"
 #include 
 #include 
@@ -12684,16 +12803,16 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12687: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:12806: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12690: \$? = $ac_status" >&5
+  echo "$as_me:12809: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12693: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12812: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12696: \$? = $ac_status" >&5
+  echo "$as_me:12815: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_header_time=yes
 else
@@ -12703,7 +12822,7 @@ ac_cv_header_time=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:12706: result: $ac_cv_header_time" >&5
+echo "$as_me:12825: result: $ac_cv_header_time" >&5
 echo "${ECHO_T}$ac_cv_header_time" >&6
 if test $ac_cv_header_time = yes; then
 
@@ -12716,6 +12835,7 @@ fi
 for ac_header in \
 getopt.h \
 locale.h \
+math.h \
 stdarg.h \
 sys/ioctl.h \
 sys/select.h \
@@ -12725,23 +12845,23 @@ unistd.h \
 
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:12728: checking for $ac_header" >&5
+echo "$as_me:12848: 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 12734 "configure"
+#line 12854 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:12738: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:12858: \"$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:12744: \$? = $ac_status" >&5
+  echo "$as_me:12864: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -12760,7 +12880,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:12763: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:12883: 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 <&5
+echo "$as_me:12907: 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 12793 "configure"
+#line 12913 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -12821,16 +12941,16 @@ f = $ac_func;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12824: \"$ac_link\"") >&5
+if { (eval echo "$as_me:12944: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12827: \$? = $ac_status" >&5
+  echo "$as_me:12947: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12830: \"$ac_try\"") >&5
+  { (eval echo "$as_me:12950: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12833: \$? = $ac_status" >&5
+  echo "$as_me:12953: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -12840,7 +12960,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12843: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:12963: 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 <&5
+echo "$as_me:12973: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
 if test "${cf_cv_need_xopen_extension+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 12860 "configure"
+#line 12980 "configure"
 #include "confdefs.h"
 
 #include 
@@ -12867,7 +12987,7 @@ main ()
 {
 
 #if defined(NCURSES_VERSION_PATCH)
-if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
+#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
 	make an error
 #endif
 #endif
@@ -12879,23 +12999,23 @@ if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12882: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13002: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12885: \$? = $ac_status" >&5
+  echo "$as_me:13005: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12888: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13008: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12891: \$? = $ac_status" >&5
+  echo "$as_me:13011: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=no
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
 cat >conftest.$ac_ext <<_ACEOF
-#line 12898 "configure"
+#line 13018 "configure"
 #include "confdefs.h"
 
 #define _XOPEN_SOURCE_EXTENDED
@@ -12917,16 +13037,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:12920: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13040: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:12923: \$? = $ac_status" >&5
+  echo "$as_me:13043: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:12926: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13046: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12929: \$? = $ac_status" >&5
+  echo "$as_me:13049: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_need_xopen_extension=yes
 else
@@ -12938,11 +13058,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:12941: result: $cf_cv_need_xopen_extension" >&5
+echo "$as_me:13061: 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:12945: checking for term.h" >&5
+echo "$as_me:13065: 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
@@ -12955,7 +13075,7 @@ for cf_header in \
 	term.h
 do
 	cat >conftest.$ac_ext <<_ACEOF
-#line 12958 "configure"
+#line 13078 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -12969,16 +13089,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:12972: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13092: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:12975: \$? = $ac_status" >&5
+  echo "$as_me:13095: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:12978: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13098: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:12981: \$? = $ac_status" >&5
+  echo "$as_me:13101: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
 	 break
@@ -12997,7 +13117,7 @@ no)
 	for cf_header in ncurses/term.h ncursesw/term.h
 	do
 		cat >conftest.$ac_ext <<_ACEOF
-#line 13000 "configure"
+#line 13120 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -13015,16 +13135,16 @@ WINDOW *x
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13018: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13138: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13021: \$? = $ac_status" >&5
+  echo "$as_me:13141: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13024: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13144: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13027: \$? = $ac_status" >&5
+  echo "$as_me:13147: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_term_header=$cf_header
 			 break
@@ -13039,7 +13159,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 esac
 
 fi
-echo "$as_me:13042: result: $cf_cv_term_header" >&5
+echo "$as_me:13162: result: $cf_cv_term_header" >&5
 echo "${ECHO_T}$cf_cv_term_header" >&6
 
 case $cf_cv_term_header in #(vi
@@ -13101,10 +13221,10 @@ do
 
 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
-	echo "$as_me:13104: checking for ${cf_func}" >&5
+	echo "$as_me:13224: checking for ${cf_func}" >&5
 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
 
-echo "${as_me:-configure}:13107: testing ${cf_func} ..." 1>&5
+echo "${as_me:-configure}:13227: testing ${cf_func} ..." 1>&5
 
 	if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13113,7 +13233,7 @@ else
 		eval cf_result='$ac_cv_func_'$cf_func
 		if test ".$cf_result" != ".no"; then
 			cat >conftest.$ac_ext <<_ACEOF
-#line 13116 "configure"
+#line 13236 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -13144,16 +13264,16 @@ ${cf_cv_main_return:-return}(foo == 0);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13147: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13267: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13150: \$? = $ac_status" >&5
+  echo "$as_me:13270: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13153: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13273: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13156: \$? = $ac_status" >&5
+  echo "$as_me:13276: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -13169,7 +13289,7 @@ fi
 
 	# use the computed/retrieved cache-value:
 	eval 'cf_result=$cf_cv_func_'$cf_func
-	echo "$as_me:13172: result: $cf_result" >&5
+	echo "$as_me:13292: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 	if test $cf_result != no; then
 		cat >>confdefs.h <&5
+echo "$as_me:13302: 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 13189 "configure"
+#line 13309 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -13201,16 +13321,16 @@ int x = NCURSES_EXT_FUNCS
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13204: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13324: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13207: \$? = $ac_status" >&5
+  echo "$as_me:13327: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13210: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13330: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13213: \$? = $ac_status" >&5
+  echo "$as_me:13333: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_ext_funcs=defined
 else
@@ -13218,7 +13338,7 @@ else
 cat conftest.$ac_ext >&5
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 13221 "configure"
+#line 13341 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -13243,16 +13363,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13246: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13366: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13249: \$? = $ac_status" >&5
+  echo "$as_me:13369: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13252: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13372: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13255: \$? = $ac_status" >&5
+  echo "$as_me:13375: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_ncurses_ext_funcs=yes
 else
@@ -13266,20 +13386,20 @@ fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:13269: result: $cf_cv_ncurses_ext_funcs" >&5
+echo "$as_me:13389: 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
 #define NCURSES_EXT_FUNCS 1
 EOF
 
-echo "$as_me:13275: checking for wide-character functions" >&5
+echo "$as_me:13395: 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 13282 "configure"
+#line 13402 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -13296,16 +13416,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13299: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13419: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13302: \$? = $ac_status" >&5
+  echo "$as_me:13422: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13305: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13425: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13308: \$? = $ac_status" >&5
+  echo "$as_me:13428: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_widechar_funcs=yes
 else
@@ -13316,7 +13436,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:13319: result: $cf_cv_widechar_funcs" >&5
+echo "$as_me:13439: result: $cf_cv_widechar_funcs" >&5
 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
 if test "$cf_cv_widechar_funcs" != no ; then
 	cat >>confdefs.h <<\EOF
@@ -13336,28 +13456,28 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
                   inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13339: checking for $ac_header" >&5
+echo "$as_me:13459: 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 13345 "configure"
+#line 13465 "configure"
 #include "confdefs.h"
 $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13351: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13471: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13354: \$? = $ac_status" >&5
+  echo "$as_me:13474: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13357: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13477: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13360: \$? = $ac_status" >&5
+  echo "$as_me:13480: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_Header=yes"
 else
@@ -13367,7 +13487,7 @@ eval "$as_ac_Header=no"
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:13370: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13490: 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 <&5
+echo "$as_me:13500: checking for pid_t" >&5
 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
 if test "${ac_cv_type_pid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13386 "configure"
+#line 13506 "configure"
 #include "confdefs.h"
 $ac_includes_default
 int
@@ -13398,16 +13518,16 @@ if (sizeof (pid_t))
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13401: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13521: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13404: \$? = $ac_status" >&5
+  echo "$as_me:13524: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13407: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13527: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13410: \$? = $ac_status" >&5
+  echo "$as_me:13530: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_type_pid_t=yes
 else
@@ -13417,7 +13537,7 @@ ac_cv_type_pid_t=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:13420: result: $ac_cv_type_pid_t" >&5
+echo "$as_me:13540: result: $ac_cv_type_pid_t" >&5
 echo "${ECHO_T}$ac_cv_type_pid_t" >&6
 if test $ac_cv_type_pid_t = yes; then
   :
@@ -13432,23 +13552,23 @@ fi
 for ac_header in unistd.h vfork.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:13435: checking for $ac_header" >&5
+echo "$as_me:13555: 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 13441 "configure"
+#line 13561 "configure"
 #include "confdefs.h"
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:13445: \"$ac_cpp conftest.$ac_ext\"") >&5
+if { (eval echo "$as_me:13565: \"$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:13451: \$? = $ac_status" >&5
+  echo "$as_me:13571: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null; then
   if test -s conftest.err; then
     ac_cpp_err=$ac_c_preproc_warn_flag
@@ -13467,7 +13587,7 @@ else
 fi
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:13470: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "$as_me:13590: 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 <&5
+echo "$as_me:13603: 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 13489 "configure"
+#line 13609 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func (); below.  */
@@ -13517,16 +13637,16 @@ f = $ac_func;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13520: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13640: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13523: \$? = $ac_status" >&5
+  echo "$as_me:13643: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13526: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13646: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13529: \$? = $ac_status" >&5
+  echo "$as_me:13649: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   eval "$as_ac_var=yes"
 else
@@ -13536,7 +13656,7 @@ eval "$as_ac_var=no"
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:13539: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "$as_me:13659: 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 <&5
+  echo "$as_me:13671: checking for working fork" >&5
 echo $ECHO_N "checking for working fork... $ECHO_C" >&6
 if test "${ac_cv_func_fork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13571,15 +13691,15 @@ else
       }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13574: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13694: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13577: \$? = $ac_status" >&5
+  echo "$as_me:13697: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13579: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13699: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13582: \$? = $ac_status" >&5
+  echo "$as_me:13702: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_fork_works=yes
 else
@@ -13591,7 +13711,7 @@ fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-echo "$as_me:13594: result: $ac_cv_func_fork_works" >&5
+echo "$as_me:13714: result: $ac_cv_func_fork_works" >&5
 echo "${ECHO_T}$ac_cv_func_fork_works" >&6
 
 fi
@@ -13605,12 +13725,12 @@ if test "x$ac_cv_func_fork_works" = xcross; then
       ac_cv_func_fork_works=yes
       ;;
   esac
-  { echo "$as_me:13608: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
+  { echo "$as_me:13728: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5
 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;}
 fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 if test "x$ac_cv_func_vfork" = xyes; then
-  echo "$as_me:13613: checking for working vfork" >&5
+  echo "$as_me:13733: checking for working vfork" >&5
 echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
 if test "${ac_cv_func_vfork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13619,7 +13739,7 @@ else
   ac_cv_func_vfork_works=cross
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13622 "configure"
+#line 13742 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include 
@@ -13716,15 +13836,15 @@ main ()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13719: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13839: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13722: \$? = $ac_status" >&5
+  echo "$as_me:13842: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13724: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13844: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13727: \$? = $ac_status" >&5
+  echo "$as_me:13847: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_func_vfork_works=yes
 else
@@ -13736,13 +13856,13 @@ fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-echo "$as_me:13739: result: $ac_cv_func_vfork_works" >&5
+echo "$as_me:13859: result: $ac_cv_func_vfork_works" >&5
 echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
 
 fi;
 if test "x$ac_cv_func_fork_works" = xcross; then
   ac_cv_func_vfork_works=ac_cv_func_vfork
-  { echo "$as_me:13745: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
+  { echo "$as_me:13865: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5
 echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;}
 fi
 
@@ -13767,14 +13887,14 @@ EOF
 
 fi
 
-echo "$as_me:13770: checking if sys/time.h works with sys/select.h" >&5
+echo "$as_me:13890: 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 13777 "configure"
+#line 13897 "configure"
 #include "confdefs.h"
 
 #include 
@@ -13794,16 +13914,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:13797: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:13917: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:13800: \$? = $ac_status" >&5
+  echo "$as_me:13920: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:13803: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13923: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13806: \$? = $ac_status" >&5
+  echo "$as_me:13926: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_sys_time_select=yes
 else
@@ -13815,13 +13935,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 
 fi
 
-echo "$as_me:13818: result: $cf_cv_sys_time_select" >&5
+echo "$as_me:13938: 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:13824: checking for function curses_version" >&5
+echo "$as_me:13944: 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
@@ -13831,7 +13951,7 @@ if test "$cross_compiling" = yes; then
   cf_cv_func_curses_version=unknown
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 13834 "configure"
+#line 13954 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -13844,15 +13964,15 @@ int main()
 
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:13847: \"$ac_link\"") >&5
+if { (eval echo "$as_me:13967: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13850: \$? = $ac_status" >&5
+  echo "$as_me:13970: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:13852: \"$ac_try\"") >&5
+  { (eval echo "$as_me:13972: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13855: \$? = $ac_status" >&5
+  echo "$as_me:13975: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_func_curses_version=yes
 
@@ -13867,13 +13987,13 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f core
 fi
-echo "$as_me:13870: result: $cf_cv_func_curses_version" >&5
+echo "$as_me:13990: 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:13876: checking for ncurses wrap-prefix" >&5
+echo "$as_me:13996: 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.
@@ -13883,10 +14003,10 @@ if test "${with_ncurses_wrap_prefix+set}" = set; then
 else
   NCURSES_WRAP_PREFIX=_nc_
 fi;
-echo "$as_me:13886: result: $NCURSES_WRAP_PREFIX" >&5
+echo "$as_me:14006: result: $NCURSES_WRAP_PREFIX" >&5
 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
 
-echo "$as_me:13889: checking for alternate character set array" >&5
+echo "$as_me:14009: 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
@@ -13896,7 +14016,7 @@ 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 13899 "configure"
+#line 14019 "configure"
 #include "confdefs.h"
 
 #include <${cf_cv_ncurses_header:-curses.h}>
@@ -13912,16 +14032,16 @@ $name['k'] = ACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13915: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14035: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13918: \$? = $ac_status" >&5
+  echo "$as_me:14038: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13921: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14041: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13924: \$? = $ac_status" >&5
+  echo "$as_me:14044: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_acs_map=$name; break
 else
@@ -13932,14 +14052,14 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 done
 
 fi
-echo "$as_me:13935: result: $cf_cv_curses_acs_map" >&5
+echo "$as_me:14055: result: $cf_cv_curses_acs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
 
 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <&5
+echo "$as_me:14062: 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
@@ -13949,7 +14069,7 @@ else
 	for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
 	do
 	cat >conftest.$ac_ext <<_ACEOF
-#line 13952 "configure"
+#line 14072 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -13965,16 +14085,16 @@ void *foo = &($name['k'])
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:13968: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14088: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:13971: \$? = $ac_status" >&5
+  echo "$as_me:14091: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:13974: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14094: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:13977: \$? = $ac_status" >&5
+  echo "$as_me:14097: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_map=$name
 	 break
@@ -13985,14 +14105,14 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 	done
 fi
-echo "$as_me:13988: result: $cf_cv_curses_wacs_map" >&5
+echo "$as_me:14108: result: $cf_cv_curses_wacs_map" >&5
 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
 
 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <&5
+echo "$as_me:14115: 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
@@ -14002,7 +14122,7 @@ cf_cv_curses_wacs_symbols=no
 if test "$cf_cv_curses_wacs_map" != unknown
 then
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14005 "configure"
+#line 14125 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -14019,16 +14139,16 @@ cchar_t *foo = WACS_PLUS;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14022: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14142: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14025: \$? = $ac_status" >&5
+  echo "$as_me:14145: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14028: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14148: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14031: \$? = $ac_status" >&5
+  echo "$as_me:14151: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_symbols=yes
 else
@@ -14038,7 +14158,7 @@ fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 else
 	cat >conftest.$ac_ext <<_ACEOF
-#line 14041 "configure"
+#line 14161 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -14054,16 +14174,16 @@ cchar_t *foo = WACS_PLUS
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14057: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14177: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14060: \$? = $ac_status" >&5
+  echo "$as_me:14180: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14063: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14183: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14066: \$? = $ac_status" >&5
+  echo "$as_me:14186: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_curses_wacs_symbols=yes
 else
@@ -14074,17 +14194,17 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 
 fi
-echo "$as_me:14077: result: $cf_cv_curses_wacs_symbols" >&5
+echo "$as_me:14197: result: $cf_cv_curses_wacs_symbols" >&5
 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
 
 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
 #define CURSES_WACS_SYMBOLS 1
 EOF
 
-echo "$as_me:14084: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:14204: 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 14087 "configure"
+#line 14207 "configure"
 #include "confdefs.h"
 
 #ifndef _XOPEN_SOURCE_EXTENDED
@@ -14102,16 +14222,16 @@ attr_t foo
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14105: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14225: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14108: \$? = $ac_status" >&5
+  echo "$as_me:14228: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14111: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14231: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14114: \$? = $ac_status" >&5
+  echo "$as_me:14234: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14120,7 +14240,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14123: result: $cf_result" >&5
+echo "$as_me:14243: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
@@ -14138,14 +14258,14 @@ EOF
 fi
 
 # This is needed on Tru64 5.0 to declare mbstate_t
-echo "$as_me:14141: checking if we must include wchar.h to declare mbstate_t" >&5
+echo "$as_me:14261: 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 14148 "configure"
+#line 14268 "configure"
 #include "confdefs.h"
 
 #include 
@@ -14163,23 +14283,23 @@ mbstate_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14166: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14286: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14169: \$? = $ac_status" >&5
+  echo "$as_me:14289: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14172: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14292: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14175: \$? = $ac_status" >&5
+  echo "$as_me:14295: \$? = $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 14182 "configure"
+#line 14302 "configure"
 #include "confdefs.h"
 
 #include 
@@ -14198,16 +14318,16 @@ mbstate_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14201: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14321: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14204: \$? = $ac_status" >&5
+  echo "$as_me:14324: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14207: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14327: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14210: \$? = $ac_status" >&5
+  echo "$as_me:14330: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_mbstate_t=yes
 else
@@ -14219,7 +14339,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:14222: result: $cf_cv_mbstate_t" >&5
+echo "$as_me:14342: result: $cf_cv_mbstate_t" >&5
 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
 
 if test "$cf_cv_mbstate_t" = yes ; then
@@ -14241,14 +14361,14 @@ if test "$cf_cv_mbstate_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wchar_t
-echo "$as_me:14244: checking if we must include wchar.h to declare wchar_t" >&5
+echo "$as_me:14364: 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 14251 "configure"
+#line 14371 "configure"
 #include "confdefs.h"
 
 #include 
@@ -14266,23 +14386,23 @@ wchar_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14269: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14389: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14272: \$? = $ac_status" >&5
+  echo "$as_me:14392: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14275: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14395: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14278: \$? = $ac_status" >&5
+  echo "$as_me:14398: \$? = $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 14285 "configure"
+#line 14405 "configure"
 #include "confdefs.h"
 
 #include 
@@ -14301,16 +14421,16 @@ wchar_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14304: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14424: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14307: \$? = $ac_status" >&5
+  echo "$as_me:14427: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14310: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14430: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14313: \$? = $ac_status" >&5
+  echo "$as_me:14433: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wchar_t=yes
 else
@@ -14322,7 +14442,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:14325: result: $cf_cv_wchar_t" >&5
+echo "$as_me:14445: result: $cf_cv_wchar_t" >&5
 echo "${ECHO_T}$cf_cv_wchar_t" >&6
 
 if test "$cf_cv_wchar_t" = yes ; then
@@ -14344,14 +14464,14 @@ if test "$cf_cv_wchar_t" != unknown ; then
 fi
 
 # This is needed on Tru64 5.0 to declare wint_t
-echo "$as_me:14347: checking if we must include wchar.h to declare wint_t" >&5
+echo "$as_me:14467: 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 14354 "configure"
+#line 14474 "configure"
 #include "confdefs.h"
 
 #include 
@@ -14369,23 +14489,23 @@ wint_t state
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14372: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14492: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14375: \$? = $ac_status" >&5
+  echo "$as_me:14495: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14378: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14498: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14381: \$? = $ac_status" >&5
+  echo "$as_me:14501: \$? = $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 14388 "configure"
+#line 14508 "configure"
 #include "confdefs.h"
 
 #include 
@@ -14404,16 +14524,16 @@ wint_t value
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14407: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14527: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14410: \$? = $ac_status" >&5
+  echo "$as_me:14530: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14413: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14533: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14416: \$? = $ac_status" >&5
+  echo "$as_me:14536: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_cv_wint_t=yes
 else
@@ -14425,7 +14545,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:14428: result: $cf_cv_wint_t" >&5
+echo "$as_me:14548: result: $cf_cv_wint_t" >&5
 echo "${ECHO_T}$cf_cv_wint_t" >&6
 
 if test "$cf_cv_wint_t" = yes ; then
@@ -14448,129 +14568,9 @@ fi
 
 if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
 
-echo "$as_me:14451: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:14571: 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 14454 "configure"
-#include "confdefs.h"
-
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-
-mbstate_t foo
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14472: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:14475: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14478: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:14481: \$? = $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:14490: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-	cat >>confdefs.h <>confdefs.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 14514 "configure"
-#include "confdefs.h"
-
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED
-#endif
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-
-wchar_t foo
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14532: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:14535: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14538: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:14541: \$? = $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:14550: result: $cf_result" >&5
-echo "${ECHO_T}$cf_result" >&6
-if test $cf_result = yes ; then
-
-cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-	cat >>confdefs.h <>confdefs.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 14574 "configure"
 #include "confdefs.h"
 
@@ -14582,7 +14582,7 @@ int
 main ()
 {
 
-wint_t foo
+mbstate_t foo
 
   ;
   return 0;
@@ -14611,6 +14611,126 @@ echo "$as_me:14610: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 if test $cf_result = yes ; then
 
+cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	cat >>confdefs.h <>confdefs.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 14634 "configure"
+#include "confdefs.h"
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+
+wchar_t foo
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14652: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14655: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14658: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14661: \$? = $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:14670: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
+
+cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+	cat >>confdefs.h <>confdefs.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 14694 "configure"
+#include "confdefs.h"
+
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>
+int
+main ()
+{
+
+wint_t foo
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:14712: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:14715: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:14718: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:14721: \$? = $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:14730: result: $cf_result" >&5
+echo "${ECHO_T}$cf_result" >&6
+if test $cf_result = yes ; then
+
 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 
 	cat >>confdefs.h <&5
+echo "$as_me:14749: 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
 
 cat >conftest.$ac_ext <<_ACEOF
-#line 14633 "configure"
+#line 14753 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -14658,16 +14778,16 @@ void *foo = &(boolnames)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14661: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14781: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14664: \$? = $ac_status" >&5
+  echo "$as_me:14784: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14667: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14787: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14670: \$? = $ac_status" >&5
+  echo "$as_me:14790: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14676,7 +14796,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14679: result: $cf_result" >&5
+echo "$as_me:14799: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test $cf_result = yes ; then
@@ -14688,14 +14808,14 @@ cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz.
 EOF
 
 else
-	echo "$as_me:14691: checking for data boolnames in library" >&5
+	echo "$as_me:14811: checking for data boolnames in library" >&5
 echo $ECHO_N "checking for data boolnames 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 14698 "configure"
+#line 14818 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -14727,16 +14847,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14730: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14850: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14733: \$? = $ac_status" >&5
+  echo "$as_me:14853: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14736: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14856: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14739: \$? = $ac_status" >&5
+  echo "$as_me:14859: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14748,7 +14868,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14751 "configure"
+#line 14871 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -14773,15 +14893,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14776: \"$ac_link\"") >&5
+if { (eval echo "$as_me:14896: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14779: \$? = $ac_status" >&5
+  echo "$as_me:14899: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14781: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14901: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14784: \$? = $ac_status" >&5
+  echo "$as_me:14904: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14792,7 +14912,7 @@ cf_result=no
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-	echo "$as_me:14795: result: $cf_result" >&5
+	echo "$as_me:14915: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 	if test $cf_result = yes ; then
 
@@ -14805,11 +14925,11 @@ EOF
 	fi
 fi
 
-echo "$as_me:14808: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
+echo "$as_me:14928: 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 14812 "configure"
+#line 14932 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -14837,16 +14957,16 @@ void *foo = &(boolfnames)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:14840: \"$ac_compile\"") >&5
+if { (eval echo "$as_me:14960: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:14843: \$? = $ac_status" >&5
+  echo "$as_me:14963: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:14846: \"$ac_try\"") >&5
+  { (eval echo "$as_me:14966: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14849: \$? = $ac_status" >&5
+  echo "$as_me:14969: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14855,7 +14975,7 @@ cat conftest.$ac_ext >&5
 cf_result=no
 fi
 rm -f conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:14858: result: $cf_result" >&5
+echo "$as_me:14978: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 
 if test $cf_result = yes ; then
@@ -14867,14 +14987,14 @@ cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz
 EOF
 
 else
-	echo "$as_me:14870: checking for data boolfnames in library" >&5
+	echo "$as_me:14990: 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 14877 "configure"
+#line 14997 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -14906,16 +15026,16 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:14909: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15029: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14912: \$? = $ac_status" >&5
+  echo "$as_me:15032: \$? = $ac_status" >&5
   (exit $ac_status); } &&
          { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:14915: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15035: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14918: \$? = $ac_status" >&5
+  echo "$as_me:15038: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14927,7 +15047,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
 else
   cat >conftest.$ac_ext <<_ACEOF
-#line 14930 "configure"
+#line 15050 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_XCURSES
@@ -14952,15 +15072,15 @@ int main(void)
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:14955: \"$ac_link\"") >&5
+if { (eval echo "$as_me:15075: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:14958: \$? = $ac_status" >&5
+  echo "$as_me:15078: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:14960: \"$ac_try\"") >&5
+  { (eval echo "$as_me:15080: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  echo "$as_me:14963: \$? = $ac_status" >&5
+  echo "$as_me:15083: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   cf_result=yes
 else
@@ -14971,7 +15091,7 @@ cf_result=no
 fi
 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-	echo "$as_me:14974: result: $cf_result" >&5
+	echo "$as_me:15094: result: $cf_result" >&5
 echo "${ECHO_T}$cf_result" >&6
 	if test $cf_result = yes ; then
 
@@ -15068,7 +15188,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:15071: creating $CONFIG_STATUS" >&5
+{ echo "$as_me:15191: creating $CONFIG_STATUS" >&5
 echo "$as_me: creating $CONFIG_STATUS" >&6;}
 cat >$CONFIG_STATUS <<_ACEOF
 #! $SHELL
@@ -15200,7 +15320,7 @@ EOF
 cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF
     echo "$ac_cs_version"; exit 0 ;;
   --he | --h)
     # Conflict between --help and --header
-    { { echo "$as_me:15247: error: ambiguous option: $1
+    { { echo "$as_me:15367: 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;}
@@ -15263,7 +15383,7 @@ Try \`$0 --help' for more information." >&2;}
     ac_need_defaults=false;;
 
   # This is an error.
-  -*) { { echo "$as_me:15266: error: unrecognized option: $1
+  -*) { { echo "$as_me:15386: 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;}
@@ -15282,7 +15402,7 @@ cat >&5 << _ACEOF
 ## Running config.status.  ##
 ## ----------------------- ##
 
-This file was extended by $as_me 2.52.20101001, executed with
+This file was extended by $as_me 2.52.20101002, executed with
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
   CONFIG_LINKS    = $CONFIG_LINKS
@@ -15311,7 +15431,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:15314: error: invalid argument: $ac_config_target" >&5
+  *) { { echo "$as_me:15434: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
@@ -15453,6 +15573,7 @@ s,@ECHO_CC@,$ECHO_CC,;t t
 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
 s,@X_CFLAGS@,$X_CFLAGS,;t t
 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
 s,@X_LIBS@,$X_LIBS,;t t
@@ -15573,7 +15694,7 @@ done; }
   esac
 
   if test x"$ac_file" != x-; then
-    { echo "$as_me:15576: creating $ac_file" >&5
+    { echo "$as_me:15697: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
     rm -f "$ac_file"
   fi
@@ -15591,7 +15712,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:15594: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:15715: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -15604,7 +15725,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:15607: error: cannot find input file: $f" >&5
+           { { echo "$as_me:15728: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -15670,7 +15791,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:15673: creating $ac_file" >&5
+  test x"$ac_file" != x- && { echo "$as_me:15794: creating $ac_file" >&5
 echo "$as_me: creating $ac_file" >&6;}
 
   # First look for the input files in the build tree, otherwise in the
@@ -15681,7 +15802,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:15684: error: cannot find input file: $f" >&5
+         test -f "$f" || { { echo "$as_me:15805: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          echo $f;;
@@ -15694,7 +15815,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
            echo $srcdir/$f
          else
            # /dev/null tree
-           { { echo "$as_me:15697: error: cannot find input file: $f" >&5
+           { { echo "$as_me:15818: error: cannot find input file: $f" >&5
 echo "$as_me: error: cannot find input file: $f" >&2;}
    { (exit 1); exit 1; }; }
          fi;;
@@ -15752,7 +15873,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:15755: $ac_file is unchanged" >&5
+      { echo "$as_me:15876: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
diff --git a/test/configure.in b/test/configure.in
index c9070b6770b..5ffd3e87bcc 100644
--- a/test/configure.in
+++ b/test/configure.in
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1996, etc.
 dnl
-dnl $Id: configure.in,v 1.89 2011/01/15 19:41:30 tom Exp $
+dnl $Id: configure.in,v 1.90 2011/03/22 09:15:08 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)
@@ -176,6 +176,7 @@ AC_HEADER_TIME
 AC_CHECK_HEADERS( \
 getopt.h \
 locale.h \
+math.h \
 stdarg.h \
 sys/ioctl.h \
 sys/select.h \
diff --git a/test/make-tar.sh b/test/make-tar.sh
index f468e2321bf..0ebccbbc6e8 100755
--- a/test/make-tar.sh
+++ b/test/make-tar.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
-# $Id: make-tar.sh,v 1.4 2010/11/06 18:31:46 tom Exp $
+# $Id: make-tar.sh,v 1.10 2011/03/26 20:46:51 tom Exp $
 ##############################################################################
-# Copyright (c) 2010 Free Software Foundation, Inc.                          #
+# Copyright (c) 2010,2011 Free 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"), #
@@ -31,15 +31,53 @@
 # scripts.  The reason for doing that is to simplify distributing the test
 # programs as a separate package.
 
+CDPATH=:
+export CDPATH
+
 TARGET=`pwd`
 
+: ${PKG_NAME:=ncurses-examples}
 : ${ROOTNAME:=ncurses-test}
 : ${DESTDIR:=$TARGET}
 : ${TMPDIR:=/tmp}
 
-# This can be run from either the test subdirectory, or from the top-level
+grep_assign() {
+	grep_assign=`egrep "^$2\>" "$1" | sed -e "s/^$2[ 	]*=[ 	]*//" -e 's/"//g'`
+	eval $2=\"$grep_assign\"
+}
+
+grep_patchdate() {
+	grep_assign ../dist.mk NCURSES_MAJOR
+	grep_assign ../dist.mk NCURSES_MINOR
+	grep_assign ../dist.mk NCURSES_PATCH
+}
+
+# The rpm spec-file in the ncurses tree is a template.  Fill in the version
+# information from dist.mk
+edit_specfile() {
+	sed \
+		-e "s/\\/$NCURSES_MAJOR/g" \
+		-e "s/\\/$NCURSES_MINOR/g" \
+		-e "s/\\/$NCURSES_PATCH/g" $1 >$1.new
+	chmod u+w $1
+	mv $1.new $1
+}
+
+make_changelog() {
+	test -f $1 && chmod u+w $1
+	cat >$1 <MANIFEST )
+
 cd $BUILD || exit 
 
+# Remove build-artifacts.
+find . -name RCS -exec rm -rf {} \;
+find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
+find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
+find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null
+
 # There is no need for this script in the tar file.
 rm -f $ROOTNAME/make-tar.sh
 
 # Remove build-artifacts.
-find . -name RCS -exec rm -rf {} \;
 find . -name "*.gz" -exec rm -rf {} \;
 
 # Make the files writable...
@@ -81,3 +139,5 @@ cd $DESTDIR
 
 pwd
 ls -l $ROOTNAME.tar.gz
+
+# vi:ts=4 sw=4
diff --git a/test/package/debian/compat b/test/package/debian/compat
new file mode 100644
index 00000000000..7ed6ff82de6
--- /dev/null
+++ b/test/package/debian/compat
@@ -0,0 +1 @@
+5
diff --git a/test/package/debian/control b/test/package/debian/control
new file mode 100644
index 00000000000..520ad422ee9
--- /dev/null
+++ b/test/package/debian/control
@@ -0,0 +1,16 @@
+Source: ncurses-examples
+Maintainer: Thomas E. Dickey 
+Section: misc
+Priority: optional
+Standards-Version: 3.8.4
+Build-Depends: debhelper (>= 5)
+Homepage: http://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
+ These are the example/test programs from the ncurses distribution.
+ .
+ This package installs in "bin/ncurses-examples" to avoid conflict with other
+ packages.
diff --git a/test/package/debian/copyright b/test/package/debian/copyright
new file mode 100644
index 00000000000..e681a6bd58a
--- /dev/null
+++ b/test/package/debian/copyright
@@ -0,0 +1,69 @@
+Upstream source http://invisible-island.net/ncurses/ncurses-examples.html
+
+Current ncurses maintainer: Thomas Dickey 
+
+-------------------------------------------------------------------------------
+    Copyright (c) 1998-2010,2011 Free 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.
+-------------------------------------------------------------------------------
+
+Files: install-sh
+Copyright:  1994 X Consortium
+Licence: other-BSD
+    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'
diff --git a/test/package/debian/docs b/test/package/debian/docs
new file mode 100644
index 00000000000..e845566c06f
--- /dev/null
+++ b/test/package/debian/docs
@@ -0,0 +1 @@
+README
diff --git a/test/package/debian/rules b/test/package/debian/rules
new file mode 100755
index 00000000000..4d4146b8c98
--- /dev/null
+++ b/test/package/debian/rules
@@ -0,0 +1,90 @@
+#!/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)
+
+CFLAGS =
+
+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=$(DEB_HOST_GNU_TYPE) \
+		--build=$(DEB_BUILD_GNU_TYPE) \
+		--bindir=\$${prefix}/bin/ncurses-examples \
+		--prefix=/usr \
+		--with-ncursesw \
+		--disable-rpath-hack
+
+	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=$(CURDIR)/debian/ncurses-examples
+
+	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/source/format b/test/package/debian/source/format
new file mode 100644
index 00000000000..89ae9db8f88
--- /dev/null
+++ b/test/package/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/test/package/debian/watch b/test/package/debian/watch
new file mode 100644
index 00000000000..1d080986daf
--- /dev/null
+++ b/test/package/debian/watch
@@ -0,0 +1,4 @@
+version=3
+
+opts=passive ftp://invisible-island.net/ncurses-examples/ncurses-examples-([\d.]+)\.tgz \
+ debian  uupdate
diff --git a/test/package/ncurses-examples.spec b/test/package/ncurses-examples.spec
new file mode 100644
index 00000000000..ad79e5a2218
--- /dev/null
+++ b/test/package/ncurses-examples.spec
@@ -0,0 +1,55 @@
+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.2 2011/03/25 17:46:44 tom Exp $
+Name: %{AppProgram}
+Version: %{AppVersion}
+Release: %{AppRelease}
+License: MIT
+Group: Applications/Development
+URL: ftp://invisible-island.net/%{AppProgram}
+Source0: %{AppProgram}-%{AppRelease}.tgz
+Packager: Thomas Dickey 
+
+%description
+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
+packages.
+%prep
+
+%setup -q -n %{AppProgram}-%{AppRelease}
+
+%build
+
+INSTALL_PROGRAM='${INSTALL}' \
+	./configure \
+		--target %{_target_platform} \
+		--prefix=%{_prefix} \
+		--bindir=%{_bindir}/%{AppProgram} \
+		--with-ncursesw \
+		--disable-rpath-hack
+
+make
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+make install               DESTDIR=$RPM_BUILD_ROOT
+
+strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram}/*
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%{_bindir}/%{AppProgram}/*
+
+%changelog
+# each patch should add its ChangeLog entries here
+
+* Fri Mar 25 2010 Thomas Dickey
+- initial version
diff --git a/test/tclock.c b/test/tclock.c
index fdcb446b58a..fb44725d320 100644
--- a/test/tclock.c
+++ b/test/tclock.c
@@ -1,7 +1,9 @@
-/* $Id: tclock.c,v 1.29 2010/11/14 01:04:52 tom Exp $ */
+/* $Id: tclock.c,v 1.30 2011/03/22 09:16:00 tom Exp $ */
 
 #include 
 
+#if HAVE_MATH_H
+
 #include 
 
 #if TIME_WITH_SYS_TIME
@@ -256,3 +258,11 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
     endwin();
     ExitProgram(EXIT_SUCCESS);
 }
+#else
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+    printf("This program requires the development header math.h\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/test.priv.h b/test/test.priv.h
index 8070c7131f1..51d52a83ceb 100644
--- a/test/test.priv.h
+++ b/test/test.priv.h
@@ -29,7 +29,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.102 2011/01/15 23:50:33 tom Exp $ */
+/* $Id: test.priv.h,v 1.103 2011/03/22 09:15:45 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
@@ -118,6 +118,10 @@
 #define HAVE_LOCALE_H 0
 #endif
 
+#ifndef HAVE_MATH_H
+#define HAVE_MATH_H 0
+#endif
+
 #ifndef HAVE_MENU_H
 #define HAVE_MENU_H 0
 #endif

From 4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a Mon Sep 17 00:00:00 2001
From: Xin LI 
Date: Fri, 28 Feb 2014 19:12:44 +0000
Subject: [PATCH 3/4] Undo two previous imports which was never done in
 preparation of doing a new import.

---
 ANNOUNCE                                      |   323 +-
 Ada95/Makefile.in                             |    81 -
 Ada95/README                                  |    33 -
 Ada95/TODO                                    |    55 -
 Ada95/aclocal.m4                              |  3579 ----
 Ada95/configure                               | 12502 ------------
 Ada95/configure.in                            |   678 -
 Ada95/doc/Makefile.in                         |    81 -
 Ada95/gen/Makefile.in                         |   451 -
 Ada95/gen/adacurses-config.in                 |    79 -
 Ada95/gen/gen.c                               |  1568 --
 Ada95/gen/html.m4                             |    40 -
 Ada95/gen/normal.m4                           |    37 -
 Ada95/gen/table.m4                            |    35 -
 .../gen/terminal_interface-curses-aux.ads.m4  |   105 -
 ..._interface-curses-forms-field_types.ads.m4 |   238 -
 ...erface-curses-forms-field_user_data.ads.m4 |    70 -
 ...terface-curses-forms-form_user_data.ads.m4 |    70 -
 .../terminal_interface-curses-forms.ads.m4    |   699 -
 ...terface-curses-menus-item_user_data.ads.m4 |    75 -
 ...terface-curses-menus-menu_user_data.ads.m4 |    70 -
 .../terminal_interface-curses-menus.ads.m4    |   604 -
 .../terminal_interface-curses-mouse.ads.m4    |   178 -
 ...l_interface-curses-panels-user_data.ads.m4 |    70 -
 .../terminal_interface-curses-panels.ads.m4   |   147 -
 .../terminal_interface-curses-trace.ads.m4    |    78 -
 Ada95/gen/terminal_interface-curses.adb.m4    |  2502 ---
 Ada95/gen/terminal_interface-curses.ads.m4    |  1559 --
 Ada95/include/MKncurses_def.sh                |    80 -
 Ada95/include/Makefile.in                     |    92 -
 Ada95/include/ncurses_cfg.hin                 |    72 -
 Ada95/include/ncurses_defs                    |   207 -
 Ada95/make-tar.sh                             |   153 -
 Ada95/mk-1st.awk                              |    90 -
 Ada95/package/AdaCurses-doc.spec              |    48 -
 Ada95/package/AdaCurses.spec                  |    78 -
 Ada95/package/debian/compat                   |     1 -
 Ada95/package/debian/control                  |    17 -
 Ada95/package/debian/copyright                |    69 -
 Ada95/package/debian/docs                     |     1 -
 Ada95/package/debian/rules                    |    97 -
 Ada95/package/debian/source/format            |     1 -
 Ada95/package/debian/watch                    |     4 -
 Ada95/samples/Makefile.in                     |   155 -
 Ada95/samples/README                          |    35 -
 Ada95/samples/explain.txt                     |   186 -
 Ada95/samples/ncurses.adb                     |    47 -
 Ada95/samples/ncurses2-acs_and_scroll.adb     |   714 -
 Ada95/samples/ncurses2-acs_and_scroll.ads     |    41 -
 Ada95/samples/ncurses2-acs_display.adb        |   235 -
 Ada95/samples/ncurses2-acs_display.ads        |    41 -
 Ada95/samples/ncurses2-attr_test.adb          |   362 -
 Ada95/samples/ncurses2-attr_test.ads          |    42 -
 Ada95/samples/ncurses2-color_edit.adb         |   259 -
 Ada95/samples/ncurses2-color_edit.ads         |    41 -
 Ada95/samples/ncurses2-color_test.adb         |   163 -
 Ada95/samples/ncurses2-color_test.ads         |    41 -
 Ada95/samples/ncurses2-demo_forms.adb         |   497 -
 Ada95/samples/ncurses2-demo_forms.ads         |    41 -
 Ada95/samples/ncurses2-demo_pad.adb           |   675 -
 Ada95/samples/ncurses2-demo_pad.ads           |    41 -
 Ada95/samples/ncurses2-demo_panels.adb        |   382 -
 Ada95/samples/ncurses2-demo_panels.ads        |    41 -
 Ada95/samples/ncurses2-flushinp_test.adb      |   135 -
 Ada95/samples/ncurses2-flushinp_test.ads      |    43 -
 Ada95/samples/ncurses2-genericputs.adb        |   117 -
 Ada95/samples/ncurses2-genericputs.ads        |    72 -
 Ada95/samples/ncurses2-getch.ads              |    41 -
 Ada95/samples/ncurses2-getch_test.adb         |   254 -
 Ada95/samples/ncurses2-getch_test.ads         |    41 -
 Ada95/samples/ncurses2-getopt.adb             |   163 -
 Ada95/samples/ncurses2-getopt.ads             |    60 -
 Ada95/samples/ncurses2-m.adb                  |   448 -
 Ada95/samples/ncurses2-m.ads                  |    43 -
 Ada95/samples/ncurses2-menu_test.adb          |   168 -
 Ada95/samples/ncurses2-menu_test.ads          |    41 -
 Ada95/samples/ncurses2-overlap_test.adb       |   157 -
 Ada95/samples/ncurses2-overlap_test.ads       |    41 -
 Ada95/samples/ncurses2-slk_test.adb           |   174 -
 Ada95/samples/ncurses2-slk_test.ads           |    41 -
 .../samples/ncurses2-test_sgr_attributes.adb  |   185 -
 .../samples/ncurses2-test_sgr_attributes.ads  |    41 -
 Ada95/samples/ncurses2-trace_set.adb          |   480 -
 Ada95/samples/ncurses2-trace_set.ads          |    41 -
 Ada95/samples/ncurses2-util.adb               |   190 -
 Ada95/samples/ncurses2-util.ads               |    76 -
 Ada95/samples/ncurses2.ads                    |    44 -
 Ada95/samples/rain.adb                        |   179 -
 Ada95/samples/rain.ads                        |    43 -
 .../samples/sample-curses_demo-attributes.adb |   122 -
 .../samples/sample-curses_demo-attributes.ads |    45 -
 Ada95/samples/sample-curses_demo-mouse.adb    |   220 -
 Ada95/samples/sample-curses_demo-mouse.ads    |    45 -
 Ada95/samples/sample-curses_demo.adb          |   143 -
 Ada95/samples/sample-curses_demo.ads          |    45 -
 Ada95/samples/sample-explanation.adb          |   430 -
 Ada95/samples/sample-explanation.ads          |    59 -
 Ada95/samples/sample-form_demo-aux.adb        |   263 -
 Ada95/samples/sample-form_demo-aux.ads        |    92 -
 Ada95/samples/sample-form_demo-handler.adb    |    98 -
 Ada95/samples/sample-form_demo-handler.ads    |    64 -
 Ada95/samples/sample-form_demo.adb            |   130 -
 Ada95/samples/sample-form_demo.ads            |    45 -
 Ada95/samples/sample-function_key_setting.adb |   214 -
 Ada95/samples/sample-function_key_setting.ads |    82 -
 Ada95/samples/sample-header_handler.adb       |   182 -
 Ada95/samples/sample-header_handler.ads       |    53 -
 Ada95/samples/sample-helpers.adb              |    68 -
 Ada95/samples/sample-helpers.ads              |    54 -
 Ada95/samples/sample-keyboard_handler.adb     |   194 -
 Ada95/samples/sample-keyboard_handler.ads     |    55 -
 Ada95/samples/sample-manifest.ads             |    67 -
 Ada95/samples/sample-menu_demo-aux.adb        |   204 -
 Ada95/samples/sample-menu_demo-aux.ads        |    71 -
 Ada95/samples/sample-menu_demo-handler.adb    |   108 -
 Ada95/samples/sample-menu_demo-handler.ads    |    64 -
 Ada95/samples/sample-menu_demo.adb            |   396 -
 Ada95/samples/sample-menu_demo.ads            |    45 -
 Ada95/samples/sample-my_field_type.adb        |    68 -
 Ada95/samples/sample-my_field_type.ads        |    61 -
 Ada95/samples/sample-text_io_demo.adb         |   195 -
 Ada95/samples/sample-text_io_demo.ads         |    45 -
 Ada95/samples/sample.adb                      |   220 -
 Ada95/samples/sample.ads                      |    43 -
 Ada95/samples/status.adb                      |    57 -
 Ada95/samples/status.ads                      |    60 -
 Ada95/samples/tour.adb                        |    46 -
 Ada95/samples/tour.ads                        |    41 -
 Ada95/src/Makefile.in                         |   319 -
 Ada95/src/c_varargs_to_ada.c                  |   117 -
 Ada95/src/c_varargs_to_ada.h                  |    73 -
 Ada95/src/library.gpr                         |    56 -
 Ada95/src/modules                             |    70 -
 Ada95/src/ncurses_compat.c                    |   135 -
 Ada95/src/terminal_interface-curses-aux.adb   |   116 -
 ...terface-curses-forms-field_types-alpha.adb |    62 -
 ...terface-curses-forms-field_types-alpha.ads |    53 -
 ...-curses-forms-field_types-alphanumeric.adb |    62 -
 ...-curses-forms-field_types-alphanumeric.ads |    54 -
 ...rses-forms-field_types-enumeration-ada.adb |    81 -
 ...rses-forms-field_types-enumeration-ada.ads |    59 -
 ...e-curses-forms-field_types-enumeration.adb |   115 -
 ...e-curses-forms-field_types-enumeration.ads |    98 -
 ...face-curses-forms-field_types-intfield.adb |    66 -
 ...face-curses-forms-field_types-intfield.ads |    55 -
 ...-curses-forms-field_types-ipv4_address.adb |    62 -
 ...-curses-forms-field_types-ipv4_address.ads |    51 -
 ...rface-curses-forms-field_types-numeric.adb |    69 -
 ...rface-curses-forms-field_types-numeric.ads |    55 -
 ...erface-curses-forms-field_types-regexp.adb |    67 -
 ...erface-curses-forms-field_types-regexp.ads |    55 -
 ...e-curses-forms-field_types-user-choice.adb |   108 -
 ...e-curses-forms-field_types-user-choice.ads |    94 -
 ...nterface-curses-forms-field_types-user.adb |   133 -
 ...nterface-curses-forms-field_types-user.ads |    95 -
 ...nal_interface-curses-forms-field_types.adb |   283 -
 ...interface-curses-forms-field_user_data.adb |    85 -
 ..._interface-curses-forms-form_user_data.adb |    86 -
 Ada95/src/terminal_interface-curses-forms.adb |  1161 --
 ..._interface-curses-menus-item_user_data.adb |    77 -
 ..._interface-curses-menus-menu_user_data.adb |    76 -
 Ada95/src/terminal_interface-curses-menus.adb |  1022 -
 Ada95/src/terminal_interface-curses-mouse.adb |   217 -
 ...inal_interface-curses-panels-user_data.adb |    78 -
 .../src/terminal_interface-curses-panels.adb  |   165 -
 .../src/terminal_interface-curses-putwin.adb  |    77 -
 .../src/terminal_interface-curses-putwin.ads  |    50 -
 .../src/terminal_interface-curses-termcap.adb |   163 -
 .../src/terminal_interface-curses-termcap.ads |    80 -
 .../terminal_interface-curses-terminfo.adb    |   161 -
 .../terminal_interface-curses-terminfo.ads    |    81 -
 .../terminal_interface-curses-text_io-aux.adb |   128 -
 .../terminal_interface-curses-text_io-aux.ads |    55 -
 ...al_interface-curses-text_io-complex_io.adb |    73 -
 ...al_interface-curses-text_io-complex_io.ads |    70 -
 ...al_interface-curses-text_io-decimal_io.adb |    75 -
 ...al_interface-curses-text_io-decimal_io.ads |    66 -
 ...nterface-curses-text_io-enumeration_io.adb |    80 -
 ...nterface-curses-text_io-enumeration_io.ads |    63 -
 ...inal_interface-curses-text_io-fixed_io.adb |    75 -
 ...inal_interface-curses-text_io-fixed_io.ads |    66 -
 ...inal_interface-curses-text_io-float_io.adb |    76 -
 ...inal_interface-curses-text_io-float_io.ads |    66 -
 ...al_interface-curses-text_io-integer_io.adb |    70 -
 ...al_interface-curses-text_io-integer_io.ads |    63 -
 ...al_interface-curses-text_io-modular_io.adb |    70 -
 ...al_interface-curses-text_io-modular_io.ads |    63 -
 .../src/terminal_interface-curses-text_io.adb |   338 -
 .../src/terminal_interface-curses-text_io.ads |   136 -
 .../src/terminal_interface-curses-trace.adb_p |    97 -
 Ada95/src/terminal_interface.ads              |    47 -
 INSTALL                                       |   219 +-
 MANIFEST                                      |    86 +-
 Makefile.in                                   |    15 +-
 NEWS                                          |  1082 +-
 README.MinGW                                  |   149 -
 TO-DO                                         |    39 +-
 aclocal.m4                                    |  1806 +-
 announce.html.in                              |   907 +-
 c++/Makefile.in                               |   248 -
 c++/NEWS                                      |    71 -
 c++/PROBLEMS                                  |    34 -
 c++/README-first                              |    80 -
 c++/cursesapp.cc                              |   164 -
 c++/cursesapp.h                               |   176 -
 c++/cursesf.cc                                |   454 -
 c++/cursesf.h                                 |   967 -
 c++/cursesm.cc                                |   407 -
 c++/cursesm.h                                 |   672 -
 c++/cursesmain.cc                             |    93 -
 c++/cursesp.cc                                |   138 -
 c++/cursesp.h                                 |   268 -
 c++/cursespad.cc                              |   279 -
 c++/cursesw.cc                                |   468 -
 c++/cursesw.h                                 |  1556 --
 c++/cursslk.cc                                |   132 -
 c++/cursslk.h                                 |   238 -
 c++/demo.cc                                   |   569 -
 c++/etip.h.in                                 |   378 -
 c++/headers                                   |    40 -
 c++/internal.h                                |    65 -
 c++/modules                                   |    45 -
 config.guess                                  |   370 +-
 config.sub                                    |   166 +-
 configure                                     |  6945 +++----
 configure.in                                  |   454 +-
 dist.mk                                       |    11 +-
 doc/html/Ada95.html                           |   184 -
 doc/html/ada/files.htm                        |     6 -
 doc/html/ada/files/T.htm                      |    78 -
 doc/html/ada/funcs.htm                        |    27 -
 doc/html/ada/funcs/A.htm                      |    24 -
 doc/html/ada/funcs/B.htm                      |    21 -
 doc/html/ada/funcs/C.htm                      |    56 -
 doc/html/ada/funcs/D.htm                      |    47 -
 doc/html/ada/funcs/E.htm                      |    18 -
 doc/html/ada/funcs/F.htm                      |    55 -
 doc/html/ada/funcs/G.htm                      |    96 -
 doc/html/ada/funcs/H.htm                      |    22 -
 doc/html/ada/funcs/I.htm                      |    51 -
 doc/html/ada/funcs/K.htm                      |    14 -
 doc/html/ada/funcs/L.htm                      |    20 -
 doc/html/ada/funcs/M.htm                      |    51 -
 doc/html/ada/funcs/N.htm                      |    35 -
 doc/html/ada/funcs/O.htm                      |    12 -
 doc/html/ada/funcs/P.htm                      |    59 -
 doc/html/ada/funcs/Q.htm                      |     8 -
 doc/html/ada/funcs/R.htm                      |    39 -
 doc/html/ada/funcs/S.htm                      |   191 -
 doc/html/ada/funcs/T.htm                      |    36 -
 doc/html/ada/funcs/U.htm                      |    23 -
 doc/html/ada/funcs/V.htm                      |    11 -
 doc/html/ada/funcs/W.htm                      |    53 -
 doc/html/ada/index.htm                        |    39 -
 doc/html/ada/main.htm                         |    69 -
 doc/html/ada/table.html                       |   341 -
 .../terminal_interface-curses-aux__adb.htm    |   122 -
 .../terminal_interface-curses-aux__ads.htm    |   130 -
 ...ce-curses-forms-field_types-alpha__adb.htm |    68 -
 ...ce-curses-forms-field_types-alpha__ads.htm |    59 -
 ...es-forms-field_types-alphanumeric__adb.htm |    68 -
 ...es-forms-field_types-alphanumeric__ads.htm |    60 -
 ...forms-field_types-enumeration-ada__adb.htm |    87 -
 ...forms-field_types-enumeration-ada__ads.htm |    65 -
 ...ses-forms-field_types-enumeration__adb.htm |   121 -
 ...ses-forms-field_types-enumeration__ads.htm |   104 -
 ...curses-forms-field_types-intfield__adb.htm |    72 -
 ...curses-forms-field_types-intfield__ads.htm |    61 -
 ...es-forms-field_types-ipv4_address__adb.htm |    68 -
 ...es-forms-field_types-ipv4_address__ads.htm |    57 -
 ...-curses-forms-field_types-numeric__adb.htm |    75 -
 ...-curses-forms-field_types-numeric__ads.htm |    61 -
 ...e-curses-forms-field_types-regexp__adb.htm |    73 -
 ...e-curses-forms-field_types-regexp__ads.htm |    61 -
 ...ses-forms-field_types-user-choice__adb.htm |   114 -
 ...ses-forms-field_types-user-choice__ads.htm |   100 -
 ...ace-curses-forms-field_types-user__adb.htm |   139 -
 ...ace-curses-forms-field_types-user__ads.htm |   101 -
 ...nterface-curses-forms-field_types__adb.htm |   289 -
 ...nterface-curses-forms-field_types__ads.htm |   245 -
 ...face-curses-forms-field_user_data__adb.htm |    91 -
 ...face-curses-forms-field_user_data__ads.htm |    75 -
 ...rface-curses-forms-form_user_data__adb.htm |    92 -
 ...rface-curses-forms-form_user_data__ads.htm |    75 -
 .../terminal_interface-curses-forms__adb.htm  |  1167 --
 .../terminal_interface-curses-forms__ads.htm  |   790 -
 ...rface-curses-menus-item_user_data__adb.htm |    83 -
 ...rface-curses-menus-item_user_data__ads.htm |    80 -
 ...rface-curses-menus-menu_user_data__adb.htm |    82 -
 ...rface-curses-menus-menu_user_data__ads.htm |    75 -
 .../terminal_interface-curses-menus__adb.htm  |  1028 -
 .../terminal_interface-curses-menus__ads.htm  |   685 -
 .../terminal_interface-curses-mouse__adb.htm  |   223 -
 .../terminal_interface-curses-mouse__ads.htm  |   231 -
 ...interface-curses-panels-user_data__adb.htm |    84 -
 ...interface-curses-panels-user_data__ads.htm |    75 -
 .../terminal_interface-curses-panels__adb.htm |   171 -
 .../terminal_interface-curses-panels__ads.htm |   153 -
 .../terminal_interface-curses-putwin__adb.htm |    83 -
 .../terminal_interface-curses-putwin__ads.htm |    56 -
 ...terminal_interface-curses-termcap__adb.htm |   169 -
 ...terminal_interface-curses-termcap__ads.htm |    86 -
 ...erminal_interface-curses-terminfo__adb.htm |   167 -
 ...erminal_interface-curses-terminfo__ads.htm |    87 -
 ...inal_interface-curses-text_io-aux__adb.htm |   134 -
 ...inal_interface-curses-text_io-aux__ads.htm |    61 -
 ...terface-curses-text_io-complex_io__adb.htm |    79 -
 ...terface-curses-text_io-complex_io__ads.htm |    76 -
 ...terface-curses-text_io-decimal_io__adb.htm |    81 -
 ...terface-curses-text_io-decimal_io__ads.htm |    72 -
 ...ace-curses-text_io-enumeration_io__adb.htm |    86 -
 ...ace-curses-text_io-enumeration_io__ads.htm |    69 -
 ...interface-curses-text_io-fixed_io__adb.htm |    81 -
 ...interface-curses-text_io-fixed_io__ads.htm |    72 -
 ...interface-curses-text_io-float_io__adb.htm |    82 -
 ...interface-curses-text_io-float_io__ads.htm |    72 -
 ...terface-curses-text_io-integer_io__adb.htm |    76 -
 ...terface-curses-text_io-integer_io__ads.htm |    69 -
 ...terface-curses-text_io-modular_io__adb.htm |    76 -
 ...terface-curses-text_io-modular_io__ads.htm |    69 -
 ...terminal_interface-curses-text_io__adb.htm |   344 -
 ...terminal_interface-curses-text_io__ads.htm |   142 -
 .../terminal_interface-curses-trace__adb.htm  |    62 -
 .../terminal_interface-curses-trace__ads.htm  |   122 -
 .../ada/terminal_interface-curses__adb.htm    |  2562 ---
 .../ada/terminal_interface-curses__ads.htm    |  1935 --
 doc/html/ada/terminal_interface__ads.htm      |    53 -
 doc/html/announce.html                        |   907 +-
 doc/html/hackguide.html                       |     6 +-
 doc/html/index.html                           |    51 -
 doc/html/man/adacurses-config.1.html          |    98 -
 doc/html/man/captoinfo.1m.html                |   229 -
 doc/html/man/clear.1.html                     |    84 -
 doc/html/man/curs_add_wch.3x.html             |   232 -
 doc/html/man/curs_add_wchstr.3x.html          |   131 -
 doc/html/man/curs_addch.3x.html               |   220 -
 doc/html/man/curs_addchstr.3x.html            |   133 -
 doc/html/man/curs_addstr.3x.html              |   125 -
 doc/html/man/curs_addwstr.3x.html             |   124 -
 doc/html/man/curs_attr.3x.html                |   267 -
 doc/html/man/curs_beep.3x.html                |   106 -
 doc/html/man/curs_bkgd.3x.html                |   131 -
 doc/html/man/curs_bkgrnd.3x.html              |   128 -
 doc/html/man/curs_border.3x.html              |   162 -
 doc/html/man/curs_border_set.3x.html          |   184 -
 doc/html/man/curs_clear.3x.html               |   146 -
 doc/html/man/curs_color.3x.html               |   285 -
 doc/html/man/curs_delch.3x.html               |   112 -
 doc/html/man/curs_deleteln.3x.html            |   126 -
 doc/html/man/curs_extend.3x.html              |   111 -
 doc/html/man/curs_get_wch.3x.html             |   155 -
 doc/html/man/curs_get_wstr.3x.html            |   166 -
 doc/html/man/curs_getcchar.3x.html            |   158 -
 doc/html/man/curs_getch.3x.html               |   359 -
 doc/html/man/curs_getstr.3x.html              |   155 -
 doc/html/man/curs_getyx.3x.html               |   131 -
 doc/html/man/curs_in_wch.3x.html              |   109 -
 doc/html/man/curs_in_wchstr.3x.html           |   124 -
 doc/html/man/curs_inch.3x.html                |   118 -
 doc/html/man/curs_inchstr.3x.html             |   133 -
 doc/html/man/curs_initscr.3x.html             |   167 -
 doc/html/man/curs_inopts.3x.html              |   261 -
 doc/html/man/curs_ins_wch.3x.html             |   104 -
 doc/html/man/curs_ins_wstr.3x.html            |   129 -
 doc/html/man/curs_insch.3x.html               |   117 -
 doc/html/man/curs_insstr.3x.html              |   131 -
 doc/html/man/curs_instr.3x.html               |   123 -
 doc/html/man/curs_inwstr.3x.html              |   115 -
 doc/html/man/curs_kernel.3x.html              |   206 -
 doc/html/man/curs_legacy.3x.html              |   121 -
 doc/html/man/curs_memleaks.3x.html            |   111 -
 doc/html/man/curs_mouse.3x.html               |   318 -
 doc/html/man/curs_move.3x.html                |   105 -
 doc/html/man/curs_opaque.3x.html              |   161 -
 doc/html/man/curs_outopts.3x.html             |   234 -
 doc/html/man/curs_overlay.3x.html             |   122 -
 doc/html/man/curs_pad.3x.html                 |   184 -
 doc/html/man/curs_print.3x.html               |   121 -
 doc/html/man/curs_printw.3x.html              |   126 -
 doc/html/man/curs_refresh.3x.html             |   170 -
 doc/html/man/curs_scanw.3x.html               |   133 -
 doc/html/man/curs_scr_dump.3x.html            |   137 -
 doc/html/man/curs_scroll.3x.html              |   131 -
 doc/html/man/curs_slk.3x.html                 |   235 -
 doc/html/man/curs_sp_funcs.3x.html            |   285 -
 doc/html/man/curs_termattrs.3x.html           |   161 -
 doc/html/man/curs_termcap.3x.html             |   191 -
 doc/html/man/curs_terminfo.3x.html            |   363 -
 doc/html/man/curs_threads.3x.html             |   634 -
 doc/html/man/curs_touch.3x.html               |   144 -
 doc/html/man/curs_trace.3x.html               |   186 -
 doc/html/man/curs_util.3x.html                |   266 -
 doc/html/man/curs_variables.3x.html           |   164 -
 doc/html/man/curs_window.3x.html              |   216 -
 doc/html/man/default_colors.3x.html           |   180 -
 doc/html/man/define_key.3x.html               |   111 -
 doc/html/man/form.3x.html                     |   258 -
 doc/html/man/form_cursor.3x.html              |   118 -
 doc/html/man/form_data.3x.html                |   104 -
 doc/html/man/form_driver.3x.html              |   375 -
 doc/html/man/form_field.3x.html               |   142 -
 doc/html/man/form_field_attributes.3x.html    |   130 -
 doc/html/man/form_field_buffer.3x.html        |   179 -
 doc/html/man/form_field_info.3x.html          |   129 -
 doc/html/man/form_field_just.3x.html          |   119 -
 doc/html/man/form_field_new.3x.html           |   150 -
 doc/html/man/form_field_opts.3x.html          |   168 -
 doc/html/man/form_field_userptr.3x.html       |   112 -
 doc/html/man/form_field_validation.3x.html    |   195 -
 doc/html/man/form_fieldtype.3x.html           |   190 -
 doc/html/man/form_hook.3x.html                |   138 -
 doc/html/man/form_new.3x.html                 |   132 -
 doc/html/man/form_new_page.3x.html            |   119 -
 doc/html/man/form_opts.3x.html                |   134 -
 doc/html/man/form_page.3x.html                |   139 -
 doc/html/man/form_post.3x.html                |   136 -
 doc/html/man/form_requestname.3x.html         |   112 -
 doc/html/man/form_userptr.3x.html             |   112 -
 doc/html/man/form_variables.3x.html           |   118 -
 doc/html/man/form_win.3x.html                 |   139 -
 doc/html/man/index.html                       |    67 -
 doc/html/man/infocmp.1m.html                  |   444 -
 doc/html/man/infotocap.1m.html                |   115 -
 doc/html/man/key_defined.3x.html              |   103 -
 doc/html/man/keybound.3x.html                 |   105 -
 doc/html/man/keyok.3x.html                    |   105 -
 doc/html/man/legacy_coding.3x.html            |   118 -
 doc/html/man/menu.3x.html                     |   241 -
 doc/html/man/menu_attributes.3x.html          |   139 -
 doc/html/man/menu_cursor.3x.html              |   117 -
 doc/html/man/menu_driver.3x.html              |   255 -
 doc/html/man/menu_format.3x.html              |   133 -
 doc/html/man/menu_hook.3x.html                |   138 -
 doc/html/man/menu_items.3x.html               |   138 -
 doc/html/man/menu_mark.3x.html                |   131 -
 doc/html/man/menu_new.3x.html                 |   129 -
 doc/html/man/menu_opts.3x.html                |   148 -
 doc/html/man/menu_pattern.3x.html             |   138 -
 doc/html/man/menu_post.3x.html                |   138 -
 doc/html/man/menu_requestname.3x.html         |   112 -
 doc/html/man/menu_spacing.3x.html             |   129 -
 doc/html/man/menu_userptr.3x.html             |   112 -
 doc/html/man/menu_win.3x.html                 |   139 -
 doc/html/man/mitem_current.3x.html            |   146 -
 doc/html/man/mitem_name.3x.html               |   107 -
 doc/html/man/mitem_new.3x.html                |   134 -
 doc/html/man/mitem_opts.3x.html               |   126 -
 doc/html/man/mitem_userptr.3x.html            |   112 -
 doc/html/man/mitem_value.3x.html              |   117 -
 doc/html/man/mitem_visible.3x.html            |   100 -
 doc/html/man/ncurses.3x.html                  |  1267 --
 doc/html/man/ncurses5-config.1.html           |   133 -
 doc/html/man/panel.3x.html                    |   241 -
 doc/html/man/resizeterm.3x.html               |   141 -
 doc/html/man/tabs.1.html                      |   171 -
 doc/html/man/term.5.html                      |   308 -
 doc/html/man/term.7.html                      |   251 -
 doc/html/man/term_variables.3x.html           |   165 -
 doc/html/man/terminfo.5.html                  |  2375 ---
 doc/html/man/tic.1m.html                      |   330 -
 doc/html/man/toe.1m.html                      |   126 -
 doc/html/man/tput.1.html                      |   343 -
 doc/html/man/tset.1.html                      |   334 -
 doc/html/man/wresize.3x.html                  |   108 -
 doc/html/ncurses-intro.html                   |     6 +-
 form/Makefile.in                              |    19 +-
 form/f_trace.c                                |    12 +-
 form/fld_arg.c                                |     8 +-
 form/fld_attr.c                               |     6 +-
 form/fld_current.c                            |    10 +-
 form/fld_def.c                                |    10 +-
 form/fld_dup.c                                |     8 +-
 form/fld_ftchoice.c                           |    11 +-
 form/fld_ftlink.c                             |     8 +-
 form/fld_info.c                               |    18 +-
 form/fld_just.c                               |     8 +-
 form/fld_link.c                               |     8 +-
 form/fld_max.c                                |     6 +-
 form/fld_move.c                               |     6 +-
 form/fld_newftyp.c                            |    28 +-
 form/fld_opts.c                               |    12 +-
 form/fld_pad.c                                |     8 +-
 form/fld_page.c                               |     8 +-
 form/fld_stat.c                               |     8 +-
 form/fld_type.c                               |     8 +-
 form/fld_user.c                               |     8 +-
 form/form.h                                   |    81 +-
 form/form.priv.h                              |    61 +-
 form/frm_cursor.c                             |     6 +-
 form/frm_data.c                               |     8 +-
 form/frm_def.c                                |    67 +-
 form/frm_driver.c                             |   350 +-
 form/frm_hook.c                               |     6 +-
 form/frm_opts.c                               |    12 +-
 form/frm_page.c                               |     8 +-
 form/frm_post.c                               |     8 +-
 form/frm_req_name.c                           |     8 +-
 form/frm_scale.c                              |     9 +-
 form/frm_sub.c                                |    23 +-
 form/frm_user.c                               |     8 +-
 form/frm_win.c                                |    29 +-
 form/fty_alnum.c                              |    65 +-
 form/fty_alpha.c                              |    65 +-
 form/fty_enum.c                               |   160 +-
 form/fty_generic.c                            |   297 -
 form/fty_int.c                                |    79 +-
 form/fty_ipv4.c                               |    25 +-
 form/fty_num.c                                |    91 +-
 form/fty_regex.c                              |   228 +-
 form/llib-lform                               |    51 +-
 form/llib-lformt                              |   777 -
 form/llib-lformtw                             |   783 -
 form/llib-lformw                              |    51 +-
 form/modules                                  |    86 +-
 include/Caps                                  |    10 +-
 include/Caps.aix4                             |    10 +-
 include/Caps.hpux11                           |    10 +-
 include/Caps.keys                             |    10 +-
 include/Caps.osf1r5                           |    10 +-
 include/Caps.uwin                             |    10 +-
 include/MKterm.h.awk.in                       |    56 +-
 include/Makefile.in                           |    20 +-
 include/capdefaults.c                         |     6 +-
 include/curses.h.in                           |   270 +-
 include/curses.tail                           |    32 +-
 include/curses.wide                           |    68 +-
 include/headers                               |     6 +-
 include/nc_alloc.h                            |    18 +-
 include/nc_mingw.h                            |    69 -
 include/nc_panel.h                            |    35 +-
 include/nc_tparm.h                            |    12 +-
 include/ncurses_defs                          |    11 +-
 include/{ncurses_dll.h.in => ncurses_dll.h}   |    20 +-
 include/ncurses_mingw.h                       |   164 -
 include/term_entry.h                          |    12 +-
 include/tic.h                                 |    28 +-
 include/unctrl.h.in                           |     8 +-
 man/MKada_config.in                           |    57 -
 man/MKncu_config.in                           |    98 -
 man/Makefile.in                               |    11 +-
 man/captoinfo.1m                              |    59 +-
 man/clear.1                                   |    12 +-
 man/curs_add_wch.3x                           |   129 +-
 man/curs_add_wchstr.3x                        |    16 +-
 man/curs_addch.3x                             |    34 +-
 man/curs_addchstr.3x                          |    18 +-
 man/curs_addstr.3x                            |    18 +-
 man/curs_addwstr.3x                           |    16 +-
 man/curs_attr.3x                              |    24 +-
 man/curs_beep.3x                              |    12 +-
 man/curs_bkgd.3x                              |    14 +-
 man/curs_bkgrnd.3x                            |    10 +-
 man/curs_border.3x                            |    32 +-
 man/curs_border_set.3x                        |    31 +-
 man/curs_clear.3x                             |    17 +-
 man/curs_color.3x                             |    51 +-
 man/curs_delch.3x                             |    16 +-
 man/curs_deleteln.3x                          |    12 +-
 man/curs_extend.3x                            |    12 +-
 man/curs_get_wch.3x                           |     8 +-
 man/curs_get_wstr.3x                          |    14 +-
 man/curs_getcchar.3x                          |    45 +-
 man/curs_getch.3x                             |    34 +-
 man/curs_getstr.3x                            |    20 +-
 man/curs_getyx.3x                             |    14 +-
 man/curs_in_wch.3x                            |    16 +-
 man/curs_in_wchstr.3x                         |    14 +-
 man/curs_inch.3x                              |    20 +-
 man/curs_inchstr.3x                           |    18 +-
 man/curs_initscr.3x                           |    20 +-
 man/curs_inopts.3x                            |    14 +-
 man/curs_ins_wch.3x                           |    14 +-
 man/curs_ins_wstr.3x                          |    14 +-
 man/curs_insch.3x                             |    16 +-
 man/curs_insstr.3x                            |    16 +-
 man/curs_instr.3x                             |    16 +-
 man/curs_inwstr.3x                            |    14 +-
 man/curs_kernel.3x                            |    29 +-
 man/curs_legacy.3x                            |    21 +-
 man/curs_memleaks.3x                          |    14 +-
 man/curs_mouse.3x                             |    29 +-
 man/curs_move.3x                              |    12 +-
 man/curs_opaque.3x                            |    28 +-
 man/curs_outopts.3x                           |    26 +-
 man/curs_overlay.3x                           |    12 +-
 man/curs_pad.3x                               |    19 +-
 man/curs_print.3x                             |    12 +-
 man/curs_printw.3x                            |    16 +-
 man/curs_refresh.3x                           |    16 +-
 man/curs_scanw.3x                             |    16 +-
 man/curs_scr_dump.3x                          |    12 +-
 man/curs_scroll.3x                            |    12 +-
 man/curs_slk.3x                               |   111 +-
 man/curs_sp_funcs.3x                          |   353 -
 man/curs_termattrs.3x                         |    12 +-
 man/curs_termcap.3x                           |    29 +-
 man/curs_terminfo.3x                          |    41 +-
 man/curs_threads.3x                           |    40 +-
 man/curs_touch.3x                             |    16 +-
 man/curs_trace.3x                             |    37 +-
 man/curs_util.3x                              |    59 +-
 man/curs_variables.3x                         |   135 -
 man/curs_window.3x                            |    21 +-
 man/default_colors.3x                         |    22 +-
 man/define_key.3x                             |    16 +-
 man/form.3x                                   |    16 +-
 man/form_cursor.3x                            |    12 +-
 man/form_data.3x                              |    12 +-
 man/form_driver.3x                            |    44 +-
 man/form_field.3x                             |    14 +-
 man/form_field_attributes.3x                  |    12 +-
 man/form_field_buffer.3x                      |    40 +-
 man/form_field_info.3x                        |    12 +-
 man/form_field_just.3x                        |    12 +-
 man/form_field_new.3x                         |    12 +-
 man/form_field_opts.3x                        |    13 +-
 man/form_field_userptr.3x                     |    12 +-
 man/form_field_validation.3x                  |    26 +-
 man/form_fieldtype.3x                         |    12 +-
 man/form_hook.3x                              |    12 +-
 man/form_new.3x                               |    12 +-
 man/form_new_page.3x                          |    12 +-
 man/form_opts.3x                              |    12 +-
 man/form_page.3x                              |    12 +-
 man/form_post.3x                              |    12 +-
 man/form_requestname.3x                       |    12 +-
 man/form_userptr.3x                           |    12 +-
 man/form_variables.3x                         |    82 -
 man/form_win.3x                               |    16 +-
 man/infocmp.1m                                |   182 +-
 man/infotocap.1m                              |    45 +-
 man/key_defined.3x                            |    12 +-
 man/keybound.3x                               |    10 +-
 man/keyok.3x                                  |    12 +-
 man/legacy_coding.3x                          |    10 +-
 man/man_db.renames                            |    20 +-
 man/menu.3x                                   |    16 +-
 man/menu_attributes.3x                        |    12 +-
 man/menu_cursor.3x                            |    12 +-
 man/menu_driver.3x                            |    55 +-
 man/menu_format.3x                            |    12 +-
 man/menu_hook.3x                              |    12 +-
 man/menu_items.3x                             |    14 +-
 man/menu_mark.3x                              |    14 +-
 man/menu_new.3x                               |    12 +-
 man/menu_opts.3x                              |    12 +-
 man/menu_pattern.3x                           |    12 +-
 man/menu_post.3x                              |    12 +-
 man/menu_requestname.3x                       |    12 +-
 man/menu_spacing.3x                           |    52 +-
 man/menu_userptr.3x                           |    12 +-
 man/menu_win.3x                               |    16 +-
 man/mitem_current.3x                          |    14 +-
 man/mitem_name.3x                             |    12 +-
 man/mitem_new.3x                              |    12 +-
 man/mitem_opts.3x                             |    12 +-
 man/mitem_userptr.3x                          |    12 +-
 man/mitem_value.3x                            |    12 +-
 man/mitem_visible.3x                          |    12 +-
 man/ncurses.3x                                |   130 +-
 man/panel.3x                                  |    19 +-
 man/resizeterm.3x                             |    13 +-
 man/tabs.1                                    |   141 -
 man/term.5                                    |    22 +-
 man/term.7                                    |    62 +-
 man/term_variables.3x                         |   153 -
 man/terminfo.head                             |    34 +-
 man/terminfo.tail                             |   103 +-
 man/tic.1m                                    |   180 +-
 man/toe.1m                                    |    26 +-
 man/tput.1                                    |    56 +-
 man/tset.1                                    |    95 +-
 man/wresize.3x                                |    17 +-
 menu/Makefile.in                              |    19 +-
 menu/llib-lmenu                               |    12 +-
 menu/llib-lmenut                              |   551 -
 menu/llib-lmenutw                             |   553 -
 menu/llib-lmenuw                              |    12 +-
 menu/m_attribs.c                              |    11 +-
 menu/m_cursor.c                               |     8 +-
 menu/m_driver.c                               |    11 +-
 menu/m_format.c                               |     6 +-
 menu/m_global.c                               |    14 +-
 menu/m_hook.c                                 |     6 +-
 menu/m_item_cur.c                             |    10 +-
 menu/m_item_nam.c                             |     8 +-
 menu/m_item_new.c                             |    15 +-
 menu/m_item_opt.c                             |    12 +-
 menu/m_item_top.c                             |     8 +-
 menu/m_item_use.c                             |     8 +-
 menu/m_item_val.c                             |     8 +-
 menu/m_item_vis.c                             |     6 +-
 menu/m_items.c                                |    10 +-
 menu/m_new.c                                  |    84 +-
 menu/m_opts.c                                 |    12 +-
 menu/m_pad.c                                  |    12 +-
 menu/m_pattern.c                              |     8 +-
 menu/m_post.c                                 |    14 +-
 menu/m_req_name.c                             |     6 +-
 menu/m_scale.c                                |     9 +-
 menu/m_spacing.c                              |    13 +-
 menu/m_sub.c                                  |    28 +-
 menu/m_trace.c                                |    10 +-
 menu/m_userptr.c                              |     8 +-
 menu/m_win.c                                  |    30 +-
 menu/menu.h                                   |     8 +-
 menu/menu.priv.h                              |    10 +-
 menu/modules                                  |    58 +-
 misc/Makefile.in                              |    38 +-
 misc/gen-pkgconfig.in                         |   139 -
 misc/jpf-indent                               |   119 +
 misc/ncu-indent                               |   132 +
 misc/ncurses-config.in                        |    59 +-
 misc/run_tic.in                               |    90 +-
 misc/terminfo.src                             |  1084 +-
 mk-0th.awk                                    |    16 +-
 mk-1st.awk                                    |    39 +-
 mk-dlls.sh.in                                 |   114 -
 mk-hdr.awk                                    |     6 +-
 mkdirs.sh                                     |    51 +
 ncurses/Makefile.in                           |    54 +-
 ncurses/README                                |    23 +-
 ncurses/base/MKkeyname.awk                    |    21 +-
 ncurses/base/MKlib_gen.sh                     |    75 +-
 ncurses/base/MKunctrl.awk                     |    26 +-
 ncurses/base/define_key.c                     |    39 +-
 ncurses/base/key_defined.c                    |    20 +-
 ncurses/base/keybound.c                       |    23 +-
 ncurses/base/keyok.c                          |    39 +-
 ncurses/base/legacy_coding.c                  |    31 +-
 ncurses/base/lib_addch.c                      |    80 +-
 ncurses/base/lib_addstr.c                     |    19 +-
 ncurses/base/lib_beep.c                       |    27 +-
 ncurses/base/lib_bkgd.c                       |    16 +-
 ncurses/base/lib_box.c                        |     9 +-
 ncurses/base/lib_chgat.c                      |     8 +-
 ncurses/base/lib_clear.c                      |     6 +-
 ncurses/base/lib_clearok.c                    |     6 +-
 ncurses/base/lib_clrbot.c                     |     6 +-
 ncurses/base/lib_clreol.c                     |     6 +-
 ncurses/base/lib_color.c                      |   544 +-
 ncurses/base/lib_colorset.c                   |    19 +-
 ncurses/base/lib_delch.c                      |     6 +-
 ncurses/base/lib_delwin.c                     |    21 +-
 ncurses/base/lib_dft_fgbg.c                   |    74 +-
 ncurses/base/lib_driver.c                     |   143 -
 ncurses/base/lib_echo.c                       |    36 +-
 ncurses/base/lib_endwin.c                     |    47 +-
 ncurses/base/lib_erase.c                      |     6 +-
 ncurses/base/lib_flash.c                      |    30 +-
 ncurses/base/lib_freeall.c                    |    62 +-
 ncurses/base/lib_getch.c                      |   181 +-
 ncurses/base/lib_getstr.c                     |    25 +-
 ncurses/base/lib_hline.c                      |    10 +-
 ncurses/base/lib_immedok.c                    |     6 +-
 ncurses/base/lib_inchstr.c                    |    11 +-
 ncurses/base/lib_initscr.c                    |     8 +-
 ncurses/base/lib_insch.c                      |    48 +-
 ncurses/base/lib_insdel.c                     |     6 +-
 ncurses/base/lib_insnstr.c                    |    10 +-
 ncurses/base/lib_instr.c                      |    30 +-
 ncurses/base/lib_isendwin.c                   |    20 +-
 ncurses/base/lib_leaveok.c                    |     6 +-
 ncurses/base/lib_mouse.c                      |   277 +-
 ncurses/base/lib_move.c                       |     6 +-
 ncurses/base/lib_mvwin.c                      |    20 +-
 ncurses/base/lib_newterm.c                    |   234 +-
 ncurses/base/lib_newwin.c                     |   154 +-
 ncurses/base/lib_nl.c                         |    50 +-
 ncurses/base/lib_overlay.c                    |    16 +-
 ncurses/base/lib_pad.c                        |    82 +-
 ncurses/base/lib_printw.c                     |    16 +-
 ncurses/base/lib_redrawln.c                   |    27 +-
 ncurses/base/lib_refresh.c                    |    69 +-
 ncurses/base/lib_restart.c                    |    78 +-
 ncurses/base/lib_scanw.c                      |     6 +-
 ncurses/base/lib_screen.c                     |   132 +-
 ncurses/base/lib_scroll.c                     |    10 +-
 ncurses/base/lib_scrollok.c                   |     6 +-
 ncurses/base/lib_scrreg.c                     |     6 +-
 ncurses/base/lib_set_term.c                   |   472 +-
 ncurses/base/lib_slk.c                        |   238 +-
 ncurses/base/lib_slkatr_set.c                 |    52 +-
 ncurses/base/lib_slkatrof.c                   |    26 +-
 ncurses/base/lib_slkatron.c                   |    26 +-
 ncurses/base/lib_slkatrset.c                  |    20 +-
 ncurses/base/lib_slkattr.c                    |    24 +-
 ncurses/base/lib_slkclear.c                   |    30 +-
 ncurses/base/lib_slkcolor.c                   |    40 +-
 ncurses/base/lib_slkinit.c                    |    45 +-
 ncurses/base/lib_slklab.c                     |    24 +-
 ncurses/base/lib_slkrefr.c                    |   103 +-
 ncurses/base/lib_slkset.c                     |    28 +-
 ncurses/base/lib_slktouch.c                   |    30 +-
 ncurses/base/lib_touch.c                      |    14 +-
 ncurses/base/lib_ungetch.c                    |    14 +-
 ncurses/base/lib_vline.c                      |    10 +-
 ncurses/base/lib_wattroff.c                   |     6 +-
 ncurses/base/lib_wattron.c                    |     8 +-
 ncurses/base/lib_winch.c                      |    12 +-
 ncurses/base/lib_window.c                     |    66 +-
 ncurses/base/nc_panel.c                       |    18 +-
 ncurses/base/resizeterm.c                     |   200 +-
 ncurses/base/safe_sprintf.c                   |    37 +-
 ncurses/base/tries.c                          |    12 +-
 ncurses/base/use_window.c                     |     6 +-
 ncurses/base/wresize.c                        |    33 +-
 ncurses/build.priv.h                          |   108 -
 ncurses/curses.priv.h                         |   878 +-
 ncurses/llib-lncurses                         |  1026 +-
 ncurses/llib-lncursest                        |  1055 +-
 ncurses/llib-lncursestw                       |  5270 -----
 ncurses/llib-lncursesw                        |  1071 +-
 ncurses/modules                               |   370 +-
 ncurses/tinfo/MKcaptab.sh                     |   136 +-
 ncurses/tinfo/MKcodes.awk                     |    23 +-
 ncurses/tinfo/MKfallback.sh                   |    18 +-
 ncurses/tinfo/MKnames.awk                     |    26 +-
 ncurses/tinfo/access.c                        |     7 +-
 ncurses/tinfo/add_tries.c                     |    11 +-
 ncurses/tinfo/alloc_entry.c                   |    19 +-
 ncurses/tinfo/alloc_ttype.c                   |    90 +-
 ncurses/tinfo/captoinfo.c                     |    49 +-
 ncurses/tinfo/comp_expand.c                   |     6 +-
 ncurses/tinfo/comp_hash.c                     |   338 +-
 ncurses/tinfo/comp_parse.c                    |    18 +-
 ncurses/tinfo/comp_scan.c                     |    92 +-
 ncurses/tinfo/db_iterator.c                   |    11 +-
 ncurses/tinfo/entries.c                       |    18 +-
 ncurses/tinfo/free_ttype.c                    |     6 +-
 ncurses/tinfo/hashed_db.c                     |    58 +-
 ncurses/tinfo/home_terminfo.c                 |     6 +-
 ncurses/tinfo/init_keytry.c                   |    20 +-
 ncurses/tinfo/lib_acs.c                       |    82 +-
 ncurses/tinfo/lib_baudrate.c                  |    32 +-
 ncurses/tinfo/lib_cur_term.c                  |   122 +-
 ncurses/tinfo/lib_data.c                      |    50 +-
 ncurses/tinfo/lib_has_cap.c                   |    53 +-
 ncurses/tinfo/lib_kernel.c                    |    82 +-
 ncurses/tinfo/lib_longname.c                  |    42 +-
 ncurses/tinfo/lib_napms.c                     |    21 +-
 ncurses/tinfo/lib_options.c                   |   287 +-
 ncurses/tinfo/lib_print.c                     |    39 +-
 ncurses/tinfo/lib_raw.c                       |   202 +-
 ncurses/tinfo/lib_setup.c                     |   399 +-
 ncurses/tinfo/lib_termcap.c                   |   235 +-
 ncurses/tinfo/lib_termname.c                  |    34 +-
 ncurses/tinfo/lib_ti.c                        |   164 +-
 ncurses/tinfo/lib_tparm.c                     |    49 +-
 ncurses/tinfo/lib_tputs.c                     |   168 +-
 ncurses/tinfo/lib_ttyflags.c                  |   225 +-
 ncurses/tinfo/make_hash.c                     |   294 -
 ncurses/tinfo/make_keys.c                     |    24 +-
 ncurses/tinfo/name_match.c                    |     3 +-
 ncurses/tinfo/parse_entry.c                   |    55 +-
 ncurses/tinfo/read_entry.c                    |    71 +-
 ncurses/tinfo/read_termcap.c                  |    20 +-
 ncurses/tinfo/setbuf.c                        |    35 +-
 ncurses/tinfo/tinfo_driver.c                  |  1337 --
 ncurses/tinfo/trim_sgr0.c                     |    38 +-
 ncurses/tinfo/use_screen.c                    |     8 +-
 ncurses/tinfo/write_entry.c                   |    82 +-
 ncurses/trace/lib_trace.c                     |    37 +-
 ncurses/trace/lib_traceatr.c                  |    55 +-
 ncurses/trace/lib_tracebits.c                 |     7 +-
 ncurses/trace/lib_tracechr.c                  |    10 +-
 ncurses/trace/lib_tracedmp.c                  |    12 +-
 ncurses/trace/lib_tracemse.c                  |    42 +-
 ncurses/trace/trace_buf.c                     |    11 +-
 ncurses/trace/trace_tries.c                   |    14 +-
 ncurses/trace/trace_xnames.c                  |     7 +-
 ncurses/trace/varargs.c                       |     4 +-
 ncurses/trace/visbuf.c                        |    57 +-
 ncurses/tty/MKexpanded.sh                     |    61 +-
 ncurses/tty/hardscroll.c                      |   113 +-
 ncurses/tty/hashmap.c                         |   257 +-
 ncurses/tty/lib_mvcur.c                       |   500 +-
 ncurses/tty/lib_tstp.c                        |    45 +-
 ncurses/tty/lib_twait.c                       |    84 +-
 ncurses/tty/lib_vidattr.c                     |   133 +-
 ncurses/tty/tty_update.c                      |  1236 +-
 ncurses/wcwidth.h                             |   309 -
 ncurses/widechar/lib_add_wch.c                |   438 +-
 ncurses/widechar/lib_box_set.c                |     6 +-
 ncurses/widechar/lib_cchar.c                  |    34 +-
 ncurses/widechar/lib_erasewchar.c             |     8 +-
 ncurses/widechar/lib_get_wch.c                |    33 +-
 ncurses/widechar/lib_get_wstr.c               |     7 +-
 ncurses/widechar/lib_hline_set.c              |    12 +-
 ncurses/widechar/lib_in_wch.c                 |     6 +-
 ncurses/widechar/lib_in_wchnstr.c             |     6 +-
 ncurses/widechar/lib_ins_wch.c                |    56 +-
 ncurses/widechar/lib_inwstr.c                 |     8 +-
 ncurses/widechar/lib_pecho_wchar.c            |     8 +-
 ncurses/widechar/lib_unget_wch.c              |    28 +-
 ncurses/widechar/lib_vid_attr.c               |   124 +-
 ncurses/widechar/lib_vline_set.c              |    12 +-
 ncurses/widechar/lib_wacs.c                   |    31 +-
 ncurses/widechar/lib_wunctrl.c                |    26 +-
 ncurses/win32con/gettimeofday.c               |    51 -
 ncurses/win32con/wcwidth.c                    |    50 -
 ncurses/win32con/win_driver.c                 |  1241 --
 panel/Makefile.in                             |    19 +-
 panel/llib-lpanel                             |    21 +-
 panel/llib-lpanelt                            |   197 -
 panel/llib-lpaneltw                           |   197 -
 panel/llib-lpanelw                            |    21 +-
 panel/modules                                 |    34 +-
 panel/p_above.c                               |    46 +-
 panel/p_below.c                               |    43 +-
 panel/p_bottom.c                              |     8 +-
 panel/p_delete.c                              |    14 +-
 panel/p_hidden.c                              |    18 +-
 panel/p_hide.c                                |    24 +-
 panel/p_move.c                                |    24 +-
 panel/p_new.c                                 |    29 +-
 panel/p_replace.c                             |    26 +-
 panel/p_show.c                                |    39 +-
 panel/p_top.c                                 |     6 +-
 panel/p_update.c                              |    43 +-
 panel/p_user.c                                |     8 +-
 panel/p_win.c                                 |     6 +-
 panel/panel.c                                 |    10 +-
 panel/panel.h                                 |    12 +-
 panel/panel.priv.h                            |    59 +-
 progs/Makefile.in                             |    49 +-
 progs/dump_entry.c                            |    16 +-
 progs/infocmp.c                               |    24 +-
 progs/modules                                 |    10 +-
 progs/tabs.c                                  |   510 -
 progs/tic.c                                   |   207 +-
 progs/toe.c                                   |    23 +-
 progs/tput.c                                  |    60 +-
 progs/transform.c                             |    79 -
 progs/tset.c                                  |    38 +-
 c++/edit_cfg.sh => tar-copy.sh                |    80 +-
 test/Makefile.in                              |   131 -
 test/README                                   |   800 -
 test/aclocal.m4                               |  3130 ---
 test/background.c                             |    95 -
 test/blue.c                                   |   465 -
 test/bs.6                                     |    71 -
 test/bs.c                                     |  1257 --
 test/bulgarian-utf8.txt                       |     6 -
 test/cardfile.c                               |   621 -
 test/cardfile.dat                             |    13 -
 test/chgat.c                                  |   375 -
 test/clip_printw.c                            |   380 -
 test/color_set.c                              |    92 -
 test/configure                                | 15994 ----------------
 test/configure.in                             |   321 -
 test/demo_altkeys.c                           |   163 -
 test/demo_defkey.c                            |   282 -
 test/demo_forms.c                             |   550 -
 test/demo_keyok.c                             |    82 -
 test/demo_menus.c                             |   902 -
 test/demo_panels.c                            |   816 -
 test/demo_termcap.c                           |   311 -
 test/demo_terminfo.c                          |   317 -
 test/ditto.c                                  |   441 -
 test/dots.c                                   |   164 -
 test/dots_mvcur.c                             |   174 -
 test/echochar.c                               |   159 -
 test/edit_field.c                             |   465 -
 test/edit_field.h                             |    53 -
 test/filter.c                                 |   164 -
 test/firework.c                               |   196 -
 test/firstlast.c                              |   123 -
 test/foldkeys.c                               |   264 -
 test/gdc.6                                    |    64 -
 test/gdc.c                                    |   351 -
 test/hanoi.c                                  |   338 -
 test/hashtest.c                               |   247 -
 test/inch_wide.c                              |   279 -
 test/inchs.c                                  |   272 -
 test/ins_wide.c                               |   508 -
 test/insdelln.c                               |   387 -
 test/inserts.c                                |   438 -
 test/key_names.c                              |    93 -
 test/keynames.c                               |    83 -
 test/knight.c                                 |   727 -
 test/linedata.h                               |   100 -
 test/linux-color.dat                          |    48 -
 test/listused.sh                              |   183 -
 test/lrtest.c                                 |   182 -
 test/make-tar.sh                              |   143 -
 test/mk-test.awk                              |   132 -
 test/modules                                  |    96 -
 test/movewindow.c                             |   639 -
 test/ncurses.c                                |  6847 -------
 test/ncurses_tst.hin                          |    56 -
 test/newdemo.c                                |   358 -
 test/package/debian/compat                    |     1 -
 test/package/debian/control                   |    16 -
 test/package/debian/copyright                 |    69 -
 test/package/debian/docs                      |     1 -
 test/package/debian/rules                     |    90 -
 test/package/debian/source/format             |     1 -
 test/package/debian/watch                     |     4 -
 test/package/ncurses-examples.spec            |    55 -
 test/programs                                 |    93 -
 test/railroad.c                               |   254 -
 test/rain.c                                   |   390 -
 test/redraw.c                                 |   171 -
 test/savescreen.c                             |   342 -
 test/savescreen.sh                            |    56 -
 test/tclock.c                                 |   268 -
 test/test.priv.h                              |   771 -
 test/test_add_wchstr.c                        |   589 -
 test/test_addchstr.c                          |   511 -
 test/test_addstr.c                            |   424 -
 test/test_addwstr.c                           |   516 -
 test/test_arrays.c                            |    99 -
 test/test_get_wstr.c                          |   372 -
 test/test_getstr.c                            |   363 -
 test/test_instr.c                             |   260 -
 test/test_inwstr.c                            |   269 -
 test/test_opaque.c                            |   471 -
 test/testaddch.c                              |    88 -
 test/testcurs.c                               |   737 -
 test/testscanw.c                              |    67 -
 test/tracemunch                               |   161 -
 test/view.c                                   |   586 -
 test/widechars-utf8.txt                       |     7 -
 test/worm.c                                   |   618 -
 test/xmas.c                                   |  1162 --
 test/xterm-16color.dat                        |    53 -
 test/xterm-256color.dat                       |   293 -
 test/xterm-88color.dat                        |   125 -
 1029 files changed, 12716 insertions(+), 188502 deletions(-)
 delete mode 100644 Ada95/Makefile.in
 delete mode 100644 Ada95/README
 delete mode 100644 Ada95/TODO
 delete mode 100644 Ada95/aclocal.m4
 delete mode 100755 Ada95/configure
 delete mode 100644 Ada95/configure.in
 delete mode 100644 Ada95/doc/Makefile.in
 delete mode 100644 Ada95/gen/Makefile.in
 delete mode 100644 Ada95/gen/adacurses-config.in
 delete mode 100644 Ada95/gen/gen.c
 delete mode 100644 Ada95/gen/html.m4
 delete mode 100644 Ada95/gen/normal.m4
 delete mode 100644 Ada95/gen/table.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-aux.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-forms.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-menus.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-mouse.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-panels.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses-trace.ads.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses.adb.m4
 delete mode 100644 Ada95/gen/terminal_interface-curses.ads.m4
 delete mode 100755 Ada95/include/MKncurses_def.sh
 delete mode 100644 Ada95/include/Makefile.in
 delete mode 100644 Ada95/include/ncurses_cfg.hin
 delete mode 100644 Ada95/include/ncurses_defs
 delete mode 100755 Ada95/make-tar.sh
 delete mode 100644 Ada95/mk-1st.awk
 delete mode 100644 Ada95/package/AdaCurses-doc.spec
 delete mode 100644 Ada95/package/AdaCurses.spec
 delete mode 100644 Ada95/package/debian/compat
 delete mode 100644 Ada95/package/debian/control
 delete mode 100644 Ada95/package/debian/copyright
 delete mode 100644 Ada95/package/debian/docs
 delete mode 100755 Ada95/package/debian/rules
 delete mode 100644 Ada95/package/debian/source/format
 delete mode 100644 Ada95/package/debian/watch
 delete mode 100644 Ada95/samples/Makefile.in
 delete mode 100644 Ada95/samples/README
 delete mode 100644 Ada95/samples/explain.txt
 delete mode 100644 Ada95/samples/ncurses.adb
 delete mode 100644 Ada95/samples/ncurses2-acs_and_scroll.adb
 delete mode 100644 Ada95/samples/ncurses2-acs_and_scroll.ads
 delete mode 100644 Ada95/samples/ncurses2-acs_display.adb
 delete mode 100644 Ada95/samples/ncurses2-acs_display.ads
 delete mode 100644 Ada95/samples/ncurses2-attr_test.adb
 delete mode 100644 Ada95/samples/ncurses2-attr_test.ads
 delete mode 100644 Ada95/samples/ncurses2-color_edit.adb
 delete mode 100644 Ada95/samples/ncurses2-color_edit.ads
 delete mode 100644 Ada95/samples/ncurses2-color_test.adb
 delete mode 100644 Ada95/samples/ncurses2-color_test.ads
 delete mode 100644 Ada95/samples/ncurses2-demo_forms.adb
 delete mode 100644 Ada95/samples/ncurses2-demo_forms.ads
 delete mode 100644 Ada95/samples/ncurses2-demo_pad.adb
 delete mode 100644 Ada95/samples/ncurses2-demo_pad.ads
 delete mode 100644 Ada95/samples/ncurses2-demo_panels.adb
 delete mode 100644 Ada95/samples/ncurses2-demo_panels.ads
 delete mode 100644 Ada95/samples/ncurses2-flushinp_test.adb
 delete mode 100644 Ada95/samples/ncurses2-flushinp_test.ads
 delete mode 100644 Ada95/samples/ncurses2-genericputs.adb
 delete mode 100644 Ada95/samples/ncurses2-genericputs.ads
 delete mode 100644 Ada95/samples/ncurses2-getch.ads
 delete mode 100644 Ada95/samples/ncurses2-getch_test.adb
 delete mode 100644 Ada95/samples/ncurses2-getch_test.ads
 delete mode 100644 Ada95/samples/ncurses2-getopt.adb
 delete mode 100644 Ada95/samples/ncurses2-getopt.ads
 delete mode 100644 Ada95/samples/ncurses2-m.adb
 delete mode 100644 Ada95/samples/ncurses2-m.ads
 delete mode 100644 Ada95/samples/ncurses2-menu_test.adb
 delete mode 100644 Ada95/samples/ncurses2-menu_test.ads
 delete mode 100644 Ada95/samples/ncurses2-overlap_test.adb
 delete mode 100644 Ada95/samples/ncurses2-overlap_test.ads
 delete mode 100644 Ada95/samples/ncurses2-slk_test.adb
 delete mode 100644 Ada95/samples/ncurses2-slk_test.ads
 delete mode 100644 Ada95/samples/ncurses2-test_sgr_attributes.adb
 delete mode 100644 Ada95/samples/ncurses2-test_sgr_attributes.ads
 delete mode 100644 Ada95/samples/ncurses2-trace_set.adb
 delete mode 100644 Ada95/samples/ncurses2-trace_set.ads
 delete mode 100644 Ada95/samples/ncurses2-util.adb
 delete mode 100644 Ada95/samples/ncurses2-util.ads
 delete mode 100644 Ada95/samples/ncurses2.ads
 delete mode 100644 Ada95/samples/rain.adb
 delete mode 100644 Ada95/samples/rain.ads
 delete mode 100644 Ada95/samples/sample-curses_demo-attributes.adb
 delete mode 100644 Ada95/samples/sample-curses_demo-attributes.ads
 delete mode 100644 Ada95/samples/sample-curses_demo-mouse.adb
 delete mode 100644 Ada95/samples/sample-curses_demo-mouse.ads
 delete mode 100644 Ada95/samples/sample-curses_demo.adb
 delete mode 100644 Ada95/samples/sample-curses_demo.ads
 delete mode 100644 Ada95/samples/sample-explanation.adb
 delete mode 100644 Ada95/samples/sample-explanation.ads
 delete mode 100644 Ada95/samples/sample-form_demo-aux.adb
 delete mode 100644 Ada95/samples/sample-form_demo-aux.ads
 delete mode 100644 Ada95/samples/sample-form_demo-handler.adb
 delete mode 100644 Ada95/samples/sample-form_demo-handler.ads
 delete mode 100644 Ada95/samples/sample-form_demo.adb
 delete mode 100644 Ada95/samples/sample-form_demo.ads
 delete mode 100644 Ada95/samples/sample-function_key_setting.adb
 delete mode 100644 Ada95/samples/sample-function_key_setting.ads
 delete mode 100644 Ada95/samples/sample-header_handler.adb
 delete mode 100644 Ada95/samples/sample-header_handler.ads
 delete mode 100644 Ada95/samples/sample-helpers.adb
 delete mode 100644 Ada95/samples/sample-helpers.ads
 delete mode 100644 Ada95/samples/sample-keyboard_handler.adb
 delete mode 100644 Ada95/samples/sample-keyboard_handler.ads
 delete mode 100644 Ada95/samples/sample-manifest.ads
 delete mode 100644 Ada95/samples/sample-menu_demo-aux.adb
 delete mode 100644 Ada95/samples/sample-menu_demo-aux.ads
 delete mode 100644 Ada95/samples/sample-menu_demo-handler.adb
 delete mode 100644 Ada95/samples/sample-menu_demo-handler.ads
 delete mode 100644 Ada95/samples/sample-menu_demo.adb
 delete mode 100644 Ada95/samples/sample-menu_demo.ads
 delete mode 100644 Ada95/samples/sample-my_field_type.adb
 delete mode 100644 Ada95/samples/sample-my_field_type.ads
 delete mode 100644 Ada95/samples/sample-text_io_demo.adb
 delete mode 100644 Ada95/samples/sample-text_io_demo.ads
 delete mode 100644 Ada95/samples/sample.adb
 delete mode 100644 Ada95/samples/sample.ads
 delete mode 100644 Ada95/samples/status.adb
 delete mode 100644 Ada95/samples/status.ads
 delete mode 100644 Ada95/samples/tour.adb
 delete mode 100644 Ada95/samples/tour.ads
 delete mode 100644 Ada95/src/Makefile.in
 delete mode 100644 Ada95/src/c_varargs_to_ada.c
 delete mode 100644 Ada95/src/c_varargs_to_ada.h
 delete mode 100644 Ada95/src/library.gpr
 delete mode 100644 Ada95/src/modules
 delete mode 100644 Ada95/src/ncurses_compat.c
 delete mode 100644 Ada95/src/terminal_interface-curses-aux.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types-user.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_types.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-field_user_data.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms-form_user_data.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-forms.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-menus-item_user_data.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-menus-menu_user_data.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-menus.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-mouse.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-panels-user_data.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-panels.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-putwin.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-putwin.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-termcap.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-termcap.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-terminfo.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-terminfo.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-aux.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-aux.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-complex_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-complex_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-decimal_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-decimal_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-fixed_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-fixed_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-float_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-float_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-integer_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-integer_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-modular_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io-modular_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io.adb
 delete mode 100644 Ada95/src/terminal_interface-curses-text_io.ads
 delete mode 100644 Ada95/src/terminal_interface-curses-trace.adb_p
 delete mode 100644 Ada95/src/terminal_interface.ads
 delete mode 100644 README.MinGW
 delete mode 100644 c++/Makefile.in
 delete mode 100644 c++/NEWS
 delete mode 100644 c++/PROBLEMS
 delete mode 100644 c++/README-first
 delete mode 100644 c++/cursesapp.cc
 delete mode 100644 c++/cursesapp.h
 delete mode 100644 c++/cursesf.cc
 delete mode 100644 c++/cursesf.h
 delete mode 100644 c++/cursesm.cc
 delete mode 100644 c++/cursesm.h
 delete mode 100644 c++/cursesmain.cc
 delete mode 100644 c++/cursesp.cc
 delete mode 100644 c++/cursesp.h
 delete mode 100644 c++/cursespad.cc
 delete mode 100644 c++/cursesw.cc
 delete mode 100644 c++/cursesw.h
 delete mode 100644 c++/cursslk.cc
 delete mode 100644 c++/cursslk.h
 delete mode 100644 c++/demo.cc
 delete mode 100644 c++/etip.h.in
 delete mode 100644 c++/headers
 delete mode 100644 c++/internal.h
 delete mode 100644 c++/modules
 delete mode 100644 doc/html/Ada95.html
 delete mode 100644 doc/html/ada/files.htm
 delete mode 100644 doc/html/ada/files/T.htm
 delete mode 100644 doc/html/ada/funcs.htm
 delete mode 100644 doc/html/ada/funcs/A.htm
 delete mode 100644 doc/html/ada/funcs/B.htm
 delete mode 100644 doc/html/ada/funcs/C.htm
 delete mode 100644 doc/html/ada/funcs/D.htm
 delete mode 100644 doc/html/ada/funcs/E.htm
 delete mode 100644 doc/html/ada/funcs/F.htm
 delete mode 100644 doc/html/ada/funcs/G.htm
 delete mode 100644 doc/html/ada/funcs/H.htm
 delete mode 100644 doc/html/ada/funcs/I.htm
 delete mode 100644 doc/html/ada/funcs/K.htm
 delete mode 100644 doc/html/ada/funcs/L.htm
 delete mode 100644 doc/html/ada/funcs/M.htm
 delete mode 100644 doc/html/ada/funcs/N.htm
 delete mode 100644 doc/html/ada/funcs/O.htm
 delete mode 100644 doc/html/ada/funcs/P.htm
 delete mode 100644 doc/html/ada/funcs/Q.htm
 delete mode 100644 doc/html/ada/funcs/R.htm
 delete mode 100644 doc/html/ada/funcs/S.htm
 delete mode 100644 doc/html/ada/funcs/T.htm
 delete mode 100644 doc/html/ada/funcs/U.htm
 delete mode 100644 doc/html/ada/funcs/V.htm
 delete mode 100644 doc/html/ada/funcs/W.htm
 delete mode 100644 doc/html/ada/index.htm
 delete mode 100644 doc/html/ada/main.htm
 delete mode 100644 doc/html/ada/table.html
 delete mode 100644 doc/html/ada/terminal_interface-curses-aux__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-aux__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-forms__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-menus__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-menus__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-mouse__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-mouse__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-panels__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-panels__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-putwin__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-putwin__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-termcap__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-termcap__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-terminfo__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-terminfo__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-text_io__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-trace__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses-trace__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses__adb.htm
 delete mode 100644 doc/html/ada/terminal_interface-curses__ads.htm
 delete mode 100644 doc/html/ada/terminal_interface__ads.htm
 delete mode 100644 doc/html/index.html
 delete mode 100644 doc/html/man/adacurses-config.1.html
 delete mode 100644 doc/html/man/captoinfo.1m.html
 delete mode 100644 doc/html/man/clear.1.html
 delete mode 100644 doc/html/man/curs_add_wch.3x.html
 delete mode 100644 doc/html/man/curs_add_wchstr.3x.html
 delete mode 100644 doc/html/man/curs_addch.3x.html
 delete mode 100644 doc/html/man/curs_addchstr.3x.html
 delete mode 100644 doc/html/man/curs_addstr.3x.html
 delete mode 100644 doc/html/man/curs_addwstr.3x.html
 delete mode 100644 doc/html/man/curs_attr.3x.html
 delete mode 100644 doc/html/man/curs_beep.3x.html
 delete mode 100644 doc/html/man/curs_bkgd.3x.html
 delete mode 100644 doc/html/man/curs_bkgrnd.3x.html
 delete mode 100644 doc/html/man/curs_border.3x.html
 delete mode 100644 doc/html/man/curs_border_set.3x.html
 delete mode 100644 doc/html/man/curs_clear.3x.html
 delete mode 100644 doc/html/man/curs_color.3x.html
 delete mode 100644 doc/html/man/curs_delch.3x.html
 delete mode 100644 doc/html/man/curs_deleteln.3x.html
 delete mode 100644 doc/html/man/curs_extend.3x.html
 delete mode 100644 doc/html/man/curs_get_wch.3x.html
 delete mode 100644 doc/html/man/curs_get_wstr.3x.html
 delete mode 100644 doc/html/man/curs_getcchar.3x.html
 delete mode 100644 doc/html/man/curs_getch.3x.html
 delete mode 100644 doc/html/man/curs_getstr.3x.html
 delete mode 100644 doc/html/man/curs_getyx.3x.html
 delete mode 100644 doc/html/man/curs_in_wch.3x.html
 delete mode 100644 doc/html/man/curs_in_wchstr.3x.html
 delete mode 100644 doc/html/man/curs_inch.3x.html
 delete mode 100644 doc/html/man/curs_inchstr.3x.html
 delete mode 100644 doc/html/man/curs_initscr.3x.html
 delete mode 100644 doc/html/man/curs_inopts.3x.html
 delete mode 100644 doc/html/man/curs_ins_wch.3x.html
 delete mode 100644 doc/html/man/curs_ins_wstr.3x.html
 delete mode 100644 doc/html/man/curs_insch.3x.html
 delete mode 100644 doc/html/man/curs_insstr.3x.html
 delete mode 100644 doc/html/man/curs_instr.3x.html
 delete mode 100644 doc/html/man/curs_inwstr.3x.html
 delete mode 100644 doc/html/man/curs_kernel.3x.html
 delete mode 100644 doc/html/man/curs_legacy.3x.html
 delete mode 100644 doc/html/man/curs_memleaks.3x.html
 delete mode 100644 doc/html/man/curs_mouse.3x.html
 delete mode 100644 doc/html/man/curs_move.3x.html
 delete mode 100644 doc/html/man/curs_opaque.3x.html
 delete mode 100644 doc/html/man/curs_outopts.3x.html
 delete mode 100644 doc/html/man/curs_overlay.3x.html
 delete mode 100644 doc/html/man/curs_pad.3x.html
 delete mode 100644 doc/html/man/curs_print.3x.html
 delete mode 100644 doc/html/man/curs_printw.3x.html
 delete mode 100644 doc/html/man/curs_refresh.3x.html
 delete mode 100644 doc/html/man/curs_scanw.3x.html
 delete mode 100644 doc/html/man/curs_scr_dump.3x.html
 delete mode 100644 doc/html/man/curs_scroll.3x.html
 delete mode 100644 doc/html/man/curs_slk.3x.html
 delete mode 100644 doc/html/man/curs_sp_funcs.3x.html
 delete mode 100644 doc/html/man/curs_termattrs.3x.html
 delete mode 100644 doc/html/man/curs_termcap.3x.html
 delete mode 100644 doc/html/man/curs_terminfo.3x.html
 delete mode 100644 doc/html/man/curs_threads.3x.html
 delete mode 100644 doc/html/man/curs_touch.3x.html
 delete mode 100644 doc/html/man/curs_trace.3x.html
 delete mode 100644 doc/html/man/curs_util.3x.html
 delete mode 100644 doc/html/man/curs_variables.3x.html
 delete mode 100644 doc/html/man/curs_window.3x.html
 delete mode 100644 doc/html/man/default_colors.3x.html
 delete mode 100644 doc/html/man/define_key.3x.html
 delete mode 100644 doc/html/man/form.3x.html
 delete mode 100644 doc/html/man/form_cursor.3x.html
 delete mode 100644 doc/html/man/form_data.3x.html
 delete mode 100644 doc/html/man/form_driver.3x.html
 delete mode 100644 doc/html/man/form_field.3x.html
 delete mode 100644 doc/html/man/form_field_attributes.3x.html
 delete mode 100644 doc/html/man/form_field_buffer.3x.html
 delete mode 100644 doc/html/man/form_field_info.3x.html
 delete mode 100644 doc/html/man/form_field_just.3x.html
 delete mode 100644 doc/html/man/form_field_new.3x.html
 delete mode 100644 doc/html/man/form_field_opts.3x.html
 delete mode 100644 doc/html/man/form_field_userptr.3x.html
 delete mode 100644 doc/html/man/form_field_validation.3x.html
 delete mode 100644 doc/html/man/form_fieldtype.3x.html
 delete mode 100644 doc/html/man/form_hook.3x.html
 delete mode 100644 doc/html/man/form_new.3x.html
 delete mode 100644 doc/html/man/form_new_page.3x.html
 delete mode 100644 doc/html/man/form_opts.3x.html
 delete mode 100644 doc/html/man/form_page.3x.html
 delete mode 100644 doc/html/man/form_post.3x.html
 delete mode 100644 doc/html/man/form_requestname.3x.html
 delete mode 100644 doc/html/man/form_userptr.3x.html
 delete mode 100644 doc/html/man/form_variables.3x.html
 delete mode 100644 doc/html/man/form_win.3x.html
 delete mode 100644 doc/html/man/index.html
 delete mode 100644 doc/html/man/infocmp.1m.html
 delete mode 100644 doc/html/man/infotocap.1m.html
 delete mode 100644 doc/html/man/key_defined.3x.html
 delete mode 100644 doc/html/man/keybound.3x.html
 delete mode 100644 doc/html/man/keyok.3x.html
 delete mode 100644 doc/html/man/legacy_coding.3x.html
 delete mode 100644 doc/html/man/menu.3x.html
 delete mode 100644 doc/html/man/menu_attributes.3x.html
 delete mode 100644 doc/html/man/menu_cursor.3x.html
 delete mode 100644 doc/html/man/menu_driver.3x.html
 delete mode 100644 doc/html/man/menu_format.3x.html
 delete mode 100644 doc/html/man/menu_hook.3x.html
 delete mode 100644 doc/html/man/menu_items.3x.html
 delete mode 100644 doc/html/man/menu_mark.3x.html
 delete mode 100644 doc/html/man/menu_new.3x.html
 delete mode 100644 doc/html/man/menu_opts.3x.html
 delete mode 100644 doc/html/man/menu_pattern.3x.html
 delete mode 100644 doc/html/man/menu_post.3x.html
 delete mode 100644 doc/html/man/menu_requestname.3x.html
 delete mode 100644 doc/html/man/menu_spacing.3x.html
 delete mode 100644 doc/html/man/menu_userptr.3x.html
 delete mode 100644 doc/html/man/menu_win.3x.html
 delete mode 100644 doc/html/man/mitem_current.3x.html
 delete mode 100644 doc/html/man/mitem_name.3x.html
 delete mode 100644 doc/html/man/mitem_new.3x.html
 delete mode 100644 doc/html/man/mitem_opts.3x.html
 delete mode 100644 doc/html/man/mitem_userptr.3x.html
 delete mode 100644 doc/html/man/mitem_value.3x.html
 delete mode 100644 doc/html/man/mitem_visible.3x.html
 delete mode 100644 doc/html/man/ncurses.3x.html
 delete mode 100644 doc/html/man/ncurses5-config.1.html
 delete mode 100644 doc/html/man/panel.3x.html
 delete mode 100644 doc/html/man/resizeterm.3x.html
 delete mode 100644 doc/html/man/tabs.1.html
 delete mode 100644 doc/html/man/term.5.html
 delete mode 100644 doc/html/man/term.7.html
 delete mode 100644 doc/html/man/term_variables.3x.html
 delete mode 100644 doc/html/man/terminfo.5.html
 delete mode 100644 doc/html/man/tic.1m.html
 delete mode 100644 doc/html/man/toe.1m.html
 delete mode 100644 doc/html/man/tput.1.html
 delete mode 100644 doc/html/man/tset.1.html
 delete mode 100644 doc/html/man/wresize.3x.html
 delete mode 100644 form/fty_generic.c
 delete mode 100644 form/llib-lformt
 delete mode 100644 form/llib-lformtw
 delete mode 100644 include/nc_mingw.h
 rename include/{ncurses_dll.h.in => ncurses_dll.h} (93%)
 delete mode 100644 include/ncurses_mingw.h
 delete mode 100644 man/MKada_config.in
 delete mode 100644 man/MKncu_config.in
 delete mode 100644 man/curs_sp_funcs.3x
 delete mode 100644 man/curs_variables.3x
 delete mode 100644 man/form_variables.3x
 delete mode 100644 man/tabs.1
 delete mode 100644 man/term_variables.3x
 delete mode 100644 menu/llib-lmenut
 delete mode 100644 menu/llib-lmenutw
 delete mode 100644 misc/gen-pkgconfig.in
 create mode 100755 misc/jpf-indent
 create mode 100755 misc/ncu-indent
 delete mode 100644 mk-dlls.sh.in
 create mode 100644 mkdirs.sh
 delete mode 100644 ncurses/base/lib_driver.c
 delete mode 100644 ncurses/build.priv.h
 delete mode 100644 ncurses/llib-lncursestw
 delete mode 100644 ncurses/tinfo/make_hash.c
 delete mode 100644 ncurses/tinfo/tinfo_driver.c
 delete mode 100644 ncurses/wcwidth.h
 delete mode 100644 ncurses/win32con/gettimeofday.c
 delete mode 100644 ncurses/win32con/wcwidth.c
 delete mode 100644 ncurses/win32con/win_driver.c
 delete mode 100644 panel/llib-lpanelt
 delete mode 100644 panel/llib-lpaneltw
 delete mode 100644 progs/tabs.c
 delete mode 100644 progs/transform.c
 rename c++/edit_cfg.sh => tar-copy.sh (69%)
 delete mode 100644 test/Makefile.in
 delete mode 100644 test/README
 delete mode 100644 test/aclocal.m4
 delete mode 100644 test/background.c
 delete mode 100644 test/blue.c
 delete mode 100644 test/bs.6
 delete mode 100644 test/bs.c
 delete mode 100644 test/bulgarian-utf8.txt
 delete mode 100644 test/cardfile.c
 delete mode 100644 test/cardfile.dat
 delete mode 100644 test/chgat.c
 delete mode 100644 test/clip_printw.c
 delete mode 100644 test/color_set.c
 delete mode 100755 test/configure
 delete mode 100644 test/configure.in
 delete mode 100644 test/demo_altkeys.c
 delete mode 100644 test/demo_defkey.c
 delete mode 100644 test/demo_forms.c
 delete mode 100644 test/demo_keyok.c
 delete mode 100644 test/demo_menus.c
 delete mode 100644 test/demo_panels.c
 delete mode 100644 test/demo_termcap.c
 delete mode 100644 test/demo_terminfo.c
 delete mode 100644 test/ditto.c
 delete mode 100644 test/dots.c
 delete mode 100644 test/dots_mvcur.c
 delete mode 100644 test/echochar.c
 delete mode 100644 test/edit_field.c
 delete mode 100644 test/edit_field.h
 delete mode 100644 test/filter.c
 delete mode 100644 test/firework.c
 delete mode 100644 test/firstlast.c
 delete mode 100644 test/foldkeys.c
 delete mode 100644 test/gdc.6
 delete mode 100644 test/gdc.c
 delete mode 100644 test/hanoi.c
 delete mode 100644 test/hashtest.c
 delete mode 100644 test/inch_wide.c
 delete mode 100644 test/inchs.c
 delete mode 100644 test/ins_wide.c
 delete mode 100644 test/insdelln.c
 delete mode 100644 test/inserts.c
 delete mode 100644 test/key_names.c
 delete mode 100644 test/keynames.c
 delete mode 100644 test/knight.c
 delete mode 100644 test/linedata.h
 delete mode 100644 test/linux-color.dat
 delete mode 100755 test/listused.sh
 delete mode 100644 test/lrtest.c
 delete mode 100755 test/make-tar.sh
 delete mode 100644 test/mk-test.awk
 delete mode 100644 test/modules
 delete mode 100644 test/movewindow.c
 delete mode 100644 test/ncurses.c
 delete mode 100644 test/ncurses_tst.hin
 delete mode 100644 test/newdemo.c
 delete mode 100644 test/package/debian/compat
 delete mode 100644 test/package/debian/control
 delete mode 100644 test/package/debian/copyright
 delete mode 100644 test/package/debian/docs
 delete mode 100755 test/package/debian/rules
 delete mode 100644 test/package/debian/source/format
 delete mode 100644 test/package/debian/watch
 delete mode 100644 test/package/ncurses-examples.spec
 delete mode 100644 test/programs
 delete mode 100644 test/railroad.c
 delete mode 100644 test/rain.c
 delete mode 100644 test/redraw.c
 delete mode 100644 test/savescreen.c
 delete mode 100755 test/savescreen.sh
 delete mode 100644 test/tclock.c
 delete mode 100644 test/test.priv.h
 delete mode 100644 test/test_add_wchstr.c
 delete mode 100644 test/test_addchstr.c
 delete mode 100644 test/test_addstr.c
 delete mode 100644 test/test_addwstr.c
 delete mode 100644 test/test_arrays.c
 delete mode 100644 test/test_get_wstr.c
 delete mode 100644 test/test_getstr.c
 delete mode 100644 test/test_instr.c
 delete mode 100644 test/test_inwstr.c
 delete mode 100644 test/test_opaque.c
 delete mode 100644 test/testaddch.c
 delete mode 100644 test/testcurs.c
 delete mode 100644 test/testscanw.c
 delete mode 100755 test/tracemunch
 delete mode 100644 test/view.c
 delete mode 100644 test/widechars-utf8.txt
 delete mode 100644 test/worm.c
 delete mode 100644 test/xmas.c
 delete mode 100644 test/xterm-16color.dat
 delete mode 100644 test/xterm-256color.dat
 delete mode 100644 test/xterm-88color.dat

diff --git a/ANNOUNCE b/ANNOUNCE
index 11933c5f6d5..e09e73177a4 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,4 +1,4 @@
-                            Announcing ncurses 5.9
+                            Announcing ncurses 5.7
 
    The  ncurses  (new  curses)  library  is  a free software emulation of
    curses  in  System  V  Release 4.0, and more. It uses terminfo format,
@@ -27,30 +27,217 @@
                                  Release Notes
 
    This  release  is  designed  to  be upward compatible from ncurses 5.0
-   through   5.8;  very  few  applications  will  require  recompilation,
+   through   5.6;  very  few  applications  will  require  recompilation,
    depending   on  the  platform.  These  are  the  highlights  from  the
-   change-log since ncurses 5.8 release.
+   change-log since ncurses 5.6 release.
 
-   This  is  a  bug-fix  release,  correcting  a  small  number of urgent
-   problems in the ncurses library from the 5.8 release.
+   Interface changes:
+     * generate linkable stubs for some macros:
+       getattrs
 
-   It also improves the Ada95 binding:
-     * fixes  a  longstanding  portability  problem  with  its use of the
-       [3]set_field_type    function.    Because   that   function   uses
-       variable-length  argument  lists, its interface with gnat does not
-       work with certain platforms.
-     * improves  configurability and portability, particularly when built
-       separately  from the main ncurses tree. The 5.8 release introduced
-       scripts  which  can be used to construct separate tarballs for the
-       Ada95 and ncurses examples.
-       Those  were a proof of concept. For the 5.9 release, those scripts
-       are  augmented  with  rpm-  and  dpkg-scripts  used in test builds
-       against  a  variety of gnat- and system ncurses versions as old as
-       gnat  3.15  and  ncurses  5.4  (see  snapshots  and systems tested
-       [4]here.
-     * additional  improvements  were made for portability of the ncurses
-       examples,  adding  rpm-  and  dpkg-scripts  for  test-builds.  See
-       [5]this page for snapshots and other information.
+   New features and improvements:
+     * library
+          + new  flavor  of  the  ncurses  library  provides  rudimentary
+            support  for  POSIX threads. Several functions are reentrant,
+            but most require either a window-level or screen-level mutex.
+            (This  is  API-compatible,  but  not  ABI-compatible with the
+            normal library).
+          + add  NCURSES_OPAQUE  symbol  to  curses.h,  will  use to make
+            structs opaque in selected configurations.
+          + add   NCURSES_EXT_FUNCS  and  NCURSES_EXT_COLORS  symbols  to
+            curses.h to make it simpler to tell if the extended functions
+            and/or colors are declared.
+          + add wresize() to C++ binding
+          + eliminate fixed-buffer vsprintf() calls in C++ binding.
+          + add  several  functions to C++ binding which wrap C functions
+            that pass a WINDOW* parameter.
+          + adapt mouse-handling code from menu library in form-library
+          + improve  tracing  for  form  library,  showing created forms,
+            fields, etc.
+          + make $NCURSES_NO_PADDING feature work for termcap interface .
+          + add  check  to  trace-file  open,  if  the  given  name  is a
+            directory, add ".log" to the name and try again.
+          + several   new   manpages:  curs_legacy.3x,  curs_memleaks.3x,
+            curs_opaque.3x and curs_threads.3x
+     * programs:
+          + modified  three  test-programs  to  demonstrate the threading
+            support in this version: ditto, rain, worm.
+          + several    new    test-programs:   demo_panels,   dots_mvcur,
+            inch_wide,    inchs,    key_name,    key_names,   savescreen,
+            savescreen.sh    test_arrays,   test_get_wstr,   test_getstr,
+            test_instr, test_inwstr and test_opaque.
+          + add adacurses-config to the Ada95 install.
+          + modify  tic  -f option to format spaces as \s to prevent them
+            from  being  lost  when  that  is  read  back  in unformatted
+            strings.
+          + The tack program is now distributed separately from ncurses.
+     * terminal database
+          + added entries:
+               o Eterm-256color, Eterm-88color and rxvt-88color
+               o aterm
+               o konsole-256color
+               o mrxvt
+               o screen.mlterm
+               o screen.rxvt
+               o teraterm4.59  is now the primary primary teraterm entry,
+                 renamed original to teraterm2.3
+               o 9term terminal
+               o Newbury Data entries
+          + updated/improved entries:
+               o gnome to version 2.22.3
+               o h19, z100
+               o konsole to version 1.6.6
+               o mlterm, mlterm+pcfkeys
+               o xterm, and building-blocks for function-keys to [3]xterm
+                 patch #230.
+
+   Major bug fixes:
+     * add   logic   to   tic  for  cancelling  strings  in  user-defined
+       capabilities (this is needed for current konsole terminfo entry).
+     * modify  mk-1st.awk  so the generated makefile rules for linking or
+       installing  shared  libraries  do not first remove the library, in
+       case it is in use, e.g., libncurses.so by /bin/sh.
+     * correct check for notimeout() in wgetch().
+     * fix a sign-extension bug in infocmp's repair_acsc() function.
+     * change winnstr() to stop at the end of the line.
+     * make Ada95 demo_panels() example work.
+     * fix for adding a non-spacing character at the beginning of a line.
+     * fill   in   extended-color   pair   to   make   colors   work  for
+       wide-characters using extended-colors.
+     * improve  refresh  of  window  on  top  of multi-column characters,
+       taking   into   account  split  characters  on  left/right  window
+       boundaries.
+     * modify  win_wchnstr()  to ensure that only a base cell is returned
+       for each multi-column character.
+     * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by
+       using  unctrl()  to  display  illegal  bytes rather than trying to
+       append further bytes to make up a valid sequence.
+     * restore curs_set() state after endwin()/refresh()
+     * modify  keyname() to use "^X" form only if meta() has been called,
+       or  if  keyname() is called without initializing curses, e.g., via
+       initscr() or newterm().
+     * modify  unctrl() to check codes in 128-255 range versus isprint().
+       If  they  are not printable, and locale was set, use a "M-" or "~"
+       sequence.
+     * improve  resizeterm()  by  moving ripped-off lines, and repainting
+       the soft-keys.
+     * modify  form  library to accept control characters such as newline
+       in set_field_buffer(), which is compatible with Solaris.
+     * use  NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc.,
+       to   make   those   work   properly  with  the  --enable-ext-mouse
+       configuration
+     * correct  some  functions  in Ada95 binding which were using return
+       value from C where none was returned.
+     * reviewed/fixed issues reported by Coverity and Klocwork tools.
+
+   Portability:
+     * configure script:
+          + new options:
+
+              --disable-big-strings
+                      control  whether static string tables are generated
+                      as   single   large  strings  (to  improve  startup
+                      performance), or as array of individual strings.
+
+              --disable-relink
+                      control   whether  shared  libraries  are  relinked
+                      (during install) when rpath is enabled.
+
+              --disable-tic-depends
+                      make   explicit  whether  tic  library  depends  on
+                      ncurses/ncursesw library.
+
+              --enable-mixed-case
+                      override   the  configure  script's  check  if  the
+                      filesystem   supports  mixed-case  filenames.  This
+                      allows  one  to  control  how the terminal database
+                      maps to the filesystem. For filesystems that do not
+                      support   mixed-case,  the  library  uses  generate
+                      2-character (hexadecimal) codes for the lower-level
+                      of the filesystem terminfo database
+
+              --enable-reentrant
+                      builds  a  different  flavor of the ncurses library
+                      (ncursest)  which  improves  reentrant  use  of the
+                      library  by  reducing  global  and static variables
+                      (see  the  "--with-pthread" option for the threaded
+                      support).
+
+              --enable-weak-symbols
+                      use  weak-symbols  for  linking to the POSIX thread
+                      library,  and  use  the same soname for the ncurses
+                      shared  library  as the normal library (caveat: the
+                      ABI is for the threaded library, which makes global
+                      data accessed via functions).
+
+              --with-pthread
+                      build  with  the  POSIX thread library (tested with
+                      AIX,   Linux,   FreeBSD,   OpenBSD,  HPUX,  IRIX64,
+                      Solaris, Tru64).
+
+              --with-ticlib
+                      build/install   the   tic-support  functions  in  a
+                      separate library
+
+          + improved options:
+
+              --enable-ext-colors
+                      requires the wide-character configuration.
+
+              --with-chtype
+                      ignore  option  value "unsigned" is always added to
+                      the   type   in   curses.h;   do   the   same   for
+                      --with-mmask-t.
+
+              --with-dmalloc
+                      build-fix for redefinition of strndup.
+
+              --with-hashed-db
+                      accepts  a parameter which is the install-prefix of
+                      a given Berkeley Database.
+
+              --with-hashed-db
+                      the $LIBS environment variable overrides the search
+                      for the db library.
+
+              --without-hashed-db
+                      assumed when "--disable-database" is used.
+
+     * other configure/build issues:
+          + build-fixes for LynxOS
+          + modify  shared-library  rules  to  allow  FreeBSD  3.x to use
+            rpath.
+          + build-fix for FreeBSD "contemporary" TTY interface.
+          + build-fixes for AIX with libtool.
+          + build-fixes for Darwin and libtool.
+          + modify BeOS-specific ifdef's to build on Haiku.
+          + corrected  gcc  options  for  building  shared  libraries  on
+            Solaris and IRIX64.
+          + change  shared-library  configuration for OpenBSD, make rpath
+            work.
+          + build-fixes for using libutf8, e.g., on OpenBSD 3.7
+          + add   "-e"  option  in  ncurses/Makefile.in  when  generating
+            source-files  to  force earlier exit if the build environment
+            fails unexpectedly.
+          + add support for shared libraries for QNX.
+          + change  delimiter  in  MKlib_gen.sh from '%' to '@', to avoid
+            substitution  by  IBM xlc to '#' as part of its extensions to
+            digraphs.
+     * library:
+          + rewrite  wrapper  for  wcrtomb(),  making it work on Solaris.
+            This  is  used in the form library to determine the length of
+            the buffer needed by field_buffer.
+          + add/use  configure  script  macro  CF_SIG_ATOMIC_T,  use  the
+            corresponding type for data manipulated by signal handlers.
+          + set locale in misc/ncurses-config.in since it uses a range
+          + disable  GPM  mouse  support  when  $TERM  does not happen to
+            contain  "linux",  since  Gpm_Open()  no  longer  limits  its
+            assertion  to  terminals  that  it might handle, e.g., within
+            "screen" in xterm.
+          + reset mouse file-descriptor when unloading GPM library.
+     * test programs:
+          + update  test  programs to build/work with various UNIX curses
+            for comparisons.
 
                               Features of Ncurses
 
@@ -87,15 +274,15 @@
      * Support  for mouse event reporting with X Window xterm and FreeBSD
        and OS/2 console windows.
      * Extended mouse support via Alessandro Rubini's gpm package.
-     * The  function  wresize  allows  you  to resize windows, preserving
+     * The  function  wresize()  allows you to resize windows, preserving
        their data.
-     * The  function  use_default_colors allows you to use the terminal's
+     * The function use_default_colors() allows you to use the terminal's
        default colors for the default color pair, achieving the effect of
        transparent colors.
-     * The functions keyok and define_key allow you to better control the
-       use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by
-       defining  more  than  one  control  sequence to map to a given key
-       code.
+     * The functions keyok() and define_key() allow you to better control
+       the  use  of function keys, e.g., disabling the ncurses KEY_MOUSE,
+       or  by  defining  more than one control sequence to map to a given
+       key code.
      * Support  for  256-color  terminals,  such  as  modern  xterm, when
        configured using the --enable-ext-colors option.
      * Support for 16-color terminals, such as aixterm and modern xterm.
@@ -106,7 +293,7 @@
        incorporates  a novel, simple, and cheap algorithm that enables it
        to  make  optimal  use  of hardware scrolling, line-insertion, and
        line-deletion  for  screen-line  movements. This algorithm is more
-       powerful than the 4.4BSD curses quickch routine.
+       powerful than the 4.4BSD curses quickch() routine.
      * Real  support  for  terminals  with  the  magic-cookie glitch. The
        screen-update  code  will  refrain from drawing a highlight if the
        magic-   cookie  unattributed  spaces  required  just  before  the
@@ -169,55 +356,55 @@
 
    cdk
           Curses Development Kit
-          [6]http://invisible-island.net/cdk/
-          [7]http://www.vexus.ca/products/CDK/
+          [4]http://invisible-island.net/cdk/
+          [5]http://www.vexus.ca/products/CDK/
 
    ded
           directory-editor
-          [8]http://invisible-island.net/ded/
+          [6]http://invisible-island.net/ded/
 
    dialog
           the  underlying  application used in Slackware's setup, and the
           basis for similar applications on GNU/Linux.
-          [9]http://invisible-island.net/dialog/
+          [7]http://invisible-island.net/dialog/
 
    lynx
           the character-screen WWW browser
-          [10]http://lynx.isc.org/release/
+          [8]http://lynx.isc.org/release/
 
    Midnight Commander
           file manager
-          [11]http://www.midnight-commander.org/
+          [9]http://www.ibiblio.org/mc/
 
    mutt
           mail utility
-          [12]http://www.mutt.org/
+          [10]http://www.mutt.org/
 
    ncftp
           file-transfer utility
-          [13]http://www.ncftp.com/
+          [11]http://www.ncftp.com/
 
    nvi
           New vi versions 1.50 are able to use ncurses versions 1.9.7 and
           later.
-          [14]https://sites.google.com/a/bostic.com/keithbostic/nvi
+          [12]http://www.bostic.com/vi/
 
    pinfo
           Lynx-like info browser.
-          [15]https://alioth.debian.org/projects/pinfo/
+          [13]https://alioth.debian.org/projects/pinfo/
 
    tin
-          newsreader, supporting color, MIME [16]http://www.tin.org/
+          newsreader, supporting color, MIME [14]http://www.tin.org/
 
    as well as some that use ncurses for the terminfo support alone:
 
    minicom
           terminal emulator
-          [17]http://alioth.debian.org/projects/minicom/
+          [15]http://alioth.debian.org/projects/minicom/
 
    vile
           vi-like-emacs
-          [18]http://invisible-island.net/vile/
+          [16]http://invisible-island.net/vile/
 
    The  ncurses  distribution  includes  a  selection  of  test  programs
    (including a few games).
@@ -225,11 +412,11 @@
 Who's Who and What's What
 
    Zeyd  Ben-Halim started it from a previous package pcurses, written by
-   Pavel  Curtis.  Eric S. Raymond continued development. Juergen Pfeifer
+   Pavel  Curtis.  Eric  S. Raymond continued development. Jürgen Pfeifer
    wrote  most of the form and menu libraries. Ongoing work is being done
-   by  [19]Thomas  Dickey.  Thomas  Dickey acts as the maintainer for the
+   by  [17]Thomas  Dickey.  Thomas  Dickey acts as the maintainer for the
    Free  Software  Foundation,  which  holds  the  copyright  on ncurses.
-   Contact the current maintainers at [20]bug-ncurses@gnu.org.
+   Contact the current maintainers at [18]bug-ncurses@gnu.org.
 
    To   join   the   ncurses   mailing   list,   please  write  email  to
    bug-ncurses-request@gnu.org containing the line:
@@ -239,7 +426,7 @@ Who's Who and What's What
    and testing of this package.
 
    Beta  versions  of ncurses and patches to the current release are made
-   available at [21]ftp://invisible-island.net/ncurses/ .
+   available at [19]ftp://invisible-island.net/ncurses/ .
 
 Future Plans
 
@@ -253,36 +440,34 @@ Future Plans
 Other Related Resources
 
    The  distribution  provides  a  newer  version  of the terminfo-format
-   terminal description file once maintained by [22]Eric Raymond . Unlike
+   terminal description file once maintained by [20]Eric Raymond . Unlike
    the  older  version, the termcap and terminfo data are provided in the
    same  file,  and provides several user-definable extensions beyond the
    X/Open specification.
 
    You  can  find  lots  of  information  on  terminal-related topics not
-   covered in the terminfo file at [23]Richard Shuford's archive .
+   covered in the terminfo file at [21]Richard Shuford's archive .
 
 References
 
    1. ftp://ftp.gnu.org/gnu/ncurses/
    2. ftp://invisible-island.net/ncurses/
-   3. http://invisible-island.net/ncurses/man/form_fieldtype.3x
-   4. http://invisible-island.net/ncurses/ncurses-Ada95.html
-   5. http://invisible-island.net/ncurses/ncurses-examples.html
-   6. http://invisible-island.net/cdk/
-   7. http://www.vexus.ca/products/CDK/
-   8. http://invisible-island.net/ded/
-   9. http://invisible-island.net/dialog/
-  10. http://lynx.isc.org/release/
-  11. http://www.midnight-commander.org/
-  12. http://www.mutt.org/
-  13. http://www.ncftp.com/
-  14. https://sites.google.com/a/bostic.com/keithbostic/nvi
-  15. https://alioth.debian.org/projects/pinfo/
-  16. http://www.tin.org/
-  17. http://alioth.debian.org/projects/minicom/
-  18. http://invisible-island.net/vile/
-  19. mailto:dickey@invisible-island.net
-  20. mailto:bug-ncurses@gnu.org
-  21. ftp://invisible-island.net/ncurses/
-  22. http://www.catb.org/~esr/terminfo/
-  23. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal
+   3. http://invisible-island.net/xterm/xterm.log.html#xterm_230
+   4. http://invisible-island.net/cdk/
+   5. http://www.vexus.ca/products/CDK/
+   6. http://invisible-island.net/ded/
+   7. http://invisible-island.net/dialog/
+   8. http://lynx.isc.org/release/
+   9. http://www.ibiblio.org/mc/
+  10. http://www.mutt.org/
+  11. http://www.ncftp.com/
+  12. http://www.bostic.com/vi/
+  13. https://alioth.debian.org/projects/pinfo/
+  14. http://www.tin.org/
+  15. http://alioth.debian.org/projects/minicom/
+  16. http://invisible-island.net/vile/
+  17. mailto:dickey@invisible-island.net
+  18. mailto:bug-ncurses@gnu.org
+  19. ftp://invisible-island.net/ncurses/
+  20. http://www.catb.org/~esr/terminfo/
+  21. http://www.cs.utk.edu/~shuford/terminal_index.html
diff --git a/Ada95/Makefile.in b/Ada95/Makefile.in
deleted file mode 100644
index f8207933021..00000000000
--- a/Ada95/Makefile.in
+++ /dev/null
@@ -1,81 +0,0 @@
-# $Id: Makefile.in,v 1.21 2010/11/27 21:45:27 tom Exp $
-##############################################################################
-# Copyright (c) 1998-2003,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"), #
-# 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:  Juergen Pfeifer, 1996
-#
-#  Version Control
-#  $Revision: 1.21 $
-#
-SHELL		= /bin/sh
-VPATH		= @srcdir@
-THIS		= Makefile
-
-SUBDIRS         = @ADA_SUBDIRS@
-
-CF_MFLAGS 	= @cf_cv_makeflags@
-@SET_MAKE@
-
-all \
-libs \
-sources \
-install \
-install.libs \
-uninstall \
-uninstall.libs ::
-	for d in $(SUBDIRS); do \
-		(cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\
-	done
-
-clean \
-mostlyclean ::
-	for d in $(SUBDIRS); do \
-		(cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\
-	done
-
-distclean \
-realclean ::
-	for d in $(SUBDIRS); do \
-		(cd $$d ; $(MAKE) $(CF_MFLAGS) $@) ;\
-	done
-	rm -rf lib
-	for lib_kind in static dynamic; do \
-		rm -rf $${lib_kind}-ali; \
-		rm -rf $${lib_kind}-obj; \
-	done
-	-rm -f config.cache config.log config.status include/ncurses_cfg.h
-	-rm -f Makefile
-
-tags :
-	@
-
-preinstall :
-	@
-
-install.data :
-	@
diff --git a/Ada95/README b/Ada95/README
deleted file mode 100644
index be8425969de..00000000000
--- a/Ada95/README
+++ /dev/null
@@ -1,33 +0,0 @@
--------------------------------------------------------------------------------
--- Copyright (c) 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             --
--- "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:  Juergen Pfeifer, 1996
-
-The documentation is provided in HTML format in the ./html 
-subdirectory. The main document is named index.html
-
diff --git a/Ada95/TODO b/Ada95/TODO
deleted file mode 100644
index f5c8acde4c4..00000000000
--- a/Ada95/TODO
+++ /dev/null
@@ -1,55 +0,0 @@
--------------------------------------------------------------------------------
--- Copyright (c) 1998-1999,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"), 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: TODO,v 1.5 2006/04/22 22:23:21 tom Exp $
--------------------------------------------------------------------------------
-
---  Intensive testing
-    Perhaps the delivery of the Beta will help a bit.
-
---  Documentation
-    Like most WEB pages: under continuous construction
-
---  Style cleanup
-    	
---  Alternate functions for procedures with out params
-    Comfort purpose
-
---  Sample program
-    Under continuous construction (and it's not a WEB page!!!)
-
---  Make the binding objects a shared library
-    They are rather large, so it would make sense, otherwise Ada95
-    would look too large, although the generated code is as compact
-    as C or C++. I'll wait a bit until the GNAT people provide some
-    better support to construct shared libraries.
-
---  Think about more inlining
-
---  Check for memory leaks.
-    Oh I would like it so much if the GNAT guys would put an optional
-    GC into their system.
diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4
deleted file mode 100644
index 597483b7b6b..00000000000
--- a/Ada95/aclocal.m4
+++ /dev/null
@@ -1,3579 +0,0 @@
-dnl***************************************************************************
-dnl Copyright (c) 2010,2011 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            *
-dnl "Software"), to deal in the Software without restriction, including      *
-dnl without limitation the rights to use, copy, modify, merge, publish,      *
-dnl distribute, distribute with modifications, sublicense, and/or sell       *
-dnl copies of the Software, and to permit persons to whom the Software is    *
-dnl furnished to do so, subject to the following conditions:                 *
-dnl                                                                          *
-dnl The above copyright notice and this permission notice shall be included  *
-dnl in all copies or substantial portions of the Software.                   *
-dnl                                                                          *
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
-dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
-dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
-dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
-dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
-dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
-dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
-dnl                                                                          *
-dnl Except as contained in this notice, the name(s) of the above copyright   *
-dnl holders shall not be used in advertising or otherwise to promote the     *
-dnl sale, use or other dealings in this Software without prior written       *
-dnl authorization.                                                           *
-dnl***************************************************************************
-dnl
-dnl Author: Thomas E. Dickey
-dnl
-dnl $Id: aclocal.m4,v 1.24 2011/03/31 23:32:36 tom Exp $
-dnl Macros used in NCURSES Ada95 auto-configuration script.
-dnl
-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
-dnl ---------------------------------------------------------------------------
-dnl ---------------------------------------------------------------------------
-dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07
-dnl -------------------
-dnl Construct the list of include-options for the C programs in the Ada95
-dnl binding.
-AC_DEFUN([CF_ADA_INCLUDE_DIRS],
-[
-ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
-if test "$srcdir" != "."; then
-	ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
-fi
-if test "$GCC" != yes; then
-	ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
-elif test "$includedir" != "/usr/include"; then
-	if test "$includedir" = '${prefix}/include' ; then
-		if test $prefix != /usr ; then
-			ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
-		fi
-	else
-		ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
-	fi
-fi
-AC_SUBST(ACPPFLAGS)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18
-dnl ---------------
-dnl Add to $ADAFLAGS, which is substituted into makefile and scripts.
-AC_DEFUN([CF_ADD_ADAFLAGS],[
- 	ADAFLAGS="$ADAFLAGS $1"
-	AC_SUBST(ADAFLAGS)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
-dnl -------------
-dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
-dnl The second parameter if given makes this macro verbose.
-dnl
-dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
-dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
-dnl confused by the quotes (which require backslashes to keep them usable).
-AC_DEFUN([CF_ADD_CFLAGS],
-[
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-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
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-	ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
-	CFLAGS="$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"
-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"
-fi
-
-AC_SUBST(EXTRA_CPPFLAGS)
-
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57
-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,
-dnl but old versions (and some misinstalled ones) need that.  To make things
-dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
-dnl the include-path).
-AC_DEFUN([CF_ADD_INCDIR],
-[
-if test -n "$1" ; then
-  for cf_add_incdir in $1
-  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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  AC_TRY_COMPILE([#include ],
-				  [printf("Hello")],
-				  [],
-				  [cf_have_incdir=yes])
-			  CPPFLAGS=$cf_save_CPPFLAGS
-			fi
-		  fi
-		fi
-
-		if test "$cf_have_incdir" = no ; then
-		  CF_VERBOSE(adding $cf_add_incdir to include-path)
-		  ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -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
-	  fi
-	done
-  done
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
-dnl ----------
-dnl Add a library, used to enforce consistency.
-dnl
-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 -------------
-dnl	Adds to the library-path
-dnl
-dnl	Some machines have trouble with multiple -L options.
-dnl
-dnl $1 is the (list of) directory(s) to add
-dnl $2 is the optional name of the variable to update (default LDFLAGS)
-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
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
-dnl -----------
-dnl Add one or more libraries, used to enforce consistency.
-dnl
-dnl $1 = libraries to add, with the "-l", etc.
-dnl $2 = variable to update (default $LIBS)
-AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
-dnl ------------------
-dnl Append to a search-list for a nonstandard header/lib-file
-dnl	$1 = the variable to return as result
-dnl	$2 = the package name
-dnl	$3 = the subdirectory, e.g., bin, include or lib
-dnl $4 = the directory under which we will test for subdirectories
-dnl $5 = a directory that we do not want $4 to match
-AC_DEFUN([CF_ADD_SUBDIR_PATH],
-[
-test "$4" != "$5" && \
-test -d "$4" && \
-ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
-	test -n "$verbose" && echo "	... testing for $3-directories under $4"
-	test -d $4/$3 &&          $1="[$]$1 $4/$3"
-	test -d $4/$3/$2 &&       $1="[$]$1 $4/$3/$2"
-	test -d $4/$3/$2/$3 &&    $1="[$]$1 $4/$3/$2/$3"
-	test -d $4/$2/$3 &&       $1="[$]$1 $4/$2/$3"
-	test -d $4/$2/$3/$2 &&    $1="[$]$1 $4/$2/$3/$2"
-}
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32
-dnl ----------------
-dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
-dnl in the sharutils 4.2 distribution.
-AC_DEFUN([CF_ANSI_CC_CHECK],
-[
-AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
-cf_cv_ansi_cc=no
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX			-Aa -D_HPUX_SOURCE
-# SVR4			-Xc
-# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
-for cf_arg in "-DCC_HAS_PROTOS" \
-	"" \
-	-qlanglvl=ansi \
-	-std1 \
-	-Ae \
-	"-Aa -D_HPUX_SOURCE" \
-	-Xc
-do
-	CF_ADD_CFLAGS($cf_arg)
-	AC_TRY_COMPILE(
-[
-#ifndef CC_HAS_PROTOS
-#if !defined(__STDC__) || (__STDC__ != 1)
-choke me
-#endif
-#endif
-],[
-	int test (int i, double x);
-	struct s1 {int (*f) (int a);};
-	struct s2 {int (*f) (double a);};],
-	[cf_cv_ansi_cc="$cf_arg"; break])
-done
-CFLAGS="$cf_save_CFLAGS"
-CPPFLAGS="$cf_save_CPPFLAGS"
-])
-
-if test "$cf_cv_ansi_cc" != "no"; then
-if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
-	CF_ADD_CFLAGS($cf_cv_ansi_cc)
-else
-	AC_DEFINE(CC_HAS_PROTOS)
-fi
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
-dnl ---------------
-dnl For programs that must use an ANSI compiler, obtain compiler options that
-dnl will make it recognize prototypes.  We'll do preprocessor checks in other
-dnl macros, since tools such as unproto can fake prototypes, but only part of
-dnl the preprocessor.
-AC_DEFUN([CF_ANSI_CC_REQD],
-[AC_REQUIRE([CF_ANSI_CC_CHECK])
-if test "$cf_cv_ansi_cc" = "no"; then
-	AC_MSG_ERROR(
-[Your compiler does not appear to recognize prototypes.
-You have the following choices:
-	a. adjust your compiler options
-	b. get an up-to-date compiler
-	c. use a wrapper such as unproto])
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29
-dnl -----------
-dnl Check for suitable "ar" (archiver) options for updating an archive.
-AC_DEFUN([CF_AR_FLAGS],[
-AC_REQUIRE([CF_PROG_AR])
-
-AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
-	cf_cv_ar_flags=unknown
-	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
-	do
-
-		# check if $ARFLAGS already contains this choice
-		if test "x$ARFLAGS" != "x" ; then
-			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
-			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
-				cf_cv_ar_flags=
-				break
-			fi
-		fi
-
-		rm -f conftest.$ac_cv_objext
-		rm -f conftest.a
-
-		cat >conftest.$ac_ext <&AC_FD_CC
-			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null
-			if test -f conftest.a ; then
-				cf_cv_ar_flags=$cf_ar_flags
-				break
-			fi
-		else
-			CF_VERBOSE(cannot compile test-program)
-			break
-		fi
-	done
-	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
-])
-
-if test -n "$ARFLAGS" ; then
-	if test -n "$cf_cv_ar_flags" ; then
-		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
-	fi
-else
-	ARFLAGS=$cf_cv_ar_flags
-fi
-
-AC_SUBST(ARFLAGS)
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_BUILD_CC version: 6 updated: 2006/10/14 15:23:15
-dnl -----------
-dnl If we're cross-compiling, allow the user to override the tools and their
-dnl options.  The configure script is oriented toward identifying the host
-dnl compiler, etc., but we need a build compiler to generate parts of the
-dnl source.
-dnl
-dnl $1 = default for $CPPFLAGS
-dnl $2 = default for $LIBS
-AC_DEFUN([CF_BUILD_CC],[
-AC_REQUIRE([CF_PROG_EXT])
-if test "$cross_compiling" = yes ; then
-
-	# defaults that we might want to override
-	: ${BUILD_CFLAGS:=''}
-	: ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'}
-	: ${BUILD_LDFLAGS:=''}
-	: ${BUILD_LIBS:='ifelse([$2],,,[$2])'}
-	: ${BUILD_EXEEXT:='$x'}
-	: ${BUILD_OBJEXT:='o'}
-
-	AC_ARG_WITH(build-cc,
-		[  --with-build-cc=XXX     the build C compiler ($BUILD_CC)],
-		[BUILD_CC="$withval"],
-		[AC_CHECK_PROGS(BUILD_CC, gcc cc cl)])
-	AC_MSG_CHECKING(for native build C compiler)
-	AC_MSG_RESULT($BUILD_CC)
-
-	AC_MSG_CHECKING(for native build C preprocessor)
-	AC_ARG_WITH(build-cpp,
-		[  --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)],
-		[BUILD_CPP="$withval"],
-		[BUILD_CPP='${BUILD_CC} -E'])
-	AC_MSG_RESULT($BUILD_CPP)
-
-	AC_MSG_CHECKING(for native build C flags)
-	AC_ARG_WITH(build-cflags,
-		[  --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)],
-		[BUILD_CFLAGS="$withval"])
-	AC_MSG_RESULT($BUILD_CFLAGS)
-
-	AC_MSG_CHECKING(for native build C preprocessor-flags)
-	AC_ARG_WITH(build-cppflags,
-		[  --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)],
-		[BUILD_CPPFLAGS="$withval"])
-	AC_MSG_RESULT($BUILD_CPPFLAGS)
-
-	AC_MSG_CHECKING(for native build linker-flags)
-	AC_ARG_WITH(build-ldflags,
-		[  --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)],
-		[BUILD_LDFLAGS="$withval"])
-	AC_MSG_RESULT($BUILD_LDFLAGS)
-
-	AC_MSG_CHECKING(for native build linker-libraries)
-	AC_ARG_WITH(build-libs,
-		[  --with-build-libs=XXX   the build libraries (${BUILD_LIBS})],
-		[BUILD_LIBS="$withval"])
-	AC_MSG_RESULT($BUILD_LIBS)
-
-	# this assumes we're on Unix.
-	BUILD_EXEEXT=
-	BUILD_OBJEXT=o
-
-	: ${BUILD_CC:='${CC}'}
-
-	if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
-		AC_MSG_ERROR([Cross-build requires two compilers.
-Use --with-build-cc to specify the native compiler.])
-	fi
-
-else
-	: ${BUILD_CC:='${CC}'}
-	: ${BUILD_CPP:='${CPP}'}
-	: ${BUILD_CFLAGS:='${CFLAGS}'}
-	: ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
-	: ${BUILD_LDFLAGS:='${LDFLAGS}'}
-	: ${BUILD_LIBS:='${LIBS}'}
-	: ${BUILD_EXEEXT:='$x'}
-	: ${BUILD_OBJEXT:='o'}
-fi
-
-AC_SUBST(BUILD_CC)
-AC_SUBST(BUILD_CPP)
-AC_SUBST(BUILD_CFLAGS)
-AC_SUBST(BUILD_CPPFLAGS)
-AC_SUBST(BUILD_LDFLAGS)
-AC_SUBST(BUILD_LIBS)
-AC_SUBST(BUILD_EXEEXT)
-AC_SUBST(BUILD_OBJEXT)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_CFG_DEFAULTS version: 7 updated: 2005/09/24 16:15:00
-dnl ---------------
-dnl Determine the default configuration into which we'll install ncurses.  This
-dnl can be overridden by the user's command-line options.  There's two items to
-dnl look for:
-dnl	1. the prefix (e.g., /usr)
-dnl	2. the header files (e.g., /usr/include/ncurses)
-dnl We'll look for a previous installation of ncurses and use the same defaults.
-dnl
-dnl We don't use AC_PREFIX_DEFAULT, because it gets evaluated too soon, and
-dnl we don't use AC_PREFIX_PROGRAM, because we cannot distinguish ncurses's
-dnl programs from a vendor's.
-AC_DEFUN([CF_CFG_DEFAULTS],
-[
-AC_MSG_CHECKING(for prefix)
-if test "x$prefix" = "xNONE" ; then
-	case "$cf_cv_system_name" in
-		# non-vendor systems don't have a conflict
-	openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
-		prefix=/usr
-		;;
-	*)	prefix=$ac_default_prefix
-		;;
-	esac
-fi
-AC_MSG_RESULT($prefix)
-
-if test "x$prefix" = "xNONE" ; then
-AC_MSG_CHECKING(for default include-directory)
-test -n "$verbose" && echo 1>&AC_FD_MSG
-for cf_symbol in \
-	$includedir \
-	$includedir/ncurses \
-	$prefix/include \
-	$prefix/include/ncurses \
-	/usr/local/include \
-	/usr/local/include/ncurses \
-	/usr/include \
-	/usr/include/ncurses
-do
-	cf_dir=`eval echo $cf_symbol`
-	if test -f $cf_dir/curses.h ; then
-	if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
-		includedir="$cf_symbol"
-		test -n "$verbose"  && echo $ac_n "	found " 1>&AC_FD_MSG
-		break
-	fi
-	fi
-	test -n "$verbose"  && echo "	tested $cf_dir" 1>&AC_FD_MSG
-done
-AC_MSG_RESULT($includedir)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
-dnl --------------
-dnl Check if we're accidentally using a cache from a different machine.
-dnl Derive the system name, as a check for reusing the autoconf cache.
-dnl
-dnl If we've packaged config.guess and config.sub, run that (since it does a
-dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but allow
-dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
-dnl which is useful in cross-compiles.
-dnl
-dnl Note: we would use $ac_config_sub, but that is one of the places where
-dnl autoconf 2.5x broke compatibility with autoconf 2.13
-AC_DEFUN([CF_CHECK_CACHE],
-[
-if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
-	ifelse([$1],,[AC_CANONICAL_HOST],[$1])
-	system_name="$host_os"
-else
-	system_name="`(uname -s -r) 2>/dev/null`"
-	if test -z "$system_name" ; then
-		system_name="`(hostname) 2>/dev/null`"
-	fi
-fi
-test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
-AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
-
-test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
-
-if test ".$system_name" != ".$cf_cv_system_name" ; then
-	AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
-	AC_MSG_ERROR("Please remove config.cache and try again.")
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16
-dnl ----------------
-dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
-dnl variations of ncurses' installs.
-dnl
-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/curses.h \
-	$1/ncurses.h]) \
-	curses.h \
-	ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h])
-do
-AC_TRY_COMPILE([#include <${cf_header}>],
-	[initscr(); tgoto("?", 0,0)],
-	[cf_cv_ncurses_header=$cf_header; break],[])
-done
-])
-
-if test "$cf_cv_ncurses_header" = none ; then
-	AC_MSG_ERROR(No curses header-files found)
-fi
-
-# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
-AC_CHECK_HEADERS($cf_cv_ncurses_header)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
-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_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54
-dnl ---------------
-dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
-dnl prefer a standard location, and use -L options only if we do not find the
-dnl library in the standard library location(s).
-dnl	$1 = library name
-dnl	$2 = library class, usually the same as library name
-dnl	$3 = includes
-dnl	$4 = code fragment to compile/link
-dnl	$5 = corresponding function-name
-dnl	$6 = flag, nonnull if failure should not cause an error-exit
-dnl
-dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
-dnl to use a -L option.
-AC_DEFUN([CF_FIND_LIBRARY],
-[
-	eval 'cf_cv_have_lib_'$1'=no'
-	cf_libdir=""
-	AC_CHECK_FUNC($5,
-		eval 'cf_cv_have_lib_'$1'=yes',[
-		cf_save_LIBS="$LIBS"
-		AC_MSG_CHECKING(for $5 in -l$1)
-		LIBS="-l$1 $LIBS"
-		AC_TRY_LINK([$3],[$4],
-			[AC_MSG_RESULT(yes)
-			 eval 'cf_cv_have_lib_'$1'=yes'
-			],
-			[AC_MSG_RESULT(no)
-			CF_LIBRARY_PATH(cf_search,$2)
-			for cf_libdir in $cf_search
-			do
-				AC_MSG_CHECKING(for -l$1 in $cf_libdir)
-				LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
-				AC_TRY_LINK([$3],[$4],
-					[AC_MSG_RESULT(yes)
-			 		 eval 'cf_cv_have_lib_'$1'=yes'
-					 break],
-					[AC_MSG_RESULT(no)
-					 LIBS="$cf_save_LIBS"])
-			done
-			])
-		])
-eval 'cf_found_library=[$]cf_cv_have_lib_'$1
-ifelse($6,,[
-if test $cf_found_library = no ; then
-	AC_MSG_ERROR(Cannot link $1 library)
-fi
-])
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02
-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.
-dnl See also CF_ADD_SEARCHPATH.
-dnl
-dnl Parameters (4-on are optional):
-dnl     $1 = headers for library entrypoint
-dnl     $2 = code fragment for library entrypoint
-dnl     $3 = the library name without the "-l" option or ".so" suffix.
-dnl     $4 = action to perform if successful (default: update CPPFLAGS, etc)
-dnl     $5 = action to perform if not successful
-dnl     $6 = module name, if not the same as the library name
-dnl     $7 = extra libraries
-dnl
-dnl Sets these variables:
-dnl     $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
-dnl     $cf_cv_header_path_$3 - include-directory if needed
-dnl     $cf_cv_library_path_$3 - library-directory if needed
-dnl     $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
-AC_DEFUN([CF_FIND_LINKAGE],[
-
-# 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_$3=
-cf_cv_library_path_$3=
-
-CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
-
-cf_save_LIBS="$LIBS"
-
-AC_TRY_LINK([$1],[$2],[
-	cf_cv_find_linkage_$3=yes
-	cf_cv_header_path_$3=/usr/include
-	cf_cv_library_path_$3=/usr/lib
-],[
-
-LIBS="-l$3 $7 $cf_save_LIBS"
-
-AC_TRY_LINK([$1],[$2],[
-	cf_cv_find_linkage_$3=yes
-	cf_cv_header_path_$3=/usr/include
-	cf_cv_library_path_$3=/usr/lib
-	cf_cv_library_file_$3="-l$3"
-],[
-	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)
-])
-
-LIBS="$cf_save_LIBS"
-
-if test "$cf_cv_find_linkage_$3" = yes ; then
-ifelse([$4],,[
-	CF_ADD_INCDIR($cf_cv_header_path_$3)
-	CF_ADD_LIBDIR($cf_cv_library_path_$3)
-	CF_ADD_LIB($3)
-],[$4])
-else
-ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
-dnl -----------------
-dnl Test for availability of useful gcc __attribute__ directives to quiet
-dnl compiler warnings.  Though useful, not all are supported -- and contrary
-dnl to documentation, unrecognized directives cause older compilers to barf.
-AC_DEFUN([CF_GCC_ATTRIBUTES],
-[
-if test "$GCC" = yes
-then
-cat > conftest.i < conftest.$ac_ext <&AC_FD_CC
-
-		case $cf_attribute in #(vi
-		printf) #(vi
-			cf_printf_attribute=yes
-			cat >conftest.h <conftest.h <conftest.h <>confdefs.h
-			case $cf_attribute in #(vi
-			printf) #(vi
-				if test "$cf_printf_attribute" = no ; then
-					cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h
-fi
-rm -rf conftest*
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
-dnl --------------
-dnl Find version of gcc
-AC_DEFUN([CF_GCC_VERSION],[
-AC_REQUIRE([AC_PROG_CC])
-GCC_VERSION=none
-if test "$GCC" = yes ; then
-	AC_MSG_CHECKING(version of $CC)
-	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
-	test -z "$GCC_VERSION" && GCC_VERSION=unknown
-	AC_MSG_RESULT($GCC_VERSION)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
-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	-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
-dnl		is enabled for ncurses using "--enable-const".
-dnl	-pedantic
-dnl
-dnl Parameter:
-dnl	$1 is an optional list of gcc warning flags that a particular
-dnl		application might want to use, e.g., "no-unused" for
-dnl		-Wno-unused
-dnl Special:
-dnl	If $with_ext_const is "yes", add a check for -Wwrite-strings
-dnl
-AC_DEFUN([CF_GCC_WARNINGS],
-[
-AC_REQUIRE([CF_GCC_VERSION])
-CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
-
-cat > conftest.$ac_ext <>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then
-			cf_gnat_projects=yes
-		fi
-		cd ..
-		if test -f conftest.lib/confpackage.ali
-		then
-			cf_gnat_libraries=yes
-		fi
-		rm -rf conftest* *~conftest*
-		;;
-	esac
-	;;
-esac
-AC_MSG_RESULT($cf_gnat_projects)
-
-if test $cf_gnat_projects = yes
-then
-	AC_MSG_CHECKING(if GNAT supports libraries)
-	AC_MSG_RESULT($cf_gnat_libraries)
-fi
-
-if test "$cf_gnat_projects" = yes
-then
-	USE_OLD_MAKERULES="#"
-	USE_GNAT_PROJECTS=""
-else
-	USE_OLD_MAKERULES=""
-	USE_GNAT_PROJECTS="#"
-fi
-
-if test "$cf_gnat_libraries" = yes
-then
-	USE_GNAT_LIBRARIES=""
-else
-	USE_GNAT_LIBRARIES="#"
-fi
-
-AC_SUBST(USE_OLD_MAKERULES)
-AC_SUBST(USE_GNAT_PROJECTS)
-AC_SUBST(USE_GNAT_LIBRARIES)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45
-dnl ----------------
-dnl Verify that a test program compiles/links with GNAT.
-dnl $cf_ada_make is set to the program that compiles/links
-dnl $ADAFLAGS may be set to the GNAT flags.
-dnl
-dnl $1 is the text of the spec
-dnl $2 is the text of the body
-dnl $3 is the shell command to execute if successful
-dnl $4 is the shell command to execute if not successful
-AC_DEFUN([CF_GNAT_TRY_LINK],
-[
-rm -rf conftest* *~conftest*
-cat >>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then
-ifelse($3,,      :,[      $3])
-ifelse($4,,,[else
-   $4])
-fi
-rm -rf conftest* *~conftest*
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_TRY_RUN version: 5 updated: 2011/03/19 14:47:45
-dnl ---------------
-dnl Verify that a test program compiles and runs with GNAT
-dnl $cf_ada_make is set to the program that compiles/links
-dnl $ADAFLAGS may be set to the GNAT flags.
-dnl
-dnl $1 is the text of the spec
-dnl $2 is the text of the body
-dnl $3 is the shell command to execute if successful
-dnl $4 is the shell command to execute if not successful
-AC_DEFUN([CF_GNAT_TRY_RUN],
-[
-rm -rf conftest* *~conftest*
-cat >>conftest.ads <>conftest.adb <&AC_FD_CC 2>&1 ) ; then
-   if ( ./conftest 1>&AC_FD_CC 2>&1 ) ; then
-ifelse($3,,      :,[      $3])
-ifelse($4,,,[   else
-      $4])
-   fi
-ifelse($4,,,[else
-   $4])
-fi
-rm -rf conftest* *~conftest*
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_VERSION version: 17 updated: 2011/03/23 20:24:41
-dnl ---------------
-dnl Verify version of GNAT.
-AC_DEFUN([CF_GNAT_VERSION],
-[
-AC_MSG_CHECKING(for gnat version)
-cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
-	grep '[[0-9]].[[0-9]][[0-9]]*' |\
-    sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'`
-AC_MSG_RESULT($cf_gnat_version)
-
-case $cf_gnat_version in #(vi
-3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi
-	cf_cv_prog_gnat_correct=yes
-	;;
-*)
-	AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.)
-	cf_cv_prog_gnat_correct=no
-	;;
-esac
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
-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
-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...
-AC_DEFUN([CF_GNU_SOURCE],
-[
-AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
-AC_TRY_COMPILE([#include ],[
-#ifndef _XOPEN_SOURCE
-make an error
-#endif],
-	[cf_cv_gnu_source=no],
-	[cf_save="$CPPFLAGS"
-	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
-	 AC_TRY_COMPILE([#include ],[
-#ifdef _XOPEN_SOURCE
-make an error
-#endif],
-	[cf_cv_gnu_source=no],
-	[cf_cv_gnu_source=yes])
-	CPPFLAGS="$cf_save"
-	])
-])
-test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
-dnl --------------
-dnl Construct a search-list of directories for a nonstandard header-file
-dnl
-dnl Parameters
-dnl	$1 = the variable to return as result
-dnl	$2 = the package name
-AC_DEFUN([CF_HEADER_PATH],
-[
-$1=
-
-# 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$,,'`
-			CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
-			cf_header_path_list="$cf_header_path_list [$]$1"
-			;;
-		esac
-	done
-fi
-
-# add the variations for the package we are looking for
-CF_SUBDIR_PATH($1,$2,include)
-
-test "$includedir" != NONE && \
-test "$includedir" != "/usr/include" && \
-test -d "$includedir" && {
-	test -d $includedir &&    $1="[$]$1 $includedir"
-	test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
-}
-
-test "$oldincludedir" != NONE && \
-test "$oldincludedir" != "/usr/include" && \
-test -d "$oldincludedir" && {
-	test -d $oldincludedir    && $1="[$]$1 $oldincludedir"
-	test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
-}
-
-$1="[$]$1 $cf_header_path_list"
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
-dnl ---------------
-dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
-AC_DEFUN([CF_HELP_MESSAGE],
-[AC_DIVERT_HELP([$1])dnl
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40
-dnl ---------------
-dnl Construct the list of include-options according to whether we're building
-dnl in the source directory or using '--srcdir=DIR' option.  If we're building
-dnl with gcc, don't append the includedir if it happens to be /usr/include,
-dnl since that usually breaks gcc's shadow-includes.
-AC_DEFUN([CF_INCLUDE_DIRS],
-[
-CPPFLAGS="$CPPFLAGS -I. -I../include"
-if test "$srcdir" != "."; then
-	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
-fi
-if test "$GCC" != yes; then
-	CPPFLAGS="$CPPFLAGS -I\${includedir}"
-elif test "$includedir" != "/usr/include"; then
-	if test "$includedir" = '${prefix}/include' ; then
-		if test $prefix != /usr ; then
-			CPPFLAGS="$CPPFLAGS -I\${includedir}"
-		fi
-	else
-		CPPFLAGS="$CPPFLAGS -I\${includedir}"
-	fi
-fi
-AC_SUBST(CPPFLAGS)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
-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
-dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
-dnl
-dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
-dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked from
-dnl the wrappers for gcc and g++ warnings.
-dnl
-dnl $1 = GCC (default) or GXX
-dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
-dnl $3 = CFLAGS (default) or CXXFLAGS
-AC_DEFUN([CF_INTEL_COMPILER],[
-ifelse([$2],,INTEL_COMPILER,[$2])=no
-
-if test "$ifelse([$1],,[$1],GCC)" = yes ; then
-	case $host_os in
-	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"
-		AC_TRY_COMPILE([],[
-#ifdef __INTEL_COMPILER
-#else
-make an error
-#endif
-],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
-],[])
-		ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
-		AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
-		;;
-	esac
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50
-dnl ------------
-dnl Add checks for large file support.
-AC_DEFUN([CF_LARGEFILE],[
-ifdef([AC_FUNC_FSEEKO],[
-    AC_SYS_LARGEFILE
-    if test "$enable_largefile" != no ; then
-	AC_FUNC_FSEEKO
-
-	# Normally we would collect these definitions in the config.h,
-	# but (like _XOPEN_SOURCE), some environments rely on having these
-	# defined before any of the system headers are included.  Another
-	# case comes up with C++, e.g., on AIX the compiler compiles the
-	# header files by themselves before looking at the body files it is
-	# told to compile.  For ncurses, those header files do not include
-	# the config.h
-	test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
-	test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
-	test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
-
-	AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[
-		AC_TRY_COMPILE([
-#include 
-#include 
-		],[
-		/* if transitional largefile support is setup, this is true */
-		extern struct dirent64 * readdir(DIR *);
-		struct dirent64 *x = readdir((DIR *)0);
-		struct dirent *y = readdir((DIR *)0);
-		int z = x - y;
-		],
-		[cf_cv_struct_dirent64=yes],
-		[cf_cv_struct_dirent64=no])
-	])
-	test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64)
-    fi
-])
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05
-dnl ---------------
-dnl For the given system and compiler, find the compiler flags to pass to the
-dnl loader to use the "rpath" feature.
-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
-		LD_RPATH_OPT="-Wl,-rpath,"
-	else
-		LD_RPATH_OPT="-rpath "
-	fi
-	;;
-linux*|gnu*|k*bsd*-gnu) #(vi
-	LD_RPATH_OPT="-Wl,-rpath,"
-	;;
-openbsd[[2-9]].*) #(vi
-	LD_RPATH_OPT="-Wl,-rpath,"
-	;;
-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)
-
-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
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
-dnl ---------------
-dnl Construct a search-list of directories for a nonstandard library-file
-dnl
-dnl Parameters
-dnl	$1 = the variable to return as result
-dnl	$2 = the package name
-AC_DEFUN([CF_LIBRARY_PATH],
-[
-$1=
-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$,,'`
-			CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
-			cf_library_path_list="$cf_library_path_list [$]$1"
-			;;
-		esac
-	done
-fi
-
-CF_SUBDIR_PATH($1,$2,lib)
-
-$1="$cf_library_path_list [$]$1"
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16
-dnl -------------
-dnl Compute the library-prefix for the given host system
-dnl $1 = variable to set
-AC_DEFUN([CF_LIB_PREFIX],
-[
-	case $cf_cv_system_name in #(vi
-	OS/2*|os2*) #(vi
-        LIB_PREFIX=''
-        ;;
-	*)	LIB_PREFIX='lib'
-        ;;
-	esac
-ifelse($1,,,[$1=$LIB_PREFIX])
-	AC_SUBST(LIB_PREFIX)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SONAME version: 5 updated: 2010/08/14 18:25:37
-dnl -------------
-dnl Find the and soname for the given shared library.  Set the cache variable
-dnl cf_cv_$3_soname to this, unless it is not found.  Then set the cache
-dnl variable to "unknown".
-dnl
-dnl $1 = headers
-dnl $2 = code
-dnl $3 = library name
-AC_DEFUN([CF_LIB_SONAME],
-[
-AC_CACHE_CHECK(for soname of $3 library,cf_cv_$3_soname,[
-
-cf_cv_$3_soname=unknown
-if test "$cross_compiling" != yes ; then
-cat >conftest.$ac_ext </dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.`
-			test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown
-		fi
-	fi
-rm -rf conftest*
-LIBS="$cf_save_LIBS"
-fi
-])
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03
-dnl -------------
-dnl Compute the library file-suffix from the given model name
-dnl $1 = model name
-dnl $2 = variable to set (the nominal library suffix)
-dnl $3 = dependency variable to set (actual filename)
-dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
-AC_DEFUN([CF_LIB_SUFFIX],
-[
-	AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
-	case $1 in #(vi
-	libtool) #(vi
-		$2='.la'
-		$3=[$]$2
-		;;
-	normal) #(vi
-		$2='.a'
-		$3=[$]$2
-		;;
-	debug) #(vi
-		$2='_g.a'
-		$3=[$]$2
-		;;
-	profile) #(vi
-		$2='_p.a'
-		$3=[$]$2
-		;;
-	shared) #(vi
-		case $cf_cv_system_name in
-		aix[[56]]*) #(vi
-			$2='.a'
-			$3=[$]$2
-			;;
-		cygwin*) #(vi
-			$2='.dll'
-			$3='.dll.a'
-			;;
-		darwin*) #(vi
-			$2='.dylib'
-			$3=[$]$2
-			;;
-		hpux*) #(vi
-			case $target in
-			ia64*) #(vi
-				$2='.so'
-				$3=[$]$2
-				;;
-			*) #(vi
-				$2='.sl'
-				$3=[$]$2
-				;;
-			esac
-			;;
-		*)	$2='.so'
-			$3=[$]$2
-			;;
-		esac
-	esac
-	test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
-	test -n "$LIB_SUFFIX" && $3="${LIB_SUFFIX}[$]{$3}"
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LIB_TYPE version: 4 updated: 2000/10/20 22:57:49
-dnl -----------
-dnl Compute the string to append to -library from the given model name
-dnl $1 = model name
-dnl $2 = variable to set
-dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
-AC_DEFUN([CF_LIB_TYPE],
-[
-	case $1 in
-	libtool) $2=''   ;;
-	normal)  $2=''   ;;
-	debug)   $2='_g' ;;
-	profile) $2='_p' ;;
-	shared)  $2=''   ;;
-	esac
-	test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}"
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38
-dnl ----------------
-dnl Some systems have a non-ANSI linker that doesn't pull in modules that have
-dnl only data (i.e., no functions), for example NeXT.  On those systems we'll
-dnl have to provide wrappers for global tables to ensure they're linked
-dnl properly.
-AC_DEFUN([CF_LINK_DATAONLY],
-[
-AC_MSG_CHECKING([if data-only library module links])
-AC_CACHE_VAL(cf_cv_link_dataonly,[
-	rm -f conftest.a
-	cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null
-	fi
-	rm -f conftest.$ac_ext data.o
-	cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null
-	fi
-	rm -f conftest.$ac_ext func.o
-	( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null
-	cf_saveLIBS="$LIBS"
-	LIBS="conftest.a $LIBS"
-	AC_TRY_RUN([
-	int main()
-	{
-		extern int testfunc();
-		${cf_cv_main_return:-return} (!testfunc());
-	}
-	],
-	[cf_cv_link_dataonly=yes],
-	[cf_cv_link_dataonly=no],
-	[cf_cv_link_dataonly=unknown])
-	LIBS="$cf_saveLIBS"
-	])
-AC_MSG_RESULT($cf_cv_link_dataonly)
-
-if test "$cf_cv_link_dataonly" = no ; then
-	AC_DEFINE(BROKEN_LINKER)
-	BROKEN_LINKER=1
-fi
-
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_LINK_FUNCS version: 7 updated: 2006/12/16 12:33:30
-dnl -------------
-dnl Most Unix systems have both link and symlink, a few don't have symlink.
-dnl A few non-Unix systems implement symlink, but not link.
-dnl A few non-systems implement neither (or have nonfunctional versions).
-AC_DEFUN([CF_LINK_FUNCS],
-[
-AC_CHECK_FUNCS( \
-	remove \
-	unlink )
-
-if test "$cross_compiling" = yes ; then
-	AC_CHECK_FUNCS( \
-		link \
-		symlink )
-else
-	AC_CACHE_CHECK(if link/symlink functions work,cf_cv_link_funcs,[
-		cf_cv_link_funcs=
-		for cf_func in link symlink ; do
-			AC_TRY_RUN([
-#include 
-#include 
-#ifdef HAVE_UNISTD_H
-#include 
-#endif
-int main()
-{
-	int fail = 0;
-	char *src = "config.log";
-	char *dst = "conftest.chk";
-	struct stat src_sb;
-	struct stat dst_sb;
-
-	stat(src, &src_sb);
-	fail = ($cf_func("config.log", "conftest.chk") < 0)
-	    || (stat(dst, &dst_sb) < 0)
-	    || (dst_sb.st_mtime != src_sb.st_mtime);
-#ifdef HAVE_UNLINK
-	unlink(dst);
-#else
-	remove(dst);
-#endif
-	${cf_cv_main_return:-return} (fail);
-}
-			],[
-			cf_cv_link_funcs="$cf_cv_link_funcs $cf_func"
-			eval 'ac_cv_func_'$cf_func'=yes'],[
-			eval 'ac_cv_func_'$cf_func'=no'],[
-			eval 'ac_cv_func_'$cf_func'=error'])
-		done
-		test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no
-	])
-	test "$ac_cv_func_link"    = yes && AC_DEFINE(HAVE_LINK)
-	test "$ac_cv_func_symlink" = yes && AC_DEFINE(HAVE_SYMLINK)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MAIN_RETURN version: 1 updated: 2006/12/10 09:51:54
-dnl --------------
-dnl Check if a return from main to the shell actually returns the same exit
-dnl code.  This is true for almost any POSIX environment.
-dnl
-dnl Some very old environments did not flush stdout, etc., on an exit.  That
-dnl would be a useful case to test for also.
-AC_DEFUN([CF_MAIN_RETURN],
-[
-cf_cv_main_return=return
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MAKEFLAGS version: 14 updated: 2011/03/31 19:29:46
-dnl ------------
-dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
-dnl options to lower-levels.  It's very useful for "make -n" -- if we have it.
-dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
-dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
-AC_DEFUN([CF_MAKEFLAGS],
-[
-AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
-	cf_cv_makeflags=''
-	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
-	do
-		cat >cf_makeflags.tmp </dev/null | fgrep -v "ing directory" | sed -e 's,[[ 	]]*$,,'`
-		case "$cf_result" in
-		.*k)
-			cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
-			case "$cf_result" in
-			.*CC=*)	cf_cv_makeflags=
-				;;
-			*)	cf_cv_makeflags=$cf_option
-				;;
-			esac
-			break
-			;;
-		.-)	;;
-		*)	echo "given option \"$cf_option\", no match \"$cf_result\""
-			;;
-		esac
-	done
-	rm -f cf_makeflags.tmp
-])
-
-AC_SUBST(cf_cv_makeflags)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
-dnl ------------
-dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we have
-dnl a monocase filesystem.
-AC_DEFUN([CF_MAKE_TAGS],[
-AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
-
-AC_CHECK_PROGS(CTAGS, exctags ctags)
-AC_CHECK_PROGS(ETAGS, exetags etags)
-
-AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
-
-if test "$cf_cv_mixedcase" = yes ; then
-	AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
-else
-	MAKE_UPPER_TAGS=no
-fi
-
-if test "$MAKE_UPPER_TAGS" = yes ; then
-	MAKE_UPPER_TAGS=
-else
-	MAKE_UPPER_TAGS="#"
-fi
-
-if test "$MAKE_LOWER_TAGS" = yes ; then
-	MAKE_LOWER_TAGS=
-else
-	MAKE_LOWER_TAGS="#"
-fi
-
-AC_SUBST(CTAGS)
-AC_SUBST(ETAGS)
-
-AC_SUBST(MAKE_UPPER_TAGS)
-AC_SUBST(MAKE_LOWER_TAGS)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
-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.
-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*|*-mingw32*|*-uwin*) #(vi
-		cf_cv_mixedcase=no
-		;;
-	*)
-		cf_cv_mixedcase=yes
-		;;
-	esac
-else
-	rm -f conftest CONFTEST
-	echo test >conftest
-	if test -f CONFTEST ; then
-		cf_cv_mixedcase=no
-	else
-		cf_cv_mixedcase=yes
-	fi
-	rm -f conftest CONFTEST
-fi
-])
-test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37
-dnl ----------
-dnl Check for a working mkstemp.  This creates two files, checks that they are
-dnl successfully created and distinct (AmigaOS apparently fails on the last).
-AC_DEFUN([CF_MKSTEMP],[
-AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
-rm -rf conftest*
-AC_TRY_RUN([
-#include 
-#include 
-#include 
-#include 
-#include 
-int main()
-{
-	char *tmpl = "conftestXXXXXX";
-	char name[2][80];
-	int n;
-	int result = 0;
-	int fd;
-	struct stat sb;
-
-	umask(077);
-	for (n = 0; n < 2; ++n) {
-		strcpy(name[n], tmpl);
-		if ((fd = mkstemp(name[n])) >= 0) {
-			if (!strcmp(name[n], tmpl)
-			 || stat(name[n], &sb) != 0
-			 || (sb.st_mode & S_IFMT) != S_IFREG
-			 || (sb.st_mode & 077) != 0) {
-				result = 1;
-			}
-			close(fd);
-		}
-	}
-	if (result == 0
-	 && !strcmp(name[0], name[1]))
-		result = 1;
-	${cf_cv_main_return:-return}(result);
-}
-],[cf_cv_func_mkstemp=yes
-],[cf_cv_func_mkstemp=no
-],[AC_CHECK_FUNC(mkstemp)
-])
-])
-if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
-	AC_DEFINE(HAVE_MKSTEMP)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
-dnl ----------
-dnl Write a debug message to config.log, along with the line number in the
-dnl configure script.
-AC_DEFUN([CF_MSG_LOG],[
-echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_ADDON version: 4 updated: 2011/03/27 17:10:13
-dnl ----------------
-dnl Configure an ncurses add-on, built outside the ncurses tree.
-AC_DEFUN([CF_NCURSES_ADDON],[
-
-AC_PROVIDE([CF_SUBST_NCURSES_VERSION])
-
-AC_MSG_CHECKING(if you want wide-character code)
-AC_ARG_ENABLE(widec,
-	[  --enable-widec          compile with wide-char/UTF-8 code],
-	[with_widec=$enableval],
-	[with_widec=no])
-AC_MSG_RESULT($with_widec)
-if test "$with_widec" = yes ; then
-	CF_UTF8_LIB 
-	CF_NCURSES_CONFIG(ncursesw)
-else
-	CF_NCURSES_CONFIG(ncurses)
-fi
-
-if test "$NCURSES_CONFIG" != none ; then
-
-cf_version=`$NCURSES_CONFIG --version`
-
-NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'`
-NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.//' -e 's/\..*//'`
-NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.//'`
-
-# ABI version is not available from headers
-cf_cv_abi_version=`$NCURSES_CONFIG --abi-version`
-
-else
-
-for cf_name in MAJOR MINOR PATCH
-do
-cat >conftest.$ac_ext <
-AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
-CF_EOF
-	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
-	AC_TRY_EVAL(cf_try)
-	if test -f conftest.out ; then
-		cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ 	]][[ 	]]*//"`
-		eval NCURSES_$cf_name=\"$cf_result\"
-		# cat conftest.$ac_ext
-		# cat conftest.out
-	fi
-done
-
-cf_cv_abi_version=${NCURSES_MAJOR}
-
-fi
-
-cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
-
-dnl Show the computed version, for logging
-cf_cv_timestamp=`date`
-
-AC_MSG_RESULT(Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp))
-
-dnl We need these values in the generated headers
-AC_SUBST(NCURSES_MAJOR)
-AC_SUBST(NCURSES_MINOR)
-AC_SUBST(NCURSES_PATCH)
-
-dnl We need these values in the generated makefiles
-AC_SUBST(cf_cv_rel_version)
-AC_SUBST(cf_cv_abi_version)
-
-dnl FIXME - not needed for Ada95
-AC_SUBST(cf_cv_builtin_bool)
-AC_SUBST(cf_cv_header_stdbool_h)
-AC_SUBST(cf_cv_type_of_bool)dnl
-
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05
-dnl -------------------
-dnl Check if we can compile with ncurses' header file
-dnl $1 is the cache variable to set
-dnl $2 is the header-file to include
-dnl $3 is the root name (ncurses or ncursesw)
-AC_DEFUN([CF_NCURSES_CC_CHECK],[
-	AC_TRY_COMPILE([
-]ifelse($3,ncursesw,[
-#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 <$2>],[
-#ifdef NCURSES_VERSION
-]ifelse($3,ncursesw,[
-#ifndef WACS_BSSB
-	make an error
-#endif
-])[
-printf("%s\n", NCURSES_VERSION);
-#else
-#ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
-#endif
-#endif
-	]
-	,[$1=$2]
-	,[$1=no])
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30
-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
-dnl $1 is the root library name (default: "ncurses")
-AC_DEFUN([CF_NCURSES_CONFIG],
-[
-cf_ncuconfig_root=ifelse($1,,ncurses,$1)
-
-echo "Looking for ${cf_ncuconfig_root}-config"
-AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none)
-
-if test "$NCURSES_CONFIG" != none ; then
-
-CPPFLAGS="$CPPFLAGS `$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)
-
-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
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38
-dnl -------------------
-dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
-dnl the CPPFLAGS variable so we can include its header.
-dnl
-dnl The header files may be installed as either curses.h, or ncurses.h (would
-dnl be obsolete, except that some packagers prefer this name to distinguish it
-dnl from a "native" curses implementation).  If not installed for overwrite,
-dnl the curses.h file would be in an ncurses subdirectory (e.g.,
-dnl /usr/include/ncurses), but someone may have installed overwriting the
-dnl vendor's curses.  Only very old versions (pre-1.9.2d, the first autoconf'd
-dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
-dnl the header.
-dnl
-dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
-dnl is already in the include-path, don't even bother with this, since we cannot
-dnl easily determine which file it is.  In this case, it has to be .
-dnl
-dnl The optional parameter gives the root name of the library, in case it is
-dnl not installed as the default curses library.  That is how the
-dnl wide-character version of ncurses is installed.
-AC_DEFUN([CF_NCURSES_CPPFLAGS],
-[AC_REQUIRE([CF_WITH_CURSES_DIR])
-
-AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
-cf_ncuhdr_root=ifelse($1,,ncurses,$1)
-
-test -n "$cf_cv_curses_dir" && \
-test "$cf_cv_curses_dir" != "no" && { \
-  CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root)
-}
-
-AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
-	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
-	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
-	for cf_header in $cf_header_list
-	do
-		CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
-		test "$cf_cv_ncurses_h" != no && break
-	done
-])
-
-CF_NCURSES_HEADER
-CF_TERM_HEADER
-
-# some applications need this, but should check for NCURSES_VERSION
-AC_DEFINE(NCURSES)
-
-CF_NCURSES_VERSION
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
-dnl -----------------
-dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
-dnl variations of ncurses' installs.
-dnl
-dnl See also CF_CURSES_HEADER, which sets the same cache variable.
-AC_DEFUN([CF_NCURSES_HEADER],[
-
-if test "$cf_cv_ncurses_h" != no ; then
-	cf_cv_ncurses_header=$cf_cv_ncurses_h
-else
-
-AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
-	test -n "$verbose" && echo
-	CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
-	test -n "$verbose" && echo search path $cf_search
-	cf_save2_CPPFLAGS="$CPPFLAGS"
-	for cf_incdir in $cf_search
-	do
-		CF_ADD_INCDIR($cf_incdir)
-		for cf_header in \
-			ncurses.h \
-			curses.h
-		do
-			CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
-			if test "$cf_cv_ncurses_h2" != no ; then
-				cf_cv_ncurses_h2=$cf_incdir/$cf_header
-				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&AC_FD_MSG
-				break
-			fi
-			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
-		done
-		CPPFLAGS="$cf_save2_CPPFLAGS"
-		test "$cf_cv_ncurses_h2" != no && break
-	done
-	test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
-	])
-
-	CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
-	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
-	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
-		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
-	fi
-	CF_ADD_INCDIR($cf_1st_incdir)
-
-fi
-
-# Set definitions to allow ifdef'ing for ncurses.h
-
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
-	AC_DEFINE(HAVE_NCURSES_H)
-	;;
-esac
-
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
-	AC_DEFINE(HAVE_NCURSES_NCURSES_H)
-	;;
-ncursesw/curses.h|ncursesw/ncurses.h)
-	AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
-	;;
-esac
-
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38
-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.
-dnl Some distributions have gpm linked with (bsd) curses, which makes it
-dnl unusable with ncurses.  However, we don't want to link with gpm unless
-dnl ncurses has a dependency, since gpm is normally set up as a shared library,
-dnl and the linker will record a dependency.
-dnl
-dnl The optional parameter gives the root name of the library, in case it is
-dnl not installed as the default curses library.  That is how the
-dnl wide-character version of ncurses is installed.
-AC_DEFUN([CF_NCURSES_LIBS],
-[AC_REQUIRE([CF_NCURSES_CPPFLAGS])
-
-cf_nculib_root=ifelse($1,,ncurses,$1)
-	# 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"
-AC_CHECK_LIB(gpm,Gpm_Open,
-	[AC_CHECK_LIB(gpm,initscr,
-		[LIBS="$cf_ncurses_SAVE"],
-		[cf_ncurses_LIBS="-lgpm"])])
-
-case $host_os in #(vi
-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
-		AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
-	fi
-	;;
-esac
-
-CF_ADD_LIBS($cf_ncurses_LIBS)
-
-if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
-then
-	CF_ADD_LIBS(-l$cf_nculib_root)
-else
-	CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
-		[#include <${cf_cv_ncurses_header:-curses.h}>],
-		[initscr()],
-		initscr)
-fi
-
-if test -n "$cf_ncurses_LIBS" ; then
-	AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
-	cf_ncurses_SAVE="$LIBS"
-	for p in $cf_ncurses_LIBS ; do
-		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
-		if test "$q" != "$LIBS" ; then
-			LIBS="$q"
-		fi
-	done
-	AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
-		[initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
-		[AC_MSG_RESULT(yes)],
-		[AC_MSG_RESULT(no)
-		 LIBS="$cf_ncurses_SAVE"])
-fi
-
-CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
-AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49
-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
-dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
-AC_DEFUN([CF_NCURSES_VERSION],
-[
-AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
-AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
-	cf_cv_ncurses_version=no
-	cf_tempfile=out$$
-	rm -f $cf_tempfile
-	AC_TRY_RUN([
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include 
-int main()
-{
-	FILE *fp = fopen("$cf_tempfile", "w");
-#ifdef NCURSES_VERSION
-# ifdef NCURSES_VERSION_PATCH
-	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
-# else
-	fprintf(fp, "%s\n", NCURSES_VERSION);
-# endif
-#else
-# ifdef __NCURSES_H
-	fprintf(fp, "old\n");
-# else
-	make an error
-# endif
-#endif
-	${cf_cv_main_return:-return}(0);
-}],[
-	cf_cv_ncurses_version=`cat $cf_tempfile`],,[
-
-	# This will not work if the preprocessor splits the line after the
-	# Autoconf token.  The 'unproto' program does that.
-	cat > conftest.$ac_ext <
-#undef Autoconf
-#ifdef NCURSES_VERSION
-Autoconf NCURSES_VERSION
-#else
-#ifdef __NCURSES_H
-Autoconf "old"
-#endif
-;
-#endif
-EOF
-	cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
-	AC_TRY_EVAL(cf_try)
-	if test -f conftest.out ; then
-		cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'`
-		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
-		rm -f conftest.out
-	fi
-])
-	rm -f $cf_tempfile
-])
-test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
-dnl ------------------
-dnl see CF_WITH_NO_LEAKS
-AC_DEFUN([CF_NO_LEAKS_OPTION],[
-AC_MSG_CHECKING(if you want to use $1 for testing)
-AC_ARG_WITH($1,
-	[$2],
-	[AC_DEFINE($3)ifelse([$4],,[
-	 $4
-])
-	: ${with_cflags:=-g}
-	: ${with_no_leaks:=yes}
-	 with_$1=yes],
-	[with_$1=])
-AC_MSG_RESULT(${with_$1:-no})
-
-case .$with_cflags in #(vi
-.*-g*)
-	case .$CFLAGS in #(vi
-	.*-g*) #(vi
-		;;
-	*)
-		CF_ADD_CFLAGS([-g])
-		;;
-	esac
-	;;
-esac
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_NUMBER_SYNTAX version: 1 updated: 2003/09/20 18:12:49
-dnl ----------------
-dnl Check if the given variable is a number.  If not, report an error.
-dnl $1 is the variable
-dnl $2 is the message
-AC_DEFUN([CF_NUMBER_SYNTAX],[
-if test -n "$1" ; then
-  case $1 in #(vi
-  [[0-9]]*) #(vi
- 	;;
-  *)
-	AC_MSG_ERROR($2 is not a number: $1)
- 	;;
-  esac
-else
-  AC_MSG_ERROR($2 value is empty)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_OBJ_SUBDIR version: 4 updated: 2002/02/23 20:38:31
-dnl -------------
-dnl Compute the object-directory name from the given model name
-AC_DEFUN([CF_OBJ_SUBDIR],
-[
-	case $1 in
-	libtool) $2='obj_lo'  ;;
-	normal)  $2='objects' ;;
-	debug)   $2='obj_g' ;;
-	profile) $2='obj_p' ;;
-	shared)
-		case $cf_cv_system_name in #(vi
-		cygwin) #(vi
-			$2='objects' ;;
-		*)
-			$2='obj_s' ;;
-		esac
-	esac
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42
-dnl ----------
-dnl Provide a value for the $PATH and similar separator
-AC_DEFUN([CF_PATHSEP],
-[
-	case $cf_cv_system_name in
-	os2*)	PATH_SEPARATOR=';'  ;;
-	*)	PATH_SEPARATOR=':'  ;;
-	esac
-ifelse([$1],,,[$1=$PATH_SEPARATOR])
-	AC_SUBST(PATH_SEPARATOR)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
-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
-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"
-else
-  cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".[$]$1" in #(vi
-.\[$]\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
-  ;;
-.\[$]{*prefix}*) #(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)
-  ;;
-esac
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24
-dnl -------------
-dnl Check for the package-config program, unless disabled by command-line.
-AC_DEFUN([CF_PKG_CONFIG],
-[
-AC_MSG_CHECKING(if you want to use pkg-config)
-AC_ARG_WITH(pkg-config,
-	[  --with-pkg-config{=path} enable/disable use of pkg-config],
-	[cf_pkg_config=$withval],
-	[cf_pkg_config=yes])
-AC_MSG_RESULT($cf_pkg_config)
-
-case $cf_pkg_config in #(vi
-no) #(vi
-	PKG_CONFIG=none
-	;;
-yes) #(vi
-	AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)
-	;;
-*)
-	PKG_CONFIG=$withval
-	;;
-esac
-
-test -z "$PKG_CONFIG" && PKG_CONFIG=none
-if test "$PKG_CONFIG" != none ; then
-	CF_PATH_SYNTAX(PKG_CONFIG)
-fi
-
-AC_SUBST(PKG_CONFIG)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
-dnl -----------------
-dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
-dnl
-dnl	POSIX.1-1990				_POSIX_SOURCE
-dnl	POSIX.1-1990 and			_POSIX_SOURCE and
-dnl		POSIX.2-1992 C-Language			_POSIX_C_SOURCE=2
-dnl		Bindings Option
-dnl	POSIX.1b-1993				_POSIX_C_SOURCE=199309L
-dnl	POSIX.1c-1996				_POSIX_C_SOURCE=199506L
-dnl	X/Open 2000				_POSIX_C_SOURCE=200112L
-dnl
-dnl Parameters:
-dnl	$1 is the nominal value for _POSIX_C_SOURCE
-AC_DEFUN([CF_POSIX_C_SOURCE],
-[
-cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
-
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-
-CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
-CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
-
-AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
-	CF_MSG_LOG(if the symbol is already defined go no further)
-	AC_TRY_COMPILE([#include ],[
-#ifndef _POSIX_C_SOURCE
-make an error
-#endif],
-	[cf_cv_posix_c_source=no],
-	[cf_want_posix_source=no
-	 case .$cf_POSIX_C_SOURCE in #(vi
-	 .[[12]]??*) #(vi
-		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
-		;;
-	 .2) #(vi
-		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
-		AC_TRY_COMPILE([#include ],[
-#ifdef _POSIX_SOURCE
-make an error
-#endif],[],
-		cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
-	 fi
-	 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
-	 CFLAGS="$cf_trim_CFLAGS"
-	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
-	 CF_MSG_LOG(if the second compile does not leave our definition intact error)
-	 AC_TRY_COMPILE([#include ],[
-#ifndef _POSIX_C_SOURCE
-make an error
-#endif],,
-	 [cf_cv_posix_c_source=no])
-	 CFLAGS="$cf_save_CFLAGS"
-	 CPPFLAGS="$cf_save_CPPFLAGS"
-	])
-])
-
-if test "$cf_cv_posix_c_source" != no ; then
-	CFLAGS="$cf_trim_CFLAGS"
-	CPPFLAGS="$cf_trim_CPPFLAGS"
-	CF_ADD_CFLAGS($cf_cv_posix_c_source)
-fi
-
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22
-dnl ----------
-dnl Check for archiver "ar".
-AC_DEFUN([CF_PROG_AR],[
-AC_CHECK_TOOL(AR, ar, ar)
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59
-dnl -----------
-dnl Check for awk, ensure that the check found something.
-AC_DEFUN([CF_PROG_AWK],
-[
-AC_PROG_AWK
-test -z "$AWK" && AC_MSG_ERROR(No awk program found)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37
-dnl --------------
-dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that
-dnl the output file can be renamed, and allows for a shell variable that can
-dnl be used later.  The parameter is either CC or CXX.  The result is the
-dnl cache variable:
-dnl	$cf_cv_prog_CC_c_o
-dnl	$cf_cv_prog_CXX_c_o
-AC_DEFUN([CF_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_MSG_CHECKING([whether [$]$1 understands -c and -o together])
-AC_CACHE_VAL(cf_cv_prog_$1_c_o,
-[
-cat > conftest.$ac_ext <
-int main()
-{
-	${cf_cv_main_return:-return}(0);
-}
-CF_EOF
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='[$]$1 -c conftest.$ac_ext -o conftest2.$ac_objext >&AC_FD_CC'
-if AC_TRY_EVAL(ac_try) &&
-  test -f conftest2.$ac_objext && AC_TRY_EVAL(ac_try);
-then
-  eval cf_cv_prog_$1_c_o=yes
-else
-  eval cf_cv_prog_$1_c_o=no
-fi
-rm -rf conftest*
-])dnl
-if test $cf_cv_prog_$1_c_o = yes; then
-  AC_MSG_RESULT([yes])
-else
-  AC_MSG_RESULT([no])
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_EGREP version: 1 updated: 2006/09/16 11:40:59
-dnl -------------
-dnl AC_PROG_EGREP was introduced in autoconf 2.53.
-dnl This macro adds a check to ensure the script found something.
-AC_DEFUN([CF_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-test -z "$EGREP" && AC_MSG_ERROR(No egrep program found)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
-dnl -----------
-dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
-AC_DEFUN([CF_PROG_EXT],
-[
-AC_REQUIRE([CF_CHECK_CACHE])
-case $cf_cv_system_name in
-os2*)
-    CFLAGS="$CFLAGS -Zmt"
-    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
-    CXXFLAGS="$CXXFLAGS -Zmt"
-    # autoconf's macro sets -Zexe and suffix both, which conflict:w
-    LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
-    ac_cv_exeext=.exe
-    ;;
-esac
-
-AC_EXEEXT
-AC_OBJEXT
-
-PROG_EXT="$EXEEXT"
-AC_SUBST(PROG_EXT)
-test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18
-dnl ------------
-dnl Check for gnatmake, ensure that it is complete.
-AC_DEFUN([CF_PROG_GNAT],[
-cf_ada_make=gnatmake
-AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no)
-if test "$ac_cv_prog_gnat_exists" = no; then
-   cf_ada_make=
-else
-   CF_GNAT_VERSION
-   AC_CHECK_PROG(M4_exists, m4, yes, no)
-   if test "$ac_cv_prog_M4_exists" = no; then
-      cf_cv_prog_gnat_correct=no
-      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
-   fi
-   if test "$cf_cv_prog_gnat_correct" = yes; then
-      AC_MSG_CHECKING(if GNAT works)
-      CF_GNAT_TRY_RUN([procedure conftest;],
-[with Text_IO;
-with GNAT.OS_Lib;
-procedure conftest is
-begin
-   Text_IO.Put ("Hello World");
-   Text_IO.New_Line;
-   GNAT.OS_Lib.OS_Exit (0);
-end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no])
-      AC_MSG_RESULT($cf_cv_prog_gnat_correct)
-   fi
-fi
-
-AC_SUBST(cf_ada_make)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37
-dnl ------------
-dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f"
-dnl option if it is supported.
-AC_DEFUN([CF_PROG_LN_S],[
-AC_PROG_LN_S
-AC_MSG_CHECKING(if $LN_S -f options work)
-
-rm -f conf$$.src conf$$dst
-echo >conf$$.dst
-echo first >conf$$.src
-if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
-	cf_prog_ln_sf=yes
-else
-	cf_prog_ln_sf=no
-fi
-rm -f conf$$.dst conf$$src
-AC_MSG_RESULT($cf_prog_ln_sf)
-
-test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
-dnl ----------------
-dnl Remove all -U and -D options that refer to the given symbol from a list
-dnl of C compiler options.  This works around the problem that not all
-dnl compilers process -U and -D options from left-to-right, so a -U option
-dnl cannot be used to cancel the effect of a preceding -D option.
-dnl
-dnl $1 = target (which could be the same as the source variable)
-dnl $2 = source (including '$')
-dnl $3 = symbol to remove
-define([CF_REMOVE_DEFINE],
-[
-$1=`echo "$2" | \
-	sed	-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
-		-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[$]//g'`
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52
-dnl -------------
-dnl Remove the given library from the symbol
-dnl
-dnl $1 = target (which could be the same as the source variable)
-dnl $2 = source (including '$')
-dnl $3 = library to remove
-define([CF_REMOVE_LIB],
-[
-# remove $3 library from $2
-$1=`echo "$2" | sed -e 's/-l$3[[ 	]]//g' -e 's/-l$3[$]//'`
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16
-dnl --------------
-dnl --------------
-dnl Attempt to determine the appropriate CC/LD options for creating a shared
-dnl library.
-dnl
-dnl Note: ${LOCAL_LDFLAGS} is used to link executables that will run within the
-dnl build-tree, i.e., by making use of the libraries that are compiled in ../lib
-dnl We avoid compiling-in a ../lib path for the shared library since that can
-dnl lead to unexpected results at runtime.
-dnl ${LOCAL_LDFLAGS2} has the same intention but assumes that the shared libraries
-dnl are compiled in ../../lib
-dnl
-dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure
-dnl to install symbolic links to the rel/abi versions of shared libraries.
-dnl
-dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi
-dnl version when making symbolic links.
-dnl
-dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
-dnl version numbers are infix (ex: libncurses..dylib) or postfix
-dnl (ex: libncurses.so.).
-dnl
-dnl Some loaders leave 'so_locations' lying around.  It's nice to clean up.
-AC_DEFUN([CF_SHARED_OPTS],
-[
-	AC_REQUIRE([CF_SUBST_NCURSES_VERSION])
-	AC_REQUIRE([CF_LD_RPATH_OPT])
-	LOCAL_LDFLAGS=
-	LOCAL_LDFLAGS2=
-	LD_SHARED_OPTS=
-	INSTALL_LIB="-m 644"
-
-	cf_cv_do_symlinks=no
-	cf_ld_rpath_opt=
-	test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
-
-	AC_MSG_CHECKING(if release/abi version should be used for shared libs)
-	AC_ARG_WITH(shlib-version,
-	[  --with-shlib-version=X  Specify rel or abi version for shared libs],
-	[test -z "$withval" && withval=auto
-	case $withval in #(vi
-	yes) #(vi
-		cf_cv_shlib_version=auto
-		;;
-	rel|abi|auto|no) #(vi
-		cf_cv_shlib_version=$withval
-		;;
-	*)
-		AC_MSG_ERROR([option value must be one of: rel, abi, auto or no])
-		;;
-	esac
-	],[cf_cv_shlib_version=auto])
-	AC_MSG_RESULT($cf_cv_shlib_version)
-
-	cf_cv_rm_so_locs=no
-
-	# Some less-capable ports of gcc support only -fpic
-	CC_SHARED_OPTS=
-	if test "$GCC" = yes
-	then
-		AC_MSG_CHECKING(which $CC option to use)
-		cf_save_CFLAGS="$CFLAGS"
-		for CC_SHARED_OPTS in -fPIC -fpic ''
-		do
-			CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
-			AC_TRY_COMPILE([#include ],[int x = 1],[break],[])
-		done
-		AC_MSG_RESULT($CC_SHARED_OPTS)
-		CFLAGS="$cf_save_CFLAGS"
-	fi
-
-	cf_cv_shlib_version_infix=no
-
-	case $cf_cv_system_name in #(vi
-	aix[[56]]*) #(vi
-		if test "$GCC" = yes; then
-			CC_SHARED_OPTS=
-			MK_SHARED_LIB='$(CC) -shared'
-		fi
-		;;
-	beos*) #(vi
-		MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
-		;;
-	cygwin*) #(vi
-		CC_SHARED_OPTS=
-		MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
-		cf_cv_shlib_version=cygdll
-		cf_cv_shlib_version_infix=cygdll
-		cat >mk_shared_lib.sh <<-CF_EOF
-		#!/bin/sh
-		SHARED_LIB=\[$]1
-		IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
-		shift
-		cat <<-EOF
-		Linking shared library
-		** SHARED_LIB \[$]SHARED_LIB
-		** IMPORT_LIB \[$]IMPORT_LIB
-EOF
-		exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB}
-CF_EOF
-		chmod +x mk_shared_lib.sh
-		;;
-	darwin*) #(vi
-		EXTRA_CFLAGS="-no-cpp-precomp"
-		CC_SHARED_OPTS="-dynamic"
-		MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
-		cf_cv_shlib_version_infix=yes
-		AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [
-			cf_save_LDFLAGS=$LDFLAGS
-			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
-			AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no)
-				LDFLAGS=$cf_save_LDFLAGS])
-		if test $cf_cv_ldflags_search_paths_first = yes; then
-			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
-		fi
-		;;
-	hpux*) #(vi
-		# (tested with gcc 2.7.2 -- I don't have c89)
-		if test "$GCC" = yes; then
-			LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
-		else
-			CC_SHARED_OPTS='+Z'
-			LD_SHARED_OPTS='-Wl,+b,${libdir}'
-		fi
-		MK_SHARED_LIB='${LD} +b ${libdir} -b -o $[@]'
-		# HP-UX shared libraries must be executable, and should be
-		# readonly to exploit a quirk in the memory manager.
-		INSTALL_LIB="-m 555"
-		;;
-	irix*) #(vi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-		# tested with IRIX 5.2 and 'cc'.
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-KPIC'
-			MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
-		else
-			MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $[@]` -o $[@]'
-		fi
-		cf_cv_rm_so_locs=yes
-		;;
-	linux*|gnu*|k*bsd*-gnu) #(vi
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-		CF_SHARED_SONAME
-		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
-		;;
-	openbsd[[2-9]].*) #(vi
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		CF_SHARED_SONAME
-		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
-		;;
-	nto-qnx*|openbsd*|freebsd[[12]].*) #(vi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		MK_SHARED_LIB='${LD} -Bshareable -o $[@]'
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-		;;
-	freebsd*) #(vi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
-			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-		CF_SHARED_SONAME
-		MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]'
-		;;
-	netbsd*) #(vi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
-			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-			if test "$cf_cv_shlib_version" = auto; then
-			if test -f /usr/libexec/ld.elf_so; then
-				cf_cv_shlib_version=abi
-			else
-				cf_cv_shlib_version=rel
-			fi
-			fi
-			CF_SHARED_SONAME
-			MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]'
-		else
-			MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]'
-		fi
-		;;
-	osf*|mls+*) #(vi
-		# tested with OSF/1 V3.2 and 'cc'
-		# tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
-		# link with shared libs).
-		MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`'
-		case $host_os in #(vi
-		osf4*)
-			MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
-			;;
-		esac
-		MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		cf_cv_rm_so_locs=yes
-		;;
-	sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
-		# tested with osr5.0.5
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-belf -KPIC'
-		fi
-		MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@'
-		if test "$cf_cv_enable_rpath" = yes ; then
-			# only way is to set LD_RUN_PATH but no switch for it
-			RUN_PATH=$libdir
-		fi
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-		LINK_PROGS='LD_RUN_PATH=${libdir}'
-		LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
-		;;
-	sunos4*) #(vi
-		# tested with SunOS 4.1.1 and gcc 2.7.0
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-KPIC'
-		fi
-		MK_SHARED_LIB='${LD} -assert pure-text -o $[@]'
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-		;;
-	solaris2*) #(vi
-		# tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
-		# tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
-		fi
-		CF_SHARED_SONAME
-		if test "$GCC" != yes; then
-			cf_save_CFLAGS="$CFLAGS"
-			for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
-			do
-				CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
-				AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break])
-			done
-			CFLAGS="$cf_save_CFLAGS"
-			CC_SHARED_OPTS=$cf_shared_opts
-			MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]'
-		else
-			MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]'
-		fi
-		;;
-	sysv5uw7*|unix_sv*) #(vi
-		# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-KPIC'
-		fi
-		MK_SHARED_LIB='${LD} -d y -G -o [$]@'
-		;;
-	*)
-		CC_SHARED_OPTS='unknown'
-		MK_SHARED_LIB='echo unknown'
-		;;
-	esac
-
-	# This works if the last tokens in $MK_SHARED_LIB are the -o target.
-	case "$cf_cv_shlib_version" in #(vi
-	rel|abi)
-		case "$MK_SHARED_LIB" in #(vi
-		*'-o $[@]') #(vi
-			test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
-			;;
-		*)
-			AC_MSG_WARN(ignored --with-shlib-version)
-			;;
-		esac
-		;;
-	esac
-
-	if test -n "$cf_ld_rpath_opt" ; then
-		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
-	fi
-
-	AC_SUBST(CC_SHARED_OPTS)
-	AC_SUBST(LD_RPATH_OPT)
-	AC_SUBST(LD_SHARED_OPTS)
-	AC_SUBST(MK_SHARED_LIB)
-	AC_SUBST(LINK_PROGS)
-	AC_SUBST(LINK_TESTS)
-	AC_SUBST(EXTRA_LDFLAGS)
-	AC_SUBST(LOCAL_LDFLAGS)
-	AC_SUBST(LOCAL_LDFLAGS2)
-	AC_SUBST(INSTALL_LIB)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43
-dnl ----------------
-dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for
-dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar)
-dnl option.
-dnl
-dnl $1 is the default that should be used for "$cf_cv_shlib_version".
-dnl If missing, use "rel".
-define([CF_SHARED_SONAME],
-[
-	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1)
-	if test "$cf_cv_shlib_version" = rel; then
-		cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}'
-	else
-		cf_cv_shared_soname='`basename $[@]`'
-	fi
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_STRIP_G_OPT version: 3 updated: 2002/12/21 19:25:52
-dnl --------------
-dnl	Remove "-g" option from the compiler options
-AC_DEFUN([CF_STRIP_G_OPT],
-[$1=`echo ${$1} | sed -e 's%-g %%' -e 's%-g$%%'`])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
-dnl --------------
-dnl Construct a search-list for a nonstandard header/lib-file
-dnl	$1 = the variable to return as result
-dnl	$2 = the package name
-dnl	$3 = the subdirectory, e.g., bin, include or lib
-AC_DEFUN([CF_SUBDIR_PATH],
-[
-$1=
-
-CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
-CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03
-dnl --------
-dnl	Shorthand macro for substituting things that the user may override
-dnl	with an environment variable.
-dnl
-dnl	$1 = long/descriptive name
-dnl	$2 = environment variable
-dnl	$3 = default value
-AC_DEFUN([CF_SUBST],
-[AC_CACHE_VAL(cf_cv_subst_$2,[
-AC_MSG_CHECKING(for $1 (symbol $2))
-CF_SUBST_IF([-z "[$]$2"], [$2], [$3])
-cf_cv_subst_$2=[$]$2
-AC_MSG_RESULT([$]$2)
-])
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49
-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
-	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
-AC_TRY_COMPILE([#include 
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <$cf_test>
-],[int x = auto_left_margin],[
-	cf_cv_term_header="$cf_test"],[
-	cf_cv_term_header=unknown
-	])
-	test "$cf_cv_term_header" != unknown && break
-done
-])
-
-# Set definitions to allow ifdef'ing to accommodate subdirectories
-
-case $cf_cv_term_header in # (vi
-*term.h)
-	AC_DEFINE(HAVE_TERM_H)
-	;;
-esac
-
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
-	AC_DEFINE(HAVE_NCURSES_TERM_H)
-	;;
-ncursesw/term.h)
-	AC_DEFINE(HAVE_NCURSESW_TERM_H)
-	;;
-esac
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_TOP_BUILDDIR version: 1 updated: 2006/10/15 16:33:23
-dnl ---------------
-dnl Define a top_builddir symbol, for applications that need an absolute path.
-AC_DEFUN([CF_TOP_BUILDDIR],
-[
-top_builddir=`pwd`
-AC_SUBST(top_builddir)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
-dnl --------
-dnl Make an uppercase version of a variable
-dnl $1=uppercase($2)
-AC_DEFUN([CF_UPPER],
-[
-$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
-dnl -----------
-dnl Check for multibyte support, and if not found, utf8 compatibility library
-AC_DEFUN([CF_UTF8_LIB],
-[
-AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
-	cf_save_LIBS="$LIBS"
-	AC_TRY_LINK([
-#include ],[putwc(0,0);],
-	[cf_cv_utf8_lib=yes],
-	[CF_FIND_LINKAGE([
-#include ],[putwc(0,0);],utf8,
-		[cf_cv_utf8_lib=add-on],
-		[cf_cv_utf8_lib=no])
-])])
-
-# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
-# ncurses/ncursesw:
-if test "$cf_cv_utf8_lib" = "add-on" ; then
-	AC_DEFINE(HAVE_LIBUTF8_H)
-	CF_ADD_INCDIR($cf_cv_header_path_utf8)
-	CF_ADD_LIBDIR($cf_cv_library_path_utf8)
-	CF_ADD_LIBS($cf_cv_library_file_utf8)
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
-dnl ----------
-dnl Use AC_VERBOSE w/o the warnings
-AC_DEFUN([CF_VERBOSE],
-[test -n "$verbose" && echo "	$1" 1>&AC_FD_MSG
-CF_MSG_LOG([$1])
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WEAK_SYMBOLS version: 1 updated: 2008/08/16 19:18:06
-dnl ---------------
-dnl Check for compiler-support for weak symbols.
-dnl This works with "recent" gcc.
-AC_DEFUN([CF_WEAK_SYMBOLS],[
-AC_CACHE_CHECK(if $CC supports weak symbols,cf_cv_weak_symbols,[
-
-AC_TRY_COMPILE([
-#include ],
-[
-#if defined(__GNUC__)
-#  if defined __USE_ISOC99
-#    define _cat_pragma(exp)	_Pragma(#exp)
-#    define _weak_pragma(exp)	_cat_pragma(weak name)
-#  else
-#    define _weak_pragma(exp)
-#  endif
-#  define _declare(name)	__extension__ extern __typeof__(name) name
-#  define weak_symbol(name)	_weak_pragma(name) _declare(name) __attribute__((weak))
-#endif
-
-weak_symbol(fopen);
-],[cf_cv_weak_symbols=yes],[cf_cv_weak_symbols=no])
-])
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58
-dnl --------------------
-dnl Command-line option to specify the Ada95 compiler.
-AC_DEFUN([CF_WITH_ADA_COMPILER],[
-AC_MSG_CHECKING(for ada-compiler)
-AC_ARG_WITH(ada-compiler,
-	[  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
-	[cf_ada_compiler=$withval],
-	[cf_ada_compiler=gnatmake])
-AC_SUBST(cf_ada_compiler)
-AC_MSG_RESULT($cf_ada_compiler)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58
-dnl -------------------
-dnl Command-line option to specify where Ada includes will install.
-AC_DEFUN([CF_WITH_ADA_INCLUDE],[
-AC_MSG_CHECKING(for ada-include)
-CF_WITH_PATH(ada-include,
-   [  --with-ada-include=DIR  Ada includes are in DIR],
-   ADA_INCLUDE,
-   PREFIX/share/ada/adainclude,
-   [$]prefix/share/ada/adainclude)
-AC_SUBST(ADA_INCLUDE)
-AC_MSG_RESULT($ADA_INCLUDE)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58
-dnl -------------------
-dnl Command-line option to specify where Ada objects will install.
-AC_DEFUN([CF_WITH_ADA_OBJECTS],[
-AC_MSG_CHECKING(for ada-objects)
-CF_WITH_PATH(ada-objects,
-   [  --with-ada-objects=DIR  Ada objects are in DIR],
-   ADA_OBJECTS,
-   PREFIX/lib/ada/adalib,
-   [$]prefix/lib/ada/adalib)
-AC_SUBST(ADA_OBJECTS)
-AC_MSG_RESULT($ADA_OBJECTS)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58
-dnl ---------------------
-dnl Command-line option to specify if an Ada95 shared-library should be built,
-dnl and optionally what its soname should be.
-AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[
-AC_MSG_CHECKING(if an Ada95 shared-library should be built)
-AC_ARG_WITH(ada-sharedlib,
-	[  --with-ada-sharedlib=XX build Ada95 shared-library],
-	[with_ada_sharedlib=$withval],
-	[with_ada_sharedlib=no])
-AC_MSG_RESULT($with_ada_sharedlib)
-
-ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
-MAKE_ADA_SHAREDLIB="#"
-
-if test "x$with_ada_sharedlib" != xno
-then
-	MAKE_ADA_SHAREDLIB=
-	if test "x$with_ada_sharedlib" != xyes
-	then
-		ADA_SHAREDLIB="$with_ada_sharedlib"
-	fi
-fi
-
-AC_SUBST(ADA_SHAREDLIB)
-AC_SUBST(MAKE_ADA_SHAREDLIB)
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38
-dnl ------------------
-dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
-dnl libraries.
-AC_DEFUN([CF_WITH_CURSES_DIR],[
-
-AC_MSG_CHECKING(for specific curses-directory)
-AC_ARG_WITH(curses-dir,
-	[  --with-curses-dir=DIR   directory in which (n)curses is installed],
-	[cf_cv_curses_dir=$withval],
-	[cf_cv_curses_dir=no])
-AC_MSG_RESULT($cf_cv_curses_dir)
-
-if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
-then
-	CF_PATH_SYNTAX(withval)
-	if test -d "$cf_cv_curses_dir"
-	then
-		CF_ADD_INCDIR($cf_cv_curses_dir/include)
-		CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
-	fi
-fi
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18
-dnl ------------
-dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
-dnl defaulting to yes/no.
-dnl
-dnl $1 = option name
-dnl $2 = help-text
-dnl $3 = environment variable to set
-dnl $4 = default value, shown in the help-message, must be a constant
-dnl $5 = default value, if it's an expression & cannot be in the help-message
-dnl
-AC_DEFUN([CF_WITH_PATH],
-[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),,
-ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl
-if ifelse([$5],,true,[test -n "$5"]) ; then
-CF_PATH_SYNTAX(withval)
-fi
-$3="$withval"
-AC_SUBST($3)dnl
-])dnl
-dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02
-dnl ---------------
-dnl Check for POSIX thread library.
-AC_DEFUN([CF_WITH_PTHREAD],
-[
-AC_MSG_CHECKING(if you want to link with the pthread library)
-AC_ARG_WITH(pthread,
-    [  --with-pthread          use POSIX thread library],
-    [with_pthread=$withval],
-    [with_pthread=no])
-AC_MSG_RESULT($with_pthread)
-
-if test "$with_pthread" != no ; then
-    AC_CHECK_HEADER(pthread.h,[
-        AC_DEFINE(HAVE_PTHREADS_H)
-
-        AC_MSG_CHECKING(if we can link with the pthread library)
-        cf_save_LIBS="$LIBS"
-        CF_ADD_LIB(pthread)
-        AC_TRY_LINK([
-#include 
-],[
-        int rc = pthread_create(0,0,0,0);
-],[with_pthread=yes],[with_pthread=no])
-        LIBS="$cf_save_LIBS"
-        AC_MSG_RESULT($with_pthread)
-
-        if test "$with_pthread" = yes ; then
-            CF_ADD_LIB(pthread)
-            AC_DEFINE(HAVE_LIBPTHREADS)
-        else
-            AC_MSG_ERROR(Cannot link with pthread library)
-        fi
-    ])
-fi
-])
-dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37
-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,
-dnl without losing the common non-POSIX features.
-dnl
-dnl Parameters:
-dnl	$1 is the nominal value for _XOPEN_SOURCE
-dnl	$2 is the nominal value for _POSIX_C_SOURCE
-AC_DEFUN([CF_XOPEN_SOURCE],[
-
-cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
-cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
-cf_xopen_source=
-
-case $host_os in #(vi
-aix[[456]]*) #(vi
-	cf_xopen_source="-D_ALL_SOURCE"
-	;;
-cygwin) #(vi
-	cf_XOPEN_SOURCE=600
-	;;
-darwin[[0-8]].*) #(vi
-	cf_xopen_source="-D_APPLE_C_SOURCE"
-	;;
-darwin*) #(vi
-	cf_xopen_source="-D_DARWIN_C_SOURCE"
-	;;
-freebsd*|dragonfly*) #(vi
-	# 5.x headers associate
-	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
-	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
-	cf_POSIX_C_SOURCE=200112L
-	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
-	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
-	;;
-hpux*) #(vi
-	cf_xopen_source="-D_HPUX_SOURCE"
-	;;
-irix[[56]].*) #(vi
-	cf_xopen_source="-D_SGI_SOURCE"
-	;;
-linux*|gnu*|mint*|k*bsd*-gnu) #(vi
-	CF_GNU_SOURCE
-	;;
-mirbsd*) #(vi
-	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks 
-	;;
-netbsd*) #(vi
-	# setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
-	;;
-openbsd*) #(vi
-	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
-	;;
-osf[[45]]*) #(vi
-	cf_xopen_source="-D_OSF_SOURCE"
-	;;
-nto-qnx*) #(vi
-	cf_xopen_source="-D_QNX_SOURCE"
-	;;
-sco*) #(vi
-	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
-	;;
-solaris2.1[[0-9]]) #(vi
-	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-	;;
-solaris2.[[1-9]]) #(vi
-	cf_xopen_source="-D__EXTENSIONS__"
-	;;
-*)
-	AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
-	AC_TRY_COMPILE([#include ],[
-#ifndef _XOPEN_SOURCE
-make an error
-#endif],
-	[cf_cv_xopen_source=no],
-	[cf_save="$CPPFLAGS"
-	 CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-	 AC_TRY_COMPILE([#include ],[
-#ifdef _XOPEN_SOURCE
-make an error
-#endif],
-	[cf_cv_xopen_source=no],
-	[cf_cv_xopen_source=$cf_XOPEN_SOURCE])
-	CPPFLAGS="$cf_save"
-	])
-])
-	if test "$cf_cv_xopen_source" != no ; then
-		CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
-		CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
-		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
-		CF_ADD_CFLAGS($cf_temp_xopen_source)
-	fi
-	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
-	;;
-esac
-
-if test -n "$cf_xopen_source" ; then
-	CF_ADD_CFLAGS($cf_xopen_source)
-fi
-])
diff --git a/Ada95/configure b/Ada95/configure
deleted file mode 100755
index 4db6f1f932e..00000000000
--- a/Ada95/configure
+++ /dev/null
@@ -1,12502 +0,0 @@
-#! /bin/sh
-# From configure.in Revision: 1.30 .
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by Autoconf 2.52.20101002.
-#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-# Name of the executable.
-as_me=`echo "$0" |sed 's,.*[\\/],,'`
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-as_executable_p="test -f"
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-# NLS nuisances.
-$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
-$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
-$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
-$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
-$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
-$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
-$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
-$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
-
-# Name of the host.
-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-exec 6>&1
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-cross_compiling=no
-subdirs=
-MFLAGS= MAKEFLAGS=
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
-ac_unique_file="gen/gen.c"
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-
-ac_prev=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
-    ac_prev=
-    continue
-  fi
-
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_option in
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
-    datadir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
-
-  -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
-   { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
-
-  -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
-   { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
-Try \`$0 --help' for more information." >&2
-   { (exit 1); exit 1; }; }
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
-   { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
-   { (exit 1); exit 1; }; }
-fi
-
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-              localstatedir libdir includedir oldincludedir infodir mandir
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: should be removed in autoconf 3.0.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used." >&2
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_prog=$0
-  ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
-  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
-  srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources in $srcdir" >&2
-   { (exit 1); exit 1; }; }
-  fi
-fi
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat < if you have libraries in a
-              nonstandard directory 
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I if you have
-              headers in a nonstandard directory 
-  CPP         C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-EOF
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
-  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
-    cd $ac_subdir
-    # A "../" for each directory in /$ac_subdir.
-    ac_dots=`echo $ac_subdir |
-             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
-
-    case $srcdir in
-    .) # No --srcdir option.  We are building in place.
-      ac_sub_srcdir=$srcdir ;;
-    [\\/]* | ?:[\\/]* ) # Absolute path.
-      ac_sub_srcdir=$srcdir/$ac_subdir ;;
-    *) # Relative path.
-      ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
-    esac
-
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_sub_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_sub_srcdir/configure; then
-      echo
-      $SHELL $ac_sub_srcdir/configure  --help=recursive
-    elif test -f $ac_sub_srcdir/configure.ac ||
-           test -f $ac_sub_srcdir/configure.in; then
-      echo
-      $ac_configure --help
-    else
-      echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
-    fi
-    cd $ac_popdir
-  done
-fi
-
-test -n "$ac_init_help" && exit 0
-if $ac_init_version; then
-  cat <<\EOF
-
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-EOF
-  exit 0
-fi
-exec 5>config.log
-cat >&5 </dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-PATH = $PATH
-
-_ASUNAME
-} >&5
-
-cat >&5 <\?\"\']*)
-    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
-    ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-    ac_sep=" " ;;
-  *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
-     ac_sep=" " ;;
-  esac
-  # Get rid of the leading space.
-done
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  echo >&5
-  echo "## ----------------- ##" >&5
-  echo "## Cache variables.  ##" >&5
-  echo "## ----------------- ##" >&5
-  echo >&5
-  # The following way of writing the cache mishandles newlines in values,
-{
-  (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      sed -n \
-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
-    *)
-      sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-} >&5
-  sed "/^$/d" confdefs.h >conftest.log
-  if test -s conftest.log; then
-    echo >&5
-    echo "## ------------ ##" >&5
-    echo "## confdefs.h.  ##" >&5
-    echo "## ------------ ##" >&5
-    echo >&5
-    cat conftest.log >&5
-  fi
-  (echo; echo) >&5
-  test "$ac_signal" != 0 &&
-    echo "$as_me: caught signal $ac_signal" >&5
-  echo "$as_me: exit $exit_status" >&5
-  rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
-    exit $exit_status
-     ' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
-fi
-for ac_site_file in $CONFIG_SITE; do
-  if test -r "$ac_site_file"; then
-    { echo "$as_me:884: 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"
-  fi
-done
-
-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:895: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
-    esac
-  fi
-else
-  { echo "$as_me:903: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { echo "$as_me:919: 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:923: 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:929: 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:931:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-        { echo "$as_me:933:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-        ac_cache_corrupted=:
-      fi;;
-  esac
-  # Pass precious variables to config.status.  It doesn't matter if
-  # we pass some twice (in addition to the command line arguments).
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
-      ac_configure_args="$ac_configure_args '$ac_arg'"
-      ;;
-    *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
-       ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { echo "$as_me:952: 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:954: 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
-
-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
-
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='	' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
-esac
-echo "#! $SHELL" >conftest.sh
-echo  "exit 0"   >>conftest.sh
-chmod +x conftest.sh
-if { (echo "$as_me:975: PATH=\".;.\"; conftest.sh") >&5
-  (PATH=".;."; conftest.sh) 2>&5
-  ac_status=$?
-  echo "$as_me:978: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  ac_path_separator=';'
-else
-  ac_path_separator=:
-fi
-PATH_SEPARATOR="$ac_path_separator"
-rm -f conftest.sh
-
-ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg.hin"
-
-top_builddir=`pwd`
-
-ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f $ac_dir/install.sh; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f $ac_dir/shtool; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:1008: 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
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-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:1018: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
-   { (exit 1); exit 1; }; }
-
-echo "$as_me:1022: 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
-else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
-  { { echo "$as_me:1031: 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:1035: 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:1040: 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/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-echo "$as_me:1047: 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
-else
-  ac_cv_host_alias=$host_alias
-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:1056: 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:1061: 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/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
-	echo "$as_me:1069: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6
-if test "${ac_cv_target+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_target_alias=$target_alias
-test "x$ac_cv_target_alias" = "x" &&
-  ac_cv_target_alias=$ac_cv_host_alias
-ac_cv_target=`$ac_config_sub $ac_cv_target_alias` ||
-  { { echo "$as_me:1078: error: $ac_config_sub $ac_cv_target_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:1083: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6
-target=$ac_cv_target
-target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
-  test "$program_prefix$program_suffix$program_transform_name" = \
-    NONENONEs,x,x, &&
-  program_prefix=${target_alias}-
-	system_name="$host_os"
-else
-	system_name="`(uname -s -r) 2>/dev/null`"
-	if test -z "$system_name" ; then
-		system_name="`(hostname) 2>/dev/null`"
-	fi
-fi
-test -n "$system_name" && cat >>confdefs.h <&6
-else
-  cf_cv_system_name="$system_name"
-fi
-
-test -z "$system_name" && system_name="$cf_cv_system_name"
-test -n "$cf_cv_system_name" && echo "$as_me:1114: 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:1118: 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:1120: 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
-
-# Check whether --with-system-type or --without-system-type was given.
-if test "${with_system_type+set}" = set; then
-  withval="$with_system_type"
-  { echo "$as_me:1128: WARNING: overriding system type to $withval" >&5
-echo "$as_me: WARNING: overriding system type to $withval" >&2;}
- cf_cv_system_name=$withval
-fi;
-
-###	Save the given $CFLAGS to allow user-override.
-cf_user_CFLAGS="$CFLAGS"
-
-###	Default install-location
-
-echo "$as_me:1138: checking for prefix" >&5
-echo $ECHO_N "checking for prefix... $ECHO_C" >&6
-if test "x$prefix" = "xNONE" ; then
-	case "$cf_cv_system_name" in
-		# non-vendor systems don't have a conflict
-	openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu)
-		prefix=/usr
-		;;
-	*)	prefix=$ac_default_prefix
-		;;
-	esac
-fi
-echo "$as_me:1150: result: $prefix" >&5
-echo "${ECHO_T}$prefix" >&6
-
-if test "x$prefix" = "xNONE" ; then
-echo "$as_me:1154: checking for default include-directory" >&5
-echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6
-test -n "$verbose" && echo 1>&6
-for cf_symbol in \
-	$includedir \
-	$includedir/ncurses \
-	$prefix/include \
-	$prefix/include/ncurses \
-	/usr/local/include \
-	/usr/local/include/ncurses \
-	/usr/include \
-	/usr/include/ncurses
-do
-	cf_dir=`eval echo $cf_symbol`
-	if test -f $cf_dir/curses.h ; then
-	if ( fgrep NCURSES_VERSION $cf_dir/curses.h 2>&1 >/dev/null ) ; then
-		includedir="$cf_symbol"
-		test -n "$verbose"  && echo $ac_n "	found " 1>&6
-		break
-	fi
-	fi
-	test -n "$verbose"  && echo "	tested $cf_dir" 1>&6
-done
-echo "$as_me:1177: result: $includedir" >&5
-echo "${ECHO_T}$includedir" >&6
-fi
-
-###	Checks for programs.
-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
-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:1191: 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
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  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:1206: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:1214: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:1217: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-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:1226: 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
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="gcc"
-echo "$as_me:1241: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:1249: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:1252: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-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:1265: 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
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  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:1280: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:1288: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:1291: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-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:1300: 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
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_CC="cc"
-echo "$as_me:1315: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:1323: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:1326: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-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:1339: 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
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
-  ac_prog_rejected=yes
-  continue
-fi
-ac_cv_prog_CC="cc"
-echo "$as_me:1359: found $ac_dir/$ac_word" >&5
-break
-done
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    set dummy "$ac_dir/$ac_word" ${1+"$@"}
-    shift
-    ac_cv_prog_CC="$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:1381: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:1384: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
-  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:1395: 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
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  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:1410: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  echo "$as_me:1418: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:1421: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl
-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:1434: 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
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  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:1449: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:1457: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
-else
-  echo "$as_me:1460: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$ac_ct_CC" && break
-done
-
-  CC=$ac_ct_CC
-fi
-
-fi
-
-test -z "$CC" && { { echo "$as_me:1472: 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:1477:" \
-     "checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:1480: \"$ac_compiler --version &5\"") >&5
-  (eval $ac_compiler --version &5) 2>&5
-  ac_status=$?
-  echo "$as_me:1483: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:1485: \"$ac_compiler -v &5\"") >&5
-  (eval $ac_compiler -v &5) 2>&5
-  ac_status=$?
-  echo "$as_me:1488: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (eval echo "$as_me:1490: \"$ac_compiler -V &5\"") >&5
-  (eval $ac_compiler -V &5) 2>&5
-  ac_status=$?
-  echo "$as_me:1493: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 1497 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-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:1513: 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:1516: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
-  ac_status=$?
-  echo "$as_me:1519: \$? = $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
-# resort.
-for ac_file in `ls a.exe conftest.exe 2>/dev/null;
-                ls a.out conftest 2>/dev/null;
-                ls a.* conftest.* 2>/dev/null`; do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
-    a.out ) # We found the default executable, but exeext='' is most
-            # certainly right.
-            break;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
-          export ac_cv_exeext
-          break;;
-    * ) break;;
-  esac
-done
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:1542: 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:1548: 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:1553: 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:1559: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1562: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { echo "$as_me:1569: 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;}
-   { (exit 1); exit 1; }; }
-    fi
-  fi
-fi
-echo "$as_me:1577: 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:1584: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:1586: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:1589: checking for executable suffix" >&5
-echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
-if { (eval echo "$as_me:1591: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:1594: \$? = $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
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-          export ac_cv_exeext
-          break;;
-    * ) break;;
-  esac
-done
-else
-  { { echo "$as_me:1610: 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:1616: 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:1622: 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 1628 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1643: \$? = $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
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-{ { echo "$as_me:1655: 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:1662: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-echo "$as_me:1666: 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 1672 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1687: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1690: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1693: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1696: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_compiler_gnu=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-echo "$as_me:1708: 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:1714: 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 1720 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1732: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1735: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1738: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1741: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:1751: 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
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1778: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1781: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1784: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1787: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   ''\
-   '#include ' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
-#line 1799 "configure"
-#include "confdefs.h"
-#include 
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1815: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1818: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1821: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-continue
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line 1831 "configure"
-#include "confdefs.h"
-$ac_declaration
-int
-main ()
-{
-exit (42);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:1843: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:1846: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:1849: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:1852: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-rm -rf conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
-fi
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-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
-
-GCC_VERSION=none
-if test "$GCC" = yes ; then
-	echo "$as_me:1882: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
-	test -z "$GCC_VERSION" && GCC_VERSION=unknown
-	echo "$as_me:1886: result: $GCC_VERSION" >&5
-echo "${ECHO_T}$GCC_VERSION" >&6
-fi
-
-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:1896: 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
-  CPP=
-fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # 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 1917 "configure"
-#include "confdefs.h"
-#include 
-                     Syntax error
-_ACEOF
-if { (eval echo "$as_me:1922: \"$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:1928: \$? = $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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Broken: fails on valid input.
-continue
-fi
-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 1951 "configure"
-#include "confdefs.h"
-#include 
-_ACEOF
-if { (eval echo "$as_me:1955: \"$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:1961: \$? = $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
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:1998: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # 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 2008 "configure"
-#include "confdefs.h"
-#include 
-                     Syntax error
-_ACEOF
-if { (eval echo "$as_me:2013: \"$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:2019: \$? = $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
-  :
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Broken: fails on valid input.
-continue
-fi
-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 2042 "configure"
-#include "confdefs.h"
-#include 
-_ACEOF
-if { (eval echo "$as_me:2046: \"$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:2052: \$? = $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
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:2080: error: C preprocessor \"$CPP\" fails sanity check" >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-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
-
-if test $ac_cv_c_compiler_gnu = yes; then
-    echo "$as_me:2093: checking whether $CC needs -traditional" >&5
-echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
-if test "${ac_cv_prog_gcc_traditional+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    ac_pattern="Autoconf.*'x'"
-  cat >conftest.$ac_ext <<_ACEOF
-#line 2100 "configure"
-#include "confdefs.h"
-#include 
-int Autoconf = TIOCGETP;
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "$ac_pattern" >/dev/null 2>&1; then
-  ac_cv_prog_gcc_traditional=yes
-else
-  ac_cv_prog_gcc_traditional=no
-fi
-rm -rf conftest*
-
-  if test $ac_cv_prog_gcc_traditional = no; then
-    cat >conftest.$ac_ext <<_ACEOF
-#line 2115 "configure"
-#include "confdefs.h"
-#include 
-int Autoconf = TCGETA;
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "$ac_pattern" >/dev/null 2>&1; then
-  ac_cv_prog_gcc_traditional=yes
-fi
-rm -rf conftest*
-
-  fi
-fi
-echo "$as_me:2128: result: $ac_cv_prog_gcc_traditional" >&5
-echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
-  if test $ac_cv_prog_gcc_traditional = yes; then
-    CC="$CC -traditional"
-  fi
-fi
-
-echo "$as_me:2135: checking whether $CC understands -c and -o together" >&5
-echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6
-if test "${cf_cv_prog_CC_c_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-cat > conftest.$ac_ext <
-int main()
-{
-	${cf_cv_main_return:-return}(0);
-}
-CF_EOF
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-if { (eval echo "$as_me:2151: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:2154: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-  test -f conftest2.$ac_objext && { (eval echo "$as_me:2156: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:2159: \$? = $ac_status" >&5
-  (exit $ac_status); };
-then
-  eval cf_cv_prog_CC_c_o=yes
-else
-  eval cf_cv_prog_CC_c_o=no
-fi
-rm -rf conftest*
-
-fi
-if test $cf_cv_prog_CC_c_o = yes; then
-  echo "$as_me:2170: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me:2173: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-echo "$as_me:2177: checking for POSIXized ISC" >&5
-echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6
-if test -d /etc/conf/kconfig.d &&
-   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
-  echo "$as_me:2182: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-  ISC=yes # If later tests want to check for ISC.
-
-cat >>confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
-
-  if test "$GCC" = yes; then
-    CC="$CC -posix"
-  else
-    CC="$CC -Xp"
-  fi
-else
-  echo "$as_me:2196: result: no" >&5
-echo "${ECHO_T}no" >&6
-  ISC=
-fi
-
-echo "$as_me:2201: checking for ${CC:-cc} option to accept ANSI C" >&5
-echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
-if test "${cf_cv_ansi_cc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-cf_cv_ansi_cc=no
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX			-Aa -D_HPUX_SOURCE
-# SVR4			-Xc
-# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
-for cf_arg in "-DCC_HAS_PROTOS" \
-	"" \
-	-qlanglvl=ansi \
-	-std1 \
-	-Ae \
-	"-Aa -D_HPUX_SOURCE" \
-	-Xc
-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 #(vi
-	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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
-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
-	CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line 2305 "configure"
-#include "confdefs.h"
-
-#ifndef CC_HAS_PROTOS
-#if !defined(__STDC__) || (__STDC__ != 1)
-choke me
-#endif
-#endif
-
-int
-main ()
-{
-
-	int test (int i, double x);
-	struct s1 {int (*f) (int a);};
-	struct s2 {int (*f) (double a);};
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:2326: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:2329: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:2332: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:2335: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ansi_cc="$cf_arg"; break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-done
-CFLAGS="$cf_save_CFLAGS"
-CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-echo "$as_me:2348: result: $cf_cv_ansi_cc" >&5
-echo "${ECHO_T}$cf_cv_ansi_cc" >&6
-
-if test "$cf_cv_ansi_cc" != "no"; then
-if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in $cf_cv_ansi_cc
-do
-case $cf_fix_cppflags in
-no)
-	case $cf_add_cflags in #(vi
-	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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
-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
-	CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-else
-	cat >>confdefs.h <<\EOF
-#define CC_HAS_PROTOS 1
-EOF
-
-fi
-fi
-
-if test "$cf_cv_ansi_cc" = "no"; then
-	{ { echo "$as_me:2441: error: Your compiler does not appear to recognize prototypes.
-You have the following choices:
-	a. adjust your compiler options
-	b. get an up-to-date compiler
-	c. use a wrapper such as unproto" >&5
-echo "$as_me: error: Your compiler does not appear to recognize prototypes.
-You have the following choices:
-	a. adjust your compiler options
-	b. get an up-to-date compiler
-	c. use a wrapper such as unproto" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-case $cf_cv_system_name in
-os2*)
-    CFLAGS="$CFLAGS -Zmt"
-    CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__"
-    CXXFLAGS="$CXXFLAGS -Zmt"
-    # autoconf's macro sets -Zexe and suffix both, which conflict:w
-    LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
-    ac_cv_exeext=.exe
-    ;;
-esac
-
-PROG_EXT="$EXEEXT"
-
-test -n "$PROG_EXT" && cat >>confdefs.h <conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
-
-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:2488: 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
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_AWK="$ac_prog"
-echo "$as_me:2503: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  echo "$as_me:2511: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
-else
-  echo "$as_me:2514: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$AWK" && break
-done
-
-test -z "$AWK" && { { echo "$as_me:2521: error: No awk program found" >&5
-echo "$as_me: error: No awk program found" >&2;}
-   { (exit 1); exit 1; }; }
-
-echo "$as_me:2525: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:2535: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-test -z "$EGREP" && { { echo "$as_me:2539: error: No egrep program found" >&5
-echo "$as_me: error: No egrep program found" >&2;}
-   { (exit 1); exit 1; }; }
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# 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:2555: 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
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    ac_save_IFS=$IFS; IFS=$ac_path_separator
-  for ac_dir in $PATH; do
-    IFS=$ac_save_IFS
-    # Account for people who put trailing slashes in PATH elements.
-    case $ac_dir/ in
-    / | ./ | .// | /cC/* \
-    | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
-    | /usr/ucb/* ) ;;
-    *)
-      # OSF1 and SCO ODT 3.0 have their own names for install.
-      # Don't use installbsd from OSF since it installs stuff as root
-      # by default.
-      for ac_prog in ginstall scoinst install; do
-        if $as_executable_p "$ac_dir/$ac_prog"; then
-	  if test $ac_prog = install &&
-            grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    ac_cv_path_install="$ac_dir/$ac_prog -c"
-	    break 2
-	  fi
-	fi
-      done
-      ;;
-    esac
-  done
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
-    INSTALL=$ac_install_sh
-  fi
-fi
-echo "$as_me:2604: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-echo "$as_me:2615: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  echo "$as_me:2619: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me:2622: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
-fi
-
-echo "$as_me:2626: checking if $LN_S -f options work" >&5
-echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6
-
-rm -f conf$$.src conf$$dst
-echo >conf$$.dst
-echo first >conf$$.src
-if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
-	cf_prog_ln_sf=yes
-else
-	cf_prog_ln_sf=no
-fi
-rm -f conf$$.dst conf$$src
-echo "$as_me:2638: result: $cf_prog_ln_sf" >&5
-echo "${ECHO_T}$cf_prog_ln_sf" >&6
-
-test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
-
-echo "$as_me:2643: checking for long file names" >&5
-echo $ECHO_N "checking for long file names... $ECHO_C" >&6
-if test "${ac_cv_sys_long_file_names+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_sys_long_file_names=yes
-# Test for long file names in all the places we know might matter:
-#      .		the current directory, where building will happen
-#      $prefix/lib	where we will be installing things
-#      $exec_prefix/lib	likewise
-# eval it to expand exec_prefix.
-#      $TMPDIR		if set, where it might want to write temporary files
-# if $TMPDIR is not set:
-#      /tmp		where it might want to write temporary files
-#      /var/tmp		likewise
-#      /usr/tmp		likewise
-if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
-  ac_tmpdirs=$TMPDIR
-else
-  ac_tmpdirs='/tmp /var/tmp /usr/tmp'
-fi
-for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
-  test -d $ac_dir || continue
-  test -w $ac_dir || continue # It is less confusing to not echo anything here.
-  ac_xdir=$ac_dir/cf$$
-  (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
-  ac_tf1=$ac_xdir/conftest9012345
-  ac_tf2=$ac_xdir/conftest9012346
-  (echo 1 >$ac_tf1) 2>/dev/null
-  (echo 2 >$ac_tf2) 2>/dev/null
-  ac_val=`cat $ac_tf1 2>/dev/null`
-  if test ! -f $ac_tf1 || test "$ac_val" != 1; then
-    ac_cv_sys_long_file_names=no
-    rm -rf $ac_xdir 2>/dev/null
-    break
-  fi
-  rm -rf $ac_xdir 2>/dev/null
-done
-fi
-echo "$as_me:2682: result: $ac_cv_sys_long_file_names" >&5
-echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
-if test $ac_cv_sys_long_file_names = yes; then
-
-cat >>confdefs.h <<\EOF
-#define HAVE_LONG_FILE_NAMES 1
-EOF
-
-fi
-
-# if we find pkg-config, check if we should install the ".pc" files.
-
-echo "$as_me:2694: 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.
-if test "${with_pkg_config+set}" = set; then
-  withval="$with_pkg_config"
-  cf_pkg_config=$withval
-else
-  cf_pkg_config=yes
-fi;
-echo "$as_me:2704: result: $cf_pkg_config" >&5
-echo "${ECHO_T}$cf_pkg_config" >&6
-
-case $cf_pkg_config in #(vi
-no) #(vi
-	PKG_CONFIG=none
-	;;
-yes) #(vi
-	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:2715: 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
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  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:2732: found $ac_dir/$ac_word" >&5
-   break
-fi
-done
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-
-if test -n "$PKG_CONFIG"; then
-  echo "$as_me:2743: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
-else
-  echo "$as_me:2746: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-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:2755: 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
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  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:2772: found $ac_dir/$ac_word" >&5
-   break
-fi
-done
-
-  test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-
-if test -n "$ac_pt_PKG_CONFIG"; then
-  echo "$as_me:2784: result: $ac_pt_PKG_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
-else
-  echo "$as_me:2787: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  PKG_CONFIG=$ac_pt_PKG_CONFIG
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-	;;
-*)
-	PKG_CONFIG=$withval
-	;;
-esac
-
-test -z "$PKG_CONFIG" && PKG_CONFIG=none
-if test "$PKG_CONFIG" != none ; then
-
-if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
-else
-  cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".$PKG_CONFIG" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
-  ;;
-.\${*prefix}*) #(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:2830: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
-echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-fi
-
-if test "$PKG_CONFIG" != none ; then
-	echo "$as_me:2839: checking if we should install .pc files for $PKG_CONFIG" >&5
-echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6
-
-	# Leave this as something that can be overridden in the environment.
-	if test -z "$PKG_CONFIG_LIBDIR" ; then
-		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig
-	fi
-	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
-
-# Check whether --enable-pc-files or --disable-pc-files was given.
-if test "${enable_pc_files+set}" = set; then
-  enableval="$enable_pc_files"
-  enable_pc_files=$enableval
-else
-  enable_pc_files=no
-fi;
-		echo "$as_me:2856: result: $enable_pc_files" >&5
-echo "${ECHO_T}$enable_pc_files" >&6
-	else
-		echo "$as_me:2859: result: no" >&5
-echo "${ECHO_T}no" >&6
-		{ echo "$as_me:2861: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5
-echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;}
-		enable_pc_files=no
-	fi
-fi
-
-echo "$as_me:2867: checking if you want to build test-programs" >&5
-echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6
-
-# Check whether --with-tests or --without-tests was given.
-if test "${with_tests+set}" = set; then
-  withval="$with_tests"
-  cf_with_tests=$withval
-else
-  cf_with_tests=yes
-fi;
-echo "$as_me:2877: result: $cf_with_tests" >&5
-echo "${ECHO_T}$cf_with_tests" >&6
-
-echo "$as_me:2880: checking if we should assume mixed-case filenames" >&5
-echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6
-
-# Check whether --enable-mixed-case or --disable-mixed-case was given.
-if test "${enable_mixed_case+set}" = set; then
-  enableval="$enable_mixed_case"
-  enable_mixedcase=$enableval
-else
-  enable_mixedcase=auto
-fi;
-echo "$as_me:2890: result: $enable_mixedcase" >&5
-echo "${ECHO_T}$enable_mixedcase" >&6
-if test "$enable_mixedcase" = "auto" ; then
-
-echo "$as_me:2894: 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*|*-mingw32*|*-uwin*) #(vi
-		cf_cv_mixedcase=no
-		;;
-	*)
-		cf_cv_mixedcase=yes
-		;;
-	esac
-else
-	rm -f conftest CONFTEST
-	echo test >conftest
-	if test -f CONFTEST ; then
-		cf_cv_mixedcase=no
-	else
-		cf_cv_mixedcase=yes
-	fi
-	rm -f conftest CONFTEST
-fi
-
-fi
-echo "$as_me:2921: result: $cf_cv_mixedcase" >&5
-echo "${ECHO_T}$cf_cv_mixedcase" >&6
-test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
-#define MIXEDCASE_FILENAMES 1
-EOF
-
-else
-    cf_cv_mixedcase=$enable_mixedcase
-    if test "$enable_mixedcase" = "yes" ; then
-        cat >>confdefs.h <<\EOF
-#define MIXEDCASE_FILENAMES 1
-EOF
-
-    fi
-fi
-
-# do this after mixed-case option (tags/TAGS is not as important as tic).
-echo "$as_me:2938: 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
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.make <<\EOF
-all:
-	@echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftest.make
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:2958: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-  SET_MAKE=
-else
-  echo "$as_me:2962: result: no" >&5
-echo "${ECHO_T}no" >&6
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-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:2971: 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
-else
-  if test -n "$CTAGS"; then
-  ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_CTAGS="$ac_prog"
-echo "$as_me:2986: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-CTAGS=$ac_cv_prog_CTAGS
-if test -n "$CTAGS"; then
-  echo "$as_me:2994: result: $CTAGS" >&5
-echo "${ECHO_T}$CTAGS" >&6
-else
-  echo "$as_me:2997: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$CTAGS" && break
-done
-
-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:3008: 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
-else
-  if test -n "$ETAGS"; then
-  ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ETAGS="$ac_prog"
-echo "$as_me:3023: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-ETAGS=$ac_cv_prog_ETAGS
-if test -n "$ETAGS"; then
-  echo "$as_me:3031: result: $ETAGS" >&5
-echo "${ECHO_T}$ETAGS" >&6
-else
-  echo "$as_me:3034: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$ETAGS" && break
-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:3043: 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
-else
-  if test -n "$MAKE_LOWER_TAGS"; then
-  ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_MAKE_LOWER_TAGS="yes"
-echo "$as_me:3058: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
-fi
-fi
-MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
-if test -n "$MAKE_LOWER_TAGS"; then
-  echo "$as_me:3067: result: $MAKE_LOWER_TAGS" >&5
-echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
-else
-  echo "$as_me:3070: 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:3077: 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
-else
-  if test -n "$MAKE_UPPER_TAGS"; then
-  ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_MAKE_UPPER_TAGS="yes"
-echo "$as_me:3092: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
-fi
-fi
-MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
-if test -n "$MAKE_UPPER_TAGS"; then
-  echo "$as_me:3101: result: $MAKE_UPPER_TAGS" >&5
-echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
-else
-  echo "$as_me:3104: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-else
-	MAKE_UPPER_TAGS=no
-fi
-
-if test "$MAKE_UPPER_TAGS" = yes ; then
-	MAKE_UPPER_TAGS=
-else
-	MAKE_UPPER_TAGS="#"
-fi
-
-if test "$MAKE_LOWER_TAGS" = yes ; then
-	MAKE_LOWER_TAGS=
-else
-	MAKE_LOWER_TAGS="#"
-fi
-
-echo "$as_me:3124: checking for makeflags variable" >&5
-echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6
-if test "${cf_cv_makeflags+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-	cf_cv_makeflags=''
-	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
-	do
-		cat >cf_makeflags.tmp </dev/null | fgrep -v "ing directory" | sed -e 's,[ 	]*$,,'`
-		case "$cf_result" in
-		.*k)
-			cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
-			case "$cf_result" in
-			.*CC=*)	cf_cv_makeflags=
-				;;
-			*)	cf_cv_makeflags=$cf_option
-				;;
-			esac
-			break
-			;;
-		.-)	;;
-		*)	echo "given option \"$cf_option\", no match \"$cf_result\""
-			;;
-		esac
-	done
-	rm -f cf_makeflags.tmp
-
-fi
-echo "$as_me:3158: result: $cf_cv_makeflags" >&5
-echo "${ECHO_T}$cf_cv_makeflags" >&6
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:3164: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-echo "$as_me:3179: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  echo "$as_me:3187: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
-else
-  echo "$as_me:3190: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo "$as_me:3199: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_RANLIB="ranlib"
-echo "$as_me:3214: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'"
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:3223: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
-else
-  echo "$as_me:3226: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  RANLIB=$ac_ct_RANLIB
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ld; ac_word=$2
-echo "$as_me:3238: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$LD"; then
-  ac_cv_prog_LD="$LD" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_LD="${ac_tool_prefix}ld"
-echo "$as_me:3253: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-LD=$ac_cv_prog_LD
-if test -n "$LD"; then
-  echo "$as_me:3261: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6
-else
-  echo "$as_me:3264: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_LD"; then
-  ac_ct_LD=$LD
-  # Extract the first word of "ld", so it can be a program name with args.
-set dummy ld; ac_word=$2
-echo "$as_me:3273: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_LD"; then
-  ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_LD="ld"
-echo "$as_me:3288: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld"
-fi
-fi
-ac_ct_LD=$ac_cv_prog_ac_ct_LD
-if test -n "$ac_ct_LD"; then
-  echo "$as_me:3297: result: $ac_ct_LD" >&5
-echo "${ECHO_T}$ac_ct_LD" >&6
-else
-  echo "$as_me:3300: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  LD=$ac_ct_LD
-else
-  LD="$ac_cv_prog_LD"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:3312: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_AR="${ac_tool_prefix}ar"
-echo "$as_me:3327: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  echo "$as_me:3335: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
-else
-  echo "$as_me:3338: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo "$as_me:3347: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_AR="ar"
-echo "$as_me:3362: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  echo "$as_me:3371: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
-else
-  echo "$as_me:3374: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  AR=$ac_ct_AR
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-echo "$as_me:3386: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_AR="${ac_tool_prefix}ar"
-echo "$as_me:3401: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  echo "$as_me:3409: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6
-else
-  echo "$as_me:3412: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-echo "$as_me:3421: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_ac_ct_AR="ar"
-echo "$as_me:3436: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar"
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  echo "$as_me:3445: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6
-else
-  echo "$as_me:3448: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  AR=$ac_ct_AR
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-echo "$as_me:3457: checking for options to update archives" >&5
-echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6
-if test "${cf_cv_ar_flags+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-	cf_cv_ar_flags=unknown
-	for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv
-	do
-
-		# check if $ARFLAGS already contains this choice
-		if test "x$ARFLAGS" != "x" ; then
-			cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
-			if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
-				cf_cv_ar_flags=
-				break
-			fi
-		fi
-
-		rm -f conftest.$ac_cv_objext
-		rm -f conftest.a
-
-		cat >conftest.$ac_ext <&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3486: \$? = $ac_status" >&5
-  (exit $ac_status); } ; then
-			echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5
-			$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null
-			if test -f conftest.a ; then
-				cf_cv_ar_flags=$cf_ar_flags
-				break
-			fi
-		else
-			test -n "$verbose" && echo "	cannot compile test-program" 1>&6
-
-echo "${as_me:-configure}:3497: testing cannot compile test-program ..." 1>&5
-
-			break
-		fi
-	done
-	rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
-
-fi
-echo "$as_me:3505: result: $cf_cv_ar_flags" >&5
-echo "${ECHO_T}$cf_cv_ar_flags" >&6
-
-if test -n "$ARFLAGS" ; then
-	if test -n "$cf_cv_ar_flags" ; then
-		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
-	fi
-else
-	ARFLAGS=$cf_cv_ar_flags
-fi
-
-echo "$as_me:3516: checking if you have specified an install-prefix" >&5
-echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6
-
-# Check whether --with-install-prefix or --without-install-prefix was given.
-if test "${with_install_prefix+set}" = set; then
-  withval="$with_install_prefix"
-  case "$withval" in #(vi
-	yes|no) #(vi
-		;;
-	*)	DESTDIR="$withval"
-		;;
-	esac
-fi;
-echo "$as_me:3529: result: $DESTDIR" >&5
-echo "${ECHO_T}$DESTDIR" >&6
-
-###############################################################################
-
-# If we're cross-compiling, allow the user to override the tools and their
-# options.  The configure script is oriented toward identifying the host
-# compiler, etc., but we need a build compiler to generate parts of the source.
-
-if test "$cross_compiling" = yes ; then
-
-	# defaults that we might want to override
-	: ${BUILD_CFLAGS:=''}
-	: ${BUILD_CPPFLAGS:=''}
-	: ${BUILD_LDFLAGS:=''}
-	: ${BUILD_LIBS:=''}
-	: ${BUILD_EXEEXT:='$x'}
-	: ${BUILD_OBJEXT:='o'}
-
-# Check whether --with-build-cc or --without-build-cc was given.
-if test "${with_build_cc+set}" = set; then
-  withval="$with_build_cc"
-  BUILD_CC="$withval"
-else
-  for ac_prog in gcc cc cl
-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:3557: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_BUILD_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$BUILD_CC"; then
-  ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_BUILD_CC="$ac_prog"
-echo "$as_me:3572: found $ac_dir/$ac_word" >&5
-break
-done
-
-fi
-fi
-BUILD_CC=$ac_cv_prog_BUILD_CC
-if test -n "$BUILD_CC"; then
-  echo "$as_me:3580: result: $BUILD_CC" >&5
-echo "${ECHO_T}$BUILD_CC" >&6
-else
-  echo "$as_me:3583: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$BUILD_CC" && break
-done
-
-fi;
-	echo "$as_me:3591: checking for native build C compiler" >&5
-echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6
-	echo "$as_me:3593: result: $BUILD_CC" >&5
-echo "${ECHO_T}$BUILD_CC" >&6
-
-	echo "$as_me:3596: checking for native build C preprocessor" >&5
-echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6
-
-# Check whether --with-build-cpp or --without-build-cpp was given.
-if test "${with_build_cpp+set}" = set; then
-  withval="$with_build_cpp"
-  BUILD_CPP="$withval"
-else
-  BUILD_CPP='${BUILD_CC} -E'
-fi;
-	echo "$as_me:3606: result: $BUILD_CPP" >&5
-echo "${ECHO_T}$BUILD_CPP" >&6
-
-	echo "$as_me:3609: checking for native build C flags" >&5
-echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6
-
-# Check whether --with-build-cflags or --without-build-cflags was given.
-if test "${with_build_cflags+set}" = set; then
-  withval="$with_build_cflags"
-  BUILD_CFLAGS="$withval"
-fi;
-	echo "$as_me:3617: result: $BUILD_CFLAGS" >&5
-echo "${ECHO_T}$BUILD_CFLAGS" >&6
-
-	echo "$as_me:3620: checking for native build C preprocessor-flags" >&5
-echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6
-
-# Check whether --with-build-cppflags or --without-build-cppflags was given.
-if test "${with_build_cppflags+set}" = set; then
-  withval="$with_build_cppflags"
-  BUILD_CPPFLAGS="$withval"
-fi;
-	echo "$as_me:3628: result: $BUILD_CPPFLAGS" >&5
-echo "${ECHO_T}$BUILD_CPPFLAGS" >&6
-
-	echo "$as_me:3631: checking for native build linker-flags" >&5
-echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6
-
-# Check whether --with-build-ldflags or --without-build-ldflags was given.
-if test "${with_build_ldflags+set}" = set; then
-  withval="$with_build_ldflags"
-  BUILD_LDFLAGS="$withval"
-fi;
-	echo "$as_me:3639: result: $BUILD_LDFLAGS" >&5
-echo "${ECHO_T}$BUILD_LDFLAGS" >&6
-
-	echo "$as_me:3642: checking for native build linker-libraries" >&5
-echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6
-
-# Check whether --with-build-libs or --without-build-libs was given.
-if test "${with_build_libs+set}" = set; then
-  withval="$with_build_libs"
-  BUILD_LIBS="$withval"
-fi;
-	echo "$as_me:3650: result: $BUILD_LIBS" >&5
-echo "${ECHO_T}$BUILD_LIBS" >&6
-
-	# this assumes we're on Unix.
-	BUILD_EXEEXT=
-	BUILD_OBJEXT=o
-
-	: ${BUILD_CC:='${CC}'}
-
-	if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
-		{ { echo "$as_me:3660: error: Cross-build requires two compilers.
-Use --with-build-cc to specify the native compiler." >&5
-echo "$as_me: error: Cross-build requires two compilers.
-Use --with-build-cc to specify the native compiler." >&2;}
-   { (exit 1); exit 1; }; }
-	fi
-
-else
-	: ${BUILD_CC:='${CC}'}
-	: ${BUILD_CPP:='${CPP}'}
-	: ${BUILD_CFLAGS:='${CFLAGS}'}
-	: ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
-	: ${BUILD_LDFLAGS:='${LDFLAGS}'}
-	: ${BUILD_LIBS:='${LIBS}'}
-	: ${BUILD_EXEEXT:='$x'}
-	: ${BUILD_OBJEXT:='o'}
-fi
-
-###############################################################################
-
-### Options to allow the user to specify the set of libraries which are used.
-### Use "--without-normal --with-shared" to allow the default model to be
-### shared, for example.
-cf_list_models=""
-
-echo "$as_me:3685: checking if you want to build shared C-objects" >&5
-echo $ECHO_N "checking if you want to build shared C-objects... $ECHO_C" >&6
-
-# Check whether --with-shared or --without-shared was given.
-if test "${with_shared+set}" = set; then
-  withval="$with_shared"
-  with_shared=$withval
-else
-  with_shared=no
-fi;
-echo "$as_me:3695: result: $with_shared" >&5
-echo "${ECHO_T}$with_shared" >&6
-test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
-
-echo "$as_me:3699: checking for specified models" >&5
-echo $ECHO_N "checking for specified models... $ECHO_C" >&6
-test -z "$cf_list_models" && cf_list_models=normal
-echo "$as_me:3702: result: $cf_list_models" >&5
-echo "${ECHO_T}$cf_list_models" >&6
-
-### Use the first model as the default, and save its suffix for use in building
-### up test-applications.
-echo "$as_me:3707: checking for default model" >&5
-echo $ECHO_N "checking for default model... $ECHO_C" >&6
-DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
-echo "$as_me:3710: result: $DFT_LWR_MODEL" >&5
-echo "${ECHO_T}$DFT_LWR_MODEL" >&6
-
-DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-echo "$as_me:3715: 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.
-if test "${with_curses_dir+set}" = set; then
-  withval="$with_curses_dir"
-  cf_cv_curses_dir=$withval
-else
-  cf_cv_curses_dir=no
-fi;
-echo "$as_me:3725: 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"
-else
-  cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".$withval" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
-  ;;
-.\${*prefix}*) #(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:3756: 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"
-	then
-
-if test -n "$cf_cv_curses_dir/include" ; then
-  for cf_add_incdir in $cf_cv_curses_dir/include
-  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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat >conftest.$ac_ext <<_ACEOF
-#line 3789 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:3801: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:3804: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:3807: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3810: \$? = $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}:3827: 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
-	  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
-
-echo "${as_me:-configure}:3861: testing adding $cf_add_libdir to library-path ..." 1>&5
-
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
-
-	fi
-fi
-
-echo "$as_me:3872: checking if you want wide-character code" >&5
-echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6
-
-# Check whether --enable-widec or --disable-widec was given.
-if test "${enable_widec+set}" = set; then
-  enableval="$enable_widec"
-  with_widec=$enableval
-else
-  with_widec=no
-fi;
-echo "$as_me:3882: result: $with_widec" >&5
-echo "${ECHO_T}$with_widec" >&6
-if test "$with_widec" = yes ; then
-
-echo "$as_me:3886: 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 3894 "configure"
-#include "confdefs.h"
-
-#include 
-int
-main ()
-{
-putwc(0,0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3907: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:3910: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3913: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3916: \$? = $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}:3928: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
-
-cf_save_LIBS="$LIBS"
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 3933 "configure"
-#include "confdefs.h"
-
-#include 
-int
-main ()
-{
-putwc(0,0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3946: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:3949: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3952: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3955: \$? = $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 3969 "configure"
-#include "confdefs.h"
-
-#include 
-int
-main ()
-{
-putwc(0,0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:3982: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:3985: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:3988: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:3991: \$? = $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}:4008: testing find linkage for utf8 library ..." 1>&5
-
-echo "${as_me:-configure}:4010: 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 #(vi
-		-I*)
-			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
-
-test "$cf_header_path" != "NONE" && \
-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 "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr"
-	test -d /usr/include &&          cf_search="$cf_search /usr/include"
-	test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
-	test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
-	test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
-	test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
-}
-
-test "$prefix" != "NONE" && \
-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 "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
-	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
-	test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
-	test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
-	test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
-	test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
-}
-
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /opt"
-	test -d /opt/include &&          cf_search="$cf_search /opt/include"
-	test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
-	test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
-	test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
-	test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
-}
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
-	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
-	test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
-	test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
-	test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
-	test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
-}
-
-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}:4123: 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 4127 "configure"
-#include "confdefs.h"
-
-#include 
-int
-main ()
-{
-putwc(0,0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4140: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4143: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4146: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4149: \$? = $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}:4154: 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}:4172: 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$,,'`
-
-test "$cf_library_path" != "NONE" && \
-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 "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
-	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
-	test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
-	test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
-	test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
-	test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
-}
-
-test "$prefix" != "NONE" && \
-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"
-}
-
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
-	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
-	test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
-	test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
-	test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
-	test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
-}
-
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
-	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
-	test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
-	test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
-	test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
-	test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
-}
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
-	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
-	test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
-	test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
-	test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
-	test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
-}
-
-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}:4269: 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 4275 "configure"
-#include "confdefs.h"
-
-#include 
-int
-main ()
-{
-putwc(0,0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:4288: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:4291: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:4294: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4297: \$? = $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}:4302: 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
-
-                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
-
-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:4344: 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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat >conftest.$ac_ext <<_ACEOF
-#line 4378 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4390: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4393: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4396: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4399: \$? = $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}:4416: 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
-	  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}:4450: testing adding $cf_add_libdir to library-path ..." 1>&5
-
-        LDFLAGS="-L$cf_add_libdir $LDFLAGS"
-      fi
-    fi
-  done
-fi
-
-	LIBS="$cf_cv_library_file_utf8 $LIBS"
-fi
-
-cf_ncuconfig_root=ncursesw
-
-echo "Looking for ${cf_ncuconfig_root}-config"
-for ac_prog in ${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:4468: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $NCURSES_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:4485: found $ac_dir/$ac_word" >&5
-   break
-fi
-done
-
-  ;;
-esac
-fi
-NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
-
-if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:4496: result: $NCURSES_CONFIG" >&5
-echo "${ECHO_T}$NCURSES_CONFIG" >&6
-else
-  echo "$as_me:4499: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$NCURSES_CONFIG" && break
-done
-test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
-
-if test "$NCURSES_CONFIG" != none ; then
-
-CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-LIBS="`$NCURSES_CONFIG --libs` $LIBS"
-
-# even with config script, some packages use no-override for curses.h
-
-echo "$as_me:4514: 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/curses.h \
-	ncursesw/ncurses.h \
-	curses.h \
-	ncurses.h
-do
-cat >conftest.$ac_ext <<_ACEOF
-#line 4528 "configure"
-#include "confdefs.h"
-#include <${cf_header}>
-int
-main ()
-{
-initscr(); tgoto("?", 0,0)
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4543: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4546: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4549: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_header=$cf_header; 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:4560: 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:4564: error: No curses header-files found" >&5
-echo "$as_me: error: No curses header-files found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
-
-for ac_header in $cf_cv_ncurses_header
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:4574: 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 4580 "configure"
-#include "confdefs.h"
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:4584: \"$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:4590: \$? = $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:4609: 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 <>confdefs.h <<\EOF
-#define NCURSES 1
-EOF
-
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <conftest.$ac_ext <<_ACEOF
-#line 4662 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4674: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4677: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4680: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4683: \$? = $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}:4700: 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
-	  fi
-	done
-  done
-fi
-
-}
-
-echo "$as_me:4717: 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
-else
-
-	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
-	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
-	for cf_header in $cf_header_list
-	do
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line 4729 "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 ()
-{
-
-#ifdef NCURSES_VERSION
-
-#ifndef WACS_BSSB
-	make an error
-#endif
-
-printf("%s\n", NCURSES_VERSION);
-#else
-#ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
-#endif
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4761: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4764: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4767: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4770: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_h=$cf_header
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_ncurses_h=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-		test "$cf_cv_ncurses_h" != no && break
-	done
-
-fi
-echo "$as_me:4785: 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:4792: 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
-else
-
-	test -n "$verbose" && echo
-
-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 #(vi
-		-I*)
-			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
-
-test "$cf_header_path" != "NONE" && \
-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/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
-	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
-	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
-	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-			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 "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr"
-	test -d /usr/include &&          cf_search="$cf_search /usr/include"
-	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
-	test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
-	test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
-	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$prefix" != "NONE" && \
-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/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
-	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
-	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
-	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
-	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
-	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
-	test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
-	test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
-	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /opt"
-	test -d /opt/include &&          cf_search="$cf_search /opt/include"
-	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
-	test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
-	test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
-	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
-	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
-	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
-	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
-	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
-	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$includedir" != NONE && \
-test "$includedir" != "/usr/include" && \
-test -d "$includedir" && {
-	test -d $includedir &&    cf_search="$cf_search $includedir"
-	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
-}
-
-test "$oldincludedir" != NONE && \
-test "$oldincludedir" != "/usr/include" && \
-test -d "$oldincludedir" && {
-	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
-	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
-}
-
-cf_search="$cf_search $cf_header_path_list"
-
-	test -n "$verbose" && echo search path $cf_search
-	cf_save2_CPPFLAGS="$CPPFLAGS"
-	for cf_incdir in $cf_search
-	do
-
-if test -n "$cf_incdir" ; then
-  for cf_add_incdir in $cf_incdir
-  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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat >conftest.$ac_ext <<_ACEOF
-#line 4932 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:4944: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:4947: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:4950: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:4953: \$? = $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}:4970: 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
-	  fi
-	done
-  done
-fi
-
-		for cf_header in \
-			ncurses.h \
-			curses.h
-		do
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line 4991 "configure"
-#include "confdefs.h"
-
-#include <$cf_header>
-int
-main ()
-{
-
-#ifdef NCURSES_VERSION
-
-printf("%s\n", NCURSES_VERSION);
-#else
-#ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
-#endif
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5015: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:5018: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5021: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5024: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_h2=$cf_header
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_ncurses_h2=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-			if test "$cf_cv_ncurses_h2" != no ; then
-				cf_cv_ncurses_h2=$cf_incdir/$cf_header
-				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
-				break
-			fi
-			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
-		done
-		CPPFLAGS="$cf_save2_CPPFLAGS"
-		test "$cf_cv_ncurses_h2" != no && break
-	done
-	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:5045: error: not found" >&5
-echo "$as_me: error: not found" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:5050: 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%/[^/]*$%%'`
-	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
-	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
-		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
-	fi
-
-if test -n "$cf_1st_incdir" ; then
-  for cf_add_incdir in $cf_1st_incdir
-  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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat >conftest.$ac_ext <<_ACEOF
-#line 5083 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5095: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:5098: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5101: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5104: \$? = $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}:5121: 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
-	  fi
-	done
-  done
-fi
-
-fi
-
-# Set definitions to allow ifdef'ing for ncurses.h
-
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
-	cat >>confdefs.h <<\EOF
-#define HAVE_NCURSES_H 1
-EOF
-
-	;;
-esac
-
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
-	cat >>confdefs.h <<\EOF
-#define HAVE_NCURSES_NCURSES_H 1
-EOF
-
-	;;
-ncursesw/curses.h|ncursesw/ncurses.h)
-	cat >>confdefs.h <<\EOF
-#define HAVE_NCURSESW_NCURSES_H 1
-EOF
-
-	;;
-esac
-
-echo "$as_me:5164: 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
-	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 5182 "configure"
-#include "confdefs.h"
-#include 
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <$cf_test>
-
-int
-main ()
-{
-int x = auto_left_margin
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5197: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:5200: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5203: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5206: \$? = $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:5222: 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)
-	cat >>confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
-
-	;;
-esac
-
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
-	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
-
-# some applications need this, but should check for NCURSES_VERSION
-cat >>confdefs.h <<\EOF
-#define NCURSES 1
-EOF
-
-echo "$as_me:5256: 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
-else
-
-	cf_cv_ncurses_version=no
-	cf_tempfile=out$$
-	rm -f $cf_tempfile
-	if test "$cross_compiling" = yes; then
-
-	# This will not work if the preprocessor splits the line after the
-	# Autoconf token.  The 'unproto' program does that.
-	cat > conftest.$ac_ext <
-#undef Autoconf
-#ifdef NCURSES_VERSION
-Autoconf NCURSES_VERSION
-#else
-#ifdef __NCURSES_H
-Autoconf "old"
-#endif
-;
-#endif
-EOF
-	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:5282: \"$cf_try\"") >&5
-  (eval $cf_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5285: \$? = $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%".*%%'`
-		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
-		rm -f conftest.out
-	fi
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 5295 "configure"
-#include "confdefs.h"
-
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include 
-int main()
-{
-	FILE *fp = fopen("$cf_tempfile", "w");
-#ifdef NCURSES_VERSION
-# ifdef NCURSES_VERSION_PATCH
-	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
-# else
-	fprintf(fp, "%s\n", NCURSES_VERSION);
-# endif
-#else
-# ifdef __NCURSES_H
-	fprintf(fp, "old\n");
-# else
-	make an error
-# endif
-#endif
-	${cf_cv_main_return:-return}(0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:5320: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5323: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:5325: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5328: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-	cf_cv_ncurses_version=`cat $cf_tempfile`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-	rm -f $cf_tempfile
-
-fi
-echo "$as_me:5342: 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
-	# 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:5354: 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
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgpm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 5362 "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 Gpm_Open ();
-int
-main ()
-{
-Gpm_Open ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5381: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5384: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5387: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5390: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gpm_Gpm_Open=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_gpm_Gpm_Open=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:5401: 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:5404: 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
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgpm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 5412 "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 ();
-int
-main ()
-{
-initscr ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5431: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5434: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5437: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5440: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gpm_initscr=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_gpm_initscr=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:5451: 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"
-else
-  cf_ncurses_LIBS="-lgpm"
-fi
-
-fi
-
-case $host_os in #(vi
-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:5466: 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
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmytinfo  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 5474 "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 tgoto ();
-int
-main ()
-{
-tgoto ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5493: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5496: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5499: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5502: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_mytinfo_tgoto=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_mytinfo_tgoto=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:5513: 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"
-fi
-
-	fi
-	;;
-esac
-
-LIBS="$cf_ncurses_LIBS $LIBS"
-
-if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
-then
-	LIBS="-l$cf_nculib_root $LIBS"
-else
-
-	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
-	cf_libdir=""
-	echo "$as_me:5532: 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 5538 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char initscr (); below.  */
-#include 
-/* 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 ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this 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;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5569: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5572: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5575: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5578: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_initscr=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_initscr=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:5588: 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:5595: 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 5599 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-initscr()
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5611: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5614: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5617: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5620: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:5622: 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:5629: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-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$,,'`
-
-test "$cf_library_path" != "NONE" && \
-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/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
-	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
-	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
-	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-			cf_library_path_list="$cf_library_path_list $cf_search"
-			;;
-		esac
-	done
-fi
-
-cf_search=
-
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
-	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
-	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
-	test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
-	test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
-	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "$prefix" != "NONE" && \
-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/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
-	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
-	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
-	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
-	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
-	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
-	test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
-	test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
-	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
-	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
-	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
-	test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
-	test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
-	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
-	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
-	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
-	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
-	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
-	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-cf_search="$cf_library_path_list $cf_search"
-
-			for cf_libdir in $cf_search
-			do
-				echo "$as_me:5719: 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 5723 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-initscr()
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:5735: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5738: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5741: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5744: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:5746: 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:5753: result: no" >&5
-echo "${ECHO_T}no" >&6
-					 LIBS="$cf_save_LIBS"
-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
-
-eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
-
-if test $cf_found_library = no ; then
-	{ { echo "$as_me:5768: error: Cannot link $cf_nculib_root library" >&5
-echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-fi
-
-if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:5776: 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
-		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
-		if test "$q" != "$LIBS" ; then
-			LIBS="$q"
-		fi
-	done
-	cat >conftest.$ac_ext <<_ACEOF
-#line 5786 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-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:5798: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:5801: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:5804: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5807: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:5809: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-echo "$as_me:5814: result: no" >&5
-echo "${ECHO_T}no" >&6
-		 LIBS="$cf_ncurses_SAVE"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $NCURSES_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  if $as_executable_p "$ac_dir/$ac_word"; then
-   ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word"
-   echo "$as_me:5855: found $ac_dir/$ac_word" >&5
-   break
-fi
-done
-
-  ;;
-esac
-fi
-NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG
-
-if test -n "$NCURSES_CONFIG"; then
-  echo "$as_me:5866: result: $NCURSES_CONFIG" >&5
-echo "${ECHO_T}$NCURSES_CONFIG" >&6
-else
-  echo "$as_me:5869: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$NCURSES_CONFIG" && break
-done
-test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none"
-
-if test "$NCURSES_CONFIG" != none ; then
-
-CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-LIBS="`$NCURSES_CONFIG --libs` $LIBS"
-
-# even with config script, some packages use no-override for curses.h
-
-echo "$as_me:5884: 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/curses.h \
-	ncurses/ncurses.h \
-	curses.h \
-	ncurses.h
-do
-cat >conftest.$ac_ext <<_ACEOF
-#line 5898 "configure"
-#include "confdefs.h"
-#include <${cf_header}>
-int
-main ()
-{
-initscr(); tgoto("?", 0,0)
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:5910: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:5913: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:5916: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:5919: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_header=$cf_header; 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:5930: 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:5934: error: No curses header-files found" >&5
-echo "$as_me: error: No curses header-files found" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-# cheat, to get the right #define's for HAVE_NCURSES_H, etc.
-
-for ac_header in $cf_cv_ncurses_header
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:5944: 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 5950 "configure"
-#include "confdefs.h"
-#include <$ac_header>
-_ACEOF
-if { (eval echo "$as_me:5954: \"$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:5960: \$? = $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:5979: 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 <>confdefs.h <<\EOF
-#define NCURSES 1
-EOF
-
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <conftest.$ac_ext <<_ACEOF
-#line 6032 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6044: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6047: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6050: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6053: \$? = $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}:6070: 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
-	  fi
-	done
-  done
-fi
-
-}
-
-echo "$as_me:6087: 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
-else
-
-	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
-	( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
-	for cf_header in $cf_header_list
-	do
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line 6099 "configure"
-#include "confdefs.h"
-
-#include <$cf_header>
-int
-main ()
-{
-
-#ifdef NCURSES_VERSION
-
-printf("%s\n", NCURSES_VERSION);
-#else
-#ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
-#endif
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6123: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6126: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6129: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6132: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_h=$cf_header
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_ncurses_h=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-		test "$cf_cv_ncurses_h" != no && break
-	done
-
-fi
-echo "$as_me:6147: 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:6154: 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
-else
-
-	test -n "$verbose" && echo
-
-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 #(vi
-		-I*)
-			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
-
-test "$cf_header_path" != "NONE" && \
-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/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
-	test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
-	test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
-	test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-			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 "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr"
-	test -d /usr/include &&          cf_search="$cf_search /usr/include"
-	test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
-	test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
-	test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
-	test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$prefix" != "NONE" && \
-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/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
-	test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
-	test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
-	test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /usr/local"
-	test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
-	test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
-	test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
-	test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
-	test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under /opt"
-	test -d /opt/include &&          cf_search="$cf_search /opt/include"
-	test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
-	test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
-	test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
-	test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for include-directories under $HOME"
-	test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
-	test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
-	test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
-	test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
-	test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
-}
-
-test "$includedir" != NONE && \
-test "$includedir" != "/usr/include" && \
-test -d "$includedir" && {
-	test -d $includedir &&    cf_search="$cf_search $includedir"
-	test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
-}
-
-test "$oldincludedir" != NONE && \
-test "$oldincludedir" != "/usr/include" && \
-test -d "$oldincludedir" && {
-	test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
-	test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
-}
-
-cf_search="$cf_search $cf_header_path_list"
-
-	test -n "$verbose" && echo search path $cf_search
-	cf_save2_CPPFLAGS="$CPPFLAGS"
-	for cf_incdir in $cf_search
-	do
-
-if test -n "$cf_incdir" ; then
-  for cf_add_incdir in $cf_incdir
-  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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat >conftest.$ac_ext <<_ACEOF
-#line 6294 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6306: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6309: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6312: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6315: \$? = $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}:6332: 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
-	  fi
-	done
-  done
-fi
-
-		for cf_header in \
-			ncurses.h \
-			curses.h
-		do
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line 6353 "configure"
-#include "confdefs.h"
-
-#include <$cf_header>
-int
-main ()
-{
-
-#ifdef NCURSES_VERSION
-
-printf("%s\n", NCURSES_VERSION);
-#else
-#ifdef __NCURSES_H
-printf("old\n");
-#else
-	make an error
-#endif
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6377: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6380: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6383: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6386: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ncurses_h2=$cf_header
-
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_ncurses_h2=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-			if test "$cf_cv_ncurses_h2" != no ; then
-				cf_cv_ncurses_h2=$cf_incdir/$cf_header
-				test -n "$verbose" && echo $ac_n "	... found $ac_c" 1>&6
-				break
-			fi
-			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&6
-		done
-		CPPFLAGS="$cf_save2_CPPFLAGS"
-		test "$cf_cv_ncurses_h2" != no && break
-	done
-	test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6407: error: not found" >&5
-echo "$as_me: error: not found" >&2;}
-   { (exit 1); exit 1; }; }
-
-fi
-echo "$as_me:6412: 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%/[^/]*$%%'`
-	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
-	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
-		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
-	fi
-
-if test -n "$cf_1st_incdir" ; then
-  for cf_add_incdir in $cf_1st_incdir
-  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
-			  CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
-			  cat >conftest.$ac_ext <<_ACEOF
-#line 6445 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello")
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6457: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6460: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6463: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6466: \$? = $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}:6483: 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
-	  fi
-	done
-  done
-fi
-
-fi
-
-# Set definitions to allow ifdef'ing for ncurses.h
-
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
-	cat >>confdefs.h <<\EOF
-#define HAVE_NCURSES_H 1
-EOF
-
-	;;
-esac
-
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
-	cat >>confdefs.h <<\EOF
-#define HAVE_NCURSES_NCURSES_H 1
-EOF
-
-	;;
-ncursesw/curses.h|ncursesw/ncurses.h)
-	cat >>confdefs.h <<\EOF
-#define HAVE_NCURSESW_NCURSES_H 1
-EOF
-
-	;;
-esac
-
-echo "$as_me:6526: 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
-	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 6544 "configure"
-#include "confdefs.h"
-#include 
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include <$cf_test>
-
-int
-main ()
-{
-int x = auto_left_margin
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:6559: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:6562: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:6565: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6568: \$? = $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:6584: 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)
-	cat >>confdefs.h <<\EOF
-#define HAVE_TERM_H 1
-EOF
-
-	;;
-esac
-
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
-	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
-
-# some applications need this, but should check for NCURSES_VERSION
-cat >>confdefs.h <<\EOF
-#define NCURSES 1
-EOF
-
-echo "$as_me:6618: 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
-else
-
-	cf_cv_ncurses_version=no
-	cf_tempfile=out$$
-	rm -f $cf_tempfile
-	if test "$cross_compiling" = yes; then
-
-	# This will not work if the preprocessor splits the line after the
-	# Autoconf token.  The 'unproto' program does that.
-	cat > conftest.$ac_ext <
-#undef Autoconf
-#ifdef NCURSES_VERSION
-Autoconf NCURSES_VERSION
-#else
-#ifdef __NCURSES_H
-Autoconf "old"
-#endif
-;
-#endif
-EOF
-	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
-	{ (eval echo "$as_me:6644: \"$cf_try\"") >&5
-  (eval $cf_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6647: \$? = $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%".*%%'`
-		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
-		rm -f conftest.out
-	fi
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 6657 "configure"
-#include "confdefs.h"
-
-#include <${cf_cv_ncurses_header:-curses.h}>
-#include 
-int main()
-{
-	FILE *fp = fopen("$cf_tempfile", "w");
-#ifdef NCURSES_VERSION
-# ifdef NCURSES_VERSION_PATCH
-	fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
-# else
-	fprintf(fp, "%s\n", NCURSES_VERSION);
-# endif
-#else
-# ifdef __NCURSES_H
-	fprintf(fp, "old\n");
-# else
-	make an error
-# endif
-#endif
-	${cf_cv_main_return:-return}(0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:6682: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:6685: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:6687: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6690: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-
-	cf_cv_ncurses_version=`cat $cf_tempfile`
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-	rm -f $cf_tempfile
-
-fi
-echo "$as_me:6704: 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
-	# 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:6716: 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
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgpm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 6724 "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 Gpm_Open ();
-int
-main ()
-{
-Gpm_Open ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6743: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:6746: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6749: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6752: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gpm_Gpm_Open=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_gpm_Gpm_Open=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:6763: 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:6766: 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
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgpm  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 6774 "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 ();
-int
-main ()
-{
-initscr ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6793: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:6796: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6799: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6802: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gpm_initscr=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_gpm_initscr=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:6813: 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"
-else
-  cf_ncurses_LIBS="-lgpm"
-fi
-
-fi
-
-case $host_os in #(vi
-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:6828: 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
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lmytinfo  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 6836 "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 tgoto ();
-int
-main ()
-{
-tgoto ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6855: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:6858: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6861: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6864: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_mytinfo_tgoto=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_mytinfo_tgoto=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:6875: 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"
-fi
-
-	fi
-	;;
-esac
-
-LIBS="$cf_ncurses_LIBS $LIBS"
-
-if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
-then
-	LIBS="-l$cf_nculib_root $LIBS"
-else
-
-	eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
-	cf_libdir=""
-	echo "$as_me:6894: 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 6900 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char initscr (); below.  */
-#include 
-/* 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 ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this 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;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6931: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:6934: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6937: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6940: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_initscr=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_initscr=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:6950: 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:6957: 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 6961 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-initscr()
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:6973: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:6976: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:6979: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:6982: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:6984: 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:6991: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-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$,,'`
-
-test "$cf_library_path" != "NONE" && \
-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/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
-	test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
-	test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
-	test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-			cf_library_path_list="$cf_library_path_list $cf_search"
-			;;
-		esac
-	done
-fi
-
-cf_search=
-
-test "/usr" != "$prefix" && \
-test -d "/usr" && \
-(test $prefix = NONE || test "/usr" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr"
-	test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
-	test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
-	test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
-	test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
-	test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "$prefix" != "NONE" && \
-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/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
-	test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
-	test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
-	test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "/usr/local" != "$prefix" && \
-test -d "/usr/local" && \
-(test $prefix = NONE || test "/usr/local" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /usr/local"
-	test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
-	test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
-	test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
-	test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
-	test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "/opt" != "$prefix" && \
-test -d "/opt" && \
-(test $prefix = NONE || test "/opt" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under /opt"
-	test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
-	test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
-	test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
-	test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
-	test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-test "$HOME" != "$prefix" && \
-test -d "$HOME" && \
-(test $prefix = NONE || test "$HOME" != "$prefix") && {
-	test -n "$verbose" && echo "	... testing for lib-directories under $HOME"
-	test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
-	test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
-	test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
-	test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
-	test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
-}
-
-cf_search="$cf_library_path_list $cf_search"
-
-			for cf_libdir in $cf_search
-			do
-				echo "$as_me:7081: 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 7085 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-initscr()
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7097: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:7100: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7103: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7106: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:7108: 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:7115: result: no" >&5
-echo "${ECHO_T}no" >&6
-					 LIBS="$cf_save_LIBS"
-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
-
-eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
-
-if test $cf_found_library = no ; then
-	{ { echo "$as_me:7130: error: Cannot link $cf_nculib_root library" >&5
-echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-fi
-
-if test -n "$cf_ncurses_LIBS" ; then
-	echo "$as_me:7138: 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
-		q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
-		if test "$q" != "$LIBS" ; then
-			LIBS="$q"
-		fi
-	done
-	cat >conftest.$ac_ext <<_ACEOF
-#line 7148 "configure"
-#include "confdefs.h"
-#include <${cf_cv_ncurses_header:-curses.h}>
-int
-main ()
-{
-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:7160: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:7163: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7166: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7169: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:7171: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-echo "$as_me:7176: result: no" >&5
-echo "${ECHO_T}no" >&6
-		 LIBS="$cf_ncurses_SAVE"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-
-cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
-
-cat >>confdefs.h <conftest.$ac_ext <
-AUTOCONF_$cf_name NCURSES_VERSION_$cf_name
-CF_EOF
-	cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out"
-	{ (eval echo "$as_me:7213: \"$cf_try\"") >&5
-  (eval $cf_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7216: \$? = $ac_status" >&5
-  (exit $ac_status); }
-	if test -f conftest.out ; then
-		cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[ 	][ 	]*//"`
-		eval NCURSES_$cf_name=\"$cf_result\"
-		# cat conftest.$ac_ext
-		# cat conftest.out
-	fi
-done
-
-cf_cv_abi_version=${NCURSES_MAJOR}
-
-fi
-
-cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR}
-
-cf_cv_timestamp=`date`
-
-echo "$as_me:7234: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5
-echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6
-
-	case $cf_cv_system_name in #(vi
-	OS/2*|os2*) #(vi
-        LIB_PREFIX=''
-        ;;
-	*)	LIB_PREFIX='lib'
-        ;;
-	esac
-cf_prefix=$LIB_PREFIX
-
-LIB_PREFIX=$cf_prefix
-
-LIB_SUFFIX=
-
-###############################################################################
-
-if test X"$CC_G_OPT" = X"" ; then
-	CC_G_OPT='-g'
-	test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
-fi
-
-echo "$as_me:7257: checking for default loader flags" >&5
-echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6
-case $DFT_LWR_MODEL in
-normal)  LD_MODEL=''   ;;
-debug)   LD_MODEL=$CC_G_OPT ;;
-profile) LD_MODEL='-pg';;
-shared)  LD_MODEL=''   ;;
-esac
-echo "$as_me:7265: result: $LD_MODEL" >&5
-echo "${ECHO_T}$LD_MODEL" >&6
-
-LD_RPATH_OPT=
-echo "$as_me:7269: 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
-		LD_RPATH_OPT="-Wl,-rpath,"
-	else
-		LD_RPATH_OPT="-rpath "
-	fi
-	;;
-linux*|gnu*|k*bsd*-gnu) #(vi
-	LD_RPATH_OPT="-Wl,-rpath,"
-	;;
-openbsd[2-9].*) #(vi
-	LD_RPATH_OPT="-Wl,-rpath,"
-	;;
-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:7300: result: $LD_RPATH_OPT" >&5
-echo "${ECHO_T}$LD_RPATH_OPT" >&6
-
-case "x$LD_RPATH_OPT" in #(vi
-x-R*)
-	echo "$as_me:7305: 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"
-	LIBS="${LD_RPATH_OPT}$libdir $LIBS"
-	cat >conftest.$ac_ext <<_ACEOF
-#line 7310 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7322: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:7325: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7328: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7331: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_rpath_space=no
-else
-  echo "$as_me: failed program was:" >&5
-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:7341: result: $cf_rpath_space" >&5
-echo "${ECHO_T}$cf_rpath_space" >&6
-	test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
-	;;
-esac
-
-	LOCAL_LDFLAGS=
-	LOCAL_LDFLAGS2=
-	LD_SHARED_OPTS=
-	INSTALL_LIB="-m 644"
-
-	cf_cv_do_symlinks=no
-	cf_ld_rpath_opt=
-	test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
-
-	echo "$as_me:7356: checking if release/abi version should be used for shared libs" >&5
-echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6
-
-# Check whether --with-shlib-version or --without-shlib-version was given.
-if test "${with_shlib_version+set}" = set; then
-  withval="$with_shlib_version"
-  test -z "$withval" && withval=auto
-	case $withval in #(vi
-	yes) #(vi
-		cf_cv_shlib_version=auto
-		;;
-	rel|abi|auto|no) #(vi
-		cf_cv_shlib_version=$withval
-		;;
-	*)
-		{ { echo "$as_me:7371: error: option value must be one of: rel, abi, auto or no" >&5
-echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;}
-   { (exit 1); exit 1; }; }
-		;;
-	esac
-
-else
-  cf_cv_shlib_version=auto
-fi;
-	echo "$as_me:7380: result: $cf_cv_shlib_version" >&5
-echo "${ECHO_T}$cf_cv_shlib_version" >&6
-
-	cf_cv_rm_so_locs=no
-
-	# Some less-capable ports of gcc support only -fpic
-	CC_SHARED_OPTS=
-	if test "$GCC" = yes
-	then
-		echo "$as_me:7389: checking which $CC option to use" >&5
-echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6
-		cf_save_CFLAGS="$CFLAGS"
-		for CC_SHARED_OPTS in -fPIC -fpic ''
-		do
-			CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
-			cat >conftest.$ac_ext <<_ACEOF
-#line 7396 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-int x = 1
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7408: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7411: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7414: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7417: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-		done
-		echo "$as_me:7426: result: $CC_SHARED_OPTS" >&5
-echo "${ECHO_T}$CC_SHARED_OPTS" >&6
-		CFLAGS="$cf_save_CFLAGS"
-	fi
-
-	cf_cv_shlib_version_infix=no
-
-	case $cf_cv_system_name in #(vi
-	aix[56]*) #(vi
-		if test "$GCC" = yes; then
-			CC_SHARED_OPTS=
-			MK_SHARED_LIB='$(CC) -shared'
-		fi
-		;;
-	beos*) #(vi
-		MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0'
-		;;
-	cygwin*) #(vi
-		CC_SHARED_OPTS=
-		MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}'
-		cf_cv_shlib_version=cygdll
-		cf_cv_shlib_version_infix=cygdll
-		cat >mk_shared_lib.sh <<-CF_EOF
-		#!/bin/sh
-		SHARED_LIB=\$1
-		IMPORT_LIB=\`echo "\$1" | sed -e 's/cyg/lib/' -e 's/[0-9]*\.dll$/.dll.a/'\`
-		shift
-		cat <<-EOF
-		Linking shared library
-		** SHARED_LIB \$SHARED_LIB
-		** IMPORT_LIB \$IMPORT_LIB
-EOF
-		exec \$* -shared -Wl,--out-implib=../lib/\${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\${SHARED_LIB}
-CF_EOF
-		chmod +x mk_shared_lib.sh
-		;;
-	darwin*) #(vi
-		EXTRA_CFLAGS="-no-cpp-precomp"
-		CC_SHARED_OPTS="-dynamic"
-		MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
-		cf_cv_shlib_version_infix=yes
-		echo "$as_me:7468: checking if ld -search_paths_first works" >&5
-echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6
-if test "${cf_cv_ldflags_search_paths_first+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-			cf_save_LDFLAGS=$LDFLAGS
-			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
-			cat >conftest.$ac_ext <<_ACEOF
-#line 7477 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-int i;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:7489: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:7492: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:7495: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7498: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_ldflags_search_paths_first=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_ldflags_search_paths_first=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-				LDFLAGS=$cf_save_LDFLAGS
-fi
-echo "$as_me:7509: result: $cf_cv_ldflags_search_paths_first" >&5
-echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6
-		if test $cf_cv_ldflags_search_paths_first = yes; then
-			LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
-		fi
-		;;
-	hpux*) #(vi
-		# (tested with gcc 2.7.2 -- I don't have c89)
-		if test "$GCC" = yes; then
-			LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
-		else
-			CC_SHARED_OPTS='+Z'
-			LD_SHARED_OPTS='-Wl,+b,${libdir}'
-		fi
-		MK_SHARED_LIB='${LD} +b ${libdir} -b -o $@'
-		# HP-UX shared libraries must be executable, and should be
-		# readonly to exploit a quirk in the memory manager.
-		INSTALL_LIB="-m 555"
-		;;
-	irix*) #(vi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-		# tested with IRIX 5.2 and 'cc'.
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-KPIC'
-			MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $@` -o $@'
-		else
-			MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $@` -o $@'
-		fi
-		cf_cv_rm_so_locs=yes
-		;;
-	linux*|gnu*|k*bsd*-gnu) #(vi
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-
-	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-	if test "$cf_cv_shlib_version" = rel; then
-		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
-	else
-		cf_cv_shared_soname='`basename $@`'
-	fi
-
-		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
-		;;
-	openbsd[2-9].*) #(vi
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-
-	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-	if test "$cf_cv_shlib_version" = rel; then
-		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
-	else
-		cf_cv_shared_soname='`basename $@`'
-	fi
-
-		MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@'
-		;;
-	nto-qnx*|openbsd*|freebsd[12].*) #(vi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		MK_SHARED_LIB='${LD} -Bshareable -o $@'
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-		;;
-	freebsd*) #(vi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
-			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS"
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-		fi
-
-	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-	if test "$cf_cv_shlib_version" = rel; then
-		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
-	else
-		cf_cv_shared_soname='`basename $@`'
-	fi
-
-		MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@'
-		;;
-	netbsd*) #(vi
-		CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
-		if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
-			LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-			EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS"
-			if test "$cf_cv_shlib_version" = auto; then
-			if test -f /usr/libexec/ld.elf_so; then
-				cf_cv_shlib_version=abi
-			else
-				cf_cv_shlib_version=rel
-			fi
-			fi
-
-	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-	if test "$cf_cv_shlib_version" = rel; then
-		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
-	else
-		cf_cv_shared_soname='`basename $@`'
-	fi
-
-			MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@'
-		else
-			MK_SHARED_LIB='${LD} -shared -Bshareable -o $@'
-		fi
-		;;
-	osf*|mls+*) #(vi
-		# tested with OSF/1 V3.2 and 'cc'
-		# tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
-		# link with shared libs).
-		MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`'
-		case $host_os in #(vi
-		osf4*)
-			MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
-			;;
-		esac
-		MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@'
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		cf_cv_rm_so_locs=yes
-		;;
-	sco3.2v5*)  # (also uw2* and UW7: hops 13-Apr-98
-		# tested with osr5.0.5
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-belf -KPIC'
-		fi
-		MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@'
-		if test "$cf_cv_enable_rpath" = yes ; then
-			# only way is to set LD_RUN_PATH but no switch for it
-			RUN_PATH=$libdir
-		fi
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-		LINK_PROGS='LD_RUN_PATH=${libdir}'
-		LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
-		;;
-	sunos4*) #(vi
-		# tested with SunOS 4.1.1 and gcc 2.7.0
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-KPIC'
-		fi
-		MK_SHARED_LIB='${LD} -assert pure-text -o $@'
-		test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-		;;
-	solaris2*) #(vi
-		# tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
-		# tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
-		if test "$DFT_LWR_MODEL" = "shared" ; then
-			LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
-			LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
-		fi
-		if test "$cf_cv_enable_rpath" = yes ; then
-			EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
-		fi
-
-	test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
-	if test "$cf_cv_shlib_version" = rel; then
-		cf_cv_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}'
-	else
-		cf_cv_shared_soname='`basename $@`'
-	fi
-
-		if test "$GCC" != yes; then
-			cf_save_CFLAGS="$CFLAGS"
-			for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
-			do
-				CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
-				cat >conftest.$ac_ext <<_ACEOF
-#line 7689 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-printf("Hello\n");
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7701: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7704: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7707: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7710: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-			done
-			CFLAGS="$cf_save_CFLAGS"
-			CC_SHARED_OPTS=$cf_shared_opts
-			MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@'
-		else
-			MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@'
-		fi
-		;;
-	sysv5uw7*|unix_sv*) #(vi
-		# tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
-		if test "$GCC" != yes; then
-			CC_SHARED_OPTS='-KPIC'
-		fi
-		MK_SHARED_LIB='${LD} -d y -G -o $@'
-		;;
-	*)
-		CC_SHARED_OPTS='unknown'
-		MK_SHARED_LIB='echo unknown'
-		;;
-	esac
-
-	# This works if the last tokens in $MK_SHARED_LIB are the -o target.
-	case "$cf_cv_shlib_version" in #(vi
-	rel|abi)
-		case "$MK_SHARED_LIB" in #(vi
-		*'-o $@') #(vi
-			test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
-			;;
-		*)
-			{ echo "$as_me:7747: WARNING: ignored --with-shlib-version" >&5
-echo "$as_me: WARNING: ignored --with-shlib-version" >&2;}
-			;;
-		esac
-		;;
-	esac
-
-	if test -n "$cf_ld_rpath_opt" ; then
-		MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}"
-	fi
-
-# The test/sample programs in the original tree link using rpath option.
-# Make it optional for packagers.
-if test -n "$LOCAL_LDFLAGS"
-then
-	echo "$as_me:7762: checking if you want to link sample programs with rpath option" >&5
-echo $ECHO_N "checking if you want to link sample programs with rpath option... $ECHO_C" >&6
-
-# Check whether --enable-rpath-link or --disable-rpath-link was given.
-if test "${enable_rpath_link+set}" = set; then
-  enableval="$enable_rpath_link"
-  with_rpath_link=$enableval
-else
-  with_rpath_link=yes
-fi;
-	echo "$as_me:7772: result: $with_rpath_link" >&5
-echo "${ECHO_T}$with_rpath_link" >&6
-	if test "$with_rpath_link" = no
-	then
-		LOCAL_LDFLAGS=
-		LOCAL_LDFLAGS2=
-	fi
-fi
-
-###############################################################################
-
-	case $cf_cv_system_name in
-	os2*)	PATH_SEPARATOR=';'  ;;
-	*)	PATH_SEPARATOR=':'  ;;
-	esac
-
-###   use option --enable-broken-linker to force on use of broken-linker support
-echo "$as_me:7789: checking if you want broken-linker support code" >&5
-echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6
-
-# Check whether --enable-broken_linker or --disable-broken_linker was given.
-if test "${enable_broken_linker+set}" = set; then
-  enableval="$enable_broken_linker"
-  with_broken_linker=$enableval
-else
-  with_broken_linker=${BROKEN_LINKER:-no}
-fi;
-echo "$as_me:7799: result: $with_broken_linker" >&5
-echo "${ECHO_T}$with_broken_linker" >&6
-
-BROKEN_LINKER=0
-if test "$with_broken_linker" = yes ; then
-	cat >>confdefs.h <<\EOF
-#define BROKEN_LINKER 1
-EOF
-
-	BROKEN_LINKER=1
-elif test "$DFT_LWR_MODEL" = shared ; then
-	case $cf_cv_system_name in #(vi
-	cygwin*)
-		cat >>confdefs.h <<\EOF
-#define BROKEN_LINKER 1
-EOF
-
-		BROKEN_LINKER=1
-		test -n "$verbose" && echo "	cygwin linker is broken anyway" 1>&6
-
-echo "${as_me:-configure}:7819: testing cygwin linker is broken anyway ..." 1>&5
-
-		;;
-	esac
-fi
-
-# Check to define _XOPEN_SOURCE "automatically"
-
-cf_XOPEN_SOURCE=500
-cf_POSIX_C_SOURCE=199506L
-cf_xopen_source=
-
-case $host_os in #(vi
-aix[456]*) #(vi
-	cf_xopen_source="-D_ALL_SOURCE"
-	;;
-cygwin) #(vi
-	cf_XOPEN_SOURCE=600
-	;;
-darwin[0-8].*) #(vi
-	cf_xopen_source="-D_APPLE_C_SOURCE"
-	;;
-darwin*) #(vi
-	cf_xopen_source="-D_DARWIN_C_SOURCE"
-	;;
-freebsd*|dragonfly*) #(vi
-	# 5.x headers associate
-	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
-	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
-	cf_POSIX_C_SOURCE=200112L
-	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
-	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
-	;;
-hpux*) #(vi
-	cf_xopen_source="-D_HPUX_SOURCE"
-	;;
-irix[56].*) #(vi
-	cf_xopen_source="-D_SGI_SOURCE"
-	;;
-linux*|gnu*|mint*|k*bsd*-gnu) #(vi
-
-echo "$as_me:7863: 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 7870 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifndef _XOPEN_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7885: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7888: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7891: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7894: \$? = $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 7903 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifdef _XOPEN_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7918: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7921: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:7924: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:7927: \$? = $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_cv_gnu_source=yes
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-	CPPFLAGS="$cf_save"
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:7942: 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"
-
-	;;
-mirbsd*) #(vi
-	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks 
-	;;
-netbsd*) #(vi
-	# setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
-	;;
-openbsd*) #(vi
-	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
-	;;
-osf[45]*) #(vi
-	cf_xopen_source="-D_OSF_SOURCE"
-	;;
-nto-qnx*) #(vi
-	cf_xopen_source="-D_QNX_SOURCE"
-	;;
-sco*) #(vi
-	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
-	;;
-solaris2.1[0-9]) #(vi
-	cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
-	;;
-solaris2.[1-9]) #(vi
-	cf_xopen_source="-D__EXTENSIONS__"
-	;;
-*)
-	echo "$as_me:7972: 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 7979 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifndef _XOPEN_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:7994: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:7997: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8000: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8003: \$? = $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"
-	 cat >conftest.$ac_ext <<_ACEOF
-#line 8012 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifdef _XOPEN_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8027: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8030: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8033: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8036: \$? = $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_cv_xopen_source=$cf_XOPEN_SOURCE
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-	CPPFLAGS="$cf_save"
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:8051: result: $cf_cv_xopen_source" >&5
-echo "${ECHO_T}$cf_cv_xopen_source" >&6
-	if test "$cf_cv_xopen_source" != no ; then
-
-CFLAGS=`echo "$CFLAGS" | \
-	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
-
-CPPFLAGS=`echo "$CPPFLAGS" | \
-	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ 	]*\)\?$//g'`
-
-		cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-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
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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
-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
-	CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-	fi
-
-cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
-
-cf_save_CFLAGS="$CFLAGS"
-cf_save_CPPFLAGS="$CPPFLAGS"
-
-cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
-	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?[ 	]/ /g' \
-		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ 	]*\)\?$//g'`
-
-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:8158: 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}:8164: testing if the symbol is already defined go no further ..." 1>&5
-
-	cat >conftest.$ac_ext <<_ACEOF
-#line 8167 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifndef _POSIX_C_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8182: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8185: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8188: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8191: \$? = $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
-		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
-		;;
-	 .2) #(vi
-		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 8212 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifdef _POSIX_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8227: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8230: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8233: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8236: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-	 fi
-
-echo "${as_me:-configure}:8247: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
-
-	 CFLAGS="$cf_trim_CFLAGS"
-	 CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
-
-echo "${as_me:-configure}:8252: testing if the second compile does not leave our definition intact error ..." 1>&5
-
-	 cat >conftest.$ac_ext <<_ACEOF
-#line 8255 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-
-#ifndef _POSIX_C_SOURCE
-make an error
-#endif
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8270: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8273: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8276: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8279: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_posix_c_source=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-	 CFLAGS="$cf_save_CFLAGS"
-	 CPPFLAGS="$cf_save_CPPFLAGS"
-
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:8295: 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
-	CFLAGS="$cf_trim_CFLAGS"
-	CPPFLAGS="$cf_trim_CPPFLAGS"
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-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
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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
-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
-	CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-fi
-
-	;;
-esac
-
-if test -n "$cf_xopen_source" ; then
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-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
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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
-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
-	CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-fi
-
-# Check whether --enable-largefile or --disable-largefile was given.
-if test "${enable_largefile+set}" = set; then
-  enableval="$enable_largefile"
-
-fi;
-if test "$enable_largefile" != no; then
-
-  echo "$as_me:8474: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_sys_largefile_CC=no
-     if test "$GCC" != yes; then
-       ac_save_CC=$CC
-       while :; do
-     	 # IRIX 6.2 and later do not support large files by default,
-     	 # so use the C compiler's -n32 option if that helps.
-         cat >conftest.$ac_ext <<_ACEOF
-#line 8486 "configure"
-#include "confdefs.h"
-#include 
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-     	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8506: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8509: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8512: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8515: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext
-     	 CC="$CC -n32"
-     	 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8525: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8528: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8531: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8534: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_largefile_CC=' -n32'; break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext
-         break
-       done
-       CC=$ac_save_CC
-       rm -f conftest.$ac_ext
-    fi
-fi
-echo "$as_me:8548: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
-  if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
-  fi
-
-  echo "$as_me:8554: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  while :; do
-  ac_cv_sys_file_offset_bits=no
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8562 "configure"
-#include "confdefs.h"
-#include 
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8582: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8585: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8588: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8591: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8600 "configure"
-#include "confdefs.h"
-#define _FILE_OFFSET_BITS 64
-#include 
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8621: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8624: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8627: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8630: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_file_offset_bits=64; break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  break
-done
-fi
-echo "$as_me:8641: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
-
-cat >>confdefs.h <&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_large_files+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  while :; do
-  ac_cv_sys_large_files=no
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8659 "configure"
-#include "confdefs.h"
-#include 
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8679: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8682: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8685: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8688: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8697 "configure"
-#include "confdefs.h"
-#define _LARGE_FILES 1
-#include 
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8718: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8721: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8724: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8727: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_large_files=1; break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  break
-done
-fi
-echo "$as_me:8738: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
-
-cat >>confdefs.h <&5
-echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_source+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  while :; do
-  ac_cv_sys_largefile_source=no
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8759 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-return !fseeko;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8771: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8774: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8777: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8780: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8789 "configure"
-#include "confdefs.h"
-#define _LARGEFILE_SOURCE 1
-#include 
-int
-main ()
-{
-return !fseeko;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8802: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8805: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8808: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8811: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_largefile_source=1; break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-  break
-done
-fi
-echo "$as_me:8822: result: $ac_cv_sys_largefile_source" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
-if test "$ac_cv_sys_largefile_source" != no; then
-
-cat >>confdefs.h <&5
-echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
-if test "${ac_cv_func_fseeko+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 8842 "configure"
-#include "confdefs.h"
-#include 
-int
-main ()
-{
-return fseeko && fseeko (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:8854: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:8857: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:8860: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8863: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_fseeko=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_fseeko=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:8873: result: $ac_cv_func_fseeko" >&5
-echo "${ECHO_T}$ac_cv_func_fseeko" >&6
-if test $ac_cv_func_fseeko = yes; then
-
-cat >>confdefs.h <<\EOF
-#define HAVE_FSEEKO 1
-EOF
-
-fi
-
-	# Normally we would collect these definitions in the config.h,
-	# but (like _XOPEN_SOURCE), some environments rely on having these
-	# defined before any of the system headers are included.  Another
-	# case comes up with C++, e.g., on AIX the compiler compiles the
-	# header files by themselves before looking at the body files it is
-	# told to compile.  For ncurses, those header files do not include
-	# the config.h
-	test "$ac_cv_sys_large_files"      != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES "
-	test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE "
-	test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits "
-
-	echo "$as_me:8894: checking whether to use struct dirent64" >&5
-echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6
-if test "${cf_cv_struct_dirent64+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-		cat >conftest.$ac_ext <<_ACEOF
-#line 8901 "configure"
-#include "confdefs.h"
-
-#include 
-#include 
-
-int
-main ()
-{
-
-		/* if transitional largefile support is setup, this is true */
-		extern struct dirent64 * readdir(DIR *);
-		struct dirent64 *x = readdir((DIR *)0);
-		struct dirent *y = readdir((DIR *)0);
-		int z = x - y;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:8922: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:8925: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:8928: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:8931: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_struct_dirent64=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_struct_dirent64=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:8942: result: $cf_cv_struct_dirent64" >&5
-echo "${ECHO_T}$cf_cv_struct_dirent64" >&6
-	test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF
-#define HAVE_STRUCT_DIRENT64 1
-EOF
-
-    fi
-
-### Enable compiling-in rcs id's
-echo "$as_me:8951: checking if RCS identifiers should be compiled-in" >&5
-echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6
-
-# Check whether --with-rcs-ids or --without-rcs-ids was given.
-if test "${with_rcs_ids+set}" = set; then
-  withval="$with_rcs_ids"
-  with_rcs_ids=$withval
-else
-  with_rcs_ids=no
-fi;
-echo "$as_me:8961: result: $with_rcs_ids" >&5
-echo "${ECHO_T}$with_rcs_ids" >&6
-test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF
-#define USE_RCS_IDS 1
-EOF
-
-###############################################################################
-
-### Note that some functions (such as const) are normally disabled anyway.
-echo "$as_me:8970: checking if you want to build with function extensions" >&5
-echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6
-
-# Check whether --enable-ext-funcs or --disable-ext-funcs was given.
-if test "${enable_ext_funcs+set}" = set; then
-  enableval="$enable_ext_funcs"
-  with_ext_funcs=$enableval
-else
-  with_ext_funcs=yes
-fi;
-echo "$as_me:8980: result: $with_ext_funcs" >&5
-echo "${ECHO_T}$with_ext_funcs" >&6
-if test "$with_ext_funcs" = yes ; then
-	NCURSES_EXT_FUNCS=1
-	cat >>confdefs.h <<\EOF
-#define HAVE_USE_DEFAULT_COLORS 1
-EOF
-
-	cat >>confdefs.h <<\EOF
-#define NCURSES_EXT_FUNCS 1
-EOF
-
-else
-	NCURSES_EXT_FUNCS=0
-fi
-
-###   use option --enable-const to turn on use of const beyond that in XSI.
-echo "$as_me:8997: checking for extended use of const keyword" >&5
-echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6
-
-# Check whether --enable-const or --disable-const was given.
-if test "${enable_const+set}" = set; then
-  enableval="$enable_const"
-  with_ext_const=$enableval
-else
-  with_ext_const=no
-fi;
-echo "$as_me:9007: result: $with_ext_const" >&5
-echo "${ECHO_T}$with_ext_const" >&6
-NCURSES_CONST='/*nothing*/'
-if test "$with_ext_const" = yes ; then
-	NCURSES_CONST=const
-fi
-
-###############################################################################
-# These options are relatively safe to experiment with.
-
-echo "$as_me:9017: checking if you want all development code" >&5
-echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6
-
-# Check whether --with-develop or --without-develop was given.
-if test "${with_develop+set}" = set; then
-  withval="$with_develop"
-  with_develop=$withval
-else
-  with_develop=no
-fi;
-echo "$as_me:9027: result: $with_develop" >&5
-echo "${ECHO_T}$with_develop" >&6
-
-###############################################################################
-# These are just experimental, probably should not be in a package:
-
-# This is still experimental (20080329), but should ultimately be moved to
-# the script-block --with-normal, etc.
-
-echo "$as_me:9036: checking if you want to link with the pthread library" >&5
-echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6
-
-# Check whether --with-pthread or --without-pthread was given.
-if test "${with_pthread+set}" = set; then
-  withval="$with_pthread"
-  with_pthread=$withval
-else
-  with_pthread=no
-fi;
-echo "$as_me:9046: result: $with_pthread" >&5
-echo "${ECHO_T}$with_pthread" >&6
-
-if test "$with_pthread" != no ; then
-    echo "$as_me:9050: checking for pthread.h" >&5
-echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
-if test "${ac_cv_header_pthread_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 9056 "configure"
-#include "confdefs.h"
-#include 
-_ACEOF
-if { (eval echo "$as_me:9060: \"$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:9066: \$? = $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
-  ac_cv_header_pthread_h=yes
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_header_pthread_h=no
-fi
-rm -f conftest.err conftest.$ac_ext
-fi
-echo "$as_me:9085: result: $ac_cv_header_pthread_h" >&5
-echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
-if test $ac_cv_header_pthread_h = yes; then
-
-        cat >>confdefs.h <<\EOF
-#define HAVE_PTHREADS_H 1
-EOF
-
-        echo "$as_me:9093: checking if we can link with the pthread library" >&5
-echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6
-        cf_save_LIBS="$LIBS"
-        LIBS="-lpthread $LIBS"
-        cat >conftest.$ac_ext <<_ACEOF
-#line 9098 "configure"
-#include "confdefs.h"
-
-#include 
-
-int
-main ()
-{
-
-        int rc = pthread_create(0,0,0,0);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9114: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:9117: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9120: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9123: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  with_pthread=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-with_pthread=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-        LIBS="$cf_save_LIBS"
-        echo "$as_me:9133: result: $with_pthread" >&5
-echo "${ECHO_T}$with_pthread" >&6
-
-        if test "$with_pthread" = yes ; then
-            LIBS="-lpthread $LIBS"
-            cat >>confdefs.h <<\EOF
-#define HAVE_LIBPTHREADS 1
-EOF
-
-        else
-            { { echo "$as_me:9143: error: Cannot link with pthread library" >&5
-echo "$as_me: error: Cannot link with pthread library" >&2;}
-   { (exit 1); exit 1; }; }
-        fi
-
-fi
-
-fi
-
-echo "$as_me:9152: checking if you want to use weak-symbols for pthreads" >&5
-echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6
-
-# Check whether --enable-weak-symbols or --disable-weak-symbols was given.
-if test "${enable_weak_symbols+set}" = set; then
-  enableval="$enable_weak_symbols"
-  use_weak_symbols=$withval
-else
-  use_weak_symbols=no
-fi;
-echo "$as_me:9162: result: $use_weak_symbols" >&5
-echo "${ECHO_T}$use_weak_symbols" >&6
-if test "$use_weak_symbols" = yes ; then
-
-echo "$as_me:9166: checking if $CC supports weak symbols" >&5
-echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6
-if test "${cf_cv_weak_symbols+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-cat >conftest.$ac_ext <<_ACEOF
-#line 9173 "configure"
-#include "confdefs.h"
-
-#include 
-int
-main ()
-{
-
-#if defined(__GNUC__)
-#  if defined __USE_ISOC99
-#    define _cat_pragma(exp)	_Pragma(#exp)
-#    define _weak_pragma(exp)	_cat_pragma(weak name)
-#  else
-#    define _weak_pragma(exp)
-#  endif
-#  define _declare(name)	__extension__ extern __typeof__(name) name
-#  define weak_symbol(name)	_weak_pragma(name) _declare(name) __attribute__((weak))
-#endif
-
-weak_symbol(fopen);
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9199: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:9202: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9205: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9208: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_weak_symbols=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-cf_cv_weak_symbols=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:9219: result: $cf_cv_weak_symbols" >&5
-echo "${ECHO_T}$cf_cv_weak_symbols" >&6
-
-else
-    cf_cv_weak_symbols=no
-fi
-
-if test $cf_cv_weak_symbols = yes ; then
-    cat >>confdefs.h <<\EOF
-#define USE_WEAK_SYMBOLS 1
-EOF
-
-fi
-
-PTHREAD=
-if test "$with_pthread" = "yes" ; then
-    cat >>confdefs.h <<\EOF
-#define USE_PTHREADS 1
-EOF
-
-    enable_reentrant=yes
-    if test $cf_cv_weak_symbols = yes ; then
-        PTHREAD=-lpthread
-    fi
-fi
-
-# OpenSUSE is installing ncurses6, using reentrant option.
-echo "$as_me:9246: checking for _nc_TABSIZE" >&5
-echo $ECHO_N "checking for _nc_TABSIZE... $ECHO_C" >&6
-if test "${ac_cv_func__nc_TABSIZE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 9252 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char _nc_TABSIZE (); below.  */
-#include 
-/* 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_TABSIZE ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this 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__nc_TABSIZE) || defined (__stub____nc_TABSIZE)
-choke me
-#else
-f = _nc_TABSIZE;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9283: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:9286: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9289: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9292: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func__nc_TABSIZE=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func__nc_TABSIZE=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:9302: result: $ac_cv_func__nc_TABSIZE" >&5
-echo "${ECHO_T}$ac_cv_func__nc_TABSIZE" >&6
-if test $ac_cv_func__nc_TABSIZE = yes; then
-  assume_reentrant=yes
-else
-  assume_reentrant=no
-fi
-
-# Reentrant code has to be opaque; there's little advantage to making ncurses
-# opaque outside of that, so there is no --enable-opaque option.  We can use
-# this option without --with-pthreads, but this will be always set for
-# pthreads.
-echo "$as_me:9314: checking if you want experimental reentrant code" >&5
-echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6
-
-# Check whether --enable-reentrant or --disable-reentrant was given.
-if test "${enable_reentrant+set}" = set; then
-  enableval="$enable_reentrant"
-  with_reentrant=$enableval
-else
-  with_reentrant=$assume_reentrant
-fi;
-echo "$as_me:9324: result: $with_reentrant" >&5
-echo "${ECHO_T}$with_reentrant" >&6
-if test "$with_reentrant" = yes ; then
-	cf_cv_enable_reentrant=1
-	if test $cf_cv_weak_symbols = yes ; then
-
-# remove pthread library from $LIBS
-LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ 	]//g' -e 's/-lpthread$//'`
-
-	elif test "$assume_reentrant" = no ; then
-		LIB_SUFFIX="t${LIB_SUFFIX}"
-	fi
-	cat >>confdefs.h <<\EOF
-#define USE_REENTRANT 1
-EOF
-
-else
-	cf_cv_enable_reentrant=0
-fi
-
-### Allow using a different wrap-prefix
-if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
-	echo "$as_me:9346: checking for prefix used to wrap public variables" >&5
-echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6
-
-# Check whether --with-wrap-prefix or --without-wrap-prefix was given.
-if test "${with_wrap_prefix+set}" = set; then
-  withval="$with_wrap_prefix"
-  NCURSES_WRAP_PREFIX=$withval
-else
-  NCURSES_WRAP_PREFIX=_nc_
-fi;
-	echo "$as_me:9356: result: $NCURSES_WRAP_PREFIX" >&5
-echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
-else
-	NCURSES_WRAP_PREFIX=_nc_
-fi
-
-cat >>confdefs.h <&5
-echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6
-
-# Check whether --enable-echo or --disable-echo was given.
-if test "${enable_echo+set}" = set; then
-  enableval="$enable_echo"
-  with_echo=$enableval
-else
-  with_echo=yes
-fi;
-if test "$with_echo" = yes; then
-	ECHO_LINK=
-else
-	ECHO_LINK='@ echo linking $@ ... ;'
-fi
-echo "$as_me:9384: result: $with_echo" >&5
-echo "${ECHO_T}$with_echo" >&6
-
-###	use option --enable-warnings to turn on all gcc warnings
-echo "$as_me:9388: checking if you want to see compiler warnings" >&5
-echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6
-
-# Check whether --enable-warnings or --disable-warnings was given.
-if test "${enable_warnings+set}" = set; then
-  enableval="$enable_warnings"
-  with_warnings=$enableval
-fi;
-echo "$as_me:9396: result: $with_warnings" >&5
-echo "${ECHO_T}$with_warnings" >&6
-
-if test "x$with_warnings" = "xyes"; then
-
- 	ADAFLAGS="$ADAFLAGS -gnatg"
-
-INTEL_COMPILER=no
-
-if test "$GCC" = yes ; then
-	case $host_os in
-	linux*|gnu*)
-		echo "$as_me:9408: 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 9413 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-
-#ifdef __INTEL_COMPILER
-#else
-make an error
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:9430: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:9433: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:9436: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9439: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  INTEL_COMPILER=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
-
-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:9450: result: $INTEL_COMPILER" >&5
-echo "${ECHO_T}$INTEL_COMPILER" >&6
-		;;
-	esac
-fi
-
-cat > conftest.$ac_ext <&5
-echo "$as_me: checking for $CC warning options..." >&6;}
-	cf_save_CFLAGS="$CFLAGS"
-	EXTRA_CFLAGS="-Wall"
-	for cf_opt in \
-		wd1419 \
-		wd1683 \
-		wd1684 \
-		wd193 \
-		wd593 \
-		wd279 \
-		wd810 \
-		wd869 \
-		wd981
-	do
-		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:9490: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:9493: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:9495: 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
-then
-	{ echo "$as_me:9504: checking for $CC warning options..." >&5
-echo "$as_me: checking for $CC warning options..." >&6;}
-	cf_save_CFLAGS="$CFLAGS"
-	EXTRA_CFLAGS=
-	cf_warn_CONST=""
-	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
-	for cf_opt in W Wall \
-		Wbad-function-cast \
-		Wcast-align \
-		Wcast-qual \
-		Winline \
-		Wmissing-declarations \
-		Wmissing-prototypes \
-		Wnested-externs \
-		Wpointer-arith \
-		Wshadow \
-		Wstrict-prototypes \
-		Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum
-	do
-		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
-		if { (eval echo "$as_me:9524: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:9527: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:9529: result: ... -$cf_opt" >&5
-echo "${ECHO_T}... -$cf_opt" >&6
-			case $cf_opt in #(vi
-			Wcast-qual) #(vi
-				CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
-				;;
-			Winline) #(vi
-				case $GCC_VERSION in
-				[34].*)
-					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1>&6
-
-echo "${as_me:-configure}:9540: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
-
-					continue;;
-				esac
-				;;
-			esac
-			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
-		fi
-	done
-	CFLAGS="$cf_save_CFLAGS"
-fi
-rm -rf conftest*
-
-fi
-
-if test "$GCC" = yes
-then
-cat > conftest.i <&5
-echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
-cat > conftest.$ac_ext <&5
-
-		case $cf_attribute in #(vi
-		printf) #(vi
-			cf_printf_attribute=yes
-			cat >conftest.h <conftest.h <conftest.h <&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:9628: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-			test -n "$verbose" && echo "$as_me:9630: result: ... $cf_attribute" >&5
-echo "${ECHO_T}... $cf_attribute" >&6
-			cat conftest.h >>confdefs.h
-			case $cf_attribute in #(vi
-			printf) #(vi
-				if test "$cf_printf_attribute" = no ; then
-					cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h
-fi
-rm -rf conftest*
-fi
-
-###	use option --enable-assertions to turn on generation of assertion code
-echo "$as_me:9666: checking if you want to enable runtime assertions" >&5
-echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6
-
-# Check whether --enable-assertions or --disable-assertions was given.
-if test "${enable_assertions+set}" = set; then
-  enableval="$enable_assertions"
-  with_assertions=$enableval
-else
-  with_assertions=no
-fi;
-echo "$as_me:9676: result: $with_assertions" >&5
-echo "${ECHO_T}$with_assertions" >&6
-if test -n "$GCC"
-then
-	if test "$with_assertions" = no
-	then
-		cat >>confdefs.h <<\EOF
-#define NDEBUG 1
-EOF
-
-		CPPFLAGS="$CPPFLAGS -DNDEBUG"
-	else
-
- 	ADAFLAGS="$ADAFLAGS -gnata"
-
-	fi
-fi
-
-###	use option --disable-leaks to suppress "permanent" leaks, for testing
-cat >>confdefs.h <<\EOF
-#define HAVE_NC_ALLOC_H 1
-EOF
-
-###	use option --enable-expanded to generate certain macros as functions
-
-# Check whether --enable-expanded or --disable-expanded was given.
-if test "${enable_expanded+set}" = set; then
-  enableval="$enable_expanded"
-  test "$enableval" = yes && cat >>confdefs.h <<\EOF
-#define NCURSES_EXPANDED 1
-EOF
-
-fi;
-
-###	use option --disable-macros to suppress macros in favor of functions
-
-# Check whether --enable-macros or --disable-macros was given.
-if test "${enable_macros+set}" = set; then
-  enableval="$enable_macros"
-  test "$enableval" = no && cat >>confdefs.h <<\EOF
-#define NCURSES_NOMACROS 1
-EOF
-
-fi;
-
-# Normally we only add trace() to the debug-library.  Allow this to be
-# extended to all models of the ncurses library:
-cf_all_traces=no
-case "$CFLAGS $CPPFLAGS" in
-*-DTRACE*)
-	cf_all_traces=yes
-	;;
-esac
-
-echo "$as_me:9730: checking whether to add trace feature to all models" >&5
-echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6
-
-# Check whether --with-trace or --without-trace was given.
-if test "${with_trace+set}" = set; then
-  withval="$with_trace"
-  cf_with_trace=$withval
-else
-  cf_with_trace=$cf_all_traces
-fi;
-echo "$as_me:9740: result: $cf_with_trace" >&5
-echo "${ECHO_T}$cf_with_trace" >&6
-
-if test "$cf_with_trace" = yes ; then
-	ADA_TRACE=TRUE
-
-cf_fix_cppflags=no
-cf_new_cflags=
-cf_new_cppflags=
-cf_new_extra_cppflags=
-
-for cf_add_cflags in -DTRACE
-do
-case $cf_fix_cppflags in
-no)
-	case $cf_add_cflags in #(vi
-	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
-		case $cf_add_cflags in
-		-D*)
-			cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
-
-			test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-				&& test -z "${cf_tst_cflags}" \
-				&& cf_fix_cppflags=yes
-
-			if test $cf_fix_cppflags = yes ; then
-				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"
-				continue
-			fi
-			;;
-		esac
-		case "$CPPFLAGS" in
-		*$cf_add_cflags) #(vi
-			;;
-		*) #(vi
-			case $cf_add_cflags in #(vi
-			-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
-			cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
-			;;
-		esac
-		;;
-	*)
-		cf_new_cflags="$cf_new_cflags $cf_add_cflags"
-		;;
-	esac
-	;;
-yes)
-	cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
-
-	cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
-
-	test "${cf_add_cflags}" != "${cf_tst_cflags}" \
-		&& test -z "${cf_tst_cflags}" \
-		&& cf_fix_cppflags=no
-	;;
-esac
-done
-
-if test -n "$cf_new_cflags" ; then
-
-	CFLAGS="$CFLAGS $cf_new_cflags"
-fi
-
-if test -n "$cf_new_cppflags" ; then
-
-	CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
-fi
-
-if test -n "$cf_new_extra_cppflags" ; then
-
-	EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
-fi
-
-else
-	ADA_TRACE=FALSE
-fi
-
-###	Checks for libraries.
-case $cf_cv_system_name in #(vi
-*mingw32*) #(vi
-	;;
-*)
-echo "$as_me:9833: checking for gettimeofday" >&5
-echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
-if test "${ac_cv_func_gettimeofday+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 9839 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char gettimeofday (); below.  */
-#include 
-/* 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 gettimeofday ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this 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_gettimeofday) || defined (__stub___gettimeofday)
-choke me
-#else
-f = gettimeofday;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9870: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:9873: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9876: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9879: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_gettimeofday=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_gettimeofday=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:9889: result: $ac_cv_func_gettimeofday" >&5
-echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6
-if test $ac_cv_func_gettimeofday = yes; then
-  cat >>confdefs.h <<\EOF
-#define HAVE_GETTIMEOFDAY 1
-EOF
-
-else
-
-echo "$as_me:9898: checking for gettimeofday in -lbsd" >&5
-echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6
-if test "${ac_cv_lib_bsd_gettimeofday+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 9906 "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 gettimeofday ();
-int
-main ()
-{
-gettimeofday ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:9925: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:9928: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:9931: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:9934: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_bsd_gettimeofday=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_bsd_gettimeofday=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:9945: result: $ac_cv_lib_bsd_gettimeofday" >&5
-echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6
-if test $ac_cv_lib_bsd_gettimeofday = yes; then
-  cat >>confdefs.h <<\EOF
-#define HAVE_GETTIMEOFDAY 1
-EOF
-
-	LIBS="$LIBS -lbsd"
-fi
-
-fi
-	;;
-esac
-
-###	Checks for header files.
-echo "$as_me:9960: 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 9966 "configure"
-#include "confdefs.h"
-#include 
-#include 
-#include 
-#include 
-
-_ACEOF
-if { (eval echo "$as_me:9974: \"$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:9980: \$? = $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
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  ac_cv_header_stdc=no
-fi
-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 10002 "configure"
-#include "confdefs.h"
-#include 
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "memchr" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -rf conftest*
-
-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 10020 "configure"
-#include "confdefs.h"
-#include 
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  egrep "free" >/dev/null 2>&1; then
-  :
-else
-  ac_cv_header_stdc=no
-fi
-rm -rf conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then
-  :
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 10041 "configure"
-#include "confdefs.h"
-#include 
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
-                     || ('j' <= (c) && (c) <= 'r') \
-                     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-        || toupper (i) != TOUPPER (i))
-      $ac_main_return(2);
-  $ac_main_return (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:10067: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:10070: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:10072: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10075: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_header_stdc=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:10088: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\EOF
-#define STDC_HEADERS 1
-EOF
-
-fi
-
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
-  as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-echo "$as_me:10101: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 10107 "configure"
-#include "confdefs.h"
-#include 
-#include <$ac_hdr>
-
-int
-main ()
-{
-if ((DIR *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10122: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10125: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10128: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10131: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; 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.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:10141: 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 <&5
-echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6
-if test "${ac_cv_lib_dir_opendir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldir  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 10162 "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 opendir ();
-int
-main ()
-{
-opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10181: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:10184: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10187: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10190: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_dir_opendir=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_dir_opendir=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:10201: result: $ac_cv_lib_dir_opendir" >&5
-echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6
-if test $ac_cv_lib_dir_opendir = yes; then
-  LIBS="$LIBS -ldir"
-fi
-
-else
-  echo "$as_me:10208: checking for opendir in -lx" >&5
-echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6
-if test "${ac_cv_lib_x_opendir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lx  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-#line 10216 "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 opendir ();
-int
-main ()
-{
-opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10235: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:10238: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10241: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10244: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_x_opendir=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_lib_x_opendir=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:10255: result: $ac_cv_lib_x_opendir" >&5
-echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6
-if test $ac_cv_lib_x_opendir = yes; then
-  LIBS="$LIBS -lx"
-fi
-
-fi
-
-echo "$as_me:10263: 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 10269 "configure"
-#include "confdefs.h"
-#include 
-#include 
-#include 
-
-int
-main ()
-{
-if ((struct tm *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10285: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10288: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10291: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10294: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_time=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_header_time=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:10304: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6
-if test $ac_cv_header_time = yes; then
-
-cat >>confdefs.h <<\EOF
-#define TIME_WITH_SYS_TIME 1
-EOF
-
-fi
-
-###	checks for compiler characteristics
-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:10322: 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
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-#line 10330 "configure"
-#include "confdefs.h"
-#include 
-#include 
-#include 
-#include 
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX 10.20 and later	-Ae
-# HP-UX older versions	-Aa -D_HPUX_SOURCE
-# SVR4			-Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10379: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10382: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10385: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10388: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-fi
-rm -f conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:10405: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:10408: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-echo "$as_me:10413: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
-if test "${ac_cv_c_const+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 10419 "configure"
-#include "confdefs.h"
-
-int
-main ()
-{
-/* FIXME: Include the comments suggested by Paul. */
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
-  typedef int charset[2];
-  const charset x;
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-  }
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10477: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10480: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10483: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10486: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_const=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_c_const=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:10496: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\EOF
-#define const
-EOF
-
-fi
-
-###	Checks for external-data
-
-echo "$as_me:10508: checking if data-only library module links" >&5
-echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6
-if test "${cf_cv_link_dataonly+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-	rm -f conftest.a
-	cat >conftest.$ac_ext <&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10522: \$? = $ac_status" >&5
-  (exit $ac_status); } ; then
-		mv conftest.o data.o && \
-		( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null
-	fi
-	rm -f conftest.$ac_ext data.o
-	cat >conftest.$ac_ext <&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10545: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-		mv conftest.o func.o && \
-		( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null
-	fi
-	rm -f conftest.$ac_ext func.o
-	( eval $RANLIB conftest.a ) 2>&5 >/dev/null
-	cf_saveLIBS="$LIBS"
-	LIBS="conftest.a $LIBS"
-	if test "$cross_compiling" = yes; then
-  cf_cv_link_dataonly=unknown
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 10558 "configure"
-#include "confdefs.h"
-
-	int main()
-	{
-		extern int testfunc();
-		${cf_cv_main_return:-return} (!testfunc());
-	}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:10569: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:10572: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:10574: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10577: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_link_dataonly=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_cv_link_dataonly=no
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-	LIBS="$cf_saveLIBS"
-
-fi
-
-echo "$as_me:10592: result: $cf_cv_link_dataonly" >&5
-echo "${ECHO_T}$cf_cv_link_dataonly" >&6
-
-if test "$cf_cv_link_dataonly" = no ; then
-	cat >>confdefs.h <<\EOF
-#define BROKEN_LINKER 1
-EOF
-
-	BROKEN_LINKER=1
-fi
-
-###	Checks for library functions.
-
-echo "$as_me:10605: checking for working mkstemp" >&5
-echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
-if test "${cf_cv_func_mkstemp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-rm -rf conftest*
-if test "$cross_compiling" = yes; then
-  echo "$as_me:10613: checking for mkstemp" >&5
-echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
-if test "${ac_cv_func_mkstemp+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 10619 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char mkstemp (); below.  */
-#include 
-/* 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 mkstemp ();
-char (*f) ();
-
-int
-main ()
-{
-/* The GNU C library defines this 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_mkstemp) || defined (__stub___mkstemp)
-choke me
-#else
-f = mkstemp;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:10650: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:10653: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:10656: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10659: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_mkstemp=yes
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_func_mkstemp=no
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:10669: result: $ac_cv_func_mkstemp" >&5
-echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
-
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 10674 "configure"
-#include "confdefs.h"
-
-#include 
-#include 
-#include 
-#include 
-#include 
-int main()
-{
-	char *tmpl = "conftestXXXXXX";
-	char name[2][80];
-	int n;
-	int result = 0;
-	int fd;
-	struct stat sb;
-
-	umask(077);
-	for (n = 0; n < 2; ++n) {
-		strcpy(name[n], tmpl);
-		if ((fd = mkstemp(name[n])) >= 0) {
-			if (!strcmp(name[n], tmpl)
-			 || stat(name[n], &sb) != 0
-			 || (sb.st_mode & S_IFMT) != S_IFREG
-			 || (sb.st_mode & 077) != 0) {
-				result = 1;
-			}
-			close(fd);
-		}
-	}
-	if (result == 0
-	 && !strcmp(name[0], name[1]))
-		result = 1;
-	${cf_cv_main_return:-return}(result);
-}
-
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:10712: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:10715: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:10717: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10720: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  cf_cv_func_mkstemp=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_cv_func_mkstemp=no
-
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-fi
-echo "$as_me:10735: result: $cf_cv_func_mkstemp" >&5
-echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
-if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then
-	cat >>confdefs.h <<\EOF
-#define HAVE_MKSTEMP 1
-EOF
-
-fi
-
-echo "$as_me:10744: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
-if test "${ac_cv_type_signal+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line 10750 "configure"
-#include "confdefs.h"
-#include 
-#include 
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
-
-int
-main ()
-{
-int i;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:10772: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:10775: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:10778: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:10781: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_signal=void
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-ac_cv_type_signal=int
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:10791: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
-
-cat >>confdefs.h <&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_gnat_exists+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$gnat_exists"; then
-  ac_cv_prog_gnat_exists="$gnat_exists" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_gnat_exists="yes"
-echo "$as_me:10823: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_gnat_exists" && ac_cv_prog_gnat_exists="no"
-fi
-fi
-gnat_exists=$ac_cv_prog_gnat_exists
-if test -n "$gnat_exists"; then
-  echo "$as_me:10832: result: $gnat_exists" >&5
-echo "${ECHO_T}$gnat_exists" >&6
-else
-  echo "$as_me:10835: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-if test "$ac_cv_prog_gnat_exists" = no; then
-   cf_ada_make=
-else
-
-echo "$as_me:10843: checking for gnat version" >&5
-echo $ECHO_N "checking for gnat version... $ECHO_C" >&6
-cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \
-	grep '[0-9].[0-9][0-9]*' |\
-    sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'`
-echo "$as_me:10848: result: $cf_gnat_version" >&5
-echo "${ECHO_T}$cf_gnat_version" >&6
-
-case $cf_gnat_version in #(vi
-3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi
-	cf_cv_prog_gnat_correct=yes
-	;;
-*)
-	{ echo "$as_me:10856: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5
-echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;}
-	cf_cv_prog_gnat_correct=no
-	;;
-esac
-
-   # Extract the first word of "m4", so it can be a program name with args.
-set dummy m4; ac_word=$2
-echo "$as_me:10864: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_M4_exists+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$M4_exists"; then
-  ac_cv_prog_M4_exists="$M4_exists" # Let the user override the test.
-else
-  ac_save_IFS=$IFS; IFS=$ac_path_separator
-ac_dummy="$PATH"
-for ac_dir in $ac_dummy; do
-  IFS=$ac_save_IFS
-  test -z "$ac_dir" && ac_dir=.
-  $as_executable_p "$ac_dir/$ac_word" || continue
-ac_cv_prog_M4_exists="yes"
-echo "$as_me:10879: found $ac_dir/$ac_word" >&5
-break
-done
-
-  test -z "$ac_cv_prog_M4_exists" && ac_cv_prog_M4_exists="no"
-fi
-fi
-M4_exists=$ac_cv_prog_M4_exists
-if test -n "$M4_exists"; then
-  echo "$as_me:10888: result: $M4_exists" >&5
-echo "${ECHO_T}$M4_exists" >&6
-else
-  echo "$as_me:10891: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-   if test "$ac_cv_prog_M4_exists" = no; then
-      cf_cv_prog_gnat_correct=no
-      echo Ada95 binding required program m4 not found. Ada95 binding disabled.
-   fi
-   if test "$cf_cv_prog_gnat_correct" = yes; then
-      echo "$as_me:10900: checking if GNAT works" >&5
-echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6
-
-rm -rf conftest* *~conftest*
-cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then
-   if ( ./conftest 1>&5 2>&1 ) ; then
-      cf_cv_prog_gnat_correct=yes
-   else
-      cf_cv_prog_gnat_correct=no
-   fi
-else
-   cf_cv_prog_gnat_correct=no
-fi
-rm -rf conftest* *~conftest*
-
-      echo "$as_me:10928: result: $cf_cv_prog_gnat_correct" >&5
-echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6
-   fi
-fi
-
-	if test	"$cf_cv_prog_gnat_correct" = yes; then
-
-		# make ADAFLAGS consistent with CFLAGS
-		case "$CFLAGS" in
-		*-g*)
-
- 	ADAFLAGS="$ADAFLAGS -g"
-
-			;;
-		esac
-		case "$CFLAGS" in
-		*-O*)
-
- 	ADAFLAGS="$ADAFLAGS -O3"
-
-			;;
-		esac
-
-echo "$as_me:10951: checking if GNAT supports generics" >&5
-echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6
-case $cf_gnat_version in #(vi
-3.[1-9]*|[4-9].*) #(vi
-	cf_gnat_generics=yes
-	;;
-*)
-	cf_gnat_generics=no
-	;;
-esac
-echo "$as_me:10961: result: $cf_gnat_generics" >&5
-echo "${ECHO_T}$cf_gnat_generics" >&6
-
-if test "$cf_gnat_generics" = yes
-then
-	cf_compile_generics=generics
-	cf_generic_objects="\${GENOBJS}"
-else
-	cf_compile_generics=
-	cf_generic_objects=
-fi
-
-echo "$as_me:10973: checking if GNAT supports SIGINT" >&5
-echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6
-if test "${cf_cv_gnat_sigint+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-rm -rf conftest* *~conftest*
-cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then
-      cf_cv_gnat_sigint=yes
-else
-   cf_cv_gnat_sigint=no
-fi
-rm -rf conftest* *~conftest*
-
-fi
-echo "$as_me:11021: result: $cf_cv_gnat_sigint" >&5
-echo "${ECHO_T}$cf_cv_gnat_sigint" >&6
-
-if test $cf_cv_gnat_sigint = yes ; then
-	USE_GNAT_SIGINT=""
-else
-	USE_GNAT_SIGINT="#"
-fi
-
-echo "$as_me:11030: checking if GNAT pragma Unreferenced works" >&5
-echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6
-if test "${cf_cv_pragma_unreferenced+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-rm -rf conftest* *~conftest*
-cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then
-      cf_cv_pragma_unreferenced=yes
-else
-   cf_cv_pragma_unreferenced=no
-fi
-rm -rf conftest* *~conftest*
-
-fi
-echo "$as_me:11061: result: $cf_cv_pragma_unreferenced" >&5
-echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6
-
-# if the pragma is supported, use it (needed in the Trace code).
-if test $cf_cv_pragma_unreferenced = yes ; then
-	PRAGMA_UNREF=TRUE
-else
-	PRAGMA_UNREF=FALSE
-fi
-
-cf_gnat_libraries=no
-cf_gnat_projects=no
-
-echo "$as_me:11074: checking if GNAT supports project files" >&5
-echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6
-case $cf_gnat_version in #(vi
-3.[0-9]*) #(vi
-	;;
-*)
-	case $cf_cv_system_name in #(vi
-	cygwin*) #(vi
-		;;
-	*)
-		mkdir conftest.src conftest.bin conftest.lib
-		cd conftest.src
-		rm -rf conftest* *~conftest*
-		cat >>library.gpr <>confpackage.ads <>confpackage.adb <&5 2>&1 ) ; then
-			cf_gnat_projects=yes
-		fi
-		cd ..
-		if test -f conftest.lib/confpackage.ali
-		then
-			cf_gnat_libraries=yes
-		fi
-		rm -rf conftest* *~conftest*
-		;;
-	esac
-	;;
-esac
-echo "$as_me:11142: result: $cf_gnat_projects" >&5
-echo "${ECHO_T}$cf_gnat_projects" >&6
-
-if test $cf_gnat_projects = yes
-then
-	echo "$as_me:11147: checking if GNAT supports libraries" >&5
-echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6
-	echo "$as_me:11149: result: $cf_gnat_libraries" >&5
-echo "${ECHO_T}$cf_gnat_libraries" >&6
-fi
-
-if test "$cf_gnat_projects" = yes
-then
-	USE_OLD_MAKERULES="#"
-	USE_GNAT_PROJECTS=""
-else
-	USE_OLD_MAKERULES=""
-	USE_GNAT_PROJECTS="#"
-fi
-
-if test "$cf_gnat_libraries" = yes
-then
-	USE_GNAT_LIBRARIES=""
-else
-	USE_GNAT_LIBRARIES="#"
-fi
-
-echo "$as_me:11169: checking for ada-compiler" >&5
-echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6
-
-# Check whether --with-ada-compiler or --without-ada-compiler was given.
-if test "${with_ada_compiler+set}" = set; then
-  withval="$with_ada_compiler"
-  cf_ada_compiler=$withval
-else
-  cf_ada_compiler=gnatmake
-fi;
-
-echo "$as_me:11180: result: $cf_ada_compiler" >&5
-echo "${ECHO_T}$cf_ada_compiler" >&6
-
-		cf_ada_package=terminal_interface
-
-echo "$as_me:11185: checking for ada-include" >&5
-echo $ECHO_N "checking for ada-include... $ECHO_C" >&6
-
-# Check whether --with-ada-include or --without-ada-include was given.
-if test "${with_ada_include+set}" = set; then
-  withval="$with_ada_include"
-
-else
-  withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}"
-fi; if test -n "$prefix/share/ada/adainclude" ; then
-
-if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
-else
-  cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".$withval" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
-  ;;
-.\${*prefix}*) #(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:11221: error: expected a pathname, not \"$withval\"" >&5
-echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-fi
-ADA_INCLUDE="$withval"
-
-echo "$as_me:11230: result: $ADA_INCLUDE" >&5
-echo "${ECHO_T}$ADA_INCLUDE" >&6
-
-echo "$as_me:11233: checking for ada-objects" >&5
-echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6
-
-# Check whether --with-ada-objects or --without-ada-objects was given.
-if test "${with_ada_objects+set}" = set; then
-  withval="$with_ada_objects"
-
-else
-  withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}"
-fi; if test -n "$prefix/lib/ada/adalib" ; then
-
-if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
-else
-  cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".$withval" in #(vi
-.\$\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
-  ;;
-.\${*prefix}*) #(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:11269: error: expected a pathname, not \"$withval\"" >&5
-echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-fi
-ADA_OBJECTS="$withval"
-
-echo "$as_me:11278: result: $ADA_OBJECTS" >&5
-echo "${ECHO_T}$ADA_OBJECTS" >&6
-
-echo "$as_me:11281: checking if an Ada95 shared-library should be built" >&5
-echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6
-
-# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given.
-if test "${with_ada_sharedlib+set}" = set; then
-  withval="$with_ada_sharedlib"
-  with_ada_sharedlib=$withval
-else
-  with_ada_sharedlib=no
-fi;
-echo "$as_me:11291: result: $with_ada_sharedlib" >&5
-echo "${ECHO_T}$with_ada_sharedlib" >&6
-
-ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
-MAKE_ADA_SHAREDLIB="#"
-
-if test "x$with_ada_sharedlib" != xno
-then
-	MAKE_ADA_SHAREDLIB=
-	if test "x$with_ada_sharedlib" != xyes
-	then
-		ADA_SHAREDLIB="$with_ada_sharedlib"
-	fi
-fi
-
-	else
-		{ { echo "$as_me:11307: error: No usable Ada compiler found" >&5
-echo "$as_me: error: No usable Ada compiler found" >&2;}
-   { (exit 1); exit 1; }; }
-	fi
-else
-	{ { echo "$as_me:11312: error: The Ada compiler is needed for this package" >&5
-echo "$as_me: error: The Ada compiler is needed for this package" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-
-################################################################################
-
-# not needed
-TINFO_ARGS2=
-
-### Construct the list of include-directories to be generated
-
-CPPFLAGS="$CPPFLAGS -I. -I../include"
-if test "$srcdir" != "."; then
-	CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include"
-fi
-if test "$GCC" != yes; then
-	CPPFLAGS="$CPPFLAGS -I\${includedir}"
-elif test "$includedir" != "/usr/include"; then
-	if test "$includedir" = '${prefix}/include' ; then
-		if test $prefix != /usr ; then
-			CPPFLAGS="$CPPFLAGS -I\${includedir}"
-		fi
-	else
-		CPPFLAGS="$CPPFLAGS -I\${includedir}"
-	fi
-fi
-
-ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS"
-if test "$srcdir" != "."; then
-	ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS"
-fi
-if test "$GCC" != yes; then
-	ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
-elif test "$includedir" != "/usr/include"; then
-	if test "$includedir" = '${prefix}/include' ; then
-		if test $prefix != /usr ; then
-			ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
-		fi
-	else
-		ACPPFLAGS="$ACPPFLAGS -I\${includedir}"
-	fi
-fi
-
-### Build up pieces for makefile rules
-echo "$as_me:11357: checking default library suffix" >&5
-echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
-
-	case $DFT_LWR_MODEL in
-	libtool) DFT_ARG_SUFFIX=''   ;;
-	normal)  DFT_ARG_SUFFIX=''   ;;
-	debug)   DFT_ARG_SUFFIX='_g' ;;
-	profile) DFT_ARG_SUFFIX='_p' ;;
-	shared)  DFT_ARG_SUFFIX=''   ;;
-	esac
-	test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
-echo "$as_me:11368: result: $DFT_ARG_SUFFIX" >&5
-echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
-
-echo "$as_me:11371: checking default library-dependency suffix" >&5
-echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
-
-	case $DFT_LWR_MODEL in #(vi
-	libtool) #(vi
-		DFT_LIB_SUFFIX='.la'
-		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-		;;
-	normal) #(vi
-		DFT_LIB_SUFFIX='.a'
-		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-		;;
-	debug) #(vi
-		DFT_LIB_SUFFIX='_g.a'
-		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-		;;
-	profile) #(vi
-		DFT_LIB_SUFFIX='_p.a'
-		DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-		;;
-	shared) #(vi
-		case $cf_cv_system_name in
-		aix[56]*) #(vi
-			DFT_LIB_SUFFIX='.a'
-			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-			;;
-		cygwin*) #(vi
-			DFT_LIB_SUFFIX='.dll'
-			DFT_DEP_SUFFIX='.dll.a'
-			;;
-		darwin*) #(vi
-			DFT_LIB_SUFFIX='.dylib'
-			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-			;;
-		hpux*) #(vi
-			case $target in
-			ia64*) #(vi
-				DFT_LIB_SUFFIX='.so'
-				DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-				;;
-			*) #(vi
-				DFT_LIB_SUFFIX='.sl'
-				DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-				;;
-			esac
-			;;
-		*)	DFT_LIB_SUFFIX='.so'
-			DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX
-			;;
-		esac
-	esac
-	test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}"
-	test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}"
-echo "$as_me:11424: result: $DFT_DEP_SUFFIX" >&5
-echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
-
-echo "$as_me:11427: checking default object directory" >&5
-echo $ECHO_N "checking default object directory... $ECHO_C" >&6
-
-	case $DFT_LWR_MODEL in
-	libtool) DFT_OBJ_SUBDIR='obj_lo'  ;;
-	normal)  DFT_OBJ_SUBDIR='objects' ;;
-	debug)   DFT_OBJ_SUBDIR='obj_g' ;;
-	profile) DFT_OBJ_SUBDIR='obj_p' ;;
-	shared)
-		case $cf_cv_system_name in #(vi
-		cygwin) #(vi
-			DFT_OBJ_SUBDIR='objects' ;;
-		*)
-			DFT_OBJ_SUBDIR='obj_s' ;;
-		esac
-	esac
-echo "$as_me:11443: result: $DFT_OBJ_SUBDIR" >&5
-echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
-
-### Set up low-level terminfo dependencies for makefiles.
-
-if test "$DFT_LWR_MODEL" = shared ; then
-	case $cf_cv_system_name in #(vi
-	cygwin*)
-		# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
-		;;
-	esac
-fi
-
-### Construct the list of subdirectories for which we'll customize makefiles
-### with the appropriate compile-rules.
-
-SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
-
-cat >>confdefs.h <confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overriden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-{
-  (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
-      # `set' does not quote correctly, so add quotes (double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \).
-      sed -n \
-        "s/'/'\\\\''/g;
-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
-      ;;
-    esac;
-} |
-  sed '
-     t clear
-     : clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if cmp -s $cache_file confcache; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
-    cat confcache >$cache_file
-  else
-    echo "not updating unwritable cache $cache_file"
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ 	]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ 	]*$//;
-}'
-fi
-
-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:11659: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
-#! $SHELL
-# Generated automatically by configure.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-ac_cs_invocation="\$0 \$@"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
-fi
-
-# Name of the executable.
-as_me=`echo "$0" |sed 's,.*[\\/],,'`
-
-if expr a : '\(a\)' >/dev/null 2>&1; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-rm -f conf$$ conf$$.exe conf$$.file
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
-    as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
-else
-  as_ln_s='cp -p'
-fi
-rm -f conf$$ conf$$.exe conf$$.file
-
-as_executable_p="test -f"
-
-# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
-  as_unset=unset
-else
-  as_unset=false
-fi
-
-# NLS nuisances.
-$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
-$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
-$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
-$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
-$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
-$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
-$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
-$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
-
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" 	$as_nl"
-
-# CDPATH.
-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
-
-exec 6>&1
-
-_ACEOF
-
-# Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
-
-cat >>$CONFIG_STATUS <<\EOF
-
-ac_cs_usage="\
-\`$as_me' instantiates files from templates according to the
-current configuration.
-
-Usage: $0 [OPTIONS] [FILE]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to ."
-EOF
-
-cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
-    shift
-    set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
-    shift
-    ;;
-  -*);;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_need_defaults=false;;
-  esac
-
-  case $1 in
-  # Handling of the options.
-EOF
-cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:11835: 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;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    shift
-    CONFIG_FILES="$CONFIG_FILES $1"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $1"
-    ac_need_defaults=false;;
-
-  # This is an error.
-  -*) { { echo "$as_me:11854: 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;}
-   { (exit 1); exit 1; }; } ;;
-
-  *) ac_config_targets="$ac_config_targets $1" ;;
-
-  esac
-  shift
-done
-
-exec 5>>config.log
-cat >&5 << _ACEOF
-
-## ----------------------- ##
-## Running config.status.  ##
-## ----------------------- ##
-
-This file was extended by $as_me 2.52.20101002, executed with
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  > $ac_cs_invocation
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-
-_ACEOF
-EOF
-
-cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF
-for ac_config_target in $ac_config_targets
-do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;;
-  "doc/adacurses${DFT_ARG_SUFFIX}-config.1" ) CONFIG_FILES="$CONFIG_FILES doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in" ;;
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
-  "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
-  *) { { echo "$as_me:11925: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Create a temporary directory, and hook for its removal unless debugging.
-$debug ||
-{
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
-  trap '{ (exit 1); exit 1; }' 1 2 13 15
-}
-
-# Create a (secure) tmp directory for tmp files.
-: ${TMPDIR=/tmp}
-{
-  tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
-}  ||
-{
-  tmp=$TMPDIR/cs$$-$RANDOM
-  (umask 077 && mkdir $tmp)
-} ||
-{
-   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
-   { (exit 1); exit 1; }
-}
-
-EOF
-
-cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@DEFS@,$DEFS,;t t
-s,@LIBS@,$LIBS,;t t
-s,@top_builddir@,$top_builddir,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@target@,$target,;t t
-s,@target_cpu@,$target_cpu,;t t
-s,@target_vendor@,$target_vendor,;t t
-s,@target_os@,$target_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@CPP@,$CPP,;t t
-s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
-s,@PROG_EXT@,$PROG_EXT,;t t
-s,@AWK@,$AWK,;t t
-s,@EGREP@,$EGREP,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@LN_S@,$LN_S,;t t
-s,@PKG_CONFIG@,$PKG_CONFIG,;t t
-s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
-s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@CTAGS@,$CTAGS,;t t
-s,@ETAGS@,$ETAGS,;t t
-s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
-s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
-s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@LD@,$LD,;t t
-s,@ac_ct_LD@,$ac_ct_LD,;t t
-s,@AR@,$AR,;t t
-s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@ARFLAGS@,$ARFLAGS,;t t
-s,@DESTDIR@,$DESTDIR,;t t
-s,@BUILD_CC@,$BUILD_CC,;t t
-s,@BUILD_CPP@,$BUILD_CPP,;t t
-s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t
-s,@BUILD_CPPFLAGS@,$BUILD_CPPFLAGS,;t t
-s,@BUILD_LDFLAGS@,$BUILD_LDFLAGS,;t t
-s,@BUILD_LIBS@,$BUILD_LIBS,;t t
-s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t
-s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t
-s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t
-s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
-s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
-s,@NCURSES_MAJOR@,$NCURSES_MAJOR,;t t
-s,@NCURSES_MINOR@,$NCURSES_MINOR,;t t
-s,@NCURSES_PATCH@,$NCURSES_PATCH,;t t
-s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
-s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
-s,@cf_cv_builtin_bool@,$cf_cv_builtin_bool,;t t
-s,@cf_cv_header_stdbool_h@,$cf_cv_header_stdbool_h,;t t
-s,@cf_cv_type_of_bool@,$cf_cv_type_of_bool,;t t
-s,@LIB_PREFIX@,$LIB_PREFIX,;t t
-s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t
-s,@CC_G_OPT@,$CC_G_OPT,;t t
-s,@LD_MODEL@,$LD_MODEL,;t t
-s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
-s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t
-s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
-s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t
-s,@LINK_PROGS@,$LINK_PROGS,;t t
-s,@LINK_TESTS@,$LINK_TESTS,;t t
-s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
-s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
-s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t
-s,@INSTALL_LIB@,$INSTALL_LIB,;t t
-s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t
-s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t
-s,@NCURSES_CONST@,$NCURSES_CONST,;t t
-s,@PTHREAD@,$PTHREAD,;t t
-s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t
-s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
-s,@ECHO_LINK@,$ECHO_LINK,;t t
-s,@ADAFLAGS@,$ADAFLAGS,;t t
-s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
-s,@ADA_TRACE@,$ADA_TRACE,;t t
-s,@gnat_exists@,$gnat_exists,;t t
-s,@M4_exists@,$M4_exists,;t t
-s,@cf_ada_make@,$cf_ada_make,;t t
-s,@cf_compile_generics@,$cf_compile_generics,;t t
-s,@cf_generic_objects@,$cf_generic_objects,;t t
-s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t
-s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t
-s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t
-s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t
-s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t
-s,@cf_ada_compiler@,$cf_ada_compiler,;t t
-s,@cf_ada_package@,$cf_ada_package,;t t
-s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t
-s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t
-s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t
-s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t
-s,@TINFO_ARGS2@,$TINFO_ARGS2,;t t
-s,@ACPPFLAGS@,$ACPPFLAGS,;t t
-s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t
-s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
-s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
-s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t
-s,@cross_compiling@,$cross_compiling,;t t
-s,@TEST_ARG2@,$TEST_ARG2,;t t
-s,@TEST_LIBS2@,$TEST_LIBS2,;t t
-s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t
-s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t
-s,@NCURSES_TREE@,$NCURSES_TREE,;t t
-s,@EXTERNAL_TREE@,$EXTERNAL_TREE,;t t
-s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t
-CEOF
-
-EOF
-
-  cat >>$CONFIG_STATUS <<\EOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # 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
-      if test -z "$ac_sed_cmds"; then
-  	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"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
-  fi
-fi # test -n "$CONFIG_FILES"
-
-EOF
-cat >>$CONFIG_STATUS <<\EOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-    { case "$ac_dir" in
-  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
-  *)                      as_incr_dir=.;;
-esac
-as_dummy="$ac_dir"
-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
-  case $as_mkdir_dir in
-    # Skip DOS drivespec
-    ?:) as_incr_dir=$as_mkdir_dir ;;
-    *)
-      as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
-    ;;
-  esac
-done; }
-
-    ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
-    # A "../" for each directory in $ac_dir_suffix.
-    ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
-  else
-    ac_dir_suffix= ac_dots=
-  fi
-
-  case $srcdir in
-  .)  ac_srcdir=.
-      if test -z "$ac_dots"; then
-         ac_top_srcdir=.
-      else
-         ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
-      fi ;;
-  [\\/]* | ?:[\\/]* )
-      ac_srcdir=$srcdir$ac_dir_suffix;
-      ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_dots$srcdir ;;
-  esac
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_dots$INSTALL ;;
-  esac
-
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:12240: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated automatically by config.status.  */
-  configure_input="Generated automatically from `echo $ac_file_in |
-                                                 sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:12258: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         echo $f;;
-      *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:12271: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-EOF
-cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-EOF
-cat >>$CONFIG_STATUS <<\EOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
-ac_dB='[ 	].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_iA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_iB='\([ 	]\),\1#\2define\3'
-ac_iC=' '
-ac_iD='\4,;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-        cat >$tmp/stdin
-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
-  esac
-
-  test x"$ac_file" != x- && { echo "$as_me:12337: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-         # Absolute (can't be DOS-style, as IFS=:)
-         test -f "$f" || { { echo "$as_me:12348: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         echo $f;;
-      *) # Relative
-         if test -f "$f"; then
-           # Build tree
-           echo $f
-         elif test -f "$srcdir/$f"; then
-           # Source tree
-           echo $srcdir/$f
-         else
-           # /dev/null tree
-           { { echo "$as_me:12361: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-         fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
-
-EOF
-
-# Transform confdefs.h into a list of #define's.  We won't use it as a sed
-# script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
-# be either 'cat' or 'sort'.
-cat confdefs.h | uniq >conftest.vals
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-
-rm -f conftest.tail
-echo '  rm -f conftest.frag' >> $CONFIG_STATUS
-while grep . conftest.vals >/dev/null
-do
-  # Write chunks of a limited-size here document to conftest.frag.
-  echo '  cat >> conftest.frag <> $CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
-  echo 'CEOF' >> $CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
-  rm -f conftest.vals
-  mv conftest.tail conftest.vals
-done
-rm -f conftest.vals
-
-# Run sed to substitute the contents of conftest.frag into $tmp/in at the
-# marker @DEFS@.
-echo '  cat >> conftest.edit < $tmp/out
-rm -f $tmp/in
-mv $tmp/out $tmp/in
-rm -f conftest.edit conftest.frag
-' >> $CONFIG_STATUS
-
-cat >>$CONFIG_STATUS <<\EOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated automatically by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated automatically by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  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:12419: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-         X"$ac_file" : 'X\(//\)[^/]' \| \
-         X"$ac_file" : 'X\(//\)$' \| \
-         X"$ac_file" : 'X\(/\)' \| \
-         .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-  	  /^X\(\/\/\)$/{ s//\1/; q; }
-  	  /^X\(\/\).*/{ s//\1/; q; }
-  	  s/.*/./; q'`
-      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
-        { case "$ac_dir" in
-  [\\/]* | ?:[\\/]* ) as_incr_dir=;;
-  *)                      as_incr_dir=.;;
-esac
-as_dummy="$ac_dir"
-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
-  case $as_mkdir_dir in
-    # Skip DOS drivespec
-    ?:) as_incr_dir=$as_mkdir_dir ;;
-    *)
-      as_incr_dir=$as_incr_dir/$as_mkdir_dir
-      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
-    ;;
-  esac
-done; }
-
-      fi
-      rm -f $ac_file
-      mv $tmp/config.h $ac_file
-    fi
-  else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
-  fi
-done
-EOF
-cat >>$CONFIG_STATUS <<\EOF
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-
-  case $ac_dest in
-    default )
-if test -z "$USE_OLD_MAKERULES" ; then
-	$AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
-fi
- ;;
-  esac
-done
-EOF
-
-cat >>$CONFIG_STATUS <<\EOF
-
-{ (exit 0); exit 0; }
-EOF
-chmod +x $CONFIG_STATUS
-ac_clean_files=$ac_clean_files_save
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || { (exit 1); exit 1; }
-fi
-${MAKE:-make} preinstall
diff --git a/Ada95/configure.in b/Ada95/configure.in
deleted file mode 100644
index 2b89fd4cf78..00000000000
--- a/Ada95/configure.in
+++ /dev/null
@@ -1,678 +0,0 @@
-dnl***************************************************************************
-dnl Copyright (c) 2010,2011 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            *
-dnl "Software"), to deal in the Software without restriction, including      *
-dnl without limitation the rights to use, copy, modify, merge, publish,      *
-dnl distribute, distribute with modifications, sublicense, and/or sell       *
-dnl copies of the Software, and to permit persons to whom the Software is    *
-dnl furnished to do so, subject to the following conditions:                 *
-dnl                                                                          *
-dnl The above copyright notice and this permission notice shall be included  *
-dnl in all copies or substantial portions of the Software.                   *
-dnl                                                                          *
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
-dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
-dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
-dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
-dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
-dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
-dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
-dnl                                                                          *
-dnl Except as contained in this notice, the name(s) of the above copyright   *
-dnl holders shall not be used in advertising or otherwise to promote the     *
-dnl sale, use or other dealings in this Software without prior written       *
-dnl authorization.                                                           *
-dnl***************************************************************************
-dnl
-dnl Author: Thomas E. Dickey
-dnl
-dnl $Id: configure.in,v 1.30 2011/03/31 22:49:22 tom Exp $
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl See http://invisible-island.net/autoconf/ for additional information.
-dnl
-dnl ---------------------------------------------------------------------------
-AC_PREREQ(2.13.20020210)
-AC_REVISION($Revision: 1.30 $)
-AC_INIT(gen/gen.c)
-AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
-
-CF_TOP_BUILDDIR
-
-CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
-AC_ARG_WITH(system-type,
-[  --with-system-type=XXX  test: override derived host system-type],
-[AC_MSG_WARN(overriding system type to $withval)
- cf_cv_system_name=$withval])
-
-###	Save the given $CFLAGS to allow user-override.
-cf_user_CFLAGS="$CFLAGS"
-
-###	Default install-location
-CF_CFG_DEFAULTS
-
-###	Checks for programs.
-AC_PROG_CC
-CF_GCC_VERSION
-
-AC_PROG_CPP
-AC_PROG_GCC_TRADITIONAL
-CF_PROG_CC_C_O(CC)
-AC_ISC_POSIX
-CF_ANSI_CC_REQD
-CF_PROG_EXT
-
-AC_ARG_PROGRAM
-
-CF_PROG_AWK
-CF_PROG_EGREP
-AC_PROG_INSTALL
-CF_PROG_LN_S
-
-AC_SYS_LONG_FILE_NAMES
-
-# if we find pkg-config, check if we should install the ".pc" files.
-CF_PKG_CONFIG
-
-if test "$PKG_CONFIG" != none ; then
-	AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG)
-
-	# Leave this as something that can be overridden in the environment.
-	if test -z "$PKG_CONFIG_LIBDIR" ; then
-		PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig
-	fi
-	PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'`
-	if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then
-		AC_ARG_ENABLE(pc-files,
-			[  --enable-pc-files       generate and install .pc files for pkg-config],
-			[enable_pc_files=$enableval],
-			[enable_pc_files=no])
-		AC_MSG_RESULT($enable_pc_files)
-	else
-		AC_MSG_RESULT(no)
-		AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR)
-		enable_pc_files=no
-	fi
-fi
-AC_SUBST(PKG_CONFIG_LIBDIR)
-
-AC_MSG_CHECKING(if you want to build test-programs)
-AC_ARG_WITH(tests,
-	[  --without-tests         suppress build with test-programs],
-	[cf_with_tests=$withval],
-	[cf_with_tests=yes])
-AC_MSG_RESULT($cf_with_tests)
-
-AC_MSG_CHECKING(if we should assume mixed-case filenames)
-AC_ARG_ENABLE(mixed-case,
-	[  --enable-mixed-case     tic should assume mixed-case filenames],
-	[enable_mixedcase=$enableval],
-	[enable_mixedcase=auto])
-AC_MSG_RESULT($enable_mixedcase)
-if test "$enable_mixedcase" = "auto" ; then
-    CF_MIXEDCASE_FILENAMES
-else
-    cf_cv_mixedcase=$enable_mixedcase
-    if test "$enable_mixedcase" = "yes" ; then
-        AC_DEFINE(MIXEDCASE_FILENAMES)
-    fi
-fi
-
-# do this after mixed-case option (tags/TAGS is not as important as tic).
-AC_PROG_MAKE_SET
-CF_MAKE_TAGS
-CF_MAKEFLAGS
-
-dnl These are standard among *NIX systems, but not when cross-compiling
-AC_CHECK_TOOL(RANLIB, ranlib, ':')
-AC_CHECK_TOOL(LD, ld, ld)
-AC_CHECK_TOOL(AR, ar, ar)
-CF_AR_FLAGS
-
-dnl Special option for use by system-builders: the install-prefix is used to
-dnl adjust the location into which the actual install is done, so that an
-dnl archive can be built without modifying the host system's configuration.
-AC_MSG_CHECKING(if you have specified an install-prefix)
-AC_ARG_WITH(install-prefix,
-	[  --with-install-prefix   prefixes actual install-location ($DESTDIR)],
-	[case "$withval" in #(vi
-	yes|no) #(vi
-		;;
-	*)	DESTDIR="$withval"
-		;;
-	esac])
-AC_MSG_RESULT($DESTDIR)
-AC_SUBST(DESTDIR)
-
-###############################################################################
-CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
-# If we're cross-compiling, allow the user to override the tools and their
-# options.  The configure script is oriented toward identifying the host
-# compiler, etc., but we need a build compiler to generate parts of the source.
-CF_BUILD_CC
-
-###############################################################################
-CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
-
-### Options to allow the user to specify the set of libraries which are used.
-### Use "--without-normal --with-shared" to allow the default model to be
-### shared, for example.
-cf_list_models=""
-
-AC_MSG_CHECKING(if you want to build shared C-objects)
-AC_ARG_WITH(shared,
-	[  --with-shared           generate shared C-objects (needed for --with-ada-sharedlib)],
-	[with_shared=$withval],
-	[with_shared=no])
-AC_MSG_RESULT($with_shared)
-test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
-
-AC_MSG_CHECKING(for specified models)
-test -z "$cf_list_models" && cf_list_models=normal
-AC_MSG_RESULT($cf_list_models)
-
-### Use the first model as the default, and save its suffix for use in building
-### up test-applications.
-AC_MSG_CHECKING(for default model)
-DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
-AC_MSG_RESULT($DFT_LWR_MODEL)
-
-CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
-
-AC_SUBST(DFT_LWR_MODEL)dnl	the default model ("normal")
-AC_SUBST(DFT_UPR_MODEL)dnl	the default model ("NORMAL")
-
-CF_NCURSES_ADDON
-
-CF_LIB_PREFIX(cf_prefix)
-LIB_PREFIX=$cf_prefix
-AC_SUBST(LIB_PREFIX)
-
-LIB_SUFFIX=
-AC_SUBST(LIB_SUFFIX)
-
-###############################################################################
-
-dnl Not all ports of gcc support the -g option
-
-if test X"$CC_G_OPT" = X"" ; then
-	CC_G_OPT='-g'
-	test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
-fi
-AC_SUBST(CC_G_OPT)
-
-AC_MSG_CHECKING(for default loader flags)
-case $DFT_LWR_MODEL in
-normal)  LD_MODEL=''   ;;
-debug)   LD_MODEL=$CC_G_OPT ;;
-profile) LD_MODEL='-pg';;
-shared)  LD_MODEL=''   ;;
-esac
-AC_SUBST(LD_MODEL)dnl		the type of link (e.g., -g or -pg)
-AC_MSG_RESULT($LD_MODEL)
-
-CF_SHARED_OPTS
-
-# The test/sample programs in the original tree link using rpath option.
-# Make it optional for packagers.
-if test -n "$LOCAL_LDFLAGS"
-then
-	AC_MSG_CHECKING(if you want to link sample programs with rpath option)
-	AC_ARG_ENABLE(rpath-link,
-		[  --enable-rpath-link     link sample programs with rpath option],
-		[with_rpath_link=$enableval],
-		[with_rpath_link=yes])
-	AC_MSG_RESULT($with_rpath_link)
-	if test "$with_rpath_link" = no
-	then
-		LOCAL_LDFLAGS=
-		LOCAL_LDFLAGS2=
-	fi
-fi
-
-###############################################################################
-CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
-
-CF_PATHSEP
-
-###   use option --enable-broken-linker to force on use of broken-linker support
-AC_MSG_CHECKING(if you want broken-linker support code)
-AC_ARG_ENABLE(broken_linker,
-	[  --enable-broken_linker  compile with broken-linker support code],
-	[with_broken_linker=$enableval],
-	[with_broken_linker=${BROKEN_LINKER:-no}])
-AC_MSG_RESULT($with_broken_linker)
-
-BROKEN_LINKER=0
-if test "$with_broken_linker" = yes ; then
-	AC_DEFINE(BROKEN_LINKER)
-	BROKEN_LINKER=1
-elif test "$DFT_LWR_MODEL" = shared ; then
-	case $cf_cv_system_name in #(vi
-	cygwin*)
-		AC_DEFINE(BROKEN_LINKER)
-		BROKEN_LINKER=1
-		CF_VERBOSE(cygwin linker is broken anyway)
-		;;
-	esac
-fi
-AC_SUBST(BROKEN_LINKER)
-
-# Check to define _XOPEN_SOURCE "automatically"
-CF_XOPEN_SOURCE
-
-CF_LARGEFILE
-
-### Enable compiling-in rcs id's
-AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
-AC_ARG_WITH(rcs-ids,
-	[  --with-rcs-ids          compile-in RCS identifiers],
-	[with_rcs_ids=$withval],
-	[with_rcs_ids=no])
-AC_MSG_RESULT($with_rcs_ids)
-test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS)
-
-###############################################################################
-CF_HELP_MESSAGE(Extensions:)
-
-### Note that some functions (such as const) are normally disabled anyway.
-AC_MSG_CHECKING(if you want to build with function extensions)
-AC_ARG_ENABLE(ext-funcs,
-	[  --disable-ext-funcs     disable function-extensions],
-	[with_ext_funcs=$enableval],
-	[with_ext_funcs=yes])
-AC_MSG_RESULT($with_ext_funcs)
-if test "$with_ext_funcs" = yes ; then
-	NCURSES_EXT_FUNCS=1
-	AC_DEFINE(HAVE_USE_DEFAULT_COLORS)
-	AC_DEFINE(NCURSES_EXT_FUNCS)
-else
-	NCURSES_EXT_FUNCS=0
-fi
-AC_SUBST(NCURSES_EXT_FUNCS)
-
-###   use option --enable-const to turn on use of const beyond that in XSI.
-AC_MSG_CHECKING(for extended use of const keyword)
-AC_ARG_ENABLE(const,
-	[  --enable-const          compile with extra/non-standard const],
-	[with_ext_const=$enableval],
-	[with_ext_const=no])
-AC_MSG_RESULT($with_ext_const)
-NCURSES_CONST='/*nothing*/'
-if test "$with_ext_const" = yes ; then
-	NCURSES_CONST=const
-fi
-AC_SUBST(NCURSES_CONST)
-
-###############################################################################
-# These options are relatively safe to experiment with.
-CF_HELP_MESSAGE(Development Code:)
-AC_MSG_CHECKING(if you want all development code)
-AC_ARG_WITH(develop,
-	[  --without-develop       disable development options],
-	[with_develop=$withval],
-	[with_develop=no])
-AC_MSG_RESULT($with_develop)
-
-###############################################################################
-# These are just experimental, probably should not be in a package:
-CF_HELP_MESSAGE(Experimental Code:)
-
-# This is still experimental (20080329), but should ultimately be moved to
-# the script-block --with-normal, etc.
-CF_WITH_PTHREAD
-
-AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
-AC_ARG_ENABLE(weak-symbols,
-    [  --enable-weak-symbols   enable weak-symbols for pthreads],
-    [use_weak_symbols=$withval],
-    [use_weak_symbols=no])
-AC_MSG_RESULT($use_weak_symbols)
-if test "$use_weak_symbols" = yes ; then
-    CF_WEAK_SYMBOLS
-else
-    cf_cv_weak_symbols=no
-fi
-
-if test $cf_cv_weak_symbols = yes ; then
-    AC_DEFINE(USE_WEAK_SYMBOLS)
-fi
-
-PTHREAD=
-if test "$with_pthread" = "yes" ; then
-    AC_DEFINE(USE_PTHREADS)
-    enable_reentrant=yes
-    if test $cf_cv_weak_symbols = yes ; then
-        PTHREAD=-lpthread
-    fi
-fi
-AC_SUBST(PTHREAD)
-
-# OpenSUSE is installing ncurses6, using reentrant option.
-AC_CHECK_FUNC(_nc_TABSIZE,[assume_reentrant=yes], [assume_reentrant=no])
-
-# Reentrant code has to be opaque; there's little advantage to making ncurses
-# opaque outside of that, so there is no --enable-opaque option.  We can use
-# this option without --with-pthreads, but this will be always set for
-# pthreads.
-AC_MSG_CHECKING(if you want experimental reentrant code)
-AC_ARG_ENABLE(reentrant,
-	[  --enable-reentrant      compile with experimental reentrant code],
-	[with_reentrant=$enableval],
-	[with_reentrant=$assume_reentrant])
-AC_MSG_RESULT($with_reentrant)
-if test "$with_reentrant" = yes ; then
-	cf_cv_enable_reentrant=1
-	if test $cf_cv_weak_symbols = yes ; then
-		CF_REMOVE_LIB(LIBS,$LIBS,pthread)
-	elif test "$assume_reentrant" = no ; then
-		LIB_SUFFIX="t${LIB_SUFFIX}"
-	fi
-	AC_DEFINE(USE_REENTRANT)
-else
-	cf_cv_enable_reentrant=0
-fi
-AC_SUBST(cf_cv_enable_reentrant)
-
-### Allow using a different wrap-prefix
-if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
-	AC_MSG_CHECKING(for prefix used to wrap public variables)
-	AC_ARG_WITH(wrap-prefix,
-		[  --with-wrap-prefix=XXX  override prefix used for public variables],
-		[NCURSES_WRAP_PREFIX=$withval],
-		[NCURSES_WRAP_PREFIX=_nc_])
-	AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
-else
-	NCURSES_WRAP_PREFIX=_nc_
-fi
-AC_SUBST(NCURSES_WRAP_PREFIX)
-AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX")
-
-###############################################################################
-CF_HELP_MESSAGE(Testing/development Options:)
-
-###	use option --disable-echo to suppress full display compiling commands
-AC_MSG_CHECKING(if you want to display full commands during build)
-AC_ARG_ENABLE(echo,
-	[  --enable-echo           build: display "compiling" commands (default)],
-	[with_echo=$enableval],
-	[with_echo=yes])
-if test "$with_echo" = yes; then
-	ECHO_LINK=
-else
-	ECHO_LINK='@ echo linking $@ ... ;'
-fi
-AC_MSG_RESULT($with_echo)
-AC_SUBST(ECHO_LINK)
-
-###	use option --enable-warnings to turn on all gcc warnings
-AC_MSG_CHECKING(if you want to see compiler warnings)
-AC_ARG_ENABLE(warnings,
-	[  --enable-warnings       build: turn on GCC compiler warnings],
-	[with_warnings=$enableval])
-AC_MSG_RESULT($with_warnings)
-
-if test "x$with_warnings" = "xyes"; then
- 	CF_ADD_ADAFLAGS(-gnatg)
-	CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum)
-fi
-CF_GCC_ATTRIBUTES
-
-###	use option --enable-assertions to turn on generation of assertion code
-AC_MSG_CHECKING(if you want to enable runtime assertions)
-AC_ARG_ENABLE(assertions,
-	[  --enable-assertions     test: turn on generation of assertion code],
-	[with_assertions=$enableval],
-	[with_assertions=no])
-AC_MSG_RESULT($with_assertions)
-if test -n "$GCC"
-then
-	if test "$with_assertions" = no
-	then
-		AC_DEFINE(NDEBUG)
-		CPPFLAGS="$CPPFLAGS -DNDEBUG"
-	else
-		CF_ADD_ADAFLAGS(-gnata)
-	fi
-fi
-
-###	use option --disable-leaks to suppress "permanent" leaks, for testing
-AC_DEFINE(HAVE_NC_ALLOC_H)
-
-###	use option --enable-expanded to generate certain macros as functions
-AC_ARG_ENABLE(expanded,
-	[  --enable-expanded       test: generate functions for certain macros],
-	[test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED)])
-
-###	use option --disable-macros to suppress macros in favor of functions
-AC_ARG_ENABLE(macros,
-	[  --disable-macros        test: use functions rather than macros],
-	[test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS)])
-
-# Normally we only add trace() to the debug-library.  Allow this to be
-# extended to all models of the ncurses library:
-cf_all_traces=no
-case "$CFLAGS $CPPFLAGS" in
-*-DTRACE*)
-	cf_all_traces=yes
-	;;
-esac
-
-AC_MSG_CHECKING(whether to add trace feature to all models)
-AC_ARG_WITH(trace,
-[  --with-trace            test: add trace() function to all models of ncurses],
-[cf_with_trace=$withval],
-[cf_with_trace=$cf_all_traces])
-AC_MSG_RESULT($cf_with_trace)
-
-if test "$cf_with_trace" = yes ; then
-	ADA_TRACE=TRUE
-	CF_ADD_CFLAGS(-DTRACE)
-else
-	ADA_TRACE=FALSE
-fi
-
-AC_SUBST(ADA_TRACE)
-
-###	Checks for libraries.
-case $cf_cv_system_name in #(vi
-*mingw32*) #(vi
-	;;
-*)
-AC_CHECK_FUNC(gettimeofday,
-	AC_DEFINE(HAVE_GETTIMEOFDAY),[
-
-AC_CHECK_LIB(bsd, gettimeofday,
-	AC_DEFINE(HAVE_GETTIMEOFDAY)
-	LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
-	;;
-esac
-
-###	Checks for header files.
-AC_STDC_HEADERS
-AC_HEADER_DIRENT
-AC_HEADER_TIME
-
-###	checks for compiler characteristics
-AC_LANG_C
-AC_C_CONST
-
-###	Checks for external-data
-CF_LINK_DATAONLY
-
-###	Checks for library functions.
-CF_MKSTEMP
-
-AC_TYPE_SIGNAL
-
-dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
-if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
-	CF_STRIP_G_OPT(CFLAGS)
-	CF_STRIP_G_OPT(CXXFLAGS)
-fi
-
-CF_HELP_MESSAGE(Ada95 Binding Options:)
-
-dnl Check for availability of GNU Ada Translator (GNAT).
-dnl At the moment we support no other Ada95 compiler.
-if test "$cf_with_ada" != "no" ; then
-	CF_PROG_GNAT
-	if test	"$cf_cv_prog_gnat_correct" = yes; then
-
-		# make ADAFLAGS consistent with CFLAGS
-		case "$CFLAGS" in
-		*-g*)
-			CF_ADD_ADAFLAGS(-g)
-			;;
-		esac
-		case "$CFLAGS" in
-		*-O*)
-			CF_ADD_ADAFLAGS(-O3)
-			;;
-		esac
-
-		CF_GNAT_GENERICS
-		CF_GNAT_SIGINT
-		CF_GNAT_PRAGMA_UNREF
-		CF_GNAT_PROJECTS
-
-		CF_WITH_ADA_COMPILER
-
-		cf_ada_package=terminal_interface
-		AC_SUBST(cf_ada_package)
-
-		CF_WITH_ADA_INCLUDE
-		CF_WITH_ADA_OBJECTS
-		CF_WITH_ADA_SHAREDLIB
-	else
-		AC_MSG_ERROR(No usable Ada compiler found)
-	fi
-else
-	AC_MSG_ERROR(The Ada compiler is needed for this package)
-fi
-
-################################################################################
-
-# not needed
-TINFO_ARGS2=
-AC_SUBST(TINFO_ARGS2)
-
-### Construct the list of include-directories to be generated
-CF_INCLUDE_DIRS
-CF_ADA_INCLUDE_DIRS
-
-### Build up pieces for makefile rules
-AC_MSG_CHECKING(default library suffix)
-CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
-AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
-AC_MSG_RESULT($DFT_ARG_SUFFIX)
-
-AC_MSG_CHECKING(default library-dependency suffix)
-CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
-AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
-AC_MSG_RESULT($DFT_DEP_SUFFIX)
-
-AC_MSG_CHECKING(default object directory)
-CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
-AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
-AC_MSG_RESULT($DFT_OBJ_SUBDIR)
-
-### Set up low-level terminfo dependencies for makefiles.
-
-if test "$DFT_LWR_MODEL" = shared ; then
-	case $cf_cv_system_name in #(vi
-	cygwin*)
-		# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
-		;;
-	esac
-fi
-
-### Construct the list of subdirectories for which we'll customize makefiles
-### with the appropriate compile-rules.
-
-SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
-
-AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR')
-
-### Now that we're done running tests, add the compiler-warnings, if any
-CF_ADD_CFLAGS($EXTRA_CFLAGS)
-
-################################################################################
-
-if test x"$enable_pc_files" = xyes ; then \
-SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in"
-MAKE_PC_FILES=
-else
-MAKE_PC_FILES="#"
-fi
-AC_SUBST(MAKE_PC_FILES)
-AC_SUBST(cross_compiling)
-
-################################################################################
-
-TEST_ARG2=
-AC_SUBST(TEST_ARG2)
-
-TEST_LIBS2=
-AC_SUBST(TEST_LIBS2)
-
-dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib"
-NCURSES_SHLIB2="sh -c"
-AC_SUBST(NCURSES_SHLIB2)
-
-ADA_SUBDIRS="include gen src doc"
-if test "x$cf_with_tests" != "xno" ; then
-	ADA_SUBDIRS="$ADA_SUBDIRS samples"
-fi
-for cf_dir in $ADA_SUBDIRS
-do
-	SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
-done
-AC_SUBST(ADA_SUBDIRS)
-
-NCURSES_TREE="#"
-AC_SUBST(NCURSES_TREE)
-
-EXTERNAL_TREE=
-AC_SUBST(EXTERNAL_TREE)
-
-# match layout used by make-tar.sh
-ADAHTML_DIR=../doc/ada
-AC_SUBST(ADAHTML_DIR)
-
-AC_OUTPUT( \
-	$SUB_MAKEFILES \
-	doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \
-	Makefile,[
-if test -z "$USE_OLD_MAKERULES" ; then
-	$AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
-fi
-],[
-### Special initialization commands, used to pass information from the
-### configuration-run into config.status
-
-AWK="$AWK"
-DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
-DFT_LWR_MODEL="$DFT_LWR_MODEL"
-ECHO_LINK="$ECHO_LINK"
-LIB_NAME="$LIB_NAME"
-LIB_SUFFIX="$LIB_SUFFIX"
-LN_S="$LN_S"
-NCURSES_MAJOR="$NCURSES_MAJOR"
-NCURSES_MINOR="$NCURSES_MINOR"
-NCURSES_PATCH="$NCURSES_PATCH"
-USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
-cf_cv_abi_version="$cf_cv_abi_version"
-cf_cv_rel_version="$cf_cv_rel_version"
-cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
-cf_cv_shared_soname='$cf_cv_shared_soname'
-cf_cv_shlib_version="$cf_cv_shlib_version"
-cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
-cf_cv_system_name="$cf_cv_system_name"
-host="$host"
-target="$target"
-
-],cat)dnl
-${MAKE:-make} preinstall
diff --git a/Ada95/doc/Makefile.in b/Ada95/doc/Makefile.in
deleted file mode 100644
index 8f33c930a36..00000000000
--- a/Ada95/doc/Makefile.in
+++ /dev/null
@@ -1,81 +0,0 @@
-# $Id: Makefile.in,v 1.2 2011/03/26 19:26:17 tom Exp $
-##############################################################################
-# Copyright (c) 2011 Free 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
-#
-# Makefile for AdaCurses manual pages.
-
-SHELL		= /bin/sh
-VPATH		= @srcdir@
-
-DESTDIR		= @DESTDIR@
-srcdir		= @srcdir@
-prefix		= @prefix@
-exec_prefix	= @exec_prefix@
-datadir		= @datadir@
-mandir		= @mandir@
-
-INSTALL		= @INSTALL@
-INSTALL_DATA	= @INSTALL_DATA@
-
-DFT_ARG_SUFFIX	= @DFT_ARG_SUFFIX@
-
-THIS		= AdaCurses
-DOCDIR		= $(DESTDIR)$(datadir)/doc/$(THIS)
-MANDIR		= $(DESTDIR)$(mandir)/man1
-
-all \
-sources \
-depend \
-tags :
-
-$(DOCDIR) \
-$(MANDIR) :
-	mkdir -p $@
-
-install install.man : $(MANDIR)
-	$(INSTALL_DATA) adacurses${DFT_ARG_SUFFIX}-config.1 $(MANDIR)
-
-uninstall uninstall.man :
-	-rm -f $(MANDIR)/adacurses${DFT_ARG_SUFFIX}-config.1
-
-# HTML documentation is optional, usually in a separate package.
-install.html : $(DOCDIR)
-	cd $(srcdir) && tar -cf - *.htm* ada | tar -C $(DOCDIR) -xf -
-
-uninstall.html :
-	-rm -rf $(DOCDIR)
-
-mostlyclean :
-	-rm -f core tags TAGS *~ *.bak *.ln *.atac trace
-
-clean:	mostlyclean
-
-distclean realclean: clean
-	-rm -f Makefile *-config.1
diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in
deleted file mode 100644
index 10fd6352ce3..00000000000
--- a/Ada95/gen/Makefile.in
+++ /dev/null
@@ -1,451 +0,0 @@
-##############################################################################
-# Copyright (c) 1998-2010,2011 Free 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:  Juergen Pfeifer, 1996
-#
-#  $Id: Makefile.in,v 1.74 2011/03/26 23:36:30 tom Exp $
-#
-.SUFFIXES:
-
-SHELL		= /bin/sh
-VPATH		= @srcdir@
-THIS		= Makefile
-
-x		= @PROG_EXT@
-
-top_srcdir	= @top_srcdir@
-DESTDIR		= @DESTDIR@
-srcdir		= @srcdir@
-prefix		= @prefix@
-exec_prefix	= @exec_prefix@
-bindir		= @bindir@
-includedir	= @includedir@
-
-INSTALL		= @INSTALL@
-INSTALL_PROG	= @INSTALL_PROGRAM@
-INSTALL_DATA	= @INSTALL_DATA@
-
-AWK		= @AWK@
-LN_S		= @LN_S@
-
-CC		= @CC@
-HOST_CC		= @BUILD_CC@
-CFLAGS		= @CFLAGS@
-
-CPPFLAGS	= @ACPPFLAGS@ @CPPFLAGS@ \
-		  -DHAVE_CONFIG_H -I$(srcdir)
-
-CCFLAGS		= $(CPPFLAGS) $(CFLAGS)
-CFLAGS_NORMAL	= $(CCFLAGS)
-CFLAGS_DEBUG	= $(CCFLAGS) @CC_G_OPT@ -DTRACE
-CFLAGS_PROFILE	= $(CCFLAGS) -pg
-CFLAGS_SHARED	= $(CCFLAGS) @CC_SHARED_OPTS@
-
-CFLAGS_DEFAULT	= $(CFLAGS_@DFT_UPR_MODEL@)
-
-REL_VERSION	= @cf_cv_rel_version@
-ABI_VERSION	= @cf_cv_abi_version@
-LOCAL_LIBDIR	= @top_builddir@/lib
-
-LINK		= $(HOST_CC)
-LD_FLAGS	= @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_ARGS2@
-
-RANLIB		= @RANLIB@
-
-M4		= m4
-M4FLAGS		= -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
-
-ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config
-
-WRAPPER		= @NCURSES_SHLIB2@
-
-PROG_GENERATE	= ./generate$x
-GENERATE	= $(PROG_GENERATE) '@DFT_ARG_SUFFIX@'
-DEL_ADAMODE	= sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
-
-GNATHTML	= `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
-GNATHP          = www.gnat.com
-
-################################################################################
-ALIB            = @cf_ada_package@
-ABASE		= $(ALIB)-curses
-
-ADA_SRCDIR	= ../src
-
-GEN_FILES0      = Base_Defs
-
-GEN_FILES1      = ACS_Map                      		\
-		  AC_Rep                       		\
-		  Base_Defs			        \
-		  Character_Attribute_Set_Rep  		\
-		  Color_Defs                   		\
-		  Key_Definitions              		\
-		  Linker_Options               		\
-		  Old_Keys                     		\
-		  Public_Variables                      \
-		  Trace_Defs				\
-		  Version_Info				\
-		  Window_Offsets
-
-GEN_FILES2      = Menu_Opt_Rep        		    	\
-		  Menu_Base_Defs               		\
-		  Menu_Linker_Options          		\
-		  Item_Rep
-
-GEN_FILES3      = Form_Opt_Rep                 		\
-		  Form_Base_Defs               		\
-		  Form_Linker_Options          		\
-		  Field_Rep
-
-GEN_FILES4      = Mouse_Base_Defs              		\
-		  Mouse_Event_Rep			\
-		  Mouse_Events                          \
-		  Panel_Linker_Options
-
-GEN_FILES5	= Chtype_Def                            \
-		  Eti_Defs
-
-GEN_TARGETS     = $(ADA_SRCDIR)/$(ABASE).ads         			\
-		  $(ADA_SRCDIR)/$(ABASE).adb         			\
-	          $(ADA_SRCDIR)/$(ABASE)-aux.ads   			\
-	          $(ADA_SRCDIR)/$(ABASE)-trace.ads   			\
-	          $(ADA_SRCDIR)/$(ABASE)-menus.ads   			\
-	          $(ADA_SRCDIR)/$(ABASE)-forms.ads   			\
-	          $(ADA_SRCDIR)/$(ABASE)-mouse.ads 			\
-	          $(ADA_SRCDIR)/$(ABASE)-panels.ads			\
-	          $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads	\
-	          $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads	\
-	          $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads	\
-	          $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads		\
-	          $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads	\
-	          $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
-
-GEN_SRC		= $(srcdir)/$(ABASE).ads.m4				\
-		  $(srcdir)/$(ABASE).adb.m4				\
-	          $(srcdir)/$(ABASE)-aux.ads.m4 	  		\
-	          $(srcdir)/$(ABASE)-trace.ads.m4 	  		\
-	          $(srcdir)/$(ABASE)-menus.ads.m4 	  		\
-	          $(srcdir)/$(ABASE)-forms.ads.m4   			\
-	          $(srcdir)/$(ABASE)-mouse.ads.m4			\
-	          $(srcdir)/$(ABASE)-panels.ads.m4			\
-	          $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4	\
-	          $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4	\
-	          $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4	\
-	          $(srcdir)/$(ABASE)-forms-field_types.ads.m4		\
-	          $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4	\
-	          $(srcdir)/$(ABASE)-panels-user_data.ads.m4
-
-
-all \
-libs :	$(GEN_TARGETS)
-	@echo made $@
-
-sources:
-
-$(DESTDIR)$(bindir) :
-	mkdir -p $@
-
-install \
-install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
-	$(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
-
-uninstall \
-uninstall.libs ::
-	-rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
-
-$(PROG_GENERATE):  gen.o
-	@ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
-
-gen.o:	$(srcdir)/gen.c
-	$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
-################################################################################
-Character_Attribute_Set_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B A" >$@
-
-Base_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B B" >$@
-
-Color_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B C" >$@
-
-Window_Offsets: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B D" >$@
-
-Key_Definitions: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B K" >$@
-
-Linker_Options: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B L" >$@
-
-ACS_Map: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B M" >$@
-
-Old_Keys: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B O" >$@
-
-Public_Variables: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B P" >$@
-
-AC_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B R" >$@
-
-Version_Info: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B V" >$@
-
-Trace_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B T" >$@
-################################################################################
-Menu_Opt_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) M R" >$@
-
-Menu_Base_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) M B" >$@
-
-Menu_Linker_Options: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) M L" >$@
-
-Item_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) M I" >$@
-################################################################################
-Form_Opt_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) F R" >$@
-
-Form_Base_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) F B" >$@
-
-Form_Linker_Options: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) F L" >$@
-
-Field_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) F I" >$@
-################################################################################
-Mouse_Base_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) P B" >$@
-
-Mouse_Event_Rep: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) P M" >$@
-
-Mouse_Events: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) B E" >$@
-
-Panel_Linker_Options: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) P L" >$@
-
-Chtype_Def: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) E C" >$@
-
-Eti_Defs: $(PROG_GENERATE)
-	$(WRAPPER) "$(GENERATE) E E" >$@
-################################################################################
-$(ADA_SRCDIR)/$(ABASE).ads: 	$(srcdir)/$(ABASE).ads.m4 \
-				$(GEN_FILES1) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE).ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE).adb: 	$(srcdir)/$(ABASE).adb.m4 \
-				$(GEN_FILES1) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE).adb.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
-				$(GEN_FILES5) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-aux.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
-				$(GEN_FILES5) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-trace.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
-				  $(GEN_FILES2) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-menus.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
-				  $(GEN_FILES3) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-forms.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
-				  $(GEN_FILES4) $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-mouse.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \
-                                  $(GEN_FILES4) \
-				   $(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-panels.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \
-		$(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \
-		$(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \
-		$(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \
-		$(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \
-		$(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \
-		$(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads: \
-		$(srcdir)/$(ABASE)-forms-field_types.ads.m4 \
-		$(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-forms-field_types.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \
-		$(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \
-		$(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \
-		$(srcdir)/$(ABASE)-panels-user_data.ads.m4 \
-		$(srcdir)/normal.m4
-	$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
-	$(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
-	$(DEL_ADAMODE) >$@
-
-install.progs ::
-
-tags:
-	ctags *.[ch]
-
-@MAKE_UPPER_TAGS@TAGS:
-@MAKE_UPPER_TAGS@	etags *.[ch]
-
-mostlyclean ::
-	-rm -f a.out core $(PROG_GENERATE) *.o
-	-rm -f $(GEN_FILES1)
-	-rm -f $(GEN_FILES2)
-	-rm -f $(GEN_FILES3)
-	-rm -f $(GEN_FILES4)
-	-rm -f $(GEN_FILES5)
-
-clean :: mostlyclean
-	-rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
-
-distclean :: clean
-	-rm -f $(ADACURSES_CONFIG)
-	-rm -f Makefile
-
-realclean :: distclean
-
-HTML_DIR = @ADAHTML_DIR@
-
-instab.tmp : table.m4 $(GEN_SRC)
-	@rm -f $@
-	@for f in $(GEN_SRC) ; do \
-	  $(M4) $(M4FLAGS) -DM4MACRO=table.m4 $$f | $(DEL_ADAMODE) >> $@ ;\
-	done;
-
-$(HTML_DIR)/table.html : instab.tmp
-	@-touch $@
-	@-chmod +w $@
-	@echo ' $@
-	@echo 'PUBLIC "-//IETF//DTD HTML 3.0//EN">' >> $@
-	@echo '' >> $@
-	@echo '' >> $@
-	@echo 'Correspondence between ncurses C and Ada functions' >>$@
-	@echo '' >> $@
-	@echo '' >> $@
-	@echo '

Correspondence between ncurses C and Ada functions

' >>$@ - @echo '

Sorted by C function name

' >>$@ - @echo '' >>$@ - @echo '' >>$@ - @echo '' >>$@ - @sort < instab.tmp >> $@ - @echo '
C nameAda nameman page
' >>$@ - @rm -f instab.tmp - -adahtml: - test -n "$(GNATHTML)" || exit 1 - @find $(HTML_DIR) -type f -exec rm -f {} \; - @mkdir -p $(HTML_DIR) - cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb] -@USE_OLD_MAKERULES@ ln -sf ../src/*.ali . -@USE_GNAT_PROJECTS@ ln -sf ../static-ali/*.ali . - @echo "Filtering generated files" - @for f in $(GEN_SRC); do \ - h=`basename $$f` ;\ - g=`basename $$f .ads.m4` ;\ - if test "$$g" != "$$h" ; then \ - $(M4) $(M4FLAGS) -DM4MACRO=html.m4 $$f | $(DEL_ADAMODE) > $$g.ads ;\ - echo "... $$g.ads" ;\ - fi \ - done - @-rm -f $(HTML_DIR)/$(ALIB)*.htm* - $(GNATHTML) -d -f $(ALIB)*.ads - for f in html/$(ALIB)*.htm*; do \ - a=`basename $$f` ; \ - sed -e 's/You may also.*body.*//' <$$f |\ - sed -e 's%GNAT%GNAT%g' |\ - sed -e 's%<A HREF%%g' |\ - sed -e 's/3X/3x/g' |\ - sed -e 's/$$\([ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxz0123456789_]*:.*\)\$$/@\1@/' |\ - sed -e 's%</A>%%g' > $$a.tmp ;\ - mv $$a.tmp $$f ;\ - done - @rm -f *.ad[sb] *.ali *.tmp - @for f in funcs.htm main.htm ; do \ - sed -e "\%\[ \]%d" < html/$$f > $$f ;\ - mv $$f html/$$f ;\ - done - @rm -f "html/funcs/ .htm" - @cp -pdrf html/* $(HTML_DIR)/ - @rm -rf html - -html : adahtml $(HTML_DIR)/table.html - @echo made $@ - -############################################################################### -# The remainder of this file is automatically generated during configuration -############################################################################### diff --git a/Ada95/gen/adacurses-config.in b/Ada95/gen/adacurses-config.in deleted file mode 100644 index ec0b6b68b67..00000000000 --- a/Ada95/gen/adacurses-config.in +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh -# $Id: adacurses-config.in,v 1.6 2010/03/06 21:05:01 tom Exp $ -############################################################################## -# Copyright (c) 2007-2009,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"), # -# 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. # -############################################################################## -# -# This script returns the options to add to `gnatmake' for using AdaCurses. - -DESTDIR=@DESTDIR@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ - -ADA_INCLUDE=@ADA_INCLUDE@ -ADA_OBJECTS=@ADA_OBJECTS@ - -VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@ - -CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS" -LIBS="-L$ADA_OBJECTS -lAdaCurses" - -THIS="adacurses" - -case "x$1" in - x--version) - echo AdaCurses $VERSION - ;; - x--cflags) - echo $CFLAGS - ;; - x--libs) - echo $LIBS - ;; - x) - # if no parameter is given, give what gnatmake needs - echo "$CFLAGS -i -largs $LIBS" - ;; - x--help) - cat <&2 - exit 1 - ;; -esac diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c deleted file mode 100644 index 30772b0b021..00000000000 --- a/Ada95/gen/gen.c +++ /dev/null @@ -1,1568 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998,2010,2011 Free 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: Juergen Pfeifer, 1996 * - ****************************************************************************/ - -/* - Version Control - $Id: gen.c,v 1.59 2011/03/31 23:50:24 tom Exp $ - --------------------------------------------------------------------------*/ -/* - This program generates various record structures and constants from the - ncurses header file for the Ada95 packages. Essentially it produces - Ada95 source on stdout, which is then merged using m4 into a template - to produce the real source. - */ - -#ifdef HAVE_CONFIG_H -#include -#else -#include -#define HAVE_USE_DEFAULT_COLORS 1 -#endif - -#include -#include -#include -#include -#include - -#include -#include - -#define UChar(c) ((unsigned char)(c)) -#define RES_NAME "Reserved" - -static const char *model = ""; -static int little_endian = 0; - -typedef struct - { - const char *name; - unsigned long attr; - } -name_attribute_pair; - -static int -find_pos(char *s, unsigned len, int *low, int *high) -{ - unsigned int i, j; - int l = 0; - - *high = -1; - *low = (int)(8 * len); - - for (i = 0; i < len; i++, s++) - { - if (*s) - { - for (j = 0; j < 8 * sizeof(char); j++) - - { - if (((little_endian && ((*s) & 0x01)) || - (!little_endian && ((*s) & 0x80)))) - { - if (l > *high) - *high = l; - if (l < *low) - *low = l; - } - l++; - if (little_endian) - { - *s >>= 1; - } - else - { - *s = (char)(*s << 1); - } - } - } - else - l += 8; - } - return (*high >= 0 && (*low <= *high)) ? *low : -1; -} - -/* - * This helper routine generates a representation clause for a - * record type defined in the binding. - * We are only dealing with record types which are of 32 or 16 - * bit size, i.e. they fit into an (u)int or a (u)short. - */ -static void -gen_reps( - const name_attribute_pair * nap, /* array of name_attribute_pair records */ - const char *name, /* name of the represented record type */ - int len, /* size of the record in bytes */ - int bias) -{ - const char *unused_name = "Unused"; - int long_bits = (8 * (int)sizeof(unsigned long)); - int len_bits = (8 * len); - int i, j, n, l, cnt = 0, low, high; - int width = strlen(RES_NAME) + 3; - unsigned long a; - unsigned long mask = 0; - - assert(nap != NULL); - - for (i = 0; nap[i].name != (char *)0; i++) - { - cnt++; - l = (int)strlen(nap[i].name); - if (l > width) - width = l; - } - assert(width > 0); - - printf(" type %s is\n", name); - printf(" record\n"); - for (i = 0; nap[i].name != (char *)0; i++) - { - mask |= nap[i].attr; - printf(" %-*s : Boolean;\n", width, nap[i].name); - } - - /* - * Compute a mask for the unused bits in this target. - */ - mask = ~mask; - /* - * Bits in the biased area are unused by the target. - */ - for (j = 0; j < bias; ++j) - { - mask &= (unsigned long)(~(1L << j)); - } - /* - * Bits past the target's size are really unused. - */ - for (j = len_bits + bias; j < long_bits; ++j) - { - mask &= (unsigned long)(~(1L << j)); - } - if (mask != 0) - { - printf(" %-*s : Boolean;\n", width, unused_name); - } - printf(" end record;\n"); - printf(" pragma Convention (C, %s);\n\n", name); - - printf(" for %s use\n", name); - printf(" record\n"); - - for (i = 0; nap[i].name != (char *)0; i++) - { - a = nap[i].attr; - l = find_pos((char *)&a, sizeof(a), &low, &high); - if (l >= 0) - printf(" %-*s at 0 range %2d .. %2d;\n", width, nap[i].name, - low - bias, high - bias); - } - if (mask != 0) - { - l = find_pos((char *)&mask, sizeof(mask), &low, &high); - if (l >= 0) - printf(" %-*s at 0 range %2d .. %2d;\n", width, unused_name, - low - bias, high - bias); - } - i = 1; - n = cnt; - printf(" end record;\n"); - printf(" for %s'Size use %d;\n", name, len_bits); - printf(" -- Please note: this rep. clause is generated and may be\n"); - printf(" -- different on your system."); -} - -static void -chtype_rep(const char *name, attr_t mask) -{ - attr_t x = (attr_t)-1; - attr_t t = x & mask; - int low, high; - int l = find_pos((char *)&t, sizeof(t), &low, &high); - - if (l >= 0) - printf(" %-5s at 0 range %2d .. %2d;\n", name, low, high); -} - -static void -gen_chtype_rep(const char *name) -{ - printf(" for %s use\n record\n", name); - chtype_rep("Ch", A_CHARTEXT); - chtype_rep("Color", A_COLOR); - chtype_rep("Attr", (A_ATTRIBUTES & ~A_COLOR)); - printf(" end record;\n for %s'Size use %ld;\n", - name, (long)(8 * sizeof(chtype))); - - printf(" -- Please note: this rep. clause is generated and may be\n"); - printf(" -- different on your system.\n"); -} - -static void -mrep_rep(const char *name, void *rec) -{ - int low, high; - int l = find_pos((char *)rec, sizeof(MEVENT), &low, &high); - - if (l >= 0) - printf(" %-7s at 0 range %3d .. %3d;\n", name, low, high); -} - -static void -gen_mrep_rep(const char *name) -{ - MEVENT x; - - printf(" for %s use\n record\n", name); - - memset(&x, 0, sizeof(x)); - x.id = -1; - mrep_rep("Id", &x); - - memset(&x, 0, sizeof(x)); - x.x = -1; - mrep_rep("X", &x); - - memset(&x, 0, sizeof(x)); - x.y = -1; - mrep_rep("Y", &x); - - memset(&x, 0, sizeof(x)); - x.z = -1; - mrep_rep("Z", &x); - - memset(&x, 0, sizeof(x)); - x.bstate = (mmask_t) - 1; - mrep_rep("Bstate", &x); - - printf(" end record;\n"); - printf(" -- Please note: this rep. clause is generated and may be\n"); - printf(" -- different on your system.\n"); -} - -static void -gen_attr_set(const char *name) -{ - /* All of the A_xxx symbols are defined in ncurses, but not all are nonzero - * if "configure --enable-widec" is not specified. Originally (in - * 1999-2000), the ifdef's also were needed since the proposed bit-layout - * for wide characters allocated 16-bits for A_CHARTEXT, leaving too few - * bits for a few of the A_xxx symbols. - */ - static const name_attribute_pair nap[] = - { -#if A_STANDOUT - {"Stand_Out", A_STANDOUT}, -#endif -#if A_UNDERLINE - {"Under_Line", A_UNDERLINE}, -#endif -#if A_REVERSE - {"Reverse_Video", A_REVERSE}, -#endif -#if A_BLINK - {"Blink", A_BLINK}, -#endif -#if A_DIM - {"Dim_Character", A_DIM}, -#endif -#if A_BOLD - {"Bold_Character", A_BOLD}, -#endif -#if A_ALTCHARSET - {"Alternate_Character_Set", A_ALTCHARSET}, -#endif -#if A_INVIS - {"Invisible_Character", A_INVIS}, -#endif -#if A_PROTECT - {"Protected_Character", A_PROTECT}, -#endif -#if A_HORIZONTAL - {"Horizontal", A_HORIZONTAL}, -#endif -#if A_LEFT - {"Left", A_LEFT}, -#endif -#if A_LOW - {"Low", A_LOW}, -#endif -#if A_RIGHT - {"Right", A_RIGHT}, -#endif -#if A_TOP - {"Top", A_TOP}, -#endif -#if A_VERTICAL - {"Vertical", A_VERTICAL}, -#endif - {(char *)0, 0} - }; - chtype attr = A_ATTRIBUTES & ~A_COLOR; - int start = -1; - int len = 0; - int i; - chtype set; - for (i = 0; i < (int)(8 * sizeof(chtype)); i++) - - { - set = (attr & 1); - if (set) - { - if (start < 0) - start = i; - if (start >= 0) - { - len++; - } - } - attr = attr >> 1; - } - gen_reps(nap, name, (len + 7) / 8, little_endian ? start : 0); -} - -static void -gen_trace(const char *name) -{ - static const name_attribute_pair nap[] = - { - {"Times", TRACE_TIMES}, - {"Tputs", TRACE_TPUTS}, - {"Update", TRACE_UPDATE}, - {"Cursor_Move", TRACE_MOVE}, - {"Character_Output", TRACE_CHARPUT}, - {"Calls", TRACE_CALLS}, - {"Virtual_Puts", TRACE_VIRTPUT}, - {"Input_Events", TRACE_IEVENT}, - {"TTY_State", TRACE_BITS}, - {"Internal_Calls", TRACE_ICALLS}, - {"Character_Calls", TRACE_CCALLS}, - {"Termcap_TermInfo", TRACE_DATABASE}, - {"Attributes_And_Colors", TRACE_ATTRS}, - {(char *)0, 0} - }; - gen_reps(nap, name, sizeof(int), 0); -} - -static void -gen_menu_opt_rep(const char *name) -{ - static const name_attribute_pair nap[] = - { -#ifdef O_ONEVALUE - {"One_Valued", O_ONEVALUE}, -#endif -#ifdef O_SHOWDESC - {"Show_Descriptions", O_SHOWDESC}, -#endif -#ifdef O_ROWMAJOR - {"Row_Major_Order", O_ROWMAJOR}, -#endif -#ifdef O_IGNORECASE - {"Ignore_Case", O_IGNORECASE}, -#endif -#ifdef O_SHOWMATCH - {"Show_Matches", O_SHOWMATCH}, -#endif -#ifdef O_NONCYCLIC - {"Non_Cyclic", O_NONCYCLIC}, -#endif - {(char *)0, 0} - }; - gen_reps(nap, name, sizeof(int), 0); -} - -static void -gen_item_opt_rep(const char *name) -{ - static const name_attribute_pair nap[] = - { -#ifdef O_SELECTABLE - {"Selectable", O_SELECTABLE}, -#endif - {(char *)0, 0} - }; - gen_reps(nap, name, sizeof(int), 0); -} - -static void -gen_form_opt_rep(const char *name) -{ - static const name_attribute_pair nap[] = - { -#ifdef O_NL_OVERLOAD - {"NL_Overload", O_NL_OVERLOAD}, -#endif -#ifdef O_BS_OVERLOAD - {"BS_Overload", O_BS_OVERLOAD}, -#endif - {(char *)0, 0} - }; - gen_reps(nap, name, sizeof(int), 0); -} - -/* - * Generate the representation clause for the Field_Option_Set record - */ -static void -gen_field_opt_rep(const char *name) -{ - static const name_attribute_pair nap[] = - { -#ifdef O_VISIBLE - {"Visible", O_VISIBLE}, -#endif -#ifdef O_ACTIVE - {"Active", O_ACTIVE}, -#endif -#ifdef O_PUBLIC - {"Public", O_PUBLIC}, -#endif -#ifdef O_EDIT - {"Edit", O_EDIT}, -#endif -#ifdef O_WRAP - {"Wrap", O_WRAP}, -#endif -#ifdef O_BLANK - {"Blank", O_BLANK}, -#endif -#ifdef O_AUTOSKIP - {"Auto_Skip", O_AUTOSKIP}, -#endif -#ifdef O_NULLOK - {"Null_Ok", O_NULLOK}, -#endif -#ifdef O_PASSOK - {"Pass_Ok", O_PASSOK}, -#endif -#ifdef O_STATIC - {"Static", O_STATIC}, -#endif - {(char *)0, 0} - }; - gen_reps(nap, name, sizeof(int), 0); -} - -/* - * Generate a single key code constant definition. - */ -static void -keydef(const char *name, const char *old_name, int value, int mode) -{ - if (mode == 0) /* Generate the new name */ - printf(" %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value); - else - { - const char *s = old_name; - const char *t = name; - - /* generate the old name, but only if it doesn't conflict with the old - * name (Ada95 isn't case sensitive!) - */ - while (*s && *t && (toupper(UChar(*s++)) == toupper(UChar(*t++)))); - if (*s || *t) - printf(" %-16s : Special_Key_Code renames %s;\n", old_name, name); - } -} - -/* - * Generate constants for the key codes. When called with mode==0, a - * complete list with nice constant names in proper casing style will - * be generated. Otherwise a list of old (i.e. C-style) names will be - * generated, given that the name wasn't already defined in the "nice" - * list. - */ -static void -gen_keydefs(int mode) -{ - char buf[16]; - char obuf[16]; - int i; - -#ifdef KEY_CODE_YES - keydef("Key_Code_Yes", "KEY_CODE_YES", KEY_CODE_YES, mode); -#endif -#ifdef KEY_MIN - keydef("Key_Min", "KEY_MIN", KEY_MIN, mode); -#endif -#ifdef KEY_BREAK - keydef("Key_Break", "KEY_BREAK", KEY_BREAK, mode); -#endif -#ifdef KEY_DOWN - keydef("Key_Cursor_Down", "KEY_DOWN", KEY_DOWN, mode); -#endif -#ifdef KEY_UP - keydef("Key_Cursor_Up", "KEY_UP", KEY_UP, mode); -#endif -#ifdef KEY_LEFT - keydef("Key_Cursor_Left", "KEY_LEFT", KEY_LEFT, mode); -#endif -#ifdef KEY_RIGHT - keydef("Key_Cursor_Right", "KEY_RIGHT", KEY_RIGHT, mode); -#endif -#ifdef KEY_HOME - keydef("Key_Home", "KEY_HOME", KEY_HOME, mode); -#endif -#ifdef KEY_BACKSPACE - keydef("Key_Backspace", "KEY_BACKSPACE", KEY_BACKSPACE, mode); -#endif -#ifdef KEY_F0 - keydef("Key_F0", "KEY_F0", KEY_F0, mode); -#endif -#ifdef KEY_F - for (i = 1; i <= 24; i++) - { - sprintf(buf, "Key_F%d", i); - sprintf(obuf, "KEY_F%d", i); - keydef(buf, obuf, KEY_F(i), mode); - } -#endif -#ifdef KEY_DL - keydef("Key_Delete_Line", "KEY_DL", KEY_DL, mode); -#endif -#ifdef KEY_IL - keydef("Key_Insert_Line", "KEY_IL", KEY_IL, mode); -#endif -#ifdef KEY_DC - keydef("Key_Delete_Char", "KEY_DC", KEY_DC, mode); -#endif -#ifdef KEY_IC - keydef("Key_Insert_Char", "KEY_IC", KEY_IC, mode); -#endif -#ifdef KEY_EIC - keydef("Key_Exit_Insert_Mode", "KEY_EIC", KEY_EIC, mode); -#endif -#ifdef KEY_CLEAR - keydef("Key_Clear_Screen", "KEY_CLEAR", KEY_CLEAR, mode); -#endif -#ifdef KEY_EOS - keydef("Key_Clear_End_Of_Screen", "KEY_EOS", KEY_EOS, mode); -#endif -#ifdef KEY_EOL - keydef("Key_Clear_End_Of_Line", "KEY_EOL", KEY_EOL, mode); -#endif -#ifdef KEY_SF - keydef("Key_Scroll_1_Forward", "KEY_SF", KEY_SF, mode); -#endif -#ifdef KEY_SR - keydef("Key_Scroll_1_Backward", "KEY_SR", KEY_SR, mode); -#endif -#ifdef KEY_NPAGE - keydef("Key_Next_Page", "KEY_NPAGE", KEY_NPAGE, mode); -#endif -#ifdef KEY_PPAGE - keydef("Key_Previous_Page", "KEY_PPAGE", KEY_PPAGE, mode); -#endif -#ifdef KEY_STAB - keydef("Key_Set_Tab", "KEY_STAB", KEY_STAB, mode); -#endif -#ifdef KEY_CTAB - keydef("Key_Clear_Tab", "KEY_CTAB", KEY_CTAB, mode); -#endif -#ifdef KEY_CATAB - keydef("Key_Clear_All_Tabs", "KEY_CATAB", KEY_CATAB, mode); -#endif -#ifdef KEY_ENTER - keydef("Key_Enter_Or_Send", "KEY_ENTER", KEY_ENTER, mode); -#endif -#ifdef KEY_SRESET - keydef("Key_Soft_Reset", "KEY_SRESET", KEY_SRESET, mode); -#endif -#ifdef KEY_RESET - keydef("Key_Reset", "KEY_RESET", KEY_RESET, mode); -#endif -#ifdef KEY_PRINT - keydef("Key_Print", "KEY_PRINT", KEY_PRINT, mode); -#endif -#ifdef KEY_LL - keydef("Key_Bottom", "KEY_LL", KEY_LL, mode); -#endif -#ifdef KEY_A1 - keydef("Key_Upper_Left_Of_Keypad", "KEY_A1", KEY_A1, mode); -#endif -#ifdef KEY_A3 - keydef("Key_Upper_Right_Of_Keypad", "KEY_A3", KEY_A3, mode); -#endif -#ifdef KEY_B2 - keydef("Key_Center_Of_Keypad", "KEY_B2", KEY_B2, mode); -#endif -#ifdef KEY_C1 - keydef("Key_Lower_Left_Of_Keypad", "KEY_C1", KEY_C1, mode); -#endif -#ifdef KEY_C3 - keydef("Key_Lower_Right_Of_Keypad", "KEY_C3", KEY_C3, mode); -#endif -#ifdef KEY_BTAB - keydef("Key_Back_Tab", "KEY_BTAB", KEY_BTAB, mode); -#endif -#ifdef KEY_BEG - keydef("Key_Beginning", "KEY_BEG", KEY_BEG, mode); -#endif -#ifdef KEY_CANCEL - keydef("Key_Cancel", "KEY_CANCEL", KEY_CANCEL, mode); -#endif -#ifdef KEY_CLOSE - keydef("Key_Close", "KEY_CLOSE", KEY_CLOSE, mode); -#endif -#ifdef KEY_COMMAND - keydef("Key_Command", "KEY_COMMAND", KEY_COMMAND, mode); -#endif -#ifdef KEY_COPY - keydef("Key_Copy", "KEY_COPY", KEY_COPY, mode); -#endif -#ifdef KEY_CREATE - keydef("Key_Create", "KEY_CREATE", KEY_CREATE, mode); -#endif -#ifdef KEY_END - keydef("Key_End", "KEY_END", KEY_END, mode); -#endif -#ifdef KEY_EXIT - keydef("Key_Exit", "KEY_EXIT", KEY_EXIT, mode); -#endif -#ifdef KEY_FIND - keydef("Key_Find", "KEY_FIND", KEY_FIND, mode); -#endif -#ifdef KEY_HELP - keydef("Key_Help", "KEY_HELP", KEY_HELP, mode); -#endif -#ifdef KEY_MARK - keydef("Key_Mark", "KEY_MARK", KEY_MARK, mode); -#endif -#ifdef KEY_MESSAGE - keydef("Key_Message", "KEY_MESSAGE", KEY_MESSAGE, mode); -#endif -#ifdef KEY_MOVE - keydef("Key_Move", "KEY_MOVE", KEY_MOVE, mode); -#endif -#ifdef KEY_NEXT - keydef("Key_Next", "KEY_NEXT", KEY_NEXT, mode); -#endif -#ifdef KEY_OPEN - keydef("Key_Open", "KEY_OPEN", KEY_OPEN, mode); -#endif -#ifdef KEY_OPTIONS - keydef("Key_Options", "KEY_OPTIONS", KEY_OPTIONS, mode); -#endif -#ifdef KEY_PREVIOUS - keydef("Key_Previous", "KEY_PREVIOUS", KEY_PREVIOUS, mode); -#endif -#ifdef KEY_REDO - keydef("Key_Redo", "KEY_REDO", KEY_REDO, mode); -#endif -#ifdef KEY_REFERENCE - keydef("Key_Reference", "KEY_REFERENCE", KEY_REFERENCE, mode); -#endif -#ifdef KEY_REFRESH - keydef("Key_Refresh", "KEY_REFRESH", KEY_REFRESH, mode); -#endif -#ifdef KEY_REPLACE - keydef("Key_Replace", "KEY_REPLACE", KEY_REPLACE, mode); -#endif -#ifdef KEY_RESTART - keydef("Key_Restart", "KEY_RESTART", KEY_RESTART, mode); -#endif -#ifdef KEY_RESUME - keydef("Key_Resume", "KEY_RESUME", KEY_RESUME, mode); -#endif -#ifdef KEY_SAVE - keydef("Key_Save", "KEY_SAVE", KEY_SAVE, mode); -#endif -#ifdef KEY_SBEG - keydef("Key_Shift_Begin", "KEY_SBEG", KEY_SBEG, mode); -#endif -#ifdef KEY_SCANCEL - keydef("Key_Shift_Cancel", "KEY_SCANCEL", KEY_SCANCEL, mode); -#endif -#ifdef KEY_SCOMMAND - keydef("Key_Shift_Command", "KEY_SCOMMAND", KEY_SCOMMAND, mode); -#endif -#ifdef KEY_SCOPY - keydef("Key_Shift_Copy", "KEY_SCOPY", KEY_SCOPY, mode); -#endif -#ifdef KEY_SCREATE - keydef("Key_Shift_Create", "KEY_SCREATE", KEY_SCREATE, mode); -#endif -#ifdef KEY_SDC - keydef("Key_Shift_Delete_Char", "KEY_SDC", KEY_SDC, mode); -#endif -#ifdef KEY_SDL - keydef("Key_Shift_Delete_Line", "KEY_SDL", KEY_SDL, mode); -#endif -#ifdef KEY_SELECT - keydef("Key_Select", "KEY_SELECT", KEY_SELECT, mode); -#endif -#ifdef KEY_SEND - keydef("Key_Shift_End", "KEY_SEND", KEY_SEND, mode); -#endif -#ifdef KEY_SEOL - keydef("Key_Shift_Clear_End_Of_Line", "KEY_SEOL", KEY_SEOL, mode); -#endif -#ifdef KEY_SEXIT - keydef("Key_Shift_Exit", "KEY_SEXIT", KEY_SEXIT, mode); -#endif -#ifdef KEY_SFIND - keydef("Key_Shift_Find", "KEY_SFIND", KEY_SFIND, mode); -#endif -#ifdef KEY_SHELP - keydef("Key_Shift_Help", "KEY_SHELP", KEY_SHELP, mode); -#endif -#ifdef KEY_SHOME - keydef("Key_Shift_Home", "KEY_SHOME", KEY_SHOME, mode); -#endif -#ifdef KEY_SIC - keydef("Key_Shift_Insert_Char", "KEY_SIC", KEY_SIC, mode); -#endif -#ifdef KEY_SLEFT - keydef("Key_Shift_Cursor_Left", "KEY_SLEFT", KEY_SLEFT, mode); -#endif -#ifdef KEY_SMESSAGE - keydef("Key_Shift_Message", "KEY_SMESSAGE", KEY_SMESSAGE, mode); -#endif -#ifdef KEY_SMOVE - keydef("Key_Shift_Move", "KEY_SMOVE", KEY_SMOVE, mode); -#endif -#ifdef KEY_SNEXT - keydef("Key_Shift_Next_Page", "KEY_SNEXT", KEY_SNEXT, mode); -#endif -#ifdef KEY_SOPTIONS - keydef("Key_Shift_Options", "KEY_SOPTIONS", KEY_SOPTIONS, mode); -#endif -#ifdef KEY_SPREVIOUS - keydef("Key_Shift_Previous_Page", "KEY_SPREVIOUS", KEY_SPREVIOUS, mode); -#endif -#ifdef KEY_SPRINT - keydef("Key_Shift_Print", "KEY_SPRINT", KEY_SPRINT, mode); -#endif -#ifdef KEY_SREDO - keydef("Key_Shift_Redo", "KEY_SREDO", KEY_SREDO, mode); -#endif -#ifdef KEY_SREPLACE - keydef("Key_Shift_Replace", "KEY_SREPLACE", KEY_SREPLACE, mode); -#endif -#ifdef KEY_SRIGHT - keydef("Key_Shift_Cursor_Right", "KEY_SRIGHT", KEY_SRIGHT, mode); -#endif -#ifdef KEY_SRSUME - keydef("Key_Shift_Resume", "KEY_SRSUME", KEY_SRSUME, mode); -#endif -#ifdef KEY_SSAVE - keydef("Key_Shift_Save", "KEY_SSAVE", KEY_SSAVE, mode); -#endif -#ifdef KEY_SSUSPEND - keydef("Key_Shift_Suspend", "KEY_SSUSPEND", KEY_SSUSPEND, mode); -#endif -#ifdef KEY_SUNDO - keydef("Key_Shift_Undo", "KEY_SUNDO", KEY_SUNDO, mode); -#endif -#ifdef KEY_SUSPEND - keydef("Key_Suspend", "KEY_SUSPEND", KEY_SUSPEND, mode); -#endif -#ifdef KEY_UNDO - keydef("Key_Undo", "KEY_UNDO", KEY_UNDO, mode); -#endif -#ifdef KEY_MOUSE - keydef("Key_Mouse", "KEY_MOUSE", KEY_MOUSE, mode); -#endif -#ifdef KEY_RESIZE - keydef("Key_Resize", "KEY_RESIZE", KEY_RESIZE, mode); -#endif -} - -/* - * Generate a constant with the given name. The second parameter - * is a reference to the ACS character in the acs_map[] array and - * will be translated into an index. - */ -static void -acs_def(const char *name, chtype *a) -{ - int c = (int)(a - &acs_map[0]); - - printf(" %-24s : constant Character := ", name); - if (isprint(UChar(c)) && (c != '`')) - printf("'%c';\n", c); - else - printf("Character'Val (%d);\n", c); -} - -/* - * Generate the constants for the ACS characters - */ -static void -gen_acs(void) -{ - printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n"); - printf(" of Attributed_Character;\n"); -#if USE_REENTRANT || BROKEN_LINKER - printf(" type C_ACS_Ptr is access C_ACS_Map;\n"); - printf(" function ACS_Map return C_ACS_Ptr;\n"); - printf(" pragma Import (C, ACS_Map, \"" - NCURSES_WRAP_PREFIX - "acs_map\");\n"); -#else - printf(" ACS_Map : C_ACS_Map;\n"); - printf(" pragma Import (C, ACS_Map, \"acs_map\");\n"); -#endif - printf(" --\n"); - printf(" --\n"); - printf(" -- Constants for several characters from the Alternate Character Set\n"); - printf(" -- You must use these constants as indices into the ACS_Map array\n"); - printf(" -- to get the corresponding attributed character at runtime.\n"); - printf(" --\n"); - -#ifdef ACS_ULCORNER - acs_def("ACS_Upper_Left_Corner", &ACS_ULCORNER); -#endif -#ifdef ACS_LLCORNER - acs_def("ACS_Lower_Left_Corner", &ACS_LLCORNER); -#endif -#ifdef ACS_URCORNER - acs_def("ACS_Upper_Right_Corner", &ACS_URCORNER); -#endif -#ifdef ACS_LRCORNER - acs_def("ACS_Lower_Right_Corner", &ACS_LRCORNER); -#endif -#ifdef ACS_LTEE - acs_def("ACS_Left_Tee", &ACS_LTEE); -#endif -#ifdef ACS_RTEE - acs_def("ACS_Right_Tee", &ACS_RTEE); -#endif -#ifdef ACS_BTEE - acs_def("ACS_Bottom_Tee", &ACS_BTEE); -#endif -#ifdef ACS_TTEE - acs_def("ACS_Top_Tee", &ACS_TTEE); -#endif -#ifdef ACS_HLINE - acs_def("ACS_Horizontal_Line", &ACS_HLINE); -#endif -#ifdef ACS_VLINE - acs_def("ACS_Vertical_Line", &ACS_VLINE); -#endif -#ifdef ACS_PLUS - acs_def("ACS_Plus_Symbol", &ACS_PLUS); -#endif -#ifdef ACS_S1 - acs_def("ACS_Scan_Line_1", &ACS_S1); -#endif -#ifdef ACS_S9 - acs_def("ACS_Scan_Line_9", &ACS_S9); -#endif -#ifdef ACS_DIAMOND - acs_def("ACS_Diamond", &ACS_DIAMOND); -#endif -#ifdef ACS_CKBOARD - acs_def("ACS_Checker_Board", &ACS_CKBOARD); -#endif -#ifdef ACS_DEGREE - acs_def("ACS_Degree", &ACS_DEGREE); -#endif -#ifdef ACS_PLMINUS - acs_def("ACS_Plus_Minus", &ACS_PLMINUS); -#endif -#ifdef ACS_BULLET - acs_def("ACS_Bullet", &ACS_BULLET); -#endif -#ifdef ACS_LARROW - acs_def("ACS_Left_Arrow", &ACS_LARROW); -#endif -#ifdef ACS_RARROW - acs_def("ACS_Right_Arrow", &ACS_RARROW); -#endif -#ifdef ACS_DARROW - acs_def("ACS_Down_Arrow", &ACS_DARROW); -#endif -#ifdef ACS_UARROW - acs_def("ACS_Up_Arrow", &ACS_UARROW); -#endif -#ifdef ACS_BOARD - acs_def("ACS_Board_Of_Squares", &ACS_BOARD); -#endif -#ifdef ACS_LANTERN - acs_def("ACS_Lantern", &ACS_LANTERN); -#endif -#ifdef ACS_BLOCK - acs_def("ACS_Solid_Block", &ACS_BLOCK); -#endif -#ifdef ACS_S3 - acs_def("ACS_Scan_Line_3", &ACS_S3); -#endif -#ifdef ACS_S7 - acs_def("ACS_Scan_Line_7", &ACS_S7); -#endif -#ifdef ACS_LEQUAL - acs_def("ACS_Less_Or_Equal", &ACS_LEQUAL); -#endif -#ifdef ACS_GEQUAL - acs_def("ACS_Greater_Or_Equal", &ACS_GEQUAL); -#endif -#ifdef ACS_PI - acs_def("ACS_PI", &ACS_PI); -#endif -#ifdef ACS_NEQUAL - acs_def("ACS_Not_Equal", &ACS_NEQUAL); -#endif -#ifdef ACS_STERLING - acs_def("ACS_Sterling", &ACS_STERLING); -#endif -} - -#define GEN_EVENT(name,value) \ - printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \ - #name, value) - -#define GEN_MEVENT(name) \ - printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \ - #name, name) - -static void -gen_mouse_events(void) -{ - mmask_t all1 = 0; - mmask_t all2 = 0; - mmask_t all3 = 0; - mmask_t all4 = 0; - -#ifdef BUTTON1_RELEASED - GEN_MEVENT(BUTTON1_RELEASED); - all1 |= BUTTON1_RELEASED; -#endif -#ifdef BUTTON1_PRESSED - GEN_MEVENT(BUTTON1_PRESSED); - all1 |= BUTTON1_PRESSED; -#endif -#ifdef BUTTON1_CLICKED - GEN_MEVENT(BUTTON1_CLICKED); - all1 |= BUTTON1_CLICKED; -#endif -#ifdef BUTTON1_DOUBLE_CLICKED - GEN_MEVENT(BUTTON1_DOUBLE_CLICKED); - all1 |= BUTTON1_DOUBLE_CLICKED; -#endif -#ifdef BUTTON1_TRIPLE_CLICKED - GEN_MEVENT(BUTTON1_TRIPLE_CLICKED); - all1 |= BUTTON1_TRIPLE_CLICKED; -#endif -#ifdef BUTTON1_RESERVED_EVENT - GEN_MEVENT(BUTTON1_RESERVED_EVENT); - all1 |= BUTTON1_RESERVED_EVENT; -#endif -#ifdef BUTTON2_RELEASED - GEN_MEVENT(BUTTON2_RELEASED); - all2 |= BUTTON2_RELEASED; -#endif -#ifdef BUTTON2_PRESSED - GEN_MEVENT(BUTTON2_PRESSED); - all2 |= BUTTON2_PRESSED; -#endif -#ifdef BUTTON2_CLICKED - GEN_MEVENT(BUTTON2_CLICKED); - all2 |= BUTTON2_CLICKED; -#endif -#ifdef BUTTON2_DOUBLE_CLICKED - GEN_MEVENT(BUTTON2_DOUBLE_CLICKED); - all2 |= BUTTON2_DOUBLE_CLICKED; -#endif -#ifdef BUTTON2_TRIPLE_CLICKED - GEN_MEVENT(BUTTON2_TRIPLE_CLICKED); - all2 |= BUTTON2_TRIPLE_CLICKED; -#endif -#ifdef BUTTON2_RESERVED_EVENT - GEN_MEVENT(BUTTON2_RESERVED_EVENT); - all2 |= BUTTON2_RESERVED_EVENT; -#endif -#ifdef BUTTON3_RELEASED - GEN_MEVENT(BUTTON3_RELEASED); - all3 |= BUTTON3_RELEASED; -#endif -#ifdef BUTTON3_PRESSED - GEN_MEVENT(BUTTON3_PRESSED); - all3 |= BUTTON3_PRESSED; -#endif -#ifdef BUTTON3_CLICKED - GEN_MEVENT(BUTTON3_CLICKED); - all3 |= BUTTON3_CLICKED; -#endif -#ifdef BUTTON3_DOUBLE_CLICKED - GEN_MEVENT(BUTTON3_DOUBLE_CLICKED); - all3 |= BUTTON3_DOUBLE_CLICKED; -#endif -#ifdef BUTTON3_TRIPLE_CLICKED - GEN_MEVENT(BUTTON3_TRIPLE_CLICKED); - all3 |= BUTTON3_TRIPLE_CLICKED; -#endif -#ifdef BUTTON3_RESERVED_EVENT - GEN_MEVENT(BUTTON3_RESERVED_EVENT); - all3 |= BUTTON3_RESERVED_EVENT; -#endif -#ifdef BUTTON4_RELEASED - GEN_MEVENT(BUTTON4_RELEASED); - all4 |= BUTTON4_RELEASED; -#endif -#ifdef BUTTON4_PRESSED - GEN_MEVENT(BUTTON4_PRESSED); - all4 |= BUTTON4_PRESSED; -#endif -#ifdef BUTTON4_CLICKED - GEN_MEVENT(BUTTON4_CLICKED); - all4 |= BUTTON4_CLICKED; -#endif -#ifdef BUTTON4_DOUBLE_CLICKED - GEN_MEVENT(BUTTON4_DOUBLE_CLICKED); - all4 |= BUTTON4_DOUBLE_CLICKED; -#endif -#ifdef BUTTON4_TRIPLE_CLICKED - GEN_MEVENT(BUTTON4_TRIPLE_CLICKED); - all4 |= BUTTON4_TRIPLE_CLICKED; -#endif -#ifdef BUTTON4_RESERVED_EVENT - GEN_MEVENT(BUTTON4_RESERVED_EVENT); - all4 |= BUTTON4_RESERVED_EVENT; -#endif -#ifdef BUTTON_CTRL - GEN_MEVENT(BUTTON_CTRL); -#endif -#ifdef BUTTON_SHIFT - GEN_MEVENT(BUTTON_SHIFT); -#endif -#ifdef BUTTON_ALT - GEN_MEVENT(BUTTON_ALT); -#endif -#ifdef REPORT_MOUSE_POSITION - GEN_MEVENT(REPORT_MOUSE_POSITION); -#endif -#ifdef ALL_MOUSE_EVENTS - GEN_MEVENT(ALL_MOUSE_EVENTS); -#endif - - GEN_EVENT(BUTTON1_EVENTS, all1); - GEN_EVENT(BUTTON2_EVENTS, all2); - GEN_EVENT(BUTTON3_EVENTS, all3); - GEN_EVENT(BUTTON4_EVENTS, all4); -} - -static void -wrap_one_var(const char *c_var, - const char *c_type, - const char *ada_func, - const char *ada_type) -{ -#if USE_REENTRANT - /* must wrap variables */ - printf("\n"); - printf(" function %s return %s\n", ada_func, ada_type); - printf(" is\n"); - printf(" function Result return %s;\n", c_type); - printf(" pragma Import (C, Result, \"" NCURSES_WRAP_PREFIX "%s\");\n", c_var); - printf(" begin\n"); - if (strcmp(c_type, ada_type)) - printf(" return %s (Result);\n", ada_type); - else - printf(" return Result;\n"); - printf(" end %s;\n", ada_func); -#else - /* global variables are really global */ - printf("\n"); - printf(" function %s return %s\n", ada_func, ada_type); - printf(" is\n"); - printf(" Result : %s;\n", c_type); - printf(" pragma Import (C, Result, \"%s\");\n", c_var); - printf(" begin\n"); - if (strcmp(c_type, ada_type)) - printf(" return %s (Result);\n", ada_type); - else - printf(" return Result;\n"); - printf(" end %s;\n", ada_func); -#endif -} - -#define GEN_PUBLIC_VAR(c_var, c_type, ada_func, ada_type) \ - wrap_one_var(#c_var, #c_type, #ada_func, #ada_type) - -static void -gen_public_vars(void) -{ - GEN_PUBLIC_VAR(stdscr, Window, Standard_Window, Window); - GEN_PUBLIC_VAR(curscr, Window, Current_Window, Window); - GEN_PUBLIC_VAR(LINES, C_Int, Lines, Line_Count); - GEN_PUBLIC_VAR(COLS, C_Int, Columns, Column_Count); - GEN_PUBLIC_VAR(TABSIZE, C_Int, Tab_Size, Natural); - GEN_PUBLIC_VAR(COLORS, C_Int, Number_Of_Colors, Natural); - GEN_PUBLIC_VAR(COLOR_PAIRS, C_Int, Number_Of_Color_Pairs, Natural); -} - -/* - * Output some comment lines indicating that the file is generated. - * The name parameter is the name of the facility to be used in - * the comment. - */ -static void -prologue(const char *name) -{ - printf("-- %s binding.\n", name); - printf("-- This module is generated. Please don't change it manually!\n"); - printf("-- Run the generator instead.\n-- |"); - - printf("define(`M4_BIT_ORDER',`%s_Order_First')", - little_endian ? "Low" : "High"); -} - -/* - * Write the prologue for the curses facility and make sure that - * KEY_MIN and KEY_MAX are defined for the rest of this source. - */ -static void -basedefs(void) -{ - prologue("curses"); -#ifndef KEY_MAX -# define KEY_MAX 0777 -#endif - printf("define(`M4_KEY_MAX',`8#%o#')", KEY_MAX); -#ifndef KEY_MIN -# define KEY_MIN 0401 -#endif - if (KEY_MIN == 256) - { - fprintf(stderr, "Unexpected value for KEY_MIN: %d\n", KEY_MIN); - exit(1); - } - printf("define(`M4_SPECIAL_FIRST',`8#%o#')", KEY_MIN - 1); -} - -/* - * Write out the comment lines for the menu facility - */ -static void -menu_basedefs(void) -{ - prologue("menu"); -} - -/* - * Write out the comment lines for the form facility - */ -static void -form_basedefs(void) -{ - prologue("form"); -} - -/* - * Write out the comment lines for the mouse facility - */ -static void -mouse_basedefs(void) -{ - prologue("mouse"); -} - -/* - * Write the definition of a single color - */ -static void -color_def(const char *name, int value) -{ - printf(" %-16s : constant Color_Number := %d;\n", name, value); -} - -/* - * Generate all color definitions - */ -static void -gen_color(void) -{ -#if HAVE_USE_DEFAULT_COLORS - color_def("Default_Color", -1); -#endif -#ifdef COLOR_BLACK - color_def("Black", COLOR_BLACK); -#endif -#ifdef COLOR_RED - color_def("Red", COLOR_RED); -#endif -#ifdef COLOR_GREEN - color_def("Green", COLOR_GREEN); -#endif -#ifdef COLOR_YELLOW - color_def("Yellow", COLOR_YELLOW); -#endif -#ifdef COLOR_BLUE - color_def("Blue", COLOR_BLUE); -#endif -#ifdef COLOR_MAGENTA - color_def("Magenta", COLOR_MAGENTA); -#endif -#ifdef COLOR_CYAN - color_def("Cyan", COLOR_CYAN); -#endif -#ifdef COLOR_WHITE - color_def("White", COLOR_WHITE); -#endif -} - -/* - * Generate the linker options for the base facility - */ -static void -gen_linkopts(void) -{ - printf(" pragma Linker_Options (\"-lncurses%s\");\n", model); -} - -/* - * Generate the linker options for the menu facility - */ -static void -gen_menu_linkopts(void) -{ - printf(" pragma Linker_Options (\"-lmenu%s\");\n", model); -} - -/* - * Generate the linker options for the form facility - */ -static void -gen_form_linkopts(void) -{ - printf(" pragma Linker_Options (\"-lform%s\");\n", model); -} - -/* - * Generate the linker options for the panel facility - */ -static void -gen_panel_linkopts(void) -{ - printf(" pragma Linker_Options (\"-lpanel%s\");\n", model); -} - -static void -gen_version_info(void) -{ - static const char *v1 = - " NC_Major_Version : constant := %d; -- Major version of the library\n"; - static const char *v2 = - " NC_Minor_Version : constant := %d; -- Minor version of the library\n"; - static const char *v3 = - " NC_Version : constant String := %c%d.%d%c; -- Version of library\n"; - - printf(v1, NCURSES_VERSION_MAJOR); - printf(v2, NCURSES_VERSION_MINOR); - printf(v3, '"', NCURSES_VERSION_MAJOR, NCURSES_VERSION_MINOR, '"'); -} - -static int -eti_gen(char *buf, int code, const char *name, int *etimin, int *etimax) -{ - sprintf(buf, " E_%-16s : constant Eti_Error := %d;\n", name, code); - if (code < *etimin) - *etimin = code; - if (code > *etimax) - *etimax = code; - return (int)strlen(buf); -} - -static void -gen_offsets(void) -{ - const char *s_bool = ""; - - if (sizeof(bool) == sizeof(char)) - { - s_bool = "char"; - } - else if (sizeof(bool) == sizeof(short)) - { - s_bool = "short"; - } - else if (sizeof(bool) == sizeof(int)) - { - s_bool = "int"; - } - printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n", - 12, "_bool", (long)sizeof(bool), "bool"); - - printf(" type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n", s_bool); -} - -/* - * main() expects two arguments on the commandline, both single characters. - * The first character denotes the facility for which we generate output. - * Possible values are - * B - Base - * M - Menus - * F - Forms - * P - Pointer Device (Mouse) - * E - ETI base definitions - * - * The second character then denotes the specific output that should be - * generated for the selected facility. - */ -int -main(int argc, char *argv[]) -{ - int x = 0x12345678; - char *s = (char *)&x; - - if (*s == 0x78) - little_endian = 1; - - if (argc != 4) - exit(1); - model = *++argv; - - switch (argv[1][0]) - { - /* --------------------------------------------------------------- */ - case 'B': /* The Base facility */ - switch (argv[2][0]) - { - case 'A': /* chtype translation into Ada95 record type */ - gen_attr_set("Character_Attribute_Set"); - break; - case 'B': /* write some initial comment lines */ - basedefs(); - break; - case 'C': /* generate color constants */ - gen_color(); - break; - case 'D': /* generate displacements of fields in WINDOW struct. */ - gen_offsets(); - break; - case 'E': /* generate Mouse Event codes */ - gen_mouse_events(); - break; - case 'K': /* translation of keycodes */ - gen_keydefs(0); - break; - case 'L': /* generate the Linker_Options pragma */ - gen_linkopts(); - break; - case 'M': /* generate constants for the ACS characters */ - gen_acs(); - break; - case 'O': /* generate definitions of the old key code names */ - gen_keydefs(1); - break; - case 'P': /* generate definitions of the public variables */ - gen_public_vars(); - break; - case 'R': /* generate representation clause for Attributed character */ - gen_chtype_rep("Attributed_Character"); - break; - case 'T': /* generate the Trace info */ - gen_trace("Trace_Attribute_Set"); - break; - case 'V': /* generate version info */ - gen_version_info(); - break; - default: - break; - } - break; - /* --------------------------------------------------------------- */ - case 'M': /* The Menu facility */ - switch (argv[2][0]) - { - case 'R': /* generate representation clause for Menu_Option_Set */ - gen_menu_opt_rep("Menu_Option_Set"); - break; - case 'B': /* write some initial comment lines */ - menu_basedefs(); - break; - case 'L': /* generate the Linker_Options pragma */ - gen_menu_linkopts(); - break; - case 'I': /* generate representation clause for Item_Option_Set */ - gen_item_opt_rep("Item_Option_Set"); - break; - default: - break; - } - break; - /* --------------------------------------------------------------- */ - case 'F': /* The Form facility */ - switch (argv[2][0]) - { - case 'R': /* generate representation clause for Form_Option_Set */ - gen_form_opt_rep("Form_Option_Set"); - break; - case 'B': /* write some initial comment lines */ - form_basedefs(); - break; - case 'L': /* generate the Linker_Options pragma */ - gen_form_linkopts(); - break; - case 'I': /* generate representation clause for Field_Option_Set */ - gen_field_opt_rep("Field_Option_Set"); - break; - default: - break; - } - break; - /* --------------------------------------------------------------- */ - case 'P': /* The Pointer(=Mouse) facility */ - switch (argv[2][0]) - { - case 'B': /* write some initial comment lines */ - mouse_basedefs(); - break; - case 'M': /* generate representation clause for Mouse_Event */ - gen_mrep_rep("Mouse_Event"); - break; - case 'L': /* generate the Linker_Options pragma */ - gen_panel_linkopts(); - break; - default: - break; - } - break; - /* --------------------------------------------------------------- */ - case 'E': /* chtype size detection */ - switch (argv[2][0]) - { - case 'C': - { - const char *fmt = " type C_Chtype is new %s;\n"; - const char *afmt = " type C_AttrType is new %s;\n"; - - if (sizeof(chtype) == sizeof(int)) - { - if (sizeof(int) == sizeof(long)) - printf(fmt, "C_ULong"); - - else - printf(fmt, "C_UInt"); - } - else if (sizeof(chtype) == sizeof(long)) - { - printf(fmt, "C_ULong"); - } - else - printf("Error\n"); - - if (sizeof(attr_t) == sizeof(int)) - { - if (sizeof(int) == sizeof(long)) - printf(afmt, "C_ULong"); - - else - printf(afmt, "C_UInt"); - } - else if (sizeof(attr_t) == sizeof(long)) - { - printf(afmt, "C_ULong"); - } - else - printf("Error\n"); - - printf("define(`CF_CURSES_OK',`%d')", OK); - printf("define(`CF_CURSES_ERR',`%d')", ERR); - printf("define(`CF_CURSES_TRUE',`%d')", TRUE); - printf("define(`CF_CURSES_FALSE',`%d')", FALSE); - } - break; - case 'E': - { - char *buf = (char *)malloc(2048); - char *p = buf; - int etimin = E_OK; - int etimax = E_OK; - - if (p) - { - p += eti_gen(p, E_OK, "Ok", &etimin, &etimax); - p += eti_gen(p, E_SYSTEM_ERROR, "System_Error", &etimin, &etimax); - p += eti_gen(p, E_BAD_ARGUMENT, "Bad_Argument", &etimin, &etimax); - p += eti_gen(p, E_POSTED, "Posted", &etimin, &etimax); - p += eti_gen(p, E_CONNECTED, "Connected", &etimin, &etimax); - p += eti_gen(p, E_BAD_STATE, "Bad_State", &etimin, &etimax); - p += eti_gen(p, E_NO_ROOM, "No_Room", &etimin, &etimax); - p += eti_gen(p, E_NOT_POSTED, "Not_Posted", &etimin, &etimax); - p += eti_gen(p, E_UNKNOWN_COMMAND, - "Unknown_Command", &etimin, &etimax); - p += eti_gen(p, E_NO_MATCH, "No_Match", &etimin, &etimax); - p += eti_gen(p, E_NOT_SELECTABLE, - "Not_Selectable", &etimin, &etimax); - p += eti_gen(p, E_NOT_CONNECTED, - "Not_Connected", &etimin, &etimax); - p += eti_gen(p, E_REQUEST_DENIED, - "Request_Denied", &etimin, &etimax); - p += eti_gen(p, E_INVALID_FIELD, - "Invalid_Field", &etimin, &etimax); - p += eti_gen(p, E_CURRENT, - "Current", &etimin, &etimax); - } - printf(" subtype Eti_Error is C_Int range %d .. %d;\n\n", - etimin, etimax); - printf("%s", buf); - } - break; - default: - break; - } - break; - /* --------------------------------------------------------------- */ - case 'V': /* plain version dump */ - { - switch (argv[2][0]) - { - case '1': /* major version */ -#ifdef NCURSES_VERSION_MAJOR - printf("%d", NCURSES_VERSION_MAJOR); -#endif - break; - case '2': /* minor version */ -#ifdef NCURSES_VERSION_MINOR - printf("%d", NCURSES_VERSION_MINOR); -#endif - break; - case '3': /* patch level */ -#ifdef NCURSES_VERSION_PATCH - printf("%d", NCURSES_VERSION_PATCH); -#endif - break; - default: - break; - } - } - break; - /* --------------------------------------------------------------- */ - default: - break; - } - return 0; -} diff --git a/Ada95/gen/html.m4 b/Ada95/gen/html.m4 deleted file mode 100644 index 8df2653c7ec..00000000000 --- a/Ada95/gen/html.m4 +++ /dev/null @@ -1,40 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 2000-2006,2007 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl $Id: html.m4,v 1.3 2007/09/01 23:59:59 tom Exp $ -define(`ANCHORIDX',`0')dnl -define(`MANPAGE',`define(`MANPG',$1)dnl -|===================================================================== - -- | Man page MANPG - -- |=====================================================================')dnl -define(`ANCHOR',`define(`ANCHORIDX',incr(ANCHORIDX))dnl -`#'1A NAME="AFU`_'ANCHORIDX"`#'2dnl -define(`CFUNAME',`$1')define(`AFUNAME',`$2')dnl -|')dnl -define(`AKA',``AKA': CFUNAME')dnl -define(`ALIAS',``AKA': $1')dnl diff --git a/Ada95/gen/normal.m4 b/Ada95/gen/normal.m4 deleted file mode 100644 index 95299768314..00000000000 --- a/Ada95/gen/normal.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 1998,2006 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl $Id: normal.m4,v 1.2 2006/04/22 23:16:14 tom Exp $ -define(`MANPAGE',`define(`MANPG',$1)dnl -|===================================================================== - -- | Man page MANPG - -- |=====================================================================')dnl -define(`ANCHOR',`define(`CFUNAME',`$1')define(`AFUNAME',`$2')'dnl -|)dnl -define(`AKA',``AKA': CFUNAME')dnl -define(`ALIAS',``AKA': $1')dnl diff --git a/Ada95/gen/table.m4 b/Ada95/gen/table.m4 deleted file mode 100644 index 36b0027b8d1..00000000000 --- a/Ada95/gen/table.m4 +++ /dev/null @@ -1,35 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 2000,2006 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl $Id: table.m4,v 1.2 2006/04/22 23:16:44 tom Exp $ -define(`ANCHORIDX',`0')dnl -define(`MANPAGE',`define(`MANPG',$1)')dnl -divert(-1)dnl -define(`ANCHOR',`divert(0)define(`ANCHORIDX',incr(ANCHORIDX))dnl -$1$2MANPG -divert(-1)') diff --git a/Ada95/gen/terminal_interface-curses-aux.ads.m4 b/Ada95/gen/terminal_interface-curses-aux.ads.m4 deleted file mode 100644 index 111ec698a49..00000000000 --- a/Ada95/gen/terminal_interface-curses-aux.ads.m4 +++ /dev/null @@ -1,105 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-aux__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Aux -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.18 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -include(`Base_Defs') -with System; -with Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Unchecked_Conversion; - -package Terminal_Interface.Curses.Aux is - pragma Preelaborate (Terminal_Interface.Curses.Aux); - - use type Interfaces.C.int; - - subtype C_Int is Interfaces.C.int; - subtype C_Short is Interfaces.C.short; - subtype C_Long_Int is Interfaces.C.long; - subtype C_Size_T is Interfaces.C.size_t; - subtype C_UInt is Interfaces.C.unsigned; - subtype C_ULong is Interfaces.C.unsigned_long; - subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr; - type C_Void_Ptr is new System.Address; -include(`Chtype_Def') - -- This is how those constants are defined in ncurses. I see them also - -- exactly like this in all ETI implementations I ever tested. So it - -- could be that this is quite general, but please check with your curses. - -- This is critical, because curses sometime mixes Boolean returns with - -- returning an error status. - Curses_Ok : constant C_Int := CF_CURSES_OK; - Curses_Err : constant C_Int := CF_CURSES_ERR; - - Curses_True : constant C_Int := CF_CURSES_TRUE; - Curses_False : constant C_Int := CF_CURSES_FALSE; - - -- Eti_Error: type for error codes returned by the menu and form subsystem -include(`Eti_Defs') - procedure Eti_Exception (Code : Eti_Error); - -- Dispatch the error code and raise the appropriate exception - -- - -- - -- Some helpers - function Chtype_To_AttrChar is new - Unchecked_Conversion (Source => C_Chtype, - Target => Attributed_Character); - function AttrChar_To_Chtype is new - Unchecked_Conversion (Source => Attributed_Character, - Target => C_Chtype); - - function AttrChar_To_AttrType is new - Unchecked_Conversion (Source => Attributed_Character, - Target => C_AttrType); - - function AttrType_To_AttrChar is new - Unchecked_Conversion (Source => C_AttrType, - Target => Attributed_Character); - - procedure Fill_String (Cp : chars_ptr; - Str : out String); - -- Fill the Str parameter with the string denoted by the chars_ptr - -- C-Style string. - - function Fill_String (Cp : chars_ptr) return String; - -- Same but as function. - -end Terminal_Interface.Curses.Aux; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 deleted file mode 100644 index b8481d59714..00000000000 --- a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 +++ /dev/null @@ -1,238 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.16 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; - -package Terminal_Interface.Curses.Forms.Field_Types is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types); - use type Interfaces.C.int; - subtype C_Int is Interfaces.C.int; - - -- MANPAGE(`form_fieldtype.3x') - - type Field_Type is abstract tagged null record; - -- Abstract base type for all field types. A concrete field type - -- is an extension that adds some data elements describing formats or - -- boundary values for the type and validation routines. - -- For the builtin low-level fieldtypes, the validation routines are - -- already defined by the low-level C library. - -- The builtin types like Alpha or AlphaNumeric etc. are defined in - -- child packages of this package. You may use one of them as example - -- how to create you own child packages for low-level field types that - -- you may have already written in C. - - type Field_Type_Access is access all Field_Type'Class; - - -- ANCHOR(`set_field_type()',`Set_Type') - procedure Set_Field_Type (Fld : Field; - Fld_Type : Field_Type) is abstract; - -- AKA - -- But: we hide the vararg mechanism of the C interface. You always - -- have to pass a single Field_Type parameter. - - -- --------------------------------------------------------------------- - - -- MANPAGE(`form_field_validation.3x') - - -- ANCHOR(`field_type()',`Get_Type') - function Get_Type (Fld : Field) return Field_Type_Access; - -- AKA - -- ALIAS(`field_arg()') - -- In Ada95 we can combine these. If you try to retrieve the field type - -- that is not defined as extension of the abstract tagged type above, - -- you will raise a Form_Exception. - -- This is not inlined - - -- +---------------------------------------------------------------------- - -- | Private Part. - -- | Most of this is used by the implementations of the child packages. - -- | -private - type Makearg_Function is access - function (Args : System.Address) return System.Address; - pragma Convention (C, Makearg_Function); - - type Copyarg_Function is access - function (Usr : System.Address) return System.Address; - pragma Convention (C, Copyarg_Function); - - type Freearg_Function is access - procedure (Usr : System.Address); - pragma Convention (C, Freearg_Function); - - type Field_Check_Function is access - function (Fld : Field; Usr : System.Address) return Curses_Bool; - pragma Convention (C, Field_Check_Function); - - type Char_Check_Function is access - function (Ch : C_Int; Usr : System.Address) return Curses_Bool; - pragma Convention (C, Char_Check_Function); - - type Choice_Function is access - function (Fld : Field; Usr : System.Address) return Curses_Bool; - pragma Convention (C, Choice_Function); - - -- +---------------------------------------------------------------------- - -- | This must be in sync with the FIELDTYPE structure in form.h - -- | - type Low_Level_Field_Type is - record - Status : Interfaces.C.unsigned_short; - Ref_Count : Interfaces.C.long; - Left, Right : System.Address; - Makearg : Makearg_Function; - Copyarg : Copyarg_Function; - Freearg : Freearg_Function; - Fcheck : Field_Check_Function; - Ccheck : Char_Check_Function; - Next, Prev : Choice_Function; - end record; - pragma Convention (C, Low_Level_Field_Type); - type C_Field_Type is access all Low_Level_Field_Type; - - Null_Field_Type : constant C_Field_Type := null; - - -- +---------------------------------------------------------------------- - -- | This four low-level fieldtypes are the ones associated with - -- | fieldtypes handled by this binding. Any other low-level fieldtype - -- | will result in a Form_Exception is function Get_Type. - -- | - M_Generic_Type : C_Field_Type := null; - M_Generic_Choice : C_Field_Type := null; - M_Builtin_Router : C_Field_Type := null; - M_Choice_Router : C_Field_Type := null; - - -- Two wrapper functions to access those low-level fieldtypes defined - -- in this package. - function C_Builtin_Router return C_Field_Type; - function C_Choice_Router return C_Field_Type; - - procedure Wrap_Builtin (Fld : Field; - Typ : Field_Type'Class; - Cft : C_Field_Type := C_Builtin_Router); - -- This procedure has to be called by the Set_Field_Type implementation - -- for builtin low-level fieldtypes to replace it by an Ada95 - -- conformant Field_Type object. - -- The parameter Cft must be C_Builtin_Router for regular low-level - -- fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for - -- low-level fieldtypes witch choice functions (like TYP_ENUM). - -- Any other value will raise a Form_Exception. - - function Make_Arg (Args : System.Address) return System.Address; - pragma Import (C, Make_Arg, "void_star_make_arg"); - -- This is the Makearg_Function for the internal low-level types - -- introduced by this binding. - - function Copy_Arg (Usr : System.Address) return System.Address; - pragma Convention (C, Copy_Arg); - -- This is the Copyarg_Function for the internal low-level types - -- introduced by this binding. - - procedure Free_Arg (Usr : System.Address); - pragma Convention (C, Free_Arg); - -- This is the Freearg_Function for the internal low-level types - -- introduced by this binding. - - function Field_Check_Router (Fld : Field; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Field_Check_Router); - -- This is the Field_Check_Function for the internal low-level types - -- introduced to wrap the low-level types by a Field_Type derived - -- type. It routes the call to the corresponding low-level validation - -- function. - - function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Char_Check_Router); - -- This is the Char_Check_Function for the internal low-level types - -- introduced to wrap the low-level types by a Field_Type derived - -- type. It routes the call to the corresponding low-level validation - -- function. - - function Next_Router (Fld : Field; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Next_Router); - -- This is the Choice_Function for the internal low-level types - -- introduced to wrap the low-level types by a Field_Type derived - -- type. It routes the call to the corresponding low-level next_choice - -- function. - - function Prev_Router (Fld : Field; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Prev_Router); - -- This is the Choice_Function for the internal low-level types - -- introduced to wrap the low-level types by a Field_Type derived - -- type. It routes the call to the corresponding low-level prev_choice - -- function. - - -- This is the Argument structure maintained by all low-level field types - -- introduced by this binding. - type Argument is record - Typ : Field_Type_Access; -- the Field_Type creating this record - Usr : System.Address; -- original arg for builtin low-level types - Cft : C_Field_Type; -- the original low-level type - end record; - type Argument_Access is access all Argument; - - -- +---------------------------------------------------------------------- - -- | - -- | Some Imports of libform routines to deal with low-level fieldtypes. - -- | - function New_Fieldtype (Fcheck : Field_Check_Function; - Ccheck : Char_Check_Function) - return C_Field_Type; - pragma Import (C, New_Fieldtype, "new_fieldtype"); - - function Set_Fieldtype_Arg (Cft : C_Field_Type; - Mak : Makearg_Function := Make_Arg'Access; - Cop : Copyarg_Function := Copy_Arg'Access; - Fre : Freearg_Function := Free_Arg'Access) - return C_Int; - pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg"); - - function Set_Fieldtype_Choice (Cft : C_Field_Type; - Next, Prev : Choice_Function) - return C_Int; - pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice"); - -end Terminal_Interface.Curses.Forms.Field_Types; diff --git a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 deleted file mode 100644 index 9de700bcd05..00000000000 --- a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 +++ /dev/null @@ -1,70 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_User_Data -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.16 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -generic - type User is limited private; - type User_Access is access User; -package Terminal_Interface.Curses.Forms.Field_User_Data is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data); - - -- MANPAGE(`form_field_userptr.3x') - - -- ANCHOR(`set_field_userptr',`Set_User_Data') - procedure Set_User_Data (Fld : Field; - Data : User_Access); - -- AKA - pragma Inline (Set_User_Data); - - -- ANCHOR(`field_userptr',`Get_User_Data') - procedure Get_User_Data (Fld : Field; - Data : out User_Access); - -- AKA - - -- ANCHOR(`field_userptr',`Get_User_Data') - function Get_User_Data (Fld : Field) return User_Access; - -- AKA - -- Sama as function - pragma Inline (Get_User_Data); - -end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 deleted file mode 100644 index f7fb1a702f3..00000000000 --- a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 +++ /dev/null @@ -1,70 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms-form_user_data__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Form_User_Data -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.15 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -generic - type User is limited private; - type User_Access is access User; -package Terminal_Interface.Curses.Forms.Form_User_Data is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data); - - -- MANPAGE(`form_userptr.3x') - - -- ANCHOR(`set_form_userptr',`Set_User_Data') - procedure Set_User_Data (Frm : Form; - Data : User_Access); - -- AKA - pragma Inline (Set_User_Data); - - -- ANCHOR(`form_userptr',`Get_User_Data') - procedure Get_User_Data (Frm : Form; - Data : out User_Access); - -- AKA - - -- ANCHOR(`form_userptr',`Get_User_Data') - function Get_User_Data (Frm : Form) return User_Access; - -- AKA - -- Same as function - pragma Inline (Get_User_Data); - -end Terminal_Interface.Curses.Forms.Form_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4 deleted file mode 100644 index a4329ba9f0c..00000000000 --- a/Ada95/gen/terminal_interface-curses-forms.ads.m4 +++ /dev/null @@ -1,699 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Form -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.30 $ --- $Date: 2009/12/26 17:31:35 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -include(`Form_Base_Defs') -with System; -with Ada.Characters.Latin_1; - -package Terminal_Interface.Curses.Forms is - pragma Preelaborate (Terminal_Interface.Curses.Forms); -include(`Form_Linker_Options')dnl -include(`Linker_Options') - Space : Character renames Ada.Characters.Latin_1.Space; - - type Field is private; - type Form is private; - - Null_Field : constant Field; - Null_Form : constant Form; - - type Field_Justification is (None, - Left, - Center, - Right); - - pragma Warnings (Off); -include(`Field_Rep')Dnl - - pragma Warnings (On); - - function Default_Field_Options return Field_Option_Set; - -- The initial defaults for the field options. - pragma Inline (Default_Field_Options); - - pragma Warnings (Off); -include(`Form_Opt_Rep')Dnl - - pragma Warnings (On); - - function Default_Form_Options return Form_Option_Set; - -- The initial defaults for the form options. - pragma Inline (Default_Form_Options); - - type Buffer_Number is new Natural; - - type Field_Array is array (Positive range <>) of aliased Field; - pragma Convention (C, Field_Array); - - type Field_Array_Access is access Field_Array; - - procedure Free (FA : in out Field_Array_Access; - Free_Fields : Boolean := False); - -- Release the memory for an allocated field array - -- If Free_Fields is True, call Delete() for all the fields in - -- the array. - - subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57); - - -- The prefix F_ stands for "Form Request" - F_Next_Page : constant Form_Request_Code := Key_Max + 1; - F_Previous_Page : constant Form_Request_Code := Key_Max + 2; - F_First_Page : constant Form_Request_Code := Key_Max + 3; - F_Last_Page : constant Form_Request_Code := Key_Max + 4; - - F_Next_Field : constant Form_Request_Code := Key_Max + 5; - F_Previous_Field : constant Form_Request_Code := Key_Max + 6; - F_First_Field : constant Form_Request_Code := Key_Max + 7; - F_Last_Field : constant Form_Request_Code := Key_Max + 8; - F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9; - F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10; - F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11; - F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12; - F_Left_Field : constant Form_Request_Code := Key_Max + 13; - F_Right_Field : constant Form_Request_Code := Key_Max + 14; - F_Up_Field : constant Form_Request_Code := Key_Max + 15; - F_Down_Field : constant Form_Request_Code := Key_Max + 16; - - F_Next_Char : constant Form_Request_Code := Key_Max + 17; - F_Previous_Char : constant Form_Request_Code := Key_Max + 18; - F_Next_Line : constant Form_Request_Code := Key_Max + 19; - F_Previous_Line : constant Form_Request_Code := Key_Max + 20; - F_Next_Word : constant Form_Request_Code := Key_Max + 21; - F_Previous_Word : constant Form_Request_Code := Key_Max + 22; - F_Begin_Field : constant Form_Request_Code := Key_Max + 23; - F_End_Field : constant Form_Request_Code := Key_Max + 24; - F_Begin_Line : constant Form_Request_Code := Key_Max + 25; - F_End_Line : constant Form_Request_Code := Key_Max + 26; - F_Left_Char : constant Form_Request_Code := Key_Max + 27; - F_Right_Char : constant Form_Request_Code := Key_Max + 28; - F_Up_Char : constant Form_Request_Code := Key_Max + 29; - F_Down_Char : constant Form_Request_Code := Key_Max + 30; - - F_New_Line : constant Form_Request_Code := Key_Max + 31; - F_Insert_Char : constant Form_Request_Code := Key_Max + 32; - F_Insert_Line : constant Form_Request_Code := Key_Max + 33; - F_Delete_Char : constant Form_Request_Code := Key_Max + 34; - F_Delete_Previous : constant Form_Request_Code := Key_Max + 35; - F_Delete_Line : constant Form_Request_Code := Key_Max + 36; - F_Delete_Word : constant Form_Request_Code := Key_Max + 37; - F_Clear_EOL : constant Form_Request_Code := Key_Max + 38; - F_Clear_EOF : constant Form_Request_Code := Key_Max + 39; - F_Clear_Field : constant Form_Request_Code := Key_Max + 40; - F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41; - F_Insert_Mode : constant Form_Request_Code := Key_Max + 42; - - -- Vertical Scrolling - F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43; - F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44; - F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45; - F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46; - F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47; - F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48; - - -- Horizontal Scrolling - F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49; - F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50; - F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51; - F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52; - F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53; - F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54; - - F_Validate_Field : constant Form_Request_Code := Key_Max + 55; - F_Next_Choice : constant Form_Request_Code := Key_Max + 56; - F_Previous_Choice : constant Form_Request_Code := Key_Max + 57; - - -- For those who like the old 'C' style request names - REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page; - REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page; - REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page; - REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page; - - REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field; - REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field; - REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field; - REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field; - REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field; - REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field; - REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field; - REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field; - REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field; - REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field; - REQ_UP_FIELD : Form_Request_Code renames F_Up_Field; - REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field; - - REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char; - REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char; - REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line; - REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line; - REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word; - REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word; - REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field; - REQ_END_FIELD : Form_Request_Code renames F_End_Field; - REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line; - REQ_END_LINE : Form_Request_Code renames F_End_Line; - REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char; - REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char; - REQ_UP_CHAR : Form_Request_Code renames F_Up_Char; - REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char; - - REQ_NEW_LINE : Form_Request_Code renames F_New_Line; - REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char; - REQ_INS_LINE : Form_Request_Code renames F_Insert_Line; - REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char; - REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous; - REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line; - REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word; - REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL; - REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF; - REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field; - REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode; - REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode; - - REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line; - REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line; - REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page; - REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page; - REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage; - REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage; - - REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char; - REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char; - REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line; - REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line; - REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine; - REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine; - - REQ_VALIDATION : Form_Request_Code renames F_Validate_Field; - REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice; - REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice; - - procedure Request_Name (Key : Form_Request_Code; - Name : out String); - - function Request_Name (Key : Form_Request_Code) return String; - -- Same as function - pragma Inline (Request_Name); - - ------------------ - -- Exceptions -- - ------------------ - Form_Exception : exception; - - -- MANPAGE(`form_field_new.3x') - - -- ANCHOR(`new_field()',`Create') - function Create (Height : Line_Count; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0; - More_Buffers : Buffer_Number := Buffer_Number'First) - return Field; - -- AKA - -- An overloaded Create is defined later. Pragma Inline appears there. - - -- ANCHOR(`new_field()',`New_Field') - function New_Field (Height : Line_Count; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0; - More_Buffers : Buffer_Number := Buffer_Number'First) - return Field renames Create; - -- AKA - pragma Inline (New_Field); - - -- ANCHOR(`free_field()',`Delete') - procedure Delete (Fld : in out Field); - -- AKA - -- Reset Fld to Null_Field - -- An overloaded Delete is defined later. Pragma Inline appears there. - - -- ANCHOR(`dup_field()',`Duplicate') - function Duplicate (Fld : Field; - Top : Line_Position; - Left : Column_Position) return Field; - -- AKA - pragma Inline (Duplicate); - - -- ANCHOR(`link_field()',`Link') - function Link (Fld : Field; - Top : Line_Position; - Left : Column_Position) return Field; - -- AKA - pragma Inline (Link); - - -- MANPAGE(`form_field_just.3x') - - -- ANCHOR(`set_field_just()',`Set_Justification') - procedure Set_Justification (Fld : Field; - Just : Field_Justification := None); - -- AKA - pragma Inline (Set_Justification); - - -- ANCHOR(`field_just()',`Get_Justification') - function Get_Justification (Fld : Field) return Field_Justification; - -- AKA - pragma Inline (Get_Justification); - - -- MANPAGE(`form_field_buffer.3x') - - -- ANCHOR(`set_field_buffer()',`Set_Buffer') - procedure Set_Buffer - (Fld : Field; - Buffer : Buffer_Number := Buffer_Number'First; - Str : String); - -- AKA - -- Not inlined - - -- ANCHOR(`field_buffer()',`Get_Buffer') - procedure Get_Buffer - (Fld : Field; - Buffer : Buffer_Number := Buffer_Number'First; - Str : out String); - -- AKA - - function Get_Buffer - (Fld : Field; - Buffer : Buffer_Number := Buffer_Number'First) return String; - -- AKA - -- Same but as function - pragma Inline (Get_Buffer); - - -- ANCHOR(`set_field_status()',`Set_Status') - procedure Set_Status (Fld : Field; - Status : Boolean := True); - -- AKA - pragma Inline (Set_Status); - - -- ANCHOR(`field_status()',`Changed') - function Changed (Fld : Field) return Boolean; - -- AKA - pragma Inline (Changed); - - -- ANCHOR(`set_field_max()',`Set_Maximum_Size') - procedure Set_Maximum_Size (Fld : Field; - Max : Natural := 0); - -- AKA - pragma Inline (Set_Maximum_Size); - - -- MANPAGE(`form_field_opts.3x') - - -- ANCHOR(`set_field_opts()',`Set_Options') - procedure Set_Options (Fld : Field; - Options : Field_Option_Set); - -- AKA - -- An overloaded version is defined later. Pragma Inline appears there - - -- ANCHOR(`field_opts_on()',`Switch_Options') - procedure Switch_Options (Fld : Field; - Options : Field_Option_Set; - On : Boolean := True); - -- AKA - -- ALIAS(`field_opts_off()') - -- An overloaded version is defined later. Pragma Inline appears there - - -- ANCHOR(`field_opts()',`Get_Options') - procedure Get_Options (Fld : Field; - Options : out Field_Option_Set); - -- AKA - - -- ANCHOR(`field_opts()',`Get_Options') - function Get_Options (Fld : Field := Null_Field) - return Field_Option_Set; - -- AKA - -- An overloaded version is defined later. Pragma Inline appears there - - -- MANPAGE(`form_field_attributes.3x') - - -- ANCHOR(`set_field_fore()',`Set_Foreground') - procedure Set_Foreground - (Fld : Field; - Fore : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - pragma Inline (Set_Foreground); - - -- ANCHOR(`field_fore()',`Foreground') - procedure Foreground (Fld : Field; - Fore : out Character_Attribute_Set); - -- AKA - - -- ANCHOR(`field_fore()',`Foreground') - procedure Foreground (Fld : Field; - Fore : out Character_Attribute_Set; - Color : out Color_Pair); - -- AKA - pragma Inline (Foreground); - - -- ANCHOR(`set_field_back()',`Set_Background') - procedure Set_Background - (Fld : Field; - Back : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - pragma Inline (Set_Background); - - -- ANCHOR(`field_back()',`Background') - procedure Background (Fld : Field; - Back : out Character_Attribute_Set); - -- AKA - - -- ANCHOR(`field_back()',`Background') - procedure Background (Fld : Field; - Back : out Character_Attribute_Set; - Color : out Color_Pair); - -- AKA - pragma Inline (Background); - - -- ANCHOR(`set_field_pad()',`Set_Pad_Character') - procedure Set_Pad_Character (Fld : Field; - Pad : Character := Space); - -- AKA - pragma Inline (Set_Pad_Character); - - -- ANCHOR(`field_pad()',`Pad_Character') - procedure Pad_Character (Fld : Field; - Pad : out Character); - -- AKA - pragma Inline (Pad_Character); - - -- MANPAGE(`form_field_info.3x') - - -- ANCHOR(`field_info()',`Info') - procedure Info (Fld : Field; - Lines : out Line_Count; - Columns : out Column_Count; - First_Row : out Line_Position; - First_Column : out Column_Position; - Off_Screen : out Natural; - Additional_Buffers : out Buffer_Number); - -- AKA - pragma Inline (Info); - - -- ANCHOR(`dynamic_field_info()',`Dynamic_Info') - procedure Dynamic_Info (Fld : Field; - Lines : out Line_Count; - Columns : out Column_Count; - Max : out Natural); - -- AKA - pragma Inline (Dynamic_Info); - - -- MANPAGE(`form_win.3x') - - -- ANCHOR(`set_form_win()',`Set_Window') - procedure Set_Window (Frm : Form; - Win : Window); - -- AKA - pragma Inline (Set_Window); - - -- ANCHOR(`form_win()',`Get_Window') - function Get_Window (Frm : Form) return Window; - -- AKA - pragma Inline (Get_Window); - - -- ANCHOR(`set_form_sub()',`Set_Sub_Window') - procedure Set_Sub_Window (Frm : Form; - Win : Window); - -- AKA - pragma Inline (Set_Sub_Window); - - -- ANCHOR(`form_sub()',`Get_Sub_Window') - function Get_Sub_Window (Frm : Form) return Window; - -- AKA - pragma Inline (Get_Sub_Window); - - -- ANCHOR(`scale_form()',`Scale') - procedure Scale (Frm : Form; - Lines : out Line_Count; - Columns : out Column_Count); - -- AKA - pragma Inline (Scale); - - -- MANPAGE(`form_hook.3x') - - type Form_Hook_Function is access procedure (Frm : Form); - pragma Convention (C, Form_Hook_Function); - - -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook') - procedure Set_Field_Init_Hook (Frm : Form; - Proc : Form_Hook_Function); - -- AKA - pragma Inline (Set_Field_Init_Hook); - - -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook') - procedure Set_Field_Term_Hook (Frm : Form; - Proc : Form_Hook_Function); - -- AKA - pragma Inline (Set_Field_Term_Hook); - - -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook') - procedure Set_Form_Init_Hook (Frm : Form; - Proc : Form_Hook_Function); - -- AKA - pragma Inline (Set_Form_Init_Hook); - - -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook') - procedure Set_Form_Term_Hook (Frm : Form; - Proc : Form_Hook_Function); - -- AKA - pragma Inline (Set_Form_Term_Hook); - - -- ANCHOR(`field_init()',`Get_Field_Init_Hook') - function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function; - -- AKA - pragma Import (C, Get_Field_Init_Hook, "field_init"); - - -- ANCHOR(`field_term()',`Get_Field_Term_Hook') - function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function; - -- AKA - pragma Import (C, Get_Field_Term_Hook, "field_term"); - - -- ANCHOR(`form_init()',`Get_Form_Init_Hook') - function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function; - -- AKA - pragma Import (C, Get_Form_Init_Hook, "form_init"); - - -- ANCHOR(`form_term()',`Get_Form_Term_Hook') - function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function; - -- AKA - pragma Import (C, Get_Form_Term_Hook, "form_term"); - - -- MANPAGE(`form_field.3x') - - -- ANCHOR(`set_form_fields()',`Redefine') - procedure Redefine (Frm : Form; - Flds : Field_Array_Access); - -- AKA - pragma Inline (Redefine); - - -- ANCHOR(`set_form_fields()',`Set_Fields') - procedure Set_Fields (Frm : Form; - Flds : Field_Array_Access) renames Redefine; - -- AKA - -- pragma Inline (Set_Fields); - - -- ANCHOR(`form_fields()',`Fields') - function Fields (Frm : Form; - Index : Positive) return Field; - -- AKA - pragma Inline (Fields); - - -- ANCHOR(`field_count()',`Field_Count') - function Field_Count (Frm : Form) return Natural; - -- AKA - pragma Inline (Field_Count); - - -- ANCHOR(`move_field()',`Move') - procedure Move (Fld : Field; - Line : Line_Position; - Column : Column_Position); - -- AKA - pragma Inline (Move); - - -- MANPAGE(`form_new.3x') - - -- ANCHOR(`new_form()',`Create') - function Create (Fields : Field_Array_Access) return Form; - -- AKA - pragma Inline (Create); - - -- ANCHOR(`new_form()',`New_Form') - function New_Form (Fields : Field_Array_Access) return Form - renames Create; - -- AKA - -- pragma Inline (New_Form); - - -- ANCHOR(`free_form()',`Delete') - procedure Delete (Frm : in out Form); - -- AKA - -- Reset Frm to Null_Form - pragma Inline (Delete); - - -- MANPAGE(`form_opts.3x') - - -- ANCHOR(`set_form_opts()',`Set_Options') - procedure Set_Options (Frm : Form; - Options : Form_Option_Set); - -- AKA - pragma Inline (Set_Options); - - -- ANCHOR(`form_opts_on()',`Switch_Options') - procedure Switch_Options (Frm : Form; - Options : Form_Option_Set; - On : Boolean := True); - -- AKA - -- ALIAS(`form_opts_off()') - pragma Inline (Switch_Options); - - -- ANCHOR(`form_opts()',`Get_Options') - procedure Get_Options (Frm : Form; - Options : out Form_Option_Set); - -- AKA - - -- ANCHOR(`form_opts()',`Get_Options') - function Get_Options (Frm : Form := Null_Form) return Form_Option_Set; - -- AKA - pragma Inline (Get_Options); - - -- MANPAGE(`form_post.3x') - - -- ANCHOR(`post_form()',`Post') - procedure Post (Frm : Form; - Post : Boolean := True); - -- AKA - -- ALIAS(`unpost_form()') - pragma Inline (Post); - - -- MANPAGE(`form_cursor.3x') - - -- ANCHOR(`pos_form_cursor()',`Position_Cursor') - procedure Position_Cursor (Frm : Form); - -- AKA - pragma Inline (Position_Cursor); - - -- MANPAGE(`form_data.3x') - - -- ANCHOR(`data_ahead()',`Data_Ahead') - function Data_Ahead (Frm : Form) return Boolean; - -- AKA - pragma Inline (Data_Ahead); - - -- ANCHOR(`data_behind()',`Data_Behind') - function Data_Behind (Frm : Form) return Boolean; - -- AKA - pragma Inline (Data_Behind); - - -- MANPAGE(`form_driver.3x') - - type Driver_Result is (Form_Ok, - Request_Denied, - Unknown_Request, - Invalid_Field); - - -- ANCHOR(`form_driver()',`Driver') - function Driver (Frm : Form; - Key : Key_Code) return Driver_Result; - -- AKA - -- Driver not inlined - - -- MANPAGE(`form_page.3x') - - type Page_Number is new Natural; - - -- ANCHOR(`set_current_field()',`Set_Current') - procedure Set_Current (Frm : Form; - Fld : Field); - -- AKA - pragma Inline (Set_Current); - - -- ANCHOR(`current_field()',`Current') - function Current (Frm : Form) return Field; - -- AKA - pragma Inline (Current); - - -- ANCHOR(`set_form_page()',`Set_Page') - procedure Set_Page (Frm : Form; - Page : Page_Number := Page_Number'First); - -- AKA - pragma Inline (Set_Page); - - -- ANCHOR(`form_page()',`Page') - function Page (Frm : Form) return Page_Number; - -- AKA - pragma Inline (Page); - - -- ANCHOR(`field_index()',`Get_Index') - function Get_Index (Fld : Field) return Positive; - -- AKA - -- Please note that in this binding we start the numbering of fields - -- with 1. So this is number is one more than you get from the low - -- level call. - pragma Inline (Get_Index); - - -- MANPAGE(`form_new_page.3x') - - -- ANCHOR(`set_new_page()',`Set_New_Page') - procedure Set_New_Page (Fld : Field; - New_Page : Boolean := True); - -- AKA - pragma Inline (Set_New_Page); - - -- ANCHOR(`new_page()',`Is_New_Page') - function Is_New_Page (Fld : Field) return Boolean; - -- AKA - pragma Inline (Is_New_Page); - - -- MANPAGE(`form_requestname.3x') - -- Not Implemented: form_request_name, form_request_by_name - ------------------------------------------------------------------------------- -private - type Field is new System.Storage_Elements.Integer_Address; - type Form is new System.Storage_Elements.Integer_Address; - - Null_Field : constant Field := 0; - Null_Form : constant Form := 0; - -end Terminal_Interface.Curses.Forms; diff --git a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 deleted file mode 100644 index 4ffa41b5bde..00000000000 --- a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 +++ /dev/null @@ -1,75 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-menus-item_user_data__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Menus.Item_User_Data -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.17 $ --- $Date: 2009/12/26 17:31:35 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -generic - type User is limited private; - type User_Access is access User; -package Terminal_Interface.Curses.Menus.Item_User_Data is - pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data); - - -- The binding uses the same user pointer for menu items - -- as the low level C implementation. So you can safely - -- read or write the user pointer also with the C routines - -- - -- MANPAGE(`mitem_userptr.3x') - - -- ANCHOR(`set_item_userptr',`Set_User_Data') - procedure Set_User_Data (Itm : Item; - Data : User_Access); - -- AKA - pragma Inline (Set_User_Data); - - -- ANCHOR(`item_userptr',`Get_User_Data') - procedure Get_User_Data (Itm : Item; - Data : out User_Access); - -- AKA - - -- ANCHOR(`item_userptr',`Get_User_Data') - function Get_User_Data (Itm : Item) return User_Access; - -- AKA - -- Same as function - pragma Inline (Get_User_Data); - -end Terminal_Interface.Curses.Menus.Item_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 deleted file mode 100644 index 9138ba6c3ab..00000000000 --- a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 +++ /dev/null @@ -1,70 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-menus-menu_user_data__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Menus.Menu_User_Data -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.15 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -generic - type User is limited private; - type User_Access is access User; -package Terminal_Interface.Curses.Menus.Menu_User_Data is - pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data); - - -- MANPAGE(`menu_userptr.3x') - - -- ANCHOR(`set_menu_userptr',`Set_User_Data') - procedure Set_User_Data (Men : Menu; - Data : User_Access); - -- AKA - pragma Inline (Set_User_Data); - - -- ANCHOR(`menu_userptr',`Get_User_Data') - procedure Get_User_Data (Men : Menu; - Data : out User_Access); - -- AKA - - -- ANCHOR(`menu_userptr',`Get_User_Data') - function Get_User_Data (Men : Menu) return User_Access; - -- AKA - -- Same as function - pragma Inline (Get_User_Data); - -end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 deleted file mode 100644 index 6274b6ed8f2..00000000000 --- a/Ada95/gen/terminal_interface-curses-menus.ads.m4 +++ /dev/null @@ -1,604 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-menus__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Menu -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.28 $ --- $Date: 2009/12/26 18:35:22 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -include(`Menu_Base_Defs') -with System; -with Ada.Characters.Latin_1; - -package Terminal_Interface.Curses.Menus is - pragma Preelaborate (Terminal_Interface.Curses.Menus); -include(`Menu_Linker_Options')dnl -include(`Linker_Options') - Space : Character renames Ada.Characters.Latin_1.Space; - - type Item is private; - type Menu is private; - - --------------------------- - -- Interface constants -- - --------------------------- - Null_Item : constant Item; - Null_Menu : constant Menu; - - subtype Menu_Request_Code is Key_Code - range (Key_Max + 1) .. (Key_Max + 17); - - -- The prefix M_ stands for "Menu Request" - M_Left_Item : constant Menu_Request_Code := Key_Max + 1; - M_Right_Item : constant Menu_Request_Code := Key_Max + 2; - M_Up_Item : constant Menu_Request_Code := Key_Max + 3; - M_Down_Item : constant Menu_Request_Code := Key_Max + 4; - M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5; - M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6; - M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7; - M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8; - M_First_Item : constant Menu_Request_Code := Key_Max + 9; - M_Last_Item : constant Menu_Request_Code := Key_Max + 10; - M_Next_Item : constant Menu_Request_Code := Key_Max + 11; - M_Previous_Item : constant Menu_Request_Code := Key_Max + 12; - M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13; - M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14; - M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15; - M_Next_Match : constant Menu_Request_Code := Key_Max + 16; - M_Previous_Match : constant Menu_Request_Code := Key_Max + 17; - - -- For those who like the old 'C' names for the request codes - REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item; - REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item; - REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item; - REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item; - REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line; - REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line; - REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page; - REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page; - REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item; - REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item; - REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item; - REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item; - REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item; - REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern; - REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern; - REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match; - REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match; - - procedure Request_Name (Key : Menu_Request_Code; - Name : out String); - - function Request_Name (Key : Menu_Request_Code) return String; - -- Same as function - - ------------------ - -- Exceptions -- - ------------------ - - Menu_Exception : exception; - -- - -- Menu options - -- - pragma Warnings (Off); -include(`Menu_Opt_Rep')dnl - - pragma Warnings (On); - - function Default_Menu_Options return Menu_Option_Set; - -- Initial default options for a menu. - pragma Inline (Default_Menu_Options); - -- - -- Item options - -- - pragma Warnings (Off); -include(`Item_Rep')dnl - - pragma Warnings (On); - - function Default_Item_Options return Item_Option_Set; - -- Initial default options for an item. - pragma Inline (Default_Item_Options); - - -- - -- Item Array - -- - type Item_Array is array (Positive range <>) of aliased Item; - pragma Convention (C, Item_Array); - - type Item_Array_Access is access Item_Array; - - procedure Free (IA : in out Item_Array_Access; - Free_Items : Boolean := False); - -- Release the memory for an allocated item array - -- If Free_Items is True, call Delete() for all the items in - -- the array. - - -- MANPAGE(`mitem_new.3x') - - -- ANCHOR(`new_item()',`Create') - function Create (Name : String; - Description : String := "") return Item; - -- AKA - -- Not inlined. - - -- ANCHOR(`new_item()',`New_Item') - function New_Item (Name : String; - Description : String := "") return Item - renames Create; - -- AKA - - -- ANCHOR(`free_item()',`Delete') - procedure Delete (Itm : in out Item); - -- AKA - -- Resets Itm to Null_Item - - -- MANPAGE(`mitem_value.3x') - - -- ANCHOR(`set_item_value()',`Set_Value') - procedure Set_Value (Itm : Item; - Value : Boolean := True); - -- AKA - pragma Inline (Set_Value); - - -- ANCHOR(`item_value()',`Value') - function Value (Itm : Item) return Boolean; - -- AKA - pragma Inline (Value); - - -- MANPAGE(`mitem_visible.3x') - - -- ANCHOR(`item_visible()',`Visible') - function Visible (Itm : Item) return Boolean; - -- AKA - pragma Inline (Visible); - - -- MANPAGE(`mitem_opts.3x') - - -- ANCHOR(`set_item_opts()',`Set_Options') - procedure Set_Options (Itm : Item; - Options : Item_Option_Set); - -- AKA - -- An overloaded Set_Options is defined later. Pragma Inline appears there - - -- ANCHOR(`item_opts_on()',`Switch_Options') - procedure Switch_Options (Itm : Item; - Options : Item_Option_Set; - On : Boolean := True); - -- AKA - -- ALIAS(`item_opts_off()') - -- An overloaded Switch_Options is defined later. - -- Pragma Inline appears there - - -- ANCHOR(`item_opts()',`Get_Options') - procedure Get_Options (Itm : Item; - Options : out Item_Option_Set); - -- AKA - - -- ANCHOR(`item_opts()',`Get_Options') - function Get_Options (Itm : Item := Null_Item) return Item_Option_Set; - -- AKA - -- An overloaded Get_Options is defined later. Pragma Inline appears there - - -- MANPAGE(`mitem_name.3x') - - -- ANCHOR(`item_name()',`Name') - procedure Name (Itm : Item; - Name : out String); - -- AKA - function Name (Itm : Item) return String; - -- AKA - -- Implemented as function - pragma Inline (Name); - - -- ANCHOR(`item_description();',`Description') - procedure Description (Itm : Item; - Description : out String); - -- AKA - - function Description (Itm : Item) return String; - -- AKA - -- Implemented as function - pragma Inline (Description); - - -- MANPAGE(`mitem_current.3x') - - -- ANCHOR(`set_current_item()',`Set_Current') - procedure Set_Current (Men : Menu; - Itm : Item); - -- AKA - pragma Inline (Set_Current); - - -- ANCHOR(`current_item()',`Current') - function Current (Men : Menu) return Item; - -- AKA - pragma Inline (Current); - - -- ANCHOR(`set_top_row()',`Set_Top_Row') - procedure Set_Top_Row (Men : Menu; - Line : Line_Position); - -- AKA - pragma Inline (Set_Top_Row); - - -- ANCHOR(`top_row()',`Top_Row') - function Top_Row (Men : Menu) return Line_Position; - -- AKA - pragma Inline (Top_Row); - - -- ANCHOR(`item_index()',`Get_Index') - function Get_Index (Itm : Item) return Positive; - -- AKA - -- Please note that in this binding we start the numbering of items - -- with 1. So this is number is one more than you get from the low - -- level call. - pragma Inline (Get_Index); - - -- MANPAGE(`menu_post.3x') - - -- ANCHOR(`post_menu()',`Post') - procedure Post (Men : Menu; - Post : Boolean := True); - -- AKA - -- ALIAS(`unpost_menu()') - pragma Inline (Post); - - -- MANPAGE(`menu_opts.3x') - - -- ANCHOR(`set_menu_opts()',`Set_Options') - procedure Set_Options (Men : Menu; - Options : Menu_Option_Set); - -- AKA - pragma Inline (Set_Options); - - -- ANCHOR(`menu_opts_on()',`Switch_Options') - procedure Switch_Options (Men : Menu; - Options : Menu_Option_Set; - On : Boolean := True); - -- AKA - -- ALIAS(`menu_opts_off()') - pragma Inline (Switch_Options); - - -- ANCHOR(`menu_opts()',`Get_Options') - procedure Get_Options (Men : Menu; - Options : out Menu_Option_Set); - -- AKA - - -- ANCHOR(`menu_opts()',`Get_Options') - function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set; - -- AKA - pragma Inline (Get_Options); - - -- MANPAGE(`menu_win.3x') - - -- ANCHOR(`set_menu_win()',`Set_Window') - procedure Set_Window (Men : Menu; - Win : Window); - -- AKA - pragma Inline (Set_Window); - - -- ANCHOR(`menu_win()',`Get_Window') - function Get_Window (Men : Menu) return Window; - -- AKA - pragma Inline (Get_Window); - - -- ANCHOR(`set_menu_sub()',`Set_Sub_Window') - procedure Set_Sub_Window (Men : Menu; - Win : Window); - -- AKA - pragma Inline (Set_Sub_Window); - - -- ANCHOR(`menu_sub()',`Get_Sub_Window') - function Get_Sub_Window (Men : Menu) return Window; - -- AKA - pragma Inline (Get_Sub_Window); - - -- ANCHOR(`scale_menu()',`Scale') - procedure Scale (Men : Menu; - Lines : out Line_Count; - Columns : out Column_Count); - -- AKA - pragma Inline (Scale); - - -- MANPAGE(`menu_cursor.3x') - - -- ANCHOR(`pos_menu_cursor()',`Position_Cursor') - procedure Position_Cursor (Men : Menu); - -- AKA - pragma Inline (Position_Cursor); - - -- MANPAGE(`menu_mark.3x') - - -- ANCHOR(`set_menu_mark()',`Set_Mark') - procedure Set_Mark (Men : Menu; - Mark : String); - -- AKA - pragma Inline (Set_Mark); - - -- ANCHOR(`menu_mark()',`Mark') - procedure Mark (Men : Menu; - Mark : out String); - -- AKA - - function Mark (Men : Menu) return String; - -- AKA - -- Implemented as function - pragma Inline (Mark); - - -- MANPAGE(`menu_attributes.3x') - - -- ANCHOR(`set_menu_fore()',`Set_Foreground') - procedure Set_Foreground - (Men : Menu; - Fore : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - pragma Inline (Set_Foreground); - - -- ANCHOR(`menu_fore()',`Foreground') - procedure Foreground (Men : Menu; - Fore : out Character_Attribute_Set); - -- AKA - - -- ANCHOR(`menu_fore()',`Foreground') - procedure Foreground (Men : Menu; - Fore : out Character_Attribute_Set; - Color : out Color_Pair); - -- AKA - pragma Inline (Foreground); - - -- ANCHOR(`set_menu_back()',`Set_Background') - procedure Set_Background - (Men : Menu; - Back : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - pragma Inline (Set_Background); - - -- ANCHOR(`menu_back()',`Background') - procedure Background (Men : Menu; - Back : out Character_Attribute_Set); - -- AKA - -- ANCHOR(`menu_back()',`Background') - - procedure Background (Men : Menu; - Back : out Character_Attribute_Set; - Color : out Color_Pair); - -- AKA - pragma Inline (Background); - - -- ANCHOR(`set_menu_grey()',`Set_Grey') - procedure Set_Grey - (Men : Menu; - Grey : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - pragma Inline (Set_Grey); - - -- ANCHOR(`menu_grey()',`Grey') - procedure Grey (Men : Menu; - Grey : out Character_Attribute_Set); - -- AKA - - -- ANCHOR(`menu_grey()',`Grey') - procedure Grey - (Men : Menu; - Grey : out Character_Attribute_Set; - Color : out Color_Pair); - -- AKA - pragma Inline (Grey); - - -- ANCHOR(`set_menu_pad()',`Set_Pad_Character') - procedure Set_Pad_Character (Men : Menu; - Pad : Character := Space); - -- AKA - pragma Inline (Set_Pad_Character); - - -- ANCHOR(`menu_pad()',`Pad_Character') - procedure Pad_Character (Men : Menu; - Pad : out Character); - -- AKA - pragma Inline (Pad_Character); - - -- MANPAGE(`menu_spacing.3x') - - -- ANCHOR(`set_menu_spacing()',`Set_Spacing') - procedure Set_Spacing (Men : Menu; - Descr : Column_Position := 0; - Row : Line_Position := 0; - Col : Column_Position := 0); - -- AKA - pragma Inline (Set_Spacing); - - -- ANCHOR(`menu_spacing()',`Spacing') - procedure Spacing (Men : Menu; - Descr : out Column_Position; - Row : out Line_Position; - Col : out Column_Position); - -- AKA - pragma Inline (Spacing); - - -- MANPAGE(`menu_pattern.3x') - - -- ANCHOR(`set_menu_pattern()',`Set_Pattern') - function Set_Pattern (Men : Menu; - Text : String) return Boolean; - -- AKA - -- Return TRUE if the pattern matches, FALSE otherwise - pragma Inline (Set_Pattern); - - -- ANCHOR(`menu_pattern()',`Pattern') - procedure Pattern (Men : Menu; - Text : out String); - -- AKA - pragma Inline (Pattern); - - -- MANPAGE(`menu_format.3x') - - -- ANCHOR(`set_menu_format()',`Set_Format') - procedure Set_Format (Men : Menu; - Lines : Line_Count; - Columns : Column_Count); - -- Not implemented: 0 argument for Lines or Columns; - -- instead use Format to get the current sizes - -- The default format is 16 rows, 1 column. Calling - -- set_menu_format with a null menu pointer will change this - -- default. A zero row or column argument to set_menu_format - -- is interpreted as a request not to change the current - -- value. - -- AKA - pragma Inline (Set_Format); - - -- ANCHOR(`menu_format()',`Format') - procedure Format (Men : Menu; - Lines : out Line_Count; - Columns : out Column_Count); - -- AKA - pragma Inline (Format); - - -- MANPAGE(`menu_hook.3x') - - type Menu_Hook_Function is access procedure (Men : Menu); - pragma Convention (C, Menu_Hook_Function); - - -- ANCHOR(`set_item_init()',`Set_Item_Init_Hook') - procedure Set_Item_Init_Hook (Men : Menu; - Proc : Menu_Hook_Function); - -- AKA - pragma Inline (Set_Item_Init_Hook); - - -- ANCHOR(`set_item_term()',`Set_Item_Term_Hook') - procedure Set_Item_Term_Hook (Men : Menu; - Proc : Menu_Hook_Function); - -- AKA - pragma Inline (Set_Item_Term_Hook); - - -- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook') - procedure Set_Menu_Init_Hook (Men : Menu; - Proc : Menu_Hook_Function); - -- AKA - pragma Inline (Set_Menu_Init_Hook); - - -- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook') - procedure Set_Menu_Term_Hook (Men : Menu; - Proc : Menu_Hook_Function); - -- AKA - pragma Inline (Set_Menu_Term_Hook); - - -- ANCHOR(`item_init()',`Get_Item_Init_Hook') - function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function; - -- AKA - pragma Inline (Get_Item_Init_Hook); - - -- ANCHOR(`item_term()',`Get_Item_Term_Hook') - function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function; - -- AKA - pragma Inline (Get_Item_Term_Hook); - - -- ANCHOR(`menu_init()',`Get_Menu_Init_Hook') - function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function; - -- AKA - pragma Inline (Get_Menu_Init_Hook); - - -- ANCHOR(`menu_term()',`Get_Menu_Term_Hook') - function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function; - -- AKA - pragma Inline (Get_Menu_Term_Hook); - - -- MANPAGE(`menu_items.3x') - - -- ANCHOR(`set_menu_items()',`Redefine') - procedure Redefine (Men : Menu; - Items : Item_Array_Access); - -- AKA - pragma Inline (Redefine); - - procedure Set_Items (Men : Menu; - Items : Item_Array_Access) renames Redefine; - -- pragma Inline (Set_Items); - - -- ANCHOR(`menu_items()',`Items') - function Items (Men : Menu; - Index : Positive) return Item; - -- AKA - pragma Inline (Items); - - -- ANCHOR(`item_count()',`Item_Count') - function Item_Count (Men : Menu) return Natural; - -- AKA - pragma Inline (Item_Count); - - -- MANPAGE(`menu_new.3x') - - -- ANCHOR(`new_menu()',`Create') - function Create (Items : Item_Array_Access) return Menu; - -- AKA - -- Not inlined - - function New_Menu (Items : Item_Array_Access) return Menu renames Create; - - -- ANCHOR(`free_menu()',`Delete') - procedure Delete (Men : in out Menu); - -- AKA - -- Reset Men to Null_Menu - -- Not inlined - - -- MANPAGE(`menu_driver.3x') - - type Driver_Result is (Menu_Ok, - Request_Denied, - Unknown_Request, - No_Match); - - -- ANCHOR(`menu_driver()',`Driver') - function Driver (Men : Menu; - Key : Key_Code) return Driver_Result; - -- AKA - -- Driver is not inlined - - -- ANCHOR(`menu_requestname.3x') - -- Not Implemented: menu_request_name, menu_request_by_name -------------------------------------------------------------------------------- -private - type Item is new System.Storage_Elements.Integer_Address; - type Menu is new System.Storage_Elements.Integer_Address; - - Null_Item : constant Item := 0; - Null_Menu : constant Menu := 0; - -end Terminal_Interface.Curses.Menus; diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 deleted file mode 100644 index a4fb661ef84..00000000000 --- a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 +++ /dev/null @@ -1,178 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-mouse__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Mouse -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.29 $ --- $Date: 2011/03/19 12:35:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -include(`Mouse_Base_Defs') -with System; - -package Terminal_Interface.Curses.Mouse is - pragma Preelaborate (Terminal_Interface.Curses.Mouse); - - -- MANPAGE(`curs_mouse.3x') - -- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates - -- in the parent package. - -- - -- Not implemented: - -- REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event - -- or Start_Mouse) - type Event_Mask is private; - No_Events : constant Event_Mask; - All_Events : constant Event_Mask; - - type Mouse_Button is (Left, -- aka: Button 1 - Middle, -- aka: Button 2 - Right, -- aka: Button 3 - Button4, -- aka: Button 4 - Control, -- Control Key - Shift, -- Shift Key - Alt); -- ALT Key - - subtype Real_Buttons is Mouse_Button range Left .. Button4; - subtype Modifier_Keys is Mouse_Button range Control .. Alt; - - type Button_State is (Released, - Pressed, - Clicked, - Double_Clicked, - Triple_Clicked); - - type Button_States is array (Button_State) of Boolean; - pragma Pack (Button_States); - - All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True, - others => False); - All_States : constant Button_States := (others => True); - - type Mouse_Event is private; - - -- MANPAGE(`curs_mouse.3x') - - function Has_Mouse return Boolean; - -- Return true if a mouse device is supported, false otherwise. - - procedure Register_Reportable_Event - (Button : Mouse_Button; - State : Button_State; - Mask : in out Event_Mask); - -- Stores the event described by the button and the state in the mask. - -- Before you call this the first time, you should initialize the mask - -- with the Empty_Mask constant - pragma Inline (Register_Reportable_Event); - - procedure Register_Reportable_Events - (Button : Mouse_Button; - State : Button_States; - Mask : in out Event_Mask); - -- Register all events described by the Button and the State bitmap. - -- Before you call this the first time, you should initialize the mask - -- with the Empty_Mask constant - - -- ANCHOR(`mousemask()',`Start_Mouse') - -- There is one difference to mousmask(): we return the value of the - -- old mask, that means the event mask value before this call. - -- Not Implemented: The library version - -- returns a Mouse_Mask that tells which events are reported. - function Start_Mouse (Mask : Event_Mask := All_Events) - return Event_Mask; - -- AKA - pragma Inline (Start_Mouse); - - procedure End_Mouse (Mask : Event_Mask := No_Events); - -- Terminates the mouse, restores the specified event mask - pragma Inline (End_Mouse); - - -- ANCHOR(`getmouse()',`Get_Mouse') - function Get_Mouse return Mouse_Event; - -- AKA - pragma Inline (Get_Mouse); - - procedure Get_Event (Event : Mouse_Event; - Y : out Line_Position; - X : out Column_Position; - Button : out Mouse_Button; - State : out Button_State); - -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they - -- may not be identical to window coordinates. - -- Not Implemented: Get_Event only reports one event, the C library - -- version supports multiple events, e.g. {click-1, click-3} - pragma Inline (Get_Event); - - -- ANCHOR(`ungetmouse()',`Unget_Mouse') - procedure Unget_Mouse (Event : Mouse_Event); - -- AKA - pragma Inline (Unget_Mouse); - - -- ANCHOR(`wenclose()',`Enclosed_In_Window') - function Enclosed_In_Window (Win : Window := Standard_Window; - Event : Mouse_Event) return Boolean; - -- AKA - -- But : use event instead of screen coordinates. - pragma Inline (Enclosed_In_Window); - - -- ANCHOR(`mouseinterval()',`Mouse_Interval') - function Mouse_Interval (Msec : Natural := 200) return Natural; - -- AKA - pragma Inline (Mouse_Interval); - -private - type Event_Mask is new Interfaces.C.unsigned_long; - - type Mouse_Event is - record - Id : Integer range Integer (Interfaces.C.short'First) .. - Integer (Interfaces.C.short'Last); - X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. - Integer (Interfaces.C.int'Last); - Bstate : Event_Mask; - end record; - pragma Convention (C, Mouse_Event); - -include(`Mouse_Event_Rep') - Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; - -- This constant may be different on your system. - -include(`Mouse_Events') - No_Events : constant Event_Mask := 0; - All_Events : constant Event_Mask := ALL_MOUSE_EVENTS; - -end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 deleted file mode 100644 index 03d8114fdff..00000000000 --- a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 +++ /dev/null @@ -1,70 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-panels-user_data__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Panels.User_Data -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.15 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -generic - type User is limited private; - type User_Access is access all User; -package Terminal_Interface.Curses.Panels.User_Data is - pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data); - - -- MANPAGE(`panel.3x') - - -- ANCHOR(`set_panel_userptr',`Set_User_Data') - procedure Set_User_Data (Pan : Panel; - Data : User_Access); - -- AKA - pragma Inline (Set_User_Data); - - -- ANCHOR(`panel_userptr',`Get_User_Data') - procedure Get_User_Data (Pan : Panel; - Data : out User_Access); - -- AKA - - -- ANCHOR(`panel_userptr',`Get_User_Data') - function Get_User_Data (Pan : Panel) return User_Access; - -- AKA - -- Same as function - pragma Inline (Get_User_Data); - -end Terminal_Interface.Curses.Panels.User_Data; diff --git a/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/Ada95/gen/terminal_interface-curses-panels.ads.m4 deleted file mode 100644 index dc06fa42171..00000000000 --- a/Ada95/gen/terminal_interface-curses-panels.ads.m4 +++ /dev/null @@ -1,147 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-panels__ads.htm')dnl -include(M4MACRO)dnl ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Panels -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.20 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with System; - -package Terminal_Interface.Curses.Panels is - pragma Preelaborate (Terminal_Interface.Curses.Panels); -include(`Panel_Linker_Options')dnl -include(`Linker_Options') - type Panel is private; - - --------------------------- - -- Interface constants -- - --------------------------- - Null_Panel : constant Panel; - - ------------------- - -- Exceptions -- - ------------------- - - Panel_Exception : exception; - - -- MANPAGE(`panel.3x') - - -- ANCHOR(`new_panel()',`Create') - function Create (Win : Window) return Panel; - -- AKA - pragma Inline (Create); - - -- ANCHOR(`new_panel()',`New_Panel') - function New_Panel (Win : Window) return Panel renames Create; - -- AKA - -- pragma Inline (New_Panel); - - -- ANCHOR(`bottom_panel()',`Bottom') - procedure Bottom (Pan : Panel); - -- AKA - pragma Inline (Bottom); - - -- ANCHOR(`top_panel()',`Top') - procedure Top (Pan : Panel); - -- AKA - pragma Inline (Top); - - -- ANCHOR(`show_panel()',`Show') - procedure Show (Pan : Panel); - -- AKA - pragma Inline (Show); - - -- ANCHOR(`update_panels()',`Update_Panels') - procedure Update_Panels; - -- AKA - pragma Import (C, Update_Panels, "update_panels"); - - -- ANCHOR(`hide_panel()',`Hide') - procedure Hide (Pan : Panel); - -- AKA - pragma Inline (Hide); - - -- ANCHOR(`panel_window()',`Get_Window') - function Get_Window (Pan : Panel) return Window; - -- AKA - pragma Inline (Get_Window); - - -- ANCHOR(`panel_window()',`Panel_Window') - function Panel_Window (Pan : Panel) return Window renames Get_Window; - -- pragma Inline (Panel_Window); - - -- ANCHOR(`replace_panel()',`Replace') - procedure Replace (Pan : Panel; - Win : Window); - -- AKA - pragma Inline (Replace); - - -- ANCHOR(`move_panel()',`Move') - procedure Move (Pan : Panel; - Line : Line_Position; - Column : Column_Position); - -- AKA - pragma Inline (Move); - - -- ANCHOR(`panel_hidden()',`Is_Hidden') - function Is_Hidden (Pan : Panel) return Boolean; - -- AKA - pragma Inline (Is_Hidden); - - -- ANCHOR(`panel_above()',`Above') - function Above (Pan : Panel) return Panel; - -- AKA - pragma Import (C, Above, "panel_above"); - - -- ANCHOR(`panel_below()',`Below') - function Below (Pan : Panel) return Panel; - -- AKA - pragma Import (C, Below, "panel_below"); - - -- ANCHOR(`del_panel()',`Delete') - procedure Delete (Pan : in out Panel); - -- AKA - pragma Inline (Delete); - -private - type Panel is new System.Storage_Elements.Integer_Address; - Null_Panel : constant Panel := 0; - -end Terminal_Interface.Curses.Panels; diff --git a/Ada95/gen/terminal_interface-curses-trace.ads.m4 b/Ada95/gen/terminal_interface-curses-trace.ads.m4 deleted file mode 100644 index 546004fd493..00000000000 --- a/Ada95/gen/terminal_interface-curses-trace.ads.m4 +++ /dev/null @@ -1,78 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses-trace__ads.htm')dnl -include(M4MACRO)------------------------------------------------------------------------------ --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Trace -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control: --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -package Terminal_Interface.Curses.Trace is - pragma Preelaborate (Terminal_Interface.Curses.Trace); - - pragma Warnings (Off); -include(`Trace_Defs') - - pragma Warnings (On); - - Trace_Disable : constant Trace_Attribute_Set := (others => False); - - Trace_Ordinary : constant Trace_Attribute_Set := - (Times => True, - Tputs => True, - Update => True, - Cursor_Move => True, - Character_Output => True, - others => False); - Trace_Maximum : constant Trace_Attribute_Set := (others => True); - ------------------------------------------------------------------------------- - - -- MANPAGE(`curs_trace.3x') - - -- ANCHOR(`trace()',`Trace_on') - procedure Trace_On (x : Trace_Attribute_Set); - -- The debugging library has trace. - - -- ANCHOR(`_tracef()',`Trace_Put') - procedure Trace_Put (str : String); - -- AKA - - Current_Trace_Setting : Trace_Attribute_Set; - pragma Import (C, Current_Trace_Setting, "_nc_tracing"); - -end Terminal_Interface.Curses.Trace; diff --git a/Ada95/gen/terminal_interface-curses.adb.m4 b/Ada95/gen/terminal_interface-curses.adb.m4 deleted file mode 100644 index 1f89a5a3523..00000000000 --- a/Ada95/gen/terminal_interface-curses.adb.m4 +++ /dev/null @@ -1,2502 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses__adb.htm')dnl -include(M4MACRO)------------------------------------------------------------------------------ --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.8 $ --- $Date: 2011/03/22 23:02:14 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with System; - -with Terminal_Interface.Curses.Aux; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Ada.Characters.Handling; use Ada.Characters.Handling; -with Ada.Strings.Fixed; - -package body Terminal_Interface.Curses is - - use Aux; - use type System.Bit_Order; - - package ASF renames Ada.Strings.Fixed; - - type chtype_array is array (size_t range <>) - of aliased Attributed_Character; - pragma Convention (C, chtype_array); - ------------------------------------------------------------------------------- - function Key_Name (Key : Real_Key_Code) return String - is - function Keyname (K : C_Int) return chars_ptr; - pragma Import (C, Keyname, "keyname"); - - Ch : Character; - begin - if Key <= Character'Pos (Character'Last) then - Ch := Character'Val (Key); - if Is_Control (Ch) then - return Un_Control (Attributed_Character'(Ch => Ch, - Color => Color_Pair'First, - Attr => Normal_Video)); - elsif Is_Graphic (Ch) then - declare - S : String (1 .. 1); - begin - S (1) := Ch; - return S; - end; - else - return ""; - end if; - else - return Fill_String (Keyname (C_Int (Key))); - end if; - end Key_Name; - - procedure Key_Name (Key : Real_Key_Code; - Name : out String) - is - begin - ASF.Move (Key_Name (Key), Name); - end Key_Name; - ------------------------------------------------------------------------------- - procedure Init_Screen - is - function Initscr return Window; - pragma Import (C, Initscr, "initscr"); - - W : Window; - begin - W := Initscr; - if W = Null_Window then - raise Curses_Exception; - end if; - end Init_Screen; - - procedure End_Windows - is - function Endwin return C_Int; - pragma Import (C, Endwin, "endwin"); - begin - if Endwin = Curses_Err then - raise Curses_Exception; - end if; - end End_Windows; - - function Is_End_Window return Boolean - is - function Isendwin return Curses_Bool; - pragma Import (C, Isendwin, "isendwin"); - begin - if Isendwin = Curses_Bool_False then - return False; - else - return True; - end if; - end Is_End_Window; ------------------------------------------------------------------------------- - procedure Move_Cursor (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position) - is - function Wmove (Win : Window; - Line : C_Int; - Column : C_Int - ) return C_Int; - pragma Import (C, Wmove, "wmove"); - begin - if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then - raise Curses_Exception; - end if; - end Move_Cursor; ------------------------------------------------------------------------------- - procedure Add (Win : Window := Standard_Window; - Ch : Attributed_Character) - is - function Waddch (W : Window; - Ch : C_Chtype) return C_Int; - pragma Import (C, Waddch, "waddch"); - begin - if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Add; - - procedure Add (Win : Window := Standard_Window; - Ch : Character) - is - begin - Add (Win, - Attributed_Character'(Ch => Ch, - Color => Color_Pair'First, - Attr => Normal_Video)); - end Add; - - procedure Add - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Ch : Attributed_Character) - is - function mvwaddch (W : Window; - Y : C_Int; - X : C_Int; - Ch : C_Chtype) return C_Int; - pragma Import (C, mvwaddch, "mvwaddch"); - begin - if mvwaddch (Win, C_Int (Line), - C_Int (Column), - AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Add; - - procedure Add - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Ch : Character) - is - begin - Add (Win, - Line, - Column, - Attributed_Character'(Ch => Ch, - Color => Color_Pair'First, - Attr => Normal_Video)); - end Add; - - procedure Add_With_Immediate_Echo - (Win : Window := Standard_Window; - Ch : Attributed_Character) - is - function Wechochar (W : Window; - Ch : C_Chtype) return C_Int; - pragma Import (C, Wechochar, "wechochar"); - begin - if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Add_With_Immediate_Echo; - - procedure Add_With_Immediate_Echo - (Win : Window := Standard_Window; - Ch : Character) - is - begin - Add_With_Immediate_Echo - (Win, - Attributed_Character'(Ch => Ch, - Color => Color_Pair'First, - Attr => Normal_Video)); - end Add_With_Immediate_Echo; ------------------------------------------------------------------------------- - function Create (Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window - is - function Newwin (Number_Of_Lines : C_Int; - Number_Of_Columns : C_Int; - First_Line_Position : C_Int; - First_Column_Position : C_Int) return Window; - pragma Import (C, Newwin, "newwin"); - - W : Window; - begin - W := Newwin (C_Int (Number_Of_Lines), - C_Int (Number_Of_Columns), - C_Int (First_Line_Position), - C_Int (First_Column_Position)); - if W = Null_Window then - raise Curses_Exception; - end if; - return W; - end Create; - - procedure Delete (Win : in out Window) - is - function Wdelwin (W : Window) return C_Int; - pragma Import (C, Wdelwin, "delwin"); - begin - if Wdelwin (Win) = Curses_Err then - raise Curses_Exception; - end if; - Win := Null_Window; - end Delete; - - function Sub_Window - (Win : Window := Standard_Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window - is - function Subwin - (Win : Window; - Number_Of_Lines : C_Int; - Number_Of_Columns : C_Int; - First_Line_Position : C_Int; - First_Column_Position : C_Int) return Window; - pragma Import (C, Subwin, "subwin"); - - W : Window; - begin - W := Subwin (Win, - C_Int (Number_Of_Lines), - C_Int (Number_Of_Columns), - C_Int (First_Line_Position), - C_Int (First_Column_Position)); - if W = Null_Window then - raise Curses_Exception; - end if; - return W; - end Sub_Window; - - function Derived_Window - (Win : Window := Standard_Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window - is - function Derwin - (Win : Window; - Number_Of_Lines : C_Int; - Number_Of_Columns : C_Int; - First_Line_Position : C_Int; - First_Column_Position : C_Int) return Window; - pragma Import (C, Derwin, "derwin"); - - W : Window; - begin - W := Derwin (Win, - C_Int (Number_Of_Lines), - C_Int (Number_Of_Columns), - C_Int (First_Line_Position), - C_Int (First_Column_Position)); - if W = Null_Window then - raise Curses_Exception; - end if; - return W; - end Derived_Window; - - function Duplicate (Win : Window) return Window - is - function Dupwin (Win : Window) return Window; - pragma Import (C, Dupwin, "dupwin"); - - W : constant Window := Dupwin (Win); - begin - if W = Null_Window then - raise Curses_Exception; - end if; - return W; - end Duplicate; - - procedure Move_Window (Win : Window; - Line : Line_Position; - Column : Column_Position) - is - function Mvwin (Win : Window; - Line : C_Int; - Column : C_Int) return C_Int; - pragma Import (C, Mvwin, "mvwin"); - begin - if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then - raise Curses_Exception; - end if; - end Move_Window; - - procedure Move_Derived_Window (Win : Window; - Line : Line_Position; - Column : Column_Position) - is - function Mvderwin (Win : Window; - Line : C_Int; - Column : C_Int) return C_Int; - pragma Import (C, Mvderwin, "mvderwin"); - begin - if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then - raise Curses_Exception; - end if; - end Move_Derived_Window; - - procedure Set_Synch_Mode (Win : Window := Standard_Window; - Mode : Boolean := False) - is - function Syncok (Win : Window; - Mode : Curses_Bool) return C_Int; - pragma Import (C, Syncok, "syncok"); - begin - if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Synch_Mode; ------------------------------------------------------------------------------- - procedure Add (Win : Window := Standard_Window; - Str : String; - Len : Integer := -1) - is - function Waddnstr (Win : Window; - Str : char_array; - Len : C_Int := -1) return C_Int; - pragma Import (C, Waddnstr, "waddnstr"); - - Txt : char_array (0 .. Str'Length); - Length : size_t; - begin - To_C (Str, Txt, Length); - if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then - raise Curses_Exception; - end if; - end Add; - - procedure Add - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : String; - Len : Integer := -1) - is - begin - Move_Cursor (Win, Line, Column); - Add (Win, Str, Len); - end Add; ------------------------------------------------------------------------------- - procedure Add - (Win : Window := Standard_Window; - Str : Attributed_String; - Len : Integer := -1) - is - function Waddchnstr (Win : Window; - Str : chtype_array; - Len : C_Int := -1) return C_Int; - pragma Import (C, Waddchnstr, "waddchnstr"); - - Txt : chtype_array (0 .. Str'Length); - begin - for Length in 1 .. size_t (Str'Length) loop - Txt (Length - 1) := Str (Natural (Length)); - end loop; - Txt (Str'Length) := Default_Character; - if Waddchnstr (Win, - Txt, - C_Int (Len)) = Curses_Err then - raise Curses_Exception; - end if; - end Add; - - procedure Add - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : Attributed_String; - Len : Integer := -1) - is - begin - Move_Cursor (Win, Line, Column); - Add (Win, Str, Len); - end Add; ------------------------------------------------------------------------------- - procedure Border - (Win : Window := Standard_Window; - Left_Side_Symbol : Attributed_Character := Default_Character; - Right_Side_Symbol : Attributed_Character := Default_Character; - Top_Side_Symbol : Attributed_Character := Default_Character; - Bottom_Side_Symbol : Attributed_Character := Default_Character; - Upper_Left_Corner_Symbol : Attributed_Character := Default_Character; - Upper_Right_Corner_Symbol : Attributed_Character := Default_Character; - Lower_Left_Corner_Symbol : Attributed_Character := Default_Character; - Lower_Right_Corner_Symbol : Attributed_Character := Default_Character) - is - function Wborder (W : Window; - LS : C_Chtype; - RS : C_Chtype; - TS : C_Chtype; - BS : C_Chtype; - ULC : C_Chtype; - URC : C_Chtype; - LLC : C_Chtype; - LRC : C_Chtype) return C_Int; - pragma Import (C, Wborder, "wborder"); - begin - if Wborder (Win, - AttrChar_To_Chtype (Left_Side_Symbol), - AttrChar_To_Chtype (Right_Side_Symbol), - AttrChar_To_Chtype (Top_Side_Symbol), - AttrChar_To_Chtype (Bottom_Side_Symbol), - AttrChar_To_Chtype (Upper_Left_Corner_Symbol), - AttrChar_To_Chtype (Upper_Right_Corner_Symbol), - AttrChar_To_Chtype (Lower_Left_Corner_Symbol), - AttrChar_To_Chtype (Lower_Right_Corner_Symbol) - ) = Curses_Err - then - raise Curses_Exception; - end if; - end Border; - - procedure Box - (Win : Window := Standard_Window; - Vertical_Symbol : Attributed_Character := Default_Character; - Horizontal_Symbol : Attributed_Character := Default_Character) - is - begin - Border (Win, - Vertical_Symbol, Vertical_Symbol, - Horizontal_Symbol, Horizontal_Symbol); - end Box; - - procedure Horizontal_Line - (Win : Window := Standard_Window; - Line_Size : Natural; - Line_Symbol : Attributed_Character := Default_Character) - is - function Whline (W : Window; - Ch : C_Chtype; - Len : C_Int) return C_Int; - pragma Import (C, Whline, "whline"); - begin - if Whline (Win, - AttrChar_To_Chtype (Line_Symbol), - C_Int (Line_Size)) = Curses_Err then - raise Curses_Exception; - end if; - end Horizontal_Line; - - procedure Vertical_Line - (Win : Window := Standard_Window; - Line_Size : Natural; - Line_Symbol : Attributed_Character := Default_Character) - is - function Wvline (W : Window; - Ch : C_Chtype; - Len : C_Int) return C_Int; - pragma Import (C, Wvline, "wvline"); - begin - if Wvline (Win, - AttrChar_To_Chtype (Line_Symbol), - C_Int (Line_Size)) = Curses_Err then - raise Curses_Exception; - end if; - end Vertical_Line; - ------------------------------------------------------------------------------- - function Get_Keystroke (Win : Window := Standard_Window) - return Real_Key_Code - is - function Wgetch (W : Window) return C_Int; - pragma Import (C, Wgetch, "wgetch"); - - C : constant C_Int := Wgetch (Win); - begin - if C = Curses_Err then - return Key_None; - else - return Real_Key_Code (C); - end if; - end Get_Keystroke; - - procedure Undo_Keystroke (Key : Real_Key_Code) - is - function Ungetch (Ch : C_Int) return C_Int; - pragma Import (C, Ungetch, "ungetch"); - begin - if Ungetch (C_Int (Key)) = Curses_Err then - raise Curses_Exception; - end if; - end Undo_Keystroke; - - function Has_Key (Key : Special_Key_Code) return Boolean - is - function Haskey (Key : C_Int) return C_Int; - pragma Import (C, Haskey, "has_key"); - begin - if Haskey (C_Int (Key)) = Curses_False then - return False; - else - return True; - end if; - end Has_Key; - - function Is_Function_Key (Key : Special_Key_Code) return Boolean - is - L : constant Special_Key_Code := Special_Key_Code (Natural (Key_F0) + - Natural (Function_Key_Number'Last)); - begin - if (Key >= Key_F0) and then (Key <= L) then - return True; - else - return False; - end if; - end Is_Function_Key; - - function Function_Key (Key : Real_Key_Code) - return Function_Key_Number - is - begin - if Is_Function_Key (Key) then - return Function_Key_Number (Key - Key_F0); - else - raise Constraint_Error; - end if; - end Function_Key; - - function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code - is - begin - return Real_Key_Code (Natural (Key_F0) + Natural (Key)); - end Function_Key_Code; ------------------------------------------------------------------------------- - procedure Standout (Win : Window := Standard_Window; - On : Boolean := True) - is - function wstandout (Win : Window) return C_Int; - pragma Import (C, wstandout, "wstandout"); - function wstandend (Win : Window) return C_Int; - pragma Import (C, wstandend, "wstandend"); - - Err : C_Int; - begin - if On then - Err := wstandout (Win); - else - Err := wstandend (Win); - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Standout; - - procedure Switch_Character_Attribute - (Win : Window := Standard_Window; - Attr : Character_Attribute_Set := Normal_Video; - On : Boolean := True) - is - function Wattron (Win : Window; - C_Attr : C_AttrType) return C_Int; - pragma Import (C, Wattron, "wattr_on"); - function Wattroff (Win : Window; - C_Attr : C_AttrType) return C_Int; - pragma Import (C, Wattroff, "wattr_off"); - -- In Ada we use the On Boolean to control whether or not we want to - -- switch on or off the attributes in the set. - Err : C_Int; - AC : constant Attributed_Character := (Ch => Character'First, - Color => Color_Pair'First, - Attr => Attr); - begin - if On then - Err := Wattron (Win, AttrChar_To_AttrType (AC)); - else - Err := Wattroff (Win, AttrChar_To_AttrType (AC)); - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Switch_Character_Attribute; - - procedure Set_Character_Attributes - (Win : Window := Standard_Window; - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Wattrset (Win : Window; - C_Attr : C_AttrType) return C_Int; - pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set - begin - if Wattrset (Win, - AttrChar_To_AttrType (Attributed_Character' - (Ch => Character'First, - Color => Color, - Attr => Attr))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Character_Attributes; - - function Get_Character_Attribute (Win : Window := Standard_Window) - return Character_Attribute_Set - is - function Wattrget (Win : Window; - Atr : access C_AttrType; - Col : access C_Short; - Opt : System.Address) return C_Int; - pragma Import (C, Wattrget, "wattr_get"); - - Attr : aliased C_AttrType; - Col : aliased C_Short; - Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access, - System.Null_Address); - Ch : Attributed_Character; - begin - if Res = Curses_Ok then - Ch := AttrType_To_AttrChar (Attr); - return Ch.Attr; - else - raise Curses_Exception; - end if; - end Get_Character_Attribute; - - function Get_Character_Attribute (Win : Window := Standard_Window) - return Color_Pair - is - function Wattrget (Win : Window; - Atr : access C_AttrType; - Col : access C_Short; - Opt : System.Address) return C_Int; - pragma Import (C, Wattrget, "wattr_get"); - - Attr : aliased C_AttrType; - Col : aliased C_Short; - Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access, - System.Null_Address); - Ch : Attributed_Character; - begin - if Res = Curses_Ok then - Ch := AttrType_To_AttrChar (Attr); - return Ch.Color; - else - raise Curses_Exception; - end if; - end Get_Character_Attribute; - - procedure Set_Color (Win : Window := Standard_Window; - Pair : Color_Pair) - is - function Wset_Color (Win : Window; - Color : C_Short; - Opts : C_Void_Ptr) return C_Int; - pragma Import (C, Wset_Color, "wcolor_set"); - begin - if Wset_Color (Win, - C_Short (Pair), - C_Void_Ptr (System.Null_Address)) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Color; - - procedure Change_Attributes - (Win : Window := Standard_Window; - Count : Integer := -1; - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Wchgat (Win : Window; - Cnt : C_Int; - Attr : C_AttrType; - Color : C_Short; - Opts : System.Address := System.Null_Address) - return C_Int; - pragma Import (C, Wchgat, "wchgat"); - - Ch : constant Attributed_Character := - (Ch => Character'First, Color => Color_Pair'First, Attr => Attr); - begin - if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch), - C_Short (Color)) = Curses_Err then - raise Curses_Exception; - end if; - end Change_Attributes; - - procedure Change_Attributes - (Win : Window := Standard_Window; - Line : Line_Position := Line_Position'First; - Column : Column_Position := Column_Position'First; - Count : Integer := -1; - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - begin - Move_Cursor (Win, Line, Column); - Change_Attributes (Win, Count, Attr, Color); - end Change_Attributes; ------------------------------------------------------------------------------- - procedure Beep - is - function Beeper return C_Int; - pragma Import (C, Beeper, "beep"); - begin - if Beeper = Curses_Err then - raise Curses_Exception; - end if; - end Beep; - - procedure Flash_Screen - is - function Flash return C_Int; - pragma Import (C, Flash, "flash"); - begin - if Flash = Curses_Err then - raise Curses_Exception; - end if; - end Flash_Screen; ------------------------------------------------------------------------------- - procedure Set_Cbreak_Mode (SwitchOn : Boolean := True) - is - function Cbreak return C_Int; - pragma Import (C, Cbreak, "cbreak"); - function NoCbreak return C_Int; - pragma Import (C, NoCbreak, "nocbreak"); - - Err : C_Int; - begin - if SwitchOn then - Err := Cbreak; - else - Err := NoCbreak; - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Set_Cbreak_Mode; - - procedure Set_Raw_Mode (SwitchOn : Boolean := True) - is - function Raw return C_Int; - pragma Import (C, Raw, "raw"); - function NoRaw return C_Int; - pragma Import (C, NoRaw, "noraw"); - - Err : C_Int; - begin - if SwitchOn then - Err := Raw; - else - Err := NoRaw; - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Set_Raw_Mode; - - procedure Set_Echo_Mode (SwitchOn : Boolean := True) - is - function Echo return C_Int; - pragma Import (C, Echo, "echo"); - function NoEcho return C_Int; - pragma Import (C, NoEcho, "noecho"); - - Err : C_Int; - begin - if SwitchOn then - Err := Echo; - else - Err := NoEcho; - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Set_Echo_Mode; - - procedure Set_Meta_Mode (Win : Window := Standard_Window; - SwitchOn : Boolean := True) - is - function Meta (W : Window; Mode : Curses_Bool) return C_Int; - pragma Import (C, Meta, "meta"); - begin - if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Meta_Mode; - - procedure Set_KeyPad_Mode (Win : Window := Standard_Window; - SwitchOn : Boolean := True) - is - function Keypad (W : Window; Mode : Curses_Bool) return C_Int; - pragma Import (C, Keypad, "keypad"); - begin - if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_KeyPad_Mode; - - function Get_KeyPad_Mode (Win : Window := Standard_Window) - return Boolean - is - function Is_Keypad (W : Window) return Curses_Bool; - pragma Import (C, Is_Keypad, "is_keypad"); - begin - return (Is_Keypad (Win) /= Curses_Bool_False); - end Get_KeyPad_Mode; - - procedure Half_Delay (Amount : Half_Delay_Amount) - is - function Halfdelay (Amount : C_Int) return C_Int; - pragma Import (C, Halfdelay, "halfdelay"); - begin - if Halfdelay (C_Int (Amount)) = Curses_Err then - raise Curses_Exception; - end if; - end Half_Delay; - - procedure Set_Flush_On_Interrupt_Mode - (Win : Window := Standard_Window; - Mode : Boolean := True) - is - function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int; - pragma Import (C, Intrflush, "intrflush"); - begin - if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Flush_On_Interrupt_Mode; - - procedure Set_Queue_Interrupt_Mode - (Win : Window := Standard_Window; - Flush : Boolean := True) - is - procedure Qiflush; - pragma Import (C, Qiflush, "qiflush"); - procedure No_Qiflush; - pragma Import (C, No_Qiflush, "noqiflush"); - begin - if Win = Null_Window then - raise Curses_Exception; - end if; - if Flush then - Qiflush; - else - No_Qiflush; - end if; - end Set_Queue_Interrupt_Mode; - - procedure Set_NoDelay_Mode - (Win : Window := Standard_Window; - Mode : Boolean := False) - is - function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int; - pragma Import (C, Nodelay, "nodelay"); - begin - if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_NoDelay_Mode; - - procedure Set_Timeout_Mode (Win : Window := Standard_Window; - Mode : Timeout_Mode; - Amount : Natural) - is - procedure Wtimeout (Win : Window; Amount : C_Int); - pragma Import (C, Wtimeout, "wtimeout"); - - Time : C_Int; - begin - case Mode is - when Blocking => Time := -1; - when Non_Blocking => Time := 0; - when Delayed => - if Amount = 0 then - raise Constraint_Error; - end if; - Time := C_Int (Amount); - end case; - Wtimeout (Win, Time); - end Set_Timeout_Mode; - - procedure Set_Escape_Timer_Mode - (Win : Window := Standard_Window; - Timer_Off : Boolean := False) - is - function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int; - pragma Import (C, Notimeout, "notimeout"); - begin - if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off))) - = Curses_Err then - raise Curses_Exception; - end if; - end Set_Escape_Timer_Mode; - ------------------------------------------------------------------------------- - procedure Set_NL_Mode (SwitchOn : Boolean := True) - is - function NL return C_Int; - pragma Import (C, NL, "nl"); - function NoNL return C_Int; - pragma Import (C, NoNL, "nonl"); - - Err : C_Int; - begin - if SwitchOn then - Err := NL; - else - Err := NoNL; - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Set_NL_Mode; - - procedure Clear_On_Next_Update - (Win : Window := Standard_Window; - Do_Clear : Boolean := True) - is - function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int; - pragma Import (C, Clear_Ok, "clearok"); - begin - if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then - raise Curses_Exception; - end if; - end Clear_On_Next_Update; - - procedure Use_Insert_Delete_Line - (Win : Window := Standard_Window; - Do_Idl : Boolean := True) - is - function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int; - pragma Import (C, IDL_Ok, "idlok"); - begin - if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then - raise Curses_Exception; - end if; - end Use_Insert_Delete_Line; - - procedure Use_Insert_Delete_Character - (Win : Window := Standard_Window; - Do_Idc : Boolean := True) - is - procedure IDC_Ok (W : Window; Flag : Curses_Bool); - pragma Import (C, IDC_Ok, "idcok"); - begin - IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc))); - end Use_Insert_Delete_Character; - - procedure Leave_Cursor_After_Update - (Win : Window := Standard_Window; - Do_Leave : Boolean := True) - is - function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int; - pragma Import (C, Leave_Ok, "leaveok"); - begin - if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then - raise Curses_Exception; - end if; - end Leave_Cursor_After_Update; - - procedure Immediate_Update_Mode - (Win : Window := Standard_Window; - Mode : Boolean := False) - is - procedure Immedok (Win : Window; Mode : Curses_Bool); - pragma Import (C, Immedok, "immedok"); - begin - Immedok (Win, Curses_Bool (Boolean'Pos (Mode))); - end Immediate_Update_Mode; - - procedure Allow_Scrolling - (Win : Window := Standard_Window; - Mode : Boolean := False) - is - function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int; - pragma Import (C, Scrollok, "scrollok"); - begin - if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then - raise Curses_Exception; - end if; - end Allow_Scrolling; - - function Scrolling_Allowed (Win : Window := Standard_Window) - return Boolean - is - function Is_Scroll_Ok (W : Window) return Curses_Bool; - pragma Import (C, Is_Scroll_Ok, "is_scrollok"); - begin - return (Is_Scroll_Ok (Win) /= Curses_Bool_False); - end Scrolling_Allowed; - - procedure Set_Scroll_Region - (Win : Window := Standard_Window; - Top_Line : Line_Position; - Bottom_Line : Line_Position) - is - function Wsetscrreg (Win : Window; - Lin : C_Int; - Col : C_Int) return C_Int; - pragma Import (C, Wsetscrreg, "wsetscrreg"); - begin - if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line)) - = Curses_Err then - raise Curses_Exception; - end if; - end Set_Scroll_Region; ------------------------------------------------------------------------------- - procedure Update_Screen - is - function Do_Update return C_Int; - pragma Import (C, Do_Update, "doupdate"); - begin - if Do_Update = Curses_Err then - raise Curses_Exception; - end if; - end Update_Screen; - - procedure Refresh (Win : Window := Standard_Window) - is - function Wrefresh (W : Window) return C_Int; - pragma Import (C, Wrefresh, "wrefresh"); - begin - if Wrefresh (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Refresh; - - procedure Refresh_Without_Update - (Win : Window := Standard_Window) - is - function Wnoutrefresh (W : Window) return C_Int; - pragma Import (C, Wnoutrefresh, "wnoutrefresh"); - begin - if Wnoutrefresh (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Refresh_Without_Update; - - procedure Redraw (Win : Window := Standard_Window) - is - function Redrawwin (Win : Window) return C_Int; - pragma Import (C, Redrawwin, "redrawwin"); - begin - if Redrawwin (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Redraw; - - procedure Redraw - (Win : Window := Standard_Window; - Begin_Line : Line_Position; - Line_Count : Positive) - is - function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int) - return C_Int; - pragma Import (C, Wredrawln, "wredrawln"); - begin - if Wredrawln (Win, - C_Int (Begin_Line), - C_Int (Line_Count)) = Curses_Err then - raise Curses_Exception; - end if; - end Redraw; - ------------------------------------------------------------------------------- - procedure Erase (Win : Window := Standard_Window) - is - function Werase (W : Window) return C_Int; - pragma Import (C, Werase, "werase"); - begin - if Werase (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Erase; - - procedure Clear (Win : Window := Standard_Window) - is - function Wclear (W : Window) return C_Int; - pragma Import (C, Wclear, "wclear"); - begin - if Wclear (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Clear; - - procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window) - is - function Wclearbot (W : Window) return C_Int; - pragma Import (C, Wclearbot, "wclrtobot"); - begin - if Wclearbot (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Clear_To_End_Of_Screen; - - procedure Clear_To_End_Of_Line (Win : Window := Standard_Window) - is - function Wcleareol (W : Window) return C_Int; - pragma Import (C, Wcleareol, "wclrtoeol"); - begin - if Wcleareol (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Clear_To_End_Of_Line; ------------------------------------------------------------------------------- - procedure Set_Background - (Win : Window := Standard_Window; - Ch : Attributed_Character) - is - procedure WBackground (W : Window; Ch : C_Chtype); - pragma Import (C, WBackground, "wbkgdset"); - begin - WBackground (Win, AttrChar_To_Chtype (Ch)); - end Set_Background; - - procedure Change_Background - (Win : Window := Standard_Window; - Ch : Attributed_Character) - is - function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int; - pragma Import (C, WChangeBkgd, "wbkgd"); - begin - if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Change_Background; - - function Get_Background (Win : Window := Standard_Window) - return Attributed_Character - is - function Wgetbkgd (Win : Window) return C_Chtype; - pragma Import (C, Wgetbkgd, "getbkgd"); - begin - return Chtype_To_AttrChar (Wgetbkgd (Win)); - end Get_Background; ------------------------------------------------------------------------------- - procedure Change_Lines_Status (Win : Window := Standard_Window; - Start : Line_Position; - Count : Positive; - State : Boolean) - is - function Wtouchln (Win : Window; - Sta : C_Int; - Cnt : C_Int; - Chg : C_Int) return C_Int; - pragma Import (C, Wtouchln, "wtouchln"); - begin - if Wtouchln (Win, C_Int (Start), C_Int (Count), - C_Int (Boolean'Pos (State))) = Curses_Err then - raise Curses_Exception; - end if; - end Change_Lines_Status; - - procedure Touch (Win : Window := Standard_Window) - is - Y : Line_Position; - X : Column_Position; - begin - Get_Size (Win, Y, X); - pragma Unreferenced (X); - Change_Lines_Status (Win, 0, Positive (Y), True); - end Touch; - - procedure Untouch (Win : Window := Standard_Window) - is - Y : Line_Position; - X : Column_Position; - begin - Get_Size (Win, Y, X); - pragma Unreferenced (X); - Change_Lines_Status (Win, 0, Positive (Y), False); - end Untouch; - - procedure Touch (Win : Window := Standard_Window; - Start : Line_Position; - Count : Positive) - is - begin - Change_Lines_Status (Win, Start, Count, True); - end Touch; - - function Is_Touched - (Win : Window := Standard_Window; - Line : Line_Position) return Boolean - is - function WLineTouched (W : Window; L : C_Int) return Curses_Bool; - pragma Import (C, WLineTouched, "is_linetouched"); - begin - if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then - return False; - else - return True; - end if; - end Is_Touched; - - function Is_Touched - (Win : Window := Standard_Window) return Boolean - is - function WWinTouched (W : Window) return Curses_Bool; - pragma Import (C, WWinTouched, "is_wintouched"); - begin - if WWinTouched (Win) = Curses_Bool_False then - return False; - else - return True; - end if; - end Is_Touched; ------------------------------------------------------------------------------- - procedure Copy - (Source_Window : Window; - Destination_Window : Window; - Source_Top_Row : Line_Position; - Source_Left_Column : Column_Position; - Destination_Top_Row : Line_Position; - Destination_Left_Column : Column_Position; - Destination_Bottom_Row : Line_Position; - Destination_Right_Column : Column_Position; - Non_Destructive_Mode : Boolean := True) - is - function Copywin (Src : Window; - Dst : Window; - Str : C_Int; - Slc : C_Int; - Dtr : C_Int; - Dlc : C_Int; - Dbr : C_Int; - Drc : C_Int; - Ndm : C_Int) return C_Int; - pragma Import (C, Copywin, "copywin"); - begin - if Copywin (Source_Window, - Destination_Window, - C_Int (Source_Top_Row), - C_Int (Source_Left_Column), - C_Int (Destination_Top_Row), - C_Int (Destination_Left_Column), - C_Int (Destination_Bottom_Row), - C_Int (Destination_Right_Column), - Boolean'Pos (Non_Destructive_Mode) - ) = Curses_Err then - raise Curses_Exception; - end if; - end Copy; - - procedure Overwrite - (Source_Window : Window; - Destination_Window : Window) - is - function Overwrite (Src : Window; Dst : Window) return C_Int; - pragma Import (C, Overwrite, "overwrite"); - begin - if Overwrite (Source_Window, Destination_Window) = Curses_Err then - raise Curses_Exception; - end if; - end Overwrite; - - procedure Overlay - (Source_Window : Window; - Destination_Window : Window) - is - function Overlay (Src : Window; Dst : Window) return C_Int; - pragma Import (C, Overlay, "overlay"); - begin - if Overlay (Source_Window, Destination_Window) = Curses_Err then - raise Curses_Exception; - end if; - end Overlay; - ------------------------------------------------------------------------------- - procedure Insert_Delete_Lines - (Win : Window := Standard_Window; - Lines : Integer := 1) -- default is to insert one line above - is - function Winsdelln (W : Window; N : C_Int) return C_Int; - pragma Import (C, Winsdelln, "winsdelln"); - begin - if Winsdelln (Win, C_Int (Lines)) = Curses_Err then - raise Curses_Exception; - end if; - end Insert_Delete_Lines; - - procedure Delete_Line (Win : Window := Standard_Window) - is - begin - Insert_Delete_Lines (Win, -1); - end Delete_Line; - - procedure Insert_Line (Win : Window := Standard_Window) - is - begin - Insert_Delete_Lines (Win, 1); - end Insert_Line; ------------------------------------------------------------------------------- - - procedure Get_Size - (Win : Window := Standard_Window; - Number_Of_Lines : out Line_Count; - Number_Of_Columns : out Column_Count) - is - function GetMaxY (W : Window) return C_Int; - pragma Import (C, GetMaxY, "getmaxy"); - - function GetMaxX (W : Window) return C_Int; - pragma Import (C, GetMaxX, "getmaxx"); - - Y : constant C_Int := GetMaxY (Win); - X : constant C_Int := GetMaxX (Win); - begin - Number_Of_Lines := Line_Count (Y); - Number_Of_Columns := Column_Count (X); - end Get_Size; - - procedure Get_Window_Position - (Win : Window := Standard_Window; - Top_Left_Line : out Line_Position; - Top_Left_Column : out Column_Position) - is - function GetBegY (W : Window) return C_Int; - pragma Import (C, GetBegY, "getbegy"); - - function GetBegX (W : Window) return C_Int; - pragma Import (C, GetBegX, "getbegx"); - - Y : constant C_Short := C_Short (GetBegY (Win)); - X : constant C_Short := C_Short (GetBegX (Win)); - begin - Top_Left_Line := Line_Position (Y); - Top_Left_Column := Column_Position (X); - end Get_Window_Position; - - procedure Get_Cursor_Position - (Win : Window := Standard_Window; - Line : out Line_Position; - Column : out Column_Position) - is - function GetCurY (W : Window) return C_Int; - pragma Import (C, GetCurY, "getcury"); - - function GetCurX (W : Window) return C_Int; - pragma Import (C, GetCurX, "getcurx"); - - Y : constant C_Short := C_Short (GetCurY (Win)); - X : constant C_Short := C_Short (GetCurX (Win)); - begin - Line := Line_Position (Y); - Column := Column_Position (X); - end Get_Cursor_Position; - - procedure Get_Origin_Relative_To_Parent - (Win : Window; - Top_Left_Line : out Line_Position; - Top_Left_Column : out Column_Position; - Is_Not_A_Subwindow : out Boolean) - is - function GetParY (W : Window) return C_Int; - pragma Import (C, GetParY, "getpary"); - - function GetParX (W : Window) return C_Int; - pragma Import (C, GetParX, "getparx"); - - Y : constant C_Int := GetParY (Win); - X : constant C_Int := GetParX (Win); - begin - if Y = -1 then - Top_Left_Line := Line_Position'Last; - Top_Left_Column := Column_Position'Last; - Is_Not_A_Subwindow := True; - else - Top_Left_Line := Line_Position (Y); - Top_Left_Column := Column_Position (X); - Is_Not_A_Subwindow := False; - end if; - end Get_Origin_Relative_To_Parent; ------------------------------------------------------------------------------- - function New_Pad (Lines : Line_Count; - Columns : Column_Count) return Window - is - function Newpad (Lines : C_Int; Columns : C_Int) return Window; - pragma Import (C, Newpad, "newpad"); - - W : Window; - begin - W := Newpad (C_Int (Lines), C_Int (Columns)); - if W = Null_Window then - raise Curses_Exception; - end if; - return W; - end New_Pad; - - function Sub_Pad - (Pad : Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window - is - function Subpad - (Pad : Window; - Number_Of_Lines : C_Int; - Number_Of_Columns : C_Int; - First_Line_Position : C_Int; - First_Column_Position : C_Int) return Window; - pragma Import (C, Subpad, "subpad"); - - W : Window; - begin - W := Subpad (Pad, - C_Int (Number_Of_Lines), - C_Int (Number_Of_Columns), - C_Int (First_Line_Position), - C_Int (First_Column_Position)); - if W = Null_Window then - raise Curses_Exception; - end if; - return W; - end Sub_Pad; - - procedure Refresh - (Pad : Window; - Source_Top_Row : Line_Position; - Source_Left_Column : Column_Position; - Destination_Top_Row : Line_Position; - Destination_Left_Column : Column_Position; - Destination_Bottom_Row : Line_Position; - Destination_Right_Column : Column_Position) - is - function Prefresh - (Pad : Window; - Source_Top_Row : C_Int; - Source_Left_Column : C_Int; - Destination_Top_Row : C_Int; - Destination_Left_Column : C_Int; - Destination_Bottom_Row : C_Int; - Destination_Right_Column : C_Int) return C_Int; - pragma Import (C, Prefresh, "prefresh"); - begin - if Prefresh (Pad, - C_Int (Source_Top_Row), - C_Int (Source_Left_Column), - C_Int (Destination_Top_Row), - C_Int (Destination_Left_Column), - C_Int (Destination_Bottom_Row), - C_Int (Destination_Right_Column)) = Curses_Err then - raise Curses_Exception; - end if; - end Refresh; - - procedure Refresh_Without_Update - (Pad : Window; - Source_Top_Row : Line_Position; - Source_Left_Column : Column_Position; - Destination_Top_Row : Line_Position; - Destination_Left_Column : Column_Position; - Destination_Bottom_Row : Line_Position; - Destination_Right_Column : Column_Position) - is - function Pnoutrefresh - (Pad : Window; - Source_Top_Row : C_Int; - Source_Left_Column : C_Int; - Destination_Top_Row : C_Int; - Destination_Left_Column : C_Int; - Destination_Bottom_Row : C_Int; - Destination_Right_Column : C_Int) return C_Int; - pragma Import (C, Pnoutrefresh, "pnoutrefresh"); - begin - if Pnoutrefresh (Pad, - C_Int (Source_Top_Row), - C_Int (Source_Left_Column), - C_Int (Destination_Top_Row), - C_Int (Destination_Left_Column), - C_Int (Destination_Bottom_Row), - C_Int (Destination_Right_Column)) = Curses_Err then - raise Curses_Exception; - end if; - end Refresh_Without_Update; - - procedure Add_Character_To_Pad_And_Echo_It - (Pad : Window; - Ch : Attributed_Character) - is - function Pechochar (Pad : Window; Ch : C_Chtype) - return C_Int; - pragma Import (C, Pechochar, "pechochar"); - begin - if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Add_Character_To_Pad_And_Echo_It; - - procedure Add_Character_To_Pad_And_Echo_It - (Pad : Window; - Ch : Character) - is - begin - Add_Character_To_Pad_And_Echo_It - (Pad, - Attributed_Character'(Ch => Ch, - Color => Color_Pair'First, - Attr => Normal_Video)); - end Add_Character_To_Pad_And_Echo_It; ------------------------------------------------------------------------------- - procedure Scroll (Win : Window := Standard_Window; - Amount : Integer := 1) - is - function Wscrl (Win : Window; N : C_Int) return C_Int; - pragma Import (C, Wscrl, "wscrl"); - - begin - if Wscrl (Win, C_Int (Amount)) = Curses_Err then - raise Curses_Exception; - end if; - end Scroll; - ------------------------------------------------------------------------------- - procedure Delete_Character (Win : Window := Standard_Window) - is - function Wdelch (Win : Window) return C_Int; - pragma Import (C, Wdelch, "wdelch"); - begin - if Wdelch (Win) = Curses_Err then - raise Curses_Exception; - end if; - end Delete_Character; - - procedure Delete_Character - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position) - is - function Mvwdelch (Win : Window; - Lin : C_Int; - Col : C_Int) return C_Int; - pragma Import (C, Mvwdelch, "mvwdelch"); - begin - if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then - raise Curses_Exception; - end if; - end Delete_Character; ------------------------------------------------------------------------------- - function Peek (Win : Window := Standard_Window) - return Attributed_Character - is - function Winch (Win : Window) return C_Chtype; - pragma Import (C, Winch, "winch"); - begin - return Chtype_To_AttrChar (Winch (Win)); - end Peek; - - function Peek - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position) return Attributed_Character - is - function Mvwinch (Win : Window; - Lin : C_Int; - Col : C_Int) return C_Chtype; - pragma Import (C, Mvwinch, "mvwinch"); - begin - return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column))); - end Peek; ------------------------------------------------------------------------------- - procedure Insert (Win : Window := Standard_Window; - Ch : Attributed_Character) - is - function Winsch (Win : Window; Ch : C_Chtype) return C_Int; - pragma Import (C, Winsch, "winsch"); - begin - if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Insert; - - procedure Insert - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Ch : Attributed_Character) - is - function Mvwinsch (Win : Window; - Lin : C_Int; - Col : C_Int; - Ch : C_Chtype) return C_Int; - pragma Import (C, Mvwinsch, "mvwinsch"); - begin - if Mvwinsch (Win, - C_Int (Line), - C_Int (Column), - AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Insert; ------------------------------------------------------------------------------- - procedure Insert (Win : Window := Standard_Window; - Str : String; - Len : Integer := -1) - is - function Winsnstr (Win : Window; - Str : char_array; - Len : Integer := -1) return C_Int; - pragma Import (C, Winsnstr, "winsnstr"); - - Txt : char_array (0 .. Str'Length); - Length : size_t; - begin - To_C (Str, Txt, Length); - if Winsnstr (Win, Txt, Len) = Curses_Err then - raise Curses_Exception; - end if; - end Insert; - - procedure Insert - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : String; - Len : Integer := -1) - is - function Mvwinsnstr (Win : Window; - Line : C_Int; - Column : C_Int; - Str : char_array; - Len : C_Int) return C_Int; - pragma Import (C, Mvwinsnstr, "mvwinsnstr"); - - Txt : char_array (0 .. Str'Length); - Length : size_t; - begin - To_C (Str, Txt, Length); - if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len)) - = Curses_Err then - raise Curses_Exception; - end if; - end Insert; ------------------------------------------------------------------------------- - procedure Peek (Win : Window := Standard_Window; - Str : out String; - Len : Integer := -1) - is - function Winnstr (Win : Window; - Str : char_array; - Len : C_Int) return C_Int; - pragma Import (C, Winnstr, "winnstr"); - - N : Integer := Len; - Txt : char_array (0 .. Str'Length); - Cnt : Natural; - begin - if N < 0 then - N := Str'Length; - end if; - if N > Str'Length then - raise Constraint_Error; - end if; - Txt (0) := Interfaces.C.char'First; - if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then - raise Curses_Exception; - end if; - To_Ada (Txt, Str, Cnt, True); - if Cnt < Str'Length then - Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); - end if; - end Peek; - - procedure Peek - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : out String; - Len : Integer := -1) - is - begin - Move_Cursor (Win, Line, Column); - Peek (Win, Str, Len); - end Peek; ------------------------------------------------------------------------------- - procedure Peek - (Win : Window := Standard_Window; - Str : out Attributed_String; - Len : Integer := -1) - is - function Winchnstr (Win : Window; - Str : chtype_array; -- out - Len : C_Int) return C_Int; - pragma Import (C, Winchnstr, "winchnstr"); - - N : Integer := Len; - Txt : constant chtype_array (0 .. Str'Length) - := (0 => Default_Character); - Cnt : Natural := 0; - begin - if N < 0 then - N := Str'Length; - end if; - if N > Str'Length then - raise Constraint_Error; - end if; - if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then - raise Curses_Exception; - end if; - for To in Str'Range loop - exit when Txt (size_t (Cnt)) = Default_Character; - Str (To) := Txt (size_t (Cnt)); - Cnt := Cnt + 1; - end loop; - if Cnt < Str'Length then - Str ((Str'First + Cnt) .. Str'Last) := - (others => (Ch => ' ', - Color => Color_Pair'First, - Attr => Normal_Video)); - end if; - end Peek; - - procedure Peek - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : out Attributed_String; - Len : Integer := -1) - is - begin - Move_Cursor (Win, Line, Column); - Peek (Win, Str, Len); - end Peek; ------------------------------------------------------------------------------- - procedure Get (Win : Window := Standard_Window; - Str : out String; - Len : Integer := -1) - is - function Wgetnstr (Win : Window; - Str : char_array; - Len : C_Int) return C_Int; - pragma Import (C, Wgetnstr, "wgetnstr"); - - N : Integer := Len; - Txt : char_array (0 .. Str'Length); - Cnt : Natural; - begin - if N < 0 then - N := Str'Length; - end if; - if N > Str'Length then - raise Constraint_Error; - end if; - Txt (0) := Interfaces.C.char'First; - if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then - raise Curses_Exception; - end if; - To_Ada (Txt, Str, Cnt, True); - if Cnt < Str'Length then - Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); - end if; - end Get; - - procedure Get - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : out String; - Len : Integer := -1) - is - begin - Move_Cursor (Win, Line, Column); - Get (Win, Str, Len); - end Get; ------------------------------------------------------------------------------- - procedure Init_Soft_Label_Keys - (Format : Soft_Label_Key_Format := Three_Two_Three) - is - function Slk_Init (Fmt : C_Int) return C_Int; - pragma Import (C, Slk_Init, "slk_init"); - begin - if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then - raise Curses_Exception; - end if; - end Init_Soft_Label_Keys; - - procedure Set_Soft_Label_Key (Label : Label_Number; - Text : String; - Fmt : Label_Justification := Left) - is - function Slk_Set (Label : C_Int; - Txt : char_array; - Fmt : C_Int) return C_Int; - pragma Import (C, Slk_Set, "slk_set"); - - Txt : char_array (0 .. Text'Length); - Len : size_t; - begin - To_C (Text, Txt, Len); - if Slk_Set (C_Int (Label), Txt, - C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Soft_Label_Key; - - procedure Refresh_Soft_Label_Keys - is - function Slk_Refresh return C_Int; - pragma Import (C, Slk_Refresh, "slk_refresh"); - begin - if Slk_Refresh = Curses_Err then - raise Curses_Exception; - end if; - end Refresh_Soft_Label_Keys; - - procedure Refresh_Soft_Label_Keys_Without_Update - is - function Slk_Noutrefresh return C_Int; - pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh"); - begin - if Slk_Noutrefresh = Curses_Err then - raise Curses_Exception; - end if; - end Refresh_Soft_Label_Keys_Without_Update; - - procedure Get_Soft_Label_Key (Label : Label_Number; - Text : out String) - is - function Slk_Label (Label : C_Int) return chars_ptr; - pragma Import (C, Slk_Label, "slk_label"); - begin - Fill_String (Slk_Label (C_Int (Label)), Text); - end Get_Soft_Label_Key; - - function Get_Soft_Label_Key (Label : Label_Number) return String - is - function Slk_Label (Label : C_Int) return chars_ptr; - pragma Import (C, Slk_Label, "slk_label"); - begin - return Fill_String (Slk_Label (C_Int (Label))); - end Get_Soft_Label_Key; - - procedure Clear_Soft_Label_Keys - is - function Slk_Clear return C_Int; - pragma Import (C, Slk_Clear, "slk_clear"); - begin - if Slk_Clear = Curses_Err then - raise Curses_Exception; - end if; - end Clear_Soft_Label_Keys; - - procedure Restore_Soft_Label_Keys - is - function Slk_Restore return C_Int; - pragma Import (C, Slk_Restore, "slk_restore"); - begin - if Slk_Restore = Curses_Err then - raise Curses_Exception; - end if; - end Restore_Soft_Label_Keys; - - procedure Touch_Soft_Label_Keys - is - function Slk_Touch return C_Int; - pragma Import (C, Slk_Touch, "slk_touch"); - begin - if Slk_Touch = Curses_Err then - raise Curses_Exception; - end if; - end Touch_Soft_Label_Keys; - - procedure Switch_Soft_Label_Key_Attributes - (Attr : Character_Attribute_Set; - On : Boolean := True) - is - function Slk_Attron (Ch : C_Chtype) return C_Int; - pragma Import (C, Slk_Attron, "slk_attron"); - function Slk_Attroff (Ch : C_Chtype) return C_Int; - pragma Import (C, Slk_Attroff, "slk_attroff"); - - Err : C_Int; - Ch : constant Attributed_Character := (Ch => Character'First, - Attr => Attr, - Color => Color_Pair'First); - begin - if On then - Err := Slk_Attron (AttrChar_To_Chtype (Ch)); - else - Err := Slk_Attroff (AttrChar_To_Chtype (Ch)); - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Switch_Soft_Label_Key_Attributes; - - procedure Set_Soft_Label_Key_Attributes - (Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Slk_Attrset (Ch : C_Chtype) return C_Int; - pragma Import (C, Slk_Attrset, "slk_attrset"); - - Ch : constant Attributed_Character := (Ch => Character'First, - Attr => Attr, - Color => Color); - begin - if Slk_Attrset (AttrChar_To_Chtype (Ch)) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Soft_Label_Key_Attributes; - - function Get_Soft_Label_Key_Attributes return Character_Attribute_Set - is - function Slk_Attr return C_Chtype; - pragma Import (C, Slk_Attr, "slk_attr"); - - Attr : constant C_Chtype := Slk_Attr; - begin - return Chtype_To_AttrChar (Attr).Attr; - end Get_Soft_Label_Key_Attributes; - - function Get_Soft_Label_Key_Attributes return Color_Pair - is - function Slk_Attr return C_Chtype; - pragma Import (C, Slk_Attr, "slk_attr"); - - Attr : constant C_Chtype := Slk_Attr; - begin - return Chtype_To_AttrChar (Attr).Color; - end Get_Soft_Label_Key_Attributes; - - procedure Set_Soft_Label_Key_Color (Pair : Color_Pair) - is - function Slk_Color (Color : C_Short) return C_Int; - pragma Import (C, Slk_Color, "slk_color"); - begin - if Slk_Color (C_Short (Pair)) = Curses_Err then - raise Curses_Exception; - end if; - end Set_Soft_Label_Key_Color; - ------------------------------------------------------------------------------- - procedure Enable_Key (Key : Special_Key_Code; - Enable : Boolean := True) - is - function Keyok (Keycode : C_Int; - On_Off : Curses_Bool) return C_Int; - pragma Import (C, Keyok, "keyok"); - begin - if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable))) - = Curses_Err then - raise Curses_Exception; - end if; - end Enable_Key; ------------------------------------------------------------------------------- - procedure Define_Key (Definition : String; - Key : Special_Key_Code) - is - function Defkey (Def : char_array; - Key : C_Int) return C_Int; - pragma Import (C, Defkey, "define_key"); - - Txt : char_array (0 .. Definition'Length); - Length : size_t; - begin - To_C (Definition, Txt, Length); - if Defkey (Txt, C_Int (Key)) = Curses_Err then - raise Curses_Exception; - end if; - end Define_Key; ------------------------------------------------------------------------------- - procedure Un_Control (Ch : Attributed_Character; - Str : out String) - is - function Unctrl (Ch : C_Chtype) return chars_ptr; - pragma Import (C, Unctrl, "unctrl"); - begin - Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str); - end Un_Control; - - function Un_Control (Ch : Attributed_Character) return String - is - function Unctrl (Ch : C_Chtype) return chars_ptr; - pragma Import (C, Unctrl, "unctrl"); - begin - return Fill_String (Unctrl (AttrChar_To_Chtype (Ch))); - end Un_Control; - - procedure Delay_Output (Msecs : Natural) - is - function Delayoutput (Msecs : C_Int) return C_Int; - pragma Import (C, Delayoutput, "delay_output"); - begin - if Delayoutput (C_Int (Msecs)) = Curses_Err then - raise Curses_Exception; - end if; - end Delay_Output; - - procedure Flush_Input - is - function Flushinp return C_Int; - pragma Import (C, Flushinp, "flushinp"); - begin - if Flushinp = Curses_Err then -- docu says that never happens, but... - raise Curses_Exception; - end if; - end Flush_Input; ------------------------------------------------------------------------------- - function Baudrate return Natural - is - function Baud return C_Int; - pragma Import (C, Baud, "baudrate"); - begin - return Natural (Baud); - end Baudrate; - - function Erase_Character return Character - is - function Erasechar return C_Int; - pragma Import (C, Erasechar, "erasechar"); - begin - return Character'Val (Erasechar); - end Erase_Character; - - function Kill_Character return Character - is - function Killchar return C_Int; - pragma Import (C, Killchar, "killchar"); - begin - return Character'Val (Killchar); - end Kill_Character; - - function Has_Insert_Character return Boolean - is - function Has_Ic return Curses_Bool; - pragma Import (C, Has_Ic, "has_ic"); - begin - if Has_Ic = Curses_Bool_False then - return False; - else - return True; - end if; - end Has_Insert_Character; - - function Has_Insert_Line return Boolean - is - function Has_Il return Curses_Bool; - pragma Import (C, Has_Il, "has_il"); - begin - if Has_Il = Curses_Bool_False then - return False; - else - return True; - end if; - end Has_Insert_Line; - - function Supported_Attributes return Character_Attribute_Set - is - function Termattrs return C_Chtype; - pragma Import (C, Termattrs, "termattrs"); - - Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs); - begin - return Ch.Attr; - end Supported_Attributes; - - procedure Long_Name (Name : out String) - is - function Longname return chars_ptr; - pragma Import (C, Longname, "longname"); - begin - Fill_String (Longname, Name); - end Long_Name; - - function Long_Name return String - is - function Longname return chars_ptr; - pragma Import (C, Longname, "longname"); - begin - return Fill_String (Longname); - end Long_Name; - - procedure Terminal_Name (Name : out String) - is - function Termname return chars_ptr; - pragma Import (C, Termname, "termname"); - begin - Fill_String (Termname, Name); - end Terminal_Name; - - function Terminal_Name return String - is - function Termname return chars_ptr; - pragma Import (C, Termname, "termname"); - begin - return Fill_String (Termname); - end Terminal_Name; ------------------------------------------------------------------------------- - procedure Init_Pair (Pair : Redefinable_Color_Pair; - Fore : Color_Number; - Back : Color_Number) - is - function Initpair (Pair : C_Short; - Fore : C_Short; - Back : C_Short) return C_Int; - pragma Import (C, Initpair, "init_pair"); - begin - if Integer (Pair) >= Number_Of_Color_Pairs then - raise Constraint_Error; - end if; - if Integer (Fore) >= Number_Of_Colors or else - Integer (Back) >= Number_Of_Colors then - raise Constraint_Error; - end if; - if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back)) - = Curses_Err then - raise Curses_Exception; - end if; - end Init_Pair; - - procedure Pair_Content (Pair : Color_Pair; - Fore : out Color_Number; - Back : out Color_Number) - is - type C_Short_Access is access all C_Short; - function Paircontent (Pair : C_Short; - Fp : C_Short_Access; - Bp : C_Short_Access) return C_Int; - pragma Import (C, Paircontent, "pair_content"); - - F, B : aliased C_Short; - begin - if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then - raise Curses_Exception; - else - Fore := Color_Number (F); - Back := Color_Number (B); - end if; - end Pair_Content; - - function Has_Colors return Boolean - is - function Hascolors return Curses_Bool; - pragma Import (C, Hascolors, "has_colors"); - begin - if Hascolors = Curses_Bool_False then - return False; - else - return True; - end if; - end Has_Colors; - - procedure Init_Color (Color : Color_Number; - Red : RGB_Value; - Green : RGB_Value; - Blue : RGB_Value) - is - function Initcolor (Col : C_Short; - Red : C_Short; - Green : C_Short; - Blue : C_Short) return C_Int; - pragma Import (C, Initcolor, "init_color"); - begin - if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green), - C_Short (Blue)) = Curses_Err then - raise Curses_Exception; - end if; - end Init_Color; - - function Can_Change_Color return Boolean - is - function Canchangecolor return Curses_Bool; - pragma Import (C, Canchangecolor, "can_change_color"); - begin - if Canchangecolor = Curses_Bool_False then - return False; - else - return True; - end if; - end Can_Change_Color; - - procedure Color_Content (Color : Color_Number; - Red : out RGB_Value; - Green : out RGB_Value; - Blue : out RGB_Value) - is - type C_Short_Access is access all C_Short; - - function Colorcontent (Color : C_Short; R, G, B : C_Short_Access) - return C_Int; - pragma Import (C, Colorcontent, "color_content"); - - R, G, B : aliased C_Short; - begin - if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) = - Curses_Err then - raise Curses_Exception; - else - Red := RGB_Value (R); - Green := RGB_Value (G); - Blue := RGB_Value (B); - end if; - end Color_Content; - ------------------------------------------------------------------------------- - procedure Save_Curses_Mode (Mode : Curses_Mode) - is - function Def_Prog_Mode return C_Int; - pragma Import (C, Def_Prog_Mode, "def_prog_mode"); - function Def_Shell_Mode return C_Int; - pragma Import (C, Def_Shell_Mode, "def_shell_mode"); - - Err : C_Int; - begin - case Mode is - when Curses => Err := Def_Prog_Mode; - when Shell => Err := Def_Shell_Mode; - end case; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Save_Curses_Mode; - - procedure Reset_Curses_Mode (Mode : Curses_Mode) - is - function Reset_Prog_Mode return C_Int; - pragma Import (C, Reset_Prog_Mode, "reset_prog_mode"); - function Reset_Shell_Mode return C_Int; - pragma Import (C, Reset_Shell_Mode, "reset_shell_mode"); - - Err : C_Int; - begin - case Mode is - when Curses => Err := Reset_Prog_Mode; - when Shell => Err := Reset_Shell_Mode; - end case; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Reset_Curses_Mode; - - procedure Save_Terminal_State - is - function Savetty return C_Int; - pragma Import (C, Savetty, "savetty"); - begin - if Savetty = Curses_Err then - raise Curses_Exception; - end if; - end Save_Terminal_State; - - procedure Reset_Terminal_State - is - function Resetty return C_Int; - pragma Import (C, Resetty, "resetty"); - begin - if Resetty = Curses_Err then - raise Curses_Exception; - end if; - end Reset_Terminal_State; - - procedure Rip_Off_Lines (Lines : Integer; - Proc : Stdscr_Init_Proc) - is - function Ripoffline (Lines : C_Int; - Proc : Stdscr_Init_Proc) return C_Int; - pragma Import (C, Ripoffline, "_nc_ripoffline"); - begin - if Ripoffline (C_Int (Lines), Proc) = Curses_Err then - raise Curses_Exception; - end if; - end Rip_Off_Lines; - - procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility) - is - function Curs_Set (Curs : C_Int) return C_Int; - pragma Import (C, Curs_Set, "curs_set"); - - Res : C_Int; - begin - Res := Curs_Set (Cursor_Visibility'Pos (Visibility)); - if Res /= Curses_Err then - Visibility := Cursor_Visibility'Val (Res); - end if; - end Set_Cursor_Visibility; - - procedure Nap_Milli_Seconds (Ms : Natural) - is - function Napms (Ms : C_Int) return C_Int; - pragma Import (C, Napms, "napms"); - begin - if Napms (C_Int (Ms)) = Curses_Err then - raise Curses_Exception; - end if; - end Nap_Milli_Seconds; ------------------------------------------------------------------------------- -include(`Public_Variables') ------------------------------------------------------------------------------- - procedure Transform_Coordinates - (W : Window := Standard_Window; - Line : in out Line_Position; - Column : in out Column_Position; - Dir : Transform_Direction := From_Screen) - is - type Int_Access is access all C_Int; - function Transform (W : Window; - Y, X : Int_Access; - Dir : Curses_Bool) return C_Int; - pragma Import (C, Transform, "wmouse_trafo"); - - X : aliased C_Int := C_Int (Column); - Y : aliased C_Int := C_Int (Line); - D : Curses_Bool := Curses_Bool_False; - R : C_Int; - begin - if Dir = To_Screen then - D := 1; - end if; - R := Transform (W, Y'Access, X'Access, D); - if R = Curses_False then - raise Curses_Exception; - else - Line := Line_Position (Y); - Column := Column_Position (X); - end if; - end Transform_Coordinates; ------------------------------------------------------------------------------- - procedure Use_Default_Colors is - function C_Use_Default_Colors return C_Int; - pragma Import (C, C_Use_Default_Colors, "use_default_colors"); - Err : constant C_Int := C_Use_Default_Colors; - begin - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Use_Default_Colors; - - procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; - Back : Color_Number := Default_Color) - is - function C_Assume_Default_Colors (Fore : C_Int; - Back : C_Int) return C_Int; - pragma Import (C, C_Assume_Default_Colors, "assume_default_colors"); - - Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore), - C_Int (Back)); - begin - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Assume_Default_Colors; ------------------------------------------------------------------------------- - function Curses_Version return String - is - function curses_versionC return chars_ptr; - pragma Import (C, curses_versionC, "curses_version"); - Result : constant chars_ptr := curses_versionC; - begin - return Fill_String (Result); - end Curses_Version; ------------------------------------------------------------------------------- - procedure Curses_Free_All is - procedure curses_freeall; - pragma Import (C, curses_freeall, "_nc_freeall"); - begin - -- Use this only for testing: you cannot use curses after calling it, - -- so it has to be the "last" thing done before exiting the program. - -- This will not really free ALL of memory used by curses. That is - -- because it cannot free the memory used for stdout's setbuf. The - -- _nc_free_and_exit() procedure can do that, but it can be invoked - -- safely only from C - and again, that only as the "last" thing done - -- before exiting the program. - curses_freeall; - end Curses_Free_All; ------------------------------------------------------------------------------- - function Use_Extended_Names (Enable : Boolean) return Boolean - is - function use_extended_namesC (e : Curses_Bool) return C_Int; - pragma Import (C, use_extended_namesC, "use_extended_names"); - - Res : constant C_Int := - use_extended_namesC (Curses_Bool (Boolean'Pos (Enable))); - begin - if Res = C_Int (Curses_Bool_False) then - return False; - else - return True; - end if; - end Use_Extended_Names; ------------------------------------------------------------------------------- - procedure Screen_Dump_To_File (Filename : String) - is - function scr_dump (f : char_array) return C_Int; - pragma Import (C, scr_dump, "scr_dump"); - Txt : char_array (0 .. Filename'Length); - Length : size_t; - begin - To_C (Filename, Txt, Length); - if Curses_Err = scr_dump (Txt) then - raise Curses_Exception; - end if; - end Screen_Dump_To_File; - - procedure Screen_Restore_From_File (Filename : String) - is - function scr_restore (f : char_array) return C_Int; - pragma Import (C, scr_restore, "scr_restore"); - Txt : char_array (0 .. Filename'Length); - Length : size_t; - begin - To_C (Filename, Txt, Length); - if Curses_Err = scr_restore (Txt) then - raise Curses_Exception; - end if; - end Screen_Restore_From_File; - - procedure Screen_Init_From_File (Filename : String) - is - function scr_init (f : char_array) return C_Int; - pragma Import (C, scr_init, "scr_init"); - Txt : char_array (0 .. Filename'Length); - Length : size_t; - begin - To_C (Filename, Txt, Length); - if Curses_Err = scr_init (Txt) then - raise Curses_Exception; - end if; - end Screen_Init_From_File; - - procedure Screen_Set_File (Filename : String) - is - function scr_set (f : char_array) return C_Int; - pragma Import (C, scr_set, "scr_set"); - Txt : char_array (0 .. Filename'Length); - Length : size_t; - begin - To_C (Filename, Txt, Length); - if Curses_Err = scr_set (Txt) then - raise Curses_Exception; - end if; - end Screen_Set_File; ------------------------------------------------------------------------------- - procedure Resize (Win : Window := Standard_Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count) is - function wresize (win : Window; - lines : C_Int; - columns : C_Int) return C_Int; - pragma Import (C, wresize); - begin - if wresize (Win, - C_Int (Number_Of_Lines), - C_Int (Number_Of_Columns)) = Curses_Err then - raise Curses_Exception; - end if; - end Resize; ------------------------------------------------------------------------------- - -end Terminal_Interface.Curses; diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 deleted file mode 100644 index 28cc9d19877..00000000000 --- a/Ada95/gen/terminal_interface-curses.ads.m4 +++ /dev/null @@ -1,1559 +0,0 @@ --- -*- ada -*- -define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl -include(M4MACRO)------------------------------------------------------------------------------ --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.44 $ --- $Date: 2011/03/19 23:05:56 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -include(`Base_Defs') -with System.Storage_Elements; -with Interfaces.C; -- We need this for some assertions. - -package Terminal_Interface.Curses is - pragma Preelaborate (Terminal_Interface.Curses); -include(`Linker_Options') -include(`Version_Info') - type Window is private; - Null_Window : constant Window; - - type Line_Position is new Integer; -- line coordinate - type Column_Position is new Integer; -- column coordinate - - subtype Line_Count is Line_Position range 1 .. Line_Position'Last; - -- Type to count lines. We do not allow null windows, so must be positive - subtype Column_Count is Column_Position range 1 .. Column_Position'Last; - -- Type to count columns. We do not allow null windows, so must be positive - - type Key_Code is new Integer; - -- That is anything including real characters, special keys and logical - -- request codes. - - -- FIXME: The "-1" should be Curses_Err - subtype Real_Key_Code is Key_Code range -1 .. M4_KEY_MAX; - -- This are the codes that potentially represent a real keystroke. - -- Not all codes may be possible on a specific terminal. To check the - -- availability of a special key, the Has_Key function is provided. - - subtype Special_Key_Code is Real_Key_Code - range M4_SPECIAL_FIRST .. Real_Key_Code'Last; - -- Type for a function- or special key number - - subtype Normal_Key_Code is Real_Key_Code range - Character'Pos (Character'First) .. Character'Pos (Character'Last); - -- This are the codes for regular (incl. non-graphical) characters. - - -- Constants for function- and special keys - -- - Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST; -include(`Key_Definitions') - Key_Max : constant Special_Key_Code - := Special_Key_Code'Last; - - subtype User_Key_Code is Key_Code - range (Key_Max + 129) .. Key_Code'Last; - -- This is reserved for user defined key codes. The range between Key_Max - -- and the first user code is reserved for subsystems like menu and forms. - - -- For those who like to use the original key names we produce them were - -- they differ from the original. Please note that they may differ in - -- lower/upper case. -include(`Old_Keys')dnl - ------------------------------------------------------------------------------- - - type Color_Number is range -1 .. Integer (Interfaces.C.short'Last); - for Color_Number'Size use Interfaces.C.short'Size; - -- (n)curses uses a short for the color index - -- The model is, that a Color_Number is an index into an array of - -- (potentially) definable colors. Some of those indices are - -- predefined (see below), although they may not really exist. - -include(`Color_Defs') - type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last); - for RGB_Value'Size use Interfaces.C.short'Size; - -- Some system may allow to redefine a color by setting RGB values. - - type Color_Pair is range 0 .. 255; - for Color_Pair'Size use 8; - subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255; - -- (n)curses reserves 1 Byte for the color-pair number. Color Pair 0 - -- is fixed (Black & White). A color pair is simply a combination of - -- two colors described by Color_Numbers, one for the foreground and - -- the other for the background - -include(`Character_Attribute_Set_Rep') - -- (n)curses uses all but the lowest 16 Bits for Attributes. - - Normal_Video : constant Character_Attribute_Set := (others => False); - - type Attributed_Character is - record - Attr : Character_Attribute_Set; - Color : Color_Pair; - Ch : Character; - end record; - pragma Convention (C, Attributed_Character); - -- This is the counterpart for the chtype in C. - -include(`AC_Rep') - Default_Character : constant Attributed_Character - := (Ch => Character'First, - Color => Color_Pair'First, - Attr => (others => False)); -- preelaboratable Normal_Video - - type Attributed_String is array (Positive range <>) of Attributed_Character; - pragma Pack (Attributed_String); - -- In this binding we allow strings of attributed characters. - - ------------------ - -- Exceptions -- - ------------------ - Curses_Exception : exception; - Wrong_Curses_Version : exception; - - -- Those exceptions are raised by the ETI (Extended Terminal Interface) - -- subpackets for Menu and Forms handling. - -- - Eti_System_Error : exception; - Eti_Bad_Argument : exception; - Eti_Posted : exception; - Eti_Connected : exception; - Eti_Bad_State : exception; - Eti_No_Room : exception; - Eti_Not_Posted : exception; - Eti_Unknown_Command : exception; - Eti_No_Match : exception; - Eti_Not_Selectable : exception; - Eti_Not_Connected : exception; - Eti_Request_Denied : exception; - Eti_Invalid_Field : exception; - Eti_Current : exception; - - -------------------------------------------------------------------------- - -- External C variables - -- Conceptually even in C this are kind of constants, but they are - -- initialized and sometimes changed by the library routines at runtime - -- depending on the type of terminal. I believe the best way to model - -- this is to use functions. - -------------------------------------------------------------------------- - - function Lines return Line_Count; - pragma Inline (Lines); - - function Columns return Column_Count; - pragma Inline (Columns); - - function Tab_Size return Natural; - pragma Inline (Tab_Size); - - function Number_Of_Colors return Natural; - pragma Inline (Number_Of_Colors); - - function Number_Of_Color_Pairs return Natural; - pragma Inline (Number_Of_Color_Pairs); - -include(`ACS_Map')dnl - - -- MANPAGE(`curs_initscr.3x') - -- | Not implemented: newterm, set_term, delscreen - - -- ANCHOR(`stdscr',`Standard_Window') - function Standard_Window return Window; - -- AKA - pragma Inline (Standard_Window); - - -- ANCHOR(`curscr',`Current_Window') - function Current_Window return Window; - -- AKA - pragma Inline (Current_Window); - - -- ANCHOR(`initscr()',`Init_Screen') - procedure Init_Screen; - - -- ANCHOR(`initscr()',`Init_Windows') - procedure Init_Windows renames Init_Screen; - -- AKA - pragma Inline (Init_Screen); - -- pragma Inline (Init_Windows); - - -- ANCHOR(`endwin()',`End_Windows') - procedure End_Windows; - -- AKA - procedure End_Screen renames End_Windows; - pragma Inline (End_Windows); - -- pragma Inline (End_Screen); - - -- ANCHOR(`isendwin()',`Is_End_Window') - function Is_End_Window return Boolean; - -- AKA - pragma Inline (Is_End_Window); - - -- MANPAGE(`curs_move.3x') - - -- ANCHOR(`wmove()',`Move_Cursor') - procedure Move_Cursor (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position); - -- AKA - -- ALIAS(`move()') - pragma Inline (Move_Cursor); - - -- MANPAGE(`curs_addch.3x') - - -- ANCHOR(`waddch()',`Add') - procedure Add (Win : Window := Standard_Window; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`addch()') - - procedure Add (Win : Window := Standard_Window; - Ch : Character); - -- Add a single character at the current logical cursor position to - -- the window. Use the current windows attributes. - - -- ANCHOR(`mvwaddch()',`Add') - procedure Add - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`mvaddch()') - - procedure Add - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Ch : Character); - -- Move to the position and add a single character into the window - -- There are more Add routines, so the Inline pragma follows later - - -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo') - procedure Add_With_Immediate_Echo - (Win : Window := Standard_Window; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`echochar()') - - procedure Add_With_Immediate_Echo - (Win : Window := Standard_Window; - Ch : Character); - -- Add a character and do an immediate refresh of the screen. - pragma Inline (Add_With_Immediate_Echo); - - -- MANPAGE(`curs_window.3x') - -- Not Implemented: wcursyncup - - -- ANCHOR(`newwin()',`Create') - function Create - (Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window; - -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns - -- the C version lets them be 0, see the man page. - -- AKA - pragma Inline (Create); - - function New_Window - (Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window - renames Create; - -- pragma Inline (New_Window); - - -- ANCHOR(`delwin()',`Delete') - procedure Delete (Win : in out Window); - -- AKA - -- Reset Win to Null_Window - pragma Inline (Delete); - - -- ANCHOR(`subwin()',`Sub_Window') - function Sub_Window - (Win : Window := Standard_Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window; - -- AKA - pragma Inline (Sub_Window); - - -- ANCHOR(`derwin()',`Derived_Window') - function Derived_Window - (Win : Window := Standard_Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window; - -- AKA - pragma Inline (Derived_Window); - - -- ANCHOR(`dupwin()',`Duplicate') - function Duplicate (Win : Window) return Window; - -- AKA - pragma Inline (Duplicate); - - -- ANCHOR(`mvwin()',`Move_Window') - procedure Move_Window (Win : Window; - Line : Line_Position; - Column : Column_Position); - -- AKA - pragma Inline (Move_Window); - - -- ANCHOR(`mvderwin()',`Move_Derived_Window') - procedure Move_Derived_Window (Win : Window; - Line : Line_Position; - Column : Column_Position); - -- AKA - pragma Inline (Move_Derived_Window); - - -- ANCHOR(`wsyncup()',`Synchronize_Upwards') - procedure Synchronize_Upwards (Win : Window); - -- AKA - pragma Import (C, Synchronize_Upwards, "wsyncup"); - - -- ANCHOR(`wsyncdown()',`Synchronize_Downwards') - procedure Synchronize_Downwards (Win : Window); - -- AKA - pragma Import (C, Synchronize_Downwards, "wsyncdown"); - - -- ANCHOR(`syncok()',`Set_Synch_Mode') - procedure Set_Synch_Mode (Win : Window := Standard_Window; - Mode : Boolean := False); - -- AKA - pragma Inline (Set_Synch_Mode); - - -- MANPAGE(`curs_addstr.3x') - - -- ANCHOR(`waddnstr()',`Add') - procedure Add (Win : Window := Standard_Window; - Str : String; - Len : Integer := -1); - -- AKA - -- ALIAS(`waddstr()') - -- ALIAS(`addnstr()') - -- ALIAS(`addstr()') - - -- ANCHOR(`mvwaddnstr()',`Add') - procedure Add (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : String; - Len : Integer := -1); - -- AKA - -- ALIAS(`mvwaddstr()') - -- ALIAS(`mvaddnstr()') - -- ALIAS(`mvaddstr()') - - -- MANPAGE(`curs_addchstr.3x') - - -- ANCHOR(`waddchnstr()',`Add') - procedure Add (Win : Window := Standard_Window; - Str : Attributed_String; - Len : Integer := -1); - -- AKA - -- ALIAS(`waddchstr()') - -- ALIAS(`addchnstr()') - -- ALIAS(`addchstr()') - - -- ANCHOR(`mvwaddchnstr()',`Add') - procedure Add (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : Attributed_String; - Len : Integer := -1); - -- AKA - -- ALIAS(`mvwaddchstr()') - -- ALIAS(`mvaddchnstr()') - -- ALIAS(`mvaddchstr()') - pragma Inline (Add); - - -- MANPAGE(`curs_border.3x') - -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline - -- | use Move_Cursor then Horizontal_Line or Vertical_Line - - -- ANCHOR(`wborder()',`Border') - procedure Border - (Win : Window := Standard_Window; - Left_Side_Symbol : Attributed_Character := Default_Character; - Right_Side_Symbol : Attributed_Character := Default_Character; - Top_Side_Symbol : Attributed_Character := Default_Character; - Bottom_Side_Symbol : Attributed_Character := Default_Character; - Upper_Left_Corner_Symbol : Attributed_Character := Default_Character; - Upper_Right_Corner_Symbol : Attributed_Character := Default_Character; - Lower_Left_Corner_Symbol : Attributed_Character := Default_Character; - Lower_Right_Corner_Symbol : Attributed_Character := Default_Character - ); - -- AKA - -- ALIAS(`border()') - pragma Inline (Border); - - -- ANCHOR(`box()',`Box') - procedure Box - (Win : Window := Standard_Window; - Vertical_Symbol : Attributed_Character := Default_Character; - Horizontal_Symbol : Attributed_Character := Default_Character); - -- AKA - pragma Inline (Box); - - -- ANCHOR(`whline()',`Horizontal_Line') - procedure Horizontal_Line - (Win : Window := Standard_Window; - Line_Size : Natural; - Line_Symbol : Attributed_Character := Default_Character); - -- AKA - -- ALIAS(`hline()') - pragma Inline (Horizontal_Line); - - -- ANCHOR(`wvline()',`Vertical_Line') - procedure Vertical_Line - (Win : Window := Standard_Window; - Line_Size : Natural; - Line_Symbol : Attributed_Character := Default_Character); - -- AKA - -- ALIAS(`vline()') - pragma Inline (Vertical_Line); - - -- MANPAGE(`curs_getch.3x') - -- Not implemented: mvgetch, mvwgetch - - -- ANCHOR(`wgetch()',`Get_Keystroke') - function Get_Keystroke (Win : Window := Standard_Window) - return Real_Key_Code; - -- AKA - -- ALIAS(`getch()') - -- Get a character from the keyboard and echo it - if enabled - to the - -- window. - -- If for any reason (i.e. a timeout) we could not get a character the - -- returned keycode is Key_None. - pragma Inline (Get_Keystroke); - - -- ANCHOR(`ungetch()',`Undo_Keystroke') - procedure Undo_Keystroke (Key : Real_Key_Code); - -- AKA - pragma Inline (Undo_Keystroke); - - -- ANCHOR(`has_key()',`Has_Key') - function Has_Key (Key : Special_Key_Code) return Boolean; - -- AKA - pragma Inline (Has_Key); - - -- | - -- | Some helper functions - -- | - function Is_Function_Key (Key : Special_Key_Code) return Boolean; - -- Return True if the Key is a function key (i.e. one of F0 .. F63) - pragma Inline (Is_Function_Key); - - subtype Function_Key_Number is Integer range 0 .. 63; - -- (n)curses allows for 64 function keys. - - function Function_Key (Key : Real_Key_Code) return Function_Key_Number; - -- Return the number of the function key. If the code is not a - -- function key, a CONSTRAINT_ERROR will be raised. - pragma Inline (Function_Key); - - function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code; - -- Return the key code for a given function-key number. - pragma Inline (Function_Key_Code); - - -- MANPAGE(`curs_attr.3x') - -- | Not implemented attr_off, wattr_off, - -- | attr_on, wattr_on, attr_set, wattr_set - - -- PAIR_NUMBER - -- PAIR_NUMBER(c) is the same as c.Color - - -- ANCHOR(`standout()',`Standout') - procedure Standout (Win : Window := Standard_Window; - On : Boolean := True); - -- ALIAS(`wstandout()') - -- ALIAS(`wstandend()') - - -- ANCHOR(`wattron()',`Switch_Character_Attribute') - procedure Switch_Character_Attribute - (Win : Window := Standard_Window; - Attr : Character_Attribute_Set := Normal_Video; - On : Boolean := True); -- if False we switch Off. - -- Switches those Attributes set to true in the list. - -- AKA - -- ALIAS(`wattroff()') - -- ALIAS(`attron()') - -- ALIAS(`attroff()') - - -- ANCHOR(`wattrset()',`Set_Character_Attributes') - procedure Set_Character_Attributes - (Win : Window := Standard_Window; - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - -- ALIAS(`attrset()') - pragma Inline (Set_Character_Attributes); - - -- ANCHOR(`wattr_get()',`Get_Character_Attributes') - function Get_Character_Attribute - (Win : Window := Standard_Window) return Character_Attribute_Set; - -- AKA - -- ALIAS(`attr_get()') - - -- ANCHOR(`wattr_get()',`Get_Character_Attribute') - function Get_Character_Attribute - (Win : Window := Standard_Window) return Color_Pair; - -- AKA - pragma Inline (Get_Character_Attribute); - - -- ANCHOR(`wcolor_set()',`Set_Color') - procedure Set_Color (Win : Window := Standard_Window; - Pair : Color_Pair); - -- AKA - -- ALIAS(`color_set()') - pragma Inline (Set_Color); - - -- ANCHOR(`wchgat()',`Change_Attributes') - procedure Change_Attributes - (Win : Window := Standard_Window; - Count : Integer := -1; - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - -- ALIAS(`chgat()') - - -- ANCHOR(`mvwchgat()',`Change_Attributes') - procedure Change_Attributes - (Win : Window := Standard_Window; - Line : Line_Position := Line_Position'First; - Column : Column_Position := Column_Position'First; - Count : Integer := -1; - Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - -- ALIAS(`mvchgat()') - pragma Inline (Change_Attributes); - - -- MANPAGE(`curs_beep.3x') - - -- ANCHOR(`beep()',`Beep') - procedure Beep; - -- AKA - pragma Inline (Beep); - - -- ANCHOR(`flash()',`Flash_Screen') - procedure Flash_Screen; - -- AKA - pragma Inline (Flash_Screen); - - -- MANPAGE(`curs_inopts.3x') - - -- | Not implemented : typeahead - -- - -- ANCHOR(`cbreak()',`Set_Cbreak_Mode') - procedure Set_Cbreak_Mode (SwitchOn : Boolean := True); - -- AKA - -- ALIAS(`nocbreak()') - pragma Inline (Set_Cbreak_Mode); - - -- ANCHOR(`raw()',`Set_Raw_Mode') - procedure Set_Raw_Mode (SwitchOn : Boolean := True); - -- AKA - -- ALIAS(`noraw()') - pragma Inline (Set_Raw_Mode); - - -- ANCHOR(`echo()',`Set_Echo_Mode') - procedure Set_Echo_Mode (SwitchOn : Boolean := True); - -- AKA - -- ALIAS(`noecho()') - pragma Inline (Set_Echo_Mode); - - -- ANCHOR(`meta()',`Set_Meta_Mode') - procedure Set_Meta_Mode (Win : Window := Standard_Window; - SwitchOn : Boolean := True); - -- AKA - pragma Inline (Set_Meta_Mode); - - -- ANCHOR(`keypad()',`Set_KeyPad_Mode') - procedure Set_KeyPad_Mode (Win : Window := Standard_Window; - SwitchOn : Boolean := True); - -- AKA - pragma Inline (Set_KeyPad_Mode); - - function Get_KeyPad_Mode (Win : Window := Standard_Window) - return Boolean; - -- This has no pendant in C. There you've to look into the WINDOWS - -- structure to get the value. Bad practice, not repeated in Ada. - - type Half_Delay_Amount is range 1 .. 255; - - -- ANCHOR(`halfdelay()',`Half_Delay') - procedure Half_Delay (Amount : Half_Delay_Amount); - -- AKA - pragma Inline (Half_Delay); - - -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode') - procedure Set_Flush_On_Interrupt_Mode - (Win : Window := Standard_Window; - Mode : Boolean := True); - -- AKA - pragma Inline (Set_Flush_On_Interrupt_Mode); - - -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode') - procedure Set_Queue_Interrupt_Mode - (Win : Window := Standard_Window; - Flush : Boolean := True); - -- AKA - -- ALIAS(`noqiflush()') - pragma Inline (Set_Queue_Interrupt_Mode); - - -- ANCHOR(`nodelay()',`Set_NoDelay_Mode') - procedure Set_NoDelay_Mode - (Win : Window := Standard_Window; - Mode : Boolean := False); - -- AKA - pragma Inline (Set_NoDelay_Mode); - - type Timeout_Mode is (Blocking, Non_Blocking, Delayed); - - -- ANCHOR(`wtimeout()',`Set_Timeout_Mode') - procedure Set_Timeout_Mode (Win : Window := Standard_Window; - Mode : Timeout_Mode; - Amount : Natural); -- in Milliseconds - -- AKA - -- ALIAS(`timeout()') - -- Instead of overloading the semantic of the sign of amount, we - -- introduce the Timeout_Mode parameter. This should improve - -- readability. For Blocking and Non_Blocking, the Amount is not - -- evaluated. - -- We do not inline this procedure. - - -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode') - procedure Set_Escape_Timer_Mode - (Win : Window := Standard_Window; - Timer_Off : Boolean := False); - -- AKA - pragma Inline (Set_Escape_Timer_Mode); - - -- MANPAGE(`curs_outopts.3x') - - -- ANCHOR(`nl()',`Set_NL_Mode') - procedure Set_NL_Mode (SwitchOn : Boolean := True); - -- AKA - -- ALIAS(`nonl()') - pragma Inline (Set_NL_Mode); - - -- ANCHOR(`clearok()',`Clear_On_Next_Update') - procedure Clear_On_Next_Update - (Win : Window := Standard_Window; - Do_Clear : Boolean := True); - -- AKA - pragma Inline (Clear_On_Next_Update); - - -- ANCHOR(`idlok()',`Use_Insert_Delete_Line') - procedure Use_Insert_Delete_Line - (Win : Window := Standard_Window; - Do_Idl : Boolean := True); - -- AKA - pragma Inline (Use_Insert_Delete_Line); - - -- ANCHOR(`idcok()',`Use_Insert_Delete_Character') - procedure Use_Insert_Delete_Character - (Win : Window := Standard_Window; - Do_Idc : Boolean := True); - -- AKA - pragma Inline (Use_Insert_Delete_Character); - - -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update') - procedure Leave_Cursor_After_Update - (Win : Window := Standard_Window; - Do_Leave : Boolean := True); - -- AKA - pragma Inline (Leave_Cursor_After_Update); - - -- ANCHOR(`immedok()',`Immediate_Update_Mode') - procedure Immediate_Update_Mode - (Win : Window := Standard_Window; - Mode : Boolean := False); - -- AKA - pragma Inline (Immediate_Update_Mode); - - -- ANCHOR(`scrollok()',`Allow_Scrolling') - procedure Allow_Scrolling - (Win : Window := Standard_Window; - Mode : Boolean := False); - -- AKA - pragma Inline (Allow_Scrolling); - - function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean; - -- There is no such function in the C interface. - pragma Inline (Scrolling_Allowed); - - -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region') - procedure Set_Scroll_Region - (Win : Window := Standard_Window; - Top_Line : Line_Position; - Bottom_Line : Line_Position); - -- AKA - -- ALIAS(`setscrreg()') - pragma Inline (Set_Scroll_Region); - - -- MANPAGE(`curs_refresh.3x') - - -- ANCHOR(`doupdate()',`Update_Screen') - procedure Update_Screen; - -- AKA - pragma Inline (Update_Screen); - - -- ANCHOR(`wrefresh()',`Refresh') - procedure Refresh (Win : Window := Standard_Window); - -- AKA - -- There is an overloaded Refresh for Pads. - -- The Inline pragma appears there - -- ALIAS(`refresh()') - - -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update') - procedure Refresh_Without_Update - (Win : Window := Standard_Window); - -- AKA - -- There is an overloaded Refresh_Without_Update for Pads. - -- The Inline pragma appears there - - -- ANCHOR(`redrawwin()',`Redraw') - procedure Redraw (Win : Window := Standard_Window); - -- AKA - - -- ANCHOR(`wredrawln()',`Redraw') - procedure Redraw (Win : Window := Standard_Window; - Begin_Line : Line_Position; - Line_Count : Positive); - -- AKA - pragma Inline (Redraw); - - -- MANPAGE(`curs_clear.3x') - - -- ANCHOR(`werase()',`Erase') - procedure Erase (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`erase()') - pragma Inline (Erase); - - -- ANCHOR(`wclear()',`Clear') - procedure Clear - (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`clear()') - pragma Inline (Clear); - - -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen') - procedure Clear_To_End_Of_Screen - (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`clrtobot()') - pragma Inline (Clear_To_End_Of_Screen); - - -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line') - procedure Clear_To_End_Of_Line - (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`clrtoeol()') - pragma Inline (Clear_To_End_Of_Line); - - -- MANPAGE(`curs_bkgd.3x') - - -- ANCHOR(`wbkgdset()',`Set_Background') - -- TODO: we could have Set_Background(Window; Character_Attribute_Set) - -- because in C it is common to see bkgdset(A_BOLD) or - -- bkgdset(COLOR_PAIR(n)) - procedure Set_Background - (Win : Window := Standard_Window; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`bkgdset()') - pragma Inline (Set_Background); - - -- ANCHOR(`wbkgd()',`Change_Background') - procedure Change_Background - (Win : Window := Standard_Window; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`bkgd()') - pragma Inline (Change_Background); - - -- ANCHOR(`wbkgdget()',`Get_Background') - -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough. - function Get_Background (Win : Window := Standard_Window) - return Attributed_Character; - -- AKA - -- ALIAS(`bkgdget()') - pragma Inline (Get_Background); - - -- MANPAGE(`curs_touch.3x') - - -- ANCHOR(`untouchwin()',`Untouch') - procedure Untouch (Win : Window := Standard_Window); - -- AKA - pragma Inline (Untouch); - - -- ANCHOR(`touchwin()',`Touch') - procedure Touch (Win : Window := Standard_Window); - -- AKA - - -- ANCHOR(`touchline()',`Touch') - procedure Touch (Win : Window := Standard_Window; - Start : Line_Position; - Count : Positive); - -- AKA - pragma Inline (Touch); - - -- ANCHOR(`wtouchln()',`Change_Line_Status') - procedure Change_Lines_Status (Win : Window := Standard_Window; - Start : Line_Position; - Count : Positive; - State : Boolean); - -- AKA - pragma Inline (Change_Lines_Status); - - -- ANCHOR(`is_linetouched()',`Is_Touched') - function Is_Touched (Win : Window := Standard_Window; - Line : Line_Position) return Boolean; - -- AKA - - -- ANCHOR(`is_wintouched()',`Is_Touched') - function Is_Touched (Win : Window := Standard_Window) return Boolean; - -- AKA - pragma Inline (Is_Touched); - - -- MANPAGE(`curs_overlay.3x') - - -- ANCHOR(`copywin()',`Copy') - procedure Copy - (Source_Window : Window; - Destination_Window : Window; - Source_Top_Row : Line_Position; - Source_Left_Column : Column_Position; - Destination_Top_Row : Line_Position; - Destination_Left_Column : Column_Position; - Destination_Bottom_Row : Line_Position; - Destination_Right_Column : Column_Position; - Non_Destructive_Mode : Boolean := True); - -- AKA - pragma Inline (Copy); - - -- ANCHOR(`overwrite()',`Overwrite') - procedure Overwrite (Source_Window : Window; - Destination_Window : Window); - -- AKA - pragma Inline (Overwrite); - - -- ANCHOR(`overlay()',`Overlay') - procedure Overlay (Source_Window : Window; - Destination_Window : Window); - -- AKA - pragma Inline (Overlay); - - -- MANPAGE(`curs_deleteln.3x') - - -- ANCHOR(`winsdelln()',`Insert_Delete_Lines') - procedure Insert_Delete_Lines - (Win : Window := Standard_Window; - Lines : Integer := 1); -- default is to insert one line above - -- AKA - -- ALIAS(`insdelln()') - pragma Inline (Insert_Delete_Lines); - - -- ANCHOR(`wdeleteln()',`Delete_Line') - procedure Delete_Line (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`deleteln()') - pragma Inline (Delete_Line); - - -- ANCHOR(`winsertln()',`Insert_Line') - procedure Insert_Line (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`insertln()') - pragma Inline (Insert_Line); - - -- MANPAGE(`curs_getyx.3x') - - -- ANCHOR(`getmaxyx()',`Get_Size') - procedure Get_Size - (Win : Window := Standard_Window; - Number_Of_Lines : out Line_Count; - Number_Of_Columns : out Column_Count); - -- AKA - pragma Inline (Get_Size); - - -- ANCHOR(`getbegyx()',`Get_Window_Position') - procedure Get_Window_Position - (Win : Window := Standard_Window; - Top_Left_Line : out Line_Position; - Top_Left_Column : out Column_Position); - -- AKA - pragma Inline (Get_Window_Position); - - -- ANCHOR(`getyx()',`Get_Cursor_Position') - procedure Get_Cursor_Position - (Win : Window := Standard_Window; - Line : out Line_Position; - Column : out Column_Position); - -- AKA - pragma Inline (Get_Cursor_Position); - - -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent') - procedure Get_Origin_Relative_To_Parent - (Win : Window; - Top_Left_Line : out Line_Position; - Top_Left_Column : out Column_Position; - Is_Not_A_Subwindow : out Boolean); - -- AKA - -- Instead of placing -1 in the coordinates as return, we use a Boolean - -- to return the info that the window has no parent. - pragma Inline (Get_Origin_Relative_To_Parent); - - -- MANPAGE(`curs_pad.3x') - - -- ANCHOR(`newpad()',`New_Pad') - function New_Pad (Lines : Line_Count; - Columns : Column_Count) return Window; - -- AKA - pragma Inline (New_Pad); - - -- ANCHOR(`subpad()',`Sub_Pad') - function Sub_Pad - (Pad : Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count; - First_Line_Position : Line_Position; - First_Column_Position : Column_Position) return Window; - -- AKA - pragma Inline (Sub_Pad); - - -- ANCHOR(`prefresh()',`Refresh') - procedure Refresh - (Pad : Window; - Source_Top_Row : Line_Position; - Source_Left_Column : Column_Position; - Destination_Top_Row : Line_Position; - Destination_Left_Column : Column_Position; - Destination_Bottom_Row : Line_Position; - Destination_Right_Column : Column_Position); - -- AKA - pragma Inline (Refresh); - - -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update') - procedure Refresh_Without_Update - (Pad : Window; - Source_Top_Row : Line_Position; - Source_Left_Column : Column_Position; - Destination_Top_Row : Line_Position; - Destination_Left_Column : Column_Position; - Destination_Bottom_Row : Line_Position; - Destination_Right_Column : Column_Position); - -- AKA - pragma Inline (Refresh_Without_Update); - - -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It') - procedure Add_Character_To_Pad_And_Echo_It - (Pad : Window; - Ch : Attributed_Character); - -- AKA - - procedure Add_Character_To_Pad_And_Echo_It - (Pad : Window; - Ch : Character); - pragma Inline (Add_Character_To_Pad_And_Echo_It); - - -- MANPAGE(`curs_scroll.3x') - - -- ANCHOR(`wscrl()',`Scroll') - procedure Scroll (Win : Window := Standard_Window; - Amount : Integer := 1); - -- AKA - -- ALIAS(`scroll()') - -- ALIAS(`scrl()') - pragma Inline (Scroll); - - -- MANPAGE(`curs_delch.3x') - - -- ANCHOR(`wdelch()',`Delete_Character') - procedure Delete_Character (Win : Window := Standard_Window); - -- AKA - -- ALIAS(`delch()') - - -- ANCHOR(`mvwdelch()',`Delete_Character') - procedure Delete_Character - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position); - -- AKA - -- ALIAS(`mvdelch()') - pragma Inline (Delete_Character); - - -- MANPAGE(`curs_inch.3x') - - -- ANCHOR(`winch()',`Peek') - function Peek (Win : Window := Standard_Window) - return Attributed_Character; - -- ALIAS(`inch()') - -- AKA - - -- ANCHOR(`mvwinch()',`Peek') - function Peek - (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position) return Attributed_Character; - -- AKA - -- ALIAS(`mvinch()') - -- More Peek's follow, pragma Inline appears later. - - -- MANPAGE(`curs_insch.3x') - - -- ANCHOR(`winsch()',`Insert') - procedure Insert (Win : Window := Standard_Window; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`insch()') - - -- ANCHOR(`mvwinsch()',`Insert') - procedure Insert (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Ch : Attributed_Character); - -- AKA - -- ALIAS(`mvinsch()') - - -- MANPAGE(`curs_insstr.3x') - - -- ANCHOR(`winsnstr()',`Insert') - procedure Insert (Win : Window := Standard_Window; - Str : String; - Len : Integer := -1); - -- AKA - -- ALIAS(`winsstr()') - -- ALIAS(`insnstr()') - -- ALIAS(`insstr()') - - -- ANCHOR(`mvwinsnstr()',`Insert') - procedure Insert (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : String; - Len : Integer := -1); - -- AKA - -- ALIAS(`mvwinsstr()') - -- ALIAS(`mvinsnstr()') - -- ALIAS(`mvinsstr()') - pragma Inline (Insert); - - -- MANPAGE(`curs_instr.3x') - - -- ANCHOR(`winnstr()',`Peek') - procedure Peek (Win : Window := Standard_Window; - Str : out String; - Len : Integer := -1); - -- AKA - -- ALIAS(`winstr()') - -- ALIAS(`innstr()') - -- ALIAS(`instr()') - - -- ANCHOR(`mvwinnstr()',`Peek') - procedure Peek (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : out String; - Len : Integer := -1); - -- AKA - -- ALIAS(`mvwinstr()') - -- ALIAS(`mvinnstr()') - -- ALIAS(`mvinstr()') - - -- MANPAGE(`curs_inchstr.3x') - - -- ANCHOR(`winchnstr()',`Peek') - procedure Peek (Win : Window := Standard_Window; - Str : out Attributed_String; - Len : Integer := -1); - -- AKA - -- ALIAS(`winchstr()') - -- ALIAS(`inchnstr()') - -- ALIAS(`inchstr()') - - -- ANCHOR(`mvwinchnstr()',`Peek') - procedure Peek (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : out Attributed_String; - Len : Integer := -1); - -- AKA - -- ALIAS(`mvwinchstr()') - -- ALIAS(`mvinchnstr()') - -- ALIAS(`mvinchstr()') - -- We do not inline the Peek procedures - - -- MANPAGE(`curs_getstr.3x') - - -- ANCHOR(`wgetnstr()',`Get') - procedure Get (Win : Window := Standard_Window; - Str : out String; - Len : Integer := -1); - -- AKA - -- ALIAS(`wgetstr()') - -- ALIAS(`getnstr()') - -- ALIAS(`getstr()') - -- actually getstr is not supported because that results in buffer - -- overflows. - - -- ANCHOR(`mvwgetnstr()',`Get') - procedure Get (Win : Window := Standard_Window; - Line : Line_Position; - Column : Column_Position; - Str : out String; - Len : Integer := -1); - -- AKA - -- ALIAS(`mvwgetstr()') - -- ALIAS(`mvgetnstr()') - -- ALIAS(`mvgetstr()') - -- Get is not inlined - - -- MANPAGE(`curs_slk.3x') - - -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set - - type Soft_Label_Key_Format is (Three_Two_Three, - Four_Four, - PC_Style, -- ncurses specific - PC_Style_With_Index); -- " - type Label_Number is new Positive range 1 .. 12; - type Label_Justification is (Left, Centered, Right); - - -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys') - procedure Init_Soft_Label_Keys - (Format : Soft_Label_Key_Format := Three_Two_Three); - -- AKA - pragma Inline (Init_Soft_Label_Keys); - - -- ANCHOR(`slk_set()',`Set_Soft_Label_Key') - procedure Set_Soft_Label_Key (Label : Label_Number; - Text : String; - Fmt : Label_Justification := Left); - -- AKA - -- We do not inline this procedure - - -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key') - procedure Refresh_Soft_Label_Keys; - -- AKA - pragma Inline (Refresh_Soft_Label_Keys); - - -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update') - procedure Refresh_Soft_Label_Keys_Without_Update; - -- AKA - pragma Inline (Refresh_Soft_Label_Keys_Without_Update); - - -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') - procedure Get_Soft_Label_Key (Label : Label_Number; - Text : out String); - -- AKA - - -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') - function Get_Soft_Label_Key (Label : Label_Number) return String; - -- AKA - -- Same as function - pragma Inline (Get_Soft_Label_Key); - - -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys') - procedure Clear_Soft_Label_Keys; - -- AKA - pragma Inline (Clear_Soft_Label_Keys); - - -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys') - procedure Restore_Soft_Label_Keys; - -- AKA - pragma Inline (Restore_Soft_Label_Keys); - - -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys') - procedure Touch_Soft_Label_Keys; - -- AKA - pragma Inline (Touch_Soft_Label_Keys); - - -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes') - procedure Switch_Soft_Label_Key_Attributes - (Attr : Character_Attribute_Set; - On : Boolean := True); - -- AKA - -- ALIAS(`slk_attroff()') - pragma Inline (Switch_Soft_Label_Key_Attributes); - - -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes') - procedure Set_Soft_Label_Key_Attributes - (Attr : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First); - -- AKA - pragma Inline (Set_Soft_Label_Key_Attributes); - - -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') - function Get_Soft_Label_Key_Attributes return Character_Attribute_Set; - -- AKA - - -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') - function Get_Soft_Label_Key_Attributes return Color_Pair; - -- AKA - pragma Inline (Get_Soft_Label_Key_Attributes); - - -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color') - procedure Set_Soft_Label_Key_Color (Pair : Color_Pair); - -- AKA - pragma Inline (Set_Soft_Label_Key_Color); - - -- MANPAGE(`keybound.3x') - -- Not Implemented: keybound - - -- MANPAGE(`keyok.3x') - - -- ANCHOR(`keyok()',`Enable_Key') - procedure Enable_Key (Key : Special_Key_Code; - Enable : Boolean := True); - -- AKA - pragma Inline (Enable_Key); - - -- MANPAGE(`define_key.3x') - - -- ANCHOR(`define_key()',`Define_Key') - procedure Define_Key (Definition : String; - Key : Special_Key_Code); - -- AKA - pragma Inline (Define_Key); - - -- MANPAGE(`curs_util.3x') - - -- | Not implemented : filter, use_env - -- | putwin, getwin are in the child package PutWin - -- - - -- ANCHOR(`keyname()',`Key_Name') - procedure Key_Name (Key : Real_Key_Code; - Name : out String); - -- AKA - -- The external name for a real keystroke. - - -- ANCHOR(`keyname()',`Key_Name') - function Key_Name (Key : Real_Key_Code) return String; - -- AKA - -- Same as function - -- We do not inline this routine - - -- ANCHOR(`unctrl()',`Un_Control') - procedure Un_Control (Ch : Attributed_Character; - Str : out String); - -- AKA - - -- ANCHOR(`unctrl()',`Un_Control') - function Un_Control (Ch : Attributed_Character) return String; - -- AKA - -- Same as function - pragma Inline (Un_Control); - - -- ANCHOR(`delay_output()',`Delay_Output') - procedure Delay_Output (Msecs : Natural); - -- AKA - pragma Inline (Delay_Output); - - -- ANCHOR(`flushinp()',`Flush_Input') - procedure Flush_Input; - -- AKA - pragma Inline (Flush_Input); - - -- MANPAGE(`curs_termattrs.3x') - - -- ANCHOR(`baudrate()',`Baudrate') - function Baudrate return Natural; - -- AKA - pragma Inline (Baudrate); - - -- ANCHOR(`erasechar()',`Erase_Character') - function Erase_Character return Character; - -- AKA - pragma Inline (Erase_Character); - - -- ANCHOR(`killchar()',`Kill_Character') - function Kill_Character return Character; - -- AKA - pragma Inline (Kill_Character); - - -- ANCHOR(`has_ic()',`Has_Insert_Character') - function Has_Insert_Character return Boolean; - -- AKA - pragma Inline (Has_Insert_Character); - - -- ANCHOR(`has_il()',`Has_Insert_Line') - function Has_Insert_Line return Boolean; - -- AKA - pragma Inline (Has_Insert_Line); - - -- ANCHOR(`termattrs()',`Supported_Attributes') - function Supported_Attributes return Character_Attribute_Set; - -- AKA - pragma Inline (Supported_Attributes); - - -- ANCHOR(`longname()',`Long_Name') - procedure Long_Name (Name : out String); - -- AKA - - -- ANCHOR(`longname()',`Long_Name') - function Long_Name return String; - -- AKA - -- Same as function - pragma Inline (Long_Name); - - -- ANCHOR(`termname()',`Terminal_Name') - procedure Terminal_Name (Name : out String); - -- AKA - - -- ANCHOR(`termname()',`Terminal_Name') - function Terminal_Name return String; - -- AKA - -- Same as function - pragma Inline (Terminal_Name); - - -- MANPAGE(`curs_color.3x') - - -- COLOR_PAIR - -- COLOR_PAIR(n) in C is the same as - -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video) - -- In C you often see something like c = c | COLOR_PAIR(n); - -- This is equivalent to c.Color := n; - - -- ANCHOR(`start_color()',`Start_Color') - procedure Start_Color; - -- AKA - pragma Import (C, Start_Color, "start_color"); - - -- ANCHOR(`init_pair()',`Init_Pair') - procedure Init_Pair (Pair : Redefinable_Color_Pair; - Fore : Color_Number; - Back : Color_Number); - -- AKA - pragma Inline (Init_Pair); - - -- ANCHOR(`pair_content()',`Pair_Content') - procedure Pair_Content (Pair : Color_Pair; - Fore : out Color_Number; - Back : out Color_Number); - -- AKA - pragma Inline (Pair_Content); - - -- ANCHOR(`has_colors()',`Has_Colors') - function Has_Colors return Boolean; - -- AKA - pragma Inline (Has_Colors); - - -- ANCHOR(`init_color()',`Init_Color') - procedure Init_Color (Color : Color_Number; - Red : RGB_Value; - Green : RGB_Value; - Blue : RGB_Value); - -- AKA - pragma Inline (Init_Color); - - -- ANCHOR(`can_change_color()',`Can_Change_Color') - function Can_Change_Color return Boolean; - -- AKA - pragma Inline (Can_Change_Color); - - -- ANCHOR(`color_content()',`Color_Content') - procedure Color_Content (Color : Color_Number; - Red : out RGB_Value; - Green : out RGB_Value; - Blue : out RGB_Value); - -- AKA - pragma Inline (Color_Content); - - -- MANPAGE(`curs_kernel.3x') - -- | Not implemented: getsyx, setsyx - -- - type Curses_Mode is (Curses, Shell); - - -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode') - procedure Save_Curses_Mode (Mode : Curses_Mode); - -- AKA - -- ALIAS(`def_shell_mode()') - pragma Inline (Save_Curses_Mode); - - -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode') - procedure Reset_Curses_Mode (Mode : Curses_Mode); - -- AKA - -- ALIAS(`reset_shell_mode()') - pragma Inline (Reset_Curses_Mode); - - -- ANCHOR(`savetty()',`Save_Terminal_State') - procedure Save_Terminal_State; - -- AKA - pragma Inline (Save_Terminal_State); - - -- ANCHOR(`resetty();',`Reset_Terminal_State') - procedure Reset_Terminal_State; - -- AKA - pragma Inline (Reset_Terminal_State); - - type Stdscr_Init_Proc is access - function (Win : Window; - Columns : Column_Count) return Integer; - pragma Convention (C, Stdscr_Init_Proc); - -- N.B.: the return value is actually ignored, but it seems to be - -- a good practice to return 0 if you think all went fine - -- and -1 otherwise. - - -- ANCHOR(`ripoffline()',`Rip_Off_Lines') - procedure Rip_Off_Lines (Lines : Integer; - Proc : Stdscr_Init_Proc); - -- AKA - -- N.B.: to be more precise, this uses a ncurses specific enhancement of - -- ripoffline(), in which the Lines argument absolute value is the - -- number of lines to be ripped of. The official ripoffline() only - -- uses the sign of Lines to remove a single line from bottom or top. - pragma Inline (Rip_Off_Lines); - - type Cursor_Visibility is (Invisible, Normal, Very_Visible); - - -- ANCHOR(`curs_set()',`Set_Cursor_Visibility') - procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility); - -- AKA - pragma Inline (Set_Cursor_Visibility); - - -- ANCHOR(`napms()',`Nap_Milli_Seconds') - procedure Nap_Milli_Seconds (Ms : Natural); - -- AKA - pragma Inline (Nap_Milli_Seconds); - - -- |===================================================================== - -- | Some useful helpers. - -- |===================================================================== - type Transform_Direction is (From_Screen, To_Screen); - procedure Transform_Coordinates - (W : Window := Standard_Window; - Line : in out Line_Position; - Column : in out Column_Position; - Dir : Transform_Direction := From_Screen); - -- This procedure transforms screen coordinates into coordinates relative - -- to the window and vice versa, depending on the Dir parameter. - -- Screen coordinates are the position information for the physical device. - -- An Curses_Exception will be raised if Line and Column are not in the - -- Window or if you pass the Null_Window as argument. - -- We do not inline this procedure - - -- MANPAGE(`default_colors.3x') - - -- ANCHOR(`use_default_colors()',`Use_Default_Colors') - procedure Use_Default_Colors; - -- AKA - pragma Inline (Use_Default_Colors); - - -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors') - procedure Assume_Default_Colors (Fore : Color_Number := Default_Color; - Back : Color_Number := Default_Color); - -- AKA - pragma Inline (Assume_Default_Colors); - - -- MANPAGE(`curs_extend.3x') - - -- ANCHOR(`curses_version()',`Curses_Version') - function Curses_Version return String; - -- AKA - - -- ANCHOR(`use_extended_names()',`Use_Extended_Names') - -- The returnvalue is the previous setting of the flag - function Use_Extended_Names (Enable : Boolean) return Boolean; - -- AKA - - -- MANPAGE(`curs_trace.3x') - - -- ANCHOR(`_nc_freeall()',`Curses_Free_All') - procedure Curses_Free_All; - -- AKA - - -- MANPAGE(`curs_scr_dump.3x') - - -- ANCHOR(`scr_dump()',`Screen_Dump_To_File') - procedure Screen_Dump_To_File (Filename : String); - -- AKA - - -- ANCHOR(`scr_restore()',`Screen_Restore_From_File') - procedure Screen_Restore_From_File (Filename : String); - -- AKA - - -- ANCHOR(`scr_init()',`Screen_Init_From_File') - procedure Screen_Init_From_File (Filename : String); - -- AKA - - -- ANCHOR(`scr_set()',`Screen_Set_File') - procedure Screen_Set_File (Filename : String); - -- AKA - - -- MANPAGE(`curs_print.3x') - -- Not implemented: mcprint - - -- MANPAGE(`curs_printw.3x') - -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw, - -- vw_printw - -- Please use the Ada style Text_IO child packages for formatted - -- printing. It does not make a lot of sense to map the printf style - -- C functions to Ada. - - -- MANPAGE(`curs_scanw.3x') - -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw - - -- MANPAGE(`resizeterm.3x') - -- Not Implemented: resizeterm - - -- MANPAGE(`wresize.3x') - - -- ANCHOR(`wresize()',`Resize') - procedure Resize (Win : Window := Standard_Window; - Number_Of_Lines : Line_Count; - Number_Of_Columns : Column_Count); - -- AKA - -private - type Window is new System.Storage_Elements.Integer_Address; - Null_Window : constant Window := 0; - - -- The next constants are generated and may be different on your - -- architecture. - -- -include(`Window_Offsets')dnl - Curses_Bool_False : constant Curses_Bool := 0; - -end Terminal_Interface.Curses; diff --git a/Ada95/include/MKncurses_def.sh b/Ada95/include/MKncurses_def.sh deleted file mode 100755 index 4aac86554b5..00000000000 --- a/Ada95/include/MKncurses_def.sh +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -# $Id: MKncurses_def.sh,v 1.2 2003/10/25 16:19:46 tom Exp $ -############################################################################## -# Copyright (c) 2000 Free Software Foundation, Inc. # -# # -# Permission is hereby granted, free of charge, to any person obtaining a # -# copy of this software and associated documentation files (the "Software"), # -# 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. # -############################################################################## -# -# MKncurses_def.sh -- generate fallback definitions for ncurses_cfg.h -# -# Author: Thomas E. Dickey 2000 -# -# Given the choice between constructs such as -# -# #if defined(foo) && foo -# #if foo -# -# we chose the latter. It is guaranteed by the language standard, and there -# appear to be no broken compilers that do not honor that detail. But some -# people want to use gcc's -Wundef option (corresponding to one of the less -# useful features in Watcom's compiler) to check for misspellings. So we -# generate a set of fallback definitions to quiet the warnings without making -# the code ugly. -# -DEFS="${1-ncurses_defs}" -cat <$@ - -tags: - ctags *.[ch] - -@MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] - -mostlyclean :: - -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace - -clean :: mostlyclean - -rm -f $(AUTO_SRC) - -distclean :: clean - -rm -f Makefile - -realclean :: distclean - -############################################################################### -# The remainder of this file is automatically generated during configuration -############################################################################### diff --git a/Ada95/include/ncurses_cfg.hin b/Ada95/include/ncurses_cfg.hin deleted file mode 100644 index 3f8a482a5d8..00000000000 --- a/Ada95/include/ncurses_cfg.hin +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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 1997 * - ****************************************************************************/ -/* - * $Id: ncurses_cfg.hin,v 1.7 2005/01/02 01:26:58 tom Exp $ - * - * This is a template-file used to generate the "ncurses_cfg.h" file. - * - * Rather than list every definition, the configuration script substitutes the - * definitions that it finds using 'sed'. You need a patch (original date - * 971222) to autoconf 2.12 or 2.13 to do this. - * - * See: - * http://invisible-island.net/autoconf/ - * ftp://invisible-island.net/autoconf/ - */ -#ifndef NC_CONFIG_H -#define NC_CONFIG_H -@DEFS@ - -#include - - /* The C compiler may not treat these properly but C++ has to */ -#ifdef __cplusplus -#undef const -#undef inline -#else -#if defined(lint) || defined(TRACE) -#undef inline -#define inline /* nothing */ -#endif -#endif - - /* On HP-UX, the C compiler doesn't grok mbstate_t without - -D_XOPEN_SOURCE=500. However, this causes problems on - IRIX. So, we #define mbstate_t to int in configure.in - only for the C compiler if needed. */ -#ifndef __cplusplus -#ifdef NEED_MBSTATE_T_DEF -#define mbstate_t int -#endif -#endif - -#endif /* NC_CONFIG_H */ diff --git a/Ada95/include/ncurses_defs b/Ada95/include/ncurses_defs deleted file mode 100644 index b07f5f1f7bd..00000000000 --- a/Ada95/include/ncurses_defs +++ /dev/null @@ -1,207 +0,0 @@ -# $Id: ncurses_defs,v 1.41 2008/11/16 00:19:59 juergen Exp $ -############################################################################## -# Copyright (c) 2000-2007,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 "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. # -############################################################################## -# -# See "MKncurses_def.sh" for an explanation. -# -# (hint: don't try to define NDEBUG ;-) - -BROKEN_LINKER -BSD_TPUTS -CC_HAS_PROTOS -CPP_HAS_PARAM_INIT -CURSES_ACS_ARRAY acs_map -CURSES_WACS_ARRAY _nc_wacs -DECL_ERRNO -ETIP_NEEDS_MATH_H -GCC_NORETURN /* nothing */ -GCC_UNUSED /* nothing */ -HAVE_BIG_CORE -HAVE_BSD_CGETENT -HAVE_BSD_SIGNAL_H -HAVE_BTOWC -HAVE_BUILTIN_H -HAVE_CHGAT 1 -HAVE_COLOR_SET 1 -HAVE_DIRENT_H -HAVE_ERRNO -HAVE_FCNTL_H -HAVE_FILTER 1 -HAVE_FORM_H -HAVE_GETBEGX 1 -HAVE_GETCURX 1 -HAVE_GETCWD -HAVE_GETEGID -HAVE_GETEUID -HAVE_GETMAXX 1 -HAVE_GETNSTR -HAVE_GETOPT_H -HAVE_GETPARX 1 -HAVE_GETTIMEOFDAY -HAVE_GETTTYNAM -HAVE_GETWIN 1 -HAVE_GPM_H -HAVE_GPP_BUILTIN_H -HAVE_GXX_BUILTIN_H -HAVE_HAS_KEY -HAVE_IOSTREAM -HAVE_ISASCII -HAVE_ISSETUGID -HAVE_LANGINFO_CODESET -HAVE_LIBC_H -HAVE_LIBDBMALLOC -HAVE_LIBDMALLOC -HAVE_LIBFORM -HAVE_LIBGPM -HAVE_LIBMENU -HAVE_LIBMPATROL -HAVE_LIBPANEL -HAVE_LIMITS_H -HAVE_LINK -HAVE_LOCALE_H -HAVE_LONG_FILE_NAMES -HAVE_MBLEN -HAVE_MBRLEN -HAVE_MBRTOWC -HAVE_MBSRTOWCS -HAVE_MBSTOWCS -HAVE_MBTOWC -HAVE_MENU_H -HAVE_MKSTEMP -HAVE_MVVLINE 1 -HAVE_MVWVLINE 1 -HAVE_NANOSLEEP -HAVE_NC_ALLOC_H -HAVE_PANEL_H -HAVE_POLL -HAVE_POLL_H -HAVE_PURIFY -HAVE_PUTWC -HAVE_PUTWIN 1 -HAVE_REGEXPR_H_FUNCS -HAVE_REGEXP_H_FUNCS -HAVE_REGEX_H_FUNCS -HAVE_REMOVE -HAVE_RESIZETERM -HAVE_RESIZE_TERM -HAVE_RIPOFFLINE 1 -HAVE_SELECT -HAVE_SETBUF -HAVE_SETBUFFER -HAVE_SETUPTERM 1 -HAVE_SETVBUF -HAVE_SIGACTION -HAVE_SIGVEC -HAVE_SIZECHANGE -HAVE_SLK_COLOR -HAVE_SLK_INIT 1 -HAVE_STRDUP -HAVE_STRSTR -HAVE_SYMLINK -HAVE_SYS_BSDTYPES_H -HAVE_SYS_IOCTL_H -HAVE_SYS_PARAM_H -HAVE_SYS_POLL_H -HAVE_SYS_SELECT_H -HAVE_SYS_TERMIO_H -HAVE_SYS_TIMES_H -HAVE_SYS_TIME_H -HAVE_SYS_TIME_SELECT -HAVE_TCGETATTR -HAVE_TCGETPGRP -HAVE_TELL -HAVE_TERMATTRS 1 -HAVE_TERMIOS_H -HAVE_TERMIO_H -HAVE_TERMNAME 1 -HAVE_TERM_H 1 -HAVE_TGETENT 1 -HAVE_TIGETNUM 1 -HAVE_TIGETSTR 1 -HAVE_TIMES -HAVE_TTYENT_H -HAVE_TYPEAHEAD 1 -HAVE_TYPEINFO -HAVE_TYPE_ATTR_T -HAVE_TYPE_SIGACTION -HAVE_UNISTD_H -HAVE_UNLINK -HAVE_USE_DEFAULT_COLORS -HAVE_VFSCANF -HAVE_VSNPRINTF -HAVE_VSSCANF -HAVE_WCSRTOMBS -HAVE_WCSTOMBS -HAVE_WCTOB -HAVE_WCTOMB -HAVE_WCTYPE_H -HAVE_WINSSTR 1 -HAVE_WORKING_POLL -HAVE_WRESIZE -HAVE__DOSCAN -MIXEDCASE_FILENAMES -NCURSES_CHAR_EQ -NCURSES_EXPANDED -NCURSES_EXT_COLORS -NCURSES_EXT_FUNCS -NCURSES_NO_PADDING -NCURSES_PATHSEP ':' -NEED_PTEM_H -NO_LEAKS -PURE_TERMINFO -RETSIGTYPE -STDC_HEADERS -SVR4_ACTION -SVR4_TERMIO -SYSTEM_NAME "unknown" -TERMINFO "none" -TERMPATH "none" -TIME_WITH_SYS_TIME -TYPEOF_CHTYPE -USE_COLORFGBG -USE_DATABASE -USE_GETCAP -USE_GETCAP_CACHE -USE_HARD_TABS -USE_HASHED_DB -USE_HASHMAP -USE_HOME_TERMINFO -USE_LINKS -USE_MY_MEMMOVE -USE_OK_BCOPY -USE_RCS_IDS -USE_REENTRANT -USE_SAFE_SPRINTF -USE_SCROLL_HINTS -USE_SIGWINCH -USE_SYMLINKS -USE_SYSMOUSE -USE_TERMCAP -USE_WEAK_SYMBOLS -USE_WIDEC_SUPPORT -USE_XMC_SUPPORT diff --git a/Ada95/make-tar.sh b/Ada95/make-tar.sh deleted file mode 100755 index 608bbdff844..00000000000 --- a/Ada95/make-tar.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -# $Id: make-tar.sh,v 1.12 2011/03/26 19:07:38 tom Exp $ -############################################################################## -# Copyright (c) 2010,2011 Free 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. # -############################################################################## -# Construct a tar-file containing only the Ada95 tree as well as its associated -# documentation. The reason for doing that is to simplify distributing the -# ada binding as a separate package. - -CDPATH=: -export CDPATH - -TARGET=`pwd` - -: ${ROOTNAME:=ncurses-Ada95} -: ${PKG_NAME:=AdaCurses} -: ${DESTDIR:=$TARGET} -: ${TMPDIR:=/tmp} - -grep_assign() { - grep_assign=`egrep "^$2\>" "$1" | sed -e "s/^$2[ ]*=[ ]*//" -e 's/"//g'` - eval $2=\"$grep_assign\" -} - -grep_patchdate() { - grep_assign ../dist.mk NCURSES_MAJOR - grep_assign ../dist.mk NCURSES_MINOR - grep_assign ../dist.mk NCURSES_PATCH -} - -# The rpm spec-file in the ncurses tree is a template. Fill in the version -# information from dist.mk -edit_specfile() { - sed \ - -e "s/\\/$NCURSES_MAJOR/g" \ - -e "s/\\/$NCURSES_MINOR/g" \ - -e "s/\\/$NCURSES_PATCH/g" $1 >$1.new - chmod u+w $1 - mv $1.new $1 -} - -make_changelog() { - test -f $1 && chmod u+w $1 - cat >$1 <MANIFEST ) - -cd $BUILD || exit - -# Remove build-artifacts. -find . -name RCS -exec rm -rf {} \; -find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null -find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null -find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null - -# There is no need for this script in the tar file. -rm -f $ROOTNAME/make-tar.sh - -# Remove build-artifacts. -find . -name "*.gz" -exec rm -rf {} \; - -# Make the files writable... -chmod -R u+w . - -tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz -cd $DESTDIR - -pwd -ls -l $ROOTNAME.tar.gz - -# vi:ts=4 sw=4 diff --git a/Ada95/mk-1st.awk b/Ada95/mk-1st.awk deleted file mode 100644 index 77265497152..00000000000 --- a/Ada95/mk-1st.awk +++ /dev/null @@ -1,90 +0,0 @@ -# $Id: mk-1st.awk,v 1.4 2011/02/22 09:40:01 tom Exp $ -############################################################################## -# Copyright (c) 2010,2011 Free 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 -# -# Generate compile-rules for the Ada95 modules that we are using in libraries -# or programs. This script is used for older versions of gnatmake, which do -# not build libraries reliably, e.g., gnatmake 3.15. -# -# Fields in src/modules: -# $1 = module name -# $2 = directory where spec-dependency ".ads" is found -# $3 = directory where body-dependency ".adb" is found -# $4 = unit to compile (spec or body) -# -BEGIN { - printf "\n"; - printf "# generated by Ada95/mk-1st.awk\n"; - } - /^[#]/ { - next - } - /^$/ { - next - } - { - printf "\n"; - printf "%s.o :", $1; - - if ( $2 == "none" ) { - pre_spec = ""; - } else if ( $2 == "." ) { - pre_spec = ""; - printf " \\\n\t\t%s.ads", $1; - } else { - pre_spec = sprintf("%s/", $2); - printf " \\\n\t\t%s%s.ads", pre_spec, $1; - } - - if ( $3 == "none" ) { - pre_body = ""; - } else if ( $3 == "." ) { - pre_body = ""; - printf " \\\n\t\t%s.adb", $1; - } else { - pre_body = sprintf("%s/", $3); - printf " \\\n\t\t%s%s.adb", pre_body, $1; - printf " \\\n\t\t$(BASEDEPS)"; - } - - if ( $4 == "spec" ) { - suffix = "ads"; - prefix = pre_spec; - } else { - suffix = "adb"; - prefix = pre_body; - } - - printf "\n"; - printf "\t$(ADA) $(ADAFLAGS) -c -o $@ %s%s.%s\n", prefix, $1, suffix - } -END { - print "" - } diff --git a/Ada95/package/AdaCurses-doc.spec b/Ada95/package/AdaCurses-doc.spec deleted file mode 100644 index eb7e6b8fedb..00000000000 --- a/Ada95/package/AdaCurses-doc.spec +++ /dev/null @@ -1,48 +0,0 @@ -Summary: AdaCurses - Ada95 binding documentation for ncurses -%define AppProgram AdaCurses -%define AppVersion MAJOR.MINOR -%define AppRelease YYYYMMDD -%define AppPackage %{AppProgram}-doc -# $Id: AdaCurses-doc.spec,v 1.1 2011/03/26 19:22:39 tom Exp $ -Name: %{AppPackage} -Version: %{AppVersion} -Release: %{AppRelease} -License: MIT -Group: Applications/Development -URL: ftp://invisible-island.net/%{AppProgram} -Source0: %{AppProgram}-%{AppRelease}.tgz -Packager: Thomas Dickey - -%description -This is the Ada95 binding documentation from the ncurses MAJOR.MINOR -distribution, for patch-date YYYYMMDD. -%prep - -%setup -q -n %{AppProgram}-%{AppRelease} - -%build - -INSTALL_PROGRAM='${INSTALL}' \ - ./configure \ - --target %{_target_platform} \ - --prefix=%{_prefix} \ - --datadir=%{_datadir} \ - --with-ada-sharedlib - -%install -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -(cd doc && make install.html DESTDIR=$RPM_BUILD_ROOT ) - -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%{_datadir}/doc/AdaCurses - -%changelog -# each patch should add its ChangeLog entries here - -* Sat Mar 26 2010 Thomas Dickey -- initial version diff --git a/Ada95/package/AdaCurses.spec b/Ada95/package/AdaCurses.spec deleted file mode 100644 index c98e1047097..00000000000 --- a/Ada95/package/AdaCurses.spec +++ /dev/null @@ -1,78 +0,0 @@ -Summary: AdaCurses - Ada95 binding for ncurses -%define AppProgram AdaCurses -%define AppVersion MAJOR.MINOR -%define AppRelease YYYYMMDD -# $Id: AdaCurses.spec,v 1.12 2011/04/01 00:08:32 tom Exp $ -Name: %{AppProgram} -Version: %{AppVersion} -Release: %{AppRelease} -License: MIT -Group: Applications/Development -URL: ftp://invisible-island.net/%{AppProgram} -Source0: %{AppProgram}-%{AppRelease}.tgz -Packager: Thomas Dickey - -%description -This is the Ada95 binding from the ncurses MAJOR.MINOR distribution, for -patch-date YYYYMMDD. - -In addition to a library, this package installs sample programs in -"bin/AdaCurses" to avoid conflict with other packages. -%prep - -%setup -q -n %{AppProgram}-%{AppRelease} - -%build - -%define ada_libdir %{_prefix}/lib/ada/adalib - -INSTALL_PROGRAM='${INSTALL}' \ - ./configure \ - --target %{_target_platform} \ - --prefix=%{_prefix} \ - --bindir=%{_bindir} \ - --libdir=%{_libdir} \ - --mandir=%{_mandir} \ - --datadir=%{_datadir} \ - --disable-rpath-link \ - --with-shared \ - --with-ada-sharedlib - -make - -%install -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -make install DESTDIR=$RPM_BUILD_ROOT - -( cd samples && - make install.examples \ - DESTDIR=$RPM_BUILD_ROOT \ - BINDIR=$RPM_BUILD_ROOT%{_bindir}/%{AppProgram} -) - -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%{_bindir}/adacurses*-config -%{_bindir}/%{AppProgram}/* -%{_libdir}/libAdaCurses.* -%{ada_libdir}/libAdaCurses.* -%{ada_libdir}/terminal_interface* -%{_mandir}/man1/adacurses*-config.1* -%{_datadir}/%{AppProgram}/* -%{_datadir}/ada/adainclude/terminal_interface* - -%changelog -# each patch should add its ChangeLog entries here - -* Thu Mar 31 2010 Thomas Dickey -- use --with-shared option for consistency with --with-ada-sharelib -- ensure that MY_DATADIR is set when installing examples -- add ada_libdir symbol to handle special case where libdir is /usr/lib64 -- use --disable-rpath-link to link sample programs without rpath - -* Fri Mar 25 2010 Thomas Dickey -- initial version diff --git a/Ada95/package/debian/compat b/Ada95/package/debian/compat deleted file mode 100644 index 7ed6ff82de6..00000000000 --- a/Ada95/package/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/Ada95/package/debian/control b/Ada95/package/debian/control deleted file mode 100644 index 88af9706d0c..00000000000 --- a/Ada95/package/debian/control +++ /dev/null @@ -1,17 +0,0 @@ -Source: adacurses -Maintainer: Thomas E. Dickey -Section: misc -Priority: optional -Standards-Version: 3.8.4 -Build-Depends: debhelper (>= 5) -Homepage: http://invisible-island.net/adacurses/ - -Package: adacurses -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: AdaCurses - Ada95 binding for ncurses - This package installs as "adacurses" to avoid conflict with other packages. - This is the Ada95 binding from the ncurses distribution. - . - In addition to a library, this package installs sample programs in - "bin/AdaCurses" to avoid conflict with other packages. diff --git a/Ada95/package/debian/copyright b/Ada95/package/debian/copyright deleted file mode 100644 index e681a6bd58a..00000000000 --- a/Ada95/package/debian/copyright +++ /dev/null @@ -1,69 +0,0 @@ -Upstream source http://invisible-island.net/ncurses/ncurses-examples.html - -Current ncurses maintainer: Thomas Dickey - -------------------------------------------------------------------------------- - Copyright (c) 1998-2010,2011 Free 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. -------------------------------------------------------------------------------- - -Files: install-sh -Copyright: 1994 X Consortium -Licence: other-BSD - 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' diff --git a/Ada95/package/debian/docs b/Ada95/package/debian/docs deleted file mode 100644 index e845566c06f..00000000000 --- a/Ada95/package/debian/docs +++ /dev/null @@ -1 +0,0 @@ -README diff --git a/Ada95/package/debian/rules b/Ada95/package/debian/rules deleted file mode 100755 index ad1a35101b1..00000000000 --- a/Ada95/package/debian/rules +++ /dev/null @@ -1,97 +0,0 @@ -#!/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) - -TARGET_DIR = $(CURDIR)/debian/adacurses -SAMPLE_DIR = $(TARGET_DIR)/usr/bin/AdaCurses - -CFLAGS = - -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=$(DEB_HOST_GNU_TYPE) \ - --build=$(DEB_BUILD_GNU_TYPE) \ - --prefix=/usr \ - --disable-rpath-link \ - --with-shared \ - --with-ada-sharedlib - - 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=$(TARGET_DIR) - - # FIXME: it would be nice to make these into separate packages - ( cd samples && $(MAKE) install.examples DESTDIR=$(TARGET_DIR) BINDIR=$(SAMPLE_DIR) ) - ( cd doc && $(MAKE) install.html DESTDIR=$(TARGET_DIR) ) - - 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/Ada95/package/debian/source/format b/Ada95/package/debian/source/format deleted file mode 100644 index 89ae9db8f88..00000000000 --- a/Ada95/package/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/Ada95/package/debian/watch b/Ada95/package/debian/watch deleted file mode 100644 index 4794ae38527..00000000000 --- a/Ada95/package/debian/watch +++ /dev/null @@ -1,4 +0,0 @@ -version=3 - -opts=passive ftp://invisible-island.net/AdaCurses/AdaCurses-([\d.]+)\.tgz \ - debian uupdate diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in deleted file mode 100644 index aa839ffbaf6..00000000000 --- a/Ada95/samples/Makefile.in +++ /dev/null @@ -1,155 +0,0 @@ -############################################################################## -# Copyright (c) 1998-2010,2011 Free 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: Juergen Pfeifer, 1996 -# -# $Id: Makefile.in,v 1.46 2011/03/28 23:45:08 tom Exp $ -# -.SUFFIXES: - -SHELL = /bin/sh -VPATH = @srcdir@ -THIS = Makefile - -x = @PROG_EXT@ - -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -datadir = @datadir@ -libdir = @libdir@ -includedir = @includedir@ - -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ - -AWK = @AWK@ -LN_S = @LN_S@ - -CC = @CC@ -CFLAGS = @CFLAGS@ - -CPPFLAGS = @ACPPFLAGS@ \ - -DHAVE_CONFIG_H -I$(srcdir) - -CCFLAGS = $(CPPFLAGS) $(CFLAGS) - -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ - -CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) - -REL_VERSION = @cf_cv_rel_version@ -ABI_VERSION = @cf_cv_abi_version@ -LOCAL_LIBDIR = @top_builddir@/lib - -LINK = $(CC) -LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ - -RANLIB = @RANLIB@ -################################################################################ -BINDIR = $(DESTDIR)$(bindir) -DATADIR = $(DESTDIR)$(datadir) -LIBDIR = $(DESTDIR)$(libdir) - -MY_DATADIR = $(DATADIR)/AdaCurses - -################################################################################ -ada_srcdir=../src - -LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) - -ADA = @cf_ada_compiler@ -ADAFLAGS = @ADAFLAGS@ -I$(srcdir) - -ADAMAKE = @cf_ada_make@ -ADAMAKEFLAGS = -a -A$(srcdir) -A$(ada_srcdir) -A$(srcdir)/$(ada_srcdir) - -ALIB = @cf_ada_package@ -ABASE = $(ALIB)-curses - -CARGS =-cargs $(ADAFLAGS) -LARGS =-largs -L../lib -lAdaCurses @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@ - -PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x - -all :: $(PROGS) - @echo made $@ - -sources : - @echo made $@ - -libs \ -install \ -install.libs :: - @echo made $@ - -uninstall \ -uninstall.libs :: - @echo made $@ - -install.examples :: $(BINDIR) $(PROGS) - $(INSTALL) $(PROGS) $(BINDIR) - -install.examples :: $(MY_DATADIR) - $(INSTALL_DATA) explain.txt $(MY_DATADIR) - -uninstall.examples :: - -cd $(BINDIR) && rm -f $(PROGS) - -rmdir $(BINDIR) - -rm -f $(MY_DATADIR)/explain.txt - -rmdir $(MY_DATADIR) - -$(BINDIR) \ -$(MY_DATADIR) : - mkdir -p $@ - -ncurses$x : - $(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS) - -tour$x : - $(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS) - -rain$x : - $(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS) - -mostlyclean: - @echo made $@ - -clean :: mostlyclean - rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \ - trace screendump b~*.ad[bs] - -distclean :: clean - rm -f Makefile - -realclean :: distclean - @echo made $@ diff --git a/Ada95/samples/README b/Ada95/samples/README deleted file mode 100644 index c4f16ad306d..00000000000 --- a/Ada95/samples/README +++ /dev/null @@ -1,35 +0,0 @@ -------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: README,v 1.2 2006/04/22 22:24:12 tom Exp $ -------------------------------------------------------------------------------- - -The intention of the demo at this point in time is not to demonstrate all -the features of (n)curses and its subsystems, but to give some sample -sources how to use the binding at all. - -Ideally in the future we can combine both goals. diff --git a/Ada95/samples/explain.txt b/Ada95/samples/explain.txt deleted file mode 100644 index be2cba154ee..00000000000 --- a/Ada95/samples/explain.txt +++ /dev/null @@ -1,186 +0,0 @@ -#VERSION -This is Version 00.90.00 of the demo package. -#MENUKEYS -In a menu you can use the following Keys in the whole application: - - - CTRL-X eXit the menu - - CTRL-N Go to next item - - CTRL-P Go to previous item - - CTRL-U Scroll up one line - - CTRL-D Scroll down one line - - CTRL-F Scroll down one page - - PAGE DOWN Scroll down one page - - PAGE UP Scroll back one page - - CTRL-B Scroll back one page - - CTRL-Y Clear pattern - - CTRL-H Delete last character from pattern - - Backspace Delete last character from pattern - - CTRL-A Next pattern match - - CTRL-E Previous pattern match - - CTRL-T Toggle item in a multi-selection menu - - CR or LF Select an item - - HOME Key Go to the first item - - F3 Quit the menu - - Cursor Down Down one item - - Cursor Up Up one item - - Cursor Left Left one item - - Cursor Right Right one item - - END Key Go to last item -#FORMKEYS - - CTRL-X eXit the form - - CTRL-F Go forward to the next field - - CTRL-B Go backward to the previous field - - CTRL-L Go to the field left of the current one - - CTRL-R Go to the field right of the current one - - CTRL-U Go to the field above the current one - - CTRL-D Go to the field below the current one - - - CTRL-W Go to the next word in the field - - CTRL-T Go to the previous word in the field - - - CTRL-A Go to the beginning of the field - - CTRL-E Go to the end of the field - - - CTRL-I Insert a blank character at the current position - - CTRL-O Insert a line - - CTRL-V Delete a character - - CTRL-H Delete previous character - - CTRL-Y Delete a line - - CTRL-G Delete a word - - CTRL-K Clear to end of field - - - CTRL-N Next choice in a choice field (Enumerations etc.) - - CTRL-P Previous choice in a choice field. -#HELP -#HELPKEYS -You may scroll with the Cursor Up/Down Keys. -You may leave the help with the Function Key labeled 'Quit'. -#INHELP -You are already in the help system. -You may leave the help with the Function Key labeled 'Quit'. -#MAIN -This is the main menu of the sample program for the ncurses Ada95 -binding. The main intention of the demo is not to demonstrate or -test all the features of ncurses and it's subsystems, but to provide -to you some sample code how to use the binding with Ada95. - -You may select this options: - - * Look at some ncurses core functions - * Look at some features of the menu subsystem - * Look at some features of the form subsystem - * Look at the output of the Ada.Text_IO like functions - for ncurses. - -#MAINPAD -You may press at any place in this demo CTRL-C. This will give you a command -window. You can just type in the Label-String of a function key, then this -key will be simulated. This should help you to run the application even if -you run it on a terminal with no or only a few function keys. With CTRL-N -and CTRL-P you may browse through the possible values in the command window. -#MENU00 -Here we give you a selection of various menu demonstrations. -#MENU-PAD00 -This menu itself is a demo for a single valued, 1-column menu with -descriptions for the items, a marker and a padding character between -the item name and the description. -#MENU01 -This is a demo of the some of the menu layout options. One of them -is the spacing functionality. Just press the Key labeled "Flip" to -flip between the non-spaced and a spaced version of the menu. Please -note that this functionality is unique for ncurses and is not found -in the SVr4 menu implementation. - -This is a menu that sometimes does not fit into it's window and -therefore it becomes a scroll menu. - -You can also see here very nicely the pattern matching functionality -of menus. Type for example a 'J' and you will be positioned to the -next item after the current starting with a 'J'. Any more characters -you type in make the pattern more specific. With CTRL-A and CTRL-Z -(for more details press the Key labeled "Keys") you can browse -through all the items matching the pattern. - -You may change the format of the menu. Just press one of the keys -labeled "4x1", "4x2" or "4x3" to get a menu with that many rows -and columns. - -With the Keys "O-Row" or "O-Col" (they occupy the same label and -switch on selection) you can change the major order scheme for -the menu. If "O-Col" is visible, the menu is currently major -ordered by rows, you can switch to major column order by pressing -the key. If "O-Row" is visible, it's just the reverse situation. -This Key is not visible in "4x1" layout mode, because in this case -the functionality makes no sense. - -With the Keys "Multi" or "Singl" (they occupy the same label and -switch on selection) you can change whether or not the menu allows -multiple or only single selection. - -With the Keys "+Desc" or "-Desc" (they occupy the same label and -switch on selection) you can change whether or not the descriptions -for each item should be displayed. Please not that this key is -not visible in the "4x3" layout mode, because in this case the -menu would not fit on a typical 80x24 screen. - -With the Keys "Disab" or "Enab" (they occupy the same label and -switch on selection) you can dis- or enable the selectability of -the month with 31 days. -#MENU-PAD01 -You may press "Flip" to see the effect of ncurses unique menu-spacing. -The Keys "4x1", "4x2" and "4x3" will change the format of the menu. -Please note that this is a scrolling menu. You may also play with the -pattern matching functionality or try to change the format of the menu. -For more details press the Key labeled "Help". -#FORM00 -This is a demo of the forms package. -#FORM-PAD00 -Please note that this demo is far from being complete. It really shows -only a small part of the functionality of the forms package. Let's hope -the next version will have a richer demo (You want to contribute ?). -#NOTIMPL -Sorry this functionality of the demo is not implemented at the moment. -Remember this is a freeware project, so I can use only my very rare -free time to continue coding. If you would like to contribute, you -are very welcome ! -#CURSES00 -This is a menu where you can select some different demos of the ncurses -functionality. -#CURSES-PAD00 -Please note that this demo is far from being complete. It really shows -only a small part of the functionality of the curses package. Let's hope -the next version will have a richer demo (You want to contribute ?). -#MOUSEKEYS -In this demo you may use this keys: - - - Key labeled "Help" to get a help - - Key labeled "Keys" is what you are reading now - - Key labeled "Quit" to leave the demo - -You may click the mouse buttons at any location at the screen and look -at the protocol window ! -#MOUSE00 -A rather simple use of a mouse as demo. It's there just to test the -code and to provide the sample source. - -It might be of interest, that the output into the protocol window is -done by the (n)curses Text_IO subpackages. Especially the output of -the button and state names is done by Ads's enumeration IO, which -allows you to print the names of enumeration literals. That's really -nice. -#MOUSE-PAD00 -This is a very simple demo of the mouse features of ncurses. It's there -just to test whether or not the generated code for the binding really -works on the different architectures (seems so). -#ATTRIBDEMO -Again this is a more than simple demo and just here to give you the -sourcecode. -#ATTRIBKEYS -You may press one of the three well known standard keys of this demo. -#ATTRIB-PAD00 -Again this is a more than simple demo and just here to give you the -source code. Feel free to contribute more. -#TEXTIO -#TEXTIOKEYS -#TEXTIO-PAD00 -#END diff --git a/Ada95/samples/ncurses.adb b/Ada95/samples/ncurses.adb deleted file mode 100644 index 19f658d5632..00000000000 --- a/Ada95/samples/ncurses.adb +++ /dev/null @@ -1,47 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.m; use ncurses2.m; -with GNAT.OS_Lib; use GNAT.OS_Lib; - -procedure ncurses is -begin - OS_Exit (main); -end ncurses; diff --git a/Ada95/samples/ncurses2-acs_and_scroll.adb b/Ada95/samples/ncurses2-acs_and_scroll.adb deleted file mode 100644 index 00e9afc2607..00000000000 --- a/Ada95/samples/ncurses2-acs_and_scroll.adb +++ /dev/null @@ -1,714 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2009,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.11 $ --- $Date: 2011/03/23 00:33:00 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- Windows and scrolling tester. --- Demonstrate windows - -with Ada.Strings.Fixed; -with Ada.Strings; - -with ncurses2.util; use ncurses2.util; -with ncurses2.genericPuts; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; -with Terminal_Interface.Curses.PutWin; use Terminal_Interface.Curses.PutWin; - -with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; -with Ada.Streams; use Ada.Streams; - -procedure ncurses2.acs_and_scroll is - - Macro_Quit : constant Key_Code := Character'Pos ('Q') mod 16#20#; - Macro_Escape : constant Key_Code := Character'Pos ('[') mod 16#20#; - - Quit : constant Key_Code := CTRL ('Q'); - Escape : constant Key_Code := CTRL ('['); - - Botlines : constant Line_Position := 4; - - type pair is record - y : Line_Position; - x : Column_Position; - end record; - - type Frame; - type FrameA is access Frame; - - f : File_Type; - dumpfile : constant String := "screendump"; - - procedure Outerbox (ul, lr : pair; onoff : Boolean); - function HaveKeyPad (w : Window) return Boolean; - function HaveScroll (w : Window) return Boolean; - procedure newwin_legend (curpw : Window); - procedure transient (curpw : Window; msg : String); - procedure newwin_report (win : Window := Standard_Window); - procedure selectcell (uli : Line_Position; - ulj : Column_Position; - lri : Line_Position; - lrj : Column_Position; - p : out pair; - b : out Boolean); - function getwindow return Window; - procedure newwin_move (win : Window; - dy : Line_Position; - dx : Column_Position); - function delete_framed (fp : FrameA; showit : Boolean) return FrameA; - - -- A linked list - -- I wish there was a standard library linked list. Oh well. - type Frame is record - next, last : FrameA; - do_scroll : Boolean; - do_keypad : Boolean; - wind : Window; - end record; - - current : FrameA; - - c : Key_Code; - - procedure Outerbox (ul, lr : pair; onoff : Boolean) is - begin - if onoff then - -- Note the fix of an obscure bug - -- try making a 1x1 box then enlarging it, the is a blank - -- upper left corner! - Add (Line => ul.y - 1, Column => ul.x - 1, - Ch => ACS_Map (ACS_Upper_Left_Corner)); - Add (Line => ul.y - 1, Column => lr.x + 1, - Ch => ACS_Map (ACS_Upper_Right_Corner)); - Add (Line => lr.y + 1, Column => lr.x + 1, - Ch => ACS_Map (ACS_Lower_Right_Corner)); - Add (Line => lr.y + 1, Column => ul.x - 1, - Ch => ACS_Map (ACS_Lower_Left_Corner)); - - Move_Cursor (Line => ul.y - 1, Column => ul.x); - Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), - Line_Size => Integer (lr.x - ul.x) + 1); - Move_Cursor (Line => ul.y, Column => ul.x - 1); - Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), - Line_Size => Integer (lr.y - ul.y) + 1); - Move_Cursor (Line => lr.y + 1, Column => ul.x); - Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line), - Line_Size => Integer (lr.x - ul.x) + 1); - Move_Cursor (Line => ul.y, Column => lr.x + 1); - Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line), - Line_Size => Integer (lr.y - ul.y) + 1); - else - Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ' '); - Add (Line => ul.y - 1, Column => lr.x + 1, Ch => ' '); - Add (Line => lr.y + 1, Column => lr.x + 1, Ch => ' '); - Add (Line => lr.y + 1, Column => ul.x - 1, Ch => ' '); - - Move_Cursor (Line => ul.y - 1, Column => ul.x); - Horizontal_Line (Line_Symbol => Blank2, - Line_Size => Integer (lr.x - ul.x) + 1); - Move_Cursor (Line => ul.y, Column => ul.x - 1); - Vertical_Line (Line_Symbol => Blank2, - Line_Size => Integer (lr.y - ul.y) + 1); - Move_Cursor (Line => lr.y + 1, Column => ul.x); - Horizontal_Line (Line_Symbol => Blank2, - Line_Size => Integer (lr.x - ul.x) + 1); - Move_Cursor (Line => ul.y, Column => lr.x + 1); - Vertical_Line (Line_Symbol => Blank2, - Line_Size => Integer (lr.y - ul.y) + 1); - end if; - end Outerbox; - - function HaveKeyPad (w : Window) return Boolean is - begin - return Get_KeyPad_Mode (w); - exception - when Curses_Exception => return False; - end HaveKeyPad; - - function HaveScroll (w : Window) return Boolean is - begin - return Scrolling_Allowed (w); - exception - when Curses_Exception => return False; - end HaveScroll; - - procedure newwin_legend (curpw : Window) is - - package p is new genericPuts (200); - use p; - use p.BS; - - type string_a is access String; - - type rrr is record - msg : string_a; - code : Integer range 0 .. 3; - end record; - - legend : constant array (Positive range <>) of rrr := - ( - ( - new String'("^C = create window"), 0 - ), - ( - new String'("^N = next window"), 0 - ), - ( - new String'("^P = previous window"), 0 - ), - ( - new String'("^F = scroll forward"), 0 - ), - ( - new String'("^B = scroll backward"), 0 - ), - ( - new String'("^K = keypad(%s)"), 1 - ), - ( - new String'("^S = scrollok(%s)"), 2 - ), - ( - new String'("^W = save window to file"), 0 - ), - ( - new String'("^R = restore window"), 0 - ), - ( - new String'("^X = resize"), 0 - ), - ( - new String'("^Q%s = exit"), 3 - ) - ); - - buf : Bounded_String; - do_keypad : constant Boolean := HaveKeyPad (curpw); - do_scroll : constant Boolean := HaveScroll (curpw); - - pos : Natural; - - mypair : pair; - - use Ada.Strings.Fixed; - - begin - Move_Cursor (Line => Lines - 4, Column => 0); - for n in legend'Range loop - pos := Ada.Strings.Fixed.Index (Source => legend (n).msg.all, - Pattern => "%s"); - -- buf := (others => ' '); - buf := To_Bounded_String (legend (n).msg.all); - case legend (n).code is - when 0 => null; - when 1 => - if do_keypad then - Replace_Slice (buf, pos, pos + 1, "yes"); - else - Replace_Slice (buf, pos, pos + 1, "no"); - end if; - when 2 => - if do_scroll then - Replace_Slice (buf, pos, pos + 1, "yes"); - else - Replace_Slice (buf, pos, pos + 1, "no"); - end if; - when 3 => - if do_keypad then - Replace_Slice (buf, pos, pos + 1, "/ESC"); - else - Replace_Slice (buf, pos, pos + 1, ""); - end if; - end case; - Get_Cursor_Position (Line => mypair.y, Column => mypair.x); - if Columns < mypair.x + 3 + Column_Position (Length (buf)) then - Add (Ch => newl); - elsif n /= 1 then -- n /= legen'First - Add (Str => ", "); - end if; - myAdd (Str => buf); - end loop; - Clear_To_End_Of_Line; - end newwin_legend; - - procedure transient (curpw : Window; msg : String) is - begin - newwin_legend (curpw); - if msg /= "" then - Add (Line => Lines - 1, Column => 0, Str => msg); - Refresh; - Nap_Milli_Seconds (1000); - end if; - - Move_Cursor (Line => Lines - 1, Column => 0); - - if HaveKeyPad (curpw) then - Add (Str => "Non-arrow"); - else - Add (Str => "All other"); - end if; - Add (Str => " characters are echoed, window should "); - if not HaveScroll (curpw) then - Add (Str => "not "); - end if; - Add (Str => "scroll"); - - Clear_To_End_Of_Line; - end transient; - - procedure newwin_report (win : Window := Standard_Window) is - y : Line_Position; - x : Column_Position; - use Int_IO; - tmp2a : String (1 .. 2); - tmp2b : String (1 .. 2); - begin - if win /= Standard_Window then - transient (win, ""); - end if; - Get_Cursor_Position (win, y, x); - Move_Cursor (Line => Lines - 1, Column => Columns - 17); - Put (tmp2a, Integer (y)); - Put (tmp2b, Integer (x)); - Add (Str => "Y = " & tmp2a & " X = " & tmp2b); - if win /= Standard_Window then - Refresh; - else - Move_Cursor (win, y, x); - end if; - end newwin_report; - - procedure selectcell (uli : Line_Position; - ulj : Column_Position; - lri : Line_Position; - lrj : Column_Position; - p : out pair; - b : out Boolean) is - c : Key_Code; - res : pair; - i : Line_Position := 0; - j : Column_Position := 0; - si : constant Line_Position := lri - uli + 1; - sj : constant Column_Position := lrj - ulj + 1; - begin - res.y := uli; - res.x := ulj; - loop - Move_Cursor (Line => uli + i, Column => ulj + j); - newwin_report; - - c := Getchar; - case c is - when - Macro_Quit | - Macro_Escape => - -- on the same line macro calls interfere due to the # comment - -- this is needed because keypad off affects all windows. - -- try removing the ESCAPE and see what happens. - b := False; - return; - when KEY_UP => - i := i + si - 1; - -- same as i := i - 1 because of Modulus arithmetic, - -- on Line_Position, which is a Natural - -- the C version uses this form too, interestingly. - when KEY_DOWN => - i := i + 1; - when KEY_LEFT => - j := j + sj - 1; - when KEY_RIGHT => - j := j + 1; - when Key_Mouse => - declare - event : Mouse_Event; - y : Line_Position; - x : Column_Position; - Button : Mouse_Button; - State : Button_State; - - begin - event := Get_Mouse; - Get_Event (Event => event, - Y => y, - X => x, - Button => Button, - State => State); - if y > uli and x > ulj then - i := y - uli; - j := x - ulj; - -- same as when others => - res.y := uli + i; - res.x := ulj + j; - p := res; - b := True; - return; - else - Beep; - end if; - end; - when others => - res.y := uli + i; - res.x := ulj + j; - p := res; - b := True; - return; - end case; - i := i mod si; - j := j mod sj; - end loop; - end selectcell; - - function getwindow return Window is - rwindow : Window; - ul, lr : pair; - result : Boolean; - begin - Move_Cursor (Line => 0, Column => 0); - Clear_To_End_Of_Line; - Add (Str => "Use arrows to move cursor, anything else to mark corner 1"); - Refresh; - selectcell (2, 1, Lines - Botlines - 2, Columns - 2, ul, result); - if not result then - return Null_Window; - end if; - Add (Line => ul.y - 1, Column => ul.x - 1, - Ch => ACS_Map (ACS_Upper_Left_Corner)); - Move_Cursor (Line => 0, Column => 0); - Clear_To_End_Of_Line; - Add (Str => "Use arrows to move cursor, anything else to mark corner 2"); - Refresh; - selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, lr, result); - if not result then - return Null_Window; - end if; - - rwindow := Sub_Window (Number_Of_Lines => lr.y - ul.y + 1, - Number_Of_Columns => lr.x - ul.x + 1, - First_Line_Position => ul.y, - First_Column_Position => ul.x); - - Outerbox (ul, lr, True); - Refresh; - - Refresh (rwindow); - - Move_Cursor (Line => 0, Column => 0); - Clear_To_End_Of_Line; - return rwindow; - end getwindow; - - procedure newwin_move (win : Window; - dy : Line_Position; - dx : Column_Position) is - cur_y, max_y : Line_Position; - cur_x, max_x : Column_Position; - begin - Get_Cursor_Position (win, cur_y, cur_x); - Get_Size (win, max_y, max_x); - cur_x := Column_Position'Min (Column_Position'Max (cur_x + dx, 0), - max_x - 1); - cur_y := Line_Position'Min (Line_Position'Max (cur_y + dy, 0), - max_y - 1); - - Move_Cursor (win, Line => cur_y, Column => cur_x); - end newwin_move; - - function delete_framed (fp : FrameA; showit : Boolean) return FrameA is - np : FrameA; - begin - fp.all.last.all.next := fp.all.next; - fp.all.next.all.last := fp.all.last; - - if showit then - Erase (fp.all.wind); - Refresh (fp.all.wind); - end if; - Delete (fp.all.wind); - - if fp = fp.all.next then - np := null; - else - np := fp.all.next; - end if; - -- TODO free(fp); - return np; - end delete_framed; - - Mask : Event_Mask := No_Events; - Mask2 : Event_Mask; - - usescr : Window; - -begin - if Has_Mouse then - Register_Reportable_Event ( - Button => Left, - State => Clicked, - Mask => Mask); - Mask2 := Start_Mouse (Mask); - end if; - c := CTRL ('C'); - Set_Raw_Mode (SwitchOn => True); - loop - transient (Standard_Window, ""); - case c is - when Character'Pos ('c') mod 16#20# => -- Ctrl('c') - declare - neww : constant FrameA := new Frame'(null, null, - False, False, - Null_Window); - begin - neww.all.wind := getwindow; - if neww.all.wind = Null_Window then - exit; - -- was goto breakout; ha ha ha - else - - if current = null then - neww.all.next := neww; - neww.all.last := neww; - else - neww.all.next := current.all.next; - neww.all.last := current; - neww.all.last.all.next := neww; - neww.all.next.all.last := neww; - end if; - current := neww; - - Set_KeyPad_Mode (current.all.wind, True); - current.all.do_keypad := HaveKeyPad (current.all.wind); - current.all.do_scroll := HaveScroll (current.all.wind); - end if; - end; - when Character'Pos ('N') mod 16#20# => -- Ctrl('N') - if current /= null then - current := current.all.next; - end if; - when Character'Pos ('P') mod 16#20# => -- Ctrl('P') - if current /= null then - current := current.all.last; - end if; - when Character'Pos ('F') mod 16#20# => -- Ctrl('F') - if current /= null and then HaveScroll (current.all.wind) then - Scroll (current.all.wind, 1); - end if; - when Character'Pos ('B') mod 16#20# => -- Ctrl('B') - if current /= null and then HaveScroll (current.all.wind) then - -- The C version of Scroll may return ERR which is ignored - -- we need to avoid the exception - -- with the 'and HaveScroll(current.wind)' - Scroll (current.all.wind, -1); - end if; - when Character'Pos ('K') mod 16#20# => -- Ctrl('K') - if current /= null then - current.all.do_keypad := not current.all.do_keypad; - Set_KeyPad_Mode (current.all.wind, current.all.do_keypad); - end if; - when Character'Pos ('S') mod 16#20# => -- Ctrl('S') - if current /= null then - current.all.do_scroll := not current.all.do_scroll; - Allow_Scrolling (current.all.wind, current.all.do_scroll); - end if; - when Character'Pos ('W') mod 16#20# => -- Ctrl('W') - if current /= current.all.next then - Create (f, Name => dumpfile); -- TODO error checking - if not Is_Open (f) then - raise Curses_Exception; - end if; - Put_Window (current.all.wind, f); - Close (f); - current := delete_framed (current, True); - end if; - when Character'Pos ('R') mod 16#20# => -- Ctrl('R') - declare - neww : FrameA := new Frame'(null, null, False, False, - Null_Window); - begin - Open (f, Mode => In_File, Name => dumpfile); - neww := new Frame'(null, null, False, False, Null_Window); - - neww.all.next := current.all.next; - neww.all.last := current; - neww.all.last.all.next := neww; - neww.all.next.all.last := neww; - - neww.all.wind := Get_Window (f); - Close (f); - - Refresh (neww.all.wind); - end; - when Character'Pos ('X') mod 16#20# => -- Ctrl('X') - if current /= null then - declare - tmp, ul, lr : pair; - mx : Column_Position; - my : Line_Position; - tmpbool : Boolean; - begin - Move_Cursor (Line => 0, Column => 0); - Clear_To_End_Of_Line; - Add (Str => "Use arrows to move cursor, anything else " & - "to mark new corner"); - Refresh; - - Get_Window_Position (current.all.wind, ul.y, ul.x); - - selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, - tmp, tmpbool); - if not tmpbool then - -- the C version had a goto. I refuse gotos. - Beep; - else - Get_Size (current.all.wind, lr.y, lr.x); - lr.y := lr.y + ul.y - 1; - lr.x := lr.x + ul.x - 1; - Outerbox (ul, lr, False); - Refresh_Without_Update; - - Get_Size (current.all.wind, my, mx); - if my > tmp.y - ul.y then - Get_Cursor_Position (current.all.wind, lr.y, lr.x); - Move_Cursor (current.all.wind, tmp.y - ul.y + 1, 0); - Clear_To_End_Of_Screen (current.all.wind); - Move_Cursor (current.all.wind, lr.y, lr.x); - end if; - if mx > tmp.x - ul.x then - for i in 0 .. my - 1 loop - Move_Cursor (current.all.wind, i, tmp.x - ul.x + 1); - Clear_To_End_Of_Line (current.all.wind); - end loop; - end if; - Refresh_Without_Update (current.all.wind); - - lr := tmp; - -- The C version passes invalid args to resize - -- which returns an ERR. For Ada we avoid the exception. - if lr.y /= ul.y and lr.x /= ul.x then - Resize (current.all.wind, lr.y - ul.y + 0, - lr.x - ul.x + 0); - end if; - - Get_Window_Position (current.all.wind, ul.y, ul.x); - Get_Size (current.all.wind, lr.y, lr.x); - lr.y := lr.y + ul.y - 1; - lr.x := lr.x + ul.x - 1; - Outerbox (ul, lr, True); - Refresh_Without_Update; - - Refresh_Without_Update (current.all.wind); - Move_Cursor (Line => 0, Column => 0); - Clear_To_End_Of_Line; - Update_Screen; - end if; - end; - end if; - when Key_F10 => - declare tmp : pair; tmpbool : Boolean; - begin - -- undocumented --- use this to test area clears - selectcell (0, 0, Lines - 1, Columns - 1, tmp, tmpbool); - Clear_To_End_Of_Screen; - Refresh; - end; - when Key_Cursor_Up => - newwin_move (current.all.wind, -1, 0); - when Key_Cursor_Down => - newwin_move (current.all.wind, 1, 0); - when Key_Cursor_Left => - newwin_move (current.all.wind, 0, -1); - when Key_Cursor_Right => - newwin_move (current.all.wind, 0, 1); - when Key_Backspace | Key_Delete_Char => - declare - y : Line_Position; - x : Column_Position; - tmp : Line_Position; - begin - Get_Cursor_Position (current.all.wind, y, x); - -- x := x - 1; - -- I got tricked by the -1 = Max_Natural - 1 result - -- y := y - 1; - if not (x = 0 and y = 0) then - if x = 0 then - y := y - 1; - Get_Size (current.all.wind, tmp, x); - end if; - x := x - 1; - Delete_Character (current.all.wind, y, x); - end if; - end; - when others => - -- TODO c = '\r' ? - if current /= null then - declare - begin - Add (current.all.wind, Ch => Code_To_Char (c)); - exception - when Curses_Exception => null; - -- this happens if we are at the - -- lower right of a window and add a character. - end; - else - Beep; - end if; - end case; - newwin_report (current.all.wind); - if current /= null then - usescr := current.all.wind; - else - usescr := Standard_Window; - end if; - Refresh (usescr); - c := Getchar (usescr); - exit when c = Quit or (c = Escape and HaveKeyPad (usescr)); - -- TODO when does c = ERR happen? - end loop; - - -- TODO while current /= null loop - -- current := delete_framed(current, False); - -- end loop; - - Allow_Scrolling (Mode => True); - - End_Mouse (Mask2); - Set_Raw_Mode (SwitchOn => True); - Erase; - End_Windows; - -end ncurses2.acs_and_scroll; diff --git a/Ada95/samples/ncurses2-acs_and_scroll.ads b/Ada95/samples/ncurses2-acs_and_scroll.ads deleted file mode 100644 index 79e4862af0f..00000000000 --- a/Ada95/samples/ncurses2-acs_and_scroll.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.acs_and_scroll; diff --git a/Ada95/samples/ncurses2-acs_display.adb b/Ada95/samples/ncurses2-acs_display.adb deleted file mode 100644 index a71c61d5daf..00000000000 --- a/Ada95/samples/ncurses2-acs_display.adb +++ /dev/null @@ -1,235 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.6 $ --- $Date: 2008/07/26 18:47:34 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with ncurses2.genericPuts; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -with Ada.Strings.Unbounded; -with Ada.Strings.Fixed; - -procedure ncurses2.acs_display is - use Int_IO; - - procedure show_upper_chars (first : Integer); - function show_1_acs (N : Integer; - name : String; - code : Attributed_Character) - return Integer; - procedure show_acs_chars; - - procedure show_upper_chars (first : Integer) is - C1 : constant Boolean := (first = 128); - last : constant Integer := first + 31; - package p is new ncurses2.genericPuts (200); - use p; - use p.BS; - use Ada.Strings.Unbounded; - - tmpa : Unbounded_String; - tmpb : BS.Bounded_String; - begin - Erase; - Switch_Character_Attribute - (Attr => (Bold_Character => True, others => False)); - Move_Cursor (Line => 0, Column => 20); - tmpa := To_Unbounded_String ("Display of "); - if C1 then - tmpa := tmpa & "C1"; - else - tmpa := tmpa & "GR"; - end if; - tmpa := tmpa & " Character Codes "; - myPut (tmpb, first); - Append (tmpa, To_String (tmpb)); - Append (tmpa, " to "); - myPut (tmpb, last); - Append (tmpa, To_String (tmpb)); - Add (Str => To_String (tmpa)); - Switch_Character_Attribute - (On => False, - Attr => (Bold_Character => True, others => False)); - Refresh; - - for code in first .. last loop - declare - row : constant Line_Position - := Line_Position (4 + ((code - first) mod 16)); - col : constant Column_Position - := Column_Position (((code - first) / 16) * - Integer (Columns) / 2); - tmp3 : String (1 .. 3); - tmpx : String (1 .. Integer (Columns / 4)); - reply : Key_Code; - begin - Put (tmp3, code); - myPut (tmpb, code, 16); - tmpa := To_Unbounded_String (tmp3 & " (" & To_String (tmpb) & ')'); - - Ada.Strings.Fixed.Move (To_String (tmpa), tmpx, - Justify => Ada.Strings.Right); - Add (Line => row, Column => col, - Str => tmpx & ' ' & ':' & ' '); - if C1 then - Set_NoDelay_Mode (Mode => True); - end if; - Add_With_Immediate_Echo (Ch => Code_To_Char (Key_Code (code))); - -- TODO check this - if C1 then - reply := Getchar; - while reply /= Key_None loop - Add (Ch => Code_To_Char (reply)); - Nap_Milli_Seconds (10); - reply := Getchar; - end loop; - Set_NoDelay_Mode (Mode => False); - end if; - end; - end loop; - end show_upper_chars; - - function show_1_acs (N : Integer; - name : String; - code : Attributed_Character) - return Integer is - height : constant Integer := 16; - row : constant Line_Position := Line_Position (4 + (N mod height)); - col : constant Column_Position := Column_Position ((N / height) * - Integer (Columns) / 2); - tmpx : String (1 .. Integer (Columns) / 3); - begin - Ada.Strings.Fixed.Move (name, tmpx, - Justify => Ada.Strings.Right, - Drop => Ada.Strings.Left); - Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' '); - -- we need more room than C because our identifiers are longer - -- 22 chars actually - Add (Ch => code); - return N + 1; - end show_1_acs; - - procedure show_acs_chars is - n : Integer; - begin - Erase; - Switch_Character_Attribute - (Attr => (Bold_Character => True, others => False)); - Add (Line => 0, Column => 20, - Str => "Display of the ACS Character Set"); - Switch_Character_Attribute (On => False, - Attr => (Bold_Character => True, - others => False)); - Refresh; - - -- the following is useful to generate the below - -- grep '^[ ]*ACS_' ../src/terminal_interface-curses.ads | - -- awk '{print "n := show_1_acs(n, \""$1"\", ACS_Map("$1"));"}' - - n := show_1_acs (0, "ACS_Upper_Left_Corner", - ACS_Map (ACS_Upper_Left_Corner)); - n := show_1_acs (n, "ACS_Lower_Left_Corner", - ACS_Map (ACS_Lower_Left_Corner)); - n := show_1_acs (n, "ACS_Upper_Right_Corner", - ACS_Map (ACS_Upper_Right_Corner)); - n := show_1_acs (n, "ACS_Lower_Right_Corner", - ACS_Map (ACS_Lower_Right_Corner)); - n := show_1_acs (n, "ACS_Left_Tee", ACS_Map (ACS_Left_Tee)); - n := show_1_acs (n, "ACS_Right_Tee", ACS_Map (ACS_Right_Tee)); - n := show_1_acs (n, "ACS_Bottom_Tee", ACS_Map (ACS_Bottom_Tee)); - n := show_1_acs (n, "ACS_Top_Tee", ACS_Map (ACS_Top_Tee)); - n := show_1_acs (n, "ACS_Horizontal_Line", - ACS_Map (ACS_Horizontal_Line)); - n := show_1_acs (n, "ACS_Vertical_Line", ACS_Map (ACS_Vertical_Line)); - n := show_1_acs (n, "ACS_Plus_Symbol", ACS_Map (ACS_Plus_Symbol)); - n := show_1_acs (n, "ACS_Scan_Line_1", ACS_Map (ACS_Scan_Line_1)); - n := show_1_acs (n, "ACS_Scan_Line_9", ACS_Map (ACS_Scan_Line_9)); - n := show_1_acs (n, "ACS_Diamond", ACS_Map (ACS_Diamond)); - n := show_1_acs (n, "ACS_Checker_Board", ACS_Map (ACS_Checker_Board)); - n := show_1_acs (n, "ACS_Degree", ACS_Map (ACS_Degree)); - n := show_1_acs (n, "ACS_Plus_Minus", ACS_Map (ACS_Plus_Minus)); - n := show_1_acs (n, "ACS_Bullet", ACS_Map (ACS_Bullet)); - n := show_1_acs (n, "ACS_Left_Arrow", ACS_Map (ACS_Left_Arrow)); - n := show_1_acs (n, "ACS_Right_Arrow", ACS_Map (ACS_Right_Arrow)); - n := show_1_acs (n, "ACS_Down_Arrow", ACS_Map (ACS_Down_Arrow)); - n := show_1_acs (n, "ACS_Up_Arrow", ACS_Map (ACS_Up_Arrow)); - n := show_1_acs (n, "ACS_Board_Of_Squares", - ACS_Map (ACS_Board_Of_Squares)); - n := show_1_acs (n, "ACS_Lantern", ACS_Map (ACS_Lantern)); - n := show_1_acs (n, "ACS_Solid_Block", ACS_Map (ACS_Solid_Block)); - n := show_1_acs (n, "ACS_Scan_Line_3", ACS_Map (ACS_Scan_Line_3)); - n := show_1_acs (n, "ACS_Scan_Line_7", ACS_Map (ACS_Scan_Line_7)); - n := show_1_acs (n, "ACS_Less_Or_Equal", ACS_Map (ACS_Less_Or_Equal)); - n := show_1_acs (n, "ACS_Greater_Or_Equal", - ACS_Map (ACS_Greater_Or_Equal)); - n := show_1_acs (n, "ACS_PI", ACS_Map (ACS_PI)); - n := show_1_acs (n, "ACS_Not_Equal", ACS_Map (ACS_Not_Equal)); - n := show_1_acs (n, "ACS_Sterling", ACS_Map (ACS_Sterling)); - - if n = 0 then - raise Constraint_Error; - end if; - end show_acs_chars; - - c1 : Key_Code; - c : Character := 'a'; -begin - loop - case c is - when 'a' => - show_acs_chars; - when '0' | '1' | '2' | '3' => - show_upper_chars (ctoi (c) * 32 + 128); - when others => - null; - end case; - Add (Line => Lines - 3, Column => 0, - Str => "Note: ANSI terminals may not display C1 characters."); - Add (Line => Lines - 2, Column => 0, - Str => "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit"); - Refresh; - c1 := Getchar; - c := Code_To_Char (c1); - exit when c = 'q' or c = 'x'; - end loop; - Pause; - Erase; - End_Windows; -end ncurses2.acs_display; diff --git a/Ada95/samples/ncurses2-acs_display.ads b/Ada95/samples/ncurses2-acs_display.ads deleted file mode 100644 index 4e616c5e144..00000000000 --- a/Ada95/samples/ncurses2-acs_display.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.acs_display; diff --git a/Ada95/samples/ncurses2-attr_test.adb b/Ada95/samples/ncurses2-attr_test.adb deleted file mode 100644 index 66271042c0b..00000000000 --- a/Ada95/samples/ncurses2-attr_test.adb +++ /dev/null @@ -1,362 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2007,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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.9 $ --- $Date: 2008/07/26 18:47:26 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Terminfo; -use Terminal_Interface.Curses.Terminfo; -with Ada.Characters.Handling; -with Ada.Strings.Fixed; - -procedure ncurses2.attr_test is - - function subset (super, sub : Character_Attribute_Set) return Boolean; - function intersect (b, a : Character_Attribute_Set) return Boolean; - function has_A_COLOR (attr : Attributed_Character) return Boolean; - function show_attr (row : Line_Position; - skip : Natural; - attr : Character_Attribute_Set; - name : String; - once : Boolean) return Line_Position; - procedure attr_getc (skip : in out Integer; - fg, bg : in out Color_Number; - result : out Boolean); - - function subset (super, sub : Character_Attribute_Set) return Boolean is - begin - if - (super.Stand_Out or not sub.Stand_Out) and - (super.Under_Line or not sub.Under_Line) and - (super.Reverse_Video or not sub.Reverse_Video) and - (super.Blink or not sub.Blink) and - (super.Dim_Character or not sub.Dim_Character) and - (super.Bold_Character or not sub.Bold_Character) and - (super.Alternate_Character_Set or not sub.Alternate_Character_Set) and - (super.Invisible_Character or not sub.Invisible_Character) -- and --- (super.Protected_Character or not sub.Protected_Character) and --- (super.Horizontal or not sub.Horizontal) and --- (super.Left or not sub.Left) and --- (super.Low or not sub.Low) and --- (super.Right or not sub.Right) and --- (super.Top or not sub.Top) and --- (super.Vertical or not sub.Vertical) - then - return True; - else - return False; - end if; - end subset; - - function intersect (b, a : Character_Attribute_Set) return Boolean is - begin - if - (a.Stand_Out and b.Stand_Out) or - (a.Under_Line and b.Under_Line) or - (a.Reverse_Video and b.Reverse_Video) or - (a.Blink and b.Blink) or - (a.Dim_Character and b.Dim_Character) or - (a.Bold_Character and b.Bold_Character) or - (a.Alternate_Character_Set and b.Alternate_Character_Set) or - (a.Invisible_Character and b.Invisible_Character) -- or --- (a.Protected_Character and b.Protected_Character) or --- (a.Horizontal and b.Horizontal) or --- (a.Left and b.Left) or --- (a.Low and b.Low) or --- (a.Right and b.Right) or --- (a.Top and b.Top) or --- (a.Vertical and b.Vertical) - then - return True; - else - return False; - end if; - end intersect; - - function has_A_COLOR (attr : Attributed_Character) return Boolean is - begin - if attr.Color /= Color_Pair (0) then - return True; - else - return False; - end if; - end has_A_COLOR; - - -- Print some text with attributes. - function show_attr (row : Line_Position; - skip : Natural; - attr : Character_Attribute_Set; - name : String; - once : Boolean) return Line_Position is - - function make_record (n : Integer) return Character_Attribute_Set; - function make_record (n : Integer) return Character_Attribute_Set is - -- unsupported means true - a : Character_Attribute_Set := (others => False); - m : Integer; - rest : Integer; - begin - -- ncv is a bitmap with these fields - -- A_STANDOUT, - -- A_UNDERLINE, - -- A_REVERSE, - -- A_BLINK, - -- A_DIM, - -- A_BOLD, - -- A_INVIS, - -- A_PROTECT, - -- A_ALTCHARSET - -- It means no_color_video, - -- video attributes that can't be used with colors - -- see man terminfo.5 - m := n mod 2; - rest := n / 2; - if 1 = m then - a.Stand_Out := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Under_Line := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Reverse_Video := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Blink := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Bold_Character := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Invisible_Character := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Protected_Character := True; - end if; - m := rest mod 2; - rest := rest / 2; - if 1 = m then - a.Alternate_Character_Set := True; - end if; - - return a; - end make_record; - - ncv : constant Integer := Get_Number ("ncv"); - - begin - Move_Cursor (Line => row, Column => 8); - Add (Str => name & " mode:"); - Move_Cursor (Line => row, Column => 24); - Add (Ch => '|'); - if skip /= 0 then - -- printw("%*s", skip, " ") - Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); - end if; - if once then - Switch_Character_Attribute (Attr => attr); - else - Set_Character_Attributes (Attr => attr); - end if; - Add (Str => "abcde fghij klmno pqrst uvwxy z"); - if once then - Switch_Character_Attribute (Attr => attr, On => False); - end if; - if skip /= 0 then - Add (Str => Ada.Strings.Fixed."*" (skip, ' ')); - end if; - Add (Ch => '|'); - if attr /= Normal_Video then - declare begin - if not subset (super => Supported_Attributes, sub => attr) then - Add (Str => " (N/A)"); - elsif ncv > 0 and has_A_COLOR (Get_Background) then - declare - Color_Supported_Attributes : - constant Character_Attribute_Set := make_record (ncv); - begin - if intersect (Color_Supported_Attributes, attr) then - Add (Str => " (NCV) "); - end if; - end; - end if; - end; - end if; - return row + 2; - end show_attr; - - procedure attr_getc (skip : in out Integer; - fg, bg : in out Color_Number; - result : out Boolean) is - ch : constant Key_Code := Getchar; - nc : constant Color_Number := Color_Number (Number_Of_Colors); - begin - result := True; - if Ada.Characters.Handling.Is_Digit (Character'Val (ch)) then - skip := ctoi (Code_To_Char (ch)); - elsif ch = CTRL ('L') then - Touch; - Touch (Current_Window); - Refresh; - elsif Has_Colors then - case ch is - -- Note the mathematical elegance compared to the C version. - when Character'Pos ('f') => fg := (fg + 1) mod nc; - when Character'Pos ('F') => fg := (fg - 1) mod nc; - when Character'Pos ('b') => bg := (bg + 1) mod nc; - when Character'Pos ('B') => bg := (bg - 1) mod nc; - when others => - result := False; - end case; - else - result := False; - end if; - end attr_getc; - - -- pairs could be defined as array ( Color_Number(0) .. colors - 1) of - -- array (Color_Number(0).. colors - 1) of Boolean; - pairs : array (Color_Pair'Range) of Boolean := (others => False); - fg, bg : Color_Number := Black; -- = 0; - xmc : constant Integer := Get_Number ("xmc"); - skip : Integer := xmc; - n : Integer; - - use Int_IO; - -begin - pairs (0) := True; - - if skip < 0 then - skip := 0; - end if; - n := skip; - - loop - declare - row : Line_Position := 2; - normal : Attributed_Character := Blank2; - -- ??? - begin - -- row := 2; -- weird, row is set to 0 without this. - -- TODO delete the above line, it was a gdb quirk that confused me - if Has_Colors then - declare pair : constant Color_Pair := - Color_Pair (fg * Color_Number (Number_Of_Colors) + bg); - begin - -- Go though each color pair. Assume that the number of - -- Redefinable_Color_Pairs is 8*8 with predefined Colors 0..7 - if not pairs (pair) then - Init_Pair (pair, fg, bg); - pairs (pair) := True; - end if; - normal.Color := pair; - end; - end if; - Set_Background (Ch => normal); - Erase; - - Add (Line => 0, Column => 20, - Str => "Character attribute test display"); - - row := show_attr (row, n, (Stand_Out => True, others => False), - "STANDOUT", True); - row := show_attr (row, n, (Reverse_Video => True, others => False), - "REVERSE", True); - row := show_attr (row, n, (Bold_Character => True, others => False), - "BOLD", True); - row := show_attr (row, n, (Under_Line => True, others => False), - "UNDERLINE", True); - row := show_attr (row, n, (Dim_Character => True, others => False), - "DIM", True); - row := show_attr (row, n, (Blink => True, others => False), - "BLINK", True); --- row := show_attr (row, n, (Protected_Character => True, --- others => False), "PROTECT", True); - row := show_attr (row, n, (Invisible_Character => True, - others => False), "INVISIBLE", True); - row := show_attr (row, n, Normal_Video, "NORMAL", False); - - Move_Cursor (Line => row, Column => 8); - if xmc > -1 then - Add (Str => "This terminal does have the magic-cookie glitch"); - else - Add (Str => "This terminal does not have the magic-cookie glitch"); - end if; - Move_Cursor (Line => row + 1, Column => 8); - Add (Str => "Enter a digit to set gaps on each side of " & - "displayed attributes"); - Move_Cursor (Line => row + 2, Column => 8); - Add (Str => "^L = repaint"); - if Has_Colors then - declare tmp1 : String (1 .. 1); - begin - Add (Str => ". f/F/b/F toggle colors ("); - Put (tmp1, Integer (fg)); - Add (Str => tmp1); - Add (Ch => '/'); - Put (tmp1, Integer (bg)); - Add (Str => tmp1); - Add (Ch => ')'); - end; - end if; - Refresh; - end; - - declare result : Boolean; begin - attr_getc (n, fg, bg, result); - exit when not result; - end; - end loop; - - Set_Background (Ch => Blank2); - Erase; - End_Windows; -end ncurses2.attr_test; diff --git a/Ada95/samples/ncurses2-attr_test.ads b/Ada95/samples/ncurses2-attr_test.ads deleted file mode 100644 index 51c51435eab..00000000000 --- a/Ada95/samples/ncurses2-attr_test.ads +++ /dev/null @@ -1,42 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.2 $ --- $Date: 2006/06/25 14:24:40 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.attr_test; diff --git a/Ada95/samples/ncurses2-color_edit.adb b/Ada95/samples/ncurses2-color_edit.adb deleted file mode 100644 index 098f98d837b..00000000000 --- a/Ada95/samples/ncurses2-color_edit.adb +++ /dev/null @@ -1,259 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2006,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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.6 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with ncurses2.genericPuts; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -procedure ncurses2.color_edit is - use Int_IO; - - type RGB_Enum is (Redx, Greenx, Bluex); - - procedure change_color (current : Color_Number; - field : RGB_Enum; - value : RGB_Value; - usebase : Boolean); - - procedure change_color (current : Color_Number; - field : RGB_Enum; - value : RGB_Value; - usebase : Boolean) is - red, green, blue : RGB_Value; - begin - if usebase then - Color_Content (current, red, green, blue); - else - red := 0; - green := 0; - blue := 0; - end if; - - case field is - when Redx => red := red + value; - when Greenx => green := green + value; - when Bluex => blue := blue + value; - end case; - - declare - begin - Init_Color (current, red, green, blue); - exception - when Curses_Exception => Beep; - end; - - end change_color; - - package x is new ncurses2.genericPuts (100); use x; - - tmpb : x.BS.Bounded_String; - - tmp4 : String (1 .. 4); - tmp6 : String (1 .. 6); - tmp8 : String (1 .. 8); - -- This would be easier if Ada had a Bounded_String - -- defined as a class instead of the inferior generic package, - -- then I could define Put, Add, and Get for them. Blech. - value : RGB_Value := 0; - red, green, blue : RGB_Value; - max_colors : constant Natural := Number_Of_Colors; - current : Color_Number := 0; - field : RGB_Enum := Redx; - this_c : Key_Code := 0; -begin - Refresh; - - for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop - Init_Pair (Color_Pair (i), White, i); - end loop; - - Move_Cursor (Line => Lines - 2, Column => 0); - Add (Str => "Number: "); - myPut (tmpb, Integer (value)); - myAdd (Str => tmpb); - - loop - - Switch_Character_Attribute (On => False, - Attr => (Bold_Character => True, - others => False)); - Add (Line => 0, Column => 20, Str => "Color RGB Value Editing"); - - Switch_Character_Attribute (On => False, - Attr => (Bold_Character => True, - others => False)); - - for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop - Move_Cursor (Line => 2 + Line_Position (i), Column => 0); - if current = i then - Add (Ch => '>'); - else - Add (Ch => ' '); - end if; - -- TODO if i <= color_names'Max then - Put (tmp8, Integer (i)); - Set_Character_Attributes (Color => Color_Pair (i)); - Add (Str => " "); - Set_Character_Attributes; - - Refresh; - - Color_Content (i, red, green, blue); - Add (Str => " R = "); - if current = i and field = Redx then - Switch_Character_Attribute (On => True, - Attr => (Stand_Out => True, - others => False)); - end if; - Put (tmp4, Integer (red)); - Add (Str => tmp4); - if current = i and field = Redx then - Set_Character_Attributes; - end if; - Add (Str => " G = "); - if current = i and field = Greenx then - Switch_Character_Attribute (On => True, - Attr => (Stand_Out => True, - others => False)); - end if; - Put (tmp4, Integer (green)); - Add (Str => tmp4); - if current = i and field = Greenx then - Set_Character_Attributes; - end if; - Add (Str => " B = "); - if current = i and field = Bluex then - Switch_Character_Attribute (On => True, - Attr => (Stand_Out => True, - others => False)); - end if; - Put (tmp4, Integer (blue)); - Add (Str => tmp4); - if current = i and field = Bluex then - Set_Character_Attributes; - end if; - Set_Character_Attributes; - Add (Ch => ')'); - end loop; - Add (Line => Line_Position (Number_Of_Colors + 3), Column => 0, - Str => "Use up/down to select a color, left/right to change " & - "fields."); - Add (Line => Line_Position (Number_Of_Colors + 4), Column => 0, - Str => "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); - - Move_Cursor (Line => 2 + Line_Position (current), Column => 0); - - this_c := Getchar; - if Is_Digit (this_c) then - value := 0; - end if; - - case this_c is - when KEY_UP => - current := (current - 1) mod Color_Number (max_colors); - when KEY_DOWN => - current := (current + 1) mod Color_Number (max_colors); - when KEY_RIGHT => - field := RGB_Enum'Val ((RGB_Enum'Pos (field) + 1) mod 3); - when KEY_LEFT => - field := RGB_Enum'Val ((RGB_Enum'Pos (field) - 1) mod 3); - when - Character'Pos ('0') | - Character'Pos ('1') | - Character'Pos ('2') | - Character'Pos ('3') | - Character'Pos ('4') | - Character'Pos ('5') | - Character'Pos ('6') | - Character'Pos ('7') | - Character'Pos ('8') | - Character'Pos ('9') => - value := value * 10 + RGB_Value (ctoi (Code_To_Char (this_c))); - - when Character'Pos ('+') => - change_color (current, field, value, True); - - when Character'Pos ('-') => - change_color (current, field, -value, True); - - when Character'Pos ('=') => - change_color (current, field, value, False); - - when Character'Pos ('?') => - Erase; - P (" RGB Value Editing Help"); - P (""); - P ("You are in the RGB value editor. Use the arrow keys to " & - "select one of"); - P ("the fields in one of the RGB triples of the current colors;" & - " the one"); - P ("currently selected will be reverse-video highlighted."); - P (""); - P ("To change a field, enter the digits of the new value; they" & - " are echoed"); - P ("as entered. Finish by typing `='. The change will take" & - " effect instantly."); - P ("To increment or decrement a value, use the same procedure," & - " but finish"); - P ("with a `+' or `-'."); - P (""); - P ("To quit, do `x' or 'q'"); - - Pause; - Erase; - when Character'Pos ('q') | - Character'Pos ('x') => - null; - when others => - Beep; - end case; - Move_Cursor (Line => Lines - 2, Column => 0); - Put (tmp6, Integer (value)); - Add (Str => "Number: " & tmp6); - - Clear_To_End_Of_Line; - exit when this_c = Character'Pos ('x') or - this_c = Character'Pos ('q'); - end loop; - - Erase; - End_Windows; -end ncurses2.color_edit; diff --git a/Ada95/samples/ncurses2-color_edit.ads b/Ada95/samples/ncurses2-color_edit.ads deleted file mode 100644 index 3e8e392dfe8..00000000000 --- a/Ada95/samples/ncurses2-color_edit.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.color_edit; diff --git a/Ada95/samples/ncurses2-color_test.adb b/Ada95/samples/ncurses2-color_test.adb deleted file mode 100644 index c8f6c837ae1..00000000000 --- a/Ada95/samples/ncurses2-color_test.adb +++ /dev/null @@ -1,163 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.3 $ --- $Date: 2008/07/26 18:47:17 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; - -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Ada.Strings.Fixed; - -procedure ncurses2.color_test is - use Int_IO; - - procedure show_color_name (y, x : Integer; color : Integer); - - color_names : constant array (0 .. 15) of String (1 .. 7) := - ( - "black ", - "red ", - "green ", - "yellow ", - "blue ", - "magenta", - "cyan ", - "white ", - "BLACK ", - "RED ", - "GREEN ", - "YELLOW ", - "BLUE ", - "MAGENTA", - "CYAN ", - "WHITE " - ); - - procedure show_color_name (y, x : Integer; color : Integer) is - tmp5 : String (1 .. 5); - begin - if Number_Of_Colors > 8 then - - Put (tmp5, color); - Add (Line => Line_Position (y), Column => Column_Position (x), - Str => tmp5); - else - Add (Line => Line_Position (y), Column => Column_Position (x), - Str => color_names (color)); - end if; - end show_color_name; - - top, width : Integer; - hello : String (1 .. 5); - -- tmp3 : String (1 .. 3); - -- tmp2 : String (1 .. 2); - -begin - Refresh; - Add (Str => "There are "); - -- Put(tmp3, Number_Of_Colors*Number_Of_Colors); - Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors * - Number_Of_Colors), - Ada.Strings.Left)); - Add (Str => " color pairs"); - Add (Ch => newl); - - if Number_Of_Colors > 8 then - width := 4; - else - width := 8; - end if; - - if Number_Of_Colors > 8 then - hello := "Test "; - else - hello := "Hello"; - end if; - - for Bright in Boolean loop - if Number_Of_Colors > 8 then - top := 0; - else - top := Boolean'Pos (Bright) * (Number_Of_Colors + 3); - end if; - Clear_To_End_Of_Screen; - Move_Cursor (Line => Line_Position (top) + 1, Column => 0); - -- Put(tmp2, Number_Of_Colors); - Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), - Ada.Strings.Left)); - Add (Ch => 'x'); - Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors), - Ada.Strings.Left)); - Add (Str => " matrix of foreground/background colors, bright *"); - if Bright then - Add (Str => "on"); - else - Add (Str => "off"); - end if; - Add (Ch => '*'); - - for i in 0 .. Number_Of_Colors - 1 loop - show_color_name (top + 2, (i + 1) * width, i); - end loop; - for i in 0 .. Number_Of_Colors - 1 loop - show_color_name (top + 3 + i, 0, i); - end loop; - for i in 1 .. Number_Of_Color_Pairs - 1 loop - Init_Pair (Color_Pair (i), Color_Number (i mod Number_Of_Colors), - Color_Number (i / Number_Of_Colors)); - -- attron((attr_t) COLOR_PAIR(i)) -- Huh? - Set_Color (Pair => Color_Pair (i)); - if Bright then - Switch_Character_Attribute (Attr => (Bold_Character => True, - others => False)); - end if; - Add (Line => Line_Position (top + 3 + (i / Number_Of_Colors)), - Column => Column_Position ((i mod Number_Of_Colors + 1) * - width), - Str => hello); - Set_Character_Attributes; - end loop; - if Number_Of_Colors > 8 or Bright then - Pause; - end if; - end loop; - - Erase; - End_Windows; -end ncurses2.color_test; diff --git a/Ada95/samples/ncurses2-color_test.ads b/Ada95/samples/ncurses2-color_test.ads deleted file mode 100644 index 6e663181a9b..00000000000 --- a/Ada95/samples/ncurses2-color_test.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.color_test; diff --git a/Ada95/samples/ncurses2-demo_forms.adb b/Ada95/samples/ncurses2-demo_forms.adb deleted file mode 100644 index 1afbb88bf3f..00000000000 --- a/Ada95/samples/ncurses2-demo_forms.adb +++ /dev/null @@ -1,497 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2006,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.6 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; -with Terminal_Interface.Curses.Forms.Field_User_Data; -with Ada.Characters.Handling; -with Ada.Strings; -with Ada.Strings.Bounded; - -procedure ncurses2.demo_forms is - package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (80); - - type myptr is access Integer; - - -- The C version stores a pointer in the userptr and - -- converts it into a long integer. - -- The correct, but inconvenient way to do it is to use a - -- pointer to long and keep the pointer constant. - -- It just adds one memory piece to allocate and deallocate (not done here) - - package StringData is new - Terminal_Interface.Curses.Forms.Field_User_Data (Integer, myptr); - - function edit_secure (me : Field; c_in : Key_Code) return Key_Code; - function form_virtualize (f : Form; w : Window) return Key_Code; - function my_form_driver (f : Form; c : Key_Code) return Boolean; - function make_label (frow : Line_Position; - fcol : Column_Position; - label : String) return Field; - function make_field (frow : Line_Position; - fcol : Column_Position; - rows : Line_Count; - cols : Column_Count; - secure : Boolean) return Field; - procedure display_form (f : Form); - procedure erase_form (f : Form); - - -- prints '*' instead of characters. - -- Not that this keeps a bug from the C version: - -- type in the psasword field then move off and back. - -- the cursor is at position one, but - -- this assumes it as at the end so text gets appended instead - -- of overwtitting. - function edit_secure (me : Field; c_in : Key_Code) return Key_Code is - rows, frow : Line_Position; - nrow : Natural; - cols, fcol : Column_Position; - nbuf : Buffer_Number; - c : Key_Code := c_in; - c2 : Character; - - use StringData; - begin - Info (me, rows, cols, frow, fcol, nrow, nbuf); - -- TODO if result = Form_Ok and nbuf > 0 then - -- C version checked the return value - -- of Info, the Ada binding throws an exception I think. - if nbuf > 0 then - declare - temp : BS.Bounded_String; - temps : String (1 .. 10); - -- TODO Get_Buffer povides no information on the field length? - len : myptr; - begin - Get_Buffer (me, 1, Str => temps); - -- strcpy(temp, field_buffer(me, 1)); - Get_User_Data (me, len); - temp := BS.To_Bounded_String (temps (1 .. len.all)); - if c <= Key_Max then - c2 := Code_To_Char (c); - if Ada.Characters.Handling.Is_Graphic (c2) then - BS.Append (temp, c2); - len.all := len.all + 1; - Set_Buffer (me, 1, BS.To_String (temp)); - c := Character'Pos ('*'); - else - c := 0; - end if; - else - case c is - when REQ_BEG_FIELD | - REQ_CLR_EOF | - REQ_CLR_EOL | - REQ_DEL_LINE | - REQ_DEL_WORD | - REQ_DOWN_CHAR | - REQ_END_FIELD | - REQ_INS_CHAR | - REQ_INS_LINE | - REQ_LEFT_CHAR | - REQ_NEW_LINE | - REQ_NEXT_WORD | - REQ_PREV_WORD | - REQ_RIGHT_CHAR | - REQ_UP_CHAR => - c := 0; -- we don't want to do inline editing - when REQ_CLR_FIELD => - if len.all /= 0 then - temp := BS.To_Bounded_String (""); - Set_Buffer (me, 1, BS.To_String (temp)); - len.all := 0; - end if; - - when REQ_DEL_CHAR | - REQ_DEL_PREV => - if len.all /= 0 then - BS.Delete (temp, BS.Length (temp), BS.Length (temp)); - Set_Buffer (me, 1, BS.To_String (temp)); - len.all := len.all - 1; - end if; - when others => null; - end case; - end if; - end; - end if; - return c; - end edit_secure; - - mode : Key_Code := REQ_INS_MODE; - - function form_virtualize (f : Form; w : Window) return Key_Code is - type lookup_t is record - code : Key_Code; - result : Key_Code; - -- should be Form_Request_Code, but we need MAX_COMMAND + 1 - end record; - - lookup : constant array (Positive range <>) of lookup_t := - ( - ( - Character'Pos ('A') mod 16#20#, REQ_NEXT_CHOICE - ), - ( - Character'Pos ('B') mod 16#20#, REQ_PREV_WORD - ), - ( - Character'Pos ('C') mod 16#20#, REQ_CLR_EOL - ), - ( - Character'Pos ('D') mod 16#20#, REQ_DOWN_FIELD - ), - ( - Character'Pos ('E') mod 16#20#, REQ_END_FIELD - ), - ( - Character'Pos ('F') mod 16#20#, REQ_NEXT_PAGE - ), - ( - Character'Pos ('G') mod 16#20#, REQ_DEL_WORD - ), - ( - Character'Pos ('H') mod 16#20#, REQ_DEL_PREV - ), - ( - Character'Pos ('I') mod 16#20#, REQ_INS_CHAR - ), - ( - Character'Pos ('K') mod 16#20#, REQ_CLR_EOF - ), - ( - Character'Pos ('L') mod 16#20#, REQ_LEFT_FIELD - ), - ( - Character'Pos ('M') mod 16#20#, REQ_NEW_LINE - ), - ( - Character'Pos ('N') mod 16#20#, REQ_NEXT_FIELD - ), - ( - Character'Pos ('O') mod 16#20#, REQ_INS_LINE - ), - ( - Character'Pos ('P') mod 16#20#, REQ_PREV_FIELD - ), - ( - Character'Pos ('R') mod 16#20#, REQ_RIGHT_FIELD - ), - ( - Character'Pos ('S') mod 16#20#, REQ_BEG_FIELD - ), - ( - Character'Pos ('U') mod 16#20#, REQ_UP_FIELD - ), - ( - Character'Pos ('V') mod 16#20#, REQ_DEL_CHAR - ), - ( - Character'Pos ('W') mod 16#20#, REQ_NEXT_WORD - ), - ( - Character'Pos ('X') mod 16#20#, REQ_CLR_FIELD - ), - ( - Character'Pos ('Y') mod 16#20#, REQ_DEL_LINE - ), - ( - Character'Pos ('Z') mod 16#20#, REQ_PREV_CHOICE - ), - ( - Character'Pos ('[') mod 16#20#, -- ESCAPE - Form_Request_Code'Last + 1 - ), - ( - Key_Backspace, REQ_DEL_PREV - ), - ( - KEY_DOWN, REQ_DOWN_CHAR - ), - ( - Key_End, REQ_LAST_FIELD - ), - ( - Key_Home, REQ_FIRST_FIELD - ), - ( - KEY_LEFT, REQ_LEFT_CHAR - ), - ( - KEY_LL, REQ_LAST_FIELD - ), - ( - Key_Next, REQ_NEXT_FIELD - ), - ( - KEY_NPAGE, REQ_NEXT_PAGE - ), - ( - KEY_PPAGE, REQ_PREV_PAGE - ), - ( - Key_Previous, REQ_PREV_FIELD - ), - ( - KEY_RIGHT, REQ_RIGHT_CHAR - ), - ( - KEY_UP, REQ_UP_CHAR - ), - ( - Character'Pos ('Q') mod 16#20#, -- QUIT - Form_Request_Code'Last + 1 -- TODO MAX_FORM_COMMAND + 1 - ) - ); - - c : Key_Code := Getchar (w); - me : constant Field := Current (f); - - begin - if c = Character'Pos (']') mod 16#20# then - if mode = REQ_INS_MODE then - mode := REQ_OVL_MODE; - else - mode := REQ_INS_MODE; - end if; - c := mode; - else - for n in lookup'Range loop - if lookup (n).code = c then - c := lookup (n).result; - exit; - end if; - end loop; - end if; - - -- Force the field that the user is typing into to be in reverse video, - -- while the other fields are shown underlined. - if c <= Key_Max then - c := edit_secure (me, c); - Set_Background (me, (Reverse_Video => True, others => False)); - elsif c <= Form_Request_Code'Last then - c := edit_secure (me, c); - Set_Background (me, (Under_Line => True, others => False)); - end if; - return c; - end form_virtualize; - - function my_form_driver (f : Form; c : Key_Code) return Boolean is - flag : constant Driver_Result := Driver (f, F_Validate_Field); - begin - if c = Form_Request_Code'Last + 1 - and flag = Form_Ok then - return True; - else - Beep; - return False; - end if; - end my_form_driver; - - function make_label (frow : Line_Position; - fcol : Column_Position; - label : String) return Field is - f : constant Field := Create (1, label'Length, frow, fcol, 0, 0); - o : Field_Option_Set := Get_Options (f); - begin - if f /= Null_Field then - Set_Buffer (f, 0, label); - o.Active := False; - Set_Options (f, o); - end if; - return f; - end make_label; - - function make_field (frow : Line_Position; - fcol : Column_Position; - rows : Line_Count; - cols : Column_Count; - secure : Boolean) return Field is - f : Field; - use StringData; - len : myptr; - begin - if secure then - f := Create (rows, cols, frow, fcol, 0, 1); - else - f := Create (rows, cols, frow, fcol, 0, 0); - end if; - - if f /= Null_Field then - Set_Background (f, (Under_Line => True, others => False)); - len := new Integer; - len.all := 0; - Set_User_Data (f, len); - end if; - return f; - end make_field; - - procedure display_form (f : Form) is - w : Window; - rows : Line_Count; - cols : Column_Count; - begin - Scale (f, rows, cols); - - w := New_Window (rows + 2, cols + 4, 0, 0); - if w /= Null_Window then - Set_Window (f, w); - Set_Sub_Window (f, Derived_Window (w, rows, cols, 1, 2)); - Box (w); -- 0,0 - Set_KeyPad_Mode (w, True); - end if; - - -- TODO if Post(f) /= Form_Ok then it's a procedure - declare - begin - Post (f); - exception - when - Eti_System_Error | - Eti_Bad_Argument | - Eti_Posted | - Eti_Connected | - Eti_Bad_State | - Eti_No_Room | - Eti_Not_Posted | - Eti_Unknown_Command | - Eti_No_Match | - Eti_Not_Selectable | - Eti_Not_Connected | - Eti_Request_Denied | - Eti_Invalid_Field | - Eti_Current => - Refresh (w); - end; - -- end if; - end display_form; - - procedure erase_form (f : Form) is - w : Window := Get_Window (f); - s : Window := Get_Sub_Window (f); - begin - Post (f, False); - Erase (w); - Refresh (w); - Delete (s); - Delete (w); - end erase_form; - - finished : Boolean := False; - f : constant Field_Array_Access := new Field_Array (1 .. 12); - secure : Field; - myform : Form; - w : Window; - c : Key_Code; - result : Driver_Result; -begin - Move_Cursor (Line => 18, Column => 0); - Add (Str => "Defined form-traversal keys: ^Q/ESC- exit form"); - Add (Ch => newl); - Add (Str => "^N -- go to next field ^P -- go to previous field"); - Add (Ch => newl); - Add (Str => "Home -- go to first field End -- go to last field"); - Add (Ch => newl); - Add (Str => "^L -- go to field to left ^R -- go to field to right"); - Add (Ch => newl); - Add (Str => "^U -- move upward to field ^D -- move downward to field"); - Add (Ch => newl); - Add (Str => "^W -- go to next word ^B -- go to previous word"); - Add (Ch => newl); - Add (Str => "^S -- go to start of field ^E -- go to end of field"); - Add (Ch => newl); - Add (Str => "^H -- delete previous char ^Y -- delete line"); - Add (Ch => newl); - Add (Str => "^G -- delete current word ^C -- clear to end of line"); - Add (Ch => newl); - Add (Str => "^K -- clear to end of field ^X -- clear field"); - Add (Ch => newl); - Add (Str => "Arrow keys move within a field as you would expect."); - - Add (Line => 4, Column => 57, Str => "Forms Entry Test"); - - Refresh; - - -- describe the form - f.all (1) := make_label (0, 15, "Sample Form"); - f.all (2) := make_label (2, 0, "Last Name"); - f.all (3) := make_field (3, 0, 1, 18, False); - f.all (4) := make_label (2, 20, "First Name"); - f.all (5) := make_field (3, 20, 1, 12, False); - f.all (6) := make_label (2, 34, "Middle Name"); - f.all (7) := make_field (3, 34, 1, 12, False); - f.all (8) := make_label (5, 0, "Comments"); - f.all (9) := make_field (6, 0, 4, 46, False); - f.all (10) := make_label (5, 20, "Password:"); - f.all (11) := make_field (5, 30, 1, 9, True); - secure := f.all (11); - f.all (12) := Null_Field; - - myform := New_Form (f); - - display_form (myform); - - w := Get_Window (myform); - Set_Raw_Mode (SwitchOn => True); - Set_NL_Mode (SwitchOn => True); -- lets us read ^M's - while not finished loop - c := form_virtualize (myform, w); - result := Driver (myform, c); - case result is - when Form_Ok => - Add (Line => 5, Column => 57, Str => Get_Buffer (secure, 1)); - Clear_To_End_Of_Line; - Refresh; - when Unknown_Request => - finished := my_form_driver (myform, c); - when others => - Beep; - end case; - end loop; - - erase_form (myform); - - -- TODO Free_Form(myform); - -- for (c = 0; f[c] != 0; c++) free_field(f[c]); - Set_Raw_Mode (SwitchOn => False); - Set_NL_Mode (SwitchOn => True); - -end ncurses2.demo_forms; diff --git a/Ada95/samples/ncurses2-demo_forms.ads b/Ada95/samples/ncurses2-demo_forms.ads deleted file mode 100644 index eabaa01b9e9..00000000000 --- a/Ada95/samples/ncurses2-demo_forms.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.demo_forms; diff --git a/Ada95/samples/ncurses2-demo_pad.adb b/Ada95/samples/ncurses2-demo_pad.adb deleted file mode 100644 index b1b72aec0b6..00000000000 --- a/Ada95/samples/ncurses2-demo_pad.adb +++ /dev/null @@ -1,675 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2008,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.8 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; - -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -with Interfaces.C; -with System.Storage_Elements; -with System.Address_To_Access_Conversions; - -with Ada.Text_IO; --- with Ada.Real_Time; use Ada.Real_Time; --- TODO is there a way to use Real_Time or Ada.Calendar in place of --- gettimeofday? - --- Demonstrate pads. -procedure ncurses2.demo_pad is - - type timestruct is record - seconds : Integer; - microseconds : Integer; - end record; - - type myfunc is access function (w : Window) return Key_Code; - - function gettime return timestruct; - procedure do_h_line (y : Line_Position; - x : Column_Position; - c : Attributed_Character; - to : Column_Position); - procedure do_v_line (y : Line_Position; - x : Column_Position; - c : Attributed_Character; - to : Line_Position); - function padgetch (win : Window) return Key_Code; - function panner_legend (line : Line_Position) return Boolean; - procedure panner_legend (line : Line_Position); - procedure panner_h_cleanup (from_y : Line_Position; - from_x : Column_Position; - to_x : Column_Position); - procedure panner_v_cleanup (from_y : Line_Position; - from_x : Column_Position; - to_y : Line_Position); - procedure panner (pad : Window; - top_xp : Column_Position; - top_yp : Line_Position; - portyp : Line_Position; - portxp : Column_Position; - pgetc : myfunc); - - function gettime return timestruct is - - retval : timestruct; - - use Interfaces.C; - type timeval is record - tv_sec : long; - tv_usec : long; - end record; - pragma Convention (C, timeval); - - -- TODO function from_timeval is new Ada.Unchecked_Conversion( - -- timeval_a, System.Storage_Elements.Integer_Address); - -- should Interfaces.C.Pointers be used here? - - package myP is new System.Address_To_Access_Conversions (timeval); - use myP; - - t : constant Object_Pointer := new timeval; - - function gettimeofday - (TP : System.Storage_Elements.Integer_Address; - TZP : System.Storage_Elements.Integer_Address) return int; - pragma Import (C, gettimeofday, "gettimeofday"); - tmp : int; - begin - tmp := gettimeofday (System.Storage_Elements.To_Integer - (myP.To_Address (t)), - System.Storage_Elements.To_Integer - (myP.To_Address (null))); - if tmp < 0 then - retval.seconds := 0; - retval.microseconds := 0; - else - retval.seconds := Integer (t.all.tv_sec); - retval.microseconds := Integer (t.all.tv_usec); - end if; - return retval; - end gettime; - - -- in C, The behavior of mvhline, mvvline for negative/zero length is - -- unspecified, though we can rely on negative x/y values to stop the - -- macro. Except Ada makes Line_Position(-1) = Natural - 1 so forget it. - procedure do_h_line (y : Line_Position; - x : Column_Position; - c : Attributed_Character; - to : Column_Position) is - begin - if to > x then - Move_Cursor (Line => y, Column => x); - Horizontal_Line (Line_Size => Natural (to - x), Line_Symbol => c); - end if; - end do_h_line; - - procedure do_v_line (y : Line_Position; - x : Column_Position; - c : Attributed_Character; - to : Line_Position) is - begin - if to > y then - Move_Cursor (Line => y, Column => x); - Vertical_Line (Line_Size => Natural (to - y), Line_Symbol => c); - end if; - end do_v_line; - - function padgetch (win : Window) return Key_Code is - c : Key_Code; - c2 : Character; - begin - c := Getchar (win); - c2 := Code_To_Char (c); - - case c2 is - when '!' => - ShellOut (False); - return Key_Refresh; - when Character'Val (Character'Pos ('r') mod 16#20#) => -- CTRL('r') - End_Windows; - Refresh; - return Key_Refresh; - when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') - return Key_Refresh; - when 'U' => - return Key_Cursor_Up; - when 'D' => - return Key_Cursor_Down; - when 'R' => - return Key_Cursor_Right; - when 'L' => - return Key_Cursor_Left; - when '+' => - return Key_Insert_Line; - when '-' => - return Key_Delete_Line; - when '>' => - return Key_Insert_Char; - when '<' => - return Key_Delete_Char; - -- when ERR=> /* FALLTHRU */ - when 'q' => - return (Key_Exit); - when others => - return (c); - end case; - end padgetch; - - show_panner_legend : Boolean := True; - - function panner_legend (line : Line_Position) return Boolean is - legend : constant array (0 .. 3) of String (1 .. 61) := - ( - "Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags) ", - "Use ! to shell-out. Toggle legend:?, timer:t, scroll mark:s.", - "Use +,- (or j,k) to grow/shrink the panner vertically. ", - "Use <,> (or h,l) to grow/shrink the panner horizontally. "); - legendsize : constant := 4; - - n : constant Integer := legendsize - Integer (Lines - line); - begin - if line < Lines and n >= 0 then - Move_Cursor (Line => line, Column => 0); - if show_panner_legend then - Add (Str => legend (n)); - end if; - Clear_To_End_Of_Line; - return show_panner_legend; - end if; - return False; - end panner_legend; - - procedure panner_legend (line : Line_Position) is - begin - if not panner_legend (line) then - Beep; - end if; - end panner_legend; - - procedure panner_h_cleanup (from_y : Line_Position; - from_x : Column_Position; - to_x : Column_Position) is - begin - if not panner_legend (from_y) then - do_h_line (from_y, from_x, Blank2, to_x); - end if; - end panner_h_cleanup; - - procedure panner_v_cleanup (from_y : Line_Position; - from_x : Column_Position; - to_y : Line_Position) is - begin - if not panner_legend (from_y) then - do_v_line (from_y, from_x, Blank2, to_y); - end if; - end panner_v_cleanup; - - procedure panner (pad : Window; - top_xp : Column_Position; - top_yp : Line_Position; - portyp : Line_Position; - portxp : Column_Position; - pgetc : myfunc) is - - function f (y : Line_Position) return Line_Position; - function f (x : Column_Position) return Column_Position; - function greater (y1, y2 : Line_Position) return Integer; - function greater (x1, x2 : Column_Position) return Integer; - - top_x : Column_Position := top_xp; - top_y : Line_Position := top_yp; - porty : Line_Position := portyp; - portx : Column_Position := portxp; - - -- f[x] returns max[x - 1, 0] - function f (y : Line_Position) return Line_Position is - begin - if y > 0 then - return y - 1; - else - return y; -- 0 - end if; - end f; - - function f (x : Column_Position) return Column_Position is - begin - if x > 0 then - return x - 1; - else - return x; -- 0 - end if; - end f; - - function greater (y1, y2 : Line_Position) return Integer is - begin - if y1 > y2 then - return 1; - else - return 0; - end if; - end greater; - - function greater (x1, x2 : Column_Position) return Integer is - begin - if x1 > x2 then - return 1; - else - return 0; - end if; - end greater; - - pymax : Line_Position; - basey : Line_Position := 0; - pxmax : Column_Position; - basex : Column_Position := 0; - c : Key_Code; - scrollers : Boolean := True; - before, after : timestruct; - timing : Boolean := True; - - package floatio is new Ada.Text_IO.Float_IO (Long_Float); - begin - Get_Size (pad, pymax, pxmax); - Allow_Scrolling (Mode => False); -- we don't want stdscr to scroll! - - c := Key_Refresh; - loop - -- During shell-out, the user may have resized the window. Adjust - -- the port size of the pad to accommodate this. Ncurses - -- automatically resizes all of the normal windows to fit on the - -- new screen. - if top_x > Columns then - top_x := Columns; - end if; - if portx > Columns then - portx := Columns; - end if; - if top_y > Lines then - top_y := Lines; - end if; - if porty > Lines then - porty := Lines; - end if; - - case c is - when Key_Refresh | Character'Pos ('?') => - if c = Key_Refresh then - Erase; - else -- '?' - show_panner_legend := not show_panner_legend; - end if; - panner_legend (Lines - 4); - panner_legend (Lines - 3); - panner_legend (Lines - 2); - panner_legend (Lines - 1); - when Character'Pos ('t') => - timing := not timing; - if not timing then - panner_legend (Lines - 1); - end if; - when Character'Pos ('s') => - scrollers := not scrollers; - - -- Move the top-left corner of the pad, keeping the - -- bottom-right corner fixed. - when Character'Pos ('h') => - -- increase-columns: move left edge to left - if top_x = 0 then - Beep; - else - panner_v_cleanup (top_y, top_x, porty); - top_x := top_x - 1; - end if; - - when Character'Pos ('j') => - -- decrease-lines: move top-edge down - if top_y >= porty then - Beep; - else - if top_y /= 0 then - panner_h_cleanup (top_y - 1, f (top_x), portx); - end if; - top_y := top_y + 1; - end if; - when Character'Pos ('k') => - -- increase-lines: move top-edge up - if top_y = 0 then - Beep; - else - top_y := top_y - 1; - panner_h_cleanup (top_y, top_x, portx); - end if; - - when Character'Pos ('l') => - -- decrease-columns: move left-edge to right - if top_x >= portx then - Beep; - else - if top_x /= 0 then - panner_v_cleanup (f (top_y), top_x - 1, porty); - end if; - top_x := top_x + 1; - end if; - - -- Move the bottom-right corner of the pad, keeping the - -- top-left corner fixed. - when Key_Insert_Char => - -- increase-columns: move right-edge to right - if portx >= pxmax or portx >= Columns then - Beep; - else - panner_v_cleanup (f (top_y), portx - 1, porty); - portx := portx + 1; - -- C had ++portx instead of portx++, weird. - end if; - when Key_Insert_Line => - -- increase-lines: move bottom-edge down - if porty >= pymax or porty >= Lines then - Beep; - else - panner_h_cleanup (porty - 1, f (top_x), portx); - porty := porty + 1; - end if; - - when Key_Delete_Char => - -- decrease-columns: move bottom edge up - if portx <= top_x then - Beep; - else - portx := portx - 1; - panner_v_cleanup (f (top_y), portx, porty); - end if; - - when Key_Delete_Line => - -- decrease-lines - if porty <= top_y then - Beep; - else - porty := porty - 1; - panner_h_cleanup (porty, f (top_x), portx); - end if; - when Key_Cursor_Left => - -- pan leftwards - if basex > 0 then - basex := basex - 1; - else - Beep; - end if; - when Key_Cursor_Right => - -- pan rightwards - -- if (basex + portx - (pymax > porty) < pxmax) - if basex + portx - - Column_Position (greater (pymax, porty)) < pxmax then - -- if basex + portx < pxmax or - -- (pymax > porty and basex + portx - 1 < pxmax) then - basex := basex + 1; - else - Beep; - end if; - - when Key_Cursor_Up => - -- pan upwards - if basey > 0 then - basey := basey - 1; - else - Beep; - end if; - - when Key_Cursor_Down => - -- pan downwards - -- same as if (basey + porty - (pxmax > portx) < pymax) - if basey + porty - - Line_Position (greater (pxmax, portx)) < pymax then - -- if (basey + porty < pymax) or - -- (pxmax > portx and basey + porty - 1 < pymax) then - basey := basey + 1; - else - Beep; - end if; - - when Character'Pos ('H') | - Key_Home | - Key_Find => - basey := 0; - - when Character'Pos ('E') | - Key_End | - Key_Select => - if pymax < porty then - basey := 0; - else - basey := pymax - porty; - end if; - - when others => - Beep; - end case; - - -- more writing off the screen. - -- Interestingly, the exception is not handled if - -- we put a block around this. - -- delcare --begin - if top_y /= 0 and top_x /= 0 then - Add (Line => top_y - 1, Column => top_x - 1, - Ch => ACS_Map (ACS_Upper_Left_Corner)); - end if; - if top_x /= 0 then - do_v_line (top_y, top_x - 1, ACS_Map (ACS_Vertical_Line), porty); - end if; - if top_y /= 0 then - do_h_line (top_y - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); - end if; - -- exception when Curses_Exception => null; end; - - -- in C was ... pxmax > portx - 1 - if scrollers and pxmax >= portx then - declare - length : constant Column_Position := portx - top_x - 1; - lowend, highend : Column_Position; - begin - -- Instead of using floats, I'll use integers only. - lowend := top_x + (basex * length) / pxmax; - highend := top_x + ((basex + length) * length) / pxmax; - - do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), - lowend); - if highend < portx then - Switch_Character_Attribute - (Attr => (Reverse_Video => True, others => False), - On => True); - do_h_line (porty - 1, lowend, Blank2, highend + 1); - Switch_Character_Attribute - (Attr => (Reverse_Video => True, others => False), - On => False); - do_h_line (porty - 1, highend + 1, - ACS_Map (ACS_Horizontal_Line), portx); - end if; - end; - else - do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx); - end if; - - if scrollers and pymax >= porty then - declare - length : constant Line_Position := porty - top_y - 1; - lowend, highend : Line_Position; - begin - lowend := top_y + (basey * length) / pymax; - highend := top_y + ((basey + length) * length) / pymax; - - do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), - lowend); - if highend < porty then - Switch_Character_Attribute - (Attr => (Reverse_Video => True, others => False), - On => True); - do_v_line (lowend, portx - 1, Blank2, highend + 1); - Switch_Character_Attribute - (Attr => (Reverse_Video => True, others => False), - On => False); - do_v_line (highend + 1, portx - 1, - ACS_Map (ACS_Vertical_Line), porty); - end if; - end; - else - do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), porty); - end if; - - if top_y /= 0 then - Add (Line => top_y - 1, Column => portx - 1, - Ch => ACS_Map (ACS_Upper_Right_Corner)); - end if; - if top_x /= 0 then - Add (Line => porty - 1, Column => top_x - 1, - Ch => ACS_Map (ACS_Lower_Left_Corner)); - end if; - declare - begin - -- Here is another place where it is possible - -- to write to the corner of the screen. - Add (Line => porty - 1, Column => portx - 1, - Ch => ACS_Map (ACS_Lower_Right_Corner)); - exception - when Curses_Exception => null; - end; - - before := gettime; - - Refresh_Without_Update; - - declare - -- the C version allows the panel to have a zero height - -- wich raise the exception - begin - Refresh_Without_Update - ( - pad, - basey, basex, - top_y, top_x, - porty - Line_Position (greater (pxmax, portx)) - 1, - portx - Column_Position (greater (pymax, porty)) - 1); - exception - when Curses_Exception => null; - end; - - Update_Screen; - - if timing then - declare - s : String (1 .. 7); - elapsed : Long_Float; - begin - after := gettime; - elapsed := (Long_Float (after.seconds - before.seconds) + - Long_Float (after.microseconds - - before.microseconds) - / 1.0e6); - Move_Cursor (Line => Lines - 1, Column => Columns - 20); - floatio.Put (s, elapsed, Aft => 3, Exp => 0); - Add (Str => s); - Refresh; - end; - end if; - - c := pgetc (pad); - exit when c = Key_Exit; - - end loop; - - Allow_Scrolling (Mode => True); - - end panner; - - Gridsize : constant := 3; - Gridcount : Integer := 0; - - Pad_High : constant Line_Count := 200; - Pad_Wide : constant Column_Count := 200; - panpad : Window := New_Pad (Pad_High, Pad_Wide); -begin - if panpad = Null_Window then - Cannot ("cannot create requested pad"); - return; - end if; - - for i in 0 .. Pad_High - 1 loop - for j in 0 .. Pad_Wide - 1 loop - if i mod Gridsize = 0 and j mod Gridsize = 0 then - if i = 0 or j = 0 then - Add (panpad, '+'); - else - -- depends on ASCII? - Add (panpad, - Ch => Character'Val (Character'Pos ('A') + - Gridcount mod 26)); - Gridcount := Gridcount + 1; - end if; - elsif i mod Gridsize = 0 then - Add (panpad, '-'); - elsif j mod Gridsize = 0 then - Add (panpad, '|'); - else - declare - -- handle the write to the lower right corner error - begin - Add (panpad, ' '); - exception - when Curses_Exception => null; - end; - end if; - end loop; - end loop; - panner_legend (Lines - 4); - panner_legend (Lines - 3); - panner_legend (Lines - 2); - panner_legend (Lines - 1); - - Set_KeyPad_Mode (panpad, True); - -- Make the pad (initially) narrow enough that a trace file won't wrap. - -- We'll still be able to widen it during a test, since that's required - -- for testing boundaries. - - panner (panpad, 2, 2, Lines - 5, Columns - 15, padgetch'Access); - - Delete (panpad); - End_Windows; -- Hmm, Erase after End_Windows - Erase; -end ncurses2.demo_pad; diff --git a/Ada95/samples/ncurses2-demo_pad.ads b/Ada95/samples/ncurses2-demo_pad.ads deleted file mode 100644 index b996263c1cd..00000000000 --- a/Ada95/samples/ncurses2-demo_pad.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.demo_pad; diff --git a/Ada95/samples/ncurses2-demo_panels.adb b/Ada95/samples/ncurses2-demo_panels.adb deleted file mode 100644 index 9693e1a13ba..00000000000 --- a/Ada95/samples/ncurses2-demo_panels.adb +++ /dev/null @@ -1,382 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2008,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.7 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Panels.User_Data; - -with ncurses2.genericPuts; - -procedure ncurses2.demo_panels (nap_mseci : Integer) is - use Int_IO; - - function mkpanel (color : Color_Number; - rows : Line_Count; - cols : Column_Count; - tly : Line_Position; - tlx : Column_Position) return Panel; - procedure rmpanel (pan : in out Panel); - procedure pflush; - procedure wait_a_while (msec : Integer); - procedure saywhat (text : String); - procedure fill_panel (pan : Panel); - - nap_msec : Integer := nap_mseci; - - function mkpanel (color : Color_Number; - rows : Line_Count; - cols : Column_Count; - tly : Line_Position; - tlx : Column_Position) return Panel is - win : Window; - pan : Panel := Null_Panel; - begin - win := New_Window (rows, cols, tly, tlx); - if Null_Window /= win then - pan := New_Panel (win); - if pan = Null_Panel then - Delete (win); - elsif Has_Colors then - declare - fg, bg : Color_Number; - begin - if color = Blue then - fg := White; - else - fg := Black; - end if; - bg := color; - Init_Pair (Color_Pair (color), fg, bg); - Set_Background (win, (Ch => ' ', - Attr => Normal_Video, - Color => Color_Pair (color))); - end; - else - Set_Background (win, (Ch => ' ', - Attr => (Bold_Character => True, - others => False), - Color => Color_Pair (color))); - end if; - end if; - return pan; - end mkpanel; - - procedure rmpanel (pan : in out Panel) is - win : Window := Panel_Window (pan); - begin - Delete (pan); - Delete (win); - end rmpanel; - - procedure pflush is - begin - Update_Panels; - Update_Screen; - end pflush; - - procedure wait_a_while (msec : Integer) is - begin - -- The C version had some #ifdef blocks here - if msec = 1 then - Getchar; - else - Nap_Milli_Seconds (msec); - end if; - end wait_a_while; - - procedure saywhat (text : String) is - begin - Move_Cursor (Line => Lines - 1, Column => 0); - Clear_To_End_Of_Line; - Add (Str => text); - end saywhat; - - -- from sample-curses_demo.adb - type User_Data is new String (1 .. 2); - type User_Data_Access is access all User_Data; - package PUD is new Panels.User_Data (User_Data, User_Data_Access); - - use PUD; - - procedure fill_panel (pan : Panel) is - win : constant Window := Panel_Window (pan); - num : constant Character := Get_User_Data (pan).all (2); - tmp6 : String (1 .. 6) := "-panx-"; - maxy : Line_Count; - maxx : Column_Count; - - begin - Move_Cursor (win, 1, 1); - tmp6 (5) := num; - Add (win, Str => tmp6); - Clear_To_End_Of_Line (win); - Box (win); - Get_Size (win, maxy, maxx); - for y in 2 .. maxy - 3 loop - for x in 1 .. maxx - 3 loop - Move_Cursor (win, y, x); - Add (win, num); - end loop; - end loop; - exception - when Curses_Exception => null; - end fill_panel; - - modstr : constant array (0 .. 5) of String (1 .. 5) := - ("test ", - "TEST ", - "(**) ", - "*()* ", - "<--> ", - "LAST " - ); - - package p is new ncurses2.genericPuts (1024); - use p; - use p.BS; - -- the C version said register int y, x; - tmpb : BS.Bounded_String; - -begin - Refresh; - - for y in 0 .. Integer (Lines - 2) loop - for x in 0 .. Integer (Columns - 1) loop - myPut (tmpb, (y + x) mod 10); - myAdd (Str => tmpb); - end loop; - end loop; - for y in 0 .. 4 loop - declare - p1, p2, p3, p4, p5 : Panel; - U1 : constant User_Data_Access := new User_Data'("p1"); - U2 : constant User_Data_Access := new User_Data'("p2"); - U3 : constant User_Data_Access := new User_Data'("p3"); - U4 : constant User_Data_Access := new User_Data'("p4"); - U5 : constant User_Data_Access := new User_Data'("p5"); - - begin - p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0); - Set_User_Data (p1, U1); - p2 := mkpanel (Green, Lines / 2 + 1, Columns / 7, Lines / 4, - Columns / 10); - Set_User_Data (p2, U2); - p3 := mkpanel (Yellow, Lines / 4, Columns / 10, Lines / 2, - Columns / 9); - Set_User_Data (p3, U3); - p4 := mkpanel (Blue, Lines / 2 - 2, Columns / 8, Lines / 2 - 2, - Columns / 3); - Set_User_Data (p4, U4); - p5 := mkpanel (Magenta, Lines / 2 - 2, Columns / 8, Lines / 2, - Columns / 2 - 2); - Set_User_Data (p5, U5); - - fill_panel (p1); - fill_panel (p2); - fill_panel (p3); - fill_panel (p4); - fill_panel (p5); - Hide (p4); - Hide (p5); - pflush; - saywhat ("press any key to continue"); - wait_a_while (nap_msec); - - saywhat ("h3 s1 s2 s4 s5; press any key to continue"); - Move (p1, 0, 0); - Hide (p3); - Show (p1); - Show (p2); - Show (p4); - Show (p5); - pflush; - wait_a_while (nap_msec); - - saywhat ("s1; press any key to continue"); - Show (p1); - pflush; - wait_a_while (nap_msec); - - saywhat ("s2; press any key to continue"); - Show (p2); - pflush; - wait_a_while (nap_msec); - - saywhat ("m2; press any key to continue"); - Move (p2, Lines / 3 + 1, Columns / 8); - pflush; - wait_a_while (nap_msec); - - saywhat ("s3;"); - Show (p3); - pflush; - wait_a_while (nap_msec); - - saywhat ("m3; press any key to continue"); - Move (p3, Lines / 4 + 1, Columns / 15); - pflush; - wait_a_while (nap_msec); - - saywhat ("b3; press any key to continue"); - Bottom (p3); - pflush; - wait_a_while (nap_msec); - - saywhat ("s4; press any key to continue"); - Show (p4); - pflush; - wait_a_while (nap_msec); - - saywhat ("s5; press any key to continue"); - Show (p5); - pflush; - wait_a_while (nap_msec); - - saywhat ("t3; press any key to continue"); - Top (p3); - pflush; - wait_a_while (nap_msec); - - saywhat ("t1; press any key to continue"); - Top (p1); - pflush; - wait_a_while (nap_msec); - - saywhat ("t2; press any key to continue"); - Top (p2); - pflush; - wait_a_while (nap_msec); - - saywhat ("t3; press any key to continue"); - Top (p3); - pflush; - wait_a_while (nap_msec); - - saywhat ("t4; press any key to continue"); - Top (p4); - pflush; - wait_a_while (nap_msec); - - for itmp in 0 .. 5 loop - declare - w4 : constant Window := Panel_Window (p4); - w5 : constant Window := Panel_Window (p5); - begin - - saywhat ("m4; press any key to continue"); - Move_Cursor (w4, Lines / 8, 1); - Add (w4, modstr (itmp)); - Move (p4, Lines / 6, Column_Position (itmp) * (Columns / 8)); - Move_Cursor (w5, Lines / 6, 1); - Add (w5, modstr (itmp)); - pflush; - wait_a_while (nap_msec); - - saywhat ("m5; press any key to continue"); - Move_Cursor (w4, Lines / 6, 1); - Add (w4, modstr (itmp)); - Move (p5, Lines / 3 - 1, (Column_Position (itmp) * 10) + 6); - Move_Cursor (w5, Lines / 8, 1); - Add (w5, modstr (itmp)); - pflush; - wait_a_while (nap_msec); - end; - end loop; - - saywhat ("m4; press any key to continue"); - Move (p4, Lines / 6, 6 * (Columns / 8)); - -- Move(p4, Lines / 6, itmp * (Columns / 8)); - pflush; - wait_a_while (nap_msec); - - saywhat ("t5; press any key to continue"); - Top (p5); - pflush; - wait_a_while (nap_msec); - - saywhat ("t2; press any key to continue"); - Top (p2); - pflush; - wait_a_while (nap_msec); - - saywhat ("t1; press any key to continue"); - Top (p1); - pflush; - wait_a_while (nap_msec); - - saywhat ("d2; press any key to continue"); - rmpanel (p2); - pflush; - wait_a_while (nap_msec); - - saywhat ("h3; press any key to continue"); - Hide (p3); - pflush; - wait_a_while (nap_msec); - - saywhat ("d1; press any key to continue"); - rmpanel (p1); - pflush; - wait_a_while (nap_msec); - - saywhat ("d4; press any key to continue"); - rmpanel (p4); - pflush; - wait_a_while (nap_msec); - - saywhat ("d5; press any key to continue"); - rmpanel (p5); - pflush; - wait_a_while (nap_msec); - if nap_msec = 1 then - exit; - else - nap_msec := 100; - end if; - - end; - end loop; - - Erase; - End_Windows; - -end ncurses2.demo_panels; diff --git a/Ada95/samples/ncurses2-demo_panels.ads b/Ada95/samples/ncurses2-demo_panels.ads deleted file mode 100644 index eb2878c8501..00000000000 --- a/Ada95/samples/ncurses2-demo_panels.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.demo_panels (nap_mseci : Integer); diff --git a/Ada95/samples/ncurses2-flushinp_test.adb b/Ada95/samples/ncurses2-flushinp_test.adb deleted file mode 100644 index 9ea98e158c3..00000000000 --- a/Ada95/samples/ncurses2-flushinp_test.adb +++ /dev/null @@ -1,135 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with ncurses2.util; use ncurses2.util; - -procedure ncurses2.flushinp_test (win : Window) is - - procedure Continue (win : Window); - - procedure Continue (win : Window) is - begin - Set_Echo_Mode (False); - Move_Cursor (win, 10, 1); - Add (win, 10, 1, " Press any key to continue"); - Refresh (win); - Getchar (win); - end Continue; - - h, by, sh : Line_Position; - w, bx, sw : Column_Position; - - subWin : Window; - -begin - Clear (win); - Get_Size (win, h, w); - Get_Window_Position (win, by, bx); - sw := w / 3; - sh := h / 3; - subWin := Sub_Window (win, sh, sw, by + h - sh - 2, bx + w - sw - 2); - - if Has_Colors then - Init_Pair (2, Cyan, Blue); - Change_Background (subWin, - Attributed_Character'(Ch => ' ', Color => 2, - Attr => Normal_Video)); - end if; - - Set_Character_Attributes (subWin, - (Bold_Character => True, others => False)); - Box (subWin); - Add (subWin, 2, 1, "This is a subwindow"); - Refresh (win); - - Set_Cbreak_Mode (True); - Add (win, 0, 1, "This is a test of the flushinp() call."); - - Add (win, 2, 1, "Type random keys for 5 seconds."); - Add (win, 3, 1, - "These should be discarded (not echoed) after the subwindow " & - "goes away."); - Refresh (win); - - for i in 0 .. 4 loop - Move_Cursor (subWin, 1, 1); - Add (subWin, Str => "Time = "); - Add (subWin, Str => Integer'Image (i)); - Refresh (subWin); - Nap_Milli_Seconds (1000); - Flush_Input; - end loop; - - Delete (subWin); - Erase (win); - Flash_Screen; - Refresh (win); - Nap_Milli_Seconds (1000); - - Add (win, 2, 1, - Str => "If you were still typing when the window timer expired,"); - Add (win, 3, 1, - "or else you typed nothing at all while it was running,"); - Add (win, 4, 1, - "test was invalid. You'll see garbage or nothing at all. "); - Add (win, 6, 1, "Press a key"); - Move_Cursor (win, 9, 10); - Refresh (win); - Set_Echo_Mode (True); - Getchar (win); - Flush_Input; - Add (win, 12, 0, - "If you see any key other than what you typed, flushinp() is broken."); - Continue (win); - - Move_Cursor (win, 9, 10); - Delete_Character (win); - Refresh (win); - Move_Cursor (win, 12, 0); - Clear_To_End_Of_Line; - Add (win, - "What you typed should now have been deleted; if not, wdelch() " & - "failed."); - Continue (win); - - Set_Cbreak_Mode (True); - -end ncurses2.flushinp_test; diff --git a/Ada95/samples/ncurses2-flushinp_test.ads b/Ada95/samples/ncurses2-flushinp_test.ads deleted file mode 100644 index 5376c94a54b..00000000000 --- a/Ada95/samples/ncurses2-flushinp_test.ads +++ /dev/null @@ -1,43 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; - -procedure ncurses2.flushinp_test (win : Terminal_Interface.Curses.Window); diff --git a/Ada95/samples/ncurses2-genericputs.adb b/Ada95/samples/ncurses2-genericputs.adb deleted file mode 100644 index 829d08d23a2..00000000000 --- a/Ada95/samples/ncurses2-genericputs.adb +++ /dev/null @@ -1,117 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.4 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body ncurses2.genericPuts is - - procedure myGet (Win : Window := Standard_Window; - Str : out BS.Bounded_String; - Len : Integer := -1) - is - function Wgetnstr (Win : Window; - Str : char_array; - Len : int) return int; - pragma Import (C, Wgetnstr, "wgetnstr"); - - N : Integer := Len; - Txt : char_array (0 .. size_t (Max_Length)); - xStr : String (1 .. Max_Length); - Cnt : Natural; - begin - if N < 0 then - N := Max_Length; - end if; - if N > Max_Length then - raise Constraint_Error; - end if; - Txt (0) := Interfaces.C.char'First; - if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then - raise Curses_Exception; - end if; - To_Ada (Txt, xStr, Cnt, True); - Str := To_Bounded_String (xStr (1 .. Cnt)); - end myGet; - - procedure myPut (Str : out BS.Bounded_String; - i : Integer; - Base : Number_Base := 10) is - package Int_IO is new Integer_IO (Integer); use Int_IO; - tmp : String (1 .. BS.Max_Length); - begin - Put (tmp, i, Base); - Str := To_Bounded_String (tmp); - Trim (Str, Ada.Strings.Trim_End'(Ada.Strings.Left)); - end myPut; - - procedure myAdd (Str : BS.Bounded_String) is - begin - Add (Str => To_String (Str)); - end myAdd; - - -- from ncurses-aux - procedure Fill_String (Cp : chars_ptr; - Str : out BS.Bounded_String) - is - -- Fill the string with the characters referenced by the - -- chars_ptr. - -- - Len : Natural; - begin - if Cp /= Null_Ptr then - Len := Natural (Strlen (Cp)); - if Max_Length < Len then - raise Constraint_Error; - end if; - declare - S : String (1 .. Len); - begin - S := Value (Cp); - Str := To_Bounded_String (S); - end; - else - Str := Null_Bounded_String; - end if; - - end Fill_String; - -end ncurses2.genericPuts; diff --git a/Ada95/samples/ncurses2-genericputs.ads b/Ada95/samples/ncurses2-genericputs.ads deleted file mode 100644 index accc3cc63d7..00000000000 --- a/Ada95/samples/ncurses2-genericputs.ads +++ /dev/null @@ -1,72 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2006,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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.3 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -with Ada.Text_IO; use Ada.Text_IO; -with Ada.Strings.Bounded; -use Ada.Strings.Bounded; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Terminal_Interface.Curses; - -generic - Max : Natural; - -- type mystring is private; - -- type myint is -package ncurses2.genericPuts is - package BS is new - Ada.Strings.Bounded.Generic_Bounded_Length (Max); - use BS; - - procedure myGet (Win : Terminal_Interface.Curses.Window - := Terminal_Interface.Curses.Standard_Window; - Str : out BS.Bounded_String; - Len : Integer := -1); - - procedure myPut (Str : out BS.Bounded_String; - i : Integer; - Base : Number_Base := 10); - -- the default should be Ada.Text_IO.Integer_IO.Default_Base - -- but Default_Base is hidden in the generic so doesn't exist! - procedure myAdd (Str : BS.Bounded_String); - - procedure Fill_String (Cp : chars_ptr; Str : out BS.Bounded_String); -end ncurses2.genericPuts; diff --git a/Ada95/samples/ncurses2-getch.ads b/Ada95/samples/ncurses2-getch.ads deleted file mode 100644 index 21a09f3160f..00000000000 --- a/Ada95/samples/ncurses2-getch.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure getch_test; diff --git a/Ada95/samples/ncurses2-getch_test.adb b/Ada95/samples/ncurses2-getch_test.adb deleted file mode 100644 index 2802cfb5501..00000000000 --- a/Ada95/samples/ncurses2-getch_test.adb +++ /dev/null @@ -1,254 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.8 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- Character input test --- test the keypad feature - -with ncurses2.util; use ncurses2.util; - -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; -with Ada.Characters.Handling; -with Ada.Strings.Bounded; - -with ncurses2.genericPuts; - -procedure ncurses2.getch_test is - use Int_IO; - - function mouse_decode (ep : Mouse_Event) return String; - - function mouse_decode (ep : Mouse_Event) return String is - Y : Line_Position; - X : Column_Position; - Button : Mouse_Button; - State : Button_State; - package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); - use BS; - buf : Bounded_String := To_Bounded_String (""); - begin - -- Note that these bindings do not allow - -- two button states, - -- The C version can print {click-1, click-3} for example. - -- They also don't have the 'id' or z coordinate. - Get_Event (ep, Y, X, Button, State); - - -- TODO Append (buf, "id "); from C version - Append (buf, "at ("); - Append (buf, Column_Position'Image (X)); - Append (buf, ", "); - Append (buf, Line_Position'Image (Y)); - Append (buf, ") state"); - Append (buf, Mouse_Button'Image (Button)); - - Append (buf, " = "); - Append (buf, Button_State'Image (State)); - return To_String (buf); - end mouse_decode; - - buf : String (1 .. 1024); -- TODO was BUFSIZE - n : Integer; - c : Key_Code; - blockflag : Timeout_Mode := Blocking; - firsttime : Boolean := True; - tmp2 : Event_Mask; - tmp6 : String (1 .. 6); - tmp20 : String (1 .. 20); - x : Column_Position; - y : Line_Position; - tmpx : Integer; - incount : Integer := 0; - -begin - Refresh; - tmp2 := Start_Mouse (All_Events); - Add (Str => "Delay in 10ths of a second ( for blocking input)? "); - Set_Echo_Mode (SwitchOn => True); - Get (Str => buf); - - Set_Echo_Mode (SwitchOn => False); - Set_NL_Mode (SwitchOn => False); - - if Ada.Characters.Handling.Is_Digit (buf (1)) then - Get (Item => n, From => buf, Last => tmpx); - Set_Timeout_Mode (Mode => Delayed, Amount => n * 100); - blockflag := Delayed; - end if; - - c := Character'Pos ('?'); - Set_Raw_Mode (SwitchOn => True); - loop - if not firsttime then - Add (Str => "Key pressed: "); - Put (tmp6, Integer (c), 8); - Add (Str => tmp6); - Add (Ch => ' '); - if c = Key_Mouse then - declare - event : Mouse_Event; - begin - event := Get_Mouse; - Add (Str => "KEY_MOUSE, "); - Add (Str => mouse_decode (event)); - Add (Ch => newl); - end; - elsif c >= Key_Min then - Key_Name (c, tmp20); - Add (Str => tmp20); - -- I used tmp and got bitten by the length problem:-> - Add (Ch => newl); - elsif c > 16#80# then -- TODO fix, use constant if possible - declare - c2 : constant Character := Character'Val (c mod 16#80#); - begin - if Ada.Characters.Handling.Is_Graphic (c2) then - Add (Str => "M-"); - Add (Ch => c2); - else - Add (Str => "M-"); - Add (Str => Un_Control ((Ch => c2, - Color => Color_Pair'First, - Attr => Normal_Video))); - end if; - Add (Str => " (high-half character)"); - Add (Ch => newl); - end; - else - declare - c2 : constant Character := Character'Val (c mod 16#80#); - begin - if Ada.Characters.Handling.Is_Graphic (c2) then - Add (Ch => c2); - Add (Str => " (ASCII printable character)"); - Add (Ch => newl); - else - Add (Str => Un_Control ((Ch => c2, - Color => Color_Pair'First, - Attr => Normal_Video))); - Add (Str => " (ASCII control character)"); - Add (Ch => newl); - end if; - end; - end if; - -- TODO I am not sure why this was in the C version - -- the delay statement scroll anyway. - Get_Cursor_Position (Line => y, Column => x); - if y >= Lines - 1 then - Move_Cursor (Line => 0, Column => 0); - end if; - Clear_To_End_Of_Line; - end if; - - firsttime := False; - if c = Character'Pos ('g') then - declare - package p is new ncurses2.genericPuts (1024); - use p; - use p.BS; - timedout : Boolean := False; - boundedbuf : Bounded_String; - begin - Add (Str => "getstr test: "); - Set_Echo_Mode (SwitchOn => True); - -- Note that if delay mode is set - -- Get can raise an exception. - -- The C version would print the string it had so far - -- also TODO get longer length string, like the C version - declare begin - myGet (Str => boundedbuf); - exception when Curses_Exception => - Add (Str => "Timed out."); - Add (Ch => newl); - timedout := True; - end; - -- note that the Ada Get will stop reading at 1024. - if not timedout then - Set_Echo_Mode (SwitchOn => False); - Add (Str => " I saw '"); - myAdd (Str => boundedbuf); - Add (Str => "'."); - Add (Ch => newl); - end if; - end; - elsif c = Character'Pos ('s') then - ShellOut (True); - elsif c = Character'Pos ('x') or c = Character'Pos ('q') or - (c = Key_None and blockflag = Blocking) then - exit; - elsif c = Character'Pos ('?') then - Add (Str => "Type any key to see its keypad value. Also:"); - Add (Ch => newl); - Add (Str => "g -- triggers a getstr test"); - Add (Ch => newl); - Add (Str => "s -- shell out"); - Add (Ch => newl); - Add (Str => "q -- quit"); - Add (Ch => newl); - Add (Str => "? -- repeats this help message"); - Add (Ch => newl); - end if; - - loop - c := Getchar; - exit when c /= Key_None; - if blockflag /= Blocking then - Put (tmp6, incount); -- argh string length! - Add (Str => tmp6); - Add (Str => ": input timed out"); - Add (Ch => newl); - else - Put (tmp6, incount); - Add (Str => tmp6); - Add (Str => ": input error"); - Add (Ch => newl); - exit; - end if; - incount := incount + 1; - end loop; - end loop; - - End_Mouse (tmp2); - Set_Timeout_Mode (Mode => Blocking, Amount => 0); -- amount is ignored - Set_Raw_Mode (SwitchOn => False); - Set_NL_Mode (SwitchOn => True); - Erase; - End_Windows; -end ncurses2.getch_test; diff --git a/Ada95/samples/ncurses2-getch_test.ads b/Ada95/samples/ncurses2-getch_test.ads deleted file mode 100644 index 78a0a48c172..00000000000 --- a/Ada95/samples/ncurses2-getch_test.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.getch_test; diff --git a/Ada95/samples/ncurses2-getopt.adb b/Ada95/samples/ncurses2-getopt.adb deleted file mode 100644 index 29f1fee8281..00000000000 --- a/Ada95/samples/ncurses2-getopt.adb +++ /dev/null @@ -1,163 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2008,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.8 $ --- $Date: 2011/03/19 12:09:51 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- A simplified version of the GNU getopt function --- copyright Free Software Foundtion - -with Ada.Strings.Fixed; -with Ada.Strings.Bounded; -with Ada.Text_IO; use Ada.Text_IO; - -package body ncurses2.getopt is - - nextchar : Natural := 0; - - -- Ncurses doesn't use the non option elements so we are spared - -- the job of computing those. - - -- also the user is not allowed to modify argv or argc - -- Doing so is Erroneous execution. - - -- long options are not handled. - - procedure Qgetopt (retval : out Integer; - argc : Integer; - argv : stringfunc; - -- argv will be the Argument function. - optstring : String; - optind : in out Integer; - -- ignored for ncurses, must be initialized to 1 by - -- the caller - Optarg : out stringa - -- a garbage collector would be useful here. - ) is - - package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200); - use BS; - optargx : Bounded_String; - begin - - if argc < optind then - retval := -1; - return; - end if; - - optargx := To_Bounded_String (""); - - if nextchar = 0 then - - if argv (optind) = "--" then - -- the rest are non-options, we ignore them - retval := -1; - return; - end if; - - if argv (optind)(1) /= '-' or argv (optind)'Length = 1 then - optind := optind + 1; - Optarg := new String'(argv (optind)); - retval := 1; - return; - end if; - - nextchar := 2; -- skip the one hyphen. - end if; - - -- Look at and handle the next short option-character. - declare - c : Character := argv (optind) (nextchar); - temp : constant Natural := - Ada.Strings.Fixed.Index (optstring, String'(1 => c)); - begin - if temp = 0 or c = ':' then - Put_Line (Standard_Error, - argv (optind) & ": invalid option -- " & c); - c := '?'; - return; - end if; - - if optstring (temp + 1) = ':' then - if optstring (temp + 2) = ':' then - -- This is an option that accepts an argument optionally. - if nextchar /= argv (optind)'Length then - optargx := To_Bounded_String - (argv (optind) (nextchar .. argv (optind)'Length)); - else - Optarg := null; - end if; - else - -- This is an option that requires an argument. - if nextchar /= argv (optind)'Length then - optargx := To_Bounded_String - (argv (optind) (nextchar .. argv (optind)'Length)); - optind := optind + 1; - elsif optind = argc then - Put_Line (Standard_Error, - argv (optind) & - ": option requires an argument -- " & c); - if optstring (optstring'First) = ':' then - c := ':'; - else - c := '?'; - end if; - else - -- increment it again when taking next ARGV-elt as argument. - optind := optind + 1; - optargx := To_Bounded_String (argv (optind)); - optind := optind + 1; - end if; - end if; - nextchar := 0; - else -- no argument for the option - if nextchar = argv (optind)'Length then - optind := optind + 1; - nextchar := 0; - else - nextchar := nextchar + 1; - end if; - end if; - - retval := Character'Pos (c); - Optarg := new String'(To_String (optargx)); - return; - end; - end Qgetopt; - -end ncurses2.getopt; diff --git a/Ada95/samples/ncurses2-getopt.ads b/Ada95/samples/ncurses2-getopt.ads deleted file mode 100644 index a8b356e968d..00000000000 --- a/Ada95/samples/ncurses2-getopt.ads +++ /dev/null @@ -1,60 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.2 $ --- $Date: 2006/06/25 14:24:40 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package ncurses2.getopt is - - type stringa is access String; - - type stringfunc is access - function (n : Positive) return String; - - procedure Qgetopt (retval : out Integer; - argc : Integer; - argv : stringfunc; - optstring : String; - optind : in out Integer; - -- ignored for ncurses, must be initialized to 0 - -- by the caller - Optarg : out stringa - -- a garbage collector would be useful here. - ); - -end ncurses2.getopt; diff --git a/Ada95/samples/ncurses2-m.adb b/Ada95/samples/ncurses2-m.adb deleted file mode 100644 index 5b20428c20a..00000000000 --- a/Ada95/samples/ncurses2-m.adb +++ /dev/null @@ -1,448 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.8 $ --- $Date: 2008/07/26 18:47:50 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- TODO use Default_Character where appropriate - --- This is an Ada version of ncurses --- I translated this because it tests the most features. - -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; - -with Ada.Text_IO; use Ada.Text_IO; - -with Ada.Characters.Latin_1; --- with Ada.Characters.Handling; - -with Ada.Command_Line; use Ada.Command_Line; - -with Ada.Strings.Unbounded; - -with ncurses2.util; use ncurses2.util; -with ncurses2.getch_test; -with ncurses2.attr_test; -with ncurses2.color_test; -with ncurses2.demo_panels; -with ncurses2.color_edit; -with ncurses2.slk_test; -with ncurses2.acs_display; -with ncurses2.acs_and_scroll; -with ncurses2.flushinp_test; -with ncurses2.test_sgr_attributes; -with ncurses2.menu_test; -with ncurses2.demo_pad; -with ncurses2.demo_forms; -with ncurses2.overlap_test; -with ncurses2.trace_set; - -with ncurses2.getopt; use ncurses2.getopt; - -package body ncurses2.m is - use Int_IO; - - function To_trace (n : Integer) return Trace_Attribute_Set; - procedure usage; - procedure Set_Terminal_Modes; - function Do_Single_Test (c : Character) return Boolean; - - function To_trace (n : Integer) return Trace_Attribute_Set is - a : Trace_Attribute_Set := (others => False); - m : Integer; - rest : Integer; - begin - m := n mod 2; - if 1 = m then - a.Times := True; - end if; - rest := n / 2; - - m := rest mod 2; - if 1 = m then - a.Tputs := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Update := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Cursor_Move := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Character_Output := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Calls := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Virtual_Puts := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Input_Events := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.TTY_State := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Internal_Calls := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Character_Calls := True; - end if; - rest := rest / 2; - m := rest mod 2; - if 1 = m then - a.Termcap_TermInfo := True; - end if; - - return a; - end To_trace; - - -- these are type Stdscr_Init_Proc; - - function rip_footer ( - Win : Window; - Columns : Column_Count) return Integer; - pragma Convention (C, rip_footer); - - function rip_footer ( - Win : Window; - Columns : Column_Count) return Integer is - begin - Set_Background (Win, (Ch => ' ', - Attr => (Reverse_Video => True, others => False), - Color => 0)); - Erase (Win); - Move_Cursor (Win, 0, 0); - Add (Win, "footer:" & Columns'Img & " columns"); - Refresh_Without_Update (Win); - return 0; -- Curses_OK; - end rip_footer; - - function rip_header ( - Win : Window; - Columns : Column_Count) return Integer; - pragma Convention (C, rip_header); - - function rip_header ( - Win : Window; - Columns : Column_Count) return Integer is - begin - Set_Background (Win, (Ch => ' ', - Attr => (Reverse_Video => True, others => False), - Color => 0)); - Erase (Win); - Move_Cursor (Win, 0, 0); - Add (Win, "header:" & Columns'Img & " columns"); - -- 'Img is a GNAT extention - Refresh_Without_Update (Win); - return 0; -- Curses_OK; - end rip_header; - - procedure usage is - -- type Stringa is access String; - use Ada.Strings.Unbounded; - -- tbl : constant array (Positive range <>) of Stringa := ( - tbl : constant array (Positive range <>) of Unbounded_String - := ( - To_Unbounded_String ("Usage: ncurses [options]"), - To_Unbounded_String (""), - To_Unbounded_String ("Options:"), - To_Unbounded_String (" -a f,b set default-colors " & - "(assumed white-on-black)"), - To_Unbounded_String (" -d use default-colors if terminal " & - "supports them"), - To_Unbounded_String (" -e fmt specify format for soft-keys " & - "test (e)"), - To_Unbounded_String (" -f rip-off footer line " & - "(can repeat)"), - To_Unbounded_String (" -h rip-off header line " & - "(can repeat)"), - To_Unbounded_String (" -s msec specify nominal time for " & - "panel-demo (default: 1, to hold)"), - To_Unbounded_String (" -t mask specify default trace-level " & - "(may toggle with ^T)") - ); - begin - for n in tbl'Range loop - Put_Line (Standard_Error, To_String (tbl (n))); - end loop; - -- exit(EXIT_FAILURE); - -- TODO should we use Set_Exit_Status and throw and exception? - end usage; - - procedure Set_Terminal_Modes is begin - Set_Raw_Mode (SwitchOn => False); - Set_Cbreak_Mode (SwitchOn => True); - Set_Echo_Mode (SwitchOn => False); - Allow_Scrolling (Mode => True); - Use_Insert_Delete_Line (Do_Idl => True); - Set_KeyPad_Mode (SwitchOn => True); - end Set_Terminal_Modes; - - nap_msec : Integer := 1; - - function Do_Single_Test (c : Character) return Boolean is - begin - case c is - when 'a' => - getch_test; - when 'b' => - attr_test; - when 'c' => - if not Has_Colors then - Cannot ("does not support color."); - else - color_test; - end if; - when 'd' => - if not Has_Colors then - Cannot ("does not support color."); - elsif not Can_Change_Color then - Cannot ("has hardwired color values."); - else - color_edit; - end if; - when 'e' => - slk_test; - when 'f' => - acs_display; - when 'o' => - demo_panels (nap_msec); - when 'g' => - acs_and_scroll; - when 'i' => - flushinp_test (Standard_Window); - when 'k' => - test_sgr_attributes; - when 'm' => - menu_test; - when 'p' => - demo_pad; - when 'r' => - demo_forms; - when 's' => - overlap_test; - when 't' => - trace_set; - when '?' => - null; - when others => return False; - end case; - return True; - end Do_Single_Test; - - command : Character; - my_e_param : Soft_Label_Key_Format := Four_Four; - assumed_colors : Boolean := False; - default_colors : Boolean := False; - default_fg : Color_Number := White; - default_bg : Color_Number := Black; - -- nap_msec was an unsigned long integer in the C version, - -- yet napms only takes an int! - - c : Integer; - c2 : Character; - optind : Integer := 1; -- must be initialized to one. - optarg : getopt.stringa; - - length : Integer; - tmpi : Integer; - - package myio is new Ada.Text_IO.Integer_IO (Integer); - use myio; - - save_trace : Integer := 0; - save_trace_set : Trace_Attribute_Set; - - function main return Integer is - begin - loop - Qgetopt (c, Argument_Count, Argument'Access, - "a:de:fhs:t:", optind, optarg); - exit when c = -1; - c2 := Character'Val (c); - case c2 is - when 'a' => - -- Ada doesn't have scanf, it doesn't even have a - -- regular expression library. - assumed_colors := True; - myio.Get (optarg.all, Integer (default_fg), length); - myio.Get (optarg.all (length + 2 .. optarg.all'Length), - Integer (default_bg), length); - when 'd' => - default_colors := True; - when 'e' => - myio.Get (optarg.all, tmpi, length); - if tmpi > 3 then - usage; - return 1; - end if; - my_e_param := Soft_Label_Key_Format'Val (tmpi); - when 'f' => - Rip_Off_Lines (-1, rip_footer'Access); - when 'h' => - Rip_Off_Lines (1, rip_header'Access); - when 's' => - myio.Get (optarg.all, nap_msec, length); - when 't' => - myio.Get (optarg.all, save_trace, length); - when others => - usage; - return 1; - end case; - end loop; - - -- the C version had a bunch of macros here. - - -- if (!isatty(fileno(stdin))) - -- isatty is not available in the standard Ada so skip it. - save_trace_set := To_trace (save_trace); - Trace_On (save_trace_set); - - Init_Soft_Label_Keys (my_e_param); - - Init_Screen; - Set_Background (Ch => (Ch => Blank, - Attr => Normal_Video, - Color => Color_Pair'First)); - - if Has_Colors then - Start_Color; - if default_colors then - Use_Default_Colors; - elsif assumed_colors then - Assume_Default_Colors (default_fg, default_bg); - end if; - end if; - - Set_Terminal_Modes; - Save_Curses_Mode (Curses); - - End_Windows; - - -- TODO add macro #if blocks. - Put_Line ("Welcome to " & Curses_Version & ". Press ? for help."); - - loop - Put_Line ("This is the ncurses main menu"); - Put_Line ("a = keyboard and mouse input test"); - Put_Line ("b = character attribute test"); - Put_Line ("c = color test pattern"); - Put_Line ("d = edit RGB color values"); - Put_Line ("e = exercise soft keys"); - Put_Line ("f = display ACS characters"); - Put_Line ("g = display windows and scrolling"); - Put_Line ("i = test of flushinp()"); - Put_Line ("k = display character attributes"); - Put_Line ("m = menu code test"); - Put_Line ("o = exercise panels library"); - Put_Line ("p = exercise pad features"); - Put_Line ("q = quit"); - Put_Line ("r = exercise forms code"); - Put_Line ("s = overlapping-refresh test"); - Put_Line ("t = set trace level"); - Put_Line ("? = repeat this command summary"); - - Put ("> "); - Flush; - - command := Ada.Characters.Latin_1.NUL; - -- get_input: - -- loop - declare - Ch : Character; - begin - Get (Ch); - -- TODO if read(ch) <= 0 - -- TODO ada doesn't have an Is_Space function - command := Ch; - -- TODO if ch = '\n' or '\r' are these in Ada? - end; - -- end loop get_input; - - declare - begin - if Do_Single_Test (command) then - Flush_Input; - Set_Terminal_Modes; - Reset_Curses_Mode (Curses); - Clear; - Refresh; - End_Windows; - if command = '?' then - Put_Line ("This is the ncurses capability tester."); - Put_Line ("You may select a test from the main menu by " & - "typing the"); - Put_Line ("key letter of the choice (the letter to left " & - "of the =)"); - Put_Line ("at the > prompt. The commands `x' or `q' will " & - "exit."); - end if; - -- continue; --why continue in the C version? - end if; - exception - when Curses_Exception => End_Windows; - end; - - exit when command = 'q'; - end loop; - Curses_Free_All; - return 0; -- TODO ExitProgram(EXIT_SUCCESS); - end main; - -end ncurses2.m; diff --git a/Ada95/samples/ncurses2-m.ads b/Ada95/samples/ncurses2-m.ads deleted file mode 100644 index c32d895dc14..00000000000 --- a/Ada95/samples/ncurses2-m.ads +++ /dev/null @@ -1,43 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package ncurses2.m is - function main return Integer; -end ncurses2.m; diff --git a/Ada95/samples/ncurses2-menu_test.adb b/Ada95/samples/ncurses2-menu_test.adb deleted file mode 100644 index bce9782372a..00000000000 --- a/Ada95/samples/ncurses2-menu_test.adb +++ /dev/null @@ -1,168 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2006,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.8 $ --- $Date: 2011/03/23 00:39:28 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; - -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; -with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; - -procedure ncurses2.menu_test is - function menu_virtualize (c : Key_Code) return Key_Code; - procedure xAdd (l : Line_Position; c : Column_Position; s : String); - - function menu_virtualize (c : Key_Code) return Key_Code is - begin - case c is - when Character'Pos (newl) | Key_Exit => - return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO - when Character'Pos ('u') => - return M_ScrollUp_Line; - when Character'Pos ('d') => - return M_ScrollDown_Line; - when Character'Pos ('b') | Key_Next_Page => - return M_ScrollUp_Page; - when Character'Pos ('f') | Key_Previous_Page => - return M_ScrollDown_Page; - when Character'Pos ('n') | Key_Cursor_Down => - return M_Next_Item; - when Character'Pos ('p') | Key_Cursor_Up => - return M_Previous_Item; - when Character'Pos (' ') => - return M_Toggle_Item; - when Key_Mouse => - return c; - when others => - Beep; - return c; - end case; - end menu_virtualize; - - MENU_Y : constant Line_Count := 8; - MENU_X : constant Column_Count := 8; - - type String_Access is access String; - - animals : constant array (Positive range <>) of String_Access := - (new String'("Lions"), - new String'("Tigers"), - new String'("Bears"), - new String'("(Oh my!)"), - new String'("Newts"), - new String'("Platypi"), - new String'("Lemurs")); - - items_a : constant Item_Array_Access := - new Item_Array (1 .. animals'Last + 1); - - tmp : Event_Mask; - - procedure xAdd (l : Line_Position; c : Column_Position; s : String) is - begin - Add (Line => l, Column => c, Str => s); - end xAdd; - - mrows : Line_Count; - mcols : Column_Count; - - menuwin : Window; - - m : Menu; - - c1 : Key_Code; - - c : Driver_Result; - r : Key_Code; -begin - tmp := Start_Mouse; - xAdd (0, 0, "This is the menu test:"); - xAdd (2, 0, " Use up and down arrow to move the select bar."); - xAdd (3, 0, " 'n' and 'p' act like arrows."); - xAdd (4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); - xAdd (5, 0, " Press return to exit."); - Refresh; - - for i in animals'Range loop - items_a.all (i) := New_Item (animals (i).all); - end loop; - items_a.all (animals'Last + 1) := Null_Item; - - m := New_Menu (items_a); - - Set_Format (m, Line_Position (animals'Last + 1) / 2, 1); - Scale (m, mrows, mcols); - - menuwin := Create (mrows + 2, mcols + 2, MENU_Y, MENU_X); - Set_Window (m, menuwin); - Set_KeyPad_Mode (menuwin, True); - Box (menuwin); -- 0,0? - - Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); - - Post (m); - - loop - c1 := Getchar (menuwin); - r := menu_virtualize (c1); - c := Driver (m, r); - exit when c = Unknown_Request; -- E_UNKNOWN_COMMAND? - if c = Request_Denied then - Beep; - end if; - -- continue ? - end loop; - - Move_Cursor (Line => Lines - 2, Column => 0); - Add (Str => "You chose: "); - Add (Str => Name (Current (m))); - Add (Ch => newl); - Pause; -- the C version didn't use Pause, it spelled it out - - Post (m, False); -- unpost, not clear :-( - declare begin - Delete (menuwin); - exception when Curses_Exception => null; end; - -- menuwin has children so will raise the exception. - - Delete (m); - - End_Mouse (tmp); -end ncurses2.menu_test; diff --git a/Ada95/samples/ncurses2-menu_test.ads b/Ada95/samples/ncurses2-menu_test.ads deleted file mode 100644 index 17e5b16b3e4..00000000000 --- a/Ada95/samples/ncurses2-menu_test.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.menu_test; diff --git a/Ada95/samples/ncurses2-overlap_test.adb b/Ada95/samples/ncurses2-overlap_test.adb deleted file mode 100644 index ddf8a9a31f6..00000000000 --- a/Ada95/samples/ncurses2-overlap_test.adb +++ /dev/null @@ -1,157 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2004,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.5 $ --- $Date: 2011/03/19 12:07:18 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - --- test effects of overlapping windows - -procedure ncurses2.overlap_test is - - procedure fillwin (win : Window; ch : Character); - procedure crosswin (win : Window; ch : Character); - - procedure fillwin (win : Window; ch : Character) is - y1 : Line_Position; - x1 : Column_Position; - begin - Get_Size (win, y1, x1); - for y in 0 .. y1 - 1 loop - Move_Cursor (win, y, 0); - for x in 0 .. x1 - 1 loop - Add (win, Ch => ch); - end loop; - end loop; - exception - when Curses_Exception => null; - -- write to lower right corner - end fillwin; - - procedure crosswin (win : Window; ch : Character) is - y1 : Line_Position; - x1 : Column_Position; - begin - Get_Size (win, y1, x1); - for y in 0 .. y1 - 1 loop - for x in 0 .. x1 - 1 loop - if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3)) - or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3))) then - Move_Cursor (win, y, x); - Add (win, Ch => ch); - end if; - end loop; - end loop; - end crosswin; - - -- In a 24x80 screen like some xterms are, the instructions will - -- be overwritten. - ch : Character; - win1 : Window := New_Window (9, 20, 3, 3); - win2 : Window := New_Window (9, 20, 9, 16); -begin - Set_Raw_Mode (SwitchOn => True); - Refresh; - Move_Cursor (Line => 0, Column => 0); - Add (Str => "This test shows the behavior of wnoutrefresh() with " & - "respect to"); - Add (Ch => newl); - Add (Str => "the shared region of two overlapping windows A and B. "& - "The cross"); - Add (Ch => newl); - Add (Str => "pattern in each window does not overlap the other."); - Add (Ch => newl); - - Move_Cursor (Line => 18, Column => 0); - Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " & - "then A, then doupdate"); - Add (Ch => newl); - Add (Str => "c = fill window A with letter A. d = fill window B " & - "with letter B."); - Add (Ch => newl); - Add (Str => "e = cross pattern in window A. f = cross pattern " & - "in window B."); - Add (Ch => newl); - Add (Str => "g = clear window A. h = clear window B."); - Add (Ch => newl); - Add (Str => "i = overwrite A onto B. j = overwrite " & - "B onto A."); - Add (Ch => newl); - Add (Str => "^Q/ESC = terminate test."); - - loop - ch := Code_To_Char (Getchar); - exit when ch = CTRL ('Q') or ch = CTRL ('['); -- QUIT or ESCAPE - case ch is - when 'a' => -- refresh window A first, then B - Refresh_Without_Update (win1); - Refresh_Without_Update (win2); - Update_Screen; - when 'b' => -- refresh window B first, then A - Refresh_Without_Update (win2); - Refresh_Without_Update (win1); - Update_Screen; - when 'c' => -- fill window A so it's visible - fillwin (win1, 'A'); - when 'd' => -- fill window B so it's visible - fillwin (win2, 'B'); - when 'e' => -- cross test pattern in window A - crosswin (win1, 'A'); - when 'f' => -- cross test pattern in window B - crosswin (win2, 'B'); - when 'g' => -- clear window A - Clear (win1); - Move_Cursor (win1, 0, 0); - when 'h' => -- clear window B - Clear (win2); - Move_Cursor (win2, 0, 0); - when 'i' => -- overwrite A onto B - Overwrite (win1, win2); - when 'j' => -- overwrite B onto A - Overwrite (win2, win1); - when others => null; - end case; - end loop; - - Delete (win2); - Delete (win1); - Erase; - End_Windows; -end ncurses2.overlap_test; diff --git a/Ada95/samples/ncurses2-overlap_test.ads b/Ada95/samples/ncurses2-overlap_test.ads deleted file mode 100644 index ce6e3e69612..00000000000 --- a/Ada95/samples/ncurses2-overlap_test.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.overlap_test; diff --git a/Ada95/samples/ncurses2-slk_test.adb b/Ada95/samples/ncurses2-slk_test.adb deleted file mode 100644 index aa368ba5f9c..00000000000 --- a/Ada95/samples/ncurses2-slk_test.adb +++ /dev/null @@ -1,174 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2009,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.9 $ --- $Date: 2011/03/19 12:03:08 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -with Ada.Strings.Unbounded; -with Interfaces.C; -with Terminal_Interface.Curses.Aux; - -procedure ncurses2.slk_test is - procedure myGet (Win : Window := Standard_Window; - Str : out Ada.Strings.Unbounded.Unbounded_String; - Len : Integer := -1); - - procedure myGet (Win : Window := Standard_Window; - Str : out Ada.Strings.Unbounded.Unbounded_String; - Len : Integer := -1) - is - use Ada.Strings.Unbounded; - use Interfaces.C; - use Terminal_Interface.Curses.Aux; - - function Wgetnstr (Win : Window; - Str : char_array; - Len : int) return int; - pragma Import (C, Wgetnstr, "wgetnstr"); - - -- FIXME: how to construct "(Len > 0) ? Len : 80"? - Ask : constant Interfaces.C.size_t := Interfaces.C.size_t'Val (Len + 80); - Txt : char_array (0 .. Ask); - - begin - Txt (0) := Interfaces.C.char'First; - if Wgetnstr (Win, Txt, Txt'Length) = Curses_Err then - raise Curses_Exception; - end if; - Str := To_Unbounded_String (To_Ada (Txt, True)); - end myGet; - - use Int_IO; - - use Ada.Strings.Unbounded; - - c : Key_Code; - buf : Unbounded_String; - c2 : Character; - fmt : Label_Justification := Centered; - tmp : Integer; - -begin - c := CTRL ('l'); - loop - Move_Cursor (Line => 0, Column => 0); - c2 := Code_To_Char (c); - case c2 is - when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l') - Erase; - Switch_Character_Attribute (Attr => (Bold_Character => True, - others => False)); - Add (Line => 0, Column => 20, - Str => "Soft Key Exerciser"); - Switch_Character_Attribute (On => False, - Attr => (Bold_Character => True, - others => False)); - - Move_Cursor (Line => 2, Column => 0); - P ("Available commands are:"); - P (""); - P ("^L -- refresh screen"); - P ("a -- activate or restore soft keys"); - P ("d -- disable soft keys"); - P ("c -- set centered format for labels"); - P ("l -- set left-justified format for labels"); - P ("r -- set right-justified format for labels"); - P ("[12345678] -- set label; labels are numbered 1 through 8"); - P ("e -- erase stdscr (should not erase labels)"); - P ("s -- test scrolling of shortened screen"); - P ("x, q -- return to main menu"); - P (""); - P ("Note: if activating the soft keys causes your terminal to"); - P ("scroll up one line, your terminal auto-scrolls when anything"); - P ("is written to the last screen position. The ncurses code"); - P ("does not yet handle this gracefully."); - Refresh; - Restore_Soft_Label_Keys; - - when 'a' => - Restore_Soft_Label_Keys; - when 'e' => - Clear; - when 's' => - Add (Line => 20, Column => 0, - Str => "Press Q to stop the scrolling-test: "); - loop - c := Getchar; - c2 := Code_To_Char (c); - exit when c2 = 'Q'; - -- c = ERR? - -- TODO when c is not a character (arrow key) - -- the behavior is different from the C version. - Add (Ch => c2); - end loop; - when 'd' => - Clear_Soft_Label_Keys; - when 'l' => - fmt := Left; - when 'c' => - fmt := Centered; - when 'r' => - fmt := Right; - when '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' => - Add (Line => 20, Column => 0, - Str => "Please enter the label value: "); - Set_Echo_Mode (SwitchOn => True); - myGet (Str => buf); - Set_Echo_Mode (SwitchOn => False); - tmp := ctoi (c2); - Set_Soft_Label_Key (Label_Number (tmp), To_String (buf), fmt); - Refresh_Soft_Label_Keys; - Move_Cursor (Line => 20, Column => 0); - Clear_To_End_Of_Line; - when 'x' | 'q' => - exit; - -- the C version needed a goto, ha ha - -- breaks exit the case not the loop because fall-through - -- happens in C! - when others => - Beep; - end case; - c := Getchar; - -- TODO exit when c = EOF - end loop; - Erase; - End_Windows; -end ncurses2.slk_test; diff --git a/Ada95/samples/ncurses2-slk_test.ads b/Ada95/samples/ncurses2-slk_test.ads deleted file mode 100644 index 51e95871a97..00000000000 --- a/Ada95/samples/ncurses2-slk_test.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.slk_test; diff --git a/Ada95/samples/ncurses2-test_sgr_attributes.adb b/Ada95/samples/ncurses2-test_sgr_attributes.adb deleted file mode 100644 index 97449a40caf..00000000000 --- a/Ada95/samples/ncurses2-test_sgr_attributes.adb +++ /dev/null @@ -1,185 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.2 $ --- $Date: 2006/06/25 14:24:40 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with ncurses2.util; use ncurses2.util; - --- Graphic-rendition test (adapted from vttest) - -procedure ncurses2.test_sgr_attributes is - - procedure xAdd (l : Line_Position; c : Column_Position; s : String); - - procedure xAdd (l : Line_Position; c : Column_Position; s : String) is - begin - Add (Line => l, Column => c, Str => s); - end xAdd; - - normal, current : Attributed_Character; -begin - for pass in reverse Boolean loop - if pass then - normal := (Ch => ' ', Attr => Normal_Video, Color => 0); - else - normal := (Ch => ' ', Attr => - (Reverse_Video => True, others => False), Color => 0); - end if; - - -- Use non-default colors if possible to exercise bce a little - if Has_Colors then - Init_Pair (1, White, Blue); - normal.Color := 1; - end if; - Set_Background (Ch => normal); - Erase; - xAdd (1, 20, "Graphic rendition test pattern:"); - - xAdd (4, 1, "vanilla"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - Set_Background (Ch => current); - xAdd (4, 40, "bold"); - - current := normal; - current.Attr.Under_Line := not current.Attr.Under_Line; - Set_Background (Ch => current); - xAdd (6, 6, "underline"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - current.Attr.Under_Line := not current.Attr.Under_Line; - Set_Background (Ch => current); - xAdd (6, 45, "bold underline"); - - current := normal; - current.Attr.Blink := not current.Attr.Blink; - Set_Background (Ch => current); - xAdd (8, 1, "blink"); - - current := normal; - current.Attr.Blink := not current.Attr.Blink; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - Set_Background (Ch => current); - xAdd (8, 40, "bold blink"); - - current := normal; - current.Attr.Under_Line := not current.Attr.Under_Line; - current.Attr.Blink := not current.Attr.Blink; - Set_Background (Ch => current); - xAdd (10, 6, "underline blink"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - current.Attr.Under_Line := not current.Attr.Under_Line; - current.Attr.Blink := not current.Attr.Blink; - Set_Background (Ch => current); - xAdd (10, 45, "bold underline blink"); - - current := normal; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (12, 1, "negative"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (12, 40, "bold negative"); - - current := normal; - current.Attr.Under_Line := not current.Attr.Under_Line; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (14, 6, "underline negative"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - current.Attr.Under_Line := not current.Attr.Under_Line; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (14, 45, "bold underline negative"); - - current := normal; - current.Attr.Blink := not current.Attr.Blink; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (16, 1, "blink negative"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - current.Attr.Blink := not current.Attr.Blink; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (16, 40, "bold blink negative"); - - current := normal; - current.Attr.Under_Line := not current.Attr.Under_Line; - current.Attr.Blink := not current.Attr.Blink; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (18, 6, "underline blink negative"); - - current := normal; - current.Attr.Bold_Character := not current.Attr.Bold_Character; - current.Attr.Under_Line := not current.Attr.Under_Line; - current.Attr.Blink := not current.Attr.Blink; - current.Attr.Reverse_Video := not current.Attr.Reverse_Video; - Set_Background (Ch => current); - xAdd (18, 45, "bold underline blink negative"); - - Set_Background (Ch => normal); - Move_Cursor (Line => Lines - 2, Column => 1); - if pass then - Add (Str => "Dark"); - else - Add (Str => "Light"); - end if; - Add (Str => " background. "); - Clear_To_End_Of_Line; - Pause; - end loop; - - Set_Background (Ch => Blank2); - Erase; - End_Windows; - -end ncurses2.test_sgr_attributes; diff --git a/Ada95/samples/ncurses2-test_sgr_attributes.ads b/Ada95/samples/ncurses2-test_sgr_attributes.ads deleted file mode 100644 index 241118094e1..00000000000 --- a/Ada95/samples/ncurses2-test_sgr_attributes.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.test_sgr_attributes; diff --git a/Ada95/samples/ncurses2-trace_set.adb b/Ada95/samples/ncurses2-trace_set.adb deleted file mode 100644 index 7537afe407e..00000000000 --- a/Ada95/samples/ncurses2-trace_set.adb +++ /dev/null @@ -1,480 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses2.trace_set -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2008,2011 Free 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.5 $ --- $Date: 2011/03/23 00:40:33 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with ncurses2.util; use ncurses2.util; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; -with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; - -with Ada.Strings.Bounded; - --- interactively set the trace level - -procedure ncurses2.trace_set is - - function menu_virtualize (c : Key_Code) return Key_Code; - function subset (super, sub : Trace_Attribute_Set) return Boolean; - function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set; - function trace_num (tlevel : Trace_Attribute_Set) return String; - function tracetrace (tlevel : Trace_Attribute_Set) return String; - function run_trace_menu (m : Menu; count : Integer) return Boolean; - - function menu_virtualize (c : Key_Code) return Key_Code is - begin - case c is - when Character'Pos (newl) | Key_Exit => - return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO - when Character'Pos ('u') => - return M_ScrollUp_Line; - when Character'Pos ('d') => - return M_ScrollDown_Line; - when Character'Pos ('b') | Key_Next_Page => - return M_ScrollUp_Page; - when Character'Pos ('f') | Key_Previous_Page => - return M_ScrollDown_Page; - when Character'Pos ('n') | Key_Cursor_Down => - return M_Next_Item; - when Character'Pos ('p') | Key_Cursor_Up => - return M_Previous_Item; - when Character'Pos (' ') => - return M_Toggle_Item; - when Key_Mouse => - return c; - when others => - Beep; - return c; - end case; - end menu_virtualize; - - type string_a is access String; - type tbl_entry is record - name : string_a; - mask : Trace_Attribute_Set; - end record; - - t_tbl : constant array (Positive range <>) of tbl_entry := - ( - (new String'("Disable"), - Trace_Disable), - (new String'("Times"), - Trace_Attribute_Set'(Times => True, others => False)), - (new String'("Tputs"), - Trace_Attribute_Set'(Tputs => True, others => False)), - (new String'("Update"), - Trace_Attribute_Set'(Update => True, others => False)), - (new String'("Cursor_Move"), - Trace_Attribute_Set'(Cursor_Move => True, others => False)), - (new String'("Character_Output"), - Trace_Attribute_Set'(Character_Output => True, others => False)), - (new String'("Ordinary"), - Trace_Ordinary), - (new String'("Calls"), - Trace_Attribute_Set'(Calls => True, others => False)), - (new String'("Virtual_Puts"), - Trace_Attribute_Set'(Virtual_Puts => True, others => False)), - (new String'("Input_Events"), - Trace_Attribute_Set'(Input_Events => True, others => False)), - (new String'("TTY_State"), - Trace_Attribute_Set'(TTY_State => True, others => False)), - (new String'("Internal_Calls"), - Trace_Attribute_Set'(Internal_Calls => True, others => False)), - (new String'("Character_Calls"), - Trace_Attribute_Set'(Character_Calls => True, others => False)), - (new String'("Termcap_TermInfo"), - Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)), - (new String'("Maximium"), - Trace_Maximum) - ); - - package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (300); - - function subset (super, sub : Trace_Attribute_Set) return Boolean is - begin - if - (super.Times or not sub.Times) and - (super.Tputs or not sub.Tputs) and - (super.Update or not sub.Update) and - (super.Cursor_Move or not sub.Cursor_Move) and - (super.Character_Output or not sub.Character_Output) and - (super.Calls or not sub.Calls) and - (super.Virtual_Puts or not sub.Virtual_Puts) and - (super.Input_Events or not sub.Input_Events) and - (super.TTY_State or not sub.TTY_State) and - (super.Internal_Calls or not sub.Internal_Calls) and - (super.Character_Calls or not sub.Character_Calls) and - (super.Termcap_TermInfo or not sub.Termcap_TermInfo) and - True then - return True; - else - return False; - end if; - end subset; - - function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set is - retval : Trace_Attribute_Set := Trace_Disable; - begin - retval.Times := (a.Times or b.Times); - retval.Tputs := (a.Tputs or b.Tputs); - retval.Update := (a.Update or b.Update); - retval.Cursor_Move := (a.Cursor_Move or b.Cursor_Move); - retval.Character_Output := (a.Character_Output or b.Character_Output); - retval.Calls := (a.Calls or b.Calls); - retval.Virtual_Puts := (a.Virtual_Puts or b.Virtual_Puts); - retval.Input_Events := (a.Input_Events or b.Input_Events); - retval.TTY_State := (a.TTY_State or b.TTY_State); - retval.Internal_Calls := (a.Internal_Calls or b.Internal_Calls); - retval.Character_Calls := (a.Character_Calls or b.Character_Calls); - retval.Termcap_TermInfo := (a.Termcap_TermInfo or b.Termcap_TermInfo); - - return retval; - end trace_or; - - -- Print the hexadecimal value of the mask so - -- users can set it from the command line. - - function trace_num (tlevel : Trace_Attribute_Set) return String is - result : Integer := 0; - m : Integer := 1; - begin - - if tlevel.Times then - result := result + m; - end if; - m := m * 2; - - if tlevel.Tputs then - result := result + m; - end if; - m := m * 2; - - if tlevel.Update then - result := result + m; - end if; - m := m * 2; - - if tlevel.Cursor_Move then - result := result + m; - end if; - m := m * 2; - - if tlevel.Character_Output then - result := result + m; - end if; - m := m * 2; - - if tlevel.Calls then - result := result + m; - end if; - m := m * 2; - - if tlevel.Virtual_Puts then - result := result + m; - end if; - m := m * 2; - - if tlevel.Input_Events then - result := result + m; - end if; - m := m * 2; - - if tlevel.TTY_State then - result := result + m; - end if; - m := m * 2; - - if tlevel.Internal_Calls then - result := result + m; - end if; - m := m * 2; - - if tlevel.Character_Calls then - result := result + m; - end if; - m := m * 2; - - if tlevel.Termcap_TermInfo then - result := result + m; - end if; - m := m * 2; - return result'Img; - end trace_num; - - function tracetrace (tlevel : Trace_Attribute_Set) return String is - - use BS; - buf : Bounded_String := To_Bounded_String (""); - begin - -- The C version prints the hexadecimal value of the mask, we - -- won't do that here because this is Ada. - - if tlevel = Trace_Disable then - Append (buf, "Trace_Disable"); - else - - if subset (tlevel, - Trace_Attribute_Set'(Times => True, others => False)) then - Append (buf, "Times"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Tputs => True, others => False)) then - Append (buf, "Tputs"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Update => True, others => False)) then - Append (buf, "Update"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Cursor_Move => True, - others => False)) then - Append (buf, "Cursor_Move"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Character_Output => True, - others => False)) then - Append (buf, "Character_Output"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Ordinary) then - Append (buf, "Ordinary"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Calls => True, others => False)) then - Append (buf, "Calls"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Virtual_Puts => True, - others => False)) then - Append (buf, "Virtual_Puts"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Input_Events => True, - others => False)) then - Append (buf, "Input_Events"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(TTY_State => True, - others => False)) then - Append (buf, "TTY_State"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Internal_Calls => True, - others => False)) then - Append (buf, "Internal_Calls"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Character_Calls => True, - others => False)) then - Append (buf, "Character_Calls"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Attribute_Set'(Termcap_TermInfo => True, - others => False)) then - Append (buf, "Termcap_TermInfo"); - Append (buf, ", "); - end if; - - if subset (tlevel, - Trace_Maximum) then - Append (buf, "Maximium"); - Append (buf, ", "); - end if; - end if; - - if To_String (buf) (Length (buf) - 1) = ',' then - Delete (buf, Length (buf) - 1, Length (buf)); - end if; - - return To_String (buf); - end tracetrace; - - function run_trace_menu (m : Menu; count : Integer) return Boolean is - i, p : Item; - changed : Boolean; - c, v : Key_Code; - begin - loop - changed := (count /= 0); - c := Getchar (Get_Window (m)); - v := menu_virtualize (c); - case Driver (m, v) is - when Unknown_Request => - return False; - when others => - i := Current (m); - if i = Menus.Items (m, 1) then -- the first item - for n in t_tbl'First + 1 .. t_tbl'Last loop - if Value (i) then - Set_Value (i, False); - changed := True; - end if; - end loop; - else - for n in t_tbl'First + 1 .. t_tbl'Last loop - p := Menus.Items (m, n); - if Value (p) then - Set_Value (Menus.Items (m, 1), False); - changed := True; - exit; - end if; - end loop; - end if; - if not changed then - return True; - end if; - end case; - end loop; - end run_trace_menu; - - nc_tracing, mask : Trace_Attribute_Set; - pragma Import (C, nc_tracing, "_nc_tracing"); - items_a : constant Item_Array_Access := - new Item_Array (t_tbl'First .. t_tbl'Last + 1); - mrows : Line_Count; - mcols : Column_Count; - menuwin : Window; - menu_y : constant Line_Position := 8; - menu_x : constant Column_Position := 8; - ip : Item; - m : Menu; - count : Integer; - newtrace : Trace_Attribute_Set; -begin - Add (Line => 0, Column => 0, Str => "Interactively set trace level:"); - Add (Line => 2, Column => 0, - Str => " Press space bar to toggle a selection."); - Add (Line => 3, Column => 0, - Str => " Use up and down arrow to move the select bar."); - Add (Line => 4, Column => 0, - Str => " Press return to set the trace level."); - Add (Line => 6, Column => 0, Str => "(Current trace level is "); - Add (Str => tracetrace (nc_tracing) & " numerically: " & - trace_num (nc_tracing)); - Add (Ch => ')'); - - Refresh; - - for n in t_tbl'Range loop - items_a.all (n) := New_Item (t_tbl (n).name.all); - end loop; - items_a.all (t_tbl'Last + 1) := Null_Item; - - m := New_Menu (items_a); - - Set_Format (m, 16, 2); - Scale (m, mrows, mcols); - - Switch_Options (m, (One_Valued => True, others => False), On => False); - menuwin := New_Window (mrows + 2, mcols + 2, menu_y, menu_x); - Set_Window (m, menuwin); - Set_KeyPad_Mode (menuwin, SwitchOn => True); - Box (menuwin); - - Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1)); - - Post (m); - - for n in t_tbl'Range loop - ip := Items (m, n); - mask := t_tbl (n).mask; - if mask = Trace_Disable then - Set_Value (ip, nc_tracing = Trace_Disable); - elsif subset (sub => mask, super => nc_tracing) then - Set_Value (ip, True); - end if; - end loop; - - count := 1; - while run_trace_menu (m, count) loop - count := count + 1; - end loop; - - newtrace := Trace_Disable; - for n in t_tbl'Range loop - ip := Items (m, n); - if Value (ip) then - mask := t_tbl (n).mask; - newtrace := trace_or (newtrace, mask); - end if; - end loop; - - Trace_On (newtrace); - Trace_Put ("trace level interactively set to " & - tracetrace (nc_tracing)); - - Move_Cursor (Line => Lines - 4, Column => 0); - Add (Str => "Trace level is "); - Add (Str => tracetrace (nc_tracing)); - Add (Ch => newl); - Pause; -- was just Add(); Getchar - - Post (m, False); - -- menuwin has subwindows I think, which makes an error. - declare begin - Delete (menuwin); - exception when Curses_Exception => null; end; - - -- free_menu(m); - -- free_item() -end ncurses2.trace_set; diff --git a/Ada95/samples/ncurses2-trace_set.ads b/Ada95/samples/ncurses2-trace_set.ads deleted file mode 100644 index 7bbf8ca5450..00000000000 --- a/Ada95/samples/ncurses2-trace_set.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses2.trace_set -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure ncurses2.trace_set; diff --git a/Ada95/samples/ncurses2-util.adb b/Ada95/samples/ncurses2-util.adb deleted file mode 100644 index 8ae327242ba..00000000000 --- a/Ada95/samples/ncurses2-util.adb +++ /dev/null @@ -1,190 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses2.util -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-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 -- --- "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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.7 $ --- $Date: 2008/07/26 18:51:20 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; use Ada.Text_IO; - -pragma Warnings (Off); -with Terminal_Interface.Curses.Aux; -pragma Warnings (On); - -with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace; - -with Interfaces.C; -with Interfaces.C.Strings; - -with Ada.Characters.Handling; - -with ncurses2.genericPuts; - -package body ncurses2.util is - - -- #defines from C - -- #define CTRL(x) ((x) & 0x1f) - function CTRL (c : Character) return Key_Code is - begin - return Character'Pos (c) mod 16#20#; - -- uses a property of ASCII - -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# - end CTRL; - - function CTRL (c : Character) return Character is - begin - return Character'Val (Character'Pos (c) mod 16#20#); - -- uses a property of ASCII - -- A = 16#41#; a = 16#61#; ^A = 1 or 16#1# - end CTRL; - - save_trace : Trace_Attribute_Set; - -- Common function to allow ^T to toggle trace-mode in the middle of a test - -- so that trace-files can be made smaller. - function Getchar (win : Window := Standard_Window) return Key_Code is - c : Key_Code; - begin - -- #ifdef TRACE - c := Get_Keystroke (win); - while c = CTRL ('T') loop - -- if _nc_tracing in C - if Current_Trace_Setting /= Trace_Disable then - save_trace := Current_Trace_Setting; - Trace_Put ("TOGGLE-TRACING OFF"); - Current_Trace_Setting := Trace_Disable; - else - Current_Trace_Setting := save_trace; - end if; - Trace_On (Current_Trace_Setting); - if Current_Trace_Setting /= Trace_Disable then - Trace_Put ("TOGGLE-TRACING ON"); - end if; - end loop; - -- #else c := Get_Keystroke; - return c; - end Getchar; - - procedure Getchar (win : Window := Standard_Window) is - begin - if Getchar (win) < 0 then - Beep; - end if; - end Getchar; - - procedure Pause is - begin - Move_Cursor (Line => Lines - 1, Column => 0); - Add (Str => "Press any key to continue... "); - Getchar; - end Pause; - - procedure Cannot (s : String) is - use Interfaces.C; - use Interfaces.C.Strings; - use Terminal_Interface.Curses.Aux; - function getenv (x : char_array) return chars_ptr; - pragma Import (C, getenv, "getenv"); - tmp1 : char_array (0 .. 10); - package p is new ncurses2.genericPuts (1024); - use p; - use p.BS; - - tmpb : BS.Bounded_String; - - Length : size_t; - begin - To_C ("TERM", tmp1, Length); - Fill_String (getenv (tmp1), tmpb); - Add (Ch => newl); - myAdd (Str => "This " & tmpb & " terminal " & s); - Pause; - end Cannot; - - procedure ShellOut (message : Boolean) is - use Interfaces.C; - Txt : char_array (0 .. 10); - Length : size_t; - procedure system (x : char_array); - pragma Import (C, system, "system"); - begin - To_C ("sh", Txt, Length); - if message then - Add (Str => "Shelling out..."); - end if; - Save_Curses_Mode (Mode => Curses); - End_Windows; - system (Txt); - if message then - Add (Str => "returned from shellout."); - Add (Ch => newl); - end if; - Refresh; - end ShellOut; - - function Is_Digit (c : Key_Code) return Boolean is - begin - if c >= 16#100# then - return False; - else - return Ada.Characters.Handling.Is_Digit (Character'Val (c)); - end if; - end Is_Digit; - - procedure P (s : String) is - begin - Add (Str => s); - Add (Ch => newl); - end P; - - function Code_To_Char (c : Key_Code) return Character is - begin - if c > Character'Pos (Character'Last) then - return Character'Val (0); - -- maybe raise exception? - else - return Character'Val (c); - end if; - end Code_To_Char; - - -- This was untestable due to a bug in GNAT (3.12p) - -- Hmm, what bug? I don't remember. - function ctoi (c : Character) return Integer is - begin - return Character'Pos (c) - Character'Pos ('0'); - end ctoi; - -end ncurses2.util; diff --git a/Ada95/samples/ncurses2-util.ads b/Ada95/samples/ncurses2-util.ads deleted file mode 100644 index f46749f0686..00000000000 --- a/Ada95/samples/ncurses2-util.ads +++ /dev/null @@ -1,76 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses2.util -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000,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"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.2 $ --- $Date: 2006/06/25 14:24:40 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -with Ada.Text_IO; -package ncurses2.util is - - Blank : constant Character := ' '; - Blank2 : constant Attributed_Character := - (Ch => Blank, Attr => Normal_Video, Color => Color_Pair'First); - - newl : constant Character := Character'Val (10); - - function CTRL (c : Character) return Key_Code; - - function CTRL (c : Character) return Character; - - function Getchar (win : Window := Standard_Window) return Key_Code; - - procedure Getchar (win : Window := Standard_Window); - - procedure Pause; - - procedure Cannot (s : String); - - procedure ShellOut (message : Boolean); - - package Int_IO is new Ada.Text_IO.Integer_IO (Integer); - - function Is_Digit (c : Key_Code) return Boolean; - - procedure P (s : String); - - function Code_To_Char (c : Key_Code) return Character; - function ctoi (c : Character) return Integer; - -end ncurses2.util; diff --git a/Ada95/samples/ncurses2.ads b/Ada95/samples/ncurses2.ads deleted file mode 100644 index 2fe01970899..00000000000 --- a/Ada95/samples/ncurses2.ads +++ /dev/null @@ -1,44 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- ncurses -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Eugene V. Melaragno 2000 --- Version Control --- $Revision: 1.1 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -package ncurses2 is - pragma Pure (ncurses2); -end ncurses2; diff --git a/Ada95/samples/rain.adb b/Ada95/samples/rain.adb deleted file mode 100644 index d673018eb03..00000000000 --- a/Ada95/samples/rain.adb +++ /dev/null @@ -1,179 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Rain -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,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 -- --- "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: Laurent Pautet --- Modified by: Juergen Pfeifer, 1997 --- Version Control --- $Revision: 1.8 $ --- $Date: 2008/08/30 21:38:07 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- -- -with ncurses2.util; use ncurses2.util; -with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; -with Status; use Status; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -procedure Rain is - - Visibility : Cursor_Visibility; - - subtype X_Position is Line_Position; - subtype Y_Position is Column_Position; - - Xpos : array (1 .. 5) of X_Position; - Ypos : array (1 .. 5) of Y_Position; - - done : Boolean; - - c : Key_Code; - - N : Integer; - - G : Generator; - - Max_X, X : X_Position; - Max_Y, Y : Y_Position; - - procedure Next (J : in out Integer); - procedure Cursor (X : X_Position; Y : Y_Position); - - procedure Next (J : in out Integer) is - begin - if J = 5 then - J := 1; - else - J := J + 1; - end if; - end Next; - - procedure Cursor (X : X_Position; Y : Y_Position) is - begin - Move_Cursor (Line => X, Column => Y); - end Cursor; - pragma Inline (Cursor); - -begin - - Init_Screen; - Set_NL_Mode; - Set_Echo_Mode (False); - - Visibility := Invisible; - Set_Cursor_Visibility (Visibility); - Set_Timeout_Mode (Standard_Window, Non_Blocking, 0); - - Max_X := Lines - 5; - Max_Y := Columns - 5; - - for I in Xpos'Range loop - Xpos (I) := X_Position (Float (Max_X) * Random (G)) + 2; - Ypos (I) := Y_Position (Float (Max_Y) * Random (G)) + 2; - end loop; - - N := 1; - done := False; - while not done and Process.Continue loop - - X := X_Position (Float (Max_X) * Random (G)) + 2; - Y := Y_Position (Float (Max_Y) * Random (G)) + 2; - - Cursor (X, Y); - Add (Ch => '.'); - - Cursor (Xpos (N), Ypos (N)); - Add (Ch => 'o'); - - -- - Next (N); - Cursor (Xpos (N), Ypos (N)); - Add (Ch => 'O'); - - -- - Next (N); - Cursor (Xpos (N) - 1, Ypos (N)); - Add (Ch => '-'); - Cursor (Xpos (N), Ypos (N) - 1); - Add (Str => "|.|"); - Cursor (Xpos (N) + 1, Ypos (N)); - Add (Ch => '-'); - - -- - Next (N); - Cursor (Xpos (N) - 2, Ypos (N)); - Add (Ch => '-'); - Cursor (Xpos (N) - 1, Ypos (N) - 1); - Add (Str => "/\\"); - Cursor (Xpos (N), Ypos (N) - 2); - Add (Str => "| O |"); - Cursor (Xpos (N) + 1, Ypos (N) - 1); - Add (Str => "\\/"); - Cursor (Xpos (N) + 2, Ypos (N)); - Add (Ch => '-'); - - -- - Next (N); - Cursor (Xpos (N) - 2, Ypos (N)); - Add (Ch => ' '); - Cursor (Xpos (N) - 1, Ypos (N) - 1); - Add (Str => " "); - Cursor (Xpos (N), Ypos (N) - 2); - Add (Str => " "); - Cursor (Xpos (N) + 1, Ypos (N) - 1); - Add (Str => " "); - Cursor (Xpos (N) + 2, Ypos (N)); - Add (Ch => ' '); - - Xpos (N) := X; - Ypos (N) := Y; - - c := Getchar; - case c is - when Character'Pos ('q') => done := True; - when Character'Pos ('Q') => done := True; - when Character'Pos ('s') => Set_NoDelay_Mode (Standard_Window, False); - when Character'Pos (' ') => Set_NoDelay_Mode (Standard_Window, True); - when others => null; - end case; - - Nap_Milli_Seconds (50); - end loop; - - Visibility := Normal; - Set_Cursor_Visibility (Visibility); - End_Windows; - Curses_Free_All; - -end Rain; diff --git a/Ada95/samples/rain.ads b/Ada95/samples/rain.ads deleted file mode 100644 index 3ad1912c5e4..00000000000 --- a/Ada95/samples/rain.ads +++ /dev/null @@ -1,43 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Rain -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Laurent Pautet --- Modified by: Juergen Pfeifer, 1997 --- Version Control --- $Revision: 1.6 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- -- -procedure Rain; diff --git a/Ada95/samples/sample-curses_demo-attributes.adb b/Ada95/samples/sample-curses_demo-attributes.adb deleted file mode 100644 index c49f37d6024..00000000000 --- a/Ada95/samples/sample-curses_demo-attributes.adb +++ /dev/null @@ -1,122 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Curses_Demo.Attributes -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Explanation; use Sample.Explanation; - -package body Sample.Curses_Demo.Attributes is - - procedure Demo - is - P : Panel := Create (Standard_Window); - K : Real_Key_Code; - begin - Set_Meta_Mode; - Set_KeyPad_Mode; - - Top (P); - - Push_Environment ("ATTRIBDEMO"); - Default_Labels; - Notepad ("ATTRIB-PAD00"); - - Set_Character_Attributes (Attr => (others => False)); - Add (Line => 1, Column => Columns / 2 - 10, - Str => "This is NORMAL"); - - Set_Character_Attributes (Attr => (Stand_Out => True, - others => False)); - Add (Line => 2, Column => Columns / 2 - 10, - Str => "This is Stand_Out"); - - Set_Character_Attributes (Attr => (Under_Line => True, - others => False)); - Add (Line => 3, Column => Columns / 2 - 10, - Str => "This is Under_Line"); - - Set_Character_Attributes (Attr => (Reverse_Video => True, - others => False)); - Add (Line => 4, Column => Columns / 2 - 10, - Str => "This is Reverse_Video"); - - Set_Character_Attributes (Attr => (Blink => True, - others => False)); - Add (Line => 5, Column => Columns / 2 - 10, - Str => "This is Blink"); - - Set_Character_Attributes (Attr => (Dim_Character => True, - others => False)); - Add (Line => 6, Column => Columns / 2 - 10, - Str => "This is Dim_Character"); - - Set_Character_Attributes (Attr => (Bold_Character => True, - others => False)); - Add (Line => 7, Column => Columns / 2 - 10, - Str => "This is Bold_Character"); - - Refresh_Without_Update; - Update_Panels; Update_Screen; - - loop - K := Get_Key; - if K in Special_Key_Code'Range then - case K is - when QUIT_CODE => exit; - when HELP_CODE => Explain_Context; - when EXPLAIN_CODE => Explain ("ATTRIBKEYS"); - when others => null; - end case; - end if; - end loop; - - Pop_Environment; - Clear; - Refresh_Without_Update; - Delete (P); - Update_Panels; Update_Screen; - - end Demo; - -end Sample.Curses_Demo.Attributes; diff --git a/Ada95/samples/sample-curses_demo-attributes.ads b/Ada95/samples/sample-curses_demo-attributes.ads deleted file mode 100644 index 6d9b4e8df80..00000000000 --- a/Ada95/samples/sample-curses_demo-attributes.ads +++ /dev/null @@ -1,45 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Curses_Demo.Attributes -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample.Curses_Demo.Attributes is - - procedure Demo; - -end Sample.Curses_Demo.Attributes; diff --git a/Ada95/samples/sample-curses_demo-mouse.adb b/Ada95/samples/sample-curses_demo-mouse.adb deleted file mode 100644 index 490685c7507..00000000000 --- a/Ada95/samples/sample-curses_demo-mouse.adb +++ /dev/null @@ -1,220 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Curses_Demo.Mouse -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.16 $ --- $Date: 2008/07/26 18:48:19 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; -with Terminal_Interface.Curses.Text_IO; use Terminal_Interface.Curses.Text_IO; -with Terminal_Interface.Curses.Text_IO.Integer_IO; -with Terminal_Interface.Curses.Text_IO.Enumeration_IO; - -with Sample.Helpers; use Sample.Helpers; -with Sample.Manifest; use Sample.Manifest; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Explanation; use Sample.Explanation; - -package body Sample.Curses_Demo.Mouse is - - package Int_IO is new - Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); - use Int_IO; - - package Button_IO is new - Terminal_Interface.Curses.Text_IO.Enumeration_IO (Mouse_Button); - use Button_IO; - - package State_IO is new - Terminal_Interface.Curses.Text_IO.Enumeration_IO (Button_State); - use State_IO; - - procedure Demo is - - type Controls is array (1 .. 3) of Panel; - - Frame : Window; - Msg : Window; - Ctl : Controls; - Pan : Panel; - K : Real_Key_Code; - V : Cursor_Visibility := Invisible; - W : Window; - Note : Window; - Msg_L : constant Line_Count := 8; - Lins : Line_Position := Lines; - Cols : Column_Position; - Mask : Event_Mask; - procedure Show_Mouse_Event; - - procedure Show_Mouse_Event - is - Evt : constant Mouse_Event := Get_Mouse; - Y : Line_Position; - X : Column_Position; - Button : Mouse_Button; - State : Button_State; - W : Window; - begin - Get_Event (Evt, Y, X, Button, State); - Put (Msg, "Event at"); - Put (Msg, " X="); Put (Msg, Integer (X), 3); - Put (Msg, ", Y="); Put (Msg, Integer (Y), 3); - Put (Msg, ", Btn="); Put (Msg, Button, 10); - Put (Msg, ", Stat="); Put (Msg, State, 15); - for I in Ctl'Range loop - W := Get_Window (Ctl (I)); - if Enclosed_In_Window (W, Evt) then - Transform_Coordinates (W, Y, X, From_Screen); - Put (Msg, ",Box("); - Put (Msg, (I), 1); Put (Msg, ","); - Put (Msg, Integer (Y), 1); Put (Msg, ","); - Put (Msg, Integer (X), 1); Put (Msg, ")"); - end if; - end loop; - New_Line (Msg); - Flush (Msg); - Update_Panels; Update_Screen; - end Show_Mouse_Event; - - begin - Push_Environment ("MOUSE00"); - Notepad ("MOUSE-PAD00"); - Default_Labels; - Set_Cursor_Visibility (V); - - Note := Notepad_Window; - if Note /= Null_Window then - Get_Window_Position (Note, Lins, Cols); - end if; - Frame := Create (Msg_L, Columns, Lins - Msg_L, 0); - if Has_Colors then - Set_Background (Win => Frame, - Ch => (Color => Default_Colors, - Attr => Normal_Video, - Ch => ' ')); - Set_Character_Attributes (Win => Frame, - Attr => Normal_Video, - Color => Default_Colors); - Erase (Frame); - end if; - Msg := Derived_Window (Frame, Msg_L - 2, Columns - 2, 1, 1); - Pan := Create (Frame); - - Set_Meta_Mode; - Set_KeyPad_Mode; - Mask := Start_Mouse; - - Box (Frame); - Window_Title (Frame, "Mouse Protocol"); - Refresh_Without_Update (Frame); - Allow_Scrolling (Msg, True); - - declare - Middle_Column : constant Integer := Integer (Columns) / 2; - Middle_Index : constant Natural := Ctl'First + (Ctl'Length / 2); - Width : constant Column_Count := 5; - Height : constant Line_Count := 3; - Half : constant Column_Count := Width / 2; - Space : constant Column_Count := 3; - Position : Integer; - W : Window; - begin - for I in Ctl'Range loop - Position := ((I) - Integer (Middle_Index)) * - Integer (Half + Space + Width) + Middle_Column; - W := Create (Height, - Width, - 1, - Column_Position (Position)); - if Has_Colors then - Set_Background (Win => W, - Ch => (Color => Menu_Back_Color, - Attr => Normal_Video, - Ch => ' ')); - Set_Character_Attributes (Win => W, - Attr => Normal_Video, - Color => Menu_Fore_Color); - Erase (W); - end if; - Ctl (I) := Create (W); - Box (W); - Move_Cursor (W, 1, Half); - Put (W, (I), 1); - Refresh_Without_Update (W); - end loop; - end; - - Update_Panels; Update_Screen; - - loop - K := Get_Key; - if K in Special_Key_Code'Range then - case K is - when QUIT_CODE => exit; - when HELP_CODE => Explain_Context; - when EXPLAIN_CODE => Explain ("MOUSEKEYS"); - when Key_Mouse => Show_Mouse_Event; - when others => null; - end case; - end if; - end loop; - - for I in Ctl'Range loop - W := Get_Window (Ctl (I)); - Clear (W); - Delete (Ctl (I)); - Delete (W); - end loop; - - Clear (Frame); - Delete (Pan); - Delete (Msg); - Delete (Frame); - - Set_Cursor_Visibility (V); - End_Mouse (Mask); - - Pop_Environment; - Update_Panels; Update_Screen; - - end Demo; - -end Sample.Curses_Demo.Mouse; diff --git a/Ada95/samples/sample-curses_demo-mouse.ads b/Ada95/samples/sample-curses_demo-mouse.ads deleted file mode 100644 index ad78d0d0a75..00000000000 --- a/Ada95/samples/sample-curses_demo-mouse.ads +++ /dev/null @@ -1,45 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Curses_Demo.Mouse -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample.Curses_Demo.Mouse is - - procedure Demo; - -end Sample.Curses_Demo.Mouse; diff --git a/Ada95/samples/sample-curses_demo.adb b/Ada95/samples/sample-curses_demo.adb deleted file mode 100644 index 4dd96a721d2..00000000000 --- a/Ada95/samples/sample-curses_demo.adb +++ /dev/null @@ -1,143 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Curses_Demo -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2004,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.17 $ --- $Date: 2011/03/23 00:29:04 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; -with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Panels.User_Data; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Helpers; use Sample.Helpers; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; - -with Sample.Explanation; use Sample.Explanation; - -with Sample.Menu_Demo.Handler; -with Sample.Curses_Demo.Mouse; -with Sample.Curses_Demo.Attributes; - -package body Sample.Curses_Demo is - - type User_Data is new Integer; - type User_Data_Access is access all User_Data; - package PUD is new Panels.User_Data (User_Data, User_Data_Access); - -- We use above instantiation of the generic User_Data package to - -- demonstrate and test the use of the user data mechanism. - - procedure Demo - is - function My_Driver (M : Menu; - K : Key_Code; - Pan : Panel) return Boolean; - package Mh is new Sample.Menu_Demo.Handler (My_Driver); - - Itm : Item_Array_Access := new Item_Array' - (New_Item ("Attributes Demo"), - New_Item ("Mouse Demo"), - Null_Item); - M : Menu := New_Menu (Itm); - U1 : constant User_Data_Access := new User_Data'(4711); - U2 : User_Data_Access; - - function My_Driver (M : Menu; - K : Key_Code; - Pan : Panel) return Boolean - is - Idx : constant Positive := Get_Index (Current (M)); - Result : Boolean := False; - begin - PUD.Set_User_Data (Pan, U1); -- set some user data, just for fun - if K in User_Key_Code'Range then - if K = QUIT then - Result := True; - elsif K = SELECT_ITEM then - if Idx in Itm'Range then - Hide (Pan); - Update_Panels; - end if; - case Idx is - when 1 => Sample.Curses_Demo.Attributes.Demo; - when 2 => Sample.Curses_Demo.Mouse.Demo; - when others => Not_Implemented; - end case; - if Idx in Itm'Range then - Top (Pan); - Show (Pan); - Update_Panels; - Update_Screen; - end if; - end if; - end if; - PUD.Get_User_Data (Pan, U2); -- get the user data - pragma Assert (U1.all = U2.all and then U1 = U2); - return Result; - end My_Driver; - - begin - - if (1 + Item_Count (M)) /= Itm'Length then - raise Constraint_Error; - end if; - - if not Has_Mouse then - declare - O : Item_Option_Set; - begin - Get_Options (Itm.all (2), O); - O.Selectable := False; - Set_Options (Itm.all (2), O); - end; - end if; - - Push_Environment ("CURSES00"); - Notepad ("CURSES-PAD00"); - Default_Labels; - Refresh_Soft_Label_Keys_Without_Update; - - Mh.Drive_Me (M, " Demo "); - Pop_Environment; - - Delete (M); - Free (Itm, True); - end Demo; - -end Sample.Curses_Demo; diff --git a/Ada95/samples/sample-curses_demo.ads b/Ada95/samples/sample-curses_demo.ads deleted file mode 100644 index ed4ad0f019f..00000000000 --- a/Ada95/samples/sample-curses_demo.ads +++ /dev/null @@ -1,45 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Curses_Demo -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample.Curses_Demo is - - procedure Demo; - -end Sample.Curses_Demo; diff --git a/Ada95/samples/sample-explanation.adb b/Ada95/samples/sample-explanation.adb deleted file mode 100644 index 5587099b242..00000000000 --- a/Ada95/samples/sample-explanation.adb +++ /dev/null @@ -1,430 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Explanation -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.26 $ --- $Date: 2011/03/26 22:33:29 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- Poor mans help system. This scans a sequential file for key lines and --- then reads the lines up to the next key. Those lines are presented in --- a window as help or explanation. --- -with Ada.Text_IO; use Ada.Text_IO; -with Ada.Unchecked_Deallocation; -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; - -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Manifest; use Sample.Manifest; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Helpers; use Sample.Helpers; - -package body Sample.Explanation is - - Help_Keys : constant String := "HELPKEYS"; - In_Help : constant String := "INHELP"; - - File_Name : constant String := "explain.txt"; - F : File_Type; - - type Help_Line; - type Help_Line_Access is access Help_Line; - pragma Controlled (Help_Line_Access); - type String_Access is access String; - pragma Controlled (String_Access); - - type Help_Line is - record - Prev, Next : Help_Line_Access; - Line : String_Access; - end record; - - procedure Explain (Key : String; - Win : Window); - - procedure Release_String is - new Ada.Unchecked_Deallocation (String, - String_Access); - procedure Release_Help_Line is - new Ada.Unchecked_Deallocation (Help_Line, - Help_Line_Access); - - function Search (Key : String) return Help_Line_Access; - procedure Release_Help (Root : in out Help_Line_Access); - - function Check_File (Name : String) return Boolean; - - procedure Explain (Key : String) - is - begin - Explain (Key, Null_Window); - end Explain; - - procedure Explain (Key : String; - Win : Window) - is - -- Retrieve the text associated with this key and display it in this - -- window. If no window argument is passed, the routine will create - -- a temporary window and use it. - - function Filter_Key return Real_Key_Code; - procedure Unknown_Key; - procedure Redo; - procedure To_Window (C : in out Help_Line_Access; - More : in out Boolean); - - Frame : Window := Null_Window; - - W : Window := Win; - K : Real_Key_Code; - P : Panel; - - Height : Line_Count; - Width : Column_Count; - Help : Help_Line_Access := Search (Key); - Current : Help_Line_Access; - Top_Line : Help_Line_Access; - - Has_More : Boolean := True; - - procedure Unknown_Key - is - begin - Add (W, "Help message with ID "); - Add (W, Key); - Add (W, " not found."); - Add (W, Character'Val (10)); - Add (W, "Press the Function key labeled 'Quit' key to continue."); - end Unknown_Key; - - procedure Redo - is - H : Help_Line_Access := Top_Line; - begin - if Top_Line /= null then - for L in 0 .. (Height - 1) loop - Add (W, L, 0, H.all.Line.all); - exit when H.all.Next = null; - H := H.all.Next; - end loop; - else - Unknown_Key; - end if; - end Redo; - - function Filter_Key return Real_Key_Code - is - K : Real_Key_Code; - begin - loop - K := Get_Key (W); - if K in Special_Key_Code'Range then - case K is - when HELP_CODE => - if not Find_Context (In_Help) then - Push_Environment (In_Help, False); - Explain (In_Help, W); - Pop_Environment; - Redo; - end if; - when EXPLAIN_CODE => - if not Find_Context (Help_Keys) then - Push_Environment (Help_Keys, False); - Explain (Help_Keys, W); - Pop_Environment; - Redo; - end if; - when others => exit; - end case; - else - exit; - end if; - end loop; - return K; - end Filter_Key; - - procedure To_Window (C : in out Help_Line_Access; - More : in out Boolean) - is - L : Line_Position := 0; - begin - loop - Add (W, L, 0, C.all.Line.all); - L := L + 1; - exit when C.all.Next = null or else L = Height; - C := C.all.Next; - end loop; - if C.all.Next /= null then - pragma Assert (L = Height); - More := True; - else - More := False; - end if; - end To_Window; - - begin - if W = Null_Window then - Push_Environment ("HELP"); - Default_Labels; - Frame := New_Window (Lines - 2, Columns, 0, 0); - if Has_Colors then - Set_Background (Win => Frame, - Ch => (Ch => ' ', - Color => Help_Color, - Attr => Normal_Video)); - Set_Character_Attributes (Win => Frame, - Attr => Normal_Video, - Color => Help_Color); - Erase (Frame); - end if; - Box (Frame); - Set_Character_Attributes (Frame, (Reverse_Video => True, - others => False)); - Add (Frame, Lines - 3, 2, "Cursor Up/Down scrolls"); - Set_Character_Attributes (Frame); -- Back to default. - Window_Title (Frame, "Explanation"); - W := Derived_Window (Frame, Lines - 4, Columns - 2, 1, 1); - Refresh_Without_Update (Frame); - Get_Size (W, Height, Width); - Set_Meta_Mode (W); - Set_KeyPad_Mode (W); - Allow_Scrolling (W, True); - Set_Echo_Mode (False); - P := Create (Frame); - Top (P); - Update_Panels; - else - Clear (W); - Refresh_Without_Update (W); - end if; - - Current := Help; Top_Line := Help; - - if null = Help then - Unknown_Key; - loop - K := Filter_Key; - exit when K = QUIT_CODE; - end loop; - else - To_Window (Current, Has_More); - if Has_More then - -- This means there are more lines available, so we have to go - -- into a scroll manager. - loop - K := Filter_Key; - if K in Special_Key_Code'Range then - case K is - when Key_Cursor_Down => - if Current.all.Next /= null then - Move_Cursor (W, Height - 1, 0); - Scroll (W, 1); - Current := Current.all.Next; - Top_Line := Top_Line.all.Next; - Add (W, Current.all.Line.all); - end if; - when Key_Cursor_Up => - if Top_Line.all.Prev /= null then - Move_Cursor (W, 0, 0); - Scroll (W, -1); - Top_Line := Top_Line.all.Prev; - Current := Current.all.Prev; - Add (W, Top_Line.all.Line.all); - end if; - when QUIT_CODE => exit; - when others => null; - end case; - end if; - end loop; - else - loop - K := Filter_Key; - exit when K = QUIT_CODE; - end loop; - end if; - end if; - - Clear (W); - - if Frame /= Null_Window then - Clear (Frame); - Delete (P); - Delete (W); - Delete (Frame); - Pop_Environment; - end if; - - Update_Panels; - Update_Screen; - - Release_Help (Help); - - end Explain; - - function Search (Key : String) return Help_Line_Access - is - Last : Natural; - Buffer : String (1 .. 256); - Root : Help_Line_Access := null; - Current : Help_Line_Access; - Tail : Help_Line_Access := null; - - function Next_Line return Boolean; - - function Next_Line return Boolean - is - H_End : constant String := "#END"; - begin - Get_Line (F, Buffer, Last); - if Last = H_End'Length and then H_End = Buffer (1 .. Last) then - return False; - else - return True; - end if; - end Next_Line; - begin - Reset (F); - Outer : - loop - exit Outer when not Next_Line; - if Last = (1 + Key'Length) and then Key = Buffer (2 .. Last) - and then Buffer (1) = '#' then - loop - exit when not Next_Line; - exit when Buffer (1) = '#'; - Current := new Help_Line'(null, null, - new String'(Buffer (1 .. Last))); - if Tail = null then - Release_Help (Root); - Root := Current; - else - Tail.all.Next := Current; - Current.all.Prev := Tail; - end if; - Tail := Current; - end loop; - exit Outer; - end if; - end loop Outer; - return Root; - end Search; - - procedure Release_Help (Root : in out Help_Line_Access) - is - Next : Help_Line_Access; - begin - loop - exit when Root = null; - Next := Root.all.Next; - Release_String (Root.all.Line); - Release_Help_Line (Root); - Root := Next; - end loop; - end Release_Help; - - procedure Explain_Context - is - begin - Explain (Context); - end Explain_Context; - - procedure Notepad (Key : String) - is - H : constant Help_Line_Access := Search (Key); - T : Help_Line_Access := H; - N : Line_Count := 1; - L : Line_Position := 0; - W : Window; - P : Panel; - begin - if H /= null then - loop - T := T.all.Next; - exit when T = null; - N := N + 1; - end loop; - W := New_Window (N + 2, Columns, Lines - N - 2, 0); - if Has_Colors then - Set_Background (Win => W, - Ch => (Ch => ' ', - Color => Notepad_Color, - Attr => Normal_Video)); - Set_Character_Attributes (Win => W, - Attr => Normal_Video, - Color => Notepad_Color); - Erase (W); - end if; - Box (W); - Window_Title (W, "Notepad"); - P := New_Panel (W); - T := H; - loop - Add (W, L + 1, 1, T.all.Line.all, Integer (Columns - 2)); - L := L + 1; - T := T.all.Next; - exit when T = null; - end loop; - T := H; - Release_Help (T); - Refresh_Without_Update (W); - Notepad_To_Context (P); - end if; - end Notepad; - - function Check_File (Name : String) return Boolean is - The_File : File_Type; - begin - Open (The_File, In_File, Name); - Close (The_File); - return True; - exception - when Name_Error => - return False; - end Check_File; - -begin - if Check_File ("/usr/share/AdaCurses/" & File_Name) then - Open (F, In_File, "/usr/share/AdaCurses/" & File_Name); - elsif Check_File (File_Name) then - Open (F, In_File, File_Name); - else - Put_Line (Standard_Error, - "The file explain.txt was not found in the current directory." - ); - raise Name_Error; - end if; -end Sample.Explanation; diff --git a/Ada95/samples/sample-explanation.ads b/Ada95/samples/sample-explanation.ads deleted file mode 100644 index 728825e2c9d..00000000000 --- a/Ada95/samples/sample-explanation.ads +++ /dev/null @@ -1,59 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Explanation -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- Poor mans help system. This scans a sequential file for key lines and --- then reads the lines up to the next key. Those lines are presented in --- a window as help or explanation. --- -package Sample.Explanation is - - procedure Explain (Key : String); - -- Retrieve the text associated with this key and display it. - - procedure Explain_Context; - -- Explain the current context. - - procedure Notepad (Key : String); - -- Put a note on the screen and maintain it with the context - - Explanation_Not_Found : exception; - Explanation_Error : exception; - -end Sample.Explanation; diff --git a/Ada95/samples/sample-form_demo-aux.adb b/Ada95/samples/sample-form_demo-aux.adb deleted file mode 100644 index a3b044dcc3e..00000000000 --- a/Ada95/samples/sample-form_demo-aux.adb +++ /dev/null @@ -1,263 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Form_Demo.Aux -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2004,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.17 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Helpers; use Sample.Helpers; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Explanation; use Sample.Explanation; - -package body Sample.Form_Demo.Aux is - - procedure Geometry (F : Form; - L : out Line_Count; -- Lines used for menu - C : out Column_Count; -- Columns used for menu - Y : out Line_Position; -- Proposed Line for menu - X : out Column_Position) -- Proposed Column for menu - is - begin - Scale (F, L, C); - - L := L + 2; -- count for frame at top and bottom - C := C + 2; -- " - - -- Calculate horizontal coordinate at the screen center - X := (Columns - C) / 2; - Y := 1; -- start always in line 1 - end Geometry; - - function Create (F : Form; - Title : String; - Lin : Line_Position; - Col : Column_Position) return Panel - is - W, S : Window; - L : Line_Count; - C : Column_Count; - Y : Line_Position; - X : Column_Position; - Pan : Panel; - begin - Geometry (F, L, C, Y, X); - W := New_Window (L, C, Lin, Col); - Set_Meta_Mode (W); - Set_KeyPad_Mode (W); - if Has_Colors then - Set_Background (Win => W, - Ch => (Ch => ' ', - Color => Default_Colors, - Attr => Normal_Video)); - Set_Character_Attributes (Win => W, - Color => Default_Colors, - Attr => Normal_Video); - Erase (W); - end if; - S := Derived_Window (W, L - 2, C - 2, 1, 1); - Set_Meta_Mode (S); - Set_KeyPad_Mode (S); - Box (W); - Set_Window (F, W); - Set_Sub_Window (F, S); - if Title'Length > 0 then - Window_Title (W, Title); - end if; - Pan := New_Panel (W); - Post (F); - return Pan; - end Create; - - procedure Destroy (F : Form; - P : in out Panel) - is - W, S : Window; - begin - W := Get_Window (F); - S := Get_Sub_Window (F); - Post (F, False); - Erase (W); - Delete (P); - Set_Window (F, Null_Window); - Set_Sub_Window (F, Null_Window); - Delete (S); - Delete (W); - Update_Panels; - end Destroy; - - function Get_Request (F : Form; - P : Panel; - Handle_CRLF : Boolean := True) return Key_Code - is - W : constant Window := Get_Window (F); - K : Real_Key_Code; - Ch : Character; - begin - Top (P); - loop - K := Get_Key (W); - if K in Special_Key_Code'Range then - case K is - when HELP_CODE => Explain_Context; - when EXPLAIN_CODE => Explain ("FORMKEYS"); - when Key_Home => return F_First_Field; - when Key_End => return F_Last_Field; - when QUIT_CODE => return QUIT; - when Key_Cursor_Down => return F_Down_Char; - when Key_Cursor_Up => return F_Up_Char; - when Key_Cursor_Left => return F_Previous_Char; - when Key_Cursor_Right => return F_Next_Char; - when Key_Next_Page => return F_Next_Page; - when Key_Previous_Page => return F_Previous_Page; - when Key_Backspace => return F_Delete_Previous; - when Key_Clear_Screen => return F_Clear_Field; - when Key_Clear_End_Of_Line => return F_Clear_EOF; - when others => return K; - end case; - elsif K in Normal_Key_Code'Range then - Ch := Character'Val (K); - case Ch is - when CAN => return QUIT; -- CTRL-X - - when ACK => return F_Next_Field; -- CTRL-F - when STX => return F_Previous_Field; -- CTRL-B - when FF => return F_Left_Field; -- CTRL-L - when DC2 => return F_Right_Field; -- CTRL-R - when NAK => return F_Up_Field; -- CTRL-U - when EOT => return F_Down_Field; -- CTRL-D - - when ETB => return F_Next_Word; -- CTRL-W - when DC4 => return F_Previous_Word; -- CTRL-T - - when SOH => return F_Begin_Field; -- CTRL-A - when ENQ => return F_End_Field; -- CTRL-E - - when HT => return F_Insert_Char; -- CTRL-I - when SI => return F_Insert_Line; -- CTRL-O - when SYN => return F_Delete_Char; -- CTRL-V - when BS => return F_Delete_Previous; -- CTRL-H - when EM => return F_Delete_Line; -- CTRL-Y - when BEL => return F_Delete_Word; -- CTRL-G - when VT => return F_Clear_EOF; -- CTRL-K - - when SO => return F_Next_Choice; -- CTRL-N - when DLE => return F_Previous_Choice; -- CTRL-P - - when CR | LF => - if Handle_CRLF then - return F_New_Line; - else - return K; - end if; - when others => return K; - end case; - else - return K; - end if; - end loop; - end Get_Request; - - function Make (Top : Line_Position; - Left : Column_Position; - Text : String) return Field - is - Fld : Field; - C : constant Column_Count := Column_Count (Text'Length); - begin - Fld := New_Field (1, C, Top, Left); - Set_Buffer (Fld, 0, Text); - Switch_Options (Fld, (Active => True, others => False), False); - if Has_Colors then - Set_Background (Fld => Fld, Color => Default_Colors); - end if; - return Fld; - end Make; - - function Make (Height : Line_Count := 1; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0) return Field - is - Fld : constant Field := New_Field (Height, Width, Top, Left, Off_Screen); - begin - if Has_Colors then - Set_Foreground (Fld => Fld, Color => Form_Fore_Color); - Set_Background (Fld => Fld, Color => Form_Back_Color); - else - Set_Background (Fld, (Reverse_Video => True, others => False)); - end if; - return Fld; - end Make; - - function Default_Driver (F : Form; - K : Key_Code; - P : Panel) return Boolean - is - begin - if P = Null_Panel then - raise Panel_Exception; - end if; - if K in User_Key_Code'Range and then K = QUIT then - if Driver (F, F_Validate_Field) = Form_Ok then - return True; - end if; - end if; - return False; - end Default_Driver; - - function Count_Active (F : Form) return Natural - is - N : Natural := 0; - O : Field_Option_Set; - H : constant Natural := Field_Count (F); - begin - if H > 0 then - for I in 1 .. H loop - Get_Options (Fields (F, I), O); - if O.Active then - N := N + 1; - end if; - end loop; - end if; - return N; - end Count_Active; - -end Sample.Form_Demo.Aux; diff --git a/Ada95/samples/sample-form_demo-aux.ads b/Ada95/samples/sample-form_demo-aux.ads deleted file mode 100644 index 7e7f7cd21e3..00000000000 --- a/Ada95/samples/sample-form_demo-aux.ads +++ /dev/null @@ -1,92 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Form_Demo.Aux -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; - -package Sample.Form_Demo.Aux is - - procedure Geometry (F : Form; - L : out Line_Count; - C : out Column_Count; - Y : out Line_Position; - X : out Column_Position); - -- Calculate the geometry for a panel being able to be used to display - -- the menu. - - function Create (F : Form; - Title : String; - Lin : Line_Position; - Col : Column_Position) return Panel; - -- Create a panel decorated with a frame and the title at the specified - -- position. The dimension of the panel is derived from the menus layout. - - procedure Destroy (F : Form; - P : in out Panel); - -- Destroy all the windowing structures associated with this menu and - -- panel. - - function Get_Request (F : Form; - P : Panel; - Handle_CRLF : Boolean := True) return Key_Code; - -- Centralized request driver for all menus in this sample. This - -- gives us a common key binding for all menus. - - function Make (Top : Line_Position; - Left : Column_Position; - Text : String) return Field; - -- create a label - - function Make (Height : Line_Count := 1; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0) return Field; - -- create a editable field - - function Default_Driver (F : Form; - K : Key_Code; - P : Panel) return Boolean; - - function Count_Active (F : Form) return Natural; - -- Count the number of active fields in the form - -end Sample.Form_Demo.Aux; diff --git a/Ada95/samples/sample-form_demo-handler.adb b/Ada95/samples/sample-form_demo-handler.adb deleted file mode 100644 index d871c1cc779..00000000000 --- a/Ada95/samples/sample-form_demo-handler.adb +++ /dev/null @@ -1,98 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Form_Demo.Handler -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2004,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.14 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Sample.Form_Demo.Aux; - -package body Sample.Form_Demo.Handler is - - package Aux renames Sample.Form_Demo.Aux; - - procedure Drive_Me (F : Form; - Title : String := "") - is - L : Line_Count; - C : Column_Count; - Y : Line_Position; - X : Column_Position; - begin - Aux.Geometry (F, L, C, Y, X); - Drive_Me (F, Y, X, Title); - end Drive_Me; - - procedure Drive_Me (F : Form; - Lin : Line_Position; - Col : Column_Position; - Title : String := "") - is - Pan : Panel := Aux.Create (F, Title, Lin, Col); - V : Cursor_Visibility := Normal; - Handle_CRLF : Boolean := True; - - begin - Set_Cursor_Visibility (V); - if Aux.Count_Active (F) = 1 then - Handle_CRLF := False; - end if; - loop - declare - K : constant Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF); - R : Driver_Result; - begin - if (K = 13 or else K = 10) and then not Handle_CRLF then - R := Unknown_Request; - else - R := Driver (F, K); - end if; - case R is - when Form_Ok => null; - when Unknown_Request => - if My_Driver (F, K, Pan) then - exit; - end if; - when others => Beep; - end case; - end; - end loop; - Set_Cursor_Visibility (V); - Aux.Destroy (F, Pan); - end Drive_Me; - -end Sample.Form_Demo.Handler; diff --git a/Ada95/samples/sample-form_demo-handler.ads b/Ada95/samples/sample-form_demo-handler.ads deleted file mode 100644 index 7d875a0fff6..00000000000 --- a/Ada95/samples/sample-form_demo-handler.ads +++ /dev/null @@ -1,64 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Form_Demo.Handler -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.10 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; -use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; -use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Forms; -use Terminal_Interface.Curses.Forms; - -generic - with function My_Driver (Frm : Form; - K : Key_Code; - Pan : Panel) return Boolean; -package Sample.Form_Demo.Handler is - - procedure Drive_Me (F : Form; - Lin : Line_Position; - Col : Column_Position; - Title : String := ""); - -- Position the menu at the given point and drive it. - - procedure Drive_Me (F : Form; - Title : String := ""); - -- Center menu and drive it. - -end Sample.Form_Demo.Handler; diff --git a/Ada95/samples/sample-form_demo.adb b/Ada95/samples/sample-form_demo.adb deleted file mode 100644 index ed84526feae..00000000000 --- a/Ada95/samples/sample-form_demo.adb +++ /dev/null @@ -1,130 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Form_Demo -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.16 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; -with Terminal_Interface.Curses.Forms.Field_User_Data; -with Sample.My_Field_Type; use Sample.My_Field_Type; -with Sample.Explanation; use Sample.Explanation; -with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Form_Demo.Handler; - -with Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; -with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; -use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; -with Terminal_Interface.Curses.Forms.Field_Types.IntField; -use Terminal_Interface.Curses.Forms.Field_Types.IntField; - -package body Sample.Form_Demo is - - type User_Data is - record - Data : Integer; - end record; - type User_Access is access User_Data; - - package Fld_U is new - Terminal_Interface.Curses.Forms.Field_User_Data (User_Data, - User_Access); - - type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday, - Friday, Saturday); - - package Weekday_Enum is new - Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada (Weekday); - - Enum_Field : constant Enumeration_Field := - Weekday_Enum.Create; - - procedure Demo - is - - Mft : constant My_Data := (Ch => 'X'); - - FA : Field_Array_Access := new Field_Array' - (Make (0, 14, "Sample Entry Form"), - Make (2, 0, "WeekdayEnumeration"), - Make (2, 20, "Numeric 1-10"), - Make (2, 34, "Only 'X'"), - Make (5, 0, "Multiple Lines offscreen(Scroll)"), - Make (Width => 18, Top => 3, Left => 0), - Make (Width => 12, Top => 3, Left => 20), - Make (Width => 12, Top => 3, Left => 34), - Make (Width => 46, Top => 6, Left => 0, Height => 4, Off_Screen => 2), - Null_Field - ); - - Frm : Terminal_Interface.Curses.Forms.Form := Create (FA); - - I_F : constant Integer_Field := (Precision => 0, - Lower_Limit => 1, - Upper_Limit => 10); - - F1, F2 : User_Access; - - package Fh is new Sample.Form_Demo.Handler (Default_Driver); - - begin - Push_Environment ("FORM00"); - Notepad ("FORM-PAD00"); - Default_Labels; - - Set_Field_Type (FA.all (6), Enum_Field); - Set_Field_Type (FA.all (7), I_F); - Set_Field_Type (FA.all (8), Mft); - - F1 := new User_Data'(Data => 4711); - Fld_U.Set_User_Data (FA.all (1), F1); - - Fh.Drive_Me (Frm); - - Fld_U.Get_User_Data (FA.all (1), F2); - pragma Assert (F1 = F2); - pragma Assert (F1.Data = F2.Data); - - Pop_Environment; - Delete (Frm); - - Free (FA, True); - end Demo; - -end Sample.Form_Demo; diff --git a/Ada95/samples/sample-form_demo.ads b/Ada95/samples/sample-form_demo.ads deleted file mode 100644 index bd33f578750..00000000000 --- a/Ada95/samples/sample-form_demo.ads +++ /dev/null @@ -1,45 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Form_Demo -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample.Form_Demo is - - procedure Demo; - -end Sample.Form_Demo; diff --git a/Ada95/samples/sample-function_key_setting.adb b/Ada95/samples/sample-function_key_setting.adb deleted file mode 100644 index 4ff70be7bb8..00000000000 --- a/Ada95/samples/sample-function_key_setting.adb +++ /dev/null @@ -1,214 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Function_Key_Setting -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.15 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Unchecked_Deallocation; -with Sample.Manifest; use Sample.Manifest; - --- This package implements a simple stack of function key label environments. --- -package body Sample.Function_Key_Setting is - - Max_Label_Length : constant Positive := 8; - Number_Of_Keys : Label_Number := Label_Number'Last; - Justification : Label_Justification := Left; - - subtype Label is String (1 .. Max_Label_Length); - type Label_Array is array (Label_Number range <>) of Label; - - type Key_Environment (N : Label_Number := Label_Number'Last); - type Env_Ptr is access Key_Environment; - pragma Controlled (Env_Ptr); - - type String_Access is access String; - pragma Controlled (String_Access); - - Active_Context : String_Access := new String'("MAIN"); - Active_Notepad : Panel := Null_Panel; - - type Key_Environment (N : Label_Number := Label_Number'Last) is - record - Prev : Env_Ptr; - Help : String_Access; - Notepad : Panel; - Labels : Label_Array (1 .. N); - end record; - - procedure Release_String is - new Ada.Unchecked_Deallocation (String, - String_Access); - - procedure Release_Environment is - new Ada.Unchecked_Deallocation (Key_Environment, - Env_Ptr); - - Top_Of_Stack : Env_Ptr := null; - - procedure Push_Environment (Key : String; - Reset : Boolean := True) - is - P : constant Env_Ptr := new Key_Environment (Number_Of_Keys); - begin - -- Store the current labels in the environment - for I in 1 .. Number_Of_Keys loop - Get_Soft_Label_Key (I, P.all.Labels (I)); - if Reset then - Set_Soft_Label_Key (I, " "); - end if; - end loop; - P.all.Prev := Top_Of_Stack; - -- now store active help context and notepad - P.all.Help := Active_Context; - P.all.Notepad := Active_Notepad; - -- The notepad must now vanish and the new notepad is empty. - if P.all.Notepad /= Null_Panel then - Hide (P.all.Notepad); - Update_Panels; - end if; - Active_Notepad := Null_Panel; - Active_Context := new String'(Key); - - Top_Of_Stack := P; - if Reset then - Refresh_Soft_Label_Keys_Without_Update; - end if; - end Push_Environment; - - procedure Pop_Environment - is - P : Env_Ptr := Top_Of_Stack; - begin - if Top_Of_Stack = null then - raise Function_Key_Stack_Error; - else - for I in 1 .. Number_Of_Keys loop - Set_Soft_Label_Key (I, P.all.Labels (I), Justification); - end loop; - pragma Assert (Active_Context /= null); - Release_String (Active_Context); - Active_Context := P.all.Help; - Refresh_Soft_Label_Keys_Without_Update; - Notepad_To_Context (P.all.Notepad); - Top_Of_Stack := P.all.Prev; - Release_Environment (P); - end if; - end Pop_Environment; - - function Context return String - is - begin - if Active_Context /= null then - return Active_Context.all; - else - return ""; - end if; - end Context; - - function Find_Context (Key : String) return Boolean - is - P : Env_Ptr := Top_Of_Stack; - begin - if Active_Context.all = Key then - return True; - else - loop - exit when P = null; - if P.all.Help.all = Key then - return True; - else - P := P.all.Prev; - end if; - end loop; - return False; - end if; - end Find_Context; - - procedure Notepad_To_Context (Pan : Panel) - is - W : Window; - begin - if Active_Notepad /= Null_Panel then - W := Get_Window (Active_Notepad); - Clear (W); - Delete (Active_Notepad); - Delete (W); - end if; - Active_Notepad := Pan; - if Pan /= Null_Panel then - Top (Pan); - end if; - Update_Panels; - Update_Screen; - end Notepad_To_Context; - - procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style; - Just : Label_Justification := Left) - is - begin - case Mode is - when PC_Style .. PC_Style_With_Index - => Number_Of_Keys := 12; - when others - => Number_Of_Keys := 8; - end case; - Init_Soft_Label_Keys (Mode); - Justification := Just; - end Initialize; - - procedure Default_Labels - is - begin - Set_Soft_Label_Key (FKEY_QUIT, "Quit"); - Set_Soft_Label_Key (FKEY_HELP, "Help"); - Set_Soft_Label_Key (FKEY_EXPLAIN, "Keys"); - Refresh_Soft_Label_Keys_Without_Update; - end Default_Labels; - - function Notepad_Window return Window - is - begin - if Active_Notepad /= Null_Panel then - return Get_Window (Active_Notepad); - else - return Null_Window; - end if; - end Notepad_Window; - -end Sample.Function_Key_Setting; diff --git a/Ada95/samples/sample-function_key_setting.ads b/Ada95/samples/sample-function_key_setting.ads deleted file mode 100644 index 4188158f05c..00000000000 --- a/Ada95/samples/sample-function_key_setting.ads +++ /dev/null @@ -1,82 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Function_Key_Setting -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; - --- This package implements a simple stack of function key label environments. --- -package Sample.Function_Key_Setting is - - procedure Push_Environment (Key : String; - Reset : Boolean := True); - -- Push the definition of the current function keys on an internal - -- stack. If the reset flag is true, all labels are reset while - -- pushed, so the new environment can assume a tabula rasa. - -- The Key defines the new Help Context associated with the new - -- Environment. This saves also the currently active Notepad. - - procedure Pop_Environment; - -- Pop the Definitions from the stack and make them the current ones. - -- This also restores the Help context and the previous Notepad. - - procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style; - Just : Label_Justification := Left); - -- Initialize the environment - - function Context return String; - -- Return the current context identifier - - function Find_Context (Key : String) return Boolean; - -- Look for a context, return true if it is in the stack, - -- false otherwise. - - procedure Notepad_To_Context (Pan : Panel); - -- Add a panel representing a notepad to the current context. - - Function_Key_Stack_Error : exception; - - procedure Default_Labels; - -- Set the default labels used in all environments - - function Notepad_Window return Window; - -- Return the current notepad window or Null_Window if there is none. - -end Sample.Function_Key_Setting; diff --git a/Ada95/samples/sample-header_handler.adb b/Ada95/samples/sample-header_handler.adb deleted file mode 100644 index ad60caf4b0c..00000000000 --- a/Ada95/samples/sample-header_handler.adb +++ /dev/null @@ -1,182 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Header_Handler -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.19 $ --- $Date: 2011/03/22 23:54:38 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Calendar; use Ada.Calendar; -with Terminal_Interface.Curses.Text_IO.Integer_IO; -with Sample.Manifest; use Sample.Manifest; - -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO); - --- This package handles the painting of the header line of the screen. --- -package body Sample.Header_Handler is - - package Int_IO is new - Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); - use Int_IO; - - Header_Window : Window := Null_Window; - - Display_Hour : Integer := -1; -- hour last displayed - Display_Min : Integer := -1; -- minute last displayed - Display_Day : Integer := -1; -- day last displayed - Display_Month : Integer := -1; -- month last displayed - - -- This is the routine handed over to the curses library to be called - -- as initialization routine when ripping of the header lines from - -- the screen. This routine must follow C conventions. - function Init_Header_Window (Win : Window; - Columns : Column_Count) return Integer; - pragma Convention (C, Init_Header_Window); - - procedure Internal_Update_Header_Window (Do_Update : Boolean); - - -- The initialization must be called before Init_Screen. It steals two - -- lines from the top of the screen. - procedure Init_Header_Handler - is - begin - Rip_Off_Lines (2, Init_Header_Window'Access); - end Init_Header_Handler; - - procedure N_Out (N : Integer); - - -- Emit a two digit number and ensure that a leading zero is generated if - -- necessary. - procedure N_Out (N : Integer) - is - begin - if N < 10 then - Add (Header_Window, '0'); - Put (Header_Window, N, 1); - else - Put (Header_Window, N, 2); - end if; - end N_Out; - - -- Paint the header window. The input parameter is a flag indicating - -- whether or not the screen should be updated physically after painting. - procedure Internal_Update_Header_Window (Do_Update : Boolean) - is - type Month_Name_Array is - array (Month_Number'First .. Month_Number'Last) of String (1 .. 9); - - Month_Names : constant Month_Name_Array := - ("January ", - "February ", - "March ", - "April ", - "May ", - "June ", - "July ", - "August ", - "September", - "October ", - "November ", - "December "); - - Now : constant Time := Clock; - Sec : constant Integer := Integer (Seconds (Now)); - Hour : constant Integer := Sec / 3600; - Minute : constant Integer := (Sec - Hour * 3600) / 60; - Mon : constant Month_Number := Month (Now); - D : constant Day_Number := Day (Now); - begin - if Header_Window /= Null_Window then - if Minute /= Display_Min or else Hour /= Display_Hour - or else Display_Day /= D or else Display_Month /= Mon then - Move_Cursor (Header_Window, 0, 0); - N_Out (D); Add (Header_Window, '.'); - Add (Header_Window, Month_Names (Mon)); - Move_Cursor (Header_Window, 1, 0); - N_Out (Hour); Add (Header_Window, ':'); - N_Out (Minute); - Display_Min := Minute; - Display_Hour := Hour; - Display_Month := Mon; - Display_Day := D; - Refresh_Without_Update (Header_Window); - if Do_Update then - Update_Screen; - end if; - end if; - end if; - end Internal_Update_Header_Window; - - -- This routine is called in the keyboard input timeout handler. So it will - -- periodically update the header line of the screen. - procedure Update_Header_Window - is - begin - Internal_Update_Header_Window (True); - end Update_Header_Window; - - function Init_Header_Window (Win : Window; - Columns : Column_Count) return Integer - is - Title : constant String := "Ada 95 ncurses Binding Sample"; - Pos : Column_Position; - begin - Header_Window := Win; - if Win /= Null_Window then - if Has_Colors then - Set_Background (Win => Win, - Ch => (Ch => ' ', - Color => Header_Color, - Attr => Normal_Video)); - Set_Character_Attributes (Win => Win, - Attr => Normal_Video, - Color => Header_Color); - Erase (Win); - end if; - Leave_Cursor_After_Update (Win, True); - Pos := Columns - Column_Position (Title'Length); - Add (Win, 0, Pos / 2, Title); - -- In this phase we must not allow a physical update, because - -- ncurses is not properly initialized at this point. - Internal_Update_Header_Window (False); - return 0; - else - return -1; - end if; - end Init_Header_Window; - -end Sample.Header_Handler; diff --git a/Ada95/samples/sample-header_handler.ads b/Ada95/samples/sample-header_handler.ads deleted file mode 100644 index aa0a0c29e9f..00000000000 --- a/Ada95/samples/sample-header_handler.ads +++ /dev/null @@ -1,53 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Header_Handler -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - --- This package handles the painting of the header line of the screen. --- -package Sample.Header_Handler is - - procedure Init_Header_Handler; - -- Initialize the handler for the headerlines. - - procedure Update_Header_Window; - -- Update the information in the header window - -end Sample.Header_Handler; diff --git a/Ada95/samples/sample-helpers.adb b/Ada95/samples/sample-helpers.adb deleted file mode 100644 index ceef268134a..00000000000 --- a/Ada95/samples/sample-helpers.adb +++ /dev/null @@ -1,68 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Helpers -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.14 $ --- $Date: 2011/03/19 12:13:21 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Sample.Explanation; use Sample.Explanation; - --- This package contains some convenient helper routines used throughout --- this example. --- -package body Sample.Helpers is - - procedure Window_Title (Win : Window; - Title : String) - is - Height : Line_Count; - Width : Column_Count; - Pos : Column_Position := 0; - begin - Get_Size (Win, Height, Width); - if Title'Length < Width then - Pos := (Width - Title'Length) / 2; - end if; - Add (Win, 0, Pos, Title); - end Window_Title; - - procedure Not_Implemented is - begin - Explain ("NOTIMPL"); - end Not_Implemented; - -end Sample.Helpers; diff --git a/Ada95/samples/sample-helpers.ads b/Ada95/samples/sample-helpers.ads deleted file mode 100644 index 28e89bb5707..00000000000 --- a/Ada95/samples/sample-helpers.ads +++ /dev/null @@ -1,54 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Helpers -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - --- This package contains some convenient helper routines used throughout --- this example. --- -package Sample.Helpers is - - procedure Window_Title (Win : Window; - Title : String); - -- Put a title string into the first line of the window - - procedure Not_Implemented; - -end Sample.Helpers; diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb deleted file mode 100644 index 1d3f20c74b4..00000000000 --- a/Ada95/samples/sample-keyboard_handler.adb +++ /dev/null @@ -1,194 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Keyboard_Handler -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.16 $ --- $Date: 2011/03/23 00:34:24 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Strings; use Ada.Strings; -with Ada.Strings.Fixed; use Ada.Strings.Fixed; -with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; -with Ada.Characters.Handling; use Ada.Characters.Handling; - -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; -with Terminal_Interface.Curses.Forms.Field_Types.Enumeration; -use Terminal_Interface.Curses.Forms.Field_Types.Enumeration; - -with Sample.Header_Handler; use Sample.Header_Handler; -with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux; -with Sample.Manifest; use Sample.Manifest; -with Sample.Form_Demo.Handler; - --- This package contains a centralized keyboard handler used throughout --- this example. The handler establishes a timeout mechanism that provides --- periodical updates of the common header lines used in this example. --- - -package body Sample.Keyboard_Handler is - - In_Command : Boolean := False; - - function Get_Key (Win : Window := Standard_Window) return Real_Key_Code - is - K : Real_Key_Code; - - function Command return Real_Key_Code; - - function Command return Real_Key_Code - is - function My_Driver (F : Form; - C : Key_Code; - P : Panel) return Boolean; - package Fh is new Sample.Form_Demo.Handler (My_Driver); - - type Label_Array is array (Label_Number) of String (1 .. 8); - - Labels : Label_Array; - - FA : Field_Array_Access := new Field_Array' - (Make (0, 0, "Command:"), - Make (Top => 0, Left => 9, Width => Columns - 11), - Null_Field); - - K : Real_Key_Code := Key_None; - N : Natural := 0; - - function My_Driver (F : Form; - C : Key_Code; - P : Panel) return Boolean - is - Ch : Character; - begin - if P = Null_Panel then - raise Panel_Exception; - end if; - if C in User_Key_Code'Range and then C = QUIT then - if Driver (F, F_Validate_Field) = Form_Ok then - K := Key_None; - return True; - end if; - elsif C in Normal_Key_Code'Range then - Ch := Character'Val (C); - if Ch = LF or else Ch = CR then - if Driver (F, F_Validate_Field) = Form_Ok then - declare - Buffer : String (1 .. Positive (Columns - 11)); - Cmdc : String (1 .. 8); - begin - Get_Buffer (Fld => FA.all (2), Str => Buffer); - Trim (Buffer, Left); - if Buffer (1) /= ' ' then - Cmdc := To_Upper (Buffer (Cmdc'Range)); - for I in Labels'Range loop - if Cmdc = Labels (I) then - K := Function_Key_Code - (Function_Key_Number (I)); - exit; - end if; - end loop; - end if; - return True; - end; - end if; - end if; - end if; - return False; - end My_Driver; - - begin - In_Command := True; - for I in Label_Number'Range loop - Get_Soft_Label_Key (I, Labels (I)); - Trim (Labels (I), Left); - Translate (Labels (I), Upper_Case_Map); - if Labels (I) (1) /= ' ' then - N := N + 1; - end if; - end loop; - if N > 0 then -- some labels were really set - declare - Enum_Info : Enumeration_Info (N); - Enum_Field : Enumeration_Field; - J : Positive := Enum_Info.Names'First; - - Frm : Form := Create (FA); - - begin - for I in Label_Number'Range loop - if Labels (I) (1) /= ' ' then - Enum_Info.Names (J) := new String'(Labels (I)); - J := J + 1; - end if; - end loop; - Enum_Field := Create (Enum_Info, True); - Set_Field_Type (FA.all (2), Enum_Field); - Set_Background (FA.all (2), Normal_Video); - - Fh.Drive_Me (Frm, Lines - 3, 0); - Delete (Frm); - Update_Panels; Update_Screen; - end; - end if; - Free (FA, True); - In_Command := False; - return K; - end Command; - - begin - Set_Timeout_Mode (Win, Delayed, 30000); - loop - K := Get_Keystroke (Win); - if K = Key_None then -- a timeout occurred - Update_Header_Window; - elsif K = 3 and then not In_Command then -- CTRL-C - K := Command; - exit when K /= Key_None; - else - exit; - end if; - end loop; - return K; - end Get_Key; - - procedure Init_Keyboard_Handler is - begin - null; - end Init_Keyboard_Handler; - -end Sample.Keyboard_Handler; diff --git a/Ada95/samples/sample-keyboard_handler.ads b/Ada95/samples/sample-keyboard_handler.ads deleted file mode 100644 index ac5b1399db0..00000000000 --- a/Ada95/samples/sample-keyboard_handler.ads +++ /dev/null @@ -1,55 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Keyboard_Handler -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - --- This package contains a centralized keyboard handler used throughout --- this example. The handler establishes a timeout mechanism that provides --- periodical updates of the common header lines used in this example. --- -package Sample.Keyboard_Handler is - - function Get_Key (Win : Window := Standard_Window) return Real_Key_Code; - -- The central routine for handling keystrokes. - - procedure Init_Keyboard_Handler; - -- Initialize the keyboard - -end Sample.Keyboard_Handler; diff --git a/Ada95/samples/sample-manifest.ads b/Ada95/samples/sample-manifest.ads deleted file mode 100644 index bb76c4cba78..00000000000 --- a/Ada95/samples/sample-manifest.ads +++ /dev/null @@ -1,67 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Manifest -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; - -package Sample.Manifest is - - QUIT : constant User_Key_Code := User_Key_Code'First; - SELECT_ITEM : constant User_Key_Code := QUIT + 1; - - FKEY_HELP : constant Label_Number := 1; - HELP_CODE : constant Special_Key_Code := Key_F1; - FKEY_EXPLAIN : constant Label_Number := 2; - EXPLAIN_CODE : constant Special_Key_Code := Key_F2; - FKEY_QUIT : constant Label_Number := 3; - QUIT_CODE : constant Special_Key_Code := Key_F3; - - Menu_Marker : constant String := "=> "; - - Default_Colors : constant Redefinable_Color_Pair := 1; - Menu_Fore_Color : constant Redefinable_Color_Pair := 2; - Menu_Back_Color : constant Redefinable_Color_Pair := 3; - Menu_Grey_Color : constant Redefinable_Color_Pair := 4; - Form_Fore_Color : constant Redefinable_Color_Pair := 5; - Form_Back_Color : constant Redefinable_Color_Pair := 6; - Notepad_Color : constant Redefinable_Color_Pair := 7; - Help_Color : constant Redefinable_Color_Pair := 8; - Header_Color : constant Redefinable_Color_Pair := 9; - -end Sample.Manifest; diff --git a/Ada95/samples/sample-menu_demo-aux.adb b/Ada95/samples/sample-menu_demo-aux.adb deleted file mode 100644 index 091f08b92a3..00000000000 --- a/Ada95/samples/sample-menu_demo-aux.adb +++ /dev/null @@ -1,204 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Menu_Demo.Aux -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.14 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Helpers; use Sample.Helpers; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Explanation; use Sample.Explanation; - -package body Sample.Menu_Demo.Aux is - - procedure Geometry (M : Menu; - L : out Line_Count; - C : out Column_Count; - Y : out Line_Position; - X : out Column_Position; - Fy : out Line_Position; - Fx : out Column_Position); - - procedure Geometry (M : Menu; - L : out Line_Count; -- Lines used for menu - C : out Column_Count; -- Columns used for menu - Y : out Line_Position; -- Proposed Line for menu - X : out Column_Position; -- Proposed Column for menu - Fy : out Line_Position; -- Vertical inner frame - Fx : out Column_Position) -- Horiz. inner frame - is - Spc_Desc : Column_Position; -- spaces between description and item - begin - Set_Mark (M, Menu_Marker); - - Spacing (M, Spc_Desc, Fy, Fx); - Scale (M, L, C); - - Fx := Fx + Column_Position (Fy - 1); -- looks a bit nicer - - L := L + 2 * Fy; -- count for frame at top and bottom - C := C + 2 * Fx; -- " - - -- Calculate horizontal coordinate at the screen center - X := (Columns - C) / 2; - Y := 1; -- always startin line 1 - - end Geometry; - - procedure Geometry (M : Menu; - L : out Line_Count; -- Lines used for menu - C : out Column_Count; -- Columns used for menu - Y : out Line_Position; -- Proposed Line for menu - X : out Column_Position) -- Proposed Column for menu - is - Fy : Line_Position; - Fx : Column_Position; - begin - Geometry (M, L, C, Y, X, Fy, Fx); - end Geometry; - - function Create (M : Menu; - Title : String; - Lin : Line_Position; - Col : Column_Position) return Panel - is - W, S : Window; - L : Line_Count; - C : Column_Count; - Y, Fy : Line_Position; - X, Fx : Column_Position; - Pan : Panel; - begin - Geometry (M, L, C, Y, X, Fy, Fx); - W := New_Window (L, C, Lin, Col); - Set_Meta_Mode (W); - Set_KeyPad_Mode (W); - if Has_Colors then - Set_Background (Win => W, - Ch => (Ch => ' ', - Color => Menu_Back_Color, - Attr => Normal_Video)); - Set_Foreground (Men => M, Color => Menu_Fore_Color); - Set_Background (Men => M, Color => Menu_Back_Color); - Set_Grey (Men => M, Color => Menu_Grey_Color); - Erase (W); - end if; - S := Derived_Window (W, L - Fy, C - Fx, Fy, Fx); - Set_Meta_Mode (S); - Set_KeyPad_Mode (S); - Box (W); - Set_Window (M, W); - Set_Sub_Window (M, S); - if Title'Length > 0 then - Window_Title (W, Title); - end if; - Pan := New_Panel (W); - Post (M); - return Pan; - end Create; - - procedure Destroy (M : Menu; - P : in out Panel) - is - W, S : Window; - begin - W := Get_Window (M); - S := Get_Sub_Window (M); - Post (M, False); - Erase (W); - Delete (P); - Set_Window (M, Null_Window); - Set_Sub_Window (M, Null_Window); - Delete (S); - Delete (W); - Update_Panels; - end Destroy; - - function Get_Request (M : Menu; P : Panel) return Key_Code - is - W : constant Window := Get_Window (M); - K : Real_Key_Code; - Ch : Character; - begin - Top (P); - loop - K := Get_Key (W); - if K in Special_Key_Code'Range then - case K is - when HELP_CODE => Explain_Context; - when EXPLAIN_CODE => Explain ("MENUKEYS"); - when Key_Home => return REQ_FIRST_ITEM; - when QUIT_CODE => return QUIT; - when Key_Cursor_Down => return REQ_DOWN_ITEM; - when Key_Cursor_Up => return REQ_UP_ITEM; - when Key_Cursor_Left => return REQ_LEFT_ITEM; - when Key_Cursor_Right => return REQ_RIGHT_ITEM; - when Key_End => return REQ_LAST_ITEM; - when Key_Backspace => return REQ_BACK_PATTERN; - when Key_Next_Page => return REQ_SCR_DPAGE; - when Key_Previous_Page => return REQ_SCR_UPAGE; - when others => return K; - end case; - elsif K in Normal_Key_Code'Range then - Ch := Character'Val (K); - case Ch is - when CAN => return QUIT; -- CTRL-X - when SO => return REQ_NEXT_ITEM; -- CTRL-N - when DLE => return REQ_PREV_ITEM; -- CTRL-P - when NAK => return REQ_SCR_ULINE; -- CTRL-U - when EOT => return REQ_SCR_DLINE; -- CTRL-D - when ACK => return REQ_SCR_DPAGE; -- CTRL-F - when STX => return REQ_SCR_UPAGE; -- CTRL-B - when EM => return REQ_CLEAR_PATTERN; -- CTRL-Y - when BS => return REQ_BACK_PATTERN; -- CTRL-H - when SOH => return REQ_NEXT_MATCH; -- CTRL-A - when ENQ => return REQ_PREV_MATCH; -- CTRL-E - when DC4 => return REQ_TOGGLE_ITEM; -- CTRL-T - - when CR | LF => return SELECT_ITEM; - when others => return K; - end case; - else - return K; - end if; - end loop; - end Get_Request; - -end Sample.Menu_Demo.Aux; diff --git a/Ada95/samples/sample-menu_demo-aux.ads b/Ada95/samples/sample-menu_demo-aux.ads deleted file mode 100644 index e82aedf995b..00000000000 --- a/Ada95/samples/sample-menu_demo-aux.ads +++ /dev/null @@ -1,71 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Menu_Demo.Aux -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; - -package Sample.Menu_Demo.Aux is - - procedure Geometry (M : Menu; - L : out Line_Count; - C : out Column_Count; - Y : out Line_Position; - X : out Column_Position); - -- Calculate the geometry for a panel being able to be used to display - -- the menu. - - function Create (M : Menu; - Title : String; - Lin : Line_Position; - Col : Column_Position) return Panel; - -- Create a panel decorated with a frame and the title at the specified - -- position. The dimension of the panel is derived from the menus layout. - - procedure Destroy (M : Menu; - P : in out Panel); - -- Destroy all the windowing structures associated with this menu and - -- panel. - - function Get_Request (M : Menu; P : Panel) return Key_Code; - -- Centralized request driver for all menus in this sample. This - -- gives us a common key binding for all menus. - -end Sample.Menu_Demo.Aux; diff --git a/Ada95/samples/sample-menu_demo-handler.adb b/Ada95/samples/sample-menu_demo-handler.adb deleted file mode 100644 index 84d29f6351b..00000000000 --- a/Ada95/samples/sample-menu_demo-handler.adb +++ /dev/null @@ -1,108 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Menu_Demo.Handler -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2004,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.16 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Sample.Menu_Demo.Aux; -with Sample.Manifest; use Sample.Manifest; -with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse; - -package body Sample.Menu_Demo.Handler is - - package Aux renames Sample.Menu_Demo.Aux; - - procedure Drive_Me (M : Menu; - Title : String := "") - is - L : Line_Count; - C : Column_Count; - Y : Line_Position; - X : Column_Position; - begin - Aux.Geometry (M, L, C, Y, X); - Drive_Me (M, Y, X, Title); - end Drive_Me; - - procedure Drive_Me (M : Menu; - Lin : Line_Position; - Col : Column_Position; - Title : String := "") - is - Mask : Event_Mask := No_Events; - Old : Event_Mask; - Pan : Panel := Aux.Create (M, Title, Lin, Col); - V : Cursor_Visibility := Invisible; - begin - -- We are only interested in Clicks with the left button - Register_Reportable_Events (Left, All_Clicks, Mask); - Old := Start_Mouse (Mask); - Set_Cursor_Visibility (V); - loop - declare - K : Key_Code := Aux.Get_Request (M, Pan); - R : constant Driver_Result := Driver (M, K); - begin - case R is - when Menu_Ok => null; - when Unknown_Request => - declare - I : constant Item := Current (M); - O : Item_Option_Set; - begin - if K = Key_Mouse then - K := SELECT_ITEM; - end if; - Get_Options (I, O); - if K = SELECT_ITEM and then not O.Selectable then - Beep; - else - if My_Driver (M, K, Pan) then - exit; - end if; - end if; - end; - when others => Beep; - end case; - end; - end loop; - End_Mouse (Old); - Aux.Destroy (M, Pan); - end Drive_Me; - -end Sample.Menu_Demo.Handler; diff --git a/Ada95/samples/sample-menu_demo-handler.ads b/Ada95/samples/sample-menu_demo-handler.ads deleted file mode 100644 index e9eaa6b74b7..00000000000 --- a/Ada95/samples/sample-menu_demo-handler.ads +++ /dev/null @@ -1,64 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Menu_Demo.Handler -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.10 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; -use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; -use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Menus; -use Terminal_Interface.Curses.Menus; - -generic - with function My_Driver (Men : Menu; - K : Key_Code; - Pan : Panel) return Boolean; -package Sample.Menu_Demo.Handler is - - procedure Drive_Me (M : Menu; - Lin : Line_Position; - Col : Column_Position; - Title : String := ""); - -- Position the menu at the given point and drive it. - - procedure Drive_Me (M : Menu; - Title : String := ""); - -- Center menu and drive it. - -end Sample.Menu_Demo.Handler; diff --git a/Ada95/samples/sample-menu_demo.adb b/Ada95/samples/sample-menu_demo.adb deleted file mode 100644 index 80cd94b1d4e..00000000000 --- a/Ada95/samples/sample-menu_demo.adb +++ /dev/null @@ -1,396 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Menu_Demo -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2008,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.19 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; -with Terminal_Interface.Curses.Menus.Menu_User_Data; -with Terminal_Interface.Curses.Menus.Item_User_Data; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Menu_Demo.Handler; -with Sample.Helpers; use Sample.Helpers; -with Sample.Explanation; use Sample.Explanation; - -package body Sample.Menu_Demo is - - package Spacing_Demo is - procedure Spacing_Test; - end Spacing_Demo; - - package body Spacing_Demo is - - procedure Spacing_Test - is - function My_Driver (M : Menu; - K : Key_Code; - P : Panel) return Boolean; - - procedure Set_Option_Key; - procedure Set_Select_Key; - procedure Set_Description_Key; - procedure Set_Hide_Key; - - package Mh is new Sample.Menu_Demo.Handler (My_Driver); - - I : Item_Array_Access := new Item_Array' - (New_Item ("January", "31 Days"), - New_Item ("February", "28/29 Days"), - New_Item ("March", "31 Days"), - New_Item ("April", "30 Days"), - New_Item ("May", "31 Days"), - New_Item ("June", "30 Days"), - New_Item ("July", "31 Days"), - New_Item ("August", "31 Days"), - New_Item ("September", "30 Days"), - New_Item ("October", "31 Days"), - New_Item ("November", "30 Days"), - New_Item ("December", "31 Days"), - Null_Item); - - M : Menu := New_Menu (I); - Flip_State : Boolean := True; - Hide_Long : Boolean := False; - - type Format_Code is (Four_By_1, Four_By_2, Four_By_3); - type Operations is (Flip, Reorder, Reformat, Reselect, Describe); - - type Change is array (Operations) of Boolean; - pragma Pack (Change); - No_Change : constant Change := Change'(others => False); - - Current_Format : Format_Code := Four_By_1; - To_Change : Change := No_Change; - - function My_Driver (M : Menu; - K : Key_Code; - P : Panel) return Boolean - is - begin - if M = Null_Menu then - raise Menu_Exception; - end if; - if P = Null_Panel then - raise Panel_Exception; - end if; - To_Change := No_Change; - if K in User_Key_Code'Range then - if K = QUIT then - return True; - end if; - end if; - if K in Special_Key_Code'Range then - case K is - when Key_F4 => - To_Change (Flip) := True; - return True; - when Key_F5 => - To_Change (Reformat) := True; - Current_Format := Four_By_1; - return True; - when Key_F6 => - To_Change (Reformat) := True; - Current_Format := Four_By_2; - return True; - when Key_F7 => - To_Change (Reformat) := True; - Current_Format := Four_By_3; - return True; - when Key_F8 => - To_Change (Reorder) := True; - return True; - when Key_F9 => - To_Change (Reselect) := True; - return True; - when Key_F10 => - if Current_Format /= Four_By_3 then - To_Change (Describe) := True; - return True; - else - return False; - end if; - when Key_F11 => - Hide_Long := not Hide_Long; - declare - O : Item_Option_Set; - begin - for J in I'Range loop - Get_Options (I.all (J), O); - O.Selectable := True; - if Hide_Long then - case J is - when 1 | 3 | 5 | 7 | 8 | 10 | 12 => - O.Selectable := False; - when others => null; - end case; - end if; - Set_Options (I.all (J), O); - end loop; - end; - return False; - when others => null; - end case; - end if; - return False; - end My_Driver; - - procedure Set_Option_Key - is - O : Menu_Option_Set; - begin - if Current_Format = Four_By_1 then - Set_Soft_Label_Key (8, ""); - else - Get_Options (M, O); - if O.Row_Major_Order then - Set_Soft_Label_Key (8, "O-Col"); - else - Set_Soft_Label_Key (8, "O-Row"); - end if; - end if; - Refresh_Soft_Label_Keys_Without_Update; - end Set_Option_Key; - - procedure Set_Select_Key - is - O : Menu_Option_Set; - begin - Get_Options (M, O); - if O.One_Valued then - Set_Soft_Label_Key (9, "Multi"); - else - Set_Soft_Label_Key (9, "Singl"); - end if; - Refresh_Soft_Label_Keys_Without_Update; - end Set_Select_Key; - - procedure Set_Description_Key - is - O : Menu_Option_Set; - begin - if Current_Format = Four_By_3 then - Set_Soft_Label_Key (10, ""); - else - Get_Options (M, O); - if O.Show_Descriptions then - Set_Soft_Label_Key (10, "-Desc"); - else - Set_Soft_Label_Key (10, "+Desc"); - end if; - end if; - Refresh_Soft_Label_Keys_Without_Update; - end Set_Description_Key; - - procedure Set_Hide_Key - is - begin - if Hide_Long then - Set_Soft_Label_Key (11, "Enab"); - else - Set_Soft_Label_Key (11, "Disab"); - end if; - Refresh_Soft_Label_Keys_Without_Update; - end Set_Hide_Key; - - begin - Push_Environment ("MENU01"); - Notepad ("MENU-PAD01"); - Default_Labels; - Set_Soft_Label_Key (4, "Flip"); - Set_Soft_Label_Key (5, "4x1"); - Set_Soft_Label_Key (6, "4x2"); - Set_Soft_Label_Key (7, "4x3"); - Set_Option_Key; - Set_Select_Key; - Set_Description_Key; - Set_Hide_Key; - - Set_Format (M, 4, 1); - loop - Mh.Drive_Me (M); - exit when To_Change = No_Change; - if To_Change (Flip) then - if Flip_State then - Flip_State := False; - Set_Spacing (M, 3, 2, 0); - else - Flip_State := True; - Set_Spacing (M); - end if; - elsif To_Change (Reformat) then - case Current_Format is - when Four_By_1 => Set_Format (M, 4, 1); - when Four_By_2 => Set_Format (M, 4, 2); - when Four_By_3 => - declare - O : Menu_Option_Set; - begin - Get_Options (M, O); - O.Show_Descriptions := False; - Set_Options (M, O); - Set_Format (M, 4, 3); - end; - end case; - Set_Option_Key; - Set_Description_Key; - elsif To_Change (Reorder) then - declare - O : Menu_Option_Set; - begin - Get_Options (M, O); - O.Row_Major_Order := not O.Row_Major_Order; - Set_Options (M, O); - Set_Option_Key; - end; - elsif To_Change (Reselect) then - declare - O : Menu_Option_Set; - begin - Get_Options (M, O); - O.One_Valued := not O.One_Valued; - Set_Options (M, O); - Set_Select_Key; - end; - elsif To_Change (Describe) then - declare - O : Menu_Option_Set; - begin - Get_Options (M, O); - O.Show_Descriptions := not O.Show_Descriptions; - Set_Options (M, O); - Set_Description_Key; - end; - else - null; - end if; - end loop; - Set_Spacing (M); - - Pop_Environment; - pragma Assert (Get_Index (Items (M, 1)) = Get_Index (I (1))); - Delete (M); - Free (I, True); - end Spacing_Test; - end Spacing_Demo; - - procedure Demo - is - -- We use this datatype only to test the instantiation of - -- the Menu_User_Data generic package. No functionality - -- behind it. - type User_Data is new Integer; - type User_Data_Access is access User_Data; - - -- Those packages are only instantiated to test the usability. - -- No real functionality is shown in the demo. - package MUD is new Menu_User_Data (User_Data, User_Data_Access); - package IUD is new Item_User_Data (User_Data, User_Data_Access); - - function My_Driver (M : Menu; - K : Key_Code; - P : Panel) return Boolean; - - package Mh is new Sample.Menu_Demo.Handler (My_Driver); - - Itm : Item_Array_Access := new Item_Array' - (New_Item ("Menu Layout Options"), - New_Item ("Demo of Hook functions"), - Null_Item); - M : Menu := New_Menu (Itm); - - U1 : constant User_Data_Access := new User_Data'(4711); - U2 : User_Data_Access; - U3 : constant User_Data_Access := new User_Data'(4712); - U4 : User_Data_Access; - - function My_Driver (M : Menu; - K : Key_Code; - P : Panel) return Boolean - is - Idx : constant Positive := Get_Index (Current (M)); - begin - if K in User_Key_Code'Range then - if K = QUIT then - return True; - elsif K = SELECT_ITEM then - if Idx in Itm'Range then - Hide (P); - Update_Panels; - end if; - case Idx is - when 1 => Spacing_Demo.Spacing_Test; - when others => Not_Implemented; - end case; - if Idx in Itm'Range then - Top (P); - Show (P); - Update_Panels; - Update_Screen; - end if; - end if; - end if; - return False; - end My_Driver; - begin - Push_Environment ("MENU00"); - Notepad ("MENU-PAD00"); - Default_Labels; - Refresh_Soft_Label_Keys_Without_Update; - Set_Pad_Character (M, '|'); - - MUD.Set_User_Data (M, U1); - IUD.Set_User_Data (Itm.all (1), U3); - - Mh.Drive_Me (M); - - MUD.Get_User_Data (M, U2); - pragma Assert (U1 = U2 and U1.all = 4711); - - IUD.Get_User_Data (Itm.all (1), U4); - pragma Assert (U3 = U4 and U3.all = 4712); - - Pop_Environment; - Delete (M); - Free (Itm, True); - end Demo; - -end Sample.Menu_Demo; diff --git a/Ada95/samples/sample-menu_demo.ads b/Ada95/samples/sample-menu_demo.ads deleted file mode 100644 index b071afc8277..00000000000 --- a/Ada95/samples/sample-menu_demo.ads +++ /dev/null @@ -1,45 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Menu_Demo -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample.Menu_Demo is - - procedure Demo; - -end Sample.Menu_Demo; diff --git a/Ada95/samples/sample-my_field_type.adb b/Ada95/samples/sample-my_field_type.adb deleted file mode 100644 index e0d6f6732d1..00000000000 --- a/Ada95/samples/sample-my_field_type.adb +++ /dev/null @@ -1,68 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.My_Field_Type -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.16 $ --- $Date: 2008/07/26 18:47:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - --- This is a very simple user defined field type. It accepts only a --- defined character as input into the field. --- -package body Sample.My_Field_Type is - - -- That's simple. There are minimal field validity checks. - function Field_Check (Fld : Field; - Typ : My_Data) return Boolean - is - begin - if Fld = Null_Field or Typ.Ch = Character'Val (0) then - return False; - end if; - return True; - end Field_Check; - - -- Check exactly against the specified character. - function Character_Check (Ch : Character; - Typ : My_Data) return Boolean - is - C : constant Character := Typ.Ch; - begin - return Ch = C; - end Character_Check; - -end Sample.My_Field_Type; diff --git a/Ada95/samples/sample-my_field_type.ads b/Ada95/samples/sample-my_field_type.ads deleted file mode 100644 index b8f3653c1d0..00000000000 --- a/Ada95/samples/sample-my_field_type.ads +++ /dev/null @@ -1,61 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.My_Field_Type -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; -with Terminal_Interface.Curses.Forms.Field_Types.User; -use Terminal_Interface.Curses.Forms.Field_Types.User; - --- This is a very simple user defined field type. It accepts only a --- defined character as input into the field. --- -package Sample.My_Field_Type is - - type My_Data is new User_Defined_Field_Type with - record - Ch : Character; - end record; - - function Field_Check (Fld : Field; - Typ : My_Data) return Boolean; - - function Character_Check (Ch : Character; - Typ : My_Data) return Boolean; - -end Sample.My_Field_Type; diff --git a/Ada95/samples/sample-text_io_demo.adb b/Ada95/samples/sample-text_io_demo.adb deleted file mode 100644 index a458a37cdbd..00000000000 --- a/Ada95/samples/sample-text_io_demo.adb +++ /dev/null @@ -1,195 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Text_IO_Demo -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.17 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Numerics.Generic_Elementary_Functions; - -with Ada.Numerics.Complex_Types; -use Ada.Numerics.Complex_Types; - -with Terminal_Interface.Curses; -use Terminal_Interface.Curses; - -with Terminal_Interface.Curses.Panels; -use Terminal_Interface.Curses.Panels; - -with Terminal_Interface.Curses.Text_IO; -use Terminal_Interface.Curses.Text_IO; - -with Terminal_Interface.Curses.Text_IO.Integer_IO; -with Terminal_Interface.Curses.Text_IO.Float_IO; -with Terminal_Interface.Curses.Text_IO.Enumeration_IO; -with Terminal_Interface.Curses.Text_IO.Complex_IO; -with Terminal_Interface.Curses.Text_IO.Fixed_IO; -with Terminal_Interface.Curses.Text_IO.Decimal_IO; -with Terminal_Interface.Curses.Text_IO.Modular_IO; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Explanation; use Sample.Explanation; - -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Complex_IO); -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Decimal_IO); -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Enumeration_IO); -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Fixed_IO); -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Float_IO); -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO); -pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Modular_IO); - -package body Sample.Text_IO_Demo is - - type Weekday is (Sunday, - Monday, - Tuesday, - Wednesday, - Thursday, - Friday, - Saturday); - - type Fix is delta 0.1 range 0.0 .. 4.0; - type Dec is delta 0.01 digits 5 range 0.0 .. 4.0; - type Md is mod 5; - - package Math is new - Ada.Numerics.Generic_Elementary_Functions (Float); - - package Int_IO is new - Terminal_Interface.Curses.Text_IO.Integer_IO (Integer); - use Int_IO; - - package Real_IO is new - Terminal_Interface.Curses.Text_IO.Float_IO (Float); - use Real_IO; - - package Enum_IO is new - Terminal_Interface.Curses.Text_IO.Enumeration_IO (Weekday); - use Enum_IO; - - package C_IO is new - Terminal_Interface.Curses.Text_IO.Complex_IO (Ada.Numerics.Complex_Types); - use C_IO; - - package F_IO is new - Terminal_Interface.Curses.Text_IO.Fixed_IO (Fix); - use F_IO; - - package D_IO is new - Terminal_Interface.Curses.Text_IO.Decimal_IO (Dec); - use D_IO; - - package M_IO is new - Terminal_Interface.Curses.Text_IO.Modular_IO (Md); - use M_IO; - - procedure Demo - is - W : Window; - P : Panel := Create (Standard_Window); - K : Real_Key_Code; - Im : constant Complex := (0.0, 1.0); - Fx : constant Dec := 3.14; - Dc : constant Dec := 2.72; - L : Md; - - begin - Push_Environment ("TEXTIO"); - Default_Labels; - Notepad ("TEXTIO-PAD00"); - - Set_Echo_Mode (False); - Set_Meta_Mode; - Set_KeyPad_Mode; - W := Sub_Window (Standard_Window, Lines - 2, Columns - 2, 1, 1); - Box; - Refresh_Without_Update; - Set_Meta_Mode (W); - Set_KeyPad_Mode (W); - Immediate_Update_Mode (W, True); - - Set_Window (W); - - for I in 1 .. 10 loop - Put ("Square root of "); - Put (Item => I, Width => 5); - Put (" is "); - Put (Item => Math.Sqrt (Float (I)), Exp => 0, Aft => 7); - New_Line; - end loop; - - for W in Weekday loop - Put (Item => W); Put (' '); - end loop; - New_Line; - - L := Md'First; - for I in 1 .. 2 loop - for J in Md'Range loop - Put (L); Put (' '); - L := L + 1; - end loop; - end loop; - New_Line; - - Put (Im); New_Line; - Put (Fx); New_Line; - Put (Dc); New_Line; - - loop - K := Get_Key; - if K in Special_Key_Code'Range then - case K is - when QUIT_CODE => exit; - when HELP_CODE => Explain_Context; - when EXPLAIN_CODE => Explain ("TEXTIOKEYS"); - when others => null; - end case; - end if; - end loop; - - Set_Window (Null_Window); - Erase; Refresh_Without_Update; - Delete (P); - Delete (W); - - Pop_Environment; - end Demo; - -end Sample.Text_IO_Demo; diff --git a/Ada95/samples/sample-text_io_demo.ads b/Ada95/samples/sample-text_io_demo.ads deleted file mode 100644 index d3f5a188baf..00000000000 --- a/Ada95/samples/sample-text_io_demo.ads +++ /dev/null @@ -1,45 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample.Text_IO_Demo -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample.Text_IO_Demo is - - procedure Demo; - -end Sample.Text_IO_Demo; diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb deleted file mode 100644 index 9b3759f0c53..00000000000 --- a/Ada95/samples/sample.adb +++ /dev/null @@ -1,220 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2008,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.18 $ --- $Date: 2011/03/23 00:44:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Text_IO; - -with Ada.Exceptions; use Ada.Exceptions; - -with Terminal_Interface.Curses; use Terminal_Interface.Curses; -with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; -with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; -with Terminal_Interface.Curses.Menus.Menu_User_Data; -with Terminal_Interface.Curses.Menus.Item_User_Data; - -with Sample.Manifest; use Sample.Manifest; -with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; -with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; -with Sample.Header_Handler; use Sample.Header_Handler; -with Sample.Explanation; use Sample.Explanation; - -with Sample.Menu_Demo.Handler; -with Sample.Curses_Demo; -with Sample.Form_Demo; -with Sample.Menu_Demo; -with Sample.Text_IO_Demo; - -with GNAT.OS_Lib; - -package body Sample is - - type User_Data is - record - Data : Integer; - end record; - type User_Access is access User_Data; - - package Ud is new - Terminal_Interface.Curses.Menus.Menu_User_Data - (User_Data, User_Access); - - package Id is new - Terminal_Interface.Curses.Menus.Item_User_Data - (User_Data, User_Access); - - procedure Whow is - procedure Main_Menu; - procedure Main_Menu - is - function My_Driver (M : Menu; - K : Key_Code; - Pan : Panel) return Boolean; - - package Mh is new Sample.Menu_Demo.Handler (My_Driver); - - I : Item_Array_Access := new Item_Array' - (New_Item ("Curses Core Demo"), - New_Item ("Menu Demo"), - New_Item ("Form Demo"), - New_Item ("Text IO Demo"), - Null_Item); - - M : Menu := New_Menu (I); - - D1, D2 : User_Access; - I1, I2 : User_Access; - - function My_Driver (M : Menu; - K : Key_Code; - Pan : Panel) return Boolean - is - Idx : constant Positive := Get_Index (Current (M)); - begin - if K in User_Key_Code'Range then - if K = QUIT then - return True; - elsif K = SELECT_ITEM then - if Idx <= 4 then - Hide (Pan); - Update_Panels; - end if; - case Idx is - when 1 => Sample.Curses_Demo.Demo; - when 2 => Sample.Menu_Demo.Demo; - when 3 => Sample.Form_Demo.Demo; - when 4 => Sample.Text_IO_Demo.Demo; - when others => null; - end case; - if Idx <= 4 then - Top (Pan); - Show (Pan); - Update_Panels; - Update_Screen; - end if; - end if; - end if; - return False; - end My_Driver; - - begin - - if (1 + Item_Count (M)) /= I'Length then - raise Constraint_Error; - end if; - - D1 := new User_Data'(Data => 4711); - Ud.Set_User_Data (M, D1); - - I1 := new User_Data'(Data => 1174); - Id.Set_User_Data (I.all (1), I1); - - Set_Spacing (Men => M, Row => 2); - - Default_Labels; - Notepad ("MAINPAD"); - - Mh.Drive_Me (M, " Demo "); - - Ud.Get_User_Data (M, D2); - pragma Assert (D1 = D2); - pragma Assert (D1.Data = D2.Data); - - Id.Get_User_Data (I.all (1), I2); - pragma Assert (I1 = I2); - pragma Assert (I1.Data = I2.Data); - - Delete (M); - Free (I, True); - end Main_Menu; - - begin - Initialize (PC_Style_With_Index); - Init_Header_Handler; - Init_Screen; - - if Has_Colors then - Start_Color; - - Init_Pair (Pair => Default_Colors, Fore => Black, Back => White); - Init_Pair (Pair => Menu_Back_Color, Fore => Black, Back => Cyan); - Init_Pair (Pair => Menu_Fore_Color, Fore => Red, Back => Cyan); - Init_Pair (Pair => Menu_Grey_Color, Fore => White, Back => Cyan); - Init_Pair (Pair => Notepad_Color, Fore => Black, Back => Yellow); - Init_Pair (Pair => Help_Color, Fore => Blue, Back => Cyan); - Init_Pair (Pair => Form_Back_Color, Fore => Black, Back => Cyan); - Init_Pair (Pair => Form_Fore_Color, Fore => Red, Back => Cyan); - Init_Pair (Pair => Header_Color, Fore => Black, Back => Green); - - Set_Background (Ch => (Color => Default_Colors, - Attr => Normal_Video, - Ch => ' ')); - Set_Character_Attributes (Attr => Normal_Video, - Color => Default_Colors); - Erase; - - Set_Soft_Label_Key_Attributes (Color => Header_Color); - -- This propagates the attributes to the label window - Refresh_Soft_Label_Keys; - end if; - - Init_Keyboard_Handler; - - Set_Echo_Mode (False); - Set_Raw_Mode; - Set_Meta_Mode; - Set_KeyPad_Mode; - - -- Initialize the Function Key Environment - -- We have some fixed key throughout this sample - Main_Menu; - End_Windows; - Curses_Free_All; - - exception - when Event : others => - Terminal_Interface.Curses.End_Windows; - Text_IO.Put ("Exception: "); - Text_IO.Put (Exception_Name (Event)); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (1); - - end Whow; - -end Sample; diff --git a/Ada95/samples/sample.ads b/Ada95/samples/sample.ads deleted file mode 100644 index 9d0647dad78..00000000000 --- a/Ada95/samples/sample.ads +++ /dev/null @@ -1,43 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Sample -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Sample is - procedure Whow; -end Sample; diff --git a/Ada95/samples/status.adb b/Ada95/samples/status.adb deleted file mode 100644 index e6581317f40..00000000000 --- a/Ada95/samples/status.adb +++ /dev/null @@ -1,57 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Status -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Laurent Pautet --- Modified by: Juergen Pfeifer, 1997 --- Version Control --- $Revision: 1.7 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- This package has been contributed by Laurent Pautet -- --- -- -package body Status is - - protected body Process is - procedure Stop is - begin - Done := True; - end Stop; - function Continue return Boolean is - begin - return not Done; - end Continue; - end Process; - -end Status; diff --git a/Ada95/samples/status.ads b/Ada95/samples/status.ads deleted file mode 100644 index e9e3ee8b350..00000000000 --- a/Ada95/samples/status.ads +++ /dev/null @@ -1,60 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Status -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Laurent Pautet --- Modified by: Juergen Pfeifer, 1997 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- This package has been contributed by Laurent Pautet -- --- -- -with Ada.Interrupts.Names; - -package Status is - - pragma Warnings (Off); -- the next pragma exists since 3.11p - pragma Unreserve_All_Interrupts; - pragma Warnings (On); - - protected Process is - procedure Stop; - function Continue return Boolean; - pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); - private - Done : Boolean := False; - end Process; - -end Status; diff --git a/Ada95/samples/tour.adb b/Ada95/samples/tour.adb deleted file mode 100644 index 1cc91c15d74..00000000000 --- a/Ada95/samples/tour.adb +++ /dev/null @@ -1,46 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- tour -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Sample; use Sample; - -procedure Tour is -begin - Whow; -end Tour; diff --git a/Ada95/samples/tour.ads b/Ada95/samples/tour.ads deleted file mode 100644 index 8888169160a..00000000000 --- a/Ada95/samples/tour.ads +++ /dev/null @@ -1,41 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding Samples -- --- -- --- Tour -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control --- $Revision: 1.9 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -procedure Tour; diff --git a/Ada95/src/Makefile.in b/Ada95/src/Makefile.in deleted file mode 100644 index f6c3e75673b..00000000000 --- a/Ada95/src/Makefile.in +++ /dev/null @@ -1,319 +0,0 @@ -############################################################################## -# Copyright (c) 1998-2010,2011 Free 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: Juergen Pfeifer, 1996 -# -# $Id: Makefile.in,v 1.60 2011/03/31 09:46:16 tom Exp $ -# -.SUFFIXES: - -SHELL = /bin/sh -VPATH = @srcdir@ -THIS = Makefile - -MODEL = ../../@DFT_OBJ_SUBDIR@ - -DESTDIR = @DESTDIR@ - -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -includedir = @includedir@ -libdir = @libdir@ - -LIBDIR = $(DESTDIR)$(libdir) -ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@ -ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@ - -INSTALL = @INSTALL@ -INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ - -AR = @AR@ -ARFLAGS = @ARFLAGS@ -AWK = @AWK@ -LN_S = @LN_S@ - -CC = @CC@ -CFLAGS = @CFLAGS@ - -CPPFLAGS = @ACPPFLAGS@ @CPPFLAGS@ \ - -DHAVE_CONFIG_H -I$(srcdir) - -CCFLAGS = $(CPPFLAGS) $(CFLAGS) - -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ - -CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) - -LINK = $(CC) -LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ - -RANLIB = @RANLIB@ - -################################################################################ -ADA = @cf_ada_compiler@ -ADAPREP = gnatprep -ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) - -LIB_NAME = AdaCurses -SONAME = @ADA_SHAREDLIB@ - -GNAT_PROJECT = $(srcdir)/library.gpr - -# build/source are the Ada95 tree -BUILD_DIR = .. -SOURCE_DIR = .. - -BUILD_DIR_LIB = $(BUILD_DIR)/lib -SOURCE_DIR_SRC = $(SOURCE_DIR)/src - -ADAMAKE = @cf_ada_make@ -ADAMAKEFLAGS = \ - -P$(GNAT_PROJECT) \ - -XBUILD_DIR=`cd $(BUILD_DIR);pwd` \ - -XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \ - -XSOURCE_DIR2=`cd $(srcdir);pwd` \ - -XLIB_NAME=$(LIB_NAME) \ - -XSONAME=$(SONAME) - -CARGS = -cargs $(ADAFLAGS) -LARGS = - -STATIC_LIBNAME = lib$(LIB_NAME).a -SHARED_LIBNAME = $(SONAME) -SHARED_SYMLINK = lib$(LIB_NAME).so - -ALIB = @cf_ada_package@ -ABASE = $(ALIB)-curses -################################################################################ -GENERATED_SOURCES=$(ABASE).ads \ - $(ABASE).adb \ - $(ABASE)-aux.ads \ - $(ABASE)-trace.ads \ - $(ABASE)-menus.ads \ - $(ABASE)-forms.ads \ - $(ABASE)-mouse.ads \ - $(ABASE)-panels.ads \ - $(ABASE)-menus-menu_user_data.ads \ - $(ABASE)-menus-item_user_data.ads \ - $(ABASE)-forms-form_user_data.ads \ - $(ABASE)-forms-field_types.ads \ - $(ABASE)-forms-field_user_data.ads \ - $(ABASE)-panels-user_data.ads -################################################################################ -LIBOBJS=$(ALIB).o \ - $(ABASE)-aux.o \ - $(ABASE).o \ - $(ABASE)-terminfo.o \ - $(ABASE)-termcap.o \ - $(ABASE)-putwin.o \ - $(ABASE)-trace.o \ - $(ABASE)-mouse.o \ - $(ABASE)-panels.o \ - $(ABASE)-menus.o \ - $(ABASE)-forms.o \ - $(ABASE)-forms-field_types.o \ - $(ABASE)-forms-field_types-alpha.o \ - $(ABASE)-forms-field_types-alphanumeric.o \ - $(ABASE)-forms-field_types-intfield.o \ - $(ABASE)-forms-field_types-numeric.o \ - $(ABASE)-forms-field_types-regexp.o \ - $(ABASE)-forms-field_types-enumeration.o \ - $(ABASE)-forms-field_types-ipv4_address.o \ - $(ABASE)-forms-field_types-user.o \ - $(ABASE)-forms-field_types-user-choice.o \ - $(ABASE)-text_io.o \ - $(ABASE)-text_io-aux.o - -# Ada object files for generic packages. Since gnat 3.10 they are -# also compiled -GENOBJS=$(ABASE)-menus-menu_user_data.o \ - $(ABASE)-menus-item_user_data.o \ - $(ABASE)-forms-form_user_data.o \ - $(ABASE)-forms-field_user_data.o \ - $(ABASE)-forms-field_types-enumeration-ada.o \ - $(ABASE)-panels-user_data.o \ - $(ABASE)-text_io-integer_io.o \ - $(ABASE)-text_io-float_io.o \ - $(ABASE)-text_io-fixed_io.o \ - $(ABASE)-text_io-decimal_io.o \ - $(ABASE)-text_io-enumeration_io.o \ - $(ABASE)-text_io-modular_io.o \ - $(ABASE)-text_io-complex_io.o - -all :: $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) - @echo done - -$(ADA_INCLUDE) \ -$(ADA_OBJECTS) \ -$(LIBDIR) \ -$(BUILD_DIR_LIB) : - mkdir -p $@ - -sources : - @echo made $@ - -libs \ -install \ -install.libs :: \ - $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) - @echo made $(STATIC_LIBNAME) - -install \ -install.libs :: \ - $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \ - $(ADA_OBJECTS) - @$(INSTALL_LIB) \ - $(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \ - $(ADA_OBJECTS) - -uninstall \ -uninstall.libs :: - @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) - -mostlyclean :: - rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a - -clean :: mostlyclean - rm -f $(ABASE)-trace.adb - -distclean :: clean - rm -f Makefile - -realclean :: distclean - -BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb - -$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p - rm -f $@ - $(ADAPREP) -DADA_TRACE=@ADA_TRACE@ -DPRAGMA_UNREF=@PRAGMA_UNREF@ $(srcdir)/$(ABASE)-trace.adb_p $@ - -############################################################################### -C_OBJS = c_varargs_to_ada.o ncurses_compat.o - -c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c - $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c - -ncurses_compat.o : $(srcdir)/ncurses_compat.c - $(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/ncurses_compat.c - -############################################################################### - -MIXED_OBJS = $(C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@ - -@USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ -@USE_OLD_MAKERULES@ $(BUILD_DIR_LIB) \ -@USE_OLD_MAKERULES@ $(MIXED_OBJS) -@USE_OLD_MAKERULES@ $(AR) $(ARFLAGS) $@ $(MIXED_OBJS) - -$(BUILD_DIR)/static-ali : ; mkdir -p $@ -$(BUILD_DIR)/static-obj : ; mkdir -p $@ - -STATIC_DIRS = \ - $(BUILD_DIR_LIB) \ - $(BUILD_DIR)/static-ali \ - $(BUILD_DIR)/static-obj - -@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \ -@USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \ -@USE_GNAT_PROJECTS@ $(C_OBJS) \ -@USE_GNAT_PROJECTS@ $(STATIC_DIRS) -@USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static -@USE_GNAT_PROJECTS@ $(AR) $(ARFLAGS) $@ $(C_OBJS) -@USE_GNAT_PROJECTS@ -@USE_GNAT_LIBRARIES@install \ -@USE_GNAT_LIBRARIES@install.libs :: \ -@USE_GNAT_LIBRARIES@ $(ADA_OBJECTS) -@USE_GNAT_LIBRARIES@ $(INSTALL_LIB) \ -@USE_GNAT_LIBRARIES@ $(BUILD_DIR)/static-ali/*.ali \ -@USE_GNAT_LIBRARIES@ $(ADA_OBJECTS) - -uninstall \ -uninstall.libs :: - @rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME) - -@USE_GNAT_LIBRARIES@uninstall \ -@USE_GNAT_LIBRARIES@uninstall.libs :: -@USE_GNAT_LIBRARIES@ @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' - -$(BUILD_DIR)/dynamic-ali : ; mkdir -p $@ -$(BUILD_DIR)/dynamic-obj : ; mkdir -p $@ - -SHARED_DIRS = \ - $(BUILD_DIR_LIB) \ - $(BUILD_DIR)/dynamic-ali \ - $(BUILD_DIR)/dynamic-obj - -@MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) -@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: $(ABASE)-trace.adb $(SHARED_DIRS) -@MAKE_ADA_SHAREDLIB@ cp $(MIXED_OBJS) $(BUILD_DIR)/dynamic-obj/ -@MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic - -install \ -install.libs :: $(ADA_INCLUDE) - $(INSTALL_LIB) \ - $(SOURCE_DIR_SRC)/*.ad[sb] \ - $(ADA_INCLUDE) - -install \ -install.libs :: $(ADA_INCLUDE) - $(INSTALL_LIB) \ - $(GENERATED_SOURCES) \ - $(ADA_INCLUDE) - -uninstall \ -uninstall.libs :: - $(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done' - -@MAKE_ADA_SHAREDLIB@install \ -@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) $(LIBDIR) -@MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ -@MAKE_ADA_SHAREDLIB@ $(BUILD_DIR)/dynamic-ali/* \ -@MAKE_ADA_SHAREDLIB@ $(ADA_OBJECTS) -@MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \ -@MAKE_ADA_SHAREDLIB@ $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \ -@MAKE_ADA_SHAREDLIB@ $(LIBDIR) -@MAKE_ADA_SHAREDLIB@ cd $(LIBDIR) && $(LN_S) $(SHARED_LIBNAME) $(SHARED_SYMLINK) -@MAKE_ADA_SHAREDLIB@ -@MAKE_ADA_SHAREDLIB@uninstall \ -@MAKE_ADA_SHAREDLIB@uninstall.libs :: -@MAKE_ADA_SHAREDLIB@ $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done' -@MAKE_ADA_SHAREDLIB@ -@MAKE_ADA_SHAREDLIB@uninstall \ -@MAKE_ADA_SHAREDLIB@uninstall.libs :: -@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_SYMLINK) -@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_LIBNAME) - -clean :: - rm -rf $(BUILD_DIR)/*-ali - rm -rf $(BUILD_DIR)/*-obj - rm -rf $(BUILD_DIR_LIB) diff --git a/Ada95/src/c_varargs_to_ada.c b/Ada95/src/c_varargs_to_ada.c deleted file mode 100644 index ed236ddc90d..00000000000 --- a/Ada95/src/c_varargs_to_ada.c +++ /dev/null @@ -1,117 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2011 Free 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: Nicolas Boulenguez, 2011 * - ****************************************************************************/ - -/* - Version Control - $Id: c_varargs_to_ada.c,v 1.4 2011/03/19 19:07:39 tom Exp $ - --------------------------------------------------------------------------*/ -/* - */ - -#include - -int -set_field_type_alnum(FIELD *field, - int minimum_width) -{ - return set_field_type(field, TYPE_ALNUM, minimum_width); -} - -int -set_field_type_alpha(FIELD *field, - int minimum_width) -{ - return set_field_type(field, TYPE_ALPHA, minimum_width); -} - -int -set_field_type_enum(FIELD *field, - char **value_list, - int case_sensitive, - int unique_match) -{ - return set_field_type(field, TYPE_ENUM, value_list, case_sensitive, - unique_match); -} - -int -set_field_type_integer(FIELD *field, - int precision, - long minimum, - long maximum) -{ - return set_field_type(field, TYPE_INTEGER, precision, minimum, maximum); -} - -int -set_field_type_numeric(FIELD *field, - int precision, - double minimum, - double maximum) -{ - return set_field_type(field, TYPE_NUMERIC, precision, minimum, maximum); -} - -int -set_field_type_regexp(FIELD *field, - char *regular_expression) -{ - return set_field_type(field, TYPE_REGEXP, regular_expression); -} - -int -set_field_type_ipv4(FIELD *field) -{ - return set_field_type(field, TYPE_IPV4); -} - -int -set_field_type_user(FIELD *field, - FIELDTYPE *fieldtype, - void *arg) -{ - return set_field_type(field, fieldtype, arg); -} - -void * -void_star_make_arg(va_list *list) -{ - return va_arg(*list, void *); -} - -#ifdef TRACE -void -_traces(const char *fmt, char *arg) -{ - _tracef(fmt, arg); -} -#endif diff --git a/Ada95/src/c_varargs_to_ada.h b/Ada95/src/c_varargs_to_ada.h deleted file mode 100644 index ee6a7a7c1eb..00000000000 --- a/Ada95/src/c_varargs_to_ada.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2011 Free 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: c_varargs_to_ada.h,v 1.3 2011/03/19 19:07:41 tom Exp $ */ - -#ifndef __C_VARARGS_TO_ADA_H -#define __C_VARARGS_TO_ADA_H - -#include - -extern int set_field_type_alnum(FIELD * /* field */ , - int /* minimum_width */ ); - -extern int set_field_type_alpha(FIELD * /* field */ , - int /* minimum_width */ ); - -extern int set_field_type_enum(FIELD * /* field */ , - char ** /* value_list */ , - int /* case_sensitive */ , - int /* unique_match */ ); - -extern int set_field_type_integer(FIELD * /* field */ , - int /* precision */ , - long /* minimum */ , - long /* maximum */ ); - -extern int set_field_type_numeric(FIELD * /* field */ , - int /* precision */ , - double /* minimum */ , - double /* maximum */ ); - -extern int set_field_type_regexp(FIELD * /* field */ , - char * /* regular_expression */ ); - -extern int set_field_type_ipv4(FIELD * /* field */ ); - -extern int set_field_type_user(FIELD * /* field */ , - FIELDTYPE * /* fieldtype */ , - void * /* arg */ ); - -extern void *void_star_make_arg(va_list * /* list */ ); - -#ifdef TRACE -extern void _traces(const char * /* fmt */ - ,char * /* arg */ ); -#endif - -#endif /* __C_VARARGS_TO_ADA_H */ diff --git a/Ada95/src/library.gpr b/Ada95/src/library.gpr deleted file mode 100644 index 33e4a3c7d7e..00000000000 --- a/Ada95/src/library.gpr +++ /dev/null @@ -1,56 +0,0 @@ ------------------------------------------------------------------------------- --- Copyright (c) 2010,2011 Free 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: library.gpr,v 1.7 2011/03/18 23:10:28 Nicolas.Boulenguez Exp $ --- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html --- http://www.adaworld.com/debian/debian-ada-policy.html -project Library is - Build_Dir := External ("BUILD_DIR"); - Source_Dir := External ("SOURCE_DIR"); - Source_Dir2 := External ("SOURCE_DIR2"); - Kind := External ("LIB_KIND"); - for Library_Name use External ("LIB_NAME"); - for Library_Version use External ("SONAME"); - - for Library_Kind use Kind; - for Library_Dir use Build_Dir & "/lib"; - for Object_Dir use Build_Dir & "/" & Kind & "-obj"; - for Library_ALI_Dir use Build_Dir & "/" & Kind & "-ali"; - for Source_Dirs use (Source_Dir & "/src", - Source_Dir2, - Build_Dir & "/src"); - for Library_Options use ("-lncurses", "-lpanel", "-lmenu", "-lform"); - package Compiler is - for Default_Switches ("Ada") use - ("-g", - "-O2", - "-gnatafno", - "-gnatVa", -- All validity checks - "-gnatwa"); -- Activate all optional errors - end Compiler; - for Languages use ("C", "Ada"); -end Library; diff --git a/Ada95/src/modules b/Ada95/src/modules deleted file mode 100644 index 9f5e03038eb..00000000000 --- a/Ada95/src/modules +++ /dev/null @@ -1,70 +0,0 @@ -# $Id: modules,v 1.3 2010/06/26 23:33:14 tom Exp $ -############################################################################## -# Copyright (c) 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"), # -# 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 2010 -# - -# Library objects -# rootname depend-spec depend-body unit -$(ALIB) $(srcdir) none spec -$(ABASE)-aux none $(srcdir) body -$(ABASE) none . body -$(ABASE)-terminfo $(srcdir) $(srcdir) body -$(ABASE)-termcap $(srcdir) $(srcdir) body -$(ABASE)-putwin $(srcdir) $(srcdir) body -$(ABASE)-trace . . body -$(ABASE)-mouse . $(srcdir) body -$(ABASE)-panels . $(srcdir) body -$(ABASE)-menus . $(srcdir) body -$(ABASE)-forms . $(srcdir) body -$(ABASE)-forms-field_types . $(srcdir) body -$(ABASE)-forms-field_types-alpha $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-alphanumeric $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-intfield $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-numeric $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-regexp $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-enumeration $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-ipv4_address $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-user $(srcdir) $(srcdir) body -$(ABASE)-forms-field_types-user-choice $(srcdir) $(srcdir) body -$(ABASE)-text_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-aux $(srcdir) $(srcdir) body -$(ABASE)-menus-menu_user_data . $(srcdir) body -$(ABASE)-menus-item_user_data . $(srcdir) body -$(ABASE)-forms-form_user_data . $(srcdir) body -$(ABASE)-forms-field_user_data . $(srcdir) body -$(ABASE)-forms-field_types-enumeration-ada $(srcdir) $(srcdir) body -$(ABASE)-panels-user_data . $(srcdir) body -$(ABASE)-text_io-integer_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-float_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-fixed_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-decimal_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-enumeration_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-modular_io $(srcdir) $(srcdir) body -$(ABASE)-text_io-complex_io $(srcdir) $(srcdir) body diff --git a/Ada95/src/ncurses_compat.c b/Ada95/src/ncurses_compat.c deleted file mode 100644 index b3d0607a5ff..00000000000 --- a/Ada95/src/ncurses_compat.c +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2011 Free 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, 2011 * - ****************************************************************************/ - -/* - Version Control - $Id: ncurses_compat.c,v 1.2 2011/03/28 00:29:04 tom Exp $ - --------------------------------------------------------------------------*/ - -/* - * Provide compatibility with older versions of ncurses. - */ -#include - -#if defined(NCURSES_VERSION_PATCH) - -#if NCURSES_VERSION_PATCH < 20081122 -extern bool has_mouse(void); -extern int _nc_has_mouse(void); - -bool -has_mouse(void) -{ - return (bool) _nc_has_mouse(); -} -#endif - -/* - * These are provided by lib_gen.c: - */ -#if NCURSES_VERSION_PATCH < 20070331 -extern bool (is_keypad) (const WINDOW *); -extern bool (is_scrollok) (const WINDOW *); - -bool -is_keypad(const WINDOW *win) -{ - return ((win)->_use_keypad); -} - -bool - (is_scrollok) (const WINDOW *win) -{ - return ((win)->_scroll); -} -#endif - -#if NCURSES_VERSION_PATCH < 20060107 -extern int (getbegx) (WINDOW *); -extern int (getbegy) (WINDOW *); -extern int (getcurx) (WINDOW *); -extern int (getcury) (WINDOW *); -extern int (getmaxx) (WINDOW *); -extern int (getmaxy) (WINDOW *); -extern int (getparx) (WINDOW *); -extern int (getpary) (WINDOW *); - -int - (getbegy) (WINDOW *win) -{ - return ((win) ? (win)->_begy : ERR); -} - -int - (getbegx) (WINDOW *win) -{ - return ((win) ? (win)->_begx : ERR); -} - -int - (getcury) (WINDOW *win) -{ - return ((win) ? (win)->_cury : ERR); -} - -int - (getcurx) (WINDOW *win) -{ - return ((win) ? (win)->_curx : ERR); -} - -int - (getmaxy) (WINDOW *win) -{ - return ((win) ? ((win)->_maxy + 1) : ERR); -} - -int - (getmaxx) (WINDOW *win) -{ - return ((win) ? ((win)->_maxx + 1) : ERR); -} - -int - (getpary) (WINDOW *win) -{ - return ((win) ? (win)->_pary : ERR); -} - -int - (getparx) (WINDOW *win) -{ - return ((win) ? (win)->_parx : ERR); -} -#endif - -#endif diff --git a/Ada95/src/terminal_interface-curses-aux.adb b/Ada95/src/terminal_interface-curses-aux.adb deleted file mode 100644 index 9c2f8cd3867..00000000000 --- a/Ada95/src/terminal_interface-curses-aux.adb +++ /dev/null @@ -1,116 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Aux -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package body Terminal_Interface.Curses.Aux is - -- - -- Some helpers - procedure Fill_String (Cp : chars_ptr; - Str : out String) - is - -- Fill the string with the characters referenced by the - -- chars_ptr. - -- - Len : Natural; - begin - if Cp /= Null_Ptr then - Len := Natural (Strlen (Cp)); - if Str'Length < Len then - raise Constraint_Error; - end if; - declare - S : String (1 .. Len); - begin - S := Value (Cp); - Str (Str'First .. (Str'First + Len - 1)) := S (S'Range); - end; - else - Len := 0; - end if; - - if Len < Str'Length then - Str ((Str'First + Len) .. Str'Last) := (others => ' '); - end if; - - end Fill_String; - - function Fill_String (Cp : chars_ptr) return String - is - Len : Natural; - begin - if Cp /= Null_Ptr then - Len := Natural (Strlen (Cp)); - if Len = 0 then - return ""; - else - declare - S : String (1 .. Len); - begin - Fill_String (Cp, S); - return S; - end; - end if; - else - return ""; - end if; - end Fill_String; - - procedure Eti_Exception (Code : Eti_Error) - is - begin - case Code is - when E_Ok => null; - when E_System_Error => raise Eti_System_Error; - when E_Bad_Argument => raise Eti_Bad_Argument; - when E_Posted => raise Eti_Posted; - when E_Connected => raise Eti_Connected; - when E_Bad_State => raise Eti_Bad_State; - when E_No_Room => raise Eti_No_Room; - when E_Not_Posted => raise Eti_Not_Posted; - when E_Unknown_Command => raise Eti_Unknown_Command; - when E_No_Match => raise Eti_No_Match; - when E_Not_Selectable => raise Eti_Not_Selectable; - when E_Not_Connected => raise Eti_Not_Connected; - when E_Request_Denied => raise Eti_Request_Denied; - when E_Invalid_Field => raise Eti_Invalid_Field; - when E_Current => raise Eti_Current; - end case; - end Eti_Exception; - -end Terminal_Interface.Curses.Aux; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb deleted file mode 100644 index 94336201239..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb +++ /dev/null @@ -1,62 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- $Date: 2011/03/19 00:45:37 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is - - procedure Set_Field_Type (Fld : Field; - Typ : Alpha_Field) - is - function Set_Fld_Type (F : Field := Fld; - Arg1 : C_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_alpha"); - - Res : Eti_Error; - begin - Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.Alpha; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads deleted file mode 100644 index 7878f73b2b5..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads +++ /dev/null @@ -1,53 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Alpha -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface.Curses.Forms.Field_Types.Alpha is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha); - - type Alpha_Field is new Field_Type - with record - Minimum_Field_Width : Natural := 0; - end record; - - procedure Set_Field_Type (Fld : Field; - Typ : Alpha_Field); - pragma Inline (Set_Field_Type); - -end Terminal_Interface.Curses.Forms.Field_Types.Alpha; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb deleted file mode 100644 index 53f66801e91..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.adb +++ /dev/null @@ -1,62 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- $Date: 2011/03/19 00:45:37 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is - - procedure Set_Field_Type (Fld : Field; - Typ : AlphaNumeric_Field) - is - function Set_Fld_Type (F : Field := Fld; - Arg1 : C_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_alnum"); - - Res : Eti_Error; - begin - Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads deleted file mode 100644 index c1009ac77ad..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-alphanumeric.ads +++ /dev/null @@ -1,54 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is - pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric); - - type AlphaNumeric_Field is new Field_Type - with record - Minimum_Field_Width : Natural := 0; - end record; - - procedure Set_Field_Type (Fld : Field; - Typ : AlphaNumeric_Field); - pragma Inline (Set_Field_Type); - -end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb deleted file mode 100644 index d38e062aa5e..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb +++ /dev/null @@ -1,81 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2004,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- $Date: 2011/03/22 23:36:20 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Characters.Handling; use Ada.Characters.Handling; - -package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is - - function Create (Set : Type_Set := Mixed_Case; - Case_Sensitive : Boolean := False; - Must_Be_Unique : Boolean := False) - return Enumeration_Field - is - I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1); - J : Positive := 1; - begin - I.Case_Sensitive := Case_Sensitive; - I.Match_Must_Be_Unique := Must_Be_Unique; - - for E in T'Range loop - I.Names (J) := new String'(T'Image (E)); - -- The Image attribute defaults to upper case, so we have to handle - -- only the other ones... - if Set /= Upper_Case then - I.Names (J).all := To_Lower (I.Names (J).all); - if Set = Mixed_Case then - I.Names (J).all (I.Names (J).all'First) := - To_Upper (I.Names (J).all (I.Names (J).all'First)); - end if; - end if; - J := J + 1; - end loop; - - return Create (I, True); - end Create; - - function Value (Fld : Field; - Buf : Buffer_Number := Buffer_Number'First) return T - is - begin - return T'Value (Get_Buffer (Fld, Buf)); - end Value; - -end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads deleted file mode 100644 index 48fad09c2f2..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads +++ /dev/null @@ -1,59 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.10 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type T is (<>); - -package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is - pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); - - function Create (Set : Type_Set := Mixed_Case; - Case_Sensitive : Boolean := False; - Must_Be_Unique : Boolean := False) - return Enumeration_Field; - - function Value (Fld : Field; - Buf : Buffer_Number := Buffer_Number'First) return T; - -- Translate the content of the fields buffer - indicated by the - -- buffer number - into an enumeration value. If the buffer is empty - -- or the content is invalid, a Constraint_Error is raises. - -end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb deleted file mode 100644 index 12648e5a1dc..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.adb +++ /dev/null @@ -1,115 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.10 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Unchecked_Deallocation; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is - - function Create (Info : Enumeration_Info; - Auto_Release_Names : Boolean := False) - return Enumeration_Field - is - procedure Release_String is - new Ada.Unchecked_Deallocation (String, - String_Access); - E : Enumeration_Field; - L : constant size_t := 1 + size_t (Info.C); - S : String_Access; - begin - E.Case_Sensitive := Info.Case_Sensitive; - E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique; - E.Arr := new chars_ptr_array (size_t (1) .. L); - for I in 1 .. Positive (L - 1) loop - if Info.Names (I) = null then - raise Form_Exception; - end if; - E.Arr.all (size_t (I)) := New_String (Info.Names (I).all); - if Auto_Release_Names then - S := Info.Names (I); - Release_String (S); - end if; - end loop; - E.Arr.all (L) := Null_Ptr; - return E; - end Create; - - procedure Release (Enum : in out Enumeration_Field) - is - I : size_t := 0; - P : chars_ptr; - begin - loop - P := Enum.Arr.all (I); - exit when P = Null_Ptr; - Free (P); - Enum.Arr.all (I) := Null_Ptr; - I := I + 1; - end loop; - Enum.Arr := null; - end Release; - - procedure Set_Field_Type (Fld : Field; - Typ : Enumeration_Field) - is - function Set_Fld_Type (F : Field := Fld; - Arg1 : chars_ptr_array; - Arg2 : C_Int; - Arg3 : C_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_enum"); - - Res : Eti_Error; - begin - if Typ.Arr = null then - raise Form_Exception; - end if; - Res := Set_Fld_Type (Arg1 => Typ.Arr.all, - Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)), - Arg3 => C_Int (Boolean'Pos - (Typ.Match_Must_Be_Unique))); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ, C_Choice_Router); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.Enumeration; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads b/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads deleted file mode 100644 index e6924f6b19f..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads +++ /dev/null @@ -1,98 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Enumeration -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C.Strings; - -package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is - pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.Enumeration); - - type String_Access is access String; - - -- Type_Set is used by the child package Ada - type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); - - type Enum_Array is array (Positive range <>) - of String_Access; - - type Enumeration_Info (C : Positive) is - record - Names : Enum_Array (1 .. C); - Case_Sensitive : Boolean := False; - Match_Must_Be_Unique : Boolean := False; - end record; - - type Enumeration_Field is new Field_Type with private; - - function Create (Info : Enumeration_Info; - Auto_Release_Names : Boolean := False) - return Enumeration_Field; - -- Make an fieldtype from the info. Enumerations are special, because - -- they normally don't copy the enum values into a private store, so - -- we have to care for the lifetime of the info we provide. - -- The Auto_Release_Names flag may be used to automatically releases - -- the strings in the Names array of the Enumeration_Info. - - function Make_Enumeration_Type (Info : Enumeration_Info; - Auto_Release_Names : Boolean := False) - return Enumeration_Field renames Create; - - procedure Release (Enum : in out Enumeration_Field); - -- But we may want to release the field to release the memory allocated - -- by it internally. After that the Enumeration field is no longer usable. - - -- The next type defintions are all ncurses extensions. They are typically - -- not available in other curses implementations. - - procedure Set_Field_Type (Fld : Field; - Typ : Enumeration_Field); - pragma Inline (Set_Field_Type); - -private - type CPA_Access is access Interfaces.C.Strings.chars_ptr_array; - - type Enumeration_Field is new Field_Type with - record - Case_Sensitive : Boolean := False; - Match_Must_Be_Unique : Boolean := False; - Arr : CPA_Access := null; - end record; - -end Terminal_Interface.Curses.Forms.Field_Types.Enumeration; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb deleted file mode 100644 index b6229becefb..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb +++ /dev/null @@ -1,66 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.IntField -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- $Date: 2011/03/19 00:45:37 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.IntField is - - procedure Set_Field_Type (Fld : Field; - Typ : Integer_Field) - is - function Set_Fld_Type (F : Field := Fld; - Arg1 : C_Int; - Arg2 : C_Long_Int; - Arg3 : C_Long_Int) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_integer"); - - Res : Eti_Error; - begin - Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision), - Arg2 => C_Long_Int (Typ.Lower_Limit), - Arg3 => C_Long_Int (Typ.Upper_Limit)); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.IntField; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads b/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads deleted file mode 100644 index e90f0d06f17..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-intfield.ads +++ /dev/null @@ -1,55 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.IntField -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface.Curses.Forms.Field_Types.IntField is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField); - - type Integer_Field is new Field_Type with - record - Precision : Natural; - Lower_Limit : Integer; - Upper_Limit : Integer; - end record; - - procedure Set_Field_Type (Fld : Field; - Typ : Integer_Field); - pragma Inline (Set_Field_Type); - -end Terminal_Interface.Curses.Forms.Field_Types.IntField; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb deleted file mode 100644 index 66e052942d3..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.adb +++ /dev/null @@ -1,62 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- $Date: 2011/03/19 00:45:37 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is - - procedure Set_Field_Type (Fld : Field; - Typ : Internet_V4_Address_Field) - is - function Set_Fld_Type (F : Field := Fld) - return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_ipv4"); - - Res : Eti_Error; - begin - Res := Set_Fld_Type; - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads b/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads deleted file mode 100644 index af367e7e5ab..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-ipv4_address.ads +++ /dev/null @@ -1,51 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is - pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address); - - type Internet_V4_Address_Field is new Field_Type with null record; - - procedure Set_Field_Type (Fld : Field; - Typ : Internet_V4_Address_Field); - pragma Inline (Set_Field_Type); - -end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb deleted file mode 100644 index b31dfa657a5..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.adb +++ /dev/null @@ -1,69 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- $Date: 2011/03/19 00:45:37 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is - - procedure Set_Field_Type (Fld : Field; - Typ : Numeric_Field) - is - type Double is new Interfaces.C.double; - - function Set_Fld_Type (F : Field := Fld; - Arg1 : C_Int; - Arg2 : Double; - Arg3 : Double) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_numeric"); - - Res : Eti_Error; - begin - Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision), - Arg2 => Double (Typ.Lower_Limit), - Arg3 => Double (Typ.Upper_Limit)); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.Numeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads b/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads deleted file mode 100644 index 7c6f9fa15ce..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-numeric.ads +++ /dev/null @@ -1,55 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.Numeric -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface.Curses.Forms.Field_Types.Numeric is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric); - - type Numeric_Field is new Field_Type with - record - Precision : Natural; - Lower_Limit : Float; - Upper_Limit : Float; - end record; - - procedure Set_Field_Type (Fld : Field; - Typ : Numeric_Field); - pragma Inline (Set_Field_Type); - -end Terminal_Interface.Curses.Forms.Field_Types.Numeric; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb deleted file mode 100644 index 55f0255071a..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.adb +++ /dev/null @@ -1,67 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.10 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; use Interfaces.C; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is - - procedure Set_Field_Type (Fld : Field; - Typ : Regular_Expression_Field) - is - type Char_Ptr is access all Interfaces.C.char; - - function Set_Ftyp (F : Field := Fld; - Arg1 : Char_Ptr) return C_Int; - pragma Import (C, Set_Ftyp, "set_field_type_regexp"); - - Txt : char_array (0 .. Typ.Regular_Expression.all'Length); - Len : size_t; - Res : Eti_Error; - begin - To_C (Typ.Regular_Expression.all, Txt, Len); - Res := Set_Ftyp (Arg1 => Txt (Txt'First)'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Wrap_Builtin (Fld, Typ); - end Set_Field_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.RegExp; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads b/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads deleted file mode 100644 index 26841382dcb..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-regexp.ads +++ /dev/null @@ -1,55 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.RegExp -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface.Curses.Forms.Field_Types.RegExp is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp); - - type String_Access is access String; - - type Regular_Expression_Field is new Field_Type with - record - Regular_Expression : String_Access; - end record; - - procedure Set_Field_Type (Fld : Field; - Typ : Regular_Expression_Field); - pragma Inline (Set_Field_Type); - -end Terminal_Interface.Curses.Forms.Field_Types.RegExp; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb deleted file mode 100644 index 3a7e6b5aeb2..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.adb +++ /dev/null @@ -1,108 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2008,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.17 $ --- $Date: 2011/03/22 10:53:37 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with System.Address_To_Access_Conversions; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is - - package Argument_Conversions is - new System.Address_To_Access_Conversions (Argument); - - function Generic_Next (Fld : Field; - Usr : System.Address) return Curses_Bool - is - Result : Boolean; - Udf : constant User_Defined_Field_Type_With_Choice_Access := - User_Defined_Field_Type_With_Choice_Access - (Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ); - begin - Result := Next (Fld, Udf.all); - return Curses_Bool (Boolean'Pos (Result)); - end Generic_Next; - - function Generic_Prev (Fld : Field; - Usr : System.Address) return Curses_Bool - is - Result : Boolean; - Udf : constant User_Defined_Field_Type_With_Choice_Access := - User_Defined_Field_Type_With_Choice_Access - (Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ); - begin - Result := Previous (Fld, Udf.all); - return Curses_Bool (Boolean'Pos (Result)); - end Generic_Prev; - - -- ----------------------------------------------------------------------- - -- - function C_Generic_Choice return C_Field_Type - is - Res : Eti_Error; - T : C_Field_Type; - begin - if M_Generic_Choice = Null_Field_Type then - T := New_Fieldtype (Generic_Field_Check'Access, - Generic_Char_Check'Access); - if T = Null_Field_Type then - raise Form_Exception; - else - Res := Set_Fieldtype_Arg (T, - Make_Arg'Access, - Copy_Arg'Access, - Free_Arg'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - - Res := Set_Fieldtype_Choice (T, - Generic_Next'Access, - Generic_Prev'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - M_Generic_Choice := T; - end if; - pragma Assert (M_Generic_Choice /= Null_Field_Type); - return M_Generic_Choice; - end C_Generic_Choice; - -end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads deleted file mode 100644 index 5b132c9192b..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user-choice.ads +++ /dev/null @@ -1,94 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.User.Choice -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2008,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.14 $ --- $Date: 2011/03/19 12:27:47 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; - -package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is - pragma Preelaborate - (Terminal_Interface.Curses.Forms.Field_Types.User.Choice); - - subtype C_Int is Interfaces.C.int; - - type User_Defined_Field_Type_With_Choice is abstract new - User_Defined_Field_Type with null record; - -- This is the root of the mechanism we use to create field types in - -- Ada95 that allow the prev/next mechanism. You should your own type - -- derive from this one and implement the Field_Check, Character_Check - -- Next and Previous functions for your own type. - - type User_Defined_Field_Type_With_Choice_Access is access all - User_Defined_Field_Type_With_Choice'Class; - - function Next - (Fld : Field; - Typ : User_Defined_Field_Type_With_Choice) return Boolean - is abstract; - -- If True is returned, the function successfully generated a next - -- value into the fields buffer. - - function Previous - (Fld : Field; - Typ : User_Defined_Field_Type_With_Choice) return Boolean - is abstract; - -- If True is returned, the function successfully generated a previous - -- value into the fields buffer. - - -- +---------------------------------------------------------------------- - -- | Private Part. - -- | -private - function C_Generic_Choice return C_Field_Type; - - function Generic_Next (Fld : Field; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Generic_Next); - -- This is the generic next Choice_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivatives. It routes - -- the call to the Next implementation for the type. - - function Generic_Prev (Fld : Field; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Generic_Prev); - -- This is the generic prev Choice_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivatives. It routes - -- the call to the Previous implementation for the type. - -end Terminal_Interface.Curses.Forms.Field_Types.User.Choice; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb b/Ada95/src/terminal_interface-curses-forms-field_types-user.adb deleted file mode 100644 index 2dd295db7e7..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.adb +++ /dev/null @@ -1,133 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.User -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.21 $ --- $Date: 2011/03/23 00:44:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with System.Address_To_Access_Conversions; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Field_Types.User is - - procedure Set_Field_Type (Fld : Field; - Typ : User_Defined_Field_Type) - is - function Allocate_Arg (T : User_Defined_Field_Type'Class) - return Argument_Access; - - function Set_Fld_Type (F : Field := Fld; - Cft : C_Field_Type := C_Generic_Type; - Arg1 : Argument_Access) - return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_user"); - - Res : Eti_Error; - - function Allocate_Arg (T : User_Defined_Field_Type'Class) - return Argument_Access - is - Ptr : constant Field_Type_Access - := new User_Defined_Field_Type'Class'(T); - begin - return new Argument'(Usr => System.Null_Address, - Typ => Ptr, - Cft => Null_Field_Type); - end Allocate_Arg; - - begin - Res := Set_Fld_Type (Arg1 => Allocate_Arg (Typ)); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Field_Type; - - package Argument_Conversions is - new System.Address_To_Access_Conversions (Argument); - - function Generic_Field_Check (Fld : Field; - Usr : System.Address) return Curses_Bool - is - Result : Boolean; - Udf : constant User_Defined_Field_Type_Access := - User_Defined_Field_Type_Access - (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); - begin - Result := Field_Check (Fld, Udf.all); - return Curses_Bool (Boolean'Pos (Result)); - end Generic_Field_Check; - - function Generic_Char_Check (Ch : C_Int; - Usr : System.Address) return Curses_Bool - is - Result : Boolean; - Udf : constant User_Defined_Field_Type_Access := - User_Defined_Field_Type_Access - (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ); - begin - Result := Character_Check (Character'Val (Ch), Udf.all); - return Curses_Bool (Boolean'Pos (Result)); - end Generic_Char_Check; - - -- ----------------------------------------------------------------------- - -- - function C_Generic_Type return C_Field_Type - is - Res : Eti_Error; - T : C_Field_Type; - begin - if M_Generic_Type = Null_Field_Type then - T := New_Fieldtype (Generic_Field_Check'Access, - Generic_Char_Check'Access); - if T = Null_Field_Type then - raise Form_Exception; - else - Res := Set_Fieldtype_Arg (T, - Make_Arg'Access, - Copy_Arg'Access, - Free_Arg'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - M_Generic_Type := T; - end if; - pragma Assert (M_Generic_Type /= Null_Field_Type); - return M_Generic_Type; - end C_Generic_Type; - -end Terminal_Interface.Curses.Forms.Field_Types.User; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads b/Ada95/src/terminal_interface-curses-forms-field_types-user.ads deleted file mode 100644 index 7000fce23de..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types-user.ads +++ /dev/null @@ -1,95 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types.User -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.15 $ --- $Date: 2011/03/19 12:27:21 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; - -package Terminal_Interface.Curses.Forms.Field_Types.User is - pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User); - subtype C_Int is Interfaces.C.int; - - type User_Defined_Field_Type is abstract new Field_Type with null record; - -- This is the root of the mechanism we use to create field types in - -- Ada95. You should your own type derive from this one and implement - -- the Field_Check and Character_Check functions for your own type. - - type User_Defined_Field_Type_Access is access all - User_Defined_Field_Type'Class; - - function Field_Check - (Fld : Field; - Typ : User_Defined_Field_Type) return Boolean - is abstract; - -- If True is returned, the field is considered valid, otherwise it is - -- invalid. - - function Character_Check - (Ch : Character; - Typ : User_Defined_Field_Type) return Boolean - is abstract; - -- If True is returned, the character is considered as valid for the - -- field, otherwise as invalid. - - procedure Set_Field_Type (Fld : Field; - Typ : User_Defined_Field_Type); - -- This should work for all types derived from User_Defined_Field_Type. - -- No need to reimplement it for your derived type. - - -- +---------------------------------------------------------------------- - -- | Private Part. - -- | Used by the Choice child package. -private - function C_Generic_Type return C_Field_Type; - - function Generic_Field_Check (Fld : Field; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Generic_Field_Check); - -- This is the generic Field_Check_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivatives. It routes - -- the call to the Field_Check implementation for the type. - - function Generic_Char_Check (Ch : C_Int; - Usr : System.Address) return Curses_Bool; - pragma Convention (C, Generic_Char_Check); - -- This is the generic Char_Check_Function for the low-level fieldtype - -- representing all the User_Defined_Field_Type derivatives. It routes - -- the call to the Character_Check implementation for the type. - -end Terminal_Interface.Curses.Forms.Field_Types.User; diff --git a/Ada95/src/terminal_interface-curses-forms-field_types.adb b/Ada95/src/terminal_interface-curses-forms-field_types.adb deleted file mode 100644 index 5195a20a499..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_types.adb +++ /dev/null @@ -1,283 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.25 $ --- $Date: 2011/03/22 23:22:27 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Ada.Unchecked_Deallocation; -with System.Address_To_Access_Conversions; - --- | --- |===================================================================== --- | man page form_fieldtype.3x --- |===================================================================== --- | -package body Terminal_Interface.Curses.Forms.Field_Types is - - use type System.Address; - - package Argument_Conversions is - new System.Address_To_Access_Conversions (Argument); - - function Get_Fieldtype (F : Field) return C_Field_Type; - pragma Import (C, Get_Fieldtype, "field_type"); - - function Get_Arg (F : Field) return System.Address; - pragma Import (C, Get_Arg, "field_arg"); - -- | - -- |===================================================================== - -- | man page form_field_validation.3x - -- |===================================================================== - -- | - -- | - -- | - function Get_Type (Fld : Field) return Field_Type_Access - is - Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); - Arg : Argument_Access; - begin - if Low_Level = Null_Field_Type then - return null; - else - if Low_Level = M_Builtin_Router or else - Low_Level = M_Generic_Type or else - Low_Level = M_Choice_Router or else - Low_Level = M_Generic_Choice then - Arg := Argument_Access - (Argument_Conversions.To_Pointer (Get_Arg (Fld))); - if Arg = null then - raise Form_Exception; - else - return Arg.all.Typ; - end if; - else - raise Form_Exception; - end if; - end if; - end Get_Type; - - function Copy_Arg (Usr : System.Address) return System.Address - is - begin - return Usr; - end Copy_Arg; - - procedure Free_Arg (Usr : System.Address) - is - procedure Free_Type is new Ada.Unchecked_Deallocation - (Field_Type'Class, Field_Type_Access); - procedure Freeargs is new Ada.Unchecked_Deallocation - (Argument, Argument_Access); - - To_Be_Free : Argument_Access - := Argument_Access (Argument_Conversions.To_Pointer (Usr)); - Low_Level : C_Field_Type; - begin - if To_Be_Free /= null then - if To_Be_Free.all.Usr /= System.Null_Address then - Low_Level := To_Be_Free.all.Cft; - if Low_Level.all.Freearg /= null then - Low_Level.all.Freearg (To_Be_Free.all.Usr); - end if; - end if; - if To_Be_Free.all.Typ /= null then - Free_Type (To_Be_Free.all.Typ); - end if; - Freeargs (To_Be_Free); - end if; - end Free_Arg; - - procedure Wrap_Builtin (Fld : Field; - Typ : Field_Type'Class; - Cft : C_Field_Type := C_Builtin_Router) - is - Usr_Arg : constant System.Address := Get_Arg (Fld); - Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); - Arg : Argument_Access; - Res : Eti_Error; - function Set_Fld_Type (F : Field := Fld; - Cf : C_Field_Type := Cft; - Arg1 : Argument_Access) return C_Int; - pragma Import (C, Set_Fld_Type, "set_field_type_user"); - - begin - pragma Assert (Low_Level /= Null_Field_Type); - if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then - raise Form_Exception; - else - Arg := new Argument'(Usr => System.Null_Address, - Typ => new Field_Type'Class'(Typ), - Cft => Get_Fieldtype (Fld)); - if Usr_Arg /= System.Null_Address then - if Low_Level.all.Copyarg /= null then - Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg); - else - Arg.all.Usr := Usr_Arg; - end if; - end if; - - Res := Set_Fld_Type (Arg1 => Arg); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - end Wrap_Builtin; - - function Field_Check_Router (Fld : Field; - Usr : System.Address) return Curses_Bool - is - Arg : constant Argument_Access - := Argument_Access (Argument_Conversions.To_Pointer (Usr)); - begin - pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type - and then Arg.all.Typ /= null); - if Arg.all.Cft.all.Fcheck /= null then - return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr); - else - return 1; - end if; - end Field_Check_Router; - - function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return Curses_Bool - is - Arg : constant Argument_Access - := Argument_Access (Argument_Conversions.To_Pointer (Usr)); - begin - pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type - and then Arg.all.Typ /= null); - if Arg.all.Cft.all.Ccheck /= null then - return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr); - else - return 1; - end if; - end Char_Check_Router; - - function Next_Router (Fld : Field; - Usr : System.Address) return Curses_Bool - is - Arg : constant Argument_Access - := Argument_Access (Argument_Conversions.To_Pointer (Usr)); - begin - pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type - and then Arg.all.Typ /= null); - if Arg.all.Cft.all.Next /= null then - return Arg.all.Cft.all.Next (Fld, Arg.all.Usr); - else - return 1; - end if; - end Next_Router; - - function Prev_Router (Fld : Field; - Usr : System.Address) return Curses_Bool - is - Arg : constant Argument_Access := - Argument_Access (Argument_Conversions.To_Pointer (Usr)); - begin - pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type - and then Arg.all.Typ /= null); - if Arg.all.Cft.all.Prev /= null then - return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr); - else - return 1; - end if; - end Prev_Router; - - -- ----------------------------------------------------------------------- - -- - function C_Builtin_Router return C_Field_Type - is - Res : Eti_Error; - T : C_Field_Type; - begin - if M_Builtin_Router = Null_Field_Type then - T := New_Fieldtype (Field_Check_Router'Access, - Char_Check_Router'Access); - if T = Null_Field_Type then - raise Form_Exception; - else - Res := Set_Fieldtype_Arg (T, - Make_Arg'Access, - Copy_Arg'Access, - Free_Arg'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - M_Builtin_Router := T; - end if; - pragma Assert (M_Builtin_Router /= Null_Field_Type); - return M_Builtin_Router; - end C_Builtin_Router; - - -- ----------------------------------------------------------------------- - -- - function C_Choice_Router return C_Field_Type - is - Res : Eti_Error; - T : C_Field_Type; - begin - if M_Choice_Router = Null_Field_Type then - T := New_Fieldtype (Field_Check_Router'Access, - Char_Check_Router'Access); - if T = Null_Field_Type then - raise Form_Exception; - else - Res := Set_Fieldtype_Arg (T, - Make_Arg'Access, - Copy_Arg'Access, - Free_Arg'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - - Res := Set_Fieldtype_Choice (T, - Next_Router'Access, - Prev_Router'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - M_Choice_Router := T; - end if; - pragma Assert (M_Choice_Router /= Null_Field_Type); - return M_Choice_Router; - end C_Choice_Router; - -end Terminal_Interface.Curses.Forms.Field_Types; diff --git a/Ada95/src/terminal_interface-curses-forms-field_user_data.adb b/Ada95/src/terminal_interface-curses-forms-field_user_data.adb deleted file mode 100644 index 96178d8a934..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-field_user_data.adb +++ /dev/null @@ -1,85 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_User_Data -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.13 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - --- | --- |===================================================================== --- | man page form_field_userptr.3x --- |===================================================================== --- | -package body Terminal_Interface.Curses.Forms.Field_User_Data is - -- | - -- | - -- | - use type Interfaces.C.int; - - procedure Set_User_Data (Fld : Field; - Data : User_Access) - is - function Set_Field_Userptr (Fld : Field; - Usr : User_Access) return C_Int; - pragma Import (C, Set_Field_Userptr, "set_field_userptr"); - - Res : constant Eti_Error := Set_Field_Userptr (Fld, Data); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_User_Data; - -- | - -- | - -- | - function Get_User_Data (Fld : Field) return User_Access - is - function Field_Userptr (Fld : Field) return User_Access; - pragma Import (C, Field_Userptr, "field_userptr"); - begin - return Field_Userptr (Fld); - end Get_User_Data; - - procedure Get_User_Data (Fld : Field; - Data : out User_Access) - is - begin - Data := Get_User_Data (Fld); - end Get_User_Data; - -end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/Ada95/src/terminal_interface-curses-forms-form_user_data.adb b/Ada95/src/terminal_interface-curses-forms-form_user_data.adb deleted file mode 100644 index 84353eb5570..00000000000 --- a/Ada95/src/terminal_interface-curses-forms-form_user_data.adb +++ /dev/null @@ -1,86 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Form_User_Data -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.13 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- --- | --- |===================================================================== --- | man page form__userptr.3x --- |===================================================================== --- | -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms.Form_User_Data is - - use type Interfaces.C.int; - - -- | - -- | - -- | - procedure Set_User_Data (Frm : Form; - Data : User_Access) - is - function Set_Form_Userptr (Frm : Form; - Data : User_Access) return C_Int; - pragma Import (C, Set_Form_Userptr, "set_form_userptr"); - - Res : constant Eti_Error := Set_Form_Userptr (Frm, Data); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_User_Data; - -- | - -- | - -- | - function Get_User_Data (Frm : Form) return User_Access - is - function Form_Userptr (Frm : Form) return User_Access; - pragma Import (C, Form_Userptr, "form_userptr"); - begin - return Form_Userptr (Frm); - end Get_User_Data; - - procedure Get_User_Data (Frm : Form; - Data : out User_Access) - is - begin - Data := Get_User_Data (Frm); - end Get_User_Data; - -end Terminal_Interface.Curses.Forms.Form_User_Data; diff --git a/Ada95/src/terminal_interface-curses-forms.adb b/Ada95/src/terminal_interface-curses-forms.adb deleted file mode 100644 index 915ed58418e..00000000000 --- a/Ada95/src/terminal_interface-curses-forms.adb +++ /dev/null @@ -1,1161 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.28 $ --- $Date: 2011/03/22 23:37:32 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Unchecked_Deallocation; -with Ada.Unchecked_Conversion; - -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Interfaces.C.Pointers; - -with Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Forms is - - use Terminal_Interface.Curses.Aux; - - type C_Field_Array is array (Natural range <>) of aliased Field; - package F_Array is new - Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field); - ------------------------------------------------------------------------------- - -- | - -- | - -- | - -- subtype chars_ptr is Interfaces.C.Strings.chars_ptr; - - function FOS_2_CInt is new - Ada.Unchecked_Conversion (Field_Option_Set, - C_Int); - - function CInt_2_FOS is new - Ada.Unchecked_Conversion (C_Int, - Field_Option_Set); - - function FrmOS_2_CInt is new - Ada.Unchecked_Conversion (Form_Option_Set, - C_Int); - - function CInt_2_FrmOS is new - Ada.Unchecked_Conversion (C_Int, - Form_Option_Set); - - procedure Request_Name (Key : Form_Request_Code; - Name : out String) - is - function Form_Request_Name (Key : C_Int) return chars_ptr; - pragma Import (C, Form_Request_Name, "form_request_name"); - begin - Fill_String (Form_Request_Name (C_Int (Key)), Name); - end Request_Name; - - function Request_Name (Key : Form_Request_Code) return String - is - function Form_Request_Name (Key : C_Int) return chars_ptr; - pragma Import (C, Form_Request_Name, "form_request_name"); - begin - return Fill_String (Form_Request_Name (C_Int (Key))); - end Request_Name; ------------------------------------------------------------------------------- - -- | - -- | - -- | - -- | - -- |===================================================================== - -- | man page form_field_new.3x - -- |===================================================================== - -- | - -- | - -- | - function Create (Height : Line_Count; - Width : Column_Count; - Top : Line_Position; - Left : Column_Position; - Off_Screen : Natural := 0; - More_Buffers : Buffer_Number := Buffer_Number'First) - return Field - is - function Newfield (H, W, T, L, O, M : C_Int) return Field; - pragma Import (C, Newfield, "new_field"); - Fld : constant Field := Newfield (C_Int (Height), C_Int (Width), - C_Int (Top), C_Int (Left), - C_Int (Off_Screen), - C_Int (More_Buffers)); - begin - if Fld = Null_Field then - raise Form_Exception; - end if; - return Fld; - end Create; --- | --- | --- | - procedure Delete (Fld : in out Field) - is - function Free_Field (Fld : Field) return C_Int; - pragma Import (C, Free_Field, "free_field"); - - Res : Eti_Error; - begin - Res := Free_Field (Fld); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Fld := Null_Field; - end Delete; - -- | - -- | - -- | - function Duplicate (Fld : Field; - Top : Line_Position; - Left : Column_Position) return Field - is - function Dup_Field (Fld : Field; - Top : C_Int; - Left : C_Int) return Field; - pragma Import (C, Dup_Field, "dup_field"); - - F : constant Field := Dup_Field (Fld, - C_Int (Top), - C_Int (Left)); - begin - if F = Null_Field then - raise Form_Exception; - end if; - return F; - end Duplicate; - -- | - -- | - -- | - function Link (Fld : Field; - Top : Line_Position; - Left : Column_Position) return Field - is - function Lnk_Field (Fld : Field; - Top : C_Int; - Left : C_Int) return Field; - pragma Import (C, Lnk_Field, "link_field"); - - F : constant Field := Lnk_Field (Fld, - C_Int (Top), - C_Int (Left)); - begin - if F = Null_Field then - raise Form_Exception; - end if; - return F; - end Link; - -- | - -- |===================================================================== - -- | man page form_field_just.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Justification (Fld : Field; - Just : Field_Justification := None) - is - function Set_Field_Just (Fld : Field; - Just : C_Int) return C_Int; - pragma Import (C, Set_Field_Just, "set_field_just"); - - Res : constant Eti_Error := - Set_Field_Just (Fld, - C_Int (Field_Justification'Pos (Just))); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Justification; - -- | - -- | - -- | - function Get_Justification (Fld : Field) return Field_Justification - is - function Field_Just (Fld : Field) return C_Int; - pragma Import (C, Field_Just, "field_just"); - begin - return Field_Justification'Val (Field_Just (Fld)); - end Get_Justification; - -- | - -- |===================================================================== - -- | man page form_field_buffer.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Buffer - (Fld : Field; - Buffer : Buffer_Number := Buffer_Number'First; - Str : String) - is - type Char_Ptr is access all Interfaces.C.char; - function Set_Fld_Buffer (Fld : Field; - Bufnum : C_Int; - S : Char_Ptr) - return C_Int; - pragma Import (C, Set_Fld_Buffer, "set_field_buffer"); - - Txt : char_array (0 .. Str'Length); - Len : size_t; - Res : Eti_Error; - begin - To_C (Str, Txt, Len); - Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Buffer; - -- | - -- | - -- | - procedure Get_Buffer - (Fld : Field; - Buffer : Buffer_Number := Buffer_Number'First; - Str : out String) - is - function Field_Buffer (Fld : Field; - B : C_Int) return chars_ptr; - pragma Import (C, Field_Buffer, "field_buffer"); - begin - Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str); - end Get_Buffer; - - function Get_Buffer - (Fld : Field; - Buffer : Buffer_Number := Buffer_Number'First) return String - is - function Field_Buffer (Fld : Field; - B : C_Int) return chars_ptr; - pragma Import (C, Field_Buffer, "field_buffer"); - begin - return Fill_String (Field_Buffer (Fld, C_Int (Buffer))); - end Get_Buffer; - -- | - -- | - -- | - procedure Set_Status (Fld : Field; - Status : Boolean := True) - is - function Set_Fld_Status (Fld : Field; - St : C_Int) return C_Int; - pragma Import (C, Set_Fld_Status, "set_field_status"); - - Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status)); - begin - if Res /= E_Ok then - raise Form_Exception; - end if; - end Set_Status; - -- | - -- | - -- | - function Changed (Fld : Field) return Boolean - is - function Field_Status (Fld : Field) return C_Int; - pragma Import (C, Field_Status, "field_status"); - - Res : constant C_Int := Field_Status (Fld); - begin - if Res = Curses_False then - return False; - else - return True; - end if; - end Changed; - -- | - -- | - -- | - procedure Set_Maximum_Size (Fld : Field; - Max : Natural := 0) - is - function Set_Field_Max (Fld : Field; - M : C_Int) return C_Int; - pragma Import (C, Set_Field_Max, "set_max_field"); - - Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Maximum_Size; - -- | - -- |===================================================================== - -- | man page form_field_opts.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Options (Fld : Field; - Options : Field_Option_Set) - is - function Set_Field_Opts (Fld : Field; - Opt : C_Int) return C_Int; - pragma Import (C, Set_Field_Opts, "set_field_opts"); - - Opt : constant C_Int := FOS_2_CInt (Options); - Res : Eti_Error; - begin - Res := Set_Field_Opts (Fld, Opt); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Options; - -- | - -- | - -- | - procedure Switch_Options (Fld : Field; - Options : Field_Option_Set; - On : Boolean := True) - is - function Field_Opts_On (Fld : Field; - Opt : C_Int) return C_Int; - pragma Import (C, Field_Opts_On, "field_opts_on"); - function Field_Opts_Off (Fld : Field; - Opt : C_Int) return C_Int; - pragma Import (C, Field_Opts_Off, "field_opts_off"); - - Err : Eti_Error; - Opt : constant C_Int := FOS_2_CInt (Options); - begin - if On then - Err := Field_Opts_On (Fld, Opt); - else - Err := Field_Opts_Off (Fld, Opt); - end if; - if Err /= E_Ok then - Eti_Exception (Err); - end if; - end Switch_Options; - -- | - -- | - -- | - procedure Get_Options (Fld : Field; - Options : out Field_Option_Set) - is - function Field_Opts (Fld : Field) return C_Int; - pragma Import (C, Field_Opts, "field_opts"); - - Res : constant C_Int := Field_Opts (Fld); - begin - Options := CInt_2_FOS (Res); - end Get_Options; - -- | - -- | - -- | - function Get_Options (Fld : Field := Null_Field) - return Field_Option_Set - is - Fos : Field_Option_Set; - begin - Get_Options (Fld, Fos); - return Fos; - end Get_Options; - -- | - -- |===================================================================== - -- | man page form_field_attributes.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Foreground - (Fld : Field; - Fore : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Set_Field_Fore (Fld : Field; - Attr : C_Chtype) return C_Int; - pragma Import (C, Set_Field_Fore, "set_field_fore"); - - Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Fore); - Res : constant Eti_Error := - Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Foreground; - -- | - -- | - -- | - procedure Foreground (Fld : Field; - Fore : out Character_Attribute_Set) - is - function Field_Fore (Fld : Field) return C_Chtype; - pragma Import (C, Field_Fore, "field_fore"); - begin - Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; - end Foreground; - - procedure Foreground (Fld : Field; - Fore : out Character_Attribute_Set; - Color : out Color_Pair) - is - function Field_Fore (Fld : Field) return C_Chtype; - pragma Import (C, Field_Fore, "field_fore"); - begin - Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr; - Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color; - end Foreground; - -- | - -- | - -- | - procedure Set_Background - (Fld : Field; - Back : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Set_Field_Back (Fld : Field; - Attr : C_Chtype) return C_Int; - pragma Import (C, Set_Field_Back, "set_field_back"); - - Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Back); - Res : constant Eti_Error := - Set_Field_Back (Fld, AttrChar_To_Chtype (Ch)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Background; - -- | - -- | - -- | - procedure Background (Fld : Field; - Back : out Character_Attribute_Set) - is - function Field_Back (Fld : Field) return C_Chtype; - pragma Import (C, Field_Back, "field_back"); - begin - Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; - end Background; - - procedure Background (Fld : Field; - Back : out Character_Attribute_Set; - Color : out Color_Pair) - is - function Field_Back (Fld : Field) return C_Chtype; - pragma Import (C, Field_Back, "field_back"); - begin - Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr; - Color := Chtype_To_AttrChar (Field_Back (Fld)).Color; - end Background; - -- | - -- | - -- | - procedure Set_Pad_Character (Fld : Field; - Pad : Character := Space) - is - function Set_Field_Pad (Fld : Field; - Ch : C_Int) return C_Int; - pragma Import (C, Set_Field_Pad, "set_field_pad"); - - Res : constant Eti_Error := Set_Field_Pad (Fld, - C_Int (Character'Pos (Pad))); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Pad_Character; - -- | - -- | - -- | - procedure Pad_Character (Fld : Field; - Pad : out Character) - is - function Field_Pad (Fld : Field) return C_Int; - pragma Import (C, Field_Pad, "field_pad"); - begin - Pad := Character'Val (Field_Pad (Fld)); - end Pad_Character; - -- | - -- |===================================================================== - -- | man page form_field_info.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Info (Fld : Field; - Lines : out Line_Count; - Columns : out Column_Count; - First_Row : out Line_Position; - First_Column : out Column_Position; - Off_Screen : out Natural; - Additional_Buffers : out Buffer_Number) - is - type C_Int_Access is access all C_Int; - function Fld_Info (Fld : Field; - L, C, Fr, Fc, Os, Ab : C_Int_Access) - return C_Int; - pragma Import (C, Fld_Info, "field_info"); - - L, C, Fr, Fc, Os, Ab : aliased C_Int; - Res : constant Eti_Error := Fld_Info (Fld, - L'Access, C'Access, - Fr'Access, Fc'Access, - Os'Access, Ab'Access); - begin - if Res /= E_Ok then - Eti_Exception (Res); - else - Lines := Line_Count (L); - Columns := Column_Count (C); - First_Row := Line_Position (Fr); - First_Column := Column_Position (Fc); - Off_Screen := Natural (Os); - Additional_Buffers := Buffer_Number (Ab); - end if; - end Info; --- | --- | --- | - procedure Dynamic_Info (Fld : Field; - Lines : out Line_Count; - Columns : out Column_Count; - Max : out Natural) - is - type C_Int_Access is access all C_Int; - function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int; - pragma Import (C, Dyn_Info, "dynamic_field_info"); - - L, C, M : aliased C_Int; - Res : constant Eti_Error := Dyn_Info (Fld, - L'Access, C'Access, - M'Access); - begin - if Res /= E_Ok then - Eti_Exception (Res); - else - Lines := Line_Count (L); - Columns := Column_Count (C); - Max := Natural (M); - end if; - end Dynamic_Info; - -- | - -- |===================================================================== - -- | man page form_win.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Window (Frm : Form; - Win : Window) - is - function Set_Form_Win (Frm : Form; - Win : Window) return C_Int; - pragma Import (C, Set_Form_Win, "set_form_win"); - - Res : constant Eti_Error := Set_Form_Win (Frm, Win); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Window; - -- | - -- | - -- | - function Get_Window (Frm : Form) return Window - is - function Form_Win (Frm : Form) return Window; - pragma Import (C, Form_Win, "form_win"); - - W : constant Window := Form_Win (Frm); - begin - return W; - end Get_Window; - -- | - -- | - -- | - procedure Set_Sub_Window (Frm : Form; - Win : Window) - is - function Set_Form_Sub (Frm : Form; - Win : Window) return C_Int; - pragma Import (C, Set_Form_Sub, "set_form_sub"); - - Res : constant Eti_Error := Set_Form_Sub (Frm, Win); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Sub_Window; - -- | - -- | - -- | - function Get_Sub_Window (Frm : Form) return Window - is - function Form_Sub (Frm : Form) return Window; - pragma Import (C, Form_Sub, "form_sub"); - - W : constant Window := Form_Sub (Frm); - begin - return W; - end Get_Sub_Window; - -- | - -- | - -- | - procedure Scale (Frm : Form; - Lines : out Line_Count; - Columns : out Column_Count) - is - type C_Int_Access is access all C_Int; - function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int; - pragma Import (C, M_Scale, "scale_form"); - - X, Y : aliased C_Int; - Res : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Lines := Line_Count (Y); - Columns := Column_Count (X); - end Scale; - -- | - -- |===================================================================== - -- | man page menu_hook.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Field_Init_Hook (Frm : Form; - Proc : Form_Hook_Function) - is - function Set_Field_Init (Frm : Form; - Proc : Form_Hook_Function) return C_Int; - pragma Import (C, Set_Field_Init, "set_field_init"); - - Res : constant Eti_Error := Set_Field_Init (Frm, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Field_Init_Hook; - -- | - -- | - -- | - procedure Set_Field_Term_Hook (Frm : Form; - Proc : Form_Hook_Function) - is - function Set_Field_Term (Frm : Form; - Proc : Form_Hook_Function) return C_Int; - pragma Import (C, Set_Field_Term, "set_field_term"); - - Res : constant Eti_Error := Set_Field_Term (Frm, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Field_Term_Hook; - -- | - -- | - -- | - procedure Set_Form_Init_Hook (Frm : Form; - Proc : Form_Hook_Function) - is - function Set_Form_Init (Frm : Form; - Proc : Form_Hook_Function) return C_Int; - pragma Import (C, Set_Form_Init, "set_form_init"); - - Res : constant Eti_Error := Set_Form_Init (Frm, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Form_Init_Hook; - -- | - -- | - -- | - procedure Set_Form_Term_Hook (Frm : Form; - Proc : Form_Hook_Function) - is - function Set_Form_Term (Frm : Form; - Proc : Form_Hook_Function) return C_Int; - pragma Import (C, Set_Form_Term, "set_form_term"); - - Res : constant Eti_Error := Set_Form_Term (Frm, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Form_Term_Hook; - -- | - -- |===================================================================== - -- | man page form_fields.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Redefine (Frm : Form; - Flds : Field_Array_Access) - is - function Set_Frm_Fields (Frm : Form; - Items : System.Address) return C_Int; - pragma Import (C, Set_Frm_Fields, "set_form_fields"); - - Res : Eti_Error; - begin - pragma Assert (Flds.all (Flds'Last) = Null_Field); - if Flds.all (Flds'Last) /= Null_Field then - raise Form_Exception; - else - Res := Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - end Redefine; - -- | - -- | - -- | - function Fields (Frm : Form; - Index : Positive) return Field - is - use F_Array; - - function C_Fields (Frm : Form) return Pointer; - pragma Import (C, C_Fields, "form_fields"); - - P : Pointer := C_Fields (Frm); - begin - if P = null or else Index > Field_Count (Frm) then - raise Form_Exception; - else - P := P + ptrdiff_t (C_Int (Index) - 1); - return P.all; - end if; - end Fields; - -- | - -- | - -- | - function Field_Count (Frm : Form) return Natural - is - function Count (Frm : Form) return C_Int; - pragma Import (C, Count, "field_count"); - begin - return Natural (Count (Frm)); - end Field_Count; - -- | - -- | - -- | - procedure Move (Fld : Field; - Line : Line_Position; - Column : Column_Position) - is - function Move (Fld : Field; L, C : C_Int) return C_Int; - pragma Import (C, Move, "move_field"); - - Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Move; - -- | - -- |===================================================================== - -- | man page form_new.3x - -- |===================================================================== - -- | - -- | - -- | - function Create (Fields : Field_Array_Access) return Form - is - function NewForm (Fields : System.Address) return Form; - pragma Import (C, NewForm, "new_form"); - - M : Form; - begin - pragma Assert (Fields.all (Fields'Last) = Null_Field); - if Fields.all (Fields'Last) /= Null_Field then - raise Form_Exception; - else - M := NewForm (Fields.all (Fields'First)'Address); - if M = Null_Form then - raise Form_Exception; - end if; - return M; - end if; - end Create; - -- | - -- | - -- | - procedure Delete (Frm : in out Form) - is - function Free (Frm : Form) return C_Int; - pragma Import (C, Free, "free_form"); - - Res : constant Eti_Error := Free (Frm); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Frm := Null_Form; - end Delete; - -- | - -- |===================================================================== - -- | man page form_opts.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Options (Frm : Form; - Options : Form_Option_Set) - is - function Set_Form_Opts (Frm : Form; - Opt : C_Int) return C_Int; - pragma Import (C, Set_Form_Opts, "set_form_opts"); - - Opt : constant C_Int := FrmOS_2_CInt (Options); - Res : Eti_Error; - begin - Res := Set_Form_Opts (Frm, Opt); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Options; - -- | - -- | - -- | - procedure Switch_Options (Frm : Form; - Options : Form_Option_Set; - On : Boolean := True) - is - function Form_Opts_On (Frm : Form; - Opt : C_Int) return C_Int; - pragma Import (C, Form_Opts_On, "form_opts_on"); - function Form_Opts_Off (Frm : Form; - Opt : C_Int) return C_Int; - pragma Import (C, Form_Opts_Off, "form_opts_off"); - - Err : Eti_Error; - Opt : constant C_Int := FrmOS_2_CInt (Options); - begin - if On then - Err := Form_Opts_On (Frm, Opt); - else - Err := Form_Opts_Off (Frm, Opt); - end if; - if Err /= E_Ok then - Eti_Exception (Err); - end if; - end Switch_Options; - -- | - -- | - -- | - procedure Get_Options (Frm : Form; - Options : out Form_Option_Set) - is - function Form_Opts (Frm : Form) return C_Int; - pragma Import (C, Form_Opts, "form_opts"); - - Res : constant C_Int := Form_Opts (Frm); - begin - Options := CInt_2_FrmOS (Res); - end Get_Options; - -- | - -- | - -- | - function Get_Options (Frm : Form := Null_Form) return Form_Option_Set - is - Fos : Form_Option_Set; - begin - Get_Options (Frm, Fos); - return Fos; - end Get_Options; - -- | - -- |===================================================================== - -- | man page form_post.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Post (Frm : Form; - Post : Boolean := True) - is - function M_Post (Frm : Form) return C_Int; - pragma Import (C, M_Post, "post_form"); - function M_Unpost (Frm : Form) return C_Int; - pragma Import (C, M_Unpost, "unpost_form"); - - Res : Eti_Error; - begin - if Post then - Res := M_Post (Frm); - else - Res := M_Unpost (Frm); - end if; - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Post; - -- | - -- |===================================================================== - -- | man page form_cursor.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Position_Cursor (Frm : Form) - is - function Pos_Form_Cursor (Frm : Form) return C_Int; - pragma Import (C, Pos_Form_Cursor, "pos_form_cursor"); - - Res : constant Eti_Error := Pos_Form_Cursor (Frm); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Position_Cursor; - -- | - -- |===================================================================== - -- | man page form_data.3x - -- |===================================================================== - -- | - -- | - -- | - function Data_Ahead (Frm : Form) return Boolean - is - function Ahead (Frm : Form) return C_Int; - pragma Import (C, Ahead, "data_ahead"); - - Res : constant C_Int := Ahead (Frm); - begin - if Res = Curses_False then - return False; - else - return True; - end if; - end Data_Ahead; - -- | - -- | - -- | - function Data_Behind (Frm : Form) return Boolean - is - function Behind (Frm : Form) return C_Int; - pragma Import (C, Behind, "data_behind"); - - Res : constant C_Int := Behind (Frm); - begin - if Res = Curses_False then - return False; - else - return True; - end if; - end Data_Behind; - -- | - -- |===================================================================== - -- | man page form_driver.3x - -- |===================================================================== - -- | - -- | - -- | - function Driver (Frm : Form; - Key : Key_Code) return Driver_Result - is - function Frm_Driver (Frm : Form; Key : C_Int) return C_Int; - pragma Import (C, Frm_Driver, "form_driver"); - - R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key)); - begin - if R /= E_Ok then - if R = E_Unknown_Command then - return Unknown_Request; - elsif R = E_Invalid_Field then - return Invalid_Field; - elsif R = E_Request_Denied then - return Request_Denied; - else - Eti_Exception (R); - return Form_Ok; - end if; - else - return Form_Ok; - end if; - end Driver; - -- | - -- |===================================================================== - -- | man page form_page.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_Current (Frm : Form; - Fld : Field) - is - function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int; - pragma Import (C, Set_Current_Fld, "set_current_field"); - - Res : constant Eti_Error := Set_Current_Fld (Frm, Fld); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Current; - -- | - -- | - -- | - function Current (Frm : Form) return Field - is - function Current_Fld (Frm : Form) return Field; - pragma Import (C, Current_Fld, "current_field"); - - Fld : constant Field := Current_Fld (Frm); - begin - if Fld = Null_Field then - raise Form_Exception; - end if; - return Fld; - end Current; - -- | - -- | - -- | - procedure Set_Page (Frm : Form; - Page : Page_Number := Page_Number'First) - is - function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int; - pragma Import (C, Set_Frm_Page, "set_form_page"); - - Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Page; - -- | - -- | - -- | - function Page (Frm : Form) return Page_Number - is - function Get_Page (Frm : Form) return C_Int; - pragma Import (C, Get_Page, "form_page"); - - P : constant C_Int := Get_Page (Frm); - begin - if P < 0 then - raise Form_Exception; - else - return Page_Number (P); - end if; - end Page; - - function Get_Index (Fld : Field) return Positive - is - function Get_Fieldindex (Fld : Field) return C_Int; - pragma Import (C, Get_Fieldindex, "field_index"); - - Res : constant C_Int := Get_Fieldindex (Fld); - begin - if Res = Curses_Err then - raise Form_Exception; - end if; - return Positive (Natural (Res) + Positive'First); - end Get_Index; - - -- | - -- |===================================================================== - -- | man page form_new_page.3x - -- |===================================================================== - -- | - -- | - -- | - procedure Set_New_Page (Fld : Field; - New_Page : Boolean := True) - is - function Set_Page (Fld : Field; Flg : C_Int) return C_Int; - pragma Import (C, Set_Page, "set_new_page"); - - Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_New_Page; - -- | - -- | - -- | - function Is_New_Page (Fld : Field) return Boolean - is - function Is_New (Fld : Field) return C_Int; - pragma Import (C, Is_New, "new_page"); - - Res : constant C_Int := Is_New (Fld); - begin - if Res = Curses_False then - return False; - else - return True; - end if; - end Is_New_Page; - - procedure Free (FA : in out Field_Array_Access; - Free_Fields : Boolean := False) - is - procedure Release is new Ada.Unchecked_Deallocation - (Field_Array, Field_Array_Access); - begin - if FA /= null and then Free_Fields then - for I in FA'First .. (FA'Last - 1) loop - if FA.all (I) /= Null_Field then - Delete (FA.all (I)); - end if; - end loop; - end if; - Release (FA); - end Free; - - -- |===================================================================== - - function Default_Field_Options return Field_Option_Set - is - begin - return Get_Options (Null_Field); - end Default_Field_Options; - - function Default_Form_Options return Form_Option_Set - is - begin - return Get_Options (Null_Form); - end Default_Form_Options; - -end Terminal_Interface.Curses.Forms; diff --git a/Ada95/src/terminal_interface-curses-menus-item_user_data.adb b/Ada95/src/terminal_interface-curses-menus-item_user_data.adb deleted file mode 100644 index eb06d096dfb..00000000000 --- a/Ada95/src/terminal_interface-curses-menus-item_user_data.adb +++ /dev/null @@ -1,77 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Menus.Item_User_Data -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Menus.Item_User_Data is - - use type Interfaces.C.int; - - procedure Set_User_Data (Itm : Item; - Data : User_Access) - is - function Set_Item_Userptr (Itm : Item; - Addr : User_Access) return C_Int; - pragma Import (C, Set_Item_Userptr, "set_item_userptr"); - - Res : constant Eti_Error := Set_Item_Userptr (Itm, Data); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_User_Data; - - function Get_User_Data (Itm : Item) return User_Access - is - function Item_Userptr (Itm : Item) return User_Access; - pragma Import (C, Item_Userptr, "item_userptr"); - begin - return Item_Userptr (Itm); - end Get_User_Data; - - procedure Get_User_Data (Itm : Item; - Data : out User_Access) - is - begin - Data := Get_User_Data (Itm); - end Get_User_Data; - -end Terminal_Interface.Curses.Menus.Item_User_Data; diff --git a/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb b/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb deleted file mode 100644 index 7d66a8c052e..00000000000 --- a/Ada95/src/terminal_interface-curses-menus-menu_user_data.adb +++ /dev/null @@ -1,76 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Menus.Menu_User_Data -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.13 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.Menus.Menu_User_Data is - - use type Interfaces.C.int; - - procedure Set_User_Data (Men : Menu; - Data : User_Access) - is - function Set_Menu_Userptr (Men : Menu; - Data : User_Access) return C_Int; - pragma Import (C, Set_Menu_Userptr, "set_menu_userptr"); - - Res : constant Eti_Error := Set_Menu_Userptr (Men, Data); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_User_Data; - - function Get_User_Data (Men : Menu) return User_Access - is - function Menu_Userptr (Men : Menu) return User_Access; - pragma Import (C, Menu_Userptr, "menu_userptr"); - begin - return Menu_Userptr (Men); - end Get_User_Data; - - procedure Get_User_Data (Men : Menu; - Data : out User_Access) - is - begin - Data := Get_User_Data (Men); - end Get_User_Data; - -end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/Ada95/src/terminal_interface-curses-menus.adb b/Ada95/src/terminal_interface-curses-menus.adb deleted file mode 100644 index a7dca07c287..00000000000 --- a/Ada95/src/terminal_interface-curses-menus.adb +++ /dev/null @@ -1,1022 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Menus -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.28 $ --- $Date: 2011/03/22 23:38:12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Unchecked_Deallocation; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Interfaces.C.Pointers; - -with Ada.Unchecked_Conversion; - -package body Terminal_Interface.Curses.Menus is - - type C_Item_Array is array (Natural range <>) of aliased Item; - package I_Array is new - Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); - - use type System.Bit_Order; - subtype chars_ptr is Interfaces.C.Strings.chars_ptr; - - function MOS_2_CInt is new - Ada.Unchecked_Conversion (Menu_Option_Set, - C_Int); - - function CInt_2_MOS is new - Ada.Unchecked_Conversion (C_Int, - Menu_Option_Set); - - function IOS_2_CInt is new - Ada.Unchecked_Conversion (Item_Option_Set, - C_Int); - - function CInt_2_IOS is new - Ada.Unchecked_Conversion (C_Int, - Item_Option_Set); - ------------------------------------------------------------------------------- - procedure Request_Name (Key : Menu_Request_Code; - Name : out String) - is - function Request_Name (Key : C_Int) return chars_ptr; - pragma Import (C, Request_Name, "menu_request_name"); - begin - Fill_String (Request_Name (C_Int (Key)), Name); - end Request_Name; - - function Request_Name (Key : Menu_Request_Code) return String - is - function Request_Name (Key : C_Int) return chars_ptr; - pragma Import (C, Request_Name, "menu_request_name"); - begin - return Fill_String (Request_Name (C_Int (Key))); - end Request_Name; - - function Create (Name : String; - Description : String := "") return Item - is - type Char_Ptr is access all Interfaces.C.char; - function Newitem (Name, Desc : Char_Ptr) return Item; - pragma Import (C, Newitem, "new_item"); - - type Name_String is new char_array (0 .. Name'Length); - type Name_String_Ptr is access Name_String; - pragma Controlled (Name_String_Ptr); - - type Desc_String is new char_array (0 .. Description'Length); - type Desc_String_Ptr is access Desc_String; - pragma Controlled (Desc_String_Ptr); - - Name_Str : constant Name_String_Ptr := new Name_String; - Desc_Str : constant Desc_String_Ptr := new Desc_String; - Name_Len, Desc_Len : size_t; - Result : Item; - begin - To_C (Name, Name_Str.all, Name_Len); - To_C (Description, Desc_Str.all, Desc_Len); - Result := Newitem (Name_Str.all (Name_Str.all'First)'Access, - Desc_Str.all (Desc_Str.all'First)'Access); - if Result = Null_Item then - raise Eti_System_Error; - end if; - return Result; - end Create; - - procedure Delete (Itm : in out Item) - is - function Descname (Itm : Item) return chars_ptr; - pragma Import (C, Descname, "item_description"); - function Itemname (Itm : Item) return chars_ptr; - pragma Import (C, Itemname, "item_name"); - - function Freeitem (Itm : Item) return C_Int; - pragma Import (C, Freeitem, "free_item"); - - Res : Eti_Error; - Ptr : chars_ptr; - begin - Ptr := Descname (Itm); - if Ptr /= Null_Ptr then - Interfaces.C.Strings.Free (Ptr); - end if; - Ptr := Itemname (Itm); - if Ptr /= Null_Ptr then - Interfaces.C.Strings.Free (Ptr); - end if; - Res := Freeitem (Itm); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Itm := Null_Item; - end Delete; -------------------------------------------------------------------------------- - procedure Set_Value (Itm : Item; - Value : Boolean := True) - is - function Set_Item_Val (Itm : Item; - Val : C_Int) return C_Int; - pragma Import (C, Set_Item_Val, "set_item_value"); - - Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Value; - - function Value (Itm : Item) return Boolean - is - function Item_Val (Itm : Item) return C_Int; - pragma Import (C, Item_Val, "item_value"); - begin - if Item_Val (Itm) = Curses_False then - return False; - else - return True; - end if; - end Value; - -------------------------------------------------------------------------------- - function Visible (Itm : Item) return Boolean - is - function Item_Vis (Itm : Item) return C_Int; - pragma Import (C, Item_Vis, "item_visible"); - begin - if Item_Vis (Itm) = Curses_False then - return False; - else - return True; - end if; - end Visible; -------------------------------------------------------------------------------- - procedure Set_Options (Itm : Item; - Options : Item_Option_Set) - is - function Set_Item_Opts (Itm : Item; - Opt : C_Int) return C_Int; - pragma Import (C, Set_Item_Opts, "set_item_opts"); - - Opt : constant C_Int := IOS_2_CInt (Options); - Res : Eti_Error; - begin - Res := Set_Item_Opts (Itm, Opt); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Options; - - procedure Switch_Options (Itm : Item; - Options : Item_Option_Set; - On : Boolean := True) - is - function Item_Opts_On (Itm : Item; - Opt : C_Int) return C_Int; - pragma Import (C, Item_Opts_On, "item_opts_on"); - function Item_Opts_Off (Itm : Item; - Opt : C_Int) return C_Int; - pragma Import (C, Item_Opts_Off, "item_opts_off"); - - Opt : constant C_Int := IOS_2_CInt (Options); - Err : Eti_Error; - begin - if On then - Err := Item_Opts_On (Itm, Opt); - else - Err := Item_Opts_Off (Itm, Opt); - end if; - if Err /= E_Ok then - Eti_Exception (Err); - end if; - end Switch_Options; - - procedure Get_Options (Itm : Item; - Options : out Item_Option_Set) - is - function Item_Opts (Itm : Item) return C_Int; - pragma Import (C, Item_Opts, "item_opts"); - - Res : constant C_Int := Item_Opts (Itm); - begin - Options := CInt_2_IOS (Res); - end Get_Options; - - function Get_Options (Itm : Item := Null_Item) return Item_Option_Set - is - Ios : Item_Option_Set; - begin - Get_Options (Itm, Ios); - return Ios; - end Get_Options; -------------------------------------------------------------------------------- - procedure Name (Itm : Item; - Name : out String) - is - function Itemname (Itm : Item) return chars_ptr; - pragma Import (C, Itemname, "item_name"); - begin - Fill_String (Itemname (Itm), Name); - end Name; - - function Name (Itm : Item) return String - is - function Itemname (Itm : Item) return chars_ptr; - pragma Import (C, Itemname, "item_name"); - begin - return Fill_String (Itemname (Itm)); - end Name; - - procedure Description (Itm : Item; - Description : out String) - is - function Descname (Itm : Item) return chars_ptr; - pragma Import (C, Descname, "item_description"); - begin - Fill_String (Descname (Itm), Description); - end Description; - - function Description (Itm : Item) return String - is - function Descname (Itm : Item) return chars_ptr; - pragma Import (C, Descname, "item_description"); - begin - return Fill_String (Descname (Itm)); - end Description; -------------------------------------------------------------------------------- - procedure Set_Current (Men : Menu; - Itm : Item) - is - function Set_Curr_Item (Men : Menu; - Itm : Item) return C_Int; - pragma Import (C, Set_Curr_Item, "set_current_item"); - - Res : constant Eti_Error := Set_Curr_Item (Men, Itm); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Current; - - function Current (Men : Menu) return Item - is - function Curr_Item (Men : Menu) return Item; - pragma Import (C, Curr_Item, "current_item"); - - Res : constant Item := Curr_Item (Men); - begin - if Res = Null_Item then - raise Menu_Exception; - end if; - return Res; - end Current; - - procedure Set_Top_Row (Men : Menu; - Line : Line_Position) - is - function Set_Toprow (Men : Menu; - Line : C_Int) return C_Int; - pragma Import (C, Set_Toprow, "set_top_row"); - - Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Top_Row; - - function Top_Row (Men : Menu) return Line_Position - is - function Toprow (Men : Menu) return C_Int; - pragma Import (C, Toprow, "top_row"); - - Res : constant C_Int := Toprow (Men); - begin - if Res = Curses_Err then - raise Menu_Exception; - end if; - return Line_Position (Res); - end Top_Row; - - function Get_Index (Itm : Item) return Positive - is - function Get_Itemindex (Itm : Item) return C_Int; - pragma Import (C, Get_Itemindex, "item_index"); - - Res : constant C_Int := Get_Itemindex (Itm); - begin - if Res = Curses_Err then - raise Menu_Exception; - end if; - return Positive (Natural (Res) + Positive'First); - end Get_Index; -------------------------------------------------------------------------------- - procedure Post (Men : Menu; - Post : Boolean := True) - is - function M_Post (Men : Menu) return C_Int; - pragma Import (C, M_Post, "post_menu"); - function M_Unpost (Men : Menu) return C_Int; - pragma Import (C, M_Unpost, "unpost_menu"); - - Res : Eti_Error; - begin - if Post then - Res := M_Post (Men); - else - Res := M_Unpost (Men); - end if; - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Post; -------------------------------------------------------------------------------- - procedure Set_Options (Men : Menu; - Options : Menu_Option_Set) - is - function Set_Menu_Opts (Men : Menu; - Opt : C_Int) return C_Int; - pragma Import (C, Set_Menu_Opts, "set_menu_opts"); - - Opt : constant C_Int := MOS_2_CInt (Options); - Res : Eti_Error; - begin - Res := Set_Menu_Opts (Men, Opt); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Options; - - procedure Switch_Options (Men : Menu; - Options : Menu_Option_Set; - On : Boolean := True) - is - function Menu_Opts_On (Men : Menu; - Opt : C_Int) return C_Int; - pragma Import (C, Menu_Opts_On, "menu_opts_on"); - function Menu_Opts_Off (Men : Menu; - Opt : C_Int) return C_Int; - pragma Import (C, Menu_Opts_Off, "menu_opts_off"); - - Opt : constant C_Int := MOS_2_CInt (Options); - Err : Eti_Error; - begin - if On then - Err := Menu_Opts_On (Men, Opt); - else - Err := Menu_Opts_Off (Men, Opt); - end if; - if Err /= E_Ok then - Eti_Exception (Err); - end if; - end Switch_Options; - - procedure Get_Options (Men : Menu; - Options : out Menu_Option_Set) - is - function Menu_Opts (Men : Menu) return C_Int; - pragma Import (C, Menu_Opts, "menu_opts"); - - Res : constant C_Int := Menu_Opts (Men); - begin - Options := CInt_2_MOS (Res); - end Get_Options; - - function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set - is - Mos : Menu_Option_Set; - begin - Get_Options (Men, Mos); - return Mos; - end Get_Options; -------------------------------------------------------------------------------- - procedure Set_Window (Men : Menu; - Win : Window) - is - function Set_Menu_Win (Men : Menu; - Win : Window) return C_Int; - pragma Import (C, Set_Menu_Win, "set_menu_win"); - - Res : constant Eti_Error := Set_Menu_Win (Men, Win); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Window; - - function Get_Window (Men : Menu) return Window - is - function Menu_Win (Men : Menu) return Window; - pragma Import (C, Menu_Win, "menu_win"); - - W : constant Window := Menu_Win (Men); - begin - return W; - end Get_Window; - - procedure Set_Sub_Window (Men : Menu; - Win : Window) - is - function Set_Menu_Sub (Men : Menu; - Win : Window) return C_Int; - pragma Import (C, Set_Menu_Sub, "set_menu_sub"); - - Res : constant Eti_Error := Set_Menu_Sub (Men, Win); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Sub_Window; - - function Get_Sub_Window (Men : Menu) return Window - is - function Menu_Sub (Men : Menu) return Window; - pragma Import (C, Menu_Sub, "menu_sub"); - - W : constant Window := Menu_Sub (Men); - begin - return W; - end Get_Sub_Window; - - procedure Scale (Men : Menu; - Lines : out Line_Count; - Columns : out Column_Count) - is - type C_Int_Access is access all C_Int; - function M_Scale (Men : Menu; - Yp, Xp : C_Int_Access) return C_Int; - pragma Import (C, M_Scale, "scale_menu"); - - X, Y : aliased C_Int; - Res : constant Eti_Error := M_Scale (Men, Y'Access, X'Access); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Lines := Line_Count (Y); - Columns := Column_Count (X); - end Scale; -------------------------------------------------------------------------------- - procedure Position_Cursor (Men : Menu) - is - function Pos_Menu_Cursor (Men : Menu) return C_Int; - pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor"); - - Res : constant Eti_Error := Pos_Menu_Cursor (Men); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Position_Cursor; - -------------------------------------------------------------------------------- - procedure Set_Mark (Men : Menu; - Mark : String) - is - type Char_Ptr is access all Interfaces.C.char; - function Set_Mark (Men : Menu; - Mark : Char_Ptr) return C_Int; - pragma Import (C, Set_Mark, "set_menu_mark"); - - Txt : char_array (0 .. Mark'Length); - Len : size_t; - Res : Eti_Error; - begin - To_C (Mark, Txt, Len); - Res := Set_Mark (Men, Txt (Txt'First)'Access); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Mark; - - procedure Mark (Men : Menu; - Mark : out String) - is - function Get_Menu_Mark (Men : Menu) return chars_ptr; - pragma Import (C, Get_Menu_Mark, "menu_mark"); - begin - Fill_String (Get_Menu_Mark (Men), Mark); - end Mark; - - function Mark (Men : Menu) return String - is - function Get_Menu_Mark (Men : Menu) return chars_ptr; - pragma Import (C, Get_Menu_Mark, "menu_mark"); - begin - return Fill_String (Get_Menu_Mark (Men)); - end Mark; - -------------------------------------------------------------------------------- - procedure Set_Foreground - (Men : Menu; - Fore : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Set_Menu_Fore (Men : Menu; - Attr : C_Chtype) return C_Int; - pragma Import (C, Set_Menu_Fore, "set_menu_fore"); - - Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Fore); - Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Foreground; - - procedure Foreground (Men : Menu; - Fore : out Character_Attribute_Set) - is - function Menu_Fore (Men : Menu) return C_Chtype; - pragma Import (C, Menu_Fore, "menu_fore"); - begin - Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; - end Foreground; - - procedure Foreground (Men : Menu; - Fore : out Character_Attribute_Set; - Color : out Color_Pair) - is - function Menu_Fore (Men : Menu) return C_Chtype; - pragma Import (C, Menu_Fore, "menu_fore"); - begin - Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; - Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color; - end Foreground; - - procedure Set_Background - (Men : Menu; - Back : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Set_Menu_Back (Men : Menu; - Attr : C_Chtype) return C_Int; - pragma Import (C, Set_Menu_Back, "set_menu_back"); - - Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Back); - Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Background; - - procedure Background (Men : Menu; - Back : out Character_Attribute_Set) - is - function Menu_Back (Men : Menu) return C_Chtype; - pragma Import (C, Menu_Back, "menu_back"); - begin - Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; - end Background; - - procedure Background (Men : Menu; - Back : out Character_Attribute_Set; - Color : out Color_Pair) - is - function Menu_Back (Men : Menu) return C_Chtype; - pragma Import (C, Menu_Back, "menu_back"); - begin - Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; - Color := Chtype_To_AttrChar (Menu_Back (Men)).Color; - end Background; - - procedure Set_Grey (Men : Menu; - Grey : Character_Attribute_Set := Normal_Video; - Color : Color_Pair := Color_Pair'First) - is - function Set_Menu_Grey (Men : Menu; - Attr : C_Chtype) return C_Int; - pragma Import (C, Set_Menu_Grey, "set_menu_grey"); - - Ch : constant Attributed_Character := (Ch => Character'First, - Color => Color, - Attr => Grey); - - Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Grey; - - procedure Grey (Men : Menu; - Grey : out Character_Attribute_Set) - is - function Menu_Grey (Men : Menu) return C_Chtype; - pragma Import (C, Menu_Grey, "menu_grey"); - begin - Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; - end Grey; - - procedure Grey (Men : Menu; - Grey : out Character_Attribute_Set; - Color : out Color_Pair) - is - function Menu_Grey (Men : Menu) return C_Chtype; - pragma Import (C, Menu_Grey, "menu_grey"); - begin - Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; - Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color; - end Grey; - - procedure Set_Pad_Character (Men : Menu; - Pad : Character := Space) - is - function Set_Menu_Pad (Men : Menu; - Ch : C_Int) return C_Int; - pragma Import (C, Set_Menu_Pad, "set_menu_pad"); - - Res : constant Eti_Error := Set_Menu_Pad (Men, - C_Int (Character'Pos (Pad))); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Pad_Character; - - procedure Pad_Character (Men : Menu; - Pad : out Character) - is - function Menu_Pad (Men : Menu) return C_Int; - pragma Import (C, Menu_Pad, "menu_pad"); - begin - Pad := Character'Val (Menu_Pad (Men)); - end Pad_Character; -------------------------------------------------------------------------------- - procedure Set_Spacing (Men : Menu; - Descr : Column_Position := 0; - Row : Line_Position := 0; - Col : Column_Position := 0) - is - function Set_Spacing (Men : Menu; - D, R, C : C_Int) return C_Int; - pragma Import (C, Set_Spacing, "set_menu_spacing"); - - Res : constant Eti_Error := Set_Spacing (Men, - C_Int (Descr), - C_Int (Row), - C_Int (Col)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Spacing; - - procedure Spacing (Men : Menu; - Descr : out Column_Position; - Row : out Line_Position; - Col : out Column_Position) - is - type C_Int_Access is access all C_Int; - function Get_Spacing (Men : Menu; - D, R, C : C_Int_Access) return C_Int; - pragma Import (C, Get_Spacing, "menu_spacing"); - - D, R, C : aliased C_Int; - Res : constant Eti_Error := Get_Spacing (Men, - D'Access, - R'Access, - C'Access); - begin - if Res /= E_Ok then - Eti_Exception (Res); - else - Descr := Column_Position (D); - Row := Line_Position (R); - Col := Column_Position (C); - end if; - end Spacing; -------------------------------------------------------------------------------- - function Set_Pattern (Men : Menu; - Text : String) return Boolean - is - type Char_Ptr is access all Interfaces.C.char; - function Set_Pattern (Men : Menu; - Pattern : Char_Ptr) return C_Int; - pragma Import (C, Set_Pattern, "set_menu_pattern"); - - S : char_array (0 .. Text'Length); - L : size_t; - Res : Eti_Error; - begin - To_C (Text, S, L); - Res := Set_Pattern (Men, S (S'First)'Access); - case Res is - when E_No_Match => return False; - when E_Ok => return True; - when others => - Eti_Exception (Res); - return False; - end case; - end Set_Pattern; - - procedure Pattern (Men : Menu; - Text : out String) - is - function Get_Pattern (Men : Menu) return chars_ptr; - pragma Import (C, Get_Pattern, "menu_pattern"); - begin - Fill_String (Get_Pattern (Men), Text); - end Pattern; -------------------------------------------------------------------------------- - procedure Set_Format (Men : Menu; - Lines : Line_Count; - Columns : Column_Count) - is - function Set_Menu_Fmt (Men : Menu; - Lin : C_Int; - Col : C_Int) return C_Int; - pragma Import (C, Set_Menu_Fmt, "set_menu_format"); - - Res : constant Eti_Error := Set_Menu_Fmt (Men, - C_Int (Lines), - C_Int (Columns)); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Format; - - procedure Format (Men : Menu; - Lines : out Line_Count; - Columns : out Column_Count) - is - type C_Int_Access is access all C_Int; - function Menu_Fmt (Men : Menu; - Y, X : C_Int_Access) return C_Int; - pragma Import (C, Menu_Fmt, "menu_format"); - - L, C : aliased C_Int; - Res : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access); - begin - if Res /= E_Ok then - Eti_Exception (Res); - else - Lines := Line_Count (L); - Columns := Column_Count (C); - end if; - end Format; -------------------------------------------------------------------------------- - procedure Set_Item_Init_Hook (Men : Menu; - Proc : Menu_Hook_Function) - is - function Set_Item_Init (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; - pragma Import (C, Set_Item_Init, "set_item_init"); - - Res : constant Eti_Error := Set_Item_Init (Men, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Item_Init_Hook; - - procedure Set_Item_Term_Hook (Men : Menu; - Proc : Menu_Hook_Function) - is - function Set_Item_Term (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; - pragma Import (C, Set_Item_Term, "set_item_term"); - - Res : constant Eti_Error := Set_Item_Term (Men, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Item_Term_Hook; - - procedure Set_Menu_Init_Hook (Men : Menu; - Proc : Menu_Hook_Function) - is - function Set_Menu_Init (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; - pragma Import (C, Set_Menu_Init, "set_menu_init"); - - Res : constant Eti_Error := Set_Menu_Init (Men, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Menu_Init_Hook; - - procedure Set_Menu_Term_Hook (Men : Menu; - Proc : Menu_Hook_Function) - is - function Set_Menu_Term (Men : Menu; - Proc : Menu_Hook_Function) return C_Int; - pragma Import (C, Set_Menu_Term, "set_menu_term"); - - Res : constant Eti_Error := Set_Menu_Term (Men, Proc); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end Set_Menu_Term_Hook; - - function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function - is - function Item_Init (Men : Menu) return Menu_Hook_Function; - pragma Import (C, Item_Init, "item_init"); - begin - return Item_Init (Men); - end Get_Item_Init_Hook; - - function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function - is - function Item_Term (Men : Menu) return Menu_Hook_Function; - pragma Import (C, Item_Term, "item_term"); - begin - return Item_Term (Men); - end Get_Item_Term_Hook; - - function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function - is - function Menu_Init (Men : Menu) return Menu_Hook_Function; - pragma Import (C, Menu_Init, "menu_init"); - begin - return Menu_Init (Men); - end Get_Menu_Init_Hook; - - function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function - is - function Menu_Term (Men : Menu) return Menu_Hook_Function; - pragma Import (C, Menu_Term, "menu_term"); - begin - return Menu_Term (Men); - end Get_Menu_Term_Hook; -------------------------------------------------------------------------------- - procedure Redefine (Men : Menu; - Items : Item_Array_Access) - is - function Set_Items (Men : Menu; - Items : System.Address) return C_Int; - pragma Import (C, Set_Items, "set_menu_items"); - - Res : Eti_Error; - begin - pragma Assert (Items.all (Items'Last) = Null_Item); - if Items.all (Items'Last) /= Null_Item then - raise Menu_Exception; - else - Res := Set_Items (Men, Items.all'Address); - if Res /= E_Ok then - Eti_Exception (Res); - end if; - end if; - end Redefine; - - function Item_Count (Men : Menu) return Natural - is - function Count (Men : Menu) return C_Int; - pragma Import (C, Count, "item_count"); - begin - return Natural (Count (Men)); - end Item_Count; - - function Items (Men : Menu; - Index : Positive) return Item - is - use I_Array; - - function C_Mitems (Men : Menu) return Pointer; - pragma Import (C, C_Mitems, "menu_items"); - - P : Pointer := C_Mitems (Men); - begin - if P = null or else Index > Item_Count (Men) then - raise Menu_Exception; - else - P := P + ptrdiff_t (C_Int (Index) - 1); - return P.all; - end if; - end Items; - -------------------------------------------------------------------------------- - function Create (Items : Item_Array_Access) return Menu - is - function Newmenu (Items : System.Address) return Menu; - pragma Import (C, Newmenu, "new_menu"); - - M : Menu; - begin - pragma Assert (Items.all (Items'Last) = Null_Item); - if Items.all (Items'Last) /= Null_Item then - raise Menu_Exception; - else - M := Newmenu (Items.all'Address); - if M = Null_Menu then - raise Menu_Exception; - end if; - return M; - end if; - end Create; - - procedure Delete (Men : in out Menu) - is - function Free (Men : Menu) return C_Int; - pragma Import (C, Free, "free_menu"); - - Res : constant Eti_Error := Free (Men); - begin - if Res /= E_Ok then - Eti_Exception (Res); - end if; - Men := Null_Menu; - end Delete; - ------------------------------------------------------------------------------- - function Driver (Men : Menu; - Key : Key_Code) return Driver_Result - is - function Driver (Men : Menu; - Key : C_Int) return C_Int; - pragma Import (C, Driver, "menu_driver"); - - R : constant Eti_Error := Driver (Men, C_Int (Key)); - begin - if R /= E_Ok then - case R is - when E_Unknown_Command => return Unknown_Request; - when E_No_Match => return No_Match; - when E_Request_Denied | - E_Not_Selectable => return Request_Denied; - when others => - Eti_Exception (R); - end case; - end if; - return Menu_Ok; - end Driver; - - procedure Free (IA : in out Item_Array_Access; - Free_Items : Boolean := False) - is - procedure Release is new Ada.Unchecked_Deallocation - (Item_Array, Item_Array_Access); - begin - if IA /= null and then Free_Items then - for I in IA'First .. (IA'Last - 1) loop - if IA.all (I) /= Null_Item then - Delete (IA.all (I)); - end if; - end loop; - end if; - Release (IA); - end Free; - -------------------------------------------------------------------------------- - function Default_Menu_Options return Menu_Option_Set - is - begin - return Get_Options (Null_Menu); - end Default_Menu_Options; - - function Default_Item_Options return Item_Option_Set - is - begin - return Get_Options (Null_Item); - end Default_Item_Options; -------------------------------------------------------------------------------- - -end Terminal_Interface.Curses.Menus; diff --git a/Ada95/src/terminal_interface-curses-mouse.adb b/Ada95/src/terminal_interface-curses-mouse.adb deleted file mode 100644 index 9b403263930..00000000000 --- a/Ada95/src/terminal_interface-curses-mouse.adb +++ /dev/null @@ -1,217 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Mouse -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.24 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Interfaces.C; use Interfaces.C; -use Interfaces; - -package body Terminal_Interface.Curses.Mouse is - - use type System.Bit_Order; - - function Has_Mouse return Boolean - is - function Mouse_Avail return C_Int; - pragma Import (C, Mouse_Avail, "has_mouse"); - begin - if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then - return True; - else - return False; - end if; - end Has_Mouse; - - function Get_Mouse return Mouse_Event - is - type Event_Access is access all Mouse_Event; - - function Getmouse (Ev : Event_Access) return C_Int; - pragma Import (C, Getmouse, "getmouse"); - - Event : aliased Mouse_Event; - begin - if Getmouse (Event'Access) = Curses_Err then - raise Curses_Exception; - end if; - return Event; - end Get_Mouse; - - procedure Register_Reportable_Event (Button : Mouse_Button; - State : Button_State; - Mask : in out Event_Mask) - is - Button_Nr : constant Natural := Mouse_Button'Pos (Button); - State_Nr : constant Natural := Button_State'Pos (State); - begin - if Button in Modifier_Keys and then State /= Pressed then - raise Curses_Exception; - else - if Button in Real_Buttons then - Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr); - else - Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4)); - end if; - end if; - end Register_Reportable_Event; - - procedure Register_Reportable_Events (Button : Mouse_Button; - State : Button_States; - Mask : in out Event_Mask) - is - begin - for S in Button_States'Range loop - if State (S) then - Register_Reportable_Event (Button, S, Mask); - end if; - end loop; - end Register_Reportable_Events; - - function Start_Mouse (Mask : Event_Mask := All_Events) - return Event_Mask - is - function MMask (M : Event_Mask; - O : access Event_Mask) return Event_Mask; - pragma Import (C, MMask, "mousemask"); - R : Event_Mask; - Old : aliased Event_Mask; - begin - R := MMask (Mask, Old'Access); - if R = No_Events then - Beep; - end if; - return Old; - end Start_Mouse; - - procedure End_Mouse (Mask : Event_Mask := No_Events) - is - begin - if Mask /= No_Events then - Beep; - end if; - end End_Mouse; - - procedure Dispatch_Event (Mask : Event_Mask; - Button : out Mouse_Button; - State : out Button_State); - - procedure Dispatch_Event (Mask : Event_Mask; - Button : out Mouse_Button; - State : out Button_State) is - L : Event_Mask; - begin - Button := Alt; -- preset to non real button; - if (Mask and BUTTON1_EVENTS) /= 0 then - Button := Left; - elsif (Mask and BUTTON2_EVENTS) /= 0 then - Button := Middle; - elsif (Mask and BUTTON3_EVENTS) /= 0 then - Button := Right; - elsif (Mask and BUTTON4_EVENTS) /= 0 then - Button := Button4; - end if; - if Button in Real_Buttons then - L := 2 ** (6 * Mouse_Button'Pos (Button)); - for I in Button_State'Range loop - if (Mask and L) /= 0 then - State := I; - exit; - end if; - L := 2 * L; - end loop; - else - State := Pressed; - if (Mask and BUTTON_CTRL) /= 0 then - Button := Control; - elsif (Mask and BUTTON_SHIFT) /= 0 then - Button := Shift; - elsif (Mask and BUTTON_ALT) /= 0 then - Button := Alt; - end if; - end if; - end Dispatch_Event; - - procedure Get_Event (Event : Mouse_Event; - Y : out Line_Position; - X : out Column_Position; - Button : out Mouse_Button; - State : out Button_State) - is - Mask : constant Event_Mask := Event.Bstate; - begin - X := Column_Position (Event.X); - Y := Line_Position (Event.Y); - Dispatch_Event (Mask, Button, State); - end Get_Event; - - procedure Unget_Mouse (Event : Mouse_Event) - is - function Ungetmouse (Ev : Mouse_Event) return C_Int; - pragma Import (C, Ungetmouse, "ungetmouse"); - begin - if Ungetmouse (Event) = Curses_Err then - raise Curses_Exception; - end if; - end Unget_Mouse; - - function Enclosed_In_Window (Win : Window := Standard_Window; - Event : Mouse_Event) return Boolean - is - function Wenclose (Win : Window; Y : C_Int; X : C_Int) - return Curses_Bool; - pragma Import (C, Wenclose, "wenclose"); - begin - if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X)) - = Curses_Bool_False then - return False; - else - return True; - end if; - end Enclosed_In_Window; - - function Mouse_Interval (Msec : Natural := 200) return Natural - is - function Mouseinterval (Msec : C_Int) return C_Int; - pragma Import (C, Mouseinterval, "mouseinterval"); - begin - return Natural (Mouseinterval (C_Int (Msec))); - end Mouse_Interval; - -end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/src/terminal_interface-curses-panels-user_data.adb b/Ada95/src/terminal_interface-curses-panels-user_data.adb deleted file mode 100644 index d855f5423c7..00000000000 --- a/Ada95/src/terminal_interface-curses-panels-user_data.adb +++ /dev/null @@ -1,78 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Panels.User_Data -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Interfaces.C; -with Terminal_Interface.Curses.Aux; -use Terminal_Interface.Curses.Aux; -with Terminal_Interface.Curses.Panels; -use Terminal_Interface.Curses.Panels; - -package body Terminal_Interface.Curses.Panels.User_Data is - - use type Interfaces.C.int; - - procedure Set_User_Data (Pan : Panel; - Data : User_Access) - is - function Set_Panel_Userptr (Pan : Panel; - Addr : User_Access) return C_Int; - pragma Import (C, Set_Panel_Userptr, "set_panel_userptr"); - begin - if Set_Panel_Userptr (Pan, Data) = Curses_Err then - raise Panel_Exception; - end if; - end Set_User_Data; - - function Get_User_Data (Pan : Panel) return User_Access - is - function Panel_Userptr (Pan : Panel) return User_Access; - pragma Import (C, Panel_Userptr, "panel_userptr"); - begin - return Panel_Userptr (Pan); - end Get_User_Data; - - procedure Get_User_Data (Pan : Panel; - Data : out User_Access) - is - begin - Data := Get_User_Data (Pan); - end Get_User_Data; - -end Terminal_Interface.Curses.Panels.User_Data; diff --git a/Ada95/src/terminal_interface-curses-panels.adb b/Ada95/src/terminal_interface-curses-panels.adb deleted file mode 100644 index 84e29e519c2..00000000000 --- a/Ada95/src/terminal_interface-curses-panels.adb +++ /dev/null @@ -1,165 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Panels -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2004,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.14 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Interfaces.C; - -package body Terminal_Interface.Curses.Panels is - - use type Interfaces.C.int; - - function Create (Win : Window) return Panel - is - function Newpanel (Win : Window) return Panel; - pragma Import (C, Newpanel, "new_panel"); - - Pan : Panel; - begin - Pan := Newpanel (Win); - if Pan = Null_Panel then - raise Panel_Exception; - end if; - return Pan; - end Create; - - procedure Bottom (Pan : Panel) - is - function Bottompanel (Pan : Panel) return C_Int; - pragma Import (C, Bottompanel, "bottom_panel"); - begin - if Bottompanel (Pan) = Curses_Err then - raise Panel_Exception; - end if; - end Bottom; - - procedure Top (Pan : Panel) - is - function Toppanel (Pan : Panel) return C_Int; - pragma Import (C, Toppanel, "top_panel"); - begin - if Toppanel (Pan) = Curses_Err then - raise Panel_Exception; - end if; - end Top; - - procedure Show (Pan : Panel) - is - function Showpanel (Pan : Panel) return C_Int; - pragma Import (C, Showpanel, "show_panel"); - begin - if Showpanel (Pan) = Curses_Err then - raise Panel_Exception; - end if; - end Show; - - procedure Hide (Pan : Panel) - is - function Hidepanel (Pan : Panel) return C_Int; - pragma Import (C, Hidepanel, "hide_panel"); - begin - if Hidepanel (Pan) = Curses_Err then - raise Panel_Exception; - end if; - end Hide; - - function Get_Window (Pan : Panel) return Window - is - function Panel_Win (Pan : Panel) return Window; - pragma Import (C, Panel_Win, "panel_window"); - - Win : constant Window := Panel_Win (Pan); - begin - if Win = Null_Window then - raise Panel_Exception; - end if; - return Win; - end Get_Window; - - procedure Replace (Pan : Panel; - Win : Window) - is - function Replace_Pan (Pan : Panel; - Win : Window) return C_Int; - pragma Import (C, Replace_Pan, "replace_panel"); - begin - if Replace_Pan (Pan, Win) = Curses_Err then - raise Panel_Exception; - end if; - end Replace; - - procedure Move (Pan : Panel; - Line : Line_Position; - Column : Column_Position) - is - function Move (Pan : Panel; - Line : C_Int; - Column : C_Int) return C_Int; - pragma Import (C, Move, "move_panel"); - begin - if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then - raise Panel_Exception; - end if; - end Move; - - function Is_Hidden (Pan : Panel) return Boolean - is - function Panel_Hidden (Pan : Panel) return C_Int; - pragma Import (C, Panel_Hidden, "panel_hidden"); - begin - if Panel_Hidden (Pan) = Curses_False then - return False; - else - return True; - end if; - end Is_Hidden; - - procedure Delete (Pan : in out Panel) - is - function Del_Panel (Pan : Panel) return C_Int; - pragma Import (C, Del_Panel, "del_panel"); - begin - if Del_Panel (Pan) = Curses_Err then - raise Panel_Exception; - end if; - Pan := Null_Panel; - end Delete; - -end Terminal_Interface.Curses.Panels; diff --git a/Ada95/src/terminal_interface-curses-putwin.adb b/Ada95/src/terminal_interface-curses-putwin.adb deleted file mode 100644 index 986cd6b9bd6..00000000000 --- a/Ada95/src/terminal_interface-curses-putwin.adb +++ /dev/null @@ -1,77 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.PutWin -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.3 $ --- Binding Version 01.00 - -with Ada.Streams.Stream_IO.C_Streams; -with Interfaces.C_Streams; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; - -package body Terminal_Interface.Curses.PutWin is - - package ICS renames Interfaces.C_Streams; - package ACS renames Ada.Streams.Stream_IO.C_Streams; - use type C_Int; - - procedure Put_Window (Win : Window; - File : Ada.Streams.Stream_IO.File_Type) is - function putwin (Win : Window; f : ICS.FILEs) return C_Int; - pragma Import (C, putwin, "putwin"); - - R : constant C_Int := putwin (Win, ACS.C_Stream (File)); - begin - if R /= Curses_Ok then - raise Curses_Exception; - end if; - end Put_Window; - - function Get_Window (File : Ada.Streams.Stream_IO.File_Type) - return Window is - function getwin (f : ICS.FILEs) return Window; - pragma Import (C, getwin, "getwin"); - - W : constant Window := getwin (ACS.C_Stream (File)); - begin - if W = Null_Window then - raise Curses_Exception; - else - return W; - end if; - end Get_Window; - -end Terminal_Interface.Curses.PutWin; diff --git a/Ada95/src/terminal_interface-curses-putwin.ads b/Ada95/src/terminal_interface-curses-putwin.ads deleted file mode 100644 index d302bdcec45..00000000000 --- a/Ada95/src/terminal_interface-curses-putwin.ads +++ /dev/null @@ -1,50 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.PutWin -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.3 $ --- Binding Version 01.00 - -with Ada.Streams.Stream_IO; - -package Terminal_Interface.Curses.PutWin is - - procedure Put_Window (Win : Window; - File : Ada.Streams.Stream_IO.File_Type); - - function Get_Window (File : Ada.Streams.Stream_IO.File_Type) return Window; - -end Terminal_Interface.Curses.PutWin; diff --git a/Ada95/src/terminal_interface-curses-termcap.adb b/Ada95/src/terminal_interface-curses-termcap.adb deleted file mode 100644 index 643865781fd..00000000000 --- a/Ada95/src/terminal_interface-curses-termcap.adb +++ /dev/null @@ -1,163 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Termcap -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; - -package body Terminal_Interface.Curses.Termcap is - - function Get_Entry (Name : String) return Boolean - is - function tgetent (name : char_array; val : char_array) - return C_Int; - pragma Import (C, tgetent, "tgetent"); - NameTxt : char_array (0 .. Name'Length); - Length : size_t; - ignored : constant char_array (0 .. 0) := (0 => nul); - result : C_Int; - begin - To_C (Name, NameTxt, Length); - result := tgetent (char_array (ignored), NameTxt); - if result = -1 then - raise Curses_Exception; - else - return Boolean'Val (result); - end if; - end Get_Entry; - ------------------------------------------------------------------------------- - function Get_Flag (Name : String) return Boolean - is - function tgetflag (id : char_array) return C_Int; - pragma Import (C, tgetflag, "tgetflag"); - Txt : char_array (0 .. Name'Length); - Length : size_t; - begin - To_C (Name, Txt, Length); - if tgetflag (Txt) = 0 then - return False; - else - return True; - end if; - end Get_Flag; - ------------------------------------------------------------------------------- - procedure Get_Number (Name : String; - Value : out Integer; - Result : out Boolean) - is - function tgetnum (id : char_array) return C_Int; - pragma Import (C, tgetnum, "tgetnum"); - Txt : char_array (0 .. Name'Length); - Length : size_t; - begin - To_C (Name, Txt, Length); - Value := Integer (tgetnum (Txt)); - if Value = -1 then - Result := False; - else - Result := True; - end if; - end Get_Number; - ------------------------------------------------------------------------------- - procedure Get_String (Name : String; - Value : out String; - Result : out Boolean) - is - function tgetstr (id : char_array; - buf : char_array) return chars_ptr; - pragma Import (C, tgetstr, "tgetstr"); - Txt : char_array (0 .. Name'Length); - Length : size_t; - Txt2 : chars_ptr; - type t is new char_array (0 .. 1024); -- does it need to be 1024? - Return_Buffer : constant t := (others => nul); - begin - To_C (Name, Txt, Length); - Txt2 := tgetstr (Txt, char_array (Return_Buffer)); - if Txt2 = Null_Ptr then - Result := False; - else - Value := Fill_String (Txt2); - Result := True; - end if; - end Get_String; - - function Get_String (Name : String) return Boolean - is - function tgetstr (Id : char_array; - buf : char_array) return chars_ptr; - pragma Import (C, tgetstr, "tgetstr"); - Txt : char_array (0 .. Name'Length); - Length : size_t; - Txt2 : chars_ptr; - type t is new char_array (0 .. 1024); -- does it need to be 1024? - Phony_Txt : constant t := (others => nul); - begin - To_C (Name, Txt, Length); - Txt2 := tgetstr (Txt, char_array (Phony_Txt)); - if Txt2 = Null_Ptr then - return False; - else - return True; - end if; - end Get_String; - ------------------------------------------------------------------------------- - function TGoto (Cap : String; - Col : Column_Position; - Row : Line_Position) return Termcap_String is - function tgoto (cap : char_array; - col : C_Int; - row : C_Int) return chars_ptr; - pragma Import (C, tgoto); - Txt : char_array (0 .. Cap'Length); - Length : size_t; - begin - To_C (Cap, Txt, Length); - return Termcap_String (Fill_String - (tgoto (Txt, C_Int (Col), C_Int (Row)))); - end TGoto; - -end Terminal_Interface.Curses.Termcap; diff --git a/Ada95/src/terminal_interface-curses-termcap.ads b/Ada95/src/terminal_interface-curses-termcap.ads deleted file mode 100644 index dd01396e8b0..00000000000 --- a/Ada95/src/terminal_interface-curses-termcap.ads +++ /dev/null @@ -1,80 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Termcap -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.3 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -package Terminal_Interface.Curses.Termcap is - pragma Preelaborate (Terminal_Interface.Curses.Termcap); - - -- |===================================================================== - -- | Man page curs_termcap.3x - -- |===================================================================== - -- Not implemented: tputs (see curs_terminfo) - - type Termcap_String is new String; - - -- | - function TGoto (Cap : String; - Col : Column_Position; - Row : Line_Position) return Termcap_String; - -- AKA: tgoto() - - -- | - function Get_Entry (Name : String) return Boolean; - -- AKA: tgetent() - - -- | - function Get_Flag (Name : String) return Boolean; - -- AKA: tgetflag() - - -- | - procedure Get_Number (Name : String; - Value : out Integer; - Result : out Boolean); - -- AKA: tgetnum() - - -- | - procedure Get_String (Name : String; - Value : out String; - Result : out Boolean); - function Get_String (Name : String) return Boolean; - -- Returns True if the string is found. - -- AKA: tgetstr() - -end Terminal_Interface.Curses.Termcap; diff --git a/Ada95/src/terminal_interface-curses-terminfo.adb b/Ada95/src/terminal_interface-curses-terminfo.adb deleted file mode 100644 index 9b3c9d56b33..00000000000 --- a/Ada95/src/terminal_interface-curses-terminfo.adb +++ /dev/null @@ -1,161 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Terminfo -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.6 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Ada.Unchecked_Conversion; - -package body Terminal_Interface.Curses.Terminfo is - - function Is_MinusOne_Pointer (P : chars_ptr) return Boolean; - - function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is - type Weird_Address is new System.Storage_Elements.Integer_Address; - Invalid_Pointer : constant Weird_Address := -1; - function To_Weird is new Ada.Unchecked_Conversion - (Source => chars_ptr, Target => Weird_Address); - begin - if To_Weird (P) = Invalid_Pointer then - return True; - else - return False; - end if; - end Is_MinusOne_Pointer; - pragma Inline (Is_MinusOne_Pointer); - ------------------------------------------------------------------------------- - function Get_Flag (Name : String) return Boolean - is - function tigetflag (id : char_array) return Curses_Bool; - pragma Import (C, tigetflag); - Txt : char_array (0 .. Name'Length); - Length : size_t; - begin - To_C (Name, Txt, Length); - if tigetflag (Txt) = Curses_Bool (Curses_True) then - return True; - else - return False; - end if; - end Get_Flag; - ------------------------------------------------------------------------------- - procedure Get_String (Name : String; - Value : out Terminfo_String; - Result : out Boolean) - is - function tigetstr (id : char_array) return chars_ptr; - pragma Import (C, tigetstr, "tigetstr"); - Txt : char_array (0 .. Name'Length); - Length : size_t; - Txt2 : chars_ptr; - begin - To_C (Name, Txt, Length); - Txt2 := tigetstr (Txt); - if Txt2 = Null_Ptr then - Result := False; - elsif Is_MinusOne_Pointer (Txt2) then - raise Curses_Exception; - else - Value := Terminfo_String (Fill_String (Txt2)); - Result := True; - end if; - end Get_String; - ------------------------------------------------------------------------------- - function Has_String (Name : String) return Boolean - is - function tigetstr (id : char_array) return chars_ptr; - pragma Import (C, tigetstr, "tigetstr"); - Txt : char_array (0 .. Name'Length); - Length : size_t; - Txt2 : chars_ptr; - begin - To_C (Name, Txt, Length); - Txt2 := tigetstr (Txt); - if Txt2 = Null_Ptr then - return False; - elsif Is_MinusOne_Pointer (Txt2) then - raise Curses_Exception; - else - return True; - end if; - end Has_String; - ------------------------------------------------------------------------------- - function Get_Number (Name : String) return Integer is - function tigetstr (s : char_array) return C_Int; - pragma Import (C, tigetstr); - Txt : char_array (0 .. Name'Length); - Length : size_t; - begin - To_C (Name, Txt, Length); - return Integer (tigetstr (Txt)); - end Get_Number; - ------------------------------------------------------------------------------- - procedure Put_String (Str : Terminfo_String; - affcnt : Natural := 1; - putc : putctype := null) is - function tputs (str : char_array; - affcnt : C_Int; - putc : putctype) return C_Int; - function putp (str : char_array) return C_Int; - pragma Import (C, tputs); - pragma Import (C, putp); - Txt : char_array (0 .. Str'Length); - Length : size_t; - Err : C_Int; - begin - To_C (String (Str), Txt, Length); - if putc = null then - Err := putp (Txt); - else - Err := tputs (Txt, C_Int (affcnt), putc); - end if; - if Err = Curses_Err then - raise Curses_Exception; - end if; - end Put_String; - -end Terminal_Interface.Curses.Terminfo; diff --git a/Ada95/src/terminal_interface-curses-terminfo.ads b/Ada95/src/terminal_interface-curses-terminfo.ads deleted file mode 100644 index fb39bf1ed6f..00000000000 --- a/Ada95/src/terminal_interface-curses-terminfo.ads +++ /dev/null @@ -1,81 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Terminfo -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.3 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- - -with Interfaces.C; - -package Terminal_Interface.Curses.Terminfo is - pragma Preelaborate (Terminal_Interface.Curses.Terminfo); - - -- |===================================================================== - -- | Man page curs_terminfo.3x - -- |===================================================================== - -- Not implemented: setupterm, setterm, set_curterm, del_curterm, - -- restartterm, tparm, putp, vidputs, vidattr, - -- mvcur - - type Terminfo_String is new String; - - -- | - procedure Get_String (Name : String; - Value : out Terminfo_String; - Result : out Boolean); - function Has_String (Name : String) return Boolean; - -- AKA: tigetstr() - - -- | - function Get_Flag (Name : String) return Boolean; - -- AKA: tigetflag() - - -- | - function Get_Number (Name : String) return Integer; - -- AKA: tigetnum() - - type putctype is access function (c : Interfaces.C.int) - return Interfaces.C.int; - pragma Convention (C, putctype); - - -- | - procedure Put_String (Str : Terminfo_String; - affcnt : Natural := 1; - putc : putctype := null); - -- AKA: tputs() - -end Terminal_Interface.Curses.Terminfo; diff --git a/Ada95/src/terminal_interface-curses-text_io-aux.adb b/Ada95/src/terminal_interface-curses-text_io-aux.adb deleted file mode 100644 index 50a4e4461ba..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-aux.adb +++ /dev/null @@ -1,128 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Aux -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.13 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package body Terminal_Interface.Curses.Text_IO.Aux is - - procedure Put_Buf - (Win : Window; - Buf : String; - Width : Field; - Signal : Boolean := True; - Ljust : Boolean := False) - is - L : Field; - Len : Field; - W : Field := Width; - LC : Line_Count; - CC : Column_Count; - Y : Line_Position; - X : Column_Position; - - procedure Output (From, To : Field); - - procedure Output (From, To : Field) - is - begin - if Len > 0 then - if W = 0 then - W := Len; - end if; - if Len > W then - -- LRM A10.6 (7) says this - W := Len; - end if; - - pragma Assert (Len <= W); - Get_Size (Win, LC, CC); - if Column_Count (Len) > CC then - if Signal then - raise Layout_Error; - else - return; - end if; - else - if Len < W and then not Ljust then - declare - Filler : constant String (1 .. (W - Len)) - := (others => ' '); - begin - Put (Win, Filler); - end; - end if; - Get_Cursor_Position (Win, Y, X); - if (X + Column_Position (Len)) > CC then - New_Line (Win); - end if; - Put (Win, Buf (From .. To)); - if Len < W and then Ljust then - declare - Filler : constant String (1 .. (W - Len)) - := (others => ' '); - begin - Put (Win, Filler); - end; - end if; - end if; - end if; - end Output; - - begin - pragma Assert (Win /= Null_Window); - if Ljust then - L := 1; - for I in 1 .. Buf'Length loop - exit when Buf (L) = ' '; - L := L + 1; - end loop; - Len := L - 1; - Output (1, Len); - else -- input buffer is not left justified - L := Buf'Length; - for I in 1 .. Buf'Length loop - exit when Buf (L) = ' '; - L := L - 1; - end loop; - Len := Buf'Length - L; - Output (L + 1, Buf'Length); - end if; - end Put_Buf; - -end Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/src/terminal_interface-curses-text_io-aux.ads b/Ada95/src/terminal_interface-curses-text_io-aux.ads deleted file mode 100644 index 6b50b339506..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-aux.ads +++ /dev/null @@ -1,55 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Aux -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.14 $ --- $Date: 2009/12/26 17:38:58 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -private package Terminal_Interface.Curses.Text_IO.Aux is - -- pragma Preelaborate (Aux); - - -- This routine is called from the Text_IO output routines for numeric - -- and enumeration types. - -- - procedure Put_Buf - (Win : Window; -- The output window - Buf : String; -- The buffer containing the text - Width : Field; -- The width of the output field - Signal : Boolean := True; -- If true, we raise Layout_Error - Ljust : Boolean := False); -- The Buf is left justified - -end Terminal_Interface.Curses.Text_IO.Aux; diff --git a/Ada95/src/terminal_interface-curses-text_io-complex_io.adb b/Ada95/src/terminal_interface-curses-text_io-complex_io.adb deleted file mode 100644 index 6c2e144eb37..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-complex_io.adb +++ /dev/null @@ -1,73 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Complex_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Terminal_Interface.Curses.Text_IO.Float_IO; - -package body Terminal_Interface.Curses.Text_IO.Complex_IO is - - package FIO is new - Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base); - - procedure Put - (Win : Window; - Item : Complex; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) - is - begin - Put (Win, '('); - FIO.Put (Win, Item.Re, Fore, Aft, Exp); - Put (Win, ','); - FIO.Put (Win, Item.Im, Fore, Aft, Exp); - Put (Win, ')'); - end Put; - - procedure Put - (Item : Complex; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) - is - begin - Put (Get_Window, Item, Fore, Aft, Exp); - end Put; - -end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-complex_io.ads b/Ada95/src/terminal_interface-curses-text_io-complex_io.ads deleted file mode 100644 index e61345895d1..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-complex_io.ads +++ /dev/null @@ -1,70 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Complex_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Numerics.Generic_Complex_Types; - -generic - with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>); - -package Terminal_Interface.Curses.Text_IO.Complex_IO is - - use Complex_Types; - - Default_Fore : Field := 2; - Default_Aft : Field := Real'Digits - 1; - Default_Exp : Field := 3; - - procedure Put - (Win : Window; - Item : Complex; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - - procedure Put - (Item : Complex; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb b/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb deleted file mode 100644 index 1b1ad8cbf2e..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-decimal_io.adb +++ /dev/null @@ -1,75 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Decimal_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Terminal_Interface.Curses.Text_IO.Aux; - -package body Terminal_Interface.Curses.Text_IO.Decimal_IO is - - package Aux renames Terminal_Interface.Curses.Text_IO.Aux; - package DIO is new Ada.Text_IO.Decimal_IO (Num); - - procedure Put - (Win : Window; - Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) - is - Buf : String (1 .. Field'Last); - Len : Field := Fore + 1 + Aft; - begin - if Exp > 0 then - Len := Len + 1 + Exp; - end if; - DIO.Put (Buf, Item, Aft, Exp); - Aux.Put_Buf (Win, Buf, Len, False); - end Put; - - procedure Put - (Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) is - begin - Put (Get_Window, Item, Fore, Aft, Exp); - end Put; - -end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads b/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads deleted file mode 100644 index 1590127451e..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-decimal_io.ads +++ /dev/null @@ -1,66 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Decimal_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type Num is delta <> digits <>; - -package Terminal_Interface.Curses.Text_IO.Decimal_IO is - - Default_Fore : Field := Num'Fore; - Default_Aft : Field := Num'Aft; - Default_Exp : Field := 0; - - procedure Put - (Win : Window; - Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - - procedure Put - (Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb deleted file mode 100644 index 53f3e55ec83..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.adb +++ /dev/null @@ -1,80 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Ada.Characters.Handling; use Ada.Characters.Handling; -with Terminal_Interface.Curses.Text_IO.Aux; - -package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is - - package Aux renames Terminal_Interface.Curses.Text_IO.Aux; - package EIO is new Ada.Text_IO.Enumeration_IO (Enum); - - procedure Put - (Win : Window; - Item : Enum; - Width : Field := Default_Width; - Set : Type_Set := Default_Setting) - is - Buf : String (1 .. Field'Last); - Tset : Ada.Text_IO.Type_Set; - begin - if Set /= Mixed_Case then - Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set)); - else - Tset := Ada.Text_IO.Lower_Case; - end if; - EIO.Put (Buf, Item, Tset); - if Set = Mixed_Case then - Buf (Buf'First) := To_Upper (Buf (Buf'First)); - end if; - Aux.Put_Buf (Win, Buf, Width, True, True); - end Put; - - procedure Put - (Item : Enum; - Width : Field := Default_Width; - Set : Type_Set := Default_Setting) - is - begin - Put (Get_Window, Item, Width, Set); - end Put; - -end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads b/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads deleted file mode 100644 index a981f0ebc57..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-enumeration_io.ads +++ /dev/null @@ -1,63 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type Enum is (<>); - -package Terminal_Interface.Curses.Text_IO.Enumeration_IO is - - Default_Width : Field := 0; - Default_Setting : Type_Set := Mixed_Case; - - procedure Put - (Win : Window; - Item : Enum; - Width : Field := Default_Width; - Set : Type_Set := Default_Setting); - - procedure Put - (Item : Enum; - Width : Field := Default_Width; - Set : Type_Set := Default_Setting); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb b/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb deleted file mode 100644 index 13a34202389..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-fixed_io.adb +++ /dev/null @@ -1,75 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Fixed_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Terminal_Interface.Curses.Text_IO.Aux; - -package body Terminal_Interface.Curses.Text_IO.Fixed_IO is - - package Aux renames Terminal_Interface.Curses.Text_IO.Aux; - package FIXIO is new Ada.Text_IO.Fixed_IO (Num); - - procedure Put - (Win : Window; - Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) - is - Buf : String (1 .. Field'Last); - Len : Field := Fore + 1 + Aft; - begin - if Exp > 0 then - Len := Len + 1 + Exp; - end if; - FIXIO.Put (Buf, Item, Aft, Exp); - Aux.Put_Buf (Win, Buf, Len, False); - end Put; - - procedure Put - (Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) is - begin - Put (Get_Window, Item, Fore, Aft, Exp); - end Put; - -end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads b/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads deleted file mode 100644 index 3c22a01479c..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-fixed_io.ads +++ /dev/null @@ -1,66 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Fixed_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type Num is delta <>; - -package Terminal_Interface.Curses.Text_IO.Fixed_IO is - - Default_Fore : Field := Num'Fore; - Default_Aft : Field := Num'Aft; - Default_Exp : Field := 0; - - procedure Put - (Win : Window; - Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - - procedure Put - (Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-float_io.adb b/Ada95/src/terminal_interface-curses-text_io-float_io.adb deleted file mode 100644 index af667b4cd17..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-float_io.adb +++ /dev/null @@ -1,76 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Float_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Terminal_Interface.Curses.Text_IO.Aux; - -package body Terminal_Interface.Curses.Text_IO.Float_IO is - - package Aux renames Terminal_Interface.Curses.Text_IO.Aux; - package FIO is new Ada.Text_IO.Float_IO (Num); - - procedure Put - (Win : Window; - Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) - is - Buf : String (1 .. Field'Last); - Len : Field := Fore + 1 + Aft; - begin - if Exp > 0 then - Len := Len + 1 + Exp; - end if; - FIO.Put (Buf, Item, Aft, Exp); - Aux.Put_Buf (Win, Buf, Len, False); - end Put; - - procedure Put - (Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp) - is - begin - Put (Get_Window, Item, Fore, Aft, Exp); - end Put; - -end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-float_io.ads b/Ada95/src/terminal_interface-curses-text_io-float_io.ads deleted file mode 100644 index b0a68d029eb..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-float_io.ads +++ /dev/null @@ -1,66 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Float_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type Num is digits <>; - -package Terminal_Interface.Curses.Text_IO.Float_IO is - - Default_Fore : Field := 2; - Default_Aft : Field := Num'Digits - 1; - Default_Exp : Field := 3; - - procedure Put - (Win : Window; - Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - - procedure Put - (Item : Num; - Fore : Field := Default_Fore; - Aft : Field := Default_Aft; - Exp : Field := Default_Exp); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-integer_io.adb b/Ada95/src/terminal_interface-curses-text_io-integer_io.adb deleted file mode 100644 index 4d19c42e883..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-integer_io.adb +++ /dev/null @@ -1,70 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Integer_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Terminal_Interface.Curses.Text_IO.Aux; - -package body Terminal_Interface.Curses.Text_IO.Integer_IO is - - package Aux renames Terminal_Interface.Curses.Text_IO.Aux; - package IIO is new Ada.Text_IO.Integer_IO (Num); - - procedure Put - (Win : Window; - Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base) - is - Buf : String (1 .. Field'Last); - begin - IIO.Put (Buf, Item, Base); - Aux.Put_Buf (Win, Buf, Width); - end Put; - - procedure Put - (Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base) - is - begin - Put (Get_Window, Item, Width, Base); - end Put; - -end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-integer_io.ads b/Ada95/src/terminal_interface-curses-text_io-integer_io.ads deleted file mode 100644 index 9ffe1e01816..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-integer_io.ads +++ /dev/null @@ -1,63 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Integer_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type Num is range <>; - -package Terminal_Interface.Curses.Text_IO.Integer_IO is - - Default_Width : Field := Num'Width; - Default_Base : Number_Base := 10; - - procedure Put - (Win : Window; - Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base); - - procedure Put - (Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-modular_io.adb b/Ada95/src/terminal_interface-curses-text_io-modular_io.adb deleted file mode 100644 index fe8a6d0b155..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-modular_io.adb +++ /dev/null @@ -1,70 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Modular_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.11 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Terminal_Interface.Curses.Text_IO.Aux; - -package body Terminal_Interface.Curses.Text_IO.Modular_IO is - - package Aux renames Terminal_Interface.Curses.Text_IO.Aux; - package MIO is new Ada.Text_IO.Modular_IO (Num); - - procedure Put - (Win : Window; - Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base) - is - Buf : String (1 .. Field'Last); - begin - MIO.Put (Buf, Item, Base); - Aux.Put_Buf (Win, Buf, Width); - end Put; - - procedure Put - (Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base) - is - begin - Put (Get_Window, Item, Width, Base); - end Put; - -end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io-modular_io.ads b/Ada95/src/terminal_interface-curses-text_io-modular_io.ads deleted file mode 100644 index 68e70e556bf..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io-modular_io.ads +++ /dev/null @@ -1,63 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO.Modular_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.12 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -generic - type Num is mod <>; - -package Terminal_Interface.Curses.Text_IO.Modular_IO is - - Default_Width : Field := Num'Width; - Default_Base : Number_Base := 10; - - procedure Put - (Win : Window; - Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base); - - procedure Put - (Item : Num; - Width : Field := Default_Width; - Base : Number_Base := Default_Base); - -private - pragma Inline (Put); - -end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io.adb b/Ada95/src/terminal_interface-curses-text_io.adb deleted file mode 100644 index e2ca27f208e..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io.adb +++ /dev/null @@ -1,338 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.20 $ --- $Date: 2011/03/22 23:38:49 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package body Terminal_Interface.Curses.Text_IO is - - Default_Window : Window := Null_Window; - - procedure Set_Window (Win : Window) - is - begin - Default_Window := Win; - end Set_Window; - - function Get_Window return Window - is - begin - if Default_Window = Null_Window then - return Standard_Window; - else - return Default_Window; - end if; - end Get_Window; - pragma Inline (Get_Window); - - procedure Flush (Win : Window) - is - begin - Refresh (Win); - end Flush; - - procedure Flush - is - begin - Flush (Get_Window); - end Flush; - - -------------------------------------------- - -- Specification of line and page lengths -- - -------------------------------------------- - - -- There are no set routines in this package. I assume, that you allocate - -- the window with an appropriate size. - -- A scroll-window is interpreted as an page with unbounded page length, - -- i.e. it returns the conventional 0 as page length. - - function Line_Length (Win : Window) return Count - is - N_Lines : Line_Count; - N_Cols : Column_Count; - begin - Get_Size (Win, N_Lines, N_Cols); - -- if Natural (N_Cols) > Natural (Count'Last) then - -- raise Layout_Error; - -- end if; - return Count (N_Cols); - end Line_Length; - - function Line_Length return Count - is - begin - return Line_Length (Get_Window); - end Line_Length; - - function Page_Length (Win : Window) return Count - is - N_Lines : Line_Count; - N_Cols : Column_Count; - begin - if Scrolling_Allowed (Win) then - return 0; - else - Get_Size (Win, N_Lines, N_Cols); - -- if Natural (N_Lines) > Natural (Count'Last) then - -- raise Layout_Error; - -- end if; - return Count (N_Lines); - end if; - end Page_Length; - - function Page_Length return Count - is - begin - return Page_Length (Get_Window); - end Page_Length; - - ------------------------------------ - -- Column, Line, and Page Control -- - ------------------------------------ - procedure New_Line (Win : Window; Spacing : Positive_Count := 1) - is - P_Size : constant Count := Page_Length (Win); - begin - if not Spacing'Valid then - raise Constraint_Error; - end if; - - for I in 1 .. Spacing loop - if P_Size > 0 and then Line (Win) >= P_Size then - New_Page (Win); - else - Add (Win, ASCII.LF); - end if; - end loop; - end New_Line; - - procedure New_Line (Spacing : Positive_Count := 1) - is - begin - New_Line (Get_Window, Spacing); - end New_Line; - - procedure New_Page (Win : Window) - is - begin - Clear (Win); - end New_Page; - - procedure New_Page - is - begin - New_Page (Get_Window); - end New_Page; - - procedure Set_Col (Win : Window; To : Positive_Count) - is - Y : Line_Position; - X1 : Column_Position; - X2 : Column_Position; - N : Natural; - begin - if not To'Valid then - raise Constraint_Error; - end if; - - Get_Cursor_Position (Win, Y, X1); - N := Natural (To); N := N - 1; - X2 := Column_Position (N); - if X1 > X2 then - New_Line (Win, 1); - X1 := 0; - end if; - if X1 < X2 then - declare - Filler : constant String (Integer (X1) .. (Integer (X2) - 1)) - := (others => ' '); - begin - Put (Win, Filler); - end; - end if; - end Set_Col; - - procedure Set_Col (To : Positive_Count) - is - begin - Set_Col (Get_Window, To); - end Set_Col; - - procedure Set_Line (Win : Window; To : Positive_Count) - is - Y1 : Line_Position; - Y2 : Line_Position; - X : Column_Position; - N : Natural; - begin - if not To'Valid then - raise Constraint_Error; - end if; - - Get_Cursor_Position (Win, Y1, X); - pragma Unreferenced (X); - N := Natural (To); N := N - 1; - Y2 := Line_Position (N); - if Y2 < Y1 then - New_Page (Win); - Y1 := 0; - end if; - if Y1 < Y2 then - New_Line (Win, Positive_Count (Y2 - Y1)); - end if; - end Set_Line; - - procedure Set_Line (To : Positive_Count) - is - begin - Set_Line (Get_Window, To); - end Set_Line; - - function Col (Win : Window) return Positive_Count - is - Y : Line_Position; - X : Column_Position; - N : Natural; - begin - Get_Cursor_Position (Win, Y, X); - N := Natural (X); N := N + 1; - -- if N > Natural (Count'Last) then - -- raise Layout_Error; - -- end if; - return Positive_Count (N); - end Col; - - function Col return Positive_Count - is - begin - return Col (Get_Window); - end Col; - - function Line (Win : Window) return Positive_Count - is - Y : Line_Position; - X : Column_Position; - N : Natural; - begin - Get_Cursor_Position (Win, Y, X); - N := Natural (Y); N := N + 1; - -- if N > Natural (Count'Last) then - -- raise Layout_Error; - -- end if; - return Positive_Count (N); - end Line; - - function Line return Positive_Count - is - begin - return Line (Get_Window); - end Line; - - ----------------------- - -- Characters Output -- - ----------------------- - - procedure Put (Win : Window; Item : Character) - is - P_Size : constant Count := Page_Length (Win); - Y : Line_Position; - X : Column_Position; - L : Line_Count; - C : Column_Count; - begin - if P_Size > 0 then - Get_Cursor_Position (Win, Y, X); - Get_Size (Win, L, C); - if (Y + 1) = L and then (X + 1) = C then - New_Page (Win); - end if; - end if; - Add (Win, Item); - end Put; - - procedure Put (Item : Character) - is - begin - Put (Get_Window, Item); - end Put; - - -------------------- - -- Strings-Output -- - -------------------- - - procedure Put (Win : Window; Item : String) - is - P_Size : constant Count := Page_Length (Win); - Y : Line_Position; - X : Column_Position; - L : Line_Count; - C : Column_Count; - begin - if P_Size > 0 then - Get_Cursor_Position (Win, Y, X); - Get_Size (Win, L, C); - if (Y + 1) = L and then (X + 1 + Item'Length) >= C then - New_Page (Win); - end if; - end if; - Add (Win, Item); - end Put; - - procedure Put (Item : String) - is - begin - Put (Get_Window, Item); - end Put; - - procedure Put_Line - (Win : Window; - Item : String) - is - begin - Put (Win, Item); - New_Line (Win, 1); - end Put_Line; - - procedure Put_Line - (Item : String) - is - begin - Put_Line (Get_Window, Item); - end Put_Line; - -end Terminal_Interface.Curses.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-text_io.ads b/Ada95/src/terminal_interface-curses-text_io.ads deleted file mode 100644 index 9c40329ff4b..00000000000 --- a/Ada95/src/terminal_interface-curses-text_io.ads +++ /dev/null @@ -1,136 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Text_IO -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2003,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.14 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -with Ada.Text_IO; -with Ada.IO_Exceptions; - -package Terminal_Interface.Curses.Text_IO is - - use type Ada.Text_IO.Count; - subtype Count is Ada.Text_IO.Count; - subtype Positive_Count is Count range 1 .. Count'Last; - - subtype Field is Ada.Text_IO.Field; - subtype Number_Base is Integer range 2 .. 16; - - type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); - - -- For most of the routines you will see a version without a Window - -- type parameter. They will operate on a default window, which can - -- be set by the user. It is initially equal to Standard_Window. - - procedure Set_Window (Win : Window); - -- Set Win as the default window - - function Get_Window return Window; - -- Get the current default window - - procedure Flush (Win : Window); - procedure Flush; - - -------------------------------------------- - -- Specification of line and page lengths -- - -------------------------------------------- - - -- There are no set routines in this package. I assume, that you allocate - -- the window with an appropriate size. - -- A scroll-window is interpreted as an page with unbounded page length, - -- i.e. it returns the conventional 0 as page length. - - function Line_Length (Win : Window) return Count; - function Line_Length return Count; - - function Page_Length (Win : Window) return Count; - function Page_Length return Count; - - ------------------------------------ - -- Column, Line, and Page Control -- - ------------------------------------ - procedure New_Line (Win : Window; Spacing : Positive_Count := 1); - procedure New_Line (Spacing : Positive_Count := 1); - - procedure New_Page (Win : Window); - procedure New_Page; - - procedure Set_Col (Win : Window; To : Positive_Count); - procedure Set_Col (To : Positive_Count); - - procedure Set_Line (Win : Window; To : Positive_Count); - procedure Set_Line (To : Positive_Count); - - function Col (Win : Window) return Positive_Count; - function Col return Positive_Count; - - function Line (Win : Window) return Positive_Count; - function Line return Positive_Count; - - ----------------------- - -- Characters-Output -- - ----------------------- - - procedure Put (Win : Window; Item : Character); - procedure Put (Item : Character); - - -------------------- - -- Strings-Output -- - -------------------- - - procedure Put (Win : Window; Item : String); - procedure Put (Item : String); - - procedure Put_Line - (Win : Window; - Item : String); - - procedure Put_Line - (Item : String); - - -- Exceptions - - Status_Error : exception renames Ada.IO_Exceptions.Status_Error; - Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error; - Name_Error : exception renames Ada.IO_Exceptions.Name_Error; - Use_Error : exception renames Ada.IO_Exceptions.Use_Error; - Device_Error : exception renames Ada.IO_Exceptions.Device_Error; - End_Error : exception renames Ada.IO_Exceptions.End_Error; - Data_Error : exception renames Ada.IO_Exceptions.Data_Error; - Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error; - -end Terminal_Interface.Curses.Text_IO; diff --git a/Ada95/src/terminal_interface-curses-trace.adb_p b/Ada95/src/terminal_interface-curses-trace.adb_p deleted file mode 100644 index d2117a4cef1..00000000000 --- a/Ada95/src/terminal_interface-curses-trace.adb_p +++ /dev/null @@ -1,97 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Trace -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 2000-2004,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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.7 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -#if ADA_TRACE then -with Interfaces.C; use Interfaces.C; -with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Ada.Unchecked_Conversion; -#end if; - -package body Terminal_Interface.Curses.Trace is - -#if ADA_TRACE then - type C_TraceType is new C_UInt; - - function TraceAda_To_TraceC is new - Ada.Unchecked_Conversion (Source => Trace_Attribute_Set, - Target => C_TraceType); - - procedure Trace_On (x : Trace_Attribute_Set) is - procedure traceC (y : C_TraceType); - pragma Import (C, traceC, "trace"); - begin - traceC (TraceAda_To_TraceC (x)); - end Trace_On; - - -- 75. (12) A C function that takes a variable number of arguments can - -- correspond to several Ada subprograms, taking various specific - -- numbers and types of parameters. - - procedure Trace_Put (str : String) is - procedure tracef (format : char_array; s : char_array); - pragma Import (C, tracef, "_traces"); - Txt : char_array (0 .. str'Length); - Length : size_t; - formatstr : constant String := "%s" & ASCII.NUL; - formattxt : char_array (0 .. formatstr'Length); - begin - To_C (formatstr, formattxt, Length); - To_C (str, Txt, Length); - tracef (formattxt, Txt); - end Trace_Put; -#else - procedure Trace_On (x : Trace_Attribute_Set) is -#if PRAGMA_UNREF - pragma Unreferenced (x); -#end if; - begin - null; - end Trace_On; - - procedure Trace_Put (str : String) is -#if PRAGMA_UNREF - pragma Unreferenced (str); -#end if; - begin - null; - end Trace_Put; -#end if; - -end Terminal_Interface.Curses.Trace; diff --git a/Ada95/src/terminal_interface.ads b/Ada95/src/terminal_interface.ads deleted file mode 100644 index fdaaf9fe727..00000000000 --- a/Ada95/src/terminal_interface.ads +++ /dev/null @@ -1,47 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface -- --- -- --- S P E C -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: Juergen Pfeifer, 1996 --- Version Control: --- $Revision: 1.14 $ --- $Date: 2006/06/25 14:30:22 $ --- Binding Version 01.00 ------------------------------------------------------------------------------- -package Terminal_Interface is - pragma Pure (Terminal_Interface); --- --- Everything is in the child units --- -end Terminal_Interface; diff --git a/INSTALL b/INSTALL index eb26ab103ef..ab7dcd82995 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- +-- Copyright (c) 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 -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $ +-- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -39,8 +39,9 @@ d.d is the current version number. There should be several subdirectories, including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs', and `test'. See the README file for a roadmap to the package. -If you are a distribution integrator or packager, please read and act on the -section titled IF YOU ARE A SYSTEM INTEGRATOR below. +If you are a Linux or FreeBSD or NetBSD distribution integrator or packager, +please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR +below. If you are converting from BSD curses and do not have root access, be sure to read the BSD CONVERSION NOTES section below. @@ -57,6 +58,10 @@ CROSS-COMPILER. If you want to build the Ada95 binding, go to the Ada95 directory and follow the instructions there. The Ada95 binding is not covered below. +If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based +i386 Unixes, go read the Portability section in the TO-DO file before you +do anything else. + REQUIREMENTS: ------------ @@ -81,14 +86,14 @@ INSTALLATION PROCEDURE: The --prefix option to configure changes the root directory for installing ncurses. The default is normally in subdirectories of /usr/local, except - for systems where ncurses is normally installed as a system library (see - "IF YOU ARE A SYSTEM INTEGRATOR"). Use --prefix=/usr to replace your - default curses distribution. + for systems where ncurses is normally installed as a system library, e.g., + Linux, the various BSD systems and Cygwin. Use --prefix=/usr to replace + your default curses distribution. The package gets installed beneath the --prefix directory as follows: In $(prefix)/bin: tic, infocmp, captoinfo, tset, - reset, clear, tput, toe, tabs + reset, clear, tput, toe In $(prefix)/lib: libncurses*.* libcurses.a In $(prefix)/share/terminfo: compiled terminal descriptions In $(prefix)/include: C header files @@ -100,12 +105,12 @@ INSTALLATION PROCEDURE: Do not use commands such as - make install prefix=XXX + make install prefix=XXX to change the prefix after configuration, since the prefix value is used for some absolute pathnames such as TERMINFO. Instead do this - make install DESTDIR=XXX + make install DESTDIR=XXX See also the discussion of --with-install-prefix. @@ -142,7 +147,7 @@ INSTALLATION PROCEDURE: library interfaces are not binary-compatible with the non-wide-character version. Building and running the wide-character code relies on a fairly recent implementation of libiconv. We have built this configuration on - various systems using libiconv, sometimes requiring libutf8. + Linux using libiconv, sometimes requiring libutf8. If you configure using the --with-pthread option, a "t" is appended to the library names (e.g., libncursest.a, libncursestw.a). @@ -165,8 +170,8 @@ INSTALLATION PROCEDURE: ./configure --with-shared --without-normal --without-debug Rules for generating shared libraries are highly dependent upon the choice - of host system and compiler. We've been testing shared libraries on - several systems, but more work needs to be done to make shared libraries + of host system and compiler. We've been testing shared libraries on Linux + and SunOS with gcc, but more work needs to be done to make shared libraries work on other systems. If you have libtool installed, you can type @@ -333,17 +338,6 @@ SUMMARY OF CONFIGURE OPTIONS: --disable-largefile Disable compiler flags needed to use large-file interfaces. - --disable-libtool-version - when using --with-libtool, control how the major/minor version numbers - are used for constructing the library name. - - The default uses the -version-number feature of libtool, which makes - the library names compatible (though not identical) with the standard - build using --with-shared. - - Use --disable-libtool-version to use the libtool -version-info feature. - This corresponds to the setting used before patch 20100515. - --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. @@ -395,12 +389,6 @@ SUMMARY OF CONFIGURE OPTIONS: application. These are (for example $TERMINFO) those that allow the search path for the terminfo or termcap entry to be customized. - --disable-rpath-hack - Normally the configure script helps link libraries found in unusual - places by adding an rpath option to the link command. If you are - building packages, this feature may be redundant. Use this option - to suppress the feature. - --disable-scroll-hints Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. @@ -433,7 +421,7 @@ SUMMARY OF CONFIGURE OPTIONS: changes several data references to functions to work around this problem. - NOTE: With ncurses 5.1, this may not be necessary, since we are + NOTE: With ncurses 5.1, this may not be necessary, since we are told that some linkers interpret uninitialized global data as a different type of reference which behaves as described above. We have explicitly initialized all of the global data to work around the @@ -462,7 +450,7 @@ SUMMARY OF CONFIGURE OPTIONS: warning. There will still be warnings due to subtle inconsistencies in the interface, but at a lower level. - NOTE: configuring ncurses with this option may detract from the + NOTE: configuring ncurses with this option may detract from the portability of your applications by encouraging you to use const in places where the XSI curses interface would not allow them. Similar issues arise when porting to SVr4 curses, which uses const in even @@ -483,7 +471,7 @@ SUMMARY OF CONFIGURE OPTIONS: encoded. This applies only to the wide-character (--enable-widec) configuration. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have an array of cchar_t's must be recompiled. @@ -492,7 +480,7 @@ SUMMARY OF CONFIGURE OPTIONS: That allows one to use ncurses with a wheel mouse with xterm or similar X terminal emulators. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have mouse mask mmask_t's must be recompiled. @@ -512,7 +500,7 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-getcap-cache Cache translated termcaps under the directory $HOME/.terminfo - NOTE: this sounds good - it makes ncurses run faster the second time. + NOTE: this sounds good - it makes ncurses run faster the second time. But look where the data comes from - an /etc/termcap containing lots of entries that are not up to date. If you configure with this option and forget to install the terminfo database before running an ncurses @@ -525,10 +513,6 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. - --enable-interop - Compile-in experimental interop bindings. These provide generic types - for the form-library. - --enable-mixed-case Controls whether the filesystem on which the terminfo database resides supports mixed-case filenames (normal for UNIX, but not on other @@ -541,15 +525,6 @@ SUMMARY OF CONFIGURE OPTIONS: terminfo entries. This is the default, unless you have disabled the extended functions. - --enable-pc-files - If pkg-config is found (see --with-pkg-config), generate ".pc" files - for each of the libraries, and install them in pkg-config's library - directory. - - --enable-pthreads-eintr - add logic in threaded configuration to ensure that a read(2) system - call can be interrupted for SIGWINCH. - --enable-reentrant Compile experimental configuration which improves reentrant use of the library by reducing global and static variables. This option is also @@ -590,11 +565,6 @@ SUMMARY OF CONFIGURE OPTIONS: is not strictly compatible. This option allows one to implement this alteration without patching the source code. - --enable-sp-funcs - Compile-in support for extended functions which accept a SCREEN pointer, - reducing the need for juggling the global SP value with set_term() and - delscreen(). - --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -606,11 +576,6 @@ SUMMARY OF CONFIGURE OPTIONS: capabilities as user-defined strings. This option is the default, unless you have disabled the extended functions. - --enable-term-driver - Enable experimental terminal-driver. This is currently used for the - MinGW port, by providing a way to substitute the low-level terminfo - library with different terminal drivers. - --enable-termcap Compile in support for reading terminal descriptions from termcap if no match is found in the terminfo database. See also the --enable-getcap @@ -665,23 +630,12 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) - --with-ada-sharedlib - Build a shared library for Ada95 binding, if the compiler permits. - - NOTE: You must also set the --with-shared option on some platforms - for a successful build. You need not use this option when you set - --with-shared, unless you want to use the Ada shared library. - --with-bool=TYPE If --without-cxx is specified, override the type used for the "bool" declared in curses.h (normally the type is automatically chosen to correspond with that in , or defaults to platform-specific sizes). - --with-build-cpp=XXX - This option is provided by the same macro used for $BUILD_CC, etc., - but is not directly used by ncurses. - --with-build-cc=XXX If cross-compiling, specify a host C compiler, which is needed to compile a few utilities which generate source modules for ncurses. @@ -728,17 +682,12 @@ SUMMARY OF CONFIGURE OPTIONS: to use a terminfo database which is compatible with the native applications. - --with-ccharw-max=XXX - Override the size of the wide-character array in cchar_t structures. - Changing this will alter the binary interface. This defaults to 5. - --with-chtype=TYPE Override type of chtype, which stores the video attributes and (if --enable-widec is not given) a character. Prior to ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it may be unsigned. Use this option if you need to preserve compatibility with 64-bit - executables, e.g., by setting "--with-chtype=long" (the configure - script supplies "unsigned"). + executables. --with-database=XXX Specify the terminfo source file to install. Usually you will wish @@ -770,7 +719,7 @@ SUMMARY OF CONFIGURE OPTIONS: use Alessandro Rubini's GPM library to provide mouse support on the Linux console. Prior to ncurses 5.5, this introduced a dependency on the GPM library. - + Currently ncurses uses the dlsym() function to bind to the library at runtime, so it is only necessary that the library be present when ncurses is built, to obtain the filename (or soname) used in the @@ -787,7 +736,7 @@ SUMMARY OF CONFIGURE OPTIONS: Use a hashed database for storing terminfo data rather than storing each compiled entry in a separate binary file within a directory tree. - + In particular, this uses the Berkeley database 1.8.5 interface, as provided by that and its successors db 2, 3, and 4. The actual interface is slightly different in the successor versions of the @@ -821,7 +770,7 @@ SUMMARY OF CONFIGURE OPTIONS: make install DESTDIR=XXX since the makefiles pass that variable to subordinate makes. - NOTE: a few systems build shared libraries with fixed pathnames; this + NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. --with-libtool[=XXX] @@ -858,9 +807,9 @@ SUMMARY OF CONFIGURE OPTIONS: --with-manpage-renames=XXX Tell the configure script that you wish to rename the manpages while - installing. Currently the only distribution which does this is Debian. - The option value specifies the name of a file that lists the renamed - files, e.g., $srcdir/man/man_db.renames + installing. Currently the only distribution which does this is + the Linux Debian. The option value specifies the name of a file + that lists the renamed files, e.g., $srcdir/man/man_db.renames --with-manpage-symlinks Tell the configure script that you wish to make symbolic links in the @@ -901,9 +850,6 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. - --with-pkg-config=[DIR] - Check for pkg-config, optionally specifying its path. - --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -927,7 +873,7 @@ SUMMARY OF CONFIGURE OPTIONS: which you are building, typically using a ".so" suffix, along with symbolic links that refer to the release version. - NOTE: Unless you override the configure script by setting the $CFLAGS + NOTE: Unless you override the configure script by setting the $CFLAGS environment variable, these will not be built with the -g debugging option. @@ -939,11 +885,7 @@ SUMMARY OF CONFIGURE OPTIONS: loads the system's copy of the ncurses shared libraries. In that case, using the misc/shlib script may be helpful, since it sets $LD_LIBRARY_PATH to point to the build tree, e.g., - ./misc/shlib make install - - NOTE: If you use the --with-ada-sharedlib option, you should also - set this option, to ensure that C-language modules needed for the - Ada binding use appropriate compiler options. + ./misc/shlib make install --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. @@ -1004,17 +946,6 @@ SUMMARY OF CONFIGURE OPTIONS: For testing, compile with debug option. This also sets the --disable-leaks option. - --with-wrap-prefix=XXX - When using the --enable-reentrant option, ncurses redefines variables - that would be global in curses, e.g., LINES, as a macro that calls a - "wrapping" function which fetches the data from the current SCREEN - structure. Normally that function is named by prepending "_nc_" to the - variable's name. The function is technically private (since portable - applications would not refer directly to it). But according to one - line of reasoning, it is not the same type of "private" as functions - which applications should not call even via a macro. This configure - option lets you choose the prefix for these wrapped variables. - --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -1044,18 +975,11 @@ SUMMARY OF CONFIGURE OPTIONS: --without-dlsym Do not use dlsym() to load GPM dynamically. - --without-manpages - Tell the configure script to suppress the install of ncurses' manpages. - --without-progs Tell the configure script to suppress the build of ncurses' application programs (e.g., tic). The test applications will still be built if you type "make", though not if you simply do "make install". - --without-tests - Tell the configure script to suppress the build of ncurses' test - programs. - --without-xterm-new Tell the configure script to use "xterm-old" for the entry used in the terminfo database. This will work with variations such as @@ -1077,60 +1001,6 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: you may encounter when building a system with different versions of ncurses: - 5.8 (Feb 26, 2011) - Interface changes: - - + add an alternate library configuration, i.e., "terminal driver" to - support port to Windows, built with MinGW. There are two drivers - (terminfo and Windows console). The terminfo driver works on other - platforms. - - + add a new set of functions which accept a SCREEN* parameter, in - contrast with the original set which use the global value "sp". - By default, these names end with "_sp", and are otherwise - functionally identical with the originals. - - In addition to the "_sp" functions, there are a few new functions - associated with this feature: ceiling_panel, ground_panel, - new_prescr. - - If the library is not built with the sp-funcs extension, there - are no related interface changes. - - + add tiparm function based on review of X/Open Curses Issue 7. - - + change internal _nc_has_mouse function to public has_mouse function - - Added extensions: - - + add a few more functions to support the NCURSES_OPAQUE feature: - get_escdelay, is_pad, is_subwin - - Added internal functions (other than "_sp" variants): - _nc_curscr_of - _nc_format_slks - _nc_get_alias_table - _nc_get_hash_info - _nc_insert_wch - _nc_newscr_of - _nc_outc_wrapper - _nc_retrace_char - _nc_retrace_int_attr_t - _nc_retrace_mmask_t - _nc_setup_tinfo - _nc_stdscr_of - _nc_tinfo_cmdch - - Removed internal functions: - _nc_makenew (some configurations replace by _nc_makenew_sp) - - Modified internal functions: - _nc_UpdateAttrs - _nc_get_hash_table - _nc_has_mouse - _nc_insert_ch - _nc_wgetch - 5.7 (November 2, 2008) Interface changes: @@ -1141,7 +1011,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: of the ncurses library used for the tic program as well as some others such as tack. There is no API change, but makefiles would be changed to use the tic-library built separately. - + tack, distributed separately from ncurses, uses some of the internal _nc_XXX functions, which are declared in the tic.h header file. @@ -1288,7 +1158,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: still used in this release to allow compiling with not-so-old compilers. - + form and menu libraries now work with wide-character data. + + form and menu libraries now work with wide-character data. Applications which bypassed the form library and manipulated the FIELD.buf data directly will not work properly with libformw, since that no longer points to an array of char. The set_field_buffer() @@ -1568,8 +1438,8 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: 4.0 (December 24, 1996) - We bumped to version 4.0 because the newly released Linux dynamic - loader (ld.so.1.8.5) did not load shared libraries whose ABI and REL + We bumped to version 4.0 because the newly released dynamic loader + (ld.so.1.8.5) on Linux did not load shared libraries whose ABI and REL versions were inconsistent. At that point, ncurses ABI was 3.4 and the REL was 1.9.9g, so we made them consistent. @@ -1626,10 +1496,10 @@ IF YOU ARE A SYSTEM INTEGRATOR: Configuration and Installation: - On platforms where ncurses is assumed to be installed in /usr/lib, + On platforms where ncurses is assumed to be installed in /usr/lib, the configure script uses "/usr" as a default: - GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin + Linux, FreeBSD, NetBSD, OpenBSD, Cygwin For other platforms, the default is "/usr/local". See the discussion of the "--disable-overwrite" option. @@ -1692,7 +1562,7 @@ IF YOU ARE A SYSTEM INTEGRATOR: bsdos -- BSD/OS If you are responsible for integrating ncurses for one of these - distributions, please either use the recommended name or get back + distribution, please either use the recommended name or get back to us explaining why you don't want to, so we can work out nomenclature that will make users' lives easier rather than harder. @@ -1714,8 +1584,7 @@ CONFIGURING FALLBACK ENTRIES: tree is accessible (that is, in single-user mode or at OS installation time) the ncurses library can be compiled to include an array of pre-fetched fallback entries. This must be done on a machine which - has ncurses' infocmp and terminfo database installed (as well as - ncurses' tic and infocmp programs). + has ncurses' infocmp and terminfo database installed. These entries are checked by setupterm() only when the conventional fetches from the terminfo tree and the termcap fallback (if configured) @@ -1820,8 +1689,8 @@ USING NCURSES WITH AFS: with this by making tic use symbolic links. USING NCURSES WITH GPM: - Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) - which is used with Linux console. Be aware that GPM is commonly + Ncurses 4.1 and up can be configured to use GPM (General Purpose + Mouse) which is used on Linux console. Be aware that GPM is commonly installed as a shared library which contains a wrapper for the curses wgetch() function (libcurses.o). Some integrators have simplified linking applications by combining all or part of libcurses.so into the @@ -1866,10 +1735,6 @@ BUILDING NCURSES WITH A CROSS-COMPILER option), ncurses uses the development platform's tic to do the "make install.data" portion. - The system's tic program is used to install the terminal database, - even for cross-compiles. For best results, the tic program should - be from the most current version of ncurses. - BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to diff --git a/MANIFEST b/MANIFEST index 421cc678cd6..db3871f2e11 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,10 +3,6 @@ ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO -./Ada95/aclocal.m4 -./Ada95/configure -./Ada95/configure.in -./Ada95/doc/Makefile.in ./Ada95/gen/Makefile.in ./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c @@ -27,21 +23,6 @@ ./Ada95/gen/terminal_interface-curses-trace.ads.m4 ./Ada95/gen/terminal_interface-curses.adb.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 -./Ada95/include/MKncurses_def.sh -./Ada95/include/Makefile.in -./Ada95/include/ncurses_cfg.hin -./Ada95/include/ncurses_defs -./Ada95/make-tar.sh -./Ada95/mk-1st.awk -./Ada95/package/AdaCurses-doc.spec -./Ada95/package/AdaCurses.spec -./Ada95/package/debian/compat -./Ada95/package/debian/control -./Ada95/package/debian/copyright -./Ada95/package/debian/docs -./Ada95/package/debian/rules -./Ada95/package/debian/source/format -./Ada95/package/debian/watch ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -128,11 +109,6 @@ ./Ada95/samples/tour.adb ./Ada95/samples/tour.ads ./Ada95/src/Makefile.in -./Ada95/src/c_varargs_to_ada.c -./Ada95/src/c_varargs_to_ada.h -./Ada95/src/library.gpr -./Ada95/src/modules -./Ada95/src/ncurses_compat.c ./Ada95/src/terminal_interface-curses-aux.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -196,7 +172,6 @@ ./Makefile.os2 ./NEWS ./README -./README.MinGW ./README.emx ./TO-DO ./aclocal.m4 @@ -336,7 +311,6 @@ ./doc/html/announce.html ./doc/html/hackguide.html ./doc/html/index.html -./doc/html/man/adacurses-config.1.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html ./doc/html/man/curs_add_wch.3x.html @@ -376,7 +350,6 @@ ./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html ./doc/html/man/curs_legacy.3x.html -./doc/html/man/curs_memleaks.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html ./doc/html/man/curs_opaque.3x.html @@ -390,7 +363,6 @@ ./doc/html/man/curs_scr_dump.3x.html ./doc/html/man/curs_scroll.3x.html ./doc/html/man/curs_slk.3x.html -./doc/html/man/curs_sp_funcs.3x.html ./doc/html/man/curs_termattrs.3x.html ./doc/html/man/curs_termcap.3x.html ./doc/html/man/curs_terminfo.3x.html @@ -398,7 +370,6 @@ ./doc/html/man/curs_touch.3x.html ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html -./doc/html/man/curs_variables.3x.html ./doc/html/man/curs_window.3x.html ./doc/html/man/default_colors.3x.html ./doc/html/man/define_key.3x.html @@ -424,7 +395,6 @@ ./doc/html/man/form_post.3x.html ./doc/html/man/form_requestname.3x.html ./doc/html/man/form_userptr.3x.html -./doc/html/man/form_variables.3x.html ./doc/html/man/form_win.3x.html ./doc/html/man/index.html ./doc/html/man/infocmp.1m.html @@ -457,13 +427,10 @@ ./doc/html/man/mitem_value.3x.html ./doc/html/man/mitem_visible.3x.html ./doc/html/man/ncurses.3x.html -./doc/html/man/ncurses5-config.1.html ./doc/html/man/panel.3x.html ./doc/html/man/resizeterm.3x.html -./doc/html/man/tabs.1.html ./doc/html/man/term.5.html ./doc/html/man/term.7.html -./doc/html/man/term_variables.3x.html ./doc/html/man/terminfo.5.html ./doc/html/man/tic.1m.html ./doc/html/man/toe.1m.html @@ -512,15 +479,12 @@ ./form/fty_alnum.c ./form/fty_alpha.c ./form/fty_enum.c -./form/fty_generic.c ./form/fty_int.c ./form/fty_ipv4.c ./form/fty_num.c ./form/fty_regex.c ./form/headers ./form/llib-lform -./form/llib-lformt -./form/llib-lformtw ./form/llib-lformw ./form/modules ./include/Caps @@ -543,20 +507,16 @@ ./include/hashed_db.h ./include/headers ./include/nc_alloc.h -./include/nc_mingw.h ./include/nc_panel.h ./include/nc_tparm.h ./include/ncurses_cfg.hin ./include/ncurses_defs -./include/ncurses_dll.h.in -./include/ncurses_mingw.h +./include/ncurses_dll.h ./include/term_entry.h ./include/termcap.h.in ./include/tic.h ./include/unctrl.h.in ./install-sh -./man/MKada_config.in -./man/MKncu_config.in ./man/MKterminfo.sh ./man/Makefile.in ./man/captoinfo.1m @@ -612,7 +572,6 @@ ./man/curs_scr_dump.3x ./man/curs_scroll.3x ./man/curs_slk.3x -./man/curs_sp_funcs.3x ./man/curs_termattrs.3x ./man/curs_termcap.3x ./man/curs_terminfo.3x @@ -620,7 +579,6 @@ ./man/curs_touch.3x ./man/curs_trace.3x ./man/curs_util.3x -./man/curs_variables.3x ./man/curs_window.3x ./man/default_colors.3x ./man/define_key.3x @@ -646,7 +604,6 @@ ./man/form_post.3x ./man/form_requestname.3x ./man/form_userptr.3x -./man/form_variables.3x ./man/form_win.3x ./man/infocmp.1m ./man/infotocap.1m @@ -683,10 +640,8 @@ ./man/ncurses.3x ./man/panel.3x ./man/resizeterm.3x -./man/tabs.1 ./man/term.5 ./man/term.7 -./man/term_variables.3x ./man/terminfo.head ./man/terminfo.tail ./man/tic.1m @@ -699,8 +654,6 @@ ./menu/eti.h ./menu/headers ./menu/llib-lmenu -./menu/llib-lmenut -./menu/llib-lmenutw ./menu/llib-lmenuw ./menu/m_attribs.c ./menu/m_cursor.c @@ -741,12 +694,13 @@ ./misc/emx.src ./misc/form.def ./misc/form.ref -./misc/gen-pkgconfig.in ./misc/gen_edit.sh +./misc/jpf-indent ./misc/makedef.cmd ./misc/makellib ./misc/menu.def ./misc/menu.ref +./misc/ncu-indent ./misc/ncurses-config.in ./misc/ncurses.def ./misc/ncurses.ref @@ -764,8 +718,8 @@ ./mk-0th.awk ./mk-1st.awk ./mk-2nd.awk -./mk-dlls.sh.in ./mk-hdr.awk +./mkdirs.sh ./ncurses/Makefile.in ./ncurses/README ./ncurses/README.IZ @@ -794,7 +748,6 @@ ./ncurses/base/lib_delch.c ./ncurses/base/lib_delwin.c ./ncurses/base/lib_dft_fgbg.c -./ncurses/base/lib_driver.c ./ncurses/base/lib_echo.c ./ncurses/base/lib_endwin.c ./ncurses/base/lib_erase.c @@ -860,12 +813,10 @@ ./ncurses/base/version.c ./ncurses/base/vsscanf.c ./ncurses/base/wresize.c -./ncurses/build.priv.h ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses ./ncurses/llib-lncursest -./ncurses/llib-lncursestw ./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk @@ -912,7 +863,6 @@ ./ncurses/tinfo/lib_tparm.c ./ncurses/tinfo/lib_tputs.c ./ncurses/tinfo/lib_ttyflags.c -./ncurses/tinfo/make_hash.c ./ncurses/tinfo/make_keys.c ./ncurses/tinfo/name_match.c ./ncurses/tinfo/parse_entry.c @@ -920,7 +870,6 @@ ./ncurses/tinfo/read_termcap.c ./ncurses/tinfo/setbuf.c ./ncurses/tinfo/strings.c -./ncurses/tinfo/tinfo_driver.c ./ncurses/tinfo/trim_sgr0.c ./ncurses/tinfo/use_screen.c ./ncurses/tinfo/write_entry.c @@ -946,7 +895,6 @@ ./ncurses/tty/tty_display.h ./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c -./ncurses/wcwidth.h ./ncurses/widechar/charable.c ./ncurses/widechar/lib_add_wch.c ./ncurses/widechar/lib_box_set.c @@ -967,14 +915,9 @@ ./ncurses/widechar/lib_vline_set.c ./ncurses/widechar/lib_wacs.c ./ncurses/widechar/lib_wunctrl.c -./ncurses/win32con/gettimeofday.c -./ncurses/win32con/wcwidth.c -./ncurses/win32con/win_driver.c ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel -./panel/llib-lpanelt -./panel/llib-lpaneltw ./panel/llib-lpanelw ./panel/modules ./panel/p_above.c @@ -1004,12 +947,11 @@ ./progs/infocmp.c ./progs/modules ./progs/progs.priv.h -./progs/tabs.c ./progs/tic.c ./progs/toe.c ./progs/tput.c -./progs/transform.c ./progs/tset.c +./tar-copy.sh ./test/Makefile.in ./test/README ./test/aclocal.m4 @@ -1021,7 +963,6 @@ ./test/cardfile.c ./test/cardfile.dat ./test/chgat.c -./test/clip_printw.c ./test/color_set.c ./test/configure ./test/configure.in @@ -1032,7 +973,6 @@ ./test/demo_menus.c ./test/demo_panels.c ./test/demo_termcap.c -./test/demo_terminfo.c ./test/ditto.c ./test/dots.c ./test/dots_mvcur.c @@ -1050,30 +990,19 @@ ./test/inch_wide.c ./test/inchs.c ./test/ins_wide.c -./test/insdelln.c ./test/inserts.c ./test/key_names.c ./test/keynames.c ./test/knight.c -./test/linedata.h ./test/linux-color.dat ./test/listused.sh ./test/lrtest.c -./test/make-tar.sh ./test/mk-test.awk ./test/modules ./test/movewindow.c ./test/ncurses.c ./test/ncurses_tst.hin ./test/newdemo.c -./test/package/debian/compat -./test/package/debian/control -./test/package/debian/copyright -./test/package/debian/docs -./test/package/debian/rules -./test/package/debian/source/format -./test/package/debian/watch -./test/package/ncurses-examples.spec ./test/programs ./test/railroad.c ./test/rain.c @@ -1082,10 +1011,6 @@ ./test/savescreen.sh ./test/tclock.c ./test/test.priv.h -./test/test_add_wchstr.c -./test/test_addchstr.c -./test/test_addstr.c -./test/test_addwstr.c ./test/test_arrays.c ./test/test_get_wstr.c ./test/test_getstr.c @@ -1101,5 +1026,4 @@ ./test/worm.c ./test/xmas.c ./test/xterm-16color.dat -./test/xterm-256color.dat ./test/xterm-88color.dat diff --git a/Makefile.in b/Makefile.in index d891e002fd8..cb8cd422cc4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.24 2005/01/29 19:30:06 tom Exp $ ############################################################################## -# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,7 +32,6 @@ # Master Makefile for ncurses library. SHELL = /bin/sh -VPATH = @srcdir@ DESTDIR=@DESTDIR@ CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" @@ -43,9 +42,6 @@ NCURSES_MAJOR = @NCURSES_MAJOR@ NCURSES_MINOR = @NCURSES_MINOR@ NCURSES_PATCH = @NCURSES_PATCH@ -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ - prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -87,13 +83,6 @@ preinstall : fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ echo '** Will overwrite non-ncurses curses.h' -dlls: libs - $(SHELL) $(srcdir)/mk-dlls.sh - -distclean \ -realclean :: - -rm -f mk-dlls.sh mingw_arch - # Put the common rules here so that we can easily construct the list of # directories to visit. all \ diff --git a/NEWS b/NEWS index e8f9cefbabd..a64450b3022 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2007,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 -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1682 2011/04/04 00:02:42 tom Exp $ +-- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,1076 +45,6 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. -20110404 5.9 release for upload to ftp.gnu.org - -20110402 - + various build-fixes for the rpm/dpkg scripts. - + add "--enable-rpath-link" option to Ada95/configure, to allow - packages to suppress the rpath feature which is normally used for - the in-tree build of sample programs. - + corrected definition of libdir variable in Ada95/src/Makefile.in, - needed for rpm script. - + add "--with-shared" option to Ada95/configure script, to allow - making the C-language parts of the binding use appropriate compiler - options if building a shared library with gnat. - -20110329 - > portability fixes for Ada95 binding: - + add configure check to ensure that SIGINT works with gnat. This is - needed for the "rain" sample program. If SIGINT does not work, omit - that sample program. - + correct typo in check of $PKG_CONFIG variable in Ada95/configure - + add ncurses_compat.c, to supply functions used in the Ada95 binding - which were added in 5.7 and later. - + modify sed expression in CF_NCURSES_ADDON to eliminate a dependency - upon GNU sed. - -20110326 - + add special check in Ada95/configure script for ncurses6 reentrant - code. - + regen Ada html documentation. - + build-fix for Ada shared libraries versus the varargs workaround. - + add rpm and dpkg scripts for Ada95 and test directories, for test - builds. - + update test/configure macros CF_CURSES_LIBS, CF_XOPEN_SOURCE and - CF_X_ATHENA_LIBS. - + add configure check to determine if gnat's project feature supports - libraries, i.e., collections of .ali files. - + make all dereferences in Ada95 samples explicit. - + fix typo in comment in lib_add_wch.c (patch by Petr Pavlu). - + add configure check for, ifdef's for math.h which is in a separate - package on Solaris and potentially not installed (report by Petr - Pavlu). - > fixes for Ada95 binding (Nicolas Boulenguez): - + improve type-checking in Ada95 by eliminating a few warning-suppress - pragmas. - + suppress unreferenced warnings. - + make all dereferences in binding explicit. - -20110319 - + regen Ada html documentation. - + change order of -I options from ncurses*-config script when the - --disable-overwrite option was used, so that the subdirectory include - is listed first. - + modify the make-tar.sh scripts to add a MANIFEST and NEWS file. - + modify configure script to provide value for HTML_DIR in - Ada95/gen/Makefile.in, which depends on whether the Ada95 binding is - distributed separately (report by Nicolas Boulenguez). - + modify configure script to add -g and/or -O3 to ADAFLAGS if the - CFLAGS for the build has these options. - + amend change from 20070324, to not add 1 to the result of getmaxx - and getmaxy in the Ada binding (report by Nicolas Boulenguez for - thread in comp.lang.ada). - + build-fix Ada95/samples for gnat 4.5 - + spelling fixes for Ada95/samples/explain.txt - > fixes for Ada95 binding (Nicolas Boulenguez): - + add item in Trace_Attribute_Set corresponding to TRACE_ATTRS. - + add workaround for binding to set_field_type(), which uses varargs. - The original binding from 990220 relied on the prevalent - implementation of varargs which did not support or need va_copy(). - + add dependency on gen/Makefile.in needed for *-panels.ads - + add Library_Options to library.gpr - + add Languages to library.gpr, for gprbuild - -20110307 - + revert changes to limit-checks from 20110122 (Debian #616711). - > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): - + corrected a minor sign error in a field of Low_Level_Field_Type, to - conform to form.h. - + replaced C_Int by Curses_Bool as return type for some callbacks, see - fieldtype(3FORM). - + modify samples/sample-explain.adb to provide explicit message when - explain.txt is not found. - -20110305 - + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). - + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes - for compiler warnings (report by Nicolas Boulenguez). - + modify Ada95/gen/gen.c to declare unused bits in generated layouts, - needed to compile when chtype is 64-bits using gnat 4.4.5 - -20110226 5.8 release for upload to ftp.gnu.org - -20110226 - + update release notes, for 5.8. - + regenerated html manpages. - + change open() in _nc_read_file_entry() to fopen() for consistency - with write_file(). - + modify misc/run_tic.in to create parent directory, in case this is - a new install of hashed database. - + fix typo in Ada95/mk-1st.awk which causes error with original awk. - -20110220 - + configure script rpath fixes from xterm #269. - + workaround for cygwin's non-functional features.h, to force ncurses' - configure script to define _XOPEN_SOURCE_EXTENDED when building - wide-character configuration. - + build-fix in run_tic.sh for OS/2 EMX install - + add cons25-debian entry (patch by Brian M Carlson, Debian #607662). - -20110212 - + regenerated html manpages. - + use _tracef() in show_where() function of tic, to work correctly with - special case of trace configuration. - -20110205 - + add xterm-utf8 entry as a demo of the U8 feature -TD - + add U8 feature to denote entries for terminal emulators which do not - support VT100 SI/SO when processing UTF-8 encoding -TD - + improve the NCURSES_NO_UTF8_ACS feature by adding a check for an - extended terminfo capability U8 (prompted by mailing list - discussion). - -20110122 - + start documenting interface changes for upcoming 5.8 release. - + correct limit-checks in derwin(). - + correct limit-checks in newwin(), to ensure that windows have nonzero - size (report by Garrett Cooper). - + fix a missing "weak" declaration for pthread_kill (patch by Nicholas - Alcock). - + improve documentation of KEY_ENTER in curs_getch.3x manpage (prompted - by discussion with Kevin Martin). - -20110115 - + modify Ada95/configure script to make the --with-curses-dir option - work without requiring the --with-ncurses option. - + modify test programs to allow them to be built with NetBSD curses. - + document thick- and double-line symbols in curs_add_wch.3x manpage. - + document WACS_xxx constants in curs_add_wch.3x manpage. - + fix some warnings for clang 2.6 "--analyze" - + modify Ada95 makefiles to make html-documentation with the project - file configuration if that is used. - + update config.guess, config.sub - -20110108 - + regenerated html manpages. - + minor fixes to enable lint when trace is not enabled, e.g., with - clang --analyze. - + fix typo in man/default_colors.3x (patch by Tim van der Molen). - + update ncurses/llib-lncurses* - -20110101 - + fix remaining strict compiler warnings in ncurses library ABI=5, - except those dealing with function pointers, etc. - -20101225 - + modify nc_tparm.h, adding guards against repeated inclusion, and - allowing TPARM_ARG to be overridden. - + fix some strict compiler warnings in ncurses library. - -20101211 - + suppress ncv in screen entry, allowing underline (patch by Alejandro - R Sedeno). - + also suppress ncv in konsole-base -TD - + fixes in wins_nwstr() and related functions to ensure that special - characters, i.e., control characters are handled properly with the - wide-character configuration. - + correct a comparison in wins_nwstr() (Redhat #661506). - + correct help-messages in some of the test-programs, which still - referred to quitting with 'q'. - -20101204 - + add special case to _nc_infotocap() to recognize the setaf/setab - strings from xterm+256color and xterm+88color, and provide a reduced - version which works with termcap. - + remove obsolete emacs "Local Variables" section from documentation - (request by Sven Joachim). - + update doc/html/index.html to include NCURSES-Programming-HOWTO.html - (report by Sven Joachim). - -20101128 - + modify test/configure and test/Makefile.in to handle this special - case of building within a build-tree (Debian #34182): - mkdir -p build && cd build && ../test/configure && make - -20101127 - + miscellaneous build-fixes for Ada95 and test-directories when built - out-of-tree. - + use VPATH in makefiles to simplify out-of-tree builds (Debian #34182). - + fix typo in rmso for tek4106 entry -Goran Weinholt - -20101120 - + improve checks in test/configure for X libraries, from xterm #267 - changes. - + modify test/configure to allow it to use the build-tree's libraries - e.g., when using that to configure the test-programs without the - rpath feature (request by Sven Joachim). - + repurpose "gnome" terminfo entries as "vte", retaining "gnome" items - for compatibility, but generally deprecating those since the VTE - library is what actually defines the behavior of "gnome", etc., - since 2003 -TD - -20101113 - + compiler warning fixes for test programs. - + various build-fixes for test-programs with pdcurses. - + updated configure checks for X packages in test/configure from xterm - #267 changes. - + add configure check to gnatmake, to accommodate cygwin. - -20101106 - + correct list of sub-directories needed in Ada95 tree for building as - a separate package. - + modify scripts in test-directory to improve builds as a separate - package. - -20101023 - + correct parsing of relative tab-stops in tabs program (report by - Philip Ganchev). - + adjust configure script so that "t" is not added to library suffix - when weak-symbols are used, allowing the pthread configuration to - more closely match the non-thread naming (report by Werner Fink). - + modify configure check for tic program, used for fallbacks, to a - warning if not found. This makes it simpler to use additonal - scripts to bootstrap the fallbacks code using tic from the build - tree (report by Werner Fink). - + fix several places in configure script using ${variable-value} form. - + modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders - which do not support selectively linking against static libraries - (report by John P. Hartmann) - + fix an unescaped dash in man/tset.1 (report by Sven Joachim). - -20101009 - + correct comparison used for setting 16-colors in linux-16color - entry (Novell #644831) -TD - + improve linux-16color entry, using "dim" for color-8 which makes it - gray rather than black like color-0 -TD - + drop misc/ncu-indent and misc/jpf-indent; they are provided by an - external package "cindent". - -20101002 - + improve linkages in html manpages, adding references to the newer - pages, e.g., *_variables, curs_sp_funcs, curs_threads. - + add checks in tic for inconsistent cursor-movement controls, and for - inconsistent printer-controls. - + fill in no-parameter forms of cursor-movement where a parameterized - form is available -TD - + fill in missing cursor controls where the form of the controls is - ANSI -TD - + fix inconsistent punctuation in form_variables manpage (patch by - Sven Joachim). - + add parameterized cursor-controls to linux-basic (report by Dae) -TD - > patch by Juergen Pfeifer: - + document how to build 32-bit libraries in README.MinGW - + fixes to filename computation in mk-dlls.sh.in - + use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven - Joachim). - + add a check in mk-dlls.sh.in to obtain the size of a pointer to - distinguish between 32-bit and 64-bit hosts. The result is stored - in mingw_arch - -20100925 - + add "XT" capability to entries for terminals that support both - xterm-style mouse- and title-controls, for "screen" which - special-cases TERM beginning with "xterm" or "rxvt" -TD - > patch by Juergen Pfeifer: - + use 64-Bit MinGW toolchain (recommended package from TDM, see - README.MinGW). - + support pthreads when using the TDM MinGW toolchain - -20100918 - + regenerated html manpages. - + minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages. - + add manpage for sp-funcs. - + add sp-funcs to test/listused.sh, for documentation aids. - -20100911 - + add manpages for summarizing public variables of curses-, terminfo- - and form-libraries. - + minor fixes to manpages for consistency (patch by Jason McIntyre). - + modify tic's -I/-C dump to reformat acsc strings into canonical form - (sorted, unique mapping) (cf: 971004). - + add configure check for pthread_kill(), needed for some old - platforms. - -20100904 - + add configure option --without-tests, to suppress building test - programs (request by Frederic L W Meunier). - -20100828 - + modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD - + add check in terminfo source-reader to provide more informative - message when someone attempts to run tic on a compiled terminal - description (prompted by Debian #593920). - + note in infotocap and captoinfo manpages that they read terminal - descriptions from text-files (Debian #593920). - + improve acsc string for vt52, show arrow keys (patch by Benjamin - Sittler). - -20100814 - + document in manpages that "mv" functions first use wmove() to check - the window pointer and whether the position lies within the window - (suggested by Poul-Henning Kamp). - + fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch - by Tim van der Molen). - + modify configure script to transform library names for tic- and - tinfo-libraries so that those build properly with Mac OS X shared - library configuration. - + modify configure script to ensure that it removes conftest.dSYM - directory leftover on checks with Mac OS X. - + modify configure script to cleanup after check for symbolic links. - -20100807 - + correct a typo in mk-1st.awk (patch by Gabriele Balducci) - (cf: 20100724) - + improve configure checks for location of tic and infocmp programs - used for installing database and for generating fallback data, - e.g., for cross-compiling. - + add Markus Kuhn's wcwidth function for compiling MinGW - + add special case to CF_REGEX for cross-compiling to MinGW target. - -20100731 - + modify initialization check for win32con driver to eliminate need for - special case for TERM "unknown", using terminal database if available - (prompted by discussion with Roumen Petrov). - + for MinGW port, ensure that terminal driver is setup if tgetent() - is called (patch by Roumen Petrov). - + document tabs "-0" and "-8" options in manpage. - + fix Debian "lintian" issues with manpages reported in - http://lintian.debian.org/full/csmall@debian.org.html#ncurses - -20100724 - + add a check in tic for missing set_tab if clear_all_tabs given. - + improve use of symbolic links in makefiles by using "-f" option if - it is supported, to eliminate temporary removal of the target - (prompted by http://www.t2-project.org/packages/ncurses.html) - + minor improvement to test/ncurses.c, reset color pairs in 'd' test - after exit from 'm' main-menu command. - + improved ncu-indent, from mawk changes, allows more than one of - GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line. - -20100717 - + add hard-reset for rs2 to wsvt25 to help ensure that reset ends - the alternate character set (patch by Nicholas Marriott) - + remove tar-copy.sh and related configure/Makefile chunks, since the - Ada95 binding is now installed using rules in Ada95/src. - -20100703 - + continue integrating changes to use gnatmake project files in Ada95 - + add/use configure check to turn on project rules for Ada95/src. - + revert the vfork change from 20100130, since it does not work. - -20100626 - + continue integrating changes to use gnatmake project files in Ada95 - + old gnatmake (3.15) does not produce libraries using project-file; - work around by adding script to generate alternate makefile. - -20100619 - + continue integrating changes to use gnatmake project files in Ada95 - + add configure --with-ada-sharedlib option, for the test_make rule. - + move Ada95-related logic into aclocal.m4, since additional checks - will be needed to distinguish old/new implementations of gnat. - -20100612 - + start integrating changes to use gnatmake project files in Ada95 tree - + add test_make / test_clean / test_install rules in Ada95/src - + change install-path for adainclude directory to /usr/share/ada (was - /usr/lib/ada). - + update Ada95/configure. - + add mlterm+256color entry, for mlterm 3.0.0 -TD - + modify test/configure to use macros to ensure consistent order - of updating LIBS variable. - -20100605 - + change search order of options for Solaris in CF_SHARED_OPTS, to - work with 64-bit compiles. - + correct quoting of assignment in CF_SHARED_OPTS case for aix - (cf: 20081227) - -20100529 - + regenerated html documentation. - + modify test/configure to support pkg-config for checking X libraries - used by PDCurses. - + add/use configure macro CF_ADD_LIB to force consistency of - assignments to $LIBS, etc. - + fix configure script for combining --with-pthread - and --enable-weak-symbols options. - -20100522 - + correct cross-compiling configure check for CF_MKSTEMP macro, by - adding a check cache variable set by AC_CHECK_FUNC (report by - Pierre Labastie). - + simplify include-dependencies of make_hash and make_keys, to reduce - the need for setting BUILD_CPPFLAGS in cross-compiling when the - build- and target-machines differ. - + repair broken-linker configuration by restoring a definition of SP - variable to curses.priv.h, and adjusting for cases where sp-funcs - are used. - + improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment - variable to override (prompted by report by Pablo Cazallas). - -20100515 - + add configure option --enable-pthreads-eintr to control whether the - new EINTR feature is enabled. - + modify logic in pthread configuration to allow EINTR to interrupt - a read operation in wgetch() (Novell #540571, patch by Werner Fink). - + drop mkdirs.sh, use "mkdir -p". - + add configure option --disable-libtool-version, to use the - "-version-number" feature which was added in libtool 1.5 (report by - Peter Haering). The default value for the option uses the newer - feature, which makes libraries generated using libtool compatible - with the standard builds of ncurses. - + updated test/configure to match configure script macros. - + fixes for configure script from lynx changes: - + improve CF_FIND_LINKAGE logic for the case where a function is - found in predefined libraries. - + revert part of change to CF_HEADER (cf: 20100424) - -20100501 - + correct limit-check in wredrawln, accounting for begy/begx values - (patch by David Benjamin). - + fix most compiler warnings from clang. - + amend build-fix for OpenSolaris, to ensure that a system header is - included in curses.h before testing feature symbols, since they - may be defined by that route. - -20100424 - + fix some strict compiler warnings in ncurses library. - + modify configure macro CF_HEADER_PATH to not look for variations in - the predefined include directories. - + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work - with gcc 4.x's c89 alias, which gives warning messages for cases - where older versions would produce an error. - -20100417 - + modify _nc_capcmp() to work with cancelled strings. - + correct translation of "^" in _nc_infotocap(), used to transform - terminfo to termcap strings - + add configure --disable-rpath-hack, to allow disabling the feature - which adds rpath options for libraries in unusual places. - + improve CF_RPATH_HACK_2 by checking if the rpath option for a given - directory was already added. - + improve CF_RPATH_HACK_2 by using ldd to provide a standard list of - directories (which will be ignored). - -20100410 - + improve win_driver.c handling of mouse: - + discard motion events - + avoid calling _nc_timed_wait when there is a mouse event - + handle 4th and "rightmost" buttons. - + quote substitutions in CF_RPATH_HACK_2 configure macro, needed for - cases where there are embedded blanks in the rpath option. - -20100403 - + add configure check for exctags vs ctags, to work around pkgsrc. - + simplify logic in _nc_get_screensize() to make it easier to see how - environment variables may override system- and terminfo-values - (prompted by discussion with Igor Bujna). - + make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose. - + improve handling of color-pairs embedded in attributes for the - extended-colors configuration. - + modify MKlib_gen.sh to build link_test with sp-funcs. - + build-fixes for OpenSolaris aka Solaris 11, for wide-character - configuration as well as for rpath feature in *-config scripts. - -20100327 - + refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more - reusable. - + improve configure CF_REGEX, similar fixes. - + improve configure CF_FIND_LINKAGE, adding add check between system - (default) and explicit paths, where we can find the entrypoint in the - given library. - + add check if Gpm_Open() returns a -2, e.g., for "xterm". This is - normally suppressed but can be overridden using $NCURSES_GPM_TERMS. - Ensure that Gpm_Close() is called in this case. - -20100320 - + rename atari and st52 terminfo entries to atari-old, st52-old, use - newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan - Hourihane). - -20100313 - + modify install-rule for manpages so that *-config manpages will - install when building with --srcdir (report by Sven Joachim). - + modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks - option is not the same as --disable-leaks (GenToo #305889). - + modify #define's for build-compiler to suppress cchar_t symbol from - compile of make_hash and make_keys, improving cross-compilation of - ncursesw (report by Bernhard Rosenkraenzer). - + modify CF_MAN_PAGES configure macro to replace all occurrences of - TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders - Kaseorg). - -20100306 - + generate manpages for the *-config scripts, adapted from help2man - (suggested by Sven Joachim). - + use va_copy() in _nc_printf_string() to avoid conflicting use of - va_list value in _nc_printf_length() (report by Wim Lewis). - -20100227 - + add Ada95/configure script, to use in tar-file created by - Ada95/make-tar.sh - + fix typo in wresize.3x (patch by Tim van der Molen). - + modify screen-bce.XXX entries to exclude ech, since screen's color - model does not clear with color for that feature -TD - -20100220 - + add make-tar.sh scripts to Ada95 and test subdirectories to help with - making those separately distributable. - + build-fix for static libraries without dlsym (Debian #556378). - + fix a syntax error in man/form_field_opts.3x (patch by Ingo - Schwarze). - -20100213 - + add several screen-bce.XXX entries -TD - -20100206 - + update mrxvt terminfo entry -TD - + modify win_driver.c to support mouse single-clicks. - + correct name for termlib in ncurses*-config, e.g., if it is renamed - to provide a single file for ncurses/ncursesw libraries (patch by - Miroslav Lichvar). - -20100130 - + use vfork in test/ditto.c if available (request by Mike Frysinger). - + miscellaneous cleanup of manpages. - + fix typo in curs_bkgd.3x (patch by Tim van der Molen). - + build-fix for --srcdir (patch by Miroslav Lichvar). - -20100123 - + for term-driver configuration, ensure that the driver pointer is - initialized in setupterm so that terminfo/termcap programs work. - + amend fix for Debian #542031 to ensure that wattrset() returns only - OK or ERR, rather than the attribute value (report by Miroslav - Lichvar). - + reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making - _nc_screen_of() compatible between normal/wide libraries again (patch - by Miroslav Lichvar) - + review/fix include-dependencies in modules files (report by Miroslav - Lichvar). - -20100116 - + modify win_driver.c to initialize acs_map for win32 console, so - that line-drawing works. - + modify win_driver.c to initialize TERMINAL struct so that programs - such as test/lrtest.c and test/ncurses.c which test string - capabilities can run. - + modify term-driver modules to eliminate forward-reference - declarations. - -20100109 - + modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS - consistently to add new -D's while removing duplicates. - + modify a few configure macros to consistently put new options - before older in the list. - + add tiparm(), based on review of X/Open Curses Issue 7. - + minor documentation cleanup. - + update config.guess, config.sub from - http://savannah.gnu.org/projects/config - (caveat - its maintainer put 2010 copyright date on files dated 2009) - -20100102 - + minor improvement to tic's checking of similar SGR's to allow for the - most common case of SGR 0. - + modify getmouse() to act as its documentation implied, returning on - each call the preceding event until none are left. When no more - events remain, it will return ERR. - -20091227 - + change order of lookup in progs/tput.c, looking for terminfo data - first. This fixes a confusion between termcap "sg" and terminfo - "sgr" or "sgr0", originally from 990123 changes, but exposed by - 20091114 fixes for hashing. With this change, only "dl" and "ed" are - ambiguous (Mandriva #56272). - -20091226 - + add bterm terminfo entry, based on bogl 0.1.18 -TD - + minor fix to rxvt+pcfkeys terminfo entry -TD - + build-fixes for Ada95 tree for gnat 4.4 "style". - -20091219 - + remove old check in mvderwin() which prevented moving a derived - window whose origin happened to coincide with its parent's origin - (report by Katarina Machalkova). - + improve test/ncurses.c to put mouse droppings in the proper window. - + update minix terminfo entry -TD - + add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler) - -20091212 - + correct transfer of multicolumn characters in multirow - field_buffer(), which stopped at the end of the first row due to - filling of unused entries in a cchar_t array with nulls. - + updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta) - + modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character - nulls. - + use strdup() in set_menu_mark(), restore .marklen struct member on - failure. - + eliminate clause 3 from the UCB copyrights in read_termcap.c and - tset.c per - ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change - (patch by Nicholas Marriott). - + replace a malloc in tic.c with strdup, checking for failure (patch by - Nicholas Marriott). - + update config.guess, config.sub from - http://savannah.gnu.org/projects/config - -20091205 - + correct layout of working window used to extract data in - wide-character configured by set_field_buffer (patch by Rafael - Garrido Fernandez) - + improve some limit-checks related to filename length in reading and - writing terminfo entries. - + ensure that filename is always filled in when attempting to read - a terminfo entry, so that infocmp can report the filename (patch - by Nicholas Marriott). - -20091128 - + modify mk-1st.awk to allow tinfo library to be built when term-driver - is enabled. - + add error-check to configure script to ensure that sp-funcs is - enabled if term-driver is, since some internal interfaces rely upon - this. - -20091121 - + fix case where progs/tput is used while sp-funcs is configure; this - requires save/restore of out-character function from _nc_prescreen - rather than the SCREEN structure (report by Charles Wilson). - + fix typo in man/curs_trace.3x which caused incorrect symbolic links - + improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT. - -20091114 - - + updated man/curs_trace.3x - + limit hashing for termcap-names to 2-characters (Ubuntu #481740). - + change a variable name in lib_newwin.c to make it clearer which - value is being freed on error (patch by Nicholas Marriott). - -20091107 - + improve test/ncurses.c color-cycling test by reusing attribute- - and color-cycling logic from the video-attributes screen. - + add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form - library which help make it compatible with interop applications - (patch by Juergen Pfeifer). - + add configure option --enable-interop, for integrating changes - for generic/interop support to form-library by Juergen Pfeifer - -20091031 - + modify use of $CC environment variable which is defined by X/Open - as a curses feature, to ignore it if it is not a single character - (prompted by discussion with Benjamin C W Sittler). - + add START_TRACE in slk_init - + fix a regression in _nc_ripoffline which made test/ncurses.c not show - soft-keys, broken in 20090927 merging. - + change initialization of "hidden" flag for soft-keys from true to - false, broken in 20090704 merging (Ubuntu #464274). - + update nsterm entries (patch by Benjamin C W Sittler, prompted by - discussion with Fabian Groffen in GenToo #206201). - + add test/xterm-256color.dat - -20091024 - + quiet some pedantic gcc warnings. - + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a - SIGWINCH, and discard that value, to avoid confusing application - (patch by Eygene Ryabinkin, FreeBSD bin/136223). - -20091017 - + modify handling of $PKG_CONFIG_LIBDIR to use only the first item in - a possibly colon-separated list (Debian #550716). - -20091010 - + supply a null-terminator to buffer in _nc_viswibuf(). - + fix a sign-extension bug in unget_wch() (report by Mike Gran). - + minor fixes to error-returns in default function for tputs, as well - as in lib_screen.c - -20091003 - + add WACS_xxx definitions to wide-character configuration for thick- - and double-lines (discussion with Slava Zanko). - + remove unnecessary kcan assignment to ^C from putty (Sven Joachim) - + add ccc and initc capabilities to xterm-16color -TD - > patch by Benjamin C W Sittler: - + add linux-16color - + correct initc capability of linux-c-nc end-of-range - + similar change for dg+ccc and dgunix+ccc - -20090927 - + move leak-checking for comp_captab.c into _nc_leaks_tinfo() since - that module since 20090711 is in libtinfo. - + add configure option --enable-term-driver, to allow compiling with - terminal-driver. That is used in MinGW port, and (being somewhat - more complicated) is an experimental alternative to the conventional - termlib internals. Currently, it requires the sp-funcs feature to - be enabled. - + completed integrating "sp-funcs" by Juergen Pfeifer in ncurses - library (some work remains for forms library). - -20090919 - + document return code from define_key (report by Mike Gran). - + make some symbolic links in the terminfo directory-tree shorter - (patch by Daniel Jacobowitz, forwarded by Sven Joachim).). - + fix some groff warnings in terminfo.5, etc., from recent Debian - changes. - + change ncv and op capabilities in sun-color terminfo entry to match - Sun's entry for this (report by Laszlo Peter). - + improve interix smso terminfo capability by using reverse rather than - bold (report by Kristof Zelechovski). - -20090912 - + add some test programs (and make these use the same special keys - by sharing linedata.h functions): - test/test_addstr.c - test/test_addwstr.c - test/test_addchstr.c - test/test_add_wchstr.c - + correct internal _nc_insert_ch() to use _nc_insert_wch() when - inserting wide characters, since the wins_wch() function that it used - did not update the cursor position (report by Ciprian Craciun). - -20090906 - + fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not - work. - + add null-pointer checks to other opaque-functions. - + add is_pad() and is_subwin() functions for opaque access to WINDOW - (discussion with Mark Dickinson). - + correct merge to lib_newterm.c, which broke when sp-funcs was - enabled. - -20090905 - + build-fix for building outside source-tree (report by Sven Joachim). - + fix Debian lintian warning for man/tabs.1 by making section number - agree with file-suffix (report by Sven Joachim). - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090829 - + workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on - amd64 (Debian #542031). - + fix typo in curs_mouse.3x (Debian #429198). - -20090822 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090815 - + correct use of terminfo capabilities for initializing soft-keys, - broken in 20090509 merging. - + modify wgetch() to ensure it checks SIGWINCH when it gets an error - in non-blocking mode (patch by Clemens Ladisch). - + use PATH_SEPARATOR symbol when substituting into run_tic.sh, to - help with builds on non-Unix platforms such as OS/2 EMX. - + modify scripting for misc/run_tic.sh to test configure script's - $cross_compiling variable directly rather than comparing host/build - compiler names (prompted by comment in GenToo #249363). - + fix configure script option --with-database, which was coded as an - enable-type switch. - + build-fixes for --srcdir (report by Frederic L W Meunier). - -20090808 - + separate _nc_find_entry() and _nc_find_type_entry() from - implementation details of hash function. - -20090803 - + add tabs.1 to man/man_db.renames - + modify lib_addch.c to compensate for removal of wide-character test - from unctrl() in 20090704 (Debian #539735). - -20090801 - + improve discussion in INSTALL for use of system's tic/infocmp for - cross-compiling and building fallbacks. - + modify test/demo_termcap.c to correspond better to options in - test/demo_terminfo.c - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - + fix logic for 'V' in test/ncurses.c tests f/F. - -20090728 - + correct logic in tigetnum(), which caused tput program to treat all - string capabilities as numeric (report by Rajeev V Pillai, - cf: 20090711). - -20090725 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090718 - + fix a null-pointer check in _nc_format_slks() in lib_slk.c, from - 20070704 changes. - + modify _nc_find_type_entry() to use hashing. - + make CCHARW_MAX value configurable, noting that changing this would - change the size of cchar_t, and would be ABI-incompatible. - + modify test-programs, e.g,. test/view.c, to address subtle - differences between Tru64/Solaris and HPUX/AIX getcchar() return - values. - + modify length returned by getcchar() to count the trailing null - which is documented in X/Open (cf: 20020427). - + fixes for test programs to build/work on HPUX and AIX, etc. - -20090711 - + improve performance of tigetstr, etc., by using hashing code from tic. - + minor fixes for memory-leak checking. - + add test/demo_terminfo, for comparison with demo_termcap - -20090704 - + remove wide-character checks from unctrl() (patch by Clemens Ladisch). - + revise wadd_wch() and wecho_wchar() to eliminate dependency on - unctrl(). - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090627 - + update llib-lncurses[wt] to use sp-funcs. - + various code-fixes to build/work with --disable-macros configure - option. - + add several new files from Juergen Pfeifer which will be used when - integration of "sp-funcs" is complete. This includes a port to - MinGW. - -20090613 - + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to - make includes of term.h without curses.h work (report by "Nix"). - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090607 - + fix a regression in lib_tputs.c, from ongoing merges. - -20090606 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090530 - + fix an infinite recursion when adding a legacy-coding 8-bit value - using insch() (report by Clemens Ladisch). - + free home-terminfo string in del_curterm() (patch by Dan Weber). - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090523 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090516 - + work around antique BSD game's manipulation of stdscr, etc., versus - SCREEN's copy of the pointer (Debian #528411). - + add a cast to wattrset macro to avoid compiler warning when comparing - its result against ERR (adapted from patch by Matt Kraii, Debian - #528374). - -20090510 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090502 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - + add vwmterm terminfo entry (patch by Bryan Christ). - -20090425 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090419 - + build fix for _nc_free_and_exit() change in 20090418 (report by - Christian Ebert). - -20090418 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090411 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - This change finishes merging for menu and panel libraries, does - part of the form library. - -20090404 - + suppress configure check for static/dynamic linker flags for gcc on - Darwin (report by Nelson Beebe). - -20090328 - + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving - function key definitions from emx-base for consistency -TD - + correct missing final 'p' in pfkey capability of ansi.sys-old (report - by Kalle Olavi Niemitalo). - + improve test/ncurses.c 'F' test, show combining characters in color. - + quiet a false report by cppcheck in c++/cursesw.cc by eliminating - a temporary variable. - + use _nc_doalloc() rather than realloc() in a few places in ncurses - library to avoid leak in out-of-memory condition (reports by William - Egert and Martin Ettl based on cppcheck tool). - + add --with-ncurses-wrap-prefix option to test/configure (discussion - with Charles Wilson). - + use ncurses*-config scripts if available for test/configure. - + update test/aclocal.m4 and test/configure - > patches by Charles Wilson: - + modify CF_WITH_LIBTOOL configure check to allow unreleased libtool - version numbers (e.g. which include alphabetic chars, as well as - digits, after the final '.'). - + improve use of -no-undefined option for libtool by setting an - intermediate variable LT_UNDEF in the configure script, and then - using that in the libtool link-commands. - + fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk - from 2009031 changes. - + improve mk-1st.awk script by writing separate cases for the - LIBTOOL_LINK command, depending on which library (ncurses, ticlib, - termlib) is to be linked. - + modify configure.in to allow broken-linker configurations, not just - enable-reentrant, to set public wrap prefix. - -20090321 - + add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to - build with tic and term libraries (patch by Charles Wilson). - + add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX - (report by Charles Wilson). - + fix definition for c++/Makefile.in's SHLIB_LIST, which did not list - the form, menu or panel libraries (patch by Charles Wilson). - + add configure option --with-wrap-prefix to allow setting the prefix - for functions used to wrap global variables to something other than - "_nc_" (discussion with Charles Wilson). - -20090314 - + modify scripts to generate ncurses*-config and pc-files to add - dependency for tinfo library (patch by Charles Wilson). - + improve comparison of program-names when checking for linked flavors - such as "reset" by ignoring the executable suffix (reports by Charles - Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing - list). - + suppress configure check for static/dynamic linker flags for gcc on - Solaris 10, since gcc is confused by absence of static libc, and - does not switch back to dynamic mode before finishing the libraries - (reports by Joel Bertrand, Alan Pae). - + minor fixes to Intel compiler warning checks in configure script. - + modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works. - + modify set_curterm() to make broken-linker configuration work with - changes from 20090228 (report by Charles Wilson). - -20090228 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - + modify declaration of cur_term when broken-linker is used, but - enable-reentrant is not, to match pre-5.7 (report by Charles Wilson). - -20090221 - + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). - -20090214 - + add configure script --enable-sp-funcs to enable the new set of - extended functions. - + start integrating patches by Juergen Pfeifer: - + add extended functions which specify the SCREEN pointer for several - curses functions which use the global SP (these are incomplete; - some internals work is needed to complete these). - + add special cases to configure script for MinGW port. - -20090207 - + update several configure macros from lynx changes - + append (not prepend) to CFLAGS/CPPFLAGS - + change variable from PATHSEP to PATH_SEPARATOR - + improve install-rules for pc-files (patch by Miroslav Lichvar). - + make it work with $DESTDIR - + create the pkg-config library directory if needed. - -20090124 - + modify init_pair() to allow caller to create extra color pairs beyond - the color_pairs limit, which use default colors (request by Emanuele - Giaquinta). - + add misc/terminfo.tmp and misc/*.pc to "sources" rule. - + fix typo "==" where "=" is needed in ncurses-config.in and - gen-pkgconfig.in files (Debian #512161). - -20090117 - + add -shared option to MK_SHARED_LIB when -Bsharable is used, for - *BSD's, without which "main" might be one of the shared library's - dependencies (report/analysis by Ken Dickey). - + modify waddch_literal(), updating line-pointer after a multicolumn - character is found to not fit on the current row, and wrapping is - done. Since the line-pointer was not updated, the wrapped - multicolumn character was written to the beginning of the current row - (cf: 20041023, reported by "Nick" regarding problem with ncmpc - http://musicpd.org/mantis/bug_view_page.php?bug_id=1930). - -20090110 - + add screen.Eterm terminfo entry (GenToo #124887) -TD - + modify adacurses-config to look for ".ali" files in the adalib - directory. - + correct install for Ada95, which omitted libAdaCurses.a used in - adacurses-config - + change install for adacurses-config to provide additional flavors - such as adacursesw-config, for ncursesw (GenToo #167849). - -20090105 - + remove undeveloped feature in ncurses-config.in for setting - prefix variable. - + recent change to ncurses-config.in did not take into account the - --disable-overwrite option, which sets $includedir to the - subdirectory and using just that for a -I option does not work - fix - (report by Frederic L W Meunier). - -20090104 - + modify gen-pkgconfig.in to eliminate a dependency on rpath when - deciding whether to add $LIBS to --libs output; that should be shown - for the ncurses and tinfo libraries without taking rpath into - account. - + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk, - used in static libraries (report by Marty Jack). - -20090103 - + add a configure-time check to pick a suitable value for - CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen). - + add configure --with-pkg-config and --enable-pc-files options, along - with misc/gen-pkgconfig.in which can be used to generate ".pc" files - for pkg-config (request by Jan Engelhardt). - + use $includedir symbol in misc/ncurses-config.in, add --includedir - option. - + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a - configure check to detect whether a "-" is needed before "ar" - options. - + update config.guess, config.sub from - http://savannah.gnu.org/projects/config - -20081227 - + modify mk-1st.awk to work with extra categories for tinfo library. - + modify configure script to allow building shared libraries with gcc - on AIX 5 or 6 (adapted from patch by Lital Natan). - -20081220 - + modify to omit the opaque-functions from lib_gen.o when - --disable-ext-funcs is used. - + add test/clip_printw.c to illustrate how to use printw without - wrapping. - + modify ncurses 'F' test to demo wborder_set() with colored lines. - + modify ncurses 'f' test to demo wborder() with colored lines. - -20081213 - + add check for failure to open hashed-database needed for db4.6 - (GenToo #245370). - + corrected --without-manpages option; previous change only suppressed - the auxiliary rules install.man and uninstall.man - + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from - GenToo #250454). - + fixes from NetBSD port at - http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches - patch-ac (build-fix for DragonFly) - patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config). - + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH - by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the - search-lists. - + correct title string for keybound manpage (patch by Frederic Culot, - OpenBSD documentation/6019), - -20081206 - + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to - work for progs/clear, progs/tabs, etc. - + correct buffer-size after internal resizing of wide-character - set_field_buffer(), broken in 20081018 changes (report by Mike Gran). - + add "-i" option to test/filter.c to tell it to use initscr() rather - than newterm(), to investigate report on comp.unix.programmer that - ncurses would clear the screen in that case (it does not - the issue - was xterm's alternate screen feature). - + add check in mouse-driver to disable connection if GPM returns a - zero, indicating that the connection is closed (Debian #506717, - adapted from patch by Samuel Thibault). - -20081129 - + improve a workaround in adding wide-characters, when a control - character is found. The library (cf: 20040207) uses unctrl() to - obtain a printable version of the control character, but was not - passing color or video attributes. - + improve test/ncurses.c 'a' test, using unctrl() more consistently to - display meta-characters. - + turn on _XOPEN_CURSES definition in curses.h - + add eterm-color entry (report by Vincent Lefevre) -TD - + correct use of key_name() in test/ncurses.c 'A' test, which only - displays wide-characters, not key-codes since 20070612 (report by - Ricardo Cantu). - -20081122 - + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and - Ada95 (patch by Juergen Pfeifer). - + document in TO-DO an issue with Cygwin's package for GNAT (report - by Mike Dennison). - + improve error-checking of command-line options in "tabs" program. - -20081115 - + change several terminfo entries to make consistent use of ANSI - clear-all-tabs -TD - + add "tabs" program (prompted by Debian #502260). - + add configure --without-manpages option (request by Mike Frysinger). - 20081102 5.7 release for upload to ftp.gnu.org 20081025 @@ -1147,7 +77,7 @@ it is not possible to add this information. overlooked til now. 20081011 - + regenerated html documentation. + + update html documentation. + add -m and -s options to test/keynames.c and test/key_names.c to test the meta() function with keyname() or key_name(), respectively. + correct return value of key_name() on error; it is null. @@ -3274,7 +2204,7 @@ it is not possible to add this information. (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., - #define NCURSES_ENABLE_STDBOOL_H 0 + #define NCURSES_ENABLE_STDBOOL_H 0 #include (discussion on XFree86 mailing list). @@ -3854,7 +2784,7 @@ it is not possible to add this information. 20030208 + add checking in tic for incomplete line-drawing character mapping. - + updated configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, + + update configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda ). + make return value from _nc_printf_string() consistent. Before, @@ -4573,7 +3503,7 @@ it is not possible to add this information. + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. - + updated configure macro CF_WITH_PATHLIST, to omit some double quotes + + update configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) diff --git a/README.MinGW b/README.MinGW deleted file mode 100644 index d111b387784..00000000000 --- a/README.MinGW +++ /dev/null @@ -1,149 +0,0 @@ -------------------------------------------------------------------------------- --- Copyright (c) 2008-2010,2011 Free 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: README.MinGW,v 1.5 2011/02/26 16:57:17 tom Exp $ --- Author: Juergen Pfeifer -------------------------------------------------------------------------------- - -This is work in progress, but it's in an state where one can see it -works at least on the Windows Console. - -You should install the MSYS package, so that you've a shell environment that -allows you to run the scripts, especially configure etc. You can get that -from http://www.mingw.org - -To build ncurses for native Windows, you need the MinGW toolchain. The -original MinGW toolchain from the above site is only for 32-Bit Windows. As -Windows Server - and also regular workstations - are moving to 64-Bit, it -seems to be reasonable to have a toolchain that supports both architectures. -I recommend to use the TDM gcc toolchain which you can find at -http://tdm-gcc.tdragon.net/download. Go to the download section and select -the bundle installer for tdm64 (MinGW-w64). This installs a multilib version -of the gcc toolchain that can compile for native 32- and 64-Bit Windows -versions. It also comes with a working pthread implementation. - -The latest config and build scripts we use for MinGW have only been tested -for the gcc-4.4 compiler toolchain (or better). - -Using MinGW is a pragmatic decision, it's the easiest way to port this -heavily UNIX based sourcebase to native Windows. The goal is of course -to provide the includes, libraries and DLLs to be used with the more -common traditional development environments on Windows, mainly with -Microsoft Visual Studio. - -If you start a bash from the MSYS environment, please make sure that the -Microsoft Development tools are in your PATH right after the MinGW -tools. The LIB.EXE tool is the only one needed. You need this only if -you want to build DLLs that work with native Windows programs. If you -don't have any Microsoft Development tools on your machine, consider -at least to get the free "Visual C++ 2010 Express Edition". -It contains the LIB.EXE tool. You may also use this compiler to test -writing native Windows programs using the ncurses DLLs without using -MinGW then for writing apps. - -It is necessary to unset the TERM environment variable, to activate the -Windows console-driver. - -Please also make sure that MSYS links to the correct directory containing -your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows -CMD.EXE command shell go to the MSYS root directory (most probably -C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw -that points to the MinGW toolchain directory. If not, delete the mingw -directory and use the mklink command (or the linkd.exe utility on older -Windows) to create the junction point. - -This code requires WindowsNT 5.1 or better, which means on the client -Windows XP or better, on the server Windows Server 2003 or better. - -In order to build ncurses for the planned interop layer with .NET, we -recommend to use these options with configure - - --disable-home-terminfo - --enable-reentrant - --enable-sp-funcs - --enable-term-driver - --enable-interop - --with-pthread (if using TDM toolchain as recommended) - -This is the configuration commandline as I'm using it at the moment: - -./configure \ - --prefix=/mingw \ - --without-cxx-binding \ - --without-ada \ - --enable-warnings \ - --enable-assertions \ - --enable-reentrant \ - --with-debug \ - --with-normal \ - --disable-home-terminfo \ - --enable-sp-funcs \ - --enable-term-driver \ - --enable-interop \ - --with-pthread - -If you are on a 64-Bit Windows system and want to build a 32-Bit version -of ncurses, you may use this commandline for configuration (when using -the TDM toolchain): - -CC="gcc -m32" LD="ld -m32" ./configure \ - --prefix=/mingw \ - --without-cxx-binding \ - --without-ada \ - --enable-warnings \ - --enable-assertions \ - --enable-reentrant \ - --with-debug \ - --with-normal \ - --disable-home-terminfo \ - --enable-sp-funcs \ - --enable-term-driver \ - --enable-interop \ - --with-pthread - -All the options above are - like the whole Windows support - -experimental. - -In order to build the DLLs, after your regular make you must call - - make dlls - -A lot is still TODO, e.g.: - - - Wide Character support - The Win32Con driver should actually only use Unicode in the - future. - - Thread support (locking). If using TDM toolchain this is done by - configuring pthreads. - - A GUI console driver - - Support for Terminals attached via a serial port (via terminfo) - - Support for networked Terminal connections (via terminfo) - - Workarounds for MinGW's filesystem access are necessary to make infocmp - work (though tic works). - -To support terminfo, we need to have an ioctl() simulation for the -serial and networked Terminals. diff --git a/TO-DO b/TO-DO index 5df7f47e722..ca47d02d0ec 100644 --- a/TO-DO +++ b/TO-DO @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2007,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 -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: TO-DO,v 1.57 2011/03/28 00:23:02 tom Exp $ +-- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $ ------------------------------------------------------------------------------- SHORT-TERM TO-DO ITEMS: @@ -45,7 +45,7 @@ Known Problems: + Scrolling optimization has holes: for example, it forces repaints of the screen between calls to refresh(). -+ SVr4 uses slightly different rules for determining when softkeys are shown. ++ SVr4 uses slightly different rules for determining when softkeys are shown. For example, they are initially displayed (before the ncurses 'e' test activates them), and a touchwin can apparently also force them to be displayed. @@ -58,7 +58,7 @@ Known Problems: + The window classes defined in the c++ subdirectory need documentation. Some C++ programmer could earn a lot of good karma by doing this... -+ vid_attr() should support the set_a_attributes (sgr1) string, but does not. ++ vid_attr() should support the set_a_attributes (sgr1) string, but does not. There appear to be no terminals that require that functionality. + the configure --disable-ext-funcs option does not work for Ada95 tree. @@ -72,28 +72,27 @@ Known Problems: Building those with libtool does not work either. (This is a problem with the BSD platforms). -+ more work is needed to make the MinGW port support ordinary terminals. - Portability (or lack thereof): + Users of older System V UNIXes (but not Solaris, and probably not SVr4) may trip over a known problem with the signal-handling code which causes abrupt termination of ncurses applications following resume from a ^Z suspend (this problem was first seen running lynx). You will not see this problem if you - are using one of the 4.4BSD derivatives like such as, NetBSD, or BSDI, or - systems using that convention. For details, see the analysis in the header - comment of ncurses/tty/lib_tstp.c . + are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or + BSDI. For details, see the analysis in the header comment of + ncurses/tty/lib_tstp.c . + In theory, vwprintw and vwscanf are supposed to use the older varargs.h interface for handling variadic argument lists (and are deprecated by X/Open - for that reason). Many newer systems do no have varargs.h, instead they have - only the newer X/Open-standard stdargs.h equivalent. So these functions use - stdargs instead. This is unlikely to be a problem unless you're building - ncurses on a System V old enough to only have varargs.h. (Solaris 2.5.1 used - the stdarg.h binding as well). + for that reason). Linux doesn't have varargs.h, it has the newer + X/Open-standard stdargs.h equivalent. So these functions use stdargs + instead. This is unlikely to be a problem unless you're building ncurses on + a System V old enough to only have varargs.h. (Solaris 2.5.1 used the + stdarg.h binding as well). -+ If you're using a system old enough not to have a native vsscanf(3) in its - library, vwscanw() will not work. If you want to fix this, add an ++ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have + a native vsscanf(3) in its library, vwscanw() will not work. You lose. (It + should work on any System V, however). If you want to fix this, add an implementation to ncurses/vsscanf.c. + The C++ binding fails to build with a few C++ compilers. @@ -123,7 +122,7 @@ supporting internationalization. 2. DOS port Only a few of the files in the library depend on the terminfo format. -It should be possible to further kernelize the package, then rewrite +It should be possible to further kernelize the package, then rewrite a small number of core files to produce a functionally-compatible port that would do updates to a memory-mapped screen area. The first result of this would be a DOS port. @@ -196,10 +195,10 @@ F. Unused VDT capabilities: move_insert, dest_tabs_magic_smso, transparent_underline, needs_xon_xoff, hard_cursor. Numerics: lines_of_memory, buttons. - Strings: pkey_key, pkey_local, pkey_xmit, underline_char, - enter_xon_mode, exit_xon_mode, xon_character, xoff_character, + Strings: pkey_key, pkey_local, pkey_xmit, underline_char, + enter_xon_mode, exit_xon_mode, xon_character, xoff_character, display_clock, remove_clock, user[0-5], display_pc_char, - enter_scancode_mode, exit_scancode_mode, pc_term_options, + enter_scancode_mode, exit_scancode_mode, pc_term_options, scancode_escape, alt_scancode_esc. These are the potentially important ones for ncurses. Notes: diff --git a/aclocal.m4 b/aclocal.m4 index 9a828559d4a..4c8e818f240 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2007,2008 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 * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.553 2011/03/31 23:35:38 tom Exp $ +dnl $Id: aclocal.m4,v 1.470 2008/10/25 22:15:32 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -62,13 +62,13 @@ AC_DEFUN([AM_LANGINFO_CODESET], fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 +dnl CF_ADA_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. AC_DEFUN([CF_ADA_INCLUDE_DIRS], [ -ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -86,15 +86,7 @@ fi AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18 -dnl --------------- -dnl Add to $ADAFLAGS, which is substituted into makefile and scripts. -AC_DEFUN([CF_ADD_ADAFLAGS],[ - ADAFLAGS="$ADAFLAGS $1" - AC_SUBST(ADAFLAGS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 +dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -120,8 +112,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -136,12 +128,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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" ;; esac @@ -157,24 +143,24 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then - ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$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" + ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then - ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) + ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi @@ -182,7 +168,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 +dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 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, @@ -209,7 +195,7 @@ if test -n "$1" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS @@ -225,11 +211,11 @@ if test -n "$1" ; then if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) - ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" + ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)" - 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" + 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 @@ -239,15 +225,7 @@ if test -n "$1" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 -dnl ---------- -dnl Add a library, used to enforce consistency. -dnl -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: 6 updated: 2008/02/09 13:15:34 dnl ------------- dnl Adds to the library-path dnl @@ -276,22 +254,14 @@ if test -n "$1" ; then 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])" + ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 -dnl ----------- -dnl Add one or more libraries, used to enforce consistency. -dnl -dnl $1 = libraries to add, with the "-l", etc. -dnl $2 = variable to update (default $LIBS) -AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 +dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -303,7 +273,7 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "$4" != "$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { +ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" @@ -313,13 +283,13 @@ ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { } ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 +dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 dnl ---------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ -AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -383,89 +353,7 @@ You have the following choices: fi ])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. -AC_DEFUN([CF_ARG_DISABLE], -[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 -dnl ------------- -dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus -dnl values. -dnl -dnl Parameters: -dnl $1 = option name -dnl $2 = help-string -dnl $3 = action to perform if option is not default -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 -ifelse([$3],,[ :]dnl -,[ $3]) ifelse([$4],,,[ - else - $4]) - fi],[enableval=$5 ifelse([$4],,,[ - $4 -])dnl - ])])dnl -dnl --------------------------------------------------------------------------- -dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29 -dnl ----------- -dnl Check for suitable "ar" (archiver) options for updating an archive. -AC_DEFUN([CF_AR_FLAGS],[ -AC_REQUIRE([CF_PROG_AR]) - -AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ - cf_cv_ar_flags=unknown - for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv - do - - # check if $ARFLAGS already contains this choice - if test "x$ARFLAGS" != "x" ; then - cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` - if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then - cf_cv_ar_flags= - break - fi - fi - - rm -f conftest.$ac_cv_objext - rm -f conftest.a - - cat >conftest.$ac_ext <&AC_FD_CC - $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null - if test -f conftest.a ; then - cf_cv_ar_flags=$cf_ar_flags - break - fi - else - CF_VERBOSE(cannot compile test-program) - break - fi - done - rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext -]) - -if test -n "$ARFLAGS" ; then - if test -n "$cf_cv_ar_flags" ; then - ARFLAGS="$ARFLAGS $cf_cv_ar_flags" - fi -else - ARFLAGS=$cf_cv_ar_flags -fi - -AC_SUBST(ARFLAGS) -]) -dnl --------------------------------------------------------------------------- -dnl CF_AWK_BIG_PRINTF version: 3 updated: 2008/12/27 12:30:03 +dnl CF_AWK_BIG_PRINTF version: 2 updated: 2008/10/04 17:16:18 dnl ----------------- dnl Check if awk can handle big strings using printf. Some older versions of dnl awk choke on large strings passed via "%s". @@ -474,19 +362,19 @@ dnl $1 = desired string size dnl $2 = variable to set with result AC_DEFUN([CF_AWK_BIG_PRINTF], [ - case x$AWK in #(vi - x) - eval $2=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval $2=yes - else - eval $2=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval $2=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval $2=yes + else + eval $2=no + fi + ;; + esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18 @@ -807,7 +695,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42 +dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it @@ -825,7 +713,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ #include #include #include ], - ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, + ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) @@ -836,7 +724,7 @@ if test "$cf_cv_dcl_$1" = no ; then fi # It's possible (for near-UNIX clones) that the data doesn't exist -CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) +CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2)) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 @@ -864,7 +752,7 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_GPM_WGETCH version: 2 updated: 2010/08/14 18:25:37 +dnl CF_CHECK_GPM_WGETCH version: 1 updated: 2007/04/28 14:38:06 dnl ------------------- dnl Check if GPM is already linked with curses. If so - and if the linkage dnl is not "weak" - warn about this because it can create problems linking @@ -898,7 +786,7 @@ CF_EOF test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -rf conftest* + rm -f conftest* LIBS="$cf_save_LIBS" fi ]) @@ -999,7 +887,7 @@ fi test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C_INLINE version: 3 updated: 2010/05/01 15:14:41 +dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50 dnl ----------- dnl Check if the C compiler supports "inline". dnl $1 is the name of a shell variable to set if inline is supported @@ -1014,7 +902,7 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - AC_CACHE_CHECK(if $CC supports options to tune inlining,cf_cv_gcc_inline,[ + AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[ cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=$2" AC_TRY_COMPILE([inline int foo(void) { return 1; }], @@ -1057,7 +945,7 @@ done AC_SUBST(DIRS_TO_MAKE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 +dnl CF_DISABLE_LEAKS version: 4 updated: 2006/12/16 15:10:42 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -1070,71 +958,27 @@ AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], - [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], + [with_no_leaks=yes], : ${with_no_leaks:=no}) AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then AC_DEFINE(NO_LEAKS) - AC_DEFINE(YY_NO_LEAKS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LIBTOOL_VERSION version: 1 updated: 2010/05/15 15:45:59 -dnl -------------------------- -dnl Check if we should use the libtool 1.5 feature "-version-number" instead of -dnl the older "-version-info" feature. The newer feature allows us to use -dnl version numbering on shared libraries which make them compatible with -dnl various systems. -AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION], -[ -AC_MSG_CHECKING(if libtool -version-number should be used) -CF_ARG_DISABLE(libtool-version, - [ --disable-libtool-version enable to use libtool's incompatible naming scheme], - [cf_libtool_version=no], - [cf_libtool_version=yes]) -AC_MSG_RESULT($cf_libtool_version) - -if test "$cf_libtool_version" = yes ; then - LIBTOOL_VERSION="-version-number" -else - LIBTOOL_VERSION="-version-info" -fi - -AC_SUBST(LIBTOOL_VERSION) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33 -dnl --------------------- -dnl The rpath-hack makes it simpler to build programs, particularly with the -dnl *BSD ports which may have essential libraries in unusual places. But it -dnl can interfere with building an executable for the base system. Use this -dnl option in that case. -AC_DEFUN([CF_DISABLE_RPATH_HACK], -[ -AC_MSG_CHECKING(if rpath-hack should be disabled) -CF_ARG_DISABLE(rpath-hack, - [ --disable-rpath-hack don't add rpath options for additional libraries], - [cf_disable_rpath_hack=yes], - [cf_disable_rpath_hack=no]) -AC_MSG_RESULT($cf_disable_rpath_hack) -if test "$cf_disable_rpath_hack" = no ; then - CF_RPATH_HACK -fi -]) -dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42 +dnl CF_ENABLE_RPATH version: 1 updated: 2008/09/13 10:22:30 dnl --------------- dnl Check if the rpath option should be used, setting cache variable -dnl cf_cv_enable_rpath if so. +dnl cf_cv_ld_rpath if so. AC_DEFUN([CF_ENABLE_RPATH], [ AC_MSG_CHECKING(if rpath option should be used) AC_ARG_ENABLE(rpath, [ --enable-rpath use rpath option when generating shared libraries], -[cf_cv_enable_rpath=$enableval], -[cf_cv_enable_rpath=no]) -AC_MSG_RESULT($cf_cv_enable_rpath) +[cf_cv_ld_rpath=$enableval], +[cf_cv_ld_rpath=no]) +AC_MSG_RESULT($cf_cv_ld_rpath) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 @@ -1175,7 +1019,7 @@ AC_MSG_RESULT($cf_result) CXXFLAGS="$cf_save_CXXFLAGS" ]) dnl --------------------------------------------------------------------------- -dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 +dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53 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. @@ -1204,26 +1048,10 @@ cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) -cf_save_LIBS="$LIBS" +AC_TRY_LINK([$1],[$2], + cf_cv_find_linkage_$3=yes,[ + cf_cv_find_linkage_$3=no -AC_TRY_LINK([$1],[$2],[ - cf_cv_find_linkage_$3=yes - cf_cv_header_path_$3=/usr/include - cf_cv_library_path_$3=/usr/lib -],[ - -LIBS="-l$3 $7 $cf_save_LIBS" - -AC_TRY_LINK([$1],[$2],[ - cf_cv_find_linkage_$3=yes - cf_cv_header_path_$3=/usr/include - cf_cv_library_path_$3=/usr/lib - cf_cv_library_file_$3="-l$3" -],[ - 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" @@ -1282,6 +1110,7 @@ AC_TRY_LINK([$1],[$2],[ ]) fi done + LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -1290,22 +1119,19 @@ AC_TRY_LINK([$1],[$2],[ cf_cv_find_linkage_$3=no fi ],$7) -]) - -LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ - CF_ADD_INCDIR($cf_cv_header_path_$3) - CF_ADD_LIBDIR($cf_cv_library_path_$3) - CF_ADD_LIB($3) + CF_ADD_INCDIR($cf_cv_header_path_$3) + CF_ADD_LIBDIR($cf_cv_library_path_$3) + LIBS="-l$3 $LIBS" ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02 +dnl CF_FUNC_DLSYM version: 1 updated: 2004/06/16 20:52:45 dnl ------------- dnl Test for dlsym() and related functions, as well as libdl. dnl @@ -1322,7 +1148,7 @@ AC_CHECK_LIB(dl,dlsym,[ cf_have_libdl=yes])]) if test "$cf_have_dlsym" = yes ; then - test "$cf_have_libdl" = yes && CF_ADD_LIB(dl) + test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" AC_MSG_CHECKING(whether able to link to dl*() functions) AC_TRY_LINK([#include ],[ @@ -1405,7 +1231,7 @@ int main() { test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP) ]) dnl --------------------------------------------------------------------------- -dnl CF_FUNC_OPENPTY version: 3 updated: 2010/05/29 16:31:02 +dnl CF_FUNC_OPENPTY version: 2 updated: 2008/04/12 19:49:01 dnl --------------- dnl Check for openpty() function, along with header. It may need the dnl "util" library as well. @@ -1414,7 +1240,7 @@ 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) + test $cf_cv_lib_util = yes && LIBS="-lutil $LIBS" for cf_header in pty.h libutil.h util.h do AC_TRY_LINK([ @@ -1536,7 +1362,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 +dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1563,7 +1389,7 @@ if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) cat > conftest.$ac_ext <&AC_FD_CC - - case $cf_attribute in #(vi - printf) #(vi - cf_printf_attribute=yes - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <>confdefs.h - case $cf_attribute in #(vi - printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then - cf_gnat_projects=yes - fi - cd .. - if test -f conftest.lib/confpackage.ali - then - cf_gnat_libraries=yes - fi - rm -rf conftest* *~conftest* - ;; - esac - ;; -esac -AC_MSG_RESULT($cf_gnat_projects) - -if test $cf_gnat_projects = yes -then - AC_MSG_CHECKING(if GNAT supports libraries) - AC_MSG_RESULT($cf_gnat_libraries) -fi - -if test "$cf_gnat_projects" = yes -then - USE_OLD_MAKERULES="#" - USE_GNAT_PROJECTS="" -else - USE_OLD_MAKERULES="" - USE_GNAT_PROJECTS="#" -fi - -if test "$cf_gnat_libraries" = yes -then - USE_GNAT_LIBRARIES="" -else - USE_GNAT_LIBRARIES="#" -fi - -AC_SUBST(USE_OLD_MAKERULES) -AC_SUBST(USE_GNAT_PROJECTS) -AC_SUBST(USE_GNAT_LIBRARIES) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 -dnl -------------- -dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it -dnl is noted that gnat may compile a tasking unit even for configurations which -dnl fail at runtime. -AC_DEFUN([CF_GNAT_SIGINT],[ -AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ -CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; - -package ConfTest is - - pragma Warnings (Off); -- the next pragma exists since 3.11p - pragma Unreserve_All_Interrupts; - pragma Warnings (On); - - protected Process is - procedure Stop; - function Continue return Boolean; - pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); - private - Done : Boolean := False; - end Process; - -end ConfTest;], -[package body ConfTest is - protected body Process is - procedure Stop is - begin - Done := True; - end Stop; - function Continue return Boolean is - begin - return not Done; - end Continue; - end Process; -end ConfTest;], - [cf_cv_gnat_sigint=yes], - [cf_cv_gnat_sigint=no])]) - -if test $cf_cv_gnat_sigint = yes ; then - USE_GNAT_SIGINT="" -else - USE_GNAT_SIGINT="#" -fi -AC_SUBST(USE_GNAT_SIGINT) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 +dnl CF_GNAT_TRY_LINK version: 1 updated: 2004/08/21 19:02:08 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1994,7 +1574,7 @@ dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ -rm -rf conftest* *~conftest* +rm -f conftest* cat >>conftest.ads <>conftest.ads <&1 | \ - grep '[[0-9]].[[0-9]][[0-9]]*' |\ - sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` +cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` AC_MSG_RESULT($cf_gnat_version) -case $cf_gnat_version in #(vi -3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi - cf_cv_prog_gnat_correct=yes - ;; -*) - AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) - cf_cv_prog_gnat_correct=no - ;; +case $cf_gnat_version in + 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) + cf_cv_prog_gnat_correct=yes + ;; + *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. + cf_cv_prog_gnat_correct=no + ;; +esac +case $cf_gnat_version in + 3.[[1-9]]*|[[4-9]].*) + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" + ;; + *) cf_compile_generics= + cf_generic_objects= + ;; esac ]) dnl --------------------------------------------------------------------------- @@ -2092,7 +1679,7 @@ make an error test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GPP_LIBRARY version: 10 updated: 2010/05/29 16:31:02 +dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46 dnl -------------- dnl If we're trying to use g++, test if libg++ is installed (a rather common dnl problem :-). If we have the compiler but no library, we'll be able to @@ -2111,13 +1698,13 @@ esac if test "$GXX" = yes; then AC_MSG_CHECKING([for lib$cf_gpp_libname]) cf_save="$LIBS" - CF_ADD_LIB($cf_gpp_libname) + LIBS="$LIBS -l$cf_gpp_libname" AC_TRY_LINK([ #include <$cf_gpp_libname/builtin.h> ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CF_ADD_LIB($cf_gpp_libname,CXXLIBS) + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" if test "$cf_gpp_libname" = cpp ; then AC_DEFINE(HAVE_GPP_BUILTIN_H) else @@ -2128,7 +1715,7 @@ if test "$GXX" = yes; then ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CF_ADD_LIB($cf_gpp_libname,CXXLIBS) + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" AC_DEFINE(HAVE_BUILTIN_H)], [cf_cxx_library=no])]) LIBS="$cf_save" @@ -2136,7 +1723,7 @@ if test "$GXX" = yes; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_VERSION version: 6 updated: 2010/10/23 15:44:18 +dnl CF_GXX_VERSION version: 5 updated: 2005/08/27 09:53:42 dnl -------------- dnl Check for version of g++ AC_DEFUN([CF_GXX_VERSION],[ @@ -2144,13 +1731,13 @@ AC_REQUIRE([AC_PROG_CPP]) GXX_VERSION=none if test "$GXX" = yes; then AC_MSG_CHECKING(version of g++) - GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown AC_MSG_RESULT($GXX_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_WARNINGS version: 6 updated: 2010/08/14 18:25:37 +dnl CF_GXX_WARNINGS version: 5 updated: 2005/08/13 14:54:38 dnl --------------- dnl Check if the compiler supports useful warning options. dnl @@ -2261,12 +1848,12 @@ then CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -rf conftest* +rm -f conftest* AC_LANG_RESTORE AC_SUBST(EXTRA_CXXFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB version: 4 updated: 2010/05/29 16:31:02 +dnl CF_HASHED_DB version: 3 updated: 2007/11/24 17:43:37 dnl ------------ dnl Look for an instance of the Berkeley hashed database. dnl @@ -2293,7 +1880,7 @@ else if test "$cf_cv_hashed_db_libs" = unknown ; then AC_MSG_ERROR(Cannot determine library for db) elif test "$cf_cv_hashed_db_libs" != default ; then - CF_ADD_LIB($cf_cv_hashed_db_libs) + LIBS="-l$cf_cv_hashed_db_libs $LIBS" fi fi ],[ @@ -2301,7 +1888,7 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB_LIBS version: 9 updated: 2010/05/29 16:31:02 +dnl CF_HASHED_DB_LIBS version: 8 updated: 2008/08/04 06:18:06 dnl ----------------- dnl Given that we have the header and version for hashed database, find the dnl library information. @@ -2313,7 +1900,7 @@ for cf_db_libs in "" db$cf_cv_hashed_db_version db-$cf_cv_hashed_db_version db ' do cf_save_libs="$LIBS" if test -n "$cf_db_libs"; then - CF_ADD_LIB($cf_db_libs) + LIBS="-l$cf_db_libs $LIBS" fi CF_MSG_LOG(checking for library "$cf_db_libs") AC_TRY_LINK([ @@ -2411,35 +1998,11 @@ done ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 +dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59 dnl -------------- -dnl Construct a search-list of directories for a nonstandard header-file -dnl -dnl Parameters -dnl $1 = the variable to return as result -dnl $2 = the package name +dnl Construct a search-list for a nonstandard header-file AC_DEFUN([CF_HEADER_PATH], -[ -$1= - -# 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$,,'` - CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) - cf_header_path_list="$cf_header_path_list [$]$1" - ;; - esac - done -fi - -# add the variations for the package we are looking for -CF_SUBDIR_PATH($1,$2,include) - +[CF_SUBDIR_PATH($1,$2,include) test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { @@ -2454,7 +2017,6 @@ test -d "$oldincludedir" && { test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" } -$1="[$]$1 $cf_header_path_list" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 @@ -2464,7 +2026,7 @@ AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40 +dnl CF_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 dnl --------------- dnl Construct the list of include-options according to whether we're building dnl in the source directory or using '--srcdir=DIR' option. If we're building @@ -2472,9 +2034,9 @@ dnl with gcc, don't append the includedir if it happens to be /usr/include, dnl since that usually breaks gcc's shadow-includes. AC_DEFUN([CF_INCLUDE_DIRS], [ -CPPFLAGS="$CPPFLAGS -I. -I../include" +CPPFLAGS="-I. -I../include $CPPFLAGS" if test "$srcdir" != "."; then - CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" + CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -2490,7 +2052,7 @@ fi AC_SUBST(CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 +dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29 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 @@ -2504,24 +2066,24 @@ dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ -ifelse([$2],,INTEL_COMPILER,[$2])=no +ifelse($2,,INTEL_COMPILER,[$2])=no -if test "$ifelse([$1],,[$1],GCC)" = yes ; then +if test "$ifelse($1,,[$1],GCC)" = yes ; then case $host_os in 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" + 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" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif -],[ifelse([$2],,INTEL_COMPILER,[$2])=yes +],[ifelse($2,,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" ],[]) - ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" - AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) + ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2])) ;; esac fi @@ -2581,7 +2143,7 @@ ifdef([AC_FUNC_FSEEKO],[ ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LDFLAGS_STATIC version: 8 updated: 2010/10/23 14:39:56 +dnl CF_LDFLAGS_STATIC version: 4 updated: 2008/10/18 17:58:20 dnl ----------------- dnl Check for compiler/linker flags used to temporarily force usage of static dnl libraries. This depends on the compiler and platform. Use this to help @@ -2591,7 +2153,7 @@ AC_DEFUN([CF_LDFLAGS_STATIC],[ if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[[4]]*|solaris2.1[[0-9]]|darwin*) #( vi + OS/2*|os2*|aix[[45]]*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -2602,7 +2164,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[[456]]*) #( from ld manpage + aix[[45]]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -2617,7 +2179,7 @@ else ;; osf[[45]]*) #( from ld manpage osf4.0d, osf5.1 # alternative "-oldstyle_liblookup" (not in cc manpage) - LDFLAGS_STATIC=-noso + LDFLAGS_STATIC=-noso LDFLAGS_SHARED=-so_archive ;; solaris2*) @@ -2627,134 +2189,15 @@ else esac fi -if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" -then - AC_MSG_CHECKING(if linker supports switching between static/dynamic) - - rm -f libconftest.a - cat >conftest.$ac_ext < -int cf_ldflags_static(FILE *fp) { return fflush(fp); } -EOF - if AC_TRY_EVAL(ac_compile) ; then - ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&AC_FD_CC 1>/dev/null - ( eval $RANLIB libconftest.a ) 2>&AC_FD_CC >/dev/null - fi - rm -f conftest.* - - cf_save_LIBS="$LIBS" - - LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" - AC_TRY_LINK([ -#line __oline__ "configure" -#include -int cf_ldflags_static(FILE *fp); -],[ - return cf_ldflags_static(stdin); -],[cf_ldflags_static=yes],[cf_ldflags_static=no]) - - rm -f libconftest.* - LIBS="$cf_save_LIBS" - - AC_MSG_RESULT($cf_ldflags_static) - - if test $cf_ldflags_static != yes - then - LDFLAGS_STATIC= - LDFLAGS_SHARED= - fi -else - LDFLAGS_STATIC= - LDFLAGS_SHARED= -fi - AC_SUBST(LDFLAGS_STATIC) AC_SUBST(LDFLAGS_SHARED) ]) dnl --------------------------------------------------------------------------- -dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 +dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59 dnl --------------- -dnl For the given system and compiler, find the compiler flags to pass to the -dnl loader to use the "rpath" feature. -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 - LD_RPATH_OPT="-Wl,-rpath," - else - LD_RPATH_OPT="-rpath " - fi - ;; -linux*|gnu*|k*bsd*-gnu) #(vi - LD_RPATH_OPT="-Wl,-rpath," - ;; -openbsd[[2-9]].*) #(vi - LD_RPATH_OPT="-Wl,-rpath," - ;; -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) - -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 -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 -dnl --------------- -dnl Construct a search-list of directories for a nonstandard library-file -dnl -dnl Parameters -dnl $1 = the variable to return as result -dnl $2 = the package name +dnl Construct a search-list for a nonstandard library-file AC_DEFUN([CF_LIBRARY_PATH], -[ -$1= -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$,,'` - CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) - cf_library_path_list="$cf_library_path_list [$]$1" - ;; - esac - done -fi - -CF_SUBDIR_PATH($1,$2,lib) - -$1="$cf_library_path_list [$]$1" -])dnl +[CF_SUBDIR_PATH($1,$2,lib)])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 dnl ------------- @@ -2773,7 +2216,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 61 updated: 2010/10/23 16:10:30 +dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -2796,23 +2239,6 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi -if test -n "$TINFO_SUFFIX" ; then - case $TINFO_SUFFIX in - tw*) - TINFO_NAME="${TINFO_NAME}tw" - TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` - ;; - t*) - TINFO_NAME="${TINFO_NAME}t" - TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` - ;; - w*) - TINFO_NAME="${TINFO_NAME}w" - TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` - ;; - esac -fi - for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -2831,14 +2257,6 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in - .tw*) - cf_suffix=`echo $cf_suffix | sed 's/^tw//'` - cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" - ;; - .t*) - cf_suffix=`echo $cf_suffix | sed 's/^t//'` - cf_suffix=t'.${REL_VERSION}'"$cf_suffix" - ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -2855,14 +2273,6 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in - .tw*) - cf_suffix=`echo $cf_suffix | sed 's/^tw//'` - cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" - ;; - .t*) - cf_suffix=`echo $cf_suffix | sed 's/^t//'` - cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" - ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -2983,16 +2393,6 @@ do if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in - tw*) - cf_libname=`echo $cf_libname | sed 's/tw$//'` - cf_suffix=`echo $cf_suffix | sed 's/^tw//'` - cf_dir_suffix=tw - ;; - t*) - cf_libname=`echo $cf_libname | sed 's/t$//'` - cf_suffix=`echo $cf_suffix | sed 's/^t//'` - cf_dir_suffix=t - ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -3010,19 +2410,17 @@ do prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ - SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink:-no} \ + ReLink=${cf_cv_do_relink-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ - libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -3106,28 +2504,18 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile </dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.` test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown fi fi -rm -rf conftest* +rm -f conftest* LIBS="$cf_save_LIBS" fi ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03 +dnl CF_LIB_SUFFIX version: 15 updated: 2008/09/13 11:54:48 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name @@ -3302,44 +2689,40 @@ dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_SUFFIX], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - case $1 in #(vi - libtool) #(vi + case $1 in + libtool) $2='.la' $3=[$]$2 ;; - normal) #(vi + normal) $2='.a' $3=[$]$2 ;; - debug) #(vi + debug) $2='_g.a' $3=[$]$2 ;; - profile) #(vi + profile) $2='_p.a' $3=[$]$2 ;; - shared) #(vi + shared) case $cf_cv_system_name in - aix[[56]]*) #(vi - $2='.a' - $3=[$]$2 - ;; - cygwin*) #(vi + cygwin*) $2='.dll' $3='.dll.a' ;; - darwin*) #(vi + darwin*) $2='.dylib' $3=[$]$2 ;; - hpux*) #(vi + hpux*) case $target in - ia64*) #(vi + ia64*) $2='.so' $3=[$]$2 ;; - *) #(vi + *) $2='.sl' $3=[$]$2 ;; @@ -3372,7 +2755,7 @@ AC_DEFUN([CF_LIB_TYPE], test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38 +dnl CF_LINK_DATAONLY version: 8 updated: 2006/12/16 12:33:30 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll @@ -3389,7 +2772,7 @@ int testdata[[3]] = { 123, 456, 789 }; EOF if AC_TRY_EVAL(ac_compile) ; then mv conftest.o data.o && \ - ( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null + ( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null + ( $AR $AR_OPTS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null @@ -3504,7 +2887,7 @@ AC_DEFUN([CF_MAIN_RETURN], cf_cv_main_return=return ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 14 updated: 2011/03/31 19:29:46 +dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. @@ -3521,10 +2904,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -3544,20 +2927,16 @@ CF_EOF AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 +dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have dnl a monocase filesystem. AC_DEFUN([CF_MAKE_TAGS],[ AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) - -AC_CHECK_PROGS(CTAGS, exctags ctags) -AC_CHECK_PROGS(ETAGS, exetags etags) - -AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) +AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no) if test "$cf_cv_mixedcase" = yes ; then - AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) + AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) else MAKE_UPPER_TAGS=no fi @@ -3567,21 +2946,17 @@ if test "$MAKE_UPPER_TAGS" = yes ; then else MAKE_UPPER_TAGS="#" fi +AC_SUBST(MAKE_UPPER_TAGS) if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi - -AC_SUBST(CTAGS) -AC_SUBST(ETAGS) - -AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 9 updated: 2010/10/23 16:10:30 +dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34 dnl ----------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases: @@ -3623,7 +2998,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -3737,7 +3112,7 @@ AC_MSG_RESULT($MANPAGE_RENAMES) AC_SUBST(MANPAGE_RENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_SYMLINKS version: 5 updated: 2010/07/24 17:12:40 +dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58 dnl ------------------- dnl Some people expect each tool to make all aliases for manpages in the dnl man-directory. This accommodates the older, less-capable implementations @@ -3753,14 +3128,11 @@ AC_ARG_WITH(manpage-aliases, AC_MSG_RESULT($MANPAGE_ALIASES) -case "x$LN_S" in #(vi -xln*) #(vi +if test "$LN_S" = "ln -s"; then cf_use_symlinks=yes - ;; -*) +else cf_use_symlinks=no - ;; -esac +fi MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then @@ -3799,7 +3171,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 39 updated: 2010/10/23 15:44:18 +dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -3842,7 +3214,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) +*gzip*) #(vi cf_so_strip="gz" cf_compress=gzip ;; @@ -3865,12 +3237,14 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" +MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" + INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR:=/tmp}/man\$\$ +TMP=\${TMPDIR-/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\[$]1 @@ -3908,7 +3282,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - mkdir -p \$cf_subdir\$section + \$MKDIRS \$cf_subdir\$section fi fi @@ -3928,7 +3302,7 @@ CF_EOF cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name,g + s,@$cf_NAME@,$cf_name, CF_EOF done ]) @@ -4057,21 +3431,8 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -4130,7 +3491,7 @@ chmod 755 $cf_edit_man ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02 +dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10 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 @@ -4143,13 +3504,13 @@ AC_CACHE_CHECK(if -lm needed for math functions, #include #include ], - [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], + [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])]) if test "$cf_cv_need_libm" = yes then ifelse($1,,[ - CF_ADD_LIB(m) + LIBS="$LIBS -lm" ],[$1=-lm]) fi ]) @@ -4184,13 +3545,13 @@ fi test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37 +dnl CF_MKSTEMP version: 5 updated: 2006/12/16 12:33:30 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ -rm -rf conftest* +rm -f conftest* AC_TRY_RUN([ #include #include @@ -4229,17 +3590,17 @@ int main() ],[AC_CHECK_FUNC(mkstemp) ]) ]) -if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then +if test "$cf_cv_func_mkstemp" = yes ; then AC_DEFINE(HAVE_MKSTEMP) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 +dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ -echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49 @@ -4326,20 +3687,20 @@ AC_DEFUN([CF_OBJ_SUBDIR], esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42 +dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53 dnl ---------- dnl Provide a value for the $PATH and similar separator AC_DEFUN([CF_PATHSEP], [ case $cf_cv_system_name in - os2*) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; + os2*) PATHSEP=';' ;; + *) PATHSEP=':' ;; esac -ifelse([$1],,,[$1=$PATH_SEPARATOR]) - AC_SUBST(PATH_SEPARATOR) +ifelse($1,,,[$1=$PATHSEP]) + AC_SUBST(PATHSEP) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 +dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59 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 @@ -4371,44 +3732,12 @@ case ".[$]$1" in #(vi $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; *) - ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24 -dnl ------------- -dnl Check for the package-config program, unless disabled by command-line. -AC_DEFUN([CF_PKG_CONFIG], -[ -AC_MSG_CHECKING(if you want to use pkg-config) -AC_ARG_WITH(pkg-config, - [ --with-pkg-config{=path} enable/disable use of pkg-config], - [cf_pkg_config=$withval], - [cf_pkg_config=yes]) -AC_MSG_RESULT($cf_pkg_config) - -case $cf_pkg_config in #(vi -no) #(vi - PKG_CONFIG=none - ;; -yes) #(vi - AC_PATH_TOOL(PKG_CONFIG, pkg-config, none) - ;; -*) - PKG_CONFIG=$withval - ;; -esac - -test -z "$PKG_CONFIG" && PKG_CONFIG=none -if test "$PKG_CONFIG" != none ; then - CF_PATH_SYNTAX(PKG_CONFIG) -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: 6 updated: 2005/07/14 20:25:10 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -4424,7 +3753,7 @@ dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ -cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) +cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -4476,12 +3805,17 @@ make an error if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - CF_ADD_CFLAGS($cf_cv_posix_c_source) + if test "$cf_cv_cc_u_d_options" = yes ; then + cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ + sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'` + CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" + fi + CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PREDEFINE version: 2 updated: 2010/05/26 16:44:57 +dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56 dnl ------------ dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles. dnl @@ -4498,7 +3832,7 @@ make an error AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then - CPPFLAGS="$CPPFLAGS ifelse([$2],,-D$1,[-D$1=$2])" + CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])" elif test "x$2" != "x" ; then AC_MSG_CHECKING(checking for compatible value versus $2) AC_TRY_COMPILE([#include @@ -4538,13 +3872,6 @@ done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 -dnl ---------- -dnl Check for archiver "ar". -AC_DEFUN([CF_PROG_AR],[ -AC_CHECK_TOOL(AR, ar, ar) -]) -dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. @@ -4554,7 +3881,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37 +dnl CF_PROG_CC_C_O version: 2 updated: 2006/12/16 15:55:46 dnl -------------- dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that dnl the output file can be renamed, and allows for a shell variable that can @@ -4584,7 +3911,7 @@ then else eval cf_cv_prog_$1_c_o=no fi -rm -rf conftest* +rm -f conftest* ])dnl if test $cf_cv_prog_$1_c_o = yes; then AC_MSG_RESULT([yes]) @@ -4658,39 +3985,6 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 -dnl ------------ -dnl Check for gnatmake, ensure that it is complete. -AC_DEFUN([CF_PROG_GNAT],[ -cf_ada_make=gnatmake -AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) -if test "$ac_cv_prog_gnat_exists" = no; then - cf_ada_make= -else - CF_GNAT_VERSION - AC_CHECK_PROG(M4_exists, m4, yes, no) - if test "$ac_cv_prog_M4_exists" = no; then - cf_cv_prog_gnat_correct=no - echo Ada95 binding required program m4 not found. Ada95 binding disabled. - fi - if test "$cf_cv_prog_gnat_correct" = yes; then - AC_MSG_CHECKING(if GNAT works) - CF_GNAT_TRY_RUN([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is -begin - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) - AC_MSG_RESULT($cf_cv_prog_gnat_correct) - fi -fi - -AC_SUBST(cf_ada_make) -])dnl -dnl --------------------------------------------------------------------------- dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 dnl --------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -4709,7 +4003,7 @@ case $INSTALL in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LDCONFIG version: 2 updated: 2008/12/13 14:08:40 +dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55 dnl ---------------- dnl Check for ldconfig, needed to fixup shared libraries that would be built dnl and then used in the install. @@ -4718,7 +4012,7 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -dragonfly*|freebsd*) #(vi +freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin @@ -4729,117 +4023,49 @@ fi AC_SUBST(LDCONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 +dnl CF_PROG_LINT version: 1 updated: 2006/09/16 11:40:59 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ -AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) +AC_CHECK_PROGS(LINT, tdlint lint alint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 -dnl ------------ -dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" -dnl option if it is supported. -AC_DEFUN([CF_PROG_LN_S],[ -AC_PROG_LN_S -AC_MSG_CHECKING(if $LN_S -f options work) - -rm -f conf$$.src conf$$dst -echo >conf$$.dst -echo first >conf$$.src -if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then - cf_prog_ln_sf=yes -else - cf_prog_ln_sf=no -fi -rm -f conf$$.dst conf$$src -AC_MSG_RESULT($cf_prog_ln_sf) - -test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_REGEX version: 8 updated: 2010/08/07 14:09:44 +dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression dnl code that we can support. AC_DEFUN([CF_REGEX], [ - -cf_regex_func=no - -cf_regex_libs="regex re" -case $host_os in #(vi -mingw*) - cf_regex_libs="regex.dll $cf_regex_libs" - ;; -esac - -AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ - for cf_regex_lib in $cf_regex_libs - do - AC_CHECK_LIB($cf_regex_lib,regcomp,[ - CF_ADD_LIB($cf_regex_lib) - cf_regex_func=regcomp - break]) - done -]) - -if test "$cf_regex_func" = no ; then - AC_CHECK_FUNC(compile,[cf_regex_func=compile],[ - AC_CHECK_LIB(gen,compile,[ - CF_ADD_LIB(gen) - cf_regex_func=compile])]) -fi - -if test "$cf_regex_func" = no ; then - AC_MSG_WARN(cannot find regular expression library) -fi - -AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[ - -cf_cv_regex_hdrs=no -case $cf_regex_func in #(vi -compile) #(vi - for cf_regex_hdr in regexp.h regexpr.h - do - AC_TRY_LINK([#include <$cf_regex_hdr>],[ - char *p = compile("", "", "", 0); +AC_MSG_CHECKING([for regular-expression headers]) +AC_CACHE_VAL(cf_cv_regex,[ +AC_TRY_LINK([#include +#include ],[ + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + ],[cf_cv_regex="regex.h"],[ + AC_TRY_LINK([#include ],[ + char *p = compile("", "", "", 0); + int x = step("", ""); + ],[cf_cv_regex="regexp.h"],[ + cf_save_LIBS="$LIBS" + LIBS="-lgen $LIBS" + AC_TRY_LINK([#include ],[ + char *p = compile("", "", ""); int x = step("", ""); - ],[ - cf_cv_regex_hdrs=$cf_regex_hdr - break - ]) - done - ;; -*) - for cf_regex_hdr in regex.h - do - AC_TRY_LINK([#include -#include <$cf_regex_hdr>],[ - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - ],[ - cf_cv_regex_hdrs=$cf_regex_hdr - break - ]) - done - ;; -esac - + ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])]) ]) - -case $cf_cv_regex_hdrs in #(vi - no) AC_MSG_WARN(no regular expression header found) ;; #(vi - regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; #(vi - regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; #(vi - regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; +AC_MSG_RESULT($cf_cv_regex) +case $cf_cv_regex in + regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; + regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; + regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 +dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all @@ -4851,9 +4077,10 @@ dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ +# remove $3 symbol from $2 $1=`echo "$2" | \ - sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ - -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` + sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 @@ -4869,122 +4096,58 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK version: 9 updated: 2011/02/13 13:31:33 +dnl CF_RPATH_HACK version: 4 updated: 2008/09/13 12:53:26 dnl ------------- AC_DEFUN([CF_RPATH_HACK], [ -AC_REQUIRE([CF_LD_RPATH_OPT]) +AC_REQUIRE([CF_SHARED_OPTS]) AC_MSG_CHECKING(for updated LDFLAGS) -if test -n "$LD_RPATH_OPT" ; then - AC_MSG_RESULT(maybe) - - AC_CHECK_PROGS(cf_ldd_prog,ldd,no) - cf_rpath_list="/usr/lib /lib" - if test "$cf_ldd_prog" != no - then - cf_rpath_oops= - -AC_TRY_LINK([#include ], - [printf("Hello");], - [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` - cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`]) - - # If we passed the link-test, but get a "not found" on a given library, - # this could be due to inept reconfiguration of gcc to make it only - # partly honor /usr/local/lib (or whatever). Sometimes this behavior - # is intentional, e.g., installing gcc in /usr/bin and suppressing the - # /usr/local libraries. - if test -n "$cf_rpath_oops" - then - for cf_rpath_src in $cf_rpath_oops - do - for cf_rpath_dir in \ - /usr/local \ - /usr/pkg \ - /opt/sfw - do - if test -f $cf_rpath_dir/lib/$cf_rpath_src - then - CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src) - LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" - break - fi - done - done - fi - fi - - CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) - - CF_RPATH_HACK_2(LDFLAGS) - CF_RPATH_HACK_2(LIBS) - +if test -n "$LDFLAGS" ; then +AC_MSG_RESULT(maybe) +CF_VERBOSE(...checking LDFLAGS $LDFLAGS) +CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) +case "$EXTRA_LDFLAGS" in #(vi +-Wl,-rpath,*) #(vi + cf_rpath_hack="-Wl,-rpath," + ;; +-R\ *) + cf_rpath_hack="-R " + ;; +-R*) + cf_rpath_hack="-R" + ;; +*) + cf_rpath_hack= + ;; +esac +if test -n "$cf_rpath_hack" ; then + cf_rpath_dst= + for cf_rpath_src in $LDFLAGS + do + CF_VERBOSE(Filtering $cf_rpath_src) + case $cf_rpath_src in #(vi + -L*) #(vi + if test "$cf_rpath_hack" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` + fi + CF_VERBOSE(...Filter $cf_rpath_tmp) + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" + done + LDFLAGS=$cf_rpath_dst + CF_VERBOSE(...checked LDFLAGS $LDFLAGS) CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS) fi -AC_SUBST(EXTRA_LDFLAGS) +else +AC_MSG_RESULT(no) +fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24 -dnl --------------- -dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to -dnl EXTRA_LDFLAGS for each -L option found. -dnl -dnl $cf_rpath_list contains a list of directories to ignore. -dnl -dnl $1 = variable name to update. The LDFLAGS variable should be the only one, -dnl but LIBS often has misplaced -L options. -AC_DEFUN([CF_RPATH_HACK_2], -[ -CF_VERBOSE(...checking $1 [$]$1) - -cf_rpath_dst= -for cf_rpath_src in [$]$1 -do - case $cf_rpath_src in #(vi - -L*) #(vi - - # check if this refers to a directory which we will ignore - cf_rpath_skip=no - if test -n "$cf_rpath_list" - then - for cf_rpath_item in $cf_rpath_list - do - if test "x$cf_rpath_src" = "x-L$cf_rpath_item" - then - cf_rpath_skip=yes - break - fi - done - fi - - if test "$cf_rpath_skip" = no - then - # transform the option - if test "$LD_RPATH_OPT" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` - fi - - # if we have not already added this, add it now - cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` - if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" - then - CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp) - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - fi - fi - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" -done -$1=$cf_rpath_dst - -CF_VERBOSE(...checked $1 [$]$1) -AC_SUBST(EXTRA_LDFLAGS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16 +dnl CF_SHARED_OPTS version: 53 updated: 2008/10/25 18:14:20 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -5011,15 +4174,12 @@ dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - AC_REQUIRE([CF_LD_RPATH_OPT]) LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no - cf_ld_rpath_opt= - test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" AC_MSG_CHECKING(if release/abi version should be used for shared libs) AC_ARG_WITH(shlib-version, @@ -5058,17 +4218,11 @@ AC_DEFUN([CF_SHARED_OPTS], cf_cv_shlib_version_infix=no - case $cf_cv_system_name in #(vi - aix[[56]]*) #(vi - if test "$GCC" = yes; then - CC_SHARED_OPTS= - MK_SHARED_LIB='$(CC) -shared' - fi - ;; - beos*) #(vi + case $cf_cv_system_name in + beos*) MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; - cygwin*) #(vi + cygwin*) CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' cf_cv_shlib_version=cygdll @@ -5085,9 +4239,9 @@ AC_DEFUN([CF_SHARED_OPTS], EOF exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} CF_EOF - chmod +x mk_shared_lib.sh + chmod +x mk_shared_lib.sh ;; - darwin*) #(vi + darwin*) EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' @@ -5102,7 +4256,7 @@ CF_EOF LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) #(vi + hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -5115,9 +4269,15 @@ CF_EOF # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) #(vi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + irix*) + if test "$cf_cv_ld_rpath" = yes ; then + if test "$GCC" = yes; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + else + cf_ld_rpath_opt="-rpath " + EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + fi fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -5128,50 +4288,54 @@ CF_EOF fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) #(vi + linux*|gnu*|k*bsd*-gnu) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - openbsd[[2-9]].*) #(vi + openbsd[[2-9]].*) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - nto-qnx*|openbsd*|freebsd[[12]].*) #(vi + nto-qnx*|openbsd*|freebsd[[12]].*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) #(vi + freebsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then - LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then + LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" + cf_ld_rpath_opt="-rpath " + EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]' + MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $[@]` -o $[@]' ;; - netbsd*) #(vi + netbsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then - LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -5182,33 +4346,37 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]' + MK_SHARED_LIB='${LD} -Bshareable -o $[@]' fi ;; - osf*|mls+*) #(vi + osf*|mls+*) # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`' - case $host_os in #(vi + case $host_os in osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-rpath" + # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@' - if test "$cf_cv_enable_rpath" = yes ; then + if test "$cf_cv_ld_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -5216,7 +4384,7 @@ CF_EOF LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) #(vi + sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5224,32 +4392,26 @@ CF_EOF MK_SHARED_LIB='${LD} -assert pure-text -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) #(vi + solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-R" + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then - cf_save_CFLAGS="$CFLAGS" - for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O - do - CFLAGS="$cf_shared_opts $cf_save_CFLAGS" - AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break]) - done - CFLAGS="$cf_save_CFLAGS" - CC_SHARED_OPTS=$cf_shared_opts + CC_SHARED_OPTS='-xcode=pic32' MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' fi ;; - sysv5uw7*|unix_sv*) #(vi + sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5266,7 +4428,7 @@ CF_EOF case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $[@]') #(vi + *'-o $[@]') test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) @@ -5277,11 +4439,17 @@ CF_EOF esac if test -n "$cf_ld_rpath_opt" ; then + AC_MSG_CHECKING(if we need a space after rpath option) + cf_save_LIBS="$LIBS" + LIBS="$LIBS ${cf_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 && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi AC_SUBST(CC_SHARED_OPTS) - AC_SUBST(LD_RPATH_OPT) AC_SUBST(LD_SHARED_OPTS) AC_SUBST(MK_SHARED_LIB) AC_SUBST(LINK_PROGS) @@ -5474,7 +4642,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 21 updated: 2010/09/04 17:37:40 +dnl CF_SRC_MODULES version: 18 updated: 2005/05/28 12:58:54 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll @@ -5549,28 +4717,19 @@ AC_SUBST(TEST_DEPS) AC_SUBST(TEST_ARG2) AC_SUBST(TEST_DEP2) -SRC_SUBDIRS= -if test "x$cf_with_manpages" != xno ; then - SRC_SUBDIRS="$SRC_SUBDIRS man" -fi -SRC_SUBDIRS="$SRC_SUBDIRS include" +SRC_SUBDIRS="man include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -if test "x$cf_with_tests" != "xno" ; then - SRC_SUBDIRS="$SRC_SUBDIRS test" -fi +SRC_SUBDIRS="$SRC_SUBDIRS test" test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src" - if test "x$cf_with_tests" != "xno" ; then - ADA_SUBDIRS="$ADA_SUBDIRS samples" - fi + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src samples" fi SUB_MAKEFILES= @@ -5580,15 +4739,15 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done - AC_SUBST(ADA_SUBDIRS) + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done + AC_SUBST(ADA_SUBDIRS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_STDCPP_LIBRARY version: 7 updated: 2010/05/29 16:31:02 +dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52 dnl ----------------- dnl Check for -lstdc++, which is GNU's standard C++ library. AC_DEFUN([CF_STDCPP_LIBRARY], @@ -5604,7 +4763,7 @@ os2*) #(vi esac AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ cf_save="$LIBS" - CF_ADD_LIB($cf_stdcpp_libname) + LIBS="$LIBS -l$cf_stdcpp_libname" AC_TRY_LINK([ #include ],[ char buf[80]; @@ -5614,7 +4773,7 @@ strstreambuf foo(buf, sizeof(buf)) [cf_cv_libstdcpp=no]) LIBS="$cf_save" ]) -test "$cf_cv_libstdcpp" = yes && CF_ADD_LIB($cf_stdcpp_libname,CXXLIBS) +test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" fi ])dnl dnl --------------------------------------------------------------------------- @@ -5687,15 +4846,14 @@ if test "$ac_cv_header_termios_h" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 +dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], -[ -$1= +[$1="" CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) @@ -5890,7 +5048,7 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 +dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], @@ -5912,40 +5070,10 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H) CF_ADD_INCDIR($cf_cv_header_path_utf8) CF_ADD_LIBDIR($cf_cv_library_path_utf8) - CF_ADD_LIBS($cf_cv_library_file_utf8) + LIBS="-lutf8 $LIBS" fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29 -dnl ---------- -dnl check for va_copy, part of stdarg.h -dnl Also, workaround for glibc's __va_copy, by checking for both. -AC_DEFUN([CF_VA_COPY],[ -AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[ -AC_TRY_LINK([ -#include -],[ - static va_list dst; - static va_list src; - va_copy(dst, src)], - cf_cv_have_va_copy=yes, - cf_cv_have_va_copy=no)]) - -test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY) - -AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[ -AC_TRY_LINK([ -#include -],[ - static va_list dst; - static va_list src; - __va_copy(dst, src)], - cf_cv_have___va_copy=yes, - cf_cv_have___va_copy=no)]) - -test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY) -]) -dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings @@ -5954,7 +5082,7 @@ AC_DEFUN([CF_VERBOSE], CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57 +dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20 dnl ------------- dnl Check if type wide-character type $1 is declared, and if so, which header dnl file is needed. The second parameter is used to set a shell variable when @@ -5990,7 +5118,7 @@ if test "$cf_cv_$1" = yes ; then NEED_WCHAR_H=1 fi -ifelse([$2],,,[ +ifelse($2,,,[ # if we do not find $1 in either place, use substitution to provide a fallback. if test "$cf_cv_$1" = unknown ; then $2=1 @@ -6050,76 +5178,7 @@ $1_ABI=$cf_cv_abi_version ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 -dnl -------------------- -dnl Command-line option to specify the Ada95 compiler. -AC_DEFUN([CF_WITH_ADA_COMPILER],[ -AC_MSG_CHECKING(for ada-compiler) -AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], - [cf_ada_compiler=$withval], - [cf_ada_compiler=gnatmake]) -AC_SUBST(cf_ada_compiler) -AC_MSG_RESULT($cf_ada_compiler) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 -dnl ------------------- -dnl Command-line option to specify where Ada includes will install. -AC_DEFUN([CF_WITH_ADA_INCLUDE],[ -AC_MSG_CHECKING(for ada-include) -CF_WITH_PATH(ada-include, - [ --with-ada-include=DIR Ada includes are in DIR], - ADA_INCLUDE, - PREFIX/share/ada/adainclude, - [$]prefix/share/ada/adainclude) -AC_SUBST(ADA_INCLUDE) -AC_MSG_RESULT($ADA_INCLUDE) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 -dnl ------------------- -dnl Command-line option to specify where Ada objects will install. -AC_DEFUN([CF_WITH_ADA_OBJECTS],[ -AC_MSG_CHECKING(for ada-objects) -CF_WITH_PATH(ada-objects, - [ --with-ada-objects=DIR Ada objects are in DIR], - ADA_OBJECTS, - PREFIX/lib/ada/adalib, - [$]prefix/lib/ada/adalib) -AC_SUBST(ADA_OBJECTS) -AC_MSG_RESULT($ADA_OBJECTS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58 -dnl --------------------- -dnl Command-line option to specify if an Ada95 shared-library should be built, -dnl and optionally what its soname should be. -AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ -AC_MSG_CHECKING(if an Ada95 shared-library should be built) -AC_ARG_WITH(ada-sharedlib, - [ --with-ada-sharedlib=XX build Ada95 shared-library], - [with_ada_sharedlib=$withval], - [with_ada_sharedlib=no]) -AC_MSG_RESULT($with_ada_sharedlib) - -ADA_SHAREDLIB='lib$(LIB_NAME).so.1' -MAKE_ADA_SHAREDLIB="#" - -if test "x$with_ada_sharedlib" != xno -then - MAKE_ADA_SHAREDLIB= - if test "x$with_ada_sharedlib" != xyes - then - ADA_SHAREDLIB="$with_ada_sharedlib" - fi -fi - -AC_SUBST(ADA_SHAREDLIB) -AC_SUBST(MAKE_ADA_SHAREDLIB) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 +dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. @@ -6130,11 +5189,11 @@ CF_NO_LEAKS_OPTION(dbmalloc, if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, - [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) + [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 +dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. @@ -6145,7 +5204,7 @@ CF_NO_LEAKS_OPTION(dmalloc, if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, - [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) + [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- @@ -6182,7 +5241,7 @@ if test "$with_gpm" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24 +dnl CF_WITH_LIBTOOL version: 19 updated: 2008/03/29 15:46:43 dnl --------------- dnl Provide a configure option to incorporate libtool. Define several useful dnl symbols for the makefile rules. @@ -6202,23 +5261,22 @@ dnl elif test ! -f $ACLOCAL/libtool.m4 ; then dnl echo cannot find libtool.m4 file dnl exit 1 dnl fi -dnl +dnl dnl LOCAL=aclocal.m4 dnl ORIG=aclocal.m4.orig -dnl +dnl dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15 dnl rm -f $ORIG dnl mv $LOCAL $ORIG -dnl +dnl dnl # sed the LIBTOOL= assignment to omit the current directory? -dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL +dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL dnl cat $ORIG >>$LOCAL -dnl +dnl dnl autoconf-257 $* dnl AC_DEFUN([CF_WITH_LIBTOOL], [ -AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION]) ifdef([AC_PROG_LIBTOOL],,[ LIBTOOL= ]) @@ -6248,17 +5306,17 @@ ifdef([AC_PROG_LIBTOOL],[ AC_PROG_LIBTOOL # missing_content_AC_PROG_LIBTOOL}} ],[ - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then CF_PATH_SYNTAX(with_libtool) LIBTOOL=$with_libtool else - AC_PATH_PROG(LIBTOOL,libtool) - fi - if test -z "$LIBTOOL" ; then - AC_MSG_ERROR(Cannot find libtool) - fi + AC_PATH_PROG(LIBTOOL,libtool) + fi + if test -z "$LIBTOOL" ; then + AC_MSG_ERROR(Cannot find libtool) + fi ])dnl - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -6273,25 +5331,16 @@ ifdef([AC_PROG_LIBTOOL],[ # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. "(" + # bug reports it might be useful to have the original string. cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'` AC_MSG_RESULT($cf_cv_libtool_version) if test -z "$cf_cv_libtool_version" ; then AC_MSG_ERROR(This is not GNU libtool) fi - # special hack to add -no-undefined (which libtool should do for itself) - LT_UNDEF= - case "$cf_cv_system_name" in #(vi - cygwin*|mingw32*|uwin*|aix[[456]]) #(vi - LT_UNDEF=-no-undefined - ;; - esac - AC_SUBST([LT_UNDEF]) - # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in #(vi - 1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*) #(vi + case $cf_cv_libtool_version in + 1.[[5-9]]*|[[2-9]]*) LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -6323,7 +5372,7 @@ AC_SUBST(LIB_UNINSTALL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 +dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. @@ -6335,16 +5384,16 @@ dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], -[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, -ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl -if ifelse([$5],,true,[test -n "$5"]) ; then +[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, +ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl +if ifelse($5,,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATHLIST version: 7 updated: 2010/10/23 16:10:30 +dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30 dnl ---------------- dnl Process an option specifying a list of colon-separated paths. dnl @@ -6358,9 +5407,9 @@ dnl AC_DEFUN([CF_WITH_PATHLIST],[ AC_REQUIRE([CF_PATHSEP]) AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval=${$3}],[withval=${$3:-ifelse($5,,$4,$5)}]))dnl +ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl -IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do @@ -6386,7 +5435,7 @@ AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02 +dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -6404,7 +5453,7 @@ if test "$with_pthread" != no ; then AC_MSG_CHECKING(if we can link with the pthread library) cf_save_LIBS="$LIBS" - CF_ADD_LIB(pthread) + LIBS="-lpthread $LIBS" AC_TRY_LINK([ #include ],[ @@ -6414,7 +5463,7 @@ if test "$with_pthread" != no ; then AC_MSG_RESULT($with_pthread) if test "$with_pthread" = yes ; then - CF_ADD_LIB(pthread) + LIBS="-lpthread $LIBS" AC_DEFINE(HAVE_LIBPTHREADS) else AC_MSG_ERROR(Cannot link with pthread library) @@ -6486,7 +5535,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 +dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57 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, @@ -6497,22 +5546,14 @@ dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ -cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) -cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) -cf_xopen_source= +AC_REQUIRE([CF_PROG_CC_U_D]) + +cf_XOPEN_SOURCE=ifelse($1,,500,$1) +cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) case $host_os in #(vi -aix[[456]]*) #(vi - cf_xopen_source="-D_ALL_SOURCE" - ;; -cygwin) #(vi - cf_XOPEN_SOURCE=600 - ;; -darwin[[0-8]].*) #(vi - cf_xopen_source="-D_APPLE_C_SOURCE" - ;; -darwin*) #(vi - cf_xopen_source="-D_DARWIN_C_SOURCE" +aix[[45]]*) #(vi + CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -6520,18 +5561,15 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L 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 - cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; hpux*) #(vi - cf_xopen_source="-D_HPUX_SOURCE" + CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" ;; irix[[56]].*) #(vi - cf_xopen_source="-D_SGI_SOURCE" + CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" ;; -linux*|gnu*|mint*|k*bsd*-gnu) #(vi +linux*|gnu*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi @@ -6544,19 +5582,16 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi - cf_xopen_source="-D_OSF_SOURCE" + CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" ;; nto-qnx*) #(vi - cf_xopen_source="-D_QNX_SOURCE" + CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris2.1[[0-9]]) #(vi - cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - ;; -solaris2.[[1-9]]) #(vi - cf_xopen_source="-D__EXTENSIONS__" +solaris*) #(vi + CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ @@ -6579,14 +5614,11 @@ make an error if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) - cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" - CF_ADD_CFLAGS($cf_temp_xopen_source) + test "$cf_cv_cc_u_d_options" = yes && \ + CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" fi CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac - -if test -n "$cf_xopen_source" ; then - CF_ADD_CFLAGS($cf_xopen_source) -fi ]) diff --git a/announce.html.in b/announce.html.in index e385204de50..1d4121ee4ff 100644 --- a/announce.html.in +++ b/announce.html.in @@ -1,8 +1,8 @@ - + - - - - - - Announcing ncurses @VERSION@ - - - - - -

Announcing ncurses @VERSION@

The ncurses (new curses) - library is a free software emulation of curses in System V - Release 4.0, and more. It uses terminfo format, supports pads and - color and multiple highlights and forms characters and - function-key mapping, and has all the other SYSV-curses - enhancements over BSD curses. - -

In mid-June 1995, the maintainer of 4.4BSD curses declared - that he considered 4.4BSD curses obsolete, and encouraged the - keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to - switch over to ncurses.

- -

The ncurses code was developed under GNU/Linux. It has been in - use for some time with OpenBSD as the system curses library, and - on FreeBSD and NetBSD as an external package. It should port - easily to any ANSI/POSIX-conforming UNIX. It has even been ported - to OS/2 Warp!

- -

The distribution includes the library and support utilities, - including a terminfo compiler tic(1), a decompiler infocmp(1), - clear(1), tput(1), tset(1), and a termcap conversion tool - captoinfo(1). Full manual pages are provided for the library and - tools.

- -

The ncurses distribution is available via anonymous FTP at the - GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
- - It is also available at ftp://invisible-island.net/ncurses/ .

- -

Release Notes

This release is designed to be upward - compatible from ncurses 5.0 through 5.8; very few applications - will require recompilation, depending on the platform. These are - the highlights from the change-log since ncurses 5.8 release. -

- This is a bug-fix release, correcting a small number of urgent problems - in the ncurses library from the 5.8 release. -

- It also improves the Ada95 binding: -

    -
  • fixes a longstanding portability problem with its use of the - set_field_type - function. Because that function uses variable-length argument lists, - its interface with gnat does not work with certain platforms. -
  • improves configurability and portability, particularly when built - separately from the main ncurses tree. The 5.8 release introduced - scripts which can be used to construct separate tarballs for the - Ada95 and ncurses examples. -

    Those were a proof of concept. For the 5.9 release, those - scripts are augmented with rpm- and dpkg-scripts used in test builds - against a variety of gnat- and system ncurses versions as old as - gnat 3.15 and ncurses 5.4 (see snapshots and systems tested - here. -

  • additional improvements were made for portability of the - ncurses examples, adding rpm- and dpkg-scripts for test-builds. - See - this page - for snapshots and other information. -
- -

Features of Ncurses

The ncurses package is fully - compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are - documented).
  • - -
  • Full support for SVr4 curses features including keyboard - mapping, color, forms-drawing with ACS characters, and - automatic recognition of keypad and function keys.
  • - -
  • An emulation of the SVr4 panels library, supporting a stack - of windows with backing store, is included.
  • - -
  • An emulation of the SVr4 menus library, supporting a - uniform but flexible interface for menu programming, is - included.
  • - -
  • An emulation of the SVr4 form library, supporting data - collection through on-screen forms, is included.
  • - -
  • Binary terminfo entries generated by the ncurses tic(1) - implementation are bit-for-bit-compatible with the entry format - SVr4 curses uses.
  • - -
  • The utilities have options to allow you to filter terminfo - entries for use with less capable - curses/terminfo versions such - as the HP/UX and AIX ports.
  • -
The ncurses package also has many useful extensions over - SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the - X/OPEN curses specification, XSI curses (that is, it implements - all BASE level features, and most EXTENDED features). It - includes many function calls not supported under SVr4 curses - (but portability of all calls is documented so you can use the - SVr4 subset only).
  • - -
  • Unlike SVr3 curses, ncurses can write to the - rightmost-bottommost corner of the screen if your terminal has - an insert-character capability.
  • - -
  • Ada95 and C++ bindings.
  • - -
  • Support for mouse event reporting with X Window xterm and - FreeBSD and OS/2 console windows.
  • - -
  • Extended mouse support via Alessandro Rubini's gpm - package.
  • - -
  • The function wresize allows you to resize - windows, preserving their data.
  • - -
  • The function use_default_colors allows you to - use the terminal's default colors for the default color pair, - achieving the effect of transparent colors.
  • - -
  • The functions keyok and - define_key allow you to better control the use of - function keys, e.g., disabling the ncurses KEY_MOUSE, or by - defining more than one control sequence to map to a given key - code.
  • - -
  • Support for 256-color terminals, such as modern xterm, when - configured using the --enable-ext-colors - option.
  • - -
  • Support for 16-color terminals, such as aixterm - and modern xterm.
  • - -
  • Better cursor-movement optimization. The package now - features a cursor-local-movement computation more efficient - than either BSD's or System V's.
  • - -
  • Super hardware scrolling support. The screen-update code - incorporates a novel, simple, and cheap algorithm that enables - it to make optimal use of hardware scrolling, line-insertion, - and line-deletion for screen-line movements. This algorithm is - more powerful than the 4.4BSD curses quickch - routine.
  • - -
  • Real support for terminals with the magic-cookie glitch. - The screen-update code will refrain from drawing a highlight if - the magic- cookie unattributed spaces required just before the - beginning and after the end would step on a non-space - character. It will automatically shift highlight boundaries - when doing so would make it possible to draw the highlight - without changing the visual appearance of the screen.
  • - -
  • It is possible to generate the library with a list of - pre-loaded fallback entries linked to it so that it can serve - those terminal types even when no terminfo tree or termcap file - is accessible (this may be useful for support of - screen-oriented programs that must run in single-user - mode).
  • - -
  • The tic(1)/captoinfo utility provided with ncurses has the - ability to translate many termcaps from the XENIX, IBM and - AT&T extension sets.
  • - -
  • A BSD-like tset(1) utility is provided.
  • - -
  • The ncurses library and utilities will automatically read - terminfo entries from $HOME/.terminfo if it exists, and compile - to that directory if it exists and the user has no write access - to the system directory. This feature makes it easier for users - to have personal terminfo entries without giving up access to - the system terminfo directory.
  • - -
  • You may specify a path of directories to search for - compiled descriptions with the environment variable - TERMINFO_DIRS (this generalizes the feature provided by - TERMINFO under stock System V.)
  • - -
  • In terminfo source files, use capabilities may refer not - just to other entries in the same source file (as in System V) - but also to compiled entries in either the system terminfo - directory or the user's $HOME/.terminfo directory.
  • - -
  • A script (capconvert) is provided to help - BSD users transition from termcap to terminfo. It gathers the - information in a TERMCAP environment variable and/or a - ~/.termcap local entries file and converts it to an equivalent - local terminfo tree under $HOME/.terminfo.
  • - -
  • Automatic fallback to the /etc/termcap file can be compiled - in when it is not possible to build a terminfo tree. This - feature is neither fast nor cheap, you don't want to use it - unless you have to, but it's there.
  • - -
  • The table-of-entries utility toe makes it - easy for users to see exactly what terminal types are available - on the system.
  • - -
  • The library meets the XSI requirement that every macro - entry point have a corresponding function which may be linked - (and will be prototype-checked) if the macro definition is - disabled with #undef.
  • - -
  • An HTML "Introduction to Programming with NCURSES" document - provides a narrative introduction to the curses programming - interface.
  • -
- -

State of the Package

Numerous bugs present in earlier - versions have been fixed; the library is far more reliable than - it used to be. Bounds checking in many `dangerous' entry points - has been improved. The code is now type-safe according to gcc - -Wall. The library has been checked for malloc leaks and arena - corruption by the Purify memory-allocation tester. - -

The ncurses code has been tested with a wide variety of - applications including (versions starting with those noted):

- -
-
cdk
- -
Curses Development Kit
- http://invisible-island.net/cdk/
- - http://www.vexus.ca/products/CDK/
- -
ded
- -
directory-editor
- http://invisible-island.net/ded/
- -
dialog
- -
the underlying application used in Slackware's setup, and - the basis for similar applications on GNU/Linux.
- http://invisible-island.net/dialog/
- -
lynx
- -
the character-screen WWW browser
- http://lynx.isc.org/release/
- -
Midnight Commander
- -
file manager
- http://www.midnight-commander.org/
- -
mutt
- -
mail utility
- http://www.mutt.org/
- -
ncftp
- -
file-transfer utility
- http://www.ncftp.com/
- -
nvi
- -
New vi versions 1.50 are able to use ncurses versions 1.9.7 - and later.
- https://sites.google.com/a/bostic.com/keithbostic/nvi
-
- -
pinfo
- -
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
- -
tin
- -
newsreader, supporting color, MIME http://www.tin.org/
-
as well as some that use ncurses for the terminfo support - alone: - -
-
minicom
- -
terminal emulator
- http://alioth.debian.org/projects/minicom/
- -
vile
- -
vi-like-emacs
- http://invisible-island.net/vile/
-
- -

The ncurses distribution includes a selection of test programs - (including a few games).

- -

Who's Who and What's What

Zeyd Ben-Halim started it from - a previous package pcurses, written by Pavel Curtis. Eric S. - Raymond continued development. Jürgen Pfeifer wrote most of - the form and menu libraries. Ongoing work is being done by - Thomas Dickey. - Thomas Dickey acts as the maintainer for the Free Software - Foundation, which holds the copyright on ncurses. Contact the - current maintainers at bug-ncurses@gnu.org. - -

To join the ncurses mailing list, please write email to - bug-ncurses-request@gnu.org containing the line:

-
+
+
+Announcing ncurses @VERSION@
+
+
+
+
+
+

Announcing ncurses @VERSION@

+ +The ncurses (new curses) library is a free software emulation of +curses in System V Release 4.0, and more. It uses terminfo format, +supports pads and color +and multiple highlights and forms characters and function-key mapping, +and has all the other SYSV-curses enhancements over BSD curses.

+ +In mid-June 1995, the maintainer of 4.4BSD curses declared that he +considered 4.4BSD curses obsolete, and encouraged the keepers of +Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to +ncurses.

+ +The ncurses code was developed under GNU/Linux. +It has been in use for some time with OpenBSD as the system curses library, +and on FreeBSD and NetBSD as an external package. +It should port easily to any ANSI/POSIX-conforming UNIX. +It has even been ported to OS/2 Warp!

+ +The distribution includes the library and support utilities, including a +terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), +and a termcap conversion tool captoinfo(1). Full manual pages are provided for +the library and tools.

+ +The ncurses distribution is available via anonymous FTP at +the GNU distribution site +ftp://ftp.gnu.org/gnu/ncurses/ . +
It is also available at +ftp://invisible-island.net/ncurses/ . + +

Release Notes

+ +This release is designed to be upward compatible from ncurses 5.0 through 5.6; +very few applications will require recompilation, depending on the platform. +These are the highlights from the change-log since ncurses 5.6 release. +

+Interface changes: +

    +
  • generate linkable stubs for some macros: +
    + getattrs + +
+New features and improvements: +
    +
  • library +
      +
    • new flavor of the ncurses library provides rudimentary + support for POSIX threads. Several functions are + reentrant, but most require either a window-level or + screen-level mutex.
      + (This is API-compatible, + but not ABI-compatible with the normal library). + +
    • add NCURSES_OPAQUE symbol to curses.h, will + use to make structs opaque in selected configurations. + +
    • add NCURSES_EXT_FUNCS and + NCURSES_EXT_COLORS symbols to curses.h to make + it simpler to tell if the extended functions and/or colors + are declared. + +
    • add wresize() to C++ binding + +
    • eliminate fixed-buffer vsprintf() calls in C++ binding. + +
    • add several functions to C++ binding which wrap C functions + that pass a WINDOW* parameter. + +
    • adapt mouse-handling code from menu library in form-library + +
    • improve tracing for form library, showing created forms, + fields, etc. + +
    • make $NCURSES_NO_PADDING feature work for termcap interface . + +
    • add check to trace-file open, if the given name is a + directory, add ".log" to the name and try again. + +
    • several new manpages: curs_legacy.3x, curs_memleaks.3x, + curs_opaque.3x and curs_threads.3x +
    + +
  • programs: +
      +
    • modified three test-programs to demonstrate the threading + support in this version: ditto, rain, worm. + +
    • several new test-programs: demo_panels, dots_mvcur, + inch_wide, inchs, key_name, key_names, savescreen, + savescreen.sh test_arrays, test_get_wstr, test_getstr, + test_instr, test_inwstr and test_opaque. + +
    • add adacurses-config to the Ada95 install. + +
    • modify tic -f option to format spaces as + \s to prevent them from being lost when that + is read back in unformatted strings. + +
    • The tack program is now distributed separately + from ncurses. +
    + +
  • terminal database +
      +
    • added entries: +
        +
      • Eterm-256color, + Eterm-88color and + rxvt-88color +
      • aterm +
      • konsole-256color +
      • mrxvt +
      • screen.mlterm +
      • screen.rxvt +
      • teraterm4.59 is now the primary primary + teraterm entry, renamed original to + teraterm2.3 +
      • 9term terminal +
      • Newbury Data entries +
      +
    • updated/improved entries: +
        +
      • gnome to version 2.22.3 +
      • h19, z100 +
      • konsole to version 1.6.6 +
      • mlterm, mlterm+pcfkeys +
      • xterm, and building-blocks for function-keys + to xterm patch #230. +
      +
    +
+Major bug fixes: +
    +
  • add logic to tic for cancelling strings in user-defined + capabilities + (this is needed for + current konsole terminfo entry). + +
  • modify mk-1st.awk so the generated makefile rules for + linking or installing shared libraries do not first remove the + library, in case it is in use, e.g., libncurses.so by + /bin/sh. + +
  • correct check for notimeout() in wgetch(). + +
  • fix a sign-extension bug in infocmp's repair_acsc() function. + +
  • change winnstr() to stop at the end of the line. + +
  • make Ada95 demo_panels() example work. + +
  • fix for adding a non-spacing character at the beginning of a line. + +
  • fill in extended-color pair to make colors work + for wide-characters using extended-colors. + +
  • improve refresh of window on top of multi-column characters, + taking into account split characters on left/right window + boundaries. + +
  • modify win_wchnstr() to ensure that only a base cell + is returned for each multi-column character. + +
  • improve waddch() and winsch() handling of + EILSEQ from mbrtowc() by using unctrl() + to display illegal bytes rather than trying to append further bytes + to make up a valid sequence. + +
  • restore curs_set() state after + endwin()/refresh() + +
  • modify keyname() to use "^X" form only if + meta() has been called, or if keyname() + is called without initializing curses, e.g., via + initscr() or newterm(). + +
  • modify unctrl() to check codes in 128-255 range versus + isprint(). + If they are not printable, and locale was set, use a "M-" or "~" + sequence. + +
  • improve resizeterm() by moving ripped-off lines, and + repainting the soft-keys. + +
  • modify form library to accept control characters such as newline + in set_field_buffer(), which is compatible with Solaris. + +
  • use NCURSES_MOUSE_MASK() in definition of + BUTTON_RELEASE(), etc., to make those work properly + with the --enable-ext-mouse configuration + +
  • correct some functions in Ada95 binding which were using return + value from C where none was returned. + +
  • reviewed/fixed issues reported by Coverity and Klocwork tools. +
+ +Portability: +
    +
  • configure script: +
      +
    • new options: +
      + +
      --disable-big-strings +
      control whether static string tables are generated as single + large strings (to improve startup performance), or as array + of individual strings. + +
      --disable-relink +
      control whether shared libraries are relinked (during install) + when rpath is enabled. + +
      --disable-tic-depends +
      make explicit whether tic library depends on ncurses/ncursesw + library. + +
      --enable-mixed-case +
      override the configure script's check if the filesystem + supports mixed-case filenames. + This allows one to control how the terminal database + maps to the filesystem. + For filesystems that do not support mixed-case, the library + uses generate 2-character (hexadecimal) codes for the + lower-level of the filesystem terminfo database + +
      --enable-reentrant +
      builds a different flavor of the ncurses library (ncursest) + which improves reentrant use of the + library by reducing global and static variables + (see the "--with-pthread" option for the threaded support). + +
      --enable-weak-symbols +
      use weak-symbols for linking to the POSIX thread library, + and use the same soname for the ncurses shared library + as the normal library (caveat: the ABI is for the threaded + library, which makes global data accessed via functions). + +
      --with-pthread +
      build with the POSIX thread library (tested with AIX, + Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). + +
      --with-ticlib +
      build/install the tic-support functions in a separate library + +
      + +
    • improved options: +
      + +
      --enable-ext-colors +
      requires the wide-character configuration. + +
      --with-chtype +
      ignore option value "unsigned" is always added to + the type in curses.h; do the same for --with-mmask-t. + +
      --with-dmalloc +
      build-fix for redefinition of strndup. + +
      --with-hashed-db +
      accepts a parameter which is the install-prefix of a given + Berkeley Database. + +
      --with-hashed-db +
      the $LIBS environment variable overrides the search for the db + library. + +
      --without-hashed-db +
      assumed when "--disable-database" is used. + +
      + +
    + +
  • other configure/build issues: +
      +
    • build-fixes for LynxOS +
    • modify shared-library rules to allow FreeBSD 3.x to use rpath. +
    • build-fix for FreeBSD "contemporary" TTY interface. +
    • build-fixes for AIX with libtool. +
    • build-fixes for Darwin and libtool. +
    • modify BeOS-specific ifdef's to build on Haiku. +
    • corrected gcc options for building shared libraries on Solaris + and IRIX64. +
    • change shared-library configuration for OpenBSD, make rpath work. +
    • build-fixes for using libutf8, e.g., on OpenBSD 3.7 +
    • add "-e" option in ncurses/Makefile.in when generating source-files + to force earlier exit if the build environment fails unexpectedly. +
    • add support for shared libraries for QNX. +
    • change delimiter in MKlib_gen.sh from '%' to '@', to + avoid substitution by IBM xlc to '#' as part of its extensions to + digraphs. +
    + +
  • library: +
      +
    • rewrite wrapper for wcrtomb(), making it work on + Solaris. This is used in the form library to determine the length + of the buffer needed by field_buffer. +
    • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding + type for data manipulated by signal handlers. +
    • set locale in misc/ncurses-config.in since it uses a range +
    • disable GPM mouse support when $TERM does not happen to contain + "linux", since Gpm_Open() no longer limits its assertion to terminals + that it might handle, e.g., within "screen" in xterm. +
    • reset mouse file-descriptor when unloading GPM library. +
    + +
  • test programs: +
      +
    • update test programs to build/work with various UNIX curses for + comparisons. +
    +
+ +

Features of Ncurses

+ +The ncurses package is fully compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are documented). +
  • Full support for SVr4 curses features including keyboard mapping, color, +forms-drawing with ACS characters, and automatic recognition of keypad +and function keys. +
  • An emulation of the SVr4 panels library, supporting +a stack of windows with backing store, is included. +
  • An emulation of the SVr4 menus library, supporting +a uniform but flexible interface for menu programming, is included. +
  • An emulation of the SVr4 form library, supporting +data collection through on-screen forms, is included. +
  • Binary terminfo entries generated by the ncurses tic(1) implementation +are bit-for-bit-compatible with the entry format SVr4 curses uses. +
  • The utilities have options to allow you to filter terminfo +entries for use with less capable curses/terminfo +versions such as the HP/UX and AIX ports.
+ +The ncurses package also has many useful extensions over SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses +specification, XSI curses (that is, it implements all BASE level features, +and most EXTENDED features). +It includes many function calls not supported under SVr4 curses +(but portability of all +calls is documented so you can use the SVr4 subset only). +
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner +of the screen if your terminal has an insert-character capability. +
  • Ada95 and C++ bindings. +
  • Support for mouse event reporting with X Window xterm +and FreeBSD and OS/2 console windows. +
  • Extended mouse support via Alessandro Rubini's gpm package. +
  • The function wresize() allows you to resize windows, preserving +their data. +
  • The function use_default_colors() allows you to +use the terminal's default colors for the default color pair, +achieving the effect of transparent colors. +
  • The functions keyok() +and define_key() allow +you to better control the use of function keys, +e.g., disabling the ncurses KEY_MOUSE, +or by defining more than one control sequence to map to a given key code. +
  • Support for 256-color terminals, such as modern xterm, when configured +using the --enable-ext-colors option. +
  • Support for 16-color terminals, such as aixterm and modern xterm. +
  • Better cursor-movement optimization. The package now features a +cursor-local-movement computation more efficient than either BSD's +or System V's. +
  • Super hardware scrolling support. The screen-update code incorporates +a novel, simple, and cheap algorithm that enables it to make optimal +use of hardware scrolling, line-insertion, and line-deletion +for screen-line movements. This algorithm is more powerful than +the 4.4BSD curses quickch() routine. +
  • Real support for terminals with the magic-cookie glitch. The +screen-update code will refrain from drawing a highlight if the magic- +cookie unattributed spaces required just before the beginning and +after the end would step on a non-space character. It will +automatically shift highlight boundaries when doing so would make it +possible to draw the highlight without changing the visual appearance +of the screen. +
  • It is possible to generate the library with a list of pre-loaded +fallback entries linked to it so that it can serve those terminal types even +when no terminfo tree or termcap file is accessible (this may be useful +for support of screen-oriented programs that must run in single-user mode). +
  • The tic(1)/captoinfo utility provided with ncurses has the +ability to translate many termcaps from the XENIX, IBM and +AT&T extension sets. +
  • A BSD-like tset(1) utility is provided. +
  • The ncurses library and utilities will automatically read terminfo +entries from $HOME/.terminfo if it exists, and compile to that directory +if it exists and the user has no write access to the system directory. +This feature makes it easier for users to have personal terminfo entries +without giving up access to the system terminfo directory. +
  • You may specify a path of directories to search for compiled +descriptions with the environment variable TERMINFO_DIRS (this +generalizes the feature provided by TERMINFO under stock System V.) +
  • In terminfo source files, use capabilities may refer not just to +other entries in the same source file (as in System V) but also to +compiled entries in either the system terminfo directory or the user's +$HOME/.terminfo directory. +
  • A script (capconvert) is provided to help BSD users +transition from termcap to terminfo. It gathers the information in a +TERMCAP environment variable and/or a ~/.termcap local entries file +and converts it to an equivalent local terminfo tree under $HOME/.terminfo. +
  • Automatic fallback to the /etc/termcap file can be compiled in +when it is not possible to build a terminfo tree. This feature is neither +fast nor cheap, you don't want to use it unless you have to, +but it's there. +
  • The table-of-entries utility toe makes it easy for users to +see exactly what terminal types are available on the system. +
  • The library meets the XSI requirement that every macro entry +point have a corresponding function which may be linked (and will be +prototype-checked) if the macro definition is disabled with +#undef. +
  • An HTML "Introduction to Programming with NCURSES" document provides +a narrative introduction to the curses programming interface. +
+ +

State of the Package

+ +Numerous bugs present in earlier versions have been fixed; the +library is far more reliable than it used to be. Bounds checking in many +`dangerous' entry points has been improved. The code is now type-safe +according to gcc -Wall. The library has been checked for malloc leaks and +arena corruption by the Purify memory-allocation tester.

+ +The ncurses code has been tested with a wide variety of applications +including (versions starting with those noted): +

+
cdk +
Curses Development Kit +
+http://invisible-island.net/cdk/ +
+http://www.vexus.ca/products/CDK/ +
ded +
directory-editor +
+http://invisible-island.net/ded/ +
dialog +
the underlying application used in Slackware's setup, and the basis +for similar applications on GNU/Linux. +
+http://invisible-island.net/dialog/ +
lynx +
the character-screen WWW browser +
+http://lynx.isc.org/release/ +
Midnight Commander +
file manager +
+http://www.ibiblio.org/mc/ +
mutt +
mail utility +
+http://www.mutt.org/ +
ncftp +
file-transfer utility +
+http://www.ncftp.com/ +
nvi +
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. +
+http://www.bostic.com/vi/ +
+
pinfo +
Lynx-like info browser. +https://alioth.debian.org/projects/pinfo/ +
tin +
newsreader, supporting color, MIME +http://www.tin.org/ +
+as well as some that use ncurses for the terminfo support alone: +
+
minicom +
terminal emulator +
+ +http://alioth.debian.org/projects/minicom/ +
vile +
vi-like-emacs +
+http://invisible-island.net/vile/ +
+

+ +The ncurses distribution includes a selection of test programs (including +a few games). + +

Who's Who and What's What

+ +Zeyd Ben-Halim +started it from a previous package pcurses, written by Pavel Curtis. +Eric S. Raymond +continued development. +Jürgen Pfeifer wrote most of the form and menu libraries. +Ongoing work is being done by +Thomas Dickey. +Thomas Dickey +acts as the maintainer for the Free Software Foundation, +which holds the copyright on ncurses. +Contact the current maintainers at +bug-ncurses@gnu.org. +

+ +To join the ncurses mailing list, please write email to +bug-ncurses-request@gnu.org containing the line: +

              subscribe <name>@<host.domain>
-
+
-

This list is open to anyone interested in helping with the - development and testing of this package.

+This list is open to anyone interested in helping with the development and +testing of this package.

-

Beta versions of ncurses and patches to the current release - are made available at ftp://invisible-island.net/ncurses/ .

+Beta versions of ncurses and patches to the current release are made available at +ftp://invisible-island.net/ncurses/ . -

Future Plans

+

Future Plans

+
    +
  • Extended-level XPG4 conformance, with internationalization support. +
  • Ports to more systems, including DOS and Windows. +
+We need people to help with these projects. If you are interested in working +on them, please join the ncurses list. -
    -
  • Extended-level XPG4 conformance, with internationalization - support.
  • +

    Other Related Resources

    -
  • Ports to more systems, including DOS and Windows.
  • -
We need people to help with these projects. If you are - interested in working on them, please join the ncurses list. +The distribution provides a newer version of the terminfo-format +terminal description file once maintained by +Eric Raymond . +Unlike the older version, the termcap and terminfo data are provided +in the same file, and provides several user-definable extensions +beyond the X/Open specification.

-

Other Related Resources

The distribution provides a newer - version of the terminfo-format terminal description file once - maintained by Eric - Raymond . Unlike the older version, the termcap and - terminfo data are provided in the same file, and provides several - user-definable extensions beyond the X/Open specification. - -

You can find lots of information on terminal-related topics - not covered in the terminfo file at - Richard Shuford's archive .

- - +You can find lots of information on terminal-related topics +not covered in the terminfo file at +Richard Shuford's +archive . + + + diff --git a/c++/Makefile.in b/c++/Makefile.in deleted file mode 100644 index 6fd8ffc55f2..00000000000 --- a/c++/Makefile.in +++ /dev/null @@ -1,248 +0,0 @@ -# $Id: Makefile.in,v 1.93 2010/11/27 21:45:27 tom Exp $ -############################################################################## -# Copyright (c) 1998-2009,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"), # -# 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 -# -# Simple makefile for c++ window class demo - -# turn off _all_ suffix rules; we'll generate our own -.SUFFIXES: - -SHELL = /bin/sh -VPATH = @srcdir@ - -CF_MFLAGS = @cf_cv_makeflags@ -@SET_MAKE@ -x = @EXEEXT@ -o = .@OBJEXT@ - -MODEL = ../@DFT_OBJ_SUBDIR@ -DESTDIR = @DESTDIR@ -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -libdir = @libdir@ -includedir = @includedir@ - -LIBTOOL = @LIBTOOL_CXX@ -LIBTOOL_CLEAN = @LIB_CLEAN@ -LIBTOOL_COMPILE = @LIB_COMPILE@ -LIBTOOL_LINK = @LIB_LINK@ -LIBTOOL_INSTALL = @LIB_INSTALL@ -LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ -LIBTOOL_VERSION = @LIBTOOL_VERSION@ -LT_UNDEF = @LT_UNDEF@ - -INSTALL = @INSTALL@ -INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ -INSTALL_DATA = @INSTALL_DATA@ - -AR = @AR@ -ARFLAGS = @ARFLAGS@ - -CXX_AR = @CXX_AR@ -CXX_ARFLAGS = @CXX_ARFLAGS@ -RANLIB = @LIB_PREP@ - -CXX = @CXX@ -CPP = @CXXCPP@ -CXXFLAGS = @CXXFLAGS@ @EXTRA_CXXFLAGS@ -CXXLIBS = @CXXLIBS@ - -INCDIR = ../include -CPPFLAGS = -I../c++ -I$(INCDIR) -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ - -CTAGS = @CTAGS@ -ETAGS = @ETAGS@ - -CC = ${CXX} -CCFLAGS = $(CPPFLAGS) $(CXXFLAGS) - -CFLAGS_LIBTOOL = $(CCFLAGS) -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CXX_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ - -CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) - -NCURSES_MAJOR = @NCURSES_MAJOR@ -NCURSES_MINOR = @NCURSES_MINOR@ -REL_VERSION = @cf_cv_rel_version@ -ABI_VERSION = @cf_cv_abi_version@ - -LOCAL_LIBDIR = @top_builddir@/lib - -LINK = @LINK_PROGS@ $(LIBTOOL_LINK) @CXXLDFLAGS@ -SHLIB_DIRS = -L../lib -SHLIB_LIST = $(SHLIB_DIRS) -lform@LIB_SUFFIX@ -lmenu@LIB_SUFFIX@ -lpanel@LIB_SUFFIX@ -lncurses@LIB_SUFFIX@ @SHLIB_LIST@ - -LIBROOT = ncurses++ - -LIBNAME_LIBTOOL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.la -LIBNAME_NORMAL = @LIB_PREFIX@$(LIBROOT)@LIB_SUFFIX@.a -LIBNAME = @LIB_PREFIX@$(LIBROOT)@CXX_LIB_SUFFIX@ - -MY_LIBRARY = ../lib/$(LIBNAME) - -LINK_FLAGS = @EXTRA_LDFLAGS@ -L../lib -l$(LIBROOT)@LIB_SUFFIX@ - -LINK_LIBTOOL = @EXTRA_LDFLAGS@ -L../lib $(MY_LIBRARY) -LINK_NORMAL = $(LINK_FLAGS) -LINK_DEBUG = $(LINK_FLAGS) -LINK_PROFILE = $(LINK_FLAGS) -LINK_SHARED = $(LINK_FLAGS) - -TEST_LIBS = @TEST_LIBS@ -TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ - -LDFLAGS = $(TEST_ARGS) @LDFLAGS@ \ - @LD_MODEL@ $(TEST_LIBS) @LIBS@ @LOCAL_LDFLAGS@ $(CXXLIBS) - -LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL) -LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL) -LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG) -LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) -LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@ - -LDFLAGS_DEFAULT = $(LINK_@DFT_UPR_MODEL@) $(LDFLAGS_@DFT_UPR_MODEL@) - -AUTO_SRC = \ - etip.h - -all \ -libs :: $(AUTO_SRC) $(MY_LIBRARY) - -@MAKE_TESTS@all :: demo$x - -sources : $(AUTO_SRC) - -depend : - -tags: - $(CTAGS) *.[h] *.cc - -# Build a conventional library for installing, since a shared library would -# pull in all of the ncurses libraries (panel, menu, form, ncurses) as direct -# dependencies. -LIB_OBJS = \ - $(MODEL)/cursesf$o \ - $(MODEL)/cursesm$o \ - $(MODEL)/cursesw$o \ - $(MODEL)/cursespad$o \ - $(MODEL)/cursesp$o \ - $(MODEL)/cursslk$o \ - $(MODEL)/cursesapp$o \ - $(MODEL)/cursesmain$o - -../lib/$(LIBNAME_NORMAL) : $(LIB_OBJS) - $(CXX_AR) $(CXX_ARFLAGS) $@ $? - $(RANLIB) $@ - -../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) - cd ../lib && $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) \ - -o $(LIBNAME) $(LIB_OBJS:$o=.lo) \ - -rpath $(INSTALL_PREFIX)$(libdir) \ - $(LIBTOOL_VERSION) $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(SHLIB_LIST) - -OBJS_DEMO = $(MODEL)/demo$o - -$(MODEL)/demo$o : $(srcdir)/demo.cc \ - $(cursesf_h) $(cursesm_h) $(cursesapp_h) - -demo$x: $(OBJS_DEMO) \ - $(MY_LIBRARY) \ - @TEST_DEPS@ - @ECHO_LINK@ $(LINK) -o $@ $(OBJS_DEMO) $(LDFLAGS_DEFAULT) - -etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh - cp $(srcdir)/etip.h.in $@ - sh $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@ - -$(DESTDIR)$(libdir) : - mkdir -p $@ - -install \ -install.libs:: $(MY_LIBRARY) $(DESTDIR)$(libdir) - $(LIBTOOL_INSTALL) $(INSTALL_LIB) $(MY_LIBRARY) $(DESTDIR)$(libdir)/$(LIBNAME) - -uninstall \ -uninstall.libs:: - -$(LIBTOOL_UNINSTALL) rm -f $(DESTDIR)$(libdir)/$(LIBNAME) - -mostlyclean :: - -rm -f core tags TAGS *~ *.bak *.i *.ii *.ln *.atac trace - -clean :: mostlyclean - -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi" - -rm -rf $(MODEL)/SunWS_cache - -$(LIBTOOL_CLEAN) rm -f demo$x $(AUTO_SRC) $(MY_LIBRARY) $(LIB_OBJS) $(OBJS_DEMO) - -rm -rf .libs - -distclean :: clean - -rm -f Makefile - -realclean :: distclean - -############################################################################### - -cursesw_h = $(srcdir)/cursesw.h \ - etip.h \ - $(INCDIR)/curses.h - -cursesp_h = $(srcdir)/cursesp.h \ - $(cursesw_h) \ - $(INCDIR)/panel.h - -cursesf_h = $(srcdir)/cursesf.h \ - $(cursesp_h) \ - $(INCDIR)/form.h - -cursesm_h = $(srcdir)/cursesm.h \ - $(cursesp_h) \ - $(INCDIR)/menu.h - -cursslk_h = $(srcdir)/cursslk.h \ - $(cursesw_h) - -cursesapp_h = $(srcdir)/cursesapp.h \ - $(cursslk_h) - -$(INCDIR)/form.h : - cd ../form && $(MAKE) $@ - -$(INCDIR)/menu.h : - cd ../menu && $(MAKE) $@ - -$(INCDIR)/panel.h : - cd ../panel && $(MAKE) $@ - -############################################################################### -# The remainder of this file is automatically generated during configuration -############################################################################### diff --git a/c++/NEWS b/c++/NEWS deleted file mode 100644 index 17488a41f4c..00000000000 --- a/c++/NEWS +++ /dev/null @@ -1,71 +0,0 @@ -------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: NEWS,v 1.4 2006/04/22 22:19:37 tom Exp $ -------------------------------------------------------------------------------- -This is a log of changes that the ncurses C++ binding has gone -through starting with the integration of menu and forms integration -into the binding. - -990731 + Improve support for pads. A viewport window may now be added to - a pad. It will then be possible to use a builtin panning mechanism - to view the pad. - -970908 + Improve NCursesWindow class: added additional methods to - cover more ncurses functionality. Make refresh() and - noutrefresh() virtual members to allow different implementation - in the NCursesPanel class. - + CAUTION: changed order of parameters in vline() and hline() of - NCursesWindow class. - + Make refresh() in NCursesPanel non-static, it is now a - reimplementation of refresh() in the base class. Added - noutrefresh() to NCursesPanel. - + Added NCursesForm and related classes to support libform - functionality. - + Moved most of configuration related stuff from cursesw.h to - etip.h - + Added NCursesApplication class to support easy configuration - of menu and forms related attributes as well as ripped of - title lines and Soft-Label-Keys for an application. - + Support of Auto-Cleanup for a menus fieldlist. - + Change of return type for current_item() and operator[] for - menus. - + Enhanced demo. -970502 - + Introduced the THROW and THROWS functions/macros to prepare - a smoother transition to real exception handling. - + Exception classes provided in etip.h - + Added the NCursesMenu class to support libmenu functionality. - + The inheritace relation between NCursesWindow and NCursesColorWindow - was kind of brain damage. Monochrome is a special case of colored, so - the relation should be just the opposite. This would allow all - derived classes like NCursesPanel, NCursesMenu or NCursesForm to - have colors. - To resolve that design flaw I put the color functionality into the - NCursesWindow class and it can be switched on by the static member - useColors(). NCursesColorWindow is still there for compatibility - reasons. diff --git a/c++/PROBLEMS b/c++/PROBLEMS deleted file mode 100644 index 7f2a7df5efc..00000000000 --- a/c++/PROBLEMS +++ /dev/null @@ -1,34 +0,0 @@ -------------------------------------------------------------------------------- --- Copyright (c) 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 -- --- "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: PROBLEMS,v 1.3 2006/04/22 22:19:37 tom Exp $ -------------------------------------------------------------------------------- -This is a list of open problems. This mainly lists known missing pieces -and design flaws. - -1. Testing!!! -2. Better demo program diff --git a/c++/README-first b/c++/README-first deleted file mode 100644 index 42487f52db4..00000000000 --- a/c++/README-first +++ /dev/null @@ -1,80 +0,0 @@ -------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. -- --- -- --- Permission is hereby granted, free of charge, to any person obtaining a -- --- copy of this software and associated documentation files (the -- --- "Software"), 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: README-first,v 1.9 2007/01/27 18:27:09 tom Exp $ -------------------------------------------------------------------------------- - C++ interface to ncurses routines ------------------------------------------------------------------------ - -This directory contains the source code for several C++ classes which -ease the use of writing ncurses-based programs. The code was originally -derived from the libg++ CursesWindow class, but rewritten for ncurses. - -The classes simplify the use of window specific functions by -encapsulating them in the window object. Function overloading is -used in order to narrow the interface. For example, you do not have the -distinction between `printw' and `mvprintw' anymore. - -A second benefit is the removal of all #defines which are included in -the curses.h file. This is a steady cause of trouble because many -common identifiers are used. Instead now all #defines are inline -functions, which also allows strict type checking of arguments. - -The next enhancement is color support. It was originally provided by a -derived class. This caused some trouble if you think about Panels or -Menus and Forms with colors. We decided to put color support into the -base class so that any derived class may use color support also. -The implementation chosen here is directed to unrestricted use -of mixes of color and monochrome windows. The original NCursesColorWindow -class is maintained for compatibility reasons. - -The last point to mention is the support of other packages that are -distributed with the ncurses package: the panels library, the menu library -and the form library. This support is provided by the NCursesPanel class, -which is also derived from the NCursesWindow class and the NCursesMenu -and NCursesForm classes which are derived from NCursesPanel. This allows -building interfaces with windows. - -Please see the example program for a quick introduction. - -Note that at this point, there is no documentation for these classes. -Hopefully some will be written in the not too distant future. For now, -to find out how to use the classes, read the code and the example program. - -Suggestions for enhancements and contributions of code (and docs) are -welcome. Please let us know which functionality you miss. - -Original author: - Eric Newton for FSF's libg++ - -Authors of first ncurses based release (NCursesWindow, NCursesPanel): - Ulrich Drepper - and Anatoly Ivasyuk - -Authors of this release: - Juergen Pfeifer - Thomas E. Dickey diff --git a/c++/cursesapp.cc b/c++/cursesapp.cc deleted file mode 100644 index ddab6fdf9b9..00000000000 --- a/c++/cursesapp.cc +++ /dev/null @@ -1,164 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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: Juergen Pfeifer, 1997 * - * and: Thomas E. Dickey * - ****************************************************************************/ - -#include "internal.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesapp.cc,v 1.15 2008/08/16 17:15:35 tom Exp $") - -void -NCursesApplication::init(bool bColors) -{ - if (bColors) - NCursesWindow::useColors(); - - if (Root_Window->colors() > 1) { - b_Colors = TRUE; - Root_Window->setcolor(1); - Root_Window->setpalette(COLOR_YELLOW,COLOR_BLUE); - Root_Window->setcolor(2); - Root_Window->setpalette(COLOR_CYAN,COLOR_BLUE); - Root_Window->setcolor(3); - Root_Window->setpalette(COLOR_BLACK,COLOR_BLUE); - Root_Window->setcolor(4); - Root_Window->setpalette(COLOR_BLACK,COLOR_CYAN); - Root_Window->setcolor(5); - Root_Window->setpalette(COLOR_BLUE,COLOR_YELLOW); - Root_Window->setcolor(6); - Root_Window->setpalette(COLOR_BLACK,COLOR_GREEN); - } - else - b_Colors = FALSE; - - Root_Window->bkgd(' '|window_backgrounds()); -} - -NCursesApplication* NCursesApplication::theApp = 0; -NCursesWindow* NCursesApplication::titleWindow = 0; -NCursesApplication::SLK_Link* NCursesApplication::slk_stack = 0; - -NCursesApplication::~NCursesApplication() -{ - Soft_Label_Key_Set* S; - - delete titleWindow; - titleWindow = 0; - - while( (S=top()) ) { - pop(); - delete S; - } - - delete Root_Window; - Root_Window = 0; - - ::endwin(); -} - -int NCursesApplication::rinit(NCursesWindow& w) -{ - titleWindow = &w; - return OK; -} - -void NCursesApplication::push(Soft_Label_Key_Set& S) -{ - SLK_Link* L = new SLK_Link; - assert(L != 0); - L->prev = slk_stack; - L->SLKs = &S; - slk_stack = L; - if (Root_Window) - S.show(); -} - -bool NCursesApplication::pop() -{ - if (slk_stack) { - SLK_Link* L = slk_stack; - slk_stack = slk_stack->prev; - delete L; - if (Root_Window) { - Soft_Label_Key_Set* xx = top(); - if (xx != 0) - xx->show(); - } - } - return (slk_stack ? FALSE : TRUE); -} - -Soft_Label_Key_Set* NCursesApplication::top() const -{ - if (slk_stack) - return slk_stack->SLKs; - else - return static_cast(0); -} - -int NCursesApplication::operator()(void) -{ - bool bColors = b_Colors; - Soft_Label_Key_Set* S = 0; - - int ts = titlesize(); - if (ts>0) - NCursesWindow::ripoffline(ts,rinit); - Soft_Label_Key_Set::Label_Layout fmt = useSLKs(); - if (fmt!=Soft_Label_Key_Set::None) { - S = new Soft_Label_Key_Set(fmt); - assert(S != 0); - init_labels(*S); - } - - Root_Window = new NCursesWindow(::stdscr); - init(bColors); - - if (ts>0) - title(); - if (fmt!=Soft_Label_Key_Set::None) { - push(*S); - } - - return run(); -} - -NCursesApplication::NCursesApplication(bool bColors) - : b_Colors(bColors), - Root_Window(NULL) -{ - if (theApp) - THROW(new NCursesException("Application object already created.")); - else - theApp = this; -} diff --git a/c++/cursesapp.h b/c++/cursesapp.h deleted file mode 100644 index 7e995d2e39c..00000000000 --- a/c++/cursesapp.h +++ /dev/null @@ -1,176 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesapp.h,v 1.11 2005/05/28 21:57:44 tom Exp $ - -#ifndef NCURSES_CURSESAPP_H_incl -#define NCURSES_CURSESAPP_H_incl - -#include - -class NCURSES_IMPEXP NCursesApplication { -public: - typedef struct _slk_link { // This structure is used to maintain - struct _slk_link* prev; // a stack of SLKs - Soft_Label_Key_Set* SLKs; - } SLK_Link; -private: - static int rinit(NCursesWindow& w); // Internal Init function for title - static NCursesApplication* theApp; // Global ref. to the application - - static SLK_Link* slk_stack; - -protected: - static NCursesWindow* titleWindow; // The Title Window (if any) - - bool b_Colors; // Is this a color application? - NCursesWindow* Root_Window; // This is the stdscr equiv. - - // Initialization of attributes; - // Rewrite this in your derived class if you prefer other settings - virtual void init(bool bColors); - - // The number of lines for the title window. Default is no title window - // You may rewrite this in your derived class - virtual int titlesize() const { - return 0; - } - - // This method is called to put something into the title window initially - // You may rewrite this in your derived class - virtual void title() { - } - - // The layout used for the Soft Label Keys. Default is to have no SLKs. - // You may rewrite this in your derived class - virtual Soft_Label_Key_Set::Label_Layout useSLKs() const { - return Soft_Label_Key_Set::None; - } - - // This method is called to initialize the SLKs. Default is nothing. - // You may rewrite this in your derived class - virtual void init_labels(Soft_Label_Key_Set& S) const { - } - - // Your derived class must implement this method. The return value must - // be the exit value of your application. - virtual int run() = 0; - - // The constructor is protected, so you may use it in your derived - // class constructor. The argument tells whether or not you want colors. - NCursesApplication(bool wantColors = FALSE); - - NCursesApplication& operator=(const NCursesApplication& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesApplication(const NCursesApplication& rhs) - : b_Colors(rhs.b_Colors), - Root_Window(rhs.Root_Window) - { - } - -public: - virtual ~NCursesApplication(); - - // Get a pointer to the current application object - static NCursesApplication* getApplication() { - return theApp; - } - - // This method runs the application and returns its exit value - int operator()(void); - - // Process the commandline arguments. The default implementation simply - // ignores them. Your derived class may rewrite this. - virtual void handleArgs(int argc, char* argv[]) { - } - - // Does this application use colors? - inline bool useColors() const { - return b_Colors; - } - - // Push the Key Set S onto the SLK Stack. S then becomes the current set - // of Soft Labelled Keys. - void push(Soft_Label_Key_Set& S); - - // Throw away the current set of SLKs and make the previous one the - // new current set. - bool pop(); - - // Retrieve the current set of Soft Labelled Keys. - Soft_Label_Key_Set* top() const; - - // Attributes to use for menu and forms foregrounds - virtual chtype foregrounds() const { - return b_Colors ? COLOR_PAIR(1) : A_BOLD; - } - - // Attributes to use for menu and forms backgrounds - virtual chtype backgrounds() const { - return b_Colors ? COLOR_PAIR(2) : A_NORMAL; - } - - // Attributes to use for inactive (menu) elements - virtual chtype inactives() const { - return b_Colors ? (COLOR_PAIR(3)|A_DIM) : A_DIM; - } - - // Attributes to use for (form) labels and SLKs - virtual chtype labels() const { - return b_Colors ? COLOR_PAIR(4) : A_NORMAL; - } - - // Attributes to use for form backgrounds - virtual chtype dialog_backgrounds() const { - return b_Colors ? COLOR_PAIR(4) : A_NORMAL; - } - - // Attributes to use as default for (form) window backgrounds - virtual chtype window_backgrounds() const { - return b_Colors ? COLOR_PAIR(5) : A_NORMAL; - } - - // Attributes to use for the title window - virtual chtype screen_titles() const { - return b_Colors ? COLOR_PAIR(6) : A_BOLD; - } - -}; - -#endif /* NCURSES_CURSESAPP_H_incl */ diff --git a/c++/cursesf.cc b/c++/cursesf.cc deleted file mode 100644 index aaf1202ca94..00000000000 --- a/c++/cursesf.cc +++ /dev/null @@ -1,454 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesf.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesf.cc,v 1.21 2005/08/13 18:09:06 tom Exp $") - -NCursesFormField::~NCursesFormField () -{ - if (field) - OnError(::free_field (field)); -} - -/* Construct a FIELD* array from an array of NCursesFormField - * objects. - */ -FIELD** -NCursesForm::mapFields(NCursesFormField* nfields[]) -{ - int fieldCount = 0,lcv; - FIELD** old_fields; - - assert(nfields != 0); - - for (lcv=0; nfields[lcv]->field; ++lcv) - ++fieldCount; - - FIELD** fields = new FIELD*[fieldCount + 1]; - - for (lcv=0;nfields[lcv]->field;++lcv) { - fields[lcv] = nfields[lcv]->field; - } - fields[lcv] = NULL; - - my_fields = nfields; - - if (form && (old_fields = ::form_fields(form))) { - ::set_form_fields(form, static_cast(0)); - delete[] old_fields; - } - return fields; -} - -void NCursesForm::setDefaultAttributes() -{ - NCursesApplication* S = NCursesApplication::getApplication(); - - int n = count(); - if (n > 0) { - for(int i=0; ioptions() & (O_EDIT|O_ACTIVE))==(O_EDIT|O_ACTIVE)) { - if (S) { - f->set_foreground(S->foregrounds()); - f->set_background(S->backgrounds()); - } - f->set_pad_character('_'); - } - else { - if (S) - f->set_background(S->labels()); - } - } - } - - if (S) { - bkgd(' '|S->dialog_backgrounds()); - if (sub) - sub->bkgd(' '|S->dialog_backgrounds()); - } -} - -void -NCursesForm::InitForm(NCursesFormField* nfields[], - bool with_frame, - bool autoDelete_Fields) -{ - int mrows, mcols; - - keypad(TRUE); - meta(TRUE); - - b_framed = with_frame; - b_autoDelete = autoDelete_Fields; - - form = static_cast(0); - form = ::new_form(mapFields(nfields)); - if (!form) - OnError (E_SYSTEM_ERROR); - - UserHook* hook = new UserHook; - hook->m_user = NULL; - hook->m_back = this; - hook->m_owner = form; - ::set_form_userptr(form, reinterpret_cast(hook)); - - ::set_form_init (form, _nc_xx_frm_init); - ::set_form_term (form, _nc_xx_frm_term); - ::set_field_init (form, _nc_xx_fld_init); - ::set_field_term (form, _nc_xx_fld_term); - - scale(mrows, mcols); - ::set_form_win(form, w); - - if (with_frame) { - if ((mrows > height()-2) || (mcols > width()-2)) - OnError(E_NO_ROOM); - sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); - ::set_form_sub(form, sub->w); - b_sub_owner = TRUE; - } - else { - sub = static_cast(0); - b_sub_owner = FALSE; - } - options_on(O_NL_OVERLOAD); - setDefaultAttributes(); -} - -NCursesForm::~NCursesForm() -{ - UserHook* hook = reinterpret_cast(::form_userptr(form)); - delete hook; - if (b_sub_owner) { - delete sub; - ::set_form_sub(form, static_cast(0)); - } - if (form) { - FIELD** fields = ::form_fields(form); - int cnt = count(); - - OnError(::set_form_fields(form, static_cast(0))); - - if (b_autoDelete) { - if (cnt>0) { - for (int i=0; i <= cnt; i++) - delete my_fields[i]; - } - delete[] my_fields; - } - - ::free_form(form); - // It's essential to do this after free_form() - delete[] fields; - } -} - -void -NCursesForm::setSubWindow(NCursesWindow& nsub) -{ - if (!isDescendant(nsub)) - OnError(E_SYSTEM_ERROR); - else { - if (b_sub_owner) - delete sub; - sub = ⊄ - ::set_form_sub(form,sub->w); - } -} - -/* Internal hook functions. They will route the hook - * calls to virtual methods of the NCursesForm class, - * so in C++ providing a hook is done simply by - * implementing a virtual method in a derived class - */ -void -_nc_xx_frm_init(FORM *f) -{ - NCursesForm::getHook(f)->On_Form_Init(); -} - -void -_nc_xx_frm_term(FORM *f) -{ - NCursesForm::getHook(f)->On_Form_Termination(); -} - -void -_nc_xx_fld_init(FORM *f) -{ - NCursesForm* F = NCursesForm::getHook(f); - F->On_Field_Init (*(F->current_field ())); -} - -void -_nc_xx_fld_term(FORM *f) -{ - NCursesForm* F = NCursesForm::getHook(f); - F->On_Field_Termination (*(F->current_field ())); -} - -void -NCursesForm::On_Form_Init() -{ -} - -void -NCursesForm::On_Form_Termination() -{ -} - -void -NCursesForm::On_Field_Init(NCursesFormField& field) -{ -} - -void -NCursesForm::On_Field_Termination(NCursesFormField& field) -{ -} - -// call the form driver and do basic error checking. -int -NCursesForm::driver (int c) -{ - int res = ::form_driver (form, c); - switch (res) { - case E_OK: - case E_REQUEST_DENIED: - case E_INVALID_FIELD: - case E_UNKNOWN_COMMAND: - break; - default: - OnError (res); - } - return (res); -} - -void NCursesForm::On_Request_Denied(int c) const -{ - ::beep(); -} - -void NCursesForm::On_Invalid_Field(int c) const -{ - ::beep(); -} - -void NCursesForm::On_Unknown_Command(int c) const -{ - ::beep(); -} - -static const int CMD_QUIT = MAX_COMMAND + 1; - -NCursesFormField* -NCursesForm::operator()(void) -{ - int drvCmnd; - int err; - int c; - - post(); - show(); - refresh(); - - while (((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { - switch((err=driver(drvCmnd))) { - case E_REQUEST_DENIED: - On_Request_Denied(c); - break; - case E_INVALID_FIELD: - On_Invalid_Field(c); - break; - case E_UNKNOWN_COMMAND: - On_Unknown_Command(c); - break; - case E_OK: - break; - default: - OnError(err); - } - } - - unpost(); - hide(); - refresh(); - return my_fields[::field_index (::current_field (form))]; -} - -// Provide a default key virtualization. Translate the keyboard -// code c into a form request code. -// The default implementation provides a hopefully straightforward -// mapping for the most common keystrokes and form requests. -int -NCursesForm::virtualize(int c) -{ - switch(c) { - - case KEY_HOME : return(REQ_FIRST_FIELD); - case KEY_END : return(REQ_LAST_FIELD); - - case KEY_DOWN : return(REQ_DOWN_CHAR); - case KEY_UP : return(REQ_UP_CHAR); - case KEY_LEFT : return(REQ_PREV_CHAR); - case KEY_RIGHT : return(REQ_NEXT_CHAR); - - case KEY_NPAGE : return(REQ_NEXT_PAGE); - case KEY_PPAGE : return(REQ_PREV_PAGE); - - case KEY_BACKSPACE : return(REQ_DEL_PREV); - case KEY_ENTER : return(REQ_NEW_LINE); - case KEY_CLEAR : return(REQ_CLR_FIELD); - - case CTRL('X') : return(CMD_QUIT); // eXit - - case CTRL('F') : return(REQ_NEXT_FIELD); // Forward - case CTRL('B') : return(REQ_PREV_FIELD); // Backward - case CTRL('L') : return(REQ_LEFT_FIELD); // Left - case CTRL('R') : return(REQ_RIGHT_FIELD); // Right - case CTRL('U') : return(REQ_UP_FIELD); // Up - case CTRL('D') : return(REQ_DOWN_FIELD); // Down - - case CTRL('W') : return(REQ_NEXT_WORD); - case CTRL('T') : return(REQ_PREV_WORD); - - case CTRL('A') : return(REQ_BEG_FIELD); - case CTRL('E') : return(REQ_END_FIELD); - - case CTRL('I') : return(REQ_INS_CHAR); - case CTRL('M') : - case CTRL('J') : return(REQ_NEW_LINE); - case CTRL('O') : return(REQ_INS_LINE); - case CTRL('V') : return(REQ_DEL_CHAR); - case CTRL('H') : return(REQ_DEL_PREV); - case CTRL('Y') : return(REQ_DEL_LINE); - case CTRL('G') : return(REQ_DEL_WORD); - case CTRL('K') : return(REQ_CLR_EOF); - - case CTRL('N') : return(REQ_NEXT_CHOICE); - case CTRL('P') : return(REQ_PREV_CHOICE); - - default: - return(c); - } -} -// -// ------------------------------------------------------------------------- -// User Defined Fieldtypes -// ------------------------------------------------------------------------- -// -bool _nc_xx_fld_fcheck(FIELD *f, const void *u) -{ - NCursesFormField* F = reinterpret_cast(const_cast(u)); - assert(F != 0); - UserDefinedFieldType* udf = reinterpret_cast(F->fieldtype()); - assert(udf != 0); - return udf->field_check(*F); -} - -bool _nc_xx_fld_ccheck(int c, const void *u) -{ - NCursesFormField* F = reinterpret_cast(const_cast(u)); - assert(F != 0); - UserDefinedFieldType* udf = - reinterpret_cast(F->fieldtype()); - assert(udf != 0); - return udf->char_check(c); -} - -void* _nc_xx_fld_makearg(va_list* va) -{ - return va_arg(*va,NCursesFormField*); -} - -FIELDTYPE* UserDefinedFieldType::generic_fieldtype = - ::new_fieldtype(_nc_xx_fld_fcheck, - _nc_xx_fld_ccheck); - -FIELDTYPE* UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice = - ::new_fieldtype(_nc_xx_fld_fcheck, - _nc_xx_fld_ccheck); - -bool _nc_xx_next_choice(FIELD *f, const void *u) -{ - NCursesFormField* F = reinterpret_cast(const_cast(u)); - assert(F != 0); - UserDefinedFieldType_With_Choice* udf = - reinterpret_cast(F->fieldtype()); - assert(udf != 0); - return udf->next(*F); -} - -bool _nc_xx_prev_choice(FIELD *f, const void *u) -{ - NCursesFormField* F = reinterpret_cast(const_cast(u)); - assert(F != 0); - UserDefinedFieldType_With_Choice* udf = - reinterpret_cast(F->fieldtype()); - assert(udf != 0); - return udf->previous(*F); -} - -class UDF_Init -{ -private: - int code; - static UDF_Init* I; - -public: - UDF_Init() - : code(0) - { - code = ::set_fieldtype_arg(UserDefinedFieldType::generic_fieldtype, - _nc_xx_fld_makearg, - NULL, - NULL); - if (code==E_OK) - code = ::set_fieldtype_arg - (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, - _nc_xx_fld_makearg, - NULL, - NULL); - if (code==E_OK) - code = ::set_fieldtype_choice - (UserDefinedFieldType_With_Choice::generic_fieldtype_with_choice, - _nc_xx_next_choice, - _nc_xx_prev_choice); - } -}; - -UDF_Init* UDF_Init::I = new UDF_Init(); diff --git a/c++/cursesf.h b/c++/cursesf.h deleted file mode 100644 index 70a30c370e5..00000000000 --- a/c++/cursesf.h +++ /dev/null @@ -1,967 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesf.h,v 1.28 2005/08/13 18:08:24 tom Exp $ - -#ifndef NCURSES_CURSESF_H_incl -#define NCURSES_CURSESF_H_incl 1 - -#include - -#ifndef __EXT_QNX -#include -#endif - -extern "C" { -# include -} -// -// ------------------------------------------------------------------------- -// The abstract base class for buitin and user defined Fieldtypes. -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesFormField; // forward declaration - -// Class to represent builtin field types as well as C++ written new -// fieldtypes (see classes UserDefineFieldType... -class NCURSES_IMPEXP NCursesFieldType -{ - friend class NCursesFormField; - -protected: - FIELDTYPE* fieldtype; - - inline void OnError(int err) const THROWS(NCursesFormException) { - if (err!=E_OK) - THROW(new NCursesFormException (err)); - } - - NCursesFieldType(FIELDTYPE *f) : fieldtype(f) { - } - - virtual ~NCursesFieldType() {} - - // Set the fields f fieldtype to this one. - virtual void set(NCursesFormField& f) = 0; - -public: - NCursesFieldType() - : fieldtype(STATIC_CAST(FIELDTYPE*)(0)) - { - } - - NCursesFieldType& operator=(const NCursesFieldType& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesFieldType(const NCursesFieldType& rhs) - : fieldtype(rhs.fieldtype) - { - } - -}; - -// -// ------------------------------------------------------------------------- -// The class representing a forms field, wrapping the lowlevel FIELD struct -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesFormField -{ - friend class NCursesForm; - -protected: - FIELD *field; // lowlevel structure - NCursesFieldType* ftype; // Associated field type - - // Error handler - inline void OnError (int err) const THROWS(NCursesFormException) { - if (err != E_OK) - THROW(new NCursesFormException (err)); - } - -public: - // Create a 'Null' field. Can be used to delimit a field list - NCursesFormField() - : field(STATIC_CAST(FIELD*)(0)), - ftype(STATIC_CAST(NCursesFieldType*)(0)) - { - } - - // Create a new field - NCursesFormField (int rows, - int ncols, - int first_row = 0, - int first_col = 0, - int offscreen_rows = 0, - int additional_buffers = 0) - : field(0), - ftype(STATIC_CAST(NCursesFieldType*)(0)) - { - field = ::new_field(rows, ncols, first_row, first_col, - offscreen_rows, additional_buffers); - if (!field) - OnError(errno); - } - - NCursesFormField& operator=(const NCursesFormField& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesFormField(const NCursesFormField& rhs) - : field(rhs.field), ftype(rhs.ftype) - { - } - - virtual ~NCursesFormField (); - - // Duplicate the field at a new position - inline NCursesFormField* dup(int first_row, int first_col) - { - NCursesFormField* f = new NCursesFormField(); - if (!f) - OnError(E_SYSTEM_ERROR); - else { - f->ftype = ftype; - f->field = ::dup_field(field,first_row,first_col); - if (!f->field) - OnError(errno); - } - return f; - } - - // Link the field to a new location - inline NCursesFormField* link(int first_row, int first_col) { - NCursesFormField* f = new NCursesFormField(); - if (!f) - OnError(E_SYSTEM_ERROR); - else { - f->ftype = ftype; - f->field = ::link_field(field,first_row,first_col); - if (!f->field) - OnError(errno); - } - return f; - } - - // Get the lowlevel field representation - inline FIELD* get_field() const { - return field; - } - - // Retrieve info about the field - inline void info(int& rows, int& ncols, - int& first_row, int& first_col, - int& offscreen_rows, int& additional_buffers) const { - OnError(::field_info(field, &rows, &ncols, - &first_row, &first_col, - &offscreen_rows, &additional_buffers)); - } - - // Retrieve info about the fields dynamic properties. - inline void dynamic_info(int& dynamic_rows, int& dynamic_cols, - int& max_growth) const { - OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols, - &max_growth)); - } - - // For a dynamic field you may set the maximum growth limit. - // A zero means unlimited growth. - inline void set_maximum_growth(int growth = 0) { - OnError(::set_max_field(field,growth)); - } - - // Move the field to a new position - inline void move(int row, int col) { - OnError(::move_field(field,row,col)); - } - - // Mark the field to start a new page - inline void new_page(bool pageFlag = FALSE) { - OnError(::set_new_page(field,pageFlag)); - } - - // Retrieve whether or not the field starts a new page. - inline bool is_new_page() const { - return ::new_page(field); - } - - // Set the justification for the field - inline void set_justification(int just) { - OnError(::set_field_just(field,just)); - } - - // Retrieve the fields justification - inline int justification() const { - return ::field_just(field); - } - // Set the foreground attribute for the field - inline void set_foreground(chtype foreground) { - OnError(::set_field_fore(field,foreground)); - } - - // Retrieve the fields foreground attribute - inline chtype fore() const { - return ::field_fore(field); - } - - // Set the background attribute for the field - inline void set_background(chtype background) { - OnError(::set_field_back(field,background)); - } - - // Retrieve the fields background attribute - inline chtype back() const { - return ::field_back(field); - } - - // Set the padding character for the field - inline void set_pad_character(int padding) { - OnError(::set_field_pad(field, padding)); - } - - // Retrieve the fields padding character - inline int pad() const { - return ::field_pad(field); - } - - // Switch on the fields options - inline void options_on (Field_Options opts) { - OnError (::field_opts_on (field, opts)); - } - - // Switch off the fields options - inline void options_off (Field_Options opts) { - OnError (::field_opts_off (field, opts)); - } - - // Retrieve the fields options - inline Field_Options options () const { - return ::field_opts (field); - } - - // Set the fields options - inline void set_options (Field_Options opts) { - OnError (::set_field_opts (field, opts)); - } - - // Mark the field as changed - inline void set_changed(bool changeFlag = TRUE) { - OnError(::set_field_status(field,changeFlag)); - } - - // Test whether or not the field is marked as changed - inline bool changed() const { - return ::field_status(field); - } - - // Return the index of the field in the field array of a form - // or -1 if the field is not associated to a form - inline int (index)() const { - return ::field_index(field); - } - - // Store a value in a fields buffer. The default buffer is nr. 0 - inline void set_value(const char *val, int buffer = 0) { - OnError(::set_field_buffer(field,buffer,val)); - } - - // Retrieve the value of a fields buffer. The default buffer is nr. 0 - inline char* value(int buffer = 0) const { - return ::field_buffer(field,buffer); - } - - // Set the validation type of the field. - inline void set_fieldtype(NCursesFieldType& f) { - ftype = &f; - f.set(*this); // A good friend may do that... - } - - // Retrieve the validation type of the field. - inline NCursesFieldType* fieldtype() const { - return ftype; - } - -}; - - // This are the built-in hook functions in this C++ binding. In C++ we use - // virtual member functions (see below On_..._Init and On_..._Termination) - // to provide this functionality in an object oriented manner. -extern "C" { - void _nc_xx_frm_init(FORM *); - void _nc_xx_frm_term(FORM *); - void _nc_xx_fld_init(FORM *); - void _nc_xx_fld_term(FORM *); -} - -// -// ------------------------------------------------------------------------- -// The class representing a form, wrapping the lowlevel FORM struct -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesForm : public NCursesPanel -{ -protected: - FORM* form; // the lowlevel structure - -private: - NCursesWindow* sub; // the subwindow object - bool b_sub_owner; // is this our own subwindow? - bool b_framed; // has the form a border? - bool b_autoDelete; // Delete fields when deleting form? - - NCursesFormField** my_fields; // The array of fields for this form - - // This structure is used for the form's user data field to link the - // FORM* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesForm* m_back; // backward pointer to C++ object - const FORM* m_owner; - } UserHook; - - // Get the backward pointer to the C++ object from a FORM - static inline NCursesForm* getHook(const FORM *f) { - UserHook* hook = reinterpret_cast(::form_userptr(f)); - assert(hook != 0 && hook->m_owner==f); - return const_cast(hook->m_back); - } - - friend void _nc_xx_frm_init(FORM *); - friend void _nc_xx_frm_term(FORM *); - friend void _nc_xx_fld_init(FORM *); - friend void _nc_xx_fld_term(FORM *); - - // Calculate FIELD* array for the menu - FIELD** mapFields(NCursesFormField* nfields[]); - -protected: - // internal routines - inline void set_user(void *user) { - UserHook* uptr = reinterpret_cast(::form_userptr (form)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); - uptr->m_user = user; - } - - inline void *get_user() { - UserHook* uptr = reinterpret_cast(::form_userptr (form)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); - return uptr->m_user; - } - - void InitForm (NCursesFormField* Fields[], - bool with_frame, - bool autoDeleteFields); - - inline void OnError (int err) const THROWS(NCursesFormException) { - if (err != E_OK) - THROW(new NCursesFormException (err)); - } - - // this wraps the form_driver call. - virtual int driver (int c) ; - - // 'Internal' constructor, builds an object without association to a - // field array. - NCursesForm( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(nlines, ncols, begin_y, begin_x), - form (STATIC_CAST(FORM*)(0)), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_fields(0) - { - } - -public: - // Create form for the default panel. - NCursesForm (NCursesFormField* Fields[], - bool with_frame=FALSE, // reserve space for a frame? - bool autoDelete_Fields=FALSE) // do automatic cleanup? - : NCursesPanel(), - form(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_fields(0) - { - InitForm(Fields, with_frame, autoDelete_Fields); - } - - // Create a form in a panel with the given position and size. - NCursesForm (NCursesFormField* Fields[], - int nlines, - int ncols, - int begin_y, - int begin_x, - bool with_frame=FALSE, // reserve space for a frame? - bool autoDelete_Fields=FALSE) // do automatic cleanup? - : NCursesPanel(nlines, ncols, begin_y, begin_x), - form(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_fields(0) - { - InitForm(Fields, with_frame, autoDelete_Fields); - } - - NCursesForm& operator=(const NCursesForm& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesPanel::operator=(rhs); - } - return *this; - } - - NCursesForm(const NCursesForm& rhs) - : NCursesPanel(rhs), - form(rhs.form), - sub(rhs.sub), - b_sub_owner(rhs.b_sub_owner), - b_framed(rhs.b_framed), - b_autoDelete(rhs.b_autoDelete), - my_fields(rhs.my_fields) - { - } - - virtual ~NCursesForm(); - - // Set the default attributes for the form - virtual void setDefaultAttributes(); - - // Retrieve current field of the form. - inline NCursesFormField* current_field() const { - return my_fields[::field_index(::current_field(form))]; - } - - // Set the forms subwindow - void setSubWindow(NCursesWindow& sub); - - // Set these fields for the form - inline void setFields(NCursesFormField* Fields[]) { - OnError(::set_form_fields(form,mapFields(Fields))); - } - - // Remove the form from the screen - inline void unpost (void) { - OnError (::unpost_form (form)); - } - - // Post the form to the screen if flag is true, unpost it otherwise - inline void post(bool flag = TRUE) { - OnError (flag ? ::post_form(form) : ::unpost_form (form)); - } - - // Decorations - inline void frame(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::frame(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void boldframe(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::boldframe(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void label(const char *topLabel, const char *bottomLabel) { - if (b_framed) - NCursesPanel::label(topLabel,bottomLabel); - else - OnError(E_SYSTEM_ERROR); - } - - // ----- - // Hooks - // ----- - - // Called after the form gets repositioned in its window. - // This is especially true if the form is posted. - virtual void On_Form_Init(); - - // Called before the form gets repositioned in its window. - // This is especially true if the form is unposted. - virtual void On_Form_Termination(); - - // Called after the field became the current field - virtual void On_Field_Init(NCursesFormField& field); - - // Called before this field is left as current field. - virtual void On_Field_Termination(NCursesFormField& field); - - // Calculate required window size for the form. - void scale(int& rows, int& ncols) const { - OnError(::scale_form(form,&rows,&ncols)); - } - - // Retrieve number of fields in the form. - int count() const { - return ::field_count(form); - } - - // Make the page the current page of the form. - void set_page(int pageNum) { - OnError(::set_form_page(form, pageNum)); - } - - // Retrieve current page number - int page() const { - return ::form_page(form); - } - - // Switch on the forms options - inline void options_on (Form_Options opts) { - OnError (::form_opts_on (form, opts)); - } - - // Switch off the forms options - inline void options_off (Form_Options opts) { - OnError (::form_opts_off (form, opts)); - } - - // Retrieve the forms options - inline Form_Options options () const { - return ::form_opts (form); - } - - // Set the forms options - inline void set_options (Form_Options opts) { - OnError (::set_form_opts (form, opts)); - } - - // Are there more data in the current field after the data shown - inline bool data_ahead() const { - return ::data_ahead(form); - } - - // Are there more data in the current field before the data shown - inline bool data_behind() const { - return ::data_behind(form); - } - - // Position the cursor to the current field - inline void position_cursor () { - OnError (::pos_form_cursor (form)); - } - // Set the current field - inline void set_current(NCursesFormField& F) { - OnError (::set_current_field(form, F.field)); - } - - // Provide a default key virtualization. Translate the keyboard - // code c into a form request code. - // The default implementation provides a hopefully straightforward - // mapping for the most common keystrokes and form requests. - virtual int virtualize(int c); - - // Operators - inline NCursesFormField* operator[](int i) const { - if ( (i < 0) || (i >= ::field_count (form)) ) - OnError (E_BAD_ARGUMENT); - return my_fields[i]; - } - - // Perform the menu's operation - // Return the field where you left the form. - virtual NCursesFormField* operator()(void); - - // Exception handlers. The default is a Beep. - virtual void On_Request_Denied(int c) const; - virtual void On_Invalid_Field(int c) const; - virtual void On_Unknown_Command(int c) const; - -}; - -// -// ------------------------------------------------------------------------- -// This is the typical C++ typesafe way to allow to attach -// user data to a field of a form. Its assumed that the user -// data belongs to some class T. Use T as template argument -// to create a UserField. -// ------------------------------------------------------------------------- -template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField -{ -public: - NCursesUserField (int rows, - int ncols, - int first_row = 0, - int first_col = 0, - const T* p_UserData = STATIC_CAST(T*)(0), - int offscreen_rows = 0, - int additional_buffers = 0) - : NCursesFormField (rows, ncols, - first_row, first_col, - offscreen_rows, additional_buffers) { - if (field) - OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData))); - } - - virtual ~NCursesUserField() {}; - - inline const T* UserData (void) const { - return reinterpret_cast(::field_userptr (field)); - } - - inline virtual void setUserData(const T* p_UserData) { - if (field) - OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData))); - } -}; -// -// ------------------------------------------------------------------------- -// The same mechanism is used to attach user data to a form -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm -{ -protected: - // 'Internal' constructor, builds an object without association to a - // field array. - NCursesUserForm( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesForm(nlines,ncols,begin_y,begin_x) { - if (form) - set_user (const_cast(p_UserData)); - } - -public: - NCursesUserForm (NCursesFormField Fields[], - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE, - bool autoDelete_Fields=FALSE) - : NCursesForm (Fields, with_frame, autoDelete_Fields) { - if (form) - set_user (const_cast(p_UserData)); - }; - - NCursesUserForm (NCursesFormField Fields[], - int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE, - bool autoDelete_Fields=FALSE) - : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, - with_frame, autoDelete_Fields) { - if (form) - set_user (const_cast(p_UserData)); - }; - - virtual ~NCursesUserForm() { - }; - - inline T* UserData (void) const { - return reinterpret_cast(get_user ()); - }; - - inline virtual void setUserData (const T* p_UserData) { - if (form) - set_user (const_cast(p_UserData)); - } - -}; -// -// ------------------------------------------------------------------------- -// Builtin Fieldtypes -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType -{ -private: - int min_field_width; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); - } - -public: - Alpha_Field(int width) - : NCursesFieldType(TYPE_ALPHA), - min_field_width(width) { - } -}; - -class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType -{ -private: - int min_field_width; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); - } - -public: - Alphanumeric_Field(int width) - : NCursesFieldType(TYPE_ALNUM), - min_field_width(width) { - } -}; - -class NCURSES_IMPEXP Integer_Field : public NCursesFieldType -{ -private: - int precision; - long lower_limit, upper_limit; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - precision,lower_limit,upper_limit)); - } - -public: - Integer_Field(int prec, long low=0L, long high=0L) - : NCursesFieldType(TYPE_INTEGER), - precision(prec), lower_limit(low), upper_limit(high) { - } -}; - -class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType -{ -private: - int precision; - double lower_limit, upper_limit; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - precision,lower_limit,upper_limit)); - } - -public: - Numeric_Field(int prec, double low=0.0, double high=0.0) - : NCursesFieldType(TYPE_NUMERIC), - precision(prec), lower_limit(low), upper_limit(high) { - } -}; - -class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType -{ -private: - char* regex; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,regex)); - } - - void copy_regex(const char *source) - { - regex = new char[1 + ::strlen(source)]; - (::strcpy)(regex, source); - } - -public: - Regular_Expression_Field(const char *expr) - : NCursesFieldType(TYPE_REGEXP), - regex(NULL) - { - copy_regex(expr); - } - - Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs) - { - if (this != &rhs) { - *this = rhs; - copy_regex(rhs.regex); - NCursesFieldType::operator=(rhs); - } - return *this; - } - - Regular_Expression_Field(const Regular_Expression_Field& rhs) - : NCursesFieldType(rhs), - regex(NULL) - { - copy_regex(rhs.regex); - } - - ~Regular_Expression_Field() { - delete[] regex; - } -}; - -class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType -{ -private: - const char** list; - int case_sensitive; - int non_unique_matches; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - list,case_sensitive,non_unique_matches)); - } -public: - Enumeration_Field(const char* enums[], - bool case_sens=FALSE, - bool non_unique=FALSE) - : NCursesFieldType(TYPE_ENUM), - list(enums), - case_sensitive(case_sens ? -1 : 0), - non_unique_matches(non_unique ? -1 : 0) { - } - - Enumeration_Field& operator=(const Enumeration_Field& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesFieldType::operator=(rhs); - } - return *this; - } - - Enumeration_Field(const Enumeration_Field& rhs) - : NCursesFieldType(rhs), - list(rhs.list), - case_sensitive(rhs.case_sensitive), - non_unique_matches(rhs.non_unique_matches) - { - } -}; - -class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType -{ -private: - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype)); - } - -public: - IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) { - } -}; - -extern "C" { - bool _nc_xx_fld_fcheck(FIELD *, const void*); - bool _nc_xx_fld_ccheck(int c, const void *); - void* _nc_xx_fld_makearg(va_list*); -} - -// -// ------------------------------------------------------------------------- -// Abstract base class for User-Defined Fieldtypes -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType -{ - friend class UDF_Init; // Internal helper to set up statics -private: - // For all C++ defined fieldtypes we need only one generic lowlevel - // FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype; - -protected: - // This are the functions required by the low level libforms functions - // to construct a fieldtype. - friend bool _nc_xx_fld_fcheck(FIELD *, const void*); - friend bool _nc_xx_fld_ccheck(int c, const void *); - friend void* _nc_xx_fld_makearg(va_list*); - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,&f)); - } - -protected: - // Redefine this function to do a field validation. The argument - // is a reference to the field you should validate. - virtual bool field_check(NCursesFormField& f) = 0; - - // Redefine this function to do a character validation. The argument - // is the character to be validated. - virtual bool char_check (int c) = 0; - -public: - UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) { - } -}; - -extern "C" { - bool _nc_xx_next_choice(FIELD*, const void *); - bool _nc_xx_prev_choice(FIELD*, const void *); -} - -// -// ------------------------------------------------------------------------- -// Abstract base class for User-Defined Fieldtypes with Choice functions -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType -{ - friend class UDF_Init; // Internal helper to set up statics -private: - // For all C++ defined fieldtypes with choice functions we need only one - // generic lowlevel FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype_with_choice; - - // This are the functions required by the low level libforms functions - // to construct a fieldtype with choice functions. - friend bool _nc_xx_next_choice(FIELD*, const void *); - friend bool _nc_xx_prev_choice(FIELD*, const void *); - -protected: - // Redefine this function to do the retrieval of the next choice value. - // The argument is a reference to the field tobe examined. - virtual bool next (NCursesFormField& f) = 0; - - // Redefine this function to do the retrieval of the previous choice value. - // The argument is a reference to the field tobe examined. - virtual bool previous(NCursesFormField& f) = 0; - -public: - UserDefinedFieldType_With_Choice() { - fieldtype = generic_fieldtype_with_choice; - } -}; - -#endif /* NCURSES_CURSESF_H_incl */ diff --git a/c++/cursesm.cc b/c++/cursesm.cc deleted file mode 100644 index c253a679990..00000000000 --- a/c++/cursesm.cc +++ /dev/null @@ -1,407 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesm.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursesm.cc,v 1.22 2005/04/02 20:39:05 tom Exp $") - -NCursesMenuItem::~NCursesMenuItem() -{ - if (item) - OnError(::free_item(item)); -} - -bool -NCursesMenuItem::action() -{ - return FALSE; -} - -NCursesMenuCallbackItem::~NCursesMenuCallbackItem() -{ -} - -bool -NCursesMenuCallbackItem::action() -{ - if (p_fct) - return p_fct (*this); - else - return FALSE; -} - -/* Internal hook functions. They will route the hook - * calls to virtual methods of the NCursesMenu class, - * so in C++ providing a hook is done simply by - * implementing a virtual method in a derived class - */ -void -_nc_xx_mnu_init(MENU *m) -{ - NCursesMenu::getHook(m)->On_Menu_Init(); -} - -void -_nc_xx_mnu_term(MENU *m) -{ - NCursesMenu::getHook(m)->On_Menu_Termination(); -} - -void -_nc_xx_itm_init(MENU *m) -{ - NCursesMenu* M = NCursesMenu::getHook(m); - M->On_Item_Init (*(M->current_item ())); -} - -void -_nc_xx_itm_term(MENU *m) -{ - NCursesMenu* M = NCursesMenu::getHook(m); - M->On_Item_Termination (*(M->current_item ())); -} - -/* Construct an ITEM* array from an array of NCursesMenuItem - * objects. - */ -ITEM** -NCursesMenu::mapItems(NCursesMenuItem* nitems[]) -{ - int itemCount = 0,lcv; - - for (lcv=0; nitems[lcv]->item; ++lcv) - ++itemCount; - - ITEM** itemArray = new ITEM*[itemCount + 1]; - - for (lcv=0;nitems[lcv]->item;++lcv) { - itemArray[lcv] = nitems[lcv]->item; - } - itemArray[lcv] = NULL; - - my_items = nitems; - - if (menu) - delete[] ::menu_items(menu); - return itemArray; -} - -void -NCursesMenu::InitMenu(NCursesMenuItem* nitems[], - bool with_frame, - bool autoDelete_Items) -{ - int mrows, mcols; - - keypad(TRUE); - meta(TRUE); - - b_framed = with_frame; - b_autoDelete = autoDelete_Items; - - menu = static_cast(0); - menu = ::new_menu(mapItems(nitems)); - if (!menu) - OnError (E_SYSTEM_ERROR); - - UserHook* hook = new UserHook; - hook->m_user = NULL; - hook->m_back = this; - hook->m_owner = menu; - ::set_menu_userptr(menu, static_cast(hook)); - - ::set_menu_init (menu, _nc_xx_mnu_init); - ::set_menu_term (menu, _nc_xx_mnu_term); - ::set_item_init (menu, _nc_xx_itm_init); - ::set_item_term (menu, _nc_xx_itm_term); - - scale(mrows, mcols); - ::set_menu_win(menu, w); - - if (with_frame) { - if ((mrows > height()-2) || (mcols > width()-2)) - OnError(E_NO_ROOM); - sub = new NCursesWindow(*this,mrows,mcols,1,1,'r'); - ::set_menu_sub(menu, sub->w); - b_sub_owner = TRUE; - } - else { - sub = static_cast(0); - b_sub_owner = FALSE; - } - setDefaultAttributes(); -} - -void -NCursesMenu::setDefaultAttributes() -{ - NCursesApplication* S = NCursesApplication::getApplication(); - if (S) { - ::set_menu_fore(menu, S->foregrounds()); - ::set_menu_back(menu, S->backgrounds()); - ::set_menu_grey(menu, S->inactives()); - } -} - -NCursesMenu::~NCursesMenu() -{ - UserHook* hook = reinterpret_cast(::menu_userptr(menu)); - delete hook; - if (b_sub_owner) { - delete sub; - ::set_menu_sub(menu, static_cast(0)); - } - if (menu) { - ITEM** itms = ::menu_items(menu); - int cnt = count(); - - OnError(::set_menu_items(menu, static_cast(0))); - - if (b_autoDelete) { - if (cnt>0) { - for (int i=0; i <= cnt; i++) - delete my_items[i]; - } - delete[] my_items; - } - - ::free_menu(menu); - // It's essential to do this after free_menu() - delete[] itms; - } -} - -void -NCursesMenu::setSubWindow(NCursesWindow& nsub) -{ - if (!isDescendant(nsub)) - OnError(E_SYSTEM_ERROR); - else { - if (b_sub_owner) - delete sub; - sub = ⊄ - ::set_menu_sub(menu,sub->w); - } -} - -bool -NCursesMenu::set_pattern (const char *pat) -{ - int res = ::set_menu_pattern (menu, pat); - switch(res) { - case E_OK: - break; - case E_NO_MATCH: - return FALSE; - default: - OnError (res); - } - return TRUE; -} - -// call the menu driver and do basic error checking. -int -NCursesMenu::driver (int c) -{ - int res = ::menu_driver (menu, c); - switch (res) { - case E_OK: - case E_REQUEST_DENIED: - case E_NOT_SELECTABLE: - case E_UNKNOWN_COMMAND: - case E_NO_MATCH: - break; - default: - OnError (res); - } - return (res); -} - -static const int CMD_QUIT = MAX_COMMAND + 1; -static const int CMD_ACTION = MAX_COMMAND + 2; -// -// ------------------------------------------------------------------------- -// Provide a default key virtualization. Translate the keyboard -// code c into a menu request code. -// The default implementation provides a hopefully straightforward -// mapping for the most common keystrokes and menu requests. -// ------------------------------------------------------------------------- -int -NCursesMenu::virtualize(int c) -{ - switch(c) { - case CTRL('X') : return(CMD_QUIT); // eXit - - case KEY_DOWN : return(REQ_DOWN_ITEM); - case CTRL('N') : return(REQ_NEXT_ITEM); // Next - case KEY_UP : return(REQ_UP_ITEM); - case CTRL('P') : return(REQ_PREV_ITEM); // Previous - - case CTRL('U') : return(REQ_SCR_ULINE); // Up - case CTRL('D') : return(REQ_SCR_DLINE); // Down - case CTRL('F') : return(REQ_SCR_DPAGE); // Forward - case CTRL('B') : return(REQ_SCR_UPAGE); // Backward - - case CTRL('Y') : return(REQ_CLEAR_PATTERN); - case CTRL('H') : return(REQ_BACK_PATTERN); - case CTRL('A') : return(REQ_NEXT_MATCH); - case CTRL('E') : return(REQ_PREV_MATCH); - case CTRL('T') : return(REQ_TOGGLE_ITEM); - - case CTRL('J') : - case CTRL('M') : return(CMD_ACTION); - - case KEY_HOME : return(REQ_FIRST_ITEM); - case KEY_LEFT : return(REQ_LEFT_ITEM); - case KEY_RIGHT : return(REQ_RIGHT_ITEM); - case KEY_END : return(REQ_LAST_ITEM); - case KEY_BACKSPACE : return(REQ_BACK_PATTERN); - case KEY_NPAGE : return(REQ_SCR_DPAGE); - case KEY_PPAGE : return(REQ_SCR_UPAGE); - - default: - return(c); - } -} - -NCursesMenuItem* -NCursesMenu::operator()(void) -{ - int drvCmnd; - int err; - int c; - bool b_action = FALSE; - - post(); - show(); - refresh(); - - while (!b_action && ((drvCmnd = virtualize((c=getKey()))) != CMD_QUIT)) { - - switch((err=driver(drvCmnd))) { - case E_REQUEST_DENIED: - On_Request_Denied(c); - break; - case E_NOT_SELECTABLE: - On_Not_Selectable(c); - break; - case E_UNKNOWN_COMMAND: - if (drvCmnd == CMD_ACTION) { - if (options() & O_ONEVALUE) { - NCursesMenuItem* itm = current_item(); - assert(itm != 0); - if (itm->options() & O_SELECTABLE) - { - b_action = itm->action(); - refresh(); - } - else - On_Not_Selectable(c); - } - else { - int n = count(); - for(int i=0; ivalue()) { - b_action |= itm->action(); - refresh(); - } - } - } - } else - On_Unknown_Command(c); - break; - case E_NO_MATCH: - On_No_Match(c); - break; - case E_OK: - break; - default: - OnError(err); - } - } - - unpost(); - hide(); - refresh(); - if (options() & O_ONEVALUE) - return my_items[::item_index (::current_item (menu))]; - else - return NULL; -} - -void -NCursesMenu::On_Menu_Init() -{ -} - -void -NCursesMenu::On_Menu_Termination() -{ -} - -void -NCursesMenu::On_Item_Init(NCursesMenuItem& item) -{ -} - -void -NCursesMenu::On_Item_Termination(NCursesMenuItem& item) -{ -} - -void -NCursesMenu::On_Request_Denied(int c) const -{ - ::beep(); -} - -void -NCursesMenu::On_Not_Selectable(int c) const -{ - ::beep(); -} - -void -NCursesMenu::On_No_Match(int c) const -{ - ::beep(); -} - -void -NCursesMenu::On_Unknown_Command(int c) const -{ - ::beep(); -} diff --git a/c++/cursesm.h b/c++/cursesm.h deleted file mode 100644 index d9c2273e6f6..00000000000 --- a/c++/cursesm.h +++ /dev/null @@ -1,672 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesm.h,v 1.25 2005/08/13 18:10:36 tom Exp $ - -#ifndef NCURSES_CURSESM_H_incl -#define NCURSES_CURSESM_H_incl 1 - -#include - -extern "C" { -# include -} -// -// ------------------------------------------------------------------------- -// This wraps the ITEM type of -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesMenuItem -{ - friend class NCursesMenu; - -protected: - ITEM *item; - - inline void OnError (int err) const THROWS(NCursesMenuException) { - if (err != E_OK) - THROW(new NCursesMenuException (err)); - } - -public: - NCursesMenuItem (const char* p_name = NULL, - const char* p_descript = NULL) - : item(0) - { - item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0); - if (p_name && !item) - OnError (E_SYSTEM_ERROR); - } - // Create an item. If you pass both parameters as NULL, a delimiting - // item is constructed which can be used to terminate a list of - // NCursesMenu objects. - - NCursesMenuItem& operator=(const NCursesMenuItem& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesMenuItem(const NCursesMenuItem& rhs) - : item(0) - { - } - - virtual ~NCursesMenuItem (); - // Release the items memory - - inline const char* name () const { - return ::item_name (item); - } - // Name of the item - - inline const char* description () const { - return ::item_description (item); - } - // Description of the item - - inline int (index) (void) const { - return ::item_index (item); - } - // Index of the item in an item array (or -1) - - inline void options_on (Item_Options opts) { - OnError (::item_opts_on (item, opts)); - } - // Switch on the items options - - inline void options_off (Item_Options opts) { - OnError (::item_opts_off (item, opts)); - } - // Switch off the item's option - - inline Item_Options options () const { - return ::item_opts (item); - } - // Retrieve the items options - - inline void set_options (Item_Options opts) { - OnError (::set_item_opts (item, opts)); - } - // Set the items options - - inline void set_value (bool f) { - OnError (::set_item_value (item,f)); - } - // Set/Reset the items selection state - - inline bool value () const { - return ::item_value (item); - } - // Retrieve the items selection state - - inline bool visible () const { - return ::item_visible (item); - } - // Retrieve visibility of the item - - virtual bool action(); - // Perform an action associated with this item; you may use this in an - // user supplied driver for a menu; you may derive from this class and - // overload action() to supply items with different actions. - // If an action returns true, the menu will be exited. The default action - // is to do nothing. -}; - -// Prototype for an items callback function. -typedef bool ITEMCALLBACK(NCursesMenuItem&); - -// If you don't like to create a child class for individual items to -// overload action(), you may use this class and provide a callback -// function pointer for items. -class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem -{ -private: - ITEMCALLBACK* p_fct; - -public: - NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, - const char* p_name = NULL, - const char* p_descript = NULL ) - : NCursesMenuItem (p_name, p_descript), - p_fct (fct) { - } - - NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs) - : NCursesMenuItem(rhs), - p_fct(0) - { - } - - virtual ~NCursesMenuCallbackItem(); - - bool action(); -}; - - // This are the built-in hook functions in this C++ binding. In C++ we use - // virtual member functions (see below On_..._Init and On_..._Termination) - // to provide this functionality in an object oriented manner. -extern "C" { - void _nc_xx_mnu_init(MENU *); - void _nc_xx_mnu_term(MENU *); - void _nc_xx_itm_init(MENU *); - void _nc_xx_itm_term(MENU *); -} - -// -// ------------------------------------------------------------------------- -// This wraps the MENU type of -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesMenu : public NCursesPanel -{ -protected: - MENU *menu; - -private: - NCursesWindow* sub; // the subwindow object - bool b_sub_owner; // is this our own subwindow? - bool b_framed; // has the menu a border? - bool b_autoDelete; // Delete items when deleting menu? - - NCursesMenuItem** my_items; // The array of items for this menu - - // This structure is used for the menu's user data field to link the - // MENU* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesMenu* m_back; // backward pointer to C++ object - const MENU* m_owner; - } UserHook; - - // Get the backward pointer to the C++ object from a MENU - static inline NCursesMenu* getHook(const MENU *m) { - UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m)); - assert(hook != 0 && hook->m_owner==m); - return const_cast(hook->m_back); - } - - friend void _nc_xx_mnu_init(MENU *); - friend void _nc_xx_mnu_term(MENU *); - friend void _nc_xx_itm_init(MENU *); - friend void _nc_xx_itm_term(MENU *); - - // Calculate ITEM* array for the menu - ITEM** mapItems(NCursesMenuItem* nitems[]); - -protected: - // internal routines - inline void set_user(void *user) { - UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); - uptr->m_user = user; - } - - inline void *get_user() { - UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); - return uptr->m_user; - } - - void InitMenu (NCursesMenuItem* menu[], - bool with_frame, - bool autoDeleteItems); - - inline void OnError (int err) const THROWS(NCursesMenuException) { - if (err != E_OK) - THROW(new NCursesMenuException (this, err)); - } - - // this wraps the menu_driver call. - virtual int driver (int c) ; - - // 'Internal' constructor to create a menu without association to - // an array of items. - NCursesMenu( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(nlines,ncols,begin_y,begin_x), - menu (STATIC_CAST(MENU*)(0)), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_items(0) - { - } - -public: - // Make a full window size menu - NCursesMenu (NCursesMenuItem* Items[], - bool with_frame=FALSE, // Reserve space for a frame? - bool autoDelete_Items=FALSE) // Autocleanup of Items? - : NCursesPanel(), - menu(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_items(0) - { - InitMenu(Items, with_frame, autoDelete_Items); - } - - // Make a menu with a window of this size. - NCursesMenu (NCursesMenuItem* Items[], - int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - bool with_frame=FALSE, // Reserve space for a frame? - bool autoDelete_Items=FALSE) // Autocleanup of Items? - : NCursesPanel(nlines, ncols, begin_y, begin_x), - menu(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_items(0) - { - InitMenu(Items, with_frame, autoDelete_Items); - } - - NCursesMenu& operator=(const NCursesMenu& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesPanel::operator=(rhs); - } - return *this; - } - - NCursesMenu(const NCursesMenu& rhs) - : NCursesPanel(rhs), - menu(rhs.menu), - sub(rhs.sub), - b_sub_owner(rhs.b_sub_owner), - b_framed(rhs.b_framed), - b_autoDelete(rhs.b_autoDelete), - my_items(rhs.my_items) - { - } - - virtual ~NCursesMenu (); - - // Retrieve the menus subwindow - inline NCursesWindow& subWindow() const { - assert(sub!=NULL); - return *sub; - } - - // Set the menus subwindow - void setSubWindow(NCursesWindow& sub); - - // Set these items for the menu - inline void setItems(NCursesMenuItem* Items[]) { - OnError(::set_menu_items(menu,mapItems(Items))); - } - - // Remove the menu from the screen - inline void unpost (void) { - OnError (::unpost_menu (menu)); - } - - // Post the menu to the screen if flag is true, unpost it otherwise - inline void post(bool flag = TRUE) { - flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu)); - } - - // Get the numer of rows and columns for this menu - inline void scale (int& mrows, int& mcols) const { - OnError (::scale_menu (menu, &mrows, &mcols)); - } - - // Set the format of this menu - inline void set_format(int mrows, int mcols) { - OnError (::set_menu_format(menu, mrows, mcols)); - } - - // Get the format of this menu - inline void menu_format(int& rows,int& ncols) { - ::menu_format(menu,&rows,&ncols); - } - - // Items of the menu - inline NCursesMenuItem* items() const { - return *my_items; - } - - // Get the number of items in this menu - inline int count() const { - return ::item_count(menu); - } - - // Get the current item (i.e. the one the cursor is located) - inline NCursesMenuItem* current_item() const { - return my_items[::item_index(::current_item(menu))]; - } - - // Get the marker string - inline const char* mark() const { - return ::menu_mark(menu); - } - - // Set the marker string - inline void set_mark(const char *marker) { - OnError (::set_menu_mark (menu, marker)); - } - - // Get the name of the request code c - inline static const char* request_name(int c) { - return ::menu_request_name(c); - } - - // Get the current pattern - inline char* pattern() const { - return ::menu_pattern(menu); - } - - // true if there is a pattern match, false otherwise. - bool set_pattern (const char *pat); - - // set the default attributes for the menu - // i.e. set fore, back and grey attribute - virtual void setDefaultAttributes(); - - // Get the menus background attributes - inline chtype back() const { - return ::menu_back(menu); - } - - // Get the menus foreground attributes - inline chtype fore() const { - return ::menu_fore(menu); - } - - // Get the menus grey attributes (used for unselectable items) - inline chtype grey() const { - return ::menu_grey(menu); - } - - // Set the menus background attributes - inline chtype set_background(chtype a) { - return ::set_menu_back(menu,a); - } - - // Set the menus foreground attributes - inline chtype set_foreground(chtype a) { - return ::set_menu_fore(menu,a); - } - - // Set the menus grey attributes (used for unselectable items) - inline chtype set_grey(chtype a) { - return ::set_menu_grey(menu,a); - } - - inline void options_on (Menu_Options opts) { - OnError (::menu_opts_on (menu,opts)); - } - - inline void options_off(Menu_Options opts) { - OnError (::menu_opts_off(menu,opts)); - } - - inline Menu_Options options() const { - return ::menu_opts(menu); - } - - inline void set_options (Menu_Options opts) { - OnError (::set_menu_opts (menu,opts)); - } - - inline int pad() const { - return ::menu_pad(menu); - } - - inline void set_pad (int padch) { - OnError (::set_menu_pad (menu, padch)); - } - - // Position the cursor to the current item - inline void position_cursor () const { - OnError (::pos_menu_cursor (menu)); - } - - // Set the current item - inline void set_current(NCursesMenuItem& I) { - OnError (::set_current_item(menu, I.item)); - } - - // Get the current top row of the menu - inline int top_row (void) const { - return ::top_row (menu); - } - - // Set the current top row of the menu - inline void set_top_row (int row) { - OnError (::set_top_row (menu, row)); - } - - // spacing control - // Set the spacing for the menu - inline void setSpacing(int spc_description, - int spc_rows, - int spc_columns) { - OnError(::set_menu_spacing(menu, - spc_description, - spc_rows, - spc_columns)); - } - - // Get the spacing info for the menu - inline void Spacing(int& spc_description, - int& spc_rows, - int& spc_columns) const { - OnError(::menu_spacing(menu, - &spc_description, - &spc_rows, - &spc_columns)); - } - - // Decorations - inline void frame(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::frame(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void boldframe(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::boldframe(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void label(const char *topLabel, const char *bottomLabel) { - if (b_framed) - NCursesPanel::label(topLabel,bottomLabel); - else - OnError(E_SYSTEM_ERROR); - } - - // ----- - // Hooks - // ----- - - // Called after the menu gets repositioned in its window. - // This is especially true if the menu is posted. - virtual void On_Menu_Init(); - - // Called before the menu gets repositioned in its window. - // This is especially true if the menu is unposted. - virtual void On_Menu_Termination(); - - // Called after the item became the current item - virtual void On_Item_Init(NCursesMenuItem& item); - - // Called before this item is left as current item. - virtual void On_Item_Termination(NCursesMenuItem& item); - - // Provide a default key virtualization. Translate the keyboard - // code c into a menu request code. - // The default implementation provides a hopefully straightforward - // mapping for the most common keystrokes and menu requests. - virtual int virtualize(int c); - - - // Operators - inline NCursesMenuItem* operator[](int i) const { - if ( (i < 0) || (i >= ::item_count (menu)) ) - OnError (E_BAD_ARGUMENT); - return (my_items[i]); - } - - // Perform the menu's operation - // Return the item where you left the selection mark for a single - // selection menu, or NULL for a multivalued menu. - virtual NCursesMenuItem* operator()(void); - - // -------------------- - // Exception handlers - // Called by operator() - // -------------------- - - // Called if the request is denied - virtual void On_Request_Denied(int c) const; - - // Called if the item is not selectable - virtual void On_Not_Selectable(int c) const; - - // Called if pattern doesn't match - virtual void On_No_Match(int c) const; - - // Called if the command is unknown - virtual void On_Unknown_Command(int c) const; - -}; -// -// ------------------------------------------------------------------------- -// This is the typical C++ typesafe way to allow to attach -// user data to an item of a menu. Its assumed that the user -// data belongs to some class T. Use T as template argument -// to create a UserItem. -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem -{ -public: - NCursesUserItem (const char* p_name, - const char* p_descript = NULL, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesMenuItem (p_name, p_descript) { - if (item) - OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); - } - - virtual ~NCursesUserItem() {} - - inline const T* UserData (void) const { - return reinterpret_cast(::item_userptr (item)); - }; - - inline virtual void setUserData(const T* p_UserData) { - if (item) - OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); - } -}; -// -// ------------------------------------------------------------------------- -// The same mechanism is used to attach user data to a menu -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu -{ -protected: - NCursesUserMenu( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesMenu(nlines,ncols,begin_y,begin_x) { - if (menu) - set_user (const_cast(p_UserData)); - } - -public: - NCursesUserMenu (NCursesMenuItem Items[], - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE, - bool autoDelete_Items=FALSE) - : NCursesMenu (Items, with_frame, autoDelete_Items) { - if (menu) - set_user (const_cast(p_UserData)); - }; - - NCursesUserMenu (NCursesMenuItem Items[], - int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE) - : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { - if (menu) - set_user (const_cast(p_UserData)); - }; - - virtual ~NCursesUserMenu() { - }; - - inline T* UserData (void) const { - return reinterpret_cast(get_user ()); - }; - - inline virtual void setUserData (const T* p_UserData) { - if (menu) - set_user (const_cast(p_UserData)); - } -}; - -#endif /* NCURSES_CURSESM_H_incl */ diff --git a/c++/cursesmain.cc b/c++/cursesmain.cc deleted file mode 100644 index 1f82d4ad84c..00000000000 --- a/c++/cursesmain.cc +++ /dev/null @@ -1,93 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), 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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesapp.h" - -#if CPP_HAS_TRY_CATCH && HAVE_IOSTREAM -#include -#else -#undef CPP_HAS_TRY_CATCH -#define CPP_HAS_TRY_CATCH 0 -#endif - -MODULE_ID("$Id: cursesmain.cc,v 1.14 2007/04/07 17:10:11 tom Exp $") - -#if HAVE_LOCALE_H -#include -#else -#define setlocale(name,string) /* nothing */ -#endif - -#if NO_LEAKS -#include -#endif - -/* This is the default implementation of main() for a NCursesApplication. - * You only have to instantiate a static NCursesApplication object in your - * main application source file and link this module with your application. - */ -int main(int argc, char* argv[]) -{ - setlocale(LC_ALL, ""); - - NCursesApplication* A = NCursesApplication::getApplication(); - if (!A) - return(1); - else { - int res; - - A->handleArgs(argc,argv); - ::endwin(); -#if CPP_HAS_TRY_CATCH - try { - res = (*A)(); - ::endwin(); - } - catch(const NCursesException &e) { - ::endwin(); - std::cerr << e.message << std::endl; - res = e.errorno; - } -#else - res = (*A)(); - ::endwin(); -#endif -#if NO_LEAKS - delete A; - _nc_free_and_exit(res); -#else - return(res); -#endif - } -} diff --git a/c++/cursesp.cc b/c++/cursesp.cc deleted file mode 100644 index 9c4eab6954e..00000000000 --- a/c++/cursesp.cc +++ /dev/null @@ -1,138 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1993, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursesp.h" - -MODULE_ID("$Id: cursesp.cc,v 1.25 2005/08/06 22:12:36 tom Exp $") - -NCursesPanel* NCursesPanel::dummy = static_cast(0); - -void NCursesPanel::init() -{ - p = ::new_panel(w); - if (!p) - OnError(ERR); - - UserHook* hook = new UserHook; - hook->m_user = NULL; - hook->m_back = this; - hook->m_owner = p; - ::set_panel_userptr(p, reinterpret_cast(hook)); -} - -NCursesPanel::~NCursesPanel() -{ - UserHook* hook = UserPointer(); - assert(hook != 0 && hook->m_back==this && hook->m_owner==p); - delete hook; - ::del_panel(p); - ::update_panels(); -} - -void -NCursesPanel::redraw() -{ - PANEL *pan; - - pan = ::panel_above(NULL); - while (pan) { - ::touchwin(panel_window(pan)); - pan = ::panel_above(pan); - } - ::update_panels(); - ::doupdate(); -} - -int -NCursesPanel::refresh() -{ - ::update_panels(); - return ::doupdate(); -} - -int -NCursesPanel::noutrefresh() -{ - ::update_panels(); - return OK; -} - -void -NCursesPanel::boldframe(const char *title, const char* btitle) -{ - standout(); - frame(title, btitle); - standend(); -} - -void -NCursesPanel::frame(const char *title,const char *btitle) -{ - int err = OK; - if (!title && !btitle) { - err = box(); - } - else { - err = box(); - if (err==OK) - label(title,btitle); - } - OnError(err); -} - -void -NCursesPanel::label(const char *tLabel, const char *bLabel) -{ - if (tLabel) - centertext(0,tLabel); - if (bLabel) - centertext(maxy(),bLabel); -} - -void -NCursesPanel::centertext(int row,const char *labelText) -{ - if (labelText) { - int x = (maxx() - ::strlen(labelText)) / 2; - if (x<0) - x=0; - OnError(addstr(row, x, labelText, width())); - } -} - -int -NCursesPanel::getKey(void) -{ - return getch(); -} diff --git a/c++/cursesp.h b/c++/cursesp.h deleted file mode 100644 index 9b63d6d671b..00000000000 --- a/c++/cursesp.h +++ /dev/null @@ -1,268 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#ifndef NCURSES_CURSESP_H_incl -#define NCURSES_CURSESP_H_incl 1 - -// $Id: cursesp.h,v 1.29 2008/08/16 17:20:23 tom Exp $ - -#include - -extern "C" { -# include -} - -class NCURSES_IMPEXP NCursesPanel - : public NCursesWindow -{ -protected: - PANEL *p; - static NCursesPanel *dummy; - -private: - // This structure is used for the panel's user data field to link the - // PANEL* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesPanel* m_back; // backward pointer to C++ object - const PANEL* m_owner; // the panel itself - } UserHook; - - inline UserHook *UserPointer() - { - UserHook* uptr = reinterpret_cast( - const_cast(::panel_userptr (p))); - return uptr; - } - - void init(); // Initialize the panel object - -protected: - void set_user(void *user) - { - UserHook* uptr = UserPointer(); - if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) { - uptr->m_user = user; - } - } - // Set the user pointer of the panel. - - void *get_user() - { - UserHook* uptr = UserPointer(); - void *result = 0; - if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) - result = uptr->m_user; - return result; - } - - void OnError (int err) const THROWS(NCursesPanelException) - { - if (err==ERR) - THROW(new NCursesPanelException (this, err)); - } - // If err is equal to the curses error indicator ERR, an error handler - // is called. - - // Get a keystroke. Default implementation calls getch() - virtual int getKey(void); - -public: - NCursesPanel(int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0) - : NCursesWindow(nlines,ncols,begin_y,begin_x), p(0) - { - init(); - } - // Create a panel with this size starting at the requested position. - - NCursesPanel() - : NCursesWindow(::stdscr), p(0) - { - init(); - } - // This constructor creates the default Panel associated with the - // ::stdscr window - - NCursesPanel& operator=(const NCursesPanel& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesWindow::operator=(rhs); - } - return *this; - } - - NCursesPanel(const NCursesPanel& rhs) - : NCursesWindow(rhs), - p(rhs.p) - { - } - - virtual ~NCursesPanel(); - - // basic manipulation - inline void hide() - { - OnError (::hide_panel(p)); - } - // Hide the panel. It stays in the stack but becomes invisible. - - inline void show() - { - OnError (::show_panel(p)); - } - // Show the panel, i.e. make it visible. - - inline void top() - { - OnError (::top_panel(p)); - } - // Make this panel the top panel in the stack. - - inline void bottom() - { - OnError (::bottom_panel(p)); - } - // Make this panel the bottom panel in the stack. - // N.B.: The panel associated with ::stdscr is always on the bottom. So - // actually bottom() makes the panel the first above ::stdscr. - - virtual int mvwin(int y, int x) - { - OnError(::move_panel(p, y, x)); - return OK; - } - - inline bool hidden() const - { - return (::panel_hidden (p) ? TRUE : FALSE); - } - // Return TRUE if the panel is hidden, FALSE otherwise. - -/* The functions panel_above() and panel_below() are not reflected in - the NCursesPanel class. The reason for this is, that we cannot - assume that a panel retrieved by those operations is one wrapped - by a C++ class. Although this situation might be handled, we also - need a reverse mapping from PANEL to NCursesPanel which needs some - redesign of the low level stuff. At the moment, we define them in the - interface but they will always produce an error. */ - inline NCursesPanel& above() const - { - OnError(ERR); - return *dummy; - } - - inline NCursesPanel& below() const - { - OnError(ERR); - return *dummy; - } - - // Those two are rewrites of the corresponding virtual members of - // NCursesWindow - virtual int refresh(); - // Propagate all panel changes to the virtual screen and update the - // physical screen. - - virtual int noutrefresh(); - // Propagate all panel changes to the virtual screen. - - static void redraw(); - // Redraw all panels. - - // decorations - virtual void frame(const char* title=NULL, - const char* btitle=NULL); - // Put a frame around the panel and put the title centered in the top line - // and btitle in the bottom line. - - virtual void boldframe(const char* title=NULL, - const char* btitle=NULL); - // Same as frame(), but use highlighted attributes. - - virtual void label(const char* topLabel, - const char* bottomLabel); - // Put the title centered in the top line and btitle in the bottom line. - - virtual void centertext(int row,const char* label); - // Put the label text centered in the specified row. -}; - -/* We use templates to provide a typesafe mechanism to associate - * user data with a panel. A NCursesUserPanel is a panel - * associated with some user data of type T. - */ -template class NCursesUserPanel : public NCursesPanel -{ -public: - NCursesUserPanel (int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesPanel (nlines, ncols, begin_y, begin_x) - { - if (p) - set_user (const_cast(p_UserData)); - }; - // This creates an user panel of the requested size with associated - // user data pointed to by p_UserData. - - NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel() - { - if (p) - set_user(const_cast(p_UserData)); - }; - // This creates an user panel associated with the ::stdscr and user data - // pointed to by p_UserData. - - virtual ~NCursesUserPanel() {}; - - T* UserData (void) const - { - return reinterpret_cast(get_user ()); - }; - // Retrieve the user data associated with the panel. - - virtual void setUserData (const T* p_UserData) - { - if (p) - set_user (const_cast(p_UserData)); - } - // Associate the user panel with the user data pointed to by p_UserData. -}; - -#endif /* NCURSES_CURSESP_H_incl */ diff --git a/c++/cursespad.cc b/c++/cursespad.cc deleted file mode 100644 index 28c58fab36a..00000000000 --- a/c++/cursespad.cc +++ /dev/null @@ -1,279 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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: Juergen Pfeifer, 1999 * - ****************************************************************************/ - -#include "internal.h" - -#include -#include - -MODULE_ID("$Id: cursespad.cc,v 1.13 2008/08/04 18:59:22 tom Exp $") - -NCursesPad::NCursesPad(int nlines, int ncols) - : NCursesWindow(), - viewWin(static_cast(0)), - viewSub(static_cast(0)), - h_gridsize(0), v_gridsize(0), - min_row(0), min_col(0) -{ - w = ::newpad(nlines, ncols); - if (static_cast(0) == w) { - count--; - err_handler("Cannot construct window"); - } - alloced = TRUE; -} - - -int NCursesPad::driver (int key) -{ - // Default implementation - switch(key) { - case KEY_UP: - // ======= - return REQ_PAD_UP; - case KEY_DOWN: - // ========= - return REQ_PAD_DOWN; - case KEY_LEFT: - // ========= - return REQ_PAD_LEFT; - case KEY_RIGHT: - // ========== - return REQ_PAD_RIGHT; - case KEY_EXIT: - // ========= - case CTRL('X'): - // ========== - return REQ_PAD_EXIT; - - default: return(key); - } -} - - -void NCursesPad::operator()(void) -{ - NCursesWindow* W = Win(); - - if (static_cast(0) != W) { - int Width = W->width(); - int Height = W->height(); - - int req = REQ_PAD_REFRESH; - - W->keypad(TRUE); - W->meta(TRUE); - refresh(); - - do { - bool changed = FALSE; - - switch (req) { - case REQ_PAD_REFRESH: - // ================ - changed = TRUE; - break; - case REQ_PAD_LEFT: - // ============= - if (min_col > 0) { - changed = TRUE; - if (min_col < h_gridsize) - min_col = 0; - else - min_col -= h_gridsize; - } - else - OnNavigationError(req); - break; - case REQ_PAD_RIGHT: - // ============== - if (min_col < (width() - Width - 1)) { - changed = TRUE; - if (min_col > (width() - Width - h_gridsize - 1)) - min_col = width() - Width - 1; - else - min_col += h_gridsize; - } - else - OnNavigationError(req); - break; - case REQ_PAD_UP: - // =========== - if (min_row > 0) { - changed = TRUE; - if (min_row < v_gridsize) - min_row = 0; - else - min_row -= v_gridsize; - } - else - OnNavigationError(req); - break; - case REQ_PAD_DOWN: - // ============= - if (min_row < (height() - Height - 1)) { - changed = TRUE; - if (min_row > (height() - Height - v_gridsize - 1)) - min_row = height() - Height - 1; - else - min_row += v_gridsize; - } - else - OnNavigationError(req); - break; - - default: - OnUnknownOperation(req); - } - - if (changed) { - noutrefresh(); - W->syncup(); - OnOperation(req); - viewWin->refresh(); - } - } while( (req=driver(W->getch())) != REQ_PAD_EXIT ); - } -} - - -int NCursesPad::refresh() -{ - int res = noutrefresh(); - if (res==OK && (static_cast(0) != viewWin)) { - res = (viewWin->refresh()); - } - return(res); -} - -int NCursesPad::noutrefresh() -{ - int res = OK; - NCursesWindow* W = Win(); - if (static_cast(0) != W) { - int high = W->maxy(); - int wide = W->maxx(); - res = copywin(*W, min_row, min_col, - 0, 0, high, wide, - FALSE); - if (res==OK) { - W->syncup(); - res = viewWin->noutrefresh(); - } - } - return (res); -} - -void NCursesPad::setWindow(NCursesWindow& view, - int v_grid NCURSES_PARAM_INIT(1), - int h_grid NCURSES_PARAM_INIT(1)) -{ - viewWin = &view; - min_row = min_col = 0; - if (h_grid <=0 || v_grid <= 0) - err_handler("Illegal Gridsize"); - else { - h_gridsize = h_grid; - v_gridsize = v_grid; - } -} - -void NCursesPad::setSubWindow(NCursesWindow& sub) -{ - if (static_cast(0) == viewWin) - err_handler("Pad has no viewport"); - assert(viewWin != 0); - if (!viewWin->isDescendant(sub)) - THROW(new NCursesException("NCursesFramePad", E_SYSTEM_ERROR)); - viewSub = ⊂ -} - -void NCursesFramedPad::OnOperation(int pad_req) -{ - NCursesWindow* W = Win(); - NCursesWindow* W2 = getWindow(); - - if ((static_cast(0) != W) && (static_cast(0) != W2)) { - int Width = W->width(); - int Height = W->height(); - int i, row, col, h_len, v_len; - - h_len = (Width*Width + width() - 1)/width(); - if (h_len==0) - h_len = 1; - if (h_len > Width) - h_len = Width; - - v_len = (Height*Height + height() - 1)/height(); - if (v_len==0) - v_len = 1; - if (v_len > Height) - v_len = Height; - - col = (min_col * Width + width() - 1) / width(); - if (col + h_len > Width) - col = Width - h_len; - - row = (min_row * Height + height() - 1) / height(); - if (row + v_len > Height) - row = Height - v_len; - - W2->vline(1,Width+1,Height); - W2->attron(A_REVERSE); - if (v_len>=2) { - W2->addch(row+1,Width+1,ACS_UARROW); - for(i=2;iaddch(row+i,Width+1,' '); - W2->addch(row+v_len,Width+1,ACS_DARROW); - } - else { - for(i=1;i<=v_len;i++) - W2->addch(row+i,Width+1,' '); - } - W2->attroff(A_REVERSE); - - W2->hline(Height+1,1,Width); - W2->attron(A_REVERSE); - if (h_len >= 2) { - W2->addch(Height+1,col+1,ACS_LARROW); - for(i=2;iaddch(Height+1,col+i,' '); - W2->addch(Height+1,col+h_len,ACS_RARROW); - } - else { - for(i=1;i<=h_len;i++) - W2->addch(Height+1,col+i,' '); - } - W2->attroff(A_REVERSE); - } -} diff --git a/c++/cursesw.cc b/c++/cursesw.cc deleted file mode 100644 index 47e5cf64dcf..00000000000 --- a/c++/cursesw.cc +++ /dev/null @@ -1,468 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 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 * - * "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. * - ****************************************************************************/ - -/* - * Authors: - * Thomas E. Dickey - * Juergen Pfeifer - * - * The NCursesWindow class was originally based on a file written by - * Eric Newton, later modified by Ulrich Drepper and Anatoly Ivasyuk. - * However, aside from the compatible interface definition, no trace - * of the original code remains in this version: it consists only of - * changes introduced since 1995. - */ - -#include "internal.h" -#include "cursesw.h" - -MODULE_ID("$Id: cursesw.cc,v 1.51 2009/03/28 21:31:37 tom Exp $") - -#define COLORS_NEED_INITIALIZATION -1 -#define COLORS_NOT_INITIALIZED 0 -#define COLORS_MONOCHROME 1 -#define COLORS_ARE_REALLY_THERE 2 - -#define HaveColors() (colorInitialized == COLORS_ARE_REALLY_THERE) - -// declare static variables for the class -long NCursesWindow::count = 0L; -bool NCursesWindow::b_initialized = FALSE; - -int -NCursesWindow::scanw(const char* fmt, ...) -{ - int result = ERR; - - va_list args; - va_start(args, fmt); - result = ::vw_scanw (w, const_cast(fmt), args); - va_end(args); - - return result; -} - - -int -NCursesWindow::scanw(int y, int x, const char* fmt, ...) -{ - int result = ERR; - - if (::wmove(w, y, x) != ERR) { - va_list args; - va_start(args, fmt); - result = ::vw_scanw (w, const_cast(fmt), args); - va_end(args); - } - return result; -} - - -int -NCursesWindow::scanw(const char* fmt, va_list args) -{ - int result = ERR; - - result = ::vw_scanw (w, const_cast(fmt), args); - - return result; -} - - -int -NCursesWindow::scanw(int y, int x, const char* fmt, va_list args) -{ - int result = ERR; - - if (::wmove(w, y, x) != ERR) { - result = ::vw_scanw (w, const_cast(fmt), args); - } - return result; -} - - -int -NCursesWindow::printw(const char * fmt, ...) -{ - va_list args; - va_start(args, fmt); - int result = ::vw_printw(w, fmt, args); - va_end(args); - return result; -} - - -int -NCursesWindow::printw(int y, int x, const char * fmt, ...) -{ - va_list args; - va_start(args, fmt); - int result = ::wmove(w, y, x); - if (result == OK) { - result = ::vw_printw(w, fmt, args); - } - va_end(args); - return result; -} - - -int -NCursesWindow::printw(const char * fmt, va_list args) -{ - int result = ::vw_printw(w, fmt, args); - return result; -} - - -int -NCursesWindow::printw(int y, int x, const char * fmt, va_list args) -{ - int result = ::wmove(w, y, x); - if (result == OK) { - result = ::vw_printw(w, fmt, args); - } - return result; -} - - -void -NCursesWindow::set_keyboard(void) -{ - keypad(TRUE); - meta(TRUE); -} - -void -NCursesWindow::err_handler(const char *msg) const THROWS(NCursesException) -{ - THROW(new NCursesException(msg)); -} - -void -NCursesWindow::initialize() -{ - if (!b_initialized) { - ::initscr(); - b_initialized = TRUE; - if (colorInitialized == COLORS_NEED_INITIALIZATION) { - colorInitialized = COLORS_NOT_INITIALIZED; - useColors(); - } - ::noecho(); - ::cbreak(); - } -} - -void -NCursesWindow::constructing() -{ - initialize(); - ++count; -} - -NCursesWindow::NCursesWindow() - : w(0), alloced(FALSE), par(0), subwins(0), sib(0) -{ - constructing(); - - w = static_cast(0); - set_keyboard(); -} - -NCursesWindow::NCursesWindow(int nlines, int ncols, int begin_y, int begin_x) - : w(0), alloced(TRUE), par(0), subwins(0), sib(0) -{ - constructing(); - - w = ::newwin(nlines, ncols, begin_y, begin_x); - if (w == 0) { - err_handler("Cannot construct window"); - } - set_keyboard(); -} - -NCursesWindow::NCursesWindow(WINDOW* window) - : w(0), alloced(FALSE), par(0), subwins(0), sib(0) -{ - constructing(); - - // We used to use a reference on the "window" parameter, but we cannot do - // that with an opaque pointer (see NCURSES_OPAQUE). If the parameter was - // "::stdscr", that is first set via the "constructing() call, and is null - // up to that point. So we allow a null pointer here as meaning the "same" - // as "::stdscr". - w = window ? window : ::stdscr; - set_keyboard(); -} - -NCursesWindow::NCursesWindow(NCursesWindow& win, int ny, int nx, - int begin_y, int begin_x, char absrel) - : w(0), alloced(TRUE), par(0), subwins(0), sib(0) -{ - constructing(); - if (absrel == 'a') { // absolute origin - begin_y -= win.begy(); - begin_x -= win.begx(); - } - - // Link this window into its parent's list of subwindows. - // We use derwin(), since this also works for pads. - w = ::derwin(win.w, ny, nx, begin_y, begin_x); - if (w == 0) { - err_handler("Cannot construct subwindow"); - } - - par = &win; - sib = win.subwins; - win.subwins = this; -} - -NCursesWindow::NCursesWindow(NCursesWindow& win, - bool do_box NCURSES_PARAM_INIT(TRUE)) - : w(0), alloced(TRUE), par(0), subwins(0), sib(0) -{ - constructing(); - int myHeight = win.height(); - int myWidth = win.width(); - w = :: derwin(win.w, myHeight - 2, myWidth - 2, 1, 1); - if (w == 0) { - err_handler("Cannot construct subwindow"); - } - - par = &win; - sib = win.subwins; - win.subwins = this; - subwins = 0; - - if (do_box) { - win.box(); - win.touchwin(); - } -} - -NCursesWindow NCursesWindow::Clone() -{ - WINDOW *d = ::dupwin(w); - NCursesWindow W(d); - W.subwins = subwins; - W.sib = sib; - W.par = par; - W.alloced = alloced; - return W; -} - -typedef int (*RIPOFFINIT)(NCursesWindow&); -static RIPOFFINIT R_INIT[5]; // There can't be more -static int r_init_idx = 0; -static RIPOFFINIT* prip = R_INIT; - -NCursesWindow::NCursesWindow(WINDOW *win, int ncols) - : w(0), alloced(FALSE), par(0), subwins(0), sib(0) -{ - initialize(); - w = win; -} - -int _nc_xx_ripoff_init(WINDOW *w, int ncols) -{ - int res = ERR; - - RIPOFFINIT init = *prip++; - if (init) { - res = init(*(new NCursesWindow(w,ncols))); - } - return res; -} - -int NCursesWindow::ripoffline(int ripoff_lines, - int (*init)(NCursesWindow& win)) -{ - int code = ::_nc_ripoffline(ripoff_lines,_nc_xx_ripoff_init); - if (code == OK && init && ripoff_lines) { - R_INIT[r_init_idx++] = init; - } - return code; -} - -bool -NCursesWindow::isDescendant(NCursesWindow& win) -{ - bool result = FALSE; - - for (NCursesWindow* p = subwins; p != NULL; p = p->sib) { - if (p == &win || p->isDescendant(win)) { - result = TRUE; - break; - } - } - return result; -} - -void -NCursesWindow::kill_subwindows() -{ - NCursesWindow* p = subwins; - - subwins = 0; - while (p != 0) { - NCursesWindow* q = p->sib; - p->kill_subwindows(); - if (p->alloced) { - if (p->w != 0) - ::delwin(p->w); - } - delete p; - p = q; - } -} - - -NCursesWindow::~NCursesWindow() -{ - kill_subwindows(); - - if (par != 0) { - // Remove this window from the parent's list of subwindows. - NCursesWindow * next = par->subwins; - NCursesWindow * prev = 0; - while (next != 0) { - if (next == this) { - if (prev != 0) { - prev->sib = next->sib; - } else { - par->subwins = next->sib; - } - break; - } - prev = next; - next = next->sib; - } - } - - if (alloced && w != 0) - ::delwin(w); - - if (alloced) { - --count; - if (count == 0) { - ::endwin(); - } else if (count < 0) { // cannot happen! - err_handler("Too many windows destroyed"); - } - } -} - -// --------------------------------------------------------------------- -// Color stuff -// -int NCursesWindow::colorInitialized = COLORS_NOT_INITIALIZED; - -void -NCursesWindow::useColors(void) -{ - if (colorInitialized == COLORS_NOT_INITIALIZED) { - if (b_initialized) { - if (::has_colors()) { - ::start_color(); - colorInitialized = COLORS_ARE_REALLY_THERE; - } else { - colorInitialized = COLORS_MONOCHROME; - } - } else { - colorInitialized = COLORS_NEED_INITIALIZATION; - } - } -} - -short -NCursesWindow::getPair() const -{ - return static_cast(PAIR_NUMBER(getattrs(w))); -} - -short -NCursesWindow::getcolor(int getback) const -{ - short fore, back; - - if (HaveColors()) { - if (::pair_content(getPair(), &fore, &back) == ERR) - err_handler("Can't get color pair"); - } else { - // Monochrome means white on black - back = COLOR_BLACK; - fore = COLOR_WHITE; - } - return getback ? back : fore; -} - -int NCursesWindow::NumberOfColors() -{ - return (HaveColors()) ? COLORS : 1; -} - -short -NCursesWindow::getcolor() const -{ - return (HaveColors()) ? getPair() : 0; -} - -int -NCursesWindow::setpalette(short fore, short back, short pair) -{ - return (HaveColors()) ? ::init_pair(pair, fore, back) : OK; -} - -int -NCursesWindow::setpalette(short fore, short back) -{ - return setpalette(fore, back, getPair()); -} - - -int -NCursesWindow::setcolor(short pair) -{ - if (HaveColors()) { - if ((pair < 1) || (pair > COLOR_PAIRS)) - err_handler("Can't set color pair"); - - attroff(A_COLOR); - attrset(COLOR_PAIR(pair)); - } - return OK; -} - -#if HAVE_HAS_KEY -bool NCursesWindow::has_mouse() const -{ - return ((::has_key(KEY_MOUSE) || ::has_mouse()) - ? TRUE : FALSE); -} -#endif diff --git a/c++/cursesw.h b/c++/cursesw.h deleted file mode 100644 index b8e921a9b7a..00000000000 --- a/c++/cursesw.h +++ /dev/null @@ -1,1556 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -// vile:cppmode -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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. * - ****************************************************************************/ - -#ifndef NCURSES_CURSESW_H_incl -#define NCURSES_CURSESW_H_incl 1 - -// $Id: cursesw.h,v 1.48 2008/01/19 21:09:10 tom Exp $ - -#include - -extern "C" { -# include -} - -/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. - Undefine it here, because NCursesWindow uses lines as a method. */ -#undef lines - -/* "Convert" macros to inlines. We'll define it as another symbol to avoid - * conflict with library symbols. - */ -#undef UNDEF -#define UNDEF(name) CUR_ ##name - -#ifdef addch -inline int UNDEF(addch)(chtype ch) { return addch(ch); } -#undef addch -#define addch UNDEF(addch) -#endif - -#ifdef addchstr -inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); } -#undef addchstr -#define addchstr UNDEF(addchstr) -#endif - -#ifdef addnstr -inline int UNDEF(addnstr)(const char *str, int n) -{ return addnstr(str, n); } -#undef addnstr -#define addnstr UNDEF(addnstr) -#endif - -#ifdef addstr -inline int UNDEF(addstr)(const char * str) { return addstr(str); } -#undef addstr -#define addstr UNDEF(addstr) -#endif - -#ifdef attroff -inline int UNDEF(attroff)(chtype at) { return attroff(at); } -#undef attroff -#define attroff UNDEF(attroff) -#endif - -#ifdef attron -inline int UNDEF(attron)(chtype at) { return attron(at); } -#undef attron -#define attron UNDEF(attron) -#endif - -#ifdef attrset -inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } -#undef attrset -#define attrset UNDEF(attrset) -#endif - -#ifdef bkgd -inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } -#undef bkgd -#define bkgd UNDEF(bkgd) -#endif - -#ifdef bkgdset -inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } -#undef bkgdset -#define bkgdset UNDEF(bkgdset) -#endif - -#ifdef border -inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) -{ return border(ls, rs, ts, bs, tl, tr, bl, br); } -#undef border -#define border UNDEF(border) -#endif - -#ifdef box -inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } -#undef box -#define box UNDEF(box) -#endif - -#ifdef chgat -inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) { - return chgat(n, attr, color, opts); } -#undef chgat -#define chgat UNDEF(chgat) -#endif - -#ifdef clear -inline int UNDEF(clear)() { return clear(); } -#undef clear -#define clear UNDEF(clear) -#endif - -#ifdef clearok -inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } -#undef clearok -#define clearok UNDEF(clearok) -#else -extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); -#endif - -#ifdef clrtobot -inline int UNDEF(clrtobot)() { return clrtobot(); } -#undef clrtobot -#define clrtobot UNDEF(clrtobot) -#endif - -#ifdef clrtoeol -inline int UNDEF(clrtoeol)() { return clrtoeol(); } -#undef clrtoeol -#define clrtoeol UNDEF(clrtoeol) -#endif - -#ifdef color_set -inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); } -#undef color_set -#define color_set UNDEF(color_set) -#endif - -#ifdef crmode -inline int UNDEF(crmode)(void) { return crmode(); } -#undef crmode -#define crmode UNDEF(crmode) -#endif - -#ifdef delch -inline int UNDEF(delch)() { return delch(); } -#undef delch -#define delch UNDEF(delch) -#endif - -#ifdef deleteln -inline int UNDEF(deleteln)() { return deleteln(); } -#undef deleteln -#define deleteln UNDEF(deleteln) -#endif - -#ifdef echochar -inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } -#undef echochar -#define echochar UNDEF(echochar) -#endif - -#ifdef erase -inline int UNDEF(erase)() { return erase(); } -#undef erase -#define erase UNDEF(erase) -#endif - -#ifdef fixterm -inline int UNDEF(fixterm)(void) { return fixterm(); } -#undef fixterm -#define fixterm UNDEF(fixterm) -#endif - -#ifdef flushok -inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { - return flushok(_win, _bf); } -#undef flushok -#define flushok UNDEF(flushok) -#else -#define _no_flushok -#endif - -#ifdef getattrs -inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); } -#undef getattrs -#define getattrs UNDEF(getattrs) -#endif - -#ifdef getbegyx -inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } -#undef getbegyx -#define getbegyx UNDEF(getbegyx) -#endif - -#ifdef getbkgd -inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } -#undef getbkgd -#define getbkgd UNDEF(getbkgd) -#endif - -#ifdef getch -inline int UNDEF(getch)() { return getch(); } -#undef getch -#define getch UNDEF(getch) -#endif - -#ifdef getmaxyx -inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } -#undef getmaxyx -#define getmaxyx UNDEF(getmaxyx) -#endif - -#ifdef getnstr -inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } -#undef getnstr -#define getnstr UNDEF(getnstr) -#endif - -#ifdef getparyx -inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); } -#undef getparyx -#define getparyx UNDEF(getparyx) -#endif - -#ifdef getstr -inline int UNDEF(getstr)(char *_str) { return getstr(_str); } -#undef getstr -#define getstr UNDEF(getstr) -#endif - -#ifdef getyx -inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { - getyx(win, y, x); } -#undef getyx -#define getyx UNDEF(getyx) -#endif - -#ifdef hline -inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } -#undef hline -#define hline UNDEF(hline) -#endif - -#ifdef inch -inline chtype UNDEF(inch)() { return inch(); } -#undef inch -#define inch UNDEF(inch) -#endif - -#ifdef inchstr -inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); } -#undef inchstr -#define inchstr UNDEF(inchstr) -#endif - -#ifdef innstr -inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } -#undef innstr -#define innstr UNDEF(innstr) -#endif - -#ifdef insch -inline int UNDEF(insch)(chtype c) { return insch(c); } -#undef insch -#define insch UNDEF(insch) -#endif - -#ifdef insdelln -inline int UNDEF(insdelln)(int n) { return insdelln(n); } -#undef insdelln -#define insdelln UNDEF(insdelln) -#endif - -#ifdef insertln -inline int UNDEF(insertln)() { return insertln(); } -#undef insertln -#define insertln UNDEF(insertln) -#endif - -#ifdef insnstr -inline int UNDEF(insnstr)(const char *_str, int n) { - return insnstr(_str, n); } -#undef insnstr -#define insnstr UNDEF(insnstr) -#endif - -#ifdef insstr -inline int UNDEF(insstr)(const char *_str) { - return insstr(_str); } -#undef insstr -#define insstr UNDEF(insstr) -#endif - -#ifdef instr -inline int UNDEF(instr)(char *_str) { return instr(_str); } -#undef instr -#define instr UNDEF(instr) -#endif - -#ifdef intrflush -inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); } -#undef intrflush -#define intrflush UNDEF(intrflush) -#endif - -#ifdef leaveok -inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } -#undef leaveok -#define leaveok UNDEF(leaveok) -#else -extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); -#endif - -#ifdef move -inline int UNDEF(move)(int x, int y) { return move(x, y); } -#undef move -#define move UNDEF(move) -#endif - -#ifdef mvaddch -inline int UNDEF(mvaddch)(int y, int x, chtype ch) -{ return mvaddch(y, x, ch); } -#undef mvaddch -#define mvaddch UNDEF(mvaddch) -#endif - -#ifdef mvaddnstr -inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) -{ return mvaddnstr(y, x, str, n); } -#undef mvaddnstr -#define mvaddnstr UNDEF(mvaddnstr) -#endif - -#ifdef mvaddstr -inline int UNDEF(mvaddstr)(int y, int x, const char * str) -{ return mvaddstr(y, x, str); } -#undef mvaddstr -#define mvaddstr UNDEF(mvaddstr) -#endif - -#ifdef mvchgat -inline int UNDEF(mvchgat)(int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvchgat(y, x, n, attr, color, opts); } -#undef mvchgat -#define mvchgat UNDEF(mvchgat) -#endif - -#ifdef mvdelch -inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} -#undef mvdelch -#define mvdelch UNDEF(mvdelch) -#endif - -#ifdef mvgetch -inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} -#undef mvgetch -#define mvgetch UNDEF(mvgetch) -#endif - -#ifdef mvgetnstr -inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { - return mvgetnstr(y, x, str, n);} -#undef mvgetnstr -#define mvgetnstr UNDEF(mvgetnstr) -#endif - -#ifdef mvgetstr -inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} -#undef mvgetstr -#define mvgetstr UNDEF(mvgetstr) -#endif - -#ifdef mvinch -inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} -#undef mvinch -#define mvinch UNDEF(mvinch) -#endif - -#ifdef mvinnstr -inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { - return mvinnstr(y, x, _str, n); } -#undef mvinnstr -#define mvinnstr UNDEF(mvinnstr) -#endif - -#ifdef mvinsch -inline int UNDEF(mvinsch)(int y, int x, chtype c) -{ return mvinsch(y, x, c); } -#undef mvinsch -#define mvinsch UNDEF(mvinsch) -#endif - -#ifdef mvinsnstr -inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { - return mvinsnstr(y, x, _str, n); } -#undef mvinsnstr -#define mvinsnstr UNDEF(mvinsnstr) -#endif - -#ifdef mvinsstr -inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { - return mvinsstr(y, x, _str); } -#undef mvinsstr -#define mvinsstr UNDEF(mvinsstr) -#endif - -#ifdef mvwaddch -inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) -{ return mvwaddch(win, y, x, ch); } -#undef mvwaddch -#define mvwaddch UNDEF(mvwaddch) -#endif - -#ifdef mvwaddchnstr -inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n) -{ return mvwaddchnstr(win, y, x, str, n); } -#undef mvwaddchnstr -#define mvwaddchnstr UNDEF(mvwaddchnstr) -#endif - -#ifdef mvwaddchstr -inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str) -{ return mvwaddchstr(win, y, x, str); } -#undef mvwaddchstr -#define mvwaddchstr UNDEF(mvwaddchstr) -#endif - -#ifdef mvwaddnstr -inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) -{ return mvwaddnstr(win, y, x, str, n); } -#undef mvwaddnstr -#define mvwaddnstr UNDEF(mvwaddnstr) -#endif - -#ifdef mvwaddstr -inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) -{ return mvwaddstr(win, y, x, str); } -#undef mvwaddstr -#define mvwaddstr UNDEF(mvwaddstr) -#endif - -#ifdef mvwchgat -inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvwchgat(win, y, x, n, attr, color, opts); } -#undef mvwchgat -#define mvwchgat UNDEF(mvwchgat) -#endif - -#ifdef mvwdelch -inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) -{ return mvwdelch(win, y, x); } -#undef mvwdelch -#define mvwdelch UNDEF(mvwdelch) -#endif - -#ifdef mvwgetch -inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} -#undef mvwgetch -#define mvwgetch UNDEF(mvwgetch) -#endif - -#ifdef mvwgetnstr -inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) -{return mvwgetnstr(win, y, x, str, n);} -#undef mvwgetnstr -#define mvwgetnstr UNDEF(mvwgetnstr) -#endif - -#ifdef mvwgetstr -inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) -{return mvwgetstr(win, y, x, str);} -#undef mvwgetstr -#define mvwgetstr UNDEF(mvwgetstr) -#endif - -#ifdef mvwhline -inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwhline(win, y, x, c, n); } -#undef mvwhline -#define mvwhline UNDEF(mvwhline) -#endif - -#ifdef mvwinch -inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { - return mvwinch(win, y, x);} -#undef mvwinch -#define mvwinch UNDEF(mvwinch) -#endif - -#ifdef mvwinchnstr -inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); } -#undef mvwinchnstr -#define mvwinchnstr UNDEF(mvwinchnstr) -#endif - -#ifdef mvwinchstr -inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); } -#undef mvwinchstr -#define mvwinchstr UNDEF(mvwinchstr) -#endif - -#ifdef mvwinnstr -inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { - return mvwinnstr(win, y, x, _str, n); } -#undef mvwinnstr -#define mvwinnstr UNDEF(mvwinnstr) -#endif - -#ifdef mvwinsch -inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) -{ return mvwinsch(win, y, x, c); } -#undef mvwinsch -#define mvwinsch UNDEF(mvwinsch) -#endif - -#ifdef mvwinsnstr -inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { - return mvwinsnstr(w, y, x, _str, n); } -#undef mvwinsnstr -#define mvwinsnstr UNDEF(mvwinsnstr) -#endif - -#ifdef mvwinsstr -inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { - return mvwinsstr(w, y, x, _str); } -#undef mvwinsstr -#define mvwinsstr UNDEF(mvwinsstr) -#endif - -#ifdef mvwvline -inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwvline(win, y, x, c, n); } -#undef mvwvline -#define mvwvline UNDEF(mvwvline) -#endif - -#ifdef napms -inline void UNDEF(napms)(unsigned long x) { napms(x); } -#undef napms -#define napms UNDEF(napms) -#endif - -#ifdef nocrmode -inline int UNDEF(nocrmode)(void) { return nocrmode(); } -#undef nocrmode -#define nocrmode UNDEF(nocrmode) -#endif - -#ifdef nodelay -inline void UNDEF(nodelay)() { nodelay(); } -#undef nodelay -#define nodelay UNDEF(nodelay) -#endif - -#ifdef redrawwin -inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } -#undef redrawwin -#define redrawwin UNDEF(redrawwin) -#endif - -#ifdef refresh -inline int UNDEF(refresh)() { return refresh(); } -#undef refresh -#define refresh UNDEF(refresh) -#endif - -#ifdef resetterm -inline int UNDEF(resetterm)(void) { return resetterm(); } -#undef resetterm -#define resetterm UNDEF(resetterm) -#endif - -#ifdef saveterm -inline int UNDEF(saveterm)(void) { return saveterm(); } -#undef saveterm -#define saveterm UNDEF(saveterm) -#endif - -#ifdef scrl -inline int UNDEF(scrl)(int l) { return scrl(l); } -#undef scrl -#define scrl UNDEF(scrl) -#endif - -#ifdef scroll -inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } -#undef scroll -#define scroll UNDEF(scroll) -#endif - -#ifdef scrollok -inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } -#undef scrollok -#define scrollok UNDEF(scrollok) -#else -#if defined(__NCURSES_H) -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); -#else -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); -#endif -#endif - -#ifdef setscrreg -inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } -#undef setscrreg -#define setscrreg UNDEF(setscrreg) -#endif - -#ifdef standend -inline int UNDEF(standend)() { return standend(); } -#undef standend -#define standend UNDEF(standend) -#endif - -#ifdef standout -inline int UNDEF(standout)() { return standout(); } -#undef standout -#define standout UNDEF(standout) -#endif - -#ifdef subpad -inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) -{ return derwin(p, l, c, y, x); } -#undef subpad -#define subpad UNDEF(subpad) -#endif - -#ifdef timeout -inline void UNDEF(timeout)(int delay) { timeout(delay); } -#undef timeout -#define timeout UNDEF(timeout) -#endif - -#ifdef touchline -inline int UNDEF(touchline)(WINDOW *win, int s, int c) -{ return touchline(win, s, c); } -#undef touchline -#define touchline UNDEF(touchline) -#endif - -#ifdef touchwin -inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } -#undef touchwin -#define touchwin UNDEF(touchwin) -#endif - -#ifdef untouchwin -inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } -#undef untouchwin -#define untouchwin UNDEF(untouchwin) -#endif - -#ifdef vline -inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } -#undef vline -#define vline UNDEF(vline) -#endif - -#ifdef waddchstr -inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } -#undef waddchstr -#define waddchstr UNDEF(waddchstr) -#endif - -#ifdef waddstr -inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } -#undef waddstr -#define waddstr UNDEF(waddstr) -#endif - -#ifdef wattroff -inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } -#undef wattroff -#define wattroff UNDEF(wattroff) -#endif - -#ifdef wattrset -inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } -#undef wattrset -#define wattrset UNDEF(wattrset) -#endif - -#ifdef winch -inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } -#undef winch -#define winch UNDEF(winch) -#endif - -#ifdef winchnstr -inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); } -#undef winchnstr -#define winchnstr UNDEF(winchnstr) -#endif - -#ifdef winchstr -inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); } -#undef winchstr -#define winchstr UNDEF(winchstr) -#endif - -#ifdef winsstr -inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { - return winsstr(w, _str); } -#undef winsstr -#define winsstr UNDEF(winsstr) -#endif - -#ifdef wstandend -inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } -#undef wstandend -#define wstandend UNDEF(wstandend) -#endif - -#ifdef wstandout -inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } -#undef wstandout -#define wstandout UNDEF(wstandout) -#endif - -/* - * - * C++ class for windows. - * - */ - -extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); -extern "C" int _nc_xx_ripoff_init(WINDOW *, int); -extern "C" int _nc_has_mouse(void); - -class NCURSES_IMPEXP NCursesWindow -{ - friend class NCursesMenu; - friend class NCursesForm; - -private: - static bool b_initialized; - static void initialize(); - void constructing(); - friend int _nc_xx_ripoff_init(WINDOW *, int); - - void set_keyboard(); - - short getcolor(int getback) const; - short getPair() const; - - static int setpalette(short fore, short back, short pair); - static int colorInitialized; - - // This private constructor is only used during the initialization - // of windows generated by ripoffline() calls. - NCursesWindow(WINDOW* win, int ncols); - -protected: - virtual void err_handler(const char *) const THROWS(NCursesException); - // Signal an error with the given message text. - - static long count; // count of all active windows: - // We rely on the c++ promise that - // all otherwise uninitialized - // static class vars are set to 0 - - WINDOW* w; // the curses WINDOW - - bool alloced; // TRUE if we own the WINDOW - - NCursesWindow* par; // parent, if subwindow - NCursesWindow* subwins; // head of subwindows list - NCursesWindow* sib; // next subwindow of parent - - void kill_subwindows(); // disable all subwindows - // Destroy all subwindows. - - /* Only for use by derived classes. They are then in charge to - fill the member variables correctly. */ - NCursesWindow(); - -public: - NCursesWindow(WINDOW* window); // useful only for stdscr - - NCursesWindow(int nlines, // number of lines - int ncols, // number of columns - int begin_y, // line origin - int begin_x); // col origin - - NCursesWindow(NCursesWindow& par,// parent window - int nlines, // number of lines - int ncols, // number of columns - int begin_y, // absolute or relative - int begin_x, // origins: - char absrel = 'a');// if `a', begin_y & begin_x are - // absolute screen pos, else if `r', they are relative to par origin - - NCursesWindow(NCursesWindow& par,// parent window - bool do_box = TRUE); - // this is the very common case that we want to create the subwindow that - // is two lines and two columns smaller and begins at (1,1). - // We may automatically request the box around it. - - NCursesWindow& operator=(const NCursesWindow& rhs) - { - if (this != &rhs) - *this = rhs; - return *this; - } - - NCursesWindow(const NCursesWindow& rhs) - : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib) - { - } - - virtual ~NCursesWindow(); - - NCursesWindow Clone(); - // Make an exact copy of the window. - - // Initialization. - static void useColors(void); - // Call this routine very early if you want to have colors. - - static int ripoffline(int ripoff_lines, - int (*init)(NCursesWindow& win)); - // This function is used to generate a window of ripped-of lines. - // If the argument is positive, lines are removed from the top, if it - // is negative lines are removed from the bottom. This enhances the - // lowlevel ripoffline() function because it uses the internal - // implementation that allows to remove more than just a single line. - // This function must be called before any other ncurses function. The - // creation of the window is deferred until ncurses gets initialized. - // The initialization function is then called. - - // ------------------------------------------------------------------------- - // terminal status - // ------------------------------------------------------------------------- - int lines() const { initialize(); return LINES; } - // Number of lines on terminal, *not* window - - int cols() const { initialize(); return COLS; } - // Number of cols on terminal, *not* window - - int tabsize() const { initialize(); return TABSIZE; } - // Size of a tab on terminal, *not* window - - static int NumberOfColors(); - // Number of available colors - - int colors() const { return NumberOfColors(); } - // Number of available colors - - // ------------------------------------------------------------------------- - // window status - // ------------------------------------------------------------------------- - int height() const { return maxy() + 1; } - // Number of lines in this window - - int width() const { return maxx() + 1; } - // Number of columns in this window - - int begx() const { return getbegx(w); } - // Column of top left corner relative to stdscr - - int begy() const { return getbegy(w); } - // Line of top left corner relative to stdscr - - int curx() const { return getcurx(w); } - // Column of top left corner relative to stdscr - - int cury() const { return getcury(w); } - // Line of top left corner relative to stdscr - - int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; } - // Largest x coord in window - - int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; } - // Largest y coord in window - - short getcolor() const; - // Actual color pair - - short foreground() const { return getcolor(0); } - // Actual foreground color - - short background() const { return getcolor(1); } - // Actual background color - - int setpalette(short fore, short back); - // Set color palette entry - - int setcolor(short pair); - // Set actually used palette entry - - // ------------------------------------------------------------------------- - // window positioning - // ------------------------------------------------------------------------- - virtual int mvwin(int begin_y, int begin_x) { - return ::mvwin(w, begin_y, begin_x); } - // Move window to new position with the new position as top left corner. - // This is virtual because it is redefined in NCursesPanel. - - // ------------------------------------------------------------------------- - // coordinate positioning - // ------------------------------------------------------------------------- - int move(int y, int x) { return ::wmove(w, y, x); } - // Move cursor the this position - - void getyx(int& y, int& x) const { ::getyx(w, y, x); } - // Get current position of the cursor - - void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); } - // Get beginning of the window - - void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); } - // Get size of the window - - void getparyx(int& y, int& x) const { ::getparyx(w, y, x); } - // Get parent's beginning of the window - - int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { - return ::mvcur(oldrow, oldcol, newrow, newcol); } - // Perform lowlevel cursor motion that takes effect immediately. - - // ------------------------------------------------------------------------- - // input - // ------------------------------------------------------------------------- - int getch() { return ::wgetch(w); } - // Get a keystroke from the window. - - int getch(int y, int x) { return ::mvwgetch(w, y, x); } - // Move cursor to position and get a keystroke from the window - - int getstr(char* str, int n=-1) { - return ::wgetnstr(w, str, n); } - // Read a series of characters into str until a newline or carriage return - // is received. Read at most n characters. If n is negative, the limit is - // ignored. - - int getstr(int y, int x, char* str, int n=-1) { - return ::mvwgetnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the getstr() - // as described above. - - int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } - // Get a string of characters from the window into the buffer s. Retrieve - // at most n characters, if n is negative retrieve all characters up to the - // end of the current line. Attributes are stripped from the characters. - - int instr(int y, int x, char *s, int n=-1) { - return ::mvwinnstr(w, y, x, s, n); } - // Move the cursor to the requested position and then perform the instr() - // as described above. - - int scanw(const char* fmt, ...) - // Perform a scanw function from the window. -#if __GNUG__ >= 2 - __attribute__ ((format (scanf, 2, 3))); -#else - ; -#endif - - int scanw(const char*, va_list); - // Perform a scanw function from the window. - - int scanw(int y, int x, const char* fmt, ...) - // Move the cursor to the requested position and then perform a scanw - // from the window. -#if __GNUG__ >= 2 - __attribute__ ((format (scanf, 4, 5))); -#else - ; -#endif - - int scanw(int y, int x, const char* fmt, va_list); - // Move the cursor to the requested position and then perform a scanw - // from the window. - - // ------------------------------------------------------------------------- - // output - // ------------------------------------------------------------------------- - int addch(const chtype ch) { return ::waddch(w, ch); } - // Put attributed character to the window. - - int addch(int y, int x, const chtype ch) { - return ::mvwaddch(w, y, x, ch); } - // Move cursor to the requested position and then put attributed character - // to the window. - - int echochar(const chtype ch) { return ::wechochar(w, ch); } - // Put attributed character to the window and refresh it immediately. - - int addstr(const char* str, int n=-1) { - return ::waddnstr(w, str, n); } - // Write the string str to the window, stop writing if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int addstr(int y, int x, const char * str, int n=-1) { - return ::mvwaddnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the addchstr - // as described above. - - int addchstr(const chtype* str, int n=-1) { - return ::waddchnstr(w, str, n); } - // Write the string str to the window, stop writing if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int addchstr(int y, int x, const chtype * str, int n=-1) { - return ::mvwaddchnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the addchstr - // as described above. - - int printw(const char* fmt, ...) - // Do a formatted print to the window. -#if (__GNUG__ >= 2) && !defined(printf) - __attribute__ ((format (printf, 2, 3))); -#else - ; -#endif - - int printw(int y, int x, const char * fmt, ...) - // Move the cursor and then do a formatted print to the window. -#if (__GNUG__ >= 2) && !defined(printf) - __attribute__ ((format (printf, 4, 5))); -#else - ; -#endif - - int printw(const char* fmt, va_list args); - // Do a formatted print to the window. - - int printw(int y, int x, const char * fmt, va_list args); - // Move the cursor and then do a formatted print to the window. - - chtype inch() const { return ::winch(w); } - // Retrieve attributed character under the current cursor position. - - chtype inch(int y, int x) { return ::mvwinch(w, y, x); } - // Move cursor to requested position and then retrieve attributed character - // at this position. - - int inchstr(chtype* str, int n=-1) { - return ::winchnstr(w, str, n); } - // Read the string str from the window, stop reading if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int inchstr(int y, int x, chtype * str, int n=-1) { - return ::mvwinchnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the inchstr - // as described above. - - int insch(chtype ch) { return ::winsch(w, ch); } - // Insert attributed character into the window before current cursor - // position. - - int insch(int y, int x, chtype ch) { - return ::mvwinsch(w, y, x, ch); } - // Move cursor to requested position and then insert the attributed - // character before that position. - - int insertln() { return ::winsdelln(w, 1); } - // Insert an empty line above the current line. - - int insdelln(int n=1) { return ::winsdelln(w, n); } - // If n>0 insert that many lines above the current line. If n<0 delete - // that many lines beginning with the current line. - - int insstr(const char *s, int n=-1) { - return ::winsnstr(w, s, n); } - // Insert the string into the window before the current cursor position. - // Insert stops at end of string or when the limit n is reached. If n is - // negative, it is ignored. - - int insstr(int y, int x, const char *s, int n=-1) { - return ::mvwinsnstr(w, y, x, s, n); } - // Move the cursor to the requested position and then perform the insstr() - // as described above. - - int attron (chtype at) { return ::wattron (w, at); } - // Switch on the window attributes; - - int attroff(chtype at) { return ::wattroff(w, static_cast(at)); } - // Switch off the window attributes; - - int attrset(chtype at) { return ::wattrset(w, static_cast(at)); } - // Set the window attributes; - - chtype attrget() { return ::getattrs(w); } - // Get the window attributes; - - int color_set(short color_pair_number, void* opts=NULL) { - return ::wcolor_set(w, color_pair_number, opts); } - // Set the window color attribute; - - int chgat(int n, attr_t attr, short color, const void *opts=NULL) { - return ::wchgat(w, n, attr, color, opts); } - // Change the attributes of the next n characters in the current line. If - // n is negative or greater than the number of remaining characters in the - // line, the attributes will be changed up to the end of the line. - - int chgat(int y, int x, - int n, attr_t attr, short color, const void *opts=NULL) { - return ::mvwchgat(w, y, x, n, attr, color, opts); } - // Move the cursor to the requested position and then perform chgat() as - // described above. - - // ------------------------------------------------------------------------- - // background - // ------------------------------------------------------------------------- - chtype getbkgd() const { return ::getbkgd(w); } - // Get current background setting. - - int bkgd(const chtype ch) { return ::wbkgd(w, ch); } - // Set the background property and apply it to the window. - - void bkgdset(chtype ch) { ::wbkgdset(w, ch); } - // Set the background property. - - // ------------------------------------------------------------------------- - // borders - // ------------------------------------------------------------------------- - int box(chtype vert=0, chtype hor=0) { - return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); } - // Draw a box around the window with the given vertical and horizontal - // drawing characters. If you specify a zero as character, curses will try - // to find a "nice" character. - - int border(chtype left=0, chtype right=0, - chtype top =0, chtype bottom=0, - chtype top_left =0, chtype top_right=0, - chtype bottom_left =0, chtype bottom_right=0) { - return ::wborder(w, left, right, top, bottom, top_left, top_right, - bottom_left, bottom_right); } - // Draw a border around the window with the given characters for the - // various parts of the border. If you pass zero for a character, curses - // will try to find "nice" characters. - - // ------------------------------------------------------------------------- - // lines and boxes - // ------------------------------------------------------------------------- - int hline(int len, chtype ch=0) { return ::whline(w, ch, len); } - // Draw a horizontal line of len characters with the given character. If - // you pass zero for the character, curses will try to find a "nice" one. - - int hline(int y, int x, int len, chtype ch=0) { - return ::mvwhline(w, y, x, ch, len); } - // Move the cursor to the requested position and then draw a horizontal line. - - int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); } - // Draw a vertical line of len characters with the given character. If - // you pass zero for the character, curses will try to find a "nice" one. - - int vline(int y, int x, int len, chtype ch=0) { - return ::mvwvline(w, y, x, ch, len); } - // Move the cursor to the requested position and then draw a vertical line. - - // ------------------------------------------------------------------------- - // erasure - // ------------------------------------------------------------------------- - int erase() { return ::werase(w); } - // Erase the window. - - int clear() { return ::wclear(w); } - // Clear the window. - - int clearok(bool bf) { return ::clearok(w, bf); } - // Set/Reset the clear flag. If set, the next refresh() will clear the - // screen. - - int clrtobot() { return ::wclrtobot(w); } - // Clear to the end of the window. - - int clrtoeol() { return ::wclrtoeol(w); } - // Clear to the end of the line. - - int delch() { return ::wdelch(w); } - // Delete character under the cursor. - - int delch(int y, int x) { return ::mvwdelch(w, y, x); } - // Move cursor to requested position and delete the character under the - // cursor. - - int deleteln() { return ::winsdelln(w, -1); } - // Delete the current line. - - // ------------------------------------------------------------------------- - // screen control - // ------------------------------------------------------------------------- - int scroll(int amount=1) { return ::wscrl(w, amount); } - // Scroll amount lines. If amount is positive, scroll up, otherwise - // scroll down. - - int scrollok(bool bf) { return ::scrollok(w, bf); } - // If bf is TRUE, window scrolls if cursor is moved off the bottom - // edge of the window or a scrolling region, otherwise the cursor is left - // at the bottom line. - - int setscrreg(int from, int to) { - return ::wsetscrreg(w, from, to); } - // Define a soft scrolling region. - - int idlok(bool bf) { return ::idlok(w, bf); } - // If bf is TRUE, use insert/delete line hardware support if possible. - // Otherwise do it in software. - - void idcok(bool bf) { ::idcok(w, bf); } - // If bf is TRUE, use insert/delete character hardware support if possible. - // Otherwise do it in software. - - int touchline(int s, int c) { return ::touchline(w, s, c); } - // Mark the given lines as modified. - - int touchwin() { return ::wtouchln(w, 0, height(), 1); } - // Mark the whole window as modified. - - int untouchwin() { return ::wtouchln(w, 0, height(), 0); } - // Mark the whole window as unmodified. - - int touchln(int s, int cnt, bool changed=TRUE) { - return ::wtouchln(w, s, cnt, static_cast(changed ? 1 : 0)); } - // Mark cnt lines beginning from line s as changed or unchanged, depending - // on the value of the changed flag. - - bool is_linetouched(int line) const { - return (::is_linetouched(w, line) ? TRUE:FALSE); } - // Return TRUE if line is marked as changed, FALSE otherwise - - bool is_wintouched() const { - return (::is_wintouched(w) ? TRUE:FALSE); } - // Return TRUE if window is marked as changed, FALSE otherwise - - int leaveok(bool bf) { return ::leaveok(w, bf); } - // If bf is TRUE, curses will leave the cursor after an update whereever - // it is after the update. - - int redrawln(int from, int n) { return ::wredrawln(w, from, n); } - // Redraw n lines starting from the requested line - - int redrawwin() { return ::wredrawln(w, 0, height()); } - // Redraw the whole window - - int doupdate() { return ::doupdate(); } - // Do all outputs to make the physical screen looking like the virtual one - - void syncdown() { ::wsyncdown(w); } - // Propagate the changes down to all descendant windows - - void syncup() { ::wsyncup(w); } - // Propagate the changes up in the hierarchy - - void cursyncup() { ::wcursyncup(w); } - // Position the cursor in all ancestor windows corresponding to our setting - - int syncok(bool bf) { return ::syncok(w, bf); } - // If called with bf=TRUE, syncup() is called whenever the window is changed - -#ifndef _no_flushok - int flushok(bool bf) { return ::flushok(w, bf); } -#endif - - void immedok(bool bf) { ::immedok(w, bf); } - // If called with bf=TRUE, any change in the window will cause an - // automatic immediate refresh() - - int intrflush(bool bf) { return ::intrflush(w, bf); } - - int keypad(bool bf) { return ::keypad(w, bf); } - // If called with bf=TRUE, the application will interpret function keys. - - int nodelay(bool bf) { return ::nodelay(w, bf); } - - int meta(bool bf) { return ::meta(w, bf); } - // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise - // 7-Bit characters are generated. - - int standout() { return ::wstandout(w); } - // Enable "standout" attributes - - int standend() { return ::wstandend(w); } - // Disable "standout" attributes - - // ------------------------------------------------------------------------- - // The next two are virtual, because we redefine them in the - // NCursesPanel class. - // ------------------------------------------------------------------------- - virtual int refresh() { return ::wrefresh(w); } - // Propagate the changes in this window to the virtual screen and call - // doupdate(). This is redefined in NCursesPanel. - - virtual int noutrefresh() { return ::wnoutrefresh(w); } - // Propagate the changes in this window to the virtual screen. This is - // redefined in NCursesPanel. - - // ------------------------------------------------------------------------- - // multiple window control - // ------------------------------------------------------------------------- - int overlay(NCursesWindow& win) { - return ::overlay(w, win.w); } - // Overlay this window over win. - - int overwrite(NCursesWindow& win) { - return ::overwrite(w, win.w); } - // Overwrite win with this window. - - int copywin(NCursesWindow& win, - int sminrow, int smincol, - int dminrow, int dmincol, - int dmaxrow, int dmaxcol, bool overlaywin=TRUE) { - return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, - dmaxrow, dmaxcol, static_cast(overlaywin ? 1 : 0)); } - // Overlay or overwrite the rectangle in win given by dminrow,dmincol, - // dmaxrow,dmaxcol with the rectangle in this window beginning at - // sminrow,smincol. - - // ------------------------------------------------------------------------- - // Extended functions - // ------------------------------------------------------------------------- -#if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0) - int wresize(int newLines, int newColumns) { - return ::wresize(w, newLines, newColumns); } -#endif - - // ------------------------------------------------------------------------- - // Mouse related - // ------------------------------------------------------------------------- - bool has_mouse() const; - // Return TRUE if terminal supports a mouse, FALSE otherwise - - // ------------------------------------------------------------------------- - // traversal support - // ------------------------------------------------------------------------- - NCursesWindow* child() { return subwins; } - // Get the first child window. - - NCursesWindow* sibling() { return sib; } - // Get the next child of my parent. - - NCursesWindow* parent() { return par; } - // Get my parent. - - bool isDescendant(NCursesWindow& win); - // Return TRUE if win is a descendant of this. -}; - -// ------------------------------------------------------------------------- -// We leave this here for compatibility reasons. -// ------------------------------------------------------------------------- -class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow -{ -public: - NCursesColorWindow(WINDOW* &window) // useful only for stdscr - : NCursesWindow(window) { - useColors(); } - - NCursesColorWindow(int nlines, // number of lines - int ncols, // number of columns - int begin_y, // line origin - int begin_x) // col origin - : NCursesWindow(nlines, ncols, begin_y, begin_x) { - useColors(); } - - NCursesColorWindow(NCursesWindow& parentWin,// parent window - int nlines, // number of lines - int ncols, // number of columns - int begin_y, // absolute or relative - int begin_x, // origins: - char absrel = 'a') // if `a', by & bx are - : NCursesWindow(parentWin, - nlines, ncols, // absolute screen pos, - begin_y, begin_x, // else if `r', they are - absrel ) { // relative to par origin - useColors(); } -}; - -// These enum definitions really belong inside the NCursesPad class, but only -// recent compilers support that feature. - - typedef enum { - REQ_PAD_REFRESH = KEY_MAX + 1, - REQ_PAD_UP, - REQ_PAD_DOWN, - REQ_PAD_LEFT, - REQ_PAD_RIGHT, - REQ_PAD_EXIT - } Pad_Request; - - const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code - const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code - -// ------------------------------------------------------------------------- -// Pad Support. We allow an association of a pad with a "real" window -// through which the pad may be viewed. -// ------------------------------------------------------------------------- -class NCURSES_IMPEXP NCursesPad : public NCursesWindow -{ -private: - NCursesWindow* viewWin; // the "viewport" window - NCursesWindow* viewSub; // the "viewport" subwindow - - int h_gridsize, v_gridsize; - -protected: - int min_row, min_col; // top left row/col of the pads display area - - NCursesWindow* Win(void) const { - // Get the window into which the pad should be copied (if any) - return (viewSub?viewSub:(viewWin?viewWin:0)); - } - - NCursesWindow* getWindow(void) const { - return viewWin; - } - - NCursesWindow* getSubWindow(void) const { - return viewSub; - } - - virtual int driver (int key); // Virtualize keystroke key - // The driver translates the keystroke c into an Pad_Request - - virtual void OnUnknownOperation(int pad_req) { - ::beep(); - } - // This is called if the driver returns an unknown op-code - - virtual void OnNavigationError(int pad_req) { - ::beep(); - } - // This is called if a navigation request couldn't be satisfied - - virtual void OnOperation(int pad_req) { - }; - // OnOperation is called if a Pad_Operation was executed and just before - // the refresh() operation is done. - -public: - NCursesPad(int nlines, int ncols); - // create a pad with the given size - - NCursesPad& operator=(const NCursesPad& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesWindow::operator=(rhs); - } - return *this; - } - - NCursesPad(const NCursesPad& rhs) - : NCursesWindow(rhs), - viewWin(rhs.viewWin), - viewSub(rhs.viewSub), - h_gridsize(rhs.h_gridsize), - v_gridsize(rhs.v_gridsize), - min_row(rhs.min_row), - min_col(rhs.min_col) - { - } - - virtual ~NCursesPad() {} - - int echochar(const chtype ch) { return ::pechochar(w, ch); } - // Put the attributed character onto the pad and immediately do a - // prefresh(). - - int refresh(); - // If a viewport is defined the pad is displayed in this window, otherwise - // this is a noop. - - int refresh(int pminrow, int pmincol, - int sminrow, int smincol, - int smaxrow, int smaxcol) { - return ::prefresh(w, pminrow, pmincol, - sminrow, smincol, smaxrow, smaxcol); - } - // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle - // on the screen. refresh copies a rectangle of this size beginning - // with top left corner pminrow,pmincol onto the screen and calls doupdate(). - - int noutrefresh(); - // If a viewport is defined the pad is displayed in this window, otherwise - // this is a noop. - - int noutrefresh(int pminrow, int pmincol, - int sminrow, int smincol, - int smaxrow, int smaxcol) { - return ::pnoutrefresh(w, pminrow, pmincol, - sminrow, smincol, smaxrow, smaxcol); - } - // Does the same as refresh() but without calling doupdate(). - - virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1); - // Add the window "view" as viewing window to the pad. - - virtual void setSubWindow(NCursesWindow& sub); - // Use the subwindow "sub" of the viewport window for the actual viewing. - // The full viewport window is usually used to provide some decorations - // like frames, titles etc. - - virtual void operator() (void); - // Perform Pad's operation -}; - -// A FramedPad is constructed always with a viewport window. This viewport -// will be framed (by a box() command) and the interior of the box is the -// viewport subwindow. On the frame we display scrollbar sliders. -class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad -{ -protected: - virtual void OnOperation(int pad_req); - -public: - NCursesFramedPad(NCursesWindow& win, int nlines, int ncols, - int v_grid = 1, int h_grid = 1) - : NCursesPad(nlines, ncols) { - NCursesPad::setWindow(win, v_grid, h_grid); - NCursesPad::setSubWindow(*(new NCursesWindow(win))); - } - // Construct the FramedPad with the given Window win as viewport. - - virtual ~NCursesFramedPad() { - delete getSubWindow(); - } - - void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { - err_handler("Operation not allowed"); - } - // Disable this call; the viewport is already defined - - void setSubWindow(NCursesWindow& sub) { - err_handler("Operation not allowed"); - } - // Disable this call; the viewport subwindow is already defined - -}; - -#endif /* NCURSES_CURSESW_H_incl */ diff --git a/c++/cursslk.cc b/c++/cursslk.cc deleted file mode 100644 index cfbc9da42da..00000000000 --- a/c++/cursslk.cc +++ /dev/null @@ -1,132 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#include "internal.h" -#include "cursslk.h" -#include "cursesapp.h" - -MODULE_ID("$Id: cursslk.cc,v 1.15 2005/08/06 22:12:36 tom Exp $") - -Soft_Label_Key_Set::Soft_Label_Key& - Soft_Label_Key_Set::Soft_Label_Key::operator=(char *text) -{ - delete[] label; - label = new char[1 + ::strlen(text)]; - (::strcpy)(label,text); - return *this; -} - -long Soft_Label_Key_Set::count = 0L; -int Soft_Label_Key_Set::num_labels = 0; - -Soft_Label_Key_Set::Label_Layout - Soft_Label_Key_Set::format = None; - -void Soft_Label_Key_Set::init() -{ - slk_array = new Soft_Label_Key[num_labels]; - for(int i=0; i < num_labels; i++) { - slk_array[i].num = i+1; - } - b_attrInit = FALSE; -} - -Soft_Label_Key_Set::Soft_Label_Key_Set() - : b_attrInit(FALSE), - slk_array(NULL) -{ - if (format==None) - Error("No default SLK layout"); - init(); -} - -Soft_Label_Key_Set::Soft_Label_Key_Set(Soft_Label_Key_Set::Label_Layout fmt) - : b_attrInit(FALSE), - slk_array(NULL) -{ - if (fmt==None) - Error("Invalid SLK Layout"); - if (count++==0) { - format = fmt; - if (ERR == ::slk_init(static_cast(fmt))) - Error("slk_init"); - num_labels = (fmt>=PC_Style?12:8); - } - else if (fmt!=format) - Error("All SLKs must have same layout"); - init(); -} - -Soft_Label_Key_Set::~Soft_Label_Key_Set() { - if (!::isendwin()) - clear(); - delete[] slk_array; - count--; -} - -Soft_Label_Key_Set::Soft_Label_Key& Soft_Label_Key_Set::operator[](int i) { - if (i<1 || i>num_labels) - Error("Invalid Label index"); - return slk_array[i-1]; -} - -void Soft_Label_Key_Set::activate_label(int i, bool bf) { - if (!b_attrInit) { - NCursesApplication* A = NCursesApplication::getApplication(); - if (A) attrset(A->labels()); - b_attrInit = TRUE; - } - Soft_Label_Key& K = (*this)[i]; - if (ERR==::slk_set(K.num,bf?K.label:"",K.format)) - Error("slk_set"); - noutrefresh(); -} - -void Soft_Label_Key_Set::activate_labels(bool bf) -{ - if (!b_attrInit) { - NCursesApplication* A = NCursesApplication::getApplication(); - if (A) attrset(A->labels()); - b_attrInit = TRUE; - } - for(int i=1; i <= num_labels; i++) { - Soft_Label_Key& K = (*this)[i]; - if (ERR==::slk_set(K.num,bf?K.label:"",K.format)) - Error("slk_set"); - } - if (bf) - restore(); - else - clear(); - noutrefresh(); -} diff --git a/c++/cursslk.h b/c++/cursslk.h deleted file mode 100644 index 091695eef27..00000000000 --- a/c++/cursslk.h +++ /dev/null @@ -1,238 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $ - -#ifndef NCURSES_CURSSLK_H_incl -#define NCURSES_CURSSLK_H_incl - -#include - -class NCURSES_IMPEXP Soft_Label_Key_Set { -public: - // This inner class represents the attributes of a Soft Label Key (SLK) - class NCURSES_IMPEXP Soft_Label_Key { - friend class Soft_Label_Key_Set; - public: - typedef enum { Left=0, Center=1, Right=2 } Justification; - - private: - char *label; // The Text of the Label - Justification format; // The Justification - int num; // The number of the Label - - Soft_Label_Key() : label(NULL), format(Left), num(-1) { - } - - virtual ~Soft_Label_Key() { - delete[] label; - }; - - public: - // Set the text of the Label - Soft_Label_Key& operator=(char *text); - - // Set the Justification of the Label - Soft_Label_Key& operator=(Justification just) { - format = just; - return *this; - } - - // Retrieve the text of the label - inline char* operator()(void) const { - return label; - } - - Soft_Label_Key& operator=(const Soft_Label_Key& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - Soft_Label_Key(const Soft_Label_Key& rhs) - : label(NULL), - format(rhs.format), - num(rhs.num) - { - *this = rhs.label; - } - }; - -public: - typedef enum { - None = -1, - Three_Two_Three = 0, - Four_Four = 1, - PC_Style = 2, - PC_Style_With_Index = 3 - } Label_Layout; - -private: - static long NCURSES_IMPEXP count; // Number of Key Sets - static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets - static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets - bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized - - Soft_Label_Key *slk_array; // The array of SLK's - - // Init the Key Set - void init(); - - // Activate or Deactivate Label# i, Label counting starts with 1! - void activate_label(int i, bool bf=TRUE); - - // Activate of Deactivate all Labels - void activate_labels(bool bf); - -protected: - inline void Error (const char* msg) const THROWS(NCursesException) { - THROW(new NCursesException (msg)); - } - - // Remove SLK's from screen - void clear() { - if (ERR==::slk_clear()) - Error("slk_clear"); - } - - // Restore them - void restore() { - if (ERR==::slk_restore()) - Error("slk_restore"); - } - -public: - - // Construct a Key Set, use the most comfortable layout as default. - // You must create a Soft_Label_Key_Set before you create any object of - // the NCursesWindow, NCursesPanel or derived classes. (Actually before - // ::initscr() is called). - Soft_Label_Key_Set(Label_Layout fmt); - - // This constructor assumes, that you already constructed a Key Set - // with a layout by the constructor above. This layout will be reused. - NCURSES_IMPEXP Soft_Label_Key_Set(); - - Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) - { - if (this != &rhs) { - *this = rhs; - init(); // allocate a new slk_array[] - } - return *this; - } - - Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs) - : b_attrInit(rhs.b_attrInit), - slk_array(NULL) - { - init(); // allocate a new slk_array[] - } - - virtual ~Soft_Label_Key_Set(); - - // Get Label# i. Label counting starts with 1! - NCURSES_IMPEXP Soft_Label_Key& operator[](int i); - - // Retrieve number of Labels - inline int labels() const { return num_labels; } - - // Refresh the SLK portion of the screen - inline void refresh() { - if (ERR==::slk_refresh()) - Error("slk_refresh"); - } - - // Mark the SLK portion of the screen for refresh, defer actual refresh - // until next update call. - inline void noutrefresh() { - if (ERR==::slk_noutrefresh()) - Error("slk_noutrefresh"); - } - - // Mark the whole SLK portion of the screen as modified - inline void touch() { - if (ERR==::slk_touch()) - Error("slk_touch"); - } - - // Activate Label# i - inline void show(int i) { - activate_label(i,FALSE); - activate_label(i,TRUE); - } - - // Hide Label# i - inline void hide(int i) { - activate_label(i,FALSE); - } - - // Show all Labels - inline void show() { - activate_labels(FALSE); - activate_labels(TRUE); - } - - // Hide all Labels - inline void hide() { - activate_labels(FALSE); - } - - inline void attron(attr_t attrs) { - if (ERR==::slk_attron(attrs)) - Error("slk_attron"); - } - - inline void attroff(attr_t attrs) { - if (ERR==::slk_attroff(attrs)) - Error("slk_attroff"); - } - - inline void attrset(attr_t attrs) { - if (ERR==::slk_attrset(attrs)) - Error("slk_attrset"); - } - - inline void color(short color_pair_number) { - if (ERR==::slk_color(color_pair_number)) - Error("slk_color"); - } - - inline attr_t attr() const { - return ::slk_attr(); - } -}; - -#endif /* NCURSES_CURSSLK_H_incl */ diff --git a/c++/demo.cc b/c++/demo.cc deleted file mode 100644 index 35433425f1f..00000000000 --- a/c++/demo.cc +++ /dev/null @@ -1,569 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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. * - ****************************************************************************/ - -/* - * Silly demo program for the NCursesPanel class. - * - * written by Anatoly Ivasyuk (anatoly@nick.csh.rit.edu) - * - * Demo code for NCursesMenu and NCursesForm written by - * Juergen Pfeifer - * - * $Id: demo.cc,v 1.39 2008/12/07 02:07:34 juergen Exp $ - */ - -#include "internal.h" -#include "cursesapp.h" -#include "cursesm.h" -#include "cursesf.h" - -#ifdef __MINGW32__ -#undef KEY_EVENT -#endif - -#ifndef __MINGW32__ -extern "C" unsigned int sleep(unsigned int); -#endif - -#undef index // needed for NeXT - -// -// ------------------------------------------------------------------------- -// -class SillyDemo -{ - public: - void run(int sleeptime) { - - NCursesPanel *mystd = new NCursesPanel(); - - // Make a few small demo panels - - NCursesPanel *u = new NCursesPanel(8, 20, 12, 4); - NCursesPanel *v = new NCursesPanel(8, 20, 10, 6); - NCursesPanel *w = new NCursesPanel(8, 20, 8, 8); - NCursesPanel *x = new NCursesPanel(8, 20, 6, 10); - NCursesPanel *y = new NCursesPanel(8, 20, 4, 12); - NCursesPanel *z = new NCursesPanel(8, 30, 2, 14); - - // Draw something on the main screen, so we can see what happens - // when panels get moved or deleted. - - mystd->box(); - mystd->move(mystd->height()/2, 1); - mystd->hline(mystd->width()-2); - mystd->move(1, mystd->width()/2); - mystd->vline(mystd->height()-2); - mystd->addch(0, mystd->width()/2, ACS_TTEE); - mystd->addch(mystd->height()-1, mystd->width()/2, ACS_BTEE); - mystd->addch(mystd->height()/2, 0, ACS_LTEE); - mystd->addch(mystd->height()/2, mystd->width()-1, ACS_RTEE); - mystd->addch(mystd->height()/2, mystd->width()/2, ACS_PLUS); - - // Draw frames with titles around panels so that we can see where - // the panels are located. - u->boldframe("Win U"); - v->frame("Win V"); - w->boldframe("Win W"); - x->frame("Win X"); - y->boldframe("Win Y"); - z->frame("Win Z"); - if (NCursesApplication::getApplication()->useColors()) { - u->bkgd(' '|COLOR_PAIR(1)); - w->bkgd(' '|COLOR_PAIR(1)); - y->bkgd(' '|COLOR_PAIR(1)); - v->bkgd(' '|COLOR_PAIR(2)); - x->bkgd(' '|COLOR_PAIR(2)); - z->bkgd(' '|COLOR_PAIR(2)); - } - - // A refresh to any valid panel updates all panels and refreshes - // the screen. Using mystd is just convenient - We know it's always - // valid until the end of the program. - - mystd->refresh(); - sleep(sleeptime); - - // Show what happens when panels are deleted and moved. - - sleep(sleeptime); - delete u; - mystd->refresh(); - - sleep(sleeptime); - delete z; - mystd->refresh(); - - sleep(sleeptime); - delete v; - mystd->refresh(); - - // show how it looks when a panel moves - sleep(sleeptime); - y->mvwin(5, 30); - mystd->refresh(); - - sleep(sleeptime); - delete y; - mystd->refresh(); - - // show how it looks when you raise a panel - sleep(sleeptime); - w->top(); - mystd->refresh(); - - sleep(sleeptime); - delete w; - mystd->refresh(); - - sleep(sleeptime); - delete x; - - mystd->clear(); - mystd->refresh(); - - // Don't forget to clean up the main screen. Since this is the - // last thing using NCursesWindow, this has the effect of - // shutting down ncurses and restoring the terminal state. - - sleep(sleeptime); - delete mystd; - } -}; - -class UserData -{ -private: - int u; -public: - UserData(int x) : u(x) {} - int sleeptime() const { return u; } -}; -// -// ------------------------------------------------------------------------- -// -template class MyAction : public NCursesUserItem -{ -public: - MyAction (const char* p_name, - const T* p_UserData) - : NCursesUserItem(p_name, static_cast(0), p_UserData) - {} - - virtual ~MyAction() {} - - bool action() { - SillyDemo a; - a.run(NCursesUserItem::UserData()->sleeptime()); - return FALSE; - } -}; - -template class MyAction; -template class NCURSES_IMPEXP NCursesUserItem; - -class QuitItem : public NCursesMenuItem -{ -public: - QuitItem() : NCursesMenuItem("Quit") { - } - - bool action() { - return TRUE; - } -}; -// -// ------------------------------------------------------------------------- -// -class Label : public NCursesFormField -{ -public: - Label(const char* title, - int row, int col) - : NCursesFormField(1, static_cast(::strlen(title)), row, col) { - set_value(title); - options_off(O_EDIT|O_ACTIVE); - } -}; -// -// ------------------------------------------------------------------------- -// -class MyFieldType : public UserDefinedFieldType -{ -private: - int chk; -protected: - bool field_check(NCursesFormField& f) { - return TRUE; - } - bool char_check(int c) { - return (c==chk?TRUE:FALSE); - } -public: - MyFieldType(int x) : chk(x) { - } -}; -// -// ------------------------------------------------------------------------- -// -class TestForm : public NCursesForm -{ -private: - NCursesFormField** F; - MyFieldType* mft; - Integer_Field *ift; - Enumeration_Field *eft; - - static const char *weekdays[]; - -public: - TestForm() - : NCursesForm(13, 51, (lines() - 15)/2, (cols() - 53)/2), - F(0), - mft(0), - ift(0), - eft(0) - { - - F = new NCursesFormField*[10]; - mft = new MyFieldType('X'); - ift = new Integer_Field(0, 1, 10); - eft = new Enumeration_Field(weekdays); - - F[0] = new Label("Demo Entry Form", 0, 16); - F[1] = new Label("Weekday Enum", 2, 1); - F[2] = new Label("Number(1-10)", 2, 21); - F[3] = new Label("Only 'X'", 2, 35); - F[4] = new Label("Multiline Field (Dynamic and Scrollable)", 5, 1); - F[5] = new NCursesFormField(1, 18, 3, 1); - F[6] = new NCursesFormField(1, 12, 3, 21); - F[7] = new NCursesFormField(1, 12, 3, 35); - F[8] = new NCursesFormField(4, 46, 6, 1, 2); - F[9] = new NCursesFormField(); - - InitForm(F, TRUE, TRUE); - boldframe(); - - F[5]->set_fieldtype(*eft); - F[6]->set_fieldtype(*ift); - - F[7]->set_fieldtype(*mft); - F[7]->set_maximum_growth(20); // max. 20 characters - F[7]->options_off(O_STATIC); // make field dynamic - - F[8]->set_maximum_growth(10); // max. 10 lines - F[8]->options_off(O_STATIC); // make field dynamic - } - - TestForm& operator=(const TestForm& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - TestForm(const TestForm& rhs) - : NCursesForm(rhs), F(0), mft(0), ift(0), eft(0) - { - } - - ~TestForm() { - delete mft; - delete ift; - delete eft; - } -}; - -const char* TestForm::weekdays[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", - "Friday", "Saturday", NULL }; -// -// ------------------------------------------------------------------------- -// -class FormAction : public NCursesMenuItem -{ -public: - FormAction(const char *s) : NCursesMenuItem(s) { - } - - bool action() { - TestForm F; - Soft_Label_Key_Set* S = new Soft_Label_Key_Set; - for(int i=1; i <= S->labels(); i++) { - char buf[8]; - assert(i < 100); - ::sprintf(buf, "Frm%02d", i); - (*S)[i] = buf; // Text - (*S)[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification - } - NCursesApplication::getApplication()->push(*S); - F(); - NCursesApplication::getApplication()->pop(); - delete S; - return FALSE; - } -}; -// -// ------------------------------------------------------------------------- -// -class PadAction : public NCursesMenuItem -{ -public: - PadAction(const char* s) : NCursesMenuItem(s) { - } - - bool action() { - const int GRIDSIZE = 3; - const int PADSIZE = 200; - unsigned gridcount = 0; - - NCursesPanel mystd; - NCursesPanel P(mystd.lines()-2, mystd.cols()-2, 1, 1); - NCursesFramedPad FP(P, PADSIZE, PADSIZE); - - for (int i=0; i < PADSIZE; i++) { - for (int j=0; j < PADSIZE; j++) { - if (i % GRIDSIZE == 0 && j % GRIDSIZE == 0) { - if (i==0 || j==0) - FP.addch('+'); - else - FP.addch(static_cast('A' + (gridcount++ % 26))); - } - else if (i % GRIDSIZE == 0) - FP.addch('-'); - else if (j % GRIDSIZE == 0) - FP.addch('|'); - else - FP.addch(' '); - } - } - - P.label("Pad Demo", NULL); - FP(); - P.clear(); - return FALSE; - } -}; - -// -// ------------------------------------------------------------------------- -// -class PassiveItem : public NCursesMenuItem -{ -public: - PassiveItem(const char* text) : NCursesMenuItem(text) { - options_off(O_SELECTABLE); - } -}; - -// -// ------------------------------------------------------------------------- -// -class ScanAction : public NCursesMenuItem -{ -public: - ScanAction(const char* s) : NCursesMenuItem(s) { - } - - bool action() { - NCursesPanel *mystd = new NCursesPanel(); - - NCursesPanel *w = new NCursesPanel(mystd->lines() - 2, mystd->cols() - 2, 1, 1); - w->box(); - w->refresh(); - - NCursesPanel *s = new NCursesPanel(w->lines() - 6, w->cols() - 6, 3, 3); - s->scrollok(TRUE); - ::echo(); - - s->printw("Enter decimal integers. The running total will be shown\n"); - int nvalue = -1; - int result = 0; - while (nvalue != 0) { - nvalue = 0; - s->scanw("%d", &nvalue); - if (nvalue != 0) { - s->printw("%d: ", result += nvalue); - } - s->refresh(); - } - s->printw("\nPress any key to continue..."); - s->getch(); - - delete s; - delete w; - delete mystd; - ::noecho(); - return FALSE; - } -}; - -// -// ------------------------------------------------------------------------- -// -class MyMenu : public NCursesMenu -{ -private: - NCursesPanel* P; - NCursesMenuItem** I; - UserData *u; - #define n_items 7 - -public: - MyMenu () - : NCursesMenu (n_items+2, 8, (lines()-10)/2, (cols()-10)/2), - P(0), I(0), u(0) - { - u = new UserData(1); - I = new NCursesMenuItem*[1+n_items]; - I[0] = new PassiveItem("One"); - I[1] = new PassiveItem("Two"); - I[2] = new MyAction ("Silly", u); - I[3] = new FormAction("Form"); - I[4] = new PadAction("Pad"); - I[5] = new ScanAction("Scan"); - I[6] = new QuitItem(); - I[7] = new NCursesMenuItem(); // Terminating empty item - - InitMenu(I, TRUE, TRUE); - - P = new NCursesPanel(1, n_items, LINES-1, 1); - boldframe("Demo", "Silly"); - P->show(); - } - - MyMenu& operator=(const MyMenu& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - MyMenu(const MyMenu& rhs) - : NCursesMenu(rhs), P(0), I(0), u(0) - { - } - - ~MyMenu() - { - P->hide(); - delete P; - delete u; - } - - virtual void On_Menu_Init() - { - NCursesWindow W(::stdscr); - P->move(0, 0); - P->clrtoeol(); - for(int i=1; i<=count(); i++) - P->addch('0' + i); - P->bkgd(W.getbkgd()); - refresh(); - } - - virtual void On_Menu_Termination() - { - P->move(0, 0); - P->clrtoeol(); - refresh(); - } - - virtual void On_Item_Init(NCursesMenuItem& item) - { - P->move(0, item.index()); - P->attron(A_REVERSE); - P->printw("%1d", 1+item.index()); - P->attroff(A_REVERSE); - refresh(); - } - - virtual void On_Item_Termination(NCursesMenuItem& item) - { - P->move(0, item.index()); - P->attroff(A_REVERSE); - P->printw("%1d", 1+item.index()); - refresh(); - } -}; -// -// ------------------------------------------------------------------------- -// -class TestApplication : public NCursesApplication -{ -protected: - int titlesize() const { return 1; } - void title(); - Soft_Label_Key_Set::Label_Layout useSLKs() const { - return Soft_Label_Key_Set::PC_Style_With_Index; - } - void init_labels(Soft_Label_Key_Set& S) const; - -public: - TestApplication() : NCursesApplication(TRUE) { - } - - int run(); -}; - -void TestApplication::init_labels(Soft_Label_Key_Set& S) const -{ - for(int i=1; i <= S.labels(); i++) { - char buf[8]; - assert(i < 100); - ::sprintf(buf, "Key%02d", i); - S[i] = buf; // Text - S[i] = Soft_Label_Key_Set::Soft_Label_Key::Left; // Justification - } -} - -void TestApplication::title() -{ - const char * const titleText = "Simple C++ Binding Demo"; - const int len = ::strlen(titleText); - - titleWindow->bkgd(screen_titles()); - titleWindow->addstr(0, (titleWindow->cols() - len)/2, titleText); - titleWindow->noutrefresh(); -} - - -int TestApplication::run() -{ - MyMenu M; - M(); - return 0; -} - -// -// ------------------------------------------------------------------------- -// -static TestApplication *Demo = new TestApplication(); diff --git a/c++/etip.h.in b/c++/etip.h.in deleted file mode 100644 index 20642a60ec7..00000000000 --- a/c++/etip.h.in +++ /dev/null @@ -1,378 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: etip.h.in,v 1.37 2008/08/30 19:27:32 tom Exp $ - -#ifndef NCURSES_ETIP_H_incl -#define NCURSES_ETIP_H_incl 1 - -// These are substituted at configure/build time -#ifndef HAVE_BUILTIN_H -#define HAVE_BUILTIN_H 0 -#endif - -#ifndef HAVE_GXX_BUILTIN_H -#define HAVE_GXX_BUILTIN_H 0 -#endif - -#ifndef HAVE_GPP_BUILTIN_H -#define HAVE_GPP_BUILTIN_H 0 -#endif - -#ifndef HAVE_IOSTREAM -#define HAVE_IOSTREAM 0 -#endif - -#ifndef HAVE_TYPEINFO -#define HAVE_TYPEINFO 0 -#endif - -#ifndef HAVE_VALUES_H -#define HAVE_VALUES_H 0 -#endif - -#ifndef ETIP_NEEDS_MATH_H -#define ETIP_NEEDS_MATH_H 0 -#endif - -#ifndef ETIP_NEEDS_MATH_EXCEPTION -#define ETIP_NEEDS_MATH_EXCEPTION 0 -#endif - -#ifndef CPP_HAS_PARAM_INIT -#define CPP_HAS_PARAM_INIT 0 -#endif - -#ifndef CPP_HAS_STATIC_CAST -#define CPP_HAS_STATIC_CAST 0 // workaround for g++ 2.95.3 -#endif - -#ifndef IOSTREAM_NAMESPACE -#define IOSTREAM_NAMESPACE 0 -#endif - -#ifdef __GNUG__ -# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) -# if HAVE_TYPEINFO -# include -# endif -# endif -#endif - -#if defined(__GNUG__) -# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H -# if ETIP_NEEDS_MATH_H -# if ETIP_NEEDS_MATH_EXCEPTION -# undef exception -# define exception math_exception -# endif -# include -# endif -# undef exception -# define exception builtin_exception -# if HAVE_GPP_BUILTIN_H -# include -# elif HAVE_GXX_BUILTIN_H -# include -# else -# include -# endif -# undef exception -# endif -#elif defined (__SUNPRO_CC) -# include -#endif - -#include - -extern "C" { -#if HAVE_VALUES_H -# include -#endif - -#include -#include -#include -} - -// Language features -#if CPP_HAS_PARAM_INIT -#define NCURSES_PARAM_INIT(value) = value -#else -#define NCURSES_PARAM_INIT(value) /*nothing*/ -#endif - -#if CPP_HAS_STATIC_CAST -#define STATIC_CAST(s) static_cast -#else -#define STATIC_CAST(s) (s) -#endif - -// Forward Declarations -class NCURSES_IMPEXP NCursesPanel; -class NCURSES_IMPEXP NCursesMenu; -class NCURSES_IMPEXP NCursesForm; - -class NCURSES_IMPEXP NCursesException -{ -public: - const char *message; - int errorno; - - NCursesException (const char* msg, int err) - : message(msg), errorno (err) - {}; - - NCursesException (const char* msg) - : message(msg), errorno (E_SYSTEM_ERROR) - {}; - - NCursesException& operator=(const NCursesException& rhs) - { - errorno = rhs.errorno; - return *this; - } - - NCursesException(const NCursesException& rhs) - : message(rhs.message), errorno(rhs.errorno) - { - } - - virtual const char *classname() const { - return "NCursesWindow"; - } - - virtual ~NCursesException() - { - } -}; - -class NCURSES_IMPEXP NCursesPanelException : public NCursesException -{ -public: - const NCursesPanel* p; - - NCursesPanelException (const char *msg, int err) : - NCursesException (msg, err), - p (NULL) - {}; - - NCursesPanelException (const NCursesPanel* panel, - const char *msg, - int err) : - NCursesException (msg, err), - p (panel) - {}; - - NCursesPanelException (int err) : - NCursesException ("panel library error", err), - p (NULL) - {}; - - NCursesPanelException (const NCursesPanel* panel, - int err) : - NCursesException ("panel library error", err), - p (panel) - {}; - - NCursesPanelException& operator=(const NCursesPanelException& rhs) - { - if (this != &rhs) { - NCursesException::operator=(rhs); - p = rhs.p; - } - return *this; - } - - NCursesPanelException(const NCursesPanelException& rhs) - : NCursesException(rhs), p(rhs.p) - { - } - - virtual const char *classname() const { - return "NCursesPanel"; - } - - virtual ~NCursesPanelException() - { - } -}; - -class NCURSES_IMPEXP NCursesMenuException : public NCursesException -{ -public: - const NCursesMenu* m; - - NCursesMenuException (const char *msg, int err) : - NCursesException (msg, err), - m (NULL) - {}; - - NCursesMenuException (const NCursesMenu* menu, - const char *msg, - int err) : - NCursesException (msg, err), - m (menu) - {}; - - NCursesMenuException (int err) : - NCursesException ("menu library error", err), - m (NULL) - {}; - - NCursesMenuException (const NCursesMenu* menu, - int err) : - NCursesException ("menu library error", err), - m (menu) - {}; - - NCursesMenuException& operator=(const NCursesMenuException& rhs) - { - if (this != &rhs) { - NCursesException::operator=(rhs); - m = rhs.m; - } - return *this; - } - - NCursesMenuException(const NCursesMenuException& rhs) - : NCursesException(rhs), m(rhs.m) - { - } - - virtual const char *classname() const { - return "NCursesMenu"; - } - - virtual ~NCursesMenuException() - { - } -}; - -class NCURSES_IMPEXP NCursesFormException : public NCursesException -{ -public: - const NCursesForm* f; - - NCursesFormException (const char *msg, int err) : - NCursesException (msg, err), - f (NULL) - {}; - - NCursesFormException (const NCursesForm* form, - const char *msg, - int err) : - NCursesException (msg, err), - f (form) - {}; - - NCursesFormException (int err) : - NCursesException ("form library error", err), - f (NULL) - {}; - - NCursesFormException (const NCursesForm* form, - int err) : - NCursesException ("form library error", err), - f (form) - {}; - - NCursesFormException& operator=(const NCursesFormException& rhs) - { - if (this != &rhs) { - NCursesException::operator=(rhs); - f = rhs.f; - } - return *this; - } - - NCursesFormException(const NCursesFormException& rhs) - : NCursesException(rhs), f(rhs.f) - { - } - - virtual const char *classname() const { - return "NCursesForm"; - } - - virtual ~NCursesFormException() - { - } -}; - -#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC)) -# if HAVE_IOSTREAM -# include -# if IOSTREAM_NAMESPACE -using std::cerr; -using std::endl; -# endif -# else -# include -# endif - extern "C" void exit(int); -#endif - -inline void THROW(const NCursesException *e) { -#if defined(__GNUG__) && defined(__EXCEPTIONS) -# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) - (*lib_error_handler)(e ? e->classname() : "", e ? e->message : ""); -#else -#define CPP_HAS_TRY_CATCH 1 -#endif -#elif defined(__SUNPRO_CC) -# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) - genericerror(1, ((e != 0) ? (char *)(e->message) : "")); -#else -#define CPP_HAS_TRY_CATCH 1 -#endif -#else - if (e) - cerr << e->message << endl; - exit(0); -#endif - -#ifndef CPP_HAS_TRY_CATCH -#define CPP_HAS_TRY_CATCH 0 -#define NCURSES_CPP_TRY /* nothing */ -#define NCURSES_CPP_CATCH(e) if (false) -#define THROWS(s) /* nothing */ -#elif CPP_HAS_TRY_CATCH - throw *e; -#define NCURSES_CPP_TRY try -#define NCURSES_CPP_CATCH(e) catch(e) -#define THROWS(s) throw(s) -#endif -} - -#endif /* NCURSES_ETIP_H_incl */ diff --git a/c++/headers b/c++/headers deleted file mode 100644 index 0be0311bd9c..00000000000 --- a/c++/headers +++ /dev/null @@ -1,40 +0,0 @@ -# C++ headers -# $Id: headers,v 1.3 2006/12/24 16:25:45 tom Exp $ -############################################################################## -# Copyright (c) 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 "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 1997 -# -$(srcdir)/cursesapp.h -$(srcdir)/cursesf.h -$(srcdir)/cursesm.h -$(srcdir)/cursesp.h -$(srcdir)/cursesw.h -$(srcdir)/cursslk.h -etip.h -# vile:makemode diff --git a/c++/internal.h b/c++/internal.h deleted file mode 100644 index 64d57cd712d..00000000000 --- a/c++/internal.h +++ /dev/null @@ -1,65 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: internal.h,v 1.17 2008/12/07 02:07:34 juergen Exp $ - -#ifndef NCURSES_CPLUS_INTERNAL_H -#define NCURSES_CPLUS_INTERNAL_H 1 - -#include - -#if USE_RCS_IDS -#define MODULE_ID(id) static const char Ident[] = id; -#else -#define MODULE_ID(id) /*nothing*/ -#endif - -#ifdef __MINGW32__ -#include -#undef KEY_EVENT -#endif - -#ifndef _QNX_SOURCE -#include -#include -#endif - -#ifndef CTRL -#define CTRL(x) ((x) & 0x1f) -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#endif /* NCURSES_CPLUS_INTERNAL_H */ diff --git a/c++/modules b/c++/modules deleted file mode 100644 index bc4fae59925..00000000000 --- a/c++/modules +++ /dev/null @@ -1,45 +0,0 @@ -# Program modules -# $Id: modules,v 1.7 2006/12/24 00:53:08 tom Exp $ -############################################################################## -# Copyright (c) 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 "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 1995-on -# - -@ base -cursesf c++ $(srcdir) $(cursesf_h) $(cursesapp_h) -cursesm c++ $(srcdir) $(cursesm_h) $(cursesapp_h) -cursesp c++ $(srcdir) $(cursesp_h) -cursesw c++ $(srcdir) $(cursesw_h) -cursespad c++ $(srcdir) $(cursesw_h) -cursslk c++ $(srcdir) $(cursslk_h) $(cursesapp_h) -cursesapp c++ $(srcdir) $(cursesapp_h) -cursesmain c++ $(srcdir) $(cursesapp_h) -demo c++ $(srcdir) $(cursesf_h) $(cursesm_h) $(cursesapp_h) - -# vile:makemode diff --git a/config.guess b/config.guess index bec935b96fc..c7607c74f1b 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2010-09-24' +timestamp='2008-04-14' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2010-09-24' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,9 +56,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -92,7 +91,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' HUP INT TERM +trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -106,7 +105,7 @@ trap 'exit 1' HUP INT TERM set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -171,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ + | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -181,7 +180,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -220,11 +219,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -296,7 +295,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -325,33 +324,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -395,23 +375,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -481,8 +461,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -552,7 +532,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[4567]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -595,8 +575,8 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 @@ -660,7 +640,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ + grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else @@ -731,22 +711,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -770,14 +750,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -805,30 +785,27 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - authenticamd | genuineintel | EM64T) + EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -858,24 +835,10 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ - grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else @@ -892,18 +855,7 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -914,34 +866,75 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:* | mips64:Linux:*:*) + mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + CPU=mips #else CPU= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -950,17 +943,14 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -968,9 +958,6 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu - exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -978,8 +965,68 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -987,11 +1034,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1008,7 +1055,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1023,7 +1070,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1051,13 +1098,10 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1092,18 +1136,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1116,7 +1150,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1137,9 +1171,9 @@ EOF fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1169,7 +1203,7 @@ EOF else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1209,16 +1243,6 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1226,17 +1250,14 @@ EOF *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1282,13 +1303,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1303,9 +1324,6 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/config.sub b/config.sub index de11910f0b1..a649350a6ca 100755 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2010-09-11' +timestamp='2008-06-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,16 +32,13 @@ timestamp='2010-09-11' # Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -75,9 +72,8 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -124,10 +120,8 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -154,13 +148,10 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; - -bluegene*) - os=-cnk - ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -258,7 +249,6 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ - | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -280,41 +270,28 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ - | moxie \ | mt \ | msp430 \ - | nds32 | nds32le | nds32be\ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ + | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) + | z8k) basic_machine=$basic_machine-unknown ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) + m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -329,8 +306,8 @@ case $basic_machine in # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; + basic_machine=$basic_machine-pc + ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 @@ -345,7 +322,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -354,10 +331,9 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ - | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -379,30 +355,27 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ - | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-* | z80-*) + | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -424,7 +397,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -470,10 +443,6 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; - aros) - basic_machine=i386-pc - os=-aros - ;; aux) basic_machine=m68k-apple os=-aux @@ -490,24 +459,11 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -755,9 +711,6 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) - basic_machine=microblaze-xilinx - ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -862,12 +815,6 @@ case $basic_machine in np1) basic_machine=np1-gould ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -1102,10 +1049,17 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff ;; tile*) basic_machine=tile-unknown @@ -1186,10 +1140,6 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1228,7 +1178,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1275,12 +1225,9 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1301,11 +1248,10 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1316,8 +1262,7 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1325,7 +1270,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1364,7 +1309,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1413,7 +1358,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1458,8 +1403,6 @@ case $os in -dicos*) os=-dicos ;; - -nacl*) - ;; -none) ;; *) @@ -1482,10 +1425,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1497,17 +1440,8 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1534,7 +1468,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1561,7 +1495,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) @@ -1666,7 +1600,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -cnk*|-aix*) + -aix*) vendor=ibm ;; -beos*) diff --git a/configure b/configure index 639b790dc3a..1342387ce63 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.520 . +# From configure.in Revision: 1.454 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20101002. +# Generated by Autoconf 2.52.20080325. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -697,12 +697,8 @@ Optional Features: --without-cxx do not adjust ncurses bool to match C++ --without-cxx-binding do not build C++ binding and demo --without-ada suppress check for Ada95, don't build demo - --without-manpages suppress install of manpages --without-progs suppress build with programs (e.g., tic) - --without-tests suppress build with test-programs --without-curses-h install curses.h as ncurses.h only - --with-pkg-config{=path} enable/disable use of pkg-config - --enable-pc-files generate and install .pc files for pkg-config --enable-mixed-case tic should assume mixed-case filenames --with-install-prefix prefixes actual install-location ($DESTDIR) Build-Tools Needed to Compile Temporary Applications for Cross-compiling: @@ -713,7 +709,6 @@ Build-Tools Needed to Compile Temporary Applications for Cross-compiling: --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS) --with-build-libs=XXX the build libraries (${BUILD_LIBS}) Options to Specify the Libraries Built/Used: - --disable-libtool-version enable to use libtool's incompatible naming scheme --with-libtool generate libraries with libtool --with-shared generate shared-libraries --with-normal generate normal-libraries (default) @@ -727,7 +722,6 @@ Options to Specify the Libraries Built/Used: --enable-rpath use rpath option when generating shared libraries --disable-relink relink shared libraries during install --with-shlib-version=X Specify rel or abi version for shared libs - --disable-rpath-hack don't add rpath options for additional libraries Fine-Tuning Your Configuration: --disable-overwrite leave out the link to -lcurses --disable-database do not use terminfo, only fallbacks/termcap @@ -758,7 +752,6 @@ Fine-Tuning Your Configuration: --with-chtype=TYPE override type of chtype --with-ospeed=TYPE override type of ospeed variable --with-mmask-t=TYPE override type of mmask_t - --with-ccharw-max=XXX override size CCHARW_MAX --with-rcs-ids compile-in RCS identifiers Options to Specify How Manpages are Installed: --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and @@ -769,8 +762,6 @@ Options to Specify How Manpages are Installed: --with-manpage-tbl specify manpage processing with tbl Extensions: --disable-ext-funcs disable function-extensions - --enable-sp-funcs enable experimental SCREEN-extensions - --enable-term-driver enable experimental terminal-driver --enable-const compile with extra/non-standard const --enable-ext-colors compile for 256-color support --enable-ext-mouse compile for extended mouse-encoding @@ -785,13 +776,10 @@ Development Code: Experimental Code: --disable-assumed-color do not assume anything about default-colors --disable-hashmap compile without hashmap scrolling-optimization - --enable-colorfgbg compile-in experimental $COLORFGBG code - --enable-interop compile-in experimental interop bindings + --enable-colorfgbg compile with $COLORFGBG code --with-pthread use POSIX thread library - --enable-pthreads-eintr enable EINTR in wgetch with pthreads --enable-weak-symbols enable weak-symbols for pthreads --enable-reentrant compile with experimental reentrant code - --with-wrap-prefix=XXX override prefix used for public variables --enable-safe-sprintf compile with experimental safe-sprintf code --disable-scroll-hints compile without scroll-hints code --enable-wgetch-events compile with experimental wgetch-events code @@ -808,9 +796,8 @@ Testing/development Options: --with-trace test: add trace() function to all models of ncurses Ada95 Binding Options: --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake) - --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/share/ada/adainclude) + --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/lib/ada/adainclude) --with-ada-objects=DIR Ada objects are in DIR (default: PREFIX/lib/ada/adalib) - --with-ada-sharedlib=XX build Ada95 shared-library Some influential environment variables: CC C compiler command @@ -883,7 +870,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.20101002. Invocation command line was +generated by GNU Autoconf 2.52.20080325. Invocation command line was $ $0 $@ @@ -1007,7 +994,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:1010: loading site script $ac_site_file" >&5 + { echo "$as_me:997: 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" @@ -1018,7 +1005,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:1021: loading cache $cache_file" >&5 + { echo "$as_me:1008: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -1026,7 +1013,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:1029: creating cache $cache_file" >&5 + { echo "$as_me:1016: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1042,21 +1029,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:1045: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:1032: 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:1049: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:1036: 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:1055: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:1042: 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:1057: former value: $ac_old_val" >&5 + { echo "$as_me:1044: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:1059: current value: $ac_new_val" >&5 + { echo "$as_me:1046: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -1075,9 +1062,9 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:1078: error: changes in the environment can compromise the build" >&5 + { echo "$as_me:1065: 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:1080: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:1067: 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 @@ -1098,10 +1085,10 @@ esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:1101: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:1088: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:1104: \$? = $ac_status" >&5 + echo "$as_me:1091: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else @@ -1114,7 +1101,7 @@ ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg. top_builddir=`pwd` -echo "$as_me:1117: checking for egrep" >&5 +echo "$as_me:1104: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1124,11 +1111,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:1127: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:1114: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:1131: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:1118: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -1138,7 +1125,7 @@ NCURSES_PATCH="`$ac_cv_prog_egrep '^NCURSES_PATCH[ ]*=' $srcdir/dist.mk | sed - cf_cv_abi_version=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} cf_cv_timestamp=`date` -echo "$as_me:1141: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "$as_me:1128: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 @@ -1146,7 +1133,7 @@ test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 # Check whether --with-rel-version or --without-rel-version was given. if test "${with_rel_version+set}" = set; then withval="$with_rel_version" - { echo "$as_me:1149: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 + { echo "$as_me:1136: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 echo "$as_me: WARNING: overriding release version $cf_cv_rel_version to $withval" >&2;} cf_cv_rel_version=$withval fi; @@ -1159,13 +1146,13 @@ if test -n "$NCURSES_MAJOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1162: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 + { { echo "$as_me:1149: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 echo "$as_me: error: Release major-version is not a number: $NCURSES_MAJOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1168: error: Release major-version value is empty" >&5 + { { echo "$as_me:1155: error: Release major-version value is empty" >&5 echo "$as_me: error: Release major-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1175,13 +1162,13 @@ if test -n "$NCURSES_MINOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1178: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 + { { echo "$as_me:1165: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 echo "$as_me: error: Release minor-version is not a number: $NCURSES_MINOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1184: error: Release minor-version value is empty" >&5 + { { echo "$as_me:1171: error: Release minor-version value is empty" >&5 echo "$as_me: error: Release minor-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1191,7 +1178,7 @@ test -z "$cf_cv_abi_version" && cf_cv_abi_version=0 # Check whether --with-abi-version or --without-abi-version was given. if test "${with_abi_version+set}" = set; then withval="$with_abi_version" - { echo "$as_me:1194: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 + { echo "$as_me:1181: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 echo "$as_me: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&2;} cf_cv_abi_version=$withval fi; @@ -1201,13 +1188,13 @@ if test -n "$cf_cv_abi_version" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1204: error: ABI version is not a number: $cf_cv_abi_version" >&5 + { { echo "$as_me:1191: error: ABI version is not a number: $cf_cv_abi_version" >&5 echo "$as_me: error: ABI version is not a number: $cf_cv_abi_version" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1210: error: ABI version value is empty" >&5 + { { echo "$as_me:1197: error: ABI version value is empty" >&5 echo "$as_me: error: ABI version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1229,7 +1216,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1232: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1219: 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 @@ -1239,11 +1226,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:1242: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1229: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1246: checking build system type" >&5 +echo "$as_me:1233: 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 @@ -1252,23 +1239,23 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1255: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1242: 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:1259: error: $ac_config_sub $ac_cv_build_alias failed." >&5 + { { echo "$as_me:1246: 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:1264: result: $ac_cv_build" >&5 +echo "$as_me:1251: 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/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:1271: checking host system type" >&5 +echo "$as_me:1258: 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 @@ -1277,12 +1264,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:1280: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { echo "$as_me:1267: 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:1285: result: $ac_cv_host" >&5 +echo "$as_me:1272: 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/'` @@ -1290,7 +1277,7 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1293: checking target system type" >&5 + echo "$as_me:1280: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1299,12 +1286,12 @@ else test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1302: error: $ac_config_sub $ac_cv_target_alias failed" >&5 + { { echo "$as_me:1289: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1307: result: $ac_cv_target" >&5 +echo "$as_me:1294: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1335,13 +1322,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1338: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1325: 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:1342: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1329: 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:1344: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1331: 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 @@ -1349,7 +1336,7 @@ fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" - { echo "$as_me:1352: WARNING: overriding system type to $withval" >&5 + { echo "$as_me:1339: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval fi; @@ -1359,7 +1346,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location -echo "$as_me:1362: checking for prefix" >&5 +echo "$as_me:1349: checking for prefix" >&5 echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in @@ -1371,11 +1358,11 @@ if test "x$prefix" = "xNONE" ; then ;; esac fi -echo "$as_me:1374: result: $prefix" >&5 +echo "$as_me:1361: result: $prefix" >&5 echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then -echo "$as_me:1378: checking for default include-directory" >&5 +echo "$as_me:1365: checking for default include-directory" >&5 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ @@ -1398,7 +1385,7 @@ do fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done -echo "$as_me:1401: result: $includedir" >&5 +echo "$as_me:1388: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 fi @@ -1412,7 +1399,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:1415: checking for $ac_word" >&5 +echo "$as_me:1402: 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 @@ -1427,7 +1414,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:1430: found $ac_dir/$ac_word" >&5 +echo "$as_me:1417: found $ac_dir/$ac_word" >&5 break done @@ -1435,10 +1422,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1438: result: $CC" >&5 + echo "$as_me:1425: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1441: result: no" >&5 + echo "$as_me:1428: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1447,7 +1434,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:1450: checking for $ac_word" >&5 +echo "$as_me:1437: 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 @@ -1462,7 +1449,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:1465: found $ac_dir/$ac_word" >&5 +echo "$as_me:1452: found $ac_dir/$ac_word" >&5 break done @@ -1470,10 +1457,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1473: result: $ac_ct_CC" >&5 + echo "$as_me:1460: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1476: result: no" >&5 + echo "$as_me:1463: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1486,7 +1473,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:1489: checking for $ac_word" >&5 +echo "$as_me:1476: 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 @@ -1501,7 +1488,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:1504: found $ac_dir/$ac_word" >&5 +echo "$as_me:1491: found $ac_dir/$ac_word" >&5 break done @@ -1509,10 +1496,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1512: result: $CC" >&5 + echo "$as_me:1499: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1515: result: no" >&5 + echo "$as_me:1502: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1521,7 +1508,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:1524: checking for $ac_word" >&5 +echo "$as_me:1511: 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 @@ -1536,7 +1523,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:1539: found $ac_dir/$ac_word" >&5 +echo "$as_me:1526: found $ac_dir/$ac_word" >&5 break done @@ -1544,10 +1531,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1547: result: $ac_ct_CC" >&5 + echo "$as_me:1534: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1550: result: no" >&5 + echo "$as_me:1537: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1560,7 +1547,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:1563: checking for $ac_word" >&5 +echo "$as_me:1550: 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 @@ -1580,7 +1567,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1583: found $ac_dir/$ac_word" >&5 +echo "$as_me:1570: found $ac_dir/$ac_word" >&5 break done @@ -1602,10 +1589,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1605: result: $CC" >&5 + echo "$as_me:1592: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1608: result: no" >&5 + echo "$as_me:1595: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1616,7 +1603,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:1619: checking for $ac_word" >&5 +echo "$as_me:1606: 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 @@ -1631,7 +1618,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:1634: found $ac_dir/$ac_word" >&5 +echo "$as_me:1621: found $ac_dir/$ac_word" >&5 break done @@ -1639,10 +1626,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1642: result: $CC" >&5 + echo "$as_me:1629: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1645: result: no" >&5 + echo "$as_me:1632: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1655,7 +1642,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:1658: checking for $ac_word" >&5 +echo "$as_me:1645: 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 @@ -1670,7 +1657,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:1673: found $ac_dir/$ac_word" >&5 +echo "$as_me:1660: found $ac_dir/$ac_word" >&5 break done @@ -1678,10 +1665,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1681: result: $ac_ct_CC" >&5 + echo "$as_me:1668: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1684: result: no" >&5 + echo "$as_me:1671: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1693,32 +1680,32 @@ fi fi -test -z "$CC" && { { echo "$as_me:1696: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1683: 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:1701:" \ +echo "$as_me:1688:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1704: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:1691: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:1707: \$? = $ac_status" >&5 + echo "$as_me:1694: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1709: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:1696: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:1712: \$? = $ac_status" >&5 + echo "$as_me:1699: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1714: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:1701: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:1717: \$? = $ac_status" >&5 + echo "$as_me:1704: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1721 "configure" +#line 1708 "configure" #include "confdefs.h" int @@ -1734,13 +1721,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:1737: checking for C compiler default output" >&5 +echo "$as_me:1724: 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:1740: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:1727: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1743: \$? = $ac_status" >&5 + echo "$as_me:1730: \$? = $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 @@ -1749,7 +1736,7 @@ for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; @@ -1763,34 +1750,34 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1766: error: C compiler cannot create executables" >&5 +{ { echo "$as_me:1753: 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:1772: result: $ac_file" >&5 +echo "$as_me:1759: 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:1777: checking whether the C compiler works" >&5 +echo "$as_me:1764: 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:1783: \"$ac_try\"") >&5 + { (eval echo "$as_me:1770: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1786: \$? = $ac_status" >&5 + echo "$as_me:1773: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1793: error: cannot run C compiled programs. + { { echo "$as_me:1780: 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;} @@ -1798,24 +1785,24 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1801: result: yes" >&5 +echo "$as_me:1788: 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:1808: checking whether we are cross compiling" >&5 +echo "$as_me:1795: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1810: result: $cross_compiling" >&5 +echo "$as_me:1797: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1813: checking for executable suffix" >&5 +echo "$as_me:1800: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1815: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1818: \$? = $ac_status" >&5 + echo "$as_me:1805: \$? = $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 @@ -1823,7 +1810,7 @@ if { (eval echo "$as_me:1815: \"$ac_link\"") >&5 # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -1831,25 +1818,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1834: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1821: 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:1840: result: $ac_cv_exeext" >&5 +echo "$as_me:1827: 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:1846: checking for object suffix" >&5 +echo "$as_me:1833: 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 1852 "configure" +#line 1839 "configure" #include "confdefs.h" int @@ -1861,14 +1848,14 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1851: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1867: \$? = $ac_status" >&5 + echo "$as_me:1854: \$? = $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 - *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1876,24 +1863,24 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1879: error: cannot compute OBJEXT: cannot compile" >&5 +{ { echo "$as_me:1866: 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:1886: result: $ac_cv_objext" >&5 +echo "$as_me:1873: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1890: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1877: 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 1896 "configure" +#line 1883 "configure" #include "confdefs.h" int @@ -1908,16 +1895,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1911: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1914: \$? = $ac_status" >&5 + echo "$as_me:1901: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1917: \"$ac_try\"") >&5 + { (eval echo "$as_me:1904: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1920: \$? = $ac_status" >&5 + echo "$as_me:1907: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -1929,19 +1916,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1932: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1919: 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:1938: checking whether $CC accepts -g" >&5 +echo "$as_me:1925: 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 1944 "configure" +#line 1931 "configure" #include "confdefs.h" int @@ -1953,16 +1940,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1956: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1943: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1959: \$? = $ac_status" >&5 + echo "$as_me:1946: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1962: \"$ac_try\"") >&5 + { (eval echo "$as_me:1949: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1965: \$? = $ac_status" >&5 + echo "$as_me:1952: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -1972,7 +1959,7 @@ ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1975: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1962: 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 @@ -1999,16 +1986,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2005: \$? = $ac_status" >&5 + echo "$as_me:1992: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2008: \"$ac_try\"") >&5 + { (eval echo "$as_me:1995: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2011: \$? = $ac_status" >&5 + echo "$as_me:1998: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -2020,7 +2007,7 @@ if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2023 "configure" +#line 2010 "configure" #include "confdefs.h" #include $ac_declaration @@ -2033,16 +2020,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2036: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2023: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2039: \$? = $ac_status" >&5 + echo "$as_me:2026: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2042: \"$ac_try\"") >&5 + { (eval echo "$as_me:2029: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2045: \$? = $ac_status" >&5 + echo "$as_me:2032: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2052,7 +2039,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2055 "configure" +#line 2042 "configure" #include "confdefs.h" $ac_declaration int @@ -2064,16 +2051,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2067: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2054: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2070: \$? = $ac_status" >&5 + echo "$as_me:2057: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2073: \"$ac_try\"") >&5 + { (eval echo "$as_me:2060: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2076: \$? = $ac_status" >&5 + echo "$as_me:2063: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -2082,7 +2069,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -rf conftest* +rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -2103,11 +2090,11 @@ ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:2106: checking version of $CC" >&5 + echo "$as_me:2093: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:2110: result: $GCC_VERSION" >&5 + echo "$as_me:2097: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi @@ -2117,7 +2104,7 @@ 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:2120: checking how to run the C preprocessor" >&5 +echo "$as_me:2107: 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 @@ -2138,18 +2125,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 2141 "configure" +#line 2128 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2146: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2133: \"$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:2152: \$? = $ac_status" >&5 + echo "$as_me:2139: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2172,17 +2159,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 2175 "configure" +#line 2162 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2179: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2166: \"$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:2185: \$? = $ac_status" >&5 + echo "$as_me:2172: \$? = $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 +2206,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:2222: result: $CPP" >&5 +echo "$as_me:2209: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2229,18 +2216,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 2232 "configure" +#line 2219 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2237: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2224: \"$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:2243: \$? = $ac_status" >&5 + echo "$as_me:2230: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2263,17 +2250,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 2266 "configure" +#line 2253 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2270: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2257: \"$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:2276: \$? = $ac_status" >&5 + echo "$as_me:2263: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2301,7 +2288,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2304: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2291: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2314,14 +2301,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:2317: checking whether $CC needs -traditional" >&5 + echo "$as_me:2304: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line 2324 "configure" +#line 2311 "configure" #include "confdefs.h" #include int Autoconf = TIOCGETP; @@ -2332,11 +2319,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_prog_gcc_traditional=no fi -rm -rf conftest* +rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line 2339 "configure" +#line 2326 "configure" #include "confdefs.h" #include int Autoconf = TCGETA; @@ -2345,18 +2332,18 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi -rm -rf conftest* +rm -f conftest* fi fi -echo "$as_me:2352: result: $ac_cv_prog_gcc_traditional" >&5 +echo "$as_me:2339: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo "$as_me:2359: checking whether $CC understands -c and -o together" >&5 +echo "$as_me:2346: checking whether $CC understands -c and -o together" >&5 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CC_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2372,38 +2359,38 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:2375: \"$ac_try\"") >&5 +if { (eval echo "$as_me:2362: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2378: \$? = $ac_status" >&5 + echo "$as_me:2365: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:2380: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:2367: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2383: \$? = $ac_status" >&5 + echo "$as_me:2370: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CC_c_o=yes else eval cf_cv_prog_CC_c_o=no fi -rm -rf conftest* +rm -f conftest* fi if test $cf_cv_prog_CC_c_o = yes; then - echo "$as_me:2394: result: yes" >&5 + echo "$as_me:2381: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2397: result: no" >&5 + echo "$as_me:2384: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:2401: checking for POSIXized ISC" >&5 +echo "$as_me:2388: checking for POSIXized ISC" >&5 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then - echo "$as_me:2406: result: yes" >&5 + echo "$as_me:2393: result: yes" >&5 echo "${ECHO_T}yes" >&6 ISC=yes # If later tests want to check for ISC. @@ -2417,13 +2404,13 @@ EOF CC="$CC -Xp" fi else - echo "$as_me:2420: result: no" >&5 + echo "$as_me:2407: result: no" >&5 echo "${ECHO_T}no" >&6 ISC= fi -echo "$as_me:2425: checking for ${CC:-cc} option to accept ANSI C" >&5 -echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 +echo "$as_me:2412: checking for ${CC-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2463,8 +2450,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2479,16 +2466,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2504,8 +2481,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2517,7 +2494,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2526,7 +2503,7 @@ if test -n "$cf_new_extra_cppflags" ; then fi cat >conftest.$ac_ext <<_ACEOF -#line 2529 "configure" +#line 2506 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2547,16 +2524,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2550: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2527: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2553: \$? = $ac_status" >&5 + echo "$as_me:2530: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2556: \"$ac_try\"") >&5 + { (eval echo "$as_me:2533: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2559: \$? = $ac_status" >&5 + echo "$as_me:2536: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else @@ -2569,7 +2546,7 @@ CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$as_me:2572: result: $cf_cv_ansi_cc" >&5 +echo "$as_me:2549: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then @@ -2591,8 +2568,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2607,16 +2584,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2632,8 +2599,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2645,7 +2612,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2662,7 +2629,7 @@ fi fi if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2665: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2632: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler @@ -2696,13 +2663,13 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -dragonfly*|freebsd*) #(vi +freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 -echo "$as_me:2705: checking for $ac_word" >&5 +echo "$as_me:2672: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2719,7 +2686,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_LDCONFIG="$ac_dir/$ac_word" - echo "$as_me:2722: found $ac_dir/$ac_word" >&5 + echo "$as_me:2689: found $ac_dir/$ac_word" >&5 break fi done @@ -2730,10 +2697,10 @@ fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then - echo "$as_me:2733: result: $LDCONFIG" >&5 + echo "$as_me:2700: result: $LDCONFIG" >&5 echo "${ECHO_T}$LDCONFIG" >&6 else - echo "$as_me:2736: result: no" >&5 + echo "$as_me:2703: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2741,7 +2708,7 @@ fi esac fi -echo "$as_me:2744: checking if you want to ensure bool is consistent with C++" >&5 +echo "$as_me:2711: checking if you want to ensure bool is consistent with C++" >&5 echo $ECHO_N "checking if you want to ensure bool is consistent with C++... $ECHO_C" >&6 # Check whether --with-cxx or --without-cxx was given. @@ -2751,7 +2718,7 @@ if test "${with_cxx+set}" = set; then else cf_with_cxx=yes fi; -echo "$as_me:2754: result: $cf_with_cxx" >&5 +echo "$as_me:2721: result: $cf_with_cxx" >&5 echo "${ECHO_T}$cf_with_cxx" >&6 if test "X$cf_with_cxx" = Xno ; then CXX="" @@ -2769,7 +2736,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:2772: checking for $ac_word" >&5 +echo "$as_me:2739: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2784,7 +2751,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_CXX="$ac_tool_prefix$ac_prog" -echo "$as_me:2787: found $ac_dir/$ac_word" >&5 +echo "$as_me:2754: found $ac_dir/$ac_word" >&5 break done @@ -2792,10 +2759,10 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:2795: result: $CXX" >&5 + echo "$as_me:2762: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:2798: result: no" >&5 + echo "$as_me:2765: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2808,7 +2775,7 @@ if test -z "$CXX"; 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:2811: checking for $ac_word" >&5 +echo "$as_me:2778: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2823,7 +2790,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_CXX="$ac_prog" -echo "$as_me:2826: found $ac_dir/$ac_word" >&5 +echo "$as_me:2793: found $ac_dir/$ac_word" >&5 break done @@ -2831,10 +2798,10 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:2834: result: $ac_ct_CXX" >&5 + echo "$as_me:2801: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else - echo "$as_me:2837: result: no" >&5 + echo "$as_me:2804: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2846,32 +2813,32 @@ test -n "$ac_ct_CXX" || ac_ct_CXX="g++" fi # Provide some information about the compiler. -echo "$as_me:2849:" \ +echo "$as_me:2816:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:2852: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:2819: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:2855: \$? = $ac_status" >&5 + echo "$as_me:2822: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2857: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:2824: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:2860: \$? = $ac_status" >&5 + echo "$as_me:2827: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2862: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:2829: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:2865: \$? = $ac_status" >&5 + echo "$as_me:2832: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:2868: checking whether we are using the GNU C++ compiler" >&5 +echo "$as_me:2835: 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_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2874 "configure" +#line 2841 "configure" #include "confdefs.h" int @@ -2886,16 +2853,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2889: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2856: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2892: \$? = $ac_status" >&5 + echo "$as_me:2859: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2895: \"$ac_try\"") >&5 + { (eval echo "$as_me:2862: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2898: \$? = $ac_status" >&5 + echo "$as_me:2865: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -2907,19 +2874,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:2910: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "$as_me:2877: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" -echo "$as_me:2916: checking whether $CXX accepts -g" >&5 +echo "$as_me:2883: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2922 "configure" +#line 2889 "configure" #include "confdefs.h" int @@ -2931,16 +2898,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2934: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2901: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2937: \$? = $ac_status" >&5 + echo "$as_me:2904: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2940: \"$ac_try\"") >&5 + { (eval echo "$as_me:2907: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2943: \$? = $ac_status" >&5 + echo "$as_me:2910: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else @@ -2950,7 +2917,7 @@ ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2953: result: $ac_cv_prog_cxx_g" >&5 +echo "$as_me:2920: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS @@ -2977,7 +2944,7 @@ for ac_declaration in \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2980 "configure" +#line 2947 "configure" #include "confdefs.h" #include $ac_declaration @@ -2990,16 +2957,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2993: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2960: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2996: \$? = $ac_status" >&5 + echo "$as_me:2963: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2999: \"$ac_try\"") >&5 + { (eval echo "$as_me:2966: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3002: \$? = $ac_status" >&5 + echo "$as_me:2969: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -3009,7 +2976,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 3012 "configure" +#line 2979 "configure" #include "confdefs.h" $ac_declaration int @@ -3021,16 +2988,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3024: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2991: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3027: \$? = $ac_status" >&5 + echo "$as_me:2994: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3030: \"$ac_try\"") >&5 + { (eval echo "$as_me:2997: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3033: \$? = $ac_status" >&5 + echo "$as_me:3000: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -3039,7 +3006,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -rf conftest* +rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -3057,7 +3024,7 @@ ac_main_return=return if test "$CXX" = "g++" ; then # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -echo "$as_me:3060: checking for $ac_word" >&5 +echo "$as_me:3027: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3074,7 +3041,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_CXX="$ac_dir/$ac_word" - echo "$as_me:3077: found $ac_dir/$ac_word" >&5 + echo "$as_me:3044: found $ac_dir/$ac_word" >&5 break fi done @@ -3085,16 +3052,16 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - echo "$as_me:3088: result: $CXX" >&5 + echo "$as_me:3055: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:3091: result: no" >&5 + echo "$as_me:3058: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$CXX" = "g++" ; then - { echo "$as_me:3097: WARNING: ignoring hardcoded g++" >&5 + { echo "$as_me:3064: WARNING: ignoring hardcoded g++" >&5 echo "$as_me: WARNING: ignoring hardcoded g++" >&2;} cf_with_cxx=no; CXX=""; GXX=""; fi @@ -3102,11 +3069,11 @@ fi GXX_VERSION=none if test "$GXX" = yes; then - echo "$as_me:3105: checking version of g++" >&5 + echo "$as_me:3072: checking version of g++" >&5 echo $ECHO_N "checking version of g++... $ECHO_C" >&6 - GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown - echo "$as_me:3109: result: $GXX_VERSION" >&5 + echo "$as_me:3076: result: $GXX_VERSION" >&5 echo "${ECHO_T}$GXX_VERSION" >&6 fi @@ -3114,12 +3081,12 @@ case $GXX_VERSION in 1*|2.[0-6]*) # GXX=""; CXX=""; ac_cv_prog_gxx=no # cf_cxx_library=no - { echo "$as_me:3117: WARNING: templates do not work" >&5 + { echo "$as_me:3084: WARNING: templates do not work" >&5 echo "$as_me: WARNING: templates do not work" >&2;} ;; esac -echo "$as_me:3122: checking if you want to build C++ binding and demo" >&5 +echo "$as_me:3089: checking if you want to build C++ binding and demo" >&5 echo $ECHO_N "checking if you want to build C++ binding and demo... $ECHO_C" >&6 # Check whether --with-cxx-binding or --without-cxx-binding was given. @@ -3129,10 +3096,10 @@ if test "${with_cxx_binding+set}" = set; then else cf_with_cxx_binding=$cf_with_cxx fi; -echo "$as_me:3132: result: $cf_with_cxx_binding" >&5 +echo "$as_me:3099: result: $cf_with_cxx_binding" >&5 echo "${ECHO_T}$cf_with_cxx_binding" >&6 -echo "$as_me:3135: checking if you want to build with Ada95" >&5 +echo "$as_me:3102: checking if you want to build with Ada95" >&5 echo $ECHO_N "checking if you want to build with Ada95... $ECHO_C" >&6 # Check whether --with-ada or --without-ada was given. @@ -3142,23 +3109,10 @@ if test "${with_ada+set}" = set; then else cf_with_ada=yes fi; -echo "$as_me:3145: result: $cf_with_ada" >&5 +echo "$as_me:3112: result: $cf_with_ada" >&5 echo "${ECHO_T}$cf_with_ada" >&6 -echo "$as_me:3148: checking if you want to install manpages" >&5 -echo $ECHO_N "checking if you want to install manpages... $ECHO_C" >&6 - -# Check whether --with-manpages or --without-manpages was given. -if test "${with_manpages+set}" = set; then - withval="$with_manpages" - cf_with_manpages=$withval -else - cf_with_manpages=yes -fi; -echo "$as_me:3158: result: $cf_with_manpages" >&5 -echo "${ECHO_T}$cf_with_manpages" >&6 - -echo "$as_me:3161: checking if you want to build programs such as tic" >&5 +echo "$as_me:3115: checking if you want to build programs such as tic" >&5 echo $ECHO_N "checking if you want to build programs such as tic... $ECHO_C" >&6 # Check whether --with-progs or --without-progs was given. @@ -3168,23 +3122,10 @@ if test "${with_progs+set}" = set; then else cf_with_progs=yes fi; -echo "$as_me:3171: result: $cf_with_progs" >&5 +echo "$as_me:3125: result: $cf_with_progs" >&5 echo "${ECHO_T}$cf_with_progs" >&6 -echo "$as_me:3174: checking if you want to build test-programs" >&5 -echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 - -# Check whether --with-tests or --without-tests was given. -if test "${with_tests+set}" = set; then - withval="$with_tests" - cf_with_tests=$withval -else - cf_with_tests=yes -fi; -echo "$as_me:3184: result: $cf_with_tests" >&5 -echo "${ECHO_T}$cf_with_tests" >&6 - -echo "$as_me:3187: checking if you wish to install curses.h" >&5 +echo "$as_me:3128: checking if you wish to install curses.h" >&5 echo $ECHO_N "checking if you wish to install curses.h... $ECHO_C" >&6 # Check whether --with-curses-h or --without-curses-h was given. @@ -3194,7 +3135,7 @@ if test "${with_curses_h+set}" = set; then else with_curses_h=yes fi; -echo "$as_me:3197: result: $with_curses_h" >&5 +echo "$as_me:3138: result: $with_curses_h" >&5 echo "${ECHO_T}$with_curses_h" >&6 modules_to_build="ncurses" @@ -3220,7 +3161,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:3223: checking for $ac_word" >&5 +echo "$as_me:3164: 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 @@ -3235,7 +3176,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:3238: found $ac_dir/$ac_word" >&5 +echo "$as_me:3179: found $ac_dir/$ac_word" >&5 break done @@ -3243,21 +3184,21 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:3246: result: $AWK" >&5 + echo "$as_me:3187: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:3249: result: no" >&5 + echo "$as_me:3190: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done -test -z "$AWK" && { { echo "$as_me:3256: error: No awk program found" >&5 +test -z "$AWK" && { { echo "$as_me:3197: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:3260: checking for egrep" >&5 +echo "$as_me:3201: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3267,11 +3208,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:3270: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:3211: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:3274: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:3215: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -3287,7 +3228,7 @@ echo "$as_me: error: No egrep program found" >&2;} # 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:3290: checking for a BSD compatible install" >&5 +echo "$as_me:3231: 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 @@ -3336,7 +3277,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:3339: result: $INSTALL" >&5 +echo "$as_me:3280: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -3357,11 +3298,11 @@ case $INSTALL in ;; esac -for ac_prog in tdlint lint alint splint lclint +for ac_prog in tdlint lint alint 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:3364: checking for $ac_word" >&5 +echo "$as_me:3305: 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 @@ -3376,7 +3317,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:3379: found $ac_dir/$ac_word" >&5 +echo "$as_me:3320: found $ac_dir/$ac_word" >&5 break done @@ -3384,45 +3325,28 @@ fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$as_me:3387: result: $LINT" >&5 + echo "$as_me:3328: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else - echo "$as_me:3390: result: no" >&5 + echo "$as_me:3331: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done -echo "$as_me:3397: checking whether ln -s works" >&5 +echo "$as_me:3338: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:3401: result: yes" >&5 + echo "$as_me:3342: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:3404: result: no, using $LN_S" >&5 + echo "$as_me:3345: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi -echo "$as_me:3408: checking if $LN_S -f options work" >&5 -echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 - -rm -f conf$$.src conf$$dst -echo >conf$$.dst -echo first >conf$$.src -if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then - cf_prog_ln_sf=yes -else - cf_prog_ln_sf=no -fi -rm -f conf$$.dst conf$$src -echo "$as_me:3420: result: $cf_prog_ln_sf" >&5 -echo "${ECHO_T}$cf_prog_ln_sf" >&6 - -test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" - -echo "$as_me:3425: checking for long file names" >&5 +echo "$as_me:3349: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3461,7 +3385,7 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do rm -rf $ac_xdir 2>/dev/null done fi -echo "$as_me:3464: result: $ac_cv_sys_long_file_names" >&5 +echo "$as_me:3388: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then @@ -3471,182 +3395,7 @@ EOF fi -# if we find pkg-config, check if we should install the ".pc" files. - -echo "$as_me:3476: 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. -if test "${with_pkg_config+set}" = set; then - withval="$with_pkg_config" - cf_pkg_config=$withval -else - cf_pkg_config=yes -fi; -echo "$as_me:3486: result: $cf_pkg_config" >&5 -echo "${ECHO_T}$cf_pkg_config" >&6 - -case $cf_pkg_config in #(vi -no) #(vi - PKG_CONFIG=none - ;; -yes) #(vi - 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:3497: 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 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:3514: found $ac_dir/$ac_word" >&5 - break -fi -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:3525: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:3528: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -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:3537: 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 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:3554: found $ac_dir/$ac_word" >&5 - break -fi -done - - test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG - -if test -n "$ac_pt_PKG_CONFIG"; then - echo "$as_me:3566: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 -else - echo "$as_me:3569: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - PKG_CONFIG=$ac_pt_PKG_CONFIG -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - - ;; -*) - PKG_CONFIG=$withval - ;; -esac - -test -z "$PKG_CONFIG" && PKG_CONFIG=none -if test "$PKG_CONFIG" != none ; then - -if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" -else - cf_path_syntax="$ac_default_prefix" -fi - -case ".$PKG_CONFIG" in #(vi -.\$\(*\)*|.\'*\'*) #(vi - ;; -..|./*|.\\*) #(vi - ;; -.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX - ;; -.\${*prefix}*) #(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:3612: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 -echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} - { (exit 1); exit 1; }; } - ;; -esac - -fi - -if test "$PKG_CONFIG" != no ; then - echo "$as_me:3621: checking if we should install .pc files for $PKG_CONFIG" >&5 -echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6 - - # Leave this as something that can be overridden in the environment. - if test -z "$PKG_CONFIG_LIBDIR" ; then - PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig - fi - PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` - if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then - -# Check whether --enable-pc-files or --disable-pc-files was given. -if test "${enable_pc_files+set}" = set; then - enableval="$enable_pc_files" - enable_pc_files=$enableval -else - enable_pc_files=no -fi; - echo "$as_me:3638: result: $enable_pc_files" >&5 -echo "${ECHO_T}$enable_pc_files" >&6 - else - echo "$as_me:3641: result: no" >&5 -echo "${ECHO_T}no" >&6 - { echo "$as_me:3643: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 -echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} - enable_pc_files=no - fi -fi - -echo "$as_me:3649: checking if we should assume mixed-case filenames" >&5 +echo "$as_me:3398: checking if we should assume mixed-case filenames" >&5 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 # Check whether --enable-mixed-case or --disable-mixed-case was given. @@ -3656,11 +3405,11 @@ if test "${enable_mixed_case+set}" = set; then else enable_mixedcase=auto fi; -echo "$as_me:3659: result: $enable_mixedcase" >&5 +echo "$as_me:3408: result: $enable_mixedcase" >&5 echo "${ECHO_T}$enable_mixedcase" >&6 if test "$enable_mixedcase" = "auto" ; then -echo "$as_me:3663: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:3412: 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 @@ -3687,7 +3436,7 @@ else fi fi -echo "$as_me:3690: result: $cf_cv_mixedcase" >&5 +echo "$as_me:3439: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 @@ -3704,7 +3453,7 @@ EOF fi # do this after mixed-case option (tags/TAGS is not as important as tic). -echo "$as_me:3707: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "$as_me:3456: 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 @@ -3724,92 +3473,18 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:3727: result: yes" >&5 + echo "$as_me:3476: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:3731: result: no" >&5 + echo "$as_me:3480: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi -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:3740: 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 -else - if test -n "$CTAGS"; then - ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CTAGS="$ac_prog" -echo "$as_me:3755: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CTAGS=$ac_cv_prog_CTAGS -if test -n "$CTAGS"; then - echo "$as_me:3763: result: $CTAGS" >&5 -echo "${ECHO_T}$CTAGS" >&6 -else - echo "$as_me:3766: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CTAGS" && break -done - -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:3777: 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 -else - if test -n "$ETAGS"; then - ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ETAGS="$ac_prog" -echo "$as_me:3792: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ETAGS=$ac_cv_prog_ETAGS -if test -n "$ETAGS"; then - echo "$as_me:3800: result: $ETAGS" >&5 -echo "${ECHO_T}$ETAGS" >&6 -else - echo "$as_me:3803: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ETAGS" && break -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:3812: checking for $ac_word" >&5 +# Extract the first word of "ctags", so it can be a program name with args. +set dummy ctags; ac_word=$2 +echo "$as_me:3487: 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 @@ -3824,7 +3499,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:3827: found $ac_dir/$ac_word" >&5 +echo "$as_me:3502: found $ac_dir/$ac_word" >&5 break done @@ -3833,17 +3508,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:3836: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:3511: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:3839: result: no" >&5 + echo "$as_me:3514: 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:3846: checking for $ac_word" >&5 + # Extract the first word of "etags", so it can be a program name with args. +set dummy etags; ac_word=$2 +echo "$as_me:3521: 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 @@ -3858,7 +3533,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:3861: found $ac_dir/$ac_word" >&5 +echo "$as_me:3536: found $ac_dir/$ac_word" >&5 break done @@ -3867,10 +3542,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:3870: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:3545: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:3873: result: no" >&5 + echo "$as_me:3548: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3890,7 +3565,7 @@ else MAKE_LOWER_TAGS="#" fi -echo "$as_me:3893: checking for makeflags variable" >&5 +echo "$as_me:3568: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3904,10 +3579,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[ ]*$,,'` + cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -3924,13 +3599,13 @@ CF_EOF rm -f cf_makeflags.tmp fi -echo "$as_me:3927: result: $cf_cv_makeflags" >&5 +echo "$as_me:3602: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:3933: checking for $ac_word" >&5 +echo "$as_me:3608: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3945,7 +3620,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_RANLIB="${ac_tool_prefix}ranlib" -echo "$as_me:3948: found $ac_dir/$ac_word" >&5 +echo "$as_me:3623: found $ac_dir/$ac_word" >&5 break done @@ -3953,10 +3628,10 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:3956: result: $RANLIB" >&5 + echo "$as_me:3631: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else - echo "$as_me:3959: result: no" >&5 + echo "$as_me:3634: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3965,7 +3640,7 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:3968: checking for $ac_word" >&5 +echo "$as_me:3643: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3980,7 +3655,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_RANLIB="ranlib" -echo "$as_me:3983: found $ac_dir/$ac_word" >&5 +echo "$as_me:3658: found $ac_dir/$ac_word" >&5 break done @@ -3989,10 +3664,10 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:3992: result: $ac_ct_RANLIB" >&5 + echo "$as_me:3667: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$as_me:3995: result: no" >&5 + echo "$as_me:3670: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4004,7 +3679,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 -echo "$as_me:4007: checking for $ac_word" >&5 +echo "$as_me:3682: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4019,7 +3694,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_LD="${ac_tool_prefix}ld" -echo "$as_me:4022: found $ac_dir/$ac_word" >&5 +echo "$as_me:3697: found $ac_dir/$ac_word" >&5 break done @@ -4027,10 +3702,10 @@ fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$as_me:4030: result: $LD" >&5 + echo "$as_me:3705: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else - echo "$as_me:4033: result: no" >&5 + echo "$as_me:3708: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4039,7 +3714,7 @@ if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo "$as_me:4042: checking for $ac_word" >&5 +echo "$as_me:3717: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4054,7 +3729,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_LD="ld" -echo "$as_me:4057: found $ac_dir/$ac_word" >&5 +echo "$as_me:3732: found $ac_dir/$ac_word" >&5 break done @@ -4063,10 +3738,10 @@ fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then - echo "$as_me:4066: result: $ac_ct_LD" >&5 + echo "$as_me:3741: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else - echo "$as_me:4069: result: no" >&5 + echo "$as_me:3744: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4078,7 +3753,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:4081: checking for $ac_word" >&5 +echo "$as_me:3756: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4093,7 +3768,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_AR="${ac_tool_prefix}ar" -echo "$as_me:4096: found $ac_dir/$ac_word" >&5 +echo "$as_me:3771: found $ac_dir/$ac_word" >&5 break done @@ -4101,10 +3776,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:4104: result: $AR" >&5 + echo "$as_me:3779: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:4107: result: no" >&5 + echo "$as_me:3782: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4113,7 +3788,7 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:4116: checking for $ac_word" >&5 +echo "$as_me:3791: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4128,7 +3803,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_AR="ar" -echo "$as_me:4131: found $ac_dir/$ac_word" >&5 +echo "$as_me:3806: found $ac_dir/$ac_word" >&5 break done @@ -4137,10 +3812,10 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:4140: result: $ac_ct_AR" >&5 + echo "$as_me:3815: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else - echo "$as_me:4143: result: no" >&5 + echo "$as_me:3818: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4149,140 +3824,25 @@ else AR="$ac_cv_prog_AR" fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:4155: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_AR="${ac_tool_prefix}ar" -echo "$as_me:4170: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - echo "$as_me:4178: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6 -else - echo "$as_me:4181: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -echo "$as_me:4190: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_AR="ar" -echo "$as_me:4205: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - echo "$as_me:4214: result: $ac_ct_AR" >&5 -echo "${ECHO_T}$ac_ct_AR" >&6 -else - echo "$as_me:4217: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - AR=$ac_ct_AR -else - AR="$ac_cv_prog_AR" -fi - -echo "$as_me:4226: checking for options to update archives" >&5 -echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 -if test "${cf_cv_ar_flags+set}" = set; then +if test "${cf_cv_subst_AR_OPTS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cf_cv_ar_flags=unknown - for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv - do +echo "$as_me:3831: checking for archiver options (symbol AR_OPTS)" >&5 +echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6 - # check if $ARFLAGS already contains this choice - if test "x$ARFLAGS" != "x" ; then - cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` - if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then - cf_cv_ar_flags= - break - fi - fi - - rm -f conftest.$ac_cv_objext - rm -f conftest.a - - cat >conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4255: \$? = $ac_status" >&5 - (exit $ac_status); } ; then - echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 - $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null - if test -f conftest.a ; then - cf_cv_ar_flags=$cf_ar_flags - break - fi - else - test -n "$verbose" && echo " cannot compile test-program" 1>&6 - -echo "${as_me:-configure}:4266: testing cannot compile test-program ..." 1>&5 - - break - fi - done - rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext +if test -z "$AR_OPTS" ; then + AR_OPTS=rv fi -echo "$as_me:4274: result: $cf_cv_ar_flags" >&5 -echo "${ECHO_T}$cf_cv_ar_flags" >&6 -if test -n "$ARFLAGS" ; then - if test -n "$cf_cv_ar_flags" ; then - ARFLAGS="$ARFLAGS $cf_cv_ar_flags" - fi -else - ARFLAGS=$cf_cv_ar_flags +cf_cv_subst_AR_OPTS=$AR_OPTS +echo "$as_me:3840: result: $AR_OPTS" >&5 +echo "${ECHO_T}$AR_OPTS" >&6 + fi -echo "$as_me:4285: checking if you have specified an install-prefix" >&5 +echo "$as_me:3845: checking if you have specified an install-prefix" >&5 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. @@ -4295,7 +3855,7 @@ if test "${with_install_prefix+set}" = set; then ;; esac fi; -echo "$as_me:4298: result: $DESTDIR" >&5 +echo "$as_me:3858: result: $DESTDIR" >&5 echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### @@ -4323,7 +3883,7 @@ else 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:4326: checking for $ac_word" >&5 +echo "$as_me:3886: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4338,7 +3898,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_BUILD_CC="$ac_prog" -echo "$as_me:4341: found $ac_dir/$ac_word" >&5 +echo "$as_me:3901: found $ac_dir/$ac_word" >&5 break done @@ -4346,10 +3906,10 @@ fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - echo "$as_me:4349: result: $BUILD_CC" >&5 + echo "$as_me:3909: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else - echo "$as_me:4352: result: no" >&5 + echo "$as_me:3912: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -4357,12 +3917,12 @@ fi done fi; - echo "$as_me:4360: checking for native build C compiler" >&5 + echo "$as_me:3920: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 - echo "$as_me:4362: result: $BUILD_CC" >&5 + echo "$as_me:3922: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 - echo "$as_me:4365: checking for native build C preprocessor" >&5 + echo "$as_me:3925: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. @@ -4372,10 +3932,10 @@ if test "${with_build_cpp+set}" = set; then else BUILD_CPP='${BUILD_CC} -E' fi; - echo "$as_me:4375: result: $BUILD_CPP" >&5 + echo "$as_me:3935: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 - echo "$as_me:4378: checking for native build C flags" >&5 + echo "$as_me:3938: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. @@ -4383,10 +3943,10 @@ if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; - echo "$as_me:4386: result: $BUILD_CFLAGS" >&5 + echo "$as_me:3946: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 - echo "$as_me:4389: checking for native build C preprocessor-flags" >&5 + echo "$as_me:3949: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. @@ -4394,10 +3954,10 @@ if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; - echo "$as_me:4397: result: $BUILD_CPPFLAGS" >&5 + echo "$as_me:3957: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 - echo "$as_me:4400: checking for native build linker-flags" >&5 + echo "$as_me:3960: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. @@ -4405,10 +3965,10 @@ if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; - echo "$as_me:4408: result: $BUILD_LDFLAGS" >&5 + echo "$as_me:3968: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 - echo "$as_me:4411: checking for native build linker-libraries" >&5 + echo "$as_me:3971: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. @@ -4416,7 +3976,7 @@ if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; - echo "$as_me:4419: result: $BUILD_LIBS" >&5 + echo "$as_me:3979: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. @@ -4426,7 +3986,7 @@ echo "${ECHO_T}$BUILD_LIBS" >&6 : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then - { { echo "$as_me:4429: error: Cross-build requires two compilers. + { { echo "$as_me:3989: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} @@ -4451,32 +4011,6 @@ fi ### shared, for example. cf_list_models="" -echo "$as_me:4454: checking if libtool -version-number should be used" >&5 -echo $ECHO_N "checking if libtool -version-number should be used... $ECHO_C" >&6 - -# Check whether --enable-libtool-version or --disable-libtool-version was given. -if test "${enable_libtool_version+set}" = set; then - enableval="$enable_libtool_version" - test "$enableval" != no && enableval=yes - if test "$enableval" != "yes" ; then - cf_libtool_version=no - else - cf_libtool_version=yes - fi -else - enableval=yes - cf_libtool_version=yes - -fi; -echo "$as_me:4471: result: $cf_libtool_version" >&5 -echo "${ECHO_T}$cf_libtool_version" >&6 - -if test "$cf_libtool_version" = yes ; then - LIBTOOL_VERSION="-version-number" -else - LIBTOOL_VERSION="-version-info" -fi - LIBTOOL= # common library maintenance symbols that are convenient for libtool scripts: @@ -4493,7 +4027,7 @@ LIB_LINK='${CC}' LIB_INSTALL= LIB_UNINSTALL= -echo "$as_me:4496: checking if you want to build libraries with libtool" >&5 +echo "$as_me:4030: checking if you want to build libraries with libtool" >&5 echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6 # Check whether --with-libtool or --without-libtool was given. @@ -4503,11 +4037,11 @@ if test "${with_libtool+set}" = set; then else with_libtool=no fi; -echo "$as_me:4506: result: $with_libtool" >&5 +echo "$as_me:4040: result: $with_libtool" >&5 echo "${ECHO_T}$with_libtool" >&6 if test "$with_libtool" != "no"; then - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -4534,7 +4068,7 @@ case ".$with_libtool" in #(vi with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:4537: error: expected a pathname, not \"$with_libtool\"" >&5 + { { echo "$as_me:4071: error: expected a pathname, not \"$with_libtool\"" >&5 echo "$as_me: error: expected a pathname, not \"$with_libtool\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -4542,9 +4076,9 @@ esac LIBTOOL=$with_libtool else - # Extract the first word of "libtool", so it can be a program name with args. + # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 -echo "$as_me:4547: checking for $ac_word" >&5 +echo "$as_me:4081: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LIBTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4561,7 +4095,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_LIBTOOL="$ac_dir/$ac_word" - echo "$as_me:4564: found $ac_dir/$ac_word" >&5 + echo "$as_me:4098: found $ac_dir/$ac_word" >&5 break fi done @@ -4572,20 +4106,20 @@ fi LIBTOOL=$ac_cv_path_LIBTOOL if test -n "$LIBTOOL"; then - echo "$as_me:4575: result: $LIBTOOL" >&5 + echo "$as_me:4109: result: $LIBTOOL" >&5 echo "${ECHO_T}$LIBTOOL" >&6 else - echo "$as_me:4578: result: no" >&5 + echo "$as_me:4112: result: no" >&5 echo "${ECHO_T}no" >&6 fi - fi - if test -z "$LIBTOOL" ; then - { { echo "$as_me:4584: error: Cannot find libtool" >&5 + fi + if test -z "$LIBTOOL" ; then + { { echo "$as_me:4118: error: Cannot find libtool" >&5 echo "$as_me: error: Cannot find libtool" >&2;} { (exit 1); exit 1; }; } - fi - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' + fi + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -4596,32 +4130,24 @@ echo "$as_me: error: Cannot find libtool" >&2;} LIB_PREP=: # Show the version of libtool - echo "$as_me:4599: checking version of libtool" >&5 + echo "$as_me:4133: checking version of libtool" >&5 echo $ECHO_N "checking version of libtool... $ECHO_C" >&6 # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. "(" + # bug reports it might be useful to have the original string. cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([^)]*)//g' -e 's/^[^1-9]*//' -e 's/[^0-9.].*//'` - echo "$as_me:4606: result: $cf_cv_libtool_version" >&5 + echo "$as_me:4140: result: $cf_cv_libtool_version" >&5 echo "${ECHO_T}$cf_cv_libtool_version" >&6 if test -z "$cf_cv_libtool_version" ; then - { { echo "$as_me:4609: error: This is not GNU libtool" >&5 + { { echo "$as_me:4143: error: This is not GNU libtool" >&5 echo "$as_me: error: This is not GNU libtool" >&2;} { (exit 1); exit 1; }; } fi - # special hack to add -no-undefined (which libtool should do for itself) - LT_UNDEF= - case "$cf_cv_system_name" in #(vi - cygwin*|mingw32*|uwin*|aix[456]) #(vi - LT_UNDEF=-no-undefined - ;; - esac - # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in #(vi - 1.[5-9]*|[2-9].[0-9.a-z]*) #(vi + case $cf_cv_libtool_version in + 1.[5-9]*|[2-9]*) LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -4642,7 +4168,7 @@ cf_list_models="$cf_list_models libtool" else -echo "$as_me:4645: checking if you want to build shared libraries" >&5 +echo "$as_me:4171: checking if you want to build shared libraries" >&5 echo $ECHO_N "checking if you want to build shared libraries... $ECHO_C" >&6 # Check whether --with-shared or --without-shared was given. @@ -4652,11 +4178,11 @@ if test "${with_shared+set}" = set; then else with_shared=no fi; -echo "$as_me:4655: result: $with_shared" >&5 +echo "$as_me:4181: result: $with_shared" >&5 echo "${ECHO_T}$with_shared" >&6 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" -echo "$as_me:4659: checking if you want to build static libraries" >&5 +echo "$as_me:4185: checking if you want to build static libraries" >&5 echo $ECHO_N "checking if you want to build static libraries... $ECHO_C" >&6 # Check whether --with-normal or --without-normal was given. @@ -4666,11 +4192,11 @@ if test "${with_normal+set}" = set; then else with_normal=yes fi; -echo "$as_me:4669: result: $with_normal" >&5 +echo "$as_me:4195: result: $with_normal" >&5 echo "${ECHO_T}$with_normal" >&6 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" -echo "$as_me:4673: checking if you want to build debug libraries" >&5 +echo "$as_me:4199: checking if you want to build debug libraries" >&5 echo $ECHO_N "checking if you want to build debug libraries... $ECHO_C" >&6 # Check whether --with-debug or --without-debug was given. @@ -4680,11 +4206,11 @@ if test "${with_debug+set}" = set; then else with_debug=yes fi; -echo "$as_me:4683: result: $with_debug" >&5 +echo "$as_me:4209: result: $with_debug" >&5 echo "${ECHO_T}$with_debug" >&6 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" -echo "$as_me:4687: checking if you want to build profiling libraries" >&5 +echo "$as_me:4213: checking if you want to build profiling libraries" >&5 echo $ECHO_N "checking if you want to build profiling libraries... $ECHO_C" >&6 # Check whether --with-profile or --without-profile was given. @@ -4694,7 +4220,7 @@ if test "${with_profile+set}" = set; then else with_profile=no fi; -echo "$as_me:4697: result: $with_profile" >&5 +echo "$as_me:4223: result: $with_profile" >&5 echo "${ECHO_T}$with_profile" >&6 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" @@ -4702,19 +4228,19 @@ fi ############################################################################### -echo "$as_me:4705: checking for specified models" >&5 +echo "$as_me:4231: checking for specified models" >&5 echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal test "$with_libtool" != "no" && cf_list_models=libtool -echo "$as_me:4709: result: $cf_list_models" >&5 +echo "$as_me:4235: result: $cf_list_models" >&5 echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. -echo "$as_me:4714: checking for default model" >&5 +echo "$as_me:4240: checking for default model" >&5 echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` -echo "$as_me:4717: result: $DFT_LWR_MODEL" >&5 +echo "$as_me:4243: result: $DFT_LWR_MODEL" >&5 echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` @@ -4743,7 +4269,7 @@ LIB_SUFFIX= ############################################################################### -echo "$as_me:4746: checking if you want to build a separate terminfo library" >&5 +echo "$as_me:4272: checking if you want to build a separate terminfo library" >&5 echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6 # Check whether --with-termlib or --without-termlib was given. @@ -4753,10 +4279,10 @@ if test "${with_termlib+set}" = set; then else with_termlib=no fi; -echo "$as_me:4756: result: $with_termlib" >&5 +echo "$as_me:4282: result: $with_termlib" >&5 echo "${ECHO_T}$with_termlib" >&6 -echo "$as_me:4759: checking if you want to build a separate tic library" >&5 +echo "$as_me:4285: checking if you want to build a separate tic library" >&5 echo $ECHO_N "checking if you want to build a separate tic library... $ECHO_C" >&6 # Check whether --with-ticlib or --without-ticlib was given. @@ -4766,13 +4292,13 @@ if test "${with_ticlib+set}" = set; then else with_ticlib=no fi; -echo "$as_me:4769: result: $with_ticlib" >&5 +echo "$as_me:4295: result: $with_ticlib" >&5 echo "${ECHO_T}$with_ticlib" >&6 ### Checks for special libraries, must be done up-front. SHLIB_LIST="" -echo "$as_me:4775: checking if you want to link with the GPM mouse library" >&5 +echo "$as_me:4301: checking if you want to link with the GPM mouse library" >&5 echo $ECHO_N "checking if you want to link with the GPM mouse library... $ECHO_C" >&6 # Check whether --with-gpm or --without-gpm was given. @@ -4782,27 +4308,27 @@ if test "${with_gpm+set}" = set; then else with_gpm=maybe fi; -echo "$as_me:4785: result: $with_gpm" >&5 +echo "$as_me:4311: result: $with_gpm" >&5 echo "${ECHO_T}$with_gpm" >&6 if test "$with_gpm" != no ; then - echo "$as_me:4789: checking for gpm.h" >&5 + echo "$as_me:4315: checking for gpm.h" >&5 echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6 if test "${ac_cv_header_gpm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4795 "configure" +#line 4321 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4799: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4325: \"$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:4805: \$? = $ac_status" >&5 + echo "$as_me:4331: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4821,7 +4347,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4824: result: $ac_cv_header_gpm_h" >&5 +echo "$as_me:4350: result: $ac_cv_header_gpm_h" >&5 echo "${ECHO_T}$ac_cv_header_gpm_h" >&6 if test $ac_cv_header_gpm_h = yes; then @@ -4832,14 +4358,14 @@ EOF if test "$with_gpm" != yes && test "$with_gpm" != maybe ; then test -n "$verbose" && echo " assuming we really have GPM library" 1>&6 -echo "${as_me:-configure}:4835: testing assuming we really have GPM library ..." 1>&5 +echo "${as_me-configure}:4361: testing assuming we really have GPM library ..." 1>&5 cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF else - echo "$as_me:4842: checking for Gpm_Open in -lgpm" >&5 + echo "$as_me:4368: 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 @@ -4847,7 +4373,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4850 "configure" +#line 4376 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4866,16 +4392,16 @@ Gpm_Open (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4869: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4395: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4872: \$? = $ac_status" >&5 + echo "$as_me:4398: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4875: \"$ac_try\"") >&5 + { (eval echo "$as_me:4401: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4878: \$? = $ac_status" >&5 + echo "$as_me:4404: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else @@ -4886,13 +4412,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4889: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "$as_me:4415: 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 : else - { { echo "$as_me:4895: error: Cannot link with GPM library" >&5 + { { echo "$as_me:4421: error: Cannot link with GPM library" >&5 echo "$as_me: error: Cannot link with GPM library" >&2;} { (exit 1); exit 1; }; } fi @@ -4902,7 +4428,7 @@ fi else - test "$with_gpm" != maybe && { echo "$as_me:4905: WARNING: Cannot find GPM header" >&5 + test "$with_gpm" != maybe && { echo "$as_me:4431: WARNING: Cannot find GPM header" >&5 echo "$as_me: WARNING: Cannot find GPM header" >&2;} with_gpm=no @@ -4911,7 +4437,7 @@ fi fi if test "$with_gpm" != no ; then - echo "$as_me:4914: checking if you want to load GPM dynamically" >&5 + echo "$as_me:4440: checking if you want to load GPM dynamically" >&5 echo $ECHO_N "checking if you want to load GPM dynamically... $ECHO_C" >&6 # Check whether --with-dlsym or --without-dlsym was given. @@ -4921,18 +4447,18 @@ if test "${with_dlsym+set}" = set; then else with_dlsym=yes fi; - echo "$as_me:4924: result: $with_dlsym" >&5 + echo "$as_me:4450: result: $with_dlsym" >&5 echo "${ECHO_T}$with_dlsym" >&6 if test "$with_dlsym" = yes ; then cf_have_dlsym=no -echo "$as_me:4929: checking for dlsym" >&5 +echo "$as_me:4455: checking for dlsym" >&5 echo $ECHO_N "checking for dlsym... $ECHO_C" >&6 if test "${ac_cv_func_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4935 "configure" +#line 4461 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlsym (); below. */ @@ -4963,16 +4489,16 @@ f = dlsym; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4966: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4492: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4969: \$? = $ac_status" >&5 + echo "$as_me:4495: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4972: \"$ac_try\"") >&5 + { (eval echo "$as_me:4498: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4975: \$? = $ac_status" >&5 + echo "$as_me:4501: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlsym=yes else @@ -4982,14 +4508,14 @@ ac_cv_func_dlsym=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4985: result: $ac_cv_func_dlsym" >&5 +echo "$as_me:4511: result: $ac_cv_func_dlsym" >&5 echo "${ECHO_T}$ac_cv_func_dlsym" >&6 if test $ac_cv_func_dlsym = yes; then cf_have_dlsym=yes else cf_have_libdl=no -echo "$as_me:4992: checking for dlsym in -ldl" >&5 +echo "$as_me:4518: checking for dlsym in -ldl" >&5 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4997,7 +4523,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 5000 "configure" +#line 4526 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -5016,16 +4542,16 @@ dlsym (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5019: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4545: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5022: \$? = $ac_status" >&5 + echo "$as_me:4548: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5025: \"$ac_try\"") >&5 + { (eval echo "$as_me:4551: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5028: \$? = $ac_status" >&5 + echo "$as_me:4554: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlsym=yes else @@ -5036,7 +4562,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:5039: result: $ac_cv_lib_dl_dlsym" >&5 +echo "$as_me:4565: result: $ac_cv_lib_dl_dlsym" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6 if test $ac_cv_lib_dl_dlsym = yes; then @@ -5049,10 +4575,10 @@ fi if test "$cf_have_dlsym" = yes ; then test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" - echo "$as_me:5052: checking whether able to link to dl*() functions" >&5 + echo "$as_me:4578: checking whether able to link to dl*() functions" >&5 echo $ECHO_N "checking whether able to link to dl*() functions... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 5055 "configure" +#line 4581 "configure" #include "confdefs.h" #include int @@ -5070,16 +4596,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5073: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4599: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5076: \$? = $ac_status" >&5 + echo "$as_me:4602: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5079: \"$ac_try\"") >&5 + { (eval echo "$as_me:4605: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5082: \$? = $ac_status" >&5 + echo "$as_me:4608: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\EOF @@ -5090,15 +4616,15 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - { { echo "$as_me:5093: error: Cannot link test program for libdl" >&5 + { { echo "$as_me:4619: error: Cannot link test program for libdl" >&5 echo "$as_me: error: Cannot link test program for libdl" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:5098: result: ok" >&5 + echo "$as_me:4624: result: ok" >&5 echo "${ECHO_T}ok" >&6 else - { { echo "$as_me:5101: error: Cannot find dlsym function" >&5 + { { echo "$as_me:4627: error: Cannot find dlsym function" >&5 echo "$as_me: error: Cannot find dlsym function" >&2;} { (exit 1); exit 1; }; } fi @@ -5106,12 +4632,12 @@ fi if test "$with_gpm" != yes ; then test -n "$verbose" && echo " assuming soname for gpm is $with_gpm" 1>&6 -echo "${as_me:-configure}:5109: testing assuming soname for gpm is $with_gpm ..." 1>&5 +echo "${as_me-configure}:4635: testing assuming soname for gpm is $with_gpm ..." 1>&5 cf_cv_gpm_soname="$with_gpm" else -echo "$as_me:5114: checking for soname of gpm library" >&5 +echo "$as_me:4640: checking for soname of gpm library" >&5 echo $ECHO_N "checking for soname of gpm library... $ECHO_C" >&6 if test "${cf_cv_gpm_soname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5129,26 +4655,26 @@ if (Gpm_Open(0,0)) Gpm_Close(); CF_EOF cf_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" - if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4658: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5135: \$? = $ac_status" >&5 + echo "$as_me:4661: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:5137: \"$ac_link\"") >&5 + if { (eval echo "$as_me:4663: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5140: \$? = $ac_status" >&5 + echo "$as_me:4666: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_gpm_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep libgpm.` test -z "$cf_cv_gpm_soname" && cf_cv_gpm_soname=unknown fi fi -rm -rf conftest* +rm -f conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:5151: result: $cf_cv_gpm_soname" >&5 +echo "$as_me:4677: result: $cf_cv_gpm_soname" >&5 echo "${ECHO_T}$cf_cv_gpm_soname" >&6 fi @@ -5159,13 +4685,12 @@ EOF SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" - TEST_LIBS="-lgpm $TEST_LIBS" fi cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF -echo "$as_me:5168: checking for Gpm_Wgetch in -lgpm" >&5 +echo "$as_me:4693: checking for Gpm_Wgetch in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Wgetch in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5173,7 +4698,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 5176 "configure" +#line 4701 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -5192,16 +4717,16 @@ Gpm_Wgetch (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5195: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4720: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5198: \$? = $ac_status" >&5 + echo "$as_me:4723: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5201: \"$ac_try\"") >&5 + { (eval echo "$as_me:4726: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5204: \$? = $ac_status" >&5 + echo "$as_me:4729: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Wgetch=yes else @@ -5212,11 +4737,11 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:5215: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 +echo "$as_me:4740: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Wgetch" >&6 if test $ac_cv_lib_gpm_Gpm_Wgetch = yes; then -echo "$as_me:5219: checking if GPM is weakly bound to curses library" >&5 +echo "$as_me:4744: checking if GPM is weakly bound to curses library" >&5 echo $ECHO_N "checking if GPM is weakly bound to curses library... $ECHO_C" >&6 if test "${cf_cv_check_gpm_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5240,31 +4765,31 @@ CF_EOF # to rely on the static library, noting that some packagers may not # include it. LIBS="-static -lgpm -dynamic $LIBS" - if { (eval echo "$as_me:5243: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4768: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5246: \$? = $ac_status" >&5 + echo "$as_me:4771: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:5248: \"$ac_link\"") >&5 + if { (eval echo "$as_me:4773: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5251: \$? = $ac_status" >&5 + echo "$as_me:4776: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_check_gpm_wgetch=`nm conftest$ac_exeext | egrep '\' | egrep '\<[vVwW]\>'` test -n "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=yes test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -rf conftest* + rm -f conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:5263: result: $cf_cv_check_gpm_wgetch" >&5 +echo "$as_me:4788: result: $cf_cv_check_gpm_wgetch" >&5 echo "${ECHO_T}$cf_cv_check_gpm_wgetch" >&6 if test "$cf_cv_check_gpm_wgetch" != yes ; then - { echo "$as_me:5267: WARNING: GPM library is already linked with curses - read the FAQ" >&5 + { echo "$as_me:4792: WARNING: GPM library is already linked with curses - read the FAQ" >&5 echo "$as_me: WARNING: GPM library is already linked with curses - read the FAQ" >&2;} fi @@ -5274,7 +4799,7 @@ fi # not everyone has "test -c" if test -c /dev/sysmouse 2>/dev/null ; then -echo "$as_me:5277: checking if you want to use sysmouse" >&5 +echo "$as_me:4802: checking if you want to use sysmouse" >&5 echo $ECHO_N "checking if you want to use sysmouse... $ECHO_C" >&6 # Check whether --with-sysmouse or --without-sysmouse was given. @@ -5286,7 +4811,7 @@ else fi; if test "$cf_with_sysmouse" != no ; then cat >conftest.$ac_ext <<_ACEOF -#line 5289 "configure" +#line 4814 "configure" #include "confdefs.h" #include @@ -5309,16 +4834,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5312: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5315: \$? = $ac_status" >&5 + echo "$as_me:4840: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5318: \"$ac_try\"") >&5 + { (eval echo "$as_me:4843: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5321: \$? = $ac_status" >&5 + echo "$as_me:4846: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_with_sysmouse=yes else @@ -5328,7 +4853,7 @@ cf_with_sysmouse=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:5331: result: $cf_with_sysmouse" >&5 +echo "$as_me:4856: result: $cf_with_sysmouse" >&5 echo "${ECHO_T}$cf_with_sysmouse" >&6 test "$cf_with_sysmouse" = yes && cat >>confdefs.h <<\EOF #define USE_SYSMOUSE 1 @@ -5346,7 +4871,7 @@ if test X"$CXX_G_OPT" = X"" ; then test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' fi -echo "$as_me:5349: checking for default loader flags" >&5 +echo "$as_me:4874: checking for default loader flags" >&5 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) LD_MODEL='' ;; @@ -5355,26 +4880,26 @@ debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; shared) LD_MODEL='' ;; esac -echo "$as_me:5358: result: $LD_MODEL" >&5 +echo "$as_me:4883: result: $LD_MODEL" >&5 echo "${ECHO_T}$LD_MODEL" >&6 case $DFT_LWR_MODEL in shared) -echo "$as_me:5364: checking if rpath option should be used" >&5 +echo "$as_me:4889: checking if rpath option should be used" >&5 echo $ECHO_N "checking if rpath option should be used... $ECHO_C" >&6 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" - cf_cv_enable_rpath=$enableval + cf_cv_ld_rpath=$enableval else - cf_cv_enable_rpath=no + cf_cv_ld_rpath=no fi; -echo "$as_me:5374: result: $cf_cv_enable_rpath" >&5 -echo "${ECHO_T}$cf_cv_enable_rpath" >&6 +echo "$as_me:4899: result: $cf_cv_ld_rpath" >&5 +echo "${ECHO_T}$cf_cv_ld_rpath" >&6 -echo "$as_me:5377: checking if shared libraries should be relinked during install" >&5 +echo "$as_me:4902: checking if shared libraries should be relinked during install" >&5 echo $ECHO_N "checking if shared libraries should be relinked during install... $ECHO_C" >&6 # Check whether --enable-relink or --disable-relink was given. @@ -5384,100 +4909,19 @@ if test "${enable_relink+set}" = set; then else cf_cv_do_relink=yes fi; -echo "$as_me:5387: result: $cf_cv_do_relink" >&5 +echo "$as_me:4912: result: $cf_cv_do_relink" >&5 echo "${ECHO_T}$cf_cv_do_relink" >&6 ;; esac -LD_RPATH_OPT= -echo "$as_me:5393: 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 - LD_RPATH_OPT="-Wl,-rpath," - else - LD_RPATH_OPT="-rpath " - fi - ;; -linux*|gnu*|k*bsd*-gnu) #(vi - LD_RPATH_OPT="-Wl,-rpath," - ;; -openbsd[2-9].*) #(vi - LD_RPATH_OPT="-Wl,-rpath," - ;; -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:5424: result: $LD_RPATH_OPT" >&5 -echo "${ECHO_T}$LD_RPATH_OPT" >&6 - -case "x$LD_RPATH_OPT" in #(vi -x-R*) - echo "$as_me:5429: 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" - LIBS="${LD_RPATH_OPT}$libdir $LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line 5434 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5446: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5449: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5452: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5455: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_rpath_space=no -else - echo "$as_me: failed program was:" >&5 -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:5465: result: $cf_rpath_space" >&5 -echo "${ECHO_T}$cf_rpath_space" >&6 - test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " - ;; -esac - LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no - cf_ld_rpath_opt= - test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" - echo "$as_me:5480: checking if release/abi version should be used for shared libs" >&5 + echo "$as_me:4924: checking if release/abi version should be used for shared libs" >&5 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 # Check whether --with-shlib-version or --without-shlib-version was given. @@ -5492,7 +4936,7 @@ if test "${with_shlib_version+set}" = set; then cf_cv_shlib_version=$withval ;; *) - { { echo "$as_me:5495: error: option value must be one of: rel, abi, auto or no" >&5 + { { echo "$as_me:4939: error: option value must be one of: rel, abi, auto or no" >&5 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} { (exit 1); exit 1; }; } ;; @@ -5501,7 +4945,7 @@ echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} else cf_cv_shlib_version=auto fi; - echo "$as_me:5504: result: $cf_cv_shlib_version" >&5 + echo "$as_me:4948: result: $cf_cv_shlib_version" >&5 echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no @@ -5510,14 +4954,14 @@ echo "${ECHO_T}$cf_cv_shlib_version" >&6 CC_SHARED_OPTS= if test "$GCC" = yes then - echo "$as_me:5513: checking which $CC option to use" >&5 + echo "$as_me:4957: checking which $CC option to use" >&5 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat >conftest.$ac_ext <<_ACEOF -#line 5520 "configure" +#line 4964 "configure" #include "confdefs.h" #include int @@ -5529,16 +4973,16 @@ int x = 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5532: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4976: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5535: \$? = $ac_status" >&5 + echo "$as_me:4979: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5538: \"$ac_try\"") >&5 + { (eval echo "$as_me:4982: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5541: \$? = $ac_status" >&5 + echo "$as_me:4985: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -5547,24 +4991,18 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done - echo "$as_me:5550: result: $CC_SHARED_OPTS" >&5 + echo "$as_me:4994: result: $CC_SHARED_OPTS" >&5 echo "${ECHO_T}$CC_SHARED_OPTS" >&6 CFLAGS="$cf_save_CFLAGS" fi cf_cv_shlib_version_infix=no - case $cf_cv_system_name in #(vi - aix[56]*) #(vi - if test "$GCC" = yes; then - CC_SHARED_OPTS= - MK_SHARED_LIB='$(CC) -shared' - fi - ;; - beos*) #(vi + case $cf_cv_system_name in + beos*) MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; - cygwin*) #(vi + cygwin*) CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}' cf_cv_shlib_version=cygdll @@ -5583,13 +5021,13 @@ EOF CF_EOF chmod +x mk_shared_lib.sh ;; - darwin*) #(vi + darwin*) EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes - echo "$as_me:5592: checking if ld -search_paths_first works" >&5 + echo "$as_me:5030: checking if ld -search_paths_first works" >&5 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5598,7 +5036,7 @@ else cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF -#line 5601 "configure" +#line 5039 "configure" #include "confdefs.h" int @@ -5610,16 +5048,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5613: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5051: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5616: \$? = $ac_status" >&5 + echo "$as_me:5054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5619: \"$ac_try\"") >&5 + { (eval echo "$as_me:5057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5622: \$? = $ac_status" >&5 + echo "$as_me:5060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ldflags_search_paths_first=yes else @@ -5630,13 +5068,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS=$cf_save_LDFLAGS fi -echo "$as_me:5633: result: $cf_cv_ldflags_search_paths_first" >&5 +echo "$as_me:5071: result: $cf_cv_ldflags_search_paths_first" >&5 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) #(vi + hpux*) # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -5649,9 +5087,15 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) #(vi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + irix*) + if test "$cf_cv_ld_rpath" = yes ; then + if test "$GCC" = yes; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + else + cf_ld_rpath_opt="-rpath " + EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + fi fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -5662,13 +5106,14 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) #(vi + linux*|gnu*|k*bsd*-gnu) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5680,13 +5125,14 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - openbsd[2-9].*) #(vi + openbsd[2-9].*) if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-Wl,-rpath," + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" @@ -5697,19 +5143,20 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - nto-qnx*|openbsd*|freebsd[12].*) #(vi + nto-qnx*|openbsd*|freebsd[12].*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) #(vi + freebsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then - LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then + LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" + cf_ld_rpath_opt="-rpath " + EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5719,14 +5166,15 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@' + MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $@` -o $@' ;; - netbsd*) #(vi + netbsd*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then - LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -5744,33 +5192,37 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@' else - MK_SHARED_LIB='${LD} -shared -Bshareable -o $@' + MK_SHARED_LIB='${LD} -Bshareable -o $@' fi ;; - osf*|mls+*) #(vi + osf*|mls+*) # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`' - case $host_os in #(vi + case $host_os in osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-rpath" + # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@' - if test "$cf_cv_enable_rpath" = yes ; then + if test "$cf_cv_ld_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -5778,7 +5230,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) #(vi + sunos4*) # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5786,15 +5238,16 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${LD} -assert pure-text -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) #(vi + solaris2*) # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_ld_rpath" = yes ; then + cf_ld_rpath_opt="-R" + EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5805,49 +5258,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi if test "$GCC" != yes; then - cf_save_CFLAGS="$CFLAGS" - for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O - do - CFLAGS="$cf_shared_opts $cf_save_CFLAGS" - cat >conftest.$ac_ext <<_ACEOF -#line 5813 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello\n"); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5825: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:5828: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5831: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5834: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext - done - CFLAGS="$cf_save_CFLAGS" - CC_SHARED_OPTS=$cf_shared_opts + CC_SHARED_OPTS='-xcode=pic32' MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@' fi ;; - sysv5uw7*|unix_sv*) #(vi + sysv5uw7*|unix_sv*) # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5864,11 +5281,11 @@ rm -f conftest.$ac_objext conftest.$ac_ext case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $@') #(vi + *'-o $@') test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) - { echo "$as_me:5871: WARNING: ignored --with-shlib-version" >&5 + { echo "$as_me:5288: WARNING: ignored --with-shlib-version" >&5 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac @@ -5876,278 +5293,62 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} esac if test -n "$cf_ld_rpath_opt" ; then + echo "$as_me:5296: 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" + LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" + cat >conftest.$ac_ext <<_ACEOF +#line 5301 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5313: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5316: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5319: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5322: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_space=no +else + echo "$as_me: failed program was:" >&5 +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:5332: result: $cf_rpath_space" >&5 +echo "${ECHO_T}$cf_rpath_space" >&6 + test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi if test "$CC_SHARED_OPTS" = "unknown"; then for model in $cf_list_models; do if test "$model" = "shared"; then - { { echo "$as_me:5885: error: Shared libraries are not supported in this version" >&5 + { { echo "$as_me:5341: error: Shared libraries are not supported in this version" >&5 echo "$as_me: error: Shared libraries are not supported in this version" >&2;} { (exit 1); exit 1; }; } fi done fi -### If we're building with rpath, try to link non-standard libs that way too. -if test "$DFT_LWR_MODEL" = "shared"; then - -echo "$as_me:5895: 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 - cf_disable_rpath_hack=yes - else - cf_disable_rpath_hack=no - fi -else - enableval=yes - cf_disable_rpath_hack=no - -fi; -echo "$as_me:5912: 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:5916: 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:5919: 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:5926: 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 -else - if test -n "$cf_ldd_prog"; then - ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:5941: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -cf_ldd_prog=$ac_cv_prog_cf_ldd_prog -if test -n "$cf_ldd_prog"; then - echo "$as_me:5949: result: $cf_ldd_prog" >&5 -echo "${ECHO_T}$cf_ldd_prog" >&6 -else - echo "$as_me:5952: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$cf_ldd_prog" && break -done -test -n "$cf_ldd_prog" || cf_ldd_prog="no" - - cf_rpath_list="/usr/lib /lib" - if test "$cf_ldd_prog" != no - then - cf_rpath_oops= - -cat >conftest.$ac_ext <<_ACEOF -#line 5966 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello"); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5978: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5981: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5984: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5987: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` - cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u` -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - - # If we passed the link-test, but get a "not found" on a given library, - # this could be due to inept reconfiguration of gcc to make it only - # partly honor /usr/local/lib (or whatever). Sometimes this behavior - # is intentional, e.g., installing gcc in /usr/bin and suppressing the - # /usr/local libraries. - if test -n "$cf_rpath_oops" - then - for cf_rpath_src in $cf_rpath_oops - do - for cf_rpath_dir in \ - /usr/local \ - /usr/pkg \ - /opt/sfw - do - if test -f $cf_rpath_dir/lib/$cf_rpath_src - then - test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 - -echo "${as_me:-configure}:6015: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 - - LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" - break - fi - done - done - fi - fi - - test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me:-configure}:6027: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me:-configure}:6031: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 - -cf_rpath_dst= -for cf_rpath_src in $LDFLAGS -do - case $cf_rpath_src in #(vi - -L*) #(vi - - # check if this refers to a directory which we will ignore - cf_rpath_skip=no - if test -n "$cf_rpath_list" - then - for cf_rpath_item in $cf_rpath_list - do - if test "x$cf_rpath_src" = "x-L$cf_rpath_item" - then - cf_rpath_skip=yes - break - fi - done - fi - - if test "$cf_rpath_skip" = no - then - # transform the option - if test "$LD_RPATH_OPT" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` - fi - - # if we have not already added this, add it now - cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` - if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" - then - test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 - -echo "${as_me:-configure}:6068: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 - - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - fi - fi - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" -done -LDFLAGS=$cf_rpath_dst - -test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me:-configure}:6081: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 - -test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 - -echo "${as_me:-configure}:6085: testing ...checking LIBS $LIBS ..." 1>&5 - -cf_rpath_dst= -for cf_rpath_src in $LIBS -do - case $cf_rpath_src in #(vi - -L*) #(vi - - # check if this refers to a directory which we will ignore - cf_rpath_skip=no - if test -n "$cf_rpath_list" - then - for cf_rpath_item in $cf_rpath_list - do - if test "x$cf_rpath_src" = "x-L$cf_rpath_item" - then - cf_rpath_skip=yes - break - fi - done - fi - - if test "$cf_rpath_skip" = no - then - # transform the option - if test "$LD_RPATH_OPT" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` - fi - - # if we have not already added this, add it now - cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` - if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" - then - test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 - -echo "${as_me:-configure}:6122: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 - - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - fi - fi - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" -done -LIBS=$cf_rpath_dst - -test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 - -echo "${as_me:-configure}:6135: testing ...checked LIBS $LIBS ..." 1>&5 - - test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me:-configure}:6139: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -fi - -fi - -fi - ############################################################################### ### use option --disable-overwrite to leave out the link to -lcurses -echo "$as_me:6150: checking if you wish to install ncurses overwriting curses" >&5 +echo "$as_me:5351: checking if you wish to install ncurses overwriting curses" >&5 echo $ECHO_N "checking if you wish to install ncurses overwriting curses... $ECHO_C" >&6 # Check whether --enable-overwrite or --disable-overwrite was given. @@ -6157,10 +5358,10 @@ if test "${enable_overwrite+set}" = set; then else if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi fi; -echo "$as_me:6160: result: $with_overwrite" >&5 +echo "$as_me:5361: result: $with_overwrite" >&5 echo "${ECHO_T}$with_overwrite" >&6 -echo "$as_me:6163: checking if external terminfo-database is used" >&5 +echo "$as_me:5364: checking if external terminfo-database is used" >&5 echo $ECHO_N "checking if external terminfo-database is used... $ECHO_C" >&6 # Check whether --enable-database or --disable-database was given. @@ -6170,7 +5371,7 @@ if test "${enable_database+set}" = set; then else use_database=yes fi; -echo "$as_me:6173: result: $use_database" >&5 +echo "$as_me:5374: result: $use_database" >&5 echo "${ECHO_T}$use_database" >&6 case $host_os in #(vi @@ -6183,8 +5384,8 @@ os2*) #(vi esac case $cf_cv_system_name in - os2*) PATH_SEPARATOR=';' ;; - *) PATH_SEPARATOR=':' ;; + os2*) PATHSEP=';' ;; + *) PATHSEP=':' ;; esac if test "$use_database" != no ; then @@ -6192,18 +5393,18 @@ if test "$use_database" != no ; then #define USE_DATABASE 1 EOF - echo "$as_me:6195: checking which terminfo source-file will be installed" >&5 + echo "$as_me:5396: checking which terminfo source-file will be installed" >&5 echo $ECHO_N "checking which terminfo source-file will be installed... $ECHO_C" >&6 -# Check whether --with-database or --without-database was given. -if test "${with_database+set}" = set; then - withval="$with_database" +# Check whether --enable-database or --disable-database was given. +if test "${enable_database+set}" = set; then + enableval="$enable_database" TERMINFO_SRC=$withval fi; - echo "$as_me:6203: result: $TERMINFO_SRC" >&5 + echo "$as_me:5404: result: $TERMINFO_SRC" >&5 echo "${ECHO_T}$TERMINFO_SRC" >&6 - echo "$as_me:6206: checking whether to use hashed database instead of directory/tree" >&5 + echo "$as_me:5407: checking whether to use hashed database instead of directory/tree" >&5 echo $ECHO_N "checking whether to use hashed database instead of directory/tree... $ECHO_C" >&6 # Check whether --with-hashed-db or --without-hashed-db was given. @@ -6213,13 +5414,13 @@ if test "${with_hashed_db+set}" = set; then else with_hashed_db=no fi; - echo "$as_me:6216: result: $with_hashed_db" >&5 + echo "$as_me:5417: result: $with_hashed_db" >&5 echo "${ECHO_T}$with_hashed_db" >&6 else with_hashed_db=no fi -echo "$as_me:6222: checking for list of fallback descriptions" >&5 +echo "$as_me:5423: checking for list of fallback descriptions" >&5 echo $ECHO_N "checking for list of fallback descriptions... $ECHO_C" >&6 # Check whether --with-fallbacks or --without-fallbacks was given. @@ -6229,11 +5430,11 @@ if test "${with_fallbacks+set}" = set; then else with_fallback= fi; -echo "$as_me:6232: result: $with_fallback" >&5 +echo "$as_me:5433: result: $with_fallback" >&5 echo "${ECHO_T}$with_fallback" >&6 FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'` -echo "$as_me:6236: checking if you want modern xterm or antique" >&5 +echo "$as_me:5437: checking if you want modern xterm or antique" >&5 echo $ECHO_N "checking if you want modern xterm or antique... $ECHO_C" >&6 # Check whether --with-xterm-new or --without-xterm-new was given. @@ -6247,7 +5448,7 @@ case $with_xterm_new in no) with_xterm_new=xterm-old;; *) with_xterm_new=xterm-new;; esac -echo "$as_me:6250: result: $with_xterm_new" >&5 +echo "$as_me:5451: result: $with_xterm_new" >&5 echo "${ECHO_T}$with_xterm_new" >&6 WHICH_XTERM=$with_xterm_new @@ -6257,7 +5458,7 @@ if test "$use_database" = no ; then MAKE_TERMINFO="#" else -echo "$as_me:6260: checking for list of terminfo directories" >&5 +echo "$as_me:5461: checking for list of terminfo directories" >&5 echo $ECHO_N "checking for list of terminfo directories... $ECHO_C" >&6 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given. @@ -6265,9 +5466,9 @@ if test "${with_terminfo_dirs+set}" = set; then withval="$with_terminfo_dirs" else - withval=${TERMINFO_DIRS:-${datadir}/terminfo} + withval=${TERMINFO_DIRS-${datadir}/terminfo} fi; -IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do @@ -6297,7 +5498,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:6300: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:5501: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -6310,13 +5511,13 @@ IFS="$ac_save_ifs" eval 'TERMINFO_DIRS="$cf_dst_path"' -echo "$as_me:6313: result: $TERMINFO_DIRS" >&5 +echo "$as_me:5514: result: $TERMINFO_DIRS" >&5 echo "${ECHO_T}$TERMINFO_DIRS" >&6 test -n "$TERMINFO_DIRS" && cat >>confdefs.h <&5 +echo "$as_me:5520: checking for default terminfo directory" >&5 echo $ECHO_N "checking for default terminfo directory... $ECHO_C" >&6 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given. @@ -6324,7 +5525,7 @@ if test "${with_default_terminfo_dir+set}" = set; then withval="$with_default_terminfo_dir" else - withval="${TERMINFO:-${datadir}/terminfo}" + withval="${TERMINFO-${datadir}/terminfo}" fi; if test -n "${datadir}/terminfo" ; then if test "x$prefix" != xNONE; then @@ -6352,7 +5553,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:6355: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:5556: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -6361,7 +5562,7 @@ esac fi TERMINFO="$withval" -echo "$as_me:6364: result: $TERMINFO" >&5 +echo "$as_me:5565: result: $TERMINFO" >&5 echo "${ECHO_T}$TERMINFO" >&6 cat >>confdefs.h <&5 +echo "$as_me:5575: checking if big-core option selected" >&5 echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6 # Check whether --enable-big-core or --disable-big-core was given. @@ -6383,7 +5584,7 @@ else with_big_core=no else cat >conftest.$ac_ext <<_ACEOF -#line 6386 "configure" +#line 5587 "configure" #include "confdefs.h" #include @@ -6397,15 +5598,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:6400: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5601: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6403: \$? = $ac_status" >&5 + echo "$as_me:5604: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6405: \"$ac_try\"") >&5 + { (eval echo "$as_me:5606: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6408: \$? = $ac_status" >&5 + echo "$as_me:5609: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_big_core=yes else @@ -6417,7 +5618,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi; -echo "$as_me:6420: result: $with_big_core" >&5 +echo "$as_me:5621: result: $with_big_core" >&5 echo "${ECHO_T}$with_big_core" >&6 test "$with_big_core" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_BIG_CORE 1 @@ -6426,7 +5627,7 @@ EOF ### ISO C only guarantees 512-char strings, we have tables which load faster ### when constructed using "big" strings. More than the C compiler, the awk ### program is a limit on most vendor UNIX systems. Check that we can build. -echo "$as_me:6429: checking if big-strings option selected" >&5 +echo "$as_me:5630: checking if big-strings option selected" >&5 echo $ECHO_N "checking if big-strings option selected... $ECHO_C" >&6 # Check whether --enable-big-strings or --disable-big-strings was given. @@ -6435,29 +5636,29 @@ if test "${enable_big_strings+set}" = set; then with_big_strings=$enableval else - case x$AWK in #(vi - x) - eval with_big_strings=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval with_big_strings=yes - else - eval with_big_strings=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval with_big_strings=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval with_big_strings=yes + else + eval with_big_strings=no + fi + ;; + esac fi; -echo "$as_me:6453: result: $with_big_strings" >&5 +echo "$as_me:5654: result: $with_big_strings" >&5 echo "${ECHO_T}$with_big_strings" >&6 USE_BIG_STRINGS=0 test "$with_big_strings" = "yes" && USE_BIG_STRINGS=1 ### use option --enable-termcap to compile in the termcap fallback support -echo "$as_me:6460: checking if you want termcap-fallback support" >&5 +echo "$as_me:5661: checking if you want termcap-fallback support" >&5 echo $ECHO_N "checking if you want termcap-fallback support... $ECHO_C" >&6 # Check whether --enable-termcap or --disable-termcap was given. @@ -6467,13 +5668,13 @@ if test "${enable_termcap+set}" = set; then else with_termcap=no fi; -echo "$as_me:6470: result: $with_termcap" >&5 +echo "$as_me:5671: result: $with_termcap" >&5 echo "${ECHO_T}$with_termcap" >&6 if test "$with_termcap" != "yes" ; then if test "$use_database" = no ; then if test -z "$with_fallback" ; then - { { echo "$as_me:6476: error: You have disabled the database w/o specifying fallbacks" >&5 + { { echo "$as_me:5677: error: You have disabled the database w/o specifying fallbacks" >&5 echo "$as_me: error: You have disabled the database w/o specifying fallbacks" >&2;} { (exit 1); exit 1; }; } fi @@ -6485,7 +5686,7 @@ EOF else if test "$with_ticlib" != no ; then - { { echo "$as_me:6488: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 + { { echo "$as_me:5689: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 echo "$as_me: error: Options --with-ticlib and --enable-termcap cannot be combined" >&2;} { (exit 1); exit 1; }; } fi @@ -6494,7 +5695,7 @@ cat >>confdefs.h <<\EOF #define USE_TERMCAP 1 EOF -echo "$as_me:6497: checking for list of termcap files" >&5 +echo "$as_me:5698: checking for list of termcap files" >&5 echo $ECHO_N "checking for list of termcap files... $ECHO_C" >&6 # Check whether --with-termpath or --without-termpath was given. @@ -6502,9 +5703,9 @@ if test "${with_termpath+set}" = set; then withval="$with_termpath" else - withval=${TERMPATH:-/etc/termcap:/usr/share/misc/termcap} + withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} fi; -IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" +IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" cf_dst_path= for cf_src_path in $withval do @@ -6534,7 +5735,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:6537: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:5738: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -6547,14 +5748,14 @@ IFS="$ac_save_ifs" eval 'TERMPATH="$cf_dst_path"' -echo "$as_me:6550: result: $TERMPATH" >&5 +echo "$as_me:5751: result: $TERMPATH" >&5 echo "${ECHO_T}$TERMPATH" >&6 test -n "$TERMPATH" && cat >>confdefs.h <&5 +echo "$as_me:5758: checking if fast termcap-loader is needed" >&5 echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6 # Check whether --enable-getcap or --disable-getcap was given. @@ -6564,13 +5765,13 @@ if test "${enable_getcap+set}" = set; then else with_getcap=no fi; -echo "$as_me:6567: result: $with_getcap" >&5 +echo "$as_me:5768: result: $with_getcap" >&5 echo "${ECHO_T}$with_getcap" >&6 test "$with_getcap" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP 1 EOF -echo "$as_me:6573: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "$as_me:5774: checking if translated termcaps will be cached in ~/.terminfo" >&5 echo $ECHO_N "checking if translated termcaps will be cached in ~/.terminfo... $ECHO_C" >&6 # Check whether --enable-getcap-cache or --disable-getcap-cache was given. @@ -6580,7 +5781,7 @@ if test "${enable_getcap_cache+set}" = set; then else with_getcap_cache=no fi; -echo "$as_me:6583: result: $with_getcap_cache" >&5 +echo "$as_me:5784: result: $with_getcap_cache" >&5 echo "${ECHO_T}$with_getcap_cache" >&6 test "$with_getcap_cache" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP_CACHE 1 @@ -6589,7 +5790,7 @@ EOF fi ### Use option --disable-home-terminfo to completely remove ~/.terminfo -echo "$as_me:6592: checking if ~/.terminfo is wanted" >&5 +echo "$as_me:5793: checking if ~/.terminfo is wanted" >&5 echo $ECHO_N "checking if ~/.terminfo is wanted... $ECHO_C" >&6 # Check whether --enable-home-terminfo or --disable-home-terminfo was given. @@ -6599,13 +5800,13 @@ if test "${enable_home_terminfo+set}" = set; then else with_home_terminfo=yes fi; -echo "$as_me:6602: result: $with_home_terminfo" >&5 +echo "$as_me:5803: result: $with_home_terminfo" >&5 echo "${ECHO_T}$with_home_terminfo" >&6 test "$with_home_terminfo" = "yes" && cat >>confdefs.h <<\EOF #define USE_HOME_TERMINFO 1 EOF -echo "$as_me:6608: checking if you want to use restricted environment when running as root" >&5 +echo "$as_me:5809: checking if you want to use restricted environment when running as root" >&5 echo $ECHO_N "checking if you want to use restricted environment when running as root... $ECHO_C" >&6 # Check whether --enable-root-environ or --disable-root-environ was given. @@ -6615,7 +5816,7 @@ if test "${enable_root_environ+set}" = set; then else with_root_environ=yes fi; -echo "$as_me:6618: result: $with_root_environ" >&5 +echo "$as_me:5819: result: $with_root_environ" >&5 echo "${ECHO_T}$with_root_environ" >&6 test "$with_root_environ" = yes && cat >>confdefs.h <<\EOF #define USE_ROOT_ENVIRON 1 @@ -6629,13 +5830,13 @@ for ac_func in \ unlink do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:6632: checking for $ac_func" >&5 +echo "$as_me:5833: 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 6638 "configure" +#line 5839 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -6666,16 +5867,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6669: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5870: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6672: \$? = $ac_status" >&5 + echo "$as_me:5873: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6675: \"$ac_try\"") >&5 + { (eval echo "$as_me:5876: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6678: \$? = $ac_status" >&5 + echo "$as_me:5879: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -6685,7 +5886,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6688: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:5889: 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 <&5 +echo "$as_me:5906: 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 6711 "configure" +#line 5912 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -6739,16 +5940,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6742: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5943: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6745: \$? = $ac_status" >&5 + echo "$as_me:5946: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6748: \"$ac_try\"") >&5 + { (eval echo "$as_me:5949: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6751: \$? = $ac_status" >&5 + echo "$as_me:5952: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -6758,7 +5959,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6761: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:5962: 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 <&5 + echo "$as_me:5973: checking if link/symlink functions work" >&5 echo $ECHO_N "checking if link/symlink functions work... $ECHO_C" >&6 if test "${cf_cv_link_funcs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6782,7 +5983,7 @@ else eval 'ac_cv_func_'$cf_func'=error' else cat >conftest.$ac_ext <<_ACEOF -#line 6785 "configure" +#line 5986 "configure" #include "confdefs.h" #include @@ -6812,15 +6013,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:6815: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6016: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6818: \$? = $ac_status" >&5 + echo "$as_me:6019: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6820: \"$ac_try\"") >&5 + { (eval echo "$as_me:6021: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6823: \$? = $ac_status" >&5 + echo "$as_me:6024: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" @@ -6838,7 +6039,7 @@ fi test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no fi -echo "$as_me:6841: result: $cf_cv_link_funcs" >&5 +echo "$as_me:6042: result: $cf_cv_link_funcs" >&5 echo "${ECHO_T}$cf_cv_link_funcs" >&6 test "$ac_cv_func_link" = yes && cat >>confdefs.h <<\EOF #define HAVE_LINK 1 @@ -6856,7 +6057,7 @@ with_symlinks=no # soft links (symbolic links) are useful for some systems where hard links do # not work, or to make it simpler to copy terminfo trees around. if test "$ac_cv_func_symlink" = yes ; then - echo "$as_me:6859: checking if tic should use symbolic links" >&5 + echo "$as_me:6060: checking if tic should use symbolic links" >&5 echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 # Check whether --enable-symlinks or --disable-symlinks was given. @@ -6866,21 +6067,21 @@ if test "${enable_symlinks+set}" = set; then else with_symlinks=no fi; - echo "$as_me:6869: result: $with_symlinks" >&5 + echo "$as_me:6070: result: $with_symlinks" >&5 echo "${ECHO_T}$with_symlinks" >&6 fi # If we have hard links and did not choose to use soft links instead, there is # no reason to make this choice optional - use the hard links. if test "$with_symlinks" = no ; then - echo "$as_me:6876: checking if tic should use hard links" >&5 + echo "$as_me:6077: checking if tic should use hard links" >&5 echo $ECHO_N "checking if tic should use hard links... $ECHO_C" >&6 if test "$ac_cv_func_link" = yes ; then with_links=yes else with_links=no fi - echo "$as_me:6883: result: $with_links" >&5 + echo "$as_me:6084: result: $with_links" >&5 echo "${ECHO_T}$with_links" >&6 fi @@ -6893,7 +6094,7 @@ test "$with_symlinks" = yes && cat >>confdefs.h <<\EOF EOF ### use option --enable-broken-linker to force on use of broken-linker support -echo "$as_me:6896: checking if you want broken-linker support code" >&5 +echo "$as_me:6097: checking if you want broken-linker support code" >&5 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. @@ -6901,9 +6102,9 @@ if test "${enable_broken_linker+set}" = set; then enableval="$enable_broken_linker" with_broken_linker=$enableval else - with_broken_linker=${BROKEN_LINKER:-no} + with_broken_linker=${BROKEN_LINKER-no} fi; -echo "$as_me:6906: result: $with_broken_linker" >&5 +echo "$as_me:6107: result: $with_broken_linker" >&5 echo "${ECHO_T}$with_broken_linker" >&6 BROKEN_LINKER=0 @@ -6923,14 +6124,14 @@ EOF BROKEN_LINKER=1 test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 -echo "${as_me:-configure}:6926: testing cygwin linker is broken anyway ..." 1>&5 +echo "${as_me-configure}:6127: testing cygwin linker is broken anyway ..." 1>&5 ;; esac fi ### use option --enable-bsdpad to have tputs process BSD-style prefix padding -echo "$as_me:6933: checking if tputs should process BSD-style prefix padding" >&5 +echo "$as_me:6134: checking if tputs should process BSD-style prefix padding" >&5 echo $ECHO_N "checking if tputs should process BSD-style prefix padding... $ECHO_C" >&6 # Check whether --enable-bsdpad or --disable-bsdpad was given. @@ -6940,7 +6141,7 @@ if test "${enable_bsdpad+set}" = set; then else with_bsdpad=no fi; -echo "$as_me:6943: result: $with_bsdpad" >&5 +echo "$as_me:6144: result: $with_bsdpad" >&5 echo "${ECHO_T}$with_bsdpad" >&6 test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF #define BSD_TPUTS 1 @@ -6957,22 +6158,66 @@ NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" +echo "$as_me:6161: checking if $CC -U and -D options work together" >&5 +echo $ECHO_N "checking if $CC -U and -D options work together... $ECHO_C" >&6 +if test "${cf_cv_cc_u_d_options+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" + cat >conftest.$ac_ext <<_ACEOF +#line 6170 "configure" +#include "confdefs.h" + +int +main () +{ + +#ifndef U_D_OPTIONS +make an undefined-error +#endif +#ifdef D_U_OPTIONS +make a defined-error +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:6189: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:6192: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:6195: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:6198: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_cc_u_d_options=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + cf_cv_cc_u_d_options=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save_CPPFLAGS" + +fi +echo "$as_me:6212: result: $cf_cv_cc_u_d_options" >&5 +echo "${ECHO_T}$cf_cv_cc_u_d_options" >&6 + cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L -cf_xopen_source= case $host_os in #(vi -aix[456]*) #(vi - cf_xopen_source="-D_ALL_SOURCE" - ;; -cygwin) #(vi - cf_XOPEN_SOURCE=600 - ;; -darwin[0-8].*) #(vi - cf_xopen_source="-D_APPLE_C_SOURCE" - ;; -darwin*) #(vi - cf_xopen_source="-D_DARWIN_C_SOURCE" +aix[45]*) #(vi + CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -6980,27 +6225,24 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L 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 - cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; hpux*) #(vi - cf_xopen_source="-D_HPUX_SOURCE" + CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" ;; irix[56].*) #(vi - cf_xopen_source="-D_SGI_SOURCE" + CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" ;; -linux*|gnu*|mint*|k*bsd*-gnu) #(vi +linux*|gnu*|k*bsd*-gnu) #(vi -echo "$as_me:6996: checking if we must define _GNU_SOURCE" >&5 +echo "$as_me:6238: 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 7003 "configure" +#line 6245 "configure" #include "confdefs.h" #include int @@ -7015,16 +6257,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7018: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6260: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7021: \$? = $ac_status" >&5 + echo "$as_me:6263: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7024: \"$ac_try\"") >&5 + { (eval echo "$as_me:6266: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7027: \$? = $ac_status" >&5 + echo "$as_me:6269: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -7033,7 +6275,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 7036 "configure" +#line 6278 "configure" #include "confdefs.h" #include int @@ -7048,16 +6290,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7051: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6293: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7054: \$? = $ac_status" >&5 + echo "$as_me:6296: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7057: \"$ac_try\"") >&5 + { (eval echo "$as_me:6299: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7060: \$? = $ac_status" >&5 + echo "$as_me:6302: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -7072,7 +6314,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7075: result: $cf_cv_gnu_source" >&5 +echo "$as_me:6317: 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" @@ -7087,29 +6329,26 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[45]*) #(vi - cf_xopen_source="-D_OSF_SOURCE" + CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" ;; nto-qnx*) #(vi - cf_xopen_source="-D_QNX_SOURCE" + CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris2.1[0-9]) #(vi - cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - ;; -solaris2.[1-9]) #(vi - cf_xopen_source="-D__EXTENSIONS__" +solaris*) #(vi + CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" ;; *) - echo "$as_me:7105: checking if we should define _XOPEN_SOURCE" >&5 + echo "$as_me:6344: 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 7112 "configure" +#line 6351 "configure" #include "confdefs.h" #include int @@ -7124,16 +6363,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7127: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6366: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7130: \$? = $ac_status" >&5 + echo "$as_me:6369: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7133: \"$ac_try\"") >&5 + { (eval echo "$as_me:6372: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7136: \$? = $ac_status" >&5 + echo "$as_me:6375: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -7142,7 +6381,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 7145 "configure" +#line 6384 "configure" #include "confdefs.h" #include int @@ -7157,16 +6396,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7160: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6399: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7163: \$? = $ac_status" >&5 + echo "$as_me:6402: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7166: \"$ac_try\"") >&5 + { (eval echo "$as_me:6405: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7169: \$? = $ac_status" >&5 + echo "$as_me:6408: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -7181,98 +6420,23 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7184: result: $cf_cv_xopen_source" >&5 +echo "$as_me:6423: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then +# remove _XOPEN_SOURCE symbol from $CFLAGS CFLAGS=`echo "$CFLAGS" | \ - sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` +# remove _XOPEN_SOURCE symbol from $CPPFLAGS CPPFLAGS=`echo "$CPPFLAGS" | \ - sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` - - cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi + sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + test "$cf_cv_cc_u_d_options" = yes && \ + CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" + CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" fi cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE @@ -7280,24 +6444,26 @@ cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" +# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ - sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` +# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ - sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` -echo "$as_me:7291: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:6457: 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}:7297: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me-configure}:6463: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 7300 "configure" +#line 6466 "configure" #include "confdefs.h" #include int @@ -7312,16 +6478,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7315: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6481: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7318: \$? = $ac_status" >&5 + echo "$as_me:6484: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7321: \"$ac_try\"") >&5 + { (eval echo "$as_me:6487: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7324: \$? = $ac_status" >&5 + echo "$as_me:6490: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -7342,7 +6508,7 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 7345 "configure" +#line 6511 "configure" #include "confdefs.h" #include int @@ -7357,16 +6523,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7360: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6526: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7363: \$? = $ac_status" >&5 + echo "$as_me:6529: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7366: \"$ac_try\"") >&5 + { (eval echo "$as_me:6532: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7369: \$? = $ac_status" >&5 + echo "$as_me:6535: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -7377,15 +6543,15 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me:-configure}:7380: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me-configure}:6546: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "${as_me:-configure}:7385: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me-configure}:6551: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 7388 "configure" +#line 6554 "configure" #include "confdefs.h" #include int @@ -7400,16 +6566,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7403: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6569: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7406: \$? = $ac_status" >&5 + echo "$as_me:6572: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7409: \"$ac_try\"") >&5 + { (eval echo "$as_me:6575: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7412: \$? = $ac_status" >&5 + echo "$as_me:6578: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -7425,188 +6591,33 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7428: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:6594: 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 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - + if test "$cf_cv_cc_u_d_options" = yes ; then + cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ + sed -e 's/-D/-U/g' -e 's/=[^ ]*//g'` + CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" + fi + CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" fi ;; esac -if test -n "$cf_xopen_source" ; then - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -fi - # Work around breakage on OS X -echo "$as_me:7602: checking if SIGWINCH is defined" >&5 +echo "$as_me:6613: 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 7609 "configure" +#line 6620 "configure" #include "confdefs.h" #include @@ -7621,23 +6632,23 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7624: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6635: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7627: \$? = $ac_status" >&5 + echo "$as_me:6638: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7630: \"$ac_try\"") >&5 + { (eval echo "$as_me:6641: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7633: \$? = $ac_status" >&5 + echo "$as_me:6644: \$? = $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 7640 "configure" +#line 6651 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -7655,16 +6666,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7658: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6669: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7661: \$? = $ac_status" >&5 + echo "$as_me:6672: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7664: \"$ac_try\"") >&5 + { (eval echo "$as_me:6675: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7667: \$? = $ac_status" >&5 + echo "$as_me:6678: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_define_sigwinch=maybe else @@ -7678,11 +6689,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7681: result: $cf_cv_define_sigwinch" >&5 +echo "$as_me:6692: 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:7685: checking for actual SIGWINCH definition" >&5 +echo "$as_me:6696: 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 @@ -7693,7 +6704,7 @@ cf_sigwinch=32 while test $cf_sigwinch != 1 do cat >conftest.$ac_ext <<_ACEOF -#line 7696 "configure" +#line 6707 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -7715,16 +6726,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7718: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6729: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7721: \$? = $ac_status" >&5 + echo "$as_me:6732: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7724: \"$ac_try\"") >&5 + { (eval echo "$as_me:6735: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7727: \$? = $ac_status" >&5 + echo "$as_me:6738: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_fixup_sigwinch=$cf_sigwinch break @@ -7738,7 +6749,7 @@ cf_sigwinch=`expr $cf_sigwinch - 1` done fi -echo "$as_me:7741: result: $cf_cv_fixup_sigwinch" >&5 +echo "$as_me:6752: result: $cf_cv_fixup_sigwinch" >&5 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6 if test "$cf_cv_fixup_sigwinch" != unknown ; then @@ -7748,13 +6759,13 @@ fi # Checks for CODESET support. - echo "$as_me:7751: checking for nl_langinfo and CODESET" >&5 + echo "$as_me:6762: 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 7757 "configure" +#line 6768 "configure" #include "confdefs.h" #include int @@ -7766,16 +6777,16 @@ char* cs = nl_langinfo(CODESET); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7769: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6780: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7772: \$? = $ac_status" >&5 + echo "$as_me:6783: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7775: \"$ac_try\"") >&5 + { (eval echo "$as_me:6786: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7778: \$? = $ac_status" >&5 + echo "$as_me:6789: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else @@ -7786,7 +6797,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:7789: result: $am_cv_langinfo_codeset" >&5 +echo "$as_me:6800: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then @@ -7800,7 +6811,7 @@ EOF NCURSES_OK_WCHAR_T= NCURSES_OK_WINT_T= -echo "$as_me:7803: checking if you want wide-character code" >&5 +echo "$as_me:6814: checking if you want wide-character code" >&5 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. @@ -7810,7 +6821,7 @@ if test "${enable_widec+set}" = set; then else with_widec=no fi; -echo "$as_me:7813: result: $with_widec" >&5 +echo "$as_me:6824: result: $with_widec" >&5 echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" @@ -7818,15 +6829,10 @@ if test "$with_widec" = yes ; then #define USE_WIDEC_SUPPORT 1 EOF - case "$CFLAGS $CPPFLAGS" in #(vi - *-D_XOPEN_SOURCE=500) #(vi - ;; - *) - -echo "$as_me:7826: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 +echo "$as_me:6832: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 7829 "configure" +#line 6835 "configure" #include "confdefs.h" #include @@ -7842,16 +6848,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7845: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6851: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7848: \$? = $ac_status" >&5 + echo "$as_me:6854: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7851: \"$ac_try\"") >&5 + { (eval echo "$as_me:6857: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7854: \$? = $ac_status" >&5 + echo "$as_me:6860: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=no else @@ -7860,16 +6866,16 @@ cat conftest.$ac_ext >&5 cf_result=yes fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:7863: result: $cf_result" >&5 +echo "$as_me:6869: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" elif test "x" != "x" ; then - echo "$as_me:7869: checking checking for compatible value versus " >&5 + echo "$as_me:6875: checking checking for compatible value versus " >&5 echo $ECHO_N "checking checking for compatible value versus ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 7872 "configure" +#line 6878 "configure" #include "confdefs.h" #include @@ -7885,16 +6891,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7888: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6894: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7891: \$? = $ac_status" >&5 + echo "$as_me:6897: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7894: \"$ac_try\"") >&5 + { (eval echo "$as_me:6900: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7897: \$? = $ac_status" >&5 + echo "$as_me:6903: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes else @@ -7903,7 +6909,7 @@ cat conftest.$ac_ext >&5 cf_result=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:7906: result: $cf_result" >&5 + echo "$as_me:6912: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = no ; then # perhaps we can override it - try... @@ -7911,22 +6917,19 @@ echo "${ECHO_T}$cf_result" >&6 fi fi - ;; - esac - # with_overwrite=no NCURSES_CH_T=cchar_t for ac_func in putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:7923: checking for $ac_func" >&5 +echo "$as_me:6926: 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 7929 "configure" +#line 6932 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -7957,16 +6960,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7960: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6963: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7963: \$? = $ac_status" >&5 + echo "$as_me:6966: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7966: \"$ac_try\"") >&5 + { (eval echo "$as_me:6969: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7969: \$? = $ac_status" >&5 + echo "$as_me:6972: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -7976,7 +6979,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:7979: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6982: 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 <&5 +echo "$as_me:6994: 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 @@ -7996,7 +6999,7 @@ else cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7999 "configure" +#line 7002 "configure" #include "confdefs.h" #include @@ -8009,16 +7012,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8012: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7015: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8015: \$? = $ac_status" >&5 + echo "$as_me:7018: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8018: \"$ac_try\"") >&5 + { (eval echo "$as_me:7021: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8021: \$? = $ac_status" >&5 + echo "$as_me:7024: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_utf8_lib=yes else @@ -8030,12 +7033,10 @@ cat conftest.$ac_ext >&5 cf_cv_header_path_utf8= cf_cv_library_path_utf8= -echo "${as_me:-configure}:8033: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 - -cf_save_LIBS="$LIBS" +echo "${as_me-configure}:7036: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 8038 "configure" +#line 7039 "configure" #include "confdefs.h" #include @@ -8048,110 +7049,34 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8051: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7052: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8054: \$? = $ac_status" >&5 + echo "$as_me:7055: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8057: \"$ac_try\"") >&5 + { (eval echo "$as_me:7058: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8060: \$? = $ac_status" >&5 + echo "$as_me:7061: \$? = $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_find_linkage_utf8=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -LIBS="-lutf8 $cf_save_LIBS" + cf_cv_find_linkage_utf8=no -cat >conftest.$ac_ext <<_ACEOF -#line 8074 "configure" -#include "confdefs.h" - -#include -int -main () -{ -putwc(0,0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8087: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8090: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8093: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8096: \$? = $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}:8113: testing find linkage for utf8 library ..." 1>&5 - -echo "${as_me:-configure}:8115: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me-configure}:7070: 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 #(vi - -I*) - cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` - -test "$cf_header_path" != "NONE" && \ -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= + cf_search="" test "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for include-directories under /usr" test -d /usr/include && cf_search="$cf_search /usr/include" test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" @@ -8173,7 +7098,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for include-directories under /usr/local" test -d /usr/local/include && cf_search="$cf_search /usr/local/include" test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" @@ -8184,7 +7109,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for include-directories under /opt" test -d /opt/include && cf_search="$cf_search /opt/include" test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" @@ -8195,7 +7120,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for include-directories under $HOME" test -d $HOME/include && cf_search="$cf_search $HOME/include" test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" @@ -8218,18 +7143,16 @@ test -d "$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}:8228: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me-configure}:7151: 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 8232 "configure" +#line 7155 "configure" #include "confdefs.h" #include @@ -8242,21 +7165,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8245: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7168: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8248: \$? = $ac_status" >&5 + echo "$as_me:7171: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8251: \"$ac_try\"") >&5 + { (eval echo "$as_me:7174: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8254: \$? = $ac_status" >&5 + echo "$as_me:7177: \$? = $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}:8259: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me-configure}:7182: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=maybe cf_test_CPPFLAGS="$CPPFLAGS" @@ -8274,44 +7197,17 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_find_linkage_utf8" = maybe ; then -echo "${as_me:-configure}:8277: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me-configure}:7200: 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$,,'` - -test "$cf_library_path" != "NONE" && \ -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= + cf_search="" test "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for lib-directories under /usr" test -d /usr/lib && cf_search="$cf_search /usr/lib" test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" @@ -8333,7 +7229,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" @@ -8344,7 +7240,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for lib-directories under /opt" test -d /opt/lib && cf_search="$cf_search /opt/lib" test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" @@ -8355,7 +7251,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { +(test $prefix = NONE || test -d $prefix) && { test -n "$verbose" && echo " ... testing for lib-directories under $HOME" test -d $HOME/lib && cf_search="$cf_search $HOME/lib" test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" @@ -8364,20 +7260,18 @@ test -d "$HOME" && \ test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" } -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}:8374: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me-configure}:7268: 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 8380 "configure" +#line 7274 "configure" #include "confdefs.h" #include @@ -8390,21 +7284,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8393: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7287: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8396: \$? = $ac_status" >&5 + echo "$as_me:7290: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8399: \"$ac_try\"") >&5 + { (eval echo "$as_me:7293: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8402: \$? = $ac_status" >&5 + echo "$as_me:7296: \$? = $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}:8407: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me-configure}:7301: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" @@ -8421,6 +7315,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done + LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -8432,11 +7327,6 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext 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 @@ -8446,7 +7336,7 @@ fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:8449: result: $cf_cv_utf8_lib" >&5 +echo "$as_me:7339: 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 @@ -8474,13 +7364,13 @@ if test -n "$cf_cv_header_path_utf8" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; 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 8483 "configure" +#line 7373 "configure" #include "confdefs.h" #include int @@ -8492,16 +7382,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8495: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7385: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8498: \$? = $ac_status" >&5 + echo "$as_me:7388: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8501: \"$ac_try\"") >&5 + { (eval echo "$as_me:7391: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8504: \$? = $ac_status" >&5 + echo "$as_me:7394: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -8518,13 +7408,13 @@ 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}:8521: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me-configure}:7411: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" - 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" + 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 @@ -8552,7 +7442,7 @@ if test -n "$cf_cv_library_path_utf8" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me:-configure}:8555: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -8560,7 +7450,7 @@ echo "${as_me:-configure}:8555: testing adding $cf_add_libdir to library-path .. done fi - LIBS="$cf_cv_library_file_utf8 $LIBS" + LIBS="-lutf8 $LIBS" fi if test "$cf_cv_utf8_lib" != no ; then @@ -8569,14 +7459,14 @@ fi fi # This is needed on Tru64 5.0 to declare mbstate_t -echo "$as_me:8572: checking if we must include wchar.h to declare mbstate_t" >&5 +echo "$as_me:7462: 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 8579 "configure" +#line 7469 "configure" #include "confdefs.h" #include @@ -8594,23 +7484,23 @@ mbstate_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8597: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7487: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8600: \$? = $ac_status" >&5 + echo "$as_me:7490: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8603: \"$ac_try\"") >&5 + { (eval echo "$as_me:7493: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8606: \$? = $ac_status" >&5 + echo "$as_me:7496: \$? = $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 8613 "configure" +#line 7503 "configure" #include "confdefs.h" #include @@ -8629,16 +7519,16 @@ mbstate_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8632: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7522: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8635: \$? = $ac_status" >&5 + echo "$as_me:7525: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8638: \"$ac_try\"") >&5 + { (eval echo "$as_me:7528: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8641: \$? = $ac_status" >&5 + echo "$as_me:7531: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_mbstate_t=yes else @@ -8650,7 +7540,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8653: result: $cf_cv_mbstate_t" >&5 +echo "$as_me:7543: result: $cf_cv_mbstate_t" >&5 echo "${ECHO_T}$cf_cv_mbstate_t" >&6 if test "$cf_cv_mbstate_t" = yes ; then @@ -8667,14 +7557,14 @@ if test "$cf_cv_mbstate_t" = unknown ; then fi # This is needed on Tru64 5.0 to declare wchar_t -echo "$as_me:8670: checking if we must include wchar.h to declare wchar_t" >&5 +echo "$as_me:7560: 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 8677 "configure" +#line 7567 "configure" #include "confdefs.h" #include @@ -8692,23 +7582,23 @@ wchar_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8695: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7585: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8698: \$? = $ac_status" >&5 + echo "$as_me:7588: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8701: \"$ac_try\"") >&5 + { (eval echo "$as_me:7591: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8704: \$? = $ac_status" >&5 + echo "$as_me:7594: \$? = $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 8711 "configure" +#line 7601 "configure" #include "confdefs.h" #include @@ -8727,16 +7617,16 @@ wchar_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8730: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7620: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8733: \$? = $ac_status" >&5 + echo "$as_me:7623: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8736: \"$ac_try\"") >&5 + { (eval echo "$as_me:7626: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8739: \$? = $ac_status" >&5 + echo "$as_me:7629: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wchar_t=yes else @@ -8748,7 +7638,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8751: result: $cf_cv_wchar_t" >&5 +echo "$as_me:7641: result: $cf_cv_wchar_t" >&5 echo "${ECHO_T}$cf_cv_wchar_t" >&6 if test "$cf_cv_wchar_t" = yes ; then @@ -8770,14 +7660,14 @@ if test "$cf_cv_wchar_t" != unknown ; then fi # This is needed on Tru64 5.0 to declare wint_t -echo "$as_me:8773: checking if we must include wchar.h to declare wint_t" >&5 +echo "$as_me:7663: 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 8780 "configure" +#line 7670 "configure" #include "confdefs.h" #include @@ -8795,23 +7685,23 @@ wint_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8798: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7688: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8801: \$? = $ac_status" >&5 + echo "$as_me:7691: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8804: \"$ac_try\"") >&5 + { (eval echo "$as_me:7694: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8807: \$? = $ac_status" >&5 + echo "$as_me:7697: \$? = $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 8814 "configure" +#line 7704 "configure" #include "confdefs.h" #include @@ -8830,16 +7720,16 @@ wint_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7723: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8836: \$? = $ac_status" >&5 + echo "$as_me:7726: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8839: \"$ac_try\"") >&5 + { (eval echo "$as_me:7729: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8842: \$? = $ac_status" >&5 + echo "$as_me:7732: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wint_t=yes else @@ -8851,7 +7741,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8854: result: $cf_cv_wint_t" >&5 +echo "$as_me:7744: result: $cf_cv_wint_t" >&5 echo "${ECHO_T}$cf_cv_wint_t" >&6 if test "$cf_cv_wint_t" = yes ; then @@ -8890,7 +7780,7 @@ case $cf_cv_abi_version in ;; esac -echo "$as_me:8893: checking whether to enable _LP64 definition in curses.h" >&5 +echo "$as_me:7783: checking whether to enable _LP64 definition in curses.h" >&5 echo $ECHO_N "checking whether to enable _LP64 definition in curses.h... $ECHO_C" >&6 # Check whether --enable-lp64 or --disable-lp64 was given. @@ -8900,7 +7790,7 @@ if test "${enable_lp64+set}" = set; then else with_lp64=$default_with_lp64 fi; -echo "$as_me:8903: result: $with_lp64" >&5 +echo "$as_me:7793: result: $with_lp64" >&5 echo "${ECHO_T}$with_lp64" >&6 if test "$with_lp64" = yes ; then @@ -8916,7 +7806,7 @@ if test "${enable_largefile+set}" = set; then fi; if test "$enable_largefile" != no; then - echo "$as_me:8919: checking for special C compiler options needed for large files" >&5 + echo "$as_me:7809: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8928,7 +7818,7 @@ else # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF -#line 8931 "configure" +#line 7821 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8948,16 +7838,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8951: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7841: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8954: \$? = $ac_status" >&5 + echo "$as_me:7844: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8957: \"$ac_try\"") >&5 + { (eval echo "$as_me:7847: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8960: \$? = $ac_status" >&5 + echo "$as_me:7850: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8967,16 +7857,16 @@ fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext -if { (eval echo "$as_me:8970: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7860: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8973: \$? = $ac_status" >&5 + echo "$as_me:7863: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8976: \"$ac_try\"") >&5 + { (eval echo "$as_me:7866: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8979: \$? = $ac_status" >&5 + echo "$as_me:7869: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else @@ -8990,13 +7880,13 @@ rm -f conftest.$ac_objext rm -f conftest.$ac_ext fi fi -echo "$as_me:8993: result: $ac_cv_sys_largefile_CC" >&5 +echo "$as_me:7883: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:8999: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + echo "$as_me:7889: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9004,7 +7894,7 @@ else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF -#line 9007 "configure" +#line 7897 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -9024,16 +7914,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9027: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7917: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9030: \$? = $ac_status" >&5 + echo "$as_me:7920: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9033: \"$ac_try\"") >&5 + { (eval echo "$as_me:7923: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9036: \$? = $ac_status" >&5 + echo "$as_me:7926: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -9042,7 +7932,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 9045 "configure" +#line 7935 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include @@ -9063,16 +7953,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9066: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9069: \$? = $ac_status" >&5 + echo "$as_me:7959: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9072: \"$ac_try\"") >&5 + { (eval echo "$as_me:7962: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9075: \$? = $ac_status" >&5 + echo "$as_me:7965: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else @@ -9083,7 +7973,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:9086: result: $ac_cv_sys_file_offset_bits" >&5 +echo "$as_me:7976: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then @@ -9092,8 +7982,8 @@ cat >>confdefs.h <&5 +rm -f conftest* + echo "$as_me:7986: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9101,7 +7991,7 @@ else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF -#line 9104 "configure" +#line 7994 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -9121,16 +8011,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9124: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8014: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9127: \$? = $ac_status" >&5 + echo "$as_me:8017: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9130: \"$ac_try\"") >&5 + { (eval echo "$as_me:8020: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9133: \$? = $ac_status" >&5 + echo "$as_me:8023: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -9139,7 +8029,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 9142 "configure" +#line 8032 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include @@ -9160,16 +8050,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9163: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9166: \$? = $ac_status" >&5 + echo "$as_me:8056: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9169: \"$ac_try\"") >&5 + { (eval echo "$as_me:8059: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9172: \$? = $ac_status" >&5 + echo "$as_me:8062: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else @@ -9180,7 +8070,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:9183: result: $ac_cv_sys_large_files" >&5 +echo "$as_me:8073: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then @@ -9189,11 +8079,11 @@ cat >>confdefs.h <&5 + echo "$as_me:8086: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9201,7 +8091,7 @@ else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF -#line 9204 "configure" +#line 8094 "configure" #include "confdefs.h" #include int @@ -9213,16 +8103,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9216: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8106: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9219: \$? = $ac_status" >&5 + echo "$as_me:8109: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9222: \"$ac_try\"") >&5 + { (eval echo "$as_me:8112: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9225: \$? = $ac_status" >&5 + echo "$as_me:8115: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -9231,7 +8121,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 9234 "configure" +#line 8124 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include @@ -9244,16 +8134,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9247: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8137: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9250: \$? = $ac_status" >&5 + echo "$as_me:8140: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9253: \"$ac_try\"") >&5 + { (eval echo "$as_me:8143: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9256: \$? = $ac_status" >&5 + echo "$as_me:8146: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else @@ -9264,7 +8154,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:9267: result: $ac_cv_sys_largefile_source" >&5 +echo "$as_me:8157: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then @@ -9273,18 +8163,18 @@ cat >>confdefs.h <&5 +echo "$as_me:8171: checking for fseeko" >&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9287 "configure" +#line 8177 "configure" #include "confdefs.h" #include int @@ -9296,16 +8186,16 @@ return fseeko && fseeko (stdin, 0, 0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9299: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8189: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9302: \$? = $ac_status" >&5 + echo "$as_me:8192: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9305: \"$ac_try\"") >&5 + { (eval echo "$as_me:8195: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9308: \$? = $ac_status" >&5 + echo "$as_me:8198: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else @@ -9315,7 +8205,7 @@ ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:9318: result: $ac_cv_func_fseeko" >&5 +echo "$as_me:8208: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then @@ -9336,14 +8226,14 @@ fi test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " - echo "$as_me:9339: checking whether to use struct dirent64" >&5 + echo "$as_me:8229: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9346 "configure" +#line 8236 "configure" #include "confdefs.h" #include @@ -9364,16 +8254,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9367: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8257: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9370: \$? = $ac_status" >&5 + echo "$as_me:8260: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9373: \"$ac_try\"") >&5 + { (eval echo "$as_me:8263: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9376: \$? = $ac_status" >&5 + echo "$as_me:8266: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else @@ -9384,7 +8274,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9387: result: $cf_cv_struct_dirent64" >&5 +echo "$as_me:8277: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 @@ -9393,7 +8283,7 @@ EOF fi ### use option --disable-tparm-varargs to make tparm() conform to X/Open -echo "$as_me:9396: checking if you want tparm not to use X/Open fixed-parameter list" >&5 +echo "$as_me:8286: checking if you want tparm not to use X/Open fixed-parameter list" >&5 echo $ECHO_N "checking if you want tparm not to use X/Open fixed-parameter list... $ECHO_C" >&6 # Check whether --enable-tparm-varargs or --disable-tparm-varargs was given. @@ -9403,14 +8293,14 @@ if test "${enable_tparm_varargs+set}" = set; then else with_tparm_varargs=yes fi; -echo "$as_me:9406: result: $with_tparm_varargs" >&5 +echo "$as_me:8296: result: $with_tparm_varargs" >&5 echo "${ECHO_T}$with_tparm_varargs" >&6 NCURSES_TPARM_VARARGS=0 test "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1 ### use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw if test "$with_ticlib" != no ; then -echo "$as_me:9413: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 +echo "$as_me:8303: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 echo $ECHO_N "checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library... $ECHO_C" >&6 # Check whether --enable-tic-depends or --disable-tic-depends was given. @@ -9420,14 +8310,14 @@ if test "${enable_tic_depends+set}" = set; then else with_tic_depends=yes fi; -echo "$as_me:9423: result: $with_tic_depends" >&5 +echo "$as_me:8313: result: $with_tic_depends" >&5 echo "${ECHO_T}$with_tic_depends" >&6 else with_tic_depends=no fi ### use option --with-bool to override bool's type -echo "$as_me:9430: checking for type of bool" >&5 +echo "$as_me:8320: checking for type of bool" >&5 echo $ECHO_N "checking for type of bool... $ECHO_C" >&6 # Check whether --with-bool or --without-bool was given. @@ -9437,10 +8327,10 @@ if test "${with_bool+set}" = set; then else NCURSES_BOOL=auto fi; -echo "$as_me:9440: result: $NCURSES_BOOL" >&5 +echo "$as_me:8330: result: $NCURSES_BOOL" >&5 echo "${ECHO_T}$NCURSES_BOOL" >&6 -echo "$as_me:9443: checking for alternate terminal capabilities file" >&5 +echo "$as_me:8333: checking for alternate terminal capabilities file" >&5 echo $ECHO_N "checking for alternate terminal capabilities file... $ECHO_C" >&6 # Check whether --with-caps or --without-caps was given. @@ -9451,11 +8341,11 @@ else TERMINFO_CAPS=Caps fi; test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps -echo "$as_me:9454: result: $TERMINFO_CAPS" >&5 +echo "$as_me:8344: result: $TERMINFO_CAPS" >&5 echo "${ECHO_T}$TERMINFO_CAPS" >&6 ### use option --with-chtype to override chtype's type -echo "$as_me:9458: checking for type of chtype" >&5 +echo "$as_me:8348: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 # Check whether --with-chtype or --without-chtype was given. @@ -9465,11 +8355,11 @@ if test "${with_chtype+set}" = set; then else NCURSES_CHTYPE=auto fi; -echo "$as_me:9468: result: $NCURSES_CHTYPE" >&5 +echo "$as_me:8358: result: $NCURSES_CHTYPE" >&5 echo "${ECHO_T}$NCURSES_CHTYPE" >&6 ### use option --with-ospeed to override ospeed's type -echo "$as_me:9472: checking for type of ospeed" >&5 +echo "$as_me:8362: checking for type of ospeed" >&5 echo $ECHO_N "checking for type of ospeed... $ECHO_C" >&6 # Check whether --with-ospeed or --without-ospeed was given. @@ -9479,11 +8369,11 @@ if test "${with_ospeed+set}" = set; then else NCURSES_OSPEED=short fi; -echo "$as_me:9482: result: $NCURSES_OSPEED" >&5 +echo "$as_me:8372: result: $NCURSES_OSPEED" >&5 echo "${ECHO_T}$NCURSES_OSPEED" >&6 ### use option --with-mmask-t to override mmask_t's type -echo "$as_me:9486: checking for type of mmask_t" >&5 +echo "$as_me:8376: checking for type of mmask_t" >&5 echo $ECHO_N "checking for type of mmask_t... $ECHO_C" >&6 # Check whether --with-mmask-t or --without-mmask-t was given. @@ -9493,25 +8383,11 @@ if test "${with_mmask_t+set}" = set; then else NCURSES_MMASK_T=auto fi; -echo "$as_me:9496: result: $NCURSES_MMASK_T" >&5 +echo "$as_me:8386: result: $NCURSES_MMASK_T" >&5 echo "${ECHO_T}$NCURSES_MMASK_T" >&6 -### use option --with-ccharw-max to override CCHARW_MAX size -echo "$as_me:9500: checking for size CCHARW_MAX" >&5 -echo $ECHO_N "checking for size CCHARW_MAX... $ECHO_C" >&6 - -# Check whether --with-ccharw-max or --without-ccharw-max was given. -if test "${with_ccharw_max+set}" = set; then - withval="$with_ccharw_max" - NCURSES_CCHARW_MAX="$withval" -else - NCURSES_CCHARW_MAX=5 -fi; -echo "$as_me:9510: result: $NCURSES_CCHARW_MAX" >&5 -echo "${ECHO_T}$NCURSES_CCHARW_MAX" >&6 - ### Enable compiling-in rcs id's -echo "$as_me:9514: checking if RCS identifiers should be compiled-in" >&5 +echo "$as_me:8390: checking if RCS identifiers should be compiled-in" >&5 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. @@ -9521,7 +8397,7 @@ if test "${with_rcs_ids+set}" = set; then else with_rcs_ids=no fi; -echo "$as_me:9524: result: $with_rcs_ids" >&5 +echo "$as_me:8400: result: $with_rcs_ids" >&5 echo "${ECHO_T}$with_rcs_ids" >&6 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 @@ -9529,7 +8405,7 @@ EOF ############################################################################### -echo "$as_me:9532: checking format of man-pages" >&5 +echo "$as_me:8408: checking format of man-pages" >&5 echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6 # Check whether --with-manpage-format or --without-manpage-format was given. @@ -9557,7 +8433,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[01]* $cf_dir/cat*/$cf_example.[01]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -9618,14 +8494,14 @@ unknown) ;; esac -echo "$as_me:9621: result: $MANPAGE_FORMAT" >&5 +echo "$as_me:8497: result: $MANPAGE_FORMAT" >&5 echo "${ECHO_T}$MANPAGE_FORMAT" >&6 if test -n "$cf_unknown" ; then - { echo "$as_me:9624: WARNING: Unexpected manpage-format $cf_unknown" >&5 + { echo "$as_me:8500: WARNING: Unexpected manpage-format $cf_unknown" >&5 echo "$as_me: WARNING: Unexpected manpage-format $cf_unknown" >&2;} fi -echo "$as_me:9628: checking for manpage renaming" >&5 +echo "$as_me:8504: checking for manpage renaming" >&5 echo $ECHO_N "checking for manpage renaming... $ECHO_C" >&6 # Check whether --with-manpage-renames or --without-manpage-renames was given. @@ -9653,7 +8529,7 @@ if test "$MANPAGE_RENAMES" != no ; then if test -f $srcdir/man/$MANPAGE_RENAMES ; then MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES elif test ! -f $MANPAGE_RENAMES ; then - { { echo "$as_me:9656: error: not a filename: $MANPAGE_RENAMES" >&5 + { { echo "$as_me:8532: error: not a filename: $MANPAGE_RENAMES" >&5 echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} { (exit 1); exit 1; }; } fi @@ -9667,10 +8543,10 @@ echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} fi fi -echo "$as_me:9670: result: $MANPAGE_RENAMES" >&5 +echo "$as_me:8546: result: $MANPAGE_RENAMES" >&5 echo "${ECHO_T}$MANPAGE_RENAMES" >&6 -echo "$as_me:9673: checking if manpage aliases will be installed" >&5 +echo "$as_me:8549: checking if manpage aliases will be installed" >&5 echo $ECHO_N "checking if manpage aliases will be installed... $ECHO_C" >&6 # Check whether --with-manpage-aliases or --without-manpage-aliases was given. @@ -9681,21 +8557,18 @@ else MANPAGE_ALIASES=yes fi; -echo "$as_me:9684: result: $MANPAGE_ALIASES" >&5 +echo "$as_me:8560: result: $MANPAGE_ALIASES" >&5 echo "${ECHO_T}$MANPAGE_ALIASES" >&6 -case "x$LN_S" in #(vi -xln*) #(vi +if test "$LN_S" = "ln -s"; then cf_use_symlinks=yes - ;; -*) +else cf_use_symlinks=no - ;; -esac +fi MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then -echo "$as_me:9698: checking if manpage symlinks should be used" >&5 +echo "$as_me:8571: checking if manpage symlinks should be used" >&5 echo $ECHO_N "checking if manpage symlinks should be used... $ECHO_C" >&6 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. @@ -9708,17 +8581,17 @@ fi; if test "$$cf_use_symlinks" = no; then if test "$MANPAGE_SYMLINKS" = yes ; then - { echo "$as_me:9711: WARNING: cannot make symlinks" >&5 + { echo "$as_me:8584: WARNING: cannot make symlinks" >&5 echo "$as_me: WARNING: cannot make symlinks" >&2;} MANPAGE_SYMLINKS=no fi fi -echo "$as_me:9717: result: $MANPAGE_SYMLINKS" >&5 +echo "$as_me:8590: result: $MANPAGE_SYMLINKS" >&5 echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6 fi -echo "$as_me:9721: checking for manpage tbl" >&5 +echo "$as_me:8594: checking for manpage tbl" >&5 echo $ECHO_N "checking for manpage tbl... $ECHO_C" >&6 # Check whether --with-manpage-tbl or --without-manpage-tbl was given. @@ -9729,7 +8602,7 @@ else MANPAGE_TBL=no fi; -echo "$as_me:9732: result: $MANPAGE_TBL" >&5 +echo "$as_me:8605: result: $MANPAGE_TBL" >&5 echo "${ECHO_T}$MANPAGE_TBL" >&6 if test "$prefix" = "NONE" ; then @@ -9762,7 +8635,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) +*gzip*) #(vi cf_so_strip="gz" cf_compress=gzip ;; @@ -9785,12 +8658,14 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" +MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" + INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR:=/tmp}/man\$\$ +TMP=\${TMPDIR-/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\$1 @@ -9828,7 +8703,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - mkdir -p \$cf_subdir\$section + \$MKDIRS \$cf_subdir\$section fi fi @@ -9843,12 +8718,12 @@ cat >>$cf_man_alias <<-CF_EOF2 s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g CF_EOF - for cf_name in captoinfo clear infocmp infotocap tabs tic toe tput tset + for cf_name in captoinfo clear infocmp infotocap tic toe tput do cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name,g + s,@$cf_NAME@,$cf_name, CF_EOF done @@ -9977,21 +8852,8 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -10051,7 +8913,7 @@ chmod 755 $cf_edit_man ############################################################################### ### Note that some functions (such as const) are normally disabled anyway. -echo "$as_me:10054: checking if you want to build with function extensions" >&5 +echo "$as_me:8916: checking if you want to build with function extensions" >&5 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. @@ -10061,7 +8923,7 @@ if test "${enable_ext_funcs+set}" = set; then else with_ext_funcs=yes fi; -echo "$as_me:10064: result: $with_ext_funcs" >&5 +echo "$as_me:8926: result: $with_ext_funcs" >&5 echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 @@ -10079,10 +8941,6 @@ EOF cat >>confdefs.h <<\EOF #define HAVE_RESIZE_TERM 1 -EOF - - cat >>confdefs.h <<\EOF -#define HAVE_TERM_ENTRY_H 1 EOF cat >>confdefs.h <<\EOF @@ -10097,62 +8955,12 @@ EOF #define NCURSES_EXT_FUNCS 1 EOF - GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 - GENERATED_EXT_FUNCS= -fi - -echo "$as_me:10106: checking if you want to build with experimental SCREEN extensions" >&5 -echo $ECHO_N "checking if you want to build with experimental SCREEN extensions... $ECHO_C" >&6 - -# Check whether --enable-sp-funcs or --disable-sp-funcs was given. -if test "${enable_sp_funcs+set}" = set; then - enableval="$enable_sp_funcs" - with_sp_funcs=$enableval -else - with_sp_funcs=no -fi; -echo "$as_me:10116: result: $with_sp_funcs" >&5 -echo "${ECHO_T}$with_sp_funcs" >&6 -if test "$with_sp_funcs" = yes ; then - NCURSES_SP_FUNCS=1 - cat >>confdefs.h <<\EOF -#define NCURSES_SP_FUNCS 1 -EOF - - GENERATED_SP_FUNCS=generated -else - NCURSES_SP_FUNCS=0 - GENERATED_SP_FUNCS= -fi - -echo "$as_me:10130: checking if you want to build with experimental terminal-driver" >&5 -echo $ECHO_N "checking if you want to build with experimental terminal-driver... $ECHO_C" >&6 - -# Check whether --enable-term-driver or --disable-term-driver was given. -if test "${enable_term_driver+set}" = set; then - enableval="$enable_term_driver" - with_term_driver=$enableval -else - with_term_driver=no -fi; -echo "$as_me:10140: result: $with_term_driver" >&5 -echo "${ECHO_T}$with_term_driver" >&6 -if test "$with_term_driver" = yes ; then - cat >>confdefs.h <<\EOF -#define USE_TERM_DRIVER 1 -EOF - - if test "$with_sp_funcs" != yes ; then - { { echo "$as_me:10148: error: The term-driver option relies upon sp-funcs" >&5 -echo "$as_me: error: The term-driver option relies upon sp-funcs" >&2;} - { (exit 1); exit 1; }; } - fi fi ### use option --enable-const to turn on use of const beyond that in XSI. -echo "$as_me:10155: checking for extended use of const keyword" >&5 +echo "$as_me:8963: checking for extended use of const keyword" >&5 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. @@ -10162,7 +8970,7 @@ if test "${enable_const+set}" = set; then else with_ext_const=no fi; -echo "$as_me:10165: result: $with_ext_const" >&5 +echo "$as_me:8973: result: $with_ext_const" >&5 echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then @@ -10170,7 +8978,7 @@ if test "$with_ext_const" = yes ; then fi ### use option --enable-ext-colors to turn on use of colors beyond 16. -echo "$as_me:10173: checking if you want to use extended colors" >&5 +echo "$as_me:8981: checking if you want to use extended colors" >&5 echo $ECHO_N "checking if you want to use extended colors... $ECHO_C" >&6 # Check whether --enable-ext-colors or --disable-ext-colors was given. @@ -10180,12 +8988,12 @@ if test "${enable_ext_colors+set}" = set; then else with_ext_colors=no fi; -echo "$as_me:10183: result: $with_ext_colors" >&5 +echo "$as_me:8991: result: $with_ext_colors" >&5 echo "${ECHO_T}$with_ext_colors" >&6 NCURSES_EXT_COLORS=0 if test "$with_ext_colors" = yes ; then if test "$with_widec" != yes ; then - { { echo "$as_me:10188: error: This option applies only to wide-character library" >&5 + { { echo "$as_me:8996: error: This option applies only to wide-character library" >&5 echo "$as_me: error: This option applies only to wide-character library" >&2;} { (exit 1); exit 1; }; } else @@ -10196,7 +9004,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:10199: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:9007: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -10211,7 +9019,7 @@ EOF fi ### use option --enable-ext-mouse to modify coding to support 5-button mice -echo "$as_me:10214: checking if you want to use extended mouse encoding" >&5 +echo "$as_me:9022: checking if you want to use extended mouse encoding" >&5 echo $ECHO_N "checking if you want to use extended mouse encoding... $ECHO_C" >&6 # Check whether --enable-ext-mouse or --disable-ext-mouse was given. @@ -10221,7 +9029,7 @@ if test "${enable_ext_mouse+set}" = set; then else with_ext_mouse=no fi; -echo "$as_me:10224: result: $with_ext_mouse" >&5 +echo "$as_me:9032: result: $with_ext_mouse" >&5 echo "${ECHO_T}$with_ext_mouse" >&6 NCURSES_MOUSE_VERSION=1 if test "$with_ext_mouse" = yes ; then @@ -10232,7 +9040,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:10235: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:9043: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -10240,7 +9048,7 @@ fi fi -echo "$as_me:10243: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "$as_me:9051: checking if you want \$NCURSES_NO_PADDING code" >&5 echo $ECHO_N "checking if you want \$NCURSES_NO_PADDING code... $ECHO_C" >&6 # Check whether --enable-no-padding or --disable-no-padding was given. @@ -10250,19 +9058,19 @@ if test "${enable_no_padding+set}" = set; then else with_no_padding=$with_ext_funcs fi; -echo "$as_me:10253: result: $with_no_padding" >&5 +echo "$as_me:9061: result: $with_no_padding" >&5 echo "${ECHO_T}$with_no_padding" >&6 test "$with_no_padding" = yes && cat >>confdefs.h <<\EOF #define NCURSES_NO_PADDING 1 EOF -echo "$as_me:10259: checking for ANSI C header files" >&5 +echo "$as_me:9067: 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 10265 "configure" +#line 9073 "configure" #include "confdefs.h" #include #include @@ -10270,13 +9078,13 @@ else #include _ACEOF -if { (eval echo "$as_me:10273: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:9081: \"$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:10279: \$? = $ac_status" >&5 + echo "$as_me:9087: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10298,7 +9106,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 10301 "configure" +#line 9109 "configure" #include "confdefs.h" #include @@ -10309,14 +9117,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* 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 10319 "configure" +#line 9127 "configure" #include "confdefs.h" #include @@ -10327,7 +9135,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* fi @@ -10337,7 +9145,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 10340 "configure" +#line 9148 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -10363,15 +9171,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:10366: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9174: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10369: \$? = $ac_status" >&5 + echo "$as_me:9177: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:10371: \"$ac_try\"") >&5 + { (eval echo "$as_me:9179: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10374: \$? = $ac_status" >&5 + echo "$as_me:9182: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -10384,7 +9192,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:10387: result: $ac_cv_header_stdc" >&5 +echo "$as_me:9195: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -10400,28 +9208,28 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:10403: checking for $ac_header" >&5 +echo "$as_me:9211: 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 10409 "configure" +#line 9217 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10415: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9223: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10418: \$? = $ac_status" >&5 + echo "$as_me:9226: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10421: \"$ac_try\"") >&5 + { (eval echo "$as_me:9229: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10424: \$? = $ac_status" >&5 + echo "$as_me:9232: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -10431,7 +9239,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:10434: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:9242: 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 <&5 +echo "$as_me:9252: checking for signed char" >&5 echo $ECHO_N "checking for signed char... $ECHO_C" >&6 if test "${ac_cv_type_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10450 "configure" +#line 9258 "configure" #include "confdefs.h" $ac_includes_default int @@ -10462,16 +9270,16 @@ if (sizeof (signed char)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10465: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9273: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10468: \$? = $ac_status" >&5 + echo "$as_me:9276: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10471: \"$ac_try\"") >&5 + { (eval echo "$as_me:9279: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10474: \$? = $ac_status" >&5 + echo "$as_me:9282: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signed_char=yes else @@ -10481,10 +9289,10 @@ ac_cv_type_signed_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:10484: result: $ac_cv_type_signed_char" >&5 +echo "$as_me:9292: result: $ac_cv_type_signed_char" >&5 echo "${ECHO_T}$ac_cv_type_signed_char" >&6 -echo "$as_me:10487: checking size of signed char" >&5 +echo "$as_me:9295: checking size of signed char" >&5 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6 if test "${ac_cv_sizeof_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10493,7 +9301,7 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line 10496 "configure" +#line 9304 "configure" #include "confdefs.h" $ac_includes_default int @@ -10505,21 +9313,21 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10508: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9316: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10511: \$? = $ac_status" >&5 + echo "$as_me:9319: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10514: \"$ac_try\"") >&5 + { (eval echo "$as_me:9322: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10517: \$? = $ac_status" >&5 + echo "$as_me:9325: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 10522 "configure" +#line 9330 "configure" #include "confdefs.h" $ac_includes_default int @@ -10531,16 +9339,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10534: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9342: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10537: \$? = $ac_status" >&5 + echo "$as_me:9345: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10540: \"$ac_try\"") >&5 + { (eval echo "$as_me:9348: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10543: \$? = $ac_status" >&5 + echo "$as_me:9351: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else @@ -10556,7 +9364,7 @@ cat conftest.$ac_ext >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 10559 "configure" +#line 9367 "configure" #include "confdefs.h" $ac_includes_default int @@ -10568,16 +9376,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10571: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9379: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10574: \$? = $ac_status" >&5 + echo "$as_me:9382: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10577: \"$ac_try\"") >&5 + { (eval echo "$as_me:9385: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10580: \$? = $ac_status" >&5 + echo "$as_me:9388: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else @@ -10593,7 +9401,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line 10596 "configure" +#line 9404 "configure" #include "confdefs.h" $ac_includes_default int @@ -10605,16 +9413,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10608: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9416: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10611: \$? = $ac_status" >&5 + echo "$as_me:9419: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10614: \"$ac_try\"") >&5 + { (eval echo "$as_me:9422: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10617: \$? = $ac_status" >&5 + echo "$as_me:9425: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else @@ -10627,12 +9435,12 @@ done ac_cv_sizeof_signed_char=$ac_lo else if test "$cross_compiling" = yes; then - { { echo "$as_me:10630: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:9438: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 10635 "configure" +#line 9443 "configure" #include "confdefs.h" $ac_includes_default int @@ -10648,15 +9456,15 @@ fclose (f); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:10651: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9459: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10654: \$? = $ac_status" >&5 + echo "$as_me:9462: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:10656: \"$ac_try\"") >&5 + { (eval echo "$as_me:9464: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10659: \$? = $ac_status" >&5 + echo "$as_me:9467: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_signed_char=`cat conftest.val` else @@ -10672,7 +9480,7 @@ else ac_cv_sizeof_signed_char=0 fi fi -echo "$as_me:10675: result: $ac_cv_sizeof_signed_char" >&5 +echo "$as_me:9483: result: $ac_cv_sizeof_signed_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6 cat >>confdefs.h <&5 +echo "$as_me:9494: checking if you want to use signed Boolean array in term.h" >&5 echo $ECHO_N "checking if you want to use signed Boolean array in term.h... $ECHO_C" >&6 # Check whether --enable-signed-char or --disable-signed-char was given. @@ -10693,12 +9501,12 @@ if test "${enable_signed_char+set}" = set; then else with_signed_char=no fi; -echo "$as_me:10696: result: $with_signed_char" >&5 +echo "$as_me:9504: result: $with_signed_char" >&5 echo "${ECHO_T}$with_signed_char" >&6 test "$with_signed_char" != yes && NCURSES_SBOOL="char" ### use option --enable-sigwinch to turn on use of SIGWINCH logic -echo "$as_me:10701: checking if you want SIGWINCH handler" >&5 +echo "$as_me:9509: checking if you want SIGWINCH handler" >&5 echo $ECHO_N "checking if you want SIGWINCH handler... $ECHO_C" >&6 # Check whether --enable-sigwinch or --disable-sigwinch was given. @@ -10708,14 +9516,14 @@ if test "${enable_sigwinch+set}" = set; then else with_sigwinch=$with_ext_funcs fi; -echo "$as_me:10711: result: $with_sigwinch" >&5 +echo "$as_me:9519: result: $with_sigwinch" >&5 echo "${ECHO_T}$with_sigwinch" >&6 test "$with_sigwinch" = yes && cat >>confdefs.h <<\EOF #define USE_SIGWINCH 1 EOF ### use option --enable-tcap-names to allow user to define new capabilities -echo "$as_me:10718: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "$as_me:9526: checking if you want user-definable terminal capabilities like termcap" >&5 echo $ECHO_N "checking if you want user-definable terminal capabilities like termcap... $ECHO_C" >&6 # Check whether --enable-tcap-names or --disable-tcap-names was given. @@ -10725,7 +9533,7 @@ if test "${enable_tcap_names+set}" = set; then else with_tcap_names=$with_ext_funcs fi; -echo "$as_me:10728: result: $with_tcap_names" >&5 +echo "$as_me:9536: result: $with_tcap_names" >&5 echo "${ECHO_T}$with_tcap_names" >&6 NCURSES_XNAMES=0 test "$with_tcap_names" = yes && NCURSES_XNAMES=1 @@ -10733,7 +9541,7 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 ############################################################################### # These options are relatively safe to experiment with. -echo "$as_me:10736: checking if you want all development code" >&5 +echo "$as_me:9544: checking if you want all development code" >&5 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. @@ -10743,11 +9551,11 @@ if test "${with_develop+set}" = set; then else with_develop=no fi; -echo "$as_me:10746: result: $with_develop" >&5 +echo "$as_me:9554: result: $with_develop" >&5 echo "${ECHO_T}$with_develop" >&6 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -echo "$as_me:10750: checking if you want hard-tabs code" >&5 +echo "$as_me:9558: checking if you want hard-tabs code" >&5 echo $ECHO_N "checking if you want hard-tabs code... $ECHO_C" >&6 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. @@ -10757,14 +9565,14 @@ if test "${enable_hard_tabs+set}" = set; then else enable_hard_tabs=$with_develop fi; -echo "$as_me:10760: result: $enable_hard_tabs" >&5 +echo "$as_me:9568: result: $enable_hard_tabs" >&5 echo "${ECHO_T}$enable_hard_tabs" >&6 test "$enable_hard_tabs" = yes && cat >>confdefs.h <<\EOF #define USE_HARD_TABS 1 EOF ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -echo "$as_me:10767: checking if you want limited support for xmc" >&5 +echo "$as_me:9575: checking if you want limited support for xmc" >&5 echo $ECHO_N "checking if you want limited support for xmc... $ECHO_C" >&6 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. @@ -10774,7 +9582,7 @@ if test "${enable_xmc_glitch+set}" = set; then else enable_xmc_glitch=$with_develop fi; -echo "$as_me:10777: result: $enable_xmc_glitch" >&5 +echo "$as_me:9585: result: $enable_xmc_glitch" >&5 echo "${ECHO_T}$enable_xmc_glitch" >&6 test "$enable_xmc_glitch" = yes && cat >>confdefs.h <<\EOF #define USE_XMC_SUPPORT 1 @@ -10783,7 +9591,7 @@ EOF ############################################################################### # These are just experimental, probably should not be in a package: -echo "$as_me:10786: checking if you do not want to assume colors are white-on-black" >&5 +echo "$as_me:9594: checking if you do not want to assume colors are white-on-black" >&5 echo $ECHO_N "checking if you do not want to assume colors are white-on-black... $ECHO_C" >&6 # Check whether --enable-assumed-color or --disable-assumed-color was given. @@ -10793,14 +9601,14 @@ if test "${enable_assumed_color+set}" = set; then else with_assumed_color=yes fi; -echo "$as_me:10796: result: $with_assumed_color" >&5 +echo "$as_me:9604: result: $with_assumed_color" >&5 echo "${ECHO_T}$with_assumed_color" >&6 test "$with_assumed_color" = yes && cat >>confdefs.h <<\EOF #define USE_ASSUMED_COLOR 1 EOF ### use option --enable-hashmap to turn on use of hashmap scrolling logic -echo "$as_me:10803: checking if you want hashmap scrolling-optimization code" >&5 +echo "$as_me:9611: checking if you want hashmap scrolling-optimization code" >&5 echo $ECHO_N "checking if you want hashmap scrolling-optimization code... $ECHO_C" >&6 # Check whether --enable-hashmap or --disable-hashmap was given. @@ -10810,14 +9618,14 @@ if test "${enable_hashmap+set}" = set; then else with_hashmap=yes fi; -echo "$as_me:10813: result: $with_hashmap" >&5 +echo "$as_me:9621: result: $with_hashmap" >&5 echo "${ECHO_T}$with_hashmap" >&6 test "$with_hashmap" = yes && cat >>confdefs.h <<\EOF #define USE_HASHMAP 1 EOF ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -echo "$as_me:10820: checking if you want colorfgbg code" >&5 +echo "$as_me:9628: checking if you want colorfgbg code" >&5 echo $ECHO_N "checking if you want colorfgbg code... $ECHO_C" >&6 # Check whether --enable-colorfgbg or --disable-colorfgbg was given. @@ -10827,33 +9635,16 @@ if test "${enable_colorfgbg+set}" = set; then else with_colorfgbg=no fi; -echo "$as_me:10830: result: $with_colorfgbg" >&5 +echo "$as_me:9638: result: $with_colorfgbg" >&5 echo "${ECHO_T}$with_colorfgbg" >&6 test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF #define USE_COLORFGBG 1 EOF -### use option --enable-interop to turn on use of bindings used for interop -echo "$as_me:10837: checking if you want interop bindings" >&5 -echo $ECHO_N "checking if you want interop bindings... $ECHO_C" >&6 - -# Check whether --enable-interop or --disable-interop was given. -if test "${enable_interop+set}" = set; then - enableval="$enable_interop" - with_exp_interop=$enableval -else - with_exp_interop=no -fi; -echo "$as_me:10847: result: $with_exp_interop" >&5 -echo "${ECHO_T}$with_exp_interop" >&6 - -NCURSES_INTEROP_FUNCS=0 -test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 - # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. -echo "$as_me:10856: checking if you want to link with the pthread library" >&5 +echo "$as_me:9647: checking if you want to link with the pthread library" >&5 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 # Check whether --with-pthread or --without-pthread was given. @@ -10863,27 +9654,27 @@ if test "${with_pthread+set}" = set; then else with_pthread=no fi; -echo "$as_me:10866: result: $with_pthread" >&5 +echo "$as_me:9657: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" != no ; then - echo "$as_me:10870: checking for pthread.h" >&5 + echo "$as_me:9661: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10876 "configure" +#line 9667 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10880: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:9671: \"$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:10886: \$? = $ac_status" >&5 + echo "$as_me:9677: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10902,7 +9693,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10905: result: $ac_cv_header_pthread_h" >&5 +echo "$as_me:9696: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 if test $ac_cv_header_pthread_h = yes; then @@ -10910,12 +9701,12 @@ if test $ac_cv_header_pthread_h = yes; then #define HAVE_PTHREADS_H 1 EOF - echo "$as_me:10913: checking if we can link with the pthread library" >&5 + echo "$as_me:9704: checking if we can link with the pthread library" >&5 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6 cf_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10918 "configure" +#line 9709 "configure" #include "confdefs.h" #include @@ -10931,16 +9722,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10934: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9725: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10937: \$? = $ac_status" >&5 + echo "$as_me:9728: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10940: \"$ac_try\"") >&5 + { (eval echo "$as_me:9731: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10943: \$? = $ac_status" >&5 + echo "$as_me:9734: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_pthread=yes else @@ -10950,7 +9741,7 @@ with_pthread=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:10953: result: $with_pthread" >&5 + echo "$as_me:9744: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" = yes ; then @@ -10960,7 +9751,7 @@ echo "${ECHO_T}$with_pthread" >&6 EOF else - { { echo "$as_me:10963: error: Cannot link with pthread library" >&5 + { { echo "$as_me:9754: error: Cannot link with pthread library" >&5 echo "$as_me: error: Cannot link with pthread library" >&2;} { (exit 1); exit 1; }; } fi @@ -10969,109 +9760,28 @@ fi fi -if test "x$with_pthread" != xno; then - echo "$as_me:10973: checking for pthread_kill" >&5 -echo $ECHO_N "checking for pthread_kill... $ECHO_C" >&6 -if test "${ac_cv_func_pthread_kill+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 10979 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char pthread_kill (); below. */ -#include -/* 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 pthread_kill (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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_pthread_kill) || defined (__stub___pthread_kill) -choke me -#else -f = pthread_kill; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11010: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11013: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11016: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11019: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_pthread_kill=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_pthread_kill=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:11029: result: $ac_cv_func_pthread_kill" >&5 -echo "${ECHO_T}$ac_cv_func_pthread_kill" >&6 -if test $ac_cv_func_pthread_kill = yes; then - - echo "$as_me:11033: checking if you want to allow EINTR in wgetch with pthreads" >&5 -echo $ECHO_N "checking if you want to allow EINTR in wgetch with pthreads... $ECHO_C" >&6 - -# Check whether --enable-pthreads-eintr or --disable-pthreads-eintr was given. -if test "${enable_pthreads_eintr+set}" = set; then - enableval="$enable_pthreads_eintr" - use_pthreads_eintr=$enableval -else - use_pthreads_eintr=no -fi; - echo "$as_me:11043: result: $use_pthreads_eintr" >&5 -echo "${ECHO_T}$use_pthreads_eintr" >&6 - if test $use_pthreads_eintr = yes ; then - cat >>confdefs.h <<\EOF -#define USE_PTHREADS_EINTR 1 -EOF - - fi -fi - - echo "$as_me:11053: checking if you want to use weak-symbols for pthreads" >&5 +echo "$as_me:9763: checking if you want to use weak-symbols for pthreads" >&5 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 # Check whether --enable-weak-symbols or --disable-weak-symbols was given. if test "${enable_weak_symbols+set}" = set; then enableval="$enable_weak_symbols" - use_weak_symbols=$enableval + use_weak_symbols=$withval else use_weak_symbols=no fi; - echo "$as_me:11063: result: $use_weak_symbols" >&5 +echo "$as_me:9773: result: $use_weak_symbols" >&5 echo "${ECHO_T}$use_weak_symbols" >&6 - if test "$use_weak_symbols" = yes ; then +if test "$use_weak_symbols" = yes ; then -echo "$as_me:11067: checking if $CC supports weak symbols" >&5 +echo "$as_me:9777: checking if $CC supports weak symbols" >&5 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 if test "${cf_cv_weak_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11074 "configure" +#line 9784 "configure" #include "confdefs.h" #include @@ -11097,16 +9807,16 @@ weak_symbol(fopen); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11100: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9810: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11103: \$? = $ac_status" >&5 + echo "$as_me:9813: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11106: \"$ac_try\"") >&5 + { (eval echo "$as_me:9816: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11109: \$? = $ac_status" >&5 + echo "$as_me:9819: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_weak_symbols=yes else @@ -11117,19 +9827,18 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11120: result: $cf_cv_weak_symbols" >&5 +echo "$as_me:9830: result: $cf_cv_weak_symbols" >&5 echo "${ECHO_T}$cf_cv_weak_symbols" >&6 - else - cf_cv_weak_symbols=no - fi +else + cf_cv_weak_symbols=no +fi - if test $cf_cv_weak_symbols = yes ; then - cat >>confdefs.h <<\EOF +if test $cf_cv_weak_symbols = yes ; then + cat >>confdefs.h <<\EOF #define USE_WEAK_SYMBOLS 1 EOF - fi fi PTHREAD= @@ -11148,7 +9857,7 @@ fi # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. -echo "$as_me:11151: checking if you want experimental reentrant code" >&5 +echo "$as_me:9860: checking if you want experimental reentrant code" >&5 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 # Check whether --enable-reentrant or --disable-reentrant was given. @@ -11158,23 +9867,21 @@ if test "${enable_reentrant+set}" = set; then else with_reentrant=no fi; -echo "$as_me:11161: result: $with_reentrant" >&5 +echo "$as_me:9870: result: $with_reentrant" >&5 echo "${ECHO_T}$with_reentrant" >&6 if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then + if test $cf_cv_weak_symbols = yes ; then # remove pthread library from $LIBS LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` - TEST_LIBS="-lpthread $TEST_LIBS" - TEST_LIBS2="-lpthread $TEST_LIBS2" - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi cat >>confdefs.h <<\EOF #define USE_REENTRANT 1 EOF @@ -11184,7 +9891,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:11187: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:9894: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -11197,29 +9904,7 @@ else NCURSES_SIZE_T=short fi -### Allow using a different wrap-prefix -if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then - echo "$as_me:11202: checking for prefix used to wrap public variables" >&5 -echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 - -# Check whether --with-wrap-prefix or --without-wrap-prefix was given. -if test "${with_wrap_prefix+set}" = set; then - withval="$with_wrap_prefix" - NCURSES_WRAP_PREFIX=$withval -else - NCURSES_WRAP_PREFIX=_nc_ -fi; - echo "$as_me:11212: result: $NCURSES_WRAP_PREFIX" >&5 -echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 -else - NCURSES_WRAP_PREFIX=_nc_ -fi - -cat >>confdefs.h <&5 +echo "$as_me:9907: checking if you want experimental safe-sprintf code" >&5 echo $ECHO_N "checking if you want experimental safe-sprintf code... $ECHO_C" >&6 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given. @@ -11229,7 +9914,7 @@ if test "${enable_safe_sprintf+set}" = set; then else with_safe_sprintf=no fi; -echo "$as_me:11232: result: $with_safe_sprintf" >&5 +echo "$as_me:9917: result: $with_safe_sprintf" >&5 echo "${ECHO_T}$with_safe_sprintf" >&6 test "$with_safe_sprintf" = yes && cat >>confdefs.h <<\EOF #define USE_SAFE_SPRINTF 1 @@ -11238,7 +9923,7 @@ EOF ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic # when hashmap is used scroll hints are useless if test "$with_hashmap" = no ; then -echo "$as_me:11241: checking if you want to experiment without scrolling-hints code" >&5 +echo "$as_me:9926: checking if you want to experiment without scrolling-hints code" >&5 echo $ECHO_N "checking if you want to experiment without scrolling-hints code... $ECHO_C" >&6 # Check whether --enable-scroll-hints or --disable-scroll-hints was given. @@ -11248,7 +9933,7 @@ if test "${enable_scroll_hints+set}" = set; then else with_scroll_hints=yes fi; -echo "$as_me:11251: result: $with_scroll_hints" >&5 +echo "$as_me:9936: result: $with_scroll_hints" >&5 echo "${ECHO_T}$with_scroll_hints" >&6 test "$with_scroll_hints" = yes && cat >>confdefs.h <<\EOF #define USE_SCROLL_HINTS 1 @@ -11256,7 +9941,7 @@ EOF fi -echo "$as_me:11259: checking if you want experimental wgetch-events code" >&5 +echo "$as_me:9944: checking if you want experimental wgetch-events code" >&5 echo $ECHO_N "checking if you want experimental wgetch-events code... $ECHO_C" >&6 # Check whether --enable-wgetch-events or --disable-wgetch-events was given. @@ -11266,7 +9951,7 @@ if test "${enable_wgetch_events+set}" = set; then else with_wgetch_events=no fi; -echo "$as_me:11269: result: $with_wgetch_events" >&5 +echo "$as_me:9954: result: $with_wgetch_events" >&5 echo "${ECHO_T}$with_wgetch_events" >&6 test "$with_wgetch_events" = yes && cat >>confdefs.h <<\EOF #define NCURSES_WGETCH_EVENTS 1 @@ -11275,7 +9960,7 @@ EOF ############################################################################### ### use option --disable-echo to suppress full display compiling commands -echo "$as_me:11278: checking if you want to display full commands during build" >&5 +echo "$as_me:9963: checking if you want to display full commands during build" >&5 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -11292,11 +9977,11 @@ else test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent" fi -echo "$as_me:11295: result: $with_echo" >&5 +echo "$as_me:9980: result: $with_echo" >&5 echo "${ECHO_T}$with_echo" >&6 ### use option --enable-warnings to turn on all gcc warnings -echo "$as_me:11299: checking if you want to see compiler warnings" >&5 +echo "$as_me:9984: checking if you want to see compiler warnings" >&5 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. @@ -11304,11 +9989,10 @@ if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval fi; -echo "$as_me:11307: result: $with_warnings" >&5 +echo "$as_me:9992: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "x$with_warnings" = "xyes"; then - ADAFLAGS="$ADAFLAGS -gnatg" INTEL_COMPILER=no @@ -11316,12 +10000,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:11319: checking if this is really Intel C compiler" >&5 + echo "$as_me:10003: 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 11324 "configure" +#line 10008 "configure" #include "confdefs.h" int @@ -11338,16 +10022,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11341: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10025: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11344: \$? = $ac_status" >&5 + echo "$as_me:10028: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11347: \"$ac_try\"") >&5 + { (eval echo "$as_me:10031: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11350: \$? = $ac_status" >&5 + echo "$as_me:10034: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -11358,14 +10042,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:11361: result: $INTEL_COMPILER" >&5 + echo "$as_me:10045: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <&5 + { echo "$as_me:10070: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ + wd1682 \ wd1683 \ wd1684 \ wd193 \ - wd593 \ wd279 \ + wd593 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:11401: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:10087: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11404: \$? = $ac_status" >&5 + echo "$as_me:10090: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:11406: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:10092: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -11412,13 +10098,13 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:11415: checking for $CC warning options..." >&5 + { echo "$as_me:10101: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS= + EXTRA_CFLAGS="-W -Wall" cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" - for cf_opt in W Wall \ + for cf_opt in \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ @@ -11432,12 +10118,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:11435: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:10121: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11438: \$? = $ac_status" >&5 + echo "$as_me:10124: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:11440: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:10126: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -11448,7 +10134,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:11451: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -11459,7 +10145,7 @@ echo "${as_me:-configure}:11451: testing feature is broken in gcc $GCC_VERSION . done CFLAGS="$cf_save_CFLAGS" fi -rm -rf conftest* +rm -f conftest* if test "$cf_with_cxx" = yes ; then @@ -11468,12 +10154,12 @@ INTEL_CPLUSPLUS=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:11471: checking if this is really Intel C++ compiler" >&5 + echo "$as_me:10157: 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="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 11476 "configure" +#line 10162 "configure" #include "confdefs.h" int @@ -11490,16 +10176,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11493: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10179: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11496: \$? = $ac_status" >&5 + echo "$as_me:10182: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11499: \"$ac_try\"") >&5 + { (eval echo "$as_me:10185: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11502: \$? = $ac_status" >&5 + echo "$as_me:10188: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_CPLUSPLUS=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -11510,7 +10196,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$cf_save_CFLAGS" - echo "$as_me:11513: result: $INTEL_CPLUSPLUS" >&5 + echo "$as_me:10199: result: $INTEL_CPLUSPLUS" >&5 echo "${ECHO_T}$INTEL_CPLUSPLUS" >&6 ;; esac @@ -11524,7 +10210,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat > conftest.$ac_ext <&5 + { echo "$as_me:10231: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-Wall" @@ -11559,12 +10245,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -$cf_opt" - if { (eval echo "$as_me:11562: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:10248: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11565: \$? = $ac_status" >&5 + echo "$as_me:10251: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:11567: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:10253: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" fi @@ -11573,7 +10259,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GXX" = yes then - { echo "$as_me:11576: checking for $CXX warning options..." >&5 + { echo "$as_me:10262: checking for $CXX warning options..." >&5 echo "$as_me: checking for $CXX warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-W -Wall" @@ -11602,23 +10288,23 @@ echo "$as_me: checking for $CXX warning options..." >&6;} Wundef $cf_gxx_extra_warnings Wno-unused do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -Werror -$cf_opt" - if { (eval echo "$as_me:11605: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:10291: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11608: \$? = $ac_status" >&5 + echo "$as_me:10294: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:11610: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:10296: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" else - test -n "$verbose" && echo "$as_me:11614: result: ... no -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:10300: result: ... no -$cf_opt" >&5 echo "${ECHO_T}... no -$cf_opt" >&6 fi done CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -rf conftest* +rm -f conftest* ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11647,10 +10333,10 @@ cat > conftest.i <&5 + { echo "$as_me:10336: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 - - case $cf_attribute in #(vi - printf) #(vi - cf_printf_attribute=yes - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <&5 + if { (eval echo "$as_me:10377: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11705: \$? = $ac_status" >&5 + echo "$as_me:10380: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:11707: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:10382: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h - case $cf_attribute in #(vi - printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <&5 +echo "$as_me:10394: checking if you want to enable runtime assertions" >&5 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. @@ -11750,7 +10401,7 @@ if test "${enable_assertions+set}" = set; then else with_assertions=no fi; -echo "$as_me:11753: result: $with_assertions" >&5 +echo "$as_me:10404: result: $with_assertions" >&5 echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then @@ -11762,15 +10413,13 @@ EOF CPPFLAGS="$CPPFLAGS -DNDEBUG" else - - ADAFLAGS="$ADAFLAGS -gnata" - + ADAFLAGS="$ADAFLAGS -gnata" fi fi ### use option --disable-leaks to suppress "permanent" leaks, for testing -echo "$as_me:11773: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:10422: 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. @@ -11786,7 +10435,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:11789: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:10438: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -11812,8 +10461,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -11828,16 +10477,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -11853,8 +10492,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -11866,7 +10505,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -11880,23 +10519,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:11883: checking for dmalloc.h" >&5 + echo "$as_me:10522: 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 11889 "configure" +#line 10528 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:11893: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10532: \"$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:11899: \$? = $ac_status" >&5 + echo "$as_me:10538: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11915,11 +10554,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:11918: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:10557: 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:11922: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:10561: 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 @@ -11927,7 +10566,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11930 "configure" +#line 10569 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11946,16 +10585,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11949: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10588: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11952: \$? = $ac_status" >&5 + echo "$as_me:10591: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11955: \"$ac_try\"") >&5 + { (eval echo "$as_me:10594: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11958: \$? = $ac_status" >&5 + echo "$as_me:10597: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -11966,7 +10605,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11969: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:10608: 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 <&5 +echo "$as_me:10623: 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. @@ -11997,7 +10636,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:12000: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:10639: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -12023,8 +10662,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -12039,16 +10678,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -12064,8 +10693,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -12077,7 +10706,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -12091,23 +10720,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:12094: checking for dbmalloc.h" >&5 + echo "$as_me:10723: 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 12100 "configure" +#line 10729 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:12104: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10733: \"$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:12110: \$? = $ac_status" >&5 + echo "$as_me:10739: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -12126,11 +10755,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:12129: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:10758: 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:12133: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:10762: 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 @@ -12138,7 +10767,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 12141 "configure" +#line 10770 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -12157,16 +10786,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12160: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10789: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12163: \$? = $ac_status" >&5 + echo "$as_me:10792: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12166: \"$ac_try\"") >&5 + { (eval echo "$as_me:10795: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12169: \$? = $ac_status" >&5 + echo "$as_me:10798: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -12177,7 +10806,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:12180: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:10809: 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 <&5 +echo "$as_me:10824: 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. @@ -12208,7 +10837,7 @@ EOF else with_valgrind= fi; -echo "$as_me:12211: result: ${with_valgrind:-no}" >&5 +echo "$as_me:10840: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in #(vi @@ -12234,8 +10863,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -12250,16 +10879,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -12275,8 +10894,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -12288,7 +10907,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -12301,26 +10920,22 @@ fi ;; esac -echo "$as_me:12304: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:10923: 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. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi + with_no_leaks=yes else : ${with_no_leaks:=no} fi; -echo "$as_me:12314: result: $with_no_leaks" >&5 +echo "$as_me:10933: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 -EOF - - cat >>confdefs.h <<\EOF -#define YY_NO_LEAKS 1 EOF fi @@ -12360,7 +10975,7 @@ case "$CFLAGS $CPPFLAGS" in ;; esac -echo "$as_me:12363: checking whether to add trace feature to all models" >&5 +echo "$as_me:10978: checking whether to add trace feature to all models" >&5 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 # Check whether --with-trace or --without-trace was given. @@ -12370,7 +10985,7 @@ if test "${with_trace+set}" = set; then else cf_with_trace=$cf_all_traces fi; -echo "$as_me:12373: result: $cf_with_trace" >&5 +echo "$as_me:10988: result: $cf_with_trace" >&5 echo "${ECHO_T}$cf_with_trace" >&6 if test "$cf_with_trace" = yes ; then @@ -12393,8 +11008,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -12409,16 +11024,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -12434,8 +11039,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -12447,7 +11052,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -12461,17 +11066,13 @@ else fi ### Checks for libraries. -case $cf_cv_system_name in #(vi -*mingw32*) #(vi - ;; -*) -echo "$as_me:12468: checking for gettimeofday" >&5 +echo "$as_me:11069: checking for gettimeofday" >&5 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 if test "${ac_cv_func_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12474 "configure" +#line 11075 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday (); below. */ @@ -12502,16 +11103,16 @@ f = gettimeofday; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12505: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11106: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12508: \$? = $ac_status" >&5 + echo "$as_me:11109: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12511: \"$ac_try\"") >&5 + { (eval echo "$as_me:11112: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12514: \$? = $ac_status" >&5 + echo "$as_me:11115: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gettimeofday=yes else @@ -12521,7 +11122,7 @@ ac_cv_func_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12524: result: $ac_cv_func_gettimeofday" >&5 +echo "$as_me:11125: result: $ac_cv_func_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 if test $ac_cv_func_gettimeofday = yes; then cat >>confdefs.h <<\EOF @@ -12530,7 +11131,7 @@ EOF else -echo "$as_me:12533: checking for gettimeofday in -lbsd" >&5 +echo "$as_me:11134: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12538,7 +11139,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 12541 "configure" +#line 11142 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -12557,16 +11158,16 @@ gettimeofday (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12560: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11161: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12563: \$? = $ac_status" >&5 + echo "$as_me:11164: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12566: \"$ac_try\"") >&5 + { (eval echo "$as_me:11167: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12569: \$? = $ac_status" >&5 + echo "$as_me:11170: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else @@ -12577,28 +11178,26 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:12580: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "$as_me:11181: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF - LIBS="-lbsd $LIBS" + LIBS="$LIBS -lbsd" fi fi - ;; -esac -echo "$as_me:12594: checking if -lm needed for math functions" >&5 +echo "$as_me:11193: 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 12601 "configure" +#line 11200 "configure" #include "confdefs.h" #include @@ -12613,16 +11212,16 @@ double x = rand(); printf("result = %g\n", sin(x)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12616: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11215: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12619: \$? = $ac_status" >&5 + echo "$as_me:11218: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12622: \"$ac_try\"") >&5 + { (eval echo "$as_me:11221: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12625: \$? = $ac_status" >&5 + echo "$as_me:11224: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_need_libm=no else @@ -12632,7 +11231,7 @@ cf_cv_need_libm=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12635: result: $cf_cv_need_libm" >&5 +echo "$as_me:11234: result: $cf_cv_need_libm" >&5 echo "${ECHO_T}$cf_cv_need_libm" >&6 if test "$cf_cv_need_libm" = yes then @@ -12640,13 +11239,13 @@ MATH_LIB=-lm fi ### Checks for header files. -echo "$as_me:12643: checking for ANSI C header files" >&5 +echo "$as_me:11242: 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 12649 "configure" +#line 11248 "configure" #include "confdefs.h" #include #include @@ -12654,13 +11253,13 @@ else #include _ACEOF -if { (eval echo "$as_me:12657: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:11256: \"$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:12663: \$? = $ac_status" >&5 + echo "$as_me:11262: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -12682,7 +11281,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 12685 "configure" +#line 11284 "configure" #include "confdefs.h" #include @@ -12693,14 +11292,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* 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 12703 "configure" +#line 11302 "configure" #include "confdefs.h" #include @@ -12711,7 +11310,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -rf conftest* +rm -f conftest* fi @@ -12721,7 +11320,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 12724 "configure" +#line 11323 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -12747,15 +11346,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12750: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11349: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12753: \$? = $ac_status" >&5 + echo "$as_me:11352: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12755: \"$ac_try\"") >&5 + { (eval echo "$as_me:11354: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12758: \$? = $ac_status" >&5 + echo "$as_me:11357: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -12768,7 +11367,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:12771: result: $ac_cv_header_stdc" >&5 +echo "$as_me:11370: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -12781,13 +11380,13 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:12784: checking for $ac_hdr that defines DIR" >&5 +echo "$as_me:11383: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 12790 "configure" +#line 11389 "configure" #include "confdefs.h" #include #include <$ac_hdr> @@ -12802,16 +11401,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12805: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11404: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12808: \$? = $ac_status" >&5 + echo "$as_me:11407: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12811: \"$ac_try\"") >&5 + { (eval echo "$as_me:11410: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12814: \$? = $ac_status" >&5 + echo "$as_me:11413: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -12821,7 +11420,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12824: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:11423: 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 <&5 + echo "$as_me:11436: checking for opendir in -ldir" >&5 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 if test "${ac_cv_lib_dir_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12842,7 +11441,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 12845 "configure" +#line 11444 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -12861,16 +11460,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12864: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11463: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12867: \$? = $ac_status" >&5 + echo "$as_me:11466: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12870: \"$ac_try\"") >&5 + { (eval echo "$as_me:11469: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12873: \$? = $ac_status" >&5 + echo "$as_me:11472: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dir_opendir=yes else @@ -12881,14 +11480,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:12884: result: $ac_cv_lib_dir_opendir" >&5 +echo "$as_me:11483: result: $ac_cv_lib_dir_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" fi else - echo "$as_me:12891: checking for opendir in -lx" >&5 + echo "$as_me:11490: checking for opendir in -lx" >&5 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 if test "${ac_cv_lib_x_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12896,7 +11495,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 12899 "configure" +#line 11498 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -12915,16 +11514,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12918: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11517: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12921: \$? = $ac_status" >&5 + echo "$as_me:11520: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12924: \"$ac_try\"") >&5 + { (eval echo "$as_me:11523: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12927: \$? = $ac_status" >&5 + echo "$as_me:11526: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_x_opendir=yes else @@ -12935,7 +11534,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:12938: result: $ac_cv_lib_x_opendir" >&5 +echo "$as_me:11537: result: $ac_cv_lib_x_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 if test $ac_cv_lib_x_opendir = yes; then LIBS="$LIBS -lx" @@ -12943,13 +11542,13 @@ fi fi -echo "$as_me:12946: checking whether time.h and sys/time.h may both be included" >&5 +echo "$as_me:11545: 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 12952 "configure" +#line 11551 "configure" #include "confdefs.h" #include #include @@ -12965,16 +11564,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12968: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11567: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12971: \$? = $ac_status" >&5 + echo "$as_me:11570: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12974: \"$ac_try\"") >&5 + { (eval echo "$as_me:11573: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12977: \$? = $ac_status" >&5 + echo "$as_me:11576: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else @@ -12984,7 +11583,7 @@ ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12987: result: $ac_cv_header_time" >&5 +echo "$as_me:11586: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then @@ -12994,287 +11593,90 @@ EOF fi -cf_regex_func=no - -cf_regex_libs="regex re" -case $host_os in #(vi -mingw*) - cf_regex_libs="regex.dll $cf_regex_libs" - ;; -esac - -echo "$as_me:13006: checking for regcomp" >&5 -echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 -if test "${ac_cv_func_regcomp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 13012 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char regcomp (); below. */ -#include -/* 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 regcomp (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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_regcomp) || defined (__stub___regcomp) -choke me -#else -f = regcomp; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13043: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13046: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13049: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13052: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_regcomp=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_regcomp=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:13062: result: $ac_cv_func_regcomp" >&5 -echo "${ECHO_T}$ac_cv_func_regcomp" >&6 -if test $ac_cv_func_regcomp = yes; then - cf_regex_func=regcomp -else - - for cf_regex_lib in $cf_regex_libs - do - as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` -echo "$as_me:13071: checking for regcomp in -l$cf_regex_lib" >&5 -echo $ECHO_N "checking for regcomp in -l$cf_regex_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_regex_lib $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 13079 "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 regcomp (); -int -main () -{ -regcomp (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13098: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13101: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13104: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13107: \$? = $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:13118: 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 - - LIBS="-l$cf_regex_lib $LIBS" - cf_regex_func=regcomp - break -fi - - done - -fi - -if test "$cf_regex_func" = no ; then - echo "$as_me:13132: checking for compile" >&5 -echo $ECHO_N "checking for compile... $ECHO_C" >&6 -if test "${ac_cv_func_compile+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 13138 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char compile (); below. */ -#include -/* 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 compile (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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_compile) || defined (__stub___compile) -choke me -#else -f = compile; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13169: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13172: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13175: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13178: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_compile=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_compile=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:13188: result: $ac_cv_func_compile" >&5 -echo "${ECHO_T}$ac_cv_func_compile" >&6 -if test $ac_cv_func_compile = yes; then - cf_regex_func=compile -else - - echo "$as_me:13194: checking for compile in -lgen" >&5 -echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6 -if test "${ac_cv_lib_gen_compile+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgen $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 13202 "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 compile (); -int -main () -{ -compile (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13221: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13224: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13227: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13230: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gen_compile=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_gen_compile=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:13241: result: $ac_cv_lib_gen_compile" >&5 -echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6 -if test $ac_cv_lib_gen_compile = yes; then - - LIBS="-lgen $LIBS" - cf_regex_func=compile -fi - -fi - -fi - -if test "$cf_regex_func" = no ; then - { echo "$as_me:13254: WARNING: cannot find regular expression library" >&5 -echo "$as_me: WARNING: cannot find regular expression library" >&2;} -fi - -echo "$as_me:13258: checking for regular-expression headers" >&5 +echo "$as_me:11596: checking for regular-expression headers" >&5 echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 -if test "${cf_cv_regex_hdrs+set}" = set; then +if test "${cf_cv_regex+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cf_cv_regex_hdrs=no -case $cf_regex_func in #(vi -compile) #(vi - for cf_regex_hdr in regexp.h regexpr.h - do - cat >conftest.$ac_ext <<_ACEOF -#line 13270 "configure" +cat >conftest.$ac_ext <<_ACEOF +#line 11603 "configure" #include "confdefs.h" -#include <$cf_regex_hdr> +#include +#include int main () { - char *p = compile("", "", "", 0); + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11621: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11624: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11627: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11630: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_regex="regex.h" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + cat >conftest.$ac_ext <<_ACEOF +#line 11638 "configure" +#include "confdefs.h" +#include +int +main () +{ + + char *p = compile("", "", "", 0); + int x = step("", ""); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11653: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11656: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11659: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11662: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_regex="regexp.h" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + cf_save_LIBS="$LIBS" + LIBS="-lgen $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 11672 "configure" +#include "confdefs.h" +#include +int +main () +{ + + char *p = compile("", "", ""); int x = step("", ""); ; @@ -13282,90 +11684,43 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13285: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11687: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13288: \$? = $ac_status" >&5 + echo "$as_me:11690: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13291: \"$ac_try\"") >&5 + { (eval echo "$as_me:11693: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13294: \$? = $ac_status" >&5 + echo "$as_me:11696: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - - cf_cv_regex_hdrs=$cf_regex_hdr - break - + cf_cv_regex="regexpr.h" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 +LIBS="$cf_save_LIBS" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done - ;; -*) - for cf_regex_hdr in regex.h - do - cat >conftest.$ac_ext <<_ACEOF -#line 13311 "configure" -#include "confdefs.h" -#include -#include <$cf_regex_hdr> -int -main () -{ - - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13329: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13332: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13335: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13338: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_regex_hdrs=$cf_regex_hdr - break - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done - ;; -esac fi -echo "$as_me:13354: result: $cf_cv_regex_hdrs" >&5 -echo "${ECHO_T}$cf_cv_regex_hdrs" >&6 -case $cf_cv_regex_hdrs in #(vi - no) { echo "$as_me:13358: WARNING: no regular expression header found" >&5 -echo "$as_me: WARNING: no regular expression header found" >&2;} ;; #(vi - regex.h) cat >>confdefs.h <<\EOF +echo "$as_me:11712: result: $cf_cv_regex" >&5 +echo "${ECHO_T}$cf_cv_regex" >&6 +case $cf_cv_regex in + regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF - ;; #(vi - regexp.h) cat >>confdefs.h <<\EOF + ;; + regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF - ;; #(vi - regexpr.h) cat >>confdefs.h <<\EOF + ;; + regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; @@ -13376,7 +11731,6 @@ fcntl.h \ getopt.h \ limits.h \ locale.h \ -math.h \ poll.h \ sys/bsdtypes.h \ sys/ioctl.h \ @@ -13391,23 +11745,23 @@ wctype.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:13394: checking for $ac_header" >&5 +echo "$as_me:11748: 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 13400 "configure" +#line 11754 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13404: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:11758: \"$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:13410: \$? = $ac_status" >&5 + echo "$as_me:11764: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13426,7 +11780,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13429: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:11783: 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 < to declare fd_set if test "$ISC" = yes ; then -echo "$as_me:13443: checking for main in -lcposix" >&5 +echo "$as_me:11797: checking for main in -lcposix" >&5 echo $ECHO_N "checking for main in -lcposix... $ECHO_C" >&6 if test "${ac_cv_lib_cposix_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13448,7 +11802,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 13451 "configure" +#line 11805 "configure" #include "confdefs.h" int @@ -13460,16 +11814,16 @@ main (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13463: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11817: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13466: \$? = $ac_status" >&5 + echo "$as_me:11820: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13469: \"$ac_try\"") >&5 + { (eval echo "$as_me:11823: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13472: \$? = $ac_status" >&5 + echo "$as_me:11826: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cposix_main=yes else @@ -13480,7 +11834,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:13483: result: $ac_cv_lib_cposix_main" >&5 +echo "$as_me:11837: result: $ac_cv_lib_cposix_main" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_main" >&6 if test $ac_cv_lib_cposix_main = yes; then cat >>confdefs.h <&5 + echo "$as_me:11848: checking for bzero in -linet" >&5 echo $ECHO_N "checking for bzero in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_bzero+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13499,7 +11853,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 13502 "configure" +#line 11856 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -13518,16 +11872,16 @@ bzero (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13521: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11875: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13524: \$? = $ac_status" >&5 + echo "$as_me:11878: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13527: \"$ac_try\"") >&5 + { (eval echo "$as_me:11881: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13530: \$? = $ac_status" >&5 + echo "$as_me:11884: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_bzero=yes else @@ -13538,21 +11892,21 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:13541: result: $ac_cv_lib_inet_bzero" >&5 +echo "$as_me:11895: result: $ac_cv_lib_inet_bzero" >&5 echo "${ECHO_T}$ac_cv_lib_inet_bzero" >&6 if test $ac_cv_lib_inet_bzero = yes; then - LIBS="-linet $LIBS" + LIBS="$LIBS -linet" fi fi -echo "$as_me:13548: checking if sys/time.h works with sys/select.h" >&5 +echo "$as_me:11902: 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 13555 "configure" +#line 11909 "configure" #include "confdefs.h" #include @@ -13572,16 +11926,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13575: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11929: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13578: \$? = $ac_status" >&5 + echo "$as_me:11932: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13581: \"$ac_try\"") >&5 + { (eval echo "$as_me:11935: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13584: \$? = $ac_status" >&5 + echo "$as_me:11938: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sys_time_select=yes else @@ -13593,7 +11947,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13596: result: $cf_cv_sys_time_select" >&5 +echo "$as_me:11950: 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 @@ -13607,7 +11961,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:13610: checking for $CC option to accept ANSI C" >&5 +echo "$as_me:11964: 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 @@ -13615,7 +11969,7 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line 13618 "configure" +#line 11972 "configure" #include "confdefs.h" #include #include @@ -13664,16 +12018,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:13667: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12021: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13670: \$? = $ac_status" >&5 + echo "$as_me:12024: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13673: \"$ac_try\"") >&5 + { (eval echo "$as_me:12027: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13676: \$? = $ac_status" >&5 + echo "$as_me:12030: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -13690,21 +12044,21 @@ fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:13693: result: none needed" >&5 + echo "$as_me:12047: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:13696: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:12050: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac -echo "$as_me:13701: checking for an ANSI C-conforming const" >&5 +echo "$as_me:12055: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13707 "configure" +#line 12061 "configure" #include "confdefs.h" int @@ -13762,16 +12116,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13765: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12119: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13768: \$? = $ac_status" >&5 + echo "$as_me:12122: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13771: \"$ac_try\"") >&5 + { (eval echo "$as_me:12125: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13774: \$? = $ac_status" >&5 + echo "$as_me:12128: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else @@ -13781,7 +12135,7 @@ ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13784: result: $ac_cv_c_const" >&5 +echo "$as_me:12138: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then @@ -13791,7 +12145,7 @@ EOF fi -echo "$as_me:13794: checking for inline" >&5 +echo "$as_me:12148: 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 @@ -13799,7 +12153,7 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line 13802 "configure" +#line 12156 "configure" #include "confdefs.h" #ifndef __cplusplus static $ac_kw int static_foo () {return 0; } @@ -13808,16 +12162,16 @@ $ac_kw int foo () {return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13811: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12165: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13814: \$? = $ac_status" >&5 + echo "$as_me:12168: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13817: \"$ac_try\"") >&5 + { (eval echo "$as_me:12171: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13820: \$? = $ac_status" >&5 + echo "$as_me:12174: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else @@ -13828,7 +12182,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:13831: result: $ac_cv_c_inline" >&5 +echo "$as_me:12185: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; @@ -13851,8 +12205,8 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - echo "$as_me:13854: checking if $CC supports options to tune inlining" >&5 -echo $ECHO_N "checking if $CC supports options to tune inlining... $ECHO_C" >&6 + echo "$as_me:12208: checking if gcc supports options to tune inlining" >&5 +echo $ECHO_N "checking if gcc supports options to tune inlining... $ECHO_C" >&6 if test "${cf_cv_gcc_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -13860,7 +12214,7 @@ else cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=1200" cat >conftest.$ac_ext <<_ACEOF -#line 13863 "configure" +#line 12217 "configure" #include "confdefs.h" inline int foo(void) { return 1; } int @@ -13872,16 +12226,16 @@ ${cf_cv_main_return:-return} foo() } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13875: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13878: \$? = $ac_status" >&5 + echo "$as_me:12232: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13881: \"$ac_try\"") >&5 + { (eval echo "$as_me:12235: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13884: \$? = $ac_status" >&5 + echo "$as_me:12238: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gcc_inline=yes else @@ -13893,7 +12247,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS=$cf_save_CFLAGS fi -echo "$as_me:13896: result: $cf_cv_gcc_inline" >&5 +echo "$as_me:12250: result: $cf_cv_gcc_inline" >&5 echo "${ECHO_T}$cf_cv_gcc_inline" >&6 if test "$cf_cv_gcc_inline" = yes ; then @@ -13913,8 +12267,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -13929,16 +12283,6 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi - case $cf_add_cflags in #(vi - -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -13954,8 +12298,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -13967,7 +12311,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + CPPFLAGS="$cf_new_cppflags $CPPFLAGS" fi if test -n "$cf_new_extra_cppflags" ; then @@ -13979,7 +12323,7 @@ fi fi fi -echo "$as_me:13982: checking for signal global datatype" >&5 +echo "$as_me:12326: 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 @@ -13991,7 +12335,7 @@ else "int" do cat >conftest.$ac_ext <<_ACEOF -#line 13994 "configure" +#line 12338 "configure" #include "confdefs.h" #include @@ -14014,16 +12358,16 @@ signal(SIGINT, handler); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14017: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12361: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14020: \$? = $ac_status" >&5 + echo "$as_me:12364: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14023: \"$ac_try\"") >&5 + { (eval echo "$as_me:12367: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14026: \$? = $ac_status" >&5 + echo "$as_me:12370: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sig_atomic_t=$cf_type else @@ -14037,7 +12381,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:14040: result: $cf_cv_sig_atomic_t" >&5 +echo "$as_me:12384: 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 <&5 +echo "$as_me:12392: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 if test "${cf_cv_typeof_chtype+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14055,7 +12399,7 @@ else cf_cv_typeof_chtype=long else cat >conftest.$ac_ext <<_ACEOF -#line 14058 "configure" +#line 12402 "configure" #include "confdefs.h" #define WANT_BITS 31 @@ -14090,15 +12434,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12437: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14096: \$? = $ac_status" >&5 + echo "$as_me:12440: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14098: \"$ac_try\"") >&5 + { (eval echo "$as_me:12442: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14101: \$? = $ac_status" >&5 + echo "$as_me:12445: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_typeof_chtype=`cat cf_test.out` else @@ -14113,7 +12457,7 @@ fi fi -echo "$as_me:14116: result: $cf_cv_typeof_chtype" >&5 +echo "$as_me:12460: result: $cf_cv_typeof_chtype" >&5 echo "${ECHO_T}$cf_cv_typeof_chtype" >&6 cat >>confdefs.h <&5 +echo "$as_me:12472: checking if unsigned literals are legal" >&5 echo $ECHO_N "checking if unsigned literals are legal... $ECHO_C" >&6 if test "${cf_cv_unsigned_literals+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14135 "configure" +#line 12479 "configure" #include "confdefs.h" int @@ -14144,16 +12488,16 @@ long x = 1L + 1UL + 1U + 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14147: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12491: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14150: \$? = $ac_status" >&5 + echo "$as_me:12494: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14153: \"$ac_try\"") >&5 + { (eval echo "$as_me:12497: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14156: \$? = $ac_status" >&5 + echo "$as_me:12500: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_unsigned_literals=yes else @@ -14165,7 +12509,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:14168: result: $cf_cv_unsigned_literals" >&5 +echo "$as_me:12512: result: $cf_cv_unsigned_literals" >&5 echo "${ECHO_T}$cf_cv_unsigned_literals" >&6 cf_cv_1UL="1" @@ -14181,14 +12525,14 @@ test "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t="" ### Checks for external-data -echo "$as_me:14184: checking if external errno is declared" >&5 +echo "$as_me:12528: checking if external errno is declared" >&5 echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14191 "configure" +#line 12535 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -14206,16 +12550,16 @@ int x = (int) errno } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12553: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14212: \$? = $ac_status" >&5 + echo "$as_me:12556: \$? = $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:12559: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14218: \$? = $ac_status" >&5 + echo "$as_me:12562: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_dcl_errno=yes else @@ -14226,7 +12570,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:14229: result: $cf_cv_dcl_errno" >&5 +echo "$as_me:12573: result: $cf_cv_dcl_errno" >&5 echo "${ECHO_T}$cf_cv_dcl_errno" >&6 if test "$cf_cv_dcl_errno" = no ; then @@ -14241,14 +12585,14 @@ fi # It's possible (for near-UNIX clones) that the data doesn't exist -echo "$as_me:14244: checking if external errno exists" >&5 +echo "$as_me:12588: checking if external errno exists" >&5 echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6 if test "${cf_cv_have_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14251 "configure" +#line 12595 "configure" #include "confdefs.h" #undef errno @@ -14263,16 +12607,16 @@ errno = 2 } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14266: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12610: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14269: \$? = $ac_status" >&5 + echo "$as_me:12613: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14272: \"$ac_try\"") >&5 + { (eval echo "$as_me:12616: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14275: \$? = $ac_status" >&5 + echo "$as_me:12619: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_errno=yes else @@ -14283,7 +12627,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:14286: result: $cf_cv_have_errno" >&5 +echo "$as_me:12630: result: $cf_cv_have_errno" >&5 echo "${ECHO_T}$cf_cv_have_errno" >&6 if test "$cf_cv_have_errno" = yes ; then @@ -14296,7 +12640,7 @@ EOF fi -echo "$as_me:14299: checking if data-only library module links" >&5 +echo "$as_me:12643: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14304,20 +12648,20 @@ else rm -f conftest.a cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:12654: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14313: \$? = $ac_status" >&5 + echo "$as_me:12657: \$? = $ac_status" >&5 (exit $ac_status); } ; then mv conftest.o data.o && \ - ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null + ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:12677: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14336: \$? = $ac_status" >&5 + echo "$as_me:12680: \$? = $ac_status" >&5 (exit $ac_status); }; then mv conftest.o func.o && \ - ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null + ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&5 >/dev/null @@ -14346,7 +12690,7 @@ EOF cf_cv_link_dataonly=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14349 "configure" +#line 12693 "configure" #include "confdefs.h" int main() @@ -14357,15 +12701,15 @@ else _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14360: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12704: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14363: \$? = $ac_status" >&5 + echo "$as_me:12707: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14365: \"$ac_try\"") >&5 + { (eval echo "$as_me:12709: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14368: \$? = $ac_status" >&5 + echo "$as_me:12712: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else @@ -14380,7 +12724,7 @@ fi fi -echo "$as_me:14383: result: $cf_cv_link_dataonly" >&5 +echo "$as_me:12727: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then @@ -14415,13 +12759,13 @@ vsnprintf \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:14418: checking for $ac_func" >&5 +echo "$as_me:12762: 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 14424 "configure" +#line 12768 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -14452,16 +12796,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14455: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12799: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14458: \$? = $ac_status" >&5 + echo "$as_me:12802: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14461: \"$ac_try\"") >&5 + { (eval echo "$as_me:12805: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14464: \$? = $ac_status" >&5 + echo "$as_me:12808: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -14471,7 +12815,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:14474: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:12818: 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 <&5 +echo "$as_me:12830: checking for terminal-capability database functions" >&5 echo $ECHO_N "checking for terminal-capability database functions... $ECHO_C" >&6 if test "${cf_cv_cgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14493 "configure" +#line 12837 "configure" #include "confdefs.h" #include @@ -14510,16 +12854,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14513: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12857: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14516: \$? = $ac_status" >&5 + echo "$as_me:12860: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14519: \"$ac_try\"") >&5 + { (eval echo "$as_me:12863: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14522: \$? = $ac_status" >&5 + echo "$as_me:12866: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cgetent=yes else @@ -14531,7 +12875,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:14534: result: $cf_cv_cgetent" >&5 +echo "$as_me:12878: result: $cf_cv_cgetent" >&5 echo "${ECHO_T}$cf_cv_cgetent" >&6 test "$cf_cv_cgetent" = yes && cat >>confdefs.h <<\EOF #define HAVE_BSD_CGETENT 1 @@ -14539,14 +12883,14 @@ EOF fi -echo "$as_me:14542: checking for isascii" >&5 +echo "$as_me:12886: checking for isascii" >&5 echo $ECHO_N "checking for isascii... $ECHO_C" >&6 if test "${cf_cv_have_isascii+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14549 "configure" +#line 12893 "configure" #include "confdefs.h" #include int @@ -14558,16 +12902,16 @@ int x = isascii(' ') } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14561: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12905: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14564: \$? = $ac_status" >&5 + echo "$as_me:12908: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14567: \"$ac_try\"") >&5 + { (eval echo "$as_me:12911: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14570: \$? = $ac_status" >&5 + echo "$as_me:12914: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_isascii=yes else @@ -14578,17 +12922,17 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:14581: result: $cf_cv_have_isascii" >&5 +echo "$as_me:12925: result: $cf_cv_have_isascii" >&5 echo "${ECHO_T}$cf_cv_have_isascii" >&6 test "$cf_cv_have_isascii" = yes && cat >>confdefs.h <<\EOF #define HAVE_ISASCII 1 EOF if test "$ac_cv_func_sigaction" = yes; then -echo "$as_me:14588: checking whether sigaction needs _POSIX_SOURCE" >&5 +echo "$as_me:12932: checking whether sigaction needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether sigaction needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 14591 "configure" +#line 12935 "configure" #include "confdefs.h" #include @@ -14602,16 +12946,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14605: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12949: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14608: \$? = $ac_status" >&5 + echo "$as_me:12952: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14611: \"$ac_try\"") >&5 + { (eval echo "$as_me:12955: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14614: \$? = $ac_status" >&5 + echo "$as_me:12958: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=no else @@ -14619,7 +12963,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14622 "configure" +#line 12966 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -14634,16 +12978,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14637: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12981: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14640: \$? = $ac_status" >&5 + echo "$as_me:12984: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14643: \"$ac_try\"") >&5 + { (eval echo "$as_me:12987: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14646: \$? = $ac_status" >&5 + echo "$as_me:12990: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=yes cat >>confdefs.h <<\EOF @@ -14658,11 +13002,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:14661: result: $sigact_bad" >&5 +echo "$as_me:13005: result: $sigact_bad" >&5 echo "${ECHO_T}$sigact_bad" >&6 fi -echo "$as_me:14665: checking if nanosleep really works" >&5 +echo "$as_me:13009: checking if nanosleep really works" >&5 echo $ECHO_N "checking if nanosleep really works... $ECHO_C" >&6 if test "${cf_cv_func_nanosleep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14672,7 +13016,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_nanosleep=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14675 "configure" +#line 13019 "configure" #include "confdefs.h" #include @@ -14697,15 +13041,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14700: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13044: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14703: \$? = $ac_status" >&5 + echo "$as_me:13047: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14705: \"$ac_try\"") >&5 + { (eval echo "$as_me:13049: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14708: \$? = $ac_status" >&5 + echo "$as_me:13052: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_nanosleep=yes else @@ -14717,7 +13061,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14720: result: $cf_cv_func_nanosleep" >&5 +echo "$as_me:13064: result: $cf_cv_func_nanosleep" >&5 echo "${ECHO_T}$cf_cv_func_nanosleep" >&6 test "$cf_cv_func_nanosleep" = "yes" && cat >>confdefs.h <<\EOF @@ -14731,23 +13075,23 @@ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:14734: checking for $ac_header" >&5 +echo "$as_me:13078: 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 14740 "configure" +#line 13084 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:14744: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:13088: \"$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:14750: \$? = $ac_status" >&5 + echo "$as_me:13094: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -14766,7 +13110,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:14769: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:13113: 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 <&5 +echo "$as_me:13128: 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 14790 "configure" +#line 13134 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:14794: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:13138: \"$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:14800: \$? = $ac_status" >&5 + echo "$as_me:13144: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -14816,7 +13160,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:14819: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:13163: 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 <&5 + echo "$as_me:13181: checking whether termios.h needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 14840 "configure" +#line 13184 "configure" #include "confdefs.h" #include int @@ -14849,16 +13193,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14852: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13196: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14855: \$? = $ac_status" >&5 + echo "$as_me:13199: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14858: \"$ac_try\"") >&5 + { (eval echo "$as_me:13202: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14861: \$? = $ac_status" >&5 + echo "$as_me:13205: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=no else @@ -14866,7 +13210,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14869 "configure" +#line 13213 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -14880,16 +13224,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14883: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13227: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14886: \$? = $ac_status" >&5 + echo "$as_me:13230: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14889: \"$ac_try\"") >&5 + { (eval echo "$as_me:13233: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14892: \$? = $ac_status" >&5 + echo "$as_me:13236: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=unknown else @@ -14904,19 +13248,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:14907: result: $termios_bad" >&5 + echo "$as_me:13251: result: $termios_bad" >&5 echo "${ECHO_T}$termios_bad" >&6 fi fi -echo "$as_me:14912: checking for tcgetattr" >&5 +echo "$as_me:13256: checking for tcgetattr" >&5 echo $ECHO_N "checking for tcgetattr... $ECHO_C" >&6 if test "${cf_cv_have_tcgetattr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14919 "configure" +#line 13263 "configure" #include "confdefs.h" #include @@ -14944,16 +13288,16 @@ tcgetattr(1, &foo); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14947: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13291: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14950: \$? = $ac_status" >&5 + echo "$as_me:13294: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14953: \"$ac_try\"") >&5 + { (eval echo "$as_me:13297: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14956: \$? = $ac_status" >&5 + echo "$as_me:13300: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_tcgetattr=yes else @@ -14963,20 +13307,20 @@ cf_cv_have_tcgetattr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:14966: result: $cf_cv_have_tcgetattr" >&5 +echo "$as_me:13310: result: $cf_cv_have_tcgetattr" >&5 echo "${ECHO_T}$cf_cv_have_tcgetattr" >&6 test "$cf_cv_have_tcgetattr" = yes && cat >>confdefs.h <<\EOF #define HAVE_TCGETATTR 1 EOF -echo "$as_me:14972: checking for vsscanf function or workaround" >&5 +echo "$as_me:13316: checking for vsscanf function or workaround" >&5 echo $ECHO_N "checking for vsscanf function or workaround... $ECHO_C" >&6 if test "${cf_cv_func_vsscanf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14979 "configure" +#line 13323 "configure" #include "confdefs.h" #include @@ -14992,16 +13336,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14995: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13339: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14998: \$? = $ac_status" >&5 + echo "$as_me:13342: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15001: \"$ac_try\"") >&5 + { (eval echo "$as_me:13345: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15004: \$? = $ac_status" >&5 + echo "$as_me:13348: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vsscanf else @@ -15009,7 +13353,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 15012 "configure" +#line 13356 "configure" #include "confdefs.h" #include @@ -15031,16 +13375,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15034: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13378: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15037: \$? = $ac_status" >&5 + echo "$as_me:13381: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15040: \"$ac_try\"") >&5 + { (eval echo "$as_me:13384: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15043: \$? = $ac_status" >&5 + echo "$as_me:13387: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vfscanf else @@ -15048,7 +13392,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 15051 "configure" +#line 13395 "configure" #include "confdefs.h" #include @@ -15070,16 +13414,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15073: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13417: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15076: \$? = $ac_status" >&5 + echo "$as_me:13420: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15079: \"$ac_try\"") >&5 + { (eval echo "$as_me:13423: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15082: \$? = $ac_status" >&5 + echo "$as_me:13426: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=_doscan else @@ -15094,7 +13438,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:15097: result: $cf_cv_func_vsscanf" >&5 +echo "$as_me:13441: result: $cf_cv_func_vsscanf" >&5 echo "${ECHO_T}$cf_cv_func_vsscanf" >&6 case $cf_cv_func_vsscanf in #(vi @@ -15112,21 +13456,21 @@ EOF ;; esac -echo "$as_me:15115: checking for working mkstemp" >&5 +echo "$as_me:13459: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -rm -rf conftest* +rm -f conftest* if test "$cross_compiling" = yes; then - echo "$as_me:15123: checking for mkstemp" >&5 + echo "$as_me:13467: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15129 "configure" +#line 13473 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -15157,16 +13501,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15160: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13504: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15163: \$? = $ac_status" >&5 + echo "$as_me:13507: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15166: \"$ac_try\"") >&5 + { (eval echo "$as_me:13510: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15169: \$? = $ac_status" >&5 + echo "$as_me:13513: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -15176,12 +13520,12 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:15179: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:13523: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15184 "configure" +#line 13528 "configure" #include "confdefs.h" #include @@ -15219,15 +13563,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15222: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13566: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15225: \$? = $ac_status" >&5 + echo "$as_me:13569: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15227: \"$ac_try\"") >&5 + { (eval echo "$as_me:13571: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15230: \$? = $ac_status" >&5 + echo "$as_me:13574: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -15242,9 +13586,9 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:15245: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:13589: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 -if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then +if test "$cf_cv_func_mkstemp" = yes ; then cat >>confdefs.h <<\EOF #define HAVE_MKSTEMP 1 EOF @@ -15260,21 +13604,21 @@ else fi if test "$cross_compiling" = yes ; then - { echo "$as_me:15263: WARNING: cross compiling: assume setvbuf params not reversed" >&5 + { echo "$as_me:13607: WARNING: cross compiling: assume setvbuf params not reversed" >&5 echo "$as_me: WARNING: cross compiling: assume setvbuf params not reversed" >&2;} else - echo "$as_me:15266: checking whether setvbuf arguments are reversed" >&5 + echo "$as_me:13610: checking whether setvbuf arguments are reversed" >&5 echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6 if test "${ac_cv_func_setvbuf_reversed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:15272: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:13616: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 15277 "configure" +#line 13621 "configure" #include "confdefs.h" #include /* If setvbuf has the reversed format, exit 0. */ @@ -15291,15 +13635,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15294: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13638: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15297: \$? = $ac_status" >&5 + echo "$as_me:13641: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15299: \"$ac_try\"") >&5 + { (eval echo "$as_me:13643: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15302: \$? = $ac_status" >&5 + echo "$as_me:13646: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setvbuf_reversed=yes else @@ -15312,7 +13656,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f core core.* *.core fi -echo "$as_me:15315: result: $ac_cv_func_setvbuf_reversed" >&5 +echo "$as_me:13659: result: $ac_cv_func_setvbuf_reversed" >&5 echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6 if test $ac_cv_func_setvbuf_reversed = yes; then @@ -15323,13 +13667,13 @@ EOF fi fi -echo "$as_me:15326: checking return type of signal handlers" >&5 +echo "$as_me:13670: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15332 "configure" +#line 13676 "configure" #include "confdefs.h" #include #include @@ -15351,16 +13695,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15354: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13698: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15357: \$? = $ac_status" >&5 + echo "$as_me:13701: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15360: \"$ac_try\"") >&5 + { (eval echo "$as_me:13704: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15363: \$? = $ac_status" >&5 + echo "$as_me:13707: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else @@ -15370,21 +13714,21 @@ ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:15373: result: $ac_cv_type_signal" >&5 +echo "$as_me:13717: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 +echo "$as_me:13724: checking for type sigaction_t" >&5 echo $ECHO_N "checking for type sigaction_t... $ECHO_C" >&6 if test "${cf_cv_type_sigaction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15387 "configure" +#line 13731 "configure" #include "confdefs.h" #include @@ -15397,16 +13741,16 @@ sigaction_t x } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15400: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13744: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15403: \$? = $ac_status" >&5 + echo "$as_me:13747: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15406: \"$ac_try\"") >&5 + { (eval echo "$as_me:13750: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15409: \$? = $ac_status" >&5 + echo "$as_me:13753: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_sigaction=yes else @@ -15417,13 +13761,13 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:15420: result: $cf_cv_type_sigaction" >&5 +echo "$as_me:13764: result: $cf_cv_type_sigaction" >&5 echo "${ECHO_T}$cf_cv_type_sigaction" >&6 test "$cf_cv_type_sigaction" = yes && cat >>confdefs.h <<\EOF #define HAVE_TYPE_SIGACTION 1 EOF -echo "$as_me:15426: checking declaration of size-change" >&5 +echo "$as_me:13770: checking declaration of size-change" >&5 echo $ECHO_N "checking declaration of size-change... $ECHO_C" >&6 if test "${cf_cv_sizechange+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15438,7 +13782,7 @@ do CPPFLAGS="$cf_save_CPPFLAGS" test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" cat >conftest.$ac_ext <<_ACEOF -#line 15441 "configure" +#line 13785 "configure" #include "confdefs.h" #include #ifdef HAVE_TERMIOS_H @@ -15482,16 +13826,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15485: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13829: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15488: \$? = $ac_status" >&5 + echo "$as_me:13832: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15491: \"$ac_try\"") >&5 + { (eval echo "$as_me:13835: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15494: \$? = $ac_status" >&5 + echo "$as_me:13838: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sizechange=yes else @@ -15510,7 +13854,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:15513: result: $cf_cv_sizechange" >&5 +echo "$as_me:13857: result: $cf_cv_sizechange" >&5 echo "${ECHO_T}$cf_cv_sizechange" >&6 if test "$cf_cv_sizechange" != no ; then cat >>confdefs.h <<\EOF @@ -15527,13 +13871,13 @@ EOF esac fi -echo "$as_me:15530: checking for memmove" >&5 +echo "$as_me:13874: checking for memmove" >&5 echo $ECHO_N "checking for memmove... $ECHO_C" >&6 if test "${ac_cv_func_memmove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15536 "configure" +#line 13880 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memmove (); below. */ @@ -15564,16 +13908,16 @@ f = memmove; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15567: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13911: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15570: \$? = $ac_status" >&5 + echo "$as_me:13914: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15573: \"$ac_try\"") >&5 + { (eval echo "$as_me:13917: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15576: \$? = $ac_status" >&5 + echo "$as_me:13920: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memmove=yes else @@ -15583,19 +13927,19 @@ ac_cv_func_memmove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:15586: result: $ac_cv_func_memmove" >&5 +echo "$as_me:13930: result: $ac_cv_func_memmove" >&5 echo "${ECHO_T}$ac_cv_func_memmove" >&6 if test $ac_cv_func_memmove = yes; then : else -echo "$as_me:15592: checking for bcopy" >&5 +echo "$as_me:13936: checking for bcopy" >&5 echo $ECHO_N "checking for bcopy... $ECHO_C" >&6 if test "${ac_cv_func_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15598 "configure" +#line 13942 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bcopy (); below. */ @@ -15626,16 +13970,16 @@ f = bcopy; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15629: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13973: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15632: \$? = $ac_status" >&5 + echo "$as_me:13976: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15635: \"$ac_try\"") >&5 + { (eval echo "$as_me:13979: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15638: \$? = $ac_status" >&5 + echo "$as_me:13982: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_bcopy=yes else @@ -15645,11 +13989,11 @@ ac_cv_func_bcopy=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:15648: result: $ac_cv_func_bcopy" >&5 +echo "$as_me:13992: result: $ac_cv_func_bcopy" >&5 echo "${ECHO_T}$ac_cv_func_bcopy" >&6 if test $ac_cv_func_bcopy = yes; then - echo "$as_me:15652: checking if bcopy does overlapping moves" >&5 + echo "$as_me:13996: checking if bcopy does overlapping moves" >&5 echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6 if test "${cf_cv_good_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15659,7 +14003,7 @@ else cf_cv_good_bcopy=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15662 "configure" +#line 14006 "configure" #include "confdefs.h" int main() { @@ -15673,15 +14017,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15676: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14020: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15679: \$? = $ac_status" >&5 + echo "$as_me:14023: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15681: \"$ac_try\"") >&5 + { (eval echo "$as_me:14025: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15684: \$? = $ac_status" >&5 + echo "$as_me:14028: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_good_bcopy=yes else @@ -15694,7 +14038,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:15697: result: $cf_cv_good_bcopy" >&5 +echo "$as_me:14041: result: $cf_cv_good_bcopy" >&5 echo "${ECHO_T}$cf_cv_good_bcopy" >&6 else @@ -15715,7 +14059,7 @@ EOF fi -echo "$as_me:15718: checking if poll really works" >&5 +echo "$as_me:14062: checking if poll really works" >&5 echo $ECHO_N "checking if poll really works... $ECHO_C" >&6 if test "${cf_cv_working_poll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15725,7 +14069,7 @@ if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15728 "configure" +#line 14072 "configure" #include "confdefs.h" #include @@ -15746,15 +14090,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15749: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15752: \$? = $ac_status" >&5 + echo "$as_me:14096: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15754: \"$ac_try\"") >&5 + { (eval echo "$as_me:14098: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15757: \$? = $ac_status" >&5 + echo "$as_me:14101: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_working_poll=yes else @@ -15766,505 +14110,15 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:15769: result: $cf_cv_working_poll" >&5 +echo "$as_me:14113: result: $cf_cv_working_poll" >&5 echo "${ECHO_T}$cf_cv_working_poll" >&6 test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_WORKING_POLL 1 EOF -echo "$as_me:15775: checking for va_copy" >&5 -echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 -if test "${cf_cv_have_va_copy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cat >conftest.$ac_ext <<_ACEOF -#line 15782 "configure" -#include "confdefs.h" - -#include - -int -main () -{ - - static va_list dst; - static va_list src; - va_copy(dst, src) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15799: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:15802: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15805: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:15808: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_have_va_copy=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_have_va_copy=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:15818: result: $cf_cv_have_va_copy" >&5 -echo "${ECHO_T}$cf_cv_have_va_copy" >&6 - -test "$cf_cv_have_va_copy" = yes && cat >>confdefs.h <<\EOF -#define HAVE_VA_COPY 1 -EOF - -echo "$as_me:15825: checking for __va_copy" >&5 -echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6 -if test "${cf_cv_have___va_copy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cat >conftest.$ac_ext <<_ACEOF -#line 15832 "configure" -#include "confdefs.h" - -#include - -int -main () -{ - - static va_list dst; - static va_list src; - __va_copy(dst, src) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:15849: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:15852: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15855: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:15858: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_have___va_copy=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_have___va_copy=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:15868: result: $cf_cv_have___va_copy" >&5 -echo "${ECHO_T}$cf_cv_have___va_copy" >&6 - -test "$cf_cv_have___va_copy" = yes && cat >>confdefs.h <<\EOF -#define HAVE___VA_COPY 1 -EOF - -echo "$as_me:15875: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 15881 "configure" -#include "confdefs.h" -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:15896: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:15899: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15902: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:15905: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_type_pid_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:15915: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : -else - -cat >>confdefs.h <&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 15936 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:15940: \"$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:15946: \$? = $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:15965: 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 <&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 15984 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* 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 $ac_func (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16015: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:16018: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16021: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:16024: \$? = $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:16034: 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 <&5 -echo $ECHO_N "checking for working fork... $ECHO_C" >&6 -if test "${ac_cv_func_fork_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_fork_works=cross -else - cat >conftest.$ac_ext <<_ACEOF -/* By Rüdiger Kuhlmann. */ - #include - #if HAVE_UNISTD_H - # include - #endif - /* Some systems only have a dummy stub for fork() */ - int main () - { - if (fork() < 0) - $ac_main_return (1); - $ac_main_return (0); - } -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:16069: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:16072: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:16074: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:16077: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_fork_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_fork_works=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:16089: result: $ac_cv_func_fork_works" >&5 -echo "${ECHO_T}$ac_cv_func_fork_works" >&6 - -fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { echo "$as_me:16103: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5 -echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - echo "$as_me:16108: checking for working vfork" >&5 -echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 -if test "${ac_cv_func_vfork_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_vfork_works=cross -else - cat >conftest.$ac_ext <<_ACEOF -#line 16117 "configure" -#include "confdefs.h" -/* Thanks to Paul Eggert for this test. */ -#include -#include -#include -#if HAVE_UNISTD_H -# include -#endif -#if HAVE_VFORK_H -# include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include , but some compilers - (e.g. gcc -O) don't grok . Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} - -int -main () -{ - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - $ac_main_return( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:16214: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:16217: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:16219: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:16222: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_vfork_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_vfork_works=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:16234: result: $ac_cv_func_vfork_works" >&5 -echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 - -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=ac_cv_func_vfork - { echo "$as_me:16240: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5 -echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;} -fi - -if test "x$ac_cv_func_vfork_works" = xyes; then - -cat >>confdefs.h <<\EOF -#define HAVE_WORKING_VFORK 1 -EOF - -else - -cat >>confdefs.h <<\EOF -#define vfork fork -EOF - -fi -if test "x$ac_cv_func_fork_works" = xyes; then - -cat >>confdefs.h <<\EOF -#define HAVE_WORKING_FORK 1 -EOF - -fi - # special check for test/ditto.c -echo "$as_me:16267: checking for openpty in -lutil" >&5 +echo "$as_me:14121: 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 @@ -16272,7 +14126,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 16275 "configure" +#line 14129 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -16291,16 +14145,16 @@ openpty (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16294: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14148: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16297: \$? = $ac_status" >&5 + echo "$as_me:14151: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16300: \"$ac_try\"") >&5 + { (eval echo "$as_me:14154: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16303: \$? = $ac_status" >&5 + echo "$as_me:14157: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_util_openpty=yes else @@ -16311,7 +14165,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:16314: result: $ac_cv_lib_util_openpty" >&5 +echo "$as_me:14168: 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 @@ -16319,7 +14173,7 @@ else cf_cv_lib_util=no fi -echo "$as_me:16322: checking for openpty header" >&5 +echo "$as_me:14176: 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 @@ -16330,7 +14184,7 @@ else for cf_header in pty.h libutil.h util.h do cat >conftest.$ac_ext <<_ACEOF -#line 16333 "configure" +#line 14187 "configure" #include "confdefs.h" #include <$cf_header> @@ -16347,16 +14201,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16350: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14204: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16353: \$? = $ac_status" >&5 + echo "$as_me:14207: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16356: \"$ac_try\"") >&5 + { (eval echo "$as_me:14210: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16359: \$? = $ac_status" >&5 + echo "$as_me:14213: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_openpty=$cf_header @@ -16374,7 +14228,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" fi -echo "$as_me:16377: result: $cf_cv_func_openpty" >&5 +echo "$as_me:14231: result: $cf_cv_func_openpty" >&5 echo "${ECHO_T}$cf_cv_func_openpty" >&6 if test "$cf_cv_func_openpty" != no ; then @@ -16420,13 +14274,13 @@ if test -n "$with_hashed_db/include" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; 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 16429 "configure" +#line 14283 "configure" #include "confdefs.h" #include int @@ -16438,16 +14292,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:16441: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14295: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:16444: \$? = $ac_status" >&5 + echo "$as_me:14298: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:16447: \"$ac_try\"") >&5 + { (eval echo "$as_me:14301: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16450: \$? = $ac_status" >&5 + echo "$as_me:14304: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -16464,13 +14318,13 @@ 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}:16467: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me-configure}:14321: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" + CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" - 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" + 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 @@ -16498,7 +14352,7 @@ if test -n "$with_hashed_db/lib" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me:-configure}:16501: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me-configure}:14355: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -16509,23 +14363,23 @@ fi fi esac -echo "$as_me:16512: checking for db.h" >&5 +echo "$as_me:14366: checking for db.h" >&5 echo $ECHO_N "checking for db.h... $ECHO_C" >&6 if test "${ac_cv_header_db_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 16518 "configure" +#line 14372 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:16522: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14376: \"$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:16528: \$? = $ac_status" >&5 + echo "$as_me:14382: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -16544,11 +14398,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:16547: result: $ac_cv_header_db_h" >&5 +echo "$as_me:14401: result: $ac_cv_header_db_h" >&5 echo "${ECHO_T}$ac_cv_header_db_h" >&6 if test $ac_cv_header_db_h = yes; then -echo "$as_me:16551: checking for version of db" >&5 +echo "$as_me:14405: checking for version of db" >&5 echo $ECHO_N "checking for version of db... $ECHO_C" >&6 if test "${cf_cv_hashed_db_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16559,10 +14413,10 @@ cf_cv_hashed_db_version=unknown for cf_db_version in 1 2 3 4 5 do -echo "${as_me:-configure}:16562: testing checking for db version $cf_db_version ..." 1>&5 +echo "${as_me-configure}:14416: testing checking for db version $cf_db_version ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 16565 "configure" +#line 14419 "configure" #include "confdefs.h" $ac_includes_default @@ -16592,16 +14446,16 @@ DBT *foo = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:16595: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14449: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:16598: \$? = $ac_status" >&5 + echo "$as_me:14452: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:16601: \"$ac_try\"") >&5 + { (eval echo "$as_me:14455: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16604: \$? = $ac_status" >&5 + echo "$as_me:14458: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_hashed_db_version=$cf_db_version @@ -16615,16 +14469,16 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:16618: result: $cf_cv_hashed_db_version" >&5 +echo "$as_me:14472: result: $cf_cv_hashed_db_version" >&5 echo "${ECHO_T}$cf_cv_hashed_db_version" >&6 if test "$cf_cv_hashed_db_version" = unknown ; then - { { echo "$as_me:16622: error: Cannot determine version of db" >&5 + { { echo "$as_me:14476: error: Cannot determine version of db" >&5 echo "$as_me: error: Cannot determine version of db" >&2;} { (exit 1); exit 1; }; } else -echo "$as_me:16627: checking for db libraries" >&5 +echo "$as_me:14481: checking for db libraries" >&5 echo $ECHO_N "checking for db libraries... $ECHO_C" >&6 if test "${cf_cv_hashed_db_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16638,10 +14492,10 @@ do LIBS="-l$cf_db_libs $LIBS" fi -echo "${as_me:-configure}:16641: testing checking for library "$cf_db_libs" ..." 1>&5 +echo "${as_me-configure}:14495: testing checking for library "$cf_db_libs" ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 16644 "configure" +#line 14498 "configure" #include "confdefs.h" $ac_includes_default @@ -16696,16 +14550,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16699: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14553: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16702: \$? = $ac_status" >&5 + echo "$as_me:14556: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16705: \"$ac_try\"") >&5 + { (eval echo "$as_me:14559: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16708: \$? = $ac_status" >&5 + echo "$as_me:14562: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test -n "$cf_db_libs" ; then @@ -16725,11 +14579,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi -echo "$as_me:16728: result: $cf_cv_hashed_db_libs" >&5 +echo "$as_me:14582: result: $cf_cv_hashed_db_libs" >&5 echo "${ECHO_T}$cf_cv_hashed_db_libs" >&6 if test "$cf_cv_hashed_db_libs" = unknown ; then - { { echo "$as_me:16732: error: Cannot determine library for db" >&5 + { { echo "$as_me:14586: error: Cannot determine library for db" >&5 echo "$as_me: error: Cannot determine library for db" >&2;} { (exit 1); exit 1; }; } elif test "$cf_cv_hashed_db_libs" != default ; then @@ -16739,7 +14593,7 @@ fi else - { { echo "$as_me:16742: error: Cannot find db.h" >&5 + { { echo "$as_me:14596: error: Cannot find db.h" >&5 echo "$as_me: error: Cannot find db.h" >&2;} { (exit 1); exit 1; }; } @@ -16754,7 +14608,7 @@ fi # Just in case, check if the C compiler has a bool type. -echo "$as_me:16757: checking if we should include stdbool.h" >&5 +echo "$as_me:14611: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -16762,7 +14616,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 16765 "configure" +#line 14619 "configure" #include "confdefs.h" int @@ -16774,23 +14628,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:16777: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14631: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:16780: \$? = $ac_status" >&5 + echo "$as_me:14634: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:16783: \"$ac_try\"") >&5 + { (eval echo "$as_me:14637: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16786: \$? = $ac_status" >&5 + echo "$as_me:14640: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 16793 "configure" +#line 14647 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -16806,16 +14660,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:16809: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:16812: \$? = $ac_status" >&5 + echo "$as_me:14666: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:16815: \"$ac_try\"") >&5 + { (eval echo "$as_me:14669: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16818: \$? = $ac_status" >&5 + echo "$as_me:14672: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -16829,13 +14683,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:16832: result: yes" >&5 +then echo "$as_me:14686: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:16834: result: no" >&5 +else echo "$as_me:14688: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:16838: checking for builtin bool type" >&5 +echo "$as_me:14692: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_cc_bool_type+set}" = set; then @@ -16843,7 +14697,7 @@ if test "${cf_cv_cc_bool_type+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 16846 "configure" +#line 14700 "configure" #include "confdefs.h" #include @@ -16858,16 +14712,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:16861: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14715: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:16864: \$? = $ac_status" >&5 + echo "$as_me:14718: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:16867: \"$ac_try\"") >&5 + { (eval echo "$as_me:14721: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16870: \$? = $ac_status" >&5 + echo "$as_me:14724: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cc_bool_type=1 else @@ -16880,9 +14734,9 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_cc_bool_type" = 1 -then echo "$as_me:16883: result: yes" >&5 +then echo "$as_me:14737: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:16885: result: no" >&5 +else echo "$as_me:14739: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -16904,16 +14758,16 @@ os2*) #(vi cf_stdcpp_libname=stdc++ ;; esac -echo "$as_me:16907: checking for library $cf_stdcpp_libname" >&5 +echo "$as_me:14761: checking for library $cf_stdcpp_libname" >&5 echo $ECHO_N "checking for library $cf_stdcpp_libname... $ECHO_C" >&6 if test "${cf_cv_libstdcpp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save="$LIBS" - LIBS="-l$cf_stdcpp_libname $LIBS" + LIBS="$LIBS -l$cf_stdcpp_libname" cat >conftest.$ac_ext <<_ACEOF -#line 16916 "configure" +#line 14770 "configure" #include "confdefs.h" #include @@ -16929,16 +14783,16 @@ strstreambuf foo(buf, sizeof(buf)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:16932: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14786: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:16935: \$? = $ac_status" >&5 + echo "$as_me:14789: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:16938: \"$ac_try\"") >&5 + { (eval echo "$as_me:14792: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16941: \$? = $ac_status" >&5 + echo "$as_me:14795: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_libstdcpp=yes else @@ -16950,12 +14804,12 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" fi -echo "$as_me:16953: result: $cf_cv_libstdcpp" >&5 +echo "$as_me:14807: result: $cf_cv_libstdcpp" >&5 echo "${ECHO_T}$cf_cv_libstdcpp" >&6 -test "$cf_cv_libstdcpp" = yes && CXXLIBS="-l$cf_stdcpp_libname $CXXLIBS" +test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" fi - echo "$as_me:16958: checking whether $CXX understands -c and -o together" >&5 + echo "$as_me:14812: checking whether $CXX understands -c and -o together" >&5 echo $ECHO_N "checking whether $CXX understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CXX_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -16971,29 +14825,29 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CXX -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:16974: \"$ac_try\"") >&5 +if { (eval echo "$as_me:14828: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16977: \$? = $ac_status" >&5 + echo "$as_me:14831: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:16979: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:14833: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:16982: \$? = $ac_status" >&5 + echo "$as_me:14836: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CXX_c_o=yes else eval cf_cv_prog_CXX_c_o=no fi -rm -rf conftest* +rm -f conftest* fi if test $cf_cv_prog_CXX_c_o = yes; then - echo "$as_me:16993: result: yes" >&5 + echo "$as_me:14847: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:16996: result: no" >&5 + echo "$as_me:14850: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -17013,12 +14867,12 @@ os2*) #(vi ;; esac if test "$GXX" = yes; then - echo "$as_me:17016: checking for lib$cf_gpp_libname" >&5 + echo "$as_me:14870: checking for lib$cf_gpp_libname" >&5 echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6 cf_save="$LIBS" - LIBS="-l$cf_gpp_libname $LIBS" + LIBS="$LIBS -l$cf_gpp_libname" cat >conftest.$ac_ext <<_ACEOF -#line 17021 "configure" +#line 14875 "configure" #include "confdefs.h" #include <$cf_gpp_libname/builtin.h> @@ -17032,19 +14886,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17035: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14889: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17038: \$? = $ac_status" >&5 + echo "$as_me:14892: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17041: \"$ac_try\"") >&5 + { (eval echo "$as_me:14895: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17044: \$? = $ac_status" >&5 + echo "$as_me:14898: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="-l$cf_gpp_libname $CXXLIBS" + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" if test "$cf_gpp_libname" = cpp ; then cat >>confdefs.h <<\EOF #define HAVE_GPP_BUILTIN_H 1 @@ -17060,7 +14914,7 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 17063 "configure" +#line 14917 "configure" #include "confdefs.h" #include @@ -17074,19 +14928,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:17077: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14931: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17080: \$? = $ac_status" >&5 + echo "$as_me:14934: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:17083: \"$ac_try\"") >&5 + { (eval echo "$as_me:14937: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17086: \$? = $ac_status" >&5 + echo "$as_me:14940: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="-l$cf_gpp_libname $CXXLIBS" + CXXLIBS="$CXXLIBS -l$cf_gpp_libname" cat >>confdefs.h <<\EOF #define HAVE_BUILTIN_H 1 EOF @@ -17100,7 +14954,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" - echo "$as_me:17103: result: $cf_cxx_library" >&5 + echo "$as_me:14957: result: $cf_cxx_library" >&5 echo "${ECHO_T}$cf_cxx_library" >&6 fi @@ -17116,7 +14970,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return -echo "$as_me:17119: checking how to run the C++ preprocessor" >&5 +echo "$as_me:14973: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then @@ -17133,18 +14987,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 17136 "configure" +#line 14990 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:17141: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14995: \"$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:17147: \$? = $ac_status" >&5 + echo "$as_me:15001: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -17167,17 +15021,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 17170 "configure" +#line 15024 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:17174: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:15028: \"$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:17180: \$? = $ac_status" >&5 + echo "$as_me:15034: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -17214,7 +15068,7 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:17217: result: $CXXCPP" >&5 +echo "$as_me:15071: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes @@ -17224,18 +15078,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 17227 "configure" +#line 15081 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:17232: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:15086: \"$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:17238: \$? = $ac_status" >&5 + echo "$as_me:15092: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -17258,17 +15112,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 17261 "configure" +#line 15115 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:17265: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:15119: \"$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:17271: \$? = $ac_status" >&5 + echo "$as_me:15125: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -17296,7 +15150,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:17299: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 + { { echo "$as_me:15153: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -17311,23 +15165,23 @@ ac_main_return=return for ac_header in iostream typeinfo do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:17314: checking for $ac_header" >&5 +echo "$as_me:15168: 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 17320 "configure" +#line 15174 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:17324: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:15178: \"$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:17330: \$? = $ac_status" >&5 + echo "$as_me:15184: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -17346,7 +15200,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:17349: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:15203: 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 <&5 + echo "$as_me:15214: checking if iostream uses std-namespace" >&5 echo $ECHO_N "checking if iostream uses std-namespace... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 17363 "configure" +#line 15217 "configure" #include "confdefs.h" #include @@ -17377,16 +15231,16 @@ cerr << "testing" << endl; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17380: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15234: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17383: \$? = $ac_status" >&5 + echo "$as_me:15237: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17386: \"$ac_try\"") >&5 + { (eval echo "$as_me:15240: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17389: \$? = $ac_status" >&5 + echo "$as_me:15243: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_iostream_namespace=yes else @@ -17395,7 +15249,7 @@ cat conftest.$ac_ext >&5 cf_iostream_namespace=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:17398: result: $cf_iostream_namespace" >&5 + echo "$as_me:15252: result: $cf_iostream_namespace" >&5 echo "${ECHO_T}$cf_iostream_namespace" >&6 if test "$cf_iostream_namespace" = yes ; then cat >>confdefs.h <<\EOF @@ -17405,7 +15259,7 @@ EOF fi fi -echo "$as_me:17408: checking if we should include stdbool.h" >&5 +echo "$as_me:15262: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -17413,7 +15267,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 17416 "configure" +#line 15270 "configure" #include "confdefs.h" int @@ -17425,23 +15279,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17428: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15282: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17431: \$? = $ac_status" >&5 + echo "$as_me:15285: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17434: \"$ac_try\"") >&5 + { (eval echo "$as_me:15288: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17437: \$? = $ac_status" >&5 + echo "$as_me:15291: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 17444 "configure" +#line 15298 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -17457,16 +15311,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17460: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15314: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17463: \$? = $ac_status" >&5 + echo "$as_me:15317: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17466: \"$ac_try\"") >&5 + { (eval echo "$as_me:15320: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17469: \$? = $ac_status" >&5 + echo "$as_me:15323: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -17480,13 +15334,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:17483: result: yes" >&5 +then echo "$as_me:15337: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:17485: result: no" >&5 +else echo "$as_me:15339: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:17489: checking for builtin bool type" >&5 +echo "$as_me:15343: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_builtin_bool+set}" = set; then @@ -17494,7 +15348,7 @@ if test "${cf_cv_builtin_bool+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 17497 "configure" +#line 15351 "configure" #include "confdefs.h" #include @@ -17509,16 +15363,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17512: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15366: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17515: \$? = $ac_status" >&5 + echo "$as_me:15369: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17518: \"$ac_try\"") >&5 + { (eval echo "$as_me:15372: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17521: \$? = $ac_status" >&5 + echo "$as_me:15375: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_builtin_bool=1 else @@ -17531,13 +15385,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_builtin_bool" = 1 -then echo "$as_me:17534: result: yes" >&5 +then echo "$as_me:15388: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:17536: result: no" >&5 +else echo "$as_me:15390: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:17540: checking for size of bool" >&5 +echo "$as_me:15394: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -17548,7 +15402,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 17551 "configure" +#line 15405 "configure" #include "confdefs.h" #include @@ -17590,15 +15444,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:17593: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15447: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17596: \$? = $ac_status" >&5 + echo "$as_me:15450: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17598: \"$ac_try\"") >&5 + { (eval echo "$as_me:15452: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17601: \$? = $ac_status" >&5 + echo "$as_me:15455: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -17616,18 +15470,18 @@ fi fi rm -f cf_test.out -echo "$as_me:17619: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:15473: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:17625: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:15479: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi -echo "$as_me:17630: checking for special defines needed for etip.h" >&5 +echo "$as_me:15484: checking for special defines needed for etip.h" >&5 echo $ECHO_N "checking for special defines needed for etip.h... $ECHO_C" >&6 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" @@ -17639,7 +15493,7 @@ do test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" cat >conftest.$ac_ext <<_ACEOF -#line 17642 "configure" +#line 15496 "configure" #include "confdefs.h" #include @@ -17653,16 +15507,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17656: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15510: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17659: \$? = $ac_status" >&5 + echo "$as_me:15513: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17662: \"$ac_try\"") >&5 + { (eval echo "$as_me:15516: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17665: \$? = $ac_status" >&5 + echo "$as_me:15519: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$cf_math" && cat >>confdefs.h <&5 +echo "$as_me:15540: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 CXXFLAGS="$cf_save_CXXFLAGS" if test -n "$CXX"; then -echo "$as_me:17691: checking if $CXX accepts parameter initialization" >&5 +echo "$as_me:15545: checking if $CXX accepts parameter initialization" >&5 echo $ECHO_N "checking if $CXX accepts parameter initialization... $ECHO_C" >&6 if test "${cf_cv_cpp_param_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -17705,7 +15559,7 @@ ac_main_return=return cf_cv_cpp_param_init=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 17708 "configure" +#line 15562 "configure" #include "confdefs.h" class TEST { @@ -17724,15 +15578,15 @@ void main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:17727: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15581: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17730: \$? = $ac_status" >&5 + echo "$as_me:15584: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17732: \"$ac_try\"") >&5 + { (eval echo "$as_me:15586: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17735: \$? = $ac_status" >&5 + echo "$as_me:15589: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_param_init=yes else @@ -17751,7 +15605,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:17754: result: $cf_cv_cpp_param_init" >&5 +echo "$as_me:15608: result: $cf_cv_cpp_param_init" >&5 echo "${ECHO_T}$cf_cv_cpp_param_init" >&6 fi test "$cf_cv_cpp_param_init" = yes && cat >>confdefs.h <<\EOF @@ -17760,7 +15614,7 @@ EOF if test -n "$CXX"; then -echo "$as_me:17763: checking if $CXX accepts static_cast" >&5 +echo "$as_me:15617: checking if $CXX accepts static_cast" >&5 echo $ECHO_N "checking if $CXX accepts static_cast... $ECHO_C" >&6 if test "${cf_cv_cpp_static_cast+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -17774,7 +15628,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat >conftest.$ac_ext <<_ACEOF -#line 17777 "configure" +#line 15631 "configure" #include "confdefs.h" class NCursesPanel @@ -17818,16 +15672,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:17821: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15675: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:17824: \$? = $ac_status" >&5 + echo "$as_me:15678: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:17827: \"$ac_try\"") >&5 + { (eval echo "$as_me:15681: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17830: \$? = $ac_status" >&5 + echo "$as_me:15684: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_static_cast=yes else @@ -17845,7 +15699,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:17848: result: $cf_cv_cpp_static_cast" >&5 +echo "$as_me:15702: result: $cf_cv_cpp_static_cast" >&5 echo "${ECHO_T}$cf_cv_cpp_static_cast" >&6 fi @@ -17855,12 +15709,12 @@ test "$cf_cv_cpp_static_cast" = yes && cat >>confdefs.h <<\EOF EOF CXX_AR='$(AR)' - CXX_ARFLAGS='$(ARFLAGS)' + CXX_AR_OPTS='$(AR_OPTS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_ARFLAGS='-ar -o' + CXX_AR_OPTS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -17869,7 +15723,7 @@ EOF solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_ARFLAGS='-xar -o' + CXX_AR_OPTS='-xar -o' fi ;; esac @@ -17893,7 +15747,7 @@ else else if test "$cf_cv_header_stdbool_h" = 1 ; then -echo "$as_me:17896: checking for size of bool" >&5 +echo "$as_me:15750: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -17904,7 +15758,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 17907 "configure" +#line 15761 "configure" #include "confdefs.h" #include @@ -17946,15 +15800,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:17949: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15803: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:17952: \$? = $ac_status" >&5 + echo "$as_me:15806: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:17954: \"$ac_try\"") >&5 + { (eval echo "$as_me:15808: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:17957: \$? = $ac_status" >&5 + echo "$as_me:15811: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -17972,25 +15826,25 @@ fi fi rm -f cf_test.out -echo "$as_me:17975: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:15829: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:17981: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:15835: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi else - echo "$as_me:17987: checking for fallback type of bool" >&5 + echo "$as_me:15841: checking for fallback type of bool" >&5 echo $ECHO_N "checking for fallback type of bool... $ECHO_C" >&6 case "$host_cpu" in #(vi i?86) cf_cv_type_of_bool=char ;; #(vi *) cf_cv_type_of_bool=int ;; esac - echo "$as_me:17993: result: $cf_cv_type_of_bool" >&5 + echo "$as_me:15847: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 fi fi @@ -18017,20 +15871,19 @@ fi if test -f "${srcdir}/Ada95/Makefile.in" ; then - if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - { echo "$as_me:18022: WARNING: libtool does not support Ada - disabling feature" >&5 +if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + { echo "$as_me:15876: WARNING: libtool does not support Ada - disabling feature" >&5 echo "$as_me: WARNING: libtool does not support Ada - disabling feature" >&2;} - cf_with_ada=no - fi - fi - - if test "$cf_with_ada" != "no" ; then + cf_with_ada=no + fi +fi +if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 -echo "$as_me:18033: checking for $ac_word" >&5 +echo "$as_me:15886: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -18045,7 +15898,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_gnat_exists="yes" -echo "$as_me:18048: found $ac_dir/$ac_word" >&5 +echo "$as_me:15901: found $ac_dir/$ac_word" >&5 break done @@ -18054,10 +15907,10 @@ fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$as_me:18057: result: $gnat_exists" >&5 + echo "$as_me:15910: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else - echo "$as_me:18060: result: no" >&5 + echo "$as_me:15913: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -18065,28 +15918,34 @@ if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else -echo "$as_me:18068: checking for gnat version" >&5 +echo "$as_me:15921: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 -cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ - grep '[0-9].[0-9][0-9]*' |\ - sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:18073: result: $cf_gnat_version" >&5 +cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ + sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` +echo "$as_me:15925: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 -case $cf_gnat_version in #(vi -3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi - cf_cv_prog_gnat_correct=yes - ;; -*) - { echo "$as_me:18081: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 -echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} - cf_cv_prog_gnat_correct=no - ;; +case $cf_gnat_version in + 3.1[1-9]*|3.[2-9]*|[4-9].*) + cf_cv_prog_gnat_correct=yes + ;; + *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. + cf_cv_prog_gnat_correct=no + ;; +esac +case $cf_gnat_version in + 3.[1-9]*|[4-9].*) + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" + ;; + *) cf_compile_generics= + cf_generic_objects= + ;; esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:18089: checking for $ac_word" >&5 +echo "$as_me:15948: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -18101,7 +15960,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_M4_exists="yes" -echo "$as_me:18104: found $ac_dir/$ac_word" >&5 +echo "$as_me:15963: found $ac_dir/$ac_word" >&5 break done @@ -18110,10 +15969,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:18113: result: $M4_exists" >&5 + echo "$as_me:15972: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:18116: result: no" >&5 + echo "$as_me:15975: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -18122,10 +15981,10 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:18125: checking if GNAT works" >&5 + echo "$as_me:15984: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 -rm -rf conftest* *~conftest* +rm -f conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_prog_gnat_correct=no fi -rm -rf conftest* *~conftest* +rm -f conftest* - echo "$as_me:18153: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:16012: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi +if test "$cf_cv_prog_gnat_correct" = yes; then + ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - if test "$cf_cv_prog_gnat_correct" = yes; then - - ADAFLAGS="$ADAFLAGS -gnatpn" - - # make ADAFLAGS consistent with CFLAGS - case "$CFLAGS" in - *-g*) - - ADAFLAGS="$ADAFLAGS -g" - - ;; - esac - case "$CFLAGS" in - *-O*) - - ADAFLAGS="$ADAFLAGS -O3" - - ;; - esac - -echo "$as_me:18178: checking if GNAT supports generics" >&5 -echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 -case $cf_gnat_version in #(vi -3.[1-9]*|[4-9].*) #(vi - cf_gnat_generics=yes - ;; -*) - cf_gnat_generics=no - ;; -esac -echo "$as_me:18188: result: $cf_gnat_generics" >&5 -echo "${ECHO_T}$cf_gnat_generics" >&6 - -if test "$cf_gnat_generics" = yes -then - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" -else - cf_compile_generics= - cf_generic_objects= -fi - -echo "$as_me:18200: checking if GNAT supports SIGINT" >&5 -echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 -if test "${cf_cv_gnat_sigint+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -rm -rf conftest* *~conftest* -cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then - cf_cv_gnat_sigint=yes -else - cf_cv_gnat_sigint=no -fi -rm -rf conftest* *~conftest* - -fi -echo "$as_me:18248: result: $cf_cv_gnat_sigint" >&5 -echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 - -if test $cf_cv_gnat_sigint = yes ; then - USE_GNAT_SIGINT="" -else - USE_GNAT_SIGINT="#" -fi - -echo "$as_me:18257: checking if GNAT pragma Unreferenced works" >&5 + echo "$as_me:16019: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 -if test "${cf_cv_pragma_unreferenced+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else -rm -rf conftest* *~conftest* +rm -f conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_pragma_unreferenced=no fi -rm -rf conftest* *~conftest* +rm -f conftest* -fi -echo "$as_me:18288: result: $cf_cv_pragma_unreferenced" >&5 + echo "$as_me:16046: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 -# if the pragma is supported, use it (needed in the Trace code). -if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE -else - PRAGMA_UNREF=FALSE -fi - -cf_gnat_libraries=no -cf_gnat_projects=no - -echo "$as_me:18301: checking if GNAT supports project files" >&5 -echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 -case $cf_gnat_version in #(vi -3.[0-9]*) #(vi - ;; -*) - case $cf_cv_system_name in #(vi - cygwin*) #(vi - ;; - *) - mkdir conftest.src conftest.bin conftest.lib - cd conftest.src - rm -rf conftest* *~conftest* - cat >>library.gpr <>confpackage.ads <>confpackage.adb <&5 2>&1 ) ; then - cf_gnat_projects=yes - fi - cd .. - if test -f conftest.lib/confpackage.ali - then - cf_gnat_libraries=yes - fi - rm -rf conftest* *~conftest* - ;; - esac - ;; -esac -echo "$as_me:18369: result: $cf_gnat_projects" >&5 -echo "${ECHO_T}$cf_gnat_projects" >&6 - -if test $cf_gnat_projects = yes -then - echo "$as_me:18374: checking if GNAT supports libraries" >&5 -echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 - echo "$as_me:18376: result: $cf_gnat_libraries" >&5 -echo "${ECHO_T}$cf_gnat_libraries" >&6 -fi - -if test "$cf_gnat_projects" = yes -then - USE_OLD_MAKERULES="#" - USE_GNAT_PROJECTS="" -else - USE_OLD_MAKERULES="" - USE_GNAT_PROJECTS="#" -fi - -if test "$cf_gnat_libraries" = yes -then - USE_GNAT_LIBRARIES="" -else - USE_GNAT_LIBRARIES="#" -fi - -echo "$as_me:18396: checking for ada-compiler" >&5 -echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 + # if the pragma is supported, use it (needed in the Trace code). + if test $cf_cv_pragma_unreferenced = yes ; then + PRAGMA_UNREF=TRUE + else + PRAGMA_UNREF=FALSE + fi # Check whether --with-ada-compiler or --without-ada-compiler was given. if test "${with_ada_compiler+set}" = set; then @@ -18404,21 +16061,15 @@ else cf_ada_compiler=gnatmake fi; -echo "$as_me:18407: result: $cf_ada_compiler" >&5 -echo "${ECHO_T}$cf_ada_compiler" >&6 - - cf_ada_package=terminal_interface - -echo "$as_me:18412: checking for ada-include" >&5 -echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 + cf_ada_package=terminal_interface # Check whether --with-ada-include or --without-ada-include was given. if test "${with_ada_include+set}" = set; then withval="$with_ada_include" else - withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}" -fi; if test -n "$prefix/share/ada/adainclude" ; then + withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}" +fi; if test -n "$prefix/lib/ada/adainclude" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -18445,7 +16096,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:18448: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:16099: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -18454,18 +16105,12 @@ esac fi ADA_INCLUDE="$withval" -echo "$as_me:18457: result: $ADA_INCLUDE" >&5 -echo "${ECHO_T}$ADA_INCLUDE" >&6 - -echo "$as_me:18460: checking for ada-objects" >&5 -echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 - # Check whether --with-ada-objects or --without-ada-objects was given. if test "${with_ada_objects+set}" = set; then withval="$with_ada_objects" else - withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}" + withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}" fi; if test -n "$prefix/lib/ada/adalib" ; then if test "x$prefix" != xNONE; then @@ -18493,7 +16138,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:18496: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:16141: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -18502,38 +16147,10 @@ esac fi ADA_OBJECTS="$withval" -echo "$as_me:18505: result: $ADA_OBJECTS" >&5 -echo "${ECHO_T}$ADA_OBJECTS" >&6 - -echo "$as_me:18508: checking if an Ada95 shared-library should be built" >&5 -echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 - -# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. -if test "${with_ada_sharedlib+set}" = set; then - withval="$with_ada_sharedlib" - with_ada_sharedlib=$withval -else - with_ada_sharedlib=no -fi; -echo "$as_me:18518: result: $with_ada_sharedlib" >&5 -echo "${ECHO_T}$with_ada_sharedlib" >&6 - -ADA_SHAREDLIB='lib$(LIB_NAME).so.1' -MAKE_ADA_SHAREDLIB="#" - -if test "x$with_ada_sharedlib" != xno -then - MAKE_ADA_SHAREDLIB= - if test "x$with_ada_sharedlib" != xyes - then - ADA_SHAREDLIB="$with_ada_sharedlib" - fi fi - - fi - fi +fi else - cf_with_ada=no + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -18546,7 +16163,7 @@ fi ### chooses to split module lists into libraries. ### ### (see CF_LIB_RULES). -echo "$as_me:18549: checking for library subsets" >&5 +echo "$as_me:16166: checking for library subsets" >&5 echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 LIB_SUBSETS= @@ -18561,7 +16178,6 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" - if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -18569,32 +16185,17 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" - -# Most term-driver calls are to tinfo, but some like init_pair are to the -# base library (so it resides in base). -if test "$with_term_driver" != no ; then - LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" - case $cf_cv_system_name in #(vi - *mingw32*) #(vi - LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" - ;; - *) #(vi - LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" - ;; - esac -fi - test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" -echo "$as_me:18590: result: $LIB_SUBSETS" >&5 +echo "$as_me:16191: result: $LIB_SUBSETS" >&5 echo "${ECHO_T}$LIB_SUBSETS" >&6 ### Construct the list of include-directories to be generated -CPPFLAGS="$CPPFLAGS -I. -I../include" +CPPFLAGS="-I. -I../include $CPPFLAGS" if test "$srcdir" != "."; then - CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" + CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -18608,7 +16209,7 @@ elif test "$includedir" != "/usr/include"; then fi fi -ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -18625,7 +16226,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:18628: checking default library suffix" >&5 +echo "$as_me:16229: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -18636,50 +16237,46 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:18639: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:16240: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:18642: checking default library-dependency suffix" >&5 +echo "$as_me:16243: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 - case $DFT_LWR_MODEL in #(vi - libtool) #(vi + case $DFT_LWR_MODEL in + libtool) DFT_LIB_SUFFIX='.la' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - normal) #(vi + normal) DFT_LIB_SUFFIX='.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - debug) #(vi + debug) DFT_LIB_SUFFIX='_g.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - profile) #(vi + profile) DFT_LIB_SUFFIX='_p.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - shared) #(vi + shared) case $cf_cv_system_name in - aix[56]*) #(vi - DFT_LIB_SUFFIX='.a' - DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX - ;; - cygwin*) #(vi + cygwin*) DFT_LIB_SUFFIX='.dll' DFT_DEP_SUFFIX='.dll.a' ;; - darwin*) #(vi + darwin*) DFT_LIB_SUFFIX='.dylib' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - hpux*) #(vi + hpux*) case $target in - ia64*) #(vi + ia64*) DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - *) #(vi + *) DFT_LIB_SUFFIX='.sl' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; @@ -18692,10 +16289,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:18695: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:16292: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:18698: checking default object directory" >&5 +echo "$as_me:16295: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -18711,55 +16308,51 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:18714: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:16311: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 # libtool thinks it can make c++ shared libraries (perhaps only g++) if test "$cf_with_cxx" = yes ; then -echo "$as_me:18719: checking c++ library-dependency suffix" >&5 +echo "$as_me:16316: checking c++ library-dependency suffix" >&5 echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 if test "$with_libtool" != "no"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else - case normal in #(vi - libtool) #(vi + case normal in + libtool) CXX_LIB_SUFFIX='.la' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - normal) #(vi + normal) CXX_LIB_SUFFIX='.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - debug) #(vi + debug) CXX_LIB_SUFFIX='_g.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - profile) #(vi + profile) CXX_LIB_SUFFIX='_p.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - shared) #(vi + shared) case $cf_cv_system_name in - aix[56]*) #(vi - CXX_LIB_SUFFIX='.a' - CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX - ;; - cygwin*) #(vi + cygwin*) CXX_LIB_SUFFIX='.dll' CXX_DEP_SUFFIX='.dll.a' ;; - darwin*) #(vi + darwin*) CXX_LIB_SUFFIX='.dylib' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - hpux*) #(vi + hpux*) case $target in - ia64*) #(vi + ia64*) CXX_LIB_SUFFIX='.so' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - *) #(vi + *) CXX_LIB_SUFFIX='.sl' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; @@ -18773,7 +16366,7 @@ else test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && CXX_DEP_SUFFIX="${LIB_SUFFIX}${CXX_DEP_SUFFIX}" fi -echo "$as_me:18776: result: $CXX_LIB_SUFFIX" >&5 +echo "$as_me:16369: result: $CXX_LIB_SUFFIX" >&5 echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 fi @@ -18838,8 +16431,6 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" - TICS_LIST="$SHLIB_LIST $TEST_ARGS" - SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -18889,7 +16480,7 @@ normal|debug|profile) if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[4]*|solaris2.1[0-9]|darwin*) #( vi + OS/2*|os2*|aix[45]*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -18900,7 +16491,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[456]*) #( from ld manpage + aix[45]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -18925,93 +16516,15 @@ else esac fi -if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" -then - echo "$as_me:18930: checking if linker supports switching between static/dynamic" >&5 -echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6 - - rm -f libconftest.a - cat >conftest.$ac_ext < -int cf_ldflags_static(FILE *fp) { return fflush(fp); } -EOF - if { (eval echo "$as_me:18939: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:18942: \$? = $ac_status" >&5 - (exit $ac_status); } ; then - ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null - ( eval $RANLIB libconftest.a ) 2>&5 >/dev/null - fi - rm -f conftest.* - - cf_save_LIBS="$LIBS" - - LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line 18953 "configure" -#include "confdefs.h" - -#line 18956 "configure" -#include -int cf_ldflags_static(FILE *fp); - -int -main () -{ - - return cf_ldflags_static(stdin); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:18971: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:18974: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:18977: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:18980: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_ldflags_static=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_ldflags_static=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - - rm -f libconftest.* - LIBS="$cf_save_LIBS" - - echo "$as_me:18993: result: $cf_ldflags_static" >&5 -echo "${ECHO_T}$cf_ldflags_static" >&6 - - if test $cf_ldflags_static != yes - then - LDFLAGS_STATIC= - LDFLAGS_SHARED= - fi -else - LDFLAGS_STATIC= - LDFLAGS_SHARED= -fi - ;; esac -echo "$as_me:19009: checking where we will install curses.h" >&5 +echo "$as_me:16522: checking where we will install curses.h" >&5 echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='${prefix}/include/ncurses'${LIB_SUFFIX} -echo "$as_me:19014: result: $includedir" >&5 +echo "$as_me:16527: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 ### Resolve a conflict between normal and wide-curses by forcing applications @@ -19019,11 +16532,10 @@ echo "${ECHO_T}$includedir" >&6 if test "$with_overwrite" != no ; then if test "$NCURSES_LIBUTF8" = 1 ; then NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' - { echo "$as_me:19022: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 + { echo "$as_me:16535: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} fi fi -WITH_OVERWRITE=$with_overwrite # used to separate tack out of the tree NCURSES_TREE= @@ -19036,7 +16548,7 @@ EOF ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. -echo "$as_me:19039: checking for src modules" >&5 +echo "$as_me:16551: checking for src modules" >&5 echo $ECHO_N "checking for src modules... $ECHO_C" >&6 # dependencies and linker-arguments for test-programs @@ -19099,34 +16611,25 @@ EOF fi fi done -echo "$as_me:19102: result: $cf_cv_src_modules" >&5 +echo "$as_me:16614: result: $cf_cv_src_modules" >&5 echo "${ECHO_T}$cf_cv_src_modules" >&6 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" TEST_ARG2="-L${LIB_2ND} $TEST_ARG2" -SRC_SUBDIRS= -if test "x$cf_with_manpages" != xno ; then - SRC_SUBDIRS="$SRC_SUBDIRS man" -fi -SRC_SUBDIRS="$SRC_SUBDIRS include" +SRC_SUBDIRS="man include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -if test "x$cf_with_tests" != "xno" ; then - SRC_SUBDIRS="$SRC_SUBDIRS test" -fi +SRC_SUBDIRS="$SRC_SUBDIRS test" test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src" - if test "x$cf_with_tests" != "xno" ; then - ADA_SUBDIRS="$ADA_SUBDIRS samples" - fi + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src samples" fi SUB_MAKEFILES= @@ -19136,16 +16639,15 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done fi if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" - SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" fi DIRS_TO_MAKE="lib" @@ -19177,12 +16679,8 @@ do test ! -d $cf_dir && mkdir $cf_dir done -# symbols that differ when compiling Ada95 by itself. -NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' - -# values to use as strings cat >>confdefs.h <>confdefs.h <&5 +echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 +if test -n "$LDFLAGS" ; then +echo "$as_me:16766: result: maybe" >&5 +echo "${ECHO_T}maybe" >&6 +test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me-configure}:16770: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me-configure}:16774: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +case "$EXTRA_LDFLAGS" in #(vi +-Wl,-rpath,*) #(vi + cf_rpath_hack="-Wl,-rpath," + ;; +-R\ *) + cf_rpath_hack="-R " + ;; +-R*) + cf_rpath_hack="-R" + ;; +*) + cf_rpath_hack= + ;; +esac +if test -n "$cf_rpath_hack" ; then + cf_rpath_dst= + for cf_rpath_src in $LDFLAGS + do + test -n "$verbose" && echo " Filtering $cf_rpath_src" 1>&6 + +echo "${as_me-configure}:16796: testing Filtering $cf_rpath_src ..." 1>&5 + + case $cf_rpath_src in #(vi + -L*) #(vi + if test "$cf_rpath_hack" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` + fi + test -n "$verbose" && echo " ...Filter $cf_rpath_tmp" 1>&6 + +echo "${as_me-configure}:16807: testing ...Filter $cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" + done + LDFLAGS=$cf_rpath_dst + test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me-configure}:16817: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 + + test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me-configure}:16821: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +fi +else +echo "$as_me:16825: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi + ### Define substitutions for header files to avoid name-pollution if test "$cf_cv_have_tcgetattr" = yes ; then @@ -19290,82 +16849,9 @@ else fi ################################################################################ -test "$use_database" = yes && \ -SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" - +test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" -SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" - -if test x"$enable_pc_files" = xyes ; then \ -SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" -MAKE_PC_FILES= -else -MAKE_PC_FILES="#" -fi - -# Extract the first word of "tic", so it can be a program name with args. -set dummy tic; ac_word=$2 -echo "$as_me:19308: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_TIC_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $TIC_PATH in - [\\/]* | ?:[\\/]*) - ac_cv_path_TIC_PATH="$TIC_PATH" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH:/usr/local/ncurses/bin" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - if $as_executable_p "$ac_dir/$ac_word"; then - ac_cv_path_TIC_PATH="$ac_dir/$ac_word" - echo "$as_me:19325: found $ac_dir/$ac_word" >&5 - break -fi -done - - test -z "$ac_cv_path_TIC_PATH" && ac_cv_path_TIC_PATH="unknown" - ;; -esac -fi -TIC_PATH=$ac_cv_path_TIC_PATH - -if test -n "$TIC_PATH"; then - echo "$as_me:19337: result: $TIC_PATH" >&5 -echo "${ECHO_T}$TIC_PATH" >&6 -else - echo "$as_me:19340: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -if test -n "$FALLBACK_LIST" -then - if test "$TIC_PATH" = unknown - then - { echo "$as_me:19348: WARNING: no tic program found for fallbacks" >&5 -echo "$as_me: WARNING: no tic program found for fallbacks" >&2;} - fi -fi - -if test "x$cf_with_tests" != xno ; then - MAKE_TESTS= -else - MAKE_TESTS="#" -fi - -ADAHTML_DIR=../../doc/html/ada - -SUB_SCRIPTS= -case $cf_cv_system_name in #(vi -*mingw32*) #(vi - SUB_SCRIPTS="mk-dlls.sh" - ;; -esac - -ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_SCRIPTS $SUB_MAKEFILES Makefile" +ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -19446,7 +16932,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:19449: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:16935: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -19572,13 +17058,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:19625: error: ambiguous option: $1 + { { echo "$as_me:17111: 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;} @@ -19641,7 +17127,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:19644: error: unrecognized option: $1 + -*) { { echo "$as_me:17130: 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;} @@ -19660,7 +17146,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20101002, executed with +This file was extended by $as_me 2.52.20080325, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -19684,12 +17170,10 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" -LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" -LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -19697,15 +17181,13 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" -TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -USE_OLD_MAKERULES="$USE_OLD_MAKERULES" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -19723,10 +17205,7 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" -cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" -cf_with_manpages="$cf_with_manpages" -cf_with_tests="$cf_with_tests" host="$host" target="$target" @@ -19739,15 +17218,13 @@ do # Handling of arguments. "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; - "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; - "$SUB_SCRIPTS" ) CONFIG_FILES="$CONFIG_FILES $SUB_SCRIPTS" ;; "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:19750: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:17227: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -19872,12 +17349,7 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@LN_S@,$LN_S,;t t -s,@PKG_CONFIG@,$PKG_CONFIG,;t t -s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t -s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t s,@SET_MAKE@,$SET_MAKE,;t t -s,@CTAGS@,$CTAGS,;t t -s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t @@ -19887,7 +17359,7 @@ s,@LD@,$LD,;t t s,@ac_ct_LD@,$ac_ct_LD,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@ARFLAGS@,$ARFLAGS,;t t +s,@AR_OPTS@,$AR_OPTS,;t t s,@DESTDIR@,$DESTDIR,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@BUILD_CPP@,$BUILD_CPP,;t t @@ -19898,9 +17370,7 @@ s,@BUILD_LIBS@,$BUILD_LIBS,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t s,@cf_list_models@,$cf_list_models,;t t -s,@LIBTOOL_VERSION@,$LIBTOOL_VERSION,;t t s,@LIBTOOL@,$LIBTOOL,;t t -s,@LT_UNDEF@,$LT_UNDEF,;t t s,@LIBTOOL_CXX@,$LIBTOOL_CXX,;t t s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t s,@LIB_CREATE@,$LIB_CREATE,;t t @@ -19922,7 +17392,6 @@ s,@CC_G_OPT@,$CC_G_OPT,;t t s,@CXX_G_OPT@,$CXX_G_OPT,;t t s,@LD_MODEL@,$LD_MODEL,;t t s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t -s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t s,@LINK_PROGS@,$LINK_PROGS,;t t @@ -19931,8 +17400,8 @@ s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t s,@INSTALL_LIB@,$INSTALL_LIB,;t t -s,@cf_ldd_prog@,$cf_ldd_prog,;t t s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t +s,@PATHSEP@,$PATHSEP,;t t s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t s,@WHICH_XTERM@,$WHICH_XTERM,;t t s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t @@ -19954,26 +17423,19 @@ s,@NCURSES_TPARM_VARARGS@,$NCURSES_TPARM_VARARGS,;t t s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t -s,@NCURSES_CCHARW_MAX@,$NCURSES_CCHARW_MAX,;t t s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t -s,@GENERATED_EXT_FUNCS@,$GENERATED_EXT_FUNCS,;t t -s,@NCURSES_SP_FUNCS@,$NCURSES_SP_FUNCS,;t t -s,@GENERATED_SP_FUNCS@,$GENERATED_SP_FUNCS,;t t s,@NCURSES_CONST@,$NCURSES_CONST,;t t s,@NCURSES_EXT_COLORS@,$NCURSES_EXT_COLORS,;t t s,@NCURSES_MOUSE_VERSION@,$NCURSES_MOUSE_VERSION,;t t s,@NCURSES_SBOOL@,$NCURSES_SBOOL,;t t s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t -s,@NCURSES_INTEROP_FUNCS@,$NCURSES_INTEROP_FUNCS,;t t s,@PTHREAD@,$PTHREAD,;t t s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t s,@cf_cv_enable_opaque@,$cf_cv_enable_opaque,;t t s,@NCURSES_OPAQUE@,$NCURSES_OPAQUE,;t t s,@NCURSES_SIZE_T@,$NCURSES_SIZE_T,;t t -s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t s,@ECHO_LINK@,$ECHO_LINK,;t t -s,@ADAFLAGS@,$ADAFLAGS,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@EXTRA_CXXFLAGS@,$EXTRA_CXXFLAGS,;t t s,@ADA_TRACE@,$ADA_TRACE,;t t @@ -19984,29 +17446,23 @@ s,@cf_cv_1UL@,$cf_cv_1UL,;t t s,@cf_cv_typeof_mmask_t@,$cf_cv_typeof_mmask_t,;t t s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;t t s,@TEST_LIBS@,$TEST_LIBS,;t t -s,@TEST_LIBS2@,$TEST_LIBS2,;t t s,@CXXCPP@,$CXXCPP,;t t s,@CXXLDFLAGS@,$CXXLDFLAGS,;t t s,@CXX_AR@,$CXX_AR,;t t -s,@CXX_ARFLAGS@,$CXX_ARFLAGS,;t t +s,@CXX_AR_OPTS@,$CXX_AR_OPTS,;t t s,@CXXLIBS@,$CXXLIBS,;t t s,@USE_CXX_BOOL@,$USE_CXX_BOOL,;t t s,@gnat_exists@,$gnat_exists,;t t s,@M4_exists@,$M4_exists,;t t s,@cf_ada_make@,$cf_ada_make,;t t -s,@cf_compile_generics@,$cf_compile_generics,;t t -s,@cf_generic_objects@,$cf_generic_objects,;t t -s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t -s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t -s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t -s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t -s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t s,@cf_ada_compiler@,$cf_ada_compiler,;t t s,@cf_ada_package@,$cf_ada_package,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t +s,@cf_compile_generics@,$cf_compile_generics,;t t +s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t -s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t -s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t s,@ACPPFLAGS@,$ACPPFLAGS,;t t s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t @@ -20034,15 +17490,9 @@ s,@TEST_ARG2@,$TEST_ARG2,;t t s,@TEST_DEP2@,$TEST_DEP2,;t t s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;t t -s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t s,@HAVE_TCGETATTR@,$HAVE_TCGETATTR,;t t s,@HAVE_TERMIO_H@,$HAVE_TERMIO_H,;t t s,@HAVE_TERMIOS_H@,$HAVE_TERMIOS_H,;t t -s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t -s,@cross_compiling@,$cross_compiling,;t t -s,@TIC_PATH@,$TIC_PATH,;t t -s,@MAKE_TESTS@,$MAKE_TESTS,;t t -s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t CEOF EOF @@ -20157,7 +17607,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:20160: creating $ac_file" >&5 + { echo "$as_me:17610: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -20175,7 +17625,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:20178: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:17628: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -20188,7 +17638,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:20191: error: cannot find input file: $f" >&5 + { { echo "$as_me:17641: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -20254,7 +17704,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:20257: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:17707: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -20265,7 +17715,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:20268: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:17718: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -20278,7 +17728,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:20281: error: cannot find input file: $f" >&5 + { { echo "$as_me:17731: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -20336,7 +17786,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:20339: $ac_file is unchanged" >&5 + { echo "$as_me:17789: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -20378,6 +17828,7 @@ done; } done EOF cat >>$CONFIG_STATUS <<\EOF + # # CONFIG_COMMANDS section. # @@ -20387,19 +17838,16 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue case $ac_dest in default ) -if test "x$cf_with_tests" != xno ; then for cf_dir in test do if test ! -d $srcdir/$cf_dir; then continue elif test -f $srcdir/$cf_dir/programs; then - $AWK -f $srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile + $AWK -f $srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile fi done -fi - case $cf_cv_system_name in #(vi OS/2*|os2*) #(vi LIB_PREFIX='' @@ -20414,23 +17862,6 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi -if test -n "$TINFO_SUFFIX" ; then - case $TINFO_SUFFIX in - tw*) - TINFO_NAME="${TINFO_NAME}tw" - TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` - ;; - t*) - TINFO_NAME="${TINFO_NAME}t" - TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` - ;; - w*) - TINFO_NAME="${TINFO_NAME}w" - TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` - ;; - esac -fi - for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -20442,44 +17873,40 @@ do for cf_item in $cf_LIST_MODELS do - case $cf_item in #(vi - libtool) #(vi + case $cf_item in + libtool) cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) #(vi + normal) cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) #(vi + debug) cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) #(vi + profile) cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) #(vi + shared) case $cf_cv_system_name in - aix[56]*) #(vi - cf_suffix='.a' - cf_depsuf=$cf_suffix - ;; - cygwin*) #(vi + cygwin*) cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) #(vi + darwin*) cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) #(vi + hpux*) case $target in - ia64*) #(vi + ia64*) cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) #(vi + *) cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -20500,14 +17927,6 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in - .tw*) - cf_suffix=`echo $cf_suffix | sed 's/^tw//'` - cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" - ;; - .t*) - cf_suffix=`echo $cf_suffix | sed 's/^t//'` - cf_suffix=t'.${REL_VERSION}'"$cf_suffix" - ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -20524,14 +17943,6 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in - .tw*) - cf_suffix=`echo $cf_suffix | sed 's/^tw//'` - cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" - ;; - .t*) - cf_suffix=`echo $cf_suffix | sed 's/^t//'` - cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" - ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -20609,44 +18020,40 @@ do cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - case $cf_item in #(vi - libtool) #(vi + case $cf_item in + libtool) cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) #(vi + normal) cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) #(vi + debug) cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) #(vi + profile) cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) #(vi + shared) case $cf_cv_system_name in - aix[56]*) #(vi - cf_suffix='.a' - cf_depsuf=$cf_suffix - ;; - cygwin*) #(vi + cygwin*) cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) #(vi + darwin*) cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) #(vi + hpux*) case $target in - ia64*) #(vi + ia64*) cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) #(vi + *) cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -20716,16 +18123,6 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in - tw*) - cf_libname=`echo $cf_libname | sed 's/tw$//'` - cf_suffix=`echo $cf_suffix | sed 's/^tw//'` - cf_dir_suffix=tw - ;; - t*) - cf_libname=`echo $cf_libname | sed 's/t$//'` - cf_suffix=`echo $cf_suffix | sed 's/^t//'` - cf_dir_suffix=t - ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -20743,19 +18140,17 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ - SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink:-no} \ + ReLink=${cf_cv_do_relink-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ - libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -20839,28 +18234,18 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile <>Ada95/src/Makefile -fi -fi ;; esac done @@ -21013,4 +18392,4 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -${MAKE:-make} preinstall +${MAKE-make} preinstall diff --git a/configure.in b/configure.in index d5bc841e9b0..2b4422a439d 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2007,2008 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 * @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.520 2011/03/28 00:22:26 tom Exp $ +dnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.520 $) +AC_REVISION($Revision: 1.454 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -122,13 +122,6 @@ AC_ARG_WITH(ada, [cf_with_ada=yes]) AC_MSG_RESULT($cf_with_ada) -AC_MSG_CHECKING(if you want to install manpages) -AC_ARG_WITH(manpages, - [ --without-manpages suppress install of manpages], - [cf_with_manpages=$withval], - [cf_with_manpages=yes]) -AC_MSG_RESULT($cf_with_manpages) - AC_MSG_CHECKING(if you want to build programs such as tic) AC_ARG_WITH(progs, [ --without-progs suppress build with programs (e.g., tic)], @@ -136,13 +129,6 @@ AC_ARG_WITH(progs, [cf_with_progs=yes]) AC_MSG_RESULT($cf_with_progs) -AC_MSG_CHECKING(if you want to build test-programs) -AC_ARG_WITH(tests, - [ --without-tests suppress build with test-programs], - [cf_with_tests=$withval], - [cf_with_tests=yes]) -AC_MSG_RESULT($cf_with_tests) - AC_MSG_CHECKING(if you wish to install curses.h) AC_ARG_WITH(curses-h, [ --without-curses-h install curses.h as ncurses.h only], @@ -162,35 +148,10 @@ CF_PROG_AWK CF_PROG_EGREP CF_PROG_INSTALL CF_PROG_LINT -CF_PROG_LN_S +AC_PROG_LN_S AC_SYS_LONG_FILE_NAMES -# if we find pkg-config, check if we should install the ".pc" files. -CF_PKG_CONFIG - -if test "$PKG_CONFIG" != no ; then - AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) - - # Leave this as something that can be overridden in the environment. - if test -z "$PKG_CONFIG_LIBDIR" ; then - PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig - fi - PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` - if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then - AC_ARG_ENABLE(pc-files, - [ --enable-pc-files generate and install .pc files for pkg-config], - [enable_pc_files=$enableval], - [enable_pc_files=no]) - AC_MSG_RESULT($enable_pc_files) - else - AC_MSG_RESULT(no) - AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR) - enable_pc_files=no - fi -fi -AC_SUBST(PKG_CONFIG_LIBDIR) - AC_MSG_CHECKING(if we should assume mixed-case filenames) AC_ARG_ENABLE(mixed-case, [ --enable-mixed-case tic should assume mixed-case filenames], @@ -215,7 +176,7 @@ dnl These are standard among *NIX systems, but not when cross-compiling AC_CHECK_TOOL(RANLIB, ranlib, ':') AC_CHECK_TOOL(LD, ld, ld) AC_CHECK_TOOL(AR, ar, ar) -CF_AR_FLAGS +CF_SUBST(archiver options,AR_OPTS,rv) dnl Special option for use by system-builders: the install-prefix is used to dnl adjust the location into which the actual install is done, so that an @@ -366,7 +327,6 @@ if test "$with_gpm" != no ; then SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" - CF_ADD_LIB(gpm,TEST_LIBS) fi AC_DEFINE(HAVE_LIBGPM) CF_CHECK_GPM_WGETCH @@ -420,11 +380,6 @@ if test "$CC_SHARED_OPTS" = "unknown"; then done fi -### If we're building with rpath, try to link non-standard libs that way too. -if test "$DFT_LWR_MODEL" = "shared"; then - CF_DISABLE_RPATH_HACK -fi - ############################################################################### CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) @@ -458,7 +413,7 @@ if test "$use_database" != no ; then AC_DEFINE(USE_DATABASE) AC_MSG_CHECKING(which terminfo source-file will be installed) - AC_ARG_WITH(database, + AC_ARG_ENABLE(database, [ --with-database=XXX specify terminfo source to install], [TERMINFO_SRC=$withval]) AC_MSG_RESULT($TERMINFO_SRC) @@ -663,7 +618,7 @@ AC_MSG_CHECKING(if you want broken-linker support code) AC_ARG_ENABLE(broken_linker, [ --enable-broken_linker compile with broken-linker support code], [with_broken_linker=$enableval], - [with_broken_linker=${BROKEN_LINKER:-no}]) + [with_broken_linker=${BROKEN_LINKER-no}]) AC_MSG_RESULT($with_broken_linker) BROKEN_LINKER=0 @@ -700,7 +655,7 @@ NCURSES_WCHAR_T=0 NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -CF_XOPEN_SOURCE(500) +CF_XOPEN_SOURCE # Work around breakage on OS X CF_SIGWINCH @@ -721,15 +676,7 @@ AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" AC_DEFINE(USE_WIDEC_SUPPORT) - - case "$CFLAGS $CPPFLAGS" in #(vi - *-D_XOPEN_SOURCE=500) #(vi - ;; - *) - CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) - ;; - esac - + CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) # with_overwrite=no NCURSES_CH_T=cchar_t AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs) @@ -850,15 +797,6 @@ AC_ARG_WITH(mmask-t, [NCURSES_MMASK_T=auto]) AC_MSG_RESULT($NCURSES_MMASK_T) -### use option --with-ccharw-max to override CCHARW_MAX size -AC_MSG_CHECKING(for size CCHARW_MAX) -AC_ARG_WITH(ccharw-max, - [ --with-ccharw-max=XXX override size CCHARW_MAX], - [NCURSES_CCHARW_MAX="$withval"], - [NCURSES_CCHARW_MAX=5]) -AC_MSG_RESULT($NCURSES_CCHARW_MAX) -AC_SUBST(NCURSES_CCHARW_MAX) - ### Enable compiling-in rcs id's AC_MSG_CHECKING(if RCS identifiers should be compiled-in) AC_ARG_WITH(rcs-ids, @@ -869,7 +807,7 @@ AC_MSG_RESULT($with_rcs_ids) test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) ############################################################################### -CF_MAN_PAGES([ captoinfo clear infocmp infotocap tabs tic toe tput tset ]) +CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) ############################################################################### CF_HELP_MESSAGE(Extensions:) @@ -887,47 +825,13 @@ if test "$with_ext_funcs" = yes ; then AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_RESIZE_TERM) - AC_DEFINE(HAVE_TERM_ENTRY_H) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) AC_DEFINE(HAVE_WRESIZE) AC_DEFINE(NCURSES_EXT_FUNCS) - GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 - GENERATED_EXT_FUNCS= fi AC_SUBST(NCURSES_EXT_FUNCS) -AC_SUBST(GENERATED_EXT_FUNCS) - -AC_MSG_CHECKING(if you want to build with experimental SCREEN extensions) -AC_ARG_ENABLE(sp-funcs, - [ --enable-sp-funcs enable experimental SCREEN-extensions], - [with_sp_funcs=$enableval], - [with_sp_funcs=no]) -AC_MSG_RESULT($with_sp_funcs) -if test "$with_sp_funcs" = yes ; then - NCURSES_SP_FUNCS=1 - AC_DEFINE(NCURSES_SP_FUNCS) - GENERATED_SP_FUNCS=generated -else - NCURSES_SP_FUNCS=0 - GENERATED_SP_FUNCS= -fi -AC_SUBST(NCURSES_SP_FUNCS) -AC_SUBST(GENERATED_SP_FUNCS) - -AC_MSG_CHECKING(if you want to build with experimental terminal-driver) -AC_ARG_ENABLE(term-driver, - [ --enable-term-driver enable experimental terminal-driver], - [with_term_driver=$enableval], - [with_term_driver=no]) -AC_MSG_RESULT($with_term_driver) -if test "$with_term_driver" = yes ; then - AC_DEFINE(USE_TERM_DRIVER) - if test "$with_sp_funcs" != yes ; then - AC_MSG_ERROR(The term-driver option relies upon sp-funcs) - fi -fi ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) @@ -1069,55 +973,30 @@ test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment AC_MSG_CHECKING(if you want colorfgbg code) AC_ARG_ENABLE(colorfgbg, - [ --enable-colorfgbg compile-in experimental $COLORFGBG code], + [ --enable-colorfgbg compile with $COLORFGBG code], [with_colorfgbg=$enableval], [with_colorfgbg=no]) AC_MSG_RESULT($with_colorfgbg) test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) -### use option --enable-interop to turn on use of bindings used for interop -AC_MSG_CHECKING(if you want interop bindings) -AC_ARG_ENABLE(interop, - [ --enable-interop compile-in experimental interop bindings], - [with_exp_interop=$enableval], - [with_exp_interop=no]) -AC_MSG_RESULT($with_exp_interop) - -NCURSES_INTEROP_FUNCS=0 -test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 -AC_SUBST(NCURSES_INTEROP_FUNCS) - # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. CF_WITH_PTHREAD -if test "x$with_pthread" != xno; then - AC_CHECK_FUNC(pthread_kill,[ - AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads) - AC_ARG_ENABLE(pthreads-eintr, - [ --enable-pthreads-eintr enable EINTR in wgetch with pthreads], - [use_pthreads_eintr=$enableval], - [use_pthreads_eintr=no]) - AC_MSG_RESULT($use_pthreads_eintr) - if test $use_pthreads_eintr = yes ; then - AC_DEFINE(USE_PTHREADS_EINTR) - fi]) +AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) +AC_ARG_ENABLE(weak-symbols, + [ --enable-weak-symbols enable weak-symbols for pthreads], + [use_weak_symbols=$withval], + [use_weak_symbols=no]) +AC_MSG_RESULT($use_weak_symbols) +if test "$use_weak_symbols" = yes ; then + CF_WEAK_SYMBOLS +else + cf_cv_weak_symbols=no +fi - AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) - AC_ARG_ENABLE(weak-symbols, - [ --enable-weak-symbols enable weak-symbols for pthreads], - [use_weak_symbols=$enableval], - [use_weak_symbols=no]) - AC_MSG_RESULT($use_weak_symbols) - if test "$use_weak_symbols" = yes ; then - CF_WEAK_SYMBOLS - else - cf_cv_weak_symbols=no - fi - - if test $cf_cv_weak_symbols = yes ; then - AC_DEFINE(USE_WEAK_SYMBOLS) - fi +if test $cf_cv_weak_symbols = yes ; then + AC_DEFINE(USE_WEAK_SYMBOLS) fi PTHREAD= @@ -1145,13 +1024,11 @@ if test "$with_reentrant" = yes ; then cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then - CF_REMOVE_LIB(LIBS,$LIBS,pthread) - CF_ADD_LIB(pthread,TEST_LIBS) - CF_ADD_LIB(pthread,TEST_LIBS2) - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + if test $cf_cv_weak_symbols = yes ; then + CF_REMOVE_LIB(LIBS,$LIBS,pthread) + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi AC_DEFINE(USE_REENTRANT) CF_NCURSES_ABI_6 else @@ -1165,20 +1042,6 @@ AC_SUBST(cf_cv_enable_opaque) AC_SUBST(NCURSES_OPAQUE) AC_SUBST(NCURSES_SIZE_T) -### Allow using a different wrap-prefix -if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then - AC_MSG_CHECKING(for prefix used to wrap public variables) - AC_ARG_WITH(wrap-prefix, - [ --with-wrap-prefix=XXX override prefix used for public variables], - [NCURSES_WRAP_PREFIX=$withval], - [NCURSES_WRAP_PREFIX=_nc_]) - AC_MSG_RESULT($NCURSES_WRAP_PREFIX) -else - NCURSES_WRAP_PREFIX=_nc_ -fi -AC_SUBST(NCURSES_WRAP_PREFIX) -AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX") - AC_MSG_CHECKING(if you want experimental safe-sprintf code) AC_ARG_ENABLE(safe-sprintf, [ --enable-safe-sprintf compile with experimental safe-sprintf code], @@ -1234,7 +1097,7 @@ AC_ARG_ENABLE(warnings, AC_MSG_RESULT($with_warnings) if test "x$with_warnings" = "xyes"; then - CF_ADD_ADAFLAGS(-gnatg) + ADAFLAGS="$ADAFLAGS -gnatg" CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) if test "$cf_with_cxx" = yes ; then CF_GXX_WARNINGS(Wno-unused) @@ -1256,7 +1119,7 @@ then AC_DEFINE(NDEBUG) CPPFLAGS="$CPPFLAGS -DNDEBUG" else - CF_ADD_ADAFLAGS(-gnata) + ADAFLAGS="$ADAFLAGS -gnata" fi fi @@ -1302,18 +1165,12 @@ fi AC_SUBST(ADA_TRACE) ### Checks for libraries. -case $cf_cv_system_name in #(vi -*mingw32*) #(vi - ;; -*) AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY),[ AC_CHECK_LIB(bsd, gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY) - CF_ADD_LIB(bsd))])dnl CLIX: bzero, select, gettimeofday - ;; -esac + LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday CF_MATH_LIB(MATH_LIB,sin(x)) AC_SUBST(MATH_LIB) @@ -1330,7 +1187,6 @@ fcntl.h \ getopt.h \ limits.h \ locale.h \ -math.h \ poll.h \ sys/bsdtypes.h \ sys/ioctl.h \ @@ -1348,7 +1204,7 @@ wctype.h \ # Note: even non-Posix ISC needs to declare fd_set if test "$ISC" = yes ; then AC_CHECK_LIB(cposix,main) - AC_CHECK_LIB(inet,bzero,CF_ADD_LIB(inet))dnl also 'select()' + AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()' fi CF_SYS_TIME_SELECT @@ -1431,8 +1287,6 @@ CF_TYPE_SIGACTION CF_SIZECHANGE CF_FUNC_MEMMOVE CF_FUNC_POLL -CF_VA_COPY -AC_FUNC_VFORK # special check for test/ditto.c CF_FUNC_OPENPTY @@ -1440,11 +1294,10 @@ if test "$cf_cv_func_openpty" != no ; then AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>) AC_DEFINE(USE_XTERM_PTY) if test "$cf_cv_lib_util" = yes ; then - CF_ADD_LIB(util,TEST_LIBS) + TEST_LIBS="-lutil $TEST_LIBS" fi fi AC_SUBST(TEST_LIBS) -AC_SUBST(TEST_LIBS2) if test "$with_hashed_db" != no ; then AC_DEFINE(USE_HASHED_DB) @@ -1501,12 +1354,12 @@ cerr << "testing" << endl; CF_CPP_STATIC_CAST CXX_AR='$(AR)' - CXX_ARFLAGS='$(ARFLAGS)' + CXX_AR_OPTS='$(AR_OPTS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_ARFLAGS='-ar -o' + CXX_AR_OPTS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -1515,13 +1368,13 @@ cerr << "testing" << endl; solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_ARFLAGS='-xar -o' + CXX_AR_OPTS='-xar -o' fi ;; esac AC_SUBST(CXXLDFLAGS) AC_SUBST(CXX_AR) - AC_SUBST(CXX_ARFLAGS) + AC_SUBST(CXX_AR_OPTS) else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -1582,49 +1435,99 @@ if test -f "${srcdir}/Ada95/Makefile.in" ; then dnl libtool does not know anything about GNAT, though a change made in 1998 dnl provided for it "someday". Disable the ada subtree if we are using dnl libtool -TD 20070714 - if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - AC_MSG_WARN(libtool does not support Ada - disabling feature) - cf_with_ada=no - fi - fi +if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + AC_MSG_WARN(libtool does not support Ada - disabling feature) + cf_with_ada=no + fi +fi dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. - if test "$cf_with_ada" != "no" ; then - CF_PROG_GNAT - if test "$cf_cv_prog_gnat_correct" = yes; then - CF_ADD_ADAFLAGS(-gnatpn) - - # make ADAFLAGS consistent with CFLAGS - case "$CFLAGS" in - *-g*) - CF_ADD_ADAFLAGS(-g) - ;; - esac - case "$CFLAGS" in - *-O*) - CF_ADD_ADAFLAGS(-O3) - ;; - esac - - CF_GNAT_GENERICS - CF_GNAT_SIGINT - CF_GNAT_PRAGMA_UNREF - CF_GNAT_PROJECTS - - CF_WITH_ADA_COMPILER - - cf_ada_package=terminal_interface - AC_SUBST(cf_ada_package) - - CF_WITH_ADA_INCLUDE - CF_WITH_ADA_OBJECTS - CF_WITH_ADA_SHAREDLIB - fi - fi +if test "$cf_with_ada" != "no" ; then +cf_ada_make=gnatmake +AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= else - cf_with_ada=no + CF_GNAT_VERSION + AC_CHECK_PROG(M4_exists, m4, yes, no) + if test "$ac_cv_prog_M4_exists" = no; then + cf_cv_prog_gnat_correct=no + echo Ada95 binding required program m4 not found. Ada95 binding disabled. + fi + if test "$cf_cv_prog_gnat_correct" = yes; then + AC_MSG_CHECKING(if GNAT works) + CF_GNAT_TRY_RUN([procedure conftest;], +[with Text_IO; +with GNAT.OS_Lib; +procedure conftest is +begin + Text_IO.Put ("Hello World"); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (0); +end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) + AC_MSG_RESULT($cf_cv_prog_gnat_correct) + fi +fi +if test "$cf_cv_prog_gnat_correct" = yes; then + ADAFLAGS="-O3 -gnatpn $ADAFLAGS" + + AC_MSG_CHECKING(if GNAT pragma Unreferenced works) + CF_GNAT_TRY_LINK([procedure conftest;], +[with Text_IO; +with GNAT.OS_Lib; +procedure conftest is + test : Integer; + pragma Unreferenced (test); +begin + test := 1; + Text_IO.Put ("Hello World"); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (0); +end conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no]) + AC_MSG_RESULT($cf_cv_pragma_unreferenced) + + # if the pragma is supported, use it (needed in the Trace code). + if test $cf_cv_pragma_unreferenced = yes ; then + PRAGMA_UNREF=TRUE + else + PRAGMA_UNREF=FALSE + fi + + AC_ARG_WITH(ada-compiler, + [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], + [cf_ada_compiler=$withval], + [cf_ada_compiler=gnatmake]) + + cf_ada_package=terminal_interface + + AC_SUBST(cf_ada_make) + AC_SUBST(cf_ada_compiler) + AC_SUBST(cf_ada_package) + AC_SUBST(ADAFLAGS) + AC_SUBST(cf_compile_generics) + AC_SUBST(cf_generic_objects) + AC_SUBST(PRAGMA_UNREF) + + CF_WITH_PATH(ada-include, + [ --with-ada-include=DIR Ada includes are in DIR], + ADA_INCLUDE, + PREFIX/lib/ada/adainclude, + [$]prefix/lib/ada/adainclude) + AC_SUBST(ADA_INCLUDE) + + CF_WITH_PATH(ada-objects, + [ --with-ada-objects=DIR Ada objects are in DIR], + ADA_OBJECTS, + PREFIX/lib/ada/adalib, + [$]prefix/lib/ada/adalib) + AC_SUBST(ADA_OBJECTS) + +fi +fi +else + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -1651,7 +1554,6 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" - if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -1659,21 +1561,6 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" - -# Most term-driver calls are to tinfo, but some like init_pair are to the -# base library (so it resides in base). -if test "$with_term_driver" != no ; then - LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" - case $cf_cv_system_name in #(vi - *mingw32*) #(vi - LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" - ;; - *) #(vi - LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" - ;; - esac -fi - test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" @@ -1769,8 +1656,6 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" - TICS_LIST="$SHLIB_LIST $TEST_ARGS" - SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -1838,7 +1723,6 @@ if test "$NCURSES_LIBUTF8" = 1 ; then AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h) fi fi -WITH_OVERWRITE=$with_overwrite AC_SUBST(WITH_OVERWRITE) AC_SUBST(TICS_LIST) @@ -1858,91 +1742,40 @@ AC_DEFINE(HAVE_SLK_COLOR) CF_SRC_MODULES($modules_to_build) if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" - SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" fi CF_DIRS_TO_MAKE -# symbols that differ when compiling Ada95 by itself. -NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' -AC_SUBST(NCURSES_SHLIB2) - -# values to use as strings -AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR') +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}") ### Now that we're done running tests, add the compiler-warnings, if any CF_ADD_CFLAGS($EXTRA_CFLAGS) +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + CF_RPATH_HACK +fi + ### Define substitutions for header files to avoid name-pollution CF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0) CF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0) CF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0) ################################################################################ -test "$use_database" = yes && \ -SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" - +test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" -SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" - -if test x"$enable_pc_files" = xyes ; then \ -SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" -MAKE_PC_FILES= -else -MAKE_PC_FILES="#" -fi -AC_SUBST(MAKE_PC_FILES) -AC_SUBST(cross_compiling) - -AC_PATH_PROG(TIC_PATH,tic,unknown,$PATH:/usr/local/ncurses/bin) -if test -n "$FALLBACK_LIST" -then - if test "$TIC_PATH" = unknown - then - AC_MSG_WARN(no tic program found for fallbacks) - fi -fi -AC_SUBST(TIC_PATH) - -if test "x$cf_with_tests" != xno ; then - MAKE_TESTS= -else - MAKE_TESTS="#" -fi -AC_SUBST(MAKE_TESTS) - -ADAHTML_DIR=../../doc/html/ada -AC_SUBST(ADAHTML_DIR) - -SUB_SCRIPTS= -case $cf_cv_system_name in #(vi -*mingw32*) #(vi - SUB_SCRIPTS="mk-dlls.sh" - ;; -esac - AC_OUTPUT( \ include/MKterm.h.awk \ include/curses.head:include/curses.h.in \ - include/ncurses_dll.h \ include/termcap.h \ include/unctrl.h \ - $SUB_SCRIPTS \ $SUB_MAKEFILES \ Makefile,[ -if test "x$cf_with_tests" != xno ; then - CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK"], test) -fi +CF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test) CF_LIB_RULES($SRC_SUBDIRS) - -if test "x$cf_with_ada" != xno ; then -if test -z "$USE_OLD_MAKERULES" ; then - $AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile -fi -fi ],[ ### Special initialization commands, used to pass information from the ### configuration-run into config.status @@ -1952,12 +1785,10 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" -LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" -LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -1965,15 +1796,13 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" -TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -USE_OLD_MAKERULES="$USE_OLD_MAKERULES" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -1991,12 +1820,9 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" -cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" -cf_with_manpages="$cf_with_manpages" -cf_with_tests="$cf_with_tests" host="$host" target="$target" ],cat)dnl -${MAKE:-make} preinstall +${MAKE-make} preinstall diff --git a/dist.mk b/dist.mk index 371f0043b3f..551d773313f 100644 --- a/dist.mk +++ b/dist.mk @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. # +# Copyright (c) 1998-2007,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 "Software"), # @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.810 2011/04/04 22:42:20 tom Exp $ +# $Id: dist.mk,v 1.671 2008/11/02 00:58:38 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -36,8 +36,8 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 -NCURSES_MINOR = 9 -NCURSES_PATCH = 20110404 +NCURSES_MINOR = 7 +NCURSES_PATCH = 20081102 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) @@ -57,7 +57,8 @@ GNATHTML= `type -p gnathtml || type -p gnathtml.pl` # has the effect of lengthening the text portion of the page -- so man2html # would remove some text. The man program on Redhat 6.1 appears to work with # man2html if we set the top/bottom margins to 6 (the default is 7). Newer -# versions of 'man' leave no margin (and make it harder to sync with pages). +# versions of 'man' on Linux leave no margin (and make it harder to sync with +# pages). MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html' ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml diff --git a/doc/html/Ada95.html b/doc/html/Ada95.html deleted file mode 100644 index e744da7278c..00000000000 --- a/doc/html/Ada95.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - -Ada95 Binding for ncurses - - - - -

Ada95 Binding for ncurses

-by Jürgen Pfeifer. - -
-

General Remarks

-
    -
  • This document describes Version 01.00 of the binding.
  • -
  • The functionality is modeled to be compatible with the ncurses -package, a clone of the SVr4 curses model.
    -I did the development on an Intel box running the latest stable release of -Linux, ncurses and the most recent released -GNU Ada Translator -gnat versions. For any older versions of ncurses and gnat -it is not guaranteed to work.
  • -
  • You must have the m4 macroprocessor to build this package. -If you don't have this program, you can get the FSF version -here.
  • -
  • Ada programs are supposed to be readable. One of my -favorite methods to make code readable is to use expressive -names for the identifiers. You can find a list of a mapping -of the cryptic curses names to the Ada names in this table.
  • -
  • This is not a typical one-to-one interface mapping. It is -close to one-to-one on the functional level. Each (n)curses function -has it's counterpart with a more or less similar formal parameter list -in the binding. It is not one-to-one with respect to the datatypes. -I tried to make records out of the flat chtype and similar structures, -so you don't have to do bit operations to mark an attributed character -as bold. Just make the boolean member bold of the record -true. The binding also hides the structures like WINDOW, PANEL, MENU, FORM -etc. ! It's a pure functional API.
  • -
  • I try to do as much error checking as possible and feasible -in the binding. I will raise an Ada exception when something -went wrong in the low-level curses. This has the effect that - at least -first time in my life - (n)curses programs have now a very rigid error -checking, but - thanks to Ada - you don't have to code the orgiastic -error checking style of C.
  • -
  • Support for wide characters is currently not in the binding, as it -is not really in ncurses at this point in time.
  • -
- -

Limitations

-
    -
  • I provide no SCREEN datatype and functions to set a new screen. -If you need this (mostly for debugging I guess), write a small -C routine doing all this and import it into your Ada program.
  • -
  • I provide no functions to switch on/off curses tracing options. -Same suggestion as above.
  • -
  • Although Ada95 is an OO Language, this binding doesn't provide -an OO abstraction of the (n)curses functionality. As mentioned above -it's a thin binding for the (n)curses functions. But without any -doubt it would be nice to build on top of this an OO abstraction -of (n)curses functionality.
    -The only exception is the method how fieldtypes are represented in -this Binding. We provide an abstract tagged type Field_Type from -which the various fieldtypes are derived.
  • -
  • I currently do not support the link_fieldtype functionality of the -forms subsystem.
  • -
  • The *_IO packages are currently output only.
  • -
- -

Hierarchy of packages

- -If you want to navigate through the html pages of the package specs, click here. -

Implementation Details

-

Behind the abstraction

-All the new types like Window, Panel, -Menu, Form etc. are just -opaque representations of the pointers to the corresponding -low level (n)curses structures like -WINDOW *, PANEL *, -MENU * or FORM *. -So you can safely pass them to C routines that expect a pointer -to one of those structures. -

Extended ripoffline() usage

-The official documentation of (n)curses says, that the line parameter -determines only whether or not exactly one line is -stolen from the top or bottom of the screen. So essentially only the -sign of the parameter is evaluated. ncurses has internally implemented -it in a way, that uses the line parameter also to control the amount of -lines to steal. This mechanism is used in the Rip_Off_Lines -routine of the binding. -

How user defined field types work

-TBD -

Enumeration fields handling

-The (n)curses documentation says, that the String arrays to be passed to -an TYPE_ENUM fieldtype must not be automatic variables. This is not true -in this binding, because it is internally arranged to safely copy these -values. -

Using other Ada compilers

-This should basically not be a problem. -

Port to other curses implementations

-Basically it should not be too hard to make all this run on a regular SVr4 -implementation of curses. The problems are probably these:
-
    -
  • ncurses has some additional features which are presented in this binding. You -have two choices to deal with this: -
      -
    • Emulate the feature in this binding
    • -
    • Raise an exception for non implemented features
    • -
    -Most likely you will follow a mixed approach. Some features are easy to simulate, -others will be hard if not impossible.
  • -
-I'm quite sure I forgot something. - - diff --git a/doc/html/ada/files.htm b/doc/html/ada/files.htm deleted file mode 100644 index a3bad641f82..00000000000 --- a/doc/html/ada/files.htm +++ /dev/null @@ -1,6 +0,0 @@ - - - -

Files

-[T] - diff --git a/doc/html/ada/files/T.htm b/doc/html/ada/files/T.htm deleted file mode 100644 index d9d6950b818..00000000000 --- a/doc/html/ada/files/T.htm +++ /dev/null @@ -1,78 +0,0 @@ - -T - -

Files - T

-[index] - diff --git a/doc/html/ada/funcs.htm b/doc/html/ada/funcs.htm deleted file mode 100644 index 9a2da6189da..00000000000 --- a/doc/html/ada/funcs.htm +++ /dev/null @@ -1,27 +0,0 @@ - - - -

Functions/Procedures

-[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] - diff --git a/doc/html/ada/funcs/A.htm b/doc/html/ada/funcs/A.htm deleted file mode 100644 index 7714f754280..00000000000 --- a/doc/html/ada/funcs/A.htm +++ /dev/null @@ -1,24 +0,0 @@ - -A - -

Functions - A

-[index] - diff --git a/doc/html/ada/funcs/B.htm b/doc/html/ada/funcs/B.htm deleted file mode 100644 index b62dda82968..00000000000 --- a/doc/html/ada/funcs/B.htm +++ /dev/null @@ -1,21 +0,0 @@ - -B - -

Functions - B

-[index] - diff --git a/doc/html/ada/funcs/C.htm b/doc/html/ada/funcs/C.htm deleted file mode 100644 index 85a094a134d..00000000000 --- a/doc/html/ada/funcs/C.htm +++ /dev/null @@ -1,56 +0,0 @@ - -C - -

Functions - C

-[index] - diff --git a/doc/html/ada/funcs/D.htm b/doc/html/ada/funcs/D.htm deleted file mode 100644 index e2db5db8078..00000000000 --- a/doc/html/ada/funcs/D.htm +++ /dev/null @@ -1,47 +0,0 @@ - -D - -

Functions - D

-[index] - diff --git a/doc/html/ada/funcs/E.htm b/doc/html/ada/funcs/E.htm deleted file mode 100644 index 70d6a2a4074..00000000000 --- a/doc/html/ada/funcs/E.htm +++ /dev/null @@ -1,18 +0,0 @@ - -E - -

Functions - E

-[index] - diff --git a/doc/html/ada/funcs/F.htm b/doc/html/ada/funcs/F.htm deleted file mode 100644 index 465e06e582d..00000000000 --- a/doc/html/ada/funcs/F.htm +++ /dev/null @@ -1,55 +0,0 @@ - -F - -

Functions - F

-[index] - diff --git a/doc/html/ada/funcs/G.htm b/doc/html/ada/funcs/G.htm deleted file mode 100644 index 1f7bf21247d..00000000000 --- a/doc/html/ada/funcs/G.htm +++ /dev/null @@ -1,96 +0,0 @@ - -G - -

Functions - G

-[index] - diff --git a/doc/html/ada/funcs/H.htm b/doc/html/ada/funcs/H.htm deleted file mode 100644 index 4d31cedb5ea..00000000000 --- a/doc/html/ada/funcs/H.htm +++ /dev/null @@ -1,22 +0,0 @@ - -H - -

Functions - H

-[index] - diff --git a/doc/html/ada/funcs/I.htm b/doc/html/ada/funcs/I.htm deleted file mode 100644 index 88265658694..00000000000 --- a/doc/html/ada/funcs/I.htm +++ /dev/null @@ -1,51 +0,0 @@ - -I - -

Functions - I

-[index] - diff --git a/doc/html/ada/funcs/K.htm b/doc/html/ada/funcs/K.htm deleted file mode 100644 index 715a6e468a9..00000000000 --- a/doc/html/ada/funcs/K.htm +++ /dev/null @@ -1,14 +0,0 @@ - -K - -

Functions - K

-[index] - diff --git a/doc/html/ada/funcs/L.htm b/doc/html/ada/funcs/L.htm deleted file mode 100644 index 13a0b9a7d27..00000000000 --- a/doc/html/ada/funcs/L.htm +++ /dev/null @@ -1,20 +0,0 @@ - -L - -

Functions - L

-[index] - diff --git a/doc/html/ada/funcs/M.htm b/doc/html/ada/funcs/M.htm deleted file mode 100644 index 27dea4e05de..00000000000 --- a/doc/html/ada/funcs/M.htm +++ /dev/null @@ -1,51 +0,0 @@ - -M - -

Functions - M

-[index] - diff --git a/doc/html/ada/funcs/N.htm b/doc/html/ada/funcs/N.htm deleted file mode 100644 index 40fbf5ae49c..00000000000 --- a/doc/html/ada/funcs/N.htm +++ /dev/null @@ -1,35 +0,0 @@ - -N - -

Functions - N

-[index] - diff --git a/doc/html/ada/funcs/O.htm b/doc/html/ada/funcs/O.htm deleted file mode 100644 index 0e65524568f..00000000000 --- a/doc/html/ada/funcs/O.htm +++ /dev/null @@ -1,12 +0,0 @@ - -O - -

Functions - O

-[index] - diff --git a/doc/html/ada/funcs/P.htm b/doc/html/ada/funcs/P.htm deleted file mode 100644 index ea4ee25976a..00000000000 --- a/doc/html/ada/funcs/P.htm +++ /dev/null @@ -1,59 +0,0 @@ - -P - -

Functions - P

-[index] - diff --git a/doc/html/ada/funcs/Q.htm b/doc/html/ada/funcs/Q.htm deleted file mode 100644 index d4874689bdb..00000000000 --- a/doc/html/ada/funcs/Q.htm +++ /dev/null @@ -1,8 +0,0 @@ - -Q - -

Functions - Q

-[index] - diff --git a/doc/html/ada/funcs/R.htm b/doc/html/ada/funcs/R.htm deleted file mode 100644 index 8e223f4c177..00000000000 --- a/doc/html/ada/funcs/R.htm +++ /dev/null @@ -1,39 +0,0 @@ - -R - -

Functions - R

-[index] - diff --git a/doc/html/ada/funcs/S.htm b/doc/html/ada/funcs/S.htm deleted file mode 100644 index 67478063deb..00000000000 --- a/doc/html/ada/funcs/S.htm +++ /dev/null @@ -1,191 +0,0 @@ - -S - -

Functions - S

-[index] - diff --git a/doc/html/ada/funcs/T.htm b/doc/html/ada/funcs/T.htm deleted file mode 100644 index 2714f68d945..00000000000 --- a/doc/html/ada/funcs/T.htm +++ /dev/null @@ -1,36 +0,0 @@ - -T - -

Functions - T

-[index] - diff --git a/doc/html/ada/funcs/U.htm b/doc/html/ada/funcs/U.htm deleted file mode 100644 index ccd09dec72f..00000000000 --- a/doc/html/ada/funcs/U.htm +++ /dev/null @@ -1,23 +0,0 @@ - -U - -

Functions - U

-[index] - diff --git a/doc/html/ada/funcs/V.htm b/doc/html/ada/funcs/V.htm deleted file mode 100644 index 858d0e67437..00000000000 --- a/doc/html/ada/funcs/V.htm +++ /dev/null @@ -1,11 +0,0 @@ - -V - -

Functions - V

-[index] - diff --git a/doc/html/ada/funcs/W.htm b/doc/html/ada/funcs/W.htm deleted file mode 100644 index 8567ecce199..00000000000 --- a/doc/html/ada/funcs/W.htm +++ /dev/null @@ -1,53 +0,0 @@ - -W - -

Functions - W

-[index] - diff --git a/doc/html/ada/index.htm b/doc/html/ada/index.htm deleted file mode 100644 index 4a13484de69..00000000000 --- a/doc/html/ada/index.htm +++ /dev/null @@ -1,39 +0,0 @@ - - -Source Browser - - -<H2 ALIGN=CENTER>Files</H2> -<A HREF="files/T.htm">[T]</A> -<HR> -<H2 ALIGN=CENTER>Functions/Procedures</H2> -<A HREF="funcs/A.htm">[A]</A> -<A HREF="funcs/B.htm">[B]</A> -<A HREF="funcs/C.htm">[C]</A> -<A HREF="funcs/D.htm">[D]</A> -<A HREF="funcs/E.htm">[E]</A> -<A HREF="funcs/F.htm">[F]</A> -<A HREF="funcs/G.htm">[G]</A> -<A HREF="funcs/H.htm">[H]</A> -<A HREF="funcs/I.htm">[I]</A> -<A HREF="funcs/K.htm">[K]</A> -<A HREF="funcs/L.htm">[L]</A> -<A HREF="funcs/M.htm">[M]</A> -<A HREF="funcs/N.htm">[N]</A> -<A HREF="funcs/O.htm">[O]</A> -<A HREF="funcs/P.htm">[P]</A> -<A HREF="funcs/Q.htm">[Q]</A> -<A HREF="funcs/R.htm">[R]</A> -<A HREF="funcs/S.htm">[S]</A> -<A HREF="funcs/T.htm">[T]</A> -<A HREF="funcs/U.htm">[U]</A> -<A HREF="funcs/V.htm">[V]</A> -<A HREF="funcs/W.htm">[W]</A> - - - - - - - - diff --git a/doc/html/ada/main.htm b/doc/html/ada/main.htm deleted file mode 100644 index 701fe7d1437..00000000000 --- a/doc/html/ada/main.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - -

[No frame version is here]

Files

-[T] -

Functions/Procedures

-[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -
-You should start your browsing with one of these files: - - diff --git a/doc/html/ada/table.html b/doc/html/ada/table.html deleted file mode 100644 index ce8d91f4eb6..00000000000 --- a/doc/html/ada/table.html +++ /dev/null @@ -1,341 +0,0 @@ - - - -Correspondence between ncurses C and Ada functions - - -

Correspondence between ncurses C and Ada functions

-

Sorted by C function name

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C nameAda nameman page
_nc_freeall()Curses_Free_Allcurs_trace.3x
_tracef()Trace_Putcurs_trace.3x
assume_default_colors()Assume_Default_Colorsdefault_colors.3x
baudrate()Baudratecurs_termattrs.3x
beep()Beepcurs_beep.3x
bottom_panel()Bottompanel.3x
box()Boxcurs_border.3x
can_change_color()Can_Change_Colorcurs_color.3x
cbreak()Set_Cbreak_Modecurs_inopts.3x
clearok()Clear_On_Next_Updatecurs_outopts.3x
color_content()Color_Contentcurs_color.3x
copywin()Copycurs_overlay.3x
current_field()Currentform_page.3x
current_item()Currentmitem_current.3x
curs_set()Set_Cursor_Visibilitycurs_kernel.3x
curscrCurrent_Windowcurs_initscr.3x
curses_version()Curses_Versioncurs_extend.3x
data_ahead()Data_Aheadform_data.3x
data_behind()Data_Behindform_data.3x
def_prog_mode()Save_Curses_Modecurs_kernel.3x
define_key()Define_Keydefine_key.3x
del_panel()Deletepanel.3x
delay_output()Delay_Outputcurs_util.3x
delwin()Deletecurs_window.3x
derwin()Derived_Windowcurs_window.3x
doupdate()Update_Screencurs_refresh.3x
dup_field()Duplicateform_field_new.3x
dupwin()Duplicatecurs_window.3x
dynamic_field_info()Dynamic_Infoform_field_info.3x
echo()Set_Echo_Modecurs_inopts.3x
endwin()End_Windowscurs_initscr.3x
erasechar()Erase_Charactercurs_termattrs.3x
field_back()Backgroundform_field_attributes.3x
field_back()Backgroundform_field_attributes.3x
field_buffer()Get_Bufferform_field_buffer.3x
field_count()Field_Countform_field.3x
field_fore()Foregroundform_field_attributes.3x
field_fore()Foregroundform_field_attributes.3x
field_index()Get_Indexform_page.3x
field_info()Infoform_field_info.3x
field_init()Get_Field_Init_Hookform_hook.3x
field_just()Get_Justificationform_field_just.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts_on()Switch_Optionsform_field_opts.3x
field_pad()Pad_Characterform_field_attributes.3x
field_status()Changedform_field_buffer.3x
field_term()Get_Field_Term_Hookform_hook.3x
field_type()Get_Typeform_field_validation.3x
field_userptrGet_User_Dataform_field_userptr.3x
field_userptrGet_User_Dataform_field_userptr.3x
flash()Flash_Screencurs_beep.3x
flushinp()Flush_Inputcurs_util.3x
form_driver()Driverform_driver.3x
form_fields()Fieldsform_field.3x
form_init()Get_Form_Init_Hookform_hook.3x
form_opts()Get_Optionsform_opts.3x
form_opts()Get_Optionsform_opts.3x
form_opts_on()Switch_Optionsform_opts.3x
form_page()Pageform_page.3x
form_sub()Get_Sub_Windowform_win.3x
form_term()Get_Form_Term_Hookform_hook.3x
form_userptrGet_User_Dataform_userptr.3x
form_userptrGet_User_Dataform_userptr.3x
form_win()Get_Windowform_win.3x
free_field()Deleteform_field_new.3x
free_form()Deleteform_new.3x
free_item()Deletemitem_new.3x
free_menu()Deletemenu_new.3x
getbegyx()Get_Window_Positioncurs_getyx.3x
getmaxyx()Get_Sizecurs_getyx.3x
getmouse()Get_Mousecurs_mouse.3x
getparyx()Get_Origin_Relative_To_Parentcurs_getyx.3x
getyx()Get_Cursor_Positioncurs_getyx.3x
halfdelay()Half_Delaycurs_inopts.3x
has_colors()Has_Colorscurs_color.3x
has_ic()Has_Insert_Charactercurs_termattrs.3x
has_il()Has_Insert_Linecurs_termattrs.3x
has_key()Has_Keycurs_getch.3x
hide_panel()Hidepanel.3x
idcok()Use_Insert_Delete_Charactercurs_outopts.3x
idlok()Use_Insert_Delete_Linecurs_outopts.3x
immedok()Immediate_Update_Modecurs_outopts.3x
init_color()Init_Colorcurs_color.3x
init_pair()Init_Paircurs_color.3x
initscr()Init_Screencurs_initscr.3x
initscr()Init_Windowscurs_initscr.3x
intrflush()Set_Flush_On_Interrupt_Modecurs_inopts.3x
is_linetouched()Is_Touchedcurs_touch.3x
is_wintouched()Is_Touchedcurs_touch.3x
isendwin()Is_End_Windowcurs_initscr.3x
item_count()Item_Countmenu_items.3x
item_description();Descriptionmitem_name.3x
item_index()Get_Indexmitem_current.3x
item_init()Get_Item_Init_Hookmenu_hook.3x
item_name()Namemitem_name.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts_on()Switch_Optionsmitem_opts.3x
item_term()Get_Item_Term_Hookmenu_hook.3x
item_userptrGet_User_Datamitem_userptr.3x
item_userptrGet_User_Datamitem_userptr.3x
item_value()Valuemitem_value.3x
item_visible()Visiblemitem_visible.3x
keyname()Key_Namecurs_util.3x
keyname()Key_Namecurs_util.3x
keyok()Enable_Keykeyok.3x
keypad()Set_KeyPad_Modecurs_inopts.3x
killchar()Kill_Charactercurs_termattrs.3x
leaveok()Leave_Cursor_After_Updatecurs_outopts.3x
link_field()Linkform_field_new.3x
longname()Long_Namecurs_termattrs.3x
longname()Long_Namecurs_termattrs.3x
menu_back()Backgroundmenu_attributes.3x
menu_back()Backgroundmenu_attributes.3x
menu_driver()Drivermenu_driver.3x
menu_fore()Foregroundmenu_attributes.3x
menu_fore()Foregroundmenu_attributes.3x
menu_format()Formatmenu_format.3x
menu_grey()Greymenu_attributes.3x
menu_grey()Greymenu_attributes.3x
menu_init()Get_Menu_Init_Hookmenu_hook.3x
menu_items()Itemsmenu_items.3x
menu_mark()Markmenu_mark.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts_on()Switch_Optionsmenu_opts.3x
menu_pad()Pad_Charactermenu_attributes.3x
menu_pattern()Patternmenu_pattern.3x
menu_requestname.3xmenu_driver.3x
menu_spacing()Spacingmenu_spacing.3x
menu_sub()Get_Sub_Windowmenu_win.3x
menu_term()Get_Menu_Term_Hookmenu_hook.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_win()Get_Windowmenu_win.3x
meta()Set_Meta_Modecurs_inopts.3x
mouseinterval()Mouse_Intervalcurs_mouse.3x
mousemask()Start_Mousecurs_mouse.3x
move_field()Moveform_field.3x
move_panel()Movepanel.3x
mvderwin()Move_Derived_Windowcurs_window.3x
mvwaddch()Addcurs_addch.3x
mvwaddchnstr()Addcurs_addchstr.3x
mvwaddnstr()Addcurs_addstr.3x
mvwchgat()Change_Attributescurs_attr.3x
mvwdelch()Delete_Charactercurs_delch.3x
mvwgetnstr()Getcurs_getstr.3x
mvwin()Move_Windowcurs_window.3x
mvwinch()Peekcurs_inch.3x
mvwinchnstr()Peekcurs_inchstr.3x
mvwinnstr()Peekcurs_instr.3x
mvwinsch()Insertcurs_insch.3x
mvwinsnstr()Insertcurs_insstr.3x
napms()Nap_Milli_Secondscurs_kernel.3x
new_field()Createform_field_new.3x
new_field()New_Fieldform_field_new.3x
new_form()Createform_new.3x
new_form()New_Formform_new.3x
new_item()Createmitem_new.3x
new_item()New_Itemmitem_new.3x
new_menu()Createmenu_new.3x
new_page()Is_New_Pageform_new_page.3x
new_panel()Createpanel.3x
new_panel()New_Panelpanel.3x
newpad()New_Padcurs_pad.3x
newwin()Createcurs_window.3x
nl()Set_NL_Modecurs_outopts.3x
nodelay()Set_NoDelay_Modecurs_inopts.3x
notimeout()Set_Escape_Time_Modecurs_inopts.3x
overlay()Overlaycurs_overlay.3x
overwrite()Overwritecurs_overlay.3x
pair_content()Pair_Contentcurs_color.3x
panel_above()Abovepanel.3x
panel_below()Belowpanel.3x
panel_hidden()Is_Hiddenpanel.3x
panel_userptrGet_User_Datapanel.3x
panel_userptrGet_User_Datapanel.3x
panel_window()Get_Windowpanel.3x
panel_window()Panel_Windowpanel.3x
pechochar()Add_Character_To_Pad_And_Echo_Itcurs_pad.3x
pnoutrefresh()Refresh_Without_Updatecurs_pad.3x
pos_form_cursor()Position_Cursorform_cursor.3x
pos_menu_cursor()Position_Cursormenu_cursor.3x
post_form()Postform_post.3x
post_menu()Postmenu_post.3x
prefresh()Refreshcurs_pad.3x
qiflush()Set_Queue_Interrupt_Modecurs_inopts.3x
raw()Set_Raw_Modecurs_inopts.3x
redrawwin()Redrawcurs_refresh.3x
replace_panel()Replacepanel.3x
reset_prog_mode()Reset_Curses_Modecurs_kernel.3x
resetty();Reset_Terminal_Statecurs_kernel.3x
ripoffline()Rip_Off_Linescurs_kernel.3x
savetty()Save_Terminal_Statecurs_kernel.3x
scale_form()Scaleform_win.3x
scale_menu()Scalemenu_win.3x
scr_dump()Screen_Dump_To_Filecurs_scr_dump.3x
scr_init()Screen_Init_From_Filecurs_scr_dump.3x
scr_restore()Screen_Restore_From_Filecurs_scr_dump.3x
scr_set()Screen_Set_Filecurs_scr_dump.3x
scrollok()Allow_Scrollingcurs_outopts.3x
set_current_field()Set_Currentform_page.3x
set_current_item()Set_Currentmitem_current.3x
set_field_back()Set_Backgroundform_field_attributes.3x
set_field_buffer()Set_Bufferform_field_buffer.3x
set_field_fore()Set_Foregroundform_field_attributes.3x
set_field_init()Set_Field_Init_Hookform_hook.3x
set_field_just()Set_Justificationform_field_just.3x
set_field_max()Set_Maximum_Sizeform_field_buffer.3x
set_field_opts()Set_Optionsform_field_opts.3x
set_field_pad()Set_Pad_Characterform_field_attributes.3x
set_field_status()Set_Statusform_field_buffer.3x
set_field_term()Set_Field_Term_Hookform_hook.3x
set_field_type()Set_Typeform_fieldtype.3x
set_field_userptrSet_User_Dataform_field_userptr.3x
set_form_fields()Redefineform_field.3x
set_form_fields()Set_Fieldsform_field.3x
set_form_init()Set_Form_Init_Hookform_hook.3x
set_form_opts()Set_Optionsform_opts.3x
set_form_page()Set_Pageform_page.3x
set_form_sub()Set_Sub_Windowform_win.3x
set_form_term()Set_Form_Term_Hookform_hook.3x
set_form_userptrSet_User_Dataform_userptr.3x
set_form_win()Set_Windowform_win.3x
set_item_init()Set_Item_Init_Hookmenu_hook.3x
set_item_opts()Set_Optionsmitem_opts.3x
set_item_term()Set_Item_Term_Hookmenu_hook.3x
set_item_userptrSet_User_Datamitem_userptr.3x
set_item_value()Set_Valuemitem_value.3x
set_menu_back()Set_Backgroundmenu_attributes.3x
set_menu_fore()Set_Foregroundmenu_attributes.3x
set_menu_format()Set_Formatmenu_format.3x
set_menu_grey()Set_Greymenu_attributes.3x
set_menu_init()Set_Menu_Init_Hookmenu_hook.3x
set_menu_items()Redefinemenu_items.3x
set_menu_mark()Set_Markmenu_mark.3x
set_menu_opts()Set_Optionsmenu_opts.3x
set_menu_pad()Set_Pad_Charactermenu_attributes.3x
set_menu_pattern()Set_Patternmenu_pattern.3x
set_menu_spacing()Set_Spacingmenu_spacing.3x
set_menu_sub()Set_Sub_Windowmenu_win.3x
set_menu_term()Set_Menu_Term_Hookmenu_hook.3x
set_menu_userptrSet_User_Datamenu_userptr.3x
set_menu_win()Set_Windowmenu_win.3x
set_new_page()Set_New_Pageform_new_page.3x
set_panel_userptrSet_User_Datapanel.3x
set_top_row()Set_Top_Rowmitem_current.3x
show_panel()Showpanel.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attron()Switch_Soft_Label_Key_Attributescurs_slk.3x
slk_attrset()Set_Soft_Label_Key_Attributescurs_slk.3x
slk_clear()Clear_Soft_Label_Keyscurs_slk.3x
slk_color()Set_Soft_Label_Key_Colorcurs_slk.3x
slk_init()Init_Soft_Label_Keyscurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_noutrefresh()Refresh_Soft_Label_Keys_Without_Updatecurs_slk.3x
slk_refresh()Refresh_Soft_Label_Keycurs_slk.3x
slk_restore()Restore_Soft_Label_Keyscurs_slk.3x
slk_set()Set_Soft_Label_Keycurs_slk.3x
slk_touch()Touch_Soft_Label_Keyscurs_slk.3x
standout()Standoutcurs_attr.3x
start_color()Start_Colorcurs_color.3x
stdscrStandard_Windowcurs_initscr.3x
subpad()Sub_Padcurs_pad.3x
subwin()Sub_Windowcurs_window.3x
syncok()Set_Synch_Modecurs_window.3x
termattrs()Supported_Attributescurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
top_panel()Toppanel.3x
top_row()Top_Rowmitem_current.3x
touchline()Touchcurs_touch.3x
touchwin()Touchcurs_touch.3x
trace()Trace_oncurs_trace.3x
unctrl()Un_Controlcurs_util.3x
unctrl()Un_Controlcurs_util.3x
ungetch()Undo_Keystrokecurs_getch.3x
ungetmouse()Unget_Mousecurs_mouse.3x
untouchwin()Untouchcurs_touch.3x
update_panels()Update_Panelspanel.3x
use_default_colors()Use_Default_Colorsdefault_colors.3x
use_extended_names()Use_Extended_Namescurs_extend.3x
waddch()Addcurs_addch.3x
waddchnstr()Addcurs_addchstr.3x
waddnstr()Addcurs_addstr.3x
wattr_get()Get_Character_Attributescurs_attr.3x
wattr_get()Get_Character_Attributecurs_attr.3x
wattron()Switch_Character_Attributecurs_attr.3x
wattrset()Set_Character_Attributescurs_attr.3x
wbkgd()Change_Backgroundcurs_bkgd.3x
wbkgdget()Get_Backgroundcurs_bkgd.3x
wbkgdset()Set_Backgroundcurs_bkgd.3x
wborder()Bordercurs_border.3x
wchgat()Change_Attributescurs_attr.3x
wclear()Clearcurs_clear.3x
wclrtobot()Clear_To_End_Of_Screencurs_clear.3x
wclrtoeol()Clear_To_End_Of_Linecurs_clear.3x
wcolor_set()Set_Colorcurs_attr.3x
wdelch()Delete_Charactercurs_delch.3x
wdeleteln()Delete_Linecurs_deleteln.3x
wechochar()Add_With_Immediate_Echocurs_addch.3x
wenclose()Enclosed_In_Windowcurs_mouse.3x
werase()Erasecurs_clear.3x
wgetch()Get_Keystrokecurs_getch.3x
wgetnstr()Getcurs_getstr.3x
whline()Horizontal_Linecurs_border.3x
winch()Peekcurs_inch.3x
winchnstr()Peekcurs_inchstr.3x
winnstr()Peekcurs_instr.3x
winsch()Insertcurs_insch.3x
winsdelln()Insert_Delete_Linescurs_deleteln.3x
winsertln()Insert_Linecurs_deleteln.3x
winsnstr()Insertcurs_insstr.3x
wmove()Move_Cursorcurs_move.3x
wnoutrefresh()Refresh_Without_Updatecurs_refresh.3x
wredrawln()Redrawcurs_refresh.3x
wrefresh()Refreshcurs_refresh.3x
wresize()Resizewresize.3x
wscrl()Scrollcurs_scroll.3x
wsetscrreg()Set_Scroll_Regioncurs_outopts.3x
wsyncdown()Synchronize_Downwardscurs_window.3x
wsyncup()Synchronize_Upwardscurs_window.3x
wtimeout()Set_Timeout_Modecurs_inopts.3x
wtouchln()Change_Line_Statuscurs_touch.3x
wvline()Vertical_Linecurs_border.3x
diff --git a/doc/html/ada/terminal_interface-curses-aux__adb.htm b/doc/html/ada/terminal_interface-curses-aux__adb.htm deleted file mode 100644 index b2e86ce8021..00000000000 --- a/doc/html/ada/terminal_interface-curses-aux__adb.htm +++ /dev/null @@ -1,122 +0,0 @@ - -terminal_interface-curses-aux.adb - -

File : terminal_interface-curses-aux.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Aux                       --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package body Terminal_Interface.Curses.Aux is
-   --
-   --  Some helpers
-   procedure Fill_String (Cp  : chars_ptr;
-                          Str : out String)
-   is
-      --  Fill the string with the characters referenced by the
-      --  chars_ptr.
-      --
-      Len : Natural;
-   begin
-      if Cp /= Null_Ptr then
-         Len := Natural (Strlen (Cp));
-         if Str'Length < Len then
-            raise Constraint_Error;
-         end if;
-         declare
-            S : String (1 .. Len);
-         begin
-            S := Value (Cp);
-            Str (Str'First .. (Str'First + Len - 1)) := S (S'Range);
-         end;
-      else
-         Len := 0;
-      end if;
-
-      if Len < Str'Length then
-         Str ((Str'First + Len) .. Str'Last) := (others => ' ');
-      end if;
-
-   end Fill_String;
-
-   function Fill_String (Cp : chars_ptr) return String
-   is
-      Len : Natural;
-   begin
-      if Cp /= Null_Ptr then
-         Len := Natural (Strlen (Cp));
-         if Len = 0 then
-            return "";
-         else
-            declare
-               S : String (1 .. Len);
-            begin
-               Fill_String (Cp, S);
-               return S;
-            end;
-         end if;
-      else
-         return "";
-      end if;
-   end Fill_String;
-
-   procedure Eti_Exception (Code : Eti_Error)
-   is
-   begin
-      case Code is
-         when E_Ok              => null;
-         when E_System_Error    => raise Eti_System_Error;
-         when E_Bad_Argument    => raise Eti_Bad_Argument;
-         when E_Posted          => raise Eti_Posted;
-         when E_Connected       => raise Eti_Connected;
-         when E_Bad_State       => raise Eti_Bad_State;
-         when E_No_Room         => raise Eti_No_Room;
-         when E_Not_Posted      => raise Eti_Not_Posted;
-         when E_Unknown_Command => raise Eti_Unknown_Command;
-         when E_No_Match        => raise Eti_No_Match;
-         when E_Not_Selectable  => raise Eti_Not_Selectable;
-         when E_Not_Connected   => raise Eti_Not_Connected;
-         when E_Request_Denied  => raise Eti_Request_Denied;
-         when E_Invalid_Field   => raise Eti_Invalid_Field;
-         when E_Current         => raise Eti_Current;
-      end case;
-   end Eti_Exception;
-
-end Terminal_Interface.Curses.Aux;
-
diff --git a/doc/html/ada/terminal_interface-curses-aux__ads.htm b/doc/html/ada/terminal_interface-curses-aux__ads.htm deleted file mode 100644 index 26742af7eee..00000000000 --- a/doc/html/ada/terminal_interface-curses-aux__ads.htm +++ /dev/null @@ -1,130 +0,0 @@ - -terminal_interface-curses-aux.ads - -

File : terminal_interface-curses-aux.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                       Terminal_Interface.Curses.Aux                      --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.18 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
---  curses binding.
---  This module is generated. Please don't change it manually!
---  Run the generator instead.
---  |
-with System;
-with Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Unchecked_Conversion;
-
-package Terminal_Interface.Curses.Aux is
-   pragma Preelaborate (Terminal_Interface.Curses.Aux);
-
-   use type Interfaces.C.int;
-
-   subtype C_Int      is Interfaces.C.int;
-   subtype C_Short    is Interfaces.C.short;
-   subtype C_Long_Int is Interfaces.C.long;
-   subtype C_Size_T   is Interfaces.C.size_t;
-   subtype C_UInt     is Interfaces.C.unsigned;
-   subtype C_ULong    is Interfaces.C.unsigned_long;
-   subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr;
-   type    C_Void_Ptr is new System.Address;
-   type    C_Chtype   is new C_ULong;
-   type    C_AttrType is new C_ULong;
-
-   --  This is how those constants are defined in ncurses. I see them also
-   --  exactly like this in all ETI implementations I ever tested. So it
-   --  could be that this is quite general, but please check with your curses.
-   --  This is critical, because curses sometime mixes Boolean returns with
-   --  returning an error status.
-   Curses_Ok    : constant C_Int := 0;
-   Curses_Err   : constant C_Int := -1;
-
-   Curses_True  : constant C_Int := 1;
-   Curses_False : constant C_Int := 0;
-
-   --  Eti_Error: type for error codes returned by the menu and form subsystem
-   subtype Eti_Error is C_Int range -14 .. 0;
-
-   E_Ok               : constant Eti_Error := 0;
-   E_System_Error     : constant Eti_Error := -1;
-   E_Bad_Argument     : constant Eti_Error := -2;
-   E_Posted           : constant Eti_Error := -3;
-   E_Connected        : constant Eti_Error := -4;
-   E_Bad_State        : constant Eti_Error := -5;
-   E_No_Room          : constant Eti_Error := -6;
-   E_Not_Posted       : constant Eti_Error := -7;
-   E_Unknown_Command  : constant Eti_Error := -8;
-   E_No_Match         : constant Eti_Error := -9;
-   E_Not_Selectable   : constant Eti_Error := -10;
-   E_Not_Connected    : constant Eti_Error := -11;
-   E_Request_Denied   : constant Eti_Error := -12;
-   E_Invalid_Field    : constant Eti_Error := -13;
-   E_Current          : constant Eti_Error := -14;
-
-   procedure Eti_Exception (Code : Eti_Error);
-   --  Dispatch the error code and raise the appropriate exception
-   --
-   --
-   --  Some helpers
-   function Chtype_To_AttrChar is new
-     Unchecked_Conversion (Source => C_Chtype,
-                           Target => Attributed_Character);
-   function AttrChar_To_Chtype is new
-     Unchecked_Conversion (Source => Attributed_Character,
-                           Target => C_Chtype);
-
-   function AttrChar_To_AttrType is new
-     Unchecked_Conversion (Source => Attributed_Character,
-                           Target => C_AttrType);
-
-   function AttrType_To_AttrChar is new
-     Unchecked_Conversion (Source => C_AttrType,
-                           Target => Attributed_Character);
-
-   procedure Fill_String (Cp  : chars_ptr;
-                          Str : out String);
-   --  Fill the Str parameter with the string denoted by the chars_ptr
-   --  C-Style string.
-
-   function Fill_String (Cp : chars_ptr) return String;
-   --  Same but as function.
-
-end Terminal_Interface.Curses.Aux;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm deleted file mode 100644 index 531e28083fc..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__adb.htm +++ /dev/null @@ -1,68 +0,0 @@ - -terminal_interface-curses-forms-field_types-alpha.adb - -

File : terminal_interface-curses-forms-field_types-alpha.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  @Date: 2011/03/19 00:45:37 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Alpha_Field)
-   is
-      function Set_Fld_Type (F    : Field := Fld;
-                             Arg1 : C_Int) return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_alpha");
-
-      Res : Eti_Error;
-   begin
-      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width));
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm deleted file mode 100644 index 9a861b53b59..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alpha__ads.htm +++ /dev/null @@ -1,59 +0,0 @@ - -terminal_interface-curses-forms-field_types-alpha.ads - -

File : terminal_interface-curses-forms-field_types-alpha.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---              Terminal_Interface.Curses.Forms.Field_Types.Alpha           --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface.Curses.Forms.Field_Types.Alpha is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha);
-
-   type Alpha_Field is new Field_Type
-     with record
-        Minimum_Field_Width : Natural := 0;
-     end record;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Alpha_Field);
-   pragma Inline (Set_Field_Type);
-
-end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm deleted file mode 100644 index 97a14f4b025..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__adb.htm +++ /dev/null @@ -1,68 +0,0 @@ - -terminal_interface-curses-forms-field_types-alphanumeric.adb - -

File : terminal_interface-curses-forms-field_types-alphanumeric.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  @Date: 2011/03/19 00:45:37 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : AlphaNumeric_Field)
-   is
-      function Set_Fld_Type (F    : Field := Fld;
-                             Arg1 : C_Int) return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_alnum");
-
-      Res : Eti_Error;
-   begin
-      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width));
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm deleted file mode 100644 index fb13c7c4299..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-alphanumeric__ads.htm +++ /dev/null @@ -1,60 +0,0 @@ - -terminal_interface-curses-forms-field_types-alphanumeric.ads - -

File : terminal_interface-curses-forms-field_types-alphanumeric.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---          Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric        --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
-   pragma Preelaborate
-     (Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric);
-
-   type AlphaNumeric_Field is new Field_Type
-     with record
-        Minimum_Field_Width : Natural := 0;
-     end record;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : AlphaNumeric_Field);
-   pragma Inline (Set_Field_Type);
-
-end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm deleted file mode 100644 index aa1c6665fd5..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__adb.htm +++ /dev/null @@ -1,87 +0,0 @@ - -terminal_interface-curses-forms-field_types-enumeration-ada.adb - -

File : terminal_interface-curses-forms-field_types-enumeration-ada.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  @Date: 2011/03/22 23:36:20 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Characters.Handling; use Ada.Characters.Handling;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
-
-   function Create (Set            : Type_Set := Mixed_Case;
-                    Case_Sensitive : Boolean  := False;
-                    Must_Be_Unique : Boolean  := False)
-                    return Enumeration_Field
-   is
-      I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1);
-      J : Positive := 1;
-   begin
-      I.Case_Sensitive := Case_Sensitive;
-      I.Match_Must_Be_Unique := Must_Be_Unique;
-
-      for E in T'Range loop
-         I.Names (J) := new String'(T'Image (E));
-         --  The Image attribute defaults to upper case, so we have to handle
-         --  only the other ones...
-         if Set /= Upper_Case then
-            I.Names (J).all := To_Lower (I.Names (J).all);
-            if Set = Mixed_Case then
-               I.Names (J).all (I.Names (J).all'First) :=
-                 To_Upper (I.Names (J).all (I.Names (J).all'First));
-            end if;
-         end if;
-         J := J + 1;
-      end loop;
-
-      return Create (I, True);
-   end Create;
-
-   function Value (Fld : Field;
-                   Buf : Buffer_Number := Buffer_Number'First) return T
-   is
-   begin
-      return T'Value (Get_Buffer (Fld, Buf));
-   end Value;
-
-end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm deleted file mode 100644 index 80fd9cf4099..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration-ada__ads.htm +++ /dev/null @@ -1,65 +0,0 @@ - -terminal_interface-curses-forms-field_types-enumeration-ada.ads - -

File : terminal_interface-curses-forms-field_types-enumeration-ada.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---         Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada      --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.10 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type T is (<>);
-
-package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
-   pragma Preelaborate
-     (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada);
-
-   function Create (Set            : Type_Set := Mixed_Case;
-                    Case_Sensitive : Boolean  := False;
-                    Must_Be_Unique : Boolean  := False)
-                    return Enumeration_Field;
-
-   function Value (Fld : Field;
-                   Buf : Buffer_Number := Buffer_Number'First) return T;
-   --  Translate the content of the fields buffer - indicated by the
-   --  buffer number - into an enumeration value. If the buffer is empty
-   --  or the content is invalid, a Constraint_Error is raises.
-
-end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm deleted file mode 100644 index adac9c06c62..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__adb.htm +++ /dev/null @@ -1,121 +0,0 @@ - -terminal_interface-curses-forms-field_types-enumeration.adb - -

File : terminal_interface-curses-forms-field_types-enumeration.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---          Terminal_Interface.Curses.Forms.Field_Types.Enumeration         --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.10 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Unchecked_Deallocation;
-with Interfaces.C; use Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
-
-   function Create (Info               : Enumeration_Info;
-                    Auto_Release_Names : Boolean := False)
-                    return Enumeration_Field
-   is
-      procedure Release_String is
-        new Ada.Unchecked_Deallocation (String,
-                                        String_Access);
-      E : Enumeration_Field;
-      L : constant size_t := 1 + size_t (Info.C);
-      S : String_Access;
-   begin
-      E.Case_Sensitive       := Info.Case_Sensitive;
-      E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique;
-      E.Arr := new chars_ptr_array (size_t (1) .. L);
-      for I in 1 .. Positive (L - 1) loop
-         if Info.Names (I) = null then
-            raise Form_Exception;
-         end if;
-         E.Arr.all (size_t (I)) := New_String (Info.Names (I).all);
-         if Auto_Release_Names then
-            S := Info.Names (I);
-            Release_String (S);
-         end if;
-      end loop;
-      E.Arr.all (L) := Null_Ptr;
-      return E;
-   end Create;
-
-   procedure Release (Enum : in out Enumeration_Field)
-   is
-      I : size_t := 0;
-      P : chars_ptr;
-   begin
-      loop
-         P := Enum.Arr.all (I);
-         exit when P = Null_Ptr;
-         Free (P);
-         Enum.Arr.all (I) := Null_Ptr;
-         I := I + 1;
-      end loop;
-      Enum.Arr := null;
-   end Release;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Enumeration_Field)
-   is
-      function Set_Fld_Type (F    : Field := Fld;
-                             Arg1 : chars_ptr_array;
-                             Arg2 : C_Int;
-                             Arg3 : C_Int) return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_enum");
-
-      Res : Eti_Error;
-   begin
-      if Typ.Arr = null then
-         raise Form_Exception;
-      end if;
-      Res := Set_Fld_Type (Arg1 => Typ.Arr.all,
-                           Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)),
-                           Arg3 => C_Int (Boolean'Pos
-                                          (Typ.Match_Must_Be_Unique)));
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ, C_Choice_Router);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm deleted file mode 100644 index bb0abeba717..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-enumeration__ads.htm +++ /dev/null @@ -1,104 +0,0 @@ - -terminal_interface-curses-forms-field_types-enumeration.ads - -

File : terminal_interface-curses-forms-field_types-enumeration.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---           Terminal_Interface.Curses.Forms.Field_Types.Enumeration        --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C.Strings;
-
-package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
-   pragma Preelaborate
-     (Terminal_Interface.Curses.Forms.Field_Types.Enumeration);
-
-   type String_Access is access String;
-
-   --  Type_Set is used by the child package Ada
-   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
-
-   type Enum_Array is array (Positive range <>)
-     of String_Access;
-
-   type Enumeration_Info (C : Positive) is
-      record
-         Names                : Enum_Array (1 .. C);
-         Case_Sensitive       : Boolean := False;
-         Match_Must_Be_Unique : Boolean := False;
-      end record;
-
-   type Enumeration_Field is new Field_Type with private;
-
-   function Create (Info : Enumeration_Info;
-                    Auto_Release_Names : Boolean := False)
-                    return Enumeration_Field;
-   --  Make an fieldtype from the info. Enumerations are special, because
-   --  they normally don't copy the enum values into a private store, so
-   --  we have to care for the lifetime of the info we provide.
-   --  The Auto_Release_Names flag may be used to automatically releases
-   --  the strings in the Names array of the Enumeration_Info.
-
-   function Make_Enumeration_Type (Info : Enumeration_Info;
-                                   Auto_Release_Names : Boolean := False)
-                                   return Enumeration_Field renames Create;
-
-   procedure Release (Enum : in out Enumeration_Field);
-   --  But we may want to release the field to release the memory allocated
-   --  by it internally. After that the Enumeration field is no longer usable.
-
-   --  The next type defintions are all ncurses extensions. They are typically
-   --  not available in other curses implementations.
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Enumeration_Field);
-   pragma Inline (Set_Field_Type);
-
-private
-   type CPA_Access is access Interfaces.C.Strings.chars_ptr_array;
-
-   type Enumeration_Field is new Field_Type with
-      record
-         Case_Sensitive       : Boolean := False;
-         Match_Must_Be_Unique : Boolean := False;
-         Arr                  : CPA_Access := null;
-      end record;
-
-end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm deleted file mode 100644 index be4d9b3b3c8..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__adb.htm +++ /dev/null @@ -1,72 +0,0 @@ - -terminal_interface-curses-forms-field_types-intfield.adb - -

File : terminal_interface-curses-forms-field_types-intfield.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  @Date: 2011/03/19 00:45:37 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.IntField is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Integer_Field)
-   is
-      function Set_Fld_Type (F    : Field := Fld;
-                             Arg1 : C_Int;
-                             Arg2 : C_Long_Int;
-                             Arg3 : C_Long_Int) return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_integer");
-
-      Res : Eti_Error;
-   begin
-      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
-                           Arg2 => C_Long_Int (Typ.Lower_Limit),
-                           Arg3 => C_Long_Int (Typ.Upper_Limit));
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.IntField;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm deleted file mode 100644 index 86239785354..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-intfield__ads.htm +++ /dev/null @@ -1,61 +0,0 @@ - -terminal_interface-curses-forms-field_types-intfield.ads - -

File : terminal_interface-curses-forms-field_types-intfield.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---            Terminal_Interface.Curses.Forms.Field_Types.IntField          --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface.Curses.Forms.Field_Types.IntField is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField);
-
-   type Integer_Field is new Field_Type with
-      record
-         Precision   : Natural;
-         Lower_Limit : Integer;
-         Upper_Limit : Integer;
-      end record;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Integer_Field);
-   pragma Inline (Set_Field_Type);
-
-end Terminal_Interface.Curses.Forms.Field_Types.IntField;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm deleted file mode 100644 index bd33283a449..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__adb.htm +++ /dev/null @@ -1,68 +0,0 @@ - -terminal_interface-curses-forms-field_types-ipv4_address.adb - -

File : terminal_interface-curses-forms-field_types-ipv4_address.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  @Date: 2011/03/19 00:45:37 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Internet_V4_Address_Field)
-   is
-      function Set_Fld_Type (F : Field := Fld)
-                             return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_ipv4");
-
-      Res : Eti_Error;
-   begin
-      Res := Set_Fld_Type;
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm deleted file mode 100644 index 8f9e0510b02..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-ipv4_address__ads.htm +++ /dev/null @@ -1,57 +0,0 @@ - -terminal_interface-curses-forms-field_types-ipv4_address.ads - -

File : terminal_interface-curses-forms-field_types-ipv4_address.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---          Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address        --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
-   pragma Preelaborate
-     (Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address);
-
-   type Internet_V4_Address_Field is new Field_Type with null record;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Internet_V4_Address_Field);
-   pragma Inline (Set_Field_Type);
-
-end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm deleted file mode 100644 index 9b829991ee2..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__adb.htm +++ /dev/null @@ -1,75 +0,0 @@ - -terminal_interface-curses-forms-field_types-numeric.adb - -

File : terminal_interface-curses-forms-field_types-numeric.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---            Terminal_Interface.Curses.Forms.Field_Types.Numeric           --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  @Date: 2011/03/19 00:45:37 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Numeric_Field)
-   is
-      type Double is new Interfaces.C.double;
-
-      function Set_Fld_Type (F    : Field := Fld;
-                             Arg1 : C_Int;
-                             Arg2 : Double;
-                             Arg3 : Double) return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_numeric");
-
-      Res : Eti_Error;
-   begin
-      Res := Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
-                           Arg2 => Double (Typ.Lower_Limit),
-                           Arg3 => Double (Typ.Upper_Limit));
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm deleted file mode 100644 index e3f37a27be0..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-numeric__ads.htm +++ /dev/null @@ -1,61 +0,0 @@ - -terminal_interface-curses-forms-field_types-numeric.ads - -

File : terminal_interface-curses-forms-field_types-numeric.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---             Terminal_Interface.Curses.Forms.Field_Types.Numeric          --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface.Curses.Forms.Field_Types.Numeric is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric);
-
-   type Numeric_Field is new Field_Type with
-      record
-         Precision   : Natural;
-         Lower_Limit : Float;
-         Upper_Limit : Float;
-      end record;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Numeric_Field);
-   pragma Inline (Set_Field_Type);
-
-end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm deleted file mode 100644 index 9d3b1df86e2..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__adb.htm +++ /dev/null @@ -1,73 +0,0 @@ - -terminal_interface-curses-forms-field_types-regexp.adb - -

File : terminal_interface-curses-forms-field_types-regexp.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---             Terminal_Interface.Curses.Forms.Field_Types.RegExp           --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.10 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C; use Interfaces.C;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Regular_Expression_Field)
-   is
-      type Char_Ptr is access all Interfaces.C.char;
-
-      function Set_Ftyp (F    : Field := Fld;
-                         Arg1 : Char_Ptr) return C_Int;
-      pragma Import (C, Set_Ftyp, "set_field_type_regexp");
-
-      Txt : char_array (0 .. Typ.Regular_Expression.all'Length);
-      Len : size_t;
-      Res : Eti_Error;
-   begin
-      To_C (Typ.Regular_Expression.all, Txt, Len);
-      Res := Set_Ftyp (Arg1 => Txt (Txt'First)'Access);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Wrap_Builtin (Fld, Typ);
-   end Set_Field_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm deleted file mode 100644 index dd273dcb161..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-regexp__ads.htm +++ /dev/null @@ -1,61 +0,0 @@ - -terminal_interface-curses-forms-field_types-regexp.ads - -

File : terminal_interface-curses-forms-field_types-regexp.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---              Terminal_Interface.Curses.Forms.Field_Types.RegExp          --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp);
-
-   type String_Access is access String;
-
-   type Regular_Expression_Field is new Field_Type with
-      record
-         Regular_Expression : String_Access;
-      end record;
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : Regular_Expression_Field);
-   pragma Inline (Set_Field_Type);
-
-end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm deleted file mode 100644 index 018a19ddfa6..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__adb.htm +++ /dev/null @@ -1,114 +0,0 @@ - -terminal_interface-curses-forms-field_types-user-choice.adb - -

File : terminal_interface-curses-forms-field_types-user-choice.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---          Terminal_Interface.Curses.Forms.Field_Types.User.Choice         --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2008,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.17 @
---  @Date: 2011/03/22 10:53:37 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with System.Address_To_Access_Conversions;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
-
-   package Argument_Conversions is
-      new System.Address_To_Access_Conversions (Argument);
-
-   function Generic_Next (Fld : Field;
-                          Usr : System.Address) return Curses_Bool
-   is
-      Result : Boolean;
-      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
-        User_Defined_Field_Type_With_Choice_Access
-        (Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ);
-   begin
-      Result := Next (Fld, Udf.all);
-      return Curses_Bool (Boolean'Pos (Result));
-   end Generic_Next;
-
-   function Generic_Prev (Fld : Field;
-                          Usr : System.Address) return Curses_Bool
-   is
-      Result : Boolean;
-      Udf    : constant User_Defined_Field_Type_With_Choice_Access :=
-        User_Defined_Field_Type_With_Choice_Access
-        (Argument_Access (Argument_Conversions.To_Pointer (Usr)).Typ);
-   begin
-      Result := Previous (Fld, Udf.all);
-      return Curses_Bool (Boolean'Pos (Result));
-   end Generic_Prev;
-
-   --  -----------------------------------------------------------------------
-   --
-   function C_Generic_Choice return C_Field_Type
-   is
-      Res : Eti_Error;
-      T   : C_Field_Type;
-   begin
-      if M_Generic_Choice = Null_Field_Type then
-         T := New_Fieldtype (Generic_Field_Check'Access,
-                             Generic_Char_Check'Access);
-         if T = Null_Field_Type then
-            raise Form_Exception;
-         else
-            Res := Set_Fieldtype_Arg (T,
-                                      Make_Arg'Access,
-                                      Copy_Arg'Access,
-                                      Free_Arg'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
-
-            Res := Set_Fieldtype_Choice (T,
-                                         Generic_Next'Access,
-                                         Generic_Prev'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
-         end if;
-         M_Generic_Choice := T;
-      end if;
-      pragma Assert (M_Generic_Choice /= Null_Field_Type);
-      return M_Generic_Choice;
-   end C_Generic_Choice;
-
-end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm deleted file mode 100644 index 1b0d0ffb23a..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm +++ /dev/null @@ -1,100 +0,0 @@ - -terminal_interface-curses-forms-field_types-user-choice.ads - -

File : terminal_interface-curses-forms-field_types-user-choice.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---           Terminal_Interface.Curses.Forms.Field_Types.User.Choice        --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2008,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.14 @
---  @Date: 2011/03/19 12:27:47 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C;
-
-package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
-   pragma Preelaborate
-     (Terminal_Interface.Curses.Forms.Field_Types.User.Choice);
-
-   subtype C_Int is Interfaces.C.int;
-
-   type User_Defined_Field_Type_With_Choice is abstract new
-     User_Defined_Field_Type with null record;
-   --  This is the root of the mechanism we use to create field types in
-   --  Ada95 that allow the prev/next mechanism. You should your own type
-   --  derive from this one and implement the Field_Check, Character_Check
-   --  Next and Previous functions for your own type.
-
-   type User_Defined_Field_Type_With_Choice_Access is access all
-     User_Defined_Field_Type_With_Choice'Class;
-
-   function Next
-     (Fld : Field;
-      Typ : User_Defined_Field_Type_With_Choice) return Boolean
-      is abstract;
-   --  If True is returned, the function successfully generated a next
-   --  value into the fields buffer.
-
-   function Previous
-     (Fld : Field;
-      Typ : User_Defined_Field_Type_With_Choice) return Boolean
-      is abstract;
-   --  If True is returned, the function successfully generated a previous
-   --  value into the fields buffer.
-
-   --  +----------------------------------------------------------------------
-   --  | Private Part.
-   --  |
-private
-   function C_Generic_Choice return C_Field_Type;
-
-   function Generic_Next (Fld : Field;
-                          Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Generic_Next);
-   --  This is the generic next Choice_Function for the low-level fieldtype
-   --  representing all the User_Defined_Field_Type derivatives. It routes
-   --  the call to the Next implementation for the type.
-
-   function Generic_Prev (Fld : Field;
-                          Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Generic_Prev);
-   --  This is the generic prev Choice_Function for the low-level fieldtype
-   --  representing all the User_Defined_Field_Type derivatives. It routes
-   --  the call to the Previous implementation for the type.
-
-end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm deleted file mode 100644 index ed3a5e1baa9..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user__adb.htm +++ /dev/null @@ -1,139 +0,0 @@ - -terminal_interface-curses-forms-field_types-user.adb - -

File : terminal_interface-curses-forms-field_types-user.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---              Terminal_Interface.Curses.Forms.Field_Types.User            --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.21 @
---  @Date: 2011/03/23 00:44:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with System.Address_To_Access_Conversions;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Field_Types.User is
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : User_Defined_Field_Type)
-   is
-      function Allocate_Arg (T : User_Defined_Field_Type'Class)
-                             return Argument_Access;
-
-      function Set_Fld_Type (F    : Field := Fld;
-                             Cft  : C_Field_Type := C_Generic_Type;
-                             Arg1 : Argument_Access)
-                             return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_user");
-
-      Res : Eti_Error;
-
-      function Allocate_Arg (T : User_Defined_Field_Type'Class)
-                             return Argument_Access
-      is
-         Ptr : constant Field_Type_Access
-             := new User_Defined_Field_Type'Class'(T);
-      begin
-         return new Argument'(Usr => System.Null_Address,
-                              Typ => Ptr,
-                              Cft => Null_Field_Type);
-      end Allocate_Arg;
-
-   begin
-      Res := Set_Fld_Type (Arg1 => Allocate_Arg (Typ));
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Field_Type;
-
-   package Argument_Conversions is
-      new System.Address_To_Access_Conversions (Argument);
-
-   function Generic_Field_Check (Fld : Field;
-                                 Usr : System.Address) return Curses_Bool
-   is
-      Result : Boolean;
-      Udf    : constant User_Defined_Field_Type_Access :=
-        User_Defined_Field_Type_Access
-          (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
-   begin
-      Result := Field_Check (Fld, Udf.all);
-      return Curses_Bool (Boolean'Pos (Result));
-   end Generic_Field_Check;
-
-   function Generic_Char_Check (Ch  : C_Int;
-                                Usr : System.Address) return Curses_Bool
-   is
-      Result : Boolean;
-      Udf    : constant User_Defined_Field_Type_Access :=
-        User_Defined_Field_Type_Access
-          (Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
-   begin
-      Result := Character_Check (Character'Val (Ch), Udf.all);
-      return Curses_Bool (Boolean'Pos (Result));
-   end Generic_Char_Check;
-
-   --  -----------------------------------------------------------------------
-   --
-   function C_Generic_Type return C_Field_Type
-   is
-      Res : Eti_Error;
-      T   : C_Field_Type;
-   begin
-      if M_Generic_Type = Null_Field_Type then
-         T := New_Fieldtype (Generic_Field_Check'Access,
-                             Generic_Char_Check'Access);
-         if T = Null_Field_Type then
-            raise Form_Exception;
-         else
-            Res := Set_Fieldtype_Arg (T,
-                                      Make_Arg'Access,
-                                      Copy_Arg'Access,
-                                      Free_Arg'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
-         end if;
-         M_Generic_Type := T;
-      end if;
-      pragma Assert (M_Generic_Type /= Null_Field_Type);
-      return M_Generic_Type;
-   end C_Generic_Type;
-
-end Terminal_Interface.Curses.Forms.Field_Types.User;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm deleted file mode 100644 index 107c8637e45..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types-user__ads.htm +++ /dev/null @@ -1,101 +0,0 @@ - -terminal_interface-curses-forms-field_types-user.ads - -

File : terminal_interface-curses-forms-field_types-user.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Forms.Field_Types.User           --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.15 @
---  @Date: 2011/03/19 12:27:21 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C;
-
-package Terminal_Interface.Curses.Forms.Field_Types.User is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User);
-   subtype C_Int is Interfaces.C.int;
-
-   type User_Defined_Field_Type is abstract new Field_Type with null record;
-   --  This is the root of the mechanism we use to create field types in
-   --  Ada95. You should your own type derive from this one and implement
-   --  the Field_Check and Character_Check functions for your own type.
-
-   type User_Defined_Field_Type_Access is access all
-     User_Defined_Field_Type'Class;
-
-   function Field_Check
-     (Fld : Field;
-      Typ : User_Defined_Field_Type) return Boolean
-      is abstract;
-   --  If True is returned, the field is considered valid, otherwise it is
-   --  invalid.
-
-   function Character_Check
-     (Ch  : Character;
-      Typ : User_Defined_Field_Type) return Boolean
-      is abstract;
-   --  If True is returned, the character is considered as valid for the
-   --  field, otherwise as invalid.
-
-   procedure Set_Field_Type (Fld : Field;
-                             Typ : User_Defined_Field_Type);
-   --  This should work for all types derived from User_Defined_Field_Type.
-   --  No need to reimplement it for your derived type.
-
-   --  +----------------------------------------------------------------------
-   --  | Private Part.
-   --  | Used by the Choice child package.
-private
-   function C_Generic_Type   return C_Field_Type;
-
-   function Generic_Field_Check (Fld : Field;
-                                 Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Generic_Field_Check);
-   --  This is the generic Field_Check_Function for the low-level fieldtype
-   --  representing all the User_Defined_Field_Type derivatives. It routes
-   --  the call to the Field_Check implementation for the type.
-
-   function Generic_Char_Check (Ch  : C_Int;
-                                Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Generic_Char_Check);
-   --  This is the generic Char_Check_Function for the low-level fieldtype
-   --  representing all the User_Defined_Field_Type derivatives. It routes
-   --  the call to the Character_Check implementation for the type.
-
-end Terminal_Interface.Curses.Forms.Field_Types.User;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm deleted file mode 100644 index 2a48f9c5410..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm +++ /dev/null @@ -1,289 +0,0 @@ - -terminal_interface-curses-forms-field_types.adb - -

File : terminal_interface-curses-forms-field_types.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                 Terminal_Interface.Curses.Forms.Field_Types              --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.25 @
---  @Date: 2011/03/22 23:22:27 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-with Ada.Unchecked_Deallocation;
-with System.Address_To_Access_Conversions;
-
---  |
---  |=====================================================================
---  | man page form_fieldtype.3x
---  |=====================================================================
---  |
-package body Terminal_Interface.Curses.Forms.Field_Types is
-
-   use type System.Address;
-
-   package Argument_Conversions is
-      new System.Address_To_Access_Conversions (Argument);
-
-   function Get_Fieldtype (F : Field) return C_Field_Type;
-   pragma Import (C, Get_Fieldtype, "field_type");
-
-   function Get_Arg (F : Field) return System.Address;
-   pragma Import (C, Get_Arg, "field_arg");
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_validation.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   function Get_Type (Fld : Field) return Field_Type_Access
-   is
-      Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
-      Arg : Argument_Access;
-   begin
-      if Low_Level = Null_Field_Type then
-         return null;
-      else
-         if Low_Level = M_Builtin_Router or else
-           Low_Level = M_Generic_Type or else
-           Low_Level = M_Choice_Router or else
-           Low_Level = M_Generic_Choice then
-            Arg := Argument_Access
-         (Argument_Conversions.To_Pointer (Get_Arg (Fld)));
-            if Arg = null then
-               raise Form_Exception;
-            else
-               return Arg.all.Typ;
-            end if;
-         else
-            raise Form_Exception;
-         end if;
-      end if;
-   end Get_Type;
-
-   function Copy_Arg (Usr : System.Address) return System.Address
-   is
-   begin
-      return Usr;
-   end Copy_Arg;
-
-   procedure Free_Arg (Usr : System.Address)
-   is
-      procedure Free_Type is new Ada.Unchecked_Deallocation
-        (Field_Type'Class, Field_Type_Access);
-      procedure Freeargs is new Ada.Unchecked_Deallocation
-        (Argument, Argument_Access);
-
-      To_Be_Free : Argument_Access
-   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
-      Low_Level  : C_Field_Type;
-   begin
-      if To_Be_Free /= null then
-         if To_Be_Free.all.Usr /= System.Null_Address then
-            Low_Level := To_Be_Free.all.Cft;
-            if Low_Level.all.Freearg /= null then
-               Low_Level.all.Freearg (To_Be_Free.all.Usr);
-            end if;
-         end if;
-         if To_Be_Free.all.Typ /= null then
-            Free_Type (To_Be_Free.all.Typ);
-         end if;
-         Freeargs (To_Be_Free);
-      end if;
-   end Free_Arg;
-
-   procedure Wrap_Builtin (Fld : Field;
-                           Typ : Field_Type'Class;
-                           Cft : C_Field_Type := C_Builtin_Router)
-   is
-      Usr_Arg   : constant System.Address := Get_Arg (Fld);
-      Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
-      Arg : Argument_Access;
-      Res : Eti_Error;
-      function Set_Fld_Type (F    : Field := Fld;
-                             Cf   : C_Field_Type := Cft;
-                             Arg1 : Argument_Access) return C_Int;
-      pragma Import (C, Set_Fld_Type, "set_field_type_user");
-
-   begin
-      pragma Assert (Low_Level /= Null_Field_Type);
-      if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then
-         raise Form_Exception;
-      else
-         Arg := new Argument'(Usr => System.Null_Address,
-                              Typ => new Field_Type'Class'(Typ),
-                              Cft => Get_Fieldtype (Fld));
-         if Usr_Arg /= System.Null_Address then
-            if Low_Level.all.Copyarg /= null then
-               Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg);
-            else
-               Arg.all.Usr := Usr_Arg;
-            end if;
-         end if;
-
-         Res := Set_Fld_Type (Arg1 => Arg);
-         if Res /= E_Ok then
-            Eti_Exception (Res);
-         end if;
-      end if;
-   end Wrap_Builtin;
-
-   function Field_Check_Router (Fld : Field;
-                                Usr : System.Address) return Curses_Bool
-   is
-      Arg  : constant Argument_Access
-   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
-   begin
-      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
-                     and then Arg.all.Typ /= null);
-      if Arg.all.Cft.all.Fcheck /= null then
-         return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr);
-      else
-         return 1;
-      end if;
-   end Field_Check_Router;
-
-   function Char_Check_Router (Ch  : C_Int;
-                               Usr : System.Address) return Curses_Bool
-   is
-      Arg  : constant Argument_Access
-   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
-   begin
-      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
-                     and then Arg.all.Typ /= null);
-      if Arg.all.Cft.all.Ccheck /= null then
-         return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr);
-      else
-         return 1;
-      end if;
-   end Char_Check_Router;
-
-   function Next_Router (Fld : Field;
-                         Usr : System.Address) return Curses_Bool
-   is
-      Arg  : constant Argument_Access
-   := Argument_Access (Argument_Conversions.To_Pointer (Usr));
-   begin
-      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
-                     and then Arg.all.Typ /= null);
-      if Arg.all.Cft.all.Next /= null then
-         return Arg.all.Cft.all.Next (Fld, Arg.all.Usr);
-      else
-         return 1;
-      end if;
-   end Next_Router;
-
-   function Prev_Router (Fld : Field;
-                         Usr : System.Address) return Curses_Bool
-   is
-      Arg  : constant Argument_Access :=
-               Argument_Access (Argument_Conversions.To_Pointer (Usr));
-   begin
-      pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
-                     and then Arg.all.Typ /= null);
-      if Arg.all.Cft.all.Prev /= null then
-         return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr);
-      else
-         return 1;
-      end if;
-   end Prev_Router;
-
-   --  -----------------------------------------------------------------------
-   --
-   function C_Builtin_Router return C_Field_Type
-   is
-      Res : Eti_Error;
-      T   : C_Field_Type;
-   begin
-      if M_Builtin_Router = Null_Field_Type then
-         T := New_Fieldtype (Field_Check_Router'Access,
-                             Char_Check_Router'Access);
-         if T = Null_Field_Type then
-            raise Form_Exception;
-         else
-            Res := Set_Fieldtype_Arg (T,
-                                      Make_Arg'Access,
-                                      Copy_Arg'Access,
-                                      Free_Arg'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
-         end if;
-         M_Builtin_Router := T;
-      end if;
-      pragma Assert (M_Builtin_Router /= Null_Field_Type);
-      return M_Builtin_Router;
-   end C_Builtin_Router;
-
-   --  -----------------------------------------------------------------------
-   --
-   function C_Choice_Router return C_Field_Type
-   is
-      Res : Eti_Error;
-      T   : C_Field_Type;
-   begin
-      if M_Choice_Router = Null_Field_Type then
-         T := New_Fieldtype (Field_Check_Router'Access,
-                             Char_Check_Router'Access);
-         if T = Null_Field_Type then
-            raise Form_Exception;
-         else
-            Res := Set_Fieldtype_Arg (T,
-                                      Make_Arg'Access,
-                                      Copy_Arg'Access,
-                                      Free_Arg'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
-
-            Res := Set_Fieldtype_Choice (T,
-                                         Next_Router'Access,
-                                         Prev_Router'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
-         end if;
-         M_Choice_Router := T;
-      end if;
-      pragma Assert (M_Choice_Router /= Null_Field_Type);
-      return M_Choice_Router;
-   end C_Choice_Router;
-
-end Terminal_Interface.Curses.Forms.Field_Types;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm deleted file mode 100644 index 94f90eae8f9..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_types__ads.htm +++ /dev/null @@ -1,245 +0,0 @@ - -terminal_interface-curses-forms-field_types.ads - -

File : terminal_interface-curses-forms-field_types.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                 Terminal_Interface.Curses.Forms.Field_Types              --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.16 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C;
-
-package Terminal_Interface.Curses.Forms.Field_Types is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types);
-   use type Interfaces.C.int;
-   subtype C_Int is Interfaces.C.int;
-
-   --  |=====================================================================
-   --  | Man page form_fieldtype.3x
-   --  |=====================================================================
-
-   type Field_Type is abstract tagged null record;
-   --  Abstract base type for all field types. A concrete field type
-   --  is an extension that adds some data elements describing formats or
-   --  boundary values for the type and validation routines.
-   --  For the builtin low-level fieldtypes, the validation routines are
-   --  already defined by the low-level C library.
-   --  The builtin types like Alpha or AlphaNumeric etc. are defined in
-   --  child packages of this package. You may use one of them as example
-   --  how to create you own child packages for low-level field types that
-   --  you may have already written in C.
-
-   type Field_Type_Access is access all Field_Type'Class;
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Set_Field_Type (Fld      : Field;
-                             Fld_Type : Field_Type) is abstract;
-   --  AKA: set_field_type()
-   --  But: we hide the vararg mechanism of the C interface. You always
-   --       have to pass a single Field_Type parameter.
-
-   --  ---------------------------------------------------------------------
-
-   --  |=====================================================================
-   --  | Man page form_field_validation.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_2"#2|
-   function Get_Type (Fld : Field) return Field_Type_Access;
-   --  AKA: field_type()
-   --  AKA: field_arg()
-   --  In Ada95 we can combine these. If you try to retrieve the field type
-   --  that is not defined as extension of the abstract tagged type above,
-   --  you will raise a Form_Exception.
-   --  This is not inlined
-
-   --  +----------------------------------------------------------------------
-   --  | Private Part.
-   --  | Most of this is used by the implementations of the child packages.
-   --  |
-private
-   type Makearg_Function is access
-     function (Args : System.Address) return System.Address;
-   pragma Convention (C, Makearg_Function);
-
-   type Copyarg_Function is access
-     function (Usr : System.Address) return System.Address;
-   pragma Convention (C, Copyarg_Function);
-
-   type Freearg_Function is access
-     procedure (Usr : System.Address);
-   pragma Convention (C, Freearg_Function);
-
-   type Field_Check_Function is access
-     function (Fld : Field; Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Field_Check_Function);
-
-   type Char_Check_Function is access
-     function (Ch : C_Int; Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Char_Check_Function);
-
-   type Choice_Function is access
-     function (Fld : Field; Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Choice_Function);
-
-   --  +----------------------------------------------------------------------
-   --  | This must be in sync with the FIELDTYPE structure in form.h
-   --  |
-   type Low_Level_Field_Type is
-      record
-         Status :              Interfaces.C.unsigned_short;
-         Ref_Count :           Interfaces.C.long;
-         Left, Right :         System.Address;
-         Makearg :             Makearg_Function;
-         Copyarg :             Copyarg_Function;
-         Freearg :             Freearg_Function;
-         Fcheck :              Field_Check_Function;
-         Ccheck :              Char_Check_Function;
-         Next, Prev :          Choice_Function;
-      end record;
-   pragma Convention (C, Low_Level_Field_Type);
-   type C_Field_Type is access all Low_Level_Field_Type;
-
-   Null_Field_Type   : constant C_Field_Type := null;
-
-   --  +----------------------------------------------------------------------
-   --  | This four low-level fieldtypes are the ones associated with
-   --  | fieldtypes handled by this binding. Any other low-level fieldtype
-   --  | will result in a Form_Exception is function Get_Type.
-   --  |
-   M_Generic_Type   : C_Field_Type := null;
-   M_Generic_Choice : C_Field_Type := null;
-   M_Builtin_Router : C_Field_Type := null;
-   M_Choice_Router  : C_Field_Type := null;
-
-   --  Two wrapper functions to access those low-level fieldtypes defined
-   --  in this package.
-   function C_Builtin_Router return C_Field_Type;
-   function C_Choice_Router  return C_Field_Type;
-
-   procedure Wrap_Builtin (Fld : Field;
-                           Typ : Field_Type'Class;
-                           Cft : C_Field_Type := C_Builtin_Router);
-   --  This procedure has to be called by the Set_Field_Type implementation
-   --  for builtin low-level fieldtypes to replace it by an Ada95
-   --  conformant Field_Type object.
-   --  The parameter Cft must be C_Builtin_Router for regular low-level
-   --  fieldtypes (like TYP_ALPHA or TYP_ALNUM) and C_Choice_Router for
-   --  low-level fieldtypes witch choice functions (like TYP_ENUM).
-   --  Any other value will raise a Form_Exception.
-
-   function Make_Arg (Args : System.Address) return System.Address;
-   pragma Import (C, Make_Arg, "void_star_make_arg");
-   --  This is the Makearg_Function for the internal low-level types
-   --  introduced by this binding.
-
-   function Copy_Arg (Usr : System.Address) return System.Address;
-   pragma Convention (C, Copy_Arg);
-   --  This is the Copyarg_Function for the internal low-level types
-   --  introduced by this binding.
-
-   procedure Free_Arg (Usr : System.Address);
-   pragma Convention (C, Free_Arg);
-   --  This is the Freearg_Function for the internal low-level types
-   --  introduced by this binding.
-
-   function Field_Check_Router (Fld : Field;
-                                Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Field_Check_Router);
-   --  This is the Field_Check_Function for the internal low-level types
-   --  introduced to wrap the low-level types by a Field_Type derived
-   --  type. It routes the call to the corresponding low-level validation
-   --  function.
-
-   function Char_Check_Router (Ch : C_Int;
-                               Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Char_Check_Router);
-   --  This is the Char_Check_Function for the internal low-level types
-   --  introduced to wrap the low-level types by a Field_Type derived
-   --  type. It routes the call to the corresponding low-level validation
-   --  function.
-
-   function Next_Router (Fld : Field;
-                         Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Next_Router);
-   --  This is the Choice_Function for the internal low-level types
-   --  introduced to wrap the low-level types by a Field_Type derived
-   --  type. It routes the call to the corresponding low-level next_choice
-   --  function.
-
-   function Prev_Router (Fld : Field;
-                         Usr : System.Address) return Curses_Bool;
-   pragma Convention (C, Prev_Router);
-   --  This is the Choice_Function for the internal low-level types
-   --  introduced to wrap the low-level types by a Field_Type derived
-   --  type. It routes the call to the corresponding low-level prev_choice
-   --  function.
-
-   --  This is the Argument structure maintained by all low-level field types
-   --  introduced by this binding.
-   type Argument is record
-      Typ : Field_Type_Access;   --  the Field_Type creating this record
-      Usr : System.Address;      --  original arg for builtin low-level types
-      Cft : C_Field_Type;        --  the original low-level type
-   end record;
-   type Argument_Access is access all Argument;
-
-   --  +----------------------------------------------------------------------
-   --  |
-   --  | Some Imports of libform routines to deal with low-level fieldtypes.
-   --  |
-   function New_Fieldtype (Fcheck : Field_Check_Function;
-                           Ccheck : Char_Check_Function)
-     return C_Field_Type;
-   pragma Import (C, New_Fieldtype, "new_fieldtype");
-
-   function Set_Fieldtype_Arg (Cft : C_Field_Type;
-                               Mak : Makearg_Function := Make_Arg'Access;
-                               Cop : Copyarg_Function := Copy_Arg'Access;
-                               Fre : Freearg_Function := Free_Arg'Access)
-     return C_Int;
-   pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg");
-
-   function Set_Fieldtype_Choice (Cft : C_Field_Type;
-                                  Next, Prev : Choice_Function)
-     return C_Int;
-   pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice");
-
-end Terminal_Interface.Curses.Forms.Field_Types;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm deleted file mode 100644 index a04a469fec1..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_user_data__adb.htm +++ /dev/null @@ -1,91 +0,0 @@ - -terminal_interface-curses-forms-field_user_data.adb - -

File : terminal_interface-curses-forms-field_user_data.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Forms.Field_User_Data            --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.13 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use  Terminal_Interface.Curses.Aux;
-
---  |
---  |=====================================================================
---  | man page form_field_userptr.3x
---  |=====================================================================
---  |
-package body Terminal_Interface.Curses.Forms.Field_User_Data is
-   --  |
-   --  |
-   --  |
-   use type Interfaces.C.int;
-
-   procedure Set_User_Data (Fld  : Field;
-                            Data : User_Access)
-   is
-      function Set_Field_Userptr (Fld : Field;
-                                  Usr : User_Access) return C_Int;
-      pragma Import (C, Set_Field_Userptr, "set_field_userptr");
-
-      Res : constant Eti_Error := Set_Field_Userptr (Fld, Data);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_User_Data;
-   --  |
-   --  |
-   --  |
-   function Get_User_Data (Fld  : Field) return User_Access
-   is
-      function Field_Userptr (Fld : Field) return User_Access;
-      pragma Import (C, Field_Userptr, "field_userptr");
-   begin
-      return Field_Userptr (Fld);
-   end Get_User_Data;
-
-   procedure Get_User_Data (Fld  : Field;
-                            Data : out User_Access)
-   is
-   begin
-      Data := Get_User_Data (Fld);
-   end Get_User_Data;
-
-end Terminal_Interface.Curses.Forms.Field_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm deleted file mode 100644 index 072378017b0..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-field_user_data__ads.htm +++ /dev/null @@ -1,75 +0,0 @@ - -terminal_interface-curses-forms-field_user_data.ads - -

File : terminal_interface-curses-forms-field_user_data.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Forms.Field_User_Data            --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.16 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-generic
-   type User is limited private;
-   type User_Access is access User;
-package Terminal_Interface.Curses.Forms.Field_User_Data is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data);
-
-   --  |=====================================================================
-   --  | Man page form_field_userptr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Set_User_Data (Fld  : Field;
-                            Data : User_Access);
-   --  AKA: set_field_userptr
-   pragma Inline (Set_User_Data);
-
-   --  #1A NAME="AFU_2"#2|
-   procedure Get_User_Data (Fld  : Field;
-                            Data : out User_Access);
-   --  AKA: field_userptr
-
-   --  #1A NAME="AFU_3"#2|
-   function Get_User_Data (Fld  : Field) return User_Access;
-   --  AKA: field_userptr
-   --  Sama as function
-   pragma Inline (Get_User_Data);
-
-end Terminal_Interface.Curses.Forms.Field_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm deleted file mode 100644 index 3b91c7b9636..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-form_user_data__adb.htm +++ /dev/null @@ -1,92 +0,0 @@ - -terminal_interface-curses-forms-form_user_data.adb - -

File : terminal_interface-curses-forms-form_user_data.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                Terminal_Interface.Curses.Forms.Form_User_Data            --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.13 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
---  |
---  |=====================================================================
---  | man page form__userptr.3x
---  |=====================================================================
---  |
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms.Form_User_Data is
-
-   use type Interfaces.C.int;
-
-   --  |
-   --  |
-   --  |
-   procedure Set_User_Data (Frm  : Form;
-                            Data : User_Access)
-   is
-      function Set_Form_Userptr (Frm  : Form;
-                                 Data : User_Access)  return C_Int;
-      pragma Import (C, Set_Form_Userptr, "set_form_userptr");
-
-      Res : constant Eti_Error := Set_Form_Userptr (Frm, Data);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_User_Data;
-   --  |
-   --  |
-   --  |
-   function Get_User_Data (Frm  : Form) return User_Access
-   is
-      function Form_Userptr (Frm : Form) return User_Access;
-      pragma Import (C, Form_Userptr, "form_userptr");
-   begin
-      return Form_Userptr (Frm);
-   end Get_User_Data;
-
-   procedure Get_User_Data (Frm  : Form;
-                            Data : out User_Access)
-   is
-   begin
-      Data := Get_User_Data (Frm);
-   end Get_User_Data;
-
-end Terminal_Interface.Curses.Forms.Form_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm deleted file mode 100644 index bc0be4c0c3c..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms-form_user_data__ads.htm +++ /dev/null @@ -1,75 +0,0 @@ - -terminal_interface-curses-forms-form_user_data.ads - -

File : terminal_interface-curses-forms-form_user_data.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                Terminal_Interface.Curses.Forms.Form_User_Data            --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.15 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-generic
-   type User is limited private;
-   type User_Access is access User;
-package Terminal_Interface.Curses.Forms.Form_User_Data is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms.Form_User_Data);
-
-   --  |=====================================================================
-   --  | Man page form_userptr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Set_User_Data (Frm  : Form;
-                            Data : User_Access);
-   --  AKA: set_form_userptr
-   pragma Inline (Set_User_Data);
-
-   --  #1A NAME="AFU_2"#2|
-   procedure Get_User_Data (Frm  : Form;
-                            Data : out User_Access);
-   --  AKA: form_userptr
-
-   --  #1A NAME="AFU_3"#2|
-   function Get_User_Data (Frm  : Form) return User_Access;
-   --  AKA: form_userptr
-   --  Same as function
-   pragma Inline (Get_User_Data);
-
-end Terminal_Interface.Curses.Forms.Form_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms__adb.htm b/doc/html/ada/terminal_interface-curses-forms__adb.htm deleted file mode 100644 index 007b21ba739..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms__adb.htm +++ /dev/null @@ -1,1167 +0,0 @@ - -terminal_interface-curses-forms.adb - -

File : terminal_interface-curses-forms.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Forms                     --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.28 @
---  @Date: 2011/03/22 23:37:32 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Unchecked_Deallocation;
-with Ada.Unchecked_Conversion;
-
-with Interfaces.C; use Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Interfaces.C.Pointers;
-
-with Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Forms is
-
-   use Terminal_Interface.Curses.Aux;
-
-   type C_Field_Array is array (Natural range <>) of aliased Field;
-   package F_Array is new
-     Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field);
-
-------------------------------------------------------------------------------
-   --  |
-   --  |
-   --  |
-   --  subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
-
-   function FOS_2_CInt is new
-     Ada.Unchecked_Conversion (Field_Option_Set,
-                               C_Int);
-
-   function CInt_2_FOS is new
-     Ada.Unchecked_Conversion (C_Int,
-                               Field_Option_Set);
-
-   function FrmOS_2_CInt is new
-     Ada.Unchecked_Conversion (Form_Option_Set,
-                               C_Int);
-
-   function CInt_2_FrmOS is new
-     Ada.Unchecked_Conversion (C_Int,
-                               Form_Option_Set);
-
-   procedure Request_Name (Key  : Form_Request_Code;
-                                Name : out String)
-   is
-      function Form_Request_Name (Key : C_Int) return chars_ptr;
-      pragma Import (C, Form_Request_Name, "form_request_name");
-   begin
-      Fill_String (Form_Request_Name (C_Int (Key)), Name);
-   end Request_Name;
-
-   function Request_Name (Key : Form_Request_Code) return String
-   is
-      function Form_Request_Name (Key : C_Int) return chars_ptr;
-      pragma Import (C, Form_Request_Name, "form_request_name");
-   begin
-      return Fill_String (Form_Request_Name (C_Int (Key)));
-   end Request_Name;
-------------------------------------------------------------------------------
-   --  |
-   --  |
-   --  |
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_new.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   function Create (Height       : Line_Count;
-                    Width        : Column_Count;
-                    Top          : Line_Position;
-                    Left         : Column_Position;
-                    Off_Screen   : Natural := 0;
-                    More_Buffers : Buffer_Number := Buffer_Number'First)
-                    return Field
-   is
-      function Newfield (H, W, T, L, O, M : C_Int) return Field;
-      pragma Import (C, Newfield, "new_field");
-      Fld : constant Field := Newfield (C_Int (Height), C_Int (Width),
-                                        C_Int (Top), C_Int (Left),
-                                        C_Int (Off_Screen),
-                                        C_Int (More_Buffers));
-   begin
-      if Fld = Null_Field then
-         raise Form_Exception;
-      end if;
-      return Fld;
-   end Create;
---  |
---  |
---  |
-   procedure Delete (Fld : in out Field)
-   is
-      function Free_Field (Fld : Field) return C_Int;
-      pragma Import (C, Free_Field, "free_field");
-
-      Res : Eti_Error;
-   begin
-      Res := Free_Field (Fld);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Fld := Null_Field;
-   end Delete;
-   --  |
-   --  |
-   --  |
-   function Duplicate (Fld  : Field;
-                       Top  : Line_Position;
-                       Left : Column_Position) return Field
-   is
-      function Dup_Field (Fld  : Field;
-                          Top  : C_Int;
-                          Left : C_Int) return Field;
-      pragma Import (C, Dup_Field, "dup_field");
-
-      F : constant Field := Dup_Field (Fld,
-                                       C_Int (Top),
-                                       C_Int (Left));
-   begin
-      if F = Null_Field then
-         raise Form_Exception;
-      end if;
-      return F;
-   end Duplicate;
-   --  |
-   --  |
-   --  |
-   function Link (Fld  : Field;
-                  Top  : Line_Position;
-                  Left : Column_Position) return Field
-   is
-      function Lnk_Field (Fld  : Field;
-                          Top  : C_Int;
-                          Left : C_Int) return Field;
-      pragma Import (C, Lnk_Field, "link_field");
-
-      F : constant Field := Lnk_Field (Fld,
-                                       C_Int (Top),
-                                       C_Int (Left));
-   begin
-      if F = Null_Field then
-         raise Form_Exception;
-      end if;
-      return F;
-   end Link;
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_just.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Justification (Fld  : Field;
-                                Just : Field_Justification := None)
-   is
-      function Set_Field_Just (Fld  : Field;
-                               Just : C_Int) return C_Int;
-      pragma Import (C, Set_Field_Just, "set_field_just");
-
-      Res : constant Eti_Error :=
-        Set_Field_Just (Fld,
-                        C_Int (Field_Justification'Pos (Just)));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Justification;
-   --  |
-   --  |
-   --  |
-   function Get_Justification (Fld : Field) return Field_Justification
-   is
-      function Field_Just (Fld : Field) return C_Int;
-      pragma Import (C, Field_Just, "field_just");
-   begin
-      return Field_Justification'Val (Field_Just (Fld));
-   end Get_Justification;
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_buffer.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Buffer
-     (Fld    : Field;
-      Buffer : Buffer_Number := Buffer_Number'First;
-      Str    : String)
-   is
-      type Char_Ptr is access all Interfaces.C.char;
-      function Set_Fld_Buffer (Fld    : Field;
-                                 Bufnum : C_Int;
-                                 S      : Char_Ptr)
-        return C_Int;
-      pragma Import (C, Set_Fld_Buffer, "set_field_buffer");
-
-      Txt : char_array (0 .. Str'Length);
-      Len : size_t;
-      Res : Eti_Error;
-   begin
-      To_C (Str, Txt, Len);
-      Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Buffer;
-   --  |
-   --  |
-   --  |
-   procedure Get_Buffer
-     (Fld    : Field;
-      Buffer : Buffer_Number := Buffer_Number'First;
-      Str    : out String)
-   is
-      function Field_Buffer (Fld : Field;
-                             B   : C_Int) return chars_ptr;
-      pragma Import (C, Field_Buffer, "field_buffer");
-   begin
-      Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str);
-   end Get_Buffer;
-
-   function Get_Buffer
-     (Fld    : Field;
-      Buffer : Buffer_Number := Buffer_Number'First) return String
-   is
-      function Field_Buffer (Fld : Field;
-                             B   : C_Int) return chars_ptr;
-      pragma Import (C, Field_Buffer, "field_buffer");
-   begin
-      return Fill_String (Field_Buffer (Fld, C_Int (Buffer)));
-   end Get_Buffer;
-   --  |
-   --  |
-   --  |
-   procedure Set_Status (Fld    : Field;
-                         Status : Boolean := True)
-   is
-      function Set_Fld_Status (Fld : Field;
-                               St  : C_Int) return C_Int;
-      pragma Import (C, Set_Fld_Status, "set_field_status");
-
-      Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status));
-   begin
-      if Res /= E_Ok then
-         raise Form_Exception;
-      end if;
-   end Set_Status;
-   --  |
-   --  |
-   --  |
-   function Changed (Fld : Field) return Boolean
-   is
-      function Field_Status (Fld : Field) return C_Int;
-      pragma Import (C, Field_Status, "field_status");
-
-      Res : constant C_Int := Field_Status (Fld);
-   begin
-      if Res = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Changed;
-   --  |
-   --  |
-   --  |
-   procedure Set_Maximum_Size (Fld : Field;
-                               Max : Natural := 0)
-   is
-      function Set_Field_Max (Fld : Field;
-                              M   : C_Int) return C_Int;
-      pragma Import (C, Set_Field_Max, "set_max_field");
-
-      Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Maximum_Size;
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_opts.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Options (Fld     : Field;
-                          Options : Field_Option_Set)
-   is
-      function Set_Field_Opts (Fld : Field;
-                               Opt : C_Int) return C_Int;
-      pragma Import (C, Set_Field_Opts, "set_field_opts");
-
-      Opt : constant C_Int := FOS_2_CInt (Options);
-      Res : Eti_Error;
-   begin
-      Res := Set_Field_Opts (Fld, Opt);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Options;
-   --  |
-   --  |
-   --  |
-   procedure Switch_Options (Fld     : Field;
-                             Options : Field_Option_Set;
-                             On      : Boolean := True)
-   is
-      function Field_Opts_On (Fld : Field;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Field_Opts_On, "field_opts_on");
-      function Field_Opts_Off (Fld : Field;
-                               Opt : C_Int) return C_Int;
-      pragma Import (C, Field_Opts_Off, "field_opts_off");
-
-      Err : Eti_Error;
-      Opt : constant C_Int := FOS_2_CInt (Options);
-   begin
-      if On then
-         Err := Field_Opts_On (Fld, Opt);
-      else
-         Err := Field_Opts_Off (Fld, Opt);
-      end if;
-      if Err /= E_Ok then
-         Eti_Exception (Err);
-      end if;
-   end Switch_Options;
-   --  |
-   --  |
-   --  |
-   procedure Get_Options (Fld     : Field;
-                          Options : out Field_Option_Set)
-   is
-      function Field_Opts (Fld : Field) return C_Int;
-      pragma Import (C, Field_Opts, "field_opts");
-
-      Res : constant C_Int := Field_Opts (Fld);
-   begin
-      Options := CInt_2_FOS (Res);
-   end Get_Options;
-   --  |
-   --  |
-   --  |
-   function Get_Options (Fld : Field := Null_Field)
-                         return Field_Option_Set
-   is
-      Fos : Field_Option_Set;
-   begin
-      Get_Options (Fld, Fos);
-      return Fos;
-   end Get_Options;
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_attributes.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Foreground
-     (Fld   : Field;
-      Fore  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Set_Field_Fore (Fld  : Field;
-                               Attr : C_Chtype) return C_Int;
-      pragma Import (C, Set_Field_Fore, "set_field_fore");
-
-      Ch : constant Attributed_Character := (Ch    => Character'First,
-                                             Color => Color,
-                                             Attr  => Fore);
-      Res : constant Eti_Error :=
-        Set_Field_Fore (Fld, AttrChar_To_Chtype (Ch));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Foreground;
-   --  |
-   --  |
-   --  |
-   procedure Foreground (Fld  : Field;
-                         Fore : out Character_Attribute_Set)
-   is
-      function Field_Fore (Fld : Field) return C_Chtype;
-      pragma Import (C, Field_Fore, "field_fore");
-   begin
-      Fore := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
-   end Foreground;
-
-   procedure Foreground (Fld   : Field;
-                         Fore  : out Character_Attribute_Set;
-                         Color : out Color_Pair)
-   is
-      function Field_Fore (Fld : Field) return C_Chtype;
-      pragma Import (C, Field_Fore, "field_fore");
-   begin
-      Fore  := Chtype_To_AttrChar (Field_Fore (Fld)).Attr;
-      Color := Chtype_To_AttrChar (Field_Fore (Fld)).Color;
-   end Foreground;
-   --  |
-   --  |
-   --  |
-   procedure Set_Background
-     (Fld   : Field;
-      Back  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Set_Field_Back (Fld  : Field;
-                               Attr : C_Chtype) return C_Int;
-      pragma Import (C, Set_Field_Back, "set_field_back");
-
-      Ch : constant Attributed_Character := (Ch    => Character'First,
-                                             Color => Color,
-                                             Attr  => Back);
-      Res : constant Eti_Error :=
-        Set_Field_Back (Fld, AttrChar_To_Chtype (Ch));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Background;
-   --  |
-   --  |
-   --  |
-   procedure Background (Fld  : Field;
-                         Back : out Character_Attribute_Set)
-   is
-      function Field_Back (Fld : Field) return C_Chtype;
-      pragma Import (C, Field_Back, "field_back");
-   begin
-      Back := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
-   end Background;
-
-   procedure Background (Fld   : Field;
-                         Back  : out Character_Attribute_Set;
-                         Color : out Color_Pair)
-   is
-      function Field_Back (Fld : Field) return C_Chtype;
-      pragma Import (C, Field_Back, "field_back");
-   begin
-      Back  := Chtype_To_AttrChar (Field_Back (Fld)).Attr;
-      Color := Chtype_To_AttrChar (Field_Back (Fld)).Color;
-   end Background;
-   --  |
-   --  |
-   --  |
-   procedure Set_Pad_Character (Fld : Field;
-                                Pad : Character := Space)
-   is
-      function Set_Field_Pad (Fld : Field;
-                              Ch  : C_Int) return C_Int;
-      pragma Import (C, Set_Field_Pad, "set_field_pad");
-
-      Res : constant Eti_Error := Set_Field_Pad (Fld,
-                                                 C_Int (Character'Pos (Pad)));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Pad_Character;
-   --  |
-   --  |
-   --  |
-   procedure Pad_Character (Fld : Field;
-                            Pad : out Character)
-   is
-      function Field_Pad (Fld : Field) return C_Int;
-      pragma Import (C, Field_Pad, "field_pad");
-   begin
-      Pad := Character'Val (Field_Pad (Fld));
-   end Pad_Character;
-   --  |
-   --  |=====================================================================
-   --  | man page form_field_info.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Info (Fld                : Field;
-                   Lines              : out Line_Count;
-                   Columns            : out Column_Count;
-                   First_Row          : out Line_Position;
-                   First_Column       : out Column_Position;
-                   Off_Screen         : out Natural;
-                   Additional_Buffers : out Buffer_Number)
-   is
-      type C_Int_Access is access all C_Int;
-      function Fld_Info (Fld : Field;
-                         L, C, Fr, Fc, Os, Ab : C_Int_Access)
-                         return C_Int;
-      pragma Import (C, Fld_Info, "field_info");
-
-      L, C, Fr, Fc, Os, Ab : aliased C_Int;
-      Res : constant Eti_Error := Fld_Info (Fld,
-                                            L'Access, C'Access,
-                                            Fr'Access, Fc'Access,
-                                            Os'Access, Ab'Access);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      else
-         Lines              := Line_Count (L);
-         Columns            := Column_Count (C);
-         First_Row          := Line_Position (Fr);
-         First_Column       := Column_Position (Fc);
-         Off_Screen         := Natural (Os);
-         Additional_Buffers := Buffer_Number (Ab);
-      end if;
-   end Info;
---  |
---  |
---  |
-   procedure Dynamic_Info (Fld     : Field;
-                           Lines   : out Line_Count;
-                           Columns : out Column_Count;
-                           Max     : out Natural)
-   is
-      type C_Int_Access is access all C_Int;
-      function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int;
-      pragma Import (C, Dyn_Info, "dynamic_field_info");
-
-      L, C, M : aliased C_Int;
-      Res : constant Eti_Error := Dyn_Info (Fld,
-                                            L'Access, C'Access,
-                                            M'Access);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      else
-         Lines   := Line_Count (L);
-         Columns := Column_Count (C);
-         Max     := Natural (M);
-      end if;
-   end Dynamic_Info;
-   --  |
-   --  |=====================================================================
-   --  | man page form_win.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Window (Frm : Form;
-                         Win : Window)
-   is
-      function Set_Form_Win (Frm : Form;
-                             Win : Window) return C_Int;
-      pragma Import (C, Set_Form_Win, "set_form_win");
-
-      Res : constant Eti_Error := Set_Form_Win (Frm, Win);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Window;
-   --  |
-   --  |
-   --  |
-   function Get_Window (Frm : Form) return Window
-   is
-      function Form_Win (Frm : Form) return Window;
-      pragma Import (C, Form_Win, "form_win");
-
-      W : constant Window := Form_Win (Frm);
-   begin
-      return W;
-   end Get_Window;
-   --  |
-   --  |
-   --  |
-   procedure Set_Sub_Window (Frm : Form;
-                             Win : Window)
-   is
-      function Set_Form_Sub (Frm : Form;
-                             Win : Window) return C_Int;
-      pragma Import (C, Set_Form_Sub, "set_form_sub");
-
-      Res : constant Eti_Error := Set_Form_Sub (Frm, Win);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Sub_Window;
-   --  |
-   --  |
-   --  |
-   function Get_Sub_Window (Frm : Form) return Window
-   is
-      function Form_Sub (Frm : Form) return Window;
-      pragma Import (C, Form_Sub, "form_sub");
-
-      W : constant Window := Form_Sub (Frm);
-   begin
-      return W;
-   end Get_Sub_Window;
-   --  |
-   --  |
-   --  |
-   procedure Scale (Frm     : Form;
-                    Lines   : out Line_Count;
-                    Columns : out Column_Count)
-   is
-      type C_Int_Access is access all C_Int;
-      function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int;
-      pragma Import (C, M_Scale, "scale_form");
-
-      X, Y : aliased C_Int;
-      Res  : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Lines := Line_Count (Y);
-      Columns := Column_Count (X);
-   end Scale;
-   --  |
-   --  |=====================================================================
-   --  | man page menu_hook.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Field_Init_Hook (Frm  : Form;
-                                  Proc : Form_Hook_Function)
-   is
-      function Set_Field_Init (Frm  : Form;
-                               Proc : Form_Hook_Function) return C_Int;
-      pragma Import (C, Set_Field_Init, "set_field_init");
-
-      Res : constant Eti_Error := Set_Field_Init (Frm, Proc);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Field_Init_Hook;
-   --  |
-   --  |
-   --  |
-   procedure Set_Field_Term_Hook (Frm  : Form;
-                                  Proc : Form_Hook_Function)
-   is
-      function Set_Field_Term (Frm  : Form;
-                               Proc : Form_Hook_Function) return C_Int;
-      pragma Import (C, Set_Field_Term, "set_field_term");
-
-      Res : constant Eti_Error := Set_Field_Term (Frm, Proc);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Field_Term_Hook;
-   --  |
-   --  |
-   --  |
-   procedure Set_Form_Init_Hook (Frm  : Form;
-                                 Proc : Form_Hook_Function)
-   is
-      function Set_Form_Init (Frm  : Form;
-                              Proc : Form_Hook_Function) return C_Int;
-      pragma Import (C, Set_Form_Init, "set_form_init");
-
-      Res : constant Eti_Error := Set_Form_Init (Frm, Proc);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Form_Init_Hook;
-   --  |
-   --  |
-   --  |
-   procedure Set_Form_Term_Hook (Frm  : Form;
-                                 Proc : Form_Hook_Function)
-   is
-      function Set_Form_Term (Frm  : Form;
-                              Proc : Form_Hook_Function) return C_Int;
-      pragma Import (C, Set_Form_Term, "set_form_term");
-
-      Res : constant Eti_Error := Set_Form_Term (Frm, Proc);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Form_Term_Hook;
-   --  |
-   --  |=====================================================================
-   --  | man page form_fields.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Redefine (Frm  : Form;
-                       Flds : Field_Array_Access)
-   is
-      function Set_Frm_Fields (Frm   : Form;
-                               Items : System.Address) return C_Int;
-      pragma Import (C, Set_Frm_Fields, "set_form_fields");
-
-      Res : Eti_Error;
-   begin
-      pragma Assert (Flds.all (Flds'Last) = Null_Field);
-      if Flds.all (Flds'Last) /= Null_Field then
-         raise Form_Exception;
-      else
-         Res := Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address);
-         if  Res /= E_Ok then
-            Eti_Exception (Res);
-         end if;
-      end if;
-   end Redefine;
-   --  |
-   --  |
-   --  |
-   function Fields (Frm   : Form;
-                    Index : Positive) return Field
-   is
-      use F_Array;
-
-      function C_Fields (Frm : Form) return Pointer;
-      pragma Import (C, C_Fields, "form_fields");
-
-      P : Pointer := C_Fields (Frm);
-   begin
-      if P = null or else Index > Field_Count (Frm) then
-         raise Form_Exception;
-      else
-         P := P + ptrdiff_t (C_Int (Index) - 1);
-         return P.all;
-      end if;
-   end Fields;
-   --  |
-   --  |
-   --  |
-   function Field_Count (Frm : Form) return Natural
-   is
-      function Count (Frm : Form) return C_Int;
-      pragma Import (C, Count, "field_count");
-   begin
-      return Natural (Count (Frm));
-   end Field_Count;
-   --  |
-   --  |
-   --  |
-   procedure Move (Fld    : Field;
-                   Line   : Line_Position;
-                   Column : Column_Position)
-   is
-      function Move (Fld : Field; L, C : C_Int) return C_Int;
-      pragma Import (C, Move, "move_field");
-
-      Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Move;
-   --  |
-   --  |=====================================================================
-   --  | man page form_new.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   function Create (Fields : Field_Array_Access) return Form
-   is
-      function NewForm (Fields : System.Address) return Form;
-      pragma Import (C, NewForm, "new_form");
-
-      M   : Form;
-   begin
-      pragma Assert (Fields.all (Fields'Last) = Null_Field);
-      if Fields.all (Fields'Last) /= Null_Field then
-         raise Form_Exception;
-      else
-         M := NewForm (Fields.all (Fields'First)'Address);
-         if M = Null_Form then
-            raise Form_Exception;
-         end if;
-         return M;
-      end if;
-   end Create;
-   --  |
-   --  |
-   --  |
-   procedure Delete (Frm : in out Form)
-   is
-      function Free (Frm : Form) return C_Int;
-      pragma Import (C, Free, "free_form");
-
-      Res : constant Eti_Error := Free (Frm);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Frm := Null_Form;
-   end Delete;
-   --  |
-   --  |=====================================================================
-   --  | man page form_opts.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Options (Frm     : Form;
-                          Options : Form_Option_Set)
-   is
-      function Set_Form_Opts (Frm : Form;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Set_Form_Opts, "set_form_opts");
-
-      Opt : constant C_Int := FrmOS_2_CInt (Options);
-      Res : Eti_Error;
-   begin
-      Res := Set_Form_Opts (Frm, Opt);
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Options;
-   --  |
-   --  |
-   --  |
-   procedure Switch_Options (Frm     : Form;
-                             Options : Form_Option_Set;
-                             On      : Boolean := True)
-   is
-      function Form_Opts_On (Frm : Form;
-                             Opt : C_Int) return C_Int;
-      pragma Import (C, Form_Opts_On, "form_opts_on");
-      function Form_Opts_Off (Frm : Form;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Form_Opts_Off, "form_opts_off");
-
-      Err : Eti_Error;
-      Opt : constant C_Int := FrmOS_2_CInt (Options);
-   begin
-      if On then
-         Err := Form_Opts_On (Frm, Opt);
-      else
-         Err := Form_Opts_Off (Frm, Opt);
-      end if;
-      if Err /= E_Ok then
-         Eti_Exception (Err);
-      end if;
-   end Switch_Options;
-   --  |
-   --  |
-   --  |
-   procedure Get_Options (Frm     : Form;
-                          Options : out Form_Option_Set)
-   is
-      function Form_Opts (Frm : Form) return C_Int;
-      pragma Import (C, Form_Opts, "form_opts");
-
-      Res : constant C_Int := Form_Opts (Frm);
-   begin
-      Options := CInt_2_FrmOS (Res);
-   end Get_Options;
-   --  |
-   --  |
-   --  |
-   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set
-   is
-      Fos : Form_Option_Set;
-   begin
-      Get_Options (Frm, Fos);
-      return Fos;
-   end Get_Options;
-   --  |
-   --  |=====================================================================
-   --  | man page form_post.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Post (Frm  : Form;
-                   Post : Boolean := True)
-   is
-      function M_Post (Frm : Form) return C_Int;
-      pragma Import (C, M_Post, "post_form");
-      function M_Unpost (Frm : Form) return C_Int;
-      pragma Import (C, M_Unpost, "unpost_form");
-
-      Res : Eti_Error;
-   begin
-      if Post then
-         Res := M_Post (Frm);
-      else
-         Res := M_Unpost (Frm);
-      end if;
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Post;
-   --  |
-   --  |=====================================================================
-   --  | man page form_cursor.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Position_Cursor (Frm : Form)
-   is
-      function Pos_Form_Cursor (Frm : Form) return C_Int;
-      pragma Import (C, Pos_Form_Cursor, "pos_form_cursor");
-
-      Res : constant Eti_Error := Pos_Form_Cursor (Frm);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Position_Cursor;
-   --  |
-   --  |=====================================================================
-   --  | man page form_data.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   function Data_Ahead (Frm : Form) return Boolean
-   is
-      function Ahead (Frm : Form) return C_Int;
-      pragma Import (C, Ahead, "data_ahead");
-
-      Res : constant C_Int := Ahead (Frm);
-   begin
-      if Res = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Data_Ahead;
-   --  |
-   --  |
-   --  |
-   function Data_Behind (Frm : Form) return Boolean
-   is
-      function Behind (Frm : Form) return C_Int;
-      pragma Import (C, Behind, "data_behind");
-
-      Res : constant C_Int := Behind (Frm);
-   begin
-      if Res = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Data_Behind;
-   --  |
-   --  |=====================================================================
-   --  | man page form_driver.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   function Driver (Frm : Form;
-                    Key : Key_Code) return Driver_Result
-   is
-      function Frm_Driver (Frm : Form; Key : C_Int) return C_Int;
-      pragma Import (C, Frm_Driver, "form_driver");
-
-      R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key));
-   begin
-      if R /= E_Ok then
-         if R = E_Unknown_Command then
-            return Unknown_Request;
-         elsif R = E_Invalid_Field then
-            return Invalid_Field;
-         elsif R = E_Request_Denied then
-            return Request_Denied;
-         else
-            Eti_Exception (R);
-            return Form_Ok;
-         end if;
-      else
-         return Form_Ok;
-      end if;
-   end Driver;
-   --  |
-   --  |=====================================================================
-   --  | man page form_page.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_Current (Frm : Form;
-                          Fld : Field)
-   is
-      function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int;
-      pragma Import (C, Set_Current_Fld, "set_current_field");
-
-      Res : constant Eti_Error := Set_Current_Fld (Frm, Fld);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Current;
-   --  |
-   --  |
-   --  |
-   function Current (Frm : Form) return Field
-   is
-      function Current_Fld (Frm : Form) return Field;
-      pragma Import (C, Current_Fld, "current_field");
-
-      Fld : constant Field := Current_Fld (Frm);
-   begin
-      if Fld = Null_Field then
-         raise Form_Exception;
-      end if;
-      return Fld;
-   end Current;
-   --  |
-   --  |
-   --  |
-   procedure Set_Page (Frm  : Form;
-                       Page : Page_Number := Page_Number'First)
-   is
-      function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int;
-      pragma Import (C, Set_Frm_Page, "set_form_page");
-
-      Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Page;
-   --  |
-   --  |
-   --  |
-   function Page (Frm : Form) return Page_Number
-   is
-      function Get_Page (Frm : Form) return C_Int;
-      pragma Import (C, Get_Page, "form_page");
-
-      P : constant C_Int := Get_Page (Frm);
-   begin
-      if P < 0 then
-         raise Form_Exception;
-      else
-         return Page_Number (P);
-      end if;
-   end Page;
-
-   function Get_Index (Fld : Field) return Positive
-   is
-      function Get_Fieldindex (Fld : Field) return C_Int;
-      pragma Import (C, Get_Fieldindex, "field_index");
-
-      Res : constant C_Int := Get_Fieldindex (Fld);
-   begin
-      if Res = Curses_Err then
-         raise Form_Exception;
-      end if;
-      return Positive (Natural (Res) + Positive'First);
-   end Get_Index;
-
-   --  |
-   --  |=====================================================================
-   --  | man page form_new_page.3x
-   --  |=====================================================================
-   --  |
-   --  |
-   --  |
-   procedure Set_New_Page (Fld      : Field;
-                           New_Page : Boolean := True)
-   is
-      function Set_Page (Fld : Field; Flg : C_Int) return C_Int;
-      pragma Import (C, Set_Page, "set_new_page");
-
-      Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_New_Page;
-   --  |
-   --  |
-   --  |
-   function Is_New_Page (Fld : Field) return Boolean
-   is
-      function Is_New (Fld : Field) return C_Int;
-      pragma Import (C, Is_New, "new_page");
-
-      Res : constant C_Int := Is_New (Fld);
-   begin
-      if Res = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Is_New_Page;
-
-   procedure Free (FA          : in out Field_Array_Access;
-                   Free_Fields : Boolean := False)
-   is
-      procedure Release is new Ada.Unchecked_Deallocation
-        (Field_Array, Field_Array_Access);
-   begin
-      if FA /= null and then Free_Fields then
-         for I in FA'First .. (FA'Last - 1) loop
-            if FA.all (I) /= Null_Field then
-               Delete (FA.all (I));
-            end if;
-         end loop;
-      end if;
-      Release (FA);
-   end Free;
-
-   --  |=====================================================================
-
-   function Default_Field_Options return Field_Option_Set
-   is
-   begin
-      return Get_Options (Null_Field);
-   end Default_Field_Options;
-
-   function Default_Form_Options return Form_Option_Set
-   is
-   begin
-      return Get_Options (Null_Form);
-   end Default_Form_Options;
-
-end Terminal_Interface.Curses.Forms;
-
diff --git a/doc/html/ada/terminal_interface-curses-forms__ads.htm b/doc/html/ada/terminal_interface-curses-forms__ads.htm deleted file mode 100644 index a899c5d067d..00000000000 --- a/doc/html/ada/terminal_interface-curses-forms__ads.htm +++ /dev/null @@ -1,790 +0,0 @@ - -terminal_interface-curses-forms.ads - -

File : terminal_interface-curses-forms.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Form                      --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.30 @
---  @Date: 2009/12/26 17:31:35 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
---  form binding.
---  This module is generated. Please don't change it manually!
---  Run the generator instead.
---  |
-with System;
-with Ada.Characters.Latin_1;
-
-package Terminal_Interface.Curses.Forms is
-   pragma Preelaborate (Terminal_Interface.Curses.Forms);
-   pragma Linker_Options ("-lform");
-   pragma Linker_Options ("-lncurses");
-
-   Space : Character renames Ada.Characters.Latin_1.Space;
-
-   type Field        is private;
-   type Form         is private;
-
-   Null_Field        : constant Field;
-   Null_Form         : constant Form;
-
-   type Field_Justification is (None,
-                                Left,
-                                Center,
-                                Right);
-
-   pragma Warnings (Off);
-   type Field_Option_Set is
-      record
-         Visible     : Boolean;
-         Active      : Boolean;
-         Public      : Boolean;
-         Edit        : Boolean;
-         Wrap        : Boolean;
-         Blank       : Boolean;
-         Auto_Skip   : Boolean;
-         Null_Ok     : Boolean;
-         Pass_Ok     : Boolean;
-         Static      : Boolean;
-         Unused      : Boolean;
-      end record;
-   pragma Convention (C, Field_Option_Set);
-
-   for Field_Option_Set use
-      record
-         Visible     at 0 range  0 ..  0;
-         Active      at 0 range  1 ..  1;
-         Public      at 0 range  2 ..  2;
-         Edit        at 0 range  3 ..  3;
-         Wrap        at 0 range  4 ..  4;
-         Blank       at 0 range  5 ..  5;
-         Auto_Skip   at 0 range  6 ..  6;
-         Null_Ok     at 0 range  7 ..  7;
-         Pass_Ok     at 0 range  8 ..  8;
-         Static      at 0 range  9 ..  9;
-         Unused      at 0 range 10 .. 31;
-      end record;
-   for Field_Option_Set'Size use 32;
-   --  Please note: this rep. clause is generated and may be
-   --               different on your system.Dnl
-
-   pragma Warnings (On);
-
-   function Default_Field_Options return Field_Option_Set;
-   --  The initial defaults for the field options.
-   pragma Inline (Default_Field_Options);
-
-   pragma Warnings (Off);
-   type Form_Option_Set is
-      record
-         NL_Overload : Boolean;
-         BS_Overload : Boolean;
-         Unused      : Boolean;
-      end record;
-   pragma Convention (C, Form_Option_Set);
-
-   for Form_Option_Set use
-      record
-         NL_Overload at 0 range  0 ..  0;
-         BS_Overload at 0 range  1 ..  1;
-         Unused      at 0 range  2 .. 31;
-      end record;
-   for Form_Option_Set'Size use 32;
-   --  Please note: this rep. clause is generated and may be
-   --               different on your system.Dnl
-
-   pragma Warnings (On);
-
-   function Default_Form_Options return Form_Option_Set;
-   --  The initial defaults for the form options.
-   pragma Inline (Default_Form_Options);
-
-   type Buffer_Number is new Natural;
-
-   type Field_Array is array (Positive range <>) of aliased Field;
-   pragma Convention (C, Field_Array);
-
-   type Field_Array_Access is access Field_Array;
-
-   procedure Free (FA          : in out Field_Array_Access;
-                   Free_Fields : Boolean := False);
-   --  Release the memory for an allocated field array
-   --  If Free_Fields is True, call Delete() for all the fields in
-   --  the array.
-
-   subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);
-
-   --  The prefix F_ stands for "Form Request"
-   F_Next_Page                : constant Form_Request_Code := Key_Max + 1;
-   F_Previous_Page            : constant Form_Request_Code := Key_Max + 2;
-   F_First_Page               : constant Form_Request_Code := Key_Max + 3;
-   F_Last_Page                : constant Form_Request_Code := Key_Max + 4;
-
-   F_Next_Field               : constant Form_Request_Code := Key_Max + 5;
-   F_Previous_Field           : constant Form_Request_Code := Key_Max + 6;
-   F_First_Field              : constant Form_Request_Code := Key_Max + 7;
-   F_Last_Field               : constant Form_Request_Code := Key_Max + 8;
-   F_Sorted_Next_Field        : constant Form_Request_Code := Key_Max + 9;
-   F_Sorted_Previous_Field    : constant Form_Request_Code := Key_Max + 10;
-   F_Sorted_First_Field       : constant Form_Request_Code := Key_Max + 11;
-   F_Sorted_Last_Field        : constant Form_Request_Code := Key_Max + 12;
-   F_Left_Field               : constant Form_Request_Code := Key_Max + 13;
-   F_Right_Field              : constant Form_Request_Code := Key_Max + 14;
-   F_Up_Field                 : constant Form_Request_Code := Key_Max + 15;
-   F_Down_Field               : constant Form_Request_Code := Key_Max + 16;
-
-   F_Next_Char                : constant Form_Request_Code := Key_Max + 17;
-   F_Previous_Char            : constant Form_Request_Code := Key_Max + 18;
-   F_Next_Line                : constant Form_Request_Code := Key_Max + 19;
-   F_Previous_Line            : constant Form_Request_Code := Key_Max + 20;
-   F_Next_Word                : constant Form_Request_Code := Key_Max + 21;
-   F_Previous_Word            : constant Form_Request_Code := Key_Max + 22;
-   F_Begin_Field              : constant Form_Request_Code := Key_Max + 23;
-   F_End_Field                : constant Form_Request_Code := Key_Max + 24;
-   F_Begin_Line               : constant Form_Request_Code := Key_Max + 25;
-   F_End_Line                 : constant Form_Request_Code := Key_Max + 26;
-   F_Left_Char                : constant Form_Request_Code := Key_Max + 27;
-   F_Right_Char               : constant Form_Request_Code := Key_Max + 28;
-   F_Up_Char                  : constant Form_Request_Code := Key_Max + 29;
-   F_Down_Char                : constant Form_Request_Code := Key_Max + 30;
-
-   F_New_Line                 : constant Form_Request_Code := Key_Max + 31;
-   F_Insert_Char              : constant Form_Request_Code := Key_Max + 32;
-   F_Insert_Line              : constant Form_Request_Code := Key_Max + 33;
-   F_Delete_Char              : constant Form_Request_Code := Key_Max + 34;
-   F_Delete_Previous          : constant Form_Request_Code := Key_Max + 35;
-   F_Delete_Line              : constant Form_Request_Code := Key_Max + 36;
-   F_Delete_Word              : constant Form_Request_Code := Key_Max + 37;
-   F_Clear_EOL                : constant Form_Request_Code := Key_Max + 38;
-   F_Clear_EOF                : constant Form_Request_Code := Key_Max + 39;
-   F_Clear_Field              : constant Form_Request_Code := Key_Max + 40;
-   F_Overlay_Mode             : constant Form_Request_Code := Key_Max + 41;
-   F_Insert_Mode              : constant Form_Request_Code := Key_Max + 42;
-
-   --  Vertical Scrolling
-   F_ScrollForward_Line       : constant Form_Request_Code := Key_Max + 43;
-   F_ScrollBackward_Line      : constant Form_Request_Code := Key_Max + 44;
-   F_ScrollForward_Page       : constant Form_Request_Code := Key_Max + 45;
-   F_ScrollBackward_Page      : constant Form_Request_Code := Key_Max + 46;
-   F_ScrollForward_HalfPage   : constant Form_Request_Code := Key_Max + 47;
-   F_ScrollBackward_HalfPage  : constant Form_Request_Code := Key_Max + 48;
-
-   --  Horizontal Scrolling
-   F_HScrollForward_Char      : constant Form_Request_Code := Key_Max + 49;
-   F_HScrollBackward_Char     : constant Form_Request_Code := Key_Max + 50;
-   F_HScrollForward_Line      : constant Form_Request_Code := Key_Max + 51;
-   F_HScrollBackward_Line     : constant Form_Request_Code := Key_Max + 52;
-   F_HScrollForward_HalfLine  : constant Form_Request_Code := Key_Max + 53;
-   F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;
-
-   F_Validate_Field           : constant Form_Request_Code := Key_Max + 55;
-   F_Next_Choice              : constant Form_Request_Code := Key_Max + 56;
-   F_Previous_Choice          : constant Form_Request_Code := Key_Max + 57;
-
-   --  For those who like the old 'C' style request names
-   REQ_NEXT_PAGE    : Form_Request_Code renames F_Next_Page;
-   REQ_PREV_PAGE    : Form_Request_Code renames F_Previous_Page;
-   REQ_FIRST_PAGE   : Form_Request_Code renames F_First_Page;
-   REQ_LAST_PAGE    : Form_Request_Code renames F_Last_Page;
-
-   REQ_NEXT_FIELD   : Form_Request_Code renames F_Next_Field;
-   REQ_PREV_FIELD   : Form_Request_Code renames F_Previous_Field;
-   REQ_FIRST_FIELD  : Form_Request_Code renames F_First_Field;
-   REQ_LAST_FIELD   : Form_Request_Code renames F_Last_Field;
-   REQ_SNEXT_FIELD  : Form_Request_Code renames F_Sorted_Next_Field;
-   REQ_SPREV_FIELD  : Form_Request_Code renames F_Sorted_Previous_Field;
-   REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
-   REQ_SLAST_FIELD  : Form_Request_Code renames F_Sorted_Last_Field;
-   REQ_LEFT_FIELD   : Form_Request_Code renames F_Left_Field;
-   REQ_RIGHT_FIELD  : Form_Request_Code renames F_Right_Field;
-   REQ_UP_FIELD     : Form_Request_Code renames F_Up_Field;
-   REQ_DOWN_FIELD   : Form_Request_Code renames F_Down_Field;
-
-   REQ_NEXT_CHAR    : Form_Request_Code renames F_Next_Char;
-   REQ_PREV_CHAR    : Form_Request_Code renames F_Previous_Char;
-   REQ_NEXT_LINE    : Form_Request_Code renames F_Next_Line;
-   REQ_PREV_LINE    : Form_Request_Code renames F_Previous_Line;
-   REQ_NEXT_WORD    : Form_Request_Code renames F_Next_Word;
-   REQ_PREV_WORD    : Form_Request_Code renames F_Previous_Word;
-   REQ_BEG_FIELD    : Form_Request_Code renames F_Begin_Field;
-   REQ_END_FIELD    : Form_Request_Code renames F_End_Field;
-   REQ_BEG_LINE     : Form_Request_Code renames F_Begin_Line;
-   REQ_END_LINE     : Form_Request_Code renames F_End_Line;
-   REQ_LEFT_CHAR    : Form_Request_Code renames F_Left_Char;
-   REQ_RIGHT_CHAR   : Form_Request_Code renames F_Right_Char;
-   REQ_UP_CHAR      : Form_Request_Code renames F_Up_Char;
-   REQ_DOWN_CHAR    : Form_Request_Code renames F_Down_Char;
-
-   REQ_NEW_LINE     : Form_Request_Code renames F_New_Line;
-   REQ_INS_CHAR     : Form_Request_Code renames F_Insert_Char;
-   REQ_INS_LINE     : Form_Request_Code renames F_Insert_Line;
-   REQ_DEL_CHAR     : Form_Request_Code renames F_Delete_Char;
-   REQ_DEL_PREV     : Form_Request_Code renames F_Delete_Previous;
-   REQ_DEL_LINE     : Form_Request_Code renames F_Delete_Line;
-   REQ_DEL_WORD     : Form_Request_Code renames F_Delete_Word;
-   REQ_CLR_EOL      : Form_Request_Code renames F_Clear_EOL;
-   REQ_CLR_EOF      : Form_Request_Code renames F_Clear_EOF;
-   REQ_CLR_FIELD    : Form_Request_Code renames F_Clear_Field;
-   REQ_OVL_MODE     : Form_Request_Code renames F_Overlay_Mode;
-   REQ_INS_MODE     : Form_Request_Code renames F_Insert_Mode;
-
-   REQ_SCR_FLINE    : Form_Request_Code renames F_ScrollForward_Line;
-   REQ_SCR_BLINE    : Form_Request_Code renames F_ScrollBackward_Line;
-   REQ_SCR_FPAGE    : Form_Request_Code renames F_ScrollForward_Page;
-   REQ_SCR_BPAGE    : Form_Request_Code renames F_ScrollBackward_Page;
-   REQ_SCR_FHPAGE   : Form_Request_Code renames F_ScrollForward_HalfPage;
-   REQ_SCR_BHPAGE   : Form_Request_Code renames F_ScrollBackward_HalfPage;
-
-   REQ_SCR_FCHAR    : Form_Request_Code renames F_HScrollForward_Char;
-   REQ_SCR_BCHAR    : Form_Request_Code renames F_HScrollBackward_Char;
-   REQ_SCR_HFLINE   : Form_Request_Code renames F_HScrollForward_Line;
-   REQ_SCR_HBLINE   : Form_Request_Code renames F_HScrollBackward_Line;
-   REQ_SCR_HFHALF   : Form_Request_Code renames F_HScrollForward_HalfLine;
-   REQ_SCR_HBHALF   : Form_Request_Code renames F_HScrollBackward_HalfLine;
-
-   REQ_VALIDATION   : Form_Request_Code renames F_Validate_Field;
-   REQ_NEXT_CHOICE  : Form_Request_Code renames F_Next_Choice;
-   REQ_PREV_CHOICE  : Form_Request_Code renames F_Previous_Choice;
-
-   procedure Request_Name (Key  : Form_Request_Code;
-                           Name : out String);
-
-   function  Request_Name (Key : Form_Request_Code) return String;
-   --  Same as function
-   pragma Inline (Request_Name);
-
-   ------------------
-   --  Exceptions  --
-   ------------------
-   Form_Exception : exception;
-
-   --  |=====================================================================
-   --  | Man page form_field_new.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   function Create (Height       : Line_Count;
-                    Width        : Column_Count;
-                    Top          : Line_Position;
-                    Left         : Column_Position;
-                    Off_Screen   : Natural := 0;
-                    More_Buffers : Buffer_Number := Buffer_Number'First)
-                    return Field;
-   --  AKA: new_field()
-   --  An overloaded Create is defined later. Pragma Inline appears there.
-
-   --  #1A NAME="AFU_2"#2|
-   function New_Field (Height       : Line_Count;
-                       Width        : Column_Count;
-                       Top          : Line_Position;
-                       Left         : Column_Position;
-                       Off_Screen   : Natural := 0;
-                       More_Buffers : Buffer_Number := Buffer_Number'First)
-                       return Field renames Create;
-   --  AKA: new_field()
-   pragma Inline (New_Field);
-
-   --  #1A NAME="AFU_3"#2|
-   procedure Delete (Fld : in out Field);
-   --  AKA: free_field()
-   --  Reset Fld to Null_Field
-   --  An overloaded Delete is defined later. Pragma Inline appears there.
-
-   --  #1A NAME="AFU_4"#2|
-   function Duplicate (Fld  : Field;
-                       Top  : Line_Position;
-                       Left : Column_Position) return Field;
-   --  AKA: dup_field()
-   pragma Inline (Duplicate);
-
-   --  #1A NAME="AFU_5"#2|
-   function Link (Fld  : Field;
-                  Top  : Line_Position;
-                  Left : Column_Position) return Field;
-   --  AKA: link_field()
-   pragma Inline (Link);
-
-   --  |=====================================================================
-   --  | Man page form_field_just.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_6"#2|
-   procedure Set_Justification (Fld  : Field;
-                                Just : Field_Justification := None);
-   --  AKA: set_field_just()
-   pragma Inline (Set_Justification);
-
-   --  #1A NAME="AFU_7"#2|
-   function Get_Justification (Fld : Field) return Field_Justification;
-   --  AKA: field_just()
-   pragma Inline (Get_Justification);
-
-   --  |=====================================================================
-   --  | Man page form_field_buffer.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_8"#2|
-   procedure Set_Buffer
-     (Fld    : Field;
-      Buffer : Buffer_Number := Buffer_Number'First;
-      Str    : String);
-   --  AKA: set_field_buffer()
-   --  Not inlined
-
-   --  #1A NAME="AFU_9"#2|
-   procedure Get_Buffer
-     (Fld    : Field;
-      Buffer : Buffer_Number := Buffer_Number'First;
-      Str    : out String);
-   --  AKA: field_buffer()
-
-   function Get_Buffer
-     (Fld    : Field;
-      Buffer : Buffer_Number := Buffer_Number'First) return String;
-   --  AKA: field_buffer()
-   --  Same but as function
-   pragma Inline (Get_Buffer);
-
-   --  #1A NAME="AFU_10"#2|
-   procedure Set_Status (Fld    : Field;
-                         Status : Boolean := True);
-   --  AKA: set_field_status()
-   pragma Inline (Set_Status);
-
-   --  #1A NAME="AFU_11"#2|
-   function Changed (Fld : Field) return Boolean;
-   --  AKA: field_status()
-   pragma Inline (Changed);
-
-   --  #1A NAME="AFU_12"#2|
-   procedure Set_Maximum_Size (Fld : Field;
-                               Max : Natural := 0);
-   --  AKA: set_field_max()
-   pragma Inline (Set_Maximum_Size);
-
-   --  |=====================================================================
-   --  | Man page form_field_opts.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_13"#2|
-   procedure Set_Options (Fld     : Field;
-                          Options : Field_Option_Set);
-   --  AKA: set_field_opts()
-   --  An overloaded version is defined later. Pragma Inline appears there
-
-   --  #1A NAME="AFU_14"#2|
-   procedure Switch_Options (Fld     : Field;
-                             Options : Field_Option_Set;
-                             On      : Boolean := True);
-   --  AKA: field_opts_on()
-   --  AKA: field_opts_off()
-   --  An overloaded version is defined later. Pragma Inline appears there
-
-   --  #1A NAME="AFU_15"#2|
-   procedure Get_Options (Fld     : Field;
-                          Options : out Field_Option_Set);
-   --  AKA: field_opts()
-
-   --  #1A NAME="AFU_16"#2|
-   function Get_Options (Fld : Field := Null_Field)
-                         return Field_Option_Set;
-   --  AKA: field_opts()
-   --  An overloaded version is defined later. Pragma Inline appears there
-
-   --  |=====================================================================
-   --  | Man page form_field_attributes.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_17"#2|
-   procedure Set_Foreground
-     (Fld   : Field;
-      Fore  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: set_field_fore()
-   pragma Inline (Set_Foreground);
-
-   --  #1A NAME="AFU_18"#2|
-   procedure Foreground (Fld  : Field;
-                         Fore : out Character_Attribute_Set);
-   --  AKA: field_fore()
-
-   --  #1A NAME="AFU_19"#2|
-   procedure Foreground (Fld   : Field;
-                         Fore  : out Character_Attribute_Set;
-                         Color : out Color_Pair);
-   --  AKA: field_fore()
-   pragma Inline (Foreground);
-
-   --  #1A NAME="AFU_20"#2|
-   procedure Set_Background
-     (Fld   : Field;
-      Back  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: set_field_back()
-   pragma Inline (Set_Background);
-
-   --  #1A NAME="AFU_21"#2|
-   procedure Background (Fld  : Field;
-                         Back : out Character_Attribute_Set);
-   --  AKA: field_back()
-
-   --  #1A NAME="AFU_22"#2|
-   procedure Background (Fld   : Field;
-                         Back  : out Character_Attribute_Set;
-                         Color : out Color_Pair);
-   --  AKA: field_back()
-   pragma Inline (Background);
-
-   --  #1A NAME="AFU_23"#2|
-   procedure Set_Pad_Character (Fld : Field;
-                                Pad : Character := Space);
-   --  AKA: set_field_pad()
-   pragma Inline (Set_Pad_Character);
-
-   --  #1A NAME="AFU_24"#2|
-   procedure Pad_Character (Fld : Field;
-                            Pad : out Character);
-   --  AKA: field_pad()
-   pragma Inline (Pad_Character);
-
-   --  |=====================================================================
-   --  | Man page form_field_info.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_25"#2|
-   procedure Info (Fld                : Field;
-                   Lines              : out Line_Count;
-                   Columns            : out Column_Count;
-                   First_Row          : out Line_Position;
-                   First_Column       : out Column_Position;
-                   Off_Screen         : out Natural;
-                   Additional_Buffers : out Buffer_Number);
-   --  AKA: field_info()
-   pragma Inline (Info);
-
-   --  #1A NAME="AFU_26"#2|
-   procedure Dynamic_Info (Fld     : Field;
-                           Lines   : out Line_Count;
-                           Columns : out Column_Count;
-                           Max     : out Natural);
-   --  AKA: dynamic_field_info()
-   pragma Inline (Dynamic_Info);
-
-   --  |=====================================================================
-   --  | Man page form_win.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_27"#2|
-   procedure Set_Window (Frm : Form;
-                         Win : Window);
-   --  AKA: set_form_win()
-   pragma Inline (Set_Window);
-
-   --  #1A NAME="AFU_28"#2|
-   function Get_Window (Frm : Form) return Window;
-   --  AKA: form_win()
-   pragma Inline (Get_Window);
-
-   --  #1A NAME="AFU_29"#2|
-   procedure Set_Sub_Window (Frm : Form;
-                             Win : Window);
-   --  AKA: set_form_sub()
-   pragma Inline (Set_Sub_Window);
-
-   --  #1A NAME="AFU_30"#2|
-   function Get_Sub_Window (Frm : Form) return Window;
-   --  AKA: form_sub()
-   pragma Inline (Get_Sub_Window);
-
-   --  #1A NAME="AFU_31"#2|
-   procedure Scale (Frm     : Form;
-                    Lines   : out Line_Count;
-                    Columns : out Column_Count);
-   --  AKA: scale_form()
-   pragma Inline (Scale);
-
-   --  |=====================================================================
-   --  | Man page form_hook.3x
-   --  |=====================================================================
-
-   type Form_Hook_Function is access procedure (Frm : Form);
-   pragma Convention (C, Form_Hook_Function);
-
-   --  #1A NAME="AFU_32"#2|
-   procedure Set_Field_Init_Hook (Frm  : Form;
-                                  Proc : Form_Hook_Function);
-   --  AKA: set_field_init()
-   pragma Inline (Set_Field_Init_Hook);
-
-   --  #1A NAME="AFU_33"#2|
-   procedure Set_Field_Term_Hook (Frm  : Form;
-                                  Proc : Form_Hook_Function);
-   --  AKA: set_field_term()
-   pragma Inline (Set_Field_Term_Hook);
-
-   --  #1A NAME="AFU_34"#2|
-   procedure Set_Form_Init_Hook (Frm  : Form;
-                                 Proc : Form_Hook_Function);
-   --  AKA: set_form_init()
-   pragma Inline (Set_Form_Init_Hook);
-
-   --  #1A NAME="AFU_35"#2|
-   procedure Set_Form_Term_Hook (Frm  : Form;
-                                 Proc : Form_Hook_Function);
-   --  AKA: set_form_term()
-   pragma Inline (Set_Form_Term_Hook);
-
-   --  #1A NAME="AFU_36"#2|
-   function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
-   --  AKA: field_init()
-   pragma Import (C, Get_Field_Init_Hook, "field_init");
-
-   --  #1A NAME="AFU_37"#2|
-   function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
-   --  AKA: field_term()
-   pragma Import (C, Get_Field_Term_Hook, "field_term");
-
-   --  #1A NAME="AFU_38"#2|
-   function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
-   --  AKA: form_init()
-   pragma Import (C, Get_Form_Init_Hook, "form_init");
-
-   --  #1A NAME="AFU_39"#2|
-   function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
-   --  AKA: form_term()
-   pragma Import (C, Get_Form_Term_Hook, "form_term");
-
-   --  |=====================================================================
-   --  | Man page form_field.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_40"#2|
-   procedure Redefine (Frm  : Form;
-                       Flds : Field_Array_Access);
-   --  AKA: set_form_fields()
-   pragma Inline (Redefine);
-
-   --  #1A NAME="AFU_41"#2|
-   procedure Set_Fields (Frm  : Form;
-                         Flds : Field_Array_Access) renames Redefine;
-   --  AKA: set_form_fields()
-   --  pragma Inline (Set_Fields);
-
-   --  #1A NAME="AFU_42"#2|
-   function Fields (Frm   : Form;
-                    Index : Positive) return Field;
-   --  AKA: form_fields()
-   pragma Inline (Fields);
-
-   --  #1A NAME="AFU_43"#2|
-   function Field_Count (Frm : Form) return Natural;
-   --  AKA: field_count()
-   pragma Inline (Field_Count);
-
-   --  #1A NAME="AFU_44"#2|
-   procedure Move (Fld    : Field;
-                   Line   : Line_Position;
-                   Column : Column_Position);
-   --  AKA: move_field()
-   pragma Inline (Move);
-
-   --  |=====================================================================
-   --  | Man page form_new.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_45"#2|
-   function Create (Fields : Field_Array_Access) return Form;
-   --  AKA: new_form()
-   pragma Inline (Create);
-
-   --  #1A NAME="AFU_46"#2|
-   function New_Form (Fields : Field_Array_Access) return Form
-     renames Create;
-   --  AKA: new_form()
-   --  pragma Inline (New_Form);
-
-   --  #1A NAME="AFU_47"#2|
-   procedure Delete (Frm : in out Form);
-   --  AKA: free_form()
-   --  Reset Frm to Null_Form
-   pragma Inline (Delete);
-
-   --  |=====================================================================
-   --  | Man page form_opts.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_48"#2|
-   procedure Set_Options (Frm     : Form;
-                          Options : Form_Option_Set);
-   --  AKA: set_form_opts()
-   pragma Inline (Set_Options);
-
-   --  #1A NAME="AFU_49"#2|
-   procedure Switch_Options (Frm     : Form;
-                             Options : Form_Option_Set;
-                             On      : Boolean := True);
-   --  AKA: form_opts_on()
-   --  AKA: form_opts_off()
-   pragma Inline (Switch_Options);
-
-   --  #1A NAME="AFU_50"#2|
-   procedure Get_Options (Frm     : Form;
-                          Options : out Form_Option_Set);
-   --  AKA: form_opts()
-
-   --  #1A NAME="AFU_51"#2|
-   function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
-   --  AKA: form_opts()
-   pragma Inline (Get_Options);
-
-   --  |=====================================================================
-   --  | Man page form_post.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_52"#2|
-   procedure Post (Frm  : Form;
-                   Post : Boolean := True);
-   --  AKA: post_form()
-   --  AKA: unpost_form()
-   pragma Inline (Post);
-
-   --  |=====================================================================
-   --  | Man page form_cursor.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_53"#2|
-   procedure Position_Cursor (Frm : Form);
-   --  AKA: pos_form_cursor()
-   pragma Inline (Position_Cursor);
-
-   --  |=====================================================================
-   --  | Man page form_data.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_54"#2|
-   function Data_Ahead (Frm : Form) return Boolean;
-   --  AKA: data_ahead()
-   pragma Inline (Data_Ahead);
-
-   --  #1A NAME="AFU_55"#2|
-   function Data_Behind (Frm : Form) return Boolean;
-   --  AKA: data_behind()
-   pragma Inline (Data_Behind);
-
-   --  |=====================================================================
-   --  | Man page form_driver.3x
-   --  |=====================================================================
-
-   type Driver_Result is (Form_Ok,
-                          Request_Denied,
-                          Unknown_Request,
-                          Invalid_Field);
-
-   --  #1A NAME="AFU_56"#2|
-   function Driver (Frm : Form;
-                    Key : Key_Code) return Driver_Result;
-   --  AKA: form_driver()
-   --  Driver not inlined
-
-   --  |=====================================================================
-   --  | Man page form_page.3x
-   --  |=====================================================================
-
-   type Page_Number is new Natural;
-
-   --  #1A NAME="AFU_57"#2|
-   procedure Set_Current (Frm : Form;
-                          Fld : Field);
-   --  AKA: set_current_field()
-   pragma Inline (Set_Current);
-
-   --  #1A NAME="AFU_58"#2|
-   function Current (Frm : Form) return Field;
-   --  AKA: current_field()
-   pragma Inline (Current);
-
-   --  #1A NAME="AFU_59"#2|
-   procedure Set_Page (Frm  : Form;
-                       Page : Page_Number := Page_Number'First);
-   --  AKA: set_form_page()
-   pragma Inline (Set_Page);
-
-   --  #1A NAME="AFU_60"#2|
-   function Page (Frm : Form) return Page_Number;
-   --  AKA: form_page()
-   pragma Inline (Page);
-
-   --  #1A NAME="AFU_61"#2|
-   function Get_Index (Fld : Field) return Positive;
-   --  AKA: field_index()
-   --  Please note that in this binding we start the numbering of fields
-   --  with 1. So this is number is one more than you get from the low
-   --  level call.
-   pragma Inline (Get_Index);
-
-   --  |=====================================================================
-   --  | Man page form_new_page.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_62"#2|
-   procedure Set_New_Page (Fld      : Field;
-                           New_Page : Boolean := True);
-   --  AKA: set_new_page()
-   pragma Inline (Set_New_Page);
-
-   --  #1A NAME="AFU_63"#2|
-   function Is_New_Page (Fld : Field) return Boolean;
-   --  AKA: new_page()
-   pragma Inline (Is_New_Page);
-
-   --  |=====================================================================
-   --  | Man page form_requestname.3x
-   --  |=====================================================================
-   --  Not Implemented: form_request_name, form_request_by_name
-
-------------------------------------------------------------------------------
-private
-   type Field is new System.Storage_Elements.Integer_Address;
-   type Form  is new System.Storage_Elements.Integer_Address;
-
-   Null_Field : constant Field := 0;
-   Null_Form  : constant Form  := 0;
-
-end Terminal_Interface.Curses.Forms;
-
diff --git a/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm deleted file mode 100644 index c9583dd3a1b..00000000000 --- a/doc/html/ada/terminal_interface-curses-menus-item_user_data__adb.htm +++ /dev/null @@ -1,83 +0,0 @@ - -terminal_interface-curses-menus-item_user_data.adb - -

File : terminal_interface-curses-menus-item_user_data.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Menus.Item_User_Data             --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Menus.Item_User_Data is
-
-   use type Interfaces.C.int;
-
-   procedure Set_User_Data (Itm  : Item;
-                            Data : User_Access)
-   is
-      function Set_Item_Userptr (Itm  : Item;
-                                 Addr : User_Access)  return C_Int;
-      pragma Import (C, Set_Item_Userptr, "set_item_userptr");
-
-      Res : constant Eti_Error := Set_Item_Userptr (Itm, Data);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_User_Data;
-
-   function Get_User_Data (Itm  : Item) return User_Access
-   is
-      function Item_Userptr (Itm : Item) return User_Access;
-      pragma Import (C, Item_Userptr, "item_userptr");
-   begin
-      return Item_Userptr (Itm);
-   end Get_User_Data;
-
-   procedure Get_User_Data (Itm  : Item;
-                            Data : out User_Access)
-   is
-   begin
-      Data := Get_User_Data (Itm);
-   end Get_User_Data;
-
-end Terminal_Interface.Curses.Menus.Item_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm deleted file mode 100644 index 8614e20a26c..00000000000 --- a/doc/html/ada/terminal_interface-curses-menus-item_user_data__ads.htm +++ /dev/null @@ -1,80 +0,0 @@ - -terminal_interface-curses-menus-item_user_data.ads - -

File : terminal_interface-curses-menus-item_user_data.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Menus.Item_User_Data             --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.17 @
---  @Date: 2009/12/26 17:31:35 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-generic
-   type User is limited private;
-   type User_Access is access User;
-package Terminal_Interface.Curses.Menus.Item_User_Data is
-   pragma Preelaborate (Terminal_Interface.Curses.Menus.Item_User_Data);
-
-   --  The binding uses the same user pointer for menu items
-   --  as the low level C implementation. So you can safely
-   --  read or write the user pointer also with the C routines
-   --
-   --  |=====================================================================
-   --  | Man page mitem_userptr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Set_User_Data (Itm  : Item;
-                            Data : User_Access);
-   --  AKA: set_item_userptr
-   pragma Inline (Set_User_Data);
-
-   --  #1A NAME="AFU_2"#2|
-   procedure Get_User_Data (Itm  : Item;
-                            Data : out User_Access);
-   --  AKA: item_userptr
-
-   --  #1A NAME="AFU_3"#2|
-   function Get_User_Data (Itm  : Item) return User_Access;
-   --  AKA: item_userptr
-   --  Same as function
-   pragma Inline (Get_User_Data);
-
-end Terminal_Interface.Curses.Menus.Item_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm deleted file mode 100644 index 9c4e92f245c..00000000000 --- a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__adb.htm +++ /dev/null @@ -1,82 +0,0 @@ - -terminal_interface-curses-menus-menu_user_data.adb - -

File : terminal_interface-curses-menus-menu_user_data.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Menus.Menu_User_Data             --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.13 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.Menus.Menu_User_Data is
-
-   use type Interfaces.C.int;
-
-   procedure Set_User_Data (Men  : Menu;
-                            Data : User_Access)
-   is
-      function Set_Menu_Userptr (Men  : Menu;
-                                 Data : User_Access)  return C_Int;
-      pragma Import (C, Set_Menu_Userptr, "set_menu_userptr");
-
-      Res : constant Eti_Error := Set_Menu_Userptr (Men, Data);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_User_Data;
-
-   function Get_User_Data (Men  : Menu) return User_Access
-   is
-      function Menu_Userptr (Men : Menu) return User_Access;
-      pragma Import (C, Menu_Userptr, "menu_userptr");
-   begin
-      return Menu_Userptr (Men);
-   end Get_User_Data;
-
-   procedure Get_User_Data (Men  : Menu;
-                            Data : out User_Access)
-   is
-   begin
-      Data := Get_User_Data (Men);
-   end Get_User_Data;
-
-end Terminal_Interface.Curses.Menus.Menu_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm b/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm deleted file mode 100644 index 72276413b1e..00000000000 --- a/doc/html/ada/terminal_interface-curses-menus-menu_user_data__ads.htm +++ /dev/null @@ -1,75 +0,0 @@ - -terminal_interface-curses-menus-menu_user_data.ads - -

File : terminal_interface-curses-menus-menu_user_data.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Menus.Menu_User_Data             --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.15 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-generic
-   type User is limited private;
-   type User_Access is access User;
-package Terminal_Interface.Curses.Menus.Menu_User_Data is
-   pragma Preelaborate (Terminal_Interface.Curses.Menus.Menu_User_Data);
-
-   --  |=====================================================================
-   --  | Man page menu_userptr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Set_User_Data (Men  : Menu;
-                            Data : User_Access);
-   --  AKA: set_menu_userptr
-   pragma Inline (Set_User_Data);
-
-   --  #1A NAME="AFU_2"#2|
-   procedure Get_User_Data (Men  : Menu;
-                            Data : out User_Access);
-   --  AKA: menu_userptr
-
-   --  #1A NAME="AFU_3"#2|
-   function Get_User_Data (Men  : Menu) return User_Access;
-   --  AKA: menu_userptr
-   --  Same as function
-   pragma Inline (Get_User_Data);
-
-end Terminal_Interface.Curses.Menus.Menu_User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-menus__adb.htm b/doc/html/ada/terminal_interface-curses-menus__adb.htm deleted file mode 100644 index c51db2805bb..00000000000 --- a/doc/html/ada/terminal_interface-curses-menus__adb.htm +++ /dev/null @@ -1,1028 +0,0 @@ - -terminal_interface-curses-menus.adb - -

File : terminal_interface-curses-menus.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Menus                     --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.28 @
---  @Date: 2011/03/22 23:38:12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Unchecked_Deallocation;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-with Interfaces.C; use Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Interfaces.C.Pointers;
-
-with Ada.Unchecked_Conversion;
-
-package body Terminal_Interface.Curses.Menus is
-
-   type C_Item_Array is array (Natural range <>) of aliased Item;
-   package I_Array is new
-     Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item);
-
-   use type System.Bit_Order;
-   subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
-
-   function MOS_2_CInt is new
-     Ada.Unchecked_Conversion (Menu_Option_Set,
-                               C_Int);
-
-   function CInt_2_MOS is new
-     Ada.Unchecked_Conversion (C_Int,
-                               Menu_Option_Set);
-
-   function IOS_2_CInt is new
-     Ada.Unchecked_Conversion (Item_Option_Set,
-                               C_Int);
-
-   function CInt_2_IOS is new
-     Ada.Unchecked_Conversion (C_Int,
-                               Item_Option_Set);
-
-------------------------------------------------------------------------------
-   procedure Request_Name (Key  : Menu_Request_Code;
-                           Name : out String)
-   is
-      function Request_Name (Key : C_Int) return chars_ptr;
-      pragma Import (C, Request_Name, "menu_request_name");
-   begin
-      Fill_String (Request_Name (C_Int (Key)), Name);
-   end Request_Name;
-
-   function Request_Name (Key : Menu_Request_Code) return String
-   is
-      function Request_Name (Key : C_Int) return chars_ptr;
-      pragma Import (C, Request_Name, "menu_request_name");
-   begin
-      return Fill_String (Request_Name (C_Int (Key)));
-   end Request_Name;
-
-   function Create (Name        : String;
-                    Description : String := "") return Item
-   is
-      type Char_Ptr is access all Interfaces.C.char;
-      function Newitem (Name, Desc : Char_Ptr) return Item;
-      pragma Import (C, Newitem, "new_item");
-
-      type Name_String is new char_array (0 .. Name'Length);
-      type Name_String_Ptr is access Name_String;
-      pragma Controlled (Name_String_Ptr);
-
-      type Desc_String is new char_array (0 .. Description'Length);
-      type Desc_String_Ptr is access Desc_String;
-      pragma Controlled (Desc_String_Ptr);
-
-      Name_Str : constant Name_String_Ptr := new Name_String;
-      Desc_Str : constant Desc_String_Ptr := new Desc_String;
-      Name_Len, Desc_Len : size_t;
-      Result : Item;
-   begin
-      To_C (Name, Name_Str.all, Name_Len);
-      To_C (Description, Desc_Str.all, Desc_Len);
-      Result := Newitem (Name_Str.all (Name_Str.all'First)'Access,
-                         Desc_Str.all (Desc_Str.all'First)'Access);
-      if Result = Null_Item then
-         raise Eti_System_Error;
-      end if;
-      return Result;
-   end Create;
-
-   procedure Delete (Itm : in out Item)
-   is
-      function Descname (Itm  : Item) return chars_ptr;
-      pragma Import (C, Descname, "item_description");
-      function Itemname (Itm  : Item) return chars_ptr;
-      pragma Import (C, Itemname, "item_name");
-
-      function Freeitem (Itm : Item) return C_Int;
-      pragma Import (C, Freeitem, "free_item");
-
-      Res : Eti_Error;
-      Ptr : chars_ptr;
-   begin
-      Ptr := Descname (Itm);
-      if Ptr /= Null_Ptr then
-         Interfaces.C.Strings.Free (Ptr);
-      end if;
-      Ptr := Itemname (Itm);
-      if Ptr /= Null_Ptr then
-         Interfaces.C.Strings.Free (Ptr);
-      end if;
-      Res := Freeitem (Itm);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Itm := Null_Item;
-   end Delete;
--------------------------------------------------------------------------------
-   procedure Set_Value (Itm   : Item;
-                        Value : Boolean := True)
-   is
-      function Set_Item_Val (Itm : Item;
-                             Val : C_Int) return C_Int;
-      pragma Import (C, Set_Item_Val, "set_item_value");
-
-      Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Value;
-
-   function Value (Itm : Item) return Boolean
-   is
-      function Item_Val (Itm : Item) return C_Int;
-      pragma Import (C, Item_Val, "item_value");
-   begin
-      if Item_Val (Itm) = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Value;
-
--------------------------------------------------------------------------------
-   function Visible (Itm : Item) return Boolean
-   is
-      function Item_Vis (Itm : Item) return C_Int;
-      pragma Import (C, Item_Vis, "item_visible");
-   begin
-      if Item_Vis (Itm) = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Visible;
--------------------------------------------------------------------------------
-   procedure Set_Options (Itm     : Item;
-                          Options : Item_Option_Set)
-   is
-      function Set_Item_Opts (Itm : Item;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Set_Item_Opts, "set_item_opts");
-
-      Opt : constant C_Int := IOS_2_CInt (Options);
-      Res : Eti_Error;
-   begin
-      Res := Set_Item_Opts (Itm, Opt);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Options;
-
-   procedure Switch_Options (Itm     : Item;
-                             Options : Item_Option_Set;
-                             On      : Boolean := True)
-   is
-      function Item_Opts_On (Itm : Item;
-                             Opt : C_Int) return C_Int;
-      pragma Import (C, Item_Opts_On, "item_opts_on");
-      function Item_Opts_Off (Itm : Item;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Item_Opts_Off, "item_opts_off");
-
-      Opt : constant C_Int := IOS_2_CInt (Options);
-      Err : Eti_Error;
-   begin
-      if On then
-         Err := Item_Opts_On (Itm, Opt);
-      else
-         Err := Item_Opts_Off (Itm, Opt);
-      end if;
-      if Err /= E_Ok then
-         Eti_Exception (Err);
-      end if;
-   end Switch_Options;
-
-   procedure Get_Options (Itm     : Item;
-                          Options : out Item_Option_Set)
-   is
-      function Item_Opts (Itm : Item) return C_Int;
-      pragma Import (C, Item_Opts, "item_opts");
-
-      Res : constant C_Int := Item_Opts (Itm);
-   begin
-      Options := CInt_2_IOS (Res);
-   end Get_Options;
-
-   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set
-   is
-      Ios : Item_Option_Set;
-   begin
-      Get_Options (Itm, Ios);
-      return Ios;
-   end Get_Options;
--------------------------------------------------------------------------------
-   procedure Name (Itm  : Item;
-                   Name : out String)
-   is
-      function Itemname (Itm : Item) return chars_ptr;
-      pragma Import (C, Itemname, "item_name");
-   begin
-      Fill_String (Itemname (Itm), Name);
-   end Name;
-
-   function Name (Itm : Item) return String
-   is
-      function Itemname (Itm : Item) return chars_ptr;
-      pragma Import (C, Itemname, "item_name");
-   begin
-      return Fill_String (Itemname (Itm));
-   end Name;
-
-   procedure Description (Itm         : Item;
-                          Description : out String)
-   is
-      function Descname (Itm  : Item) return chars_ptr;
-      pragma Import (C, Descname, "item_description");
-   begin
-      Fill_String (Descname (Itm), Description);
-   end Description;
-
-   function Description (Itm : Item) return String
-   is
-      function Descname (Itm  : Item) return chars_ptr;
-      pragma Import (C, Descname, "item_description");
-   begin
-      return Fill_String (Descname (Itm));
-   end Description;
--------------------------------------------------------------------------------
-   procedure Set_Current (Men : Menu;
-                          Itm : Item)
-   is
-      function Set_Curr_Item (Men : Menu;
-                              Itm : Item) return C_Int;
-      pragma Import (C, Set_Curr_Item, "set_current_item");
-
-      Res : constant Eti_Error := Set_Curr_Item (Men, Itm);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Current;
-
-   function Current (Men : Menu) return Item
-   is
-      function Curr_Item (Men : Menu) return Item;
-      pragma Import (C, Curr_Item, "current_item");
-
-      Res : constant Item := Curr_Item (Men);
-   begin
-      if Res = Null_Item then
-         raise Menu_Exception;
-      end if;
-      return Res;
-   end Current;
-
-   procedure Set_Top_Row (Men  : Menu;
-                          Line : Line_Position)
-   is
-      function Set_Toprow (Men  : Menu;
-                           Line : C_Int) return C_Int;
-      pragma Import (C, Set_Toprow, "set_top_row");
-
-      Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Top_Row;
-
-   function Top_Row (Men : Menu) return Line_Position
-   is
-      function Toprow (Men : Menu) return C_Int;
-      pragma Import (C, Toprow, "top_row");
-
-      Res : constant C_Int := Toprow (Men);
-   begin
-      if Res = Curses_Err then
-         raise Menu_Exception;
-      end if;
-      return Line_Position (Res);
-   end Top_Row;
-
-   function Get_Index (Itm : Item) return Positive
-   is
-      function Get_Itemindex (Itm : Item) return C_Int;
-      pragma Import (C, Get_Itemindex, "item_index");
-
-      Res : constant C_Int := Get_Itemindex (Itm);
-   begin
-      if Res = Curses_Err then
-         raise Menu_Exception;
-      end if;
-      return Positive (Natural (Res) + Positive'First);
-   end Get_Index;
--------------------------------------------------------------------------------
-   procedure Post (Men  : Menu;
-                   Post : Boolean := True)
-   is
-      function M_Post (Men : Menu) return C_Int;
-      pragma Import (C, M_Post, "post_menu");
-      function M_Unpost (Men : Menu) return C_Int;
-      pragma Import (C, M_Unpost, "unpost_menu");
-
-      Res : Eti_Error;
-   begin
-      if Post then
-         Res := M_Post (Men);
-      else
-         Res := M_Unpost (Men);
-      end if;
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Post;
--------------------------------------------------------------------------------
-   procedure Set_Options (Men     : Menu;
-                          Options : Menu_Option_Set)
-   is
-      function Set_Menu_Opts (Men : Menu;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Set_Menu_Opts, "set_menu_opts");
-
-      Opt : constant C_Int := MOS_2_CInt (Options);
-      Res : Eti_Error;
-   begin
-      Res := Set_Menu_Opts (Men, Opt);
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Options;
-
-   procedure Switch_Options (Men     : Menu;
-                             Options : Menu_Option_Set;
-                             On      : Boolean := True)
-   is
-      function Menu_Opts_On (Men : Menu;
-                             Opt : C_Int) return C_Int;
-      pragma Import (C, Menu_Opts_On, "menu_opts_on");
-      function Menu_Opts_Off (Men : Menu;
-                              Opt : C_Int) return C_Int;
-      pragma Import (C, Menu_Opts_Off, "menu_opts_off");
-
-      Opt : constant C_Int := MOS_2_CInt (Options);
-      Err : Eti_Error;
-   begin
-      if On then
-         Err := Menu_Opts_On  (Men, Opt);
-      else
-         Err := Menu_Opts_Off (Men, Opt);
-      end if;
-      if Err /= E_Ok then
-         Eti_Exception (Err);
-      end if;
-   end Switch_Options;
-
-   procedure Get_Options (Men     : Menu;
-                          Options : out Menu_Option_Set)
-   is
-      function Menu_Opts (Men : Menu) return C_Int;
-      pragma Import (C, Menu_Opts, "menu_opts");
-
-      Res : constant C_Int := Menu_Opts (Men);
-   begin
-      Options := CInt_2_MOS (Res);
-   end Get_Options;
-
-   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set
-   is
-      Mos : Menu_Option_Set;
-   begin
-      Get_Options (Men, Mos);
-      return Mos;
-   end Get_Options;
--------------------------------------------------------------------------------
-   procedure Set_Window (Men : Menu;
-                         Win : Window)
-   is
-      function Set_Menu_Win (Men : Menu;
-                             Win : Window) return C_Int;
-      pragma Import (C, Set_Menu_Win, "set_menu_win");
-
-      Res : constant Eti_Error := Set_Menu_Win (Men, Win);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Window;
-
-   function Get_Window (Men : Menu) return Window
-   is
-      function Menu_Win (Men : Menu) return Window;
-      pragma Import (C, Menu_Win, "menu_win");
-
-      W : constant Window := Menu_Win (Men);
-   begin
-      return W;
-   end Get_Window;
-
-   procedure Set_Sub_Window (Men : Menu;
-                             Win : Window)
-   is
-      function Set_Menu_Sub (Men : Menu;
-                             Win : Window) return C_Int;
-      pragma Import (C, Set_Menu_Sub, "set_menu_sub");
-
-      Res : constant Eti_Error := Set_Menu_Sub (Men, Win);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Sub_Window;
-
-   function Get_Sub_Window (Men : Menu) return Window
-   is
-      function Menu_Sub (Men : Menu) return Window;
-      pragma Import (C, Menu_Sub, "menu_sub");
-
-      W : constant Window := Menu_Sub (Men);
-   begin
-      return W;
-   end Get_Sub_Window;
-
-   procedure Scale (Men     : Menu;
-                    Lines   : out Line_Count;
-                    Columns : out Column_Count)
-   is
-      type C_Int_Access is access all C_Int;
-      function M_Scale (Men    : Menu;
-                        Yp, Xp : C_Int_Access) return C_Int;
-      pragma Import (C, M_Scale, "scale_menu");
-
-      X, Y : aliased C_Int;
-      Res  : constant Eti_Error := M_Scale (Men, Y'Access, X'Access);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Lines := Line_Count (Y);
-      Columns := Column_Count (X);
-   end Scale;
--------------------------------------------------------------------------------
-   procedure Position_Cursor (Men : Menu)
-   is
-      function Pos_Menu_Cursor (Men : Menu) return C_Int;
-      pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor");
-
-      Res : constant Eti_Error := Pos_Menu_Cursor (Men);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Position_Cursor;
-
--------------------------------------------------------------------------------
-   procedure Set_Mark (Men  : Menu;
-                       Mark : String)
-   is
-      type Char_Ptr is access all Interfaces.C.char;
-      function Set_Mark (Men  : Menu;
-                         Mark : Char_Ptr) return C_Int;
-      pragma Import (C, Set_Mark, "set_menu_mark");
-
-      Txt : char_array (0 .. Mark'Length);
-      Len : size_t;
-      Res : Eti_Error;
-   begin
-      To_C (Mark, Txt, Len);
-      Res := Set_Mark (Men, Txt (Txt'First)'Access);
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Mark;
-
-   procedure Mark (Men  : Menu;
-                   Mark : out String)
-   is
-      function Get_Menu_Mark (Men : Menu) return chars_ptr;
-      pragma Import (C, Get_Menu_Mark, "menu_mark");
-   begin
-      Fill_String (Get_Menu_Mark (Men), Mark);
-   end Mark;
-
-   function Mark (Men : Menu) return String
-   is
-      function Get_Menu_Mark (Men : Menu) return chars_ptr;
-      pragma Import (C, Get_Menu_Mark, "menu_mark");
-   begin
-      return Fill_String (Get_Menu_Mark (Men));
-   end Mark;
-
--------------------------------------------------------------------------------
-   procedure Set_Foreground
-     (Men   : Menu;
-      Fore  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Set_Menu_Fore (Men  : Menu;
-                              Attr : C_Chtype) return C_Int;
-      pragma Import (C, Set_Menu_Fore, "set_menu_fore");
-
-      Ch : constant Attributed_Character := (Ch    => Character'First,
-                                             Color => Color,
-                                             Attr  => Fore);
-      Res : constant Eti_Error := Set_Menu_Fore (Men, AttrChar_To_Chtype (Ch));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Foreground;
-
-   procedure Foreground (Men  : Menu;
-                         Fore : out Character_Attribute_Set)
-   is
-      function Menu_Fore (Men : Menu) return C_Chtype;
-      pragma Import (C, Menu_Fore, "menu_fore");
-   begin
-      Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
-   end Foreground;
-
-   procedure Foreground (Men   : Menu;
-                         Fore  : out Character_Attribute_Set;
-                         Color : out Color_Pair)
-   is
-      function Menu_Fore (Men : Menu) return C_Chtype;
-      pragma Import (C, Menu_Fore, "menu_fore");
-   begin
-      Fore  := Chtype_To_AttrChar (Menu_Fore (Men)).Attr;
-      Color := Chtype_To_AttrChar (Menu_Fore (Men)).Color;
-   end Foreground;
-
-   procedure Set_Background
-     (Men   : Menu;
-      Back  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Set_Menu_Back (Men  : Menu;
-                              Attr : C_Chtype) return C_Int;
-      pragma Import (C, Set_Menu_Back, "set_menu_back");
-
-      Ch : constant Attributed_Character := (Ch    => Character'First,
-                                             Color => Color,
-                                             Attr  => Back);
-      Res : constant Eti_Error := Set_Menu_Back (Men, AttrChar_To_Chtype (Ch));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Background;
-
-   procedure Background (Men  : Menu;
-                         Back : out Character_Attribute_Set)
-   is
-      function Menu_Back (Men : Menu) return C_Chtype;
-      pragma Import (C, Menu_Back, "menu_back");
-   begin
-      Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
-   end Background;
-
-   procedure Background (Men   : Menu;
-                         Back  : out Character_Attribute_Set;
-                         Color : out Color_Pair)
-   is
-      function Menu_Back (Men : Menu) return C_Chtype;
-      pragma Import (C, Menu_Back, "menu_back");
-   begin
-      Back  := Chtype_To_AttrChar (Menu_Back (Men)).Attr;
-      Color := Chtype_To_AttrChar (Menu_Back (Men)).Color;
-   end Background;
-
-   procedure Set_Grey (Men   : Menu;
-                       Grey  : Character_Attribute_Set := Normal_Video;
-                       Color : Color_Pair := Color_Pair'First)
-   is
-      function Set_Menu_Grey (Men  : Menu;
-                              Attr : C_Chtype) return C_Int;
-      pragma Import (C, Set_Menu_Grey, "set_menu_grey");
-
-      Ch : constant Attributed_Character := (Ch    => Character'First,
-                                             Color => Color,
-                                             Attr  => Grey);
-
-      Res : constant Eti_Error := Set_Menu_Grey (Men, AttrChar_To_Chtype (Ch));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Grey;
-
-   procedure Grey (Men  : Menu;
-                   Grey : out Character_Attribute_Set)
-   is
-      function Menu_Grey (Men : Menu) return C_Chtype;
-      pragma Import (C, Menu_Grey, "menu_grey");
-   begin
-      Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
-   end Grey;
-
-   procedure Grey (Men  : Menu;
-                   Grey : out Character_Attribute_Set;
-                   Color : out Color_Pair)
-   is
-      function Menu_Grey (Men : Menu) return C_Chtype;
-      pragma Import (C, Menu_Grey, "menu_grey");
-   begin
-      Grey  := Chtype_To_AttrChar (Menu_Grey (Men)).Attr;
-      Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color;
-   end Grey;
-
-   procedure Set_Pad_Character (Men : Menu;
-                                Pad : Character := Space)
-   is
-      function Set_Menu_Pad (Men : Menu;
-                             Ch  : C_Int) return C_Int;
-      pragma Import (C, Set_Menu_Pad, "set_menu_pad");
-
-      Res : constant Eti_Error := Set_Menu_Pad (Men,
-                                                C_Int (Character'Pos (Pad)));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Pad_Character;
-
-   procedure Pad_Character (Men : Menu;
-                            Pad : out Character)
-   is
-      function Menu_Pad (Men : Menu) return C_Int;
-      pragma Import (C, Menu_Pad, "menu_pad");
-   begin
-      Pad := Character'Val (Menu_Pad (Men));
-   end Pad_Character;
--------------------------------------------------------------------------------
-   procedure Set_Spacing (Men   : Menu;
-                          Descr : Column_Position := 0;
-                          Row   : Line_Position   := 0;
-                          Col   : Column_Position := 0)
-   is
-      function Set_Spacing (Men     : Menu;
-                            D, R, C : C_Int) return C_Int;
-      pragma Import (C, Set_Spacing, "set_menu_spacing");
-
-      Res : constant Eti_Error := Set_Spacing (Men,
-                                               C_Int (Descr),
-                                               C_Int (Row),
-                                               C_Int (Col));
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Spacing;
-
-   procedure Spacing (Men   : Menu;
-                      Descr : out Column_Position;
-                      Row   : out Line_Position;
-                      Col   : out Column_Position)
-   is
-      type C_Int_Access is access all C_Int;
-      function Get_Spacing (Men     : Menu;
-                            D, R, C : C_Int_Access) return C_Int;
-      pragma Import (C, Get_Spacing, "menu_spacing");
-
-      D, R, C : aliased C_Int;
-      Res : constant Eti_Error := Get_Spacing (Men,
-                                               D'Access,
-                                               R'Access,
-                                               C'Access);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      else
-         Descr := Column_Position (D);
-         Row   := Line_Position (R);
-         Col   := Column_Position (C);
-      end if;
-   end Spacing;
--------------------------------------------------------------------------------
-   function Set_Pattern (Men  : Menu;
-                         Text : String) return Boolean
-   is
-      type Char_Ptr is access all Interfaces.C.char;
-      function Set_Pattern (Men     : Menu;
-                            Pattern : Char_Ptr) return C_Int;
-      pragma Import (C, Set_Pattern, "set_menu_pattern");
-
-      S   : char_array (0 .. Text'Length);
-      L   : size_t;
-      Res : Eti_Error;
-   begin
-      To_C (Text, S, L);
-      Res := Set_Pattern (Men, S (S'First)'Access);
-      case Res is
-         when E_No_Match => return False;
-         when E_Ok       => return True;
-         when others =>
-            Eti_Exception (Res);
-            return False;
-      end case;
-   end Set_Pattern;
-
-   procedure Pattern (Men  : Menu;
-                      Text : out String)
-   is
-      function Get_Pattern (Men : Menu) return chars_ptr;
-      pragma Import (C, Get_Pattern, "menu_pattern");
-   begin
-      Fill_String (Get_Pattern (Men), Text);
-   end Pattern;
--------------------------------------------------------------------------------
-   procedure Set_Format (Men     : Menu;
-                         Lines   : Line_Count;
-                         Columns : Column_Count)
-   is
-      function Set_Menu_Fmt (Men : Menu;
-                             Lin : C_Int;
-                             Col : C_Int) return C_Int;
-      pragma Import (C, Set_Menu_Fmt, "set_menu_format");
-
-      Res : constant Eti_Error := Set_Menu_Fmt (Men,
-                                                C_Int (Lines),
-                                                C_Int (Columns));
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Format;
-
-   procedure Format (Men     : Menu;
-                     Lines   : out Line_Count;
-                     Columns : out Column_Count)
-   is
-      type C_Int_Access is access all C_Int;
-      function Menu_Fmt (Men  : Menu;
-                         Y, X : C_Int_Access) return C_Int;
-      pragma Import (C, Menu_Fmt, "menu_format");
-
-      L, C : aliased C_Int;
-      Res  : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      else
-         Lines   := Line_Count (L);
-         Columns := Column_Count (C);
-      end if;
-   end Format;
--------------------------------------------------------------------------------
-   procedure Set_Item_Init_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function)
-   is
-      function Set_Item_Init (Men  : Menu;
-                              Proc : Menu_Hook_Function) return C_Int;
-      pragma Import (C, Set_Item_Init, "set_item_init");
-
-      Res : constant Eti_Error := Set_Item_Init (Men, Proc);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Item_Init_Hook;
-
-   procedure Set_Item_Term_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function)
-   is
-      function Set_Item_Term (Men  : Menu;
-                              Proc : Menu_Hook_Function) return C_Int;
-      pragma Import (C, Set_Item_Term, "set_item_term");
-
-      Res : constant Eti_Error := Set_Item_Term (Men, Proc);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Item_Term_Hook;
-
-   procedure Set_Menu_Init_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function)
-   is
-      function Set_Menu_Init (Men  : Menu;
-                              Proc : Menu_Hook_Function) return C_Int;
-      pragma Import (C, Set_Menu_Init, "set_menu_init");
-
-      Res : constant Eti_Error := Set_Menu_Init (Men, Proc);
-   begin
-      if  Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Menu_Init_Hook;
-
-   procedure Set_Menu_Term_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function)
-   is
-      function Set_Menu_Term (Men  : Menu;
-                              Proc : Menu_Hook_Function) return C_Int;
-      pragma Import (C, Set_Menu_Term, "set_menu_term");
-
-      Res : constant Eti_Error := Set_Menu_Term (Men, Proc);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-   end Set_Menu_Term_Hook;
-
-   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function
-   is
-      function Item_Init (Men : Menu) return Menu_Hook_Function;
-      pragma Import (C, Item_Init, "item_init");
-   begin
-      return Item_Init (Men);
-   end Get_Item_Init_Hook;
-
-   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function
-   is
-      function Item_Term (Men : Menu) return Menu_Hook_Function;
-      pragma Import (C, Item_Term, "item_term");
-   begin
-      return Item_Term (Men);
-   end Get_Item_Term_Hook;
-
-   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function
-   is
-      function Menu_Init (Men : Menu) return Menu_Hook_Function;
-      pragma Import (C, Menu_Init, "menu_init");
-   begin
-      return Menu_Init (Men);
-   end Get_Menu_Init_Hook;
-
-   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function
-   is
-      function Menu_Term (Men : Menu) return Menu_Hook_Function;
-      pragma Import (C, Menu_Term, "menu_term");
-   begin
-      return Menu_Term (Men);
-   end Get_Menu_Term_Hook;
--------------------------------------------------------------------------------
-   procedure Redefine (Men   : Menu;
-                       Items : Item_Array_Access)
-   is
-      function Set_Items (Men   : Menu;
-                          Items : System.Address) return C_Int;
-      pragma Import (C, Set_Items, "set_menu_items");
-
-      Res : Eti_Error;
-   begin
-      pragma Assert (Items.all (Items'Last) = Null_Item);
-      if Items.all (Items'Last) /= Null_Item then
-         raise Menu_Exception;
-      else
-         Res := Set_Items (Men, Items.all'Address);
-         if  Res /= E_Ok then
-            Eti_Exception (Res);
-         end if;
-      end if;
-   end Redefine;
-
-   function Item_Count (Men : Menu) return Natural
-   is
-      function Count (Men : Menu) return C_Int;
-      pragma Import (C, Count, "item_count");
-   begin
-      return Natural (Count (Men));
-   end Item_Count;
-
-   function Items (Men   : Menu;
-                   Index : Positive) return Item
-   is
-      use I_Array;
-
-      function C_Mitems (Men : Menu) return Pointer;
-      pragma Import (C, C_Mitems, "menu_items");
-
-      P : Pointer := C_Mitems (Men);
-   begin
-      if P = null or else Index > Item_Count (Men) then
-         raise Menu_Exception;
-      else
-         P := P + ptrdiff_t (C_Int (Index) - 1);
-         return P.all;
-      end if;
-   end Items;
-
--------------------------------------------------------------------------------
-   function Create (Items : Item_Array_Access) return Menu
-   is
-      function Newmenu (Items : System.Address) return Menu;
-      pragma Import (C, Newmenu, "new_menu");
-
-      M   : Menu;
-   begin
-      pragma Assert (Items.all (Items'Last) = Null_Item);
-      if Items.all (Items'Last) /= Null_Item then
-         raise Menu_Exception;
-      else
-         M := Newmenu (Items.all'Address);
-         if M = Null_Menu then
-            raise Menu_Exception;
-         end if;
-         return M;
-      end if;
-   end Create;
-
-   procedure Delete (Men : in out Menu)
-   is
-      function Free (Men : Menu) return C_Int;
-      pragma Import (C, Free, "free_menu");
-
-      Res : constant Eti_Error := Free (Men);
-   begin
-      if Res /= E_Ok then
-         Eti_Exception (Res);
-      end if;
-      Men := Null_Menu;
-   end Delete;
-
-------------------------------------------------------------------------------
-   function Driver (Men : Menu;
-                    Key : Key_Code) return Driver_Result
-   is
-      function Driver (Men : Menu;
-                       Key : C_Int) return C_Int;
-      pragma Import (C, Driver, "menu_driver");
-
-      R : constant Eti_Error := Driver (Men, C_Int (Key));
-   begin
-      if R /= E_Ok then
-         case R is
-            when E_Unknown_Command  => return Unknown_Request;
-            when E_No_Match         => return No_Match;
-            when E_Request_Denied |
-                 E_Not_Selectable   => return Request_Denied;
-            when others =>
-               Eti_Exception (R);
-         end case;
-      end if;
-      return Menu_Ok;
-   end Driver;
-
-   procedure Free (IA         : in out Item_Array_Access;
-                   Free_Items : Boolean := False)
-   is
-      procedure Release is new Ada.Unchecked_Deallocation
-        (Item_Array, Item_Array_Access);
-   begin
-      if IA /= null and then Free_Items then
-         for I in IA'First .. (IA'Last - 1) loop
-            if IA.all (I) /= Null_Item then
-               Delete (IA.all (I));
-            end if;
-         end loop;
-      end if;
-      Release (IA);
-   end Free;
-
--------------------------------------------------------------------------------
-   function Default_Menu_Options return Menu_Option_Set
-   is
-   begin
-      return Get_Options (Null_Menu);
-   end Default_Menu_Options;
-
-   function Default_Item_Options return Item_Option_Set
-   is
-   begin
-      return Get_Options (Null_Item);
-   end Default_Item_Options;
--------------------------------------------------------------------------------
-
-end Terminal_Interface.Curses.Menus;
-
diff --git a/doc/html/ada/terminal_interface-curses-menus__ads.htm b/doc/html/ada/terminal_interface-curses-menus__ads.htm deleted file mode 100644 index a0220657dd4..00000000000 --- a/doc/html/ada/terminal_interface-curses-menus__ads.htm +++ /dev/null @@ -1,685 +0,0 @@ - -terminal_interface-curses-menus.ads - -

File : terminal_interface-curses-menus.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Menu                      --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2007,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.28 @
---  @Date: 2009/12/26 18:35:22 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
---  menu binding.
---  This module is generated. Please don't change it manually!
---  Run the generator instead.
---  |
-with System;
-with Ada.Characters.Latin_1;
-
-package Terminal_Interface.Curses.Menus is
-   pragma Preelaborate (Terminal_Interface.Curses.Menus);
-   pragma Linker_Options ("-lmenu");
-   pragma Linker_Options ("-lncurses");
-
-   Space : Character renames Ada.Characters.Latin_1.Space;
-
-   type Item is private;
-   type Menu is private;
-
-   ---------------------------
-   --  Interface constants  --
-   ---------------------------
-   Null_Item : constant Item;
-   Null_Menu : constant Menu;
-
-   subtype Menu_Request_Code is Key_Code
-     range (Key_Max + 1) .. (Key_Max + 17);
-
-   --  The prefix M_ stands for "Menu Request"
-   M_Left_Item       : constant Menu_Request_Code := Key_Max + 1;
-   M_Right_Item      : constant Menu_Request_Code := Key_Max + 2;
-   M_Up_Item         : constant Menu_Request_Code := Key_Max + 3;
-   M_Down_Item       : constant Menu_Request_Code := Key_Max + 4;
-   M_ScrollUp_Line   : constant Menu_Request_Code := Key_Max + 5;
-   M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6;
-   M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7;
-   M_ScrollUp_Page   : constant Menu_Request_Code := Key_Max + 8;
-   M_First_Item      : constant Menu_Request_Code := Key_Max + 9;
-   M_Last_Item       : constant Menu_Request_Code := Key_Max + 10;
-   M_Next_Item       : constant Menu_Request_Code := Key_Max + 11;
-   M_Previous_Item   : constant Menu_Request_Code := Key_Max + 12;
-   M_Toggle_Item     : constant Menu_Request_Code := Key_Max + 13;
-   M_Clear_Pattern   : constant Menu_Request_Code := Key_Max + 14;
-   M_Back_Pattern    : constant Menu_Request_Code := Key_Max + 15;
-   M_Next_Match      : constant Menu_Request_Code := Key_Max + 16;
-   M_Previous_Match  : constant Menu_Request_Code := Key_Max + 17;
-
-   --  For those who like the old 'C' names for the request codes
-   REQ_LEFT_ITEM     : Menu_Request_Code renames M_Left_Item;
-   REQ_RIGHT_ITEM    : Menu_Request_Code renames M_Right_Item;
-   REQ_UP_ITEM       : Menu_Request_Code renames M_Up_Item;
-   REQ_DOWN_ITEM     : Menu_Request_Code renames M_Down_Item;
-   REQ_SCR_ULINE     : Menu_Request_Code renames M_ScrollUp_Line;
-   REQ_SCR_DLINE     : Menu_Request_Code renames M_ScrollDown_Line;
-   REQ_SCR_DPAGE     : Menu_Request_Code renames M_ScrollDown_Page;
-   REQ_SCR_UPAGE     : Menu_Request_Code renames M_ScrollUp_Page;
-   REQ_FIRST_ITEM    : Menu_Request_Code renames M_First_Item;
-   REQ_LAST_ITEM     : Menu_Request_Code renames M_Last_Item;
-   REQ_NEXT_ITEM     : Menu_Request_Code renames M_Next_Item;
-   REQ_PREV_ITEM     : Menu_Request_Code renames M_Previous_Item;
-   REQ_TOGGLE_ITEM   : Menu_Request_Code renames M_Toggle_Item;
-   REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern;
-   REQ_BACK_PATTERN  : Menu_Request_Code renames M_Back_Pattern;
-   REQ_NEXT_MATCH    : Menu_Request_Code renames M_Next_Match;
-   REQ_PREV_MATCH    : Menu_Request_Code renames M_Previous_Match;
-
-   procedure Request_Name (Key  : Menu_Request_Code;
-                           Name : out String);
-
-   function  Request_Name (Key : Menu_Request_Code) return String;
-   --  Same as function
-
-   ------------------
-   --  Exceptions  --
-   ------------------
-
-   Menu_Exception : exception;
-   --
-   --  Menu options
-   --
-   pragma Warnings (Off);
-   type Menu_Option_Set is
-      record
-         One_Valued        : Boolean;
-         Show_Descriptions : Boolean;
-         Row_Major_Order   : Boolean;
-         Ignore_Case       : Boolean;
-         Show_Matches      : Boolean;
-         Non_Cyclic        : Boolean;
-         Unused            : Boolean;
-      end record;
-   pragma Convention (C, Menu_Option_Set);
-
-   for Menu_Option_Set use
-      record
-         One_Valued        at 0 range  0 ..  0;
-         Show_Descriptions at 0 range  1 ..  1;
-         Row_Major_Order   at 0 range  2 ..  2;
-         Ignore_Case       at 0 range  3 ..  3;
-         Show_Matches      at 0 range  4 ..  4;
-         Non_Cyclic        at 0 range  5 ..  5;
-         Unused            at 0 range  6 .. 31;
-      end record;
-   for Menu_Option_Set'Size use 32;
-   --  Please note: this rep. clause is generated and may be
-   --               different on your system.
-   pragma Warnings (On);
-
-   function Default_Menu_Options return Menu_Option_Set;
-   --  Initial default options for a menu.
-   pragma Inline (Default_Menu_Options);
-   --
-   --  Item options
-   --
-   pragma Warnings (Off);
-   type Item_Option_Set is
-      record
-         Selectable  : Boolean;
-         Unused      : Boolean;
-      end record;
-   pragma Convention (C, Item_Option_Set);
-
-   for Item_Option_Set use
-      record
-         Selectable  at 0 range  0 ..  0;
-         Unused      at 0 range  1 .. 31;
-      end record;
-   for Item_Option_Set'Size use 32;
-   --  Please note: this rep. clause is generated and may be
-   --               different on your system.
-   pragma Warnings (On);
-
-   function Default_Item_Options return Item_Option_Set;
-   --  Initial default options for an item.
-   pragma Inline (Default_Item_Options);
-
-   --
-   --  Item Array
-   --
-   type Item_Array is array (Positive range <>) of aliased Item;
-   pragma Convention (C, Item_Array);
-
-   type Item_Array_Access is access Item_Array;
-
-   procedure Free (IA         : in out Item_Array_Access;
-                   Free_Items : Boolean := False);
-   --  Release the memory for an allocated item array
-   --  If Free_Items is True, call Delete() for all the items in
-   --  the array.
-
-   --  |=====================================================================
-   --  | Man page mitem_new.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   function Create (Name        : String;
-                    Description : String := "") return Item;
-   --  AKA: new_item()
-   --  Not inlined.
-
-   --  #1A NAME="AFU_2"#2|
-   function New_Item (Name        : String;
-                      Description : String := "") return Item
-     renames Create;
-   --  AKA: new_item()
-
-   --  #1A NAME="AFU_3"#2|
-   procedure Delete (Itm : in out Item);
-   --  AKA: free_item()
-   --  Resets Itm to Null_Item
-
-   --  |=====================================================================
-   --  | Man page mitem_value.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_4"#2|
-   procedure Set_Value (Itm   : Item;
-                        Value : Boolean := True);
-   --  AKA: set_item_value()
-   pragma Inline (Set_Value);
-
-   --  #1A NAME="AFU_5"#2|
-   function Value (Itm : Item) return Boolean;
-   --  AKA: item_value()
-   pragma Inline (Value);
-
-   --  |=====================================================================
-   --  | Man page mitem_visible.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_6"#2|
-   function Visible (Itm : Item) return Boolean;
-   --  AKA: item_visible()
-   pragma Inline (Visible);
-
-   --  |=====================================================================
-   --  | Man page mitem_opts.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_7"#2|
-   procedure Set_Options (Itm     : Item;
-                          Options : Item_Option_Set);
-   --  AKA: set_item_opts()
-   --  An overloaded Set_Options is defined later. Pragma Inline appears there
-
-   --  #1A NAME="AFU_8"#2|
-   procedure Switch_Options (Itm     : Item;
-                             Options : Item_Option_Set;
-                             On      : Boolean := True);
-   --  AKA: item_opts_on()
-   --  AKA: item_opts_off()
-   --  An overloaded Switch_Options is defined later.
-   --  Pragma Inline appears there
-
-   --  #1A NAME="AFU_9"#2|
-   procedure Get_Options (Itm     : Item;
-                          Options : out Item_Option_Set);
-   --  AKA: item_opts()
-
-   --  #1A NAME="AFU_10"#2|
-   function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
-   --  AKA: item_opts()
-   --  An overloaded Get_Options is defined later. Pragma Inline appears there
-
-   --  |=====================================================================
-   --  | Man page mitem_name.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_11"#2|
-   procedure Name (Itm  : Item;
-                   Name : out String);
-   --  AKA: item_name()
-   function  Name (Itm : Item) return String;
-   --  AKA: item_name()
-   --  Implemented as function
-   pragma Inline (Name);
-
-   --  #1A NAME="AFU_12"#2|
-   procedure Description (Itm         : Item;
-                          Description : out String);
-   --  AKA: item_description();
-
-   function  Description (Itm : Item) return String;
-   --  AKA: item_description();
-   --  Implemented as function
-   pragma Inline (Description);
-
-   --  |=====================================================================
-   --  | Man page mitem_current.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_13"#2|
-   procedure Set_Current (Men : Menu;
-                          Itm : Item);
-   --  AKA: set_current_item()
-   pragma Inline (Set_Current);
-
-   --  #1A NAME="AFU_14"#2|
-   function Current (Men : Menu) return Item;
-   --  AKA: current_item()
-   pragma Inline (Current);
-
-   --  #1A NAME="AFU_15"#2|
-   procedure Set_Top_Row (Men  : Menu;
-                          Line : Line_Position);
-   --  AKA: set_top_row()
-   pragma Inline (Set_Top_Row);
-
-   --  #1A NAME="AFU_16"#2|
-   function Top_Row (Men : Menu) return Line_Position;
-   --  AKA: top_row()
-   pragma Inline (Top_Row);
-
-   --  #1A NAME="AFU_17"#2|
-   function Get_Index (Itm : Item) return Positive;
-   --  AKA: item_index()
-   --  Please note that in this binding we start the numbering of items
-   --  with 1. So this is number is one more than you get from the low
-   --  level call.
-   pragma Inline (Get_Index);
-
-   --  |=====================================================================
-   --  | Man page menu_post.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_18"#2|
-   procedure Post (Men  : Menu;
-                   Post : Boolean := True);
-   --  AKA: post_menu()
-   --  AKA: unpost_menu()
-   pragma Inline (Post);
-
-   --  |=====================================================================
-   --  | Man page menu_opts.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_19"#2|
-   procedure Set_Options (Men     : Menu;
-                          Options : Menu_Option_Set);
-   --  AKA: set_menu_opts()
-   pragma Inline (Set_Options);
-
-   --  #1A NAME="AFU_20"#2|
-   procedure Switch_Options (Men     : Menu;
-                             Options : Menu_Option_Set;
-                             On      : Boolean := True);
-   --  AKA: menu_opts_on()
-   --  AKA: menu_opts_off()
-   pragma Inline (Switch_Options);
-
-   --  #1A NAME="AFU_21"#2|
-   procedure Get_Options (Men     : Menu;
-                          Options : out Menu_Option_Set);
-   --  AKA: menu_opts()
-
-   --  #1A NAME="AFU_22"#2|
-   function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
-   --  AKA: menu_opts()
-   pragma Inline (Get_Options);
-
-   --  |=====================================================================
-   --  | Man page menu_win.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_23"#2|
-   procedure Set_Window (Men : Menu;
-                         Win : Window);
-   --  AKA: set_menu_win()
-   pragma Inline (Set_Window);
-
-   --  #1A NAME="AFU_24"#2|
-   function Get_Window (Men : Menu) return Window;
-   --  AKA: menu_win()
-   pragma Inline (Get_Window);
-
-   --  #1A NAME="AFU_25"#2|
-   procedure Set_Sub_Window (Men : Menu;
-                             Win : Window);
-   --  AKA: set_menu_sub()
-   pragma Inline (Set_Sub_Window);
-
-   --  #1A NAME="AFU_26"#2|
-   function Get_Sub_Window (Men : Menu) return Window;
-   --  AKA: menu_sub()
-   pragma Inline (Get_Sub_Window);
-
-   --  #1A NAME="AFU_27"#2|
-   procedure Scale (Men     : Menu;
-                    Lines   : out Line_Count;
-                    Columns : out Column_Count);
-   --  AKA: scale_menu()
-   pragma Inline (Scale);
-
-   --  |=====================================================================
-   --  | Man page menu_cursor.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_28"#2|
-   procedure Position_Cursor (Men : Menu);
-   --  AKA: pos_menu_cursor()
-   pragma Inline (Position_Cursor);
-
-   --  |=====================================================================
-   --  | Man page menu_mark.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_29"#2|
-   procedure Set_Mark (Men  : Menu;
-                       Mark : String);
-   --  AKA: set_menu_mark()
-   pragma Inline (Set_Mark);
-
-   --  #1A NAME="AFU_30"#2|
-   procedure Mark (Men  : Menu;
-                   Mark : out String);
-   --  AKA: menu_mark()
-
-   function  Mark (Men : Menu) return String;
-   --  AKA: menu_mark()
-   --  Implemented as function
-   pragma Inline (Mark);
-
-   --  |=====================================================================
-   --  | Man page menu_attributes.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_31"#2|
-   procedure Set_Foreground
-     (Men   : Menu;
-      Fore  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: set_menu_fore()
-   pragma Inline (Set_Foreground);
-
-   --  #1A NAME="AFU_32"#2|
-   procedure Foreground (Men   : Menu;
-                         Fore  : out Character_Attribute_Set);
-   --  AKA: menu_fore()
-
-   --  #1A NAME="AFU_33"#2|
-   procedure Foreground (Men   : Menu;
-                         Fore  : out Character_Attribute_Set;
-                         Color : out Color_Pair);
-   --  AKA: menu_fore()
-   pragma Inline (Foreground);
-
-   --  #1A NAME="AFU_34"#2|
-   procedure Set_Background
-     (Men   : Menu;
-      Back  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: set_menu_back()
-   pragma Inline (Set_Background);
-
-   --  #1A NAME="AFU_35"#2|
-   procedure Background (Men  : Menu;
-                         Back : out Character_Attribute_Set);
-   --  AKA: menu_back()
-   --  #1A NAME="AFU_36"#2|
-
-   procedure Background (Men   : Menu;
-                         Back  : out Character_Attribute_Set;
-                         Color : out Color_Pair);
-   --  AKA: menu_back()
-   pragma Inline (Background);
-
-   --  #1A NAME="AFU_37"#2|
-   procedure Set_Grey
-     (Men   : Menu;
-      Grey  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: set_menu_grey()
-   pragma Inline (Set_Grey);
-
-   --  #1A NAME="AFU_38"#2|
-   procedure Grey (Men  : Menu;
-                   Grey : out Character_Attribute_Set);
-   --  AKA: menu_grey()
-
-   --  #1A NAME="AFU_39"#2|
-   procedure Grey
-     (Men   : Menu;
-      Grey  : out Character_Attribute_Set;
-      Color : out Color_Pair);
-   --  AKA: menu_grey()
-   pragma Inline (Grey);
-
-   --  #1A NAME="AFU_40"#2|
-   procedure Set_Pad_Character (Men : Menu;
-                                Pad : Character := Space);
-   --  AKA: set_menu_pad()
-   pragma Inline (Set_Pad_Character);
-
-   --  #1A NAME="AFU_41"#2|
-   procedure Pad_Character (Men : Menu;
-                            Pad : out Character);
-   --  AKA: menu_pad()
-   pragma Inline (Pad_Character);
-
-   --  |=====================================================================
-   --  | Man page menu_spacing.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_42"#2|
-   procedure Set_Spacing (Men   : Menu;
-                          Descr : Column_Position := 0;
-                          Row   : Line_Position   := 0;
-                          Col   : Column_Position := 0);
-   --  AKA: set_menu_spacing()
-   pragma Inline (Set_Spacing);
-
-   --  #1A NAME="AFU_43"#2|
-   procedure Spacing (Men   : Menu;
-                      Descr : out Column_Position;
-                      Row   : out Line_Position;
-                      Col   : out Column_Position);
-   --  AKA: menu_spacing()
-   pragma Inline (Spacing);
-
-   --  |=====================================================================
-   --  | Man page menu_pattern.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_44"#2|
-   function Set_Pattern (Men  : Menu;
-                         Text : String) return Boolean;
-   --  AKA: set_menu_pattern()
-   --  Return TRUE if the pattern matches, FALSE otherwise
-   pragma Inline (Set_Pattern);
-
-   --  #1A NAME="AFU_45"#2|
-   procedure Pattern (Men  : Menu;
-                      Text : out String);
-   --  AKA: menu_pattern()
-   pragma Inline (Pattern);
-
-   --  |=====================================================================
-   --  | Man page menu_format.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_46"#2|
-   procedure Set_Format (Men     : Menu;
-                         Lines   : Line_Count;
-                         Columns : Column_Count);
-   --  Not implemented: 0 argument for Lines or Columns;
-   --  instead use Format to get the current sizes
-   --      The  default  format  is  16  rows,  1  column.    Calling
-   --      set_menu_format  with a null menu pointer will change this
-   --      default.  A zero row or column argument to set_menu_format
-   --      is  interpreted  as  a  request  not to change the current
-   --      value.
-   --  AKA: set_menu_format()
-   pragma Inline (Set_Format);
-
-   --  #1A NAME="AFU_47"#2|
-   procedure Format (Men     : Menu;
-                     Lines   : out Line_Count;
-                     Columns : out Column_Count);
-   --  AKA: menu_format()
-   pragma Inline (Format);
-
-   --  |=====================================================================
-   --  | Man page menu_hook.3x
-   --  |=====================================================================
-
-   type Menu_Hook_Function is access procedure (Men : Menu);
-   pragma Convention (C, Menu_Hook_Function);
-
-   --  #1A NAME="AFU_48"#2|
-   procedure Set_Item_Init_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function);
-   --  AKA: set_item_init()
-   pragma Inline (Set_Item_Init_Hook);
-
-   --  #1A NAME="AFU_49"#2|
-   procedure Set_Item_Term_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function);
-   --  AKA: set_item_term()
-   pragma Inline (Set_Item_Term_Hook);
-
-   --  #1A NAME="AFU_50"#2|
-   procedure Set_Menu_Init_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function);
-   --  AKA: set_menu_init()
-   pragma Inline (Set_Menu_Init_Hook);
-
-   --  #1A NAME="AFU_51"#2|
-   procedure Set_Menu_Term_Hook (Men  : Menu;
-                                 Proc : Menu_Hook_Function);
-   --  AKA: set_menu_term()
-   pragma Inline (Set_Menu_Term_Hook);
-
-   --  #1A NAME="AFU_52"#2|
-   function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
-   --  AKA: item_init()
-   pragma Inline (Get_Item_Init_Hook);
-
-   --  #1A NAME="AFU_53"#2|
-   function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
-   --  AKA: item_term()
-   pragma Inline (Get_Item_Term_Hook);
-
-   --  #1A NAME="AFU_54"#2|
-   function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
-   --  AKA: menu_init()
-   pragma Inline (Get_Menu_Init_Hook);
-
-   --  #1A NAME="AFU_55"#2|
-   function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
-   --  AKA: menu_term()
-   pragma Inline (Get_Menu_Term_Hook);
-
-   --  |=====================================================================
-   --  | Man page menu_items.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_56"#2|
-   procedure Redefine (Men   : Menu;
-                       Items : Item_Array_Access);
-   --  AKA: set_menu_items()
-   pragma Inline (Redefine);
-
-   procedure Set_Items (Men   : Menu;
-                        Items : Item_Array_Access) renames Redefine;
-   --  pragma Inline (Set_Items);
-
-   --  #1A NAME="AFU_57"#2|
-   function Items (Men   : Menu;
-                   Index : Positive) return Item;
-   --  AKA: menu_items()
-   pragma Inline (Items);
-
-   --  #1A NAME="AFU_58"#2|
-   function Item_Count (Men : Menu) return Natural;
-   --  AKA: item_count()
-   pragma Inline (Item_Count);
-
-   --  |=====================================================================
-   --  | Man page menu_new.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_59"#2|
-   function Create (Items : Item_Array_Access) return Menu;
-   --  AKA: new_menu()
-   --  Not inlined
-
-   function New_Menu (Items : Item_Array_Access) return Menu renames Create;
-
-   --  #1A NAME="AFU_60"#2|
-   procedure Delete (Men : in out Menu);
-   --  AKA: free_menu()
-   --  Reset Men to Null_Menu
-   --  Not inlined
-
-   --  |=====================================================================
-   --  | Man page menu_driver.3x
-   --  |=====================================================================
-
-   type Driver_Result is (Menu_Ok,
-                          Request_Denied,
-                          Unknown_Request,
-                          No_Match);
-
-   --  #1A NAME="AFU_61"#2|
-   function Driver (Men : Menu;
-                    Key : Key_Code) return Driver_Result;
-   --  AKA: menu_driver()
-   --  Driver is not inlined
-
-   --  #1A NAME="AFU_62"#2|
-   --  Not Implemented: menu_request_name, menu_request_by_name
--------------------------------------------------------------------------------
-private
-   type Item   is new System.Storage_Elements.Integer_Address;
-   type Menu   is new System.Storage_Elements.Integer_Address;
-
-   Null_Item : constant Item := 0;
-   Null_Menu : constant Menu := 0;
-
-end Terminal_Interface.Curses.Menus;
-
diff --git a/doc/html/ada/terminal_interface-curses-mouse__adb.htm b/doc/html/ada/terminal_interface-curses-mouse__adb.htm deleted file mode 100644 index f75789c081d..00000000000 --- a/doc/html/ada/terminal_interface-curses-mouse__adb.htm +++ /dev/null @@ -1,223 +0,0 @@ - -terminal_interface-curses-mouse.adb - -

File : terminal_interface-curses-mouse.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                     Terminal_Interface.Curses.Mouse                      --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.24 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-with Interfaces.C; use Interfaces.C;
-use Interfaces;
-
-package body Terminal_Interface.Curses.Mouse is
-
-   use type System.Bit_Order;
-
-   function Has_Mouse return Boolean
-   is
-      function Mouse_Avail return C_Int;
-      pragma Import (C, Mouse_Avail, "has_mouse");
-   begin
-      if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
-         return True;
-      else
-         return False;
-      end if;
-   end Has_Mouse;
-
-   function Get_Mouse return Mouse_Event
-   is
-      type Event_Access is access all Mouse_Event;
-
-      function Getmouse (Ev : Event_Access) return C_Int;
-      pragma Import (C, Getmouse, "getmouse");
-
-      Event : aliased Mouse_Event;
-   begin
-      if Getmouse (Event'Access) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-      return Event;
-   end Get_Mouse;
-
-   procedure Register_Reportable_Event (Button : Mouse_Button;
-                                        State  : Button_State;
-                                        Mask   : in out Event_Mask)
-   is
-      Button_Nr : constant Natural := Mouse_Button'Pos (Button);
-      State_Nr  : constant Natural := Button_State'Pos (State);
-   begin
-      if Button in Modifier_Keys and then State /= Pressed then
-         raise Curses_Exception;
-      else
-         if Button in Real_Buttons then
-            Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr);
-         else
-            Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4));
-         end if;
-      end if;
-   end Register_Reportable_Event;
-
-   procedure Register_Reportable_Events (Button : Mouse_Button;
-                                         State  : Button_States;
-                                         Mask   : in out Event_Mask)
-   is
-   begin
-      for S in Button_States'Range loop
-         if State (S) then
-            Register_Reportable_Event (Button, S, Mask);
-         end if;
-      end loop;
-   end Register_Reportable_Events;
-
-   function Start_Mouse (Mask : Event_Mask := All_Events)
-                         return Event_Mask
-   is
-      function MMask (M : Event_Mask;
-                      O : access Event_Mask) return Event_Mask;
-      pragma Import (C, MMask, "mousemask");
-      R   : Event_Mask;
-      Old : aliased Event_Mask;
-   begin
-      R := MMask (Mask, Old'Access);
-      if R = No_Events then
-         Beep;
-      end if;
-      return Old;
-   end Start_Mouse;
-
-   procedure End_Mouse (Mask : Event_Mask := No_Events)
-   is
-   begin
-      if Mask /= No_Events then
-         Beep;
-      end if;
-   end End_Mouse;
-
-   procedure Dispatch_Event (Mask   : Event_Mask;
-                             Button : out Mouse_Button;
-                             State  : out Button_State);
-
-   procedure Dispatch_Event (Mask   : Event_Mask;
-                             Button : out Mouse_Button;
-                             State  : out Button_State) is
-      L : Event_Mask;
-   begin
-      Button := Alt;  --  preset to non real button;
-      if (Mask and BUTTON1_EVENTS) /= 0 then
-         Button := Left;
-      elsif (Mask and BUTTON2_EVENTS) /= 0 then
-         Button := Middle;
-      elsif (Mask and BUTTON3_EVENTS) /= 0 then
-         Button := Right;
-      elsif (Mask and BUTTON4_EVENTS) /= 0 then
-         Button := Button4;
-      end if;
-      if Button in Real_Buttons then
-         L := 2 ** (6 * Mouse_Button'Pos (Button));
-         for I in Button_State'Range loop
-            if (Mask and L) /= 0 then
-               State := I;
-               exit;
-            end if;
-            L := 2 * L;
-         end loop;
-      else
-         State := Pressed;
-         if (Mask and BUTTON_CTRL) /= 0 then
-            Button := Control;
-         elsif (Mask and BUTTON_SHIFT) /= 0 then
-            Button := Shift;
-         elsif (Mask and BUTTON_ALT) /= 0 then
-            Button := Alt;
-         end if;
-      end if;
-   end Dispatch_Event;
-
-   procedure Get_Event (Event  : Mouse_Event;
-                        Y      : out Line_Position;
-                        X      : out Column_Position;
-                        Button : out Mouse_Button;
-                        State  : out Button_State)
-   is
-      Mask  : constant Event_Mask := Event.Bstate;
-   begin
-      X := Column_Position (Event.X);
-      Y := Line_Position   (Event.Y);
-      Dispatch_Event (Mask, Button, State);
-   end Get_Event;
-
-   procedure Unget_Mouse (Event : Mouse_Event)
-   is
-      function Ungetmouse (Ev : Mouse_Event) return C_Int;
-      pragma Import (C, Ungetmouse, "ungetmouse");
-   begin
-      if Ungetmouse (Event) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Unget_Mouse;
-
-   function Enclosed_In_Window (Win    : Window := Standard_Window;
-                                Event  : Mouse_Event) return Boolean
-   is
-      function Wenclose (Win : Window; Y : C_Int; X : C_Int)
-                         return Curses_Bool;
-      pragma Import (C, Wenclose, "wenclose");
-   begin
-      if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X))
-        = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Enclosed_In_Window;
-
-   function Mouse_Interval (Msec : Natural := 200) return Natural
-   is
-      function Mouseinterval (Msec : C_Int) return C_Int;
-      pragma Import (C, Mouseinterval, "mouseinterval");
-   begin
-      return Natural (Mouseinterval (C_Int (Msec)));
-   end Mouse_Interval;
-
-end Terminal_Interface.Curses.Mouse;
-
diff --git a/doc/html/ada/terminal_interface-curses-mouse__ads.htm b/doc/html/ada/terminal_interface-curses-mouse__ads.htm deleted file mode 100644 index b02db8e1d84..00000000000 --- a/doc/html/ada/terminal_interface-curses-mouse__ads.htm +++ /dev/null @@ -1,231 +0,0 @@ - -terminal_interface-curses-mouse.ads - -

File : terminal_interface-curses-mouse.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Mouse                     --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.29 @
---  @Date: 2011/03/19 12:35:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
---  mouse binding.
---  This module is generated. Please don't change it manually!
---  Run the generator instead.
---  |
-with System;
-
-package Terminal_Interface.Curses.Mouse is
-   pragma Preelaborate (Terminal_Interface.Curses.Mouse);
-
-   --  |=====================================================================
-   --  | Man page curs_mouse.3x
-   --  |=====================================================================
-   --  mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates
-   --  in the parent package.
-   --
-   --  Not implemented:
-   --  REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event
-   --  or Start_Mouse)
-   type Event_Mask is private;
-   No_Events  : constant Event_Mask;
-   All_Events : constant Event_Mask;
-
-   type Mouse_Button is (Left,     -- aka: Button 1
-                         Middle,   -- aka: Button 2
-                         Right,    -- aka: Button 3
-                         Button4,  -- aka: Button 4
-                         Control,  -- Control Key
-                         Shift,    -- Shift Key
-                         Alt);     -- ALT Key
-
-   subtype Real_Buttons  is Mouse_Button range Left .. Button4;
-   subtype Modifier_Keys is Mouse_Button range Control .. Alt;
-
-   type Button_State is (Released,
-                         Pressed,
-                         Clicked,
-                         Double_Clicked,
-                         Triple_Clicked);
-
-   type Button_States is array (Button_State) of Boolean;
-   pragma Pack (Button_States);
-
-   All_Clicks : constant Button_States := (Clicked .. Triple_Clicked => True,
-                                           others => False);
-   All_States : constant Button_States := (others => True);
-
-   type Mouse_Event is private;
-
-   --  |=====================================================================
-   --  | Man page curs_mouse.3x
-   --  |=====================================================================
-
-   function Has_Mouse return Boolean;
-   --  Return true if a mouse device is supported, false otherwise.
-
-   procedure Register_Reportable_Event
-     (Button : Mouse_Button;
-      State  : Button_State;
-      Mask   : in out Event_Mask);
-   --  Stores the event described by the button and the state in the mask.
-   --  Before you call this the first time, you should initialize the mask
-   --  with the Empty_Mask constant
-   pragma Inline (Register_Reportable_Event);
-
-   procedure Register_Reportable_Events
-     (Button : Mouse_Button;
-      State  : Button_States;
-      Mask   : in out Event_Mask);
-   --  Register all events described by the Button and the State bitmap.
-   --  Before you call this the first time, you should initialize the mask
-   --  with the Empty_Mask constant
-
-   --  #1A NAME="AFU_1"#2|
-   --  There is one difference to mousmask(): we return the value of the
-   --  old mask, that means the event mask value before this call.
-   --  Not Implemented: The library version
-   --  returns a Mouse_Mask that tells which events are reported.
-   function Start_Mouse (Mask : Event_Mask := All_Events)
-                         return Event_Mask;
-   --  AKA: mousemask()
-   pragma Inline (Start_Mouse);
-
-   procedure End_Mouse (Mask : Event_Mask := No_Events);
-   --  Terminates the mouse, restores the specified event mask
-   pragma Inline (End_Mouse);
-
-   --  #1A NAME="AFU_2"#2|
-   function Get_Mouse return Mouse_Event;
-   --  AKA: getmouse()
-   pragma Inline (Get_Mouse);
-
-   procedure Get_Event (Event  : Mouse_Event;
-                        Y      : out Line_Position;
-                        X      : out Column_Position;
-                        Button : out Mouse_Button;
-                        State  : out Button_State);
-   --  !!! Warning: X and Y are screen coordinates. Due to ripped of lines they
-   --  may not be identical to window coordinates.
-   --  Not Implemented: Get_Event only reports one event, the C library
-   --  version supports multiple events, e.g. {click-1, click-3}
-   pragma Inline (Get_Event);
-
-   --  #1A NAME="AFU_3"#2|
-   procedure Unget_Mouse (Event : Mouse_Event);
-   --  AKA: ungetmouse()
-   pragma Inline (Unget_Mouse);
-
-   --  #1A NAME="AFU_4"#2|
-   function Enclosed_In_Window (Win    : Window := Standard_Window;
-                                Event  : Mouse_Event) return Boolean;
-   --  AKA: wenclose()
-   --  But : use event instead of screen coordinates.
-   pragma Inline (Enclosed_In_Window);
-
-   --  #1A NAME="AFU_5"#2|
-   function Mouse_Interval (Msec : Natural := 200) return Natural;
-   --  AKA: mouseinterval()
-   pragma Inline (Mouse_Interval);
-
-private
-   type Event_Mask is new Interfaces.C.unsigned_long;
-
-   type Mouse_Event is
-      record
-         Id      : Integer range Integer (Interfaces.C.short'First) ..
-                                 Integer (Interfaces.C.short'Last);
-         X, Y, Z : Integer range Integer (Interfaces.C.int'First) ..
-                                 Integer (Interfaces.C.int'Last);
-         Bstate  : Event_Mask;
-      end record;
-   pragma Convention (C, Mouse_Event);
-
-   for Mouse_Event use
-      record
-         Id      at 0 range   0 ..  15;
-         X       at 0 range  32 ..  63;
-         Y       at 0 range  64 ..  95;
-         Z       at 0 range  96 .. 127;
-         Bstate  at 0 range 128 .. 159;
-      end record;
-      --  Please note: this rep. clause is generated and may be
-      --               different on your system.
-
-   Generation_Bit_Order : constant System.Bit_Order := System.Low_Order_First;
-   --  This constant may be different on your system.
-
-   BUTTON1_RELEASED          : constant Event_Mask := 8#00000000001#;
-   BUTTON1_PRESSED           : constant Event_Mask := 8#00000000002#;
-   BUTTON1_CLICKED           : constant Event_Mask := 8#00000000004#;
-   BUTTON1_DOUBLE_CLICKED    : constant Event_Mask := 8#00000000010#;
-   BUTTON1_TRIPLE_CLICKED    : constant Event_Mask := 8#00000000020#;
-   BUTTON1_RESERVED_EVENT    : constant Event_Mask := 8#00000000040#;
-   BUTTON2_RELEASED          : constant Event_Mask := 8#00000000100#;
-   BUTTON2_PRESSED           : constant Event_Mask := 8#00000000200#;
-   BUTTON2_CLICKED           : constant Event_Mask := 8#00000000400#;
-   BUTTON2_DOUBLE_CLICKED    : constant Event_Mask := 8#00000001000#;
-   BUTTON2_TRIPLE_CLICKED    : constant Event_Mask := 8#00000002000#;
-   BUTTON2_RESERVED_EVENT    : constant Event_Mask := 8#00000004000#;
-   BUTTON3_RELEASED          : constant Event_Mask := 8#00000010000#;
-   BUTTON3_PRESSED           : constant Event_Mask := 8#00000020000#;
-   BUTTON3_CLICKED           : constant Event_Mask := 8#00000040000#;
-   BUTTON3_DOUBLE_CLICKED    : constant Event_Mask := 8#00000100000#;
-   BUTTON3_TRIPLE_CLICKED    : constant Event_Mask := 8#00000200000#;
-   BUTTON3_RESERVED_EVENT    : constant Event_Mask := 8#00000400000#;
-   BUTTON4_RELEASED          : constant Event_Mask := 8#00001000000#;
-   BUTTON4_PRESSED           : constant Event_Mask := 8#00002000000#;
-   BUTTON4_CLICKED           : constant Event_Mask := 8#00004000000#;
-   BUTTON4_DOUBLE_CLICKED    : constant Event_Mask := 8#00010000000#;
-   BUTTON4_TRIPLE_CLICKED    : constant Event_Mask := 8#00020000000#;
-   BUTTON4_RESERVED_EVENT    : constant Event_Mask := 8#00040000000#;
-   BUTTON_CTRL               : constant Event_Mask := 8#00100000000#;
-   BUTTON_SHIFT              : constant Event_Mask := 8#00200000000#;
-   BUTTON_ALT                : constant Event_Mask := 8#00400000000#;
-   REPORT_MOUSE_POSITION     : constant Event_Mask := 8#01000000000#;
-   ALL_MOUSE_EVENTS          : constant Event_Mask := 8#00777777777#;
-   BUTTON1_EVENTS            : constant Event_Mask := 8#00000000077#;
-   BUTTON2_EVENTS            : constant Event_Mask := 8#00000007700#;
-   BUTTON3_EVENTS            : constant Event_Mask := 8#00000770000#;
-   BUTTON4_EVENTS            : constant Event_Mask := 8#00077000000#;
-
-   No_Events  : constant Event_Mask := 0;
-   All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
-
-end Terminal_Interface.Curses.Mouse;
-
diff --git a/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm b/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm deleted file mode 100644 index 60ef8092adb..00000000000 --- a/doc/html/ada/terminal_interface-curses-panels-user_data__adb.htm +++ /dev/null @@ -1,84 +0,0 @@ - -terminal_interface-curses-panels-user_data.adb - -

File : terminal_interface-curses-panels-user_data.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                 Terminal_Interface.Curses.Panels.User_Data               --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Interfaces.C;
-with Terminal_Interface.Curses.Aux;
-use  Terminal_Interface.Curses.Aux;
-with Terminal_Interface.Curses.Panels;
-use  Terminal_Interface.Curses.Panels;
-
-package body Terminal_Interface.Curses.Panels.User_Data is
-
-   use type Interfaces.C.int;
-
-   procedure Set_User_Data (Pan  : Panel;
-                            Data : User_Access)
-   is
-      function Set_Panel_Userptr (Pan  : Panel;
-                                  Addr : User_Access) return C_Int;
-      pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
-   begin
-      if Set_Panel_Userptr (Pan, Data) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Set_User_Data;
-
-   function Get_User_Data (Pan  : Panel) return User_Access
-   is
-      function Panel_Userptr (Pan : Panel) return User_Access;
-      pragma Import (C, Panel_Userptr, "panel_userptr");
-   begin
-      return Panel_Userptr (Pan);
-   end Get_User_Data;
-
-   procedure Get_User_Data (Pan  : Panel;
-                            Data : out User_Access)
-   is
-   begin
-      Data := Get_User_Data (Pan);
-   end Get_User_Data;
-
-end Terminal_Interface.Curses.Panels.User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm b/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm deleted file mode 100644 index 0fd9c5b376f..00000000000 --- a/doc/html/ada/terminal_interface-curses-panels-user_data__ads.htm +++ /dev/null @@ -1,75 +0,0 @@ - -terminal_interface-curses-panels-user_data.ads - -

File : terminal_interface-curses-panels-user_data.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                 Terminal_Interface.Curses.Panels.User_Data               --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.15 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-generic
-   type User is limited private;
-   type User_Access is access all User;
-package Terminal_Interface.Curses.Panels.User_Data is
-   pragma Preelaborate (Terminal_Interface.Curses.Panels.User_Data);
-
-   --  |=====================================================================
-   --  | Man page panel.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Set_User_Data (Pan  : Panel;
-                            Data : User_Access);
-   --  AKA: set_panel_userptr
-   pragma Inline (Set_User_Data);
-
-   --  #1A NAME="AFU_2"#2|
-   procedure Get_User_Data (Pan  : Panel;
-                            Data : out User_Access);
-   --  AKA: panel_userptr
-
-   --  #1A NAME="AFU_3"#2|
-   function Get_User_Data (Pan  : Panel) return User_Access;
-   --  AKA: panel_userptr
-   --  Same as function
-   pragma Inline (Get_User_Data);
-
-end Terminal_Interface.Curses.Panels.User_Data;
-
diff --git a/doc/html/ada/terminal_interface-curses-panels__adb.htm b/doc/html/ada/terminal_interface-curses-panels__adb.htm deleted file mode 100644 index a7cb4d03da2..00000000000 --- a/doc/html/ada/terminal_interface-curses-panels__adb.htm +++ /dev/null @@ -1,171 +0,0 @@ - -terminal_interface-curses-panels.adb - -

File : terminal_interface-curses-panels.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Panels                    --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.14 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-with Interfaces.C;
-
-package body Terminal_Interface.Curses.Panels is
-
-   use type Interfaces.C.int;
-
-   function Create (Win : Window) return Panel
-   is
-      function Newpanel (Win : Window) return Panel;
-      pragma Import (C, Newpanel, "new_panel");
-
-      Pan : Panel;
-   begin
-      Pan := Newpanel (Win);
-      if Pan = Null_Panel then
-         raise Panel_Exception;
-      end if;
-      return Pan;
-   end Create;
-
-   procedure Bottom (Pan : Panel)
-   is
-      function Bottompanel (Pan : Panel) return C_Int;
-      pragma Import (C, Bottompanel, "bottom_panel");
-   begin
-      if Bottompanel (Pan) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Bottom;
-
-   procedure Top (Pan : Panel)
-   is
-      function Toppanel (Pan : Panel) return C_Int;
-      pragma Import (C, Toppanel, "top_panel");
-   begin
-      if Toppanel (Pan) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Top;
-
-   procedure Show (Pan : Panel)
-   is
-      function Showpanel (Pan : Panel) return C_Int;
-      pragma Import (C, Showpanel, "show_panel");
-   begin
-      if Showpanel (Pan) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Show;
-
-   procedure Hide (Pan : Panel)
-   is
-      function Hidepanel (Pan : Panel) return C_Int;
-      pragma Import (C, Hidepanel, "hide_panel");
-   begin
-      if Hidepanel (Pan) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Hide;
-
-   function Get_Window (Pan : Panel) return Window
-   is
-      function Panel_Win (Pan : Panel) return Window;
-      pragma Import (C, Panel_Win, "panel_window");
-
-      Win : constant Window := Panel_Win (Pan);
-   begin
-      if Win = Null_Window then
-         raise Panel_Exception;
-      end if;
-      return Win;
-   end Get_Window;
-
-   procedure Replace (Pan : Panel;
-                      Win : Window)
-   is
-      function Replace_Pan (Pan : Panel;
-                            Win : Window) return C_Int;
-      pragma Import (C, Replace_Pan, "replace_panel");
-   begin
-      if Replace_Pan (Pan, Win) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Replace;
-
-   procedure Move (Pan    : Panel;
-                   Line   : Line_Position;
-                   Column : Column_Position)
-   is
-      function Move (Pan    : Panel;
-                     Line   : C_Int;
-                     Column : C_Int) return C_Int;
-      pragma Import (C, Move, "move_panel");
-   begin
-      if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-   end Move;
-
-   function Is_Hidden (Pan : Panel) return Boolean
-   is
-      function Panel_Hidden (Pan : Panel) return C_Int;
-      pragma Import (C, Panel_Hidden, "panel_hidden");
-   begin
-      if Panel_Hidden (Pan) = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Is_Hidden;
-
-   procedure Delete (Pan : in out Panel)
-   is
-      function Del_Panel (Pan : Panel) return C_Int;
-      pragma Import (C, Del_Panel, "del_panel");
-   begin
-      if Del_Panel (Pan) = Curses_Err then
-         raise Panel_Exception;
-      end if;
-      Pan := Null_Panel;
-   end Delete;
-
-end Terminal_Interface.Curses.Panels;
-
diff --git a/doc/html/ada/terminal_interface-curses-panels__ads.htm b/doc/html/ada/terminal_interface-curses-panels__ads.htm deleted file mode 100644 index 5f140196e8f..00000000000 --- a/doc/html/ada/terminal_interface-curses-panels__ads.htm +++ /dev/null @@ -1,153 +0,0 @@ - -terminal_interface-curses-panels.ads - -

File : terminal_interface-curses-panels.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Panels                    --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.20 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with System;
-
-package Terminal_Interface.Curses.Panels is
-   pragma Preelaborate (Terminal_Interface.Curses.Panels);
-   pragma Linker_Options ("-lpanel");
-   pragma Linker_Options ("-lncurses");
-
-   type Panel is private;
-
-   ---------------------------
-   --  Interface constants  --
-   ---------------------------
-   Null_Panel : constant Panel;
-
-   -------------------
-   --  Exceptions   --
-   -------------------
-
-   Panel_Exception : exception;
-
-   --  |=====================================================================
-   --  | Man page panel.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   function Create (Win : Window) return Panel;
-   --  AKA: new_panel()
-   pragma Inline (Create);
-
-   --  #1A NAME="AFU_2"#2|
-   function New_Panel (Win : Window) return Panel renames Create;
-   --  AKA: new_panel()
-   --  pragma Inline (New_Panel);
-
-   --  #1A NAME="AFU_3"#2|
-   procedure Bottom (Pan : Panel);
-   --  AKA: bottom_panel()
-   pragma Inline (Bottom);
-
-   --  #1A NAME="AFU_4"#2|
-   procedure Top (Pan : Panel);
-   --  AKA: top_panel()
-   pragma Inline (Top);
-
-   --  #1A NAME="AFU_5"#2|
-   procedure Show (Pan : Panel);
-   --  AKA: show_panel()
-   pragma Inline (Show);
-
-   --  #1A NAME="AFU_6"#2|
-   procedure Update_Panels;
-   --  AKA: update_panels()
-   pragma Import (C, Update_Panels, "update_panels");
-
-   --  #1A NAME="AFU_7"#2|
-   procedure Hide (Pan : Panel);
-   --  AKA: hide_panel()
-   pragma Inline (Hide);
-
-   --  #1A NAME="AFU_8"#2|
-   function Get_Window (Pan : Panel) return Window;
-   --  AKA: panel_window()
-   pragma Inline (Get_Window);
-
-   --  #1A NAME="AFU_9"#2|
-   function Panel_Window (Pan : Panel) return Window renames Get_Window;
-   --  pragma Inline (Panel_Window);
-
-   --  #1A NAME="AFU_10"#2|
-   procedure Replace (Pan : Panel;
-                      Win : Window);
-   --  AKA: replace_panel()
-   pragma Inline (Replace);
-
-   --  #1A NAME="AFU_11"#2|
-   procedure Move (Pan    : Panel;
-                   Line   : Line_Position;
-                   Column : Column_Position);
-   --  AKA: move_panel()
-   pragma Inline (Move);
-
-   --  #1A NAME="AFU_12"#2|
-   function Is_Hidden (Pan : Panel) return Boolean;
-   --  AKA: panel_hidden()
-   pragma Inline (Is_Hidden);
-
-   --  #1A NAME="AFU_13"#2|
-   function Above (Pan : Panel) return Panel;
-   --  AKA: panel_above()
-   pragma Import (C, Above, "panel_above");
-
-   --  #1A NAME="AFU_14"#2|
-   function Below (Pan : Panel) return Panel;
-   --  AKA: panel_below()
-   pragma Import (C, Below, "panel_below");
-
-   --  #1A NAME="AFU_15"#2|
-   procedure Delete (Pan : in out Panel);
-   --  AKA: del_panel()
-   pragma Inline (Delete);
-
-private
-      type Panel is new System.Storage_Elements.Integer_Address;
-      Null_Panel : constant Panel := 0;
-
-end Terminal_Interface.Curses.Panels;
-
diff --git a/doc/html/ada/terminal_interface-curses-putwin__adb.htm b/doc/html/ada/terminal_interface-curses-putwin__adb.htm deleted file mode 100644 index b27e07d2e6f..00000000000 --- a/doc/html/ada/terminal_interface-curses-putwin__adb.htm +++ /dev/null @@ -1,83 +0,0 @@ - -terminal_interface-curses-putwin.adb - -

File : terminal_interface-curses-putwin.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                    Terminal_Interface.Curses.PutWin                      --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
---                                                                          --
--- Permission is hereby granted, free of charge, to any person obtaining a  --
--- copy of this software and associated documentation files (the            --
--- "Software"), 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.3 @
---  Binding Version 01.00
-
-with Ada.Streams.Stream_IO.C_Streams;
-with Interfaces.C_Streams;
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-
-package body Terminal_Interface.Curses.PutWin is
-
-   package ICS renames Interfaces.C_Streams;
-   package ACS renames Ada.Streams.Stream_IO.C_Streams;
-   use type C_Int;
-
-   procedure Put_Window (Win  : Window;
-                         File : Ada.Streams.Stream_IO.File_Type) is
-      function putwin (Win : Window; f : ICS.FILEs) return C_Int;
-      pragma Import (C, putwin, "putwin");
-
-      R : constant C_Int := putwin (Win, ACS.C_Stream (File));
-   begin
-      if R /= Curses_Ok then
-         raise Curses_Exception;
-      end if;
-   end Put_Window;
-
-   function Get_Window (File : Ada.Streams.Stream_IO.File_Type)
-                        return Window is
-      function getwin (f : ICS.FILEs) return Window;
-      pragma Import (C, getwin, "getwin");
-
-      W : constant Window := getwin (ACS.C_Stream (File));
-   begin
-      if W = Null_Window then
-         raise Curses_Exception;
-      else
-         return W;
-      end if;
-   end Get_Window;
-
-end Terminal_Interface.Curses.PutWin;
-
diff --git a/doc/html/ada/terminal_interface-curses-putwin__ads.htm b/doc/html/ada/terminal_interface-curses-putwin__ads.htm deleted file mode 100644 index 0bf60e6baff..00000000000 --- a/doc/html/ada/terminal_interface-curses-putwin__ads.htm +++ /dev/null @@ -1,56 +0,0 @@ - -terminal_interface-curses-putwin.ads - -

File : terminal_interface-curses-putwin.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                    Terminal_Interface.Curses.PutWin                      --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
---                                                                          --
--- Permission is hereby granted, free of charge, to any person obtaining a  --
--- copy of this software and associated documentation files (the            --
--- "Software"), 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.3 @
---  Binding Version 01.00
-
-with Ada.Streams.Stream_IO;
-
-package Terminal_Interface.Curses.PutWin is
-
-   procedure Put_Window (Win  : Window;
-                         File : Ada.Streams.Stream_IO.File_Type);
-
-   function Get_Window (File  : Ada.Streams.Stream_IO.File_Type) return Window;
-
-end Terminal_Interface.Curses.PutWin;
-
diff --git a/doc/html/ada/terminal_interface-curses-termcap__adb.htm b/doc/html/ada/terminal_interface-curses-termcap__adb.htm deleted file mode 100644 index 3a82187099f..00000000000 --- a/doc/html/ada/terminal_interface-curses-termcap__adb.htm +++ /dev/null @@ -1,169 +0,0 @@ - -terminal_interface-curses-termcap.adb - -

File : terminal_interface-curses-termcap.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                    Terminal_Interface.Curses.Termcap                     --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-with Interfaces.C; use Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-
-package body Terminal_Interface.Curses.Termcap is
-
-   function Get_Entry (Name : String) return Boolean
-   is
-      function tgetent (name : char_array; val : char_array)
-                        return C_Int;
-      pragma Import (C, tgetent, "tgetent");
-      NameTxt : char_array (0 .. Name'Length);
-      Length  : size_t;
-      ignored : constant char_array (0 .. 0) := (0 => nul);
-      result  : C_Int;
-   begin
-      To_C (Name, NameTxt, Length);
-      result := tgetent (char_array (ignored), NameTxt);
-      if result = -1 then
-         raise Curses_Exception;
-      else
-         return Boolean'Val (result);
-      end if;
-   end Get_Entry;
-
-------------------------------------------------------------------------------
-   function Get_Flag (Name : String) return Boolean
-   is
-      function tgetflag (id : char_array) return C_Int;
-      pragma Import (C, tgetflag, "tgetflag");
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-   begin
-      To_C (Name, Txt, Length);
-      if tgetflag (Txt) = 0 then
-         return False;
-      else
-         return True;
-      end if;
-   end Get_Flag;
-
-------------------------------------------------------------------------------
-   procedure Get_Number (Name   : String;
-                         Value  : out Integer;
-                         Result : out Boolean)
-   is
-      function tgetnum (id : char_array) return C_Int;
-      pragma Import (C, tgetnum, "tgetnum");
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-   begin
-      To_C (Name, Txt, Length);
-      Value := Integer (tgetnum (Txt));
-      if Value = -1 then
-         Result := False;
-      else
-         Result :=  True;
-      end if;
-   end Get_Number;
-
-------------------------------------------------------------------------------
-   procedure Get_String (Name   : String;
-                         Value  : out String;
-                         Result : out Boolean)
-   is
-      function tgetstr (id  : char_array;
-                        buf : char_array) return chars_ptr;
-      pragma Import (C, tgetstr, "tgetstr");
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-      Txt2   : chars_ptr;
-      type t is new char_array (0 .. 1024); --  does it need to be 1024?
-      Return_Buffer : constant t := (others => nul);
-   begin
-      To_C (Name, Txt, Length);
-      Txt2 := tgetstr (Txt, char_array (Return_Buffer));
-      if Txt2 = Null_Ptr then
-         Result := False;
-      else
-         Value := Fill_String (Txt2);
-         Result := True;
-      end if;
-   end Get_String;
-
-   function Get_String (Name : String) return Boolean
-   is
-      function tgetstr (Id  : char_array;
-                        buf : char_array) return chars_ptr;
-      pragma Import (C, tgetstr, "tgetstr");
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-      Txt2   : chars_ptr;
-      type t is new char_array (0 .. 1024); --  does it need to be 1024?
-      Phony_Txt : constant t := (others => nul);
-   begin
-      To_C (Name, Txt, Length);
-      Txt2 := tgetstr (Txt, char_array (Phony_Txt));
-      if Txt2 = Null_Ptr then
-         return False;
-      else
-         return True;
-      end if;
-   end Get_String;
-
-------------------------------------------------------------------------------
-   function TGoto (Cap : String;
-                   Col : Column_Position;
-                   Row : Line_Position) return Termcap_String is
-      function tgoto (cap : char_array;
-                      col : C_Int;
-                      row : C_Int) return chars_ptr;
-      pragma Import (C, tgoto);
-      Txt    : char_array (0 .. Cap'Length);
-      Length : size_t;
-   begin
-      To_C (Cap, Txt, Length);
-      return Termcap_String (Fill_String
-                             (tgoto (Txt, C_Int (Col), C_Int (Row))));
-   end TGoto;
-
-end Terminal_Interface.Curses.Termcap;
-
diff --git a/doc/html/ada/terminal_interface-curses-termcap__ads.htm b/doc/html/ada/terminal_interface-curses-termcap__ads.htm deleted file mode 100644 index 51621b62699..00000000000 --- a/doc/html/ada/terminal_interface-curses-termcap__ads.htm +++ /dev/null @@ -1,86 +0,0 @@ - -terminal_interface-curses-termcap.ads - -

File : terminal_interface-curses-termcap.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                     Terminal_Interface.Curses.Termcap                    --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
---                                                                          --
--- Permission is hereby granted, free of charge, to any person obtaining a  --
--- copy of this software and associated documentation files (the            --
--- "Software"), 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.3 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-package Terminal_Interface.Curses.Termcap is
-   pragma Preelaborate (Terminal_Interface.Curses.Termcap);
-
-   --  |=====================================================================
-   --  | Man page curs_termcap.3x
-   --  |=====================================================================
-   --  Not implemented:  tputs (see curs_terminfo)
-
-   type Termcap_String is new String;
-
-   --  |
-   function TGoto (Cap : String;
-                   Col : Column_Position;
-                   Row : Line_Position) return Termcap_String;
-   --  AKA: tgoto()
-
-   --  |
-   function Get_Entry (Name : String) return Boolean;
-   --  AKA: tgetent()
-
-   --  |
-   function Get_Flag (Name : String) return Boolean;
-   --  AKA: tgetflag()
-
-   --  |
-   procedure Get_Number (Name   : String;
-                         Value  : out Integer;
-                         Result : out Boolean);
-   --  AKA: tgetnum()
-
-   --  |
-   procedure Get_String (Name   : String;
-                         Value  : out String;
-                         Result : out Boolean);
-   function Get_String (Name : String) return Boolean;
-   --  Returns True if the string is found.
-   --  AKA: tgetstr()
-
-end Terminal_Interface.Curses.Termcap;
-
diff --git a/doc/html/ada/terminal_interface-curses-terminfo__adb.htm b/doc/html/ada/terminal_interface-curses-terminfo__adb.htm deleted file mode 100644 index 049e1541bcd..00000000000 --- a/doc/html/ada/terminal_interface-curses-terminfo__adb.htm +++ /dev/null @@ -1,167 +0,0 @@ - -terminal_interface-curses-terminfo.adb - -

File : terminal_interface-curses-terminfo.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                    Terminal_Interface.Curses.Terminfo                    --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.6 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-with Interfaces.C; use Interfaces.C;
-with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Ada.Unchecked_Conversion;
-
-package body Terminal_Interface.Curses.Terminfo is
-
-   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean;
-
-   function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is
-      type Weird_Address is new System.Storage_Elements.Integer_Address;
-      Invalid_Pointer : constant Weird_Address := -1;
-      function To_Weird is new Ada.Unchecked_Conversion
-        (Source => chars_ptr, Target => Weird_Address);
-   begin
-      if To_Weird (P) = Invalid_Pointer then
-         return True;
-      else
-         return False;
-      end if;
-   end Is_MinusOne_Pointer;
-   pragma Inline (Is_MinusOne_Pointer);
-
-------------------------------------------------------------------------------
-   function Get_Flag (Name : String) return Boolean
-   is
-      function tigetflag (id : char_array) return Curses_Bool;
-      pragma Import (C, tigetflag);
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-   begin
-      To_C (Name, Txt, Length);
-      if tigetflag (Txt) = Curses_Bool (Curses_True) then
-         return True;
-      else
-         return False;
-      end if;
-   end Get_Flag;
-
-------------------------------------------------------------------------------
-   procedure Get_String (Name   : String;
-                         Value  : out Terminfo_String;
-                         Result : out Boolean)
-   is
-      function tigetstr (id : char_array) return chars_ptr;
-      pragma Import (C, tigetstr, "tigetstr");
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-      Txt2 : chars_ptr;
-   begin
-      To_C (Name, Txt, Length);
-      Txt2 := tigetstr (Txt);
-      if Txt2 = Null_Ptr then
-         Result := False;
-      elsif Is_MinusOne_Pointer (Txt2) then
-         raise Curses_Exception;
-      else
-         Value  := Terminfo_String (Fill_String (Txt2));
-         Result := True;
-      end if;
-   end Get_String;
-
-------------------------------------------------------------------------------
-   function Has_String (Name : String) return Boolean
-   is
-      function tigetstr (id : char_array) return chars_ptr;
-      pragma Import (C, tigetstr, "tigetstr");
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-      Txt2 : chars_ptr;
-   begin
-      To_C (Name, Txt, Length);
-      Txt2 := tigetstr (Txt);
-      if Txt2 = Null_Ptr then
-         return False;
-      elsif Is_MinusOne_Pointer (Txt2) then
-         raise Curses_Exception;
-      else
-         return True;
-      end if;
-   end Has_String;
-
-------------------------------------------------------------------------------
-   function Get_Number (Name : String) return Integer is
-      function tigetstr (s : char_array) return C_Int;
-      pragma Import (C, tigetstr);
-      Txt    : char_array (0 .. Name'Length);
-      Length : size_t;
-   begin
-      To_C (Name, Txt, Length);
-      return Integer (tigetstr (Txt));
-   end Get_Number;
-
-------------------------------------------------------------------------------
-   procedure Put_String (Str    : Terminfo_String;
-                         affcnt : Natural := 1;
-                         putc   : putctype := null) is
-      function tputs (str    : char_array;
-                      affcnt : C_Int;
-                      putc   : putctype) return C_Int;
-      function putp (str : char_array) return C_Int;
-      pragma Import (C, tputs);
-      pragma Import (C, putp);
-      Txt    : char_array (0 .. Str'Length);
-      Length : size_t;
-      Err : C_Int;
-   begin
-      To_C (String (Str), Txt, Length);
-      if putc = null then
-         Err := putp (Txt);
-      else
-         Err := tputs (Txt, C_Int (affcnt), putc);
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Put_String;
-
-end Terminal_Interface.Curses.Terminfo;
-
diff --git a/doc/html/ada/terminal_interface-curses-terminfo__ads.htm b/doc/html/ada/terminal_interface-curses-terminfo__ads.htm deleted file mode 100644 index 72edda4f627..00000000000 --- a/doc/html/ada/terminal_interface-curses-terminfo__ads.htm +++ /dev/null @@ -1,87 +0,0 @@ - -terminal_interface-curses-terminfo.ads - -

File : terminal_interface-curses-terminfo.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                     Terminal_Interface.Curses.Terminfo                   --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
---                                                                          --
--- Permission is hereby granted, free of charge, to any person obtaining a  --
--- copy of this software and associated documentation files (the            --
--- "Software"), 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.3 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-with Interfaces.C;
-
-package Terminal_Interface.Curses.Terminfo is
-   pragma Preelaborate (Terminal_Interface.Curses.Terminfo);
-
-   --  |=====================================================================
-   --  | Man page curs_terminfo.3x
-   --  |=====================================================================
-   --  Not implemented:  setupterm, setterm, set_curterm, del_curterm,
-   --                    restartterm, tparm, putp, vidputs,  vidattr,
-   --                    mvcur
-
-   type Terminfo_String is new String;
-
-   --  |
-   procedure Get_String (Name   : String;
-                         Value  : out Terminfo_String;
-                         Result : out Boolean);
-   function Has_String (Name : String) return Boolean;
-   --  AKA: tigetstr()
-
-   --  |
-   function Get_Flag (Name : String) return Boolean;
-   --  AKA: tigetflag()
-
-   --  |
-   function Get_Number (Name : String) return Integer;
-   --  AKA: tigetnum()
-
-   type putctype is access function (c : Interfaces.C.int)
-                                    return Interfaces.C.int;
-   pragma Convention (C, putctype);
-
-   --  |
-   procedure Put_String (Str    : Terminfo_String;
-                         affcnt : Natural := 1;
-                         putc   : putctype := null);
-   --  AKA: tputs()
-
-end Terminal_Interface.Curses.Terminfo;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm deleted file mode 100644 index 36dc342d9d8..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-aux__adb.htm +++ /dev/null @@ -1,134 +0,0 @@ - -terminal_interface-curses-text_io-aux.adb - -

File : terminal_interface-curses-text_io-aux.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                   Terminal_Interface.Curses.Text_IO.Aux                  --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.13 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package body Terminal_Interface.Curses.Text_IO.Aux is
-
-   procedure Put_Buf
-     (Win    : Window;
-      Buf    : String;
-      Width  : Field;
-      Signal : Boolean := True;
-      Ljust  : Boolean := False)
-   is
-      L   : Field;
-      Len : Field;
-      W   : Field := Width;
-      LC  : Line_Count;
-      CC  : Column_Count;
-      Y   : Line_Position;
-      X   : Column_Position;
-
-      procedure Output (From, To : Field);
-
-      procedure Output (From, To : Field)
-      is
-      begin
-         if Len > 0 then
-            if W = 0 then
-               W := Len;
-            end if;
-            if Len > W then
-               --  LRM A10.6 (7) says this
-               W := Len;
-            end if;
-
-            pragma Assert (Len <= W);
-            Get_Size (Win, LC, CC);
-            if Column_Count (Len) > CC then
-               if Signal then
-                  raise Layout_Error;
-               else
-                  return;
-               end if;
-            else
-               if Len < W and then not Ljust then
-                  declare
-                     Filler : constant String (1 .. (W - Len))
-                       := (others => ' ');
-                  begin
-                     Put (Win, Filler);
-                  end;
-               end if;
-               Get_Cursor_Position (Win, Y, X);
-               if (X + Column_Position (Len)) > CC then
-                  New_Line (Win);
-               end if;
-               Put (Win, Buf (From .. To));
-               if Len < W and then Ljust then
-                  declare
-                     Filler : constant String (1 .. (W - Len))
-                       := (others => ' ');
-                  begin
-                     Put (Win, Filler);
-                  end;
-               end if;
-            end if;
-         end if;
-      end Output;
-
-   begin
-      pragma Assert (Win /= Null_Window);
-      if Ljust then
-         L := 1;
-         for I in 1 .. Buf'Length loop
-            exit when Buf (L) = ' ';
-            L := L + 1;
-         end loop;
-         Len := L - 1;
-         Output (1, Len);
-      else  -- input buffer is not left justified
-         L := Buf'Length;
-         for I in 1 .. Buf'Length loop
-            exit when Buf (L) = ' ';
-            L := L - 1;
-         end loop;
-         Len := Buf'Length - L;
-         Output (L + 1, Buf'Length);
-      end if;
-   end Put_Buf;
-
-end Terminal_Interface.Curses.Text_IO.Aux;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm deleted file mode 100644 index 6a8ff2c7f32..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-aux__ads.htm +++ /dev/null @@ -1,61 +0,0 @@ - -terminal_interface-curses-text_io-aux.ads - -

File : terminal_interface-curses-text_io-aux.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                   Terminal_Interface.Curses.Text_IO.Aux                  --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.14 @
---  @Date: 2009/12/26 17:38:58 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-private package Terminal_Interface.Curses.Text_IO.Aux is
-   --  pragma Preelaborate (Aux);
-
-   --  This routine is called from the Text_IO output routines for numeric
-   --  and enumeration types.
-   --
-   procedure Put_Buf
-     (Win    : Window;               -- The output window
-      Buf    : String;               -- The buffer containing the text
-      Width  : Field;                -- The width of the output field
-      Signal : Boolean := True;      -- If true, we raise Layout_Error
-      Ljust  : Boolean := False);    -- The Buf is left justified
-
-end Terminal_Interface.Curses.Text_IO.Aux;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm deleted file mode 100644 index 8f94a9571d5..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-complex_io__adb.htm +++ /dev/null @@ -1,79 +0,0 @@ - -terminal_interface-curses-text_io-complex_io.adb - -

File : terminal_interface-curses-text_io-complex_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Complex_IO               --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Text_IO.Float_IO;
-
-package body Terminal_Interface.Curses.Text_IO.Complex_IO is
-
-   package FIO is new
-     Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base);
-
-   procedure Put
-     (Win  : Window;
-      Item : Complex;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp)
-   is
-   begin
-      Put (Win, '(');
-      FIO.Put (Win, Item.Re, Fore, Aft, Exp);
-      Put (Win, ',');
-      FIO.Put (Win, Item.Im, Fore, Aft, Exp);
-      Put (Win, ')');
-   end Put;
-
-   procedure Put
-     (Item : Complex;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp)
-   is
-   begin
-      Put (Get_Window, Item, Fore, Aft, Exp);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Complex_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm deleted file mode 100644 index ce215b59c88..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-complex_io__ads.htm +++ /dev/null @@ -1,76 +0,0 @@ - -terminal_interface-curses-text_io-complex_io.ads - -

File : terminal_interface-curses-text_io-complex_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Complex_IO               --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Numerics.Generic_Complex_Types;
-
-generic
-   with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>);
-
-package Terminal_Interface.Curses.Text_IO.Complex_IO is
-
-   use Complex_Types;
-
-   Default_Fore : Field := 2;
-   Default_Aft  : Field := Real'Digits - 1;
-   Default_Exp  : Field := 3;
-
-   procedure Put
-     (Win  : Window;
-      Item : Complex;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-   procedure Put
-     (Item : Complex;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Complex_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm deleted file mode 100644 index 0e021444688..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-decimal_io__adb.htm +++ /dev/null @@ -1,81 +0,0 @@ - -terminal_interface-curses-text_io-decimal_io.adb - -

File : terminal_interface-curses-text_io-decimal_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Terminal_Interface.Curses.Text_IO.Aux;
-
-package body Terminal_Interface.Curses.Text_IO.Decimal_IO is
-
-   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
-   package DIO is new Ada.Text_IO.Decimal_IO (Num);
-
-   procedure Put
-     (Win  : Window;
-      Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp)
-   is
-      Buf : String (1 .. Field'Last);
-      Len : Field := Fore + 1 + Aft;
-   begin
-      if Exp > 0 then
-         Len := Len + 1 + Exp;
-      end if;
-      DIO.Put (Buf, Item, Aft, Exp);
-      Aux.Put_Buf (Win, Buf, Len, False);
-   end Put;
-
-   procedure Put
-     (Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp) is
-   begin
-      Put (Get_Window, Item, Fore, Aft, Exp);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Decimal_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm deleted file mode 100644 index b19c151d7e2..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-decimal_io__ads.htm +++ /dev/null @@ -1,72 +0,0 @@ - -terminal_interface-curses-text_io-decimal_io.ads - -

File : terminal_interface-curses-text_io-decimal_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Decimal_IO               --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type Num is delta <> digits <>;
-
-package Terminal_Interface.Curses.Text_IO.Decimal_IO is
-
-   Default_Fore : Field := Num'Fore;
-   Default_Aft  : Field := Num'Aft;
-   Default_Exp  : Field := 0;
-
-   procedure Put
-     (Win  : Window;
-      Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-   procedure Put
-     (Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Decimal_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm deleted file mode 100644 index 070e480a09e..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__adb.htm +++ /dev/null @@ -1,86 +0,0 @@ - -terminal_interface-curses-text_io-enumeration_io.adb - -

File : terminal_interface-curses-text_io-enumeration_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Ada.Characters.Handling; use Ada.Characters.Handling;
-with Terminal_Interface.Curses.Text_IO.Aux;
-
-package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is
-
-   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
-   package EIO is new Ada.Text_IO.Enumeration_IO (Enum);
-
-   procedure Put
-     (Win   : Window;
-      Item  : Enum;
-      Width : Field := Default_Width;
-      Set   : Type_Set := Default_Setting)
-   is
-      Buf  : String (1 .. Field'Last);
-      Tset : Ada.Text_IO.Type_Set;
-   begin
-      if Set /= Mixed_Case then
-         Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set));
-      else
-         Tset := Ada.Text_IO.Lower_Case;
-      end if;
-      EIO.Put (Buf, Item, Tset);
-      if Set = Mixed_Case then
-         Buf (Buf'First) := To_Upper (Buf (Buf'First));
-      end if;
-      Aux.Put_Buf (Win, Buf, Width, True, True);
-   end Put;
-
-   procedure Put
-     (Item  : Enum;
-      Width : Field := Default_Width;
-      Set   : Type_Set := Default_Setting)
-   is
-   begin
-      Put (Get_Window, Item, Width, Set);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm deleted file mode 100644 index b3d316ade6e..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-enumeration_io__ads.htm +++ /dev/null @@ -1,69 +0,0 @@ - -terminal_interface-curses-text_io-enumeration_io.ads - -

File : terminal_interface-curses-text_io-enumeration_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---             Terminal_Interface.Curses.Text_IO.Enumeration_IO             --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type Enum is (<>);
-
-package Terminal_Interface.Curses.Text_IO.Enumeration_IO is
-
-   Default_Width : Field := 0;
-   Default_Setting : Type_Set := Mixed_Case;
-
-   procedure Put
-     (Win   : Window;
-      Item  : Enum;
-      Width : Field := Default_Width;
-      Set   : Type_Set := Default_Setting);
-
-   procedure Put
-     (Item  : Enum;
-      Width : Field := Default_Width;
-      Set   : Type_Set := Default_Setting);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm deleted file mode 100644 index 578da53890d..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-fixed_io__adb.htm +++ /dev/null @@ -1,81 +0,0 @@ - -terminal_interface-curses-text_io-fixed_io.adb - -

File : terminal_interface-curses-text_io-fixed_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Terminal_Interface.Curses.Text_IO.Aux;
-
-package body Terminal_Interface.Curses.Text_IO.Fixed_IO is
-
-   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
-   package FIXIO is new Ada.Text_IO.Fixed_IO (Num);
-
-   procedure Put
-     (Win  : Window;
-      Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp)
-   is
-      Buf : String (1 .. Field'Last);
-      Len : Field := Fore + 1 + Aft;
-   begin
-      if Exp > 0 then
-         Len := Len + 1 + Exp;
-      end if;
-      FIXIO.Put (Buf, Item, Aft, Exp);
-      Aux.Put_Buf (Win, Buf, Len, False);
-   end Put;
-
-   procedure Put
-     (Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp) is
-   begin
-      Put (Get_Window, Item, Fore, Aft, Exp);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Fixed_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm deleted file mode 100644 index 315a0cbaa75..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-fixed_io__ads.htm +++ /dev/null @@ -1,72 +0,0 @@ - -terminal_interface-curses-text_io-fixed_io.ads - -

File : terminal_interface-curses-text_io-fixed_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                Terminal_Interface.Curses.Text_IO.Fixed_IO                --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type Num is delta <>;
-
-package Terminal_Interface.Curses.Text_IO.Fixed_IO is
-
-   Default_Fore : Field := Num'Fore;
-   Default_Aft  : Field := Num'Aft;
-   Default_Exp  : Field := 0;
-
-   procedure Put
-     (Win  : Window;
-      Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-   procedure Put
-     (Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Fixed_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm deleted file mode 100644 index db86cfcc7bb..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-float_io__adb.htm +++ /dev/null @@ -1,82 +0,0 @@ - -terminal_interface-curses-text_io-float_io.adb - -

File : terminal_interface-curses-text_io-float_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                Terminal_Interface.Curses.Text_IO.Float_IO                --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Terminal_Interface.Curses.Text_IO.Aux;
-
-package body Terminal_Interface.Curses.Text_IO.Float_IO is
-
-   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
-   package FIO is new Ada.Text_IO.Float_IO (Num);
-
-   procedure Put
-     (Win  : Window;
-      Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp)
-   is
-      Buf : String (1 .. Field'Last);
-      Len : Field := Fore + 1 + Aft;
-   begin
-      if Exp > 0 then
-         Len := Len + 1 + Exp;
-      end if;
-      FIO.Put (Buf, Item, Aft, Exp);
-      Aux.Put_Buf (Win, Buf, Len, False);
-   end Put;
-
-   procedure Put
-     (Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp)
-   is
-   begin
-      Put (Get_Window, Item, Fore, Aft, Exp);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Float_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm deleted file mode 100644 index 6b6e30a2812..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-float_io__ads.htm +++ /dev/null @@ -1,72 +0,0 @@ - -terminal_interface-curses-text_io-float_io.ads - -

File : terminal_interface-curses-text_io-float_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                Terminal_Interface.Curses.Text_IO.Float_IO                --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type Num is digits <>;
-
-package Terminal_Interface.Curses.Text_IO.Float_IO is
-
-   Default_Fore : Field := 2;
-   Default_Aft  : Field := Num'Digits - 1;
-   Default_Exp  : Field := 3;
-
-   procedure Put
-     (Win  : Window;
-      Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-   procedure Put
-     (Item : Num;
-      Fore : Field := Default_Fore;
-      Aft  : Field := Default_Aft;
-      Exp  : Field := Default_Exp);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Float_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm deleted file mode 100644 index 17c2f49447f..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-integer_io__adb.htm +++ /dev/null @@ -1,76 +0,0 @@ - -terminal_interface-curses-text_io-integer_io.adb - -

File : terminal_interface-curses-text_io-integer_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Integer_IO               --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Terminal_Interface.Curses.Text_IO.Aux;
-
-package body Terminal_Interface.Curses.Text_IO.Integer_IO is
-
-   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
-   package IIO is new Ada.Text_IO.Integer_IO (Num);
-
-   procedure Put
-     (Win   : Window;
-      Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base)
-   is
-      Buf : String (1 .. Field'Last);
-   begin
-      IIO.Put (Buf, Item, Base);
-      Aux.Put_Buf (Win, Buf, Width);
-   end Put;
-
-   procedure Put
-     (Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base)
-   is
-   begin
-      Put (Get_Window, Item, Width, Base);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Integer_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm deleted file mode 100644 index 930bff14f29..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-integer_io__ads.htm +++ /dev/null @@ -1,69 +0,0 @@ - -terminal_interface-curses-text_io-integer_io.ads - -

File : terminal_interface-curses-text_io-integer_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Integer_IO               --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type Num is range <>;
-
-package Terminal_Interface.Curses.Text_IO.Integer_IO is
-
-   Default_Width : Field := Num'Width;
-   Default_Base  : Number_Base := 10;
-
-   procedure Put
-     (Win   : Window;
-      Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base);
-
-   procedure Put
-     (Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Integer_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm deleted file mode 100644 index 1ef76a739db..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-modular_io__adb.htm +++ /dev/null @@ -1,76 +0,0 @@ - -terminal_interface-curses-text_io-modular_io.adb - -

File : terminal_interface-curses-text_io-modular_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Modular_IO               --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.11 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Terminal_Interface.Curses.Text_IO.Aux;
-
-package body Terminal_Interface.Curses.Text_IO.Modular_IO is
-
-   package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
-   package MIO is new Ada.Text_IO.Modular_IO (Num);
-
-   procedure Put
-     (Win   : Window;
-      Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base)
-   is
-      Buf : String (1 .. Field'Last);
-   begin
-      MIO.Put (Buf, Item, Base);
-      Aux.Put_Buf (Win, Buf, Width);
-   end Put;
-
-   procedure Put
-     (Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base)
-   is
-   begin
-      Put (Get_Window, Item, Width, Base);
-   end Put;
-
-end Terminal_Interface.Curses.Text_IO.Modular_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm deleted file mode 100644 index 227dd9bff97..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io-modular_io__ads.htm +++ /dev/null @@ -1,69 +0,0 @@ - -terminal_interface-curses-text_io-modular_io.ads - -

File : terminal_interface-curses-text_io-modular_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---               Terminal_Interface.Curses.Text_IO.Modular_IO               --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.12 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-generic
-   type Num is mod <>;
-
-package Terminal_Interface.Curses.Text_IO.Modular_IO is
-
-   Default_Width : Field := Num'Width;
-   Default_Base  : Number_Base := 10;
-
-   procedure Put
-     (Win   : Window;
-      Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base);
-
-   procedure Put
-     (Item  : Num;
-      Width : Field := Default_Width;
-      Base  : Number_Base := Default_Base);
-
-private
-   pragma Inline (Put);
-
-end Terminal_Interface.Curses.Text_IO.Modular_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io__adb.htm deleted file mode 100644 index 7d48825de4a..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io__adb.htm +++ /dev/null @@ -1,344 +0,0 @@ - -terminal_interface-curses-text_io.adb - -

File : terminal_interface-curses-text_io.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                     Terminal_Interface.Curses.Text_IO                    --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.20 @
---  @Date: 2011/03/22 23:38:49 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package body Terminal_Interface.Curses.Text_IO is
-
-   Default_Window : Window := Null_Window;
-
-   procedure Set_Window (Win : Window)
-   is
-   begin
-      Default_Window := Win;
-   end Set_Window;
-
-   function Get_Window return Window
-   is
-   begin
-      if Default_Window = Null_Window then
-         return Standard_Window;
-      else
-         return Default_Window;
-      end if;
-   end Get_Window;
-   pragma Inline (Get_Window);
-
-   procedure Flush (Win : Window)
-   is
-   begin
-      Refresh (Win);
-   end Flush;
-
-   procedure Flush
-   is
-   begin
-      Flush (Get_Window);
-   end Flush;
-
-   --------------------------------------------
-   -- Specification of line and page lengths --
-   --------------------------------------------
-
-   --  There are no set routines in this package. I assume, that you allocate
-   --  the window with an appropriate size.
-   --  A scroll-window is interpreted as an page with unbounded page length,
-   --  i.e. it returns the conventional 0 as page length.
-
-   function Line_Length (Win : Window) return Count
-   is
-      N_Lines : Line_Count;
-      N_Cols  : Column_Count;
-   begin
-      Get_Size (Win, N_Lines, N_Cols);
-      --  if Natural (N_Cols) > Natural (Count'Last) then
-      --     raise Layout_Error;
-      --  end if;
-      return Count (N_Cols);
-   end Line_Length;
-
-   function Line_Length return Count
-   is
-   begin
-      return Line_Length (Get_Window);
-   end Line_Length;
-
-   function Page_Length (Win : Window) return Count
-   is
-      N_Lines : Line_Count;
-      N_Cols  : Column_Count;
-   begin
-      if Scrolling_Allowed (Win) then
-         return 0;
-      else
-         Get_Size (Win, N_Lines, N_Cols);
-         --  if Natural (N_Lines) > Natural (Count'Last) then
-         --     raise Layout_Error;
-         --  end if;
-         return Count (N_Lines);
-      end if;
-   end Page_Length;
-
-   function Page_Length return Count
-   is
-   begin
-      return Page_Length (Get_Window);
-   end Page_Length;
-
-   ------------------------------------
-   -- Column, Line, and Page Control --
-   ------------------------------------
-   procedure New_Line (Win : Window; Spacing : Positive_Count := 1)
-   is
-      P_Size : constant Count := Page_Length (Win);
-   begin
-      if not Spacing'Valid then
-         raise Constraint_Error;
-      end if;
-
-      for I in 1 .. Spacing loop
-         if P_Size > 0 and then Line (Win) >= P_Size then
-            New_Page (Win);
-         else
-            Add (Win, ASCII.LF);
-         end if;
-      end loop;
-   end New_Line;
-
-   procedure New_Line (Spacing : Positive_Count := 1)
-   is
-   begin
-      New_Line (Get_Window, Spacing);
-   end New_Line;
-
-   procedure New_Page (Win : Window)
-   is
-   begin
-      Clear (Win);
-   end New_Page;
-
-   procedure New_Page
-   is
-   begin
-      New_Page (Get_Window);
-   end New_Page;
-
-   procedure Set_Col (Win : Window;  To : Positive_Count)
-   is
-      Y  : Line_Position;
-      X1 : Column_Position;
-      X2 : Column_Position;
-      N  : Natural;
-   begin
-      if not To'Valid then
-         raise Constraint_Error;
-      end if;
-
-      Get_Cursor_Position (Win, Y, X1);
-      N  := Natural (To); N := N - 1;
-      X2 := Column_Position (N);
-      if X1 > X2 then
-         New_Line (Win, 1);
-         X1 := 0;
-      end if;
-      if X1 < X2 then
-         declare
-            Filler : constant String (Integer (X1) .. (Integer (X2) - 1))
-              := (others => ' ');
-         begin
-            Put (Win, Filler);
-         end;
-      end if;
-   end Set_Col;
-
-   procedure Set_Col (To : Positive_Count)
-   is
-   begin
-      Set_Col (Get_Window, To);
-   end Set_Col;
-
-   procedure Set_Line (Win : Window; To : Positive_Count)
-   is
-      Y1 : Line_Position;
-      Y2 : Line_Position;
-      X  : Column_Position;
-      N  : Natural;
-   begin
-      if not To'Valid then
-         raise Constraint_Error;
-      end if;
-
-      Get_Cursor_Position (Win, Y1, X);
-      pragma Unreferenced (X);
-      N  := Natural (To); N := N - 1;
-      Y2 := Line_Position (N);
-      if Y2 < Y1 then
-         New_Page (Win);
-         Y1 := 0;
-      end if;
-      if Y1 < Y2 then
-         New_Line (Win, Positive_Count (Y2 - Y1));
-      end if;
-   end Set_Line;
-
-   procedure Set_Line (To : Positive_Count)
-   is
-   begin
-      Set_Line (Get_Window, To);
-   end Set_Line;
-
-   function Col (Win : Window) return Positive_Count
-   is
-      Y : Line_Position;
-      X : Column_Position;
-      N : Natural;
-   begin
-      Get_Cursor_Position (Win, Y, X);
-      N := Natural (X); N := N + 1;
-      --  if N > Natural (Count'Last) then
-      --     raise Layout_Error;
-      --  end if;
-      return Positive_Count (N);
-   end Col;
-
-   function Col return Positive_Count
-   is
-   begin
-      return Col (Get_Window);
-   end Col;
-
-   function Line (Win : Window) return Positive_Count
-   is
-      Y : Line_Position;
-      X : Column_Position;
-      N : Natural;
-   begin
-      Get_Cursor_Position (Win, Y, X);
-      N := Natural (Y); N := N + 1;
-      --  if N > Natural (Count'Last) then
-      --     raise Layout_Error;
-      --  end if;
-      return Positive_Count (N);
-   end Line;
-
-   function Line return Positive_Count
-   is
-   begin
-      return Line (Get_Window);
-   end Line;
-
-   -----------------------
-   -- Characters Output --
-   -----------------------
-
-   procedure Put (Win  : Window; Item : Character)
-   is
-      P_Size : constant Count := Page_Length (Win);
-      Y : Line_Position;
-      X : Column_Position;
-      L : Line_Count;
-      C : Column_Count;
-   begin
-      if P_Size > 0 then
-         Get_Cursor_Position (Win, Y, X);
-         Get_Size (Win, L, C);
-         if (Y + 1) = L and then (X + 1) = C then
-            New_Page (Win);
-         end if;
-      end if;
-      Add (Win, Item);
-   end Put;
-
-   procedure Put (Item : Character)
-   is
-   begin
-      Put (Get_Window, Item);
-   end Put;
-
-   --------------------
-   -- Strings-Output --
-   --------------------
-
-   procedure Put (Win  : Window; Item : String)
-   is
-      P_Size : constant Count := Page_Length (Win);
-      Y : Line_Position;
-      X : Column_Position;
-      L : Line_Count;
-      C : Column_Count;
-   begin
-      if P_Size > 0 then
-         Get_Cursor_Position (Win, Y, X);
-         Get_Size (Win, L, C);
-         if (Y + 1) = L and then (X + 1 + Item'Length) >= C then
-            New_Page (Win);
-         end if;
-      end if;
-      Add (Win, Item);
-   end Put;
-
-   procedure Put (Item : String)
-   is
-   begin
-      Put (Get_Window, Item);
-   end Put;
-
-   procedure Put_Line
-     (Win  : Window;
-      Item : String)
-   is
-   begin
-      Put (Win, Item);
-      New_Line (Win, 1);
-   end Put_Line;
-
-   procedure Put_Line
-     (Item : String)
-   is
-   begin
-      Put_Line (Get_Window, Item);
-   end Put_Line;
-
-end Terminal_Interface.Curses.Text_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-text_io__ads.htm b/doc/html/ada/terminal_interface-curses-text_io__ads.htm deleted file mode 100644 index 36f9476f687..00000000000 --- a/doc/html/ada/terminal_interface-curses-text_io__ads.htm +++ /dev/null @@ -1,142 +0,0 @@ - -terminal_interface-curses-text_io.ads - -

File : terminal_interface-curses-text_io.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                     Terminal_Interface.Curses.Text_IO                    --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2003,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.14 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with Ada.Text_IO;
-with Ada.IO_Exceptions;
-
-package Terminal_Interface.Curses.Text_IO is
-
-   use type Ada.Text_IO.Count;
-   subtype Count is Ada.Text_IO.Count;
-   subtype Positive_Count is Count range 1 .. Count'Last;
-
-   subtype Field is Ada.Text_IO.Field;
-   subtype Number_Base is Integer range 2 .. 16;
-
-   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
-
-   --  For most of the routines you will see a version without a Window
-   --  type parameter. They will operate on a default window, which can
-   --  be set by the user. It is initially equal to Standard_Window.
-
-   procedure Set_Window (Win : Window);
-   --  Set Win as the default window
-
-   function Get_Window return Window;
-   --  Get the current default window
-
-   procedure Flush (Win : Window);
-   procedure Flush;
-
-   --------------------------------------------
-   -- Specification of line and page lengths --
-   --------------------------------------------
-
-   --  There are no set routines in this package. I assume, that you allocate
-   --  the window with an appropriate size.
-   --  A scroll-window is interpreted as an page with unbounded page length,
-   --  i.e. it returns the conventional 0 as page length.
-
-   function Line_Length (Win : Window) return Count;
-   function Line_Length return Count;
-
-   function Page_Length (Win : Window) return Count;
-   function Page_Length return Count;
-
-   ------------------------------------
-   -- Column, Line, and Page Control --
-   ------------------------------------
-   procedure New_Line (Win : Window; Spacing : Positive_Count := 1);
-   procedure New_Line (Spacing : Positive_Count := 1);
-
-   procedure New_Page (Win : Window);
-   procedure New_Page;
-
-   procedure Set_Col (Win : Window;  To : Positive_Count);
-   procedure Set_Col (To : Positive_Count);
-
-   procedure Set_Line (Win : Window; To : Positive_Count);
-   procedure Set_Line (To : Positive_Count);
-
-   function Col (Win : Window) return Positive_Count;
-   function Col return Positive_Count;
-
-   function Line (Win : Window) return Positive_Count;
-   function Line return Positive_Count;
-
-   -----------------------
-   -- Characters-Output --
-   -----------------------
-
-   procedure Put (Win  : Window; Item : Character);
-   procedure Put (Item : Character);
-
-   --------------------
-   -- Strings-Output --
-   --------------------
-
-   procedure Put (Win  : Window; Item : String);
-   procedure Put (Item : String);
-
-   procedure Put_Line
-     (Win  : Window;
-      Item : String);
-
-   procedure Put_Line
-     (Item : String);
-
-   --  Exceptions
-
-   Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
-   Mode_Error   : exception renames Ada.IO_Exceptions.Mode_Error;
-   Name_Error   : exception renames Ada.IO_Exceptions.Name_Error;
-   Use_Error    : exception renames Ada.IO_Exceptions.Use_Error;
-   Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
-   End_Error    : exception renames Ada.IO_Exceptions.End_Error;
-   Data_Error   : exception renames Ada.IO_Exceptions.Data_Error;
-   Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
-
-end Terminal_Interface.Curses.Text_IO;
-
diff --git a/doc/html/ada/terminal_interface-curses-trace__adb.htm b/doc/html/ada/terminal_interface-curses-trace__adb.htm deleted file mode 100644 index b771291b0f8..00000000000 --- a/doc/html/ada/terminal_interface-curses-trace__adb.htm +++ /dev/null @@ -1,62 +0,0 @@ - -terminal_interface-curses-trace.adb - -

File : terminal_interface-curses-trace.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Trace                     --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000-2004,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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.7 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-package body Terminal_Interface.Curses.Trace is
-
-   procedure Trace_On (x : Trace_Attribute_Set) is
-   pragma Unreferenced (x);
-   begin
-      null;
-   end Trace_On;
-
-   procedure Trace_Put (str : String) is
-   pragma Unreferenced (str);
-   begin
-      null;
-   end Trace_Put;
-
-end Terminal_Interface.Curses.Trace;
-
diff --git a/doc/html/ada/terminal_interface-curses-trace__ads.htm b/doc/html/ada/terminal_interface-curses-trace__ads.htm deleted file mode 100644 index 6aa1e8c850c..00000000000 --- a/doc/html/ada/terminal_interface-curses-trace__ads.htm +++ /dev/null @@ -1,122 +0,0 @@ - -terminal_interface-curses-trace.ads - -

File : terminal_interface-curses-trace.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                      Terminal_Interface.Curses.Trace                     --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
---                                                                          --
--- Permission is hereby granted, free of charge, to any person obtaining a  --
--- copy of this software and associated documentation files (the            --
--- "Software"), 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: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
---  Version Control:
---  @Revision: 1.1 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-
-package Terminal_Interface.Curses.Trace is
-   pragma Preelaborate (Terminal_Interface.Curses.Trace);
-
-   pragma Warnings (Off);
-   type Trace_Attribute_Set is
-      record
-         Times                 : Boolean;
-         Tputs                 : Boolean;
-         Update                : Boolean;
-         Cursor_Move           : Boolean;
-         Character_Output      : Boolean;
-         Calls                 : Boolean;
-         Virtual_Puts          : Boolean;
-         Input_Events          : Boolean;
-         TTY_State             : Boolean;
-         Internal_Calls        : Boolean;
-         Character_Calls       : Boolean;
-         Termcap_TermInfo      : Boolean;
-         Attributes_And_Colors : Boolean;
-         Unused                : Boolean;
-      end record;
-   pragma Convention (C, Trace_Attribute_Set);
-
-   for Trace_Attribute_Set use
-      record
-         Times                 at 0 range  0 ..  0;
-         Tputs                 at 0 range  1 ..  1;
-         Update                at 0 range  2 ..  2;
-         Cursor_Move           at 0 range  3 ..  3;
-         Character_Output      at 0 range  4 ..  4;
-         Calls                 at 0 range  5 ..  5;
-         Virtual_Puts          at 0 range  6 ..  6;
-         Input_Events          at 0 range  7 ..  7;
-         TTY_State             at 0 range  8 ..  8;
-         Internal_Calls        at 0 range  9 ..  9;
-         Character_Calls       at 0 range 10 .. 10;
-         Termcap_TermInfo      at 0 range 11 .. 11;
-         Attributes_And_Colors at 0 range 12 .. 12;
-         Unused                at 0 range 13 .. 31;
-      end record;
-   for Trace_Attribute_Set'Size use 32;
-   --  Please note: this rep. clause is generated and may be
-   --               different on your system.
-
-   pragma Warnings (On);
-
-   Trace_Disable  : constant Trace_Attribute_Set := (others => False);
-
-   Trace_Ordinary : constant Trace_Attribute_Set :=
-     (Times            => True,
-      Tputs            => True,
-      Update           => True,
-      Cursor_Move      => True,
-      Character_Output => True,
-      others           => False);
-   Trace_Maximum : constant Trace_Attribute_Set := (others => True);
-
-------------------------------------------------------------------------------
-
-   --  |=====================================================================
-   --  | Man page curs_trace.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_1"#2|
-   procedure Trace_On (x : Trace_Attribute_Set);
-   --  The debugging library has trace.
-
-   --  #1A NAME="AFU_2"#2|
-   procedure Trace_Put (str : String);
-   --  AKA: _tracef()
-
-   Current_Trace_Setting : Trace_Attribute_Set;
-   pragma Import (C, Current_Trace_Setting, "_nc_tracing");
-
-end Terminal_Interface.Curses.Trace;
-
diff --git a/doc/html/ada/terminal_interface-curses__adb.htm b/doc/html/ada/terminal_interface-curses__adb.htm deleted file mode 100644 index 272b0036e85..00000000000 --- a/doc/html/ada/terminal_interface-curses__adb.htm +++ /dev/null @@ -1,2562 +0,0 @@ - -terminal_interface-curses.adb - -

File : terminal_interface-curses.adb


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                        Terminal_Interface.Curses                         --
---                                                                          --
---                                 B O D Y                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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: Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.8 @
---  @Date: 2011/03/22 23:02:14 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-with System;
-
-with Terminal_Interface.Curses.Aux;
-with Interfaces.C;                  use Interfaces.C;
-with Interfaces.C.Strings;          use Interfaces.C.Strings;
-with Ada.Characters.Handling;       use Ada.Characters.Handling;
-with Ada.Strings.Fixed;
-
-package body Terminal_Interface.Curses is
-
-   use Aux;
-   use type System.Bit_Order;
-
-   package ASF renames Ada.Strings.Fixed;
-
-   type chtype_array is array (size_t range <>)
-      of aliased Attributed_Character;
-   pragma Convention (C, chtype_array);
-
-------------------------------------------------------------------------------
-   function Key_Name (Key : Real_Key_Code) return String
-   is
-      function Keyname (K : C_Int) return chars_ptr;
-      pragma Import (C, Keyname, "keyname");
-
-      Ch : Character;
-   begin
-      if Key <= Character'Pos (Character'Last) then
-         Ch := Character'Val (Key);
-         if Is_Control (Ch) then
-            return Un_Control (Attributed_Character'(Ch    => Ch,
-                                                     Color => Color_Pair'First,
-                                                     Attr  => Normal_Video));
-         elsif Is_Graphic (Ch) then
-            declare
-               S : String (1 .. 1);
-            begin
-               S (1) := Ch;
-               return S;
-            end;
-         else
-            return "";
-         end if;
-      else
-         return Fill_String (Keyname (C_Int (Key)));
-      end if;
-   end Key_Name;
-
-   procedure Key_Name (Key  :  Real_Key_Code;
-                       Name : out String)
-   is
-   begin
-      ASF.Move (Key_Name (Key), Name);
-   end Key_Name;
-
-------------------------------------------------------------------------------
-   procedure Init_Screen
-   is
-      function Initscr return Window;
-      pragma Import (C, Initscr, "initscr");
-
-      W : Window;
-   begin
-      W := Initscr;
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-   end Init_Screen;
-
-   procedure End_Windows
-   is
-      function Endwin return C_Int;
-      pragma Import (C, Endwin, "endwin");
-   begin
-      if Endwin = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end End_Windows;
-
-   function Is_End_Window return Boolean
-   is
-      function Isendwin return Curses_Bool;
-      pragma Import (C, Isendwin, "isendwin");
-   begin
-      if Isendwin = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Is_End_Window;
-------------------------------------------------------------------------------
-   procedure Move_Cursor (Win    : Window := Standard_Window;
-                          Line   : Line_Position;
-                          Column : Column_Position)
-   is
-      function Wmove (Win    : Window;
-                      Line   : C_Int;
-                      Column : C_Int
-                     ) return C_Int;
-      pragma Import (C, Wmove, "wmove");
-   begin
-      if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Move_Cursor;
-------------------------------------------------------------------------------
-   procedure Add (Win : Window := Standard_Window;
-                  Ch  : Attributed_Character)
-   is
-      function Waddch (W  : Window;
-                       Ch : C_Chtype) return C_Int;
-      pragma Import (C, Waddch, "waddch");
-   begin
-      if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Add;
-
-   procedure Add (Win : Window := Standard_Window;
-                  Ch  : Character)
-   is
-   begin
-      Add (Win,
-           Attributed_Character'(Ch    => Ch,
-                                 Color => Color_Pair'First,
-                                 Attr  => Normal_Video));
-   end Add;
-
-   procedure Add
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Ch     : Attributed_Character)
-   is
-      function mvwaddch (W  : Window;
-                         Y  : C_Int;
-                         X  : C_Int;
-                         Ch : C_Chtype) return C_Int;
-      pragma Import (C, mvwaddch, "mvwaddch");
-   begin
-      if mvwaddch (Win, C_Int (Line),
-                   C_Int (Column),
-                   AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Add;
-
-   procedure Add
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Ch     : Character)
-   is
-   begin
-      Add (Win,
-           Line,
-           Column,
-           Attributed_Character'(Ch    => Ch,
-                                 Color => Color_Pair'First,
-                                 Attr  => Normal_Video));
-   end Add;
-
-   procedure Add_With_Immediate_Echo
-     (Win : Window := Standard_Window;
-      Ch  : Attributed_Character)
-   is
-      function Wechochar (W  : Window;
-                          Ch : C_Chtype) return C_Int;
-      pragma Import (C, Wechochar, "wechochar");
-   begin
-      if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Add_With_Immediate_Echo;
-
-   procedure Add_With_Immediate_Echo
-     (Win : Window := Standard_Window;
-      Ch  : Character)
-   is
-   begin
-      Add_With_Immediate_Echo
-        (Win,
-         Attributed_Character'(Ch    => Ch,
-                               Color => Color_Pair'First,
-                               Attr  => Normal_Video));
-   end Add_With_Immediate_Echo;
-------------------------------------------------------------------------------
-   function Create (Number_Of_Lines       : Line_Count;
-                    Number_Of_Columns     : Column_Count;
-                    First_Line_Position   : Line_Position;
-                    First_Column_Position : Column_Position) return Window
-   is
-      function Newwin (Number_Of_Lines       : C_Int;
-                       Number_Of_Columns     : C_Int;
-                       First_Line_Position   : C_Int;
-                       First_Column_Position : C_Int) return Window;
-      pragma Import (C, Newwin, "newwin");
-
-      W : Window;
-   begin
-      W := Newwin (C_Int (Number_Of_Lines),
-                   C_Int (Number_Of_Columns),
-                   C_Int (First_Line_Position),
-                   C_Int (First_Column_Position));
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-      return W;
-   end Create;
-
-   procedure Delete (Win : in out Window)
-   is
-      function Wdelwin (W : Window) return C_Int;
-      pragma Import (C, Wdelwin, "delwin");
-   begin
-      if Wdelwin (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-      Win := Null_Window;
-   end Delete;
-
-   function Sub_Window
-     (Win                   : Window := Standard_Window;
-      Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window
-   is
-      function Subwin
-        (Win                   : Window;
-         Number_Of_Lines       : C_Int;
-         Number_Of_Columns     : C_Int;
-         First_Line_Position   : C_Int;
-         First_Column_Position : C_Int) return Window;
-      pragma Import (C, Subwin, "subwin");
-
-      W : Window;
-   begin
-      W := Subwin (Win,
-                   C_Int (Number_Of_Lines),
-                   C_Int (Number_Of_Columns),
-                   C_Int (First_Line_Position),
-                   C_Int (First_Column_Position));
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-      return W;
-   end Sub_Window;
-
-   function Derived_Window
-     (Win                   : Window := Standard_Window;
-      Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window
-   is
-      function Derwin
-        (Win                   : Window;
-         Number_Of_Lines       : C_Int;
-         Number_Of_Columns     : C_Int;
-         First_Line_Position   : C_Int;
-         First_Column_Position : C_Int) return Window;
-      pragma Import (C, Derwin, "derwin");
-
-      W : Window;
-   begin
-      W := Derwin (Win,
-                   C_Int (Number_Of_Lines),
-                   C_Int (Number_Of_Columns),
-                   C_Int (First_Line_Position),
-                   C_Int (First_Column_Position));
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-      return W;
-   end Derived_Window;
-
-   function Duplicate (Win : Window) return Window
-   is
-      function Dupwin (Win : Window) return Window;
-      pragma Import (C, Dupwin, "dupwin");
-
-      W : constant Window := Dupwin (Win);
-   begin
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-      return W;
-   end Duplicate;
-
-   procedure Move_Window (Win    : Window;
-                          Line   : Line_Position;
-                          Column : Column_Position)
-   is
-      function Mvwin (Win    : Window;
-                      Line   : C_Int;
-                      Column : C_Int) return C_Int;
-      pragma Import (C, Mvwin, "mvwin");
-   begin
-      if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Move_Window;
-
-   procedure Move_Derived_Window (Win    : Window;
-                                  Line   : Line_Position;
-                                  Column : Column_Position)
-   is
-      function Mvderwin (Win    : Window;
-                         Line   : C_Int;
-                         Column : C_Int) return C_Int;
-      pragma Import (C, Mvderwin, "mvderwin");
-   begin
-      if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Move_Derived_Window;
-
-   procedure Set_Synch_Mode (Win  : Window  := Standard_Window;
-                             Mode : Boolean := False)
-   is
-      function Syncok (Win  : Window;
-                       Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Syncok, "syncok");
-   begin
-      if Syncok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Synch_Mode;
-------------------------------------------------------------------------------
-   procedure Add (Win : Window := Standard_Window;
-                  Str : String;
-                  Len : Integer := -1)
-   is
-      function Waddnstr (Win : Window;
-                         Str : char_array;
-                         Len : C_Int := -1) return C_Int;
-      pragma Import (C, Waddnstr, "waddnstr");
-
-      Txt    : char_array (0 .. Str'Length);
-      Length : size_t;
-   begin
-      To_C (Str, Txt, Length);
-      if Waddnstr (Win, Txt, C_Int (Len)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Add;
-
-   procedure Add
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Str    : String;
-      Len    : Integer := -1)
-   is
-   begin
-      Move_Cursor (Win, Line, Column);
-      Add (Win, Str, Len);
-   end Add;
-------------------------------------------------------------------------------
-   procedure Add
-     (Win : Window := Standard_Window;
-      Str : Attributed_String;
-      Len : Integer := -1)
-   is
-      function Waddchnstr (Win : Window;
-                           Str : chtype_array;
-                           Len : C_Int := -1) return C_Int;
-      pragma Import (C, Waddchnstr, "waddchnstr");
-
-      Txt : chtype_array (0 .. Str'Length);
-   begin
-      for Length in 1 .. size_t (Str'Length) loop
-         Txt (Length - 1) := Str (Natural (Length));
-      end loop;
-      Txt (Str'Length) := Default_Character;
-      if Waddchnstr (Win,
-                     Txt,
-                     C_Int (Len)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Add;
-
-   procedure Add
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Str    : Attributed_String;
-      Len    : Integer := -1)
-   is
-   begin
-      Move_Cursor (Win, Line, Column);
-      Add (Win, Str, Len);
-   end Add;
-------------------------------------------------------------------------------
-   procedure Border
-     (Win                       : Window := Standard_Window;
-      Left_Side_Symbol          : Attributed_Character := Default_Character;
-      Right_Side_Symbol         : Attributed_Character := Default_Character;
-      Top_Side_Symbol           : Attributed_Character := Default_Character;
-      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
-      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
-      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
-      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
-      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character)
-   is
-      function Wborder (W   : Window;
-                        LS  : C_Chtype;
-                        RS  : C_Chtype;
-                        TS  : C_Chtype;
-                        BS  : C_Chtype;
-                        ULC : C_Chtype;
-                        URC : C_Chtype;
-                        LLC : C_Chtype;
-                        LRC : C_Chtype) return C_Int;
-      pragma Import (C, Wborder, "wborder");
-   begin
-      if Wborder (Win,
-                  AttrChar_To_Chtype (Left_Side_Symbol),
-                  AttrChar_To_Chtype (Right_Side_Symbol),
-                  AttrChar_To_Chtype (Top_Side_Symbol),
-                  AttrChar_To_Chtype (Bottom_Side_Symbol),
-                  AttrChar_To_Chtype (Upper_Left_Corner_Symbol),
-                  AttrChar_To_Chtype (Upper_Right_Corner_Symbol),
-                  AttrChar_To_Chtype (Lower_Left_Corner_Symbol),
-                  AttrChar_To_Chtype (Lower_Right_Corner_Symbol)
-                  ) = Curses_Err
-      then
-         raise Curses_Exception;
-      end if;
-   end Border;
-
-   procedure Box
-     (Win               : Window := Standard_Window;
-      Vertical_Symbol   : Attributed_Character := Default_Character;
-      Horizontal_Symbol : Attributed_Character := Default_Character)
-   is
-   begin
-      Border (Win,
-              Vertical_Symbol, Vertical_Symbol,
-              Horizontal_Symbol, Horizontal_Symbol);
-   end Box;
-
-   procedure Horizontal_Line
-     (Win         : Window := Standard_Window;
-      Line_Size   : Natural;
-      Line_Symbol : Attributed_Character := Default_Character)
-   is
-      function Whline (W   : Window;
-                       Ch  : C_Chtype;
-                       Len : C_Int) return C_Int;
-      pragma Import (C, Whline, "whline");
-   begin
-      if Whline (Win,
-                 AttrChar_To_Chtype (Line_Symbol),
-                 C_Int (Line_Size)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Horizontal_Line;
-
-   procedure Vertical_Line
-     (Win         : Window := Standard_Window;
-      Line_Size   : Natural;
-      Line_Symbol : Attributed_Character := Default_Character)
-   is
-      function Wvline (W   : Window;
-                       Ch  : C_Chtype;
-                       Len : C_Int) return C_Int;
-      pragma Import (C, Wvline, "wvline");
-   begin
-      if Wvline (Win,
-                 AttrChar_To_Chtype (Line_Symbol),
-                 C_Int (Line_Size)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Vertical_Line;
-
-------------------------------------------------------------------------------
-   function Get_Keystroke (Win : Window := Standard_Window)
-     return Real_Key_Code
-   is
-      function Wgetch (W : Window) return C_Int;
-      pragma Import (C, Wgetch, "wgetch");
-
-      C : constant C_Int := Wgetch (Win);
-   begin
-      if C = Curses_Err then
-         return Key_None;
-      else
-         return Real_Key_Code (C);
-      end if;
-   end Get_Keystroke;
-
-   procedure Undo_Keystroke (Key : Real_Key_Code)
-   is
-      function Ungetch (Ch : C_Int) return C_Int;
-      pragma Import (C, Ungetch, "ungetch");
-   begin
-      if Ungetch (C_Int (Key)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Undo_Keystroke;
-
-   function Has_Key (Key : Special_Key_Code) return Boolean
-   is
-      function Haskey (Key : C_Int) return C_Int;
-      pragma Import (C, Haskey, "has_key");
-   begin
-      if Haskey (C_Int (Key)) = Curses_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Has_Key;
-
-   function Is_Function_Key (Key : Special_Key_Code) return Boolean
-   is
-      L : constant Special_Key_Code  := Special_Key_Code (Natural (Key_F0) +
-        Natural (Function_Key_Number'Last));
-   begin
-      if (Key >= Key_F0) and then (Key <= L) then
-         return True;
-      else
-         return False;
-      end if;
-   end Is_Function_Key;
-
-   function Function_Key (Key : Real_Key_Code)
-                          return Function_Key_Number
-   is
-   begin
-      if Is_Function_Key (Key) then
-         return Function_Key_Number (Key - Key_F0);
-      else
-         raise Constraint_Error;
-      end if;
-   end Function_Key;
-
-   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code
-   is
-   begin
-      return Real_Key_Code (Natural (Key_F0) + Natural (Key));
-   end Function_Key_Code;
-------------------------------------------------------------------------------
-   procedure Standout (Win : Window  := Standard_Window;
-                       On  : Boolean := True)
-   is
-      function wstandout (Win : Window) return C_Int;
-      pragma Import (C, wstandout, "wstandout");
-      function wstandend (Win : Window) return C_Int;
-      pragma Import (C, wstandend, "wstandend");
-
-      Err : C_Int;
-   begin
-      if On then
-         Err := wstandout (Win);
-      else
-         Err := wstandend (Win);
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Standout;
-
-   procedure Switch_Character_Attribute
-     (Win  : Window := Standard_Window;
-      Attr : Character_Attribute_Set := Normal_Video;
-      On   : Boolean := True)
-   is
-      function Wattron (Win    : Window;
-                        C_Attr : C_AttrType) return C_Int;
-      pragma Import (C, Wattron, "wattr_on");
-      function Wattroff (Win    : Window;
-                         C_Attr : C_AttrType) return C_Int;
-      pragma Import (C, Wattroff, "wattr_off");
-      --  In Ada we use the On Boolean to control whether or not we want to
-      --  switch on or off the attributes in the set.
-      Err : C_Int;
-      AC  : constant Attributed_Character := (Ch    => Character'First,
-                                              Color => Color_Pair'First,
-                                              Attr  => Attr);
-   begin
-      if On then
-         Err := Wattron  (Win, AttrChar_To_AttrType (AC));
-      else
-         Err := Wattroff (Win, AttrChar_To_AttrType (AC));
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Switch_Character_Attribute;
-
-   procedure Set_Character_Attributes
-     (Win   : Window := Standard_Window;
-      Attr  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Wattrset (Win    : Window;
-                         C_Attr : C_AttrType) return C_Int;
-      pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set
-   begin
-      if Wattrset (Win,
-                   AttrChar_To_AttrType (Attributed_Character'
-                                         (Ch    => Character'First,
-                                          Color => Color,
-                                          Attr  => Attr))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Character_Attributes;
-
-   function Get_Character_Attribute (Win : Window := Standard_Window)
-                                     return Character_Attribute_Set
-   is
-      function Wattrget (Win : Window;
-                         Atr : access C_AttrType;
-                         Col : access C_Short;
-                         Opt : System.Address) return C_Int;
-      pragma Import (C, Wattrget, "wattr_get");
-
-      Attr : aliased C_AttrType;
-      Col  : aliased C_Short;
-      Res  : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
-                                         System.Null_Address);
-      Ch   : Attributed_Character;
-   begin
-      if Res = Curses_Ok then
-         Ch := AttrType_To_AttrChar (Attr);
-         return Ch.Attr;
-      else
-         raise Curses_Exception;
-      end if;
-   end Get_Character_Attribute;
-
-   function Get_Character_Attribute (Win : Window := Standard_Window)
-                                     return Color_Pair
-   is
-      function Wattrget (Win : Window;
-                         Atr : access C_AttrType;
-                         Col : access C_Short;
-                         Opt : System.Address) return C_Int;
-      pragma Import (C, Wattrget, "wattr_get");
-
-      Attr : aliased C_AttrType;
-      Col  : aliased C_Short;
-      Res  : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
-                                         System.Null_Address);
-      Ch   : Attributed_Character;
-   begin
-      if Res = Curses_Ok then
-         Ch := AttrType_To_AttrChar (Attr);
-         return Ch.Color;
-      else
-         raise Curses_Exception;
-      end if;
-   end Get_Character_Attribute;
-
-   procedure Set_Color (Win  : Window := Standard_Window;
-                        Pair : Color_Pair)
-   is
-      function Wset_Color (Win   : Window;
-                           Color : C_Short;
-                           Opts  : C_Void_Ptr) return C_Int;
-      pragma Import (C, Wset_Color, "wcolor_set");
-   begin
-      if Wset_Color (Win,
-                     C_Short (Pair),
-                     C_Void_Ptr (System.Null_Address)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Color;
-
-   procedure Change_Attributes
-     (Win   : Window := Standard_Window;
-      Count : Integer := -1;
-      Attr  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Wchgat (Win   : Window;
-                       Cnt   : C_Int;
-                       Attr  : C_AttrType;
-                       Color : C_Short;
-                       Opts  : System.Address := System.Null_Address)
-                       return C_Int;
-      pragma Import (C, Wchgat, "wchgat");
-
-      Ch : constant Attributed_Character :=
-        (Ch => Character'First, Color => Color_Pair'First, Attr => Attr);
-   begin
-      if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch),
-                 C_Short (Color)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Change_Attributes;
-
-   procedure Change_Attributes
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position := Line_Position'First;
-      Column : Column_Position := Column_Position'First;
-      Count  : Integer := -1;
-      Attr   : Character_Attribute_Set := Normal_Video;
-      Color  : Color_Pair := Color_Pair'First)
-   is
-   begin
-      Move_Cursor (Win, Line, Column);
-      Change_Attributes (Win, Count, Attr, Color);
-   end Change_Attributes;
-------------------------------------------------------------------------------
-   procedure Beep
-   is
-      function Beeper return C_Int;
-      pragma Import (C, Beeper, "beep");
-   begin
-      if Beeper = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Beep;
-
-   procedure Flash_Screen
-   is
-      function Flash return C_Int;
-      pragma Import (C, Flash, "flash");
-   begin
-      if Flash = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Flash_Screen;
-------------------------------------------------------------------------------
-   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True)
-   is
-      function Cbreak return C_Int;
-      pragma Import (C, Cbreak, "cbreak");
-      function NoCbreak return C_Int;
-      pragma Import (C, NoCbreak, "nocbreak");
-
-      Err : C_Int;
-   begin
-      if SwitchOn then
-         Err := Cbreak;
-      else
-         Err := NoCbreak;
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Cbreak_Mode;
-
-   procedure Set_Raw_Mode (SwitchOn : Boolean := True)
-   is
-      function Raw return C_Int;
-      pragma Import (C, Raw, "raw");
-      function NoRaw return C_Int;
-      pragma Import (C, NoRaw, "noraw");
-
-      Err : C_Int;
-   begin
-      if SwitchOn then
-         Err := Raw;
-      else
-         Err := NoRaw;
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Raw_Mode;
-
-   procedure Set_Echo_Mode (SwitchOn : Boolean := True)
-   is
-      function Echo return C_Int;
-      pragma Import (C, Echo, "echo");
-      function NoEcho return C_Int;
-      pragma Import (C, NoEcho, "noecho");
-
-      Err : C_Int;
-   begin
-      if SwitchOn then
-         Err := Echo;
-      else
-         Err := NoEcho;
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Echo_Mode;
-
-   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
-                            SwitchOn : Boolean := True)
-   is
-      function Meta (W : Window; Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Meta, "meta");
-   begin
-      if Meta (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Meta_Mode;
-
-   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
-                              SwitchOn : Boolean := True)
-   is
-      function Keypad (W : Window; Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Keypad, "keypad");
-   begin
-      if Keypad (Win, Curses_Bool (Boolean'Pos (SwitchOn))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_KeyPad_Mode;
-
-   function Get_KeyPad_Mode (Win : Window := Standard_Window)
-                             return Boolean
-   is
-      function Is_Keypad (W : Window) return Curses_Bool;
-      pragma Import (C, Is_Keypad, "is_keypad");
-   begin
-      return (Is_Keypad (Win) /= Curses_Bool_False);
-   end Get_KeyPad_Mode;
-
-   procedure Half_Delay (Amount : Half_Delay_Amount)
-   is
-      function Halfdelay (Amount : C_Int) return C_Int;
-      pragma Import (C, Halfdelay, "halfdelay");
-   begin
-      if Halfdelay (C_Int (Amount)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Half_Delay;
-
-   procedure Set_Flush_On_Interrupt_Mode
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := True)
-   is
-      function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Intrflush, "intrflush");
-   begin
-      if Intrflush (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Flush_On_Interrupt_Mode;
-
-   procedure Set_Queue_Interrupt_Mode
-     (Win   : Window := Standard_Window;
-      Flush : Boolean := True)
-   is
-      procedure Qiflush;
-      pragma Import (C, Qiflush, "qiflush");
-      procedure No_Qiflush;
-      pragma Import (C, No_Qiflush, "noqiflush");
-   begin
-      if Win = Null_Window then
-         raise Curses_Exception;
-      end if;
-      if Flush then
-         Qiflush;
-      else
-         No_Qiflush;
-      end if;
-   end Set_Queue_Interrupt_Mode;
-
-   procedure Set_NoDelay_Mode
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := False)
-   is
-      function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Nodelay, "nodelay");
-   begin
-      if Nodelay (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_NoDelay_Mode;
-
-   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
-                               Mode   : Timeout_Mode;
-                               Amount : Natural)
-   is
-      procedure Wtimeout (Win : Window; Amount : C_Int);
-      pragma Import (C, Wtimeout, "wtimeout");
-
-      Time : C_Int;
-   begin
-      case Mode is
-         when Blocking     => Time := -1;
-         when Non_Blocking => Time := 0;
-         when Delayed      =>
-            if Amount = 0 then
-               raise Constraint_Error;
-            end if;
-            Time := C_Int (Amount);
-      end case;
-      Wtimeout (Win, Time);
-   end Set_Timeout_Mode;
-
-   procedure Set_Escape_Timer_Mode
-     (Win       : Window := Standard_Window;
-      Timer_Off : Boolean := False)
-   is
-      function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Notimeout, "notimeout");
-   begin
-      if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off)))
-        = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Escape_Timer_Mode;
-
-------------------------------------------------------------------------------
-   procedure Set_NL_Mode (SwitchOn : Boolean := True)
-   is
-      function NL return C_Int;
-      pragma Import (C, NL, "nl");
-      function NoNL return C_Int;
-      pragma Import (C, NoNL, "nonl");
-
-      Err : C_Int;
-   begin
-      if SwitchOn then
-         Err := NL;
-      else
-         Err := NoNL;
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_NL_Mode;
-
-   procedure Clear_On_Next_Update
-     (Win      : Window := Standard_Window;
-      Do_Clear : Boolean := True)
-   is
-      function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int;
-      pragma Import (C, Clear_Ok, "clearok");
-   begin
-      if Clear_Ok (Win, Curses_Bool (Boolean'Pos (Do_Clear))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Clear_On_Next_Update;
-
-   procedure Use_Insert_Delete_Line
-     (Win    : Window := Standard_Window;
-      Do_Idl : Boolean := True)
-   is
-      function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int;
-      pragma Import (C, IDL_Ok, "idlok");
-   begin
-      if IDL_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idl))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Use_Insert_Delete_Line;
-
-   procedure Use_Insert_Delete_Character
-     (Win    : Window := Standard_Window;
-      Do_Idc : Boolean := True)
-   is
-      procedure IDC_Ok (W : Window; Flag : Curses_Bool);
-      pragma Import (C, IDC_Ok, "idcok");
-   begin
-      IDC_Ok (Win, Curses_Bool (Boolean'Pos (Do_Idc)));
-   end Use_Insert_Delete_Character;
-
-   procedure Leave_Cursor_After_Update
-     (Win      : Window := Standard_Window;
-      Do_Leave : Boolean := True)
-   is
-      function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int;
-      pragma Import (C, Leave_Ok, "leaveok");
-   begin
-      if Leave_Ok (Win, Curses_Bool (Boolean'Pos (Do_Leave))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Leave_Cursor_After_Update;
-
-   procedure Immediate_Update_Mode
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := False)
-   is
-      procedure Immedok (Win : Window; Mode : Curses_Bool);
-      pragma Import (C, Immedok, "immedok");
-   begin
-      Immedok (Win, Curses_Bool (Boolean'Pos (Mode)));
-   end Immediate_Update_Mode;
-
-   procedure Allow_Scrolling
-     (Win  : Window  := Standard_Window;
-      Mode : Boolean := False)
-   is
-      function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int;
-      pragma Import (C, Scrollok, "scrollok");
-   begin
-      if Scrollok (Win, Curses_Bool (Boolean'Pos (Mode))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Allow_Scrolling;
-
-   function Scrolling_Allowed (Win : Window := Standard_Window)
-                               return Boolean
-   is
-      function Is_Scroll_Ok (W : Window) return Curses_Bool;
-      pragma Import (C, Is_Scroll_Ok, "is_scrollok");
-   begin
-      return (Is_Scroll_Ok (Win) /= Curses_Bool_False);
-   end Scrolling_Allowed;
-
-   procedure Set_Scroll_Region
-     (Win         : Window := Standard_Window;
-      Top_Line    : Line_Position;
-      Bottom_Line : Line_Position)
-   is
-      function Wsetscrreg (Win : Window;
-                           Lin : C_Int;
-                           Col : C_Int) return C_Int;
-      pragma Import (C, Wsetscrreg, "wsetscrreg");
-   begin
-      if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line))
-        = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Scroll_Region;
-------------------------------------------------------------------------------
-   procedure Update_Screen
-   is
-      function Do_Update return C_Int;
-      pragma Import (C, Do_Update, "doupdate");
-   begin
-      if Do_Update = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Update_Screen;
-
-   procedure Refresh (Win : Window := Standard_Window)
-   is
-      function Wrefresh (W : Window) return C_Int;
-      pragma Import (C, Wrefresh, "wrefresh");
-   begin
-      if Wrefresh (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Refresh;
-
-   procedure Refresh_Without_Update
-     (Win : Window := Standard_Window)
-   is
-      function Wnoutrefresh (W : Window) return C_Int;
-      pragma Import (C, Wnoutrefresh, "wnoutrefresh");
-   begin
-      if Wnoutrefresh (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Refresh_Without_Update;
-
-   procedure Redraw (Win : Window := Standard_Window)
-   is
-      function Redrawwin (Win : Window) return C_Int;
-      pragma Import (C, Redrawwin, "redrawwin");
-   begin
-      if Redrawwin (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Redraw;
-
-   procedure Redraw
-     (Win        : Window := Standard_Window;
-      Begin_Line : Line_Position;
-      Line_Count : Positive)
-   is
-      function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int)
-                          return C_Int;
-      pragma Import (C, Wredrawln, "wredrawln");
-   begin
-      if Wredrawln (Win,
-                    C_Int (Begin_Line),
-                    C_Int (Line_Count)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Redraw;
-
-------------------------------------------------------------------------------
-   procedure Erase (Win : Window := Standard_Window)
-   is
-      function Werase (W : Window) return C_Int;
-      pragma Import (C, Werase, "werase");
-   begin
-      if Werase (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Erase;
-
-   procedure Clear (Win : Window := Standard_Window)
-   is
-      function Wclear (W : Window) return C_Int;
-      pragma Import (C, Wclear, "wclear");
-   begin
-      if Wclear (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Clear;
-
-   procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window)
-   is
-      function Wclearbot (W : Window) return C_Int;
-      pragma Import (C, Wclearbot, "wclrtobot");
-   begin
-      if Wclearbot (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Clear_To_End_Of_Screen;
-
-   procedure Clear_To_End_Of_Line (Win : Window := Standard_Window)
-   is
-      function Wcleareol (W : Window) return C_Int;
-      pragma Import (C, Wcleareol, "wclrtoeol");
-   begin
-      if Wcleareol (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Clear_To_End_Of_Line;
-------------------------------------------------------------------------------
-   procedure Set_Background
-     (Win : Window := Standard_Window;
-      Ch  : Attributed_Character)
-   is
-      procedure WBackground (W : Window; Ch : C_Chtype);
-      pragma Import (C, WBackground, "wbkgdset");
-   begin
-      WBackground (Win, AttrChar_To_Chtype (Ch));
-   end Set_Background;
-
-   procedure Change_Background
-     (Win : Window := Standard_Window;
-      Ch  : Attributed_Character)
-   is
-      function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int;
-      pragma Import (C, WChangeBkgd, "wbkgd");
-   begin
-      if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Change_Background;
-
-   function Get_Background (Win : Window := Standard_Window)
-     return Attributed_Character
-   is
-      function Wgetbkgd (Win : Window) return C_Chtype;
-      pragma Import (C, Wgetbkgd, "getbkgd");
-   begin
-      return Chtype_To_AttrChar (Wgetbkgd (Win));
-   end Get_Background;
-------------------------------------------------------------------------------
-   procedure Change_Lines_Status (Win   : Window := Standard_Window;
-                                  Start : Line_Position;
-                                  Count : Positive;
-                                  State : Boolean)
-   is
-      function Wtouchln (Win : Window;
-                         Sta : C_Int;
-                         Cnt : C_Int;
-                         Chg : C_Int) return C_Int;
-      pragma Import (C, Wtouchln, "wtouchln");
-   begin
-      if Wtouchln (Win, C_Int (Start), C_Int (Count),
-                   C_Int (Boolean'Pos (State))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Change_Lines_Status;
-
-   procedure Touch (Win : Window := Standard_Window)
-   is
-      Y : Line_Position;
-      X : Column_Position;
-   begin
-      Get_Size (Win, Y, X);
-      pragma Unreferenced (X);
-      Change_Lines_Status (Win, 0, Positive (Y), True);
-   end Touch;
-
-   procedure Untouch (Win : Window := Standard_Window)
-   is
-      Y : Line_Position;
-      X : Column_Position;
-   begin
-      Get_Size (Win, Y, X);
-      pragma Unreferenced (X);
-      Change_Lines_Status (Win, 0, Positive (Y), False);
-   end Untouch;
-
-   procedure Touch (Win   : Window := Standard_Window;
-                    Start : Line_Position;
-                    Count : Positive)
-   is
-   begin
-      Change_Lines_Status (Win, Start, Count, True);
-   end Touch;
-
-   function Is_Touched
-     (Win  : Window := Standard_Window;
-      Line : Line_Position) return Boolean
-   is
-      function WLineTouched (W : Window; L : C_Int) return Curses_Bool;
-      pragma Import (C, WLineTouched, "is_linetouched");
-   begin
-      if WLineTouched (Win, C_Int (Line)) = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Is_Touched;
-
-   function Is_Touched
-     (Win : Window := Standard_Window) return Boolean
-   is
-      function WWinTouched (W : Window) return Curses_Bool;
-      pragma Import (C, WWinTouched, "is_wintouched");
-   begin
-      if WWinTouched (Win) = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Is_Touched;
-------------------------------------------------------------------------------
-   procedure Copy
-     (Source_Window            : Window;
-      Destination_Window       : Window;
-      Source_Top_Row           : Line_Position;
-      Source_Left_Column       : Column_Position;
-      Destination_Top_Row      : Line_Position;
-      Destination_Left_Column  : Column_Position;
-      Destination_Bottom_Row   : Line_Position;
-      Destination_Right_Column : Column_Position;
-      Non_Destructive_Mode     : Boolean := True)
-   is
-      function Copywin (Src : Window;
-                        Dst : Window;
-                        Str : C_Int;
-                        Slc : C_Int;
-                        Dtr : C_Int;
-                        Dlc : C_Int;
-                        Dbr : C_Int;
-                        Drc : C_Int;
-                        Ndm : C_Int) return C_Int;
-      pragma Import (C, Copywin, "copywin");
-   begin
-      if Copywin (Source_Window,
-                  Destination_Window,
-                  C_Int (Source_Top_Row),
-                  C_Int (Source_Left_Column),
-                  C_Int (Destination_Top_Row),
-                  C_Int (Destination_Left_Column),
-                  C_Int (Destination_Bottom_Row),
-                  C_Int (Destination_Right_Column),
-                  Boolean'Pos (Non_Destructive_Mode)
-                ) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Copy;
-
-   procedure Overwrite
-     (Source_Window      : Window;
-      Destination_Window : Window)
-   is
-      function Overwrite (Src : Window; Dst : Window) return C_Int;
-      pragma Import (C, Overwrite, "overwrite");
-   begin
-      if Overwrite (Source_Window, Destination_Window) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Overwrite;
-
-   procedure Overlay
-     (Source_Window      : Window;
-      Destination_Window : Window)
-   is
-      function Overlay (Src : Window; Dst : Window) return C_Int;
-      pragma Import (C, Overlay, "overlay");
-   begin
-      if Overlay (Source_Window, Destination_Window) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Overlay;
-
-------------------------------------------------------------------------------
-   procedure Insert_Delete_Lines
-     (Win   : Window := Standard_Window;
-      Lines : Integer       := 1) -- default is to insert one line above
-   is
-      function Winsdelln (W : Window; N : C_Int) return C_Int;
-      pragma Import (C, Winsdelln, "winsdelln");
-   begin
-      if Winsdelln (Win, C_Int (Lines)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Insert_Delete_Lines;
-
-   procedure Delete_Line (Win : Window := Standard_Window)
-   is
-   begin
-      Insert_Delete_Lines (Win, -1);
-   end Delete_Line;
-
-   procedure Insert_Line (Win : Window := Standard_Window)
-   is
-   begin
-      Insert_Delete_Lines (Win, 1);
-   end Insert_Line;
-------------------------------------------------------------------------------
-
-   procedure Get_Size
-     (Win               : Window := Standard_Window;
-      Number_Of_Lines   : out Line_Count;
-      Number_Of_Columns : out Column_Count)
-   is
-      function GetMaxY (W : Window) return C_Int;
-      pragma Import (C, GetMaxY, "getmaxy");
-
-      function GetMaxX (W : Window) return C_Int;
-      pragma Import (C, GetMaxX, "getmaxx");
-
-      Y : constant C_Int := GetMaxY (Win);
-      X : constant C_Int := GetMaxX (Win);
-   begin
-      Number_Of_Lines   := Line_Count (Y);
-      Number_Of_Columns := Column_Count (X);
-   end Get_Size;
-
-   procedure Get_Window_Position
-     (Win             : Window := Standard_Window;
-      Top_Left_Line   : out Line_Position;
-      Top_Left_Column : out Column_Position)
-   is
-      function GetBegY (W : Window) return C_Int;
-      pragma Import (C, GetBegY, "getbegy");
-
-      function GetBegX (W : Window) return C_Int;
-      pragma Import (C, GetBegX, "getbegx");
-
-      Y : constant C_Short := C_Short (GetBegY (Win));
-      X : constant C_Short := C_Short (GetBegX (Win));
-   begin
-      Top_Left_Line   := Line_Position (Y);
-      Top_Left_Column := Column_Position (X);
-   end Get_Window_Position;
-
-   procedure Get_Cursor_Position
-     (Win    :  Window := Standard_Window;
-      Line   : out Line_Position;
-      Column : out Column_Position)
-   is
-      function GetCurY (W : Window) return C_Int;
-      pragma Import (C, GetCurY, "getcury");
-
-      function GetCurX (W : Window) return C_Int;
-      pragma Import (C, GetCurX, "getcurx");
-
-      Y : constant C_Short := C_Short (GetCurY (Win));
-      X : constant C_Short := C_Short (GetCurX (Win));
-   begin
-      Line   := Line_Position (Y);
-      Column := Column_Position (X);
-   end Get_Cursor_Position;
-
-   procedure Get_Origin_Relative_To_Parent
-     (Win                :  Window;
-      Top_Left_Line      : out Line_Position;
-      Top_Left_Column    : out Column_Position;
-      Is_Not_A_Subwindow : out Boolean)
-   is
-      function GetParY (W : Window) return C_Int;
-      pragma Import (C, GetParY, "getpary");
-
-      function GetParX (W : Window) return C_Int;
-      pragma Import (C, GetParX, "getparx");
-
-      Y : constant C_Int := GetParY (Win);
-      X : constant C_Int := GetParX (Win);
-   begin
-      if Y = -1 then
-         Top_Left_Line   := Line_Position'Last;
-         Top_Left_Column := Column_Position'Last;
-         Is_Not_A_Subwindow := True;
-      else
-         Top_Left_Line   := Line_Position (Y);
-         Top_Left_Column := Column_Position (X);
-         Is_Not_A_Subwindow := False;
-      end if;
-   end Get_Origin_Relative_To_Parent;
-------------------------------------------------------------------------------
-   function New_Pad (Lines   : Line_Count;
-                     Columns : Column_Count) return Window
-   is
-      function Newpad (Lines : C_Int; Columns : C_Int) return Window;
-      pragma Import (C, Newpad, "newpad");
-
-      W : Window;
-   begin
-      W := Newpad (C_Int (Lines), C_Int (Columns));
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-      return W;
-   end New_Pad;
-
-   function Sub_Pad
-     (Pad                   : Window;
-      Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window
-   is
-      function Subpad
-        (Pad                   : Window;
-         Number_Of_Lines       : C_Int;
-         Number_Of_Columns     : C_Int;
-         First_Line_Position   : C_Int;
-         First_Column_Position : C_Int) return Window;
-      pragma Import (C, Subpad, "subpad");
-
-      W : Window;
-   begin
-      W := Subpad (Pad,
-                   C_Int (Number_Of_Lines),
-                   C_Int (Number_Of_Columns),
-                   C_Int (First_Line_Position),
-                   C_Int (First_Column_Position));
-      if W = Null_Window then
-         raise Curses_Exception;
-      end if;
-      return W;
-   end Sub_Pad;
-
-   procedure Refresh
-     (Pad                      : Window;
-      Source_Top_Row           : Line_Position;
-      Source_Left_Column       : Column_Position;
-      Destination_Top_Row      : Line_Position;
-      Destination_Left_Column  : Column_Position;
-      Destination_Bottom_Row   : Line_Position;
-      Destination_Right_Column : Column_Position)
-   is
-      function Prefresh
-        (Pad                      : Window;
-         Source_Top_Row           : C_Int;
-         Source_Left_Column       : C_Int;
-         Destination_Top_Row      : C_Int;
-         Destination_Left_Column  : C_Int;
-         Destination_Bottom_Row   : C_Int;
-         Destination_Right_Column : C_Int) return C_Int;
-      pragma Import (C, Prefresh, "prefresh");
-   begin
-      if Prefresh (Pad,
-                   C_Int (Source_Top_Row),
-                   C_Int (Source_Left_Column),
-                   C_Int (Destination_Top_Row),
-                   C_Int (Destination_Left_Column),
-                   C_Int (Destination_Bottom_Row),
-                   C_Int (Destination_Right_Column)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Refresh;
-
-   procedure Refresh_Without_Update
-     (Pad                      : Window;
-      Source_Top_Row           : Line_Position;
-      Source_Left_Column       : Column_Position;
-      Destination_Top_Row      : Line_Position;
-      Destination_Left_Column  : Column_Position;
-      Destination_Bottom_Row   : Line_Position;
-      Destination_Right_Column : Column_Position)
-   is
-      function Pnoutrefresh
-        (Pad                      : Window;
-         Source_Top_Row           : C_Int;
-         Source_Left_Column       : C_Int;
-         Destination_Top_Row      : C_Int;
-         Destination_Left_Column  : C_Int;
-         Destination_Bottom_Row   : C_Int;
-         Destination_Right_Column : C_Int) return C_Int;
-      pragma Import (C, Pnoutrefresh, "pnoutrefresh");
-   begin
-      if Pnoutrefresh (Pad,
-                       C_Int (Source_Top_Row),
-                       C_Int (Source_Left_Column),
-                       C_Int (Destination_Top_Row),
-                       C_Int (Destination_Left_Column),
-                       C_Int (Destination_Bottom_Row),
-                       C_Int (Destination_Right_Column)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Refresh_Without_Update;
-
-   procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : Window;
-      Ch  : Attributed_Character)
-   is
-      function Pechochar (Pad : Window; Ch : C_Chtype)
-                          return C_Int;
-      pragma Import (C, Pechochar, "pechochar");
-   begin
-      if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Add_Character_To_Pad_And_Echo_It;
-
-   procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : Window;
-      Ch  : Character)
-   is
-   begin
-      Add_Character_To_Pad_And_Echo_It
-        (Pad,
-         Attributed_Character'(Ch    => Ch,
-                               Color => Color_Pair'First,
-                               Attr  => Normal_Video));
-   end Add_Character_To_Pad_And_Echo_It;
-------------------------------------------------------------------------------
-   procedure Scroll (Win    : Window := Standard_Window;
-                     Amount : Integer := 1)
-   is
-      function Wscrl (Win : Window; N : C_Int) return C_Int;
-      pragma Import (C, Wscrl, "wscrl");
-
-   begin
-      if Wscrl (Win, C_Int (Amount)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Scroll;
-
-------------------------------------------------------------------------------
-   procedure Delete_Character (Win : Window := Standard_Window)
-   is
-      function Wdelch (Win : Window) return C_Int;
-      pragma Import (C, Wdelch, "wdelch");
-   begin
-      if Wdelch (Win) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Delete_Character;
-
-   procedure Delete_Character
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position)
-   is
-      function Mvwdelch (Win : Window;
-                         Lin : C_Int;
-                         Col : C_Int) return C_Int;
-      pragma Import (C, Mvwdelch, "mvwdelch");
-   begin
-      if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Delete_Character;
-------------------------------------------------------------------------------
-   function Peek (Win : Window := Standard_Window)
-     return Attributed_Character
-   is
-      function Winch (Win : Window) return C_Chtype;
-      pragma Import (C, Winch, "winch");
-   begin
-      return Chtype_To_AttrChar (Winch (Win));
-   end Peek;
-
-   function Peek
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position) return Attributed_Character
-   is
-      function Mvwinch (Win : Window;
-                        Lin : C_Int;
-                        Col : C_Int) return C_Chtype;
-      pragma Import (C, Mvwinch, "mvwinch");
-   begin
-      return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column)));
-   end Peek;
-------------------------------------------------------------------------------
-   procedure Insert (Win : Window := Standard_Window;
-                     Ch  : Attributed_Character)
-   is
-      function Winsch (Win : Window; Ch : C_Chtype) return C_Int;
-      pragma Import (C, Winsch, "winsch");
-   begin
-      if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Insert;
-
-   procedure Insert
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Ch     : Attributed_Character)
-   is
-      function Mvwinsch (Win : Window;
-                         Lin : C_Int;
-                         Col : C_Int;
-                         Ch  : C_Chtype) return C_Int;
-      pragma Import (C, Mvwinsch, "mvwinsch");
-   begin
-      if Mvwinsch (Win,
-                   C_Int (Line),
-                   C_Int (Column),
-                   AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Insert;
-------------------------------------------------------------------------------
-   procedure Insert (Win : Window := Standard_Window;
-                     Str : String;
-                     Len : Integer := -1)
-   is
-      function Winsnstr (Win : Window;
-                         Str : char_array;
-                         Len : Integer := -1) return C_Int;
-      pragma Import (C, Winsnstr, "winsnstr");
-
-      Txt    : char_array (0 .. Str'Length);
-      Length : size_t;
-   begin
-      To_C (Str, Txt, Length);
-      if Winsnstr (Win, Txt, Len) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Insert;
-
-   procedure Insert
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Str    : String;
-      Len    : Integer := -1)
-   is
-      function Mvwinsnstr (Win    : Window;
-                           Line   : C_Int;
-                           Column : C_Int;
-                           Str    : char_array;
-                           Len    : C_Int) return C_Int;
-      pragma Import (C, Mvwinsnstr, "mvwinsnstr");
-
-      Txt    : char_array (0 .. Str'Length);
-      Length : size_t;
-   begin
-      To_C (Str, Txt, Length);
-      if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len))
-        = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Insert;
-------------------------------------------------------------------------------
-   procedure Peek (Win :  Window := Standard_Window;
-                   Str : out String;
-                   Len :  Integer := -1)
-   is
-      function Winnstr (Win : Window;
-                        Str : char_array;
-                        Len : C_Int) return C_Int;
-      pragma Import (C, Winnstr, "winnstr");
-
-      N   : Integer := Len;
-      Txt : char_array (0 .. Str'Length);
-      Cnt : Natural;
-   begin
-      if N < 0 then
-         N := Str'Length;
-      end if;
-      if N > Str'Length then
-         raise Constraint_Error;
-      end if;
-      Txt (0) := Interfaces.C.char'First;
-      if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-      To_Ada (Txt, Str, Cnt, True);
-      if Cnt < Str'Length then
-         Str ((Str'First + Cnt) .. Str'Last) := (others => ' ');
-      end if;
-   end Peek;
-
-   procedure Peek
-     (Win    :  Window := Standard_Window;
-      Line   :  Line_Position;
-      Column :  Column_Position;
-      Str    : out String;
-      Len    :  Integer := -1)
-   is
-   begin
-      Move_Cursor (Win, Line, Column);
-      Peek (Win, Str, Len);
-   end Peek;
-------------------------------------------------------------------------------
-   procedure Peek
-     (Win :  Window := Standard_Window;
-      Str : out Attributed_String;
-      Len :  Integer := -1)
-   is
-      function Winchnstr (Win : Window;
-                          Str : chtype_array;             -- out
-                          Len : C_Int) return C_Int;
-      pragma Import (C, Winchnstr, "winchnstr");
-
-      N   : Integer := Len;
-      Txt : constant chtype_array (0 .. Str'Length)
-          := (0 => Default_Character);
-      Cnt : Natural := 0;
-   begin
-      if N < 0 then
-         N := Str'Length;
-      end if;
-      if N > Str'Length then
-         raise Constraint_Error;
-      end if;
-      if Winchnstr (Win, Txt, C_Int (N)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-      for To in Str'Range loop
-         exit when Txt (size_t (Cnt)) = Default_Character;
-         Str (To) := Txt (size_t (Cnt));
-         Cnt := Cnt + 1;
-      end loop;
-      if Cnt < Str'Length then
-         Str ((Str'First + Cnt) .. Str'Last) :=
-           (others => (Ch => ' ',
-                       Color => Color_Pair'First,
-                       Attr => Normal_Video));
-      end if;
-   end Peek;
-
-   procedure Peek
-     (Win    :  Window := Standard_Window;
-      Line   :  Line_Position;
-      Column :  Column_Position;
-      Str    : out Attributed_String;
-      Len    : Integer := -1)
-   is
-   begin
-      Move_Cursor (Win, Line, Column);
-      Peek (Win, Str, Len);
-   end Peek;
-------------------------------------------------------------------------------
-   procedure Get (Win :  Window := Standard_Window;
-                  Str : out String;
-                  Len :  Integer := -1)
-   is
-      function Wgetnstr (Win : Window;
-                         Str : char_array;
-                         Len : C_Int) return C_Int;
-      pragma Import (C, Wgetnstr, "wgetnstr");
-
-      N   : Integer := Len;
-      Txt : char_array (0 .. Str'Length);
-      Cnt : Natural;
-   begin
-      if N < 0 then
-         N := Str'Length;
-      end if;
-      if N > Str'Length then
-         raise Constraint_Error;
-      end if;
-      Txt (0) := Interfaces.C.char'First;
-      if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-      To_Ada (Txt, Str, Cnt, True);
-      if Cnt < Str'Length then
-         Str ((Str'First + Cnt) .. Str'Last) := (others => ' ');
-      end if;
-   end Get;
-
-   procedure Get
-     (Win    :  Window := Standard_Window;
-      Line   :  Line_Position;
-      Column :  Column_Position;
-      Str    : out String;
-      Len    :  Integer := -1)
-   is
-   begin
-      Move_Cursor (Win, Line, Column);
-      Get (Win, Str, Len);
-   end Get;
-------------------------------------------------------------------------------
-   procedure Init_Soft_Label_Keys
-     (Format : Soft_Label_Key_Format := Three_Two_Three)
-   is
-      function Slk_Init (Fmt : C_Int) return C_Int;
-      pragma Import (C, Slk_Init, "slk_init");
-   begin
-      if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Init_Soft_Label_Keys;
-
-   procedure Set_Soft_Label_Key (Label : Label_Number;
-                                 Text  : String;
-                                 Fmt   : Label_Justification := Left)
-   is
-      function Slk_Set (Label : C_Int;
-                        Txt   : char_array;
-                        Fmt   : C_Int) return C_Int;
-      pragma Import (C, Slk_Set, "slk_set");
-
-      Txt : char_array (0 .. Text'Length);
-      Len : size_t;
-   begin
-      To_C (Text, Txt, Len);
-      if Slk_Set (C_Int (Label), Txt,
-                  C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Soft_Label_Key;
-
-   procedure Refresh_Soft_Label_Keys
-   is
-      function Slk_Refresh return C_Int;
-      pragma Import (C, Slk_Refresh, "slk_refresh");
-   begin
-      if Slk_Refresh = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Refresh_Soft_Label_Keys;
-
-   procedure Refresh_Soft_Label_Keys_Without_Update
-   is
-      function Slk_Noutrefresh return C_Int;
-      pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh");
-   begin
-      if Slk_Noutrefresh = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Refresh_Soft_Label_Keys_Without_Update;
-
-   procedure Get_Soft_Label_Key (Label : Label_Number;
-                                 Text  : out String)
-   is
-      function Slk_Label (Label : C_Int) return chars_ptr;
-      pragma Import (C, Slk_Label, "slk_label");
-   begin
-      Fill_String (Slk_Label (C_Int (Label)), Text);
-   end Get_Soft_Label_Key;
-
-   function Get_Soft_Label_Key (Label : Label_Number) return String
-   is
-      function Slk_Label (Label : C_Int) return chars_ptr;
-      pragma Import (C, Slk_Label, "slk_label");
-   begin
-      return Fill_String (Slk_Label (C_Int (Label)));
-   end Get_Soft_Label_Key;
-
-   procedure Clear_Soft_Label_Keys
-   is
-      function Slk_Clear return C_Int;
-      pragma Import (C, Slk_Clear, "slk_clear");
-   begin
-      if Slk_Clear = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Clear_Soft_Label_Keys;
-
-   procedure Restore_Soft_Label_Keys
-   is
-      function Slk_Restore return C_Int;
-      pragma Import (C, Slk_Restore, "slk_restore");
-   begin
-      if Slk_Restore = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Restore_Soft_Label_Keys;
-
-   procedure Touch_Soft_Label_Keys
-   is
-      function Slk_Touch return C_Int;
-      pragma Import (C, Slk_Touch, "slk_touch");
-   begin
-      if Slk_Touch = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Touch_Soft_Label_Keys;
-
-   procedure Switch_Soft_Label_Key_Attributes
-     (Attr : Character_Attribute_Set;
-      On   : Boolean := True)
-   is
-      function Slk_Attron (Ch : C_Chtype) return C_Int;
-      pragma Import (C, Slk_Attron, "slk_attron");
-      function Slk_Attroff (Ch : C_Chtype) return C_Int;
-      pragma Import (C, Slk_Attroff, "slk_attroff");
-
-      Err : C_Int;
-      Ch  : constant Attributed_Character := (Ch    => Character'First,
-                                              Attr  => Attr,
-                                              Color => Color_Pair'First);
-   begin
-      if On then
-         Err := Slk_Attron  (AttrChar_To_Chtype (Ch));
-      else
-         Err := Slk_Attroff (AttrChar_To_Chtype (Ch));
-      end if;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Switch_Soft_Label_Key_Attributes;
-
-   procedure Set_Soft_Label_Key_Attributes
-     (Attr  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First)
-   is
-      function Slk_Attrset (Ch : C_Chtype) return C_Int;
-      pragma Import (C, Slk_Attrset, "slk_attrset");
-
-      Ch : constant Attributed_Character := (Ch    => Character'First,
-                                             Attr  => Attr,
-                                             Color => Color);
-   begin
-      if Slk_Attrset (AttrChar_To_Chtype (Ch)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Soft_Label_Key_Attributes;
-
-   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set
-   is
-      function Slk_Attr return C_Chtype;
-      pragma Import (C, Slk_Attr, "slk_attr");
-
-      Attr : constant C_Chtype := Slk_Attr;
-   begin
-      return Chtype_To_AttrChar (Attr).Attr;
-   end Get_Soft_Label_Key_Attributes;
-
-   function Get_Soft_Label_Key_Attributes return Color_Pair
-   is
-      function Slk_Attr return C_Chtype;
-      pragma Import (C, Slk_Attr, "slk_attr");
-
-      Attr : constant C_Chtype := Slk_Attr;
-   begin
-      return Chtype_To_AttrChar (Attr).Color;
-   end Get_Soft_Label_Key_Attributes;
-
-   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair)
-   is
-      function Slk_Color (Color : C_Short) return C_Int;
-      pragma Import (C, Slk_Color, "slk_color");
-   begin
-      if Slk_Color (C_Short (Pair)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Set_Soft_Label_Key_Color;
-
-------------------------------------------------------------------------------
-   procedure Enable_Key (Key    : Special_Key_Code;
-                         Enable : Boolean := True)
-   is
-      function Keyok (Keycode : C_Int;
-                      On_Off  : Curses_Bool) return C_Int;
-      pragma Import (C, Keyok, "keyok");
-   begin
-      if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable)))
-        = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Enable_Key;
-------------------------------------------------------------------------------
-   procedure Define_Key (Definition : String;
-                         Key        : Special_Key_Code)
-   is
-      function Defkey (Def : char_array;
-                       Key : C_Int) return C_Int;
-      pragma Import (C, Defkey, "define_key");
-
-      Txt    : char_array (0 .. Definition'Length);
-      Length : size_t;
-   begin
-      To_C (Definition, Txt, Length);
-      if Defkey (Txt, C_Int (Key)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Define_Key;
-------------------------------------------------------------------------------
-   procedure Un_Control (Ch  : Attributed_Character;
-                         Str : out String)
-   is
-      function Unctrl (Ch : C_Chtype) return chars_ptr;
-      pragma Import (C, Unctrl, "unctrl");
-   begin
-      Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str);
-   end Un_Control;
-
-   function Un_Control (Ch : Attributed_Character) return String
-   is
-      function Unctrl (Ch : C_Chtype) return chars_ptr;
-      pragma Import (C, Unctrl, "unctrl");
-   begin
-      return Fill_String (Unctrl (AttrChar_To_Chtype (Ch)));
-   end Un_Control;
-
-   procedure Delay_Output (Msecs : Natural)
-   is
-      function Delayoutput (Msecs : C_Int) return C_Int;
-      pragma Import (C, Delayoutput, "delay_output");
-   begin
-      if Delayoutput (C_Int (Msecs)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Delay_Output;
-
-   procedure Flush_Input
-   is
-      function Flushinp return C_Int;
-      pragma Import (C, Flushinp, "flushinp");
-   begin
-      if Flushinp = Curses_Err then  -- docu says that never happens, but...
-         raise Curses_Exception;
-      end if;
-   end Flush_Input;
-------------------------------------------------------------------------------
-   function Baudrate return Natural
-   is
-      function Baud return C_Int;
-      pragma Import (C, Baud, "baudrate");
-   begin
-      return Natural (Baud);
-   end Baudrate;
-
-   function Erase_Character return Character
-   is
-      function Erasechar return C_Int;
-      pragma Import (C, Erasechar, "erasechar");
-   begin
-      return Character'Val (Erasechar);
-   end Erase_Character;
-
-   function Kill_Character return Character
-   is
-      function Killchar return C_Int;
-      pragma Import (C, Killchar, "killchar");
-   begin
-      return Character'Val (Killchar);
-   end Kill_Character;
-
-   function Has_Insert_Character return Boolean
-   is
-      function Has_Ic return Curses_Bool;
-      pragma Import (C, Has_Ic, "has_ic");
-   begin
-      if Has_Ic = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Has_Insert_Character;
-
-   function Has_Insert_Line return Boolean
-   is
-      function Has_Il return Curses_Bool;
-      pragma Import (C, Has_Il, "has_il");
-   begin
-      if Has_Il = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Has_Insert_Line;
-
-   function Supported_Attributes return Character_Attribute_Set
-   is
-      function Termattrs return C_Chtype;
-      pragma Import (C, Termattrs, "termattrs");
-
-      Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs);
-   begin
-      return Ch.Attr;
-   end Supported_Attributes;
-
-   procedure Long_Name (Name : out String)
-   is
-      function Longname return chars_ptr;
-      pragma Import (C, Longname, "longname");
-   begin
-      Fill_String (Longname, Name);
-   end Long_Name;
-
-   function Long_Name return String
-   is
-      function Longname return chars_ptr;
-      pragma Import (C, Longname, "longname");
-   begin
-      return Fill_String (Longname);
-   end Long_Name;
-
-   procedure Terminal_Name (Name : out String)
-   is
-      function Termname return chars_ptr;
-      pragma Import (C, Termname, "termname");
-   begin
-      Fill_String (Termname, Name);
-   end Terminal_Name;
-
-   function Terminal_Name return String
-   is
-      function Termname return chars_ptr;
-      pragma Import (C, Termname, "termname");
-   begin
-      return Fill_String (Termname);
-   end Terminal_Name;
-------------------------------------------------------------------------------
-   procedure Init_Pair (Pair : Redefinable_Color_Pair;
-                        Fore : Color_Number;
-                        Back : Color_Number)
-   is
-      function Initpair (Pair : C_Short;
-                         Fore : C_Short;
-                         Back : C_Short) return C_Int;
-      pragma Import (C, Initpair, "init_pair");
-   begin
-      if Integer (Pair) >= Number_Of_Color_Pairs then
-         raise Constraint_Error;
-      end if;
-      if Integer (Fore) >= Number_Of_Colors or else
-         Integer (Back) >= Number_Of_Colors then
-         raise Constraint_Error;
-      end if;
-      if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back))
-        = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Init_Pair;
-
-   procedure Pair_Content (Pair : Color_Pair;
-                           Fore : out Color_Number;
-                           Back : out Color_Number)
-   is
-      type C_Short_Access is access all C_Short;
-      function Paircontent (Pair : C_Short;
-                            Fp   : C_Short_Access;
-                            Bp   : C_Short_Access) return C_Int;
-      pragma Import (C, Paircontent, "pair_content");
-
-      F, B : aliased C_Short;
-   begin
-      if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then
-         raise Curses_Exception;
-      else
-         Fore := Color_Number (F);
-         Back := Color_Number (B);
-      end if;
-   end Pair_Content;
-
-   function Has_Colors return Boolean
-   is
-      function Hascolors return Curses_Bool;
-      pragma Import (C, Hascolors, "has_colors");
-   begin
-      if Hascolors = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Has_Colors;
-
-   procedure Init_Color (Color : Color_Number;
-                         Red   : RGB_Value;
-                         Green : RGB_Value;
-                         Blue  : RGB_Value)
-   is
-      function Initcolor (Col   : C_Short;
-                          Red   : C_Short;
-                          Green : C_Short;
-                          Blue  : C_Short) return C_Int;
-      pragma Import (C, Initcolor, "init_color");
-   begin
-      if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green),
-                    C_Short (Blue)) = Curses_Err then
-            raise Curses_Exception;
-      end if;
-   end Init_Color;
-
-   function Can_Change_Color return Boolean
-   is
-      function Canchangecolor return Curses_Bool;
-      pragma Import (C, Canchangecolor, "can_change_color");
-   begin
-      if Canchangecolor = Curses_Bool_False then
-         return False;
-      else
-         return True;
-      end if;
-   end Can_Change_Color;
-
-   procedure Color_Content (Color :  Color_Number;
-                            Red   : out RGB_Value;
-                            Green : out RGB_Value;
-                            Blue  : out RGB_Value)
-   is
-      type C_Short_Access is access all C_Short;
-
-      function Colorcontent (Color : C_Short; R, G, B : C_Short_Access)
-                             return C_Int;
-      pragma Import (C, Colorcontent, "color_content");
-
-      R, G, B : aliased C_Short;
-   begin
-      if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) =
-        Curses_Err then
-         raise Curses_Exception;
-      else
-         Red   := RGB_Value (R);
-         Green := RGB_Value (G);
-         Blue  := RGB_Value (B);
-      end if;
-   end Color_Content;
-
-------------------------------------------------------------------------------
-   procedure Save_Curses_Mode (Mode : Curses_Mode)
-   is
-      function Def_Prog_Mode return C_Int;
-      pragma Import (C, Def_Prog_Mode, "def_prog_mode");
-      function Def_Shell_Mode return C_Int;
-      pragma Import (C, Def_Shell_Mode, "def_shell_mode");
-
-      Err : C_Int;
-   begin
-      case Mode is
-         when Curses => Err := Def_Prog_Mode;
-         when Shell  => Err := Def_Shell_Mode;
-      end case;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Save_Curses_Mode;
-
-   procedure Reset_Curses_Mode (Mode : Curses_Mode)
-   is
-      function Reset_Prog_Mode return C_Int;
-      pragma Import (C, Reset_Prog_Mode, "reset_prog_mode");
-      function Reset_Shell_Mode return C_Int;
-      pragma Import (C, Reset_Shell_Mode, "reset_shell_mode");
-
-      Err : C_Int;
-   begin
-      case Mode is
-         when Curses => Err := Reset_Prog_Mode;
-         when Shell  => Err := Reset_Shell_Mode;
-      end case;
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Reset_Curses_Mode;
-
-   procedure Save_Terminal_State
-   is
-      function Savetty return C_Int;
-      pragma Import (C, Savetty, "savetty");
-   begin
-      if Savetty = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Save_Terminal_State;
-
-   procedure Reset_Terminal_State
-   is
-      function Resetty return C_Int;
-      pragma Import (C, Resetty, "resetty");
-   begin
-      if Resetty = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Reset_Terminal_State;
-
-   procedure Rip_Off_Lines (Lines : Integer;
-                            Proc  : Stdscr_Init_Proc)
-   is
-      function Ripoffline (Lines : C_Int;
-                           Proc  : Stdscr_Init_Proc) return C_Int;
-      pragma Import (C, Ripoffline, "_nc_ripoffline");
-   begin
-      if Ripoffline (C_Int (Lines), Proc) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Rip_Off_Lines;
-
-   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility)
-   is
-      function Curs_Set (Curs : C_Int) return C_Int;
-      pragma Import (C, Curs_Set, "curs_set");
-
-      Res : C_Int;
-   begin
-      Res := Curs_Set (Cursor_Visibility'Pos (Visibility));
-      if Res /= Curses_Err then
-         Visibility := Cursor_Visibility'Val (Res);
-      end if;
-   end Set_Cursor_Visibility;
-
-   procedure Nap_Milli_Seconds (Ms : Natural)
-   is
-      function Napms (Ms : C_Int) return C_Int;
-      pragma Import (C, Napms, "napms");
-   begin
-      if Napms (C_Int (Ms)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Nap_Milli_Seconds;
-------------------------------------------------------------------------------
-
-   function Standard_Window return Window
-   is
-      Result : Window;
-      pragma Import (C, Result, "stdscr");
-   begin
-      return Result;
-   end Standard_Window;
-
-   function Current_Window return Window
-   is
-      Result : Window;
-      pragma Import (C, Result, "curscr");
-   begin
-      return Result;
-   end Current_Window;
-
-   function Lines return Line_Count
-   is
-      Result : C_Int;
-      pragma Import (C, Result, "LINES");
-   begin
-      return Line_Count (Result);
-   end Lines;
-
-   function Columns return Column_Count
-   is
-      Result : C_Int;
-      pragma Import (C, Result, "COLS");
-   begin
-      return Column_Count (Result);
-   end Columns;
-
-   function Tab_Size return Natural
-   is
-      Result : C_Int;
-      pragma Import (C, Result, "TABSIZE");
-   begin
-      return Natural (Result);
-   end Tab_Size;
-
-   function Number_Of_Colors return Natural
-   is
-      Result : C_Int;
-      pragma Import (C, Result, "COLORS");
-   begin
-      return Natural (Result);
-   end Number_Of_Colors;
-
-   function Number_Of_Color_Pairs return Natural
-   is
-      Result : C_Int;
-      pragma Import (C, Result, "COLOR_PAIRS");
-   begin
-      return Natural (Result);
-   end Number_Of_Color_Pairs;
-
-------------------------------------------------------------------------------
-   procedure Transform_Coordinates
-     (W      : Window := Standard_Window;
-      Line   : in out Line_Position;
-      Column : in out Column_Position;
-      Dir    : Transform_Direction := From_Screen)
-   is
-      type Int_Access is access all C_Int;
-      function Transform (W    : Window;
-                          Y, X : Int_Access;
-                          Dir  : Curses_Bool) return C_Int;
-      pragma Import (C, Transform, "wmouse_trafo");
-
-      X : aliased C_Int := C_Int (Column);
-      Y : aliased C_Int := C_Int (Line);
-      D : Curses_Bool := Curses_Bool_False;
-      R : C_Int;
-   begin
-      if Dir = To_Screen then
-         D := 1;
-      end if;
-      R := Transform (W, Y'Access, X'Access, D);
-      if R = Curses_False then
-         raise Curses_Exception;
-      else
-         Line   := Line_Position (Y);
-         Column := Column_Position (X);
-      end if;
-   end Transform_Coordinates;
-------------------------------------------------------------------------------
-   procedure Use_Default_Colors is
-      function C_Use_Default_Colors return C_Int;
-      pragma Import (C, C_Use_Default_Colors, "use_default_colors");
-      Err : constant C_Int := C_Use_Default_Colors;
-   begin
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Use_Default_Colors;
-
-   procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
-                                    Back : Color_Number := Default_Color)
-   is
-      function C_Assume_Default_Colors (Fore : C_Int;
-                                        Back : C_Int) return C_Int;
-      pragma Import (C, C_Assume_Default_Colors, "assume_default_colors");
-
-      Err : constant C_Int := C_Assume_Default_Colors (C_Int (Fore),
-                                                       C_Int (Back));
-   begin
-      if Err = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Assume_Default_Colors;
-------------------------------------------------------------------------------
-   function Curses_Version return String
-   is
-      function curses_versionC return chars_ptr;
-      pragma Import (C, curses_versionC, "curses_version");
-      Result : constant chars_ptr := curses_versionC;
-   begin
-      return Fill_String (Result);
-   end Curses_Version;
-------------------------------------------------------------------------------
-   procedure Curses_Free_All is
-      procedure curses_freeall;
-      pragma Import (C, curses_freeall, "_nc_freeall");
-   begin
-      --  Use this only for testing: you cannot use curses after calling it,
-      --  so it has to be the "last" thing done before exiting the program.
-      --  This will not really free ALL of memory used by curses.  That is
-      --  because it cannot free the memory used for stdout's setbuf.  The
-      --  _nc_free_and_exit() procedure can do that, but it can be invoked
-      --  safely only from C - and again, that only as the "last" thing done
-      --  before exiting the program.
-      curses_freeall;
-   end Curses_Free_All;
-------------------------------------------------------------------------------
-   function Use_Extended_Names (Enable : Boolean) return Boolean
-   is
-      function use_extended_namesC (e : Curses_Bool) return C_Int;
-      pragma Import (C, use_extended_namesC, "use_extended_names");
-
-      Res : constant C_Int :=
-         use_extended_namesC (Curses_Bool (Boolean'Pos (Enable)));
-   begin
-      if Res = C_Int (Curses_Bool_False) then
-         return False;
-      else
-         return True;
-      end if;
-   end Use_Extended_Names;
-------------------------------------------------------------------------------
-   procedure Screen_Dump_To_File (Filename : String)
-   is
-      function scr_dump (f : char_array) return C_Int;
-      pragma Import (C, scr_dump, "scr_dump");
-      Txt    : char_array (0 .. Filename'Length);
-      Length : size_t;
-   begin
-      To_C (Filename, Txt, Length);
-      if Curses_Err = scr_dump (Txt) then
-         raise Curses_Exception;
-      end if;
-   end Screen_Dump_To_File;
-
-   procedure Screen_Restore_From_File (Filename : String)
-   is
-      function scr_restore (f : char_array) return C_Int;
-      pragma Import (C, scr_restore, "scr_restore");
-      Txt    : char_array (0 .. Filename'Length);
-      Length : size_t;
-   begin
-      To_C (Filename, Txt, Length);
-      if Curses_Err = scr_restore (Txt)  then
-         raise Curses_Exception;
-      end if;
-   end Screen_Restore_From_File;
-
-   procedure Screen_Init_From_File (Filename : String)
-   is
-      function scr_init (f : char_array) return C_Int;
-      pragma Import (C, scr_init, "scr_init");
-      Txt    : char_array (0 .. Filename'Length);
-      Length : size_t;
-   begin
-      To_C (Filename, Txt, Length);
-      if Curses_Err = scr_init (Txt) then
-         raise Curses_Exception;
-      end if;
-   end Screen_Init_From_File;
-
-   procedure Screen_Set_File (Filename : String)
-   is
-      function scr_set (f : char_array) return C_Int;
-      pragma Import (C, scr_set, "scr_set");
-      Txt    : char_array (0 .. Filename'Length);
-      Length : size_t;
-   begin
-      To_C (Filename, Txt, Length);
-      if Curses_Err = scr_set (Txt) then
-         raise Curses_Exception;
-      end if;
-   end Screen_Set_File;
-------------------------------------------------------------------------------
-   procedure Resize (Win               : Window := Standard_Window;
-                     Number_Of_Lines   : Line_Count;
-                     Number_Of_Columns : Column_Count) is
-      function wresize (win     : Window;
-                        lines   : C_Int;
-                        columns : C_Int) return C_Int;
-      pragma Import (C, wresize);
-   begin
-      if wresize (Win,
-                  C_Int (Number_Of_Lines),
-                  C_Int (Number_Of_Columns)) = Curses_Err then
-         raise Curses_Exception;
-      end if;
-   end Resize;
-------------------------------------------------------------------------------
-
-end Terminal_Interface.Curses;
-
diff --git a/doc/html/ada/terminal_interface-curses__ads.htm b/doc/html/ada/terminal_interface-curses__ads.htm deleted file mode 100644 index 8139eb89d98..00000000000 --- a/doc/html/ada/terminal_interface-curses__ads.htm +++ /dev/null @@ -1,1935 +0,0 @@ - -terminal_interface-curses.ads - -

File : terminal_interface-curses.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                         Terminal_Interface.Curses                        --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free 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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.44 @
---  @Date: 2011/03/19 23:05:56 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
---  curses binding.
---  This module is generated. Please don't change it manually!
---  Run the generator instead.
---  |
-with System.Storage_Elements;
-with Interfaces.C;   --  We need this for some assertions.
-
-package Terminal_Interface.Curses is
-   pragma Preelaborate (Terminal_Interface.Curses);
-   pragma Linker_Options ("-lncurses");
-
-   NC_Major_Version : constant := 5; --  Major version of the library
-   NC_Minor_Version : constant := 9; --  Minor version of the library
-   NC_Version : constant String := "5.9";  --  Version of library
-
-   type Window is private;
-   Null_Window : constant Window;
-
-   type Line_Position   is new Integer; --  line coordinate
-   type Column_Position is new Integer; --  column coordinate
-
-   subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
-   --  Type to count lines. We do not allow null windows, so must be positive
-   subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
-   --  Type to count columns. We do not allow null windows, so must be positive
-
-   type Key_Code is new Integer;
-   --  That is anything including real characters, special keys and logical
-   --  request codes.
-
-   --  FIXME: The "-1" should be Curses_Err
-   subtype Real_Key_Code is Key_Code range -1 .. 8#777#;
-   --  This are the codes that potentially represent a real keystroke.
-   --  Not all codes may be possible on a specific terminal. To check the
-   --  availability of a special key, the Has_Key function is provided.
-
-   subtype Special_Key_Code is Real_Key_Code
-     range 8#400# .. Real_Key_Code'Last;
-   --  Type for a function- or special key number
-
-   subtype Normal_Key_Code is Real_Key_Code range
-     Character'Pos (Character'First) .. Character'Pos (Character'Last);
-   --  This are the codes for regular (incl. non-graphical) characters.
-
-   --  Constants for function- and special keys
-   --
-   Key_None                       : constant Special_Key_Code := 8#400#;
-   Key_Code_Yes                   : constant Special_Key_Code := 8#400#;
-   Key_Min                        : constant Special_Key_Code := 8#401#;
-   Key_Break                      : constant Special_Key_Code := 8#401#;
-   Key_Cursor_Down                : constant Special_Key_Code := 8#402#;
-   Key_Cursor_Up                  : constant Special_Key_Code := 8#403#;
-   Key_Cursor_Left                : constant Special_Key_Code := 8#404#;
-   Key_Cursor_Right               : constant Special_Key_Code := 8#405#;
-   Key_Home                       : constant Special_Key_Code := 8#406#;
-   Key_Backspace                  : constant Special_Key_Code := 8#407#;
-   Key_F0                         : constant Special_Key_Code := 8#410#;
-   Key_F1                         : constant Special_Key_Code := 8#411#;
-   Key_F2                         : constant Special_Key_Code := 8#412#;
-   Key_F3                         : constant Special_Key_Code := 8#413#;
-   Key_F4                         : constant Special_Key_Code := 8#414#;
-   Key_F5                         : constant Special_Key_Code := 8#415#;
-   Key_F6                         : constant Special_Key_Code := 8#416#;
-   Key_F7                         : constant Special_Key_Code := 8#417#;
-   Key_F8                         : constant Special_Key_Code := 8#420#;
-   Key_F9                         : constant Special_Key_Code := 8#421#;
-   Key_F10                        : constant Special_Key_Code := 8#422#;
-   Key_F11                        : constant Special_Key_Code := 8#423#;
-   Key_F12                        : constant Special_Key_Code := 8#424#;
-   Key_F13                        : constant Special_Key_Code := 8#425#;
-   Key_F14                        : constant Special_Key_Code := 8#426#;
-   Key_F15                        : constant Special_Key_Code := 8#427#;
-   Key_F16                        : constant Special_Key_Code := 8#430#;
-   Key_F17                        : constant Special_Key_Code := 8#431#;
-   Key_F18                        : constant Special_Key_Code := 8#432#;
-   Key_F19                        : constant Special_Key_Code := 8#433#;
-   Key_F20                        : constant Special_Key_Code := 8#434#;
-   Key_F21                        : constant Special_Key_Code := 8#435#;
-   Key_F22                        : constant Special_Key_Code := 8#436#;
-   Key_F23                        : constant Special_Key_Code := 8#437#;
-   Key_F24                        : constant Special_Key_Code := 8#440#;
-   Key_Delete_Line                : constant Special_Key_Code := 8#510#;
-   Key_Insert_Line                : constant Special_Key_Code := 8#511#;
-   Key_Delete_Char                : constant Special_Key_Code := 8#512#;
-   Key_Insert_Char                : constant Special_Key_Code := 8#513#;
-   Key_Exit_Insert_Mode           : constant Special_Key_Code := 8#514#;
-   Key_Clear_Screen               : constant Special_Key_Code := 8#515#;
-   Key_Clear_End_Of_Screen        : constant Special_Key_Code := 8#516#;
-   Key_Clear_End_Of_Line          : constant Special_Key_Code := 8#517#;
-   Key_Scroll_1_Forward           : constant Special_Key_Code := 8#520#;
-   Key_Scroll_1_Backward          : constant Special_Key_Code := 8#521#;
-   Key_Next_Page                  : constant Special_Key_Code := 8#522#;
-   Key_Previous_Page              : constant Special_Key_Code := 8#523#;
-   Key_Set_Tab                    : constant Special_Key_Code := 8#524#;
-   Key_Clear_Tab                  : constant Special_Key_Code := 8#525#;
-   Key_Clear_All_Tabs             : constant Special_Key_Code := 8#526#;
-   Key_Enter_Or_Send              : constant Special_Key_Code := 8#527#;
-   Key_Soft_Reset                 : constant Special_Key_Code := 8#530#;
-   Key_Reset                      : constant Special_Key_Code := 8#531#;
-   Key_Print                      : constant Special_Key_Code := 8#532#;
-   Key_Bottom                     : constant Special_Key_Code := 8#533#;
-   Key_Upper_Left_Of_Keypad       : constant Special_Key_Code := 8#534#;
-   Key_Upper_Right_Of_Keypad      : constant Special_Key_Code := 8#535#;
-   Key_Center_Of_Keypad           : constant Special_Key_Code := 8#536#;
-   Key_Lower_Left_Of_Keypad       : constant Special_Key_Code := 8#537#;
-   Key_Lower_Right_Of_Keypad      : constant Special_Key_Code := 8#540#;
-   Key_Back_Tab                   : constant Special_Key_Code := 8#541#;
-   Key_Beginning                  : constant Special_Key_Code := 8#542#;
-   Key_Cancel                     : constant Special_Key_Code := 8#543#;
-   Key_Close                      : constant Special_Key_Code := 8#544#;
-   Key_Command                    : constant Special_Key_Code := 8#545#;
-   Key_Copy                       : constant Special_Key_Code := 8#546#;
-   Key_Create                     : constant Special_Key_Code := 8#547#;
-   Key_End                        : constant Special_Key_Code := 8#550#;
-   Key_Exit                       : constant Special_Key_Code := 8#551#;
-   Key_Find                       : constant Special_Key_Code := 8#552#;
-   Key_Help                       : constant Special_Key_Code := 8#553#;
-   Key_Mark                       : constant Special_Key_Code := 8#554#;
-   Key_Message                    : constant Special_Key_Code := 8#555#;
-   Key_Move                       : constant Special_Key_Code := 8#556#;
-   Key_Next                       : constant Special_Key_Code := 8#557#;
-   Key_Open                       : constant Special_Key_Code := 8#560#;
-   Key_Options                    : constant Special_Key_Code := 8#561#;
-   Key_Previous                   : constant Special_Key_Code := 8#562#;
-   Key_Redo                       : constant Special_Key_Code := 8#563#;
-   Key_Reference                  : constant Special_Key_Code := 8#564#;
-   Key_Refresh                    : constant Special_Key_Code := 8#565#;
-   Key_Replace                    : constant Special_Key_Code := 8#566#;
-   Key_Restart                    : constant Special_Key_Code := 8#567#;
-   Key_Resume                     : constant Special_Key_Code := 8#570#;
-   Key_Save                       : constant Special_Key_Code := 8#571#;
-   Key_Shift_Begin                : constant Special_Key_Code := 8#572#;
-   Key_Shift_Cancel               : constant Special_Key_Code := 8#573#;
-   Key_Shift_Command              : constant Special_Key_Code := 8#574#;
-   Key_Shift_Copy                 : constant Special_Key_Code := 8#575#;
-   Key_Shift_Create               : constant Special_Key_Code := 8#576#;
-   Key_Shift_Delete_Char          : constant Special_Key_Code := 8#577#;
-   Key_Shift_Delete_Line          : constant Special_Key_Code := 8#600#;
-   Key_Select                     : constant Special_Key_Code := 8#601#;
-   Key_Shift_End                  : constant Special_Key_Code := 8#602#;
-   Key_Shift_Clear_End_Of_Line    : constant Special_Key_Code := 8#603#;
-   Key_Shift_Exit                 : constant Special_Key_Code := 8#604#;
-   Key_Shift_Find                 : constant Special_Key_Code := 8#605#;
-   Key_Shift_Help                 : constant Special_Key_Code := 8#606#;
-   Key_Shift_Home                 : constant Special_Key_Code := 8#607#;
-   Key_Shift_Insert_Char          : constant Special_Key_Code := 8#610#;
-   Key_Shift_Cursor_Left          : constant Special_Key_Code := 8#611#;
-   Key_Shift_Message              : constant Special_Key_Code := 8#612#;
-   Key_Shift_Move                 : constant Special_Key_Code := 8#613#;
-   Key_Shift_Next_Page            : constant Special_Key_Code := 8#614#;
-   Key_Shift_Options              : constant Special_Key_Code := 8#615#;
-   Key_Shift_Previous_Page        : constant Special_Key_Code := 8#616#;
-   Key_Shift_Print                : constant Special_Key_Code := 8#617#;
-   Key_Shift_Redo                 : constant Special_Key_Code := 8#620#;
-   Key_Shift_Replace              : constant Special_Key_Code := 8#621#;
-   Key_Shift_Cursor_Right         : constant Special_Key_Code := 8#622#;
-   Key_Shift_Resume               : constant Special_Key_Code := 8#623#;
-   Key_Shift_Save                 : constant Special_Key_Code := 8#624#;
-   Key_Shift_Suspend              : constant Special_Key_Code := 8#625#;
-   Key_Shift_Undo                 : constant Special_Key_Code := 8#626#;
-   Key_Suspend                    : constant Special_Key_Code := 8#627#;
-   Key_Undo                       : constant Special_Key_Code := 8#630#;
-   Key_Mouse                      : constant Special_Key_Code := 8#631#;
-   Key_Resize                     : constant Special_Key_Code := 8#632#;
-
-   Key_Max                        : constant Special_Key_Code
-     := Special_Key_Code'Last;
-
-   subtype User_Key_Code is Key_Code
-     range (Key_Max + 129) .. Key_Code'Last;
-   --  This is reserved for user defined key codes. The range between Key_Max
-   --  and the first user code is reserved for subsystems like menu and forms.
-
-   --  For those who like to use the original key names we produce them were
-   --  they differ from the original. Please note that they may differ in
-   --  lower/upper case.
-   KEY_DOWN         : Special_Key_Code renames Key_Cursor_Down;
-   KEY_UP           : Special_Key_Code renames Key_Cursor_Up;
-   KEY_LEFT         : Special_Key_Code renames Key_Cursor_Left;
-   KEY_RIGHT        : Special_Key_Code renames Key_Cursor_Right;
-   KEY_DL           : Special_Key_Code renames Key_Delete_Line;
-   KEY_IL           : Special_Key_Code renames Key_Insert_Line;
-   KEY_DC           : Special_Key_Code renames Key_Delete_Char;
-   KEY_IC           : Special_Key_Code renames Key_Insert_Char;
-   KEY_EIC          : Special_Key_Code renames Key_Exit_Insert_Mode;
-   KEY_CLEAR        : Special_Key_Code renames Key_Clear_Screen;
-   KEY_EOS          : Special_Key_Code renames Key_Clear_End_Of_Screen;
-   KEY_EOL          : Special_Key_Code renames Key_Clear_End_Of_Line;
-   KEY_SF           : Special_Key_Code renames Key_Scroll_1_Forward;
-   KEY_SR           : Special_Key_Code renames Key_Scroll_1_Backward;
-   KEY_NPAGE        : Special_Key_Code renames Key_Next_Page;
-   KEY_PPAGE        : Special_Key_Code renames Key_Previous_Page;
-   KEY_STAB         : Special_Key_Code renames Key_Set_Tab;
-   KEY_CTAB         : Special_Key_Code renames Key_Clear_Tab;
-   KEY_CATAB        : Special_Key_Code renames Key_Clear_All_Tabs;
-   KEY_ENTER        : Special_Key_Code renames Key_Enter_Or_Send;
-   KEY_SRESET       : Special_Key_Code renames Key_Soft_Reset;
-   KEY_LL           : Special_Key_Code renames Key_Bottom;
-   KEY_A1           : Special_Key_Code renames Key_Upper_Left_Of_Keypad;
-   KEY_A3           : Special_Key_Code renames Key_Upper_Right_Of_Keypad;
-   KEY_B2           : Special_Key_Code renames Key_Center_Of_Keypad;
-   KEY_C1           : Special_Key_Code renames Key_Lower_Left_Of_Keypad;
-   KEY_C3           : Special_Key_Code renames Key_Lower_Right_Of_Keypad;
-   KEY_BTAB         : Special_Key_Code renames Key_Back_Tab;
-   KEY_BEG          : Special_Key_Code renames Key_Beginning;
-   KEY_SBEG         : Special_Key_Code renames Key_Shift_Begin;
-   KEY_SCANCEL      : Special_Key_Code renames Key_Shift_Cancel;
-   KEY_SCOMMAND     : Special_Key_Code renames Key_Shift_Command;
-   KEY_SCOPY        : Special_Key_Code renames Key_Shift_Copy;
-   KEY_SCREATE      : Special_Key_Code renames Key_Shift_Create;
-   KEY_SDC          : Special_Key_Code renames Key_Shift_Delete_Char;
-   KEY_SDL          : Special_Key_Code renames Key_Shift_Delete_Line;
-   KEY_SEND         : Special_Key_Code renames Key_Shift_End;
-   KEY_SEOL         : Special_Key_Code renames Key_Shift_Clear_End_Of_Line;
-   KEY_SEXIT        : Special_Key_Code renames Key_Shift_Exit;
-   KEY_SFIND        : Special_Key_Code renames Key_Shift_Find;
-   KEY_SHELP        : Special_Key_Code renames Key_Shift_Help;
-   KEY_SHOME        : Special_Key_Code renames Key_Shift_Home;
-   KEY_SIC          : Special_Key_Code renames Key_Shift_Insert_Char;
-   KEY_SLEFT        : Special_Key_Code renames Key_Shift_Cursor_Left;
-   KEY_SMESSAGE     : Special_Key_Code renames Key_Shift_Message;
-   KEY_SMOVE        : Special_Key_Code renames Key_Shift_Move;
-   KEY_SNEXT        : Special_Key_Code renames Key_Shift_Next_Page;
-   KEY_SOPTIONS     : Special_Key_Code renames Key_Shift_Options;
-   KEY_SPREVIOUS    : Special_Key_Code renames Key_Shift_Previous_Page;
-   KEY_SPRINT       : Special_Key_Code renames Key_Shift_Print;
-   KEY_SREDO        : Special_Key_Code renames Key_Shift_Redo;
-   KEY_SREPLACE     : Special_Key_Code renames Key_Shift_Replace;
-   KEY_SRIGHT       : Special_Key_Code renames Key_Shift_Cursor_Right;
-   KEY_SRSUME       : Special_Key_Code renames Key_Shift_Resume;
-   KEY_SSAVE        : Special_Key_Code renames Key_Shift_Save;
-   KEY_SSUSPEND     : Special_Key_Code renames Key_Shift_Suspend;
-   KEY_SUNDO        : Special_Key_Code renames Key_Shift_Undo;
-
-------------------------------------------------------------------------------
-
-   type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
-   for Color_Number'Size use Interfaces.C.short'Size;
-   --  (n)curses uses a short for the color index
-   --  The model is, that a Color_Number is an index into an array of
-   --  (potentially) definable colors. Some of those indices are
-   --  predefined (see below), although they may not really exist.
-
-   Default_Color    : constant Color_Number := -1;
-   Black            : constant Color_Number := 0;
-   Red              : constant Color_Number := 1;
-   Green            : constant Color_Number := 2;
-   Yellow           : constant Color_Number := 3;
-   Blue             : constant Color_Number := 4;
-   Magenta          : constant Color_Number := 5;
-   Cyan             : constant Color_Number := 6;
-   White            : constant Color_Number := 7;
-
-   type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
-   for RGB_Value'Size use Interfaces.C.short'Size;
-   --  Some system may allow to redefine a color by setting RGB values.
-
-   type Color_Pair is range 0 .. 255;
-   for Color_Pair'Size use 8;
-   subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
-   --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
-   --  is fixed (Black & White). A color pair is simply a combination of
-   --  two colors described by Color_Numbers, one for the foreground and
-   --  the other for the background
-
-   type Character_Attribute_Set is
-      record
-         Stand_Out               : Boolean;
-         Under_Line              : Boolean;
-         Reverse_Video           : Boolean;
-         Blink                   : Boolean;
-         Dim_Character           : Boolean;
-         Bold_Character          : Boolean;
-         Alternate_Character_Set : Boolean;
-         Invisible_Character     : Boolean;
-         Protected_Character     : Boolean;
-         Horizontal              : Boolean;
-         Left                    : Boolean;
-         Low                     : Boolean;
-         Right                   : Boolean;
-         Top                     : Boolean;
-         Vertical                : Boolean;
-         Unused                  : Boolean;
-      end record;
-   pragma Convention (C, Character_Attribute_Set);
-
-   for Character_Attribute_Set use
-      record
-         Stand_Out               at 0 range  0 ..  0;
-         Under_Line              at 0 range  1 ..  1;
-         Reverse_Video           at 0 range  2 ..  2;
-         Blink                   at 0 range  3 ..  3;
-         Dim_Character           at 0 range  4 ..  4;
-         Bold_Character          at 0 range  5 ..  5;
-         Alternate_Character_Set at 0 range  6 ..  6;
-         Invisible_Character     at 0 range  7 ..  7;
-         Protected_Character     at 0 range  8 ..  8;
-         Horizontal              at 0 range  9 ..  9;
-         Left                    at 0 range 10 .. 10;
-         Low                     at 0 range 11 .. 11;
-         Right                   at 0 range 12 .. 12;
-         Top                     at 0 range 13 .. 13;
-         Vertical                at 0 range 14 .. 14;
-         Unused                  at 0 range 15 .. 15;
-      end record;
-   for Character_Attribute_Set'Size use 16;
-   --  Please note: this rep. clause is generated and may be
-   --               different on your system.
-   --  (n)curses uses all but the lowest 16 Bits for Attributes.
-
-   Normal_Video : constant Character_Attribute_Set := (others => False);
-
-   type Attributed_Character is
-      record
-         Attr  : Character_Attribute_Set;
-         Color : Color_Pair;
-         Ch    : Character;
-      end record;
-   pragma Convention (C, Attributed_Character);
-   --  This is the counterpart for the chtype in C.
-
-   for Attributed_Character use
-      record
-         Ch    at 0 range  0 ..  7;
-         Color at 0 range  8 .. 15;
-         Attr  at 0 range 16 .. 31;
-      end record;
-   for Attributed_Character'Size use 32;
-      --  Please note: this rep. clause is generated and may be
-      --               different on your system.
-
-   Default_Character : constant Attributed_Character
-     := (Ch    => Character'First,
-         Color => Color_Pair'First,
-         Attr  => (others => False));  --  preelaboratable Normal_Video
-
-   type Attributed_String is array (Positive range <>) of Attributed_Character;
-   pragma Pack (Attributed_String);
-   --  In this binding we allow strings of attributed characters.
-
-   ------------------
-   --  Exceptions  --
-   ------------------
-   Curses_Exception     : exception;
-   Wrong_Curses_Version : exception;
-
-   --  Those exceptions are raised by the ETI (Extended Terminal Interface)
-   --  subpackets for Menu and Forms handling.
-   --
-   Eti_System_Error    : exception;
-   Eti_Bad_Argument    : exception;
-   Eti_Posted          : exception;
-   Eti_Connected       : exception;
-   Eti_Bad_State       : exception;
-   Eti_No_Room         : exception;
-   Eti_Not_Posted      : exception;
-   Eti_Unknown_Command : exception;
-   Eti_No_Match        : exception;
-   Eti_Not_Selectable  : exception;
-   Eti_Not_Connected   : exception;
-   Eti_Request_Denied  : exception;
-   Eti_Invalid_Field   : exception;
-   Eti_Current         : exception;
-
-   --------------------------------------------------------------------------
-   --  External C variables
-   --  Conceptually even in C this are kind of constants, but they are
-   --  initialized and sometimes changed by the library routines at runtime
-   --  depending on the type of terminal. I believe the best way to model
-   --  this is to use functions.
-   --------------------------------------------------------------------------
-
-   function Lines            return Line_Count;
-   pragma Inline (Lines);
-
-   function Columns          return Column_Count;
-   pragma Inline (Columns);
-
-   function Tab_Size         return Natural;
-   pragma Inline (Tab_Size);
-
-   function Number_Of_Colors return Natural;
-   pragma Inline (Number_Of_Colors);
-
-   function Number_Of_Color_Pairs return Natural;
-   pragma Inline (Number_Of_Color_Pairs);
-
-   type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))
-        of Attributed_Character;
-   ACS_Map : C_ACS_Map;
-   pragma Import (C, ACS_Map, "acs_map");
-   --
-   --
-   --  Constants for several characters from the Alternate Character Set
-   --  You must use these constants as indices into the ACS_Map array
-   --  to get the corresponding attributed character at runtime.
-   --
-   ACS_Upper_Left_Corner    : constant Character := 'l';
-   ACS_Lower_Left_Corner    : constant Character := 'm';
-   ACS_Upper_Right_Corner   : constant Character := 'k';
-   ACS_Lower_Right_Corner   : constant Character := 'j';
-   ACS_Left_Tee             : constant Character := 't';
-   ACS_Right_Tee            : constant Character := 'u';
-   ACS_Bottom_Tee           : constant Character := 'v';
-   ACS_Top_Tee              : constant Character := 'w';
-   ACS_Horizontal_Line      : constant Character := 'q';
-   ACS_Vertical_Line        : constant Character := 'x';
-   ACS_Plus_Symbol          : constant Character := 'n';
-   ACS_Scan_Line_1          : constant Character := 'o';
-   ACS_Scan_Line_9          : constant Character := 's';
-   ACS_Diamond              : constant Character := Character'Val (96);
-   ACS_Checker_Board        : constant Character := 'a';
-   ACS_Degree               : constant Character := 'f';
-   ACS_Plus_Minus           : constant Character := 'g';
-   ACS_Bullet               : constant Character := '~';
-   ACS_Left_Arrow           : constant Character := ',';
-   ACS_Right_Arrow          : constant Character := '+';
-   ACS_Down_Arrow           : constant Character := '.';
-   ACS_Up_Arrow             : constant Character := '-';
-   ACS_Board_Of_Squares     : constant Character := 'h';
-   ACS_Lantern              : constant Character := 'i';
-   ACS_Solid_Block          : constant Character := '0';
-   ACS_Scan_Line_3          : constant Character := 'p';
-   ACS_Scan_Line_7          : constant Character := 'r';
-   ACS_Less_Or_Equal        : constant Character := 'y';
-   ACS_Greater_Or_Equal     : constant Character := 'z';
-   ACS_PI                   : constant Character := '{';
-   ACS_Not_Equal            : constant Character := '|';
-   ACS_Sterling             : constant Character := '}';
-
-   --  |=====================================================================
-   --  | Man page curs_initscr.3x
-   --  |=====================================================================
-   --  | Not implemented: newterm, set_term, delscreen
-
-   --  #1A NAME="AFU_1"#2|
-   function Standard_Window return Window;
-   --  AKA: stdscr
-   pragma Inline (Standard_Window);
-
-   --  #1A NAME="AFU_2"#2|
-   function Current_Window return Window;
-   --  AKA: curscr
-   pragma Inline (Current_Window);
-
-   --  #1A NAME="AFU_3"#2|
-   procedure Init_Screen;
-
-   --  #1A NAME="AFU_4"#2|
-   procedure Init_Windows renames Init_Screen;
-   --  AKA: initscr()
-   pragma Inline (Init_Screen);
-   --  pragma Inline (Init_Windows);
-
-   --  #1A NAME="AFU_5"#2|
-   procedure End_Windows;
-   --  AKA: endwin()
-   procedure End_Screen renames End_Windows;
-   pragma Inline (End_Windows);
-   --  pragma Inline (End_Screen);
-
-   --  #1A NAME="AFU_6"#2|
-   function Is_End_Window return Boolean;
-   --  AKA: isendwin()
-   pragma Inline (Is_End_Window);
-
-   --  |=====================================================================
-   --  | Man page curs_move.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_7"#2|
-   procedure Move_Cursor (Win    : Window := Standard_Window;
-                          Line   : Line_Position;
-                          Column : Column_Position);
-   --  AKA: wmove()
-   --  AKA: move()
-   pragma Inline (Move_Cursor);
-
-   --  |=====================================================================
-   --  | Man page curs_addch.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_8"#2|
-   procedure Add (Win : Window := Standard_Window;
-                  Ch  : Attributed_Character);
-   --  AKA: waddch()
-   --  AKA: addch()
-
-   procedure Add (Win : Window := Standard_Window;
-                  Ch  : Character);
-   --  Add a single character at the current logical cursor position to
-   --  the window. Use the current windows attributes.
-
-   --  #1A NAME="AFU_9"#2|
-   procedure Add
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Ch     : Attributed_Character);
-   --  AKA: mvwaddch()
-   --  AKA: mvaddch()
-
-   procedure Add
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position;
-      Ch     : Character);
-   --  Move to the position and add a single character into the window
-   --  There are more Add routines, so the Inline pragma follows later
-
-   --  #1A NAME="AFU_10"#2|
-   procedure Add_With_Immediate_Echo
-     (Win : Window := Standard_Window;
-      Ch  : Attributed_Character);
-   --  AKA: wechochar()
-   --  AKA: echochar()
-
-   procedure Add_With_Immediate_Echo
-     (Win : Window := Standard_Window;
-      Ch  : Character);
-   --  Add a character and do an immediate refresh of the screen.
-   pragma Inline (Add_With_Immediate_Echo);
-
-   --  |=====================================================================
-   --  | Man page curs_window.3x
-   --  |=====================================================================
-   --  Not Implemented: wcursyncup
-
-   --  #1A NAME="AFU_11"#2|
-   function Create
-     (Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window;
-   --  Not Implemented: Default Number_Of_Lines, Number_Of_Columns
-   --  the C version lets them be 0, see the man page.
-   --  AKA: newwin()
-   pragma Inline (Create);
-
-   function New_Window
-     (Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window
-     renames Create;
-   --  pragma Inline (New_Window);
-
-   --  #1A NAME="AFU_12"#2|
-   procedure Delete (Win : in out Window);
-   --  AKA: delwin()
-   --  Reset Win to Null_Window
-   pragma Inline (Delete);
-
-   --  #1A NAME="AFU_13"#2|
-   function Sub_Window
-     (Win                   : Window := Standard_Window;
-      Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window;
-   --  AKA: subwin()
-   pragma Inline (Sub_Window);
-
-   --  #1A NAME="AFU_14"#2|
-   function Derived_Window
-     (Win                   : Window := Standard_Window;
-      Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window;
-   --  AKA: derwin()
-   pragma Inline (Derived_Window);
-
-   --  #1A NAME="AFU_15"#2|
-   function Duplicate (Win : Window) return Window;
-   --  AKA: dupwin()
-   pragma Inline (Duplicate);
-
-   --  #1A NAME="AFU_16"#2|
-   procedure Move_Window (Win    : Window;
-                          Line   : Line_Position;
-                          Column : Column_Position);
-   --  AKA: mvwin()
-   pragma Inline (Move_Window);
-
-   --  #1A NAME="AFU_17"#2|
-   procedure Move_Derived_Window (Win    : Window;
-                                  Line   : Line_Position;
-                                  Column : Column_Position);
-   --  AKA: mvderwin()
-   pragma Inline (Move_Derived_Window);
-
-   --  #1A NAME="AFU_18"#2|
-   procedure Synchronize_Upwards (Win : Window);
-   --  AKA: wsyncup()
-   pragma Import (C, Synchronize_Upwards, "wsyncup");
-
-   --  #1A NAME="AFU_19"#2|
-   procedure Synchronize_Downwards (Win : Window);
-   --  AKA: wsyncdown()
-   pragma Import (C, Synchronize_Downwards, "wsyncdown");
-
-   --  #1A NAME="AFU_20"#2|
-   procedure Set_Synch_Mode (Win  : Window := Standard_Window;
-                             Mode : Boolean := False);
-   --  AKA: syncok()
-   pragma Inline (Set_Synch_Mode);
-
-   --  |=====================================================================
-   --  | Man page curs_addstr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_21"#2|
-   procedure Add (Win : Window := Standard_Window;
-                  Str : String;
-                  Len : Integer := -1);
-   --  AKA: waddnstr()
-   --  AKA: waddstr()
-   --  AKA: addnstr()
-   --  AKA: addstr()
-
-   --  #1A NAME="AFU_22"#2|
-   procedure Add (Win    : Window := Standard_Window;
-                  Line   : Line_Position;
-                  Column : Column_Position;
-                  Str    : String;
-                  Len    : Integer := -1);
-   --  AKA: mvwaddnstr()
-   --  AKA: mvwaddstr()
-   --  AKA: mvaddnstr()
-   --  AKA: mvaddstr()
-
-   --  |=====================================================================
-   --  | Man page curs_addchstr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_23"#2|
-   procedure Add (Win : Window := Standard_Window;
-                  Str : Attributed_String;
-                  Len : Integer := -1);
-   --  AKA: waddchnstr()
-   --  AKA: waddchstr()
-   --  AKA: addchnstr()
-   --  AKA: addchstr()
-
-   --  #1A NAME="AFU_24"#2|
-   procedure Add (Win    : Window := Standard_Window;
-                  Line   : Line_Position;
-                  Column : Column_Position;
-                  Str    : Attributed_String;
-                  Len    : Integer := -1);
-   --  AKA: mvwaddchnstr()
-   --  AKA: mvwaddchstr()
-   --  AKA: mvaddchnstr()
-   --  AKA: mvaddchstr()
-   pragma Inline (Add);
-
-   --  |=====================================================================
-   --  | Man page curs_border.3x
-   --  |=====================================================================
-   --  | Not implemented: mvhline,  mvwhline, mvvline, mvwvline
-   --  | use Move_Cursor then Horizontal_Line or Vertical_Line
-
-   --  #1A NAME="AFU_25"#2|
-   procedure Border
-     (Win                       : Window := Standard_Window;
-      Left_Side_Symbol          : Attributed_Character := Default_Character;
-      Right_Side_Symbol         : Attributed_Character := Default_Character;
-      Top_Side_Symbol           : Attributed_Character := Default_Character;
-      Bottom_Side_Symbol        : Attributed_Character := Default_Character;
-      Upper_Left_Corner_Symbol  : Attributed_Character := Default_Character;
-      Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
-      Lower_Left_Corner_Symbol  : Attributed_Character := Default_Character;
-      Lower_Right_Corner_Symbol : Attributed_Character := Default_Character
-     );
-   --  AKA: wborder()
-   --  AKA: border()
-   pragma Inline (Border);
-
-   --  #1A NAME="AFU_26"#2|
-   procedure Box
-     (Win               : Window := Standard_Window;
-      Vertical_Symbol   : Attributed_Character := Default_Character;
-      Horizontal_Symbol : Attributed_Character := Default_Character);
-   --  AKA: box()
-   pragma Inline (Box);
-
-   --  #1A NAME="AFU_27"#2|
-   procedure Horizontal_Line
-     (Win         : Window := Standard_Window;
-      Line_Size   : Natural;
-      Line_Symbol : Attributed_Character := Default_Character);
-   --  AKA: whline()
-   --  AKA: hline()
-   pragma Inline (Horizontal_Line);
-
-   --  #1A NAME="AFU_28"#2|
-   procedure Vertical_Line
-     (Win         : Window := Standard_Window;
-      Line_Size   : Natural;
-      Line_Symbol : Attributed_Character := Default_Character);
-   --  AKA: wvline()
-   --  AKA: vline()
-   pragma Inline (Vertical_Line);
-
-   --  |=====================================================================
-   --  | Man page curs_getch.3x
-   --  |=====================================================================
-   --  Not implemented: mvgetch, mvwgetch
-
-   --  #1A NAME="AFU_29"#2|
-   function Get_Keystroke (Win : Window := Standard_Window)
-                           return Real_Key_Code;
-   --  AKA: wgetch()
-   --  AKA: getch()
-   --  Get a character from the keyboard and echo it - if enabled - to the
-   --  window.
-   --  If for any reason (i.e. a timeout) we could not get a character the
-   --  returned keycode is Key_None.
-   pragma Inline (Get_Keystroke);
-
-   --  #1A NAME="AFU_30"#2|
-   procedure Undo_Keystroke (Key : Real_Key_Code);
-   --  AKA: ungetch()
-   pragma Inline (Undo_Keystroke);
-
-   --  #1A NAME="AFU_31"#2|
-   function Has_Key (Key : Special_Key_Code) return Boolean;
-   --  AKA: has_key()
-   pragma Inline (Has_Key);
-
-   --  |
-   --  | Some helper functions
-   --  |
-   function Is_Function_Key (Key : Special_Key_Code) return Boolean;
-   --  Return True if the Key is a function key (i.e. one of F0 .. F63)
-   pragma Inline (Is_Function_Key);
-
-   subtype Function_Key_Number is Integer range 0 .. 63;
-   --  (n)curses allows for 64 function keys.
-
-   function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
-   --  Return the number of the function key. If the code is not a
-   --  function key, a CONSTRAINT_ERROR will be raised.
-   pragma Inline (Function_Key);
-
-   function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
-   --  Return the key code for a given function-key number.
-   pragma Inline (Function_Key_Code);
-
-   --  |=====================================================================
-   --  | Man page curs_attr.3x
-   --  |=====================================================================
-   --  | Not implemented attr_off,  wattr_off,
-   --  |  attr_on, wattr_on, attr_set, wattr_set
-
-   --  PAIR_NUMBER
-   --  PAIR_NUMBER(c) is the same as c.Color
-
-   --  #1A NAME="AFU_32"#2|
-   procedure Standout (Win : Window  := Standard_Window;
-                       On  : Boolean := True);
-   --  AKA: wstandout()
-   --  AKA: wstandend()
-
-   --  #1A NAME="AFU_33"#2|
-   procedure Switch_Character_Attribute
-     (Win  : Window := Standard_Window;
-      Attr : Character_Attribute_Set := Normal_Video;
-      On   : Boolean := True); --  if False we switch Off.
-   --  Switches those Attributes set to true in the list.
-   --  AKA: wattron()
-   --  AKA: wattroff()
-   --  AKA: attron()
-   --  AKA: attroff()
-
-   --  #1A NAME="AFU_34"#2|
-   procedure Set_Character_Attributes
-     (Win   : Window := Standard_Window;
-      Attr  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: wattrset()
-   --  AKA: attrset()
-   pragma Inline (Set_Character_Attributes);
-
-   --  #1A NAME="AFU_35"#2|
-   function Get_Character_Attribute
-     (Win : Window := Standard_Window) return Character_Attribute_Set;
-   --  AKA: wattr_get()
-   --  AKA: attr_get()
-
-   --  #1A NAME="AFU_36"#2|
-   function Get_Character_Attribute
-     (Win : Window := Standard_Window) return Color_Pair;
-   --  AKA: wattr_get()
-   pragma Inline (Get_Character_Attribute);
-
-   --  #1A NAME="AFU_37"#2|
-   procedure Set_Color (Win  : Window := Standard_Window;
-                        Pair : Color_Pair);
-   --  AKA: wcolor_set()
-   --  AKA: color_set()
-   pragma Inline (Set_Color);
-
-   --  #1A NAME="AFU_38"#2|
-   procedure Change_Attributes
-     (Win   : Window := Standard_Window;
-      Count : Integer := -1;
-      Attr  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: wchgat()
-   --  AKA: chgat()
-
-   --  #1A NAME="AFU_39"#2|
-   procedure Change_Attributes
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position := Line_Position'First;
-      Column : Column_Position := Column_Position'First;
-      Count  : Integer := -1;
-      Attr   : Character_Attribute_Set := Normal_Video;
-      Color  : Color_Pair := Color_Pair'First);
-   --  AKA: mvwchgat()
-   --  AKA: mvchgat()
-   pragma Inline (Change_Attributes);
-
-   --  |=====================================================================
-   --  | Man page curs_beep.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_40"#2|
-   procedure Beep;
-   --  AKA: beep()
-   pragma Inline (Beep);
-
-   --  #1A NAME="AFU_41"#2|
-   procedure Flash_Screen;
-   --  AKA: flash()
-   pragma Inline (Flash_Screen);
-
-   --  |=====================================================================
-   --  | Man page curs_inopts.3x
-   --  |=====================================================================
-
-   --  | Not implemented : typeahead
-   --
-   --  #1A NAME="AFU_42"#2|
-   procedure Set_Cbreak_Mode (SwitchOn : Boolean := True);
-   --  AKA: cbreak()
-   --  AKA: nocbreak()
-   pragma Inline (Set_Cbreak_Mode);
-
-   --  #1A NAME="AFU_43"#2|
-   procedure Set_Raw_Mode (SwitchOn : Boolean := True);
-   --  AKA: raw()
-   --  AKA: noraw()
-   pragma Inline (Set_Raw_Mode);
-
-   --  #1A NAME="AFU_44"#2|
-   procedure Set_Echo_Mode (SwitchOn : Boolean := True);
-   --  AKA: echo()
-   --  AKA: noecho()
-   pragma Inline (Set_Echo_Mode);
-
-   --  #1A NAME="AFU_45"#2|
-   procedure Set_Meta_Mode (Win      : Window := Standard_Window;
-                            SwitchOn : Boolean := True);
-   --  AKA: meta()
-   pragma Inline (Set_Meta_Mode);
-
-   --  #1A NAME="AFU_46"#2|
-   procedure Set_KeyPad_Mode (Win      : Window := Standard_Window;
-                              SwitchOn : Boolean := True);
-   --  AKA: keypad()
-   pragma Inline (Set_KeyPad_Mode);
-
-   function Get_KeyPad_Mode (Win : Window := Standard_Window)
-                             return Boolean;
-   --  This has no pendant in C. There you've to look into the WINDOWS
-   --  structure to get the value. Bad practice, not repeated in Ada.
-
-   type Half_Delay_Amount is range 1 .. 255;
-
-   --  #1A NAME="AFU_47"#2|
-   procedure Half_Delay (Amount : Half_Delay_Amount);
-   --  AKA: halfdelay()
-   pragma Inline (Half_Delay);
-
-   --  #1A NAME="AFU_48"#2|
-   procedure Set_Flush_On_Interrupt_Mode
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := True);
-   --  AKA: intrflush()
-   pragma Inline (Set_Flush_On_Interrupt_Mode);
-
-   --  #1A NAME="AFU_49"#2|
-   procedure Set_Queue_Interrupt_Mode
-     (Win   : Window := Standard_Window;
-      Flush : Boolean := True);
-   --  AKA: qiflush()
-   --  AKA: noqiflush()
-   pragma Inline (Set_Queue_Interrupt_Mode);
-
-   --  #1A NAME="AFU_50"#2|
-   procedure Set_NoDelay_Mode
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := False);
-   --  AKA: nodelay()
-   pragma Inline (Set_NoDelay_Mode);
-
-   type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
-
-   --  #1A NAME="AFU_51"#2|
-   procedure Set_Timeout_Mode (Win    : Window := Standard_Window;
-                               Mode   : Timeout_Mode;
-                               Amount : Natural); --  in Milliseconds
-   --  AKA: wtimeout()
-   --  AKA: timeout()
-   --  Instead of overloading the semantic of the sign of amount, we
-   --  introduce the Timeout_Mode parameter. This should improve
-   --  readability. For Blocking and Non_Blocking, the Amount is not
-   --  evaluated.
-   --  We do not inline this procedure.
-
-   --  #1A NAME="AFU_52"#2|
-   procedure Set_Escape_Timer_Mode
-     (Win       : Window := Standard_Window;
-      Timer_Off : Boolean := False);
-   --  AKA: notimeout()
-   pragma Inline (Set_Escape_Timer_Mode);
-
-   --  |=====================================================================
-   --  | Man page curs_outopts.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_53"#2|
-   procedure Set_NL_Mode (SwitchOn : Boolean := True);
-   --  AKA: nl()
-   --  AKA: nonl()
-   pragma Inline (Set_NL_Mode);
-
-   --  #1A NAME="AFU_54"#2|
-   procedure Clear_On_Next_Update
-     (Win      : Window := Standard_Window;
-      Do_Clear : Boolean := True);
-   --  AKA: clearok()
-   pragma Inline (Clear_On_Next_Update);
-
-   --  #1A NAME="AFU_55"#2|
-   procedure Use_Insert_Delete_Line
-     (Win    : Window := Standard_Window;
-      Do_Idl : Boolean := True);
-   --  AKA: idlok()
-   pragma Inline (Use_Insert_Delete_Line);
-
-   --  #1A NAME="AFU_56"#2|
-   procedure Use_Insert_Delete_Character
-     (Win    : Window := Standard_Window;
-      Do_Idc : Boolean := True);
-   --  AKA: idcok()
-   pragma Inline (Use_Insert_Delete_Character);
-
-   --  #1A NAME="AFU_57"#2|
-   procedure Leave_Cursor_After_Update
-     (Win      : Window := Standard_Window;
-      Do_Leave : Boolean := True);
-   --  AKA: leaveok()
-   pragma Inline (Leave_Cursor_After_Update);
-
-   --  #1A NAME="AFU_58"#2|
-   procedure Immediate_Update_Mode
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := False);
-   --  AKA: immedok()
-   pragma Inline (Immediate_Update_Mode);
-
-   --  #1A NAME="AFU_59"#2|
-   procedure Allow_Scrolling
-     (Win  : Window := Standard_Window;
-      Mode : Boolean := False);
-   --  AKA: scrollok()
-   pragma Inline (Allow_Scrolling);
-
-   function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
-   --  There is no such function in the C interface.
-   pragma Inline (Scrolling_Allowed);
-
-   --  #1A NAME="AFU_60"#2|
-   procedure Set_Scroll_Region
-     (Win         : Window := Standard_Window;
-      Top_Line    : Line_Position;
-      Bottom_Line : Line_Position);
-   --  AKA: wsetscrreg()
-   --  AKA: setscrreg()
-   pragma Inline (Set_Scroll_Region);
-
-   --  |=====================================================================
-   --  | Man page curs_refresh.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_61"#2|
-   procedure Update_Screen;
-   --  AKA: doupdate()
-   pragma Inline (Update_Screen);
-
-   --  #1A NAME="AFU_62"#2|
-   procedure Refresh (Win : Window := Standard_Window);
-   --  AKA: wrefresh()
-   --  There is an overloaded Refresh for Pads.
-   --  The Inline pragma appears there
-   --  AKA: refresh()
-
-   --  #1A NAME="AFU_63"#2|
-   procedure Refresh_Without_Update
-     (Win : Window := Standard_Window);
-   --  AKA: wnoutrefresh()
-   --  There is an overloaded Refresh_Without_Update for Pads.
-   --  The Inline pragma appears there
-
-   --  #1A NAME="AFU_64"#2|
-   procedure Redraw (Win : Window := Standard_Window);
-   --  AKA: redrawwin()
-
-   --  #1A NAME="AFU_65"#2|
-   procedure Redraw (Win        : Window := Standard_Window;
-                     Begin_Line : Line_Position;
-                     Line_Count : Positive);
-   --  AKA: wredrawln()
-   pragma Inline (Redraw);
-
-   --  |=====================================================================
-   --  | Man page curs_clear.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_66"#2|
-   procedure Erase (Win : Window := Standard_Window);
-   --  AKA: werase()
-   --  AKA: erase()
-   pragma Inline (Erase);
-
-   --  #1A NAME="AFU_67"#2|
-   procedure Clear
-     (Win : Window := Standard_Window);
-   --  AKA: wclear()
-   --  AKA: clear()
-   pragma Inline (Clear);
-
-   --  #1A NAME="AFU_68"#2|
-   procedure Clear_To_End_Of_Screen
-     (Win : Window := Standard_Window);
-   --  AKA: wclrtobot()
-   --  AKA: clrtobot()
-   pragma Inline (Clear_To_End_Of_Screen);
-
-   --  #1A NAME="AFU_69"#2|
-   procedure Clear_To_End_Of_Line
-     (Win : Window := Standard_Window);
-   --  AKA: wclrtoeol()
-   --  AKA: clrtoeol()
-   pragma Inline (Clear_To_End_Of_Line);
-
-   --  |=====================================================================
-   --  | Man page curs_bkgd.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_70"#2|
-   --  TODO: we could have Set_Background(Window; Character_Attribute_Set)
-   --  because in C it is common to see bkgdset(A_BOLD) or
-   --  bkgdset(COLOR_PAIR(n))
-   procedure Set_Background
-     (Win : Window := Standard_Window;
-      Ch  : Attributed_Character);
-   --  AKA: wbkgdset()
-   --  AKA: bkgdset()
-   pragma Inline (Set_Background);
-
-   --  #1A NAME="AFU_71"#2|
-   procedure Change_Background
-     (Win : Window := Standard_Window;
-      Ch  : Attributed_Character);
-   --  AKA: wbkgd()
-   --  AKA: bkgd()
-   pragma Inline (Change_Background);
-
-   --  #1A NAME="AFU_72"#2|
-   --  ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
-   function Get_Background (Win : Window := Standard_Window)
-     return Attributed_Character;
-   --  AKA: wbkgdget()
-   --  AKA: bkgdget()
-   pragma Inline (Get_Background);
-
-   --  |=====================================================================
-   --  | Man page curs_touch.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_73"#2|
-   procedure Untouch (Win : Window := Standard_Window);
-   --  AKA: untouchwin()
-   pragma Inline (Untouch);
-
-   --  #1A NAME="AFU_74"#2|
-   procedure Touch (Win : Window := Standard_Window);
-   --  AKA: touchwin()
-
-   --  #1A NAME="AFU_75"#2|
-   procedure Touch (Win   : Window := Standard_Window;
-                    Start : Line_Position;
-                    Count : Positive);
-   --  AKA: touchline()
-   pragma Inline (Touch);
-
-   --  #1A NAME="AFU_76"#2|
-   procedure Change_Lines_Status (Win   : Window := Standard_Window;
-                                  Start : Line_Position;
-                                  Count : Positive;
-                                  State : Boolean);
-   --  AKA: wtouchln()
-   pragma Inline (Change_Lines_Status);
-
-   --  #1A NAME="AFU_77"#2|
-   function Is_Touched (Win  : Window := Standard_Window;
-                        Line : Line_Position) return Boolean;
-   --  AKA: is_linetouched()
-
-   --  #1A NAME="AFU_78"#2|
-   function Is_Touched (Win : Window := Standard_Window) return Boolean;
-   --  AKA: is_wintouched()
-   pragma Inline (Is_Touched);
-
-   --  |=====================================================================
-   --  | Man page curs_overlay.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_79"#2|
-   procedure Copy
-     (Source_Window            : Window;
-      Destination_Window       : Window;
-      Source_Top_Row           : Line_Position;
-      Source_Left_Column       : Column_Position;
-      Destination_Top_Row      : Line_Position;
-      Destination_Left_Column  : Column_Position;
-      Destination_Bottom_Row   : Line_Position;
-      Destination_Right_Column : Column_Position;
-      Non_Destructive_Mode     : Boolean := True);
-   --  AKA: copywin()
-   pragma Inline (Copy);
-
-   --  #1A NAME="AFU_80"#2|
-   procedure Overwrite (Source_Window      : Window;
-                        Destination_Window : Window);
-   --  AKA: overwrite()
-   pragma Inline (Overwrite);
-
-   --  #1A NAME="AFU_81"#2|
-   procedure Overlay (Source_Window      : Window;
-                      Destination_Window : Window);
-   --  AKA: overlay()
-   pragma Inline (Overlay);
-
-   --  |=====================================================================
-   --  | Man page curs_deleteln.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_82"#2|
-   procedure Insert_Delete_Lines
-     (Win   : Window  := Standard_Window;
-      Lines : Integer := 1); --  default is to insert one line above
-   --  AKA: winsdelln()
-   --  AKA: insdelln()
-   pragma Inline (Insert_Delete_Lines);
-
-   --  #1A NAME="AFU_83"#2|
-   procedure Delete_Line (Win : Window := Standard_Window);
-   --  AKA: wdeleteln()
-   --  AKA: deleteln()
-   pragma Inline (Delete_Line);
-
-   --  #1A NAME="AFU_84"#2|
-   procedure Insert_Line (Win : Window := Standard_Window);
-   --  AKA: winsertln()
-   --  AKA: insertln()
-   pragma Inline (Insert_Line);
-
-   --  |=====================================================================
-   --  | Man page curs_getyx.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_85"#2|
-   procedure Get_Size
-     (Win               : Window := Standard_Window;
-      Number_Of_Lines   : out Line_Count;
-      Number_Of_Columns : out Column_Count);
-   --  AKA: getmaxyx()
-   pragma Inline (Get_Size);
-
-   --  #1A NAME="AFU_86"#2|
-   procedure Get_Window_Position
-     (Win             : Window := Standard_Window;
-      Top_Left_Line   : out Line_Position;
-      Top_Left_Column : out Column_Position);
-   --  AKA: getbegyx()
-   pragma Inline (Get_Window_Position);
-
-   --  #1A NAME="AFU_87"#2|
-   procedure Get_Cursor_Position
-     (Win    : Window := Standard_Window;
-      Line   : out Line_Position;
-      Column : out Column_Position);
-   --  AKA: getyx()
-   pragma Inline (Get_Cursor_Position);
-
-   --  #1A NAME="AFU_88"#2|
-   procedure Get_Origin_Relative_To_Parent
-     (Win                : Window;
-      Top_Left_Line      : out Line_Position;
-      Top_Left_Column    : out Column_Position;
-      Is_Not_A_Subwindow : out Boolean);
-   --  AKA: getparyx()
-   --  Instead of placing -1 in the coordinates as return, we use a Boolean
-   --  to return the info that the window has no parent.
-   pragma Inline (Get_Origin_Relative_To_Parent);
-
-   --  |=====================================================================
-   --  | Man page curs_pad.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_89"#2|
-   function New_Pad (Lines   : Line_Count;
-                     Columns : Column_Count) return Window;
-   --  AKA: newpad()
-   pragma Inline (New_Pad);
-
-   --  #1A NAME="AFU_90"#2|
-   function Sub_Pad
-     (Pad                   : Window;
-      Number_Of_Lines       : Line_Count;
-      Number_Of_Columns     : Column_Count;
-      First_Line_Position   : Line_Position;
-      First_Column_Position : Column_Position) return Window;
-   --  AKA: subpad()
-   pragma Inline (Sub_Pad);
-
-   --  #1A NAME="AFU_91"#2|
-   procedure Refresh
-     (Pad                      : Window;
-      Source_Top_Row           : Line_Position;
-      Source_Left_Column       : Column_Position;
-      Destination_Top_Row      : Line_Position;
-      Destination_Left_Column  : Column_Position;
-      Destination_Bottom_Row   : Line_Position;
-      Destination_Right_Column : Column_Position);
-   --  AKA: prefresh()
-   pragma Inline (Refresh);
-
-   --  #1A NAME="AFU_92"#2|
-   procedure Refresh_Without_Update
-     (Pad                      : Window;
-      Source_Top_Row           : Line_Position;
-      Source_Left_Column       : Column_Position;
-      Destination_Top_Row      : Line_Position;
-      Destination_Left_Column  : Column_Position;
-      Destination_Bottom_Row   : Line_Position;
-      Destination_Right_Column : Column_Position);
-   --  AKA: pnoutrefresh()
-   pragma Inline (Refresh_Without_Update);
-
-   --  #1A NAME="AFU_93"#2|
-   procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : Window;
-      Ch  : Attributed_Character);
-   --  AKA: pechochar()
-
-   procedure Add_Character_To_Pad_And_Echo_It
-     (Pad : Window;
-      Ch  : Character);
-   pragma Inline (Add_Character_To_Pad_And_Echo_It);
-
-   --  |=====================================================================
-   --  | Man page curs_scroll.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_94"#2|
-   procedure Scroll (Win    : Window  := Standard_Window;
-                     Amount : Integer := 1);
-   --  AKA: wscrl()
-   --  AKA: scroll()
-   --  AKA: scrl()
-   pragma Inline (Scroll);
-
-   --  |=====================================================================
-   --  | Man page curs_delch.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_95"#2|
-   procedure Delete_Character (Win : Window := Standard_Window);
-   --  AKA: wdelch()
-   --  AKA: delch()
-
-   --  #1A NAME="AFU_96"#2|
-   procedure Delete_Character
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position);
-   --  AKA: mvwdelch()
-   --  AKA: mvdelch()
-   pragma Inline (Delete_Character);
-
-   --  |=====================================================================
-   --  | Man page curs_inch.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_97"#2|
-   function Peek (Win : Window := Standard_Window)
-     return Attributed_Character;
-   --  AKA: inch()
-   --  AKA: winch()
-
-   --  #1A NAME="AFU_98"#2|
-   function Peek
-     (Win    : Window := Standard_Window;
-      Line   : Line_Position;
-      Column : Column_Position) return Attributed_Character;
-   --  AKA: mvwinch()
-   --  AKA: mvinch()
-   --  More Peek's follow, pragma Inline appears later.
-
-   --  |=====================================================================
-   --  | Man page curs_insch.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_99"#2|
-   procedure Insert (Win : Window := Standard_Window;
-                     Ch  : Attributed_Character);
-   --  AKA: winsch()
-   --  AKA: insch()
-
-   --  #1A NAME="AFU_100"#2|
-   procedure Insert (Win    : Window := Standard_Window;
-                     Line   : Line_Position;
-                     Column : Column_Position;
-                     Ch     : Attributed_Character);
-   --  AKA: mvwinsch()
-   --  AKA: mvinsch()
-
-   --  |=====================================================================
-   --  | Man page curs_insstr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_101"#2|
-   procedure Insert (Win : Window := Standard_Window;
-                     Str : String;
-                     Len : Integer := -1);
-   --  AKA: winsnstr()
-   --  AKA: winsstr()
-   --  AKA: insnstr()
-   --  AKA: insstr()
-
-   --  #1A NAME="AFU_102"#2|
-   procedure Insert (Win    : Window := Standard_Window;
-                     Line   : Line_Position;
-                     Column : Column_Position;
-                     Str    : String;
-                     Len    : Integer := -1);
-   --  AKA: mvwinsnstr()
-   --  AKA: mvwinsstr()
-   --  AKA: mvinsnstr()
-   --  AKA: mvinsstr()
-   pragma Inline (Insert);
-
-   --  |=====================================================================
-   --  | Man page curs_instr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_103"#2|
-   procedure Peek (Win : Window := Standard_Window;
-                   Str : out String;
-                   Len : Integer := -1);
-   --  AKA: winnstr()
-   --  AKA: winstr()
-   --  AKA: innstr()
-   --  AKA: instr()
-
-   --  #1A NAME="AFU_104"#2|
-   procedure Peek (Win    : Window := Standard_Window;
-                   Line   : Line_Position;
-                   Column : Column_Position;
-                   Str    : out String;
-                   Len    : Integer := -1);
-   --  AKA: mvwinnstr()
-   --  AKA: mvwinstr()
-   --  AKA: mvinnstr()
-   --  AKA: mvinstr()
-
-   --  |=====================================================================
-   --  | Man page curs_inchstr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_105"#2|
-   procedure Peek (Win : Window := Standard_Window;
-                   Str : out Attributed_String;
-                   Len : Integer := -1);
-   --  AKA: winchnstr()
-   --  AKA: winchstr()
-   --  AKA: inchnstr()
-   --  AKA: inchstr()
-
-   --  #1A NAME="AFU_106"#2|
-   procedure Peek (Win    : Window := Standard_Window;
-                   Line   : Line_Position;
-                   Column : Column_Position;
-                   Str    : out Attributed_String;
-                   Len    : Integer := -1);
-   --  AKA: mvwinchnstr()
-   --  AKA: mvwinchstr()
-   --  AKA: mvinchnstr()
-   --  AKA: mvinchstr()
-   --  We do not inline the Peek procedures
-
-   --  |=====================================================================
-   --  | Man page curs_getstr.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_107"#2|
-   procedure Get (Win : Window := Standard_Window;
-                  Str : out String;
-                  Len : Integer := -1);
-   --  AKA: wgetnstr()
-   --  AKA: wgetstr()
-   --  AKA: getnstr()
-   --  AKA: getstr()
-   --  actually getstr is not supported because that results in buffer
-   --  overflows.
-
-   --  #1A NAME="AFU_108"#2|
-   procedure Get (Win    : Window := Standard_Window;
-                  Line   : Line_Position;
-                  Column : Column_Position;
-                  Str    : out String;
-                  Len    : Integer := -1);
-   --  AKA: mvwgetnstr()
-   --  AKA: mvwgetstr()
-   --  AKA: mvgetnstr()
-   --  AKA: mvgetstr()
-   --  Get is not inlined
-
-   --  |=====================================================================
-   --  | Man page curs_slk.3x
-   --  |=====================================================================
-
-   --  Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
-
-   type Soft_Label_Key_Format is (Three_Two_Three,
-                                  Four_Four,
-                                  PC_Style,              --  ncurses specific
-                                  PC_Style_With_Index);  --  "
-   type Label_Number is new Positive range 1 .. 12;
-   type Label_Justification is (Left, Centered, Right);
-
-   --  #1A NAME="AFU_109"#2|
-   procedure Init_Soft_Label_Keys
-     (Format : Soft_Label_Key_Format := Three_Two_Three);
-   --  AKA: slk_init()
-   pragma Inline (Init_Soft_Label_Keys);
-
-   --  #1A NAME="AFU_110"#2|
-   procedure Set_Soft_Label_Key (Label : Label_Number;
-                                 Text  : String;
-                                 Fmt   : Label_Justification := Left);
-   --  AKA: slk_set()
-   --  We do not inline this procedure
-
-   --  #1A NAME="AFU_111"#2|
-   procedure Refresh_Soft_Label_Keys;
-   --  AKA: slk_refresh()
-   pragma Inline (Refresh_Soft_Label_Keys);
-
-   --  #1A NAME="AFU_112"#2|
-   procedure Refresh_Soft_Label_Keys_Without_Update;
-   --  AKA: slk_noutrefresh()
-   pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
-
-   --  #1A NAME="AFU_113"#2|
-   procedure Get_Soft_Label_Key (Label : Label_Number;
-                                 Text  : out String);
-   --  AKA: slk_label()
-
-   --  #1A NAME="AFU_114"#2|
-   function Get_Soft_Label_Key (Label : Label_Number) return String;
-   --  AKA: slk_label()
-   --  Same as function
-   pragma Inline (Get_Soft_Label_Key);
-
-   --  #1A NAME="AFU_115"#2|
-   procedure Clear_Soft_Label_Keys;
-   --  AKA: slk_clear()
-   pragma Inline (Clear_Soft_Label_Keys);
-
-   --  #1A NAME="AFU_116"#2|
-   procedure Restore_Soft_Label_Keys;
-   --  AKA: slk_restore()
-   pragma Inline (Restore_Soft_Label_Keys);
-
-   --  #1A NAME="AFU_117"#2|
-   procedure Touch_Soft_Label_Keys;
-   --  AKA: slk_touch()
-   pragma Inline (Touch_Soft_Label_Keys);
-
-   --  #1A NAME="AFU_118"#2|
-   procedure Switch_Soft_Label_Key_Attributes
-     (Attr : Character_Attribute_Set;
-      On   : Boolean := True);
-   --  AKA: slk_attron()
-   --  AKA: slk_attroff()
-   pragma Inline (Switch_Soft_Label_Key_Attributes);
-
-   --  #1A NAME="AFU_119"#2|
-   procedure Set_Soft_Label_Key_Attributes
-     (Attr  : Character_Attribute_Set := Normal_Video;
-      Color : Color_Pair := Color_Pair'First);
-   --  AKA: slk_attrset()
-   pragma Inline (Set_Soft_Label_Key_Attributes);
-
-   --  #1A NAME="AFU_120"#2|
-   function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
-   --  AKA: slk_attr()
-
-   --  #1A NAME="AFU_121"#2|
-   function Get_Soft_Label_Key_Attributes return Color_Pair;
-   --  AKA: slk_attr()
-   pragma Inline (Get_Soft_Label_Key_Attributes);
-
-   --  #1A NAME="AFU_122"#2|
-   procedure Set_Soft_Label_Key_Color (Pair : Color_Pair);
-   --  AKA: slk_color()
-   pragma Inline (Set_Soft_Label_Key_Color);
-
-   --  |=====================================================================
-   --  | Man page keybound.3x
-   --  |=====================================================================
-   --  Not Implemented: keybound
-
-   --  |=====================================================================
-   --  | Man page keyok.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_123"#2|
-   procedure Enable_Key (Key    : Special_Key_Code;
-                         Enable : Boolean := True);
-   --  AKA: keyok()
-   pragma Inline (Enable_Key);
-
-   --  |=====================================================================
-   --  | Man page define_key.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_124"#2|
-   procedure Define_Key (Definition : String;
-                         Key        : Special_Key_Code);
-   --  AKA: define_key()
-   pragma Inline (Define_Key);
-
-   --  |=====================================================================
-   --  | Man page curs_util.3x
-   --  |=====================================================================
-
-   --  | Not implemented : filter, use_env
-   --  | putwin, getwin are in the child package PutWin
-   --
-
-   --  #1A NAME="AFU_125"#2|
-   procedure Key_Name (Key  : Real_Key_Code;
-                       Name : out String);
-   --  AKA: keyname()
-   --  The external name for a real keystroke.
-
-   --  #1A NAME="AFU_126"#2|
-   function Key_Name (Key  : Real_Key_Code) return String;
-   --  AKA: keyname()
-   --  Same as function
-   --  We do not inline this routine
-
-   --  #1A NAME="AFU_127"#2|
-   procedure Un_Control (Ch  : Attributed_Character;
-                         Str : out String);
-   --  AKA: unctrl()
-
-   --  #1A NAME="AFU_128"#2|
-   function Un_Control (Ch  : Attributed_Character) return String;
-   --  AKA: unctrl()
-   --  Same as function
-   pragma Inline (Un_Control);
-
-   --  #1A NAME="AFU_129"#2|
-   procedure Delay_Output (Msecs : Natural);
-   --  AKA: delay_output()
-   pragma Inline (Delay_Output);
-
-   --  #1A NAME="AFU_130"#2|
-   procedure Flush_Input;
-   --  AKA: flushinp()
-   pragma Inline (Flush_Input);
-
-   --  |=====================================================================
-   --  | Man page curs_termattrs.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_131"#2|
-   function Baudrate return Natural;
-   --  AKA: baudrate()
-   pragma Inline (Baudrate);
-
-   --  #1A NAME="AFU_132"#2|
-   function Erase_Character return Character;
-   --  AKA: erasechar()
-   pragma Inline (Erase_Character);
-
-   --  #1A NAME="AFU_133"#2|
-   function Kill_Character return Character;
-   --  AKA: killchar()
-   pragma Inline (Kill_Character);
-
-   --  #1A NAME="AFU_134"#2|
-   function Has_Insert_Character return Boolean;
-   --  AKA: has_ic()
-   pragma Inline (Has_Insert_Character);
-
-   --  #1A NAME="AFU_135"#2|
-   function Has_Insert_Line return Boolean;
-   --  AKA: has_il()
-   pragma Inline (Has_Insert_Line);
-
-   --  #1A NAME="AFU_136"#2|
-   function Supported_Attributes return Character_Attribute_Set;
-   --  AKA: termattrs()
-   pragma Inline (Supported_Attributes);
-
-   --  #1A NAME="AFU_137"#2|
-   procedure Long_Name (Name : out String);
-   --  AKA: longname()
-
-   --  #1A NAME="AFU_138"#2|
-   function Long_Name return String;
-   --  AKA: longname()
-   --  Same as function
-   pragma Inline (Long_Name);
-
-   --  #1A NAME="AFU_139"#2|
-   procedure Terminal_Name (Name : out String);
-   --  AKA: termname()
-
-   --  #1A NAME="AFU_140"#2|
-   function Terminal_Name return String;
-   --  AKA: termname()
-   --  Same as function
-   pragma Inline (Terminal_Name);
-
-   --  |=====================================================================
-   --  | Man page curs_color.3x
-   --  |=====================================================================
-
-   --  COLOR_PAIR
-   --  COLOR_PAIR(n) in C is the same as
-   --  Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
-   --  In C you often see something like c = c | COLOR_PAIR(n);
-   --  This is equivalent to c.Color := n;
-
-   --  #1A NAME="AFU_141"#2|
-   procedure Start_Color;
-   --  AKA: start_color()
-   pragma Import (C, Start_Color, "start_color");
-
-   --  #1A NAME="AFU_142"#2|
-   procedure Init_Pair (Pair : Redefinable_Color_Pair;
-                        Fore : Color_Number;
-                        Back : Color_Number);
-   --  AKA: init_pair()
-   pragma Inline (Init_Pair);
-
-   --  #1A NAME="AFU_143"#2|
-   procedure Pair_Content (Pair : Color_Pair;
-                           Fore : out Color_Number;
-                           Back : out Color_Number);
-   --  AKA: pair_content()
-   pragma Inline (Pair_Content);
-
-   --  #1A NAME="AFU_144"#2|
-   function Has_Colors return Boolean;
-   --  AKA: has_colors()
-   pragma Inline (Has_Colors);
-
-   --  #1A NAME="AFU_145"#2|
-   procedure Init_Color (Color : Color_Number;
-                         Red   : RGB_Value;
-                         Green : RGB_Value;
-                         Blue  : RGB_Value);
-   --  AKA: init_color()
-   pragma Inline (Init_Color);
-
-   --  #1A NAME="AFU_146"#2|
-   function Can_Change_Color return Boolean;
-   --  AKA: can_change_color()
-   pragma Inline (Can_Change_Color);
-
-   --  #1A NAME="AFU_147"#2|
-   procedure Color_Content (Color : Color_Number;
-                            Red   : out RGB_Value;
-                            Green : out RGB_Value;
-                            Blue  : out RGB_Value);
-   --  AKA: color_content()
-   pragma Inline (Color_Content);
-
-   --  |=====================================================================
-   --  | Man page curs_kernel.3x
-   --  |=====================================================================
-   --  | Not implemented: getsyx, setsyx
-   --
-   type Curses_Mode is (Curses, Shell);
-
-   --  #1A NAME="AFU_148"#2|
-   procedure Save_Curses_Mode (Mode : Curses_Mode);
-   --  AKA: def_prog_mode()
-   --  AKA: def_shell_mode()
-   pragma Inline (Save_Curses_Mode);
-
-   --  #1A NAME="AFU_149"#2|
-   procedure Reset_Curses_Mode (Mode : Curses_Mode);
-   --  AKA: reset_prog_mode()
-   --  AKA: reset_shell_mode()
-   pragma Inline (Reset_Curses_Mode);
-
-   --  #1A NAME="AFU_150"#2|
-   procedure Save_Terminal_State;
-   --  AKA: savetty()
-   pragma Inline (Save_Terminal_State);
-
-   --  #1A NAME="AFU_151"#2|
-   procedure Reset_Terminal_State;
-   --  AKA: resetty();
-   pragma Inline (Reset_Terminal_State);
-
-   type Stdscr_Init_Proc is access
-      function (Win     : Window;
-                Columns : Column_Count) return Integer;
-   pragma Convention (C, Stdscr_Init_Proc);
-   --  N.B.: the return value is actually ignored, but it seems to be
-   --        a good practice to return 0 if you think all went fine
-   --        and -1 otherwise.
-
-   --  #1A NAME="AFU_152"#2|
-   procedure Rip_Off_Lines (Lines : Integer;
-                            Proc  : Stdscr_Init_Proc);
-   --  AKA: ripoffline()
-   --  N.B.: to be more precise, this uses a ncurses specific enhancement of
-   --        ripoffline(), in which the Lines argument absolute value is the
-   --        number of lines to be ripped of. The official ripoffline() only
-   --        uses the sign of Lines to remove a single line from bottom or top.
-   pragma Inline (Rip_Off_Lines);
-
-   type Cursor_Visibility is (Invisible, Normal, Very_Visible);
-
-   --  #1A NAME="AFU_153"#2|
-   procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
-   --  AKA: curs_set()
-   pragma Inline (Set_Cursor_Visibility);
-
-   --  #1A NAME="AFU_154"#2|
-   procedure Nap_Milli_Seconds (Ms : Natural);
-   --  AKA: napms()
-   pragma Inline (Nap_Milli_Seconds);
-
-   --  |=====================================================================
-   --  | Some useful helpers.
-   --  |=====================================================================
-   type Transform_Direction is (From_Screen, To_Screen);
-   procedure Transform_Coordinates
-     (W      : Window := Standard_Window;
-      Line   : in out Line_Position;
-      Column : in out Column_Position;
-      Dir    : Transform_Direction := From_Screen);
-   --  This procedure transforms screen coordinates into coordinates relative
-   --  to the window and vice versa, depending on the Dir parameter.
-   --  Screen coordinates are the position information for the physical device.
-   --  An Curses_Exception will be raised if Line and Column are not in the
-   --  Window or if you pass the Null_Window as argument.
-   --  We do not inline this procedure
-
-   --  |=====================================================================
-   --  | Man page default_colors.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_155"#2|
-   procedure Use_Default_Colors;
-   --  AKA: use_default_colors()
-   pragma Inline (Use_Default_Colors);
-
-   --  #1A NAME="AFU_156"#2|
-   procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
-                                    Back : Color_Number := Default_Color);
-   --  AKA: assume_default_colors()
-   pragma Inline (Assume_Default_Colors);
-
-   --  |=====================================================================
-   --  | Man page curs_extend.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_157"#2|
-   function Curses_Version return String;
-   --  AKA: curses_version()
-
-   --  #1A NAME="AFU_158"#2|
-   --  The returnvalue is the previous setting of the flag
-   function Use_Extended_Names (Enable : Boolean) return Boolean;
-   --  AKA: use_extended_names()
-
-   --  |=====================================================================
-   --  | Man page curs_trace.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_159"#2|
-   procedure Curses_Free_All;
-   --  AKA: _nc_freeall()
-
-   --  |=====================================================================
-   --  | Man page curs_scr_dump.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_160"#2|
-   procedure Screen_Dump_To_File (Filename : String);
-   --  AKA: scr_dump()
-
-   --  #1A NAME="AFU_161"#2|
-   procedure Screen_Restore_From_File (Filename : String);
-   --  AKA: scr_restore()
-
-   --  #1A NAME="AFU_162"#2|
-   procedure Screen_Init_From_File (Filename : String);
-   --  AKA: scr_init()
-
-   --  #1A NAME="AFU_163"#2|
-   procedure Screen_Set_File (Filename : String);
-   --  AKA: scr_set()
-
-   --  |=====================================================================
-   --  | Man page curs_print.3x
-   --  |=====================================================================
-   --  Not implemented: mcprint
-
-   --  |=====================================================================
-   --  | Man page curs_printw.3x
-   --  |=====================================================================
-   --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw,
-   --                   vw_printw
-   --  Please use the Ada style Text_IO child packages for formatted
-   --  printing. It does not make a lot of sense to map the printf style
-   --  C functions to Ada.
-
-   --  |=====================================================================
-   --  | Man page curs_scanw.3x
-   --  |=====================================================================
-   --  Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
-
-   --  |=====================================================================
-   --  | Man page resizeterm.3x
-   --  |=====================================================================
-   --  Not Implemented: resizeterm
-
-   --  |=====================================================================
-   --  | Man page wresize.3x
-   --  |=====================================================================
-
-   --  #1A NAME="AFU_164"#2|
-   procedure Resize (Win               : Window := Standard_Window;
-                     Number_Of_Lines   : Line_Count;
-                     Number_Of_Columns : Column_Count);
-   --  AKA: wresize()
-
-private
-   type Window is new System.Storage_Elements.Integer_Address;
-   Null_Window : constant Window := 0;
-
-   --  The next constants are generated and may be different on your
-   --  architecture.
-   --
-   Sizeof_bool        : constant Natural :=  1; --  bool
-   type Curses_Bool is mod 2 ** Interfaces.C.char'Size;
-   Curses_Bool_False : constant Curses_Bool := 0;
-
-end Terminal_Interface.Curses;
-
diff --git a/doc/html/ada/terminal_interface__ads.htm b/doc/html/ada/terminal_interface__ads.htm deleted file mode 100644 index 6d7cdf1d2fe..00000000000 --- a/doc/html/ada/terminal_interface__ads.htm +++ /dev/null @@ -1,53 +0,0 @@ - -terminal_interface.ads - -

File : terminal_interface.ads


-
-------------------------------------------------------------------------------
---                                                                          --
---                           GNAT ncurses Binding                           --
---                                                                          --
---                            Terminal_Interface                            --
---                                                                          --
---                                 S P E C                                  --
---                                                                          --
-------------------------------------------------------------------------------
--- Copyright (c) 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            --
--- "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:  Juergen Pfeifer, 1996
---  Version Control:
---  @Revision: 1.14 @
---  @Date: 2006/06/25 14:30:22 @
---  Binding Version 01.00
-------------------------------------------------------------------------------
-package Terminal_Interface is
-   pragma Pure (Terminal_Interface);
---
---  Everything is in the child units
---
-end Terminal_Interface;
-
diff --git a/doc/html/announce.html b/doc/html/announce.html index 961e7571cf6..234c703145a 100644 --- a/doc/html/announce.html +++ b/doc/html/announce.html @@ -1,8 +1,8 @@ - + - - - - - - Announcing ncurses 5.9 - - - - - -

Announcing ncurses 5.9

The ncurses (new curses) - library is a free software emulation of curses in System V - Release 4.0, and more. It uses terminfo format, supports pads and - color and multiple highlights and forms characters and - function-key mapping, and has all the other SYSV-curses - enhancements over BSD curses. - -

In mid-June 1995, the maintainer of 4.4BSD curses declared - that he considered 4.4BSD curses obsolete, and encouraged the - keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to - switch over to ncurses.

- -

The ncurses code was developed under GNU/Linux. It has been in - use for some time with OpenBSD as the system curses library, and - on FreeBSD and NetBSD as an external package. It should port - easily to any ANSI/POSIX-conforming UNIX. It has even been ported - to OS/2 Warp!

- -

The distribution includes the library and support utilities, - including a terminfo compiler tic(1), a decompiler infocmp(1), - clear(1), tput(1), tset(1), and a termcap conversion tool - captoinfo(1). Full manual pages are provided for the library and - tools.

- -

The ncurses distribution is available via anonymous FTP at the - GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
- - It is also available at ftp://invisible-island.net/ncurses/ .

- -

Release Notes

This release is designed to be upward - compatible from ncurses 5.0 through 5.8; very few applications - will require recompilation, depending on the platform. These are - the highlights from the change-log since ncurses 5.8 release. -

- This is a bug-fix release, correcting a small number of urgent problems - in the ncurses library from the 5.8 release. -

- It also improves the Ada95 binding: -

    -
  • fixes a longstanding portability problem with its use of the - set_field_type - function. Because that function uses variable-length argument lists, - its interface with gnat does not work with certain platforms. -
  • improves configurability and portability, particularly when built - separately from the main ncurses tree. The 5.8 release introduced - scripts which can be used to construct separate tarballs for the - Ada95 and ncurses examples. -

    Those were a proof of concept. For the 5.9 release, those - scripts are augmented with rpm- and dpkg-scripts used in test builds - against a variety of gnat- and system ncurses versions as old as - gnat 3.15 and ncurses 5.4 (see snapshots and systems tested - here. -

  • additional improvements were made for portability of the - ncurses examples, adding rpm- and dpkg-scripts for test-builds. - See - this page - for snapshots and other information. -
- -

Features of Ncurses

The ncurses package is fully - compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are - documented).
  • - -
  • Full support for SVr4 curses features including keyboard - mapping, color, forms-drawing with ACS characters, and - automatic recognition of keypad and function keys.
  • - -
  • An emulation of the SVr4 panels library, supporting a stack - of windows with backing store, is included.
  • - -
  • An emulation of the SVr4 menus library, supporting a - uniform but flexible interface for menu programming, is - included.
  • - -
  • An emulation of the SVr4 form library, supporting data - collection through on-screen forms, is included.
  • - -
  • Binary terminfo entries generated by the ncurses tic(1) - implementation are bit-for-bit-compatible with the entry format - SVr4 curses uses.
  • - -
  • The utilities have options to allow you to filter terminfo - entries for use with less capable - curses/terminfo versions such - as the HP/UX and AIX ports.
  • -
The ncurses package also has many useful extensions over - SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the - X/OPEN curses specification, XSI curses (that is, it implements - all BASE level features, and most EXTENDED features). It - includes many function calls not supported under SVr4 curses - (but portability of all calls is documented so you can use the - SVr4 subset only).
  • - -
  • Unlike SVr3 curses, ncurses can write to the - rightmost-bottommost corner of the screen if your terminal has - an insert-character capability.
  • - -
  • Ada95 and C++ bindings.
  • - -
  • Support for mouse event reporting with X Window xterm and - FreeBSD and OS/2 console windows.
  • - -
  • Extended mouse support via Alessandro Rubini's gpm - package.
  • - -
  • The function wresize allows you to resize - windows, preserving their data.
  • - -
  • The function use_default_colors allows you to - use the terminal's default colors for the default color pair, - achieving the effect of transparent colors.
  • - -
  • The functions keyok and - define_key allow you to better control the use of - function keys, e.g., disabling the ncurses KEY_MOUSE, or by - defining more than one control sequence to map to a given key - code.
  • - -
  • Support for 256-color terminals, such as modern xterm, when - configured using the --enable-ext-colors - option.
  • - -
  • Support for 16-color terminals, such as aixterm - and modern xterm.
  • - -
  • Better cursor-movement optimization. The package now - features a cursor-local-movement computation more efficient - than either BSD's or System V's.
  • - -
  • Super hardware scrolling support. The screen-update code - incorporates a novel, simple, and cheap algorithm that enables - it to make optimal use of hardware scrolling, line-insertion, - and line-deletion for screen-line movements. This algorithm is - more powerful than the 4.4BSD curses quickch - routine.
  • - -
  • Real support for terminals with the magic-cookie glitch. - The screen-update code will refrain from drawing a highlight if - the magic- cookie unattributed spaces required just before the - beginning and after the end would step on a non-space - character. It will automatically shift highlight boundaries - when doing so would make it possible to draw the highlight - without changing the visual appearance of the screen.
  • - -
  • It is possible to generate the library with a list of - pre-loaded fallback entries linked to it so that it can serve - those terminal types even when no terminfo tree or termcap file - is accessible (this may be useful for support of - screen-oriented programs that must run in single-user - mode).
  • - -
  • The tic(1)/captoinfo utility provided with ncurses has the - ability to translate many termcaps from the XENIX, IBM and - AT&T extension sets.
  • - -
  • A BSD-like tset(1) utility is provided.
  • - -
  • The ncurses library and utilities will automatically read - terminfo entries from $HOME/.terminfo if it exists, and compile - to that directory if it exists and the user has no write access - to the system directory. This feature makes it easier for users - to have personal terminfo entries without giving up access to - the system terminfo directory.
  • - -
  • You may specify a path of directories to search for - compiled descriptions with the environment variable - TERMINFO_DIRS (this generalizes the feature provided by - TERMINFO under stock System V.)
  • - -
  • In terminfo source files, use capabilities may refer not - just to other entries in the same source file (as in System V) - but also to compiled entries in either the system terminfo - directory or the user's $HOME/.terminfo directory.
  • - -
  • A script (capconvert) is provided to help - BSD users transition from termcap to terminfo. It gathers the - information in a TERMCAP environment variable and/or a - ~/.termcap local entries file and converts it to an equivalent - local terminfo tree under $HOME/.terminfo.
  • - -
  • Automatic fallback to the /etc/termcap file can be compiled - in when it is not possible to build a terminfo tree. This - feature is neither fast nor cheap, you don't want to use it - unless you have to, but it's there.
  • - -
  • The table-of-entries utility toe makes it - easy for users to see exactly what terminal types are available - on the system.
  • - -
  • The library meets the XSI requirement that every macro - entry point have a corresponding function which may be linked - (and will be prototype-checked) if the macro definition is - disabled with #undef.
  • - -
  • An HTML "Introduction to Programming with NCURSES" document - provides a narrative introduction to the curses programming - interface.
  • -
- -

State of the Package

Numerous bugs present in earlier - versions have been fixed; the library is far more reliable than - it used to be. Bounds checking in many `dangerous' entry points - has been improved. The code is now type-safe according to gcc - -Wall. The library has been checked for malloc leaks and arena - corruption by the Purify memory-allocation tester. - -

The ncurses code has been tested with a wide variety of - applications including (versions starting with those noted):

- -
-
cdk
- -
Curses Development Kit
- http://invisible-island.net/cdk/
- - http://www.vexus.ca/products/CDK/
- -
ded
- -
directory-editor
- http://invisible-island.net/ded/
- -
dialog
- -
the underlying application used in Slackware's setup, and - the basis for similar applications on GNU/Linux.
- http://invisible-island.net/dialog/
- -
lynx
- -
the character-screen WWW browser
- http://lynx.isc.org/release/
- -
Midnight Commander
- -
file manager
- http://www.midnight-commander.org/
- -
mutt
- -
mail utility
- http://www.mutt.org/
- -
ncftp
- -
file-transfer utility
- http://www.ncftp.com/
- -
nvi
- -
New vi versions 1.50 are able to use ncurses versions 1.9.7 - and later.
- https://sites.google.com/a/bostic.com/keithbostic/nvi
-
- -
pinfo
- -
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
- -
tin
- -
newsreader, supporting color, MIME http://www.tin.org/
-
as well as some that use ncurses for the terminfo support - alone: - -
-
minicom
- -
terminal emulator
- http://alioth.debian.org/projects/minicom/
- -
vile
- -
vi-like-emacs
- http://invisible-island.net/vile/
-
- -

The ncurses distribution includes a selection of test programs - (including a few games).

- -

Who's Who and What's What

Zeyd Ben-Halim started it from - a previous package pcurses, written by Pavel Curtis. Eric S. - Raymond continued development. Jürgen Pfeifer wrote most of - the form and menu libraries. Ongoing work is being done by - Thomas Dickey. - Thomas Dickey acts as the maintainer for the Free Software - Foundation, which holds the copyright on ncurses. Contact the - current maintainers at bug-ncurses@gnu.org. - -

To join the ncurses mailing list, please write email to - bug-ncurses-request@gnu.org containing the line:

-
+
+
+Announcing ncurses 5.7
+
+
+
+
+
+

Announcing ncurses 5.7

+ +The ncurses (new curses) library is a free software emulation of +curses in System V Release 4.0, and more. It uses terminfo format, +supports pads and color +and multiple highlights and forms characters and function-key mapping, +and has all the other SYSV-curses enhancements over BSD curses.

+ +In mid-June 1995, the maintainer of 4.4BSD curses declared that he +considered 4.4BSD curses obsolete, and encouraged the keepers of +Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to +ncurses.

+ +The ncurses code was developed under GNU/Linux. +It has been in use for some time with OpenBSD as the system curses library, +and on FreeBSD and NetBSD as an external package. +It should port easily to any ANSI/POSIX-conforming UNIX. +It has even been ported to OS/2 Warp!

+ +The distribution includes the library and support utilities, including a +terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), +and a termcap conversion tool captoinfo(1). Full manual pages are provided for +the library and tools.

+ +The ncurses distribution is available via anonymous FTP at +the GNU distribution site +ftp://ftp.gnu.org/gnu/ncurses/ . +
It is also available at +ftp://invisible-island.net/ncurses/ . + +

Release Notes

+ +This release is designed to be upward compatible from ncurses 5.0 through 5.6; +very few applications will require recompilation, depending on the platform. +These are the highlights from the change-log since ncurses 5.6 release. +

+Interface changes: +

    +
  • generate linkable stubs for some macros: +
    + getattrs + +
+New features and improvements: +
    +
  • library +
      +
    • new flavor of the ncurses library provides rudimentary + support for POSIX threads. Several functions are + reentrant, but most require either a window-level or + screen-level mutex.
      + (This is API-compatible, + but not ABI-compatible with the normal library). + +
    • add NCURSES_OPAQUE symbol to curses.h, will + use to make structs opaque in selected configurations. + +
    • add NCURSES_EXT_FUNCS and + NCURSES_EXT_COLORS symbols to curses.h to make + it simpler to tell if the extended functions and/or colors + are declared. + +
    • add wresize() to C++ binding + +
    • eliminate fixed-buffer vsprintf() calls in C++ binding. + +
    • add several functions to C++ binding which wrap C functions + that pass a WINDOW* parameter. + +
    • adapt mouse-handling code from menu library in form-library + +
    • improve tracing for form library, showing created forms, + fields, etc. + +
    • make $NCURSES_NO_PADDING feature work for termcap interface . + +
    • add check to trace-file open, if the given name is a + directory, add ".log" to the name and try again. + +
    • several new manpages: curs_legacy.3x, curs_memleaks.3x, + curs_opaque.3x and curs_threads.3x +
    + +
  • programs: +
      +
    • modified three test-programs to demonstrate the threading + support in this version: ditto, rain, worm. + +
    • several new test-programs: demo_panels, dots_mvcur, + inch_wide, inchs, key_name, key_names, savescreen, + savescreen.sh test_arrays, test_get_wstr, test_getstr, + test_instr, test_inwstr and test_opaque. + +
    • add adacurses-config to the Ada95 install. + +
    • modify tic -f option to format spaces as + \s to prevent them from being lost when that + is read back in unformatted strings. + +
    • The tack program is now distributed separately + from ncurses. +
    + +
  • terminal database +
      +
    • added entries: +
        +
      • Eterm-256color, + Eterm-88color and + rxvt-88color +
      • aterm +
      • konsole-256color +
      • mrxvt +
      • screen.mlterm +
      • screen.rxvt +
      • teraterm4.59 is now the primary primary + teraterm entry, renamed original to + teraterm2.3 +
      • 9term terminal +
      • Newbury Data entries +
      +
    • updated/improved entries: +
        +
      • gnome to version 2.22.3 +
      • h19, z100 +
      • konsole to version 1.6.6 +
      • mlterm, mlterm+pcfkeys +
      • xterm, and building-blocks for function-keys + to xterm patch #230. +
      +
    +
+Major bug fixes: +
    +
  • add logic to tic for cancelling strings in user-defined + capabilities + (this is needed for + current konsole terminfo entry). + +
  • modify mk-1st.awk so the generated makefile rules for + linking or installing shared libraries do not first remove the + library, in case it is in use, e.g., libncurses.so by + /bin/sh. + +
  • correct check for notimeout() in wgetch(). + +
  • fix a sign-extension bug in infocmp's repair_acsc() function. + +
  • change winnstr() to stop at the end of the line. + +
  • make Ada95 demo_panels() example work. + +
  • fix for adding a non-spacing character at the beginning of a line. + +
  • fill in extended-color pair to make colors work + for wide-characters using extended-colors. + +
  • improve refresh of window on top of multi-column characters, + taking into account split characters on left/right window + boundaries. + +
  • modify win_wchnstr() to ensure that only a base cell + is returned for each multi-column character. + +
  • improve waddch() and winsch() handling of + EILSEQ from mbrtowc() by using unctrl() + to display illegal bytes rather than trying to append further bytes + to make up a valid sequence. + +
  • restore curs_set() state after + endwin()/refresh() + +
  • modify keyname() to use "^X" form only if + meta() has been called, or if keyname() + is called without initializing curses, e.g., via + initscr() or newterm(). + +
  • modify unctrl() to check codes in 128-255 range versus + isprint(). + If they are not printable, and locale was set, use a "M-" or "~" + sequence. + +
  • improve resizeterm() by moving ripped-off lines, and + repainting the soft-keys. + +
  • modify form library to accept control characters such as newline + in set_field_buffer(), which is compatible with Solaris. + +
  • use NCURSES_MOUSE_MASK() in definition of + BUTTON_RELEASE(), etc., to make those work properly + with the --enable-ext-mouse configuration + +
  • correct some functions in Ada95 binding which were using return + value from C where none was returned. + +
  • reviewed/fixed issues reported by Coverity and Klocwork tools. +
+ +Portability: +
    +
  • configure script: +
      +
    • new options: +
      + +
      --disable-big-strings +
      control whether static string tables are generated as single + large strings (to improve startup performance), or as array + of individual strings. + +
      --disable-relink +
      control whether shared libraries are relinked (during install) + when rpath is enabled. + +
      --disable-tic-depends +
      make explicit whether tic library depends on ncurses/ncursesw + library. + +
      --enable-mixed-case +
      override the configure script's check if the filesystem + supports mixed-case filenames. + This allows one to control how the terminal database + maps to the filesystem. + For filesystems that do not support mixed-case, the library + uses generate 2-character (hexadecimal) codes for the + lower-level of the filesystem terminfo database + +
      --enable-reentrant +
      builds a different flavor of the ncurses library (ncursest) + which improves reentrant use of the + library by reducing global and static variables + (see the "--with-pthread" option for the threaded support). + +
      --enable-weak-symbols +
      use weak-symbols for linking to the POSIX thread library, + and use the same soname for the ncurses shared library + as the normal library (caveat: the ABI is for the threaded + library, which makes global data accessed via functions). + +
      --with-pthread +
      build with the POSIX thread library (tested with AIX, + Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). + +
      --with-ticlib +
      build/install the tic-support functions in a separate library + +
      + +
    • improved options: +
      + +
      --enable-ext-colors +
      requires the wide-character configuration. + +
      --with-chtype +
      ignore option value "unsigned" is always added to + the type in curses.h; do the same for --with-mmask-t. + +
      --with-dmalloc +
      build-fix for redefinition of strndup. + +
      --with-hashed-db +
      accepts a parameter which is the install-prefix of a given + Berkeley Database. + +
      --with-hashed-db +
      the $LIBS environment variable overrides the search for the db + library. + +
      --without-hashed-db +
      assumed when "--disable-database" is used. + +
      + +
    + +
  • other configure/build issues: +
      +
    • build-fixes for LynxOS +
    • modify shared-library rules to allow FreeBSD 3.x to use rpath. +
    • build-fix for FreeBSD "contemporary" TTY interface. +
    • build-fixes for AIX with libtool. +
    • build-fixes for Darwin and libtool. +
    • modify BeOS-specific ifdef's to build on Haiku. +
    • corrected gcc options for building shared libraries on Solaris + and IRIX64. +
    • change shared-library configuration for OpenBSD, make rpath work. +
    • build-fixes for using libutf8, e.g., on OpenBSD 3.7 +
    • add "-e" option in ncurses/Makefile.in when generating source-files + to force earlier exit if the build environment fails unexpectedly. +
    • add support for shared libraries for QNX. +
    • change delimiter in MKlib_gen.sh from '%' to '@', to + avoid substitution by IBM xlc to '#' as part of its extensions to + digraphs. +
    + +
  • library: +
      +
    • rewrite wrapper for wcrtomb(), making it work on + Solaris. This is used in the form library to determine the length + of the buffer needed by field_buffer. +
    • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding + type for data manipulated by signal handlers. +
    • set locale in misc/ncurses-config.in since it uses a range +
    • disable GPM mouse support when $TERM does not happen to contain + "linux", since Gpm_Open() no longer limits its assertion to terminals + that it might handle, e.g., within "screen" in xterm. +
    • reset mouse file-descriptor when unloading GPM library. +
    + +
  • test programs: +
      +
    • update test programs to build/work with various UNIX curses for + comparisons. +
    +
+ +

Features of Ncurses

+ +The ncurses package is fully compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are documented). +
  • Full support for SVr4 curses features including keyboard mapping, color, +forms-drawing with ACS characters, and automatic recognition of keypad +and function keys. +
  • An emulation of the SVr4 panels library, supporting +a stack of windows with backing store, is included. +
  • An emulation of the SVr4 menus library, supporting +a uniform but flexible interface for menu programming, is included. +
  • An emulation of the SVr4 form library, supporting +data collection through on-screen forms, is included. +
  • Binary terminfo entries generated by the ncurses tic(1) implementation +are bit-for-bit-compatible with the entry format SVr4 curses uses. +
  • The utilities have options to allow you to filter terminfo +entries for use with less capable curses/terminfo +versions such as the HP/UX and AIX ports.
+ +The ncurses package also has many useful extensions over SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses +specification, XSI curses (that is, it implements all BASE level features, +and most EXTENDED features). +It includes many function calls not supported under SVr4 curses +(but portability of all +calls is documented so you can use the SVr4 subset only). +
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner +of the screen if your terminal has an insert-character capability. +
  • Ada95 and C++ bindings. +
  • Support for mouse event reporting with X Window xterm +and FreeBSD and OS/2 console windows. +
  • Extended mouse support via Alessandro Rubini's gpm package. +
  • The function wresize() allows you to resize windows, preserving +their data. +
  • The function use_default_colors() allows you to +use the terminal's default colors for the default color pair, +achieving the effect of transparent colors. +
  • The functions keyok() +and define_key() allow +you to better control the use of function keys, +e.g., disabling the ncurses KEY_MOUSE, +or by defining more than one control sequence to map to a given key code. +
  • Support for 256-color terminals, such as modern xterm, when configured +using the --enable-ext-colors option. +
  • Support for 16-color terminals, such as aixterm and modern xterm. +
  • Better cursor-movement optimization. The package now features a +cursor-local-movement computation more efficient than either BSD's +or System V's. +
  • Super hardware scrolling support. The screen-update code incorporates +a novel, simple, and cheap algorithm that enables it to make optimal +use of hardware scrolling, line-insertion, and line-deletion +for screen-line movements. This algorithm is more powerful than +the 4.4BSD curses quickch() routine. +
  • Real support for terminals with the magic-cookie glitch. The +screen-update code will refrain from drawing a highlight if the magic- +cookie unattributed spaces required just before the beginning and +after the end would step on a non-space character. It will +automatically shift highlight boundaries when doing so would make it +possible to draw the highlight without changing the visual appearance +of the screen. +
  • It is possible to generate the library with a list of pre-loaded +fallback entries linked to it so that it can serve those terminal types even +when no terminfo tree or termcap file is accessible (this may be useful +for support of screen-oriented programs that must run in single-user mode). +
  • The tic(1)/captoinfo utility provided with ncurses has the +ability to translate many termcaps from the XENIX, IBM and +AT&T extension sets. +
  • A BSD-like tset(1) utility is provided. +
  • The ncurses library and utilities will automatically read terminfo +entries from $HOME/.terminfo if it exists, and compile to that directory +if it exists and the user has no write access to the system directory. +This feature makes it easier for users to have personal terminfo entries +without giving up access to the system terminfo directory. +
  • You may specify a path of directories to search for compiled +descriptions with the environment variable TERMINFO_DIRS (this +generalizes the feature provided by TERMINFO under stock System V.) +
  • In terminfo source files, use capabilities may refer not just to +other entries in the same source file (as in System V) but also to +compiled entries in either the system terminfo directory or the user's +$HOME/.terminfo directory. +
  • A script (capconvert) is provided to help BSD users +transition from termcap to terminfo. It gathers the information in a +TERMCAP environment variable and/or a ~/.termcap local entries file +and converts it to an equivalent local terminfo tree under $HOME/.terminfo. +
  • Automatic fallback to the /etc/termcap file can be compiled in +when it is not possible to build a terminfo tree. This feature is neither +fast nor cheap, you don't want to use it unless you have to, +but it's there. +
  • The table-of-entries utility toe makes it easy for users to +see exactly what terminal types are available on the system. +
  • The library meets the XSI requirement that every macro entry +point have a corresponding function which may be linked (and will be +prototype-checked) if the macro definition is disabled with +#undef. +
  • An HTML "Introduction to Programming with NCURSES" document provides +a narrative introduction to the curses programming interface. +
+ +

State of the Package

+ +Numerous bugs present in earlier versions have been fixed; the +library is far more reliable than it used to be. Bounds checking in many +`dangerous' entry points has been improved. The code is now type-safe +according to gcc -Wall. The library has been checked for malloc leaks and +arena corruption by the Purify memory-allocation tester.

+ +The ncurses code has been tested with a wide variety of applications +including (versions starting with those noted): +

+
cdk +
Curses Development Kit +
+http://invisible-island.net/cdk/ +
+http://www.vexus.ca/products/CDK/ +
ded +
directory-editor +
+http://invisible-island.net/ded/ +
dialog +
the underlying application used in Slackware's setup, and the basis +for similar applications on GNU/Linux. +
+http://invisible-island.net/dialog/ +
lynx +
the character-screen WWW browser +
+http://lynx.isc.org/release/ +
Midnight Commander +
file manager +
+http://www.ibiblio.org/mc/ +
mutt +
mail utility +
+http://www.mutt.org/ +
ncftp +
file-transfer utility +
+http://www.ncftp.com/ +
nvi +
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. +
+http://www.bostic.com/vi/ +
+
pinfo +
Lynx-like info browser. +https://alioth.debian.org/projects/pinfo/ +
tin +
newsreader, supporting color, MIME +http://www.tin.org/ +
+as well as some that use ncurses for the terminfo support alone: +
+
minicom +
terminal emulator +
+ +http://alioth.debian.org/projects/minicom/ +
vile +
vi-like-emacs +
+http://invisible-island.net/vile/ +
+

+ +The ncurses distribution includes a selection of test programs (including +a few games). + +

Who's Who and What's What

+ +Zeyd Ben-Halim +started it from a previous package pcurses, written by Pavel Curtis. +Eric S. Raymond +continued development. +Jürgen Pfeifer wrote most of the form and menu libraries. +Ongoing work is being done by +Thomas Dickey. +Thomas Dickey +acts as the maintainer for the Free Software Foundation, +which holds the copyright on ncurses. +Contact the current maintainers at +bug-ncurses@gnu.org. +

+ +To join the ncurses mailing list, please write email to +bug-ncurses-request@gnu.org containing the line: +

              subscribe <name>@<host.domain>
-
+
-

This list is open to anyone interested in helping with the - development and testing of this package.

+This list is open to anyone interested in helping with the development and +testing of this package.

-

Beta versions of ncurses and patches to the current release - are made available at ftp://invisible-island.net/ncurses/ .

+Beta versions of ncurses and patches to the current release are made available at +ftp://invisible-island.net/ncurses/ . -

Future Plans

+

Future Plans

+
    +
  • Extended-level XPG4 conformance, with internationalization support. +
  • Ports to more systems, including DOS and Windows. +
+We need people to help with these projects. If you are interested in working +on them, please join the ncurses list. -
    -
  • Extended-level XPG4 conformance, with internationalization - support.
  • +

    Other Related Resources

    -
  • Ports to more systems, including DOS and Windows.
  • -
We need people to help with these projects. If you are - interested in working on them, please join the ncurses list. +The distribution provides a newer version of the terminfo-format +terminal description file once maintained by +Eric Raymond . +Unlike the older version, the termcap and terminfo data are provided +in the same file, and provides several user-definable extensions +beyond the X/Open specification.

-

Other Related Resources

The distribution provides a newer - version of the terminfo-format terminal description file once - maintained by Eric - Raymond . Unlike the older version, the termcap and - terminfo data are provided in the same file, and provides several - user-definable extensions beyond the X/Open specification. - -

You can find lots of information on terminal-related topics - not covered in the terminfo file at - Richard Shuford's archive .

- - +You can find lots of information on terminal-related topics +not covered in the terminfo file at +Richard Shuford's +archive . + + + diff --git a/doc/html/hackguide.html b/doc/html/hackguide.html index 417f4c9855e..97d1369170c 100644 --- a/doc/html/hackguide.html +++ b/doc/html/hackguide.html @@ -1,8 +1,8 @@ - + - - -Welcome to ncurses - - - - - -

Welcome to ncurses

-From this index page you have access to these further documents -

-We also have HTML versions of all the ncurses manpages. - - diff --git a/doc/html/man/adacurses-config.1.html b/doc/html/man/adacurses-config.1.html deleted file mode 100644 index 74b58a15e86..00000000000 --- a/doc/html/man/adacurses-config.1.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - -ADACURSES 1 User Commands - - - - -

ADACURSES 1 User Commands

-
-
-
-ADACURSES(1)                 User Commands                 ADACURSES(1)
-
-
-
-
-
-

NAME

-       adacurses-config - helper script for AdaCurses libraries
-
-
-
-

SYNOPSIS

-       adacurses-config [options]
-
-
-
-

DESCRIPTION

-       This  is  a  shell  script which simplifies configuring an
-       application  to  use  the  AdaCurses  library  binding  to
-       ncurses.
-
-
-
-

OPTIONS

-       --cflags
-              echos  the gnat (Ada compiler) flags needed to com-
-              pile with AdaCurses.
-
-       --libs echos  the  gnat  libraries  needed  to  link  with
-              AdaCurses.
-
-       --version
-              echos  the release+patchdate version of the ncurses
-              libraries used to configure and build AdaCurses.
-
-       --help prints a  list  of  the  adacurses-config  script's
-              options.
-
-
-
-

SEE ALSO

-       curses(3x)
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                           ADACURSES(1)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html deleted file mode 100644 index aeacdd39cab..00000000000 --- a/doc/html/man/captoinfo.1m.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - -captoinfo 1m - - - - -

captoinfo 1m

-
-
-
-captoinfo(1m)                                             captoinfo(1m)
-
-
-
-
-
-

NAME

-       captoinfo  - convert a termcap description into a terminfo
-       description
-
-
-
-

SYNOPSIS

-       captoinfo [-vn width]  [-V] [-1] [-w width] file . . .
-
-
-
-

DESCRIPTION

-       captoinfo looks  in  each  given  text  file  for  termcap
-       descriptions.   For each one found, an equivalent terminfo
-       description is written to  standard  output.   Termcap  tc
-       capabilities are translated directly to terminfo use capa-
-       bilities.
-
-       If no file is given, then the environment variable TERMCAP
-       is  used  for the filename or entry.  If TERMCAP is a full
-       pathname to a file, only the terminal whose name is speci-
-       fied  in  the  environment variable TERM is extracted from
-       that file.  If the environment  variable  TERMCAP  is  not
-       set, then the file /usr/share/terminfo is read.
-
-       -v   print  out  tracing  information on standard error as
-            the program runs.
-
-       -V   print out the version of the program in use on  stan-
-            dard error and exit.
-
-       -1   cause  the fields to print out one to a line.  Other-
-            wise, the fields will be printed several to a line to
-            a maximum width of 60 characters.
-
-       -w   change the output to width characters.
-
-
-
-

FILES

-       /usr/share/terminfo Compiled      terminal     description
-                           database.
-
-
-
-

TRANSLATIONS FROM NONSTANDARD CAPABILITIES

-       Some obsolete nonstandard capabilities will  automatically
-       be  translated  into  standard  (SVr4/XSI Curses) terminfo
-       capabilities by captoinfo.  Whenever one  of  these  auto-
-       matic  translations  is  done,  the  program will issue an
-       notification to stderr, inviting the user to check that it
-       has  not  mistakenly  translated  a completely unknown and
-       random capability and/or syntax error.
-
-
-       Nonstd   Std    From           Terminfo
-        name    name                 capability
-       -----------------------------------------------
-       BO       mr     AT&T    enter_reverse_mode
-       CI       vi     AT&T    cursor_invisible
-       CV       ve     AT&T    cursor_normal
-       DS       mh     AT&T    enter_dim_mode
-       EE       me     AT&T    exit_attribute_mode
-       FE       LF     AT&T    label_on
-       FL       LO     AT&T    label_off
-       XS       mk     AT&T    enter_secure_mode
-       EN       @7     XENIX   key_end
-       GE       ae     XENIX   exit_alt_charset_mode
-       GS       as     XENIX   enter_alt_charset_mode
-
-       HM       kh     XENIX   key_home
-       LD       kL     XENIX   key_dl
-       PD       kN     XENIX   key_npage
-       PN       po     XENIX   prtr_off
-       PS       pf     XENIX   prtr_on
-       PU       kP     XENIX   key_ppage
-       RT       @8     XENIX   kent
-       UP       ku     XENIX   kcuu1
-       KA       k;     Tek     key_f10
-       KB       F1     Tek     key_f11
-       KC       F2     Tek     key_f12
-       KD       F3     Tek     key_f13
-       KE       F4     Tek     key_f14
-       KF       F5     Tek     key_f15
-       BC       Sb     Tek     set_background
-       FC       Sf     Tek     set_foreground
-       HS       mh     Iris    enter_dim_mode
-
-       XENIX termcap also used to have a set of  extension  capa-
-       bilities  for forms drawing, designed to take advantage of
-       the IBM PC high-half graphics.  They were as follows:
-
-
-       Cap          Graphic
-       -----------------------------
-       G2    upper left
-       G3    lower left
-       G1    upper right
-       G4    lower right
-       GR    pointing right
-       GL    pointing left
-       GU    pointing up
-       GD    pointing down
-       GH    horizontal line
-       GV    vertical line
-       GC    intersection
-       G6    upper left
-       G7    lower left
-       G5    upper right
-       G8    lower right
-       Gr    tee pointing right
-       Gr    tee pointing left
-       Gu    tee pointing up
-       Gd    tee pointing down
-       Gh    horizontal line
-       Gv    vertical line
-       Gc    intersection
-       GG    acs magic cookie count
-
-       If the single-line capabilities occur in  an  entry,  they
-       will  automatically  be composed into an acsc string.  The
-       double-line capabilities and GG are discarded with a warn-
-       ing message.
-
-       IBM's AIX has a terminfo facility descended from SVr1 ter-
-       minfo but incompatible with the SVr4 format.  The  follow-
-       ing AIX extensions are automatically translated:
-
-        IBM    XSI
-       -------------
-       ksel    kslt
-       kbtab   kcbt
-       font0   s0ds
-       font1   s1ds
-       font2   s2ds
-
-       font3   s3ds
-
-       Additionally,  the  AIX  box1 capability will be automati-
-       cally translated to an acsc string.
-
-       Hewlett-Packard's terminfo library supports  two  nonstan-
-       dard  terminfo  capabilities  meml  (memory lock) and memu
-       (memory unlock).  These will be discarded with  a  warning
-       message.
-
-
-
-

NOTES

-       This  utility is actually a link to tic(1m), running in -I
-       mode.  You can use other tic options such as -f and  -x.
-
-       The trace option is not identical to SVr4's.  Under  SVr4,
-       instead  of  following  the  -v  with a trace level n, you
-       repeat it n times.
-
-
-
-

SEE ALSO

-       infocmp(1m), curses(3x), terminfo(5)
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-

AUTHOR

-       Eric S. Raymond <esr@snark.thyrsus.com> and
-       Thomas E. Dickey <dickey@invisible-island.net>
-
-
-
-                                                          captoinfo(1m)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html deleted file mode 100644 index 138806fc487..00000000000 --- a/doc/html/man/clear.1.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - -clear 1 - - - - -

clear 1

-
-
-
-clear(1)                                                       clear(1)
-
-
-
-
-
-

NAME

-       clear - clear the terminal screen
-
-
-
-

SYNOPSIS

-       clear
-
-
-
-

DESCRIPTION

-       clear clears your screen if this is possible.  It looks in
-       the environment for the terminal type and then in the ter-
-       minfo database to figure out how to clear the screen.
-
-       clear  ignores  any  command-line  parameters  that may be
-       present.
-
-
-
-

SEE ALSO

-       tput(1), terminfo(5)
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                               clear(1)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_add_wch.3x.html b/doc/html/man/curs_add_wch.3x.html deleted file mode 100644 index 77ed34d591b..00000000000 --- a/doc/html/man/curs_add_wch.3x.html +++ /dev/null @@ -1,232 +0,0 @@ - - - - -curs_add_wch 3x - - - - -

curs_add_wch 3x

-
-
-
-curs_add_wch(3x)                                       curs_add_wch(3x)
-
-
-
-
-
-

NAME

-       add_wch,   wadd_wch,  mvadd_wch,  mvwadd_wch,  echo_wchar,
-       wecho_wchar - add a complex character and rendition  to  a
-       curses window, then advance the cursor
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int add_wch( const cchar_t *wch );
-       int wadd_wch( WINDOW *win, const cchar_t *wch );
-       int mvadd_wch( int y, int x, const cchar_t *wch );
-       int  mvwadd_wch(  WINDOW *win, int y, int x, const cchar_t
-       *wch );
-       int echo_wchar( const cchar_t *wch );
-       int wecho_wchar( WINDOW *win, const cchar_t *wch );
-
-
-
-

DESCRIPTION

-       The add_wch, wadd_wch, mvadd_wch, and mvwadd_wch functions
-       put the complex character wch into the given window at its
-       current position, which is then advanced.  These functions
-       perform  wrapping and special-character processing as fol-
-       lows:
-
-       o   If wch refers to a spacing character, then any  previ-
-           ous  character  at  that  location  is removed.  A new
-           character specified by wch is placed at that  location
-           with  rendition  specified  by  wch.   The cursor then
-           advances to the next spacing character on the  screen.
-
-       o   If wch refers to a non-spacing character, all previous
-           characters at that location are preserved.   The  non-
-           spacing  characters  of  wch  are added to the spacing
-           complex character, and the rendition specified by  wch
-           is ignored.
-
-       o   If  the  character  part  of  wch  is  a tab, newline,
-           backspace or other control character,  the  window  is
-           updated  and the cursor moves as if addch were called.
-
-       The echo_wchar function is functionally  equivalent  to  a
-       call to add_wch followed by a call to refresh.  Similarly,
-       the wecho_wchar is functionally equivalent to  a  call  to
-       wadd_wch  followed  by  a call to wrefresh.  The knowledge
-       that only a single character is being output is taken into
-       consideration and, for non-control characters, a consider-
-       able performance gain might be seen by  using  the  *echo*
-       functions instead of their equivalents.
-
-   Line Graphics
-       Like  addch(3x),  addch_wch  accepts symbols which make it
-       simple to draw lines and  other  frequently  used  special
-       characters.   These  symbols  correspond to the same VT100
-       line-drawing set as addch(3x).
-
-
-       Name              Unicode    Default   Description
-       ----------------------------------------------------------------
-       WACS_BLOCK        0x25ae     #         solid square block
-       WACS_BOARD        0x2592     #         board of squares
-       WACS_BTEE         0x2534     +         bottom tee
-       WACS_BULLET       0x00b7     o         bullet
-
-       WACS_CKBOARD      0x2592     :         checker board (stipple)
-       WACS_DARROW       0x2193     v         arrow pointing down
-       WACS_DEGREE       0x00b0     '         degree symbol
-       WACS_DIAMOND      0x25c6     +         diamond
-       WACS_GEQUAL       0x2265     >         greater-than-or-equal-to
-       WACS_HLINE        0x2500     -         horizontal line
-       WACS_LANTERN      0x2603     #         lantern symbol
-       WACS_LARROW       0x2190     <         arrow pointing left
-       WACS_LEQUAL       0x2264     <         less-than-or-equal-to
-       WACS_LLCORNER     0x2514     +         lower left-hand corner
-       WACS_LRCORNER     0x2518     +         lower right-hand corner
-       WACS_LTEE         0x2524     +         left tee
-       WACS_NEQUAL       0x2260     !         not-equal
-       WACS_PI           0x03c0     *         greek pi
-       WACS_PLMINUS      0x00b1     #         plus/minus
-       WACS_PLUS         0x253c     +         plus
-       WACS_RARROW       0x2192     >         arrow pointing right
-       WACS_RTEE         0x251c     +         right tee
-       WACS_S1           0x23ba     -         scan line 1
-       WACS_S3           0x23bb     -         scan line 3
-       WACS_S7           0x23bc     -         scan line 7
-       WACS_S9           0x23bd     _         scan line 9
-       WACS_STERLING     0x00a3     f         pound-sterling symbol
-       WACS_TTEE         0x252c     +         top tee
-       WACS_UARROW       0x2191     ^         arrow pointing up
-       WACS_ULCORNER     0x250c     +         upper left-hand corner
-       WACS_URCORNER     0x2510     +         upper right-hand corner
-       WACS_VLINE        0x2502     |         vertical line
-
-       The wide-character configuration of ncurses  also  defines
-       symbols for thick- and double-lines:
-
-
-       Name              Unicode   Default   Description
-       ---------------------------------------------------------------------
-       WACS_T_ULCORNER   0x250f    +         thick upper left corner
-       WACS_T_LLCORNER   0x2517    +         thick lower left corner
-       WACS_T_URCORNER   0x2513    +         thick upper right corner
-       WACS_T_LRCORNER   0x251b    +         thick lower right corner
-       WACS_T_LTEE       0x252b    +         thick tee pointing right
-       WACS_T_RTEE       0x2523    +         thick tee pointing left
-       WACS_T_BTEE       0x253b    +         thick tee pointing up
-       WACS_T_TTEE       0x2533    +         thick tee pointing down
-       WACS_T_HLINE      0x2501    -         thick horizontal line
-       WACS_T_VLINE      0x2503    |         thick vertical line
-       WACS_T_PLUS       0x254b    +         thick large plus or crossover
-       WACS_D_ULCORNER   0x2554    +         double upper left corner
-       WACS_D_LLCORNER   0x255a    +         double lower left corner
-       WACS_D_URCORNER   0x2557    +         double upper right corner
-       WACS_D_LRCORNER   0x255d    +         double lower right corner
-       WACS_D_RTEE       0x2563    +         double tee pointing left
-       WACS_D_LTEE       0x2560    +         double tee pointing right
-       WACS_D_BTEE       0x2569    +         double tee pointing up
-       WACS_D_TTEE       0x2566    +         double tee pointing down
-       WACS_D_HLINE      0x2550    -         double horizontal line
-       WACS_D_VLINE      0x2551    |         double vertical line
-       WACS_D_PLUS       0x256c    +         double large plus or crossover
-
-
-
-

RETURN VALUES

-       All routines return the integer ERR upon failure and OK on
-       success.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that add_wch, mvadd_wch, mvwadd_wch,  and  echo_wchar
-       may be macros.
-
-
-
-

PORTABILITY

-       All  of  these  functions  are described in the XSI Curses
-       standard, Issue 4.  The defaults specified for  line-draw-
-       ing characters apply in the POSIX locale.
-
-       X/Open Curses makes it clear that the WACS_ symbols should
-       be defined as a pointer to cchar_t data, e.g., in the dis-
-       cussion of border_set.  A few implementations are problem-
-       atic:
-
-       o   NetBSD curses defines the symbols as a wchar_t  within
-           a cchar_t.
-
-       o   HPUX  curses  equates  some of the ACS_ symbols to the
-           analogous WACS_ symbols as if the  ACS_  symbols  were
-           wide  characters.   The  misdefined  symbols  are  the
-           arrows and other symbols which are not used for  line-
-           drawing.
-
-       X/Open  Curses  does not define symbols for thick- or dou-
-       ble-lines.   SVr4  curses  implementations  defined  their
-       line-drawing  symbols  in  terms  of intermediate symbols.
-       This implementation extends those symbols,  providing  new
-       definitions which are not in the SVr4 implementations.
-
-
-
-

SEE ALSO

-       curses(3x), curs_addch(3x), curs_attr(3x), curs_clear(3x),
-       curs_outopts(3x), curs_refresh(3x), putwc(3)
-
-
-
-                                                       curs_add_wch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_add_wchstr.3x.html b/doc/html/man/curs_add_wchstr.3x.html deleted file mode 100644 index 0f676ce3a15..00000000000 --- a/doc/html/man/curs_add_wchstr.3x.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - -curs_add_wchstr 3x - - - - -

curs_add_wchstr 3x

-
-
-
-curs_add_wchstr(3x)                                 curs_add_wchstr(3x)
-
-
-
-
-
-

NAME

-       add_wchstr,    add_wchnstr,   wadd_wchstr,   wadd_wchnstr,
-       mvadd_wchstr, mvadd_wchnstr, mvwadd_wchstr, mvwadd_wchnstr
-       - add an array of complex characters (and attributes) to a
-       curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int add_wchstr(const cchar_t *wchstr);
-       int add_wchnstr(const cchar_t *wchstr, int n);
-       int wadd_wchstr(WINDOW * win, const cchar_t *wchstr);
-       int wadd_wchnstr(WINDOW * win, const cchar_t *wchstr, int n);
-       int mvadd_wchstr(int y, int x, const cchar_t *wchstr);
-       int mvadd_wchnstr(int y, int x, const cchar_t *wchstr, int n);
-       int mvwadd_wchstr(WINDOW *win, int y, int x, const cchar_t *wchstr);
-       int mvwadd_wchnstr(WINDOW *win, int y, int x, const cchar_t *wchstr, int n);
-
-
-
-

DESCRIPTION

-       These routines copy the array of complex characters wchstr
-       into  the  window image structure at and after the current
-       cursor position.  The four routines with  n  as  the  last
-       argument  copy  at  most n elements, but no more than will
-       fit on the line.  If n=-1 then the whole array is  copied,
-       to  the  maximum number of characters that will fit on the
-       line.
-
-       The window cursor is not advanced.   These  routines  work
-       faster than waddnstr.  On the other hand, they do not per-
-       form checking (such as for the newline, backspace, or car-
-       riage  return characters), they do not advance the current
-       cursor position, they do not expand other control  charac-
-       ters  to  ^-escapes,  and  they  truncate the string if it
-       crosses the right margin, rather than wrapping  it  around
-       to the new line.
-
-       These  routines  end  successfully  on encountering a null
-       cchar_t, or when they have filled the current line.  If  a
-       complex  character cannot completely fit at the end of the
-       current line, the remaining columns are  filled  with  the
-       background character and rendition.
-
-
-
-

NOTES

-       All functions except wadd_wchnstr may be macros.
-
-
-
-

RETURN VALUES

-       All routines return the integer ERR upon failure and OK on
-       success.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

PORTABILITY

-       All these entry points are described  in  the  XSI  Curses
-       standard, Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x), curs_addchstr(3x), curs_addwstr(3x)
-
-
-
-                                                    curs_add_wchstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_addch.3x.html b/doc/html/man/curs_addch.3x.html deleted file mode 100644 index af567118c69..00000000000 --- a/doc/html/man/curs_addch.3x.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - -curs_addch 3x - - - - -

curs_addch 3x

-
-
-
-curs_addch(3x)                                           curs_addch(3x)
-
-
-
-
-
-

NAME

-       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
-       add a character (with attributes) to a curses window, then
-       advance the cursor
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int addch(const chtype ch);
-       int waddch(WINDOW *win, const chtype ch);
-       int mvaddch(int y, int x, const chtype ch);
-       int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
-       int echochar(const chtype ch);
-       int wechochar(WINDOW *win, const chtype ch);
-
-
-
-

DESCRIPTION

-       The  addch,  waddch, mvaddch and mvwaddch routines put the
-       character ch into the given window at its  current  window
-       position,  which  is then advanced.  They are analogous to
-       putchar in stdio(3).  If the advance is at the right  mar-
-       gin,  the  cursor  automatically wraps to the beginning of
-       the next line.  At the bottom  of  the  current  scrolling
-       region,  if  scrollok  is enabled, the scrolling region is
-       scrolled up one line.
-
-       If ch is a tab, newline, or backspace, the cursor is moved
-       appropriately within the window.  Backspace moves the cur-
-       sor one character left; at the left edge of  a  window  it
-       does  nothing.   Newline  does  a clrtoeol, then moves the
-       cursor to  the  window  left  margin  on  the  next  line,
-       scrolling  the  window if on the last line.  Tabs are con-
-       sidered to be at every eighth column.   The  tab  interval
-       may be altered by setting the TABSIZE variable.
-
-       If ch is any control character other than tab, newline, or
-       backspace, it is drawn  in  ^X  notation.   Calling  winch
-       after adding a control character does not return the char-
-       acter itself, but instead returns the ^-representation  of
-       the control character.
-
-       Video attributes can be combined with a character argument
-       passed to addch or related functions by logical-ORing them
-       into  the  character.   (Thus, text, including attributes,
-       can be copied from one place to  another  using  inch  and
-       addch.)   See  the curs_attr(3x) page for values of prede-
-       fined video attribute constants that can be usefully OR'ed
-       into characters.
-
-       The  echochar  and  wechochar routines are equivalent to a
-       call to addch followed by a call to refresh, or a call  to
-       waddch followed by a call to wrefresh.  The knowledge that
-       only a single character is being output is used  and,  for
-       non-control  characters,  a  considerable performance gain
-       may be seen by  using  these  routines  instead  of  their
-       equivalents.
-
-   Line Graphics
-       The  following  variables  may be used to add line drawing
-       characters to the screen with routines of the  addch  fam-
-       ily.   The  default  character listed below is used if the
-       acsc  capability  does  not  define  a   terminal-specific
-       replacement  for  it.   The  names  are  taken  from VT100
-       nomenclature.
-
-
-       Name           Default   Description
-       --------------------------------------------------
-       ACS_BLOCK      #         solid square block
-       ACS_BOARD      #         board of squares
-       ACS_BTEE       +         bottom tee
-       ACS_BULLET     o         bullet
-       ACS_CKBOARD    :         checker board (stipple)
-       ACS_DARROW     v         arrow pointing down
-       ACS_DEGREE     '         degree symbol
-       ACS_DIAMOND    +         diamond
-       ACS_GEQUAL     >         greater-than-or-equal-to
-       ACS_HLINE      -         horizontal line
-       ACS_LANTERN    #         lantern symbol
-       ACS_LARROW     <         arrow pointing left
-       ACS_LEQUAL     <         less-than-or-equal-to
-       ACS_LLCORNER   +         lower left-hand corner
-       ACS_LRCORNER   +         lower right-hand corner
-       ACS_LTEE       +         left tee
-       ACS_NEQUAL     !         not-equal
-       ACS_PI         *         greek pi
-       ACS_PLMINUS    #         plus/minus
-       ACS_PLUS       +         plus
-       ACS_RARROW     >         arrow pointing right
-       ACS_RTEE       +         right tee
-       ACS_S1         -         scan line 1
-       ACS_S3         -         scan line 3
-       ACS_S7         -         scan line 7
-       ACS_S9         _         scan line 9
-       ACS_STERLING   f         pound-sterling symbol
-       ACS_TTEE       +         top tee
-       ACS_UARROW     ^         arrow pointing up
-       ACS_ULCORNER   +         upper left-hand corner
-       ACS_URCORNER   +         upper right-hand corner
-       ACS_VLINE      |         vertical line
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon failure and OK on
-       success  (the  SVr4 manuals specify only "an integer value
-       other than ERR") upon successful completion, unless other-
-       wise noted in the preceding routine descriptions.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note  that  addch,  mvaddch, mvwaddch, and echochar may be
-       macros.
-
-
-
-

PORTABILITY

-       All these functions are described in the XSI Curses  stan-
-       dard,  Issue  4.  The defaults specified for forms-drawing
-       characters apply in the POSIX locale.
-
-       X/Open Curses states that the ACS_  definitions  are  char
-       constants.   For  the  wide-character  implementation (see
-       curs_add_wch), there are analogous WACS_ definitions which
-       are cchar_t constants.
-
-       Some  ACS symbols (ACS_S3, ACS_S7, ACS_LEQUAL, ACS_GEQUAL,
-       ACS_PI, ACS_NEQUAL, ACS_STERLING) were not  documented  in
-       any  publicly  released  System V.  However, many publicly
-       available terminfos include acsc strings  in  which  their
-       key  characters  (pryz{|}) are embedded, and a second-hand
-       list of their character descriptions has  come  to  light.
-       The   ACS-prefixed   names  for  them  were  invented  for
-       ncurses(3x).
-
-       The TABSIZE variable is implemented in  some  versions  of
-       curses, but is not part of X/Open curses.
-
-       If  ch  is  a  carriage return, the cursor is moved to the
-       beginning of the current row of the window.  This is  true
-       of other implementations, but is not documented.
-
-
-
-

SEE ALSO

-       curses(3x),  curs_attr(3x), curs_clear(3x), curs_inch(3x),
-       curs_outopts(3x),  curs_refresh(3x),   curs_variables(3x),
-       putc(3).
-
-       Comparable  functions  in  the  wide-character  (ncursesw)
-       library are described in curs_add_wch(3x).
-
-
-
-                                                         curs_addch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_addchstr.3x.html b/doc/html/man/curs_addchstr.3x.html deleted file mode 100644 index e8861399946..00000000000 --- a/doc/html/man/curs_addchstr.3x.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - -curs_addchstr 3x - - - - -

curs_addchstr 3x

-
-
-
-curs_addchstr(3x)                                     curs_addchstr(3x)
-
-
-
-
-
-

NAME

-       addchstr, addchnstr, waddchstr, waddchnstr, mvaddchstr,
-       mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a string of
-       characters (and attributes) to a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int addchstr(const chtype *chstr);
-       int addchnstr(const chtype *chstr, int n);
-       int waddchstr(WINDOW *win, const chtype *chstr);
-       int waddchnstr(WINDOW *win, const chtype *chstr, int n);
-       int mvaddchstr(int y, int x, const chtype *chstr);
-       int mvaddchnstr(int y, int x, const chtype *chstr, int n);
-       int  mvwaddchstr(WINDOW  *win,  int y, int x, const chtype
-       *chstr);
-       int mvwaddchnstr(WINDOW *win, int y, int x,  const  chtype
-       *chstr, int n);
-
-
-
-

DESCRIPTION

-       These  routines copy chstr into the window image structure
-       at and after the current cursor position.  The  four  rou-
-       tines with n as the last argument copy at most n elements,
-       but no more than will fit on the line.  If n=-1  then  the
-       whole  string  is copied, to the maximum number of charac-
-       ters that will fit on the line.
-
-       The window cursor is not advanced, and these routines work
-       faster than waddnstr.  On the other hand, they do not per-
-       form any kind  of  checking  (such  as  for  the  newline,
-       backspace, or carriage return characters), they do not ad-
-       vance the current cursor position, they do not expand oth-
-       er  control characters to ^-escapes, and they truncate the
-       string if it crosses the right margin, rather  than  wrap-
-       ping it around to the new line.
-
-
-
-

RETURN VALUES

-       All routines return the integer ERR upon failure and OK on
-       success (the SVr4 manuals specify only "an  integer  value
-       other than ERR") upon successful completion, unless other-
-       wise noted in the preceding routine descriptions.
-
-       X/Open does not define any error conditions.  This  imple-
-       mentation returns an error if the window pointer is null.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that all routines except waddchnstr may be macros.
-
-
-
-

PORTABILITY

-       These  entry  points are described in the XSI Curses stan-
-       dard, Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x).
-
-       Comparable functions in the wide-character (ncursesw)  li-
-       brary are described in curs_add_wchstr(3x).
-
-
-
-                                                      curs_addchstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_addstr.3x.html b/doc/html/man/curs_addstr.3x.html deleted file mode 100644 index d89503cc8bc..00000000000 --- a/doc/html/man/curs_addstr.3x.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - -curs_addstr 3x - - - - -

curs_addstr 3x

-
-
-
-curs_addstr(3x)                                         curs_addstr(3x)
-
-
-
-
-
-

NAME

-       addstr, addnstr, waddstr, waddnstr, mvaddstr, mvaddnstr,
-       mvwaddstr, mvwaddnstr - add a string of characters to a
-       curses window and advance cursor
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int addstr(const char *str);
-       int addnstr(const char *str, int n);
-       int waddstr(WINDOW *win, const char *str);
-       int waddnstr(WINDOW *win, const char *str, int n);
-       int mvaddstr(int y, int x, const char *str);
-       int mvaddnstr(int y, int x, const char *str, int n);
-       int mvwaddstr(WINDOW *win, int y, int x, const char *str);
-       int mvwaddnstr(WINDOW *win, int y, int x, const char *str, int n);
-
-
-
-

DESCRIPTION

-       These routines write the characters of the (null-terminat-
-       ed) character string str on the given window.  It is simi-
-       lar  to  calling  waddch  once  for  each character in the
-       string.  The four routines with n  as  the  last  argument
-       write  at  most n characters.  If n is -1, then the entire
-       string will be added, up to the maximum number of  charac-
-       ters  that  will  fit  on the line, or until a terminating
-       null is reached.
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon failure and OK on
-       success  (the  SVr4 manuals specify only "an integer value
-       other than ERR") upon successful completion.
-
-       X/Open does not define any error conditions.  This  imple-
-       mentation  returns  an error if the window pointer is null
-       or if the string pointer is null or if  the  corresponding
-       calls to waddch return an error.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note  that  all  of  these  routines  except  waddstr  and
-       waddnstr may be macros.
-
-
-
-

PORTABILITY

-       All these entry points are described  in  the  XSI  Curses
-       standard,  Issue  4.  The XSI errors EILSEQ and EOVERFLOW,
-       associated with extended-level conformance,  are  not  yet
-       detected.
-
-
-
-

SEE ALSO

-       curses(3x), curs_addch(3x).
-
-
-
-                                                        curs_addstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_addwstr.3x.html b/doc/html/man/curs_addwstr.3x.html deleted file mode 100644 index 99ab802ec68..00000000000 --- a/doc/html/man/curs_addwstr.3x.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - -curs_addwstr 3x - - - - -

curs_addwstr 3x

-
-
-
-curs_addwstr(3x)                                       curs_addwstr(3x)
-
-
-
-
-
-

NAME

-       addwstr, addnwstr, waddwstr, waddnwstr, mvaddwstr,
-       mvaddnwstr, mvwaddwstr, mvwaddnwstr - add a string of wide
-       characters to a curses window and advance cursor
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int addwstr(const wchar_t *wstr);
-       int addnwstr(const wchar_t *wstr, int n);
-       int waddwstr(WINDOW *win, const wchar_t *wstr);
-       int waddnwstr(WINDOW *win, const wchar_t *wstr, int n);
-       int mvaddwstr(int y, int x, const wchar_t *wstr);
-       int mvaddnwstr(int y, int x, const wchar_t *wstr, int n);
-       int mvwaddwstr(WINDOW *win, int y, int x, const wchar_t *wstr);
-       int mvwaddnwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
-
-
-
-

DESCRIPTION

-       These routines write the characters of the (null-terminat-
-       ed) wchar_t character string wstr on the given window.  It
-       is  similar  to constructing a cchar_t for each wchar_t in
-       the  string,  then  calling  wadd_wch  for  the  resulting
-       cchar_t.
-
-       The mv routines perform cursor movement once, before writ-
-       ing any characters.  Thereafter, the cursor is advanced as
-       a side-effect of writing to the window.
-
-       The  four  routines  with  n as the last argument write at
-       most n wchar_t characters.  If n is -1,  then  the  entire
-       string  will be added, up to the maximum number of charac-
-       ters that will fit on the line,  or  until  a  terminating
-       null is reached.
-
-
-
-

RETURN VALUES

-       All routines return the integer ERR upon failure and OK on
-       success.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that all of these routines except  waddnwstr  may  be
-       macros.
-
-
-
-

PORTABILITY

-       All  these  entry  points  are described in the XSI Curses
-       standard, Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x), curs_add_wch(3x)
-
-
-
-                                                       curs_addwstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_attr.3x.html b/doc/html/man/curs_attr.3x.html deleted file mode 100644 index 23a157332e7..00000000000 --- a/doc/html/man/curs_attr.3x.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - -curs_attr 3x - - - - -

curs_attr 3x

-
-
-
-curs_attr(3x)                                             curs_attr(3x)
-
-
-
-
-
-

NAME

-       attroff, wattroff, attron, wattron, attrset, wattrset,
-       color_set, wcolor_set, standend, wstandend, standout,
-       wstandout, attr_get, wattr_get, attr_off, wattr_off,
-       attr_on, wattr_on, attr_set, wattr_set, chgat, wchgat,
-       mvchgat, mvwchgat, PAIR_NUMBER - curses character and
-       window attribute control routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       int attroff(int attrs);
-       int wattroff(WINDOW *win, int attrs);
-       int attron(int attrs);
-       int wattron(WINDOW *win, int attrs);
-       int attrset(int attrs);
-       int wattrset(WINDOW *win, int attrs);
-       int color_set(short color_pair_number, void* opts);
-       int wcolor_set(WINDOW *win, short color_pair_number,
-             void* opts);
-       int standend(void);
-       int wstandend(WINDOW *win);
-       int standout(void);
-       int wstandout(WINDOW *win);
-       int attr_get(attr_t *attrs, short *pair, void *opts);
-       int wattr_get(WINDOW *win, attr_t *attrs, short *pair,
-              void *opts);
-       int attr_off(attr_t attrs, void *opts);
-       int wattr_off(WINDOW *win, attr_t attrs, void *opts);
-       int attr_on(attr_t attrs, void *opts);
-       int wattr_on(WINDOW *win, attr_t attrs, void *opts);
-       int attr_set(attr_t attrs, short pair, void *opts);
-       int wattr_set(WINDOW *win, attr_t attrs, short pair,  void
-       *opts);
-       int chgat(int n, attr_t attr, short color,
-             const void *opts)
-       int wchgat(WINDOW *win, int n, attr_t attr,
-             short color, const void *opts)
-       int mvchgat(int y, int x, int n, attr_t attr,
-             short color, const void *opts)
-       int mvwchgat(WINDOW *win, int y, int x, int n,
-             attr_t attr, short color, const void *opts)
-
-
-
-

DESCRIPTION

-       These  routines  manipulate  the current attributes of the
-       named window.  The current attributes of a window apply to
-       all characters that are written into the window with wadd-
-       ch, waddstr and wprintw.  Attributes are a property of the
-       character,   and  move  with  the  character  through  any
-       scrolling and insert/delete line/character operations.  To
-       the  extent  possible,  they  are displayed as appropriate
-       modifications to the graphic rendition of  characters  put
-       on the screen.
-
-       The  routine  attrset  sets  the current attributes of the
-       given window to attrs.  The routine attroff turns off  the
-       named  attributes  without turning any other attributes on
-       or off.  The routine attron turns on the named  attributes
-       without affecting any others.  The routine standout is the
-       same as attron(A_STANDOUT).  The routine standend  is  the
-       same as attrset(A_NORMAL) or attrset(0), that is, it turns
-       off all attributes.
-
-       The attrset and related routines do  not  affect  the  at-
-       tributes  used  when  erasing portions of the window.  See
-       curs_bkgd(3x) for functions which  modify  the  attributes
-       used for erasing and clearing.
-
-       The  routine color_set sets the current color of the given
-       window to the foreground/background combination  described
-       by  the  color_pair_number. The parameter opts is reserved
-       for future use, applications must supply a null pointer.
-
-       The routine wattr_get returns the  current  attribute  and
-       color pair for the given window; attr_get returns the cur-
-       rent attribute and color pair for stdscr.   The  remaining
-       attr_*  functions  operate  exactly like the corresponding
-       attr* functions, except that they take arguments  of  type
-       attr_t rather than int.
-
-       The routine chgat changes the attributes of a given number
-       of characters starting at the current cursor  location  of
-       stdscr.   It  does not update the cursor and does not per-
-       form wrapping.  A character count of -1  or  greater  than
-       the  remaining window width means to change attributes all
-       the way to the end of the current line.  The wchgat  func-
-       tion generalizes this to any window; the mvwchgat function
-       does a cursor move before acting.  In these functions, the
-       color  argument is a color-pair index (as in the first ar-
-       gument of init_pair, see curs_color(3x)).  The opts  argu-
-       ment is not presently used, but is reserved for the future
-       (leave it NULL).
-
-   Attributes
-       The following video attributes, defined in <curses.h>, can
-       be passed to the routines attron, attroff, and attrset, or
-       OR'd with the characters passed to addch.
-
-
-        A_NORMAL        Normal display (no highlight)
-        A_STANDOUT      Best highlighting mode of the terminal.
-        A_UNDERLINE     Underlining
-        A_REVERSE       Reverse video
-        A_BLINK         Blinking
-        A_DIM           Half bright
-        A_BOLD          Extra bright or bold
-        A_PROTECT       Protected mode
-        A_INVIS         Invisible or blank mode
-        A_ALTCHARSET    Alternate character set
-        A_CHARTEXT      Bit-mask to extract a character
-        COLOR_PAIR(n)   Color-pair number n
-
-       The following macro is the reverse of COLOR_PAIR(n):
-
-       PAIR_NUMBER(attrs) Returns the pair number associated
-                          with the COLOR_PAIR(n) attribute.
-
-       The return values of many of these routines are not  mean-
-       ingful (they are implemented as macro-expanded assignments
-       and simply return their argument).  The SVr4  manual  page
-       claims (falsely) that these routines always return 1.
-
-
-
-

NOTES

-       Note  that  attroff,  wattroff,  attron, wattron, attrset,
-       wattrset, standend and standout may be macros.
-
-       COLOR_PAIR values can only be OR'd with attributes if  the
-       pair  number  is  less  than 256.  The alternate functions
-       such as color_set can pass a color  pair  value  directly.
-       However,  ncurses  ABI 4 and 5 simply OR this value within
-       the alternate functions.  You must use ncurses  ABI  6  to
-       support more than 256 color pairs.
-
-
-
-

PORTABILITY

-       These  functions are supported in the XSI Curses standard,
-       Issue 4.  The standard  defined  the  dedicated  type  for
-       highlights,  attr_t,  which is not defined in SVr4 curses.
-       The functions taking attr_t arguments  are  not  supported
-       under SVr4.
-
-       The XSI Curses standard states that whether the tradition-
-       al functions  attron/attroff/attrset  can  manipulate  at-
-       tributes  other  than  A_BLINK,  A_BOLD, A_DIM, A_REVERSE,
-       A_STANDOUT, or A_UNDERLINE is "unspecified".   Under  this
-       implementation  as  well  as  SVr4 curses, these functions
-       correctly manipulate all other  highlights  (specifically,
-       A_ALTCHARSET, A_PROTECT, and A_INVIS).
-
-       XSI  Curses added the new entry points, attr_get, attr_on,
-       attr_off, attr_set, wattr_on, wattr_off,  wattr_get,  wat-
-       tr_set.   These  are intended to work with a new series of
-       highlight macros prefixed with WA_.
-
-       Older versions of this library did not force an update  of
-       the  screen when changing the attributes.  Use touchwin to
-       force the screen to match the updated attributes.
-
-
-        WA_NORMAL       Normal display (no highlight)
-        WA_STANDOUT     Best highlighting mode of the terminal.
-        WA_UNDERLINE    Underlining
-        WA_REVERSE      Reverse video
-        WA_BLINK        Blinking
-        WA_DIM          Half bright
-        WA_BOLD         Extra bright or bold
-        WA_ALTCHARSET   Alternate character set
-
-       The XSI curses standard specifies that each pair of corre-
-       sponding  A_  and WA_-using functions operates on the same
-       current-highlight information.
-
-       The XSI standard extended conformance level adds new high-
-       lights A_HORIZONTAL, A_LEFT, A_LOW, A_RIGHT, A_TOP, A_VER-
-       TICAL (and corresponding WA_ macros for each)  which  this
-       implementation does not yet support.
-
-
-
-

RETURN VALUE

-       All  routines  return the integer OK on success, or ERR on
-       failure.
-
-       X/Open does not define any error conditions.
-
-       This implementation returns an error if the window pointer
-       is  null.  The wcolor_set function returns an error if the
-       color  pair  parameter  is  outside  the   range   0..COL-
-       OR_PAIRS-1.   This  implementation  also provides getattrs
-       for compatibility with older versions of curses.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

SEE ALSO

-       curses(3x),        curs_addch(3x),        curs_addstr(3x),
-       curs_bkgd(3x), curs_printw(3x), curs_variables(3x)
-
-
-
-                                                          curs_attr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_beep.3x.html b/doc/html/man/curs_beep.3x.html deleted file mode 100644 index e450ce29bfb..00000000000 --- a/doc/html/man/curs_beep.3x.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - -curs_beep 3x - - - - -

curs_beep 3x

-
-
-
-curs_beep(3x)                                             curs_beep(3x)
-
-
-
-
-
-

NAME

-       beep, flash - curses bell and screen flash routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int beep(void);
-       int flash(void);
-
-
-
-

DESCRIPTION

-       The beep and flash routines are used to alert the terminal
-       user.  The routine beep sounds an  audible  alarm  on  the
-       terminal,  if  possible;  otherwise  it flashes the screen
-       (visible bell).  The routine flash flashes the screen, and
-       if  that  is  not  possible, sounds the alert.  If neither
-       alert is possible, nothing happens.  Nearly all  terminals
-       have  an  audible  alert (bell or beep), but only some can
-       flash the screen.
-
-
-
-

RETURN VALUE

-       These routines return OK if they  succeed  in  beeping  or
-       flashing, ERR otherwise.
-
-
-
-

EXTENSIONS

-       SVr4's  beep  and flash routines always returned OK, so it
-       was not possible to tell when the beep or flash failed.
-
-
-
-

PORTABILITY

-       These functions are described in the XSI Curses  standard,
-       Issue  4.  Like SVr4, it specifies that they always return
-       OK.
-
-
-
-

SEE ALSO

-       curses(3x)
-
-
-
-                                                          curs_beep(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_bkgd.3x.html b/doc/html/man/curs_bkgd.3x.html deleted file mode 100644 index 56f5cb91c5c..00000000000 --- a/doc/html/man/curs_bkgd.3x.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - -curs_bkgd 3x - - - - -

curs_bkgd 3x

-
-
-
-curs_bkgd(3x)                                             curs_bkgd(3x)
-
-
-
-
-
-

NAME

-       bkgdset,  wbkgdset,  bkgd,  wbkgd, getbkgd - curses window
-       background manipulation routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       void bkgdset(chtype ch);
-       void wbkgdset(WINDOW *win, chtype ch);
-       int bkgd(chtype ch);
-       int wbkgd(WINDOW *win, chtype ch);
-       chtype getbkgd(WINDOW *win);
-
-
-
-

DESCRIPTION

-       The bkgdset and wbkgdset  routines  manipulate  the  back-
-       ground  of  the  named window.  The window background is a
-       chtype consisting of any combination of attributes  (i.e.,
-       rendition)  and  a  character.   The attribute part of the
-       background is combined (OR'ed) with all non-blank  charac-
-       ters  that  are written into the window with waddch.  Both
-       the character and attribute parts of  the  background  are
-       combined   with  the  blank  characters.   The  background
-       becomes a property of the character  and  moves  with  the
-       character   through   any   scrolling   and  insert/delete
-       line/character operations.
-
-       To the extent  possible  on  a  particular  terminal,  the
-       attribute  part  of  the  background  is  displayed as the
-       graphic rendition of the character put on the screen.
-
-       The bkgd and wbkgd functions set the  background  property
-       of  the  current  or  specified window and then apply this
-       setting to every character position in that window:
-
-              The rendition of every character on the  screen  is
-              changed to the new background rendition.
-
-              Wherever  the  former background character appears,
-              it is changed to the new background character.
-
-       The getbkgd function returns the  given  window's  current
-       background character/attribute pair.
-
-
-
-

RETURN VALUE

-       The  routines  bkgd  and wbkgd return the integer OK.  The
-       SVr4.0 manual says "or a non-negative integer  if  immedok
-       is set", but this appears to be an error.
-
-
-
-

NOTES

-       Note that bkgdset and bkgd may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  It specifies that bkgd and wbkgd return  ERR  on
-       failure, but gives no failure conditions.
-
-
-
-

SEE ALSO

-       curses(3x),   curs_addch(3x),   curs_attr(3x),   curs_out-
-       opts(3x)
-
-
-
-                                                          curs_bkgd(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_bkgrnd.3x.html b/doc/html/man/curs_bkgrnd.3x.html deleted file mode 100644 index 5dc6fdb16a2..00000000000 --- a/doc/html/man/curs_bkgrnd.3x.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - -curs_bkgrnd 3x - - - - -

curs_bkgrnd 3x

-
-
-
-curs_bkgrnd(3x)                                         curs_bkgrnd(3x)
-
-
-
-
-
-

NAME

-       bkgrnd,  wbkgrnd,  bkgrndset, wbkgrndset, getbkgrnd, wget-
-       bkgrnd - curses  window  complex  background  manipulation
-       routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int bkgrnd( const cchar_t *wch);
-       int wbkgrnd( WINDOW *win, const cchar_t *wch);
-       void bkgrndset(const cchar_t *wch );
-       void wbkgrndset(WINDOW *win, const cchar_t *wch);
-       int getbkgrnd(cchar_t *wch);
-       int wgetbkgrnd(WINDOW *win, cchar_t *wch);
-
-
-
-

DESCRIPTION

-       The bkgrndset and wbkgrndset routines manipulate the back-
-       ground of the named window.  The window  background  is  a
-       cchar_t consisting of any combination of attributes (i.e.,
-       rendition) and a complex character.  The attribute part of
-       the  background  is  combined  (OR'ed)  with all non-blank
-       characters that are written into the window  with  waddch.
-       Both  the  character and attribute parts of the background
-       are combined with the blank  characters.   The  background
-       becomes  a  property  of  the character and moves with the
-       character  through   any   scrolling   and   insert/delete
-       line/character operations.
-
-       To  the  extent  possible  on  a  particular terminal, the
-       attribute part of  the  background  is  displayed  as  the
-       graphic rendition of the character put on the screen.
-
-       The  bkgrnd and wbkgrnd functions set the background prop-
-       erty of the current or specified  window  and  then  apply
-       this setting to every character position in that window:
-
-              The  rendition  of every character on the screen is
-              changed to the new background rendition.
-
-              Wherever the former background  character  appears,
-              it is changed to the new background character.
-
-       The  getbkgrnd function returns the given window's current
-       background character/attribute pair via the wch pointer.
-
-
-
-

NOTES

-       Note that bkgrnd, bkgrndset, and getbkgrnd may be macros.
-
-
-
-

RETURN VALUES

-       The bkgrndset and wbkgrndset  routines  do  not  return  a
-       value.
-
-       Upon successful completion, the other functions return OK.
-       Otherwise, they return ERR.   A  null  window  pointer  is
-       treated as an error.
-
-
-
-

SEE ALSO

-       curses(3x), curs_bkgd(3x)
-
-
-
-                                                        curs_bkgrnd(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_border.3x.html b/doc/html/man/curs_border.3x.html deleted file mode 100644 index 880d59bca20..00000000000 --- a/doc/html/man/curs_border.3x.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - -curs_border 3x - - - - -

curs_border 3x

-
-
-
-curs_border(3x)                                         curs_border(3x)
-
-
-
-
-
-

NAME

-       border, wborder, box, hline, whline, vline, wvline,
-       mvhline, mvwhline, mvvline, mvwvline - create curses
-       borders, horizontal and vertical lines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       int border(chtype ls, chtype rs, chtype ts, chtype bs,
-          chtype tl, chtype tr, chtype bl, chtype br);
-       int wborder(WINDOW *win, chtype ls, chtype rs,
-          chtype ts, chtype bs, chtype tl, chtype tr,
-          chtype bl, chtype br);
-       int box(WINDOW *win, chtype verch, chtype horch);
-       int hline(chtype ch, int n);
-       int whline(WINDOW *win, chtype ch, int n);
-       int vline(chtype ch, int n);
-       int wvline(WINDOW *win, chtype ch, int n);
-       int mvhline(int y, int x, chtype ch, int n);
-       int mvwhline(WINDOW *, int y, int x, chtype ch, int n);
-       int mvvline(int y, int x, chtype ch, int n);
-       int mvwvline(WINDOW *, int y, int x, chtype ch, int n);
-
-
-
-

DESCRIPTION

-       The border, wborder and box routines draw a box around the
-       edges of a window.  Other than the window,  each  argument
-       is a character with attributes:
-
-              ls - left side,
-              rs - right side,
-              ts - top side,
-              bs - bottom side,
-              tl - top left-hand corner,
-              tr - top right-hand corner,
-              bl - bottom left-hand corner, and
-              br - bottom right-hand corner.
-
-       If  any of these arguments is zero, then the corresponding
-       default values (defined in curses.h) are used instead:
-
-              ACS_VLINE,
-              ACS_VLINE,
-              ACS_HLINE,
-              ACS_HLINE,
-              ACS_ULCORNER,
-              ACS_URCORNER,
-              ACS_LLCORNER,
-              ACS_LRCORNER.
-
-       box(win, verch, horch) is a shorthand  for  the  following
-       call:  wborder(win,  verch,  verch, horch, horch, 0, 0, 0,
-       0).
-
-       The hline and whline functions draw a horizontal (left  to
-       right)  line using ch starting at the current cursor posi-
-       tion in the window.  The current cursor  position  is  not
-       changed.   The  line  is  at most n characters long, or as
-       many as fit into the window.
-
-       The vline and wvline functions draw  a  vertical  (top  to
-       bottom) line using ch starting at the current cursor posi-
-       tion in the window.  The current cursor  position  is  not
-       changed.   The  line  is  at most n characters long, or as
-       many as fit into the window.
-
-
-
-

RETURN VALUE

-       All routines return the integer  OK.   The  SVr4.0  manual
-       says  "or  a  non-negative integer if immedok is set", but
-       this appears to be an error.
-
-       X/Open does not define any error conditions.  This  imple-
-       mentation returns an error if the window pointer is null.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       The  borders  generated by these functions are inside bor-
-       ders (this is also true of SVr4 curses, though the fact is
-       not documented).
-
-       Note that border and box may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  The standard specifies that they return  ERR  on
-       failure, but specifies no error conditions.
-
-
-
-

SEE ALSO

-       curses(3x), curs_outopts(3x).
-
-
-
-                                                        curs_border(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_border_set.3x.html b/doc/html/man/curs_border_set.3x.html deleted file mode 100644 index c64a816c173..00000000000 --- a/doc/html/man/curs_border_set.3x.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - -curs_border_set 3x - - - - -

curs_border_set 3x

-
-
-
-curs_border_set(3x)                                 curs_border_set(3x)
-
-
-
-
-
-

NAME

-       border_set, wborder_set, box_set, hline_set, whline_set,
-       mvhline_set, mvwhline_set, vline_set, wvline_set,
-       mvvline_set, mvwvline_set - create curses borders or lines
-       using complex characters and renditions
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int border_set(
-          const cchar_t *ls, const cchar_t *rs,
-          const cchar_t *ts, const cchar_t *bs,
-          const cchar_t *tl, const cchar_t *tr,
-          const cchar_t *bl, const cchar_t *br );
-       int wborder_set(
-          WINDOW *win,
-          const cchar_t *ls, const cchar_t *rs,
-          const cchar_t *ts, const cchar_t *bs,
-          const cchar_t *tl, const cchar_t *tr,
-          const cchar_t *bl, const cchar_t *br);
-       int box_set(
-          WINDOW *win,
-          const cchar_t *verch,
-          const cchar_t *horch);
-       int hline_set(
-          const cchar_t *wch, int n);
-       int whline_set(
-          WINDOW *win,
-          const cchar_t *wch, int n);
-       int mvhline_set(
-          int y, int x,
-          const cchar_t *wch, int n);
-       int mvwhline_set(
-          WINDOW *win,
-          int y, int x,
-          const cchar_t *wch, int n);
-       int vline_set(
-          const cchar_t *wch, int n);
-       int wvline_set(
-          WINDOW *win,
-          const cchar_t *wch, int n);
-       int mvvline_set(
-          int y, int x,
-          const cchar_t *wch, int n);
-       int mvwvline_set(
-          WINDOW *win,
-          int y, int x,
-          const cchar_t *wch, int n);
-
-
-
-

DESCRIPTION

-       The border_set and wborder_set  functions  draw  a  border
-       around  the  edges  of  the  current  or specified window.
-       These functions do not change the cursor position, and  do
-       not wrap.
-
-       Other  than the window, each argument is a complex charac-
-       ter with attributes:
-              ls - left side,
-              rs - right side,
-              ts - top side,
-              bs - bottom side,
-              tl - top left-hand corner,
-              tr - top right-hand corner,
-              bl - bottom left-hand corner, and
-              br - bottom right-hand corner.
-
-       If any of these arguments is zero, then the  corresponding
-       default values (defined in curses.h) are used instead:
-              WACS_VLINE,
-              WACS_VLINE,
-              WACS_HLINE,
-              WACS_HLINE,
-              WACS_ULCORNER,
-              WACS_URCORNER,
-              WACS_LLCORNER, and
-              WACS_LRCORNER.
-
-       box_set(win, verch, horch); is a shorthand for the follow-
-       ing call:
-
-       wborder_set(win, verch, verch,
-           horch, horch, NULL, NULL, NULL, NULL);
-
-       The *line_set functions use wch to draw a line starting at
-       the current cursor position in the window.  The line is at
-       most n characters long or as many as fit into the  window.
-       The current cursor position is not changed.
-
-       The  hline_set,  mvhline_set, mvwhline_set, and whline_set
-       functions draw a line proceeding toward the last column of
-       the same line.
-
-       The  vline_set,  mvvline_set, mvwvline_set, and wvline_set
-       functions draw a line proceeding toward the last  line  of
-       the window.
-
-
-
-

NOTES

-       Note that border_set, hline_set, mvhline_set, mvvline_set,
-       mvwhline_set, mvwvline_set, and vline_set may be macros.
-
-
-
-

RETURN VALUES

-       Upon successful completion,  these  functions  return  OK.
-       Otherwise, they return ERR.
-
-       Functions  using  a window parameter return an error if it
-       is null.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

SEE ALSO

-       ncurses(3x), curs_add_wch(3x), curs_border(3x),  curs_out-
-       opts(3x)
-
-
-
-                                                    curs_border_set(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_clear.3x.html b/doc/html/man/curs_clear.3x.html deleted file mode 100644 index ca581c2b0b1..00000000000 --- a/doc/html/man/curs_clear.3x.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - -curs_clear 3x - - - - -

curs_clear 3x

-
-
-
-curs_clear(3x)                                           curs_clear(3x)
-
-
-
-
-
-

NAME

-       erase, werase, clear, wclear, clrtobot, wclrtobot,
-       clrtoeol, wclrtoeol - clear all or part of a curses window
-
-
-
-

SYNOPSIS

-       # include <curses.h>
-
-       int erase(void);
-       int werase(WINDOW *win);
-       int clear(void);
-       int wclear(WINDOW *win);
-       int clrtobot(void);
-       int wclrtobot(WINDOW *win);
-       int clrtoeol(void);
-       int wclrtoeol(WINDOW *win);
-
-
-
-

DESCRIPTION

-       The erase and werase routines copy blanks to  every  posi-
-       tion in the window, clearing the screen.
-
-       The  clear  and wclear routines are like erase and werase,
-       but they also call clearok, so that the screen is  cleared
-       completely  on  the  next call to wrefresh for that window
-       and repainted from scratch.
-
-       The clrtobot and wclrtobot routines erase from the  cursor
-       to the end of screen.  That is, they erase all lines below
-       the cursor in the window.  Also, the current line  to  the
-       right of the cursor, inclusive, is erased.
-
-       The clrtoeol and wclrtoeol routines erase the current line
-       to the right of the cursor, inclusive, to the end  of  the
-       current line.
-
-       Blanks created by erasure have the current background ren-
-       dition (as set by wbkgdset) merged into them.
-
-
-
-

RETURN VALUE

-       All routines return the integer OK on success and  ERR  on
-       failure.   The SVr4.0 manual says "or a non-negative inte-
-       ger if immedok is set", but this appears to be an error.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion, functions using a window pointer parameter return an
-       error if it is null.
-
-
-
-

NOTES

-       Note that erase, werase, clear, wclear, clrtobot, and clr-
-       toeol may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  The standard specifies that they return  ERR  on
-       failure, but specifies no error conditions.
-
-       Some  historic  curses  implementations had, as an undocu-
-       mented feature,  the  ability  to  do  the  equivalent  of
-       clearok(...,  1)  by saying touchwin(stdscr) or clear(std-
-       scr).  This will not work under ncurses.
-
-       This implementation, and others such as Solaris, sets  the
-       current  position  to  0,0  after erasing via werase() and
-       wclear().  That fact is not documented in other  implemen-
-       tations, and may not be true of implementations which were
-       not derived from SVr4 source.
-
-       Not obvious from  the  description,  most  implementations
-       clear  the screen after wclear even for a subwindow or de-
-       rived window.  If you do not want to clear the screen dur-
-       ing the next wrefresh, use werase instead.
-
-
-
-

SEE ALSO

-       curses(3x), curs_outopts(3x), curs_refresh(3x), curs_vari-
-       ables(3x)
-
-
-
-                                                         curs_clear(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_color.3x.html b/doc/html/man/curs_color.3x.html deleted file mode 100644 index 39a73184fcc..00000000000 --- a/doc/html/man/curs_color.3x.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - -curs_color 3x - - - - -

curs_color 3x

-
-
-
-curs_color(3x)                                           curs_color(3x)
-
-
-
-
-
-

NAME

-       start_color, init_pair, init_color, has_colors,
-       can_change_color, color_content, pair_content, COLOR_PAIR
-       - curses color manipulation routines
-
-
-
-

SYNOPSIS

-       # include <curses.h>
-
-       int start_color(void);
-       int init_pair(short pair, short f, short b);
-       int init_color(short color, short r, short g, short b);
-       bool has_colors(void);
-       bool can_change_color(void);
-       int  color_content(short  color, short *r, short *g, short
-       *b);
-       int pair_content(short pair, short *f, short *b);
-
-
-
-

DESCRIPTION

-   Overview
-       curses support color attributes on terminals with that ca-
-       pability.   To  use  these  routines  start_color  must be
-       called, usually right after initscr.   Colors  are  always
-       used  in pairs (referred to as color-pairs).  A color-pair
-       consists of a foreground  color  (for  characters)  and  a
-       background color (for the blank field on which the charac-
-       ters are displayed).  A programmer  initializes  a  color-
-       pair  with  the routine init_pair.  After it has been ini-
-       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
-       can be used as a new video attribute.
-
-       If  a  terminal  is capable of redefining colors, the pro-
-       grammer can use the routine init_color to change the defi-
-       nition   of   a   color.    The  routines  has_colors  and
-       can_change_color  return  TRUE  or  FALSE,  depending   on
-       whether  the  terminal  has color capabilities and whether
-       the programmer can change the colors.   The  routine  col-
-       or_content  allows  a programmer to extract the amounts of
-       red, green, and blue components in an  initialized  color.
-       The  routine  pair_content allows a programmer to find out
-       how a given color-pair is currently defined.
-
-   Routine Descriptions
-       The start_color routine requires no arguments.  It must be
-       called  if  the programmer wants to use colors, and before
-       any other color manipulation routine  is  called.   It  is
-       good  practice  to  call this routine right after initscr.
-       start_color initializes eight basic  colors  (black,  red,
-       green,  yellow,  blue,  magenta, cyan, and white), and two
-       global variables,  COLORS  and  COLOR_PAIRS  (respectively
-       defining  the maximum number of colors and color-pairs the
-       terminal can support).  It also restores the colors on the
-       terminal to the values they had when the terminal was just
-       turned on.
-
-       The init_pair routine changes the definition of  a  color-
-       pair.   It takes three arguments: the number of the color-
-       pair to be changed, the foreground color number,  and  the
-       background color number.  For portable applications:
-
-       o   The  value of the first argument must be between 1 and
-           COLOR_PAIRS-1, except that if default colors are  used
-           (see  use_default_colors)  the upper limit is adjusted
-           to allow for extra pairs which use a default color  in
-           foreground and/or background.
-
-       o   The  value  of  the second and third arguments must be
-           between 0 and COLORS.  Color pair 0 is assumed  to  be
-           white  on black, but is actually whatever the terminal
-           implements before color is initialized.  It cannot  be
-           modified by the application.
-
-       If  the  color-pair was previously initialized, the screen
-       is refreshed and all occurrences of  that  color-pair  are
-       changed to the new definition.
-
-       As  an  extension,  ncurses allows you to set color pair 0
-       via the assume_default_colors routine, or to  specify  the
-       use  of  default colors (color number -1) if you first in-
-       voke the use_default_colors routine.
-
-       The init_color routine changes the definition of a  color.
-       It  takes  four  arguments:  the number of the color to be
-       changed followed by three RGB values (for the  amounts  of
-       red,  green, and blue components).  The value of the first
-       argument must be between 0 and COLORS.  (See  the  section
-       Colors  for  the  default  color index.)  Each of the last
-       three arguments must be a value between 0 and 1000.   When
-       init_color  is  used, all occurrences of that color on the
-       screen immediately change to the new definition.
-
-       The has_colors routine requires no arguments.  It  returns
-       TRUE  if the terminal can manipulate colors; otherwise, it
-       returns FALSE.  This routine facilitates writing terminal-
-       independent  programs.   For example, a programmer can use
-       it to decide whether to use color or some other video  at-
-       tribute.
-
-       The  can_change_color  routine  requires no arguments.  It
-       returns TRUE if  the  terminal  supports  colors  and  can
-       change  their  definitions; other, it returns FALSE.  This
-       routine facilitates writing terminal-independent programs.
-
-       The color_content routine gives programmers a way to  find
-       the intensity of the red, green, and blue (RGB) components
-       in a color.  It requires four arguments: the color number,
-       and  three addresses of shorts for storing the information
-       about the amounts of red, green, and  blue  components  in
-       the  given color.  The value of the first argument must be
-       between 0 and COLORS.  The values that are stored  at  the
-       addresses  pointed  to by the last three arguments are be-
-       tween 0 (no component) and 1000 (maximum amount of  compo-
-       nent).
-
-       The  pair_content  routine  allows programmers to find out
-       what colors a given color-pair consists of.   It  requires
-       three  arguments: the color-pair number, and two addresses
-       of shorts for storing the foreground  and  the  background
-       color  numbers.   The  value of the first argument must be
-       between 1 and COLOR_PAIRS-1.  The values that  are  stored
-       at  the addresses pointed to by the second and third argu-
-       ments are between 0 and COLORS.
-
-   Colors
-       In <curses.h> the following macros are defined.  These are
-       the  default colors.  curses also assumes that COLOR_BLACK
-       is the default background color for all terminals.
-
-             COLOR_BLACK
-             COLOR_RED
-             COLOR_GREEN
-             COLOR_YELLOW
-             COLOR_BLUE
-             COLOR_MAGENTA
-             COLOR_CYAN
-             COLOR_WHITE
-
-
-
-

RETURN VALUE

-       The routines can_change_color()  and  has_colors()  return
-       TRUE or FALSE.
-
-       All other routines return the integer ERR upon failure and
-       an OK (SVr4 specifies only "an integer  value  other  than
-       ERR") upon successful completion.
-
-       X/Open  defines  no error conditions.  This implementation
-       will return ERR on attempts to use  color  values  outside
-       the range 0 to COLORS-1 (except for the default colors ex-
-       tension), or use color pairs outside the range 0  to  COL-
-       OR_PAIRS-1.   Color  values  used in init_color must be in
-       the range 0 to 1000.  An error is returned from all  func-
-       tions  if the terminal has not been initialized.  An error
-       is returned from secondary functions such as init_pair  if
-       start_color was not called.
-
-          init_color
-               returns  an error if the terminal does not support
-               this feature, e.g., if the initialize_color  capa-
-               bility is absent from the terminal description.
-
-          start_color
-               returns  an error if the color table cannot be al-
-               located.
-
-
-
-

NOTES

-       In the ncurses implementation, there is a  separate  color
-       activation flag, color palette, color pairs table, and as-
-       sociated COLORS and COLOR_PAIRS counts  for  each  screen;
-       the  start_color function only affects the current screen.
-       The SVr4/XSI interface is not really designed with this in
-       mind,  and  historical  implementations  may  use a single
-       shared color palette.
-
-       Note that setting an implicit background color via a color
-       pair  affects  only character cells that a character write
-       operation explicitly touches.  To  change  the  background
-       color  used  when parts of a window are blanked by erasing
-       or scrolling operations, see curs_bkgd(3x).
-
-       Several caveats apply on 386 and 486  machines  with  VGA-
-       compatible graphics:
-
-       o   COLOR_YELLOW  is  actually  brown.  To get yellow, use
-           COLOR_YELLOW combined with the A_BOLD attribute.
-
-       o   The A_BLINK attribute should in theory cause the back-
-           ground  to  go  bright.  This often fails to work, and
-           even some cards for which it mostly works (such as the
-           Paradise  and compatibles) do the wrong thing when you
-           try to set a bright "yellow"  background  (you  get  a
-           blinking yellow foreground instead).
-
-       o   Color RGB values are not settable.
-
-
-
-

PORTABILITY

-       This  implementation  satisfies XSI Curses's minimum maxi-
-       mums for COLORS and COLOR_PAIRS.
-
-       The init_pair routine accepts  negative  values  of  fore-
-       ground   and  background  color  to  support  the  use_de-
-       fault_colors extension, but only if that routine has  been
-       first invoked.
-
-       The  assumption that COLOR_BLACK is the default background
-       color for all terminals can  be  modified  using  the  as-
-       sume_default_colors extension.
-
-       This  implementation  checks  the  pointers, e.g., for the
-       values returned by  color_content  and  pair_content,  and
-       will treat those as optional parameters when null.
-
-
-
-

SEE ALSO

-       curses(3x),  curs_initscr(3x),  curs_attr(3x),  curs_vari-
-       ables(3x), default_colors(3x)
-
-
-
-                                                         curs_color(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_delch.3x.html b/doc/html/man/curs_delch.3x.html deleted file mode 100644 index 174b17d8e62..00000000000 --- a/doc/html/man/curs_delch.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -curs_delch 3x - - - - -

curs_delch 3x

-
-
-
-curs_delch(3x)                                           curs_delch(3x)
-
-
-
-
-
-

NAME

-       delch,  wdelch, mvdelch, mvwdelch - delete character under
-       the cursor in a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int delch(void);
-       int wdelch(WINDOW *win);
-       int mvdelch(int y, int x);
-       int mvwdelch(WINDOW *win, int y, int x);
-
-
-
-

DESCRIPTION

-       These routines delete the character under the cursor;  all
-       characters to the right of the cursor on the same line are
-       moved to the left one position and the last  character  on
-       the line is filled with a blank.  The cursor position does
-       not change (after moving to y, x,  if  specified).   (This
-       does  not  imply use of the hardware delete character fea-
-       ture.)
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon failure and an OK
-       (SVr4  specifies  only  "an integer value other than ERR")
-       upon successful completion.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that delch, mvdelch, and mvwdelch may be macros.
-
-
-
-

PORTABILITY

-       These functions are described in the XSI Curses  standard,
-       Issue  4.   The standard specifies that they return ERR on
-       failure, but specifies no error conditions.
-
-
-
-

SEE ALSO

-       curses(3x)
-
-
-
-                                                         curs_delch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_deleteln.3x.html b/doc/html/man/curs_deleteln.3x.html deleted file mode 100644 index 5015849dd09..00000000000 --- a/doc/html/man/curs_deleteln.3x.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - -curs_deleteln 3x - - - - -

curs_deleteln 3x

-
-
-
-curs_deleteln(3x)                                     curs_deleteln(3x)
-
-
-
-
-
-

NAME

-       deleteln,  wdeleteln,  insdelln, winsdelln, insertln, win-
-       sertln - delete and insert lines in a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int deleteln(void);
-       int wdeleteln(WINDOW *win);
-       int insdelln(int n);
-       int winsdelln(WINDOW *win, int n);
-       int insertln(void);
-       int winsertln(WINDOW *win);
-
-
-
-

DESCRIPTION

-       The deleteln and wdeleteln routines delete the line  under
-       the cursor in the window; all lines below the current line
-       are moved up one line.  The bottom line of the  window  is
-       cleared.  The cursor position does not change.
-
-       The  insdelln  and  winsdelln  routines,  for  positive n,
-       insert n lines into the specified window above the current
-       line.   The  n  bottom  lines  are  lost.  For negative n,
-       delete n lines (starting with the one under  the  cursor),
-       and  move  the remaining lines up.  The bottom n lines are
-       cleared.  The current cursor position remains the same.
-
-       The insertln and winsertln routines insert  a  blank  line
-       above the current line and the bottom line is lost.
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon failure and an OK
-       (SVr4 specifies only "an integer value  other  than  ERR")
-       upon successful completion.
-
-       X/Open  defines  no error conditions.  In this implementa-
-       tion, if  the  window  parameter  is  null,  an  error  is
-       returned.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  The standard specifies that they return  ERR  on
-       failure, but specifies no error conditions.
-
-
-
-

NOTES

-       Note that all but winsdelln may be macros.
-
-       These  routines  do  not require a hardware line delete or
-       insert feature in the terminal.  In fact,  they  will  not
-       use  hardware  line  delete/insert unless idlok(..., TRUE)
-       has been set on the current window.
-
-
-
-

SEE ALSO

-       curses(3x)
-
-
-
-                                                      curs_deleteln(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_extend.3x.html b/doc/html/man/curs_extend.3x.html deleted file mode 100644 index a90ccd717f5..00000000000 --- a/doc/html/man/curs_extend.3x.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - -curs_extend 3x - - - - -

curs_extend 3x

-
-
-
-curs_extend(3x)                                         curs_extend(3x)
-
-
-
-
-
-

NAME

-       curses_version,  use_extended_names - miscellaneous curses
-       extensions
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       const char * curses_version(void);
-       int use_extended_names(bool enable);
-
-
-
-

DESCRIPTION

-       These functions are extensions to the curses library which
-       do not fit easily into other categories.
-
-       Use  curses_version() to get the version number, including
-       patch level of the library, e.g., 5.0.19991023
-
-       The use_extended_names()  function  controls  whether  the
-       calling  application  is  able to use user-defined or non-
-       standard names which may be  compiled  into  the  terminfo
-       description, i.e., via the terminfo or termcap interfaces.
-       Normally these names are  available  for  use,  since  the
-       essential  decision  is made by using the -x option of tic
-       to compile extended terminal definitions.  However you can
-       disable  this  feature  to ensure compatibility with other
-       implementations of curses.
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on them be  con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       curs_getch(3x),       curs_mouse(3x),      curs_print(3x),
-       curs_util(3x),  default_colors(3x),  define_key(3x),  key-
-       bound(3x), keyok(3x), resizeterm(3x), wresize(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey.
-
-
-
-                                                        curs_extend(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_get_wch.3x.html b/doc/html/man/curs_get_wch.3x.html deleted file mode 100644 index 0b2373e6b74..00000000000 --- a/doc/html/man/curs_get_wch.3x.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - -curs_get_wch 3x - - - - -

curs_get_wch 3x

-
-
-
-curs_get_wch(3x)                                       curs_get_wch(3x)
-
-
-
-
-
-

NAME

-       get_wch,  wget_wch, mvget_wch, mvwget_wch, unget_wch - get
-       (or push back) a wide character from curses terminal  key-
-       board
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int get_wch(wint_t *wch);
-       int wget_wch(WINDOW *win, wint_t *wch);
-       int mvget_wch(int y, int x, wint_t *wch);
-       int mvwget_wch(WINDOW *win, int y, int x, wint_t *wch);
-       int unget_wch(const wchar_t wch);
-
-
-
-

DESCRIPTION

-       The get_wch, wget_wch, mvget_wch, and mvwget_wch functions
-       read a character from the  terminal  associated  with  the
-       current  or  specified  window.   In  no-delay mode, if no
-       input is waiting, the value ERR  is  returned.   In  delay
-       mode,  the  program  waits  until  the  system passes text
-       through to the  program.   Depending  on  the  setting  of
-       cbreak,  this  is  after  one  character (cbreak mode), or
-       after the first newline (nocbreak  mode).   In  half-delay
-       mode,  the  program waits until the user types a character
-       or the specified timeout interval has elapsed.
-
-       Unless noecho has been set, these routines echo the  char-
-       acter into the designated window.
-
-       If  the window is not a pad and has been moved or modified
-       since the last call to wrefresh, wrefresh will  be  called
-       before another character is read.
-
-       If  keypad  is  enabled,  these  functions  respond to the
-       pressing of a function key by setting the  object  pointed
-       to  by  wch  to  the  corresponding  KEY_ value defined in
-       <curses.h> and returning  KEY_CODE_YES.   If  a  character
-       (such as escape) that could be the beginning of a function
-       key is received, curses sets a timer.  If the remainder of
-       the  sequence  does  arrive  within  the  designated time,
-       curses passes through  the  character;  otherwise,  curses
-       returns  the  function  key  value.  For this reason, many
-       terminals experience a  delay  between  the  time  a  user
-       presses the escape key and the time the escape is returned
-       to the program.
-
-       The unget_wch function pushes the wide character wch  back
-       onto the head of the input queue, so the wide character is
-       returned by the next call to get_wch.  The pushback of one
-       character  is  guaranteed.  If the program calls unget_wch
-       too many times without an intervening call to get_wch, the
-       operation may fail.
-
-
-
-

NOTES

-       The  header  file  <curses.h>  automatically  includes the
-       header file <stdio.h>.
-
-       Applications should not define the escape key by itself as
-       a single-character function.
-
-       When  using  get_wch,  wget_wch, mvget_wch, or mvwget_wch,
-       applications should not use nocbreak mode and echo mode at
-       the  same  time.  Depending on the state of the tty driver
-       when each character is  typed,  the  program  may  produce
-       undesirable results.
-
-       All functions except wget_wch and unget_wch may be macros.
-
-
-
-

RETURN VALUES

-       When  get_wch,  wget_wch,  mvget_wch, and mvwget_wch func-
-       tions successfully report the pressing of a function  key,
-       they return KEY_CODE_YES.  When they successfully report a
-       wide character, they return OK.   Otherwise,  they  return
-       ERR.
-
-       Upon  successful completion, unget_wch returns OK.  Other-
-       wise, the function returns ERR.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

SEE ALSO

-       curses(3x),       curs_getch(3x),        curs_ins_wch(3x),
-       curs_inopts(3x), curs_move(3x), curs_refresh(3x)
-
-
-
-                                                       curs_get_wch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_get_wstr.3x.html b/doc/html/man/curs_get_wstr.3x.html deleted file mode 100644 index 5775678fe04..00000000000 --- a/doc/html/man/curs_get_wstr.3x.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - -curs_get_wstr 3x - - - - -

curs_get_wstr 3x

-
-
-
-curs_get_wstr(3x)                                     curs_get_wstr(3x)
-
-
-
-
-
-

NAME

-       get_wstr, getn_wstr, wget_wstr, wgetn_wstr, mvget_wstr,
-       mvgetn_wstr, mvwget_wstr, mvwgetn_wstr - get an array of
-       wide characters from a curses terminal keyboard
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int get_wstr(wint_t *wstr);
-       int getn_wstr(wint_t *wstr, int n);
-       int wget_wstr(WINDOW *win, wint_t *wstr);
-       int wgetn_wstr(WINDOW *win, wint_t *wstr, int n);
-       int mvget_wstr(int y, int x, wint_t *wstr);
-       int mvgetn_wstr(int y, int x, wint_t *wstr, int n);
-       int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr);
-       int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n);
-
-
-
-

DESCRIPTION

-       The  effect  of get_wstr is as though a series of calls to
-       get_wch were made, until a newline, other end-of-line,  or
-       end-of-file condition is processed.  An end-of-file condi-
-       tion is represented by WEOF, as defined in <wchar.h>.  The
-       newline  and end-of-line conditions are represented by the
-       \n wchar_t value.  In all instances, the end of the string
-       is  terminated  by a null wchar_t.  The routine places re-
-       sulting values in the area pointed to by wstr.
-
-       The user's erase and kill characters are interpreted.   If
-       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
-       KEY_BACKSPACE are both considered equivalent to the user's
-       kill character.
-
-       Characters  input are echoed only if echo is currently on.
-       In that case, backspace is echoed as deletion of the  pre-
-       vious character (typically a left motion).
-
-       The  effect of wget_wstr is as though a series of calls to
-       wget_wch were made.
-
-       The effect of mvget_wstr is as though a call to  move  and
-       then a series of calls to get_wch were made.
-
-       The effect of mvwget_wstr is as though a call to wmove and
-       then a series of calls to wget_wch were made.
-
-       The getn_wstr, mvgetn_wstr, mvwgetn_wstr,  and  wgetn_wstr
-       functions  are  identical  to  the  get_wstr,  mvget_wstr,
-       mvwget_wstr, and wget_wstr functions, respectively, except
-       that  the *n_* versions read at most n characters, letting
-       the application prevent overflow of the input buffer.
-
-
-
-

NOTES

-       Using get_wstr, mvget_wstr, mvwget_wstr, or  wget_wstr  to
-       read  a  line  that overflows the array pointed to by wstr
-       causes  undefined  results.    The   use   of   getn_wstr,
-       mvgetn_wstr, mvwgetn_wstr, or wgetn_wstr, respectively, is
-       recommended.
-
-       These functions cannot return KEY_ values because there is
-       no  way  to  distinguish a KEY_ value from a valid wchar_t
-       value.
-
-       All of these routines except wgetn_wstr may be macros.
-
-
-
-

RETURN VALUES

-       All of these functions return OK upon  successful  comple-
-       tion.  Otherwise, they return ERR.
-
-       Functions  using  a window parameter return an error if it
-       is null.
-
-              wgetn_wstr
-                   returns an error if  the  associated  call  to
-                   wget_wch failed.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

PORTABILITY

-       These  functions are described in The Single Unix Specifi-
-       cation, Version 2.  No error conditions are defined.  This
-       implementation  returns ERR if the window pointer is null,
-       or if the lower-level wget_wch call returns  an  ERR.   In
-       the  latter  case,  an  ERR  return  without other data is
-       treated as an end-of-file condition, and the returned  ar-
-       ray contains a WEOF followed by a null wchar_t.
-
-       X/Open  curses  documents these functions to pass an array
-       of wchar_t, but all of the vendors  implement  this  using
-       wint_t.
-
-
-
-

SEE ALSO

-       Functions: curses(3x), curs_get_wch(3x), curs_getstr(3x).
-
-
-
-                                                      curs_get_wstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_getcchar.3x.html b/doc/html/man/curs_getcchar.3x.html deleted file mode 100644 index 22cb819fbd3..00000000000 --- a/doc/html/man/curs_getcchar.3x.html +++ /dev/null @@ -1,158 +0,0 @@ - - - - -curs_getcchar 3x - - - - -

curs_getcchar 3x

-
-
-
-curs_getcchar(3x)                                     curs_getcchar(3x)
-
-
-
-
-
-

NAME

-       getcchar,  setcchar - Get a wide character string and ren-
-       dition from a cchar_t or set a cchar_t from a wide-charac-
-       ter string
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int getcchar(
-               const cchar_t *wcval,
-               wchar_t *wch,
-               attr_t *attrs,
-               short *color_pair,
-               void *opts );
-
-       int setcchar(
-               cchar_t *wcval,
-               const wchar_t *wch,
-               const attr_t attrs,
-               short color_pair,
-               void *opts );
-
-
-
-

DESCRIPTION

-       The  getcchar  function  gets  a wide-character string and
-       rendition from a cchar_t argument.  When wch is not a null
-       pointer, the getcchar function does the following:
-
-       o   Extracts information from a cchar_t value wcval
-
-       o   Stores   the  character  attributes  in  the  location
-           pointed to by attrs
-
-       o   Stores the color-pair in the location  pointed  to  by
-           color_pair
-
-       o   Stores  the  wide-character  string, characters refer-
-           enced by wcval, into the array pointed to by wch.
-
-       When wch is a null pointer, the getcchar function does the
-       following:
-
-       o   Obtains  the  number  of wide characters pointed to by
-           wcval
-
-       o   Does not  change  the  data  referenced  by  attrs  or
-           color_pair
-
-       The  setcchar function initializes the location pointed to
-       by wcval by using:
-
-       o   The character attributes in attrs
-
-       o   The color pair in color_pair
-
-       o   The wide-character string  pointed  to  by  wch.   The
-           string  must  be L'\0' terminated, contain at most one
-           spacing character, which must be the first.
-
-           Up to CCHARW_MAX-1 nonspacing characters  may  follow.
-           Additional nonspacing characters are ignored.
-
-           The  string  may  contain  a  single control character
-           instead.  In that case, no nonspacing  characters  are
-           allowed.
-
-
-
-

NOTES

-       The  opts argument is reserved for future use.  Currently,
-       an application must provide a null pointer as opts.
-
-       The wcval argument may be a value generated by a  call  to
-       setcchar  or by a function that has a cchar_t output argu-
-       ment.  If wcval is constructed by  any  other  means,  the
-       effect is unspecified.
-
-
-
-

RETURN VALUES

-       When wch is a null pointer, getcchar returns the number of
-       wide characters referenced by wcval, including one  for  a
-       trailing null.
-
-       When  wch  is not a null pointer, getcchar returns OK upon
-       successful completion, and ERR otherwise.
-
-       Upon successful completion, setcchar returns  OK.   Other-
-       wise, it returns ERR.
-
-
-
-

SEE ALSO

-       Functions:   curs_attr(3x),   curs_color(3x),  curses(3x),
-       wcwidth(3).
-
-
-
-                                                      curs_getcchar(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_getch.3x.html b/doc/html/man/curs_getch.3x.html deleted file mode 100644 index 2bdcdc423a2..00000000000 --- a/doc/html/man/curs_getch.3x.html +++ /dev/null @@ -1,359 +0,0 @@ - - - - -curs_getch 3x - - - - -

curs_getch 3x

-
-
-
-curs_getch(3x)                                           curs_getch(3x)
-
-
-
-
-
-

NAME

-       getch, wgetch, mvgetch, mvwgetch, ungetch, has_key - get
-       (or push back) characters from curses terminal keyboard
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int getch(void);
-       int wgetch(WINDOW *win);
-       int mvgetch(int y, int x);
-       int mvwgetch(WINDOW *win, int y, int x);
-       int ungetch(int ch);
-       int has_key(int ch);
-
-
-
-

DESCRIPTION

-       The getch, wgetch, mvgetch and mvwgetch, routines  read  a
-       character  from the window.  In no-delay mode, if no input
-       is waiting, the value ERR is returned.  In delay mode, the
-       program  waits until the system passes text through to the
-       program.  Depending on the setting of cbreak, this is  af-
-       ter  one  character (cbreak mode), or after the first new-
-       line (nocbreak mode).  In  half-delay  mode,  the  program
-       waits  until a character is typed or the specified timeout
-       has been reached.
-
-       Unless noecho has been set, then the character  will  also
-       be echoed into the designated window according to the fol-
-       lowing rules: if the character is the current erase  char-
-       acter,  left  arrow, or backspace, the cursor is moved one
-       space to the left and that screen position is erased as if
-       delch had been called.  If the character value is any oth-
-       er KEY_ define, the user is  alerted  with  a  beep  call.
-       Otherwise the character is simply output to the screen.
-
-       If the window is not a pad, and it has been moved or modi-
-       fied since the last call to  wrefresh,  wrefresh  will  be
-       called before another character is read.
-
-       If  keypad is TRUE, and a function key is pressed, the to-
-       ken for that function key is returned instead of  the  raw
-       characters.   Possible function keys are defined in <curs-
-       es.h> as macros with values outside  the  range  of  8-bit
-       characters  whose  names begin with KEY_. Thus, a variable
-       intended to hold the return value of a function  key  must
-       be of short size or larger.
-
-       When a character that could be the beginning of a function
-       key is received (which, on modern terminals, means an  es-
-       cape character), curses sets a timer.  If the remainder of
-       the sequence does not come in within the designated  time,
-       the  character  is passed through; otherwise, the function
-       key value is returned.  For this  reason,  many  terminals
-       experience a delay between the time a user presses the es-
-       cape key and the escape is returned to the program.
-
-       The ungetch routine places ch back onto the input queue to
-       be returned by the next call to wgetch.  There is just one
-       input queue for all windows.
-
-
-   Function Keys
-       The following function keys, defined in <curses.h>,  might
-       be  returned  by  getch  if keypad has been enabled.  Note
-       that not all of these are  necessarily  supported  on  any
-       particular terminal.
-
-
-            Name            Key name
-            KEY_BREAK       Break key
-            KEY_DOWN        The four arrow keys ...
-            KEY_UP
-            KEY_LEFT
-            KEY_RIGHT
-            KEY_HOME        Home key (upward+left arrow)
-            KEY_BACKSPACE   Backspace
-            KEY_F0          Function keys; space for 64 keys
-                            is reserved.
-            KEY_F(n)        For 0 <= n <= 63
-            KEY_DL          Delete line
-            KEY_IL          Insert line
-            KEY_DC          Delete character
-            KEY_IC          Insert char or enter insert mode
-            KEY_EIC         Exit insert char mode
-            KEY_CLEAR       Clear screen
-            KEY_EOS         Clear to end of screen
-            KEY_EOL         Clear to end of line
-            KEY_SF          Scroll 1 line forward
-            KEY_SR          Scroll 1 line backward (reverse)
-            KEY_NPAGE       Next page
-            KEY_PPAGE       Previous page
-            KEY_STAB        Set tab
-            KEY_CTAB        Clear tab
-            KEY_CATAB       Clear all tabs
-            KEY_ENTER       Enter or send
-            KEY_SRESET      Soft (partial) reset
-            KEY_RESET       Reset or hard reset
-            KEY_PRINT       Print or copy
-            KEY_LL          Home down or bottom (lower left)
-            KEY_A1          Upper left of keypad
-            KEY_A3          Upper right of keypad
-            KEY_B2          Center of keypad
-            KEY_C1          Lower left of keypad
-            KEY_C3          Lower right of keypad
-            KEY_BTAB        Back tab key
-            KEY_BEG         Beg(inning) key
-            KEY_CANCEL      Cancel key
-            KEY_CLOSE       Close key
-            KEY_COMMAND     Cmd (command) key
-            KEY_COPY        Copy key
-            KEY_CREATE      Create key
-            KEY_END         End key
-            KEY_EXIT        Exit key
-            KEY_FIND        Find key
-            KEY_HELP        Help key
-            KEY_MARK        Mark key
-            KEY_MESSAGE     Message key
-            KEY_MOUSE       Mouse event read
-            KEY_MOVE        Move key
-            KEY_NEXT        Next object key
-            KEY_OPEN        Open key
-            KEY_OPTIONS     Options key
-            KEY_PREVIOUS    Previous object key
-            KEY_REDO        Redo key
-            KEY_REFERENCE   Ref(erence) key
-            KEY_REFRESH     Refresh key
-            KEY_REPLACE     Replace key
-            KEY_RESIZE      Screen resized
-            KEY_RESTART     Restart key
-            KEY_RESUME      Resume key
-
-            KEY_SAVE        Save key
-            KEY_SBEG        Shifted beginning key
-            KEY_SCANCEL     Shifted cancel key
-            KEY_SCOMMAND    Shifted command key
-            KEY_SCOPY       Shifted copy key
-            KEY_SCREATE     Shifted create key
-            KEY_SDC         Shifted delete char key
-            KEY_SDL         Shifted delete line key
-            KEY_SELECT      Select key
-            KEY_SEND        Shifted end key
-            KEY_SEOL        Shifted clear line key
-            KEY_SEXIT       Shifted exit key
-            KEY_SFIND       Shifted find key
-            KEY_SHELP       Shifted help key
-            KEY_SHOME       Shifted home key
-            KEY_SIC         Shifted input key
-            KEY_SLEFT       Shifted left arrow key
-            KEY_SMESSAGE    Shifted message key
-            KEY_SMOVE       Shifted move key
-            KEY_SNEXT       Shifted next key
-            KEY_SOPTIONS    Shifted options key
-            KEY_SPREVIOUS   Shifted prev key
-            KEY_SPRINT      Shifted print key
-            KEY_SREDO       Shifted redo key
-            KEY_SREPLACE    Shifted replace key
-            KEY_SRIGHT      Shifted right arrow
-            KEY_SRSUME      Shifted resume key
-            KEY_SSAVE       Shifted save key
-            KEY_SSUSPEND    Shifted suspend key
-            KEY_SUNDO       Shifted undo key
-            KEY_SUSPEND     Suspend key
-            KEY_UNDO        Undo key
-
-       Keypad is arranged like this:
-
-
-                         +-----+------+-------+
-                         | A1  |  up  |  A3   |
-                         +-----+------+-------+
-                         |left |  B2  | right |
-                         +-----+------+-------+
-                         | C1  | down |  C3   |
-                         +-----+------+-------+
-       The has_key routine takes a key value from the above list,
-       and returns TRUE or FALSE according to whether the current
-       terminal type recognizes a key with that value.  Note that
-       a  few  values  do  not  correspond  to  a real key, e.g.,
-       KEY_RESIZE and KEY_MOUSE.  See resizeterm(3x) for more de-
-       tails  about  KEY_RESIZE, and curs_mouse(3x) for a discus-
-       sion of KEY_MOUSE.
-
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon  failure  and  an
-       integer value other than ERR (OK in the case of ungetch())
-       upon successful completion.
-
-              ungetch
-                   returns an error if there is no more  room  in
-                   the FIFO.
-
-              wgetch
-                   returns  an  error  if  the  window pointer is
-                   null, or if its timeout expires without having
-                   any data.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Use of the escape key by a programmer for a single charac-
-       ter function is discouraged, as it will cause a  delay  of
-       up to one second while the keypad code looks for a follow-
-       ing function-key sequence.
-
-       Note that some keys may be the same as commonly used  con-
-       trol keys, e.g., KEY_ENTER versus control/M, KEY_BACKSPACE
-       versus control/H.  Some curses implementations may  differ
-       according  to  whether  they treat these control keys spe-
-       cially (and ignore the terminfo), or use the terminfo def-
-       initions.   Ncurses  uses  the terminfo definition.  If it
-       says  that  KEY_ENTER  is  control/M,  getch  will  return
-       KEY_ENTER when you press control/M.
-
-       Generally,  KEY_ENTER denotes the character(s) sent by the
-       Enter key on the numeric keypad:
-
-       o   the terminal description lists the most useful keys,
-
-       o   the Enter key on the regular keyboard is already  han-
-           dled by the standard ASCII characters for carriage-re-
-           turn and line-feed,
-
-       o   depending on whether nl or nonl was  called,  pressing
-           "Enter"  on  the  regular keyboard may return either a
-           carriage-return or line-feed, and finally
-
-       o   "Enter or send" is the standard description  for  this
-           key.
-
-       When  using  getch, wgetch, mvgetch, or mvwgetch, nocbreak
-       mode (nocbreak) and echo mode (echo) should not be used at
-       the  same  time.  Depending on the state of the tty driver
-       when each character is typed, the program may produce  un-
-       desirable results.
-
-       Note that getch, mvgetch, and mvwgetch may be macros.
-
-       Historically, the set of keypad macros was largely defined
-       by the extremely function-key-rich keyboard  of  the  AT&T
-       7300,  aka  3B1,  aka Safari 4.  Modern personal computers
-       usually have only a small subset of these.   IBM  PC-style
-       consoles   typically  support  little  more  than  KEY_UP,
-       KEY_DOWN,   KEY_LEFT,   KEY_RIGHT,   KEY_HOME,    KEY_END,
-       KEY_NPAGE, KEY_PPAGE, and function keys 1 through 12.  The
-       Ins key is usually mapped to KEY_IC.
-
-
-
-

PORTABILITY

-       The *get* functions are described in the XSI Curses  stan-
-       dard,  Issue  4.   They  read single-byte characters only.
-       The standard specifies that they return  ERR  on  failure,
-       but specifies no error conditions.
-
-       The  echo  behavior of these functions on input of KEY_ or
-       backspace characters was not specified in the  SVr4  docu-
-       mentation.  This description is adopted from the XSI Curs-
-       es standard.
-
-       The behavior of getch and friends in the presence of  han-
-       dled  signals  is  unspecified  in the SVr4 and XSI Curses
-       documentation.  Under historical  curses  implementations,
-       it  varied depending on whether the operating system's im-
-       plementation  of  handled  signal  receipt  interrupts   a
-       read(2)  call in progress or not, and also (in some imple-
-       mentations) depending on whether an input timeout or  non-
-       blocking mode has been set.
-
-       Programmers concerned about portability should be prepared
-       for either of two cases: (a) signal receipt does  not  in-
-       terrupt  getch;  (b)  signal  receipt interrupts getch and
-       causes it to return ERR with errno set  to  EINTR.   Under
-       the  ncurses  implementation, handled signals never inter-
-       rupt getch.
-
-       The has_key function is unique to ncurses.   We  recommend
-       that  any  code  using it be conditionalized on the NCURS-
-       ES_VERSION feature macro.
-
-
-
-

SEE ALSO

-       curses(3x),       curs_inopts(3x),       curs_outopts(3x),
-       curs_mouse(3x),   curs_move(3x),   curs_refresh(3x),   re-
-       sizeterm(3x).
-
-       Comparable functions in the wide-character (ncursesw)  li-
-       brary are described in curs_get_wch(3x).
-
-
-
-                                                         curs_getch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_getstr.3x.html b/doc/html/man/curs_getstr.3x.html deleted file mode 100644 index 222f00bc700..00000000000 --- a/doc/html/man/curs_getstr.3x.html +++ /dev/null @@ -1,155 +0,0 @@ - - - - -curs_getstr 3x - - - - -

curs_getstr 3x

-
-
-
-curs_getstr(3x)                                         curs_getstr(3x)
-
-
-
-
-
-

NAME

-       getstr, getnstr, wgetstr, wgetnstr, mvgetstr, mvgetnstr,
-       mvwgetstr, mvwgetnstr - accept character strings from
-       curses terminal keyboard
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int getstr(char *str);
-       int getnstr(char *str, int n);
-       int wgetstr(WINDOW *win, char *str);
-       int wgetnstr(WINDOW *win, char *str, int n);
-       int mvgetstr(int y, int x, char *str);
-       int mvwgetstr(WINDOW *win, int y, int x, char *str);
-       int mvgetnstr(int y, int x, char *str, int n);
-       int mvwgetnstr(WINDOW *, int y, int x, char *str, int n);
-
-
-
-

DESCRIPTION

-       The  function getstr is equivalent to a series of calls to
-       getch, until a newline or carriage return is received (the
-       terminating  character  is  not  included  in the returned
-       string).  The resulting value is placed in the area point-
-       ed to by the character pointer str.
-
-       wgetnstr  reads  at  most  n characters, thus preventing a
-       possible overflow of the input buffer.  Any attempt to en-
-       ter more characters (other than the terminating newline or
-       carriage return) causes a beep.  Function keys also  cause
-       a  beep  and are ignored.  The getnstr function reads from
-       the stdscr default window.
-
-       The user's erase and kill characters are interpreted.   If
-       keypad   mode   is   on   for  the  window,  KEY_LEFT  and
-       KEY_BACKSPACE are both considered equivalent to the user's
-       kill character.
-
-       Characters  input are echoed only if echo is currently on.
-       In that case, backspace is echoed as deletion of the  pre-
-       vious character (typically a left motion).
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon failure and an OK
-       (SVr4 specifies only "an integer value  other  than  ERR")
-       upon successful completion.
-
-       X/Open defines no error conditions.
-
-       In this implementation, these functions return an error if
-       the window pointer is null,  or  if  its  timeout  expires
-       without having any data.
-
-       This  implementation  provides an extension as well.  If a
-       SIGWINCH interrupts the function, it will  return  KEY_RE-
-       SIZE rather than OK or ERR.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that getstr, mvgetstr, and mvwgetstr may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  They  read  single-byte  characters  only.   The
-       standard  does  not define any error conditions.  This im-
-       plementation returns ERR if the window pointer is null, or
-       if the lower-level wgetch call returns an ERR.
-
-       SVr3  and early SVr4 curses implementations did not reject
-       function keys; the SVr4.0 documentation claimed that "spe-
-       cial  keys"  (such  as  function keys, "home" key, "clear"
-       key, etc.) are "interpreted", without giving details.   It
-       lied.   In  fact,  the  `character'  value appended to the
-       string by those implementations was  predictable  but  not
-       useful  (being,  in  fact, the low-order eight bits of the
-       key's KEY_ value).
-
-       The functions  getnstr,  mvgetnstr,  and  mvwgetnstr  were
-       present but not documented in SVr4.
-
-
-
-

SEE ALSO

-       curses(3x), curs_getch(3x), curs_variables(3x).
-
-
-
-                                                        curs_getstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_getyx.3x.html b/doc/html/man/curs_getyx.3x.html deleted file mode 100644 index 7a3771641a7..00000000000 --- a/doc/html/man/curs_getyx.3x.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - -curs_getyx 3x - - - - -

curs_getyx 3x

-
-
-
-curs_getyx(3x)                                           curs_getyx(3x)
-
-
-
-
-
-

NAME

-       getyx,  getparyx,  getbegyx,  getmaxyx - get curses cursor
-       and window coordinates
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       void getyx(WINDOW *win, int y, int x);
-       void getparyx(WINDOW *win, int y, int x);
-       void getbegyx(WINDOW *win, int y, int x);
-       void getmaxyx(WINDOW *win, int y, int x);
-
-
-
-

DESCRIPTION

-       The getyx macro places the current cursor position of  the
-       given window in the two integer variables y and x.
-
-       If  win  is  a  subwindow,  the  getparyx macro places the
-       beginning coordinates of the  subwindow  relative  to  the
-       parent  window into two integer variables y and x.  Other-
-       wise, -1 is placed into y and x.
-
-       Like getyx, the getbegyx and  getmaxyx  macros  store  the
-       current  beginning  coordinates  and size of the specified
-       window.
-
-
-
-

RETURN VALUE

-       The return values of these  macros  are  undefined  (i.e.,
-       they  should not be used as the right-hand side of assign-
-       ment statements).
-
-
-
-

NOTES

-       All of these interfaces are macros.  A "&" is  not  neces-
-       sary before the variables y and x.
-
-
-
-

PORTABILITY

-       The  getyx,  getparyx,  getbegyx  and  getmaxyx macros are
-       described in the XSI Curses standard, Issue 4.
-
-       This implementation also provides functions getbegx, getb-
-       egy,  getcurx, getcury, getmaxx, getmaxy, getparx and get-
-       pary for compatibility with older versions of curses.
-
-       Although X/Open Curses does not address this, many  imple-
-       mentations  provide  members  of the WINDOW structure con-
-       taining values corresponding to these  macros.   For  best
-       portability,  do  not  rely  on  using the data in WINDOW,
-       since some implementations  make  WINDOW  opaque  (do  not
-       allow direct use of its members).
-
-       Besides  the problem of opaque structures, the data stored
-       in like-named members may not have like-values in  differ-
-       ent  implementations.   For  example, the WINDOW._maxx and
-       WINDOW._maxy  values  in  ncurses  have  (at  least  since
-       release 1.8.1) differed by one from some other implementa-
-       tions.  The difference is hidden by  means  of  the  macro
-       getmaxyx.
-
-
-
-

SEE ALSO

-       curses(3x), curs_legacy(3x), curs_opaque(3x)
-
-
-
-                                                         curs_getyx(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_in_wch.3x.html b/doc/html/man/curs_in_wch.3x.html deleted file mode 100644 index 1535e51be22..00000000000 --- a/doc/html/man/curs_in_wch.3x.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - -curs_in_wch 3x - - - - -

curs_in_wch 3x

-
-
-
-curs_in_wch(3x)                                         curs_in_wch(3x)
-
-
-
-
-
-

NAME

-       in_wch,  mvin_wch,  mvwin_wch, win_wch - extract a complex
-       character and rendition from a window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int in_wch(cchar_t *wcval);
-       int mvin_wch(int y, int x, cchar_t *wcval);
-       int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
-       int win_wch(WINDOW *win, cchar_t *wcval);
-
-
-
-

DESCRIPTION

-       These functions extract the complex character  and  rendi-
-       tion  from  the  current position in the named window into
-       the cchar_t object referenced by wcval.
-
-
-
-

RETURN VALUE

-       No errors are defined in the XSI  Curses  standard.   This
-       implementation  checks  for  null pointers, returns ERR in
-       that case.  Also, the mv routines check for  error  moving
-       the  cursor,  returning  ERR in that case.  Otherwise they
-       return OK
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that all of these routines may be macros.
-
-
-
-

PORTABILITY

-       These functions are described in the XSI Curses  standard,
-       Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x), curs_inch(3x).
-
-
-
-                                                        curs_in_wch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_in_wchstr.3x.html b/doc/html/man/curs_in_wchstr.3x.html deleted file mode 100644 index e394e9063ce..00000000000 --- a/doc/html/man/curs_in_wchstr.3x.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - -curs_in_wchstr 3x - - - - -

curs_in_wchstr 3x

-
-
-
-curs_in_wchstr(3x)                                   curs_in_wchstr(3x)
-
-
-
-
-
-

NAME

-       in_wchstr, in_wchnstr, win_wchstr, win_wchnstr,
-       mvin_wchstr, mvin_wchnstr, mvwin_wchstr, mvwin_wchnstr -
-       get an array of complex characters and renditions from a
-       curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int in_wchstr(cchar_t *wchstr);
-       int in_wchnstr(cchar_t *wchstr, int n);
-       int win_wchstr(WINDOW *win, cchar_t *wchstr);
-       int win_wchnstr(WINDOW *win, cchar_t *wchstr, int n);
-       int mvin_wchstr(int y, int x, cchar_t *wchstr);
-       int mvin_wchnstr(int y, int x, cchar_t *wchstr, int n);
-       int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr);
-       int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n);
-
-
-
-

DESCRIPTION

-       These functions return an array of complex  characters  in
-       wchstr,  starting  at  the  current cursor position in the
-       named window.  Attributes (rendition) are stored with  the
-       characters.
-
-       The  in_wchnstr, mvin_wchnstr, mvwin_wchnstr and win_wchn-
-       str fill the array with at most n cchar_t elements.
-
-
-
-

NOTES

-       Note that all routines except win_wchnstr may be macros.
-
-       Reading a line that overflows the array pointed to by wch-
-       str  with in_wchstr, mvin_wchstr, mvwin_wchstr or win_wch-
-       str  causes  undefined  results.  Therefore,  the  use  of
-       in_wchnstr, mvin_wchnstr, mvwin_wchnstr, or win_wchnstr is
-       recommended.
-
-
-
-

RETURN VALUES

-       Upon successful completion,  these  functions  return  OK.
-       Otherwise, they return ERR.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

PORTABILITY

-       The  XSI  Curses defines no error conditions.  This imple-
-       mentation checks for null pointers, returning ERR in  that
-       case.
-
-
-
-

SEE ALSO

-       Functions:  curses(3x),  curs_in_wch(3x),  curs_instr(3x),
-       curs_inwstr(3x) curs_inchstr(3x)
-
-
-
-                                                     curs_in_wchstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_inch.3x.html b/doc/html/man/curs_inch.3x.html deleted file mode 100644 index 43c6159317c..00000000000 --- a/doc/html/man/curs_inch.3x.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - -curs_inch 3x - - - - -

curs_inch 3x

-
-
-
-curs_inch(3x)                                             curs_inch(3x)
-
-
-
-
-
-

NAME

-       inch,  winch,  mvinch,  mvwinch  -  get  a  character  and
-       attributes from a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       chtype inch(void);
-       chtype winch(WINDOW *win);
-       chtype mvinch(int y, int x);
-       chtype mvwinch(WINDOW *win, int y, int x);
-
-
-
-

DESCRIPTION

-       These routines return the character, of  type  chtype,  at
-       the   current  position  in  the  named  window.   If  any
-       attributes are set for that  position,  their  values  are
-       OR'ed  into  the  value  returned.   Constants  defined in
-       <curses.h> can be used with the & (logical  AND)  operator
-       to extract the character or attributes alone.
-
-   Attributes
-       The  following  bit-masks  may  be  AND-ed with characters
-       returned by winch.
-
-       A_CHARTEXT     Bit-mask to extract character
-       A_ATTRIBUTES   Bit-mask to extract attributes
-       A_COLOR        Bit-mask to extract color-pair field information
-
-
-
-

RETURN VALUE

-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that all of these routines may be macros.
-
-
-
-

PORTABILITY

-       These functions are described in the XSI Curses  standard,
-       Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x).
-
-       Comparable  functions  in  the  wide-character  (ncursesw)
-       library are described in curs_in_wch(3x).
-
-
-
-                                                          curs_inch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_inchstr.3x.html b/doc/html/man/curs_inchstr.3x.html deleted file mode 100644 index 73a78fc9c5c..00000000000 --- a/doc/html/man/curs_inchstr.3x.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - -curs_inchstr 3x - - - - -

curs_inchstr 3x

-
-
-
-curs_inchstr(3x)                                       curs_inchstr(3x)
-
-
-
-
-
-

NAME

-       inchstr, inchnstr, winchstr, winchnstr, mvinchstr,
-       mvinchnstr, mvwinchstr, mvwinchnstr - get a string of
-       characters (and attributes) from a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int inchstr(chtype *chstr);
-       int inchnstr(chtype *chstr, int n);
-       int winchstr(WINDOW *win, chtype *chstr);
-       int winchnstr(WINDOW *win, chtype *chstr, int n);
-       int mvinchstr(int y, int x, chtype *chstr);
-       int mvinchnstr(int y, int x, chtype *chstr, int n);
-       int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);
-       int  mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr,
-       int n);
-
-
-
-

DESCRIPTION

-       These routines return a NULL-terminated  array  of  chtype
-       quantities, starting at the current cursor position in the
-       named window and ending at the right margin of the window.
-       The  four  functions with n as the last argument, return a
-       leading substring at most n characters long (exclusive  of
-       the  trailing (chtype)0).  Constants defined in <curses.h>
-       can be used with the & (logical AND) operator  to  extract
-       the  character or the attribute alone from any position in
-       the chstr [see curs_inch(3x)].
-
-
-
-

RETURN VALUE

-       All routines return the integer ERR upon  failure  and  an
-       integer  value  other  than ERR upon successful completion
-       (the number of  characters  retrieved,  exclusive  of  the
-       trailing 0).
-
-       No  error  conditions are defined.  If the chstr parameter
-       is null, no data is returned, and the return value is  ze-
-       ro.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note  that  all  routines  except winchnstr may be macros.
-       SVr4 does not document whether the result string is  zero-
-       terminated;  it  does  not document whether a length limit
-       argument includes any trailing 0; and it does not document
-       the meaning of the return value.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  It is no more specific than the SVr4  documenta-
-       tion on the trailing 0.  It does specify that the success-
-       ful return of the functions is OK.
-
-
-
-

SEE ALSO

-       curses(3x), curs_inch(3x).
-
-       Comparable functions in the wide-character (ncursesw)  li-
-       brary are described in curs_in_wchstr(3x).
-
-
-
-                                                       curs_inchstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_initscr.3x.html b/doc/html/man/curs_initscr.3x.html deleted file mode 100644 index 5c4364d80e4..00000000000 --- a/doc/html/man/curs_initscr.3x.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - -curs_initscr 3x - - - - -

curs_initscr 3x

-
-
-
-curs_initscr(3x)                                       curs_initscr(3x)
-
-
-
-
-
-

NAME

-       initscr, newterm, endwin, isendwin, set_term, delscreen -
-       curses screen initialization and manipulation routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       WINDOW *initscr(void);
-       int endwin(void);
-       bool isendwin(void);
-       SCREEN *newterm(char *type, FILE *outfd, FILE *infd);
-       SCREEN *set_term(SCREEN *new);
-       void delscreen(SCREEN* sp);
-
-
-
-

DESCRIPTION

-       initscr is normally the first curses routine to call  when
-       initializing  a program.  A few special routines sometimes
-       need to be called before it; these are  slk_init,  filter,
-       ripoffline,  use_env.  For multiple-terminal applications,
-       newterm may be called before initscr.
-
-       The initscr code determines the terminal type and initial-
-       izes  all curses data structures.  initscr also causes the
-       first call to refresh to clear the screen.  If errors  oc-
-       cur,  initscr writes an appropriate error message to stan-
-       dard error and exits; otherwise, a pointer is returned  to
-       stdscr.
-
-       A  program  that  outputs to more than one terminal should
-       use the newterm  routine  for  each  terminal  instead  of
-       initscr.  A program that needs to inspect capabilities, so
-       it can continue to run in a line-oriented mode if the ter-
-       minal cannot support a screen-oriented program, would also
-       use newterm.  The routine newterm should  be  called  once
-       for each terminal.  It returns a variable of type SCREEN *
-       which should be saved as a  reference  to  that  terminal.
-       The  arguments  are the type of the terminal to be used in
-       place of $TERM, a file pointer for output to the terminal,
-       and  another  file pointer for input from the terminal (if
-       type is NULL, $TERM will be used).  The program must  also
-       call  endwin  for  each terminal being used before exiting
-       from curses.  If newterm is called more than once for  the
-       same  terminal, the first terminal referred to must be the
-       last one for which endwin is called.
-
-       A program should always call endwin before exiting or  es-
-       caping  from  curses  mode  temporarily.  This routine re-
-       stores tty modes, moves the cursor to the lower  left-hand
-       corner  of  the  screen  and  resets the terminal into the
-       proper non-visual mode.  Calling refresh or doupdate after
-       a  temporary  escape  causes  the program to resume visual
-       mode.
-
-       The isendwin routine  returns  TRUE  if  endwin  has  been
-       called without any subsequent calls to wrefresh, and FALSE
-       otherwise.
-
-       The set_term routine is used to switch  between  different
-       terminals.   The screen reference new becomes the new cur-
-       rent terminal.  The previous terminal is returned  by  the
-       routine.   This  is  the  only  routine  which manipulates
-       SCREEN pointers; all other routines affect only  the  cur-
-       rent terminal.
-
-       The  delscreen  routine  frees storage associated with the
-       SCREEN data structure.  The endwin  routine  does  not  do
-       this, so delscreen should be called after endwin if a par-
-       ticular SCREEN is no longer needed.
-
-
-
-

RETURN VALUE

-       endwin returns the integer ERR upon failure  and  OK  upon
-       successful completion.
-
-       Routines that return pointers always return NULL on error.
-
-       X/Open  defines  no error conditions.  In this implementa-
-       tion endwin returns an error if the terminal was not  ini-
-       tialized.
-
-
-
-

NOTES

-       Note that initscr and newterm may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.  It specifies that portable applications must not
-       call initscr more than once.
-
-       Old versions of curses, e.g., BSD 4.4, may have returned a
-       null pointer from  initscr  when  an  error  is  detected,
-       rather  than  exiting.   It is safe but redundant to check
-       the return value of initscr in XSI Curses.
-
-
-
-

SEE ALSO

-       curses(3x),       curs_kernel(3x),       curs_refresh(3x),
-       curs_slk(3x), curs_util(3x), curs_variables(3x).
-
-
-
-                                                       curs_initscr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_inopts.3x.html b/doc/html/man/curs_inopts.3x.html deleted file mode 100644 index d85164234c5..00000000000 --- a/doc/html/man/curs_inopts.3x.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - -curs_inopts 3x - - - - -

curs_inopts 3x

-
-
-
-curs_inopts(3x)                                         curs_inopts(3x)
-
-
-
-
-
-

NAME

-       cbreak, nocbreak, echo, noecho, halfdelay, intrflush,
-       keypad, meta, nodelay, notimeout, raw, noraw, noqiflush,
-       qiflush, timeout, wtimeout, typeahead - curses input
-       options
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int cbreak(void);
-       int nocbreak(void);
-       int echo(void);
-       int noecho(void);
-       int halfdelay(int tenths);
-       int intrflush(WINDOW *win, bool bf);
-       int keypad(WINDOW *win, bool bf);
-       int meta(WINDOW *win, bool bf);
-       int nodelay(WINDOW *win, bool bf);
-       int raw(void);
-       int noraw(void);
-       void noqiflush(void);
-       void qiflush(void);
-       int notimeout(WINDOW *win, bool bf);
-       void timeout(int delay);
-       void wtimeout(WINDOW *win, int delay);
-       int typeahead(int fd);
-
-
-
-

DESCRIPTION

-       Normally, the tty driver buffers typed characters until  a
-       newline  or  carriage return is typed.  The cbreak routine
-       disables line buffering and erase/kill  character-process-
-       ing  (interrupt  and flow control characters are unaffect-
-       ed), making  characters  typed  by  the  user  immediately
-       available  to  the  program.  The nocbreak routine returns
-       the terminal to normal (cooked) mode.
-
-       Initially the terminal may or may not be in  cbreak  mode,
-       as the mode is inherited; therefore, a program should call
-       cbreak or nocbreak explicitly.  Most interactive  programs
-       using  curses set the cbreak mode.  Note that cbreak over-
-       rides raw.  [See curs_getch(3x) for a  discussion  of  how
-       these routines interact with echo and noecho.]
-
-       The  echo  and  noecho routines control whether characters
-       typed by the user are echoed by getch as they  are  typed.
-       Echoing by the tty driver is always disabled, but initial-
-       ly getch is in echo mode, so characters typed are  echoed.
-       Authors  of  most  interactive programs prefer to do their
-       own echoing in a controlled area of the screen, or not  to
-       echo  at  all,  so they disable echoing by calling noecho.
-       [See curs_getch(3x) for a discussion of how these routines
-       interact with cbreak and nocbreak.]
-
-       The  halfdelay  routine is used for half-delay mode, which
-       is similar to cbreak mode in that characters typed by  the
-       user  are  immediately available to the program.  However,
-       after blocking for tenths tenths of seconds,  ERR  is  re-
-       turned  if  nothing  has  been typed.  The value of tenths
-       must be a number between 1 and 255.  Use nocbreak to leave
-       half-delay mode.
-
-       If  the intrflush option is enabled, (bf is TRUE), when an
-       interrupt key  is  pressed  on  the  keyboard  (interrupt,
-       break,  quit)  all  output in the tty driver queue will be
-       flushed, giving the effect of faster response to  the  in-
-       terrupt, but causing curses to have the wrong idea of what
-       is on the screen.  Disabling (bf  is  FALSE),  the  option
-       prevents  the flush.  The default for the option is inher-
-       ited from the tty driver settings.  The window argument is
-       ignored.
-
-       The  keypad option enables the keypad of the user's termi-
-       nal.  If enabled (bf is TRUE), the user can press a  func-
-       tion  key (such as an arrow key) and wgetch returns a sin-
-       gle value representing the function key, as  in  KEY_LEFT.
-       If  disabled (bf is FALSE), curses does not treat function
-       keys specially and the program has to interpret the escape
-       sequences  itself.   If  the keypad in the terminal can be
-       turned on (made to transmit) and off (made to work  local-
-       ly),  turning on this option causes the terminal keypad to
-       be turned on when wgetch is called.  The default value for
-       keypad is false.
-
-       Initially, whether the terminal returns 7 or 8 significant
-       bits on input depends on the control mode of the tty driv-
-       er  [see  termio(7)].  To force 8 bits to be returned, in-
-       voke meta(win, TRUE); this is equivalent, under POSIX,  to
-       setting  the CS8 flag on the terminal.  To force 7 bits to
-       be returned, invoke meta(win, FALSE); this is  equivalent,
-       under POSIX, to setting the CS7 flag on the terminal.  The
-       window argument, win, is always ignored.  If the  terminfo
-       capabilities  smm (meta_on) and rmm (meta_off) are defined
-       for the  terminal,  smm  is  sent  to  the  terminal  when
-       meta(win,  TRUE)  is called and rmm is sent when meta(win,
-       FALSE) is called.
-
-       The nodelay option causes getch to be a non-blocking call.
-       If  no input is ready, getch returns ERR.  If disabled (bf
-       is FALSE), getch waits until a key is pressed.
-
-       While interpreting an input escape sequence, wgetch sets a
-       timer  while  waiting  for the next character.  If notime-
-       out(win, TRUE) is called,  then  wgetch  does  not  set  a
-       timer.  The purpose of the timeout is to differentiate be-
-       tween sequences received from a  function  key  and  those
-       typed by a user.
-
-       The  raw and noraw routines place the terminal into or out
-       of raw mode.  Raw mode is similar to cbreak mode, in  that
-       characters typed are immediately passed through to the us-
-       er program.  The differences are that in raw mode, the in-
-       terrupt,  quit,  suspend,  and flow control characters are
-       all passed through uninterpreted, instead of generating  a
-       signal.   The  behavior  of the BREAK key depends on other
-       bits in the tty driver that are not set by curses.
-
-       When the noqiflush routine is used, normal flush of  input
-       and  output queues associated with the INTR, QUIT and SUSP
-       characters will not be done [see termio(7)].  When qiflush
-       is  called,  the queues will be flushed when these control
-       characters are read.  You may want to call noqiflush()  in
-       a  signal handler if you want output to continue as though
-       the interrupt had not occurred, after the handler exits.
-
-       The timeout and wtimeout routines  set  blocking  or  non-
-       blocking  read  for a given window.  If delay is negative,
-       blocking read is used (i.e., waits  indefinitely  for  in-
-       put).   If  delay  is zero, then non-blocking read is used
-       (i.e., read returns ERR if no input is waiting).  If delay
-       is  positive, then read blocks for delay milliseconds, and
-       returns ERR if there is still no input.  Hence, these rou-
-       tines  provide the same functionality as nodelay, plus the
-       additional capability of being able to block for only  de-
-       lay milliseconds (where delay is positive).
-
-       The  curses library does ``line-breakout optimization'' by
-       looking for  typeahead  periodically  while  updating  the
-       screen.   If  input is found, and it is coming from a tty,
-       the current update is postponed until refresh or  doupdate
-       is  called again.  This allows faster response to commands
-       typed in advance.  Normally, the input FILE pointer passed
-       to  newterm,  or  stdin in the case that initscr was used,
-       will be used to do this typeahead checking.  The typeahead
-       routine  specifies  that  the  file descriptor fd is to be
-       used to check for typeahead instead.  If fd is -1, then no
-       typeahead checking is done.
-
-
-
-

RETURN VALUE

-       All  routines that return an integer return ERR upon fail-
-       ure and OK (SVr4 specifies only "an  integer  value  other
-       than  ERR")  upon  successful completion, unless otherwise
-       noted in the preceding routine descriptions.
-
-       X/Open does not define any error conditions.  In this  im-
-       plementation,  functions  with a window parameter will re-
-       turn an error if it is null.  Any function will  also  re-
-       turn an error if the terminal was not initialized.  Also,
-
-              halfdelay
-                   returns  an  error if its parameter is outside
-                   the range 1..255.
-
-
-
-

PORTABILITY

-       These functions are described in the XSI Curses  standard,
-       Issue 4.
-
-       The  ncurses  library obeys the XPG4 standard and the his-
-       torical practice of the AT&T  curses  implementations,  in
-       that  the  echo bit is cleared when curses initializes the
-       terminal state.  BSD curses differed from  this  slightly;
-       it left the echo bit on at initialization, but the BSD raw
-       call turned it off as a side-effect.  For best  portabili-
-       ty,  set  echo or noecho explicitly just after initializa-
-       tion, even if your program remains in cooked mode.
-
-
-
-

NOTES

-       Note that echo, noecho, halfdelay, intrflush, meta,  node-
-       lay,  notimeout, noqiflush, qiflush, timeout, and wtimeout
-       may be macros.
-
-       The noraw and nocbreak calls follow historical practice in
-       that  they  attempt  to  restore to normal (`cooked') mode
-       from raw and cbreak modes respectively.  Mixing  raw/noraw
-       and  cbreak/nocbreak  calls  leads  to  tty driver control
-       states that are hard to predict or understand; it  is  not
-       recommended.
-
-
-
-

SEE ALSO

-       curses(3x), curs_getch(3x), curs_initscr(3x), termio(7)
-
-
-
-                                                        curs_inopts(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_ins_wch.3x.html b/doc/html/man/curs_ins_wch.3x.html deleted file mode 100644 index 2b3714c55dd..00000000000 --- a/doc/html/man/curs_ins_wch.3x.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - -curs_ins_wch 3x - - - - -

curs_ins_wch 3x

-
-
-
-curs_ins_wch(3x)                                       curs_ins_wch(3x)
-
-
-
-
-
-

NAME

-       ins_wch,  mvins_wch,  mvwins_wch, wins_wch - insert a com-
-       plex character and rendition into a window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int ins_wch(const cchar_t *wch);
-       int wins_wch(WINDOW *win, const cchar_t *wch);
-       int mvins_wch(int y, int x, const cchar_t *wch);
-       int mvwins_wch(WINDOW *win, int y, int  x,  const  cchar_t
-       *wch);
-
-
-
-

DESCRIPTION

-       These routines, insert the complex character wch with ren-
-       dition before the character under the cursor.  All charac-
-       ters to the right of the cursor are moved one space to the
-       right, with the possibility of the rightmost character  on
-       the  line  being  lost.   The insertion operation does not
-       change the cursor position.
-
-
-
-

RETURN VALUE

-       If successful, these functions return OK.   If  not,  they
-       return ERR.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

ERRORS

-       No errors are defined.
-
-
-
-

SEE ALSO

-       curses(3x), curs_insch(3x).
-
-
-
-                                                       curs_ins_wch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_ins_wstr.3x.html b/doc/html/man/curs_ins_wstr.3x.html deleted file mode 100644 index 5f7cee6142c..00000000000 --- a/doc/html/man/curs_ins_wstr.3x.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -curs_ins_wstr 3x - - - - -

curs_ins_wstr 3x

-
-
-
-curs_ins_wstr(3x)                                     curs_ins_wstr(3x)
-
-
-
-
-
-

NAME

-       ins_wstr, ins_nwstr, wins_wstr, wins_nwstr, mvins_wstr,
-       mvins_nwstr, mvwins_wstr, mvwins_nwstr - insert a wide-
-       character string into a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int ins_wstr(const wchar_t *wstr);
-       int ins_nwstr(const wchar_t *wstr, int n);
-       int wins_wstr(WINDOW *win, const wchar_t *wstr);
-       int wins_nwstr(WINDOW *win, const wchar_t *wstr, int n);
-       int mvins_wstr(int y, int x, const wchar_t *wstr);
-       int mvins_nwstr(int y, int x, const wchar_t *wstr, int n);
-       int mvwins_wstr(WINDOW *win, int y, int x, const wchar_t *wstr);
-       int mvwins_nwstr(WINDOW *win, int y, int x, const wchar_t *wstr, int n);
-
-
-
-

DESCRIPTION

-       These  routines insert a wchar_t character string (as many
-       characters as will fit on the line) before  the  character
-       under the cursor.  All characters to the right of the cur-
-       sor are shifted right, with the possibility of the  right-
-       most  characters  on  the line being lost.  No wrapping is
-       performed.  The cursor position  does  not  change  (after
-       moving  to  y, x, if specified).  The four routines with n
-       as the last argument insert a leading substring of at most
-       n  wchar_t  characters.   If  n is less than 1, the entire
-       string is inserted.
-
-       If a character in wstr is a tab, newline, carriage  return
-       or backspace, the cursor is moved appropriately within the
-       window.  A newline also does  a  clrtoeol  before  moving.
-       Tabs  are  considered  to be at every eighth column.  If a
-       character in wstr is  another  control  character,  it  is
-       drawn  in the ^X notation.  Calling win_wch after adding a
-       control character (and moving to it,  if  necessary)  does
-       not  return  the  control character, but instead returns a
-       character in the ^-representation of the  control  charac-
-       ter.
-
-
-
-

NOTES

-       Note that all but wins_nwstr may be macros.
-
-       If the first character in the string is a nonspacing char-
-       acter, these functions will fail.   XSI  does  not  define
-       what  will happen if a nonspacing character follows a con-
-       trol character.
-
-
-
-

RETURN VALUES

-       Upon successful completion,  these  functions  return  OK.
-       Otherwise, they return ERR.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

SEE ALSO

-       curses(3x),        curs_insstr(3x),       curs_in_wch(3x),
-       curs_ins_wch(3x).
-
-
-
-                                                      curs_ins_wstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_insch.3x.html b/doc/html/man/curs_insch.3x.html deleted file mode 100644 index f8c833eb5c8..00000000000 --- a/doc/html/man/curs_insch.3x.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - -curs_insch 3x - - - - -

curs_insch 3x

-
-
-
-curs_insch(3x)                                           curs_insch(3x)
-
-
-
-
-
-

NAME

-       insch,  winsch,  mvinsch,  mvwinsch  -  insert a character
-       before cursor in a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int insch(chtype ch);
-       int winsch(WINDOW *win, chtype ch);
-       int mvinsch(int y, int x, chtype ch);
-       int mvwinsch(WINDOW *win, int y, int x, chtype ch);
-
-
-
-

DESCRIPTION

-       These routines insert the character ch before the  charac-
-       ter  under the cursor.  All characters to the right of the
-       cursor are moved one space to the right, with  the  possi-
-       bility  of the rightmost character on the line being lost.
-       The insertion operation does not change the  cursor  posi-
-       tion.
-
-
-
-

RETURN VALUE

-       All  routines that return an integer return ERR upon fail-
-       ure and OK (SVr4 specifies only "an  integer  value  other
-       than  ERR")  upon  successful completion, unless otherwise
-       noted in the preceding routine descriptions.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       These routines do not necessarily imply use of a  hardware
-       insert character feature.
-
-       Note that insch, mvinsch, and mvwinsch may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x).
-
-       Comparable  functions  in  the  wide-character  (ncursesw)
-       library are described in curs_ins_wch(3x).
-
-
-
-                                                         curs_insch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_insstr.3x.html b/doc/html/man/curs_insstr.3x.html deleted file mode 100644 index 7a616489e6d..00000000000 --- a/doc/html/man/curs_insstr.3x.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - -curs_insstr 3x - - - - -

curs_insstr 3x

-
-
-
-curs_insstr(3x)                                         curs_insstr(3x)
-
-
-
-
-
-

NAME

-       insstr,  insnstr,  winsstr, winsnstr, mvinsstr, mvinsnstr,
-       mvwinsstr, mvwinsnstr - insert string before cursor  in  a
-       curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       int insstr(const char *str);
-       int insnstr(const char *str, int n);
-       int winsstr(WINDOW *win, const char *str);
-       int winsnstr(WINDOW *win, const char *str, int n);
-       int mvinsstr(int y, int x, const char *str);
-       int mvinsnstr(int y, int x, const char *str, int n);
-       int mvwinsstr(WINDOW *win, int y, int x, const char *str);
-       int mvwinsnstr(WINDOW *win, int y, int x, const char *str,
-       int n);
-
-
-
-

DESCRIPTION

-       These routines insert a character string (as many  charac-
-       ters  as  will fit on the line) before the character under
-       the cursor.  All characters to the right of the cursor are
-       shifted  right with the possibility of the rightmost char-
-       acters on the line being lost.  The cursor  position  does
-       not  change  (after  moving  to  y, x, if specified).  The
-       functions with n as the last  argument  insert  a  leading
-       substring  of  at  most  n  characters.  If n<=0, then the
-       entire string is inserted.
-
-       Special characters are handled as in addch.
-
-
-
-

RETURN VALUE

-       All routines that return an integer return ERR upon  fail-
-       ure  and  OK  (SVr4 specifies only "an integer value other
-       than ERR") upon successful  completion,  unless  otherwise
-       noted in the preceding routine descriptions.
-
-       X/Open  defines  no error conditions.  In this implementa-
-       tion, if the window parameter is null or the str parameter
-       is null, an error is returned.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that all but winsnstr may be macros.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4, which adds const qualifiers to the arguments.
-
-       The Single  Unix  Specification,  Version  2  states  that
-       insnstr  and  winsnstr perform wrapping.  This is probably
-       an error, since it makes this group of functions inconsis-
-       tent.   Also,  no  implementation of curses documents this
-       inconsistency.
-
-
-
-

SEE ALSO

-       curses(3x), curs_util(3x), curs_clear(3x), curs_inch(3x).
-
-
-
-                                                        curs_insstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_instr.3x.html b/doc/html/man/curs_instr.3x.html deleted file mode 100644 index 0f32d58eae6..00000000000 --- a/doc/html/man/curs_instr.3x.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - -curs_instr 3x - - - - -

curs_instr 3x

-
-
-
-curs_instr(3x)                                           curs_instr(3x)
-
-
-
-
-
-

NAME

-       instr,  innstr, winstr, winnstr, mvinstr, mvinnstr, mvwin-
-       str, mvwinnstr - get a string of characters from a  curses
-       window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int instr(char *str);
-       int innstr(char *str, int n);
-       int winstr(WINDOW *win, char *str);
-       int winnstr(WINDOW *win, char *str, int n);
-       int mvinstr(int y, int x, char *str);
-       int mvinnstr(int y, int x, char *str, int n);
-       int mvwinstr(WINDOW *win, int y, int x, char *str);
-       int  mvwinnstr(WINDOW  *win,  int y, int x, char *str, int
-       n);
-
-
-
-

DESCRIPTION

-       These routines return  a  string  of  characters  in  str,
-       extracted  starting  at the current cursor position in the
-       named window.  Attributes are stripped  from  the  charac-
-       ters.   The  four  functions  with  n as the last argument
-       return a leading  substring  at  most  n  characters  long
-       (exclusive of the trailing NUL).
-
-
-
-

RETURN VALUE

-       All  of the functions return ERR upon failure, or the num-
-       ber of characters actually read into the string.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion, if the window parameter is null or the str parameter
-       is null, a zero is returned.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

NOTES

-       Note that all routines except winnstr may be macros.
-
-
-
-

PORTABILITY

-       SVr4 does not document whether a length limit includes  or
-       excludes the trailing NUL.
-
-       The  ncurses library extends the XSI description by allow-
-       ing a negative value for n.  In this case,  the  functions
-       return the string ending at the right margin.
-
-
-
-

SEE ALSO

-       curses(3x).
-
-
-
-                                                         curs_instr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_inwstr.3x.html b/doc/html/man/curs_inwstr.3x.html deleted file mode 100644 index 223c398de20..00000000000 --- a/doc/html/man/curs_inwstr.3x.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - -curs_inwstr 3x - - - - -

curs_inwstr 3x

-
-
-
-curs_inwstr(3x)                                         curs_inwstr(3x)
-
-
-
-
-
-

NAME

-       inwstr,  innwstr,  winwstr, winnwstr, mvinwstr, mvinnwstr,
-       mvwinwstr, mvwinnwstr - get a string of wchar_t characters
-       from a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int inwstr(wchar_t *str);
-       int innwstr(wchar_t *str, int n);
-       int winwstr(WINDOW *win, wchar_t *str);
-       int winnwstr(WINDOW *win, wchar_t *str, int n);
-       int mvinwstr(int y, int x, wchar_t *str);
-       int mvinnwstr(int y, int x, wchar_t *str, int n);
-       int mvwinwstr(WINDOW *win, int y, int x, wchar_t *str);
-       int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *str, int n);
-
-
-
-

DESCRIPTION

-       These  routines  return  a string of wchar_t characters in
-       wstr, extracted starting at the current cursor position in
-       the  named window.  Attributes are stripped from the char-
-       acters.  The four functions with n as  the  last  argument
-       return a leading substring at most n bytes long (exclusive
-       of the trailing NUL).  Transfer stops at the  end  of  the
-       current  line,  or  when  n  bytes have been stored at the
-       location referenced by wstr.
-
-       If the size n is not large  enough  to  store  a  complete
-       character, an error is generated.
-
-
-
-

NOTES

-       Note that all routines except winnwstr may be macros.
-
-
-
-

RETURN VALUES

-       All routines return ERR upon failure. Upon successful com-
-       pletion, the *inwstr routines return OK, and the  *innwstr
-       routines  return  the  number  of characters read into the
-       string.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

SEE ALSO

-       curses(3x), curs_instr(3x), curs_in_wchstr(3x)
-
-
-
-                                                        curs_inwstr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_kernel.3x.html b/doc/html/man/curs_kernel.3x.html deleted file mode 100644 index a2e247cea51..00000000000 --- a/doc/html/man/curs_kernel.3x.html +++ /dev/null @@ -1,206 +0,0 @@ - - - - -curs_kernel 3x - - - - -

curs_kernel 3x

-
-
-
-curs_kernel(3x)                                         curs_kernel(3x)
-
-
-
-
-
-

NAME

-       def_prog_mode, def_shell_mode, reset_prog_mode,
-       reset_shell_mode, resetty, savetty, getsyx, setsyx,
-       ripoffline, curs_set, napms - low-level curses routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int def_prog_mode(void);
-       int def_shell_mode(void);
-       int reset_prog_mode(void);
-       int reset_shell_mode(void);
-       int resetty(void);
-       int savetty(void);
-       void getsyx(int y, int x);
-       void setsyx(int y, int x);
-       int ripoffline(int line, int (*init)(WINDOW *, int));
-       int curs_set(int visibility);
-       int napms(int ms);
-
-
-
-

DESCRIPTION

-       The  following  routines  give low-level access to various
-       curses capabilities.  These routines  typically  are  used
-       inside library routines.
-
-       The  def_prog_mode  and  def_shell_mode  routines save the
-       current terminal modes as the  "program"  (in  curses)  or
-       "shell"   (not  in  curses)  state  for  use  by  the  re-
-       set_prog_mode and reset_shell_mode routines.  This is done
-       automatically by initscr.  There is one such save area for
-       each screen context allocated by newterm().
-
-       The reset_prog_mode and reset_shell_mode routines  restore
-       the  terminal  to "program" (in curses) or "shell" (out of
-       curses) state.  These are  done  automatically  by  endwin
-       and,  after  an  endwin, by doupdate, so they normally are
-       not called.
-
-       The resetty and savetty  routines  save  and  restore  the
-       state  of  the  terminal modes.  savetty saves the current
-       state in a buffer and resetty restores the state  to  what
-       it was at the last call to savetty.
-
-       The  getsyx routine returns the current coordinates of the
-       virtual screen cursor in y and x.  If leaveok is currently
-       TRUE,  then -1,-1 is returned.  If lines have been removed
-       from the top of the screen, using ripoffline, y and x  in-
-       clude  these lines; therefore, y and x should be used only
-       as arguments for setsyx.
-
-       The setsyx routine sets the virtual screen cursor to y, x.
-       If y and x are both -1, then leaveok is set.  The two rou-
-       tines getsyx and setsyx are designed to be used by  a  li-
-       brary  routine,  which manipulates curses windows but does
-       not want to change the current position of  the  program's
-       cursor.   The library routine would call getsyx at the be-
-       ginning, do its manipulation of  its  own  windows,  do  a
-       wnoutrefresh  on  its  windows, call setsyx, and then call
-       doupdate.
-
-       The ripoffline routine provides access to the same facili-
-       ty  that  slk_init  [see  curs_slk(3x)] uses to reduce the
-       size of the screen.   ripoffline  must  be  called  before
-       initscr or newterm is called.  If line is positive, a line
-       is removed from the top of stdscr; if line is negative,  a
-       line is removed from the bottom.  When this is done inside
-       initscr, the routine init (supplied by the user) is called
-       with  two arguments: a window pointer to the one-line win-
-       dow that has been allocated and an integer with the number
-       of columns in the window.  Inside this initialization rou-
-       tine, the integer variables LINES  and  COLS  (defined  in
-       <curses.h>) are not guaranteed to be accurate and wrefresh
-       or doupdate must not be called.  It is allowable  to  call
-       wnoutrefresh during the initialization routine.
-
-       ripoffline  can  be called up to five times before calling
-       initscr or newterm.
-
-       The curs_set routine sets the cursor state  to  invisible,
-       normal, or very visible for visibility equal to 0, 1, or 2
-       respectively.  If the terminal supports the visibility re-
-       quested, the previous cursor state is returned; otherwise,
-       ERR is returned.
-
-       The napms routine is used to sleep for ms milliseconds.
-
-
-
-

RETURN VALUE

-       Except for curs_set, these routines always return OK.
-
-       curs_set returns the previous cursor state, or ERR if  the
-       requested visibility is not supported.
-
-       X/Open  defines  no error conditions.  In this implementa-
-       tion
-
-              def_prog_mode, def_shell_mode, reset_prog_mode, re-
-              set_shell_mode
-                   return  an  error if the terminal was not ini-
-                   tialized, or if the I/O  call  to  obtain  the
-                   terminal settings fails.
-
-              ripoffline
-                   returns  an  error  if  the  maximum number of
-                   ripped-off lines exceeds the maximum (NRIPS  =
-                   5).
-
-
-
-

NOTES

-       Note  that getsyx is a macro, so & is not necessary before
-       the variables y and x.
-
-       Older SVr4  man  pages  warn  that  the  return  value  of
-       curs_set  "is  currently  incorrect".  This implementation
-       gets it right, but it may be unwise to count on  the  cor-
-       rectness of the return value anywhere else.
-
-       Both  ncurses  and  SVr4  will  call curs_set in endwin if
-       curs_set has been called to make  the  cursor  other  than
-       normal,  i.e., either invisible or very visible.  There is
-       no way for ncurses to determine the initial  cursor  state
-       to restore that.
-
-
-
-

PORTABILITY

-       The  functions  setsyx and getsyx are not described in the
-       XSI Curses standard, Issue 4.  All other functions are  as
-       described in XSI Curses.
-
-       The SVr4 documentation describes setsyx and getsyx as hav-
-       ing return type int.  This  is  misleading,  as  they  are
-       macros with no documented semantics for the return value.
-
-
-
-

SEE ALSO

-       curses(3x),  curs_initscr(3x),  curs_outopts(3x), curs_re-
-       fresh(3x),  curs_scr_dump(3x),  curs_slk(3x),   curs_vari-
-       ables(3x).
-
-
-
-                                                        curs_kernel(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_legacy.3x.html b/doc/html/man/curs_legacy.3x.html deleted file mode 100644 index 5a86252fbcb..00000000000 --- a/doc/html/man/curs_legacy.3x.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - -curs_legacy 3x - - - - -

curs_legacy 3x

-
-
-
-curs_legacy(3x)                                         curs_legacy(3x)
-
-
-
-
-
-

NAME

-       getattrs  -  get  curses  cursor  and  window coordinates,
-       attributes
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int getattrs(WINDOW *win);
-       int getbegx(WINDOW *win);
-       int getbegy(WINDOW *win);
-       int getcurx(WINDOW *win);
-       int getcury(WINDOW *win);
-       int getmaxx(WINDOW *win);
-       int getmaxy(WINDOW *win);
-       int getparx(WINDOW *win);
-       int getpary(WINDOW *win);
-
-
-
-

DESCRIPTION

-       The getbegy and getbegx functions return the same data  as
-       getbegyx.
-
-       The  getcury and getcurx functions return the same data as
-       getyx.
-
-       The getmaxy and getmaxx functions return the same data  as
-       getmaxyx.
-
-       The  getpary and getparx functions return the same data as
-       getparyx.
-
-
-
-

RETURN VALUE

-       These functions return an integer, or ERR  if  the  window
-       parameter is null.
-
-
-
-

NOTES

-       All  of  these interfaces are provided as macros and func-
-       tions.  The macros are suppressed (and only the  functions
-       provided)  when  NCURSES_OPAQUE  is defined.  The standard
-       forms such as getyx must be implemented as macros, and (in
-       this implementation) are defined in terms of the functions
-       described here, to avoid reliance on internal  details  of
-       the WINDOW structure.
-
-
-
-

PORTABILITY

-       These functions were supported on Version 7, BSD or System
-       V implementations.
-
-
-
-

SEE ALSO

-       curses(3x), curs_getyx(3x), curs_opaque(3x)
-
-
-
-                                                        curs_legacy(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_memleaks.3x.html b/doc/html/man/curs_memleaks.3x.html deleted file mode 100644 index 540ea935a4c..00000000000 --- a/doc/html/man/curs_memleaks.3x.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - -curs_memleaks 3x - - - - -

curs_memleaks 3x

-
-
-
-curs_memleaks(3x)                                     curs_memleaks(3x)
-
-
-
-
-
-

NAME

-       _nc_freeall _nc_free_and_exit - curses memory-leak
-       checking
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       void _nc_freeall(void);
-       void _nc_free_and_exit(int);
-
-
-
-

DESCRIPTION

-       These functions are used to simplify  analysis  of  memory
-       leaks  in  the  ncurses  library.   They  are normally not
-       available; they must be configured  into  the  library  at
-       build  time  using  the --disable-leaks option.  That com-
-       piles-in code that frees memory that normally would not be
-       freed.
-
-       Any  implementation of curses must not free the memory as-
-       sociated with a screen, since (even after calling endwin),
-       it  must be available for use in the next call to refresh.
-       There are also chunks of memory held for performance  rea-
-       sons.   That  makes it hard to analyze curses applications
-       for memory leaks.  To work around this, one  can  build  a
-       debugging version of the ncurses library which frees those
-       chunks which it can, and provides these functions to  free
-       all of the memory allocated by the ncurses library.
-
-       The  _nc_free_and_exit function is the preferred one since
-       some of the memory which is freed may be required for  the
-       application  to  continue  running.   Its parameter is the
-       code to pass to the exit routine.
-
-
-
-

RETURN VALUE

-       These functions do not return a value.
-
-
-
-

PORTABILITY

-       These functions are not part of the XSI interface.
-
-
-
-

SEE ALSO

-       curses(3x).
-
-
-
-                                                      curs_memleaks(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_mouse.3x.html b/doc/html/man/curs_mouse.3x.html deleted file mode 100644 index d640680c201..00000000000 --- a/doc/html/man/curs_mouse.3x.html +++ /dev/null @@ -1,318 +0,0 @@ - - - - -curs_mouse 3x - - - - -

curs_mouse 3x

-
-
-
-curs_mouse(3x)                                           curs_mouse(3x)
-
-
-
-
-
-

NAME

-       has_mouse, getmouse, ungetmouse, mousemask, wenclose,
-       mouse_trafo, wmouse_trafo, mouseinterval - mouse interface
-       through curses
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       typedef unsigned long mmask_t;
-
-       typedef struct
-       {
-           short id;         /* ID to distinguish multiple devices */
-           int x, y, z;      /* event coordinates */
-           mmask_t bstate;   /* button state bits */
-       }
-       MEVENT;
-       bool has_mouse(void);
-       int getmouse(MEVENT *event);
-       int ungetmouse(MEVENT *event);
-       mmask_t mousemask(mmask_t newmask, mmask_t *oldmask);
-       bool wenclose(const WINDOW *win, int y, int x);
-       bool mouse_trafo(int* pY, int* pX, bool to_screen);
-       bool wmouse_trafo(const WINDOW* win, int* pY, int* pX,
-            bool to_screen);
-       int mouseinterval(int erval);
-
-
-
-

DESCRIPTION

-       These  functions provide an interface to mouse events from
-       ncurses(3x).  Mouse events are  represented  by  KEY_MOUSE
-       pseudo-key values in the wgetch input stream.
-
-       To  make mouse events visible, use the mousemask function.
-       This will set the mouse events to  be  reported.   By  de-
-       fault,  no  mouse  events are reported.  The function will
-       return a mask to indicate which  of  the  specified  mouse
-       events  can be reported; on complete failure it returns 0.
-       If oldmask is non-NULL, this function fills the  indicated
-       location  with  the  previous  value of the given window's
-       mouse event mask.
-
-       As a side effect, setting a zero mousemask  may  turn  off
-       the  mouse pointer; setting a nonzero mask may turn it on.
-       Whether this happens is device-dependent.
-
-       Here are the mouse event type masks which may be defined:
-
-
-       Name                     Description
-       ---------------------------------------------------------------------
-       BUTTON1_PRESSED          mouse button 1 down
-       BUTTON1_RELEASED         mouse button 1 up
-       BUTTON1_CLICKED          mouse button 1 clicked
-       BUTTON1_DOUBLE_CLICKED   mouse button 1 double clicked
-       BUTTON1_TRIPLE_CLICKED   mouse button 1 triple clicked
-       ---------------------------------------------------------------------
-       BUTTON2_PRESSED          mouse button 2 down
-       BUTTON2_RELEASED         mouse button 2 up
-       BUTTON2_CLICKED          mouse button 2 clicked
-       BUTTON2_DOUBLE_CLICKED   mouse button 2 double clicked
-
-
-       BUTTON2_TRIPLE_CLICKED   mouse button 2 triple clicked
-       ---------------------------------------------------------------------
-       BUTTON3_PRESSED          mouse button 3 down
-       BUTTON3_RELEASED         mouse button 3 up
-       BUTTON3_CLICKED          mouse button 3 clicked
-       BUTTON3_DOUBLE_CLICKED   mouse button 3 double clicked
-       BUTTON3_TRIPLE_CLICKED   mouse button 3 triple clicked
-       ---------------------------------------------------------------------
-       BUTTON4_PRESSED          mouse button 4 down
-       BUTTON4_RELEASED         mouse button 4 up
-       BUTTON4_CLICKED          mouse button 4 clicked
-       BUTTON4_DOUBLE_CLICKED   mouse button 4 double clicked
-       BUTTON4_TRIPLE_CLICKED   mouse button 4 triple clicked
-       ---------------------------------------------------------------------
-       BUTTON5_PRESSED          mouse button 5 down
-       BUTTON5_RELEASED         mouse button 5 up
-       BUTTON5_CLICKED          mouse button 5 clicked
-       BUTTON5_DOUBLE_CLICKED   mouse button 5 double clicked
-       BUTTON5_TRIPLE_CLICKED   mouse button 5 triple clicked
-       ---------------------------------------------------------------------
-       BUTTON_SHIFT             shift was down during button state change
-       BUTTON_CTRL              control was down during button state change
-       BUTTON_ALT               alt was down during button state change
-       ALL_MOUSE_EVENTS         report all button state changes
-       REPORT_MOUSE_POSITION    report mouse movement
-       ---------------------------------------------------------------------
-
-       Once a class of mouse events have been made visible  in  a
-       window, calling the wgetch function on that window may re-
-       turn KEY_MOUSE as an indicator that a mouse event has been
-       queued.   To read the event data and pop the event off the
-       queue, call getmouse.  This function will return OK  if  a
-       mouse  event  is actually visible in the given window, ERR
-       otherwise.  When getmouse returns OK, the  data  deposited
-       as  y  and  x  in  the event structure coordinates will be
-       screen-relative character-cell coordinates.  The  returned
-       state  mask  will have exactly one bit set to indicate the
-       event type.  The corresponding data in the queue is marked
-       invalid.   A subsequent call to getmouse will retrieve the
-       next older item from the queue.
-
-       The ungetmouse function behaves  analogously  to  ungetch.
-       It  pushes a KEY_MOUSE event onto the input queue, and as-
-       sociates with that event the given state data and  screen-
-       relative character-cell coordinates.
-
-       The  wenclose  function  tests  whether  a  given  pair of
-       screen-relative character-cell coordinates is enclosed  by
-       a  given  window, returning TRUE if it is and FALSE other-
-       wise.  It is useful for determining  what  subset  of  the
-       screen windows enclose the location of a mouse event.
-
-       The wmouse_trafo function transforms a given pair of coor-
-       dinates from stdscr-relative  coordinates  to  coordinates
-       relative to the given window or vice versa.  Please remem-
-       ber, that stdscr-relative coordinates are not always iden-
-       tical  to window-relative coordinates due to the mechanism
-       to reserve lines on top or bottom of the screen for  other
-       purposes (see the ripoffline() and slk_init calls, for ex-
-       ample).  If the parameter to_screen is TRUE, the  pointers
-       pY, pX must reference the coordinates of a location inside
-       the window win.  They are converted to window-relative co-
-       ordinates  and returned through the pointers.  If the con-
-       version was successful, the function returns TRUE.  If one
-       of  the  parameters was NULL or the location is not inside
-       the window, FALSE is returned.  If to_screen is FALSE, the
-       pointers  pY,  pX  must  reference window-relative coordi-
-       nates.  They are converted to stdscr-relative  coordinates
-       if  the  window win encloses this point.  In this case the
-       function returns TRUE.  If one of the parameters  is  NULL
-       or  the point is not inside the window, FALSE is returned.
-       Please notice, that the referenced  coordinates  are  only
-       replaced  by  the converted coordinates if the transforma-
-       tion was successful.
-
-       The mouse_trafo function performs the same translation  as
-       wmouse_trafo, using stdscr for win.
-
-       The mouseinterval function sets the maximum time (in thou-
-       sands of a second) that can elapse between press  and  re-
-       lease  events  for  them to be recognized as a click.  Use
-       mouseinterval(0) to disable click resolution.  This  func-
-       tion returns the previous interval value.  Use mouseinter-
-       val(-1) to obtain the interval without altering  it.   The
-       default is one sixth of a second.
-
-       The  has_mouse  function  returns TRUE if the mouse driver
-       has been successfully initialized.
-
-       Note that mouse events will be ignored when  input  is  in
-       cooked mode, and will cause an error beep when cooked mode
-       is being simulated in a window by a function such as  get-
-       str that expects a linefeed for input-loop termination.
-
-
-
-

RETURN VALUE

-       getmouse  and ungetmouse return the integer ERR upon fail-
-       ure or OK upon successful completion.
-
-              getmouse
-                   returns an error.  If no mouse driver was ini-
-                   tialized, or if the mask parameter is zero, it
-                   also returns an error if no more events remain
-                   in the queue.
-
-              ungetmouse
-                   returns an error if the FIFO is full.
-
-       mousemask returns the mask of reportable events.
-
-       mouseinterval  returns the previous interval value, unless
-       the terminal was not initialized.  In that  case,  it  re-
-       turns the maximum interval value (166).
-
-       wenclose  and wmouse_trafo are boolean functions returning
-       TRUE or FALSE depending on their test result.
-
-
-
-

PORTABILITY

-       These calls were designed for  ncurses(3x),  and  are  not
-       found in SVr4 curses, 4.4BSD curses, or any other previous
-       version of curses.
-
-       The feature macro NCURSES_MOUSE_VERSION is provided so the
-       preprocessor  can  be  used to test whether these features
-       are present.  If the interface is changed,  the  value  of
-       NCURSES_MOUSE_VERSION  will  be incremented.  These values
-       for NCURSES_MOUSE_VERSION may be specified when  configur-
-       ing ncurses:
-
-              1  has  definitions  for reserved events.  The mask
-                 uses 28 bits.
-
-              2  adds definitions for button 5, removes the defi-
-                 nitions  for  reserved events.  The mask uses 29
-                 bits.
-
-       The order of the MEVENT structure members is  not  guaran-
-       teed.   Additional fields may be added to the structure in
-       the future.
-
-       Under ncurses(3x), these calls are implemented  using  ei-
-       ther  xterm's built-in mouse-tracking API or platform-spe-
-       cific drivers including
-              Alessandro Rubini's gpm server
-              FreeBSD sysmouse
-              OS/2 EMX
-       If you  are  using  an  unsupported  configuration,  mouse
-       events  will not be visible to ncurses(3x) (and the mouse-
-       mask function will always return 0).
-
-       If the terminfo entry contains a XM string, this  is  used
-       in  the xterm mouse driver to control the way the terminal
-       is initialized for mouse operation.  The default, if XM is
-       not found, corresponds to private mode 1000 of xterm:
-              \E[?1000%?%p1%{1}%=%th%el%;
-       The z member in the event structure is not presently used.
-       It is intended for use with touch screens  (which  may  be
-       pressure-sensitive)   or   with   3D-mice/trackballs/power
-       gloves.
-
-
-
-

BUGS

-       Mouse events under xterm will not in fact be ignored  dur-
-       ing  cooked  mode, if they have been enabled by mousemask.
-       Instead, the xterm mouse report sequence  will  appear  in
-       the string read.
-
-       Mouse events under xterm will not be detected correctly in
-       a window with its keypad bit off, since  they  are  inter-
-       preted  as  a  variety of function key.  Your terminfo de-
-       scription should have kmous set to "\E[M"  (the  beginning
-       of  the response from xterm for mouse clicks).  Other val-
-       ues for kmous are permitted, but under  the  same  assump-
-       tion, i.e., it is the beginning of the response.
-
-       Because  there  are  no  standard  terminal responses that
-       would serve to identify terminals which support the  xterm
-       mouse  protocol,  ncurses assumes that if your $TERM envi-
-       ronment variable contains "xterm", or kmous is defined  in
-       the terminal description, then the terminal may send mouse
-       events.
-
-
-
-

SEE ALSO

-       curses(3x),  curs_kernel(3x),   curs_slk(3x),   curs_vari-
-       ables(3x).
-
-
-
-                                                         curs_mouse(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_move.3x.html b/doc/html/man/curs_move.3x.html deleted file mode 100644 index d78178d35d7..00000000000 --- a/doc/html/man/curs_move.3x.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - -curs_move 3x - - - - -

curs_move 3x

-
-
-
-curs_move(3x)                                             curs_move(3x)
-
-
-
-
-
-

NAME

-       move, wmove - move curses window cursor
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int move(int y, int x);
-       int wmove(WINDOW *win, int y, int x);
-
-
-
-

DESCRIPTION

-       These  routines move the cursor associated with the window
-       to line y and column x.  This routine does  not  move  the
-       physical  cursor  of the terminal until refresh is called.
-       The position specified is relative to the upper  left-hand
-       corner of the window, which is (0,0).
-
-
-
-

RETURN VALUE

-       These routines return ERR upon failure and OK (SVr4 speci-
-       fies only "an integer value other than ERR") upon success-
-       ful completion.
-
-       Specifically,  they  return an error if the window pointer
-       is null, or if the position is outside the window.
-
-
-
-

NOTES

-       Note that move may be a macro.
-
-
-
-

PORTABILITY

-       These functions are described in the XSI Curses  standard,
-       Issue 4.
-
-
-
-

SEE ALSO

-       curses(3x), curs_refresh(3x)
-
-
-
-                                                          curs_move(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_opaque.3x.html b/doc/html/man/curs_opaque.3x.html deleted file mode 100644 index 6d01f2e5b1c..00000000000 --- a/doc/html/man/curs_opaque.3x.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - -curs_opaque 3x - - - - -

curs_opaque 3x

-
-
-
-curs_opaque(3x)                                         curs_opaque(3x)
-
-
-
-
-
-

NAME

-       is_cleared, is_idlok, is_idcok, is_immedok, is_keypad,
-       is_leaveok, is_nodelay, is_notimeout, is_pad, is_scrollok,
-       is_subwin, is_syncok - curses window properties
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       bool is_cleared(const WINDOW *win);
-       bool is_idcok(const WINDOW *win);
-       bool is_idlok(const WINDOW *win);
-       bool is_immedok(const WINDOW *win);
-       bool is_keypad(const WINDOW *win);
-       bool is_leaveok(const WINDOW *win);
-       bool is_nodelay(const WINDOW *win);
-       bool is_notimeout(const WINDOW *win);
-       bool is_pad(const WINDOW *win);
-       bool is_scrollok(const WINDOW *win);
-       bool is_subwin(const WINDOW *win);
-       bool is_syncok(const WINDOW *win);
-       WINDOW * wgetparent(const WINDOW *win);
-       int wgetscrreg(const WINDOW *win, int *top, int *bottom);
-
-
-
-

DESCRIPTION

-       This  implementation provides functions which return prop-
-       erties set in the WINDOW  structure,  allowing  it  to  be
-       ``opaque'' if the symbol NCURSES_OPAQUE is defined:
-
-       is_cleared
-            returns the value set in clearok
-
-       is_idcok
-            returns the value set in idcok
-
-       is_idlok
-            returns the value set in idlok
-
-       is_immedok
-            returns the value set in immedok
-
-       is_keypad
-            returns the value set in keypad
-
-       is_leaveok
-            returns the value set in leaveok
-
-       is_nodelay
-            returns the value set in nodelay
-
-       is_notimeout
-            returns the value set in notimeout
-
-       is_pad
-            returns  TRUE if the window is a pad i.e., created by
-            newpad
-
-       is_scrollok
-            returns the value set in scrollok
-
-       is_subwin
-            returns TRUE if the window is a subwindow, i.e., cre-
-            ated by subwin or derwin
-
-       is_syncok
-            returns the value set in syncok
-
-       wgetparent
-            returns  the parent WINDOW pointer for subwindows, or
-            NULL for windows having no parent.
-
-       wgetscrreg
-            returns the top and bottom  rows  for  the  scrolling
-            margin as set in wsetscrreg.
-
-
-
-

RETURN VALUE

-       These functions all return TRUE or FALSE, except as noted.
-
-
-
-

NOTES

-       Both a macro and a function are provided for each name.
-
-
-
-

PORTABILITY

-       These  routines  are  specific  to ncurses.  They were not
-       supported on Version 7, BSD or System  V  implementations.
-       It  is  recommended that any code depending on ncurses ex-
-       tensions be conditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       curses(3x), curs_inopts(3x),  curs_outopts(3x),  curs_win-
-       dow(3x)
-
-
-
-                                                        curs_opaque(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_outopts.3x.html b/doc/html/man/curs_outopts.3x.html deleted file mode 100644 index 9be94d9b78f..00000000000 --- a/doc/html/man/curs_outopts.3x.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - -curs_outopts 3x - - - - -

curs_outopts 3x

-
-
-
-curs_outopts(3x)                                       curs_outopts(3x)
-
-
-
-
-
-

NAME

-       clearok, idlok, idcok, immedok, leaveok, setscrreg,
-       wsetscrreg, scrollok, nl, nonl - curses output options
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int clearok(WINDOW *win, bool bf);
-       int idlok(WINDOW *win, bool bf);
-       void idcok(WINDOW *win, bool bf);
-       void immedok(WINDOW *win, bool bf);
-       int leaveok(WINDOW *win, bool bf);
-       int setscrreg(int top, int bot);
-       int wsetscrreg(WINDOW *win, int top, int bot);
-       int scrollok(WINDOW *win, bool bf);
-       int nl(void);
-       int nonl(void);
-
-
-
-

DESCRIPTION

-       These routines set options that change the style of output
-       within  curses.   All  options are initially FALSE, unless
-       otherwise stated.  It is not necessary to turn  these  op-
-       tions off before calling endwin.
-
-       If  clearok is called with TRUE as argument, the next call
-       to wrefresh with this window will clear  the  screen  com-
-       pletely  and  redraw the entire screen from scratch.  This
-       is useful when the contents of the screen  are  uncertain,
-       or  in  some  cases for a more pleasing visual effect.  If
-       the win argument to clearok is the global variable curscr,
-       the  next  call  to  wrefresh  with  any window causes the
-       screen to be cleared and repainted from scratch.
-
-       If idlok is called with TRUE as  second  argument,  curses
-       considers using the hardware insert/delete line feature of
-       terminals so equipped.  Calling idlok with FALSE as second
-       argument  disables  use  of  line  insertion and deletion.
-       This option should be  enabled  only  if  the  application
-       needs  insert/delete  line, for example, for a screen edi-
-       tor.  It is disabled by default because insert/delete line
-       tends  to  be  visually annoying when used in applications
-       where it is not really needed.  If insert/delete line can-
-       not  be  used,  curses redraws the changed portions of all
-       lines.
-
-       If idcok is called with FALSE as second  argument,  curses
-       no longer considers using the hardware insert/delete char-
-       acter feature of terminals so equipped.  Use of  character
-       insert/delete  is  enabled by default.  Calling idcok with
-       TRUE as second argument re-enables use of character inser-
-       tion and deletion.
-
-       If  immedok is called with TRUE as argument, any change in
-       the window image, such as the ones caused by waddch, wclr-
-       tobot,  wscrl,  etc.,  automatically  cause a call to wre-
-       fresh.  However, it may degrade performance  considerably,
-       due  to repeated calls to wrefresh.  It is disabled by de-
-       fault.
-
-       Normally, the hardware cursor is left at the  location  of
-       the window cursor being refreshed.  The leaveok option al-
-       lows the cursor to be left wherever the update happens  to
-       leave  it.  It is useful for applications where the cursor
-       is not used, since it reduces the need for cursor motions.
-
-       The setscrreg and wsetscrreg routines allow  the  applica-
-       tion  programmer  to  set a software scrolling region in a
-       window.  The top and bot parameters are the  line  numbers
-       of  the  top  and  bottom  margin of the scrolling region.
-       (Line 0 is the top line of the window.)   If  this  option
-       and  scrollok are enabled, an attempt to move off the bot-
-       tom margin line causes all lines in the  scrolling  region
-       to  scroll  one  line  in the direction of the first line.
-       Only the text of the window is scrolled.  (Note that  this
-       has nothing to do with the use of a physical scrolling re-
-       gion capability in the terminal, like that in  the  VT100.
-       If  idlok  is  enabled  and  the  terminal  has  either  a
-       scrolling region or insert/delete  line  capability,  they
-       will probably be used by the output routines.)
-
-       The  scrollok option controls what happens when the cursor
-       of a window is  moved  off  the  edge  of  the  window  or
-       scrolling  region,  either as a result of a newline action
-       on the bottom line, or typing the last  character  of  the
-       last line.  If disabled, (bf is FALSE), the cursor is left
-       on the bottom line.  If enabled, (bf is TRUE), the  window
-       is  scrolled  up  one  line (Note that to get the physical
-       scrolling effect on the terminal, it is also necessary  to
-       call idlok).
-
-       The  nl  and  nonl routines control whether the underlying
-       display device translates the return key into  newline  on
-       input,  and  whether it translates newline into return and
-       line-feed on output (in either case, the call  addch('\n')
-       does the equivalent of return and line feed on the virtual
-       screen).  Initially, these translations do occur.  If  you
-       disable  them using nonl, curses will be able to make bet-
-       ter use of the line-feed capability, resulting  in  faster
-       cursor  motion.   Also, curses will then be able to detect
-       the return key.
-
-
-
-

RETURN VALUE

-       The functions setscrreg and wsetscrreg return OK upon suc-
-       cess and ERR upon failure.  All other routines that return
-       an integer always return OK.
-
-       X/Open does not define any error conditions.
-
-       In this implementation, those functions that have a window
-       pointer  will  return  an  error  if the window pointer is
-       null.
-
-              wclrtoeol
-                   returns an error if  the  cursor  position  is
-                   about to wrap.
-
-              wsetscrreg
-                   returns  an error if the scrolling region lim-
-                   its extend outside the window.
-
-       X/Open does not define any error conditions.  This  imple-
-       mentation returns an error if the window pointer is null.
-
-
-
-

PORTABILITY

-       These  functions are described in the XSI Curses standard,
-       Issue 4.
-
-       The XSI Curses standard is ambiguous on  the  question  of
-       whether  raw()  should  disable the CRLF translations con-
-       trolled by nl() and nonl().  BSD curses did turn off these
-       translations;  AT&T  curses (at least as late as SVr1) did
-       not.  We choose to do so, on the theory that a  programmer
-       requesting  raw  input wants a clean (ideally 8-bit clean)
-       connection that the operating system will not alter.
-
-       Some historic curses implementations had,  as  an  undocu-
-       mented  feature,  the  ability  to  do  the  equivalent of
-       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
-       scr).  This will not work under ncurses.
-
-       Earlier  System  V  curses  implementations specified that
-       with scrollok enabled, any window modification  triggering
-       a  scroll also forced a physical refresh.  XSI Curses does
-       not require this, and ncurses avoids doing it  to  perform
-       better vertical-motion optimization at wrefresh time.
-
-       The  XSI  Curses standard does not mention that the cursor
-       should be made invisible  as  a  side-effect  of  leaveok.
-       SVr4  curses  documentation  does  this, but the code does
-       not.  Use curs_set to make the cursor invisible.
-
-
-
-

NOTES

-       Note that clearok, leaveok, scrollok, idcok, nl, nonl  and
-       setscrreg may be macros.
-
-       The immedok routine is useful for windows that are used as
-       terminal emulators.
-
-
-
-

SEE ALSO

-       curses(3x),        curs_addch(3x),         curs_clear(3x),
-       curs_initscr(3x),    curs_scroll(3x),    curs_refresh(3x),
-       curs_variables(3x).
-
-
-
-                                                       curs_outopts(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_overlay.3x.html b/doc/html/man/curs_overlay.3x.html deleted file mode 100644 index 69ed0fcaafa..00000000000 --- a/doc/html/man/curs_overlay.3x.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - -curs_overlay 3x - - - - -

curs_overlay 3x

-
-
-
-curs_overlay(3x)                                       curs_overlay(3x)
-
-
-
-
-
-

NAME

-       overlay, overwrite, copywin - overlay and manipulate
-       overlapped curses windows
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int overlay(const WINDOW *srcwin, WINDOW *dstwin);
-       int overwrite(const WINDOW *srcwin, WINDOW *dstwin);
-       int copywin(const  WINDOW  *srcwin,  WINDOW  *dstwin,  int
-       sminrow,
-             int smincol, int dminrow, int dmincol, int dmaxrow,
-             int dmaxcol, int overlay);
-
-
-
-

DESCRIPTION

-       The  overlay  and overwrite routines overlay srcwin on top
-       of dstwin.  scrwin and dstwin are not required to  be  the
-       same  size;  only  text  where  the two windows overlap is
-       copied.  The difference is that overlay is non-destructive
-       (blanks are not copied) whereas overwrite is destructive.
-
-       The  copywin  routine provides a finer granularity of con-
-       trol over the overlay and overwrite routines.  Like in the
-       prefresh routine, a rectangle is specified in the destina-
-       tion window, (dminrow, dmincol)  and  (dmaxrow,  dmaxcol),
-       and  the  upper-left-corner coordinates of the source win-
-       dow, (sminrow, smincol).  If the argument overlay is true,
-       then copying is non-destructive, as in overlay.
-
-
-
-

RETURN VALUE

-       Routines  that  return an integer return ERR upon failure,
-       and OK (SVr4 only specifies "an integer value  other  than
-       ERR") upon successful completion.
-
-       X/Open  defines  no error conditions.  In this implementa-
-       tion, copywin, overlay and overwrite return  an  error  if
-       either of the window pointers are null, or if some part of
-       the window would be placed off-screen.
-
-
-
-

NOTES

-       Note that overlay and overwrite may be macros.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue 4 describes these functions
-       (adding the const qualifiers).  It further specifies their
-       behavior in the presence of characters with multibyte ren-
-       ditions (not yet supported in this implementation).
-
-
-
-

SEE ALSO

-       curses(3x), curs_pad(3x), curs_refresh(3x)
-
-
-
-                                                       curs_overlay(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_pad.3x.html b/doc/html/man/curs_pad.3x.html deleted file mode 100644 index ca16cf4603d..00000000000 --- a/doc/html/man/curs_pad.3x.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - -curs_pad 3x - - - - -

curs_pad 3x

-
-
-
-curs_pad(3x)                                               curs_pad(3x)
-
-
-
-
-
-

NAME

-       newpad, subpad, prefresh, pnoutrefresh, pechochar,
-       pecho_wchar - create and display curses pads
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       WINDOW *newpad(int nlines, int ncols);
-       WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
-             int begin_y, int begin_x);
-       int prefresh(WINDOW *pad, int pminrow, int pmincol,
-             int sminrow, int smincol, int smaxrow, int smaxcol);
-       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
-             int sminrow, int smincol, int smaxrow, int smaxcol);
-       int pechochar(WINDOW *pad, chtype ch);
-       int pecho_wchar(WINDOW *pad, const cchar_t *wch);
-
-
-
-

DESCRIPTION

-       The newpad routine creates and returns a pointer to a  new
-       pad data structure with the given number of lines, nlines,
-       and columns, ncols.  A pad is like a window,  except  that
-       it is not restricted by the screen size, and is not neces-
-       sarily associated with a particular part  of  the  screen.
-       Pads can be used when a large window is needed, and only a
-       part of the window will be on the screen at one time.  Au-
-       tomatic refreshes of pads (e.g., from scrolling or echoing
-       of input) do not occur.  It is not legal to call  wrefresh
-       with  a  pad  as  an  argument;  the  routines prefresh or
-       pnoutrefresh should be called instead.   Note  that  these
-       routines require additional parameters to specify the part
-       of the pad to be displayed and the location on the  screen
-       to be used for the display.
-
-       The subpad routine creates and returns a pointer to a sub-
-       window within a  pad  with  the  given  number  of  lines,
-       nlines,  and  columns,  ncols.   Unlike subwin, which uses
-       screen coordinates, the window is  at  position  (begin_x,
-       begin_y)  on the pad.  The window is made in the middle of
-       the window orig, so that changes made to one window affect
-       both windows.  During the use of this routine, it will of-
-       ten be necessary to call touchwin or touchline on orig be-
-       fore calling prefresh.
-
-       The  prefresh  and  pnoutrefresh routines are analogous to
-       wrefresh and wnoutrefresh except that they relate to  pads
-       instead  of windows.  The additional parameters are needed
-       to indicate what part of the pad and screen are  involved.
-       The pminrow and pmincol parameters specify the upper left-
-       hand corner of the rectangle to be displayed in  the  pad.
-       The  sminrow,  smincol,  smaxrow,  and  smaxcol parameters
-       specify the edges of the rectangle to be displayed on  the
-       screen.   The  lower right-hand corner of the rectangle to
-       be displayed in the pad is calculated from the screen  co-
-       ordinates,  since  the  rectangles  must be the same size.
-       Both rectangles must be entirely  contained  within  their
-       respective  structures.  Negative values of pminrow, pmin-
-       col, sminrow, or smincol are treated as if they were zero.
-
-       The pechochar routine is functionally equivalent to a call
-       to  addch  followed by a call to refresh, a call to waddch
-       followed by a call to wrefresh, or a call to  waddch  fol-
-       lowed  by  a  call to prefresh.  The knowledge that only a
-       single character is being output is taken into  considera-
-       tion  and, for non-control characters, a considerable per-
-       formance gain might be seen by using  these  routines  in-
-       stead of their equivalents.  In the case of pechochar, the
-       last location of the pad on the screen is reused  for  the
-       arguments to prefresh.
-
-       The  pecho_wchar  function is the analogous wide-character
-       form of pechochar.  It outputs one character to a pad  and
-       immediately  refreshes the pad.  It does this by a call to
-       wadd_wch followed by a call to prefresh.
-
-
-
-

RETURN VALUE

-       Routines that return an integer return  ERR  upon  failure
-       and  OK  (SVr4 only specifies "an integer value other than
-       ERR") upon successful completion.
-
-       Routines that return pointers return NULL  on  error,  and
-       set errno to ENOMEM.
-
-       X/Open  does not define any error conditions.  In this im-
-       plementation
-
-              prefresh and pnoutrefresh
-                   return an error if the window pointer is null,
-                   or if the window is not really a pad or if the
-                   area to refresh extends off-screen or  if  the
-                   minimum coordinates are greater than the maxi-
-                   mum.
-
-              pechochar
-                   returns an error if the window is not really a
-                   pad,  and the associated call to wechochar re-
-                   turns an error.
-
-              pecho_wchar
-                   returns an error if the window is not really a
-                   pad,  and  the  associated call to wecho_wchar
-                   returns an error.
-
-
-
-

NOTES

-       Note that pechochar may be a macro.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue  4  describes  these  func-
-       tions.
-
-
-
-

SEE ALSO

-       curses(3x),  curs_refresh(3x),  curs_touch(3x),  curs_add-
-       ch(3x).
-
-
-
-                                                           curs_pad(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_print.3x.html b/doc/html/man/curs_print.3x.html deleted file mode 100644 index 11b64a7f550..00000000000 --- a/doc/html/man/curs_print.3x.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - -curs_print 3x - - - - -

curs_print 3x

-
-
-
-curs_print(3x)                                           curs_print(3x)
-
-
-
-
-
-

NAME

-       mcprint - ship binary data to printer
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int mcprint(char *data, int len);
-
-
-
-

DESCRIPTION

-       This  function  uses the mc5p or mc4 and mc5 capabilities,
-       if they are present, to  ship  given  data  to  a  printer
-       attached to the terminal.
-
-       Note  that  the mcprint code has no way to do flow control
-       with the printer or to know how  much  buffering  it  has.
-       Your  application  is  responsible for keeping the rate of
-       writes to the printer below its continuous throughput rate
-       (typically  about  half  of its nominal cps rating).  Dot-
-       matrix printers and 6-page-per-minute lasers can typically
-       handle  80cps,  so a good conservative rule of thumb is to
-       sleep for a second after shipping each 80-character line.
-
-
-
-

RETURN VALUE

-       The mcprint function returns ERR if  the  write  operation
-       aborted for some reason.  In this case, errno will contain
-       either an error associated with write(2)  or  one  of  the
-       following:
-
-       ENODEV
-            Capabilities for printer redirection do not exist.
-
-       ENOMEM
-            Couldn't  allocate  sufficient  memory  to buffer the
-            printer write.
-
-       When mcprint succeeds, it returns the number of characters
-       actually sent to the printer.
-
-
-
-

PORTABILITY

-       The  mcprint call was designed for ncurses(3x), and is not
-       found in SVr4 curses, 4.4BSD curses, or any other previous
-       version of curses.
-
-
-
-

BUGS

-       Padding  in the mc5p, mc4 and mc5 capabilities will not be
-       interpreted.
-
-
-
-

SEE ALSO

-       curses(3x)
-
-
-
-                                                         curs_print(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_printw.3x.html b/doc/html/man/curs_printw.3x.html deleted file mode 100644 index f845852dec4..00000000000 --- a/doc/html/man/curs_printw.3x.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - -curs_printw 3x - - - - -

curs_printw 3x

-
-
-
-curs_printw(3x)                                         curs_printw(3x)
-
-
-
-
-
-

NAME

-       printw, wprintw, mvprintw, mvwprintw, vwprintw, vw_printw
-       - print formatted output in curses windows
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int printw(const char *fmt, ...);
-       int wprintw(WINDOW *win, const char *fmt, ...);
-       int mvprintw(int y, int x, const char *fmt, ...);
-       int mvwprintw(WINDOW *win, int y, int x, const char  *fmt,
-       ...);
-       int  vwprintw(WINDOW  *win,  const char *fmt, va_list var-
-       glist);
-       int vw_printw(WINDOW *win, const char *fmt,  va_list  var-
-       glist);
-
-
-
-

DESCRIPTION

-       The  printw,  wprintw, mvprintw and mvwprintw routines are
-       analogous to  printf  [see  printf(3)].   In  effect,  the
-       string that would be output by printf is output instead as
-       though waddstr were used on the given window.
-
-       The vwprintw  and  wv_printw  routines  are  analogous  to
-       vprintf  [see  printf(3)]  and  perform  a wprintw using a
-       variable argument list.  The third argument is a  va_list,
-       a   pointer   to  a  list  of  arguments,  as  defined  in
-       <stdarg.h>.
-
-
-
-

RETURN VALUE

-       Routines that return an integer return  ERR  upon  failure
-       and  OK  (SVr4 only specifies "an integer value other than
-       ERR") upon successful completion.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion,  an  error  may  be  returned  if it cannot allocate
-       enough memory for the buffer used to format  the  results.
-       It will return an error if the window pointer is null.
-
-       Functions  with a "mv" prefix first perform a cursor move-
-       ment using wmove, and return an error if the  position  is
-       outside the window, or if the window pointer is null.
-
-
-
-

PORTABILITY

-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.  The function vwprintw is marked TO  BE  WITHDRAWN,
-       and  is  to  be replaced by a function vw_printw using the
-       <stdarg.h> interface.  The Single Unix Specification, Ver-
-       sion  2  states  that  vw_printw  is preferred to vwprintw
-       since the latter  requires  including  <varargs.h>,  which
-       cannot  be  used in the same file as <stdarg.h>.  This im-
-       plementation uses <stdarg.h> for both, because that header
-       is included in <curses.h>.
-
-
-
-

SEE ALSO

-       curses(3x), printf(3), vprintf(3)
-
-
-
-                                                        curs_printw(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_refresh.3x.html b/doc/html/man/curs_refresh.3x.html deleted file mode 100644 index 78988f5070e..00000000000 --- a/doc/html/man/curs_refresh.3x.html +++ /dev/null @@ -1,170 +0,0 @@ - - - - -curs_refresh 3x - - - - -

curs_refresh 3x

-
-
-
-curs_refresh(3x)                                       curs_refresh(3x)
-
-
-
-
-
-

NAME

-       doupdate, redrawwin, refresh, wnoutrefresh, wredrawln,
-       wrefresh - refresh curses windows and lines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int refresh(void);
-       int wrefresh(WINDOW *win);
-       int wnoutrefresh(WINDOW *win);
-       int doupdate(void);
-       int redrawwin(WINDOW *win);
-       int wredrawln(WINDOW *win, int beg_line, int num_lines);
-
-
-
-

DESCRIPTION

-       The refresh and wrefresh  routines  (or  wnoutrefresh  and
-       doupdate)  must be called to get actual output to the ter-
-       minal, as other routines  merely  manipulate  data  struc-
-       tures.   The  routine  wrefresh copies the named window to
-       the physical terminal screen, taking into account what  is
-       already there to do optimizations.  The refresh routine is
-       the same, using stdscr  as  the  default  window.   Unless
-       leaveok  has been enabled, the physical cursor of the ter-
-       minal is left at the location of the cursor for that  win-
-       dow.
-
-       The  wnoutrefresh and doupdate routines allow multiple up-
-       dates with more efficiency than wrefresh alone.  In  addi-
-       tion  to  all the window structures, curses keeps two data
-       structures representing the terminal  screen:  a  physical
-       screen,  describing  what is actually on the screen, and a
-       virtual screen, describing what the  programmer  wants  to
-       have on the screen.
-
-       The  routine wrefresh works by first calling wnoutrefresh,
-       which copies the named window to the virtual  screen,  and
-       then  calling  doupdate, which compares the virtual screen
-       to the physical screen and does the actual update.  If the
-       programmer wishes to output several windows at once, a se-
-       ries of calls to wrefresh results in alternating calls  to
-       wnoutrefresh  and doupdate, causing several bursts of out-
-       put to the screen.  By first calling wnoutrefresh for each
-       window, it is then possible to call doupdate once, result-
-       ing in only one burst of output, with fewer total  charac-
-       ters transmitted and less CPU time used.  If the win argu-
-       ment to wrefresh is the global variable curscr, the screen
-       is immediately cleared and repainted from scratch.
-
-       The phrase "copies the named window to the virtual screen"
-       above is ambiguous.  What actually  happens  is  that  all
-       touched  (changed)  lines  in the window are copied to the
-       virtual screen.  This affects programs that  use  overlap-
-       ping  windows;  it  means that if two windows overlap, you
-       can refresh them in either order and  the  overlap  region
-       will be modified only when it is explicitly changed.  (But
-       see the section on PORTABILITY below for a  warning  about
-       exploiting this behavior.)
-
-       The wredrawln routine indicates to curses that some screen
-       lines are corrupted and should be thrown away before  any-
-       thing  is  written  over  them.   It touches the indicated
-       lines (marking them  changed).   The  routine  redrawwin()
-       touches the entire window.
-
-
-
-

RETURN VALUE

-       Routines  that  return an integer return ERR upon failure,
-       and OK (SVr4 only specifies "an integer value  other  than
-       ERR") upon successful completion.
-
-       X/Open  does not define any error conditions.  In this im-
-       plementation
-
-              wnoutrefresh
-                   returns an error  if  the  window  pointer  is
-                   null, or if the window is really a pad.
-
-              wredrawln
-                   returns  an  error  if  the associated call to
-                   touchln returns an error.
-
-
-
-

NOTES

-       Note that refresh and redrawwin may be macros.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue  4  describes  these  func-
-       tions.
-
-       Whether  wnoutrefresh()  copies  to the virtual screen the
-       entire contents of a window or just its  changed  portions
-       has never been well-documented in historic curses versions
-       (including SVr4).  It might be unwise to  rely  on  either
-       behavior  in  programs  that  might have to be linked with
-       other curses implementations.  Instead, you can do an  ex-
-       plicit  touchwin() before the wnoutrefresh() call to guar-
-       antee an entire-contents copy anywhere.
-
-
-
-

SEE ALSO

-       curses(3x), curs_outopts(3x) curs_variables(3x).
-
-
-
-                                                       curs_refresh(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_scanw.3x.html b/doc/html/man/curs_scanw.3x.html deleted file mode 100644 index 40cb95234f9..00000000000 --- a/doc/html/man/curs_scanw.3x.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - -curs_scanw 3x - - - - -

curs_scanw 3x

-
-
-
-curs_scanw(3x)                                           curs_scanw(3x)
-
-
-
-
-
-

NAME

-       scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw - con-
-       vert formatted input from a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int scanw(char *fmt, ...);
-       int wscanw(WINDOW *win, char *fmt, ...);
-       int mvscanw(int y, int x, char *fmt, ...);
-       int mvwscanw(WINDOW *win, int y, int x, char *fmt, ...);
-       int vw_scanw(WINDOW *win, char *fmt, va_list varglist);
-       int vwscanw(WINDOW *win, char *fmt, va_list varglist);
-
-
-
-

DESCRIPTION

-       The scanw, wscanw and mvscanw routines  are  analogous  to
-       scanf  [see scanf(3)].  The effect of these routines is as
-       though wgetstr were called on the window, and the  result-
-       ing line used as input for sscanf(3).  Fields which do not
-       map to a variable in the fmt field are lost.
-
-       The vwscanw and vw_scanw routines are analogous to vscanf.
-       They perform a wscanw using a variable argument list.  The
-       third argument is a va_list, a pointer to a list of  argu-
-       ments, as defined in <stdarg.h>.
-
-
-
-

RETURN VALUE

-       vwscanw returns ERR on failure and an integer equal to the
-       number of fields scanned on success.
-
-       Applications may use the  return  value  from  the  scanw,
-       wscanw,  mvscanw  and  mvwscanw  routines to determine the
-       number of fields which were mapped in the call.
-
-       Functions with a "mv" prefix first perform a cursor  move-
-       ment  using  wmove, and return an error if the position is
-       outside the window, or if the window pointer is null.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue  4  describes  these  func-
-       tions.   The  function  vwscanw is marked TO BE WITHDRAWN,
-       and is to be replaced by a  function  vw_scanw  using  the
-       <stdarg.h> interface.  The Single Unix Specification, Ver-
-       sion 2 states that vw_scanw  is preferred to vwscanw since
-       the latter requires including <varargs.h>, which cannot be
-       used in the same file as <stdarg.h>.  This  implementation
-       uses  <stdarg.h> for both, because that header is included
-       in <curses.h>.
-
-       Both XSI and The  Single  Unix  Specification,  Version  2
-       state  that  these  functions return ERR or OK.  Since the
-       underlying scanf can return the number of  items  scanned,
-       and the SVr4 code was documented to use this feature, this
-       is probably an editing error which was introduced in  XSI,
-       rather  than  being done intentionally.  Portable applica-
-       tions should only test if the return value is  ERR,  since
-       the  OK value (zero) is likely to be misleading.  One pos-
-       sible way to get useful results would be  to  use  a  "%n"
-       conversion  at the end of the format string to ensure that
-       something was processed.
-
-
-
-

SEE ALSO

-       curses(3x), curs_getstr(3x), curs_printw(3x), scanf(3)
-
-
-
-                                                         curs_scanw(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_scr_dump.3x.html b/doc/html/man/curs_scr_dump.3x.html deleted file mode 100644 index d2931e13473..00000000000 --- a/doc/html/man/curs_scr_dump.3x.html +++ /dev/null @@ -1,137 +0,0 @@ - - - - -curs_scr_dump 3x - - - - -

curs_scr_dump 3x

-
-
-
-curs_scr_dump(3x)                                     curs_scr_dump(3x)
-
-
-
-
-
-

NAME

-       scr_dump, scr_restore, scr_init, scr_set - read (write) a
-       curses screen from (to) a file
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int scr_dump(const char *filename);
-       int scr_restore(const char *filename);
-       int scr_init(const char *filename);
-       int scr_set(const char *filename);
-
-
-
-

DESCRIPTION

-       The scr_dump routine dumps the  current  contents  of  the
-       virtual screen to the file filename.
-
-       The  scr_restore  routine  sets  the virtual screen to the
-       contents of filename, which must have been  written  using
-       scr_dump.   The  next call to doupdate restores the screen
-       to the way it looked in the dump file.
-
-       The scr_init routine reads in the contents of filename and
-       uses  them  to initialize the curses data structures about
-       what the terminal currently has on its screen.  If the da-
-       ta is determined to be valid, curses bases its next update
-       of the screen on this information rather than clearing the
-       screen  and starting from scratch.  scr_init is used after
-       initscr or a system call to share the screen with  another
-       process  which  has done a scr_dump after its endwin call.
-       The data is declared invalid if the terminfo  capabilities
-       rmcup and nrrmc exist; also if the terminal has been writ-
-       ten to since the preceding scr_dump call.
-
-       The scr_set routine is a combination  of  scr_restore  and
-       scr_init.   It  tells  the program that the information in
-       filename is what is currently on the screen, and also what
-       the  program  wants on the screen.  This can be thought of
-       as a screen inheritance function.
-
-       To read (write) a window from (to) a file, use the  getwin
-       and putwin routines [see curs_util(3x)].
-
-
-
-

RETURN VALUE

-       All  routines  return  the integer ERR upon failure and OK
-       upon success.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion,  each  will  return  an  error if the file cannot be
-       opened.
-
-
-
-

NOTES

-       Note  that  scr_init,  scr_set,  and  scr_restore  may  be
-       macros.
-
-
-
-

PORTABILITY

-       The  XSI  Curses  standard, Issue 4, describes these func-
-       tions (adding the const qualifiers).
-
-       The SVr4 docs merely say under scr_init that the dump data
-       is  also  considered invalid "if the time-stamp of the tty
-       is old" but do not define "old".
-
-
-
-

SEE ALSO

-       curses(3x),      curs_initscr(3x),       curs_refresh(3x),
-       curs_util(3x), system(3)
-
-
-
-                                                      curs_scr_dump(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_scroll.3x.html b/doc/html/man/curs_scroll.3x.html deleted file mode 100644 index 856b9f55804..00000000000 --- a/doc/html/man/curs_scroll.3x.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - -curs_scroll 3x - - - - -

curs_scroll 3x

-
-
-
-curs_scroll(3x)                                         curs_scroll(3x)
-
-
-
-
-
-

NAME

-       scroll, scrl, wscrl - scroll a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int scroll(WINDOW *win);
-       int scrl(int n);
-       int wscrl(WINDOW *win, int n);
-
-
-
-

DESCRIPTION

-       The  scroll  routine scrolls the window up one line.  This
-       involves moving the lines in the  window  data  structure.
-       As  an optimization, if the scrolling region of the window
-       is the entire screen, the physical screen may be  scrolled
-       at the same time.
-
-       For  positive  n,  the  scrl and wscrl routines scroll the
-       window up n lines (line i+n becomes i);  otherwise  scroll
-       the  window  down n lines.  This involves moving the lines
-       in the window character image structure.  The current cur-
-       sor position is not changed.
-
-       For these functions to work, scrolling must be enabled via
-       scrollok.
-
-
-
-

RETURN VALUE

-       These routines return ERR upon failure, and OK (SVr4  only
-       specifies "an integer value other than ERR") upon success-
-       ful completion.
-
-       X/Open defines no error conditions.
-
-       This implementation returns an error if the window pointer
-       is  null,  or  if  scrolling is not enabled in the window,
-       e.g., with scrollok.
-
-
-
-

NOTES

-       Note that scrl and scroll may be macros.
-
-       The SVr4 documentation says that the optimization of phys-
-       ically  scrolling  immediately if the scroll region is the
-       entire screen "is"  performed,  not  "may  be"  performed.
-       This  implementation  deliberately does not guarantee that
-       this will occur, to leave open the possibility of  smarter
-       optimization  of  multiple  scroll actions on the next up-
-       date.
-
-       Neither the SVr4 nor the XSI documentation specify whether
-       the current attribute or current color-pair of blanks gen-
-       erated by the scroll function is zeroed.  Under  this  im-
-       plementation it is.
-
-
-
-

PORTABILITY

-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.
-
-
-
-

SEE ALSO

-       curses(3x), curs_outopts(3x)
-
-
-
-                                                        curs_scroll(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_slk.3x.html b/doc/html/man/curs_slk.3x.html deleted file mode 100644 index 54e4f7a04d7..00000000000 --- a/doc/html/man/curs_slk.3x.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - -curs_slk 3x - - - - -

curs_slk 3x

-
-
-
-curs_slk(3x)                                               curs_slk(3x)
-
-
-
-
-
-

NAME

-       slk_init, slk_set, slk_wset, slk_refresh, slk_noutrefresh,
-       slk_label, slk_clear, slk_restore, slk_touch, slk_attron,
-       slk_attrset, slk_attroff, slk_attr_on, slk_attr_set,
-       slk_attr_off, slk_attr, slk_color - curses soft label
-       routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int slk_init(int fmt);
-       int slk_set(int labnum, const char *label, int fmt);
-       int slk_refresh(void);
-       int slk_noutrefresh(void);
-       char *slk_label(int labnum);
-       int slk_clear(void);
-       int slk_restore(void);
-       int slk_touch(void);
-       int slk_attron(const chtype attrs);
-       int slk_attroff(const chtype attrs);
-       int slk_attrset(const chtype attrs);
-       int slk_attr_on(attr_t attrs, void* opts);
-       int slk_attr_off(const attr_t attrs, void * opts);
-       int  slk_attr_set(const  attr_t  attrs,  short color_pair,
-       void* opts);
-       attr_t slk_attr(void);
-       int slk_color(short color_pair);
-       int slk_wset(int labnum, const wchar_t *label, int fmt);
-
-
-
-

DESCRIPTION

-       The slk* functions manipulate the set of soft function-key
-       labels  that exist on many terminals.  For those terminals
-       that do not have soft labels, curses takes over the bottom
-       line  of stdscr, reducing the size of stdscr and the vari-
-       able LINES.  curses standardizes on eight labels of up  to
-       eight  characters  each.  In addition to this, the ncurses
-       implementation supports a mode where it simulates  12  la-
-       bels  of  up  to five characters each.  This is useful for
-       today's PC-like enduser devices.  ncurses  simulates  this
-       mode  by  taking over up to two lines at the bottom of the
-       screen; it does not try to use any  hardware  support  for
-       this mode.
-
-       The  slk_init  routine  must  be  called before initscr or
-       newterm is called.  If initscr eventually uses a line from
-       stdscr to emulate the soft labels, then fmt determines how
-       the labels are arranged on the screen:
-
-              0  indicates a 3-2-3 arrangement of the labels.
-
-              1  indicates a 4-4 arrangement
-
-              2  indicates the PC-like 4-4-4 mode.
-
-              3  is again the PC-like 4-4-4 mode, but in addition
-                 an  index line is generated, helping the user to
-                 identify the key numbers easily.
-
-       The slk_set routine (and  the  slk_wset  routine  for  the
-       wide-character library) has three parameters:
-
-              labnum
-                   is  the  label number, from 1 to 8 (12 for fmt
-                   in slk_init is 2 or 3);
-
-              label
-                   is be the string to put on the  label,  up  to
-                   eight  (five  for  fmt  in slk_init is 2 or 3)
-                   characters in length.  A null string or a null
-                   pointer sets up a blank label.
-
-              fmt  is  either  0, 1, or 2, indicating whether the
-                   label is to be  left-justified,  centered,  or
-                   right-justified,  respectively, within the la-
-                   bel.
-
-       The slk_refresh and slk_noutrefresh routines correspond to
-       the wrefresh and wnoutrefresh routines.
-
-       The  slk_label routine returns the current label for label
-       number labnum, with leading and trailing blanks stripped.
-
-       The slk_clear routine clears  the  soft  labels  from  the
-       screen.
-
-       The  slk_restore  routine  restores the soft labels to the
-       screen after a slk_clear has been performed.
-
-       The slk_touch routine forces all the  soft  labels  to  be
-       output the next time a slk_noutrefresh is performed.
-
-       The slk_attron, slk_attrset, slk_attroff and slk_attr rou-
-       tines correspond to attron, attrset, attroff and attr_get.
-       They  have  an effect only if soft labels are simulated on
-       the bottom line of the screen.  The default highlight  for
-       soft keys is A_STANDOUT (as in System V curses, which does
-       not document this fact).
-
-       The slk_color routine corresponds to color_set.  It has an
-       effect  only  if  soft  labels are simulated on the bottom
-       line of the screen.
-
-
-
-

RETURN VALUE

-       These routines return ERR upon failure and OK (SVr4 speci-
-       fies only "an integer value other than ERR") upon success-
-       ful completion.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion
-
-              slk_attr
-                   returns the attribute used for the soft keys.
-
-              slk_attroff, slk_attron, slk_clear,
-              slk_noutrefresh, slk_refresh, slk_touch
-                   return an error if the terminal or  the  soft-
-                   keys were not initialized.
-
-              slk_attrset
-                   returns  an error if the terminal or the soft-
-                   keys were not initialized.
-
-              slk_attr_set
-                   returns an error if the terminal or the  soft-
-                   keys  were  not initialized, or the color pair
-                   is outside the range 0..COLOR_PAIRS-1, or opts
-                   is not null.
-
-              slk_color
-                   returns  an error if the terminal or the soft-
-                   keys were not initialized, or the  color  pair
-                   is outside the range 0..COLOR_PAIRS-1.
-
-              slk_init
-                   returns  an  error  if the format parameter is
-                   outside the range 0..3.
-
-              slk_label
-                   returns NULL on error.
-
-              slk_set
-                   returns an error if the terminal or the  soft-
-                   keys  were  not initialized, or the labnum pa-
-                   rameter is outside the range of label  counts,
-                   or  if  the  format  parameter  is outside the
-                   range 0..2, or if memory for the labels cannot
-                   be allocated.
-
-
-
-

NOTES

-       Most applications would use slk_noutrefresh because a wre-
-       fresh is likely to follow soon.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue 4,  describes  these  func-
-       tions.   It changes the argument type of the attribute-ma-
-       nipulation functions slk_attron, slk_attroff,  slk_attrset
-       to be attr_t, and adds const qualifiers.  The format codes
-       2 and 3 for slk_init() and the function slk_attr are  spe-
-       cific to ncurses.
-
-
-
-

SEE ALSO

-       curses(3x),   curs_attr(3x),   curs_initscr(3x),  curs_re-
-       fresh(3x), curs_variables(3x).
-
-
-
-                                                           curs_slk(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_sp_funcs.3x.html b/doc/html/man/curs_sp_funcs.3x.html deleted file mode 100644 index a11947a74ab..00000000000 --- a/doc/html/man/curs_sp_funcs.3x.html +++ /dev/null @@ -1,285 +0,0 @@ - - - - -curs_sp_funcs 3x - - - - -

curs_sp_funcs 3x

-
-
-
-curs_sp_funcs(3x)                                     curs_sp_funcs(3x)
-
-
-
-
-
-

NAME

-       new_prescr - curses screen-pointer extension
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int assume_default_colors_sp(SCREEN*, int, int);
-       int baudrate_sp(SCREEN*);
-       int beep_sp(SCREEN*);
-       bool can_change_color_sp(SCREEN*);
-       int cbreak_sp(SCREEN*);
-       int color_content_sp(SCREEN*, short, short*, short*, short*);
-       int curs_set_sp(SCREEN*, int);
-       int define_key_sp(SCREEN*, const char *, int);
-       int def_prog_mode_sp(SCREEN*);
-       int def_shell_mode_sp(SCREEN*);
-       int delay_output_sp(SCREEN*, int);
-       int doupdate_sp(SCREEN*);
-       int echo_sp(SCREEN*);
-       int endwin_sp(SCREEN*);
-       int erasechar_sp(SCREEN*);
-       int filter_sp(SCREEN*);
-       int flash_sp(SCREEN*);
-       int flushinp_sp(SCREEN*);
-       int get_escdelay_sp(SCREEN*);
-       int getmouse_sp(SCREEN*, MEVENT*);
-       WINDOW* getwin_sp(SCREEN*, FILE*);
-       int halfdelay_sp(SCREEN*);
-       bool has_colors_sp(SCREEN*);
-       bool has_ic_sp(SCREEN*);
-       bool has_il_sp(SCREEN*);
-       int has_key_sp(SCREEN*, int);
-       bool has_mouse_sp(SCREEN*);
-       int init_color_sp(SCREEN*, short, short, short, short);
-       int init_pair_sp(SCREEN*, short, short, short);
-       int intrflush_sp(SCREEN*, WINDOW*, bool);
-       bool isendwin_sp(SCREEN*);
-       bool is_term_resized_sp(SCREEN*, int, int);
-       char* keybound_sp(SCREEN*, int, int);
-       int key_defined_sp(SCREEN*, const char *);
-       NCURSES_CONST char * keyname_sp(SCREEN*, int);
-       int keyok_sp(SCREEN*, int, bool);
-       char killchar_sp(SCREEN*);
-       int mcprint_sp(SCREEN*, char *, int);
-       int mouseinterval_sp(SCREEN*, int);
-       mmask_t mousemask_sp(SCREEN*, mmask_t, mmask_t *);
-       int mvcur_sp(SCREEN*, int, int, int, int);
-       int napms_sp(SCREEN*, int);
-       WINDOW* newpad_sp(SCREEN*, int, int);
-       SCREEN* new_prescr(void);
-       SCREEN* newterm_sp(SCREEN*, NCURSES_CONST char *, FILE *, FILE *);
-       WINDOW* newwin_sp(SCREEN*, int, int, int, int);
-       int nl_sp(SCREEN*);
-       int nocbreak_sp(SCREEN*);
-       int noecho_sp(SCREEN*);
-       int nofilter_sp(SCREEN*);
-       int nonl_sp(SCREEN*);
-       void noqiflush_sp(SCREEN*);
-       int noraw_sp(SCREEN*);
-       int pair_content_sp(SCREEN*, short, short*, short*);
-       void qiflush_sp(SCREEN*);
-       int raw_sp(SCREEN*);
-       int reset_prog_mode_sp(SCREEN*);
-       int reset_shell_mode_sp(SCREEN*);
-       int resetty_sp(SCREEN*);
-       int resize_term_sp(SCREEN*, int, int);
-       int resizeterm_sp(SCREEN*, int, int);
-       int restartterm_sp(SCREEN*, NCURSES_CONST char*, int, int *);
-       int ripoffline_sp(SCREEN*, int, int (*)(WINDOW*, int));
-       int savetty_sp(SCREEN*);
-       int scr_init_sp(SCREEN*, const char *);
-       int scr_restore_sp(SCREEN*, const char *);
-       int scr_set_sp(SCREEN*, const char *);
-       TERMINAL* set_curterm_sp(SCREEN*, TERMINAL*);
-       int set_escdelay_sp(SCREEN*, int);
-       int set_tabsize_sp(SCREEN*, int);
-       int slk_attroff_sp(SCREEN*, const chtype);
-       int slk_attron_sp(SCREEN*, const chtype);
-       int slk_attr_set_sp(SCREEN*, const attr_t, short, void*);
-       int slk_attrset_sp(SCREEN*, const chtype);
-       int slk_attr_sp((SCREEN*);
-       int slk_clear_sp(SCREEN*);
-       int slk_color_sp(SCREEN*, short);
-       int slk_init_sp(SCREEN*, int);
-       int slk_label_sp(SCREEN*, int);
-       int slk_noutrefresh_sp(SCREEN*);
-       int slk_refresh_sp(SCREEN*);
-       int slk_restore_sp(SCREEN*);
-       int slk_set_sp(SCREEN*, int, const char *, int);
-       int slk_touch_sp(SCREEN*);
-       int start_color_sp(SCREEN*);
-       attr_t term_attrs_sp(SCREEN*);
-       chtype termattrs_sp(SCREEN*);
-       char* termname_sp(SCREEN*);
-       int typeahead_sp(SCREEN*, int);
-       NCURSES_CONST char* unctrl_sp(SCREEN*, chtype);
-       int ungetch_sp(SCREEN*, int);
-       int ungetmouse_sp(SCREEN*,MEVENT *);
-       int unget_wch_sp(SCREEN*, const wchar_t);
-       int use_default_colors_sp(SCREEN*);
-       void use_env_sp(SCREEN*, bool);
-       int use_legacy_coding_sp(SCREEN*, int);
-       int vid_attr_sp(SCREEN*, attr_t, short, void *);
-       int vidattr_sp(SCREEN*, chtype);
-       int vid_puts_sp(SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC);
-       int vidputs_sp(SCREEN*, chtype, NCURSES_SP_OUTC);
-       wchar_t* wunctrl_sp(SCREEN*, cchar_t *);
-
-       #include <form.h>
-
-       int new_form_sp(SCREEN*, FIELD **);
-
-       #include <menu.h>
-
-       int new_menu_sp(SCREEN*, ITEM **);
-
-       #include <panel.h>
-
-       int ceiling_panel(SCREEN*);
-       PANEL* ground_panel(SCREEN*);
-       int update_panels_sp(SCREEN*);
-
-       #include <term.h>
-
-       int del_curterm_sp(SCREEN*, TERMINAL *);
-       int putp_sp(SCREEN*, const char *);
-       int tgetflag_sp(SCREEN*, char *, const char *);
-       int tgetent_sp(SCREEN*, char *, const char *);
-       int tgetnum_sp(SCREEN*, NCURSES_CONST char *);
-       char* tgetstr_sp(SCREEN*, NCURSES_CONST char *, char **);
-       int tigetflag_sp(SCREEN*, NCURSES_CONST char *);
-       int tigetnum_sp(SCREEN*, NCURSES_CONST char *);
-       char* tigetstr_sp(SCREEN*, NCURSES_CONST char *);
-       int tputs_sp(SCREEN*, const char *, int, NCURSES_SP_OUTC);
-
-
-
-

DESCRIPTION

-       This  implementation can be configured to provide a set of
-       functions which improve the  ability  to  manage  multiple
-       screens.  This feature can be added to any of the configu-
-       rations supported by  ncurses;  it  adds  new  entrypoints
-       without  changing the meaning of any of the existing ones.
-
-
-   IMPROVED FUNCTIONS
-       Most of the functions are new versions of  existing  func-
-       tions.  A parameter is added at the front of the parameter
-       list.  It is a SCREEN pointer.
-
-       The existing functions all use the current  screen,  which
-       is  a  static  variable.   The  extended functions use the
-       specified screen, thereby reducing the number of variables
-       which must be modified to update multiple screens.
-
-   NEW FUNCTIONS
-       Here are the new functions:
-
-       ceiling_panel
-            this  returns  a  pointer to the topmost panel in the
-            given screen.
-
-       ground_panel
-            this returns a pointer to the  lowest  panel  in  the
-            given screen.
-
-       new_prescr
-            when  creating  a new screen, the library uses static
-            variables  which   have   been   preset,   e.g.,   by
-            use_env(3x), filter(3x), etc.  With the screen-point-
-            er extension, there are situations where it must cre-
-            ate  a  current  screen before the unextended library
-            does.  The new_prescr function is used internally  to
-            handle these cases.  It is also provided as an entry-
-            point to allow applications to customize the  library
-            initialization.
-
-
-
-

NOTES

-       This extension introduces some new names:
-
-       NCURSES_SP_FUNCS
-            This  is  set  to the library patch-level number.  In
-            the unextended library, this is zero (0), to make  it
-            useful for checking if the extension is provided.
-
-       NCURSES_SP_NAME
-            The  new  functions  are named using the macro NCURS-
-            ES_SP_NAME, which hides  the  actual  implementation.
-            Currently this adds a "_sp" suffix to the name of the
-            unextended function.  This manual  page  indexes  the
-            extensions showing the full name.  However the proper
-            usage of these functions uses the macro,  to  provide
-            for the possibility of changing the naming convention
-            for specific library configurations.
-
-       NCURSES_SP_OUTC
-            This is a new function-pointer type  to  use  in  the
-            screen-pointer  functions  where  an  NCURSES_OUTC is
-            used in the unextended library.
-
-       NCURSES_OUTC
-            This is a function-pointer type used  for  the  cases
-            where  a  function  passes  characters  to the output
-            stream, e.g., vidputs(3x).
-
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on  ncurses  ex-
-       tensions be conditioned using NCURSES_SP_FUNCS.
-
-
-
-

SEE ALSO

-       curses(3x), curs_opaque(3x), curs_threads(3x).
-
-
-
-                                                      curs_sp_funcs(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_termattrs.3x.html b/doc/html/man/curs_termattrs.3x.html deleted file mode 100644 index 960cc2a4a7c..00000000000 --- a/doc/html/man/curs_termattrs.3x.html +++ /dev/null @@ -1,161 +0,0 @@ - - - - -curs_termattrs 3x - - - - -

curs_termattrs 3x

-
-
-
-curs_termattrs(3x)                                   curs_termattrs(3x)
-
-
-
-
-
-

NAME

-       baudrate, erasechar, erasewchar, has_ic, has_il, killchar,
-       killwchar, longname,  term_attrs,  termattrs,  termname  -
-       curses environment query routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int baudrate(void);
-       char erasechar(void);
-       int erasewchar(wchar_t *ch);
-       bool has_ic(void);
-       bool has_il(void);
-       char killchar(void);
-       int killwchar(wchar_t *ch);
-       char *longname(void);
-       attr_t term_attrs(void);
-       chtype termattrs(void);
-       char *termname(void);
-
-
-
-

DESCRIPTION

-       The  baudrate routine returns the output speed of the ter-
-       minal.  The number returned is in  bits  per  second,  for
-       example 9600, and is an integer.
-
-       The  erasechar  routine  returns  the user's current erase
-       character.
-
-       The erasewchar routine stores the current erase  character
-       in  the  location referenced by ch.  If no erase character
-       has been defined, the routine fails and the location  ref-
-       erenced by ch is not changed.
-
-       The has_ic routine is true if the terminal has insert- and
-       delete- character capabilities.
-
-       The has_il routine is true if the terminal has insert- and
-       delete-line  capabilities,  or  can  simulate  them  using
-       scrolling regions.  This might be used to determine if  it
-       would  be  appropriate to turn on physical scrolling using
-       scrollok.
-
-       The killchar routine returns the user's current line  kill
-       character.
-
-       The killwchar routine stores the current line-kill charac-
-       ter in the location referenced by  ch.   If  no  line-kill
-       character  has  been  defined,  the  routine fails and the
-       location referenced by ch is not changed.
-
-       The longname routine returns a pointer to  a  static  area
-       containing  a verbose description of the current terminal.
-       The maximum length of a verbose description is 128 charac-
-       ters.   It  is  defined  only after the call to initscr or
-       newterm.  The area is overwritten by each call to  newterm
-       and  is  not  restored by set_term, so the value should be
-       saved between calls to newterm if longname is going to  be
-       used with multiple terminals.
-
-       If  a  given  terminal  does not support a video attribute
-       that an application program is trying to use,  curses  may
-       substitute  a  different  video  attribute  for  it.   The
-       termattrs and term_attrs functions return a logical OR  of
-       all  video  attributes  supported by the terminal using A_
-       and WA_ constants respectively.  This information is  use-
-       ful  when a curses program needs complete control over the
-       appearance of the screen.
-
-       The termname routine returns the  terminal  name  used  by
-       setupterm.
-
-
-
-

RETURN VALUE

-       longname and termname return NULL on error.
-
-       Routines  that  return  an integer return ERR upon failure
-       and OK (SVr4 only specifies "an integer value  other  than
-       ERR") upon successful completion.
-
-
-
-

NOTES

-       Note that termattrs may be a macro.
-
-
-
-

PORTABILITY

-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.  It changes the return type of termattrs to the new
-       type  attr_t.  Most versions of curses truncate the result
-       returned by termname to 14 characters.
-
-
-
-

SEE ALSO

-       curses(3x), curs_initscr(3x), curs_outopts(3x)
-
-
-
-                                                     curs_termattrs(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_termcap.3x.html b/doc/html/man/curs_termcap.3x.html deleted file mode 100644 index f62fc0ca997..00000000000 --- a/doc/html/man/curs_termcap.3x.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - -curs_termcap 3x - - - - -

curs_termcap 3x

-
-
-
-curs_termcap(3x)                                       curs_termcap(3x)
-
-
-
-
-
-

NAME

-       PC, UP, BC, ospeed, tgetent, tgetflag, tgetnum, tgetstr,
-       tgoto, tputs - direct curses interface to the terminfo
-       capability database
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       #include <term.h>
-
-       extern char PC;
-       extern char * UP;
-       extern char * BC;
-       extern short ospeed;
-
-       int tgetent(char *bp, const char *name);
-       int tgetflag(char *id);
-       int tgetnum(char *id);
-       char *tgetstr(char *id, char **area);
-       char *tgoto(const char *cap, int col, int row);
-       int tputs(const char *str, int affcnt, int (*putc)(int));
-
-
-
-

DESCRIPTION

-       These  routines  are included as a conversion aid for pro-
-       grams that use the termcap library.  Their parameters  are
-       the  same and the routines are emulated using the terminfo
-       database.  Thus, they can only be used to query the  capa-
-       bilities  of  entries  for which a terminfo entry has been
-       compiled.
-
-       The tgetent routine loads the entry for name.  It  returns
-       1  on  success, 0 if there is no such entry, and -1 if the
-       terminfo database could not be found.  The  emulation  ig-
-       nores the buffer pointer bp.
-
-       The tgetflag routine gets the boolean entry for id, or ze-
-       ro if it is not available.
-
-       The tgetnum routine gets the numeric entry for id,  or  -1
-       if it is not available.
-
-       The  tgetstr  routine  returns the string entry for id, or
-       zero if it is not available.  Use tputs to output the  re-
-       turned  string.   The  return value will also be copied to
-       the buffer pointed to by area, and the area value will  be
-       updated to point past the null ending this value.
-
-       Only the first two characters of the id parameter of tget-
-       flag, tgetnum and tgetstr are compared in lookups.
-
-       The tgoto routine instantiates  the  parameters  into  the
-       given  capability.   The output from this routine is to be
-       passed to tputs.
-
-       The tputs routine is described  on  the  curs_terminfo(3x)
-       manual page.  It can retrieve capabilities by either term-
-       cap or terminfo name.
-
-       The variables PC, UP and BC are set by tgetent to the ter-
-       minfo   entry's   data   for   pad_char,   cursor_up   and
-       backspace_if_not_bs, respectively.   UP  is  not  used  by
-       ncurses.  PC is used in the tdelay_output function.  BC is
-       used in the tgoto emulation.  The variable ospeed  is  set
-       by ncurses in a system-specific coding to reflect the ter-
-       minal speed.
-
-
-
-

RETURN VALUE

-       Except where explicitly noted, routines that return an in-
-       teger  return ERR upon failure and OK (SVr4 only specifies
-       "an integer value other than ERR") upon successful comple-
-       tion.
-
-       Routines that return pointers return NULL on error.
-
-
-
-

BUGS

-       If you call tgetstr to fetch ca or any other parameterized
-       string, be aware that it will be returned in terminfo  no-
-       tation, not the older and not-quite-compatible termcap no-
-       tation.  This will not cause problems if all you  do  with
-       it  is  call  tgoto  or tparm, which both expand terminfo-
-       style strings as terminfo.  (The tgoto function,  if  con-
-       figured  to  support  termcap, will check if the string is
-       indeed terminfo-style by looking for  "%p"  parameters  or
-       "$<..>"  delays,  and invoke a termcap-style parser if the
-       string does not appear to be terminfo).
-
-       Because terminfo conventions for representing  padding  in
-       string  capabilities  differ  from termcap's, tputs("50");
-       will put out a literal "50" rather than  busy-waiting  for
-       50 milliseconds.  Cope with it.
-
-       Note  that termcap has nothing analogous to terminfo's sgr
-       string.  One consequence of this is that termcap  applica-
-       tions  assume me (terminfo sgr0) does not reset the alter-
-       nate character set.  This implementation checks  for,  and
-       modifies the data shown to the termcap interface to accom-
-       modate termcap's limitation in this respect.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue  4  describes  these  func-
-       tions.   However,  they are marked TO BE WITHDRAWN and may
-       be removed in future versions.
-
-       Neither the XSI Curses standard nor  the  SVr4  man  pages
-       documented  the return values of tgetent correctly, though
-       all three were in fact returned ever since SVr1.  In  par-
-       ticular,  an  omission in the XSI Curses documentation has
-       been misinterpreted to mean that  tgetent  returns  OK  or
-       ERR.  Because the purpose of these functions is to provide
-       compatibility with the termcap library, that is  a  defect
-       in XCurses, Issue 4, Version 2 rather than in ncurses.
-
-       External  variables  are  provided  for support of certain
-       termcap applications.  However, termcap applications'  use
-       of those variables is poorly documented, e.g., not distin-
-       guishing between input and output.   In  particular,  some
-       applications are reported to declare and/or modify ospeed.
-
-
-
-

SEE ALSO

-       curses(3x), terminfo(5), term_variables(3x), putc(3).
-
-
-
-                                                       curs_termcap(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_terminfo.3x.html b/doc/html/man/curs_terminfo.3x.html deleted file mode 100644 index 9a640e9f8bc..00000000000 --- a/doc/html/man/curs_terminfo.3x.html +++ /dev/null @@ -1,363 +0,0 @@ - - - - -curs_terminfo 3x - - - - -

curs_terminfo 3x

-
-
-
-curs_terminfo(3x)                                     curs_terminfo(3x)
-
-
-
-
-
-

NAME

-       del_curterm, mvcur, putp, restartterm, set_curterm,
-       setterm, setupterm, tigetflag, tigetnum, tigetstr, tiparm,
-       tparm, tputs, vid_attr, vid_puts, vidattr, vidputs -
-       curses interfaces to terminfo database
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       #include <term.h>
-
-       int setupterm(char *term, int fildes, int *errret);
-       int setterm(char *term);
-       TERMINAL *set_curterm(TERMINAL *nterm);
-       int del_curterm(TERMINAL *oterm);
-       int restartterm(char *term, int fildes, int *errret);
-       char *tparm(char *str, ...);
-       int tputs(const char *str, int affcnt, int (*putc)(int));
-       int putp(const char *str);
-       int vidputs(chtype attrs, int (*putc)(int));
-       int vidattr(chtype attrs);
-       int vid_puts(attr_t attrs, short pair, void *opts, int (*putc)(char));
-       int vid_attr(attr_t attrs, short pair, void *opts);
-       int mvcur(int oldrow, int oldcol, int newrow, int newcol);
-       int tigetflag(char *capname);
-       int tigetnum(char *capname);
-       char *tigetstr(char *capname);
-       char *tiparm(const char *str, ...);
-
-
-
-

DESCRIPTION

-       These low-level routines must be called by  programs  that
-       have to deal directly with the terminfo database to handle
-       certain terminal capabilities, such as  programming  func-
-       tion  keys.   For all other functionality, curses routines
-       are more suitable and their use is recommended.
-
-       Initially, setupterm should  be  called.   Note  that  se-
-       tupterm  is  automatically  called by initscr and newterm.
-       This  defines  the  set  of  terminal-dependent  variables
-       [listed in terminfo(5)].  The terminfo variables lines and
-       columns are initialized by setupterm as follows:
-
-              If use_env(FALSE) has been called, values for lines
-              and columns specified in terminfo are used.
-
-              Otherwise,  if  the environment variables LINES and
-              COLUMNS exist, their values are used.  If these en-
-              vironment variables do not exist and the program is
-              running in a window, the  current  window  size  is
-              used.   Otherwise,  if the environment variables do
-              not exist, the values for lines and columns  speci-
-              fied in the terminfo database are used.
-
-       The  header  files  curses.h and term.h should be included
-       (in this order) to get the definitions for these  strings,
-       numbers,  and  flags.   Parameterized  strings  should  be
-       passed through tparm to instantiate  them.   All  terminfo
-       strings  [including the output of tparm] should be printed
-       with tputs or putp.  Call the reset_shell_mode to  restore
-       the  tty modes before exiting [see curs_kernel(3x)].  Pro-
-       grams  which  use  cursor  addressing  should  output  en-
-       ter_ca_mode  upon  startup  and should output exit_ca_mode
-       before exiting.  Programs desiring  shell  escapes  should
-       call
-
-       reset_shell_mode  and output exit_ca_mode before the shell
-       is called and should output  enter_ca_mode  and  call  re-
-       set_prog_mode after returning from the shell.
-
-       The setupterm routine reads in the terminfo database, ini-
-       tializing the terminfo structures, but does not set up the
-       output virtualization structures used by curses.  The ter-
-       minal type is the character string term; if term is  null,
-       the  environment  variable TERM is used.  All output is to
-       file descriptor fildes which is  initialized  for  output.
-       If  errret  is  not null, then setupterm returns OK or ERR
-       and stores a status value in the integer pointed to by er-
-       rret.   A  return value of OK combined with status of 1 in
-       errret is normal.  If ERR is returned, examine errret:
-
-              1    means that the terminal is hardcopy, cannot be
-                   used for curses applications.
-
-              0    means that the terminal could not be found, or
-                   that it is a generic type, having  too  little
-                   information for curses applications to run.
-
-              -1   means  that the terminfo database could not be
-                   found.
-
-       If errret is null, setupterm prints an error message  upon
-       finding an error and exits.  Thus, the simplest call is:
-
-             setupterm((char *)0, 1, (int *)0);,
-
-       which  uses  all the defaults and sends the output to std-
-       out.
-
-       The setterm routine is being replaced by  setupterm.   The
-       call:
-
-             setupterm(term, 1, (int *)0)
-
-       provides  the  same  functionality  as setterm(term).  The
-       setterm routine is included here  for  BSD  compatibility,
-       and is not recommended for new programs.
-
-       The  set_curterm  routine  sets  the  variable cur_term to
-       nterm, and makes all of the terminfo boolean, numeric, and
-       string  variables  use  the values from nterm.  It returns
-       the old value of cur_term.
-
-       The del_curterm routine frees  the  space  pointed  to  by
-       oterm and makes it available for further use.  If oterm is
-       the same as cur_term, references to any  of  the  terminfo
-       boolean,  numeric, and string variables thereafter may re-
-       fer to invalid memory locations  until  another  setupterm
-       has been called.
-
-       The  restartterm  routine  is  similar  to  setupterm  and
-       initscr, except that it is called after  restoring  memory
-       to  a  previous  state (for example, when reloading a game
-       saved as a core image dump).  It assumes that the  windows
-       and the input and output options are the same as when mem-
-       ory was saved, but the terminal type and baud rate may  be
-       different.   Accordingly, it saves various tty state bits,
-       calls setupterm, and then restores the bits.
-
-       The tparm routine instantiates the string str with parame-
-       ters  pi.  A pointer is returned to the result of str with
-       the parameters applied.
-
-       tiparm is a newer form  of  tparm  which  uses  <stdarg.h>
-       rather  than  a fixed-parameter list.  Its numeric parame-
-       ters are integers (int) rather than longs.
-
-       The tputs  routine  applies  padding  information  to  the
-       string  str  and  outputs  it.  The str must be a terminfo
-       string variable or the return value from  tparm,  tgetstr,
-       or tgoto.  affcnt is the number of lines affected, or 1 if
-       not applicable.  putc is a putchar-like routine  to  which
-       the characters are passed, one at a time.
-
-       The  putp routine calls tputs(str, 1, putchar).  Note that
-       the output of putp always  goes  to  stdout,  not  to  the
-       fildes specified in setupterm.
-
-       The vidputs routine displays the string on the terminal in
-       the video attribute mode attrs, which is  any  combination
-       of  the  attributes  listed in curses(3x).  The characters
-       are passed to the putchar-like routine putc.
-
-       The vidattr routine is like the  vidputs  routine,  except
-       that it outputs through putchar.
-
-       The  vid_attr  and vid_puts routines correspond to vidattr
-       and vidputs, respectively.  They use a  set  of  arguments
-       for  representing  the  video attributes plus color, i.e.,
-       one of type attr_t for the attributes and one of short for
-       the color_pair number.  The vid_attr and vid_puts routines
-       are designed to use the attribute constants with  the  WA_
-       prefix.   The  opts  argument  is reserved for future use.
-       Currently, applications must provide a  null  pointer  for
-       that argument.
-
-       The  mvcur  routine  provides low-level cursor motion.  It
-       takes effect immediately (rather  than  at  the  next  re-
-       fresh).
-
-       The  tigetflag,  tigetnum and tigetstr routines return the
-       value of the capability corresponding to the terminfo cap-
-       name passed to them, such as xenl.
-
-       The  tigetflag  routine returns the value -1 if capname is
-       not a boolean capability, or 0 if it is canceled or absent
-       from the terminal description.
-
-       The  tigetnum  routine  returns the value -2 if capname is
-       not a numeric capability, or -1 if it is canceled  or  ab-
-       sent from the terminal description.
-
-       The  tigetstr routine returns the value (char *)-1 if cap-
-       name is not a string capability, or 0 if it is canceled or
-       absent from the terminal description.
-
-       The capname for each capability is given in the table col-
-       umn entitled capname code in the capabilities  section  of
-       terminfo(5).
-
-              char *boolnames[], *boolcodes[], *boolfnames[]
-
-              char *numnames[], *numcodes[], *numfnames[]
-
-              char *strnames[], *strcodes[], *strfnames[]
-
-       These  null-terminated  arrays  contain  the capnames, the
-       termcap codes, and the full C names, for each of the  ter-
-       minfo variables.
-
-
-
-

RETURN VALUE

-       Routines  that  return  an integer return ERR upon failure
-       and OK (SVr4 only specifies "an integer value  other  than
-       ERR")  upon  successful completion, unless otherwise noted
-       in the preceding routine descriptions.
-
-       Routines that return pointers always return NULL on error.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion
-
-              del_curterm
-                   returns  an error if its terminal parameter is
-                   null.
-
-              putp calls tputs, returning the same error-codes.
-
-              restartterm
-                   returns an error if the associated call to se-
-                   tupterm returns an error.
-
-              setupterm
-                   returns  an error if it cannot allocate enough
-                   memory, or create the initial windows (stdscr,
-                   curscr,  newscr).   Other error conditions are
-                   documented above.
-
-              tputs
-                   returns an error if the  string  parameter  is
-                   null.   It  does not detect I/O errors: X/Open
-                   states that tputs ignores the return value  of
-                   the output function putc.
-
-
-
-

NOTES

-       The  setupterm routine should be used in place of setterm.
-       It may be useful when you want to test for terminal  capa-
-       bilities  without  committing to the allocation of storage
-       involved in initscr.
-
-       Note that vidattr and vidputs may be macros.
-
-
-
-

PORTABILITY

-       The function setterm is not described by X/Open  and  must
-       be  considered  non-portable.   All other functions are as
-       described by X/Open.
-
-       setupterm copies the terminal name to the  array  ttytype.
-       This  is not part of X/Open Curses, but is assumed by some
-       applications.
-
-       In System V Release 4, set_curterm has an int return  type
-       and  returns  OK  or ERR.  We have chosen to implement the
-       X/Open Curses semantics.
-
-       In System V Release 4, the third argument of tputs has the
-       type int (*putc)(char).
-
-       At least one implementation of X/Open Curses (Solaris) re-
-       turns a value other than OK/ERR from tputs.  That  returns
-       the length of the string, and does no error-checking.
-
-       X/Open  Curses prototypes tparm with a fixed number of pa-
-       rameters, rather than a variable argument list.  This  im-
-       plementation  uses  a  variable  argument list, but can be
-       configured to use the fixed-parameter list.  Portable  ap-
-       plications  should  provide 9 parameters after the format;
-       zeroes are fine for this purpose.
-
-       In response to comments by Thomas E. Dickey, X/Open Curses
-       Issue 7 proposed the tiparam function in mid-2009.
-
-       X/Open  notes  that  after calling mvcur, the curses state
-       may not match the actual terminal state, and that  an  ap-
-       plication  should  touch and refresh the window before re-
-       suming normal curses calls.  Both ncurses and System V Re-
-       lease 4 curses implement mvcur using the SCREEN data allo-
-       cated in either initscr or newterm.  So though it is docu-
-       mented  as  a  terminfo function, mvcur is really a curses
-       function which is not well specified.
-
-       X/Open states that the old  location  must  be  given  for
-       mvcur.   This implementation allows the caller to use -1's
-       for the old ordinates.  In that case, the old location  is
-       unknown.
-
-       Extended  terminal  capability  names, e.g., as defined by
-       tic -x, are not stored in the  arrays  described  in  this
-       section.
-
-
-
-

SEE ALSO

-       curses(3x),  curs_initscr(3x), curs_kernel(3x), curs_term-
-       cap(3x), curs_variables(3x), term_variables(3x),  putc(3),
-       terminfo(5)
-
-
-
-                                                      curs_terminfo(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_threads.3x.html b/doc/html/man/curs_threads.3x.html deleted file mode 100644 index 394544a3b76..00000000000 --- a/doc/html/man/curs_threads.3x.html +++ /dev/null @@ -1,634 +0,0 @@ - - - - -curs_threads 3x - - - - -

curs_threads 3x

-
-
-
-curs_threads(3x)                                       curs_threads(3x)
-
-
-
-
-
-

NAME

-       use_screen, use_window - curses thread support
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);
-       typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);
-       int get_escdelay(void);
-       int set_escdelay(int size);
-       int set_tabsize(int size);
-       int  use_screen(SCREEN  *scr, NCURSES_WINDOW_CB func, void
-       *data);
-       int use_window(WINDOW *win, NCURSES_SCREEN_CB  func,  void
-       *data);
-
-
-
-

DESCRIPTION

-       This  implementation can be configured to provide rudimen-
-       tary support for multi-threaded applications.  This  makes
-       a  different set of libraries, e.g., libncursest since the
-       binary interfaces are different.
-
-       Rather than modify the interfaces to pass a thread  speci-
-       fier  to  each function, it adds a few functions which can
-       be used in any configuration which hide the mutex's needed
-       to  prevent  concurrent  use  of the global variables when
-       configured for threading.
-
-       In addition to forcing access to  members  of  the  WINDOW
-       structure  to  be  via functions (see curs_opaque(3x)), it
-       makes functions of the common global variables, e.g., COL-
-       ORS,  COLOR_PAIRS,  COLS, ESCDELAY, LINES, TABSIZE curscr,
-       newscr and ttytype.  Those  variables  are  maintained  as
-       read-only values, stored in the SCREEN structure.
-
-       Even  this is not enough to make a thread-safe application
-       using curses.  A multi-threaded application would  be  ex-
-       pected  to  have threads updating separate windows (within
-       the same device), or updating on separate screens (on dif-
-       ferent  devices).  Also, a few of the global variables are
-       considered writable by some applications.   The  functions
-       described here address these special situations.
-
-       The  ESCDELAY and TABSIZE global variables are modified by
-       some applications.  To modify them in  any  configuration,
-       use  the  set_escdelay  or  set_tabsize  functions.  Other
-       global variables are not modifiable.
-
-       The get_escdelay function returns the value for ESCDELAY.
-
-       The use_window and  use_screen  functions  provide  coarse
-       granularity mutexes for their respective WINDOW and SCREEN
-       parameters, and call a user-supplied function, passing  it
-       a  data  parameter, and returning the value from the user-
-       supplied function to the application.
-
-   USAGE
-       All of the ncurses library functions assume that  the  lo-
-       cale  is  not altered during operation.  In addition, they
-       use data which is maintained within a hierarchy of scopes.
-
-          o   global data, e.g., used in the  low-level  terminfo
-              or termcap interfaces.
-
-          o   terminal  data,  e.g.,  associated  with  a call to
-              set_curterm.  The  terminal  data  are  initialized
-              when screens are created.
-
-          o   screen  data,  e.g.,  associated  with  a  call  to
-              newterm or initscr.
-
-          o   window data, e.g., associated with a call to newwin
-              or  subwin.   Windows  are associated with screens.
-              Pads are not necessarily associated with a particu-
-              lar screen.
-
-              Most  curses  applications  operate  on one or more
-              windows within a single screen.
-
-          o   reentrant, i.e., it uses only the  data  passed  as
-              parameters.
-
-       This table lists the scope of data used for each symbol in
-       the ncurses library  when  it  is  configured  to  support
-       threading:
-
-      Symbol                  Scope
-      -------------------------------------------------------------
-      BC                      global
-      COLORS                  screen (readonly)
-      COLOR_PAIR              reentrant
-      COLOR_PAIRS             screen (readonly)
-      COLS                    screen (readonly)
-      ESCDELAY                screen (readonly, see set_escdelay)
-      LINES                   screen (readonly)
-      PAIR_NUMBER             reentrant
-      PC                      global
-      SP                      global
-      TABSIZE                 screen (readonly)
-      UP                      global
-      acs_map                 screen (readonly)
-      add_wch                 window (stdscr)
-      add_wchnstr             window (stdscr)
-      add_wchstr              window (stdscr)
-      addch                   window (stdscr)
-      addchnstr               window (stdscr)
-      addchstr                window (stdscr)
-      addnstr                 window (stdscr)
-      addnwstr                window (stdscr)
-      addstr                  window (stdscr)
-      addwstr                 window (stdscr)
-      assume_default_colors   screen
-      attr_get                window (stdscr)
-      attr_off                window (stdscr)
-      attr_on                 window (stdscr)
-      attr_set                window (stdscr)
-      attroff                 window (stdscr)
-      attron                  window (stdscr)
-      attrset                 window (stdscr)
-      baudrate                screen
-      beep                    screen
-      bkgd                    window (stdscr)
-      bkgdset                 window (stdscr)
-      bkgrnd                  window (stdscr)
-      bkgrndset               window (stdscr)
-      boolcodes               global (readonly)
-      boolfnames              global (readonly)
-      boolnames               global (readonly)
-      border                  window (stdscr)
-
-      border_set              window (stdscr)
-      box                     window (stdscr)
-      box_set                 window (stdscr)
-      can_change_color        terminal
-      cbreak                  screen
-      chgat                   window (stdscr)
-      clear                   window (stdscr)
-      clearok                 window
-      clrtobot                window (stdscr)
-      clrtoeol                window (stdscr)
-      color_content           screen
-      color_set               window (stdscr)
-      copywin                 window locks(source, target)
-      cur_term                terminal
-      curs_set                screen
-      curscr                  screen (readonly)
-      curses_version          global (readonly)
-      def_prog_mode           terminal
-      def_shell_mode          terminal
-      define_key              screen
-      del_curterm             screen
-      delay_output            screen
-      delch                   window (stdscr)
-      deleteln                window (stdscr)
-      delscreen               global locks(screenlist, screen)
-      delwin                  global locks(windowlist)
-      derwin                  screen
-      doupdate                screen
-      dupwin                  screen locks(window)
-      echo                    screen
-      echo_wchar              window (stdscr)
-      echochar                window (stdscr)
-      endwin                  screen
-      erase                   window (stdscr)
-      erasechar               window (stdscr)
-      erasewchar              window (stdscr)
-      filter                  global
-      flash                   terminal
-      flushinp                screen
-      get_wch                 screen (input-operation)
-      get_wstr                screen (input-operation)
-      getattrs                window
-      getbegx                 window
-      getbegy                 window
-      getbkgd                 window
-      getbkgrnd               window
-      getcchar                reentrant
-      getch                   screen (input-operation)
-      getcurx                 window
-      getcury                 window
-      getmaxx                 window
-      getmaxy                 window
-      getmouse                screen (input-operation)
-      getn_wstr               screen (input-operation)
-      getnstr                 screen (input-operation)
-      getparx                 window
-      getpary                 window
-      getstr                  screen (input-operation)
-      getwin                  screen (input-operation)
-      halfdelay               screen
-      has_colors              terminal
-      has_ic                  terminal
-      has_il                  terminal
-      has_key                 screen
-      hline                   window (stdscr)
-      hline_set               window (stdscr)
-
-      idcok                   window
-      idlok                   window
-      immedok                 window
-      in_wch                  window (stdscr)
-      in_wchnstr              window (stdscr)
-      in_wchstr               window (stdscr)
-      inch                    window (stdscr)
-      inchnstr                window (stdscr)
-      inchstr                 window (stdscr)
-      init_color              screen
-      init_pair               screen
-      initscr                 global locks(screenlist)
-      innstr                  window (stdscr)
-      innwstr                 window (stdscr)
-      ins_nwstr               window (stdscr)
-      ins_wch                 window (stdscr)
-      ins_wstr                window (stdscr)
-      insch                   window (stdscr)
-      insdelln                window (stdscr)
-      insertln                window (stdscr)
-      insnstr                 window (stdscr)
-      insstr                  window (stdscr)
-      instr                   window (stdscr)
-      intrflush               terminal
-      inwstr                  window (stdscr)
-      is_cleared              window
-      is_idcok                window
-      is_idlok                window
-      is_immedok              window
-      is_keypad               window
-      is_leaveok              window
-      is_linetouched          window
-      is_nodelay              window
-      is_notimeout            window
-      is_scrollok             window
-      is_syncok               window
-      is_term_resized         terminal
-      is_wintouched           window
-      isendwin                screen
-      key_defined             screen
-      key_name                global (static data)
-      keybound                screen
-      keyname                 global (static data)
-      keyok                   screen
-      keypad                  window
-      killchar                terminal
-      killwchar               terminal
-      leaveok                 window
-      longname                screen
-      mcprint                 terminal
-      meta                    screen
-      mouse_trafo             window (stdscr)
-      mouseinterval           screen
-      mousemask               screen
-      move                    window (stdscr)
-      mvadd_wch               window (stdscr)
-      mvadd_wchnstr           window (stdscr)
-      mvadd_wchstr            window (stdscr)
-      mvaddch                 window (stdscr)
-      mvaddchnstr             window (stdscr)
-      mvaddchstr              window (stdscr)
-      mvaddnstr               window (stdscr)
-      mvaddnwstr              window (stdscr)
-      mvaddstr                window (stdscr)
-      mvaddwstr               window (stdscr)
-      mvchgat                 window (stdscr)
-
-      mvcur                   screen
-      mvdelch                 window (stdscr)
-      mvderwin                window (stdscr)
-      mvget_wch               screen (input-operation)
-      mvget_wstr              screen (input-operation)
-      mvgetch                 screen (input-operation)
-      mvgetn_wstr             screen (input-operation)
-      mvgetnstr               screen (input-operation)
-      mvgetstr                screen (input-operation)
-      mvhline                 window (stdscr)
-      mvhline_set             window (stdscr)
-      mvin_wch                window (stdscr)
-      mvin_wchnstr            window (stdscr)
-      mvin_wchstr             window (stdscr)
-      mvinch                  window (stdscr)
-      mvinchnstr              window (stdscr)
-      mvinchstr               window (stdscr)
-      mvinnstr                window (stdscr)
-      mvinnwstr               window (stdscr)
-      mvins_nwstr             window (stdscr)
-      mvins_wch               window (stdscr)
-      mvins_wstr              window (stdscr)
-      mvinsch                 window (stdscr)
-      mvinsnstr               window (stdscr)
-      mvinsstr                window (stdscr)
-      mvinstr                 window (stdscr)
-      mvinwstr                window (stdscr)
-      mvprintw                window (stdscr)
-      mvscanw                 screen
-      mvvline                 window (stdscr)
-      mvvline_set             window (stdscr)
-      mvwadd_wch              window
-      mvwadd_wchnstr          window
-      mvwadd_wchstr           window
-      mvwaddch                window
-      mvwaddchnstr            window
-      mvwaddchstr             window
-      mvwaddnstr              window
-      mvwaddnwstr             window
-      mvwaddstr               window
-      mvwaddwstr              window
-      mvwchgat                window
-      mvwdelch                window
-      mvwget_wch              screen (input-operation)
-      mvwget_wstr             screen (input-operation)
-      mvwgetch                screen (input-operation)
-      mvwgetn_wstr            screen (input-operation)
-      mvwgetnstr              screen (input-operation)
-      mvwgetstr               screen (input-operation)
-      mvwhline                window
-      mvwhline_set            window
-      mvwin                   window
-      mvwin_wch               window
-      mvwin_wchnstr           window
-      mvwin_wchstr            window
-      mvwinch                 window
-      mvwinchnstr             window
-      mvwinchstr              window
-      mvwinnstr               window
-      mvwinnwstr              window
-      mvwins_nwstr            window
-      mvwins_wch              window
-      mvwins_wstr             window
-      mvwinsch                window
-      mvwinsnstr              window
-      mvwinsstr               window
-
-      mvwinstr                window
-      mvwinwstr               window
-      mvwprintw               window
-      mvwscanw                screen
-      mvwvline                window
-      mvwvline_set            window
-      napms                   reentrant
-      newpad                  global locks(windowlist)
-      newscr                  screen (readonly)
-      newterm                 global locks(screenlist)
-      newwin                  global locks(windowlist)
-      nl                      screen
-      nocbreak                screen
-      nodelay                 window
-      noecho                  screen
-      nofilter                global
-      nonl                    screen
-      noqiflush               terminal
-      noraw                   screen
-      notimeout               window
-      numcodes                global (readonly)
-      numfnames               global (readonly)
-      numnames                global (readonly)
-      ospeed                  global
-      overlay                 window locks(source, target)
-      overwrite               window locks(source, target)
-      pair_content            screen
-      pecho_wchar             screen
-      pechochar               screen
-      pnoutrefresh            screen
-      prefresh                screen
-      printw                  window
-      putp                    global
-      putwin                  window
-      qiflush                 terminal
-      raw                     screen
-      redrawwin               window
-      refresh                 screen
-      reset_prog_mode         screen
-      reset_shell_mode        screen
-      resetty                 terminal
-      resize_term             screen locks(windowlist)
-      resizeterm              screen
-      restartterm             screen
-      ripoffline              global (static data)
-      savetty                 terminal
-      scanw                   screen
-      scr_dump                screen
-      scr_init                screen
-      scr_restore             screen
-      scr_set                 screen
-      scrl                    window (stdscr)
-      scroll                  window
-      scrollok                window
-      set_curterm             screen
-      set_escdelay            screen
-      set_tabsize             screen
-      set_term                global locks(screenlist, screen)
-      setcchar                reentrant
-      setscrreg               window (stdscr)
-      setupterm               global
-      slk_attr                screen
-      slk_attr_off            screen
-      slk_attr_on             screen
-      slk_attr_set            screen
-      slk_attroff             screen
-
-      slk_attron              screen
-      slk_attrset             screen
-      slk_clear               screen
-      slk_color               screen
-      slk_init                screen
-      slk_label               screen
-      slk_noutrefresh         screen
-      slk_refresh             screen
-      slk_restore             screen
-      slk_set                 screen
-      slk_touch               screen
-      slk_wset                screen
-      standend                window
-      standout                window
-      start_color             screen
-      stdscr                  screen (readonly)
-      strcodes                global (readonly)
-      strfnames               global (readonly)
-      strnames                global (readonly)
-      subpad                  window
-      subwin                  window
-      syncok                  window
-      term_attrs              screen
-      termattrs               screen
-      termname                terminal
-      tgetent                 global
-      tgetflag                global
-      tgetnum                 global
-      tgetstr                 global
-      tgoto                   global
-      tigetflag               terminal
-      tigetnum                terminal
-      tigetstr                terminal
-      timeout                 window (stdscr)
-      touchline               window
-      touchwin                window
-      tparm                   global (static data)
-      tputs                   screen
-      trace                   global (static data)
-      ttytype                 screen (readonly)
-      typeahead               screen
-      unctrl                  screen
-      unget_wch               screen (input-operation)
-      ungetch                 screen (input-operation)
-      ungetmouse              screen (input-operation)
-      untouchwin              window
-      use_default_colors      screen
-      use_env                 global (static data)
-      use_extended_names      global (static data)
-      use_legacy_coding       screen
-      use_screen              global locks(screenlist, screen)
-      use_window              global locks(windowlist, window)
-      vid_attr                screen
-      vid_puts                screen
-      vidattr                 screen
-      vidputs                 screen
-      vline                   window (stdscr)
-      vline_set               window (stdscr)
-      vw_printw               window
-      vw_scanw                screen
-      vwprintw                window
-      vwscanw                 screen
-      wadd_wch                window
-      wadd_wchnstr            window
-      wadd_wchstr             window
-      waddch                  window
-
-      waddchnstr              window
-      waddchstr               window
-      waddnstr                window
-      waddnwstr               window
-      waddstr                 window
-      waddwstr                window
-      wattr_get               window
-      wattr_off               window
-      wattr_on                window
-      wattr_set               window
-      wattroff                window
-      wattron                 window
-      wattrset                window
-      wbkgd                   window
-      wbkgdset                window
-      wbkgrnd                 window
-      wbkgrndset              window
-      wborder                 window
-      wborder_set             window
-      wchgat                  window
-      wclear                  window
-      wclrtobot               window
-      wclrtoeol               window
-      wcolor_set              window
-      wcursyncup              screen (affects window plus parents)
-      wdelch                  window
-      wdeleteln               window
-      wecho_wchar             window
-      wechochar               window
-      wenclose                window
-      werase                  window
-      wget_wch                screen (input-operation)
-      wget_wstr               screen (input-operation)
-      wgetbkgrnd              window
-      wgetch                  screen (input-operation)
-      wgetn_wstr              screen (input-operation)
-      wgetnstr                screen (input-operation)
-      wgetparent              window
-      wgetscrreg              window
-      wgetstr                 screen (input-operation)
-      whline                  window
-      whline_set              window
-      win_wch                 window
-      win_wchnstr             window
-      win_wchstr              window
-      winch                   window
-      winchnstr               window
-      winchstr                window
-      winnstr                 window
-      winnwstr                window
-      wins_nwstr              window
-      wins_wch                window
-      wins_wstr               window
-      winsch                  window
-      winsdelln               window
-      winsertln               window
-      winsnstr                window
-      winsstr                 window
-      winstr                  window
-      winwstr                 window
-      wmouse_trafo            window
-      wmove                   window
-      wnoutrefresh            screen
-      wprintw                 window
-      wredrawln               window
-      wrefresh                screen
-
-      wresize                 window locks(windowlist)
-      wscanw                  screen
-      wscrl                   window
-      wsetscrreg              window
-      wstandend               window
-      wstandout               window
-      wsyncdown               screen (affects window plus parents)
-      wsyncup                 screen (affects window plus parents)
-      wtimeout                window
-      wtouchln                window
-      wunctrl                 global (static data)
-      wvline                  window
-      wvline_set              window
-
-
-
-

RETURN VALUE

-       These functions all return TRUE or FALSE, except as noted.
-
-
-
-

NOTES

-       Both a macro and a function are provided for each name.
-
-
-
-

PORTABILITY

-       These  routines  are  specific  to ncurses.  They were not
-       supported on Version 7, BSD or System  V  implementations.
-       It  is  recommended that any code depending on ncurses ex-
-       tensions be conditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       curses(3x), curs_opaque(3x), curs_variables(3x).
-
-
-
-                                                       curs_threads(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_touch.3x.html b/doc/html/man/curs_touch.3x.html deleted file mode 100644 index 9ba1bc6c21a..00000000000 --- a/doc/html/man/curs_touch.3x.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - -curs_touch 3x - - - - -

curs_touch 3x

-
-
-
-curs_touch(3x)                                           curs_touch(3x)
-
-
-
-
-
-

NAME

-       touchwin, touchline, untouchwin, wtouchln, is_linetouched,
-       is_wintouched - curses refresh control routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       int touchwin(WINDOW *win);
-       int touchline(WINDOW *win, int start, int count);
-       int untouchwin(WINDOW *win);
-       int wtouchln(WINDOW *win, int y, int n, int changed);
-       bool is_linetouched(WINDOW *win, int line);
-       bool is_wintouched(WINDOW *win);
-
-
-
-

DESCRIPTION

-       The touchwin and touchline routines throw away  all  opti-
-       mization  information about which parts of the window have
-       been touched, by pretending that  the  entire  window  has
-       been  drawn  on.   This  is sometimes necessary when using
-       overlapping windows, since a change to one window  affects
-       the other window, but the records of which lines have been
-       changed in the other window do  not  reflect  the  change.
-       The  routine touchline only pretends that count lines have
-       been changed, beginning with line start.
-
-       The untouchwin routine marks all lines in  the  window  as
-       unchanged since the last call to wrefresh.
-
-       The wtouchln routine makes n lines in the window, starting
-       at line y, look as if they have (changed=1)  or  have  not
-       (changed=0) been changed since the last call to wrefresh.
-
-       The  is_linetouched and is_wintouched routines return TRUE
-       if the specified line/window was modified since  the  last
-       call  to  wrefresh; otherwise they return FALSE.  In addi-
-       tion, is_linetouched returns ERR if line is not valid  for
-       the given window.
-
-
-
-

RETURN VALUE

-       All  routines  return  the integer ERR upon failure and an
-       integer value other than ERR upon  successful  completion,
-       unless  otherwise  noted in the preceding routine descrip-
-       tions.
-
-       X/Open does not define any error conditions.  In this  im-
-       plementation
-
-              is_linetouched
-                   returns  an  error  if  the  window pointer is
-                   null, or if the line  number  is  outside  the
-                   window.   Note  that ERR is distinct from TRUE
-                   and FALSE, which are the normal return  values
-                   of this function.
-
-              wtouchln
-                   returns  an  error  if  the  window pointer is
-                   null, or if the line  number  is  outside  the
-                   window.
-
-
-
-

PORTABILITY

-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.
-
-       Some historic curses implementations had,  as  an  undocu-
-       mented  feature,  the  ability  to  do  the  equivalent of
-       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
-       scr).  This will not work under ncurses.
-
-
-
-

NOTES

-       Note that all routines except wtouchln may be macros.
-
-
-
-

SEE ALSO

-       curses(3x), curs_refresh(3x), curs_variables(3x).
-
-
-
-                                                         curs_touch(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_trace.3x.html b/doc/html/man/curs_trace.3x.html deleted file mode 100644 index 3705fdabf4a..00000000000 --- a/doc/html/man/curs_trace.3x.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - -curs_trace 3x - - - - -

curs_trace 3x

-
-
-
-curs_trace(3x)                                           curs_trace(3x)
-
-
-
-
-
-

NAME

-       _tracef, _tracedump, _traceattr, _traceattr2,
-       _nc_tracebits, _tracecchar_t, _tracecchar_t2, _tracechar,
-       _tracechtype, _tracechtype2, _tracemouse, trace - curses
-       debugging routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       void _tracef(const char *format, ...);
-       void _tracedump(const char *label, WINDOW *win);
-       char *_traceattr(attr_t attr);
-       char *_traceattr2(int buffer, chtype ch);
-       char *_nc_tracebits(void);
-       char * _tracecchar_t(const cchar_t *string);
-       char * _tracecchar_t2(int buffer, const cchar_t *string);
-       char *_tracechar(int ch);
-       char *_tracechtype(chtype ch);
-       char *_tracechtype2(int buffer, chtype ch);
-       char *_tracemouse(const MEVENT *event);
-       void trace(const unsigned int param);
-
-
-
-

DESCRIPTION

-       The trace routines are used for debugging the ncurses  li-
-       braries, as well as applications which use the ncurses li-
-       braries.  These functions are normally available only with
-       the  debugging library libncurses_g.a, but may be compiled
-       into any model (shared, static, profile) by  defining  the
-       symbol  TRACE.   Additionally,  some  functions  are  only
-       available with the wide-character configuration of the li-
-       braries.
-
-       The  principal  parts of this interface are the trace rou-
-       tine which selectively enables different tracing features,
-       and the _tracef routine which writes formatted data to the
-       trace file.
-
-       Calling trace with a  nonzero  parameter  opens  the  file
-       trace  in the current directory for output.  The parameter
-       is formed by OR'ing values from the list of TRACE_xxx def-
-       initions in <curses.h>.  These include:
-
-       TRACE_DISABLE
-            turn off tracing.
-
-       TRACE_TIMES
-            trace user and system times of updates.
-
-       TRACE_TPUTS
-            trace tputs calls.
-
-       TRACE_UPDATE
-            trace update actions, old & new screens.
-
-       TRACE_MOVE
-            trace cursor movement and scrolling.
-
-       TRACE_CHARPUT
-            trace all character outputs.
-
-       TRACE_ORDINARY
-            trace  all  update  actions.   The old and new screen
-            contents are written to the trace file for  each  re-
-            fresh.
-
-       TRACE_CALLS
-            trace all curses calls.  The parameters for each call
-            are traced, as well as return values.
-
-       TRACE_VIRTPUT
-            trace virtual character puts, i.e., calls to addch.
-
-       TRACE_IEVENT
-            trace low-level input processing, including timeouts.
-
-       TRACE_BITS
-            trace state of TTY control bits.
-
-       TRACE_ICALLS
-            trace internal/nested calls.
-
-       TRACE_CCALLS
-            trace per-character calls.
-
-       TRACE_DATABASE
-            trace read/write of terminfo/termcap data.
-
-       TRACE_ATTRS
-            trace changes to video attributes and colors.
-
-       TRACE_MAXIMUM
-            maximum trace level,  enables  all  of  the  separate
-            trace features.
-
-       Some  tracing  features are enabled whenever the trace pa-
-       rameter is nonzero.  Some features overlap.  The  specific
-       names are used as a guideline.
-
-       These  functions check the NCURSES_TRACE environment vari-
-       able, to set the tracing feature as if trace was called:
-              filter,  initscr,  new_prescr,  newterm,  nofilter,
-              ripoffline, setupterm, slk_init, tgetent
-
-
-
-
-

RETURN VALUE

-       Routines  which  return a value are designed to be used as
-       parameters to the _tracef routine.
-
-
-
-

PORTABILITY

-       These functions are not part of the XSI  interface.   Some
-       other  curses  implementations  are known to have similar,
-       undocumented features, but they are  not  compatible  with
-       ncurses.
-
-
-
-

SEE ALSO

-       curses(3x).
-
-
-
-                                                         curs_trace(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_util.3x.html b/doc/html/man/curs_util.3x.html deleted file mode 100644 index 8181efa432f..00000000000 --- a/doc/html/man/curs_util.3x.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - -curs_util 3x - - - - -

curs_util 3x

-
-
-
-curs_util(3x)                                             curs_util(3x)
-
-
-
-
-
-

NAME

-       delay_output, filter, flushinp, getwin, key_name, keyname,
-       nofilter, putwin, unctrl, use_env, wunctrl - miscellaneous
-       curses utility routines
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       char *unctrl(chtype c);
-       wchar_t *wunctrl(cchar_t *c);
-       char *keyname(int c);
-       char *key_name(wchar_t w);
-       void filter(void);
-       void nofilter(void);
-       void use_env(bool f);
-       int putwin(WINDOW *win, FILE *filep);
-       WINDOW *getwin(FILE *filep);
-       int delay_output(int ms);
-       int flushinp(void);
-
-
-
-

DESCRIPTION

-       The  unctrl  routine returns a character string which is a
-       printable representation of the character c, ignoring  at-
-       tributes.   Control characters are displayed in the ^X no-
-       tation.  Printing characters are  displayed  as  is.   The
-       corresponding  wunctrl  returns a printable representation
-       of a wide character.
-
-       The keyname routine returns a character string correspond-
-       ing to the key c:
-
-          o   Printable  characters  are displayed as themselves,
-              e.g., a one-character string containing the key.
-
-          o   Control characters are displayed in  the  ^X  nota-
-              tion.
-
-          o   DEL (character 127) is displayed as ^?.
-
-          o   Values above 128 are either meta characters (if the
-              screen has not been initialized,  or  if  meta  has
-              been  called  with  a TRUE parameter), shown in the
-              M-X notation, or are displayed as  themselves.   In
-              the  latter  case, the values may not be printable;
-              this follows the X/Open specification.
-
-          o   Values above 256 may be the names of the  names  of
-              function keys.
-
-          o   Otherwise  (if  there is no corresponding name) the
-              function returns null, to denote an error.   X/Open
-              also  lists  an  "UNKNOWN  KEY" return value, which
-              some implementations return rather than null.
-
-       The corresponding key_name returns a character string cor-
-       responding  to  the wide-character value w.  The two func-
-       tions do not return the same set of  strings;  the  latter
-       returns null where the former would display a meta charac-
-       ter.
-
-       The filter routine, if used, must be called before initscr
-       or  newterm  are called.  The effect is that, during those
-       calls, LINES is set to 1;  the  capabilities  clear,  cup,
-       cud,  cud1,  cuu1,  cuu,  vpa  are  disabled; and the home
-       string is set to the value of cr.
-
-       The nofilter routine cancels the  effect  of  a  preceding
-       filter  call.   That  allows  the  caller  to initialize a
-       screen on a different device, using a different  value  of
-       $TERM.   The  limitation arises because the filter routine
-       modifies the in-memory copy of the terminal information.
-
-       The use_env routine, if used, is called before initscr  or
-       newterm  are  called.   When called with FALSE as an argu-
-       ment, the values of lines and  columns  specified  in  the
-       terminfo  database will be used, even if environment vari-
-       ables LINES and COLUMNS (used by default) are set,  or  if
-       curses  is  running in a window (in which case default be-
-       havior would be to  use  the  window  size  if  LINES  and
-       COLUMNS  are not set).  Note that setting LINES or COLUMNS
-       overrides the corresponding size  which  may  be  obtained
-       from the operating system.
-
-       The  putwin routine writes all data associated with window
-       win into the file to which filep points.  This information
-       can be later retrieved using the getwin function.
-
-       The getwin routine reads window related data stored in the
-       file by putwin.  The routine then creates and  initializes
-       a new window using that data.  It returns a pointer to the
-       new window.
-
-       The delay_output routine inserts an ms  millisecond  pause
-       in  output.   This  routine should not be used extensively
-       because padding characters are  used  rather  than  a  CPU
-       pause.   If  no  padding character is specified, this uses
-       napms to perform the delay.
-
-       The flushinp routine throws away any  typeahead  that  has
-       been  typed  by  the user and has not yet been read by the
-       program.
-
-
-
-

RETURN VALUE

-       Except for flushinp, routines that return an  integer  re-
-       turn  ERR upon failure and OK (SVr4 specifies only "an in-
-       teger value other than ERR") upon successful completion.
-
-       Routines that return pointers return NULL on error.
-
-       X/Open does not define any error conditions.  In this  im-
-       plementation
-
-          flushinp
-               returns  an error if the terminal was not initial-
-               ized.
-
-          meta returns an error if the terminal was not  initial-
-               ized.
-
-          putwin
-               returns  an  error  if the associated fwrite calls
-               return an error.
-
-
-
-

PORTABILITY

-       The XSI Curses standard, Issue  4  describes  these  func-
-       tions.   It  states  that unctrl and wunctrl will return a
-       null pointer if unsuccessful, but does not define any  er-
-       ror conditions.  This implementation checks for three cas-
-       es:
-
-          o   the parameter is a 7-bit US-ASCII  code.   This  is
-              the case that X/Open Curses documented.
-
-          o   the  parameter  is in the range 128-159, i.e., a C1
-              control code.  If use_legacy_coding has been called
-              with  a  2 parameter, unctrl returns the parameter,
-              i.e., a one-character string with the parameter  as
-              the first character.  Otherwise, it returns ``~@'',
-              ``~A'', etc., analogous to ``^@'', ``^A'', C0  con-
-              trols.
-
-              X/Open  Curses does not document whether unctrl can
-              be called before initializing curses.  This  imple-
-              mentation  permits  that,  and  returns the ``~@'',
-              etc., values in that case.
-
-          o   parameter values outside the 0 to 255 range.   unc-
-              trl returns a null pointer.
-
-       The SVr4 documentation describes the action of filter only
-       in the vaguest terms.  The  description  here  is  adapted
-       from  the  XSI Curses standard (which erroneously fails to
-       describe the disabling of cuu).
-
-       The strings returned by unctrl in this implementation  are
-       determined  at  compile time, showing C1 controls from the
-       upper-128 codes with a `~' prefix rather than `^'.   Other
-       implementations  have different conventions.  For example,
-       they may show both sets of control  characters  with  `^',
-       and  strip the parameter to 7 bits.  Or they may ignore C1
-       controls and treat all of the upper-128  codes  as  print-
-       able.  This implementation uses 8 bits but does not modify
-       the string to reflect locale.  The use_legacy_coding func-
-       tion allows the caller to change the output of unctrl.
-
-       Likewise,  the  meta  function allows the caller to change
-       the output of keyname, i.e., it determines whether to  use
-       the  `M-' prefix for ``meta'' keys (codes in the range 128
-       to 255).  Both use_legacy_coding and meta succeed only af-
-       ter  curses  is initialized.  X/Open Curses does not docu-
-       ment the treatment of codes 128  to  159.   When  treating
-       them as ``meta'' keys (or if keyname is called before ini-
-       tializing curses),  this  implementation  returns  strings
-       ``M-^@'', ``M-^A'', etc.
-
-       The  keyname function may return the names of user-defined
-       string capabilities which are defined in the terminfo  en-
-       try  via  the -x option of tic.  This implementation auto-
-       matically assigns at  run-time  keycodes  to  user-defined
-       strings  which  begin  with  "k".   The  keycodes start at
-       KEY_MAX, but are not guaranteed to be the same  value  for
-       different  runs because user-defined codes are merged from
-       all terminal descriptions which  have  been  loaded.   The
-       use_extended_names  function controls whether this data is
-       loaded when the terminal description is read  by  the  li-
-       brary.
-
-       The  nofilter  routine is specific to ncurses.  It was not
-       supported on Version 7, BSD or System  V  implementations.
-       It  is  recommended that any code depending on ncurses ex-
-       tensions be conditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       legacy_coding(3x), curses(3x), curs_initscr(3x), curs_ker-
-       nel(3x),   curs_scr_dump(3x),   curs_variables(3x),  lega-
-       cy_coding(3x).
-
-
-
-                                                          curs_util(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_variables.3x.html b/doc/html/man/curs_variables.3x.html deleted file mode 100644 index 3cca3feef6a..00000000000 --- a/doc/html/man/curs_variables.3x.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - -curs_variables 3x - - - - -

curs_variables 3x

-
-
-
-curs_variables(3x)                                   curs_variables(3x)
-
-
-
-
-
-

NAME

-       COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES, TABSIZE,
-       curscr, newscr, stdscr - curses global variables
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int COLOR_PAIRS;
-       int COLORS;
-       int COLS;
-       int ESCDELAY;
-       int LINES;
-       int TABSIZE;
-       WINDOW * curscr;
-       WINDOW * newscr;
-       WINDOW * stdscr;
-
-
-
-

DESCRIPTION

-       This page summarizes variables provided by the curses  li-
-       brary.   A more complete description is given in the curs-
-       es(3x) manual page.
-
-       Depending on the configuration, these may be actual  vari-
-       ables,  or  macros  (see  curs_threads(3x))  which provide
-       read-only access to curses's state.  In either  case,  ap-
-       plications should treat them as read-only to avoid confus-
-       ing the library.
-
-   COLOR_PAIRS
-       After initializing curses, this variable contains the num-
-       ber of color pairs which the terminal can support.  Usual-
-       ly the number of color pairs  will  be  the  product  COL-
-       ORS*COLORS, however this is not always true:
-
-       o   a  few  terminals  use HLS colors, which do not follow
-           this rule
-
-       o   terminals supporting a large number of colors are lim-
-           ited  by  the number of color pairs that can be repre-
-           sented in a signed short value.
-
-   COLORS
-       After initializing curses, this variable contains the num-
-       ber of colors which the terminal can support.
-
-   COLS
-       After  initializing  curses,  this  variable  contains the
-       width of the screen, i.e., the number of columns.
-
-   ESCDELAY
-       This variable holds the number of milliseconds to wait af-
-       ter reading an escape character, to distinguish between an
-       individual escape character entered on the  keyboard  from
-       escape  sequences  sent  by cursor- and function-keys (see
-       curses(3x).
-
-   LINES
-       After initializing  curses,  this  variable  contains  the
-       height of the screen, i.e., the number of lines.
-
-   TABSIZE
-       This  variable  holds  the  number  of columns used by the
-       curses library when converting a tab character  to  spaces
-       as it adds the tab to a window (see curs_addch(3x).
-
-   The Current Screen
-       This implementation of curses uses a special window curscr
-       to record its updates to the terminal screen.
-
-   The New Screen
-       This implementation of curses uses a special window newscr
-       to  hold  updates  to  the terminal screen before applying
-       them to curscr.
-
-   The Standard Screen
-       Upon initializing curses, a default window called  stdscr,
-       which  is  the  size  of  the terminal screen, is created.
-       Many curses functions use this window.
-
-
-
-

NOTES

-       The   curses   library   is   initialized   using   either
-       initscr(3x), or newterm(3x).
-
-       If  curses  is  configured to use separate curses/terminfo
-       libraries, most of these variables reside  in  the  curses
-       library.
-
-
-
-

PORTABILITY

-       ESCDELAY  and TABSIZE are extensions, not provided in most
-       other implementations of curses.
-
-
-
-

SEE ALSO

-       curses(3x), curs_threads(3x), term_variables(3x),  termin-
-       fo(3x), terminfo(5).
-
-
-
-                                                     curs_variables(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/curs_window.3x.html b/doc/html/man/curs_window.3x.html deleted file mode 100644 index d3d4ef4ae6e..00000000000 --- a/doc/html/man/curs_window.3x.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - -curs_window 3x - - - - -

curs_window 3x

-
-
-
-curs_window(3x)                                         curs_window(3x)
-
-
-
-
-
-

NAME

-       newwin, delwin, mvwin, subwin, derwin, mvderwin, dupwin,
-       wsyncup, syncok, wcursyncup, wsyncdown - create curses
-       windows
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       WINDOW *newwin(int nlines, int ncols, int begin_y,
-             int begin_x);
-       int delwin(WINDOW *win);
-       int mvwin(WINDOW *win, int y, int x);
-       WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
-             int begin_y, int begin_x);
-       WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
-             int begin_y, int begin_x);
-       int mvderwin(WINDOW *win, int par_y, int par_x);
-       WINDOW *dupwin(WINDOW *win);
-       void wsyncup(WINDOW *win);
-       int syncok(WINDOW *win, bool bf);
-       void wcursyncup(WINDOW *win);
-       void wsyncdown(WINDOW *win);
-
-
-
-

DESCRIPTION

-       Calling newwin creates and returns a pointer to a new win-
-       dow with the given number of lines and columns.  The upper
-       left-hand  corner of the window is at line begin_y, column
-       begin_x.  If either nlines or ncols is zero, they  default
-       to  LINES - begin_y and COLS - begin_x.  A new full-screen
-       window is created by calling newwin(0,0,0,0).
-
-       Calling delwin deletes the named window, freeing all memo-
-       ry associated with it (it does not actually erase the win-
-       dow's screen image).  Subwindows must  be  deleted  before
-       the main window can be deleted.
-
-       Calling mvwin moves the window so that the upper left-hand
-       corner is at position (x, y).  If the move would cause the
-       window to be off the screen, it is an error and the window
-       is not moved.  Moving subwindows is allowed, but should be
-       avoided.
-
-       Calling subwin creates and returns a pointer to a new win-
-       dow with the given number of lines, nlines,  and  columns,
-       ncols.   The  window  is at position (begin_y, begin_x) on
-       the screen.  (This position is relative to the screen, and
-       not to the window orig.)  The window is made in the middle
-       of the window orig, so that changes  made  to  one  window
-       will  affect  both  windows.   The subwindow shares memory
-       with the window orig.  When using this routine, it is nec-
-       essary  to call touchwin or touchline on orig before call-
-       ing wrefresh on the subwindow.
-
-       Calling derwin is the same as calling subwin, except  that
-       begin_y and begin_x are relative to the origin of the win-
-       dow orig rather than the screen.  There is  no  difference
-       between the subwindows and the derived windows.
-
-       Calling mvderwin moves a derived window (or subwindow) in-
-       side its parent window.  The screen-relative parameters of
-       the  window are not changed.  This routine is used to dis-
-       play different parts of the  parent  window  at  the  same
-       physical position on the screen.
-
-       Calling  dupwin  creates  an exact duplicate of the window
-       win.
-
-       Calling wsyncup touches all locations in ancestors of  win
-       that  are changed in win.  If syncok is called with second
-       argument TRUE then wsyncup is called automatically whenev-
-       er there is a change in the window.
-
-       The  wsyncdown  routine  touches each location in win that
-       has been touched in any of  its  ancestor  windows.   This
-       routine  is  called by wrefresh, so it should almost never
-       be necessary to call it manually.
-
-       The routine wcursyncup updates the current cursor position
-       of  all the ancestors of the window to reflect the current
-       cursor position of the window.
-
-
-
-

RETURN VALUE

-       Routines that return an integer return the integer ERR up-
-       on  failure  and OK (SVr4 only specifies "an integer value
-       other than ERR") upon successful completion.
-
-       Routines that return pointers return NULL on error.
-
-       X/Open defines no error conditions.  In  this  implementa-
-       tion
-
-              delwin
-                   returns  an  error  if  the  window pointer is
-                   null, or if the window is the parent of anoth-
-                   er window.
-
-                   This  implementation  also maintains a list of
-                   windows, and checks that the pointer passed to
-                   delwin  is  one  that it created, returning an
-                   error if it was not..
-
-              mvderwin
-                   returns an error  if  the  window  pointer  is
-                   null,  or  if some part of the window would be
-                   placed off-screen.
-
-              mvwin
-                   returns an error  if  the  window  pointer  is
-                   null,  or if the window is really a pad, or if
-                   some part of the window would be  placed  off-
-                   screen.
-
-              syncok
-                   returns  an  error  if  the  window pointer is
-                   null.
-
-
-
-

NOTES

-       If many small changes are made to the window, the  wsyncup
-       option could degrade performance.
-
-       Note that syncok may be a macro.
-
-
-
-

BUGS

-       The  subwindow  functions (subwin, derwin, mvderwin, wsyn-
-       cup, wsyncdown, wcursyncup, syncok) are flaky, incomplete-
-       ly implemented, and not well tested.
-
-       The  System  V  curses documentation is very unclear about
-       what wsyncup and wsyncdown actually do.  It seems to imply
-       that  they  are only supposed to touch exactly those lines
-       that are affected by ancestor changes.  The language here,
-       and  the  behavior  of  the curses implementation, is pat-
-       terned on the XPG4 curses standard.  The weaker XPG4  spec
-       may result in slower updates.
-
-
-
-

PORTABILITY

-       The  XSI  Curses  standard,  Issue 4 describes these func-
-       tions.
-
-
-
-

SEE ALSO

-       curses(3x), curs_refresh(3x),  curs_touch(3x),  curs_vari-
-       ables(3x)
-
-
-
-                                                        curs_window(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/default_colors.3x.html b/doc/html/man/default_colors.3x.html deleted file mode 100644 index f0e44e2fc60..00000000000 --- a/doc/html/man/default_colors.3x.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - -default_colors 3x - - - - -

default_colors 3x

-
-
-
-default_colors(3x)                                   default_colors(3x)
-
-
-
-
-
-

NAME

-       use_default_colors, assume_default_colors - use terminal's
-       default colors
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int use_default_colors(void);
-       int assume_default_colors(int fg, int bg);
-
-
-
-

DESCRIPTION

-       The use_default_colors() and assume_default_colors() func-
-       tions are extensions to the curses library.  They are used
-       with terminals that support ISO 6429 color, or equivalent.
-       These terminals allow the application to reset color to an
-       unspecified default value (e.g., with SGR 39 or SGR 49).
-
-       Applications that paint  a  colored  background  over  the
-       whole  screen  do not take advantage of SGR 39 and SGR 49.
-       Some applications are designed to work  with  the  default
-       background,  using  colors  only  for  text.  For example,
-       there are several implementations of the ls program  which
-       use  colors to denote different file types or permissions.
-       These "color ls" programs do not  necessarily  modify  the
-       background  color, typically using only the setaf terminfo
-       capability  to  set  the  foreground  color.   Full-screen
-       applications  that  use default colors can achieve similar
-       visual effects.
-
-       The first function, use_default_colors() tells the  curses
-       library  to  assign terminal default foreground/background
-       colors to color number  -1.  So  init_pair(x,COLOR_RED,-1)
-       will  initialize  pair  x as red on default background and
-       init_pair(x,-1,COLOR_BLUE)  will  initialize  pair  x   as
-       default foreground on blue.
-
-       The  other,  assume_default_colors() is a refinement which
-       tells which colors to paint for color pair 0.  This  func-
-       tion  recognizes  a special color number -1, which denotes
-       the default terminal color.
-
-       The following are equivalent:
-              use_default_colors();
-              assume_default_colors(-1,-1);
-
-       These are ncurses extensions.  For other curses  implemen-
-       tations,  color  number -1 does not mean anything, just as
-       for ncurses before a successful call  of  use_default_col-
-       ors() or assume_default_colors().
-
-       Other  curses  implementations do not allow an application
-       to modify color pair 0.  They assume that  the  background
-       is COLOR_BLACK, but do not ensure that the color pair 0 is
-       painted to match the assumption.  If your application does
-       not use either use_default_colors() or assume_default_col-
-       ors() ncurses will paint a white  foreground  (text)  with
-       black background for color pair 0.
-
-
-
-

RETURN VALUE

-       These functions return the integer ERR upon failure and OK
-       on success.  They will fail if either  the  terminal  does
-       not  support  the orig_pair or orig_colors capability.  If
-       the initialize_pair capability is not found,  this  causes
-       an error as well.
-
-
-
-

NOTES

-       Associated  with  this  extension,  the init_pair function
-       accepts negative arguments to specify  default  foreground
-       or background colors.
-
-       The  use_default_colors()  function  was  added to support
-       ded.  This is a full-screen application which uses  curses
-       to  manage only part of the screen.  The bottom portion of
-       the screen, which is of adjustable size, is left uncolored
-       to  display the results from shell commands.  The top por-
-       tion of the screen colors filenames using  a  scheme  like
-       the  "color  ls" programs.  Attempting to manage the back-
-       ground color of the screen for this application would give
-       unsatisfactory  results  for  a  variety of reasons.  This
-       extension was devised after noting that color  xterm  (and
-       similar  programs)  provides a background color which does
-       not necessarily correspond to  any  of  the  ANSI  colors.
-       While  a special terminfo entry could be constructed using
-       nine colors, there was no mechanism provided within curses
-       to  account for the related orig_pair and back_color_erase
-       capabilities.
-
-       The assume_default_colors() function was added to solve  a
-       different  problem:  support  for applications which would
-       use  environment  variables  and  other  configuration  to
-       bypass  curses'  notion  of the terminal's default colors,
-       setting specific values.
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on them be  con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       curs_color(3x), ded(1).
-
-
-
-

AUTHOR

-       Thomas  Dickey  (from  an analysis of the requirements for
-       color xterm for XFree86 3.1.2C, February 1996).
-
-
-
-                                                     default_colors(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/define_key.3x.html b/doc/html/man/define_key.3x.html deleted file mode 100644 index 8556833bd01..00000000000 --- a/doc/html/man/define_key.3x.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - -define_key 3x - - - - -

define_key 3x

-
-
-
-define_key(3x)                                           define_key(3x)
-
-
-
-
-
-

NAME

-       define_key - define a keycode
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int define_key(const char *definition, int keycode);
-
-
-
-

DESCRIPTION

-       This is an extension to the curses library.  It permits an
-       application to define keycodes  with  their  corresponding
-       control  strings,  so that the ncurses library will inter-
-       pret them just as it would the  predefined  codes  in  the
-       terminfo database.
-
-       If  the  given string is null, any existing definition for
-       the keycode is removed.  Similarly, if the  given  keycode
-       is  negative  or  zero,  any existing string for the given
-       definition is removed.
-
-
-
-

RETURN VALUE

-       The keycode must be greater than zero, and the string non-
-       null, otherwise ERR is returned.  ERR may also be returned
-       if there is insufficient memory to allocate  the  data  to
-       store  the  definition.   If  no  error is detected, OK is
-       returned.
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on them be  con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       keyok(3x), key_defined(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey.
-
-
-
-                                                         define_key(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html deleted file mode 100644 index 86e3317cfc5..00000000000 --- a/doc/html/man/form.3x.html +++ /dev/null @@ -1,258 +0,0 @@ - - - - -form 3x - - - - -

form 3x

-
-
-
-form(3x)                                                       form(3x)
-
-
-
-
-
-

NAME

-       form - curses extension for programming forms
-
-
-
-

SYNOPSIS

-       #include <form.h>
-
-
-
-

DESCRIPTION

-       The  form library provides terminal-independent facilities
-       for composing form screens  on  character-cell  terminals.
-       The  library  includes:  field  routines, which create and
-       modify form fields; and form routines, which group  fields
-       into forms, display forms on the screen, and handle inter-
-       action with the user.
-
-       The form library uses the curses libraries.   To  use  the
-       form library, link with the options -lform -lcurses.
-
-       Your program should set up the locale, e.g.,
-
-            setlocale(LC_ALL, "");
-
-       so that input/output processing will work.
-
-       A  curses  initialization  routine such as initscr must be
-       called before using any of these functions.
-
-   Current Default Values for Field Attributes
-       The form library  maintains  a  default  value  for  field
-       attributes.   You  can  get or set this default by calling
-       the appropriate set_ or  retrieval  routine  with  a  NULL
-       field pointer.  Changing this default with a set_ function
-       affects future field creations, but does  not  change  the
-       rendering of fields already created.
-
-   Routine Name Index
-       The  following  table lists each form routine and the name
-       of the manual page on which it is described.
-
-       curses Routine Name    Manual Page Name
-       -------------------------------------------------
-       current_field          form_page(3x)
-       data_ahead             form_data(3x)
-       data_behind            form_data(3x)
-       dup_field              form_field_new(3x)
-       dynamic_field_info     form_field_info(3x)
-       field_arg              form_field_validation(3x)
-       field_back             form_field_attributes(3x)
-       field_buffer           form_field_buffer(3x)
-       field_count            form_field(3x)
-       field_fore             form_field_attributes(3x)
-       field_index            form_page(3x)
-       field_info             form_field_info(3x)
-       field_init             form_hook(3x)
-       field_just             form_field_just(3x)
-       field_opts             form_field_opts(3x)
-       field_opts_off         form_field_opts(3x)
-       field_opts_on          form_field_opts(3x)
-       field_pad              form_field_attributes(3x)
-       field_status           form_field_buffer(3x)
-       field_term             form_hook(3x)
-       field_type             form_field_validation(3x)
-
-       field_userptr          form_field_userptr(3x)
-       form_driver            form_driver(3x)
-       form_fields            form_field(3x)
-       form_init              form_hook(3x)
-       form_opts              form_opts(3x)
-       form_opts_off          form_opts(3x)
-       form_opts_on           form_opts(3x)
-       form_page              form_page(3x)
-       form_request_by_name   form_requestname(3x)
-       form_request_name      form_requestname(3x)
-       form_sub               form_win(3x)
-       form_term              form_hook(3x)
-       form_userptr           form_userptr(3x)
-       form_win               form_win(3x)
-       free_field             form_field_new(3x)
-       free_fieldtype         form_fieldtype(3x)
-       free_form              form_new(3x)
-       link_field             form_field_new(3x)
-       link_fieldtype         form_fieldtype(3x)
-       move_field             form_field(3x)
-       new_field              form_field_new(3x)
-       new_fieldtype          form_fieldtype(3x)
-       new_form               form_new(3x)
-       new_page               form_new_page(3x)
-       pos_form_cursor        form_cursor(3x)
-       post_form              form_post(3x)
-       scale_form             form_win(3x)
-       set_current_field      form_page(3x)
-       set_field_back         form_field_attributes(3x)
-       set_field_buffer       form_field_buffer(3x)
-       set_field_fore         form_field_attributes(3x)
-       set_field_init         form_hook(3x)
-       set_field_just         form_field_just(3x)
-       set_field_opts         form_field_opts(3x)
-       set_field_pad          form_field_attributes(3x)
-       set_field_status       form_field_buffer(3x)
-       set_field_term         form_hook(3x)
-       set_field_type         form_field_validation(3x)
-       set_field_userptr      form_field_userptr(3x)
-       set_fieldtype_arg      form_fieldtype(3x)
-       set_fieldtype_choice   form_fieldtype(3x)
-       set_form_fields        form_field(3x)
-       set_form_init          form_hook(3x)
-       set_form_opts          form_field_opts(3x)
-       set_form_page          form_page(3x)
-       set_form_sub           form_win(3x)
-       set_form_term          form_hook(3x)
-       set_form_userptr       form_userptr(3x)
-       set_form_win           form_win(3x)
-       set_max_field          form_field_buffer(3x)
-       set_new_page           form_new_page(3x)
-       unpost_form            form_post(3x)
-
-
-
-

RETURN VALUE

-       Routines that return pointers return NULL  on  error,  and
-       set  errno  to  the  corresponding  error-code returned by
-       functions returning an integer.  Routines that  return  an
-       integer return one of the following error codes:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_CONNECTED
-            The field is already connected to a form.
-
-       E_INVALID_FIELD
-            Contents of a field are not valid.
-
-       E_NOT_CONNECTED
-            No fields are connected to the form.
-
-       E_NOT_POSTED
-            The form has not been posted.
-
-       E_NO_ROOM
-            Form is too large for its window.
-
-       E_POSTED
-            The form is already posted.
-
-       E_REQUEST_DENIED
-            The form driver could not process the request.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_UNKNOWN_COMMAND
-            The form driver code saw an unknown request code.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "form_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       files <curses.h> and <eti.h>.
-
-       In  your  library  list,  libform.a should be before libn-
-       curses.a; that is, you want to say `-lform -lncurses', not
-       the  other  way  around (which would give you a link error
-       using most linkers).
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.  Manual pages and adaptation for ncurses
-       by Eric S. Raymond.
-
-
-
-

SEE ALSO

-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                               form(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_cursor.3x.html b/doc/html/man/form_cursor.3x.html deleted file mode 100644 index 04de65a5b47..00000000000 --- a/doc/html/man/form_cursor.3x.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - -form_cursor 3x - - - - -

form_cursor 3x

-
-
-
-form_cursor(3x)                                         form_cursor(3x)
-
-
-
-
-
-

NAME

-       form_cursor - position a form window cursor
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int pos_form_cursor(FORM *form);
-
-
-
-

DESCRIPTION

-       The  function  pos_form_cursor  restores the cursor to the
-       position required for the forms driver  to  continue  pro-
-       cessing  requests.   This  is useful after curses routines
-       have been called to do screen-painting in  response  to  a
-       form operation.
-
-
-
-

RETURN VALUE

-       This routine returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_NOT_POSTED
-            The form has not been posted.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate the System V forms library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                        form_cursor(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_data.3x.html b/doc/html/man/form_data.3x.html deleted file mode 100644 index f181a9a3716..00000000000 --- a/doc/html/man/form_data.3x.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - -form_data 3x - - - - -

form_data 3x

-
-
-
-form_data(3x)                                             form_data(3x)
-
-
-
-
-
-

NAME

-       form_data - test for off-screen data in given forms
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       bool data_ahead(const FORM *form);
-       bool data_behind(const FORM *form);
-
-
-
-

DESCRIPTION

-       The  function data_ahead tests whether there is off-screen
-       data ahead in the given form.   It  returns  TRUE  (1)  or
-       FALSE (0).
-
-       The function data_behind tests whether there is off-screen
-       data behind in the given form.  It  returns  TRUE  (1)  or
-       FALSE (0).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          form_data(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_driver.3x.html b/doc/html/man/form_driver.3x.html deleted file mode 100644 index ab9a263787d..00000000000 --- a/doc/html/man/form_driver.3x.html +++ /dev/null @@ -1,375 +0,0 @@ - - - - -form_driver 3x - - - - -

form_driver 3x

-
-
-
-form_driver(3x)                                         form_driver(3x)
-
-
-
-
-
-

NAME

-       form_driver - command-processing loop of the form system
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int form_driver(FORM *form, int c);
-
-
-
-

DESCRIPTION

-       Once a form has been posted (displayed), you should funnel
-       input events to it through form_driver.  This routine  has
-       three major input cases:
-
-       o   The  input  is  a form navigation request.  Navigation
-           request codes are constants defined in <form.h>, which
-           are   distinct  from  the  key-  and  character  codes
-           returned by wgetch.
-
-       o   The input is a printable character.  Printable charac-
-           ters  (which  must  be  positive,  less  than 256) are
-           checked according to the program's locale settings.
-
-       o   The input is the KEY_MOUSE special key associated with
-           an mouse event.
-
-       The form driver requests are as follows:
-
-       REQ_NEXT_PAGE
-            Move to the next page.
-
-       REQ_PREV_PAGE
-            Move to the previous page.
-
-       REQ_FIRST_PAGE
-            Move to the first page.
-
-       REQ_LAST_PAGE
-            Move to the last field.
-
-
-       REQ_NEXT_FIELD
-            Move to the next field.
-
-       REQ_PREV_FIELD
-            Move to the previous field.
-
-       REQ_FIRST_FIELD
-            Move to the first field.
-
-       REQ_LAST_FIELD
-            Move to the last field.
-
-       REQ_SNEXT_FIELD
-            Move to the sorted next field.
-
-       REQ_SPREV_FIELD
-            Move to the sorted previous field.
-
-       REQ_SFIRST_FIELD
-            Move to the sorted first field.
-
-       REQ_SLAST_FIELD
-            Move to the sorted last field.
-
-       REQ_LEFT_FIELD
-            Move left to a field.
-
-       REQ_RIGHT_FIELD
-            Move right to a field.
-
-       REQ_UP_FIELD
-            Move up to a field.
-
-       REQ_DOWN_FIELD
-            Move down to a field.
-
-
-       REQ_NEXT_CHAR
-            Move to the next char.
-
-       REQ_PREV_CHAR
-            Move to the previous char.
-
-       REQ_NEXT_LINE
-            Move to the next line.
-
-       REQ_PREV_LINE
-            Move to the previous line.
-
-       REQ_NEXT_WORD
-            Move to the next word.
-
-       REQ_PREV_WORD
-            Move to the previous word.
-
-       REQ_BEG_FIELD
-            Move to the beginning of the field.
-
-       REQ_END_FIELD
-            Move to the end of the field.
-
-       REQ_BEG_LINE
-            Move to the beginning of the line.
-
-       REQ_END_LINE
-            Move to the end of the line.
-
-       REQ_LEFT_CHAR
-            Move left in the field.
-
-       REQ_RIGHT_CHAR
-            Move right in the field.
-
-       REQ_UP_CHAR
-            Move up in the field.
-
-       REQ_DOWN_CHAR
-            Move down in the field.
-
-
-       REQ_NEW_LINE
-            Insert or overlay a new line.
-
-       REQ_INS_CHAR
-            Insert a blank at the cursor.
-
-       REQ_INS_LINE
-            Insert a blank line at the cursor.
-
-       REQ_DEL_CHAR
-            Delete character at the cursor.
-
-       REQ_DEL_PREV
-            Delete character before the cursor.
-
-       REQ_DEL_LINE
-            Delete line at the cursor.
-
-       REQ_DEL_WORD
-            Delete blank-delimited word at the cursor.
-
-       REQ_CLR_EOL
-            Clear to end of line from cursor.
-
-       REQ_CLR_EOF
-            Clear to end of field from cursor.
-
-       REQ_CLR_FIELD
-            Clear the entire field.
-
-       REQ_OVL_MODE
-            Enter overlay mode.
-
-       REQ_INS_MODE
-            Enter insert mode.
-
-
-       REQ_SCR_FLINE
-            Scroll the field forward a line.
-
-       REQ_SCR_BLINE
-            Scroll the field backward a line.
-
-       REQ_SCR_FPAGE
-            Scroll the field forward a page.
-
-       REQ_SCR_BPAGE
-            Scroll the field backward a page.
-
-       REQ_SCR_FHPAGE
-            Scroll the field forward half a page.
-
-       REQ_SCR_BHPAGE
-            Scroll the field backward half a page.
-
-
-       REQ_SCR_FCHAR
-            Scroll the field forward a character.
-
-       REQ_SCR_BCHAR
-            Scroll the field backward a character.
-
-       REQ_SCR_HFLINE
-            Horizontal scroll the field forward a line.
-
-       REQ_SCR_HBLINE
-            Horizontal scroll the field backward a line.
-
-       REQ_SCR_HFHALF
-            Horizontal scroll the field forward half a line.
-
-       REQ_SCR_HBHALF
-            Horizontal scroll the field backward half a line.
-
-
-       REQ_VALIDATION
-            Validate field.
-
-       REQ_NEXT_CHOICE
-            Display next field choice.
-
-       REQ_PREV_CHOICE
-            Display previous field choice.
-
-       If  the  second  argument  is  a  printable character, the
-       driver places it in the current position  in  the  current
-       field.   If  it is one of the forms requests listed above,
-       that request is executed.
-
-   MOUSE HANDLING
-       If the second argument is the KEY_MOUSE special  key,  the
-       associated mouse event is translated into one of the above
-       pre-defined requests.  Currently only clicks in  the  user
-       window  (e.g., inside the form display area or the decora-
-       tion window) are handled.
-
-       If you click above the display region of the form:
-
-          a REQ_PREV_FIELD is generated for a single click,
-
-          a REQ_PREV_PAGE is generated for a double-click and
-
-          a REQ_FIRST_FIELD is generated for a triple-click.
-
-       If you click below the display region of the form:
-
-          a REQ_NEXT_FIELD is generated for a single click,
-
-          a REQ_NEXT_PAGE is generated for a double-click and
-
-          a REQ_LAST_FIELD is generated for a triple-click.
-
-       If you click at an field inside the display  area  of  the
-       form:
-
-          o   the form cursor is positioned to that field.
-
-          o   If  you  double-click  a  field, the form cursor is
-              positioned to that field and  E_UNKNOWN_COMMAND  is
-              returned.  This return value makes sense, because a
-              double click usually means that  an  field-specific
-              action  should be returned.  It is exactly the pur-
-              pose of this return value to signal that an  appli-
-              cation specific command should be executed.
-
-          o   If   a   translation   into  a  request  was  done,
-              form_driver returns the result of this request.
-
-       If you clicked outside the user window or the mouse  event
-       could   not   be   translated   into  a  form  request  an
-       E_REQUEST_DENIED is returned.
-
-   APPLICATION-DEFINED COMMANDS
-       If the second argument is neither printable nor one of the
-       above  pre-defined form requests, the driver assumes it is
-       an application-specific command and returns E_UNKNOWN_COM-
-       MAND.  Application-defined commands should be defined rel-
-       ative to MAX_COMMAND, the  maximum  value  of  these  pre-
-       defined requests.
-
-
-
-

RETURN VALUE

-       form_driver returns one of the following error codes:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NOT_POSTED
-            The form has not been posted.
-
-       E_INVALID_FIELD
-            Contents of field is invalid.
-
-       E_REQUEST_DENIED
-            The form driver could not process the request.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_UNKNOWN_COMMAND
-            The form driver code saw an unknown request code.
-
-
-
-

SEE ALSO

-       curses(3x), form(3x), form_variables(3x), getch(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       files <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                        form_driver(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field.3x.html b/doc/html/man/form_field.3x.html deleted file mode 100644 index 0e7f8214088..00000000000 --- a/doc/html/man/form_field.3x.html +++ /dev/null @@ -1,142 +0,0 @@ - - - - -form_field 3x - - - - -

form_field 3x

-
-
-
-form_field(3x)                                           form_field(3x)
-
-
-
-
-
-

NAME

-       form_field - make and break connections between fields and
-       forms
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_form_fields(FORM *form, FIELD **fields);
-       FIELD **form_fields(const FORM *form);
-       int field_count(const FORM *form);
-       int move_field(FIELD *field, int frow, int fcol);
-
-
-
-

DESCRIPTION

-       The function set_form_fields  changes  the  field  pointer
-       array  of the given form.  The array must be terminated by
-       a NULL.
-
-       The function form_fields returns the field  array  of  the
-       given form.
-
-       The  function  field_count  returns the count of fields in
-       form.
-
-       The function move_field moves the given field (which  must
-       be disconnected) to a specified location on the screen.
-
-
-
-

RETURN VALUES

-       The  function  form_fields returns a pointer (which may be
-       NULL).  It does not set errno.
-
-       The function field_count returns ERR if the form parameter
-       is NULL.
-
-       The functions set_form_fields and move_field return one of
-       the following codes on error:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_CONNECTED
-            The field is already connected to a form.
-
-       E_POSTED
-            The form is already posted.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       The   SVr4   forms  library  documentation  specifies  the
-       field_count error value as -1 (which is the value of ERR).
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                         form_field(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_attributes.3x.html b/doc/html/man/form_field_attributes.3x.html deleted file mode 100644 index 36b93e5d8a0..00000000000 --- a/doc/html/man/form_field_attributes.3x.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - -form_field_attributes 3x - - - - -

form_field_attributes 3x

-
-
-
-form_field_attributes(3x)                     form_field_attributes(3x)
-
-
-
-
-
-

NAME

-       form_field_attributes  -  color  and attribute control for
-       form fields
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_field_fore(FIELD *field, chtype attr);
-       chtype field_fore(const FIELD *field);
-       int set_field_back(FIELD *field, chtype attr);
-       chtype field_back(const FIELD *field);
-       int set_field_pad(FIELD *field, int pad);
-       int field_pad(const FIELD *field);
-
-
-
-

DESCRIPTION

-       The function set_field_fore sets the foreground  attribute
-       of  field. This is the highlight used to display the field
-       contents.  The function field_fore returns the  foreground
-       attribute.  The default is A_STANDOUT.
-
-       The  function set_field_back sets the background attribute
-       of form. This is the highlight used to display the  extent
-       fields  in  the form.  The function field_back returns the
-       background attribute.  The default is A_NORMAL.
-
-       The function set_field_pad sets the character used to fill
-       the  field.   The  function  field_pad  returns  the given
-       form's pad character.  The default is a blank.
-
-
-
-

RETURN VALUE

-       These routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "form_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate the System V forms library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                              form_field_attributes(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_buffer.3x.html b/doc/html/man/form_field_buffer.3x.html deleted file mode 100644 index fe6b531f44d..00000000000 --- a/doc/html/man/form_field_buffer.3x.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - -form_field_buffer 3x - - - - -

form_field_buffer 3x

-
-
-
-form_field_buffer(3x)                             form_field_buffer(3x)
-
-
-
-
-
-

NAME

-       form_field_buffer - field buffer control
-
-
-
-

SYNOPSIS

-       #include <form.h>
-
-       int  set_field_buffer(FIELD  *field,  int  buf, const char
-       *value);
-       char *field_buffer(const FIELD *field, int buffer);
-       int set_field_status(FIELD *field, bool status);
-       bool field_status(const FIELD *field);
-       int set_max_field(FIELD *field, int max);
-
-
-
-

DESCRIPTION

-       The function set_field_buffer sets the numbered buffer  of
-       the given field to contain a given string:
-
-          o   Buffer 0 is the displayed value of the field.
-
-          o   Other numbered buffers may be allocated by applica-
-              tions   through   the   nbuf   argument   of   (see
-              form_field_new(3x))  but are not manipulated by the
-              forms library.
-
-       The function field_buffer returns a pointer  to  the  con-
-       tents of the given numbered buffer:
-
-          o   The  buffer  contents  always have the same length,
-              and are padded with trailing spaces  as  needed  to
-              ensure this length is the same.
-
-          o   The buffer may contain leading spaces, depending on
-              how it was set.
-
-          o   The buffer contents are set with  set_field_buffer,
-              or  as  a  side effect of any editing operations on
-              the corresponding field.
-
-          o   Editing operations are based on  the  window  which
-              displays the field, rather than a string.  The win-
-              dow contains  only  printable  characters,  and  is
-              filled  with blanks.  If you want the raw data, you
-              must write your own routine that copies  the  value
-              out  of  the  buffer  and  removes  the leading and
-              trailing spaces.
-
-          o   Because editing operations change  the  content  of
-              the  buffer to correspond to the window, you should
-              not rely on using buffers for long-term storage  of
-              form data.
-
-       The  function  set_field_status sets the associated status
-       flag of field; field_status gets the current  value.   The
-       status  flag  is set to a nonzero value whenever the field
-       changes.
-
-       The function set_max_field sets the  maximum  size  for  a
-       dynamic  field.   An  argument  of 0 turns off any maximum
-       size threshold for that field.
-
-
-
-

RETURN VALUE

-       The field_buffer function returns NULL on error.  It  sets
-       errno according to their success:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       The field_status function returns TRUE or FALSE.
-
-       The remaining routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "form_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file
-
-       When  configured for wide characters, field_buffer returns
-       a pointer to temporary storage (allocated and freed by the
-       library).   The  application  should not attempt to modify
-       the  data.   It  will  be  freed  on  the  next  call   to
-       field_buffer to return the same buffer.  <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate the System V forms library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                  form_field_buffer(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_info.3x.html b/doc/html/man/form_field_info.3x.html deleted file mode 100644 index eec55563190..00000000000 --- a/doc/html/man/form_field_info.3x.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -form_field_info 3x - - - - -

form_field_info 3x

-
-
-
-form_field_info(3x)                                 form_field_info(3x)
-
-
-
-
-
-

NAME

-       form_field_info - retrieve field characteristics
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int field_info(const FIELD *field, int *rows, int *cols,
-                     int *frow, int *fcol, int *nrow, int *nbuf);
-       int  dynamic_field_info(const FIELD *field, int *rows, int
-       *cols, int *max);
-
-
-
-

DESCRIPTION

-       The  function  field_info  returns  the  sizes  and  other
-       attributes  passed  in  to the field at its creation time.
-       The attributes are: height, width, row of upper-left  cor-
-       ner,  column of upper-left corner, number off-screen rows,
-       and number of working buffers.
-
-       The function dynamic_field_info returns the actual size of
-       the  field,  and  its maximum possible size.  If the field
-       has no size limit, the location  addressed  by  the  third
-       argument will be set to 0.  A field can be made dynamic by
-       turning off the O_STATIC option with field_opts_off.
-
-
-
-

RETURN VALUE

-       These routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "form_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate the System V forms library.  They
-       were not supported on Version 7 or BSD versions.
-
-       A null (zero pointer) is accepted for any  of  the  return
-       values,  to  ignore  that  value.  Not all implementations
-       allow this, e.g., Solaris 2.7 does not.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                    form_field_info(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_just.3x.html b/doc/html/man/form_field_just.3x.html deleted file mode 100644 index 62dab7569dc..00000000000 --- a/doc/html/man/form_field_just.3x.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - -form_field_just 3x - - - - -

form_field_just 3x

-
-
-
-form_field_just(3x)                                 form_field_just(3x)
-
-
-
-
-
-

NAME

-       form_field_just - retrieve field characteristics
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_field_just(FIELD *field, int justification);
-       int field_just(const FIELD *field);
-
-
-
-

DESCRIPTION

-       The   function   set_field_just   sets  the  justification
-       attribute of a field; field_just returns a field's  justi-
-       fication attribute.  The attribute may be one of NO_JUSTI-
-       FICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
-
-
-
-

RETURN VALUE

-       The function field_just returns one of:  NO_JUSTIFICATION,
-       JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
-
-       The function set_field_just returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "form_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                    form_field_just(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_new.3x.html b/doc/html/man/form_field_new.3x.html deleted file mode 100644 index 66b8d80669a..00000000000 --- a/doc/html/man/form_field_new.3x.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - -form_field_new 3x - - - - -

form_field_new 3x

-
-
-
-form_field_new(3x)                                   form_field_new(3x)
-
-
-
-
-
-

NAME

-       form_field_new - create and destroy form fields
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       FIELD *new_field(int height, int width,
-                        int toprow, int leftcol,
-                        int offscreen, int nbuffers);
-       FIELD *dup_field(FIELD *field, int toprow, int leftcol);
-       FIELD *link_field(FIELD *field, int toprow, int leftcol);
-       int free_field(FIELD *field);
-
-
-
-

DESCRIPTION

-       The  function new_field allocates a new field and initial-
-       izes it from the parameters given: height, width,  row  of
-       upper-left  corner,  column  of  upper-left corner, number
-       off-screen rows, and number of additional working buffers.
-
-       The function dup_field duplicates a field at a  new  loca-
-       tion.   Most attributes (including current contents, size,
-       validation type, buffer count, growth threshold,  justifi-
-       cation,  foreground,  background,  pad character, options,
-       and user pointer) are copied.  Field status and the  field
-       page bit are not copied.
-
-       The  function  link_field acts like dup_field, but the new
-       field shares buffers with its parent.  Attribute  data  is
-       separate.
-
-       The  function  free_field  de-allocates storage associated
-       with a field.
-
-
-
-

RETURN VALUE

-       The function, new_field, dup_field, link_field return NULL
-       on error.  They set errno according to their success:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_SYSTEM_ERROR
-            System error occurred, e.g., malloc failure.
-
-       The function free_field returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_CONNECTED
-            field is connected.
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       It  may be unwise to count on the set of attributes copied
-       by dup_field being portable; the System  V  forms  library
-       documents are not very explicit about what gets copied and
-       what does not.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                     form_field_new(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_opts.3x.html b/doc/html/man/form_field_opts.3x.html deleted file mode 100644 index 5463815aa61..00000000000 --- a/doc/html/man/form_field_opts.3x.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - -form_field_opts 3x - - - - -

form_field_opts 3x

-
-
-
-form_field_opts(3x)                                 form_field_opts(3x)
-
-
-
-
-
-

NAME

-       form_field_opts - set and get field options
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_field_opts(FIELD *field, Field_Options opts);
-       int field_opts_on(FIELD *field, Field_Options opts);
-       int field_opts_off(FIELD *field, Field_Options opts);
-       Field_Options field_opts(const FIELD *field);
-
-
-
-

DESCRIPTION

-       The  function  set_field_opts  sets  all the given field's
-       option bits (field  option  bits  may  be  logically-OR'ed
-       together).
-
-       The function field_opts_on turns on the given option bits,
-       and leaves others alone.
-
-       The function field_opts_off turns  off  the  given  option
-       bits, and leaves others alone.
-
-       The function field_opts returns the field's current option
-       bits.
-
-       The following options are defined (all are on by default):
-
-       O_VISIBLE
-            The field is displayed.  If this option is off,  dis-
-            play of the field is suppressed.
-
-       O_ACTIVE
-            The  field  is  visited  during  processing.  If this
-            option is off, the field will  not  be  reachable  by
-            navigation  keys.  Please  notice  that  an invisible
-            field appears to be inactive also.
-
-       O_PUBLIC
-            The field contents are displayed as data is entered.
-
-       O_EDIT
-            The field can be edited.
-
-       O_WRAP
-            Words that do not fit on a line are  wrapped  to  the
-            next line.  Words are blank-separated.
-
-       O_BLANK
-            The  field is cleared whenever a character is entered
-            at the first position.
-
-       O_AUTOSKIP
-            Skip to the next field when this one fills.
-
-       O_NULLOK
-            Allow a blank field.
-
-       O_STATIC
-            Field buffers are fixed  to  field's  original  size.
-            Turn this option off to create a dynamic field.
-
-       O_PASSOK
-            Validate field only if modified by user.
-
-
-
-

RETURN VALUE

-       Except  for  field_opts,  each  routine returns one of the
-       following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_CURRENT
-            The field is the current field.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                    form_field_opts(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_userptr.3x.html b/doc/html/man/form_field_userptr.3x.html deleted file mode 100644 index 787e672f0a3..00000000000 --- a/doc/html/man/form_field_userptr.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -form_field_userptr 3x - - - - -

form_field_userptr 3x

-
-
-
-form_field_userptr(3x)                           form_field_userptr(3x)
-
-
-
-
-
-

NAME

-       form_field_userptr  -  associate  application  data with a
-       form field
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_field_userptr(FIELD *field, void*userptr);
-       void *field_userptr(const FIELD *field);
-
-
-
-

DESCRIPTION

-       Every form field has a field that  can  be  used  to  hold
-       application-specific  data  (that is, the form-driver code
-       leaves it alone).  These functions get and set that field.
-
-
-
-

RETURN VALUE

-       The function field_userptr returns a pointer (which may be
-       NULL).  It does not set errno.
-
-       The function set_field_userptr returns E_OK (success).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       The user pointer is a void pointer.  We chose not to leave
-       it as a char pointer for SVr4 compatibility.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                 form_field_userptr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_field_validation.3x.html b/doc/html/man/form_field_validation.3x.html deleted file mode 100644 index e810402edcf..00000000000 --- a/doc/html/man/form_field_validation.3x.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - -form_field_validation 3x - - - - -

form_field_validation 3x

-
-
-
-form_field_validation(3x)                     form_field_validation(3x)
-
-
-
-
-
-

NAME

-       form_field_validation - data type validation for fields
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_field_type(FIELD *field, FIELDTYPE *type, ...);
-       FIELDTYPE *field_type(const FIELD *field);
-       void *field_arg(const FIELD *field);
-
-       FIELDTYPE *TYPE_ALNUM;
-       FIELDTYPE *TYPE_ALPHA;
-       FIELDTYPE *TYPE_ENUM;
-       FIELDTYPE *TYPE_INTEGER;
-       FIELDTYPE *TYPE_NUMERIC;
-       FIELDTYPE *TYPE_REGEXP;
-       FIELDTYPE *TYPE_IPV4;
-
-
-
-

DESCRIPTION

-       The  function  set_field_type  declares  a data type for a
-       given form field.  This is the type checked by  validation
-       functions.  The predefined types are as follows:
-
-       TYPE_ALNUM
-            Alphanumeric  data.  Requires a third int argument, a
-            minimum field width.
-
-       TYPE_ALPHA
-            Character data.  Requires a  third  int  argument,  a
-            minimum field width.
-
-       TYPE_ENUM
-            Accept one of a specified set of strings.  Requires a
-            third (char **) argument pointing to a string list; a
-            fourth  int flag argument to enable case-sensitivity;
-            and a fifth int flag argument  specifying  whether  a
-            partial  match  must be a unique one (if this flag is
-            off, a prefix matches the first of any  set  of  more
-            than  one  list  elements  with  that prefix). Please
-            notice that the string list is copied. So you may use
-            a  list  that  lives  in  automatic  variables on the
-            stack.
-
-       TYPE_INTEGER
-            Integer data, parsable  to  an  integer  by  atoi(3).
-            Requires  a third int argument controlling the preci-
-            sion, a fourth  long  argument  constraining  minimum
-            value,  and  a fifth long constraining maximum value.
-            If the maximum value is less than  or  equal  to  the
-            minimum value, the range is simply ignored. On return
-            the field buffer is formatted according to the printf
-            format   specification   ".*ld",  where  the  '*'  is
-            replaced by the precision argument.  For  details  of
-            the precision handling see printf's man-page.
-
-       TYPE_NUMERIC
-            Numeric   data   (may  have  a  decimal-point  part).
-            Requires a third int argument controlling the  preci-
-            sion,  a  fourth double argument constraining minimum
-            value, and a fifth double constraining maximum value.
-            If  your  system  supports locales, the decimal point
-            character to be used must be  the  one  specified  by
-            your  locale.   If  the maximum value is less than or
-            equal to the  minimum  value,  the  range  is  simply
-            ignored.  On  return  the  field  buffer is formatted
-            according to the printf format  specification  ".*f",
-            where  the '*' is replaced by the precision argument.
-            For details of the precision  handling  see  printf's
-            man-page.
-
-       TYPE_REGEXP
-            Regular  expression data.  Requires a regular expres-
-            sion (char *) third argument; the data  is  valid  if
-            the  regular  expression matches it.  Regular expres-
-            sions are in  the  format  of  regcomp  and  regexec.
-            Please  notice that the regular expression must match
-            the whole field. If you have  for  example  an  eight
-            character wide field, a regular expression "^[0-9]*$"
-            always means that you have to fill  all  eight  posi-
-            tions with digits. If you want to allow fewer digits,
-            you may use for example "^[0-9]* *$"  which  is  good
-            for  trailing  spaces  (up  to an empty field), or "^
-            *[0-9]* *$" which is good for  leading  and  trailing
-            spaces around the digits.
-
-       TYPE_IPV4
-            An Internet Protocol Version 4 address. This requires
-            no additional argument. It is checked whether or  not
-            the  buffer  has  the form a.b.c.d, where a,b,c and d
-            are numbers between 0 and 255. Trailing blanks in the
-            buffer  are  ignored. The address itself is not vali-
-            dated. Please note that this is an ncurses extension.
-            This  field type may not be available in other curses
-            implementations.
-
-       It is possible to  set  up  new  programmer-defined  field
-       types.  See the form_fieldtype(3x) manual page.
-
-
-
-

RETURN VALUE

-       The  functions  field_type  and  field_arg  return NULL on
-       error. The function set_field_type returns one of the fol-
-       lowing:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x), form_variables(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                              form_field_validation(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_fieldtype.3x.html b/doc/html/man/form_fieldtype.3x.html deleted file mode 100644 index 7f195ee37a8..00000000000 --- a/doc/html/man/form_fieldtype.3x.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - -form_fieldtype 3x - - - - -

form_fieldtype 3x

-
-
-
-form_fieldtype(3x)                                   form_fieldtype(3x)
-
-
-
-
-
-

NAME

-       form_fieldtype - define validation-field types
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       FIELDTYPE *new_fieldtype(
-           bool (* const field_check)(FIELD *, const void *),
-           bool (* const char_check)(int, const void *));
-       int free_fieldtype(FIELDTYPE *fieldtype);
-       int set_fieldtype_arg(
-           FIELDTYPE *fieldtype,
-           void *(* const make_arg)(va_list *),
-           void *(* const copy_arg)(const void *),
-           void  (* const free_arg)(void *));
-       int set_fieldtype_choice(
-           FIELDTYPE *fieldtype,
-           bool (* const next_choice)(FIELD *, const void *),
-           bool (* const prev_choice)(FIELD *, const void *));
-       FIELDTYPE *link_fieldtype(FIELDTYPE *type1,
-                                 FIELDTYPE *type2);
-
-
-
-

DESCRIPTION

-       The function new_fieldtype creates a new field type usable
-       for data validation.  You supply it  with  field_check,  a
-       predicate  to check the validity of an entered data string
-       whenever the user attempts to leave a field.   The  (FIELD
-       *)  argument  is passed in so the validation predicate can
-       see the field's buffer, sizes and  other  attributes;  the
-       second  argument  is  an  argument-block  structure, about
-       which more below.
-
-       You also supply new_fieldtype with char_check, a  function
-       to  validate input characters as they are entered; it will
-       be passed the character to be checked and a pointer to  an
-       argument-block structure.
-
-       The  function free_fieldtype frees the space allocated for
-       a given validation type.
-
-       The function set_fieldtype_arg associates  three  storage-
-       management  functions  with  a  field  type.  The make_arg
-       function is automatically applied to the list of arguments
-       you  give  set_field_type  when  attaching validation to a
-       field; its job is to bundle these into an allocated  argu-
-       ment-block  object which can later be passed to validation
-       predicated.  The other two hook arguments should copy  and
-       free  argument-block structures.  They will be used by the
-       forms-driver code.  You must supply the make_arg function,
-       the  other two are optional, you may supply NULL for them.
-       In this case it is assumed that make_arg does not allocate
-       memory  but simply loads the argument into a single scalar
-       value.
-
-       The function link_fieldtype creates a new field type  from
-       the  two  given  types.   They are connected by an logical
-       'OR'.
-
-       The   form    driver    requests    REQ_NEXT_CHOICE    and
-       REQ_PREV_CHOICE assume that the possible values of a field
-       form an ordered set, and provide the forms user with a way
-       to  move  through the set.  The set_fieldtype_choice func-
-       tion allows forms  programmers  to  define  successor  and
-       predecessor functions for the field type.  These functions
-       take the field pointer and an argument-block structure  as
-       arguments.
-
-
-
-

RETURN VALUE

-       The  pointer-valued  routines  return NULL on error.  They
-       set errno according to their success:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_SYSTEM_ERROR
-            System error occurred, e.g., malloc failure.
-
-       The  integer-valued  routines  return one of the following
-       codes on error:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_CONNECTED
-            The field is already connected to a form.
-
-       E_CURRENT
-            The field is the current field.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-       All of the (char *) arguments of  these  functions  should
-       actually  be (void *).  The type has been left uncorrected
-       for strict compatibility with System V.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                     form_fieldtype(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_hook.3x.html b/doc/html/man/form_hook.3x.html deleted file mode 100644 index 369c164b996..00000000000 --- a/doc/html/man/form_hook.3x.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - -form_hook 3x - - - - -

form_hook 3x

-
-
-
-form_hook(3x)                                             form_hook(3x)
-
-
-
-
-
-

NAME

-       form_hook - set hooks for automatic invocation by applica-
-       tions
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_field_init(FORM *form, Form_Hook func);
-       Form_Hook field_init(const FORM *form);
-       int set_field_term(FORM *form, Form_Hook func);
-       Form_Hook field_term(const FORM *form);
-       int set_form_init(FORM *form, Form_Hook func);
-       Form_Hook form_init(const FORM *form);
-       int set_form_term(FORM *form, Form_Hook func);
-       Form_Hook form_term(const FORM *form);
-
-
-
-

DESCRIPTION

-       These functions make it possible to set hook functions  to
-       be called at various points in the automatic processing of
-       input event codes by form_driver.
-
-       The function set_field_init sets a hook to  be  called  at
-       form-post  time  and  each time the selected field changes
-       (after the change).  field_init returns the current  field
-       init hook, if any (NULL if there is no such hook).
-
-       The  function  set_field_term  sets a hook to be called at
-       form-unpost time and each time the selected field  changes
-       (before the change).  field_term returns the current field
-       term hook, if any (NULL if there is no such hook).
-
-       The function set_form_init sets a hook  to  be  called  at
-       form-post  time  and  just  after a page change once it is
-       posted.  form_init returns the current form init hook,  if
-       any (NULL if there is no such hook).
-
-       The  function  set_form_term  sets  a hook to be called at
-       form-unpost time and just before a page change once it  is
-       posted.   form_init returns the current form term hook, if
-       any (NULL if there is no such hook).
-
-
-
-

RETURN VALUE

-       Routines that return pointers return NULL on error.  Other
-       routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          form_hook(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_new.3x.html b/doc/html/man/form_new.3x.html deleted file mode 100644 index d73547a5f06..00000000000 --- a/doc/html/man/form_new.3x.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - -form_new 3x - - - - -

form_new 3x

-
-
-
-form_new(3x)                                               form_new(3x)
-
-
-
-
-
-

NAME

-       form_new - create and destroy forms
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       FORM *new_form(FIELD **fields);
-       int free_form(FORM *form);
-
-
-
-

DESCRIPTION

-       The  function  new_form  creates a new form connected to a
-       specified field pointer array (which must  be  NULL-termi-
-       nated).
-
-       The  function  free_form  disconnects  form from its field
-       array and frees the storage allocated for the form.
-
-
-
-

RETURN VALUE

-       The function new_form returns  NULL  on  error.   It  sets
-       errno according to the function's success:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_CONNECTED
-            The field is already connected to a form.
-
-       E_SYSTEM_ERROR
-            System error occurred, e.g., malloc failure.
-
-       The function free_form returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_POSTED
-            The form has already been posted.
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                           form_new(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_new_page.3x.html b/doc/html/man/form_new_page.3x.html deleted file mode 100644 index be9d1154cee..00000000000 --- a/doc/html/man/form_new_page.3x.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - -form_new_page 3x - - - - -

form_new_page 3x

-
-
-
-form_new_page(3x)                                     form_new_page(3x)
-
-
-
-
-
-

NAME

-       form_new_page - form pagination functions
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_new_page(FIELD *field, bool new_page_flag);
-       bool new_page(const FIELD *field);
-
-
-
-

DESCRIPTION

-       The  function  set_new_page  sets or resets a flag marking
-       the given field as the beginning of  a  new  page  on  its
-       form.
-
-       The  function  new_page  is  a  predicate which tests if a
-       given field marks a page beginning on its form.
-
-
-
-

RETURN VALUE

-       The function new_page returns TRUE or FALSE.
-
-       The function set_new_page return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_CONNECTED
-            The given field is already connected to a form.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "form_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                      form_new_page(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_opts.3x.html b/doc/html/man/form_opts.3x.html deleted file mode 100644 index 78d57fd7374..00000000000 --- a/doc/html/man/form_opts.3x.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - -form_opts 3x - - - - -

form_opts 3x

-
-
-
-form_opts(3x)                                             form_opts(3x)
-
-
-
-
-
-

NAME

-       form_opts - set and get form options
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_form_opts(FORM *form, Field_Options opts);
-       int form_opts_on(FORM *form, Field_Options opts);
-       int form_opts_off(FORM *form, Field_Options opts);
-       Field_Options form_opts(const FORM *form);
-
-
-
-

DESCRIPTION

-       The  function  set_form_opts  sets  all  the  given form's
-       option bits  (form  option  bits  may  be  logically-OR'ed
-       together).
-
-       The  function form_opts_on turns on the given option bits,
-       and leaves others alone.
-
-       The function form_opts_off  turns  off  the  given  option
-       bits, and leaves others alone.
-
-       The  function  form_opts returns the form's current option
-       bits.
-
-       The following options are defined (all are on by default):
-
-       O_NL_OVERLOAD
-            Overload the REQ_NEW_LINE  forms  driver  request  so
-            that  calling  it  at  the end of a field goes to the
-            next field.
-
-       O_BS_OVERLOAD
-            Overload the REQ_DEL_PREV  forms  driver  request  so
-            that  calling  it at the beginning of a field goes to
-            the previous field.
-
-
-
-

RETURN VALUE

-       Except for form_opts, each routine returns one of the fol-
-       lowing:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          form_opts(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_page.3x.html b/doc/html/man/form_page.3x.html deleted file mode 100644 index 2168af1ffae..00000000000 --- a/doc/html/man/form_page.3x.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - -form_page 3x - - - - -

form_page 3x

-
-
-
-form_page(3x)                                             form_page(3x)
-
-
-
-
-
-

NAME

-       form_page - set and get form page number
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_current_field(FORM *form, FIELD *field);
-       FIELD *current_field(const FORM *);
-       int set_form_page(FORM *form, int n);
-       int form_page(const FORM *form);
-       int field_index(const FIELD *field);
-
-
-
-

DESCRIPTION

-       The  function  set_current field sets the current field of
-       the given form; current_field returns the current field of
-       the given form.
-
-       The  function  set_form_page  sets  the form's page number
-       (goes to page n of the form).
-
-       The function form_page returns  the  form's  current  page
-       number.
-
-       The function field_index returns the index of the field in
-       the field array of the form it is connected to. It returns
-       ERR  if  the  argument is the null pointer or the field is
-       not connected.
-
-
-
-

RETURN VALUE

-       Except for form_page, each routine returns one of the fol-
-       lowing:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_INVALID_FIELD
-            Contents of a field are not valid.
-
-       E_REQUEST_DENIED
-            The form driver could not process the request.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          form_page(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_post.3x.html b/doc/html/man/form_post.3x.html deleted file mode 100644 index 1e7e71432e9..00000000000 --- a/doc/html/man/form_post.3x.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - -form_post 3x - - - - -

form_post 3x

-
-
-
-form_post(3x)                                             form_post(3x)
-
-
-
-
-
-

NAME

-       form_post  -  write or erase forms from associated subwin-
-       dows
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int post_form(FORM *form);
-       int unpost_form(FORM *form);
-
-
-
-

DESCRIPTION

-       The function post_form displays a form to  its  associated
-       subwindow.   To trigger physical display of the subwindow,
-       use  refresh  or  some  equivalent  curses  routine   (the
-       implicit  doupdate  triggered  by  an curses input request
-       will do).
-
-       The function unpost_form erases form from  its  associated
-       subwindow.
-
-
-
-

RETURN VALUE

-       These routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NOT_POSTED
-            The form has not been posted.
-
-       E_NOT_CONNECTED
-            No items are connected to the form.
-
-       E_NO_ROOM
-            Form is too large for its window.
-
-       E_POSTED
-            The form has already been posted.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          form_post(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_requestname.3x.html b/doc/html/man/form_requestname.3x.html deleted file mode 100644 index 8400063f3a9..00000000000 --- a/doc/html/man/form_requestname.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -form_requestname 3x - - - - -

form_requestname 3x

-
-
-
-form_requestname(3x)                               form_requestname(3x)
-
-
-
-
-
-

NAME

-       form_requestname - handle printable form request names
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       const char *form_request_name(int request);
-       int form_request_by_name(const char *name);
-
-
-
-

DESCRIPTION

-       The  function form_request_name returns the printable name
-       of a form request code.
-       The function form_request_by_name searches in the name-ta-
-       ble  for  a  request  with  the given name and returns its
-       request code. Otherwise E_NO_MATCH is returned.
-
-
-
-

RETURN VALUE

-       form_request_name returns NULL on error and sets errno  to
-       E_BAD_ARGUMENT.
-       form_request_by_name returns E_NO_MATCH on error.  It does
-       not set errno.
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  are  specific  to ncurses.  They were not
-       supported on Version 7, BSD or System  V  implementations.
-       It  is recommended that any code depending on them be con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                   form_requestname(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_userptr.3x.html b/doc/html/man/form_userptr.3x.html deleted file mode 100644 index 189fca2961a..00000000000 --- a/doc/html/man/form_userptr.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -form_userptr 3x - - - - -

form_userptr 3x

-
-
-
-form_userptr(3x)                                       form_userptr(3x)
-
-
-
-
-
-

NAME

-       form_userptr - associate application data with a form item
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_form_userptr(FORM *form, void *userptr);
-       void* form_userptr(const FORM *form);
-
-
-
-

DESCRIPTION

-       Every  form  and  every  form item has a field that can be
-       used to hold application-specific data (that is, the form-
-       driver code leaves it alone).  These functions get and set
-       the form user pointer field.
-
-
-
-

RETURN VALUE

-       The function form_userptr returns a pointer (which may  be
-       NULL).  It does not set errno.
-
-       The function set_form_userptr returns E_OK (success).
-
-
-
-

SEE ALSO

-       curses(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V forms  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       The user pointer is a void pointer.  We chose not to leave
-       it as a char pointer for SVr4 compatibility.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                       form_userptr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_variables.3x.html b/doc/html/man/form_variables.3x.html deleted file mode 100644 index 5d252d97e28..00000000000 --- a/doc/html/man/form_variables.3x.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - -form_variables 3x - - - - -

form_variables 3x

-
-
-
-form_variables(3x)                                   form_variables(3x)
-
-
-
-
-
-

NAME

-       TYPE_ALNUM, TYPE_ALPHA, TYPE_ENUM, TYPE_INTEGER,
-       TYPE_IPV4, TYPE_NUMERIC, TYPE_REGEXP - form system global
-       variables
-
-
-
-

SYNOPSIS

-       #include <form.h>
-
-       FIELDTYPE * TYPE_ALNUM;
-       FIELDTYPE * TYPE_ALPHA;
-       FIELDTYPE * TYPE_ENUM;
-       FIELDTYPE * TYPE_INTEGER;
-       FIELDTYPE * TYPE_IPV4;
-       FIELDTYPE * TYPE_NUMERIC;
-       FIELDTYPE * TYPE_REGEXP;
-
-
-
-

DESCRIPTION

-       These  are  building blocks for the form library, defining
-       fields that can be created using set_fieldtype(3x).   Each
-       provides  functions  for  field- and character-validation,
-       according to the given datatype.
-
-   TYPE_ALNUM
-       This holds alphanumeric data.
-
-   TYPE_ALPHA
-       This holds alphabetic data.
-
-   TYPE_ENUM
-       This holds an enumerated type.
-
-   TYPE_INTEGER
-       This holds a decimal integer.
-
-   TYPE_IPV4
-       This holds an IPv4 internet address, e.g., "127.0.0.1".
-
-   TYPE_NUMERIC
-       This holds a decimal number, with optional sign and  deci-
-       mal point.
-
-   TYPE_REGEXP
-       This holds a regular expression.
-
-
-
-

PORTABILITY

-       The  TYPE_IPV4  variable  is  an extension not provided by
-       older implementations of the form library.
-
-
-
-

SEE ALSO

-       form(3x).
-
-
-
-                                                     form_variables(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/form_win.3x.html b/doc/html/man/form_win.3x.html deleted file mode 100644 index 9baa68f82c1..00000000000 --- a/doc/html/man/form_win.3x.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - -form_win 3x - - - - -

form_win 3x

-
-
-
-form_win(3x)                                               form_win(3x)
-
-
-
-
-
-

NAME

-       form_win  - make and break form window and subwindow asso-
-       ciations
-
-
-
-

SYNOPSIS

-       #include <form.h>
-       int set_form_win(FORM *form, WINDOW *win);
-       WINDOW *form_win(const FORM *form);
-       int set_form_sub(FORM *form, WINDOW *sub);
-       WINDOW *form_sub(const FORM *form);
-       int scale_form(const FORM *form, int *rows, int *columns);
-
-
-
-

DESCRIPTION

-       Every form has an associated pair of curses windows.   The
-       form  window displays any title and border associated with
-       the window; the form subwindow displays the items  of  the
-       form that are currently available for selection.
-
-       The first four functions get and set those windows.  It is
-       not necessary to set either window; by default, the driver
-       code uses stdscr for both.
-
-       In  the set_ functions, window argument of NULL is treated
-       as though it were stsdcr.  A  form  argument  of  NULL  is
-       treated  as  a  request  to change the system default form
-       window or subwindow.
-
-       The function scale_form returns the minimum size  required
-       for the subwindow of form.
-
-
-
-

RETURN VALUE

-       Routines  that return pointers return NULL on error.  Rou-
-       tines that return an integer return one of  the  following
-       error codes:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_POSTED
-            The form has already been posted.
-
-       E_NOT_CONNECTED
-            No items are connected to the form.
-
-
-
-

SEE ALSO

-       curses(3x), curs_variables(3x), form(3x).
-
-
-
-

NOTES

-       The header file <form.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate the System V forms library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                           form_win(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/index.html b/doc/html/man/index.html deleted file mode 100644 index 64a832f213e..00000000000 --- a/doc/html/man/index.html +++ /dev/null @@ -1,67 +0,0 @@ - - - - -NCURSES – Manual Pages - - - -
- - - diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html deleted file mode 100644 index 553e3854858..00000000000 --- a/doc/html/man/infocmp.1m.html +++ /dev/null @@ -1,444 +0,0 @@ - - - - -infocmp 1m - - - - -

infocmp 1m

-
-
-
-infocmp(1m)                                                 infocmp(1m)
-
-
-
-
-
-

NAME

-       infocmp - compare or print out terminfo descriptions
-
-
-
-

SYNOPSIS

-       infocmp [-1CEFGILTUVcdegilnpqrtux]
-             [-v n] [-s d| i| l| c] [-R subset]
-             [-w width] [-A directory] [-B directory]
-             [termname...]
-
-
-
-

DESCRIPTION

-       infocmp  can  be  used  to compare a binary terminfo entry
-       with other terminfo entries, rewrite a  terminfo  descrip-
-       tion  to  take  advantage  of  the use= terminfo field, or
-       print out a terminfo  description  from  the  binary  file
-       (term) in a variety of formats.  In all cases, the boolean
-       fields will be printed  first,  followed  by  the  numeric
-       fields, followed by the string fields.
-
-   Default Options
-       If  no options are specified and zero or one termnames are
-       specified, the -I option will be assumed.   If  more  than
-       one  termname is specified, the -d option will be assumed.
-
-   Comparison Options [-d] [-c] [-n]
-       infocmp compares the terminfo  description  of  the  first
-       terminal  termname  with each of the descriptions given by
-       the entries for the  other  terminal's  termnames.   If  a
-       capability  is  defined for only one of the terminals, the
-       value returned will depend on the type of the  capability:
-       F  for  boolean  variables,  -1 for integer variables, and
-       NULL for string variables.
-
-       The -d option produces a list of each capability  that  is
-       different  between  two entries.  This option is useful to
-       show the difference between two entries, created  by  dif-
-       ferent people, for the same or similar terminals.
-
-       The  -c  option produces a list of each capability that is
-       common between two entries.  Capabilities that are not set
-       are  ignored.  This option can be used as a quick check to
-       see if the -u option is worth using.
-
-       The -n option produces a list of each capability  that  is
-       in neither entry.  If no termnames are given, the environ-
-       ment variable TERM will be used for both of the termnames.
-       This  can  be used as a quick check to see if anything was
-       left out of a description.
-
-   Source Listing Options [-I] [-L] [-C] [-r]
-       The -I, -L, and -C options will produce a  source  listing
-       for each terminal named.
-
-      -I   use the terminfo names
-      -L   use the long C variable name listed in <term.h>
-      -C   use the termcap names
-      -r   when using -C, put out all capabilities in termcap form
-
-       If  no  termnames are given, the environment variable TERM
-       will be used for the terminal name.
-
-       The source produced by the -C option may be used  directly
-       as  a termcap entry, but not all parameterized strings can
-       be changed to the termcap format.  infocmp will attempt to
-       convert  most  of  the parameterized information, and any-
-       thing not converted will be plainly marked in  the  output
-       and commented out.  These should be edited by hand.
-
-       All  padding  information  for  strings  will be collected
-       together and placed at the beginning of the  string  where
-       termcap  expects  it.  Mandatory padding (padding informa-
-       tion with a trailing '/') will become optional.
-
-       All termcap variables no longer supported by terminfo, but
-       which are derivable from other terminfo variables, will be
-       output.  Not all terminfo capabilities will be translated;
-       only  those variables which were part of termcap will nor-
-       mally be output.  Specifying the -r option will  take  off
-       this  restriction,  allowing all capabilities to be output
-       in termcap form.
-
-       Note that because padding is collected to the beginning of
-       the  capability,  not all capabilities are output.  Manda-
-       tory padding is not supported.   Because  termcap  strings
-       are  not as flexible, it is not always possible to convert
-       a terminfo string capability into  an  equivalent  termcap
-       format.   A subsequent conversion of the termcap file back
-       into terminfo format will not  necessarily  reproduce  the
-       original terminfo source.
-
-       Some  common  terminfo  parameter sequences, their termcap
-       equivalents, and some terminal types which  commonly  have
-       such sequences, are:
-
-     terminfo                    termcap   Representative Terminals
-     ---------------------------------------------------------------
-     %p1%c                       %.        adm
-     %p1%d                       %d        hp, ANSI standard, vt100
-     %p1%'x'%+%c                 %+x       concept
-     %i                          %iq       ANSI standard, vt100
-     %p1%?%'x'%>%t%p1%'y'%+%;    %>xy      concept
-     %p2 is printed before %p1   %r        hp
-
-   Use= Option [-u]
-       The  -u  option  produces a terminfo source description of
-       the first terminal termname which is relative to  the  sum
-       of  the  descriptions  given  by the entries for the other
-       terminals termnames.  It does this by analyzing  the  dif-
-       ferences   between   the  first  termname  and  the  other
-       termnames and producing a description with use= fields for
-       the  other  terminals.   In this manner, it is possible to
-       retrofit  generic  terminfo  entries  into  a   terminal's
-       description.  Or, if two similar terminals exist, but were
-       coded at different times or by different  people  so  that
-       each description is a full description, using infocmp will
-       show what can be done to change one description to be rel-
-       ative to the other.
-
-       A capability will get printed with an at-sign (@) if it no
-       longer exists in the first termname, but one of the  other
-       termname  entries contains a value for it.  A capability's
-       value gets printed if the value in the first  termname  is
-       not  found in any of the other termname entries, or if the
-       first of the other termname entries that has this capabil-
-       ity  gives  a different value for the capability than that
-       in the first termname.
-
-       The order of the other termname  entries  is  significant.
-       Since  the terminfo compiler tic does a left-to-right scan
-       of the capabilities, specifying two use= entries that con-
-       tain differing entries for the same capabilities will pro-
-       duce different results depending on  the  order  that  the
-       entries  are  given in.  infocmp will flag any such incon-
-       sistencies between the other termname entries as they  are
-       found.
-
-       Alternatively,  specifying a capability after a use= entry
-       that contains that capability will cause the second speci-
-       fication  to  be  ignored.   Using  infocmp  to recreate a
-       description can be a useful check to make sure that every-
-       thing  was  specified  correctly  in  the  original source
-       description.
-
-       Another error  that  does  not  cause  incorrect  compiled
-       files,  but will slow down the compilation time, is speci-
-       fying extra use= fields  that  are  superfluous.   infocmp
-       will  flag  any  other  termname use= fields that were not
-       needed.
-
-   Changing Databases [-A directory] [-B directory]
-       The location of the compiled terminfo  database  is  taken
-       from  the environment variable TERMINFO .  If the variable
-       is not defined, or the terminal is not found in that loca-
-       tion,  the  system  terminfo  database, in /usr/share/ter-
-       minfo, will be used.  The options -A and -B may be used to
-       override  this  location.  The -A option will set TERMINFO
-       for the first termname and the -B option will set TERMINFO
-       for  the  other  termnames.   With this, it is possible to
-       compare descriptions for a terminal  with  the  same  name
-       located  in  two  different databases.  This is useful for
-       comparing descriptions for the same  terminal  created  by
-       different people.
-
-   Other Options
-       -1   causes  the  fields  to be printed out one to a line.
-            Otherwise, the fields will be printed  several  to  a
-            line to a maximum width of 60 characters.
-
-       -a   tells  infocmp  to  retain commented-out capabilities
-            rather than discarding them.  Capabilities  are  com-
-            mented by prefixing them with a period.
-
-       -E   Dump  the  capabilities  of  the  given  terminal  as
-            tables, needed in the C initializer  for  a  TERMTYPE
-            structure  (the  terminal capability structure in the
-            <term.h>).  This option is useful for preparing  ver-
-            sions  of  the  curses  library hardwired for a given
-            terminal type.  The tables are all  declared  static,
-            and  are  named according to the type and the name of
-            the corresponding terminal entry.
-
-            Before ncurses 5.0, the split between the -e  and  -E
-            options  was  not  needed;  but  support for extended
-            names required making the arrays of terminal capabil-
-            ities separate from the TERMTYPE structure.
-
-       -e   Dump  the  capabilities  of the given terminal as a C
-            initializer for a TERMTYPE  structure  (the  terminal
-            capability  structure  in the <term.h>).  This option
-            is  useful  for  preparing  versions  of  the  curses
-            library hardwired for a given terminal type.
-
-       -F   compare  terminfo  files.  This assumes that two fol-
-            lowing  arguments  are  filenames.   The  files   are
-            searched  for  pairwise matches between entries, with
-            two entries considered to match if any of their names
-            do.   The  report  printed  to  standard output lists
-            entries with  no  matches  in  the  other  file,  and
-            entries  with  more than one match.  For entries with
-            exactly one match it includes  a  difference  report.
-            Normally,  to  reduce  the  volume of the report, use
-            references are not resolved before looking  for  dif-
-            ferences, but resolution can be forced by also speci-
-            fying -r.
-
-       -f   Display  complex  terminfo  strings   which   contain
-            if/then/else/endif expressions indented for readabil-
-            ity.
-
-       -G   Display constant literals in decimal form rather than
-            their character equivalents.
-
-       -g   Display  constant  character  literals in quoted form
-            rather than their decimal equivalents.
-
-       -i   Analyze the initialization (is1, is2, is3), and reset
-            (rs1,  rs2,  rs3),  strings  in  the entry.  For each
-            string, the code tries to analyze it into actions  in
-            terms of the other capabilities in the entry, certain
-            X3.64/ISO 6429/ECMA-48 capabilities, and certain  DEC
-            VT-series  private  modes (the set of recognized spe-
-            cial sequences has  been  selected  for  completeness
-            over  the  existing  terminfo database).  Each report
-            line consists of the capability name, followed  by  a
-            colon and space, followed by a printable expansion of
-            the capability string with sections  matching  recog-
-            nized  actions  translated into {}-bracketed descrip-
-            tions.  Here  is  a  list  of  the  DEC/ANSI  special
-            sequences recognized: i.
-
-                  Action        Meaning
-                  -----------------------------------------
-                  RIS           full reset
-                  SC            save cursor
-                  RC            restore cursor
-                  LL            home-down
-                  RSR           reset scroll region
-                  -----------------------------------------
-                  DECSTR        soft reset (VT320)
-                  S7C1T         7-bit controls (VT220)
-                  -----------------------------------------
-                  ISO DEC G0    enable DEC graphics for G0
-                  ISO UK G0     enable UK chars for G0
-                  ISO US G0     enable US chars for G0
-                  ISO DEC G1    enable DEC graphics for G1
-                  ISO UK G1     enable UK chars for G1
-                  ISO US G1     enable US chars for G1
-                  -----------------------------------------
-                  DECPAM        application keypad mode
-                  DECPNM        normal keypad mode
-                  DECANSI       enter ANSI mode
-                  -----------------------------------------
-                  ECMA[+-]AM    keyboard action mode
-                  ECMA[+-]IRM   insert replace mode
-                  ECMA[+-]SRM   send receive mode
-                  ECMA[+-]LNM   linefeed mode
-                  -----------------------------------------
-                  DEC[+-]CKM    application cursor keys
-                  DEC[+-]ANM    set VT52 mode
-                  DEC[+-]COLM   132-column mode
-
-                  DEC[+-]SCLM   smooth scroll
-                  DEC[+-]SCNM   reverse video mode
-                  DEC[+-]OM     origin mode
-                  DEC[+-]AWM    wraparound mode
-                  DEC[+-]ARM    auto-repeat mode
-
-            It  also  recognizes  a  SGR  action corresponding to
-            ANSI/ISO 6429/ECMA Set Graphics Rendition,  with  the
-            values  NORMAL,  BOLD, UNDERLINE, BLINK, and REVERSE.
-            All but NORMAL may be prefixed with `+' (turn on)  or
-            `-' (turn off).
-
-       An SGR0 designates an empty highlight sequence (equivalent
-       to {SGR:NORMAL}).
-
-       -l   Set output format to terminfo.
-
-       -p   Ignore padding specifications when comparing strings.
-
-       -q   Make  the comparison listing shorter by omitting sub-
-            headings, and using "-" for absent capabilities,  "@"
-            for canceled rather than "NULL".
-
-       -Rsubset
-            Restrict  output  to  a given subset.  This option is
-            for use with archaic versions of terminfo like  those
-            on  SVr1,  Ultrix,  or  HP/UX that do not support the
-            full set of SVR4/XSI Curses  terminfo;  and  variants
-            such as AIX that have their own extensions incompati-
-            ble with SVr4/XSI.  Available  terminfo  subsets  are
-            "SVr1",  "Ultrix",  "HP",  and "AIX"; see terminfo(5)
-            for details.  You can also choose  the  subset  "BSD"
-            which  selects only capabilities with termcap equiva-
-            lents recognized by 4.4BSD.
-
-       -s [d|i|l|c]
-            The -s option  sorts  the  fields  within  each  type
-            according to the argument below:
-
-            d    leave  fields  in the order that they are stored
-                 in the terminfo database.
-
-            i    sort by terminfo name.
-
-            l    sort by the long C variable name.
-
-            c    sort by the termcap name.
-
-            If the -s option is not given, the fields printed out
-            will  be  sorted  alphabetically by the terminfo name
-            within each type, except in the case of the -C or the
-            -L options, which cause the sorting to be done by the
-            termcap name or the long  C  variable  name,  respec-
-            tively.
-
-       -T   eliminates  size-restrictions  on the generated text.
-            This is mainly useful for testing and analysis, since
-            the compiled descriptions are limited (e.g., 1023 for
-            termcap, 4096 for terminfo).
-
-       -t   tells  tic  to  discard  commented-out  capabilities.
-            Normally  when  translating from terminfo to termcap,
-            untranslatable capabilities are commented-out.
-
-       -U   tells infocmp to  not  post-process  the  data  after
-            parsing  the  source  file.   This feature helps when
-            comparing the actual contents of  two  source  files,
-            since  it  excludes the inferences that infocmp makes
-            to fill in missing data.
-
-       -V   reports the version of ncurses which was used in this
-            program, and exits.
-
-       -v n prints  out  tracing information on standard error as
-            the program runs.  Higher values of n induce  greater
-            verbosity.
-
-       -w width
-            changes the output to width characters.
-
-       -x   print   information  for  user-defined  capabilities.
-            These are extensions to the terminfo repertoire which
-            can be loaded using the -x option of tic.
-
-
-
-

FILES

-       /usr/share/terminfo Compiled      terminal     description
-                           database.
-
-
-
-

EXTENSIONS

-       The -E, -F, -G, -R, -T, -V, -a, -e, -f, -g, -i, -l, -p, -q
-       and -t options are not supported in SVr4 curses.
-
-       The -r option's notion of `termcap' capabilities is System
-       V Release 4's.  Actual BSD curses  versions  will  have  a
-       more  restricted  set.  To see only the 4.4BSD set, use -r
-       -RBSD.
-
-
-
-

BUGS

-       The -F option of infocmp(1m) should be a toe(1m) mode.
-
-
-
-

SEE ALSO

-       captoinfo(1m),    infotocap(1m),     tic(1m),     toe(1m),
-       curses(3x), terminfo(5).
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-

AUTHOR

-       Eric S. Raymond <esr@snark.thyrsus.com> and
-       Thomas E. Dickey <dickey@invisible-island.net>
-
-
-
-                                                            infocmp(1m)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html deleted file mode 100644 index a143e45fc5e..00000000000 --- a/doc/html/man/infotocap.1m.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - -infotocap 1m - - - - -

infotocap 1m

-
-
-
-infotocap(1m)                                             infotocap(1m)
-
-
-
-
-
-

NAME

-       infotocap  - convert a terminfo description into a termcap
-       description
-
-
-
-

SYNOPSIS

-       infotocap [-vn width]  [-V] [-1] [-w width] file . . .
-
-
-
-

DESCRIPTION

-       infotocap looks in  each  given  text  file  for  terminfo
-       descriptions.   For  each  terminfo  description found, an
-       equivalent termcap description is written to standard out-
-       put.  Terminfo use capabilities are translated directly to
-       termcap tc capabilities.
-
-       -v   print out tracing information on  standard  error  as
-            the program runs.
-
-       -V   print  out the version of the program in use on stan-
-            dard error and exit.
-
-       -1   cause the fields to print out one to a line.   Other-
-            wise, the fields will be printed several to a line to
-            a maximum width of 60 characters.
-
-       -w   change the output to width characters.
-
-
-
-

FILES

-       /usr/share/terminfo Compiled     terminal      description
-                           database.
-
-
-
-

NOTES

-       This  utility  is  actually  a  link to tic, running in -C
-       mode.  You can use other tic options such as -f and  -x.
-
-
-
-

SEE ALSO

-       curses(3x), tic(1m), infocmp(1m), terminfo(5)
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-

AUTHOR

-       Eric S. Raymond <esr@snark.thyrsus.com> and
-       Thomas E. Dickey <dickey@invisible-island.net>
-
-
-
-                                                          infotocap(1m)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/key_defined.3x.html b/doc/html/man/key_defined.3x.html deleted file mode 100644 index ee6126b9bd7..00000000000 --- a/doc/html/man/key_defined.3x.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - -key_defined 3x - - - - -

key_defined 3x

-
-
-
-key_defined(3x)                                         key_defined(3x)
-
-
-
-
-
-

NAME

-       key_defined - check if a keycode is defined
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int key_defined(const char *definition);
-
-
-
-

DESCRIPTION

-       This is an extension to the curses library.  It permits an
-       application to determine if a string is currently bound to
-       any keycode.
-
-
-
-

RETURN VALUE

-       If  the  string  is bound to a keycode, its value (greater
-       than zero) is returned.  If no keycode is bound,  zero  is
-       returned.   If  the  string  conflicts with longer strings
-       which are bound to keys, -1 is returned.
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on them be  con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       define_key(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey.
-
-
-
-                                                        key_defined(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/keybound.3x.html b/doc/html/man/keybound.3x.html deleted file mode 100644 index 5b54466bd90..00000000000 --- a/doc/html/man/keybound.3x.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - -keybound 3x - - - - -

keybound 3x

-
-
-
-keybound(3x)                                               keybound(3x)
-
-
-
-
-
-

NAME

-       keybound - return definition of keycode
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       char * keybound(int keycode, int count);
-
-
-
-

DESCRIPTION

-       This is an extension to the curses library.  It permits an
-       application to determine the string which  is  defined  in
-       the terminfo for specific keycodes.
-
-
-
-

RETURN VALUE

-       The keycode parameter must be greater than zero, else NULL
-       is returned.  If it does not correspond to a defined  key,
-       then  NULL  is  returned.   The count parameter is used to
-       allow the application to iterate through multiple  defini-
-       tions,  counting from zero.  When successful, the function
-       returns a string which must be freed by the caller.
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on them be  con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       define_key(3x), keyok(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey.
-
-
-
-                                                           keybound(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/keyok.3x.html b/doc/html/man/keyok.3x.html deleted file mode 100644 index d2b0be1719c..00000000000 --- a/doc/html/man/keyok.3x.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - -keyok 3x - - - - -

keyok 3x

-
-
-
-keyok(3x)                                                     keyok(3x)
-
-
-
-
-
-

NAME

-       keyok - enable or disable a keycode
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int keyok(int keycode, bool enable);
-
-
-
-

DESCRIPTION

-       This is an extension to the curses library.  It permits an
-       application to disable specific keycodes, rather than  use
-       the  keypad  function  to disable all keycodes.  Keys that
-       have been disabled can be re-enabled.
-
-
-
-

RETURN VALUE

-       The keycode  must  be  greater  than  zero,  else  ERR  is
-       returned.   If  it  does  not correspond to a defined key,
-       then ERR is returned.  If the enable  parameter  is  true,
-       then  the  key  must  have  been disabled, and vice versa.
-       Otherwise, the function returns OK.
-
-
-
-

PORTABILITY

-       These routines are specific to  ncurses.   They  were  not
-       supported  on  Version 7, BSD or System V implementations.
-       It is recommended that any code depending on them be  con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       define_key(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey.
-
-
-
-                                                              keyok(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/legacy_coding.3x.html b/doc/html/man/legacy_coding.3x.html deleted file mode 100644 index 03eea8b6cc2..00000000000 --- a/doc/html/man/legacy_coding.3x.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - -legacy_coding 3x - - - - -

legacy_coding 3x

-
-
-
-legacy_coding(3x)                                     legacy_coding(3x)
-
-
-
-
-
-

NAME

-       use_legacy_coding - use terminal's default colors
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int use_legacy_coding(int level);
-
-
-
-

DESCRIPTION

-       The  use_legacy_coding()  function  is an extension to the
-       curses library.  It allows the caller to change the result
-       of  unctrl, and suppress related checks within the library
-       that would normally cause  nonprinting  characters  to  be
-       rendered in visible form.  This affects only 8-bit charac-
-       ters.
-
-       The level parameter controls the result:
-
-              0    the library functions normally, rendering non-
-                   printing characters as described in unctrl.
-
-              1    the  library ignores isprintf for codes in the
-                   range 160-255.
-
-              2    the library ignores isprintf for codes in  the
-                   range 128-255.  It also modifies the output of
-                   unctrl, showing codes in the range 128-159  as
-                   is.
-
-
-
-

RETURN VALUE

-       If  the  screen  has  not  been  initialized, or the level
-       parameter is out of range, the function returns ERR.  Oth-
-       erwise, it returns the previous level: 0, 1 or 2.
-
-
-
-

PORTABILITY

-       This routine is specific to ncurses.  It was not supported
-       on Version 7, BSD or System V implementations.  It is rec-
-       ommended  that any code depending on ncurses extensions be
-       conditioned using NCURSES_VERSION.
-
-
-
-

SEE ALSO

-       unctrl.
-
-
-
-

AUTHOR

-       Thomas Dickey (to support lynx's font-switching feature).
-
-
-
-                                                      legacy_coding(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html deleted file mode 100644 index adfde4cdcca..00000000000 --- a/doc/html/man/menu.3x.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - -menu 3x - - - - -

menu 3x

-
-
-
-menu(3x)                                                       menu(3x)
-
-
-
-
-
-

NAME

-       menu - curses extension for programming menus
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-
-
-
-

DESCRIPTION

-       The  menu library provides terminal-independent facilities
-       for composing menu systems  on  character-cell  terminals.
-       The library includes: item routines, which create and mod-
-       ify menu items; and menu routines, which group items  into
-       menus, display menus on the screen, and handle interaction
-       with the user.
-
-       The menu library uses the curses libraries, and  a  curses
-       initialization  routine  such  as  initscr  must be called
-       before using any of these  functions.   To  use  the  menu
-       library, link with the options -lmenu -lcurses.
-
-   Current Default Values for Item Attributes
-       The  menu  library  maintains  a  default  value  for item
-       attributes.  You can get or set this  default  by  calling
-       the  appropriate  get_  or  set_  routine with a NULL item
-       pointer.  Changing  this  default  with  a  set_  function
-       affects  future  item  creations,  but does not change the
-       rendering of items already created.
-
-   Routine Name Index
-       The following table lists each menu routine and  the  name
-       of the manual page on which it is described.
-
-       curses Routine Name    Manual Page Name
-       --------------------------------------------
-       current_item           mitem_current(3x)
-       free_item              mitem_new(3x)
-       free_menu              menu_new(3x)
-       item_count             menu_items(3x)
-       item_description       mitem_name(3x)
-       item_index             mitem_current(3x)
-       item_init              menu_hook(3x)
-       item_name              mitem_name(3x)
-       item_opts              mitem_opts(3x)
-       item_opts_off          mitem_opts(3x)
-       item_opts_on           mitem_opts(3x)
-       item_term              menu_hook(3x)
-       item_userptr           mitem_userptr(3x)
-       item_value             mitem_value(3x)
-       item_visible           mitem_visible(3x)
-       menu_back              menu_attributes(3x)
-       menu_driver            menu_driver(3x)
-       menu_fore              menu_attributes(3x)
-       menu_format            menu_format(3x)
-       menu_grey              menu_attributes(3x)
-       menu_init              menu_hook(3x)
-       menu_items             menu_items(3x)
-       menu_mark              menu_mark(3x)
-       menu_opts              menu_opts(3x)
-       menu_opts_off          menu_opts(3x)
-       menu_opts_on           menu_opts(3x)
-       menu_pad               menu_attributes(3x)
-       menu_pattern           menu_pattern(3x)
-
-       menu_request_by_name   menu_requestname(3x)
-       menu_request_name      menu_requestname(3x)
-       menu_spacing           menu_spacing(3x)
-       menu_sub               menu_win(3x)
-       menu_term              menu_hook(3x)
-       menu_userptr           menu_userptr(3x)
-       menu_win               menu_win(3x)
-       new_item               mitem_new(3x)
-       new_menu               menu_new(3x)
-       pos_menu_cursor        menu_cursor(3x)
-       post_menu              menu_post(3x)
-       scale_menu             menu_win(3x)
-       set_current_item       mitem_current(3x)
-       set_item_init          menu_hook(3x)
-       set_item_opts          mitem_opts(3x)
-       set_item_term          menu_hook(3x)
-       set_item_userptr       mitem_userptr(3x)
-       set_item_value         mitem_value(3x)
-       set_menu_back          menu_attributes(3x)
-       set_menu_fore          menu_attributes(3x)
-       set_menu_format        menu_format(3x)
-       set_menu_grey          menu_attributes(3x)
-       set_menu_init          menu_hook(3x)
-       set_menu_items         menu_items(3x)
-       set_menu_mark          menu_mark(3x)
-       set_menu_opts          mitem_opts(3x)
-       set_menu_pad           menu_attributes(3x)
-       set_menu_pattern       menu_pattern(3x)
-       set_menu_spacing       menu_spacing(3x)
-       set_menu_sub           menu_win(3x)
-       set_menu_term          menu_hook(3x)
-       set_menu_userptr       menu_userptr(3x)
-       set_menu_win           menu_win(3x)
-       set_top_row            mitem_current(3x)
-       top_row                mitem_current(3x)
-       unpost_menu            menu_post(3x)
-
-
-
-

RETURN VALUE

-       Routines  that return pointers return NULL on error.  Rou-
-       tines that return an integer return one of  the  following
-       error codes:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NO_MATCH
-            Character failed to match.
-
-       E_NO_ROOM
-            Menu is too large for its window.
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-       E_NOT_POSTED
-            The menu has not been posted.
-
-       E_NOT_SELECTABLE
-            The designated item cannot be selected.
-
-       E_POSTED
-            The menu is already posted.
-
-       E_REQUEST_DENIED
-            The menu driver could not process the request.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_UNKNOWN_COMMAND
-            The menu driver code saw an unknown request code.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "menu_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       files <curses.h> and <eti.h>.
-
-       In  your  library  list,  libmenu.a should be before libn-
-       curses.a; that is, you want to say `-lmenu -lncurses', not
-       the  other  way  around  (which would usually give a link-
-       error).
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.  Manual pages and adaptation for ncurses
-       by Eric S. Raymond.
-
-
-
-

SEE ALSO

-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                               menu(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_attributes.3x.html b/doc/html/man/menu_attributes.3x.html deleted file mode 100644 index c02a4ab38de..00000000000 --- a/doc/html/man/menu_attributes.3x.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - -menu_attributes 3x - - - - -

menu_attributes 3x

-
-
-
-menu_attributes(3x)                                 menu_attributes(3x)
-
-
-
-
-
-

NAME

-       menu_attributes - color and attribute control for menus
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_fore(MENU *menu, chtype attr);
-       chtype menu_fore(const MENU *menu);
-       int set_menu_back(MENU *menu, chtype attr);
-       chtype menu_back(const MENU *menu);
-       int set_menu_grey(MENU *menu, chtype attr);
-       chtype menu_grey(const MENU *menu);
-       int set_menu_pad(MENU *menu, int pad);
-       int menu_pad(const MENU *menu);
-
-
-
-

DESCRIPTION

-       The  function  set_menu_fore sets the foreground attribute
-       of menu. This is the  highlight  used  for  selected  menu
-       items.   menu_fore  returns the foreground attribute.  The
-       default is A_REVERSE.
-
-       The function set_menu_back sets the  background  attribute
-       of  menu.  This  is the highlight used for selectable (but
-       not  currently  selected)  menu   items.    The   function
-       menu_back  returns  the background attribute.  The default
-       is A_NORMAL.
-
-       The function set_menu_grey  sets  the  grey  attribute  of
-       menu.  This  is  the highlight used for un-selectable menu
-       items in menus that permit more than one  selection.   The
-       function   menu_grey  returns  the  grey  attribute.   The
-       default is A_UNDERLINE.
-
-       The function set_menu_pad sets the character used to  fill
-       the space between the name and description parts of a menu
-       item.  menu_pad returns the given  menu's  pad  character.
-       The default is a blank.
-
-
-
-

RETURN VALUE

-       These routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-
-
-

SEE ALSO

-       curses(3x) and related pages whose names begin "menu_" for
-       detailed descriptions of the entry points.
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                    menu_attributes(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_cursor.3x.html b/doc/html/man/menu_cursor.3x.html deleted file mode 100644 index be4f4299880..00000000000 --- a/doc/html/man/menu_cursor.3x.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - -menu_cursor 3x - - - - -

menu_cursor 3x

-
-
-
-menu_cursor(3x)                                         menu_cursor(3x)
-
-
-
-
-
-

NAME

-       menu_cursor - position a menu's cursor
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int pos_menu_cursor(const MENU *menu);
-
-
-
-

DESCRIPTION

-       The  function  pos_menu_cursor  restores the cursor to the
-       current position associated with the menu's selected item.
-       This  is  useful after curses routines have been called to
-       do screen-painting in response to a menu select.
-
-
-
-

RETURN VALUE

-       This routine returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_NOT_POSTED
-            The menu has not been posted.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                        menu_cursor(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_driver.3x.html b/doc/html/man/menu_driver.3x.html deleted file mode 100644 index f2b6c16c715..00000000000 --- a/doc/html/man/menu_driver.3x.html +++ /dev/null @@ -1,255 +0,0 @@ - - - - -menu_driver 3x - - - - -

menu_driver 3x

-
-
-
-menu_driver(3x)                                         menu_driver(3x)
-
-
-
-
-
-

NAME

-       menu_driver - command-processing loop of the menu system
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int menu_driver(MENU *menu, int c);
-
-
-
-

DESCRIPTION

-       Once a menu has been posted (displayed), you should funnel
-       input events to it through menu_driver.  This routine  has
-       three major input cases:
-
-       o   The  input  is  a form navigation request.  Navigation
-           request codes are constants defined in <form.h>, which
-           are   distinct  from  the  key-  and  character  codes
-           returned by wgetch.
-
-       o   The input is a printable character.  Printable charac-
-           ters  (which  must  be  positive,  less  than 256) are
-           checked according to the program's locale settings.
-
-       o   The input is the KEY_MOUSE special key associated with
-           an mouse event.
-
-       The menu driver requests are as follows:
-
-       REQ_LEFT_ITEM
-            Move left to an item.
-
-       REQ_RIGHT_ITEM
-            Move right to an item.
-
-       REQ_UP_ITEM
-            Move up to an item.
-
-       REQ_DOWN_ITEM
-            Move down to an item.
-
-       REQ_SCR_ULINE
-            Scroll up a line.
-
-       REQ_SCR_DLINE
-            Scroll down a line.
-
-       REQ_SCR_DPAGE
-            Scroll down a page.
-
-       REQ_SCR_UPAGE
-            Scroll up a page.
-
-       REQ_FIRST_ITEM
-            Move to the first item.
-
-       REQ_LAST_ITEM
-            Move to the last item.
-
-       REQ_NEXT_ITEM
-            Move to the next item.
-
-       REQ_PREV_ITEM
-            Move to the previous item.
-
-       REQ_TOGGLE_ITEM
-            Select/deselect an item.
-
-       REQ_CLEAR_PATTERN
-            Clear the menu pattern buffer.
-
-       REQ_BACK_PATTERN
-            Delete   the  previous  character  from  the  pattern
-            buffer.
-
-       REQ_NEXT_MATCH
-            Move to the next item matching the pattern match.
-
-       REQ_PREV_MATCH
-            Move to the previous item matching the pattern match.
-
-       If  the second argument is a printable character, the code
-       appends it to the pattern buffer and attempts to  move  to
-       the  next  item  matching the new pattern.  If there is no
-       such match, menu_driver returns E_NO_MATCH and deletes the
-       appended character from the buffer.
-
-       If  the  second  argument  is one of the above pre-defined
-       requests, the corresponding action is performed.
-
-   MOUSE HANDLING
-       If the second argument is the KEY_MOUSE special  key,  the
-       associated mouse event is translated into one of the above
-       pre-defined requests.  Currently only clicks in  the  user
-       window  (e.g., inside the menu display area or the decora-
-       tion window) are handled.
-
-       If you click above the display region of the menu:
-
-       o   a REQ_SCR_ULINE is generated for a single click,
-
-       o   a REQ_SCR_UPAGE is generated for a double-click and
-
-       o   a REQ_FIRST_ITEM is generated for a triple-click.
-
-       If you click below the display region of the menu:
-
-       o   a REQ_SCR_DLINE is generated for a single click,
-
-       o   a REQ_SCR_DPAGE is generated for a double-click and
-
-       o   a REQ_LAST_ITEM is generated for a triple-click.
-
-       If you click at an item inside the  display  area  of  the
-       menu:
-
-       o   the menu cursor is positioned to that item.
-
-       o   If  you double-click an item a REQ_TOGGLE_ITEM is gen-
-           erated and E_UNKNOWN_COMMAND is returned.  This return
-           value  makes  sense,  because  a  double click usually
-           means that an item-specific action should be returned.
-           It is exactly the purpose of this return value to sig-
-           nal that an application  specific  command  should  be
-           executed.
-
-       o   If  a translation into a request was done, menu_driver
-           returns the result of this request.
-
-       If you clicked outside the user window or the mouse  event
-       could   not   be   translated   into  a  menu  request  an
-       E_REQUEST_DENIED is returned.
-
-   APPLICATION-DEFINED COMMANDS
-       If the second argument is neither printable nor one of the
-       above  pre-defined  menu  requests or KEY_MOUSE, the drive
-       assumes it is an application-specific command and  returns
-       E_UNKNOWN_COMMAND.  Application-defined commands should be
-       defined relative to  MAX_COMMAND,  the  maximum  value  of
-       these pre-defined requests.
-
-
-
-

RETURN VALUE

-       menu_driver return one of the following error codes:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NOT_POSTED
-            The menu has not been posted.
-
-       E_UNKNOWN_COMMAND
-            The menu driver code saw an unknown request code.
-
-       E_NO_MATCH
-            Character failed to match.
-
-       E_REQUEST_DENIED
-            The menu driver could not process the request.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x), getch(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       files <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were  not supported on Version 7 or BSD versions. The sup-
-       port for mouse events is ncurses specific.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                        menu_driver(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_format.3x.html b/doc/html/man/menu_format.3x.html deleted file mode 100644 index c419406c35e..00000000000 --- a/doc/html/man/menu_format.3x.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - -menu_format 3x - - - - -

menu_format 3x

-
-
-
-menu_format(3x)                                         menu_format(3x)
-
-
-
-
-
-

NAME

-       menu_format - set and get menu sizes
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_format(MENU *menu, int rows, int cols);
-       void menu_format(const MENU *menu, int *rows, int *cols);
-
-
-
-

DESCRIPTION

-       The function set_menu_format sets the maximum display size
-       of the given menu.  If this size is too small  to  display
-       all  menu items, the menu will be made scrollable. If this
-       size is larger than the menus subwindow and the  subwindow
-       is  too  small to display all menu items, post_menu() will
-       fail.
-
-       The  default  format  is  16  rows,  1  column.    Calling
-       set_menu_format  with a null menu pointer will change this
-       default.  A zero row or column argument to set_menu_format
-       is  interpreted  as  a  request  not to change the current
-       value.
-
-       The function menu_format  returns  the  maximum-size  con-
-       straints  for the given menu into the storage addressed by
-       rows and cols.
-
-
-
-

RETURN VALUE

-       These routines returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_POSTED
-            The menu is already posted.
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                        menu_format(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_hook.3x.html b/doc/html/man/menu_hook.3x.html deleted file mode 100644 index 6a57ac7f8c7..00000000000 --- a/doc/html/man/menu_hook.3x.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - -menu_hook 3x - - - - -

menu_hook 3x

-
-
-
-menu_hook(3x)                                             menu_hook(3x)
-
-
-
-
-
-

NAME

-       menu_hook - set hooks for automatic invocation by applica-
-       tions
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_item_init(MENU *menu, Menu_Hook func);
-       Menu_Hook item_init(const MENU *menu);
-       int set_item_term(MENU *menu, Menu_Hook func);
-       Menu_Hook item_term(const MENU *menu);
-       int set_menu_init(MENU *menu, Menu_Hook func);
-       Menu_Hook menu_init(const MENU *menu);
-       int set_menu_term(MENU *menu, Menu_Hook func);
-       Menu_Hook menu_term(const MENU *menu);
-
-
-
-

DESCRIPTION

-       These functions make it possible to set hook functions  to
-       be called at various points in the automatic processing of
-       input event codes by menu_driver.
-
-       The function set_item_init sets a hook  to  be  called  at
-       menu-post  time  and  each  time the selected item changes
-       (after the change).  item_init returns  the  current  item
-       init hook, if any (NULL if there is no such hook).
-
-       The  function  set_item_term  sets  a hook to be called at
-       menu-unpost time and each time the selected  item  changes
-       (before  the  change).  item_term returns the current item
-       term hook, if any (NULL if there is no such hook).
-
-       The function set_menu_init sets a hook  to  be  called  at
-       menu-post  time  and  just  after  the top row on the menu
-       changes once it is posted.  menu_init returns the  current
-       menu init hook, if any (NULL if there is no such hook).
-
-       The  function  set_menu_term  sets  a hook to be called at
-       menu-unpost time and just before the top row on  the  menu
-       changes  once it is posted.  menu_term returns the current
-       menu term hook, if any (NULL if there is no such hook).
-
-
-
-

RETURN VALUE

-       Routines that return pointers return NULL on error.  Other
-       routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          menu_hook(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_items.3x.html b/doc/html/man/menu_items.3x.html deleted file mode 100644 index 322247a6811..00000000000 --- a/doc/html/man/menu_items.3x.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - -menu_items 3x - - - - -

menu_items 3x

-
-
-
-menu_items(3x)                                           menu_items(3x)
-
-
-
-
-
-

NAME

-       menu_items  - make and break connections between items and
-       menus
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_items(MENU *menu, ITEM **items);
-       ITEM **menu_items(const MENU *menu);
-       int item_count(const MENU *menu);
-
-
-
-

DESCRIPTION

-       The function set_menu_items changes the item pointer array
-       of  the  given  menu.   The  array must be terminated by a
-       NULL.
-
-       The function menu_items returns  the  item  array  of  the
-       given menu.
-
-       The  function  item_count  returns  the  count of items in
-       menu.
-
-
-
-

RETURN VALUES

-       The function menu_items returns a pointer  (which  may  be
-       NULL).  It does not set errno.
-
-       The  function  item_count  returns ERR (the general curses
-       error return value) if its menu parameter is NULL.
-
-       The function set_menu_items returns one of  the  following
-       codes on error:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-       E_POSTED
-            The menu is already posted.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-       The  SVr4  menu  library   documentation   specifies   the
-       item_count error value as -1 (which is the value of ERR).
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                         menu_items(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_mark.3x.html b/doc/html/man/menu_mark.3x.html deleted file mode 100644 index bdeaec69584..00000000000 --- a/doc/html/man/menu_mark.3x.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - -menu_mark 3x - - - - -

menu_mark 3x

-
-
-
-menu_mark(3x)                                             menu_mark(3x)
-
-
-
-
-
-

NAME

-       menu_mark - get and set the menu mark string
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_mark(MENU *menu, const char *mark);
-       const char *menu_mark(const MENU *menu);
-
-
-
-

DESCRIPTION

-       In  order  to make menu selections visible on older termi-
-       nals without highlighting or color  capability,  the  menu
-       library  marks  selected  items  in  a  menu with a prefix
-       string.
-
-       The function set_menu_mark sets the mark  string  for  the
-       given  menu.   Calling set_menu_mark with a null menu item
-       will abolish the mark  string.   Note  that  changing  the
-       length  of  the  mark  string for a menu while the menu is
-       posted is likely to produce unhelpful behavior.
-
-       The default string is "-" (a dash). Calling  set_menu_mark
-       with a non-NULL menu argument will change this default.
-
-       The  function menu_mark returns the menu's mark string (or
-       NULL if there is none).
-
-
-
-

RETURN VALUE

-       The function menu_mark returns a  pointer  (which  may  be
-       NULL).  It does not set errno.
-
-       The  function set_menu_mark may return the following error
-       codes:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          menu_mark(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_new.3x.html b/doc/html/man/menu_new.3x.html deleted file mode 100644 index fde5fcc17ed..00000000000 --- a/doc/html/man/menu_new.3x.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -menu_new 3x - - - - -

menu_new 3x

-
-
-
-menu_new(3x)                                               menu_new(3x)
-
-
-
-
-
-

NAME

-       menu_new - create and destroy menus
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       MENU *new_menu(ITEM **items);
-       int free_menu(MENU *menu);
-
-
-
-

DESCRIPTION

-       The  function  new_menu  creates a new menu connected to a
-       specified item pointer array (which  must  be  NULL-termi-
-       nated).
-
-       The  function  free_menu  disconnects  menu  from its item
-       array and frees the storage allocated for the menu.
-
-
-
-

RETURN VALUE

-       The function new_menu returns  NULL  on  error.   It  sets
-       errno according to the function's failure:
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-       E_SYSTEM_ERROR
-            System error occurred, e.g., malloc failure.
-
-       The function free_menu returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_POSTED
-            The menu has already been posted.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                           menu_new(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_opts.3x.html b/doc/html/man/menu_opts.3x.html deleted file mode 100644 index 7853d4e62bc..00000000000 --- a/doc/html/man/menu_opts.3x.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - -menu_opts 3x - - - - -

menu_opts 3x

-
-
-
-menu_opts(3x)                                             menu_opts(3x)
-
-
-
-
-
-

NAME

-       menu_opts - set and get menu options
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_opts(MENU *menu, Menu_Options opts);
-       int menu_opts_on(MENU *menu, Menu_Options opts);
-       int menu_opts_off(MENU *menu, Menu_Options opts);
-       Menu_Options menu_opts(const MENU *menu);
-
-
-
-

DESCRIPTION

-       The  function  set_menu_opts  sets  all  the  given menu's
-       option bits  (menu  option  bits  may  be  logically-OR'ed
-       together).
-
-       The  function menu_opts_on turns on the given option bits,
-       and leaves others alone.
-
-       The function menu_opts_off  turns  off  the  given  option
-       bits, and leaves others alone.
-
-       The  function  menu_opts returns the menu's current option
-       bits.
-
-       The following options are defined (all are on by default):
-
-       O_ONEVALUE
-            Only one item can be selected for this menu.
-
-       O_SHOWDESC
-            Display  the  item  descriptions  when  the  menu  is
-            posted.
-
-       O_ROWMAJOR
-            Display the menu in row-major order.
-
-       O_IGNORECASE
-            Ignore the case when pattern-matching.
-
-       O_SHOWMATCH
-            Move  the  cursor  to within the item name while pat-
-            tern-matching.
-
-       O_NONCYCLIC
-            Don't  wrap  around  next-item   and   previous-item,
-            requests to the other end of the menu.
-
-
-
-

RETURN VALUE

-       Except for menu_opts, each routine returns one of the fol-
-       lowing:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_POSTED
-            The menu is already posted.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                          menu_opts(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_pattern.3x.html b/doc/html/man/menu_pattern.3x.html deleted file mode 100644 index 88e6cdb9534..00000000000 --- a/doc/html/man/menu_pattern.3x.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - -menu_pattern 3x - - - - -

menu_pattern 3x

-
-
-
-menu_pattern(3x)                                       menu_pattern(3x)
-
-
-
-
-
-

NAME

-       menu_pattern - get and set a menu's pattern buffer
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_pattern(MENU *menu, const char *pattern);
-       char *menu_pattern(const MENU *menu);
-
-
-
-

DESCRIPTION

-       Every  menu  has  an  associated pattern match buffer.  As
-       input events that are printable characters come  in,  they
-       are  appended to this match buffer and tested for a match,
-       as described in menu_driver(3x).
-
-       The function set_menu_pattern sets the pattern buffer  for
-       the  given menu and tries to find the first matching item.
-       If it succeeds, that item becomes  current;  if  not,  the
-       current item does not change.
-
-       The  function  menu_pattern  returns the pattern buffer of
-       the given menu.
-
-
-
-

RETURN VALUE

-       The function menu_pattern returns a pointer, which is NULL
-       if the menu parameter is NULL.  Otherwise, it is a pointer
-       to a string which is empty if no pattern has been set.  It
-       does not set errno.
-
-       The  function  set_menu_pattern  may  return the following
-       error codes:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NOT_CONNECTED
-            No items are connected to menu.
-
-       E_NO_MATCH
-            Character failed to match.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                       menu_pattern(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_post.3x.html b/doc/html/man/menu_post.3x.html deleted file mode 100644 index b8715f23069..00000000000 --- a/doc/html/man/menu_post.3x.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - -menu_post 3x - - - - -

menu_post 3x

-
-
-
-menu_post(3x)                                             menu_post(3x)
-
-
-
-
-
-

NAME

-       menu_post  -  write or erase menus from associated subwin-
-       dows
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int post_menu(MENU *menu);
-       int unpost_menu(MENU *menu);
-
-
-
-

DESCRIPTION

-       The function post_menu displays a menu to  its  associated
-       subwindow.   To trigger physical display of the subwindow,
-       use  refresh  or  some  equivalent  curses  routine   (the
-       implicit  doupdate  triggered  by  an curses input request
-       will do). post_menu resets the  selection  status  of  all
-       items.
-
-       The  function  unpost_menu erases menu from its associated
-       subwindow.
-
-
-
-

RETURN VALUE

-       These routines return one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_POSTED
-            The menu has already been posted.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NO_ROOM
-            Menu is too large for its window. You should consider
-            to use set_menu_format() to solve the problem.
-
-       E_NOT_POSTED
-            The menu has not been posted.
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                          menu_post(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_requestname.3x.html b/doc/html/man/menu_requestname.3x.html deleted file mode 100644 index 54926fd2d1c..00000000000 --- a/doc/html/man/menu_requestname.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -menu_requestname 3x - - - - -

menu_requestname 3x

-
-
-
-menu_requestname(3x)                               menu_requestname(3x)
-
-
-
-
-
-

NAME

-       menu_requestname - handle printable menu request names
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       const char *menu_request_name(int request);
-       int menu_request_by_name(const char *name);
-
-
-
-

DESCRIPTION

-       The  function menu_request_name returns the printable name
-       of a menu request code.
-       The function menu_request_by_name searches in the name-ta-
-       ble  for  a  request  with  the given name and returns its
-       request code.  Otherwise E_NO_MATCH is returned.
-
-
-
-

RETURN VALUE

-       menu_request_name returns NULL on error and sets errno  to
-       E_BAD_ARGUMENT.
-       menu_request_by_name returns E_NO_MATCH on error.  It does
-       not set errno.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  are  specific  to ncurses.  They were not
-       supported on Version 7, BSD or System  V  implementations.
-       It  is recommended that any code depending on them be con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                   menu_requestname(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_spacing.3x.html b/doc/html/man/menu_spacing.3x.html deleted file mode 100644 index 82e857562fd..00000000000 --- a/doc/html/man/menu_spacing.3x.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -menu_spacing 3x - - - - -

menu_spacing 3x

-
-
-
-menu_spacing(3x)                                       menu_spacing(3x)
-
-
-
-
-
-

NAME

-       menu_spacing - Control spacing between menu items.
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_spacing(MENU *menu,
-                            int spc_description,
-                            int spc_rows,
-                            int spc_columns);
-       int menu_spacing(const MENU *menu,
-                        int* spc_description,
-                        int* spc_rows,
-                        int* spc_columns);
-
-
-
-

DESCRIPTION

-       The function set_menu_spacing sets the spacing information
-       for the menu.  Its parameter spc_description controls  the
-       number of spaces between an item name and an item descrip-
-       tion.  It must not be larger than TABSIZE.  The menu  sys-
-       tem  puts in the middle of this spacing area the pad char-
-       acter.  The remaining parts are filled with  spaces.   The
-       spc_rows  parameter  controls  the number of rows that are
-       used for an item.  It must not be larger than 3.  The menu
-       system  inserts  the  blank lines between item rows, these
-       lines will contain the pad character  in  the  appropriate
-       positions.   The spc_columns parameter controls the number
-       of blanks between columns of items.  It must not be larger
-       than  TABSIZE.   A  value  of 0 for all the spacing values
-       resets them to the default, which is 1 for all of them.
-       The function menu_spacing passes back the spacing info for
-       the  menu.   If  a  pointer is NULL, this specific info is
-       simply not returned.
-
-
-
-

RETURN VALUE

-       Both routines return E_OK  on  success.   set_menu_spacing
-       may  return E_POSTED if the menu is posted, or E_BAD_ARGU-
-       MENT if one of the spacing values is out of range.
-
-
-
-

SEE ALSO

-       curses(3x), curs_variables(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  are  specific  to ncurses.  They were not
-       supported on Version 7, BSD or System  V  implementations.
-       It  is recommended that any code depending on them be con-
-       ditioned using NCURSES_VERSION.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                       menu_spacing(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_userptr.3x.html b/doc/html/man/menu_userptr.3x.html deleted file mode 100644 index be4f7d0d555..00000000000 --- a/doc/html/man/menu_userptr.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -menu_userptr 3x - - - - -

menu_userptr 3x

-
-
-
-menu_userptr(3x)                                       menu_userptr(3x)
-
-
-
-
-
-

NAME

-       menu_userptr - associate application data with a menu item
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_userptr(MENU *menu, void *userptr);
-       void *menu_userptr(const MENU *menu);
-
-
-
-

DESCRIPTION

-       Every  menu  and  every  menu item has a field that can be
-       used to hold application-specific data (that is, the menu-
-       driver code leaves it alone).  These functions get and set
-       the menu user pointer field.
-
-
-
-

RETURN VALUE

-       menu_userptr returns a pointer (which may  be  NULL).   It
-       does not set errno.
-
-       set_menu_userptr returns E_OK (success).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       The user pointer is a void pointer.  We chose not to leave
-       it as a char pointer for SVr4 compatibility.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                       menu_userptr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/menu_win.3x.html b/doc/html/man/menu_win.3x.html deleted file mode 100644 index 64e685edfb1..00000000000 --- a/doc/html/man/menu_win.3x.html +++ /dev/null @@ -1,139 +0,0 @@ - - - - -menu_win 3x - - - - -

menu_win 3x

-
-
-
-menu_win(3x)                                               menu_win(3x)
-
-
-
-
-
-

NAME

-       menu_win  - make and break menu window and subwindow asso-
-       ciations
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_menu_win(MENU *menu, WINDOW *win);
-       WINDOW *menu_win(const MENU *menu);
-       int set_menu_sub(MENU *menu, WINDOW *sub);
-       WINDOW *menu_sub(const MENU *menu);
-       int scale_menu(const MENU *menu, int *rows, int *columns);
-
-
-
-

DESCRIPTION

-       Every menu has an associated pair of curses windows.   The
-       menu  window displays any title and border associated with
-       the window; the menu subwindow displays the items  of  the
-       menu that are currently available for selection.
-
-       The first four functions get and set those windows.  It is
-       not necessary to set either window; by default, the driver
-       code uses stdscr for both.
-
-       In  the set_ functions, window argument of NULL is treated
-       as though it were stsdcr.  A  menu  argument  of  NULL  is
-       treated  as  a  request  to change the system default menu
-       window or subwindow.
-
-       The function scale_menu returns the minimum size  required
-       for the subwindow of menu.
-
-
-
-

RETURN VALUE

-       Routines  that return pointers return NULL on error.  Rou-
-       tines that return an integer return one of  the  following
-       error codes:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_POSTED
-            The menu has already been posted.
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-
-
-

SEE ALSO

-       curses(3x), curs_variables(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                           menu_win(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_current.3x.html b/doc/html/man/mitem_current.3x.html deleted file mode 100644 index d496682c722..00000000000 --- a/doc/html/man/mitem_current.3x.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - -mitem_current 3x - - - - -

mitem_current 3x

-
-
-
-mitem_current(3x)                                     mitem_current(3x)
-
-
-
-
-
-

NAME

-       mitem_current - set and get current_menu_item
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_current_item(MENU *menu, const ITEM *item);
-       ITEM *current_item(const MENU *menu);
-       int set_top_row(MENU *menu, int row);
-       int top_row(const MENU *menu);
-       int item_index(const ITEM *item);
-
-
-
-

DESCRIPTION

-       The  function  set_current_item sets the current item (the
-       item on  which  the  menu  cursor  is  positioned).   cur-
-       rent_item  returns  a  pointer  to the current item in the
-       given menu.
-
-       The function set_top_row sets the top row of the  menu  to
-       show  the  given  row  (the top row is initially 0, and is
-       reset to this value whenever the O_ROWMAJOR option is tog-
-       gled).   The  item  leftmost on the given row becomes cur-
-       rent.  The function top_row returns the number of the  top
-       menu row being displayed.
-
-       The function item_index returns the (zero-origin) index of
-       item in the menu's item pointer list.
-
-
-
-

RETURN VALUE

-       current_item returns a pointer (which may  be  NULL).   It
-       does not set errno.
-
-       top_row  and  item_index  return  ERR  (the general curses
-       error value) if their menu parameter is NULL.
-
-       set_current_item and set_top_row return one of the follow-
-       ing:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_BAD_STATE
-            Routine was called from an initialization or termina-
-            tion function.
-
-       E_NOT_CONNECTED
-            No items are connected to the menu.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       The  SVr4 menu library documentation specifies the top_row
-       and index_item error value as -1 (which is  the  value  of
-       ERR).
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                      mitem_current(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_name.3x.html b/doc/html/man/mitem_name.3x.html deleted file mode 100644 index e596bbf2fab..00000000000 --- a/doc/html/man/mitem_name.3x.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - -mitem_name 3x - - - - -

mitem_name 3x

-
-
-
-mitem_name(3x)                                           mitem_name(3x)
-
-
-
-
-
-

NAME

-       mitem_name - get menu item name and description fields
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       const char *item_name(const ITEM *item);
-       const char *item_description(const ITEM *item);
-
-
-
-

DESCRIPTION

-       The  function item_name returns the name part of the given
-       item.
-       The function item_description returns the description part
-       of the given item.
-
-
-
-

RETURN VALUE

-       These routines return a pointer (which may be NULL).  They
-       do not set errno.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                         mitem_name(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_new.3x.html b/doc/html/man/mitem_new.3x.html deleted file mode 100644 index 4b6e1f378ba..00000000000 --- a/doc/html/man/mitem_new.3x.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - -mitem_new 3x - - - - -

mitem_new 3x

-
-
-
-mitem_new(3x)                                             mitem_new(3x)
-
-
-
-
-
-

NAME

-       mitem_new - create and destroy menu items
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       ITEM *new_item(const char *name, const char *description);
-       int free_item(ITEM *item);
-
-
-
-

DESCRIPTION

-       The function new_item allocates a new item and initializes
-       it from the name and description pointers.  Please  notice
-       that  the  item  stores  only the pointers to the name and
-       description. Those pointers must be valid during the life-
-       time of the item. So you should be very careful with names
-       or descriptions allocated on the stack of some routines.
-       The function free_item de-allocates an item. Please notice
-       that  it  is  the  responsibility  of  the  application to
-       release the memory for the name or the description of  the
-       item.
-
-
-
-

RETURN VALUE

-       The  function  new_item  returns  NULL  on error.  It sets
-       errno according to the function's failure:
-
-       E_BAD_ARGUMENT
-            Routine detected an incorrect or  out-of-range  argu-
-            ment.
-
-       E_SYSTEM_ERROR
-            System error occurred, e.g., malloc failure.
-
-       The function free_item returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_BAD_ARGUMENT
-            Routine  detected  an incorrect or out-of-range argu-
-            ment.
-
-       E_CONNECTED
-            Item is connected to a menu.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                          mitem_new(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_opts.3x.html b/doc/html/man/mitem_opts.3x.html deleted file mode 100644 index 27d44a5b0f9..00000000000 --- a/doc/html/man/mitem_opts.3x.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - -mitem_opts 3x - - - - -

mitem_opts 3x

-
-
-
-mitem_opts(3x)                                           mitem_opts(3x)
-
-
-
-
-
-

NAME

-       mitem_opts - set and get menu item options
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_item_opts(ITEM *item, Item_Options opts);
-       int item_opts_on(ITEM *item, Item_Options opts);
-       int item_opts_off(ITEM *item, Item_Options opts);
-       Item_Options item_opts(const ITEM *item);
-
-
-
-

DESCRIPTION

-       The  function  set_item_opts  sets  all  the  given item's
-       option bits  (menu  option  bits  may  be  logically-OR'ed
-       together).
-
-       The  function item_opts_on turns on the given option bits,
-       and leaves others alone.
-
-       The function item_opts_off  turns  off  the  given  option
-       bits, and leaves others alone.
-
-       The  function  item_opts returns the item's current option
-       bits.
-
-       There is only one defined option bit  mask,  O_SELECTABLE.
-       When this is on, the item may be selected during menu pro-
-       cessing.  This option defaults to on.
-
-
-
-

RETURN VALUE

-       Except for item_opts, each routine returns one of the fol-
-       lowing:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
-       curses by Eric S. Raymond.
-
-
-
-                                                         mitem_opts(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_userptr.3x.html b/doc/html/man/mitem_userptr.3x.html deleted file mode 100644 index 5cc957efc98..00000000000 --- a/doc/html/man/mitem_userptr.3x.html +++ /dev/null @@ -1,112 +0,0 @@ - - - - -mitem_userptr 3x - - - - -

mitem_userptr 3x

-
-
-
-mitem_userptr(3x)                                     mitem_userptr(3x)
-
-
-
-
-
-

NAME

-       mitem_userptr  -  associate  application  data with a menu
-       item
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_item_userptr(ITEM *item, void *userptr);
-       void *item_userptr(const ITEM *item);
-
-
-
-

DESCRIPTION

-       Every menu item has a field  that  can  be  used  to  hold
-       application-specific  data  (that is, the menu-driver code
-       leaves it alone).  These functions get and set that field.
-
-
-
-

RETURN VALUE

-       The function  item_userptr  returns  a  pointer  (possibly
-       NULL).  It does not set errno.
-
-       The set_item_userptr always returns E_OK (success).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These routines emulate the System V  menu  library.   They
-       were not supported on Version 7 or BSD versions.
-
-       The user pointer is a void pointer.  We chose not to leave
-       it as a char pointer for SVr4 compatibility.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                      mitem_userptr(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_value.3x.html b/doc/html/man/mitem_value.3x.html deleted file mode 100644 index e68a2b0a3b1..00000000000 --- a/doc/html/man/mitem_value.3x.html +++ /dev/null @@ -1,117 +0,0 @@ - - - - -mitem_value 3x - - - - -

mitem_value 3x

-
-
-
-mitem_value(3x)                                         mitem_value(3x)
-
-
-
-
-
-

NAME

-       mitem_value - set and get menu item values
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       int set_item_value(ITEM *item, bool value);
-       bool item_value(const ITEM *item);
-
-
-
-

DESCRIPTION

-       If  you  turn  off  the menu option O_ONEVALUE (e.g., with
-       set_menu_opts or menu_opts_off;  see  menu_opts(3x)),  the
-       menu becomes multi-valued; that is, more than one item may
-       simultaneously be selected.
-
-       In a multi_valued menu, you  can  used  set_item_value  to
-       select the given menu item (second argument TRUE) or dese-
-       lect it (second argument FALSE).
-
-
-
-

RETURN VALUE

-       The function set_item_value returns one of the following:
-
-       E_OK The routine succeeded.
-
-       E_SYSTEM_ERROR
-            System error occurred (see errno).
-
-       E_REQUEST_DENIED
-            The menu driver could not process the request.
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                        mitem_value(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/mitem_visible.3x.html b/doc/html/man/mitem_visible.3x.html deleted file mode 100644 index 52cdbdbe2b1..00000000000 --- a/doc/html/man/mitem_visible.3x.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - -mitem_visible 3x - - - - -

mitem_visible 3x

-
-
-
-mitem_visible(3x)                                     mitem_visible(3x)
-
-
-
-
-
-

NAME

-       mitem_visible - check visibility of a menu item
-
-
-
-

SYNOPSIS

-       #include <menu.h>
-       bool item_visible(const ITEM *item);
-
-
-
-

DESCRIPTION

-       A  menu  item  is  visible  when it is in the portion of a
-       posted menu that is mapped onto the screen (if the menu is
-       scrollable,  in  particular,  this portion will be smaller
-       than the whole menu).
-
-
-
-

SEE ALSO

-       curses(3x), menu(3x).
-
-
-
-

NOTES

-       The header file <menu.h> automatically includes the header
-       file <curses.h>.
-
-
-
-

PORTABILITY

-       These  routines  emulate  the System V menu library.  They
-       were not supported on Version 7 or BSD versions.
-
-
-
-

AUTHORS

-       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
-       curses by Eric S. Raymond.
-
-
-
-                                                      mitem_visible(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html deleted file mode 100644 index 576b1a15ec4..00000000000 --- a/doc/html/man/ncurses.3x.html +++ /dev/null @@ -1,1267 +0,0 @@ - - - - -ncurses 3x - - - - -

ncurses 3x

-
-
-
-ncurses(3x)                                                 ncurses(3x)
-
-
-
-
-
-

NAME

-       ncurses - CRT screen handling and optimization package
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-
-
-

DESCRIPTION

-       The  ncurses  library  routines  give the user a terminal-
-       independent method of updating character screens with rea-
-       sonable   optimization.    This  implementation  is  ``new
-       curses'' (ncurses) and is  the  approved  replacement  for
-       4.4BSD  classic curses, which has been discontinued.  This
-       describes ncurses version 5.9 (patch 20110404).
-
-       The ncurses library emulates the curses library of  System
-       V  Release  4  UNIX,  and  XPG4 (X/Open Portability Guide)
-       curses (also known as XSI curses).  XSI stands for  X/Open
-       System  Interfaces  Extension.   The  ncurses  library  is
-       freely redistributable in source form.   Differences  from
-       the  SVr4  curses  are summarized under the EXTENSIONS and
-       PORTABILITY sections below and described in detail in  the
-       respective  EXTENSIONS,  PORTABILITY  and BUGS sections of
-       individual man pages.
-
-       The ncurses library also provides many useful  extensions,
-       i.e.,  features  which  cannot  be implemented by a simple
-       add-on library but which require access to  the  internals
-       of the library.
-
-       A  program  using  these  routines must be linked with the
-       -lncurses option, or (if it has been generated)  with  the
-       debugging  library  -lncurses_g.   (Your system integrator
-       may also have installed these libraries  under  the  names
-       -lcurses and -lcurses_g.)  The ncurses_g library generates
-       trace logs (in a file called 'trace' in the current direc-
-       tory)  that describe curses actions.  See also the section
-       on ALTERNATE CONFIGURATIONS.
-
-       The ncurses package supports: overall screen,  window  and
-       pad manipulation; output to windows and pads; reading ter-
-       minal input; control over terminal and  curses  input  and
-       output  options; environment query routines; color manipu-
-       lation; use of soft label keys; terminfo capabilities; and
-       access to low-level terminal-manipulation routines.
-
-       The  library uses the locale which the calling program has
-       initialized.  That is normally done with setlocale:
-
-             setlocale(LC_ALL, "");
-
-       If the locale is not initialized, the library assumes that
-       characters  are  printable  as in ISO-8859-1, to work with
-       certain legacy programs.  You should initialize the locale
-       and  not  rely on specific details of the library when the
-       locale has not been setup.
-
-       The function initscr or newterm must be called to initial-
-       ize the library before any of the other routines that deal
-       with windows and screens are  used.   The  routine  endwin
-       must be called before exiting.
-
-       To  get  character-at-a-time  input  without echoing (most
-       interactive, screen oriented programs want this), the fol-
-       lowing sequence should be used:
-
-             initscr(); cbreak(); noecho();
-
-       Most programs would additionally use the sequence:
-
-             nonl();
-             intrflush(stdscr, FALSE);
-             keypad(stdscr, TRUE);
-
-       Before  a curses program is run, the tab stops of the ter-
-       minal should be set and  its  initialization  strings,  if
-       defined,  must  be  output.  This can be done by executing
-       the tput init command after the shell environment variable
-       TERM  has  been  exported.  tset(1) is usually responsible
-       for doing this.  [See terminfo(5) for further details.]
-
-       The ncurses library permits manipulation  of  data  struc-
-       tures,  called  windows,  which  can be thought of as two-
-       dimensional arrays of characters representing all or  part
-       of a CRT screen.  A default window called stdscr, which is
-       the size of the terminal screen, is supplied.  Others  may
-       be created with newwin.
-
-       Note  that  curses  does  not  handle overlapping windows,
-       that's done by the panel(3x) library.  This means that you
-       can either use stdscr or divide the screen into tiled win-
-       dows and not using stdscr at all.   Mixing  the  two  will
-       result in unpredictable, and undesired, effects.
-
-       Windows are referred to by variables declared as WINDOW *.
-       These  data  structures  are  manipulated  with   routines
-       described  here and elsewhere in the ncurses manual pages.
-       Among those, the most basic routines are move  and  addch.
-       More  general versions of these routines are included with
-       names beginning with w, allowing the  user  to  specify  a
-       window.   The routines not beginning with w affect stdscr.
-
-       After using routines to manipulate a  window,  refresh  is
-       called,  telling curses to make the user's CRT screen look
-       like stdscr.  The characters in a window are  actually  of
-       type  chtype, (character and attribute data) so that other
-       information about the character may also  be  stored  with
-       each character.
-
-       Special  windows  called  pads  may  also  be manipulated.
-       These are windows which are not constrained to the size of
-       the  screen and whose contents need not be completely dis-
-       played.  See curs_pad(3x) for more information.
-
-       In addition to drawing characters  on  the  screen,  video
-       attributes  and colors may be supported, causing the char-
-       acters to show up in such modes as underlined, in  reverse
-       video,  or in color on terminals that support such display
-       enhancements.  Line drawing characters may be specified to
-       be  output.   On  input,  curses is also able to translate
-       arrow and function keys  that  transmit  escape  sequences
-       into  single  values.   The video attributes, line drawing
-       characters,  and  input  values  use  names,  defined   in
-       <curses.h>, such as A_REVERSE, ACS_HLINE, and KEY_LEFT.
-
-       If the environment variables LINES and COLUMNS are set, or
-       if the program is executing in a window environment,  line
-       and  column  information  in the environment will override
-       information read by terminfo.  This would affect a program
-       running  in an AT&T 630 layer, for example, where the size
-       of a screen is changeable (see ENVIRONMENT).
-
-       If the environment variable TERMINFO is defined, any  pro-
-       gram  using  curses checks for a local terminal definition
-       before checking in the standard place.   For  example,  if
-       TERM is set to att4424, then the compiled terminal defini-
-       tion is found in
-
-             /usr/share/terminfo/a/att4424.
-
-       (The a is copied from the first letter of att4424 to avoid
-       creation  of  huge  directories.)  However, if TERMINFO is
-       set to $HOME/myterms, curses first checks
-
-             $HOME/myterms/a/att4424,
-
-       and if that fails, it then checks
-
-             /usr/share/terminfo/a/att4424.
-
-       This is useful for developing experimental definitions  or
-       when write permission in /usr/share/terminfo is not avail-
-       able.
-
-       The integer  variables  LINES  and  COLS  are  defined  in
-       <curses.h>  and will be filled in by initscr with the size
-       of the screen.  The constants TRUE and FALSE have the val-
-       ues 1 and 0, respectively.
-
-       The  curses  routines  also  define  the WINDOW * variable
-       curscr which is used for certain low-level operations like
-       clearing  and  redrawing a screen containing garbage.  The
-       curscr can be used in only a few routines.
-
-   Routine and Argument Names
-       Many curses routines have two or more versions.  The  rou-
-       tines prefixed with w require a window argument.  The rou-
-       tines prefixed with p require a pad argument.  Those with-
-       out a prefix generally use stdscr.
-
-       The routines prefixed with mv require a y and x coordinate
-       to move to before performing the appropriate action.   The
-       mv  routines  imply  a call to move before the call to the
-       other routine.  The coordinate y always refers to the  row
-       (of  the  window), and x always refers to the column.  The
-       upper left-hand corner is always (0,0), not (1,1).
-
-       The routines prefixed with mvw take both a window argument
-       and  x  and  y coordinates.  The window argument is always
-       specified before the coordinates.
-
-       In each case, win is the window affected, and pad  is  the
-       pad affected; win and pad are always pointers to type WIN-
-       DOW.
-
-       Option setting routines require a Boolean flag bf with the
-       value  TRUE  or FALSE; bf is always of type bool.  Most of
-       the data types used in the library routines, such as  WIN-
-       DOW,  SCREEN,  bool, and chtype are defined in <curses.h>.
-       Types used for the terminfo routines such as TERMINAL  are
-       defined in <term.h>.
-
-       This  manual  page describes functions which may appear in
-       any configuration of the library.  There  are  two  common
-       configurations of the library:
-
-              ncurses
-                   the  "normal"  library,  which  handles  8-bit
-                   characters.  The normal (8-bit) library stores
-                   characters  combined with attributes in chtype
-                   data.
-
-                   Attributes alone (no corresponding  character)
-                   may  be  stored  in  chtype  or the equivalent
-                   attr_t data.  In  either  case,  the  data  is
-                   stored in something like an integer.
-
-                   Each  cell  (row  and  column)  in a WINDOW is
-                   stored as a chtype.
-
-              ncursesw
-                   the so-called "wide"  library,  which  handles
-                   multibyte   characters  (see  the  section  on
-                   ALTERNATE CONFIGURATIONS).  The "wide" library
-                   includes  all  of  the calls from the "normal"
-                   library.  It adds about one third  more  calls
-                   using data types which store multibyte charac-
-                   ters:
-
-                   cchar_t
-                        corresponds to chtype.  However it  is  a
-                        structure,  because  more  data is stored
-                        than can fit into an integer.  The  char-
-                        acters are large enough to require a full
-                        integer value - and  there  may  be  more
-                        than  one  character per cell.  The video
-                        attributes and color are stored in  sepa-
-                        rate fields of the structure.
-
-                        Each cell (row and column) in a WINDOW is
-                        stored as a cchar_t.
-
-                   wchar_t
-                        stores a "wide" character.  Like  chtype,
-                        this may be an integer.
-
-                   wint_t
-                        stores  a wchar_t or WEOF - not the same,
-                        though both may have the same size.
-
-                   The  "wide"  library  provides  new  functions
-                   which  are analogous to functions in the "nor-
-                   mal" library.  There is  a  naming  convention
-                   which  relates  many  of the normal/wide vari-
-                   ants: a "_w" is inserted into the  name.   For
-                   example, waddch becomes wadd_wch.
-
-
-   Routine Name Index
-       The following table lists each curses routine and the name
-       of the manual page on which  it  is  described.   Routines
-       flagged  with  `*'  are ncurses-specific, not described by
-       XPG4 or present in SVr4.
-
-
-              curses Routine Name     Manual Page Name
-              --------------------------------------------
-              COLOR_PAIR              curs_color(3x)
-              PAIR_NUMBER             curs_attr(3x)
-              _nc_free_and_exit       curs_memleaks(3x)*
-
-              _nc_freeall             curs_memleaks(3x)*
-              _nc_tracebits           curs_trace(3x)*
-              _traceattr              curs_trace(3x)*
-              _traceattr2             curs_trace(3x)*
-              _tracechar              curs_trace(3x)*
-              _tracechtype            curs_trace(3x)*
-              _tracechtype2           curs_trace(3x)*
-              _tracedump              curs_trace(3x)*
-              _tracef                 curs_trace(3x)*
-              _tracemouse             curs_trace(3x)*
-              add_wch                 curs_add_wch(3x)
-              add_wchnstr             curs_add_wchstr(3x)
-              add_wchstr              curs_add_wchstr(3x)
-              addch                   curs_addch(3x)
-              addchnstr               curs_addchstr(3x)
-              addchstr                curs_addchstr(3x)
-              addnstr                 curs_addstr(3x)
-              addnwstr                curs_addwstr(3x)
-              addstr                  curs_addstr(3x)
-              addwstr                 curs_addwstr(3x)
-              assume_default_colors   default_colors(3x)*
-              attr_get                curs_attr(3x)
-              attr_off                curs_attr(3x)
-              attr_on                 curs_attr(3x)
-              attr_set                curs_attr(3x)
-              attroff                 curs_attr(3x)
-              attron                  curs_attr(3x)
-              attrset                 curs_attr(3x)
-              baudrate                curs_termattrs(3x)
-              beep                    curs_beep(3x)
-              bkgd                    curs_bkgd(3x)
-              bkgdset                 curs_bkgd(3x)
-              bkgrnd                  curs_bkgrnd(3x)
-              bkgrndset               curs_bkgrnd(3x)
-              border                  curs_border(3x)
-              border_set              curs_border_set(3x)
-              box                     curs_border(3x)
-              box_set                 curs_border_set(3x)
-              can_change_color        curs_color(3x)
-              cbreak                  curs_inopts(3x)
-              chgat                   curs_attr(3x)
-              clear                   curs_clear(3x)
-              clearok                 curs_outopts(3x)
-              clrtobot                curs_clear(3x)
-              clrtoeol                curs_clear(3x)
-              color_content           curs_color(3x)
-              color_set               curs_attr(3x)
-              copywin                 curs_overlay(3x)
-              curs_set                curs_kernel(3x)
-              curses_version          curs_extend(3x)*
-              def_prog_mode           curs_kernel(3x)
-              def_shell_mode          curs_kernel(3x)
-              define_key              define_key(3x)*
-              del_curterm             curs_terminfo(3x)
-              delay_output            curs_util(3x)
-              delch                   curs_delch(3x)
-              deleteln                curs_deleteln(3x)
-              delscreen               curs_initscr(3x)
-              delwin                  curs_window(3x)
-              derwin                  curs_window(3x)
-              doupdate                curs_refresh(3x)
-              dupwin                  curs_window(3x)
-              echo                    curs_inopts(3x)
-              echo_wchar              curs_add_wch(3x)
-              echochar                curs_addch(3x)
-
-              endwin                  curs_initscr(3x)
-              erase                   curs_clear(3x)
-              erasechar               curs_termattrs(3x)
-              erasewchar              curs_termattrs(3x)
-              filter                  curs_util(3x)
-              flash                   curs_beep(3x)
-              flushinp                curs_util(3x)
-              get_wch                 curs_get_wch(3x)
-              get_wstr                curs_get_wstr(3x)
-              getattrs                curs_attr(3x)
-              getbegx                 curs_legacy(3x)*
-              getbegy                 curs_legacy(3x)*
-              getbegyx                curs_getyx(3x)
-              getbkgd                 curs_bkgd(3x)
-              getbkgrnd               curs_bkgrnd(3x)
-              getcchar                curs_getcchar(3x)
-              getch                   curs_getch(3x)
-              getcurx                 curs_legacy(3x)*
-              getcury                 curs_legacy(3x)*
-              getmaxx                 curs_legacy(3x)*
-              getmaxy                 curs_legacy(3x)*
-              getmaxyx                curs_getyx(3x)
-              getmouse                curs_mouse(3x)*
-              getn_wstr               curs_get_wstr(3x)
-              getnstr                 curs_getstr(3x)
-              getparx                 curs_legacy(3x)*
-              getpary                 curs_legacy(3x)*
-              getparyx                curs_getyx(3x)
-              getstr                  curs_getstr(3x)
-              getsyx                  curs_kernel(3x)
-              getwin                  curs_util(3x)
-              getyx                   curs_getyx(3x)
-              halfdelay               curs_inopts(3x)
-              has_colors              curs_color(3x)
-              has_ic                  curs_termattrs(3x)
-              has_il                  curs_termattrs(3x)
-              has_key                 curs_getch(3x)*
-              hline                   curs_border(3x)
-              hline_set               curs_border_set(3x)
-              idcok                   curs_outopts(3x)
-              idlok                   curs_outopts(3x)
-              immedok                 curs_outopts(3x)
-              in_wch                  curs_in_wch(3x)
-              in_wchnstr              curs_in_wchstr(3x)
-              in_wchstr               curs_in_wchstr(3x)
-              inch                    curs_inch(3x)
-              inchnstr                curs_inchstr(3x)
-              inchstr                 curs_inchstr(3x)
-              init_color              curs_color(3x)
-              init_pair               curs_color(3x)
-              initscr                 curs_initscr(3x)
-              innstr                  curs_instr(3x)
-              innwstr                 curs_inwstr(3x)
-              ins_nwstr               curs_ins_wstr(3x)
-              ins_wch                 curs_ins_wch(3x)
-              ins_wstr                curs_ins_wstr(3x)
-              insch                   curs_insch(3x)
-              insdelln                curs_deleteln(3x)
-              insertln                curs_deleteln(3x)
-              insnstr                 curs_insstr(3x)
-              insstr                  curs_insstr(3x)
-              instr                   curs_instr(3x)
-              intrflush               curs_inopts(3x)
-              inwstr                  curs_inwstr(3x)
-              is_cleared              curs_opaque(3x)*
-
-              is_idcok                curs_opaque(3x)*
-              is_idlok                curs_opaque(3x)*
-              is_immedok              curs_opaque(3x)*
-              is_keypad               curs_opaque(3x)*
-              is_leaveok              curs_opaque(3x)*
-              is_linetouched          curs_touch(3x)
-              is_nodelay              curs_opaque(3x)*
-              is_notimeout            curs_opaque(3x)*
-              is_scrollok             curs_opaque(3x)*
-              is_syncok               curs_opaque(3x)*
-              is_term_resized         resizeterm(3x)*
-              is_wintouched           curs_touch(3x)
-              isendwin                curs_initscr(3x)
-              key_defined             key_defined(3x)*
-              key_name                curs_util(3x)
-              keybound                keybound(3x)*
-              keyname                 curs_util(3x)
-              keyok                   keyok(3x)*
-              keypad                  curs_inopts(3x)
-              killchar                curs_termattrs(3x)
-              killwchar               curs_termattrs(3x)
-              leaveok                 curs_outopts(3x)
-              longname                curs_termattrs(3x)
-              mcprint                 curs_print(3x)*
-              meta                    curs_inopts(3x)
-              mouse_trafo             curs_mouse(3x)*
-              mouseinterval           curs_mouse(3x)*
-              mousemask               curs_mouse(3x)*
-              move                    curs_move(3x)
-              mvadd_wch               curs_add_wch(3x)
-              mvadd_wchnstr           curs_add_wchstr(3x)
-              mvadd_wchstr            curs_add_wchstr(3x)
-              mvaddch                 curs_addch(3x)
-              mvaddchnstr             curs_addchstr(3x)
-              mvaddchstr              curs_addchstr(3x)
-              mvaddnstr               curs_addstr(3x)
-              mvaddnwstr              curs_addwstr(3x)
-              mvaddstr                curs_addstr(3x)
-              mvaddwstr               curs_addwstr(3x)
-              mvchgat                 curs_attr(3x)
-              mvcur                   curs_terminfo(3x)
-              mvdelch                 curs_delch(3x)
-              mvderwin                curs_window(3x)
-              mvget_wch               curs_get_wch(3x)
-              mvget_wstr              curs_get_wstr(3x)
-              mvgetch                 curs_getch(3x)
-              mvgetn_wstr             curs_get_wstr(3x)
-              mvgetnstr               curs_getstr(3x)
-              mvgetstr                curs_getstr(3x)
-              mvhline                 curs_border(3x)
-              mvhline_set             curs_border_set(3x)
-              mvin_wch                curs_in_wch(3x)
-              mvin_wchnstr            curs_in_wchstr(3x)
-              mvin_wchstr             curs_in_wchstr(3x)
-              mvinch                  curs_inch(3x)
-              mvinchnstr              curs_inchstr(3x)
-              mvinchstr               curs_inchstr(3x)
-              mvinnstr                curs_instr(3x)
-              mvinnwstr               curs_inwstr(3x)
-              mvins_nwstr             curs_ins_wstr(3x)
-              mvins_wch               curs_ins_wch(3x)
-              mvins_wstr              curs_ins_wstr(3x)
-              mvinsch                 curs_insch(3x)
-              mvinsnstr               curs_insstr(3x)
-              mvinsstr                curs_insstr(3x)
-
-              mvinstr                 curs_instr(3x)
-              mvinwstr                curs_inwstr(3x)
-              mvprintw                curs_printw(3x)
-              mvscanw                 curs_scanw(3x)
-              mvvline                 curs_border(3x)
-              mvvline_set             curs_border_set(3x)
-              mvwadd_wch              curs_add_wch(3x)
-              mvwadd_wchnstr          curs_add_wchstr(3x)
-              mvwadd_wchstr           curs_add_wchstr(3x)
-              mvwaddch                curs_addch(3x)
-              mvwaddchnstr            curs_addchstr(3x)
-              mvwaddchstr             curs_addchstr(3x)
-              mvwaddnstr              curs_addstr(3x)
-              mvwaddnwstr             curs_addwstr(3x)
-              mvwaddstr               curs_addstr(3x)
-              mvwaddwstr              curs_addwstr(3x)
-              mvwchgat                curs_attr(3x)
-              mvwdelch                curs_delch(3x)
-              mvwget_wch              curs_get_wch(3x)
-              mvwget_wstr             curs_get_wstr(3x)
-              mvwgetch                curs_getch(3x)
-              mvwgetn_wstr            curs_get_wstr(3x)
-              mvwgetnstr              curs_getstr(3x)
-              mvwgetstr               curs_getstr(3x)
-              mvwhline                curs_border(3x)
-              mvwhline_set            curs_border_set(3x)
-              mvwin                   curs_window(3x)
-              mvwin_wch               curs_in_wch(3x)
-              mvwin_wchnstr           curs_in_wchstr(3x)
-              mvwin_wchstr            curs_in_wchstr(3x)
-              mvwinch                 curs_inch(3x)
-              mvwinchnstr             curs_inchstr(3x)
-              mvwinchstr              curs_inchstr(3x)
-              mvwinnstr               curs_instr(3x)
-              mvwinnwstr              curs_inwstr(3x)
-              mvwins_nwstr            curs_ins_wstr(3x)
-              mvwins_wch              curs_ins_wch(3x)
-              mvwins_wstr             curs_ins_wstr(3x)
-              mvwinsch                curs_insch(3x)
-              mvwinsnstr              curs_insstr(3x)
-              mvwinsstr               curs_insstr(3x)
-              mvwinstr                curs_instr(3x)
-              mvwinwstr               curs_inwstr(3x)
-              mvwprintw               curs_printw(3x)
-              mvwscanw                curs_scanw(3x)
-              mvwvline                curs_border(3x)
-              mvwvline_set            curs_border_set(3x)
-              napms                   curs_kernel(3x)
-              newpad                  curs_pad(3x)
-              newterm                 curs_initscr(3x)
-              newwin                  curs_window(3x)
-              nl                      curs_outopts(3x)
-              nocbreak                curs_inopts(3x)
-              nodelay                 curs_inopts(3x)
-              noecho                  curs_inopts(3x)
-              nofilter                curs_util(3x)*
-              nonl                    curs_outopts(3x)
-              noqiflush               curs_inopts(3x)
-              noraw                   curs_inopts(3x)
-              notimeout               curs_inopts(3x)
-              overlay                 curs_overlay(3x)
-              overwrite               curs_overlay(3x)
-              pair_content            curs_color(3x)
-              pechochar               curs_pad(3x)
-              pnoutrefresh            curs_pad(3x)
-
-              prefresh                curs_pad(3x)
-              printw                  curs_printw(3x)
-              putp                    curs_terminfo(3x)
-              putwin                  curs_util(3x)
-              qiflush                 curs_inopts(3x)
-              raw                     curs_inopts(3x)
-              redrawwin               curs_refresh(3x)
-              refresh                 curs_refresh(3x)
-              reset_prog_mode         curs_kernel(3x)
-              reset_shell_mode        curs_kernel(3x)
-              resetty                 curs_kernel(3x)
-              resizeterm              resizeterm(3x)*
-              restartterm             curs_terminfo(3x)
-              ripoffline              curs_kernel(3x)
-              savetty                 curs_kernel(3x)
-              scanw                   curs_scanw(3x)
-              scr_dump                curs_scr_dump(3x)
-              scr_init                curs_scr_dump(3x)
-              scr_restore             curs_scr_dump(3x)
-              scr_set                 curs_scr_dump(3x)
-              scrl                    curs_scroll(3x)
-              scroll                  curs_scroll(3x)
-              scrollok                curs_outopts(3x)
-              set_curterm             curs_terminfo(3x)
-              set_term                curs_initscr(3x)
-              setcchar                curs_getcchar(3x)
-              setscrreg               curs_outopts(3x)
-              setsyx                  curs_kernel(3x)
-              setterm                 curs_terminfo(3x)
-              setupterm               curs_terminfo(3x)
-              slk_attr                curs_slk(3x)*
-              slk_attr_off            curs_slk(3x)
-              slk_attr_on             curs_slk(3x)
-              slk_attr_set            curs_slk(3x)
-              slk_attroff             curs_slk(3x)
-              slk_attron              curs_slk(3x)
-              slk_attrset             curs_slk(3x)
-              slk_clear               curs_slk(3x)
-              slk_color               curs_slk(3x)
-              slk_init                curs_slk(3x)
-              slk_label               curs_slk(3x)
-              slk_noutrefresh         curs_slk(3x)
-              slk_refresh             curs_slk(3x)
-              slk_restore             curs_slk(3x)
-              slk_set                 curs_slk(3x)
-              slk_touch               curs_slk(3x)
-              standend                curs_attr(3x)
-              standout                curs_attr(3x)
-              start_color             curs_color(3x)
-              subpad                  curs_pad(3x)
-              subwin                  curs_window(3x)
-              syncok                  curs_window(3x)
-              term_attrs              curs_termattrs(3x)
-              termattrs               curs_termattrs(3x)
-              termname                curs_termattrs(3x)
-              tgetent                 curs_termcap(3x)
-              tgetflag                curs_termcap(3x)
-              tgetnum                 curs_termcap(3x)
-              tgetstr                 curs_termcap(3x)
-              tgoto                   curs_termcap(3x)
-              tigetflag               curs_terminfo(3x)
-              tigetnum                curs_terminfo(3x)
-              tigetstr                curs_terminfo(3x)
-              timeout                 curs_inopts(3x)
-              touchline               curs_touch(3x)
-
-              touchwin                curs_touch(3x)
-              tparm                   curs_terminfo(3x)
-              tputs                   curs_termcap(3x)
-              tputs                   curs_terminfo(3x)
-              trace                   curs_trace(3x)*
-              typeahead               curs_inopts(3x)
-              unctrl                  curs_util(3x)
-              unget_wch               curs_get_wch(3x)
-              ungetch                 curs_getch(3x)
-              ungetmouse              curs_mouse(3x)*
-              untouchwin              curs_touch(3x)
-              use_default_colors      default_colors(3x)*
-              use_env                 curs_util(3x)
-              use_extended_names      curs_extend(3x)*
-              use_legacy_coding       legacy_coding(3x)*
-              vid_attr                curs_terminfo(3x)
-              vid_puts                curs_terminfo(3x)
-              vidattr                 curs_terminfo(3x)
-              vidputs                 curs_terminfo(3x)
-              vline                   curs_border(3x)
-              vline_set               curs_border_set(3x)
-              vw_printw               curs_printw(3x)
-              vw_scanw                curs_scanw(3x)
-              vwprintw                curs_printw(3x)
-              vwscanw                 curs_scanw(3x)
-              wadd_wch                curs_add_wch(3x)
-              wadd_wchnstr            curs_add_wchstr(3x)
-              wadd_wchstr             curs_add_wchstr(3x)
-              waddch                  curs_addch(3x)
-              waddchnstr              curs_addchstr(3x)
-              waddchstr               curs_addchstr(3x)
-              waddnstr                curs_addstr(3x)
-              waddnwstr               curs_addwstr(3x)
-              waddstr                 curs_addstr(3x)
-              waddwstr                curs_addwstr(3x)
-              wattr_get               curs_attr(3x)
-              wattr_off               curs_attr(3x)
-              wattr_on                curs_attr(3x)
-              wattr_set               curs_attr(3x)
-              wattroff                curs_attr(3x)
-              wattron                 curs_attr(3x)
-              wattrset                curs_attr(3x)
-              wbkgd                   curs_bkgd(3x)
-              wbkgdset                curs_bkgd(3x)
-              wbkgrnd                 curs_bkgrnd(3x)
-              wbkgrndset              curs_bkgrnd(3x)
-              wborder                 curs_border(3x)
-              wborder_set             curs_border_set(3x)
-              wchgat                  curs_attr(3x)
-              wclear                  curs_clear(3x)
-              wclrtobot               curs_clear(3x)
-              wclrtoeol               curs_clear(3x)
-              wcolor_set              curs_attr(3x)
-              wcursyncup              curs_window(3x)
-              wdelch                  curs_delch(3x)
-              wdeleteln               curs_deleteln(3x)
-              wecho_wchar             curs_add_wch(3x)
-              wechochar               curs_addch(3x)
-              wenclose                curs_mouse(3x)*
-              werase                  curs_clear(3x)
-              wget_wch                curs_get_wch(3x)
-              wget_wstr               curs_get_wstr(3x)
-              wgetbkgrnd              curs_bkgrnd(3x)
-              wgetch                  curs_getch(3x)
-              wgetn_wstr              curs_get_wstr(3x)
-
-              wgetnstr                curs_getstr(3x)
-              wgetstr                 curs_getstr(3x)
-              whline                  curs_border(3x)
-              whline_set              curs_border_set(3x)
-              win_wch                 curs_in_wch(3x)
-              win_wchnstr             curs_in_wchstr(3x)
-              win_wchstr              curs_in_wchstr(3x)
-              winch                   curs_inch(3x)
-              winchnstr               curs_inchstr(3x)
-              winchstr                curs_inchstr(3x)
-              winnstr                 curs_instr(3x)
-              winnwstr                curs_inwstr(3x)
-              wins_nwstr              curs_ins_wstr(3x)
-              wins_wch                curs_ins_wch(3x)
-              wins_wstr               curs_ins_wstr(3x)
-              winsch                  curs_insch(3x)
-              winsdelln               curs_deleteln(3x)
-              winsertln               curs_deleteln(3x)
-              winsnstr                curs_insstr(3x)
-              winsstr                 curs_insstr(3x)
-              winstr                  curs_instr(3x)
-              winwstr                 curs_inwstr(3x)
-              wmouse_trafo            curs_mouse(3x)*
-              wmove                   curs_move(3x)
-              wnoutrefresh            curs_refresh(3x)
-              wprintw                 curs_printw(3x)
-              wredrawln               curs_refresh(3x)
-              wrefresh                curs_refresh(3x)
-              wresize                 wresize(3x)*
-              wscanw                  curs_scanw(3x)
-              wscrl                   curs_scroll(3x)
-              wsetscrreg              curs_outopts(3x)
-              wstandend               curs_attr(3x)
-              wstandout               curs_attr(3x)
-              wsyncdown               curs_window(3x)
-              wsyncup                 curs_window(3x)
-              wtimeout                curs_inopts(3x)
-              wtouchln                curs_touch(3x)
-              wunctrl                 curs_util(3x)
-              wvline                  curs_border(3x)
-              wvline_set              curs_border_set(3x)
-
-
-
-

RETURN VALUE

-       Routines that return an integer return  ERR  upon  failure
-       and  an  integer value other than ERR upon successful com-
-       pletion, unless otherwise noted in  the  routine  descrip-
-       tions.
-
-       All  macros  return  the  value  of  the w version, except
-       setscrreg, wsetscrreg, getyx, getbegyx, and getmaxyx.  The
-       return  values  of setscrreg, wsetscrreg, getyx, getbegyx,
-       and getmaxyx are undefined (i.e., these should not be used
-       as the right-hand side of assignment statements).
-
-       Routines that return pointers return NULL on error.
-
-
-
-

ENVIRONMENT

-       The following environment symbols are useful for customiz-
-       ing the runtime behavior of the ncurses library.  The most
-       important ones have been already discussed in detail.
-
-       BAUDRATE
-            The  debugging library checks this environment symbol
-            when the application has redirected output to a file.
-            The  symbol's numeric value is used for the baudrate.
-            If no value is found, ncurses uses 9600.  This allows
-            testers  to construct repeatable test-cases that take
-            into account costs that depend on baudrate.
-
-       CC   When set, change occurrences of the command_character
-            (i.e.,  the  cmdch capability) of the loaded terminfo
-            entries to the value of this symbol.  Very  few  ter-
-            minfo entries provide this feature.
-
-            Because  this  name is also used in development envi-
-            ronments to represent the C compiler's name,  ncurses
-            ignores it if it does not happen to be a single char-
-            acter.
-
-       COLUMNS
-            Specify  the  width  of  the  screen  in  characters.
-            Applications  running in a windowing environment usu-
-            ally are able to obtain the width of  the  window  in
-            which  they  are  executing.   If neither the COLUMNS
-            value nor the terminal's screen  size  is  available,
-            ncurses  uses  the size which may be specified in the
-            terminfo database (i.e., the cols capability).
-
-            It is important that your application use  a  correct
-            size  for  the  screen.   This is not always possible
-            because your application may be  running  on  a  host
-            which  does not honor NAWS (Negotiations About Window
-            Size), or because  you  are  temporarily  running  as
-            another  user.  However, setting COLUMNS and/or LINES
-            overrides  the  library's  use  of  the  screen  size
-            obtained from the operating system.
-
-            Either  COLUMNS  or  LINES  symbols  may be specified
-            independently.  This is mainly useful  to  circumvent
-            legacy  misfeatures  of  terminal descriptions, e.g.,
-            xterm which commonly specifies a 65 line screen.  For
-            best  results, lines and cols should not be specified
-            in a terminal description for terminals which are run
-            as emulations.
-
-            Use the use_env function to disable all use of exter-
-            nal environment (including system calls) to determine
-            the screen size.
-
-       ESCDELAY
-            Specifies  the total time, in milliseconds, for which
-            ncurses will await  a  character  sequence,  e.g.,  a
-            function  key.  The default value, 1000 milliseconds,
-            is enough for most uses.  However, it is made a vari-
-            able to accommodate unusual applications.
-
-            The most common instance where you may wish to change
-            this value is to work with slow hosts, e.g.,  running
-            on  a  network.   If  the host cannot read characters
-            rapidly enough, it will have the same  effect  as  if
-            the  terminal did not send characters rapidly enough.
-            The library will still see a timeout.
-
-            Note that xterm mouse events are built up from  char-
-            acter  sequences  received  from  the xterm.  If your
-            application makes heavy use of multiple-clicking, you
-            may  wish  to lengthen this default value because the
-            timeout applies to the composed multi-click event  as
-            well as the individual clicks.
-
-            In  addition to the environment variable, this imple-
-            mentation provides a global variable  with  the  same
-            name.  Portable applications should not rely upon the
-            presence of ESCDELAY in either form, but setting  the
-            environment  variable rather than the global variable
-            does not create problems when compiling  an  applica-
-            tion.
-
-       HOME Tells  ncurses where your home directory is.  That is
-            where  it  may  read  and  write  auxiliary  terminal
-            descriptions:
-
-            $HOME/.termcap
-            $HOME/.terminfo
-
-       LINES
-            Like  COLUMNS,  specify  the  height of the screen in
-            characters.  See COLUMNS for a detailed  description.
-
-       MOUSE_BUTTONS_123
-            This applies only to the OS/2 EMX port.  It specifies
-            the order of buttons on the mouse.   OS/2  numbers  a
-            3-button mouse inconsistently from other platforms:
-
-            1 = left
-            2 = right
-            3 = middle.
-
-            This symbol lets you customize the mouse.  The symbol
-            must be three numeric digits 1-3 in any order,  e.g.,
-            123  or  321.   If  it is not specified, ncurses uses
-            132.
-
-       NCURSES_ASSUMED_COLORS
-            Override the compiled-in assumption that  the  termi-
-            nal's   default   colors   are   white-on-black  (see
-            default_colors(3x)).  You may set the foreground  and
-            background  color  values with this environment vari-
-            able by proving a  2-element  list:  foreground,back-
-            ground.   For  example, to tell ncurses to not assume
-            anything about the colors, set this to  "-1,-1".   To
-            make  it  green-on-black, set it to "2,0".  Any posi-
-            tive value from zero to the terminfo max_colors value
-            is allowed.
-
-       NCURSES_GPM_TERMS
-            This  applies  only  to ncurses configured to use the
-            GPM interface.
-
-            If present, the environment variable is a list of one
-            or  more  terminal names against which the TERM envi-
-            ronment variable is matched.  Setting it to an  empty
-            value  disables the GPM interface; using the built-in
-            support for xterm, etc.
-
-            If the environment variable is absent,  ncurses  will
-            attempt to open GPM if TERM contains "linux".
-
-       NCURSES_NO_HARD_TABS
-            Ncurses  may  use tabs as part of the cursor movement
-            optimization.  In some cases,  your  terminal  driver
-            may  not handle these properly.  Set this environment
-            variable to disable the feature.  You can also adjust
-            your stty settings to avoid the problem.
-
-       NCURSES_NO_MAGIC_COOKIES
-            Some  terminals  use  a  magic-cookie  feature  which
-            requires special handling to  make  highlighting  and
-            other  video  attributes  display  properly.  You can
-            suppress the highlighting entirely for  these  termi-
-            nals by setting this environment variable.
-
-       NCURSES_NO_PADDING
-            Most  of  the  terminal  descriptions in the terminfo
-            database are written for real  "hardware"  terminals.
-            Many  people  use  terminal  emulators which run in a
-            windowing environment and use  curses-based  applica-
-            tions.   Terminal  emulators can duplicate all of the
-            important aspects of a hardware terminal, but they do
-            not  have the same limitations.  The chief limitation
-            of a hardware terminal from the  standpoint  of  your
-            application is the management of dataflow, i.e., tim-
-            ing.  Unless a hardware terminal is interfaced into a
-            terminal  concentrator  (which does flow control), it
-            (or your application) must manage dataflow,  prevent-
-            ing  overruns.   The  cheapest  solution (no hardware
-            cost) is for your program to do this by pausing after
-            operations  that  the  terminal  does slowly, such as
-            clearing the display.
-
-            As a result, many  terminal  descriptions  (including
-            the  vt100)  have delay times embedded.  You may wish
-            to use these descriptions, but not want  to  pay  the
-            performance penalty.
-
-            Set  the NCURSES_NO_PADDING symbol to disable all but
-            mandatory padding.  Mandatory padding is  used  as  a
-            part of special control sequences such as flash.
-
-       NCURSES_NO_SETBUF
-            Normally  ncurses enables buffered output during ter-
-            minal initialization.   This  is  done  (as  in  SVr4
-            curses)  for  performance  reasons.  For testing pur-
-            poses, both of ncurses and certain applications, this
-            feature    is    made    optional.     Setting    the
-            NCURSES_NO_SETBUF variable disables output buffering,
-            leaving  the  output  in  the  original (usually line
-            buffered) mode.
-
-       NCURSES_NO_UTF8_ACS
-            During initialization, the ncurses library checks for
-            special  cases where VT100 line-drawing (and the cor-
-            responding  alternate  character  set   capabilities)
-            described  in  the  terminfo are known to be missing.
-            Specifically, when running in  a  UTF-8  locale,  the
-            Linux  console  emulator  and  the GNU screen program
-            ignore these.  Ncurses checks  the  TERM  environment
-            variable  for  these.   For  other special cases, you
-            should set this  environment  variable.   Doing  this
-            tells  ncurses to use Unicode values which correspond
-            to the VT100 line-drawing glyphs.  That works for the
-            special cases cited, and is likely to work for termi-
-            nal emulators.
-
-            When setting this variable, you should set  it  to  a
-            nonzero  value.   Setting it to zero (or to a nonnum-
-            ber) disables  the  special  check  for  "linux"  and
-            "screen".
-
-            As   an  alternative  to  the  environment  variable,
-            ncurses checks for an  extended  terminfo  capability
-            U8.   This  is a numeric capability which can be com-
-            piled using tic -x.  For example
-
-            # linux console, if patched to provide working
-            # VT100 shift-in/shift-out, with corresponding font.
-            linux-vt100|linux console with VT100 line-graphics,
-                                 U8#0, use=linux,
-
-            # uxterm with vt100Graphics resource set to false
-            xterm-utf8|xterm relying on UTF-8 line-graphics,
-                                 U8#1, use=xterm,
-
-            The name "U8" is chosen to be two characters, to per-
-            mit  it  to be used by applications that use ncurses'
-            termcap interface.
-
-       NCURSES_TRACE
-            During initialization, the ncurses debugging  library
-            checks  the  NCURSES_TRACE symbol.  If it is defined,
-            to a numeric value, ncurses calls the trace function,
-            using that value as the argument.
-
-            The  argument  values, which are defined in curses.h,
-            provide several types of information.   When  running
-            with  traces enabled, your application will write the
-            file trace to the current directory.
-
-       TERM Denotes your terminal type.  Each  terminal  type  is
-            distinct, though many are similar.
-
-       TERMCAP
-            If the ncurses library has been configured with term-
-            cap support, ncurses  will  check  for  a  terminal's
-            description in termcap form if it is not available in
-            the terminfo database.
-
-            The  TERMCAP  symbol  contains  either   a   terminal
-            description  (with  newlines stripped out), or a file
-            name telling where the  information  denoted  by  the
-            TERM  symbol  exists.   In  either  case,  setting it
-            directs ncurses to ignore the usual  place  for  this
-            information, e.g., /etc/termcap.
-
-       TERMINFO
-            Overrides the directory in which ncurses searches for
-            your terminal description.  This is the simplest, but
-            not  the  only way to change the list of directories.
-            The complete list of directories in order follows:
-
-            o   the last directory to  which  ncurses  wrote,  if
-                any, is searched first
-
-            o   the directory specified by the TERMINFO symbol
-
-            o   $HOME/.terminfo
-
-            o   directories listed in the TERMINFO_DIRS symbol
-
-            o   one  or  more directories whose names are config-
-                ured and compiled into the ncurses library, e.g.,
-                /usr/share/terminfo
-
-       TERMINFO_DIRS
-            Specifies  a list of directories to search for termi-
-            nal descriptions.  The list is  separated  by  colons
-            (i.e.,  ":") on Unix, semicolons on OS/2 EMX.  All of
-            the terminal descriptions are in terminfo form, which
-            makes  a  subdirectory  named for the first letter of
-            the terminal names therein.
-
-       TERMPATH
-            If TERMCAP does not hold a  file  name  then  ncurses
-            checks  the TERMPATH symbol.  This is a list of file-
-            names separated by spaces or colons  (i.e.,  ":")  on
-            Unix, semicolons on OS/2 EMX.  If the TERMPATH symbol
-            is not set, ncurses looks in the files  /etc/termcap,
-            /usr/share/misc/termcap  and  $HOME/.termcap, in that
-            order.
-
-       The library may be configured to disregard  the  following
-       variables  when  the current user is the superuser (root),
-       or if the application uses setuid or  setgid  permissions:
-       $TERMINFO, $TERMINFO_DIRS, $TERMPATH, as well as $HOME.
-
-
-
-

ALTERNATE CONFIGURATIONS

-       Several  different  configurations are possible, depending
-       on  the  configure  script  options  used  when   building
-       ncurses.   There  are a few main options whose effects are
-       visible to the applications developer using ncurses:
-
-       --disable-overwrite
-            The standard include for ncurses is as noted in  SYN-
-            OPSIS:
-
-            #include <curses.h>
-
-            This  option is used to avoid filename conflicts when
-            ncurses is not the main implementation of  curses  of
-            the  computer.   If  ncurses  is  installed disabling
-            overwrite, it puts its  headers  in  a  subdirectory,
-            e.g.,
-
-            #include <ncurses/curses.h>
-
-            It  also  omits a symbolic link which would allow you
-            to use -lcurses to build executables.
-
-       --enable-widec
-            The configure script renames the library and (if  the
-            --disable-overwrite  option  is used) puts the header
-            files  in  a  different  subdirectory.   All  of  the
-            library  names  have  a  "w"  appended to them, i.e.,
-            instead of
-
-            -lncurses
-
-            you link with
-
-            -lncursesw
-
-            You must also define _XOPEN_SOURCE_EXTENDED when com-
-            piling  for  the  wide-character  library  to use the
-            extended (wide-character)  functions.   The  curses.h
-            file   which  is  installed  for  the  wide-character
-            library is designed to be compatible with the  normal
-            library's header.  Only the size of the WINDOW struc-
-            ture differs, and very few applications require  more
-            than  a  pointer  to  WINDOWs.   If  the  headers are
-            installed  allowing  overwrite,  the   wide-character
-            library's  headers should be installed last, to allow
-            applications to be built using  either  library  from
-            the same set of headers.
-
-       --with-shared
-
-       --with-normal
-
-       --with-debug
-
-       --with-profile
-            The  shared  and normal (static) library names differ
-            by   their   suffixes,   e.g.,   libncurses.so    and
-            libncurses.a.   The debug and profiling libraries add
-            a "_g" and a "_p" to  the  root  names  respectively,
-            e.g., libncurses_g.a and libncurses_p.a.
-
-       --with-trace
-            The  trace  function  normally  resides  in the debug
-            library, but it is sometimes useful to configure this
-            in  the  shared  library.   Configure  scripts should
-            check for the function's existence rather than assum-
-            ing it is always in the debug library.
-
-
-
-

FILES

-       /usr/share/tabset
-            directory  containing  initialization  files  for the
-            terminal capability database /usr/share/terminfo ter-
-            minal capability database
-
-
-
-

SEE ALSO

-       terminfo(5)  and  related  pages whose names begin "curs_"
-       for detailed routine descriptions.
-       curs_variables(3x)
-
-
-
-

EXTENSIONS

-       The  ncurses  library  can  be  compiled  with  an  option
-       (-DUSE_GETCAP) that falls back to the old-style /etc/term-
-       cap file if the terminal setup code cannot find a terminfo
-       entry  corresponding  to TERM.  Use of this feature is not
-       recommended, as it essentially includes an entire  termcap
-       compiler  in the ncurses startup code, at significant cost
-       in core and startup cycles.
-
-       The ncurses  library  includes  facilities  for  capturing
-       mouse  events on certain terminals (including xterm).  See
-       the curs_mouse(3x) manual page for details.
-
-       The ncurses library includes facilities for responding  to
-       window  resizing  events,  e.g., when running in an xterm.
-       See the resizeterm(3x) and wresize(3x)  manual  pages  for
-       details.   In addition, the library may be configured with
-       a SIGWINCH handler.
-
-       The ncurses library extends the fixed set of function  key
-       capabilities  of  terminals  by  allowing  the application
-       designer to define additional key  sequences  at  runtime.
-       See the define_key(3x) key_defined(3x), and keyok(3x) man-
-       ual pages for details.
-
-       The ncurses library can exploit the capabilities of termi-
-       nals  which  implement the ISO-6429 SGR 39 and SGR 49 con-
-       trols, which allow an application to reset the terminal to
-       its  original  foreground and background colors.  From the
-       users' perspective, the application is able to  draw  col-
-       ored  text  on  a  background  whose color is set indepen-
-       dently, providing better  control  over  color  contrasts.
-       See the default_colors(3x) manual page for details.
-
-       The  ncurses  library  includes  a  function for directing
-       application output to a printer attached to  the  terminal
-       device.  See the curs_print(3x) manual page for details.
-
-
-
-

PORTABILITY

-       The  ncurses  library is intended to be BASE-level confor-
-       mant with XSI Curses.  The EXTENDED XSI Curses functional-
-       ity (including color support) is supported.
-
-       A  small  number of local differences (that is, individual
-       differences between the XSI Curses and ncurses calls)  are
-       described  in  PORTABILITY  sections  of  the  library man
-       pages.
-
-       This implementation also contains several extensions:
-
-       o   The routine has_key is not part of  XPG4,  nor  is  it
-           present  in  SVr4.  See the curs_getch(3x) manual page
-           for details.
-
-       o   The routine slk_attr is not part of XPG4,  nor  is  it
-           present in SVr4.  See the curs_slk(3x) manual page for
-           details.
-
-       o   The routines getmouse, mousemask, ungetmouse, mousein-
-           terval, and wenclose relating to mouse interfacing are
-           not part of XPG4, nor are they present in  SVr4.   See
-           the curs_mouse(3x) manual page for details.
-
-       o   The  routine  mcprint  was not present in any previous
-           curses implementation.  See the curs_print(3x)  manual
-           page for details.
-
-       o   The  routine  wresize  is  not part of XPG4, nor is it
-           present in SVr4.  See the wresize(3x) manual page  for
-           details.
-
-       o   The  WINDOW structure's internal details can be hidden
-           from application programs.   See  curs_opaque(3x)  for
-           the discussion of is_scrollok, etc.
-
-       o   This implementation can be configured to provide rudi-
-           mentary support for multi-threaded applications.   See
-           curs_threads(3x) for details.
-
-       o   This  implementation can also be configured to provide
-           a set of functions which improve the ability to manage
-           multiple  screens.  See curs_sp_funcs(3x) for details.
-
-       In historic curses versions, delays embedded in the  capa-
-       bilities cr, ind, cub1, ff and tab activated corresponding
-       delay bits in the UNIX tty driver.   In  this  implementa-
-       tion,  all  padding  is  done  by sending NUL bytes.  This
-       method is slightly more expensive, but narrows the  inter-
-       face  to  the  UNIX kernel significantly and increases the
-       package's portability correspondingly.
-
-
-
-

NOTES

-       The header  file  <curses.h>  automatically  includes  the
-       header files <stdio.h> and <unctrl.h>.
-
-       If  standard  output from a ncurses program is re-directed
-       to something which is not a tty, screen  updates  will  be
-       directed to standard error.  This was an undocumented fea-
-       ture of AT&T System V Release 3 curses.
-
-
-
-

AUTHORS

-       Zeyd M. Ben-Halim, Eric  S.  Raymond,  Thomas  E.  Dickey.
-       Based on pcurses by Pavel Curtis.
-
-
-
-                                                            ncurses(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/ncurses5-config.1.html b/doc/html/man/ncurses5-config.1.html deleted file mode 100644 index 2169bb90802..00000000000 --- a/doc/html/man/ncurses5-config.1.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - -ncurses5-config 1 - - - - -

ncurses5-config 1

-
-
-
-ncurses5-config(1)                                   ncurses5-config(1)
-
-
-
-
-
-

NAME

-       ncurses5-config - helper script for ncurses libraries
-
-
-
-

SYNOPSIS

-       ncurses5-config [options]
-
-
-
-

DESCRIPTION

-       This is a shell script which simplifies configuring appli-
-       cations against a particular set of ncurses libraries.
-
-
-
-

OPTIONS

-       --prefix
-              echos the package-prefix of ncurses
-
-       --exec-prefix
-              echos the executable-prefix of ncurses
-
-       --cflags
-              echos the C compiler flags needed to  compile  with
-              ncurses
-
-       --libs echos the libraries needed to link with ncurses
-
-       --version
-              echos the release+patchdate version of ncurses
-
-       --abi-version
-              echos the ABI version of ncurses
-
-       --mouse-version
-              echos the mouse-interface version of ncurses
-
-       --bindir
-              echos the directory containing ncurses programs
-
-       --datadir
-              echos the directory containing ncurses data
-
-       --includedir
-              echos the directory containing ncurses header files
-
-       --libdir
-              echos the directory containing ncurses libraries
-
-       --mandir
-              echos the directory containing ncurses manpages
-
-       --terminfo
-              echos the $TERMINFO terminfo database path, e.g.,
-              /usr/share/terminfo
-
-       --terminfo-dirs
-              echos the $TERMINFO_DIRS directory list, e.g.,
-              /usr/local/ncurses/lib/terminfo:/usr/share/terminfo
-
-       --termpath
-              echos  the  $TERMPATH  termcap list, if support for
-              termcap is configured.
-
-       --help prints this message
-
-
-
-

SEE ALSO

-       curses(3x)
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                     ncurses5-config(1)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html deleted file mode 100644 index c73e2416272..00000000000 --- a/doc/html/man/panel.3x.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - -panel 3x - - - - -

panel 3x

-
-
-
-panel(3x)                                                     panel(3x)
-
-
-
-
-
-

NAME

-       panel - panel stack extension for curses
-
-
-
-

SYNOPSIS

-       #include <panel.h>
-
-       cc [flags] sourcefiles -lpanel -lncurses
-
-       PANEL *new_panel(WINDOW *win)
-       int bottom_panel(PANEL *pan)
-       int top_panel(PANEL *pan)
-       int show_panel(PANEL *pan)
-       void update_panels();
-       int hide_panel(PANEL *pan)
-       WINDOW *panel_window(const PANEL *pan)
-       int replace_panel(PANEL *pan, WINDOW *window)
-       int move_panel(PANEL *pan, int starty, int startx)
-       int panel_hidden(const PANEL *pan)
-       PANEL *panel_above(const PANEL *pan)
-       PANEL *panel_below(const PANEL *pan)
-       int set_panel_userptr(PANEL *pan, const void *ptr)
-       const void *panel_userptr(const PANEL *pan)
-       int del_panel(PANEL *pan)
-
-
-
-

DESCRIPTION

-       Panels  are  curses(3x)  windows with the added feature of
-       depth.  Panel functions allow the use of  stacked  windows
-       and  ensure  the  proper  portions  of each window and the
-       curses stdscr window are hidden or displayed  when  panels
-       are  added,  moved,  modified or removed.  The set of cur-
-       rently visible panels is the stack of panels.  The  stdscr
-       window  is  beneath all panels, and is not considered part
-       of the stack.
-
-       A window is associated with every panel.  The  panel  rou-
-       tines  enable  you to create, move, hide, and show panels,
-       as well as position a panel at any desired location in the
-       stack.
-
-       Panel routines are a functional layer added to curses(3x),
-       make only high-level curses calls, and work anywhere  ter-
-       minfo curses does.
-
-
-
-

FUNCTIONS

-       new_panel(win)
-              allocates   a   PANEL structure, associates it with
-              win, places the panel  on  the  top  of  the  stack
-              (causes   it  to   be   displayed  above  any other
-              panel) and returns a pointer to the new panel.
-
-       update_panels()
-              refreshes the virtual screen to reflect  the  rela-
-              tions between the panels in the stack, but does not
-              call doupdate() to  refresh  the  physical  screen.
-              Use this function and not wrefresh or wnoutrefresh.
-              update_panels may be called more than once before a
-              call  to doupdate(), but doupdate() is the function
-              responsible for updating the physical screen.
-
-       del_panel(pan)
-              removes the given panel from the  stack and deallo-
-              cates  the  PANEL structure (but not its associated
-              window).
-
-       hide_panel(pan)
-              removes the given panel from the  panel  stack  and
-              thus hides it from view. The PANEL structure is not
-              lost, merely removed from the stack.
-
-       panel_hidden(pan)
-              returns TRUE if the panel is in  the  panel  stack,
-              FALSE  if  it  is  not.   If  the  panel  is a null
-              pointer, return ERR.
-
-       show_panel(pan)
-              makes a hidden panel visible by placing it  on  top
-              of the panels in the panel stack. See COMPATIBILITY
-              below.
-
-       top_panel(pan)
-              puts the given visible panel on top of  all  panels
-              in the stack.  See COMPATIBILITY below.
-
-       bottom_panel(pan)
-              puts panel at the bottom of all panels.
-
-       move_panel(pan,starty,startx)
-              moves the given panel window so that its upper-left
-              corner is at starty, startx.  It  does  not  change
-              the position of the panel in the stack.  Be sure to
-              use this function, not mvwin(),  to  move  a  panel
-              window.
-
-       replace_panel(pan,window)
-              replaces  the  current  window of panel with window
-              (useful, for example if you want to resize a panel;
-              if you're using ncurses, you can call replace_panel
-              on the output of wresize(3x)).  It does not  change
-              the position of the panel in the stack.
-
-       panel_above(pan)
-              returns  a  pointer to the panel above pan.  If the
-              panel argument is (PANEL *)0, it returns a  pointer
-              to the bottom panel in the stack.
-
-       panel_below(pan)
-              returns  a pointer to the panel just below pan.  If
-              the panel argument is  (PANEL  *)0,  it  returns  a
-              pointer to the top panel in the stack.
-
-       set_panel_userptr(pan,ptr)
-              sets the panel's user pointer.
-
-       panel_userptr(pan)
-              returns the user pointer for a given panel.
-
-       panel_window(pan)
-              returns a pointer to the window of the given panel.
-
-
-
-

DIAGNOSTICS

-       Each routine that returns a pointer  returns  NULL  if  an
-       error  occurs.  Each  routine  that  returns  an int value
-       returns OK if it executes successfully and ERR if not.
-
-
-
-

COMPATIBILITY

-       Reasonable care has been taken to   ensure   compatibility
-       with   the   native   panel  facility introduced in SVr3.2
-       (inspection  of  the  SVr4  manual  pages   suggests   the
-       programming  interface  is  unchanged).   The  PANEL  data
-       structures are merely  similar. The   programmer  is  cau-
-       tioned not to directly use PANEL fields.
-
-       The  functions  show_panel() and top_panel() are identical
-       in this implementation, and work equally  well  with  dis-
-       played or hidden panels.  In the native System V implemen-
-       tation, show_panel() is intended for making a hidden panel
-       visible  (at  the  top  of  the  stack) and top_panel() is
-       intended for making an already-visible panel move  to  the
-       top  of  the  stack.  You are cautioned to use the correct
-       function  to  ensure  compatibility  with   native   panel
-       libraries.
-
-
-
-

NOTE

-       In  your  library  list, libpanel.a should be before libn-
-       curses.a; that is, you want to  say  `-lpanel  -lncurses',
-       not the other way around (which would usually give a link-
-       error).
-
-
-
-

FILES

-       panel.h interface for the panels library
-
-       libpanel.a the panels library itself
-
-
-
-

SEE ALSO

-       curses(3x), curs_variables(3x),
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-

AUTHOR

-       Originally  written  by   Warren   Tucker   <wht@n4hgf.mt-
-       park.ga.us>,  primarily  to  assist  in porting u386mon to
-       systems without a native panels library.   Repackaged  for
-       ncurses by Zeyd ben-Halim.
-
-
-
-                                                              panel(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/resizeterm.3x.html b/doc/html/man/resizeterm.3x.html deleted file mode 100644 index d675ee3acd0..00000000000 --- a/doc/html/man/resizeterm.3x.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - -resizeterm 3x - - - - -

resizeterm 3x

-
-
-
-resizeterm(3x)                                           resizeterm(3x)
-
-
-
-
-
-

NAME

-       is_term_resized,  resize_term,  resizeterm  -  change  the
-       curses terminal size
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       bool is_term_resized(int lines, int columns);
-       int resize_term(int lines, int columns);
-       int resizeterm(int lines, int columns);
-
-
-
-

DESCRIPTION

-       This is an extension to the curses library.   It  provides
-       callers  with  a hook into the ncurses data to resize win-
-       dows, primarily for use by programs running in an X Window
-       terminal  (e.g.,  xterm).  The function resizeterm resizes
-       the standard and current windows to the  specified  dimen-
-       sions,  and  adjusts  other  bookkeeping  data used by the
-       ncurses library that record the window dimensions.
-
-       Most  of  the  work  is  done  by   the   inner   function
-       resize_term.  The outer function resizeterm adds bookkeep-
-       ing for the SIGWINCH handler.  When resizing the  windows,
-       resize_term  blank-fills the areas that are extended.  The
-       calling application should fill in these areas with appro-
-       priate  data.  The resize_term function attempts to resize
-       all windows.  However, due to the  calling  convention  of
-       pads,  it  is  not  possible to resize these without addi-
-       tional interaction with the application.
-
-       A support function is_term_resized  is  provided  so  that
-       applications  can  check if the resize_term function would
-       modify the window structures.  It returns TRUE if the win-
-       dows would be modified, and FALSE otherwise.
-
-
-
-

RETURN VALUE

-       Except  as  notes,  these  function return the integer ERR
-       upon failure and OK on success.  They will fail if  either
-       of the dimensions are less than or equal to zero, or if an
-       error occurs while (re)allocating memory for the windows.
-
-
-
-

NOTES

-       While these functions are intended to be used to support a
-       signal  handler (i.e., for SIGWINCH), care should be taken
-       to avoid invoking them in a context where malloc or  real-
-       loc  may  have been interrupted, since it uses those func-
-       tions.
-
-       If ncurses is configured to supply its own  SIGWINCH  han-
-       dler, the resizeterm function ungetch's a KEY_RESIZE which
-       will be read on the next call to getch.  This is  used  to
-       alert an application that the screen size has changed, and
-       that it should repaint special features such as pads  that
-       cannot be done automatically.
-
-       If  the  environment  variables  LINES or COLUMNS are set,
-       this overrides  the  library's  use  of  the  window  size
-       obtained  from the operating system.  Thus, even if a SIG-
-       WINCH is received, no screen size change may be  recorded.
-       In that case, no KEY_RESIZE is queued for the next call to
-       getch; an ERR will be returned instead.
-
-
-
-

SEE ALSO

-       curs_variables(3x), wresize(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey (from an equivalent function written in 1988
-       for BSD curses).
-
-
-
-                                                         resizeterm(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html deleted file mode 100644 index a8781acdcbf..00000000000 --- a/doc/html/man/tabs.1.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - -tabs 1 - - - - -

tabs 1

-
-
-
-tabs(1)                                                         tabs(1)
-
-
-
-
-
-

NAME

-       tabs - set tabs on a terminal
-
-
-
-

SYNOPSIS

-       tabs [-v[n]] [-ahuUV] file...
-
-
-
-

DESCRIPTION

-       The  tabs  program clears and sets tab-stops on the termi-
-       nal.  This uses the terminfo  clear_all_tabs  and  set_tab
-       capabilities.   If  either  is  absent,  tabs is unable to
-       clear/set tab-stops.  The terminal should be configured to
-       use hard tabs, e.g.,
-
-              stty tab0
-
-
-
-

OPTIONS

-   General Options
-       -Tname
-            Tell tabs which terminal type to use.  If this option
-            is not given, tabs will  use  the  $TERM  environment
-            variable.   If  that  is  not  set,  it  will use the
-            ansi+tabs entry.
-
-       -d   The debugging option shows a ruler line, followed  by
-            two  data  lines.   The  first  data  line  shows the
-            expected tab-stops marked with asterisks.  The second
-            data  line  shows  the  actual tab-stops, marked with
-            asterisks.
-
-       -n   This option tells tabs to check the options  and  run
-            any  debugging option, but not to modify the terminal
-            settings.
-
-       The tabs program processes a single  list  of  tab  stops.
-       The  last  option  to be processed which defines a list is
-       the one that determines the list to be processed.
-
-   Implicit Lists
-       Use a single number as an option, e.g., "-5" to  set  tabs
-       at  the  given  interval  (in  this case 1, 6, 11, 16, 21,
-       etc.).  Tabs are repeated up to the right  margin  of  the
-       screen.
-
-       Use "-0" to clear all tabs.
-
-       Use "-8" to set tabs to the standard interval.
-
-   Explicit Lists
-       An  explicit  list  can be defined after the options (this
-       does not use a "-").  The values in the list  must  be  in
-       increasing numeric order, and greater than zero.  They are
-       separated by a comma or a blank, for example,
-
-              tabs 1,6,11,16,21
-              tabs 1 6 11 16 21
-       Use a '+' to treat a number as an  increment  relative  to
-       the previous value, e.g.,
-
-              tabs 1,+5,+5,+5,+5
-       which is equivalent to the 1,6,11,16,21 example.
-
-   Predefined Tab-Stops
-       X/Open defines several predefined lists of tab stops.
-
-       -a   Assembler, IBM S/370, first format
-
-       -a2  Assembler, IBM S/370, second format
-
-       -c   COBOL, normal format
-
-       -c2  COBOL compact format
-
-       -c3  COBOL compact format extended
-
-       -f   FORTRAN
-
-       -p   PL/I
-
-       -s   SNOBOL
-
-       -u   UNIVAC 1100 Assembler
-
-
-
-

PORTABILITY

-       X/Open  describes  a  +m option, to set a terminal's left-
-       margin.  Very few of the entries in the terminal  database
-       provide this capability.
-
-       The  -d  (debug) and -n (no-op) options are extensions not
-       provided by other implementations.
-
-       Documentation for other implementations states that  there
-       is  a limit on the number of tab stops.  While some termi-
-       nals may not accept an arbitrary number of tab stops, this
-       implementation  will  attempt  to  set tab stops up to the
-       right margin of the screen, if the given list  happens  to
-       be that long.
-
-
-
-

SEE ALSO

-       tset(1), infocmp(1m), curses(3x), terminfo(5).
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                                tabs(1)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/term.5.html b/doc/html/man/term.5.html deleted file mode 100644 index 73ecbb297d7..00000000000 --- a/doc/html/man/term.5.html +++ /dev/null @@ -1,308 +0,0 @@ - - - - -term 5 - - - - -

term 5

-
-
-
-term(5)                                                         term(5)
-
-
-
-
-
-

NAME

-       term - format of compiled term file.
-
-
-
-

SYNOPSIS

-       term
-
-
-
-

DESCRIPTION

-   STORAGE LOCATION
-       Compiled terminfo descriptions are placed under the direc-
-       tory /usr/share/terminfo.   Two  configurations  are  sup-
-       ported (when building the ncurses libraries):
-
-       directory tree
-            A  two-level  scheme is used to avoid a linear search
-            of a  huge  UNIX  system  directory:  /usr/share/ter-
-            minfo/c/name  where name is the name of the terminal,
-            and c is the first character of name.  Thus, act4 can
-            be  found  in  the  file  /usr/share/terminfo/a/act4.
-            Synonyms for the same  terminal  are  implemented  by
-            multiple links to the same compiled file.
-
-       hashed database
-            Using  Berkeley  database,  two  types of records are
-            stored: the terminfo  data  in  the  same  format  as
-            stored  in  a directory tree with the terminfo's pri-
-            mary name as  a  key,  and  records  containing  only
-            aliases pointing to the primary name.
-
-            If built to write hashed databases, ncurses can still
-            read terminfo  databases  organized  as  a  directory
-            tree,  but  cannot  write  entries into the directory
-            tree.  It can  write  (or  rewrite)  entries  in  the
-            hashed database.
-
-            ncurses  distinguishes  the two cases in the TERMINFO
-            and TERMINFO_DIRS environment variable by assuming  a
-            directory  tree  for  entries  that  correspond to an
-            existing directory, and hashed database otherwise.
-
-   STORAGE FORMAT
-       The format has been chosen so that it will be the same  on
-       all  hardware.   An  8 or more bit byte is assumed, but no
-       assumptions about byte  ordering  or  sign  extension  are
-       made.
-
-       The  compiled  file  is  created with the tic program, and
-       read by the routine setupterm.  The file is  divided  into
-       six parts: the header, terminal names, boolean flags, num-
-       bers, strings, and string table.
-
-       The header section begins the file.  This section contains
-       six  short  integers in the format described below.  These
-       integers are
-
-            (1) the magic number (octal 0432);
-
-            (2) the size, in bytes, of the names section;
-
-            (3) the number of bytes in the boolean section;
-
-            (4) the number of short integers in the numbers  sec-
-            tion;
-
-            (5)  the  number  of  offsets (short integers) in the
-            strings section;
-
-            (6) the size, in bytes, of the string table.
-
-       Short integers are stored in two 8-bit bytes.   The  first
-       byte  contains  the least significant 8 bits of the value,
-       and the second byte contains the most significant 8  bits.
-       (Thus,  the  value  represented is 256*second+first.)  The
-       value -1 is represented by the two bytes 0377, 0377; other
-       negative  values  are  illegal. This value generally means
-       that the corresponding capability  is  missing  from  this
-       terminal.   Note that this format corresponds to the hard-
-       ware  of  the  VAX  and  PDP-11  (that  is,  little-endian
-       machines).  Machines where this does not correspond to the
-       hardware must read the integers as two bytes  and  compute
-       the little-endian value.
-
-       The  terminal  names  section comes next.  It contains the
-       first line of the terminfo description, listing the  vari-
-       ous  names  for the terminal, separated by the `|' charac-
-       ter.  The section is terminated with an ASCII NUL  charac-
-       ter.
-
-       The  boolean flags have one byte for each flag.  This byte
-       is either 0 or 1 as the flag is present  or  absent.   The
-       capabilities are in the same order as the file <term.h>.
-
-       Between the boolean section and the number section, a null
-       byte will be inserted, if necessary, to  ensure  that  the
-       number  section begins on an even byte (this is a relic of
-       the  PDP-11's  word-addressed   architecture,   originally
-       designed  in  to  avoid  IOT traps induced by addressing a
-       word on an odd byte boundary).   All  short  integers  are
-       aligned on a short word boundary.
-
-       The numbers section is similar to the flags section.  Each
-       capability takes up two bytes, and is stored as a  little-
-       endian short integer.  If the value represented is -1, the
-       capability is taken to be missing.
-
-       The strings section is also similar.  Each  capability  is
-       stored  as  a short integer, in the format above.  A value
-       of -1 means the capability  is  missing.   Otherwise,  the
-       value  is  taken  as  an  offset from the beginning of the
-       string table.  Special characters in ^X or \c notation are
-       stored  in their interpreted form, not the printing repre-
-       sentation.  Padding information $<nn> and parameter infor-
-       mation %x are stored intact in uninterpreted form.
-
-       The  final  section  is the string table.  It contains all
-       the values of string capabilities referenced in the string
-       section.  Each string is null terminated.
-
-   EXTENDED STORAGE FORMAT
-       The  previous  section describes the conventional terminfo
-       binary format.  With some minor variations of the  offsets
-       (see  PORTABILITY),  the same binary format is used in all
-       modern UNIX systems.  Each system uses a predefined set of
-       boolean, number or string capabilities.
-
-       The  ncurses  libraries  and applications support extended
-       terminfo binary format, allowing users to define capabili-
-       ties  which are loaded at runtime.  This extension is made
-       possible by using the fact that the other  implementations
-       stop  reading the terminfo data when they have reached the
-       end of the size given in the header.  ncurses  checks  the
-       size,  and  if it exceeds that due to the predefined data,
-       continues to parse according to its own scheme.
-
-       First, it reads the extended header (5 short integers):
-
-            (1)  count of extended boolean capabilities
-
-            (2)  count of extended numeric capabilities
-
-            (3)  count of extended string capabilities
-
-            (4)  size of the extended string table in bytes.
-
-            (5)  last offset of  the  extended  string  table  in
-                 bytes.
-
-       Using  the  counts and sizes, ncurses allocates arrays and
-       reads data for the extended capabilties in the same  order
-       as the header information.
-
-       The extended string table contains values for string capa-
-       bilities.  After the end of these values, it contains  the
-       names  for  each  of  the  extended capabilities in order,
-       e.g., booleans, then numbers and finally strings.
-
-
-
-

PORTABILITY

-       Note that it is possible for setupterm to expect a differ-
-       ent  set  of capabilities than are actually present in the
-       file.  Either the database may  have  been  updated  since
-       setupterm has been recompiled (resulting in extra unrecog-
-       nized entries in the file) or the program  may  have  been
-       recompiled  more  recently  than  the database was updated
-       (resulting in missing  entries).   The  routine  setupterm
-       must  be prepared for both possibilities - this is why the
-       numbers and sizes are included.   Also,  new  capabilities
-       must  always  be added at the end of the lists of boolean,
-       number, and string capabilities.
-
-       Despite the consistent use of  little-endian  for  numbers
-       and  the  otherwise self-describing format, it is not wise
-       to count on portability of binary terminfo entries between
-       commercial  UNIX  versions.  The problem is that there are
-       at least three versions of terminfo (under HP-UX, AIX, and
-       OSF/1)  which  diverged from System V terminfo after SVr1,
-       and have added extension capabilities to the string  table
-       that  (in the binary format) collide with System V and XSI
-       Curses extensions.  See terminfo(5) for  detailed  discus-
-       sion of terminfo source compatibility issues.
-
-
-
-

EXAMPLE

-       As  an  example, here is a hex dump of the description for
-       the Lear-Siegler ADM-3, a  popular  though  rather  stupid
-       early terminal:
-
-       adm3a|lsi adm3a,
-               am,
-               cols#80, lines#24,
-               bel=^G, clear= 32$<1>, cr=^M, cub1=^H, cud1=^J,
-               cuf1=^L, cup=\E=%p1%{32}%+%c%p2%{32}%+%c, cuu1=^K,
-               home=^^, ind=^J,
-
-       0000  1a 01 10 00 02 00 03 00  82 00 31 00 61 64 6d 33  ........ ..1.adm3
-       0010  61 7c 6c 73 69 20 61 64  6d 33 61 00 00 01 50 00  a|lsi ad m3a...P.
-       0020  ff ff 18 00 ff ff 00 00  02 00 ff ff ff ff 04 00  ........ ........
-       0030  ff ff ff ff ff ff ff ff  0a 00 25 00 27 00 ff ff  ........ ..%.'...
-       0040  29 00 ff ff ff ff 2b 00  ff ff 2d 00 ff ff ff ff  ).....+. ..-.....
-       0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ........ ........
-       0120  ff ff ff ff ff ff 2f 00  07 00 0d 00 1a 24 3c 31  ....../. .....$<1
-       0130  3e 00 1b 3d 25 70 31 25  7b 33 32 7d 25 2b 25 63  >..=%p1% {32}%+%c
-       0140  25 70 32 25 7b 33 32 7d  25 2b 25 63 00 0a 00 1e  %p2%{32} %+%c....
-       0150  00 08 00 0c 00 0b 00 0a  00                       ........ .
-
-
-
-
-

LIMITS

-       Some  limitations:  total  compiled  entries cannot exceed
-       4096 bytes.  The name field cannot exceed 128 bytes.
-
-
-
-

FILES

-       /usr/share/terminfo/*/*  compiled terminal capability data
-       base
-
-
-
-

SEE ALSO

-       curses(3x), terminfo(5).
-
-
-
-

AUTHORS

-       Thomas E. Dickey
-       extended terminfo format for ncurses 5.0
-       hashed database support for ncurses 5.6
-
-       Eric S. Raymond
-
-
-
-                                                                term(5)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/term.7.html b/doc/html/man/term.7.html deleted file mode 100644 index 4c944a1c5bc..00000000000 --- a/doc/html/man/term.7.html +++ /dev/null @@ -1,251 +0,0 @@ - - - - -term 7 - - - - -

term 7

-
-
-
-term(7)                                                         term(7)
-
-
-
-
-
-

NAME

-       term - conventions for naming terminal types
-
-
-
-

DESCRIPTION

-       The  environment variable TERM should normally contain the
-       type name of the terminal, console or display-device  type
-       you  are  using.   This  information  is  critical for all
-       screen-oriented  programs,  including  your   editor   and
-       mailer.
-
-       A  default  TERM  value will be set on a per-line basis by
-       either  /etc/inittab  (e.g.,  System-V-like   UNIXes)   or
-       /etc/ttys  (BSD  UNIXes).  This will nearly always suffice
-       for workstation and microcomputer consoles.
-
-       If you use a dialup line, the type of device  attached  to
-       it  may vary.  Older UNIX systems pre-set a very dumb ter-
-       minal type like `dumb' or `dialup' on dialup lines.  Newer
-       ones may pre-set `vt100', reflecting the prevalence of DEC
-       VT100-compatible terminals  and  personal-computer  emula-
-       tors.
-
-       Modern  telnets  pass  your TERM environment variable from
-       the local side to the remote one.  There can  be  problems
-       if  the  remote terminfo or termcap entry for your type is
-       not compatible with yours, but this situation is rare  and
-       can  almost  always  be  avoided  by  explicitly exporting
-       `vt100' (assuming you are in fact using  a  VT100-superset
-       console, terminal, or terminal emulator.)
-
-       In any case, you are free to override the system TERM set-
-       ting to your taste in your  shell  profile.   The  tset(1)
-       utility  may  be  of  assistance; you can give it a set of
-       rules for deducing or requesting a terminal type based  on
-       the tty device and baud rate.
-
-       Setting your own TERM value may also be useful if you have
-       created a custom  entry  incorporating  options  (such  as
-       visual  bell  or reverse-video) which you wish to override
-       the system default type for your line.
-
-       Terminal type descriptions are stored as files of capabil-
-       ity data underneath /usr/share/terminfo.  To browse a list
-       of all terminal names recognized by the system, do
-
-            toe | more
-
-       from your shell.  These capability files are in  a  binary
-       format optimized for retrieval speed (unlike the old text-
-       based termcap format they replace); to examine  an  entry,
-       you  must  use the infocmp(1m) command.  Invoke it as fol-
-       lows:
-
-            infocmp entry_name
-
-       where entry_name is the name of the type you wish to exam-
-       ine  (and the name of its capability file the subdirectory
-       of /usr/share/terminfo named for its first letter).   This
-       command  dumps  a  capability  file  in  the  text  format
-       described by terminfo(5).
-
-       The first line of  a  terminfo(5)  description  gives  the
-       names by which terminfo knows a terminal, separated by `|'
-       (pipe-bar) characters with the last name field  terminated
-       by  a  comma.   The first name field is the type's primary
-       name, and is the one to use when setting TERM.   The  last
-       name  field  (if  distinct  from  the first) is actually a
-       description of the terminal type (it may  contain  blanks;
-       the others must be single words).  Name fields between the
-       first and last (if present) are aliases for the  terminal,
-       usually historical names retained for compatibility.
-
-       There are some conventions for how to choose terminal pri-
-       mary names that help keep  them  informative  and  unique.
-       Here is a step-by-step guide to naming terminals that also
-       explains how to parse them:
-
-       First, choose a root name.  The root  will  consist  of  a
-       lower-case  letter followed by up to seven lower-case let-
-       ters or digits.  You need to avoid using punctuation char-
-       acters  in  root  names,  because they are used and inter-
-       preted as filenames and shell meta-characters (such as  !,
-       $,  *, ?, etc.) embedded in them may cause odd and unhelp-
-       ful behavior.  The slash (/), or any other character  that
-       may  be  interpreted by anyone's file system (\, $, [, ]),
-       is especially dangerous (terminfo is platform-independent,
-       and  choosing  names with special characters could someday
-       make life difficult for users of a future port).  The  dot
-       (.)  character  is  relatively safe as long as there is at
-       most one per root name; some historical terminfo names use
-       it.
-
-       The  root  name for a terminal or workstation console type
-       should almost always begin with a vendor prefix  (such  as
-       hp  for Hewlett-Packard, wy for Wyse, or att for AT&T ter-
-       minals), or a common name of the terminal line (vt for the
-       VT  series of terminals from DEC, or sun for Sun Microsys-
-       tems workstation consoles, or regent for the  ADDS  Regent
-       series.   You  can list the terminfo tree to see what pre-
-       fixes are already in common use.   The  root  name  prefix
-       should  be  followed  when  appropriate by a model number;
-       thus vt100, hp2621, wy50.
-
-       The root name for a PC-Unix console type should be the  OS
-       name,  i.e., linux, bsdos, freebsd, netbsd.  It should not
-       be console or any other generic that might cause confusion
-       in  a  multi-platform environment!  If a model number fol-
-       lows, it should indicate either the OS  release  level  or
-       the console driver release level.
-
-       The  root  name  for a terminal emulator (assuming it does
-       not fit one of the standard ANSI or vt100 types) should be
-       the program name or a readily recognizable abbreviation of
-       it (i.e., versaterm, ctrm).
-
-       Following the root name, you may add any reasonable number
-       of hyphen-separated feature suffixes.
-
-       2p   Has two pages of memory.  Likewise 4p, 8p, etc.
-
-       mc   Magic-cookie.   Some  terminals (notably older Wyses)
-            can only support one attribute  without  magic-cookie
-            lossage.   Their  base  entry  is usually paired with
-            another that has this suffix and uses  magic  cookies
-            to support multiple attributes.
-
-       -am  Enable auto-margin (right-margin wraparound).
-
-       -m   Mono mode - suppress color support.
-
-       -na  No  arrow keys - termcap ignores arrow keys which are
-            actually there on the terminal, so the user  can  use
-            the arrow keys locally.
-
-       -nam No auto-margin - suppress am capability.
-
-       -nl  No labels - suppress soft labels.
-
-       -nsl No status line - suppress status line.
-
-       -pp  Has a printer port which is used.
-
-       -rv  Terminal in reverse video mode (black on white).
-
-       -s   Enable status line.
-
-       -vb  Use visible bell (flash) rather than beep.
-
-       -w   Wide; terminal is in 132 column mode.
-
-       Conventionally,   if  your  terminal  type  is  a  variant
-       intended to specify a line height, that suffix  should  go
-       first.  So, for a hypothetical FuBarCo model 2317 terminal
-       in 30-line mode with reverse video,  best  form  would  be
-       fubar-30-rv (rather than, say, `fubar-rv-30').
-
-       Terminal types that are written not as standalone entries,
-       but rather as components to be plugged into other  entries
-       via  use capabilities, are distinguished by using embedded
-       plus signs rather than dashes.
-
-       Commands which use a  terminal  type  to  control  display
-       often  accept  a  -T  option  that accepts a terminal name
-       argument.  Such programs should  fall  back  on  the  TERM
-       environment variable when no -T option is specified.
-
-
-
-

PORTABILITY

-       For  maximum  compatibility  with  older  System V UNIXes,
-       names and aliases should be unique  within  the  first  14
-       characters.
-
-
-
-

FILES

-       /usr/share/terminfo/?/*
-            compiled terminal capability data base
-
-       /etc/inittab
-            tty line initialization (AT&T-like UNIXes)
-
-       /etc/ttys
-            tty line initialization (BSD-like UNIXes)
-
-
-
-

SEE ALSO

-       curses(3x), terminfo(5), term(5).
-
-
-
-                                                                term(7)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/term_variables.3x.html b/doc/html/man/term_variables.3x.html deleted file mode 100644 index bc1f9baba8b..00000000000 --- a/doc/html/man/term_variables.3x.html +++ /dev/null @@ -1,165 +0,0 @@ - - - - -term_variables 3x - - - - -

term_variables 3x

-
-
-
-term_variables(3x)                                   term_variables(3x)
-
-
-
-
-
-

NAME

-       SP, acs_map, boolcodes, boolfnames, boolnames, cur_term,
-       numcodes, numfnames, numnames, strcodes, strfnames,
-       strnames, ttytype - curses terminfo global variables
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-       #include <term.h>
-
-       chtype acs_map[];
-       NCURSES_CONST char * const * boolcodes;
-       NCURSES_CONST char * const * boolfnames;
-       NCURSES_CONST char * const * boolnames;
-       TERMINAL * cur_term;
-       NCURSES_CONST char * const * numcodes;
-       NCURSES_CONST char * const * numfnames;
-       NCURSES_CONST char * const * numnames;
-       NCURSES_CONST char * const * strcodes;
-       NCURSES_CONST char * const * strfnames;
-       NCURSES_CONST char * const * strnames;
-       char ttytype[];
-
-
-
-

DESCRIPTION

-       This  page summarizes variables provided by the curses li-
-       brary's low-level terminfo interface.  A more complete de-
-       scription is given in the curs_terminfo(3x) manual page.
-
-       Depending  on the configuration, these may be actual vari-
-       ables, or  macros  (see  curs_threads(3x))  which  provide
-       read-only  access  to curses's state.  In either case, ap-
-       plications should treat them as read-only to avoid confus-
-       ing the library.
-
-   Alternate Character Set Mapping
-       After  initializing the curses or terminfo interfaces, the
-       acs_map array holds information used  to  translate  cells
-       with  the  A_ALTCHARSET  video attribute into line-drawing
-       characters.
-
-       The encoding of the information in this array has  changed
-       periodically.   Application developers need only know that
-       it is used for the "ACS_" constants in <curses.h>.
-
-       The comparable data for the wide-character  library  is  a
-       private variable.
-
-   Current Terminal Data
-       After  initializing the curses or terminfo interfaces, the
-       cur_term contains data describing  the  current  terminal.
-       This variable is also set as a side-effect of set_term(3x)
-       and delscreen(3x).
-
-       It is possible to save a value of cur_term for  subsequent
-       use  as  a  parameter  to  set_term, for switching between
-       screens.  Alternatively, one can  save  the  return  value
-       from newterm or setupterm to reuse in set_term.
-
-   Terminfo Names
-       The  tic(1)  and infocmp(1) programs use lookup tables for
-       the long and short names of terminfo capabilities, as well
-       as  the  corresponding  names  for  termcap  capabilities.
-       These are available  to  other  applications,  though  the
-       hash-tables are not available.
-
-       The  long  terminfo  capability  names  use a "l" (ell) in
-       their names: boolfnames numfnames strfnames
-
-       These are the short names for terminfo capabilities: bool-
-       names, numnames, and strnames.
-
-       These  are  the  corresponding  names used for termcap de-
-       scriptions: boolcodes, numcodes, and strcodes.
-
-   Terminal Type
-       On initialization of the curses  or  terminfo  interfaces,
-       setupterm copies the terminal name to the array ttytype.
-
-
-
-

NOTES

-       The  low-level terminfo interface is initialized using se-
-       tupterm(3x).  The upper-level curses  interface  uses  the
-       low-level terminfo interface, internally.
-
-
-
-

PORTABILITY

-       X/Open  Curses  does  not describe any of these except for
-       cur_term.  (The inclusion of cur_term  appears  to  be  an
-       oversight, since other comparable low-level information is
-       omitted by X/Open).
-
-       Other implementations may have comparable variables.  Some
-       implementations  provide the variables in their libraries,
-       but omit them from the header files.
-
-
-
-

SEE ALSO

-       curses(3x), curs_terminfo(3x),  curs_threads(3x),  termin-
-       fo(3x), terminfo(5).
-
-
-
-                                                     term_variables(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html deleted file mode 100644 index 0340f50522b..00000000000 --- a/doc/html/man/terminfo.5.html +++ /dev/null @@ -1,2375 +0,0 @@ - - - - -terminfo 5 File Formats - - - - -

terminfo 5 File Formats

-
-
-
-terminfo(5)                   File Formats                  terminfo(5)
-
-
-
-
-
-

NAME

-       terminfo - terminal capability data base
-
-
-
-

SYNOPSIS

-       /usr/share/terminfo/*/*
-
-
-
-

DESCRIPTION

-       Terminfo  is  a  data  base  describing terminals, used by
-       screen-oriented programs  such  as  nvi(1),  rogue(1)  and
-       libraries  such  as curses(3x).  Terminfo describes termi-
-       nals by giving a set of capabilities which they  have,  by
-       specifying how to perform screen operations, and by speci-
-       fying padding requirements and  initialization  sequences.
-       This describes ncurses version 5.9 (patch 20110404).
-
-       Entries in terminfo consist of a sequence of `,' separated
-       fields (embedded commas may be escaped with a backslash or
-       notated  as \054).  White space after the `,' separator is
-       ignored.  The first entry  for  each  terminal  gives  the
-       names  which  are known for the terminal, separated by `|'
-       characters.  The first  name  given  is  the  most  common
-       abbreviation  for the terminal, the last name given should
-       be a long name fully identifying  the  terminal,  and  all
-       others  are  understood as synonyms for the terminal name.
-       All names but the last should be in lower case and contain
-       no  blanks;  the last name may well contain upper case and
-       blanks for readability.
-
-       Lines beginning with a `#' in the first column are treated
-       as  comments.  While comment lines are legal at any point,
-       the output of captoinfo and infotocap  (aliases  for  tic)
-       will move comments so they occur only between entries.
-
-       Newlines  and  leading  tabs  may  be  used for formatting
-       entries for readability.  These are  removed  from  parsed
-       entries.   The  infocmp -f option relies on this to format
-       if-then-else expressions: the result can be read by tic.
-
-       Terminal names (except for the last, verbose entry) should
-       be chosen using the following conventions.  The particular
-       piece of hardware making up the  terminal  should  have  a
-       root  name, thus ``hp2621''.  This name should not contain
-       hyphens.  Modes that the hardware can be in, or user pref-
-       erences,  should  be indicated by appending a hyphen and a
-       mode suffix.  Thus, a vt100 in 132 column  mode  would  be
-       vt100-w.  The following suffixes should be used where pos-
-       sible:
-
-
-      Suffix                  Meaning                   Example
-      -nn      Number of lines on the screen            aaa-60
-      -np      Number of pages of memory                c100-4p
-      -am      With automargins (usually the default)   vt100-am
-      -m       Mono mode; suppress color                ansi-m
-      -mc      Magic cookie; spaces when highlighting   wy30-mc
-      -na      No arrow keys (leave them in local)      c100-na
-      -nam     Without automatic margins                vt100-nam
-      -nl      No status line                           att4415-nl
-      -ns      No status line                           hp2626-ns
-      -rv      Reverse video                            c100-rv
-      -s       Enable status line                       vt100-s
-
-      -vb      Use visible bell instead of beep         wy370-vb
-      -w       Wide mode (> 80 columns, usually 132)    vt100-w
-
-       For more on terminal naming conventions, see  the  term(7)
-       manual page.
-
-   Capabilities
-       The  following  is  a  complete  table of the capabilities
-       included in a terminfo description block and available  to
-       terminfo-using code.  In each line of the table,
-
-       The  variable  is the name by which the programmer (at the
-       terminfo level) accesses the capability.
-
-       The capname is the short name used  in  the  text  of  the
-       database,  and  is used by a person updating the database.
-       Whenever possible, capnames are chosen to be the  same  as
-       or similar to the ANSI X3.64-1979 standard (now superseded
-       by ECMA-48, which uses identical or very  similar  names).
-       Semantics are also intended to match those of the specifi-
-       cation.
-
-       The termcap code is the old termcap capability name  (some
-       capabilities are new, and have names which termcap did not
-       originate).
-
-       Capability names have no hard length limit, but an  infor-
-       mal  limit  of  5 characters has been adopted to keep them
-       short and to allow the tabs in the  source  file  Caps  to
-       line up nicely.
-
-       Finally,  the  description  field  attempts  to convey the
-       semantics of the capability.  You may find some  codes  in
-       the description field:
-
-       (P)    indicates that padding may be specified
-
-       #[1-9] in  the description field indicates that the string
-              is passed through tparm with parms as given (#i).
-
-       (P*)   indicates that padding may vary  in  proportion  to
-              the number of lines affected
-
-       (#i)   indicates the ith parameter.
-
-
-       These are the boolean capabilities:
-
-
-               Variable          Cap-  TCap      Description
-               Booleans          name  Code
-       auto_left_margin          bw    bw    cub1 wraps from col-
-                                             umn 0 to last column
-       auto_right_margin         am    am    terminal has auto-
-                                             matic margins
-       back_color_erase          bce   ut    screen erased with
-                                             background color
-       can_change                ccc   cc    terminal can re-
-                                             define existing col-
-                                             ors
-       ceol_standout_glitch      xhp   xs    standout not erased
-                                             by overwriting (hp)
-       col_addr_glitch           xhpa  YA    only positive motion
-                                             for hpa/mhpa caps
-
-
-       cpi_changes_res           cpix  YF    changing character
-                                             pitch changes reso-
-                                             lution
-       cr_cancels_micro_mode     crxm  YB    using cr turns off
-                                             micro mode
-       dest_tabs_magic_smso      xt    xt    tabs destructive,
-                                             magic so char
-                                             (t1061)
-       eat_newline_glitch        xenl  xn    newline ignored
-                                             after 80 cols (con-
-                                             cept)
-       erase_overstrike          eo    eo    can erase over-
-                                             strikes with a blank
-       generic_type              gn    gn    generic line type
-       hard_copy                 hc    hc    hardcopy terminal
-       hard_cursor               chts  HC    cursor is hard to
-                                             see
-       has_meta_key              km    km    Has a meta key
-                                             (i.e., sets 8th-bit)
-       has_print_wheel           daisy YC    printer needs opera-
-                                             tor to change char-
-                                             acter set
-       has_status_line           hs    hs    has extra status
-                                             line
-       hue_lightness_saturation  hls   hl    terminal uses only
-                                             HLS color notation
-                                             (Tektronix)
-       insert_null_glitch        in    in    insert mode distin-
-                                             guishes nulls
-       lpi_changes_res           lpix  YG    changing line pitch
-                                             changes resolution
-       memory_above              da    da    display may be
-                                             retained above the
-                                             screen
-       memory_below              db    db    display may be
-                                             retained below the
-                                             screen
-       move_insert_mode          mir   mi    safe to move while
-                                             in insert mode
-       move_standout_mode        msgr  ms    safe to move while
-                                             in standout mode
-       needs_xon_xoff            nxon  nx    padding will not
-                                             work, xon/xoff
-                                             required
-       no_esc_ctlc               xsb   xb    beehive (f1=escape,
-                                             f2=ctrl C)
-       no_pad_char               npc   NP    pad character does
-                                             not exist
-       non_dest_scroll_region    ndscr ND    scrolling region is
-                                             non-destructive
-       non_rev_rmcup             nrrmc NR    smcup does not
-                                             reverse rmcup
-       over_strike               os    os    terminal can over-
-                                             strike
-       prtr_silent               mc5i  5i    printer will not
-                                             echo on screen
-       row_addr_glitch           xvpa  YD    only positive motion
-                                             for vpa/mvpa caps
-       semi_auto_right_margin    sam   YE    printing in last
-                                             column causes cr
-       status_line_esc_ok        eslok es    escape can be used
-                                             on the status line
-       tilde_glitch              hz    hz    cannot print ~'s
-                                             (hazeltine)
-
-
-       transparent_underline     ul    ul    underline character
-                                             overstrikes
-       xon_xoff                  xon   xo    terminal uses
-                                             xon/xoff handshaking
-
-       These are the numeric capabilities:
-
-
-            Variable         Cap-     TCap       Description
-             Numeric         name     Code
-       columns               cols     co     number of columns in
-                                             a line
-       init_tabs             it       it     tabs initially every
-                                             # spaces
-       label_height          lh       lh     rows in each label
-       label_width           lw       lw     columns in each
-                                             label
-       lines                 lines    li     number of lines on
-                                             screen or page
-       lines_of_memory       lm       lm     lines of memory if >
-                                             line. 0 means varies
-       magic_cookie_glitch   xmc      sg     number of blank
-                                             characters left by
-                                             smso or rmso
-       max_attributes        ma       ma     maximum combined
-                                             attributes terminal
-                                             can handle
-       max_colors            colors   Co     maximum number of
-                                             colors on screen
-       max_pairs             pairs    pa     maximum number of
-                                             color-pairs on the
-                                             screen
-       maximum_windows       wnum     MW     maximum number of
-                                             defineable windows
-       no_color_video        ncv      NC     video attributes
-                                             that cannot be used
-                                             with colors
-       num_labels            nlab     Nl     number of labels on
-                                             screen
-       padding_baud_rate     pb       pb     lowest baud rate
-                                             where padding needed
-       virtual_terminal      vt       vt     virtual terminal
-                                             number (CB/unix)
-       width_status_line     wsl      ws     number of columns in
-                                             status line
-
-       The following numeric  capabilities  are  present  in  the
-       SVr4.0  term  structure, but are not yet documented in the
-       man page.  They came in with SVr4's printer support.
-
-
-             Variable         Cap-    TCap       Description
-             Numeric          name    Code
-       bit_image_entwining    bitwin  Yo     number of passes for
-                                             each bit-image row
-       bit_image_type         bitype  Yp     type of bit-image
-                                             device
-       buffer_capacity        bufsz   Ya     numbers of bytes
-                                             buffered before
-                                             printing
-       buttons                btns    BT     number of buttons on
-                                             mouse
-       dot_horz_spacing       spinh   Yc     spacing of dots hor-
-                                             izontally in dots
-                                             per inch
-
-       dot_vert_spacing       spinv   Yb     spacing of pins ver-
-                                             tically in pins per
-                                             inch
-       max_micro_address      maddr   Yd     maximum value in
-                                             micro_..._address
-       max_micro_jump         mjump   Ye     maximum value in
-                                             parm_..._micro
-       micro_col_size         mcs     Yf     character step size
-                                             when in micro mode
-       micro_line_size        mls     Yg     line step size when
-                                             in micro mode
-       number_of_pins         npins   Yh     numbers of pins in
-                                             print-head
-       output_res_char        orc     Yi     horizontal resolu-
-                                             tion in units per
-                                             line
-       output_res_horz_inch   orhi    Yk     horizontal resolu-
-                                             tion in units per
-                                             inch
-       output_res_line        orl     Yj     vertical resolution
-                                             in units per line
-       output_res_vert_inch   orvi    Yl     vertical resolution
-                                             in units per inch
-       print_rate             cps     Ym     print rate in char-
-                                             acters per second
-       wide_char_size         widcs   Yn     character step size
-                                             when in double wide
-                                             mode
-
-       These are the string capabilities:
-
-
-               Variable          Cap-   TCap     Description
-                String           name   Code
-       acs_chars                 acsc   ac   graphics charset
-                                             pairs, based on
-                                             vt100
-       back_tab                  cbt    bt   back tab (P)
-       bell                      bel    bl   audible signal
-                                             (bell) (P)
-       carriage_return           cr     cr   carriage return (P*)
-                                             (P*)
-       change_char_pitch         cpi    ZA   Change number of
-                                             characters per inch
-                                             to #1
-       change_line_pitch         lpi    ZB   Change number of
-                                             lines per inch to #1
-       change_res_horz           chr    ZC   Change horizontal
-                                             resolution to #1
-       change_res_vert           cvr    ZD   Change vertical res-
-                                             olution to #1
-       change_scroll_region      csr    cs   change region to
-                                             line #1 to line #2
-                                             (P)
-       char_padding              rmp    rP   like ip but when in
-                                             insert mode
-       clear_all_tabs            tbc    ct   clear all tab stops
-                                             (P)
-       clear_margins             mgc    MC   clear right and left
-                                             soft margins
-       clear_screen              clear  cl   clear screen and
-                                             home cursor (P*)
-       clr_bol                   el1    cb   Clear to beginning
-                                             of line
-
-
-       clr_eol                   el     ce   clear to end of line
-                                             (P)
-       clr_eos                   ed     cd   clear to end of
-                                             screen (P*)
-       column_address            hpa    ch   horizontal position
-                                             #1, absolute (P)
-       command_character         cmdch  CC   terminal settable
-                                             cmd character in
-                                             prototype !?
-       create_window             cwin   CW   define a window #1
-                                             from #2,#3 to #4,#5
-       cursor_address            cup    cm   move to row #1
-                                             columns #2
-       cursor_down               cud1   do   down one line
-       cursor_home               home   ho   home cursor (if no
-                                             cup)
-       cursor_invisible          civis  vi   make cursor invisi-
-                                             ble
-       cursor_left               cub1   le   move left one space
-       cursor_mem_address        mrcup  CM   memory relative cur-
-                                             sor addressing, move
-                                             to row #1 columns #2
-       cursor_normal             cnorm  ve   make cursor appear
-                                             normal (undo
-                                             civis/cvvis)
-       cursor_right              cuf1   nd   non-destructive
-                                             space (move right
-                                             one space)
-       cursor_to_ll              ll     ll   last line, first
-                                             column (if no cup)
-       cursor_up                 cuu1   up   up one line
-       cursor_visible            cvvis  vs   make cursor very
-                                             visible
-       define_char               defc   ZE   Define a character
-                                             #1, #2 dots wide,
-                                             descender #3
-       delete_character          dch1   dc   delete character
-                                             (P*)
-       delete_line               dl1    dl   delete line (P*)
-       dial_phone                dial   DI   dial number #1
-       dis_status_line           dsl    ds   disable status line
-       display_clock             dclk   DK   display clock
-       down_half_line            hd     hd   half a line down
-       ena_acs                   enacs  eA   enable alternate
-                                             char set
-       enter_alt_charset_mode    smacs  as   start alternate
-                                             character set (P)
-       enter_am_mode             smam   SA   turn on automatic
-                                             margins
-       enter_blink_mode          blink  mb   turn on blinking
-       enter_bold_mode           bold   md   turn on bold (extra
-                                             bright) mode
-       enter_ca_mode             smcup  ti   string to start pro-
-                                             grams using cup
-       enter_delete_mode         smdc   dm   enter delete mode
-       enter_dim_mode            dim    mh   turn on half-bright
-                                             mode
-       enter_doublewide_mode     swidm  ZF   Enter double-wide
-                                             mode
-       enter_draft_quality       sdrfq  ZG   Enter draft-quality
-                                             mode
-       enter_insert_mode         smir   im   enter insert mode
-       enter_italics_mode        sitm   ZH   Enter italic mode
-       enter_leftward_mode       slm    ZI   Start leftward car-
-                                             riage motion
-
-       enter_micro_mode          smicm  ZJ   Start micro-motion
-                                             mode
-       enter_near_letter_quality snlq   ZK   Enter NLQ mode
-       enter_normal_quality      snrmq  ZL   Enter normal-quality
-                                             mode
-       enter_protected_mode      prot   mp   turn on protected
-                                             mode
-       enter_reverse_mode        rev    mr   turn on reverse
-                                             video mode
-       enter_secure_mode         invis  mk   turn on blank mode
-                                             (characters invisi-
-                                             ble)
-       enter_shadow_mode         sshm   ZM   Enter shadow-print
-                                             mode
-       enter_standout_mode       smso   so   begin standout mode
-       enter_subscript_mode      ssubm  ZN   Enter subscript mode
-       enter_superscript_mode    ssupm  ZO   Enter superscript
-                                             mode
-       enter_underline_mode      smul   us   begin underline mode
-       enter_upward_mode         sum    ZP   Start upward car-
-                                             riage motion
-       enter_xon_mode            smxon  SX   turn on xon/xoff
-                                             handshaking
-       erase_chars               ech    ec   erase #1 characters
-                                             (P)
-       exit_alt_charset_mode     rmacs  ae   end alternate char-
-                                             acter set (P)
-       exit_am_mode              rmam   RA   turn off automatic
-                                             margins
-       exit_attribute_mode       sgr0   me   turn off all
-                                             attributes
-       exit_ca_mode              rmcup  te   strings to end pro-
-                                             grams using cup
-       exit_delete_mode          rmdc   ed   end delete mode
-       exit_doublewide_mode      rwidm  ZQ   End double-wide mode
-       exit_insert_mode          rmir   ei   exit insert mode
-       exit_italics_mode         ritm   ZR   End italic mode
-       exit_leftward_mode        rlm    ZS   End left-motion mode
-       exit_micro_mode           rmicm  ZT   End micro-motion
-                                             mode
-       exit_shadow_mode          rshm   ZU   End shadow-print
-                                             mode
-       exit_standout_mode        rmso   se   exit standout mode
-       exit_subscript_mode       rsubm  ZV   End subscript mode
-       exit_superscript_mode     rsupm  ZW   End superscript mode
-       exit_underline_mode       rmul   ue   exit underline mode
-       exit_upward_mode          rum    ZX   End reverse charac-
-                                             ter motion
-       exit_xon_mode             rmxon  RX   turn off xon/xoff
-                                             handshaking
-       fixed_pause               pause  PA   pause for 2-3 sec-
-                                             onds
-       flash_hook                hook   fh   flash switch hook
-       flash_screen              flash  vb   visible bell (may
-                                             not move cursor)
-       form_feed                 ff     ff   hardcopy terminal
-                                             page eject (P*)
-       from_status_line          fsl    fs   return from status
-                                             line
-       goto_window               wingo  WG   go to window #1
-       hangup                    hup    HU   hang-up phone
-       init_1string              is1    i1   initialization
-                                             string
-       init_2string              is2    is   initialization
-                                             string
-
-       init_3string              is3    i3   initialization
-                                             string
-       init_file                 if     if   name of initializa-
-                                             tion file
-       init_prog                 iprog  iP   path name of program
-                                             for initialization
-       initialize_color          initc  Ic   initialize color #1
-                                             to (#2,#3,#4)
-       initialize_pair           initp  Ip   Initialize color
-                                             pair #1 to
-                                             fg=(#2,#3,#4),
-                                             bg=(#5,#6,#7)
-       insert_character          ich1   ic   insert character (P)
-       insert_line               il1    al   insert line (P*)
-       insert_padding            ip     ip   insert padding after
-                                             inserted character
-       key_a1                    ka1    K1   upper left of keypad
-       key_a3                    ka3    K3   upper right of key-
-                                             pad
-       key_b2                    kb2    K2   center of keypad
-       key_backspace             kbs    kb   backspace key
-       key_beg                   kbeg   @1   begin key
-       key_btab                  kcbt   kB   back-tab key
-       key_c1                    kc1    K4   lower left of keypad
-       key_c3                    kc3    K5   lower right of key-
-                                             pad
-       key_cancel                kcan   @2   cancel key
-       key_catab                 ktbc   ka   clear-all-tabs key
-       key_clear                 kclr   kC   clear-screen or
-                                             erase key
-       key_close                 kclo   @3   close key
-       key_command               kcmd   @4   command key
-       key_copy                  kcpy   @5   copy key
-       key_create                kcrt   @6   create key
-       key_ctab                  kctab  kt   clear-tab key
-       key_dc                    kdch1  kD   delete-character key
-       key_dl                    kdl1   kL   delete-line key
-       key_down                  kcud1  kd   down-arrow key
-       key_eic                   krmir  kM   sent by rmir or smir
-                                             in insert mode
-       key_end                   kend   @7   end key
-       key_enter                 kent   @8   enter/send key
-       key_eol                   kel    kE   clear-to-end-of-line
-                                             key
-       key_eos                   ked    kS   clear-to-end-of-
-                                             screen key
-       key_exit                  kext   @9   exit key
-       key_f0                    kf0    k0   F0 function key
-       key_f1                    kf1    k1   F1 function key
-       key_f10                   kf10   k;   F10 function key
-       key_f11                   kf11   F1   F11 function key
-       key_f12                   kf12   F2   F12 function key
-       key_f13                   kf13   F3   F13 function key
-       key_f14                   kf14   F4   F14 function key
-       key_f15                   kf15   F5   F15 function key
-       key_f16                   kf16   F6   F16 function key
-       key_f17                   kf17   F7   F17 function key
-       key_f18                   kf18   F8   F18 function key
-       key_f19                   kf19   F9   F19 function key
-       key_f2                    kf2    k2   F2 function key
-       key_f20                   kf20   FA   F20 function key
-       key_f21                   kf21   FB   F21 function key
-       key_f22                   kf22   FC   F22 function key
-       key_f23                   kf23   FD   F23 function key
-       key_f24                   kf24   FE   F24 function key
-
-       key_f25                   kf25   FF   F25 function key
-       key_f26                   kf26   FG   F26 function key
-       key_f27                   kf27   FH   F27 function key
-       key_f28                   kf28   FI   F28 function key
-       key_f29                   kf29   FJ   F29 function key
-       key_f3                    kf3    k3   F3 function key
-       key_f30                   kf30   FK   F30 function key
-       key_f31                   kf31   FL   F31 function key
-       key_f32                   kf32   FM   F32 function key
-       key_f33                   kf33   FN   F33 function key
-       key_f34                   kf34   FO   F34 function key
-       key_f35                   kf35   FP   F35 function key
-       key_f36                   kf36   FQ   F36 function key
-       key_f37                   kf37   FR   F37 function key
-       key_f38                   kf38   FS   F38 function key
-       key_f39                   kf39   FT   F39 function key
-       key_f4                    kf4    k4   F4 function key
-       key_f40                   kf40   FU   F40 function key
-       key_f41                   kf41   FV   F41 function key
-       key_f42                   kf42   FW   F42 function key
-       key_f43                   kf43   FX   F43 function key
-       key_f44                   kf44   FY   F44 function key
-       key_f45                   kf45   FZ   F45 function key
-       key_f46                   kf46   Fa   F46 function key
-       key_f47                   kf47   Fb   F47 function key
-       key_f48                   kf48   Fc   F48 function key
-       key_f49                   kf49   Fd   F49 function key
-       key_f5                    kf5    k5   F5 function key
-       key_f50                   kf50   Fe   F50 function key
-       key_f51                   kf51   Ff   F51 function key
-       key_f52                   kf52   Fg   F52 function key
-       key_f53                   kf53   Fh   F53 function key
-       key_f54                   kf54   Fi   F54 function key
-       key_f55                   kf55   Fj   F55 function key
-       key_f56                   kf56   Fk   F56 function key
-       key_f57                   kf57   Fl   F57 function key
-       key_f58                   kf58   Fm   F58 function key
-       key_f59                   kf59   Fn   F59 function key
-       key_f6                    kf6    k6   F6 function key
-       key_f60                   kf60   Fo   F60 function key
-       key_f61                   kf61   Fp   F61 function key
-       key_f62                   kf62   Fq   F62 function key
-       key_f63                   kf63   Fr   F63 function key
-       key_f7                    kf7    k7   F7 function key
-       key_f8                    kf8    k8   F8 function key
-       key_f9                    kf9    k9   F9 function key
-       key_find                  kfnd   @0   find key
-       key_help                  khlp   %1   help key
-       key_home                  khome  kh   home key
-       key_ic                    kich1  kI   insert-character key
-       key_il                    kil1   kA   insert-line key
-       key_left                  kcub1  kl   left-arrow key
-       key_ll                    kll    kH   lower-left key (home
-                                             down)
-       key_mark                  kmrk   %2   mark key
-       key_message               kmsg   %3   message key
-       key_move                  kmov   %4   move key
-       key_next                  knxt   %5   next key
-       key_npage                 knp    kN   next-page key
-       key_open                  kopn   %6   open key
-       key_options               kopt   %7   options key
-       key_ppage                 kpp    kP   previous-page key
-       key_previous              kprv   %8   previous key
-       key_print                 kprt   %9   print key
-       key_redo                  krdo   %0   redo key
-
-       key_reference             kref   &1   reference key
-       key_refresh               krfr   &2   refresh key
-       key_replace               krpl   &3   replace key
-       key_restart               krst   &4   restart key
-       key_resume                kres   &5   resume key
-       key_right                 kcuf1  kr   right-arrow key
-       key_save                  ksav   &6   save key
-       key_sbeg                  kBEG   &9   shifted begin key
-       key_scancel               kCAN   &0   shifted cancel key
-       key_scommand              kCMD   *1   shifted command key
-       key_scopy                 kCPY   *2   shifted copy key
-       key_screate               kCRT   *3   shifted create key
-       key_sdc                   kDC    *4   shifted delete-char-
-                                             acter key
-       key_sdl                   kDL    *5   shifted delete-line
-                                             key
-       key_select                kslt   *6   select key
-       key_send                  kEND   *7   shifted end key
-       key_seol                  kEOL   *8   shifted clear-to-
-                                             end-of-line key
-       key_sexit                 kEXT   *9   shifted exit key
-       key_sf                    kind   kF   scroll-forward key
-       key_sfind                 kFND   *0   shifted find key
-       key_shelp                 kHLP   #1   shifted help key
-       key_shome                 kHOM   #2   shifted home key
-       key_sic                   kIC    #3   shifted insert-char-
-                                             acter key
-       key_sleft                 kLFT   #4   shifted left-arrow
-                                             key
-       key_smessage              kMSG   %a   shifted message key
-       key_smove                 kMOV   %b   shifted move key
-       key_snext                 kNXT   %c   shifted next key
-       key_soptions              kOPT   %d   shifted options key
-       key_sprevious             kPRV   %e   shifted previous key
-       key_sprint                kPRT   %f   shifted print key
-       key_sr                    kri    kR   scroll-backward key
-       key_sredo                 kRDO   %g   shifted redo key
-       key_sreplace              kRPL   %h   shifted replace key
-       key_sright                kRIT   %i   shifted right-arrow
-                                             key
-       key_srsume                kRES   %j   shifted resume key
-       key_ssave                 kSAV   !1   shifted save key
-       key_ssuspend              kSPD   !2   shifted suspend key
-       key_stab                  khts   kT   set-tab key
-       key_sundo                 kUND   !3   shifted undo key
-       key_suspend               kspd   &7   suspend key
-       key_undo                  kund   &8   undo key
-       key_up                    kcuu1  ku   up-arrow key
-       keypad_local              rmkx   ke   leave 'key-
-                                             board_transmit' mode
-       keypad_xmit               smkx   ks   enter 'key-
-                                             board_transmit' mode
-       lab_f0                    lf0    l0   label on function
-                                             key f0 if not f0
-       lab_f1                    lf1    l1   label on function
-                                             key f1 if not f1
-       lab_f10                   lf10   la   label on function
-                                             key f10 if not f10
-       lab_f2                    lf2    l2   label on function
-                                             key f2 if not f2
-       lab_f3                    lf3    l3   label on function
-                                             key f3 if not f3
-       lab_f4                    lf4    l4   label on function
-                                             key f4 if not f4
-
-
-       lab_f5                    lf5    l5   label on function
-                                             key f5 if not f5
-       lab_f6                    lf6    l6   label on function
-                                             key f6 if not f6
-       lab_f7                    lf7    l7   label on function
-                                             key f7 if not f7
-       lab_f8                    lf8    l8   label on function
-                                             key f8 if not f8
-       lab_f9                    lf9    l9   label on function
-                                             key f9 if not f9
-       label_format              fln    Lf   label format
-       label_off                 rmln   LF   turn off soft labels
-       label_on                  smln   LO   turn on soft labels
-       meta_off                  rmm    mo   turn off meta mode
-       meta_on                   smm    mm   turn on meta mode
-                                             (8th-bit on)
-       micro_column_address      mhpa   ZY   Like column_address
-                                             in micro mode
-       micro_down                mcud1  ZZ   Like cursor_down in
-                                             micro mode
-       micro_left                mcub1  Za   Like cursor_left in
-                                             micro mode
-       micro_right               mcuf1  Zb   Like cursor_right in
-                                             micro mode
-       micro_row_address         mvpa   Zc   Like row_address #1
-                                             in micro mode
-       micro_up                  mcuu1  Zd   Like cursor_up in
-                                             micro mode
-       newline                   nel    nw   newline (behave like
-                                             cr followed by lf)
-       order_of_pins             porder Ze   Match software bits
-                                             to print-head pins
-       orig_colors               oc     oc   Set all color pairs
-                                             to the original ones
-       orig_pair                 op     op   Set default pair to
-                                             its original value
-       pad_char                  pad    pc   padding char
-                                             (instead of null)
-       parm_dch                  dch    DC   delete #1 characters
-                                             (P*)
-       parm_delete_line          dl     DL   delete #1 lines (P*)
-       parm_down_cursor          cud    DO   down #1 lines (P*)
-       parm_down_micro           mcud   Zf   Like parm_down_cur-
-                                             sor in micro mode
-       parm_ich                  ich    IC   insert #1 characters
-                                             (P*)
-       parm_index                indn   SF   scroll forward #1
-                                             lines (P)
-       parm_insert_line          il     AL   insert #1 lines (P*)
-       parm_left_cursor          cub    LE   move #1 characters
-                                             to the left (P)
-       parm_left_micro           mcub   Zg   Like parm_left_cur-
-                                             sor in micro mode
-       parm_right_cursor         cuf    RI   move #1 characters
-                                             to the right (P*)
-       parm_right_micro          mcuf   Zh   Like parm_right_cur-
-                                             sor in micro mode
-       parm_rindex               rin    SR   scroll back #1 lines
-                                             (P)
-       parm_up_cursor            cuu    UP   up #1 lines (P*)
-       parm_up_micro             mcuu   Zi   Like parm_up_cursor
-                                             in micro mode
-       pkey_key                  pfkey  pk   program function key
-                                             #1 to type string #2
-
-
-       pkey_local                pfloc  pl   program function key
-                                             #1 to execute string
-                                             #2
-       pkey_xmit                 pfx    px   program function key
-                                             #1 to transmit
-                                             string #2
-       plab_norm                 pln    pn   program label #1 to
-                                             show string #2
-       print_screen              mc0    ps   print contents of
-                                             screen
-       prtr_non                  mc5p   pO   turn on printer for
-                                             #1 bytes
-       prtr_off                  mc4    pf   turn off printer
-       prtr_on                   mc5    po   turn on printer
-       pulse                     pulse  PU   select pulse dialing
-       quick_dial                qdial  QD   dial number #1 with-
-                                             out checking
-       remove_clock              rmclk  RC   remove clock
-       repeat_char               rep    rp   repeat char #1 #2
-                                             times (P*)
-       req_for_input             rfi    RF   send next input char
-                                             (for ptys)
-       reset_1string             rs1    r1   reset string
-       reset_2string             rs2    r2   reset string
-       reset_3string             rs3    r3   reset string
-       reset_file                rf     rf   name of reset file
-       restore_cursor            rc     rc   restore cursor to
-                                             position of last
-                                             save_cursor
-       row_address               vpa    cv   vertical position #1
-                                             absolute (P)
-       save_cursor               sc     sc   save current cursor
-                                             position (P)
-       scroll_forward            ind    sf   scroll text up (P)
-       scroll_reverse            ri     sr   scroll text down (P)
-       select_char_set           scs    Zj   Select character
-                                             set, #1
-       set_attributes            sgr    sa   define video
-                                             attributes #1-#9
-                                             (PG9)
-       set_background            setb   Sb   Set background color
-                                             #1
-       set_bottom_margin         smgb   Zk   Set bottom margin at
-                                             current line
-       set_bottom_margin_parm    smgbp  Zl   Set bottom margin at
-                                             line #1 or (if smgtp
-                                             is not given) #2
-                                             lines from bottom
-       set_clock                 sclk   SC   set clock, #1 hrs #2
-                                             mins #3 secs
-       set_color_pair            scp    sp   Set current color
-                                             pair to #1
-       set_foreground            setf   Sf   Set foreground color
-                                             #1
-       set_left_margin           smgl   ML   set left soft margin
-                                             at current column.
-                                             See smgl. (ML is not
-                                             in BSD termcap).
-       set_left_margin_parm      smglp  Zm   Set left (right)
-                                             margin at column #1
-       set_right_margin          smgr   MR   set right soft mar-
-                                             gin at current col-
-                                             umn
-       set_right_margin_parm     smgrp  Zn   Set right margin at
-                                             column #1
-
-       set_tab                   hts    st   set a tab in every
-                                             row, current columns
-       set_top_margin            smgt   Zo   Set top margin at
-                                             current line
-       set_top_margin_parm       smgtp  Zp   Set top (bottom)
-                                             margin at row #1
-       set_window                wind   wi   current window is
-                                             lines #1-#2 cols
-                                             #3-#4
-       start_bit_image           sbim   Zq   Start printing bit
-                                             image graphics
-       start_char_set_def        scsd   Zr   Start character set
-                                             definition #1, with
-                                             #2 characters in the
-                                             set
-       stop_bit_image            rbim   Zs   Stop printing bit
-                                             image graphics
-       stop_char_set_def         rcsd   Zt   End definition of
-                                             character set #1
-       subscript_characters      subcs  Zu   List of subscript-
-                                             able characters
-       superscript_characters    supcs  Zv   List of superscript-
-                                             able characters
-       tab                       ht     ta   tab to next 8-space
-                                             hardware tab stop
-       these_cause_cr            docr   Zw   Printing any of
-                                             these characters
-                                             causes CR
-       to_status_line            tsl    ts   move to status line,
-                                             column #1
-       tone                      tone   TO   select touch tone
-                                             dialing
-       underline_char            uc     uc   underline char and
-                                             move past it
-       up_half_line              hu     hu   half a line up
-       user0                     u0     u0   User string #0
-       user1                     u1     u1   User string #1
-       user2                     u2     u2   User string #2
-       user3                     u3     u3   User string #3
-       user4                     u4     u4   User string #4
-       user5                     u5     u5   User string #5
-       user6                     u6     u6   User string #6
-       user7                     u7     u7   User string #7
-       user8                     u8     u8   User string #8
-       user9                     u9     u9   User string #9
-       wait_tone                 wait   WA   wait for dial-tone
-       xoff_character            xoffc  XF   XOFF character
-       xon_character             xonc   XN   XON character
-       zero_motion               zerom  Zx   No motion for subse-
-                                             quent character
-
-       The  following  string  capabilities  are  present  in the
-       SVr4.0 term structure, but were originally not  documented
-       in the man page.
-
-
-               Variable          Cap-     TCap    Description
-                String           name     Code
-       alt_scancode_esc          scesa    S8   Alternate escape
-                                               for scancode emu-
-                                               lation
-       bit_image_carriage_return bicr     Yv   Move to beginning
-                                               of same row
-       bit_image_newline         binel    Zz   Move to next row
-                                               of the bit image
-
-       bit_image_repeat          birep    Xy   Repeat bit image
-                                               cell #1 #2 times
-       char_set_names            csnm     Zy   Produce #1'th item
-                                               from list of char-
-                                               acter set names
-       code_set_init             csin     ci   Init sequence for
-                                               multiple codesets
-       color_names               colornm  Yw   Give name for
-                                               color #1
-       define_bit_image_region   defbi    Yx   Define rectan-
-                                               gualar bit image
-                                               region
-       device_type               devt     dv   Indicate lan-
-                                               guage/codeset sup-
-                                               port
-       display_pc_char           dispc    S1   Display PC charac-
-                                               ter #1
-       end_bit_image_region      endbi    Yy   End a bit-image
-                                               region
-       enter_pc_charset_mode     smpch    S2   Enter PC character
-                                               display mode
-       enter_scancode_mode       smsc     S4   Enter PC scancode
-                                               mode
-       exit_pc_charset_mode      rmpch    S3   Exit PC character
-                                               display mode
-       exit_scancode_mode        rmsc     S5   Exit PC scancode
-                                               mode
-       get_mouse                 getm     Gm   Curses should get
-                                               button events,
-                                               parameter #1 not
-                                               documented.
-       key_mouse                 kmous    Km   Mouse event has
-                                               occurred
-       mouse_info                minfo    Mi   Mouse status
-                                               information
-       pc_term_options           pctrm    S6   PC terminal
-                                               options
-       pkey_plab                 pfxl     xl   Program function
-                                               key #1 to type
-                                               string #2 and show
-                                               string #3
-       req_mouse_pos             reqmp    RQ   Request mouse
-                                               position
-       scancode_escape           scesc    S7   Escape for scan-
-                                               code emulation
-       set0_des_seq              s0ds     s0   Shift to codeset 0
-                                               (EUC set 0, ASCII)
-       set1_des_seq              s1ds     s1   Shift to codeset 1
-       set2_des_seq              s2ds     s2   Shift to codeset 2
-       set3_des_seq              s3ds     s3   Shift to codeset 3
-       set_a_background          setab    AB   Set background
-                                               color to #1, using
-                                               ANSI escape
-       set_a_foreground          setaf    AF   Set foreground
-                                               color to #1, using
-                                               ANSI escape
-       set_color_band            setcolor Yz   Change to ribbon
-                                               color #1
-       set_lr_margin             smglr    ML   Set both left and
-                                               right margins to
-                                               #1, #2.  (ML is
-                                               not in BSD term-
-                                               cap).
-       set_page_length           slines   YZ   Set page length to
-                                               #1 lines
-
-       set_tb_margin             smgtb    MT   Sets both top and
-                                               bottom margins to
-                                               #1, #2
-
-        The XSI Curses  standard  added  these.   They  are  some
-        post-4.1  versions  of System V curses, e.g., Solaris 2.5
-        and IRIX 6.x.  The ncurses termcap  names  for  them  are
-        invented; according to the XSI Curses standard, they have
-        no termcap names.  If your compiled terminfo entries  use
-        these,  they  may  not be binary-compatible with System V
-        terminfo entries after SVr4.1; beware!
-
-
-                Variable         Cap-   TCap     Description
-                 String          name   Code
-        enter_horizontal_hl_mode ehhlm  Xh   Enter horizontal
-                                             highlight mode
-        enter_left_hl_mode       elhlm  Xl   Enter left highlight
-                                             mode
-        enter_low_hl_mode        elohlm Xo   Enter low highlight
-                                             mode
-        enter_right_hl_mode      erhlm  Xr   Enter right high-
-                                             light mode
-        enter_top_hl_mode        ethlm  Xt   Enter top highlight
-                                             mode
-        enter_vertical_hl_mode   evhlm  Xv   Enter vertical high-
-                                             light mode
-        set_a_attributes         sgr1   sA   Define second set of
-                                             video attributes
-                                             #1-#6
-        set_pglen_inch           slengthsL   YI Set page length
-                                             to #1 hundredth of
-                                             an inch
-
-   A Sample Entry
-       The following entry, describing an ANSI-standard terminal,
-       is  representative  of  what a terminfo entry for a modern
-       terminal typically looks like.
-
-     ansi|ansi/pc-term compatible with color,
-             mc5i,
-             colors#8, ncv#3, pairs#64,
-             cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
-             cuu=\E[%p1%dA, dch=\E[%p1%dP, dl=\E[%p1%dM,
-             ech=\E[%p1%dX, el1=\E[1K, hpa=\E[%p1%dG, ht=\E[I,
-             ich=\E[%p1%d@, il=\E[%p1%dL, indn=\E[%p1%dS, .indn=\E[%p1%dT,
-             kbs=^H, kcbt=\E[Z, kcub1=\E[D, kcud1=\E[B,
-             kcuf1=\E[C, kcuu1=\E[A, kf1=\E[M, kf10=\E[V,
-             kf11=\E[W, kf12=\E[X, kf2=\E[N, kf3=\E[O, kf4=\E[P,
-             kf5=\E[Q, kf6=\E[R, kf7=\E[S, kf8=\E[T, kf9=\E[U,
-             kich1=\E[L, mc4=\E[4i, mc5=\E[5i, nel=\r\E[S,
-             op=\E[37;40m, rep=%p1%c\E[%p2%{1}%-%db,
-             rin=\E[%p1%dT, s0ds=\E(B, s1ds=\E)B, s2ds=\E*B,
-             s3ds=\E+B, setab=\E[4%p1%dm, setaf=\E[3%p1%dm,
-             setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-             setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
-             sgr=\E[0;10%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;%?%p8%t;11%;%?%p9%t;12%;m,
-             sgr0=\E[0;10m, tbc=\E[2g, u6=\E[%d;%dR, u7=\E[6n,
-             u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%p1%dd,
-
-       Entries may continue onto multiple lines by placing  white
-       space  at  the  beginning  of  each line except the first.
-       Comments may be included on lines  beginning  with  ``#''.
-       Capabilities in terminfo are of three types: Boolean capa-
-       bilities which indicate that the terminal has some partic-
-       ular  feature, numeric capabilities giving the size of the
-       terminal or the size  of  particular  delays,  and  string
-       capabilities,  which  give a sequence which can be used to
-       perform particular terminal operations.
-
-
-   Types of Capabilities
-       All capabilities have names.  For instance, the fact  that
-       ANSI-standard  terminals  have automatic margins (i.e., an
-       automatic return and line-feed when the end of a  line  is
-       reached)  is  indicated  by  the capability am.  Hence the
-       description of ansi includes am.  Numeric capabilities are
-       followed  by  the character `#' and then a positive value.
-       Thus cols, which indicates the number of columns the  ter-
-       minal  has,  gives  the  value  `80' for ansi.  Values for
-       numeric capabilities may be specified in decimal, octal or
-       hexadecimal,  using the C programming language conventions
-       (e.g., 255, 0377 and 0xff or 0xFF).
-
-       Finally, string valued capabilities, such as el (clear  to
-       end of line sequence) are given by the two-character code,
-       an `=', and then a string ending  at  the  next  following
-       `,'.
-
-       A  number  of  escape sequences are provided in the string
-       valued capabilities for easy encoding of characters there.
-       Both  \E  and  \e map to an ESCAPE character, ^x maps to a
-       control-x for any appropriate x, and the sequences  \n  \l
-       \r  \t  \b  \f  \s give a newline, line-feed, return, tab,
-       backspace, form-feed, and space.  Other escapes include \^
-       for  ^, \\ for \, \, for comma, \: for :, and \0 for null.
-       (\0 will produce \200, which does not terminate  a  string
-       but behaves as a null character on most terminals, provid-
-       ing CS7 is specified.  See stty(1).)  Finally,  characters
-       may be given as three octal digits after a \.
-
-       A  delay  in  milliseconds may appear anywhere in a string
-       capability, enclosed in $<..> brackets, as in  el=\EK$<5>,
-       and  padding  characters  are supplied by tputs to provide
-       this delay.  The delay must be a number with at  most  one
-       decimal place of precision; it may be followed by suffixes
-       `*' or '/' or both.  A  `*'  indicates  that  the  padding
-       required  is  proportional to the number of lines affected
-       by the  operation,  and  the  amount  given  is  the  per-
-       affected-unit  padding  required.   (In the case of insert
-       character,  the  factor  is  still  the  number  of  lines
-       affected.)   Normally,  padding  is advisory if the device
-       has the xon capability; it is used  for  cost  computation
-       but  does not trigger delays.  A `/' suffix indicates that
-       the padding is mandatory and forces a delay of  the  given
-       number  of  milliseconds  even on devices for which xon is
-       present to indicate flow control.
-
-       Sometimes individual capabilities must be  commented  out.
-       To  do this, put a period before the capability name.  For
-       example, see the second ind in the example above.
-
-
-   Fetching Compiled Descriptions
-       If the environment variable TERMINFO is set, it is  inter-
-       preted  as the pathname of a directory containing the com-
-       piled description you are working on.  Only that directory
-       is searched.
-
-       If  TERMINFO  is  not set, the ncurses version of the ter-
-       minfo reader code  will  instead  look  in  the  directory
-       $HOME/.terminfo  for  a compiled description.  If it fails
-       to find one  there,  and  the  environment  variable  TER-
-       MINFO_DIRS  is set, it will interpret the contents of that
-       variable as a list of colon- separated directories  to  be
-       searched  (an  empty  entry is interpreted as a command to
-       search /usr/share/terminfo).  If no description  is  found
-       in  any of the TERMINFO_DIRS directories, the fetch fails.
-
-       If neither TERMINFO nor TERMINFO_DIRS  is  set,  the  last
-       place   tried  will  be  the  system  terminfo  directory,
-       /usr/share/terminfo.
-
-       (Neither the  $HOME/.terminfo  lookups  nor  TERMINFO_DIRS
-       extensions   are  supported  under  stock  System  V  ter-
-       minfo/curses.)
-
-
-   Preparing Descriptions
-       We now outline how to prepare descriptions  of  terminals.
-       The  most  effective way to prepare a terminal description
-       is by imitating the description of a similar  terminal  in
-       terminfo  and  to  build up a description gradually, using
-       partial descriptions with vi or some other screen-oriented
-       program  to  check that they are correct.  Be aware that a
-       very unusual terminal may expose deficiencies in the abil-
-       ity  of  the  terminfo  file to describe it or bugs in the
-       screen-handling code of the test program.
-
-       To get the padding for insert line right (if the  terminal
-       manufacturer did not document it) a severe test is to edit
-       a large file at 9600 baud, delete 16 or so lines from  the
-       middle  of  the screen, then hit the `u' key several times
-       quickly.  If the terminal messes up, more padding is  usu-
-       ally  needed.  A similar test can be used for insert char-
-       acter.
-
-
-   Basic Capabilities
-       The number of columns on each line  for  the  terminal  is
-       given  by the cols numeric capability.  If the terminal is
-       a CRT, then the number of lines on the screen is given  by
-       the lines capability.  If the terminal wraps around to the
-       beginning of the next line when it reaches the right  mar-
-       gin, then it should have the am capability.  If the termi-
-       nal can clear its screen, leaving the cursor in  the  home
-       position,  then this is given by the clear string capabil-
-       ity.  If the terminal overstrikes (rather than clearing  a
-       position  when  a character is struck over) then it should
-       have the os capability.  If the  terminal  is  a  printing
-       terminal,  with no soft copy unit, give it both hc and os.
-       (os applies to storage scope terminals, such as  TEKTRONIX
-       4010  series, as well as hard copy and APL terminals.)  If
-       there is a code to move the cursor to the left edge of the
-       current row, give this as cr.  (Normally this will be car-
-       riage return, control M.)  If there is a code  to  produce
-       an audible signal (bell, beep, etc) give this as bel.
-
-       If  there is a code to move the cursor one position to the
-       left (such as backspace) that capability should  be  given
-       as  cub1.   Similarly, codes to move to the right, up, and
-       down should be given as cuf1, cuu1, and cud1.  These local
-       cursor  motions  should not alter the text they pass over,
-       for example, you would not normally use  `cuf1= '  because
-       the space would erase the character moved over.
-
-       A  very  important  point  here  is  that the local cursor
-       motions encoded in terminfo are undefined at the left  and
-       top  edges  of  a  CRT  terminal.   Programs  should never
-       attempt to backspace around the left edge,  unless  bw  is
-       given, and never attempt to go up locally off the top.  In
-       order to scroll text up, a program will go to  the  bottom
-       left corner of the screen and send the ind (index) string.
-
-       To scroll text down, a program goes to the top left corner
-       of  the  screen  and  sends the ri (reverse index) string.
-       The strings ind and ri are undefined  when  not  on  their
-       respective corners of the screen.
-
-       Parameterized versions of the scrolling sequences are indn
-       and rin which have the same semantics as ind and ri except
-       that  they take one parameter, and scroll that many lines.
-       They are also undefined except at the appropriate edge  of
-       the screen.
-
-       The  am  capability tells whether the cursor sticks at the
-       right edge of the screen when text  is  output,  but  this
-       does not necessarily apply to a cuf1 from the last column.
-       The only local motion which is defined from the left  edge
-       is  if  bw  is  given, then a cub1 from the left edge will
-       move to the right edge of the previous row.  If bw is  not
-       given,  the effect is undefined.  This is useful for draw-
-       ing a box around the edge of the screen, for example.   If
-       the  terminal has switch selectable automatic margins, the
-       terminfo file usually assumes that this is on;  i.e.,  am.
-       If  the  terminal  has  a command which moves to the first
-       column of the next line, that command can be given as  nel
-       (newline).   It  does not matter if the command clears the
-       remainder of the current line, so if the terminal  has  no
-       cr  and lf it may still be possible to craft a working nel
-       out of one or both of them.
-
-       These  capabilities  suffice  to  describe  hard-copy  and
-       "glass-tty"  terminals.   Thus  the  model  33 teletype is
-       described as
-
-       33|tty33|tty|model 33 teletype,
-            bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,
-
-       while the Lear Siegler ADM-3 is described as
-
-       adm3|3|lsi adm3,
-            am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
-            ind=^J, lines#24,
-
-
-   Parameterized Strings
-       Cursor addressing and other strings  requiring  parameters
-       in  the  terminal  are described by a parameterized string
-       capability, with printf(3) like escapes  %x  in  it.   For
-       example,  to  address  the  cursor,  the cup capability is
-       given, using two parameters: the row and column to address
-       to.  (Rows and columns are numbered from zero and refer to
-       the physical screen visible to the user, not to any unseen
-       memory.)   If  the  terminal  has  memory  relative cursor
-       addressing, that can be indicated by mrcup.
-
-       The parameter mechanism uses a stack and special  %  codes
-       to  manipulate  it.  Typically a sequence will push one of
-       the parameters onto the stack and then print  it  in  some
-       format.   Print  (e.g.,  "%d")  is  a special case.  Other
-       operations, including "%t"  pop  their  operand  from  the
-       stack.  It is noted that more complex operations are often
-       necessary, e.g., in the sgr string.
-
-       The % encodings have the following meanings:
-
-
-       %%   outputs `%'
-
-       %[[:]flags][width[.precision]][doxXs]
-            as in printf, flags are [-+#] and space.  Use  a  `:'
-            to  allow the next character to be a `-' flag, avoid-
-            ing interpreting "%-" as an operator.
-
-       %c   print pop() like %c in printf
-
-       %s   print pop() like %s in printf
-
-       %p[1-9]
-            push i'th parameter
-
-       %P[a-z]
-            set dynamic variable [a-z] to pop()
-
-       %g[a-z]
-            get dynamic variable [a-z] and push it
-
-       %P[A-Z]
-            set static variable [a-z] to pop()
-
-       %g[A-Z]
-            get static variable [a-z] and push it
-
-            The terms  "static"  and  "dynamic"  are  misleading.
-            Historically,  these are simply two different sets of
-            variables, whose values are not reset  between  calls
-            to  tparm.   However,  that fact is not documented in
-            other implementations.  Relying on it will  adversely
-            impact portability to other implementations.
-
-       %'c' char constant c
-
-       %{nn}
-            integer constant nn
-
-       %l   push strlen(pop)
-
-       %+ %- %* %/ %m
-            arithmetic (%m is mod): push(pop() op pop())
-
-       %& %| %^
-            bit operations (AND, OR and exclusive-OR): push(pop()
-            op pop())
-
-       %= %> %<
-            logical operations: push(pop() op pop())
-
-       %A, %O
-            logical AND and OR operations (for conditionals)
-
-       %! %~
-            unary  operations  (logical  and   bit   complement):
-            push(op pop())
-
-       %i   add 1 to first two parameters (for ANSI terminals)
-
-       %? expr %t thenpart %e elsepart %;
-            This  forms  an  if-then-else.   The  %e  elsepart is
-            optional.  Usually the %? expr part  pushes  a  value
-            onto  the stack, and %t pops it from the stack, test-
-            ing if it is nonzero (true).  If it is zero  (false),
-            control passes to the %e (else) part.
-
-            It is possible to form else-if's a la Algol 68:
-            %? c1 %t b1 %e c2 %t b2 %e c3 %t b3 %e c4 %t b4 %e %;
-
-            where ci are conditions, bi are bodies.
-
-            Use the -f option of tic or infocmp to see the struc-
-            ture  of if-then-else's.  Some strings, e.g., sgr can
-            be very complicated when written on one line.  The -f
-            option  splits  the  string into lines with the parts
-            indented.
-
-       Binary operations are in postfix form with the operands in
-       the  usual  order.   That  is,  to  get  x-5 one would use
-       "%gx%{5}%-".  %P and %g variables  are  persistent  across
-       escape-string evaluations.
-
-       Consider the HP2645, which, to get to row 3 and column 12,
-       needs to be sent \E&a12c03Y  padded  for  6  milliseconds.
-       Note  that  the  order of the rows and columns is inverted
-       here, and that the row and column are printed as two  dig-
-       its.  Thus its cup capability is "cup=6\E&%p2%2dc%p1%2dY".
-
-       The Microterm ACT-IV needs the current row and column sent
-       preceded  by  a ^T, with the row and column simply encoded
-       in binary, "cup=^T%p1%c%p2%c".  Terminals which  use  "%c"
-       need  to  be  able  to backspace the cursor (cub1), and to
-       move the cursor up one line on the screen (cuu1).  This is
-       necessary  because it is not always safe to transmit \n ^D
-       and \r, as the system may change or  discard  them.   (The
-       library  routines  dealing  with terminfo set tty modes so
-       that tabs are never expanded, so \t is safe to send.  This
-       turns out to be essential for the Ann Arbor 4080.)
-
-       A final example is the LSI ADM-3a, which uses row and col-
-       umn  offset  by  a  blank  character,  thus  "cup=\E=%p1%'
-       '%+%c%p2%'  '%+%c".   After sending `\E=', this pushes the
-       first parameter, pushes the ASCII value for a space  (32),
-       adds  them  (pushing  the sum on the stack in place of the
-       two previous values) and outputs that value as  a  charac-
-       ter.   Then  the  same  is  done for the second parameter.
-       More complex arithmetic is possible using the stack.
-
-
-   Cursor Motions
-       If the terminal has a fast way to home the cursor (to very
-       upper  left  corner  of  screen) then this can be given as
-       home; similarly a fast way of getting to the  lower  left-
-       hand  corner can be given as ll; this may involve going up
-       with cuu1 from the home position,  but  a  program  should
-       never  do this itself (unless ll does) because it can make
-       no assumption about the effect of moving up from the  home
-       position.   Note  that  the  home  position is the same as
-       addressing to (0,0): to the top left corner of the screen,
-       not  of  memory.   (Thus, the \EH sequence on HP terminals
-       cannot be used for home.)
-
-       If the terminal has row or column absolute cursor address-
-       ing,  these  can be given as single parameter capabilities
-       hpa (horizontal position absolute) and vpa (vertical posi-
-       tion absolute).  Sometimes these are shorter than the more
-       general two parameter sequence (as with  the  hp2645)  and
-       can   be   used  in  preference  to  cup.   If  there  are
-       parameterized local motions (e.g., move n  spaces  to  the
-       right) these can be given as cud, cub, cuf, and cuu with a
-       single parameter  indicating  how  many  spaces  to  move.
-       These  are  primarily useful if the terminal does not have
-       cup, such as the TEKTRONIX 4025.
-
-       If the terminal needs to be in a special mode when running
-       a program that uses these capabilities, the codes to enter
-       and exit this mode can be given as smcup and rmcup.   This
-       arises,  for example, from terminals like the Concept with
-       more than one page of memory.  If the  terminal  has  only
-       memory  relative cursor addressing and not screen relative
-       cursor addressing, a one screen-sized window must be fixed
-       into  the terminal for cursor addressing to work properly.
-       This is also used for the TEKTRONIX 4025, where smcup sets
-       the  command character to be the one used by terminfo.  If
-       the smcup sequence will not restore the  screen  after  an
-       rmcup sequence is output (to the state prior to outputting
-       rmcup), specify nrrmc.
-
-
-   Area Clears
-       If the terminal can clear from the current position to the
-       end  of  the  line,  leaving  the cursor where it is, this
-       should be given as el.  If the terminal can clear from the
-       beginning  of  the line to the current position inclusive,
-       leaving the cursor where it is, this should  be  given  as
-       el1.   If the terminal can clear from the current position
-       to the end of the display, then this should  be  given  as
-       ed.   Ed  is only defined from the first column of a line.
-       (Thus, it can be simulated by a request to delete a  large
-       number of lines, if a true ed is not available.)
-
-
-   Insert/delete line and vertical motions
-       If  the terminal can open a new blank line before the line
-       where the cursor is, this should be given as il1; this  is
-       done  only  from the first position of a line.  The cursor
-       must then appear on the newly blank line.  If the terminal
-       can  delete  the  line  which  the cursor is on, then this
-       should be given as dl1; this is done only from  the  first
-       position  on  the line to be deleted.  Versions of il1 and
-       dl1 which take a single parameter  and  insert  or  delete
-       that many lines can be given as il and dl.
-
-       If  the terminal has a settable scrolling region (like the
-       vt100) the command to set this can be described  with  the
-       csr  capability,  which  takes two parameters: the top and
-       bottom lines of the scrolling region.  The cursor position
-       is, alas, undefined after using this command.
-
-       It  is possible to get the effect of insert or delete line
-       using csr on a properly chosen region; the sc and rc (save
-       and  restore  cursor)  commands may be useful for ensuring
-       that your synthesized insert/delete string does  not  move
-       the  cursor.  (Note that the ncurses(3x) library does this
-       synthesis  automatically,  so   you   need   not   compose
-       insert/delete strings for an entry with csr).
-
-       Yet another way to construct insert and delete might be to
-       use a combination of index with  the  memory-lock  feature
-       found  on some terminals (like the HP-700/90 series, which
-       however also has insert/delete).
-
-       Inserting lines at the top or bottom  of  the  screen  can
-       also  be  done using ri or ind on many terminals without a
-       true insert/delete line, and is often faster even on  ter-
-       minals with those features.
-
-       The  boolean  non_dest_scroll_region should be set if each
-       scrolling window is effectively a view port on  a  screen-
-       sized  canvas.   To  test  for  this  capability, create a
-       scrolling region in the middle of the screen, write  some-
-       thing  to  the  bottom line, move the cursor to the top of
-       the region, and do ri followed by dl1 or ind.  If the data
-       scrolled  off  the  bottom  of  the  region  by the ri re-
-       appears, then scrolling is non-destructive.  System V  and
-       XSI  Curses  expect that ind, ri, indn, and rin will simu-
-       late destructive scrolling; their  documentation  cautions
-       you  not  to  define csr unless this is true.  This curses
-       implementation is more liberal and will do explicit erases
-       after scrolling if ndstr is defined.
-
-       If the terminal has the ability to define a window as part
-       of memory, which all commands affect, it should  be  given
-       as the parameterized string wind.  The four parameters are
-       the starting and ending lines in memory and  the  starting
-       and ending columns in memory, in that order.
-
-       If  the terminal can retain display memory above, then the
-       da capability should be given; if display  memory  can  be
-       retained  below,  then db should be given.  These indicate
-       that deleting a line  or  scrolling  may  bring  non-blank
-       lines  up  from  below  or that scrolling back with ri may
-       bring down non-blank lines.
-
-
-   Insert/Delete Character
-       There are two basic kinds of  intelligent  terminals  with
-       respect  to insert/delete character which can be described
-       using terminfo.  The most common  insert/delete  character
-       operations  affect only the characters on the current line
-       and shift characters off the  end  of  the  line  rigidly.
-       Other  terminals,  such  as the Concept 100 and the Perkin
-       Elmer Owl, make a distinction between  typed  and  untyped
-       blanks  on  the  screen, shifting upon an insert or delete
-       only to an untyped blank on the  screen  which  is  either
-       eliminated,  or  expanded  to two untyped blanks.  You can
-       determine the kind of terminal you have  by  clearing  the
-       screen  and  then typing text separated by cursor motions.
-       Type "abc    def" using local cursor motions (not  spaces)
-       between the "abc" and the "def".  Then position the cursor
-       before the "abc" and put the terminal in insert mode.   If
-       typing  characters  causes  the  rest of the line to shift
-       rigidly and characters to fall off the end, then your ter-
-       minal  does  not  distinguish  between  blanks and untyped
-       positions.  If the "abc" shifts over to  the  "def"  which
-       then  move together around the end of the current line and
-       onto the next as you insert, you have the second  type  of
-       terminal,  and should give the capability in, which stands
-       for "insert null".  While these are two logically separate
-       attributes  (one  line  versus multi-line insert mode, and
-       special treatment of untyped spaces) we have seen no  ter-
-       minals whose insert mode cannot be described with the sin-
-       gle attribute.
-
-       Terminfo can describe both terminals which have an  insert
-       mode, and terminals which send a simple sequence to open a
-       blank position on the current  line.   Give  as  smir  the
-       sequence  to  get  into  insert  mode.   Give  as rmir the
-       sequence to leave insert  mode.   Now  give  as  ich1  any
-       sequence  needed  to  be  sent  just  before  sending  the
-       character to be inserted.   Most  terminals  with  a  true
-       insert  mode  will  not  give ich1; terminals which send a
-       sequence to open a screen position should give it here.
-
-       If your terminal has both, insert mode is usually  prefer-
-       able  to  ich1.   Technically,  you  should  not give both
-       unless the terminal actually requires both to be  used  in
-       combination.   Accordingly,  some  non-curses applications
-       get confused if both are present; the symptom  is  doubled
-       characters in an update using insert.  This requirement is
-       now rare; most ich sequences do not require previous smir,
-       and most smir insert modes do not require ich1 before each
-       character.  Therefore, the  new  curses  actually  assumes
-       this  is the case and uses either rmir/smir or ich/ich1 as
-       appropriate (but not both).  If you have to write an entry
-       to  be  used under new curses for a terminal old enough to
-       need both, include the rmir/smir sequences in ich1.
-
-       If post insert padding is needed, give this as a number of
-       milliseconds  in ip (a string option).  Any other sequence
-       which may need to be sent after  an  insert  of  a  single
-       character may also be given in ip.  If your terminal needs
-       both to be placed into an `insert mode' and a special code
-       to  precede  each  inserted character, then both smir/rmir
-       and ich1 can be given, and both will  be  used.   The  ich
-       capability, with one parameter, n, will repeat the effects
-       of ich1 n times.
-
-       If padding is necessary between characters typed while not
-       in  insert  mode,  give  this  as a number of milliseconds
-       padding in rmp.
-
-       It is occasionally  necessary  to  move  around  while  in
-       insert  mode  to delete characters on the same line (e.g.,
-       if there is a tab after the insertion position).  If  your
-       terminal  allows  motion while in insert mode you can give
-       the capability mir to speed up  inserting  in  this  case.
-       Omitting  mir  will  affect  only  speed.   Some terminals
-       (notably Datamedia's) must not have mir because of the way
-       their insert mode works.
-
-       Finally,  you  can specify dch1 to delete a single charac-
-       ter, dch with one parameter, n, to  delete  n  characters,
-       and  delete mode by giving smdc and rmdc to enter and exit
-       delete mode (any mode the terminal needs to be  placed  in
-       for dch1 to work).
-
-       A  command to erase n characters (equivalent to outputting
-       n blanks without moving the cursor) can be  given  as  ech
-       with one parameter.
-
-
-   Highlighting, Underlining, and Visible Bells
-       If  your  terminal  has  one  or  more  kinds  of  display
-       attributes, these can be represented in a number  of  dif-
-       ferent ways.  You should choose one display form as stand-
-       out mode, representing a good, high contrast, easy-on-the-
-       eyes,  format  for  highlighting  error messages and other
-       attention getters.  (If you have a choice,  reverse  video
-       plus  half-bright  is  good, or reverse video alone.)  The
-       sequences to enter and exit standout  mode  are  given  as
-       smso  and  rmso, respectively.  If the code to change into
-       or out of standout mode  leaves  one  or  even  two  blank
-       spaces  on the screen, as the TVI 912 and Teleray 1061 do,
-       then xmc should be given to tell how many spaces are left.
-
-       Codes  to  begin  underlining  and  end underlining can be
-       given as smul and rmul respectively.  If the terminal  has
-       a  code  to  underline  the current character and move the
-       cursor one space to the right, such as the Microterm Mime,
-       this can be given as uc.
-
-       Other  capabilities  to  enter  various highlighting modes
-       include blink (blinking) bold (bold or extra  bright)  dim
-       (dim  or  half-bright)  invis (blanking or invisible text)
-       prot (protected) rev (reverse video) sgr0  (turn  off  all
-       attribute  modes)  smacs  (enter  alternate  character set
-       mode) and  rmacs  (exit  alternate  character  set  mode).
-       Turning  on  any of these modes singly may or may not turn
-       off other modes.
-
-       If there is a sequence to set  arbitrary  combinations  of
-       modes,  this should be given as sgr (set attributes), tak-
-       ing 9 parameters.  Each parameter is either 0 or  nonzero,
-       as the corresponding attribute is on or off.  The 9 param-
-       eters are, in order: standout, underline, reverse,  blink,
-       dim,  bold,  blank, protect, alternate character set.  Not
-       all modes need be supported by sgr, only those  for  which
-       corresponding separate attribute commands exist.
-
-       For example, the DEC vt220 supports most of the modes:
-
-
-            tparm parameter   attribute    escape sequence
-
-            none              none         \E[0m
-            p1                standout     \E[0;1;7m
-            p2                underline    \E[0;4m
-            p3                reverse      \E[0;7m
-            p4                blink        \E[0;5m
-            p5                dim          not available
-            p6                bold         \E[0;1m
-            p7                invis        \E[0;8m
-            p8                protect      not used
-            p9                altcharset   ^O (off) ^N (on)
-
-       We  begin each escape sequence by turning off any existing
-       modes, since there is no quick way  to  determine  whether
-       they are active.  Standout is set up to be the combination
-       of reverse and bold.  The vt220  terminal  has  a  protect
-       mode,  though  it  is  not commonly used in sgr because it
-       protects characters on the screen  from  the  host's  era-
-       sures.   The  altcharset mode also is different in that it
-       is either ^O or ^N, depending on whether it is off or  on.
-       If  all  modes  are  turned  on, the resulting sequence is
-       \E[0;1;4;5;7;8m^N.
-
-       Some sequences are common to different modes.   For  exam-
-       ple,  ;7  is output when either p1 or p3 is true, that is,
-       if either standout or reverse modes are turned on.
-
-       Writing out the above sequences, along with  their  depen-
-       dencies yields
-
-
-          sequence   when to output      terminfo translation
-
-          \E[0       always              \E[0
-          ;1         if p1 or p6         %?%p1%p6%|%t;1%;
-          ;4         if p2               %?%p2%|%t;4%;
-          ;5         if p4               %?%p4%|%t;5%;
-
-          ;7         if p1 or p3         %?%p1%p3%|%t;7%;
-          ;8         if p7               %?%p7%|%t;8%;
-          m          always              m
-          ^N or ^O   if p9 ^N, else ^O   %?%p9%t^N%e^O%;
-
-       Putting this all together into the sgr sequence gives:
-
-           sgr=\E[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;
-               %?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
-
-       Remember  that  if  you specify sgr, you must also specify
-       sgr0.  Also, some implementations rely on sgr being  given
-       if  sgr0  is, Not all terminfo entries necessarily have an
-       sgr string, however.  Many terminfo  entries  are  derived
-       from  termcap  entries which have no sgr string.  The only
-       drawback to adding an sgr  string  is  that  termcap  also
-       assumes  that  sgr0  does not exit alternate character set
-       mode.
-
-       Terminals with the ``magic cookie'' glitch  (xmc)  deposit
-       special   ``cookies''   when   they  receive  mode-setting
-       sequences, which affect the display algorithm rather  than
-       having  extra  bits  for  each character.  Some terminals,
-       such as the HP 2621,  automatically  leave  standout  mode
-       when  they  move to a new line or the cursor is addressed.
-       Programs using standout mode  should  exit  standout  mode
-       before  moving the cursor or sending a newline, unless the
-       msgr capability, asserting that it  is  safe  to  move  in
-       standout mode, is present.
-
-       If  the terminal has a way of flashing the screen to indi-
-       cate an error quietly (a bell replacement) then  this  can
-       be given as flash; it must not move the cursor.
-
-       If  the  cursor  needs to be made more visible than normal
-       when it is not on the bottom line (to make, for example, a
-       non-blinking  underline  into  an  easier to find block or
-       blinking underline) give this sequence as cvvis.  If there
-       is  a  way  to  make the cursor completely invisible, give
-       that as civis.  The capability cnorm should be given which
-       undoes the effects of both of these modes.
-
-       If your terminal correctly generates underlined characters
-       (with no special codes needed) even  though  it  does  not
-       overstrike,  then you should give the capability ul.  If a
-       character overstriking another leaves both  characters  on
-       the screen, specify the capability os.  If overstrikes are
-       erasable with a blank, then this should  be  indicated  by
-       giving eo.
-
-
-   Keypad and Function Keys
-       If the terminal has a keypad that transmits codes when the
-       keys are pressed, this information  can  be  given.   Note
-       that it is not possible to handle terminals where the key-
-       pad only works in local (this applies, for example, to the
-       unshifted  HP  2621  keys).   If  the keypad can be set to
-       transmit or not transmit, give these  codes  as  smkx  and
-       rmkx.  Otherwise the keypad is assumed to always transmit.
-       The codes sent by the left arrow, right arrow,  up  arrow,
-       down  arrow,  and  home keys can be given as kcub1, kcuf1,
-       kcuu1, kcud1, and khome respectively.  If there are  func-
-       tion  keys  such  as f0, f1, ..., f10, the codes they send
-       can be given as kf0, kf1, ..., kf10.  If these  keys  have
-       labels  other  than the default f0 through f10, the labels
-       can  be  given  as  lf0,  lf1,  ...,  lf10.    The   codes
-       transmitted  by  certain  other special keys can be given:
-       kll (home down), kbs (backspace), ktbc (clear  all  tabs),
-       kctab  (clear  the  tab  stop in this column), kclr (clear
-       screen or  erase  key),  kdch1  (delete  character),  kdl1
-       (delete line), krmir (exit insert mode), kel (clear to end
-       of line), ked (clear to  end  of  screen),  kich1  (insert
-       character  or  enter insert mode), kil1 (insert line), knp
-       (next  page),  kpp  (previous  page),  kind  (scroll  for-
-       ward/down), kri (scroll backward/up), khts (set a tab stop
-       in this column).  In addition, if the keypad has a 3 by  3
-       array  of  keys  including  the four arrow keys, the other
-       five keys can be given as ka1, ka3,  kb2,  kc1,  and  kc3.
-       These  keys are useful when the effects of a 3 by 3 direc-
-       tional pad are needed.
-
-       Strings to program function keys can be  given  as  pfkey,
-       pfloc,  and pfx.  A string to program screen labels should
-       be specified as pln.  Each  of  these  strings  takes  two
-       parameters:  the function key number to program (from 0 to
-       10) and the string to program it with.  Function key  num-
-       bers  out  of  this  range may program undefined keys in a
-       terminal dependent manner.   The  difference  between  the
-       capabilities  is  that pfkey causes pressing the given key
-       to be the same as the user typing the given string;  pfloc
-       causes the string to be executed by the terminal in local;
-       and pfx causes the string to be transmitted  to  the  com-
-       puter.
-
-       The capabilities nlab, lw and lh define the number of pro-
-       grammable screen labels and their width  and  height.   If
-       there  are  commands  to  turn the labels on and off, give
-       them in smln and rmln.  smln is normally output after  one
-       or more pln sequences to make sure that the change becomes
-       visible.
-
-
-   Tabs and Initialization
-       If the terminal has hardware tabs, the command to  advance
-       to  the  next tab stop can be given as ht (usually control
-       I).  A ``back-tab'' command which moves  leftward  to  the
-       preceding tab stop can be given as cbt.  By convention, if
-       the teletype modes indicate that tabs are  being  expanded
-       by  the  computer  rather than being sent to the terminal,
-       programs should not  use  ht  or  cbt  even  if  they  are
-       present,  since  the user may not have the tab stops prop-
-       erly set.  If the terminal has  hardware  tabs  which  are
-       initially  set every n spaces when the terminal is powered
-       up, the numeric parameter it is given, showing the  number
-       of  spaces  the tabs are set to.  This is normally used by
-       the tset command to determine whether to set the mode  for
-       hardware  tab expansion, and whether to set the tab stops.
-       If the terminal has tab stops that can be  saved  in  non-
-       volatile  memory, the terminfo description can assume that
-       they are properly set.
-
-       Other capabilities include is1, is2, and is3,  initializa-
-       tion  strings  for the terminal, iprog, the path name of a
-       program to be run to initialize the terminal, and if,  the
-       name  of  a  file  containing long initialization strings.
-       These strings are expected to set the terminal into  modes
-       consistent  with  the  rest  of  the terminfo description.
-       They are normally sent to the terminal, by the init option
-       of  the  tput  program,  each time the user logs in.  They
-       will be printed in the following order:
-
-              run the program
-                     iprog
-
-              output is1 is2
-
-              set the margins using
-                     mgc, smgl and smgr
-
-              set tabs using
-                     tbc and hts
-
-              print the file
-                     if
-
-              and finally
-                     output is3.
-
-       Most initialization is done with  is2.   Special  terminal
-       modes can be set up without duplicating strings by putting
-       the common sequences in is2 and special cases in  is1  and
-       is3.
-
-       A set of sequences that does a harder reset from a totally
-       unknown state can be given as rs1, rs2, rf and rs3, analo-
-       gous  to  is1  ,  is2  ,  if  and is3 respectively.  These
-       strings are output by the reset  program,  which  is  used
-       when  the terminal gets into a wedged state.  Commands are
-       normally placed in rs1, rs2 rs3 and rf only if  they  pro-
-       duce  annoying effects on the screen and are not necessary
-       when logging in.  For example,  the  command  to  set  the
-       vt100  into  80-column mode would normally be part of is2,
-       but it causes an annoying glitch of the screen and is  not
-       normally  needed  since the terminal is usually already in
-       80 column mode.
-
-       The reset program writes strings including iprog, etc., in
-       the  same  order  as  the  init  program, using rs1, etc.,
-       instead of is1, etc.  If any of rs1, rs2, rs3, or rf reset
-       capability  strings  are  missing, the reset program falls
-       back  upon  the  corresponding  initialization  capability
-       string.
-
-       If there are commands to set and clear tab stops, they can
-       be given as tbc (clear all tab stops) and hts (set  a  tab
-       stop  in the current column of every row).  If a more com-
-       plex sequence is needed  to  set  the  tabs  than  can  be
-       described  by  this,  the sequence can be placed in is2 or
-       if.
-
-   Delays and Padding
-       Many older and slower  terminals  do  not  support  either
-       XON/XOFF or DTR handshaking, including hard copy terminals
-       and some very archaic CRTs (including,  for  example,  DEC
-       VT100s).   These may require padding characters after cer-
-       tain cursor motions and screen changes.
-
-       If the terminal uses xon/xoff handshaking for flow control
-       (that  is, it automatically emits ^S back to the host when
-       its input buffers are close to full), set xon.  This capa-
-       bility  suppresses  the emission of padding.  You can also
-       set it for memory-mapped console devices effectively  that
-       do  not  have  a  speed limit.  Padding information should
-       still be included so that routines can make  better  deci-
-       sions about relative costs, but actual pad characters will
-       not be transmitted.
-
-       If pb (padding baud rate) is given, padding is  suppressed
-       at  baud rates below the value of pb.  If the entry has no
-       padding baud rate, then whether padding is emitted or  not
-       is completely controlled by xon.
-
-       If  the terminal requires other than a null (zero) charac-
-       ter as a pad, then this can be given  as  pad.   Only  the
-       first character of the pad string is used.
-
-
-   Status Lines
-       Some  terminals  have  an extra `status line' which is not
-       normally used by software (and thus  not  counted  in  the
-       terminal's lines capability).
-
-       The  simplest  case  is  a  status  line  which is cursor-
-       addressable but not part of the main scrolling  region  on
-       the  screen;  the  Heathkit  H19 has a status line of this
-       kind, as would a 24-line VT100 with  a  23-line  scrolling
-       region  set up on initialization.  This situation is indi-
-       cated by the hs capability.
-
-       Some terminals with status lines need special sequences to
-       access  the  status  line.   These  may  be expressed as a
-       string with single parameter tsl which takes the cursor to
-       a  given zero-origin column on the status line.  The capa-
-       bility fsl must return to the main-screen cursor positions
-       before  the  last  tsl.   You may need to embed the string
-       values of sc (save cursor) and rc (restore cursor) in  tsl
-       and fsl to accomplish this.
-
-       The  status  line is normally assumed to be the same width
-       as the width of the terminal.  If this is untrue, you  can
-       specify it with the numeric capability wsl.
-
-       A  command to erase or blank the status line may be speci-
-       fied as dsl.
-
-       The  boolean  capability  eslok  specifies   that   escape
-       sequences, tabs, etc., work ordinarily in the status line.
-
-       The ncurses implementation does not yet use any  of  these
-       capabilities.   They are documented here in case they ever
-       become important.
-
-
-   Line Graphics
-       Many terminals have alternate character  sets  useful  for
-       forms-drawing.   Terminfo  and curses build in support for
-       the drawing characters supported by the VT100,  with  some
-       characters  from  the  AT&T  4410v1 added.  This alternate
-       character set may be specified by the acsc capability.
-
-
-       Glyph                      ACS            Ascii      VT100
-       Name                       Name           Default    Name
-       UK pound sign              ACS_STERLING   f          }
-       arrow pointing down        ACS_DARROW     v          .
-       arrow pointing left        ACS_LARROW     <          ,
-       arrow pointing right       ACS_RARROW     >          +
-       arrow pointing up          ACS_UARROW     ^          -
-       board of squares           ACS_BOARD      #          h
-       bullet                     ACS_BULLET     o          ~
-       checker board (stipple)    ACS_CKBOARD    :          a
-       degree symbol              ACS_DEGREE     \          f
-       diamond                    ACS_DIAMOND    +          `
-       greater-than-or-equal-to   ACS_GEQUAL     >          z
-       greek pi                   ACS_PI         *          {
-       horizontal line            ACS_HLINE      -          q
-       lantern symbol             ACS_LANTERN    #          i
-       large plus or crossover    ACS_PLUS       +          n
-       less-than-or-equal-to      ACS_LEQUAL     <          y
-
-       lower left corner          ACS_LLCORNER   +          m
-       lower right corner         ACS_LRCORNER   +          j
-       not-equal                  ACS_NEQUAL     !          |
-       plus/minus                 ACS_PLMINUS    #          g
-       scan line 1                ACS_S1         ~          o
-       scan line 3                ACS_S3         -          p
-       scan line 7                ACS_S7         -          r
-       scan line 9                ACS_S9         _          s
-       solid square block         ACS_BLOCK      #          0
-       tee pointing down          ACS_TTEE       +          w
-       tee pointing left          ACS_RTEE       +          u
-       tee pointing right         ACS_LTEE       +          t
-       tee pointing up            ACS_BTEE       +          v
-       upper left corner          ACS_ULCORNER   +          l
-       upper right corner         ACS_URCORNER   +          k
-       vertical line              ACS_VLINE      |          x
-
-       The best way to define a new device's graphics set  is  to
-       add  a  column  to a copy of this table for your terminal,
-       giving  the  character   which   (when   emitted   between
-       smacs/rmacs  switches) will be rendered as the correspond-
-       ing graphic.  Then read off the VT100/your terminal  char-
-       acter  pairs  right  to left in sequence; these become the
-       ACSC string.
-
-
-   Color Handling
-       Most color terminals are either `Tektronix-like'  or  `HP-
-       like'.   Tektronix-like terminals have a predefined set of
-       N colors (where N usually 8), and can  set  character-cell
-       foreground and background characters independently, mixing
-       them into N * N color-pairs.  On  HP-like  terminals,  the
-       use must set each color pair up separately (foreground and
-       background are  not  independently  settable).   Up  to  M
-       color-pairs  may  be  set  up  from  2*M different colors.
-       ANSI-compatible terminals are Tektronix-like.
-
-       Some basic color capabilities are independent of the color
-       method.  The numeric capabilities colors and pairs specify
-       the maximum numbers of colors and color-pairs that can  be
-       displayed  simultaneously.   The op (original pair) string
-       resets foreground and background colors to  their  default
-       values  for the terminal.  The oc string resets all colors
-       or color-pairs to their default values for  the  terminal.
-       Some  terminals  (including  many  PC  terminal emulators)
-       erase screen  areas  with  the  current  background  color
-       rather  than the power-up default background; these should
-       have the boolean capability bce.
-
-       To change the current foreground or background color on  a
-       Tektronix-type  terminal,  use setaf (set ANSI foreground)
-       and setab (set ANSI background) or setf  (set  foreground)
-       and  setb (set background).  These take one parameter, the
-       color  number.   The  SVr4  documentation  describes  only
-       setaf/setab;  the  XPG4  draft  says that "If the terminal
-       supports ANSI escape sequences to set background and fore-
-       ground,  they  should be coded as setaf and setab, respec-
-       tively.  If the terminal supports other  escape  sequences
-       to  set background and foreground, they should be coded as
-       setf and setb, respectively.  The vidputs()  function  and
-       the  refresh  functions  use  setaf  and setab if they are
-       defined."
-
-       The setaf/setab and setf/setb capabilities take  a  single
-       numeric argument each.  Argument values 0-7 of setaf/setab
-       are portably defined as follows (the middle column is  the
-       symbolic #define available in the header for the curses or
-       ncurses libraries).  The terminal hardware is free to  map
-       these  as  it  likes,  but  the RGB values indicate normal
-       locations in color space.
-
-
-             Color       #define       Value       RGB
-             black     COLOR_BLACK       0     0, 0, 0
-             red       COLOR_RED         1     max,0,0
-             green     COLOR_GREEN       2     0,max,0
-             yellow    COLOR_YELLOW      3     max,max,0
-             blue      COLOR_BLUE        4     0,0,max
-             magenta   COLOR_MAGENTA     5     max,0,max
-             cyan      COLOR_CYAN        6     0,max,max
-             white     COLOR_WHITE       7     max,max,max
-
-       The argument values of setf/setb  historically  correspond
-       to a different mapping, i.e.,
-
-             Color       #define       Value       RGB
-             black     COLOR_BLACK       0     0, 0, 0
-             blue      COLOR_BLUE        1     0,0,max
-             green     COLOR_GREEN       2     0,max,0
-             cyan      COLOR_CYAN        3     0,max,max
-             red       COLOR_RED         4     max,0,0
-             magenta   COLOR_MAGENTA     5     max,0,max
-             yellow    COLOR_YELLOW      6     max,max,0
-             white     COLOR_WHITE       7     max,max,max
-       It is important to not confuse the two sets of color capa-
-       bilities; otherwise red/blue will be interchanged  on  the
-       display.
-
-       On  an  HP-like terminal, use scp with a color-pair number
-       parameter to set which color pair is current.
-
-       On a Tektronix-like terminal, the capability  ccc  may  be
-       present  to  indicate that colors can be modified.  If so,
-       the initc capability will take a color number (0 to colors
-       -  1)and  three  more parameters which describe the color.
-       These three parameters default to being interpreted as RGB
-       (Red,  Green, Blue) values.  If the boolean capability hls
-       is present, they are instead as HLS (Hue, Lightness, Satu-
-       ration) indices.  The ranges are terminal-dependent.
-
-       On  an  HP-like  terminal, initp may give a capability for
-       changing a color-pair value.  It will take  seven  parame-
-       ters;  a  color-pair  number (0 to max_pairs - 1), and two
-       triples describing first background  and  then  foreground
-       colors.   These  parameters  must be (Red, Green, Blue) or
-       (Hue, Lightness, Saturation) depending on hls.
-
-       On some color terminals, colors collide  with  highlights.
-       You can register these collisions with the ncv capability.
-       This is a bit-mask of attributes not to be used when  col-
-       ors  are  enabled.  The correspondence with the attributes
-       understood by curses is as follows:
-
-
-                      Attribute      Bit   Decimal
-                      A_STANDOUT     0     1
-                      A_UNDERLINE    1     2
-                      A_REVERSE      2     4
-                      A_BLINK        3     8
-                      A_DIM          4     16
-                      A_BOLD         5     32
-                      A_INVIS        6     64
-                      A_PROTECT      7     128
-                      A_ALTCHARSET   8     256
-
-       For example,  on  many  IBM  PC  consoles,  the  underline
-       attribute  collides  with the foreground color blue and is
-       not available in color mode.  These  should  have  an  ncv
-       capability of 2.
-
-       SVr4  curses  does nothing with ncv, ncurses recognizes it
-       and optimizes the output in favor of colors.
-
-
-   Miscellaneous
-       If the terminal requires other than a null (zero)  charac-
-       ter  as  a  pad,  then this can be given as pad.  Only the
-       first character of the pad string is used.  If the  termi-
-       nal does not have a pad character, specify npc.  Note that
-       ncurses implements  the  termcap-compatible  PC  variable;
-       though  the  application  may  set this value to something
-       other than a null, ncurses will test  npc  first  and  use
-       napms if the terminal has no pad character.
-
-       If  the terminal can move up or down half a line, this can
-       be indicated with hu  (half-line  up)  and  hd  (half-line
-       down).  This is primarily useful for superscripts and sub-
-       scripts on hard-copy terminals.  If a  hard-copy  terminal
-       can  eject  to  the next page (form feed), give this as ff
-       (usually control L).
-
-       If there is a command to repeat a given character a  given
-       number  of times (to save time transmitting a large number
-       of identical characters) this can be  indicated  with  the
-       parameterized  string  rep.   The  first  parameter is the
-       character to be repeated and the second is the  number  of
-       times  to repeat it.  Thus, tparm(repeat_char, 'x', 10) is
-       the same as `xxxxxxxxxx'.
-
-       If the terminal has a settable command character, such  as
-       the  TEKTRONIX  4025, this can be indicated with cmdch.  A
-       prototype command character is chosen which is used in all
-       capabilities.   This character is given in the cmdch capa-
-       bility to identify it.  The following convention  is  sup-
-       ported  on  some  UNIX  systems:  The environment is to be
-       searched for a CC variable, and if found, all  occurrences
-       of the prototype character are replaced with the character
-       in the environment variable.
-
-       Terminal descriptions that do  not  represent  a  specific
-       kind of known terminal, such as switch, dialup, patch, and
-       network, should include the  gn  (generic)  capability  so
-       that  programs  can  complain that they do not know how to
-       talk to the terminal.  (This capability does not apply  to
-       virtual   terminal   descriptions  for  which  the  escape
-       sequences are known.)
-
-       If the terminal has a ``meta key'' which acts as  a  shift
-       key,  setting  the  8th  bit of any character transmitted,
-       this fact can be indicated with km.   Otherwise,  software
-       will assume that the 8th bit is parity and it will usually
-       be cleared.  If strings exist to turn this  ``meta  mode''
-       on and off, they can be given as smm and rmm.
-
-       If  the terminal has more lines of memory than will fit on
-       the screen at once, the number of lines of memory  can  be
-       indicated  with  lm.   A  value of lm#0 indicates that the
-       number of lines is not fixed, but that there is still more
-       memory than fits on the screen.
-
-       If the terminal is one of those supported by the UNIX vir-
-       tual terminal protocol, the terminal number can  be  given
-       as vt.
-
-       Media copy strings which control an auxiliary printer con-
-       nected to the terminal can be given as mc0: print the con-
-       tents  of  the screen, mc4: turn off the printer, and mc5:
-       turn on the printer.  When the printer  is  on,  all  text
-       sent  to  the terminal will be sent to the printer.  It is
-       undefined whether the text is also displayed on the termi-
-       nal screen when the printer is on.  A variation mc5p takes
-       one parameter, and leaves the printer on for as many char-
-       acters  as  the  value  of  the  parameter, then turns the
-       printer off.  The parameter should not  exceed  255.   All
-       text,  including  mc4,  is  transparently  passed  to  the
-       printer while an mc5p is in effect.
-
-
-   Glitches and Braindamage
-       Hazeltine terminals, which do not allow `~' characters  to
-       be displayed should indicate hz.
-
-       Terminals which ignore a line-feed immediately after an am
-       wrap, such as the Concept and vt100, should indicate xenl.
-
-       If  el  is  required  to  get  rid of standout (instead of
-       merely writing normal text on top of it),  xhp  should  be
-       given.
-
-       Teleray  terminals,  where  tabs turn all characters moved
-       over to blanks, should  indicate  xt  (destructive  tabs).
-       Note:    the    variable    indicating    this    is   now
-       `dest_tabs_magic_smso'; in older  versions,  it  was  tel-
-       eray_glitch.  This glitch is also taken to mean that it is
-       not possible to position the cursor on top  of  a  ``magic
-       cookie'', that to erase standout mode it is instead neces-
-       sary to use delete and insert line.  The ncurses implemen-
-       tation ignores this glitch.
-
-       The  Beehive Superbee, which is unable to correctly trans-
-       mit the escape or control C characters, has xsb,  indicat-
-       ing  that the f1 key is used for escape and f2 for control
-       C.  (Only certain Superbees have this  problem,  depending
-       on  the  ROM.)  Note that in older terminfo versions, this
-       capability  was  called  `beehive_glitch';   it   is   now
-       `no_esc_ctl_c'.
-
-       Other  specific  terminal  problems  may  be  corrected by
-       adding more capabilities of the form xx.
-
-
-   Similar Terminals
-       If there are two very similar terminals, one (the variant)
-       can  be  defined  as  being just like the other (the base)
-       with certain exceptions.  In the definition of  the  vari-
-       ant,  the string capability use can be given with the name
-       of the base terminal.  The capabilities given  before  use
-       override  those  in  the base type named by use.  If there
-       are multiple use capabilities, they are merged in  reverse
-       order.   That is, the rightmost use reference is processed
-       first, then the one to its left, and so forth.   Capabili-
-       ties  given explicitly in the entry override those brought
-       in by use references.
-
-       A capability can be canceled by placing xx@ to the left of
-       the  use  reference that imports it, where xx is the capa-
-       bility.  For example, the entry
-
-                   2621-nl, smkx@, rmkx@, use=2621,
-
-       defines a 2621-nl that does not  have  the  smkx  or  rmkx
-       capabilities,  and hence does not turn on the function key
-       labels when in visual mode.  This is useful for  different
-       modes for a terminal, or for different user preferences.
-
-
-   Pitfalls of Long Entries
-       Long  terminfo  entries  are  unlikely to be a problem; to
-       date, no entry has even  approached  terminfo's  4096-byte
-       string-table maximum.  Unfortunately, the termcap transla-
-       tions are much more strictly limited (to 1023 bytes), thus
-       termcap  translations  of  long terminfo entries can cause
-       problems.
-
-       The man pages for 4.3BSD and older versions  of  tgetent()
-       instruct  the  user to allocate a 1024-byte buffer for the
-       termcap entry.  The  entry  gets  null-terminated  by  the
-       termcap library, so that makes the maximum safe length for
-       a termcap entry 1k-1 (1023) bytes.  Depending on what  the
-       application  and  the termcap library being used does, and
-       where in the termcap file the terminal type that tgetent()
-       is searching for is, several bad things can happen.
-
-       Some  termcap libraries print a warning message or exit if
-       they find an entry that's longer than 1023  bytes;  others
-       do  not;  others truncate the entries to 1023 bytes.  Some
-       application programs allocate more than the recommended 1K
-       for the termcap entry; others do not.
-
-       Each termcap entry has two important sizes associated with
-       it: before "tc" expansion, and after "tc" expansion.  "tc"
-       is  the  capability that tacks on another termcap entry to
-       the end of the current one, to add  on  its  capabilities.
-       If  a termcap entry does not use the "tc" capability, then
-       of course the two lengths are the same.
-
-       The "before tc expansion" length  is  the  most  important
-       one,  because it affects more than just users of that par-
-       ticular terminal.  This is the length of the entry  as  it
-       exists in /etc/termcap, minus the backslash-newline pairs,
-       which tgetent() strips out while reading it.  Some termcap
-       libraries  strip  off  the final newline, too (GNU termcap
-       does not).  Now suppose:
-
-       *    a termcap entry before expansion is  more  than  1023
-            bytes long,
-
-       *    and the application has only allocated a 1k buffer,
-
-       *    and  the  termcap library (like the one in BSD/OS 1.1
-            and GNU) reads the whole entry into  the  buffer,  no
-            matter  what its length, to see if it is the entry it
-            wants,
-
-       *    and tgetent() is searching for a terminal  type  that
-            either is the long entry, appears in the termcap file
-            after the long entry, or does not appear in the  file
-            at  all  (so  that  tgetent() has to search the whole
-            termcap file).
-
-       Then tgetent() will overwrite memory, perhaps  its  stack,
-       and  probably core dump the program.  Programs like telnet
-       are particularly vulnerable;  modern  telnets  pass  along
-       values  like the terminal type automatically.  The results
-       are almost as undesirable with  a  termcap  library,  like
-       SunOS  4.1.3  and Ultrix 4.4, that prints warning messages
-       when it reads an overly long termcap entry.  If a  termcap
-       library  truncates  long  entries,  like  OSF/1 3.0, it is
-       immune to dying here but will return  incorrect  data  for
-       the terminal.
-
-       The "after tc expansion" length will have a similar effect
-       to the above, but only for people who actually set TERM to
-       that  terminal type, since tgetent() only does "tc" expan-
-       sion once it is found the terminal  type  it  was  looking
-       for, not while searching.
-
-       In summary, a termcap entry that is longer than 1023 bytes
-       can cause, on various combinations  of  termcap  libraries
-       and  applications,  a  core  dump,  warnings, or incorrect
-       operation.  If it is too long even before "tc"  expansion,
-       it will have this effect even for users of some other ter-
-       minal types and users whose TERM variable does not have  a
-       termcap entry.
-
-       When in -C (translate to termcap) mode, the ncurses imple-
-       mentation of tic(1m) issues warning messages when the pre-
-       tc  length  of  a termcap translation is too long.  The -c
-       (check) option also checks resolved (after  tc  expansion)
-       lengths.
-
-   Binary Compatibility
-       It  is not wise to count on portability of binary terminfo
-       entries between commercial UNIX versions.  The problem  is
-       that  there  are  at least two versions of terminfo (under
-       HP-UX and AIX) which diverged from System V terminfo after
-       SVr1,  and have added extension capabilities to the string
-       table that (in the binary format) collide  with  System  V
-       and XSI Curses extensions.
-
-
-
-

EXTENSIONS

-       Some  SVr4  curses  implementations,  and  all previous to
-       SVr4, do not interpret the %A and %O operators in  parame-
-       ter strings.
-
-       SVr4/XPG4  do  not  specify whether msgr licenses movement
-       while in an alternate-character-set mode (such modes  may,
-       among  other  things,  map CR and NL to characters that do
-       not trigger local motions).   The  ncurses  implementation
-       ignores  msgr  in ALTCHARSET mode.  This raises the possi-
-       bility that an XPG4  implementation  making  the  opposite
-       interpretation  may need terminfo entries made for ncurses
-       to have msgr turned off.
-
-       The ncurses library handles insert-character  and  insert-
-       character modes in a slightly non-standard way to get bet-
-       ter update efficiency.  See  the  Insert/Delete  Character
-       subsection above.
-
-       The   parameter   substitutions  for  set_clock  and  dis-
-       play_clock are not documented in SVr4 or  the  XSI  Curses
-       standard.  They are deduced from the documentation for the
-       AT&T 505 terminal.
-
-       Be careful assigning the kmous  capability.   The  ncurses
-       wants  to  interpret it as KEY_MOUSE, for use by terminals
-       and emulators like xterm that  can  return  mouse-tracking
-       information in the keyboard-input stream.
-
-       Different  commercial ports of terminfo and curses support
-       different subsets of the XSI Curses standard and (in  some
-       cases) different extension sets.  Here is a summary, accu-
-       rate as of October 1995:
-
-       SVR4, Solaris, ncurses -- These support all SVr4 capabili-
-       ties.
-
-       SGI  --  Supports  the  SVr4  set,  adds  one undocumented
-       extended string capability (set_pglen).
-
-       SVr1, Ultrix -- These support a restricted subset of  ter-
-       minfo  capabilities.   The booleans end with xon_xoff; the
-       numerics with  width_status_line;  and  the  strings  with
-       prtr_non.
-
-       HP/UX  --  Supports  the  SVr1  subset,  plus the SVr[234]
-       numerics num_labels, label_height, label_width, plus func-
-       tion  keys  11  through  63, plus plab_norm, label_on, and
-       label_off, plus some incompatible extensions in the string
-       table.
-
-       AIX  --  Supports  the  SVr1 subset, plus function keys 11
-       through 63, plus a number  of  incompatible  string  table
-       extensions.
-
-       OSF  -- Supports both the SVr4 set and the AIX extensions.
-
-
-
-

FILES

-       /usr/share/terminfo/?/*  files     containing     terminal
-                                descriptions
-
-
-
-

SEE ALSO

-       tic(1m),   infocmp(1m),  curses(3x),  printf(3),  term(5).
-       term_variables(3x).
-
-
-
-

AUTHORS

-       Zeyd M. Ben-Halim, Eric  S.  Raymond,  Thomas  E.  Dickey.
-       Based on pcurses by Pavel Curtis.
-
-
-
-                                                            terminfo(5)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html deleted file mode 100644 index 9d05671623d..00000000000 --- a/doc/html/man/tic.1m.html +++ /dev/null @@ -1,330 +0,0 @@ - - - - -tic 1m - - - - -

tic 1m

-
-
-
-tic(1m)                                                         tic(1m)
-
-
-
-
-
-

NAME

-       tic - the terminfo entry-description compiler
-
-
-
-

SYNOPSIS

-       tic  [-1CGILNTUVacfgrstx]  [-e names] [-o dir] [-R subset]
-       [-v[n]] [-w[n]] file
-
-
-
-

DESCRIPTION

-       The command tic translates a  terminfo  file  from  source
-       format  into compiled format.  The compiled format is nec-
-       essary for use with the library routines in ncurses(3x).
-
-       The results are normally placed  in  the  system  terminfo
-       directory  /usr/share/terminfo.   There  are  two  ways to
-       change this behavior.
-
-       First, you may override the system default by setting  the
-       variable  TERMINFO  in  your  shell environment to a valid
-       (existing) directory name.
-
-       Secondly, if tic cannot get access to  /usr/share/terminfo
-       or  your  TERMINFO  directory,  it looks for the directory
-       $HOME/.terminfo; if that directory exists,  the  entry  is
-       placed there.
-
-       Libraries that read terminfo entries are expected to check
-       for a TERMINFO directory first, look at $HOME/.terminfo if
-       TERMINFO  is  not set, and finally look in /usr/share/ter-
-       minfo.
-
-       -1     restricts the output to a single column
-
-       -a     tells  tic  to  retain  commented-out  capabilities
-              rather than discarding them.  Capabilities are com-
-              mented by prefixing them with a period.  This  sets
-              the  -x option, because it treats the commented-out
-              entries as user-defined names.  If  the  source  is
-              termcap,  accept  the 2-character names required by
-              version 6.  Otherwise these are ignored.
-
-       -C     Force source translation to termcap format.   Note:
-              this  differs  from the -C option of infocmp(1m) in
-              that it does not merely translate capability names,
-              but  also  translates  terminfo  strings to termcap
-              format.  Capabilities that are not translatable are
-              left  in  the  entry under their terminfo names but
-              commented out with two preceding dots.
-
-       -c     tells tic to only check file for errors,  including
-              syntax  problems and bad use links.  If you specify
-              -C (-I) with this option, the code will print warn-
-              ings about entries which, after use resolution, are
-              more than 1023 (4096) bytes long.  Due to  a  fixed
-              buffer  length  in  older  termcap libraries (and a
-              documented limit in terminfo),  these  entries  may
-              cause core dumps.
-
-       -e names
-              Limit  writes  and  translations  to  the following
-              comma-separated list of terminals.  If any name  or
-              alias of a terminal matches one of the names in the
-              list, the entry will be written  or  translated  as
-              normal.   Otherwise no output will be generated for
-              it.  The option value is interpreted as a file con-
-              taining  the  list  if  it  contains a '/'.  (Note:
-              depending on how tic was compiled, this option  may
-              require -I or -C.)
-
-       -f     Display  complex  terminfo  strings  which  contain
-              if/then/else/endif expressions indented  for  read-
-              ability.
-
-       -G     Display  constant  literals  in decimal form rather
-              than their character equivalents.
-
-       -g     Display constant character literals in quoted  form
-              rather than their decimal equivalents.
-
-       -I     Force source translation to terminfo format.
-
-       -L     Force  source  translation to terminfo format using
-              the long C variable names listed in <term.h>
-
-       -N     Disable smart defaults.  Normally, when translating
-              from termcap to terminfo, the compiler makes a num-
-              ber of assumptions about  the  defaults  of  string
-              capabilities  reset1_string,  carriage_return, cur-
-              sor_left, cursor_down,  scroll_forward,  tab,  new-
-              line,  key_backspace,  key_left, and key_down, then
-              attempts to use obsolete  termcap  capabilities  to
-              deduce correct values.  It also normally suppresses
-              output of obsolete termcap capabilities such as bs.
-              This  option forces a more literal translation that
-              also preserves the obsolete capabilities.
-
-       -odir  Write compiled entries to given  directory.   Over-
-              rides the TERMINFO environment variable.
-
-       -Rsubset
-              Restrict  output to a given subset.  This option is
-              for use with  archaic  versions  of  terminfo  like
-              those on SVr1, Ultrix, or HP/UX that do not support
-              the full set of SVR4/XSI Curses terminfo; and  out-
-              right broken ports like AIX 3.x that have their own
-              extensions incompatible with  SVr4/XSI.   Available
-              subsets  are  "SVr1",  "Ultrix",  "HP",  "BSD"  and
-              "AIX"; see terminfo(5) for details.
-
-       -r     Force entry resolution (so there are  no  remaining
-              tc  capabilities)  even  when  doing translation to
-              termcap format.  This may  be  needed  if  you  are
-              preparing  a  termcap  file  for  a termcap library
-              (such as GNU termcap through  version  1.3  or  BSD
-              termcap through 4.3BSD) that does not handle multi-
-              ple tc capabilities per entry.
-
-       -s     Summarize the compile by showing the directory into
-              which  entries  are  written,  and  the  number  of
-              entries which are compiled.
-
-       -T     eliminates size-restrictions on the generated text.
-              This  is  mainly  useful  for testing and analysis,
-              since the compiled descriptions are limited  (e.g.,
-              1023 for termcap, 4096 for terminfo).
-
-       -t     tells  tic  to  discard commented-out capabilities.
-              Normally when translating from terminfo to termcap,
-              untranslatable capabilities are commented-out.
-
-       -U   tells  tic to not post-process the data after parsing
-            the source file.  Normally, it infers data  which  is
-            commonly  missing in older terminfo data, or in term-
-            caps.
-
-       -V   reports the version of ncurses which was used in this
-            program, and exits.
-
-       -vn  specifies  that  (verbose) output be written to stan-
-            dard error trace information showing tic's  progress.
-            The  optional  parameter  n is a number from 1 to 10,
-            inclusive, indicating the desired level of detail  of
-            information.   If  n is omitted, the default level is
-            1.  If n is specified and greater than 1,  the  level
-            of detail is increased.
-
-       -wn  specifies  the width of the output.  The parameter is
-            optional.  If it is omitted, it defaults to 60.
-
-       -x   Treat unknown capabilities as user-defined.  That is,
-            if  you  supply  a capability name which tic does not
-            recognize, it will infer its type (boolean, number or
-            string)  from  the  syntax and make an extended table
-            entry  for  that.   User-defined  capability  strings
-            whose  name begins with ``k'' are treated as function
-            keys.
-
-       file contains one or more terminfo  terminal  descriptions
-            in source format [see terminfo(5)].  Each description
-            in the file describes the capabilities of a  particu-
-            lar terminal.
-
-       The debug flag levels are as follows:
-
-       1      Names of files created and linked
-
-       2      Information related to the ``use'' facility
-
-       3      Statistics from the hashing algorithm
-
-       5      String-table memory allocations
-
-       7      Entries into the string-table
-
-       8      List of tokens encountered by scanner
-
-       9      All values computed in construction of the hash ta-
-              ble
-
-       If the debug level n is not given, it is taken to be  one.
-
-       All but one of the capabilities recognized by tic are doc-
-       umented in terminfo(5).  The exception is the use capabil-
-       ity.
-
-       When  a  use=entry-name  field is discovered in a terminal
-       entry currently being compiled, tic reads  in  the  binary
-       from  /usr/share/terminfo to complete the entry.  (Entries
-       created from file will be used first.  If the  environment
-       variable  TERMINFO  is  set,  that  directory  is searched
-       instead of /usr/share/terminfo.)  tic duplicates the capa-
-       bilities  in  entry-name  for  the current entry, with the
-       exception  of  those  capabilities  that  explicitly   are
-       defined in the current entry.
-
-       When    an   entry,   e.g.,   entry_name_1,   contains   a
-       use=entry_name_2  field,  any  canceled  capabilities   in
-       entry_name_2  must also appear in entry_name_1 before use=
-       for these capabilities to be canceled in entry_name_1.
-
-       If the environment variable TERMINFO is set, the  compiled
-       results are placed there instead of /usr/share/terminfo.
-
-       Total compiled entries cannot exceed 4096 bytes.  The name
-       field cannot exceed 512 bytes.  Terminal  names  exceeding
-       the  maximum  alias  length (32 characters on systems with
-       long filenames, 14 characters otherwise) will be truncated
-       to  the maximum alias length and a warning message will be
-       printed.
-
-
-
-

COMPATIBILITY

-       There is some evidence that historic  tic  implementations
-       treated  description  fields with no whitespace in them as
-       additional aliases or short names.  This tic does  not  do
-       that,  but  it  does  warn  when description fields may be
-       treated that way and check them for dangerous  characters.
-
-
-
-

EXTENSIONS

-       Unlike the stock SVr4 tic command, this implementation can
-       actually compile termcap sources.   In  fact,  entries  in
-       terminfo  and  termcap  syntax  can  be  mixed in a single
-       source file.  See terminfo(5)  for  the  list  of  termcap
-       names taken to be equivalent to terminfo names.
-
-       The  SVr4  manual  pages  are  not clear on the resolution
-       rules for use capabilities.  This  implementation  of  tic
-       will find use targets anywhere in the source file, or any-
-       where in the file tree rooted at TERMINFO (if TERMINFO  is
-       defined),  or  in the user's $HOME/.terminfo directory (if
-       it exists), or (finally) anywhere  in  the  system's  file
-       tree of compiled entries.
-
-       The  error  messages from this tic have the same format as
-       GNU C error messages, and can be  parsed  by  GNU  Emacs's
-       compile facility.
-
-       The  -C,  -G,  -I, -N, -R, -T, -V, -a, -e, -f, -g, -o, -r,
-       -s, -t and -x options are not supported under  SVr4.   The
-       SVr4 -c mode does not report bad use links.
-
-       System  V does not compile entries to or read entries from
-       your $HOME/.terminfo directory unless TERMINFO is  explic-
-       itly set to it.
-
-
-
-

FILES

-       /usr/share/terminfo/?/*
-            Compiled terminal description database.
-
-
-
-

SEE ALSO

-       infocmp(1m),    captoinfo(1m),   infotocap(1m),   toe(1m),
-       curses(3x), terminfo(5).
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-

AUTHOR

-       Eric S. Raymond <esr@snark.thyrsus.com> and
-       Thomas E. Dickey <dickey@invisible-island.net>
-
-
-
-                                                                tic(1m)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html deleted file mode 100644 index 925d3908c7f..00000000000 --- a/doc/html/man/toe.1m.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - -toe 1m - - - - -

toe 1m

-
-
-
-toe(1m)                                                         toe(1m)
-
-
-
-
-
-

NAME

-       toe - table of (terminfo) entries
-
-
-
-

SYNOPSIS

-       toe [-v[n]] [-ahuUV] file...
-
-
-
-

DESCRIPTION

-       With no options, toe lists all available terminal types by
-       primary name with descriptions.   File  arguments  specify
-       the  directories  to  be scanned; if no such arguments are
-       given, your default terminfo directory is scanned.  If you
-       also  specify  the  -h  option, a directory header will be
-       issued as each directory is entered.
-
-       There are other options intended for use by terminfo  file
-       maintainers:
-
-       -a     report  on  all  of  the  terminal  databases which
-              ncurses would search, rather than  only  the  first
-              one that it finds.
-
-       -u file
-              says  to  write  a  report  to the standard output,
-              listing dependencies in the given  terminfo/termcap
-              source  file.  The report condenses the `use' rela-
-              tion: each line consists of the primary name  of  a
-              terminal  that  has use capabilities, followed by a
-              colon, followed by the whitespace-separated primary
-              names  of  all  terminals  which occur in those use
-              capabilities, followed by a newline
-
-       -U file
-              says to write a  report  to  the  standard  output,
-              listing  reverse  dependencies  in  the  given ter-
-              minfo/termcap source file.  The report reverses the
-              `use'  relation:  each line consists of the primary
-              name of a terminal that occurs in use capabilities,
-              followed  by  a  colon, followed by the whitespace-
-              separated primary  names  of  all  terminals  which
-              depend on it, followed by a newline.
-
-       -vn    specifies that (verbose) output be written to stan-
-              dard error, showing toe's progress.   The  optional
-              parameter  n  is a number from 1 to 10, interpreted
-              as for tic(1m).
-
-       -V     reports the version of ncurses which  was  used  in
-              this program, and exits.
-
-
-
-

FILES

-       /usr/share/terminfo/?/*
-            Compiled terminal description database.
-
-
-
-

SEE ALSO

-       tic(1m),    infocmp(1m),   captoinfo(1m),   infotocap(1m),
-       curses(3x), terminfo(5).
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                                toe(1m)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html deleted file mode 100644 index c04914f1a2f..00000000000 --- a/doc/html/man/tput.1.html +++ /dev/null @@ -1,343 +0,0 @@ - - - - -tput 1 - - - - -

tput 1

-
-
-
-tput(1)                                                         tput(1)
-
-
-
-
-
-

NAME

-       tput,  reset  -  initialize  a  terminal or query terminfo
-       database
-
-
-
-

SYNOPSIS

-       tput [-Ttype] capname [parms ... ]
-       tput [-Ttype] init
-       tput [-Ttype] reset
-       tput [-Ttype] longname
-       tput -S  <<
-       tput -V
-
-
-
-

DESCRIPTION

-       The tput utility uses the terminfo database  to  make  the
-       values  of terminal-dependent capabilities and information
-       available to the shell (see sh(1)), to initialize or reset
-       the  terminal,  or  return  the long name of the requested
-       terminal type.  The result depends upon  the  capability's
-       type:
-
-              string
-                   tput writes the string to the standard output.
-                   No trailing newline is supplied.
-
-              integer
-                   tput writes the decimal value to the  standard
-                   output, with a trailing newline.
-
-              boolean
-                   tput  simply sets the exit code (0 for TRUE if
-                   the terminal has the capability, 1  for  FALSE
-                   if  it  does  not),  and writes nothing to the
-                   standard output.
-
-       Before using a value returned on the standard output,  the
-       application  should  test  the  exit  code  (e.g., $?, see
-       sh(1)) to be sure it is 0.  (See the EXIT CODES and  DIAG-
-       NOSTICS  sections.)   For  a complete list of capabilities
-       and the capname associated with each, see terminfo(5).
-
-       -Ttype indicates the  type  of  terminal.   Normally  this
-              option is unnecessary, because the default is taken
-              from the environment variable TERM.  If -T is spec-
-              ified,  then  the shell variables LINES and COLUMNS
-              will be ignored,and the operating system  will  not
-              be queried for the actual screen size.
-
-       capname
-              indicates   the   capability   from   the  terminfo
-              database.  When termcap support is compiled in, the
-              termcap name for the capability is also accepted.
-
-       parms  If  the  capability  is a string that takes parame-
-              ters, the arguments parms will be instantiated into
-              the string.
-
-              Most  parameters  are numbers.  Only a few terminfo
-              capabilities require string parameters; tput uses a
-              table to decide which to pass as strings.  Normally
-              tput uses tparm (3x) to perform  the  substitution.
-              If no parameters are given for the capability, tput
-              writes   the   string   without   performing    the
-              substitution.
-
-       -S     allows  more  than one capability per invocation of
-              tput.  The capabilities must be passed to tput from
-              the standard input instead of from the command line
-              (see example).  Only one  capname  is  allowed  per
-              line.   The  -S option changes the meaning of the 0
-              and 1 boolean and string exit codes (see  the  EXIT
-              CODES section).
-
-              Again, tput uses a table and the presence of param-
-              eters in its input to decide whether to  use  tparm
-              (3x), and how to interpret the parameters.
-
-       -V     reports  the  version  of ncurses which was used in
-              this program, and exits.
-
-       init   If the terminfo database is present  and  an  entry
-              for the user's terminal exists (see -Ttype, above),
-              the following will occur:
-
-              (1)    if present,  the  terminal's  initialization
-                     strings  will  be  output as detailed in the
-                     terminfo(5) section on Tabs and  Initializa-
-                     tion,
-
-              (2)    any  delays (e.g., newline) specified in the
-                     entry will be set in the tty driver,
-
-              (3)    tabs expansion will  be  turned  on  or  off
-                     according to the specification in the entry,
-                     and
-
-              (4)    if tabs are not expanded, standard tabs will
-                     be set (every 8 spaces).
-
-              If an entry does not contain the information needed
-              for any of the four above activities, that activity
-              will silently be skipped.
-
-       reset  Instead  of putting out initialization strings, the
-              terminal's reset strings will be output if  present
-              (rs1,  rs2, rs3, rf).  If the reset strings are not
-              present, but initialization strings are,  the  ini-
-              tialization  strings  will  be  output.  Otherwise,
-              reset acts identically to init.
-
-       longname
-              If the terminfo database is present  and  an  entry
-              for  the user's terminal exists (see -Ttype above),
-              then the long name of the terminal will be put out.
-              The long name is the last name in the first line of
-              the terminal's description in the terminfo database
-              [see term(5)].
-
-       If  tput  is  invoked  by a link named reset, this has the
-       same effect as tput reset.  See tset for comparison, which
-       has similar behavior.
-
-
-
-

EXAMPLES

-       tput init
-            Initialize the terminal according to the type of ter-
-            minal in the environmental variable TERM.  This  com-
-            mand  should be included in everyone's .profile after
-            the environmental variable TERM has been exported, as
-            illustrated on the profile(5) manual page.
-
-       tput -T5620 reset
-            Reset  an  AT&T 5620 terminal, overriding the type of
-            terminal in the environmental variable TERM.
-
-       tput cup 0 0
-            Send the sequence to move the cursor to row 0, column
-            0 (the upper left corner of the screen, usually known
-            as the "home" cursor position).
-
-       tput clear
-            Echo the clear-screen sequence for the current termi-
-            nal.
-
-       tput cols
-            Print the number of columns for the current terminal.
-
-       tput -T450 cols
-            Print the number of columns for the 450 terminal.
-
-       bold=`tput smso` offbold=`tput rmso`
-            Set the shell variables bold, to begin stand-out mode
-            sequence, and offbold, to end standout mode sequence,
-            for the current terminal.  This might be followed  by
-            a  prompt:  echo  "${bold}Please  type  in your name:
-            ${offbold}\c"
-
-       tput hc
-            Set exit code to indicate if the current terminal  is
-            a hard copy terminal.
-
-       tput cup 23 4
-            Send  the sequence to move the cursor to row 23, col-
-            umn 4.
-
-       tput cup
-            Send the terminfo string for cursor-movement, with no
-            parameters substituted.
-
-       tput longname
-            Print  the  long  name from the terminfo database for
-            the type of terminal specified in  the  environmental
-            variable TERM.
-
-            tput -S <<!
-            > clear
-            > cup 10 10
-            > bold
-            > !
-
-            This  example shows tput processing several capabili-
-            ties in one invocation.  It clears the screen,  moves
-            the  cursor  to  position  10,  10  and turns on bold
-            (extra bright) mode.  The list is  terminated  by  an
-            exclamation mark (!) on a line by itself.
-
-
-
-

FILES

-       /usr/share/terminfo
-              compiled terminal description database
-
-       /usr/share/tabset/*
-              tab settings for some terminals, in a format appro-
-              priate  to  be  output  to  the  terminal   (escape
-              sequences  that  set  margins  and  tabs); for more
-              information, see the "Tabs and Initialization" sec-
-              tion of terminfo(5)
-
-
-
-

EXIT CODES

-       If the -S option is used, tput checks for errors from each
-       line, and if any errors are found, will set the exit  code
-       to  4  plus the number of lines with errors.  If no errors
-       are found, the exit code is 0.   No  indication  of  which
-       line failed can be given so exit code 1 will never appear.
-       Exit codes 2, 3, and 4 retain their usual  interpretation.
-       If the -S option is not used, the exit code depends on the
-       type of capname:
-
-            boolean
-                   a value of 0 is set for TRUE and 1 for  FALSE.
-
-            string a  value of 0 is set if the capname is defined
-                   for this terminal type (the value  of  capname
-                   is  returned on standard output); a value of 1
-                   is set if capname is not defined for this ter-
-                   minal  type  (nothing  is  written to standard
-                   output).
-
-            integer
-                   a value of 0 is always  set,  whether  or  not
-                   capname is defined for this terminal type.  To
-                   determine if capname is defined for this  ter-
-                   minal type, the user must test the value writ-
-                   ten to standard output.  A value of  -1  means
-                   that  capname is not defined for this terminal
-                   type.
-
-            other  reset or init may fail to find  their  respec-
-                   tive  files.   In  that case, the exit code is
-                   set to 4 + errno.
-
-       Any other exit code indicates an error; see  the  DIAGNOS-
-       TICS section.
-
-
-
-

DIAGNOSTICS

-       tput prints the following error messages and sets the cor-
-       responding exit codes.
-
-
-       exit code   error message
-       ---------------------------------------------------------------------
-       0           (capname is a numeric variable that is not specified  in
-                   the  terminfo(5)  database  for this terminal type, e.g.
-                   tput -T450 lines and tput -T2621 xmc)
-       1           no error message is printed, see the EXIT CODES section.
-       2           usage error
-       3           unknown terminal type or no terminfo database
-       4           unknown terminfo capability capname
-       >4          error occurred in -S
-       ---------------------------------------------------------------------
-
-
-
-

PORTABILITY

-       The longname and -S options, and  the  parameter-substitu-
-       tion  features  used in the cup example, are not supported
-       in BSD curses or in AT&T/USL curses before SVr4.
-
-       X/Open documents only the operands  for  clear,  init  and
-       reset.   In this implementation, clear is part of the cap-
-       name support.  Other implementations of tput on SVr4-based
-       systems such as Solaris, IRIX64 and HPUX as well as others
-       such  as  AIX  and  Tru64  provide  support  for   capname
-       operands.  A few platforms such as FreeBSD and NetBSD rec-
-       ognize termcap names rather than terminfo capability names
-       in their respective tput commands.
-
-
-
-

SEE ALSO

-       clear(1), stty(1), tabs(1), terminfo(5).
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                                tput(1)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html deleted file mode 100644 index 2b86f9f2174..00000000000 --- a/doc/html/man/tset.1.html +++ /dev/null @@ -1,334 +0,0 @@ - - - - -tset 1 - - - - -

tset 1

-
-
-
-tset(1)                                                         tset(1)
-
-
-
-
-
-

NAME

-       tset, reset - terminal initialization
-
-
-
-

SYNOPSIS

-       tset  [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping]
-       [terminal]
-       reset [-IQVcqrsw] [-] [-e ch] [-i ch] [-k ch] [-m mapping]
-       [terminal]
-
-
-
-

DESCRIPTION

-       Tset  initializes  terminals.   Tset  first determines the
-       type of terminal that you are using.   This  determination
-       is done as follows, using the first terminal type found.
-
-       1. The terminal argument specified on the command line.
-
-       2. The value of the TERM environmental variable.
-
-       3.  (BSD  systems only.) The terminal type associated with
-       the standard error output device in  the  /etc/ttys  file.
-       (On  System-V-like  UNIXes  and systems using that conven-
-       tion, getty does this job by setting TERM according to the
-       type passed to it by /etc/inittab.)
-
-       4. The default terminal type, ``unknown''.
-
-       If  the  terminal  type  was not specified on the command-
-       line, the -m option mappings are  then  applied  (see  the
-       section  TERMINAL  TYPE  MAPPING  for  more  information).
-       Then, if the terminal type begins  with  a  question  mark
-       (``?''), the user is prompted for confirmation of the ter-
-       minal type.  An empty  response  confirms  the  type,  or,
-       another  type  can be entered to specify a new type.  Once
-       the terminal type has been determined, the terminfo  entry
-       for  the  terminal  is retrieved.  If no terminfo entry is
-       found for the type, the user is prompted for another  ter-
-       minal type.
-
-       Once  the  terminfo  entry  is retrieved, the window size,
-       backspace, interrupt and line kill characters (among  many
-       other things) are set and the terminal and tab initializa-
-       tion strings  are  sent  to  the  standard  error  output.
-       Finally,  if the erase, interrupt and line kill characters
-       have changed, or are not  set  to  their  default  values,
-       their  values  are displayed to the standard error output.
-       Use the -c or -w option to select only the  window  sizing
-       versus  the  other  initialization.   If neither option is
-       given, both are assumed.
-
-       When invoked as reset, tset sets cooked  and  echo  modes,
-       turns  off cbreak and raw modes, turns on newline transla-
-       tion and resets any  unset  special  characters  to  their
-       default  values  before  doing the terminal initialization
-       described above.  This is  useful  after  a  program  dies
-       leaving  a  terminal  in an abnormal state.  Note, you may
-       have to type
-
-           <LF>reset<LF>
-
-       (the line-feed character is normally control-J) to get the
-       terminal to work, as carriage-return may no longer work in
-       the abnormal state.  Also, the  terminal  will  often  not
-       echo the command.
-
-       The options are as follows:
-
-       -c   Set  control  characters and modes.  -e Set the erase
-            character to ch.
-
-       -I   Do  not  send  the  terminal  or  tab  initialization
-            strings to the terminal.
-
-       -i   Set the interrupt character to ch.
-
-       -k   Set the line kill character to ch.
-
-       -m   Specify  a  mapping  from  a port type to a terminal.
-            See the section TERMINAL TYPE MAPPING for more infor-
-            mation.
-
-       -Q   Do  not  display  any values for the erase, interrupt
-            and line kill characters.  Normally tset displays the
-            values  for  control characters which differ from the
-            system's default values.
-
-       -q   The terminal type is displayed to the  standard  out-
-            put,  and the terminal is not initialized in any way.
-            The option `-' by itself is equivalent but archaic.
-
-       -r   Print the terminal type to the standard error output.
-
-       -s   Print  the  sequence  of shell commands to initialize
-            the environment variable TERM to the standard output.
-            See  the section SETTING THE ENVIRONMENT for details.
-
-       -V   reports the version of ncurses which was used in this
-            program, and exits.
-
-       -w   Resize  the  window  to  match  the  size deduced via
-            setupterm.   Normally  this  has  no  effect,  unless
-            setupterm is not able to detect the window size.
-
-       The arguments for the -e, -i, and -k options may either be
-       entered as actual characters or by using the  `hat'  nota-
-       tion,  i.e.,  control-h  may  be  specified  as  ``^H'' or
-       ``^h''.
-
-
-
-

SETTING THE ENVIRONMENT

-       It is often desirable  to  enter  the  terminal  type  and
-       information  about  the  terminal's  capabilities into the
-       shell's environment.  This is done using the -s option.
-
-       When the -s option is specified, the commands to enter the
-       information  into  the  shell's environment are written to
-       the standard output.  If the SHELL environmental  variable
-       ends in ``csh'', the commands are for csh, otherwise, they
-       are for sh.  Note, the csh  commands  set  and  unset  the
-       shell  variable  noglob,  leaving it unset.  The following
-       line in the .login or .profile files will  initialize  the
-       environment correctly:
-
-           eval `tset -s options ... `
-
-
-
-

TERMINAL TYPE MAPPING

-       When the terminal is not hardwired into the system (or the
-       current system information is incorrect) the terminal type
-       derived  from the /etc/ttys file or the TERM environmental
-       variable is often something generic like network,  dialup,
-       or  unknown.   When tset is used in a startup script it is
-       often desirable to provide information about the  type  of
-       terminal used on such ports.
-
-       The  purpose  of  the -m option is to map from some set of
-       conditions to a terminal type, that is, to tell tset  ``If
-       I'm  on this port at a particular speed, guess that I'm on
-       that kind of terminal''.
-
-       The argument to the -m option consists of an optional port
-       type, an optional operator, an optional baud rate specifi-
-       cation, an optional colon (``:'') character and a terminal
-       type.   The port type is a string (delimited by either the
-       operator or the colon character).  The operator may be any
-       combination of ``>'', ``<'', ``@'', and ``!''; ``>'' means
-       greater than, ``<'' means less than, ``@'' means equal  to
-       and ``!'' inverts the sense of the test.  The baud rate is
-       specified as a number and is compared with  the  speed  of
-       the  standard  error  output  (which should be the control
-       terminal).  The terminal type is a string.
-
-       If the terminal type is not specified on the command line,
-       the  -m mappings are applied to the terminal type.  If the
-       port type and baud rate match the  mapping,  the  terminal
-       type  specified  in the mapping replaces the current type.
-       If more than one mapping is specified, the first  applica-
-       ble mapping is used.
-
-       For    example,    consider    the    following   mapping:
-       dialup>9600:vt100.  The port type is dialup , the operator
-       is  >, the baud rate specification is 9600, and the termi-
-       nal type is vt100.  The result of this mapping is to spec-
-       ify that if the terminal type is dialup, and the baud rate
-       is greater than 9600 baud, a terminal type of  vt100  will
-       be used.
-
-       If no baud rate is specified, the terminal type will match
-       any baud rate.  If no port type is specified, the terminal
-       type   will   match   any  port  type.   For  example,  -m
-       dialup:vt100  -m  :?xterm  will  cause  any  dialup  port,
-       regardless of baud rate, to match the terminal type vt100,
-       and any non-dialup port type to match  the  terminal  type
-       ?xterm.   Note,  because of the leading question mark, the
-       user will be queried on a default port as to whether  they
-       are actually using an xterm terminal.
-
-       No  whitespace  characters  are permitted in the -m option
-       argument.  Also, to avoid problems  with  meta-characters,
-       it  is  suggested  that  the  entire -m option argument be
-       placed within single quote characters, and that csh  users
-       insert  a  backslash character (``\'') before any exclama-
-       tion marks (``!'').
-
-
-
-

HISTORY

-       The tset command appeared in BSD 3.0.  The ncurses  imple-
-       mentation  was lightly adapted from the 4.4BSD sources for
-       a terminfo environment by Eric S. Raymond <esr@snark.thyr-
-       sus.com>.
-
-
-
-

COMPATIBILITY

-       The  tset  utility has been provided for backward-compati-
-       bility with BSD environments (under  most  modern  UNIXes,
-       /etc/inittab  and  getty(1) can set TERM appropriately for
-       each dial-up line; this  obviates  what  was  tset's  most
-       important  use).   This implementation behaves like 4.4BSD
-       tset, with a few exceptions specified here.
-
-       The -S option of BSD tset no longer works;  it  prints  an
-       error message to stderr and dies.  The -s option only sets
-       TERM, not TERMCAP.  Both these  changes  are  because  the
-       TERMCAP  variable  is  no longer supported under terminfo-
-       based ncurses, which makes tset -S useless (we made it die
-       noisily rather than silently induce lossage).
-
-       There  was  an  undocumented  4.4BSD feature that invoking
-       tset via a link named `TSET` (or via any other name begin-
-       ning  with  an  upper-case letter) set the terminal to use
-       upper-case only.  This feature has been omitted.
-
-       The -A, -E, -h, -u and -v options were  deleted  from  the
-       tset  utility  in 4.4BSD.  None of them were documented in
-       4.3BSD and all are of limited utility at  best.   The  -a,
-       -d, and -p options are similarly not documented or useful,
-       but were retained as they appear to be in widespread  use.
-       It  is  strongly recommended that any usage of these three
-       options be changed to use the -m option instead.   The  -n
-       option  remains, but has no effect.  The -adnp options are
-       therefore omitted from the usage summary above.
-
-       It is still permissible to specify  the  -e,  -i,  and  -k
-       options  without arguments, although it is strongly recom-
-       mended that such usage be fixed to explicitly specify  the
-       character.
-
-       As  of  4.4BSD,  executing tset as reset no longer implies
-       the -Q option.  Also, the interaction between the - option
-       and the terminal argument in some historic implementations
-       of tset has been removed.
-
-
-
-

ENVIRONMENT

-       The tset command uses these environment variables:
-
-       SHELL
-            tells tset whether to initialize TERM using sh or csh
-            syntax.
-
-       TERM Denotes  your  terminal  type.  Each terminal type is
-            distinct, though many are similar.
-
-       TERMCAP
-            may denote the location of a termcap database.  If it
-            is not an absolute pathname, e.g., begins with a `/',
-            tset removes the variable from the environment before
-            looking for the terminal description.
-
-
-
-

FILES

-       /etc/ttys
-            system  port  name  to terminal type mapping database
-            (BSD versions only).
-
-       /usr/share/terminfo
-            terminal capability database
-
-
-
-

SEE ALSO

-       csh(1), sh(1), stty(1),  curs_terminfo(3x),  tty(4),  ter-
-       minfo(5), ttys(5), environ(7)
-
-       This describes ncurses version 5.9 (patch 20110404).
-
-
-
-                                                                tset(1)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/man/wresize.3x.html b/doc/html/man/wresize.3x.html deleted file mode 100644 index dff5834db79..00000000000 --- a/doc/html/man/wresize.3x.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - -wresize 3x - - - - -

wresize 3x

-
-
-
-wresize(3x)                                                 wresize(3x)
-
-
-
-
-
-

NAME

-       wresize - resize a curses window
-
-
-
-

SYNOPSIS

-       #include <curses.h>
-
-       int wresize(WINDOW *win, int lines, int columns);
-
-
-
-

DESCRIPTION

-       This  is  an  extension to the curses library.  It reallo-
-       cates storage for an ncurses window to adjust  its  dimen-
-       sions  to  the  specified  values.  If either dimension is
-       larger than the  current  values,  the  window's  data  is
-       filled with blanks that have the current background rendi-
-       tion (as set by wbkgdset) merged into them.
-
-
-
-

RETURN VALUE

-       The function returns the integer ERR upon failure  and  OK
-       on success.  It will fail if either of the dimensions less
-       than or equal  to  zero,  or  if  an  error  occurs  while
-       (re)allocating memory for the window.
-
-
-
-

NOTES

-       The only restriction placed on the dimensions is that they
-       be greater than zero.  The dimensions are not compared  to
-       curses   screen   dimensions  to  simplify  the  logic  of
-       resizeterm.  The caller  must  ensure  that  the  window's
-       dimensions fit within the actual screen dimensions.
-
-
-
-

SEE ALSO

-       resizeterm(3x).
-
-
-
-

AUTHOR

-       Thomas Dickey (from an equivalent function written in 1988
-       for BSD curses).
-
-
-
-                                                            wresize(3x)
-
-
-
-Man(1) output converted with -man2html -
- - diff --git a/doc/html/ncurses-intro.html b/doc/html/ncurses-intro.html index fc529f293e2..451e7ab4d32 100644 --- a/doc/html/ncurses-intro.html +++ b/doc/html/ncurses-intro.html @@ -1,8 +1,8 @@ - + term.h and comp_captab.c disagree about the <--\n"); + printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); + printf("#endif\n\n"); + + free(hash_table); + return EXIT_SUCCESS; +} +#endif diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 8204d75a819..3325a0ddae6 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -51,8 +51,9 @@ #include #include +#include -MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.69 2008/08/16 21:58:16 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -91,18 +92,16 @@ force_bar(char *dst, char *src) } return src; } -#define ForceBar(dst, src) ((strchr(src, '|') == 0) ? force_bar(dst, src) : src) NCURSES_EXPORT(bool) _nc_entry_match(char *n1, char *n2) /* do any of the aliases in a pair of terminal names match? */ { char *pstart, *qstart, *pend, *qend; - char nc1[MAX_NAME_SIZE + 2]; - char nc2[MAX_NAME_SIZE + 2]; + char nc1[MAX_NAME_SIZE + 2], nc2[MAX_NAME_SIZE + 2]; - n1 = ForceBar(nc1, n1); - n2 = ForceBar(nc2, n2); + n1 = force_bar(nc1, n1); + n2 = force_bar(nc2, n2); for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) @@ -274,7 +273,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) unresolved++; total_unresolved++; - _nc_curr_line = (int) lookline; + _nc_curr_line = lookline; _nc_warning("resolution of use=%s failed", lookfor); qp->uses[i].link = 0; } @@ -376,7 +375,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) if (_nc_check_termtype != 0) { _nc_curr_col = -1; for_entry_list(qp) { - _nc_curr_line = (int) qp->startline; + _nc_curr_line = qp->startline; _nc_set_type(_nc_first_name(qp->tterm.term_names)); _nc_check_termtype2(&qp->tterm, literal); } @@ -474,6 +473,7 @@ _nc_leaks_tic(void) { _nc_alloc_entry_leaks(); _nc_captoinfo_leaks(); + _nc_comp_captab_leaks(); _nc_comp_scan_leaks(); #if BROKEN_LINKER || USE_REENTRANT _nc_names_leaks(); diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 8725b2edb7e..5ad750f930d 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -48,9 +48,10 @@ #include #include +#include #include -MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -60,13 +61,19 @@ MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $") #define iswhite(ch) (ch == ' ' || ch == '\t') -NCURSES_EXPORT_VAR (int) _nc_syntax = 0; /* termcap or terminfo? */ -NCURSES_EXPORT_VAR (long) _nc_curr_file_pos = 0; /* file offset of current line */ -NCURSES_EXPORT_VAR (long) _nc_comment_start = 0; /* start of comment range before name */ -NCURSES_EXPORT_VAR (long) _nc_comment_end = 0; /* end of comment range before name */ -NCURSES_EXPORT_VAR (long) _nc_start_line = 0; /* start line of current entry */ +NCURSES_EXPORT_VAR(int) +_nc_syntax = 0; /* termcap or terminfo? */ +NCURSES_EXPORT_VAR(long) +_nc_curr_file_pos = 0; /* file offset of current line */ +NCURSES_EXPORT_VAR(long) +_nc_comment_start = 0; /* start of comment range before name */ +NCURSES_EXPORT_VAR(long) +_nc_comment_end = 0; /* end of comment range before name */ +NCURSES_EXPORT_VAR(long) +_nc_start_line = 0; /* start line of current entry */ -NCURSES_EXPORT_VAR (struct token) _nc_curr_token = +NCURSES_EXPORT_VAR(struct token) +_nc_curr_token = { 0, 0, 0 }; @@ -84,7 +91,8 @@ static int pushtype; /* type of pushback token */ static char *pushname; #if NCURSES_EXT_FUNCS -NCURSES_EXPORT_VAR (bool) _nc_disable_period = FALSE; /* used by tic -a option */ +NCURSES_EXPORT_VAR(bool) +_nc_disable_period = FALSE; /* used by tic -a option */ #endif /***************************************************************************** @@ -203,10 +211,6 @@ next_char(void) if (fgets(result + used, (int) (allocated - used), yyin) != 0) { bufstart = result; if (used == 0) { - if (_nc_curr_line == 0 - && IS_TIC_MAGIC(result)) { - _nc_err_abort("This is a compiled terminal description, not a source"); - } _nc_curr_line++; _nc_curr_col = 0; } @@ -427,7 +431,7 @@ _nc_get_token(bool silent) && !strchr(terminfo_punct, (char) ch)) { if (!silent) _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'", - terminfo_punct, unctrl(UChar(ch))); + terminfo_punct, unctrl((chtype) ch)); _nc_panic_mode(separator); goto start_token; } @@ -483,6 +487,7 @@ _nc_get_token(bool silent) if (OkToAdd()) { AddCh(ch); } else { + ch = EOF; break; } } @@ -591,7 +596,7 @@ _nc_get_token(bool silent) case '@': if ((ch = next_char()) != separator && !silent) _nc_warning("Missing separator after `%s', have %s", - tok_buf, unctrl(UChar(ch))); + tok_buf, unctrl((chtype) ch)); _nc_curr_token.tk_name = tok_buf; type = CANCEL; break; @@ -612,7 +617,7 @@ _nc_get_token(bool silent) _nc_warning("Missing separator"); } _nc_curr_token.tk_name = tok_buf; - _nc_curr_token.tk_valnumber = (int) number; + _nc_curr_token.tk_valnumber = number; type = NUMBER; break; @@ -632,7 +637,7 @@ _nc_get_token(bool silent) /* just to get rid of the compiler warning */ type = UNDEF; if (!silent) - _nc_warning("Illegal character - '%s'", unctrl(UChar(ch))); + _nc_warning("Illegal character - '%s'", unctrl((chtype) ch)); } } /* end else (first_column == FALSE) */ } /* end else (ch != EOF) */ @@ -725,47 +730,48 @@ _nc_trans_string(char *ptr, char *last) int count = 0; int number = 0; int i, c; - int last_ch = '\0'; + chtype ch, last_ch = '\0'; bool ignored = FALSE; bool long_warning = FALSE; - while ((c = next_char()) != separator && c != EOF) { + while ((ch = c = next_char()) != (chtype) separator && c != EOF) { if (ptr >= (last - 1)) { if (c != EOF) { while ((c = next_char()) != separator && c != EOF) { ; } + ch = c; } break; } if ((_nc_syntax == SYN_TERMCAP) && c == '\n') break; - if (c == '^' && last_ch != '%') { - c = next_char(); + if (ch == '^' && last_ch != '%') { + ch = c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (!(is7bits(c) && isprint(c))) { - _nc_warning("Illegal ^ character - '%s'", unctrl(UChar(c))); + if (!(is7bits(ch) && isprint(ch))) { + _nc_warning("Illegal ^ character - '%s'", unctrl(ch)); } - if (c == '?') { + if (ch == '?') { *(ptr++) = '\177'; if (_nc_tracing) _nc_warning("Allow ^? as synonym for \\177"); } else { - if ((c &= 037) == 0) - c = 128; - *(ptr++) = (char) (c); + if ((ch &= 037) == 0) + ch = 128; + *(ptr++) = (char) (ch); } - } else if (c == '\\') { - c = next_char(); + } else if (ch == '\\') { + ch = c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (c >= '0' && c <= '7') { - number = c - '0'; + if (ch >= '0' && ch <= '7') { + number = ch - '0'; for (i = 0; i < 2; i++) { - c = next_char(); + ch = c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); @@ -842,31 +848,31 @@ _nc_trans_string(char *ptr, char *last) default: _nc_warning("Illegal character '%s' in \\ sequence", - unctrl(UChar(c))); + unctrl(ch)); /* FALLTHRU */ case '|': - *(ptr++) = (char) c; - } /* endswitch (c) */ - } /* endelse (c < '0' || c > '7') */ + *(ptr++) = (char) ch; + } /* endswitch (ch) */ + } /* endelse (ch < '0' || ch > '7') */ } - /* end else if (c == '\\') */ - else if (c == '\n' && (_nc_syntax == SYN_TERMINFO)) { + /* end else if (ch == '\\') */ + else if (ch == '\n' && (_nc_syntax == SYN_TERMINFO)) { /* * Newlines embedded in a terminfo string are ignored, provided * that the next line begins with whitespace. */ ignored = TRUE; } else { - *(ptr++) = (char) c; + *(ptr++) = (char) ch; } if (!ignored) { if (_nc_curr_col <= 1) { - push_back((char) c); - c = '\n'; + push_back((char) ch); + ch = '\n'; break; } - last_ch = c; + last_ch = ch; count++; } ignored = FALSE; @@ -879,7 +885,7 @@ _nc_trans_string(char *ptr, char *last) *ptr = '\0'; - return (c); + return (ch); } /* diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c index 82665cb54be..fdc2bb09ead 100644 --- a/ncurses/tinfo/db_iterator.c +++ b/ncurses/tinfo/db_iterator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2007,2010 Free Software Foundation, Inc. * + * Copyright (c) 2006,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,7 +38,7 @@ #include -MODULE_ID("$Id: db_iterator.c,v 1.9 2010/12/25 23:00:25 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.6 2007/04/22 00:00:26 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -104,7 +104,7 @@ next_list_item(const char *source, int *offset) if (source != 0) { FreeIfNeeded(ThisDbList); ThisDbList = strdup(source); - ThisDbSize = (int) strlen(source); + ThisDbSize = strlen(source); } if (ThisDbList != 0 && ThisDbSize && *offset < ThisDbSize) { @@ -118,10 +118,11 @@ next_list_item(const char *source, int *offset) * again, using the data at the offset. */ if (marker == 0) { - *offset += (int) strlen(result); + *offset += strlen(result) + 1; + marker = result + *offset; } else { *marker++ = 0; - *offset = (int) (marker - ThisDbList); + *offset = marker - ThisDbList; } if (*result == 0 && result != (ThisDbList + ThisDbSize)) result = system_db; diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c index b1e14a803f3..cf2a8337b87 100644 --- a/ncurses/tinfo/entries.c +++ b/ncurses/tinfo/entries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2006-2007,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 * @@ -28,7 +28,6 @@ /**************************************************************************** * Author: Thomas E. Dickey * - * and: Juergen Pfeifer * ****************************************************************************/ #include @@ -36,8 +35,9 @@ #include #include +#include -MODULE_ID("$Id: entries.c,v 1.17 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: entries.c,v 1.8 2008/09/27 13:11:10 tom Exp $") /**************************************************************************** * @@ -119,12 +119,6 @@ _nc_leaks_tinfo(void) #if NO_LEAKS _nc_free_tparm(); _nc_tgetent_leaks(); - - if (TerminalOf(CURRENT_SCREEN) != 0) { - del_curterm(TerminalOf(CURRENT_SCREEN)); - } - - _nc_comp_captab_leaks(); _nc_free_entries(_nc_head); _nc_get_type(0); _nc_first_name(0); @@ -137,12 +131,6 @@ _nc_leaks_tinfo(void) if ((s = _nc_home_terminfo()) != 0) free(s); - -#ifdef TRACE - trace(0); - _nc_trace_buf(-1, 0); -#endif - #endif /* NO_LEAKS */ returnVoid; } diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c index ad056ba4545..fa0fff1b83f 100644 --- a/ncurses/tinfo/free_ttype.c +++ b/ncurses/tinfo/free_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1999-2005,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 * @@ -41,8 +41,9 @@ #include #include +#include -MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $") +MODULE_ID("$Id: free_ttype.c,v 1.13 2006/06/25 10:46:02 tom Exp $") NCURSES_EXPORT(void) _nc_free_termtype(TERMTYPE *ptr) @@ -69,7 +70,6 @@ use_extended_names(bool flag) { int oldflag = _nc_user_definable; - START_TRACE(); T((T_CALLED("use_extended_names(%d)"), flag)); _nc_user_definable = flag; returnBool(oldflag); diff --git a/ncurses/tinfo/hashed_db.c b/ncurses/tinfo/hashed_db.c index bf7a968ee96..3fc04eae3cc 100644 --- a/ncurses/tinfo/hashed_db.c +++ b/ncurses/tinfo/hashed_db.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2006-on * + * Author: Thomas E. Dickey 2006 * ****************************************************************************/ #include @@ -36,7 +36,7 @@ #if USE_HASHED_DB -MODULE_ID("$Id: hashed_db.c,v 1.14 2008/12/13 20:59:02 tom Exp $") +MODULE_ID("$Id: hashed_db.c,v 1.13 2006/08/19 19:48:38 tom Exp $") #if HASHED_DB_API >= 2 static DBC *cursor; @@ -49,30 +49,27 @@ NCURSES_EXPORT(DB *) _nc_db_open(const char *path, bool modify) { DB *result = 0; - int code; #if HASHED_DB_API >= 4 db_create(&result, NULL, 0); - if ((code = result->open(result, - NULL, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644)) != 0) { - result = 0; - } + result->open(result, + NULL, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644); #elif HASHED_DB_API >= 3 db_create(&result, NULL, 0); - if ((code = result->open(result, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644)) != 0) { - result = 0; - } + result->open(result, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644); #elif HASHED_DB_API >= 2 + int code; + if ((code = db_open(path, DB_HASH, modify ? DB_CREATE : DB_RDONLY, @@ -80,22 +77,21 @@ _nc_db_open(const char *path, bool modify) (DB_ENV *) 0, (DB_INFO *) 0, &result)) != 0) { + T(("cannot open %s: %s", path, strerror(code))); result = 0; + } else { + T(("opened %s", path)); } #else - if ((result = dbopen(path, - modify ? (O_CREAT | O_RDWR) : O_RDONLY, - 0644, - DB_HASH, - NULL)) == 0) { - code = errno; - } -#endif + result = dbopen(path, + modify ? (O_CREAT | O_RDWR) : O_RDONLY, + 0644, + DB_HASH, + NULL); if (result != 0) { T(("opened %s", path)); - } else { - T(("cannot open %s: %s", path, strerror(code))); } +#endif return result; } diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c index 69d69f95bf7..4521c4a8da6 100644 --- a/ncurses/tinfo/home_terminfo.c +++ b/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $") +MODULE_ID("$Id: home_terminfo.c,v 1.11 2008/08/03 23:43:11 tom Exp $") /* ncurses extension...fall back on user's private directory */ @@ -53,7 +53,7 @@ _nc_home_terminfo(void) if (use_terminfo_vars()) { if (MyBuffer == 0) { if ((home = getenv("HOME")) != 0) { - size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); + unsigned want = (strlen(home) + sizeof(PRIVATE_INFO)); MyBuffer = typeMalloc(char, want); if (MyBuffer == 0) _nc_err_abort(MSG_NO_MEMORY); diff --git a/ncurses/tinfo/init_keytry.c b/ncurses/tinfo/init_keytry.c index ea47b382b49..2f6fe4f6fad 100644 --- a/ncurses/tinfo/init_keytry.c +++ b/ncurses/tinfo/init_keytry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1999-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 * @@ -27,9 +27,16 @@ ****************************************************************************/ #include + +#include +/* keypad_xmit, keypad_local, meta_on, meta_off */ +/* cursor_visible,cursor_normal,cursor_invisible */ + #include /* struct tinfo_fkeys */ -MODULE_ID("$Id: init_keytry.c,v 1.17 2010/04/24 22:29:56 tom Exp $") +#include + +MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") /* ** _nc_init_keytry() @@ -43,7 +50,7 @@ MODULE_ID("$Id: init_keytry.c,v 1.17 2010/04/24 22:29:56 tom Exp $") * than cur_term. */ #undef CUR -#define CUR SP_TERMTYPE +#define CUR (sp->_term)->type. #if BROKEN_LINKER #undef _nc_tinfo_fkeys @@ -66,7 +73,7 @@ _nc_tinfo_fkeysf(void) NCURSES_EXPORT(void) _nc_init_keytry(SCREEN *sp) { - unsigned n; + size_t n; /* The sp->_keytry value is initialized in newterm(), where the sp * structure is created, because we can not tell where keypad() or @@ -90,13 +97,12 @@ _nc_init_keytry(SCREEN *sp) { TERMTYPE *tp = &(sp->_term->type); for (n = STRCOUNT; n < NUM_STRINGS(tp); ++n) { - const char *name = ExtStrname(tp, (int) n, strnames); + const char *name = ExtStrname(tp, n, strnames); char *value = tp->Strings[n]; if (name != 0 && *name == 'k' && value != 0 - && NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx - value) == 0) { + && key_defined(value) == 0) { (void) _nc_add_to_try(&(sp->_keytry), value, n - STRCOUNT + KEY_MAX); diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index d8fdedca843..919e47287a7 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,21 +30,17 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2008 * ****************************************************************************/ #include +#include /* ena_acs, acs_chars */ -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - -MODULE_ID("$Id: lib_acs.c,v 1.43 2010/12/25 23:00:45 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.36 2008/08/16 19:22:55 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map -NCURSES_EXPORT(chtype *) -NCURSES_PUBLIC_VAR(acs_map) (void) +NCURSES_EXPORT_VAR(chtype *) +_nc_acs_map(void) { if (MyBuffer == 0) MyBuffer = typeCalloc(chtype, ACS_LEN); @@ -52,35 +48,17 @@ NCURSES_PUBLIC_VAR(acs_map) (void) } #undef MyBuffer #else -NCURSES_EXPORT_VAR (chtype) acs_map[ACS_LEN] = +NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = { 0 }; #endif -#ifdef USE_TERM_DRIVER -NCURSES_EXPORT(chtype) -NCURSES_SP_NAME(_nc_acs_char) (NCURSES_SP_DCLx int c) -{ - chtype *map; - if (c < 0 || c >= ACS_LEN) - return (chtype) 0; - map = (SP_PARM != 0) ? SP_PARM->_acs_map : -#if BROKEN_LINKER || USE_REENTRANT - _nc_prescreen.real_acs_map -#else - acs_map -#endif - ; - return map[c]; -} -#endif /* USE_TERM_DRIVER */ - NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) +_nc_init_acs(void) { chtype *fake_map = acs_map; - chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map; + chtype *real_map = SP != 0 ? SP->_acs_map : fake_map; int j; T(("initializing ACS map")); @@ -93,9 +71,9 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) if (real_map != fake_map) { for (j = 1; j < ACS_LEN; ++j) { real_map[j] = 0; - fake_map[j] = A_ALTCHARSET | (chtype) j; - if (SP_PARM) - SP_PARM->_screen_acs_map[j] = FALSE; + fake_map[j] = A_ALTCHARSET | j; + if (SP) + SP->_screen_acs_map[j] = FALSE; } } else { for (j = 1; j < ACS_LEN; ++j) { @@ -140,34 +118,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) real_map['{'] = '*'; /* should be greek pi */ real_map['|'] = '!'; /* should be not-equal */ real_map['}'] = 'f'; /* should be pound-sterling symbol */ - /* thick-line-drawing */ - real_map['L'] = '+'; /* upper left corner */ - real_map['M'] = '+'; /* lower left corner */ - real_map['K'] = '+'; /* upper right corner */ - real_map['J'] = '+'; /* lower right corner */ - real_map['T'] = '+'; /* tee pointing left */ - real_map['U'] = '+'; /* tee pointing right */ - real_map['V'] = '+'; /* tee pointing up */ - real_map['W'] = '+'; /* tee pointing down */ - real_map['Q'] = '-'; /* horizontal line */ - real_map['X'] = '|'; /* vertical line */ - real_map['N'] = '+'; /* large plus or crossover */ - /* double-line-drawing */ - real_map['C'] = '+'; /* upper left corner */ - real_map['D'] = '+'; /* lower left corner */ - real_map['B'] = '+'; /* upper right corner */ - real_map['A'] = '+'; /* lower right corner */ - real_map['G'] = '+'; /* tee pointing left */ - real_map['F'] = '+'; /* tee pointing right */ - real_map['H'] = '+'; /* tee pointing up */ - real_map['I'] = '+'; /* tee pointing down */ - real_map['R'] = '-'; /* horizontal line */ - real_map['Y'] = '|'; /* vertical line */ - real_map['E'] = '+'; /* large plus or crossover */ -#ifdef USE_TERM_DRIVER - CallDriver_2(SP_PARM, initacs, real_map, fake_map); -#else if (ena_acs != NULL) { TPUTS_TRACE("ena_acs"); putp(ena_acs); @@ -189,7 +140,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) size_t i; for (i = 1; i < ACS_LEN; ++i) { if (real_map[i] == 0) { - real_map[i] = (chtype) i; + real_map[i] = i; if (real_map != fake_map) { if (SP != 0) SP->_screen_acs_map[i] = TRUE; @@ -240,13 +191,4 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) _nc_unlock_global(tracef); } #endif /* TRACE */ -#endif } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_init_acs(void) -{ - NCURSES_SP_NAME(_nc_init_acs) (CURRENT_SCREEN); -} -#endif diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index 9302f022b89..b9cdfda9acc 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -38,6 +38,7 @@ */ #include +#include /* cur_term, pad_char */ #include /* ospeed */ #if defined(__FreeBSD__) #include @@ -79,7 +80,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.31 2010/12/19 01:50:50 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.27 2008/06/28 15:19:24 tom Exp $") /* * int @@ -194,11 +195,11 @@ _nc_ospeed(int BaudRate) } NCURSES_EXPORT(int) -NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) +baudrate(void) { int result; - T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); + T((T_CALLED("baudrate()"))); /* * In debugging, allow the environment symbol to override when we're @@ -206,41 +207,32 @@ NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) * that take into account costs that depend on baudrate. */ #ifdef TRACE - if (IsValidTIScreen(SP_PARM) - && !isatty(fileno(SP_PARM ? SP_PARM->_ofp : stdout)) + if (!isatty(fileno(SP ? SP->_ofp : stdout)) && getenv("BAUDRATE") != 0) { int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; - ospeed = (NCURSES_OSPEED) _nc_ospeed(ret); + ospeed = _nc_ospeed(ret); returnCode(ret); } #endif - if (IsValidTIScreen(SP_PARM)) { + if (cur_term != 0) { #ifdef USE_OLD_TTY - result = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); + result = cfgetospeed(&cur_term->Nttyb); ospeed = _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS - ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); + ospeed = cfgetospeed(&cur_term->Nttyb); #else - ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed; + ospeed = cur_term->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif - TerminalOf(SP_PARM)->_baudrate = result; + cur_term->_baudrate = result; } else { result = ERR; } returnCode(result); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -baudrate(void) -{ - return NCURSES_SP_NAME(baudrate) (CURRENT_SCREEN); -} -#endif diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 86e130e7852..626578d5c08 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,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 * @@ -37,141 +37,69 @@ */ #include +#include /* TTY, cur_term */ #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.30 2010/12/19 01:38:45 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.18 2008/08/16 19:22:55 tom Exp $") #undef CUR #define CUR termp->type. -#if BROKEN_LINKER && !USE_REENTRANT -NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; -#elif BROKEN_LINKER || USE_REENTRANT - -NCURSES_EXPORT(TERMINAL *) -NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_DCL0) -{ - return ((0 != TerminalOf(SP_PARM)) ? TerminalOf(SP_PARM) : CurTerm); -} - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(TERMINAL *) -_nc_get_cur_term(void) -{ - return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); -} -#endif - +#if BROKEN_LINKER || USE_REENTRANT NCURSES_EXPORT(TERMINAL *) NCURSES_PUBLIC_VAR(cur_term) (void) { -#if NCURSES_SP_FUNCS - return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); -#else - return NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG); -#endif + return (SP != 0 && SP->_term != 0) ? SP->_term : _nc_prescreen._cur_term; } - #else NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; #endif NCURSES_EXPORT(TERMINAL *) -NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) +set_curterm(TERMINAL * termp) { TERMINAL *oldterm; - T((T_CALLED("set_curterm(%p)"), (void *) termp)); + T((T_CALLED("set_curterm(%p)"), termp)); _nc_lock_global(curses); oldterm = cur_term; - if (SP_PARM) - SP_PARM->_term = termp; -#if BROKEN_LINKER && !USE_REENTRANT - cur_term = termp; + if (SP) + SP->_term = termp; +#if BROKEN_LINKER || USE_REENTRANT + _nc_prescreen._cur_term = termp; #else - CurTerm = termp; + cur_term = termp; #endif if (termp != 0) { -#ifdef USE_TERM_DRIVER - TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; - ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); - if (TCB->drv->isTerminfo && termp->type.Strings) { - PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); - } - TCB->csp = SP_PARM; -#else - ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); + ospeed = _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } -#endif } _nc_unlock_global(curses); - T((T_RETURN("%p"), (void *) oldterm)); + T((T_RETURN("%p"), oldterm)); return (oldterm); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(TERMINAL *) -set_curterm(TERMINAL * termp) -{ - return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) -{ - int rc = ERR; - - T((T_CALLED("del_curterm(%p, %p)"), (void *) SP_PARM, (void *) termp)); - - if (termp != 0) { -#ifdef USE_TERM_DRIVER - TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; -#endif - TERMINAL *cur = ( -#if BROKEN_LINKER && !USE_REENTRANT - cur_term -#elif BROKEN_LINKER || USE_REENTRANT - NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG) -#else - cur_term -#endif - ); - - _nc_free_termtype(&(termp->type)); - if (termp == cur) - NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0); - - FreeIfNeeded(termp->_termname); -#if USE_HOME_TERMINFO - if (_nc_globals.home_terminfo != 0) - FreeAndNull(_nc_globals.home_terminfo); -#endif -#ifdef USE_TERM_DRIVER - if (TCB->drv) - TCB->drv->release(TCB); -#endif - free(termp); - - rc = OK; - } - returnCode(rc); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) del_curterm(TERMINAL * termp) { int rc = ERR; + T((T_CALLED("del_curterm(%p)"), termp)); + _nc_lock_global(curses); - rc = NCURSES_SP_NAME(del_curterm) (CURRENT_SCREEN, termp); + if (termp != 0) { + _nc_free_termtype(&(termp->type)); + FreeIfNeeded(termp->_termname); + free(termp); + if (termp == cur_term) + set_curterm(0); + rc = OK; + } _nc_unlock_global(curses); - return (rc); + returnCode(rc); } -#endif diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index 195ddf978ab..e84209d4022 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -42,7 +41,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.61 2010/05/15 22:06:56 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -52,17 +51,17 @@ MODULE_ID("$Id: lib_data.c,v 1.61 2010/05/15 22:06:56 tom Exp $") NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(stdscr) (void) { - return CURRENT_SCREEN ? StdScreen(CURRENT_SCREEN) : 0; + return SP ? SP->_stdscr : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(curscr) (void) { - return CURRENT_SCREEN ? CurScreen(CURRENT_SCREEN) : 0; + return SP ? SP->_curscr : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(newscr) (void) { - return CURRENT_SCREEN ? NewScreen(CURRENT_SCREEN) : 0; + return SP ? SP->_newscr : 0; } #else NCURSES_EXPORT_VAR(WINDOW *) stdscr = 0; @@ -94,7 +93,7 @@ _nc_screen(void) NCURSES_EXPORT(int) _nc_alloc_screen(void) { - return ((my_screen = _nc_alloc_screen_sp()) != 0); + return ((my_screen = typeCalloc(SCREEN, 1)) != 0); } NCURSES_EXPORT(void) @@ -104,7 +103,6 @@ _nc_set_screen(SCREEN *sp) } #else - NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ #endif /* *INDENT-OFF* */ @@ -142,9 +140,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* tgetent_index */ 0, /* tgetent_sequence */ -#ifndef USE_SP_WINDOWLIST 0, /* _nc_windowlist */ -#endif #if USE_HOME_TERMINFO NULL, /* home_terminfo */ @@ -155,10 +151,6 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* safeprint_rows */ #endif -#ifdef USE_TERM_DRIVER - 0, /* term_driver */ -#endif - #ifdef TRACE FALSE, /* init_trace */ CHARS_0s, /* trace_fname */ @@ -182,9 +174,7 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { { CHARS_0s, CHARS_0s }, /* traceatr_color_buf */ 0, /* traceatr_color_sel */ -1, /* traceatr_color_last */ -#if !defined(USE_PTHREADS) && USE_REENTRANT - 0, /* nested_tracef */ -#endif + #endif /* TRACE */ #ifdef USE_PTHREADS PTHREAD_MUTEX_INITIALIZER, /* mutex_curses */ @@ -193,9 +183,6 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* nested_tracef */ 0, /* use_pthreads */ #endif -#if USE_PTHREADS_EINTR - 0, /* read_thread */ -#endif }; #define STACK_FRAME_0 { { 0 }, 0 } @@ -209,10 +196,8 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { TRUE, /* use_env */ FALSE, /* filter_mode */ A_NORMAL, /* previous_attr */ -#ifndef USE_SP_RIPOFF RIPOFF_0s, /* ripoff */ NULL, /* rsp */ -#endif { /* tparm_state */ #ifdef TRACE NULL, /* tname */ @@ -236,13 +221,10 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { #if NCURSES_NO_PADDING FALSE, /* flag to set if padding disabled */ #endif - 0, /* _outch */ #if BROKEN_LINKER || USE_REENTRANT NULL, /* real_acs_map */ 0, /* LINES */ 0, /* COLS */ - 8, /* TABSIZE */ - 1000, /* ESCDELAY */ 0, /* cur_term */ #ifdef TRACE 0L, /* _outchars */ @@ -252,22 +234,6 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { }; /* *INDENT-ON* */ -/* - * wgetch() and other functions with a WINDOW* parameter may use a SCREEN* - * internally, and it is useful to allow those to be invoked without switching - * SCREEN's, e.g., for multi-threaded applications. - */ -NCURSES_EXPORT(SCREEN *) -_nc_screen_of(WINDOW *win) -{ - SCREEN *sp = 0; - - if (win != 0) { - sp = WINDOW_EXT(win, screen); - } - return (sp); -} - /******************************************************************************/ #ifdef USE_PTHREADS static void @@ -348,9 +314,7 @@ _nc_mutex_unlock(pthread_mutex_t * obj) return 0; return pthread_mutex_unlock(obj); } -#endif /* USE_PTHREADS */ -#if defined(USE_PTHREADS) || USE_PTHREADS_EINTR #if USE_WEAK_SYMBOLS /* * NB: sigprocmask(2) is global but pthread_sigmask(3p) diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index d1b9b8d966d..0dc66bd9b91 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-2003 * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -42,53 +41,25 @@ #include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +#include -MODULE_ID("$Id: lib_has_cap.c,v 1.9 2009/10/24 22:15:47 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.4 2003/10/25 19:43:55 tom Exp $") -NCURSES_EXPORT(bool) -NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) -{ - bool code = FALSE; - - T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); - - if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { - code = ((insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)) ? TRUE : FALSE; - } - - returnCode(code); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_ic(void) { - return NCURSES_SP_NAME(has_ic) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(bool) -NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) -{ - bool code = FALSE; - T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); - if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { - code = ((insert_line || parm_insert_line) - && (delete_line || parm_delete_line)) ? TRUE : FALSE; - } - - returnCode(code); + T((T_CALLED("has_ic()"))); + returnCode(cur_term && + (insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_il(void) { - return NCURSES_SP_NAME(has_il) (CURRENT_SCREEN); + T((T_CALLED("has_il()"))); + returnCode(cur_term + && (insert_line || parm_insert_line) + && (delete_line || parm_delete_line)); } -#endif diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 37f70842907..89dc1e80ea8 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2004 Free 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,8 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 2002 * - * and: Juergen Pfeifer 2009 * + * and: Thomas E. Dickey 2002 * ****************************************************************************/ /* @@ -47,8 +46,9 @@ */ #include +#include /* cur_term */ -MODULE_ID("$Id: lib_kernel.c,v 1.31 2010/12/19 01:21:19 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.24 2004/05/08 17:11:21 tom Exp $") static int _nc_vdisable(void) @@ -59,7 +59,7 @@ _nc_vdisable(void) #endif #if defined(_PC_VDISABLE) if (value == -1) { - value = (int) fpathconf(0, _PC_VDISABLE); + value = fpathconf(0, _PC_VDISABLE); if (value == -1) { value = 0377; } @@ -79,33 +79,23 @@ _nc_vdisable(void) */ NCURSES_EXPORT(char) -NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) +erasechar(void) { int result = ERR; - TERMINAL *termp = TerminalOf(SP_PARM); + T((T_CALLED("erasechar()"))); - T((T_CALLED("erasechar(%p)"), (void *) SP_PARM)); - - if (termp != 0) { + if (cur_term != 0) { #ifdef TERMIOS - result = termp->Ottyb.c_cc[VERASE]; + result = cur_term->Ottyb.c_cc[VERASE]; if (result == _nc_vdisable()) result = ERR; #else - result = termp->Ottyb.sg_erase; + result = cur_term->Ottyb.sg_erase; #endif } - returnChar((char) result); + returnCode(result); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(char) -erasechar(void) -{ - return NCURSES_SP_NAME(erasechar) (CURRENT_SCREEN); -} -#endif - /* * killchar() * @@ -114,33 +104,23 @@ erasechar(void) */ NCURSES_EXPORT(char) -NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) +killchar(void) { int result = ERR; - TERMINAL *termp = TerminalOf(SP_PARM); + T((T_CALLED("killchar()"))); - T((T_CALLED("killchar(%p)"), (void *) SP_PARM)); - - if (termp != 0) { + if (cur_term != 0) { #ifdef TERMIOS - result = termp->Ottyb.c_cc[VKILL]; + result = cur_term->Ottyb.c_cc[VKILL]; if (result == _nc_vdisable()) result = ERR; #else - result = termp->Ottyb.sg_kill; + result = cur_term->Ottyb.sg_kill; #endif } - returnChar((char) result); + returnCode(result); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(char) -killchar(void) -{ - return NCURSES_SP_NAME(killchar) (CURRENT_SCREEN); -} -#endif - /* * flushinp() * @@ -149,36 +129,26 @@ killchar(void) */ NCURSES_EXPORT(int) -NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0) +flushinp(void) { - TERMINAL *termp = TerminalOf(SP_PARM); + T((T_CALLED("flushinp()"))); - T((T_CALLED("flushinp(%p)"), (void *) SP_PARM)); - - if (termp != 0) { + if (cur_term != 0) { #ifdef TERMIOS - tcflush(termp->Filedes, TCIFLUSH); + tcflush(cur_term->Filedes, TCIFLUSH); #else errno = 0; do { - ioctl(termp->Filedes, TIOCFLUSH, 0); + ioctl(cur_term->Filedes, TIOCFLUSH, 0); } while (errno == EINTR); #endif - if (SP_PARM) { - SP_PARM->_fifohead = -1; - SP_PARM->_fifotail = 0; - SP_PARM->_fifopeek = 0; + if (SP) { + SP->_fifohead = -1; + SP->_fifotail = 0; + SP->_fifopeek = 0; } returnCode(OK); } returnCode(ERR); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -flushinp(void) -{ - return NCURSES_SP_NAME(flushinp) (CURRENT_SCREEN); -} -#endif diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c index 14903175b32..1301ee51694 100644 --- a/ncurses/tinfo/lib_longname.c +++ b/ncurses/tinfo/lib_longname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,8 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -42,38 +40,8 @@ #include -MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.9 2000/12/10 02:55:07 tom Exp $") -#if USE_REENTRANT -NCURSES_EXPORT(char *) -NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0) -{ - static char empty[] = - {'\0'}; - char *ptr; - - T((T_CALLED("longname(%p)"), (void *) SP_PARM)); - - if (SP_PARM) { - for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype); - ptr > SP_PARM->_ttytype; - ptr--) - if (*ptr == '|') - returnPtr(ptr + 1); - returnPtr(SP_PARM->_ttytype); - } - return empty; -} - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(char *) -longname(void) -{ - return NCURSES_SP_NAME(longname) (CURRENT_SCREEN); -} -#endif - -#else NCURSES_EXPORT(char *) longname(void) { @@ -81,11 +49,9 @@ longname(void) T((T_CALLED("longname()"))); - for (ptr = ttytype + strlen(ttytype); - ptr > ttytype; - ptr--) + for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) if (*ptr == '|') returnPtr(ptr + 1); + returnPtr(ttytype); } -#endif diff --git a/ncurses/tinfo/lib_napms.c b/ncurses/tinfo/lib_napms.c index 1e6abda10d0..417b3b4b4db 100644 --- a/ncurses/tinfo/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -29,8 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -51,17 +49,13 @@ #endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.20 2009/11/07 20:37:30 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.17 2008/05/03 21:34:13 tom Exp $") NCURSES_EXPORT(int) -NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) +napms(int ms) { - (void) SP_PARM; T((T_CALLED("napms(%d)"), ms)); -#ifdef USE_TERM_DRIVER - CallDriver_1(SP_PARM, nap, ms); -#else /* !USE_TERM_DRIVER */ #if HAVE_NANOSLEEP { struct timespec request, remaining; @@ -75,15 +69,6 @@ NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif -#endif /* !USE_TERM_DRIVER */ returnCode(OK); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -napms(int ms) -{ - return NCURSES_SP_NAME(napms) (CURRENT_SCREEN, ms); -} -#endif diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index 654bf940aa1..f3b1485bf11 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -42,67 +41,53 @@ #include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +#include -MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $") +MODULE_ID("$Id: lib_options.c,v 1.58 2008/08/16 21:20:48 Werner.Fink Exp $") + +static int _nc_curs_set(SCREEN *, int); +static int _nc_meta(SCREEN *, bool); NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { - int res = ERR; - T((T_CALLED("idlok(%p,%d)"), (void *) win, flag)); + T((T_CALLED("idlok(%p,%d)"), win, flag)); if (win) { - SCREEN *sp = _nc_screen_of(win); - if (sp && IsTermInfo(sp)) { - sp->_nc_sp_idlok = - win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG) - || change_scroll_region)); - res = OK; - } - } - returnCode(res); + _nc_idlok = win->_idlok = (flag && (has_il() || change_scroll_region)); + returnCode(OK); + } else + returnCode(ERR); } NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { - T((T_CALLED("idcok(%p,%d)"), (void *) win, flag)); + T((T_CALLED("idcok(%p,%d)"), win, flag)); + + if (win) + _nc_idcok = win->_idcok = (flag && has_ic()); - if (win) { - SCREEN *sp = _nc_screen_of(win); - sp->_nc_sp_idcok = win->_idcok = (flag && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)); - } returnVoid; } -NCURSES_EXPORT(int) -NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) -{ - T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); - - if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) - returnCode(ERR); - - NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); - SP_PARM->_cbreak = t + 1; - returnCode(OK); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) halfdelay(int t) { - return NCURSES_SP_NAME(halfdelay) (CURRENT_SCREEN, t); + T((T_CALLED("halfdelay(%d)"), t)); + + if (t < 1 || t > 255 || SP == 0) + returnCode(ERR); + + cbreak(); + SP->_cbreak = t + 1; + returnCode(OK); } -#endif NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { - T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag)); + T((T_CALLED("nodelay(%p,%d)"), win, flag)); if (win) { if (flag == TRUE) @@ -117,7 +102,7 @@ nodelay(WINDOW *win, bool flag) NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { - T((T_CALLED("notimeout(%p,%d)"), (void *) win, f)); + T((T_CALLED("notimeout(%p,%d)"), win, f)); if (win) { win->_notimeout = f; @@ -129,7 +114,7 @@ notimeout(WINDOW *win, bool f) NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { - T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay)); + T((T_CALLED("wtimeout(%p,%d)"), win, delay)); if (win) { win->_delay = delay; @@ -140,11 +125,11 @@ wtimeout(WINDOW *win, int delay) NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { - T((T_CALLED("keypad(%p,%d)"), (void *) win, flag)); + T((T_CALLED("keypad(%p,%d)"), win, flag)); if (win) { win->_use_keypad = flag; - returnCode(_nc_keypad(_nc_screen_of(win), flag)); + returnCode(_nc_keypad(SP, flag)); } else returnCode(ERR); } @@ -152,106 +137,38 @@ keypad(WINDOW *win, bool flag) NCURSES_EXPORT(int) meta(WINDOW *win GCC_UNUSED, bool flag) { - int result = ERR; - SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win); + int result; /* Ok, we stay relaxed and don't signal an error if win is NULL */ - T((T_CALLED("meta(%p,%d)"), (void *) win, flag)); - - /* Ok, we stay relaxed and don't signal an error if win is NULL */ - - if (sp != 0) { - sp->_use_meta = flag; -#ifdef USE_TERM_DRIVER - if (IsTermInfo(sp)) { - if (flag) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); - } else { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); - } - } -#else - if (flag) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); - } else { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); - } -#endif - result = OK; - } + T((T_CALLED("meta(%p,%d)"), win, flag)); + result = _nc_meta(SP, flag); returnCode(result); } /* curs_set() moved here to narrow the kernel interface */ -NCURSES_EXPORT(int) -NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) -{ - int code = ERR; - T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis)); - - if (SP_PARM != 0 && vis >= 0 && vis <= 2) { - int cursor = SP_PARM->_cursor; - bool bBuiltIn = !IsTermInfo(SP_PARM); - if (vis == cursor) { - code = cursor; - } else { - if (!bBuiltIn) { - switch (vis) { - case 2: - code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "cursor_visible", - cursor_visible); - break; - case 1: - code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "cursor_normal", - cursor_normal); - break; - case 0: - code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "cursor_invisible", - cursor_invisible); - break; - } - } else - code = ERR; - if (code != ERR) - code = (cursor == -1 ? 1 : cursor); - SP_PARM->_cursor = vis; - } - } - returnCode(code); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) curs_set(int vis) { - return (NCURSES_SP_NAME(curs_set) (CURRENT_SCREEN, vis)); + int result; + + T((T_CALLED("curs_set(%d)"), vis)); + result = _nc_curs_set(SP, vis); + returnCode(result); } -#endif NCURSES_EXPORT(int) -NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) +typeahead(int fd) { - T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); - if (IsValidTIScreen(SP_PARM)) { - SP_PARM->_checkfd = fd; + T((T_CALLED("typeahead(%d)"), fd)); + if (SP != 0) { + SP->_checkfd = fd; returnCode(OK); } else { returnCode(ERR); } } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -typeahead(int fd) -{ - return NCURSES_SP_NAME(typeahead) (CURRENT_SCREEN, fd); -} -#endif - /* ** has_key() ** @@ -272,50 +189,43 @@ has_key_internal(int keycode, TRIES * tp) || has_key_internal(keycode, tp->sibling)); } -#ifdef USE_TERM_DRIVER -NCURSES_EXPORT(int) -TINFO_HAS_KEY(SCREEN *sp, int keycode) -{ - return IsValidTIScreen(sp) ? - has_key_internal(keycode, sp->_keytry) : 0; -} -#else -NCURSES_EXPORT(int) -NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode) -{ - T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode)); - returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) has_key(int keycode) { - return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode); + T((T_CALLED("has_key(%d)"), keycode)); + returnCode(SP != 0 ? has_key_internal(keycode, SP->_keytry) : FALSE); } -#endif -#endif #endif /* NCURSES_EXT_FUNCS */ -NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx - const char *name, const char *value) +/* + * Internal entrypoints use SCREEN* parameter to obtain capabilities rather + * than cur_term. + */ +#undef CUR +#define CUR (sp->_term)->type. + +static int +_nc_putp(const char *name GCC_UNUSED, const char *value) { - int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); + int rc = ERR; + + if (value) { + TPUTS_TRACE(name); + rc = putp(value); + } + return rc; +} + +static int +_nc_putp_flush(const char *name, const char *value) +{ + int rc = _nc_putp(name, value); if (rc != ERR) { _nc_flush(); } return rc; } -#if 0 && NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -_nc_putp_flush(const char *name, const char *value) -{ - return NCURSES_SP_NAME(_nc_putp_flush) (CURRENT_SCREEN, name, value); -} -#endif - /* Turn the keypad on/off * * Note: we flush the output because changing this mode causes some terminals @@ -335,12 +245,12 @@ _nc_keypad(SCREEN *sp, bool flag) * has wgetch() reading in more than one thread. putp() and below * may use SP explicitly. */ - if (_nc_use_pthreads && sp != CURRENT_SCREEN) { + if (_nc_use_pthreads && sp != SP) { SCREEN *save_sp; /* cannot use use_screen(), since that is not in tinfo library */ _nc_lock_global(curses); - save_sp = CURRENT_SCREEN; + save_sp = SP; _nc_set_screen(sp); rc = _nc_keypad(sp, flag); _nc_set_screen(save_sp); @@ -348,19 +258,10 @@ _nc_keypad(SCREEN *sp, bool flag) } else #endif { -#ifdef USE_TERM_DRIVER - rc = CallDriver_1(sp, kpad, flag); - if (rc == OK) - sp->_keypad_on = flag; -#else if (flag) { - (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "keypad_xmit", - keypad_xmit); + (void) _nc_putp_flush("keypad_xmit", keypad_xmit); } else if (!flag && keypad_local) { - (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx - "keypad_local", - keypad_local); + (void) _nc_putp_flush("keypad_local", keypad_local); } if (flag && !sp->_tried) { @@ -369,8 +270,58 @@ _nc_keypad(SCREEN *sp, bool flag) } sp->_keypad_on = flag; rc = OK; -#endif } } return (rc); } + +static int +_nc_curs_set(SCREEN *sp, int vis) +{ + int result = ERR; + + T((T_CALLED("curs_set(%d)"), vis)); + if (sp != 0 && vis >= 0 && vis <= 2) { + int cursor = sp->_cursor; + + if (vis == cursor) { + result = cursor; + } else { + switch (vis) { + case 2: + result = _nc_putp_flush("cursor_visible", cursor_visible); + break; + case 1: + result = _nc_putp_flush("cursor_normal", cursor_normal); + break; + case 0: + result = _nc_putp_flush("cursor_invisible", cursor_invisible); + break; + } + if (result != ERR) + result = (cursor == -1 ? 1 : cursor); + sp->_cursor = vis; + } + } + returnCode(result); +} + +static int +_nc_meta(SCREEN *sp, bool flag) +{ + int result = ERR; + + /* Ok, we stay relaxed and don't signal an error if win is NULL */ + + if (SP != 0) { + SP->_use_meta = flag; + + if (flag) { + _nc_putp("meta_on", meta_on); + } else { + _nc_putp("meta_off", meta_off); + } + result = OK; + } + return result; +} diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index c7bd3a62fa8..975b46d8577 100644 --- a/ncurses/tinfo/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 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,31 +29,23 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer * ****************************************************************************/ #include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +#include -MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.16 2006/11/26 00:26:34 tom Exp $") NCURSES_EXPORT(int) -NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) +mcprint(char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ { - int result; char *mybuf, *switchon; - size_t onsize, offsize; - size_t need; + size_t onsize, offsize, res; errno = 0; - if (!HasTInfoTerminal(SP_PARM) - || len <= 0 - || (!prtr_non && (!prtr_on || !prtr_off))) { + if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; return (ERR); } @@ -68,10 +60,8 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) offsize = strlen(prtr_off); } - need = onsize + (size_t) len + offsize; - if (switchon == 0 - || (mybuf = typeMalloc(char, need + 1)) == 0) { + || (mybuf = typeMalloc(char, onsize + len + offsize + 1)) == 0) { errno = ENOMEM; return (ERR); } @@ -88,24 +78,15 @@ NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) * data has actually been shipped to the terminal. If the write(2) * operation is truly atomic we're protected from this. */ - result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need); + res = write(cur_term->Filedes, mybuf, onsize + len + offsize); /* * By giving up our scheduler slot here we increase the odds that the * kernel will ship the contiguous clist items from the last write * immediately. */ -#ifndef __MINGW32__ (void) sleep(0); -#endif - free(mybuf); - return (result); -} -#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) -NCURSES_EXPORT(int) -mcprint(char *data, int len) -{ - return NCURSES_SP_NAME(mcprint) (CURRENT_SCREEN, data, len); + free(mybuf); + return (res); } -#endif diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index b524a1bb55b..58e71889af1 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2002,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,8 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1998-on * - * and: Juergen Pfeifer 2009 * + * and: Thomas E. Dickey 1998 on * ****************************************************************************/ /* @@ -48,8 +47,9 @@ */ #include +#include /* cur_term */ -MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -61,7 +61,7 @@ MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $") #ifdef __EMX__ #include -#define _nc_setmode(mode) setmode(SP_PARM->_ifd, mode) +#define _nc_setmode(mode) setmode(SP->_ifd, mode) #else #define _nc_setmode(mode) /* nothing */ #endif @@ -77,235 +77,188 @@ MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $") #endif /* TRACE */ NCURSES_EXPORT(int) -NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) +raw(void) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("raw(%p)"), (void *) SP_PARM)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + T((T_CALLED("raw()"))); + + if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("raw"); _nc_setmode(O_BINARY); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS - buf.c_lflag &= (unsigned) ~(ICANON | ISIG | IEXTEN); - buf.c_iflag &= (unsigned) ~(COOKED_INPUT); + buf.c_lflag &= ~(ICANON | ISIG | IEXTEN); + buf.c_iflag &= ~(COOKED_INPUT); buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= RAW; #endif - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); - if (result == OK) { - SP_PARM->_raw = TRUE; - SP_PARM->_cbreak = 1; - termp->Nttyb = buf; + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_raw = TRUE; + SP->_cbreak = 1; + cur_term->Nttyb = buf; } AFTER("raw"); } returnCode(result); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -raw(void) -{ - return NCURSES_SP_NAME(raw) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) +cbreak(void) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("cbreak(%p)"), (void *) SP_PARM)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + T((T_CALLED("cbreak()"))); + + if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("cbreak"); _nc_setmode(O_BINARY); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS - buf.c_lflag &= (unsigned) ~ICANON; - buf.c_iflag &= (unsigned) ~ICRNL; + buf.c_lflag &= ~ICANON; + buf.c_iflag &= ~ICRNL; buf.c_lflag |= ISIG; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= CBREAK; #endif - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); - if (result == OK) { - SP_PARM->_cbreak = 1; - termp->Nttyb = buf; + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_cbreak = 1; + cur_term->Nttyb = buf; } AFTER("cbreak"); } returnCode(result); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -cbreak(void) -{ - return NCURSES_SP_NAME(cbreak) (CURRENT_SCREEN); -} -#endif - /* * Note: * this implementation may be wrong. See the comment under intrflush(). */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0) +qiflush(void) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("qiflush(%p)"), (void *) SP_PARM)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + T((T_CALLED("qiflush()"))); + + if (cur_term != 0) { TTY buf; BEFORE("qiflush"); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS - buf.c_lflag &= (unsigned) ~(NOFLSH); - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + buf.c_lflag &= ~(NOFLSH); + result = _nc_set_tty_mode(&buf); #else /* FIXME */ #endif if (result == OK) - termp->Nttyb = buf; + cur_term->Nttyb = buf; AFTER("qiflush"); } returnVoid; } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -qiflush(void) -{ - NCURSES_SP_NAME(qiflush) (CURRENT_SCREEN); -} -#endif - NCURSES_EXPORT(int) -NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) +noraw(void) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("noraw(%p)"), (void *) SP_PARM)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + T((T_CALLED("noraw()"))); + + if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("noraw"); _nc_setmode(O_TEXT); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag |= ISIG | ICANON | - (termp->Ottyb.c_lflag & IEXTEN); + (cur_term->Ottyb.c_lflag & IEXTEN); buf.c_iflag |= COOKED_INPUT; #else buf.sg_flags &= ~(RAW | CBREAK); #endif - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); - if (result == OK) { - SP_PARM->_raw = FALSE; - SP_PARM->_cbreak = 0; - termp->Nttyb = buf; + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_raw = FALSE; + SP->_cbreak = 0; + cur_term->Nttyb = buf; } AFTER("noraw"); } returnCode(result); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -noraw(void) -{ - return NCURSES_SP_NAME(noraw) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) +nocbreak(void) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("nocbreak(%p)"), (void *) SP_PARM)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + T((T_CALLED("nocbreak()"))); + + if (SP != 0 && cur_term != 0) { TTY buf; BEFORE("nocbreak"); _nc_setmode(O_TEXT); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag |= ICANON; buf.c_iflag |= ICRNL; #else buf.sg_flags &= ~CBREAK; #endif - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); - if (result == OK) { - SP_PARM->_cbreak = 0; - termp->Nttyb = buf; + if ((result = _nc_set_tty_mode(&buf)) == OK) { + SP->_cbreak = 0; + cur_term->Nttyb = buf; } AFTER("nocbreak"); } returnCode(result); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -nocbreak(void) -{ - return NCURSES_SP_NAME(nocbreak) (CURRENT_SCREEN); -} -#endif - +/* + * Note: + * this implementation may be wrong. See the comment under intrflush(). + */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0) +noqiflush(void) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + T((T_CALLED("noqiflush()"))); + + if (cur_term != 0) { TTY buf; BEFORE("noqiflush"); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS buf.c_lflag |= NOFLSH; - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + result = _nc_set_tty_mode(&buf); #else /* FIXME */ #endif - if (result == OK) - termp->Nttyb = buf; + if (result == OK) { + cur_term->Nttyb = buf; + } AFTER("noqiflush"); } returnVoid; } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -noqiflush(void) -{ - NCURSES_SP_NAME(noqiflush) (CURRENT_SCREEN); -} -#endif - /* * This call does the same thing as the qiflush()/noqiflush() pair. We know * for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the other hand, @@ -314,41 +267,30 @@ noqiflush(void) * curs_inopts(3x) is too exact to be coincidence. */ NCURSES_EXPORT(int) -NCURSES_SP_NAME(intrflush) (NCURSES_SP_DCLx WINDOW *win GCC_UNUSED, bool flag) +intrflush(WINDOW *win GCC_UNUSED, bool flag) { int result = ERR; - TERMINAL *termp; - T((T_CALLED("intrflush(%p,%d)"), (void *) SP_PARM, flag)); - if (SP_PARM == 0) - returnCode(ERR); + T((T_CALLED("intrflush(%d)"), flag)); - if ((termp = TerminalOf(SP_PARM)) != 0) { + if (cur_term != 0) { TTY buf; BEFORE("intrflush"); - buf = termp->Nttyb; + buf = cur_term->Nttyb; #ifdef TERMIOS if (flag) - buf.c_lflag &= (unsigned) ~(NOFLSH); + buf.c_lflag &= ~(NOFLSH); else buf.c_lflag |= (NOFLSH); - result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + result = _nc_set_tty_mode(&buf); #else /* FIXME */ #endif if (result == OK) { - termp->Nttyb = buf; + cur_term->Nttyb = buf; } AFTER("intrflush"); } returnCode(result); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -intrflush(WINDOW *win GCC_UNUSED, bool flag) -{ - return NCURSES_SP_NAME(intrflush) (CURRENT_SCREEN, win, flag); -} -#endif diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 5fcf2ae3fc3..8cfaf12c534 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -42,6 +41,7 @@ #include #include /* for MAX_NAME_SIZE */ +#include #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -51,7 +51,9 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.135 2011/02/06 01:04:21 tom Exp $") +#include /* lines, columns, cur_term */ + +MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") /**************************************************************************** * @@ -107,96 +109,61 @@ MODULE_ID("$Id: lib_setup.c,v 1.135 2011/02/06 01:04:21 tom Exp $") * Wrap global variables in this module. */ #if USE_REENTRANT - NCURSES_EXPORT(char *) NCURSES_PUBLIC_VAR(ttytype) (void) { static char empty[] = ""; - char *result = empty; - -#if NCURSES_SP_FUNCS - if (CURRENT_SCREEN) { - TERMINAL *termp = TerminalOf(CURRENT_SCREEN); - if (termp != 0) { - result = termp->type.term_names; - } - } -#else - if (cur_term != 0) { - result = cur_term->type.term_names; - } -#endif - return result; + return cur_term ? cur_term->type.term_names : empty; } - NCURSES_EXPORT(int *) -_nc_ptr_Lines(SCREEN *sp) +_nc_ptr_Lines(void) { - return ptrLines(sp); + return ptrLines(); } - NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(LINES) (void) { - return *_nc_ptr_Lines(CURRENT_SCREEN); + return *_nc_ptr_Lines(); } - NCURSES_EXPORT(int *) -_nc_ptr_Cols(SCREEN *sp) +_nc_ptr_Cols(void) { - return ptrCols(sp); + return ptrCols(); } - NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(COLS) (void) { - return *_nc_ptr_Cols(CURRENT_SCREEN); + return *_nc_ptr_Cols(); } - -NCURSES_EXPORT(int *) -_nc_ptr_Tabsize(SCREEN *sp) -{ - return ptrTabsize(sp); -} - NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(TABSIZE) (void) { - return *_nc_ptr_Tabsize(CURRENT_SCREEN); + return SP ? SP->_TABSIZE : 8; } #else NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; NCURSES_EXPORT_VAR(int) LINES = 0; NCURSES_EXPORT_VAR(int) COLS = 0; -NCURSES_EXPORT_VAR(int) TABSIZE = 8; +NCURSES_EXPORT_VAR(int) TABSIZE = 0; #endif #if NCURSES_EXT_FUNCS NCURSES_EXPORT(int) -NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value) +set_tabsize(int value) { int code = OK; #if USE_REENTRANT - if (SP_PARM) { - SP_PARM->_TABSIZE = value; + if (SP) { + SP->_TABSIZE = value; } else { code = ERR; } #else - (void) SP_PARM; TABSIZE = value; #endif return code; } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -set_tabsize(int value) -{ - return NCURSES_SP_NAME(set_tabsize) (CURRENT_SCREEN, value); -} #endif -#endif /* NCURSES_EXT_FUNCS */ #if USE_SIGWINCH /* @@ -220,72 +187,43 @@ _nc_handle_sigwinch(SCREEN *sp) #endif -NCURSES_EXPORT(void) -NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f) -{ - T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f)); -#if NCURSES_SP_FUNCS - if (IsPreScreen(SP_PARM)) { - SP_PARM->_use_env = f; - } -#else - _nc_prescreen.use_env = f; -#endif - returnVoid; -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) use_env(bool f) { - T((T_CALLED("use_env(%d)"), (int) f)); + T((T_CALLED("use_env()"))); _nc_prescreen.use_env = f; returnVoid; } -#endif NCURSES_EXPORT(void) -_nc_get_screensize(SCREEN *sp, -#ifdef USE_TERM_DRIVER - TERMINAL * termp, -#endif - int *linep, int *colp) +_nc_get_screensize(SCREEN *sp, int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ { -#ifdef USE_TERM_DRIVER - TERMINAL_CONTROL_BLOCK *TCB; - int my_tabsize; - - assert(termp != 0 && linep != 0 && colp != 0); - TCB = (TERMINAL_CONTROL_BLOCK *) termp; - - my_tabsize = TCB->info.tabsize; - TCB->drv->size(TCB, linep, colp); - -#if USE_REENTRANT - if (sp != 0) { - sp->_TABSIZE = my_tabsize; - } -#else - (void) sp; - TABSIZE = my_tabsize; -#endif - T(("TABSIZE = %d", my_tabsize)); -#else /* !USE_TERM_DRIVER */ TERMINAL *termp = cur_term; int my_tabsize; /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); - *linep = (int) lines; - *colp = (int) columns; - - if (_nc_prescreen.use_env) { + if (!_nc_prescreen.use_env) { + *linep = (int) lines; + *colp = (int) columns; + } else { /* usually want to query LINES and COLUMNS from environment */ int value; + *linep = *colp = 0; + + /* first, look for environment variables */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + } + T(("screen size: environment LINES = %d COLUMNS = %d", *linep, *colp)); + #ifdef __EMX__ - { + if (*linep <= 0 || *colp <= 0) { int screendata[2]; _scrsize(screendata); *colp = screendata[0]; @@ -295,41 +233,33 @@ _nc_get_screensize(SCREEN *sp, } #endif #if HAVE_SIZECHANGE - /* try asking the OS */ - if (isatty(cur_term->Filedes)) { - STRUCT_WINSIZE size; + /* if that didn't work, maybe we can try asking the OS */ + if (*linep <= 0 || *colp <= 0) { + if (isatty(cur_term->Filedes)) { + STRUCT_WINSIZE size; - errno = 0; - do { - if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) >= 0) { - *linep = ((sp != 0 && sp->_filtered) - ? 1 - : WINSIZE_ROWS(size)); + errno = 0; + do { + if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) < 0 + && errno != EINTR) + goto failure; + } while + (errno == EINTR); + + /* + * Solaris lets users override either dimension with an + * environment variable. + */ + if (*linep <= 0) + *linep = (sp != 0 && sp->_filtered) ? 1 : WINSIZE_ROWS(size); + if (*colp <= 0) *colp = WINSIZE_COLS(size); - T(("SYS screen size: environment LINES = %d COLUMNS = %d", - *linep, *colp)); - break; - } - } while - (errno == EINTR); + } + /* FALLTHRU */ + failure:; } #endif /* HAVE_SIZECHANGE */ - /* - * Finally, look for environment variables. - * - * Solaris lets users override either dimension with an environment - * variable. - */ - if ((value = _nc_getenv_num("LINES")) > 0) { - *linep = value; - T(("screen size: environment LINES = %d", *linep)); - } - if ((value = _nc_getenv_num("COLUMNS")) > 0) { - *colp = value; - T(("screen size: environment COLUMNS = %d", *colp)); - } - /* if we can't get dynamic info about the size, use static */ if (*linep <= 0) { *linep = (int) lines; @@ -368,31 +298,19 @@ _nc_get_screensize(SCREEN *sp, TABSIZE = my_tabsize; #endif T(("TABSIZE = %d", TABSIZE)); -#endif /* USE_TERM_DRIVER */ } #if USE_SIZECHANGE NCURSES_EXPORT(void) _nc_update_screensize(SCREEN *sp) { - int new_lines; - int new_cols; - -#ifdef USE_TERM_DRIVER - int old_lines; - int old_cols; - - assert(sp != 0); - - CallDriver_2(sp, getsize, &old_lines, &old_cols); - -#else TERMINAL *termp = cur_term; int old_lines = lines; + int new_lines; int old_cols = columns; -#endif + int new_cols; - TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols); + _nc_get_screensize(sp, &new_lines, &new_cols); /* * See is_term_resized() and resizeterm(). @@ -402,7 +320,7 @@ _nc_update_screensize(SCREEN *sp) if (sp != 0 && sp->_resize != 0) { if ((new_lines != old_lines) || (new_cols != old_cols)) - sp->_resize(NCURSES_SP_ARGx new_lines, new_cols); + sp->_resize(new_lines, new_cols); sp->_sig_winch = FALSE; } } @@ -435,8 +353,8 @@ _nc_update_screensize(SCREEN *sp) * Return 1 if entry found, 0 if not found, -1 if database not accessible, * just like tgetent(). */ -int -_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) +static int +grab_entry(const char *const tn, TERMTYPE *const tp) { char filename[PATH_MAX]; int status = _nc_read_entry(tn, filename, tp); @@ -463,27 +381,28 @@ _nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) #endif /* +** do_prototype() +** ** Take the real command character out of the CC environment variable ** and substitute it in for the prototype given in 'command_character'. */ -void -_nc_tinfo_cmdch(TERMINAL * termp, char proto) +static void +do_prototype(TERMINAL * termp) { unsigned i; char CC; + char proto; char *tmp; - /* - * Only use the character if the string is a single character, - * since it is fairly common for developers to set the C compiler - * name as an environment variable - using the same symbol. - */ - if ((tmp = getenv("CC")) != 0 && strlen(tmp) == 1) { - CC = *tmp; - for_each_string(i, &(termp->type)) { - for (tmp = termp->type.Strings[i]; *tmp; tmp++) { - if (*tmp == proto) - *tmp = CC; + if ((tmp = getenv("CC")) != 0) { + if ((CC = *tmp) != 0) { + proto = *command_character; + + for_each_string(i, &(termp->type)) { + for (tmp = termp->type.Strings[i]; *tmp; tmp++) { + if (*tmp == proto) + *tmp = CC; + } } } } @@ -546,64 +465,39 @@ _nc_unicode_locale(void) NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL * termp) { - const char *env_name = "NCURSES_NO_UTF8_ACS"; char *env; - int value; - int result = 0; - if ((env = getenv(env_name)) != 0) { - result = _nc_getenv_num(env_name); - } else if ((value = tigetnum("U8")) >= 0) { - result = value; /* use extension feature */ + if ((env = getenv("NCURSES_NO_UTF8_ACS")) != 0) { + return atoi(env); } else if ((env = getenv("TERM")) != 0) { - if (strstr(env, "linux")) { - result = 1; /* always broken */ - } else if (strstr(env, "screen") != 0 - && ((env = getenv("TERMCAP")) != 0 - && strstr(env, "screen") != 0) - && strstr(env, "hhII00") != 0) { + if (strstr(env, "linux")) + return 1; /* always broken */ + if (strstr(env, "screen") != 0 + && ((env = getenv("TERMCAP")) != 0 + && strstr(env, "screen") != 0) + && strstr(env, "hhII00") != 0) { if (CONTROL_N(enter_alt_charset_mode) || CONTROL_O(enter_alt_charset_mode) || CONTROL_N(set_attributes) || - CONTROL_O(set_attributes)) { - result = 1; - } + CONTROL_O(set_attributes)) + return 1; } } - return result; + return 0; } +/* + * This entrypoint is called from tgetent() to allow a special case of reusing + * the same TERMINAL data (see comment). + */ NCURSES_EXPORT(int) -TINFO_SETUP_TERM(TERMINAL ** tp, - NCURSES_CONST char *tname, - int Filedes, - int *errret, - bool reuse) +_nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) { -#ifdef USE_TERM_DRIVER - TERMINAL_CONTROL_BLOCK *TCB = 0; -#else - int status; -#endif TERMINAL *termp; - SCREEN *sp = 0; - int code = ERR; + int status; START_TRACE(); - -#ifdef USE_TERM_DRIVER - T((T_CALLED("_nc_setupterm_ex(%p,%s,%d,%p)"), - (void *) tp, _nc_visbuf(tname), Filedes, (void *) errret)); - - if (tp == 0) { - ret_error0(TGETENT_ERR, - "Invalid parameter, internal error.\n"); - } else - termp = *tp; -#else - termp = cur_term; - T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, (void *) errret)); -#endif + T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); if (tname == 0) { tname = getenv("TERM"); @@ -644,37 +538,22 @@ TINFO_SETUP_TERM(TERMINAL ** tp, * properly with this feature). */ if (reuse - && (termp != 0) + && (termp = cur_term) != 0 && termp->Filedes == Filedes && termp->_termname != 0 && !strcmp(termp->_termname, tname) && _nc_name_match(termp->type.term_names, tname, "|")) { T(("reusing existing terminal information and mode-settings")); - code = OK; } else { -#ifdef USE_TERM_DRIVER - termp = (TERMINAL *) typeCalloc(TERMINAL_CONTROL_BLOCK, 1); -#else + termp = typeCalloc(TERMINAL, 1); -#endif + if (termp == 0) { ret_error0(TGETENT_ERR, "Not enough memory to create terminal structure.\n"); } -#ifdef USE_TERM_DRIVER - INIT_TERM_DRIVER(); - TCB = (TERMINAL_CONTROL_BLOCK *) termp; - code = _nc_globals.term_driver(TCB, tname, errret); - if (code == OK) { - termp->Filedes = (short) Filedes; - termp->_termname = strdup(tname); - } else { - ret_error0(TGETENT_ERR, - "Could not find any driver to handle this terminal.\n"); - } -#else #if USE_DATABASE || USE_TERMCAP - status = _nc_setup_tinfo(tname, &termp->type); + status = grab_entry(tname, &termp->type); #else status = TGETENT_NO; #endif @@ -702,13 +581,13 @@ TINFO_SETUP_TERM(TERMINAL ** tp, ttytype[NAMESIZE - 1] = '\0'; #endif - termp->Filedes = (short) Filedes; + termp->Filedes = Filedes; termp->_termname = strdup(tname); set_curterm(termp); - if (command_character) - _nc_tinfo_cmdch(termp, *command_character); + if (command_character && getenv("CC")) + do_prototype(termp); /* * If an application calls setupterm() rather than initscr() or @@ -720,95 +599,25 @@ TINFO_SETUP_TERM(TERMINAL ** tp, def_prog_mode(); baudrate(); } - code = OK; -#endif } -#ifdef USE_TERM_DRIVER - *tp = termp; - NCURSES_SP_NAME(set_curterm) (sp, termp); - TCB->drv->init(TCB); -#else - sp = SP; -#endif - /* * We should always check the screensize, just in case. */ - TINFO_GET_SIZE(sp, termp, ptrLines(sp), ptrCols(sp)); + _nc_get_screensize(SP, ptrLines(), ptrCols()); if (errret) *errret = TGETENT_YES; -#ifndef USE_TERM_DRIVER if (generic_type) { ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); } if (hard_copy) { ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); } -#endif - returnCode(code); + returnCode(OK); } -#if NCURSES_SP_FUNCS -/* - * In case of handling multiple screens, we need to have a screen before - * initialization in setupscreen takes place. This is to extend the substitute - * for some of the stuff in _nc_prescreen, especially for slk and ripoff - * handling which should be done per screen. - */ -NCURSES_EXPORT(SCREEN *) -new_prescr(void) -{ - static SCREEN *sp; - - START_TRACE(); - T((T_CALLED("new_prescr()"))); - - if (sp == 0) { - sp = _nc_alloc_screen_sp(); - if (sp != 0) { - sp->rsp = sp->rippedoff; - sp->_filtered = _nc_prescreen.filter_mode; - sp->_use_env = _nc_prescreen.use_env; -#if NCURSES_NO_PADDING - sp->_no_padding = _nc_prescreen._no_padding; -#endif - sp->slk_format = 0; - sp->_slk = 0; - sp->_prescreen = TRUE; - SP_PRE_INIT(sp); -#if USE_REENTRANT - sp->_TABSIZE = _nc_prescreen._TABSIZE; - sp->_ESCDELAY = _nc_prescreen._ESCDELAY; -#endif - } - } - returnSP(sp); -} -#endif - -#ifdef USE_TERM_DRIVER -/* - * This entrypoint is called from tgetent() to allow a special case of reusing - * the same TERMINAL data (see comment). - */ -NCURSES_EXPORT(int) -_nc_setupterm(NCURSES_CONST char *tname, - int Filedes, - int *errret, - bool reuse) -{ - int res; - TERMINAL *termp; - res = TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse); - if (ERR != res) - NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN_PRE, termp); - return res; -} -#endif - /* * setupterm(termname, Filedes, errret) * diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index e9dae85bdd9..2d245ffbb61 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer * * * * some of the code in here was contributed by: * * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) * @@ -44,11 +43,9 @@ #include #include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +#include -MODULE_ID("$Id: lib_termcap.c,v 1.73 2010/12/25 19:27:12 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.63 2008/08/16 19:22:55 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -79,26 +76,16 @@ NCURSES_EXPORT_VAR(char *) BC = 0; ***************************************************************************/ NCURSES_EXPORT(int) -NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) +tgetent(char *bufp, const char *name) { - int rc = ERR; + int errcode; int n; bool found_cache = FALSE; -#ifdef USE_TERM_DRIVER - TERMINAL *termp = 0; -#endif START_TRACE(); T((T_CALLED("tgetent()"))); - TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name, - STDOUT_FILENO, &rc, TRUE); - -#ifdef USE_TERM_DRIVER - if (termp == 0 || - !((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo) - return (rc); -#endif + _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE); /* * In general we cannot tell if the fixed sgr0 is still used by the @@ -122,9 +109,9 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) /* * Also free the terminfo data that we loaded (much bigger leak). */ - if (LAST_TRM != 0 && LAST_TRM != TerminalOf(SP_PARM)) { + if (LAST_TRM != 0 && LAST_TRM != cur_term) { TERMINAL *trm = LAST_TRM; - NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM); + del_curterm(LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; @@ -144,7 +131,7 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) } CacheInx = best; } - LAST_TRM = TerminalOf(SP_PARM); + LAST_TRM = cur_term; LAST_SEQ = ++CacheSeq; PC = 0; @@ -152,7 +139,7 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ - if (rc == 1) { + if (errcode == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) @@ -166,7 +153,7 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; - if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) { + if ((FIX_SGR0 = _nc_trim_sgr0(&(cur_term->type))) != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); @@ -177,8 +164,8 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) LAST_BUF = bufp; LAST_USE = TRUE; - SetNoPadding(SP_PARM); - (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets ospeed as a side-effect */ + SetNoPadding(SP); + (void) baudrate(); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -187,28 +174,9 @@ NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) #endif*/ } - returnCode(rc); + returnCode(errcode); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -tgetent(char *bufp, const char *name) -{ - return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name); -} -#endif - -#if 0 -static bool -same_tcname(const char *a, const char *b) -{ - fprintf(stderr, "compare(%s,%s)\n", a, b); - return !strncmp(a, b, 2); -} -#else -#define same_tcname(a,b) !strncmp(a,b,2) -#endif - /*************************************************************************** * * tgetflag(str) @@ -218,48 +186,24 @@ same_tcname(const char *a, const char *b) * ***************************************************************************/ -NCURSES_EXPORT(int) -NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) -{ - int result = 0; /* Solaris returns zero for missing flag */ - int i, j; - - T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); - if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); - struct name_table_entry const *entry_ptr; - - entry_ptr = _nc_find_type_entry(id, BOOLEAN, TRUE); - if (entry_ptr != 0) { - j = entry_ptr->nte_index; - } -#if NCURSES_XNAMES - else { - j = -1; - for_each_ext_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolcodes); - if (same_tcname(id, capname)) { - j = i; - break; - } - } - } -#endif - if (j >= 0) { - /* note: setupterm forces invalid booleans to false */ - result = tp->Booleans[j]; - } - } - returnCode(result); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tgetflag(NCURSES_CONST char *id) { - return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id); + unsigned i; + + T((T_CALLED("tgetflag(%s)"), id)); + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolcodes); + if (!strncmp(id, capname, 2)) { + /* setupterm forces invalid booleans to false */ + returnCode(tp->Booleans[i]); + } + } + } + returnCode(0); /* Solaris does this */ } -#endif /*************************************************************************** * @@ -270,48 +214,25 @@ tgetflag(NCURSES_CONST char *id) * ***************************************************************************/ -NCURSES_EXPORT(int) -NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) -{ - int result = ABSENT_NUMERIC; - int i, j; - - T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); - if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); - struct name_table_entry const *entry_ptr; - - entry_ptr = _nc_find_type_entry(id, NUMBER, TRUE); - if (entry_ptr != 0) { - j = entry_ptr->nte_index; - } -#if NCURSES_XNAMES - else { - j = -1; - for_each_ext_number(i, tp) { - const char *capname = ExtNumname(tp, i, numcodes); - if (same_tcname(id, capname)) { - j = i; - break; - } - } - } -#endif - if (j >= 0) { - if (VALID_NUMERIC(tp->Numbers[j])) - result = tp->Numbers[j]; - } - } - returnCode(result); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tgetnum(NCURSES_CONST char *id) { - return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id); + unsigned i; + + T((T_CALLED("tgetnum(%s)"), id)); + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_number(i, tp) { + const char *capname = ExtNumname(tp, i, numcodes); + if (!strncmp(id, capname, 2)) { + if (!VALID_NUMERIC(tp->Numbers[i])) + returnCode(ABSENT_NUMERIC); + returnCode(tp->Numbers[i]); + } + } + } + returnCode(ABSENT_NUMERIC); } -#endif /*************************************************************************** * @@ -323,62 +244,40 @@ tgetnum(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(char *) -NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) +tgetstr(NCURSES_CONST char *id, char **area) { + unsigned i; char *result = NULL; - int i, j; - T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); - if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); - struct name_table_entry const *entry_ptr; - - entry_ptr = _nc_find_type_entry(id, STRING, TRUE); - if (entry_ptr != 0) { - j = entry_ptr->nte_index; - } -#if NCURSES_XNAMES - else { - j = -1; - for_each_ext_string(i, tp) { - const char *capname = ExtStrname(tp, i, strcodes); - if (same_tcname(id, capname)) { - j = i; - break; - } - } - } -#endif - if (j >= 0) { - result = tp->Strings[j]; - TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); - /* setupterm forces canceled strings to null */ - if (VALID_STRING(result)) { - if (result == exit_attribute_mode - && FIX_SGR0 != 0) { - result = FIX_SGR0; - TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); - } - if (area != 0 - && *area != 0) { - (void) strcpy(*area, result); - result = *area; - *area += strlen(*area) + 1; + T((T_CALLED("tgetstr(%s,%p)"), id, area)); + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_string(i, tp) { + const char *capname = ExtStrname(tp, i, strcodes); + if (!strncmp(id, capname, 2)) { + result = tp->Strings[i]; + TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); + /* setupterm forces canceled strings to null */ + if (VALID_STRING(result)) { + if (result == exit_attribute_mode + && FIX_SGR0 != 0) { + result = FIX_SGR0; + TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); + } + if (area != 0 + && *area != 0) { + (void) strcpy(*area, result); + result = *area; + *area += strlen(*area) + 1; + } } + break; } } } returnPtr(result); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(char *) -tgetstr(NCURSES_CONST char *id, char **area) -{ - return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area); -} -#endif - #if NO_LEAKS NCURSES_EXPORT(void) _nc_tgetent_leaks(void) diff --git a/ncurses/tinfo/lib_termname.c b/ncurses/tinfo/lib_termname.c index e3f6827ee01..713d0be8c36 100644 --- a/ncurses/tinfo/lib_termname.c +++ b/ncurses/tinfo/lib_termname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,31 +28,17 @@ #include -MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.8 2003/12/27 18:23:01 tom Exp $") -NCURSES_EXPORT(char *) -NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0) -{ - char *name = 0; - - T((T_CALLED("termname(%p)"), (void *) SP_PARM)); - -#if NCURSES_SP_FUNCS - if (TerminalOf(SP_PARM) != 0) { - name = TerminalOf(SP_PARM)->_termname; - } -#else - if (cur_term != 0) - name = cur_term->_termname; -#endif - - returnPtr(name); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(char *) termname(void) { - return NCURSES_SP_NAME(termname) (CURRENT_SCREEN); + char *name = 0; + + T((T_CALLED("termname()"))); + + if (cur_term != 0) + name = cur_term->_termname; + + returnPtr(name); } -#endif diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index e41234210c8..df460f953ea 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,159 +29,75 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * ****************************************************************************/ #include +#include #include -MODULE_ID("$Id: lib_ti.c,v 1.29 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.23 2003/05/24 21:10:28 tom Exp $") -#if 0 -static bool -same_name(const char *a, const char *b) -{ - fprintf(stderr, "compare(%s,%s)\n", a, b); - return !strcmp(a, b); -} -#else -#define same_name(a,b) !strcmp(a,b) -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str) -{ - int result = ABSENT_BOOLEAN; - int i, j; - - T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str)); - - if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); - struct name_table_entry const *entry_ptr; - - entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE); - if (entry_ptr != 0) { - j = entry_ptr->nte_index; - } -#if NCURSES_XNAMES - else { - j = -1; - for_each_ext_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolnames); - if (same_name(str, capname)) { - j = i; - break; - } - } - } -#endif - if (j >= 0) { - /* note: setupterm forces invalid booleans to false */ - result = tp->Booleans[j]; - } - } - - returnCode(result); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetflag(NCURSES_CONST char *str) { - return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str); -} -#endif + unsigned i; -NCURSES_EXPORT(int) -NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str) -{ - int i, j; - int result = CANCELLED_NUMERIC; /* Solaris returns a -1 on error */ + T((T_CALLED("tigetflag(%s)"), str)); - T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str)); - - if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); - struct name_table_entry const *entry_ptr; - - entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE); - if (entry_ptr != 0) { - j = entry_ptr->nte_index; - } -#if NCURSES_XNAMES - else { - j = -1; - for_each_ext_number(i, tp) { - const char *capname = ExtNumname(tp, i, numnames); - if (same_name(str, capname)) { - j = i; - break; - } + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolnames); + if (!strcmp(str, capname)) { + /* setupterm forces invalid booleans to false */ + returnCode(tp->Booleans[i]); } } -#endif - if (j >= 0) { - if (VALID_NUMERIC(tp->Numbers[j])) - result = tp->Numbers[j]; - else - result = ABSENT_NUMERIC; - } } - returnCode(result); + returnCode(ABSENT_BOOLEAN); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetnum(NCURSES_CONST char *str) { - return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str); -} -#endif + unsigned i; -NCURSES_EXPORT(char *) -NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str) -{ - char *result = CANCELLED_STRING; - int i, j; + T((T_CALLED("tigetnum(%s)"), str)); - T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str)); - - if (HasTInfoTerminal(SP_PARM)) { - TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); - struct name_table_entry const *entry_ptr; - - entry_ptr = _nc_find_type_entry(str, STRING, FALSE); - if (entry_ptr != 0) { - j = entry_ptr->nte_index; - } -#if NCURSES_XNAMES - else { - j = -1; - for_each_ext_string(i, tp) { - const char *capname = ExtStrname(tp, i, strnames); - if (same_name(str, capname)) { - j = i; - break; - } + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_number(i, tp) { + const char *capname = ExtNumname(tp, i, numnames); + if (!strcmp(str, capname)) { + if (!VALID_NUMERIC(tp->Numbers[i])) + returnCode(ABSENT_NUMERIC); + returnCode(tp->Numbers[i]); } } -#endif - if (j >= 0) { - /* note: setupterm forces cancelled strings to null */ - result = tp->Strings[j]; - } } - returnPtr(result); + returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(char *) tigetstr(NCURSES_CONST char *str) { - return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str); + unsigned i; + + T((T_CALLED("tigetstr(%s)"), str)); + + if (cur_term != 0) { + TERMTYPE *tp = &(cur_term->type); + for_each_string(i, tp) { + const char *capname = ExtStrname(tp, i, strnames); + if (!strcmp(str, capname)) { + /* setupterm forces cancelled strings to null */ + returnPtr(tp->Strings[i]); + } + } + } + + returnPtr(CANCELLED_STRING); } -#endif diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index 7cd12f7f684..ba2a8404030 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -40,9 +40,10 @@ #include #include +#include #include -MODULE_ID("$Id: lib_tparm.c,v 1.82 2011/01/15 22:19:12 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.76 2008/08/16 19:22:55 tom Exp $") /* * char * @@ -139,7 +140,7 @@ save_text(const char *fmt, const char *s, int len) { size_t s_len = strlen(s); if (len > (int) s_len) - s_len = (size_t) len; + s_len = len; get_space(s_len + 1); @@ -450,13 +451,12 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) } static NCURSES_INLINE char * -tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) +tparam_internal(const char *string, va_list ap) { char *p_is_s[NUM_PARM]; TPARM_ARG param[NUM_PARM]; - int popcount = 0; + int popcount; int number; - int num_args; int len; int level; int x, y; @@ -479,13 +479,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (TPS(fmt_buff) == 0) return NULL; - if (number > NUM_PARM) - number = NUM_PARM; - if (popcount > NUM_PARM) - popcount = NUM_PARM; - num_args = max(popcount, number); - - for (i = 0; i < num_args; i++) { + for (i = 0; i < max(popcount, number); i++) { /* * A few caps (such as plab_norm) have string-valued parms. * We'll have to assume that the caller knows the difference, since @@ -495,11 +489,8 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) */ if (p_is_s[i] != 0) { p_is_s[i] = va_arg(ap, char *); - param[i] = 0; - } else if (use_TPARM_ARG) { - param[i] = va_arg(ap, TPARM_ARG); } else { - param[i] = (TPARM_ARG) va_arg(ap, int); + param[i] = va_arg(ap, TPARM_ARG); } } @@ -517,7 +508,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush((int) param[i]); + npush(param[i]); } } #ifdef TRACE @@ -526,7 +517,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (p_is_s[i] != 0) save_text(", %s", _nc_visbuf(p_is_s[i]), 0); else - save_number(", %d", (int) param[i], 0); + save_number(", %d", param[i], 0); } _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff)); TPS(out_used) = 0; @@ -573,7 +564,7 @@ tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush((int) param[i]); + npush(param[i]); } break; @@ -781,7 +772,7 @@ tparm_varargs(NCURSES_CONST char *string,...) #ifdef TRACE TPS(tname) = "tparm"; #endif /* TRACE */ - result = tparam_internal(TRUE, string, ap); + result = tparam_internal(string, ap); va_end(ap); return result; } @@ -802,19 +793,3 @@ tparm_proto(NCURSES_CONST char *string, return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9); } #endif /* NCURSES_TPARM_VARARGS */ - -NCURSES_EXPORT(char *) -tiparm(const char *string,...) -{ - va_list ap; - char *result; - - _nc_tparm_err = 0; - va_start(ap, string); -#ifdef TRACE - TPS(tname) = "tiparm"; -#endif /* TRACE */ - result = tparam_internal(FALSE, string, ap); - va_end(ap); - return result; -} diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index dc70f3e0b0b..a8b7276895a 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -42,16 +41,12 @@ */ #include - -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - #include +#include /* padding_baud_rate, xon_xoff */ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.66 2008/06/28 13:12:15 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -74,136 +69,63 @@ _nc_set_no_padding(SCREEN *sp) } #endif -#if NCURSES_SP_FUNCS -#define SetOutCh(func) if (SP_PARM) SP_PARM->_outch = func; else _nc_prescreen._outch = func -#define GetOutCh() (SP_PARM ? SP_PARM->_outch : _nc_prescreen._outch) -#else -#define SetOutCh(func) static_outch = func -#define GetOutCh() static_outch -static NCURSES_SP_OUTC static_outch = NCURSES_SP_NAME(_nc_outch); -#endif +static int (*my_outch) (int c) = _nc_outch; NCURSES_EXPORT(int) -NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) +delay_output(int ms) { - T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms)); - - if (!HasTInfoTerminal(SP_PARM)) - returnCode(ERR); + T((T_CALLED("delay_output(%d)"), ms)); if (no_pad_char) { - NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + _nc_flush(); napms(ms); } else { - NCURSES_SP_OUTC my_outch = GetOutCh(); register int nullcount; nullcount = (ms * _nc_baudrate(ospeed)) / (BAUDBYTE * 1000); for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--) - my_outch(NCURSES_SP_ARGx PC); - if (my_outch == NCURSES_SP_NAME(_nc_outch)) - NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + my_outch(PC); + if (my_outch == _nc_outch) + _nc_flush(); } returnCode(OK); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -delay_output(int ms) -{ - return NCURSES_SP_NAME(delay_output) (CURRENT_SCREEN, ms); -} -#endif - -NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) -{ - (void) fflush(NC_OUTPUT(SP_PARM)); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_flush(void) { - NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN); + (void) fflush(NC_OUTPUT); } -#endif NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) +_nc_outch(int ch) { - int rc = OK; - COUNT_OUTCHARS(1); - if (HasTInfoTerminal(SP_PARM) - && SP_PARM != 0 - && SP_PARM->_cleanup) { - char tmp = (char) ch; + if (SP != 0 + && SP->_cleanup) { + char tmp = ch; /* * POSIX says write() is safe in a signal handler, but the * buffered I/O is not. */ - if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1) - rc = ERR; + write(fileno(NC_OUTPUT), &tmp, 1); } else { - if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF) - rc = ERR; + putc(ch, NC_OUTPUT); } - return rc; + return OK; } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -_nc_outch(int ch) -{ - return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string) -{ - return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - string, 1, NCURSES_SP_NAME(_nc_outch)); -} - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx - const char *name GCC_UNUSED, - const char *string) -{ - int rc = ERR; - - if (string != 0) { - TPUTS_TRACE(name); - rc = NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx string); - } - return rc; -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) putp(const char *string) { - return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string); + return tputs(string, 1, _nc_outch); } NCURSES_EXPORT(int) -_nc_putp(const char *name, const char *string) +tputs(const char *string, int affcnt, int (*outc) (int)) { - return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, string); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx - const char *string, - int affcnt, - NCURSES_SP_OUTC outc) -{ - NCURSES_SP_OUTC my_outch = GetOutCh(); bool always_delay; bool normal_delay; int number; @@ -215,7 +137,7 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx char addrbuf[32]; if (USE_TRACEF(TRACE_TPUTS)) { - if (outc == NCURSES_SP_NAME(_nc_outch)) + if (outc == _nc_outch) (void) strcpy(addrbuf, "_nc_outch"); else (void) sprintf(addrbuf, "%p", outc); @@ -230,19 +152,10 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx } #endif /* TRACE */ - if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM)) - return ERR; - if (!VALID_STRING(string)) return ERR; - if ( -#if NCURSES_SP_FUNCS - (SP_PARM != 0 && SP_PARM->_term == 0) -#else - cur_term == 0 -#endif - ) { + if (cur_term == 0) { always_delay = FALSE; normal_delay = TRUE; } else { @@ -251,7 +164,7 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx !xon_xoff && padding_baud_rate #if NCURSES_NO_PADDING - && !GetNoPadding(SP_PARM) + && !GetNoPadding(SP) #endif && (_nc_baudrate(ospeed) >= padding_baud_rate); } @@ -285,24 +198,24 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx } #endif /* BSD_TPUTS */ - SetOutCh(outc); /* redirect delay_output() */ + my_outch = outc; /* redirect delay_output() */ while (*string) { if (*string != '$') - (*outc) (NCURSES_SP_ARGx *string); + (*outc) (*string); else { string++; if (*string != '<') { - (*outc) (NCURSES_SP_ARGx '$'); + (*outc) ('$'); if (*string) - (*outc) (NCURSES_SP_ARGx *string); + (*outc) (*string); } else { bool mandatory; string++; if ((!isdigit(UChar(*string)) && *string != '.') || !strchr(string, '>')) { - (*outc) (NCURSES_SP_ARGx '$'); - (*outc) (NCURSES_SP_ARGx '<'); + (*outc) ('$'); + (*outc) ('<'); continue; } @@ -337,7 +250,7 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx && (always_delay || normal_delay || mandatory)) - NCURSES_SP_NAME(delay_output) (NCURSES_SP_ARGx number / 10); + delay_output(number / 10); } /* endelse (*string == '<') */ } /* endelse (*string == '$') */ @@ -357,25 +270,6 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx delay_output(trailpad / 10); #endif /* BSD_TPUTS */ - SetOutCh(my_outch); + my_outch = _nc_outch; return OK; } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -_nc_outc_wrapper(SCREEN *sp, int c) -{ - if (0 == sp) { - return (ERR); - } else { - return sp->jump(c); - } -} - -NCURSES_EXPORT(int) -tputs(const char *string, int affcnt, int (*outc) (int)) -{ - SetSafeOutcWrapper(outc); - return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx string, affcnt, _nc_outc_wrapper); -} -#endif diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index 663a0689809..a2b38a3327f 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -36,246 +36,159 @@ */ #include +#include /* cur_term */ -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - -MODULE_ID("$Id: lib_ttyflags.c,v 1.27 2010/12/25 23:43:58 tom Exp $") +MODULE_ID("$Id: lib_ttyflags.c,v 1.18 2008/08/03 22:10:44 tom Exp $") NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) +_nc_get_tty_mode(TTY * buf) { int result = OK; - if (buf == 0 || SP_PARM == 0) { + if (buf == 0) { result = ERR; } else { - TERMINAL *termp = TerminalOf(SP_PARM); - - if (0 == termp) { + if (cur_term == 0) { result = ERR; } else { -#ifdef USE_TERM_DRIVER - result = CallDriver_2(SP_PARM, sgmode, FALSE, buf); -#else for (;;) { - if (GET_TTY(termp->Filedes, buf) != 0) { + if (GET_TTY(cur_term->Filedes, buf) != 0) { if (errno == EINTR) continue; result = ERR; } break; } -#endif } if (result == ERR) memset(buf, 0, sizeof(*buf)); TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", - termp ? termp->Filedes : -1, + cur_term ? cur_term->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -_nc_get_tty_mode(TTY * buf) -{ - return NCURSES_SP_NAME(_nc_get_tty_mode) (CURRENT_SCREEN, buf); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) +_nc_set_tty_mode(TTY * buf) { int result = OK; - if (buf == 0 || SP_PARM == 0) { + if (buf == 0) { result = ERR; } else { - TERMINAL *termp = TerminalOf(SP_PARM); - - if (0 == termp) { + if (cur_term == 0) { result = ERR; } else { -#ifdef USE_TERM_DRIVER - result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); -#else for (;;) { - if (SET_TTY(termp->Filedes, buf) != 0) { + if (SET_TTY(cur_term->Filedes, buf) != 0) { if (errno == EINTR) continue; - if ((errno == ENOTTY) && (SP_PARM != 0)) - SP_PARM->_notty = TRUE; + if ((errno == ENOTTY) && (SP != 0)) + SP->_notty = TRUE; result = ERR; } break; } -#endif } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", - termp ? termp->Filedes : -1, + cur_term ? cur_term->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -_nc_set_tty_mode(TTY * buf) -{ - return NCURSES_SP_NAME(_nc_set_tty_mode) (CURRENT_SCREEN, buf); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) -{ - int rc = ERR; - TERMINAL *termp = TerminalOf(SP_PARM); - - T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM)); - - if (termp != 0) { -#ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, FALSE, TRUE); -#else - /* - * If XTABS was on, remove the tab and backtab capabilities. - */ - if (_nc_get_tty_mode(&termp->Ottyb) == OK) { -#ifdef TERMIOS - if (termp->Ottyb.c_oflag & OFLAGS_TABS) - tab = back_tab = NULL; -#else - if (termp->Ottyb.sg_flags & XTABS) - tab = back_tab = NULL; -#endif - rc = OK; - } -#endif - } - returnCode(rc); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) def_shell_mode(void) -{ - return NCURSES_SP_NAME(def_shell_mode) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) { int rc = ERR; - TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM)); + T((T_CALLED("def_shell_mode()"))); - if (termp != 0) { -#ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, TRUE, TRUE); -#else + if (cur_term != 0) { /* - * Turn off the XTABS bit in the tty structure if it was on. + * If XTABS was on, remove the tab and backtab capabilities. */ - if (_nc_get_tty_mode(&termp->Nttyb) == OK) { + if (_nc_get_tty_mode(&cur_term->Ottyb) == OK) { #ifdef TERMIOS - termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); + if (cur_term->Ottyb.c_oflag & OFLAGS_TABS) + tab = back_tab = NULL; #else - termp->Nttyb.sg_flags &= (unsigned) (~XTABS); + if (cur_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; #endif rc = OK; } -#endif } returnCode(rc); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) def_prog_mode(void) -{ - return NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) { int rc = ERR; - TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM)); + T((T_CALLED("def_prog_mode()"))); - if (termp != 0) { -#ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, TRUE, FALSE); + if (cur_term != 0) { + /* + * Turn off the XTABS bit in the tty structure if it was on. + */ + if (_nc_get_tty_mode(&cur_term->Nttyb) == OK) { +#ifdef TERMIOS + cur_term->Nttyb.c_oflag &= ~OFLAGS_TABS; #else - if (_nc_set_tty_mode(&termp->Nttyb) == OK) { - if (SP_PARM) { - if (SP_PARM->_keypad_on) - _nc_keypad(SP_PARM, TRUE); - NC_BUFFERED(SP_PARM, TRUE); - } + cur_term->Nttyb.sg_flags &= ~XTABS; +#endif rc = OK; } -#endif } returnCode(rc); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_prog_mode(void) { - return NCURSES_SP_NAME(reset_prog_mode) (CURRENT_SCREEN); -} -#endif + T((T_CALLED("reset_prog_mode()"))); -NCURSES_EXPORT(int) -NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) -{ - int rc = ERR; - TERMINAL *termp = TerminalOf(SP_PARM); - - T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM)); - - if (termp != 0) { -#ifdef USE_TERM_DRIVER - rc = CallDriver_2(SP_PARM, mode, FALSE, FALSE); -#else - if (SP_PARM) { - _nc_keypad(SP_PARM, FALSE); - _nc_flush(); - NC_BUFFERED(SP_PARM, FALSE); + if (cur_term != 0) { + if (_nc_set_tty_mode(&cur_term->Nttyb) == OK) { + if (SP) { + if (SP->_keypad_on) + _nc_keypad(SP, TRUE); + NC_BUFFERED(TRUE); + } + returnCode(OK); } - rc = _nc_set_tty_mode(&termp->Ottyb); -#endif } - returnCode(rc); + returnCode(ERR); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_shell_mode(void) { - return NCURSES_SP_NAME(reset_shell_mode) (CURRENT_SCREEN); + T((T_CALLED("reset_shell_mode()"))); + + if (cur_term != 0) { + if (SP) { + _nc_keypad(SP, FALSE); + _nc_flush(); + NC_BUFFERED(FALSE); + } + returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); + } + returnCode(ERR); } -#endif static TTY * -saved_tty(NCURSES_SP_DCL0) +saved_tty(void) { TTY *result = 0; - if (SP_PARM != 0) { - result = (TTY *) & (SP_PARM->_saved_tty); + if (SP != 0) { + result = &(SP->_saved_tty); } else { if (_nc_prescreen.saved_tty == 0) { _nc_prescreen.saved_tty = typeCalloc(TTY, 1); @@ -290,32 +203,18 @@ saved_tty(NCURSES_SP_DCL0) ** */ -NCURSES_EXPORT(int) -NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0) -{ - T((T_CALLED("savetty(%p)"), (void *) SP_PARM)); - returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) savetty(void) { - return NCURSES_SP_NAME(savetty) (CURRENT_SCREEN); -} -#endif + T((T_CALLED("savetty()"))); -NCURSES_EXPORT(int) -NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0) -{ - T((T_CALLED("resetty(%p)"), (void *) SP_PARM)); - returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); + returnCode(_nc_get_tty_mode(saved_tty())); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) resetty(void) { - return NCURSES_SP_NAME(resetty) (CURRENT_SCREEN); + T((T_CALLED("resetty()"))); + + returnCode(_nc_set_tty_mode(saved_tty())); } -#endif diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c deleted file mode 100644 index 15c281def50..00000000000 --- a/ncurses/tinfo/make_hash.c +++ /dev/null @@ -1,294 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - ****************************************************************************/ - -/* - * make_hash.c --- build-time program for constructing comp_captab.c - * - */ - -#include - -#include -#include - -#include - -MODULE_ID("$Id: make_hash.c,v 1.3 2010/05/22 18:02:50 tom Exp $") - -/* - * _nc_make_hash_table() - * - * Takes the entries in table[] and hashes them into hash_table[] - * by name. There are CAPTABSIZE entries in table[] and HASHTABSIZE - * slots in hash_table[]. - * - */ - -#undef MODULE_ID -#define MODULE_ID(id) /*nothing */ -#include - -/* - * int hash_function(string) - * - * Computes the hashing function on the given string. - * - * The current hash function is the sum of each consectutive pair - * of characters, taken as two-byte integers, mod HASHTABSIZE. - * - */ - -static int -hash_function(const char *string) -{ - long sum = 0; - - while (*string) { - sum += (long) (*string + (*(string + 1) << 8)); - string++; - } - - return (int) (sum % HASHTABSIZE); -} - -static void -_nc_make_hash_table(struct name_table_entry *table, - HashValue * hash_table) -{ - short i; - int hashvalue; - int collisions = 0; - - for (i = 0; i < HASHTABSIZE; i++) { - hash_table[i] = -1; - } - for (i = 0; i < CAPTABSIZE; i++) { - hashvalue = hash_function(table[i].nte_name); - - if (hash_table[hashvalue] >= 0) - collisions++; - - if (hash_table[hashvalue] != 0) - table[i].nte_link = hash_table[hashvalue]; - hash_table[hashvalue] = i; - } - - printf("/* %d collisions out of %d entries */\n", collisions, CAPTABSIZE); -} - -/* - * This filter reads from standard input a list of tab-delimited columns, - * (e.g., from Caps.filtered) computes the hash-value of a specified column and - * writes the hashed tables to standard output. - * - * By compiling the hash table at build time, we're able to make the entire - * set of terminfo and termcap tables readonly (and also provide some runtime - * performance enhancement). - */ - -#define MAX_COLUMNS BUFSIZ /* this _has_ to be worst-case */ - -static char ** -parse_columns(char *buffer) -{ - static char **list; - - int col = 0; - - if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) - return (0); - - if (*buffer != '#') { - while (*buffer != '\0') { - char *s; - for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++) - /*EMPTY */ ; - if (s != buffer) { - char mark = *s; - *s = '\0'; - if ((s - buffer) > 1 - && (*buffer == '"') - && (s[-1] == '"')) { /* strip the quotes */ - assert(s > buffer + 1); - s[-1] = '\0'; - buffer++; - } - list[col] = buffer; - col++; - if (mark == '\0') - break; - while (*++s && isspace(UChar(*s))) - /*EMPTY */ ; - buffer = s; - } else - break; - } - } - return col ? list : 0; -} - -int -main(int argc, char **argv) -{ - struct name_table_entry *name_table = typeCalloc(struct - name_table_entry, CAPTABSIZE); - HashValue *hash_table = typeCalloc(HashValue, HASHTABSIZE); - const char *root_name = ""; - int column = 0; - int bigstring = 0; - int n; - char buffer[BUFSIZ]; - - static const char *typenames[] = - {"BOOLEAN", "NUMBER", "STRING"}; - - short BoolCount = 0; - short NumCount = 0; - short StrCount = 0; - - /* The first argument is the column-number (starting with 0). - * The second is the root name of the tables to generate. - */ - if (argc <= 3 - || (column = atoi(argv[1])) <= 0 - || (column >= MAX_COLUMNS) - || *(root_name = argv[2]) == 0 - || (bigstring = atoi(argv[3])) < 0 - || name_table == 0 - || hash_table == 0) { - fprintf(stderr, "usage: make_hash column root_name bigstring\n"); - exit(EXIT_FAILURE); - } - - /* - * Read the table into our arrays. - */ - for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) { - char **list, *nlp = strchr(buffer, '\n'); - if (nlp) - *nlp = '\0'; - list = parse_columns(buffer); - if (list == 0) /* blank or comment */ - continue; - name_table[n].nte_link = -1; /* end-of-hash */ - name_table[n].nte_name = strdup(list[column]); - if (!strcmp(list[2], "bool")) { - name_table[n].nte_type = BOOLEAN; - name_table[n].nte_index = BoolCount++; - } else if (!strcmp(list[2], "num")) { - name_table[n].nte_type = NUMBER; - name_table[n].nte_index = NumCount++; - } else if (!strcmp(list[2], "str")) { - name_table[n].nte_type = STRING; - name_table[n].nte_index = StrCount++; - } else { - fprintf(stderr, "Unknown type: %s\n", list[2]); - exit(EXIT_FAILURE); - } - n++; - } - _nc_make_hash_table(name_table, hash_table); - - /* - * Write the compiled tables to standard output - */ - if (bigstring) { - int len = 0; - int nxt; - - printf("static const char %s_names_text[] = \\\n", root_name); - for (n = 0; n < CAPTABSIZE; n++) { - nxt = (int) strlen(name_table[n].nte_name) + 5; - if (nxt + len > 72) { - printf("\\\n"); - len = 0; - } - printf("\"%s\\0\" ", name_table[n].nte_name); - len += nxt; - } - printf(";\n\n"); - - len = 0; - printf("static name_table_data const %s_names_data[] =\n", - root_name); - printf("{\n"); - for (n = 0; n < CAPTABSIZE; n++) { - printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n", - len, - typenames[name_table[n].nte_type], - name_table[n].nte_index, - name_table[n].nte_link, - n < CAPTABSIZE - 1 ? ',' : ' '); - len += (int) strlen(name_table[n].nte_name) + 1; - } - printf("};\n\n"); - printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name); - } else { - - printf("static struct name_table_entry %s _nc_%s_table[] =\n", - bigstring ? "" : "const", - root_name); - printf("{\n"); - for (n = 0; n < CAPTABSIZE; n++) { - sprintf(buffer, "\"%s\"", - name_table[n].nte_name); - printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n", - buffer, - typenames[name_table[n].nte_type], - name_table[n].nte_index, - name_table[n].nte_link, - n < CAPTABSIZE - 1 ? ',' : ' '); - } - printf("};\n\n"); - } - - printf("static const HashValue _nc_%s_hash_table[%d] =\n", - root_name, - HASHTABSIZE + 1); - printf("{\n"); - for (n = 0; n < HASHTABSIZE; n++) { - printf("\t%3d,\n", hash_table[n]); - } - printf("\t0\t/* base-of-table */\n"); - printf("};\n\n"); - - printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n", - BoolCount, NumCount, StrCount); - printf("#error\t--> term.h and comp_captab.c disagree about the <--\n"); - printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); - printf("#endif\n\n"); - - free(hash_table); - return EXIT_SUCCESS; -} diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c index a7854e3fe60..c084f87fb94 100644 --- a/ncurses/tinfo/make_keys.c +++ b/ncurses/tinfo/make_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -37,18 +37,18 @@ */ #define USE_TERMLIB 1 -#include +#include -MODULE_ID("$Id: make_keys.c,v 1.19 2010/06/05 22:08:00 tom Exp $") +MODULE_ID("$Id: make_keys.c,v 1.14 2008/08/03 21:57:22 tom Exp $") #include -#define UNKNOWN (unsigned) (SIZEOF(strnames) + SIZEOF(strfnames)) +#define UNKNOWN (SIZEOF(strnames) + SIZEOF(strfnames)) -static unsigned +static size_t lookup(const char *name) { - unsigned n; + size_t n; bool found = FALSE; for (n = 0; strnames[n] != 0; n++) { if (!strcmp(name, strnames[n])) { @@ -73,7 +73,7 @@ make_keys(FILE *ifp, FILE *ofp) char buffer[BUFSIZ]; char from[256]; char to[256]; - unsigned maxlen = 16; + int maxlen = 16; int scanned; while (fgets(buffer, sizeof(buffer), ifp) != 0) { @@ -85,14 +85,14 @@ make_keys(FILE *ifp, FILE *ofp) scanned = sscanf(buffer, "%255s %255s", to, from); if (scanned == 2) { - unsigned code = lookup(from); + int code = lookup(from); if (code == UNKNOWN) continue; - if (strlen(from) > maxlen) - maxlen = (unsigned) strlen(from); - fprintf(ofp, "\t{ %4u, %-*.*s },\t/* %s */\n", + if ((int) strlen(from) > maxlen) + maxlen = strlen(from); + fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n", code, - (int) maxlen, (int) maxlen, + maxlen, maxlen, to, from); } diff --git a/ncurses/tinfo/name_match.c b/ncurses/tinfo/name_match.c index a9ac6427888..d576901fa2e 100644 --- a/ncurses/tinfo/name_match.c +++ b/ncurses/tinfo/name_match.c @@ -31,9 +31,10 @@ ****************************************************************************/ #include +#include #include -MODULE_ID("$Id: name_match.c,v 1.18 2008/11/16 00:19:59 juergen Exp $") +MODULE_ID("$Id: name_match.c,v 1.17 2008/08/03 19:49:33 tom Exp $") /* * _nc_first_name(char *names) diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c index ddbc25204fe..cf7a5f409d7 100644 --- a/ncurses/tinfo/parse_entry.c +++ b/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -46,8 +46,9 @@ #include #include +#include -MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.69 2008/08/16 21:52:03 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -83,13 +84,13 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) case NUMBER: first = tp->ext_Booleans; last = tp->ext_Numbers + first; - offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); + offset = tp->ext_Booleans + tp->ext_Numbers; tindex = tp->num_Numbers; break; case STRING: - first = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); + first = tp->ext_Booleans + tp->ext_Numbers; last = tp->ext_Strings + first; - offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings); + offset = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings; tindex = tp->num_Strings; break; case CANCEL: @@ -136,31 +137,27 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) break; } } - -#define for_each_value(max) \ - for (last = (unsigned) (max - 1); last > tindex; last--) - if (!found) { switch (token_type) { case BOOLEAN: - tp->ext_Booleans++; - tp->num_Booleans++; + tp->ext_Booleans += 1; + tp->num_Booleans += 1; tp->Booleans = typeRealloc(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans); - for_each_value(tp->num_Booleans) + for (last = tp->num_Booleans - 1; last > tindex; last--) tp->Booleans[last] = tp->Booleans[last - 1]; break; case NUMBER: - tp->ext_Numbers++; - tp->num_Numbers++; + tp->ext_Numbers += 1; + tp->num_Numbers += 1; tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers); - for_each_value(tp->num_Numbers) + for (last = tp->num_Numbers - 1; last > tindex; last--) tp->Numbers[last] = tp->Numbers[last - 1]; break; case STRING: - tp->ext_Strings++; - tp->num_Strings++; + tp->ext_Strings += 1; + tp->num_Strings += 1; tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings); - for_each_value(tp->num_Strings) + for (last = tp->num_Strings - 1; last > tindex; last--) tp->Strings[last] = tp->Strings[last - 1]; break; } @@ -173,7 +170,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) temp.nte_name = tp->ext_Names[offset]; temp.nte_type = token_type; - temp.nte_index = (short) tindex; + temp.nte_index = tindex; temp.nte_link = -1; return &temp; @@ -382,14 +379,16 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) && !strcmp("ma", _nc_curr_token.tk_name)) { /* tell max_attributes from arrow_key_map */ entry_ptr = _nc_find_type_entry("ma", NUMBER, - _nc_syntax != 0); + _nc_get_table(_nc_syntax + != 0)); assert(entry_ptr != 0); } else if (token_type == STRING && !strcmp("MT", _nc_curr_token.tk_name)) { /* map terminfo's string MT to MT */ entry_ptr = _nc_find_type_entry("MT", STRING, - _nc_syntax != 0); + _nc_get_table(_nc_syntax + != 0)); assert(entry_ptr != 0); } else if (token_type == BOOLEAN @@ -445,7 +444,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) case NUMBER: entryp->tterm.Numbers[entry_ptr->nte_index] = - (short) _nc_curr_token.tk_valnumber; + _nc_curr_token.tk_valnumber; break; case STRING: @@ -511,9 +510,9 @@ NCURSES_EXPORT(int) _nc_capcmp(const char *s, const char *t) /* compare two string capabilities, stripping out padding */ { - if (!VALID_STRING(s) && !VALID_STRING(t)) + if (!s && !t) return (0); - else if (!VALID_STRING(s) || !VALID_STRING(t)) + else if (!s || !t) return (1); for (;;) { @@ -668,7 +667,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) else if (PRESENT(backspace_if_not_bs)) cursor_left = backspace_if_not_bs; } - /* vi doesn't use "do", but it does seem to use nl (or '\n') instead */ + /* vi doesn't use "do", but it does seems to use nl (or '\n') instead */ if (WANTED(cursor_down)) { if (PRESENT(linefeed_if_not_lf)) cursor_down = linefeed_if_not_lf; @@ -773,7 +772,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) * isn't from mytinfo... */ if (PRESENT(other_non_function_keys)) { - char *base; + char *base = other_non_function_keys; char *bp, *cp, *dp; struct name_table_entry const *from_ptr; struct name_table_entry const *to_ptr; @@ -789,7 +788,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) for (base = other_non_function_keys; (cp = strchr(base, ',')) != 0; base = cp + 1) { - size_t len = (unsigned) (cp - base); + size_t len = cp - base; for (ap = ko_xlate; ap->from; ap++) { if (len == strlen(ap->from) @@ -841,7 +840,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) } else *dp++ = *bp; } - *dp = '\0'; + *dp++ = '\0'; tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2); } diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index e38b9cbe49d..b4ea61ca194 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -40,8 +40,9 @@ #include #include +#include -MODULE_ID("$Id: read_entry.c,v 1.108 2011/02/26 15:36:06 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.102 2008/08/03 19:33:04 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -56,7 +57,7 @@ convert_shorts(char *buf, short *Numbers, int count) else if (IS_NEG2(buf + 2 * i)) Numbers[i] = CANCELLED_NUMERIC; else - Numbers[i] = (short) LOW_MSB(buf + 2 * i); + Numbers[i] = LOW_MSB(buf + 2 * i); TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i])); } } @@ -98,9 +99,9 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) if (have > 0) { if ((int) want > have) - want = (unsigned) have; + want = have; memcpy(dst, src + *offset, want); - *offset += (int) want; + *offset += want; } else { want = 0; } @@ -154,7 +155,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) return (TGETENT_NO); } - want = (unsigned) (str_size + name_size + 1); + want = str_size + name_size + 1; if (str_size) { /* try to allocate space for the string table */ if (str_count * 2 >= (int) sizeof(buf) @@ -172,14 +173,14 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) want = min(MAX_NAME_SIZE, (unsigned) name_size); ptr->str_table = string_table; ptr->term_names = string_table; - if ((have = (unsigned) Read(ptr->term_names, want)) != want) { + if ((have = Read(ptr->term_names, want)) != want) { memset(ptr->term_names + have, 0, want - have); } ptr->term_names[want] = '\0'; string_table += (want + 1); if (have > MAX_NAME_SIZE) - offset = (int) (have - MAX_NAME_SIZE); + offset = (have - MAX_NAME_SIZE); /* grab the booleans */ if ((ptr->Booleans = TYPE_CALLOC(NCURSES_SBOOL, @@ -233,7 +234,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) int ext_str_count = LOW_MSB(buf + 4); int ext_str_size = LOW_MSB(buf + 6); int ext_str_limit = LOW_MSB(buf + 8); - unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count); + unsigned need = (ext_bool_count + ext_num_count + ext_str_count); int base = 0; if (need >= sizeof(buf) @@ -246,9 +247,9 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) || ext_str_limit < 0) return (TGETENT_NO); - ptr->num_Booleans = UShort(BOOLCOUNT + ext_bool_count); - ptr->num_Numbers = UShort(NUMCOUNT + ext_num_count); - ptr->num_Strings = UShort(STRCOUNT + ext_str_count); + ptr->num_Booleans = BOOLCOUNT + ext_bool_count; + ptr->num_Numbers = NUMCOUNT + ext_num_count; + ptr->num_Strings = STRCOUNT + ext_str_count; ptr->Booleans = typeRealloc(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans); ptr->Numbers = typeRealloc(short, ptr->num_Numbers, ptr->Numbers); @@ -260,7 +261,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-booleans @%d", ext_bool_count, offset)); - if ((ptr->ext_Booleans = UShort(ext_bool_count)) != 0) { + if ((ptr->ext_Booleans = ext_bool_count) != 0) { if (Read(ptr->Booleans + BOOLCOUNT, (unsigned) ext_bool_count) != ext_bool_count) return (TGETENT_NO); @@ -269,7 +270,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-numbers @%d", ext_num_count, offset)); - if ((ptr->ext_Numbers = UShort(ext_num_count)) != 0) { + if ((ptr->ext_Numbers = ext_num_count) != 0) { if (!read_shorts(buf, ext_num_count)) return (TGETENT_NO); TR(TRACE_DATABASE, ("Before converting extended-numbers")); @@ -278,22 +279,21 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset)); if ((ext_str_count || need) - && !read_shorts(buf, ext_str_count + (int) need)) + && !read_shorts(buf, ext_str_count + need)) return (TGETENT_NO); TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d", ext_str_limit, offset)); if (ext_str_limit) { - ptr->ext_str_table = typeMalloc(char, (size_t) ext_str_limit); - if (ptr->ext_str_table == 0) - return (TGETENT_NO); + if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0) + return (TGETENT_NO); if (Read(ptr->ext_str_table, (unsigned) ext_str_limit) != ext_str_limit) return (TGETENT_NO); TR(TRACE_DATABASE, ("first extended-string is %s", _nc_visbuf(ptr->ext_str_table))); } - if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) { + if ((ptr->ext_Strings = ext_str_count) != 0) { TR(TRACE_DATABASE, ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d", str_count, ext_str_count)); @@ -305,7 +305,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) _nc_visbuf(ptr->Strings[i + str_count]))); ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count]; if (VALID_STRING(ptr->Strings[i + STRCOUNT])) - base += (int) (strlen(ptr->Strings[i + STRCOUNT]) + 1); + base += (strlen(ptr->Strings[i + STRCOUNT]) + 1); TR(TRACE_DATABASE, ("... to [%d] %s", i + STRCOUNT, _nc_visbuf(ptr->Strings[i + STRCOUNT]))); @@ -314,7 +314,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) if (need) { if (ext_str_count >= (MAX_ENTRY_SIZE * 2)) - return (TGETENT_NO); + return (TGETENT_NO); if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0) return (TGETENT_NO); TR(TRACE_DATABASE, @@ -364,18 +364,16 @@ NCURSES_EXPORT(int) _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) /* return 1 if read, 0 if not found or garbled */ { - FILE *fp = 0; - int code; + int code, fd = -1; int limit; char buffer[MAX_ENTRY_SIZE + 1]; if (_nc_access(filename, R_OK) < 0 - || (fp = fopen(filename, "rb")) == 0) { + || (fd = open(filename, O_RDONLY | O_BINARY)) < 0) { T(("cannot open terminfo %s (errno=%d)", filename, errno)); code = TGETENT_NO; } else { - if ((limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp)) - > 0) { + if ((limit = read(fd, buffer, sizeof(buffer))) > 0) { T(("read terminfo %s", filename)); if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) { @@ -384,7 +382,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) } else { code = TGETENT_NO; } - fclose(fp); + close(fd); } return (code); @@ -406,22 +404,26 @@ _nc_read_tic_entry(char *filename, /* * If we are looking in a directory, assume the entry is a file under that, * according to the normal rules. + * + * FIXME - add caseless-filename fixup. */ - unsigned need = (unsigned) (LEAF_LEN + 3 + strlen(path) + strlen(name)); - if (need <= limit) - (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); + if (_nc_is_dir_path(path)) { + unsigned need = 4 + strlen(path) + strlen(name); - if (_nc_is_dir_path(path)) - result = _nc_read_file_entry(filename, tp); + if (need <= limit) { + (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); + result = _nc_read_file_entry(filename, tp); + } + } #if USE_HASHED_DB else { static const char suffix[] = DBM_SUFFIX; DB *capdbp; unsigned lens = sizeof(suffix) - 1; unsigned size = strlen(path); - unsigned test = lens + size; + unsigned need = lens + size; - if (test < limit) { + if (need <= limit) { if (size >= lens && !strcmp(path + size - lens, suffix)) (void) strcpy(filename, path); @@ -513,7 +515,6 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) { int code = TGETENT_NO; - sprintf(filename, "%.*s", PATH_MAX - 1, name); if (strlen(name) == 0 || strcmp(name, ".") == 0 || strcmp(name, "..") == 0 diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index b39a5bebaa4..d94d1a42466 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -56,8 +56,9 @@ #include #include #include +#include -MODULE_ID("$Id: read_termcap.c,v 1.74 2010/01/23 17:57:43 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.71 2006/07/29 12:06:51 tom Exp $") #if !PURE_TERMINFO @@ -78,15 +79,6 @@ get_termpath(void) return result; } -/* - * Note: - * getcap(), cgetent(), etc., are BSD functions. A copy of those was added to - * this file in November 1995, derived from the BSD4.4 Lite sources. - * - * The initial adaptation uses 518 lines from that source. - * The current source (in 2009) uses 183 lines of BSD4.4 Lite (441 ignoring - * whitespace). - */ #if USE_GETCAP #if HAVE_BSD_CGETENT @@ -115,7 +107,11 @@ static int _nc_nfcmp(const char *, char *); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgment: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/ncurses/tinfo/setbuf.c b/ncurses/tinfo/setbuf.c index a2e2660c866..ba910e8983a 100644 --- a/ncurses/tinfo/setbuf.c +++ b/ncurses/tinfo/setbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,8 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2008 * ****************************************************************************/ /* @@ -42,7 +40,7 @@ #include -MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") +MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -100,20 +98,11 @@ MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") * buffer. So we disable this by default (there may yet be a workaround). */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) +_nc_set_buffer(FILE *ofp, bool buffered) { - int Cols; - int Lines; - - if (0 == SP_PARM) - return; - - Cols = *(ptrCols(SP_PARM)); - Lines = *(ptrLines(SP_PARM)); - /* optional optimization hack -- do before any output to ofp */ #if HAVE_SETVBUF || HAVE_SETBUFFER - if (SP_PARM->_buffered != buffered) { + if (SP->_buffered != buffered) { unsigned buf_len; char *buf_ptr; @@ -125,11 +114,11 @@ NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) setmode(ofp, O_BINARY); #endif if (buffered != 0) { - buf_len = (unsigned) min(Lines * (Cols + 6), 2800); - if ((buf_ptr = SP_PARM->_setbuf) == 0) { + buf_len = min(LINES * (COLS + 6), 2800); + if ((buf_ptr = SP->_setbuf) == 0) { if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) return; - SP_PARM->_setbuf = buf_ptr; + SP->_setbuf = buf_ptr; /* Don't try to free this! */ } #if !USE_SETBUF_0 @@ -155,15 +144,7 @@ NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) (void) setbuffer(ofp, buf_ptr, (int) buf_len); #endif - SP_PARM->_buffered = buffered; + SP->_buffered = buffered; } #endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_set_buffer(FILE *ofp, bool buffered) -{ - NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered); -} -#endif diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c deleted file mode 100644 index 5b3b55a4519..00000000000 --- a/ncurses/tinfo/tinfo_driver.c +++ /dev/null @@ -1,1337 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2008-2009,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"), 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: Juergen Pfeifer * - * * - ****************************************************************************/ - -#include -#define CUR ((TERMINAL*)TCB)->type. -#include - -#if HAVE_NANOSLEEP -#include -#if HAVE_SYS_TIME_H -#include /* needed for MacOS X DP3 */ -#endif -#endif - -#if HAVE_SIZECHANGE -# if !defined(sun) || !TERMIOS -# if HAVE_SYS_IOCTL_H -# include -# endif -# endif -#endif - -MODULE_ID("$Id: tinfo_driver.c,v 1.13 2010/12/20 01:47:09 tom Exp $") - -/* - * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, - * Solaris, IRIX) define TIOCGWINSZ and struct winsize. - */ -#ifdef TIOCGSIZE -# define IOCTL_WINSIZE TIOCGSIZE -# define STRUCT_WINSIZE struct ttysize -# define WINSIZE_ROWS(n) (int)n.ts_lines -# define WINSIZE_COLS(n) (int)n.ts_cols -#else -# ifdef TIOCGWINSZ -# define IOCTL_WINSIZE TIOCGWINSZ -# define STRUCT_WINSIZE struct winsize -# define WINSIZE_ROWS(n) (int)n.ws_row -# define WINSIZE_COLS(n) (int)n.ws_col -# endif -#endif - -/* - * These should be screen structure members. They need to be globals for - * historical reasons. So we assign them in start_color() and also in - * set_term()'s screen-switching logic. - */ -#if USE_REENTRANT -NCURSES_EXPORT(int) -NCURSES_PUBLIC_VAR(COLOR_PAIRS) (void) -{ - return CURRENT_SCREEN ? CURRENT_SCREEN->_pair_count : -1; -} -NCURSES_EXPORT(int) -NCURSES_PUBLIC_VAR(COLORS) (void) -{ - return CURRENT_SCREEN ? CURRENT_SCREEN->_color_count : -1; -} -#else -NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; -NCURSES_EXPORT_VAR(int) COLORS = 0; -#endif - -#define TCBMAGIC NCDRV_MAGIC(NCDRV_TINFO) -#define AssertTCB() assert(TCB!=0 && TCB->magic==TCBMAGIC) -#define SetSP() assert(TCB->csp!=0); sp = TCB->csp - -/* - * This routine needs to do all the work to make curscr look - * like newscr. - */ -static int -drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) -{ - AssertTCB(); - return TINFO_DOUPDATE(TCB->csp); -} - -#define ret_error(code, fmt, arg) if (errret) {\ - *errret = code;\ - return(FALSE); \ - } else {\ - fprintf(stderr, fmt, arg);\ - exit(EXIT_FAILURE);\ - } - -#define ret_error0(code, msg) if (errret) {\ - *errret = code;\ - return(FALSE);\ - } else {\ - fprintf(stderr, msg);\ - exit(EXIT_FAILURE);\ - } - -static bool -drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) -{ - bool result = FALSE; - int status; - TERMINAL *termp; - SCREEN *sp; - - assert(TCB != 0 && tname != 0); - termp = (TERMINAL *) TCB; - sp = TCB->csp; - TCB->magic = TCBMAGIC; - -#if (USE_DATABASE || USE_TERMCAP) - status = _nc_setup_tinfo(tname, &termp->type); -#else - status = TGETENT_NO; -#endif - - /* try fallback list if entry on disk */ - if (status != TGETENT_YES) { - const TERMTYPE *fallback = _nc_fallback(tname); - - if (fallback) { - termp->type = *fallback; - status = TGETENT_YES; - } - } - - if (status != TGETENT_YES) { - NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp); - if (status == TGETENT_ERR) { - ret_error0(status, "terminals database is inaccessible\n"); - } else if (status == TGETENT_NO) { - ret_error(status, "'%s': unknown terminal type.\n", tname); - } - } - result = TRUE; -#if !USE_REENTRANT - strncpy(ttytype, termp->type.term_names, NAMESIZE - 1); - ttytype[NAMESIZE - 1] = '\0'; -#endif - - if (command_character) - _nc_tinfo_cmdch(termp, *command_character); - - if (generic_type) { - ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); - } - if (hard_copy) { - ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); - } - - return result; -} - -static int -drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bool beepFlag) -{ - SCREEN *sp; - int res = ERR; - - AssertTCB(); - SetSP(); - - /* FIXME: should make sure that we are not in altchar mode */ - if (beepFlag) { - if (bell) { - res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); - NCURSES_SP_NAME(_nc_flush) (sp); - } else if (flash_screen) { - res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "flash_screen", - flash_screen); - NCURSES_SP_NAME(_nc_flush) (sp); - } - } else { - if (flash_screen) { - res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "flash_screen", - flash_screen); - NCURSES_SP_NAME(_nc_flush) (sp); - } else if (bell) { - res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); - NCURSES_SP_NAME(_nc_flush) (sp); - } - } - return res; -} - -/* - * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly - * to maintain compatibility with a pre-ANSI scheme. The same scheme is - * also used in the FreeBSD syscons. - */ -static int -toggled_colors(int c) -{ - if (c < 16) { - static const int table[] = - {0, 4, 2, 6, 1, 5, 3, 7, - 8, 12, 10, 14, 9, 13, 11, 15}; - c = table[c]; - } - return c; -} - -static int -drv_print(TERMINAL_CONTROL_BLOCK * TCB, char *data, int len) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); -#if NCURSES_EXT_FUNCS - return NCURSES_SP_NAME(mcprint) (TCB->csp, data, len); -#else - return ERR; -#endif -} - -static int -drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, int fg, int bg) -{ - SCREEN *sp; - int code = ERR; - - AssertTCB(); - SetSP(); - - if (sp != 0 && orig_pair && orig_colors && (initialize_pair != 0)) { -#if NCURSES_EXT_FUNCS - sp->_default_color = isDefaultColor(fg) || isDefaultColor(bg); - sp->_has_sgr_39_49 = (NCURSES_SP_NAME(tigetflag) (NCURSES_SP_ARGx - "AX") - == TRUE); - sp->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK); - sp->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK); - if (sp->_color_pairs != 0) { - bool save = sp->_default_color; - sp->_default_color = TRUE; - NCURSES_SP_NAME(init_pair) (NCURSES_SP_ARGx - 0, - (short)fg, - (short)bg); - sp->_default_color = save; - } -#endif - code = OK; - } - return (code); -} - -static void -drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, - bool fore, - int color, - NCURSES_SP_OUTC outc) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - if (fore) { - if (set_a_foreground) { - TPUTS_TRACE("set_a_foreground"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_a_foreground, color), 1, outc); - } else { - TPUTS_TRACE("set_foreground"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_foreground, - toggled_colors(color)), 1, outc); - } - } else { - if (set_a_background) { - TPUTS_TRACE("set_a_background"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_a_background, color), 1, outc); - } else { - TPUTS_TRACE("set_background"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_background, - toggled_colors(color)), 1, outc); - } - } -} - -static bool -drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) -{ - bool result = FALSE; - SCREEN *sp; - - AssertTCB(); - SetSP(); - - if (orig_pair != 0) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair); - result = TRUE; - } - return result; -} - -static bool -drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) -{ - int result = FALSE; - SCREEN *sp; - - AssertTCB(); - SetSP(); - - if (orig_colors != 0) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors); - result = TRUE; - } - return result; -} - -static int -drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) -{ - SCREEN *sp; - bool useEnv = TRUE; - - AssertTCB(); - sp = TCB->csp; /* can be null here */ - - if (sp) { - useEnv = sp->_use_env; - } else - useEnv = _nc_prescreen.use_env; - - /* figure out the size of the screen */ - T(("screen size: terminfo lines = %d columns = %d", lines, columns)); - - *linep = (int) lines; - *colp = (int) columns; - - if (useEnv) { - int value; - -#ifdef __EMX__ - { - int screendata[2]; - _scrsize(screendata); - *colp = screendata[0]; - *linep = screendata[1]; - T(("EMX screen size: environment LINES = %d COLUMNS = %d", - *linep, *colp)); - } -#endif -#if HAVE_SIZECHANGE - /* try asking the OS */ - { - TERMINAL *termp = (TERMINAL *) TCB; - if (isatty(termp->Filedes)) { - STRUCT_WINSIZE size; - - errno = 0; - do { - if (ioctl(termp->Filedes, IOCTL_WINSIZE, &size) >= 0) { - *linep = ((sp != 0 && sp->_filtered) - ? 1 - : WINSIZE_ROWS(size)); - *colp = WINSIZE_COLS(size); - T(("SYS screen size: environment LINES = %d COLUMNS = %d", - *linep, *colp)); - break; - } - } while - (errno == EINTR); - } - } -#endif /* HAVE_SIZECHANGE */ - - /* - * Finally, look for environment variables. - * - * Solaris lets users override either dimension with an environment - * variable. - */ - if ((value = _nc_getenv_num("LINES")) > 0) { - *linep = value; - T(("screen size: environment LINES = %d", *linep)); - } - if ((value = _nc_getenv_num("COLUMNS")) > 0) { - *colp = value; - T(("screen size: environment COLUMNS = %d", *colp)); - } - - /* if we can't get dynamic info about the size, use static */ - if (*linep <= 0) { - *linep = (int) lines; - } - if (*colp <= 0) { - *colp = (int) columns; - } - - /* the ultimate fallback, assume fixed 24x80 size */ - if (*linep <= 0) { - *linep = 24; - } - if (*colp <= 0) { - *colp = 80; - } - - /* - * Put the derived values back in the screen-size caps, so - * tigetnum() and tgetnum() will do the right thing. - */ - lines = (short) (*linep); - columns = (short) (*colp); - } - - T(("screen size is %dx%d", *linep, *colp)); - return OK; -} - -static int -drv_getsize(TERMINAL_CONTROL_BLOCK * TCB, int *l, int *c) -{ - AssertTCB(); - assert(l != 0 && c != 0); - *l = lines; - *c = columns; - return OK; -} - -static int -drv_setsize(TERMINAL_CONTROL_BLOCK * TCB, int l, int c) -{ - AssertTCB(); - lines = (short) l; - columns = (short) c; - return OK; -} - -static int -drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) -{ - SCREEN *sp = TCB->csp; - TERMINAL *_term = (TERMINAL *) TCB; - int result = OK; - - AssertTCB(); - if (setFlag) { - for (;;) { - if (SET_TTY(_term->Filedes, buf) != 0) { - if (errno == EINTR) - continue; - if (errno == ENOTTY) { - if (sp) - sp->_notty = TRUE; - } - result = ERR; - } - break; - } - } else { - for (;;) { - if (GET_TTY(_term->Filedes, buf) != 0) { - if (errno == EINTR) - continue; - result = ERR; - } - break; - } - } - return result; -} - -static int -drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) -{ - SCREEN *sp; - TERMINAL *_term = (TERMINAL *) TCB; - int code = ERR; - - AssertTCB(); - sp = TCB->csp; - - if (progFlag) /* prog mode */ - { - if (defFlag) { - /* def_prog_mode */ - /* - * Turn off the XTABS bit in the tty structure if it was on. - */ - if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { -#ifdef TERMIOS - _term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS; -#else - _term->Nttyb.sg_flags &= (unsigned) ~XTABS; -#endif - code = OK; - } - } else { - /* reset_prog_mode */ - if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { - if (sp) { - if (sp->_keypad_on) - _nc_keypad(sp, TRUE); - NC_BUFFERED(sp, TRUE); - } - code = OK; - } - } - } else { /* shell mode */ - if (defFlag) { - /* def_shell_mode */ - /* - * If XTABS was on, remove the tab and backtab capabilities. - */ - if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { -#ifdef TERMIOS - if (_term->Ottyb.c_oflag & OFLAGS_TABS) - tab = back_tab = NULL; -#else - if (_term->Ottyb.sg_flags & XTABS) - tab = back_tab = NULL; -#endif - code = OK; - } - } else { - /* reset_shell_mode */ - if (sp) { - _nc_keypad(sp, FALSE); - NCURSES_SP_NAME(_nc_flush) (sp); - NC_BUFFERED(sp, FALSE); - } - code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); - } - } - return (code); -} - -static void -drv_wrap(SCREEN *sp) -{ - if (sp) { - sp->_mouse_wrap(sp); - NCURSES_SP_NAME(_nc_screen_wrap) (sp); - NCURSES_SP_NAME(_nc_mvcur_wrap) (sp); /* wrap up cursor addressing */ - } -} - -static void -drv_release(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) -{ -} - -# define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) - -static void -drv_screen_init(SCREEN *sp) -{ - TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp); - - AssertTCB(); - - /* - * Check for mismatched graphic-rendition capabilities. Most SVr4 - * terminfo trees contain entries that have rmul or rmso equated to - * sgr0 (Solaris curses copes with those entries). We do this only - * for curses, since many termcap applications assume that - * smso/rmso and smul/rmul are paired, and will not function - * properly if we remove rmso or rmul. Curses applications - * shouldn't be looking at this detail. - */ - sp->_use_rmso = SGR0_TEST(exit_standout_mode); - sp->_use_rmul = SGR0_TEST(exit_underline_mode); - - /* - * Check whether we can optimize scrolling under dumb terminals in - * case we do not have any of these capabilities, scrolling - * optimization will be useless. - */ - sp->_scrolling = ((scroll_forward && scroll_reverse) || - ((parm_rindex || - parm_insert_line || - insert_line) && - (parm_index || - parm_delete_line || - delete_line))); - - NCURSES_SP_NAME(baudrate) (sp); - - NCURSES_SP_NAME(_nc_mvcur_init) (sp); - /* initialize terminal to a sane state */ - NCURSES_SP_NAME(_nc_screen_init) (sp); -} - -static void -drv_init(TERMINAL_CONTROL_BLOCK * TCB) -{ - SCREEN *sp; - TERMINAL *trm; - - AssertTCB(); - - trm = (TERMINAL *) TCB; - sp = TCB->csp; - - TCB->info.initcolor = initialize_color; - TCB->info.canchange = can_change; - TCB->info.hascolor = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs) - && (((set_foreground != NULL) - && (set_background != NULL)) - || ((set_a_foreground != NULL) - && (set_a_background != NULL)) - || set_color_pair)) ? TRUE : FALSE); - - TCB->info.caninit = !(exit_ca_mode && non_rev_rmcup); - - TCB->info.maxpairs = VALID_NUMERIC(max_pairs) ? max_pairs : 0; - TCB->info.maxcolors = VALID_NUMERIC(max_colors) ? max_colors : 0; - TCB->info.numlabels = VALID_NUMERIC(num_labels) ? num_labels : 0; - TCB->info.labelwidth = VALID_NUMERIC(label_width) ? label_width : 0; - TCB->info.labelheight = VALID_NUMERIC(label_height) ? label_height : 0; - TCB->info.nocolorvideo = VALID_NUMERIC(no_color_video) ? no_color_video - : 0; - TCB->info.tabsize = VALID_NUMERIC(init_tabs) ? (int) init_tabs : 8; - - TCB->info.defaultPalette = hue_lightness_saturation ? _nc_hls_palette : _nc_cga_palette; - - /* - * If an application calls setupterm() rather than initscr() or - * newterm(), we will not have the def_prog_mode() call in - * _nc_setupscreen(). Do it now anyway, so we can initialize the - * baudrate. - */ - if (isatty(trm->Filedes)) { - TCB->drv->mode(TCB, TRUE, TRUE); - } -} - -#define MAX_PALETTE 8 -#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE) - -static void -drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, short pair, short f, short b) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - if ((initialize_pair != NULL) && InPalette(f) && InPalette(b)) { - const color_t *tp = InfoOf(sp).defaultPalette; - - TR(TRACE_ATTRS, - ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)", - pair, - tp[f].red, tp[f].green, tp[f].blue, - tp[b].red, tp[b].green, tp[b].blue)); - - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "initialize_pair", - TPARM_7(initialize_pair, - pair, - tp[f].red, tp[f].green, tp[f].blue, - tp[b].red, tp[b].green, tp[b].blue)); - } -} - -static int -default_fg(SCREEN *sp) -{ -#if NCURSES_EXT_FUNCS - return (sp != 0) ? sp->_default_fg : COLOR_WHITE; -#else - return COLOR_WHITE; -#endif -} - -static int -default_bg(SCREEN *sp) -{ -#if NCURSES_EXT_FUNCS - return sp != 0 ? sp->_default_bg : COLOR_BLACK; -#else - return COLOR_BLACK; -#endif -} - -static void -drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, - short color, short r, short g, short b) -{ - SCREEN *sp = TCB->csp; - - AssertTCB(); - if (initialize_color != NULL) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "initialize_color", - TPARM_4(initialize_color, color, r, g, b)); - } -} - -static void -drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, - short old_pair, - short pair, - bool reverse, - NCURSES_SP_OUTC outc) -{ - SCREEN *sp = TCB->csp; - NCURSES_COLOR_T fg = COLOR_DEFAULT; - NCURSES_COLOR_T bg = COLOR_DEFAULT; - NCURSES_COLOR_T old_fg, old_bg; - - AssertTCB(); - if (sp == 0) - return; - - if (pair < 0 || pair >= COLOR_PAIRS) { - return; - } else if (pair != 0) { - if (set_color_pair) { - TPUTS_TRACE("set_color_pair"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(set_color_pair, pair), 1, outc); - return; - } else if (sp != 0) { - NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx - (short) pair, - &fg, - &bg); - } - } - - if (old_pair >= 0 - && sp != 0 - && NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx - old_pair, - &old_fg, - &old_bg) !=ERR) { - if ((isDefaultColor(fg) && !isDefaultColor(old_fg)) - || (isDefaultColor(bg) && !isDefaultColor(old_bg))) { -#if NCURSES_EXT_FUNCS - /* - * A minor optimization - but extension. If "AX" is specified in - * the terminal description, treat it as screen's indicator of ECMA - * SGR 39 and SGR 49, and assume the two sequences are independent. - */ - if (sp->_has_sgr_39_49 - && isDefaultColor(old_bg) - && !isDefaultColor(old_fg)) { - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc); - } else if (sp->_has_sgr_39_49 - && isDefaultColor(old_fg) - && !isDefaultColor(old_bg)) { - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc); - } else -#endif - drv_rescol(TCB); - } - } else { - drv_rescol(TCB); - if (old_pair < 0) - return; - } - -#if NCURSES_EXT_FUNCS - if (isDefaultColor(fg)) - fg = (NCURSES_COLOR_T) default_fg(sp); - if (isDefaultColor(bg)) - bg = (NCURSES_COLOR_T) default_bg(sp); -#endif - - if (reverse) { - NCURSES_COLOR_T xx = fg; - fg = bg; - bg = xx; - } - - TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, - fg, bg)); - - if (!isDefaultColor(fg)) { - drv_setcolor(TCB, TRUE, fg, outc); - } - if (!isDefaultColor(bg)) { - drv_setcolor(TCB, FALSE, bg, outc); - } -} - -#define xterm_kmous "\033[M" -static void -init_xterm_mouse(SCREEN *sp) -{ - sp->_mouse_type = M_XTERM; - sp->_mouse_xtermcap = NCURSES_SP_NAME(tigetstr) (NCURSES_SP_ARGx "XM"); - if (!VALID_STRING(sp->_mouse_xtermcap)) - sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;"; -} - -static void -drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - /* we know how to recognize mouse events under "xterm" */ - if (sp != 0) { - if (key_mouse != 0) { - if (!strcmp(key_mouse, xterm_kmous) - || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { - init_xterm_mouse(sp); - } - } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { - if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK) - init_xterm_mouse(sp); - } - } -} - -static int -drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) -{ - int rc = 0; - SCREEN *sp; - - AssertTCB(); - SetSP(); - -#if USE_SYSMOUSE - if ((sp->_mouse_type == M_SYSMOUSE) - && (sp->_sysmouse_head < sp->_sysmouse_tail)) { - rc = TW_MOUSE; - } else -#endif - { - rc = TCBOf(sp)->drv->twait(TCBOf(sp), - TWAIT_MASK, - delay, - (int *) 0 - EVENTLIST_2nd(evl)); -#if USE_SYSMOUSE - if ((sp->_mouse_type == M_SYSMOUSE) - && (sp->_sysmouse_head < sp->_sysmouse_tail) - && (rc == 0) - && (errno == EINTR)) { - rc |= TW_MOUSE; - } -#endif - } - return rc; -} - -static int -drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew) -{ - SCREEN *sp = TCB->csp; - AssertTCB(); - return TINFO_MVCUR(sp, yold, xold, ynew, xnew); -} - -static void -drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text) -{ - SCREEN *sp = TCB->csp; - - AssertTCB(); - if (labnum > 0 && labnum <= num_labels) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "plab_norm", - TPARM_2(plab_norm, labnum, text)); - } -} - -static void -drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, bool OnFlag) -{ - SCREEN *sp = TCB->csp; - - AssertTCB(); - if (OnFlag) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on); - } else { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off); - } -} - -static chtype -drv_conattr(TERMINAL_CONTROL_BLOCK * TCB) -{ - SCREEN *sp = TCB->csp; - chtype attrs = A_NORMAL; - - AssertTCB(); - if (enter_alt_charset_mode) - attrs |= A_ALTCHARSET; - - if (enter_blink_mode) - attrs |= A_BLINK; - - if (enter_bold_mode) - attrs |= A_BOLD; - - if (enter_dim_mode) - attrs |= A_DIM; - - if (enter_reverse_mode) - attrs |= A_REVERSE; - - if (enter_standout_mode) - attrs |= A_STANDOUT; - - if (enter_protected_mode) - attrs |= A_PROTECT; - - if (enter_secure_mode) - attrs |= A_INVIS; - - if (enter_underline_mode) - attrs |= A_UNDERLINE; - - if (sp && sp->_coloron) - attrs |= A_COLOR; - - return (attrs); -} - -static void -drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) -{ - AssertTCB(); - - clear_screen = 0; - cursor_down = parm_down_cursor = 0; - cursor_address = 0; - cursor_up = parm_up_cursor = 0; - row_address = 0; - cursor_home = carriage_return; -} - -static void -drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map) -{ - SCREEN *sp = TCB->csp; - - AssertTCB(); - assert(sp != 0); - if (ena_acs != NULL) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs); - } -#if NCURSES_EXT_FUNCS - /* - * Linux console "supports" the "PC ROM" character set by the coincidence - * that smpch/rmpch and smacs/rmacs have the same values. ncurses has - * no codepage support (see SCO Merge for an example). Outside of the - * values defined in acsc, there are no definitions for the "PC ROM" - * character set (assumed by some applications to be codepage 437), but we - * allow those applications to use those codepoints. - * - * test/blue.c uses this feature. - */ -#define PCH_KLUDGE(a,b) (a != 0 && b != 0 && !strcmp(a,b)) - if (PCH_KLUDGE(enter_pc_charset_mode, enter_alt_charset_mode) && - PCH_KLUDGE(exit_pc_charset_mode, exit_alt_charset_mode)) { - size_t i; - for (i = 1; i < ACS_LEN; ++i) { - if (real_map[i] == 0) { - real_map[i] = i; - if (real_map != fake_map) { - if (sp != 0) - sp->_screen_acs_map[i] = TRUE; - } - } - } - } -#endif - - if (acs_chars != NULL) { - size_t i = 0; - size_t length = strlen(acs_chars); - - while (i + 1 < length) { - if (acs_chars[i] != 0 && UChar(acs_chars[i]) < ACS_LEN) { - real_map[UChar(acs_chars[i])] = UChar(acs_chars[i + 1]) | A_ALTCHARSET; - if (sp != 0) - sp->_screen_acs_map[UChar(acs_chars[i])] = TRUE; - } - i += 2; - } - } -#ifdef TRACE - /* Show the equivalent mapping, noting if it does not match the - * given attribute, whether by re-ordering or duplication. - */ - if (USE_TRACEF(TRACE_CALLS)) { - size_t n, m; - char show[ACS_LEN * 2 + 1]; - for (n = 1, m = 0; n < ACS_LEN; n++) { - if (real_map[n] != 0) { - show[m++] = (char) n; - show[m++] = (char) ChCharOf(real_map[n]); - } - } - show[m] = 0; - if (acs_chars == NULL || strcmp(acs_chars, show)) - _tracef("%s acs_chars %s", - (acs_chars == NULL) ? "NULL" : "READ", - _nc_visbuf(acs_chars)); - _tracef("%s acs_chars %s", - (acs_chars == NULL) - ? "NULL" - : (strcmp(acs_chars, show) - ? "DIFF" - : "SAME"), - _nc_visbuf(show)); - - _nc_unlock_global(tracef); - } -#endif /* TRACE */ -} - -#define ENSURE_TINFO(sp) (TCBOf(sp)->drv->isTerminfo) - -NCURSES_EXPORT(void) -_nc_cookie_init(SCREEN *sp) -{ - bool support_cookies = USE_XMC_SUPPORT; - TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) (sp->_term); - - if (sp == 0 || !ENSURE_TINFO(sp)) - return; - -#if USE_XMC_SUPPORT - /* - * If we have no magic-cookie support compiled-in, or if it is suppressed - * in the environment, reset the support-flag. - */ - if (magic_cookie_glitch >= 0) { - if (getenv("NCURSES_NO_MAGIC_COOKIE") != 0) { - support_cookies = FALSE; - } - } -#endif - - if (!support_cookies && magic_cookie_glitch >= 0) { - T(("will disable attributes to work w/o magic cookies")); - } - - if (magic_cookie_glitch > 0) { /* tvi, wyse */ - - sp->_xmc_triggers = sp->_ok_attributes & ( - A_STANDOUT | - A_UNDERLINE | - A_REVERSE | - A_BLINK | - A_DIM | - A_BOLD | - A_INVIS | - A_PROTECT - ); -#if 0 - /* - * We "should" treat colors as an attribute. The wyse350 (and its - * clones) appear to be the only ones that have both colors and magic - * cookies. - */ - if (has_colors()) { - sp->_xmc_triggers |= A_COLOR; - } -#endif - sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD); - - T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress))); - /* - * Supporting line-drawing may be possible. But make the regular - * video attributes work first. - */ - acs_chars = ABSENT_STRING; - ena_acs = ABSENT_STRING; - enter_alt_charset_mode = ABSENT_STRING; - exit_alt_charset_mode = ABSENT_STRING; -#if USE_XMC_SUPPORT - /* - * To keep the cookie support simple, suppress all of the optimization - * hooks except for clear_screen and the cursor addressing. - */ - if (support_cookies) { - clr_eol = ABSENT_STRING; - clr_eos = ABSENT_STRING; - set_attributes = ABSENT_STRING; - } -#endif - } else if (magic_cookie_glitch == 0) { /* hpterm */ - } - - /* - * If magic cookies are not supported, cancel the strings that set - * video attributes. - */ - if (!support_cookies && magic_cookie_glitch >= 0) { - magic_cookie_glitch = ABSENT_NUMERIC; - set_attributes = ABSENT_STRING; - enter_blink_mode = ABSENT_STRING; - enter_bold_mode = ABSENT_STRING; - enter_dim_mode = ABSENT_STRING; - enter_reverse_mode = ABSENT_STRING; - enter_standout_mode = ABSENT_STRING; - enter_underline_mode = ABSENT_STRING; - } - - /* initialize normal acs before wide, since we use mapping in the latter */ -#if !USE_WIDEC_SUPPORT - if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) { - acs_chars = NULL; - ena_acs = NULL; - enter_alt_charset_mode = NULL; - exit_alt_charset_mode = NULL; - set_attributes = NULL; - } -#endif -} - -static int -drv_twait(TERMINAL_CONTROL_BLOCK * TCB, - int mode, - int milliseconds, - int *timeleft - EVENTLIST_2nd(_nc_eventlist * evl)) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - return _nc_timed_wait(sp, mode, milliseconds, timeleft EVENTLIST_2nd(evl)); -} - -static int -drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) -{ - SCREEN *sp; - unsigned char c2 = 0; - int n; - - AssertTCB(); - assert(buf); - SetSP(); - -# if USE_PTHREADS_EINTR - if ((pthread_self) && (pthread_kill) && (pthread_equal)) - _nc_globals.read_thread = pthread_self(); -# endif - n = read(sp->_ifd, &c2, 1); -#if USE_PTHREADS_EINTR - _nc_globals.read_thread = 0; -#endif - *buf = (int) c2; - return n; -} - -static int -drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) -{ -#if HAVE_NANOSLEEP - { - struct timespec request, remaining; - request.tv_sec = ms / 1000; - request.tv_nsec = (ms % 1000) * 1000000; - while (nanosleep(&request, &remaining) == -1 - && errno == EINTR) { - request = remaining; - } - } -#else - _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); -#endif - return OK; -} - -static int -__nc_putp(SCREEN *sp, const char *name GCC_UNUSED, const char *value) -{ - int rc = ERR; - - if (value) { - rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); - } - return rc; -} - -static int -__nc_putp_flush(SCREEN *sp, const char *name, const char *value) -{ - int rc = __nc_putp(sp, name, value); - if (rc != ERR) { - NCURSES_SP_NAME(_nc_flush) (sp); - } - return rc; -} - -static int -drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag) -{ - int ret = ERR; - SCREEN *sp; - - AssertTCB(); - - sp = TCB->csp; - - if (sp) { - if (flag) { - (void) __nc_putp_flush(sp, "keypad_xmit", keypad_xmit); - } else if (!flag && keypad_local) { - (void) __nc_putp_flush(sp, "keypad_local", keypad_local); - } - if (flag && !sp->_tried) { - _nc_init_keytry(sp); - sp->_tried = TRUE; - } - ret = OK; - } - - return ret; -} - -static int -drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) -{ - SCREEN *sp; - int code = ERR; - int count = 0; - char *s; - - AssertTCB(); - SetSP(); - - if (c >= 0) { - unsigned ch = (unsigned) c; - if (flag) { - while ((s = _nc_expand_try(sp->_key_ok, ch, &count, 0)) != 0 - && _nc_remove_key(&(sp->_key_ok), ch)) { - code = _nc_add_to_try(&(sp->_keytry), s, ch); - free(s); - count = 0; - if (code != OK) - break; - } - } else { - while ((s = _nc_expand_try(sp->_keytry, ch, &count, 0)) != 0 - && _nc_remove_key(&(sp->_keytry), ch)) { - code = _nc_add_to_try(&(sp->_key_ok), s, ch); - free(s); - count = 0; - if (code != OK) - break; - } - } - } - return (code); -} - -static bool -drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key) -{ - bool res = FALSE; - - AssertTCB(); - if (TCB->csp) - res = TINFO_HAS_KEY(TCB->csp, key) == 0 ? FALSE : TRUE; - - return res; -} - -NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = { - TRUE, - drv_CanHandle, /* CanHandle */ - drv_init, /* init */ - drv_release, /* release */ - drv_size, /* size */ - drv_sgmode, /* sgmode */ - drv_conattr, /* conattr */ - drv_mvcur, /* hwcur */ - drv_mode, /* mode */ - drv_rescol, /* rescol */ - drv_rescolors, /* rescolors */ - drv_setcolor, /* color */ - drv_dobeepflash, /* doBeepOrFlash */ - drv_initpair, /* initpair */ - drv_initcolor, /* initcolor */ - drv_do_color, /* docolor */ - drv_initmouse, /* initmouse */ - drv_testmouse, /* testmouse */ - drv_setfilter, /* setfilter */ - drv_hwlabel, /* hwlabel */ - drv_hwlabelOnOff, /* hwlabelOnOff */ - drv_doupdate, /* update */ - drv_defaultcolors, /* defaultcolors */ - drv_print, /* print */ - drv_getsize, /* getsize */ - drv_setsize, /* setsize */ - drv_initacs, /* initacs */ - drv_screen_init, /* scinit */ - drv_wrap, /* scexit */ - drv_twait, /* twait */ - drv_read, /* read */ - drv_nap, /* nap */ - drv_kpad, /* kpad */ - drv_keyok, /* kyOk */ - drv_kyExist /* kyExist */ -}; diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index 1f99208667e..80c8f77fbeb 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2007,2010 Free Software Foundation, Inc. * + * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,8 +35,9 @@ #include #include +#include -MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $") #undef CUR #define CUR tp-> @@ -99,8 +100,8 @@ rewrite_sgr(char *s, char *attr) { if (PRESENT(s)) { if (PRESENT(attr)) { - size_t len_s = strlen(s); - size_t len_a = strlen(attr); + unsigned len_s = strlen(s); + unsigned len_a = strlen(attr); if (len_s > len_a && !strncmp(attr, s, len_a)) { unsigned n; @@ -123,8 +124,8 @@ similar_sgr(char *a, char *b) bool result = FALSE; int csi_a = is_csi(a); int csi_b = is_csi(b); - size_t len_a; - size_t len_b; + unsigned len_a; + unsigned len_b; TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s", _nc_visbuf2(1, a), @@ -169,13 +170,13 @@ chop_out(char *string, unsigned i, unsigned j) * Returns the number of chars from 'full' that we matched. If any mismatch * occurs, return zero. */ -static unsigned +static int compare_part(const char *part, const char *full) { const char *next_part; const char *next_full; - unsigned used_full = 0; - unsigned used_delay = 0; + int used_full = 0; + int used_delay = 0; while (*part != 0) { if (*part != *full) { @@ -198,7 +199,7 @@ compare_part(const char *part, const char *full) next_part = skip_delay(part); next_full = skip_delay(full); if (next_part != part && next_full != full) { - used_delay += (unsigned) (next_full - full); + used_delay += (next_full - full); full = next_full; part = next_part; continue; @@ -260,11 +261,10 @@ _nc_trim_sgr0(TERMTYPE *tp) k = strlen(exit_alt_charset_mode); if (j > k) { for (i = 0; i <= (j - k); ++i) { - unsigned k2 = compare_part(exit_alt_charset_mode, - off + i); + int k2 = compare_part(exit_alt_charset_mode, off + i); if (k2 != 0) { found = TRUE; - chop_out(off, (unsigned) i, (unsigned) (i + k2)); + chop_out(off, i, i + k2); break; } } @@ -274,18 +274,18 @@ _nc_trim_sgr0(TERMTYPE *tp) * SGR 10 would reset to normal font. */ if (!found) { - if ((i = (size_t) is_csi(off)) != 0 + if ((i = is_csi(off)) != 0 && off[strlen(off) - 1] == 'm') { TR(TRACE_DATABASE, ("looking for SGR 10 in %s", _nc_visbuf(off))); tmp = skip_zero(off + i); if (tmp[0] == '1' && skip_zero(tmp + 1) != tmp + 1) { - i = (size_t) (tmp - off); + i = tmp - off; if (off[i - 1] == ';') i--; - j = (size_t) (skip_zero(tmp + 1) - off); - (void) chop_out(off, (unsigned) i, (unsigned) j); + j = skip_zero(tmp + 1) - off; + i = chop_out(off, i, j); found = TRUE; } } @@ -293,10 +293,10 @@ _nc_trim_sgr0(TERMTYPE *tp) if (!found && (tmp = strstr(end, off)) != 0 && strcmp(end, off) != 0) { - i = (size_t) (tmp - end); + i = tmp - end; j = strlen(off); tmp = strdup(end); - chop_out(tmp, (unsigned) i, (unsigned) j); + chop_out(tmp, i, j); free(off); result = tmp; } diff --git a/ncurses/tinfo/use_screen.c b/ncurses/tinfo/use_screen.c index 6a0297cebd5..6c3b12fb923 100644 --- a/ncurses/tinfo/use_screen.c +++ b/ncurses/tinfo/use_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 2007,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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $") +MODULE_ID("$Id: use_screen.c,v 1.6 2008/06/07 19:16:56 tom Exp $") NCURSES_EXPORT(int) use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) @@ -40,14 +40,14 @@ use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) SCREEN *save_SP; int code = OK; - T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data)); + T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data)); /* * FIXME - add a flag so a given thread can check if _it_ has already * recurred through this point, return an error if so. */ _nc_lock_global(curses); - save_SP = CURRENT_SCREEN; + save_SP = SP; set_term(screen); code = func(screen, data); diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index a86c11267e9..b53bb210230 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -42,6 +42,7 @@ #include #include +#include #ifndef S_ISDIR #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) @@ -53,7 +54,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.78 2010/12/25 23:23:08 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.72 2008/08/03 19:24:00 tom Exp $") static int total_written; @@ -136,12 +137,10 @@ make_db_path(char *dst, const char *src, unsigned limit) if (_nc_is_dir_path(dst)) { rc = -1; } else { - static const char suffix[] = DBM_SUFFIX; unsigned have = strlen(dst); - unsigned need = strlen(suffix); - if (have > need && strcmp(dst + have - need, suffix)) { - if (have + need <= limit) - strcat(dst, suffix); + if (have > 3 && strcmp(dst + have - 3, DBM_SUFFIX)) { + if (have + 3 <= limit) + strcat(dst, DBM_SUFFIX); else rc = -1; } @@ -172,11 +171,7 @@ make_db_root(const char *path) struct stat statbuf; if ((rc = stat(path, &statbuf)) < 0) { - rc = mkdir(path -#if !defined(__MINGW32__) - ,0777 -#endif - ); + rc = mkdir(path, 0777); } else if (_nc_access(path, R_OK | W_OK | X_OK) < 0) { rc = -1; /* permission denied */ } else if (!(S_ISDIR(statbuf.st_mode))) { @@ -343,7 +338,6 @@ _nc_write_entry(TERMTYPE *const tp) while (*other_names != '\0') { ptr = other_names++; - assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; @@ -363,7 +357,7 @@ _nc_write_entry(TERMTYPE *const tp) start_time = 0; } - if (strlen(first_name) >= sizeof(filename) - (2 + LEAF_LEN)) + if (strlen(first_name) >= sizeof(filename) - 3) _nc_warning("terminal name too long."); sprintf(filename, LEAF_FMT "/%s", first_name[0], first_name); @@ -391,13 +385,14 @@ _nc_write_entry(TERMTYPE *const tp) } while (*other_names != '\0') { ptr = other_names++; + assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; if (*other_names != '\0') *(other_names++) = '\0'; - if (strlen(ptr) > sizeof(linkname) - (2 + LEAF_LEN)) { + if (strlen(ptr) > sizeof(linkname) - 3) { _nc_warning("terminal alias %s too long.", ptr); continue; } @@ -419,12 +414,8 @@ _nc_write_entry(TERMTYPE *const tp) { int code; #if USE_SYMLINKS - if (first_name[0] == linkname[0]) - strncpy(symlinkname, first_name, sizeof(symlinkname) - 1); - else { - strcpy(symlinkname, "../"); - strncat(symlinkname, filename, sizeof(symlinkname) - 4); - } + strcpy(symlinkname, "../"); + strncat(symlinkname, filename, sizeof(symlinkname) - 4); symlinkname[sizeof(symlinkname) - 1] = '\0'; #endif /* USE_SYMLINKS */ #if HAVE_REMOVE @@ -469,26 +460,26 @@ _nc_write_entry(TERMTYPE *const tp) #endif /* USE_HASHED_DB */ } -static size_t +static unsigned fake_write(char *dst, unsigned *offset, - size_t limit, + unsigned limit, char *src, - size_t want, - size_t size) + unsigned want, + unsigned size) { - size_t have = (limit - *offset); + int have = (limit - *offset); want *= size; if (have > 0) { - if (want > have) + if ((int) want > have) want = have; memcpy(dst + *offset, src, want); - *offset += (unsigned) want; + *offset += want; } else { want = 0; } - return (want / size); + return (int) (want / size); } #define Write(buf, size, count) fake_write(buffer, offset, limit, (char *) buf, count, size) @@ -496,16 +487,15 @@ fake_write(char *dst, #undef LITTLE_ENDIAN /* BSD/OS defines this as a feature macro */ #define HI(x) ((x) / 256) #define LO(x) ((x) % 256) -#define LITTLE_ENDIAN(p, x) (p)[0] = (unsigned char)LO(x), \ - (p)[1] = (unsigned char)HI(x) +#define LITTLE_ENDIAN(p, x) (p)[0] = LO(x), (p)[1] = HI(x) #define WRITE_STRING(str) (Write(str, sizeof(char), strlen(str) + 1) == strlen(str) + 1) static int -compute_offsets(char **Strings, size_t strmax, short *offsets) +compute_offsets(char **Strings, unsigned strmax, short *offsets) { - int nextfree = 0; - size_t i; + size_t nextfree = 0; + unsigned i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -513,8 +503,8 @@ compute_offsets(char **Strings, size_t strmax, short *offsets) } else if (Strings[i] == CANCELLED_STRING) { offsets[i] = -2; } else { - offsets[i] = (short) nextfree; - nextfree += (int) strlen(Strings[i]) + 1; + offsets[i] = nextfree; + nextfree += strlen(Strings[i]) + 1; TRACE_OUT(("put Strings[%d]=%s(%d)", (int) i, _nc_visbuf(Strings[i]), (int) nextfree)); } @@ -523,9 +513,9 @@ compute_offsets(char **Strings, size_t strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, size_t count) +convert_shorts(unsigned char *buf, short *Numbers, unsigned count) { - size_t i; + unsigned i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; @@ -534,7 +524,7 @@ convert_shorts(unsigned char *buf, short *Numbers, size_t count) buf[2 * i + 1] = 0377; } else { LITTLE_ENDIAN(buf + 2 * i, Numbers[i]); - TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i])); + TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i])); } } } @@ -546,8 +536,8 @@ convert_shorts(unsigned char *buf, short *Numbers, size_t count) static unsigned extended_Booleans(TERMTYPE *tp) { - unsigned result = 0; - unsigned i; + unsigned short result = 0; + unsigned short i; for (i = 0; i < tp->ext_Booleans; ++i) { if (tp->Booleans[BOOLCOUNT + i] == TRUE) @@ -559,8 +549,8 @@ extended_Booleans(TERMTYPE *tp) static unsigned extended_Numbers(TERMTYPE *tp) { - unsigned result = 0; - unsigned i; + unsigned short result = 0; + unsigned short i; for (i = 0; i < tp->ext_Numbers; ++i) { if (tp->Numbers[NUMCOUNT + i] != ABSENT_NUMERIC) @@ -577,7 +567,7 @@ extended_Strings(TERMTYPE *tp) for (i = 0; i < tp->ext_Strings; ++i) { if (tp->Strings[STRCOUNT + i] != ABSENT_STRING) - result = (unsigned short) (i + 1); + result = (i + 1); } return result; } @@ -607,7 +597,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) size_t namelen, boolmax, nummax, strmax; char zero = '\0'; size_t i; - int nextfree; + short nextfree; short offsets[MAX_ENTRY_SIZE / 2]; unsigned char buf[MAX_ENTRY_SIZE]; unsigned last_bool = BOOLWRITE; @@ -700,7 +690,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) #if NCURSES_XNAMES if (extended_object(tp)) { - unsigned extcnt = (unsigned) NUM_EXT_NAMES(tp); + unsigned extcnt = NUM_EXT_NAMES(tp); if (even_boundary(nextfree)) return (ERR); diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index a726901d4a3..743b1f64f1a 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -47,7 +46,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -57,26 +56,26 @@ NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ NCURSES_EXPORT(const char *) NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void) { - return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace; + return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace; } NCURSES_EXPORT(long) NCURSES_PUBLIC_VAR(_nc_outchars) (void) { - return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars; + return SP ? SP->_outchars : _nc_prescreen._outchars; } NCURSES_EXPORT(void) _nc_set_tputs_trace(const char *s) { - if (CURRENT_SCREEN) - CURRENT_SCREEN->_tputs_trace = s; + if (SP) + SP->_tputs_trace = s; else _nc_prescreen._tputs_trace = s; } NCURSES_EXPORT(void) _nc_count_outchars(long increment) { - if (CURRENT_SCREEN) - CURRENT_SCREEN->_outchars += increment; + if (SP) + SP->_outchars += increment; else _nc_prescreen._outchars += increment; } @@ -96,7 +95,7 @@ trace(const unsigned int tracelevel) const char *mode = _nc_globals.init_trace ? "ab" : "wb"; if (TracePath[0] == '\0') { - size_t size = sizeof(TracePath) - 12; + int size = sizeof(TracePath) - 12; if (getcwd(TracePath, size) == 0) { perror("curses: Can't get working directory"); exit(EXIT_FAILURE); @@ -122,7 +121,7 @@ trace(const unsigned int tracelevel) */ #if HAVE_SETVBUF /* ANSI */ (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); -#elif HAVE_SETBUF /* POSIX */ +#elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif _tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)", @@ -184,11 +183,7 @@ _nc_va_tracef(const char *fmt, va_list ap) # if USE_WEAK_SYMBOLS if ((pthread_self)) # endif -#ifdef __MINGW32__ - fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p); -#else fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self()); -#endif #endif if (before || after) { int n; @@ -224,14 +219,6 @@ _nc_retrace_bool(NCURSES_BOOL code) return code; } -/* Trace 'char' return-values */ -NCURSES_EXPORT(char) -_nc_retrace_char(char code) -{ - T((T_RETURN("%c"), code)); - return code; -} - /* Trace 'int' return-values */ NCURSES_EXPORT(int) _nc_retrace_int(int code) @@ -284,7 +271,7 @@ _nc_retrace_void_ptr(void *code) NCURSES_EXPORT(SCREEN *) _nc_retrace_sp(SCREEN *code) { - T((T_RETURN("%p"), (void *) code)); + T((T_RETURN("%p"), code)); return code; } @@ -292,7 +279,7 @@ _nc_retrace_sp(SCREEN *code) NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) { - T((T_RETURN("%p"), (void *) code)); + T((T_RETURN("%p"), code)); return code; } diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index 35ba0d3e679..45a03cea05f 100644 --- a/ncurses/trace/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Thomas Dickey 1996-on * * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -38,12 +37,9 @@ */ #include +#include /* acs_chars */ -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - -MODULE_ID("$Id: lib_traceatr.c,v 1.74 2011/01/22 19:48:01 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -132,11 +128,11 @@ _traceattr2(int bufnum, chtype newmode) for (n = 0; n < SIZEOF(names); n++) { if ((newmode & names[n].val) != 0) { if (result[1] != '\0') - (void) _nc_trace_bufcat(bufnum, "|"); + result = _nc_trace_bufcat(bufnum, "|"); result = _nc_trace_bufcat(bufnum, names[n].name); if (names[n].val == A_COLOR) { - short pairnum = (short) PairNumber(newmode); + short pairnum = PAIR_NUMBER(newmode); #ifdef USE_TERMLIB /* pair_content lives in libncurses */ (void) sprintf(temp, "{%d}", pairnum); @@ -176,14 +172,6 @@ _traceattr(attr_t newmode) } /* Trace 'int' return-values */ -NCURSES_EXPORT(int) -_nc_retrace_int_attr_t(attr_t code) -{ - T((T_RETURN("%s"), _traceattr(code))); - return (int) code; -} - -/* Trace 'attr_t' return-values */ NCURSES_EXPORT(attr_t) _nc_retrace_attr_t(attr_t code) { @@ -198,9 +186,6 @@ _nc_altcharset_name(attr_t attr, chtype ch) unsigned int val; const char *name; } ALT_NAMES; -#if NCURSES_SP_FUNCS - SCREEN *sp = CURRENT_SCREEN; -#endif static const ALT_NAMES names[] = { {'l', "ACS_ULCORNER"}, /* upper left corner */ @@ -240,26 +225,23 @@ _nc_altcharset_name(attr_t attr, chtype ch) const char *result = 0; -#if NCURSES_SP_FUNCS - (void) sp; -#endif if ((attr & A_ALTCHARSET) && (acs_chars != 0)) { char *cp; char *found = 0; - const ALT_NAMES *strp; + const ALT_NAMES *sp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) { + if (ChCharOf(cp[1]) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = ChCharOf(UChar(*found)); - for (strp = names; strp->val; strp++) - if (strp->val == ch) { - result = strp->name; + ch = ChCharOf(*found); + for (sp = names; sp->val; sp++) + if (sp->val == ch) { + result = sp->name; break; } } @@ -278,9 +260,7 @@ _tracechtype2(int bufnum, chtype ch) if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) { (void) _nc_trace_bufcat(bufnum, found); } else - (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(CURRENT_SCREEN, - (int) ChCharOf(ch))); + (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch))); if (ChAttrOf(ch) != A_NORMAL) { (void) _nc_trace_bufcat(bufnum, " | "); @@ -333,17 +313,14 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) (void) _nc_trace_bufcat(bufnum, "{ "); for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { PUTC_ch = ch->chars[PUTC_i]; - if (PUTC_ch == L'\0') { - if (PUTC_i == 0) - (void) _nc_trace_bufcat(bufnum, "\\000"); + if (PUTC_ch == L'\0') break; - } - PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) { if (PUTC_ch != L'\0') { /* it could not be a multibyte sequence */ (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(CURRENT_SCREEN, + _nc_tracechar(SP, UChar(ch->chars[PUTC_i]))); } break; @@ -352,7 +329,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) if (n) (void) _nc_trace_bufcat(bufnum, ", "); (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(CURRENT_SCREEN, + _nc_tracechar(SP, UChar(PUTC_buf[n]))); } } diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c index d19d0e420ac..cc441b391e5 100644 --- a/ncurses/trace/lib_tracebits.c +++ b/ncurses/trace/lib_tracebits.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -33,8 +33,9 @@ ****************************************************************************/ #include +#include /* cur_term */ -MODULE_ID("$Id: lib_tracebits.c,v 1.19 2011/01/09 00:23:03 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.17 2008/08/03 16:09:26 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -261,5 +262,5 @@ _nc_tracebits(void) return _nc_trace_ttymode(&(cur_term->Nttyb)); } #else -EMPTY_MODULE(_nc_empty_lib_tracebits) +EMPTY_MODULE(_nc_tracebits) #endif /* TRACE */ diff --git a/ncurses/trace/lib_tracechr.c b/ncurses/trace/lib_tracechr.c index a1f9f5aa270..79cf03b4870 100644 --- a/ncurses/trace/lib_tracechr.c +++ b/ncurses/trace/lib_tracechr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_tracechr.c,v 1.20 2009/04/18 22:48:29 tom Exp $") +MODULE_ID("$Id: lib_tracechr.c,v 1.19 2008/08/03 15:39:29 tom Exp $") #ifdef TRACE @@ -52,7 +52,7 @@ _nc_tracechar(SCREEN *sp, int ch) : _nc_globals.tracechr_buf); if (ch > KEY_MIN || ch < 0) { - name = safe_keyname(SP_PARM, ch); + name = _nc_keyname(sp, ch); if (name == 0 || *name == '\0') name = "NULL"; (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -64,7 +64,7 @@ _nc_tracechar(SCREEN *sp, int ch) */ (void) sprintf(MyBuffer, "%#03o", ch); } else { - name = safe_unctrl(SP_PARM, (chtype) ch); + name = _nc_unctrl(sp, (chtype) ch); if (name == 0 || *name == 0) name = "null"; /* shouldn't happen */ (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -75,7 +75,7 @@ _nc_tracechar(SCREEN *sp, int ch) NCURSES_EXPORT(char *) _tracechar(int ch) { - return _nc_tracechar(CURRENT_SCREEN, ch); + return _nc_tracechar(SP, ch); } #else EMPTY_MODULE(_nc_lib_tracechr) diff --git a/ncurses/trace/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c index c7fcbf2e0d5..58732a06c24 100644 --- a/ncurses/trace/lib_tracedmp.c +++ b/ncurses/trace/lib_tracedmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -39,7 +39,7 @@ #include #include -MODULE_ID("$Id: lib_tracedmp.c,v 1.32 2009/04/18 21:01:38 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.31 2008/08/16 19:30:56 tom Exp $") #ifdef TRACE @@ -68,7 +68,7 @@ _tracedump(const char *name, WINDOW *win) if (width < win->_maxx) ++width; if (++width + 1 > (int) my_length) { - my_length = (unsigned) (2 * (width + 1)); + my_length = 2 * (width + 1); my_buffer = typeRealloc(char, my_length, my_buffer); } @@ -82,7 +82,7 @@ _tracedump(const char *name, WINDOW *win) * we map those to '.' and '?' respectively. */ for (j = 0; j < width; ++j) { - chtype test = (chtype) CharOf(win->_line[n].text[j]); + chtype test = CharOf(win->_line[n].text[j]); ep[j] = (char) ((UChar(test) == test #if USE_WIDEC_SUPPORT && (win->_line[n].text[j].chars[1] == 0) @@ -111,7 +111,7 @@ _tracedump(const char *name, WINDOW *win) if (multicolumn) { ep = my_buffer; for (j = 0; j < width; ++j) { - chtype test = WidecExt(win->_line[n].text[j]); + int test = WidecExt(win->_line[n].text[j]); if (test) { ep[j] = (char) (test + '0'); } else { @@ -153,7 +153,7 @@ _tracedump(const char *name, WINDOW *win) for (i = 0; i < 4; ++i) { const char *hex = " 123456789ABCDEF"; - attr_t mask = (attr_t) (0xf << ((i + 4) * 4)); + attr_t mask = (0xf << ((i + 4) * 4)); haveattrs = FALSE; for (j = 0; j < width; ++j) diff --git a/ncurses/trace/lib_tracemse.c b/ncurses/trace/lib_tracemse.c index 1afd15d2e78..74cc177d51b 100644 --- a/ncurses/trace/lib_tracemse.c +++ b/ncurses/trace/lib_tracemse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -38,16 +38,23 @@ #include -MODULE_ID("$Id: lib_tracemse.c,v 1.18 2011/01/22 19:48:08 tom Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.15 2008/08/03 15:39:29 tom Exp $") #ifdef TRACE #define my_buffer sp->tracemse_buf -static char * -_trace_mmask_t(SCREEN *sp, mmask_t code) +NCURSES_EXPORT(char *) +_nc_tracemouse(SCREEN *sp, MEVENT const *ep) { -#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ") + (void) sprintf(my_buffer, TRACEMSE_FMT, + ep->id, + ep->x, + ep->y, + ep->z, + (unsigned long) ep->bstate); + +#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(my_buffer, s), ", ") SHOW(BUTTON1_RELEASED, "release-1"); SHOW(BUTTON1_PRESSED, "press-1"); @@ -103,37 +110,14 @@ _trace_mmask_t(SCREEN *sp, mmask_t code) if (my_buffer[strlen(my_buffer) - 1] == ' ') my_buffer[strlen(my_buffer) - 2] = '\0'; - - return (my_buffer); -} - -NCURSES_EXPORT(char *) -_nc_tracemouse(SCREEN *sp, MEVENT const *ep) -{ - (void) sprintf(my_buffer, TRACEMSE_FMT, - ep->id, - ep->x, - ep->y, - ep->z, - (unsigned long) ep->bstate); - - (void) _trace_mmask_t(sp, ep->bstate); (void) strcat(my_buffer, "}"); return (my_buffer); } -NCURSES_EXPORT(mmask_t) -_nc_retrace_mmask_t(SCREEN *sp, mmask_t code) -{ - *my_buffer = '\0'; - T((T_RETURN("{%s}"), _trace_mmask_t(sp, code))); - return code; -} - NCURSES_EXPORT(char *) _tracemouse(MEVENT const *ep) { - return _nc_tracemouse(CURRENT_SCREEN, ep); + return _nc_tracemouse(SP, ep); } #else /* !TRACE */ diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c index 46baba4796b..6345acc035f 100644 --- a/ncurses/trace/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -35,9 +35,7 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $") - -#ifdef TRACE +MODULE_ID("$Id: trace_buf.c,v 1.14 2008/08/03 15:13:56 tom Exp $") #define MyList _nc_globals.tracebuf_ptr #define MySize _nc_globals.tracebuf_used @@ -49,7 +47,7 @@ _nc_trace_alloc(int bufnum, size_t want) if (bufnum >= 0) { if ((size_t) (bufnum + 1) > MySize) { - size_t need = (size_t) (bufnum + 1) * 2; + size_t need = (bufnum + 1) * 2; if ((MyList = typeRealloc(TRACEBUF, need, MyList)) != 0) { while (need > MySize) MyList[MySize++].text = 0; @@ -114,6 +112,3 @@ _nc_trace_bufcat(int bufnum, const char *value) } return buffer; } -#else -EMPTY_MODULE(_nc_empty_trace_buf) -#endif /* TRACE */ diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c index d3380131eca..f813aba1582 100644 --- a/ncurses/trace/trace_tries.c +++ b/ncurses/trace/trace_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2009,2011 Free Software Foundation, Inc. * + * Copyright (c) 1999-2007,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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1999 * + * Author: Thomas E. Dickey 1999 * ****************************************************************************/ /* * trace_tries.c - Tracing/Debugging buffers (keycode tries-trees) @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: trace_tries.c,v 1.16 2011/01/09 00:23:27 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.13 2008/08/03 15:43:30 tom Exp $") #ifdef TRACE #define my_buffer _nc_globals.tracetry_buf @@ -46,7 +46,7 @@ recur_tries(TRIES * tree, unsigned level) { if (level > my_length) { my_length = (level + 1) * 4; - my_buffer = (unsigned char *) _nc_doalloc(my_buffer, my_length); + my_buffer = (unsigned char *) realloc(my_buffer, my_length); } while (tree != 0) { @@ -67,12 +67,12 @@ NCURSES_EXPORT(void) _nc_trace_tries(TRIES * tree) { my_buffer = typeMalloc(unsigned char, my_length = 80); - _tracef("BEGIN tries %p", (void *) tree); + _tracef("BEGIN tries %p", tree); recur_tries(tree, 0); - _tracef(". . . tries %p", (void *) tree); + _tracef(". . . tries %p", tree); free(my_buffer); } #else -EMPTY_MODULE(_nc_empty_trace_tries) +EMPTY_MODULE(_nc_trace_tries) #endif diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c index 38a48730ccd..9b0b5920d81 100644 --- a/ncurses/trace/trace_xnames.c +++ b/ncurses/trace/trace_xnames.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2000,2010 Free Software Foundation, Inc. * + * Copyright (c) 1999,2000 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,11 +34,12 @@ */ #include +#include -MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $") +MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $") NCURSES_EXPORT(void) -_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) +_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED) { #ifdef TRACE #if NCURSES_XNAMES diff --git a/ncurses/trace/varargs.c b/ncurses/trace/varargs.c index 541173d2745..f4ee46710ab 100644 --- a/ncurses/trace/varargs.c +++ b/ncurses/trace/varargs.c @@ -34,7 +34,7 @@ #include -MODULE_ID("$Id: varargs.c,v 1.8 2008/11/16 00:19:59 juergen Exp $") +MODULE_ID("$Id: varargs.c,v 1.7 2008/08/03 15:42:49 tom Exp $") #ifdef TRACE @@ -44,7 +44,7 @@ typedef enum { atUnknown = 0, atInteger, atFloat, atPoint, atString } ARGTYPE; -#define VA_INT(type) ival = (int) va_arg(ap, type) +#define VA_INT(type) ival = va_arg(ap, type) #define VA_FLT(type) fval = va_arg(ap, type) #define VA_PTR(type) pval = (char *)va_arg(ap, type) #define VA_STR(type) sval = va_arg(ap, type) diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index 66da4f4beca..bf9fb147200 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2001-2007,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 * @@ -42,9 +42,7 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $") - -#define NUM_VISBUFS 4 +MODULE_ID("$Id: visbuf.c,v 1.32 2008/08/04 23:07:39 tom Exp $") #define NormalLen(len) (size_t) (((size_t)(len) + 1) * 4) #define WideLen(len) (size_t) (((size_t)(len) + 1) * 4 * MB_CUR_MAX) @@ -94,7 +92,7 @@ _nc_vischar(char *tp, unsigned c) static const char * _nc_visbuf2n(int bufnum, const char *buf, int len) { - const char *vbuf = 0; + const char *vbuf; char *tp; int c; @@ -110,16 +108,9 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, NormalLen(len)); #else { - static char *mybuf[NUM_VISBUFS]; - if (bufnum < 0) { - for (c = 0; c < NUM_VISBUFS; ++c) { - FreeAndNull(mybuf[c]); - } - tp = 0; - } else { - mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); - vbuf = tp = mybuf[bufnum]; - } + static char *mybuf[4]; + mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); + vbuf = tp = mybuf[bufnum]; } #endif if (tp != 0) { @@ -128,7 +119,7 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) tp = _nc_vischar(tp, UChar(c)); } *tp++ = D_QUOTE; - *tp = '\0'; + *tp++ = '\0'; } else { vbuf = ("(_nc_visbuf2n failed)"); } @@ -186,7 +177,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, WideLen(len)); #else { - static char *mybuf[NUM_VISBUFS]; + static char *mybuf[2]; mybuf[bufnum] = typeRealloc(char, WideLen(len), mybuf[bufnum]); vbuf = tp = mybuf[bufnum]; } @@ -205,7 +196,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) } } *tp++ = D_QUOTE; - *tp = '\0'; + *tp++ = '\0'; } else { vbuf = ("(_nc_viswbuf2n failed)"); } @@ -238,9 +229,7 @@ _nc_viswibuf(const wint_t *buf) static unsigned mylen; unsigned n; - for (n = 0; buf[n] != 0; ++n) { - ; /* empty */ - } + for (n = 0; buf[n] != 0; ++n) ; if (mylen < ++n) { mylen = n + 80; if (mybuf != 0) @@ -248,10 +237,8 @@ _nc_viswibuf(const wint_t *buf) else mybuf = typeMalloc(wchar_t, mylen); } - for (n = 0; buf[n] != 0; ++n) { + for (n = 0; buf[n] != 0; ++n) mybuf[n] = (wchar_t) buf[n]; - } - mybuf[n] = L'\0'; return _nc_viswbuf2(0, mybuf); } @@ -287,12 +274,12 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } } - (void) _nc_trace_bufcat(bufnum, l_brace); - (void) _nc_trace_bufcat(bufnum, d_quote); + result = _nc_trace_bufcat(bufnum, l_brace); + result = _nc_trace_bufcat(bufnum, d_quote); for (j = first; j <= last; ++j) { found = _nc_altcharset_name(attr, (chtype) CharOf(buf[j])); if (found != 0) { - (void) _nc_trace_bufcat(bufnum, found); + result = _nc_trace_bufcat(bufnum, found); attr &= ~A_ALTCHARSET; } else #if USE_WIDEC_SUPPORT @@ -304,19 +291,15 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) int k; PUTC_ch = buf[j].chars[PUTC_i]; - if (PUTC_ch == L'\0') { - if (PUTC_i == 0) - (void) _nc_trace_bufcat(bufnum, "\\000"); + if (PUTC_ch == L'\0') break; - } - PUTC_n = (int) wcrtomb(PUTC_buf, - buf[j].chars[PUTC_i], &PUT_st); + PUTC_n = (int) wcrtomb(PUTC_buf, buf[j].chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) break; for (k = 0; k < PUTC_n; k++) { char temp[80]; _nc_vischar(temp, UChar(PUTC_buf[k])); - (void) _nc_trace_bufcat(bufnum, temp); + result = _nc_trace_bufcat(bufnum, temp); } } } @@ -328,10 +311,10 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } #endif /* USE_WIDEC_SUPPORT */ } - (void) _nc_trace_bufcat(bufnum, d_quote); + result = _nc_trace_bufcat(bufnum, d_quote); if (attr != A_NORMAL) { - (void) _nc_trace_bufcat(bufnum, " | "); - (void) _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); + result = _nc_trace_bufcat(bufnum, " | "); + result = _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); } result = _nc_trace_bufcat(bufnum, r_brace); first = last + 1; diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh index 7a5f5993c48..bf9acf21aa4 100755 --- a/ncurses/tty/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -1,6 +1,6 @@ #! /bin/sh ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,9 +27,9 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey, 1997-on +# Author: Thomas E. Dickey 1997 # -# $Id: MKexpanded.sh,v 1.17 2010/01/23 17:57:43 tom Exp $ +# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -52,13 +52,8 @@ trap "rm -f $TMP" 0 1 2 5 15 cat < - -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - +#include #if NCURSES_EXPANDED EOF @@ -73,59 +68,29 @@ cat >$TMP </dev/null | \ - sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#if_/#if /' +$preprocessor $TMP 2>/dev/null | sed -e '1,/^IGNORE$/d' cat < -MODULE_ID("$Id: hardscroll.c,v 1.47 2010/04/24 23:46:47 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.42 2008/08/03 23:49:30 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) # undef screen_lines -# define screen_lines(sp) MAXLINES -NCURSES_EXPORT_VAR (int) - oldnums[MAXLINES]; -# define OLDNUM(sp,n) oldnums[n] +# define screen_lines MAXLINES +NCURSES_EXPORT_VAR(int) +oldnums[MAXLINES]; +# define OLDNUM(n) oldnums[n] # define _tracef printf # undef TR # define TR(n, a) if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); } -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; #else /* no debug */ /* OLDNUM(n) indicates which line will be shifted to the position n. if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from somewhere. */ -NCURSES_EXPORT_VAR (int *) - _nc_oldnums = 0; /* obsolete: keep for ABI compat */ +NCURSES_EXPORT_VAR(int *) +_nc_oldnums = 0; /* obsolete: keep for ABI compat */ # if USE_HASHMAP -# define oldnums(sp) (sp)->_oldnum_list -# define OLDNUM(sp,n) oldnums(sp)[n] +# define oldnums SP->_oldnum_list +# define OLDNUM(n) oldnums[n] # else /* !USE_HASHMAP */ -# define OLDNUM(sp,n) NewScreen(sp)->_line[n].oldindex +# define OLDNUM(n) newscr->_line[n].oldindex # endif /* !USE_HASHMAP */ -#define OLDNUM_SIZE(sp) (sp)->_oldnum_size +#define OLDNUM_SIZE SP->_oldnum_size #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) +_nc_scroll_optimize(void) /* scroll optimization to transform curscr to newscr */ { int i; int start, end, shift; - TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), (void *) SP_PARM)); + TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize"))); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) #if USE_HASHMAP /* get enough storage */ - if (OLDNUM_SIZE(SP_PARM) < screen_lines(SP_PARM)) { - int *new_oldnums = typeRealloc(int, - (size_t) screen_lines(SP_PARM), - oldnums(SP_PARM)); + if (OLDNUM_SIZE < screen_lines) { + int *new_oldnums = typeRealloc(int, screen_lines, oldnums); if (!new_oldnums) return; - oldnums(SP_PARM) = new_oldnums; - OLDNUM_SIZE(SP_PARM) = screen_lines(SP_PARM); + oldnums = new_oldnums; + OLDNUM_SIZE = screen_lines; } /* calculate the indices */ - NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG); + _nc_hash_map(); #endif #endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */ #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) { - NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_ARG); + _nc_linedump(); _nc_unlock_global(tracef); } #endif /* TRACE */ /* pass 1 - from top to bottom scrolling up */ - for (i = 0; i < screen_lines(SP_PARM);) { - while (i < screen_lines(SP_PARM) - && (OLDNUM(SP_PARM, i) == _NEWINDEX || OLDNUM(SP_PARM, i) <= i)) + for (i = 0; i < screen_lines;) { + while (i < screen_lines && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) <= i)) i++; - if (i >= screen_lines(SP_PARM)) + if (i >= screen_lines) break; - shift = OLDNUM(SP_PARM, i) - i; /* shift > 0 */ + shift = OLDNUM(i) - i; /* shift > 0 */ start = i; i++; - while (i < screen_lines(SP_PARM) - && OLDNUM(SP_PARM, i) != _NEWINDEX - && OLDNUM(SP_PARM, i) - i == shift) + while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i + == shift) i++; end = i - 1 + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx - shift, - start, - end, - screen_lines(SP_PARM) - 1) == ERR) { + if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -246,33 +238,23 @@ NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) } /* pass 2 - from bottom to top scrolling down */ - for (i = screen_lines(SP_PARM) - 1; i >= 0;) { - while (i >= 0 - && (OLDNUM(SP_PARM, i) == _NEWINDEX - || OLDNUM(SP_PARM, i) >= i)) { + for (i = screen_lines - 1; i >= 0;) { + while (i >= 0 && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) >= i)) i--; - } if (i < 0) break; - shift = OLDNUM(SP_PARM, i) - i; /* shift < 0 */ + shift = OLDNUM(i) - i; /* shift < 0 */ end = i; i--; - while (i >= 0 - && OLDNUM(SP_PARM, i) != _NEWINDEX - && OLDNUM(SP_PARM, i) - i == shift) { + while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) i--; - } start = i + 1 - (-shift); TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx - shift, - start, - end, - screen_lines(SP_PARM) - 1) == ERR) { + if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -281,41 +263,24 @@ NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) TR(TRACE_ICALLS, (T_RETURN(""))); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_scroll_optimize(void) -{ - NCURSES_SP_NAME(_nc_scroll_optimize) (CURRENT_SCREEN); -} -#endif - #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0) +_nc_linedump(void) /* dump the state of the real and virtual oldnum fields */ { int n; char *buf = 0; - size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4; + size_t want = (screen_lines + 1) * 4; if ((buf = typeMalloc(char, want)) != 0) { - *buf = '\0'; - for (n = 0; n < screen_lines(SP_PARM); n++) - (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(SP_PARM, n)); - TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf)); + (void) strcpy(buf, "virt"); + for (n = 0; n < screen_lines; n++) + (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n)); + TR(TRACE_UPDATE | TRACE_MOVE, (buf)); free(buf); } } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_linedump(void) -{ - NCURSES_SP_NAME(_nc_linedump) (CURRENT_SCREEN); -} -#endif - #endif /* defined(TRACE) || defined(SCROLLDEBUG) */ #ifdef SCROLLDEBUG diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index b670e1b9691..9b60df62d5c 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -68,12 +68,9 @@ AUTHOR *****************************************************************************/ #include +#include /* for back_color_erase */ -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - -MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $") +MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") #ifdef HASHDEBUG @@ -86,25 +83,25 @@ MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $") int oldnums[MAXLINES], reallines[MAXLINES]; static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH]; static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; -# define OLDNUM(sp,n) oldnums[n] -# define OLDTEXT(sp,n) oldtext[n] -# define NEWTEXT(sp,m) newtext[m] -# define PENDING(sp,n) 1 +# define OLDNUM(n) oldnums[n] +# define OLDTEXT(n) oldtext[n] +# define NEWTEXT(m) newtext[m] +# define PENDING(n) 1 #else /* !HASHDEBUG */ -# define OLDNUM(sp,n) (sp)->_oldnum_list[n] -# define OLDTEXT(sp,n) CurScreen(sp)->_line[n].text -# define NEWTEXT(sp,m) NewScreen(sp)->_line[m].text -# define TEXTWIDTH(sp) (CurScreen(sp)->_maxx + 1) -# define PENDING(sp,n) (NewScreen(sp)->_line[n].firstchar != _NOCHANGE) +# define OLDNUM(n) SP->_oldnum_list[n] +# define OLDTEXT(n) curscr->_line[n].text +# define NEWTEXT(m) newscr->_line[m].text +# define TEXTWIDTH (curscr->_maxx+1) +# define PENDING(n) (newscr->_line[n].firstchar != _NOCHANGE) #endif /* !HASHDEBUG */ -#define oldhash(sp) ((sp)->oldhash) -#define newhash(sp) ((sp)->newhash) -#define hashtab(sp) ((sp)->hashtab) -#define lines_alloc(sp) ((sp)->hashtab_len) +#define oldhash (SP->oldhash) +#define newhash (SP->newhash) +#define hashtab (SP->hashtab) +#define lines_alloc (SP->hashtab_len) #if USE_WIDEC_SUPPORT #define HASH_VAL(ch) (ch.chars[0]) @@ -115,26 +112,26 @@ static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_INLINE unsigned long -hash(SCREEN *sp, NCURSES_CH_T * text) +hash(NCURSES_CH_T * text) { int i; NCURSES_CH_T ch; unsigned long result = 0; - for (i = TEXTWIDTH(sp); i > 0; i--) { + for (i = TEXTWIDTH; i > 0; i--) { ch = *text++; - result += (result << 5) + (unsigned long) HASH_VAL(ch); + result += (result << 5) + HASH_VAL(ch); } return result; } /* approximate update cost */ static int -update_cost(SCREEN *sp, NCURSES_CH_T * from, NCURSES_CH_T * to) +update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) { int cost = 0; int i; - for (i = TEXTWIDTH(sp); i > 0; i--, from++, to++) + for (i = TEXTWIDTH; i > 0; i--, from++, to++) if (!(CharEq(*from, *to))) cost++; @@ -142,7 +139,7 @@ update_cost(SCREEN *sp, NCURSES_CH_T * from, NCURSES_CH_T * to) } static int -update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) +update_cost_from_blank(NCURSES_CH_T * to) { int cost = 0; int i; @@ -151,7 +148,7 @@ update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) if (back_color_erase) SetPair(blank, GetPair(stdscr->_nc_bkgd)); - for (i = TEXTWIDTH(sp); i > 0; i--, to++) + for (i = TEXTWIDTH; i > 0; i--, to++) if (!(CharEq(blank, *to))) cost++; @@ -163,14 +160,14 @@ update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) * effective. 'blank' indicates whether the line 'to' would become blank. */ static NCURSES_INLINE bool -cost_effective(SCREEN *sp, const int from, const int to, const bool blank) +cost_effective(const int from, const int to, const bool blank) { int new_from; if (from == to) return FALSE; - new_from = OLDNUM(sp, from); + new_from = OLDNUM(from); if (new_from == _NEWINDEX) new_from = from; @@ -178,17 +175,16 @@ cost_effective(SCREEN *sp, const int from, const int to, const bool blank) * On the left side of >= is the cost before moving; * on the right side -- cost after moving. */ - return (((blank ? update_cost_from_blank(sp, NEWTEXT(sp, to)) - : update_cost(sp, OLDTEXT(sp, to), NEWTEXT(sp, to))) - + update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) - >= ((new_from == from ? update_cost_from_blank(sp, NEWTEXT(sp, from)) - : update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) - + update_cost(sp, OLDTEXT(sp, from), NEWTEXT(sp, to)))) - ? TRUE : FALSE; + return (((blank ? update_cost_from_blank(NEWTEXT(to)) + : update_cost(OLDTEXT(to), NEWTEXT(to))) + + update_cost(OLDTEXT(new_from), NEWTEXT(from))) + >= ((new_from == from ? update_cost_from_blank(NEWTEXT(from)) + : update_cost(OLDTEXT(new_from), NEWTEXT(from))) + + update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE; } static void -grow_hunks(SCREEN *sp) +grow_hunks(void) { int start, end, shift; int back_limit, forward_limit; /* limits for cells to fill */ @@ -204,36 +200,35 @@ grow_hunks(SCREEN *sp) back_ref_limit = 0; i = 0; - while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) + while (i < screen_lines && OLDNUM(i) == _NEWINDEX) i++; - for (; i < screen_lines(sp); i = next_hunk) { + for (; i < screen_lines; i = next_hunk) { start = i; - shift = OLDNUM(sp, i) - i; + shift = OLDNUM(i) - i; /* get forward limit */ i = start + 1; - while (i < screen_lines(sp) - && OLDNUM(sp, i) != _NEWINDEX - && OLDNUM(sp, i) - i == shift) + while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i + == shift) i++; end = i; - while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) + while (i < screen_lines && OLDNUM(i) == _NEWINDEX) i++; next_hunk = i; forward_limit = i; - if (i >= screen_lines(sp) || OLDNUM(sp, i) >= i) + if (i >= screen_lines || OLDNUM(i) >= i) forward_ref_limit = i; else - forward_ref_limit = OLDNUM(sp, i); + forward_ref_limit = OLDNUM(i); i = start - 1; /* grow back */ if (shift < 0) back_limit = back_ref_limit + (-shift); while (i >= back_limit) { - if (newhash(sp)[i] == oldhash(sp)[i + shift] - || cost_effective(sp, i + shift, i, shift < 0)) { - OLDNUM(sp, i) = i + shift; + if (newhash[i] == oldhash[i + shift] + || cost_effective(i + shift, i, shift < 0)) { + OLDNUM(i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (backward continuation)", i, i + shift)); @@ -251,9 +246,9 @@ grow_hunks(SCREEN *sp) if (shift > 0) forward_limit = forward_ref_limit - shift; while (i < forward_limit) { - if (newhash(sp)[i] == oldhash(sp)[i + shift] - || cost_effective(sp, i + shift, i, shift > 0)) { - OLDNUM(sp, i) = i + shift; + if (newhash[i] == oldhash[i + shift] + || cost_effective(i + shift, i, shift > 0)) { + OLDNUM(i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (forward continuation)", i, i + shift)); @@ -273,54 +268,51 @@ grow_hunks(SCREEN *sp) } NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) +_nc_hash_map(void) { - HASHMAP *hsp; + HASHMAP *sp; register int i; int start, shift, size; - if (screen_lines(SP_PARM) > lines_alloc(SP_PARM)) { - if (hashtab(SP_PARM)) - free(hashtab(SP_PARM)); - hashtab(SP_PARM) = typeMalloc(HASHMAP, - ((size_t) screen_lines(SP_PARM) + 1) * 2); - if (!hashtab(SP_PARM)) { - if (oldhash(SP_PARM)) { - FreeAndNull(oldhash(SP_PARM)); + if (screen_lines > lines_alloc) { + if (hashtab) + free(hashtab); + hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2); + if (!hashtab) { + if (oldhash) { + FreeAndNull(oldhash); } - lines_alloc(SP_PARM) = 0; + lines_alloc = 0; return; } - lines_alloc(SP_PARM) = screen_lines(SP_PARM); + lines_alloc = screen_lines; } - if (oldhash(SP_PARM) && newhash(SP_PARM)) { + if (oldhash && newhash) { /* re-hash only changed lines */ - for (i = 0; i < screen_lines(SP_PARM); i++) { - if (PENDING(SP_PARM, i)) - newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); + for (i = 0; i < screen_lines; i++) { + if (PENDING(i)) + newhash[i] = hash(NEWTEXT(i)); } } else { /* re-hash all */ - if (oldhash(SP_PARM) == 0) - oldhash(SP_PARM) = typeCalloc(unsigned long, - (size_t) screen_lines(SP_PARM)); - if (newhash(SP_PARM) == 0) - newhash(SP_PARM) = typeCalloc(unsigned long, - (size_t) screen_lines(SP_PARM)); - if (!oldhash(SP_PARM) || !newhash(SP_PARM)) + if (oldhash == 0) + oldhash = typeCalloc(unsigned long, (unsigned) screen_lines); + if (newhash == 0) + newhash = typeCalloc(unsigned long, (unsigned) screen_lines); + if (!oldhash || !newhash) return; /* malloc failure */ - for (i = 0; i < screen_lines(SP_PARM); i++) { - newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); - oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); + for (i = 0; i < screen_lines; i++) { + newhash[i] = hash(NEWTEXT(i)); + oldhash[i] = hash(OLDTEXT(i)); } } #ifdef HASH_VERIFY - for (i = 0; i < screen_lines(SP_PARM); i++) { - if (newhash(SP_PARM)[i] != hash(SP_PARM, NEWTEXT(SP_PARM, i))) + for (i = 0; i < screen_lines; i++) { + if (newhash[i] != hash(NEWTEXT(i))) fprintf(stderr, "error in newhash[%d]\n", i); - if (oldhash(SP_PARM)[i] != hash(SP_PARM, OLDTEXT(SP_PARM, i))) + if (oldhash[i] != hash(OLDTEXT(i))) fprintf(stderr, "error in oldhash[%d]\n", i); } #endif @@ -328,30 +320,28 @@ NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) /* * Set up and count line-hash values. */ - memset(hashtab(SP_PARM), '\0', - sizeof(*(hashtab(SP_PARM))) - * ((size_t) screen_lines(SP_PARM) + 1) * 2); - for (i = 0; i < screen_lines(SP_PARM); i++) { - unsigned long hashval = oldhash(SP_PARM)[i]; + memset(hashtab, '\0', sizeof(*hashtab) * (screen_lines + 1) * 2); + for (i = 0; i < screen_lines; i++) { + unsigned long hashval = oldhash[i]; - for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) - if (hsp->hashval == hashval) + for (sp = hashtab; sp->hashval; sp++) + if (sp->hashval == hashval) break; - hsp->hashval = hashval; /* in case this is a new entry */ - hsp->oldcount++; - hsp->oldindex = i; + sp->hashval = hashval; /* in case this is a new entry */ + sp->oldcount++; + sp->oldindex = i; } - for (i = 0; i < screen_lines(SP_PARM); i++) { - unsigned long hashval = newhash(SP_PARM)[i]; + for (i = 0; i < screen_lines; i++) { + unsigned long hashval = newhash[i]; - for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) - if (hsp->hashval == hashval) + for (sp = hashtab; sp->hashval; sp++) + if (sp->hashval == hashval) break; - hsp->hashval = hashval; /* in case this is a new entry */ - hsp->newcount++; - hsp->newindex = i; + sp->hashval = hashval; /* in case this is a new entry */ + sp->newcount++; + sp->newindex = i; - OLDNUM(SP_PARM, i) = _NEWINDEX; /* initialize old indices array */ + OLDNUM(i) = _NEWINDEX; /* initialize old indices array */ } /* @@ -361,16 +351,16 @@ NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) * extending hunks by cost_effective. Otherwise, it does not * have any side effects. */ - for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) - if (hsp->oldcount == 1 && hsp->newcount == 1 - && hsp->oldindex != hsp->newindex) { + for (sp = hashtab; sp->hashval; sp++) + if (sp->oldcount == 1 && sp->newcount == 1 + && sp->oldindex != sp->newindex) { TR(TRACE_UPDATE | TRACE_MOVE, ("new line %d is hash-identical to old line %d (unique)", - hsp->newindex, hsp->oldindex)); - OLDNUM(SP_PARM, hsp->newindex) = hsp->oldindex; + sp->newindex, sp->oldindex)); + OLDNUM(sp->newindex) = sp->oldindex; } - grow_hunks(SP_PARM); + grow_hunks(); /* * Eliminate bad or impossible shifts -- this includes removing @@ -378,83 +368,58 @@ NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) * those which are to be moved too far, they are likely to destroy * more than carry. */ - for (i = 0; i < screen_lines(SP_PARM);) { - while (i < screen_lines(SP_PARM) && OLDNUM(SP_PARM, i) == _NEWINDEX) + for (i = 0; i < screen_lines;) { + while (i < screen_lines && OLDNUM(i) == _NEWINDEX) i++; - if (i >= screen_lines(SP_PARM)) + if (i >= screen_lines) break; start = i; - shift = OLDNUM(SP_PARM, i) - i; + shift = OLDNUM(i) - i; i++; - while (i < screen_lines(SP_PARM) - && OLDNUM(SP_PARM, i) != _NEWINDEX - && OLDNUM(SP_PARM, i) - i == shift) + while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i + == shift) i++; size = i - start; if (size < 3 || size + min(size / 8, 2) < abs(shift)) { while (start < i) { - OLDNUM(SP_PARM, start) = _NEWINDEX; + OLDNUM(start) = _NEWINDEX; start++; } } } /* After clearing invalid hunks, try grow the rest. */ - grow_hunks(SP_PARM); + grow_hunks(); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_hash_map(void) -{ - NCURSES_SP_NAME(_nc_hash_map) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_DCLx int i) -{ - if (oldhash(SP_PARM)) - oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_make_oldhash(int i) { - NCURSES_SP_NAME(_nc_make_oldhash) (CURRENT_SCREEN, i); + if (oldhash) + oldhash[i] = hash(OLDTEXT(i)); } -#endif NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_DCLx int n, int top, int bot) +_nc_scroll_oldhash(int n, int top, int bot) { size_t size; int i; - if (!oldhash(SP_PARM)) + if (!oldhash) return; - size = sizeof(*(oldhash(SP_PARM))) * (size_t) (bot - top + 1 - abs(n)); + size = sizeof(*oldhash) * (bot - top + 1 - abs(n)); if (n > 0) { - memmove(oldhash(SP_PARM) + top, oldhash(SP_PARM) + top + n, size); + memmove(oldhash + top, oldhash + top + n, size); for (i = bot; i > bot - n; i--) - oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); + oldhash[i] = hash(OLDTEXT(i)); } else { - memmove(oldhash(SP_PARM) + top - n, oldhash(SP_PARM) + top, size); + memmove(oldhash + top - n, oldhash + top, size); for (i = top; i < top - n; i++) - oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); + oldhash[i] = hash(OLDTEXT(i)); } } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_scroll_oldhash(int n, int top, int bot) -{ - NCURSES_SP_NAME(_nc_scroll_oldhash) (CURRENT_SCREEN, n, top, bot); -} -#endif - #ifdef HASHDEBUG static void usage(void) diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index ad41f8dd72d..8e66fa3bf64 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -110,8 +109,8 @@ * LONG_DIST and (b) further inward from the right or left edge than LONG_DIST, * we'll consider nonlocal. */ -#define NOT_LOCAL(sp, fy, fx, ty, tx) ((tx > LONG_DIST) \ - && (tx < screen_columns(sp) - 1 - LONG_DIST) \ +#define NOT_LOCAL(fy, fx, ty, tx) ((tx > LONG_DIST) \ + && (tx < screen_columns - 1 - LONG_DIST) \ && (abs(ty-fy) + abs(tx-fx) > LONG_DIST)) /**************************************************************************** @@ -153,21 +152,13 @@ */ #include +#include #include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +MODULE_ID("$Id: lib_mvcur.c,v 1.113 2008/08/16 19:30:58 tom Exp $") -MODULE_ID("$Id: lib_mvcur.c,v 1.126 2011/01/22 19:48:21 tom Exp $") - -#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ - -#if NCURSES_SP_FUNCS -#define BAUDRATE(sp) sp->_term->_baudrate /* bits per second */ -#else -#define BAUDRATE(sp) cur_term->_baudrate /* bits per second */ -#endif +#define WANT_CHAR(y, x) SP->_newscr->_line[y].text[x] /* desired state */ +#define BAUDRATE cur_term->_baudrate /* bits per second */ #if defined(MAIN) || defined(NCURSES_TEST) #include @@ -178,7 +169,7 @@ static float diff; #define OPT_SIZE 512 -static int normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt); +static int normalized_cost(const char *const cap, int affcnt); /**************************************************************************** * @@ -188,34 +179,34 @@ static int normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt); #ifdef TRACE static int -trace_cost_of(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) +trace_cost_of(const char *capname, const char *cap, int affcnt) { - int result = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); + int result = _nc_msec_cost(cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("CostOf %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define CostOf(cap,affcnt) trace_cost_of(NCURSES_SP_ARGx #cap, cap, affcnt) +#define CostOf(cap,affcnt) trace_cost_of(#cap,cap,affcnt); static int -trace_normalized_cost(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) +trace_normalized_cost(const char *capname, const char *cap, int affcnt) { - int result = normalized_cost(NCURSES_SP_ARGx cap, affcnt); + int result = normalized_cost(cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define NormalizedCost(cap,affcnt) trace_normalized_cost(NCURSES_SP_ARGx #cap, cap, affcnt) +#define NormalizedCost(cap,affcnt) trace_normalized_cost(#cap,cap,affcnt); #else -#define CostOf(cap,affcnt) NCURSES_SP_NAME(_nc_msec_cost)(NCURSES_SP_ARGx cap, affcnt) -#define NormalizedCost(cap,affcnt) normalized_cost(NCURSES_SP_ARGx cap, affcnt) +#define CostOf(cap,affcnt) _nc_msec_cost(cap,affcnt); +#define NormalizedCost(cap,affcnt) normalized_cost(cap,affcnt); #endif NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcnt) +_nc_msec_cost(const char *const cap, int affcnt) /* compute the cost of a given operation */ { if (cap == 0) @@ -231,68 +222,53 @@ NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcn for (cp += 2; *cp != '>'; cp++) { if (isdigit(UChar(*cp))) - number = number * 10 + (float) (*cp - '0'); + number = number * 10 + (*cp - '0'); else if (*cp == '*') - number *= (float) affcnt; + number *= affcnt; else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) - number += (float) ((*cp - '0') / 10.0); + number += (*cp - '0') / 10.0; } #if NCURSES_NO_PADDING - if (!GetNoPadding(SP_PARM)) + if (!GetNoPadding(SP)) #endif cum_cost += number * 10; - } else if (SP_PARM) { - cum_cost += (float) SP_PARM->_char_padding; - } + } else + cum_cost += SP->_char_padding; } return ((int) cum_cost); } } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -_nc_msec_cost(const char *const cap, int affcnt) -{ - return NCURSES_SP_NAME(_nc_msec_cost) (CURRENT_SCREEN, cap, affcnt); -} -#endif - static int -normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt) +normalized_cost(const char *const cap, int affcnt) /* compute the effective character-count for an operation (round up) */ { - int cost = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); + int cost = _nc_msec_cost(cap, affcnt); if (cost != INFINITY) - cost = (cost + SP_PARM->_char_padding - 1) / SP_PARM->_char_padding; + cost = (cost + SP->_char_padding - 1) / SP->_char_padding; return cost; } static void -reset_scroll_region(NCURSES_SP_DCL0) +reset_scroll_region(void) /* Set the scroll-region to a known state (the default) */ { if (change_scroll_region) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "change_scroll_region", - TPARM_2(change_scroll_region, - 0, screen_lines(SP_PARM) - 1)); + TPUTS_TRACE("change_scroll_region"); + putp(TPARM_2(change_scroll_region, 0, screen_lines - 1)); } } NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0) +_nc_mvcur_resume(void) /* what to do at initialization time and after each shellout */ { - if (SP_PARM && !IsTermInfo(SP_PARM)) - return; - /* initialize screen for cursor access */ if (enter_ca_mode) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "enter_ca_mode", - enter_ca_mode); + TPUTS_TRACE("enter_ca_mode"); + putp(enter_ca_mode); } /* @@ -304,63 +280,53 @@ NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0) * they know the screen size. This is useful when you're running * a vt100 emulation through xterm. */ - reset_scroll_region(NCURSES_SP_ARG); - SP_PARM->_cursrow = SP_PARM->_curscol = -1; + reset_scroll_region(); + SP->_cursrow = SP->_curscol = -1; /* restore cursor shape */ - if (SP_PARM->_cursor != -1) { - int cursor = SP_PARM->_cursor; - SP_PARM->_cursor = -1; - NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx cursor); + if (SP->_cursor != -1) { + int cursor = SP->_cursor; + SP->_cursor = -1; + curs_set(cursor); } } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_resume(void) -{ - NCURSES_SP_NAME(_nc_mvcur_resume) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) +_nc_mvcur_init(void) /* initialize the cost structure */ { - if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp))) - SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10) - / (BAUDRATE(SP_PARM) > 0 - ? BAUDRATE(SP_PARM) - : 9600)); + if (isatty(fileno(SP->_ofp))) + SP->_char_padding = ((BAUDBYTE * 1000 * 10) + / (BAUDRATE > 0 ? BAUDRATE : 9600)); else - SP_PARM->_char_padding = 1; /* must be nonzero */ - if (SP_PARM->_char_padding <= 0) - SP_PARM->_char_padding = 1; /* must be nonzero */ - TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP_PARM->_char_padding)); + SP->_char_padding = 1; /* must be nonzero */ + if (SP->_char_padding <= 0) + SP->_char_padding = 1; /* must be nonzero */ + TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP->_char_padding)); /* non-parameterized local-motion strings */ - SP_PARM->_cr_cost = CostOf(carriage_return, 0); - SP_PARM->_home_cost = CostOf(cursor_home, 0); - SP_PARM->_ll_cost = CostOf(cursor_to_ll, 0); + SP->_cr_cost = CostOf(carriage_return, 0); + SP->_home_cost = CostOf(cursor_home, 0); + SP->_ll_cost = CostOf(cursor_to_ll, 0); #if USE_HARD_TABS if (getenv("NCURSES_NO_HARD_TABS") == 0) { - SP_PARM->_ht_cost = CostOf(tab, 0); - SP_PARM->_cbt_cost = CostOf(back_tab, 0); + SP->_ht_cost = CostOf(tab, 0); + SP->_cbt_cost = CostOf(back_tab, 0); } else { - SP_PARM->_ht_cost = INFINITY; - SP_PARM->_cbt_cost = INFINITY; + SP->_ht_cost = INFINITY; + SP->_cbt_cost = INFINITY; } #endif /* USE_HARD_TABS */ - SP_PARM->_cub1_cost = CostOf(cursor_left, 0); - SP_PARM->_cuf1_cost = CostOf(cursor_right, 0); - SP_PARM->_cud1_cost = CostOf(cursor_down, 0); - SP_PARM->_cuu1_cost = CostOf(cursor_up, 0); + SP->_cub1_cost = CostOf(cursor_left, 0); + SP->_cuf1_cost = CostOf(cursor_right, 0); + SP->_cud1_cost = CostOf(cursor_down, 0); + SP->_cuu1_cost = CostOf(cursor_up, 0); - SP_PARM->_smir_cost = CostOf(enter_insert_mode, 0); - SP_PARM->_rmir_cost = CostOf(exit_insert_mode, 0); - SP_PARM->_ip_cost = 0; + SP->_smir_cost = CostOf(enter_insert_mode, 0); + SP->_rmir_cost = CostOf(exit_insert_mode, 0); + SP->_ip_cost = 0; if (insert_padding) { - SP_PARM->_ip_cost = CostOf(insert_padding, 0); + SP->_ip_cost = CostOf(insert_padding, 0); } /* @@ -369,7 +335,7 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) * can treat it like absolute screen addressing. This seems to be true * for all cursor_mem_address terminal types in the terminfo database. */ - SP_PARM->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; + SP->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; /* * Parametrized local-motion strings. This static cost computation @@ -395,43 +361,40 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) * All these averages depend on the assumption that all parameter values * are equally probable. */ - SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1); - SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); - SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); - SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); - SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); - SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); - SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); + SP->_cup_cost = CostOf(TPARM_2(SP->_address_cursor, 23, 23), 1); + SP->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); + SP->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); + SP->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); + SP->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); + SP->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); + SP->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); /* non-parameterized screen-update strings */ - SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1); - SP_PARM->_el_cost = NormalizedCost(clr_eol, 1); - SP_PARM->_el1_cost = NormalizedCost(clr_bol, 1); - SP_PARM->_dch1_cost = NormalizedCost(delete_character, 1); - SP_PARM->_ich1_cost = NormalizedCost(insert_character, 1); + SP->_ed_cost = NormalizedCost(clr_eos, 1); + SP->_el_cost = NormalizedCost(clr_eol, 1); + SP->_el1_cost = NormalizedCost(clr_bol, 1); + SP->_dch1_cost = NormalizedCost(delete_character, 1); + SP->_ich1_cost = NormalizedCost(insert_character, 1); /* * If this is a bce-terminal, we want to bias the choice so we use clr_eol * rather than spaces at the end of a line. */ if (back_color_erase) - SP_PARM->_el_cost = 0; + SP->_el_cost = 0; /* parameterized screen-update strings */ - SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); - SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); - SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); - SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); + SP->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); + SP->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); + SP->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); + SP->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); - SP_PARM->_cup_ch_cost = NormalizedCost( - TPARM_2(SP_PARM->_address_cursor, - 23, 23), - 1); - SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); - SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); - SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost, - min(SP_PARM->_hpa_ch_cost, - SP_PARM->_cuf_ch_cost)); + SP->_cup_ch_cost = NormalizedCost(TPARM_2(SP->_address_cursor, 23, 23), 1); + SP->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); + SP->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); + SP->_inline_cost = min(SP->_cup_ch_cost, + min(SP->_hpa_ch_cost, + SP->_cuf_ch_cost)); /* * If save_cursor is used within enter_ca_mode, we should not use it for @@ -448,42 +411,30 @@ NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) } /* - * A different, possibly better way to arrange this would be to set the - * SCREEN's _endwin to TRUE at window initialization time and let this be + * A different, possibly better way to arrange this would be to set + * SP->_endwin = TRUE at window initialization time and let this be * called by doupdate's return-from-shellout code. */ - NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); + _nc_mvcur_resume(); } -#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_init(void) -{ - NCURSES_SP_NAME(_nc_mvcur_init) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0) +_nc_mvcur_wrap(void) /* wrap up cursor-addressing mode */ { /* leave cursor at screen bottom */ - TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0); - - if (!SP_PARM || !IsTermInfo(SP_PARM)) - return; + mvcur(-1, -1, screen_lines - 1, 0); /* set cursor to normal mode */ - if (SP_PARM->_cursor != -1) { - int cursor = SP_PARM->_cursor; - NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx 1); - SP_PARM->_cursor = cursor; + if (SP->_cursor != -1) { + int cursor = SP->_cursor; + curs_set(1); + SP->_cursor = cursor; } if (exit_ca_mode) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "exit_ca_mode", - exit_ca_mode); + TPUTS_TRACE("exit_ca_mode"); + putp(exit_ca_mode); } /* * Reset terminal's tab counter. There's a long-time bug that @@ -493,17 +444,9 @@ NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0) * escape sequences that reset things as column positions. * Utter a \r to reset this invisibly. */ - NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); + _nc_outch('\r'); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_mvcur_wrap(void) -{ - NCURSES_SP_NAME(_nc_mvcur_wrap) (CURRENT_SCREEN); -} -#endif - /**************************************************************************** * * Optimized cursor movement @@ -516,7 +459,7 @@ _nc_mvcur_wrap(void) static NCURSES_INLINE int repeated_append(string_desc * target, int total, int num, int repeat, const char *src) { - size_t need = (size_t) repeat * strlen(src); + size_t need = repeat * strlen(src); if (need < target->s_size) { while (repeat-- > 0) { @@ -543,13 +486,8 @@ repeated_append(string_desc * target, int total, int num, int repeat, const char #define LASTTAB(fr) ((fr > 0) ? ((fr - 1) / init_tabs) * init_tabs : -1) static int -relative_move(NCURSES_SP_DCLx - string_desc * target, - int from_y, - int from_x, - int to_y, - int to_x, - bool ovw) +relative_move(string_desc * target, int from_y, int from_x, int to_y, int + to_x, bool ovw) /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */ { string_desc save; @@ -562,38 +500,38 @@ relative_move(NCURSES_SP_DCLx if (row_address != 0 && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) { - vcost = SP_PARM->_vpa_cost; + vcost = SP->_vpa_cost; } if (to_y > from_y) { n = (to_y - from_y); if (parm_down_cursor - && SP_PARM->_cud_cost < vcost + && SP->_cud_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_down_cursor, n))) { - vcost = SP_PARM->_cud_cost; + vcost = SP->_cud_cost; } if (cursor_down - && (*cursor_down != '\n' || SP_PARM->_nl) - && (n * SP_PARM->_cud1_cost < vcost)) { + && (*cursor_down != '\n' || SP->_nl) + && (n * SP->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP_PARM->_cud1_cost, n, cursor_down); + SP->_cud1_cost, n, cursor_down); } } else { /* (to_y < from_y) */ n = (from_y - to_y); if (parm_up_cursor - && SP_PARM->_cuu_cost < vcost + && SP->_cuu_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_up_cursor, n))) { - vcost = SP_PARM->_cuu_cost; + vcost = SP->_cuu_cost; } - if (cursor_up && (n * SP_PARM->_cuu1_cost < vcost)) { + if (cursor_up && (n * SP->_cuu1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP_PARM->_cuu1_cost, n, cursor_up); + SP->_cuu1_cost, n, cursor_up); } } @@ -612,17 +550,17 @@ relative_move(NCURSES_SP_DCLx if (column_address && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(column_address, to_x))) { - hcost = SP_PARM->_hpa_cost; + hcost = SP->_hpa_cost; } if (to_x > from_x) { n = to_x - from_x; if (parm_right_cursor - && SP_PARM->_cuf_cost < hcost + && SP->_cuf_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_right_cursor, n))) { - hcost = SP_PARM->_cuf_cost; + hcost = SP->_cuf_cost; } if (cursor_right) { @@ -637,7 +575,7 @@ relative_move(NCURSES_SP_DCLx for (fr = from_x; (nxt = NEXTTAB(fr)) <= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP_PARM->_ht_cost, 1, tab); + SP->_ht_cost, 1, tab); if (lhcost == INFINITY) break; } @@ -661,7 +599,7 @@ relative_move(NCURSES_SP_DCLx && n < (int) check.s_size && vcost == 0 && str[0] == '\0') { - int wanted = CharOf(WANT_CHAR(SP_PARM, to_y, from_x)); + int wanted = CharOf(WANT_CHAR(to_y, from_x)); if (is8bits(wanted) && isdigit(wanted)) ovw = FALSE; } @@ -678,8 +616,8 @@ relative_move(NCURSES_SP_DCLx int i; for (i = 0; i < n; i++) { - NCURSES_CH_T ch = WANT_CHAR(SP_PARM, to_y, from_x + i); - if (!SameAttrOf(ch, SCREEN_ATTRS(SP_PARM)) + NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i); + if (!SameAttrOf(ch, SCREEN_ATTRS(SP)) #if USE_WIDEC_SUPPORT || !Charable(ch) #endif @@ -693,13 +631,13 @@ relative_move(NCURSES_SP_DCLx int i; for (i = 0; i < n; i++) - *check.s_tail++ = (char) CharOf(WANT_CHAR(SP_PARM, to_y, + *check.s_tail++ = (char) CharOf(WANT_CHAR(to_y, from_x + i)); *check.s_tail = '\0'; - check.s_size -= (size_t) n; - lhcost += n * SP_PARM->_char_padding; + check.s_size -= n; + lhcost += n * SP->_char_padding; } else { - lhcost = repeated_append(&check, lhcost, SP_PARM->_cuf1_cost, + lhcost = repeated_append(&check, lhcost, SP->_cuf1_cost, n, cursor_right); } @@ -712,10 +650,10 @@ relative_move(NCURSES_SP_DCLx n = from_x - to_x; if (parm_left_cursor - && SP_PARM->_cub_cost < hcost + && SP->_cub_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_left_cursor, n))) { - hcost = SP_PARM->_cub_cost; + hcost = SP->_cub_cost; } if (cursor_left) { @@ -729,8 +667,7 @@ relative_move(NCURSES_SP_DCLx for (fr = from_x; (nxt = LASTTAB(fr)) >= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP_PARM->_cbt_cost, - 1, back_tab); + SP->_cbt_cost, 1, back_tab); if (lhcost == INFINITY) break; } @@ -739,9 +676,7 @@ relative_move(NCURSES_SP_DCLx } #endif /* USE_HARD_TABS */ - lhcost = repeated_append(&check, lhcost, - SP_PARM->_cub1_cost, - n, cursor_left); + lhcost = repeated_append(&check, lhcost, SP->_cub1_cost, n, cursor_left); if (lhcost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), str)) { @@ -770,7 +705,7 @@ relative_move(NCURSES_SP_DCLx */ static NCURSES_INLINE int -onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) +onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) /* onscreen move from (yold, xold) to (ynew, xnew) */ { string_desc result; @@ -788,9 +723,9 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) #define InitResult _nc_str_init(&result, buffer, sizeof(buffer)) /* tactic #0: use direct cursor addressing */ - if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) { + if (_nc_safe_strcpy(InitResult, TPARM_2(SP->_address_cursor, ynew, xnew))) { tactic = 0; - usecost = SP_PARM->_cup_cost; + usecost = SP->_cup_cost; #if defined(TRACE) || defined(NCURSES_TEST) if (!(_nc_optimize_enable & OPTIMIZE_MVCUR)) @@ -805,7 +740,7 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) * (like, say, local-movement \n getting mapped to some obscure * character because A_ALTCHARSET is on). */ - if (yold == -1 || xold == -1 || NOT_LOCAL(SP_PARM, yold, xold, ynew, xnew)) { + if (yold == -1 || xold == -1 || NOT_LOCAL(yold, xold, ynew, xnew)) { #if defined(MAIN) || defined(NCURSES_TEST) if (!profiling) { (void) fputs("nonlocal\n", stderr); @@ -819,10 +754,8 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) #ifndef NO_OPTIMIZE /* tactic #1: use local movement */ if (yold != -1 && xold != -1 - && ((newcost = relative_move(NCURSES_SP_ARGx - NullResult, - yold, xold, - ynew, xnew, ovw)) != INFINITY) + && ((newcost = relative_move(NullResult, yold, xold, ynew, xnew, + ovw)) != INFINITY) && newcost < usecost) { tactic = 1; usecost = newcost; @@ -830,51 +763,42 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) /* tactic #2: use carriage-return + local movement */ if (yold != -1 && carriage_return - && ((newcost = relative_move(NCURSES_SP_ARGx - NullResult, - yold, 0, - ynew, xnew, ovw)) != INFINITY) - && SP_PARM->_cr_cost + newcost < usecost) { + && ((newcost = relative_move(NullResult, yold, 0, ynew, xnew, ovw)) + != INFINITY) + && SP->_cr_cost + newcost < usecost) { tactic = 2; - usecost = SP_PARM->_cr_cost + newcost; + usecost = SP->_cr_cost + newcost; } /* tactic #3: use home-cursor + local movement */ if (cursor_home - && ((newcost = relative_move(NCURSES_SP_ARGx - NullResult, - 0, 0, - ynew, xnew, ovw)) != INFINITY) - && SP_PARM->_home_cost + newcost < usecost) { + && ((newcost = relative_move(NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY) + && SP->_home_cost + newcost < usecost) { tactic = 3; - usecost = SP_PARM->_home_cost + newcost; + usecost = SP->_home_cost + newcost; } /* tactic #4: use home-down + local movement */ if (cursor_to_ll - && ((newcost = relative_move(NCURSES_SP_ARGx - NullResult, - screen_lines(SP_PARM) - 1, 0, - ynew, xnew, ovw)) != INFINITY) - && SP_PARM->_ll_cost + newcost < usecost) { + && ((newcost = relative_move(NullResult, screen_lines - 1, 0, ynew, + xnew, ovw)) != INFINITY) + && SP->_ll_cost + newcost < usecost) { tactic = 4; - usecost = SP_PARM->_ll_cost + newcost; + usecost = SP->_ll_cost + newcost; } /* * tactic #5: use left margin for wrap to right-hand side, * unless strange wrap behavior indicated by xenl might hose us. */ - t5_cr_cost = (xold > 0 ? SP_PARM->_cr_cost : 0); + t5_cr_cost = (xold > 0 ? SP->_cr_cost : 0); if (auto_left_margin && !eat_newline_glitch && yold > 0 && cursor_left - && ((newcost = relative_move(NCURSES_SP_ARGx - NullResult, - yold - 1, screen_columns(SP_PARM) - 1, - ynew, xnew, ovw)) != INFINITY) - && t5_cr_cost + SP_PARM->_cub1_cost + newcost < usecost) { + && ((newcost = relative_move(NullResult, yold - 1, screen_columns - + 1, ynew, xnew, ovw)) != INFINITY) + && t5_cr_cost + SP->_cub1_cost + newcost < usecost) { tactic = 5; - usecost = t5_cr_cost + SP_PARM->_cub1_cost + newcost; + usecost = t5_cr_cost + SP->_cub1_cost + newcost; } /* @@ -884,39 +808,26 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) InitResult; switch (tactic) { case 1: - (void) relative_move(NCURSES_SP_ARGx - &result, - yold, xold, - ynew, xnew, ovw); + (void) relative_move(&result, yold, xold, ynew, xnew, ovw); break; case 2: (void) _nc_safe_strcpy(&result, carriage_return); - (void) relative_move(NCURSES_SP_ARGx - &result, - yold, 0, - ynew, xnew, ovw); + (void) relative_move(&result, yold, 0, ynew, xnew, ovw); break; case 3: (void) _nc_safe_strcpy(&result, cursor_home); - (void) relative_move(NCURSES_SP_ARGx - &result, 0, 0, - ynew, xnew, ovw); + (void) relative_move(&result, 0, 0, ynew, xnew, ovw); break; case 4: (void) _nc_safe_strcpy(&result, cursor_to_ll); - (void) relative_move(NCURSES_SP_ARGx - &result, - screen_lines(SP_PARM) - 1, 0, - ynew, xnew, ovw); + (void) relative_move(&result, screen_lines - 1, 0, ynew, xnew, ovw); break; case 5: if (xold > 0) (void) _nc_safe_strcat(&result, carriage_return); (void) _nc_safe_strcat(&result, cursor_left); - (void) relative_move(NCURSES_SP_ARGx - &result, - yold - 1, screen_columns(SP_PARM) - 1, - ynew, xnew, ovw); + (void) relative_move(&result, yold - 1, screen_columns - 1, ynew, + xnew, ovw); break; } #endif /* !NO_OPTIMIZE */ @@ -934,26 +845,25 @@ onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) if (usecost != INFINITY) { TPUTS_TRACE("mvcur"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - buffer, 1, NCURSES_SP_NAME(_nc_outch)); - SP_PARM->_cursrow = ynew; - SP_PARM->_curscol = xnew; + tputs(buffer, 1, _nc_outch); + SP->_cursrow = ynew; + SP->_curscol = xnew; return (OK); } else return (ERR); } NCURSES_EXPORT(int) -TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) +mvcur(int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { NCURSES_CH_T oldattr; int code; - TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), - (void *) SP_PARM, yold, xold, ynew, xnew)); + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"), + yold, xold, ynew, xnew)); - if (SP_PARM == 0) { + if (SP == 0) { code = ERR; } else if (yold == ynew && xold == xnew) { code = OK; @@ -964,9 +874,9 @@ TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) * column position implied by wraparound or the lack thereof and * rolling up the screen to get ynew on the screen. */ - if (xnew >= screen_columns(SP_PARM)) { - ynew += xnew / screen_columns(SP_PARM); - xnew %= screen_columns(SP_PARM); + if (xnew >= screen_columns) { + ynew += xnew / screen_columns; + xnew %= screen_columns; } /* @@ -974,40 +884,38 @@ TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) * character set -- these have a strong tendency to screw up the CR & * LF used for local character motions! */ - oldattr = SCREEN_ATTRS(SP_PARM); + oldattr = SCREEN_ATTRS(SP); if ((AttrOf(oldattr) & A_ALTCHARSET) || (AttrOf(oldattr) && !move_standout_mode)) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(SP_PARM, A_NORMAL, 0); + (void) VIDATTR(A_NORMAL, 0); } - if (xold >= screen_columns(SP_PARM)) { + if (xold >= screen_columns) { int l; - if (SP_PARM->_nl) { - l = (xold + 1) / screen_columns(SP_PARM); + if (SP->_nl) { + l = (xold + 1) / screen_columns; yold += l; - if (yold >= screen_lines(SP_PARM)) - l -= (yold - screen_lines(SP_PARM) - 1); + if (yold >= screen_lines) + l -= (yold - screen_lines - 1); if (l > 0) { if (carriage_return) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "carriage_return", - carriage_return); + TPUTS_TRACE("carriage_return"); + putp(carriage_return); } else - NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); + _nc_outch('\r'); xold = 0; while (l > 0) { if (newline) { - NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx - "newline", - newline); + TPUTS_TRACE("newline"); + putp(newline); } else - NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n'); + _nc_outch('\n'); l--; } } @@ -1021,35 +929,27 @@ TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) } } - if (yold > screen_lines(SP_PARM) - 1) - yold = screen_lines(SP_PARM) - 1; - if (ynew > screen_lines(SP_PARM) - 1) - ynew = screen_lines(SP_PARM) - 1; + if (yold > screen_lines - 1) + yold = screen_lines - 1; + if (ynew > screen_lines - 1) + ynew = screen_lines - 1; /* destination location is on screen now */ - code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE); + code = onscreen_mvcur(yold, xold, ynew, xnew, TRUE); /* * Restore attributes if we disabled them before moving. */ - if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP_PARM))) { + if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP))) { TR(TRACE_CHARPUT, ("turning on (%#lx) %s after move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(SP_PARM, AttrOf(oldattr), GetPair(oldattr)); + (void) VIDATTR(AttrOf(oldattr), GetPair(oldattr)); } } returnCode(code); } -#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) -NCURSES_EXPORT(int) -mvcur(int yold, int xold, int ynew, int xnew) -{ - return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew); -} -#endif - #if defined(TRACE) || defined(NCURSES_TEST) NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; #endif @@ -1312,25 +1212,25 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) speeds[i], overhead, totalest); } } else if (buf[0] == 'c') { - (void) printf("char padding: %d\n", CURRENT_SCREEN->_char_padding); - (void) printf("cr cost: %d\n", CURRENT_SCREEN->_cr_cost); - (void) printf("cup cost: %d\n", CURRENT_SCREEN->_cup_cost); - (void) printf("home cost: %d\n", CURRENT_SCREEN->_home_cost); - (void) printf("ll cost: %d\n", CURRENT_SCREEN->_ll_cost); + (void) printf("char padding: %d\n", SP->_char_padding); + (void) printf("cr cost: %d\n", SP->_cr_cost); + (void) printf("cup cost: %d\n", SP->_cup_cost); + (void) printf("home cost: %d\n", SP->_home_cost); + (void) printf("ll cost: %d\n", SP->_ll_cost); #if USE_HARD_TABS - (void) printf("ht cost: %d\n", CURRENT_SCREEN->_ht_cost); - (void) printf("cbt cost: %d\n", CURRENT_SCREEN->_cbt_cost); + (void) printf("ht cost: %d\n", SP->_ht_cost); + (void) printf("cbt cost: %d\n", SP->_cbt_cost); #endif /* USE_HARD_TABS */ - (void) printf("cub1 cost: %d\n", CURRENT_SCREEN->_cub1_cost); - (void) printf("cuf1 cost: %d\n", CURRENT_SCREEN->_cuf1_cost); - (void) printf("cud1 cost: %d\n", CURRENT_SCREEN->_cud1_cost); - (void) printf("cuu1 cost: %d\n", CURRENT_SCREEN->_cuu1_cost); - (void) printf("cub cost: %d\n", CURRENT_SCREEN->_cub_cost); - (void) printf("cuf cost: %d\n", CURRENT_SCREEN->_cuf_cost); - (void) printf("cud cost: %d\n", CURRENT_SCREEN->_cud_cost); - (void) printf("cuu cost: %d\n", CURRENT_SCREEN->_cuu_cost); - (void) printf("hpa cost: %d\n", CURRENT_SCREEN->_hpa_cost); - (void) printf("vpa cost: %d\n", CURRENT_SCREEN->_vpa_cost); + (void) printf("cub1 cost: %d\n", SP->_cub1_cost); + (void) printf("cuf1 cost: %d\n", SP->_cuf1_cost); + (void) printf("cud1 cost: %d\n", SP->_cud1_cost); + (void) printf("cuu1 cost: %d\n", SP->_cuu1_cost); + (void) printf("cub cost: %d\n", SP->_cub_cost); + (void) printf("cuf cost: %d\n", SP->_cuf_cost); + (void) printf("cud cost: %d\n", SP->_cud_cost); + (void) printf("cuu cost: %d\n", SP->_cuu_cost); + (void) printf("hpa cost: %d\n", SP->_hpa_cost); + (void) printf("vpa cost: %d\n", SP->_vpa_cost); } else if (buf[0] == 'x' || buf[0] == 'q') break; else diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 70f805a2ad5..06c8411caa4 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -46,7 +46,7 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.41 2010/05/15 21:31:12 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.37 2008/05/03 16:24:56 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -59,20 +59,16 @@ static const char * signal_name(int sig) { switch (sig) { -#ifdef SIGALRM case SIGALRM: return "SIGALRM"; -#endif #ifdef SIGCONT case SIGCONT: return "SIGCONT"; #endif case SIGINT: return "SIGINT"; -#ifdef SIGQUIT case SIGQUIT: return "SIGQUIT"; -#endif case SIGTERM: return "SIGTERM"; #ifdef SIGTSTP @@ -140,7 +136,6 @@ signal_name(int sig) static void tstp(int dummy GCC_UNUSED) { - SCREEN *sp = CURRENT_SCREEN; sigset_t mask, omask; sigaction_t act, oact; @@ -159,11 +154,11 @@ tstp(int dummy GCC_UNUSED) * parent was stopped before us, and we would likely pick up the * settings already modified by the shell. */ - if (sp != 0 && !sp->_endwin) /* don't do this if we're not in curses */ + if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */ #if HAVE_TCGETPGRP if (tcgetpgrp(STDIN_FILENO) == getpgrp()) #endif - NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG); + def_prog_mode(); /* * Block window change and timer signals. The latter @@ -171,9 +166,7 @@ tstp(int dummy GCC_UNUSED) * to repaint the screen. */ (void) sigemptyset(&mask); -#ifdef SIGALRM (void) sigaddset(&mask, SIGALRM); -#endif #if USE_SIGWINCH (void) sigaddset(&mask, SIGWINCH); #endif @@ -192,7 +185,7 @@ tstp(int dummy GCC_UNUSED) * End window mode, which also resets the terminal state to the * original (pre-curses) modes. */ - NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); + endwin(); /* Unblock SIGTSTP. */ (void) sigemptyset(&mask); @@ -219,19 +212,19 @@ tstp(int dummy GCC_UNUSED) T(("SIGCONT received")); sigaction(SIGTSTP, &oact, NULL); - NCURSES_SP_NAME(flushinp) (NCURSES_SP_ARG); + flushinp(); /* * If the user modified the tty state while suspended, he wants * those changes to stick. So save the new "default" terminal state. */ - NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG); + def_shell_mode(); /* * This relies on the fact that doupdate() will restore the * program-mode tty state, and issue enter_ca_mode if need be. */ - NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG); + doupdate(); /* Reset the signals. */ (void) sigprocmask(SIG_SETMASK, &omask, NULL); @@ -241,8 +234,6 @@ tstp(int dummy GCC_UNUSED) static void cleanup(int sig) { - SCREEN *sp = CURRENT_SCREEN; - /* * Actually, doing any sort of I/O from within an signal handler is * "unsafe". But we'll _try_ to clean up the screen and terminal @@ -250,10 +241,7 @@ cleanup(int sig) */ if (!_nc_globals.cleanup_nested++ && (sig == SIGINT -#ifdef SIGQUIT - || sig == SIGQUIT -#endif - )) { + || sig == SIGQUIT)) { #if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t act; sigemptyset(&act.sa_mask); @@ -269,12 +257,12 @@ cleanup(int sig) if (scan->_ofp != 0 && isatty(fileno(scan->_ofp))) { scan->_cleanup = TRUE; - scan->_outch = NCURSES_SP_NAME(_nc_outch); + scan->_outch = _nc_outch; } set_term(scan); - NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); - if (sp) - sp->_endwin = FALSE; /* in case we have an atexit! */ + endwin(); + if (SP) + SP->_endwin = FALSE; /* in case we have an atexit! */ } } } @@ -286,13 +274,6 @@ static void sigwinch(int sig GCC_UNUSED) { _nc_globals.have_sigwinch = 1; -# if USE_PTHREADS_EINTR - if (_nc_globals.read_thread) { - if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) - pthread_kill(_nc_globals.read_thread, SIGWINCH); - _nc_globals.read_thread = 0; - } -# endif } #endif /* USE_SIGWINCH */ diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 329ec29a019..16d12edbbe3 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -65,12 +65,10 @@ # include # endif #endif -#ifdef __MINGW32__ -# include -#endif + #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.59 2008/08/30 20:08:19 tom Exp $") static long _nc_gettime(TimeType * t0, bool first) @@ -126,27 +124,15 @@ _nc_eventlist_timeout(_nc_eventlist * evl) } #endif /* NCURSES_WGETCH_EVENTS */ -#if (USE_FUNC_POLL || HAVE_SELECT) -# define MAYBE_UNUSED -#else -# define MAYBE_UNUSED GCC_UNUSED -#endif - -#if (USE_FUNC_POLL || HAVE_SELECT) -# define MAYBE_UNUSED -#else -# define MAYBE_UNUSED GCC_UNUSED -#endif - /* * Wait a specified number of milliseconds, returning nonzero if the timer * didn't expire before there is activity on the specified file descriptors. * The file-descriptors are specified by the mode: - * TW_NONE 0 - none (absolute time) - * TW_INPUT 1 - ncurses' normal input-descriptor - * TW_MOUSE 2 - mouse descriptor, if any - * TW_ANY 3 - either input or mouse. - * TW_EVENT 4 - + * 0 - none (absolute time) + * 1 - ncurses' normal input-descriptor + * 2 - mouse descriptor, if any + * 3 - either input or mouse. + * * Experimental: if NCURSES_WGETCH_EVENTS is defined, (mode & 4) determines * whether to pay attention to evl argument. If set, the smallest of * millisecond and of timeout of evl is taken. @@ -157,18 +143,16 @@ _nc_eventlist_timeout(_nc_eventlist * evl) * descriptors. */ NCURSES_EXPORT(int) -_nc_timed_wait(SCREEN *sp MAYBE_UNUSED, - int mode MAYBE_UNUSED, +_nc_timed_wait(SCREEN *sp, + int mode, int milliseconds, int *timeleft EVENTLIST_2nd(_nc_eventlist * evl)) { - int count; - int result = TW_NONE; - TimeType t0; -#if (USE_FUNC_POLL || HAVE_SELECT) int fd; -#endif + int count; + int result = 0; + TimeType t0; #ifdef NCURSES_WGETCH_EVENTS int timeout_is_event = 0; @@ -190,7 +174,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, milliseconds, mode)); #ifdef NCURSES_WGETCH_EVENTS - if (mode & TW_EVENT) { + if (mode & 4) { int event_delay = _nc_eventlist_timeout(evl); if (event_delay >= 0 @@ -209,7 +193,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, count = 0; #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl) + if ((mode & 4) && evl) evl->result_flags = 0; #endif @@ -217,23 +201,23 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, memset(fd_list, 0, sizeof(fd_list)); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl) + if ((mode & 4) && evl) fds = typeMalloc(struct pollfd, MIN_FDS + evl->count); #endif - if (mode & TW_INPUT) { + if (mode & 1) { fds[count].fd = sp->_ifd; fds[count].events = POLLIN; count++; } - if ((mode & TW_MOUSE) + if ((mode & 2) && (fd = sp->_mouse_fd) >= 0) { fds[count].fd = fd; fds[count].events = POLLIN; count++; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl) { + if ((mode & 4) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -250,7 +234,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, result = poll(fds, (unsigned) count, milliseconds); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl) { + if ((mode & 4) && evl) { int c; if (!result) @@ -292,8 +276,8 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, * * FIXME: this assumes mode&1 if milliseconds < 0 (see lib_getch.c). */ - result = TW_NONE; - if (mode & TW_INPUT) { + result = 0; + if (mode & 1) { int step = (milliseconds < 0) ? 0 : 5000; bigtime_t d; bigtime_t useconds = milliseconds * 1000; @@ -329,17 +313,17 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, */ FD_ZERO(&set); - if (mode & TW_INPUT) { + if (mode & 1) { FD_SET(sp->_ifd, &set); count = sp->_ifd + 1; } - if ((mode & TW_MOUSE) + if ((mode & 2) && (fd = sp->_mouse_fd) >= 0) { FD_SET(fd, &set); count = max(fd, count) + 1; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl) { + if ((mode & 4) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -362,7 +346,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl) { + if ((mode & 4) && evl) { evl->result_flags = 0; for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -386,7 +370,7 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, returntime = _nc_gettime(&t0, FALSE); if (milliseconds >= 0) - milliseconds -= (int) (returntime - starttime); + milliseconds -= (returntime - starttime); #ifdef NCURSES_WGETCH_EVENTS if (evl) { @@ -444,22 +428,22 @@ _nc_timed_wait(SCREEN *sp MAYBE_UNUSED, } } #elif defined(__BEOS__) - result = TW_INPUT; /* redundant, but simple */ + result = 1; /* redundant, but simple */ #elif HAVE_SELECT - if ((mode & TW_MOUSE) + if ((mode & 2) && (fd = sp->_mouse_fd) >= 0 && FD_ISSET(fd, &set)) - result |= TW_MOUSE; - if ((mode & TW_INPUT) + result |= 2; + if ((mode & 1) && FD_ISSET(sp->_ifd, &set)) - result |= TW_INPUT; + result |= 1; #endif } else result = 0; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & TW_EVENT) && evl && evl->result_flags) - result |= TW_EVENT; + if ((mode & 4) && evl && evl->result_flags) + result |= 4; #endif return (result); diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index 9656b3c70ee..ac2a74f08e0 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,8 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * + * and: Thomas E. Dickey 1996 on * ****************************************************************************/ /* @@ -64,16 +63,11 @@ */ #include +#include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") -MODULE_ID("$Id: lib_vidattr.c,v 1.61 2010/06/05 22:22:04 tom Exp $") - -#define doPut(mode) \ - TPUTS_TRACE(#mode); \ - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc) +#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -84,49 +78,40 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.61 2010/06/05 22:22:04 tom Exp $") /* if there is no current screen, assume we *can* do color */ #define SetColorsIf(why,old_attr) \ if (can_color && (why)) { \ - int old_pair = PairNumber(old_attr); \ + int old_pair = PAIR_NUMBER(old_attr); \ TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \ if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \ - (short) old_pair, \ - (short) pair, \ - reverse, outc); \ + _nc_do_color(old_pair, pair, reverse, outc); \ } \ } #define PreviousAttr _nc_prescreen.previous_attr NCURSES_EXPORT(int) -NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx - chtype newmode, - NCURSES_SP_OUTC outc) +vidputs(chtype newmode, int (*outc) (int)) { attr_t turn_on, turn_off; int pair; bool reverse = FALSE; - bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); + bool can_color = (SP == 0 || SP->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); + bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); #else #define fix_pair0 FALSE #endif newmode &= A_ATTRIBUTES; - - T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); - - if (!IsTermInfo(SP_PARM)) - returnCode(ERR); + T((T_CALLED("vidputs(%s)"), _traceattr(newmode))); /* this allows us to go on whether or not newterm() has been called */ - if (SP_PARM) - PreviousAttr = AttrOf(SCREEN_ATTRS(SP_PARM)); + if (SP) + PreviousAttr = AttrOf(SCREEN_ATTRS(SP)); TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(PreviousAttr))); - if ((SP_PARM != 0) + if ((SP != 0) && (magic_cookie_glitch > 0)) { #if USE_XMC_SUPPORT static const chtype table[] = @@ -150,7 +135,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx * the terminfo max_attributes value. */ for (n = 0; n < SIZEOF(table); ++n) { - if ((table[n] & SP_PARM->_ok_attributes) == 0) { + if ((table[n] & SP->_ok_attributes) == 0) { newmode &= ~table[n]; } else if ((table[n] & newmode) != 0) { if (used++ >= limit) { @@ -163,7 +148,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx } } #else - newmode &= ~(SP_PARM->_xmc_suppress); + newmode &= ~(SP->_xmc_suppress); #endif TR(TRACE_ATTRS, ("suppressed attribute is %s", _traceattr(newmode))); } @@ -187,7 +172,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx * A_ALTCHARSET (256) down 2 to line up. We use the NCURSES_BITS * macro so this will work properly for the wide-character layout. */ - unsigned value = (unsigned) no_color_video; + unsigned value = no_color_video; attr_t mask = NCURSES_BITS((value & 63) | ((value & 192) << 1) | ((value & 256) >> 2), 8); @@ -203,7 +188,7 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx if (newmode == PreviousAttr) returnCode(OK); - pair = PairNumber(newmode); + pair = PAIR_NUMBER(newmode); if (reverse) { newmode &= ~A_REVERSE; @@ -223,10 +208,10 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP_PARM || SP_PARM->_use_rmul) { + if (!SP || SP->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP_PARM || SP_PARM->_use_rmso) { + if (!SP || SP->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -237,18 +222,16 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), - 1, outc); + tputs(tparm(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), 1, outc); PreviousAttr &= ALL_BUT_COLOR; } SetColorsIf((pair != 0) || fix_pair0, PreviousAttr); @@ -258,11 +241,11 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP_PARM || SP_PARM->_use_rmul) { + if (!SP || SP->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP_PARM || SP_PARM->_use_rmso) { + if (!SP || SP->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -299,53 +282,28 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx if (reverse) newmode |= A_REVERSE; - if (SP_PARM) - SetAttr(SCREEN_ATTRS(SP_PARM), newmode); + if (SP) + SetAttr(SCREEN_ATTRS(SP), newmode); else PreviousAttr = newmode; returnCode(OK); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -vidputs(chtype newmode, NCURSES_OUTC outc) -{ - SetSafeOutcWrapper(outc); - return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, - newmode, - _nc_outc_wrapper); -} -#endif - -NCURSES_EXPORT(int) -NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode) -{ - T((T_CALLED("vidattr(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); - returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx - newmode, - NCURSES_SP_NAME(_nc_outch))); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) vidattr(chtype newmode) { - return NCURSES_SP_NAME(vidattr) (CURRENT_SCREEN, newmode); + T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); + + returnCode(vidputs(newmode, _nc_outch)); } -#endif NCURSES_EXPORT(chtype) -NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) +termattrs(void) { chtype attrs = A_NORMAL; - T((T_CALLED("termattrs(%p)"), (void *) SP_PARM)); -#ifdef USE_TERM_DRIVER - if (HasTerminal(SP_PARM)) - attrs = CallDriver(SP_PARM, conattr); -#else - + T((T_CALLED("termattrs()"))); if (enter_alt_charset_mode) attrs |= A_ALTCHARSET; @@ -373,17 +331,8 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) if (enter_underline_mode) attrs |= A_UNDERLINE; - if (SP_PARM->_coloron) + if (SP->_coloron) attrs |= A_COLOR; -#endif - returnChtype(attrs); + returnChar(attrs); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(chtype) -termattrs(void) -{ - return NCURSES_SP_NAME(termattrs) (CURRENT_SCREEN); -} -#endif diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index f0d2369c18d..6a3a0c8e934 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -30,7 +30,6 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * - * and: Juergen Pfeifer 2009 * ****************************************************************************/ /*----------------------------------------------------------------- @@ -39,16 +38,12 @@ * * The routine doupdate() and its dependents. * All physical output is concentrated here (except _nc_outch() - * in lib_tputs.c). + * in lib_tputs.c). * *-----------------------------------------------------------------*/ #include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif - #if defined __HAIKU__ && defined __BEOS__ #undef __BEOS__ #endif @@ -81,8 +76,9 @@ #endif #include +#include -MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -95,7 +91,7 @@ MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $") */ #define CHECK_INTERVAL 5 -#define FILL_BCE(sp) (sp->_coloron && !sp->_default_color && !back_color_erase) +#define FILL_BCE() (SP->_coloron && !SP->_default_color && !back_color_erase) static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_CH_T normal = NewChar(BLANK_TEXT); @@ -107,23 +103,13 @@ static NCURSES_CH_T normal = NewChar(BLANK_TEXT); */ /* #define POSITION_DEBUG */ -static NCURSES_INLINE NCURSES_CH_T ClrBlank(NCURSES_SP_DCLx WINDOW *win); - -#if NCURSES_SP_FUNCS -static int ClrBottom(SCREEN *, int total); -static void ClearScreen(SCREEN *, NCURSES_CH_T blank); -static void ClrUpdate(SCREEN *); -static void DelChar(SCREEN *, int count); -static void InsStr(SCREEN *, NCURSES_CH_T * line, int count); -static void TransformLine(SCREEN *, int const lineno); -#else +static NCURSES_INLINE NCURSES_CH_T ClrBlank(WINDOW *win); static int ClrBottom(int total); static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); static void InsStr(NCURSES_CH_T * line, int count); static void TransformLine(int const lineno); -#endif #ifdef POSITION_DEBUG /**************************************************************************** @@ -133,7 +119,7 @@ static void TransformLine(int const lineno); ****************************************************************************/ static void -position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) +position_check(int expected_y, int expected_x, char *legend) /* check to see if the real cursor position matches the virtual */ { char buf[20]; @@ -143,10 +129,10 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) if (!_nc_tracing || (expected_y < 0 && expected_x < 0)) return; - NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + _nc_flush(); memset(buf, '\0', sizeof(buf)); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx "\033[6n"); /* only works on ANSI-compatibles */ - NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + putp("\033[6n"); /* only works on ANSI-compatibles */ + _nc_flush(); *(s = buf) = 0; do { int ask = sizeof(buf) - 1 - (s - buf); @@ -166,12 +152,8 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) if (expected_y < 0) expected_y = y - 1; if (y - 1 != expected_y || x - 1 != expected_x) { - NCURSES_SP_NAME(beep) (NCURSES_SP_ARG); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - tparm("\033[%d;%dH", - expected_y + 1, - expected_x + 1), - 1, NCURSES_SP_NAME(_nc_outch)); + beep(); + tputs(tparm("\033[%d;%dH", expected_y + 1, expected_x + 1), 1, _nc_outch); _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", y - 1, x - 1, expected_y, expected_x, legend); } else { @@ -180,7 +162,7 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) } } #else -#define position_check(sp, expected_y, expected_x, legend) /* nothing */ +#define position_check(expected_y, expected_x, legend) /* nothing */ #endif /* POSITION_DEBUG */ /**************************************************************************** @@ -190,22 +172,19 @@ position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) ****************************************************************************/ static NCURSES_INLINE void -GoTo(NCURSES_SP_DCLx int const row, int const col) +GoTo(int const row, int const col) { - TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)", - (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); + TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", + row, col, SP->_cursrow, SP->_curscol)); - position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo"); + position_check(SP->_cursrow, SP->_curscol, "GoTo"); - TINFO_MVCUR(NCURSES_SP_ARGx - SP_PARM->_cursrow, - SP_PARM->_curscol, - row, col); - position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo2"); + mvcur(SP->_cursrow, SP->_curscol, row, col); + position_check(SP->_cursrow, SP->_curscol, "GoTo2"); } static NCURSES_INLINE void -PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) +PutAttrChar(CARG_CH_T ch) { int chlen = 1; NCURSES_CH_T my_ch; @@ -215,7 +194,7 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)", _tracech_t(ch), - SP_PARM->_cursrow, SP_PARM->_curscol)); + SP->_cursrow, SP->_curscol)); #if USE_WIDEC_SUPPORT /* * If this is not a valid character, there is nothing more to do. @@ -245,12 +224,12 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) */ if (is8bits(CharOf(CHDEREF(ch))) && (isprint(CharOf(CHDEREF(ch))) - || (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) - || (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) + || (SP->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) + || (SP->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) || (AttrOf(attr) & A_ALTCHARSET && ((CharOfD(ch) < ACS_LEN - && SP_PARM->_acs_map != 0 - && SP_PARM->_acs_map[CharOfD(ch)] != 0) + && SP->_acs_map != 0 + && SP->_acs_map[CharOfD(ch)] != 0) || (CharOfD(ch) >= 128))))) { ; } else { @@ -262,7 +241,7 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) #endif if ((AttrOf(attr) & A_ALTCHARSET) - && SP_PARM->_acs_map != 0 + && SP->_acs_map != 0 && CharOfD(ch) < ACS_LEN) { my_ch = CHDEREF(ch); /* work around const param */ #if USE_WIDEC_SUPPORT @@ -272,8 +251,8 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) * character, and uses the wide-character mapping when we expect the * normal one to be broken (by mis-design ;-). */ - if (SP_PARM->_screen_acs_fix - && SP_PARM->_screen_acs_map[CharOf(my_ch)]) { + if (SP->_screen_acs_fix + && SP->_screen_acs_map[CharOf(my_ch)]) { RemAttr(attr, A_ALTCHARSET); my_ch = _nc_wacs[CharOf(my_ch)]; } @@ -286,9 +265,9 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) */ if (AttrOf(attr) & A_ALTCHARSET) { int j = CharOfD(ch); - chtype temp = UChar(SP_PARM->_acs_map[j]); + chtype temp = UChar(SP->_acs_map[j]); - if (!(SP_PARM->_screen_acs_map[j])) { + if (!(SP->_screen_acs_map[j])) { RemAttr(attr, A_ALTCHARSET); if (temp == 0) temp = ' '; @@ -303,28 +282,28 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) ch = CHREF(tilde); } - UpdateAttrs(SP_PARM, attr); + UpdateAttrs(attr); #if !USE_WIDEC_SUPPORT /* FIXME - we do this special case for signal handling, should see how to * make it work for wide characters. */ - if (SP_PARM->_outch != 0) { - SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch)); + if (SP->_outch != 0) { + SP->_outch(UChar(ch)); } else #endif { - PUTC(CHDEREF(ch), SP_PARM->_ofp); /* macro's fastest... */ + PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ COUNT_OUTCHARS(1); } - SP_PARM->_curscol += chlen; + SP->_curscol += chlen; if (char_padding) { TPUTS_TRACE("char_padding"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx char_padding); + putp(char_padding); } } static bool -check_pending(NCURSES_SP_DCL0) +check_pending(void) /* check for pending input */ { bool have_pending = FALSE; @@ -334,13 +313,13 @@ check_pending(NCURSES_SP_DCL0) * have the refreshing slow down drastically (or stop) if there's an * unread character available. */ - if (SP_PARM->_fifohold != 0) + if (SP->_fifohold != 0) return FALSE; - if (SP_PARM->_checkfd >= 0) { + if (SP->_checkfd >= 0) { #if USE_FUNC_POLL struct pollfd fds[1]; - fds[0].fd = SP_PARM->_checkfd; + fds[0].fd = SP->_checkfd; fds[0].events = POLLIN; if (poll(fds, 1, 0) > 0) { have_pending = TRUE; @@ -368,52 +347,43 @@ check_pending(NCURSES_SP_DCL0) ktimeout.tv_usec = 0; FD_ZERO(&fdset); - FD_SET(SP_PARM->_checkfd, &fdset); - if (select(SP_PARM->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { + FD_SET(SP->_checkfd, &fdset); + if (select(SP->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { have_pending = TRUE; } #endif } if (have_pending) { - SP_PARM->_fifohold = 5; - NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + SP->_fifohold = 5; + _nc_flush(); } return FALSE; } /* put char at lower right corner */ static void -PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) +PutCharLR(const ARG_CH_T ch) { if (!auto_right_margin) { /* we can put the char directly */ - PutAttrChar(NCURSES_SP_ARGx ch); + PutAttrChar(ch); } else if (enter_am_mode && exit_am_mode) { /* we can suppress automargin */ TPUTS_TRACE("exit_am_mode"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_am_mode); + putp(exit_am_mode); - PutAttrChar(NCURSES_SP_ARGx ch); - SP_PARM->_curscol--; - position_check(SP_PARM, - SP_PARM->_cursrow, - SP_PARM->_curscol, - "exit_am_mode"); + PutAttrChar(ch); + SP->_curscol--; + position_check(SP->_cursrow, SP->_curscol, "exit_am_mode"); TPUTS_TRACE("enter_am_mode"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_am_mode); + putp(enter_am_mode); } else if ((enter_insert_mode && exit_insert_mode) || insert_character || parm_ich) { - GoTo(NCURSES_SP_ARGx - screen_lines(SP_PARM) - 1, - screen_columns(SP_PARM) - 2); - PutAttrChar(NCURSES_SP_ARGx ch); - GoTo(NCURSES_SP_ARGx - screen_lines(SP_PARM) - 1, - screen_columns(SP_PARM) - 2); - InsStr(NCURSES_SP_ARGx - NewScreen(SP_PARM)->_line[screen_lines(SP_PARM) - 1].text + - screen_columns(SP_PARM) - 2, 1); + GoTo(screen_lines - 1, screen_columns - 2); + PutAttrChar(ch); + GoTo(screen_lines - 1, screen_columns - 2); + InsStr(newscr->_line[screen_lines - 1].text + screen_columns - 2, 1); } } @@ -421,7 +391,7 @@ PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) * Wrap the cursor position, i.e., advance to the beginning of the next line. */ static void -wrap_cursor(NCURSES_SP_DCL0) +wrap_cursor(void) { if (eat_newline_glitch) { /* @@ -437,45 +407,40 @@ wrap_cursor(NCURSES_SP_DCL0) * it's safe to just tell the code that the cursor is in hyperspace and * let the next mvcur() call straighten things out. */ - SP_PARM->_curscol = -1; - SP_PARM->_cursrow = -1; + SP->_curscol = -1; + SP->_cursrow = -1; } else if (auto_right_margin) { - SP_PARM->_curscol = 0; - SP_PARM->_cursrow++; + SP->_curscol = 0; + SP->_cursrow++; /* * We've actually moved - but may have to work around problems with * video attributes not working. */ - if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP_PARM))) { + if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP))) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before wrapping", - (unsigned long) AttrOf(SCREEN_ATTRS(SP_PARM)), - _traceattr(AttrOf(SCREEN_ATTRS(SP_PARM))))); - (void) VIDATTR(SP_PARM, A_NORMAL, 0); + (unsigned long) AttrOf(SCREEN_ATTRS(SP)), + _traceattr(AttrOf(SCREEN_ATTRS(SP))))); + (void) VIDATTR(A_NORMAL, 0); } } else { - SP_PARM->_curscol--; + SP->_curscol--; } - position_check(SP_PARM, - SP_PARM->_cursrow, - SP_PARM->_curscol, - "wrap_cursor"); + position_check(SP->_cursrow, SP->_curscol, "wrap_cursor"); } static NCURSES_INLINE void -PutChar(NCURSES_SP_DCLx const ARG_CH_T ch) +PutChar(const ARG_CH_T ch) /* insert character, handling automargin stuff */ { - if (SP_PARM->_cursrow == screen_lines(SP_PARM) - 1 && - SP_PARM->_curscol == screen_columns(SP_PARM) - 1) { - PutCharLR(NCURSES_SP_ARGx ch); - } else { - PutAttrChar(NCURSES_SP_ARGx ch); - } + if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1) + PutCharLR(ch); + else + PutAttrChar(ch); - if (SP_PARM->_curscol >= screen_columns(SP_PARM)) - wrap_cursor(NCURSES_SP_ARG); + if (SP->_curscol >= screen_columns) + wrap_cursor(); - position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "PutChar"); + position_check(SP->_cursrow, SP->_curscol, "PutChar"); } /* @@ -485,21 +450,19 @@ PutChar(NCURSES_SP_DCLx const ARG_CH_T ch) * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. */ static NCURSES_INLINE bool -can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) +can_clear_with(ARG_CH_T ch) { - if (!back_color_erase && SP_PARM->_coloron) { + if (!back_color_erase && SP->_coloron) { #if NCURSES_EXT_FUNCS int pair; - if (!SP_PARM->_default_color) + if (!SP->_default_color) return FALSE; - if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK) + if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK) return FALSE; if ((pair = GetPair(CHDEREF(ch))) != 0) { short fg, bg; - NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx - (short) pair, - &fg, &bg); + pair_content(pair, &fg, &bg); if (fg != C_MASK || bg != C_MASK) return FALSE; } @@ -525,7 +488,7 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) * This code is optimized using ech and rep. */ static int -EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) +EmitRange(const NCURSES_CH_T * ntext, int num) { int i; @@ -537,13 +500,13 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) NCURSES_CH_T ntext0; while (num > 1 && !CharEq(ntext[0], ntext[1])) { - PutChar(NCURSES_SP_ARGx CHREF(ntext[0])); + PutChar(CHREF(ntext[0])); ntext++; num--; } ntext0 = ntext[0]; if (num == 1) { - PutChar(NCURSES_SP_ARGx CHREF(ntext0)); + PutChar(CHREF(ntext0)); return 0; } runcount = 2; @@ -560,11 +523,10 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) * which it would be marginally advantageous. */ if (erase_chars - && runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost - && can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) { - UpdateAttrs(SP_PARM, ntext0); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx - TPARM_1(erase_chars, runcount)); + && runcount > SP->_ech_cost + SP->_cup_ch_cost + && can_clear_with(CHREF(ntext0))) { + UpdateAttrs(ntext0); + putp(TPARM_1(erase_chars, runcount)); /* * If this is the last part of the given interval, @@ -572,34 +534,27 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) * last update on the line. */ if (runcount < num) { - GoTo(NCURSES_SP_ARGx - SP_PARM->_cursrow, - SP_PARM->_curscol + runcount); + GoTo(SP->_cursrow, SP->_curscol + runcount); } else { return 1; /* cursor stays in the middle */ } - } else if (repeat_char && runcount > SP_PARM->_rep_cost) { - bool wrap_possible = (SP_PARM->_curscol + runcount >= - screen_columns(SP_PARM)); + } else if (repeat_char && runcount > SP->_rep_cost) { + bool wrap_possible = (SP->_curscol + runcount >= screen_columns); int rep_count = runcount; if (wrap_possible) rep_count--; - UpdateAttrs(SP_PARM, ntext0); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(repeat_char, - CharOf(ntext0), - rep_count), - rep_count, - NCURSES_SP_NAME(_nc_outch)); - SP_PARM->_curscol += rep_count; + UpdateAttrs(ntext0); + tputs(TPARM_2(repeat_char, CharOf(ntext0), rep_count), + rep_count, _nc_outch); + SP->_curscol += rep_count; if (wrap_possible) - PutChar(NCURSES_SP_ARGx CHREF(ntext0)); + PutChar(CHREF(ntext0)); } else { for (i = 0; i < runcount; i++) - PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); + PutChar(CHREF(ntext[i])); } ntext += runcount; num -= runcount; @@ -608,7 +563,7 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) } for (i = 0; i < num; i++) - PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); + PutChar(CHREF(ntext[i])); return 0; } @@ -621,43 +576,39 @@ EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) * Returns: same as EmitRange */ static int -PutRange(NCURSES_SP_DCLx - const NCURSES_CH_T * otext, +PutRange(const NCURSES_CH_T * otext, const NCURSES_CH_T * ntext, int row, int first, int last) { int i, j, same; - TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)", - (void *) SP_PARM, - (const void *) otext, - (const void *) ntext, - row, first, last)); + TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)", + otext, ntext, row, first, last)); if (otext != ntext - && (last - first + 1) > SP_PARM->_inline_cost) { + && (last - first + 1) > SP->_inline_cost) { for (j = first, same = 0; j <= last; j++) { if (!same && isWidecExt(otext[j])) continue; if (CharEq(otext[j], ntext[j])) { same++; } else { - if (same > SP_PARM->_inline_cost) { - EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); - GoTo(NCURSES_SP_ARGx row, first = j); + if (same > SP->_inline_cost) { + EmitRange(ntext + first, j - same - first); + GoTo(row, first = j); } same = 0; } } - i = EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); + i = EmitRange(ntext + first, j - same - first); /* * Always return 1 for the next GoTo() after a PutRange() if we found * identical characters at end of interval */ return (same == 0 ? i : 1); } - return EmitRange(NCURSES_SP_ARGx ntext + first, last - first + 1); + return EmitRange(ntext + first, last - first + 1); } /* leave unbracketed here so 'indent' works */ @@ -667,7 +618,7 @@ PutRange(NCURSES_SP_DCLx if_USE_SCROLL_HINTS(win->_line[row].oldindex = row) NCURSES_EXPORT(int) -TINFO_DOUPDATE(NCURSES_SP_DCL0) +doupdate(void) { int i; int nonempty; @@ -675,49 +626,30 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) struct tms before, after; #endif /* USE_TRACE_TIMES */ - T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM)); + T((T_CALLED("doupdate()"))); -#if !USE_REENTRANT - /* - * It is "legal" but unlikely that an application could assign a new - * value to one of the standard windows. Check for that possibility - * and try to recover. - * - * We do not allow applications to assign new values in the reentrant - * model. - */ -#define SyncScreens(internal,exported) \ - if (internal == 0) internal = exported; \ - if (internal != exported) exported = internal - - SyncScreens(CurScreen(SP_PARM), curscr); - SyncScreens(NewScreen(SP_PARM), newscr); - SyncScreens(StdScreen(SP_PARM), stdscr); -#endif - - if (CurScreen(SP_PARM) == 0 - || NewScreen(SP_PARM) == 0 - || StdScreen(SP_PARM) == 0) + if (curscr == 0 + || newscr == 0) returnCode(ERR); #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { - if (CurScreen(SP_PARM)->_clear) + if (curscr->_clear) _tracef("curscr is clear"); else - _tracedump("curscr", CurScreen(SP_PARM)); - _tracedump("newscr", NewScreen(SP_PARM)); + _tracedump("curscr", curscr); + _tracedump("newscr", newscr); _nc_unlock_global(tracef); } #endif /* TRACE */ _nc_signal_handler(FALSE); - if (SP_PARM->_fifohold) - SP_PARM->_fifohold--; + if (SP->_fifohold) + SP->_fifohold--; #if USE_SIZECHANGE - if (SP_PARM->_endwin || _nc_handle_sigwinch(SP_PARM)) { + if (SP->_endwin || _nc_handle_sigwinch(SP)) { /* * This is a transparent extension: XSI does not address it, * and applications need not know that ncurses can do it. @@ -726,20 +658,20 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) * (this can happen in an xterm, for example), and resize the * ncurses data structures accordingly. */ - _nc_update_screensize(SP_PARM); + _nc_update_screensize(SP); } #endif - if (SP_PARM->_endwin) { + if (SP->_endwin) { T(("coming back from shell mode")); - NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG); + reset_prog_mode(); - NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); - NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); - SP_PARM->_mouse_resume(SP_PARM); + _nc_mvcur_resume(); + _nc_screen_resume(); + SP->_mouse_resume(SP); - SP_PARM->_endwin = FALSE; + SP->_endwin = FALSE; } #if USE_TRACE_TIMES /* zero the metering machinery */ @@ -763,11 +695,11 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) int j, k; attr_t rattr = A_NORMAL; - for (i = 0; i < screen_lines(SP_PARM); i++) { - for (j = 0; j < screen_columns(SP_PARM); j++) { + for (i = 0; i < screen_lines; i++) { + for (j = 0; j < screen_columns; j++) { bool failed = FALSE; - NCURSES_CH_T *thisline = NewScreen(SP_PARM)->_line[i].text; - attr_t thisattr = AttrOf(thisline[j]) & SP_PARM->_xmc_triggers; + NCURSES_CH_T *thisline = newscr->_line[i].text; + attr_t thisattr = AttrOf(thisline[j]) & SP->_xmc_triggers; attr_t turnon = thisattr & ~rattr; /* is an attribute turned on here? */ @@ -785,8 +717,8 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) * there's enough room to set the attribute before the first * non-blank in the run. */ -#define SAFE(scr,a) (!((a) & (scr)->_xmc_triggers)) - if (ISBLANK(thisline[j]) && SAFE(SP_PARM, turnon)) { +#define SAFE(a) (!((a) & SP->_xmc_triggers)) + if (ISBLANK(thisline[j]) && SAFE(turnon)) { RemAttr(thisline[j], turnon); continue; } @@ -795,14 +727,14 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) for (k = 1; k <= magic_cookie_glitch; k++) { if (j - k < 0 || !ISBLANK(thisline[j - k]) - || !SAFE(SP_PARM, AttrOf(thisline[j - k]))) { + || !SAFE(AttrOf(thisline[j - k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at start in %d,%d%s%s", i, j - k, (ISBLANK(thisline[j - k]) ? "" : ":nonblank"), - (SAFE(SP_PARM, AttrOf(thisline[j - k])) + (SAFE(AttrOf(thisline[j - k])) ? "" : ":unsafe"))); break; @@ -813,11 +745,10 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) int m, n = j; /* find end of span, if it's onscreen */ - for (m = i; m < screen_lines(SP_PARM); m++) { - for (; n < screen_columns(SP_PARM); n++) { - attr_t testattr = - AttrOf(NewScreen(SP_PARM)->_line[m].text[n]); - if ((testattr & SP_PARM->_xmc_triggers) == rattr) { + for (m = i; m < screen_lines; m++) { + for (; n < screen_columns; n++) { + attr_t testattr = AttrOf(newscr->_line[m].text[n]); + if ((testattr & SP->_xmc_triggers) == rattr) { end_onscreen = TRUE; TR(TRACE_ATTRS, ("Range attributed with %s ends at (%d, %d)", @@ -833,8 +764,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) foundit:; if (end_onscreen) { - NCURSES_CH_T *lastline = - NewScreen(SP_PARM)->_line[m].text; + NCURSES_CH_T *lastline = newscr->_line[m].text; /* * If there are safely-attributed blanks at the end of @@ -843,15 +773,15 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) */ while (n >= 0 && ISBLANK(lastline[n]) - && SAFE(SP_PARM, AttrOf(lastline[n]))) { + && SAFE(AttrOf(lastline[n]))) { RemAttr(lastline[n--], turnon); } /* check that there's enough room at end of span */ for (k = 1; k <= magic_cookie_glitch; k++) { - if (n + k >= screen_columns(SP_PARM) + if (n + k >= screen_columns || !ISBLANK(lastline[n + k]) - || !SAFE(SP_PARM, AttrOf(lastline[n + k]))) { + || !SAFE(AttrOf(lastline[n + k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at end in %d,%d%s%s", @@ -859,7 +789,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) (ISBLANK(lastline[n + k]) ? "" : ":nonblank"), - (SAFE(SP_PARM, AttrOf(lastline[n + k])) + (SAFE(AttrOf(lastline[n + k])) ? "" : ":unsafe"))); break; @@ -876,12 +806,12 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) _traceattr(turnon), i, j)); /* turn off new attributes over span */ - for (p = i; p < screen_lines(SP_PARM); p++) { - for (; q < screen_columns(SP_PARM); q++) { + for (p = i; p < screen_lines; p++) { + for (; q < screen_columns; q++) { attr_t testattr = AttrOf(newscr->_line[p].text[q]); - if ((testattr & SP_PARM->_xmc_triggers) == rattr) + if ((testattr & SP->_xmc_triggers) == rattr) goto foundend; - RemAttr(NewScreen(SP_PARM)->_line[p].text[q], turnon); + RemAttr(newscr->_line[p].text[q], turnon); } q = 0; } @@ -907,7 +837,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) /* show altered highlights after magic-cookie check */ if (USE_TRACEF(TRACE_UPDATE)) { _tracef("After magic-cookie check..."); - _tracedump("newscr", NewScreen(SP_PARM)); + _tracedump("newscr", newscr); _nc_unlock_global(tracef); } #endif /* TRACE */ @@ -915,23 +845,23 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) #endif /* USE_XMC_SUPPORT */ nonempty = 0; - if (CurScreen(SP_PARM)->_clear || NewScreen(SP_PARM)->_clear) { /* force refresh ? */ - ClrUpdate(NCURSES_SP_ARG); - CurScreen(SP_PARM)->_clear = FALSE; /* reset flag */ - NewScreen(SP_PARM)->_clear = FALSE; /* reset flag */ + if (curscr->_clear || newscr->_clear) { /* force refresh ? */ + ClrUpdate(); + curscr->_clear = FALSE; /* reset flag */ + newscr->_clear = FALSE; /* reset flag */ } else { int changedlines = CHECK_INTERVAL; - if (check_pending(NCURSES_SP_ARG)) + if (check_pending()) goto cleanup; - nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); + nonempty = min(screen_lines, newscr->_maxy + 1); - if (SP_PARM->_scrolling) { - NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG); + if (SP->_scrolling) { + _nc_scroll_optimize(); } - nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); + nonempty = ClrBottom(nonempty); TR(TRACE_UPDATE, ("Transforming lines, nonempty %d", nonempty)); for (i = 0; i < nonempty; i++) { @@ -939,7 +869,7 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) * Here is our line-breakout optimization. */ if (changedlines == CHECK_INTERVAL) { - if (check_pending(NCURSES_SP_ARG)) + if (check_pending()) goto cleanup; changedlines = 0; } @@ -950,35 +880,35 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) * is normally set by _nc_scroll_window in the * vertical-movement optimization code, */ - if (NewScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE - || CurScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE) { - TransformLine(NCURSES_SP_ARGx i); + if (newscr->_line[i].firstchar != _NOCHANGE + || curscr->_line[i].firstchar != _NOCHANGE) { + TransformLine(i); changedlines++; } /* mark line changed successfully */ - if (i <= NewScreen(SP_PARM)->_maxy) { - MARK_NOCHANGE(NewScreen(SP_PARM), i); + if (i <= newscr->_maxy) { + MARK_NOCHANGE(newscr, i); } - if (i <= CurScreen(SP_PARM)->_maxy) { - MARK_NOCHANGE(CurScreen(SP_PARM), i); + if (i <= curscr->_maxy) { + MARK_NOCHANGE(curscr, i); } } } /* put everything back in sync */ - for (i = nonempty; i <= NewScreen(SP_PARM)->_maxy; i++) { - MARK_NOCHANGE(NewScreen(SP_PARM), i); + for (i = nonempty; i <= newscr->_maxy; i++) { + MARK_NOCHANGE(newscr, i); } - for (i = nonempty; i <= CurScreen(SP_PARM)->_maxy; i++) { - MARK_NOCHANGE(CurScreen(SP_PARM), i); + for (i = nonempty; i <= curscr->_maxy; i++) { + MARK_NOCHANGE(curscr, i); } - if (!NewScreen(SP_PARM)->_leaveok) { - CurScreen(SP_PARM)->_curx = NewScreen(SP_PARM)->_curx; - CurScreen(SP_PARM)->_cury = NewScreen(SP_PARM)->_cury; + if (!newscr->_leaveok) { + curscr->_curx = newscr->_curx; + curscr->_cury = newscr->_cury; - GoTo(NCURSES_SP_ARGx CurScreen(SP_PARM)->_cury, CurScreen(SP_PARM)->_curx); + GoTo(curscr->_cury, curscr->_curx); } cleanup: @@ -991,10 +921,10 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) #if USE_XMC_SUPPORT if (magic_cookie_glitch != 0) #endif - UpdateAttrs(SP_PARM, normal); + UpdateAttrs(normal); - NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); - WINDOW_ATTRS(CurScreen(SP_PARM)) = WINDOW_ATTRS(NewScreen(SP_PARM)); + _nc_flush(); + WINDOW_ATTRS(curscr) = WINDOW_ATTRS(newscr); #if USE_TRACE_TIMES (void) times(&after); @@ -1010,14 +940,6 @@ TINFO_DOUPDATE(NCURSES_SP_DCL0) returnCode(OK); } -#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) -NCURSES_EXPORT(int) -doupdate(void) -{ - return TINFO_DOUPDATE(CURRENT_SCREEN); -} -#endif - /* * ClrBlank(win) * @@ -1029,14 +951,14 @@ doupdate(void) * in the wbkgd() call. Assume 'stdscr' for this case. */ #define BCE_ATTRS (A_NORMAL|A_COLOR) -#define BCE_BKGD(sp,win) (((win) == CurScreen(sp) ? StdScreen(sp) : (win))->_nc_bkgd) +#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd) static NCURSES_INLINE NCURSES_CH_T -ClrBlank(NCURSES_SP_DCLx WINDOW *win) +ClrBlank(WINDOW *win) { NCURSES_CH_T blank = blankchar; if (back_color_erase) - AddAttr(blank, (AttrOf(BCE_BKGD(SP_PARM, win)) & BCE_ATTRS)); + AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS)); return blank; } @@ -1048,24 +970,23 @@ ClrBlank(NCURSES_SP_DCLx WINDOW *win) */ static void -ClrUpdate(NCURSES_SP_DCL0) +ClrUpdate(void) { + int i; + NCURSES_CH_T blank = ClrBlank(stdscr); + int nonempty = min(screen_lines, newscr->_maxy + 1); + TR(TRACE_UPDATE, (T_CALLED("ClrUpdate"))); - if (0 != SP_PARM) { - int i; - NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); - int nonempty = min(screen_lines(SP_PARM), - NewScreen(SP_PARM)->_maxy + 1); - ClearScreen(NCURSES_SP_ARGx blank); + ClearScreen(blank); - TR(TRACE_UPDATE, ("updating screen from scratch")); + TR(TRACE_UPDATE, ("updating screen from scratch")); - nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); + nonempty = ClrBottom(nonempty); + + for (i = 0; i < nonempty; i++) + TransformLine(i); - for (i = 0; i < nonempty; i++) - TransformLine(NCURSES_SP_ARGx i); - } TR(TRACE_UPDATE, (T_RETURN(""))); } @@ -1076,36 +997,35 @@ ClrUpdate(NCURSES_SP_DCL0) */ static void -ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) +ClrToEOL(NCURSES_CH_T blank, bool needclear) { int j; - if (SP_PARM != 0) { - if (CurScreen(SP_PARM) != 0 - && SP_PARM->_cursrow >= 0) { - for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) { - if (j >= 0) { - NCURSES_CH_T *cp = - &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]); + if (curscr != 0 + && SP->_cursrow >= 0) { + for (j = SP->_curscol; j < screen_columns; j++) { + if (j >= 0) { + NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]); - if (!CharEq(*cp, blank)) { - *cp = blank; - needclear = TRUE; - } + if (!CharEq(*cp, blank)) { + *cp = blank; + needclear = TRUE; } } } + } else { + needclear = TRUE; } - if (needclear && (SP_PARM != 0)) { - UpdateAttrs(SP_PARM, blank); + if (needclear) { + UpdateAttrs(blank); TPUTS_TRACE("clr_eol"); - if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) { - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); + if (clr_eol && SP->_el_cost <= (screen_columns - SP->_curscol)) { + putp(clr_eol); } else { - int count = (screen_columns(SP_PARM) - SP_PARM->_curscol); + int count = (screen_columns - SP->_curscol); while (count-- > 0) - PutChar(NCURSES_SP_ARGx CHREF(blank)); + PutChar(CHREF(blank)); } } } @@ -1117,29 +1037,23 @@ ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) */ static void -ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank) +ClrToEOS(NCURSES_CH_T blank) { int row, col; - if (0 == SP_PARM) - return; + row = SP->_cursrow; + col = SP->_curscol; - row = SP_PARM->_cursrow; - col = SP_PARM->_curscol; - - UpdateAttrs(SP_PARM, blank); + UpdateAttrs(blank); TPUTS_TRACE("clr_eos"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - clr_eos, - screen_lines(SP_PARM) - row, - NCURSES_SP_NAME(_nc_outch)); + tputs(clr_eos, screen_lines - row, _nc_outch); - while (col < screen_columns(SP_PARM)) - CurScreen(SP_PARM)->_line[row].text[col++] = blank; + while (col < screen_columns) + curscr->_line[row].text[col++] = blank; - for (row++; row < screen_lines(SP_PARM); row++) { - for (col = 0; col < screen_columns(SP_PARM); col++) - CurScreen(SP_PARM)->_line[row].text[col] = blank; + for (row++; row < screen_lines; row++) { + for (col = 0; col < screen_columns; col++) + curscr->_line[row].text[col] = blank; } } @@ -1151,26 +1065,26 @@ ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank) * screen, checking if each is blank, and one or more are changed. */ static int -ClrBottom(NCURSES_SP_DCLx int total) +ClrBottom(int total) { int row; int col; int top = total; - int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1); - NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1]; + int last = min(screen_columns, newscr->_maxx + 1); + NCURSES_CH_T blank = newscr->_line[total - 1].text[last - 1]; bool ok; - if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { + if (clr_eos && can_clear_with(CHREF(blank))) { for (row = total - 1; row >= 0; row--) { for (col = 0, ok = TRUE; ok && col < last; col++) { - ok = (CharEq(NewScreen(SP_PARM)->_line[row].text[col], blank)); + ok = (CharEq(newscr->_line[row].text[col], blank)); } if (!ok) break; for (col = 0; ok && col < last; col++) { - ok = (CharEq(CurScreen(SP_PARM)->_line[row].text[col], blank)); + ok = (CharEq(curscr->_line[row].text[col], blank)); } if (!ok) top = row; @@ -1178,11 +1092,11 @@ ClrBottom(NCURSES_SP_DCLx int total) /* don't use clr_eos for just one line if clr_eol available */ if (top < total) { - GoTo(NCURSES_SP_ARGx top, 0); - ClrToEOS(NCURSES_SP_ARGx blank); - if (SP_PARM->oldhash && SP_PARM->newhash) { - for (row = top; row < screen_lines(SP_PARM); row++) - SP_PARM->oldhash[row] = SP_PARM->newhash[row]; + GoTo(top, 0); + ClrToEOS(blank); + if (SP->oldhash && SP->newhash) { + for (row = top; row < screen_lines; row++) + SP->oldhash[row] = SP->newhash[row]; } } } @@ -1191,22 +1105,22 @@ ClrBottom(NCURSES_SP_DCLx int total) #if USE_XMC_SUPPORT #if USE_WIDEC_SUPPORT -#define check_xmc_transition(sp, a, b) \ - ((((a)->attr ^ (b)->attr) & ~((a)->attr) & (sp)->_xmc_triggers) != 0) -#define xmc_turn_on(sp,a,b) check_xmc_transition(sp,&(a), &(b)) +#define check_xmc_transition(a, b) \ + ((((a)->attr ^ (b)->attr) & ~((a)->attr) & SP->_xmc_triggers) != 0) +#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b)) #else -#define xmc_turn_on(sp,a,b) ((((a)^(b)) & ~(a) & (sp)->_xmc_triggers) != 0) +#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) #endif -#define xmc_new(sp,r,c) NewScreen(sp)->_line[r].text[c] -#define xmc_turn_off(sp,a,b) xmc_turn_on(sp,b,a) +#define xmc_new(r,c) newscr->_line[r].text[c] +#define xmc_turn_off(a,b) xmc_turn_on(b,a) #endif /* USE_XMC_SUPPORT */ /* ** TransformLine(lineno) ** ** Transform the given line in curscr to the one in newscr, using -** Insert/Delete Character if idcok && has_ic(). +** Insert/Delete Character if _nc_idcok && has_ic(). ** ** firstChar = position of first different character in line ** oLastChar = position of last different character in old line @@ -1221,19 +1135,19 @@ ClrBottom(NCURSES_SP_DCLx int total) */ static void -TransformLine(NCURSES_SP_DCLx int const lineno) +TransformLine(int const lineno) { int firstChar, oLastChar, nLastChar; - NCURSES_CH_T *newLine = NewScreen(SP_PARM)->_line[lineno].text; - NCURSES_CH_T *oldLine = CurScreen(SP_PARM)->_line[lineno].text; + NCURSES_CH_T *newLine = newscr->_line[lineno].text; + NCURSES_CH_T *oldLine = curscr->_line[lineno].text; int n; bool attrchanged = FALSE; - TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno)); + TR(TRACE_UPDATE, (T_CALLED("TransformLine(%d)"), lineno)); /* copy new hash value to old one */ - if (SP_PARM->oldhash && SP_PARM->newhash) - SP_PARM->oldhash[lineno] = SP_PARM->newhash[lineno]; + if (SP->oldhash && SP->newhash) + SP->oldhash[lineno] = SP->newhash[lineno]; /* * If we have colors, there is the possibility of having two color pairs @@ -1241,20 +1155,19 @@ TransformLine(NCURSES_SP_DCLx int const lineno) * for this case, and update the old line with the new line's colors when * they are equivalent. */ - if (SP_PARM->_coloron) { + if (SP->_coloron) { int oldPair; int newPair; - for (n = 0; n < screen_columns(SP_PARM); n++) { + for (n = 0; n < screen_columns; n++) { if (!CharEq(newLine[n], oldLine[n])) { oldPair = GetPair(oldLine[n]); newPair = GetPair(newLine[n]); if (oldPair != newPair && unColor(oldLine[n]) == unColor(newLine[n])) { - if (oldPair < SP_PARM->_pair_limit - && newPair < SP_PARM->_pair_limit - && (SP_PARM->_color_pairs[oldPair] == - SP_PARM->_color_pairs[newPair])) { + if (oldPair < COLOR_PAIRS + && newPair < COLOR_PAIRS + && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) { SetPair(oldLine[n], GetPair(newLine[n])); } } @@ -1264,7 +1177,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) if (ceol_standout_glitch && clr_eol) { firstChar = 0; - while (firstChar < screen_columns(SP_PARM)) { + while (firstChar < screen_columns) { if (!SameAttrOf(newLine[firstChar], oldLine[firstChar])) { attrchanged = TRUE; break; @@ -1276,13 +1189,9 @@ TransformLine(NCURSES_SP_DCLx int const lineno) firstChar = 0; if (attrchanged) { /* we may have to disregard the whole line */ - GoTo(NCURSES_SP_ARGx lineno, firstChar); - ClrToEOL(NCURSES_SP_ARGx - ClrBlank(NCURSES_SP_ARGx - CurScreen(SP_PARM)), FALSE); - PutRange(NCURSES_SP_ARGx - oldLine, newLine, lineno, 0, - screen_columns(SP_PARM) - 1); + GoTo(lineno, firstChar); + ClrToEOL(ClrBlank(curscr), FALSE); + PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1)); #if USE_XMC_SUPPORT /* @@ -1297,8 +1206,8 @@ TransformLine(NCURSES_SP_DCLx int const lineno) * following operation. */ } else if (magic_cookie_glitch > 0) { - GoTo(NCURSES_SP_ARGx lineno, firstChar); - for (n = 0; n < screen_columns(SP_PARM); n++) { + GoTo(lineno, firstChar); + for (n = 0; n < screen_columns; n++) { int m = n + magic_cookie_glitch; /* check for turn-on: @@ -1307,30 +1216,26 @@ TransformLine(NCURSES_SP_DCLx int const lineno) */ if (ISBLANK(newLine[n]) && ((n > 0 - && xmc_turn_on(SP_PARM, newLine[n - 1], newLine[n])) + && xmc_turn_on(newLine[n - 1], newLine[n])) || (n == 0 && lineno > 0 - && xmc_turn_on(SP_PARM, - xmc_new(SP_PARM, lineno - 1, - screen_columns(SP_PARM) - 1), + && xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1), newLine[n])))) { n = m; } - PutChar(NCURSES_SP_ARGx CHREF(newLine[n])); + PutChar(CHREF(newLine[n])); /* check for turn-off: * If we are writing an attributed non-blank, where the * next cell is blank, and not attributed. */ if (!ISBLANK(newLine[n]) - && ((n + 1 < screen_columns(SP_PARM) - && xmc_turn_off(SP_PARM, newLine[n], newLine[n + 1])) - || (n + 1 >= screen_columns(SP_PARM) - && lineno + 1 < screen_lines(SP_PARM) - && xmc_turn_off(SP_PARM, - newLine[n], - xmc_new(SP_PARM, lineno + 1, 0))))) { + && ((n + 1 < screen_columns + && xmc_turn_off(newLine[n], newLine[n + 1])) + || (n + 1 >= screen_columns + && lineno + 1 < screen_lines + && xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) { n = m; } @@ -1341,42 +1246,38 @@ TransformLine(NCURSES_SP_DCLx int const lineno) /* it may be cheap to clear leading whitespace with clr_bol */ blank = newLine[0]; - if (clr_bol && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { + if (clr_bol && can_clear_with(CHREF(blank))) { int oFirstChar, nFirstChar; - for (oFirstChar = 0; - oFirstChar < screen_columns(SP_PARM); - oFirstChar++) + for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++) if (!CharEq(oldLine[oFirstChar], blank)) break; - for (nFirstChar = 0; - nFirstChar < screen_columns(SP_PARM); - nFirstChar++) + for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++) if (!CharEq(newLine[nFirstChar], blank)) break; if (nFirstChar == oFirstChar) { firstChar = nFirstChar; /* find the first differing character */ - while (firstChar < screen_columns(SP_PARM) + while (firstChar < screen_columns && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } else if (oFirstChar > nFirstChar) { firstChar = nFirstChar; } else { /* oFirstChar < nFirstChar */ firstChar = oFirstChar; - if (SP_PARM->_el1_cost < nFirstChar - oFirstChar) { - if (nFirstChar >= screen_columns(SP_PARM) - && SP_PARM->_el_cost <= SP_PARM->_el1_cost) { - GoTo(NCURSES_SP_ARGx lineno, 0); - UpdateAttrs(SP_PARM, blank); + if (SP->_el1_cost < nFirstChar - oFirstChar) { + if (nFirstChar >= screen_columns + && SP->_el_cost <= SP->_el1_cost) { + GoTo(lineno, 0); + UpdateAttrs(blank); TPUTS_TRACE("clr_eol"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); + putp(clr_eol); } else { - GoTo(NCURSES_SP_ARGx lineno, nFirstChar - 1); - UpdateAttrs(SP_PARM, blank); + GoTo(lineno, nFirstChar - 1); + UpdateAttrs(blank); TPUTS_TRACE("clr_bol"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_bol); + putp(clr_bol); } while (firstChar < nFirstChar) @@ -1385,81 +1286,64 @@ TransformLine(NCURSES_SP_DCLx int const lineno) } } else { /* find the first differing character */ - while (firstChar < screen_columns(SP_PARM) + while (firstChar < screen_columns && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } /* if there wasn't one, we're done */ - if (firstChar >= screen_columns(SP_PARM)) { + if (firstChar >= screen_columns) { TR(TRACE_UPDATE, (T_RETURN(""))); return; } - blank = newLine[screen_columns(SP_PARM) - 1]; + blank = newLine[screen_columns - 1]; - if (!can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { + if (!can_clear_with(CHREF(blank))) { /* find the last differing character */ - nLastChar = screen_columns(SP_PARM) - 1; + nLastChar = screen_columns - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], oldLine[nLastChar])) nLastChar--; if (nLastChar >= firstChar) { - GoTo(NCURSES_SP_ARGx lineno, firstChar); - PutRange(NCURSES_SP_ARGx - oldLine, - newLine, - lineno, - firstChar, - nLastChar); + GoTo(lineno, firstChar); + PutRange(oldLine, newLine, lineno, firstChar, nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (unsigned) (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); + (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } TR(TRACE_UPDATE, (T_RETURN(""))); return; } /* find last non-blank character on old line */ - oLastChar = screen_columns(SP_PARM) - 1; + oLastChar = screen_columns - 1; while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank)) oLastChar--; /* find last non-blank character on new line */ - nLastChar = screen_columns(SP_PARM) - 1; + nLastChar = screen_columns - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank)) nLastChar--; if ((nLastChar == firstChar) - && (SP_PARM->_el_cost < (oLastChar - nLastChar))) { - GoTo(NCURSES_SP_ARGx lineno, firstChar); + && (SP->_el_cost < (oLastChar - nLastChar))) { + GoTo(lineno, firstChar); if (!CharEq(newLine[firstChar], blank)) - PutChar(NCURSES_SP_ARGx CHREF(newLine[firstChar])); - ClrToEOL(NCURSES_SP_ARGx blank, FALSE); + PutChar(CHREF(newLine[firstChar])); + ClrToEOL(blank, FALSE); } else if ((nLastChar != oLastChar) && (!CharEq(newLine[nLastChar], oldLine[oLastChar]) - || !(SP_PARM->_nc_sp_idcok - && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)))) { - GoTo(NCURSES_SP_ARGx lineno, firstChar); - if ((oLastChar - nLastChar) > SP_PARM->_el_cost) { - if (PutRange(NCURSES_SP_ARGx - oldLine, - newLine, - lineno, - firstChar, - nLastChar)) { - GoTo(NCURSES_SP_ARGx lineno, nLastChar + 1); - } - ClrToEOL(NCURSES_SP_ARGx blank, FALSE); + || !(_nc_idcok && has_ic()))) { + GoTo(lineno, firstChar); + if ((oLastChar - nLastChar) > SP->_el_cost) { + if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar)) + GoTo(lineno, nLastChar + 1); + ClrToEOL(blank, FALSE); } else { n = max(nLastChar, oLastChar); - PutRange(NCURSES_SP_ARGx - oldLine, - newLine, - lineno, - firstChar, - n); + PutRange(oldLine, newLine, lineno, firstChar, n); } } else { int nLastNonblank = nLastChar; @@ -1480,13 +1364,8 @@ TransformLine(NCURSES_SP_DCLx int const lineno) n = min(oLastChar, nLastChar); if (n >= firstChar) { - GoTo(NCURSES_SP_ARGx lineno, firstChar); - PutRange(NCURSES_SP_ARGx - oldLine, - newLine, - lineno, - firstChar, - n); + GoTo(lineno, firstChar); + PutRange(oldLine, newLine, lineno, firstChar, n); } if (oLastChar < nLastChar) { @@ -1497,26 +1376,21 @@ TransformLine(NCURSES_SP_DCLx int const lineno) --oLastChar; } #endif - GoTo(NCURSES_SP_ARGx lineno, n + 1); + GoTo(lineno, n + 1); if ((nLastChar < nLastNonblank) - || InsCharCost(SP_PARM, nLastChar - oLastChar) > (m - n)) { - PutRange(NCURSES_SP_ARGx - oldLine, - newLine, - lineno, - n + 1, - m); + || InsCharCost(nLastChar - oLastChar) > (m - n)) { + PutRange(oldLine, newLine, lineno, n + 1, m); } else { - InsStr(NCURSES_SP_ARGx &newLine[n + 1], nLastChar - oLastChar); + InsStr(&newLine[n + 1], nLastChar - oLastChar); } } else if (oLastChar > nLastChar) { - GoTo(NCURSES_SP_ARGx lineno, n + 1); - if (DelCharCost(SP_PARM, oLastChar - nLastChar) - > SP_PARM->_el_cost + nLastNonblank - (n + 1)) { - if (PutRange(NCURSES_SP_ARGx oldLine, newLine, lineno, + GoTo(lineno, n + 1); + if (DelCharCost(oLastChar - nLastChar) + > SP->_el_cost + nLastNonblank - (n + 1)) { + if (PutRange(oldLine, newLine, lineno, n + 1, nLastNonblank)) - GoTo(NCURSES_SP_ARGx lineno, nLastNonblank + 1); - ClrToEOL(NCURSES_SP_ARGx blank, FALSE); + GoTo(lineno, nLastNonblank + 1); + ClrToEOL(blank, FALSE); } else { /* * The delete-char sequence will @@ -1526,18 +1400,18 @@ TransformLine(NCURSES_SP_DCLx int const lineno) * setting the video attributes from * the last character on the row. */ - UpdateAttrs(SP_PARM, blank); - DelChar(NCURSES_SP_ARGx oLastChar - nLastChar); + UpdateAttrs(blank); + DelChar(oLastChar - nLastChar); } } } } /* update the code's internal representation */ - if (screen_columns(SP_PARM) > firstChar) + if (screen_columns > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (unsigned) (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T)); + (screen_columns - firstChar) * sizeof(NCURSES_CH_T)); TR(TRACE_UPDATE, (T_RETURN(""))); return; } @@ -1550,7 +1424,7 @@ TransformLine(NCURSES_SP_DCLx int const lineno) */ static void -ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) +ClearScreen(NCURSES_CH_T blank) { int i, j; bool fast_clear = (clear_screen || clr_eos || clr_eol); @@ -1558,13 +1432,9 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) TR(TRACE_UPDATE, ("ClearScreen() called")); #if NCURSES_EXT_FUNCS - if (SP_PARM->_coloron - && !SP_PARM->_default_color) { - NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx - (short) GET_SCREEN_PAIR(SP_PARM), - 0, - FALSE, - NCURSES_SP_NAME(_nc_outch)); + if (SP->_coloron + && !SP->_default_color) { + _nc_do_color(GET_SCREEN_PAIR(SP), 0, FALSE, _nc_outch); if (!back_color_erase) { fast_clear = FALSE; } @@ -1573,46 +1443,42 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) if (fast_clear) { if (clear_screen) { - UpdateAttrs(SP_PARM, blank); + UpdateAttrs(blank); TPUTS_TRACE("clear_screen"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clear_screen); - SP_PARM->_cursrow = SP_PARM->_curscol = 0; - position_check(SP_PARM, - SP_PARM->_cursrow, - SP_PARM->_curscol, - "ClearScreen"); + putp(clear_screen); + SP->_cursrow = SP->_curscol = 0; + position_check(SP->_cursrow, SP->_curscol, "ClearScreen"); } else if (clr_eos) { - SP_PARM->_cursrow = SP_PARM->_curscol = -1; - GoTo(NCURSES_SP_ARGx 0, 0); - UpdateAttrs(SP_PARM, blank); + SP->_cursrow = SP->_curscol = -1; + GoTo(0, 0); + + UpdateAttrs(blank); TPUTS_TRACE("clr_eos"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - clr_eos, - screen_lines(SP_PARM), - NCURSES_SP_NAME(_nc_outch)); + tputs(clr_eos, screen_lines, _nc_outch); } else if (clr_eol) { - SP_PARM->_cursrow = SP_PARM->_curscol = -1; - UpdateAttrs(SP_PARM, blank); - for (i = 0; i < screen_lines(SP_PARM); i++) { - GoTo(NCURSES_SP_ARGx i, 0); + SP->_cursrow = SP->_curscol = -1; + + UpdateAttrs(blank); + for (i = 0; i < screen_lines; i++) { + GoTo(i, 0); TPUTS_TRACE("clr_eol"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); + putp(clr_eol); } - GoTo(NCURSES_SP_ARGx 0, 0); + GoTo(0, 0); } } else { - UpdateAttrs(SP_PARM, blank); - for (i = 0; i < screen_lines(SP_PARM); i++) { - GoTo(NCURSES_SP_ARGx i, 0); - for (j = 0; j < screen_columns(SP_PARM); j++) - PutChar(NCURSES_SP_ARGx CHREF(blank)); + UpdateAttrs(blank); + for (i = 0; i < screen_lines; i++) { + GoTo(i, 0); + for (j = 0; j < screen_columns; j++) + PutChar(CHREF(blank)); } - GoTo(NCURSES_SP_ARGx 0, 0); + GoTo(0, 0); } - for (i = 0; i < screen_lines(SP_PARM); i++) { - for (j = 0; j < screen_columns(SP_PARM); j++) - CurScreen(SP_PARM)->_line[i].text[j] = blank; + for (i = 0; i < screen_lines; i++) { + for (j = 0; j < screen_columns; j++) + curscr->_line[i].text[j] = blank; } TR(TRACE_UPDATE, ("screen cleared")); @@ -1626,54 +1492,49 @@ ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) */ static void -InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) +InsStr(NCURSES_CH_T * line, int count) { - TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", - (void *) SP_PARM, - (void *) line, count)); + TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count)); /* Prefer parm_ich as it has the smallest cost - no need to shift * the whole line on each character. */ /* The order must match that of InsCharCost. */ if (parm_ich) { TPUTS_TRACE("parm_ich"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(parm_ich, count), - count, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_1(parm_ich, count), count, _nc_outch); while (count) { - PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); + PutAttrChar(CHREF(*line)); line++; count--; } } else if (enter_insert_mode && exit_insert_mode) { TPUTS_TRACE("enter_insert_mode"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_insert_mode); + putp(enter_insert_mode); while (count) { - PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); + PutAttrChar(CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); + putp(insert_padding); } line++; count--; } TPUTS_TRACE("exit_insert_mode"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); + putp(exit_insert_mode); } else { while (count) { TPUTS_TRACE("insert_character"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_character); - PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); + putp(insert_character); + PutAttrChar(CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); + putp(insert_padding); } line++; count--; } } - position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "InsStr"); + position_check(SP->_cursrow, SP->_curscol, "InsStr"); } /* @@ -1684,25 +1545,22 @@ InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) */ static void -DelChar(NCURSES_SP_DCLx int count) +DelChar(int count) { int n; - TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)", - (void *) SP_PARM, count, - (long) NewScreen(SP_PARM)->_cury, - (long) NewScreen(SP_PARM)->_curx)); + TR(TRACE_UPDATE, ("DelChar(%d) called, position = (%ld,%ld)", + count, + (long) newscr->_cury, + (long) newscr->_curx)); if (parm_dch) { TPUTS_TRACE("parm_dch"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_1(parm_dch, count), - count, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_1(parm_dch, count), count, _nc_outch); } else { for (n = 0; n < count; n++) { TPUTS_TRACE("delete_character"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_character); + putp(delete_character); } } } @@ -1741,66 +1599,54 @@ DelChar(NCURSES_SP_DCLx int count) /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */ static int -scroll_csr_forward(NCURSES_SP_DCLx - int n, - int top, - int bot, - int miny, - int maxy, - NCURSES_CH_T blank) +scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) { int i; if (n == 1 && scroll_forward && top == miny && bot == maxy) { - GoTo(NCURSES_SP_ARGx bot, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(bot, 0); + UpdateAttrs(blank); TPUTS_TRACE("scroll_forward"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); + putp(scroll_forward); } else if (n == 1 && delete_line && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); TPUTS_TRACE("delete_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); + putp(delete_line); } else if (parm_index && top == miny && bot == maxy) { - GoTo(NCURSES_SP_ARGx bot, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(bot, 0); + UpdateAttrs(blank); TPUTS_TRACE("parm_index"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_index, n, 0), - n, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_2(parm_index, n, 0), n, _nc_outch); } else if (parm_delete_line && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); TPUTS_TRACE("parm_delete_line"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_delete_line, n, 0), - n, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); } else if (scroll_forward && top == miny && bot == maxy) { - GoTo(NCURSES_SP_ARGx bot, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(bot, 0); + UpdateAttrs(blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_forward"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); + putp(scroll_forward); } } else if (delete_line && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); + putp(delete_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE(SP_PARM)) { + if (FILL_BCE()) { int j; for (i = 0; i < n; i++) { - GoTo(NCURSES_SP_ARGx bot - i, 0); - for (j = 0; j < screen_columns(SP_PARM); j++) - PutChar(NCURSES_SP_ARGx CHREF(blank)); + GoTo(bot - i, 0); + for (j = 0; j < screen_columns; j++) + PutChar(CHREF(blank)); } } #endif @@ -1810,66 +1656,55 @@ scroll_csr_forward(NCURSES_SP_DCLx /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */ /* n > 0 */ static int -scroll_csr_backward(NCURSES_SP_DCLx - int n, - int top, - int bot, - int miny, - int maxy, +scroll_csr_backward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) { int i; if (n == 1 && scroll_reverse && top == miny && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); TPUTS_TRACE("scroll_reverse"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); + putp(scroll_reverse); } else if (n == 1 && insert_line && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); TPUTS_TRACE("insert_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); + putp(insert_line); } else if (parm_rindex && top == miny && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); TPUTS_TRACE("parm_rindex"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_rindex, n, 0), - n, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_2(parm_rindex, n, 0), n, _nc_outch); } else if (parm_insert_line && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); TPUTS_TRACE("parm_insert_line"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_insert_line, n, 0), - n, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); } else if (scroll_reverse && top == miny && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_reverse"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); + putp(scroll_reverse); } } else if (insert_line && bot == maxy) { - GoTo(NCURSES_SP_ARGx top, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(top, 0); + UpdateAttrs(blank); for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); + putp(insert_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE(SP_PARM)) { + if (FILL_BCE()) { int j; for (i = 0; i < n; i++) { - GoTo(NCURSES_SP_ARGx top + i, 0); - for (j = 0; j < screen_columns(SP_PARM); j++) - PutChar(NCURSES_SP_ARGx CHREF(blank)); + GoTo(top + i, 0); + for (j = 0; j < screen_columns; j++) + PutChar(CHREF(blank)); } } #endif @@ -1879,46 +1714,40 @@ scroll_csr_backward(NCURSES_SP_DCLx /* scroll by using delete_line at del and insert_line at ins */ /* n > 0 */ static int -scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) +scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) { int i; if (!((parm_delete_line || delete_line) && (parm_insert_line || insert_line))) return ERR; - GoTo(NCURSES_SP_ARGx del, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(del, 0); + UpdateAttrs(blank); if (n == 1 && delete_line) { TPUTS_TRACE("delete_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); + putp(delete_line); } else if (parm_delete_line) { TPUTS_TRACE("parm_delete_line"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_delete_line, n, 0), - n, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); } else { /* if (delete_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); + putp(delete_line); } } - GoTo(NCURSES_SP_ARGx ins, 0); - UpdateAttrs(SP_PARM, blank); + GoTo(ins, 0); + UpdateAttrs(blank); if (n == 1 && insert_line) { TPUTS_TRACE("insert_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); + putp(insert_line); } else if (parm_insert_line) { TPUTS_TRACE("parm_insert_line"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_2(parm_insert_line, n, 0), - n, - NCURSES_SP_NAME(_nc_outch)); + tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); } else { /* if (insert_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); + putp(insert_line); } } @@ -1934,25 +1763,15 @@ scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) * save/restore cursor capabilities if the terminal has them. */ NCURSES_EXPORT(int) -NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx - int n, - int top, - int bot, - int maxy) +_nc_scrolln(int n, int top, int bot, int maxy) /* scroll region from top to bot by n lines */ { - NCURSES_CH_T blank; + NCURSES_CH_T blank = ClrBlank(stdscr); int i; bool cursor_saved = FALSE; int res; - TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", - (void *) SP_PARM, n, top, bot, maxy)); - - if (!IsValidScreen(SP_PARM)) - return (ERR); - - blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); + TR(TRACE_MOVE, ("mvcur_scrolln(%d, %d, %d, %d)", n, top, bot, maxy)); #if USE_XMC_SUPPORT /* @@ -1968,36 +1787,34 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx * Explicitly clear if stuff pushed off top of region might * be saved by the terminal. */ - res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, 0, maxy, blank); + res = scroll_csr_forward(n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { if ((((n == 1 && scroll_forward) || parm_index) - && (SP_PARM->_cursrow == bot || SP_PARM->_cursrow == bot - 1)) + && (SP->_cursrow == bot || SP->_cursrow == bot - 1)) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); + putp(save_cursor); } TPUTS_TRACE("change_scroll_region"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx - TPARM_2(change_scroll_region, top, bot)); + putp(TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); + putp(restore_cursor); } else { - SP_PARM->_cursrow = SP_PARM->_curscol = -1; + SP->_cursrow = SP->_curscol = -1; } - res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank); + res = scroll_csr_forward(n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx - TPARM_2(change_scroll_region, 0, maxy)); - SP_PARM->_cursrow = SP_PARM->_curscol = -1; + putp(TPARM_2(change_scroll_region, 0, maxy)); + SP->_cursrow = SP->_curscol = -1; } - if (res == ERR && SP_PARM->_nc_sp_idlok) - res = scroll_idl(NCURSES_SP_ARGx n, top, bot - n + 1, blank); + if (res == ERR && _nc_idlok) + res = scroll_idl(n, top, bot - n + 1, blank); /* * Clear the newly shifted-in text. @@ -2006,49 +1823,44 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx && (non_dest_scroll_region || (memory_below && bot == maxy))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); if (bot == maxy && clr_eos) { - GoTo(NCURSES_SP_ARGx bot - n + 1, 0); - ClrToEOS(NCURSES_SP_ARGx blank2); + GoTo(bot - n + 1, 0); + ClrToEOS(blank2); } else { for (i = 0; i < n; i++) { - GoTo(NCURSES_SP_ARGx bot - i, 0); - ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); + GoTo(bot - i, 0); + ClrToEOL(blank2, FALSE); } } } } else { /* (n < 0) - scroll down (backward) */ - res = scroll_csr_backward(NCURSES_SP_ARGx -n, top, bot, 0, maxy, blank); + res = scroll_csr_backward(-n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { - if (top != 0 - && (SP_PARM->_cursrow == top || - SP_PARM->_cursrow == top - 1) + if (top != 0 && (SP->_cursrow == top || SP->_cursrow == top - 1) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); + putp(save_cursor); } TPUTS_TRACE("change_scroll_region"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx - TPARM_2(change_scroll_region, top, bot)); + putp(TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); + putp(restore_cursor); } else { - SP_PARM->_cursrow = SP_PARM->_curscol = -1; + SP->_cursrow = SP->_curscol = -1; } - res = scroll_csr_backward(NCURSES_SP_ARGx - -n, top, bot, top, bot, blank); + res = scroll_csr_backward(-n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx - TPARM_2(change_scroll_region, 0, maxy)); - SP_PARM->_cursrow = SP_PARM->_curscol = -1; + putp(TPARM_2(change_scroll_region, 0, maxy)); + SP->_cursrow = SP->_curscol = -1; } - if (res == ERR && SP_PARM->_nc_sp_idlok) - res = scroll_idl(NCURSES_SP_ARGx -n, bot + n + 1, top, blank); + if (res == ERR && _nc_idlok) + res = scroll_idl(-n, bot + n + 1, top, blank); /* * Clear the newly shifted-in text. @@ -2057,8 +1869,8 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx && (non_dest_scroll_region || (memory_above && top == 0))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); for (i = 0; i < -n; i++) { - GoTo(NCURSES_SP_ARGx i + top, 0); - ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); + GoTo(i + top, 0); + ClrToEOL(blank2, FALSE); } } } @@ -2066,163 +1878,99 @@ NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx if (res == ERR) return (ERR); - _nc_scroll_window(CurScreen(SP_PARM), n, - (NCURSES_SIZE_T) top, - (NCURSES_SIZE_T) bot, - blank); + _nc_scroll_window(curscr, n, top, bot, blank); /* shift hash values too - they can be reused */ - NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_ARGx n, top, bot); + _nc_scroll_oldhash(n, top, bot); return (OK); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -_nc_scrolln(int n, int top, int bot, int maxy) -{ - return NCURSES_SP_NAME(_nc_scrolln) (CURRENT_SCREEN, n, top, bot, maxy); -} -#endif - NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0) +_nc_screen_resume(void) { - assert(SP_PARM); - /* make sure terminal is in a sane known state */ - SetAttr(SCREEN_ATTRS(SP_PARM), A_NORMAL); - NewScreen(SP_PARM)->_clear = TRUE; + SetAttr(SCREEN_ATTRS(SP), A_NORMAL); + newscr->_clear = TRUE; /* reset color pairs and definitions */ - if (SP_PARM->_coloron || SP_PARM->_color_defs) - NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); + if (SP->_coloron || SP->_color_defs) + _nc_reset_colors(); /* restore user-defined colors, if any */ - if (SP_PARM->_color_defs < 0) { + if (SP->_color_defs < 0) { int n; - SP_PARM->_color_defs = -(SP_PARM->_color_defs); - for (n = 0; n < SP_PARM->_color_defs; ++n) { - if (SP_PARM->_color_table[n].init) { - NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx - (short) n, - SP_PARM->_color_table[n].r, - SP_PARM->_color_table[n].g, - SP_PARM->_color_table[n].b); + SP->_color_defs = -(SP->_color_defs); + for (n = 0; n < SP->_color_defs; ++n) { + if (SP->_color_table[n].init) { + init_color(n, + SP->_color_table[n].r, + SP->_color_table[n].g, + SP->_color_table[n].b); } } } if (exit_attribute_mode) - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_attribute_mode); + putp(exit_attribute_mode); else { /* turn off attributes */ if (exit_alt_charset_mode) - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_alt_charset_mode); + putp(exit_alt_charset_mode); if (exit_standout_mode) - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_standout_mode); + putp(exit_standout_mode); if (exit_underline_mode) - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_underline_mode); + putp(exit_underline_mode); } if (exit_insert_mode) - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); + putp(exit_insert_mode); if (enter_am_mode && exit_am_mode) - NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx - (auto_right_margin - ? enter_am_mode - : exit_am_mode)); + putp(auto_right_margin ? enter_am_mode : exit_am_mode); } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -_nc_screen_resume(void) -{ - NCURSES_SP_NAME(_nc_screen_resume) (CURRENT_SCREEN); -} -#endif - -NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_screen_init) (NCURSES_SP_DCL0) -{ - NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); -} - -#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_screen_init(void) { - NCURSES_SP_NAME(_nc_screen_init) (CURRENT_SCREEN); + _nc_screen_resume(); } -#endif /* wrap up screen handling */ NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0) -{ - if (SP_PARM == 0) - return; - - UpdateAttrs(SP_PARM, normal); -#if NCURSES_EXT_FUNCS - if (SP_PARM->_coloron - && !SP_PARM->_default_color) { - static const NCURSES_CH_T blank = NewChar(BLANK_TEXT); - SP_PARM->_default_color = TRUE; - NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx - -1, - 0, - FALSE, - NCURSES_SP_NAME(_nc_outch)); - SP_PARM->_default_color = FALSE; - - TINFO_MVCUR(NCURSES_SP_ARGx - SP_PARM->_cursrow, - SP_PARM->_curscol, - screen_lines(SP_PARM) - 1, - 0); - - ClrToEOL(NCURSES_SP_ARGx blank, TRUE); - } -#endif - if (SP_PARM->_color_defs) { - NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); - } -} - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) _nc_screen_wrap(void) { - NCURSES_SP_NAME(_nc_screen_wrap) (CURRENT_SCREEN); -} + UpdateAttrs(normal); +#if NCURSES_EXT_FUNCS + if (SP->_coloron + && !SP->_default_color) { + static const NCURSES_CH_T blank = NewChar(BLANK_TEXT); + SP->_default_color = TRUE; + _nc_do_color(-1, 0, FALSE, _nc_outch); + SP->_default_color = FALSE; + + mvcur(SP->_cursrow, SP->_curscol, screen_lines - 1, 0); + + ClrToEOL(blank, TRUE); + } #endif + if (SP->_color_defs) { + _nc_reset_colors(); + } +} #if USE_XMC_SUPPORT NCURSES_EXPORT(void) -NCURSES_SP_NAME(_nc_do_xmc_glitch) (NCURSES_SP_DCLx attr_t previous) -{ - if (SP_PARM != 0) { - attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP_PARM))); - - while (chg != 0) { - if (chg & 1) { - SP_PARM->_curscol += magic_cookie_glitch; - if (SP_PARM->_curscol >= SP_PARM->_columns) - wrap_cursor(NCURSES_SP_ARG); - TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", - SP_PARM->_cursrow, SP_PARM->_curscol)); - } - chg >>= 1; - } - } -} - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) _nc_do_xmc_glitch(attr_t previous) { - NCURSES_SP_NAME(_nc_do_xmc_glitch) (CURRENT_SCREEN, previous); -} -#endif + attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP))); + while (chg != 0) { + if (chg & 1) { + SP->_curscol += magic_cookie_glitch; + if (SP->_curscol >= SP->_columns) + wrap_cursor(); + TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol)); + } + chg >>= 1; + } +} #endif /* USE_XMC_SUPPORT */ diff --git a/ncurses/wcwidth.h b/ncurses/wcwidth.h deleted file mode 100644 index 61e822ad679..00000000000 --- a/ncurses/wcwidth.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - * This is an implementation of wcwidth() and wcswidth() (defined in - * IEEE Std 1002.1-2001) for Unicode. - * - * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html - * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html - * - * In fixed-width output devices, Latin characters all occupy a single - * "cell" position of equal width, whereas ideographic CJK characters - * occupy two such cells. Interoperability between terminal-line - * applications and (teletype-style) character terminals using the - * UTF-8 encoding requires agreement on which character should advance - * the cursor by how many cell positions. No established formal - * standards exist at present on which Unicode character shall occupy - * how many cell positions on character terminals. These routines are - * a first attempt of defining such behavior based on simple rules - * applied to data provided by the Unicode Consortium. - * - * For some graphical characters, the Unicode standard explicitly - * defines a character-cell width via the definition of the East Asian - * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. - * In all these cases, there is no ambiguity about which width a - * terminal shall use. For characters in the East Asian Ambiguous (A) - * class, the width choice depends purely on a preference of backward - * compatibility with either historic CJK or Western practice. - * Choosing single-width for these characters is easy to justify as - * the appropriate long-term solution, as the CJK practice of - * displaying these characters as double-width comes from historic - * implementation simplicity (8-bit encoded characters were displayed - * single-width and 16-bit ones double-width, even for Greek, - * Cyrillic, etc.) and not any typographic considerations. - * - * Much less clear is the choice of width for the Not East Asian - * (Neutral) class. Existing practice does not dictate a width for any - * of these characters. It would nevertheless make sense - * typographically to allocate two character cells to characters such - * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be - * represented adequately with a single-width glyph. The following - * routines at present merely assign a single-cell width to all - * neutral characters, in the interest of simplicity. This is not - * entirely satisfactory and should be reconsidered before - * establishing a formal standard in this area. At the moment, the - * decision which Not East Asian (Neutral) characters should be - * represented by double-width glyphs cannot yet be answered by - * applying a simple rule from the Unicode database content. Setting - * up a proper standard for the behavior of UTF-8 character terminals - * will require a careful analysis not only of each Unicode character, - * but also of each presentation form, something the author of these - * routines has avoided to do so far. - * - * http://www.unicode.org/unicode/reports/tr11/ - * - * Markus Kuhn -- 2007-05-26 (Unicode 5.0) - * - * Permission to use, copy, modify, and distribute this software - * for any purpose and without fee is hereby granted. The author - * disclaims all warranties with regard to this software. - * - * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c - */ - -#include - -struct interval { - int first; - int last; -}; - -/* auxiliary function for binary search in interval table */ -static int bisearch(wchar_t ucs, const struct interval *table, int max) { - int min = 0; - int mid; - - if (ucs < table[0].first || ucs > table[max].last) - return 0; - while (max >= min) { - mid = (min + max) / 2; - if (ucs > table[mid].last) - min = mid + 1; - else if (ucs < table[mid].first) - max = mid - 1; - else - return 1; - } - - return 0; -} - - -/* The following two functions define the column width of an ISO 10646 - * character as follows: - * - * - The null character (U+0000) has a column width of 0. - * - * - Other C0/C1 control characters and DEL will lead to a return - * value of -1. - * - * - Non-spacing and enclosing combining characters (general - * category code Mn or Me in the Unicode database) have a - * column width of 0. - * - * - SOFT HYPHEN (U+00AD) has a column width of 1. - * - * - Other format characters (general category code Cf in the Unicode - * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. - * - * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) - * have a column width of 0. - * - * - Spacing characters in the East Asian Wide (W) or East Asian - * Full-width (F) category as defined in Unicode Technical - * Report #11 have a column width of 2. - * - * - All remaining characters (including all printable - * ISO 8859-1 and WGL4 characters, Unicode control characters, - * etc.) have a column width of 1. - * - * This implementation assumes that wchar_t characters are encoded - * in ISO 10646. - */ - -int mk_wcwidth(wchar_t ucs) -{ - /* sorted list of non-overlapping intervals of non-spacing characters */ - /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ - static const struct interval combining[] = { - { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, - { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, - { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, - { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, - { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, - { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, - { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, - { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, - { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, - { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, - { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, - { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, - { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, - { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, - { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, - { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, - { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, - { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, - { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, - { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, - { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, - { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, - { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, - { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, - { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, - { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, - { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, - { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, - { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, - { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, - { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, - { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, - { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, - { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, - { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, - { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, - { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, - { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, - { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, - { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, - { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, - { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, - { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, - { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, - { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, - { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, - { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, - { 0xE0100, 0xE01EF } - }; - - /* test for 8-bit control characters */ - if (ucs == 0) - return 0; - if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) - return -1; - - /* binary search in table of non-spacing characters */ - if (bisearch(ucs, combining, - sizeof(combining) / sizeof(struct interval) - 1)) - return 0; - - /* if we arrive here, ucs is not a combining or C0/C1 control character */ - - return 1 + - (ucs >= 0x1100 && - (ucs <= 0x115f || /* Hangul Jamo init. consonants */ - ucs == 0x2329 || ucs == 0x232a || - (ucs >= 0x2e80 && ucs <= 0xa4cf && - ucs != 0x303f) || /* CJK ... Yi */ - (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ - (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ - (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */ - (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ - (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ - (ucs >= 0xffe0 && ucs <= 0xffe6) || - (ucs >= 0x20000 && ucs <= 0x2fffd) || - (ucs >= 0x30000 && ucs <= 0x3fffd))); -} - - -int mk_wcswidth(const wchar_t *pwcs, size_t n) -{ - int w, width = 0; - - for (;*pwcs && n-- > 0; pwcs++) - if ((w = mk_wcwidth(*pwcs)) < 0) - return -1; - else - width += w; - - return width; -} - - -/* - * The following functions are the same as mk_wcwidth() and - * mk_wcswidth(), except that spacing characters in the East Asian - * Ambiguous (A) category as defined in Unicode Technical Report #11 - * have a column width of 2. This variant might be useful for users of - * CJK legacy encodings who want to migrate to UCS without changing - * the traditional terminal character-width behaviour. It is not - * otherwise recommended for general use. - */ -int mk_wcwidth_cjk(wchar_t ucs) -{ - /* sorted list of non-overlapping intervals of East Asian Ambiguous - * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ - static const struct interval ambiguous[] = { - { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, - { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 }, - { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 }, - { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 }, - { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED }, - { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA }, - { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, - { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, - { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 }, - { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 }, - { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 }, - { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, - { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, - { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, - { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, - { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB }, - { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB }, - { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 }, - { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 }, - { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 }, - { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, - { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, - { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, - { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 }, - { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC }, - { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, - { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, - { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 }, - { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 }, - { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 }, - { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 }, - { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B }, - { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, - { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 }, - { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E }, - { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 }, - { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 }, - { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F }, - { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 }, - { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF }, - { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B }, - { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 }, - { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 }, - { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 }, - { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 }, - { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 }, - { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 }, - { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 }, - { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, - { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F }, - { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF }, - { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } - }; - - /* binary search in table of non-spacing characters */ - if (bisearch(ucs, ambiguous, - sizeof(ambiguous) / sizeof(struct interval) - 1)) - return 2; - - return mk_wcwidth(ucs); -} - - -int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) -{ - int w, width = 0; - - for (;*pwcs && n-- > 0; pwcs++) - if ((w = mk_wcwidth_cjk(*pwcs)) < 0) - return -1; - else - width += w; - - return width; -} diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index 38d3130a54c..93b41bb4930 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -35,387 +35,39 @@ #include -#if HAVE_WCTYPE_H -#include -#endif - -MODULE_ID("$Id: lib_add_wch.c,v 1.12 2011/03/22 09:31:15 Petr.Pavlu Exp $") - -/* clone/adapt lib_addch.c */ -static const cchar_t blankchar = NewChar(BLANK_TEXT); - -/* - * Ugly microtweaking alert. Everything from here to end of module is - * likely to be speed-critical -- profiling data sure says it is! - * Most of the important screen-painting functions are shells around - * wadd_wch(). So we make every effort to reduce function-call overhead - * by inlining stuff, even at the cost of making wrapped copies for - * export. Also we supply some internal versions that don't call the - * window sync hook, for use by string-put functions. - */ - -/* Return bit mask for clearing color pair number if given ch has color */ -#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0)) - -static NCURSES_INLINE cchar_t -render_char(WINDOW *win, cchar_t ch) -/* compute a rendition of the given char correct for the current context */ -{ - attr_t a = WINDOW_ATTRS(win); - int pair = GetPair(ch); - - if (ISBLANK(ch) - && AttrOf(ch) == A_NORMAL - && pair == 0) { - /* color/pair in attrs has precedence over bkgrnd */ - ch = win->_nc_bkgd; - SetAttr(ch, a | AttrOf(win->_nc_bkgd)); - if ((pair = GET_WINDOW_PAIR(win)) == 0) - pair = GetPair(win->_nc_bkgd); - SetPair(ch, pair); - } else { - /* color in attrs has precedence over bkgrnd */ - a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a); - /* color in ch has precedence */ - if (pair == 0) { - if ((pair = GET_WINDOW_PAIR(win)) == 0) - pair = GetPair(win->_nc_bkgd); - } - AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); - SetPair(ch, pair); - } - - TR(TRACE_VIRTPUT, - ("render_char bkg %s (%d), attrs %s (%d) -> ch %s (%d)", - _tracech_t2(1, CHREF(win->_nc_bkgd)), - GetPair(win->_nc_bkgd), - _traceattr(WINDOW_ATTRS(win)), - GET_WINDOW_PAIR(win), - _tracech_t2(3, CHREF(ch)), - GetPair(ch))); - - return (ch); -} - -/* check if position is legal; if not, return error */ -#ifndef NDEBUG /* treat this like an assertion */ -#define CHECK_POSITION(win, x, y) \ - if (y > win->_maxy \ - || x > win->_maxx \ - || y < 0 \ - || x < 0) { \ - TR(TRACE_VIRTPUT, ("Alert! Win=%p _curx = %d, _cury = %d " \ - "(_maxx = %d, _maxy = %d)", win, x, y, \ - win->_maxx, win->_maxy)); \ - return(ERR); \ - } -#else -#define CHECK_POSITION(win, x, y) /* nothing */ -#endif - -static bool -newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos) -{ - bool result = FALSE; - - if (*ypos >= win->_regtop && *ypos == win->_regbottom) { - *ypos = win->_regbottom; - result = TRUE; - } else { - *ypos = (NCURSES_SIZE_T) (*ypos + 1); - } - return result; -} - -/* - * The _WRAPPED flag is useful only for telling an application that we've just - * wrapped the cursor. We don't do anything with this flag except set it when - * wrapping, and clear it whenever we move the cursor. If we try to wrap at - * the lower-right corner of a window, we cannot move the cursor (since that - * wouldn't be legal). So we return an error (which is what SVr4 does). - * Unlike SVr4, we can successfully add a character to the lower-right corner - * (Solaris 2.6 does this also, however). - */ -static int -wrap_to_next_line(WINDOW *win) -{ - win->_flags |= _WRAPPED; - if (newline_forces_scroll(win, &(win->_cury))) { - win->_curx = win->_maxx; - if (!win->_scroll) - return (ERR); - scroll(win); - } - win->_curx = 0; - return (OK); -} - -static int wadd_wch_literal(WINDOW *, cchar_t); -/* - * Fill the given number of cells with blanks using the current background - * rendition. This saves/restores the current x-position. - */ -static void -fill_cells(WINDOW *win, int count) -{ - cchar_t blank = blankchar; - int save_x = win->_curx; - int save_y = win->_cury; - - while (count-- > 0) { - if (wadd_wch_literal(win, blank) == ERR) - break; - } - win->_curx = (NCURSES_SIZE_T) save_x; - win->_cury = (NCURSES_SIZE_T) save_y; -} - -static int -wadd_wch_literal(WINDOW *win, cchar_t ch) -{ - int x; - int y; - struct ldat *line; - - x = win->_curx; - y = win->_cury; - - CHECK_POSITION(win, x, y); - - ch = render_char(win, ch); - - line = win->_line + y; - - CHANGED_CELL(line, x); - - /* - * Non-spacing characters are added to the current cell. - * - * Spacing characters that are wider than one column require some display - * adjustments. - */ - { - int len = wcwidth(CharOf(ch)); - int i; - int j; - wchar_t *chars; - - if (len == 0) { /* non-spacing */ - if ((x > 0 && y >= 0) - || (win->_maxx >= 0 && win->_cury >= 1)) { - if (x > 0 && y >= 0) - chars = (win->_line[y].text[x - 1].chars); - else - chars = (win->_line[y - 1].text[win->_maxx].chars); - for (i = 0; i < CCHARW_MAX; ++i) { - if (chars[i] == 0) { - TR(TRACE_VIRTPUT, - ("added non-spacing %d: %x", - x, (int) CharOf(ch))); - chars[i] = CharOf(ch); - break; - } - } - } - goto testwrapping; - } else if (len > 1) { /* multi-column characters */ - /* - * Check if the character will fit on the current line. If it does - * not fit, fill in the remainder of the line with blanks. and - * move to the next line. - */ - if (len > win->_maxx + 1) { - TR(TRACE_VIRTPUT, ("character will not fit")); - return ERR; - } else if (x + len > win->_maxx + 1) { - int count = win->_maxx + 1 - x; - TR(TRACE_VIRTPUT, ("fill %d remaining cells", count)); - fill_cells(win, count); - if (wrap_to_next_line(win) == ERR) - return ERR; - x = win->_curx; - y = win->_cury; - line = win->_line + y; - } - /* - * Check for cells which are orphaned by adding this character, set - * those to blanks. - * - * FIXME: this actually could fill j-i cells, more complicated to - * setup though. - */ - for (i = 0; i < len; ++i) { - if (isWidecBase(win->_line[y].text[x + i])) { - break; - } else if (isWidecExt(win->_line[y].text[x + i])) { - for (j = i; x + j <= win->_maxx; ++j) { - if (!isWidecExt(win->_line[y].text[x + j])) { - TR(TRACE_VIRTPUT, ("fill %d orphan cells", j)); - fill_cells(win, j); - break; - } - } - break; - } - } - /* - * Finally, add the cells for this character. - */ - for (i = 0; i < len; ++i) { - cchar_t value = ch; - SetWidecExt(value, i); - TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)", - i + 1, len, - win->_begy + y, win->_begx + x)); - line->text[x] = value; - CHANGED_CELL(line, x); - ++x; - } - goto testwrapping; - } - } - - /* - * Single-column characters. - */ - line->text[x++] = ch; - /* - * This label is used only for wide-characters. - */ - testwrapping: - - TR(TRACE_VIRTPUT, ("cell (%ld, %ld..%d) = %s", - (long) win->_cury, (long) win->_curx, x - 1, - _tracech_t(CHREF(ch)))); - - if (x > win->_maxx) { - return wrap_to_next_line(win); - } - win->_curx = (NCURSES_SIZE_T) x; - return OK; -} - -static NCURSES_INLINE int -wadd_wch_nosync(WINDOW *win, cchar_t ch) -/* the workhorse function -- add a character to the given window */ -{ - NCURSES_SIZE_T x, y; - wchar_t *s; - int tabsize = 8; -#if USE_REENTRANT - SCREEN *sp = _nc_screen_of(win); -#endif - - /* - * If we are using the alternate character set, forget about locale. - * Otherwise, if the locale claims the code is printable, treat it that - * way. - */ - if ((AttrOf(ch) & A_ALTCHARSET) - || iswprint((wint_t) CharOf(ch))) - return wadd_wch_literal(win, ch); - - /* - * Handle carriage control and other codes that are not printable, or are - * known to expand to more than one character according to unctrl(). - */ - x = win->_curx; - y = win->_cury; - - switch (CharOf(ch)) { - case '\t': -#if USE_REENTRANT - tabsize = *ptrTabsize(sp); -#else - tabsize = TABSIZE; -#endif - x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize))); - /* - * Space-fill the tab on the bottom line so that we'll get the - * "correct" cursor position. - */ - if ((!win->_scroll && (y == win->_regbottom)) - || (x <= win->_maxx)) { - cchar_t blank = blankchar; - AddAttr(blank, AttrOf(ch)); - while (win->_curx < x) { - if (wadd_wch_literal(win, blank) == ERR) - return (ERR); - } - break; - } else { - wclrtoeol(win); - win->_flags |= _WRAPPED; - if (newline_forces_scroll(win, &y)) { - x = win->_maxx; - if (win->_scroll) { - scroll(win); - x = 0; - } - } else { - x = 0; - } - } - break; - case '\n': - wclrtoeol(win); - if (newline_forces_scroll(win, &y)) { - if (win->_scroll) - scroll(win); - else - return (ERR); - } - /* FALLTHRU */ - case '\r': - x = 0; - win->_flags &= ~_WRAPPED; - break; - case '\b': - if (x == 0) - return (OK); - x--; - win->_flags &= ~_WRAPPED; - break; - default: - if ((s = wunctrl(&ch)) != 0) { - while (*s) { - cchar_t sch; - SetChar(sch, *s++, AttrOf(ch)); - if_EXT_COLORS(SetPair(sch, GetPair(ch))); - if (wadd_wch_literal(win, sch) == ERR) - return ERR; - } - return OK; - } - return ERR; - } - - win->_curx = x; - win->_cury = y; - - return OK; -} - -/* - * The versions below call _nc_synchook(). We wanted to avoid this in the - * version exported for string puts; they'll call _nc_synchook once at end - * of run. - */ - -/* These are actual entry points */ +MODULE_ID("$Id: lib_add_wch.c,v 1.6 2006/12/02 21:19:17 tom Exp $") NCURSES_EXPORT(int) wadd_wch(WINDOW *win, const cchar_t *wch) { + PUTC_DATA; + int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), - (void *) win, - _tracecchar_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, + _tracech_t(wch))); - if (win && (wadd_wch_nosync(win, *wch) != ERR)) { - _nc_synchook(win); - code = OK; + if (win != 0) { + PUTC_INIT; + for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { + attr_t attrs = (wch->attr & A_ATTRIBUTES); + + if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') + break; + if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { + code = ERR; + if (is8bits(PUTC_ch)) + code = waddch(win, UChar(PUTC_ch) | attrs); + break; + } + for (n = 0; n < PUTC_n; n++) { + if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { + break; + } + } + if (code == ERR) + break; + } } TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); @@ -425,19 +77,37 @@ wadd_wch(WINDOW *win, const cchar_t *wch) NCURSES_EXPORT(int) wecho_wchar(WINDOW *win, const cchar_t *wch) { + PUTC_DATA; + int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), - (void *) win, - _tracecchar_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win, + _tracech_t(wch))); - if (win && (wadd_wch_nosync(win, *wch) != ERR)) { - bool save_immed = win->_immed; - win->_immed = TRUE; - _nc_synchook(win); - win->_immed = save_immed; - code = OK; + if (win != 0) { + PUTC_INIT; + for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { + attr_t attrs = (wch->attr & A_ATTRIBUTES); + + if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') + break; + if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { + code = ERR; + if (is8bits(PUTC_ch)) + code = waddch(win, UChar(PUTC_ch) | attrs); + break; + } + for (n = 0; n < PUTC_n; n++) { + if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { + break; + } + } + if (code == ERR) + break; + } + wrefresh(win); } + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); return (code); } diff --git a/ncurses/widechar/lib_box_set.c b/ncurses/widechar/lib_box_set.c index 585c94963b0..35fce46d8d4 100644 --- a/ncurses/widechar/lib_box_set.c +++ b/ncurses/widechar/lib_box_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2003,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_box_set.c,v 1.5 2009/10/24 22:36:56 tom Exp $") +MODULE_ID("$Id: lib_box_set.c,v 1.4 2003/12/06 18:02:13 tom Exp $") NCURSES_EXPORT(int) wborder_set(WINDOW *win, @@ -53,7 +53,7 @@ wborder_set(WINDOW *win, NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - (void *) win, + win, _tracech_t2(1, ls), _tracech_t2(2, rs), _tracech_t2(3, ts), diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index c61c79529db..b4a0c37a285 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.20 2010/12/25 23:46:26 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.12 2007/05/12 19:03:06 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -50,15 +50,15 @@ setcchar(cchar_t *wcval, short color_pair, const void *opts) { - unsigned i; - unsigned len; + int i; + int len; int code = OK; TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), - (void *) wcval, _nc_viswbuf(wch), + wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); - len = (unsigned) wcslen(wch); + len = wcslen(wch); if (opts != NULL || (len > 1 && wcwidth(wch[0]) < 0)) { code = ERR; @@ -80,7 +80,7 @@ setcchar(cchar_t *wcval, memset(wcval, 0, sizeof(*wcval)); if (len != 0) { - SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair)); + SetAttr(*wcval, attrs | COLOR_PAIR(color_pair)); SetPair(CHDEREF(wcval), color_pair); memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, @@ -104,28 +104,20 @@ getcchar(const cchar_t *wcval, int code = ERR; TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), - (const void *) wcval, - (void *) wch, - (void *) attrs, - (void *) color_pair, - opts)); + wcval, wch, attrs, color_pair, opts)); if (opts == NULL) { - len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) - ? (int) (wp - wcval->chars) - : CCHARW_MAX); + len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? wp - wcval->chars + : CCHARW_MAX; if (wch == NULL) { - /* - * If the value is a null, set the length to 1. - * If the value is not a null, return the length plus 1 for null. - */ - code = (len < CCHARW_MAX) ? (len + 1) : CCHARW_MAX; + code = len; } else if (attrs == 0 || color_pair == 0) { code = ERR; } else if (len >= 0) { *attrs = AttrOf(*wcval) & A_ATTRIBUTES; - *color_pair = (short) GetPair(*wcval); + *color_pair = GetPair(*wcval); wmemcpy(wch, wcval->chars, (unsigned) len); wch[len] = L'\0'; code = OK; diff --git a/ncurses/widechar/lib_erasewchar.c b/ncurses/widechar/lib_erasewchar.c index a4ee93ffa42..7d6455370ff 100644 --- a/ncurses/widechar/lib_erasewchar.c +++ b/ncurses/widechar/lib_erasewchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: lib_erasewchar.c,v 1.2 2010/07/24 11:35:12 tom Exp $") +MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") /* * erasewchar() @@ -42,7 +42,7 @@ MODULE_ID("$Id: lib_erasewchar.c,v 1.2 2010/07/24 11:35:12 tom Exp $") */ NCURSES_EXPORT(int) -erasewchar(wchar_t *wch) +erasewchar(wchar_t * wch) { int value; int result = ERR; @@ -63,7 +63,7 @@ erasewchar(wchar_t *wch) */ NCURSES_EXPORT(int) -killwchar(wchar_t *wch) +killwchar(wchar_t * wch) { int value; int result = ERR; diff --git a/ncurses/widechar/lib_get_wch.c b/ncurses/widechar/lib_get_wch.c index 32033df2ff9..6cf3129f2d1 100644 --- a/ncurses/widechar/lib_get_wch.c +++ b/ncurses/widechar/lib_get_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-2007,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 * @@ -40,7 +40,22 @@ #include #include -MODULE_ID("$Id: lib_get_wch.c,v 1.22 2010/08/28 21:00:35 tom Exp $") +MODULE_ID("$Id: lib_get_wch.c,v 1.17 2008/08/16 19:22:55 tom Exp $") + +#if HAVE_MBTOWC && HAVE_MBLEN +#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) +#define count_mbytes(buffer,length,state) mblen(buffer,length) +#define check_mbytes(wch,buffer,length,state) \ + (int) mbtowc(&wch, buffer, length) +#define state_unused +#elif HAVE_MBRTOWC && HAVE_MBRLEN +#define reset_mbytes(state) init_mb(state) +#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) +#define check_mbytes(wch,buffer,length,state) \ + (int) mbrtowc(&wch, buffer, length, &state) +#else +make an error +#endif NCURSES_EXPORT(int) wget_wch(WINDOW *win, wint_t *result) @@ -50,13 +65,13 @@ wget_wch(WINDOW *win, wint_t *result) char buffer[(MB_LEN_MAX * 9) + 1]; /* allow some redundant shifts */ int status; size_t count = 0; - int value = 0; + unsigned long value; wchar_t wch; #ifndef state_unused mbstate_t state; #endif - T((T_CALLED("wget_wch(%p)"), (void *) win)); + T((T_CALLED("wget_wch(%p)"), win)); /* * We can get a stream of single-byte characters and KEY_xxx codes from @@ -80,12 +95,12 @@ wget_wch(WINDOW *win, wint_t *result) * whether the improvement would be worth the effort. */ if (count != 0) { - safe_ungetch(SP_PARM, value); + _nc_ungetch(sp, (int) value); code = ERR; } break; } else if (count + 1 >= sizeof(buffer)) { - safe_ungetch(SP_PARM, value); + _nc_ungetch(sp, (int) value); code = ERR; break; } else { @@ -96,7 +111,7 @@ wget_wch(WINDOW *win, wint_t *result) reset_mbytes(state); if (check_mbytes(wch, buffer, count, state) != status) { code = ERR; /* the two calls should match */ - safe_ungetch(SP_PARM, value); + _nc_ungetch(sp, (int) value); } value = wch; break; @@ -106,8 +121,8 @@ wget_wch(WINDOW *win, wint_t *result) } else { code = ERR; } - *result = (wint_t) value; + *result = value; _nc_unlock_global(curses); - T(("result %#o", value)); + T(("result %#lo", value)); returnCode(code); } diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c index 0b450211b2c..baa70a5a53f 100644 --- a/ncurses/widechar/lib_get_wstr.c +++ b/ncurses/widechar/lib_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-2004,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 * @@ -38,8 +38,9 @@ */ #include +#include -MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $") +MODULE_ID("$Id: lib_get_wstr.c,v 1.10 2008/08/16 19:25:33 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -95,7 +96,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen) wint_t ch; int y, x, code; - T((T_CALLED("wgetn_wstr(%p,%p, %d)"), (void *) win, (void *) str, maxlen)); + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); if (!win) returnCode(ERR); diff --git a/ncurses/widechar/lib_hline_set.c b/ncurses/widechar/lib_hline_set.c index da92b834f1c..43175de8346 100644 --- a/ncurses/widechar/lib_hline_set.c +++ b/ncurses/widechar/lib_hline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_hline_set.c,v 1.4 2010/12/19 01:45:03 tom Exp $") +MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") NCURSES_EXPORT(int) -whline_set(WINDOW *win, const cchar_t *ch, int n) +whline_set(WINDOW *win, const cchar_t * ch, int n) { int code = ERR; - int start; - int end; + NCURSES_SIZE_T start; + NCURSES_SIZE_T end; - T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); + T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/ncurses/widechar/lib_in_wch.c b/ncurses/widechar/lib_in_wch.c index b2396508ba2..5cd92e382de 100644 --- a/ncurses/widechar/lib_in_wch.c +++ b/ncurses/widechar/lib_in_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_in_wch.c,v 1.5 2009/10/24 22:37:55 tom Exp $") +MODULE_ID("$Id: lib_in_wch.c,v 1.4 2006/09/03 15:41:22 tom Exp $") NCURSES_EXPORT(int) win_wch(WINDOW *win, cchar_t *wcval) @@ -47,7 +47,7 @@ win_wch(WINDOW *win, cchar_t *wcval) int row, col; int code = OK; - TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval)); + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); if (win != 0 && wcval != 0) { getyx(win, row, col); diff --git a/ncurses/widechar/lib_in_wchnstr.c b/ncurses/widechar/lib_in_wchnstr.c index 57cc2ca6e73..e9f0646ea66 100644 --- a/ncurses/widechar/lib_in_wchnstr.c +++ b/ncurses/widechar/lib_in_wchnstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002-2004-2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,14 +39,14 @@ #include -MODULE_ID("$Id: lib_in_wchnstr.c,v 1.8 2009/10/24 22:37:48 tom Exp $") +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $") NCURSES_EXPORT(int) win_wchnstr(WINDOW *win, cchar_t *wchstr, int n) { int code = OK; - T((T_CALLED("win_wchnstr(%p,%p,%d)"), (void *) win, (void *) wchstr, n)); + T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); if (win != 0 && wchstr != 0) { NCURSES_CH_T *src; diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index 1eee8a3ec01..c3d0420e53b 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-2003,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,44 +39,39 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.8 2005/12/03 20:24:19 tom Exp $") /* * Insert the given character, updating the current location to simplify * inserting a string. */ -NCURSES_EXPORT(int) +static int _nc_insert_wch(WINDOW *win, const cchar_t *wch) { int cells = wcwidth(CharOf(CHDEREF(wch))); int cell; - int code = OK; - if (cells < 0) { - code = winsch(win, (chtype) CharOf(CHDEREF(wch))); - } else { - if (cells == 0) - cells = 1; + if (cells <= 0) + cells = 1; - if (win->_curx <= win->_maxx) { - struct ldat *line = &(win->_line[win->_cury]); - NCURSES_CH_T *end = &(line->text[win->_curx]); - NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); - NCURSES_CH_T *temp2 = temp1 - cells; + if (win->_curx <= win->_maxx) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - cells; - CHANGED_TO_EOL(line, win->_curx, win->_maxx); - while (temp1 > end) - *temp1-- = *temp2--; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; - *temp1 = _nc_render(win, *wch); - for (cell = 1; cell < cells; ++cell) { - SetWidecExt(temp1[cell], cell); - } - - win->_curx++; + *temp1 = _nc_render(win, *wch); + for (cell = 1; cell < cells; ++cell) { + SetWidecExt(temp1[cell], cell); } + + win->_curx++; } - return code; + return OK; } NCURSES_EXPORT(int) @@ -86,7 +81,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) NCURSES_SIZE_T ox; int code = ERR; - T((T_CALLED("wins_wch(%p, %s)"), (void *) win, _tracecchar_t(wch))); + T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); if (win != 0) { oy = win->_cury; @@ -109,23 +104,20 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T ox; const wchar_t *cp; - T((T_CALLED("wins_nwstr(%p,%s,%d)"), - (void *) win, _nc_viswbufn(wstr, n), n)); + T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n)); if (win != 0 && wstr != 0) { if (n < 1) - n = (int) wcslen(wstr); + n = wcslen(wstr); code = OK; if (n > 0) { - SCREEN *sp = _nc_screen_of(win); - oy = win->_cury; ox = win->_curx; for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { int len = wcwidth(*cp); - if ((len >= 0 && len != 1) || !is7bits(*cp)) { + if (len != 1 || !is8bits(*cp)) { cchar_t tmp_cchar; wchar_t tmp_wchar = *cp; memset(&tmp_cchar, 0, sizeof(tmp_cchar)); @@ -137,7 +129,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) code = _nc_insert_wch(win, &tmp_cchar); } else { /* tabs, other ASCII stuff */ - code = _nc_insert_ch(sp, win, (chtype) (*cp)); + code = _nc_insert_ch(win, (chtype) (*cp)); } if (code != OK) break; diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c index 4cf7182ae06..2207a5f5d19 100644 --- a/ncurses/widechar/lib_inwstr.c +++ b/ncurses/widechar/lib_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2009 Free Software Foundation, Inc. * + * Copyright (c) 2002,2004 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $") +MODULE_ID("$Id: lib_inwstr.c,v 1.4 2004/10/23 20:41:28 tom Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) @@ -50,7 +50,7 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n) cchar_t *text; wchar_t wch; - T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n)); + T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); if (wstr != 0) { if (win) { getyx(win, row, col); @@ -93,7 +93,7 @@ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; - T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); + T((T_CALLED("winwstr(%p,%p)"), win, wstr)); if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) result = ERR; returnCode(result); diff --git a/ncurses/widechar/lib_pecho_wchar.c b/ncurses/widechar/lib_pecho_wchar.c index b6da7a86569..e6127757431 100644 --- a/ncurses/widechar/lib_pecho_wchar.c +++ b/ncurses/widechar/lib_pecho_wchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004,2009 Free Software Foundation, Inc. * + * Copyright (c) 2004 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,12 +32,12 @@ #include -MODULE_ID("$Id: lib_pecho_wchar.c,v 1.2 2009/10/24 22:43:32 tom Exp $") +MODULE_ID("$Id: lib_pecho_wchar.c,v 1.1 2004/01/03 21:42:01 tom Exp $") NCURSES_EXPORT(int) -pecho_wchar(WINDOW *pad, const cchar_t *wch) +pecho_wchar(WINDOW *pad, const cchar_t * wch) { - T((T_CALLED("pecho_wchar(%p, %s)"), (void *) pad, _tracech_t(wch))); + T((T_CALLED("pecho_wchar(%p, %s)"), pad, _tracech_t(wch))); if (pad == 0) returnCode(ERR); diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c index 7a626a9eee8..bb2c4a084b1 100644 --- a/ncurses/widechar/lib_unget_wch.c +++ b/ncurses/widechar/lib_unget_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-2007,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.14 2010/07/24 11:35:21 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.10 2008/06/07 14:50:37 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -55,24 +55,24 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state) const wchar_t *tempp = temp; temp[0] = source; temp[1] = 0; - result = (int) wcsrtombs(NULL, &tempp, 0, state); + result = wcsrtombs(NULL, &tempp, 0, state); } else { - result = (int) wcrtomb(target, source, state); + result = wcrtomb(target, source, state); } if (!isEILSEQ(result) && (result == 0)) result = 1; - return (size_t) result; + return result; } NCURSES_EXPORT(int) -NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) +unget_wch(const wchar_t wch) { int result = OK; mbstate_t state; size_t length; int n; - T((T_CALLED("unget_wch(%p, %#lx)"), (void *) SP_PARM, (unsigned long) wch)); + T((T_CALLED("unget_wch(%#lx)"), (unsigned long) wch)); init_mb(state); length = _nc_wcrtomb(0, wch, &state); @@ -83,12 +83,10 @@ NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) if ((string = (char *) malloc(length)) != 0) { init_mb(state); - /* ignore the result, since we already validated the character */ - IGNORE_RC((int) wcrtomb(string, wch, &state)); + wcrtomb(string, wch, &state); for (n = (int) (length - 1); n >= 0; --n) { - if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx - UChar(string[n])) !=OK) { + if (_nc_ungetch(SP, string[n]) != OK) { result = ERR; break; } @@ -103,11 +101,3 @@ NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) returnCode(result); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -unget_wch(const wchar_t wch) -{ - return NCURSES_SP_NAME(unget_wch) (CURRENT_SCREEN, wch); -} -#endif diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c index e4cf093a1f6..1dc679e6d90 100644 --- a/ncurses/widechar/lib_vid_attr.c +++ b/ncurses/widechar/lib_vid_attr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,14 +31,11 @@ ****************************************************************************/ #include +#include -#ifndef CUR -#define CUR SP_TERMTYPE -#endif +MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") -MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $") - -#define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc) +#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -53,22 +50,14 @@ MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $") if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \ - old_pair, pair, \ - reverse, outc); \ + _nc_do_color(old_pair, pair, reverse, outc); \ } \ } -#define set_color(mode, pair) \ - mode &= ALL_BUT_COLOR; \ - mode |= (attr_t) ColorPair(pair) +#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= COLOR_PAIR(pair) NCURSES_EXPORT(int) -NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx - attr_t newmode, - short pair, - void *opts GCC_UNUSED, - NCURSES_SP_OUTC outc) +vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) { #if NCURSES_EXT_COLORS static attr_t previous_attr = A_NORMAL; @@ -76,9 +65,9 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx attr_t turn_on, turn_off; bool reverse = FALSE; - bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); + bool can_color = (SP == 0 || SP->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); + bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); #else #define fix_pair0 FALSE #endif @@ -87,18 +76,18 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); /* this allows us to go on whether or not newterm() has been called */ - if (SP_PARM) { - previous_attr = AttrOf(SCREEN_ATTRS(SP_PARM)); - previous_pair = GetPair(SCREEN_ATTRS(SP_PARM)); + if (SP) { + previous_attr = AttrOf(SCREEN_ATTRS(SP)); + previous_pair = GetPair(SCREEN_ATTRS(SP)); } TR(TRACE_ATTRS, ("previous attribute was %s, %d", _traceattr(previous_attr), previous_pair)); #if !USE_XMC_SUPPORT - if ((SP_PARM != 0) + if ((SP != 0) && (magic_cookie_glitch > 0)) - newmode &= ~(SP_PARM->_xmc_suppress); + newmode &= ~(SP->_xmc_suppress); #endif /* @@ -155,10 +144,10 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP_PARM || SP_PARM->_use_rmul) { + if (!SP || SP->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP_PARM || SP_PARM->_use_rmso) { + if (!SP || SP->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -170,18 +159,16 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx - TPARM_9(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), - 1, outc); + tputs(TPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), 1, outc); previous_attr &= ALL_BUT_COLOR; previous_pair = 0; } @@ -192,11 +179,11 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP_PARM || SP_PARM->_use_rmul) { + if (!SP || SP->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP_PARM || SP_PARM->_use_rmso) { + if (!SP || SP->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -234,9 +221,9 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx if (reverse) newmode |= A_REVERSE; - if (SP_PARM) { - SetAttr(SCREEN_ATTRS(SP_PARM), newmode); - SetPair(SCREEN_ATTRS(SP_PARM), pair); + if (SP) { + SetAttr(SCREEN_ATTRS(SP), newmode); + SetPair(SCREEN_ATTRS(SP), pair); } else { previous_attr = newmode; previous_pair = pair; @@ -246,60 +233,29 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx #else T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); set_color(newmode, pair); - returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, outc)); + returnCode(vidputs(newmode, outc)); #endif } -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) -vid_puts(attr_t newmode, - short pair, - void *opts GCC_UNUSED, - NCURSES_OUTC outc) -{ - SetSafeOutcWrapper(outc); - return NCURSES_SP_NAME(vid_puts) (CURRENT_SCREEN, - newmode, - pair, - opts, - _nc_outc_wrapper); -} -#endif - #undef vid_attr NCURSES_EXPORT(int) -NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx - attr_t newmode, - short pair, - void *opts) -{ - T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); - returnCode(NCURSES_SP_NAME(vid_puts) (NCURSES_SP_ARGx - newmode, - pair, - opts, - NCURSES_SP_NAME(_nc_outch))); -} - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(int) vid_attr(attr_t newmode, short pair, void *opts) { - return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts); + T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); + returnCode(vid_puts(newmode, pair, opts, _nc_outch)); } -#endif /* * This implementation uses the same mask values for A_xxx and WA_xxx, so * we can use termattrs() for part of the logic. */ NCURSES_EXPORT(attr_t) -NCURSES_SP_NAME(term_attrs) (NCURSES_SP_DCL0) +term_attrs(void) { attr_t attrs; T((T_CALLED("term_attrs()"))); - attrs = SP_PARM ? NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG) : 0; + attrs = termattrs(); /* these are only supported for wide-character mode */ if (enter_horizontal_hl_mode) @@ -317,11 +273,3 @@ NCURSES_SP_NAME(term_attrs) (NCURSES_SP_DCL0) returnAttr(attrs); } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(attr_t) -term_attrs(void) -{ - return NCURSES_SP_NAME(term_attrs) (CURRENT_SCREEN); -} -#endif diff --git a/ncurses/widechar/lib_vline_set.c b/ncurses/widechar/lib_vline_set.c index 917caac44b4..af42df1f24a 100644 --- a/ncurses/widechar/lib_vline_set.c +++ b/ncurses/widechar/lib_vline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_vline_set.c,v 1.4 2010/12/19 01:50:50 tom Exp $") +MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") NCURSES_EXPORT(int) -wvline_set(WINDOW *win, const cchar_t *ch, int n) +wvline_set(WINDOW *win, const cchar_t * ch, int n) { int code = ERR; - int row, col; - int end; + NCURSES_SIZE_T row, col; + NCURSES_SIZE_T end; - T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); + T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); if (win) { NCURSES_CH_T wch; diff --git a/ncurses/widechar/lib_wacs.c b/ncurses/widechar/lib_wacs.c index 5a16e457e09..fe893b4d2f8 100644 --- a/ncurses/widechar/lib_wacs.c +++ b/ncurses/widechar/lib_wacs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -31,8 +31,9 @@ ****************************************************************************/ #include +#include -MODULE_ID("$Id: lib_wacs.c,v 1.10 2010/12/19 01:43:19 tom Exp $") +MODULE_ID("$Id: lib_wacs.c,v 1.7 2006/12/17 15:16:17 tom Exp $") NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; @@ -41,7 +42,7 @@ _nc_init_wacs(void) { /* *INDENT-OFF* */ static const struct { - unsigned map; + int map; int value[2]; } table[] = { /* VT100 symbols */ @@ -79,30 +80,6 @@ _nc_init_wacs(void) { '{', { '*', 0x03c0 }}, /* greek pi */ { '|', { '!', 0x2260 }}, /* not-equal */ { '}', { 'f', 0x00a3 }}, /* pound-sterling symbol */ - /* thick-line-drawing */ - { 'L', { '+', 0x250f }}, /* upper left corner */ - { 'M', { '+', 0x2517 }}, /* lower left corner */ - { 'K', { '+', 0x2513 }}, /* upper right corner */ - { 'J', { '+', 0x251b }}, /* lower right corner */ - { 'T', { '+', 0x2523 }}, /* tee pointing left */ - { 'U', { '+', 0x252b }}, /* tee pointing right */ - { 'V', { '+', 0x253b }}, /* tee pointing up */ - { 'W', { '+', 0x2533 }}, /* tee pointing down */ - { 'Q', { '-', 0x2501 }}, /* horizontal line */ - { 'X', { '|', 0x2503 }}, /* vertical line */ - { 'N', { '+', 0x254b }}, /* large plus or crossover */ - /* double-line-drawing */ - { 'C', { '+', 0x2554 }}, /* upper left corner */ - { 'D', { '+', 0x255a }}, /* lower left corner */ - { 'B', { '+', 0x2557 }}, /* upper right corner */ - { 'A', { '+', 0x255d }}, /* lower right corner */ - { 'G', { '+', 0x2563 }}, /* tee pointing left */ - { 'F', { '+', 0x2560 }}, /* tee pointing right */ - { 'H', { '+', 0x2569 }}, /* tee pointing up */ - { 'I', { '+', 0x2566 }}, /* tee pointing down */ - { 'R', { '-', 0x2550 }}, /* horizontal line */ - { 'Y', { '|', 0x2551 }}, /* vertical line */ - { 'E', { '+', 0x256c }}, /* large plus or crossover */ }; /* *INDENT-ON* */ diff --git a/ncurses/widechar/lib_wunctrl.c b/ncurses/widechar/lib_wunctrl.c index 50958e44c7b..be2259acdcf 100644 --- a/ncurses/widechar/lib_wunctrl.c +++ b/ncurses/widechar/lib_wunctrl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,31 +35,21 @@ #include -MODULE_ID("$Id: lib_wunctrl.c,v 1.14 2010/12/19 01:42:15 tom Exp $") +MODULE_ID("$Id: lib_wunctrl.c,v 1.12 2007/06/12 20:22:32 tom Exp $") NCURSES_EXPORT(wchar_t *) -NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc) +wunctrl(cchar_t *wc) { - static wchar_t str[CCHARW_MAX + 1], *wsp; + static wchar_t str[CCHARW_MAX + 1], *sp; if (Charable(*wc)) { - const char *p = - NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx - (unsigned) _nc_to_char((wint_t)CharOf(*wc))); + const char *p = unctrl((unsigned) _nc_to_char((wint_t) CharOf(*wc))); - for (wsp = str; *p; ++p) { - *wsp++ = (wchar_t) _nc_to_widechar(*p); + for (sp = str; *p; ++p) { + *sp++ = _nc_to_widechar(*p); } - *wsp = 0; + *sp = 0; return str; } else return wc->chars; } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(wchar_t *) -wunctrl(cchar_t *wc) -{ - return NCURSES_SP_NAME(wunctrl) (CURRENT_SCREEN, wc); -} -#endif diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c deleted file mode 100644 index e1ef3401de3..00000000000 --- a/ncurses/win32con/gettimeofday.c +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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. * - ****************************************************************************/ - -#define WINVER 0x0501 - -#include - -#include - -MODULE_ID("$Id: gettimeofday.c,v 1.2 2010/01/16 15:18:51 tom Exp $") - -#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ - -int -gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) -{ - union { - FILETIME ft; - long long since1601; /* time since 1 Jan 1601 in 100ns units */ - } data; - - GetSystemTimeAsFileTime(&data.ft); - tv->tv_usec = (long) ((data.since1601 / 10LL) % 1000000LL); - tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL); - return (0); -} diff --git a/ncurses/win32con/wcwidth.c b/ncurses/win32con/wcwidth.c deleted file mode 100644 index cdef64a23c0..00000000000 --- a/ncurses/win32con/wcwidth.c +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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"), 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. * - ****************************************************************************/ -#include - -MODULE_ID("$Id: wcwidth.c,v 1.2 2010/08/07 20:52:43 tom Exp $") - -#if USE_WIDEC_SUPPORT -#define mk_wcwidth(ucs) _nc_wcwidth(ucs) -#define mk_wcswidth(pwcs, n) _nc_wcswidth(pwcs, n) -#define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) -#define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) - -extern int mk_wcwidth(wchar_t); -extern int mk_wcswidth(const wchar_t *, size_t); -extern int mk_wcwidth_cjk(wchar_t); -extern int mk_wcswidth_cjk(const wchar_t *, size_t); - -#include -#else -void _nc_empty_wcwidth(void); -void -_nc_empty_wcwidth(void) -{ -} -#endif diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c deleted file mode 100644 index c214639cd4d..00000000000 --- a/ncurses/win32con/win_driver.c +++ /dev/null @@ -1,1241 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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: Juergen Pfeifer * - * * - ****************************************************************************/ - -/* - * TODO - GetMousePos(POINT * result) from ntconio.c - * TODO - implement nodelay - */ - -#include -#define CUR my_term.type. - -MODULE_ID("$Id: win_driver.c,v 1.10 2010/12/25 19:28:21 tom Exp $") - -#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) - -#define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC) -#define SetSP() assert(TCB->csp!=0); sp = TCB->csp - -#define GenMap(vKey,key) MAKELONG(key, vKey) - -static const LONG keylist[] = -{ - GenMap(VK_PRIOR, KEY_PPAGE), - GenMap(VK_NEXT, KEY_NPAGE), - GenMap(VK_END, KEY_END), - GenMap(VK_HOME, KEY_HOME), - GenMap(VK_LEFT, KEY_LEFT), - GenMap(VK_UP, KEY_UP), - GenMap(VK_RIGHT, KEY_RIGHT), - GenMap(VK_DOWN, KEY_DOWN), - GenMap(VK_DELETE, KEY_DC), - GenMap(VK_INSERT, KEY_IC) -}; -#define N_INI ((int)(sizeof(keylist)/sizeof(keylist[0]))) -#define FKEYS 24 -#define MAPSIZE (FKEYS + N_INI) -#define NUMPAIRS 64 - -typedef struct props { - CONSOLE_SCREEN_BUFFER_INFO SBI; - bool progMode; - DWORD map[MAPSIZE]; - DWORD rmap[MAPSIZE]; - WORD pairs[NUMPAIRS]; -} Properties; - -#define PropOf(TCB) ((Properties*)TCB->prop) - -int -_nc_mingw_ioctl(int fd GCC_UNUSED, - long int request GCC_UNUSED, - struct termios *arg GCC_UNUSED) -{ - return 0; - endwin(); - fprintf(stderr, "TERMINFO currently not supported on Windows.\n"); - exit(1); -} - -static WORD -MapColor(bool fore, int color) -{ - static const int _cmap[] = - {0, 4, 2, 6, 1, 5, 3, 7}; - int a; - if (color < 0 || color > 7) - a = fore ? 7 : 0; - else - a = _cmap[color]; - if (!fore) - a = a << 4; - return (WORD) a; -} - -static WORD -MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, chtype ch) -{ - if (ch & A_COLOR) { - int p; - SCREEN *sp; - - AssertTCB(); - SetSP(); - p = PairNumber(ch); - if (p > 0 && p < NUMPAIRS && TCB != 0 && sp != 0) { - WORD a; - a = PropOf(TCB)->pairs[p]; - res = (res & 0xff00) | a; - } - } - - if (ch & A_REVERSE) - res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4))); - - if (ch & A_STANDOUT) - res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4)) - | BACKGROUND_INTENSITY); - - if (ch & A_BOLD) - res |= FOREGROUND_INTENSITY; - - if (ch & A_DIM) - res |= BACKGROUND_INTENSITY; - - return res; -} - -static BOOL -con_write(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) -{ - CHAR_INFO ci[n]; - COORD loc, siz; - SMALL_RECT rec; - int i; - chtype ch; - SCREEN *sp; - - AssertTCB(); - - if (TCB == 0 || InvalidConsoleHandle(TCB->hdl)) - return FALSE; - - SetSP(); - - for (i = 0; i < n; i++) { - ch = str[i]; - ci[i].Char.AsciiChar = ChCharOf(ch); - ci[i].Attributes = MapAttr(TCB, - PropOf(TCB)->SBI.wAttributes, - ChAttrOf(ch)); - if (ChAttrOf(ch) & A_ALTCHARSET) { - if (sp->_acs_map) - ci[i].Char.AsciiChar = - ChCharOf(NCURSES_SP_NAME(_nc_acs_char) (sp, ChCharOf(ch))); - } - } - - loc.X = (short) 0; - loc.Y = (short) 0; - siz.X = (short) n; - siz.Y = 1; - - rec.Left = (short) x; - rec.Top = (short) y; - rec.Right = (short) (x + n - 1); - rec.Bottom = rec.Top; - - return WriteConsoleOutput(TCB->hdl, ci, siz, loc, &rec); -} - -#define MARK_NOCHANGE(win,row) \ - win->_line[row].firstchar = _NOCHANGE; \ - win->_line[row].lastchar = _NOCHANGE - -static int -drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) -{ - int y, nonempty, n, x0, x1, Width, Height; - SCREEN *sp; - - AssertTCB(); - SetSP(); - - Width = screen_columns(sp); - Height = screen_lines(sp); - nonempty = min(Height, NewScreen(sp)->_maxy + 1); - - if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { - int x; - chtype empty[Width]; - - for (x = 0; x < Width; x++) - empty[x] = ' '; - - for (y = 0; y < nonempty; y++) { - con_write(TCB, y, 0, empty, Width); - memcpy(empty, - CurScreen(sp)->_line[y].text, - Width * sizeof(chtype)); - } - CurScreen(sp)->_clear = FALSE; - NewScreen(sp)->_clear = FALSE; - touchwin(NewScreen(sp)); - } - - for (y = 0; y < nonempty; y++) { - x0 = NewScreen(sp)->_line[y].firstchar; - if (x0 != _NOCHANGE) { - x1 = NewScreen(sp)->_line[y].lastchar; - n = x1 - x0 + 1; - if (n > 0) { - memcpy(CurScreen(sp)->_line[y].text + x0, - NewScreen(sp)->_line[y].text + x0, - n * sizeof(chtype)); - con_write(TCB, - y, - x0, - ((chtype *) CurScreen(sp)->_line[y].text) + x0, n); - - /* mark line changed successfully */ - if (y <= NewScreen(sp)->_maxy) { - MARK_NOCHANGE(NewScreen(sp), y); - } - if (y <= CurScreen(sp)->_maxy) { - MARK_NOCHANGE(CurScreen(sp), y); - } - } - } - } - - /* put everything back in sync */ - for (y = nonempty; y <= NewScreen(sp)->_maxy; y++) { - MARK_NOCHANGE(NewScreen(sp), y); - } - for (y = nonempty; y <= CurScreen(sp)->_maxy; y++) { - MARK_NOCHANGE(CurScreen(sp), y); - } - - if (!NewScreen(sp)->_leaveok) { - CurScreen(sp)->_curx = NewScreen(sp)->_curx; - CurScreen(sp)->_cury = NewScreen(sp)->_cury; - - TCB->drv->hwcur(TCB, 0, 0, CurScreen(sp)->_cury, CurScreen(sp)->_curx); - } - SetConsoleActiveScreenBuffer(TCB->hdl); - return OK; -} - -static bool -drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, - const char *tname, - int *errret GCC_UNUSED) -{ - bool code = FALSE; - - T((T_CALLED("win32con::drv_CanHandle(%p)"), TCB)); - - assert(TCB != 0); - assert(tname != 0); - - TCB->magic = WINMAGIC; - if (*tname == 0 || *tname == 0) { - code = TRUE; - } else { - TERMINAL my_term; - int status; - - code = FALSE; -#if (USE_DATABASE || USE_TERMCAP) - status = _nc_setup_tinfo(tname, &my_term.type); -#else - status = TGETENT_NO; -#endif - if (status != TGETENT_YES) { - const TERMTYPE *fallback = _nc_fallback(tname); - - if (fallback) { - my_term.type = *fallback; - status = TGETENT_YES; - } else if (!strcmp(tname, "unknown")) { - code = TRUE; - } - } - if (status == TGETENT_YES) { - if (generic_type || hard_copy) - code = TRUE; - } - } - - if (code) { - if ((TCB->term.type.Booleans) == 0) { - _nc_init_entry(&(TCB->term.type)); - } - } - - returnBool(code); -} - -static int -drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, - bool beepFlag GCC_UNUSED) -{ - SCREEN *sp; - int res = ERR; - - AssertTCB(); - SetSP(); - - return res; -} - -static int -drv_print(TERMINAL_CONTROL_BLOCK * TCB, - char *data GCC_UNUSED, - int len GCC_UNUSED) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - return ERR; -} - -static int -drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, - int fg GCC_UNUSED, - int bg GCC_UNUSED) -{ - SCREEN *sp; - int code = ERR; - - AssertTCB(); - SetSP(); - - return (code); -} - -static void -drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, - bool fore, - int color, - int (*outc) (SCREEN *, int) GCC_UNUSED) -{ - AssertTCB(); - - if (TCB && !InvalidConsoleHandle(TCB->hdl)) { - WORD a = MapColor(fore, color); - a = ((PropOf(TCB)->SBI.wAttributes) & (fore ? 0xfff8 : 0xff8f)) | a; - SetConsoleTextAttribute(TCB->hdl, a); - GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); - } -} - -static bool -drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) -{ - bool res = FALSE; - - AssertTCB(); - if (TCB && !InvalidConsoleHandle(TCB->hdl)) { - WORD a = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; - SetConsoleTextAttribute(TCB->hdl, a); - GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); - res = TRUE; - } - return res; -} - -static bool -drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) -{ - int result = FALSE; - SCREEN *sp; - - AssertTCB(); - SetSP(); - - return result; -} - -static int -drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *Lines, int *Cols) -{ - AssertTCB(); - - if (TCB == NULL || Lines == NULL || Cols == NULL || InvalidConsoleHandle(TCB->hdl)) - return ERR; - - *Lines = (int) (PropOf(TCB)->SBI.dwSize.Y); - *Cols = (int) (PropOf(TCB)->SBI.dwSize.X); - return OK; -} - -static int -drv_setsize(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, - int l GCC_UNUSED, - int c GCC_UNUSED) -{ - AssertTCB(); - return ERR; -} - -static int -drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) -{ - DWORD dwFlag = 0; - tcflag_t iflag; - tcflag_t lflag; - - AssertTCB(); - - if (TCB == 0 || buf == NULL) - return ERR; - - if (setFlag) { - iflag = buf->c_iflag; - lflag = buf->c_lflag; - - GetConsoleMode(TCB->inp, &dwFlag); - - if (lflag & ICANON) - dwFlag |= ENABLE_LINE_INPUT; - else - dwFlag &= ~ENABLE_LINE_INPUT; - - if (lflag & ECHO) - dwFlag |= ENABLE_ECHO_INPUT; - else - dwFlag &= ~ENABLE_ECHO_INPUT; - - if (iflag & BRKINT) - dwFlag |= ENABLE_PROCESSED_INPUT; - else - dwFlag &= ~ENABLE_PROCESSED_INPUT; - - dwFlag |= ENABLE_MOUSE_INPUT; - - buf->c_iflag = iflag; - buf->c_lflag = lflag; - SetConsoleMode(TCB->inp, dwFlag); - TCB->term.Nttyb = *buf; - } else { - iflag = TCB->term.Nttyb.c_iflag; - lflag = TCB->term.Nttyb.c_lflag; - GetConsoleMode(TCB->inp, &dwFlag); - - if (dwFlag & ENABLE_LINE_INPUT) - lflag |= ICANON; - else - lflag &= ~ICANON; - - if (dwFlag & ENABLE_ECHO_INPUT) - lflag |= ECHO; - else - lflag &= ~ECHO; - - if (dwFlag & ENABLE_PROCESSED_INPUT) - iflag |= BRKINT; - else - iflag &= ~BRKINT; - - TCB->term.Nttyb.c_iflag = iflag; - TCB->term.Nttyb.c_lflag = lflag; - - *buf = TCB->term.Nttyb; - } - return OK; -} - -static int -drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) -{ - SCREEN *sp; - TERMINAL *_term = (TERMINAL *) TCB; - int code = ERR; - - AssertTCB(); - sp = TCB->csp; - - PropOf(TCB)->progMode = progFlag; - SetConsoleActiveScreenBuffer(progFlag ? TCB->hdl : TCB->out); - - if (progFlag) /* prog mode */ { - if (defFlag) { - if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { - _term->Nttyb.c_oflag &= ~OFLAGS_TABS; - code = OK; - } - } else { - /* reset_prog_mode */ - if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { - if (sp) { - if (sp->_keypad_on) - _nc_keypad(sp, TRUE); - NC_BUFFERED(sp, TRUE); - } - code = OK; - } - } - } else { /* shell mode */ - if (defFlag) { - /* def_shell_mode */ - if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { - code = OK; - } - } else { - /* reset_shell_mode */ - if (sp) { - _nc_keypad(sp, FALSE); - NCURSES_SP_NAME(_nc_flush) (sp); - NC_BUFFERED(sp, FALSE); - } - code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); - } - } - - return (code); -} - -static void -drv_screen_init(SCREEN *sp GCC_UNUSED) -{ -} - -static void -drv_wrap(SCREEN *sp GCC_UNUSED) -{ -} - -static int -rkeycompare(const void *el1, const void *el2) -{ - WORD key1 = (LOWORD((*((const LONG *) el1)))) & 0x7fff; - WORD key2 = (LOWORD((*((const LONG *) el2)))) & 0x7fff; - - return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); -} - -static int -keycompare(const void *el1, const void *el2) -{ - WORD key1 = HIWORD((*((const LONG *) el1))); - WORD key2 = HIWORD((*((const LONG *) el2))); - - return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); -} - -static int -MapKey(TERMINAL_CONTROL_BLOCK * TCB, WORD vKey) -{ - WORD nKey = 0; - void *res; - LONG key = GenMap(vKey, 0); - int code = -1; - - AssertTCB(); - - res = bsearch(&key, - PropOf(TCB)->map, - (size_t) (N_INI + FKEYS), - sizeof(keylist[0]), - keycompare); - if (res) { - key = *((LONG *) res); - nKey = LOWORD(key); - code = (int) (nKey & 0x7fff); - if (nKey & 0x8000) - code = -code; - } - return code; -} - -static void -drv_release(TERMINAL_CONTROL_BLOCK * TCB) -{ - T((T_CALLED("win32con::drv_release(%p)"), TCB)); - - AssertTCB(); - if (TCB->prop) - free(TCB->prop); - - returnVoid; -} - -static void -drv_init(TERMINAL_CONTROL_BLOCK * TCB) -{ - DWORD num_buttons; - - T((T_CALLED("win32con::drv_init(%p)"), TCB)); - - AssertTCB(); - - if (TCB) { - BOOL b = AllocConsole(); - WORD a; - int i; - - if (!b) - b = AttachConsole(ATTACH_PARENT_PROCESS); - - TCB->inp = GetStdHandle(STD_INPUT_HANDLE); - TCB->out = GetStdHandle(STD_OUTPUT_HANDLE); - - if (getenv("NCGDB")) - TCB->hdl = TCB->out; - else - TCB->hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, - 0, - NULL, - CONSOLE_TEXTMODE_BUFFER, - NULL); - - if (!InvalidConsoleHandle(TCB->hdl)) { - TCB->prop = typeCalloc(Properties, 1); - GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); - } - - TCB->info.initcolor = TRUE; - TCB->info.canchange = FALSE; - TCB->info.hascolor = TRUE; - TCB->info.caninit = TRUE; - - TCB->info.maxpairs = NUMPAIRS; - TCB->info.maxcolors = 8; - TCB->info.numlabels = 0; - TCB->info.labelwidth = 0; - TCB->info.labelheight = 0; - TCB->info.nocolorvideo = 1; - TCB->info.tabsize = 8; - - if (GetNumberOfConsoleMouseButtons(&num_buttons)) { - T(("mouse has %ld buttons", num_buttons)); - TCB->info.numbuttons = num_buttons; - } else { - TCB->info.numbuttons = 1; - } - - TCB->info.defaultPalette = _nc_cga_palette; - - for (i = 0; i < (N_INI + FKEYS); i++) { - if (i < N_INI) - PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = keylist[i]; - else - PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = - GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI))); - } - qsort(PropOf(TCB)->map, - (size_t) (MAPSIZE), - sizeof(keylist[0]), - keycompare); - qsort(PropOf(TCB)->rmap, - (size_t) (MAPSIZE), - sizeof(keylist[0]), - rkeycompare); - - a = MapColor(true, COLOR_WHITE) | MapColor(false, COLOR_BLACK); - for (i = 0; i < NUMPAIRS; i++) - PropOf(TCB)->pairs[i] = a; - } - returnVoid; -} - -static void -drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, - short pair, - short f, - short b) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - if ((pair > 0) && (pair < NUMPAIRS) && (f >= 0) && (f < 8) - && (b >= 0) && (b < 8)) { - PropOf(TCB)->pairs[pair] = MapColor(true, f) | MapColor(false, b); - } -} - -static void -drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, - short color GCC_UNUSED, - short r GCC_UNUSED, - short g GCC_UNUSED, - short b GCC_UNUSED) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); -} - -static void -drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, - short old_pair GCC_UNUSED, - short pair GCC_UNUSED, - bool reverse GCC_UNUSED, - int (*outc) (SCREEN *, int) GCC_UNUSED -) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); -} - -static void -drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); - - sp->_mouse_type = M_TERM_DRIVER; -} - -static int -drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) -{ - int rc = 0; - SCREEN *sp; - - AssertTCB(); - SetSP(); - - if (sp->_drv_mouse_head < sp->_drv_mouse_tail) { - rc = TW_MOUSE; - } else { - rc = TCBOf(sp)->drv->twait(TCBOf(sp), - TWAIT_MASK, - delay, - (int *) 0 - EVENTLIST_2nd(evl)); - } - - return rc; -} - -static int -drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, - int yold GCC_UNUSED, int xold GCC_UNUSED, - int y, int x) -{ - int ret = ERR; - if (TCB && !InvalidConsoleHandle(TCB->hdl)) { - COORD loc; - loc.X = (short) x; - loc.Y = (short) y; - SetConsoleCursorPosition(TCB->hdl, loc); - ret = OK; - } - return ret; -} - -static void -drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, - int labnum GCC_UNUSED, - char *text GCC_UNUSED) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); -} - -static void -drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, - bool OnFlag GCC_UNUSED) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); -} - -static chtype -drv_conattr(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) -{ - chtype res = A_NORMAL; - res |= (A_BOLD | A_DIM | A_REVERSE | A_STANDOUT | A_COLOR); - return res; -} - -static void -drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) -{ - SCREEN *sp; - - AssertTCB(); - SetSP(); -} - -static void -drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, - chtype *real_map GCC_UNUSED, - chtype *fake_map GCC_UNUSED) -{ -#define DATA(a,b) { a, b } - static struct { - int acs_code; - int use_code; - } table[] = { - DATA('a', 0xb1), /* ACS_CKBOARD */ - DATA('f', 0xf8), /* ACS_DEGREE */ - DATA('g', 0xf1), /* ACS_PLMINUS */ - DATA('j', 0xd9), /* ACS_LRCORNER */ - DATA('l', 0xda), /* ACS_ULCORNER */ - DATA('k', 0xbf), /* ACS_URCORNER */ - DATA('m', 0xc0), /* ACS_LLCORNER */ - DATA('n', 0xc5), /* ACS_PLUS */ - DATA('q', 0xc4), /* ACS_HLINE */ - DATA('t', 0xc3), /* ACS_LTEE */ - DATA('u', 0xb4), /* ACS_RTEE */ - DATA('v', 0xc1), /* ACS_BTEE */ - DATA('w', 0xc2), /* ACS_TTEE */ - DATA('x', 0xb3), /* ACS_VLINE */ - DATA('y', 0xf3), /* ACS_LEQUAL */ - DATA('z', 0xf2), /* ACS_GEQUAL */ - DATA('0', 0xdb), /* ACS_BLOCK */ - DATA('{', 0xe3), /* ACS_PI */ - DATA('}', 0x9c), /* ACS_STERLING */ - DATA(',', 0xae), /* ACS_LARROW */ - DATA('+', 0xaf), /* ACS_RARROW */ - DATA('~', 0xf9), /* ACS_BULLET */ - }; -#undef DATA - unsigned n; - - SCREEN *sp; - AssertTCB(); - SetSP(); - - for (n = 0; n < SIZEOF(table); ++n) { - real_map[table[n].acs_code] = table[n].use_code | A_ALTCHARSET; - if (sp != 0) - sp->_screen_acs_map[table[n].acs_code] = TRUE; - } -} - -static ULONGLONG -tdiff(FILETIME fstart, FILETIME fend) -{ - ULARGE_INTEGER ustart; - ULARGE_INTEGER uend; - ULONGLONG diff; - - ustart.LowPart = fstart.dwLowDateTime; - ustart.HighPart = fstart.dwHighDateTime; - uend.LowPart = fend.dwLowDateTime; - uend.HighPart = fend.dwHighDateTime; - - diff = (uend.QuadPart - ustart.QuadPart) / 10000; - return diff; -} - -static int -Adjust(int milliseconds, int diff) -{ - if (milliseconds == INFINITY) - return milliseconds; - milliseconds -= diff; - if (milliseconds < 0) - milliseconds = 0; - return milliseconds; -} - -#define BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | \ - FROM_LEFT_2ND_BUTTON_PRESSED | \ - FROM_LEFT_3RD_BUTTON_PRESSED | \ - FROM_LEFT_4TH_BUTTON_PRESSED | \ - RIGHTMOST_BUTTON_PRESSED) - -static int -decode_mouse(TERMINAL_CONTROL_BLOCK * TCB, int mask) -{ - SCREEN *sp; - int result = 0; - - AssertTCB(); - SetSP(); - - if (mask & FROM_LEFT_1ST_BUTTON_PRESSED) - result |= BUTTON1_PRESSED; - if (mask & FROM_LEFT_2ND_BUTTON_PRESSED) - result |= BUTTON2_PRESSED; - if (mask & FROM_LEFT_3RD_BUTTON_PRESSED) - result |= BUTTON3_PRESSED; - if (mask & FROM_LEFT_4TH_BUTTON_PRESSED) - result |= BUTTON4_PRESSED; - - if (mask & RIGHTMOST_BUTTON_PRESSED) { - switch (TCB->info.numbuttons) { - case 1: - result |= BUTTON1_PRESSED; - break; - case 2: - result |= BUTTON2_PRESSED; - break; - case 3: - result |= BUTTON3_PRESSED; - break; - case 4: - result |= BUTTON4_PRESSED; - break; - } - } - - return result; -} - -static int -drv_twait(TERMINAL_CONTROL_BLOCK * TCB, - int mode, - int milliseconds, - int *timeleft - EVENTLIST_2nd(_nc_eventlist * evl)) -{ - SCREEN *sp; - INPUT_RECORD inp_rec; - BOOL b; - DWORD nRead = 0, rc = -1; - int code = 0; - FILETIME fstart; - FILETIME fend; - int diff; - bool isImmed = (milliseconds == 0); - -#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead) - - AssertTCB(); - SetSP(); - - TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d", - milliseconds, mode)); - - if (milliseconds < 0) - milliseconds = INFINITY; - - memset(&inp_rec, 0, sizeof(inp_rec)); - - while (true) { - GetSystemTimeAsFileTime(&fstart); - rc = WaitForSingleObject(TCB->inp, milliseconds); - GetSystemTimeAsFileTime(&fend); - diff = (int) tdiff(fstart, fend); - milliseconds = Adjust(milliseconds, diff); - - if (!isImmed && milliseconds == 0) - break; - - if (rc == WAIT_OBJECT_0) { - if (mode) { - b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead); - if (b && nRead > 0) { - b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead); - if (b && nRead > 0) { - switch (inp_rec.EventType) { - case KEY_EVENT: - if (mode & TW_INPUT) { - WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; - char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar; - - if (inp_rec.Event.KeyEvent.bKeyDown) { - if (0 == ch) { - int nKey = MapKey(TCB, vk); - if ((nKey < 0) || FALSE == sp->_keypad_on) { - CONSUME(); - continue; - } - } - code = TW_INPUT; - goto end; - } else { - CONSUME(); - } - } - continue; - case MOUSE_EVENT: - if (decode_mouse(TCB, - (inp_rec.Event.MouseEvent.dwButtonState - & BUTTON_MASK)) == 0) { - CONSUME(); - } else if (mode & TW_MOUSE) { - code = TW_MOUSE; - goto end; - } - continue; - default: - SetConsoleActiveScreenBuffer(!PropOf(TCB)->progMode ? - TCB->hdl : TCB->out); - continue; - } - } - } - } - continue; - } else { - if (rc != WAIT_TIMEOUT) { - code = -1; - break; - } else { - code = 0; - break; - } - } - } - end: - - TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec", - code, errno, milliseconds)); - - if (timeleft) - *timeleft = milliseconds; - - return code; -} - -static bool -handle_mouse(TERMINAL_CONTROL_BLOCK * TCB, MOUSE_EVENT_RECORD mer) -{ - SCREEN *sp; - MEVENT work; - bool result = FALSE; - - AssertTCB(); - SetSP(); - - sp->_drv_mouse_old_buttons = sp->_drv_mouse_new_buttons; - sp->_drv_mouse_new_buttons = mer.dwButtonState & BUTTON_MASK; - - /* - * We're only interested if the button is pressed or released. - * FIXME: implement continuous event-tracking. - */ - if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) { - - memset(&work, 0, sizeof(work)); - - if (sp->_drv_mouse_new_buttons) { - - work.bstate |= decode_mouse(TCB, sp->_drv_mouse_new_buttons); - - } else { - - /* cf: BUTTON_PRESSED, BUTTON_RELEASED */ - work.bstate |= (decode_mouse(TCB, sp->_drv_mouse_old_buttons) >> 1); - - result = TRUE; - } - - work.x = mer.dwMousePosition.X; - work.y = mer.dwMousePosition.Y; - - sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work; - sp->_drv_mouse_tail += 1; - } - - return result; -} - -static int -drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) -{ - SCREEN *sp; - int n = 1; - INPUT_RECORD inp_rec; - BOOL b; - DWORD nRead; - WORD vk; - WORD sc; - - AssertTCB(); - assert(buf); - SetSP(); - - memset(&inp_rec, 0, sizeof(inp_rec)); - - T((T_CALLED("win32con::drv_read(%p)"), TCB)); - while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) { - if (b && nRead > 0) { - if (inp_rec.EventType == KEY_EVENT) { - if (!inp_rec.Event.KeyEvent.bKeyDown) - continue; - *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar; - vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; - sc = inp_rec.Event.KeyEvent.wVirtualScanCode; - if (*buf == 0) { - if (sp->_keypad_on) { - *buf = MapKey(TCB, vk); - if (0 > (*buf)) - continue; - else - break; - } else - continue; - } else { /* *buf != 0 */ - break; - } - } else if (inp_rec.EventType == MOUSE_EVENT) { - if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) { - *buf = KEY_MOUSE; - break; - } - } - continue; - } - } - returnCode(n); -} - -static int -drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) -{ - Sleep(ms); - return OK; -} - -static bool -drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int keycode) -{ - SCREEN *sp; - WORD nKey; - void *res; - bool found = FALSE; - LONG key = GenMap(0, (WORD) keycode); - - AssertTCB(); - SetSP(); - - AssertTCB(); - - res = bsearch(&key, - PropOf(TCB)->rmap, - (size_t) (N_INI + FKEYS), - sizeof(keylist[0]), - rkeycompare); - if (res) { - key = *((LONG *) res); - nKey = LOWORD(key); - if (!(nKey & 0x8000)) - found = TRUE; - } - return found; -} - -static int -drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag GCC_UNUSED) -{ - SCREEN *sp; - int code = ERR; - - AssertTCB(); - sp = TCB->csp; - - if (sp) { - code = OK; - } - return code; -} - -static int -drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, bool flag) -{ - int code = ERR; - SCREEN *sp; - WORD nKey; - WORD vKey; - void *res; - LONG key = GenMap(0, (WORD) keycode); - - AssertTCB(); - SetSP(); - - if (sp) { - res = bsearch(&key, - PropOf(TCB)->rmap, - (size_t) (N_INI + FKEYS), - sizeof(keylist[0]), - rkeycompare); - if (res) { - key = *((LONG *) res); - vKey = HIWORD(key); - nKey = (LOWORD(key)) & 0x7fff; - if (!flag) - nKey |= 0x8000; - *(LONG *) res = GenMap(vKey, nKey); - } - } - return code; -} - -NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_WIN_DRIVER = { - FALSE, - drv_CanHandle, /* CanHandle */ - drv_init, /* init */ - drv_release, /* release */ - drv_size, /* size */ - drv_sgmode, /* sgmode */ - drv_conattr, /* conattr */ - drv_mvcur, /* hwcur */ - drv_mode, /* mode */ - drv_rescol, /* rescol */ - drv_rescolors, /* rescolors */ - drv_setcolor, /* color */ - drv_dobeepflash, /* DoBeepFlash */ - drv_initpair, /* initpair */ - drv_initcolor, /* initcolor */ - drv_do_color, /* docolor */ - drv_initmouse, /* initmouse */ - drv_testmouse, /* testmouse */ - drv_setfilter, /* setfilter */ - drv_hwlabel, /* hwlabel */ - drv_hwlabelOnOff, /* hwlabelOnOff */ - drv_doupdate, /* update */ - drv_defaultcolors, /* defaultcolors */ - drv_print, /* print */ - drv_size, /* getsize */ - drv_setsize, /* setsize */ - drv_initacs, /* initacs */ - drv_screen_init, /* scinit */ - drv_wrap, /* scexit */ - drv_twait, /* twait */ - drv_read, /* read */ - drv_nap, /* nap */ - drv_kpad, /* kpad */ - drv_keyok, /* kyOk */ - drv_kyExist /* kyExist */ -}; diff --git a/panel/Makefile.in b/panel/Makefile.in index f0f0a4922bd..89dbeeac900 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.58 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $ ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -43,7 +43,6 @@ .SUFFIXES: SHELL = /bin/sh -VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ @@ -65,7 +64,6 @@ LIBTOOL_COMPILE = @LIB_COMPILE@ LIBTOOL_LINK = @LIB_LINK@ LIBTOOL_INSTALL = @LIB_INSTALL@ LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ -LT_UNDEF = @LT_UNDEF@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ @@ -73,14 +71,11 @@ INSTALL_PROG = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ -ARFLAGS = @ARFLAGS@ +AR_OPTS = @AR_OPTS@ AWK = @AWK@ LD = @LD@ LN_S = @LN_S@ -CTAGS = @CTAGS@ -ETAGS = @ETAGS@ - CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -130,7 +125,7 @@ sources: $(AUTO_SRC) $(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - mkdir -p $@ + sh $(srcdir)/../mkdirs.sh $@ # make a copy to simplify include-paths while still keeping panel's include # file in this directory. @@ -138,15 +133,15 @@ $(DESTDIR)$(libdir) : -rm -f $@ cp $(srcdir)/panel.h $@ -HEADER_DEPS = \ +PANEL_PRIV_H = \ $(srcdir)/panel.priv.h \ $(srcdir)/panel.h tags: - $(CTAGS) *.[ch] + ctags *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] +@MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace diff --git a/panel/llib-lpanel b/panel/llib-lpanel index 85371ec73e0..de49c234eca 100644 --- a/panel/llib-lpanel +++ b/panel/llib-lpanel @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997,2005,2010 * + * Author: Thomas E. Dickey 1997,2002,2005 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include +#include "panel.priv.h" #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,11 +77,6 @@ void _nc_Touchline( /* ./p_above.c */ -#undef ground_panel -PANEL *ground_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -89,11 +84,6 @@ PANEL *panel_above( /* ./p_below.c */ -#undef ceiling_panel -PANEL *ceiling_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -167,11 +157,6 @@ int top_panel( /* ./p_update.c */ -#undef update_panels_sp -void update_panels_sp( - SCREEN *sp) - { /* void */ } - #undef update_panels void update_panels(void) { /* void */ } diff --git a/panel/llib-lpanelt b/panel/llib-lpanelt deleted file mode 100644 index 8fcd42c9b6d..00000000000 --- a/panel/llib-lpanelt +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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"), 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 2010 * - ****************************************************************************/ -/* LINTLIBRARY */ - -/* ./panel.c */ - -#include - -#undef _nc_retrace_panel -PANEL *_nc_retrace_panel( - PANEL *pan) - { return(*(PANEL **)0); } - -#undef _nc_my_visbuf -const char *_nc_my_visbuf( - const void *ptr) - { return(*(const char **)0); } - -#undef _nc_dPanel -void _nc_dPanel( - const char *text, - const PANEL *pan) - { /* void */ } - -#undef _nc_dStack -void _nc_dStack( - const char *fmt, - int num, - const PANEL *pan) - { /* void */ } - -#undef _nc_Wnoutrefresh -void _nc_Wnoutrefresh( - const PANEL *pan) - { /* void */ } - -#undef _nc_Touchpan -void _nc_Touchpan( - const PANEL *pan) - { /* void */ } - -#undef _nc_Touchline -void _nc_Touchline( - const PANEL *pan, - int start, - int count) - { /* void */ } - -/* ./p_above.c */ - -#undef ground_panel -PANEL *ground_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - -#undef panel_above -PANEL *panel_above( - const PANEL *pan) - { return(*(PANEL **)0); } - -/* ./p_below.c */ - -#undef ceiling_panel -PANEL *ceiling_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - -#undef panel_below -PANEL *panel_below( - const PANEL *pan) - { return(*(PANEL **)0); } - -/* ./p_bottom.c */ - -#undef bottom_panel -int bottom_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_delete.c */ - -#undef del_panel -int del_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_hide.c */ - -#undef hide_panel -int hide_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_hidden.c */ - -#undef panel_hidden -int panel_hidden( - const PANEL *pan) - { return(*(int *)0); } - -/* ./p_move.c */ - -#undef move_panel -int move_panel( - PANEL *pan, - int starty, - int startx) - { return(*(int *)0); } - -/* ./p_new.c */ - -#undef new_panel -PANEL *new_panel( - WINDOW *win) - { return(*(PANEL **)0); } - -/* ./p_replace.c */ - -#undef replace_panel -int replace_panel( - PANEL *pan, - WINDOW *win) - { return(*(int *)0); } - -/* ./p_show.c */ - -#undef show_panel -int show_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_top.c */ - -#undef top_panel -int top_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_update.c */ - -#undef update_panels_sp -void update_panels_sp( - SCREEN *sp) - { /* void */ } - -#undef update_panels -void update_panels(void) - { /* void */ } - -/* ./p_user.c */ - -#undef set_panel_userptr -int set_panel_userptr( - PANEL *pan, - void *uptr) - { return(*(int *)0); } - -#undef panel_userptr -void *panel_userptr( - const PANEL *pan) - { return(*(void **)0); } - -/* ./p_win.c */ - -#undef panel_window -WINDOW *panel_window( - const PANEL *pan) - { return(*(WINDOW **)0); } diff --git a/panel/llib-lpaneltw b/panel/llib-lpaneltw deleted file mode 100644 index 1d3cd8d84c8..00000000000 --- a/panel/llib-lpaneltw +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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"), 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 2010 * - ****************************************************************************/ -/* LINTLIBRARY */ - -/* ./panel.c */ - -#include - -#undef _nc_retrace_panel -PANEL *_nc_retrace_panel( - PANEL *pan) - { return(*(PANEL **)0); } - -#undef _nc_my_visbuf -const char *_nc_my_visbuf( - const void *ptr) - { return(*(const char **)0); } - -#undef _nc_dPanel -void _nc_dPanel( - const char *text, - const PANEL *pan) - { /* void */ } - -#undef _nc_dStack -void _nc_dStack( - const char *fmt, - int num, - const PANEL *pan) - { /* void */ } - -#undef _nc_Wnoutrefresh -void _nc_Wnoutrefresh( - const PANEL *pan) - { /* void */ } - -#undef _nc_Touchpan -void _nc_Touchpan( - const PANEL *pan) - { /* void */ } - -#undef _nc_Touchline -void _nc_Touchline( - const PANEL *pan, - int start, - int count) - { /* void */ } - -/* ./p_above.c */ - -#undef ground_panel -PANEL *ground_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - -#undef panel_above -PANEL *panel_above( - const PANEL *pan) - { return(*(PANEL **)0); } - -/* ./p_below.c */ - -#undef ceiling_panel -PANEL *ceiling_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - -#undef panel_below -PANEL *panel_below( - const PANEL *pan) - { return(*(PANEL **)0); } - -/* ./p_bottom.c */ - -#undef bottom_panel -int bottom_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_delete.c */ - -#undef del_panel -int del_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_hide.c */ - -#undef hide_panel -int hide_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_hidden.c */ - -#undef panel_hidden -int panel_hidden( - const PANEL *pan) - { return(*(int *)0); } - -/* ./p_move.c */ - -#undef move_panel -int move_panel( - PANEL *pan, - int starty, - int startx) - { return(*(int *)0); } - -/* ./p_new.c */ - -#undef new_panel -PANEL *new_panel( - WINDOW *win) - { return(*(PANEL **)0); } - -/* ./p_replace.c */ - -#undef replace_panel -int replace_panel( - PANEL *pan, - WINDOW *win) - { return(*(int *)0); } - -/* ./p_show.c */ - -#undef show_panel -int show_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_top.c */ - -#undef top_panel -int top_panel( - PANEL *pan) - { return(*(int *)0); } - -/* ./p_update.c */ - -#undef update_panels_sp -void update_panels_sp( - SCREEN *sp) - { /* void */ } - -#undef update_panels -void update_panels(void) - { /* void */ } - -/* ./p_user.c */ - -#undef set_panel_userptr -int set_panel_userptr( - PANEL *pan, - void *uptr) - { return(*(int *)0); } - -#undef panel_userptr -void *panel_userptr( - const PANEL *pan) - { return(*(void **)0); } - -/* ./p_win.c */ - -#undef panel_window -WINDOW *panel_window( - const PANEL *pan) - { return(*(WINDOW **)0); } diff --git a/panel/llib-lpanelw b/panel/llib-lpanelw index 503b34345ba..48bd1e0db5a 100644 --- a/panel/llib-lpanelw +++ b/panel/llib-lpanelw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 2002,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2002-2005,2010 * + * Author: Thomas E. Dickey 2002,2005 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include +#include "panel.priv.h" #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,11 +77,6 @@ void _nc_Touchline( /* ./p_above.c */ -#undef ground_panel -PANEL *ground_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -89,11 +84,6 @@ PANEL *panel_above( /* ./p_below.c */ -#undef ceiling_panel -PANEL *ceiling_panel( - SCREEN *sp) - { return(*(PANEL **)0); } - #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -167,11 +157,6 @@ int top_panel( /* ./p_update.c */ -#undef update_panels_sp -void update_panels_sp( - SCREEN *sp) - { /* void */ } - #undef update_panels void update_panels(void) { /* void */ } diff --git a/panel/modules b/panel/modules index cd3f545630f..d0f7a796678 100644 --- a/panel/modules +++ b/panel/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.10 2010/01/23 16:31:16 tom Exp $ +# $Id: modules,v 1.9 2006/12/24 00:53:17 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. # +# Copyright (c) 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 "Software"), # @@ -32,20 +32,20 @@ @ base # Library objects -panel lib $(srcdir) $(HEADER_DEPS) -p_above lib $(srcdir) $(HEADER_DEPS) -p_below lib $(srcdir) $(HEADER_DEPS) -p_bottom lib $(srcdir) $(HEADER_DEPS) -p_delete lib $(srcdir) $(HEADER_DEPS) -p_hide lib $(srcdir) $(HEADER_DEPS) -p_hidden lib $(srcdir) $(HEADER_DEPS) -p_move lib $(srcdir) $(HEADER_DEPS) -p_new lib $(srcdir) $(HEADER_DEPS) -p_replace lib $(srcdir) $(HEADER_DEPS) -p_show lib $(srcdir) $(HEADER_DEPS) -p_top lib $(srcdir) $(HEADER_DEPS) -p_update lib $(srcdir) $(HEADER_DEPS) -p_user lib $(srcdir) $(HEADER_DEPS) -p_win lib $(srcdir) $(HEADER_DEPS) +panel lib $(srcdir) $(PANEL_PRIV_H) +p_above lib $(srcdir) $(PANEL_PRIV_H) +p_below lib $(srcdir) $(PANEL_PRIV_H) +p_bottom lib $(srcdir) $(PANEL_PRIV_H) +p_delete lib $(srcdir) $(PANEL_PRIV_H) +p_hide lib $(srcdir) $(PANEL_PRIV_H) +p_hidden lib $(srcdir) $(PANEL_PRIV_H) +p_move lib $(srcdir) $(PANEL_PRIV_H) +p_new lib $(srcdir) $(PANEL_PRIV_H) +p_replace lib $(srcdir) $(PANEL_PRIV_H) +p_show lib $(srcdir) $(PANEL_PRIV_H) +p_top lib $(srcdir) $(PANEL_PRIV_H) +p_update lib $(srcdir) $(PANEL_PRIV_H) +p_user lib $(srcdir) $(PANEL_PRIV_H) +p_win lib $(srcdir) $(PANEL_PRIV_H) # vile:makemode diff --git a/panel/p_above.c b/panel/p_above.c index 8bbf1bc21ce..32495f627f2 100644 --- a/panel/p_above.c +++ b/panel/p_above.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,56 +29,24 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_above.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $") - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(PANEL *) -ground_panel(SCREEN * sp) -{ - T((T_CALLED("ground_panel(%p)"), sp)); - if (sp) - { - struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); - - if (_nc_bottom_panel) /* this is the pseudo panel */ - returnPanel(_nc_bottom_panel->above); - else - returnPanel(0); - } - else - { - if (0 == CURRENT_SCREEN) - returnPanel(0); - else - returnPanel(ground_panel(CURRENT_SCREEN)); - } -} -#endif +MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $") NCURSES_EXPORT(PANEL *) panel_above(const PANEL * pan) { - PANEL *result; - - T((T_CALLED("panel_above(%p)"), (const void *)pan)); - if (pan) - result = pan->above; - else + T((T_CALLED("panel_above(%p)"), pan)); + if (!pan) { -#if NCURSES_SP_FUNCS - result = ground_panel(CURRENT_SCREEN); -#else /* if top and bottom are equal, we have no or only the pseudo panel; if not, we return the panel above the pseudo panel */ - result = EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above; -#endif + returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above); } - returnPanel(result); + else + returnPanel(pan->above); } diff --git a/panel/p_below.c b/panel/p_below.c index f276ef959da..c4b241015f5 100644 --- a/panel/p_below.c +++ b/panel/p_below.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,57 +29,26 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_below.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $") +MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $") -#if NCURSES_SP_FUNCS NCURSES_EXPORT(PANEL *) -ceiling_panel(SCREEN * sp) +panel_below(const PANEL * pan) { - T((T_CALLED("ceiling_panel(%p)"), sp)); - if (sp) + T((T_CALLED("panel_below(%p)"), pan)); + if (!pan) { - struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); - /* if top and bottom are equal, we have no or only the pseudo panel */ returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel); } else { - if (0 == CURRENT_SCREEN) - returnPanel(0); - else - returnPanel(ceiling_panel(CURRENT_SCREEN)); - } -} -#endif - -NCURSES_EXPORT(PANEL *) -panel_below(const PANEL * pan) -{ - PANEL *result; - - T((T_CALLED("panel_below(%p)"), (const void *)pan)); - if (pan) - { - GetHook(pan); /* we must not return the pseudo panel */ - result = Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below; + returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below); } - else - { -#if NCURSES_SP_FUNCS - result = ceiling_panel(CURRENT_SCREEN); -#else - /* if top and bottom are equal, we have no or only the pseudo panel */ - result = EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel; -#endif - } - returnPanel(result); } diff --git a/panel/p_bottom.c b/panel/p_bottom.c index db814415375..b861fd9b2ce 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_bottom.c @@ -37,17 +36,16 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.13 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $") NCURSES_EXPORT(int) bottom_panel(PANEL * pan) { int err = OK; - T((T_CALLED("bottom_panel(%p)"), (void *)pan)); + T((T_CALLED("bottom_panel(%p)"), pan)); if (pan) { - GetHook(pan); if (!Is_Bottom(pan)) { diff --git a/panel/p_delete.c b/panel/p_delete.c index 39b055377c1..24ee26b4ff2 100644 --- a/panel/p_delete.c +++ b/panel/p_delete.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1999,2008 * ****************************************************************************/ /* p_delete.c @@ -37,22 +36,19 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_delete.c,v 1.10 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $") NCURSES_EXPORT(int) del_panel(PANEL * pan) { int err = OK; - T((T_CALLED("del_panel(%p)"), (void *)pan)); + T((T_CALLED("del_panel(%p)"), pan)); if (pan) { dBug(("--> del_panel %s", USER_PTR(pan->user))); - { - GetHook(pan); - HIDE_PANEL(pan, err, OK); - free((void *)pan); - } + HIDE_PANEL(pan, err, OK); + free((void *)pan); } else err = ERR; diff --git a/panel/p_hidden.c b/panel/p_hidden.c index 01b69b91d91..624c07dae0b 100644 --- a/panel/p_hidden.c +++ b/panel/p_hidden.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_hidden.c @@ -37,18 +36,13 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.9 2010/01/23 21:22:15 tom Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $") NCURSES_EXPORT(int) panel_hidden(const PANEL * pan) { - int rc = ERR; - - T((T_CALLED("panel_hidden(%p)"), (const void *)pan)); - if (pan) - { - GetHook(pan); - rc = (IS_LINKED(pan) ? FALSE : TRUE); - } - returnCode(rc); + T((T_CALLED("panel_hidden(%p)"), pan)); + if (!pan) + returnCode(ERR); + returnCode(IS_LINKED(pan) ? FALSE : TRUE); } diff --git a/panel/p_hide.c b/panel/p_hide.c index 7b780d464e1..08d8853a201 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,27 +36,23 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.11 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $") NCURSES_EXPORT(int) hide_panel(register PANEL * pan) { - int err = ERR; + int err = OK; - T((T_CALLED("hide_panel(%p)"), (void *)pan)); + T((T_CALLED("hide_panel(%p)"), pan)); + if (!pan) + returnCode(ERR); - if (pan) - { - GetHook(pan); + dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dStack("", 1, pan); - dBug(("--> hide_panel %s", USER_PTR(pan->user))); - dStack("", 1, pan); + HIDE_PANEL(pan, err, ERR); - HIDE_PANEL(pan, err, ERR); + dStack("", 9, pan); - err = OK; - - dStack("", 9, pan); - } returnCode(err); } diff --git a/panel/p_move.c b/panel/p_move.c index adae6458322..3818e8cba86 100644 --- a/panel/p_move.c +++ b/panel/p_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1997-1999,2009 * ****************************************************************************/ /* p_move.c @@ -37,24 +36,21 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.11 2010/01/23 21:22:15 tom Exp $") +MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $") NCURSES_EXPORT(int) move_panel(PANEL * pan, int starty, int startx) { - int rc = ERR; + T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx)); - T((T_CALLED("move_panel(%p,%d,%d)"), (void *)pan, starty, startx)); + if (!pan) + returnCode(ERR); - if (pan) + if (IS_LINKED(pan)) { - GetHook(pan); - if (IS_LINKED(pan)) - { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); - } - rc = mvwin(pan->win, starty, startx); + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); } - returnCode(rc); + + returnCode(mvwin(pan->win, starty, startx)); } diff --git a/panel/p_new.c b/panel/p_new.c index 235336c22f5..2719316888e 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -38,7 +38,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.16 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.10 2008/08/04 18:25:48 tom Exp $") #ifdef TRACE static char *stdscr_id; @@ -50,27 +50,20 @@ static char *new_id; Establish the pseudo panel for stdscr if necessary. --------------------------------------------------------------------------*/ static PANEL * -root_panel(NCURSES_SP_DCL0) +root_panel(void) { -#if NCURSES_SP_FUNCS - struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); - -#elif NO_LEAKS - struct panelhook *ph = _nc_panelhook(); -#endif - if (_nc_stdscr_pseudo_panel == (PANEL *) 0) { - assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel); + assert(stdscr && !_nc_bottom_panel && !_nc_top_panel); #if NO_LEAKS - ph->destroy = del_panel; + _nc_panelhook()->destroy = del_panel; #endif - _nc_stdscr_pseudo_panel = typeMalloc(PANEL, 1); + _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL)); if (_nc_stdscr_pseudo_panel != 0) { PANEL *pan = _nc_stdscr_pseudo_panel; - WINDOW *win = SP_PARM->_stdscr; + WINDOW *win = stdscr; pan->win = win; pan->below = (PANEL *) 0; @@ -93,18 +86,16 @@ new_panel(WINDOW *win) { PANEL *pan = (PANEL *) 0; - GetWindowHook(win); - - T((T_CALLED("new_panel(%p)"), (void *)win)); + T((T_CALLED("new_panel(%p)"), win)); if (!win) returnPanel(pan); if (!_nc_stdscr_pseudo_panel) - (void)root_panel(NCURSES_SP_ARG); + (void)root_panel(); assert(_nc_stdscr_pseudo_panel); - if (!(win->_flags & _ISPAD) && (pan = typeMalloc(PANEL, 1))) + if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL)))) { pan->win = win; pan->above = (PANEL *) 0; diff --git a/panel/p_replace.c b/panel/p_replace.c index d3733ed22e2..5d0d295c8b1 100644 --- a/panel/p_replace.c +++ b/panel/p_replace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,25 +36,23 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.11 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $") NCURSES_EXPORT(int) replace_panel(PANEL * pan, WINDOW *win) { - int rc = ERR; + T((T_CALLED("replace_panel(%p,%p)"), pan, win)); - T((T_CALLED("replace_panel(%p,%p)"), (void *)pan, (void *)win)); + if (!pan) + returnCode(ERR); - if (pan) + if (IS_LINKED(pan)) { - GetHook(pan); - if (IS_LINKED(pan)) - { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); - } - pan->win = win; - rc = OK; + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); } - returnCode(rc); + + pan->win = win; + + returnCode(OK); } diff --git a/panel/p_show.c b/panel/p_show.c index d5b09bd9426..35eee237b95 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,37 +36,34 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.13 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $") NCURSES_EXPORT(int) show_panel(PANEL * pan) { - int err = ERR; + int err = OK; - T((T_CALLED("show_panel(%p)"), (void *)pan)); + T((T_CALLED("show_panel(%p)"), pan)); - if (pan) - { - GetHook(pan); + if (!pan) + returnCode(ERR); - if (Is_Top(pan)) - returnCode(OK); + if (Is_Top(pan)) + returnCode(OK); - dBug(("--> show_panel %s", USER_PTR(pan->user))); + dBug(("--> show_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); + HIDE_PANEL(pan, err, OK); - dStack("", 1, pan); - assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + dStack("", 1, pan); + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); - _nc_top_panel->above = pan; - pan->below = _nc_top_panel; - pan->above = (PANEL *) 0; - _nc_top_panel = pan; + _nc_top_panel->above = pan; + pan->below = _nc_top_panel; + pan->above = (PANEL *) 0; + _nc_top_panel = pan; - err = OK; + dStack("", 9, pan); - dStack("", 9, pan); - } - returnCode(err); + returnCode(OK); } diff --git a/panel/p_top.c b/panel/p_top.c index fdcdee9afcd..8bd1d9fb3fe 100644 --- a/panel/p_top.c +++ b/panel/p_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_top.c,v 1.6 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_top.c,v 1.5 2005/02/19 16:42:23 tom Exp $") NCURSES_EXPORT(int) top_panel(PANEL * pan) { - T((T_CALLED("top_panel(%p)"), (void *)pan)); + T((T_CALLED("top_panel(%p)"), pan)); returnCode(show_panel(pan)); } diff --git a/panel/p_update.c b/panel/p_update.c index a2f45063cf5..5967718160f 100644 --- a/panel/p_update.c +++ b/panel/p_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,6 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_update.c @@ -37,42 +36,28 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.11 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $") NCURSES_EXPORT(void) -NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) +update_panels(void) { PANEL *pan; - T((T_CALLED("update_panels(%p)"), (void *)SP_PARM)); + T((T_CALLED("update_panels()"))); dBug(("--> update_panels")); - - if (SP_PARM) + pan = _nc_bottom_panel; + while (pan && pan->above) { - GetScreenHook(SP_PARM); + PANEL_UPDATE(pan, pan->above); + pan = pan->above; + } - pan = _nc_bottom_panel; - while (pan && pan->above) - { - PANEL_UPDATE(pan, pan->above); - pan = pan->above; - } - - pan = _nc_bottom_panel; - while (pan) - { - Wnoutrefresh(pan); - pan = pan->above; - } + pan = _nc_bottom_panel; + while (pan) + { + Wnoutrefresh(pan); + pan = pan->above; } returnVoid; } - -#if NCURSES_SP_FUNCS -NCURSES_EXPORT(void) -update_panels(void) -{ - NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); -} -#endif diff --git a/panel/p_user.c b/panel/p_user.c index deb5bdf7e4c..ffa25f85ae1 100644 --- a/panel/p_user.c +++ b/panel/p_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,12 +36,12 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_user.c,v 1.8 2010/01/23 23:18:35 tom Exp $") +MODULE_ID("$Id: p_user.c,v 1.6 2005/02/19 16:52:44 tom Exp $") NCURSES_EXPORT(int) set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) { - T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); + T((T_CALLED("set_panel_userptr(%p,%p)"), pan, uptr)); if (!pan) returnCode(ERR); pan->user = uptr; @@ -51,6 +51,6 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) NCURSES_EXPORT(NCURSES_CONST void *) panel_userptr(const PANEL * pan) { - T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); + T((T_CALLED("panel_userptr(%p)"), pan)); returnCVoidPtr(pan ? pan->user : (NCURSES_CONST void *)0); } diff --git a/panel/p_win.c b/panel/p_win.c index 6643d5c2671..e7d2cea8e3f 100644 --- a/panel/p_win.c +++ b/panel/p_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_win.c,v 1.6 2010/01/23 21:22:15 tom Exp $") +MODULE_ID("$Id: p_win.c,v 1.5 2005/02/19 16:44:16 tom Exp $") NCURSES_EXPORT(WINDOW *) panel_window(const PANEL * pan) { - T((T_CALLED("panel_window(%p)"), (const void *)pan)); + T((T_CALLED("panel_window(%p)"), pan)); returnWin(pan ? pan->win : (WINDOW *)0); } diff --git a/panel/panel.c b/panel/panel.c index 96cbbab7740..16a8083d64b 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,14 +29,12 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1996-1999,2008 * - * and: Thomas E. Dickey * ****************************************************************************/ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $") +MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") /*+------------------------------------------------------------------------- _nc_retrace_panel (pan) @@ -45,7 +43,7 @@ MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(PANEL *) _nc_retrace_panel(PANEL * pan) { - T((T_RETURN("%p"), (void *)pan)); + T((T_RETURN("%p"), pan)); return pan; } #endif @@ -93,8 +91,6 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) { char s80[80]; - GetPanelHook(pan); - sprintf(s80, fmt, num, pan); _tracef("%s b=%s t=%s", s80, (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--", diff --git a/panel/panel.h b/panel/panel.h index 6ed2061d1ff..1e02091d97f 100644 --- a/panel/panel.h +++ b/panel/panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2001,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,10 +29,9 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * - * and: Juergen Pfeifer 1996-1999,2008 * ****************************************************************************/ -/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */ +/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */ /* panel.h -- interface file for panels library */ @@ -69,13 +68,6 @@ extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); -extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); - -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); -#endif - #if defined(__cplusplus) } #endif diff --git a/panel/panel.priv.h b/panel/panel.priv.h index ce4f98937fc..4fb8144e1b7 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 +26,7 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */ +/* $Id: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 @@ -39,11 +39,9 @@ #include #include -struct screen; /* forward declaration */ - -#include "curses.priv.h" /* includes nc_panel.h */ +#include "curses.priv.h" #include "panel.h" - +#include #if USE_RCS_IDS # define MODULE_ID(id) static const char Ident[] = id; @@ -85,38 +83,14 @@ struct screen; /* forward declaration */ # define Touchline(pan,start,count) touchline((pan)->win,start,count) #endif -#if NCURSES_SP_FUNCS -#define GetScreenHook(sp) \ - struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp) -#define GetPanelHook(pan) \ - GetScreenHook(_nc_screen_of((pan)->win)) -#define GetWindowHook(win) \ - SCREEN* sp = _nc_screen_of(win); \ - GetScreenHook(sp) -#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); \ - GetScreenHook(sp) - -#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel) -#define _nc_top_panel ((ph)->top_panel) -#define _nc_bottom_panel ((ph)->bottom_panel) - -#else /* !NCURSES_SP_FUNCS */ - -#define GetScreenHook(sp) /* nothing */ -#define GetPanelHook(pan) /* nothing */ -#define GetWindowHook(win) /* nothing */ -#define GetHook(pan) /* nothing */ - #define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel -#define _nc_top_panel _nc_panelhook()->top_panel -#define _nc_bottom_panel _nc_panelhook()->bottom_panel +#define _nc_top_panel _nc_panelhook()->top_panel +#define _nc_bottom_panel _nc_panelhook()->bottom_panel -#endif /* NCURSES_SP_FUNCS */ - -#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel) -#define Is_Bottom(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p))) -#define Is_Top(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p))) -#define Is_Pseudo(p) (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel)) +#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel) +#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p))) +#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) +#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) /*+------------------------------------------------------------------------- IS_LINKED(pan) - check to see if panel is in the stack @@ -148,7 +122,7 @@ struct screen; /* forward declaration */ ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\ iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\ iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\ - assert((ix1<=ix2) && (iy1<=iy2)) + assert((ix1<=ix2) && (iy1<=iy2));\ /*+------------------------------------------------------------------------- @@ -162,12 +136,12 @@ struct screen; /* forward declaration */ { PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\ while(pan2) {\ if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\ - int y, ix1, ix2, iy1, iy2;\ - COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\ + int y,ix1,ix2,iy1,iy2;\ + COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\ for(y = iy1; y <= iy2; y++) {\ if (is_linetouched(pan->win,y - PSTARTY(pan))) {\ struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\ - CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\ + CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\ }\ }\ }\ @@ -206,9 +180,4 @@ struct screen; /* forward declaration */ err = err_if_unlinked;\ } -#if NCURSES_SP_FUNCS -/* These may become later renamed and part of panel.h and the public API */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); -#endif - #endif /* NCURSES_PANEL_PRIV_H */ diff --git a/progs/Makefile.in b/progs/Makefile.in index bdb8a0f0489..886fd5be246 100644 --- a/progs/Makefile.in +++ b/progs/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.85 2010/11/27 21:45:27 tom Exp $ +# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $ ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -43,7 +43,6 @@ .SUFFIXES: SHELL = /bin/sh -VPATH = @srcdir@ THIS = Makefile CF_MFLAGS = @cf_cv_makeflags@ @@ -77,9 +76,6 @@ transform = @program_transform_name@ AWK = @AWK@ LN_S = @LN_S@ -CTAGS = @CTAGS@ -ETAGS = @ETAGS@ - CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -128,7 +124,7 @@ AUTO_SRC = \ transform.h # tic relies on direct access to the terminfo database -GET_PROGS = infocmp$x clear$x tabs$x tput$x tset$x toe$x +GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x PUT_PROGS = @MAKE_TERMINFO@ tic$x PROGS = $(PUT_PROGS) $(GET_PROGS) @@ -163,7 +159,6 @@ actual_infocmp = `echo infocmp$x| $(TRANSFORM)` actual_infotocap = `echo infotocap$x| $(TRANSFORM)` actual_init = `echo init$x| $(TRANSFORM)` actual_reset = `echo reset$x| $(TRANSFORM)` -actual_tabs = `echo tabs$x| $(TRANSFORM)` actual_tic = `echo tic$x| $(TRANSFORM)` actual_toe = `echo toe$x| $(TRANSFORM)` actual_tput = `echo tput$x| $(TRANSFORM)` @@ -176,16 +171,10 @@ define_init = `echo init| $(TRANSFORM)` define_reset = `echo reset| $(TRANSFORM)` transform.h : - echo "#ifndef __TRANSFORM_H" >$@ - echo "#define __TRANSFORM_H 1" >>$@ - echo "#include " >>$@ - echo "extern bool same_program(const char *, const char *);" >>$@ - -sh -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi' - echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >>$@ - echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ - echo "#define PROG_RESET \"$(define_reset)\"" >>$@ - echo "#define PROG_INIT \"$(define_init)\"" >>$@ - echo "#endif /* __TRANSFORM_H */" >>$@ + echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@ + echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ + echo "#define PROG_RESET \"$(define_reset)\"" >>$@ + echo "#define PROG_INIT \"$(define_init)\"" >>$@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ $(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x $(DESTDIR)$(bindir)/$(actual_tic) @@ -198,7 +187,6 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) $(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp) $(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x $(DESTDIR)$(bindir)/$(actual_clear) - $(LIBTOOL_INSTALL) $(INSTALL_PROG) tabs$x $(DESTDIR)$(bindir)/$(actual_tabs) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x $(DESTDIR)$(bindir)/$(actual_tput) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x $(DESTDIR)$(bindir)/$(actual_tset) @echo "linking $(actual_reset) to $(actual_tset)" @@ -212,13 +200,12 @@ uninstall.progs: @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear) - -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tabs) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset) -@rm -f $(DESTDIR)$(bindir)/$(actual_reset) $(DESTDIR)$(bindir) : - mkdir -p $@ + sh $(srcdir)/../mkdirs.sh $@ # # Utilities normally built by make all start here @@ -226,8 +213,7 @@ $(DESTDIR)$(bindir) : DEPS_TIC = \ $(MODEL)/tic$o \ - $(MODEL)/dump_entry$o \ - $(MODEL)/transform$o + $(MODEL)/dump_entry$o tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@ @@ -244,15 +230,8 @@ DEPS_CLEAR = \ clear$x: $(DEPS_CLEAR) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@ -DEPS_TABS = \ - $(MODEL)/tabs$o - -tabs$x: $(DEPS_TABS) $(DEPS_TABS) - @ECHO_LINK@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@ - DEPS_TPUT = \ - $(MODEL)/tput$o \ - $(MODEL)/transform$o + $(MODEL)/tput$o tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@ @@ -265,8 +244,7 @@ infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@ DEPS_TSET = \ - $(MODEL)/tset$o \ - $(MODEL)/transform$o + $(MODEL)/tset$o tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@ @@ -279,10 +257,10 @@ termsort.c: $(srcdir)/MKtermsort.sh # tags: - $(CTAGS) *.[ch] + ctags *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] +@MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace @@ -311,7 +289,6 @@ lint: @MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS) - $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tabs.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS) diff --git a/progs/dump_entry.c b/progs/dump_entry.c index 485bbbd91d6..bd2422008bf 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.89 2010/05/01 22:04:08 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.88 2008/08/04 12:36:12 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -1040,7 +1040,7 @@ dump_entry(TERMTYPE *tterm, save_sgr = set_attributes; - if ((FMT_ENTRY() > critlen) + if (((len = FMT_ENTRY()) > critlen) && limited) { save_tterm = *tterm; @@ -1049,7 +1049,7 @@ dump_entry(TERMTYPE *tterm, critlen); suppress_untranslatable = TRUE; } - if (FMT_ENTRY() > critlen) { + if ((len = FMT_ENTRY()) > critlen) { /* * We pick on sgr because it's a nice long string capability that * is really just an optimization hack. Another good candidate is @@ -1075,7 +1075,7 @@ dump_entry(TERMTYPE *tterm, critlen); } changed = TRUE; - if (FMT_ENTRY() <= critlen) + if ((len = FMT_ENTRY()) <= critlen) break; } } @@ -1086,7 +1086,7 @@ dump_entry(TERMTYPE *tterm, critlen); changed = TRUE; } - if (!changed || (FMT_ENTRY() > critlen)) { + if (!changed || ((len = FMT_ENTRY()) > critlen)) { if (purged_acs(tterm)) { acs_chars = ABSENT_STRING; SHOW_WHY("# (acsc removed to fit entry within %d bytes)\n", @@ -1094,7 +1094,7 @@ dump_entry(TERMTYPE *tterm, changed = TRUE; } } - if (!changed || (FMT_ENTRY() > critlen)) { + if (!changed || ((len = FMT_ENTRY()) > critlen)) { int oldversion = tversion; tversion = V_BSD; @@ -1130,7 +1130,7 @@ dump_entry(TERMTYPE *tterm, } else if (!version_filter(STRING, STR_IDX(acs_chars))) { save_tterm = *tterm; if (purged_acs(tterm)) { - (void) FMT_ENTRY(); + len = FMT_ENTRY(); } *tterm = save_tterm; } diff --git a/progs/infocmp.c b/progs/infocmp.c index 2af9cb50b1d..84989ffc63d 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.105 2010/05/01 22:04:08 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.103 2008/08/16 22:04:56 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -894,6 +894,8 @@ file_comparison(int argc, char *argv[]) (void) printf("The following entries are equivalent:\n"); for (qp = heads[0]; qp; qp = qp->next) { + rp = qp->crosslinks[0]; + if (qp->ncrosslinks == 1) { rp = qp->crosslinks[0]; @@ -1253,15 +1255,6 @@ terminal_env(void) * ***************************************************************************/ -#if NO_LEAKS -#define MAIN_LEAKS() \ - free(myargv); \ - free(tfile); \ - free(tname) -#else -#define MAIN_LEAKS() /* nothing */ -#endif - int main(int argc, char *argv[]) { @@ -1521,7 +1514,6 @@ main(int argc, char *argv[]) #else (void) fprintf(stderr, "%s: terminfo files not supported\n", _nc_progname); - MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); #endif } else { @@ -1534,6 +1526,7 @@ main(int argc, char *argv[]) status = _nc_read_entry(tname[termcount], tfile[termcount], &entries[termcount].tterm); + directory = TERMINFO; /* for error message */ } if (status <= 0) { @@ -1541,7 +1534,6 @@ main(int argc, char *argv[]) "%s: couldn't open terminfo file %s.\n", _nc_progname, tfile[termcount]); - MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); } repair_acsc(&entries[termcount].tterm); @@ -1650,7 +1642,11 @@ main(int argc, char *argv[]) else file_comparison(argc - optind, argv + optind); - MAIN_LEAKS(); +#if NO_LEAKS + free(myargv); + free(tfile); + free(tname); +#endif ExitProgram(EXIT_SUCCESS); } diff --git a/progs/modules b/progs/modules index 55d7a9fb969..3b4f3b60236 100644 --- a/progs/modules +++ b/progs/modules @@ -1,7 +1,7 @@ -# $Id: modules,v 1.17 2010/01/23 17:47:23 tom Exp $ +# $Id: modules,v 1.13 2006/12/24 00:53:21 tom Exp $ # Program modules (some are in ncurses lib!) ############################################################################## -# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # +# Copyright (c) 1998-2005,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"), # @@ -34,12 +34,10 @@ @ base clear progs $(srcdir) $(HEADER_DEPS) tic progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h -toe progs $(srcdir) $(HEADER_DEPS) $(INCDIR)/hashed_db.h +toe progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c infocmp progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h -tabs progs $(srcdir) $(HEADER_DEPS) -tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h termsort.c +tput progs $(srcdir) $(HEADER_DEPS) transform.h termsort.c tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h -transform progs $(srcdir) $(HEADER_DEPS) transform.h # vile:makemode diff --git a/progs/tabs.c b/progs/tabs.c deleted file mode 100644 index b59c9086d8d..00000000000 --- a/progs/tabs.c +++ /dev/null @@ -1,510 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2008-2009,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"), 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 2008 * - ****************************************************************************/ - -/* - * tabs.c -- set terminal hard-tabstops - */ - -#define USE_LIBTINFO -#include - -MODULE_ID("$Id: tabs.c,v 1.19 2010/10/23 22:26:01 tom Exp $") - -static void usage(void) GCC_NORETURN; - -static int max_cols; - -static int -putch(int c) -{ - return putchar(c); -} - -static void -do_tabs(int *tab_list) -{ - int last = 1; - int stop; - - putchar('\r'); - while ((stop = *tab_list++) > 0) { - if (last < stop) { - while (last++ < stop) { - if (last > max_cols) - break; - putchar(' '); - } - } - if (stop <= max_cols) { - tputs(tparm(set_tab, stop), 1, putch); - last = stop; - } else { - break; - } - } - putchar('\n'); -} - -static int * -decode_tabs(const char *tab_list) -{ - int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols); - int n = 0; - int value = 0; - int prior = 0; - int ch; - - if (result != 0) { - while ((ch = *tab_list++) != '\0') { - if (isdigit(UChar(ch))) { - value *= 10; - value += (ch - '0'); - } else if (ch == ',') { - result[n] = value + prior; - if (n > 0 && result[n] <= result[n - 1]) { - fprintf(stderr, - "tab-stops are not in increasing order: %d %d\n", - value, result[n - 1]); - free(result); - result = 0; - break; - } - ++n; - value = 0; - prior = 0; - } else if (ch == '+') { - if (n) - prior = result[n - 1]; - } - } - } - - if (result != 0) { - /* - * If there is only one value, then it is an option such as "-8". - */ - if ((n == 0) && (value > 0)) { - int step = value; - while (n < max_cols - 1) { - result[n++] = value; - value += step; - } - } - - /* - * Add the last value, if any. - */ - result[n++] = value + prior; - result[n] = 0; - } - return result; -} - -static void -print_ruler(int *tab_list) -{ - int last = 0; - int stop; - int n; - - /* first print a readable ruler */ - for (n = 0; n < max_cols; n += 10) { - int ch = 1 + (n / 10); - char buffer[20]; - sprintf(buffer, "----+----%c", - ((ch < 10) - ? (ch + '0') - : (ch + 'A' - 10))); - printf("%.*s", ((max_cols - n) > 10) ? 10 : (max_cols - n), buffer); - } - putchar('\n'); - - /* now, print '*' for each stop */ - for (n = 0, last = 0; (tab_list[n] > 0) && (last < max_cols); ++n) { - stop = tab_list[n]; - while (++last < stop) { - if (last <= max_cols) { - putchar('-'); - } else { - break; - } - } - if (last <= max_cols) { - putchar('*'); - last = stop; - } else { - break; - } - } - while (++last <= max_cols) - putchar('-'); - putchar('\n'); -} - -/* - * Write an '*' on each tabstop, to demonstrate whether it lines up with the - * ruler. - */ -static void -write_tabs(int *tab_list) -{ - int stop; - - while ((stop = *tab_list++) > 0 && stop <= max_cols) { - fputs((stop == 1) ? "*" : "\t*", stdout); - }; - /* also show a tab _past_ the stops */ - if (stop < max_cols) - fputs("\t+", stdout); - putchar('\n'); -} - -/* - * Trim leading/trailing blanks, as well as blanks after a comma. - * Convert embedded blanks to commas. - */ -static char * -trimmed_tab_list(const char *source) -{ - char *result = strdup(source); - int ch, j, k, last; - - if (result != 0) { - for (j = k = last = 0; result[j] != 0; ++j) { - ch = UChar(result[j]); - if (isspace(ch)) { - if (last == '\0') { - continue; - } else if (isdigit(last) || last == ',') { - ch = ','; - } - } else if (ch == ',') { - ; - } else { - if (last == ',') - result[k++] = (char) last; - result[k++] = (char) ch; - } - last = ch; - } - result[k] = '\0'; - } - return result; -} - -static bool -comma_is_needed(const char *source) -{ - bool result = FALSE; - - if (source != 0) { - unsigned len = strlen(source); - if (len != 0) - result = (source[len - 1] != ','); - } else { - result = FALSE; - } - return result; -} - -/* - * Add a command-line parameter to the tab-list. It can be blank- or comma- - * separated (or a mixture). For simplicity, empty tabs are ignored, e.g., - * tabs 1,,6,11 - * tabs 1,6,11 - * are treated the same. - */ -static const char * -add_to_tab_list(char **append, const char *value) -{ - char *result = *append; - char *copied = trimmed_tab_list(value); - - if (copied != 0 && *copied != '\0') { - const char *comma = ","; - unsigned need = 1 + strlen(copied); - - if (*copied == ',') - comma = ""; - else if (!comma_is_needed(*append)) - comma = ""; - - need += strlen(comma); - if (*append != 0) - need += strlen(*append); - - result = malloc(need); - if (result != 0) { - *result = '\0'; - if (*append != 0) { - strcpy(result, *append); - free(*append); - } - strcat(result, comma); - strcat(result, copied); - } - - *append = result; - } - return result; -} - -/* - * Check for illegal characters in the tab-list. - */ -static bool -legal_tab_list(const char *program, const char *tab_list) -{ - bool result = TRUE; - - if (tab_list != 0 && *tab_list != '\0') { - if (comma_is_needed(tab_list)) { - int n, ch; - for (n = 0; tab_list[n] != '\0'; ++n) { - ch = UChar(tab_list[n]); - if (!(isdigit(ch) || ch == ',' || ch == '+')) { - fprintf(stderr, - "%s: unexpected character found '%c'\n", - program, ch); - result = FALSE; - break; - } - } - } else { - fprintf(stderr, "%s: trailing comma found '%s'\n", program, tab_list); - result = FALSE; - } - } else { - fprintf(stderr, "%s: no tab-list given\n", program); - result = FALSE; - } - return result; -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: tabs [options] [tabstop-list]" - ,"" - ,"Options:" - ," -0 reset tabs" - ," -8 set tabs to standard interval" - ," -a Assembler, IBM S/370, first format" - ," -a2 Assembler, IBM S/370, second format" - ," -c COBOL, normal format" - ," -c2 COBOL compact format" - ," -c3 COBOL compact format extended" - ," -d debug (show ruler with expected/actual tab positions)" - ," -f FORTRAN" - ," -n no-op (do not modify terminal settings)" - ," -p PL/I" - ," -s SNOBOL" - ," -u UNIVAC 1100 Assembler" - ," -T name use terminal type 'name'" - ,"" - ,"A tabstop-list is an ordered list of column numbers, e.g., 1,11,21" - ,"or 1,+10,+10 which is the same." - }; - unsigned n; - - fflush(stdout); - for (n = 0; n < SIZEOF(msg); ++n) { - fprintf(stderr, "%s\n", msg[n]); - } - ExitProgram(EXIT_FAILURE); -} - -int -main(int argc, char *argv[]) -{ - int rc = EXIT_FAILURE; - bool debug = FALSE; - bool no_op = FALSE; - int n, ch; - NCURSES_CONST char *term_name = 0; - const char *mar_list = 0; /* ignored */ - char *append = 0; - const char *tab_list = 0; - - if ((term_name = getenv("TERM")) == 0) - term_name = "ansi+tabs"; - - /* cannot use getopt, since some options are two-character */ - for (n = 1; n < argc; ++n) { - char *option = argv[n]; - switch (option[0]) { - case '-': - while ((ch = *++option) != '\0') { - switch (ch) { - case 'a': - switch (*option) { - case '\0': - tab_list = "1,10,16,36,72"; - /* Assembler, IBM S/370, first format */ - break; - case '2': - tab_list = "1,10,16,40,72"; - /* Assembler, IBM S/370, second format */ - break; - default: - usage(); - } - break; - case 'c': - switch (*option) { - case '\0': - tab_list = "1,8,12,16,20,55"; - /* COBOL, normal format */ - break; - case '2': - tab_list = "1,6,10,14,49"; - /* COBOL compact format */ - break; - case '3': - tab_list = "1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67"; - /* COBOL compact format extended */ - break; - default: - usage(); - } - break; - case 'd': /* ncurses extension */ - debug = TRUE; - break; - case 'f': - tab_list = "1,7,11,15,19,23"; - /* FORTRAN */ - break; - case 'n': /* ncurses extension */ - no_op = TRUE; - break; - case 'p': - tab_list = "1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61"; - /* PL/I */ - break; - case 's': - tab_list = "1,10,55"; - /* SNOBOL */ - break; - case 'u': - tab_list = "1,12,20,44"; - /* UNIVAC 1100 Assembler */ - break; - case 'T': - ++n; - if (*++option != '\0') { - term_name = option; - } else { - term_name = argv[n++]; - } - option += ((int) strlen(option)) - 1; - continue; - default: - if (isdigit(UChar(*option))) { - tab_list = option; - ++n; - } else { - usage(); - } - option += ((int) strlen(option)) - 1; - break; - } - } - break; - case '+': - while ((ch = *++option) != '\0') { - switch (ch) { - case 'm': - mar_list = option; - break; - default: - /* special case of relative stops separated by spaces? */ - if (option == argv[n] + 1) { - tab_list = add_to_tab_list(&append, argv[n]); - } - break; - } - } - break; - default: - if (append != 0) { - if (tab_list != (const char *) append) { - /* one of the predefined options was used */ - free(append); - append = 0; - } - } - tab_list = add_to_tab_list(&append, option); - break; - } - } - - setupterm(term_name, STDOUT_FILENO, (int *) 0); - - max_cols = (columns > 0) ? columns : 80; - - if (!VALID_STRING(clear_all_tabs)) { - fprintf(stderr, - "%s: terminal type '%s' cannot reset tabs\n", - argv[0], term_name); - } else if (!VALID_STRING(set_tab)) { - fprintf(stderr, - "%s: terminal type '%s' cannot set tabs\n", - argv[0], term_name); - } else if (legal_tab_list(argv[0], tab_list)) { - int *list = decode_tabs(tab_list); - - if (!no_op) - tputs(clear_all_tabs, 1, putch); - - if (list != 0) { - if (!no_op) - do_tabs(list); - if (debug) { - fflush(stderr); - printf("tabs %s\n", tab_list); - print_ruler(list); - write_tabs(list); - } - free(list); - } else if (debug) { - fflush(stderr); - printf("tabs %s\n", tab_list); - } - rc = EXIT_SUCCESS; - } - if (append != 0) - free(append); - ExitProgram(rc); -} diff --git a/progs/tic.c b/progs/tic.c index 8e89095fc67..82bc3ea0d78 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -44,7 +44,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.147 2011/02/12 18:39:08 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.137 2008/09/13 16:59:24 tom Exp $") const char *_nc_progname = "tic"; @@ -342,15 +342,8 @@ stripped(char *src) while (isspace(UChar(*src))) src++; if (*src != '\0') { - char *dst; - size_t len; - - if ((dst = strdup(src)) == NULL) - failed("strdup"); - - assert(dst != 0); - - len = strlen(dst); + char *dst = strcpy((char *) malloc(strlen(src) + 1), src); + size_t len = strlen(dst); while (--len != 0 && isspace(UChar(dst[len]))) dst[len] = '\0'; return dst; @@ -502,11 +495,11 @@ main(int argc, char *argv[]) _nc_progname = _nc_rootname(argv[0]); - if ((infodump = same_program(_nc_progname, PROG_CAPTOINFO)) != FALSE) { + if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) { outform = F_TERMINFO; sortmode = S_TERMINFO; } - if ((capdump = same_program(_nc_progname, PROG_INFOTOCAP)) != FALSE) { + if ((capdump = (strcmp(_nc_progname, PROG_INFOTOCAP) == 0)) != FALSE) { outform = F_TERMCAP; sortmode = S_TERMCAP; } @@ -764,7 +757,6 @@ main(int argc, char *argv[]) put_translate(fgetc(tmp_fp)); } - repair_acsc(&qp->tterm); dump_entry(&qp->tterm, suppress_untranslatable, limited, numbers, NULL); for (j = 0; j < (int) qp->nuses; j++) @@ -931,156 +923,6 @@ keypad_index(const char *string) return result; } -/* - * list[] is down, up, left, right - * "left" may be ^H rather than \E[D - * "down" may be ^J rather than \E[B - * But up/right are generally consistently escape sequences for ANSI terminals. - */ -static void -check_ansi_cursor(char *list[4]) -{ - int j, k; - int want; - size_t prefix = 0; - size_t suffix; - bool skip[4]; - bool repeated = FALSE; - - for (j = 0; j < 4; ++j) { - skip[j] = FALSE; - for (k = 0; k < j; ++k) { - if (j != k - && !strcmp(list[j], list[k])) { - char *value = _nc_tic_expand(list[k], TRUE, 0); - _nc_warning("repeated cursor control %s\n", value); - repeated = TRUE; - } - } - } - if (!repeated) { - char *up = list[1]; - - if (UChar(up[0]) == '\033') { - if (up[1] == '[') { - prefix = 2; - } else { - prefix = 1; - } - } else if (UChar(up[0]) == UChar('\233')) { - prefix = 1; - } - if (prefix) { - suffix = prefix; - while (up[suffix] && isdigit(UChar(up[suffix]))) - ++suffix; - } - if (prefix && up[suffix] == 'A') { - skip[1] = TRUE; - if (!strcmp(list[0], "\n")) - skip[0] = TRUE; - if (!strcmp(list[2], "\b")) - skip[2] = TRUE; - - for (j = 0; j < 4; ++j) { - if (skip[j] || strlen(list[j]) == 1) - continue; - if (memcmp(list[j], up, prefix)) { - char *value = _nc_tic_expand(list[j], TRUE, 0); - _nc_warning("inconsistent prefix for %s\n", value); - continue; - } - if (strlen(list[j]) < suffix) { - char *value = _nc_tic_expand(list[j], TRUE, 0); - _nc_warning("inconsistent length for %s, expected %d\n", - value, (int) suffix + 1); - continue; - } - want = "BADC"[j]; - if (list[j][suffix] != want) { - char *value = _nc_tic_expand(list[j], TRUE, 0); - _nc_warning("inconsistent suffix for %s, expected %c, have %c\n", - value, want, list[j][suffix]); - } - } - } - } -} - -#define EXPECTED(name) if (!PRESENT(name)) _nc_warning("expected " #name) - -static void -check_cursor(TERMTYPE *tp) -{ - int count; - char *list[4]; - - /* if we have a parameterized form, then the non-parameterized is easy */ - ANDMISSING(parm_down_cursor, cursor_down); - ANDMISSING(parm_up_cursor, cursor_up); - ANDMISSING(parm_left_cursor, cursor_left); - ANDMISSING(parm_right_cursor, cursor_right); - - /* Given any of a set of cursor movement, the whole set should be present. - * Technically this is not true (we could use cursor_address to fill in - * unsupported controls), but it is likely. - */ - count = 0; - if (PRESENT(parm_down_cursor)) { - list[count++] = parm_down_cursor; - } - if (PRESENT(parm_up_cursor)) { - list[count++] = parm_up_cursor; - } - if (PRESENT(parm_left_cursor)) { - list[count++] = parm_left_cursor; - } - if (PRESENT(parm_right_cursor)) { - list[count++] = parm_right_cursor; - } - if (count == 4) { - check_ansi_cursor(list); - } else if (count != 0) { - EXPECTED(parm_down_cursor); - EXPECTED(parm_up_cursor); - EXPECTED(parm_left_cursor); - EXPECTED(parm_right_cursor); - } - - count = 0; - if (PRESENT(cursor_down)) { - list[count++] = cursor_down; - } - if (PRESENT(cursor_up)) { - list[count++] = cursor_up; - } - if (PRESENT(cursor_left)) { - list[count++] = cursor_left; - } - if (PRESENT(cursor_right)) { - list[count++] = cursor_right; - } - if (count == 4) { - check_ansi_cursor(list); - } else if (count != 0) { - count = 0; - if (PRESENT(cursor_down) && strcmp(cursor_down, "\n")) - ++count; - if (PRESENT(cursor_left) && strcmp(cursor_left, "\b")) - ++count; - if (PRESENT(cursor_up) && strlen(cursor_up) > 1) - ++count; - if (PRESENT(cursor_right) && strlen(cursor_right) > 1) - ++count; - if (count) { - EXPECTED(cursor_down); - EXPECTED(cursor_up); - EXPECTED(cursor_left); - EXPECTED(cursor_right); - } - } -} - #define MAX_KP 5 /* * Do a quick sanity-check for vt100-style keypads to see if the 5-key keypad @@ -1190,32 +1032,6 @@ check_keypad(TERMTYPE *tp) } } -static void -check_printer(TERMTYPE *tp) -{ - PAIRED(enter_doublewide_mode, exit_doublewide_mode); - PAIRED(enter_italics_mode, exit_italics_mode); - PAIRED(enter_leftward_mode, exit_leftward_mode); - PAIRED(enter_micro_mode, exit_micro_mode); - PAIRED(enter_shadow_mode, exit_shadow_mode); - PAIRED(enter_subscript_mode, exit_subscript_mode); - PAIRED(enter_superscript_mode, exit_superscript_mode); - PAIRED(enter_upward_mode, exit_upward_mode); - - ANDMISSING(start_char_set_def, stop_char_set_def); - - /* if we have a parameterized form, then the non-parameterized is easy */ - ANDMISSING(set_bottom_margin_parm, set_bottom_margin); - ANDMISSING(set_left_margin_parm, set_left_margin); - ANDMISSING(set_right_margin_parm, set_right_margin); - ANDMISSING(set_top_margin_parm, set_top_margin); - - ANDMISSING(parm_down_micro, micro_down); - ANDMISSING(parm_left_micro, micro_left); - ANDMISSING(parm_right_micro, micro_right); - ANDMISSING(parm_up_micro, micro_up); -} - /* * Returns the expected number of parameters for the given capability. */ @@ -1452,8 +1268,6 @@ similar_sgr(int num, char *a, char *b) } else if (delaying) { a = skip_delay(a); b = skip_delay(b); - } else if ((*b == '0' || (*b == ';')) && *a == 'm') { - b++; } else { a++; } @@ -1529,7 +1343,7 @@ show_where(unsigned level) if (_nc_tracing >= DEBUG_LEVEL(level)) { char my_name[256]; _nc_get_type(my_name); - _tracef("\"%s\", line %d, '%s'", + fprintf(stderr, "\"%s\", line %d, '%s' ", _nc_get_source(), _nc_curr_line, my_name); } @@ -1597,9 +1411,7 @@ check_termtype(TERMTYPE *tp, bool literal) check_acs(tp); check_colors(tp); - check_cursor(tp); check_keypad(tp); - check_printer(tp); /* * These may be mismatched because the terminal description relies on @@ -1620,11 +1432,6 @@ check_termtype(TERMTYPE *tp, bool literal) ANDMISSING(change_scroll_region, save_cursor); ANDMISSING(change_scroll_region, restore_cursor); - /* - * If we can clear tabs, we should be able to initialize them. - */ - ANDMISSING(clear_all_tabs, set_tab); - if (PRESENT(set_attributes)) { char *zero = 0; diff --git a/progs/toe.c b/progs/toe.c index 6f45992f712..8af6f371b77 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: toe.c,v 1.52 2010/05/01 22:04:08 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.51 2008/08/16 21:53:25 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -61,13 +61,6 @@ ExitProgram(int code) } #endif -static void -failed(const char *msg) -{ - perror(msg); - ExitProgram(EXIT_FAILURE); -} - #if USE_HASHED_DB static bool make_db_name(char *dst, const char *src, unsigned limit) @@ -191,10 +184,10 @@ typelist(int eargc, char *eargv[], DIRENT *entry; cwd_buf = typeRealloc(char, cwd_len, cwd_buf); - if (cwd_buf == 0) - failed("realloc cwd_buf"); - - assert(cwd_buf != 0); + if (cwd_buf == 0) { + perror("realloc cwd_buf"); + continue; + } strncpy(name_1, subdir->d_name, len)[len] = '\0'; if (isDotname(name_1)) @@ -487,10 +480,6 @@ main(int argc, char *argv[]) } if (!pass) { eargv = typeCalloc(char *, count + 1); - if (eargv == 0) - failed("realloc eargv"); - - assert(eargv != 0); } else { code = typelist((int) count, eargv, header, deschook); while (count-- > 0) diff --git a/progs/tput.c b/progs/tput.c index 2e67cfecbef..022d4940c2a 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -47,7 +47,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.46 2010/01/09 16:53:24 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.42 2008/07/13 11:05:12 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -86,8 +86,8 @@ usage(void) static void check_aliases(const char *name) { - is_init = same_program(name, PROG_INIT); - is_reset = same_program(name, PROG_RESET); + is_init = (strcmp(name, PROG_INIT) == 0); + is_reset = (strcmp(name, PROG_RESET) == 0); } /* @@ -153,9 +153,6 @@ tput(int argc, char *argv[]) int i, j, c; int status; FILE *f; -#if !PURE_TERMINFO - bool termcap = FALSE; -#endif if ((name = argv[0]) == 0) name = ""; @@ -268,40 +265,35 @@ tput(int argc, char *argv[]) return 0; } #if !PURE_TERMINFO - retry: + { + const struct name_table_entry *np; + + if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0) + switch (np->nte_type) { + case BOOLEAN: + if (bool_from_termcap[np->nte_index]) + name = boolnames[np->nte_index]; + break; + + case NUMBER: + if (num_from_termcap[np->nte_index]) + name = numnames[np->nte_index]; + break; + + case STRING: + if (str_from_termcap[np->nte_index]) + name = strnames[np->nte_index]; + break; + } + } #endif + if ((status = tigetflag(name)) != -1) { return exit_code(BOOLEAN, status); } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); return exit_code(NUMBER, 0); } else if ((s = tigetstr(name)) == CANCELLED_STRING) { -#if !PURE_TERMINFO - if (!termcap) { - const struct name_table_entry *np; - - termcap = TRUE; - if ((np = _nc_find_entry(name, _nc_get_hash_table(termcap))) != 0) { - switch (np->nte_type) { - case BOOLEAN: - if (bool_from_termcap[np->nte_index]) - name = boolnames[np->nte_index]; - break; - - case NUMBER: - if (num_from_termcap[np->nte_index]) - name = numnames[np->nte_index]; - break; - - case STRING: - if (str_from_termcap[np->nte_index]) - name = strnames[np->nte_index]; - break; - } - goto retry; - } - } -#endif quit(4, "unknown terminfo capability '%s'", name); } else if (s != ABSENT_STRING) { if (argc > 1) { diff --git a/progs/transform.c b/progs/transform.c deleted file mode 100644 index 75f4573357c..00000000000 --- a/progs/transform.c +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,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"), 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 * - ****************************************************************************/ -#include -#include - -#include - -MODULE_ID("$Id: transform.c,v 1.2 2010/09/04 21:16:17 tom Exp $") - -#ifdef SUFFIX_IGNORED -static void -trim_suffix(const char *a, unsigned *len) -{ - const char ignore[] = SUFFIX_IGNORED; - - if (sizeof(ignore) != 0) { - bool trim = FALSE; - unsigned need = (sizeof(ignore) - 1); - - if (*len > need) { - unsigned first = *len - need; - unsigned n; - trim = TRUE; - for (n = first; n < *len; ++n) { - if (tolower(UChar(a[n])) != tolower(UChar(ignore[n - first]))) { - trim = FALSE; - break; - } - } - if (trim) { - *len -= need; - } - } - } -} -#else -#define trim_suffix(a, len) /* nothing */ -#endif - -bool -same_program(const char *a, const char *b) -{ - unsigned len_a = strlen(a); - unsigned len_b = strlen(b); - - trim_suffix(a, &len_a); - trim_suffix(b, &len_b); - - return (len_a == len_b) && (strncmp(a, b, len_a) == 0); -} diff --git a/progs/tset.c b/progs/tset.c index 084e41d6db2..6a4d2d61c3d 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,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 * @@ -32,22 +32,6 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* - * Notes: - * The initial adaptation from 4.4BSD Lite sources in September 1995 used 686 - * lines from that version, and made changes/additions for 150 lines. There - * was no reformatting, so with/without ignoring whitespace, the amount of - * change is the same. - * - * Comparing with current (2009) source, excluding this comment: - * a) 209 lines match identically to the 4.4BSD Lite sources, with 771 lines - * changed/added. - * a) Ignoring whitespace, the current version still uses 516 lines from the - * 4.4BSD Lite sources, with 402 lines changed/added. - * - * Raymond's original comment on this follows... - */ - /* * tset.c - terminal initialization utility * @@ -68,7 +52,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -119,7 +107,7 @@ char *ttyname(int fd); #include #include -MODULE_ID("$Id: tset.c,v 1.82 2010/05/01 21:42:46 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -141,9 +129,7 @@ MODULE_ID("$Id: tset.c,v 1.82 2010/05/01 21:42:46 tom Exp $") # endif #endif -#ifndef environ extern char **environ; -#endif #undef CTRL #define CTRL(x) ((x) & 0x1f) @@ -399,13 +385,9 @@ add_mapping(const char *port, char *arg) char *base = 0; copy = strdup(arg); - mapp = typeMalloc(MAP, 1); + mapp = (MAP *) malloc(sizeof(MAP)); if (copy == 0 || mapp == 0) failed("malloc"); - - assert(copy != 0); - assert(mapp != 0); - mapp->next = 0; if (maplist == 0) cur = maplist = mapp; @@ -1265,12 +1247,12 @@ main(int argc, char **argv) ospeed = (NCURSES_OSPEED) mode.sg_ospeed; #endif - if (same_program(_nc_progname, PROG_RESET)) { + if (!strcmp(_nc_progname, PROG_RESET)) { isreset = TRUE; reset_mode(); } - (void) get_termcap_entry(*argv); + ttype = get_termcap_entry(*argv); if (!noset) { tcolumns = columns; diff --git a/c++/edit_cfg.sh b/tar-copy.sh similarity index 69% rename from c++/edit_cfg.sh rename to tar-copy.sh index 73c31b274ed..3df1bc11169 100755 --- a/c++/edit_cfg.sh +++ b/tar-copy.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.17 2008/08/30 19:44:25 tom Exp $ +# $Id: tar-copy.sh,v 1.5 2003/10/25 14:40:07 tom Exp $ ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998,2003 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -28,44 +28,50 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1997-on +# Author: Thomas E. Dickey # -# Edit the default value of the etip.h file based on the autoconf-generated -# values: +# Copy a collection of files using 'tar', so that their dates and links are +# preserved # -# $1 = ncurses_cfg.h -# $2 = etip.h +# Parameters: +# $1 = files to copy +# $2 = source directory +# $3 = destination directory # -echo "substituting autoconf'd values from $1 into $2" -for name in \ - CPP_HAS_PARAM_INIT \ - CPP_HAS_STATIC_CAST \ - ETIP_NEEDS_MATH_EXCEPTION \ - ETIP_NEEDS_MATH_H \ - HAVE_BUILTIN_H \ - HAVE_GPP_BUILTIN_H \ - HAVE_GXX_BUILTIN_H \ - HAVE_IOSTREAM \ - HAVE_TYPEINFO \ - HAVE_VALUES_H \ - IOSTREAM_NAMESPACE -do - rm -f $2.bak - mv $2 $2.bak - if ( grep "[ ]$name[ ]1" $1 2>&1 >/dev/null) +#DOIT=echo +DOIT=eval + +if test $# != 3 ; then + echo "Usage: $0 files source target" + exit 1 +elif test ! -d "$2" ; then + echo "Source directory not found: $2" + exit 1 +elif test ! -d "$3" ; then + echo "Target directory not found: $3" + exit 1 +fi + +WD=`pwd` + +TMP=$WD/copy$$ + +cd $2 +TEST=`ls -d $1 2>/dev/null` +if test -z "$TEST" +then + echo "... no match for \"$1\" in $2" +else + echo "... installing files matching \"$1\" in $2" + trap "rm -f $TMP" 0 1 2 5 15 + if ( tar cf $TMP $1 ) then - value=1 - sed -e 's/define '$name'.*$/define '$name' 1/' $2.bak >$2 + cd $3 + LIST=`tar tf $TMP 2>&1` + $DOIT rm -rf $LIST 2>/dev/null + $DOIT tar xvf $TMP else - value=0 - sed -e 's/define '$name'.*$/define '$name' 0/' $2.bak >$2 + echo "Cannot create tar of $1 files" + exit 1 fi - if (cmp -s $2 $2.bak) - then - echo '... '$name $value - mv $2.bak $2 - else - echo '... '$name $value - rm -f $2.bak - fi -done +fi diff --git a/test/Makefile.in b/test/Makefile.in deleted file mode 100644 index 9fde0adbe8b..00000000000 --- a/test/Makefile.in +++ /dev/null @@ -1,131 +0,0 @@ -# $Id: Makefile.in,v 1.108 2010/11/28 16:39:40 tom Exp $ -############################################################################## -# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # -# # -# Permission is hereby granted, free of charge, to any person obtaining a # -# copy of this software and associated documentation files (the "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 1996-on -# -# Makefile for ncurses tests. - -# turn off _all_ suffix rules; we'll generate our own -.SUFFIXES: - -SHELL = /bin/sh -VPATH = @srcdir@ - -@SET_MAKE@ - -destdir = -x = @EXEEXT@ -o = .@OBJEXT@ - -MODEL = ../@DFT_OBJ_SUBDIR@ -srcdir = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ - -BINDIR = $(DESTDIR)$(bindir) -LIBDIR = $(DESTDIR)$(libdir) -INCLUDEDIR = $(DESTDIR)$(includedir) - -LIBTOOL = @LIBTOOL@ -LIBTOOL_CLEAN = @LIB_CLEAN@ -LIBTOOL_COMPILE = @LIB_COMPILE@ -LIBTOOL_LINK = @LIB_LINK@ - -INSTALL = @INSTALL@ -INSTALL_PROG = @INSTALL_PROGRAM@ -transform = @program_transform_name@ -TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/' - -CTAGS = @CTAGS@ -ETAGS = @ETAGS@ - -CC = @CC@ -CPP = @CPP@ - -CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@ -CPPFLAGS = -I. -I$(srcdir) -I../test -DHAVE_CONFIG_H @CPPFLAGS@ - -CCFLAGS = $(CPPFLAGS) $(CFLAGS) - -CFLAGS_LIBTOOL = $(CCFLAGS) -CFLAGS_NORMAL = $(CCFLAGS) -CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE -CFLAGS_PROFILE = $(CCFLAGS) -pg -CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ - -CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) - -REL_VERSION = @cf_cv_rel_version@ -ABI_VERSION = @cf_cv_abi_version@ -LOCAL_LIBDIR = @top_builddir@/lib -LOCAL_LIBS = @TEST_DEPS@ -MATH_LIB = @MATH_LIB@ -TEST_LIBS = @TEST_LIBS@ - -LD = @LD@ -LINK = @LINK_TESTS@ $(LIBTOOL_LINK) $(CFLAGS) - -LDFLAGS = @LD_MODEL@ @LOCAL_LDFLAGS@ @LDFLAGS@ - -LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL) -LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL) -LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG) -LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) -LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@ - -TEST_ARGS = @LDFLAGS_STATIC@ @TEST_ARGS@ @LDFLAGS_SHARED@ - -# use these for linking with all of the libraries -LIBS_DEFAULT = $(TEST_ARGS) @LIBS@ $(TEST_LIBS) $(MATH_LIB) -LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_DEFAULT) - -# use these for linking with the (n)curses library and possibly pthreads -LIBS_THREADS = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-lform.*-lpanel[^ ]*//'` $(TEST_LIBS) $(MATH_LIB) @PTHREAD@ -LDFLAGS_THREADS = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_THREADS) - -# use these for linking with the (n)curses library -LIBS_CURSES = `echo "$(TEST_ARGS) @LIBS@" | sed -e 's/-lform.*-lpanel[^ ]*//'` $(TEST_LIBS) $(MATH_LIB) -LDFLAGS_CURSES = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_CURSES) - -# use these for linking with the tinfo library if we have it, or curses library if not -LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_ARGS@ @LDFLAGS_SHARED@ @LIBS@ $(TEST_LIBS) $(MATH_LIB) -LDFLAGS_TINFO = $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO) - -LINT = @LINT@ -LINT_OPTS = @LINT_OPTS@ -LINT_LIBS = -lform -lmenu -lpanel -lncurses @LIBS@ - -HEADER_DEPS = \ - ../include/curses.h \ - ../include/term.h - -# The rest is generated from the "programs" and "modules" files... diff --git a/test/README b/test/README deleted file mode 100644 index 8a016ec824d..00000000000 --- a/test/README +++ /dev/null @@ -1,800 +0,0 @@ -------------------------------------------------------------------------------- --- Copyright (c) 1998-2010,2011 Free 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: README,v 1.44 2011/02/26 00:09:25 tom Exp $ -------------------------------------------------------------------------------- - -The programs in this directory are designed to test your newest toy :-) -Check the sources for any further details. - -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 - -The bs and knight games demonstrate processing of mouse events under xterm. -This directory also contains: - -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 -TYPE_ALPHA test: demo_forms ncurses -TYPE_ENUM test: demo_forms -TYPE_INTEGER test: demo_forms -TYPE_IPV4 test: demo_forms -TYPE_NUMERIC test: demo_forms -TYPE_REGEXP test: demo_forms -current_field test: demo_forms edit_field ncurses -data_ahead test: demo_forms -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_count test: demo_forms -field_fore test: demo_forms -field_index test: demo_forms -field_info test: ncurses -field_init - -field_just - -field_opts test: demo_forms ncurses -field_opts_off test: cardfile demo_forms -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 -form_driver test: cardfile demo_forms edit_field ncurses -form_fields test: cardfile demo_forms -form_init - -form_opts - -form_opts_off - -form_opts_on - -form_page test: demo_forms -form_request_by_name - -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 -free_fieldtype test: ncurses -free_form test: cardfile demo_forms ncurses -link_field - -link_fieldtype - -move_field - -new_field test: cardfile demo_forms ncurses -new_fieldtype test: ncurses -new_form test: cardfile demo_forms ncurses -new_form_sp - -new_page test: demo_forms -pos_form_cursor - -post_form test: cardfile demo_forms 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_buffer test: cardfile demo_forms edit_field ncurses -set_field_fore test: demo_forms -set_field_init - -set_field_just test: cardfile demo_forms -set_field_opts test: demo_forms ncurses -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_fieldtype_arg - -set_fieldtype_choice - -set_form_fields - -set_form_init - -set_form_opts - -set_form_page - -set_form_sub test: cardfile demo_forms ncurses -set_form_term - -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 - -libmenu: -------- -current_item test: demo_menus ncurses -free_item test: ncurses -free_menu test: demo_menus ncurses -item_count test: demo_menus -item_description - -item_index test: demo_menus ncurses -item_init - -item_name test: demo_menus ncurses -item_opts - -item_opts_off - -item_opts_on - -item_term - -item_userptr - -item_value test: demo_menus ncurses -item_visible - -menu_back - -menu_driver test: demo_menus ncurses -menu_fore - -menu_format - -menu_grey - -menu_init - -menu_items test: demo_menus ncurses -menu_mark test: demo_menus -menu_opts - -menu_opts_off test: demo_menus ncurses -menu_opts_on test: demo_menus -menu_pad - -menu_pattern test: demo_menus -menu_request_by_name - -menu_request_name - -menu_spacing test: demo_menus -menu_sub test: demo_menus -menu_term - -menu_userptr - -menu_win test: demo_menus ncurses -new_item test: demo_menus ncurses -new_menu test: demo_menus ncurses -new_menu_sp - -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_opts - -set_item_term - -set_item_userptr - -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_items - -set_menu_mark test: demo_menus -set_menu_opts - -set_menu_pad - -set_menu_pattern - -set_menu_spacing - -set_menu_sub test: demo_menus ncurses -set_menu_term - -set_menu_userptr - -set_menu_win test: demo_menus ncurses -set_top_row - -top_row - -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 -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 -SP lib: form -TABSIZE test: test_opaque -UP - -acs_map test: 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 -add_wchnstr test: test_add_wchstr -add_wchstr test: test_add_wchstr view -addch test: blue bs echochar hashtest ncurses 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 -assume_default_colors test: ncurses -assume_default_colors_sp - -attr_get test: ncurses -attr_off test: ncurses -attr_on test: 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 -beep_sp lib: ncurses -bkgd test: background cardfile demo_forms ncurses savescreen tclock view -bkgdset test: background ncurses testaddch -bkgrnd test: ncurses -bkgrndset test: ncurses -boolcodes test: demo_termcap test_arrays progs: dump_entry -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_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 -chgat test: chgat -clear test: blue bs gdc ncurses 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 -color_content_sp - -color_set test: color_set ncurses -copywin test: ncurses testcurs -cur_term test: demo_terminfo dots dots_mvcur lrtest 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 -def_prog_mode test: bs ncurses -def_prog_mode_sp lib: ncurses -def_shell_mode - -def_shell_mode_sp lib: ncurses -define_key test: demo_altkeys demo_defkey foldkeys -define_key_sp - -del_curterm lib: ncurses -del_curterm_sp lib: ncurses -delay_output test: newdemo -delay_output_sp - -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 -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_sp lib: ncurses -dupwin test: edit_field -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_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 - -filter test: filter -filter_sp - -flash test: cardfile lrtest ncurses tclock testcurs -flash_sp - -flushinp test: ncurses newdemo testcurs -flushinp_sp lib: ncurses -get_escdelay - -get_escdelay_sp - -get_wch - -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 -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 -getmouse_sp - -getn_wstr test: test_get_wstr -getnstr test: filter ncurses test_getstr -getparx test: movewindow -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 -has_colors_sp lib: ncurses -has_ic test: lrtest -has_ic_sp lib: ncurses -has_il - -has_il_sp lib: ncurses -has_key - -has_key_sp lib: ncurses -has_mouse - -has_mouse_sp - -hline test: gdc ncurses -hline_set - -idcok test: test_opaque -idlok test: ncurses test_opaque testscanw view -immedok test: test_opaque -in_wch test: inch_wide -in_wchnstr test: inch_wide -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_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 -innstr test: test_instr -innwstr test: test_inwstr -ins_nwstr test: ins_wide -ins_wch test: ins_wide -ins_wstr test: ins_wide -insch test: ins_wide inserts -insdelln test: insdelln -insertln test: insdelln -insnstr test: inserts -insstr test: inserts -instr test: test_instr -intrflush test: demo_forms movewindow -intrflush_sp - -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_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_subwin - -is_syncok test: test_opaque -is_term_resized - -is_term_resized_sp - -is_wintouched lib: ncurses -isendwin - -isendwin_sp - -key_defined test: demo_defkey foldkeys -key_defined_sp lib: ncurses -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 testcurs view progs: tic -keyname_sp lib: ncurses -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 - -leaveok test: hanoi test_opaque -longname test: testcurs progs: tput -mcprint - -mcprint_sp - -meta test: key_names keynames ncurses -mouse_trafo - -mouseinterval - -mouseinterval_sp - -mousemask test: bs demo_forms demo_menus knight movewindow ncurses -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 -mvadd_wch test: ncurses test_add_wchstr test_addwstr -mvadd_wchnstr test: test_add_wchstr -mvadd_wchstr test: test_add_wchstr -mvaddch test: bs gdc hanoi lrtest ncurses rain tclock test_add_wchstr test_addchstr test_addstr test_addwstr xmas -mvaddchnstr test: gdc test_addchstr -mvaddchstr test: test_addchstr -mvaddnstr test: test_addstr -mvaddnwstr test: test_addwstr -mvaddstr test: bs demo_forms gdc hanoi knight ncurses rain tclock test_addstr testcurs xmas -mvaddwstr test: test_addwstr -mvchgat test: chgat -mvcur test: dots_mvcur redraw -mvcur_sp lib: ncurses -mvdelch - -mvderwin test: movewindow -mvget_wch - -mvget_wstr test: test_get_wstr -mvgetch - -mvgetn_wstr test: test_get_wstr -mvgetnstr test: test_getstr -mvgetstr test: test_getstr -mvhline test: ncurses -mvhline_set test: ncurses -mvin_wch test: inch_wide -mvin_wchnstr test: inch_wide -mvin_wchstr test: inch_wide -mvinch test: inchs -mvinchnstr test: gdc inchs -mvinchstr test: inchs -mvinnstr test: test_instr -mvinnwstr test: test_inwstr -mvins_nwstr test: ins_wide -mvins_wch test: ins_wide -mvins_wstr test: ins_wide -mvinsch test: ins_wide inserts -mvinsnstr test: inserts -mvinsstr test: inserts -mvinstr test: test_instr -mvinwstr test: test_inwstr -mvprintw test: bs demo_menus firework hanoi ncurses 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 -mvwaddchnstr test: test_addchstr -mvwaddchstr test: inchs test_addchstr -mvwaddnstr test: newdemo test_addstr testcurs -mvwaddnwstr test: test_addwstr -mvwaddstr test: ditto firstlast ins_wide inserts knight ncurses newdemo test_addstr test_addwstr test_instr testcurs xmas -mvwaddwstr test: test_addwstr test_inwstr -mvwchgat test: chgat -mvwdelch test: ncurses -mvwget_wch - -mvwget_wstr test: test_get_wstr -mvwgetch test: inch_wide inchs test_get_wstr test_getstr test_instr test_inwstr test_opaque -mvwgetn_wstr test: test_get_wstr -mvwgetnstr test: test_getstr -mvwgetstr test: test_getstr -mvwhline test: movewindow -mvwhline_set - -mvwin test: cardfile demo_menus movewindow testcurs xmas -mvwin_wch test: inch_wide -mvwin_wchnstr test: inch_wide -mvwin_wchstr test: inch_wide -mvwinch test: inchs newdemo testcurs -mvwinchnstr test: inchs -mvwinchstr test: inchs -mvwinnstr test: test_instr testcurs -mvwinnwstr test: test_inwstr -mvwins_nwstr test: ins_wide -mvwins_wch test: ins_wide -mvwins_wstr test: ins_wide -mvwinsch test: ins_wide inserts -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 -mvwscanw test: testcurs -mvwvline test: ins_wide inserts movewindow 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 -newpad_sp lib: ncurses -newscr lib: ncurses -newterm test: demo_altkeys ditto dots_mvcur filter foldkeys gdc key_names keynames -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_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 -noecho_sp lib: ncurses -nofilter - -nofilter_sp - -nonl test: bs demo_forms hashtest movewindow ncurses view worm xmas -nonl_sp lib: ncurses -noqiflush - -noqiflush_sp - -noraw test: demo_forms demo_menus ncurses testcurs -noraw_sp lib: ncurses -notimeout test: 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 -overlay test: ncurses testcurs xmas -overwrite test: ncurses savescreen -pair_content test: background color_set -pair_content_sp lib: ncurses -pecho_wchar - -pechochar - -pnoutrefresh test: edit_field ncurses -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 lib: ncurses -putwin test: ncurses -qiflush - -qiflush_sp - -raw test: demo_forms ncurses redraw testcurs -raw_sp lib: ncurses -redrawwin test: redraw -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 -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 -resetty - -resetty_sp - -resize_term test: view -resize_term_sp - -resizeterm - -resizeterm_sp lib: ncurses -restartterm - -restartterm_sp - -ripoffline test: demo_menus ncurses -ripoffline_sp - -savetty - -savetty_sp - -scanw test: testcurs testscanw -scr_dump test: savescreen -scr_init test: savescreen -scr_init_sp - -scr_restore test: savescreen -scr_restore_sp - -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 - -set_escdelay test: test_opaque -set_escdelay_sp lib: ncurses -set_tabsize test: test_opaque -set_tabsize_sp - -set_term lib: ncurses -setcchar test: demo_panels ins_wide ncurses test_add_wchstr test_addwstr view -setscrreg test: view -setupterm test: demo_termcap demo_terminfo dots progs: clear tabs tput tset -slk_attr - -slk_attr_off - -slk_attr_on - -slk_attr_set test: ncurses -slk_attr_set_sp - -slk_attr_sp - -slk_attroff lib: ncurses -slk_attroff_sp - -slk_attron lib: ncurses -slk_attron_sp - -slk_attrset test: ncurses -slk_attrset_sp - -slk_clear test: ncurses -slk_clear_sp - -slk_color test: ncurses -slk_color_sp - -slk_init test: ncurses -slk_init_sp - -slk_label test: ncurses -slk_label_sp - -slk_noutrefresh test: 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_sp - -slk_touch test: 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_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 -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 -subpad test: testcurs -subwin test: movewindow ncurses newdemo testcurs -syncok test: test_opaque -term_attrs test: ncurses -term_attrs_sp - -termattrs test: ncurses testcurs -termattrs_sp lib: ncurses -termname test: testcurs -termname_sp lib: ncurses -tgetent test: demo_termcap railroad -tgetent_sp - -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: tput -tigetflag_sp - -tigetnum test: demo_terminfo ncurses progs: tput -tigetnum_sp - -tigetstr test: blue demo_defkey demo_terminfo foldkeys testcurs progs: tput -tigetstr_sp - -timeout test: 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 progs: clear tabs tset -tputs_sp lib: ncurses -trace test: demo_menus hanoi hashtest lrtest ncurses testcurs view worm -ttytype lib: ncurses -typeahead test: testcurs -typeahead_sp lib: ncurses -unctrl test: ncurses redraw test_add_wchstr test_addchstr testcurs -unctrl_sp lib: ncurses -unget_wch - -unget_wch_sp - -ungetch test: bs knight -ungetch_sp lib: ncurses -ungetmouse - -ungetmouse_sp - -untouchwin lib: form -use_default_colors test: filter firework gdc hanoi knight ncurses rain tclock worm xmas -use_default_colors_sp - -use_env progs: tput -use_env_sp - -use_extended_names test: demo_terminfo progs: infocmp tic -use_legacy_coding - -use_legacy_coding_sp - -use_screen test: ditto -use_window test: rain worm -vid_attr - -vid_attr_sp - -vid_puts - -vid_puts_sp - -vidattr - -vidattr_sp lib: ncurses -vidputs - -vidputs_sp lib: ncurses -vline test: gdc ncurses -vline_set - -vw_printw test: clip_printw -vw_scanw - -vwprintw test: movewindow -vwscanw lib: ncurses -wadd_wch test: inch_wide test_add_wchstr test_addwstr -wadd_wchnstr test: 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 -waddchnstr test: test_addchstr -waddchstr test: test_addchstr -waddnstr test: 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 - -wattr_off lib: ncurses -wattr_on lib: ncurses -wattr_set - -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 -wbkgdset test: demo_panels ins_wide inserts ncurses test_add_wchstr test_addchstr test_addstr test_addwstr -wbkgrnd lib: ncurses -wbkgrndset lib: ncurses -wborder test: ncurses -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 -wcolor_set lib: ncurses -wcursyncup lib: form -wdelch test: ncurses testcurs -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 -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 -wgetn_wstr test: ncurses test_get_wstr -wgetnstr test: ncurses test_getstr -wgetparent test: test_opaque -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_wchstr test: inch_wide -winch test: inchs knight testcurs -winchnstr test: inchs -winchstr test: inchs -winnstr test: demo_altkeys demo_defkey foldkeys test_instr -winnwstr test: test_inwstr -wins_nwstr test: ins_wide -wins_wch test: ins_wide -wins_wstr test: ins_wide -winsch test: ins_wide inserts testcurs -winsdelln test: insdelln -winsertln test: insdelln testcurs -winsnstr test: inserts -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 -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 -wscanw test: testcurs -wscrl test: ncurses testcurs -wsetscrreg test: ncurses testcurs -wstandend test: ncurses test_opaque xmas -wstandout test: ncurses test_opaque xmas -wsyncdown test: movewindow -wsyncup lib: form -wtimeout test: ncurses -wtouchln lib: ncurses -wunctrl lib: ncurses -wunctrl_sp - -wvline test: testcurs -wvline_set lib: ncurses - -libpanel: --------- -bottom_panel test: demo_panels ncurses -ceiling_panel - -del_panel test: demo_panels ncurses -ground_panel - -hide_panel test: demo_panels ncurses -move_panel test: demo_panels ncurses -new_panel test: cardfile demo_panels ncurses -panel_above test: demo_panels -panel_below test: demo_panels -panel_hidden test: demo_panels -panel_userptr test: demo_panels ncurses -panel_window test: cardfile demo_panels ncurses -replace_panel test: demo_panels -set_panel_userptr test: demo_panels ncurses -show_panel test: demo_panels ncurses -top_panel test: cardfile demo_panels ncurses -update_panels test: cardfile demo_panels ncurses -update_panels_sp - diff --git a/test/aclocal.m4 b/test/aclocal.m4 deleted file mode 100644 index 4e3343144a4..00000000000 --- a/test/aclocal.m4 +++ /dev/null @@ -1,3130 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 2003-2010,2011 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl $Id: aclocal.m4,v 1.50 2011/03/24 08:28:07 tom Exp $ -dnl -dnl Author: Thomas E. Dickey -dnl -dnl Macros used in NCURSES test programs auto-configuration script. -dnl -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 -dnl --------------------------------------------------------------------------- -dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 -dnl ------------- -dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS -dnl The second parameter if given makes this macro verbose. -dnl -dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, -dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily -dnl confused by the quotes (which require backslashes to keep them usable). -AC_DEFUN([CF_ADD_CFLAGS], -[ -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) - CFLAGS="$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" -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" -fi - -AC_SUBST(EXTRA_CPPFLAGS) - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 -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, -dnl but old versions (and some misinstalled ones) need that. To make things -dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to -dnl the include-path). -AC_DEFUN([CF_ADD_INCDIR], -[ -if test -n "$1" ; then - for cf_add_incdir in $1 - 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - AC_TRY_COMPILE([#include ], - [printf("Hello")], - [], - [cf_have_incdir=yes]) - CPPFLAGS=$cf_save_CPPFLAGS - fi - fi - fi - - if test "$cf_have_incdir" = no ; then - CF_VERBOSE(adding $cf_add_incdir to include-path) - ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -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 - fi - done - done -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 -dnl ---------- -dnl Add a library, used to enforce consistency. -dnl -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 ------------- -dnl Adds to the library-path -dnl -dnl Some machines have trouble with multiple -L options. -dnl -dnl $1 is the (list of) directory(s) to add -dnl $2 is the optional name of the variable to update (default LDFLAGS) -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 -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 -dnl ----------- -dnl Add one or more libraries, used to enforce consistency. -dnl -dnl $1 = libraries to add, with the "-l", etc. -dnl $2 = variable to update (default $LIBS) -AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIB_AFTER version: 2 updated: 2010/11/08 20:33:46 -dnl ---------------- -dnl Add a given library after another, e.g., following the one it satisfies a -dnl dependency for. -dnl -dnl $1 = the first library -dnl $2 = its dependency -AC_DEFUN([CF_ADD_LIB_AFTER],[ -CF_VERBOSE(...before $LIBS) -LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s,$1 ,$1 $2 ," -e 's/ / /g'` -CF_VERBOSE(...after $LIBS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 -dnl ------------------ -dnl Append to a search-list for a nonstandard header/lib-file -dnl $1 = the variable to return as result -dnl $2 = the package name -dnl $3 = the subdirectory, e.g., bin, include or lib -dnl $4 = the directory under which we will test for subdirectories -dnl $5 = a directory that we do not want $4 to match -AC_DEFUN([CF_ADD_SUBDIR_PATH], -[ -test "$4" != "$5" && \ -test -d "$4" && \ -ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { - test -n "$verbose" && echo " ... testing for $3-directories under $4" - test -d $4/$3 && $1="[$]$1 $4/$3" - test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" - test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" - test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" - test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" -} -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 -dnl ---------------- -dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' -dnl in the sharutils 4.2 distribution. -AC_DEFUN([CF_ANSI_CC_CHECK], -[ -AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ -cf_cv_ansi_cc=no -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -do - CF_ADD_CFLAGS($cf_arg) - AC_TRY_COMPILE( -[ -#ifndef CC_HAS_PROTOS -#if !defined(__STDC__) || (__STDC__ != 1) -choke me -#endif -#endif -],[ - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);};], - [cf_cv_ansi_cc="$cf_arg"; break]) -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" -]) - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - CF_ADD_CFLAGS($cf_cv_ansi_cc) -else - AC_DEFINE(CC_HAS_PROTOS) -fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 -dnl --------------- -dnl For programs that must use an ANSI compiler, obtain compiler options that -dnl will make it recognize prototypes. We'll do preprocessor checks in other -dnl macros, since tools such as unproto can fake prototypes, but only part of -dnl the preprocessor. -AC_DEFUN([CF_ANSI_CC_REQD], -[AC_REQUIRE([CF_ANSI_CC_CHECK]) -if test "$cf_cv_ansi_cc" = "no"; then - AC_MSG_ERROR( -[Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto]) -fi -])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. -AC_DEFUN([CF_ARG_DISABLE], -[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 -dnl ------------- -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 ------------- -dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus -dnl values. -dnl -dnl Parameters: -dnl $1 = option name -dnl $2 = help-string -dnl $3 = action to perform if option is not default -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 -ifelse([$3],,[ :]dnl -,[ $3]) ifelse([$4],,,[ - else - $4]) - fi],[enableval=$5 ifelse([$4],,,[ - $4 -])dnl - ])])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 -dnl -------------- -dnl Check if we're accidentally using a cache from a different machine. -dnl Derive the system name, as a check for reusing the autoconf cache. -dnl -dnl If we've packaged config.guess and config.sub, run that (since it does a -dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow -dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM -dnl which is useful in cross-compiles. -dnl -dnl Note: we would use $ac_config_sub, but that is one of the places where -dnl autoconf 2.5x broke compatibility with autoconf 2.13 -AC_DEFUN([CF_CHECK_CACHE], -[ -if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - ifelse([$1],,[AC_CANONICAL_HOST],[$1]) - system_name="$host_os" -else - system_name="`(uname -s -r) 2>/dev/null`" - if test -z "$system_name" ; then - system_name="`(hostname) 2>/dev/null`" - fi -fi -test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") -AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) - -test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) - -if test ".$system_name" != ".$cf_cv_system_name" ; then - AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) - AC_MSG_ERROR("Please remove config.cache and try again.") -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58 -dnl --------------- -dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from -dnl a build-configuration such as imake. These have the pitfall that they -dnl often contain compiler-specific options which we cannot use, mixed with -dnl preprocessor options that we usually can. -AC_DEFUN([CF_CHECK_CFLAGS], -[ -CF_VERBOSE(checking additions to CFLAGS) -cf_check_cflags="$CFLAGS" -cf_check_cppflags="$CPPFLAGS" -CF_ADD_CFLAGS($1,yes) -if test "$cf_check_cflags" != "$CFLAGS" ; then -AC_TRY_LINK([#include ],[printf("Hello world");],, - [CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS) - if test "$cf_check_cppflags" != "$CPPFLAGS" ; then - CF_VERBOSE(but keeping change to \$CPPFLAGS) - fi - CFLAGS="$cf_check_flags"]) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_ACS_MAP version: 6 updated: 2010/10/23 15:54:49 -dnl ----------------- -dnl Check for likely values of acs_map[]: -AC_DEFUN([CF_CURSES_ACS_MAP], -[ -AC_REQUIRE([CF_NCURSES_WRAP_PREFIX])dnl -AC_CACHE_CHECK(for alternate character set array, cf_cv_curses_acs_map,[ -cf_cv_curses_acs_map=unknown -for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map -do -AC_TRY_LINK([ -#include <${cf_cv_ncurses_header:-curses.h}> -],[ -$name['k'] = ACS_PLUS -],[cf_cv_curses_acs_map=$name; break]) -done -]) - -test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map) -]) -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_CHECK_DATA version: 4 updated: 2011/01/15 16:39:24 -dnl -------------------- -dnl Check if curses.h defines the given data/variable. -dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG. -AC_DEFUN([CF_CURSES_CHECK_DATA], -[ -AC_MSG_CHECKING(for data $1 declaration in ${cf_cv_ncurses_header:-curses.h}) - -AC_TRY_COMPILE(CF__CURSES_HEAD,[ -void *foo = &($1) -],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) - AC_DEFINE_UNQUOTED($cf_result) -else - AC_MSG_CHECKING(for data $1 in library) - # BSD linkers insist on making weak linkage, but resolve at runtime. - AC_TRY_RUN(CF__CURSES_HEAD -[ -extern char $1; -int main(void) -{ - void *foo = &($1); - ${cf_cv_main_return:-return}(foo == 0); -}],[cf_result=yes],[cf_result=no],[ - # cross-compiling - AC_TRY_LINK(CF__CURSES_HEAD -[extern char $1;],[ - do { - void *foo = &($1); - ${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) - AC_DEFINE_UNQUOTED($cf_result) - fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_CHECK_TYPE version: 3 updated: 2010/10/23 15:54:49 -dnl -------------------- -dnl Check if curses.h defines the given type -AC_DEFUN([CF_CURSES_CHECK_TYPE], -[ -AC_MSG_CHECKING(for type $1 in ${cf_cv_ncurses_header:-curses.h}) -AC_TRY_COMPILE([ -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}>],[ -$1 foo -],cf_result=yes,cf_result=no) -AC_MSG_RESULT($cf_result) -if test $cf_result = yes ; then - CF_UPPER(cf_result,have_type_$1) - AC_DEFINE_UNQUOTED($cf_result) -else - AC_DEFINE_UNQUOTED($1,$2) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27 -dnl ---------------- -dnl Tie together the configure-script macros for curses. It may be ncurses, -dnl but unless asked, we do not make a special search for ncurses. However, -dnl still check for the ncurses version number, for use in other macros. -AC_DEFUN([CF_CURSES_CONFIG], -[ -CF_CURSES_CPPFLAGS -CF_NCURSES_VERSION -CF_CURSES_LIBS -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11 -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 - test -d /usr/include/curses_colr && \ - cf_cv_curses_incdir="-I/usr/include/curses_colr" - ;; -sunos3*|sunos4*) - test -d /usr/5lib && \ - test -d /usr/5include && \ - cf_cv_curses_incdir="-I/usr/5include" - ;; -esac -]) -test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir" - -CF_CURSES_HEADER -CF_TERM_HEADER -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_FUNCS version: 15 updated: 2010/10/23 15:52:32 -dnl --------------- -dnl Curses-functions are a little complicated, since a lot of them are macros. -AC_DEFUN([CF_CURSES_FUNCS], -[ -AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl -AC_REQUIRE([CF_XOPEN_CURSES]) -AC_REQUIRE([CF_CURSES_TERM_H]) -for cf_func in $1 -do - CF_UPPER(cf_tr_func,$cf_func) - AC_MSG_CHECKING(for ${cf_func}) - CF_MSG_LOG(${cf_func}) - AC_CACHE_VAL(cf_cv_func_$cf_func,[ - eval cf_result='$ac_cv_func_'$cf_func - if test ".$cf_result" != ".no"; then - AC_TRY_LINK(CF__CURSES_HEAD, - [ -#ifndef ${cf_func} -long foo = (long)(&${cf_func}); -${cf_cv_main_return:-return}(foo == 0); -#endif - ], - [cf_result=yes], - [cf_result=no]) - fi - eval 'cf_cv_func_'$cf_func'=$cf_result' - ]) - # use the computed/retrieved cache-value: - eval 'cf_result=$cf_cv_func_'$cf_func - AC_MSG_RESULT($cf_result) - if test $cf_result != no; then - AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func}) - fi -done -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16 -dnl ---------------- -dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common -dnl variations of ncurses' installs. -dnl -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/curses.h \ - $1/ncurses.h]) \ - curses.h \ - ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h]) -do -AC_TRY_COMPILE([#include <${cf_header}>], - [initscr(); tgoto("?", 0,0)], - [cf_cv_ncurses_header=$cf_header; break],[]) -done -]) - -if test "$cf_cv_ncurses_header" = none ; then - AC_MSG_ERROR(No curses header-files found) -fi - -# cheat, to get the right #define's for HAVE_NCURSES_H, etc. -AC_CHECK_HEADERS($cf_cv_ncurses_header) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_LIBS version: 33 updated: 2011/03/06 12:37:18 -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. -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) -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 - AC_CHECK_LIB(cur_colr,initscr,[ - CF_ADD_LIBS(-lcur_colr) - ac_cv_func_initscr=yes - ],[ - 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" - ac_cv_func_initscr=yes - ])]) - ;; -linux*) - case `arch 2>/dev/null` in - x86_64) - if test -d /lib64 - then - CF_ADD_LIBDIR(/lib64) - else - CF_ADD_LIBDIR(/lib) - fi - ;; - *) - CF_ADD_LIBDIR(/lib) - ;; - esac - ;; -sunos3*|sunos4*) - if test -d /usr/5lib ; then - CF_ADD_LIBDIR(/usr/5lib) - CF_ADD_LIBS(-lcurses -ltermcap) - fi - ac_cv_func_initscr=yes - ;; -esac - -if test ".$ac_cv_func_initscr" != .yes ; then - cf_save_LIBS="$LIBS" - cf_term_lib="" - cf_curs_lib="" - - if test ".${cf_cv_ncurses_version:-no}" != .no - then - cf_check_list="ncurses curses cursesX" - else - cf_check_list="cursesX curses ncurses" - fi - - # Check for library containing tgoto. Do this before curses library - # because it may be needed to link the test-case for initscr. - AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ - for cf_term_lib in $cf_check_list termcap termlib unknown - do - AC_CHECK_LIB($cf_term_lib,tgoto,[break]) - done - ]) - - # Check for library containing initscr - test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" - for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown - do - AC_CHECK_LIB($cf_curs_lib,initscr,[break]) - done - 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: 8 updated: 2010/10/23 15:54:49 -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, -dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4 -dnl running with Solaris 2.5.1). -AC_DEFUN([CF_CURSES_TERM_H], -[ -AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl - -AC_CACHE_CHECK(for term.h, cf_cv_term_header,[ - -# If we found , look for , but always look -# for if we do not find the variant. -for cf_header in \ - `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \ - term.h -do - AC_TRY_COMPILE([ -#include <${cf_cv_ncurses_header:-curses.h}> -#include <${cf_header}>], - [WINDOW *x], - [cf_cv_term_header=$cf_header - break], - [cf_cv_term_header=no]) -done - -case $cf_cv_term_header in #(vi -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 - AC_TRY_COMPILE([ -#include <${cf_cv_ncurses_header:-curses.h}> -#ifdef NCURSES_VERSION -#include <${cf_header}> -#else -make an error -#endif], - [WINDOW *x], - [cf_cv_term_header=$cf_header - break], - [cf_cv_term_header=no]) - done - ;; -esac -]) - -case $cf_cv_term_header in #(vi -term.h) #(vi - AC_DEFINE(HAVE_TERM_H) - ;; -ncurses/term.h) #(vi - AC_DEFINE(HAVE_NCURSES_TERM_H) - ;; -ncursesw/term.h) - AC_DEFINE(HAVE_NCURSESW_TERM_H) - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59 -dnl ------------------ -dnl Check for likely values of wacs_map[]. -AC_DEFUN([CF_CURSES_WACS_MAP], -[ -AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[ - cf_cv_curses_wacs_map=unknown - for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char - do - AC_TRY_LINK([ -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}>], - [void *foo = &($name['k'])], - [cf_cv_curses_wacs_map=$name - break]) - done]) - -test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CURSES_WACS_SYMBOLS version: 1 updated: 2011/01/15 11:28:59 -dnl ---------------------- -dnl Do a check to see if the WACS_xxx constants are defined compatibly with -dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx -dnl constants is broken since those constants do not point to cchar_t's. -AC_DEFUN([CF_CURSES_WACS_SYMBOLS], -[ -AC_REQUIRE([CF_CURSES_WACS_MAP]) - -AC_CACHE_CHECK(for wide alternate character constants, cf_cv_curses_wacs_symbols,[ -cf_cv_curses_wacs_symbols=no -if test "$cf_cv_curses_wacs_map" != unknown -then - AC_TRY_LINK([ -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}>], - [cchar_t *foo = WACS_PLUS; - $cf_cv_curses_wacs_map['k'] = *WACS_PLUS], - [cf_cv_curses_wacs_symbols=yes]) -else - AC_TRY_LINK([ -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}>], - [cchar_t *foo = WACS_PLUS], - [cf_cv_curses_wacs_symbols=yes]) -fi -]) - -test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 -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: 11 updated: 2009/12/13 13:16: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. -dnl -dnl Sets: -dnl ECHO_LT - symbol to control if libtool is verbose -dnl ECHO_LD - symbol to prefix "cc -o" lines -dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) -dnl SHOW_CC - symbol to put before explicit "cc -c" lines -dnl ECHO_CC - symbol to put before any "cc" line -dnl -AC_DEFUN([CF_DISABLE_ECHO],[ -AC_MSG_CHECKING(if you want to see long compiling messages) -CF_ARG_DISABLE(echo, - [ --disable-echo display "compiling" commands], - [ - 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='' -]) -AC_MSG_RESULT($enableval) -AC_SUBST(ECHO_LT) -AC_SUBST(ECHO_LD) -AC_SUBST(RULE_CC) -AC_SUBST(SHOW_CC) -AC_SUBST(ECHO_CC) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 -dnl ---------------- -dnl Combine no-leak checks with the libraries or tools that are used for the -dnl checks. -AC_DEFUN([CF_DISABLE_LEAKS],[ - -AC_REQUIRE([CF_WITH_DMALLOC]) -AC_REQUIRE([CF_WITH_DBMALLOC]) -AC_REQUIRE([CF_WITH_VALGRIND]) - -AC_MSG_CHECKING(if you want to perform memory-leak testing) -AC_ARG_ENABLE(leaks, - [ --disable-leaks test: free permanent memory, analyze leaks], - [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], - : ${with_no_leaks:=no}) -AC_MSG_RESULT($with_no_leaks) - -if test "$with_no_leaks" = yes ; then - AC_DEFINE(NO_LEAKS) - AC_DEFINE(YY_NO_LEAKS) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03 -dnl ------------------ -dnl Configure-option to enable gcc warnings -AC_DEFUN([CF_ENABLE_WARNINGS],[ -if ( test "$GCC" = yes || test "$GXX" = yes ) -then -AC_MSG_CHECKING(if you want to turn on gcc warnings) -CF_ARG_ENABLE(warnings, - [ --enable-warnings test: turn on gcc compiler warnings], - [with_warnings=yes], - [with_warnings=no]) -AC_MSG_RESULT($with_warnings) -if test "$with_warnings" = "yes" -then - CF_GCC_ATTRIBUTES - CF_GCC_WARNINGS -fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 -dnl --------------- -dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We -dnl prefer a standard location, and use -L options only if we do not find the -dnl library in the standard library location(s). -dnl $1 = library name -dnl $2 = library class, usually the same as library name -dnl $3 = includes -dnl $4 = code fragment to compile/link -dnl $5 = corresponding function-name -dnl $6 = flag, nonnull if failure should not cause an error-exit -dnl -dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had -dnl to use a -L option. -AC_DEFUN([CF_FIND_LIBRARY], -[ - eval 'cf_cv_have_lib_'$1'=no' - cf_libdir="" - AC_CHECK_FUNC($5, - eval 'cf_cv_have_lib_'$1'=yes',[ - cf_save_LIBS="$LIBS" - AC_MSG_CHECKING(for $5 in -l$1) - LIBS="-l$1 $LIBS" - AC_TRY_LINK([$3],[$4], - [AC_MSG_RESULT(yes) - eval 'cf_cv_have_lib_'$1'=yes' - ], - [AC_MSG_RESULT(no) - CF_LIBRARY_PATH(cf_search,$2) - for cf_libdir in $cf_search - do - AC_MSG_CHECKING(for -l$1 in $cf_libdir) - LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" - AC_TRY_LINK([$3],[$4], - [AC_MSG_RESULT(yes) - eval 'cf_cv_have_lib_'$1'=yes' - break], - [AC_MSG_RESULT(no) - LIBS="$cf_save_LIBS"]) - done - ]) - ]) -eval 'cf_found_library=[$]cf_cv_have_lib_'$1 -ifelse($6,,[ -if test $cf_found_library = no ; then - AC_MSG_ERROR(Cannot link $1 library) -fi -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 -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. -dnl See also CF_ADD_SEARCHPATH. -dnl -dnl Parameters (4-on are optional): -dnl $1 = headers for library entrypoint -dnl $2 = code fragment for library entrypoint -dnl $3 = the library name without the "-l" option or ".so" suffix. -dnl $4 = action to perform if successful (default: update CPPFLAGS, etc) -dnl $5 = action to perform if not successful -dnl $6 = module name, if not the same as the library name -dnl $7 = extra libraries -dnl -dnl Sets these variables: -dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found -dnl $cf_cv_header_path_$3 - include-directory if needed -dnl $cf_cv_library_path_$3 - library-directory if needed -dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 -AC_DEFUN([CF_FIND_LINKAGE],[ - -# 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_$3= -cf_cv_library_path_$3= - -CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) - -cf_save_LIBS="$LIBS" - -AC_TRY_LINK([$1],[$2],[ - cf_cv_find_linkage_$3=yes - cf_cv_header_path_$3=/usr/include - cf_cv_library_path_$3=/usr/lib -],[ - -LIBS="-l$3 $7 $cf_save_LIBS" - -AC_TRY_LINK([$1],[$2],[ - cf_cv_find_linkage_$3=yes - cf_cv_header_path_$3=/usr/include - cf_cv_library_path_$3=/usr/lib - cf_cv_library_file_$3="-l$3" -],[ - 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) -]) - -LIBS="$cf_save_LIBS" - -if test "$cf_cv_find_linkage_$3" = yes ; then -ifelse([$4],,[ - CF_ADD_INCDIR($cf_cv_header_path_$3) - CF_ADD_LIBDIR($cf_cv_library_path_$3) - CF_ADD_LIB($3) -],[$4]) -else -ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_FUNC_CURSES_VERSION version: 5 updated: 2010/10/23 15:54:49 -dnl ---------------------- -dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS. -dnl It's a character string "SVR4", not documented. -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() -{ - char temp[1024]; - sprintf(temp, "%s\n", curses_version()); - ${cf_cv_main_return:-return}(0); -}] -,[cf_cv_func_curses_version=yes] -,[cf_cv_func_curses_version=no] -,[cf_cv_func_curses_version=unknown]) -rm -f core]) -test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION) -]) -dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 -dnl ----------------- -dnl Test for availability of useful gcc __attribute__ directives to quiet -dnl compiler warnings. Though useful, not all are supported -- and contrary -dnl to documentation, unrecognized directives cause older compilers to barf. -AC_DEFUN([CF_GCC_ATTRIBUTES], -[ -if test "$GCC" = yes -then -cat > conftest.i < conftest.$ac_ext <&AC_FD_CC - - case $cf_attribute in #(vi - printf) #(vi - cf_printf_attribute=yes - cat >conftest.h <conftest.h <conftest.h <>confdefs.h - case $cf_attribute in #(vi - printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h -fi -rm -rf conftest* -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31 -dnl -------------- -dnl Find version of gcc -AC_DEFUN([CF_GCC_VERSION],[ -AC_REQUIRE([AC_PROG_CC]) -GCC_VERSION=none -if test "$GCC" = yes ; then - AC_MSG_CHECKING(version of $CC) - GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" - test -z "$GCC_VERSION" && GCC_VERSION=unknown - AC_MSG_RESULT($GCC_VERSION) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32 -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 -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 -dnl is enabled for ncurses using "--enable-const". -dnl -pedantic -dnl -dnl Parameter: -dnl $1 is an optional list of gcc warning flags that a particular -dnl application might want to use, e.g., "no-unused" for -dnl -Wno-unused -dnl Special: -dnl If $with_ext_const is "yes", add a check for -Wwrite-strings -dnl -AC_DEFUN([CF_GCC_WARNINGS], -[ -AC_REQUIRE([CF_GCC_VERSION]) -CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) - -cat > conftest.$ac_ext <],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - AC_TRY_COMPILE([#include ],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_cv_gnu_source=yes]) - CPPFLAGS="$cf_save" - ]) -]) -test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 -dnl -------------- -dnl Construct a search-list of directories for a nonstandard header-file -dnl -dnl Parameters -dnl $1 = the variable to return as result -dnl $2 = the package name -AC_DEFUN([CF_HEADER_PATH], -[ -$1= - -# 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$,,'` - CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) - cf_header_path_list="$cf_header_path_list [$]$1" - ;; - esac - done -fi - -# add the variations for the package we are looking for -CF_SUBDIR_PATH($1,$2,include) - -test "$includedir" != NONE && \ -test "$includedir" != "/usr/include" && \ -test -d "$includedir" && { - test -d $includedir && $1="[$]$1 $includedir" - test -d $includedir/$2 && $1="[$]$1 $includedir/$2" -} - -test "$oldincludedir" != NONE && \ -test "$oldincludedir" != "/usr/include" && \ -test -d "$oldincludedir" && { - test -d $oldincludedir && $1="[$]$1 $oldincludedir" - test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" -} - -$1="[$]$1 $cf_header_path_list" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42 -dnl ----------------- -dnl If we do not have a given script, look for it in the parent directory. -AC_DEFUN([CF_INHERIT_SCRIPT], -[ -test -f $1 || ( test -f ../$1 && cp ../$1 ./ ) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 -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 -dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. -dnl -dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to -dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from -dnl the wrappers for gcc and g++ warnings. -dnl -dnl $1 = GCC (default) or GXX -dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS -dnl $3 = CFLAGS (default) or CXXFLAGS -AC_DEFUN([CF_INTEL_COMPILER],[ -ifelse([$2],,INTEL_COMPILER,[$2])=no - -if test "$ifelse([$1],,[$1],GCC)" = yes ; then - case $host_os in - 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" - AC_TRY_COMPILE([],[ -#ifdef __INTEL_COMPILER -#else -make an error -#endif -],[ifelse([$2],,INTEL_COMPILER,[$2])=yes -cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" -],[]) - ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" - AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) - ;; - esac -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 -dnl --------------- -dnl Construct a search-list of directories for a nonstandard library-file -dnl -dnl Parameters -dnl $1 = the variable to return as result -dnl $2 = the package name -AC_DEFUN([CF_LIBRARY_PATH], -[ -$1= -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$,,'` - CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) - cf_library_path_list="$cf_library_path_list [$]$1" - ;; - esac - done -fi - -CF_SUBDIR_PATH($1,$2,lib) - -$1="$cf_library_path_list [$]$1" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 -dnl ------------ -dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have -dnl a monocase filesystem. -AC_DEFUN([CF_MAKE_TAGS],[ -AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) - -AC_CHECK_PROGS(CTAGS, exctags ctags) -AC_CHECK_PROGS(ETAGS, exetags etags) - -AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) - -if test "$cf_cv_mixedcase" = yes ; then - AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) -else - MAKE_UPPER_TAGS=no -fi - -if test "$MAKE_UPPER_TAGS" = yes ; then - MAKE_UPPER_TAGS= -else - MAKE_UPPER_TAGS="#" -fi - -if test "$MAKE_LOWER_TAGS" = yes ; then - MAKE_LOWER_TAGS= -else - MAKE_LOWER_TAGS="#" -fi - -AC_SUBST(CTAGS) -AC_SUBST(ETAGS) - -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 ----------- -dnl Checks for libraries. At least one UNIX system, Apple Macintosh -dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler -dnl AC_CHECK_LIB(m,sin), because that fails for C++. -AC_DEFUN([CF_MATH_LIB], -[ -AC_CACHE_CHECK(if -lm needed for math functions, - cf_cv_need_libm,[ - AC_TRY_LINK([ - #include - #include - ], - [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], - [cf_cv_need_libm=no], - [cf_cv_need_libm=yes])]) -if test "$cf_cv_need_libm" = yes -then -ifelse($1,,[ - CF_ADD_LIB(m) -],[$1=-lm]) -fi -]) -dnl --------------------------------------------------------------------------- -dnl CF_MIN_GETCCHAR version: 3 updated: 2010/10/23 15:54:49 -dnl --------------- -dnl CF_MIN_GETCCHAR -dnl Check whether getcchar's return value counts the trailing null in a wchar_t -dnl string, or not. X/Open says it does, but Tru64 and Solaris do not do this. -AC_DEFUN([CF_MIN_GETCCHAR],[ -AC_CACHE_CHECK(if getcchar counts trailing null,cf_cv_min_getcchar,[ -AC_TRY_RUN([ -#include -#include -#include <${cf_cv_ncurses_header:-curses.h}> - -int main() -{ - wchar_t data[2]; - cchar_t temp[2]; - int count; - data[0] = L'\0'; - setcchar(temp, data, 0, 0, (void *)0); - count = getcchar(temp, (wchar_t *)0, (attr_t *)0, (short *)0, (void *)0); - ${cf_cv_main_return:-return}(count != 0); -}], - [cf_cv_min_getcchar=no], - [cf_cv_min_getcchar=yes], - [cf_cv_min_getcchar=yes]) -]) -if test "$cf_cv_min_getcchar" = yes ; then - AC_DEFINE(MIN_GETCCHAR,1) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55 -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. -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*|*-mingw32*|*-uwin*) #(vi - cf_cv_mixedcase=no - ;; - *) - cf_cv_mixedcase=yes - ;; - esac -else - rm -f conftest CONFTEST - echo test >conftest - if test -f CONFTEST ; then - cf_cv_mixedcase=no - else - cf_cv_mixedcase=yes - fi - rm -f conftest CONFTEST -fi -]) -test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 -dnl ---------- -dnl Write a debug message to config.log, along with the line number in the -dnl configure script. -AC_DEFUN([CF_MSG_LOG],[ -echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 -dnl ------------------- -dnl Check if we can compile with ncurses' header file -dnl $1 is the cache variable to set -dnl $2 is the header-file to include -dnl $3 is the root name (ncurses or ncursesw) -AC_DEFUN([CF_NCURSES_CC_CHECK],[ - AC_TRY_COMPILE([ -]ifelse($3,ncursesw,[ -#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 <$2>],[ -#ifdef NCURSES_VERSION -]ifelse($3,ncursesw,[ -#ifndef WACS_BSSB - make an error -#endif -])[ -printf("%s\n", NCURSES_VERSION); -#else -#ifdef __NCURSES_H -printf("old\n"); -#else - make an error -#endif -#endif - ] - ,[$1=$2] - ,[$1=no]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30 -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 -dnl $1 is the root library name (default: "ncurses") -AC_DEFUN([CF_NCURSES_CONFIG], -[ -cf_ncuconfig_root=ifelse($1,,ncurses,$1) - -echo "Looking for ${cf_ncuconfig_root}-config" -AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none) - -if test "$NCURSES_CONFIG" != none ; then - -CPPFLAGS="$CPPFLAGS `$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) - -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 -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38 -dnl ------------------- -dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting -dnl the CPPFLAGS variable so we can include its header. -dnl -dnl The header files may be installed as either curses.h, or ncurses.h (would -dnl be obsolete, except that some packagers prefer this name to distinguish it -dnl from a "native" curses implementation). If not installed for overwrite, -dnl the curses.h file would be in an ncurses subdirectory (e.g., -dnl /usr/include/ncurses), but someone may have installed overwriting the -dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd -dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in -dnl the header. -dnl -dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header -dnl is already in the include-path, don't even bother with this, since we cannot -dnl easily determine which file it is. In this case, it has to be . -dnl -dnl The optional parameter gives the root name of the library, in case it is -dnl not installed as the default curses library. That is how the -dnl wide-character version of ncurses is installed. -AC_DEFUN([CF_NCURSES_CPPFLAGS], -[AC_REQUIRE([CF_WITH_CURSES_DIR]) - -AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl -cf_ncuhdr_root=ifelse($1,,ncurses,$1) - -test -n "$cf_cv_curses_dir" && \ -test "$cf_cv_curses_dir" != "no" && { \ - CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) -} - -AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ - cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" - ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" - for cf_header in $cf_header_list - do - CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) - test "$cf_cv_ncurses_h" != no && break - done -]) - -CF_NCURSES_HEADER -CF_TERM_HEADER - -# some applications need this, but should check for NCURSES_VERSION -AC_DEFINE(NCURSES) - -CF_NCURSES_VERSION -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_EXT_FUNCS version: 3 updated: 2010/11/13 19:43:23 -dnl -------------------- -dnl Since 2007/11/17, ncurses has defined NCURSES_EXT_FUNCS; earlier versions -dnl may provide these functions. Define the symbol if it is not defined, and -dnl if it is valid. -AC_DEFUN([CF_NCURSES_EXT_FUNCS], -[ -AC_CACHE_CHECK(for ncurses extended functions,cf_cv_ncurses_ext_funcs,[ -AC_TRY_COMPILE([ -#include <${cf_cv_ncurses_header:-curses.h}>], -[ -int x = NCURSES_EXT_FUNCS -],[cf_cv_ncurses_ext_funcs=defined],[ -AC_TRY_LINK([ -#include <${cf_cv_ncurses_header:-curses.h}>], -[ - (void) assume_default_colors (0, 0); - (void) curses_version (); - (void) define_key (0, 0); - (void) is_term_resized (0, 0); - (void) key_defined (0); - (void) keybound (0, 0); - (void) keyok (0, 0); - (void) resize_term (0, 0); - (void) resizeterm (0, 0); - (void) use_default_colors (); - (void) use_extended_names (0); - (void) wresize (0, 0, 0);], - [cf_cv_ncurses_ext_funcs=yes], - [cf_cv_ncurses_ext_funcs=no]) -]) -]) -test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54 -dnl ----------------- -dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common -dnl variations of ncurses' installs. -dnl -dnl See also CF_CURSES_HEADER, which sets the same cache variable. -AC_DEFUN([CF_NCURSES_HEADER],[ - -if test "$cf_cv_ncurses_h" != no ; then - cf_cv_ncurses_header=$cf_cv_ncurses_h -else - -AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ - test -n "$verbose" && echo - CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) - test -n "$verbose" && echo search path $cf_search - cf_save2_CPPFLAGS="$CPPFLAGS" - for cf_incdir in $cf_search - do - CF_ADD_INCDIR($cf_incdir) - for cf_header in \ - ncurses.h \ - curses.h - do - CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) - if test "$cf_cv_ncurses_h2" != no ; then - cf_cv_ncurses_h2=$cf_incdir/$cf_header - test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG - break - fi - test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG - done - CPPFLAGS="$cf_save2_CPPFLAGS" - test "$cf_cv_ncurses_h2" != no && break - done - test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) - ]) - - CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) - cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` - if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then - cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header - fi - CF_ADD_INCDIR($cf_1st_incdir) - -fi - -# Set definitions to allow ifdef'ing for ncurses.h - -case $cf_cv_ncurses_header in # (vi -*ncurses.h) - AC_DEFINE(HAVE_NCURSES_H) - ;; -esac - -case $cf_cv_ncurses_header in # (vi -ncurses/curses.h|ncurses/ncurses.h) - AC_DEFINE(HAVE_NCURSES_NCURSES_H) - ;; -ncursesw/curses.h|ncursesw/ncurses.h) - AC_DEFINE(HAVE_NCURSESW_NCURSES_H) - ;; -esac - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38 -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. -dnl Some distributions have gpm linked with (bsd) curses, which makes it -dnl unusable with ncurses. However, we don't want to link with gpm unless -dnl ncurses has a dependency, since gpm is normally set up as a shared library, -dnl and the linker will record a dependency. -dnl -dnl The optional parameter gives the root name of the library, in case it is -dnl not installed as the default curses library. That is how the -dnl wide-character version of ncurses is installed. -AC_DEFUN([CF_NCURSES_LIBS], -[AC_REQUIRE([CF_NCURSES_CPPFLAGS]) - -cf_nculib_root=ifelse($1,,ncurses,$1) - # 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" -AC_CHECK_LIB(gpm,Gpm_Open, - [AC_CHECK_LIB(gpm,initscr, - [LIBS="$cf_ncurses_SAVE"], - [cf_ncurses_LIBS="-lgpm"])]) - -case $host_os in #(vi -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 - AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) - fi - ;; -esac - -CF_ADD_LIBS($cf_ncurses_LIBS) - -if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) -then - CF_ADD_LIBS(-l$cf_nculib_root) -else - CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, - [#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr()], - initscr) -fi - -if test -n "$cf_ncurses_LIBS" ; then - AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) - cf_ncurses_SAVE="$LIBS" - for p in $cf_ncurses_LIBS ; do - q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` - if test "$q" != "$LIBS" ; then - LIBS="$q" - fi - done - AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], - [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - LIBS="$cf_ncurses_SAVE"]) -fi - -CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) -AC_DEFINE_UNQUOTED($cf_nculib_ROOT) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49 -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 -dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. -AC_DEFUN([CF_NCURSES_VERSION], -[ -AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl -AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ - cf_cv_ncurses_version=no - cf_tempfile=out$$ - rm -f $cf_tempfile - AC_TRY_RUN([ -#include <${cf_cv_ncurses_header:-curses.h}> -#include -int main() -{ - FILE *fp = fopen("$cf_tempfile", "w"); -#ifdef NCURSES_VERSION -# ifdef NCURSES_VERSION_PATCH - fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); -# else - fprintf(fp, "%s\n", NCURSES_VERSION); -# endif -#else -# ifdef __NCURSES_H - fprintf(fp, "old\n"); -# else - make an error -# endif -#endif - ${cf_cv_main_return:-return}(0); -}],[ - cf_cv_ncurses_version=`cat $cf_tempfile`],,[ - - # This will not work if the preprocessor splits the line after the - # Autoconf token. The 'unproto' program does that. - cat > conftest.$ac_ext < -#undef Autoconf -#ifdef NCURSES_VERSION -Autoconf NCURSES_VERSION -#else -#ifdef __NCURSES_H -Autoconf "old" -#endif -; -#endif -EOF - cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" - AC_TRY_EVAL(cf_try) - if test -f conftest.out ; then - cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` - test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" - rm -f conftest.out - fi -]) - rm -f $cf_tempfile -]) -test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_WRAP_PREFIX version: 1 updated: 2009/03/28 16:08:10 -dnl ---------------------- -dnl Check for ncurses "wrap-prefix" used for public variables which have been -dnl wrapped with a function to help with concurrency control. -AC_DEFUN([CF_NCURSES_WRAP_PREFIX], -[ -AC_MSG_CHECKING(for ncurses wrap-prefix) -AC_ARG_WITH(ncurses-wrap-prefix, - [ --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables], - [NCURSES_WRAP_PREFIX=$withval], - [NCURSES_WRAP_PREFIX=_nc_]) -AC_MSG_RESULT($NCURSES_WRAP_PREFIX) - -AC_SUBST(NCURSES_WRAP_PREFIX) -]) -dnl --------------------------------------------------------------------------- -dnl CF_NETBSD_FORM_H version: 1 updated: 2011/01/15 14:59:18 -dnl ---------------- -dnl Check for NetBSD's form.h, which is incompatible with SVr4 and ncurses. -dnl Some workarounds are needed in client programs to allow them to compile. -AC_DEFUN([CF_NETBSD_FORM_H],[ -AC_CACHE_CHECK(for NetBSD form.h,cf_cv_netbsd_form_h,[ -AC_TRY_COMPILE([ -#include <${cf_cv_ncurses_header:-curses.h}> -#include -],[ - FORM *form; - int y = current_field(form)->cursor_ypos; - int x = current_field(form)->cursor_xpos; -],[cf_cv_netbsd_form_h=yes -],[cf_cv_netbsd_form_h=no]) -]) - -test "$cf_cv_netbsd_form_h" = yes && AC_DEFINE(HAVE_NETBSD_FORM_H) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NETBSD_MENU_H version: 1 updated: 2011/01/15 14:59:18 -dnl ---------------- -dnl Check for NetBSD's menu.h, which is incompatible with SVr4 and ncurses. -dnl Some workarounds are needed in client programs to allow them to compile. -AC_DEFUN([CF_NETBSD_MENU_H],[ -AC_CACHE_CHECK(for NetBSD menu.h,cf_cv_netbsd_menu_h,[ -AC_TRY_COMPILE([ -#include <${cf_cv_ncurses_header:-curses.h}> -#include -],[ - MENU *menu; - int y = menu->max_item_width; -],[cf_cv_netbsd_menu_h=yes -],[cf_cv_netbsd_menu_h=no]) -]) - -test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 -dnl ------------------ -dnl see CF_WITH_NO_LEAKS -AC_DEFUN([CF_NO_LEAKS_OPTION],[ -AC_MSG_CHECKING(if you want to use $1 for testing) -AC_ARG_WITH($1, - [$2], - [AC_DEFINE($3)ifelse([$4],,[ - $4 -]) - : ${with_cflags:=-g} - : ${with_no_leaks:=yes} - with_$1=yes], - [with_$1=]) -AC_MSG_RESULT(${with_$1:-no}) - -case .$with_cflags in #(vi -.*-g*) - case .$CFLAGS in #(vi - .*-g*) #(vi - ;; - *) - CF_ADD_CFLAGS([-g]) - ;; - esac - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 -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 -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" -else - cf_path_syntax="$ac_default_prefix" -fi - -case ".[$]$1" in #(vi -.\[$]\(*\)*|.\'*\'*) #(vi - ;; -..|./*|.\\*) #(vi - ;; -.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX - ;; -.\[$]{*prefix}*) #(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) - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PDCURSES_X11 version: 11 updated: 2011/01/15 18:45:38 -dnl --------------- -dnl Configure for PDCurses' X11 library -AC_DEFUN([CF_PDCURSES_X11],[ -AC_REQUIRE([CF_X_ATHENA]) - -AC_PATH_PROGS(XCURSES_CONFIG,xcurses-config,none) - -if test "$XCURSES_CONFIG" != none ; then - -CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`" -CF_ADD_LIBS(`$XCURSES_CONFIG --libs`) - -cf_cv_lib_XCurses=yes - -else - -LDFLAGS="$LDFLAGS $X_LIBS" -CF_CHECK_CFLAGS($X_CFLAGS) -AC_CHECK_LIB(X11,XOpenDisplay, - [CF_ADD_LIBS(-lX11)],, - [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS]) -AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[ -CF_ADD_LIBS(-lXCurses) -AC_TRY_LINK([ -#include -char *XCursesProgramName = "test"; -],[XCursesExit();], -[cf_cv_lib_XCurses=yes], -[cf_cv_lib_XCurses=no]) -]) - -fi - -if test $cf_cv_lib_XCurses = yes ; then - AC_DEFINE(UNIX) - AC_DEFINE(XCURSES) - AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES)) -else - AC_MSG_ERROR(Cannot link with XCurses) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24 -dnl ------------- -dnl Check for the package-config program, unless disabled by command-line. -AC_DEFUN([CF_PKG_CONFIG], -[ -AC_MSG_CHECKING(if you want to use pkg-config) -AC_ARG_WITH(pkg-config, - [ --with-pkg-config{=path} enable/disable use of pkg-config], - [cf_pkg_config=$withval], - [cf_pkg_config=yes]) -AC_MSG_RESULT($cf_pkg_config) - -case $cf_pkg_config in #(vi -no) #(vi - PKG_CONFIG=none - ;; -yes) #(vi - AC_PATH_TOOL(PKG_CONFIG, pkg-config, none) - ;; -*) - PKG_CONFIG=$withval - ;; -esac - -test -z "$PKG_CONFIG" && PKG_CONFIG=none -if test "$PKG_CONFIG" != none ; then - CF_PATH_SYNTAX(PKG_CONFIG) -fi - -AC_SUBST(PKG_CONFIG) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 -dnl ----------------- -dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. -dnl -dnl POSIX.1-1990 _POSIX_SOURCE -dnl POSIX.1-1990 and _POSIX_SOURCE and -dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 -dnl Bindings Option -dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L -dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L -dnl X/Open 2000 _POSIX_C_SOURCE=200112L -dnl -dnl Parameters: -dnl $1 is the nominal value for _POSIX_C_SOURCE -AC_DEFUN([CF_POSIX_C_SOURCE], -[ -cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) - -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" - -CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) -CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) - -AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ - CF_MSG_LOG(if the symbol is already defined go no further) - AC_TRY_COMPILE([#include ],[ -#ifndef _POSIX_C_SOURCE -make an error -#endif], - [cf_cv_posix_c_source=no], - [cf_want_posix_source=no - case .$cf_POSIX_C_SOURCE in #(vi - .[[12]]??*) #(vi - cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" - ;; - .2) #(vi - 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 - AC_TRY_COMPILE([#include ],[ -#ifdef _POSIX_SOURCE -make an error -#endif],[], - cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") - fi - CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) - CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" - CF_MSG_LOG(if the second compile does not leave our definition intact error) - AC_TRY_COMPILE([#include ],[ -#ifndef _POSIX_C_SOURCE -make an error -#endif],, - [cf_cv_posix_c_source=no]) - CFLAGS="$cf_save_CFLAGS" - CPPFLAGS="$cf_save_CPPFLAGS" - ]) -]) - -if test "$cf_cv_posix_c_source" != no ; then - CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS" - CF_ADD_CFLAGS($cf_cv_posix_c_source) -fi - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PRG_RULES version: 1 updated: 2006/06/03 11:45:08 -dnl ------------ -dnl Append definitions and rules for the given programs to the subdirectory -dnl Makefiles, and the recursion rule for the top-level Makefile. -dnl -dnl parameters -dnl $1 = script to run -dnl $2 = list of subdirectories -dnl -dnl variables -dnl $AWK -AC_DEFUN([CF_PRG_RULES], -[ -for cf_dir in $2 -do - if test ! -d $srcdir/$cf_dir; then - continue - elif test -f $srcdir/$cf_dir/programs; then - $AWK -f $1 $srcdir/$cf_dir/programs >>$cf_dir/Makefile - fi -done - -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30 -dnl -------------- -dnl Check if C (preprocessor) -U and -D options are processed in the order -dnl given rather than by type of option. Some compilers insist on apply all -dnl of the -U options after all of the -D options. Others allow mixing them, -dnl and may predefine symbols that conflict with those we define. -AC_DEFUN([CF_PROG_CC_U_D], -[ -AC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[ - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" - AC_TRY_COMPILE([],[ -#ifndef U_D_OPTIONS -make an undefined-error -#endif -#ifdef D_U_OPTIONS -make a defined-error -#endif - ],[ - cf_cv_cc_u_d_options=yes],[ - cf_cv_cc_u_d_options=no]) - CPPFLAGS="$cf_save_CPPFLAGS" -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 -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 -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%^.*/%%'` - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 -dnl ------------ -AC_DEFUN([CF_PROG_LINT], -[ -AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) -AC_SUBST(LINT_OPTS) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 -dnl ---------------- -dnl Remove all -U and -D options that refer to the given symbol from a list -dnl of C compiler options. This works around the problem that not all -dnl compilers process -U and -D options from left-to-right, so a -U option -dnl cannot be used to cancel the effect of a preceding -D option. -dnl -dnl $1 = target (which could be the same as the source variable) -dnl $2 = source (including '$') -dnl $3 = symbol to remove -define([CF_REMOVE_DEFINE], -[ -$1=`echo "$2" | \ - sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ - -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SIG_ATOMIC_T version: 2 updated: 2005/09/18 17:27:12 -dnl --------------- -dnl signal handler, but there are some gcc depedencies in that recommendation. -dnl Try anyway. -AC_DEFUN([CF_SIG_ATOMIC_T], -[ -AC_MSG_CHECKING(for signal global datatype) -AC_CACHE_VAL(cf_cv_sig_atomic_t,[ - for cf_type in \ - "volatile sig_atomic_t" \ - "sig_atomic_t" \ - "int" - do - AC_TRY_COMPILE([ -#include -#include -#include - -extern $cf_type x; -$cf_type x; -static void handler(int sig) -{ - x = 5; -}], - [signal(SIGINT, handler); - x = 1], - [cf_cv_sig_atomic_t=$cf_type], - [cf_cv_sig_atomic_t=no]) - test "$cf_cv_sig_atomic_t" != no && break - done - ]) -AC_MSG_RESULT($cf_cv_sig_atomic_t) -test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 -dnl -------------- -dnl Construct a search-list for a nonstandard header/lib-file -dnl $1 = the variable to return as result -dnl $2 = the package name -dnl $3 = the subdirectory, e.g., bin, include or lib -AC_DEFUN([CF_SUBDIR_PATH], -[ -$1= - -CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) -CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) -CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) -CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) -CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_SYS_TIME_SELECT version: 4 updated: 2000/10/04 09:18:40 -dnl ------------------ -dnl Check if we can include with ; this breaks on -dnl older SCO configurations. -AC_DEFUN([CF_SYS_TIME_SELECT], -[ -AC_MSG_CHECKING(if sys/time.h works with sys/select.h) -AC_CACHE_VAL(cf_cv_sys_time_select,[ -AC_TRY_COMPILE([ -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -],[],[cf_cv_sys_time_select=yes], - [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) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49 -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 - 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 -AC_TRY_COMPILE([#include -#include <${cf_cv_ncurses_header:-curses.h}> -#include <$cf_test> -],[int x = auto_left_margin],[ - cf_cv_term_header="$cf_test"],[ - cf_cv_term_header=unknown - ]) - test "$cf_cv_term_header" != unknown && break -done -]) - -# Set definitions to allow ifdef'ing to accommodate subdirectories - -case $cf_cv_term_header in # (vi -*term.h) - AC_DEFINE(HAVE_TERM_H) - ;; -esac - -case $cf_cv_term_header in # (vi -ncurses/term.h) #(vi - AC_DEFINE(HAVE_NCURSES_TERM_H) - ;; -ncursesw/term.h) - AC_DEFINE(HAVE_NCURSESW_TERM_H) - ;; -esac -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_TRY_PKG_CONFIG version: 4 updated: 2010/06/14 17:42:30 -dnl ----------------- -dnl This is a simple wrapper to use for pkg-config, for libraries which may be -dnl available in that form. -dnl -dnl $1 = package name -dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS -dnl $3 = logic to use if pkg-config does not have the package -AC_DEFUN([CF_TRY_PKG_CONFIG],[ -AC_REQUIRE([CF_PKG_CONFIG]) - -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then - CF_VERBOSE(found package $1) - cf_pkgconfig_incs="`$PKG_CONFIG --cflags $1 2>/dev/null`" - cf_pkgconfig_libs="`$PKG_CONFIG --libs $1 2>/dev/null`" - CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs) - CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs) - CF_ADD_CFLAGS($cf_pkgconfig_incs) - CF_ADD_LIBS($cf_pkgconfig_libs) - ifelse([$2],,:,[$2]) -else - ifelse([$3],,:,[$3]) -fi -]) -dnl --------------------------------------------------------------------------- -dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 -dnl -------- -dnl Make an uppercase version of a variable -dnl $1=uppercase($2) -AC_DEFUN([CF_UPPER], -[ -$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 -dnl ----------- -dnl Check for multibyte support, and if not found, utf8 compatibility library -AC_DEFUN([CF_UTF8_LIB], -[ -AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ - cf_save_LIBS="$LIBS" - AC_TRY_LINK([ -#include ],[putwc(0,0);], - [cf_cv_utf8_lib=yes], - [CF_FIND_LINKAGE([ -#include ],[putwc(0,0);],utf8, - [cf_cv_utf8_lib=add-on], - [cf_cv_utf8_lib=no]) -])]) - -# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between -# ncurses/ncursesw: -if test "$cf_cv_utf8_lib" = "add-on" ; then - AC_DEFINE(HAVE_LIBUTF8_H) - CF_ADD_INCDIR($cf_cv_header_path_utf8) - CF_ADD_LIBDIR($cf_cv_library_path_utf8) - CF_ADD_LIBS($cf_cv_library_file_utf8) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 -dnl ---------- -dnl Use AC_VERBOSE w/o the warnings -AC_DEFUN([CF_VERBOSE], -[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG -CF_MSG_LOG([$1]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57 -dnl ------------- -dnl Check if type wide-character type $1 is declared, and if so, which header -dnl file is needed. The second parameter is used to set a shell variable when -dnl the type is not found. The first parameter sets a shell variable for the -dnl opposite sense. -AC_DEFUN([CF_WCHAR_TYPE], -[ -# This is needed on Tru64 5.0 to declare $1 -AC_CACHE_CHECK(if we must include wchar.h to declare $1,cf_cv_$1,[ -AC_TRY_COMPILE([ -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif], - [$1 state], - [cf_cv_$1=no], - [AC_TRY_COMPILE([ -#include -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif], - [$1 value], - [cf_cv_$1=yes], - [cf_cv_$1=unknown])])]) - -if test "$cf_cv_$1" = yes ; then - AC_DEFINE(NEED_WCHAR_H) - NEED_WCHAR_H=1 -fi - -ifelse([$2],,,[ -# if we do not find $1 in either place, use substitution to provide a fallback. -if test "$cf_cv_$1" = unknown ; then - $2=1 -fi -]) -ifelse($3,,,[ -# if we find $1 in either place, use substitution to provide a fallback. -if test "$cf_cv_$1" != unknown ; then - $3=1 -fi -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38 -dnl ------------------ -dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses -dnl libraries. -AC_DEFUN([CF_WITH_CURSES_DIR],[ - -AC_MSG_CHECKING(for specific curses-directory) -AC_ARG_WITH(curses-dir, - [ --with-curses-dir=DIR directory in which (n)curses is installed], - [cf_cv_curses_dir=$withval], - [cf_cv_curses_dir=no]) -AC_MSG_RESULT($cf_cv_curses_dir) - -if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) -then - CF_PATH_SYNTAX(withval) - if test -d "$cf_cv_curses_dir" - then - CF_ADD_INCDIR($cf_cv_curses_dir/include) - CF_ADD_LIBDIR($cf_cv_curses_dir/lib) - fi -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 -dnl ---------------- -dnl Configure-option for dbmalloc. The optional parameter is used to override -dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. -AC_DEFUN([CF_WITH_DBMALLOC],[ -CF_NO_LEAKS_OPTION(dbmalloc, - [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], - [USE_DBMALLOC]) - -if test "$with_dbmalloc" = yes ; then - AC_CHECK_HEADER(dbmalloc.h, - [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 -dnl --------------- -dnl Configure-option for dmalloc. The optional parameter is used to override -dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. -AC_DEFUN([CF_WITH_DMALLOC],[ -CF_NO_LEAKS_OPTION(dmalloc, - [ --with-dmalloc test: use Gray Watson's dmalloc library], - [USE_DMALLOC]) - -if test "$with_dmalloc" = yes ; then - AC_CHECK_HEADER(dmalloc.h, - [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21 -dnl ---------------- -AC_DEFUN([CF_WITH_VALGRIND],[ -CF_NO_LEAKS_OPTION(valgrind, - [ --with-valgrind test: use valgrind], - [USE_VALGRIND]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_CURSES version: 11 updated: 2011/01/18 18:15:30 -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. -dnl -dnl The getbegyx() check is needed for HPUX, which omits legacy macros such -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_TRY_LINK([ -#include -#include <${cf_cv_ncurses_header:-curses.h}>],[ -#if defined(NCURSES_VERSION_PATCH) -#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403) - 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 -#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=yes], - [cf_cv_need_xopen_extension=unknown])])]) -test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 -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, -dnl without losing the common non-POSIX features. -dnl -dnl Parameters: -dnl $1 is the nominal value for _XOPEN_SOURCE -dnl $2 is the nominal value for _POSIX_C_SOURCE -AC_DEFUN([CF_XOPEN_SOURCE],[ - -cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) -cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) -cf_xopen_source= - -case $host_os in #(vi -aix[[456]]*) #(vi - cf_xopen_source="-D_ALL_SOURCE" - ;; -cygwin) #(vi - cf_XOPEN_SOURCE=600 - ;; -darwin[[0-8]].*) #(vi - cf_xopen_source="-D_APPLE_C_SOURCE" - ;; -darwin*) #(vi - cf_xopen_source="-D_DARWIN_C_SOURCE" - ;; -freebsd*|dragonfly*) #(vi - # 5.x headers associate - # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L - # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L - cf_POSIX_C_SOURCE=200112L - 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 - cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" - ;; -hpux*) #(vi - cf_xopen_source="-D_HPUX_SOURCE" - ;; -irix[[56]].*) #(vi - cf_xopen_source="-D_SGI_SOURCE" - ;; -linux*|gnu*|mint*|k*bsd*-gnu) #(vi - CF_GNU_SOURCE - ;; -mirbsd*) #(vi - # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks - ;; -netbsd*) #(vi - # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw - ;; -openbsd*) #(vi - # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw - ;; -osf[[45]]*) #(vi - cf_xopen_source="-D_OSF_SOURCE" - ;; -nto-qnx*) #(vi - cf_xopen_source="-D_QNX_SOURCE" - ;; -sco*) #(vi - # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer - ;; -solaris2.1[[0-9]]) #(vi - cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - ;; -solaris2.[[1-9]]) #(vi - cf_xopen_source="-D__EXTENSIONS__" - ;; -*) - AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ - AC_TRY_COMPILE([#include ],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - AC_TRY_COMPILE([#include ],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_xopen_source=no], - [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) - CPPFLAGS="$cf_save" - ]) -]) - if test "$cf_cv_xopen_source" != no ; then - CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) - CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) - cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" - CF_ADD_CFLAGS($cf_temp_xopen_source) - fi - CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) - ;; -esac - -if test -n "$cf_xopen_source" ; then - CF_ADD_CFLAGS($cf_xopen_source) -fi -]) -dnl --------------------------------------------------------------------------- -dnl CF_X_ATHENA version: 20 updated: 2010/11/09 05:18:02 -dnl ----------- -dnl Check for Xaw (Athena) libraries -dnl -dnl Sets $cf_x_athena according to the flavor of Xaw which is used. -AC_DEFUN([CF_X_ATHENA], -[ -cf_x_athena=${cf_x_athena:-Xaw} - -AC_MSG_CHECKING(if you want to link with Xaw 3d library) -withval= -AC_ARG_WITH(Xaw3d, - [ --with-Xaw3d link with Xaw 3d library]) -if test "$withval" = yes ; then - cf_x_athena=Xaw3d - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - -AC_MSG_CHECKING(if you want to link with neXT Athena library) -withval= -AC_ARG_WITH(neXtaw, - [ --with-neXtaw link with neXT Athena library]) -if test "$withval" = yes ; then - cf_x_athena=neXtaw - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - -AC_MSG_CHECKING(if you want to link with Athena-Plus library) -withval= -AC_ARG_WITH(XawPlus, - [ --with-XawPlus link with Athena-Plus library]) -if test "$withval" = yes ; then - cf_x_athena=XawPlus - AC_MSG_RESULT(yes) -else - AC_MSG_RESULT(no) -fi - -cf_x_athena_lib="" - -if test "$PKG_CONFIG" != none ; then - cf_athena_list= - test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6" - for cf_athena_pkg in \ - $cf_athena_list \ - ${cf_x_athena} \ - ${cf_x_athena}-devel \ - lib${cf_x_athena} \ - lib${cf_x_athena}-devel - do - CF_TRY_PKG_CONFIG($cf_athena_pkg,[ - cf_x_athena_lib="$cf_pkgconfig_libs" - CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena) - AC_DEFINE_UNQUOTED($cf_x_athena_LIBS) - -AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[ -AC_TRY_LINK([ -#include -],[ -int check = XmuCompareISOLatin1("big", "small") -],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])]) - - if test "$cf_cv_xaw_compat" = no - then - # workaround for broken ".pc" files... - case "$cf_x_athena_lib" in #(vi - *-lXmu*) #(vi - ;; - *) - CF_VERBOSE(work around broken package) - CF_TRY_PKG_CONFIG(xmu,,[CF_ADD_LIB_AFTER(-lXt,-lXmu)]) - ;; - esac - fi - - break]) - done -fi - -if test -z "$cf_x_athena_lib" ; then - CF_X_EXT - CF_X_TOOLKIT - CF_X_ATHENA_CPPFLAGS($cf_x_athena) - CF_X_ATHENA_LIBS($cf_x_athena) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_X_ATHENA_CPPFLAGS version: 5 updated: 2010/05/26 17:35:30 -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], -[ -cf_x_athena_root=ifelse([$1],,Xaw,[$1]) -cf_x_athena_inc="" - -for cf_path in default \ - /usr/contrib/X11R6 \ - /usr/contrib/X11R5 \ - /usr/lib/X11R5 \ - /usr/local -do - if test -z "$cf_x_athena_inc" ; then - cf_save="$CPPFLAGS" - cf_test=X11/$cf_x_athena_root/SimpleMenu.h - if test $cf_path != default ; then - CPPFLAGS="$cf_save -I$cf_path/include" - AC_MSG_CHECKING(for $cf_test in $cf_path) - else - AC_MSG_CHECKING(for $cf_test) - fi - AC_TRY_COMPILE([ -#include -#include <$cf_test>],[], - [cf_result=yes], - [cf_result=no]) - AC_MSG_RESULT($cf_result) - if test "$cf_result" = yes ; then - cf_x_athena_inc=$cf_path - 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]) -elif test "$cf_x_athena_inc" != default ; then - CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc" -fi -]) -dnl --------------------------------------------------------------------------- -dnl CF_X_ATHENA_LIBS version: 10 updated: 2011/02/13 13:31:33 -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_LIBS], -[AC_REQUIRE([CF_X_TOOLKIT]) -cf_x_athena_root=ifelse([$1],,Xaw,[$1]) -cf_x_athena_lib="" - -for cf_path in default \ - /usr/contrib/X11R6 \ - /usr/contrib/X11R5 \ - /usr/lib/X11R5 \ - /usr/local -do - for cf_lib in \ - "-l$cf_x_athena_root -lXmu" \ - "-l$cf_x_athena_root -lXpm -lXmu" \ - "-l${cf_x_athena_root}_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_lib) - AC_MSG_CHECKING(for $cf_lib in $cf_path) - else - CF_ADD_LIBS($cf_lib) - AC_MSG_CHECKING(for $cf_test in $cf_lib) - fi - AC_TRY_LINK([ -#include -#include -],[ -$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_lib" - break - fi - LIBS="$cf_save" - fi - done -done - -if test -z "$cf_x_athena_lib" ; then - AC_MSG_ERROR( -[Unable to successfully link Athena library (-l$cf_x_athena_root) with test program]) -fi - -CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena) -AC_DEFINE_UNQUOTED($cf_x_athena_LIBS) -]) -dnl --------------------------------------------------------------------------- -dnl CF_X_EXT version: 3 updated: 2010/06/02 05:03:05 -dnl -------- -AC_DEFUN([CF_X_EXT],[ -CF_TRY_PKG_CONFIG(Xext,,[ - AC_CHECK_LIB(Xext,XextCreateExtension, - [CF_ADD_LIB(Xext)])]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_X_TOOLKIT version: 20 updated: 2010/11/19 05:43:04 -dnl ------------ -dnl Check for X Toolkit libraries -dnl -AC_DEFUN([CF_X_TOOLKIT], -[ -AC_REQUIRE([AC_PATH_XTRA]) -AC_REQUIRE([CF_CHECK_CACHE]) - -cf_have_X_LIBS=no - -CF_TRY_PKG_CONFIG(xt,[ - - case "x$LIBS" in #(vi - *-lX11*) #(vi - ;; - *) -# 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([ -#include -],[ - int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0); - int rc2 = XClearWindow((Display*) 0, (Window) 0); - int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0); - int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0); -],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])]) - if test "$cf_cv_xt_x11_compat" = no - then - CF_VERBOSE(work around broken X11 dependency) - # 2010/11/19 - good enough until a working Xt on Xcb is delivered. - CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)]) - fi - ;; - esac - -AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[ -AC_TRY_LINK([ -#include -],[int num = IceConnectionNumber(0) -],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])]) - - 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 - ;; - *) - CF_VERBOSE(work around broken ICE dependency) - CF_TRY_PKG_CONFIG(ice, - [CF_TRY_PKG_CONFIG(sm)], - [CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)]) - ;; - esac - ;; - esac - fi - - cf_have_X_LIBS=yes -],[ - - LDFLAGS="$X_LIBS $LDFLAGS" - CF_CHECK_CFLAGS($X_CFLAGS) - - AC_CHECK_FUNC(XOpenDisplay,,[ - AC_CHECK_LIB(X11,XOpenDisplay, - [CF_ADD_LIB(X11)],, - [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) - - AC_CHECK_FUNC(XtAppInitialize,,[ - AC_CHECK_LIB(Xt, XtAppInitialize, - [AC_DEFINE(HAVE_LIBXT) - cf_have_X_LIBS=Xt - LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],, - [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])]) -]) - -if test $cf_have_X_LIBS = no ; then - AC_MSG_WARN( -[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.]) -fi -])dnl -dnl --------------------------------------------------------------------------- -dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49 -dnl --------------- -dnl Define a reusable chunk which includes and when they -dnl are both available. -define([CF__CURSES_HEAD],[ -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif -]) diff --git a/test/background.c b/test/background.c deleted file mode 100644 index afbe5f53603..00000000000 --- a/test/background.c +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2003,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"), 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: background.c,v 1.3 2006/06/03 16:43:08 tom Exp $ - */ - -#include - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - short f, b; - - initscr(); - cbreak(); - noecho(); - - if (has_colors()) { - start_color(); - - pair_content(0, &f, &b); - printw("pair 0 contains (%d,%d)\n", f, b); - getch(); - - printw("Initializing pair 1 to red/black\n"); - init_pair(1, COLOR_RED, COLOR_BLACK); - bkgdset(' ' | COLOR_PAIR(1)); - printw("RED/BLACK\n"); - getch(); - - printw("Initializing pair 2 to white/blue\n"); - init_pair(2, COLOR_WHITE, COLOR_BLUE); - bkgdset(' ' | COLOR_PAIR(2)); - printw("WHITE/BLUE\n"); - getch(); - - printw("Resetting colors to pair 0\n"); - bkgdset(' ' | COLOR_PAIR(0)); - printw("Default Colors\n"); - getch(); - - printw("Resetting colors to pair 1\n"); - bkgdset(' ' | COLOR_PAIR(1)); - printw("RED/BLACK\n"); - getch(); - - printw("Setting screen to pair 0\n"); - bkgd(' ' | COLOR_PAIR(0)); - getch(); - - printw("Setting screen to pair 1\n"); - bkgd(' ' | COLOR_PAIR(1)); - getch(); - - printw("Setting screen to pair 2\n"); - bkgd(' ' | COLOR_PAIR(2)); - getch(); - - printw("Setting screen to pair 0\n"); - bkgd(' ' | COLOR_PAIR(0)); - getch(); - - } else { - printw("This demo requires a color terminal"); - getch(); - } - endwin(); - - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/blue.c b/test/blue.c deleted file mode 100644 index dfe6abf1b42..00000000000 --- a/test/blue.c +++ /dev/null @@ -1,465 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-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 * - * "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. * - ****************************************************************************/ -/***************************************************************************** - * * - * B l u e M o o n * - * ================= * - * V2.2 * - * A patience game by T.A.Lister * - * Integral screen support by Eric S. Raymond * - * * - *****************************************************************************/ - -/* - * 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.33 2009/10/24 21:03:35 tom Exp $ - */ - -#include - -#include - -#define NOCARD (-1) - -#define ACE 0 -#define KING 12 -#define SUIT_LENGTH 13 - -#define HEARTS 0 -#define SPADES 1 -#define DIAMONDS 2 -#define CLUBS 3 -#define NSUITS 4 - -#define GRID_WIDTH 14 /* 13+1 */ -#define GRID_LENGTH 56 /* 4*(13+1) */ -#define PACK_SIZE 52 - -#define BASEROW 1 -#define PROMPTROW 11 - -#define RED_ON_WHITE 1 -#define BLACK_ON_WHITE 2 -#define BLUE_ON_WHITE 3 - -static RETSIGTYPE die(int onsig) GCC_NORETURN; - -static int deck_size = PACK_SIZE; /* initial deck */ -static int deck[PACK_SIZE]; - -static int grid[GRID_LENGTH]; /* card layout grid */ -static int freeptr[4]; /* free card space pointers */ - -static int deal_number = 0; - -static chtype ranks[SUIT_LENGTH][2] = -{ - {' ', 'A'}, - {' ', '2'}, - {' ', '3'}, - {' ', '4'}, - {' ', '5'}, - {' ', '6'}, - {' ', '7'}, - {' ', '8'}, - {' ', '9'}, - {'1', '0'}, - {' ', 'J'}, - {' ', 'Q'}, - {' ', '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 - -#define PC_COLORS(value,pair) (OR_COLORS(value,pair) | A_ALTCHARSET) - -static chtype letters[4] = -{ - 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 */ -}; - -#if defined(__i386__) && defined(A_ALTCHARSET) && HAVE_TIGETSTR -static chtype glyphs[] = -{ - 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 */ -}; -#define USE_CP437 1 -#else -#define USE_CP437 0 -#endif /* __i386__ */ - -static chtype *suits = letters; /* this may change to glyphs below */ - -static RETSIGTYPE -die(int onsig) -{ - (void) signal(onsig, SIG_IGN); - endwin(); - ExitProgram(EXIT_SUCCESS); -} - -static void -init_vars(void) -{ - int i; - - deck_size = PACK_SIZE; - for (i = 0; i < PACK_SIZE; i++) - deck[i] = i; - for (i = 0; i < 4; i++) - freeptr[i] = i * GRID_WIDTH; -} - -static void -shuffle(int size) -{ - int i, j, numswaps, swapnum, temp; - - numswaps = size * 10; /* an arbitrary figure */ - - for (swapnum = 0; swapnum < numswaps; swapnum++) { - i = rand() % size; - j = rand() % size; - temp = deck[i]; - deck[i] = deck[j]; - deck[j] = temp; - } -} - -static void -deal_cards(void) -{ - int ptr, card = 0, value, csuit, crank, suit, aces[4]; - - memset(aces, 0, sizeof(aces)); - for (suit = HEARTS; suit <= CLUBS; suit++) { - ptr = freeptr[suit]; - grid[ptr++] = NOCARD; /* 1st card space is blank */ - while ((ptr % GRID_WIDTH) != 0) { - value = deck[card++]; - crank = value % SUIT_LENGTH; - csuit = value / SUIT_LENGTH; - if (crank == ACE) - aces[csuit] = ptr; - grid[ptr++] = value; - } - } - - if (deal_number == 1) /* shift the aces down to the 1st column */ - for (suit = HEARTS; suit <= CLUBS; suit++) { - grid[suit * GRID_WIDTH] = suit * SUIT_LENGTH; - grid[aces[suit]] = NOCARD; - freeptr[suit] = aces[suit]; - } -} - -static void -printcard(int value) -{ - (void) addch(' '); - if (value == NOCARD) - (void) addstr(" "); - else { - addch(ranks[value % SUIT_LENGTH][0] | COLOR_PAIR(BLUE_ON_WHITE)); - addch(ranks[value % SUIT_LENGTH][1] | COLOR_PAIR(BLUE_ON_WHITE)); - addch(suits[value / SUIT_LENGTH]); - } - (void) addch(' '); -} - -static void -display_cards(int deal) -{ - int row, card; - - clear(); - (void) printw( - "Blue Moon 2.1 - by Tim Lister & Eric Raymond - Deal %d.\n", - deal); - for (row = HEARTS; row <= CLUBS; row++) { - move(BASEROW + row + row + 2, 1); - for (card = 0; card < GRID_WIDTH; card++) - printcard(grid[row * GRID_WIDTH + card]); - } - - move(PROMPTROW + 2, 0); - refresh(); -#define P(x) (void)printw("%s\n", x) - P(" This 52-card solitaire starts with the entire deck shuffled and dealt"); - P("out in four rows. The aces are then moved to the left end of the layout,"); - P("making 4 initial free spaces. You may move to a space only the card that"); - P("matches the left neighbor in suit, and is one greater in rank. Kings are"); - P("high, so no cards may be placed to their right (they create dead spaces)."); - P(" When no moves can be made, cards still out of sequence are reshuffled"); - P("and dealt face up after the ends of the partial sequences, leaving a card"); - P("space after each sequence, so that each row looks like a partial sequence"); - P("followed by a space, followed by enough cards to make a row of 14. "); - P(" A moment's reflection will show that this game cannot take more than 13"); - P("deals. A good score is 1-3 deals, 4-7 is average, 8 or more is poor. "); -#undef P - refresh(); -} - -static int -find(int card) -{ - int i; - - if ((card < 0) || (card >= PACK_SIZE)) - return (NOCARD); - for (i = 0; i < GRID_LENGTH; i++) - if (grid[i] == card) - return i; - return (NOCARD); -} - -static void -movecard(int src, int dst) -{ - grid[dst] = grid[src]; - grid[src] = NOCARD; - - move(BASEROW + (dst / GRID_WIDTH) * 2 + 2, (dst % GRID_WIDTH) * 5 + 1); - printcard(grid[dst]); - - move(BASEROW + (src / GRID_WIDTH) * 2 + 2, (src % GRID_WIDTH) * 5 + 1); - printcard(grid[src]); - - refresh(); -} - -static void -play_game(void) -{ - int dead = 0, i, j; - char c; - int selection[4], card; - - while (dead < 4) { - dead = 0; - for (i = 0; i < 4; i++) { - card = grid[freeptr[i] - 1]; - - if (((card % SUIT_LENGTH) == KING) - || - (card == NOCARD)) - selection[i] = NOCARD; - else - selection[i] = find(card + 1); - - if (selection[i] == NOCARD) - dead++; - }; - - if (dead < 4) { - char live[NSUITS + 1], *lp = live; - - for (i = 0; i < 4; i++) { - if (selection[i] != NOCARD) { - move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3, - (selection[i] % GRID_WIDTH) * 5); - (void) printw(" %c ", (*lp++ = (char) ('a' + i))); - } - }; - *lp = '\0'; - - if (strlen(live) == 1) { - move(PROMPTROW, 0); - (void) printw( - "Making forced moves... "); - refresh(); - (void) sleep(1); - c = live[0]; - } else { - char buf[BUFSIZ]; - - (void) sprintf(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(' '); - } while - (((c = (char) getch()) < 'a' || c > 'd') - && (c != 'r') - && (c != 'q')); - } - - for (j = 0; j < 4; j++) - if (selection[j] != NOCARD) { - move(BASEROW + (selection[j] / GRID_WIDTH) * 2 + 3, - (selection[j] % GRID_WIDTH) * 5); - (void) printw(" "); - } - - if (c == 'r') - display_cards(deal_number); - else if (c == 'q') - die(SIGINT); - else { - i = c - 'a'; - if (selection[i] == NOCARD) - beep(); - else { - movecard(selection[i], freeptr[i]); - freeptr[i] = selection[i]; - } - } - } - } - - move(PROMPTROW, 0); - (void) standout(); - (void) printw("Finished deal %d - type any character to continue...", deal_number); - (void) standend(); - (void) getch(); -} - -static int -collect_discards(void) -{ - int row, col, cardno = 0, finish, gridno; - - for (row = HEARTS; row <= CLUBS; row++) { - finish = 0; - for (col = 1; col < GRID_WIDTH; col++) { - gridno = row * GRID_WIDTH + col; - - if ((grid[gridno] != (grid[gridno - 1] + 1)) && (finish == 0)) { - finish = 1; - freeptr[row] = gridno; - }; - - if ((finish != 0) && (grid[gridno] != NOCARD)) - deck[cardno++] = grid[gridno]; - } - } - return cardno; -} - -static void -game_finished(int deal) -{ - clear(); - (void) printw("You finished the game in %d deals. This is ", deal); - (void) standout(); - if (deal < 2) - (void) addstr("excellent"); - else if (deal < 4) - (void) addstr("good"); - else if (deal < 8) - (void) addstr("average"); - else - (void) addstr("poor"); - (void) standend(); - (void) addstr(". "); - refresh(); -} - -int -main(int argc, char *argv[]) -{ - CATCHALL(die); - - setlocale(LC_ALL, ""); - - initscr(); - - /* - * 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) - srand((unsigned) atoi(argv[1])); - else - srand((unsigned) time((time_t *) 0)); - - init_vars(); - - do { - deal_number++; - shuffle(deck_size); - deal_cards(); - display_cards(deal_number); - play_game(); - } - while - ((deck_size = collect_discards()) != 0); - - game_finished(deal_number); - - die(SIGINT); - /*NOTREACHED */ -} - -/* blue.c ends here */ diff --git a/test/bs.6 b/test/bs.6 deleted file mode 100644 index 657f538d716..00000000000 --- a/test/bs.6 +++ /dev/null @@ -1,71 +0,0 @@ -.\"*************************************************************************** -.\" Copyright (c) 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 * -.\" "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: bs.6,v 1.2 2006/04/22 22:42:44 tom Exp $ -.TH BATTLESHIPS 6 "Aug 23, 1989" -.SH NAME -bs \- battleships game -.SH SYNOPSIS -battle [ -b | -s ] [ -c ] -.SH DESCRIPTION -This program allows you to play the familiar Battleships game against the -computer on a 10x10 board. The interface is visual and largely -self-explanatory; you place your ships and pick your shots by moving the -cursor around the `sea' with the rogue/hack motion keys hjklyubn. -.PP -Note that when selecting a ship to place, you must type the capital letter -(these are, after all, capital ships). During ship placement, the `r' command -may be used to ignore the current position and randomly place your currently -selected ship. The `R' command will place all remaining ships randomly. The ^L -command (form feed, ASCII 12) will force a screen redraw). -.PP -The command-line arguments control game modes. - -.nf - -b selects a `blitz' variant - -s selects a `salvo' variant - -c permits ships to be placed adjacently -.fi - -The `blitz' variant allows a side to shoot for as long as it continues to -score hits. -.PP -The `salvo' game allows a player one shot per turn for each of his/her ships -still afloat. This puts a premium scoring hits early and knocking out some -ships and also makes much harder the situation where you face a superior force -with only your PT-boat. -.PP -Normally, ships must be separated by at least one square of open water. The --c option disables this check and allows them to close-pack. -.PP -The algorithm the computer uses once it has found a ship to sink is provably -optimal. The dispersion criterion for the random-fire algorithm may not be. -.SH AUTHORS -Originally written by one Bruce Holloway in 1986. Salvo mode added by Chuck A. -DeGaul (cbosgd!cad). Visual user interface, `closepack' option, code rewrite -and manual page by Eric S. Raymond August 1989. diff --git a/test/bs.c b/test/bs.c deleted file mode 100644 index ee7f2271d6b..00000000000 --- a/test/bs.c +++ /dev/null @@ -1,1257 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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. * - ****************************************************************************/ -/* - * bs.c - original author: Bruce Holloway - * salvo option by: Chuck A DeGaul - * with improved user interface, autoconfiguration and code cleanup - * by Eric S. Raymond - * v1.2 with color support and minor portability fixes, November 1990 - * v2.0 featuring strict ANSI/POSIX conformance, November 1993. - * v2.1 with ncurses mouse support, September 1995 - * - * $Id: bs.c,v 1.52 2010/11/13 20:07:52 tom Exp $ - */ - -#include - -#include - -#ifndef SIGIOT -#define SIGIOT SIGABRT -#endif - -static int getcoord(int); - -/* - * Constants for tuning the random-fire algorithm. It prefers moves that - * diagonal-stripe the board with a stripe separation of srchstep. If - * no such preferred moves are found, srchstep is decremented. - */ -#define BEGINSTEP 3 /* initial value of srchstep */ - -/* miscellaneous constants */ -#define SHIPTYPES 5 -#define OTHER (1-turn) -#define PLAYER 0 -#define COMPUTER 1 -#define MARK_HIT 'H' -#define MARK_MISS 'o' -#define CTRLC '\003' /* used as terminate command */ -#define FF '\014' /* used as redraw command */ - -/* coordinate handling */ -#define BWIDTH 10 -#define BDEPTH 10 - -/* display symbols */ -#define SHOWHIT '*' -#define SHOWSPLASH ' ' -#define IS_SHIP(c) (isupper(UChar(c)) ? TRUE : FALSE) - -/* how to position us on player board */ -#define PYBASE 3 -#define PXBASE 3 -#define PY(y) (PYBASE + (y)) -#define PX(x) (PXBASE + (x)*3) -#define pgoto(y, x) (void)move(PY(y), PX(x)) - -/* how to position us on cpu board */ -#define CYBASE 3 -#define CXBASE 48 -#define CY(y) (CYBASE + (y)) -#define CX(x) (CXBASE + (x)*3) -#define CYINV(y) ((y) - CYBASE) -#define CXINV(x) (((x) - CXBASE) / 3) -#define cgoto(y, x) (void)move(CY(y), CX(x)) - -#define ONBOARD(x, y) (x >= 0 && x < BWIDTH && y >= 0 && y < BDEPTH) - -/* other board locations */ -#define COLWIDTH 80 -#define PROMPTLINE 21 /* prompt line */ -#define SYBASE CYBASE + BDEPTH + 3 /* move key diagram */ -#define SXBASE 63 -#define MYBASE SYBASE - 1 /* diagram caption */ -#define MXBASE 64 -#define HYBASE SYBASE - 1 /* help area */ -#define HXBASE 0 - -/* this will need to be changed if BWIDTH changes */ -static char numbers[] = " 0 1 2 3 4 5 6 7 8 9"; - -static char carrier[] = "Aircraft Carrier"; -static char battle[] = "Battleship"; -static char sub[] = "Submarine"; -static char destroy[] = "Destroyer"; -static char ptboat[] = "PT Boat"; - -static char name[40]; -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] = -{1, 1, 0, -1, -1, -1, 0, 1}; -static int yincr[8] = -{0, 1, 1, 1, 0, -1, -1, -1}; - -/* current ship position and direction */ -static int curx = (BWIDTH / 2); -static int cury = (BDEPTH / 2); - -typedef struct { - char *name; /* name of the ship type */ - int hits; /* how many times has this ship been hit? */ - char symbol; /* symbol for game purposes */ - int length; /* length of ship */ - int x, y; /* coordinates of ship start point */ - int dir; /* direction of `bow' */ - bool placed; /* has it been placed on the board? */ -} ship_t; - -static bool checkplace(int b, ship_t * ss, int vis); - -#define SHIPIT(name, symbol, length) { name, 0, symbol, length, 0,0, 0, FALSE } - -static ship_t plyship[SHIPTYPES] = -{ - SHIPIT(carrier, 'A', 5), - SHIPIT(battle, 'B', 4), - SHIPIT(destroy, 'D', 3), - SHIPIT(sub, 'S', 3), - SHIPIT(ptboat, 'P', 2), -}; - -static ship_t cpuship[SHIPTYPES] = -{ - SHIPIT(carrier, 'A', 5), - SHIPIT(battle, 'B', 4), - SHIPIT(destroy, 'D', 3), - SHIPIT(sub, 'S', 3), - SHIPIT(ptboat, 'P', 2), -}; - -/* "Hits" board, and main board. */ -static char hits[2][BWIDTH][BDEPTH]; -static char board[2][BWIDTH][BDEPTH]; - -static int turn; /* 0=player, 1=computer */ -static int plywon = 0, cpuwon = 0; /* How many games has each won? */ - -static int salvo, blitz, closepack; - -#define PR (void)addstr - -static RETSIGTYPE uninitgame(int sig) GCC_NORETURN; - -static RETSIGTYPE -uninitgame(int sig GCC_UNUSED) -/* end the game, either normally or due to signal */ -{ - clear(); - (void) refresh(); - (void) reset_shell_mode(); - (void) echo(); - (void) endwin(); - ExitProgram(sig ? EXIT_FAILURE : EXIT_SUCCESS); -} - -static void -announceopts(void) -/* announce which game options are enabled */ -{ - if (salvo || blitz || closepack) { - (void) printw("Playing optional game ("); - if (salvo) - (void) printw("salvo, "); - else - (void) printw("nosalvo, "); - if (blitz) - (void) printw("blitz "); - else - (void) printw("noblitz, "); - if (closepack) - (void) printw("closepack)"); - else - (void) printw("noclosepack)"); - } else - (void) printw( - "Playing standard game (noblitz, nosalvo, noclosepack)"); -} - -static void -intro(void) -{ - char *tmpname; - - srand((unsigned) (time(0L) + getpid())); /* Kick the random number generator */ - - CATCHALL(uninitgame); - - if ((tmpname = getlogin()) != 0) { - (void) strcpy(name, tmpname); - name[0] = (char) toupper(UChar(name[0])); - } else - (void) strcpy(name, dftname); - - (void) initscr(); - keypad(stdscr, TRUE); - (void) def_prog_mode(); - (void) nonl(); - (void) cbreak(); - (void) noecho(); - -#ifdef PENGUIN - (void) clear(); - MvAddStr(4, 29, "Welcome to Battleship!"); - (void) move(8, 0); - PR(" \\\n"); - PR(" \\ \\ \\\n"); - PR(" \\ \\ \\ \\ \\_____________\n"); - PR(" \\ \\ \\_____________ \\ \\/ |\n"); - PR(" \\ \\/ \\ \\/ |\n"); - PR(" \\/ \\_____/ |__\n"); - PR(" ________________/ |\n"); - PR(" \\ S.S. Penguin |\n"); - PR(" \\ /\n"); - PR(" \\___________________________________________________/\n"); - - MvAddStr(22, 27, "Hit any key to continue..."); - (void) refresh(); - (void) getch(); -#endif /* PENGUIN */ - -#ifdef A_COLOR - start_color(); - - init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK); - init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK); - init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK); - init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK); - init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK); - init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK); - init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK); - init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); -#endif /* A_COLOR */ - -#ifdef NCURSES_MOUSE_VERSION - (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); -#endif /* NCURSES_MOUSE_VERSION */ -} - -/* VARARGS1 */ -static void -prompt(int n, NCURSES_CONST char *f, const char *s) -/* print a message at the prompt line */ -{ - (void) move(PROMPTLINE + n, 0); - (void) clrtoeol(); - (void) printw(f, s); - (void) refresh(); -} - -static void -error(NCURSES_CONST char *s) -{ - (void) move(PROMPTLINE + 2, 0); - (void) clrtoeol(); - if (s) { - (void) addstr(s); - (void) beep(); - } -} - -static void -placeship(int b, ship_t * ss, int vis) -{ - int l; - - for (l = 0; l < ss->length; ++l) { - int newx = ss->x + l * xincr[ss->dir]; - int newy = ss->y + l * yincr[ss->dir]; - - board[b][newx][newy] = ss->symbol; - if (vis) { - pgoto(newy, newx); - (void) addch((chtype) ss->symbol); - } - } - ss->hits = 0; -} - -static int -rnd(int n) -{ - return (((rand() & 0x7FFF) % n)); -} - -static void -randomplace(int b, ship_t * ss) -/* generate a valid random ship placement into px,py */ -{ - - 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)); - } while - (!checkplace(b, ss, FALSE)); -} - -static void -initgame(void) -{ - int i, j, unplaced; - ship_t *ss; - - (void) clear(); - MvAddStr(0, 35, "BATTLESHIPS"); - (void) move(PROMPTLINE + 2, 0); - announceopts(); - - memset(board, 0, sizeof(char) * BWIDTH * BDEPTH * 2); - memset(hits, 0, sizeof(char) * BWIDTH * BDEPTH * 2); - for (i = 0; i < SHIPTYPES; i++) { - ss = cpuship + i; - - ss->x = - ss->y = - ss->dir = - ss->hits = 0; - ss->placed = FALSE; - - ss = plyship + i; - - ss->x = - ss->y = - ss->dir = - ss->hits = 0; - ss->placed = FALSE; - } - - /* draw empty boards */ - MvAddStr(PYBASE - 2, PXBASE + 5, "Main Board"); - MvAddStr(PYBASE - 1, PXBASE - 3, numbers); - for (i = 0; i < BDEPTH; ++i) { - MvAddCh(PYBASE + i, PXBASE - 3, (chtype) (i + 'A')); -#ifdef A_COLOR - if (has_colors()) - attron(COLOR_PAIR(COLOR_BLUE)); -#endif /* A_COLOR */ - (void) 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')); - } - MvAddStr(PYBASE + BDEPTH, PXBASE - 3, numbers); - MvAddStr(CYBASE - 2, CXBASE + 7, "Hit/Miss Board"); - MvAddStr(CYBASE - 1, CXBASE - 3, numbers); - for (i = 0; i < BDEPTH; ++i) { - MvAddCh(CYBASE + i, CXBASE - 3, (chtype) (i + 'A')); -#ifdef A_COLOR - if (has_colors()) - attron(COLOR_PAIR(COLOR_BLUE)); -#endif /* A_COLOR */ - (void) 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')); - } - - MvAddStr(CYBASE + BDEPTH, CXBASE - 3, numbers); - - MvPrintw(HYBASE, HXBASE, - "To position your ships: move the cursor to a spot, then"); - MvPrintw(HYBASE + 1, HXBASE, - "type the first letter of a ship type to select it, then"); - MvPrintw(HYBASE + 2, HXBASE, - "type a direction ([hjkl] or [4862]), indicating how the"); - MvPrintw(HYBASE + 3, HXBASE, - "ship should be pointed. You may also type a ship letter"); - MvPrintw(HYBASE + 4, HXBASE, - "followed by `r' to position it randomly, or type `R' to"); - MvPrintw(HYBASE + 5, HXBASE, - "place all remaining ships randomly."); - - MvAddStr(MYBASE, MXBASE, "Aiming keys:"); - MvAddStr(SYBASE, SXBASE, "y k u 7 8 9"); - MvAddStr(SYBASE + 1, SXBASE, " \\|/ \\|/ "); - MvAddStr(SYBASE + 2, SXBASE, "h-+-l 4-+-6"); - MvAddStr(SYBASE + 3, SXBASE, " /|\\ /|\\ "); - MvAddStr(SYBASE + 4, SXBASE, "b j n 1 2 3"); - - /* have the computer place ships */ - for (ss = cpuship; ss < cpuship + SHIPTYPES; ss++) { - randomplace(COMPUTER, ss); - placeship(COMPUTER, ss, FALSE); - } - - ss = (ship_t *) NULL; - do { - char c, docked[SHIPTYPES + 2], *cp = docked; - - /* figure which ships still wait to be placed */ - *cp++ = 'R'; - for (i = 0; i < SHIPTYPES; i++) - if (!plyship[i].placed) - *cp++ = plyship[i].symbol; - *cp = '\0'; - - /* get a command letter */ - prompt(1, "Type one of [%s] to pick a ship.", docked + 1); - do { - c = (char) getcoord(PLAYER); - } while - (!strchr(docked, c)); - - if (c == 'R') - (void) ungetch('R'); - else { - /* map that into the corresponding symbol */ - for (ss = plyship; ss < plyship + SHIPTYPES; ss++) - if (ss->symbol == c) - break; - - prompt(1, "Type one of [hjklrR] to place your %s.", ss->name); - pgoto(cury, curx); - } - - do { - c = (char) getch(); - } while - (!(strchr("hjklrR", c) || c == FF)); - - if (c == FF) { - (void) clearok(stdscr, TRUE); - (void) refresh(); - } else if (c == 'r') { - assert(ss != 0); - prompt(1, "Random-placing your %s", ss->name); - randomplace(PLAYER, ss); - placeship(PLAYER, ss, TRUE); - error((char *) NULL); - ss->placed = TRUE; - } else if (c == 'R') { - prompt(1, "Placing the rest of your fleet at random...", ""); - for (ss = plyship; ss < plyship + SHIPTYPES; ss++) - if (!ss->placed) { - randomplace(PLAYER, ss); - placeship(PLAYER, ss, TRUE); - ss->placed = TRUE; - } - error((char *) NULL); - } else if (strchr("hjkl8462", c)) { - assert(ss != 0); - ss->x = curx; - ss->y = cury; - - switch (c) { - case 'k': - case '8': - ss->dir = N; - break; - case 'j': - case '2': - ss->dir = S; - break; - case 'h': - case '4': - ss->dir = W; - break; - case 'l': - case '6': - ss->dir = E; - break; - } - - if (checkplace(PLAYER, ss, TRUE)) { - placeship(PLAYER, ss, TRUE); - error((char *) NULL); - ss->placed = TRUE; - } - } - - for (unplaced = i = 0; i < SHIPTYPES; i++) - unplaced += !plyship[i].placed; - } while - (unplaced); - - turn = rnd(2); - - MvPrintw(HYBASE, HXBASE, - "To fire, move the cursor to your chosen aiming point "); - MvPrintw(HYBASE + 1, HXBASE, - "and strike any key other than a motion key. "); - MvPrintw(HYBASE + 2, HXBASE, - " "); - MvPrintw(HYBASE + 3, HXBASE, - " "); - MvPrintw(HYBASE + 4, HXBASE, - " "); - MvPrintw(HYBASE + 5, HXBASE, - " "); - - (void) prompt(0, "Press any key to start...", ""); - (void) getch(); -} - -static int -getcoord(int atcpu) -{ - int ny, nx, c; - - if (atcpu) - cgoto(cury, curx); - else - pgoto(cury, curx); - (void) refresh(); - for (;;) { - if (atcpu) { - MvPrintw(CYBASE + BDEPTH + 1, CXBASE + 11, "(%d, %c)", - curx, 'A' + cury); - cgoto(cury, curx); - } else { - MvPrintw(PYBASE + BDEPTH + 1, PXBASE + 11, "(%d, %c)", - curx, 'A' + cury); - pgoto(cury, curx); - } - - switch (c = getch()) { - case 'k': - case '8': - case KEY_UP: - ny = cury + BDEPTH - 1; - nx = curx; - break; - case 'j': - case '2': - case KEY_DOWN: - ny = cury + 1; - nx = curx; - break; - case 'h': - case '4': - case KEY_LEFT: - ny = cury; - nx = curx + BWIDTH - 1; - break; - case 'l': - case '6': - case KEY_RIGHT: - ny = cury; - nx = curx + 1; - break; - case 'y': - case '7': - case KEY_A1: - ny = cury + BDEPTH - 1; - nx = curx + BWIDTH - 1; - break; - case 'b': - case '1': - case KEY_C1: - ny = cury + 1; - nx = curx + BWIDTH - 1; - break; - case 'u': - case '9': - case KEY_A3: - ny = cury + BDEPTH - 1; - nx = curx + 1; - break; - case 'n': - case '3': - case KEY_C3: - ny = cury + 1; - nx = curx + 1; - break; - case FF: - nx = curx; - ny = cury; - (void) clearok(stdscr, TRUE); - (void) refresh(); - break; -#ifdef NCURSES_MOUSE_VERSION - case KEY_MOUSE: - { - MEVENT myevent; - - getmouse(&myevent); - if (atcpu - && myevent.y >= CY(0) && myevent.y <= CY(BDEPTH) - && myevent.x >= CX(0) && myevent.x <= CX(BDEPTH)) { - curx = CXINV(myevent.x); - cury = CYINV(myevent.y); - return (' '); - } else { - beep(); - continue; - } - } - /* no fall through */ -#endif /* NCURSES_MOUSE_VERSION */ - - default: - if (atcpu) - MvAddStr(CYBASE + BDEPTH + 1, CXBASE + 11, " "); - else - MvAddStr(PYBASE + BDEPTH + 1, PXBASE + 11, " "); - return (c); - } - - curx = nx % BWIDTH; - cury = ny % BDEPTH; - } -} - -static bool -collidecheck(int b, int y, int x) -/* is this location on the selected zboard adjacent to a ship? */ -{ - bool collide; - - /* anything on the square */ - if ((collide = IS_SHIP(board[b][x][y])) != FALSE) - return (collide); - - /* anything on the neighbors */ - if (!closepack) { - int i; - - for (i = 0; i < 8; i++) { - int xend, yend; - - yend = y + yincr[i]; - xend = x + xincr[i]; - if (ONBOARD(xend, yend) - && IS_SHIP(board[b][xend][yend])) { - collide = TRUE; - break; - } - } - } - return (collide); -} - -static bool -checkplace(int b, ship_t * ss, int vis) -{ - int l, xend, yend; - - /* first, check for board edges */ - xend = ss->x + (ss->length - 1) * xincr[ss->dir]; - yend = ss->y + (ss->length - 1) * yincr[ss->dir]; - if (!ONBOARD(xend, yend)) { - if (vis) - switch (rnd(3)) { - case 0: - error("Ship is hanging from the edge of the world"); - break; - case 1: - error("Try fitting it on the board"); - break; - case 2: - error("Figure I won't find it if you put it there?"); - break; - } - return (FALSE); - } - - for (l = 0; l < ss->length; ++l) { - if (collidecheck(b, ss->y + l * yincr[ss->dir], ss->x + l * xincr[ss->dir])) { - if (vis) - switch (rnd(3)) { - case 0: - error("There's already a ship there"); - break; - case 1: - error("Collision alert! Aaaaaagh!"); - break; - case 2: - error("Er, Admiral, what about the other ship?"); - break; - } - return (FALSE); - } - } - return (TRUE); -} - -static int -awinna(void) -{ - int i, j; - ship_t *ss; - - for (i = 0; i < 2; ++i) { - ss = (i) ? cpuship : plyship; - for (j = 0; j < SHIPTYPES; ++j, ++ss) - if (ss->length > ss->hits) - break; - if (j == SHIPTYPES) - return (OTHER); - } - return (-1); -} - -static ship_t * -hitship(int x, int y) -/* register a hit on the targeted ship */ -{ - ship_t *sb, *ss; - char sym; - int oldx, oldy; - - getyx(stdscr, oldy, oldx); - sb = (turn) ? plyship : cpuship; - if ((sym = board[OTHER][x][y]) == 0) - return ((ship_t *) NULL); - for (ss = sb; ss < sb + SHIPTYPES; ++ss) - if (ss->symbol == sym) { - if (++ss->hits < ss->length) /* still afloat? */ - return ((ship_t *) NULL); - else { /* sunk! */ - int i, 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]; - - for (i = -1; i <= ss->length; ++i) { - int x1, y1; - - x1 = bx + i * xincr[ss->dir]; - y1 = by + i * yincr[ss->dir]; - if (ONBOARD(x1, y1)) { - hits[turn][x1][y1] = MARK_MISS; - if (turn % 2 == PLAYER) { - cgoto(y1, x1); -#ifdef A_COLOR - if (has_colors()) - attron(COLOR_PAIR(COLOR_GREEN)); -#endif /* A_COLOR */ - (void) addch(MARK_MISS); -#ifdef A_COLOR - (void) attrset(0); -#endif /* A_COLOR */ - } else { - pgoto(y1, x1); - (void) addch(SHOWSPLASH); - } - } - } - } - - for (i = 0; i < ss->length; ++i) { - int x1 = ss->x + i * xincr[ss->dir]; - int y1 = ss->y + i * yincr[ss->dir]; - - hits[turn][x1][y1] = ss->symbol; - if (turn % 2 == PLAYER) { - cgoto(y1, x1); - (void) addch((chtype) (ss->symbol)); - } else { - pgoto(y1, x1); -#ifdef A_COLOR - if (has_colors()) - attron(COLOR_PAIR(COLOR_RED)); -#endif /* A_COLOR */ - (void) addch(SHOWHIT); -#ifdef A_COLOR - (void) attrset(0); -#endif /* A_COLOR */ - } - } - - (void) move(oldy, oldx); - return (ss); - } - } - (void) move(oldy, oldx); - return ((ship_t *) NULL); -} - -static bool -plyturn(void) -{ - ship_t *ss; - bool hit; - NCURSES_CONST char *m = NULL; - - prompt(1, "Where do you want to shoot? ", ""); - for (;;) { - (void) getcoord(COMPUTER); - if (hits[PLAYER][curx][cury]) { - prompt(1, "You shelled this spot already! Try again.", ""); - beep(); - } else - break; - } - hit = IS_SHIP(board[COMPUTER][curx][cury]); - hits[PLAYER][curx][cury] = (char) (hit ? MARK_HIT : MARK_MISS); - cgoto(cury, curx); -#ifdef A_COLOR - if (has_colors()) { - if (hit) - attron(COLOR_PAIR(COLOR_RED)); - else - attron(COLOR_PAIR(COLOR_GREEN)); - } -#endif /* A_COLOR */ - (void) addch((chtype) hits[PLAYER][curx][cury]); -#ifdef A_COLOR - (void) attrset(0); -#endif /* A_COLOR */ - - prompt(1, "You %s.", hit ? "scored a hit" : "missed"); - if (hit && (ss = hitship(curx, cury))) { - switch (rnd(5)) { - case 0: - m = " You sank my %s!"; - break; - case 1: - m = " I have this sinking feeling about my %s...."; - break; - case 2: - m = " My %s has gone to Davy Jones's locker!"; - break; - case 3: - m = " Glub, glub -- my %s is headed for the bottom!"; - break; - case 4: - m = " You'll pick up survivors from my %s, I hope...!"; - break; - } - (void) printw(m, ss->name); - (void) beep(); - } - return (hit); -} - -static int -sgetc(const char *s) -{ - const char *s1; - int ch; - - (void) refresh(); - for (;;) { - ch = getch(); - if (islower(ch)) - ch = toupper(ch); - if (ch == CTRLC) - uninitgame(0); - for (s1 = s; *s1 && ch != *s1; ++s1) - continue; - if (*s1) { - (void) addch((chtype) ch); - (void) refresh(); - return (ch); - } - } -} - -static void -randomfire(int *px, int *py) -/* random-fire routine -- implements simple diagonal-striping strategy */ -{ - static int turncount = 0; - static int srchstep = BEGINSTEP; - static int huntoffs; /* Offset on search strategy */ - int ypossible[BWIDTH * BDEPTH], xpossible[BWIDTH * BDEPTH], nposs; - int ypreferred[BWIDTH * BDEPTH], xpreferred[BWIDTH * BDEPTH], npref; - int x, y, i; - - if (turncount++ == 0) - huntoffs = rnd(srchstep); - - /* first, list all possible moves */ - nposs = npref = 0; - for (x = 0; x < BWIDTH; x++) - for (y = 0; y < BDEPTH; y++) - if (!hits[COMPUTER][x][y]) { - xpossible[nposs] = x; - ypossible[nposs] = y; - nposs++; - if (((x + huntoffs) % srchstep) != (y % srchstep)) { - xpreferred[npref] = x; - ypreferred[npref] = y; - npref++; - } - } - - if (npref) { - i = rnd(npref); - - *px = xpreferred[i]; - *py = ypreferred[i]; - } else if (nposs) { - i = rnd(nposs); - - *px = xpossible[i]; - *py = ypossible[i]; - - if (srchstep > 1) - --srchstep; - } else { - error("No moves possible?? Help!"); - ExitProgram(EXIT_FAILURE); - /*NOTREACHED */ - } -} - -#define S_MISS 0 -#define S_HIT 1 -#define S_SUNK -1 - -static int -cpufire(int x, int y) -/* fire away at given location */ -{ - bool hit, sunk; - ship_t *ss = NULL; - - hit = board[PLAYER][x][y] ? MARK_HIT : MARK_MISS; - hits[COMPUTER][x][y] = (char) hit; - MvPrintw(PROMPTLINE, 0, - "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" : - "miss"); - if ((sunk = (hit && (ss = hitship(x, y)))) != 0) - (void) printw(" I've sunk your %s", ss->name); - (void) clrtoeol(); - - pgoto(y, x); -#ifdef A_COLOR - if (has_colors()) { - if (hit) - attron(COLOR_PAIR(COLOR_RED)); - else - attron(COLOR_PAIR(COLOR_GREEN)); - } -#endif /* A_COLOR */ - (void) addch((chtype) (hit ? SHOWHIT : SHOWSPLASH)); -#ifdef A_COLOR - (void) attrset(0); -#endif /* A_COLOR */ - - return hit ? (sunk ? S_SUNK : S_HIT) : S_MISS; -} - -/* - * This code implements a fairly irregular FSM, so please forgive the rampant - * unstructuredness below. The five labels are states which need to be held - * between computer turns. - * - * The FSM is not externally reset to RANDOM_FIRE if the player wins. Instead, - * the other states check for "impossible" conditions which signify a new - * game, then if found transition to RANDOM_FIRE. - */ -static bool -cputurn(void) -{ -#define POSSIBLE(x, y) (ONBOARD(x, y) && !hits[COMPUTER][x][y]) -#define RANDOM_FIRE 0 -#define RANDOM_HIT 1 -#define HUNT_DIRECT 2 -#define FIRST_PASS 3 -#define REVERSE_JUMP 4 -#define SECOND_PASS 5 - static int next = RANDOM_FIRE; - static bool used[4]; - static ship_t ts; - int navail, x, y, d, n; - int hit = S_MISS; - - switch (next) { - case RANDOM_FIRE: /* last shot was random and missed */ - refire: - randomfire(&x, &y); - if (!(hit = cpufire(x, y))) - next = RANDOM_FIRE; - else { - ts.x = x; - ts.y = y; - ts.hits = 1; - next = (hit == S_SUNK) ? RANDOM_FIRE : RANDOM_HIT; - } - break; - - case RANDOM_HIT: /* last shot was random and hit */ - used[E / 2] = used[S / 2] = used[W / 2] = used[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++) { - x = ts.x + xincr[d * 2]; - y = ts.y + yincr[d * 2]; - if (!used[d] && POSSIBLE(x, y)) - navail++; - else - used[d] = TRUE; - } - if (navail == 0) /* no valid places for shots adjacent... */ - goto refire; /* ...so we must random-fire */ - else { - n = rnd(navail) + 1; - for (d = 0; used[d]; d++) ; - /* used[d] is first that == 0 */ - for (; n > 1; n--) - while (used[++d]) ; - /* used[d] is next that == 0 */ - - assert(d < 4); - assert(used[d] == FALSE); - - used[d] = TRUE; - x = ts.x + xincr[d * 2]; - y = ts.y + yincr[d * 2]; - - assert(POSSIBLE(x, y)); - - if (!(hit = cpufire(x, y))) - next = HUNT_DIRECT; - else { - ts.x = x; - ts.y = y; - ts.dir = d * 2; - ts.hits++; - next = (hit == S_SUNK) ? RANDOM_FIRE : FIRST_PASS; - } - } - break; - - case FIRST_PASS: /* we have a start and a direction now */ - x = ts.x + xincr[ts.dir]; - y = ts.y + yincr[ts.dir]; - if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { - ts.x = x; - ts.y = y; - ts.hits++; - next = (hit == S_SUNK) ? RANDOM_FIRE : FIRST_PASS; - } else - next = REVERSE_JUMP; - break; - - case REVERSE_JUMP: /* nail down the ship's other end */ - d = (ts.dir + 4) % 8; - x = ts.x + ts.hits * xincr[d]; - y = ts.y + ts.hits * yincr[d]; - if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { - ts.x = x; - ts.y = y; - ts.dir = d; - ts.hits++; - next = (hit == S_SUNK) ? RANDOM_FIRE : SECOND_PASS; - } else - next = RANDOM_FIRE; - break; - - case SECOND_PASS: /* continue shooting after reversing */ - x = ts.x + xincr[ts.dir]; - y = ts.y + yincr[ts.dir]; - if (POSSIBLE(x, y) && (hit = cpufire(x, y))) { - ts.x = x; - ts.y = y; - ts.hits++; - next = (hit == S_SUNK) ? RANDOM_FIRE : SECOND_PASS; - break; - } else - next = RANDOM_FIRE; - break; - } - - /* pause between shots in salvo */ - if (salvo) { - (void) refresh(); - (void) sleep(1); - } -#ifdef DEBUG - MvPrintw(PROMPTLINE + 2, 0, - "New state %d, x=%d, y=%d, d=%d", - next, x, y, d); -#endif /* DEBUG */ - return ((hit) ? TRUE : FALSE); -} - -static int -playagain(void) -{ - int j; - ship_t *ss; - - 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); - } - - if (awinna()) - ++cpuwon; - else - ++plywon; - j = 18 + (int) strlen(name); - if (plywon >= 10) - ++j; - if (cpuwon >= 10) - ++j; - MvPrintw(1, (COLWIDTH - j) / 2, - "%s: %d Computer: %d", name, plywon, cpuwon); - - prompt(2, (awinna())? "Want to be humiliated again, %s [yn]? " - : "Going to give me a chance for revenge, %s [yn]? ", name); - return (sgetc("YN") == 'Y'); -} - -static void -do_options(int c, char *op[]) -{ - register int i; - - if (c > 1) { - for (i = 1; i < c; i++) { - switch (op[i][0]) { - default: - case '?': - (void) fprintf(stderr, "Usage: battle [-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"); - (void) fprintf(stderr, "\t-c : ships may be adjacent\n"); - ExitProgram(EXIT_FAILURE); - break; - case '-': - switch (op[i][1]) { - case 'b': - blitz = 1; - if (salvo == 1) { - (void) fprintf(stderr, - "Bad Arg: -b and -s are mutually exclusive\n"); - ExitProgram(EXIT_FAILURE); - } - break; - case 's': - salvo = 1; - if (blitz == 1) { - (void) fprintf(stderr, - "Bad Arg: -s and -b are mutually exclusive\n"); - ExitProgram(EXIT_FAILURE); - } - break; - case 'c': - closepack = 1; - break; - default: - (void) fprintf(stderr, - "Bad arg: type \"%s ?\" for usage message\n", - op[0]); - ExitProgram(EXIT_FAILURE); - } - } - } - } -} - -static int -scount(int who) -{ - register int i, shots; - register ship_t *sp; - - if (who) - sp = cpuship; /* count cpu shots */ - else - sp = plyship; /* count player shots */ - - for (i = 0, shots = 0; i < SHIPTYPES; i++, sp++) { - if (sp->hits >= sp->length) - continue; /* dead ship */ - else - shots++; - } - return (shots); -} - -int -main(int argc, char *argv[]) -{ - setlocale(LC_ALL, ""); - - do_options(argc, argv); - - intro(); - do { - initgame(); - while (awinna() == -1) { - if (!blitz) { - if (!salvo) { - if (turn) - (void) cputurn(); - else - (void) plyturn(); - } else { - register int i; - - i = scount(turn); - while (i--) { - if (turn) { - if (cputurn() && awinna() != -1) - i = 0; - } else { - if (plyturn() && awinna() != -1) - i = 0; - } - } - } - } else - while ((turn ? cputurn() : plyturn()) && awinna() == -1) - continue; - turn = OTHER; - } - } while - (playagain()); - uninitgame(0); - /*NOTREACHED */ -} - -/* bs.c ends here */ diff --git a/test/bulgarian-utf8.txt b/test/bulgarian-utf8.txt deleted file mode 100644 index 046c059c81d..00000000000 --- a/test/bulgarian-utf8.txt +++ /dev/null @@ -1,6 +0,0 @@ -Показване на помощна Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ -- 1 -Създаване на дÑлове -- 2 -Избор на дÑл и форматиране -- 3 -ЗапиÑване в Ð¸Ð·Ð±Ñ€Ð°Ð½Ð¸Ñ Ð´Ñл -- 4 -ИнÑталиране на LILO -- 5 -Изход от програмата -- 6 diff --git a/test/cardfile.c b/test/cardfile.c deleted file mode 100644 index f9557bd64c7..00000000000 --- a/test/cardfile.c +++ /dev/null @@ -1,621 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1999-2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: cardfile.c,v 1.38 2010/11/14 00:58:45 tom Exp $ - * - * File format: text beginning in column 1 is a title; other text is content. - */ - -#include - -#if USE_LIBFORM && USE_LIBPANEL - -#include -#include - -#define VISIBLE_CARDS 10 -#define OFFSET_CARD 2 -#define pair_1 1 -#define pair_2 2 - -#define isVisible(cardp) ((cardp)->panel != 0) - -enum { - MY_CTRL_x = MAX_FORM_COMMAND - ,MY_CTRL_N - ,MY_CTRL_P - ,MY_CTRL_Q - ,MY_CTRL_W -}; - -typedef struct _card { - struct _card *link; - PANEL *panel; - FORM *form; - char *title; - char *content; -} CARD; - -static CARD *all_cards; -static bool try_color = FALSE; -static char default_name[] = "cardfile.dat"; - -#if !HAVE_STRDUP -#define strdup my_strdup -static char * -strdup(const char *s) -{ - char *p = typeMalloc(char, strlen(s) + 1); - if (p) - strcpy(p, s); - return (p); -} -#endif /* not HAVE_STRDUP */ - -static const char * -skip(const char *buffer) -{ - while (isspace(UChar(*buffer))) - buffer++; - return buffer; -} - -static void -trim(char *buffer) -{ - size_t n = strlen(buffer); - while (n-- && isspace(UChar(buffer[n]))) - buffer[n] = 0; -} - -/*******************************************************************************/ - -static CARD * -add_title(const char *title) -{ - CARD *card, *p, *q; - - for (p = all_cards, q = 0; p != 0; q = p, p = p->link) { - int cmp = strcmp(p->title, title); - if (cmp == 0) - return p; - if (cmp > 0) - break; - } - - card = typeCalloc(CARD, 1); - card->title = strdup(title); - card->content = strdup(""); - - if (q == 0) { - card->link = all_cards; - all_cards = card; - } else { - card->link = q->link; - q->link = card; - } - - return card; -} - -static void -add_content(CARD * card, const char *content) -{ - size_t total, offset; - - content = skip(content); - if ((total = strlen(content)) != 0) { - 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++, " "); - } else { - offset = 0; - if (card->content != 0) - free(card->content); - card->content = typeMalloc(char, total + 1); - } - if (card->content) - strcpy(card->content + offset, content); - } -} - -static CARD * -new_card(void) -{ - CARD *card = add_title(""); - add_content(card, ""); - return card; -} - -static CARD * -find_card(char *title) -{ - CARD *card; - - for (card = all_cards; card != 0; card = card->link) - if (!strcmp(card->title, title)) - break; - - return card; -} - -static void -read_data(char *fname) -{ - FILE *fp; - CARD *card = 0; - char buffer[BUFSIZ]; - - if ((fp = fopen(fname, "r")) != 0) { - while (fgets(buffer, sizeof(buffer), fp)) { - trim(buffer); - if (isspace(UChar(*buffer))) { - if (card == 0) - card = add_title(""); - add_content(card, buffer); - } else if ((card = find_card(buffer)) == 0) { - card = add_title(buffer); - } - } - fclose(fp); - } -} - -/*******************************************************************************/ - -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) { - for (p = all_cards; p != 0; p = p->link) { - FIELD **f = form_fields(p->form); - for (n = 0; f[n] != 0; n++) { - char *s = field_buffer(f[n], 0); - if (s != 0 - && (s = strdup(s)) != 0) { - trim(s); - fprintf(fp, "%s%s\n", n ? "\t" : "", s); - free(s); - } - } - } - fclose(fp); - } -} - -/*******************************************************************************/ - -/* - * Count the cards - */ -static int -count_cards(void) -{ - CARD *p; - int count = 0; - - for (p = all_cards; p != 0; p = p->link) - count++; - - return count; -} - -/* - * Shuffle the panels to keep them in a natural hierarchy. - */ -static void -order_cards(CARD * first, int depth) -{ - if (first) { - if (depth && first->link) - order_cards(first->link, depth - 1); - if (isVisible(first)) - top_panel(first->panel); - } -} - -/* - * Return the next card in the list - */ -static CARD * -next_card(CARD * now) -{ - if (now->link != 0) { - CARD *tst = now->link; - if (isVisible(tst)) - now = tst; - else - (void) next_card(tst); - } - return now; -} - -/* - * Return the previous card in the list - */ -static CARD * -prev_card(CARD * now) -{ - CARD *p; - for (p = all_cards; p != 0; p = p->link) { - if (p->link == now) { - if (!isVisible(p)) - p = prev_card(p); - return p; - } - } - return now; -} - -/* - * Returns the first card in the list that we will display. - */ -static CARD * -first_card(CARD * now) -{ - if (!isVisible(now)) - now = next_card(now); - return now; -} - -/*******************************************************************************/ - -static int -form_virtualize(WINDOW *w) -{ - int c = wgetch(w); - - switch (c) { - case CTRL('W'): - return (MY_CTRL_W); - case CTRL('N'): - return (MY_CTRL_N); - case CTRL('P'): - return (MY_CTRL_P); - case QUIT: - case ESCAPE: - return (MY_CTRL_Q); - - case KEY_BACKSPACE: - return (REQ_DEL_PREV); - case KEY_DC: - return (REQ_DEL_CHAR); - case KEY_LEFT: - return (REQ_LEFT_CHAR); - case KEY_RIGHT: - return (REQ_RIGHT_CHAR); - - case KEY_DOWN: - case KEY_NEXT: - return (REQ_NEXT_FIELD); - case KEY_UP: - case KEY_PREVIOUS: - return (REQ_PREV_FIELD); - - default: - return (c); - } -} - -static FIELD ** -make_fields(CARD * p, int form_high, int form_wide) -{ - FIELD **f = typeCalloc(FIELD *, 3); - - f[0] = new_field(1, form_wide, 0, 0, 0, 0); - set_field_back(f[0], A_REVERSE); - set_field_buffer(f[0], 0, p->title); - field_opts_off(f[0], O_BLANK); - - f[1] = new_field(form_high - 1, form_wide, 1, 0, 0, 0); - set_field_buffer(f[1], 0, p->content); - set_field_just(f[1], JUSTIFY_LEFT); - field_opts_off(f[1], O_BLANK); - - f[2] = 0; - return f; -} - -static void -show_legend(void) -{ - erase(); - move(LINES - 3, 0); - addstr("^Q/ESC -- exit form ^W -- writes data to file\n"); - addstr("^N -- go to next card ^P -- go to previous card\n"); - addstr("Arrow keys move left/right within a field, up/down between fields"); -} - -#if (defined(KEY_RESIZE) && HAVE_WRESIZE) || NO_LEAKS -static void -free_form_fields(FIELD ** f) -{ - int n; - - for (n = 0; f[n] != 0; ++n) { - free_field(f[n]); - } - free(f); -} -#endif - -/*******************************************************************************/ - -static void -cardfile(char *fname) -{ - WINDOW *win; - CARD *p; - CARD *top_card; - int visible_cards; - int panel_wide; - int panel_high; - int form_wide; - int form_high; - int y; - int x; - int ch = ERR; - int finished = FALSE; - - show_legend(); - - /* decide how many cards we can display */ - visible_cards = count_cards(); - while ( - (panel_wide = COLS - (visible_cards * OFFSET_CARD)) < 10 || - (panel_high = LINES - (visible_cards * OFFSET_CARD) - 5) < 5) { - --visible_cards; - } - form_wide = panel_wide - 2; - form_high = panel_high - 2; - y = (visible_cards - 1) * OFFSET_CARD; - x = 0; - - /* make a panel for each CARD */ - for (p = all_cards; p != 0; p = p->link) { - - if ((win = newwin(panel_high, panel_wide, y, x)) == 0) - break; - - wbkgd(win, COLOR_PAIR(pair_2)); - keypad(win, TRUE); - p->panel = new_panel(win); - box(win, 0, 0); - - p->form = new_form(make_fields(p, form_high, form_wide)); - set_form_win(p->form, win); - set_form_sub(p->form, derwin(win, form_high, form_wide, 1, 1)); - post_form(p->form); - - y -= OFFSET_CARD; - x += OFFSET_CARD; - } - - top_card = first_card(all_cards); - order_cards(top_card, visible_cards); - - while (!finished) { - update_panels(); - doupdate(); - - ch = form_virtualize(panel_window(top_card->panel)); - switch (form_driver(top_card->form, ch)) { - case E_OK: - break; - case E_UNKNOWN_COMMAND: - switch (ch) { - case MY_CTRL_Q: - finished = TRUE; - break; - case MY_CTRL_P: - top_card = prev_card(top_card); - order_cards(top_card, visible_cards); - break; - case MY_CTRL_N: - top_card = next_card(top_card); - order_cards(top_card, visible_cards); - break; - case MY_CTRL_W: - form_driver(top_card->form, REQ_VALIDATION); - write_data(fname); - break; -#if defined(KEY_RESIZE) && HAVE_WRESIZE - case KEY_RESIZE: - /* resizeterm already did "something" reasonable, but it cannot - * know much about layout. So let's make it nicer. - */ - panel_wide = COLS - (visible_cards * OFFSET_CARD); - panel_high = LINES - (visible_cards * OFFSET_CARD) - 5; - - form_wide = panel_wide - 2; - form_high = panel_high - 2; - - y = (visible_cards - 1) * OFFSET_CARD; - x = 0; - - show_legend(); - for (p = all_cards; p != 0; p = p->link) { - FIELD **oldf = form_fields(p->form); - WINDOW *olds = form_sub(p->form); - - if (!isVisible(p)) - continue; - win = form_win(p->form); - - /* move and resize the card as needed - * FIXME: if the windows are shrunk too much, this won't do - */ - mvwin(win, y, x); - wresize(win, panel_high, panel_wide); - - /* reconstruct each form. Forms are not resizable, and - * there appears to be no good way to reload the text in - * a resized window. - */ - werase(win); - - unpost_form(p->form); - free_form(p->form); - - p->form = new_form(make_fields(p, form_high, form_wide)); - set_form_win(p->form, win); - set_form_sub(p->form, derwin(win, form_high, form_wide, - 1, 1)); - post_form(p->form); - - free_form_fields(oldf); - delwin(olds); - - box(win, 0, 0); - - y -= OFFSET_CARD; - x += OFFSET_CARD; - } - break; -#endif - default: - beep(); - break; - } - break; - default: - flash(); - break; - } - } -#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); - - unpost_form(p->form); /* ...so we can free it */ - free_form(p->form); /* this also disconnects the fields */ - - free_form_fields(f); - - del_panel(p->panel); - } - free(p->title); - free(p->content); - free(p); - } -#endif -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: view [options] file" - ,"" - ,"Options:" - ," -c use color if terminal supports it" - }; - 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 n; - - setlocale(LC_ALL, ""); - - while ((n = getopt(argc, argv, "c")) != -1) { - switch (n) { - case 'c': - try_color = TRUE; - break; - default: - usage(); - } - } - - initscr(); - cbreak(); - noecho(); - - if (try_color) { - if (has_colors()) { - start_color(); - init_pair(pair_1, COLOR_WHITE, COLOR_BLUE); - init_pair(pair_2, COLOR_WHITE, COLOR_CYAN); - bkgd(COLOR_PAIR(pair_1)); - } else { - try_color = FALSE; - } - } - - if (optind + 1 == argc) { - for (n = 1; n < argc; n++) - read_data(argv[n]); - if (count_cards() == 0) - new_card(); - cardfile(argv[1]); - } else { - read_data(default_name); - if (count_cards() == 0) - new_card(); - cardfile(default_name); - } - - endwin(); - - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the curses form and panel libraries\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/cardfile.dat b/test/cardfile.dat deleted file mode 100644 index deb4b76a7d8..00000000000 --- a/test/cardfile.dat +++ /dev/null @@ -1,13 +0,0 @@ -title 1 - Some text for title1 - and some more text -title 2 - The quicker brown fox ran all over the lazy dog. -put a card before the first two - This is an example of a simple cardfile. -show a fourth card - The fourth card - has a large amount of data, - more than the other cards. - At least, that is what I thought it should do, since I want to see how well - the forms package handles justification. diff --git a/test/chgat.c b/test/chgat.c deleted file mode 100644 index 53ecfd7cedf..00000000000 --- a/test/chgat.c +++ /dev/null @@ -1,375 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2006-2009,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"), 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: chgat.c,v 1.11 2010/05/01 19:12:26 tom Exp $ - * - * test-driver for chgat/wchgat/mvchgat/mvwchgat - */ - -#include - -#if HAVE_CHGAT - -#define SHOW(n) ((n) == ERR ? "ERR" : "OK") -#define COLOR_DEFAULT (-1) - -#if defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH < 20060715 -#define touch_if_needed(win, row) touchline(win, row, 1) -#else -#define touch_if_needed(win, row) /* nothing */ -#endif - -typedef struct { - unsigned c; - unsigned v; - short pair; - unsigned attr; - int count; - int ch; - const char *c_msg; - const char *v_msg; - int y_val; - int x_val; - int y_beg, x_beg; - int y_max, x_max; -} STATUS; - -static const char * -color_params(unsigned state, short *pair) -{ - /* *INDENT-OFF* */ - static struct { - short pair; - short fg, bg; - const char *msg; - } table[] = { - { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, - { 1, COLOR_RED, COLOR_BLACK, "red/black" }, - { 2, COLOR_WHITE, COLOR_BLUE, "white/blue" }, - }; - /* *INDENT-ON* */ - - static bool first = TRUE; - const char *result = 0; - - if (has_colors()) { - if (first) { - unsigned n; - - start_color(); - for (n = 0; n < SIZEOF(table); ++n) { - init_pair(table[n].pair, table[n].fg, table[n].bg); - } - } - if (state < SIZEOF(table)) { - *pair = table[state].pair; - result = table[state].msg; - } - } - return result; -} - -static const char * -video_params(unsigned state, unsigned *attr) -{ - /* *INDENT-OFF* */ - static struct { - unsigned attr; - const char *msg; - } table[] = { - { A_NORMAL, "normal" }, - { A_BOLD, "bold" }, - { A_REVERSE, "reverse" }, - { A_UNDERLINE, "underline" }, - { A_BLINK, "blink" }, - }; - /* *INDENT-ON* */ - - const char *result = 0; - - if (state < SIZEOF(table)) { - *attr = table[state].attr; - result = table[state].msg; - } - return result; -} - -/* fill the window with a test-pattern */ -static void -fill_window(WINDOW *win) -{ - int y, x; - int y0 = -1, x0 = -1; - - getyx(win, y, x); - wmove(win, 0, 0); - while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) { - int y1, x1; - getyx(win, y1, x1); - if (y1 == y0 && x1 == x0) - break; - x0 = x1; - y0 = y1; - } - wmove(win, y, x); -} - -static void -show_status(WINDOW *win, STATUS * sp) -{ - int y, x; - - getyx(win, y, x); - wmove(win, 0, 0); - wprintw(win, "Count %d", sp->count); - if (sp->v_msg != 0) - wprintw(win, " Video %s", sp->v_msg); - if (sp->c_msg != 0) - wprintw(win, " Color %s", sp->c_msg); - wclrtoeol(win); - wmove(win, y, x); -} - -static void -do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) -{ - WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, - sp->y_beg + 1, sp->x_beg + 1); - - if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { - WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); - - if (win2 != 0) { - box(win1, 0, 0); - wrefresh(win1); - func(win2); - - delwin(win2); - } else { - beep(); - } - delwin(win1); - touchwin(win); - } else { - beep(); - } -} - -static void -init_status(WINDOW *win, STATUS * sp) -{ - memset(sp, 0, sizeof(*sp)); - sp->c = 99; - sp->v = 99; - sp->ch = ' '; - - keypad(win, TRUE); - fill_window(win); - - getbegyx(win, sp->y_beg, sp->x_beg); - getmaxyx(win, sp->y_max, sp->x_max); -} - -static void -show_help(WINDOW *win) -{ - static const char *table[] = - { - "Basic commands:" - ,"Use h/j/k/l or arrow keys to move the cursor." - ,"Set the count parameter for chgat by entering digits 0-9." - ,"" - ,"Other commands:" - ,"space toggles through the set of video attributes and colors." - ,"t touches (forces repaint) of the current line." - ,". calls *chgat at the current position with the given count." - ,", calls *chgat at the window beginning with the given count." - ,"= resets count to zero." - ,"- negates count." - ,"? shows this help-window" - ,"" - ,"" - }; - - 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(); -} - -static void -update_status(WINDOW *win, STATUS * sp) -{ - switch (sp->ch) { - case ' ': /* next test-iteration */ - if (has_colors()) { - if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { - sp->c_msg = color_params(sp->c = 0, &(sp->pair)); - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { - sp->v_msg = video_params(sp->v = 0, &(sp->attr)); - } - } - } else { - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { - sp->v_msg = video_params(sp->v = 0, &(sp->attr)); - } - } - sp->count = 0; - show_status(win, sp); - break; - case KEY_LEFT: - case 'h': - if (sp->x_val > 0) - wmove(win, sp->y_val, --(sp->x_val)); - break; - case KEY_DOWN: - case 'j': - if (sp->y_val < sp->y_max) - wmove(win, ++(sp->y_val), sp->x_val); - break; - case KEY_UP: - case 'k': - if (sp->y_val > 0) - wmove(win, --(sp->y_val), sp->x_val); - break; - case KEY_RIGHT: - case 'l': - if (sp->x_val < sp->x_max) - wmove(win, sp->y_val, ++(sp->x_val)); - break; - case 't': - touchline(win, sp->y_val, 1); - break; - case '=': - sp->count = 0; - show_status(win, sp); - break; - case '-': - sp->count = -(sp->count); - show_status(win, sp); - break; - case '?': - do_subwindow(win, sp, show_help); - break; - default: - if (isdigit(sp->ch)) { - sp->count = (sp->count * 10) + (sp->ch - '0'); - show_status(win, sp); - } else { - beep(); - } - break; - } -} - -static void -test_wchgat(WINDOW *win) -{ - STATUS st; - - init_status(win, &st); - - do { - switch (st.ch) { - case '.': /* change from current position */ - wchgat(win, st.count, st.attr, st.pair, (void *) 0); - touch_if_needed(win, st.y_val); - break; - case ',': /* change from beginning of window */ - mvwchgat(win, 0, 0, st.count, st.attr, st.pair, (void *) 0); - touch_if_needed(win, 0); - wmove(win, st.y_val, st.x_val); - break; - case 'w': - do_subwindow(win, &st, test_wchgat); - break; - case 'q': - return; - default: - update_status(win, &st); - break; - } - } while ((st.ch = wgetch(win)) != ERR); -} - -static void -test_chgat(void) -{ - STATUS st; - - init_status(stdscr, &st); - - do { - switch (st.ch) { - case '.': /* change from current position */ - chgat(st.count, st.attr, st.pair, (void *) 0); - touch_if_needed(stdscr, st.y_val); - break; - case ',': /* change from beginning of window */ - mvchgat(0, 0, st.count, st.attr, st.pair, (void *) 0); - touch_if_needed(stdscr, 0); - move(st.y_val, st.x_val); - break; - case 'w': - do_subwindow(stdscr, &st, test_wchgat); - break; - case 'q': - return; - default: - update_status(stdscr, &st); - break; - } - } while ((st.ch = getch()) != ERR); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - initscr(); - cbreak(); - noecho(); - - test_chgat(); - endwin(); - - ExitProgram(EXIT_SUCCESS); -} - -#else -int -main(void) -{ - printf("This program requires the curses chgat function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/clip_printw.c b/test/clip_printw.c deleted file mode 100644 index 5b279e9eb31..00000000000 --- a/test/clip_printw.c +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2008-2009,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"), 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: clip_printw.c,v 1.7 2010/11/13 20:48:48 tom Exp $ - * - * demonstrate how to use printw without wrapping. - */ - -#include - -#ifdef HAVE_VW_PRINTW - -#define SHOW(n) ((n) == ERR ? "ERR" : "OK") -#define COLOR_DEFAULT (-1) - -typedef struct { - unsigned c; - unsigned v; - int status; - int pair; - attr_t attr; - int count; - int ch; - const char *c_msg; - const char *v_msg; - int y_val; - int x_val; - int y_beg, x_beg; - int y_max, x_max; -} STATUS; - -static int -clip_wprintw(WINDOW *win, NCURSES_CONST char *fmt,...) -{ - int y0, x0, y1, x1, width; - WINDOW *sub; - va_list ap; - int rc; - - /* - * Allocate a single-line derived window extending from the current - * cursor position to the end of the current line in the given window. - * Disable scrolling in the derived window. - */ - getyx(win, y0, x0); - width = getmaxx(win) - x0; - sub = derwin(win, 1, width, y0, x0); - scrollok(sub, FALSE); - - /* - * Print the text. - */ - va_start(ap, fmt); - rc = vw_printw(sub, fmt, ap); - va_end(ap); - - getyx(sub, y1, x1); - delwin(sub); - - wmove(win, y1 + y0, x1 + x0); - - return rc; -} - -static const char * -color_params(unsigned state, int *pair) -{ - /* *INDENT-OFF* */ - static struct { - int pair; - int fg, bg; - const char *msg; - } table[] = { - { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, - { 1, COLOR_RED, COLOR_BLACK, "red/black" }, - { 2, COLOR_WHITE, COLOR_BLUE, "white/blue" }, - }; - /* *INDENT-ON* */ - - static bool first = TRUE; - const char *result = 0; - - if (has_colors()) { - if (first) { - unsigned n; - - start_color(); - for (n = 0; n < SIZEOF(table); ++n) { - init_pair((short) table[n].pair, - (short) table[n].fg, - (short) table[n].bg); - } - } - if (state < SIZEOF(table)) { - *pair = table[state].pair; - result = table[state].msg; - } - } - return result; -} - -static const char * -video_params(unsigned state, attr_t *attr) -{ - /* *INDENT-OFF* */ - static struct { - attr_t attr; - const char *msg; - } table[] = { - { A_NORMAL, "normal" }, - { A_BOLD, "bold" }, - { A_REVERSE, "reverse" }, - { A_UNDERLINE, "underline" }, - { A_BLINK, "blink" }, - }; - /* *INDENT-ON* */ - - const char *result = 0; - - if (state < SIZEOF(table)) { - *attr = table[state].attr; - result = table[state].msg; - } - return result; -} - -/* fill the window with a test-pattern */ -static void -fill_window(WINDOW *win) -{ - int y, x; - int y0 = -1, x0 = -1; - - getyx(win, y, x); - wmove(win, 0, 0); - while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) { - int y1, x1; - getyx(win, y1, x1); - if (y1 == y0 && x1 == x0) - break; - x0 = x1; - y0 = y1; - } - wmove(win, y, x); -} - -static void -show_status(WINDOW *win, STATUS * sp) -{ - int y, x; - - getyx(win, y, x); - wmove(win, 0, 0); - wprintw(win, "Count %d", sp->count); - if (sp->v_msg != 0) - wprintw(win, " Video %s", sp->v_msg); - if (sp->c_msg != 0) - wprintw(win, " Color %s", sp->c_msg); - wprintw(win, " (%d)", sp->status); - wclrtoeol(win); - wmove(win, y, x); -} - -static void -do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) -{ - WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, - sp->y_beg + 1, sp->x_beg + 1); - - if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { - WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); - - if (win2 != 0) { - box(win1, 0, 0); - wrefresh(win1); - func(win2); - - delwin(win2); - } else { - beep(); - } - delwin(win1); - touchwin(win); - } else { - beep(); - } -} - -static void -init_status(WINDOW *win, STATUS * sp) -{ - memset(sp, 0, sizeof(*sp)); - sp->c = 99; - sp->v = 99; - sp->ch = ' '; - - keypad(win, TRUE); - fill_window(win); - - getbegyx(win, sp->y_beg, sp->x_beg); - getmaxyx(win, sp->y_max, sp->x_max); -} - -static void -show_help(WINDOW *win) -{ - static const char *table[] = - { - "Basic commands:" - ,"Use h/j/k/l or arrow keys to move the cursor." - ,"Set the count parameter for clip_wprintw by entering digits 0-9." - ,"" - ,"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." - ,"= resets count to zero." - ,"? shows this help-window" - ,"" - }; - - 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(); -} - -static void -update_status(WINDOW *win, STATUS * sp) -{ - switch (sp->ch) { - case ' ': /* next test-iteration */ - if (has_colors()) { - if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { - sp->c_msg = color_params(sp->c = 0, &(sp->pair)); - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { - sp->v_msg = video_params(sp->v = 0, &(sp->attr)); - } - } - } else { - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { - sp->v_msg = video_params(sp->v = 0, &(sp->attr)); - } - } - sp->count = 0; - show_status(win, sp); - break; - case KEY_LEFT: - case 'h': - if (sp->x_val > 0) - wmove(win, sp->y_val, --(sp->x_val)); - break; - case KEY_DOWN: - case 'j': - if (sp->y_val < sp->y_max) - wmove(win, ++(sp->y_val), sp->x_val); - break; - case KEY_UP: - case 'k': - if (sp->y_val > 0) - wmove(win, --(sp->y_val), sp->x_val); - break; - case KEY_RIGHT: - case 'l': - if (sp->x_val < sp->x_max) - wmove(win, sp->y_val, ++(sp->x_val)); - break; - case 't': - touchline(win, sp->y_val, 1); - break; - case '=': - sp->count = 0; - show_status(win, sp); - break; - case '?': - do_subwindow(win, sp, show_help); - break; - default: - if (isdigit(sp->ch)) { - sp->count = (sp->count * 10) + (sp->ch - '0'); - show_status(win, sp); - } else { - beep(); - } - break; - } -} - -static void -test_clipping(WINDOW *win) -{ - STATUS st; - char fmt[80]; - char *buffer; - unsigned j, need; - - init_status(win, &st); - - do { - switch (st.ch) { - case '.': /* change from current position */ - (void) wattrset(win, st.attr | (chtype) COLOR_PAIR(st.pair)); - if (st.count > 0) { - need = (unsigned) st.count + 1; - sprintf(fmt, "%%c%%%ds%%c", st.count); - } else { - need = (unsigned) getmaxx(win) - 1; - strcpy(fmt, "%c%s%c"); - } - if ((buffer = typeMalloc(char, need)) != 0) { - for (j = 0; j < need; ++j) { - buffer[j] = (char) ('A' + (j % 26)); - } - buffer[need - 1] = '\0'; - st.status = clip_wprintw(win, fmt, '[', buffer, ']'); - } - break; - case 'w': - do_subwindow(win, &st, test_clipping); - break; - case 'q': - return; - default: - update_status(win, &st); - break; - } - } while ((st.ch = wgetch(win)) != ERR); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - initscr(); - cbreak(); - noecho(); - - test_clipping(stdscr); - endwin(); - - ExitProgram(EXIT_SUCCESS); -} - -#else -int -main(void) -{ - printf("This program requires the curses vw_printw function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/color_set.c b/test/color_set.c deleted file mode 100644 index 2e981cba9f1..00000000000 --- a/test/color_set.c +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2003-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 * - * "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_set.c,v 1.6 2008/02/10 00:18:01 tom Exp $ - */ - -#include - -#if HAVE_COLOR_SET - -#define SHOW(n) ((n) == ERR ? "ERR" : "OK") - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - short f, b; - int i; - - initscr(); - cbreak(); - noecho(); - - if (has_colors()) { - start_color(); - - pair_content(0, &f, &b); - printw("pair 0 contains (%d,%d)\n", f, b); - getch(); - - printw("Initializing pair 1 to red/black\n"); - init_pair(1, COLOR_RED, COLOR_BLACK); - i = color_set(1, NULL); - printw("RED/BLACK (%s)\n", SHOW(i)); - getch(); - - printw("Initializing pair 2 to white/blue\n"); - init_pair(2, COLOR_WHITE, COLOR_BLUE); - i = color_set(2, NULL); - printw("WHITE/BLUE (%s)\n", SHOW(i)); - getch(); - - printw("Resetting colors to pair 0\n"); - i = color_set(0, NULL); - printw("Default Colors (%s)\n", SHOW(i)); - getch(); - - printw("Resetting colors to pair 1\n"); - i = color_set(1, NULL); - printw("RED/BLACK (%s)\n", SHOW(i)); - getch(); - - } else { - printw("This demo requires a color terminal"); - getch(); - } - endwin(); - - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the curses color_set function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/configure b/test/configure deleted file mode 100755 index 2937235eab6..00000000000 --- a/test/configure +++ /dev/null @@ -1,15994 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20101002. -# -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Name of the executable. -as_me=`echo "$0" |sed 's,.*[\\/],,'` - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -as_executable_p="test -f" - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# NLS nuisances. -$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } -$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } -$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } -$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } -$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } -$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } -$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } -$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -exec 6>&1 - -# -# Initializations. -# -ac_default_prefix=/usr/local -cross_compiling=no -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - -ac_unique_file="ncurses.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_SYS_STAT_H -# include -#endif -#if STDC_HEADERS -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -#endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif -#if HAVE_STRINGS_H -# include -#endif -#if HAVE_INTTYPES_H -# include -#else -# if HAVE_STDINT_H -# include -# endif -#endif -#if HAVE_UNISTD_H -# include -#endif" - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= - -ac_prev= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_option in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: should be removed in autoconf 3.0. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat < if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -EOF -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue - cd $ac_subdir - # A "../" for each directory in /$ac_subdir. - ac_dots=`echo $ac_subdir | - sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` - - case $srcdir in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_subdir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; - esac - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure.gnu; then - echo - $SHELL $ac_sub_srcdir/configure.gnu --help=recursive - elif test -f $ac_sub_srcdir/configure; then - echo - $SHELL $ac_sub_srcdir/configure --help=recursive - elif test -f $ac_sub_srcdir/configure.ac || - test -f $ac_sub_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 - fi - cd $ac_popdir - done -fi - -test -n "$ac_init_help" && exit 0 -if $ac_init_version; then - cat <<\EOF - -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -EOF - exit 0 -fi -exec 5>config.log -cat >&5 </dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -PATH = $PATH - -_ASUNAME -} >&5 - -cat >&5 <\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" - ac_sep=" " ;; - esac - # Get rid of the leading space. -done - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - echo >&5 - echo "## ----------------- ##" >&5 - echo "## Cache variables. ##" >&5 - echo "## ----------------- ##" >&5 - echo >&5 - # The following way of writing the cache mishandles newlines in values, -{ - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} >&5 - sed "/^$/d" confdefs.h >conftest.log - if test -s conftest.log; then - echo >&5 - echo "## ------------ ##" >&5 - echo "## confdefs.h. ##" >&5 - echo "## ------------ ##" >&5 - echo >&5 - cat conftest.log >&5 - fi - (echo; echo) >&5 - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" >&5 - echo "$as_me: exit $exit_status" >&5 - rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && - exit $exit_status - ' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:894: 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" - fi -done - -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:905: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi -else - { echo "$as_me:913: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:929: 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:933: 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:939: 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:941: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:943: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. It doesn't matter if - # we pass some twice (in addition to the command line arguments). - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" - ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:962: 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:964: 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 - -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 - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac -echo "#! $SHELL" >conftest.sh -echo "exit 0" >>conftest.sh -chmod +x conftest.sh -if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5 - (PATH=".;."; conftest.sh) 2>&5 - ac_status=$? - echo "$as_me:988: \$? = $ac_status" >&5 - (exit $ac_status); }; then - ac_path_separator=';' -else - ac_path_separator=: -fi -PATH_SEPARATOR="$ac_path_separator" -rm -f conftest.sh - -ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin" - -test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ ) - -test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ ) - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:1020: 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 -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -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:1030: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:1034: 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 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:1043: 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:1047: 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:1052: 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/'` -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:1060: 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 -else - ac_cv_host_alias=$host_alias -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:1069: 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:1074: 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/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - system_name="$host_os" -else - system_name="`(uname -s -r) 2>/dev/null`" - if test -z "$system_name" ; then - system_name="`(hostname) 2>/dev/null`" - fi -fi -test -n "$system_name" && cat >>confdefs.h <&6 -else - cf_cv_system_name="$system_name" -fi - -test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1099: 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:1103: 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:1105: 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 - -test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed - -echo "$as_me:1123: 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 - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftest.make -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:1143: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SET_MAKE= -else - echo "$as_me:1147: result: no" >&5 -echo "${ECHO_T}no" >&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -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 -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:1161: 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 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:1176: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1184: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1187: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -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:1196: 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 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="gcc" -echo "$as_me:1211: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:1219: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:1222: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -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:1235: 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 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:1250: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1258: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1261: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -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:1270: 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 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ac_ct_CC="cc" -echo "$as_me:1285: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:1293: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:1296: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -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:1309: 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 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue -fi -ac_cv_prog_CC="cc" -echo "$as_me:1329: found $ac_dir/$ac_word" >&5 -break -done - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1351: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1354: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - 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:1365: 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 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:1380: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - echo "$as_me:1388: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:1391: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl -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:1404: 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 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:1419: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:1427: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:1430: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ac_ct_CC" && break -done - - CC=$ac_ct_CC -fi - -fi - -test -z "$CC" && { { echo "$as_me:1442: 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:1447:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1450: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:1453: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:1455: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:1458: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:1460: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:1463: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -#line 1467 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -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:1483: 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:1486: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:1489: \$? = $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 -# resort. -for ac_file in `ls a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1512: 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:1518: 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:1523: 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:1529: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1532: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:1539: 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;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:1547: 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:1554: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1556: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:1559: checking for executable suffix" >&5 -echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1561: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:1564: \$? = $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 -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac -done -else - { { echo "$as_me:1580: 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:1586: 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:1592: 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 1598 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1613: \$? = $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 - *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:1625: 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:1632: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -echo "$as_me:1636: 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 1642 "configure" -#include "confdefs.h" - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1657: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1660: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1663: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1666: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_compiler_gnu=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -echo "$as_me:1678: 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:1684: 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 1690 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1702: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1705: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1708: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1711: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:1721: 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 -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1748: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1751: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1754: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1757: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line 1769 "configure" -#include "confdefs.h" -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1782: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1785: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1788: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1791: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line 1801 "configure" -#include "confdefs.h" -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:1816: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1819: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:1822: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -rf conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -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 - -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:1856: 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 - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # 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 1877 "configure" -#include "confdefs.h" -#include - Syntax error -_ACEOF -if { (eval echo "$as_me:1882: \"$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:1888: \$? = $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 - : -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Broken: fails on valid input. -continue -fi -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 1911 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:1915: \"$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:1921: \$? = $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 - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -echo "$as_me:1958: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # 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 1968 "configure" -#include "confdefs.h" -#include - Syntax error -_ACEOF -if { (eval echo "$as_me:1973: \"$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:1979: \$? = $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 - : -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Broken: fails on valid input. -continue -fi -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 2002 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:2006: \"$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:2012: \$? = $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 - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:2040: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} - { (exit 1); exit 1; }; } -fi - -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 - -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:2056: 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 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_AWK="$ac_prog" -echo "$as_me:2071: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - echo "$as_me:2079: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 -else - echo "$as_me:2082: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$AWK" && break -done - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# 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:2101: 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 - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_IFS=$IFS; IFS=$ac_path_separator - for ac_dir in $PATH; do - IFS=$ac_save_IFS - # Account for people who put trailing slashes in PATH elements. - case $ac_dir/ in - / | ./ | .// | /cC/* \ - | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ - | /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if $as_executable_p "$ac_dir/$ac_prog"; then - if test $ac_prog = install && - grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL=$ac_install_sh - fi -fi -echo "$as_me:2150: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -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%^.*/%%'` - ;; -esac - -for ac_prog in tdlint lint alint splint lclint -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:2175: 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 -else - if test -n "$LINT"; then - ac_cv_prog_LINT="$LINT" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_LINT="$ac_prog" -echo "$as_me:2190: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -LINT=$ac_cv_prog_LINT -if test -n "$LINT"; then - echo "$as_me:2198: result: $LINT" >&5 -echo "${ECHO_T}$LINT" >&6 -else - echo "$as_me:2201: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$LINT" && break -done - -echo "$as_me:2208: 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*|*-mingw32*|*-uwin*) #(vi - cf_cv_mixedcase=no - ;; - *) - cf_cv_mixedcase=yes - ;; - esac -else - rm -f conftest CONFTEST - echo test >conftest - if test -f CONFTEST ; then - cf_cv_mixedcase=no - else - cf_cv_mixedcase=yes - fi - rm -f conftest CONFTEST -fi - -fi -echo "$as_me:2235: result: $cf_cv_mixedcase" >&5 -echo "${ECHO_T}$cf_cv_mixedcase" >&6 -test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF -#define MIXEDCASE_FILENAMES 1 -EOF - -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:2245: 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 -else - if test -n "$CTAGS"; then - ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_CTAGS="$ac_prog" -echo "$as_me:2260: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -CTAGS=$ac_cv_prog_CTAGS -if test -n "$CTAGS"; then - echo "$as_me:2268: result: $CTAGS" >&5 -echo "${ECHO_T}$CTAGS" >&6 -else - echo "$as_me:2271: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$CTAGS" && break -done - -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:2282: 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 -else - if test -n "$ETAGS"; then - ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_ETAGS="$ac_prog" -echo "$as_me:2297: found $ac_dir/$ac_word" >&5 -break -done - -fi -fi -ETAGS=$ac_cv_prog_ETAGS -if test -n "$ETAGS"; then - echo "$as_me:2305: result: $ETAGS" >&5 -echo "${ECHO_T}$ETAGS" >&6 -else - echo "$as_me:2308: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$ETAGS" && break -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:2317: 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 -else - if test -n "$MAKE_LOWER_TAGS"; then - ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_MAKE_LOWER_TAGS="yes" -echo "$as_me:2332: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" -fi -fi -MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS -if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:2341: result: $MAKE_LOWER_TAGS" >&5 -echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 -else - echo "$as_me:2344: 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:2351: 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 -else - if test -n "$MAKE_UPPER_TAGS"; then - ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. -else - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - $as_executable_p "$ac_dir/$ac_word" || continue -ac_cv_prog_MAKE_UPPER_TAGS="yes" -echo "$as_me:2366: found $ac_dir/$ac_word" >&5 -break -done - - test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" -fi -fi -MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS -if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:2375: result: $MAKE_UPPER_TAGS" >&5 -echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 -else - echo "$as_me:2378: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -else - MAKE_UPPER_TAGS=no -fi - -if test "$MAKE_UPPER_TAGS" = yes ; then - MAKE_UPPER_TAGS= -else - MAKE_UPPER_TAGS="#" -fi - -if test "$MAKE_LOWER_TAGS" = yes ; then - MAKE_LOWER_TAGS= -else - MAKE_LOWER_TAGS="#" -fi - -echo "$as_me:2398: 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 2405 "configure" -#include "confdefs.h" - - #include - #include - -int -main () -{ -double x = rand(); printf("result = %g\n", sin(x)) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:2420: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:2423: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:2426: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2429: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_need_libm=no -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_need_libm=yes -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:2439: result: $cf_cv_need_libm" >&5 -echo "${ECHO_T}$cf_cv_need_libm" >&6 -if test "$cf_cv_need_libm" = yes -then -MATH_LIB=-lm -fi - -CC_G_OPT="-g" -CC_SHARED_OPTS=unknown -CPPFLAGS="$CPPFLAGS" -DFT_DEP_SUFFIX="" -DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` -DFT_UPR_MODEL="NORMAL" -LD="ld" -LDFLAGS_SHARED="" -LDFLAGS_STATIC="" -LD_MODEL="" -LD_SHARED_OPTS="" -LIBTOOL="" -LIB_CLEAN="" -LIB_COMPILE="" -LIB_LINK='${CC}' -LINK_TESTS="" -LOCAL_LDFLAGS="" -PTHREAD="-lm" -TEST_ARGS="" -TEST_DEPS="" -TEST_LIBS="" -TINFO_ARGS='$(LIBS_CURSES)' -cf_cv_abi_version="" -cf_cv_rel_version="" - -cf_cv_screen=curses -cf_cv_libtype= - -echo "$as_me:2474: checking for ${CC:-cc} option to accept ANSI C" >&5 -echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 -if test "${cf_cv_ansi_cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cf_cv_ansi_cc=no -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -# UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) -for cf_arg in "-DCC_HAS_PROTOS" \ - "" \ - -qlanglvl=ansi \ - -std1 \ - -Ae \ - "-Aa -D_HPUX_SOURCE" \ - -Xc -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 #(vi - -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - cat >conftest.$ac_ext <<_ACEOF -#line 2578 "configure" -#include "confdefs.h" - -#ifndef CC_HAS_PROTOS -#if !defined(__STDC__) || (__STDC__ != 1) -choke me -#endif -#endif - -int -main () -{ - - int test (int i, double x); - struct s1 {int (*f) (int a);}; - struct s2 {int (*f) (double a);}; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2599: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2602: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2605: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2608: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ansi_cc="$cf_arg"; break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -CFLAGS="$cf_save_CFLAGS" -CPPFLAGS="$cf_save_CPPFLAGS" - -fi -echo "$as_me:2621: result: $cf_cv_ansi_cc" >&5 -echo "${ECHO_T}$cf_cv_ansi_cc" >&6 - -if test "$cf_cv_ansi_cc" != "no"; then -if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -cf_new_extra_cppflags= - -for cf_add_cflags in $cf_cv_ansi_cc -do -case $cf_fix_cppflags in -no) - case $cf_add_cflags in #(vi - -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -else - cat >>confdefs.h <<\EOF -#define CC_HAS_PROTOS 1 -EOF - -fi -fi - -if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2714: error: Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto" >&5 -echo "$as_me: error: Your compiler does not appear to recognize prototypes. -You have the following choices: - a. adjust your compiler options - b. get an up-to-date compiler - c. use a wrapper such as unproto" >&2;} - { (exit 1); exit 1; }; } -fi - -if test "$GCC" = yes -then -cat > conftest.i <&5 -echo "$as_me: checking for $CC __attribute__ directives..." >&6;} -cat > conftest.$ac_ext <&5 - - case $cf_attribute in #(vi - printf) #(vi - cf_printf_attribute=yes - cat >conftest.h <conftest.h <conftest.h <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2800: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:2802: result: ... $cf_attribute" >&5 -echo "${ECHO_T}... $cf_attribute" >&6 - cat conftest.h >>confdefs.h - case $cf_attribute in #(vi - printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h -fi -rm -rf conftest* -fi - -cf_XOPEN_SOURCE=500 -cf_POSIX_C_SOURCE=199506L -cf_xopen_source= - -case $host_os in #(vi -aix[456]*) #(vi - cf_xopen_source="-D_ALL_SOURCE" - ;; -cygwin) #(vi - cf_XOPEN_SOURCE=600 - ;; -darwin[0-8].*) #(vi - cf_xopen_source="-D_APPLE_C_SOURCE" - ;; -darwin*) #(vi - cf_xopen_source="-D_DARWIN_C_SOURCE" - ;; -freebsd*|dragonfly*) #(vi - # 5.x headers associate - # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L - # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L - cf_POSIX_C_SOURCE=200112L - 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 - cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" - ;; -hpux*) #(vi - cf_xopen_source="-D_HPUX_SOURCE" - ;; -irix[56].*) #(vi - cf_xopen_source="-D_SGI_SOURCE" - ;; -linux*|gnu*|mint*|k*bsd*-gnu) #(vi - -echo "$as_me:2873: 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 2880 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifndef _XOPEN_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2895: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2898: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2901: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2904: \$? = $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 2913 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifdef _XOPEN_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:2928: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:2931: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2934: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:2937: \$? = $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_cv_gnu_source=yes -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save" - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:2952: 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" - - ;; -mirbsd*) #(vi - # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks - ;; -netbsd*) #(vi - # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw - ;; -openbsd*) #(vi - # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw - ;; -osf[45]*) #(vi - cf_xopen_source="-D_OSF_SOURCE" - ;; -nto-qnx*) #(vi - cf_xopen_source="-D_QNX_SOURCE" - ;; -sco*) #(vi - # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer - ;; -solaris2.1[0-9]) #(vi - cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" - ;; -solaris2.[1-9]) #(vi - cf_xopen_source="-D__EXTENSIONS__" - ;; -*) - echo "$as_me:2982: 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 2989 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifndef _XOPEN_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3004: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3007: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3010: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3013: \$? = $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" - cat >conftest.$ac_ext <<_ACEOF -#line 3022 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifdef _XOPEN_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3037: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3040: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3043: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3046: \$? = $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_cv_xopen_source=$cf_XOPEN_SOURCE -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save" - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:3061: result: $cf_cv_xopen_source" >&5 -echo "${ECHO_T}$cf_cv_xopen_source" >&6 - if test "$cf_cv_xopen_source" != no ; then - -CFLAGS=`echo "$CFLAGS" | \ - sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` - -CPPFLAGS=`echo "$CPPFLAGS" | \ - sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` - - cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - fi - -cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE - -cf_save_CFLAGS="$CFLAGS" -cf_save_CPPFLAGS="$CPPFLAGS" - -cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ - sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` - -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:3168: 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}:3174: testing if the symbol is already defined go no further ..." 1>&5 - - cat >conftest.$ac_ext <<_ACEOF -#line 3177 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifndef _POSIX_C_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3192: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3195: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3198: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3201: \$? = $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 - cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" - ;; - .2) #(vi - 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 3222 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifdef _POSIX_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3237: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3240: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3243: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3246: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" -fi -rm -f conftest.$ac_objext conftest.$ac_ext - fi - -echo "${as_me:-configure}:3257: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 - - CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" - -echo "${as_me:-configure}:3262: testing if the second compile does not leave our definition intact error ..." 1>&5 - - cat >conftest.$ac_ext <<_ACEOF -#line 3265 "configure" -#include "confdefs.h" -#include -int -main () -{ - -#ifndef _POSIX_C_SOURCE -make an error -#endif - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3280: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3283: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3286: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3289: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_posix_c_source=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$cf_save_CFLAGS" - CPPFLAGS="$cf_save_CPPFLAGS" - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:3305: 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 - CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS" - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -fi - - ;; -esac - -if test -n "$cf_xopen_source" ; then - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -fi - -echo "$as_me:3477: 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 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line 3485 "configure" -#include "confdefs.h" -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:3534: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3537: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3540: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3543: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:3560: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:3563: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - -echo "$as_me:3568: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 -if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 3574 "configure" -#include "confdefs.h" - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset x; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *ccp; - char **p; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - ccp = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++ccp; - p = (char**) ccp; - ccp = (char const *const *) p; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* AIX XL C 1.02.0.0 rejects this saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; }; - struct s *b; b->j = 5; - } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - } -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3632: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3635: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3638: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3641: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_const=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_c_const=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:3651: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 -if test $ac_cv_c_const = no; then - -cat >>confdefs.h <<\EOF -#define const -EOF - -fi - -echo "$as_me:3661: 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 -else - - for cf_type in \ - "volatile sig_atomic_t" \ - "sig_atomic_t" \ - "int" - do - cat >conftest.$ac_ext <<_ACEOF -#line 3673 "configure" -#include "confdefs.h" - -#include -#include -#include - -extern $cf_type x; -$cf_type x; -static void handler(int sig) -{ - x = 5; -} -int -main () -{ -signal(SIGINT, handler); - x = 1 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3696: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3699: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3702: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3705: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_sig_atomic_t=$cf_type -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_sig_atomic_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - test "$cf_cv_sig_atomic_t" != no && break - done - -fi - -echo "$as_me:3719: 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 <&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 - - ECHO_LT='--silent' - ECHO_LD='@echo linking $@;' - RULE_CC='@echo compiling $<' - SHOW_CC='@echo compiling $@' - ECHO_CC='@' - - else - - ECHO_LT='' - ECHO_LD='' - RULE_CC='' - SHOW_CC='' - ECHO_CC='' - - fi -else - enableval=yes - - ECHO_LT='' - ECHO_LD='' - RULE_CC='' - SHOW_CC='' - ECHO_CC='' - -fi; -echo "$as_me:3759: result: $enableval" >&5 -echo "${ECHO_T}$enableval" >&6 - -GCC_VERSION=none -if test "$GCC" = yes ; then - echo "$as_me:3764: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`" - test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:3768: result: $GCC_VERSION" >&5 -echo "${ECHO_T}$GCC_VERSION" >&6 -fi - -if ( test "$GCC" = yes || test "$GXX" = yes ) -then -echo "$as_me:3774: 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 - with_warnings=yes - else - with_warnings=no - fi -else - enableval=no - with_warnings=no - -fi; -echo "$as_me:3791: result: $with_warnings" >&5 -echo "${ECHO_T}$with_warnings" >&6 -if test "$with_warnings" = "yes" -then - -if test "$GCC" = yes -then -cat > conftest.i <&5 -echo "$as_me: checking for $CC __attribute__ directives..." >&6;} -cat > conftest.$ac_ext <&5 - - case $cf_attribute in #(vi - printf) #(vi - cf_printf_attribute=yes - cat >conftest.h <conftest.h <conftest.h <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3869: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:3871: result: ... $cf_attribute" >&5 -echo "${ECHO_T}... $cf_attribute" >&6 - cat conftest.h >>confdefs.h - case $cf_attribute in #(vi - printf) #(vi - if test "$cf_printf_attribute" = no ; then - cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h -fi -rm -rf conftest* -fi - -INTEL_COMPILER=no - -if test "$GCC" = yes ; then - case $host_os in - linux*|gnu*) - echo "$as_me:3911: 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 3916 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifdef __INTEL_COMPILER -#else -make an error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:3933: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3936: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3939: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:3942: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - INTEL_COMPILER=yes -cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" - -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:3953: result: $INTEL_COMPILER" >&5 -echo "${ECHO_T}$INTEL_COMPILER" >&6 - ;; - esac -fi - -cat > conftest.$ac_ext <&5 -echo "$as_me: checking for $CC warning options..." >&6;} - cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS="-Wall" - for cf_opt in \ - wd1419 \ - wd1683 \ - wd1684 \ - wd193 \ - wd593 \ - wd279 \ - wd810 \ - wd869 \ - wd981 - do - CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:3993: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:3996: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:3998: 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 -then - { echo "$as_me:4007: checking for $CC warning options..." >&5 -echo "$as_me: checking for $CC warning options..." >&6;} - cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS= - cf_warn_CONST="" - test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" - for cf_opt in W Wall \ - Wbad-function-cast \ - Wcast-align \ - Wcast-qual \ - Winline \ - Wmissing-declarations \ - Wmissing-prototypes \ - Wnested-externs \ - Wpointer-arith \ - Wshadow \ - Wstrict-prototypes \ - Wundef $cf_warn_CONST - do - CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4027: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4030: \$? = $ac_status" >&5 - (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4032: result: ... -$cf_opt" >&5 -echo "${ECHO_T}... -$cf_opt" >&6 - case $cf_opt in #(vi - Wcast-qual) #(vi - CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" - ;; - Winline) #(vi - case $GCC_VERSION in - [34].*) - test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 - -echo "${as_me:-configure}:4043: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 - - continue;; - esac - ;; - esac - EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" - fi - done - CFLAGS="$cf_save_CFLAGS" -fi -rm -rf conftest* - -fi -fi - -echo "$as_me:4059: 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. -if test "${with_dmalloc+set}" = set; then - withval="$with_dmalloc" - cat >>confdefs.h <<\EOF -#define USE_DMALLOC 1 -EOF - - : ${with_cflags:=-g} - : ${with_no_leaks:=yes} - with_dmalloc=yes -else - with_dmalloc= -fi; -echo "$as_me:4075: result: ${with_dmalloc:-no}" >&5 -echo "${ECHO_T}${with_dmalloc:-no}" >&6 - -case .$with_cflags in #(vi -.*-g*) - case .$CFLAGS in #(vi - .*-g*) #(vi - ;; - *) - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - ;; - esac - ;; -esac - -if test "$with_dmalloc" = yes ; then - echo "$as_me:4169: 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 4175 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:4179: \"$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:4185: \$? = $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 - ac_cv_header_dmalloc_h=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_dmalloc_h=no -fi -rm -f conftest.err conftest.$ac_ext -fi -echo "$as_me:4204: 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:4208: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldmalloc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 4216 "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 dmalloc_debug (); -int -main () -{ -dmalloc_debug (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4235: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:4238: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4241: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4244: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dmalloc_dmalloc_debug=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_dmalloc_dmalloc_debug=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:4255: 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 <&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. -if test "${with_dbmalloc+set}" = set; then - withval="$with_dbmalloc" - cat >>confdefs.h <<\EOF -#define USE_DBMALLOC 1 -EOF - - : ${with_cflags:=-g} - : ${with_no_leaks:=yes} - with_dbmalloc=yes -else - with_dbmalloc= -fi; -echo "$as_me:4286: result: ${with_dbmalloc:-no}" >&5 -echo "${ECHO_T}${with_dbmalloc:-no}" >&6 - -case .$with_cflags in #(vi -.*-g*) - case .$CFLAGS in #(vi - .*-g*) #(vi - ;; - *) - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - ;; - esac - ;; -esac - -if test "$with_dbmalloc" = yes ; then - echo "$as_me:4380: 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 4386 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:4390: \"$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:4396: \$? = $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 - ac_cv_header_dbmalloc_h=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_dbmalloc_h=no -fi -rm -f conftest.err conftest.$ac_ext -fi -echo "$as_me:4415: 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:4419: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldbmalloc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 4427 "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 debug_malloc (); -int -main () -{ -debug_malloc (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4446: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:4449: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4452: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4455: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dbmalloc_debug_malloc=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_dbmalloc_debug_malloc=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:4466: 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 <&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. -if test "${with_valgrind+set}" = set; then - withval="$with_valgrind" - cat >>confdefs.h <<\EOF -#define USE_VALGRIND 1 -EOF - - : ${with_cflags:=-g} - : ${with_no_leaks:=yes} - with_valgrind=yes -else - with_valgrind= -fi; -echo "$as_me:4497: result: ${with_valgrind:-no}" >&5 -echo "${ECHO_T}${with_valgrind:-no}" >&6 - -case .$with_cflags in #(vi -.*-g*) - case .$CFLAGS in #(vi - .*-g*) #(vi - ;; - *) - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - ;; - esac - ;; -esac - -echo "$as_me:4590: 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. -if test "${enable_leaks+set}" = set; then - enableval="$enable_leaks" - if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi -else - : ${with_no_leaks:=no} -fi; -echo "$as_me:4600: result: $with_no_leaks" >&5 -echo "${ECHO_T}$with_no_leaks" >&6 - -if test "$with_no_leaks" = yes ; then - cat >>confdefs.h <<\EOF -#define NO_LEAKS 1 -EOF - - cat >>confdefs.h <<\EOF -#define YY_NO_LEAKS 1 -EOF - -fi - -echo "$as_me:4614: 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. -if test "${with_curses_dir+set}" = set; then - withval="$with_curses_dir" - cf_cv_curses_dir=$withval -else - cf_cv_curses_dir=no -fi; -echo "$as_me:4624: 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" -else - cf_path_syntax="$ac_default_prefix" -fi - -case ".$withval" in #(vi -.\$\(*\)*|.\'*\'*) #(vi - ;; -..|./*|.\\*) #(vi - ;; -.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX - ;; -.\${*prefix}*) #(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:4655: 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" - then - -if test -n "$cf_cv_curses_dir/include" ; then - for cf_add_incdir in $cf_cv_curses_dir/include - 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat >conftest.$ac_ext <<_ACEOF -#line 4688 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4700: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4703: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4706: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4709: \$? = $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}:4726: 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 - 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 - -echo "${as_me:-configure}:4760: testing adding $cf_add_libdir to library-path ..." 1>&5 - - LDFLAGS="-L$cf_add_libdir $LDFLAGS" - fi - fi - done -fi - - fi -fi - -# Check whether --with-5lib or --without-5lib was given. -if test "${with_5lib+set}" = set; then - withval="$with_5lib" - LIBS="-L/usr/5lib $LIBS" - CPPFLAGS="$CPPFLAGS -I/usr/5include" -fi; - -# Check whether --with-ncursesw or --without-ncursesw was given. -if test "${with_ncursesw+set}" = set; then - withval="$with_ncursesw" - cf_cv_screen=ncursesw -else - -# Check whether --with-ncurses or --without-ncurses was given. -if test "${with_ncurses+set}" = set; then - withval="$with_ncurses" - cf_cv_screen=ncurses -else - -# Check whether --with-pdcurses or --without-pdcurses was given. -if test "${with_pdcurses+set}" = set; then - withval="$with_pdcurses" - cf_cv_screen=pdcurses -fi; -fi; -fi; - -case $cf_cv_screen in -curses) - -echo "$as_me:4801: 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 - test -d /usr/include/curses_colr && \ - cf_cv_curses_incdir="-I/usr/include/curses_colr" - ;; -sunos3*|sunos4*) - test -d /usr/5lib && \ - test -d /usr/5include && \ - cf_cv_curses_incdir="-I/usr/5include" - ;; -esac - -fi -echo "$as_me:4821: 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" - -echo "$as_me:4825: 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 \ - curses.h \ - ncurses.h ncurses/curses.h ncurses/ncurses.h -do -cat >conftest.$ac_ext <<_ACEOF -#line 4837 "configure" -#include "confdefs.h" -#include <${cf_header}> -int -main () -{ -initscr(); tgoto("?", 0,0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4849: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4852: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4855: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4858: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_header=$cf_header; 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:4869: 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:4873: error: No curses header-files found" >&5 -echo "$as_me: error: No curses header-files found" >&2;} - { (exit 1); exit 1; }; } -fi - -# cheat, to get the right #define's for HAVE_NCURSES_H, etc. - -for ac_header in $cf_cv_ncurses_header -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:4883: 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 4889 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:4893: \"$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:4899: \$? = $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:4918: 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 <&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 - 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 4946 "configure" -#include "confdefs.h" -#include -#include <${cf_cv_ncurses_header:-curses.h}> -#include <$cf_test> - -int -main () -{ -int x = auto_left_margin - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4961: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4964: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4967: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4970: \$? = $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:4986: 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) - cat >>confdefs.h <<\EOF -#define HAVE_TERM_H 1 -EOF - - ;; -esac - -case $cf_cv_term_header in # (vi -ncurses/term.h) #(vi - 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 - -echo "$as_me:5015: 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 -else - - cf_cv_ncurses_version=no - cf_tempfile=out$$ - rm -f $cf_tempfile - if test "$cross_compiling" = yes; then - - # This will not work if the preprocessor splits the line after the - # Autoconf token. The 'unproto' program does that. - cat > conftest.$ac_ext < -#undef Autoconf -#ifdef NCURSES_VERSION -Autoconf NCURSES_VERSION -#else -#ifdef __NCURSES_H -Autoconf "old" -#endif -; -#endif -EOF - cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo "$as_me:5041: \"$cf_try\"") >&5 - (eval $cf_try) 2>&5 - ac_status=$? - echo "$as_me:5044: \$? = $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%".*%%'` - test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" - rm -f conftest.out - fi - -else - cat >conftest.$ac_ext <<_ACEOF -#line 5054 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#include -int main() -{ - FILE *fp = fopen("$cf_tempfile", "w"); -#ifdef NCURSES_VERSION -# ifdef NCURSES_VERSION_PATCH - fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); -# else - fprintf(fp, "%s\n", NCURSES_VERSION); -# endif -#else -# ifdef __NCURSES_H - fprintf(fp, "old\n"); -# else - make an error -# endif -#endif - ${cf_cv_main_return:-return}(0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:5079: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5082: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5084: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5087: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_ncurses_version=`cat $cf_tempfile` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - rm -f $cf_tempfile - -fi -echo "$as_me:5101: 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:5107: 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 5110 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr(); tgoto("?", 0,0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5122: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5125: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5128: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5131: \$? = $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 -echo "$as_me:5140: 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:5146: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmytinfo $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 5154 "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 tgoto (); -int -main () -{ -tgoto (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5173: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5176: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5179: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5182: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_mytinfo_tgoto=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_mytinfo_tgoto=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:5193: 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 - LIBS="-lmytinfo $LIBS" -fi - - ;; -hpux10.*) #(vi - echo "$as_me:5201: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcur_colr $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 5209 "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 (); -int -main () -{ -initscr (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5228: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5231: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5234: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5237: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_cur_colr_initscr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_cur_colr_initscr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:5248: 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 - - LIBS="-lcur_colr $LIBS" - ac_cv_func_initscr=yes - -else - - echo "$as_me:5257: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lHcurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 5265 "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 (); -int -main () -{ -initscr (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5284: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5287: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5290: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5293: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Hcurses_initscr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_Hcurses_initscr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:5304: 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. - LIBS="-lHcurses $LIBS" - CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES" - ac_cv_func_initscr=yes - -fi - -fi - - ;; -linux*) - case `arch 2>/dev/null` in - 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 - -echo "${as_me:-configure}:5343: testing adding $cf_add_libdir to library-path ..." 1>&5 - - 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 - -echo "${as_me:-configure}:5372: testing adding $cf_add_libdir to library-path ..." 1>&5 - - 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 - -echo "${as_me:-configure}:5403: testing adding $cf_add_libdir to library-path ..." 1>&5 - - LDFLAGS="-L$cf_add_libdir $LDFLAGS" - fi - fi - done -fi - - ;; - esac - ;; -sunos3*|sunos4*) - 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 - -echo "${as_me:-configure}:5436: testing adding $cf_add_libdir to library-path ..." 1>&5 - - LDFLAGS="-L$cf_add_libdir $LDFLAGS" - fi - fi - done -fi - - LIBS="-lcurses -ltermcap $LIBS" - fi - ac_cv_func_initscr=yes - ;; -esac - -if test ".$ac_cv_func_initscr" != .yes ; then - cf_save_LIBS="$LIBS" - cf_term_lib="" - cf_curs_lib="" - - if test ".${cf_cv_ncurses_version:-no}" != .no - then - cf_check_list="ncurses curses cursesX" - else - cf_check_list="cursesX curses ncurses" - fi - - # Check for library containing tgoto. Do this before curses library - # because it may be needed to link the test-case for initscr. - echo "$as_me:5464: 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 5470 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char tgoto (); below. */ -#include -/* 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 tgoto (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5501: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5504: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5507: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5510: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_tgoto=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_tgoto=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:5520: 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 -else - - for cf_term_lib in $cf_check_list termcap termlib unknown - do - as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh` -echo "$as_me:5529: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$cf_term_lib $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 5537 "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 tgoto (); -int -main () -{ -tgoto (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5556: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5559: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5562: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5565: \$? = $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:5576: 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 - - # Check for library containing initscr - test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" - 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:5591: 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 5599 "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 (); -int -main () -{ -initscr (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5618: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5621: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5624: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5627: \$? = $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:5638: 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 - test $cf_curs_lib = unknown && { { echo "$as_me:5645: error: no curses library found" >&5 -echo "$as_me: error: no curses library found" >&2;} - { (exit 1); exit 1; }; } - - LIBS="-l$cf_curs_lib $cf_save_LIBS" - if test "$cf_term_lib" = unknown ; then - echo "$as_me:5651: 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 5654 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5666: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5669: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5672: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5675: \$? = $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 - echo "$as_me:5684: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - test $cf_result = no && { { echo "$as_me:5686: error: Cannot link curses library" >&5 -echo "$as_me: error: Cannot link curses library" >&2;} - { (exit 1); exit 1; }; } - elif test "$cf_curs_lib" = "$cf_term_lib" ; then - : - elif test "$cf_term_lib" != predefined ; then - echo "$as_me:5692: 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 5695 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr(); tgoto((char *)0, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5707: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5710: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5713: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5716: \$? = $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 -l$cf_term_lib $cf_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line 5725 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5737: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5740: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5743: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5746: \$? = $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=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:5758: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - fi -fi -fi - -echo "$as_me:5764: 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 - -cat >conftest.$ac_ext <<_ACEOF -#line 5771 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#include - -int -main () -{ - - 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:5790: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:5793: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5796: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5799: \$? = $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:5811: 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 - -echo "$as_me:5818: 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 5825 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#include - -int -main () -{ - - MENU *menu; - int y = menu->max_item_width; - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5843: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:5846: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5849: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5852: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_netbsd_menu_h=yes - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_netbsd_menu_h=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:5864: result: $cf_cv_netbsd_menu_h" >&5 -echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6 - -test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF -#define HAVE_NETBSD_MENU_H 1 -EOF - - ;; -ncurses) - -cf_ncuconfig_root=ncurses - -echo "Looking for ${cf_ncuconfig_root}-config" -for ac_prog in ${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:5881: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $NCURSES_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - if $as_executable_p "$ac_dir/$ac_word"; then - ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word" - echo "$as_me:5898: found $ac_dir/$ac_word" >&5 - break -fi -done - - ;; -esac -fi -NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG - -if test -n "$NCURSES_CONFIG"; then - echo "$as_me:5909: result: $NCURSES_CONFIG" >&5 -echo "${ECHO_T}$NCURSES_CONFIG" >&6 -else - echo "$as_me:5912: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$NCURSES_CONFIG" && break -done -test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none" - -if test "$NCURSES_CONFIG" != none ; then - -CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" -LIBS="`$NCURSES_CONFIG --libs` $LIBS" - -# even with config script, some packages use no-override for curses.h - -echo "$as_me:5927: 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/curses.h \ - ncurses/ncurses.h \ - curses.h \ - ncurses.h -do -cat >conftest.$ac_ext <<_ACEOF -#line 5941 "configure" -#include "confdefs.h" -#include <${cf_header}> -int -main () -{ -initscr(); tgoto("?", 0,0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:5953: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:5956: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5959: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5962: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_header=$cf_header; 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:5973: 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:5977: error: No curses header-files found" >&5 -echo "$as_me: error: No curses header-files found" >&2;} - { (exit 1); exit 1; }; } -fi - -# cheat, to get the right #define's for HAVE_NCURSES_H, etc. - -for ac_header in $cf_cv_ncurses_header -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5987: 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 5993 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:5997: \"$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:6003: \$? = $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:6022: 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 <>confdefs.h <<\EOF -#define NCURSES 1 -EOF - -cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - -cat >>confdefs.h <conftest.$ac_ext <<_ACEOF -#line 6075 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6087: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6090: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6093: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6096: \$? = $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}:6113: 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 - fi - done - done -fi - -} - -echo "$as_me:6130: 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 -else - - cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" - ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" - for cf_header in $cf_header_list - do - - cat >conftest.$ac_ext <<_ACEOF -#line 6142 "configure" -#include "confdefs.h" - -#include <$cf_header> -int -main () -{ - -#ifdef NCURSES_VERSION - -printf("%s\n", NCURSES_VERSION); -#else -#ifdef __NCURSES_H -printf("old\n"); -#else - make an error -#endif -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6166: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6169: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6172: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6175: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_h=$cf_header - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_ncurses_h=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - - test "$cf_cv_ncurses_h" != no && break - done - -fi -echo "$as_me:6190: 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:6197: 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 -else - - test -n "$verbose" && echo - -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 #(vi - -I*) - cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` - -test "$cf_header_path" != "NONE" && \ -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/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" - test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" - test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" - test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - - 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 "/usr" != "$prefix" && \ -test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /usr" - test -d /usr/include && cf_search="$cf_search /usr/include" - test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" - test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" - test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" - test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "$prefix" != "NONE" && \ -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/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" - test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" - test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" - test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "/usr/local" != "$prefix" && \ -test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /usr/local" - test -d /usr/local/include && cf_search="$cf_search /usr/local/include" - test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" - test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "/opt" != "$prefix" && \ -test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /opt" - test -d /opt/include && cf_search="$cf_search /opt/include" - test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" - test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "$HOME" != "$prefix" && \ -test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under $HOME" - test -d $HOME/include && cf_search="$cf_search $HOME/include" - test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" - test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" - test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" - test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "$includedir" != NONE && \ -test "$includedir" != "/usr/include" && \ -test -d "$includedir" && { - test -d $includedir && cf_search="$cf_search $includedir" - test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" -} - -test "$oldincludedir" != NONE && \ -test "$oldincludedir" != "/usr/include" && \ -test -d "$oldincludedir" && { - test -d $oldincludedir && cf_search="$cf_search $oldincludedir" - test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" -} - -cf_search="$cf_search $cf_header_path_list" - - test -n "$verbose" && echo search path $cf_search - cf_save2_CPPFLAGS="$CPPFLAGS" - for cf_incdir in $cf_search - do - -if test -n "$cf_incdir" ; then - for cf_add_incdir in $cf_incdir - 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat >conftest.$ac_ext <<_ACEOF -#line 6337 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6349: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6352: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6355: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6358: \$? = $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}:6375: 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 - fi - done - done -fi - - for cf_header in \ - ncurses.h \ - curses.h - do - - cat >conftest.$ac_ext <<_ACEOF -#line 6396 "configure" -#include "confdefs.h" - -#include <$cf_header> -int -main () -{ - -#ifdef NCURSES_VERSION - -printf("%s\n", NCURSES_VERSION); -#else -#ifdef __NCURSES_H -printf("old\n"); -#else - make an error -#endif -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6420: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6423: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6426: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6429: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_h2=$cf_header - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_ncurses_h2=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - - if test "$cf_cv_ncurses_h2" != no ; then - cf_cv_ncurses_h2=$cf_incdir/$cf_header - test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 - break - fi - test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 - done - CPPFLAGS="$cf_save2_CPPFLAGS" - test "$cf_cv_ncurses_h2" != no && break - done - test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6450: error: not found" >&5 -echo "$as_me: error: not found" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:6455: 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%/[^/]*$%%'` - cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` - if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then - cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header - fi - -if test -n "$cf_1st_incdir" ; then - for cf_add_incdir in $cf_1st_incdir - 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat >conftest.$ac_ext <<_ACEOF -#line 6488 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6500: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6503: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6506: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6509: \$? = $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}:6526: 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 - fi - done - done -fi - -fi - -# Set definitions to allow ifdef'ing for ncurses.h - -case $cf_cv_ncurses_header in # (vi -*ncurses.h) - cat >>confdefs.h <<\EOF -#define HAVE_NCURSES_H 1 -EOF - - ;; -esac - -case $cf_cv_ncurses_header in # (vi -ncurses/curses.h|ncurses/ncurses.h) - cat >>confdefs.h <<\EOF -#define HAVE_NCURSES_NCURSES_H 1 -EOF - - ;; -ncursesw/curses.h|ncursesw/ncurses.h) - cat >>confdefs.h <<\EOF -#define HAVE_NCURSESW_NCURSES_H 1 -EOF - - ;; -esac - -echo "$as_me:6569: 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 - 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 6587 "configure" -#include "confdefs.h" -#include -#include <${cf_cv_ncurses_header:-curses.h}> -#include <$cf_test> - -int -main () -{ -int x = auto_left_margin - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6602: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6605: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6608: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6611: \$? = $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:6627: 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) - cat >>confdefs.h <<\EOF -#define HAVE_TERM_H 1 -EOF - - ;; -esac - -case $cf_cv_term_header in # (vi -ncurses/term.h) #(vi - 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 - -# some applications need this, but should check for NCURSES_VERSION -cat >>confdefs.h <<\EOF -#define NCURSES 1 -EOF - -echo "$as_me:6661: 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 -else - - cf_cv_ncurses_version=no - cf_tempfile=out$$ - rm -f $cf_tempfile - if test "$cross_compiling" = yes; then - - # This will not work if the preprocessor splits the line after the - # Autoconf token. The 'unproto' program does that. - cat > conftest.$ac_ext < -#undef Autoconf -#ifdef NCURSES_VERSION -Autoconf NCURSES_VERSION -#else -#ifdef __NCURSES_H -Autoconf "old" -#endif -; -#endif -EOF - cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo "$as_me:6687: \"$cf_try\"") >&5 - (eval $cf_try) 2>&5 - ac_status=$? - echo "$as_me:6690: \$? = $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%".*%%'` - test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" - rm -f conftest.out - fi - -else - cat >conftest.$ac_ext <<_ACEOF -#line 6700 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#include -int main() -{ - FILE *fp = fopen("$cf_tempfile", "w"); -#ifdef NCURSES_VERSION -# ifdef NCURSES_VERSION_PATCH - fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); -# else - fprintf(fp, "%s\n", NCURSES_VERSION); -# endif -#else -# ifdef __NCURSES_H - fprintf(fp, "old\n"); -# else - make an error -# endif -#endif - ${cf_cv_main_return:-return}(0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:6725: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:6728: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6730: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6733: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_ncurses_version=`cat $cf_tempfile` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - rm -f $cf_tempfile - -fi -echo "$as_me:6747: 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 - # 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:6759: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgpm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 6767 "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 Gpm_Open (); -int -main () -{ -Gpm_Open (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6786: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:6789: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6792: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6795: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gpm_Gpm_Open=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_gpm_Gpm_Open=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:6806: 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:6809: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgpm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 6817 "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 (); -int -main () -{ -initscr (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6836: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:6839: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6842: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6845: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gpm_initscr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_gpm_initscr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:6856: 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" -else - cf_ncurses_LIBS="-lgpm" -fi - -fi - -case $host_os in #(vi -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:6871: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmytinfo $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 6879 "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 tgoto (); -int -main () -{ -tgoto (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6898: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:6901: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6904: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6907: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_mytinfo_tgoto=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_mytinfo_tgoto=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:6918: 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" -fi - - fi - ;; -esac - -LIBS="$cf_ncurses_LIBS $LIBS" - -if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) -then - LIBS="-l$cf_nculib_root $LIBS" -else - - eval 'cf_cv_have_lib_'$cf_nculib_root'=no' - cf_libdir="" - echo "$as_me:6937: 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 6943 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char initscr (); below. */ -#include -/* 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 (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6974: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:6977: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6980: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6983: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_initscr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_initscr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:6993: 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:7000: 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 7004 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7016: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7019: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7022: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7025: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:7027: 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:7034: result: no" >&5 -echo "${ECHO_T}no" >&6 - -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$,,'` - -test "$cf_library_path" != "NONE" && \ -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/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" - test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" - test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" - test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" -} - - cf_library_path_list="$cf_library_path_list $cf_search" - ;; - esac - done -fi - -cf_search= - -test "/usr" != "$prefix" && \ -test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /usr" - test -d /usr/lib && cf_search="$cf_search /usr/lib" - test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" - test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" - test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" - test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "$prefix" != "NONE" && \ -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/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" - test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" - test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" - test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "/usr/local" != "$prefix" && \ -test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" - test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" - test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" - test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "/opt" != "$prefix" && \ -test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /opt" - test -d /opt/lib && cf_search="$cf_search /opt/lib" - test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" - test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "$HOME" != "$prefix" && \ -test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under $HOME" - test -d $HOME/lib && cf_search="$cf_search $HOME/lib" - test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" - test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" - test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" - test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" -} - -cf_search="$cf_library_path_list $cf_search" - - for cf_libdir in $cf_search - do - echo "$as_me:7124: 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 7128 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7140: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7143: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7146: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7149: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:7151: 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:7158: result: no" >&5 -echo "${ECHO_T}no" >&6 - LIBS="$cf_save_LIBS" -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 - -eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root - -if test $cf_found_library = no ; then - { { echo "$as_me:7173: error: Cannot link $cf_nculib_root library" >&5 -echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - -if test -n "$cf_ncurses_LIBS" ; then - echo "$as_me:7181: 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 - q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` - if test "$q" != "$LIBS" ; then - LIBS="$q" - fi - done - cat >conftest.$ac_ext <<_ACEOF -#line 7191 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -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:7203: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7206: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7209: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7212: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:7214: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -echo "$as_me:7219: result: no" >&5 -echo "${ECHO_T}no" >&6 - LIBS="$cf_ncurses_SAVE" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi - -cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - -cat >>confdefs.h <&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 7246 "configure" -#include "confdefs.h" - -#include -int -main () -{ -putwc(0,0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7259: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7262: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7265: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7268: \$? = $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}:7280: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 - -cf_save_LIBS="$LIBS" - -cat >conftest.$ac_ext <<_ACEOF -#line 7285 "configure" -#include "confdefs.h" - -#include -int -main () -{ -putwc(0,0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7298: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7301: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7304: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7307: \$? = $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 7321 "configure" -#include "confdefs.h" - -#include -int -main () -{ -putwc(0,0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7334: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7337: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7340: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7343: \$? = $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}:7360: testing find linkage for utf8 library ..." 1>&5 - -echo "${as_me:-configure}:7362: 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 #(vi - -I*) - cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` - -test "$cf_header_path" != "NONE" && \ -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 "/usr" != "$prefix" && \ -test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /usr" - test -d /usr/include && cf_search="$cf_search /usr/include" - test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" - test -d /usr/include/utf8/include && cf_search="$cf_search /usr/include/utf8/include" - test -d /usr/utf8/include && cf_search="$cf_search /usr/utf8/include" - test -d /usr/utf8/include/utf8 && cf_search="$cf_search /usr/utf8/include/utf8" -} - -test "$prefix" != "NONE" && \ -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 "/usr/local" != "$prefix" && \ -test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /usr/local" - test -d /usr/local/include && cf_search="$cf_search /usr/local/include" - test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" - test -d /usr/local/include/utf8/include && cf_search="$cf_search /usr/local/include/utf8/include" - test -d /usr/local/utf8/include && cf_search="$cf_search /usr/local/utf8/include" - test -d /usr/local/utf8/include/utf8 && cf_search="$cf_search /usr/local/utf8/include/utf8" -} - -test "/opt" != "$prefix" && \ -test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /opt" - test -d /opt/include && cf_search="$cf_search /opt/include" - test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" - test -d /opt/include/utf8/include && cf_search="$cf_search /opt/include/utf8/include" - test -d /opt/utf8/include && cf_search="$cf_search /opt/utf8/include" - test -d /opt/utf8/include/utf8 && cf_search="$cf_search /opt/utf8/include/utf8" -} - -test "$HOME" != "$prefix" && \ -test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under $HOME" - test -d $HOME/include && cf_search="$cf_search $HOME/include" - test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" - test -d $HOME/include/utf8/include && cf_search="$cf_search $HOME/include/utf8/include" - test -d $HOME/utf8/include && cf_search="$cf_search $HOME/utf8/include" - test -d $HOME/utf8/include/utf8 && cf_search="$cf_search $HOME/utf8/include/utf8" -} - -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}:7475: 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 7479 "configure" -#include "confdefs.h" - -#include -int -main () -{ -putwc(0,0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7492: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7495: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7498: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7501: \$? = $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}:7506: 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}:7524: 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$,,'` - -test "$cf_library_path" != "NONE" && \ -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 "/usr" != "$prefix" && \ -test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /usr" - test -d /usr/lib && cf_search="$cf_search /usr/lib" - test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" - test -d /usr/lib/utf8/lib && cf_search="$cf_search /usr/lib/utf8/lib" - test -d /usr/utf8/lib && cf_search="$cf_search /usr/utf8/lib" - test -d /usr/utf8/lib/utf8 && cf_search="$cf_search /usr/utf8/lib/utf8" -} - -test "$prefix" != "NONE" && \ -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" -} - -test "/usr/local" != "$prefix" && \ -test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" - test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" - test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" - test -d /usr/local/lib/utf8/lib && cf_search="$cf_search /usr/local/lib/utf8/lib" - test -d /usr/local/utf8/lib && cf_search="$cf_search /usr/local/utf8/lib" - test -d /usr/local/utf8/lib/utf8 && cf_search="$cf_search /usr/local/utf8/lib/utf8" -} - -test "/opt" != "$prefix" && \ -test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /opt" - test -d /opt/lib && cf_search="$cf_search /opt/lib" - test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" - test -d /opt/lib/utf8/lib && cf_search="$cf_search /opt/lib/utf8/lib" - test -d /opt/utf8/lib && cf_search="$cf_search /opt/utf8/lib" - test -d /opt/utf8/lib/utf8 && cf_search="$cf_search /opt/utf8/lib/utf8" -} - -test "$HOME" != "$prefix" && \ -test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under $HOME" - test -d $HOME/lib && cf_search="$cf_search $HOME/lib" - test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" - test -d $HOME/lib/utf8/lib && cf_search="$cf_search $HOME/lib/utf8/lib" - test -d $HOME/utf8/lib && cf_search="$cf_search $HOME/utf8/lib" - test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" -} - -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}:7621: 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 7627 "configure" -#include "confdefs.h" - -#include -int -main () -{ -putwc(0,0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7640: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:7643: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7646: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7649: \$? = $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}:7654: 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 - - 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 - -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:7696: 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat >conftest.$ac_ext <<_ACEOF -#line 7730 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7742: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7745: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7748: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7751: \$? = $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}:7768: 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 - 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}:7802: testing adding $cf_add_libdir to library-path ..." 1>&5 - - LDFLAGS="-L$cf_add_libdir $LDFLAGS" - fi - fi - done -fi - - LIBS="$cf_cv_library_file_utf8 $LIBS" -fi - -cf_ncuconfig_root=ncursesw - -echo "Looking for ${cf_ncuconfig_root}-config" -for ac_prog in ${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:7820: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_NCURSES_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $NCURSES_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - if $as_executable_p "$ac_dir/$ac_word"; then - ac_cv_path_NCURSES_CONFIG="$ac_dir/$ac_word" - echo "$as_me:7837: found $ac_dir/$ac_word" >&5 - break -fi -done - - ;; -esac -fi -NCURSES_CONFIG=$ac_cv_path_NCURSES_CONFIG - -if test -n "$NCURSES_CONFIG"; then - echo "$as_me:7848: result: $NCURSES_CONFIG" >&5 -echo "${ECHO_T}$NCURSES_CONFIG" >&6 -else - echo "$as_me:7851: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$NCURSES_CONFIG" && break -done -test -n "$NCURSES_CONFIG" || NCURSES_CONFIG="none" - -if test "$NCURSES_CONFIG" != none ; then - -CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" -LIBS="`$NCURSES_CONFIG --libs` $LIBS" - -# even with config script, some packages use no-override for curses.h - -echo "$as_me:7866: 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/curses.h \ - ncursesw/ncurses.h \ - curses.h \ - ncurses.h -do -cat >conftest.$ac_ext <<_ACEOF -#line 7880 "configure" -#include "confdefs.h" -#include <${cf_header}> -int -main () -{ -initscr(); tgoto("?", 0,0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:7892: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:7895: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7898: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:7901: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_header=$cf_header; 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:7912: 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:7916: error: No curses header-files found" >&5 -echo "$as_me: error: No curses header-files found" >&2;} - { (exit 1); exit 1; }; } -fi - -# cheat, to get the right #define's for HAVE_NCURSES_H, etc. - -for ac_header in $cf_cv_ncurses_header -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:7926: 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 7932 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:7936: \"$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:7942: \$? = $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:7961: 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 <>confdefs.h <<\EOF -#define NCURSES 1 -EOF - -cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - -cat >>confdefs.h <conftest.$ac_ext <<_ACEOF -#line 8014 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:8026: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:8029: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8032: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8035: \$? = $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}:8052: 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 - fi - done - done -fi - -} - -echo "$as_me:8069: 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 -else - - cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" - ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" - for cf_header in $cf_header_list - do - - cat >conftest.$ac_ext <<_ACEOF -#line 8081 "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 () -{ - -#ifdef NCURSES_VERSION - -#ifndef WACS_BSSB - make an error -#endif - -printf("%s\n", NCURSES_VERSION); -#else -#ifdef __NCURSES_H -printf("old\n"); -#else - make an error -#endif -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:8113: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:8116: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8119: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8122: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_h=$cf_header - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_ncurses_h=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - - test "$cf_cv_ncurses_h" != no && break - done - -fi -echo "$as_me:8137: 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:8144: 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 -else - - test -n "$verbose" && echo - -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 #(vi - -I*) - cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` - -test "$cf_header_path" != "NONE" && \ -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/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" - test -d $cf_header_path/include/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" - test -d $cf_header_path/$cf_ncuhdr_root/include && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" - test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - - 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 "/usr" != "$prefix" && \ -test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /usr" - test -d /usr/include && cf_search="$cf_search /usr/include" - test -d /usr/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/include/$cf_ncuhdr_root" - test -d /usr/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include" - test -d /usr/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/$cf_ncuhdr_root/include" - test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "$prefix" != "NONE" && \ -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/$cf_ncuhdr_root && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" - test -d $prefix/include/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" - test -d $prefix/$cf_ncuhdr_root/include && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" - test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "/usr/local" != "$prefix" && \ -test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /usr/local" - test -d /usr/local/include && cf_search="$cf_search /usr/local/include" - test -d /usr/local/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root" - test -d /usr/local/include/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include" - test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "/opt" != "$prefix" && \ -test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under /opt" - test -d /opt/include && cf_search="$cf_search /opt/include" - test -d /opt/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/include/$cf_ncuhdr_root" - test -d /opt/include/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include && cf_search="$cf_search /opt/$cf_ncuhdr_root/include" - test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "$HOME" != "$prefix" && \ -test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { - test -n "$verbose" && echo " ... testing for include-directories under $HOME" - test -d $HOME/include && cf_search="$cf_search $HOME/include" - test -d $HOME/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root" - test -d $HOME/include/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include" - test -d $HOME/$cf_ncuhdr_root/include && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include" - test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root && cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root" -} - -test "$includedir" != NONE && \ -test "$includedir" != "/usr/include" && \ -test -d "$includedir" && { - test -d $includedir && cf_search="$cf_search $includedir" - test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root" -} - -test "$oldincludedir" != NONE && \ -test "$oldincludedir" != "/usr/include" && \ -test -d "$oldincludedir" && { - test -d $oldincludedir && cf_search="$cf_search $oldincludedir" - test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" -} - -cf_search="$cf_search $cf_header_path_list" - - test -n "$verbose" && echo search path $cf_search - cf_save2_CPPFLAGS="$CPPFLAGS" - for cf_incdir in $cf_search - do - -if test -n "$cf_incdir" ; then - for cf_add_incdir in $cf_incdir - 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat >conftest.$ac_ext <<_ACEOF -#line 8284 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:8296: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:8299: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8302: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8305: \$? = $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}:8322: 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 - fi - done - done -fi - - for cf_header in \ - ncurses.h \ - curses.h - do - - cat >conftest.$ac_ext <<_ACEOF -#line 8343 "configure" -#include "confdefs.h" - -#include <$cf_header> -int -main () -{ - -#ifdef NCURSES_VERSION - -printf("%s\n", NCURSES_VERSION); -#else -#ifdef __NCURSES_H -printf("old\n"); -#else - make an error -#endif -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:8367: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:8370: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8373: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8376: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_h2=$cf_header - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_ncurses_h2=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - - if test "$cf_cv_ncurses_h2" != no ; then - cf_cv_ncurses_h2=$cf_incdir/$cf_header - test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&6 - break - fi - test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 - done - CPPFLAGS="$cf_save2_CPPFLAGS" - test "$cf_cv_ncurses_h2" != no && break - done - test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8397: error: not found" >&5 -echo "$as_me: error: not found" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:8402: 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%/[^/]*$%%'` - cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` - if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then - cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header - fi - -if test -n "$cf_1st_incdir" ; then - for cf_add_incdir in $cf_1st_incdir - 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 - CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cat >conftest.$ac_ext <<_ACEOF -#line 8435 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:8447: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:8450: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8453: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8456: \$? = $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}:8473: 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 - fi - done - done -fi - -fi - -# Set definitions to allow ifdef'ing for ncurses.h - -case $cf_cv_ncurses_header in # (vi -*ncurses.h) - cat >>confdefs.h <<\EOF -#define HAVE_NCURSES_H 1 -EOF - - ;; -esac - -case $cf_cv_ncurses_header in # (vi -ncurses/curses.h|ncurses/ncurses.h) - cat >>confdefs.h <<\EOF -#define HAVE_NCURSES_NCURSES_H 1 -EOF - - ;; -ncursesw/curses.h|ncursesw/ncurses.h) - cat >>confdefs.h <<\EOF -#define HAVE_NCURSESW_NCURSES_H 1 -EOF - - ;; -esac - -echo "$as_me:8516: 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 - 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 8534 "configure" -#include "confdefs.h" -#include -#include <${cf_cv_ncurses_header:-curses.h}> -#include <$cf_test> - -int -main () -{ -int x = auto_left_margin - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:8549: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:8552: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8555: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8558: \$? = $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:8574: 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) - cat >>confdefs.h <<\EOF -#define HAVE_TERM_H 1 -EOF - - ;; -esac - -case $cf_cv_term_header in # (vi -ncurses/term.h) #(vi - 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 - -# some applications need this, but should check for NCURSES_VERSION -cat >>confdefs.h <<\EOF -#define NCURSES 1 -EOF - -echo "$as_me:8608: 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 -else - - cf_cv_ncurses_version=no - cf_tempfile=out$$ - rm -f $cf_tempfile - if test "$cross_compiling" = yes; then - - # This will not work if the preprocessor splits the line after the - # Autoconf token. The 'unproto' program does that. - cat > conftest.$ac_ext < -#undef Autoconf -#ifdef NCURSES_VERSION -Autoconf NCURSES_VERSION -#else -#ifdef __NCURSES_H -Autoconf "old" -#endif -; -#endif -EOF - cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" - { (eval echo "$as_me:8634: \"$cf_try\"") >&5 - (eval $cf_try) 2>&5 - ac_status=$? - echo "$as_me:8637: \$? = $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%".*%%'` - test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" - rm -f conftest.out - fi - -else - cat >conftest.$ac_ext <<_ACEOF -#line 8647 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#include -int main() -{ - FILE *fp = fopen("$cf_tempfile", "w"); -#ifdef NCURSES_VERSION -# ifdef NCURSES_VERSION_PATCH - fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); -# else - fprintf(fp, "%s\n", NCURSES_VERSION); -# endif -#else -# ifdef __NCURSES_H - fprintf(fp, "old\n"); -# else - make an error -# endif -#endif - ${cf_cv_main_return:-return}(0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:8672: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8675: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:8677: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8680: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_ncurses_version=`cat $cf_tempfile` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - rm -f $cf_tempfile - -fi -echo "$as_me:8694: 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 - # 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:8706: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgpm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8714 "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 Gpm_Open (); -int -main () -{ -Gpm_Open (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8733: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8736: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8739: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8742: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gpm_Gpm_Open=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_gpm_Gpm_Open=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:8753: 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:8756: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgpm $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8764 "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 (); -int -main () -{ -initscr (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8783: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8786: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8789: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8792: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gpm_initscr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_gpm_initscr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:8803: 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" -else - cf_ncurses_LIBS="-lgpm" -fi - -fi - -case $host_os in #(vi -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:8818: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lmytinfo $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 8826 "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 tgoto (); -int -main () -{ -tgoto (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8845: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8848: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8851: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8854: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_mytinfo_tgoto=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_mytinfo_tgoto=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:8865: 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" -fi - - fi - ;; -esac - -LIBS="$cf_ncurses_LIBS $LIBS" - -if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) -then - LIBS="-l$cf_nculib_root $LIBS" -else - - eval 'cf_cv_have_lib_'$cf_nculib_root'=no' - cf_libdir="" - echo "$as_me:8884: 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 8890 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char initscr (); below. */ -#include -/* 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 (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8921: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8924: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8927: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8930: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_initscr=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_initscr=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:8940: 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:8947: 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 8951 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8963: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:8966: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8969: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:8972: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:8974: 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:8981: result: no" >&5 -echo "${ECHO_T}no" >&6 - -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$,,'` - -test "$cf_library_path" != "NONE" && \ -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/$cf_nculib_root && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" - test -d $cf_library_path/lib/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" - test -d $cf_library_path/$cf_nculib_root/lib && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" - test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" -} - - cf_library_path_list="$cf_library_path_list $cf_search" - ;; - esac - done -fi - -cf_search= - -test "/usr" != "$prefix" && \ -test -d "/usr" && \ -(test $prefix = NONE || test "/usr" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /usr" - test -d /usr/lib && cf_search="$cf_search /usr/lib" - test -d /usr/lib/$cf_nculib_root && cf_search="$cf_search /usr/lib/$cf_nculib_root" - test -d /usr/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/lib/$cf_nculib_root/lib" - test -d /usr/$cf_nculib_root/lib && cf_search="$cf_search /usr/$cf_nculib_root/lib" - test -d /usr/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "$prefix" != "NONE" && \ -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/$cf_nculib_root && cf_search="$cf_search $prefix/lib/$cf_nculib_root" - test -d $prefix/lib/$cf_nculib_root/lib && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" - test -d $prefix/$cf_nculib_root/lib && cf_search="$cf_search $prefix/$cf_nculib_root/lib" - test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "/usr/local" != "$prefix" && \ -test -d "/usr/local" && \ -(test $prefix = NONE || test "/usr/local" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" - test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" - test -d /usr/local/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/lib/$cf_nculib_root" - test -d /usr/local/lib/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib && cf_search="$cf_search /usr/local/$cf_nculib_root/lib" - test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "/opt" != "$prefix" && \ -test -d "/opt" && \ -(test $prefix = NONE || test "/opt" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under /opt" - test -d /opt/lib && cf_search="$cf_search /opt/lib" - test -d /opt/lib/$cf_nculib_root && cf_search="$cf_search /opt/lib/$cf_nculib_root" - test -d /opt/lib/$cf_nculib_root/lib && cf_search="$cf_search /opt/lib/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib && cf_search="$cf_search /opt/$cf_nculib_root/lib" - test -d /opt/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root" -} - -test "$HOME" != "$prefix" && \ -test -d "$HOME" && \ -(test $prefix = NONE || test "$HOME" != "$prefix") && { - test -n "$verbose" && echo " ... testing for lib-directories under $HOME" - test -d $HOME/lib && cf_search="$cf_search $HOME/lib" - test -d $HOME/lib/$cf_nculib_root && cf_search="$cf_search $HOME/lib/$cf_nculib_root" - test -d $HOME/lib/$cf_nculib_root/lib && cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib" - test -d $HOME/$cf_nculib_root/lib && cf_search="$cf_search $HOME/$cf_nculib_root/lib" - test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root && cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root" -} - -cf_search="$cf_library_path_list $cf_search" - - for cf_libdir in $cf_search - do - echo "$as_me:9071: 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 9075 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -initscr() - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9087: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9090: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9093: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9096: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:9098: 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:9105: result: no" >&5 -echo "${ECHO_T}no" >&6 - LIBS="$cf_save_LIBS" -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 - -eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root - -if test $cf_found_library = no ; then - { { echo "$as_me:9120: error: Cannot link $cf_nculib_root library" >&5 -echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - -if test -n "$cf_ncurses_LIBS" ; then - echo "$as_me:9128: 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 - q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` - if test "$q" != "$LIBS" ; then - LIBS="$q" - fi - done - cat >conftest.$ac_ext <<_ACEOF -#line 9138 "configure" -#include "confdefs.h" -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -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:9150: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9153: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9156: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9159: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:9161: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -echo "$as_me:9166: result: no" >&5 -echo "${ECHO_T}no" >&6 - LIBS="$cf_ncurses_SAVE" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi - -cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - -cat >>confdefs.h <&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. -if test "${with_pkg_config+set}" = set; then - withval="$with_pkg_config" - cf_pkg_config=$withval -else - cf_pkg_config=yes -fi; -echo "$as_me:9194: result: $cf_pkg_config" >&5 -echo "${ECHO_T}$cf_pkg_config" >&6 - -case $cf_pkg_config in #(vi -no) #(vi - PKG_CONFIG=none - ;; -yes) #(vi - 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:9205: 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 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:9222: found $ac_dir/$ac_word" >&5 - break -fi -done - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG - -if test -n "$PKG_CONFIG"; then - echo "$as_me:9233: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 -else - echo "$as_me:9236: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -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:9245: 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 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - 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:9262: found $ac_dir/$ac_word" >&5 - break -fi -done - - test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG - -if test -n "$ac_pt_PKG_CONFIG"; then - echo "$as_me:9274: result: $ac_pt_PKG_CONFIG" >&5 -echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 -else - echo "$as_me:9277: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - PKG_CONFIG=$ac_pt_PKG_CONFIG -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - - ;; -*) - PKG_CONFIG=$withval - ;; -esac - -test -z "$PKG_CONFIG" && PKG_CONFIG=none -if test "$PKG_CONFIG" != none ; then - -if test "x$prefix" != xNONE; then - cf_path_syntax="$prefix" -else - cf_path_syntax="$ac_default_prefix" -fi - -case ".$PKG_CONFIG" in #(vi -.\$\(*\)*|.\'*\'*) #(vi - ;; -..|./*|.\\*) #(vi - ;; -.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX - ;; -.\${*prefix}*) #(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:9320: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 -echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} - { (exit 1); exit 1; }; } - ;; -esac - -fi - -echo "$as_me:9328: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6 - -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" - -fi; -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled -else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else - if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=no ac_x_libraries=no -rm -fr conftest.dir -if mkdir conftest.dir; then - cd conftest.dir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat >Imakefile <<'EOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib dll; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in - /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; - esac - case $ac_im_usrlibdir in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; - esac - fi - cd .. - rm -fr conftest.dir -fi - -# Standard set of common directories for X headers. -# Check X11 before X11Rn because it is often a symlink to the current release. -ac_x_header_dirs=' -/usr/X11/include -/usr/X11R6/include -/usr/X11R5/include -/usr/X11R4/include - -/usr/include/X11 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 - -/usr/local/X11/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include - -/usr/local/include/X11 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 - -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 - -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include - -/usr/openwin/include -/usr/openwin/share/include' - -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 9425 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:9429: \"$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:9435: \$? = $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 - # We can compile using X headers with no special include directory. -ac_x_includes= -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then - ac_x_includes=$ac_dir - break - fi -done -fi -rm -f conftest.err conftest.$ac_ext -fi # $ac_x_includes = no - -if test "$ac_x_libraries" = no; then - # Check for the libraries. - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" - cat >conftest.$ac_ext <<_ACEOF -#line 9468 "configure" -#include "confdefs.h" -#include -int -main () -{ -XtMalloc (0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9480: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9483: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9486: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9489: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - LIBS=$ac_save_LIBS -# We can link X programs with no special library path. -ac_x_libraries= -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -LIBS=$ac_save_LIBS -for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` -do - # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib dll; do - if test -r $ac_dir/libXt.$ac_extension; then - ac_x_libraries=$ac_dir - break 2 - fi - done -done -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi # $ac_x_libraries = no - -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi -fi - - fi - eval "$ac_cv_have_x" -fi # $with_x != no - -if test "$have_x" != yes; then - echo "$as_me:9527: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6 - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # 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:9537: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 -fi - -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - -cat >>confdefs.h <<\EOF -#define X_DISPLAY_MISSING 1 -EOF - - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi - - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - echo "$as_me:9561: 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 9565 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9577: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9580: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9583: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9586: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_nospace=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -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:9596: 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 9602 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9614: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9617: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9620: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9623: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_space=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -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:9633: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$as_me:9637: result: neither works" >&5 -echo "${ECHO_T}neither works" >&6 - fi - fi - LIBS=$ac_xsave_LIBS - esac - fi - - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says - # the Alpha needs dnet_stub (dnet does not exist). - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat >conftest.$ac_ext <<_ACEOF -#line 9657 "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 XOpenDisplay (); -int -main () -{ -XOpenDisplay (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9676: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9679: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9682: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9685: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -echo "$as_me:9691: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 9699 "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 dnet_ntoa (); -int -main () -{ -dnet_ntoa (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9718: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9721: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9724: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9727: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dnet_dnet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_dnet_dnet_ntoa=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:9738: 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:9745: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet_stub $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 9753 "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 dnet_ntoa (); -int -main () -{ -dnet_ntoa (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9772: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9775: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9778: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9781: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_dnet_stub_dnet_ntoa=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:9792: 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" -fi - - fi -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_xsave_LIBS" - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # The nsl library prevents programs from opening the X display - # 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:9811: 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 9817 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. */ -#include -/* 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 gethostbyname (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9848: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9851: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9854: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9857: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_gethostbyname=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:9867: 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:9871: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 9879 "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 gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9898: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9901: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9904: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9907: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_nsl_gethostbyname=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:9918: 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:9925: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 9933 "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 gethostbyname (); -int -main () -{ -gethostbyname (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9952: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:9955: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9958: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:9961: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bsd_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_bsd_gethostbyname=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:9972: 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" -fi - - fi - fi - - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says Simon Leinen: it contains gethostby* - # 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:9988: 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 9994 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. */ -#include -/* 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 connect (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10025: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10028: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10031: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10034: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_connect=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:10044: 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:10048: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10056 "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 connect (); -int -main () -{ -connect (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10075: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10078: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10081: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10084: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_connect=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_socket_connect=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:10095: 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" -fi - - fi - - # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:10104: 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 10110 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove (); below. */ -#include -/* 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 remove (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10141: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10144: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10147: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10150: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_remove=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_remove=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:10160: 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:10164: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10172 "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 remove (); -int -main () -{ -remove (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10191: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10194: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10197: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10200: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_posix_remove=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_posix_remove=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:10211: 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" -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:10220: 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 10226 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat (); below. */ -#include -/* 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 shmat (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10257: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10260: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10263: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10266: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shmat=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_shmat=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:10276: 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:10280: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lipc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10288 "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 shmat (); -int -main () -{ -shmat (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10307: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10310: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10313: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10316: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ipc_shmat=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_ipc_shmat=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:10327: 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" -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS=$LDFLAGS - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # 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:10345: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10353 "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 IceConnectionNumber (); -int -main () -{ -IceConnectionNumber (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10372: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10375: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10378: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10381: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ICE_IceConnectionNumber=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_ICE_IceConnectionNumber=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:10392: 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" -fi - - LDFLAGS=$ac_save_LDFLAGS - -fi - -cf_x_athena=${cf_x_athena:-Xaw} - -echo "$as_me:10404: 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= - -# Check whether --with-Xaw3d or --without-Xaw3d was given. -if test "${with_Xaw3d+set}" = set; then - withval="$with_Xaw3d" - -fi; -if test "$withval" = yes ; then - cf_x_athena=Xaw3d - echo "$as_me:10415: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:10418: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -echo "$as_me:10422: 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= - -# Check whether --with-neXtaw or --without-neXtaw was given. -if test "${with_neXtaw+set}" = set; then - withval="$with_neXtaw" - -fi; -if test "$withval" = yes ; then - cf_x_athena=neXtaw - echo "$as_me:10433: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:10436: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -echo "$as_me:10440: 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= - -# Check whether --with-XawPlus or --without-XawPlus was given. -if test "${with_XawPlus+set}" = set; then - withval="$with_XawPlus" - -fi; -if test "$withval" = yes ; then - cf_x_athena=XawPlus - echo "$as_me:10451: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -else - echo "$as_me:10454: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -cf_x_athena_lib="" - -if test "$PKG_CONFIG" != none ; then - cf_athena_list= - test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6" - for cf_athena_pkg in \ - $cf_athena_list \ - ${cf_x_athena} \ - ${cf_x_athena}-devel \ - lib${cf_x_athena} \ - lib${cf_x_athena}-devel - do - -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}:10474: 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}:10480: 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}:10484: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - - cf_x_athena_lib="$cf_pkgconfig_libs" - -cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <&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 10581 "configure" -#include "confdefs.h" - -#include - -int -main () -{ - -int check = XmuCompareISOLatin1("big", "small") - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10597: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10600: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10603: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10606: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_xaw_compat=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_xaw_compat=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:10616: 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 - ;; - *) - test -n "$verbose" && echo " work around broken package" 1>&6 - -echo "${as_me:-configure}:10628: 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}:10633: 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}:10639: 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}:10643: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - : -else - -test -n "$verbose" && echo " ...before $LIBS" 1>&6 - -echo "${as_me:-configure}:10729: testing ...before $LIBS ..." 1>&5 - -LIBS=`echo "$LIBS" | sed -e "s/[ ][ ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/ / /g'` -test -n "$verbose" && echo " ...after $LIBS" 1>&6 - -echo "${as_me:-configure}:10734: testing ...after $LIBS ..." 1>&5 - -fi - - ;; - esac - fi - - break -else - : -fi - - done -fi - -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}:10755: 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}:10761: 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}:10765: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - : -else - - echo "$as_me:10849: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXext $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 10857 "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 XextCreateExtension (); -int -main () -{ -XextCreateExtension (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10876: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:10879: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10882: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:10885: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Xext_XextCreateExtension=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_Xext_XextCreateExtension=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:10896: 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 - LIBS="-lXext $LIBS" -fi - -fi - -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}:10909: 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}:10915: 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}:10919: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - - case "x$LIBS" in #(vi - *-lX11*) #(vi - ;; - *) -# we have an "xt" package, but it may omit Xt's dependency on X11 -echo "$as_me:11006: 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 11013 "configure" -#include "confdefs.h" - -#include - -int -main () -{ - - int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0); - int rc2 = XClearWindow((Display*) 0, (Window) 0); - int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0); - int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11032: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11035: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11038: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11041: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_xt_x11_compat=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_xt_x11_compat=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:11051: 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}:11057: 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}:11064: 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}:11070: 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}:11074: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - : -else - -test -n "$verbose" && echo " ...before $LIBS" 1>&6 - -echo "${as_me:-configure}:11160: 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}:11165: testing ...after $LIBS ..." 1>&5 - -fi - - fi - ;; - esac - -echo "$as_me:11173: 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 11180 "configure" -#include "confdefs.h" - -#include - -int -main () -{ -int num = IceConnectionNumber(0) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11195: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11198: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11201: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11204: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_xt_ice_compat=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_xt_ice_compat=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:11214: 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 - ;; - *) - test -n "$verbose" && echo " work around broken ICE dependency" 1>&6 - -echo "${as_me:-configure}:11228: 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}:11233: 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}:11239: 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}:11243: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - -if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then - test -n "$verbose" && echo " found package sm" 1>&6 - -echo "${as_me:-configure}:11328: 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}:11334: 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}:11338: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5 - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - - CFLAGS="$CFLAGS $cf_new_cflags" -fi - -if test -n "$cf_new_cppflags" ; then - - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" -fi - -if test -n "$cf_new_extra_cppflags" ; then - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - - LIBS="$cf_pkgconfig_libs $LIBS" - : -else - : -fi - -else - -test -n "$verbose" && echo " ...before $LIBS" 1>&6 - -echo "${as_me:-configure}:11428: 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}:11433: testing ...after $LIBS ..." 1>&5 - -fi - - ;; - esac - ;; - esac - fi - - cf_have_X_LIBS=yes - -else - - LDFLAGS="$X_LIBS $LDFLAGS" - -test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 - -echo "${as_me:-configure}:11451: testing checking additions to CFLAGS ..." 1>&5 - -cf_check_cflags="$CFLAGS" -cf_check_cppflags="$CPPFLAGS" - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 - -echo "${as_me:-configure}:11522: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 - - 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}:11530: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 - - 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}:11538: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -if test "$cf_check_cflags" != "$CFLAGS" ; then -cat >conftest.$ac_ext <<_ACEOF -#line 11545 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello world"); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11557: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11560: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11563: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11566: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 - -echo "${as_me:-configure}:11574: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 - - if test "$cf_check_cppflags" != "$CPPFLAGS" ; then - test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 - -echo "${as_me:-configure}:11579: testing but keeping change to \$CPPFLAGS ..." 1>&5 - - fi - CFLAGS="$cf_check_flags" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi - - echo "$as_me:11587: 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 11593 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XOpenDisplay (); below. */ -#include -/* 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 XOpenDisplay (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11624: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11627: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11630: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11633: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_XOpenDisplay=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_XOpenDisplay=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:11643: 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:11649: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 11657 "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 XOpenDisplay (); -int -main () -{ -XOpenDisplay (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11676: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11679: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11682: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11685: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_X11_XOpenDisplay=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_X11_XOpenDisplay=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:11696: 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 - LIBS="-lX11 $LIBS" -fi - -fi - - echo "$as_me:11704: 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 11710 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char XtAppInitialize (); below. */ -#include -/* 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 XtAppInitialize (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11741: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11744: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11747: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11750: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_XtAppInitialize=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_XtAppInitialize=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:11760: 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:11766: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 11774 "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 XtAppInitialize (); -int -main () -{ -XtAppInitialize (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11793: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11796: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11799: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11802: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Xt_XtAppInitialize=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_Xt_XtAppInitialize=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:11813: 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 - cat >>confdefs.h <<\EOF -#define HAVE_LIBXT 1 -EOF - - cf_have_X_LIBS=Xt - LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS" -fi - -fi - -fi - -if test $cf_have_X_LIBS = no ; then - { echo "$as_me:11829: 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 -test program. You will have to check and add the proper libraries by hand -to makefile." >&2;} -fi - -cf_x_athena_root=$cf_x_athena -cf_x_athena_inc="" - -for cf_path in default \ - /usr/contrib/X11R6 \ - /usr/contrib/X11R5 \ - /usr/lib/X11R5 \ - /usr/local -do - if test -z "$cf_x_athena_inc" ; then - cf_save="$CPPFLAGS" - 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:11851: 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:11854: checking for $cf_test" >&5 -echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6 - fi - cat >conftest.$ac_ext <<_ACEOF -#line 11858 "configure" -#include "confdefs.h" - -#include -#include <$cf_test> -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:11872: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:11875: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11878: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11881: \$? = $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:11890: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test "$cf_result" = yes ; then - cf_x_athena_inc=$cf_path - break - else - CPPFLAGS="$cf_save" - fi - fi -done - -if test -z "$cf_x_athena_inc" ; then - { echo "$as_me:11902: 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;} -elif test "$cf_x_athena_inc" != default ; then - CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc" -fi - -cf_x_athena_root=$cf_x_athena -cf_x_athena_lib="" - -for cf_path in default \ - /usr/contrib/X11R6 \ - /usr/contrib/X11R5 \ - /usr/lib/X11R5 \ - /usr/local -do - for cf_lib in \ - "-l$cf_x_athena_root -lXmu" \ - "-l$cf_x_athena_root -lXpm -lXmu" \ - "-l${cf_x_athena_root}_s -lXmu_s" - do - if test -z "$cf_x_athena_lib" ; then - cf_save="$LIBS" - cf_test=XawSimpleMenuAddGlobalActions - if test $cf_path != default ; then - LIBS="-L$cf_path/lib $cf_lib $LIBS" - echo "$as_me:11927: checking for $cf_lib in $cf_path" >&5 -echo $ECHO_N "checking for $cf_lib in $cf_path... $ECHO_C" >&6 - else - LIBS="$cf_lib $LIBS" - echo "$as_me:11931: checking for $cf_test in $cf_lib" >&5 -echo $ECHO_N "checking for $cf_test in $cf_lib... $ECHO_C" >&6 - fi - cat >conftest.$ac_ext <<_ACEOF -#line 11935 "configure" -#include "confdefs.h" - -#include -#include - -int -main () -{ - -$cf_test((XtAppContext) 0) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11951: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11954: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11957: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11960: \$? = $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 - echo "$as_me:11969: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test "$cf_result" = yes ; then - cf_x_athena_lib="$cf_lib" - break - fi - LIBS="$cf_save" - fi - done -done - -if test -z "$cf_x_athena_lib" ; then - { { echo "$as_me:11981: 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_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - -cat >>confdefs.h <&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XCURSES_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $XCURSES_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test with a path. - ;; - *) - ac_save_IFS=$IFS; IFS=$ac_path_separator -ac_dummy="$PATH" -for ac_dir in $ac_dummy; do - IFS=$ac_save_IFS - test -z "$ac_dir" && ac_dir=. - if $as_executable_p "$ac_dir/$ac_word"; then - ac_cv_path_XCURSES_CONFIG="$ac_dir/$ac_word" - echo "$as_me:12015: found $ac_dir/$ac_word" >&5 - break -fi -done - - ;; -esac -fi -XCURSES_CONFIG=$ac_cv_path_XCURSES_CONFIG - -if test -n "$XCURSES_CONFIG"; then - echo "$as_me:12026: result: $XCURSES_CONFIG" >&5 -echo "${ECHO_T}$XCURSES_CONFIG" >&6 -else - echo "$as_me:12029: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - test -n "$XCURSES_CONFIG" && break -done -test -n "$XCURSES_CONFIG" || XCURSES_CONFIG="none" - -if test "$XCURSES_CONFIG" != none ; then - -CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`" -LIBS="`$XCURSES_CONFIG --libs` $LIBS" - -cf_cv_lib_XCurses=yes - -else - -LDFLAGS="$LDFLAGS $X_LIBS" - -test -n "$verbose" && echo " checking additions to CFLAGS" 1>&6 - -echo "${as_me:-configure}:12050: testing checking additions to CFLAGS ..." 1>&5 - -cf_check_cflags="$CFLAGS" -cf_check_cppflags="$CPPFLAGS" - -cf_fix_cppflags=no -cf_new_cflags= -cf_new_cppflags= -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 - case $cf_add_cflags in - -D*) - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes - - if test $cf_fix_cppflags = yes ; then - 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" - continue - fi - ;; - esac - case "$CPPFLAGS" in - *$cf_add_cflags) #(vi - ;; - *) #(vi - case $cf_add_cflags in #(vi - -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 - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" - ;; - esac - ;; - *) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" - ;; - esac - ;; -yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" - - cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` - - test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no - ;; -esac -done - -if test -n "$cf_new_cflags" ; then - test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 - -echo "${as_me:-configure}:12121: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 - - 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}:12129: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 - - 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}:12137: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 - - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" -fi - -if test "$cf_check_cflags" != "$CFLAGS" ; then -cat >conftest.$ac_ext <<_ACEOF -#line 12144 "configure" -#include "confdefs.h" -#include -int -main () -{ -printf("Hello world"); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12156: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12159: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12162: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12165: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -test -n "$verbose" && echo " test-compile failed. Undoing change to \$CFLAGS" 1>&6 - -echo "${as_me:-configure}:12173: testing test-compile failed. Undoing change to \$CFLAGS ..." 1>&5 - - if test "$cf_check_cppflags" != "$CPPFLAGS" ; then - test -n "$verbose" && echo " but keeping change to \$CPPFLAGS" 1>&6 - -echo "${as_me:-configure}:12178: testing but keeping change to \$CPPFLAGS ..." 1>&5 - - fi - CFLAGS="$cf_check_flags" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi - -echo "$as_me:12186: 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 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 12194 "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 XOpenDisplay (); -int -main () -{ -XOpenDisplay (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12213: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12216: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12219: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12222: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_X11_XOpenDisplay=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_lib_X11_XOpenDisplay=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:12233: 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 - LIBS="-lX11 $LIBS" -fi - -echo "$as_me:12239: 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 - -LIBS="-lXCurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 12247 "configure" -#include "confdefs.h" - -#include -char *XCursesProgramName = "test"; - -int -main () -{ -XCursesExit(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12262: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12265: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12268: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12271: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_lib_XCurses=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_lib_XCurses=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - -fi -echo "$as_me:12282: result: $cf_cv_lib_XCurses" >&5 -echo "${ECHO_T}$cf_cv_lib_XCurses" >&6 - -fi - -if test $cf_cv_lib_XCurses = yes ; then - cat >>confdefs.h <<\EOF -#define UNIX 1 -EOF - - cat >>confdefs.h <<\EOF -#define XCURSES 1 -EOF - - echo "$as_me:12296: 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 12302 "configure" -#include "confdefs.h" -#include -_ACEOF -if { (eval echo "$as_me:12306: \"$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:12312: \$? = $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 - ac_cv_header_xcurses_h=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_xcurses_h=no -fi -rm -f conftest.err conftest.$ac_ext -fi -echo "$as_me:12331: 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 - cat >>confdefs.h <<\EOF -#define HAVE_XCURSES 1 -EOF - -fi - -else - { { echo "$as_me:12341: error: Cannot link with XCurses" >&5 -echo "$as_me: error: Cannot link with XCurses" >&2;} - { (exit 1); exit 1; }; } -fi - - ;; -esac - -case $cf_cv_screen in #(vi -pdcurses) #(vi - ;; -*) - # look for curses-related libraries - -as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh` -echo "$as_me:12356: 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 12364 "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 new_panel (); -int -main () -{ -new_panel (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12383: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12386: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12389: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12392: \$? = $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:12403: 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 <&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="-lmenu$cf_cv_libtype $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 12423 "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 (); -int -main () -{ -menu_driver (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12442: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12445: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12448: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12451: \$? = $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:12462: 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 <&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="-lform$cf_cv_libtype $LIBS" -cat >conftest.$ac_ext <<_ACEOF -#line 12482 "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 form_driver (); -int -main () -{ -form_driver (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12501: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12504: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12507: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12510: \$? = $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:12521: 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 <&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 12550 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:12554: \"$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:12560: \$? = $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:12579: 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 <&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 -if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 12598 "configure" -#include "confdefs.h" -#include -#include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif - -int -main () -{ -int i; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:12620: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:12623: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12626: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12629: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_signal=void -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_type_signal=int -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:12639: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 - -cat >>confdefs.h <&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 12652 "configure" -#include "confdefs.h" -#include -#include -#include -#include - -_ACEOF -if { (eval echo "$as_me:12660: \"$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:12666: \$? = $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 - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no -fi -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 12688 "configure" -#include "confdefs.h" -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -rf conftest* - -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 12706 "configure" -#include "confdefs.h" -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -rf conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -#line 12727 "configure" -#include "confdefs.h" -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - $ac_main_return(2); - $ac_main_return (0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:12753: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12756: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12758: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12761: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_header_stdc=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -fi -echo "$as_me:12774: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo "$as_me:12784: 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 12790 "configure" -#include "confdefs.h" -#include -#include -#include - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:12806: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:12809: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12812: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12815: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_time=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_header_time=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:12825: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 -if test $ac_cv_header_time = yes; then - -cat >>confdefs.h <<\EOF -#define TIME_WITH_SYS_TIME 1 -EOF - -fi - -for ac_header in \ -getopt.h \ -locale.h \ -math.h \ -stdarg.h \ -sys/ioctl.h \ -sys/select.h \ -sys/time.h \ -termios.h \ -unistd.h \ - -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:12848: 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 12854 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:12858: \"$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:12864: \$? = $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:12883: 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 <&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 12913 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* 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 $ac_func (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12944: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:12947: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12950: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:12953: \$? = $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:12963: 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 <&5 -echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6 -if test "${cf_cv_need_xopen_extension+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - -cat >conftest.$ac_ext <<_ACEOF -#line 12980 "configure" -#include "confdefs.h" - -#include -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -#if defined(NCURSES_VERSION_PATCH) -#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403) - make an error -#endif -#endif - 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:13002: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13005: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13008: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13011: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_need_xopen_extension=no -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -#line 13018 "configure" -#include "confdefs.h" - -#define _XOPEN_SOURCE_EXTENDED -#include -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -#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) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13040: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13043: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13046: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13049: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_need_xopen_extension=yes -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 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:13061: 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:13065: 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 -else - -# If we found , look for , but always look -# for if we do not find the variant. -for cf_header in \ - `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \ - term.h -do - cat >conftest.$ac_ext <<_ACEOF -#line 13078 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#include <${cf_header}> -int -main () -{ -WINDOW *x - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13092: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:13095: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13098: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13101: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_term_header=$cf_header - break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_term_header=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done - -case $cf_cv_term_header in #(vi -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 13120 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -#ifdef NCURSES_VERSION -#include <${cf_header}> -#else -make an error -#endif -int -main () -{ -WINDOW *x - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13138: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:13141: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13144: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13147: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_term_header=$cf_header - break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_term_header=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - done - ;; -esac - -fi -echo "$as_me:13162: result: $cf_cv_term_header" >&5 -echo "${ECHO_T}$cf_cv_term_header" >&6 - -case $cf_cv_term_header in #(vi -term.h) #(vi - cat >>confdefs.h <<\EOF -#define HAVE_TERM_H 1 -EOF - - ;; -ncurses/term.h) #(vi - 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 - -for cf_func in \ -chgat \ -color_set \ -filter \ -getbegx \ -getcurx \ -getmaxx \ -getnstr \ -getparx \ -getwin \ -mvvline \ -mvwvline \ -napms \ -putwin \ -resize_term \ -resizeterm \ -ripoffline \ -scr_dump \ -setupterm \ -slk_color \ -slk_init \ -termattrs \ -tgetent \ -tigetnum \ -tigetstr \ -typeahead \ -use_default_colors \ -vw_printw \ -vsscanf \ -wchgat \ -winsstr \ -wresize \ -wsyncdown \ - -do - -cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - echo "$as_me:13224: checking for ${cf_func}" >&5 -echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6 - -echo "${as_me:-configure}:13227: testing ${cf_func} ..." 1>&5 - - if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - eval cf_result='$ac_cv_func_'$cf_func - if test ".$cf_result" != ".no"; then - cat >conftest.$ac_ext <<_ACEOF -#line 13236 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main () -{ - -#ifndef ${cf_func} -long foo = (long)(&${cf_func}); -${cf_cv_main_return:-return}(foo == 0); -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13267: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13270: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13273: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13276: \$? = $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 - fi - eval 'cf_cv_func_'$cf_func'=$cf_result' - -fi - - # use the computed/retrieved cache-value: - eval 'cf_result=$cf_cv_func_'$cf_func - echo "$as_me:13292: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 - if test $cf_result != no; then - cat >>confdefs.h <&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 13309 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -int x = NCURSES_EXT_FUNCS - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13324: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:13327: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13330: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13333: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_ext_funcs=defined -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -#line 13341 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - - (void) assume_default_colors (0, 0); - (void) curses_version (); - (void) define_key (0, 0); - (void) is_term_resized (0, 0); - (void) key_defined (0); - (void) keybound (0, 0); - (void) keyok (0, 0); - (void) resize_term (0, 0); - (void) resizeterm (0, 0); - (void) use_default_colors (); - (void) use_extended_names (0); - (void) wresize (0, 0, 0); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13366: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13369: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13372: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13375: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_ncurses_ext_funcs=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_ncurses_ext_funcs=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi -echo "$as_me:13389: 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 -#define NCURSES_EXT_FUNCS 1 -EOF - -echo "$as_me:13395: 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 13402 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - - static wchar_t src_wchar[2]; - static cchar_t dst_cchar; - setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13419: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13422: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13425: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13428: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_widechar_funcs=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_widechar_funcs=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - -fi -echo "$as_me:13439: result: $cf_cv_widechar_funcs" >&5 -echo "${ECHO_T}$cf_cv_widechar_funcs" >&6 -if test "$cf_cv_widechar_funcs" != no ; then - cat >>confdefs.h <<\EOF -#define USE_WIDEC_SUPPORT 1 -EOF - -else - cat >>confdefs.h <<\EOF -#define USE_WIDEC_SUPPORT 0 -EOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:13459: 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 13465 "configure" -#include "confdefs.h" -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13471: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:13474: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13477: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13480: \$? = $ac_status" >&5 - (exit $ac_status); }; }; 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.$ac_objext conftest.$ac_ext -fi -echo "$as_me:13490: 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 <&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line 13506 "configure" -#include "confdefs.h" -$ac_includes_default -int -main () -{ -if ((pid_t *) 0) - return 0; -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13521: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:13524: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13527: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13530: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_type_pid_t=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:13540: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 -if test $ac_cv_type_pid_t = yes; then - : -else - -cat >>confdefs.h <&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 13561 "configure" -#include "confdefs.h" -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:13565: \"$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:13571: \$? = $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:13590: 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 <&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 13609 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include -/* 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 $ac_func (); -char (*f) (); - -int -main () -{ -/* The GNU C library defines this 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; -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13640: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13643: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13646: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13649: \$? = $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:13659: 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 <&5 -echo $ECHO_N "checking for working fork... $ECHO_C" >&6 -if test "${ac_cv_func_fork_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_fork_works=cross -else - cat >conftest.$ac_ext <<_ACEOF -/* By Rüdiger Kuhlmann. */ - #include - #if HAVE_UNISTD_H - # include - #endif - /* Some systems only have a dummy stub for fork() */ - int main () - { - if (fork() < 0) - $ac_main_return (1); - $ac_main_return (0); - } -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:13694: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13697: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13699: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13702: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_fork_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_fork_works=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:13714: result: $ac_cv_func_fork_works" >&5 -echo "${ECHO_T}$ac_cv_func_fork_works" >&6 - -fi -if test "x$ac_cv_func_fork_works" = xcross; then - case $host in - *-*-amigaos* | *-*-msdosdjgpp*) - # Override, as these systems have only a dummy fork() stub - ac_cv_func_fork_works=no - ;; - *) - ac_cv_func_fork_works=yes - ;; - esac - { echo "$as_me:13728: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5 -echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;} -fi -ac_cv_func_vfork_works=$ac_cv_func_vfork -if test "x$ac_cv_func_vfork" = xyes; then - echo "$as_me:13733: checking for working vfork" >&5 -echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 -if test "${ac_cv_func_vfork_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - ac_cv_func_vfork_works=cross -else - cat >conftest.$ac_ext <<_ACEOF -#line 13742 "configure" -#include "confdefs.h" -/* Thanks to Paul Eggert for this test. */ -#include -#include -#include -#if HAVE_UNISTD_H -# include -#endif -#if HAVE_VFORK_H -# include -#endif -/* On some sparc systems, changes by the child to local and incoming - argument registers are propagated back to the parent. The compiler - is told about this with #include , but some compilers - (e.g. gcc -O) don't grok . Test for this by using a - static variable whose address is put into a register that is - clobbered by the vfork. */ -static -#ifdef __cplusplus -sparc_address_test (int arg) -# else -sparc_address_test (arg) int arg; -#endif -{ - static pid_t child; - if (!child) { - child = vfork (); - if (child < 0) { - perror ("vfork"); - _exit(2); - } - if (!child) { - arg = getpid(); - write(-1, "", 0); - _exit (arg); - } - } -} - -int -main () -{ - pid_t parent = getpid (); - pid_t child; - - sparc_address_test (); - - child = vfork (); - - if (child == 0) { - /* Here is another test for sparc vfork register problems. This - test uses lots of local variables, at least as many local - variables as main has allocated so far including compiler - temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris - 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should - reuse the register of parent for one of the local variables, - since it will think that parent can't possibly be used any more - in this routine. Assigning to the local variable will thus - munge parent in the parent process. */ - pid_t - p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), - p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); - /* Convince the compiler that p..p7 are live; otherwise, it might - use the same hardware register for all 8 local variables. */ - if (p != p1 || p != p2 || p != p3 || p != p4 - || p != p5 || p != p6 || p != p7) - _exit(1); - - /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent - from child file descriptors. If the child closes a descriptor - before it execs or exits, this munges the parent's descriptor - as well. Test for this by closing stdout in the child. */ - _exit(close(fileno(stdout)) != 0); - } else { - int status; - struct stat st; - - while (wait(&status) != child) - ; - $ac_main_return( - /* Was there some problem with vforking? */ - child < 0 - - /* Did the child fail? (This shouldn't happen.) */ - || status - - /* Did the vfork/compiler bug occur? */ - || parent != getpid() - - /* Did the file descriptor bug occur? */ - || fstat(fileno(stdout), &st) != 0 - ); - } -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:13839: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13842: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13844: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13847: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_vfork_works=yes -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -ac_cv_func_vfork_works=no -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -echo "$as_me:13859: result: $ac_cv_func_vfork_works" >&5 -echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 - -fi; -if test "x$ac_cv_func_fork_works" = xcross; then - ac_cv_func_vfork_works=ac_cv_func_vfork - { echo "$as_me:13865: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5 -echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;} -fi - -if test "x$ac_cv_func_vfork_works" = xyes; then - -cat >>confdefs.h <<\EOF -#define HAVE_WORKING_VFORK 1 -EOF - -else - -cat >>confdefs.h <<\EOF -#define vfork fork -EOF - -fi -if test "x$ac_cv_func_fork_works" = xyes; then - -cat >>confdefs.h <<\EOF -#define HAVE_WORKING_FORK 1 -EOF - -fi - -echo "$as_me:13890: 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 13897 "configure" -#include "confdefs.h" - -#include -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:13917: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:13920: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13923: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13926: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_sys_time_select=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_sys_time_select=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - -fi - -echo "$as_me:13938: 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:13944: 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 -else - -if test "$cross_compiling" = yes; then - cf_cv_func_curses_version=unknown -else - cat >conftest.$ac_ext <<_ACEOF -#line 13954 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> -int main() -{ - char temp[1024]; - sprintf(temp, "%s\n", curses_version()); - ${cf_cv_main_return:-return}(0); -} - -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:13967: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:13970: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13972: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:13975: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_func_curses_version=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_cv_func_curses_version=no - -fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f core -fi -echo "$as_me:13990: 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:13996: 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. -if test "${with_ncurses_wrap_prefix+set}" = set; then - withval="$with_ncurses_wrap_prefix" - NCURSES_WRAP_PREFIX=$withval -else - NCURSES_WRAP_PREFIX=_nc_ -fi; -echo "$as_me:14006: result: $NCURSES_WRAP_PREFIX" >&5 -echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 - -echo "$as_me:14009: 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 -else - -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 14019 "configure" -#include "confdefs.h" - -#include <${cf_cv_ncurses_header:-curses.h}> - -int -main () -{ - -$name['k'] = ACS_PLUS - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14035: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:14038: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14041: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14044: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_curses_acs_map=$name; break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -done - -fi -echo "$as_me:14055: result: $cf_cv_curses_acs_map" >&5 -echo "${ECHO_T}$cf_cv_curses_acs_map" >&6 - -test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <&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 -else - - cf_cv_curses_wacs_map=unknown - for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char - do - cat >conftest.$ac_ext <<_ACEOF -#line 14072 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -void *foo = &($name['k']) - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14088: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:14091: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14094: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14097: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_curses_wacs_map=$name - break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - done -fi -echo "$as_me:14108: result: $cf_cv_curses_wacs_map" >&5 -echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6 - -test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <&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 -else - -cf_cv_curses_wacs_symbols=no -if test "$cf_cv_curses_wacs_map" != unknown -then - cat >conftest.$ac_ext <<_ACEOF -#line 14125 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -cchar_t *foo = WACS_PLUS; - $cf_cv_curses_wacs_map['k'] = *WACS_PLUS - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14142: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:14145: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14148: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14151: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_curses_wacs_symbols=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -#line 14161 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ -cchar_t *foo = WACS_PLUS - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14177: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:14180: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14183: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14186: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_curses_wacs_symbols=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext -fi - -fi -echo "$as_me:14197: result: $cf_cv_curses_wacs_symbols" >&5 -echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6 - -test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF -#define CURSES_WACS_SYMBOLS 1 -EOF - -echo "$as_me:14204: 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 14207 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -attr_t foo - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14225: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14228: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14231: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14234: \$? = $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:14243: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 -if test $cf_result = yes ; then - -cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <>confdefs.h <&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 14268 "configure" -#include "confdefs.h" - -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -int -main () -{ -mbstate_t state - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14286: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14289: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14292: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14295: \$? = $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 14302 "configure" -#include "confdefs.h" - -#include -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -int -main () -{ -mbstate_t value - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14321: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14324: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14327: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14330: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_mbstate_t=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_mbstate_t=unknown -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:14342: result: $cf_cv_mbstate_t" >&5 -echo "${ECHO_T}$cf_cv_mbstate_t" >&6 - -if test "$cf_cv_mbstate_t" = yes ; then - cat >>confdefs.h <<\EOF -#define NEED_WCHAR_H 1 -EOF - - NEED_WCHAR_H=1 -fi - -# if we do not find mbstate_t in either place, use substitution to provide a fallback. -if test "$cf_cv_mbstate_t" = unknown ; then - NCURSES_MBSTATE_T=1 -fi - -# if we find mbstate_t in either place, use substitution to provide a fallback. -if test "$cf_cv_mbstate_t" != unknown ; then - NCURSES_OK_MBSTATE_T=1 -fi - -# This is needed on Tru64 5.0 to declare wchar_t -echo "$as_me:14364: 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 14371 "configure" -#include "confdefs.h" - -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -int -main () -{ -wchar_t state - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14389: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14392: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14395: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14398: \$? = $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 14405 "configure" -#include "confdefs.h" - -#include -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -int -main () -{ -wchar_t value - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14424: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14427: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14430: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14433: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_wchar_t=unknown -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:14445: result: $cf_cv_wchar_t" >&5 -echo "${ECHO_T}$cf_cv_wchar_t" >&6 - -if test "$cf_cv_wchar_t" = yes ; then - cat >>confdefs.h <<\EOF -#define NEED_WCHAR_H 1 -EOF - - NEED_WCHAR_H=1 -fi - -# if we do not find wchar_t in either place, use substitution to provide a fallback. -if test "$cf_cv_wchar_t" = unknown ; then - NCURSES_WCHAR_T=1 -fi - -# if we find wchar_t in either place, use substitution to provide a fallback. -if test "$cf_cv_wchar_t" != unknown ; then - NCURSES_OK_WCHAR_T=1 -fi - -# This is needed on Tru64 5.0 to declare wint_t -echo "$as_me:14467: 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 14474 "configure" -#include "confdefs.h" - -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -int -main () -{ -wint_t state - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14492: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14495: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14498: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14501: \$? = $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 14508 "configure" -#include "confdefs.h" - -#include -#include -#include -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -int -main () -{ -wint_t value - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14527: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14530: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14533: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14536: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_wint_t=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_cv_wint_t=unknown -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:14548: result: $cf_cv_wint_t" >&5 -echo "${ECHO_T}$cf_cv_wint_t" >&6 - -if test "$cf_cv_wint_t" = yes ; then - cat >>confdefs.h <<\EOF -#define NEED_WCHAR_H 1 -EOF - - NEED_WCHAR_H=1 -fi - -# if we do not find wint_t in either place, use substitution to provide a fallback. -if test "$cf_cv_wint_t" = unknown ; then - NCURSES_WINT_T=1 -fi - -# if we find wint_t in either place, use substitution to provide a fallback. -if test "$cf_cv_wint_t" != unknown ; then - NCURSES_OK_WINT_T=1 -fi - -if test "$NCURSES_OK_MBSTATE_T" = 0 ; then - -echo "$as_me:14571: 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 14574 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -mbstate_t foo - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14592: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14595: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14598: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14601: \$? = $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:14610: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 -if test $cf_result = yes ; then - -cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <>confdefs.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 14634 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -wchar_t foo - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14652: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14655: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14658: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14661: \$? = $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:14670: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 -if test $cf_result = yes ; then - -cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <>confdefs.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 14694 "configure" -#include "confdefs.h" - -#ifndef _XOPEN_SOURCE_EXTENDED -#define _XOPEN_SOURCE_EXTENDED -#endif -#include <${cf_cv_ncurses_header:-curses.h}> -int -main () -{ - -wint_t foo - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14712: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14715: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14718: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14721: \$? = $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:14730: result: $cf_result" >&5 -echo "${ECHO_T}$cf_result" >&6 -if test $cf_result = yes ; then - -cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - - cat >>confdefs.h <>confdefs.h <&5 -echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 - -cat >conftest.$ac_ext <<_ACEOF -#line 14753 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main () -{ - -void *foo = &(boolnames) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14781: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14784: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14787: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14790: \$? = $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:14799: 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___%` - - cat >>confdefs.h <&5 -echo $ECHO_N "checking for data boolnames 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 14818 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char boolnames; -int -main () -{ - - do { - void *foo = &(boolnames); - ${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:14850: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:14853: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14856: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14859: \$? = $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 14871 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char boolnames; -int main(void) -{ - void *foo = &(boolnames); - ${cf_cv_main_return:-return}(foo == 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:14896: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:14899: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14901: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14904: \$? = $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:14915: 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___%` - - cat >>confdefs.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 14932 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -int -main () -{ - -void *foo = &(boolfnames) - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:14960: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:14963: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14966: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:14969: \$? = $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:14978: 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 <&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 14997 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char boolfnames; -int -main () -{ - - do { - void *foo = &(boolfnames); - ${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:15029: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:15032: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:15035: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:15038: \$? = $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 15050 "configure" -#include "confdefs.h" - -#ifdef HAVE_XCURSES -#include -char * XCursesProgramName = "test"; -#else -#include <${cf_cv_ncurses_header:-curses.h}> -#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif -#endif - -extern char boolfnames; -int main(void) -{ - void *foo = &(boolfnames); - ${cf_cv_main_return:-return}(foo == 0); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:15075: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:15078: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15080: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:15083: \$? = $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:15094: 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___%` - - cat >>confdefs.h <confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overriden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -{ - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; -} | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if cmp -s $cache_file confcache; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - -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:15191: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -SHELL=\${CONFIG_SHELL-$SHELL} -ac_cs_invocation="\$0 \$@" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi - -# Name of the executable. -as_me=`echo "$0" |sed 's,.*[\\/],,'` - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.file - -as_executable_p="test -f" - -# Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# NLS nuisances. -$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } -$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } -$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } -$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } -$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } -$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } -$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } -$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } - -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } - -exec 6>&1 - -_ACEOF - -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - -cat >>$CONFIG_STATUS <<\EOF - -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." -EOF - -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift - ;; - -*);; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_need_defaults=false;; - esac - - case $1 in - # Handling of the options. -EOF -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:15367: 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;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" - ac_need_defaults=false;; - - # This is an error. - -*) { { echo "$as_me:15386: 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;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift -done - -exec 5>>config.log -cat >&5 << _ACEOF - -## ----------------------- ## -## Running config.status. ## -## ----------------------- ## - -This file was extended by $as_me 2.52.20101002, executed with - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - > $ac_cs_invocation -on `(hostname || uname -n) 2>/dev/null | sed 1q` - -_ACEOF -EOF - -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF -for ac_config_target in $ac_config_targets -do - case "$ac_config_target" in - # Handling of arguments. - "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:15434: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Create a temporary directory, and hook for its removal unless debugging. -$debug || -{ - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} - -# Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} -{ - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=$TMPDIR/cs$$-$RANDOM - (umask 077 && mkdir $tmp) -} || -{ - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - { (exit 1); exit 1; } -} - -EOF - -cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@DEFS@,$DEFS,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -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,@LINT@,$LINT,;t t -s,@LINT_OPTS@,$LINT_OPTS,;t t -s,@CTAGS@,$CTAGS,;t t -s,@ETAGS@,$ETAGS,;t t -s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t -s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t -s,@MATH_LIB@,$MATH_LIB,;t t -s,@CC_G_OPT@,$CC_G_OPT,;t t -s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t -s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t -s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t -s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t -s,@LD@,$LD,;t t -s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t -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,@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,@PTHREAD@,$PTHREAD,;t t -s,@TEST_ARGS@,$TEST_ARGS,;t t -s,@TEST_DEPS@,$TEST_DEPS,;t t -s,@TEST_LIBS@,$TEST_LIBS,;t t -s,@TINFO_ARGS@,$TINFO_ARGS,;t t -s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t -s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t -s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t -s,@ECHO_LT@,$ECHO_LT,;t t -s,@ECHO_LD@,$ECHO_LD,;t t -s,@RULE_CC@,$RULE_CC,;t t -s,@SHOW_CC@,$SHOW_CC,;t t -s,@ECHO_CC@,$ECHO_CC,;t t -s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t -s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t -s,@PKG_CONFIG@,$PKG_CONFIG,;t t -s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t -s,@X_CFLAGS@,$X_CFLAGS,;t t -s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t -s,@X_LIBS@,$X_LIBS,;t t -s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t -s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t -s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t -CEOF - -EOF - - cat >>$CONFIG_STATUS <<\EOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # 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 - if test -z "$ac_sed_cmds"; then - 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" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" - -EOF -cat >>$CONFIG_STATUS <<\EOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || mkdir "$as_incr_dir" - ;; - esac -done; } - - ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` - else - ac_dir_suffix= ac_dots= - fi - - case $srcdir in - .) ac_srcdir=. - if test -z "$ac_dots"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_dots$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_dots$srcdir ;; - esac - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_dots$INSTALL ;; - esac - - if test x"$ac_file" != x-; then - { echo "$as_me:15697: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated automatically by config.status. */ - configure_input="Generated automatically from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:15715: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:15728: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } -EOF -cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi - -done -EOF -cat >>$CONFIG_STATUS <<\EOF - -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_iB='\([ ]\),\1#\2define\3' -ac_iC=' ' -ac_iD='\4,;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - test x"$ac_file" != x- && { echo "$as_me:15794: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:15805: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:15818: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -EOF - -# Transform confdefs.h into a list of #define's. We won't use it as a sed -# script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to -# be either 'cat' or 'sort'. -cat confdefs.h | uniq >conftest.vals - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -echo ' rm -f conftest.frag' >> $CONFIG_STATUS -while grep . conftest.vals >/dev/null -do - # Write chunks of a limited-size here document to conftest.frag. - echo ' cat >> conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS - echo 'CEOF' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -# Run sed to substitute the contents of conftest.frag into $tmp/in at the -# marker @DEFS@. -echo ' cat >> conftest.edit < $tmp/out -rm -f $tmp/in -mv $tmp/out $tmp/in -rm -f conftest.edit conftest.frag -' >> $CONFIG_STATUS - -cat >>$CONFIG_STATUS <<\EOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated automatically by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated automatically by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - 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:15876: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || mkdir "$as_incr_dir" - ;; - esac -done; } - - fi - rm -f $ac_file - mv $tmp/config.h $ac_file - fi - else - cat $tmp/config.h - rm -f $tmp/config.h - fi -done -EOF -cat >>$CONFIG_STATUS <<\EOF -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - - case $ac_dest in - default ) - -for cf_dir in . -do - if test ! -d $srcdir/$cf_dir; then - continue - elif test -f $srcdir/$cf_dir/programs; then - $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile - fi -done - - cat >>Makefile <>Makefile <>Makefile <>$CONFIG_STATUS <<\EOF - -{ (exit 0); exit 0; } -EOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - diff --git a/test/configure.in b/test/configure.in deleted file mode 100644 index 5ffd3e87bcc..00000000000 --- a/test/configure.in +++ /dev/null @@ -1,321 +0,0 @@ -dnl*************************************************************************** -dnl Copyright (c) 1998-2010,2011 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 * -dnl "Software"), to deal in the Software without restriction, including * -dnl without limitation the rights to use, copy, modify, merge, publish, * -dnl distribute, distribute with modifications, sublicense, and/or sell * -dnl copies of the Software, and to permit persons to whom the Software is * -dnl furnished to do so, subject to the following conditions: * -dnl * -dnl The above copyright notice and this permission notice shall be included * -dnl in all copies or substantial portions of the Software. * -dnl * -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * -dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * -dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * -dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * -dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * -dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * -dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -dnl * -dnl Except as contained in this notice, the name(s) of the above copyright * -dnl holders shall not be used in advertising or otherwise to promote the * -dnl sale, use or other dealings in this Software without prior written * -dnl authorization. * -dnl*************************************************************************** -dnl -dnl Author: Thomas E. Dickey 1996, etc. -dnl -dnl $Id: configure.in,v 1.90 2011/03/22 09:15:08 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) -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 --------------------------------------------------------------------------- -AC_PREREQ(2.13.20020210) -AC_INIT(ncurses.c) -AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin) - -CF_INHERIT_SCRIPT(config.guess) -CF_INHERIT_SCRIPT(config.sub) -CF_CHECK_CACHE - -AC_ARG_PROGRAM - -AC_PROG_MAKE_SET -AC_PROG_CC -AC_PROG_CPP -AC_PROG_AWK -CF_PROG_INSTALL -CF_PROG_LINT -CF_MAKE_TAGS - -CF_MATH_LIB(MATH_LIB,sin(x)) -AC_SUBST(MATH_LIB) - -dnl Things that we don't need (or must override) if we're not building ncurses -CC_G_OPT="-g" AC_SUBST(CC_G_OPT) -CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS) -CPPFLAGS="$CPPFLAGS" AC_SUBST(CPPFLAGS) -DFT_DEP_SUFFIX="" AC_SUBST(DFT_DEP_SUFFIX) -DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR) -DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL) -LD="ld" AC_SUBST(LD) -LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED) -LDFLAGS_STATIC="" AC_SUBST(LDFLAGS_STATIC) -LD_MODEL="" AC_SUBST(LD_MODEL) -LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS) -LIBTOOL="" AC_SUBST(LIBTOOL) -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) -PTHREAD="-lm" AC_SUBST(PTHREAD) -TEST_ARGS="" AC_SUBST(TEST_ARGS) -TEST_DEPS="" AC_SUBST(TEST_DEPS) -TEST_LIBS="" AC_SUBST(TEST_LIBS) -TINFO_ARGS='$(LIBS_CURSES)' AC_SUBST(TINFO_ARGS) -cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version) -cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version) - -cf_cv_screen=curses -cf_cv_libtype= - -AC_EXEEXT -AC_OBJEXT - -CF_ANSI_CC_REQD -CF_GCC_ATTRIBUTES -CF_XOPEN_SOURCE -AC_C_CONST -CF_SIG_ATOMIC_T - -CF_DISABLE_ECHO -CF_ENABLE_WARNINGS - -CF_DISABLE_LEAKS -CF_WITH_CURSES_DIR - -dnl SunOS 4.x -AC_ARG_WITH(5lib, - [ --with-5lib use SunOS sysv-libraries], - [LIBS="-L/usr/5lib $LIBS" - CPPFLAGS="$CPPFLAGS -I/usr/5include"]) - -dnl --------------------------------------------------------------------------- -dnl NcursesW, installed in conventional location -AC_ARG_WITH(ncursesw, - [ --with-ncursesw use wide ncurses-libraries (installed)], - [cf_cv_screen=ncursesw],[ - -dnl Ncurses, installed in conventional location -AC_ARG_WITH(ncurses, - [ --with-ncurses use ncurses-libraries (installed)], - [cf_cv_screen=ncurses],[ - -AC_ARG_WITH(pdcurses, - [ --with-pdcurses compile/link with pdcurses X11 library], - [cf_cv_screen=pdcurses])])]) - -case $cf_cv_screen in -curses) - CF_CURSES_CONFIG - CF_NETBSD_FORM_H - CF_NETBSD_MENU_H - ;; -ncurses) - CF_NCURSES_CONFIG - ;; -ncursesw) - cf_cv_libtype=w - CF_UTF8_LIB - CF_NCURSES_CONFIG(ncursesw) - ;; -pdcurses) #(vi - CF_PDCURSES_X11 - ;; -esac - -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 - ;; -*) - # look for curses-related libraries - AC_CHECK_LIB(panel$cf_cv_libtype,new_panel) - AC_CHECK_LIB(menu$cf_cv_libtype,menu_driver) - AC_CHECK_LIB(form$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 \ - ) - ;; -esac - -AC_TYPE_SIGNAL - -AC_STDC_HEADERS -AC_HEADER_TIME -AC_CHECK_HEADERS( \ -getopt.h \ -locale.h \ -math.h \ -stdarg.h \ -sys/ioctl.h \ -sys/select.h \ -sys/time.h \ -termios.h \ -unistd.h \ -) - -AC_CHECK_FUNCS( \ -gettimeofday \ -mblen \ -mbrlen \ -mbrtowc \ -mbsrtowcs \ -mbstowcs \ -mbtowc \ -strdup \ -wcsrtombs \ -wcstombs \ -) - -CF_CURSES_FUNCS( \ -chgat \ -color_set \ -filter \ -getbegx \ -getcurx \ -getmaxx \ -getnstr \ -getparx \ -getwin \ -mvvline \ -mvwvline \ -napms \ -putwin \ -resize_term \ -resizeterm \ -ripoffline \ -scr_dump \ -setupterm \ -slk_color \ -slk_init \ -termattrs \ -tgetent \ -tigetnum \ -tigetstr \ -typeahead \ -use_default_colors \ -vw_printw \ -vsscanf \ -wchgat \ -winsstr \ -wresize \ -wsyncdown \ -) - -CF_NCURSES_EXT_FUNCS - -AC_CACHE_CHECK(for wide-character functions,cf_cv_widechar_funcs,[ -AC_TRY_LINK([ -#include <${cf_cv_ncurses_header:-curses.h}>], -[ - static wchar_t src_wchar[2]; - static cchar_t dst_cchar; - setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0); - ], - [cf_cv_widechar_funcs=yes], - [cf_cv_widechar_funcs=no]) -]) -if test "$cf_cv_widechar_funcs" != no ; then - AC_DEFINE(USE_WIDEC_SUPPORT,1) -else - AC_DEFINE(USE_WIDEC_SUPPORT,0) -fi - -AC_FUNC_VFORK -CF_SYS_TIME_SELECT -CF_FUNC_CURSES_VERSION -CF_CURSES_ACS_MAP -CF_CURSES_WACS_MAP -CF_CURSES_WACS_SYMBOLS - -CF_CURSES_CHECK_TYPE(attr_t,long) - -CF_WCHAR_TYPE(mbstate_t, NCURSES_MBSTATE_T, NCURSES_OK_MBSTATE_T) -CF_WCHAR_TYPE(wchar_t, NCURSES_WCHAR_T, NCURSES_OK_WCHAR_T) -CF_WCHAR_TYPE(wint_t, NCURSES_WINT_T, NCURSES_OK_WINT_T) - -if test "$NCURSES_OK_MBSTATE_T" = 0 ; then - CF_CURSES_CHECK_TYPE(mbstate_t,long) -fi - -if test "$NCURSES_OK_WCHAR_T" = 0 ; then - CF_CURSES_CHECK_TYPE(wchar_t,long) -fi - -if test "$NCURSES_OK_WINT_T" = 0 ; then - CF_CURSES_CHECK_TYPE(wint_t,long) -fi - -CF_CURSES_CHECK_DATA(boolnames) -CF_CURSES_CHECK_DATA(boolfnames) - -TEST_ARGS="$LIBS" -LIBS= - -dnl --------------------------------------------------------------------------- - -AC_OUTPUT(Makefile,[ -CF_PRG_RULES([$srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD"], .) - cat >>Makefile <>Makefile <>Makefile < - -#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#define MY_LOGFILE "demo_altkeys.log" -#define MY_KEYS (KEY_MAX + 1) - -/* - * Log the most recently-written line to our logfile - */ -static void -log_last_line(WINDOW *win) -{ - FILE *fp; - int y, x, n; - char temp[256]; - - if ((fp = fopen(MY_LOGFILE, "a")) != 0) { - int need = sizeof(temp) - 1; - if (need > COLS) - need = COLS; - getyx(win, y, x); - wmove(win, y - 1, 0); - n = winnstr(win, temp, need); - while (n-- > 0) { - if (isspace(UChar(temp[n]))) - temp[n] = '\0'; - else - break; - } - wmove(win, y, x); - fprintf(fp, "%s\n", temp); - fclose(fp); - } -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - int n; - int ch; -#if HAVE_GETTIMEOFDAY - int secs, msecs; - struct timeval current, previous; -#endif - - 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 */ - - scrollok(stdscr, TRUE); - keypad(stdscr, TRUE); - move(0, 0); - - /* we do the define_key() calls after keypad(), since the first call to - * keypad() initializes the corresponding data. - */ - for (n = 0; n < 255; ++n) { - char temp[10]; - sprintf(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); - define_key(temp, n + MY_KEYS); - free(temp); - free(value); - } - } - -#if HAVE_GETTIMEOFDAY - gettimeofday(&previous, 0); -#endif - - while ((ch = getch()) != ERR) { - bool escaped = (ch >= MY_KEYS); - const char *name = keyname(escaped ? (ch - MY_KEYS) : ch); - -#if HAVE_GETTIMEOFDAY - gettimeofday(¤t, 0); - secs = (int) (current.tv_sec - previous.tv_sec); - msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000); - if (msecs < 0) { - msecs += 1000; - --secs; - } - if (msecs >= 1000) { - secs += msecs / 1000; - msecs %= 1000; - } - printw("%6d.%03d ", secs, msecs); - previous = current; -#endif - printw("Keycode %d, name %s%s\n", - ch, - escaped ? "ESC-" : "", - name != 0 ? name : ""); - log_last_line(stdscr); - clrtoeol(); - if (ch == 'q') - break; - } - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/demo_defkey.c b/test/demo_defkey.c deleted file mode 100644 index ac6dc2df79e..00000000000 --- a/test/demo_defkey.c +++ /dev/null @@ -1,282 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2002-2007,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 * - * "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_defkey.c,v 1.20 2010/11/14 00:59:35 tom Exp $ - * - * Demonstrate the define_key() function. - * Thomas Dickey - 2002/11/23 - */ - -#include - -#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS - -#define MY_LOGFILE "demo_defkey.log" - -/* - * Log the most recently-written line to our logfile - */ -static void -log_last_line(WINDOW *win) -{ - FILE *fp; - int y, x, n; - char temp[256]; - - if ((fp = fopen(MY_LOGFILE, "a")) != 0) { - int need = sizeof(temp) - 1; - if (need > COLS) - need = COLS; - getyx(win, y, x); - wmove(win, y - 1, 0); - n = winnstr(win, temp, need); - while (n-- > 0) { - if (isspace(UChar(temp[n]))) - temp[n] = '\0'; - else - break; - } - wmove(win, y, x); - fprintf(fp, "%s\n", temp); - fclose(fp); - } -} - -/* - * Convert a character to visible form. - */ -static char * -visichar(int ch) -{ - static char temp[10]; - - ch = UChar(ch); - assert(ch >= 0 && ch < 256); - if (ch == '\\') { - strcpy(temp, "\\\\"); - } else if (ch == '\033') { - strcpy(temp, "\\E"); - } else if (ch < ' ') { - sprintf(temp, "\\%03o", ch); - } else if (ch >= 127) { - sprintf(temp, "\\%03o", ch); - } else { - sprintf(temp, "%c", ch); - } - return temp; -} - -/* - * Convert a string to visible form. - */ -static char * -visible(const char *string) -{ - char *result = 0; - size_t need = 1; - int pass; - int n; - - if (string != 0 && *string != '\0') { - for (pass = 0; pass < 2; ++pass) { - for (n = 0; string[n] != '\0'; ++n) { - char temp[80]; - strcpy(temp, visichar(string[n])); - if (pass) - strcat(result, temp); - else - need += strlen(temp); - } - if (!pass) - result = typeCalloc(char, need); - } - } else { - result = typeCalloc(char, 1); - } - return result; -} - -static void -really_define_key(WINDOW *win, const char *new_string, int code) -{ - int rc; - const char *code_name = keyname(code); - char *old_string; - char *vis_string = 0; - char temp[80]; - - if (code_name == 0) { - sprintf(temp, "Keycode %d", code); - code_name = temp; - } - - if ((old_string = keybound(code, 0)) != 0) { - wprintw(win, "%s is %s\n", - code_name, - vis_string = visible(old_string)); - } else { - wprintw(win, "%s is not bound\n", - code_name); - } - log_last_line(win); - - if (vis_string != 0) { - free(vis_string); - vis_string = 0; - } - - vis_string = visible(new_string); - if ((rc = key_defined(new_string)) > 0) { - wprintw(win, "%s was bound to %s\n", vis_string, keyname(rc)); - log_last_line(win); - } else if (new_string != 0 && rc < 0) { - wprintw(win, "%s conflicts with longer strings\n", vis_string); - log_last_line(win); - } - rc = define_key(new_string, code); - if (rc == ERR) { - wprintw(win, "%s unchanged\n", code_name); - log_last_line(win); - } else if (new_string != 0) { - wprintw(win, "%s is now bound to %s\n", - vis_string, - code_name); - log_last_line(win); - } else if (old_string != 0) { - wprintw(win, "%s deleted\n", code_name); - log_last_line(win); - } - if (vis_string != 0) - free(vis_string); - if (old_string != 0) - free(old_string); -} - -static void -duplicate(WINDOW *win, NCURSES_CONST char *name, int code) -{ - char *value = tigetstr(name); - - if (value != 0) { - const char *prefix = 0; - char temp[BUFSIZ]; - - if (!strncmp(value, "\033[", 2)) { - prefix = "\033O"; - } else if (!strncmp(value, "\033O", 2)) { - prefix = "\033["; - } - if (prefix != 0) { - sprintf(temp, "%s%s", prefix, value + 2); - really_define_key(win, temp, code); - } - } -} - -static void -redefine(WINDOW *win, char *string, int code) -{ - really_define_key(win, string, code); -} - -static void -remove_definition(WINDOW *win, int code) -{ - really_define_key(win, 0, code); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - char *fkeys[12]; - int n; - int ch; - WINDOW *win; - - unlink(MY_LOGFILE); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - printw("This demo is best on xterm: it reverses the definitions for f1-f12,\n"); - printw("adds duplicate definitions for cursor application and normal modes,\n"); - printw("and removes any definitions for the mini keypad. Type any of those:\n"); - refresh(); - - win = newwin(LINES - 3, COLS, 3, 0); - scrollok(win, TRUE); - keypad(win, TRUE); - wmove(win, 0, 0); - - /* we do the define_key() calls after keypad(), since the first call to - * keypad() initializes the corresponding data. - */ - for (n = 0; n < 12; ++n) { - char name[10]; - sprintf(name, "kf%d", n + 1); - fkeys[n] = tigetstr(name); - } - for (n = 0; n < 12; ++n) { - redefine(win, fkeys[11 - n], KEY_F(n + 1)); - } - - duplicate(win, "kcub1", KEY_LEFT); - duplicate(win, "kcuu1", KEY_UP); - duplicate(win, "kcud1", KEY_DOWN); - duplicate(win, "kcuf1", KEY_RIGHT); - - remove_definition(win, KEY_A1); - remove_definition(win, KEY_A3); - remove_definition(win, KEY_B2); - remove_definition(win, KEY_C1); - remove_definition(win, KEY_C3); - - really_define_key(win, "\033O", 1023); - - while ((ch = wgetch(win)) != ERR) { - const char *name = keyname(ch); - wprintw(win, "Keycode %d, name %s\n", - ch, - name != 0 ? name : ""); - log_last_line(win); - wclrtoeol(win); - if (ch == 'q') - break; - } - endwin(); - ExitProgram(EXIT_FAILURE); -} -#else -int -main(void) -{ - printf("This program requires the ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/demo_forms.c b/test/demo_forms.c deleted file mode 100644 index afa4ed32c22..00000000000 --- a/test/demo_forms.c +++ /dev/null @@ -1,550 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2003-2010,2011 Free 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_forms.c,v 1.38 2011/01/15 18:15:11 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 - -field_term - -form_init - -form_opts - -form_opts_off - -form_opts_on - -form_request_by_name - -form_term - -form_userptr - -free_fieldtype - -link_field - -link_fieldtype - -move_field - -new_page - -pos_form_cursor - -set_field_init - -set_field_term - -set_fieldtype_arg - -set_fieldtype_choice - -set_form_fields - -set_form_init - -set_form_opts - -set_form_page - -set_form_term - -set_form_userptr - -set_max_field - -*/ - -#include - -#if USE_LIBFORM - -#include - -static int d_option = 0; -static int j_value = 0; -static int m_value = 0; -static int o_value = 0; -static char *t_value = 0; - -static FIELD * -make_label(int frow, int fcol, NCURSES_CONST char *label) -{ - FIELD *f = new_field(1, (int) strlen(label), frow, fcol, 0, 0); - - if (f) { - set_field_buffer(f, 0, label); - set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE)); - } - return (f); -} - -/* - * Define each field with an extra one, for reflecting "actual" text. - */ -static FIELD * -make_field(int frow, int fcol, int rows, int cols) -{ - FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1); - - if (f) { - FieldAttrs *ptr; - - set_field_back(f, A_UNDERLINE); - /* - * If -j and -d options are combined, -j loses. It is documented in - * "Character User Interface Programming", page 12-15 that setting - * O_STATIC off makes the form library ignore justification. - */ - set_field_just(f, j_value); - if (d_option) { - if (has_colors()) { - set_field_fore(f, COLOR_PAIR(2)); - set_field_back(f, A_UNDERLINE | COLOR_PAIR(3)); - } else { - set_field_fore(f, A_BOLD); - } - /* - * The field_opts_off() call dumps core with Solaris curses, - * but that is a known bug in Solaris' form library -TD - */ - field_opts_off(f, O_STATIC); - set_max_field(f, m_value); - } - - /* - * The userptr is used in edit_field.c's inactive_field(). - */ - ptr = (FieldAttrs *) field_userptr(f); - if (ptr == 0) { - ptr = typeCalloc(FieldAttrs, 1); - ptr->background = field_back(f); - } - set_field_userptr(f, (void *) ptr); - if (t_value) - set_field_buffer(f, 0, t_value); - } - return (f); -} - -static void -display_form(FORM * f) -{ - WINDOW *w; - int rows, cols; - - scale_form(f, &rows, &cols); - - /* - * Put the form at the upper-left corner of the display, with just a box - * around it. - */ - if ((w = newwin(rows + 2, cols + 4, 0, 0)) != (WINDOW *) 0) { - set_form_win(f, w); - set_form_sub(f, derwin(w, rows, cols, 1, 2)); - box(w, 0, 0); - keypad(w, TRUE); - } - - if (post_form(f) != E_OK) - wrefresh(w); -} - -static void -erase_form(FORM * f) -{ - WINDOW *w = form_win(f); - WINDOW *s = form_sub(f); - - unpost_form(f); - werase(w); - wrefresh(w); - delwin(s); - delwin(w); -} - -static void -show_insert_mode(bool insert_mode) -{ - MvAddStr(5, 57, (insert_mode - ? "form_status: insert " - : "form_status: overlay")); -} - -#define O_SELECTABLE (O_ACTIVE | O_VISIBLE) - -static FIELD * -another_field(FORM * form, FIELD * field) -{ - FIELD **f = form_fields(form); - FIELD *result = 0; - int n; - - for (n = 0; f[n] != 0; ++n) { - if (f[n] != field) { - result = f[n]; - field_opts_on(result, O_SELECTABLE); - break; - } - } - return result; -} - -static int -my_form_driver(FORM * form, int c) -{ - static bool insert_mode = TRUE; - FIELD *field; - - switch (c) { - case MY_QUIT: - if (form_driver(form, REQ_VALIDATION) == E_OK) - return (TRUE); - break; - case MY_HELP: - help_edit_field(); - break; - case MY_EDT_MODE: - if ((field = current_field(form)) != 0) { - set_current_field(form, another_field(form, field)); - if ((unsigned) field_opts(field) & O_EDIT) { - field_opts_off(field, O_EDIT); - set_field_status(field, 0); - } else { - field_opts_on(field, O_EDIT); - } - set_current_field(form, field); - } - break; - case MY_INS_MODE: - /* there should be a form_status() function, but there is none */ - if (!insert_mode) { - if (form_driver(form, REQ_INS_MODE) == E_OK) { - insert_mode = TRUE; - } - } else { - if (form_driver(form, REQ_OVL_MODE) == E_OK) { - insert_mode = FALSE; - } - } - show_insert_mode(insert_mode); - refresh(); - break; - default: - beep(); - break; - } - return (FALSE); -} - -static void -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; - - if (has_colors()) { - wbkgd(win, COLOR_PAIR(1)); - } - werase(win); - form_getyx(form, currow, curcol); - wprintw(win, "Cursor: %d,%d", currow, curcol); - if (data_ahead(form)) - waddstr(win, " ahead"); - if (data_behind(form)) - waddstr(win, " behind"); - waddch(win, '\n'); - if ((field = current_field(form)) != 0) { - wprintw(win, "Page %d%s, Field %d/%d%s:", - form_page(form), - new_page(field) ? "*" : "", - field_index(field), field_count(form), - field_arg(field) ? "(arg)" : ""); - if ((type = field_type(field)) != 0) { - if (type == TYPE_ALNUM) - waddstr(win, "ALNUM"); - else if (type == TYPE_ALPHA) - waddstr(win, "ALPHA"); - else if (type == TYPE_ENUM) - waddstr(win, "ENUM"); - else if (type == TYPE_INTEGER) - waddstr(win, "INTEGER"); -#ifdef NCURSES_VERSION - else if (type == TYPE_IPV4) - waddstr(win, "IPV4"); -#endif - else if (type == TYPE_NUMERIC) - waddstr(win, "NUMERIC"); - else if (type == TYPE_REGEXP) - waddstr(win, "REGEXP"); - else - waddstr(win, "other"); - } - - if ((unsigned) field_opts(field) & O_EDIT) - waddstr(win, " editable"); - else - waddstr(win, " readonly"); - - if (field_status(field)) - waddstr(win, " modified"); - - if (dynamic_field_info(field, &field_rows, &field_cols, &field_max) - != ERR) { - wprintw(win, " size %dx%d (max %d)", - field_rows, field_cols, field_max); - } - - waddch(win, ' '); - (void) wattrset(win, field_fore(field)); - waddstr(win, "fore"); - wattroff(win, field_fore(field)); - - waddch(win, '/'); - - (void) wattrset(win, field_back(field)); - waddstr(win, "back"); - wattroff(win, field_back(field)); - - wprintw(win, ", pad '%c'", - field_pad(field)); - - waddstr(win, "\n"); - for (nbuf = 0; nbuf <= 2; ++nbuf) { - if ((buffer = field_buffer(field, nbuf)) != 0) { - wprintw(win, "buffer %d:", nbuf); - (void) wattrset(win, A_REVERSE); - waddstr(win, buffer); - wattroff(win, A_REVERSE); - waddstr(win, "\n"); - } - } - } - wrefresh(win); -} - -static void -demo_forms(void) -{ - WINDOW *w; - FORM *form; - FIELD *f[100]; /* FIXME memset to zero */ - int finished = 0, c; - unsigned n = 0; - int pg; - WINDOW *also; - -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif - - help_edit_field(); - - MvAddStr(4, 57, "Forms Entry Test"); - show_insert_mode(TRUE); - - refresh(); - - /* describe the form */ - memset(f, 0, sizeof(f)); - for (pg = 0; pg < 4; ++pg) { - char label[80]; - sprintf(label, "Sample Form Page %d", pg + 1); - f[n++] = make_label(0, 15, label); - set_new_page(f[n - 1], TRUE); - - switch (pg) { - default: - f[n++] = make_label(2, 0, "Last Name"); - f[n++] = make_field(3, 0, 1, 18); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - - f[n++] = make_label(2, 20, "First Name"); - f[n++] = make_field(3, 20, 1, 12); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - - f[n++] = make_label(2, 34, "Middle Name"); - f[n++] = make_field(3, 34, 1, 12); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - break; - case 1: - f[n++] = make_label(2, 0, "Last Name"); - f[n++] = make_field(3, 0, 1, 18); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - - f[n++] = make_label(2, 20, "First Name"); - f[n++] = make_field(3, 20, 1, 12); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - - f[n++] = make_label(2, 34, "MI"); - f[n++] = make_field(3, 34, 1, 1); - set_field_pad(f[n - 1], '?'); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - break; - case 2: - f[n++] = make_label(2, 0, "Host Name"); - f[n++] = make_field(3, 0, 1, 18); - set_field_type(f[n - 1], TYPE_ALNUM, 1); - -#ifdef NCURSES_VERSION - f[n++] = make_label(2, 20, "IP Address"); - f[n++] = make_field(3, 20, 1, 12); - set_field_type(f[n - 1], TYPE_IPV4, 1); -#endif - - break; - - case 3: - f[n++] = make_label(2, 0, "Four digits"); - f[n++] = make_field(3, 0, 1, 18); - set_field_type(f[n - 1], TYPE_INTEGER, 4, 0, 0); - - f[n++] = make_label(2, 20, "Numeric"); - f[n++] = make_field(3, 20, 1, 12); - set_field_type(f[n - 1], TYPE_NUMERIC, 3, -10000.0, 100000000.0); - - break; - } - - f[n++] = make_label(5, 0, "Comments"); - f[n++] = make_field(6, 0, 4, 46); - set_field_buffer(f[n - 1], 0, "HELLO\nWORLD!"); - set_field_buffer(f[n - 1], 1, "Hello\nWorld!"); - } - - f[n] = (FIELD *) 0; - - if ((form = new_form(f)) != 0) { - - display_form(form); - - w = form_win(form); - also = newwin(getmaxy(stdscr) - getmaxy(w), COLS, getmaxy(w), 0); - show_current_field(also, form); - - while (!finished) { - switch (edit_field(form, &c)) { - case E_OK: - break; - case E_UNKNOWN_COMMAND: - finished = my_form_driver(form, c); - break; - default: - beep(); - break; - } - show_current_field(also, form); - } - - erase_form(form); - - free_form(form); - } - for (c = 0; f[c] != 0; c++) { - void *ptr = field_userptr(f[c]); - free(ptr); - free_field(f[c]); - } - noraw(); - nl(); - -#ifdef NCURSES_MOUSE_VERSION - mousemask(0, (mmask_t *) 0); -#endif -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: demo_forms [options]" - ,"" - ," -d make fields dynamic" - ," -j value justify (1=left, 2=center, 3=right)" - ," -m value set maximum size of dynamic fields" - ," -o value specify number of offscreen rows in new_field()" - ," -t value specify text to fill fields initially" - }; - unsigned int j; - for (j = 0; j < SIZEOF(tbl); ++j) - fprintf(stderr, "%s\n", tbl[j]); - exit(EXIT_FAILURE); -} - -int -main(int argc, char *argv[]) -{ - int ch; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "dj:m:o:t:")) != -1) { - switch (ch) { - case 'd': - d_option = TRUE; - break; - case 'j': - j_value = atoi(optarg); - if (j_value < NO_JUSTIFICATION - || j_value > JUSTIFY_RIGHT) - usage(); - break; - case 'm': - m_value = atoi(optarg); - break; - case 'o': - o_value = atoi(optarg); - break; - case 't': - t_value = optarg; - break; - default: - usage(); - - } - } - - initscr(); - cbreak(); - noecho(); - raw(); - nonl(); /* lets us read ^M's */ - intrflush(stdscr, FALSE); - keypad(stdscr, TRUE); - - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - init_pair(2, COLOR_GREEN, COLOR_BLACK); - init_pair(3, COLOR_CYAN, COLOR_BLACK); - bkgd(COLOR_PAIR(1)); - refresh(); - } - - demo_forms(); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the curses form library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/demo_keyok.c b/test/demo_keyok.c deleted file mode 100644 index 8724d9819ea..00000000000 --- a/test/demo_keyok.c +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2002-2003,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"), 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_keyok.c,v 1.5 2006/11/04 20:09:51 tom Exp $ - * - * Demonstrate the keyok() function. - * Thomas Dickey - 2002/11/23 - */ - -#include - -#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - int lastch = ERR; - int ch; - WINDOW *win; - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - printw("Typing any function key will disable it, but typing it twice in\n"); - printw("a row will turn it back on (just for a demo)."); - refresh(); - - win = newwin(LINES - 2, COLS, 2, 0); - scrollok(win, TRUE); - keypad(win, TRUE); - wmove(win, 0, 0); - - while ((ch = wgetch(win)) != ERR) { - const char *name = keyname(ch); - wprintw(win, "Keycode %d, name %s\n", - ch, - name != 0 ? name : ""); - wclrtoeol(win); - wrefresh(win); - if (ch >= KEY_MIN) { - keyok(ch, FALSE); - lastch = ch; - } else if (lastch >= KEY_MIN) { - keyok(lastch, TRUE); - } - } - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/demo_menus.c b/test/demo_menus.c deleted file mode 100644 index 4f758079e79..00000000000 --- a/test/demo_menus.c +++ /dev/null @@ -1,902 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2005-2010,2011 Free 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_menus.c,v 1.32 2011/01/15 20:02:47 tom Exp $ - * - * Demonstrate a variety of functions from the menu library. - * Thomas Dickey - 2005/4/9 - */ -/* -item_description - -item_init - -item_opts - -item_opts_off - -item_opts_on - -item_term - -item_userptr - -item_visible - -menu_back - -menu_fore - -menu_format - -menu_grey - -menu_init - -menu_opts - -menu_pad - -menu_request_by_name - -menu_request_name - -menu_sub - -menu_term - -menu_userptr - -set_current_item - -set_item_init - -set_item_opts - -set_item_term - -set_item_userptr - -set_menu_grey - -set_menu_init - -set_menu_items - -set_menu_opts - -set_menu_pad - -set_menu_pattern - -set_menu_spacing - -set_menu_term - -set_menu_userptr - -set_top_row - -top_row - -*/ - -#include - -#if USE_LIBMENU - -#include - -#include -#include - -#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 { - eBanner = -1 - ,eFile - ,eSelect -#ifdef TRACE - ,eTrace -#endif - ,eMAX -} MenuNo; - -#define okMenuNo(n) (((n) > eBanner) && ((n) < eMAX)) - -#define MENU_Y 1 - -static MENU *mpBanner; -static MENU *mpFile; -static MENU *mpSelect; - -static bool loaded_file = FALSE; - -#if !HAVE_STRDUP -#define strdup my_strdup -static char * -strdup(char *s) -{ - char *p = typeMalloc(char, strlen(s) + 1); - if (p) - strcpy(p, s); - return (p); -} -#endif /* not HAVE_STRDUP */ - -/* Common function to allow ^T to toggle trace-mode in the middle of a test - * so that trace-files can be made smaller. - */ -static int -wGetchar(WINDOW *win) -{ - int c; -#ifdef TRACE - while ((c = wgetch(win)) == CTRL('T')) { - if (_nc_tracing) { - save_trace = _nc_tracing; - Trace(("TOGGLE-TRACING OFF")); - _nc_tracing = 0; - } else { - _nc_tracing = save_trace; - } - trace(_nc_tracing); - if (_nc_tracing) - Trace(("TOGGLE-TRACING ON")); - } -#else - c = wgetch(win); -#endif - return c; -} -#define Getchar() wGetchar(stdscr) - -static int -menu_virtualize(int c) -{ - int result; - - if (c == '\n' || c == KEY_EXIT) - result = (MAX_COMMAND + 1); - else if (c == 'u') - result = (REQ_SCR_ULINE); - else if (c == 'd') - result = (REQ_SCR_DLINE); - else if (c == 'b' || c == KEY_NPAGE) - result = (REQ_SCR_UPAGE); - else if (c == 'f' || c == KEY_PPAGE) - result = (REQ_SCR_DPAGE); - else if (c == 'l' || c == KEY_LEFT || c == KEY_BTAB) - result = (REQ_LEFT_ITEM); - else if (c == 'n' || c == KEY_DOWN) - result = (REQ_NEXT_ITEM); - else if (c == 'p' || c == KEY_UP) - result = (REQ_PREV_ITEM); - else if (c == 'r' || c == KEY_RIGHT || c == '\t') - result = (REQ_RIGHT_ITEM); - else if (c == ' ') - result = (REQ_TOGGLE_ITEM); - else { - if (c != KEY_MOUSE) - beep(); - result = (c); - } - return result; -} - -static int -menu_getc(MENU * m) -{ - return wGetchar(menu_win(m)); -} - -static int -menu_offset(MenuNo number) -{ - int result = 0; - - if (okMenuNo(number)) { - int spc_desc, spc_rows, spc_cols; - -#ifdef NCURSES_VERSION - menu_spacing(mpBanner, &spc_desc, &spc_rows, &spc_cols); -#else - spc_rows = 0; -#endif - - /* FIXME: MENU.itemlen seems the only way to get actual width of items */ - result = (number - (eBanner + 1)) * (menu_itemwidth(mpBanner) + spc_rows); - } - return result; -} - -static MENU * -menu_create(ITEM ** items, int count, int ncols, MenuNo number) -{ - MENU *result; - WINDOW *menuwin; - int mrows, mcols; - int y = okMenuNo(number) ? MENU_Y : 0; - int x = menu_offset(number); - int margin = (y == MENU_Y) ? 1 : 0; - int maxcol = (ncols + x) < COLS ? ncols : (COLS - x - 1); - int maxrow = (count + 1) / ncols; - - if ((maxrow + y) >= (LINES - 4)) - maxrow = LINES - 4 - y; - - result = new_menu(items); - - if (has_colors()) { - set_menu_fore(result, COLOR_PAIR(1)); - set_menu_back(result, COLOR_PAIR(2)); - } - - set_menu_format(result, maxrow, maxcol); - scale_menu(result, &mrows, &mcols); - - 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); - if (margin) - box(menuwin, 0, 0); - - set_menu_sub(result, derwin(menuwin, mrows, mcols, margin, margin)); - - post_menu(result); - - return result; -} - -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; - - count = item_count(m); - Trace(("menu_destroy %p count %d", (void *) m, count)); - if ((count > 0) && (m == mpSelect)) { - blob = item_name(*items); - } - - unpost_menu(m); - free_menu(m); - - /* free the extra data allocated in build_select_menu() */ - if ((count > 0) && (m == mpSelect)) { - if (blob && loaded_file) { - Trace(("freeing blob %p", blob)); - free((char *) blob); - } - free(items); - } -#ifdef TRACE - if ((count > 0) && (m == mpTrace)) { - ITEM **ip = items; - while (*ip) - free(*ip++); - } -#endif - } -} - -/* force the given menu to appear */ -static void -menu_display(MENU * m) -{ - touchwin(menu_win(m)); - wrefresh(menu_win(m)); -} - -/*****************************************************************************/ - -static void -build_file_menu(MenuNo number) -{ - static CONST_MENUS char *labels[] = - { - "Exit", - (char *) 0 - }; - static ITEM *items[SIZEOF(labels)]; - - ITEM **ip = items; - CONST_MENUS char **ap; - - for (ap = labels; *ap; ap++) - *ip++ = new_item(*ap, ""); - *ip = (ITEM *) 0; - - mpFile = menu_create(items, SIZEOF(labels) - 1, 1, number); -} - -static int -perform_file_menu(int cmd) -{ - return menu_driver(mpFile, cmd); -} - -/*****************************************************************************/ - -static void -build_select_menu(MenuNo number, char *filename) -{ - static CONST_MENUS char *labels[] = - { - "Lions", - "Tigers", - "Bears", - "(Oh my!)", - "Newts", - "Platypi", - "Lemurs", - "(Oh really?!)", - "Leopards", - "Panthers", - "Pumas", - "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", - "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs, Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", - (char *) 0 - }; - static ITEM **items; - - ITEM **ip; - CONST_MENUS char **ap = 0; - CONST_MENUS char **myList = 0; - unsigned count = 0; - - if (filename != 0) { - struct stat sb; - if (stat(filename, &sb) == 0 - && (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); - CONST_MENUS char **list = typeCalloc(CONST_MENUS char *, size + 1); - - items = typeCalloc(ITEM *, size + 1); - Trace(("build_select_menu blob=%p, items=%p", - (void *) blob, - (void *) items)); - if (blob != 0 && list != 0) { - FILE *fp = fopen(filename, "r"); - if (fp != 0) { - if (fread(blob, sizeof(char), size, fp) == size) { - bool mark = TRUE; - for (j = k = 0; j < size; ++j) { - if (mark) { - list[k++] = blob + j; - mark = FALSE; - } - if (blob[j] == '\n') { - blob[j] = '\0'; - if (k > 0 && *list[k - 1] == '\0') - --k; - mark = TRUE; - } else if (blob[j] == '\t') { - blob[j] = ' '; /* menu items are printable */ - } - } - list[k] = 0; - count = k; - ap = myList = list; - } - fclose(fp); - } - loaded_file = TRUE; - } - } - } - if (ap == 0) { - count = SIZEOF(labels) - 1; - items = typeCalloc(ITEM *, count + 1); - ap = labels; - } - - ip = items; - while (*ap != 0) - *ip++ = new_item(*ap++, ""); - *ip = 0; - - mpSelect = menu_create(items, (int) count, 1, number); - if (myList != 0) - free(myList); -} - -static int -perform_select_menu(int cmd) -{ - return menu_driver(mpSelect, cmd); -} - -/*****************************************************************************/ - -#ifdef TRACE -#define T_TBL(name) { #name, name } -static struct { - const char *name; - unsigned mask; -} t_tbl[] = { - - T_TBL(TRACE_DISABLE), - T_TBL(TRACE_TIMES), - T_TBL(TRACE_TPUTS), - T_TBL(TRACE_UPDATE), - T_TBL(TRACE_MOVE), - T_TBL(TRACE_CHARPUT), - T_TBL(TRACE_ORDINARY), - T_TBL(TRACE_CALLS), - T_TBL(TRACE_VIRTPUT), - T_TBL(TRACE_IEVENT), - T_TBL(TRACE_BITS), - T_TBL(TRACE_ICALLS), - T_TBL(TRACE_CCALLS), - T_TBL(TRACE_DATABASE), - T_TBL(TRACE_ATTRS), - T_TBL(TRACE_MAXIMUM), - { - (char *) 0, 0 - } -}; - -static void -build_trace_menu(MenuNo number) -{ - static ITEM *items[SIZEOF(t_tbl)]; - - ITEM **ip = items; - int n; - - for (n = 0; t_tbl[n].name != 0; n++) - *ip++ = new_item(t_tbl[n].name, ""); - *ip = (ITEM *) 0; - - mpTrace = menu_create(items, SIZEOF(t_tbl) - 1, 2, number); -} - -static char * -tracetrace(unsigned tlevel) -{ - static char *buf; - 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); - } - sprintf(buf, "0x%02x = {", tlevel); - if (tlevel == 0) { - sprintf(buf + strlen(buf), "%s, ", t_tbl[0].name); - } 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, ", "); - } - } - if (buf[strlen(buf) - 2] == ',') - buf[strlen(buf) - 2] = '\0'; - return (strcat(buf, "}")); -} - -/* fake a dynamically reconfigurable menu using the 0th entry to deselect - * the others - */ -static bool -update_trace_menu(MENU * m) -{ - ITEM **items; - ITEM *i, **p; - bool changed = FALSE; - - items = menu_items(m); - i = current_item(m); - if (i == items[0]) { - if (item_value(i)) { - for (p = items + 1; *p != 0; p++) - if (item_value(*p)) { - set_item_value(*p, FALSE); - changed = TRUE; - } - } - } - return changed; -} - -static int -perform_trace_menu(int cmd) -/* interactively set the trace level */ -{ - ITEM **ip; - unsigned newtrace; - int result; - - for (ip = menu_items(mpTrace); *ip; ip++) { - unsigned mask = t_tbl[item_index(*ip)].mask; - if (mask == 0) - set_item_value(*ip, _nc_tracing == 0); - else if ((mask & _nc_tracing) == mask) - set_item_value(*ip, TRUE); - } - - result = menu_driver(mpTrace, cmd); - - if (result == E_OK) { - if (update_trace_menu(mpTrace) || cmd == REQ_TOGGLE_ITEM) { - newtrace = 0; - for (ip = menu_items(mpTrace); *ip; ip++) { - if (item_value(*ip)) - newtrace |= t_tbl[item_index(*ip)].mask; - } - trace(newtrace); - Trace(("trace level interactively set to %s", tracetrace(_nc_tracing))); - - MvPrintw(LINES - 2, 0, - "Trace level is %s\n", tracetrace(_nc_tracing)); - refresh(); - } - } - return result; -} -#endif /* TRACE */ - -/*****************************************************************************/ - -static int -menu_number(void) -{ - return item_index(current_item(mpBanner)) - (eBanner + 1); -} - -static MENU * -current_menu(void) -{ - MENU *result; - - switch (menu_number()) { - case eFile: - result = mpFile; - break; - case eSelect: - result = mpSelect; - break; -#ifdef TRACE - case eTrace: - result = mpTrace; - break; -#endif - default: - result = 0; - break; - } - return result; -} - -static void -build_menus(char *filename) -{ - static CONST_MENUS char *labels[] = - { - "File", - "Select", -#ifdef TRACE - "Trace", -#endif - (char *) 0 - }; - static ITEM *items[SIZEOF(labels)]; - - ITEM **ip = items; - CONST_MENUS char **ap; - - for (ap = labels; *ap; ap++) - *ip++ = new_item(*ap, ""); - *ip = (ITEM *) 0; - - mpBanner = menu_create(items, SIZEOF(labels) - 1, SIZEOF(labels) - 1, eBanner); - set_menu_mark(mpBanner, ">"); - - build_file_menu(eFile); - build_select_menu(eSelect, filename); -#ifdef TRACE - build_trace_menu(eTrace); -#endif -} - -static int -move_menu(MENU * menu, MENU * current, int by_y, int by_x) -{ - WINDOW *top_win = menu_win(menu); - WINDOW *sub_win = menu_sub(menu); - int y0, x0; - int y1, x1; - int result; - - getbegyx(top_win, y0, x0); - y0 += by_y; - x0 += by_x; - - getbegyx(sub_win, y1, x1); - y1 += by_y; - x1 += by_x; - - if ((result = mvwin(top_win, y0, x0)) != ERR) { -#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH < 20060218) - sub_win->_begy = y1; - sub_win->_begx = x1; -#else - mvwin(sub_win, y1, x1); -#endif - if (menu == current) { - touchwin(top_win); - wnoutrefresh(top_win); - } - } - return result; -} - -/* - * Move the menus around on the screen, to test mvwin(). - */ -static void -move_menus(MENU * current, int by_y, int by_x) -{ - if (move_menu(mpBanner, current, by_y, by_x) != ERR) { - erase(); - wnoutrefresh(stdscr); - move_menu(mpFile, current, by_y, by_x); - move_menu(mpSelect, current, by_y, by_x); -#ifdef TRACE - move_menu(mpTrace, current, by_y, by_x); -#endif - doupdate(); - } -} - -static void -show_status(int ch, MENU * menu) -{ - move(LINES - 1, 0); - printw("key %s, menu %d, mark %s, match %s", - keyname(ch), - menu_number(), - menu_mark(menu), - menu_pattern(menu)); - clrtoeol(); - refresh(); -} - -static void -perform_menus(void) -{ - MENU *this_menu; - MENU *last_menu = mpFile; - int code = E_UNKNOWN_COMMAND; - int cmd; - int ch = ERR; - -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif - - menu_display(last_menu); - - for (;;) { - - if (ch != ERR) - show_status(ch, last_menu); - - ch = menu_getc(mpBanner); - - /* - * Provide for moving the menu around in the screen using shifted - * cursor keys. - */ - switch (ch) { - case KEY_SF: - move_menus(last_menu, 1, 0); - continue; - case KEY_SR: - move_menus(last_menu, -1, 0); - continue; - case KEY_SLEFT: - move_menus(last_menu, 0, -1); - continue; - case KEY_SRIGHT: - move_menus(last_menu, 0, 1); - continue; - } - cmd = menu_virtualize(ch); - - switch (cmd) { - /* - * The banner menu acts solely to select one of the other menus. - * Move between its items, wrapping at the left/right limits. - */ - case REQ_LEFT_ITEM: - case REQ_RIGHT_ITEM: - code = menu_driver(mpBanner, cmd); - if (code == E_REQUEST_DENIED) { - if (menu_number() > 0) - code = menu_driver(mpBanner, REQ_FIRST_ITEM); - else - code = menu_driver(mpBanner, REQ_LAST_ITEM); - } - break; - default: - switch (menu_number()) { - case eFile: - code = perform_file_menu(cmd); - break; - case eSelect: - code = perform_select_menu(cmd); - break; -#ifdef TRACE - case eTrace: - code = perform_trace_menu(cmd); - break; -#endif - } - - if ((code == E_REQUEST_DENIED) && (cmd == KEY_MOUSE)) { - code = menu_driver(mpBanner, cmd); - } - - break; - } - - if (code == E_OK) { - this_menu = current_menu(); - if (this_menu != last_menu) { - move(1, 0); - clrtobot(); - box(menu_win(this_menu), 0, 0); - refresh(); - - /* force the current menu to appear */ - menu_display(this_menu); - - last_menu = this_menu; - } - } - wrefresh(menu_win(last_menu)); - if (code == E_UNKNOWN_COMMAND - || code == E_NOT_POSTED) { - if (menu_number() == eFile) - break; - beep(); - } - if (code == E_REQUEST_DENIED) - beep(); - continue; - } - -#ifdef NCURSES_MOUSE_VERSION - mousemask(0, (mmask_t *) 0); -#endif -} - -static void -destroy_menus(void) -{ - menu_destroy(mpFile); - menu_destroy(mpSelect); -#ifdef TRACE - menu_destroy(mpTrace); -#endif - menu_destroy(mpBanner); -} - -#if HAVE_RIPOFFLINE -static int -rip_footer(WINDOW *win, int cols) -{ - wbkgd(win, A_REVERSE); - werase(win); - wmove(win, 0, 0); - wprintw(win, "footer: %d columns", cols); - wnoutrefresh(win); - return OK; -} - -static int -rip_header(WINDOW *win, int cols) -{ - wbkgd(win, A_REVERSE); - werase(win); - wmove(win, 0, 0); - wprintw(win, "header: %d columns", cols); - wnoutrefresh(win); - return OK; -} -#endif /* HAVE_RIPOFFLINE */ - -static void -usage(void) -{ - static const char *const tbl[] = - { - "Usage: demo_menus [options]" - ,"" - ,"Options:" -#if HAVE_RIPOFFLINE - ," -f rip-off footer line (can repeat)" - ," -h rip-off header line (can repeat)" -#endif -#ifdef TRACE - ," -t mask specify default trace-level (may toggle with ^T)" -#endif - }; - 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[]) -{ - int c; - - setlocale(LC_ALL, ""); - - while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) { - switch (c) { -#if HAVE_RIPOFFLINE - case 'f': - ripoffline(-1, rip_footer); - break; - case 'h': - ripoffline(1, rip_header); - break; -#endif /* HAVE_RIPOFFLINE */ -#ifdef TRACE - case 't': - trace(strtoul(optarg, 0, 0)); - break; -#endif - default: - usage(); - } - } - - initscr(); - noraw(); - cbreak(); - noecho(); - - if (has_colors()) { - start_color(); - init_pair(1, COLOR_RED, COLOR_BLACK); - init_pair(2, COLOR_BLUE, COLOR_WHITE); - } - build_menus(argc > 1 ? argv[1] : 0); - perform_menus(); - destroy_menus(); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the curses menu library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/demo_panels.c b/test/demo_panels.c deleted file mode 100644 index ce6beb703ce..00000000000 --- a/test/demo_panels.c +++ /dev/null @@ -1,816 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007-2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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_panels.c,v 1.37 2010/05/01 22:19:02 tom Exp $ - * - * Demonstrate a variety of functions from the panel library. - */ - -#include - -#if USE_LIBPANEL - -#include - -#define LAST_POS '@' -#define TEMP_POS '>' - -typedef void (*InitPanel) (void); -typedef void (*FillPanel) (PANEL *); - -static bool use_colors = FALSE; -static bool unboxed = FALSE; -static FILE *log_in; -static FILE *log_out; - -static void -close_input(void) -{ - if (log_in != 0) { - fclose(log_in); - log_in = 0; - } -} - -static void -close_output(void) -{ - if (log_out != 0) { - fclose(log_out); - log_out = 0; - } -} - -static WINDOW * -statusline(void) -{ - WINDOW *result = stdscr; - - wmove(result, LINES - 1, 0); - wclrtoeol(result); - return result; -} - -static void -pflush(void) -{ - update_panels(); - doupdate(); -} - -static void -saywhat(NCURSES_CONST char *text) -{ - WINDOW *win = statusline(); - if (text != 0 && *text != '\0') { - waddstr(win, text); - waddstr(win, "; "); - } - waddstr(win, "press any key to continue"); -} - -static void -show_position(NCURSES_CONST char *text, - NCURSES_CONST char *also, - int which, - int ypos, - int xpos) -{ - WINDOW *win = statusline(); - - wprintw(win, "%s for panel %d now %d,%d%s", text, which, ypos, xpos, also); - wmove(stdscr, ypos, xpos); -} - -static int -get_position(NCURSES_CONST char *text, - NCURSES_CONST char *also, - int which, - int *xpos, - int *ypos) -{ - int result = 0; - int x1, y1; - char cmd; - - getyx(stdscr, y1, x1); - (void) statusline(); - - show_position(text, also, which, y1, x1); - - if (log_in != 0) { - if (fscanf(log_in, "%c%d,%d\n", &cmd, &y1, &x1) == 3) { - switch (cmd) { - case LAST_POS: - result = 1; - (void) wgetch(stdscr); - break; - case TEMP_POS: - result = 0; - wrefresh(stdscr); - napms(100); - break; - default: - result = -1; - break; - } - } else { - result = -1; - } - } else { - - switch (wgetch(stdscr)) { - case QUIT: - case ESCAPE: - case ERR: - result = -1; - break; - case ' ': - result = 1; - break; - case KEY_UP: - if (y1 > 0) { - --y1; - } else { - beep(); - } - break; - case KEY_DOWN: - if (y1 < getmaxy(stdscr)) { - ++y1; - } else { - beep(); - } - break; - case KEY_LEFT: - if (x1 > 0) { - --x1; - } else { - beep(); - } - break; - case KEY_RIGHT: - if (x1 < getmaxx(stdscr)) { - ++x1; - } else { - beep(); - } - break; - } - } - - wmove(stdscr, y1, x1); - *ypos = y1; - *xpos = x1; - - if (result >= 0) { - if (log_out) - fprintf(log_out, "%c%d,%d\n", - ((result > 0) - ? LAST_POS - : TEMP_POS), - y1, x1); - } - return result; -} - -static PANEL * -mkpanel(short color, int rows, int cols, int tly, int tlx) -{ - WINDOW *win; - PANEL *pan = 0; - char *userdata = typeMalloc(char, 3); - - if ((win = newwin(rows, cols, tly, tlx)) != 0) { - keypad(win, TRUE); - if ((pan = new_panel(win)) == 0) { - delwin(win); - } else if (use_colors) { - short fg = (short) ((color == COLOR_BLUE) - ? COLOR_WHITE - : COLOR_BLACK); - short bg = color; - - init_pair(color, fg, bg); - wbkgdset(win, (chtype) (COLOR_PAIR(color) | ' ')); - } else if (!unboxed) { - wbkgdset(win, A_BOLD | ' '); - } - } - sprintf(userdata, "p%d", color % 8); - set_panel_userptr(pan, (NCURSES_CONST void *) userdata); - return pan; -} - -static void -my_remove_panel(PANEL ** pans, int which) -{ - if (pans[which] != 0) { - PANEL *pan = pans[which]; - WINDOW *win = panel_window(pan); - char *user = (char *) panel_userptr(pan); - - free(user); - del_panel(pan); - delwin(win); - - pans[which] = 0; - } -} - -#undef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define ABS(a) ((a) < 0 ? -(a) : (a)) - -static void -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); - short bg = pair; - int x0, y0, x1, y1; - - init_pair(pair, fg, bg); - - /* remove the old panel, if any */ - my_remove_panel(pans, which); - - /* get the position of one corner */ - wmove(stdscr, getmaxy(stdscr) / 2, getmaxx(stdscr) / 2); - getyx(stdscr, y0, x0); - while ((code = get_position("First corner", "", which, &x0, &y0)) == 0) { - ; - } - - if (code > 0) { - char also[80]; - sprintf(also, " (first %d,%d)", y0, x0); - /* get the position of the opposite corner */ - while ((code = get_position("Opposite corner", - also, which, &x1, &y1)) == 0) { - ; - } - - 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); - /* finish */ - myFill(pan); - pans[which] = pan; - pflush(); - wmove(stdscr, y1, x1); - } - } -} - -static void -my_move_panel(PANEL ** pans, int which, bool continuous) -{ - if (pans[which] != 0) { - int code; - int y0, x0; - int y1, x1; - WINDOW *win = panel_window(pans[which]); - char also[80]; - - getbegyx(win, y0, x0); - sprintf(also, " (start %d,%d)", y0, x0); - wmove(stdscr, y0, x0); - while ((code = get_position("Move panel", also, which, &x1, &y1)) == 0) { - if (continuous) { - move_panel(pans[which], y1, x1); - pflush(); - } - } - if (code > 0) { - move_panel(pans[which], y1, x1); - } - } -} - -static void -my_resize_panel(PANEL ** pans, int which, FillPanel myFill) -{ - if (pans[which] != 0) { - int code; - int y0, x0; - int y1, x1; - WINDOW *win = panel_window(pans[which]); - char also[80]; - - getbegyx(win, y0, x0); - sprintf(also, " (start %d,%d)", y0, x0); - wmove(stdscr, y0, x0); - while ((code = get_position("Resize panel", - also, which, &x1, &y1)) == 0) { - ; - } - if (code > 0) { - WINDOW *next = newwin(ABS(y1 - y0) + 1, - ABS(x1 - x0) + 1, - MIN(y0, y1), - MIN(x0, x1)); - if (next != 0) { - keypad(next, TRUE); - if (use_colors) { - wbkgdset(next, (chtype) (COLOR_PAIR(which) | ' ')); - } else if (!unboxed) { - wbkgdset(next, A_BOLD | ' '); - } - replace_panel(pans[which], next); - myFill(pans[which]); - delwin(win); - } - } - } -} - -static void -init_panel(void) -{ - register int y, x; - - for (y = 0; y < LINES - 1; y++) { - for (x = 0; x < COLS; x++) - wprintw(stdscr, "%d", (y + x) % 10); - } -} - -static void -fill_panel(PANEL * pan) -{ - WINDOW *win = panel_window(pan); - const char *userptr = (const char *) panel_userptr(pan); - int num = (userptr && *userptr) ? userptr[1] : '?'; - int y, x; - - wmove(win, 1, 1); - wprintw(win, "-pan%c-", num); - wclrtoeol(win); - box(win, 0, 0); - for (y = 2; y < getmaxy(win) - 1; y++) { - for (x = 1; x < getmaxx(win) - 1; x++) { - wmove(win, y, x); - waddch(win, UChar(num)); - } - } -} - -static void -fill_unboxed(PANEL * pan) -{ - WINDOW *win = panel_window(pan); - const char *userptr = (const char *) panel_userptr(pan); - int num = (userptr && *userptr) ? userptr[1] : '?'; - int y, x; - - for (y = 0; y < getmaxy(win); y++) { - for (x = 0; x < getmaxx(win); x++) { - wmove(win, y, x); - waddch(win, UChar(num)); - } - } -} - -#if USE_WIDEC_SUPPORT -static void -make_fullwidth_digit(cchar_t *target, int digit) -{ - wchar_t source[2]; - - source[0] = digit + 0xff10; - source[1] = 0; - setcchar(target, source, A_NORMAL, 0, 0); -} - -static void -init_wide_panel(void) -{ - int digit; - cchar_t temp[10]; - - for (digit = 0; digit < 10; ++digit) - make_fullwidth_digit(&temp[digit], digit); - - do { - int y, x; - getyx(stdscr, y, x); - digit = (y + x / 2) % 10; - } while (add_wch(&temp[digit]) != ERR); -} - -static void -fill_wide_panel(PANEL * pan) -{ - WINDOW *win = panel_window(pan); - int num = ((const char *) panel_userptr(pan))[1]; - int y, x; - - wmove(win, 1, 1); - wprintw(win, "-pan%c-", num); - wclrtoeol(win); - box(win, 0, 0); - for (y = 2; y < getmaxy(win) - 1; y++) { - for (x = 1; x < getmaxx(win) - 1; x++) { - wmove(win, y, x); - waddch(win, UChar(num)); - } - } -} -#endif - -#define MAX_PANELS 5 - -static int -which_panel(PANEL * px[MAX_PANELS + 1], PANEL * pan) -{ - int result = 0; - int j; - - for (j = 1; j <= MAX_PANELS; ++j) { - if (px[j] == pan) { - result = j; - break; - } - } - return result; -} - -static void -show_panels(PANEL * px[MAX_PANELS + 1]) -{ - static const char *help[] = - { - "", - "Commands are letter/digit pairs. Digits are the panel number.", - "", - " b - put the panel on the bottom of the stack", - " c - create the panel", - " d - delete the panel", - " h - hide the panel", - " 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" - }; - - struct { - bool valid; - bool hidden; - PANEL *above; - PANEL *below; - } table[MAX_PANELS + 1]; - - WINDOW *win; - PANEL *pan; - int j; - - memset(table, 0, sizeof(table)); - for (j = 1; j <= MAX_PANELS; ++j) { - table[j].valid = (px[j] != 0); - if (table[j].valid) { - table[j].hidden = panel_hidden(px[j]); - table[j].above = panel_above(px[j]); - table[j].below = panel_below(px[j]); - } - } - - if ((win = newwin(LINES - 1, COLS, 0, 0)) != 0) { - keypad(win, TRUE); - if ((pan = new_panel(win)) != 0) { - werase(win); - MvWPrintw(win, 0, 0, "Panels:\n"); - for (j = 1; j <= MAX_PANELS; ++j) { - if (table[j].valid) { - wprintw(win, " %d:", j); - if (table[j].hidden) { - waddstr(win, " hidden"); - } else { - if (table[j].above) { - wprintw(win, " above %d", - which_panel(px, table[j].above)); - } - if (table[j].below) { - wprintw(win, "%s below %d", - table[j].above ? "," : "", - which_panel(px, table[j].below)); - } - } - waddch(win, '\n'); - } - } - for (j = 0; j < (int) SIZEOF(help); ++j) { - if (wprintw(win, "%s\n", help[j]) == ERR) - break; - } - wgetch(win); - del_panel(pan); - pflush(); - } - delwin(win); - } -} - -#define wrapper(func) \ -static int my_##func(PANEL *pan) \ -{ \ - int code = ERR; \ - if (pan != 0) { \ - code = func(pan); \ - } \ - return code; \ -} -/* *INDENT-OFF* */ -wrapper(bottom_panel) -wrapper(hide_panel) -wrapper(show_panel) -wrapper(top_panel) -/* *INDENT-ON* */ - -static void -do_panel(PANEL * px[MAX_PANELS + 1], - NCURSES_CONST char *cmd, - FillPanel myFill) -{ - int which = cmd[1] - '0'; - - if (which < 1 || which > MAX_PANELS) { - beep(); - return; - } - - if (log_in != 0) { - pflush(); - } - - saywhat(cmd); - switch (*cmd) { - case 'b': - my_bottom_panel(px[which]); - break; - case 'c': - my_create_panel(px, which, myFill); - break; - case 'd': - my_remove_panel(px, which); - break; - case 'h': - my_hide_panel(px[which]); - break; - case 'm': - my_move_panel(px, which, FALSE); - break; - case 'M': - my_move_panel(px, which, TRUE); - break; - case 'r': - my_resize_panel(px, which, myFill); - break; - case 's': - my_show_panel(px[which]); - break; - case 't': - my_top_panel(px[which]); - break; - } -} - -static bool -ok_letter(int ch) -{ - return isalpha(UChar(ch)) && strchr("bcdhmMrst", ch) != 0; -} - -static bool -ok_digit(int ch) -{ - return isdigit(UChar(ch)) && (ch >= '1') && (ch - '0' <= MAX_PANELS); -} - -/* - * A command consists of one or more letter/digit pairs separated by a space. - * Digits are limited to 1..MAX_PANELS. - * - * End the command with a newline. Reject other characters. - */ -static bool -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); - win = statusline(); - waddstr(win, "Command:"); - buffer[length = 0] = '\0'; - - if (log_in != 0) { - if (fgets(buffer, limit - 3, log_in) != 0) { - length = (int) strlen(buffer); - while (length > 0 && isspace(UChar(buffer[length - 1]))) - buffer[--length] = '\0'; - waddstr(win, buffer); - } else { - close_input(); - } - (void) wgetch(win); - } else { - c0 = 0; - for (;;) { - ch = wgetch(win); - if (ch == ERR || ch == QUIT || ch == ESCAPE) { - buffer[0] = '\0'; - break; - } else if (ch == CTRL('L')) { - wrefresh(curscr); - } else if (ch == '\n' || ch == KEY_ENTER) { - break; - } else if (ch == '?') { - show_panels(px); - } else if (length + 3 < limit) { - if (ch >= KEY_MIN) { - beep(); - } else if (ok_letter(UChar(ch))) { - if (isalpha(UChar(c0))) { - beep(); - } else if (isdigit(UChar(c0))) { - wprintw(win, " %c", ch); - buffer[length++] = ' '; - buffer[length++] = (char) (c0 = ch); - } else { - wprintw(win, "%c", ch); - buffer[length++] = (char) (c0 = ch); - } - } else if (ok_digit(ch)) { - if (isalpha(UChar(c0))) { - wprintw(win, "%c", ch); - buffer[length++] = (char) (c0 = ch); - } else { - beep(); - } - } else if (ch == ' ') { - if (isdigit(UChar(c0))) { - wprintw(win, "%c", ch); - buffer[length++] = (char) (c0 = ch); - } else { - beep(); - } - } else { - beep(); - } - } else { - beep(); - } - } - } - - wmove(stdscr, y0, x0); - - buffer[length] = '\0'; - if (log_out && length) { - fprintf(log_out, "%s\n", buffer); - } - return (length != 0); -} - -static void -demo_panels(InitPanel myInit, FillPanel myFill) -{ - int itmp; - PANEL *px[MAX_PANELS + 1]; - char buffer[BUFSIZ]; - - scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */ - refresh(); - - myInit(); - memset(px, 0, sizeof(px)); - - while (get_command(px, buffer, sizeof(buffer))) { - int limit = (int) strlen(buffer); - for (itmp = 0; itmp < limit; itmp += 3) { - do_panel(px, buffer + itmp, myFill); - } - pflush(); - } -#if NO_LEAKS - for (itmp = 1; itmp <= MAX_PANELS; ++itmp) { - my_remove_panel(px, itmp); - } -#endif -} - -static void -usage(void) -{ - static const char *const tbl[] = - { - "Usage: demo_panels [options]" - ,"" - ,"Options:" - ," -i file read commands from file" - ," -o file record commands in file" - ," -m do not use colors" -#if USE_WIDEC_SUPPORT - ," -w use wide-characters in panels and background" -#endif - ," -x do not enclose panels in boxes" - }; - 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[]) -{ - int c; - bool monochrome = FALSE; - InitPanel myInit = init_panel; - FillPanel myFill = fill_panel; - - setlocale(LC_ALL, ""); - - while ((c = getopt(argc, argv, "i:o:mwx")) != -1) { - switch (c) { - case 'i': - log_in = fopen(optarg, "r"); - break; - case 'o': - log_out = fopen(optarg, "w"); - break; - case 'm': - monochrome = TRUE; - break; -#if USE_WIDEC_SUPPORT - case 'w': - myInit = init_wide_panel; - myFill = fill_wide_panel; - break; -#endif - case 'x': - unboxed = TRUE; - break; - default: - usage(); - } - } - if (unboxed) - myFill = fill_unboxed; - - initscr(); - cbreak(); - noecho(); - keypad(stdscr, TRUE); - - use_colors = monochrome ? FALSE : has_colors(); - if (use_colors) - start_color(); - - demo_panels(myInit, myFill); - endwin(); - - close_input(); - close_output(); - - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the curses panel library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/demo_termcap.c b/test/demo_termcap.c deleted file mode 100644 index a3733c67d1c..00000000000 --- a/test/demo_termcap.c +++ /dev/null @@ -1,311 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2005-2010,2011 Free 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: demo_termcap.c,v 1.14 2011/01/15 21:41:27 tom Exp $ - * - * A simple demo of the termcap interface. - */ -#define USE_TINFO -#include - -#if HAVE_TGETENT - -#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) -#define USE_CODE_LISTS 1 -#else -#define USE_CODE_LISTS 0 -#endif - -#define FCOLS 8 -#define FNAME(type) "%s %-*s = ", #type, FCOLS - -#if USE_CODE_LISTS -static bool b_opt = FALSE; -static bool n_opt = FALSE; -static bool s_opt = FALSE; -#endif - -#define isCapName(c) (isgraph(c) && strchr("^#=:\\", c) == 0) - -static void -dumpit(NCURSES_CONST char *cap) -{ - /* - * One of the limitations of the termcap interface is that the library - * cannot determine the size of the buffer passed via tgetstr(), nor the - * amount of space remaining. This demo simply reuses the whole buffer - * for each call; a normal termcap application would try to use the buffer - * to hold all of the strings extracted from the terminal entry. - */ - char area[1024], *ap = area; - char *str; - int num; - - if ((str = tgetstr(cap, &ap)) != 0) { - /* - * 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"); - } else if ((num = tgetnum(cap)) >= 0) { - printf(FNAME(num), cap); - printf(" %d\n", num); - } else if (tgetflag(cap) > 0) { - printf(FNAME(flg), cap); - printf("%s\n", "true"); - } - fflush(stdout); -} - -static void -brute_force(const char *name) -{ - char buffer[1024]; - - printf("Terminal type %s\n", name); - if (tgetent(buffer, name) >= 0) { - char cap[3]; - int c1, c2; - - cap[2] = 0; - for (c1 = 0; c1 < 256; ++c1) { - cap[0] = (char) c1; - if (isCapName(c1)) { - for (c2 = 0; c2 < 256; ++c2) { - cap[1] = (char) c2; - if (isCapName(c2)) { - dumpit(cap); - } - } - } - } - } -} - -#if USE_CODE_LISTS -static void -demo_terminfo(NCURSES_CONST char *name) -{ - unsigned n; - NCURSES_CONST char *cap; - - printf("Terminal type \"%s\"\n", name); -#if HAVE_SETUPTERM - setupterm(name, 1, (int *) 0); -#else - setterm(name); -#endif - - if (b_opt) { - for (n = 0;; ++n) { - cap = boolcodes[n]; - if (cap == 0) - break; - dumpit(cap); - } - } - - if (n_opt) { - for (n = 0;; ++n) { - cap = numcodes[n]; - if (cap == 0) - break; - dumpit(cap); - } - } - - if (s_opt) { - for (n = 0;; ++n) { - cap = strcodes[n]; - if (cap == 0) - break; - dumpit(cap); - } - } -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: demo_terminfo [options] [terminal]", - "", - "If no options are given, print all (boolean, numeric, string)", - "capabilities for the given terminal, using short names.", - "", - "Options:", - " -a try all names, print capabilities found", - " -b print boolean-capabilities", - " -n print numeric-capabilities", - " -r COUNT repeat for given count", - " -s print string-capabilities", - }; - unsigned n; - for (n = 0; n < SIZEOF(msg); ++n) { - fprintf(stderr, "%s\n", msg[n]); - } - ExitProgram(EXIT_FAILURE); -} -#endif - -int -main(int argc, char *argv[]) -{ - int n; - char *name; - bool a_opt = FALSE; - -#if USE_CODE_LISTS - int repeat; - int r_opt = 1; - - while ((n = getopt(argc, argv, "abnr:s")) != -1) { - switch (n) { - case 'a': - a_opt = TRUE; - break; - case 'b': - b_opt = TRUE; - break; - case 'n': - n_opt = TRUE; - break; - case 'r': - if ((r_opt = atoi(optarg)) <= 0) - usage(); - break; - case 's': - s_opt = TRUE; - break; - default: - usage(); - break; - } - } - - if (!(b_opt || n_opt || s_opt)) { - b_opt = TRUE; - n_opt = TRUE; - s_opt = TRUE; - } -#else - a_opt = TRUE; -#endif - - if (a_opt) { - 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); - } - } -#if USE_CODE_LISTS - else { - for (repeat = 0; repeat < r_opt; ++repeat) { - if (optind < argc) { - for (n = optind; n < argc; ++n) { - demo_terminfo(argv[n]); - } - } else if ((name = getenv("TERM")) != 0) { - demo_terminfo(name); - } else { - static char dumb[] = "dumb"; - demo_terminfo(dumb); - } - } - } -#endif - - ExitProgram(EXIT_SUCCESS); -} - -#else -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - printf("This program requires termcap\n"); - exit(EXIT_FAILURE); -} -#endif diff --git a/test/demo_terminfo.c b/test/demo_terminfo.c deleted file mode 100644 index 2ee5b4c4085..00000000000 --- a/test/demo_terminfo.c +++ /dev/null @@ -1,317 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,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"), 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_terminfo.c,v 1.9 2010/11/28 00:15:27 tom Exp $ - * - * A simple demo of the terminfo interface. - */ -#define USE_TINFO -#include - -#ifdef NCURSES_VERSION -#if !(defined(HAVE_TERM_ENTRY_H) && HAVE_TERM_ENTRY_H) -#undef NCURSES_XNAMES -#define NCURSES_XNAMES 0 -#endif -#if NCURSES_XNAMES -#include -#endif -#endif - -#if HAVE_TIGETSTR -#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) - -static bool b_opt = FALSE; -static bool f_opt = FALSE; -static bool n_opt = FALSE; -static bool s_opt = FALSE; -static bool x_opt = FALSE; - -#define FCOLS 8 -#define FNAME(type) "%s %-*s = ", #type, FCOLS - -static void -dumpit(NCURSES_CONST char *cap) -{ - /* - * One of the limitations of the termcap interface is that the library - * cannot determine the size of the buffer passed via tgetstr(), nor the - * amount of space remaining. This demo simply reuses the whole buffer - * for each call; a normal termcap application would try to use the buffer - * to hold all of the strings extracted from the terminal entry. - */ - const char *str; - int num; - - if ((str = tigetstr(cap)) != 0 && (str != (char *) -1)) { - /* - * 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"); - } else if ((num = tigetnum(cap)) >= 0) { - printf(FNAME(num), cap); - printf(" %d\n", num); - } else if ((num = tigetflag(cap)) >= 0) { - printf(FNAME(flg), cap); - printf("%s\n", num ? "true" : "false"); - } - fflush(stdout); -} - -static void -demo_terminfo(char *name) -{ - unsigned n; - NCURSES_CONST char *cap; - - printf("Terminal type \"%s\"\n", name); - setupterm(name, 1, (int *) 0); - - if (b_opt) { - for (n = 0;; ++n) { - cap = f_opt ? boolfnames[n] : boolnames[n]; - if (cap == 0) - break; - dumpit(cap); - } - } - - if (n_opt) { - for (n = 0;; ++n) { - cap = f_opt ? numfnames[n] : numnames[n]; - if (cap == 0) - break; - dumpit(cap); - } - } - - if (s_opt) { - for (n = 0;; ++n) { - cap = f_opt ? strfnames[n] : strnames[n]; - if (cap == 0) - break; - dumpit(cap); - } - } -#ifdef NCURSES_VERSION - if (x_opt) { - int mod; - if (f_opt) { -#if NCURSES_XNAMES - TERMTYPE *term = &(cur_term->type); - 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)); - } - for (n = NUMCOUNT; n < NUM_NUMBERS(term); ++n) { - dumpit(ExtNumname(term, (int) n, numnames)); - } - for (n = STRCOUNT; n < NUM_STRINGS(term); ++n) { - dumpit(ExtStrname(term, (int) n, strnames)); - } - } -#endif - } else { - char temp[10]; - static const char *xterm_keys[] = - { - "kDC", "kDN", "kEND", "kHOM", "kIC", - "kLFT", "kNXT", "kPRV", "kRIT", "kUP", - }; - for (n = 0; n < SIZEOF(xterm_keys); ++n) { - for (mod = 0; mod < 8; ++mod) { - if (mod == 0) - strcpy(temp, xterm_keys[n]); - else - sprintf(temp, "%s%d", xterm_keys[n], mod); - dumpit(temp); - } - } - } - } -#endif - -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: demo_terminfo [options] [terminal]", - "", - "If no options are given, print all (boolean, numeric, string)", - "capabilities for the given terminal, using short names.", - "", - "Options:", - " -b print boolean-capabilities", - " -f print full names", - " -n print numeric-capabilities", - " -r COUNT repeat for given count", - " -s print string-capabilities", -#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; - int repeat; - char *name; - int r_opt = 1; - - while ((n = getopt(argc, argv, "bfnr:sx")) != -1) { - switch (n) { - case 'b': - b_opt = TRUE; - break; - case 'f': - f_opt = TRUE; - break; - case 'n': - n_opt = TRUE; - break; - case 'r': - if ((r_opt = atoi(optarg)) <= 0) - usage(); - break; - case 's': - s_opt = TRUE; - break; -#ifdef NCURSES_VERSION - case 'x': - x_opt = TRUE; - use_extended_names(TRUE); - break; -#endif - default: - usage(); - break; - } - } - - if (!(b_opt || n_opt || s_opt || x_opt)) { - b_opt = TRUE; - n_opt = TRUE; - s_opt = TRUE; - } - - for (repeat = 0; repeat < r_opt; ++repeat) { - if (optind < argc) { - for (n = optind; n < argc; ++n) { - demo_terminfo(argv[n]); - } - } else if ((name = getenv("TERM")) != 0) { - demo_terminfo(name); - } else { - static char dumb[] = "dumb"; - demo_terminfo(dumb); - } - } - - 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/ditto.c b/test/ditto.c deleted file mode 100644 index 636a6eeceb6..00000000000 --- a/test/ditto.c +++ /dev/null @@ -1,441 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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 (1998-on) - * - * $Id: ditto.c,v 1.40 2010/11/14 01:06:47 tom Exp $ - * - * The program illustrates how to set up multiple screens from a single - * program. - * - * If openpty() is supported, the command line parameters are titles for - * the windows showing each screen's data. - * - * If openpty() is not supported, you must invoke the program by specifying - * another terminal on the same machine by specifying its device, e.g., - * ditto /dev/ttyp1 - */ -#include -#include - -#ifdef USE_PTHREADS -#include -#endif - -#ifdef USE_XTERM_PTY -#include USE_OPENPTY_HEADER -#endif - -#define MAX_FIFO 256 - -#define THIS_FIFO(n) ((n) % MAX_FIFO) -#define NEXT_FIFO(n) THIS_FIFO((n) + 1) - -typedef struct { - unsigned long sequence; - int head; - int tail; - int data[MAX_FIFO]; -} FIFO; - -typedef struct { - unsigned long sequence; -} PEEK; - -/* - * Data "owned" for a single screen. Each screen is divided into windows that - * show the text read from each terminal. Input from a given screen will also - * be read into one window per screen. - */ -typedef struct { - FILE *input; - FILE *output; - SCREEN *screen; /* this screen - curses internal data */ - int which1; /* this screen's index in DITTO[] array */ - int length; /* length of windows[] and peeks[] */ - char **titles; /* per-window titles */ - WINDOW **windows; /* display data from each screen */ - PEEK *peeks; /* indices for each screen's fifo */ - FIFO fifo; /* fifo for this screen */ -#ifdef USE_PTHREADS - pthread_t thread; -#endif -} DITTO; - -/* - * Structure used to pass multiple parameters via the use_screen() - * single-parameter interface. - */ -typedef struct { - int source; /* which screen did character come from */ - int target; /* which screen is character going to */ - DITTO *ditto; /* data for all screens */ -} DDATA; - -static void -failed(const char *s) -{ - perror(s); - ExitProgram(EXIT_FAILURE); -} - -static void -usage(void) -{ - fprintf(stderr, "usage: ditto [terminal1 ...]\n"); - ExitProgram(EXIT_FAILURE); -} - -/* Add to the head of the fifo, checking for overflow. */ -static void -put_fifo(FIFO * fifo, int value) -{ - int next = NEXT_FIFO(fifo->head); - if (next == fifo->tail) - fifo->tail = NEXT_FIFO(fifo->tail); - fifo->data[next] = value; - fifo->head = next; - fifo->sequence += 1; -} - -/* Get data from the tail (oldest part) of the fifo, returning -1 if no data. - * Since each screen can peek into the fifo, we do not update the tail index, - * but modify the peek-index. - * - * FIXME - test/workaround for case where fifo gets more than a buffer - * ahead of peek. - */ -static int -peek_fifo(FIFO * fifo, PEEK * peek) -{ - int result = -1; - if (peek->sequence < fifo->sequence) { - result = fifo->data[THIS_FIFO(peek->sequence)]; - peek->sequence += 1; - } - return result; -} - -static FILE * -open_tty(char *path) -{ - FILE *fp; -#ifdef USE_XTERM_PTY - int amaster; - int aslave; - char slave_name[1024]; - char s_option[sizeof(slave_name) + 80]; - - if (openpty(&amaster, &aslave, slave_name, 0, 0) != 0 - || strlen(slave_name) > sizeof(slave_name) - 1) - failed("openpty"); - if (strrchr(slave_name, '/') == 0) { - errno = EISDIR; - failed(slave_name); - } - sprintf(s_option, "-S%s/%d", slave_name, aslave); - if (fork()) { - execlp("xterm", "xterm", s_option, "-title", path, (char *) 0); - _exit(0); - } - fp = fdopen(amaster, "r+"); - if (fp == 0) - failed(path); -#else - struct stat sb; - - if (stat(path, &sb) < 0) - failed(path); - if ((sb.st_mode & S_IFMT) != S_IFCHR) { - errno = ENOTTY; - failed(path); - } - fp = fopen(path, "r+"); - if (fp == 0) - failed(path); - printf("opened %s\n", path); -#endif - assert(fp != 0); - return fp; -} - -static void -init_screen( -#if HAVE_USE_WINDOW - SCREEN *sp GCC_UNUSED, -#endif - void *arg) -{ - DITTO *target = (DITTO *) arg; - int high, wide; - int k; - - cbreak(); - noecho(); - scrollok(stdscr, TRUE); - box(stdscr, 0, 0); - - target->windows = typeCalloc(WINDOW *, (size_t) target->length); - target->peeks = typeCalloc(PEEK, (size_t) target->length); - - high = (LINES - 2) / target->length; - wide = (COLS - 2); - for (k = 0; k < target->length; ++k) { - WINDOW *outer = newwin(high, wide, 1 + (high * k), 1); - WINDOW *inner = derwin(outer, high - 2, wide - 2, 1, 1); - - box(outer, 0, 0); - MvWAddStr(outer, 0, 2, target->titles[k]); - wnoutrefresh(outer); - - scrollok(inner, TRUE); - keypad(inner, TRUE); -#ifndef USE_PTHREADS - nodelay(inner, TRUE); -#endif - - target->windows[k] = inner; - } - doupdate(); -} - -static void -open_screen(DITTO * target, char **source, int length, int which1) -{ - if (which1 != 0) { - target->input = - target->output = open_tty(source[which1]); - } else { - target->input = stdin; - target->output = stdout; - } - - target->which1 = which1; - target->titles = source; - target->length = length; - target->fifo.head = -1; - target->screen = newterm((char *) 0, /* assume $TERM is the same */ - target->output, - target->input); - - if (target->screen == 0) - failed("newterm"); - - (void) USING_SCREEN(target->screen, init_screen, target); -} - -static int -close_screen( -#if HAVE_USE_WINDOW - SCREEN *sp GCC_UNUSED, -#endif - void *arg GCC_UNUSED) -{ -#if HAVE_USE_WINDOW - (void) sp; -#endif - (void) arg; - return endwin(); -} - -/* - * Read data from the 'source' screen. - */ -static int -read_screen( -#if HAVE_USE_WINDOW - SCREEN *sp GCC_UNUSED, -#endif - void *arg) -{ - DDATA *data = (DDATA *) arg; - DITTO *ditto = &(data->ditto[data->source]); - WINDOW *win = ditto->windows[data->source]; - int ch = wgetch(win); - - if (ch > 0 && ch < 256) - put_fifo(&(ditto->fifo), ch); - else - ch = ERR; - - return ch; -} - -/* - * Write all of the data that's in fifos for the 'target' screen. - */ -static int -write_screen( -#if HAVE_USE_WINDOW - SCREEN *sp GCC_UNUSED, -#endif - void *arg GCC_UNUSED) -{ - DDATA *data = (DDATA *) arg; - DITTO *ditto = &(data->ditto[data->target]); - bool changed = FALSE; - int which; - - for (which = 0; which < ditto->length; ++which) { - WINDOW *win = ditto->windows[which]; - FIFO *fifo = &(data->ditto[which].fifo); - PEEK *peek = &(ditto->peeks[which]); - int ch; - - while ((ch = peek_fifo(fifo, peek)) > 0) { - changed = TRUE; - - waddch(win, (chtype) ch); - wnoutrefresh(win); - } - } - - if (changed) - doupdate(); - return OK; -} - -static void -show_ditto(DITTO * data, int count, DDATA * ddata) -{ - int n; - - (void) data; - for (n = 0; n < count; n++) { - ddata->target = n; - USING_SCREEN(data[n].screen, write_screen, (void *) ddata); - } -} - -#ifdef USE_PTHREADS -static void * -handle_screen(void *arg) -{ - DDATA ddata; - int ch; - - memset(&ddata, 0, sizeof(ddata)); - ddata.ditto = (DITTO *) arg; - ddata.source = ddata.ditto->which1; - ddata.ditto -= ddata.source; /* -> base of array */ - - for (;;) { - ch = read_screen(ddata.ditto->screen, &ddata); - if (ch == CTRL('D')) { - int later = (ddata.source ? ddata.source : -1); - int j; - - for (j = ddata.ditto->length - 1; j > 0; --j) { - if (j != later) { - pthread_cancel(ddata.ditto[j].thread); - } - } - if (later > 0) { - pthread_cancel(ddata.ditto[later].thread); - } - break; - } - show_ditto(ddata.ditto, ddata.ditto->length, &ddata); - } - return NULL; -} -#endif - -int -main(int argc, char *argv[]) -{ - int j; - DITTO *data; -#ifndef USE_PTHREADS - int count; -#endif - - if (argc <= 1) - usage(); - - if ((data = typeCalloc(DITTO, (size_t) argc)) == 0) - failed("calloc data"); - - assert(data != 0); - - for (j = 0; j < argc; j++) { - open_screen(&data[j], argv, argc, j); - } - -#ifdef USE_PTHREADS - /* - * For multi-threaded operation, set up a reader for each of the screens. - * That uses blocking I/O rather than polling for input, so no calls to - * napms() are needed. - */ - for (j = 0; j < argc; j++) { - (void) pthread_create(&(data[j].thread), NULL, handle_screen, &data[j]); - } - pthread_join(data[1].thread, NULL); -#else - /* - * Loop, reading characters from any of the inputs and writing to all - * of the screens. - */ - for (count = 0;; ++count) { - DDATA ddata; - int ch; - int which = (count % argc); - - napms(20); - - ddata.source = which; - ddata.ditto = data; - - ch = USING_SCREEN(data[which].screen, read_screen, &ddata); - if (ch == CTRL('D')) { - break; - } else if (ch != ERR) { - show_ditto(data, argc, &ddata); - } - } -#endif - - /* - * Cleanup and exit - */ - for (j = argc - 1; j >= 0; j--) { - USING_SCREEN(data[j].screen, close_screen, 0); - fprintf(data[j].output, "**Closed\r\n"); - - /* - * Closing before a delscreen() helps ncurses determine that there - * is no valid output buffer, and can remove the setbuf() data. - */ - fflush(data[j].output); - fclose(data[j].output); - delscreen(data[j].screen); - } - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/dots.c b/test/dots.c deleted file mode 100644 index 2533c7e3b49..00000000000 --- a/test/dots.c +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1999-2009,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"), 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 1999 - * - * $Id: dots.c,v 1.22 2010/11/14 01:00:02 tom Exp $ - * - * A simple demo of the terminfo interface. - */ -#define USE_TINFO -#include - -#if HAVE_SETUPTERM - -#include - -#define valid(s) ((s != 0) && s != (char *)-1) - -static bool interrupted = FALSE; -static long total_chars = 0; -static time_t started; - -static int -outc(TPUTS_ARG c) -{ - int rc = c; - - if (interrupted) { - char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) - rc = EOF; - } else { - rc = putc(c, stdout); - } - return rc; -} - -static bool -outs(char *s) -{ - if (valid(s)) { - tputs(s, 1, outc); - return TRUE; - } - return FALSE; -} - -static void -cleanup(void) -{ - outs(exit_attribute_mode); - if (!outs(orig_colors)) - outs(orig_pair); - outs(clear_screen); - outs(cursor_normal); - - printf("\n\n%ld total chars, 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.); -} - -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - int x, y, z, p; - double r; - double c; - - CATCHALL(onsig); - - srand((unsigned) time(0)); - setupterm((char *) 0, 1, (int *) 0); - outs(clear_screen); - outs(cursor_invisible); - if (max_colors > 1) { - if (!valid(set_a_foreground) - || !valid(set_a_background) - || (!valid(orig_colors) && !valid(orig_pair))) - max_colors = -1; - } - - r = (double) (lines - 4); - c = (double) (columns - 4); - started = time((time_t *) 0); - - while (!interrupted) { - x = (int) (c * ranf()) + 2; - y = (int) (r * ranf()) + 2; - p = (ranf() > 0.9) ? '*' : ' '; - - tputs(tparm3(cursor_address, y, x), 1, outc); - if (max_colors > 0) { - z = (int) (ranf() * max_colors); - if (ranf() > 0.01) { - tputs(tparm2(set_a_foreground, z), 1, outc); - } else { - tputs(tparm2(set_a_background, z), 1, outc); - napms(1); - } - } else if (valid(exit_attribute_mode) - && valid(enter_reverse_mode)) { - if (ranf() <= 0.01) { - outs((ranf() > 0.6) - ? enter_reverse_mode - : exit_attribute_mode); - napms(1); - } - } - outc(p); - fflush(stdout); - ++total_chars; - } - cleanup(); - 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/dots_mvcur.c b/test/dots_mvcur.c deleted file mode 100644 index 558683d56fd..00000000000 --- a/test/dots_mvcur.c +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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 * - * "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 - 2007 - * - * $Id: dots_mvcur.c,v 1.6 2010/11/14 01:00:44 tom Exp $ - * - * A simple demo of the terminfo interface, and mvcur. - */ -#define USE_TINFO -#include - -#if HAVE_SETUPTERM - -#include - -#define valid(s) ((s != 0) && s != (char *)-1) - -static bool interrupted = FALSE; -static long total_chars = 0; -static time_t started; - -static int -outc(TPUTS_ARG c) -{ - int rc = c; - - if (interrupted) { - char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) - rc = EOF; - } else { - if (putc(c, stdout) == EOF) - rc = EOF; - } - return rc; -} - -static bool -outs(char *s) -{ - if (valid(s)) { - tputs(s, 1, outc); - return TRUE; - } - return FALSE; -} - -static void -cleanup(void) -{ - outs(exit_attribute_mode); - if (!outs(orig_colors)) - outs(orig_pair); - outs(clear_screen); - outs(cursor_normal); - - printf("\n\n%ld total chars, 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.); -} - -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - int x0 = 1, y0 = 1; - int x, y, z, p; - double r; - double c; - SCREEN *sp; - - CATCHALL(onsig); - - srand((unsigned) time(0)); - sp = newterm((char *) 0, stdout, stdin); - outs(clear_screen); - outs(cursor_home); - outs(cursor_invisible); - if (max_colors > 1) { - if (!valid(set_a_foreground) - || !valid(set_a_background) - || (!valid(orig_colors) && !valid(orig_pair))) - max_colors = -1; - } - - r = (double) (lines - 4); - c = (double) (columns - 4); - started = time((time_t *) 0); - - while (!interrupted) { - x = (int) (c * ranf()) + 2; - y = (int) (r * ranf()) + 2; - p = (ranf() > 0.9) ? '*' : ' '; - - if (mvcur(y0, x0, y, x) != ERR) { - x0 = x; - y0 = y; - } - - if (max_colors > 0) { - z = (int) (ranf() * max_colors); - if (ranf() > 0.01) { - tputs(tparm2(set_a_foreground, z), 1, outc); - } else { - tputs(tparm2(set_a_background, z), 1, outc); - napms(1); - } - } else if (valid(exit_attribute_mode) - && valid(enter_reverse_mode)) { - if (ranf() <= 0.01) { - outs((ranf() > 0.6) - ? enter_reverse_mode - : exit_attribute_mode); - napms(1); - } - } - outc(p); - fflush(stdout); - ++total_chars; - } - cleanup(); - endwin(); - delscreen(sp); - 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/echochar.c b/test/echochar.c deleted file mode 100644 index 829d1f2b429..00000000000 --- a/test/echochar.c +++ /dev/null @@ -1,159 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2006-2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: echochar.c,v 1.8 2010/11/14 01:00:44 tom Exp $ - * - * Demonstrate the echochar function (compare to dots.c). - * Thomas Dickey - 2006/11/4 - */ - -#include - -#include - -#define valid(s) ((s != 0) && s != (char *)-1) - -static bool interrupted = FALSE; -static long total_chars = 0; -static time_t started; - -static void -cleanup(void) -{ - endwin(); - - printf("\n\n%ld total chars, 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 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); - } - attron(COLOR_PAIR(pair)); -} - -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - int ch, x, y, z, p; - double r; - double c; - bool use_colors; - bool opt_r = FALSE; - char *my_pairs = 0; - int last_fg = 0; - int last_bg = 0; - - while ((ch = getopt(argc, argv, "r")) != -1) { - switch (ch) { - case 'r': - opt_r = TRUE; - break; - default: - fprintf(stderr, "usage: echochar [-r]\n"); - ExitProgram(EXIT_FAILURE); - } - } - - CATCHALL(onsig); - initscr(); - - use_colors = has_colors(); - if (use_colors) { - start_color(); - if (COLOR_PAIRS > 0) { - my_pairs = typeCalloc(char, (size_t) COLOR_PAIRS); - } - use_colors = (my_pairs != 0); - } - - srand((unsigned) time(0)); - - curs_set(0); - - r = (double) (LINES - 4); - c = (double) (COLS - 4); - started = time((time_t *) 0); - - while (!interrupted) { - x = (int) (c * ranf()) + 2; - y = (int) (r * ranf()) + 2; - p = (ranf() > 0.9) ? '*' : ' '; - - move(y, x); - if (use_colors > 0) { - z = (int) (ranf() * COLORS); - if (ranf() > 0.01) { - set_color(my_pairs, z, last_bg); - last_fg = z; - } else { - set_color(my_pairs, last_fg, z); - last_bg = z; - napms(1); - } - } else { - if (ranf() <= 0.01) { - if (ranf() > 0.6) - attron(A_REVERSE); - else - attroff(A_REVERSE); - napms(1); - } - } - if (opt_r) { - addch(UChar(p)); - refresh(); - } else { - echochar(UChar(p)); - } - ++total_chars; - } - cleanup(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/edit_field.c b/test/edit_field.c deleted file mode 100644 index 8a664e8ca9a..00000000000 --- a/test/edit_field.c +++ /dev/null @@ -1,465 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2003-2008,2011 Free 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: edit_field.c,v 1.17 2011/01/15 18:15:11 tom Exp $ - * - * A wrapper for form_driver() which keeps track of the user's editing changes - * for each field, and makes the result available as a null-terminated string - * in field_buffer(field,1). - * - * Thomas Dickey - 2003/4/26. - */ - -#include - -#if USE_LIBFORM - -#include - -static struct { - int code; - int result; - const char *help; -} commands[] = { - - { - CTRL('A'), REQ_NEXT_CHOICE, "" - }, - { - CTRL('B'), REQ_PREV_WORD, "go to previous word" - }, - { - CTRL('C'), REQ_CLR_EOL, "clear to end of line" - }, - { - CTRL('D'), REQ_DOWN_FIELD, "move downward to field" - }, - { - CTRL('E'), REQ_END_FIELD, "go to end of field" - }, - { - CTRL('F'), REQ_NEXT_PAGE, "go to next page" - }, - { - CTRL('G'), REQ_DEL_WORD, "delete current word" - }, - { - CTRL('H'), REQ_DEL_PREV, "delete previous character" - }, - { - CTRL('I'), REQ_INS_CHAR, "insert character" - }, - { - CTRL('K'), REQ_CLR_EOF, "clear to end of field" - }, - { - CTRL('L'), REQ_LEFT_FIELD, "go to field to left" - }, - { - CTRL('M'), REQ_NEW_LINE, "insert/overlay new line" - }, - { - CTRL('N'), REQ_NEXT_FIELD, "go to next field" - }, - { - CTRL('O'), REQ_INS_LINE, "insert blank line at cursor" - }, - { - CTRL('P'), REQ_PREV_FIELD, "go to previous field" - }, - { - CTRL('Q'), MY_QUIT, "exit form" - }, - { - CTRL('R'), REQ_RIGHT_FIELD, "go to field to right" - }, - { - CTRL('S'), REQ_BEG_FIELD, "go to beginning of field" - }, - { - CTRL('T'), MY_EDT_MODE, "toggle O_EDIT mode, clear field status", - }, - { - CTRL('U'), REQ_UP_FIELD, "move upward to field" - }, - { - CTRL('V'), REQ_DEL_CHAR, "delete character" - }, - { - CTRL('W'), REQ_NEXT_WORD, "go to next word" - }, - { - CTRL('X'), REQ_CLR_FIELD, "clear field" - }, - { - CTRL('Y'), REQ_DEL_LINE, "delete line" - }, - { - CTRL('Z'), REQ_PREV_CHOICE, "" - }, - { - CTRL('['), MY_QUIT, "exit form" - }, - { - CTRL(']'), MY_INS_MODE, "toggle REQ_INS_MODE/REQ_OVL_MODE", - }, - { - KEY_F(1), MY_HELP, "show this screen", - }, - { - KEY_BACKSPACE, REQ_DEL_PREV, "delete previous character" - }, - { - KEY_DOWN, REQ_DOWN_CHAR, "move down 1 character" - }, - { - KEY_END, REQ_LAST_FIELD, "go to last field" - }, - { - KEY_HOME, REQ_FIRST_FIELD, "go to first field" - }, - { - KEY_LEFT, REQ_LEFT_CHAR, "move left 1 character" - }, - { - KEY_LL, REQ_LAST_FIELD, "go to last field" - }, - { - KEY_NEXT, REQ_NEXT_FIELD, "go to next field" - }, - { - KEY_NPAGE, REQ_NEXT_PAGE, "go to next page" - }, - { - KEY_PPAGE, REQ_PREV_PAGE, "go to previous page" - }, - { - KEY_PREVIOUS, REQ_PREV_FIELD, "go to previous field" - }, - { - KEY_RIGHT, REQ_RIGHT_CHAR, "move right 1 character" - }, - { - KEY_UP, REQ_UP_CHAR, "move up 1 character" - } -}; - -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); - unsigned n; - int ch = ERR; - - begin_popup(); - - keypad(help, TRUE); - keypad(data, TRUE); - waddstr(data, "Defined form edit/traversal keys:\n"); - for (n = 0; n < SIZEOF(commands); ++n) { - const char *name; -#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); - } - 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(); -} - -static int -offset_in_field(FORM * form) -{ - FIELD *field = current_field(form); - int currow, curcol; - - form_getyx(form, currow, curcol); - return curcol + currow * field->dcols; -} - -static void -inactive_field(FIELD * f) -{ - FieldAttrs *ptr = (FieldAttrs *) field_userptr(f); - set_field_back(f, ptr->background); -} - -int -edit_field(FORM * form, int *result) -{ - int ch = wgetch(form_win(form)); - int status; - FIELD *before; - unsigned n; - char lengths[80]; - int length; - char *buffer; - int before_row; - int before_col; - int before_off = offset_in_field(form); - - form_getyx(form, before_row, before_col); - before = current_field(form); - set_field_back(before, A_NORMAL); - if (ch <= KEY_MAX) { - set_field_back(before, A_REVERSE); - } else if (ch <= MAX_FORM_COMMAND) { - inactive_field(before); - } - - *result = ch; - for (n = 0; n < SIZEOF(commands); ++n) { - if (commands[n].code == ch) { - *result = commands[n].result; - break; - } - } - - status = form_driver(form, *result); - - if (status == E_OK) { - bool modified = TRUE; - - length = 0; - if ((buffer = field_buffer(before, 1)) != 0) - length = atoi(buffer); - if (length < before_off) - length = before_off; - switch (*result) { - case REQ_CLR_EOF: - length = before_off; - break; - case REQ_CLR_EOL: - if (before_row + 1 == before->rows) - length = before_off; - break; - case REQ_CLR_FIELD: - length = 0; - break; - case REQ_DEL_CHAR: - if (length > before_off) - --length; - break; - case REQ_DEL_PREV: - if (length > 0) { - if (before_col > 0) { - --length; - } else if (before_row > 0) { - length -= before->cols + before_col; - } - } - break; - case REQ_NEW_LINE: - length += before->cols; - break; -#if 0 - /* FIXME: finish these */ - case REQ_DEL_LINE: /* delete line */ - case REQ_DEL_WORD: /* delete word at cursor */ - case REQ_INS_CHAR: /* insert blank char at cursor */ - case REQ_INS_LINE: /* insert blank line at cursor */ - case REQ_INS_MODE: /* begin insert mode */ - case REQ_OVL_MODE: /* begin overlay mode */ -#endif - /* ignore all of the motion commands */ - case REQ_SCR_BCHAR: /* FALLTHRU */ - case REQ_SCR_BHPAGE: /* FALLTHRU */ - case REQ_SCR_BLINE: /* FALLTHRU */ - case REQ_SCR_BPAGE: /* FALLTHRU */ - case REQ_SCR_FCHAR: /* FALLTHRU */ - case REQ_SCR_FHPAGE: /* FALLTHRU */ - case REQ_SCR_FLINE: /* FALLTHRU */ - case REQ_SCR_FPAGE: /* FALLTHRU */ - case REQ_SCR_HBHALF: /* FALLTHRU */ - case REQ_SCR_HBLINE: /* FALLTHRU */ - case REQ_SCR_HFHALF: /* FALLTHRU */ - case REQ_SCR_HFLINE: /* FALLTHRU */ - case REQ_BEG_FIELD: /* FALLTHRU */ - case REQ_BEG_LINE: /* FALLTHRU */ - case REQ_DOWN_CHAR: /* FALLTHRU */ - case REQ_DOWN_FIELD: /* FALLTHRU */ - case REQ_END_FIELD: /* FALLTHRU */ - case REQ_END_LINE: /* FALLTHRU */ - case REQ_FIRST_FIELD: /* FALLTHRU */ - case REQ_FIRST_PAGE: /* FALLTHRU */ - case REQ_LAST_FIELD: /* FALLTHRU */ - case REQ_LAST_PAGE: /* FALLTHRU */ - case REQ_LEFT_CHAR: /* FALLTHRU */ - case REQ_LEFT_FIELD: /* FALLTHRU */ - case REQ_NEXT_CHAR: /* FALLTHRU */ - case REQ_NEXT_CHOICE: /* FALLTHRU */ - case REQ_NEXT_FIELD: /* FALLTHRU */ - case REQ_NEXT_LINE: /* FALLTHRU */ - case REQ_NEXT_PAGE: /* FALLTHRU */ - case REQ_NEXT_WORD: /* FALLTHRU */ - case REQ_PREV_CHAR: /* FALLTHRU */ - case REQ_PREV_CHOICE: /* FALLTHRU */ - case REQ_PREV_FIELD: /* FALLTHRU */ - case REQ_PREV_LINE: /* FALLTHRU */ - case REQ_PREV_PAGE: /* FALLTHRU */ - case REQ_PREV_WORD: /* FALLTHRU */ - case REQ_RIGHT_CHAR: /* FALLTHRU */ - case REQ_RIGHT_FIELD: /* FALLTHRU */ - case REQ_SFIRST_FIELD: /* FALLTHRU */ - case REQ_SLAST_FIELD: /* FALLTHRU */ - case REQ_SNEXT_FIELD: /* FALLTHRU */ - case REQ_SPREV_FIELD: /* FALLTHRU */ - case REQ_UP_CHAR: /* FALLTHRU */ - case REQ_UP_FIELD: /* FALLTHRU */ - case REQ_VALIDATION: /* FALLTHRU */ - modified = FALSE; - break; - - default: - modified = FALSE; - if (ch >= MIN_FORM_COMMAND) { - beep(); - } else if (isprint(ch)) { - modified = TRUE; - } - break; - } - - /* - * If we do not force a re-validation, then field_buffer 0 will - * be lagging by one character. - */ - if (modified && form_driver(form, REQ_VALIDATION) == E_OK && *result - < MIN_FORM_COMMAND) - ++length; - - sprintf(lengths, "%d", length); - set_field_buffer(before, 1, lengths); - } - - if (current_field(form) != before) - inactive_field(before); - return status; -} -#else - -extern void no_edit_field(void); - -void -no_edit_field(void) -{ -} - -#endif diff --git a/test/edit_field.h b/test/edit_field.h deleted file mode 100644 index eacade37fb8..00000000000 --- a/test/edit_field.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2003-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 * - * "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: edit_field.h,v 1.6 2008/12/20 19:23:18 tom Exp $ - * - * Interface of edit_field.c - */ - -#ifndef EDIT_FORM_H_incl -#define EDIT_FORM_H_incl 1 - -#include - -#define EDIT_FIELD(c) (MAX_FORM_COMMAND + c) - -#define MY_HELP EDIT_FIELD('h') -#define MY_QUIT EDIT_FIELD('q') -#define MY_EDT_MODE EDIT_FIELD('e') -#define MY_INS_MODE EDIT_FIELD('t') - -typedef struct { - chtype background; -} FieldAttrs; - -extern void help_edit_field(void); -extern int edit_field(FORM * form, int *result); - -#endif /* EDIT_FORM_H_incl */ diff --git a/test/filter.c b/test/filter.c deleted file mode 100644 index 489136e8f63..00000000000 --- a/test/filter.c +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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 1998 - * - * $Id: filter.c,v 1.13 2010/11/13 20:55:54 tom Exp $ - */ -#include - -#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. - * - * Ncurses differs slightly from SVr4 curses. The latter does not flush its - * state when exiting program mode, so the attributes on the command lines of - * this program 'bleed' onto the executed commands. Rather than use the - * reset_shell_mode() and reset_prog_mode() functions, we could invoke endwin() - * and refresh(), but that does not work any better. - */ - -static int -new_command(char *buffer, int length, attr_t underline) -{ - int code; - - attron(A_BOLD); - printw("Command: "); - 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. - */ -#ifdef KEY_EVENT - if (code == KEY_EVENT) - strcpy(buffer, "# event!"); -#endif -#ifdef KEY_RESIZE - if (code == KEY_RESIZE) { - strcpy(buffer, "# resize!"); - getch(); - } -#endif - attroff(underline); - attroff(A_BOLD); - printw("\n"); - - return code; -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: filter [options]" - ,"" - ,"Options:" - ," -i use initscr() rather than newterm()" - }; - 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 ch; - char buffer[80]; - attr_t underline; - bool i_option = FALSE; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "i")) != -1) { - switch (ch) { - case 'i': - i_option = TRUE; - break; - default: - usage(); - } - } - - printf("starting filter program using %s...\n", - i_option ? "initscr" : "newterm"); - filter(); - if (i_option) { - initscr(); - } else { - (void) newterm((char *) 0, stdout, stdin); - } - cbreak(); - keypad(stdscr, TRUE); - - if (has_colors()) { - int background = COLOR_BLACK; - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() != ERR) - background = -1; -#endif - init_pair(1, COLOR_CYAN, (short) background); - underline = COLOR_PAIR(1); - } else { - underline = A_UNDERLINE; - } - - while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR - && strlen(buffer) != 0) { - reset_shell_mode(); - printf("\n"); - fflush(stdout); - system(buffer); - reset_prog_mode(); - touchwin(stdscr); - erase(); - refresh(); - } - printw("done"); - refresh(); - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the filter function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif /* HAVE_FILTER */ diff --git a/test/firework.c b/test/firework.c deleted file mode 100644 index 2c409d835a2..00000000000 --- a/test/firework.c +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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: firework.c,v 1.27 2010/11/13 20:58:25 tom Exp $ - */ -#include - -#include - -static short my_bg = COLOR_BLACK; - -static void -cleanup(void) -{ - curs_set(1); - endwin(); -} - -static RETSIGTYPE -onsig(int n GCC_UNUSED) -{ - cleanup(); - ExitProgram(EXIT_FAILURE); -} - -static void -showit(void) -{ - int ch; - napms(120); - if ((ch = getch()) != ERR) { -#ifdef KEY_RESIZE - if (ch == KEY_RESIZE) { - erase(); - } else -#endif - if (ch == 'q') { - cleanup(); - ExitProgram(EXIT_SUCCESS); - } else if (ch == 's') { - nodelay(stdscr, FALSE); - } else if (ch == ' ') { - nodelay(stdscr, TRUE); - } - } -} - -static short -get_colour(chtype *bold) -{ - int attr; - attr = (rand() % 16) + 1; - - *bold = A_NORMAL; - if (attr > 8) { - *bold = A_BOLD; - attr &= 7; - } - return (short) (attr); -} - -static -void -explode(int row, int col) -{ - chtype bold; - erase(); - MvPrintw(row, col, "-"); - showit(); - - init_pair(1, get_colour(&bold), my_bg); - (void) attrset(COLOR_PAIR(1) | bold); - MvPrintw(row - 1, col - 1, " - "); - MvPrintw(row + 0, col - 1, "-+-"); - MvPrintw(row + 1, col - 1, " - "); - showit(); - - init_pair(1, get_colour(&bold), my_bg); - (void) attrset(COLOR_PAIR(1) | bold); - MvPrintw(row - 2, col - 2, " --- "); - MvPrintw(row - 1, col - 2, "-+++-"); - MvPrintw(row + 0, col - 2, "-+#+-"); - MvPrintw(row + 1, col - 2, "-+++-"); - MvPrintw(row + 2, col - 2, " --- "); - showit(); - - init_pair(1, get_colour(&bold), my_bg); - (void) attrset(COLOR_PAIR(1) | bold); - MvPrintw(row - 2, col - 2, " +++ "); - MvPrintw(row - 1, col - 2, "++#++"); - MvPrintw(row + 0, col - 2, "+# #+"); - MvPrintw(row + 1, col - 2, "++#++"); - MvPrintw(row + 2, col - 2, " +++ "); - showit(); - - init_pair(1, get_colour(&bold), my_bg); - (void) attrset(COLOR_PAIR(1) | bold); - MvPrintw(row - 2, col - 2, " # "); - MvPrintw(row - 1, col - 2, "## ##"); - MvPrintw(row + 0, col - 2, "# #"); - MvPrintw(row + 1, col - 2, "## ##"); - MvPrintw(row + 2, col - 2, " # "); - showit(); - - init_pair(1, get_colour(&bold), my_bg); - (void) attrset(COLOR_PAIR(1) | bold); - MvPrintw(row - 2, col - 2, " # # "); - MvPrintw(row - 1, col - 2, "# #"); - MvPrintw(row + 0, col - 2, " "); - MvPrintw(row + 1, col - 2, "# #"); - MvPrintw(row + 2, col - 2, " # # "); - showit(); -} - -int -main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - int start, end, row, diff, flag = 0, direction; - unsigned seed; - - CATCHALL(onsig); - - initscr(); - noecho(); - cbreak(); - keypad(stdscr, TRUE); - nodelay(stdscr, TRUE); - - if (has_colors()) { - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - my_bg = -1; -#endif - } - curs_set(0); - - seed = (unsigned) time((time_t *) 0); - srand(seed); - for (;;) { - do { - start = rand() % (COLS - 3); - end = rand() % (COLS - 3); - start = (start < 2) ? 2 : start; - end = (end < 2) ? 2 : end; - direction = (start > end) ? -1 : 1; - diff = abs(start - end); - } while (diff < 2 || diff >= LINES - 2); - (void) attrset(A_NORMAL); - for (row = 0; row < diff; row++) { - MvPrintw(LINES - row, start + (row * direction), - (direction < 0) ? "\\" : "/"); - if (flag++) { - showit(); - erase(); - flag = 0; - } - } - if (flag++) { - showit(); - flag = 0; - } - seed = (unsigned) time((time_t *) 0); - srand(seed); - explode(LINES - row, start + (diff * direction)); - erase(); - showit(); - } -} diff --git a/test/firstlast.c b/test/firstlast.c deleted file mode 100644 index f5328c722cf..00000000000 --- a/test/firstlast.c +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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. * - ****************************************************************************/ -/* - * 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 $ - */ - -#include - -static void -fill(WINDOW *w, const char *str) -{ - const char *s; - int x0 = -1, y0 = -1; - int x1, y1; - - for (;;) { - for (s = str; *s; s++) { - getyx(w, y1, x1); - if (waddch(w, UChar(*s)) == ERR - || (x1 == x0 && y1 == y0)) { - wmove(w, 0, 0); - return; - } - x0 = x1; - y0 = y1; - } - } -} - -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - WINDOW *large, *small; - initscr(); - noecho(); - - large = newwin(20, 60, 2, 10); - small = newwin(10, 30, 7, 25); - - /* test 1 - addch */ - fill(large, "LargeWindow"); - - refresh(); - wrefresh(large); - wrefresh(small); - - MvWAddStr(small, 5, 5, " Test String "); - wrefresh(small); - getch(); - - touchwin(large); - wrefresh(large); - - MvWAddStr(small, 5, 5, " Test <***************> String "); - wrefresh(small); - - /* DIFFERENCE! */ - getch(); - - /* test 2: erase */ - erase(); - refresh(); - getch(); - - /* test 3: clrtoeol */ - werase(small); - wrefresh(small); - touchwin(large); - wrefresh(large); - wmove(small, 5, 0); - waddstr(small, " clrtoeol>"); - wclrtoeol(small); - wrefresh(small); - - /* DIFFERENCE! */ ; - getch(); - - /* test 4: clrtobot */ - werase(small); - wrefresh(small); - touchwin(large); - wrefresh(large); - wmove(small, 5, 3); - waddstr(small, " clrtobot>"); - wclrtobot(small); - wrefresh(small); - - /* DIFFERENCE! */ - getch(); - - endwin(); - - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/foldkeys.c b/test/foldkeys.c deleted file mode 100644 index a5e25e30bb8..00000000000 --- a/test/foldkeys.c +++ /dev/null @@ -1,264 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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"), 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, 2006 - * - * $Id: foldkeys.c,v 1.4 2010/11/14 01:00:53 tom Exp $ - * - * Demonstrate a method for altering key definitions at runtime. - * - * This program reads the key definitions, merging those which have xterm-style - * modifiers into their equivalents which have no modifiers. It does this - * merging only for the keys which are defined in the terminal description. - */ - -#include - -#if defined(NCURSES_VERSION) && NCURSES_EXT_FUNCS - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -#define MY_LOGFILE "demo_foldkeys.log" -#define MY_KEYS (KEY_MAX + 1) - -/* - * Log the most recently-written line to our logfile - */ -static void -log_last_line(WINDOW *win) -{ - FILE *fp; - int y, x, n; - char temp[256]; - - if ((fp = fopen(MY_LOGFILE, "a")) != 0) { - int need = sizeof(temp) - 1; - if (need > COLS) - need = COLS; - getyx(win, y, x); - wmove(win, y - 1, 0); - n = winnstr(win, temp, need); - while (n-- > 0) { - if (isspace(UChar(temp[n]))) - temp[n] = '\0'; - else - break; - } - wmove(win, y, x); - fprintf(fp, "%s\n", temp); - fclose(fp); - } -} - -/* - * ncurses has no API for telling what the actual last key-code is. That is - * a secret because the codes past KEY_MAX are computed at run-time and may - * differ depending on the previous calls to newterm(), etc. It is unlikely - * that one could have more than a thousand key definitions... - */ -#define MAX_KEYS 2000 - -typedef struct { - const char *name; - const char *value; - int code; - int state; -} KeyInfo; - -static void -demo_foldkeys(void) -{ - KeyInfo info[MAX_KEYS]; - int info_len = 0; - int merged = 0; - int code; - int j, k; - - /* - * Tell ncurses that we want to use function keys. That will make it add - * any user-defined keys that appear in the terminfo. - */ - keypad(stdscr, TRUE); - - /* - * List the predefined keys using the strnames[] array. - */ - for (code = 0; code < STRCOUNT; ++code) { - NCURSES_CONST char *name = strnames[code]; - NCURSES_CONST char *value = tigetstr(name); - if (value != 0 && value != (NCURSES_CONST char *) -1) { - info[info_len].name = strnames[code]; - info[info_len].code = key_defined(value); - info[info_len].value = value; - info[info_len].state = 0; - if (info[info_len].code > 0) - ++info_len; - } - } - - /* - * We can get the names for user-defined keys from keyname(). It returns - * a name like KEY_foo for the predefined keys, which tigetstr() does not - * understand. - */ - for (code = KEY_MAX; code < MAX_KEYS; ++code) { - NCURSES_CONST char *name = keyname(code); - if (name != 0) { - info[info_len].name = name; - info[info_len].code = code; - info[info_len].value = tigetstr(name); - info[info_len].state = 0; - ++info_len; - } - } - printw("Initially %d key definitions\n", info_len); - - /* - * Look for keys that have xterm-style modifiers. - */ - for (j = 0; j < info_len; ++j) { - int first, second; - char final[2]; - char *value; - if (info[j].state == 0 - && sscanf(info[j].value, - "\033[%d;%d%c", - &first, - &second, - final) == 3 - && *final != ';' - && (value = strdup(info[j].value)) != 0) { - sprintf(value, "\033[%d%c", first, *final); - for (k = 0; k < info_len; ++k) { - if (info[k].state == 0 - && !strcmp(info[k].value, value)) { - info[j].state = 1; - break; - } - } - if (info[j].state == 0) { - sprintf(value, "\033O%c", *final); - for (k = 0; k < info_len; ++k) { - if (info[k].state == 0 - && !strcmp(info[k].value, value)) { - info[j].state = 1; - break; - } - } - } - if (info[j].state == 1) { - if ((define_key(info[j].value, info[k].code)) != ERR) { - printw("map %s to %s\n", info[j].value, info[k].value); - keyok(info[j].code, FALSE); - ++merged; - } else { - printw("? cannot define_key %d:%s\n", j, info[j].value); - } - } else { - printw("? cannot merge %d:%s\n", j, info[j].value); - } - free(value); - } - } - printw("Merged to %d key definitions\n", info_len - merged); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - int ch; -#if HAVE_GETTIMEOFDAY - int secs, msecs; - struct timeval current, previous; -#endif - - 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 */ - - scrollok(stdscr, TRUE); - keypad(stdscr, TRUE); - move(0, 0); - - demo_foldkeys(); - -#if HAVE_GETTIMEOFDAY - gettimeofday(&previous, 0); -#endif - - while ((ch = getch()) != ERR) { - bool escaped = (ch >= MY_KEYS); - const char *name = keyname(escaped ? (ch - MY_KEYS) : ch); - -#if HAVE_GETTIMEOFDAY - gettimeofday(¤t, 0); - secs = (int) (current.tv_sec - previous.tv_sec); - msecs = (int) ((current.tv_usec - previous.tv_usec) / 1000); - if (msecs < 0) { - msecs += 1000; - --secs; - } - if (msecs >= 1000) { - secs += msecs / 1000; - msecs %= 1000; - } - printw("%6d.%03d ", secs, msecs); - previous = current; -#endif - printw("Keycode %d, name %s%s\n", - ch, - escaped ? "ESC-" : "", - name != 0 ? name : ""); - log_last_line(stdscr); - clrtoeol(); - if (ch == 'q') - break; - } - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/gdc.6 b/test/gdc.6 deleted file mode 100644 index ed3a4f103ff..00000000000 --- a/test/gdc.6 +++ /dev/null @@ -1,64 +0,0 @@ -.\"*************************************************************************** -.\" Copyright (c) 1998-2003,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"), 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: gdc.6,v 1.3 2006/04/22 23:02:15 tom Exp $ -.TH GDC 6 -.SH NAME -gdc \- grand digital clock (curses) -.SH SYNOPSIS -.B gdc -[-n] [ -[-s] [ -.I n -] -.SH DESCRIPTION -.I Gdc -runs a digital clock made of reverse-video blanks on a terminal screen. -If the terminal supports color, the clock is drawn in red. -You can make the clock stop, pause or resume by pressing a ``q'', -``s'' or space, respectively. -.SH OPTIONS -.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 -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. -.PP -With an optional numeric argument -.I num -it stops after -.I num -seconds. -Normally it runs "forever" (counting down from 2 billion seconds). -.SH AUTHOR -Amos Shapir, modified for curses by John Lupien. -Improvements for ncurses by Thomas Dickey. diff --git a/test/gdc.c b/test/gdc.c deleted file mode 100644 index f3018cd8d33..00000000000 --- a/test/gdc.c +++ /dev/null @@ -1,351 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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. * - ****************************************************************************/ -/* - * Grand digital clock for curses compatible terminals - * Usage: gdc [-s] [n] -- run for n seconds (default infinity) - * Flags: -s: scroll - * - * modified 10-18-89 for curses (jrl) - * 10-18-89 added signal handling - * - * $Id: gdc.c,v 1.34 2010/11/13 21:01:23 tom Exp $ - */ - -#include - -#include - -#define YBASE 10 -#define XBASE 10 -#define XLENGTH 54 -#define YDEPTH 5 - -#define PAIR_DIGITS 1 -#define PAIR_OTHERS 2 -#define PAIR_FRAMES 3 - -static short disp[11] = -{ - 075557, 011111, 071747, 071717, 055711, - 074717, 074757, 071111, 075757, 075717, 002020 -}; -static long older[6], next[6], newer[6], mask; - -static int sigtermed = 0; -static bool redirected = FALSE; -static bool hascolor = FALSE; - -static RETSIGTYPE -sighndl(int signo) -{ - signal(signo, sighndl); - sigtermed = signo; - if (redirected) { - endwin(); - ExitProgram(EXIT_FAILURE); - } -} - -static void -drawbox(bool scrolling) -{ - chtype bottom[XLENGTH + 1]; - int n; - - if (hascolor) - (void) attrset(COLOR_PAIR(PAIR_FRAMES)); - - MvAddCh(YBASE - 1, XBASE - 1, ACS_ULCORNER); - hline(ACS_HLINE, XLENGTH); - MvAddCh(YBASE - 1, XBASE + XLENGTH, ACS_URCORNER); - - MvAddCh(YBASE + YDEPTH, XBASE - 1, ACS_LLCORNER); - if ((mvinchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH)) != ERR) { - for (n = 0; n < XLENGTH; n++) { - if (!scrolling) - bottom[n] &= ~A_COLOR; - bottom[n] = ACS_HLINE | (bottom[n] & (A_ATTRIBUTES | A_COLOR)); - } - (void) mvaddchnstr(YBASE + YDEPTH, XBASE, bottom, XLENGTH); - } - MvAddCh(YBASE + YDEPTH, XBASE + XLENGTH, ACS_LRCORNER); - - move(YBASE, XBASE - 1); - vline(ACS_VLINE, YDEPTH); - - move(YBASE, XBASE + XLENGTH); - vline(ACS_VLINE, YDEPTH); - - if (hascolor) - (void) attrset(COLOR_PAIR(PAIR_OTHERS)); -} - -static void -standt(int on) -{ - if (on) { - if (hascolor) { - attron(COLOR_PAIR(PAIR_DIGITS)); - } else { - attron(A_STANDOUT); - } - } else { - if (hascolor) { - attron(COLOR_PAIR(PAIR_OTHERS)); - } else { - attroff(A_STANDOUT); - } - } -} - -static void -set(int t, int n) -{ - int i, m; - - m = 7 << n; - for (i = 0; i < 5; i++) { - next[i] |= ((disp[t] >> ((4 - i) * 3)) & 07) << n; - mask |= (next[i] ^ older[i]) & m; - } - if (mask & m) - mask |= m; -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: gdc [options] [count]" - ,"" - ,"Options:" - ," -n redirect input to /dev/null" - ," -s scroll each number into place, rather than flipping" - ,"" - ,"If you specify a count, gdc runs for that number of seconds" - }; - unsigned j; - for (j = 0; j < SIZEOF(msg); j++) - fprintf(stderr, "%s\n", msg[j]); - ExitProgram(EXIT_FAILURE); -} - -int -main(int argc, char *argv[]) -{ - time_t now; - struct tm *tm; - long t, a; - int i, j, s, k; - int count = 0; - FILE *ofp = stdout; - FILE *ifp = stdin; - bool scrol = FALSE; - - setlocale(LC_ALL, ""); - - CATCHALL(sighndl); - - while ((k = getopt(argc, argv, "sn")) != -1) { - switch (k) { - case 's': - scrol = TRUE; - break; - case 'n': - ifp = fopen("/dev/null", "r"); - redirected = TRUE; - break; - default: - usage(); - } - } - if (optind < argc) { - count = atoi(argv[optind++]); - assert(count >= 0); - } - 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); - } - - } else { - initscr(); - } - cbreak(); - noecho(); - nodelay(stdscr, 1); - curs_set(0); - - hascolor = has_colors(); - - if (hascolor) { - short bg = COLOR_BLACK; - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - bg = -1; -#endif - init_pair(PAIR_DIGITS, COLOR_BLACK, COLOR_RED); - init_pair(PAIR_OTHERS, COLOR_RED, bg); - init_pair(PAIR_FRAMES, COLOR_WHITE, bg); - (void) attrset(COLOR_PAIR(PAIR_OTHERS)); - } - - restart: - for (j = 0; j < 5; j++) - older[j] = newer[j] = next[j] = 0; - - clear(); - drawbox(FALSE); - - do { - char buf[30]; - - time(&now); - tm = localtime(&now); - - mask = 0; - set(tm->tm_sec % 10, 0); - set(tm->tm_sec / 10, 4); - set(tm->tm_min % 10, 10); - set(tm->tm_min / 10, 14); - set(tm->tm_hour % 10, 20); - set(tm->tm_hour / 10, 24); - set(10, 7); - set(10, 17); - - for (k = 0; k < 6; k++) { - if (scrol) { - for (i = 0; i < 5; i++) - newer[i] = (newer[i] & ~mask) | (newer[i + 1] & mask); - newer[5] = (newer[5] & ~mask) | (next[k] & mask); - } else - newer[k] = (newer[k] & ~mask) | (next[k] & mask); - next[k] = 0; - for (s = 1; s >= 0; s--) { - standt(s); - for (i = 0; i < 6; i++) { - if ((a = (newer[i] ^ older[i]) & (s ? newer : older)[i]) - != 0) { - for (j = 0, t = 1 << 26; t; t >>= 1, j++) { - if (a & t) { - if (!(a & (t << 1))) { - move(YBASE + i, XBASE + 2 * j); - } - addstr(" "); - } - } - } - if (!s) { - older[i] = newer[i]; - } - } - if (!s) { - if (scrol) - drawbox(TRUE); - refresh(); - /* - * If we're scrolling, space out the refreshes to fake - * movement. That's 7 frames, or 6 intervals, which would - * be 166 msec if we spread it out over a second. It looks - * better (but will work on a slow terminal, e.g., less - * than 9600bd) to squeeze that into a half-second, and use - * half of 170 msec to ensure that the program doesn't eat - * a lot of time when asking what time it is, at the top of - * this loop -T.Dickey - */ - if (scrol) - napms(85); - } - } - } - - /* this depends on the detailed format of ctime(3) */ - (void) strcpy(buf, ctime(&now)); - (void) strcpy(buf + 10, buf + 19); - MvAddStr(16, 30, buf); - - move(6, 0); - drawbox(FALSE); - refresh(); - - /* - * If we're not scrolling, wait 1000 msec (1 sec). Use napms() rather - * than sleep() because the latter does odd things on some systems, - * e.g., suspending output as well. - */ - if (scrol) - napms(500); - else - napms(1000); - - /* - * This is a safe way to check if we're interrupted - making the signal - * handler set a flag that we can check. Since we're running - * nodelay(), the wgetch() call returns immediately, and in particular - * will return an error if interrupted. This works only if we can - * read from the input, of course. - */ - switch (wgetch(stdscr)) { - case 'q': - count = 1; - break; - case 's': - nodelay(stdscr, FALSE); - break; - case ' ': - nodelay(stdscr, TRUE); - break; -#ifdef KEY_RESIZE - case KEY_RESIZE: -#endif - case '?': - goto restart; - case ERR: - if (sigtermed) { - (void) standend(); - endwin(); - fprintf(stderr, "gdc terminated by signal %d\n", sigtermed); - ExitProgram(EXIT_FAILURE); - } - /* FALLTHRU */ - default: - continue; - } - } while (--count); - (void) standend(); - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/hanoi.c b/test/hanoi.c deleted file mode 100644 index 3366e93a331..00000000000 --- a/test/hanoi.c +++ /dev/null @@ -1,338 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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. * - ****************************************************************************/ -/* - * Name: Towers of Hanoi. - * - * Desc: - * This is a playable copy of towers of hanoi. - * Its sole purpose is to demonstrate my Amiga Curses package. - * This program should compile on any system that has Curses. - * 'hanoi' will give a manual game with 7 playing pieces. - * 'hanoi n' will give a manual game with n playing pieces. - * 'hanoi n a' will give an auto solved game with n playing pieces. - * - * Author: Simon J Raybould (sie@fulcrum.bt.co.uk). - * (This version has been slightly modified by the ncurses maintainers.) - * - * Date: 05.Nov.90 - * - * $Id: hanoi.c,v 1.31 2010/11/14 01:01:07 tom Exp $ - */ - -#include - -#define NPEGS 3 /* This is not configurable !! */ -#define MINTILES 3 -#define MAXTILES 9 -#define DEFAULTTILES 7 -#define TOPLINE 6 -#define BASELINE 16 -#define STATUSLINE (LINES-3) -#define LEFTPEG 19 -#define MIDPEG 39 -#define RIGHTPEG 59 - -#define LENTOIND(x) (((x)-1)/2) -#define OTHER(a,b) (3-((a)+(b))) - -struct Peg { - size_t Length[MAXTILES]; - int Count; -}; - -static struct Peg Pegs[NPEGS]; -static int PegPos[] = -{ - LEFTPEG, - MIDPEG, - RIGHTPEG -}; -static short TileColour[] = -{ - COLOR_GREEN, /* Length 3 */ - COLOR_MAGENTA, /* Length 5 */ - COLOR_RED, /* Length 7 */ - COLOR_BLUE, /* Length 9 */ - COLOR_CYAN, /* Length 11 */ - COLOR_YELLOW, /* Length 13 */ - COLOR_GREEN, /* Length 15 */ - COLOR_MAGENTA, /* Length 17 */ - COLOR_RED, /* Length 19 */ -}; -static int NMoves = 0; -static bool AutoFlag = FALSE; - -static void InitTiles(int NTiles); -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 NTiles, 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); - } -#ifdef TRACE - trace(TRACE_MAXIMUM); -#endif - 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(NTiles); - 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) -{ - if (From >= NPEGS) - return TRUE; - if (From < 0) - return TRUE; - if (To >= NPEGS) - return TRUE; - if (To < 0) - return TRUE; - if (From == To) - return TRUE; - if (!Pegs[From].Count) - return TRUE; - if (Pegs[To].Count && - Pegs[From].Length[Pegs[From].Count - 1] > - Pegs[To].Length[Pegs[To].Count - 1]) - return TRUE; - return FALSE; -} - -static void -InitTiles(int NTiles) -{ - int Size, SlotNo; - - for (Size = NTiles * 2 + 1, SlotNo = 0; Size >= 3; Size -= 2) - Pegs[0].Length[SlotNo++] = (size_t) Size; - - Pegs[0].Count = NTiles; - Pegs[1].Count = 0; - Pegs[2].Count = 0; -} - -static void -DisplayTiles(void) -{ - int Line, peg, SlotNo; - char TileBuf[BUFSIZ]; - - erase(); - MvAddStr(1, 24, "T O W E R S O F H A N O I"); - MvAddStr(3, 34, "SJR 1990"); - MvPrintw(19, 5, "Moves : %d", NMoves); - (void) attrset(A_REVERSE); - MvAddStr(BASELINE, 8, - " "); - - for (Line = TOPLINE; Line < BASELINE; Line++) { - MvAddCh(Line, LEFTPEG, ' '); - MvAddCh(Line, MIDPEG, ' '); - MvAddCh(Line, RIGHTPEG, ' '); - } - MvAddCh(BASELINE, LEFTPEG, '1'); - MvAddCh(BASELINE, MIDPEG, '2'); - MvAddCh(BASELINE, RIGHTPEG, '3'); - (void) attrset(A_NORMAL); - - /* Draw tiles */ - for (peg = 0; peg < NPEGS; peg++) { - for (SlotNo = 0; SlotNo < Pegs[peg].Count; SlotNo++) { - size_t len = Pegs[peg].Length[SlotNo]; - if (len < sizeof(TileBuf) - 1 && len < (size_t) PegPos[peg]) { - memset(TileBuf, ' ', len); - TileBuf[len] = '\0'; - if (has_colors()) - (void) attrset(COLOR_PAIR(LENTOIND(len))); - else - (void) attrset(A_REVERSE); - MvAddStr(BASELINE - (SlotNo + 1), - (PegPos[peg] - (int) len / 2), - TileBuf); - } - } - } - (void) attrset(A_NORMAL); - refresh(); -} - -static int -GetMove(int *From, int *To) -{ - MvAddStr(STATUSLINE, 0, "Next move ('q' to quit) from "); - clrtoeol(); - refresh(); - if ((*From = getch()) == 'q') - return TRUE; - *From -= ('0' + 1); - addstr(" to "); - clrtoeol(); - refresh(); - - if ((*To = getch()) == 'q') - return TRUE; - *To -= ('0' + 1); - refresh(); - if (!AutoFlag) - napms(500); - - move(STATUSLINE, 0); - clrtoeol(); - refresh(); - return FALSE; -} - -static void -MakeMove(int From, int To) -{ - Pegs[From].Count--; - Pegs[To].Length[Pegs[To].Count] = Pegs[From].Length[Pegs[From].Count]; - Pegs[To].Count++; - NMoves++; - DisplayTiles(); -} - -static void -AutoMove(int From, int To, int Num) -{ - if (Num == 1) { - MakeMove(From, To); - napms(500); - return; - } - AutoMove(From, OTHER(From, To), Num - 1); - MakeMove(From, To); - napms(500); - AutoMove(OTHER(From, To), To, Num - 1); -} - -static int -Solved(int NumTiles) -{ - int i; - - for (i = 1; i < NPEGS; i++) - if (Pegs[i].Count == NumTiles) - return TRUE; - return FALSE; -} - -static void -Usage(void) -{ - fprintf(stderr, "Usage: hanoi [] [a]\n"); - fprintf(stderr, - "The 'a' option causes the tower to be solved automatically\n"); -} diff --git a/test/hashtest.c b/test/hashtest.c deleted file mode 100644 index 919a1091e84..00000000000 --- a/test/hashtest.c +++ /dev/null @@ -1,247 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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. * - ****************************************************************************/ -/* - * hashtest.c -- test hash mapping - * - * Generate timing statistics for vertical-motion optimization. - * - * $Id: hashtest.c,v 1.31 2010/11/13 23:43:15 tom Exp $ - */ - -#include - -#define LO_CHAR ' ' -#define HI_CHAR '~' - -static bool continuous = FALSE; -static bool reverse_loops = FALSE; -static bool single_step = FALSE; -static bool extend_corner = FALSE; -static int foot_lines = 0; -static int head_lines = 0; - -static void -cleanup(void) -{ - move(LINES - 1, 0); - clrtoeol(); - refresh(); - endwin(); -} - -static RETSIGTYPE -finish(int sig GCC_UNUSED) -{ - cleanup(); - ExitProgram(EXIT_FAILURE); -} - -static void -genlines(int base) -{ - int i, j; - -#if USE_TRACE - if (base == 'a') - Trace(("Resetting screen")); - else - Trace(("Painting `%c' screen", base)); -#endif - - /* Do this so writes to lower-right corner don't cause a spurious - * scrolling operation. This _shouldn't_ break the scrolling - * optimization, since that's computed in the refresh() call. - */ - scrollok(stdscr, FALSE); - - move(0, 0); - for (i = 0; i < head_lines; i++) - for (j = 0; j < COLS; j++) - addch(UChar((j % 8 == 0) ? ('A' + j / 8) : '-')); - - move(head_lines, 0); - for (i = head_lines; i < LINES - foot_lines; i++) { - chtype c = (chtype) ((base - LO_CHAR + i) % (HI_CHAR - LO_CHAR + 1) - + LO_CHAR); - int hi = (extend_corner || (i < LINES - 1)) ? COLS : COLS - 1; - for (j = 0; j < hi; j++) - 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) : '-')); - } - - scrollok(stdscr, TRUE); - if (single_step) { - move(LINES - 1, 0); - getch(); - } else - refresh(); -} - -static void -one_cycle(int ch) -{ - if (continuous) { - genlines(ch); - } else if (ch != 'a') { - genlines('a'); - genlines(ch); - } -} - -static void -run_test(bool optimized GCC_UNUSED) -{ - char ch; - int lo = continuous ? LO_CHAR : 'a' - LINES; - int hi = continuous ? HI_CHAR : 'a' + LINES; - - if (lo < LO_CHAR) - lo = LO_CHAR; - if (hi > HI_CHAR) - hi = HI_CHAR; - -#if defined(TRACE) || defined(NCURSES_TEST) - if (optimized) { - Trace(("With hash mapping")); - _nc_optimize_enable |= OPTIMIZE_HASHMAP; - } else { - Trace(("Without hash mapping")); - _nc_optimize_enable &= ~OPTIMIZE_HASHMAP; - } -#endif - - if (reverse_loops) - for (ch = (char) hi; ch >= lo; ch--) - one_cycle(ch); - else - for (ch = (char) lo; ch <= hi; ch++) - one_cycle(ch); -} - -static void -usage(void) -{ - static const char *const tbl[] = - { - "Usage: hashtest [options]" - ,"" - ,"Options:" - ," -c continuous (don't reset between refresh's)" - ," -f num leave 'num' lines constant for footer" - ," -h num leave 'num' lines constant for header" - ," -l num repeat test 'num' times" - ," -n test the normal optimizer" - ," -o test the hashed optimizer" - ," -r reverse the loops" - ," -s single-step" - ," -x assume lower-right corner extension" - }; - 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[]) -{ - int c; - int test_loops = 1; - int test_normal = FALSE; - int test_optimize = FALSE; - - setlocale(LC_ALL, ""); - - while ((c = getopt(argc, argv, "cf:h:l:norsx")) != -1) { - switch (c) { - case 'c': - continuous = TRUE; - break; - case 'f': - foot_lines = atoi(optarg); - break; - case 'h': - head_lines = atoi(optarg); - break; - case 'l': - test_loops = atoi(optarg); - assert(test_loops >= 0); - break; - case 'n': - test_normal = TRUE; - break; - case 'o': - test_optimize = TRUE; - break; - case 'r': - reverse_loops = TRUE; - break; - case 's': - single_step = TRUE; - break; - case 'x': - extend_corner = TRUE; - break; - default: - usage(); - } - } - if (!test_normal && !test_optimize) { - test_normal = TRUE; - test_optimize = TRUE; - } -#if USE_TRACE - trace(TRACE_TIMES); -#endif - - CATCHALL(finish); /* arrange interrupts to terminate */ - - (void) initscr(); /* initialize the curses library */ - 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 */ - scrollok(stdscr, TRUE); - - while (test_loops-- > 0) { - if (test_normal) - run_test(FALSE); - if (test_optimize) - run_test(TRUE); - } - - cleanup(); /* we're done */ - ExitProgram(EXIT_SUCCESS); -} -/* hashtest.c ends here */ diff --git a/test/inch_wide.c b/test/inch_wide.c deleted file mode 100644 index 3d31f1787fa..00000000000 --- a/test/inch_wide.c +++ /dev/null @@ -1,279 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007,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"), 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: inch_wide.c,v 1.7 2010/05/01 19:13:46 tom Exp $ - */ -/* - int in_wch(cchar_t *wcval); - int mvin_wch(int y, int x, cchar_t *wcval); - int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval); - int win_wch(WINDOW *win, cchar_t *wcval); - int in_wchstr(cchar_t *wchstr); - int in_wchnstr(cchar_t *wchstr, int n); - int win_wchstr(WINDOW *win, cchar_t *wchstr); - int win_wchnstr(WINDOW *win, cchar_t *wchstr, int n); - int mvin_wchstr(int y, int x, cchar_t *wchstr); - int mvin_wchnstr(int y, int x, cchar_t *wchstr, int n); - int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr); - int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n); -*/ - -#include - -#if USE_WIDEC_SUPPORT - -#define BASE_Y 7 -#define MAX_COLS 1024 - -static bool -Quit(int ch) -{ - return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) -{ - 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]; - - if (argv[level] == 0) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((j = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(j)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) { - switch (j) { - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) - txt_y++; - else - beep(); - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) - txt_y--; - else - beep(); - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) - txt_x--; - else - beep(); - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) - txt_x++; - else - beep(); - break; - case 'w': - test_inchs(level + 1, argv, chrwin, strwin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - default: - beep(); - break; - } - - MvWPrintw(chrwin, 0, 0, "char:"); - wclrtoeol(chrwin); - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - if (win_wch(txtwin, &ch) != ERR) { - if (wadd_wch(chrwin, &ch) != ERR) { - for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { - if (mvwin_wch(txtwin, txt_y, j, &ch) != ERR) { - if (wadd_wch(chrwin, &ch) == ERR) { - break; - } - } else { - break; - } - } - } - } - } else { - move(txt_y, txt_x); - if (in_wch(&ch) != ERR) { - if (wadd_wch(chrwin, &ch) != ERR) { - for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { - if (mvin_wch(txt_y, j, &ch) != ERR) { - if (wadd_wch(chrwin, &ch) == ERR) { - break; - } - } else { - break; - } - } - } - } - } - wnoutrefresh(chrwin); - - MvWPrintw(strwin, 0, 0, "text:"); - wclrtobot(strwin); - - limit = getmaxx(strwin) - 5; - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - if (win_wchstr(txtwin, text) != ERR) { - (void) mvwadd_wchstr(strwin, 0, 5, text); - } - - wmove(txtwin, txt_y, txt_x); - if (win_wchnstr(txtwin, text, limit) != ERR) { - (void) mvwadd_wchstr(strwin, 1, 5, text); - } - - if (mvwin_wchstr(txtwin, txt_y, txt_x, text) != ERR) { - (void) mvwadd_wchstr(strwin, 2, 5, text); - } - - if (mvwin_wchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) { - (void) mvwadd_wchstr(strwin, 3, 5, text); - } - } else { - move(txt_y, txt_x); - if (in_wchstr(text) != ERR) { - (void) mvwadd_wchstr(strwin, 0, 5, text); - } - - move(txt_y, txt_x); - if (in_wchnstr(text, limit) != ERR) { - (void) mvwadd_wchstr(strwin, 1, 5, text); - } - - if (mvin_wchstr(txt_y, txt_x, text) != ERR) { - (void) mvwadd_wchstr(strwin, 2, 5, text); - } - - if (mvin_wchnstr(txt_y, txt_x, text, limit) != ERR) { - (void) mvwadd_wchstr(strwin, 3, 5, text); - } - } - - wnoutrefresh(strwin); - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - WINDOW *chrbox; - WINDOW *chrwin; - WINDOW *strwin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(chrbox, 0, 0); - wnoutrefresh(chrbox); - - chrwin = derwin(chrbox, 1, COLS - 2, 1, 1); - strwin = derwin(chrbox, 4, COLS - 2, 2, 1); - - test_inchs(1, argv, chrwin, strwin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/inchs.c b/test/inchs.c deleted file mode 100644 index f07a2bdabd0..00000000000 --- a/test/inchs.c +++ /dev/null @@ -1,272 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007,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"), 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: inchs.c,v 1.11 2010/11/13 23:41:23 tom Exp $ - * - * Author: Thomas E Dickey - */ -/* - chtype inch(void); - chtype winch(WINDOW *win); - chtype mvinch(int y, int x); - chtype mvwinch(WINDOW *win, int y, int x); - int inchstr(chtype *chstr); - int inchnstr(chtype *chstr, int n); - int winchstr(WINDOW *win, chtype *chstr); - int winchnstr(WINDOW *win, chtype *chstr, int n); - int mvinchstr(int y, int x, chtype *chstr); - int mvinchnstr(int y, int x, chtype *chstr, int n); - int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr); - int mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr, int n); -*/ - -#include - -#define BASE_Y 7 -#define MAX_COLS 1024 - -static bool -Quit(int ch) -{ - return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) -{ - 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) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((j = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(j)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) { - switch (j) { - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) - txt_y++; - else - beep(); - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) - txt_y--; - else - beep(); - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) - txt_x--; - else - beep(); - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) - txt_x++; - else - beep(); - break; - case 'w': - test_inchs(level + 1, argv, chrwin, strwin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - default: - beep(); - break; - } - - MvWPrintw(chrwin, 0, 0, "char:"); - wclrtoeol(chrwin); - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - - if ((ch = (int) winch(txtwin)) != ERR) { - if (waddch(chrwin, (chtype) ch) != ERR) { - for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { - if ((ch = (int) mvwinch(txtwin, txt_y, j)) != ERR) { - if (waddch(chrwin, (chtype) ch) == ERR) { - break; - } - } else { - break; - } - } - } - } - } else { - move(txt_y, txt_x); - - if ((ch = (int) inch()) != ERR) { - if (waddch(chrwin, (chtype) ch) != ERR) { - for (j = txt_x + 1; j < getmaxx(txtwin); ++j) { - if ((ch = (int) mvinch(txt_y, j)) != ERR) { - if (waddch(chrwin, (chtype) ch) == ERR) { - break; - } - } else { - break; - } - } - } - } - } - wnoutrefresh(chrwin); - - MvWPrintw(strwin, 0, 0, "text:"); - wclrtobot(strwin); - - limit = getmaxx(strwin) - 5; - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - if (winchstr(txtwin, text) != ERR) { - MvWAddChStr(strwin, 0, 5, text); - } - - wmove(txtwin, txt_y, txt_x); - if (winchnstr(txtwin, text, limit) != ERR) { - MvWAddChStr(strwin, 1, 5, text); - } - - if (mvwinchstr(txtwin, txt_y, txt_x, text) != ERR) { - MvWAddChStr(strwin, 2, 5, text); - } - - if (mvwinchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) { - MvWAddChStr(strwin, 3, 5, text); - } - } else { - move(txt_y, txt_x); - if (inchstr(text) != ERR) { - MvWAddChStr(strwin, 0, 5, text); - } - - move(txt_y, txt_x); - if (inchnstr(text, limit) != ERR) { - MvWAddChStr(strwin, 1, 5, text); - } - - if (mvinchstr(txt_y, txt_x, text) != ERR) { - MvWAddChStr(strwin, 2, 5, text); - } - - if (mvinchnstr(txt_y, txt_x, text, limit) != ERR) { - MvWAddChStr(strwin, 3, 5, text); - } - } - - wnoutrefresh(strwin); - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - WINDOW *chrbox; - WINDOW *chrwin; - WINDOW *strwin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(chrbox, 0, 0); - wnoutrefresh(chrbox); - - chrwin = derwin(chrbox, 1, COLS - 2, 1, 1); - strwin = derwin(chrbox, 4, COLS - 2, 2, 1); - - test_inchs(1, argv, chrwin, strwin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/ins_wide.c b/test/ins_wide.c deleted file mode 100644 index 87deb1a14d5..00000000000 --- a/test/ins_wide.c +++ /dev/null @@ -1,508 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2002-2009,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"), 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: ins_wide.c,v 1.15 2010/12/12 00:20:14 tom Exp $ - * - * Demonstrate the wins_wstr() and wins_wch functions. - * Thomas Dickey - 2002/11/23 - * - * Note: to provide inputs for *ins_wch(), we use setcchar(). A quirk of the - * X/Open definition for that function is that the string contains no - * characters with negative width. Any control character (such as tab) falls - * into that category. So it follows that *ins_wch() cannot render a tab - * character because there is no legal way to construct a cchar_t containing - * one. X/Open does not document this, and it would be logical to assume that - * *ins_wstr() has the same limitation, but it uses a wchar_t string directly, - * and does not document how tabs are handled. - */ - -#include - -#if USE_WIDEC_SUPPORT - -#define WIDE_LINEDATA -#include - -/* definitions to make it simpler to compare with inserts.c */ -#define InsNStr ins_nwstr -#define InsStr ins_wstr -#define MvInsNStr (void) mvins_nwstr -#define MvInsStr (void) mvins_wstr -#define MvWInsNStr (void) mvwins_nwstr -#define MvWInsStr (void) mvwins_wstr -#define WInsNStr wins_nwstr -#define WInsStr wins_wstr - -#define MY_TABSIZE 8 - -typedef enum { - oDefault = 0, - oMove = 1, - oWindow = 2, - oMoveWindow = 3 -} Options; - -static bool m_opt = FALSE; -static bool w_opt = FALSE; -static int n_opt = -1; - -static void -legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) -{ - const char *showstate; - - switch (state) { - default: - case oDefault: - showstate = ""; - break; - case oMove: - showstate = " (mvXXX)"; - break; - case oWindow: - showstate = " (winXXX)"; - break; - case oMoveWindow: - showstate = " (mvwinXXX)"; - break; - } - - wmove(win, 0, 0); - wprintw(win, - "The Strings/Chars displays should match. Enter any characters, except:\n"); - 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); - waddwstr(win, buffer); - waddstr(win, ">"); -} - -static int -ColOf(wchar_t *buffer, int length, int margin) -{ - int n; - int result; - - for (n = 0, result = margin + 1; n < length; ++n) { - int ch = buffer[n]; - switch (ch) { - case '\n': - /* actually newline should clear the remainder of the line - * and move to the next line - but that seems a little awkward - * in this example. - */ - case '\r': - result = 0; - break; - case '\b': - if (result > 0) - --result; - break; - case '\t': - result += (MY_TABSIZE - (result % MY_TABSIZE)); - break; - case '\177': - result += 2; - break; - default: - result += wcwidth(ch); - if (ch < 32) - ++result; - break; - } - } - return result; -} - -static int -ConvertCh(chtype source, cchar_t *target) -{ - wchar_t tmp_wchar[2]; - - tmp_wchar[0] = (wchar_t) source; - tmp_wchar[1] = 0; - if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) { - beep(); - return FALSE; - } - return TRUE; -} - -static int -MvWInsCh(WINDOW *win, int y, int x, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = mvwins_wch(win, y, x, &tmp_cchar); - } else { - code = mvwinsch(win, y, x, ch); - } - return code; -} - -static int -MvInsCh(int y, int x, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = mvins_wch(y, x, &tmp_cchar); - } else { - code = mvinsch(y, x, ch); - } - return code; -} - -static int -WInsCh(WINDOW *win, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = wins_wch(win, &tmp_cchar); - } else { - code = winsch(win, ch); - } - return code; -} - -static int -InsCh(chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = ins_wch(&tmp_cchar); - } else { - code = insch(ch); - } - return code; -} - -#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) -static void -test_inserts(int level) -{ - static bool first = TRUE; - - int ch; - int limit; - int row = 1; - int col; - int row2, col2; - int length; - wchar_t buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; - int margin = (2 * MY_TABSIZE) - 1; - Options option = ((m_opt ? oMove : oDefault) - | ((w_opt || (level > 0)) ? oWindow : oDefault)); - - if (first) { - static char cmd[80]; - setlocale(LC_ALL, ""); - - putenv(strcpy(cmd, "TABSIZE=8")); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - keypad(stdscr, TRUE); - } - - limit = LINES - 5; - if (level > 0) { - look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); - work = newwin(limit - 2, COLS - (2 * level), 1, level); - show = newwin(4, COLS, limit + 1, 0); - box(look, 0, 0); - wnoutrefresh(look); - limit -= 2; - } else { - work = stdscr; - show = derwin(stdscr, 4, COLS, limit + 1, 0); - } - keypad(work, TRUE); - - for (col = margin + 1; col < COLS; col += MY_TABSIZE) - MvWVLine(work, row, col, '.', limit - 2); - - MvWVLine(work, row, margin, ACS_VLINE, limit - 2); - MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); - limit /= 2; - - MvWAddStr(work, 1, 2, "String"); - MvWAddStr(work, limit + 1, 2, "Chars"); - wnoutrefresh(work); - - buffer[length = 0] = '\0'; - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - - /* - * Show the characters inserted in color, to distinguish from those that - * are shifted. - */ - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - wbkgdset(work, COLOR_PAIR(1) | ' '); - } - - while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { - wmove(work, row, margin + 1); - switch (ch) { - case key_RECUR: - test_inserts(level + 1); - - touchwin(look); - touchwin(work); - touchwin(show); - - wnoutrefresh(look); - wnoutrefresh(work); - wnoutrefresh(show); - - doupdate(); - break; - case key_NEWLINE: - if (row < limit) { - ++row; - /* put the whole string in, all at once */ - col2 = margin + 1; - switch (option) { - case oDefault: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (move(row, col2) != ERR) { - InsNStr(buffer + col, LEN(col)); - } - } - } else { - if (move(row, col2) != ERR) { - InsStr(buffer); - } - } - break; - case oMove: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvInsNStr(row, col2, buffer + col, LEN(col)); - } - } else { - MvInsStr(row, col2, buffer); - } - break; - case oWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (wmove(work, row, col2) != ERR) { - WInsNStr(work, buffer + col, LEN(col)); - } - } - } else { - if (wmove(work, row, col2) != ERR) { - WInsStr(work, buffer); - } - } - break; - case oMoveWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvWInsNStr(work, row, col2, buffer + col, LEN(col)); - } - } else { - MvWInsStr(work, row, col2, buffer); - } - break; - } - - /* do the corresponding single-character insertion */ - row2 = limit + row; - for (col = 0; col < length; ++col) { - col2 = ColOf(buffer, col, margin); - switch (option) { - case oDefault: - if (move(row2, col2) != ERR) { - InsCh((chtype) buffer[col]); - } - break; - case oMove: - MvInsCh(row2, col2, (chtype) buffer[col]); - break; - case oWindow: - if (wmove(work, row2, col2) != ERR) { - WInsCh(work, (chtype) buffer[col]); - } - break; - case oMoveWindow: - MvWInsCh(work, row2, col2, (chtype) buffer[col]); - break; - } - } - } else { - beep(); - } - break; - default: - buffer[length++] = ch; - buffer[length] = '\0'; - - /* put the string in, one character at a time */ - col = ColOf(buffer, length - 1, margin); - switch (option) { - case oDefault: - if (move(row, col) != ERR) { - InsStr(buffer + length - 1); - } - break; - case oMove: - MvInsStr(row, col, buffer + length - 1); - break; - case oWindow: - if (wmove(work, row, col) != ERR) { - WInsStr(work, buffer + length - 1); - } - break; - case oMoveWindow: - MvWInsStr(work, row, col, buffer + length - 1); - break; - } - - /* do the corresponding single-character insertion */ - switch (option) { - case oDefault: - if (move(limit + row, col) != ERR) { - InsCh((chtype) ch); - } - break; - case oMove: - MvInsCh(limit + row, col, (chtype) ch); - break; - case oWindow: - if (wmove(work, limit + row, col) != ERR) { - WInsCh(work, (chtype) ch); - } - break; - case oMoveWindow: - MvWInsCh(work, limit + row, col, (chtype) ch); - break; - } - - wnoutrefresh(work); - - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - break; - } - } - if (level > 0) { - delwin(show); - delwin(work); - delwin(look); - } -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: inserts [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" - ," -w use window-parameter even when stdscr would be implied" - }; - 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; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { - switch (ch) { - case 'f': - init_linedata(optarg); - break; - case 'm': - m_opt = TRUE; - break; - case 'n': - n_opt = atoi(optarg); - if (n_opt == 0) - n_opt = -1; - break; - case 'w': - w_opt = TRUE; - break; - default: - usage(); - break; - } - } - if (optind < argc) - usage(); - - test_inserts(0); - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/insdelln.c b/test/insdelln.c deleted file mode 100644 index d5034a44596..00000000000 --- a/test/insdelln.c +++ /dev/null @@ -1,387 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2008-2009,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"), 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: insdelln.c,v 1.5 2010/11/13 23:39:38 tom Exp $ - * - * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln - */ - -#include - -#define SHOW(n) ((n) == ERR ? "ERR" : "OK") -#define COLOR_DEFAULT (-1) - -typedef struct { - unsigned c; - unsigned v; - int pair; - unsigned attr; - int count; - int ch; - const char *c_msg; - const char *v_msg; - int y_val; - int x_val; - int y_beg, x_beg; - int y_max, x_max; -} STATUS; - -static const char * -color_params(unsigned state, int *pair) -{ - /* *INDENT-OFF* */ - static struct { - short pair; - short fg, bg; - const char *msg; - } table[] = { - { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" }, - { 1, COLOR_RED, COLOR_BLACK, "red/black" }, - { 2, COLOR_WHITE, COLOR_BLUE, "white/blue" }, - }; - /* *INDENT-ON* */ - - static bool first = TRUE; - const char *result = 0; - - if (has_colors()) { - if (first) { - unsigned n; - - start_color(); - for (n = 0; n < SIZEOF(table); ++n) { - init_pair(table[n].pair, table[n].fg, table[n].bg); - } - } - if (state < SIZEOF(table)) { - *pair = table[state].pair; - result = table[state].msg; - } - } - return result; -} - -static const char * -video_params(unsigned state, unsigned *attr) -{ - /* *INDENT-OFF* */ - static struct { - unsigned attr; - const char *msg; - } table[] = { - { A_NORMAL, "normal" }, - { A_BOLD, "bold" }, - { A_REVERSE, "reverse" }, - { A_UNDERLINE, "underline" }, - { A_BLINK, "blink" }, - }; - /* *INDENT-ON* */ - - const char *result = 0; - - if (state < SIZEOF(table)) { - *attr = table[state].attr; - result = table[state].msg; - } - return result; -} - -/* fill the window with a test-pattern */ -static void -fill_window(WINDOW *win) -{ - int y, x; - int y0 = -1, x0 = -1; - - getyx(win, y, x); - wmove(win, 0, 0); - while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) { - int y1, x1; - getyx(win, y1, x1); - if (y1 == y0 && x1 == x0) - break; - x0 = x1; - y0 = y1; - } - wmove(win, y, x); -} - -static void -show_status(WINDOW *win, STATUS * sp) -{ - int y, x; - - getyx(win, y, x); - wmove(win, 0, 0); - wprintw(win, "Count %d", sp->count); - if (sp->v_msg != 0) - wprintw(win, " Video %s", sp->v_msg); - if (sp->c_msg != 0) - wprintw(win, " Color %s", sp->c_msg); - wclrtoeol(win); - wmove(win, y, x); -} - -static void -reshow_status(WINDOW *win, STATUS * sp) -{ - fill_window(win); - show_status(win, sp); -} - -static void -do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *)) -{ - WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2, - sp->y_beg + 1, sp->x_beg + 1); - - if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) { - WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1); - - if (win2 != 0) { - box(win1, 0, 0); - wrefresh(win1); - func(win2); - - delwin(win2); - } else { - beep(); - } - delwin(win1); - touchwin(win); - } else { - beep(); - } -} - -static void -init_status(WINDOW *win, STATUS * sp) -{ - memset(sp, 0, sizeof(*sp)); - sp->c = 99; - sp->v = 99; - sp->ch = ' '; - - keypad(win, TRUE); - fill_window(win); - - getbegyx(win, sp->y_beg, sp->x_beg); - getmaxyx(win, sp->y_max, sp->x_max); -} - -static void -show_help(WINDOW *win) -{ - static const char *table[] = - { - "Basic commands:" - ,"Use h/j/k/l or arrow keys to move the cursor." - ,"Set the count parameter for insert/delete by entering digits 0-9." - ,"" - ,"Other commands:" - ,"space toggles through the set of video attributes and colors." - ,"t touches (forces repaint) of the current line." - ,"i calls insertln at the current position with the given count." - ,"d calls deleteln at the window beginning with the given count." - ,"I calls insdelln at the window beginning with the given count." - ,"D calls insdelln at the window beginning with the given -count." - ,"f refills the window with test-pattern using current attributes." - ,"w recur to test windows other than stdscr" - ,"q quit" - ,"= resets count to zero." - ,"? shows this help-window" - ,"" - ,"" - }; - - 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(); -} - -static void -update_status(WINDOW *win, STATUS * sp) -{ - switch (sp->ch) { - case ' ': /* next test-iteration */ - if (has_colors()) { - if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) { - sp->c_msg = color_params(sp->c = 0, &(sp->pair)); - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { - sp->v_msg = video_params(sp->v = 0, &(sp->attr)); - } - } - } else { - if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) { - sp->v_msg = video_params(sp->v = 0, &(sp->attr)); - } - } - sp->count = 0; - show_status(win, sp); - break; - case KEY_LEFT: - case 'h': - if (sp->x_val > 0) - wmove(win, sp->y_val, --(sp->x_val)); - break; - case KEY_DOWN: - case 'j': - if (sp->y_val < sp->y_max) - wmove(win, ++(sp->y_val), sp->x_val); - break; - case KEY_UP: - case 'k': - if (sp->y_val > 0) - wmove(win, --(sp->y_val), sp->x_val); - break; - case KEY_RIGHT: - case 'l': - if (sp->x_val < sp->x_max) - wmove(win, sp->y_val, ++(sp->x_val)); - break; - case 't': - touchline(win, sp->y_val, 1); - break; - case '=': - sp->count = 0; - show_status(win, sp); - break; - case '?': - do_subwindow(win, sp, show_help); - break; - default: - if (isdigit(sp->ch)) { - sp->count = (sp->count * 10) + (sp->ch - '0'); - show_status(win, sp); - } else { - beep(); - } - break; - } -} - -static void -test_winsdelln(WINDOW *win) -{ - STATUS st; - int n; - - init_status(win, &st); - - do { - (void) wattrset(win, st.attr | (attr_t) COLOR_PAIR(st.pair)); - switch (st.ch) { - case 'i': - for (n = 0; n < st.count; ++n) - winsertln(win); - break; - case 'd': - for (n = 0; n < st.count; ++n) - wdeleteln(win); - break; - case 'I': - winsdelln(win, st.count); - break; - case 'D': - winsdelln(win, -st.count); - break; - case 'f': - fill_window(win); - reshow_status(win, &st); - break; - case 'w': - do_subwindow(win, &st, test_winsdelln); - break; - case 'q': - return; - default: - update_status(win, &st); - break; - } - } while ((st.ch = wgetch(win)) != ERR); -} - -static void -test_insdelln(void) -{ - STATUS st; - int n; - - init_status(stdscr, &st); - - do { - (void) attrset(st.attr | (attr_t) COLOR_PAIR(st.pair)); - switch (st.ch) { - case 'i': - for (n = 0; n < st.count; ++n) - insertln(); - break; - case 'd': - for (n = 0; n < st.count; ++n) - deleteln(); - break; - case 'I': - insdelln(st.count); - break; - case 'D': - insdelln(-st.count); - break; - case 'f': - fill_window(stdscr); - reshow_status(stdscr, &st); - break; - case 'w': - do_subwindow(stdscr, &st, test_winsdelln); - break; - case 'q': - return; - default: - update_status(stdscr, &st); - break; - } - } while ((st.ch = getch()) != ERR); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - initscr(); - cbreak(); - noecho(); - - test_insdelln(); - endwin(); - - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/inserts.c b/test/inserts.c deleted file mode 100644 index a12fa401128..00000000000 --- a/test/inserts.c +++ /dev/null @@ -1,438 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2002-2009,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"), 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: inserts.c,v 1.23 2010/12/12 00:19:55 tom Exp $ - * - * Demonstrate the winsstr() and winsch functions. - * Thomas Dickey - 2002/10/19 - */ - -#include - -#if HAVE_WINSSTR - -#include - -#define InsNStr insnstr -#define InsStr insstr -#define MvInsNStr (void) mvinsnstr -#define MvInsStr (void) mvinsstr -#define MvWInsNStr (void) mvwinsnstr -#define MvWInsStr (void) mvwinsstr -#define WInsNStr winsnstr -#define WInsStr winsstr - -#define InsCh insch -#define MvInsCh (void) mvinsch -#define MvWInsCh (void) mvwinsch -#define WInsCh winsch - -#define MY_TABSIZE 8 - -typedef enum { - oDefault = 0, - oMove = 1, - oWindow = 2, - oMoveWindow = 3 -} Options; - -static bool m_opt = FALSE; -static bool w_opt = FALSE; -static int n_opt = -1; - -static void -legend(WINDOW *win, int level, Options state, char *buffer, int length) -{ - const char *showstate; - - switch (state) { - default: - case oDefault: - showstate = ""; - break; - case oMove: - showstate = " (mvXXX)"; - break; - case oWindow: - showstate = " (winXXX)"; - break; - case oMoveWindow: - showstate = " (mvwinXXX)"; - break; - } - - wmove(win, 0, 0); - wprintw(win, - "The Strings/Chars displays should match. Enter any characters, except:\n"); - 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 <%s>", level, - showstate, length, buffer); -} - -static int -ColOf(char *buffer, int length, int margin) -{ - int n; - int result; - - for (n = 0, result = margin + 1; n < length; ++n) { - int ch = UChar(buffer[n]); - switch (ch) { - case '\n': - /* actually newline should clear the remainder of the line - * and move to the next line - but that seems a little awkward - * in this example. - */ - case '\r': - result = 0; - break; - case '\b': - if (result > 0) - --result; - break; - case '\t': - result += (MY_TABSIZE - (result % MY_TABSIZE)); - break; - case '\177': - result += 2; - break; - default: - ++result; - if (ch < 32) - ++result; - break; - } - } - return result; -} - -#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) -static void -test_inserts(int level) -{ - static bool first = TRUE; - - int ch; - int limit; - int row = 1; - int col; - int row2, col2; - int length; - char buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; - int margin = (2 * MY_TABSIZE) - 1; - 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")); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - keypad(stdscr, TRUE); - } - - limit = LINES - 5; - if (level > 0) { - look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); - work = newwin(limit - 2, COLS - (2 * level), 1, level); - show = newwin(4, COLS, limit + 1, 0); - box(look, 0, 0); - wnoutrefresh(look); - limit -= 2; - } else { - work = stdscr; - show = derwin(stdscr, 4, COLS, limit + 1, 0); - } - keypad(work, TRUE); - - for (col = margin + 1; col < COLS; col += MY_TABSIZE) - MvWVLine(work, row, col, '.', limit - 2); - - MvWVLine(work, row, margin, ACS_VLINE, limit - 2); - MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); - limit /= 2; - - MvWAddStr(work, 1, 2, "String"); - MvWAddStr(work, limit + 1, 2, "Chars"); - wnoutrefresh(work); - - buffer[length = 0] = '\0'; - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - - /* - * Show the characters inserted in color, to distinguish from those that - * are shifted. - */ - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - wbkgdset(work, COLOR_PAIR(1) | ' '); - } - - while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { - wmove(work, row, margin + 1); - switch (ch) { - case key_RECUR: - test_inserts(level + 1); - - touchwin(look); - touchwin(work); - touchwin(show); - - wnoutrefresh(look); - wnoutrefresh(work); - wnoutrefresh(show); - - doupdate(); - break; - case key_NEWLINE: - if (row < limit) { - ++row; - /* put the whole string in, all at once */ - col2 = margin + 1; - switch (option) { - case oDefault: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (move(row, col2) != ERR) { - InsNStr(buffer + col, LEN(col)); - } - } - } else { - if (move(row, col2) != ERR) { - InsStr(buffer); - } - } - break; - case oMove: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvInsNStr(row, col2, buffer + col, LEN(col)); - } - } else { - MvInsStr(row, col2, buffer); - } - break; - case oWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (wmove(work, row, col2) != ERR) { - WInsNStr(work, buffer + col, LEN(col)); - } - } - } else { - if (wmove(work, row, col2) != ERR) { - WInsStr(work, buffer); - } - } - break; - case oMoveWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvWInsNStr(work, row, col2, buffer + col, LEN(col)); - } - } else { - MvWInsStr(work, row, col2, buffer); - } - break; - } - - /* do the corresponding single-character insertion */ - row2 = limit + row; - for (col = 0; col < length; ++col) { - col2 = ColOf(buffer, col, margin); - switch (option) { - case oDefault: - if (move(row2, col2) != ERR) { - InsCh(UChar(buffer[col])); - } - break; - case oMove: - MvInsCh(row2, col2, UChar(buffer[col])); - break; - case oWindow: - if (wmove(work, row2, col2) != ERR) { - WInsCh(work, UChar(buffer[col])); - } - break; - case oMoveWindow: - MvWInsCh(work, row2, col2, UChar(buffer[col])); - break; - } - } - } else { - beep(); - } - break; - default: - if (ch <= 0 || ch > 255) { - beep(); - break; - } - buffer[length++] = (char) ch; - buffer[length] = '\0'; - - /* put the string in, one character at a time */ - col = ColOf(buffer, length - 1, margin); - switch (option) { - case oDefault: - if (move(row, col) != ERR) { - InsStr(buffer + length - 1); - } - break; - case oMove: - MvInsStr(row, col, buffer + length - 1); - break; - case oWindow: - if (wmove(work, row, col) != ERR) { - WInsStr(work, buffer + length - 1); - } - break; - case oMoveWindow: - MvWInsStr(work, row, col, buffer + length - 1); - break; - } - - /* do the corresponding single-character insertion */ - switch (option) { - case oDefault: - if (move(limit + row, col) != ERR) { - InsCh(UChar(ch)); - } - break; - case oMove: - MvInsCh(limit + row, col, UChar(ch)); - break; - case oWindow: - if (wmove(work, limit + row, col) != ERR) { - WInsCh(work, UChar(ch)); - } - break; - case oMoveWindow: - MvWInsCh(work, limit + row, col, UChar(ch)); - break; - } - - wnoutrefresh(work); - - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - break; - } - } - if (level > 0) { - delwin(show); - delwin(work); - delwin(look); - } -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: inserts [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" - ," -w use window-parameter even when stdscr would be implied" - }; - 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; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { - switch (ch) { - case 'f': - init_linedata(optarg); - break; - case 'm': - m_opt = TRUE; - break; - case 'n': - n_opt = atoi(optarg); - if (n_opt == 0) - n_opt = -1; - break; - case 'w': - w_opt = TRUE; - break; - default: - usage(); - break; - } - } - if (optind < argc) - usage(); - - test_inserts(0); - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the winsstr function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif /* HAVE_WINSSTR */ diff --git a/test/key_names.c b/test/key_names.c deleted file mode 100644 index ba45656d50a..00000000000 --- a/test/key_names.c +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007,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 * - * "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: key_names.c,v 1.4 2008/10/11 20:22:37 tom Exp $ - */ - -#include - -#if USE_WIDEC_SUPPORT - -static void -usage(void) -{ - fprintf(stderr, "Usage: key_names [-m] [-s]\n"); - ExitProgram(EXIT_FAILURE); -} - -int -main(int argc, char *argv[]) -{ - int n; - - bool do_setup = FALSE; - bool do_meta = FALSE; - - setlocale(LC_ALL, ""); - - while ((n = getopt(argc, argv, "ms")) != -1) { - switch (n) { - case 'm': - do_meta = TRUE; - break; - case 's': - do_setup = TRUE; - break; - default: - usage(); - /* NOTREACHED */ - } - } - - if (do_setup) { - /* - * Get the terminfo entry into memory, and tell ncurses that we want to - * use function keys. That will make it add any user-defined keys that - * appear in the terminfo. - */ - newterm(getenv("TERM"), stderr, stdin); - keypad(stdscr, TRUE); - if (do_meta) - meta(stdscr, TRUE); - endwin(); - } - for (n = -1; n < KEY_MAX + 512; n++) { - const char *result = key_name(n); - if (result != 0) - printf("%d(%5o):%s\n", n, n, result); - } - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/keynames.c b/test/keynames.c deleted file mode 100644 index 26cfa87b4fb..00000000000 --- a/test/keynames.c +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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 * - * "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: keynames.c,v 1.9 2008/10/11 20:22:37 tom Exp $ - */ - -#include - -static void -usage(void) -{ - fprintf(stderr, "Usage: keynames [-m] [-s]\n"); - ExitProgram(EXIT_FAILURE); -} - -int -main(int argc, char *argv[]) -{ - int n; - bool do_setup = FALSE; - bool do_meta = FALSE; - - setlocale(LC_ALL, ""); - - while ((n = getopt(argc, argv, "ms")) != -1) { - switch (n) { - case 'm': - do_meta = TRUE; - break; - case 's': - do_setup = TRUE; - break; - default: - usage(); - /* NOTREACHED */ - } - } - - if (do_setup) { - /* - * Get the terminfo entry into memory, and tell ncurses that we want to - * use function keys. That will make it add any user-defined keys that - * appear in the terminfo. - */ - newterm(getenv("TERM"), stderr, stdin); - keypad(stdscr, TRUE); - if (do_meta) - meta(stdscr, TRUE); - endwin(); - } - - for (n = -1; n < KEY_MAX + 512; n++) { - const char *result = keyname(n); - if (result != 0) - printf("%d(%5o):%s\n", n, n, result); - } - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/knight.c b/test/knight.c deleted file mode 100644 index d9f81facace..00000000000 --- a/test/knight.c +++ /dev/null @@ -1,727 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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. * - ****************************************************************************/ -/* - * Knight's Tour - a brain game - * - * The original of this game was anonymous. It had an unbelievably bogus - * interface, you actually had to enter square coordinates! Redesign by - * Eric S. Raymond July 22 1995. Mouse support - * added September 20th 1995. - * - * $Id: knight.c,v 1.31 2010/11/13 20:44:21 tom Exp $ - */ - -#include - -/* board size */ -#define BDEPTH 8 -#define BWIDTH 8 - -/* where to start the instructions */ -#define INSTRY 2 -#define INSTRX 35 - -/* corner of board */ -#define BOARDY 2 -#define BOARDX 0 - -/* notification line */ -#define NOTIFYY 21 - -/* virtual color values */ -#define TRAIL_COLOR 1 -#define PLUS_COLOR 2 -#define MINUS_COLOR 3 - -#define CX(x) (2 + 4 * (x)) -#define CY(y) (1 + 2 * (y)) -#define cellmove(y, x) wmove(boardwin, CY(y), CX(x)) -#define CXINV(x) (((x) - 1) / 4) -#define CYINV(y) (((y) - 2) / 2) - -typedef struct { - short x, y; -} cell; - -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 */ -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 */ -/* *INDENT-OFF* */ -static const struct { - int y; - int x; -} offsets[] = { - { 2, 1 }, - { 1, 2 }, - { -1, 2 }, - { -2, 1 }, - { -2, -1 }, - { -1, -2 }, - { 1, -2 }, - { 2, -1 }, -}; -/* *INDENT-ON* */ - -static void -init_program(void) -{ - setlocale(LC_ALL, ""); - - srand((unsigned) getpid()); - initscr(); - cbreak(); /* immediate char return */ - noecho(); /* no immediate echo */ - boardwin = newwin(BDEPTH * 2 + 1, BWIDTH * 4 + 1, BOARDY, BOARDX); - helpwin = newwin(0, 0, INSTRY, INSTRX); - msgwin = newwin(1, INSTRX - 1, NOTIFYY, 0); - scrollok(msgwin, TRUE); - keypad(boardwin, TRUE); - - if (has_colors()) { - int bg = COLOR_BLACK; - - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - bg = -1; -#endif - - (void) init_pair(TRAIL_COLOR, (short) COLOR_CYAN, (short) bg); - (void) init_pair(PLUS_COLOR, (short) COLOR_RED, (short) bg); - (void) init_pair(MINUS_COLOR, (short) COLOR_GREEN, (short) bg); - - trail |= COLOR_PAIR(TRAIL_COLOR); - plus |= COLOR_PAIR(PLUS_COLOR); - minus |= COLOR_PAIR(MINUS_COLOR); - } -#ifdef NCURSES_MOUSE_VERSION - (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); -#endif /* NCURSES_MOUSE_VERSION */ - - oldch = minus; -} - -static void -help1(void) -/* game explanation -- initial help screen */ -{ - (void) waddstr(helpwin, "Knight's move is a solitaire puzzle. Your\n"); - (void) waddstr(helpwin, "objective is to visit each square of the \n"); - (void) waddstr(helpwin, "chessboard exactly once by making knight's\n"); - (void) waddstr(helpwin, "moves (one square right or left followed \n"); - (void) waddstr(helpwin, "by two squares up or down, or two squares \n"); - (void) waddstr(helpwin, "right or left followed by one square up or\n"); - (void) waddstr(helpwin, "down). You may start anywhere.\n\n"); - - (void) waddstr(helpwin, "Use arrow keys to move the cursor around.\n"); - (void) waddstr(helpwin, "When you want to move your knight to the \n"); - (void) waddstr(helpwin, "cursor location, press or Enter.\n"); - (void) waddstr(helpwin, "Illegal moves will be rejected with an \n"); - (void) waddstr(helpwin, "audible beep.\n\n"); - (void) waddstr(helpwin, "The program will detect if you solve the\n"); - (void) waddstr(helpwin, "puzzle; also inform you when you run out\n"); - (void) waddstr(helpwin, "of legal moves.\n\n"); - - MvWAddStr(helpwin, NOTIFYY - INSTRY, 0, - "Press `?' to go to keystroke help."); -} - -static void -help2(void) -/* keystroke help screen */ -{ - (void) waddstr(helpwin, "Possible moves are shown with `-'.\n\n"); - - (void) waddstr(helpwin, "You can move around with the arrow keys or\n"); - (void) waddstr(helpwin, "with the rogue/hack movement keys. Other\n"); - (void) waddstr(helpwin, "commands allow you to undo moves or redraw.\n"); - (void) waddstr(helpwin, "Your mouse may work; try left-button to\n"); - (void) waddstr(helpwin, "move to the square under the pointer.\n\n"); - - (void) waddstr(helpwin, "x,q -- exit y k u 7 8 9\n"); - (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"); - - (void) waddstr(helpwin, "\nYou can place your knight on the selected\n"); - (void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n"); - (void) waddstr(helpwin, "center key. Use F/B to review the path.\n"); - - MvWAddStr(helpwin, NOTIFYY - INSTRY, 0, - "Press `?' to go to game explanation"); -} - -static void -show_help(bool * keyhelp) -{ - werase(helpwin); - if (*keyhelp) { - help1(); - *keyhelp = FALSE; - } else { - help2(); - *keyhelp = TRUE; - } - wrefresh(helpwin); -} - -static bool -chksqr(int r1, int c1) -{ - if ((r1 < 0) || (r1 > BDEPTH - 1)) - return (FALSE); - if ((c1 < 0) || (c1 > BWIDTH - 1)) - return (FALSE); - return ((!board[r1][c1]) ? TRUE : FALSE); -} - -static bool -chkmoves(int rw, int col) -/* check to see if valid moves are available */ -{ - unsigned n; - - for (n = 0; n < SIZEOF(offsets); n++) - if (chksqr(rw + offsets[n].y, col + offsets[n].x)) - return (TRUE); - return (FALSE); -} - -static void -dosquares(void) -{ - int i, j; - - MvAddStr(0, 20, "KNIGHT'S MOVE -- a logical solitaire"); - - move(BOARDY, BOARDX); - waddch(boardwin, ACS_ULCORNER); - for (j = 0; j < 7; j++) { - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_TTEE); - } - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_URCORNER); - - for (i = 1; i < BDEPTH; i++) { - move(BOARDY + i * 2 - 1, BOARDX); - waddch(boardwin, ACS_VLINE); - for (j = 0; j < BWIDTH; j++) { - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ACS_VLINE); - } - move(BOARDY + i * 2, BOARDX); - waddch(boardwin, ACS_LTEE); - for (j = 0; j < BWIDTH - 1; j++) { - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_PLUS); - } - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_RTEE); - } - - move(BOARDY + i * 2 - 1, BOARDX); - waddch(boardwin, ACS_VLINE); - for (j = 0; j < BWIDTH; j++) { - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ' '); - waddch(boardwin, ACS_VLINE); - } - - move(BOARDY + i * 2, BOARDX); - waddch(boardwin, ACS_LLCORNER); - for (j = 0; j < BWIDTH - 1; j++) { - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_BTEE); - } - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_HLINE); - waddch(boardwin, ACS_LRCORNER); -} - -static void -mark_possibles(int prow, int pcol, 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); - waddch(boardwin, mark); - } - } -} - -static void -find_next_move(int *y, int *x) -{ - unsigned j, k; - int found = -1; - int first = -1; - int next = 0; - int oldy, oldx; - int newy, newx; - - 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 (first < 0) - first = (int) k; - if (newy == *y - && newx == *x) { - found = (int) k; - } else if (found >= 0) { - next = (int) k; - break; - } - } - } - if (found < 0) - next = first; - if (next >= 0) { - *y = oldy + offsets[next].y; - *x = oldx + offsets[next].x; - } - } else { - beep(); - } -} - -static void -unmarkcell(int row, int column) -{ - cellmove(row, column); - waddch(boardwin, '\b'); - waddch(boardwin, ' '); - waddch(boardwin, minus); - waddch(boardwin, ' '); -} - -static void -markcell(chtype tchar, int row, int column) -{ - cellmove(row, column); - waddch(boardwin, '\b'); - waddch(boardwin, tchar); - waddch(boardwin, tchar); - waddch(boardwin, tchar); -} - -static void -drawmove(chtype tchar, int oldy, int oldx, int row, int column) -/* place the stars, update board & currents */ -{ - if (movecount <= 1) { - int i, j; - - for (i = 0; i < BDEPTH; i++) { - for (j = 0; j < BWIDTH; j++) { - if (movecount == 0) { - unmarkcell(i, j); - } else { - cellmove(i, j); - if (winch(boardwin) == minus) - waddch(boardwin, movecount ? ' ' : minus); - } - } - } - } else { - markcell(tchar, oldy, oldx); - mark_possibles(oldy, oldx, ' '); - } - - if (row >= 0 && column >= 0) { - markcell(trail, row, column); - mark_possibles(row, column, minus); - board[row][column] = TRUE; - } - - wprintw(msgwin, "\nMove %d", movecount); - if (trialcount != movecount) - wprintw(msgwin, " (%d tries)", trialcount); - wclrtoeol(msgwin); -} - -static int -iabs(int num) -{ - if (num < 0) - return (-num); - else - return (num); -} - -static bool -evalmove(int row, int column) -/* evaluate move */ -{ - if (movecount == 1) - return (TRUE); - else if (board[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); - - if (!((rdif == 1) && (cdif == 2)) && !((rdif == 2) && (cdif == 1))) { - waddstr(msgwin, "\nThat's not a legal knight's move."); - return (FALSE); - } - } - - return (TRUE); -} - -static int -completed(void) -{ - int i, j, count = 0; - - for (i = 0; i < BDEPTH; i++) - for (j = 0; j < BWIDTH; j++) - if (board[i][j] != 0) - count += 1; - return (count == (BWIDTH * BDEPTH) ? -1 : count); -} - -static void -no_previous_move(void) -{ - waddstr(msgwin, "\nNo previous move."); - beep(); -} - -static void -play(void) -/* play the game */ -{ - bool keyhelp; /* TRUE if keystroke help is up */ - int i, j, count; - int lastcol = 0; /* last location visited */ - int lastrow = 0; - int ny = 0, nx = 0; - int review = 0; /* review history */ - int rw = 0, col = 0; /* current row and column */ - - do { - /* clear screen and draw board */ - werase(boardwin); - werase(helpwin); - werase(msgwin); - dosquares(); - help1(); - wnoutrefresh(stdscr); - wnoutrefresh(helpwin); - wnoutrefresh(msgwin); - wnoutrefresh(boardwin); - doupdate(); - - movecount = 0; - for (i = 0; i < BDEPTH; i++) { - for (j = 0; j < BWIDTH; j++) { - board[i][j] = FALSE; - unmarkcell(i, j); - } - } - memset(history, 0, sizeof(history)); - history[0].y = history[0].x = -1; - history[1].y = history[1].x = -1; - lastrow = lastcol = -2; - movecount = 1; - trialcount = 1; - keyhelp = FALSE; - show_help(&keyhelp); - - for (;;) { - if (rw != lastrow || col != lastcol) { - if (lastrow >= 0 && lastcol >= 0) { - cellmove(lastrow, lastcol); - if (board[lastrow][lastcol]) - waddch(boardwin, trail); - else - waddch(boardwin, oldch); - } - - cellmove(rw, col); - oldch = winch(boardwin); - - lastrow = rw; - lastcol = col; - } - cellmove(rw, col); - waddch(boardwin, plus); - cellmove(rw, col); - - wrefresh(msgwin); - - switch (wgetch(boardwin)) { - case 'k': - case '8': - case KEY_UP: - ny = rw + BDEPTH - 1; - nx = col; - break; - case 'j': - case '2': - case KEY_DOWN: - ny = rw + 1; - nx = col; - break; - case 'h': - case '4': - case KEY_LEFT: - ny = rw; - nx = col + BWIDTH - 1; - break; - case 'l': - case '6': - case KEY_RIGHT: - ny = rw; - nx = col + 1; - break; - case 'y': - case '7': - case KEY_A1: - ny = rw + BDEPTH - 1; - nx = col + BWIDTH - 1; - break; - case 'b': - case '1': - case KEY_C1: - ny = rw + 1; - nx = col + BWIDTH - 1; - break; - case 'u': - case '9': - case KEY_A3: - ny = rw + BDEPTH - 1; - nx = col + 1; - break; - case 'n': - case '3': - case KEY_C3: - ny = rw + 1; - nx = col + 1; - break; - -#ifdef NCURSES_MOUSE_VERSION - case KEY_MOUSE: - { - MEVENT myevent; - - getmouse(&myevent); - if (myevent.y >= CY(0) && myevent.y <= CY(BDEPTH) - && myevent.x >= CX(0) && myevent.x <= CX(BWIDTH)) { - nx = CXINV(myevent.x); - ny = CYINV(myevent.y); - ungetch('\n'); - break; - } else { - beep(); - continue; - } - } -#endif /* NCURSES_MOUSE_VERSION */ - - case KEY_B2: - case '\n': - case ' ': - review = 0; - if (evalmove(rw, col)) { - drawmove(trail, - history[movecount - 1].y, - history[movecount - 1].x, - rw, col); - history[movecount].y = (short) rw; - history[movecount].x = (short) col; - movecount++; - trialcount++; - - if (!chkmoves(rw, col)) { - if (completed() < 0) { - waddstr(msgwin, "\nYou won."); - } else { - waddstr(msgwin, - "\nNo further moves are possible."); - } - } - } else { - beep(); - } - break; - - case KEY_UNDO: - case KEY_BACKSPACE: - case '\b': - review = 0; - if (movecount <= 0) { - no_previous_move(); - } else if (movecount <= 1) { - ny = history[movecount].y; - nx = history[movecount].x; - if (nx < 0 || ny < 0) { - ny = lastrow; - nx = lastcol; - } - movecount = 0; - board[ny][nx] = FALSE; - oldch = minus; - drawmove(' ', ny, nx, -1, -1); - movecount = 1; - trialcount = 1; - no_previous_move(); - } else { - int oldy = history[movecount - 1].y; - int oldx = history[movecount - 1].x; - - if (!board[rw][col]) { - cellmove(rw, col); - waddch(boardwin, ' '); - } - - board[oldy][oldx] = FALSE; - --movecount; - ny = history[movecount - 1].y; - nx = history[movecount - 1].x; - if (nx < 0 || ny < 0) { - ny = oldy; - nx = oldx; - } - drawmove(' ', oldy, oldx, ny, nx); - - /* avoid problems if we just changed the current cell */ - cellmove(lastrow, lastcol); - oldch = winch(boardwin); - } - break; - - case 'a': - nx = col; - ny = rw; - find_next_move(&ny, &nx); - break; - - case 'F': - if (review > 0) { - review--; - ny = history[movecount - review - 1].y; - nx = history[movecount - review - 1].x; - } else { - beep(); - } - break; - - case 'B': - if (review < movecount - 2) { - review++; - ny = history[movecount - review - 1].y; - nx = history[movecount - review - 1].x; - } else { - beep(); - } - break; - - case KEY_REDO: - case '\f': - case 'r': - clearok(curscr, TRUE); - wnoutrefresh(stdscr); - wnoutrefresh(boardwin); - wnoutrefresh(msgwin); - wnoutrefresh(helpwin); - doupdate(); - break; - - case 'q': - case 'x': - goto dropout; - - case '?': - show_help(&keyhelp); - break; - - default: - beep(); - break; - } - - col = nx % BWIDTH; - rw = ny % BDEPTH; - } - - dropout: - if ((count = completed()) < 0) - wprintw(msgwin, "\nYou won. Care to try again? "); - else - wprintw(msgwin, "\n%d squares filled. Try again? ", count); - wclrtoeol(msgwin); - } while - (tolower(wgetch(msgwin)) == 'y'); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - init_program(); - - play(); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} - -/* knight.c ends here */ diff --git a/test/linedata.h b/test/linedata.h deleted file mode 100644 index 2510ee72f64..00000000000 --- a/test/linedata.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,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"), 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. * - ****************************************************************************/ - -#define isQUIT(c) ((c) == QUIT || (c) == ESCAPE) - -#define key_RECUR CTRL('W') -#define key_NEWLINE CTRL('N') -#define key_BACKSPACE '\b' - -static FILE *linedata; - -static void -failed(const char *s) -{ - perror(s); - ExitProgram(EXIT_FAILURE); -} - -static void -init_linedata(const char *name) -{ - if ((linedata = fopen(name, "r")) == 0) { - failed(name); - } -} - -static int -read_linedata(WINDOW *work) -{ - int result; - if (linedata != 0) { - result = fgetc(linedata); - if (result == EOF) { - fclose(linedata); - linedata = 0; - result = read_linedata(work); - } else { - wrefresh(work); - if (result == '\n') { - result = key_NEWLINE; - } - } - } else { -#ifdef WIDE_LINEDATA - wint_t ch; - int code; - - result = ERR; - while ((code = wget_wch(work, &ch)) != ERR) { - - if (code == KEY_CODE_YES) { - switch (ch) { - case KEY_DOWN: - result = key_NEWLINE; - break; - case KEY_BACKSPACE: - result = key_BACKSPACE; - break; - default: - beep(); - continue; - } - } else if (code != ERR) { - result = (int) ch; - break; - } else { - break; - } - } -#else - result = wgetch(work); -#endif - } - return result; -} diff --git a/test/linux-color.dat b/test/linux-color.dat deleted file mode 100644 index 528b3f0b61b..00000000000 --- a/test/linux-color.dat +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################## -# Copyright (c) 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"), # -# 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: linux-color.dat,v 1.2 2006/04/22 21:40:00 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 */ -scale:255 -0: 0 0 0 -1: 170 0 0 -2: 0 170 0 -3: 170 85 0 -4: 0 0 170 -5: 170 0 170 -6: 0 170 170 -7: 170 170 170 -8: 85 85 85 -9: 255 85 85 -10: 85 255 85 -11: 255 255 85 -12: 85 85 255 -13: 255 85 255 -14: 85 255 255 -15: 255 255 255 diff --git a/test/listused.sh b/test/listused.sh deleted file mode 100755 index 1c3fe0a64d5..00000000000 --- a/test/listused.sh +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/sh -############################################################################## -# Copyright (c) 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"), # -# 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: listused.sh,v 1.8 2010/09/18 15:15:15 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 -# these options: -# --disable-macros -# --enable-sp-funcs -# --enable-widec -# Static libraries are used, to provide some filtering based on internal usage -# of the different symbols. - -# keep the sorting independent of locale: -if test "${LANGUAGE+set}" = set; then LANGUAGE=C; export LANGUAGE; fi -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -if test "${LC_COLLATE+set}" = set; then LC_COLLATE=C; export LC_COLLATE; fi - -NM_OPTS= - -if test ! -d ../objects ; then - echo "? need objects to run this script" - exit 1 -elif test ! -d ../lib ; then - echo "? need libraries to run this script" - exit 1 -fi - -PROGS= -for name in `(echo "test:";sort modules; echo "progs:";sort ../progs/modules) |sed -e 's/[ ].*//' -e '/^[#@]/d'` -do - case $name in - *:) - PROGS="$PROGS $name" - ;; - *) - NAME=../objects/${name}.o - if test -f $NAME - then - PROGS="$PROGS $NAME" - fi - ;; - esac -done - -# For each library - -for lib in ../lib/*.a -do - LIB=`basename $lib .a` - case $LIB in - *_*|*+*) - continue - ;; - esac - - tmp=`echo $LIB|sed -e 's/w$//'` - echo - echo "${tmp}:" - echo $tmp |sed -e 's/./-/g' - # Construct a list of public externals provided by the library. - WANT=`nm $NM_OPTS $lib |\ - sed -e 's/^[^ ]*//' \ - -e 's/^ *//' \ - -e '/^[ a-z] /d' \ - -e '/:$/d' \ - -e '/^$/d' \ - -e '/^U /d' \ - -e 's/^[A-Z] //' \ - -e '/^_/d' |\ - sort -u` - # List programs which use that external. - for name in $WANT - do - HAVE= - tags= - last= - for prog in $PROGS - do - case $prog in - *:) - tags=$prog - ;; - *) - TEST=`nm $NM_OPTS $prog |\ - sed -e 's/^[^ ]*//' \ - -e 's/^ *//' \ - -e '/^[ a-z] /d' \ - -e '/:$/d' \ - -e '/^$/d' \ - -e 's/^[A-Z] //' \ - -e '/^_/d' \ - -e 's/^'${name}'$/_/' \ - -e '/^[^_]/d'` - if test -n "$TEST" - then - have=`basename $prog .o` - if test -n "$HAVE" - then - if test "$last" = "$tags" - then - HAVE="$HAVE $have" - else - HAVE="$HAVE $tags $have" - fi - else - HAVE="$tags $have" - fi - last="$tags" - fi - ;; - esac - done - # if we did not find a program using it directly, see if it - # is used within a library. - if test -z "$HAVE" - then - for tmp in ../lib/*.a - do - case $tmp in - *_*|*+*) - continue - ;; - esac - TEST=`nm $NM_OPTS $tmp |\ - sed -e 's/^[^ ]*//' \ - -e 's/^ *//' \ - -e '/^[ a-z] /d' \ - -e '/:$/d' \ - -e '/^$/d' \ - -e '/^[A-TV-Z] /d' \ - -e 's/^[A-Z] //' \ - -e '/^_/d' \ - -e 's/^'${name}'$/_/' \ - -e '/^[^_]/d'` - if test -n "$TEST" - then - tmp=`basename $tmp .a |sed -e 's/w$//'` - HAVE=`echo $tmp | sed -e 's/lib/lib: /'` - break - fi - done - fi - test -z "$HAVE" && HAVE="-" - lenn=`expr 39 - length $name` - lenn=`expr $lenn / 8` - tabs= - while test $lenn != 0 - do - tabs="${tabs} " - lenn=`expr $lenn - 1` - done - echo "${name}${tabs}${HAVE}" - done -done diff --git a/test/lrtest.c b/test/lrtest.c deleted file mode 100644 index da12034ce08..00000000000 --- a/test/lrtest.c +++ /dev/null @@ -1,182 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2005,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"), 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. * - ****************************************************************************/ -/* - * Test lower-right-hand corner access - * - * originally by Eric S. Raymond , written for animation - * and resizing -T.Dickey - * - * 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 $ - */ - -#include - -typedef struct { - int y, x, mode, dir, inc; - chtype value; -} MARK; - -/* - * Make a couple of markers go 'round the border to demonstrate that we can - * really write to all positions properly. - */ -static void -show(MARK *m) -{ - MvAddCh(m->y, m->x, m->value); - if (m->mode == 0) { /* along the x-direction */ - m->x += m->inc; - if (m->x >= COLS) { - m->x = COLS - 1; - m->inc = -m->dir * m->inc; - m->y += m->inc; - m->mode = 1; - } else if (m->x < 0) { - m->x = 0; - m->inc = -m->dir * m->inc; - m->y += m->inc; - m->mode = 1; - } - } else { /* along the y-direction */ - m->y += m->inc; - if (m->y >= LINES) { - m->y = LINES - 1; - m->inc = m->dir * m->inc; - m->x += m->inc; - m->mode = 0; - } else if (m->y < 0) { - m->y = 0; - m->inc = m->dir * m->inc; - m->x += m->inc; - m->mode = 0; - } - } -} - -int -main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - static MARK marks[] = - { - {0, 0, 0, -1, 1, '+' | A_BOLD}, - {0, 0, 1, 1, 2, 'X'}, - {0, 0, 1, -1, 3, 'Y'}, - {0, 8, 0, -1, 1, '+' | A_BOLD}, - {0, 9, 0, -1, 1, '+' | A_BOLD}, - {1, 0, 1, 1, 1, '*' | A_REVERSE}, - {2, 0, 1, 1, 1, '*' | A_REVERSE} - }; - - setlocale(LC_ALL, ""); - - initscr(); - noecho(); - cbreak(); - nodelay(stdscr, TRUE); - curs_set(0); - -#ifdef KEY_RESIZE - keypad(stdscr, TRUE); - restart: -#endif - move(LINES / 2 - 1, 4); - if (!(has_ic() -#if HAVE_SETUPTERM - /* see PutCharLR() */ - || auto_right_margin - || (enter_am_mode && exit_am_mode) -#endif - )) { - addstr("Your terminal lacks the capabilities needed to address the\n"); - move(LINES / 2, 4); - addstr("lower-right-hand corner of the screen.\n"); - } else { - addstr("This is a test of access to the lower right corner.\n"); - move(LINES / 2, 4); - addstr("If the top of the box is missing, the test failed.\n"); - move(LINES / 2 + 1, 4); - addstr("Please report this (with a copy of your terminfo entry).\n"); - move(LINES / 2 + 2, 4); - addstr("to the ncurses maintainers, at bug-ncurses@gnu.org.\n"); - } - - for (;;) { - int ch; - unsigned n; - - box(stdscr, 0, 0); - for (n = 0; n < SIZEOF(marks); n++) { - show(&marks[n]); - } - - if ((ch = getch()) > 0) { - if (ch == 'q') - break; - else if (ch == 's') - nodelay(stdscr, FALSE); - else if (ch == ' ') - nodelay(stdscr, TRUE); -#ifdef TRACE - else if (ch == 'T') - trace(0); - else if (ch == 't') - trace(TRACE_CALLS | TRACE_ICALLS | TRACE_UPDATE); -#endif -#ifdef KEY_RESIZE - else if (ch == KEY_RESIZE) { - for (n = 0; n < SIZEOF(marks); n++) { - if (marks[n].mode == 0) { /* moving along x-direction */ - if (marks[n].y) - marks[n].y = LINES - 1; - } else { - if (marks[n].x) - marks[n].x = COLS - 1; - } - } - flash(); - erase(); - wrefresh(curscr); - goto restart; - } -#endif - } - napms(50); - refresh(); - } - - curs_set(1); - endwin(); - ExitProgram(EXIT_SUCCESS); -} - -/* lrtest.c ends here */ diff --git a/test/make-tar.sh b/test/make-tar.sh deleted file mode 100755 index 0ebccbbc6e8..00000000000 --- a/test/make-tar.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/sh -# $Id: make-tar.sh,v 1.10 2011/03/26 20:46:51 tom Exp $ -############################################################################## -# Copyright (c) 2010,2011 Free 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. # -############################################################################## -# Construct a tar-file containing only the test tree as well as its associated -# scripts. The reason for doing that is to simplify distributing the test -# programs as a separate package. - -CDPATH=: -export CDPATH - -TARGET=`pwd` - -: ${PKG_NAME:=ncurses-examples} -: ${ROOTNAME:=ncurses-test} -: ${DESTDIR:=$TARGET} -: ${TMPDIR:=/tmp} - -grep_assign() { - grep_assign=`egrep "^$2\>" "$1" | sed -e "s/^$2[ ]*=[ ]*//" -e 's/"//g'` - eval $2=\"$grep_assign\" -} - -grep_patchdate() { - grep_assign ../dist.mk NCURSES_MAJOR - grep_assign ../dist.mk NCURSES_MINOR - grep_assign ../dist.mk NCURSES_PATCH -} - -# The rpm spec-file in the ncurses tree is a template. Fill in the version -# information from dist.mk -edit_specfile() { - sed \ - -e "s/\\/$NCURSES_MAJOR/g" \ - -e "s/\\/$NCURSES_MINOR/g" \ - -e "s/\\/$NCURSES_PATCH/g" $1 >$1.new - chmod u+w $1 - mv $1.new $1 -} - -make_changelog() { - test -f $1 && chmod u+w $1 - cat >$1 <MANIFEST ) - -cd $BUILD || exit - -# Remove build-artifacts. -find . -name RCS -exec rm -rf {} \; -find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null -find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null -find $BUILD/$ROOTNAME -type d -exec rmdir {} \; 2>/dev/null - -# There is no need for this script in the tar file. -rm -f $ROOTNAME/make-tar.sh - -# Remove build-artifacts. -find . -name "*.gz" -exec rm -rf {} \; - -# Make the files writable... -chmod -R u+w . - -tar cf - $ROOTNAME | gzip >$DESTDIR/$ROOTNAME.tar.gz -cd $DESTDIR - -pwd -ls -l $ROOTNAME.tar.gz - -# vi:ts=4 sw=4 diff --git a/test/mk-test.awk b/test/mk-test.awk deleted file mode 100644 index df560ebfa64..00000000000 --- a/test/mk-test.awk +++ /dev/null @@ -1,132 +0,0 @@ -# $Id: mk-test.awk,v 1.12 2010/11/06 23:06:48 tom Exp $ -############################################################################## -# Copyright (c) 2006-2007,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"), # -# 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 -# -# generate Makefile for ncurses tests. -BEGIN { - first = 1; - count = 0; - } -/^#/ { - next; - } -/^$/ { - next; - } - { - if (first) { - print "# generated by mk-test.awk\n"; - first = 0; - } - progs[count] = $1; - flags[count] = $2; - using[count] = $3; - files[count] = ""; - for (n = 4; n <= NF; ++n) { - files[count] = sprintf("%s $(MODEL)/%s$o", files[count], $n); - } - count = count + 1; - } -END { - for (n = 0; n < count; ++n) { - if (n == 0) { - printf "TESTS\t= "; - } else { - printf "\t "; - } - printf "$(destdir)%s$x", progs[n]; - if (n < count - 1) { - printf " \\"; - } - print ""; - } - print "" - print "all: $(TESTS)" - print "" - print "sources:" - print "" - print "tags:" - print " $(CTAGS) *.[ch]" - print "" - print "# no libraries here" - print "libs \\" - print "install.libs \\" - print "uninstall.libs:" - print "" - 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 " dst=`echo $$src | $(TRANSFORM)`; \\" - print " $(INSTALL_PROG) $$src $(BINDIR)/$$dst; \\" - print " done'" - print "" - print "uninstall \\" - print "uninstall.test:" - print " $(SHELL) -c 'for src in $(TESTS); do \\" - print " dst=`echo $$src | $(TRANSFORM)`; \\" - print " rm -f $(BINDIR)/$$dst; \\" - print " done'" - } else { - print "install \\" - print "install.test \\" - print "uninstall \\" - print "uninstall.test:" - } - print "" - print "mostlyclean ::" - print " -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace" - 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 "" - print "distclean :: clean" - print " -rm -f Makefile ncurses_cfg.h config.status config.log" - print "" - print "realclean :: distclean" - 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 " mkdir -p $@" - - - if (ECHO_LINK != "") { - ECHO_LINK="@ echo linking $@ ... ;" - } - for (n = 0; n < count; ++n) { - print ""; - printf "$(destdir)%s$x:%s %s\n", progs[n], files[n], using[n]; - printf "\t%s$(LINK) -o $@%s %s\n", ECHO_LINK, files[n], flags[n]; - } - - } diff --git a/test/modules b/test/modules deleted file mode 100644 index 67c019e7716..00000000000 --- a/test/modules +++ /dev/null @@ -1,96 +0,0 @@ -# $Id: modules,v 1.43 2010/01/23 17:51:38 tom Exp $ -############################################################################## -# Copyright (c) 1998-2009,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"), # -# 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 1997-on -# -# Test-Program modules - -@ base -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) -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_panels progs $(srcdir) $(HEADER_DEPS) ../include/panel.h -demo_termcap progs $(srcdir) $(HEADER_DEPS) -demo_terminfo progs $(srcdir) $(HEADER_DEPS) -ditto progs $(srcdir) $(HEADER_DEPS) -dots progs $(srcdir) $(HEADER_DEPS) -dots_mvcur progs $(srcdir) $(HEADER_DEPS) -echochar progs $(srcdir) $(HEADER_DEPS) -edit_field progs $(srcdir) $(HEADER_DEPS) $(srcdir)/edit_field.h -filter progs $(srcdir) $(HEADER_DEPS) -firework progs $(srcdir) $(HEADER_DEPS) -firstlast progs $(srcdir) $(HEADER_DEPS) -foldkeys progs $(srcdir) $(HEADER_DEPS) -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) -ins_wide progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h -insdelln progs $(srcdir) $(HEADER_DEPS) -inserts progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h -key_names progs $(srcdir) $(HEADER_DEPS) -keynames progs $(srcdir) $(HEADER_DEPS) -knight progs $(srcdir) $(HEADER_DEPS) -lrtest progs $(srcdir) $(HEADER_DEPS) -movewindow progs $(srcdir) $(HEADER_DEPS) -ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h -newdemo progs $(srcdir) $(HEADER_DEPS) -railroad progs $(srcdir) $(HEADER_DEPS) -rain progs $(srcdir) $(HEADER_DEPS) -redraw progs $(srcdir) $(HEADER_DEPS) -savescreen 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 -test_addstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h -test_addwstr progs $(srcdir) $(HEADER_DEPS) $(srcdir)/linedata.h -test_arrays progs $(srcdir) $(HEADER_DEPS) -test_get_wstr progs $(srcdir) $(HEADER_DEPS) -test_getstr progs $(srcdir) $(HEADER_DEPS) -test_instr progs $(srcdir) $(HEADER_DEPS) -test_inwstr progs $(srcdir) $(HEADER_DEPS) -test_opaque progs $(srcdir) $(HEADER_DEPS) -testaddch progs $(srcdir) $(HEADER_DEPS) -testcurs progs $(srcdir) $(HEADER_DEPS) -testscanw progs $(srcdir) $(HEADER_DEPS) -view progs $(srcdir) $(HEADER_DEPS) -worm progs $(srcdir) $(HEADER_DEPS) -xmas progs $(srcdir) $(HEADER_DEPS) - -# vile:makemode diff --git a/test/movewindow.c b/test/movewindow.c deleted file mode 100644 index e55a694a084..00000000000 --- a/test/movewindow.c +++ /dev/null @@ -1,639 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2006-2008,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "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: movewindow.c,v 1.24 2010/11/13 23:34:55 tom Exp $ - * - * Demonstrate move functions for windows and derived windows from the curses - * library. - * - * Thomas Dickey - 2006/2/11 - */ -/* -derwin -mvderwin -subwin -mvwin - */ - -#include -#include - -#ifdef HAVE_XCURSES -#undef derwin -#endif - -#ifdef NCURSES_VERSION -#define CONST_FMT const -#else -#define CONST_FMT /* nothing */ -#endif - -#undef LINE_MAX - -#define LINE_MIN 2 -#define LINE_MAX (LINES - 2) -#define COL_MIN 2 -#define COL_MAX (COLS - 2) - -typedef struct { - int y, x; -} PAIR; - -typedef struct { - WINDOW *parent; /* need this since WINDOW->_parent is not portable */ - 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 unsigned num_windows; -static FRAME *all_windows; - -static void -message(int lineno, CONST_FMT char *fmt, va_list argp) -{ - int y, x; - - getyx(stdscr, y, x); - move(lineno, 0); - clrtoeol(); - -#ifdef HAVE_XCURSES - { - char buffer[1024]; - vsprintf(buffer, fmt, argp); - addstr(buffer); - } -#else - vwprintw(stdscr, fmt, argp); -#endif - - move(y, x); - refresh(); -} - -static void -head_line(CONST_FMT char *fmt,...) -{ - va_list argp; - - va_start(argp, fmt); - message(0, fmt, argp); - va_end(argp); -} - -static void -tail_line(CONST_FMT char *fmt,...) -{ - va_list argp; - - va_start(argp, fmt); - message(LINES - 1, fmt, argp); - va_end(argp); -} - -/* - * Arrow keys move cursor, return location at current on non-arrow key. - */ -static PAIR * -selectcell(WINDOW *parent, int uli, int ulj, int lri, int lrj) -{ - static PAIR res; /* result cell */ - int si = lri - uli + 1; /* depth of the select area */ - int sj = lrj - ulj + 1; /* width of the select area */ - int i = 0, j = 0; /* offsets into the select area */ - - res.y = uli; - res.x = ulj; - for (;;) { - tail_line("Upper left [%2d,%2d] Lower right [%2d,%2d] -> %d,%d", - uli, ulj, - lri, lrj, - uli + i, ulj + j); - wmove(parent, uli + i, ulj + j); - - switch (wgetch(parent)) { - case KEY_UP: - i += si - 1; - break; - case KEY_DOWN: - i++; - break; - case KEY_LEFT: - j += sj - 1; - break; - case KEY_RIGHT: - j++; - break; - case QUIT: - case ESCAPE: - return ((PAIR *) 0); -#ifdef NCURSES_MOUSE_VERSION - case KEY_MOUSE: - { - MEVENT event; - - getmouse(&event); - if (event.y > uli && event.x > ulj) { - i = event.y - uli; - j = event.x - ulj; - } else { - beep(); - break; - } - } - /* FALLTHRU */ -#endif - default: - res.y = uli + i; - res.x = ulj + j; - return (&res); - } - i %= si; - j %= sj; - } -} - -/* - * Ask user for a window definition. - */ -static bool -getwindow(WINDOW *parent, PAIR * ul, PAIR * lr) -{ - int min_col = (parent == stdscr) ? COL_MIN : 0; - int max_col = (parent == stdscr) ? COL_MAX : getmaxx(parent); - int min_line = (parent == stdscr) ? LINE_MIN : 0; - int max_line = (parent == stdscr) ? LINE_MAX : getmaxy(parent); - PAIR *tmp; - bool result = FALSE; - - head_line("Use arrows to move cursor, anything else to mark corner 1"); - if ((tmp = selectcell(parent, min_line, min_col, max_line, max_col)) != 0) { - *ul = *tmp; - MvWAddCh(parent, ul->y, ul->x, '*'); - - head_line("Use arrows to move cursor, anything else to mark corner 2"); - if ((tmp = selectcell(parent, ul->y, ul->x, max_line, max_col)) != 0) { - *lr = *tmp; - MvWAddCh(parent, lr->y, lr->x, '*'); - wmove(parent, lr->y, lr->x); - wsyncdown(parent); - wrefresh(parent); - result = (lr->y != ul->y && lr->x != ul->x); - } - } - head_line("done"); - return result; -} - -/* - * Draw a box inside the given window. - */ -static void -box_inside(WINDOW *win) -{ - int y0, x0; - int y1, x1; - - getyx(win, y0, x0); - getmaxyx(win, y1, x1); - - MvWHLine(win, 0, 0, ACS_HLINE, x1); - MvWHLine(win, y1 - 1, 0, ACS_HLINE, x1); - - MvWVLine(win, 0, 0, ACS_VLINE, y1); - MvWVLine(win, 0, x1 - 1, ACS_VLINE, y1); - - MvWAddCh(win, 0, 0, ACS_ULCORNER); - MvWAddCh(win, y1 - 1, 0, ACS_LLCORNER); - MvWAddCh(win, 0, x1 - 1, ACS_URCORNER); - MvWAddCh(win, y1 - 1, x1 - 1, ACS_LRCORNER); - - wsyncdown(win); - wmove(win, y0, x0); - wrefresh(win); -} - -/* - * Add a window to our list. - */ -static void -add_window(WINDOW *parent, WINDOW *child) -{ - static unsigned have = 0; - unsigned need = ((num_windows + 1) | 31) + 1; - - keypad(child, TRUE); - if (need > have) { - all_windows = typeRealloc(FRAME, need, all_windows); - } - all_windows[num_windows].parent = parent; - all_windows[num_windows].child = child; - num_windows++; -} - -static int -window2num(WINDOW *win) -{ - int n; - int result = -1; - for (n = 0; n < (int) num_windows; ++n) { - if (win == all_windows[n].child) { - result = n; - break; - } - } - return result; -} - -static WINDOW * -parent_of(WINDOW *win) -{ - WINDOW *result = 0; - int n = window2num(win); - if (n >= 0) - result = all_windows[n].parent; - return result; -} - -static void -repaint_one(WINDOW *win) -{ - touchwin(win); - wnoutrefresh(win); -} - -static void -refresh_all(WINDOW *win) -{ - unsigned n; - - for (n = 0; n < num_windows; ++n) { - if (all_windows[n].child != win) { - repaint_one(all_windows[n].child); - } - } - - repaint_one(win); - doupdate(); -} - -static WINDOW * -next_window(WINDOW *win) -{ - WINDOW *result = win; - int n = window2num(win); - - if (n++ >= 0) { - result = all_windows[(unsigned) n % num_windows].child; - wmove(result, 0, 0); - wrefresh(result); - } - return result; -} - -static WINDOW * -prev_window(WINDOW *win) -{ - WINDOW *result = win; - int n = window2num(win); - - if (n-- >= 0) { - if (n < 0) - n = (int) (num_windows - 1); - result = all_windows[(unsigned) n % num_windows].child; - wmove(result, 0, 0); - wrefresh(result); - } - return result; -} - -static void -recur_move_window(WINDOW *parent, int dy, int dx) -{ - unsigned n; - - for (n = 0; n < num_windows; ++n) { - if (all_windows[n].parent == parent) { - int y0, x0; - - getbegyx(all_windows[n].child, y0, x0); - mvwin(all_windows[n].child, y0 + dy, x0 + dx); - recur_move_window(all_windows[n].child, dy, dx); - } - } -} - -/* - * test mvwin(). - */ -static bool -move_window(WINDOW *win, bool recur) -{ - WINDOW *parent = parent_of(win); - bool result = FALSE; - - if (parent != 0) { - bool top = (parent == stdscr); - int min_col = top ? COL_MIN : 0; - int max_col = top ? COL_MAX : getmaxx(parent); - int min_line = top ? LINE_MIN : 0; - int max_line = top ? LINE_MAX : getmaxy(parent); - PAIR *tmp; - - head_line("Select new position for %swindow", top ? "" : "sub"); - - if ((tmp = selectcell(parent, - min_line, min_col, - max_line, max_col)) != 0) { - int y0, x0; - getbegyx(parent, y0, x0); - /* - * Note: Moving a subwindow has the effect of moving a viewport - * around the screen. The parent window retains the contents of - * the subwindow in the original location, but the viewport will - * show the contents (again) at the new location. So it will look - * odd when testing. - */ - if (mvwin(win, y0 + tmp->y, x0 + tmp->x) != ERR) { - if (recur) { - recur_move_window(win, tmp->y, tmp->x); - } - refresh_all(win); - doupdate(); - result = TRUE; - } - } - } - return result; -} - -/* - * test mvderwin(). - */ -static bool -move_subwin(WINDOW *win) -{ - WINDOW *parent = parent_of(win); - bool result = FALSE; - - if (parent != 0) { - bool top = (parent == stdscr); - if (!top) { - int min_col = top ? COL_MIN : 0; - int max_col = top ? COL_MAX : getmaxx(parent); - int min_line = top ? LINE_MIN : 0; - int max_line = top ? LINE_MAX : getmaxy(parent); - PAIR *tmp; - - head_line("Select new position for subwindow"); - - if ((tmp = selectcell(parent, - min_line, min_col, - max_line, max_col)) != 0) { - int y0, x0; - getbegyx(parent, y0, x0); - if (mvderwin(win, y0 + tmp->y, x0 + tmp->x) != ERR) { - refresh_all(win); - doupdate(); - result = TRUE; - } - } - } - } - return result; -} - -static void -fill_window(WINDOW *win, chtype ch) -{ - int y, x; - int y0, x0; - int y1, x1; - - getyx(win, y0, x0); - getmaxyx(win, y1, x1); - for (y = 0; y < y1; ++y) { - for (x = 0; x < x1; ++x) { - MvWAddCh(win, y, x, ch); - } - } - wsyncdown(win); - wmove(win, y0, x0); - wrefresh(win); -} - -#define lines_of(ul,lr) (lr.y - ul.y + 1) -#define cols_of(ul,lr) (lr.x - ul.x + 1) -#define pair_of(ul) ul.y, ul.x - -static WINDOW * -create_my_window(WINDOW *current) -{ - PAIR ul, lr; - WINDOW *result = 0; - - if (getwindow(stdscr, &ul, &lr)) { - result = newwin(lines_of(ul, lr), cols_of(ul, lr), pair_of(ul)); - if (result != 0) { - fill_window(result, 'c'); - add_window(stdscr, result); - } - } - if (result == 0) - result = current; - return result; -} - -static WINDOW * -create_my_derwin(WINDOW *parent) -{ - PAIR ul, lr; - WINDOW *result = 0; - - if (getwindow(parent, &ul, &lr)) { - result = derwin(parent, lines_of(ul, lr), cols_of(ul, lr), pair_of(ul)); - if (result != 0) { - fill_window(result, 'd'); - add_window(parent, result); - } - } - if (result == 0) - result = parent; - return result; -} - -static WINDOW * -create_my_subwin(WINDOW *parent) -{ - PAIR ul, lr; - WINDOW *result = 0; - - if (getwindow(parent, &ul, &lr)) { - result = subwin(parent, - lines_of(ul, lr), - cols_of(ul, lr), - ul.y + getbegy(parent), - ul.x + getbegx(parent)); - if (result != 0) { - fill_window(result, 's'); - add_window(parent, result); - } - } - if (result == 0) - result = parent; - return result; -} - -static void -show_help(WINDOW *current) -{ - /* *INDENT-OFF* */ - static struct { - int key; - CONST_FMT char * msg; - } help[] = { - { '?', "Show this screen" }, - { 'b', "Draw a box inside the current window" }, - { 'c', "Create a new window" }, - { 'd', "Create a new derived window" }, - { 'f', "Fill the current window with the next character" }, - { 'm', "Move the current window" }, - { 'M', "Move the current window (and its children)" }, - { 'q', "Quit" }, - { 's', "Create a new subwindow" }, - { 't', "Move the current subwindow (moves content)" }, - { CTRL('L'), "Repaint all windows, doing current one last" }, - { CTRL('N'), "Cursor to next window" }, - { CTRL('P'), "Cursor to previous window" }, - }; - /* *INDENT-ON* */ - - WINDOW *mywin = newwin(LINES, COLS, 0, 0); - int row; - - 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); - } - box_inside(mywin); - wmove(mywin, 1, 1); - wgetch(mywin); - delwin(mywin); - refresh_all(current); -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - WINDOW *current_win; - int ch; - bool done = FALSE; - - initscr(); - cbreak(); - noecho(); - nonl(); - intrflush(stdscr, FALSE); - - add_window(0, current_win = stdscr); - -#ifdef NCURSES_MOUSE_VERSION - (void) mousemask(BUTTON1_CLICKED, (mmask_t *) NULL); -#endif /* NCURSES_MOUSE_VERSION */ - - while (!done && (ch = wgetch(current_win)) != ERR) { - switch (ch) { - case '?': - show_help(current_win); - break; - case 'b': - box_inside(current_win); - break; - case 'c': - current_win = create_my_window(current_win); - break; - case 'd': - current_win = create_my_derwin(current_win); - break; - case 'f': - fill_window(current_win, (chtype) wgetch(current_win)); - break; - case 'm': - case 'M': - if (!move_window(current_win, (ch == 'M'))) { - tail_line("error"); - continue; - } - break; - case 'q': - done = TRUE; - break; - case 's': - current_win = create_my_subwin(current_win); - break; - case 't': - if (!move_subwin(current_win)) { - tail_line("error"); - continue; - } - break; - case CTRL('L'): - refresh_all(current_win); - break; - case CTRL('N'): - current_win = next_window(current_win); - break; - case CTRL('P'): - current_win = prev_window(current_win); - break; -#if 0 - /* want to allow cursor to move around the current window too */ - /* want to test the resizing of windows and subwindows too */ - /* want to allow deleting a window also */ -#endif - default: - tail_line("unrecognized key (use '?' for help)"); - beep(); - continue; - } - tail_line("size [%d,%d] begin [%d,%d] parent [%d,%d]", - getmaxy(current_win), - getmaxx(current_win), - getbegy(current_win), - getbegx(current_win), - getpary(current_win), - getparx(current_win)); - wmove(current_win, 0, 0); - } - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/ncurses.c b/test/ncurses.c deleted file mode 100644 index 5a422cf1a8c..00000000000 --- a/test/ncurses.c +++ /dev/null @@ -1,6847 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2010,2011 Free 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. * - ****************************************************************************/ -/**************************************************************************** - -NAME - ncurses.c --- ncurses library exerciser - -SYNOPSIS - ncurses - -DESCRIPTION - An interactive test module for the ncurses library. - -AUTHOR - Author: Eric S. Raymond 1993 - Thomas E. Dickey (beginning revision 1.27 in 1996). - -$Id: ncurses.c,v 1.365 2011/01/22 19:48:33 tom Exp $ - -***************************************************************************/ - -#include - -#ifdef __hpux -#undef mvwdelch /* HPUX 11.23 macro will not compile */ -#endif - -#if HAVE_GETTIMEOFDAY -#if HAVE_SYS_TIME_H && HAVE_SYS_TIME_SELECT -#include -#endif -#if HAVE_SYS_SELECT_H -#include -#endif -#endif - -#if USE_LIBPANEL -#include -#endif - -#if USE_LIBMENU -#include -#endif - -#if USE_LIBFORM -#include -#endif - -#ifdef NCURSES_VERSION - -#define NCURSES_CONST_PARAM const void - -#ifdef TRACE -static unsigned save_trace = TRACE_ORDINARY | TRACE_ICALLS | TRACE_CALLS; -extern unsigned _nc_tracing; -#endif - -#else - -#define NCURSES_CONST_PARAM char - -#define mmask_t chtype /* not specified in XSI */ - -#ifndef ACS_S3 -#ifdef CURSES_ACS_ARRAY -#define ACS_S3 (CURSES_ACS_ARRAY['p']) /* scan line 3 */ -#define ACS_S7 (CURSES_ACS_ARRAY['r']) /* scan line 7 */ -#define ACS_LEQUAL (CURSES_ACS_ARRAY['y']) /* less/equal */ -#define ACS_GEQUAL (CURSES_ACS_ARRAY['z']) /* greater/equal */ -#define ACS_PI (CURSES_ACS_ARRAY['{']) /* Pi */ -#define ACS_NEQUAL (CURSES_ACS_ARRAY['|']) /* not equal */ -#define ACS_STERLING (CURSES_ACS_ARRAY['}']) /* UK pound sign */ -#else -#define ACS_S3 (A_ALTCHARSET + 'p') /* scan line 3 */ -#define ACS_S7 (A_ALTCHARSET + 'r') /* scan line 7 */ -#define ACS_LEQUAL (A_ALTCHARSET + 'y') /* less/equal */ -#define ACS_GEQUAL (A_ALTCHARSET + 'z') /* greater/equal */ -#define ACS_PI (A_ALTCHARSET + '{') /* Pi */ -#define ACS_NEQUAL (A_ALTCHARSET + '|') /* not equal */ -#define ACS_STERLING (A_ALTCHARSET + '}') /* UK pound sign */ -#endif -#endif /* ACS_S3 */ - -#ifndef WACS_S3 -#ifdef CURSES_WACS_ARRAY -#define WACS_S3 (&(CURSES_WACS_ARRAY['p'])) /* scan line 3 */ -#define WACS_S7 (&(CURSES_WACS_ARRAY['r'])) /* scan line 7 */ -#define WACS_LEQUAL (&(CURSES_WACS_ARRAY['y'])) /* less/equal */ -#define WACS_GEQUAL (&(CURSES_WACS_ARRAY['z'])) /* greater/equal */ -#define WACS_PI (&(CURSES_WACS_ARRAY['{'])) /* Pi */ -#define WACS_NEQUAL (&(CURSES_WACS_ARRAY['|'])) /* not equal */ -#define WACS_STERLING (&(CURSES_WACS_ARRAY['}'])) /* UK pound sign */ -#endif -#endif - -#endif - -#if HAVE_WCSRTOMBS -#define count_wchars(src, len, state) wcsrtombs(0, &src, len, state) -#define trans_wchars(dst, src, len, state) wcsrtombs(dst, &src, len, state) -#define reset_wchars(state) init_mb(state) -#elif HAVE_WCSTOMBS && HAVE_MBTOWC && HAVE_MBLEN -#define count_wchars(src, len, state) wcstombs(0, src, len) -#define trans_wchars(dst, src, len, state) wcstombs(dst, src, len) -#define reset_wchars(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) -#define state_unused -#endif - -#if HAVE_MBSRTOWCS -#define count_mbytes(src, len, state) mbsrtowcs(0, &src, len, state) -#define trans_mbytes(dst, src, len, state) mbsrtowcs(dst, &src, len, state) -#define reset_mbytes(state) init_mb(state) -#elif HAVE_MBSTOWCS && HAVE_MBTOWC && HAVE_MBLEN -#define count_mbytes(src, len, state) mbstowcs(0, src, len) -#define trans_mbytes(dst, src, len, state) mbstowcs(dst, src, len) -#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) -#define state_unused -#endif - -#define ToggleAcs(temp,real) temp = ((temp == real) ? 0 : 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 */ - -#undef max_pairs -static int max_pairs; /* ...and the number of color pairs */ - -typedef struct { - short red; - short green; - short blue; -} RGB_DATA; - -static RGB_DATA *all_colors; - -static void main_menu(bool); - -/* 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); - touchwin(curscr); - wrefresh(curscr); -} - -static bool -isQuit(int c) -{ - return ((c) == QUIT || (c) == ESCAPE); -} -#define case_QUIT QUIT: case ESCAPE - -/* Common function to allow ^T to toggle trace-mode in the middle of a test - * so that trace-files can be made smaller. - */ -static int -wGetchar(WINDOW *win) -{ - int c; -#ifdef TRACE - while ((c = wgetch(win)) == CTRL('T')) { - if (_nc_tracing) { - save_trace = _nc_tracing; - Trace(("TOGGLE-TRACING OFF")); - _nc_tracing = 0; - } else { - _nc_tracing = save_trace; - } - trace(_nc_tracing); - if (_nc_tracing) - Trace(("TOGGLE-TRACING ON")); - } -#else - c = wgetch(win); -#endif - return c; -} -#define Getchar() wGetchar(stdscr) - -/* 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; - bool done = FALSE; - - echo(); - getyx(win, y0, x0); - (void) wattrset(win, A_REVERSE); - - x = (int) strlen(buffer); - while (!done) { - if (x > (int) strlen(buffer)) - x = (int) strlen(buffer); - wmove(win, y0, x0); - wprintw(win, "%-*s", limit, buffer); - wmove(win, y0, x0 + x); - switch (ch = wGetchar(win)) { - case '\n': - case KEY_ENTER: - done = TRUE; - break; - case CTRL('U'): - *buffer = '\0'; - break; - case '\b': - case KEY_BACKSPACE: - case KEY_DC: - if (x > 0) { - int j; - for (j = --x; (buffer[j] = buffer[j + 1]) != '\0'; ++j) { - ; - } - } else { - beep(); - } - break; - case KEY_LEFT: - if (x > 0) { - --x; - } else { - flash(); - } - break; - case KEY_RIGHT: - ++x; - break; - default: - if (!isprint(ch) || ch >= KEY_MIN) { - beep(); - } else if ((int) strlen(buffer) < limit) { - int j; - for (j = (int) strlen(buffer) + 1; j > x; --j) { - buffer[j] = buffer[j - 1]; - } - buffer[x++] = (char) ch; - } else { - flash(); - } - } - } - - wattroff(win, A_REVERSE); - wmove(win, y0, x0); - noecho(); -} - -#if USE_WIDEC_SUPPORT -static wchar_t -fullwidth_of(int ch) -{ - return (ch + 0xff10 - '0'); -} - -static void -make_fullwidth_text(wchar_t *target, const char *source) -{ - int ch; - while ((ch = *source++) != 0) { - *target++ = fullwidth_of(ch); - } - *target = 0; -} - -static void -make_narrow_text(wchar_t *target, const char *source) -{ - int ch; - while ((ch = *source++) != 0) { - *target++ = ch; - } - *target = 0; -} - -#if USE_LIBPANEL -static void -make_fullwidth_digit(cchar_t *target, int digit) -{ - wchar_t source[2]; - - source[0] = fullwidth_of(digit + '0'); - source[1] = 0; - setcchar(target, source, A_NORMAL, 0, 0); -} -#endif - -static int -wGet_wchar(WINDOW *win, wint_t *result) -{ - int c; -#ifdef TRACE - while ((c = wget_wch(win, result)) == CTRL('T')) { - if (_nc_tracing) { - save_trace = _nc_tracing; - Trace(("TOGGLE-TRACING OFF")); - _nc_tracing = 0; - } else { - _nc_tracing = save_trace; - } - trace(_nc_tracing); - if (_nc_tracing) - Trace(("TOGGLE-TRACING ON")); - } -#else - c = wget_wch(win, result); -#endif - return c; -} -#define Get_wchar(result) wGet_wchar(stdscr, result) - -/* replaces wgetn_wstr(), since we want to be able to edit values */ -static void -wGet_wstring(WINDOW *win, wchar_t *buffer, int limit) -{ - int y0, x0, x; - wint_t ch; - bool done = FALSE; - bool fkey = FALSE; - - echo(); - getyx(win, y0, x0); - (void) wattrset(win, A_REVERSE); - - x = (int) wcslen(buffer); - while (!done) { - if (x > (int) wcslen(buffer)) - x = (int) wcslen(buffer); - - /* clear the "window' */ - wmove(win, y0, x0); - wprintw(win, "%*s", limit, " "); - - /* write the existing buffer contents */ - wmove(win, y0, x0); - waddnwstr(win, buffer, limit); - - /* positions the cursor past character 'x' */ - wmove(win, y0, x0); - waddnwstr(win, buffer, x); - - switch (wGet_wchar(win, &ch)) { - case KEY_CODE_YES: - fkey = TRUE; - switch (ch) { - case KEY_ENTER: - ch = '\n'; - fkey = FALSE; - break; - case KEY_BACKSPACE: - case KEY_DC: - ch = '\b'; - fkey = FALSE; - break; - case KEY_LEFT: - case KEY_RIGHT: - break; - default: - ch = (wint_t) -1; - break; - } - break; - case OK: - fkey = FALSE; - break; - default: - ch = (wint_t) -1; - fkey = TRUE; - break; - } - - switch (ch) { - case '\n': - done = TRUE; - break; - case CTRL('U'): - *buffer = '\0'; - break; - case '\b': - if (x > 0) { - int j; - for (j = --x; (buffer[j] = buffer[j + 1]) != '\0'; ++j) { - ; - } - } else { - beep(); - } - break; - case KEY_LEFT: - if (x > 0) { - --x; - } else { - beep(); - } - break; - case KEY_RIGHT: - ++x; - break; - default: - if (fkey) { - beep(); - } else if ((int) wcslen(buffer) < limit) { - int j; - for (j = (int) wcslen(buffer) + 1; j > x; --j) { - buffer[j] = buffer[j - 1]; - } - buffer[x++] = (wchar_t) ch; - } else { - beep(); - } - } - } - - wattroff(win, A_REVERSE); - wmove(win, y0, x0); - noecho(); -} - -#endif - -static void -Pause(void) -{ - move(LINES - 1, 0); - addstr("Press any key to continue... "); - (void) Getchar(); -} - -static void -Cannot(const char *what) -{ - printw("\nThis %s terminal %s\n\n", getenv("TERM"), what); - Pause(); -} - -static void -ShellOut(bool message) -{ - if (message) - addstr("Shelling out..."); - def_prog_mode(); - endwin(); -#ifdef __MINGW32__ - system("cmd.exe"); -#else - system("sh"); -#endif - if (message) - addstr("returned from shellout.\n"); - refresh(); -} - -#ifdef NCURSES_MOUSE_VERSION -/* - * This function is the same as _tracemouse(), but we cannot count on that - * being available in the non-debug library. - */ -static const char * -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); - -#define SHOW(m, s) if ((ep->bstate & m)==m) {strcat(buf,s); strcat(buf, ", ");} - - SHOW(BUTTON1_RELEASED, "release-1"); - SHOW(BUTTON1_PRESSED, "press-1"); - SHOW(BUTTON1_CLICKED, "click-1"); - SHOW(BUTTON1_DOUBLE_CLICKED, "doubleclick-1"); - SHOW(BUTTON1_TRIPLE_CLICKED, "tripleclick-1"); -#if NCURSES_MOUSE_VERSION == 1 - SHOW(BUTTON1_RESERVED_EVENT, "reserved-1"); -#endif - - SHOW(BUTTON2_RELEASED, "release-2"); - SHOW(BUTTON2_PRESSED, "press-2"); - SHOW(BUTTON2_CLICKED, "click-2"); - SHOW(BUTTON2_DOUBLE_CLICKED, "doubleclick-2"); - SHOW(BUTTON2_TRIPLE_CLICKED, "tripleclick-2"); -#if NCURSES_MOUSE_VERSION == 1 - SHOW(BUTTON2_RESERVED_EVENT, "reserved-2"); -#endif - - SHOW(BUTTON3_RELEASED, "release-3"); - SHOW(BUTTON3_PRESSED, "press-3"); - SHOW(BUTTON3_CLICKED, "click-3"); - SHOW(BUTTON3_DOUBLE_CLICKED, "doubleclick-3"); - SHOW(BUTTON3_TRIPLE_CLICKED, "tripleclick-3"); -#if NCURSES_MOUSE_VERSION == 1 - SHOW(BUTTON3_RESERVED_EVENT, "reserved-3"); -#endif - - SHOW(BUTTON4_RELEASED, "release-4"); - SHOW(BUTTON4_PRESSED, "press-4"); - SHOW(BUTTON4_CLICKED, "click-4"); - SHOW(BUTTON4_DOUBLE_CLICKED, "doubleclick-4"); - SHOW(BUTTON4_TRIPLE_CLICKED, "tripleclick-4"); -#if NCURSES_MOUSE_VERSION == 1 - SHOW(BUTTON4_RESERVED_EVENT, "reserved-4"); -#endif - -#if NCURSES_MOUSE_VERSION == 2 - SHOW(BUTTON5_RELEASED, "release-5"); - SHOW(BUTTON5_PRESSED, "press-5"); - SHOW(BUTTON5_CLICKED, "click-5"); - SHOW(BUTTON5_DOUBLE_CLICKED, "doubleclick-5"); - SHOW(BUTTON5_TRIPLE_CLICKED, "tripleclick-5"); -#endif - - SHOW(BUTTON_CTRL, "ctrl"); - SHOW(BUTTON_SHIFT, "shift"); - SHOW(BUTTON_ALT, "alt"); - SHOW(ALL_MOUSE_EVENTS, "all-events"); - SHOW(REPORT_MOUSE_POSITION, "position"); - -#undef SHOW - - if (buf[strlen(buf) - 1] == ' ') - buf[strlen(buf) - 2] = '\0'; - (void) strcat(buf, "}"); - return (buf); -} - -static void -show_mouse(WINDOW *win) -{ - int y, x; - MEVENT event; - bool outside; - bool show_loc; - - getmouse(&event); - outside = !wenclose(win, event.y, event.x); - - if (outside) { - (void) wstandout(win); - waddstr(win, "KEY_MOUSE"); - (void) wstandend(win); - } else { - waddstr(win, "KEY_MOUSE"); - } - wprintw(win, ", %s", mouse_decode(&event)); - - if (outside) - win = stdscr; - - show_loc = wmouse_trafo(win, &event.y, &event.x, FALSE); - - if (show_loc) { - getyx(win, y, x); - wmove(win, event.y, event.x); - waddch(win, '*'); - wmove(win, y, x); - } - - if (outside) - wnoutrefresh(win); -} -#endif /* NCURSES_MOUSE_VERSION */ - -/**************************************************************************** - * - * Character input test - * - ****************************************************************************/ - -#define NUM_GETCH_FLAGS 256 -typedef bool GetchFlags[NUM_GETCH_FLAGS]; - -static void -setup_getch(WINDOW *win, GetchFlags flags) -{ - keypad(win, flags['k']); /* should be redundant, but for testing */ - meta(win, flags['m']); /* force this to a known state */ - if (flags['e']) - echo(); - else - noecho(); -} - -static void -init_getch(WINDOW *win, GetchFlags flags) -{ - memset(flags, FALSE, NUM_GETCH_FLAGS); - flags[UChar('k')] = (win == stdscr); - flags[UChar('m')] = TRUE; - - setup_getch(win, flags); -} - -static void -wgetch_help(WINDOW *win, GetchFlags flags) -{ - static const char *help[] = - { - "e -- toggle echo mode" - ,"g -- triggers a getstr test" - ,"k -- toggle keypad/literal mode" - ,"m -- toggle meta (7-bit/8-bit) mode" - ,"^q -- quit" - ,"s -- shell out\n" - ,"w -- create a new window" -#ifdef SIGTSTP - ,"z -- suspend this process" -#endif - }; - int y, x; - unsigned chk = ((SIZEOF(help) + 1) / 2); - unsigned n; - - getyx(win, y, x); - move(0, 0); - printw("Type any key to see its %s value. Also:\n", - flags['k'] ? "keypad" : "literal"); - for (n = 0; n < SIZEOF(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)); - if (flg) - (void) standout(); - MvPrintw(row, col, "%s", help[n]); - if (col == 0) - clrtoeol(); - if (flg) - (void) standend(); - } - wrefresh(stdscr); - wmove(win, y, x); -} - -static void -wgetch_wrap(WINDOW *win, int first_y) -{ - int last_y = getmaxy(win) - 1; - int y = getcury(win) + 1; - - if (y >= last_y) - y = first_y; - wmove(win, y, 0); - wclrtoeol(win); -} - -#if defined(KEY_RESIZE) && HAVE_WRESIZE -typedef struct { - WINDOW *text; - WINDOW *frame; -} WINSTACK; - -static WINSTACK *winstack = 0; -static unsigned len_winstack = 0; - -static void -forget_boxes(void) -{ - if (winstack != 0) { - free(winstack); - } - winstack = 0; - len_winstack = 0; -} - -static void -remember_boxes(unsigned level, WINDOW *txt_win, WINDOW *box_win) -{ - unsigned need = (level + 1) * 2; - - assert(level < (unsigned) COLS); - - if (winstack == 0) { - len_winstack = 20; - winstack = typeMalloc(WINSTACK, len_winstack); - } else if (need >= len_winstack) { - len_winstack = need; - winstack = typeRealloc(WINSTACK, len_winstack, winstack); - } - winstack[level].text = txt_win; - winstack[level].frame = box_win; -} - -#if USE_SOFTKEYS && (defined(NCURSES_VERSION_PATCH) && NCURSES_VERSION_PATCH < 20071229) && NCURSES_EXT_FUNCS -static void -slk_repaint(void) -{ - /* this chunk is now done in resize_term() */ - slk_touch(); - slk_clear(); - slk_noutrefresh(); -} - -#else -#define slk_repaint() /* nothing */ -#endif - -#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE -/* - * For wgetch_test(), we create pairs of windows - one for a box, one for text. - * Resize both and paint the box in the parent. - */ -static void -resize_boxes(unsigned level, WINDOW *win) -{ - unsigned n; - int base = 5; - int high = LINES - base; - int wide = COLS; - - touchwin(stdscr); - wnoutrefresh(stdscr); - - slk_repaint(); - - for (n = 0; n < level; ++n) { - wresize(winstack[n].frame, high, wide); - wresize(winstack[n].text, high - 2, wide - 2); - high -= 2; - wide -= 2; - werase(winstack[n].text); - box(winstack[n].frame, 0, 0); - wnoutrefresh(winstack[n].frame); - wprintw(winstack[n].text, - "size %dx%d\n", - getmaxy(winstack[n].text), - getmaxx(winstack[n].text)); - wnoutrefresh(winstack[n].text); - if (winstack[n].text == win) - break; - } - doupdate(); -} -#endif /* resize_boxes */ -#else -#define forget_boxes() /* nothing */ -#define remember_boxes(level,text,frame) /* nothing */ -#endif - -static void -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); - wtimeout(win, delay); - getyx(win, first_y, first_x); - - wgetch_help(win, flags); - wsetscrreg(win, first_y, getmaxy(win) - 1); - scrollok(win, TRUE); - - for (;;) { - while ((c = wGetchar(win)) == ERR) { - incount++; - if (blocking) { - (void) wprintw(win, "%05d: input error", incount); - break; - } else { - (void) wprintw(win, "%05d: input timed out", incount); - } - wgetch_wrap(win, first_y); - } - if (c == ERR && blocking) { - wprintw(win, "ERR"); - wgetch_wrap(win, first_y); - } else if (isQuit(c)) { - break; - } else if (c == 'e') { - flags[UChar('e')] = !flags[UChar('e')]; - setup_getch(win, flags); - wgetch_help(win, flags); - } else if (c == 'g') { - waddstr(win, "getstr test: "); - echo(); - wgetnstr(win, buf, sizeof(buf) - 1); - noecho(); - wprintw(win, "I saw %d characters:\n\t`%s'.", (int) strlen(buf), buf); - wclrtoeol(win); - wgetch_wrap(win, first_y); - } else if (c == 'k') { - flags[UChar('k')] = !flags[UChar('k')]; - setup_getch(win, flags); - wgetch_help(win, flags); - } else if (c == 'm') { - flags[UChar('m')] = !flags[UChar('m')]; - setup_getch(win, flags); - wgetch_help(win, flags); - } else if (c == 's') { - ShellOut(TRUE); - } else if (c == 'w') { - int high = getmaxy(win) - 1 - first_y + 1; - int wide = getmaxx(win) - first_x; - int old_y, old_x; - int new_y = first_y + getbegy(win); - int new_x = first_x + getbegx(win); - - getyx(win, old_y, old_x); - if (high > 2 && wide > 2) { - WINDOW *wb = newwin(high, wide, new_y, new_x); - WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); - - box(wb, 0, 0); - wrefresh(wb); - wmove(wi, 0, 0); - remember_boxes(level, wi, wb); - wgetch_test(level + 1, wi, delay); - delwin(wi); - delwin(wb); - - wgetch_help(win, flags); - wmove(win, old_y, old_x); - touchwin(win); - wrefresh(win); - doupdate(); - } -#ifdef SIGTSTP - } else if (c == 'z') { - kill(getpid(), SIGTSTP); -#endif - } else { - wprintw(win, "Key pressed: %04o ", c); -#ifdef NCURSES_MOUSE_VERSION - if (c == KEY_MOUSE) { - show_mouse(win); - } else -#endif /* NCURSES_MOUSE_VERSION */ - if (c >= KEY_MIN) { -#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE - if (c == KEY_RESIZE) { - resize_boxes(level, win); - } -#endif - (void) waddstr(win, keyname(c)); - } else if (c >= 0x80) { - unsigned c2 = (unsigned) c; -#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES)) - /* at least Solaris SVR4 curses breaks unctrl(128), etc. */ - c2 &= 0x7f; -#endif - if (isprint(c)) - (void) wprintw(win, "%c", UChar(c)); - else if (c2 != UChar(c)) - (void) wprintw(win, "M-%s", unctrl(c2)); - else - (void) wprintw(win, "%s", unctrl(c2)); - waddstr(win, " (high-half character)"); - } else { - if (isprint(c)) - (void) wprintw(win, "%c (ASCII printable character)", c); - else - (void) wprintw(win, "%s (ASCII control character)", - unctrl(UChar(c))); - } - wgetch_wrap(win, first_y); - } - } - - wtimeout(win, -1); - - if (!level) - init_getch(win, flags); -} - -static int -begin_getch_test(void) -{ - char buf[BUFSIZ]; - int delay; - - refresh(); - -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif - - (void) printw("Delay in 10ths of a second ( for blocking input)? "); - echo(); - getnstr(buf, sizeof(buf) - 1); - noecho(); - nonl(); - - if (isdigit(UChar(buf[0]))) { - delay = atoi(buf) * 100; - } else { - delay = -1; - } - raw(); - move(5, 0); - return delay; -} - -static void -finish_getch_test(void) -{ -#ifdef NCURSES_MOUSE_VERSION - mousemask(0, (mmask_t *) 0); -#endif - erase(); - noraw(); - nl(); - endwin(); -} - -static void -getch_test(void) -{ - int delay = begin_getch_test(); - - slk_restore(); - wgetch_test(0, stdscr, delay); - forget_boxes(); - finish_getch_test(); - slk_clear(); -} - -#if USE_WIDEC_SUPPORT -/* - * For wget_wch_test(), we create pairs of windows - one for a box, one for text. - * Resize both and paint the box in the parent. - */ -#if defined(KEY_RESIZE) && HAVE_WRESIZE -static void -resize_wide_boxes(unsigned level, WINDOW *win) -{ - unsigned n; - int base = 5; - int high = LINES - base; - int wide = COLS; - - touchwin(stdscr); - wnoutrefresh(stdscr); - - slk_repaint(); - - for (n = 0; n < level; ++n) { - wresize(winstack[n].frame, high, wide); - wresize(winstack[n].text, high - 2, wide - 2); - high -= 2; - wide -= 2; - werase(winstack[n].text); - box_set(winstack[n].frame, 0, 0); - wnoutrefresh(winstack[n].frame); - wprintw(winstack[n].text, - "size %dx%d\n", - getmaxy(winstack[n].text), - getmaxx(winstack[n].text)); - wnoutrefresh(winstack[n].text); - if (winstack[n].text == win) - break; - } - doupdate(); -} -#endif /* KEY_RESIZE */ - -static char * -wcstos(const wchar_t *src) -{ - int need; - char *result = 0; - const wchar_t *tmp = src; -#ifndef state_unused - mbstate_t state; -#endif - - reset_wchars(state); - if ((need = (int) count_wchars(tmp, 0, &state)) > 0) { - unsigned have = (unsigned) need; - if ((result = typeCalloc(char, have + 1)) != 0) { - tmp = src; - if (trans_wchars(result, tmp, have, &state) != have) { - free(result); - result = 0; - } - } - } - return result; -} - -static void -wget_wch_test(unsigned level, WINDOW *win, int delay) -{ - wchar_t wchar_buf[BUFSIZ]; - wint_t wint_buf[BUFSIZ]; - int first_y, first_x; - wint_t c; - int incount = 0; - GetchFlags flags; - bool blocking = (delay < 0); - int code; - char *temp; - - init_getch(win, flags); - wtimeout(win, delay); - getyx(win, first_y, first_x); - - wgetch_help(win, flags); - wsetscrreg(win, first_y, getmaxy(win) - 1); - scrollok(win, TRUE); - - for (;;) { - while ((code = wGet_wchar(win, &c)) == ERR) { - incount++; - if (blocking) { - (void) wprintw(win, "%05d: input error", incount); - break; - } else { - (void) wprintw(win, "%05d: input timed out", incount); - } - wgetch_wrap(win, first_y); - } - if (code == ERR && blocking) { - wprintw(win, "ERR"); - wgetch_wrap(win, first_y); - } else if (isQuit((int) c)) { - break; - } else if (c == 'e') { - flags[UChar('e')] = !flags[UChar('e')]; - setup_getch(win, flags); - wgetch_help(win, flags); - } else if (c == 'g') { - waddstr(win, "getstr test: "); - echo(); - code = wgetn_wstr(win, wint_buf, sizeof(wint_buf) - 1); - noecho(); - if (code == ERR) { - wprintw(win, "wgetn_wstr returns an error."); - } else { - int n; - for (n = 0; (wchar_buf[n] = (wchar_t) wint_buf[n]) != 0; ++n) { - ; - } - if ((temp = wcstos(wchar_buf)) != 0) { - wprintw(win, "I saw %d characters:\n\t`%s'.", - (int) wcslen(wchar_buf), temp); - free(temp); - } else { - wprintw(win, "I saw %d characters (cannot convert).", - (int) wcslen(wchar_buf)); - } - } - wclrtoeol(win); - wgetch_wrap(win, first_y); - } else if (c == 'k') { - flags[UChar('k')] = !flags[UChar('k')]; - setup_getch(win, flags); - wgetch_help(win, flags); - } else if (c == 'm') { - flags[UChar('m')] = !flags[UChar('m')]; - setup_getch(win, flags); - wgetch_help(win, flags); - } else if (c == 's') { - ShellOut(TRUE); - } else if (c == 'w') { - int high = getmaxy(win) - 1 - first_y + 1; - int wide = getmaxx(win) - first_x; - int old_y, old_x; - int new_y = first_y + getbegy(win); - int new_x = first_x + getbegx(win); - - getyx(win, old_y, old_x); - if (high > 2 && wide > 2) { - WINDOW *wb = newwin(high, wide, new_y, new_x); - WINDOW *wi = newwin(high - 2, wide - 2, new_y + 1, new_x + 1); - - box_set(wb, 0, 0); - wrefresh(wb); - wmove(wi, 0, 0); - remember_boxes(level, wi, wb); - wget_wch_test(level + 1, wi, delay); - delwin(wi); - delwin(wb); - - wgetch_help(win, flags); - wmove(win, old_y, old_x); - touchwin(win); - wrefresh(win); - } -#ifdef SIGTSTP - } else if (c == 'z') { - kill(getpid(), SIGTSTP); -#endif - } else { - wprintw(win, "Key pressed: %04o ", (int) c); -#ifdef NCURSES_MOUSE_VERSION - if (c == KEY_MOUSE) { - show_mouse(win); - } else -#endif /* NCURSES_MOUSE_VERSION */ - if (code == KEY_CODE_YES) { -#if defined(KEY_RESIZE) && HAVE_WRESIZE - if (c == KEY_RESIZE) { - resize_wide_boxes(level, win); - } -#endif - (void) waddstr(win, keyname((wchar_t) c)); - } else { - (void) waddstr(win, key_name((wchar_t) c)); - if (c < 256 && iscntrl(c)) { - (void) wprintw(win, " (control character)"); - } else { - (void) wprintw(win, " = %#x (printable character)", - (unsigned) c); - } - } - wgetch_wrap(win, first_y); - } - } - - wtimeout(win, -1); - - if (!level) - init_getch(win, flags); -} - -static void -get_wch_test(void) -{ - int delay = begin_getch_test(); - - slk_restore(); - wget_wch_test(0, stdscr, delay); - forget_boxes(); - finish_getch_test(); - slk_clear(); -} -#endif - -/**************************************************************************** - * - * Character attributes test - * - ****************************************************************************/ - -#if HAVE_SETUPTERM || HAVE_TGETENT -#define get_ncv() TIGETNUM("ncv","NC") -#define get_xmc() TIGETNUM("xmc","sg") -#else -#define get_ncv() -1 -#define get_xmc() -1 -#endif - -#if !HAVE_TERMATTRS -static chtype -my_termattrs(void) -{ - static int first = TRUE; - static chtype result = 0; - - if (first) { -#if !HAVE_TIGETSTR - char buffer[4096]; - char parsed[4096]; - char *area_pointer = parsed; - - tgetent(buffer, getenv("TERM")); -#endif - - if (TIGETSTR("smso", "so")) - result |= A_STANDOUT; - if (TIGETSTR("smul", "us")) - result |= A_UNDERLINE; - if (TIGETSTR("rev", "mr")) - result |= A_REVERSE; - if (TIGETSTR("blink", "mb")) - result |= A_BLINK; - if (TIGETSTR("dim", "mh")) - result |= A_DIM; - if (TIGETSTR("bold", "md")) - result |= A_BOLD; - if (TIGETSTR("smacs", "ac")) - result |= A_ALTCHARSET; - - first = FALSE; - } - return result; -} -#define termattrs() my_termattrs() -#endif - -#define MAX_ATTRSTRING 31 -#define LEN_ATTRSTRING 26 - -static char attr_test_string[MAX_ATTRSTRING + 1]; - -static void -attr_legend(WINDOW *helpwin) -{ - int row = 1; - int col = 1; - - MvWPrintw(helpwin, row++, col, - "ESC to exit."); - MvWPrintw(helpwin, row++, col, - "^L repaints."); - ++row; - MvWPrintw(helpwin, row++, col, - "Modify the test strings:"); - MvWPrintw(helpwin, row++, col, - " A digit sets gaps on each side of displayed attributes"); - MvWPrintw(helpwin, row++, col, - " shifts the text left/right. "); - ++row; - MvWPrintw(helpwin, row++, col, - "Toggles:"); - if (use_colors) { - MvWPrintw(helpwin, row++, col, - " f/F/b/F toggle foreground/background background color"); - MvWPrintw(helpwin, row++, col, - " t/T toggle text/background color attribute"); - } - MvWPrintw(helpwin, row++, col, - " a/A toggle ACS (alternate character set) mapping"); - MvWPrintw(helpwin, row, col, - " v/V toggle video attribute to combine with each line"); -} - -static void -show_color_attr(int fg, int bg, int tx) -{ - if (use_colors) { - printw(" Colors (fg %d, bg %d", fg, bg); - if (tx >= 0) - printw(", text %d", tx); - printw("),"); - } -} - -static bool -cycle_color_attr(int ch, short *fg, short *bg, short *tx) -{ - bool error = FALSE; - - if (use_colors) { - switch (ch) { - case 'f': - *fg = (short) (*fg + 1); - break; - case 'F': - *fg = (short) (*fg - 1); - break; - case 'b': - *bg = (short) (*bg + 1); - break; - case 'B': - *bg = (short) (*bg - 1); - break; - case 't': - *tx = (short) (*tx + 1); - break; - case 'T': - *tx = (short) (*tx - 1); - break; - default: - beep(); - error = TRUE; - break; - } - if (*fg >= COLORS) - *fg = (short) min_colors; - if (*fg < min_colors) - *fg = (short) (COLORS - 1); - if (*bg >= COLORS) - *bg = (short) min_colors; - if (*bg < min_colors) - *bg = (short) (COLORS - 1); - if (*tx >= COLORS) - *tx = -1; - if (*tx < -1) - *tx = (short) (COLORS - 1); - } else { - beep(); - error = TRUE; - } - return error; -} - -static void -adjust_attr_string(int adjust) -{ - int first = ((int) UChar(attr_test_string[0])) + adjust; - int last = first + LEN_ATTRSTRING; - - if (first >= ' ' && last <= '~') { /* 32..126 */ - int j, k; - for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) { - attr_test_string[j] = (char) k; - if (((k + 1 - first) % 5) == 0) { - if (++j >= MAX_ATTRSTRING) - break; - attr_test_string[j] = ' '; - } - } - while (j < MAX_ATTRSTRING) - attr_test_string[j++] = ' '; - attr_test_string[j] = '\0'; - } else { - beep(); - } -} - -static void -init_attr_string(void) -{ - attr_test_string[0] = 'a'; - adjust_attr_string(0); -} - -static int -show_attr(int row, int skip, bool arrow, chtype attr, const char *name) -{ - int ncv = get_ncv(); - chtype test = attr & (chtype) (~A_ALTCHARSET); - - if (arrow) - MvPrintw(row, 5, "-->"); - MvPrintw(row, 8, "%s mode:", name); - MvPrintw(row, 24, "|"); - if (skip) - printw("%*s", skip, " "); - /* - * Just for testing, write text using the alternate character set one - * character at a time (to pass its rendition directly), and use the - * string operation for the other attributes. - */ - if (attr & A_ALTCHARSET) { - const char *s; - chtype ch; - - for (s = attr_test_string; *s != '\0'; ++s) { - ch = UChar(*s); - addch(ch | attr); - } - } else { - (void) attrset(attr); - addstr(attr_test_string); - attroff(attr); - } - if (skip) - printw("%*s", skip, " "); - printw("|"); - if (test != A_NORMAL) { - if (!(termattrs() & test)) { - printw(" (N/A)"); - } else { - if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) { - static const chtype table[] = - { - A_STANDOUT, - A_UNDERLINE, - A_REVERSE, - A_BLINK, - A_DIM, - A_BOLD, -#ifdef A_INVIS - A_INVIS, -#endif - A_PROTECT, - A_ALTCHARSET - }; - unsigned n; - bool found = FALSE; - for (n = 0; n < SIZEOF(table); n++) { - if ((table[n] & attr) != 0 - && ((1 << n) & ncv) != 0) { - found = TRUE; - break; - } - } - if (found) - printw(" (NCV)"); - } - if ((termattrs() & test) != test) - printw(" (Part)"); - } - } - return row + 2; -} -/* *INDENT-OFF* */ -static const struct { - chtype attr; - NCURSES_CONST char * name; -} attrs_to_test[] = { - { A_STANDOUT, "STANDOUT" }, - { A_REVERSE, "REVERSE" }, - { A_BOLD, "BOLD" }, - { A_UNDERLINE, "UNDERLINE" }, - { A_DIM, "DIM" }, - { A_BLINK, "BLINK" }, - { A_PROTECT, "PROTECT" }, -#ifdef A_INVIS - { A_INVIS, "INVISIBLE" }, -#endif - { A_NORMAL, "NORMAL" }, -}; -/* *INDENT-ON* */ - -static bool -attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc) -{ - bool result = TRUE; - bool error = FALSE; - WINDOW *helpwin; - - do { - int ch = Getchar(); - - error = FALSE; - if (ch < 256 && isdigit(ch)) { - *skip = (ch - '0'); - } else { - switch (ch) { - case CTRL('L'): - Repaint(); - break; - case '?': - if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { - box(helpwin, 0, 0); - attr_legend(helpwin); - wGetchar(helpwin); - delwin(helpwin); - } - break; - case 'a': - *ac = 0; - break; - case 'A': - *ac = A_ALTCHARSET; - break; - case 'v': - if (*kc == 0) - *kc = SIZEOF(attrs_to_test) - 1; - else - *kc -= 1; - break; - case 'V': - *kc += 1; - if (*kc >= SIZEOF(attrs_to_test)) - *kc = 0; - break; - case '<': - adjust_attr_string(-1); - break; - case '>': - adjust_attr_string(1); - break; - case case_QUIT: - result = FALSE; - break; - default: - error = cycle_color_attr(ch, fg, bg, tx); - break; - } - } - } while (error); - return result; -} - -static void -attr_test(void) -/* test text attributes */ -{ - int n; - int skip = get_xmc(); - short fg = COLOR_BLACK; /* color pair 0 is special */ - short bg = COLOR_BLACK; - short tx = -1; - int ac = 0; - unsigned j, k; - - if (skip < 0) - skip = 0; - - n = skip; /* make it easy */ - k = SIZEOF(attrs_to_test) - 1; - init_attr_string(); - - do { - int row = 2; - chtype normal = A_NORMAL | BLANK; - chtype extras = (chtype) ac; - - if (use_colors) { - short pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK); - if (pair != 0) { - pair = 1; - if (init_pair(pair, fg, bg) == ERR) { - beep(); - } else { - normal |= (chtype) COLOR_PAIR(pair); - } - } - if (tx >= 0) { - pair = 2; - if (init_pair(pair, tx, bg) == ERR) { - beep(); - } else { - extras |= (chtype) COLOR_PAIR(pair); - } - } - } - bkgd(normal); - bkgdset(normal); - erase(); - - box(stdscr, 0, 0); - MvAddStr(0, 20, "Character attribute test display"); - - for (j = 0; j < SIZEOF(attrs_to_test); ++j) { - bool arrow = (j == k); - row = show_attr(row, n, arrow, - extras | - attrs_to_test[j].attr | - attrs_to_test[k].attr, - attrs_to_test[j].name); - } - - MvPrintw(row, 8, - "This terminal does %shave the magic-cookie glitch", - get_xmc() > -1 ? "" : "not "); - MvPrintw(row + 1, 8, "Enter '?' for help."); - show_color_attr(fg, bg, tx); - printw(" ACS (%d)", ac != 0); - - refresh(); - } while (attr_getc(&n, &fg, &bg, &tx, &ac, &k)); - - bkgdset(A_NORMAL | BLANK); - erase(); - endwin(); -} - -#if USE_WIDEC_SUPPORT -static wchar_t wide_attr_test_string[MAX_ATTRSTRING + 1]; - -static void -wide_adjust_attr_string(int adjust) -{ - int first = ((int) UChar(wide_attr_test_string[0])) + adjust; - int last = first + LEN_ATTRSTRING; - - if (first >= ' ' && last <= '~') { /* 32..126 */ - int j, k; - for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) { - wide_attr_test_string[j] = k; - if (((k + 1 - first) % 5) == 0) { - if (++j >= MAX_ATTRSTRING) - break; - wide_attr_test_string[j] = ' '; - } - } - while (j < MAX_ATTRSTRING) - wide_attr_test_string[j++] = ' '; - wide_attr_test_string[j] = '\0'; - } else { - beep(); - } -} - -static void -wide_init_attr_string(void) -{ - wide_attr_test_string[0] = 'a'; - wide_adjust_attr_string(0); -} - -static void -set_wide_background(short pair) -{ - cchar_t normal; - wchar_t blank[2]; - - blank[0] = ' '; - blank[1] = 0; - setcchar(&normal, blank, A_NORMAL, pair, 0); - bkgrnd(&normal); - bkgrndset(&normal); -} - -static attr_t -get_wide_background(void) -{ - attr_t result = A_NORMAL; - attr_t attr; - cchar_t ch; - short pair; - wchar_t wch[10]; - - if (getbkgrnd(&ch) != ERR) { - if (getcchar(&ch, wch, &attr, &pair, 0) != ERR) { - result = attr; - } - } - return result; -} - -static int -wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const char *name) -{ - int ncv = get_ncv(); - chtype test = attr & ~WA_ALTCHARSET; - - if (arrow) - MvPrintw(row, 5, "-->"); - MvPrintw(row, 8, "%s mode:", name); - MvPrintw(row, 24, "|"); - if (skip) - printw("%*s", skip, " "); - - /* - * Just for testing, write text using the alternate character set one - * character at a time (to pass its rendition directly), and use the - * string operation for the other attributes. - */ - if (attr & WA_ALTCHARSET) { - const wchar_t *s; - cchar_t ch; - - for (s = wide_attr_test_string; *s != L'\0'; ++s) { - wchar_t fill[2]; - fill[0] = *s; - fill[1] = L'\0'; - setcchar(&ch, fill, attr, pair, 0); - add_wch(&ch); - } - } else { - attr_t old_attr; - short old_pair; - - (void) attr_get(&old_attr, &old_pair, 0); - (void) attr_set(attr, pair, 0); - addwstr(wide_attr_test_string); - (void) attr_set(old_attr, old_pair, 0); - } - if (skip) - printw("%*s", skip, " "); - printw("|"); - if (test != A_NORMAL) { - if (!(term_attrs() & test)) { - printw(" (N/A)"); - } else { - if (ncv > 0 && (get_wide_background() & A_COLOR)) { - static const attr_t table[] = - { - WA_STANDOUT, - WA_UNDERLINE, - WA_REVERSE, - WA_BLINK, - WA_DIM, - WA_BOLD, - WA_INVIS, - WA_PROTECT, - WA_ALTCHARSET - }; - unsigned n; - bool found = FALSE; - for (n = 0; n < SIZEOF(table); n++) { - if ((table[n] & attr) != 0 - && ((1 << n) & ncv) != 0) { - found = TRUE; - break; - } - } - if (found) - printw(" (NCV)"); - } - if ((term_attrs() & test) != test) - printw(" (Part)"); - } - } - return row + 2; -} - -static bool -wide_attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc) -{ - bool result = TRUE; - bool error = FALSE; - WINDOW *helpwin; - - do { - int ch = Getchar(); - - error = FALSE; - if (ch < 256 && isdigit(ch)) { - *skip = (ch - '0'); - } else { - switch (ch) { - case CTRL('L'): - Repaint(); - break; - case '?': - if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { - box_set(helpwin, 0, 0); - attr_legend(helpwin); - wGetchar(helpwin); - delwin(helpwin); - } - break; - case 'a': - *ac = 0; - break; - case 'A': - *ac = A_ALTCHARSET; - break; - case 'v': - if (*kc == 0) - *kc = SIZEOF(attrs_to_test) - 1; - else - *kc -= 1; - break; - case 'V': - *kc += 1; - if (*kc >= SIZEOF(attrs_to_test)) - *kc = 0; - break; - case '<': - wide_adjust_attr_string(-1); - break; - case '>': - wide_adjust_attr_string(1); - break; - case case_QUIT: - result = FALSE; - break; - default: - error = cycle_color_attr(ch, fg, bg, tx); - break; - } - } - } while (error); - return result; -} - -static void -wide_attr_test(void) -/* test text attributes using wide-character calls */ -{ - int n; - int skip = get_xmc(); - short fg = COLOR_BLACK; /* color pair 0 is special */ - short bg = COLOR_BLACK; - short tx = -1; - int ac = 0; - unsigned j, k; - - if (skip < 0) - skip = 0; - - n = skip; /* make it easy */ - k = SIZEOF(attrs_to_test) - 1; - wide_init_attr_string(); - - do { - int row = 2; - short pair = 0; - short extras = 0; - - if (use_colors) { - pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK); - if (pair != 0) { - pair = 1; - if (init_pair(pair, fg, bg) == ERR) { - beep(); - } - } - extras = pair; - if (tx >= 0) { - extras = 2; - if (init_pair(extras, tx, bg) == ERR) { - beep(); - } - } - } - set_wide_background(pair); - erase(); - - box_set(stdscr, 0, 0); - MvAddStr(0, 20, "Character attribute test display"); - - for (j = 0; j < SIZEOF(attrs_to_test); ++j) { - row = wide_show_attr(row, n, j == k, - ((attr_t) ac | - attrs_to_test[j].attr | - attrs_to_test[k].attr), - extras, - attrs_to_test[j].name); - } - - MvPrintw(row, 8, - "This terminal does %shave the magic-cookie glitch", - get_xmc() > -1 ? "" : "not "); - MvPrintw(row + 1, 8, "Enter '?' for help."); - show_color_attr(fg, bg, tx); - printw(" ACS (%d)", ac != 0); - - refresh(); - } while (wide_attr_getc(&n, &fg, &bg, &tx, &ac, &k)); - - set_wide_background(0); - erase(); - endwin(); -} -#endif - -/**************************************************************************** - * - * Color support tests - * - ****************************************************************************/ - -static NCURSES_CONST char *the_color_names[] = -{ - "black", - "red", - "green", - "yellow", - "blue", - "magenta", - "cyan", - "white", - "BLACK", - "RED", - "GREEN", - "YELLOW", - "BLUE", - "MAGENTA", - "CYAN", - "WHITE" -}; - -static void -show_color_name(int y, int x, int color, bool wide) -{ - if (move(y, x) != ERR) { - char temp[80]; - int width = 8; - - if (wide) { - sprintf(temp, "%02d", color); - width = 4; - } else if (color >= 8) { - sprintf(temp, "[%02d]", color); - } else if (color < 0) { - strcpy(temp, "default"); - } else { - strcpy(temp, the_color_names[color]); - } - printw("%-*.*s", width, width, temp); - } -} - -static void -color_legend(WINDOW *helpwin, bool wide) -{ - int row = 1; - int col = 1; - - MvWPrintw(helpwin, row++, col, - "ESC to exit."); - ++row; - MvWPrintw(helpwin, row++, col, - "Use up/down arrow to scroll through the display if it is"); - MvWPrintw(helpwin, row++, col, - "longer than one screen. Control/N and Control/P can be used"); - MvWPrintw(helpwin, row++, col, - "in place of up/down arrow. Use pageup/pagedown to scroll a"); - MvWPrintw(helpwin, row++, col, - "full screen; control/B and control/F can be used here."); - ++row; - MvWPrintw(helpwin, row++, col, - "Toggles:"); - MvWPrintw(helpwin, row++, col, - " a/A toggle altcharset off/on"); - MvWPrintw(helpwin, row++, col, - " b/B toggle bold off/on"); - MvWPrintw(helpwin, row++, col, - " n/N toggle text/number on/off"); - MvWPrintw(helpwin, row++, col, - " r/R toggle reverse on/off"); - MvWPrintw(helpwin, row++, col, - " w/W toggle width between 8/16 colors"); -#if USE_WIDEC_SUPPORT - if (wide) { - MvWPrintw(helpwin, row++, col, - "Wide characters:"); - MvWPrintw(helpwin, row, col, - " x/X toggle text between ASCII and wide-character"); - } -#else - (void) wide; -#endif -} - -#define set_color_test(name, value) if (name != value) { name = value; base_row = 0; } - -/* generate a color test pattern */ -static void -color_test(void) -{ - short i; - int top = 0, width; - int base_row = 0; - int grid_top = top + 3; - int page_size = (LINES - grid_top); - int pairs_max = PAIR_NUMBER(A_COLOR) + 1; - int row_limit; - int per_row; - char numbered[80]; - const char *hello; - bool done = FALSE; - bool opt_acsc = FALSE; - bool opt_bold = FALSE; - bool opt_revs = FALSE; - bool opt_nums = FALSE; - bool opt_wide = FALSE; - WINDOW *helpwin; - - if (COLORS * COLORS == COLOR_PAIRS) { - int limit = (COLORS - min_colors) * (COLORS - min_colors); - if (pairs_max > limit) - pairs_max = limit; - } else { - if (pairs_max > COLOR_PAIRS) - pairs_max = COLOR_PAIRS; - } - - while (!done) { - int shown = 0; - - /* this assumes an 80-column line */ - if (opt_wide) { - width = 4; - hello = "Test"; - per_row = (COLORS > 8) ? 16 : 8; - } else { - width = 8; - hello = "Hello"; - per_row = 8; - } - per_row -= min_colors; - - row_limit = (pairs_max + per_row - 1) / per_row; - - move(0, 0); - (void) printw("There are %d color pairs and %d colors%s\n", - pairs_max, COLORS, - min_colors ? " besides 'default'" : ""); - - clrtobot(); - MvPrintw(top + 1, 0, - "%dx%d matrix of foreground/background colors, bold *%s*\n", - row_limit, - per_row, - 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); - - /* show a grid of colors, with color names/ numbers on the left */ - for (i = (short) (base_row * per_row); i < pairs_max; i++) { - int row = grid_top + (i / per_row) - base_row; - int col = (i % per_row + 1) * width; - short pair = i; - -#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors) -#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors) - if (row >= 0 && move(row, col) != ERR) { - short fg = InxToFG(i); - short bg = InxToBG(i); - - init_pair(pair, fg, bg); - attron((attr_t) COLOR_PAIR(pair)); - if (opt_acsc) - attron((attr_t) A_ALTCHARSET); - if (opt_bold) - attron((attr_t) A_BOLD); - if (opt_revs) - attron((attr_t) A_REVERSE); - - if (opt_nums) { - sprintf(numbered, "{%02X}", 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); - } - ++shown; - } else if (shown) { - break; - } - } - - switch (wGetchar(stdscr)) { - case 'a': - opt_acsc = FALSE; - break; - case 'A': - opt_acsc = TRUE; - break; - case 'b': - opt_bold = FALSE; - break; - case 'B': - opt_bold = TRUE; - break; - case 'n': - opt_nums = FALSE; - break; - case 'N': - opt_nums = TRUE; - break; - case 'r': - opt_revs = FALSE; - break; - case 'R': - opt_revs = TRUE; - break; - case case_QUIT: - done = TRUE; - continue; - case 'w': - set_color_test(opt_wide, FALSE); - break; - case 'W': - set_color_test(opt_wide, TRUE); - break; - case CTRL('p'): - case KEY_UP: - if (base_row <= 0) { - beep(); - } else { - base_row -= 1; - } - break; - case CTRL('n'): - case KEY_DOWN: - if (base_row + page_size >= row_limit) { - beep(); - } else { - base_row += 1; - } - break; - case CTRL('b'): - case KEY_PREVIOUS: - case KEY_PPAGE: - if (base_row <= 0) { - beep(); - } else { - base_row -= (page_size - 1); - if (base_row < 0) - base_row = 0; - } - break; - case CTRL('f'): - case KEY_NEXT: - case KEY_NPAGE: - if (base_row + page_size >= row_limit) { - beep(); - } else { - base_row += page_size - 1; - if (base_row + page_size >= row_limit) { - base_row = row_limit - page_size - 1; - } - } - break; - case '?': - if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { - box(helpwin, 0, 0); - color_legend(helpwin, FALSE); - wGetchar(helpwin); - delwin(helpwin); - } - break; - default: - beep(); - continue; - } - } - - erase(); - endwin(); -} - -#if USE_WIDEC_SUPPORT -/* generate a color test pattern */ -static void -wide_color_test(void) -{ - int 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 row_limit; - int per_row; - char numbered[80]; - const char *hello; - bool done = FALSE; - bool opt_acsc = FALSE; - bool opt_bold = FALSE; - bool opt_revs = FALSE; - bool opt_wide = FALSE; - bool opt_nums = FALSE; - bool opt_xchr = FALSE; - wchar_t buffer[10]; - WINDOW *helpwin; - - if (COLORS * COLORS == COLOR_PAIRS) { - int limit = (COLORS - min_colors) * (COLORS - min_colors); - if (pairs_max > limit) - pairs_max = limit; - } else { - if (pairs_max > COLOR_PAIRS) - pairs_max = COLOR_PAIRS; - } - - while (!done) { - int shown = 0; - - /* this assumes an 80-column line */ - if (opt_wide) { - width = 4; - hello = "Test"; - per_row = (COLORS > 8) ? 16 : 8; - } else { - width = 8; - hello = "Hello"; - per_row = 8; - } - per_row -= min_colors; - - if (opt_xchr) { - make_fullwidth_text(buffer, hello); - width *= 2; - per_row /= 2; - } else { - make_narrow_text(buffer, hello); - } - - row_limit = (pairs_max + per_row - 1) / per_row; - - move(0, 0); - (void) printw("There are %d color pairs and %d colors%s\n", - pairs_max, COLORS, - min_colors ? " besides 'default'" : ""); - - clrtobot(); - MvPrintw(top + 1, 0, - "%dx%d matrix of foreground/background colors, bold *%s*\n", - row_limit, - per_row, - 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); - - /* 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; - short pair = (short) i; - - if (row >= 0 && move(row, col) != ERR) { - init_pair(pair, InxToFG(i), InxToBG(i)); - color_set(pair, NULL); - if (opt_acsc) - attr_on((attr_t) A_ALTCHARSET, NULL); - if (opt_bold) - attr_on((attr_t) A_BOLD, NULL); - if (opt_revs) - attr_on((attr_t) A_REVERSE, NULL); - - if (opt_nums) { - sprintf(numbered, "{%02X}", i); - if (opt_xchr) { - make_fullwidth_text(buffer, numbered); - } else { - make_narrow_text(buffer, numbered); - } - } - 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); - } - ++shown; - } else if (shown) { - break; - } - } - - switch (wGetchar(stdscr)) { - case 'a': - opt_acsc = FALSE; - break; - case 'A': - opt_acsc = TRUE; - break; - case 'b': - opt_bold = FALSE; - break; - case 'B': - opt_bold = TRUE; - break; - case 'n': - opt_nums = FALSE; - break; - case 'N': - opt_nums = TRUE; - break; - case 'r': - opt_revs = FALSE; - break; - case 'R': - opt_revs = TRUE; - break; - case case_QUIT: - done = TRUE; - continue; - case 'w': - set_color_test(opt_wide, FALSE); - break; - case 'W': - set_color_test(opt_wide, TRUE); - break; - case 'x': - opt_xchr = FALSE; - break; - case 'X': - opt_xchr = TRUE; - break; - case CTRL('p'): - case KEY_UP: - if (base_row <= 0) { - beep(); - } else { - base_row -= 1; - } - break; - case CTRL('n'): - case KEY_DOWN: - if (base_row + page_size >= row_limit) { - beep(); - } else { - base_row += 1; - } - break; - case CTRL('b'): - case KEY_PREVIOUS: - case KEY_PPAGE: - if (base_row <= 0) { - beep(); - } else { - base_row -= (page_size - 1); - if (base_row < 0) - base_row = 0; - } - break; - case CTRL('f'): - case KEY_NEXT: - case KEY_NPAGE: - if (base_row + page_size >= row_limit) { - beep(); - } else { - base_row += page_size - 1; - if (base_row + page_size >= row_limit) { - base_row = row_limit - page_size - 1; - } - } - break; - case '?': - if ((helpwin = newwin(LINES - 1, COLS - 2, 0, 0)) != 0) { - box(helpwin, 0, 0); - color_legend(helpwin, TRUE); - wGetchar(helpwin); - delwin(helpwin); - } - break; - default: - beep(); - continue; - } - } - - erase(); - endwin(); -} -#endif /* USE_WIDEC_SUPPORT */ - -static void -change_color(short current, int field, int value, int usebase) -{ - short red, green, blue; - - color_content(current, &red, &green, &blue); - - switch (field) { - case 0: - red = (short) (usebase ? (red + value) : value); - break; - case 1: - green = (short) (usebase ? (green + value) : value); - break; - case 2: - blue = (short) (usebase ? (blue + value) : value); - break; - } - - if (init_color(current, red, green, blue) == ERR) - beep(); -} - -static void -init_all_colors(void) -{ - short c; - - for (c = 0; c < COLORS; ++c) - init_color(c, - all_colors[c].red, - all_colors[c].green, - all_colors[c].blue); -} - -#define scaled_rgb(n) ((255 * (n)) / 1000) - -static void -color_edit(void) -/* display the color test pattern, without trying to edit colors */ -{ - int i; - int current = 0; - int this_c = 0, value = 0, field = 0; - int last_c; - int top_color = 0; - int page_size = (LINES - 6); - - init_all_colors(); - refresh(); - - for (i = 0; i < max_colors; i++) - init_pair((short) i, (short) COLOR_WHITE, (short) i); - - MvPrintw(LINES - 2, 0, "Number: %d", value); - - do { - short red, green, blue; - - attron(A_BOLD); - MvAddStr(0, 20, "Color RGB Value Editing"); - attroff(A_BOLD); - - for (i = (short) top_color; - (i - top_color < page_size) - && (i < max_colors); i++) { - char numeric[80]; - - sprintf(numeric, "[%d]", i); - MvPrintw(2 + i - top_color, 0, "%c %-8s:", - (i == current ? '>' : ' '), - (i < (int) SIZEOF(the_color_names) - ? the_color_names[i] : numeric)); - (void) attrset((attr_t) COLOR_PAIR(i)); - addstr(" "); - (void) attrset(A_NORMAL); - - color_content((short) i, &red, &green, &blue); - addstr(" R = "); - if (current == i && field == 0) - attron(A_STANDOUT); - printw("%04d", red); - if (current == i && field == 0) - (void) attrset(A_NORMAL); - addstr(", G = "); - if (current == i && field == 1) - attron(A_STANDOUT); - printw("%04d", green); - if (current == i && field == 1) - (void) attrset(A_NORMAL); - addstr(", B = "); - if (current == i && field == 2) - attron(A_STANDOUT); - printw("%04d", blue); - if (current == i && field == 2) - (void) attrset(A_NORMAL); - (void) attrset(A_NORMAL); - printw(" ( %3d %3d %3d )", - scaled_rgb(red), - scaled_rgb(green), - scaled_rgb(blue)); - } - - MvAddStr(LINES - 3, 0, - "Use up/down to select a color, left/right to change fields."); - MvAddStr(LINES - 2, 0, - "Modify field by typing nnn=, nnn-, or nnn+. ? for help."); - - move(2 + current - top_color, 0); - - last_c = this_c; - this_c = Getchar(); - if (this_c < 256 && isdigit(this_c) && !isdigit(last_c)) - value = 0; - - switch (this_c) { - case CTRL('b'): - case KEY_PPAGE: - if (current > 0) - current -= (page_size - 1); - else - beep(); - break; - - case CTRL('f'): - case KEY_NPAGE: - if (current < (max_colors - 1)) - current += (page_size - 1); - else - beep(); - break; - - case CTRL('p'): - case KEY_UP: - current = (current == 0 ? (max_colors - 1) : current - 1); - break; - - case CTRL('n'): - case KEY_DOWN: - current = (current == (max_colors - 1) ? 0 : current + 1); - break; - - case KEY_RIGHT: - field = (field == 2 ? 0 : field + 1); - break; - - case KEY_LEFT: - field = (field == 0 ? 2 : field - 1); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - value = value * 10 + (this_c - '0'); - break; - - case '+': - change_color((short) current, field, value, 1); - break; - - case '-': - change_color((short) current, field, -value, 1); - break; - - case '=': - change_color((short) current, field, value, 0); - break; - - case '?': - erase(); - P(" RGB Value Editing Help"); - P(""); - P("You are in the RGB value editor. Use the arrow keys to select one of"); - P("the fields in one of the RGB triples of the current colors; the one"); - P("currently selected will be reverse-video highlighted."); - P(""); - P("To change a field, enter the digits of the new value; they are echoed"); - P("as entered. Finish by typing `='. The change will take effect instantly."); - P("To increment or decrement a value, use the same procedure, but finish"); - P("with a `+' or `-'."); - P(""); - P("Press 'm' to invoke the top-level menu with the current color settings."); - P("To quit, do ESC"); - - Pause(); - erase(); - break; - - case 'm': - endwin(); - main_menu(FALSE); - for (i = 0; i < max_colors; i++) - init_pair((short) i, (short) COLOR_WHITE, (short) i); - refresh(); - break; - - case case_QUIT: - break; - - default: - beep(); - break; - } - - if (current < 0) - current = 0; - if (current >= max_colors) - current = max_colors - 1; - if (current < top_color) - top_color = current; - if (current - top_color >= page_size) - top_color = current - (page_size - 1); - - MvPrintw(LINES - 1, 0, "Number: %d", value); - clrtoeol(); - } while - (!isQuit(this_c)); - - erase(); - - /* - * ncurses does not reset each color individually when calling endwin(). - */ - init_all_colors(); - - endwin(); -} - -/**************************************************************************** - * - * Alternate character-set stuff - * - ****************************************************************************/ -/* *INDENT-OFF* */ -static struct { - chtype attr; - const char *name; -} attrs_to_cycle[] = { - { A_NORMAL, "normal" }, - { A_BOLD, "bold" }, - { A_BLINK, "blink" }, - { A_REVERSE, "reverse" }, - { A_UNDERLINE, "underline" }, -}; -/* *INDENT-ON* */ - -static bool -cycle_attr(int ch, unsigned *at_code, chtype *attr) -{ - bool result = TRUE; - - switch (ch) { - case 'v': - if ((*at_code += 1) >= SIZEOF(attrs_to_cycle)) - *at_code = 0; - break; - case 'V': - if (*at_code == 0) - *at_code = SIZEOF(attrs_to_cycle) - 1; - else - *at_code -= 1; - break; - default: - result = FALSE; - break; - } - if (result) - *attr = attrs_to_cycle[*at_code].attr; - return result; -} - -static bool -cycle_colors(int ch, int *fg, int *bg, short *pair) -{ - bool result = FALSE; - - if (use_colors) { - result = TRUE; - switch (ch) { - case 'F': - if ((*fg -= 1) < 0) - *fg = COLORS - 1; - break; - case 'f': - if ((*fg += 1) >= COLORS) - *fg = 0; - break; - case 'B': - if ((*bg -= 1) < 0) - *bg = COLORS - 1; - break; - case 'b': - if ((*bg += 1) >= COLORS) - *bg = 0; - break; - default: - result = FALSE; - break; - } - if (result) { - *pair = (short) (*fg != COLOR_BLACK || *bg != COLOR_BLACK); - if (*pair != 0) { - *pair = 1; - if (init_pair(*pair, (short) *fg, (short) *bg) == ERR) { - result = FALSE; - } - } - } - } - return result; -} - -/**************************************************************************** - * - * Soft-key label test - * - ****************************************************************************/ - -#if USE_SOFTKEYS - -#define SLK_HELP 17 -#define SLK_WORK (SLK_HELP + 3) - -static void -slk_help(void) -{ - static const char *table[] = - { - "Available commands are:" - ,"" - ,"^L -- repaint this message and activate soft keys" - ,"a/d -- activate/disable soft keys" - ,"c -- set centered format for labels" - ,"l -- set left-justified format for labels" - ,"r -- set right-justified format for labels" - ,"[12345678] -- set label; labels are numbered 1 through 8" - ,"e -- erase stdscr (should not erase labels)" - ,"s -- test scrolling of shortened screen" - ,"v/V -- cycle through video attributes" -#if HAVE_SLK_COLOR - ,"F/f/B/b -- cycle through foreground/background colors" -#endif - ,"ESC -- return to main menu" - ,"" - ,"Note: if activating the soft keys causes your terminal to scroll up" - ,"one line, your terminal auto-scrolls when anything is written to the" - ,"last screen position. The ncurses code does not yet handle this" - ,"gracefully." - }; - unsigned j; - - move(2, 0); - for (j = 0; j < SIZEOF(table); ++j) { - P(table[j]); - } - refresh(); -} - -#if HAVE_SLK_COLOR -static void -call_slk_color(int fg, int bg) -{ - init_pair(1, (short) bg, (short) fg); - slk_color(1); - MvPrintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg); - clrtoeol(); - slk_touch(); - slk_noutrefresh(); - refresh(); -} -#endif - -static void -slk_test(void) -/* exercise the soft keys */ -{ - int c, fmt = 1; - char buf[9]; - char *s; - chtype attr = A_NORMAL; - unsigned at_code = 0; -#if HAVE_SLK_COLOR - int fg = COLOR_BLACK; - int bg = COLOR_WHITE; - short pair = 0; -#endif - - c = CTRL('l'); -#if HAVE_SLK_COLOR - if (use_colors) { - call_slk_color(fg, bg); - } -#endif - - do { - move(0, 0); - switch (c) { - case CTRL('l'): - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Soft Key Exerciser"); - attroff(A_BOLD); - - slk_help(); - /* fall through */ - - case 'a': - slk_restore(); - break; - - case 'e': - wclear(stdscr); - break; - - case 's': - MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: "); - while ((c = Getchar()) != 'Q' && (c != ERR)) - addch((chtype) c); - break; - - case 'd': - slk_clear(); - break; - - case 'l': - fmt = 0; - break; - - case 'c': - fmt = 1; - break; - - case 'r': - fmt = 2; - break; - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - MvAddStr(SLK_WORK, 0, "Please enter the label value: "); - strcpy(buf, ""); - if ((s = slk_label(c - '0')) != 0) { - strncpy(buf, s, 8); - } - wGetstring(stdscr, buf, 8); - slk_set((c - '0'), buf, fmt); - slk_refresh(); - move(SLK_WORK, 0); - clrtobot(); - break; - - case case_QUIT: - goto done; - -#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE - case KEY_RESIZE: - wnoutrefresh(stdscr); - break; -#endif - - default: - if (cycle_attr(c, &at_code, &attr)) { - slk_attrset(attr); - slk_touch(); - slk_noutrefresh(); - break; - } -#if HAVE_SLK_COLOR - if (cycle_colors(c, &fg, &bg, &pair)) { - if (use_colors) { - call_slk_color(fg, bg); - } else { - beep(); - } - break; - } -#endif - beep(); - break; - } - } while (!isQuit(c = Getchar())); - - done: - slk_clear(); - erase(); - endwin(); -} - -#if USE_WIDEC_SUPPORT -#define SLKLEN 8 -static void -wide_slk_test(void) -/* exercise the soft keys */ -{ - int c, fmt = 1; - wchar_t buf[SLKLEN + 1]; - char *s; - chtype attr = A_NORMAL; - unsigned at_code = 0; - int fg = COLOR_BLACK; - int bg = COLOR_WHITE; - short pair = 0; - - c = CTRL('l'); - if (use_colors) { - call_slk_color(fg, bg); - } - do { - move(0, 0); - switch (c) { - case CTRL('l'): - erase(); - attr_on(WA_BOLD, NULL); - MvAddStr(0, 20, "Soft Key Exerciser"); - attr_off(WA_BOLD, NULL); - - slk_help(); - /* fall through */ - - case 'a': - slk_restore(); - break; - - case 'e': - wclear(stdscr); - break; - - case 's': - MvPrintw(SLK_WORK, 0, "Press Q to stop the scrolling-test: "); - while ((c = Getchar()) != 'Q' && (c != ERR)) - addch((chtype) c); - break; - - case 'd': - slk_clear(); - break; - - case 'l': - fmt = 0; - break; - - case 'c': - fmt = 1; - break; - - case 'r': - fmt = 2; - break; - - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - MvAddStr(SLK_WORK, 0, "Please enter the label value: "); - *buf = 0; - if ((s = slk_label(c - '0')) != 0) { - 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) { - const char *base = s; - reset_mbytes(state); - test = count_mbytes(base, 0, &state); - if (test == (size_t) -1) { - temp[--used] = 0; - } else if (test > want) { - temp[--used] = 0; - } else { - reset_mbytes(state); - trans_mbytes(buf, base, want, &state); - break; - } - } - free(temp); - } - wGet_wstring(stdscr, buf, SLKLEN); - slk_wset((c - '0'), buf, fmt); - slk_refresh(); - move(SLK_WORK, 0); - clrtobot(); - break; - - case case_QUIT: - goto done; - - case 'F': - if (use_colors) { - fg = (short) ((fg + 1) % COLORS); - call_slk_color(fg, bg); - } - break; - case 'B': - if (use_colors) { - bg = (short) ((bg + 1) % COLORS); - call_slk_color(fg, bg); - } - break; -#if defined(NCURSES_VERSION) && defined(KEY_RESIZE) && HAVE_WRESIZE - case KEY_RESIZE: - wnoutrefresh(stdscr); - break; -#endif - default: - if (cycle_attr(c, &at_code, &attr)) { - slk_attr_set(attr, (fg || bg), NULL); - slk_touch(); - slk_noutrefresh(); - break; - } -#if HAVE_SLK_COLOR - if (cycle_colors(c, &fg, &bg, &pair)) { - if (use_colors) { - call_slk_color(fg, bg); - } else { - beep(); - } - break; - } -#endif - beep(); - break; - } - } while (!isQuit(c = Getchar())); - - done: - slk_clear(); - erase(); - endwin(); -} -#endif -#endif /* SLK_INIT */ - -/* ISO 6429: codes 0x80 to 0x9f may be control characters that cause the - * terminal to perform functions. The remaining codes can be graphic. - */ -static void -show_upper_chars(unsigned first, int repeat, attr_t attr, short pair) -{ - bool C1 = (first == 128); - unsigned code; - unsigned last = first + 31; - int reply; - - erase(); - attron(A_BOLD); - MvPrintw(0, 20, "Display of %s Character Codes %d to %d", - C1 ? "C1" : "GR", first, last); - attroff(A_BOLD); - refresh(); - - for (code = first; code <= last; code++) { - int count = repeat; - int row = 2 + ((int) (code - first) % 16); - int col = ((int) (code - first) / 16) * COLS / 2; - char tmp[80]; - sprintf(tmp, "%3u (0x%x)", code, code); - MvPrintw(row, col, "%*s: ", COLS / 4, tmp); - - do { - if (C1) - nodelay(stdscr, TRUE); - echochar(colored_chtype(code, attr, pair)); - if (C1) { - /* (yes, this _is_ crude) */ - while ((reply = Getchar()) != ERR) { - addch(UChar(reply)); - napms(10); - } - nodelay(stdscr, FALSE); - } - } while (--count > 0); - } -} - -#define PC_COLS 4 - -static void -show_pc_chars(int repeat, attr_t attr, short pair) -{ - unsigned code; - - erase(); - attron(A_BOLD); - MvPrintw(0, 20, "Display of PC Character Codes"); - attroff(A_BOLD); - refresh(); - - for (code = 0; code < 16; ++code) { - MvPrintw(2, (int) code * PC_COLS + 8, "%X", code); - } - for (code = 0; code < 256; code++) { - int count = repeat; - int row = 3 + (int) (code / 16) + (code >= 128); - int col = 8 + (int) (code % 16) * PC_COLS; - if ((code % 16) == 0) - MvPrintw(row, 0, "0x%02x:", code); - move(row, col); - do { - switch (code) { - case '\n': - case '\r': - case '\b': - case '\f': - case '\033': - case 0x9b: - /* - * Skip the ones that do not work. - */ - break; - default: - addch(colored_chtype(code, A_ALTCHARSET | attr, pair)); - break; - } - } while (--count > 0); - } -} - -static void -show_box_chars(int repeat, attr_t attr, short pair) -{ - (void) repeat; - - attr |= (attr_t) COLOR_PAIR(pair); - - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the ACS Line-Drawing Set"); - attroff(A_BOLD); - refresh(); - /* *INDENT-OFF* */ - wborder(stdscr, - colored_chtype(ACS_VLINE, attr, pair), - colored_chtype(ACS_VLINE, attr, pair), - colored_chtype(ACS_HLINE, attr, pair), - colored_chtype(ACS_HLINE, attr, pair), - colored_chtype(ACS_ULCORNER, attr, pair), - colored_chtype(ACS_URCORNER, attr, pair), - colored_chtype(ACS_LLCORNER, attr, pair), - colored_chtype(ACS_LRCORNER, attr, pair)); - MvHLine(LINES / 2, 0, colored_chtype(ACS_HLINE, attr, pair), COLS); - MvVLine(0, COLS / 2, colored_chtype(ACS_VLINE, attr, pair), LINES); - MvAddCh(0, COLS / 2, colored_chtype(ACS_TTEE, attr, pair)); - MvAddCh(LINES / 2, COLS / 2, colored_chtype(ACS_PLUS, attr, pair)); - MvAddCh(LINES - 1, COLS / 2, colored_chtype(ACS_BTEE, attr, 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 -show_1_acs(int n, int repeat, const char *name, chtype code) -{ - const int height = 16; - int row = 2 + (n % height); - int col = (n / height) * COLS / 2; - - MvPrintw(row, col, "%*s : ", COLS / 4, name); - do { - addch(code); - } while (--repeat > 0); - return n + 1; -} - -static void -show_acs_chars(int repeat, attr_t attr, short pair) -/* display the ACS character set */ -{ - int n; - -#define BOTH(name) #name, colored_chtype(name, attr, (chtype) pair) - - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the ACS Character Set"); - attroff(A_BOLD); - refresh(); - - n = show_1_acs(0, repeat, BOTH(ACS_ULCORNER)); - n = show_1_acs(n, repeat, BOTH(ACS_URCORNER)); - n = show_1_acs(n, repeat, BOTH(ACS_LLCORNER)); - n = show_1_acs(n, repeat, BOTH(ACS_LRCORNER)); - - n = show_1_acs(n, repeat, BOTH(ACS_LTEE)); - n = show_1_acs(n, repeat, BOTH(ACS_RTEE)); - n = show_1_acs(n, repeat, BOTH(ACS_TTEE)); - n = show_1_acs(n, repeat, BOTH(ACS_BTEE)); - - n = show_1_acs(n, repeat, BOTH(ACS_HLINE)); - n = show_1_acs(n, repeat, BOTH(ACS_VLINE)); - - /* - * HPUX's ACS definitions are broken here. Just give up. - */ -#if !(defined(__hpux) && !defined(NCURSES_VERSION)) - n = show_1_acs(n, repeat, BOTH(ACS_LARROW)); - n = show_1_acs(n, repeat, BOTH(ACS_RARROW)); - n = show_1_acs(n, repeat, BOTH(ACS_UARROW)); - n = show_1_acs(n, repeat, BOTH(ACS_DARROW)); - - n = show_1_acs(n, repeat, BOTH(ACS_BLOCK)); - n = show_1_acs(n, repeat, BOTH(ACS_BOARD)); - n = show_1_acs(n, repeat, BOTH(ACS_LANTERN)); - n = show_1_acs(n, repeat, BOTH(ACS_BULLET)); - n = show_1_acs(n, repeat, BOTH(ACS_CKBOARD)); - n = show_1_acs(n, repeat, BOTH(ACS_DEGREE)); - n = show_1_acs(n, repeat, BOTH(ACS_DIAMOND)); - n = show_1_acs(n, repeat, BOTH(ACS_PLMINUS)); - n = show_1_acs(n, repeat, BOTH(ACS_PLUS)); - - n = show_1_acs(n, repeat, BOTH(ACS_GEQUAL)); - n = show_1_acs(n, repeat, BOTH(ACS_NEQUAL)); - n = show_1_acs(n, repeat, BOTH(ACS_LEQUAL)); - - n = show_1_acs(n, repeat, BOTH(ACS_STERLING)); - n = show_1_acs(n, repeat, BOTH(ACS_PI)); - n = show_1_acs(n, repeat, BOTH(ACS_S1)); - n = show_1_acs(n, repeat, BOTH(ACS_S3)); - n = show_1_acs(n, repeat, BOTH(ACS_S7)); - (void) show_1_acs(n, repeat, BOTH(ACS_S9)); -#endif -} - -static void -acs_display(void) -{ - int c = 'a'; - char *term = getenv("TERM"); - const char *pch_kludge = ((term != 0 && strstr(term, "linux")) - ? "p=PC, " - : ""); - chtype attr = A_NORMAL; - int digit = 0; - int repeat = 1; - int fg = COLOR_BLACK; - int bg = COLOR_BLACK; - unsigned at_code = 0; - short pair = 0; - void (*last_show_acs) (int, attr_t, short) = 0; - - do { - switch (c) { - case CTRL('L'): - Repaint(); - break; - case 'a': - ToggleAcs(last_show_acs, show_acs_chars); - break; - case 'p': - if (*pch_kludge) - ToggleAcs(last_show_acs, show_pc_chars); - else - beep(); - break; - case 'x': - ToggleAcs(last_show_acs, show_box_chars); - break; - case '0': - case '1': - case '2': - case '3': - digit = (c - '0'); - last_show_acs = 0; - break; - case '-': - if (digit > 0) { - --digit; - last_show_acs = 0; - } else { - beep(); - } - break; - case '+': - if (digit < 3) { - ++digit; - last_show_acs = 0; - } else { - beep(); - } - break; - case '>': - if (repeat < (COLS / 4)) - ++repeat; - break; - case '<': - if (repeat > 1) - --repeat; - break; - default: - if (cycle_attr(c, &at_code, &attr) - || cycle_colors(c, &fg, &bg, &pair)) { - break; - } else { - beep(); - } - break; - } - if (last_show_acs != 0) - last_show_acs(repeat, attr, pair); - else - show_upper_chars((unsigned) (digit * 32 + 128), repeat, attr, pair); - - MvPrintw(LINES - 3, 0, - "Note: ANSI terminals may not display C1 characters."); - MvPrintw(LINES - 2, 0, - "Select: a=ACS, x=box, %s0=C1, 1-3,+/- non-ASCII, repeat, ESC=quit", - pch_kludge); - if (use_colors) { - MvPrintw(LINES - 1, 0, - "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.", - attrs_to_cycle[at_code].name, - fg, bg); - } else { - MvPrintw(LINES - 1, 0, - "v/V cycles through video attributes (%s).", - attrs_to_cycle[at_code].name); - } - refresh(); - } while (!isQuit(c = Getchar())); - - Pause(); - erase(); - endwin(); -} - -#if USE_WIDEC_SUPPORT -static cchar_t * -merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair) -{ - int count; - - *dst = *src; - do { - TEST_CCHAR(src, count, { - attr |= (test_attrs & A_ALTCHARSET); - setcchar(dst, test_wch, attr, pair, NULL); - } - , { - ; - }); - } while (0); - return dst; -} - -static void -show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair) -{ - cchar_t temp; - wchar_t code; - int last = first + 31; - - erase(); - attron(A_BOLD); - MvPrintw(0, 20, "Display of Character Codes %d to %d", first, last); - attroff(A_BOLD); - - for (code = first; (int) code <= last; code++) { - int row = 2 + ((code - first) % 16); - int col = ((code - first) / 16) * COLS / 2; - wchar_t codes[10]; - char tmp[80]; - int count = repeat; - int y, x; - - memset(&codes, 0, sizeof(codes)); - codes[0] = code; - sprintf(tmp, "%3ld (0x%lx)", (long) code, (long) code); - MvPrintw(row, col, "%*s: ", COLS / 4, tmp); - setcchar(&temp, codes, attr, pair, 0); - do { - /* - * Give non-spacing characters something to combine with. If we - * don't, they'll bunch up in a heap on the space after the ":". - * Mark them with reverse-video to make them simpler to find on - * the display. - */ - if (wcwidth(code) == 0) { - addch((chtype) space | - (A_REVERSE ^ attr) | - (attr_t) COLOR_PAIR(pair)); - } - /* - * This could use add_wch(), but is done for comparison with the - * normal 'f' test (and to make a test-case for echo_wchar()). - * The screen will flicker because the erase() at the top of the - * function is met by the builtin refresh() in echo_wchar(). - */ - echo_wchar(&temp); - /* - * The repeat-count may make text wrap - avoid that. - */ - getyx(stdscr, y, x); - if (x >= col + (COLS / 2) - 2) - break; - } while (--count > 0); - } -} - -static int -show_1_wacs(int n, int repeat, const char *name, const cchar_t *code) -{ - const int height = 16; - int row = 2 + (n % height); - int col = (n / height) * COLS / 2; - - MvPrintw(row, col, "%*s : ", COLS / 4, name); - while (--repeat >= 0) { - add_wch(code); - } - return n + 1; -} - -#define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair) - -static void -show_wacs_chars(int repeat, attr_t attr, short pair) -/* display the wide-ACS character set */ -{ - cchar_t temp; - - int n; - -/*#define BOTH2(name) #name, &(name) */ -#define BOTH2(name) #name, MERGE_ATTR(name) - - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); - attroff(A_BOLD); - refresh(); - - n = show_1_wacs(0, repeat, BOTH2(WACS_ULCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_URCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LLCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LRCORNER)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_LTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_RTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_TTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BTEE)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_HLINE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_VLINE)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET)); - n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD)); - 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)); - -#ifdef CURSES_WACS_ARRAY - n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL)); - n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING)); - n = show_1_wacs(n, repeat, BOTH2(WACS_PI)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S1)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S3)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S7)); - (void) show_1_wacs(n, repeat, BOTH2(WACS_S9)); -#endif -} - -#ifdef WACS_D_PLUS -static void -show_wacs_chars_double(int repeat, attr_t attr, short pair) -/* display the wide-ACS character set */ -{ - cchar_t temp; - - int n; - -/*#define BOTH2(name) #name, &(name) */ -#define BOTH2(name) #name, MERGE_ATTR(name) - - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); - attroff(A_BOLD); - refresh(); - - n = show_1_wacs(0, repeat, BOTH2(WACS_D_ULCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_URCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_LLCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_LRCORNER)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_D_LTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_RTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_TTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_BTEE)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_D_HLINE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_D_VLINE)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET)); - n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD)); - 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)); - -#ifdef CURSES_WACS_ARRAY - n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL)); - n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING)); - n = show_1_wacs(n, repeat, BOTH2(WACS_PI)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S1)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S3)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S7)); - (void) show_1_wacs(n, repeat, BOTH2(WACS_S9)); -#endif -} -#endif - -#ifdef WACS_T_PLUS -static void -show_wacs_chars_thick(int repeat, attr_t attr, short pair) -/* display the wide-ACS character set */ -{ - cchar_t temp; - - int n; - -/*#define BOTH2(name) #name, &(name) */ -#define BOTH2(name) #name, MERGE_ATTR(name) - - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); - attroff(A_BOLD); - refresh(); - - n = show_1_wacs(0, repeat, BOTH2(WACS_T_ULCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_URCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_LLCORNER)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_LRCORNER)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_T_LTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_RTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_TTEE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_BTEE)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_T_HLINE)); - n = show_1_wacs(n, repeat, BOTH2(WACS_T_VLINE)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_LARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_RARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_UARROW)); - n = show_1_wacs(n, repeat, BOTH2(WACS_DARROW)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_BLOCK)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BOARD)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LANTERN)); - n = show_1_wacs(n, repeat, BOTH2(WACS_BULLET)); - n = show_1_wacs(n, repeat, BOTH2(WACS_CKBOARD)); - 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)); - -#ifdef CURSES_WACS_ARRAY - n = show_1_wacs(n, repeat, BOTH2(WACS_GEQUAL)); - n = show_1_wacs(n, repeat, BOTH2(WACS_NEQUAL)); - n = show_1_wacs(n, repeat, BOTH2(WACS_LEQUAL)); - - n = show_1_wacs(n, repeat, BOTH2(WACS_STERLING)); - n = show_1_wacs(n, repeat, BOTH2(WACS_PI)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S1)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S3)); - n = show_1_wacs(n, repeat, BOTH2(WACS_S7)); - (void) show_1_wacs(n, repeat, BOTH2(WACS_S9)); -#endif -} -#endif - -#undef MERGE_ATTR - -#define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair) - -static void -show_wbox_chars(int repeat, attr_t attr, short pair) -{ - cchar_t temp[8]; - - (void) repeat; - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the Wide-ACS Line-Drawing Set"); - attroff(A_BOLD); - refresh(); - - wborder_set(stdscr, - MERGE_ATTR(0, WACS_VLINE), - MERGE_ATTR(1, WACS_VLINE), - MERGE_ATTR(2, WACS_HLINE), - MERGE_ATTR(3, WACS_HLINE), - MERGE_ATTR(4, WACS_ULCORNER), - MERGE_ATTR(5, WACS_URCORNER), - MERGE_ATTR(6, WACS_LLCORNER), - MERGE_ATTR(7, WACS_LRCORNER)); - /* *INDENT-OFF* */ - (void) mvhline_set(LINES / 2, 0, MERGE_ATTR(0, WACS_HLINE), COLS); - (void) mvvline_set(0, COLS / 2, MERGE_ATTR(0, WACS_VLINE), LINES); - (void) mvadd_wch(0, COLS / 2, MERGE_ATTR(0, WACS_TTEE)); - (void) mvadd_wch(LINES / 2, COLS / 2, MERGE_ATTR(0, WACS_PLUS)); - (void) mvadd_wch(LINES - 1, COLS / 2, MERGE_ATTR(0, WACS_BTEE)); - (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 - -static int -show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair) -{ - const int height = 16; - int row = 2 + (n % height); - int col = (n / height) * COLS / 2; - char temp[80]; - - MvPrintw(row, col, "%*s : ", COLS / 4, name); - (void) attr_set(attr, pair, 0); - addstr(strcpy(temp, code)); - (void) attr_set(A_NORMAL, 0, 0); - return n + 1; -} - -#define SHOW_UTF8(n, name, code) show_2_wacs(n, name, code, attr, pair) - -static void -show_utf8_chars(int repeat, attr_t attr, short pair) -{ - int n; - - (void) repeat; - erase(); - attron(A_BOLD); - MvAddStr(0, 20, "Display of the Wide-ACS Character Set"); - attroff(A_BOLD); - refresh(); - /* *INDENT-OFF* */ - n = SHOW_UTF8(0, "WACS_ULCORNER", "\342\224\214"); - n = SHOW_UTF8(n, "WACS_URCORNER", "\342\224\220"); - n = SHOW_UTF8(n, "WACS_LLCORNER", "\342\224\224"); - n = SHOW_UTF8(n, "WACS_LRCORNER", "\342\224\230"); - - n = SHOW_UTF8(n, "WACS_LTEE", "\342\224\234"); - n = SHOW_UTF8(n, "WACS_RTEE", "\342\224\244"); - n = SHOW_UTF8(n, "WACS_TTEE", "\342\224\254"); - n = SHOW_UTF8(n, "WACS_BTEE", "\342\224\264"); - - n = SHOW_UTF8(n, "WACS_HLINE", "\342\224\200"); - n = SHOW_UTF8(n, "WACS_VLINE", "\342\224\202"); - - n = SHOW_UTF8(n, "WACS_LARROW", "\342\206\220"); - n = SHOW_UTF8(n, "WACS_RARROW", "\342\206\222"); - n = SHOW_UTF8(n, "WACS_UARROW", "\342\206\221"); - n = SHOW_UTF8(n, "WACS_DARROW", "\342\206\223"); - - n = SHOW_UTF8(n, "WACS_BLOCK", "\342\226\256"); - n = SHOW_UTF8(n, "WACS_BOARD", "\342\226\222"); - n = SHOW_UTF8(n, "WACS_LANTERN", "\342\230\203"); - n = SHOW_UTF8(n, "WACS_BULLET", "\302\267"); - n = SHOW_UTF8(n, "WACS_CKBOARD", "\342\226\222"); - n = SHOW_UTF8(n, "WACS_DEGREE", "\302\260"); - n = SHOW_UTF8(n, "WACS_DIAMOND", "\342\227\206"); - n = SHOW_UTF8(n, "WACS_PLMINUS", "\302\261"); - n = SHOW_UTF8(n, "WACS_PLUS", "\342\224\274"); - n = SHOW_UTF8(n, "WACS_GEQUAL", "\342\211\245"); - n = SHOW_UTF8(n, "WACS_NEQUAL", "\342\211\240"); - n = SHOW_UTF8(n, "WACS_LEQUAL", "\342\211\244"); - - n = SHOW_UTF8(n, "WACS_STERLING", "\302\243"); - n = SHOW_UTF8(n, "WACS_PI", "\317\200"); - n = SHOW_UTF8(n, "WACS_S1", "\342\216\272"); - n = SHOW_UTF8(n, "WACS_S3", "\342\216\273"); - 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) -{ - int c = 'a'; - int digit = 0; - int repeat = 1; - int space = ' '; - chtype attr = A_NORMAL; - int fg = COLOR_BLACK; - int bg = COLOR_BLACK; - unsigned at_code = 0; - short pair = 0; - void (*last_show_wacs) (int, attr_t, short) = 0; - - do { - switch (c) { - case CTRL('L'): - Repaint(); - break; - case 'a': - ToggleAcs(last_show_wacs, show_wacs_chars); - break; -#ifdef WACS_D_PLUS - case 'd': - ToggleAcs(last_show_wacs, show_wacs_chars_double); - break; -#endif -#ifdef WACS_T_PLUS - case 't': - ToggleAcs(last_show_wacs, show_wacs_chars_thick); - break; -#endif - case 'x': - ToggleAcs(last_show_wacs, show_wbox_chars); - break; - case 'u': - ToggleAcs(last_show_wacs, show_utf8_chars); - break; - default: - if (c < 256 && isdigit(c)) { - digit = (c - '0'); - last_show_wacs = 0; - } else if (c == '+') { - ++digit; - last_show_wacs = 0; - } else if (c == '-' && digit > 0) { - --digit; - last_show_wacs = 0; - } else if (c == '>' && repeat < (COLS / 4)) { - ++repeat; - } else if (c == '<' && repeat > 1) { - --repeat; - } else if (c == '_') { - space = (space == ' ') ? '_' : ' '; - last_show_wacs = 0; - } else if (cycle_attr(c, &at_code, &attr) - || cycle_colors(c, &fg, &bg, &pair)) { - if (last_show_wacs != 0) - break; - } else { - beep(); - break; - } - break; - } - if (last_show_wacs != 0) - last_show_wacs(repeat, attr, pair); - else - show_upper_widechars(digit * 32 + 128, repeat, space, attr, pair); - - MvPrintw(LINES - 3, 0, - "Select: a/d/t WACS, x box, u UTF-8, 0-9,+/- non-ASCII, repeat, ESC=quit"); - if (use_colors) { - MvPrintw(LINES - 2, 0, - "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.", - attrs_to_cycle[at_code].name, - fg, bg); - } else { - MvPrintw(LINES - 2, 0, - "v/V cycles through video attributes (%s).", - attrs_to_cycle[at_code].name); - } - refresh(); - } while (!isQuit(c = Getchar())); - - Pause(); - erase(); - endwin(); -} - -#endif - -/* - * Graphic-rendition test (adapted from vttest) - */ -static void -test_sgr_attributes(void) -{ - int pass; - - for (pass = 0; pass < 2; pass++) { - chtype normal = ((pass == 0 ? A_NORMAL : A_REVERSE)) | BLANK; - - /* Use non-default colors if possible to exercise bce a little */ - if (use_colors) { - init_pair(1, COLOR_WHITE, COLOR_BLUE); - normal |= COLOR_PAIR(1); - } - bkgdset(normal); - erase(); - MvPrintw(1, 20, "Graphic rendition test pattern:"); - - MvPrintw(4, 1, "vanilla"); - -#define set_sgr(mask) bkgdset((normal^(mask))); - set_sgr(A_BOLD); - MvPrintw(4, 40, "bold"); - - set_sgr(A_UNDERLINE); - MvPrintw(6, 6, "underline"); - - set_sgr(A_BOLD | A_UNDERLINE); - MvPrintw(6, 45, "bold underline"); - - set_sgr(A_BLINK); - MvPrintw(8, 1, "blink"); - - set_sgr(A_BLINK | A_BOLD); - MvPrintw(8, 40, "bold blink"); - - set_sgr(A_UNDERLINE | A_BLINK); - MvPrintw(10, 6, "underline blink"); - - set_sgr(A_BOLD | A_UNDERLINE | A_BLINK); - MvPrintw(10, 45, "bold underline blink"); - - set_sgr(A_REVERSE); - MvPrintw(12, 1, "negative"); - - set_sgr(A_BOLD | A_REVERSE); - MvPrintw(12, 40, "bold negative"); - - set_sgr(A_UNDERLINE | A_REVERSE); - MvPrintw(14, 6, "underline negative"); - - set_sgr(A_BOLD | A_UNDERLINE | A_REVERSE); - MvPrintw(14, 45, "bold underline negative"); - - set_sgr(A_BLINK | A_REVERSE); - MvPrintw(16, 1, "blink negative"); - - set_sgr(A_BOLD | A_BLINK | A_REVERSE); - MvPrintw(16, 40, "bold blink negative"); - - set_sgr(A_UNDERLINE | A_BLINK | A_REVERSE); - MvPrintw(18, 6, "underline blink negative"); - - set_sgr(A_BOLD | A_UNDERLINE | A_BLINK | A_REVERSE); - MvPrintw(18, 45, "bold underline blink negative"); - - bkgdset(normal); - MvPrintw(LINES - 2, 1, "%s background. ", pass == 0 ? "Dark" : - "Light"); - clrtoeol(); - Pause(); - } - - bkgdset(A_NORMAL | BLANK); - erase(); - endwin(); -} - -/**************************************************************************** - * - * Windows and scrolling tester. - * - ****************************************************************************/ - -#define BOTLINES 4 /* number of line stolen from screen bottom */ - -typedef struct { - int y, x; -} pair; - -#define FRAME struct frame -FRAME -{ - FRAME *next, *last; - bool do_scroll; - bool do_keypad; - WINDOW *wind; -}; - -#if defined(NCURSES_VERSION) -#if (NCURSES_VERSION_PATCH < 20070331) && NCURSES_EXT_FUNCS -#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 -#define is_scrollok(win) FALSE -#endif - -static WINDOW * -frame_win(FRAME * curp) -{ - return (curp != 0) ? curp->wind : stdscr; -} - -/* We need to know if these flags are actually set, so don't look in FRAME. - * These names are known to work with SVr4 curses as well as ncurses. The - * _use_keypad name does not work with Solaris 8. - */ -static bool -HaveKeypad(FRAME * curp) -{ - WINDOW *win = frame_win(curp); - (void) win; - return is_keypad(win); -} - -static bool -HaveScroll(FRAME * curp) -{ - WINDOW *win = frame_win(curp); - (void) win; - return is_scrollok(win); -} - -static void -newwin_legend(FRAME * curp) -{ - 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 - }, -#if HAVE_WRESIZE - { - "^X = resize", 0 - }, -#endif - { - "^Q%s = exit", 3 - } - }; - 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++) { - switch (legend[n].code) { - default: - strcpy(buf, legend[n].msg); - break; - case 1: - sprintf(buf, legend[n].msg, do_keypad ? "yes" : "no"); - break; - case 2: - sprintf(buf, legend[n].msg, do_scroll ? "yes" : "no"); - break; - case 3: - sprintf(buf, legend[n].msg, do_keypad ? "/ESC" : ""); - break; - } - x = getcurx(stdscr); - addstr((COLS < (x + 3 + (int) strlen(buf))) ? "\n" : (n ? ", " : "")); - addstr(buf); - } - clrtoeol(); -} - -static void -transient(FRAME * curp, NCURSES_CONST char *msg) -{ - newwin_legend(curp); - if (msg) { - MvAddStr(LINES - 1, 0, msg); - refresh(); - napms(1000); - } - - move(LINES - 1, 0); - printw("%s characters are echoed, window should %sscroll.", - HaveKeypad(curp) ? "Non-arrow" : "All other", - HaveScroll(curp) ? "" : "not "); - clrtoeol(); -} - -static void -newwin_report(FRAME * curp) -/* report on the cursor's current position, then restore it */ -{ - WINDOW *win = frame_win(curp); - int y, x; - - if (win != stdscr) - transient(curp, (char *) 0); - getyx(win, y, x); - move(LINES - 1, COLS - 17); - printw("Y = %2d X = %2d", y, x); - if (win != stdscr) - refresh(); - else - wmove(win, y, x); -} - -static pair * -selectcell(int uli, int ulj, int lri, int lrj) -/* arrows keys move cursor, return location at current on non-arrow key */ -{ - static pair res; /* result cell */ - int si = lri - uli + 1; /* depth of the select area */ - int sj = lrj - ulj + 1; /* width of the select area */ - int i = 0, j = 0; /* offsets into the select area */ - - res.y = uli; - res.x = ulj; - for (;;) { - move(uli + i, ulj + j); - newwin_report((FRAME *) 0); - - switch (Getchar()) { - case KEY_UP: - i += si - 1; - break; - case KEY_DOWN: - i++; - break; - case KEY_LEFT: - j += sj - 1; - break; - case KEY_RIGHT: - j++; - break; - case case_QUIT: - return ((pair *) 0); -#ifdef NCURSES_MOUSE_VERSION - case KEY_MOUSE: - { - MEVENT event; - - getmouse(&event); - if (event.y > uli && event.x > ulj) { - i = event.y - uli; - j = event.x - ulj; - } else { - beep(); - break; - } - } - /* FALLTHRU */ -#endif - default: - res.y = uli + i; - res.x = ulj + j; - return (&res); - } - i %= si; - j %= sj; - } -} - -static void -outerbox(pair ul, pair lr, bool onoff) -/* draw or erase a box *outside* the given pair of corners */ -{ - MvAddCh(ul.y - 1, lr.x - 1, onoff ? ACS_ULCORNER : ' '); - MvAddCh(ul.y - 1, lr.x + 1, onoff ? ACS_URCORNER : ' '); - MvAddCh(lr.y + 1, lr.x + 1, onoff ? ACS_LRCORNER : ' '); - MvAddCh(lr.y + 1, ul.x - 1, onoff ? ACS_LLCORNER : ' '); - move(ul.y - 1, ul.x); - hline(onoff ? ACS_HLINE : ' ', lr.x - ul.x + 1); - move(ul.y, ul.x - 1); - vline(onoff ? ACS_VLINE : ' ', lr.y - ul.y + 1); - move(lr.y + 1, ul.x); - hline(onoff ? ACS_HLINE : ' ', lr.x - ul.x + 1); - move(ul.y, lr.x + 1); - vline(onoff ? ACS_VLINE : ' ', lr.y - ul.y + 1); -} - -static WINDOW * -getwindow(void) -/* Ask user for a window definition */ -{ - WINDOW *rwindow; - pair ul, lr, *tmp; - - move(0, 0); - clrtoeol(); - addstr("Use arrows to move cursor, anything else to mark corner 1"); - refresh(); - if ((tmp = selectcell(2, 1, LINES - BOTLINES - 2, COLS - 2)) == (pair *) 0) - return ((WINDOW *) 0); - memcpy(&ul, tmp, sizeof(pair)); - MvAddCh(ul.y - 1, ul.x - 1, ACS_ULCORNER); - move(0, 0); - clrtoeol(); - addstr("Use arrows to move cursor, anything else to mark corner 2"); - refresh(); - if ((tmp = selectcell(ul.y, ul.x, LINES - BOTLINES - 2, COLS - 2)) == - (pair *) 0) - return ((WINDOW *) 0); - memcpy(&lr, tmp, sizeof(pair)); - - rwindow = subwin(stdscr, lr.y - ul.y + 1, lr.x - ul.x + 1, ul.y, ul.x); - - outerbox(ul, lr, TRUE); - refresh(); - - wrefresh(rwindow); - - move(0, 0); - clrtoeol(); - return (rwindow); -} - -static void -newwin_move(FRAME * curp, int dy, int dx) -{ - WINDOW *win = frame_win(curp); - int cur_y, cur_x; - int max_y, max_x; - - getyx(win, cur_y, cur_x); - getmaxyx(win, max_y, max_x); - if ((cur_x += dx) < 0) - cur_x = 0; - else if (cur_x >= max_x) - cur_x = max_x - 1; - if ((cur_y += dy) < 0) - cur_y = 0; - else if (cur_y >= max_y) - cur_y = max_y - 1; - wmove(win, cur_y, cur_x); -} - -static FRAME * -delete_framed(FRAME * fp, bool showit) -{ - FRAME *np = 0; - - if (fp != 0) { - fp->last->next = fp->next; - fp->next->last = fp->last; - - if (showit) { - werase(fp->wind); - wrefresh(fp->wind); - } - delwin(fp->wind); - - np = (fp == fp->next) ? 0 : fp->next; - free(fp); - } - return np; -} - -static void -acs_and_scroll(void) -/* Demonstrate windows */ -{ - int c; - FRAME *current = (FRAME *) 0, *neww; - WINDOW *usescr; -#if HAVE_PUTWIN && HAVE_GETWIN - FILE *fp; -#endif - -#define DUMPFILE "screendump" - -#ifdef NCURSES_MOUSE_VERSION - mousemask(BUTTON1_CLICKED, (mmask_t *) 0); -#endif - c = CTRL('C'); - raw(); - do { - transient((FRAME *) 0, (char *) 0); - switch (c) { - case CTRL('C'): - if ((neww = typeCalloc(FRAME, 1)) == 0) { - goto breakout; - } - if ((neww->wind = getwindow()) == (WINDOW *) 0) { - free(neww); - goto breakout; - } - - if (current == 0) { /* First element, */ - neww->next = neww; /* so point it at itself */ - neww->last = neww; - } else { - neww->next = current->next; - neww->last = current; - neww->last->next = neww; - neww->next->last = neww; - } - current = neww; - /* SVr4 curses sets the keypad on all newly-created windows to - * false. Someone reported that PDCurses makes new windows inherit - * this flag. Remove the following 'keypad()' call to test this - */ - keypad(current->wind, TRUE); - current->do_keypad = HaveKeypad(current); - current->do_scroll = HaveScroll(current); - break; - - case CTRL('N'): /* go to next window */ - if (current) - current = current->next; - break; - - case CTRL('P'): /* go to previous window */ - if (current) - current = current->last; - break; - - case CTRL('F'): /* scroll current window forward */ - if (current) - wscrl(frame_win(current), 1); - break; - - case CTRL('B'): /* scroll current window backwards */ - if (current) - wscrl(frame_win(current), -1); - break; - - case CTRL('K'): /* toggle keypad mode for current */ - if (current) { - current->do_keypad = !current->do_keypad; - keypad(current->wind, current->do_keypad); - } - break; - - case CTRL('S'): - if (current) { - current->do_scroll = !current->do_scroll; - scrollok(current->wind, current->do_scroll); - } - break; - -#if HAVE_PUTWIN && HAVE_GETWIN - case CTRL('W'): /* save and delete window */ - if ((current != 0) && (current == current->next)) { - transient(current, "Will not save/delete ONLY window"); - break; - } else if ((fp = fopen(DUMPFILE, "w")) == (FILE *) 0) { - transient(current, "Can't open screen dump file"); - } else { - (void) putwin(frame_win(current), fp); - (void) fclose(fp); - - current = delete_framed(current, TRUE); - } - break; - - case CTRL('R'): /* restore window */ - if ((fp = fopen(DUMPFILE, "r")) == (FILE *) 0) { - transient(current, "Can't open screen dump file"); - } else { - if ((neww = typeCalloc(FRAME, 1)) != 0) { - - neww->next = current ? current->next : 0; - neww->last = current; - neww->last->next = neww; - neww->next->last = neww; - - neww->wind = getwin(fp); - - wrefresh(neww->wind); - } - (void) fclose(fp); - } - break; -#endif - -#if HAVE_WRESIZE - case CTRL('X'): /* resize window */ - if (current) { - pair *tmp, ul, lr; - int i, mx, my; - - move(0, 0); - clrtoeol(); - addstr("Use arrows to move cursor, anything else to mark new corner"); - refresh(); - - getbegyx(current->wind, ul.y, ul.x); - - tmp = selectcell(ul.y, ul.x, LINES - BOTLINES - 2, COLS - 2); - if (tmp == (pair *) 0) { - beep(); - break; - } - - getmaxyx(current->wind, lr.y, lr.x); - lr.y += (ul.y - 1); - lr.x += (ul.x - 1); - outerbox(ul, lr, FALSE); - wnoutrefresh(stdscr); - - /* strictly cosmetic hack for the test */ - getmaxyx(current->wind, my, mx); - if (my > tmp->y - ul.y) { - getyx(current->wind, lr.y, lr.x); - wmove(current->wind, tmp->y - ul.y + 1, 0); - wclrtobot(current->wind); - wmove(current->wind, lr.y, lr.x); - } - if (mx > tmp->x - ul.x) - 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)); - (void) wresize(current->wind, lr.y - ul.y + 0, lr.x - ul.x + 0); - - getbegyx(current->wind, ul.y, ul.x); - getmaxyx(current->wind, lr.y, lr.x); - lr.y += (ul.y - 1); - lr.x += (ul.x - 1); - outerbox(ul, lr, TRUE); - wnoutrefresh(stdscr); - - wnoutrefresh(current->wind); - move(0, 0); - clrtoeol(); - doupdate(); - } - 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; - case KEY_DOWN: - newwin_move(current, 1, 0); - break; - case KEY_LEFT: - newwin_move(current, 0, -1); - break; - case KEY_RIGHT: - newwin_move(current, 0, 1); - break; - - case KEY_BACKSPACE: - /* FALLTHROUGH */ - case KEY_DC: - { - int y, x; - getyx(frame_win(current), y, x); - if (--x < 0) { - if (--y < 0) - break; - x = getmaxx(frame_win(current)) - 1; - } - (void) mvwdelch(frame_win(current), y, x); - } - break; - - case '\r': - c = '\n'; - /* FALLTHROUGH */ - - default: - if (current) - waddch(current->wind, (chtype) c); - else - beep(); - break; - } - newwin_report(current); - usescr = frame_win(current); - wrefresh(usescr); - } while - (!isQuit(c = wGetchar(usescr)) - && (c != ERR)); - - breakout: - while (current != 0) - current = delete_framed(current, FALSE); - - scrollok(stdscr, TRUE); /* reset to driver's default */ -#ifdef NCURSES_MOUSE_VERSION - mousemask(0, (mmask_t *) 0); -#endif - noraw(); - erase(); - endwin(); -} - -/**************************************************************************** - * - * Panels tester - * - ****************************************************************************/ - -#if USE_LIBPANEL -static int nap_msec = 1; - -static NCURSES_CONST char *mod[] = -{ - "test ", - "TEST ", - "(**) ", - "*()* ", - "<--> ", - "LAST " -}; - -/*+------------------------------------------------------------------------- - wait_a_while(msec) ---------------------------------------------------------------------------*/ -static void -wait_a_while(int msec GCC_UNUSED) -{ -#if HAVE_NAPMS - if (nap_msec == 1) - wGetchar(stdscr); - else - napms(nap_msec); -#else - if (nap_msec == 1) - wGetchar(stdscr); - else if (msec > 1000) - sleep((unsigned) msec / 1000); - else - sleep(1); -#endif -} /* end of wait_a_while */ - -/*+------------------------------------------------------------------------- - saywhat(text) ---------------------------------------------------------------------------*/ -static void -saywhat(NCURSES_CONST char *text) -{ - wmove(stdscr, LINES - 1, 0); - wclrtoeol(stdscr); - if (text != 0 && *text != '\0') { - waddstr(stdscr, text); - waddstr(stdscr, "; "); - } - waddstr(stdscr, "press any key to continue"); -} /* end of saywhat */ - -/*+------------------------------------------------------------------------- - mkpanel(rows,cols,tly,tlx) - alloc a win and panel and associate them ---------------------------------------------------------------------------*/ -static PANEL * -mkpanel(short color, int rows, int cols, int tly, int tlx) -{ - WINDOW *win; - PANEL *pan = 0; - - if ((win = newwin(rows, cols, tly, tlx)) != 0) { - if ((pan = new_panel(win)) == 0) { - delwin(win); - } else if (use_colors) { - short fg = (short) ((color == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK); - short bg = color; - - init_pair(color, fg, bg); - wbkgdset(win, (attr_t) (COLOR_PAIR(color) | ' ')); - } else { - wbkgdset(win, A_BOLD | ' '); - } - } - return pan; -} /* end of mkpanel */ - -/*+------------------------------------------------------------------------- - rmpanel(pan) ---------------------------------------------------------------------------*/ -static void -rmpanel(PANEL * pan) -{ - WINDOW *win = panel_window(pan); - del_panel(pan); - delwin(win); -} /* end of rmpanel */ - -/*+------------------------------------------------------------------------- - pflush() ---------------------------------------------------------------------------*/ -static void -pflush(void) -{ - update_panels(); - doupdate(); -} /* end of pflush */ - -/*+------------------------------------------------------------------------- - fill_panel(win) ---------------------------------------------------------------------------*/ -static void -init_panel(void) -{ - register int y, x; - - for (y = 0; y < LINES - 1; y++) { - for (x = 0; x < COLS; x++) - wprintw(stdscr, "%d", (y + x) % 10); - } -} - -static void -fill_panel(PANEL * pan) -{ - WINDOW *win = panel_window(pan); - const char *userptr = (const char *) panel_userptr(pan); - int num = (userptr && *userptr) ? userptr[1] : '?'; - int y, x; - - wmove(win, 1, 1); - wprintw(win, "-pan%c-", num); - wclrtoeol(win); - box(win, 0, 0); - for (y = 2; y < getmaxy(win) - 1; y++) { - for (x = 1; x < getmaxx(win) - 1; x++) { - wmove(win, y, x); - waddch(win, UChar(num)); - } - } -} - -#if USE_WIDEC_SUPPORT -static void -init_wide_panel(void) -{ - int digit; - cchar_t temp[10]; - - for (digit = 0; digit < 10; ++digit) - make_fullwidth_digit(&temp[digit], digit); - - do { - int y, x; - getyx(stdscr, y, x); - digit = (y + x / 2) % 10; - } while (add_wch(&temp[digit]) != ERR); -} - -static void -fill_wide_panel(PANEL * pan) -{ - WINDOW *win = panel_window(pan); - const char *userptr = (const char *) panel_userptr(pan); - int num = (userptr && *userptr) ? userptr[1] : '?'; - int y, x; - - wmove(win, 1, 1); - wprintw(win, "-pan%c-", num); - wclrtoeol(win); - box(win, 0, 0); - for (y = 2; y < getmaxy(win) - 1; y++) { - for (x = 1; x < getmaxx(win) - 1; x++) { - wmove(win, y, x); - waddch(win, UChar(num)); - } - } -} -#endif - -#define MAX_PANELS 5 - -static void -canned_panel(PANEL * px[MAX_PANELS + 1], NCURSES_CONST char *cmd) -{ - int which = cmd[1] - '0'; - - saywhat(cmd); - switch (*cmd) { - case 'h': - hide_panel(px[which]); - break; - case 's': - show_panel(px[which]); - break; - case 't': - top_panel(px[which]); - break; - case 'b': - bottom_panel(px[which]); - break; - case 'd': - rmpanel(px[which]); - break; - } - pflush(); - wait_a_while(nap_msec); -} - -static void -demo_panels(void (*InitPanel) (void), void (*FillPanel) (PANEL *)) -{ - int count; - int itmp; - PANEL *px[MAX_PANELS + 1]; - - scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */ - refresh(); - - InitPanel(); - for (count = 0; count < 5; count++) { - px[1] = mkpanel(COLOR_RED, - LINES / 2 - 2, - COLS / 8 + 1, - 0, - 0); - set_panel_userptr(px[1], (NCURSES_CONST void *) "p1"); - - px[2] = mkpanel(COLOR_GREEN, - LINES / 2 + 1, - COLS / 7, - LINES / 4, - COLS / 10); - set_panel_userptr(px[2], (NCURSES_CONST void *) "p2"); - - px[3] = mkpanel(COLOR_YELLOW, - LINES / 4, - COLS / 10, - LINES / 2, - COLS / 9); - set_panel_userptr(px[3], (NCURSES_CONST void *) "p3"); - - px[4] = mkpanel(COLOR_BLUE, - LINES / 2 - 2, - COLS / 8, - LINES / 2 - 2, - COLS / 3); - set_panel_userptr(px[4], (NCURSES_CONST void *) "p4"); - - px[5] = mkpanel(COLOR_MAGENTA, - LINES / 2 - 2, - COLS / 8, - LINES / 2, - COLS / 2 - 2); - set_panel_userptr(px[5], (NCURSES_CONST void *) "p5"); - - FillPanel(px[1]); - FillPanel(px[2]); - FillPanel(px[3]); - FillPanel(px[4]); - FillPanel(px[5]); - - hide_panel(px[4]); - hide_panel(px[5]); - pflush(); - saywhat(""); - wait_a_while(nap_msec); - - saywhat("h3 s1 s2 s4 s5"); - move_panel(px[1], 0, 0); - hide_panel(px[3]); - show_panel(px[1]); - show_panel(px[2]); - show_panel(px[4]); - show_panel(px[5]); - pflush(); - wait_a_while(nap_msec); - - canned_panel(px, "s1"); - canned_panel(px, "s2"); - - saywhat("m2"); - move_panel(px[2], LINES / 3 + 1, COLS / 8); - pflush(); - wait_a_while(nap_msec); - - canned_panel(px, "s3"); - - saywhat("m3"); - move_panel(px[3], LINES / 4 + 1, COLS / 15); - pflush(); - wait_a_while(nap_msec); - - canned_panel(px, "b3"); - canned_panel(px, "s4"); - canned_panel(px, "s5"); - canned_panel(px, "t3"); - canned_panel(px, "t1"); - canned_panel(px, "t2"); - canned_panel(px, "t3"); - canned_panel(px, "t4"); - - for (itmp = 0; itmp < 6; itmp++) { - WINDOW *w4 = panel_window(px[4]); - WINDOW *w5 = panel_window(px[5]); - - saywhat("m4"); - wmove(w4, LINES / 8, 1); - waddstr(w4, mod[itmp]); - move_panel(px[4], LINES / 6, itmp * (COLS / 8)); - wmove(w5, LINES / 6, 1); - waddstr(w5, mod[itmp]); - pflush(); - wait_a_while(nap_msec); - - saywhat("m5"); - wmove(w4, LINES / 6, 1); - waddstr(w4, mod[itmp]); - move_panel(px[5], LINES / 3 - 1, (itmp * 10) + 6); - wmove(w5, LINES / 8, 1); - waddstr(w5, mod[itmp]); - pflush(); - wait_a_while(nap_msec); - } - - saywhat("m4"); - move_panel(px[4], LINES / 6, itmp * (COLS / 8)); - pflush(); - wait_a_while(nap_msec); - - canned_panel(px, "t5"); - canned_panel(px, "t2"); - canned_panel(px, "t1"); - canned_panel(px, "d2"); - canned_panel(px, "h3"); - canned_panel(px, "d1"); - canned_panel(px, "d4"); - canned_panel(px, "d5"); - canned_panel(px, "d3"); - - wait_a_while(nap_msec); - if (nap_msec == 1) - break; - nap_msec = 100L; - } - - erase(); - endwin(); -} -#endif /* USE_LIBPANEL */ - -/**************************************************************************** - * - * Pad tester - * - ****************************************************************************/ - -#define GRIDSIZE 3 - -static bool pending_pan = FALSE; -static bool show_panner_legend = TRUE; - -static int -panner_legend(int line) -{ - static const char *const legend[] = - { - "Use arrow keys (or U,D,L,R) to pan, ESC to quit, ! to shell-out.", - "Use +,- (or j,k) to grow/shrink the panner vertically.", - "Use <,> (or h,l) to grow/shrink the panner horizontally.", - "Number repeats. Toggle legend:? filler:a timer:t scrollmark:s." - }; - int n = ((int) SIZEOF(legend) - (LINES - line)); - if (n >= 0) { - if (move(line, 0) != ERR) { - if (show_panner_legend) - printw("%s", legend[n]); - clrtoeol(); - return show_panner_legend; - } - } - return FALSE; -} - -static void -panner_h_cleanup(int from_y, int from_x, int to_x) -{ - if (!panner_legend(from_y)) - do_h_line(from_y, from_x, ' ', to_x); -} - -static void -panner_v_cleanup(int from_y, int from_x, int to_y) -{ - if (!panner_legend(from_y)) - do_v_line(from_y, from_x, ' ', to_y); -} - -static void -fill_pad(WINDOW *panpad, bool pan_lines) -{ - int y, x; - unsigned gridcount = 0; - - wmove(panpad, 0, 0); - for (y = 0; y < getmaxy(panpad); y++) { - for (x = 0; x < getmaxx(panpad); x++) { - if (y % GRIDSIZE == 0 && x % GRIDSIZE == 0) { - if (y == 0 && x == 0) - waddch(panpad, pan_lines ? ACS_ULCORNER : '+'); - else if (y == 0) - waddch(panpad, pan_lines ? ACS_TTEE : '+'); - else if (y == 0 || x == 0) - waddch(panpad, pan_lines ? ACS_LTEE : '+'); - else - waddch(panpad, (chtype) ((pan_lines ? 'a' : 'A') + - (int) (gridcount++ % 26))); - } else if (y % GRIDSIZE == 0) - waddch(panpad, pan_lines ? ACS_HLINE : '-'); - else if (x % GRIDSIZE == 0) - waddch(panpad, pan_lines ? ACS_VLINE : '|'); - else - waddch(panpad, ' '); - } - } -} - -static void -panner(WINDOW *pad, - int top_x, int top_y, int porty, int portx, - int (*pgetc) (WINDOW *)) -{ -#if HAVE_GETTIMEOFDAY - struct timeval before, after; - bool timing = TRUE; -#endif - bool pan_lines = FALSE; - bool scrollers = TRUE; - int basex = 0; - int basey = 0; - int pxmax, pymax, lowend, highend, c; - - getmaxyx(pad, pymax, pxmax); - scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */ - - c = KEY_REFRESH; - do { -#ifdef NCURSES_VERSION - /* - * During shell-out, the user may have resized the window. Adjust - * the port size of the pad to accommodate this. Ncurses automatically - * resizes all of the normal windows to fit on the new screen. - */ - if (top_x > COLS) - top_x = COLS; - if (portx > COLS) - portx = COLS; - if (top_y > LINES) - top_y = LINES; - if (porty > LINES) - porty = LINES; -#endif - switch (c) { - case KEY_REFRESH: - erase(); - - /* FALLTHRU */ - case '?': - if (c == '?') - show_panner_legend = !show_panner_legend; - panner_legend(LINES - 4); - panner_legend(LINES - 3); - panner_legend(LINES - 2); - panner_legend(LINES - 1); - break; - case 'a': - pan_lines = !pan_lines; - fill_pad(pad, pan_lines); - pending_pan = FALSE; - break; - -#if HAVE_GETTIMEOFDAY - case 't': - timing = !timing; - if (!timing) - panner_legend(LINES - 1); - break; -#endif - case 's': - scrollers = !scrollers; - break; - - /* Move the top-left corner of the pad, keeping the bottom-right - * corner fixed. - */ - case 'h': /* increase-columns: move left edge to left */ - if (top_x <= 0) - beep(); - else { - panner_v_cleanup(top_y, top_x, porty); - top_x--; - } - break; - - case 'j': /* decrease-lines: move top-edge down */ - if (top_y >= porty) - beep(); - else { - panner_h_cleanup(top_y - 1, top_x - (top_x > 0), portx); - top_y++; - } - break; - - case 'k': /* increase-lines: move top-edge up */ - if (top_y <= 0) - beep(); - else { - top_y--; - panner_h_cleanup(top_y, top_x, portx); - } - break; - - case 'l': /* decrease-columns: move left-edge to right */ - if (top_x >= portx) - beep(); - else { - panner_v_cleanup(top_y - (top_y > 0), top_x - 1, porty); - top_x++; - } - break; - - /* Move the bottom-right corner of the pad, keeping the top-left - * corner fixed. - */ - case KEY_IC: /* increase-columns: move right-edge to right */ - if (portx >= pxmax || portx >= COLS) - beep(); - else { - panner_v_cleanup(top_y - (top_y > 0), portx - 1, porty); - ++portx; - } - break; - - case KEY_IL: /* increase-lines: move bottom-edge down */ - if (porty >= pymax || porty >= LINES) - beep(); - else { - panner_h_cleanup(porty - 1, top_x - (top_x > 0), portx); - ++porty; - } - break; - - case KEY_DC: /* decrease-columns: move bottom edge up */ - if (portx <= top_x) - beep(); - else { - portx--; - panner_v_cleanup(top_y - (top_y > 0), portx, porty); - } - break; - - case KEY_DL: /* decrease-lines */ - if (porty <= top_y) - beep(); - else { - porty--; - panner_h_cleanup(porty, top_x - (top_x > 0), portx); - } - break; - - case KEY_LEFT: /* pan leftwards */ - if (basex > 0) - basex--; - else - beep(); - break; - - case KEY_RIGHT: /* pan rightwards */ - if (basex + portx - (pymax > porty) < pxmax) - basex++; - else - beep(); - break; - - case KEY_UP: /* pan upwards */ - if (basey > 0) - basey--; - else - beep(); - break; - - case KEY_DOWN: /* pan downwards */ - if (basey + porty - (pxmax > portx) < pymax) - basey++; - else - beep(); - break; - - case 'H': - case KEY_HOME: - case KEY_FIND: - basey = 0; - break; - - case 'E': - case KEY_END: - case KEY_SELECT: - basey = pymax - porty; - if (basey < 0) - basey = 0; - break; - - default: - beep(); - break; - } - - MvAddCh(top_y - 1, top_x - 1, ACS_ULCORNER); - do_v_line(top_y, top_x - 1, ACS_VLINE, porty); - do_h_line(top_y - 1, top_x, ACS_HLINE, portx); - - if (scrollers && (pxmax > portx - 1)) { - int length = (portx - top_x - 1); - float ratio = ((float) length) / ((float) pxmax); - - lowend = (int) ((float) top_x + ((float) basex * ratio)); - highend = (int) ((float) top_x + ((float) (basex + length) * ratio)); - - do_h_line(porty - 1, top_x, ACS_HLINE, lowend); - if (highend < portx) { - attron(A_REVERSE); - do_h_line(porty - 1, lowend, ' ', highend + 1); - attroff(A_REVERSE); - do_h_line(porty - 1, highend + 1, ACS_HLINE, portx); - } - } else - do_h_line(porty - 1, top_x, ACS_HLINE, portx); - - if (scrollers && (pymax > porty - 1)) { - int length = (porty - top_y - 1); - float ratio = ((float) length) / ((float) pymax); - - lowend = (int) ((float) top_y + ((float) basey * ratio)); - highend = (int) ((float) top_y + ((float) (basey + length) * ratio)); - - do_v_line(top_y, portx - 1, ACS_VLINE, lowend); - if (highend < porty) { - attron(A_REVERSE); - do_v_line(lowend, portx - 1, ' ', highend + 1); - attroff(A_REVERSE); - do_v_line(highend + 1, portx - 1, ACS_VLINE, porty); - } - } else - do_v_line(top_y, portx - 1, ACS_VLINE, porty); - - MvAddCh(top_y - 1, portx - 1, ACS_URCORNER); - MvAddCh(porty - 1, top_x - 1, ACS_LLCORNER); - MvAddCh(porty - 1, portx - 1, ACS_LRCORNER); - - if (!pending_pan) { -#if HAVE_GETTIMEOFDAY - gettimeofday(&before, 0); -#endif - wnoutrefresh(stdscr); - - pnoutrefresh(pad, - basey, basex, - top_y, top_x, - porty - (pxmax > portx) - 1, - portx - (pymax > porty) - 1); - - doupdate(); -#if HAVE_GETTIMEOFDAY -#define TIMEVAL2S(data) ((double) data.tv_sec + ((double) data.tv_usec / 1.0e6)) - if (timing) { - double elapsed; - gettimeofday(&after, 0); - elapsed = (TIMEVAL2S(after) - TIMEVAL2S(before)); - move(LINES - 1, COLS - 12); - printw("Secs: %2.03f", elapsed); - refresh(); - } -#endif - } - - } while - ((c = pgetc(pad)) != KEY_EXIT); - - scrollok(stdscr, TRUE); /* reset to driver's default */ -} - -static int -padgetch(WINDOW *win) -{ - static int count; - static int last; - int c; - - if ((pending_pan = (count > 0)) != FALSE) { - count--; - pending_pan = (count != 0); - } else { - for (;;) { - switch (c = wGetchar(win)) { - case '!': - ShellOut(FALSE); - /* FALLTHRU */ - case CTRL('r'): - endwin(); - refresh(); - c = KEY_REFRESH; - break; - case CTRL('l'): - c = KEY_REFRESH; - break; - case 'U': - c = KEY_UP; - break; - case 'D': - c = KEY_DOWN; - break; - case 'R': - c = KEY_RIGHT; - break; - case 'L': - c = KEY_LEFT; - break; - case '+': - c = KEY_IL; - break; - case '-': - c = KEY_DL; - break; - case '>': - c = KEY_IC; - break; - case '<': - c = KEY_DC; - break; - case ERR: /* FALLTHRU */ - case case_QUIT: - count = 0; - c = KEY_EXIT; - break; - default: - if (c >= '0' && c <= '9') { - count = count * 10 + (c - '0'); - continue; - } - break; - } - last = c; - break; - } - if (count > 0) - count--; - } - return (last); -} - -#define PAD_HIGH 200 -#define PAD_WIDE 200 - -static void -demo_pad(void) -/* Demonstrate pads. */ -{ - WINDOW *panpad = newpad(PAD_HIGH, PAD_WIDE); - - if (panpad == 0) { - Cannot("cannot create requested pad"); - return; - } - - fill_pad(panpad, FALSE); - - panner_legend(LINES - 4); - panner_legend(LINES - 3); - panner_legend(LINES - 2); - panner_legend(LINES - 1); - - keypad(panpad, TRUE); - - /* Make the pad (initially) narrow enough that a trace file won't wrap. - * 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); - - delwin(panpad); - endwin(); - erase(); -} - -/**************************************************************************** - * - * Tests from John Burnell's PDCurses tester - * - ****************************************************************************/ - -static void -Continue(WINDOW *win) -{ - noecho(); - wmove(win, 10, 1); - MvWAddStr(win, 10, 1, " Press any key to continue"); - wrefresh(win); - wGetchar(win); -} - -static void -flushinp_test(WINDOW *win) -/* Input test, adapted from John Burnell's PDCurses tester */ -{ - int w, h, bx, by, sw, sh, i; - - WINDOW *subWin; - wclear(win); - - getmaxyx(win, h, w); - getbegyx(win, by, bx); - sw = w / 3; - sh = h / 3; - if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == 0) - return; - -#ifdef A_COLOR - if (use_colors) { - init_pair(2, COLOR_CYAN, COLOR_BLUE); - wbkgd(subWin, COLOR_PAIR(2) | ' '); - } -#endif - (void) wattrset(subWin, A_BOLD); - box(subWin, ACS_VLINE, ACS_HLINE); - MvWAddStr(subWin, 2, 1, "This is a subwindow"); - wrefresh(win); - - /* - * This used to set 'nocbreak()'. However, Alexander Lukyanov says that - * it only happened to "work" on SVr4 because that implementation does not - * emulate nocbreak+noecho mode, whereas ncurses does. To get the desired - * test behavior, we're using 'cbreak()', which will allow a single - * character to return without needing a newline. - T.Dickey 1997/10/11. - */ - cbreak(); - MvWAddStr(win, 0, 1, "This is a test of the flushinp() call."); - - MvWAddStr(win, 2, 1, "Type random keys for 5 seconds."); - MvWAddStr(win, 3, 1, - "These should be discarded (not echoed) after the subwindow goes away."); - wrefresh(win); - - for (i = 0; i < 5; i++) { - MvWPrintw(subWin, 1, 1, "Time = %d", i); - wrefresh(subWin); - napms(1000); - flushinp(); - } - - delwin(subWin); - werase(win); - flash(); - wrefresh(win); - napms(1000); - - MvWAddStr(win, 2, 1, - "If you were still typing when the window timer expired,"); - MvWAddStr(win, 3, 1, - "or else you typed nothing at all while it was running,"); - MvWAddStr(win, 4, 1, - "test was invalid. You'll see garbage or nothing at all. "); - MvWAddStr(win, 6, 1, "Press a key"); - wmove(win, 9, 10); - wrefresh(win); - echo(); - wGetchar(win); - flushinp(); - MvWAddStr(win, 12, 0, - "If you see any key other than what you typed, flushinp() is broken."); - Continue(win); - - wmove(win, 9, 10); - wdelch(win); - wrefresh(win); - wmove(win, 12, 0); - clrtoeol(); - waddstr(win, - "What you typed should now have been deleted; if not, wdelch() failed."); - Continue(win); - - cbreak(); -} - -/**************************************************************************** - * - * Menu test - * - ****************************************************************************/ - -#if USE_LIBMENU - -#define MENU_Y 8 -#define MENU_X 8 - -static int -menu_virtualize(int c) -{ - if (c == '\n' || c == KEY_EXIT) - return (MAX_COMMAND + 1); - else if (c == 'u') - return (REQ_SCR_ULINE); - else if (c == 'd') - return (REQ_SCR_DLINE); - else if (c == 'b' || c == KEY_NPAGE) - return (REQ_SCR_UPAGE); - else if (c == 'f' || c == KEY_PPAGE) - return (REQ_SCR_DPAGE); - else if (c == 'n' || c == KEY_DOWN) - return (REQ_NEXT_ITEM); - else if (c == 'p' || c == KEY_UP) - return (REQ_PREV_ITEM); - else if (c == ' ') - return (REQ_TOGGLE_ITEM); - else { - if (c != KEY_MOUSE) - beep(); - return (c); - } -} - -static CONST_MENUS char *animals[] = -{ - "Lions", - "Tigers", - "Bears", - "(Oh my!)", - "Newts", - "Platypi", - "Lemurs", - "(Oh really?!)", - "Leopards", - "Panthers", - "Pumas", - "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", - "Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs, Lions, Tigers, Bears, (Oh my!), Newts, Platypi, Lemurs", - (char *) 0 -}; - -static void -menu_test(void) -{ - MENU *m; - ITEM *items[SIZEOF(animals)]; - ITEM **ip = items; - CONST_MENUS char **ap; - int mrows, mcols, c; - WINDOW *menuwin; - -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif - MvAddStr(0, 0, "This is the menu test:"); - MvAddStr(2, 0, " Use up and down arrow to move the select bar."); - MvAddStr(3, 0, " 'n' and 'p' act like arrows."); - MvAddStr(4, 0, - " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line)."); - MvAddStr(5, 0, " Press return to exit."); - refresh(); - - for (ap = animals; *ap; ap++) { - if ((*ip = new_item(*ap, "")) != 0) - ++ip; - } - *ip = (ITEM *) 0; - - m = new_menu(items); - - set_menu_format(m, (SIZEOF(animals) + 1) / 2, 1); - scale_menu(m, &mrows, &mcols); - - menuwin = newwin(mrows + 2, mcols + 2, MENU_Y, MENU_X); - set_menu_win(m, menuwin); - keypad(menuwin, TRUE); - box(menuwin, 0, 0); - - set_menu_sub(m, derwin(menuwin, mrows, mcols, 1, 1)); - - post_menu(m); - - while ((c = menu_driver(m, menu_virtualize(wGetchar(menuwin)))) != E_UNKNOWN_COMMAND) { - if (c == E_NOT_POSTED) - break; - if (c == E_REQUEST_DENIED) - beep(); - continue; - } - - MvPrintw(LINES - 2, 0, - "You chose: %s\n", item_name(current_item(m))); - (void) addstr("Press any key to continue..."); - wGetchar(stdscr); - - unpost_menu(m); - delwin(menuwin); - - free_menu(m); - for (ip = items; *ip; ip++) - free_item(*ip); -#ifdef NCURSES_MOUSE_VERSION - mousemask(0, (mmask_t *) 0); -#endif -} - -#ifdef TRACE -#define T_TBL(name) { #name, name } -static struct { - const char *name; - unsigned mask; -} t_tbl[] = { - - T_TBL(TRACE_DISABLE), - T_TBL(TRACE_TIMES), - T_TBL(TRACE_TPUTS), - T_TBL(TRACE_UPDATE), - T_TBL(TRACE_MOVE), - T_TBL(TRACE_CHARPUT), - T_TBL(TRACE_ORDINARY), - T_TBL(TRACE_CALLS), - T_TBL(TRACE_VIRTPUT), - T_TBL(TRACE_IEVENT), - T_TBL(TRACE_BITS), - T_TBL(TRACE_ICALLS), - T_TBL(TRACE_CCALLS), - T_TBL(TRACE_DATABASE), - T_TBL(TRACE_ATTRS), - T_TBL(TRACE_MAXIMUM), - { - (char *) 0, 0 - } -}; - -static char * -tracetrace(unsigned tlevel) -{ - static char *buf; - 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); - } - sprintf(buf, "0x%02x = {", tlevel); - if (tlevel == 0) { - sprintf(buf + strlen(buf), "%s, ", t_tbl[0].name); - } 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, ", "); - } - } - if (buf[strlen(buf) - 2] == ',') - buf[strlen(buf) - 2] = '\0'; - return (strcat(buf, "}")); -} - -/* fake a dynamically reconfigurable menu using the 0th entry to deselect - * the others - */ -static int -run_trace_menu(MENU * m) -{ - ITEM **items; - ITEM *i, **p; - - for (;;) { - bool changed = FALSE; - switch (menu_driver(m, menu_virtualize(wGetchar(menu_win(m))))) { - case E_UNKNOWN_COMMAND: - return FALSE; - default: - items = menu_items(m); - i = current_item(m); - if (i == items[0]) { - if (item_value(i)) { - for (p = items + 1; *p != 0; p++) - if (item_value(*p)) { - set_item_value(*p, FALSE); - changed = TRUE; - } - } - } else { - for (p = items + 1; *p != 0; p++) - if (item_value(*p)) { - set_item_value(items[0], FALSE); - changed = TRUE; - break; - } - } - if (!changed) - return TRUE; - } - } -} - -static void -trace_set(void) -/* interactively set the trace level */ -{ - MENU *m; - ITEM *items[SIZEOF(t_tbl)]; - ITEM **ip = items; - int mrows, mcols; - unsigned newtrace; - int n; - WINDOW *menuwin; - - MvAddStr(0, 0, "Interactively set trace level:"); - MvAddStr(2, 0, " Press space bar to toggle a selection."); - MvAddStr(3, 0, " Use up and down arrow to move the select bar."); - MvAddStr(4, 0, " Press return to set the trace level."); - MvPrintw(6, 0, "(Current trace level is %s)", tracetrace(_nc_tracing)); - - refresh(); - - for (n = 0; t_tbl[n].name != 0; n++) { - if ((*ip = new_item(t_tbl[n].name, "")) != 0) { - ++ip; - } - } - *ip = (ITEM *) 0; - - m = new_menu(items); - - set_menu_format(m, 0, 2); - scale_menu(m, &mrows, &mcols); - - menu_opts_off(m, O_ONEVALUE); - menuwin = newwin(mrows + 2, mcols + 2, MENU_Y, MENU_X); - set_menu_win(m, menuwin); - keypad(menuwin, TRUE); - box(menuwin, 0, 0); - - set_menu_sub(m, derwin(menuwin, mrows, mcols, 1, 1)); - - post_menu(m); - - for (ip = menu_items(m); *ip; ip++) { - unsigned mask = t_tbl[item_index(*ip)].mask; - if (mask == 0) - set_item_value(*ip, _nc_tracing == 0); - else if ((mask & _nc_tracing) == mask) - set_item_value(*ip, TRUE); - } - - while (run_trace_menu(m)) - continue; - - newtrace = 0; - for (ip = menu_items(m); *ip; ip++) - if (item_value(*ip)) - newtrace |= t_tbl[item_index(*ip)].mask; - trace(newtrace); - Trace(("trace level interactively set to %s", tracetrace(_nc_tracing))); - - MvPrintw(LINES - 2, 0, - "Trace level is %s\n", tracetrace(_nc_tracing)); - (void) addstr("Press any key to continue..."); - wGetchar(stdscr); - - unpost_menu(m); - delwin(menuwin); - - free_menu(m); - for (ip = items; *ip; ip++) - free_item(*ip); -} -#endif /* TRACE */ -#endif /* USE_LIBMENU */ - -/**************************************************************************** - * - * Forms test - * - ****************************************************************************/ -#if USE_LIBFORM -static FIELD * -make_label(int frow, int fcol, NCURSES_CONST char *label) -{ - FIELD *f = new_field(1, (int) strlen(label), frow, fcol, 0, 0); - - if (f) { - set_field_buffer(f, 0, label); - set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE)); - } - return (f); -} - -static FIELD * -make_field(int frow, int fcol, int rows, int cols, bool secure) -{ - FIELD *f = new_field(rows, cols, frow, fcol, 0, secure ? 1 : 0); - - if (f) { - set_field_back(f, A_UNDERLINE); - set_field_userptr(f, (void *) 0); - } - return (f); -} - -static void -display_form(FORM * f) -{ - WINDOW *w; - int rows, cols; - - scale_form(f, &rows, &cols); - - if ((w = newwin(rows + 2, cols + 4, 0, 0)) != (WINDOW *) 0) { - set_form_win(f, w); - set_form_sub(f, derwin(w, rows, cols, 1, 2)); - box(w, 0, 0); - keypad(w, TRUE); - } - - if (post_form(f) != E_OK) - wrefresh(w); -} - -static void -erase_form(FORM * f) -{ - WINDOW *w = form_win(f); - WINDOW *s = form_sub(f); - - unpost_form(f); - werase(w); - wrefresh(w); - delwin(s); - delwin(w); -} - -static int -edit_secure(FIELD * me, int c) -{ - int rows, cols, frow, fcol, nrow, nbuf; - - if (field_info(me, &rows, &cols, &frow, &fcol, &nrow, &nbuf) == E_OK - && nbuf > 0) { - char *source = field_buffer(me, 1); - char temp[80]; - long len; - - strcpy(temp, source ? source : ""); - len = (long) (char *) field_userptr(me); - if (c <= KEY_MAX) { - if (isgraph(c) && (len + 1) < (int) sizeof(temp)) { - temp[len++] = (char) c; - temp[len] = 0; - set_field_buffer(me, 1, temp); - c = '*'; - } else { - c = 0; - } - } else { - switch (c) { - case REQ_BEG_FIELD: - case REQ_CLR_EOF: - case REQ_CLR_EOL: - case REQ_DEL_LINE: - case REQ_DEL_WORD: - case REQ_DOWN_CHAR: - case REQ_END_FIELD: - case REQ_INS_CHAR: - case REQ_INS_LINE: - case REQ_LEFT_CHAR: - case REQ_NEW_LINE: - case REQ_NEXT_WORD: - case REQ_PREV_WORD: - case REQ_RIGHT_CHAR: - case REQ_UP_CHAR: - c = 0; /* we don't want to do inline editing */ - break; - case REQ_CLR_FIELD: - if (len) { - temp[0] = 0; - set_field_buffer(me, 1, temp); - } - break; - case REQ_DEL_CHAR: - case REQ_DEL_PREV: - if (len) { - temp[--len] = 0; - set_field_buffer(me, 1, temp); - } - break; - } - } - set_field_userptr(me, (void *) len); - } - return c; -} - -static int -form_virtualize(FORM * f, WINDOW *w) -{ - /* *INDENT-OFF* */ - static const struct { - int code; - int result; - } lookup[] = { - { CTRL('A'), REQ_NEXT_CHOICE }, - { CTRL('B'), REQ_PREV_WORD }, - { CTRL('C'), REQ_CLR_EOL }, - { CTRL('D'), REQ_DOWN_FIELD }, - { CTRL('E'), REQ_END_FIELD }, - { CTRL('F'), REQ_NEXT_PAGE }, - { CTRL('G'), REQ_DEL_WORD }, - { CTRL('H'), REQ_DEL_PREV }, - { CTRL('I'), REQ_INS_CHAR }, - { CTRL('K'), REQ_CLR_EOF }, - { CTRL('L'), REQ_LEFT_FIELD }, - { CTRL('M'), REQ_NEW_LINE }, - { CTRL('N'), REQ_NEXT_FIELD }, - { CTRL('O'), REQ_INS_LINE }, - { CTRL('P'), REQ_PREV_FIELD }, - { CTRL('R'), REQ_RIGHT_FIELD }, - { CTRL('S'), REQ_BEG_FIELD }, - { CTRL('U'), REQ_UP_FIELD }, - { CTRL('V'), REQ_DEL_CHAR }, - { CTRL('W'), REQ_NEXT_WORD }, - { CTRL('X'), REQ_CLR_FIELD }, - { CTRL('Y'), REQ_DEL_LINE }, - { CTRL('Z'), REQ_PREV_CHOICE }, - { ESCAPE, MAX_FORM_COMMAND + 1 }, - { KEY_BACKSPACE, REQ_DEL_PREV }, - { KEY_DOWN, REQ_DOWN_CHAR }, - { KEY_END, REQ_LAST_FIELD }, - { KEY_HOME, REQ_FIRST_FIELD }, - { KEY_LEFT, REQ_LEFT_CHAR }, - { KEY_LL, REQ_LAST_FIELD }, - { KEY_NEXT, REQ_NEXT_FIELD }, - { KEY_NPAGE, REQ_NEXT_PAGE }, - { KEY_PPAGE, REQ_PREV_PAGE }, - { KEY_PREVIOUS, REQ_PREV_FIELD }, - { KEY_RIGHT, REQ_RIGHT_CHAR }, - { KEY_UP, REQ_UP_CHAR }, - { QUIT, MAX_FORM_COMMAND + 1 } - }; - /* *INDENT-ON* */ - - static int mode = REQ_INS_MODE; - int c = wGetchar(w); - unsigned n; - FIELD *me = current_field(f); - bool current = TRUE; - - if (c == CTRL(']')) { - if (mode == REQ_INS_MODE) { - mode = REQ_OVL_MODE; - } else { - mode = REQ_INS_MODE; - } - c = mode; - } else { - for (n = 0; n < SIZEOF(lookup); n++) { - if (lookup[n].code == c) { - c = lookup[n].result; - break; - } - } - } - MvPrintw(0, COLS - 6, "(%s)", mode == REQ_INS_MODE ? "INS" : "OVL"); - - /* - * Force the field that the user is typing into to be in reverse video, - * while the other fields are shown underlined. - */ - switch (c) { - case REQ_BEG_FIELD: - case REQ_CLR_EOF: - case REQ_CLR_EOL: - case REQ_CLR_FIELD: - case REQ_DEL_CHAR: - case REQ_DEL_LINE: - case REQ_DEL_PREV: - case REQ_DEL_WORD: - case REQ_END_FIELD: - case REQ_INS_CHAR: - case REQ_INS_LINE: - case REQ_LEFT_CHAR: - case REQ_LEFT_FIELD: - case REQ_NEXT_WORD: - case REQ_RIGHT_CHAR: - current = TRUE; - break; - default: - current = (c < KEY_MAX); - break; - } - if (current) { - c = edit_secure(me, c); - set_field_back(me, A_REVERSE); - } else { - c = edit_secure(me, c); - set_field_back(me, A_UNDERLINE); - } - return c; -} - -static int -my_form_driver(FORM * form, int c) -{ - if (c == (MAX_FORM_COMMAND + 1) - && form_driver(form, REQ_VALIDATION) == E_OK) - return (TRUE); - else { - beep(); - return (FALSE); - } -} - -#ifdef NCURSES_VERSION -#define FIELDCHECK_CB(func) bool func(FIELD * fld, const void * data GCC_UNUSED) -#define CHAR_CHECK_CB(func) bool func(int ch, const void *data GCC_UNUSED) -#else -#define FIELDCHECK_CB(func) int func(FIELD * fld, char * data GCC_UNUSED) -#define CHAR_CHECK_CB(func) int func(int ch, char *data GCC_UNUSED) -#endif - -/* - * Allow a middle initial, optionally with a '.' to end it. - */ -static -FIELDCHECK_CB(mi_field_check) -{ - char *s = field_buffer(fld, 0); - int state = 0; - int n; - - for (n = 0; s[n] != '\0'; ++n) { - switch (state) { - case 0: - if (s[n] == '.') { - if (n != 1) - return FALSE; - state = 2; - } else if (isspace(UChar(s[n]))) { - state = 2; - } - break; - case 2: - if (!isspace(UChar(s[n]))) - return FALSE; - break; - } - } - - /* force the form to display a leading capital */ - if (islower(UChar(s[0]))) { - s[0] = (char) toupper(UChar(s[0])); - set_field_buffer(fld, 0, s); - } - return TRUE; -} - -static -CHAR_CHECK_CB(mi_char_check) -{ - return ((isalpha(ch) || ch == '.') ? TRUE : FALSE); -} - -/* - * Passwords should be at least 6 characters. - */ -static -FIELDCHECK_CB(pw_field_check) -{ - char *s = field_buffer(fld, 0); - int n; - - for (n = 0; s[n] != '\0'; ++n) { - if (isspace(UChar(s[n]))) { - if (n < 6) - return FALSE; - } - } - return TRUE; -} - -static -CHAR_CHECK_CB(pw_char_check) -{ - return (isgraph(ch) ? TRUE : FALSE); -} - -static void -demo_forms(void) -{ - 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; - unsigned n = 0; - -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif - - move(18, 0); - addstr("Defined edit/traversal keys: ^Q/ESC- exit form\n"); - addstr("^N -- go to next field ^P -- go to previous field\n"); - addstr("Home -- go to first field End -- go to last field\n"); - addstr("^L -- go to field to left ^R -- go to field to right\n"); - addstr("^U -- move upward to field ^D -- move downward to field\n"); - addstr("^W -- go to next word ^B -- go to previous word\n"); - addstr("^S -- go to start of field ^E -- go to end of field\n"); - addstr("^H -- delete previous char ^Y -- delete line\n"); - addstr("^G -- delete current word ^C -- clear to end of line\n"); - addstr("^K -- clear to end of field ^X -- clear field\n"); - addstr("Arrow keys move within a field as you would expect. ^] toggles overlay mode."); - - MvAddStr(4, 57, "Forms Entry Test"); - - refresh(); - - /* describe the form */ - memset(f, 0, sizeof(f)); - f[n++] = make_label(0, 15, "Sample Form"); - - f[n++] = make_label(2, 0, "Last Name"); - f[n++] = make_field(3, 0, 1, 18, FALSE); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - - f[n++] = make_label(2, 20, "First Name"); - f[n++] = make_field(3, 20, 1, 12, FALSE); - set_field_type(f[n - 1], TYPE_ALPHA, 1); - - f[n++] = make_label(2, 34, "Middle Name"); - f[n++] = make_field(3, 34, 1, 12, FALSE); - set_field_type(f[n - 1], fty_middle); - - f[n++] = make_label(5, 0, "Comments"); - f[n++] = make_field(6, 0, 4, 46, FALSE); - - f[n++] = make_label(5, 20, "Password:"); - secure = - f[n++] = make_field(5, 30, 1, 9, TRUE); - set_field_type(f[n - 1], fty_passwd); - f[n] = (FIELD *) 0; - - if ((form = new_form(f)) != 0) { - - display_form(form); - - w = form_win(form); - raw(); - nonl(); /* lets us read ^M's */ - while (!finished) { - switch (form_driver(form, c = form_virtualize(form, w))) { - case E_OK: - MvAddStr(5, 57, field_buffer(secure, 1)); - clrtoeol(); - refresh(); - break; - case E_UNKNOWN_COMMAND: - finished = my_form_driver(form, c); - break; - default: - beep(); - break; - } - } - - erase_form(form); - - free_form(form); - } - for (c = 0; f[c] != 0; c++) - free_field(f[c]); - free_fieldtype(fty_middle); - free_fieldtype(fty_passwd); - noraw(); - nl(); - -#ifdef NCURSES_MOUSE_VERSION - mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0); -#endif -} -#endif /* USE_LIBFORM */ - -/**************************************************************************** - * - * Overlap test - * - ****************************************************************************/ - -static void -fillwin(WINDOW *win, char ch) -{ - int y, x; - int y1, x1; - - getmaxyx(win, y1, x1); - for (y = 0; y < y1; y++) { - wmove(win, y, 0); - for (x = 0; x < x1; x++) - waddch(win, UChar(ch)); - } -} - -static void -crosswin(WINDOW *win, char ch) -{ - int y, x; - int y1, x1; - - 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)))) { - wmove(win, y, x); - waddch(win, UChar(ch)); - } - } -} - -#define OVERLAP_FLAVORS 5 - -static void -overlap_helpitem(int state, int item, char *message) -{ - int row = (item / 2); - int col = ((item % 2) ? COLS / 2 : 0); - - move(LINES - 6 + row, col); - printw("%c%c = %s", state == row ? '>' : ' ', 'a' + item, message); - clrtoeol(); -} - -static void -overlap_test_1_attr(WINDOW *win, int flavor, int col) -{ - short cpair = (short) (1 + (flavor * 2) + col); - - switch (flavor) { - case 0: - (void) wattrset(win, A_NORMAL); - break; - case 1: - (void) wattrset(win, A_BOLD); - break; - case 2: - init_pair(cpair, COLOR_BLUE, COLOR_WHITE); - (void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_NORMAL); - break; - case 3: - init_pair(cpair, COLOR_WHITE, COLOR_BLUE); - (void) wattrset(win, (attr_t) COLOR_PAIR(cpair) | A_BOLD); - break; - } -} - -static void -overlap_test_2_attr(WINDOW *win, int flavor, int col) -{ - short cpair = (short) (9 + (flavor * 2) + col); - - switch (flavor) { - case 0: - /* no effect */ - break; - case 1: - /* no effect */ - break; - case 2: - init_pair(cpair, COLOR_RED, COLOR_GREEN); - wbkgdset(win, colored_chtype(' ', A_BLINK, cpair)); - break; - case 3: - wbkgdset(win, ' ' | A_NORMAL); - break; - } -} - -static int -overlap_help(int state, int flavors[OVERLAP_FLAVORS]) -{ - int row; - int col; - int item; - const char *ths, *tht; - char msg[80]; - - if (state < 0) - state += OVERLAP_FLAVORS; - state = state % 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: - flavors[row] = 0; - sprintf(msg, "refresh %s, then %s, then doupdate.", ths, tht); - break; - case 1: - if (use_colors) { - flavors[row] %= 4; - } else { - flavors[row] %= 2; - } - 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); - break; - case 1: - sprintf(msg, "draw box in window %s.", ths); - break; - case 2: - sprintf(msg, "set background of window %s.", ths); - break; - case 3: - sprintf(msg, "reset background of window %s.", ths); - break; - } - break; - case 3: - 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); - break; - case 1: - sprintf(msg, "copywin(FALSE) %s onto %s.", ths, tht); - break; - case 2: - sprintf(msg, "copywin(TRUE) %s onto %s.", ths, tht); - break; - case 3: - sprintf(msg, "overlay %s onto %s.", ths, tht); - break; - } - break; - } - overlap_helpitem(state, item, msg); - (void) wattrset(stdscr, A_NORMAL); - wbkgdset(stdscr, ' ' | A_NORMAL); - } - move(LINES - 1, 0); - printw("^Q/ESC = terminate test. Up/down/space select test variations (%d %d).", - state, flavors[state]); - - return state; -} - -static void -overlap_test_0(WINDOW *a, WINDOW *b) -{ - touchwin(a); - touchwin(b); - wnoutrefresh(a); - wnoutrefresh(b); - doupdate(); -} - -static void -overlap_test_1(int flavor, int col, WINDOW *a, char fill) -{ - overlap_test_1_attr(a, flavor, col); - fillwin(a, fill); - (void) wattrset(a, A_NORMAL); -} - -static void -overlap_test_2(int flavor, int col, WINDOW *a, char fill) -{ - overlap_test_2_attr(a, flavor, col); - switch (flavor) { - case 0: - crosswin(a, fill); - break; - case 1: - box(a, 0, 0); - break; - case 2: - /* done in overlap_test_2_attr */ - break; - case 3: - /* done in overlap_test_2_attr */ - break; - } -} - -static void -overlap_test_3(WINDOW *a) -{ - wclear(a); - wmove(a, 0, 0); -} - -static void -overlap_test_4(int flavor, WINDOW *a, WINDOW *b) -{ - switch (flavor) { - case 0: - overwrite(a, b); - break; - case 1: - copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), FALSE); - break; - case 2: - copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), TRUE); - break; - case 3: - overlay(a, b); - break; - } -} - -/* test effects of overlapping windows */ -static void -overlap_test(void) -{ - int ch; - int state, flavor[OVERLAP_FLAVORS]; - - WINDOW *win1 = newwin(9, 20, 3, 3); - WINDOW *win2 = newwin(9, 20, 9, 16); - - 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"); - - memset(flavor, 0, sizeof(flavor)); - state = overlap_help(0, flavor); - - while (!isQuit(ch = Getchar())) - switch (ch) { - case 'a': /* refresh window A first, then B */ - overlap_test_0(win1, win2); - break; - - case 'b': /* refresh window B first, then A */ - overlap_test_0(win2, win1); - break; - - case 'c': /* fill window A so it's visible */ - overlap_test_1(flavor[1], 0, win1, 'A'); - break; - - case 'd': /* fill window B so it's visible */ - overlap_test_1(flavor[1], 1, win2, 'B'); - break; - - case 'e': /* cross test pattern in window A */ - overlap_test_2(flavor[2], 0, win1, 'A'); - break; - - case 'f': /* cross test pattern in window A */ - overlap_test_2(flavor[2], 1, win2, 'B'); - break; - - case 'g': /* clear window A */ - overlap_test_3(win1); - break; - - case 'h': /* clear window B */ - overlap_test_3(win2); - break; - - case 'i': /* overwrite A onto B */ - overlap_test_4(flavor[4], win1, win2); - break; - - case 'j': /* overwrite B onto A */ - overlap_test_4(flavor[4], win2, win1); - break; - - 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 '?': - state = overlap_help(state, flavor); - break; - - default: - beep(); - break; - } - - delwin(win2); - delwin(win1); - erase(); - curs_set(1); - endwin(); -} - -/**************************************************************************** - * - * Main sequence - * - ****************************************************************************/ - -static bool -do_single_test(const char c) -/* perform a single specified test */ -{ - switch (c) { - case 'a': - getch_test(); - break; - -#if USE_WIDEC_SUPPORT - case 'A': - get_wch_test(); - break; -#endif - - case 'b': - attr_test(); - break; - -#if USE_WIDEC_SUPPORT - case 'B': - wide_attr_test(); - break; -#endif - - case 'c': - if (!use_colors) - Cannot("does not support color."); - else - color_test(); - break; - -#if USE_WIDEC_SUPPORT - case 'C': - if (!use_colors) - Cannot("does not support color."); - else - wide_color_test(); - 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(); - break; - -#if USE_SOFTKEYS - case 'e': - slk_test(); - break; - -#if USE_WIDEC_SUPPORT - case 'E': - wide_slk_test(); - break; -#endif -#endif - - case 'f': - acs_display(); - break; - -#if USE_WIDEC_SUPPORT - case 'F': - wide_acs_display(); - break; -#endif - -#if USE_LIBPANEL - case 'o': - demo_panels(init_panel, fill_panel); - break; -#endif - -#if USE_WIDEC_SUPPORT && USE_LIBPANEL - case 'O': - demo_panels(init_wide_panel, fill_wide_panel); - break; -#endif - - case 'g': - acs_and_scroll(); - break; - - case 'i': - flushinp_test(stdscr); - break; - - case 'k': - test_sgr_attributes(); - break; - -#if USE_LIBMENU - case 'm': - menu_test(); - break; -#endif - - case 'p': - demo_pad(); - break; - -#if USE_LIBFORM - case 'r': - demo_forms(); - break; -#endif - - case 's': - overlap_test(); - break; - -#if USE_LIBMENU && defined(TRACE) - case 't': - trace_set(); - break; -#endif - - case '?': - break; - - default: - return FALSE; - } - - return TRUE; -} - -static void -usage(void) -{ - static const char *const tbl[] = - { - "Usage: ncurses [options]" - ,"" - ,"Options:" -#ifdef NCURSES_VERSION - ," -a f,b set default-colors (assumed white-on-black)" - ," -d use default-colors if terminal supports them" -#endif -#if USE_SOFTKEYS - ," -e fmt specify format for soft-keys test (e)" -#endif -#if HAVE_RIPOFFLINE - ," -f rip-off footer line (can repeat)" - ," -h rip-off header line (can repeat)" -#endif - ," -m do not use colors" - ," -p file rgb values to use in 'd' rather than ncurses's builtin" -#if USE_LIBPANEL - ," -s msec specify nominal time for panel-demo (default: 1, to hold)" -#endif -#ifdef TRACE - ," -t mask specify default trace-level (may toggle with ^T)" -#endif - }; - size_t n; - for (n = 0; n < SIZEOF(tbl); n++) - fprintf(stderr, "%s\n", tbl[n]); - ExitProgram(EXIT_FAILURE); -} - -static void -set_terminal_modes(void) -{ - noraw(); - cbreak(); - noecho(); - scrollok(stdscr, TRUE); - idlok(stdscr, TRUE); - keypad(stdscr, TRUE); -} - -#ifdef SIGUSR1 -static RETSIGTYPE -announce_sig(int sig) -{ - (void) fprintf(stderr, "Handled signal %d\r\n", sig); -} -#endif - -#if HAVE_RIPOFFLINE -static int -rip_footer(WINDOW *win, int cols) -{ - wbkgd(win, A_REVERSE); - werase(win); - wmove(win, 0, 0); - wprintw(win, "footer: window %p, %d columns", (void *) win, cols); - wnoutrefresh(win); - return OK; -} - -static int -rip_header(WINDOW *win, int cols) -{ - wbkgd(win, A_REVERSE); - werase(win); - wmove(win, 0, 0); - wprintw(win, "header: window %p, %d columns", (void *) win, cols); - wnoutrefresh(win); - return OK; -} -#endif /* HAVE_RIPOFFLINE */ - -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"); -#endif - (void) puts("c = color test pattern"); -#if USE_WIDEC_SUPPORT - (void) puts("C = color test pattern using wide-character calls"); -#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"); -#endif - (void) puts("g = display windows and scrolling"); - (void) puts("i = test of flushinp()"); - (void) puts("k = display character attributes"); -#if USE_LIBMENU - (void) puts("m = menu code test"); -#endif -#if USE_LIBPANEL - (void) puts("o = exercise panels library"); -#if USE_WIDEC_SUPPORT - (void) puts("O = exercise panels with wide-characters"); -#endif -#endif - (void) puts("p = exercise pad features"); - (void) puts("q = quit"); -#if USE_LIBFORM - (void) puts("r = exercise forms code"); -#endif - (void) puts("s = overlapping-refresh test"); -#if USE_LIBMENU && defined(TRACE) - (void) puts("t = set trace level"); -#endif - (void) puts("? = repeat this command summary"); - - (void) fputs("> ", stdout); - (void) fflush(stdout); /* necessary under SVr4 curses */ - - /* - * This used to be an 'fgets()' call (until 1996/10). However with - * some runtime libraries, mixing stream I/O and 'read()' causes the - * input stream to be flushed when switching between the two. - */ - command = 0; - for (;;) { - char ch = '\0'; - if (read(fileno(stdin), &ch, 1) <= 0) { - if (command == 0) - command = 'q'; - break; - } else if (command == 0 && !isspace(UChar(ch))) { - command = ch; - } else if (ch == '\n' || ch == '\r') { - if ((command == 'd') && !top) { - (void) fputs("Do not nest test-d\n", stdout); - command = 0; - } - if (command != 0) - break; - (void) fputs("> ", stdout); - (void) fflush(stdout); - } - } - - if (do_single_test(command)) { - /* - * This may be overkill; it's intended to reset everything back - * to the initial terminal modes so that tests don't get in - * each other's way. - */ - flushinp(); - set_terminal_modes(); - reset_prog_mode(); - clear(); - refresh(); - endwin(); - if (command == '?') { - (void) puts("This is the ncurses capability tester."); - (void) - puts("You may select a test from the main menu by typing the"); - (void) - puts("key letter of the choice (the letter to left of the =)"); - (void) - puts("at the > prompt. Type `q' to exit."); - } - continue; - } - } while - (command != 'q'); -} - -/*+------------------------------------------------------------------------- - 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 - int default_fg = COLOR_WHITE; - int default_bg = COLOR_BLACK; - bool assumed_colors = FALSE; - bool default_colors = FALSE; -#endif - char *palette_file = 0; - bool monochrome = FALSE; - - setlocale(LC_ALL, ""); - - while ((c = getopt(argc, argv, "a:de:fhmp:s:t:")) != -1) { - switch (c) { -#ifdef NCURSES_VERSION - case 'a': - assumed_colors = TRUE; - sscanf(optarg, "%d,%d", &default_fg, &default_bg); - break; - case 'd': - default_colors = TRUE; - break; -#endif - case 'e': - my_e_param = atoi(optarg); -#ifdef NCURSES_VERSION - if (my_e_param > 3) /* allow extended layouts */ - usage(); -#else - if (my_e_param > 1) - usage(); -#endif - break; -#if HAVE_RIPOFFLINE - case 'f': - ripoffline(-1, rip_footer); - break; - case 'h': - ripoffline(1, rip_header); - break; -#endif /* HAVE_RIPOFFLINE */ - case 'm': - monochrome = TRUE; - break; - case 'p': - palette_file = optarg; - break; -#if USE_LIBPANEL - case 's': - nap_msec = (int) atol(optarg); - break; -#endif -#ifdef TRACE - case 't': - save_trace = (unsigned) strtol(optarg, 0, 0); - break; -#endif - default: - usage(); - } - } - - /* - * If there's no menus (unlikely for ncurses!), then we'll have to set - * tracing on initially, just in case the user wants to test something that - * doesn't involve wGetchar. - */ -#ifdef TRACE - /* enable debugging */ -#if !USE_LIBMENU - trace(save_trace); -#else - if (!isatty(fileno(stdin))) - trace(save_trace); -#endif /* USE_LIBMENU */ -#endif /* TRACE */ - -#if USE_SOFTKEYS - /* tell it we're going to play with soft keys */ - slk_init(my_e_param); -#endif - -#ifdef SIGUSR1 - /* set up null signal catcher so we can see what interrupts to getch do */ - signal(SIGUSR1, announce_sig); -#endif - - /* we must initialize the curses data structure only once */ - initscr(); - bkgdset(BLANK); - - /* tests, in general, will want these modes */ - use_colors = monochrome ? FALSE : has_colors(); - - if (use_colors) { - start_color(); -#ifdef NCURSES_VERSION_PATCH - max_colors = COLORS; /* was > 16 ? 16 : COLORS */ -#if HAVE_USE_DEFAULT_COLORS - if (default_colors) { - use_default_colors(); - min_colors = -1; - } -#if NCURSES_VERSION_PATCH >= 20000708 - if (assumed_colors) - assume_default_colors(default_fg, default_bg); -#endif -#endif -#else /* normal SVr4 curses */ - max_colors = COLORS; /* was > 8 ? 8 : COLORS */ -#endif - max_pairs = COLOR_PAIRS; /* was > 256 ? 256 : COLOR_PAIRS */ - - if (can_change_color()) { - short cp; - all_colors = typeMalloc(RGB_DATA, (unsigned) max_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)) { - all_colors[c].red = (short) ((red * 1000) / scale); - all_colors[c].green = (short) ((green * 1000) / scale); - all_colors[c].blue = (short) ((blue * 1000) / scale); - } - } - fclose(fp); - } - } - } - } - set_terminal_modes(); - def_prog_mode(); - - /* - * Return to terminal mode, so we're guaranteed of being able to - * select terminal commands even if the capabilities are wrong. - */ - endwin(); - -#if HAVE_CURSES_VERSION - (void) printf("Welcome to %s. Press ? for help.\n", curses_version()); -#elif defined(NCURSES_VERSION_MAJOR) && defined(NCURSES_VERSION_MINOR) && defined(NCURSES_VERSION_PATCH) - (void) printf("Welcome to ncurses %d.%d.%d. Press ? for help.\n", - NCURSES_VERSION_MAJOR, - NCURSES_VERSION_MINOR, - NCURSES_VERSION_PATCH); -#else - (void) puts("Welcome to ncurses. Press ? for help."); -#endif - - main_menu(TRUE); - - ExitProgram(EXIT_SUCCESS); -} - -/* ncurses.c ends here */ diff --git a/test/ncurses_tst.hin b/test/ncurses_tst.hin deleted file mode 100644 index 1d77cbd3fee..00000000000 --- a/test/ncurses_tst.hin +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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 * - * "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 1998 * - ****************************************************************************/ -/* - * $Id: ncurses_tst.hin,v 1.2 1998/02/11 12:14:05 tom Exp $ - * - * This is a template-file used to generate the "ncurses_cfg.h" file. - * - * Rather than list every definition, the configuration script substitutes - * the definitions that it finds using 'sed'. You need a patch (971222) - * to autoconf 2.12 to do this. - */ -#ifndef NC_CONFIG_H -#define NC_CONFIG_H -@DEFS@ - - /* The C compiler may not treat these properly but C++ has to */ -#ifdef __cplusplus -#undef const -#undef inline -#else -#if defined(lint) || defined(TRACE) -#undef inline -#define inline /* nothing */ -#endif -#endif - -#endif /* NC_CONFIG_H */ diff --git a/test/newdemo.c b/test/newdemo.c deleted file mode 100644 index 75626a9051e..00000000000 --- a/test/newdemo.c +++ /dev/null @@ -1,358 +0,0 @@ -/* - * newdemo.c - A demo program using PDCurses. The program illustrate - * the use of colours for text output. - * - * $Id: newdemo.c,v 1.35 2010/12/12 00:19:15 tom Exp $ - */ - -#include - -#include - -/* - * The Australian map - */ -static CONST_MENUS char *AusMap[16] = -{ - " A A ", - " N.T. AAAAA AAAA ", - " AAAAAAAAAAA AAAAAAAA ", - " AAAAAAAAAAAAAAAAAAAAAAAAA Qld.", - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", - "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", - " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ", - " AAAAAAAAAAAAAAAAAAAAAAAAA N.S.W.", - "W.A. AAAAAAAAA AAAAAA Vic.", - " AAA S.A. AA", - " A Tas.", - "" -}; - -/* - * Funny messages - */ -#define NMESSAGES 6 - -static const char *messages[] = -{ - "Hello from the Land Down Under", - "The Land of crocs. and a big Red Rock", - "Where the sunflower runs along the highways", - "the dusty red roads lead one to loneliness", - "Blue sky in the morning and", - "freezing nights and twinkling stars", - "" -}; - -/* - * Trap interrupt - */ -static RETSIGTYPE -trap(int sig GCC_UNUSED) -{ - endwin(); - ExitProgram(EXIT_FAILURE); -} - -/* - * Wait for user - */ -static int -WaitForUser(WINDOW *win) -{ - time_t t; - chtype key; - - nodelay(win, TRUE); - t = time((time_t *) 0); - while (1) { - if ((int) (key = (chtype) wgetch(win)) != ERR) { - if (key == 'q' || key == 'Q') - return 1; - else - return 0; - } - if (time((time_t *) 0) - t > 5) - return 0; - } -} - -static void -set_colors(WINDOW *win, int pair, int foreground, int background) -{ - if (has_colors()) { - if (pair > COLOR_PAIRS) - pair = COLOR_PAIRS; - init_pair((short) pair, (short) foreground, (short) background); - (void) wattrset(win, (attr_t) COLOR_PAIR(pair)); - } -} - -static chtype -use_colors(WINDOW *win, int pair, chtype attrs) -{ - if (has_colors()) { - if (pair > COLOR_PAIRS) - pair = COLOR_PAIRS; - attrs |= (chtype) COLOR_PAIR(pair); - } - (void) wattrset(win, attrs); - return attrs; -} - -/* - * Test sub windows - */ -static int -SubWinTest(WINDOW *win) -{ - int w, h, sw, sh, bx, by; - WINDOW *swin1, *swin2, *swin3; - - getmaxyx(win, h, w); - getbegyx(win, by, bx); - sw = w / 3; - sh = h / 3; - if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL) - return 1; - if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL) - return 1; - if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL) - return 1; - - set_colors(swin1, 8, COLOR_RED, COLOR_BLUE); - werase(swin1); - MvWAddStr(swin1, 0, 3, "Sub-window 1"); - wrefresh(swin1); - - set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA); - werase(swin2); - MvWAddStr(swin2, 0, 3, "Sub-window 2"); - wrefresh(swin2); - - set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN); - werase(swin3); - MvWAddStr(swin3, 0, 3, "Sub-window 3"); - wrefresh(swin3); - - delwin(swin1); - delwin(swin2); - delwin(swin3); - WaitForUser(win); - return 0; -} - -static int -bounce(int n, int *dir, int len) -{ - if (*dir > 0) - ++n; - else - --n; - if (n <= 1 || n >= len - 2) - *dir = *dir ? 0 : 1; - return n; -} - -/* - * Bouncing balls - */ -static int -BouncingBalls(WINDOW *win) -{ - int w, h; - int x1, y1, xd1, yd1; - int x2, y2, xd2, yd2; - int x3, y3, xd3, yd3; - - getmaxyx(win, h, w); - - x1 = 2 + rand() % (w - 4); - y1 = 2 + rand() % (h - 4); - x2 = 2 + rand() % (w - 4); - y2 = 2 + rand() % (h - 4); - x3 = 2 + rand() % (w - 4); - y3 = 2 + rand() % (h - 4); - - xd1 = 1; - yd1 = 1; - xd2 = 1; - yd2 = 0; - xd3 = 0; - yd3 = 1; - - nodelay(win, TRUE); - - while (wgetch(win) == ERR) { - x1 = bounce(x1, &xd1, w); - y1 = bounce(y1, &yd1, h); - x2 = bounce(x2, &xd2, w); - y2 = bounce(y2, &yd2, h); - x3 = bounce(x3, &xd3, w); - y3 = bounce(y3, &yd3, h); - - set_colors(win, 11, COLOR_RED, COLOR_BLUE); - MvWAddCh(win, y1, x1, 'O'); - - set_colors(win, 12, COLOR_BLUE, COLOR_RED); - MvWAddCh(win, y2, x2, '*'); - - set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE); - MvWAddCh(win, y3, x3, '@'); - - wmove(win, 0, 0); - wrefresh(win); - delay_output(100); - } - return 0; -} - -/* - * Main driver - */ -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - WINDOW *win; - int w, x, y, i, j, k; - char buffer[200]; - const char *message; - int width, height; - chtype save[80]; - chtype c; - - setlocale(LC_ALL, ""); - - CATCHALL(trap); - - initscr(); - if (has_colors()) - start_color(); - cbreak(); - curs_set(0); - width = 48; - height = 14; /* Create a drawing window */ - win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); - if (win == NULL) { - endwin(); - ExitProgram(EXIT_FAILURE); - } - - while (1) { - set_colors(win, 1, COLOR_WHITE, COLOR_BLUE); - werase(win); - - set_colors(win, 2, COLOR_RED, COLOR_RED); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - /* Do ramdom output of a character */ - use_colors(win, 1, A_NORMAL); - c = 'a'; - for (i = 0; i < 5000; ++i) { - x = rand() % (width - 2) + 1; - y = rand() % (height - 2) + 1; - MvWAddCh(win, y, x, c); - wrefresh(win); - nodelay(win, TRUE); - if (wgetch(win) != ERR) - break; - if (i == 2000) { - c = 'b'; - set_colors(win, 3, COLOR_CYAN, COLOR_YELLOW); - } - } - - SubWinTest(win); - /* Erase and draw green window */ - set_colors(win, 4, COLOR_YELLOW, COLOR_GREEN); - wbkgd(win, use_colors(win, 4, A_BOLD)); - werase(win); - wrefresh(win); - /* Draw RED bounding box */ - use_colors(win, 2, A_NORMAL); - box(win, ' ', ' '); - wrefresh(win); - /* Display Australia map */ - use_colors(win, 4, A_BOLD); - i = 0; - while (*AusMap[i]) { - MvWAddStr(win, i + 1, 8, AusMap[i]); - wrefresh(win); - delay_output(50); - ++i; - } - - set_colors(win, 5, COLOR_BLUE, COLOR_WHITE); - use_colors(win, 5, A_BLINK); - MvWAddStr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix"); - wrefresh(win); - - /* Draw running messages */ - set_colors(win, 6, COLOR_YELLOW, COLOR_WHITE); - message = messages[j = 0]; - i = 1; - w = width - 2; - strcpy(buffer, message); - while (j < NMESSAGES) { - while ((int) strlen(buffer) < w) { - strcat(buffer, " ... "); - strcat(buffer, messages[++j % NMESSAGES]); - } - - if (i < w) - (void) mvwaddnstr(win, height / 2, w - i, buffer, i); - else - (void) mvwaddnstr(win, height / 2, 1, buffer, w); - - wrefresh(win); - nodelay(win, TRUE); - if (wgetch(win) != ERR) { - flushinp(); - break; - } - if (i++ >= w) { - for (k = 0; (buffer[k] = buffer[k + 1]) != '\0'; k++) ; - } - delay_output(100); - } - - j = 0; - /* Draw running As across in RED */ - set_colors(win, 7, COLOR_RED, COLOR_GREEN); - memset(save, ' ', sizeof(save)); - for (i = 2; i < width - 4; ++i) { - k = (int) mvwinch(win, 4, i); - if (k == ERR) - break; - save[j++] = c = (chtype) k; - c &= A_CHARTEXT; - MvWAddCh(win, 4, i, c); - } - wrefresh(win); - - /* Put a message up wait for a key */ - i = height - 2; - use_colors(win, 5, A_NORMAL); - MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit "); - wrefresh(win); - - if (WaitForUser(win) == 1) - break; - - j = 0; /* Restore the old line */ - for (i = 2; i < width - 4; ++i) - MvWAddCh(win, 4, i, save[j++]); - wrefresh(win); - - BouncingBalls(win); - /* Put a message up wait for a key */ - i = height - 2; - use_colors(win, 5, A_NORMAL); - MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit "); - wrefresh(win); - if (WaitForUser(win) == 1) - break; - } - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/package/debian/compat b/test/package/debian/compat deleted file mode 100644 index 7ed6ff82de6..00000000000 --- a/test/package/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/test/package/debian/control b/test/package/debian/control deleted file mode 100644 index 520ad422ee9..00000000000 --- a/test/package/debian/control +++ /dev/null @@ -1,16 +0,0 @@ -Source: ncurses-examples -Maintainer: Thomas E. Dickey -Section: misc -Priority: optional -Standards-Version: 3.8.4 -Build-Depends: debhelper (>= 5) -Homepage: http://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 - These are the example/test programs from the ncurses distribution. - . - This package installs in "bin/ncurses-examples" to avoid conflict with other - packages. diff --git a/test/package/debian/copyright b/test/package/debian/copyright deleted file mode 100644 index e681a6bd58a..00000000000 --- a/test/package/debian/copyright +++ /dev/null @@ -1,69 +0,0 @@ -Upstream source http://invisible-island.net/ncurses/ncurses-examples.html - -Current ncurses maintainer: Thomas Dickey - -------------------------------------------------------------------------------- - Copyright (c) 1998-2010,2011 Free 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. -------------------------------------------------------------------------------- - -Files: install-sh -Copyright: 1994 X Consortium -Licence: other-BSD - 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' diff --git a/test/package/debian/docs b/test/package/debian/docs deleted file mode 100644 index e845566c06f..00000000000 --- a/test/package/debian/docs +++ /dev/null @@ -1 +0,0 @@ -README diff --git a/test/package/debian/rules b/test/package/debian/rules deleted file mode 100755 index 4d4146b8c98..00000000000 --- a/test/package/debian/rules +++ /dev/null @@ -1,90 +0,0 @@ -#!/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) - -CFLAGS = - -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=$(DEB_HOST_GNU_TYPE) \ - --build=$(DEB_BUILD_GNU_TYPE) \ - --bindir=\$${prefix}/bin/ncurses-examples \ - --prefix=/usr \ - --with-ncursesw \ - --disable-rpath-hack - - 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=$(CURDIR)/debian/ncurses-examples - - 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/source/format b/test/package/debian/source/format deleted file mode 100644 index 89ae9db8f88..00000000000 --- a/test/package/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/test/package/debian/watch b/test/package/debian/watch deleted file mode 100644 index 1d080986daf..00000000000 --- a/test/package/debian/watch +++ /dev/null @@ -1,4 +0,0 @@ -version=3 - -opts=passive ftp://invisible-island.net/ncurses-examples/ncurses-examples-([\d.]+)\.tgz \ - debian uupdate diff --git a/test/package/ncurses-examples.spec b/test/package/ncurses-examples.spec deleted file mode 100644 index ad79e5a2218..00000000000 --- a/test/package/ncurses-examples.spec +++ /dev/null @@ -1,55 +0,0 @@ -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.2 2011/03/25 17:46:44 tom Exp $ -Name: %{AppProgram} -Version: %{AppVersion} -Release: %{AppRelease} -License: MIT -Group: Applications/Development -URL: ftp://invisible-island.net/%{AppProgram} -Source0: %{AppProgram}-%{AppRelease}.tgz -Packager: Thomas Dickey - -%description -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 -packages. -%prep - -%setup -q -n %{AppProgram}-%{AppRelease} - -%build - -INSTALL_PROGRAM='${INSTALL}' \ - ./configure \ - --target %{_target_platform} \ - --prefix=%{_prefix} \ - --bindir=%{_bindir}/%{AppProgram} \ - --with-ncursesw \ - --disable-rpath-hack - -make - -%install -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -make install DESTDIR=$RPM_BUILD_ROOT - -strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram}/* - -%clean -[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%{_bindir}/%{AppProgram}/* - -%changelog -# each patch should add its ChangeLog entries here - -* Fri Mar 25 2010 Thomas Dickey -- initial version diff --git a/test/programs b/test/programs deleted file mode 100644 index bfcc134eb9c..00000000000 --- a/test/programs +++ /dev/null @@ -1,93 +0,0 @@ -# $Id: programs,v 1.19 2009/09/12 19:44:01 tom Exp $ -############################################################################## -# Copyright (c) 2006-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 "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 -# -# programs used for ncurses tests -background $(LDFLAGS_CURSES) $(LOCAL_LIBS) background -blue $(LDFLAGS_CURSES) $(LOCAL_LIBS) blue -bs $(LDFLAGS_CURSES) $(LOCAL_LIBS) bs -cardfile $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) cardfile -chgat $(LDFLAGS_CURSES) $(LOCAL_LIBS) chgat -clip_printw $(LDFLAGS_CURSES) $(LOCAL_LIBS) clip_printw -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_keyok $(LDFLAGS_CURSES) $(LOCAL_LIBS) demo_keyok -demo_menus $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_menus -demo_panels $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) demo_panels -demo_termcap $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_termcap -demo_terminfo $(LDFLAGS_TINFO) $(LOCAL_LIBS) demo_terminfo -ditto $(LDFLAGS_THREADS) $(LOCAL_LIBS) ditto -dots $(LDFLAGS_TINFO) $(LOCAL_LIBS) dots -dots_mvcur $(LDFLAGS_CURSES) $(LOCAL_LIBS) dots_mvcur -echochar $(LDFLAGS_CURSES) $(LOCAL_LIBS) echochar -filter $(LDFLAGS_CURSES) $(LOCAL_LIBS) filter -firework $(LDFLAGS_CURSES) $(LOCAL_LIBS) firework -firstlast $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) firstlast -foldkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) foldkeys -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 -ins_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) ins_wide -insdelln $(LDFLAGS_CURSES) $(LOCAL_LIBS) insdelln -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 -lrtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) lrtest -movewindow $(LDFLAGS_CURSES) $(LOCAL_LIBS) movewindow -ncurses $(LDFLAGS_DEFAULT) $(LOCAL_LIBS) ncurses -newdemo $(LDFLAGS_CURSES) $(LOCAL_LIBS) newdemo -railroad $(LDFLAGS_TINFO) $(LOCAL_LIBS) railroad -rain $(LDFLAGS_THREADS) $(LOCAL_LIBS) rain -redraw $(LDFLAGS_CURSES) $(LOCAL_LIBS) redraw -savescreen $(LDFLAGS_CURSES) $(LOCAL_LIBS) savescreen -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_instr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_instr -test_inwstr $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_inwstr -test_opaque $(LDFLAGS_CURSES) $(LOCAL_LIBS) test_opaque -testaddch $(LDFLAGS_CURSES) $(LOCAL_LIBS) testaddch -testcurs $(LDFLAGS_CURSES) $(LOCAL_LIBS) testcurs -testscanw $(LDFLAGS_CURSES) $(LOCAL_LIBS) testscanw -view $(LDFLAGS_CURSES) $(LOCAL_LIBS) view -worm $(LDFLAGS_THREADS) $(LOCAL_LIBS) worm -xmas $(LDFLAGS_CURSES) $(LOCAL_LIBS) xmas - -# vile:makemode diff --git a/test/railroad.c b/test/railroad.c deleted file mode 100644 index 973ec46a38d..00000000000 --- a/test/railroad.c +++ /dev/null @@ -1,254 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2000-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 * - * "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 - 2000 - * - * $Id: railroad.c,v 1.19 2009/10/24 21:37:56 tom Exp $ - * - * A simple demo of the termcap interface. - */ -#define USE_TINFO -#include - -#if HAVE_TGETENT - -static char *wipeit; -static char *moveit; -static int length; -static int height; - -static char *finisC; -static char *finisS; -static char *finisU; - -static char *startC; -static char *startS; -static char *startU; - -static char *backup; - -static bool interrupted = FALSE; - -static int -outc(TPUTS_ARG c) -{ - int rc = OK; - - if (interrupted) { - char tmp = (char) c; - if (write(STDOUT_FILENO, &tmp, 1) == -1) - rc = ERR; - } else { - if (putc(c, stdout) == EOF) - rc = ERR; - } - return rc; -} - -static void -PutChar(int ch) -{ - putchar(ch); - fflush(stdout); - napms(moveit ? 10 : 50); /* not really termcap... */ -} - -static void -Backup(void) -{ - tputs(backup != 0 ? backup : "\b", 1, outc); -} - -static void -MyShowCursor(int flag) -{ - if (startC != 0 && finisC != 0) { - tputs(flag ? startC : finisC, 1, outc); - } -} - -static void -StandOut(int flag) -{ - if (startS != 0 && finisS != 0) { - tputs(flag ? startS : finisS, 1, outc); - } -} - -static void -Underline(int flag) -{ - if (startU != 0 && finisU != 0) { - tputs(flag ? startU : finisU, 1, outc); - } -} - -static void -ShowSign(char *string) -{ - char *base = string; - int ch, first, last; - - if (moveit != 0) { - tputs(tgoto(moveit, 0, height - 1), 1, outc); - tputs(wipeit, 1, outc); - } - - while (*string != 0) { - ch = *string; - if (ch != ' ') { - if (moveit != 0) { - for (first = length - 2; first >= (string - base); first--) { - if (first < length - 1) { - tputs(tgoto(moveit, first + 1, height - 1), 1, outc); - PutChar(' '); - } - tputs(tgoto(moveit, first, height - 1), 1, outc); - PutChar(ch); - } - } else { - last = ch; - if (isalpha(ch)) { - first = isupper(ch) ? 'A' : 'a'; - } else if (isdigit(ch)) { - first = '0'; - } else { - first = ch; - } - if (first < last) { - Underline(1); - while (first < last) { - PutChar(first); - Backup(); - first++; - } - Underline(0); - } - } - if (moveit != 0) - Backup(); - } - StandOut(1); - PutChar(ch); - StandOut(0); - fflush(stdout); - string++; - } - if (moveit != 0) - tputs(wipeit, 1, outc); - putchar('\n'); -} - -static void -cleanup(void) -{ - Underline(0); - StandOut(0); - MyShowCursor(1); -} - -static void -onsig(int n GCC_UNUSED) -{ - interrupted = TRUE; - cleanup(); - ExitProgram(EXIT_FAILURE); -} - -static void -railroad(char **args) -{ - NCURSES_CONST char *name = getenv("TERM"); - char buffer[1024]; - char area[1024], *ap = area; - - if (name == 0) - name = "dumb"; - if (tgetent(buffer, name) >= 0) { - - wipeit = tgetstr("ce", &ap); - height = tgetnum("li"); - length = tgetnum("co"); - moveit = tgetstr("cm", &ap); - - if (wipeit == 0 - || moveit == 0 - || height <= 0 - || length <= 0) { - wipeit = 0; - moveit = 0; - height = 0; - length = 0; - } - - startS = tgetstr("so", &ap); - finisS = tgetstr("se", &ap); - - startU = tgetstr("us", &ap); - finisU = tgetstr("ue", &ap); - - backup = tgetstr("le", &ap); - - startC = tgetstr("ve", &ap); - finisC = tgetstr("vi", &ap); - - MyShowCursor(0); - - CATCHALL(onsig); - - while (*args) { - ShowSign(*args++); - } - MyShowCursor(1); - } -} - -int -main(int argc, char *argv[]) -{ - if (argc > 1) { - railroad(argv + 1); - } else { - static char world[] = "Hello World"; - static char *hello[] = - {world, 0}; - railroad(hello); - } - ExitProgram(EXIT_SUCCESS); -} - -#else -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - printf("This program requires termcap\n"); - exit(EXIT_FAILURE); -} -#endif diff --git a/test/rain.c b/test/rain.c deleted file mode 100644 index 5f0cbfa301a..00000000000 --- a/test/rain.c +++ /dev/null @@ -1,390 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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: rain.c,v 1.38 2010/11/13 20:11:46 tom Exp $ - */ -#include - -/* rain 11/3/1980 EPS/CITHEP */ - -#ifdef USE_PTHREADS -#include -#endif - -WANT_USE_WINDOW(); - -#define MAX_THREADS 10 -#define MAX_DROP 5 - -struct DATA; - -typedef void (*DrawPart) (struct DATA *); - -typedef struct DATA { - int y, x; -#ifdef USE_PTHREADS - DrawPart func; - int state; -#endif -} DATA; - -#ifdef USE_PTHREADS -pthread_cond_t cond_next_drop; -pthread_mutex_t mutex_next_drop; -static int used_threads; - -typedef struct { - pthread_t myself; - long counter; -} STATS; - -static STATS drop_threads[MAX_THREADS]; -#endif - -static void -onsig(int n GCC_UNUSED) -{ - curs_set(1); - endwin(); - ExitProgram(EXIT_FAILURE); -} - -static double -ranf(void) -{ - long r = (rand() & 077777); - return ((double) r / 32768.); -} - -static int -random_x(void) -{ - return (int) (((double) (COLS - 4) * ranf()) + 2); -} - -static int -random_y(void) -{ - return (int) (((double) (LINES - 4) * ranf()) + 2); -} - -static int -next_j(int j) -{ - if (j == 0) - j = MAX_DROP - 1; - else - --j; - if (has_colors()) { - int z = (int) (3 * ranf()); - chtype color = (chtype) COLOR_PAIR(z); - if (z) - color |= A_BOLD; - (void) attrset(color); - } - return j; -} - -static void -part1(DATA * drop) -{ - MvAddCh(drop->y, drop->x, '.'); -} - -static void -part2(DATA * drop) -{ - MvAddCh(drop->y, drop->x, 'o'); -} - -static void -part3(DATA * drop) -{ - MvAddCh(drop->y, drop->x, 'O'); -} - -static void -part4(DATA * drop) -{ - MvAddCh(drop->y - 1, drop->x, '-'); - MvAddStr(drop->y, drop->x - 1, "|.|"); - MvAddCh(drop->y + 1, drop->x, '-'); -} - -static void -part5(DATA * drop) -{ - MvAddCh(drop->y - 2, drop->x, '-'); - MvAddStr(drop->y - 1, drop->x - 1, "/ \\"); - MvAddStr(drop->y, drop->x - 2, "| O |"); - MvAddStr(drop->y + 1, drop->x - 1, "\\ /"); - MvAddCh(drop->y + 2, drop->x, '-'); -} - -static void -part6(DATA * drop) -{ - MvAddCh(drop->y - 2, drop->x, ' '); - MvAddStr(drop->y - 1, drop->x - 1, " "); - MvAddStr(drop->y, drop->x - 2, " "); - MvAddStr(drop->y + 1, drop->x - 1, " "); - MvAddCh(drop->y + 2, drop->x, ' '); -} - -#ifdef USE_PTHREADS -static void -napsome(void) -{ - napms(60); -} - -/* - * This runs inside the use_window() mutex. - */ -static int -really_draw(WINDOW *win, void *arg) -{ - DATA *data = (DATA *) arg; - - (void) win; - next_j(data->state); - data->func(data); - refresh(); - return OK; -} - -static void -draw_part(void (*func) (DATA *), int state, DATA * data) -{ - data->func = func; - data->state = state; - use_window(stdscr, really_draw, (void *) data); - napsome(); -} - -/* - * Tell the threads that one of them can start work on a new raindrop. - * They may all be busy if we're sending requests too rapidly. - */ -static int -put_next_drop(void) -{ - pthread_cond_signal(&cond_next_drop); - pthread_mutex_unlock(&mutex_next_drop); - - return 0; -} - -/* - * Wait until we're assigned the task of drawing a new raindrop. - */ -static int -get_next_drop(void) -{ - pthread_mutex_lock(&mutex_next_drop); - pthread_cond_wait(&cond_next_drop, &mutex_next_drop); - - return TRUE; -} - -static void * -draw_drop(void *arg) -{ - DATA mydata; - int mystats; - - /* - * Find myself in the list of threads so we can count the number of loops. - */ - for (mystats = 0; mystats < MAX_THREADS; ++mystats) { -#ifdef __MINGW32__ - if (drop_threads[mystats].myself.p == pthread_self().p) -#else - if (drop_threads[mystats].myself == pthread_self()) -#endif - break; - } - - do { - if (mystats < MAX_THREADS) - drop_threads[mystats].counter++; - - /* - * Make a copy of caller's data. We're cheating for the cases after - * the first loop since we still have a pointer into the main thread - * to the data which it uses for setting up this thread (but it has - * been modified to use different coordinates). - */ - mydata = *(DATA *) arg; - - draw_part(part1, 0, &mydata); - draw_part(part2, 1, &mydata); - draw_part(part3, 2, &mydata); - draw_part(part4, 3, &mydata); - draw_part(part5, 4, &mydata); - draw_part(part6, 0, &mydata); - } while (get_next_drop()); - - return NULL; -} - -/* - * The description of pthread_create() is misleading, since it implies that - * threads will exit cleanly after their function returns. - * - * Since they do not (and the number of threads is limited by system - * resources), make a limited number of threads, and signal any that are - * waiting when we want a thread past that limit. - */ -static int -start_drop(DATA * data) -{ - int rc; - - if (!used_threads) { - /* mutex and condition for signalling thread */ - pthread_mutex_init(&mutex_next_drop, NULL); - pthread_cond_init(&cond_next_drop, NULL); - } - - if (used_threads < MAX_THREADS) { - rc = pthread_create(&(drop_threads[used_threads].myself), - NULL, - draw_drop, - data); - ++used_threads; - } else { - rc = put_next_drop(); - } - return rc; -} -#endif - -static int -get_input(void) -{ - return USING_WINDOW(stdscr, wgetch); -} - -int -main(int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - bool done = FALSE; - DATA drop; -#ifndef USE_PTHREADS - DATA last[MAX_DROP]; -#endif - int j = 0; - - setlocale(LC_ALL, ""); - - CATCHALL(onsig); - - initscr(); - if (has_colors()) { - int bg = COLOR_BLACK; - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - bg = -1; -#endif - init_pair(1, COLOR_BLUE, (short) bg); - init_pair(2, COLOR_CYAN, (short) bg); - } - nl(); - noecho(); - curs_set(0); - timeout(0); - -#ifndef USE_PTHREADS - for (j = MAX_DROP; --j >= 0;) { - last[j].x = random_x(); - last[j].y = random_y(); - } - j = 0; -#endif - - while (!done) { - drop.x = random_x(); - drop.y = random_y(); - -#ifdef USE_PTHREADS - if (start_drop(&drop) != 0) { - beep(); - } -#else - /* - * The non-threaded code draws parts of each drop on each loop. - */ - part1(&drop); - - part2(&last[j]); - - j = next_j(j); - part3(&last[j]); - - j = next_j(j); - part4(&last[j]); - - j = next_j(j); - part5(&last[j]); - - j = next_j(j); - part6(&last[j]); - - last[j] = drop; -#endif - - switch (get_input()) { - case ('q'): - case ('Q'): - done = TRUE; - break; - case 's': - nodelay(stdscr, FALSE); - break; - case ' ': - nodelay(stdscr, TRUE); - break; -#ifdef KEY_RESIZE - case (KEY_RESIZE): - break; -#endif - } - napms(50); - } - curs_set(1); - endwin(); -#ifdef USE_PTHREADS - printf("Counts per thread:\n"); - for (j = 0; j < MAX_THREADS; ++j) - printf(" %d:%ld\n", j, drop_threads[j].counter); -#endif - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/redraw.c b/test/redraw.c deleted file mode 100644 index f62c098b794..00000000000 --- a/test/redraw.c +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2006-2007,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"), 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: redraw.c,v 1.5 2010/05/01 22:04:08 tom Exp $ - * - * Demonstrate the redrawwin() and wredrawln() functions. - * Thomas Dickey - 2006/11/4 - */ - -#include - -static void -trash(int beg_x, int max_x, int cur_x) -{ - int x; - - for (x = cur_x; x > beg_x; --x) { - putchar('\b'); - } - for (x = beg_x; x < max_x; ++x) { - if (x < cur_x) - putchar('<'); - else if (x == cur_x) - putchar('='); - else if (x > cur_x) - putchar('>'); - } - for (x = max_x; x > cur_x; --x) { - putchar('\b'); - } -} - -static void -test_redraw(WINDOW *win) -{ - WINDOW *win1; - WINDOW *win2; - bool done = FALSE; - int ch, y, x; - int max_y, max_x; - int beg_y, beg_x; - - assert(win != 0); - - scrollok(win, TRUE); - keypad(win, TRUE); - getmaxyx(win, max_y, max_x); - getbegyx(win, beg_y, beg_x); - while (!done) { - ch = wgetch(win); - getyx(win, y, x); - switch (ch) { - case 'q': - /* FALLTHRU */ - case ESCAPE: - done = TRUE; - break; - case 'w': - win1 = newwin(max_y, max_x, - beg_y, beg_x); - win2 = newwin(max_y - 2, max_x - 2, - beg_y + 1, beg_x + 1); - box(win1, 0, 0); - wrefresh(win1); - - test_redraw(win2); - - delwin(win2); - delwin(win1); - - touchwin(win); - break; - - case '!': - /* - * redrawwin() and wredrawln() do not take into account the - * possibility that the cursor may have moved. That makes them - * cumbersome for using with a shell command. So we simply - * trash the current line of the window using backspace/overwrite. - */ - trash(beg_x, max_x, x + beg_x); - break; - -#ifdef NCURSES_VERSION - case '@': - /* - * For a shell command, we can work around the problem noted above - * using mvcur(). It is ifdef'd for NCURSES, since X/Open does - * not define the case where the old location is unknown. - */ - system("date"); - mvcur(-1, -1, y, x); - break; -#endif - - case CTRL('W'): - redrawwin(win); - break; - - case CTRL('L'): - wredrawln(win, y, 1); - break; - - case KEY_UP: - if (y > 0) - wmove(win, y - 1, x); - break; - - case KEY_DOWN: - if (y < max_y) - wmove(win, y + 1, x); - break; - - case KEY_LEFT: - if (x > 0) - wmove(win, y, x - 1); - break; - - case KEY_RIGHT: - if (x < max_x) - wmove(win, y, x + 1); - break; - - default: - if (ch > KEY_MIN) { - waddstr(win, keyname(ch)); - } else { - waddstr(win, unctrl(UChar(ch))); - } - break; - } - wnoutrefresh(win); - doupdate(); - } -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - initscr(); - raw(); - noecho(); - test_redraw(stdscr); - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/savescreen.c b/test/savescreen.c deleted file mode 100644 index 111882d0b55..00000000000 --- a/test/savescreen.c +++ /dev/null @@ -1,342 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007-2010,2011 Free 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: savescreen.c,v 1.15 2011/01/15 18:15:11 tom Exp $ - * - * Demonstrate save/restore functions from the curses library. - * Thomas Dickey - 2007/7/14 - */ - -#include - -#if HAVE_SCR_DUMP - -#include -#include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -static bool use_init = FALSE; - -static int -fexists(const char *name) -{ - struct stat sb; - return (stat(name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFREG); -} - -static void -setup_next(void) -{ - curs_set(1); - reset_shell_mode(); -} - -static void -cleanup(char *files[]) -{ - int n; - - for (n = 0; files[n] != 0; ++n) { - unlink(files[n]); - } -} - -static int -load_screen(char *filename) -{ - int result; - - if (use_init) { - if ((result = scr_init(filename)) != ERR) - result = scr_restore(filename); - } else { - result = scr_set(filename); - } - return result; -} - -/* - * scr_restore() or scr_set() operates on curscr. If we read a character using - * getch() that will refresh stdscr, wiping out the result. To avoid that, - * copy the data back from curscr to stdscr. - */ -static void -after_load(void) -{ - overwrite(curscr, stdscr); - doupdate(); -} - -static void -show_what(int which, int last) -{ - int y, x; - time_t now = time((time_t *) 0); - - getyx(stdscr, y, x); - - move(0, 0); - printw("Saved %d of %d - %s", which, last + 1, ctime(&now)); - - move(y, x); - - refresh(); -} - -static int -get_command(int which, int last) -{ - int ch; - - timeout(100); - - do { - show_what(which, last); - ch = getch(); - } while (ch == ERR); - - return ch; -} - -static void -usage(void) -{ - static const char *msg[] = - { - "Usage: savescreen [-r] files", - "", - "Options:", - " -i use scr_init/scr_restore rather than scr_set", - " -r replay the screen-dump files" - }; - 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 ch; - int which = 0; - int last; - bool replaying = FALSE; - bool done = FALSE; - char **files; - - while ((ch = getopt(argc, argv, "ir")) != -1) { - switch (ch) { - case 'i': - use_init = TRUE; - break; - case 'r': - replaying = TRUE; - break; - default: - usage(); - break; - } - } - - files = argv + optind; - last = argc - optind - 1; - - if (replaying) { - while (last >= 0 && !fexists(files[last])) - --last; - } - - initscr(); - cbreak(); - 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 (replaying) { - - /* - * Use the last file as the initial/current screen. - */ - if (last < 0) { - endwin(); - printf("No screen-dumps given\n"); - ExitProgram(EXIT_FAILURE); - } - - which = last; - if (load_screen(files[which]) == ERR) { - endwin(); - printf("Cannot load screen-dump %s\n", files[which]); - ExitProgram(EXIT_FAILURE); - } - after_load(); - - while (!done && (ch = getch()) != ERR) { - switch (ch) { - case 'n': - /* - * If we got a "next" here, skip to the final screen before - * moving to the next process. - */ - setup_next(); - which = last; - done = TRUE; - break; - case 'q': - endwin(); - cleanup(files); - done = TRUE; - break; - case KEY_BACKSPACE: - case '\b': - if (--which < 0) - which = last; - break; - case ' ': - if (++which > last) - which = 0; - break; - default: - beep(); - continue; - } - - if (ch == 'q') { - ; - } else if (scr_restore(files[which]) == ERR) { - endwin(); - printf("Cannot load screen-dump %s\n", files[which]); - cleanup(files); - ExitProgram(EXIT_FAILURE); - } else { - wrefresh(curscr); - } - } - } 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); - - while (!done) { - switch (get_command(which, last)) { - case 'n': - 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)); - } - } else { - beep(); - } - break; - case KEY_LEFT: - case 'h': - if (--x < 0) - x = COLS - 1; - break; - case KEY_DOWN: - case 'j': - if (++y >= LINES) - y = 1; - break; - case KEY_UP: - case 'k': - if (--y < 1) - y = LINES - 1; - break; - case KEY_RIGHT: - case 'l': - if (++x >= COLS) - x = 0; - break; - } - if (!done) { - time_t now = time((time_t *) 0); - - move(0, 0); - addstr(ctime(&now)); - move(y, x); - addch('#' | A_REVERSE); - move(y, x); - } - } - } - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(int argc, char *argv[]) -{ - printf("This program requires the screen-dump functions\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/savescreen.sh b/test/savescreen.sh deleted file mode 100755 index e49aa173506..00000000000 --- a/test/savescreen.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -############################################################################## -# Copyright (c) 2007,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 "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: savescreen.sh,v 1.4 2009/10/10 17:08:45 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. -PARAMS= -NFILES=4 -PREFIX=savescreen-$$ -n=0 -BEGINS=$PREFIX-$n.tmp -while test $n != $NFILES -do - LATEST=$PREFIX-$n.tmp - PARAMS="$PARAMS $LATEST" - n=`expr $n + 1` -done - -./savescreen $PARAMS -if test -f $BEGINS -then - while test -f $BEGINS - do - ./savescreen -r $PARAMS - test $? != 0 && break - done -else - echo "No screens were saved" -fi diff --git a/test/tclock.c b/test/tclock.c deleted file mode 100644 index fb44725d320..00000000000 --- a/test/tclock.c +++ /dev/null @@ -1,268 +0,0 @@ -/* $Id: tclock.c,v 1.30 2011/03/22 09:16:00 tom Exp $ */ - -#include - -#if HAVE_MATH_H - -#include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -/* - tclock - analog/digital clock for curses. - If it gives you joy, then - (a) I'm glad - (b) you need to get out more :-) - - This program is copyright Howard Jones, September 1994 - (ha.jones@ic.ac.uk). It may be freely distributed as - long as this copyright message remains intact, and any - modifications are clearly marked as such. [In fact, if - you modify it, I wouldn't mind the modifications back, - especially if they add any nice features. A good one - would be a precalc table for the 60 hand positions, so - that the floating point stuff can be ditched. As I said, - it was a 20 hackup minute job.] - - COMING SOON: tfishtank. Be the envy of your mac-owning - colleagues. -*/ - -/* To compile: cc -o tclock tclock.c -lcurses -lm */ - -#ifndef PI -#define PI 3.141592654 -#endif - -#define sign(_x) (_x<0?-1:1) - -#define ASPECT 2.2 -#define ROUND(value) ((int)((value) + 0.5)) - -#define A2X(angle,radius) ROUND(ASPECT * radius * sin(angle)) -#define A2Y(angle,radius) ROUND(radius * cos(angle)) - -/* Plot a point */ -static void -plot(int x, int y, char col) -{ - MvAddCh(y, x, (chtype) col); -} - -/* Draw a diagonal(arbitrary) line using Bresenham's alogrithm. */ -static void -dline(int pair, int from_x, int from_y, int x2, int y2, char ch) -{ - int dx, dy; - int ax, ay; - int sx, sy; - int x, y; - int d; - - if (has_colors()) - (void) attrset((attr_t) COLOR_PAIR(pair)); - - dx = x2 - from_x; - dy = y2 - from_y; - - ax = abs(dx * 2); - ay = abs(dy * 2); - - sx = sign(dx); - sy = sign(dy); - - x = from_x; - y = from_y; - - if (ax > ay) { - d = ay - (ax / 2); - - while (1) { - plot(x, y, ch); - if (x == x2) - return; - - if (d >= 0) { - y += sy; - d -= ax; - } - x += sx; - d += ay; - } - } else { - d = ax - (ay / 2); - - while (1) { - plot(x, y, ch); - if (y == y2) - return; - - if (d >= 0) { - x += sx; - d -= ay; - } - y += sy; - d += ax; - } - } -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - int i, cx, cy; - double cr, mradius, hradius, mangle, hangle; - double sangle, sradius, hours; - int hdx, hdy; - int mdx, mdy; - int sdx, sdy; - int ch; - int lastbeep = -1; - bool odd = FALSE; - time_t tim; - struct tm *t; - char szChar[10]; - char *text; - short my_bg = COLOR_BLACK; -#if HAVE_GETTIMEOFDAY - struct timeval current; - double fraction = 0.0; -#endif - - setlocale(LC_ALL, ""); - - initscr(); - noecho(); - cbreak(); - nodelay(stdscr, TRUE); - curs_set(0); - - if (has_colors()) { - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - my_bg = -1; -#endif - init_pair(1, COLOR_RED, my_bg); - init_pair(2, COLOR_MAGENTA, my_bg); - init_pair(3, COLOR_GREEN, my_bg); - init_pair(4, COLOR_WHITE, COLOR_BLUE); - } -#ifdef KEY_RESIZE - keypad(stdscr, TRUE); - restart: -#endif - cx = (COLS - 1) / 2; /* 39 */ - cy = LINES / 2; /* 12 */ - if (cx / ASPECT < cy) - cr = cx / ASPECT; - else - cr = cy; - sradius = (5 * cr) / 6; /* 10 */ - mradius = (3 * cr) / 4; /* 9 */ - hradius = cr / 2; /* 6 */ - - for (i = 0; i < 12; i++) { - sangle = (i + 1) * (2.0 * PI) / 12.0; - sdx = A2X(sangle, sradius); - sdy = A2Y(sangle, sradius); - sprintf(szChar, "%d", i + 1); - - MvAddStr(cy - sdy, cx + sdx, szChar); - } - - MvAddStr(0, 0, "ASCII Clock by Howard Jones (ha.jones@ic.ac.uk),1994"); - - sradius = (4 * sradius) / 5; - for (;;) { - napms(100); - - tim = time(0); - t = localtime(&tim); - - hours = (t->tm_hour + (t->tm_min / 60.0)); - if (hours > 12.0) - hours -= 12.0; - - mangle = ((t->tm_min + (t->tm_sec / 60.0)) * (2 * PI) / 60.0); - mdx = A2X(mangle, mradius); - mdy = A2Y(mangle, mradius); - - hangle = ((hours) * (2.0 * PI) / 12.0); - hdx = A2X(hangle, hradius); - hdy = A2Y(hangle, hradius); - -#if HAVE_GETTIMEOFDAY - gettimeofday(¤t, 0); - fraction = ((double) current.tv_usec / 1.0e6); -#endif - sangle = ((t->tm_sec + fraction) * (2.0 * PI) / 60.0); - sdx = A2X(sangle, sradius); - sdy = A2Y(sangle, sradius); - - dline(3, cx, cy, cx + mdx, cy - mdy, '#'); - - (void) attrset(A_REVERSE); - dline(2, cx, cy, cx + hdx, cy - hdy, '.'); - attroff(A_REVERSE); - - if (has_colors()) - (void) attrset(COLOR_PAIR(1)); - - dline(1, cx, cy, cx + sdx, cy - sdy, 'O'); - - if (has_colors()) - (void) attrset(COLOR_PAIR(0)); - - text = ctime(&tim); - MvPrintw(2, 0, "%.*s", (int) (strlen(text) - 1), text); - refresh(); - if ((t->tm_sec % 5) == 0 - && t->tm_sec != lastbeep) { - lastbeep = t->tm_sec; - if (has_colors()) { - odd = !odd; - bkgd((chtype) (odd ? COLOR_PAIR(4) : COLOR_PAIR(0))); - } - beep(); - } - - if ((ch = getch()) != ERR) { -#ifdef KEY_RESIZE - if (ch == KEY_RESIZE) { - flash(); - erase(); - wrefresh(curscr); - goto restart; - } -#endif - break; - } - - dline(0, cx, cy, cx + hdx, cy - hdy, ' '); - dline(0, cx, cy, cx + mdx, cy - mdy, ' '); - dline(0, cx, cy, cx + sdx, cy - sdy, ' '); - - } - - curs_set(1); - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - printf("This program requires the development header math.h\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/test.priv.h b/test/test.priv.h deleted file mode 100644 index 51d52a83ceb..00000000000 --- a/test/test.priv.h +++ /dev/null @@ -1,771 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2010,2011 Free 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 1996-on * - ****************************************************************************/ -/* $Id: test.priv.h,v 1.103 2011/03/22 09:15:45 tom Exp $ */ - -#ifndef __TEST_PRIV_H -#define __TEST_PRIV_H 1 - -#include - -/* - * Fix ifdef's that look for the form/menu/panel libraries, if we are building - * with wide-character ncurses. - */ -#ifdef HAVE_LIBFORMW -#define HAVE_LIBFORMW 1 -#define HAVE_LIBFORM 1 -#endif - -#ifdef HAVE_LIBMENUW -#define HAVE_LIBMENUW 1 -#define HAVE_LIBMENU 1 -#endif - -#ifdef HAVE_LIBPANELW -#define HAVE_LIBPANELW 1 -#define HAVE_LIBPANEL 1 -#endif - -/* - * Fallback definitions to accommodate broken compilers. - */ -#ifndef HAVE_CURSES_VERSION -#define HAVE_CURSES_VERSION 0 -#endif - -#ifndef HAVE_CHGAT -#define HAVE_CHGAT 0 -#endif - -#ifndef HAVE_COLOR_SET -#define HAVE_COLOR_SET 0 -#endif - -#ifndef HAVE_FILTER -#define HAVE_FILTER 0 -#endif - -#ifndef HAVE_FORM_H -#define HAVE_FORM_H 0 -#endif - -#ifndef HAVE_GETBEGX -#define HAVE_GETBEGX 0 -#endif - -#ifndef HAVE_GETCURX -#define HAVE_GETCURX 0 -#endif - -#ifndef HAVE_GETMAXX -#define HAVE_GETMAXX 0 -#endif - -#ifndef HAVE_GETOPT_H -#define HAVE_GETOPT_H 0 -#endif - -#ifndef HAVE_GETPARX -#define HAVE_GETPARX 0 -#endif - -#ifndef HAVE_GETWIN -#define HAVE_GETWIN 0 -#endif - -#ifndef HAVE_LIBFORM -#define HAVE_LIBFORM 0 -#endif - -#ifndef HAVE_LIBMENU -#define HAVE_LIBMENU 0 -#endif - -#ifndef HAVE_LIBPANEL -#define HAVE_LIBPANEL 0 -#endif - -#ifndef HAVE_LOCALE_H -#define HAVE_LOCALE_H 0 -#endif - -#ifndef HAVE_MATH_H -#define HAVE_MATH_H 0 -#endif - -#ifndef HAVE_MENU_H -#define HAVE_MENU_H 0 -#endif - -#ifndef HAVE_MVVLINE -#define HAVE_MVVLINE 0 -#endif - -#ifndef HAVE_MVWVLINE -#define HAVE_MVWVLINE 0 -#endif - -#ifndef HAVE_NAPMS -#define HAVE_NAPMS 1 -#endif - -#ifndef HAVE_NC_ALLOC_H -#define HAVE_NC_ALLOC_H 0 -#endif - -#ifndef HAVE_PANEL_H -#define HAVE_PANEL_H 0 -#endif - -#ifndef HAVE_PUTWIN -#define HAVE_PUTWIN 0 -#endif - -#ifndef HAVE_RESIZE_TERM -#define HAVE_RESIZE_TERM 0 -#endif - -#ifndef HAVE_RIPOFFLINE -#define HAVE_RIPOFFLINE 0 -#endif - -#ifndef HAVE_SETUPTERM -#define HAVE_SETUPTERM 0 -#endif - -#ifndef HAVE_SLK_COLOR -#define HAVE_SLK_COLOR 0 -#endif - -#ifndef HAVE_SLK_INIT -#define HAVE_SLK_INIT 0 -#endif - -#ifndef HAVE_TERMATTRS -#define HAVE_TERMATTRS 0 -#endif - -#ifndef HAVE_TERMNAME -#define HAVE_TERMNAME 0 -#endif - -#ifndef HAVE_TGETENT -#define HAVE_TGETENT 0 -#endif - -#ifndef HAVE_TIGETNUM -#define HAVE_TIGETNUM 0 -#endif - -#ifndef HAVE_TIGETSTR -#define HAVE_TIGETSTR 0 -#endif - -#ifndef HAVE_TYPEAHEAD -#define HAVE_TYPEAHEAD 0 -#endif - -#ifndef HAVE_WINSSTR -#define HAVE_WINSSTR 0 -#endif - -#ifndef HAVE_USE_DEFAULT_COLORS -#define HAVE_USE_DEFAULT_COLORS 0 -#endif - -#ifndef HAVE_WRESIZE -#define HAVE_WRESIZE 0 -#endif - -#ifndef NCURSES_EXT_FUNCS -#define NCURSES_EXT_FUNCS 0 -#endif - -#ifndef NEED_PTEM_H -#define NEED_PTEM_H 0 -#endif - -#ifndef NEED_WCHAR_H -#define NEED_WCHAR_H 0 -#endif - -#ifndef NO_LEAKS -#define NO_LEAKS 0 -#endif - -#include -#include -#include -#include -#include - -#if HAVE_UNISTD_H -#include -#endif - -#include /* include before curses.h to work around glibc bug */ - -#if NEED_WCHAR_H -#include -#ifdef HAVE_LIBUTF8_H -#include -#endif -#endif - -#if defined(HAVE_XCURSES) -#include -#elif defined(HAVE_NCURSESW_NCURSES_H) -#include -#elif defined(HAVE_NCURSES_NCURSES_H) -#include -#else -#include -#endif - -#if defined(HAVE_XCURSES) || defined(PDCURSES) -/* no other headers */ -#undef HAVE_SETUPTERM /* nonfunctional */ -#define HAVE_SETUPTERM 0 -#undef HAVE_TGETENT /* nonfunctional */ -#define HAVE_TGETENT 0 -#undef HAVE_TIGETSTR /* nonfunctional */ -#define HAVE_TIGETSTR 0 -#elif defined(HAVE_NCURSESW_TERM_H) -#include -#elif defined(HAVE_NCURSES_TERM_H) -#include -#elif defined(HAVE_TERM_H) -#include -#endif - -/* - * Not all curses.h implementations include unctrl.h, - * Solaris 10 xpg4 for example. - */ -#if defined(NCURSES_VERSION) || defined(_XOPEN_CURSES) -#if defined(HAVE_NCURSESW_NCURSES_H) -#include -#elif defined(HAVE_NCURSES_NCURSES_H) -#include -#else -#include -#endif -#endif - -#if HAVE_GETOPT_H -#include -#else -/* 'getopt()' may be prototyped in , but declaring its variables - * doesn't hurt. - */ -extern char *optarg; -extern int optind; -#endif /* HAVE_GETOPT_H */ - -#if HAVE_LOCALE_H -#include -#else -#define setlocale(name,string) /* nothing */ -#endif - -#include -#include - -#ifndef GCC_NORETURN -#define GCC_NORETURN /* nothing */ -#endif -#ifndef GCC_PRINTFLIKE -#define GCC_PRINTFLIKE(a,b) /* nothing */ -#endif -#ifndef GCC_UNUSED -#define GCC_UNUSED /* nothing */ -#endif - -#ifndef HAVE_GETNSTR -#define getnstr(s,n) getstr(s) -#endif - -#ifndef USE_SOFTKEYS -#if HAVE_SLK_INIT -#define USE_SOFTKEYS 1 -#else -#define USE_SOFTKEYS 0 -#endif -#endif - -#if !USE_SOFTKEYS -#define slk_init() /* nothing */ -#define slk_restore() /* nothing */ -#define slk_clear() /* nothing */ -#endif - -#ifndef HAVE_WSYNCDOWN -#define wsyncdown(win) /* nothing */ -#endif - -#ifndef USE_WIDEC_SUPPORT -#if (defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5)) && defined(WACS_ULCORNER) -#define USE_WIDEC_SUPPORT 1 -#else -#define USE_WIDEC_SUPPORT 0 -#endif -#endif - -#if HAVE_PANEL_H && HAVE_LIBPANEL -#define USE_LIBPANEL 1 -#else -#define USE_LIBPANEL 0 -#endif - -#if HAVE_MENU_H && HAVE_LIBMENU -#define USE_LIBMENU 1 -#else -#define USE_LIBMENU 0 -#endif - -#if HAVE_FORM_H && HAVE_LIBFORM -#define USE_LIBFORM 1 -#else -#define USE_LIBFORM 0 -#endif - -/* 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 -#else -#define form_getyx(form, y, x) y = (form)->currow, x = (form)->curcol -#endif - -/* workaround, to build against NetBSD's variant of the form library */ -#ifdef HAVE_NETBSD_MENU_H -#define menu_itemwidth(menu) (menu)->max_item_width -#else -#define menu_itemwidth(menu) (menu)->itemlen -#endif - -#ifndef HAVE_TYPE_ATTR_T -#if !USE_WIDEC_SUPPORT && !defined(attr_t) -#define attr_t chtype -#endif -#endif - -#undef NCURSES_CH_T -#if !USE_WIDEC_SUPPORT -#define NCURSES_CH_T chtype -#else -#define NCURSES_CH_T cchar_t -#endif - -#ifndef NCURSES_OPAQUE -#define NCURSES_OPAQUE 0 -#endif - -#ifndef CCHARW_MAX -#define CCHARW_MAX 5 -#endif - -#if defined(NCURSES_VERSION) && defined(CURSES_WACS_ARRAY) && !defined(CURSES_WACS_SYMBOLS) -#define CURSES_WACS_SYMBOLS -#endif - -#if defined(CURSES_WACS_ARRAY) && !defined(CURSES_WACS_SYMBOLS) -/* NetBSD 5.1 defines these incorrectly */ -#undef WACS_RARROW -#undef WACS_LARROW -#undef WACS_UARROW -#undef WACS_DARROW -#undef WACS_BLOCK -#undef WACS_DIAMOND -#undef WACS_CKBOARD -#undef WACS_DEGREE -#undef WACS_PLMINUS -#undef WACS_BOARD -#undef WACS_LANTERN -#undef WACS_LRCORNER -#undef WACS_URCORNER -#undef WACS_ULCORNER -#undef WACS_LLCORNER -#undef WACS_PLUS -#undef WACS_HLINE -#undef WACS_S1 -#undef WACS_S9 -#undef WACS_LTEE -#undef WACS_RTEE -#undef WACS_BTEE -#undef WACS_TTEE -#undef WACS_VLINE -#undef WACS_BULLET -#undef WACS_S3 -#undef WACS_S7 -#undef WACS_LEQUAL -#undef WACS_GEQUAL -#undef WACS_PI -#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['}']) -#endif - -#undef CTRL -#define CTRL(x) ((x) & 0x1f) - -#define QUIT CTRL('Q') -#define ESCAPE CTRL('[') - -#ifndef KEY_MIN -#define KEY_MIN 256 /* not defined in Solaris 8 */ -#endif - -#ifdef DECL_CURSES_DATA_BOOLNAMES -extern char *boolnames[], *boolcodes[], *boolfnames[]; -extern char *numnames[], *numcodes[], *numfnames[]; -extern char *strnames[], *strcodes[], *strfnames[]; -#endif - -#define colored_chtype(ch, attr, pair) \ - ((chtype) (ch) | (chtype) (attr) | (chtype) COLOR_PAIR(pair)) - -/* - * Workaround for HPUX - */ -#if defined(__hpux) && !defined(NCURSES_VERSION) -#define getbegx(w) __getbegx(w) -#define getbegy(w) __getbegy(w) -#define getcurx(w) __getcurx(w) -#define getcury(w) __getcury(w) -#define getmaxx(w) __getmaxx(w) -#define getmaxy(w) __getmaxy(w) -#define getparx(w) __getparx(w) -#define getpary(w) __getpary(w) -#endif - -/* - * Workaround in case getcchar() returns a positive value when the source - * string produces only a L'\0'. - */ -#define TEST_CCHAR(s, count, then_stmt, else_stmt) \ - if ((count = getcchar(s, NULL, NULL, NULL, NULL)) > 0) { \ - wchar_t test_wch[CCHARW_MAX + 2]; \ - attr_t test_attrs; \ - short test_pair; \ - \ - if (getcchar( s, test_wch, &test_attrs, &test_pair, NULL) == OK \ - && test_wch[0] != L'\0') { \ - then_stmt \ - } else { \ - else_stmt \ - } \ - } else { \ - else_stmt \ - } -/* - * 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) -#endif - -#if !defined(getbegx) && !HAVE_GETBEGX -#define getbegx(win) ((win)?(win)->_begx:ERR) -#define getbegy(win) ((win)?(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) -#endif - -/* - * Solaris 10 xpg4: -#define __m_getparx(w) ((w)->_parent == (WINDOW *) 0 ? -1 \ - : (w)->_begx - (w)->_parent->_begx) - */ -#if !defined(getparx) && !HAVE_GETPARX -#ifdef __m_getparx -#define getparx(win) __m_getparx(win) -#define getpary(win) __m_getpary(win) -#else -#define getparx(win) ((win)?((win)->_parx + 1):ERR) -#define getpary(win) ((win)?((win)->_pary + 1):ERR) -#endif -#endif - -#if !defined(mvwvline) && !HAVE_MVWVLINE -#define mvwvline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : wvline(w,ch,n)) -#define mvwhline(w,y,x,ch,n) (move(y,x) == ERR ? ERR : whline(w,ch,n)) -#endif - -#if !defined(mvvline) && !HAVE_MVVLINE -#define mvvline(y,x,ch,n) (move(y,x) == ERR ? ERR : vline(ch,n)) -#define mvhline(y,x,ch,n) (move(y,x) == ERR ? ERR : hline(ch,n)) -#endif - -/* - * Try to accommodate curses implementations that have no terminfo support. - */ -#if HAVE_TIGETNUM -#define TIGETNUM(ti,tc) tigetnum(ti) -#else -#define TIGETNUM(ti,tc) tgetnum(tc) -#endif - -#if HAVE_TIGETSTR -#define TIGETSTR(ti,tc) tigetstr(ti) -#else -#define TIGETSTR(ti,tc) tgetstr(tc,&area_pointer) -#endif - -/* ncurses implements tparm() with varargs, X/Open with a fixed-parameter list - * (which is incompatible with legacy usage, doesn't solve any problems). - */ -#define tparm3(a,b,c) tparm(a,b,c,0,0,0,0,0,0,0) -#define tparm2(a,b) tparm(a,b,0,0,0,0,0,0,0,0) - -#define UChar(c) ((unsigned char)(c)) - -#define SIZEOF(table) (sizeof(table)/sizeof(table[0])) - -#if defined(NCURSES_VERSION) && HAVE_NC_ALLOC_H -#include -#if HAVE_NC_FREEALL && defined(USE_TINFO) -#undef ExitProgram -#define ExitProgram(code) _nc_free_tinfo(code) -#endif -#else -#define typeMalloc(type,n) (type *) malloc((n) * sizeof(type)) -#define typeCalloc(type,elts) (type *) calloc((elts), sizeof(type)) -#define typeRealloc(type,n,p) (type *) realloc(p, (n) * sizeof(type)) -#endif - -#ifndef ExitProgram -#define ExitProgram(code) exit(code) -#endif - -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif -#ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 -#endif - -#ifdef __MINGW32__ -#include -/* conflicts in test/firstlast.c */ -#undef large -#undef small - -#endif - -/* 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 -#define NCURSES_CONST /* nothing */ -#endif - -/* out-of-band values for representing absent capabilities */ -#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */ -#define ABSENT_NUMERIC (-1) -#define ABSENT_STRING (char *)0 - -/* out-of-band values for representing cancels */ -#define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */ -#define CANCELLED_NUMERIC (-2) -#define CANCELLED_STRING (char *)(-1) - -#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */ -#define VALID_NUMERIC(s) ((s) >= 0) -#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) - -#define VT_ACSC "``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~" - -#define CATCHALL(handler) { \ - int nsig; \ - for (nsig = SIGHUP; nsig < SIGTERM; ++nsig) \ - if (nsig != SIGKILL) \ - signal(nsig, handler); \ - } - -/* - * Workaround for clean(er) compile with Solaris's legacy curses. - * The same would be needed for HPUX 10.20 - */ -#ifndef TPUTS_ARG -#if defined(sun) && !defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH) -#define TPUTS_ARG char -extern char *tgoto(char *, int, int); /* available, but not prototyped */ -#else -#define TPUTS_ARG int -#endif -#endif - -/* - * Workarounds for Solaris's X/Open curses - */ -#if defined(sun) && defined(_XOPEN_CURSES) && !defined(NCURSES_VERSION_PATCH) -#if !defined(KEY_MIN) && defined(__KEY_MIN) -#define KEY_MIN __KEY_MIN -#endif -#if !defined(KEY_MAX) && defined(__KEY_MIN) -#define KEY_MAX __KEY_MAX -#endif -#endif - -/* - * Workaround to build with Sun's default SVr4 curses. - */ -#ifdef NCURSES_VERSION -#ifndef HAVE_VW_PRINTW -#define HAVE_VW_PRINTW 1 -#endif -#endif - -/* - * ncurses provides arrays of capability names; X/Open discarded these SVr4 - * features. Some implementations continue to provide them (see the test - * configure script). - */ -#ifdef NCURSES_VERSION -#ifndef HAVE_CURSES_DATA_BOOLNAMES -#define HAVE_CURSES_DATA_BOOLNAMES 1 -#endif -#endif - -/* - * ncurses uses const in some places where X/Open does (or did) not allow. - */ -#ifdef NCURSES_VERSION -#define CONST_MENUS const -#else -#define CONST_MENUS /* nothing */ -#endif - -#ifndef HAVE_USE_WINDOW -#if !defined(NCURSES_VERSION_PATCH) || (NCURSES_VERSION_PATCH < 20070915) || !NCURSES_EXT_FUNCS -#define HAVE_USE_WINDOW 0 -#else -#define HAVE_USE_WINDOW 1 -#endif -#endif - -/* - * Simplify setting up demo of threading with these macros. - */ - -#if !HAVE_USE_WINDOW -typedef int (*NCURSES_WINDOW_CB) (WINDOW *, void *); -typedef int (*NCURSES_SCREEN_CB) (SCREEN *, void *); -#endif - -#if HAVE_USE_WINDOW -#define USING_WINDOW(w,func) use_window(w, (NCURSES_WINDOW_CB) func, w) -#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_WINDOW2(w,func,data) func(w,data) -#define WANT_USE_WINDOW() extern void _nc_want_use_window(void) -#endif - -#if HAVE_USE_WINDOW -#define USING_SCREEN(s,func,data) use_screen(s, (NCURSES_SCREEN_CB) func, data) -#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void) -#else -#define USING_SCREEN(s,func,data) func(data) -#define WANT_USE_SCREEN() extern void _nc_want_use_screen(void) -#endif - -#ifdef TRACE -#define Trace(p) _tracef p -#define USE_TRACE 1 -#else -#define Trace(p) /* nothing */ -#define USE_TRACE 0 -#endif - -#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 - -/* - * Workaround for defective implementation of gcc attribute warn_unused_result - */ -#if defined(__GNUC__) && defined(_FORTIFY_SOURCE) -#define IGNORE_RC(func) errno = func -#else -#define IGNORE_RC(func) (void) func -#endif /* gcc workarounds */ - -#define init_mb(state) memset(&state, 0, sizeof(state)) - -#endif /* __TEST_PRIV_H */ diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c deleted file mode 100644 index a48f2c49e1c..00000000000 --- a/test/test_add_wchstr.c +++ /dev/null @@ -1,589 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,2010,2011 Free 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_add_wchstr.c,v 1.15 2011/01/15 18:15:11 tom Exp $ - * - * Demonstrate the waddwchstr() and wadd_wch functions. - * Thomas Dickey - 2009/9/12 - * - * Note: to provide inputs for *add_wch(), we use setcchar(). A quirk of the - * X/Open definition for that function is that the string contains no - * characters with negative width. Any control character (such as tab) falls - * into that category. So it follows that *add_wch() cannot render a tab - * character because there is no legal way to construct a cchar_t containing - * one. X/Open does not document this, and it would be logical to assume that - * *addwchstr() has the same limitation, but it uses a wchar_t string directly, - * and does not document how tabs are handled. - */ - -#include - -#if USE_WIDEC_SUPPORT - -#define WIDE_LINEDATA -#include - -#undef MvAddCh -#undef MvAddStr -#undef MvWAddCh -#undef MvWAddStr - -/* definitions to make it simpler to compare with test_addstr.c */ -#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 WAddNStr wadd_wchnstr -#define WAddStr wadd_wchstr - -#define MY_TABSIZE 8 - -typedef enum { - oDefault = 0, - oMove = 1, - oWindow = 2, - oMoveWindow = 3 -} Options; - -static bool m_opt = FALSE; -static bool pass_ctls = FALSE; -static bool w_opt = FALSE; -static int n_opt = -1; - -static cchar_t *temp_buffer; -static size_t temp_length; - -#define TempBuffer(source_len, source_cast) \ - if (source != 0) { \ - const char *temp; \ - size_t need = source_len + 1; \ - wchar_t have[2]; \ - int n = 0; \ - \ - if (need > temp_length) { \ - temp_length = need * 2; \ - temp_buffer = typeRealloc(cchar_t, temp_length, temp_buffer); \ - } \ - have[0] = 0; \ - have[1] = 0; \ - do { \ - have[0] = source_cast; \ - if (!pass_ctls \ - && have[0] != 0 \ - && have[0] < 256 \ - && (temp = unctrl((chtype) have[0])) != 0 \ - && strlen(temp) > 1) { \ - while (*temp != '\0') { \ - have[0] = *temp++; \ - setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \ - } \ - } else { \ - setcchar(&temp_buffer[n++], have, A_NORMAL, 0, NULL); \ - } \ - } while (have[0] != 0); \ - } else if (temp_buffer != 0) { \ - free(temp_buffer); \ - temp_buffer = 0; \ - temp_length = 0; \ - } \ - return temp_buffer; - -static size_t -ChWLen(const wchar_t *source) -{ - size_t result = wcslen(source); - - if (!pass_ctls) { - size_t adjust = 0; - size_t n; - const char *s; - - for (n = 0; n < result; ++n) { - if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) { - adjust += (strlen(s) - 1); - } - } - result += adjust; - } - return result; -} - -static cchar_t * -ChStr(const char *source) -{ - TempBuffer(strlen(source), UChar(*source++)); -} - -static cchar_t * -ChWStr(const wchar_t *source) -{ - TempBuffer(ChWLen(source), *source++); -} - -static void -legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) -{ - const char *showstate; - - switch (state) { - default: - case oDefault: - showstate = ""; - break; - case oMove: - showstate = " (mvXXX)"; - break; - case oWindow: - showstate = " (winXXX)"; - break; - case oMoveWindow: - showstate = " (mvwinXXX)"; - break; - } - - wmove(win, 0, 0); - wprintw(win, - "The Strings/Chars displays should match. Enter any characters, except:\n"); - 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 added %d characters <", level, - showstate, length); - waddwstr(win, buffer); - waddstr(win, ">"); -} - -static int -ColOf(wchar_t *buffer, int length, int margin) -{ - int n; - int result; - - for (n = 0, result = margin + 1; n < length; ++n) { - int ch = buffer[n]; - switch (ch) { - case '\n': - /* actually newline should clear the remainder of the line - * and move to the next line - but that seems a little awkward - * in this example. - */ - case '\r': - result = 0; - break; - case '\b': - if (result > 0) - --result; - break; - case '\t': - result += (MY_TABSIZE - (result % MY_TABSIZE)); - break; - case '\177': - result += 2; - break; - default: - result += wcwidth(ch); - if (ch < 32) - ++result; - break; - } - } - return result; -} - -static int -ConvertCh(chtype source, cchar_t *target) -{ - wchar_t tmp_wchar[2]; - - tmp_wchar[0] = (wchar_t) source; - tmp_wchar[1] = 0; - if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) { - beep(); - return FALSE; - } - return TRUE; -} - -static int -MvWAddCh(WINDOW *win, int y, int x, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = mvwadd_wch(win, y, x, &tmp_cchar); - } else { - code = mvwaddch(win, y, x, ch); - } - return code; -} - -static int -MvAddCh(int y, int x, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = mvadd_wch(y, x, &tmp_cchar); - } else { - code = mvaddch(y, x, ch); - } - return code; -} - -static int -WAddCh(WINDOW *win, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = wadd_wch(win, &tmp_cchar); - } else { - code = waddch(win, ch); - } - return code; -} - -static int -AddCh(chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = add_wch(&tmp_cchar); - } else { - code = addch(ch); - } - return code; -} - -#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) -static void -test_add_wchstr(int level) -{ - static bool first = TRUE; - - int ch; - int limit; - int row = 1; - int col; - int row2, col2; - int length; - wchar_t buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; - int margin = (2 * MY_TABSIZE) - 1; - Options option = ((m_opt ? oMove : oDefault) - | ((w_opt || (level > 0)) ? oWindow : oDefault)); - - if (first) { - static char cmd[80]; - setlocale(LC_ALL, ""); - - putenv(strcpy(cmd, "TABSIZE=8")); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - keypad(stdscr, TRUE); - } - - limit = LINES - 5; - if (level > 0) { - look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); - work = newwin(limit - 2, COLS - (2 * level), 1, level); - show = newwin(4, COLS, limit + 1, 0); - box(look, 0, 0); - wnoutrefresh(look); - limit -= 2; - } else { - work = stdscr; - show = derwin(stdscr, 4, COLS, limit + 1, 0); - } - keypad(work, TRUE); - - for (col = margin + 1; col < COLS; col += MY_TABSIZE) - MvWVLine(work, row, col, '.', limit - 2); - - MvWVLine(work, row, margin, ACS_VLINE, limit - 2); - 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")); - wnoutrefresh(work); - - buffer[length = 0] = '\0'; - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - - /* - * Show the characters added in color, to distinguish from those that - * are shifted. - */ - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - wbkgdset(work, COLOR_PAIR(1) | ' '); - } - - while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { - wmove(work, row, margin + 1); - switch (ch) { - case key_RECUR: - test_add_wchstr(level + 1); - - touchwin(look); - touchwin(work); - touchwin(show); - - wnoutrefresh(look); - wnoutrefresh(work); - wnoutrefresh(show); - - doupdate(); - break; - case key_NEWLINE: - if (row < limit) { - ++row; - /* put the whole string in, all at once */ - col2 = margin + 1; - switch (option) { - case oDefault: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (move(row, col2) != ERR) { - AddNStr(ChWStr(buffer + col), LEN(col)); - } - } - } else { - if (move(row, col2) != ERR) { - AddStr(ChWStr(buffer)); - } - } - break; - case oMove: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvAddNStr(row, col2, ChWStr(buffer + col), LEN(col)); - } - } else { - MvAddStr(row, col2, ChWStr(buffer)); - } - break; - case oWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (wmove(work, row, col2) != ERR) { - WAddNStr(work, ChWStr(buffer + col), LEN(col)); - } - } - } else { - if (wmove(work, row, col2) != ERR) { - WAddStr(work, ChWStr(buffer)); - } - } - break; - case oMoveWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvWAddNStr(work, row, col2, ChWStr(buffer + - col), LEN(col)); - } - } else { - MvWAddStr(work, row, col2, ChWStr(buffer)); - } - break; - } - - /* do the corresponding single-character add */ - row2 = limit + row; - for (col = 0; col < length; ++col) { - col2 = ColOf(buffer, col, margin); - switch (option) { - case oDefault: - if (move(row2, col2) != ERR) { - AddCh((chtype) buffer[col]); - } - break; - case oMove: - MvAddCh(row2, col2, (chtype) buffer[col]); - break; - case oWindow: - if (wmove(work, row2, col2) != ERR) { - WAddCh(work, (chtype) buffer[col]); - } - break; - case oMoveWindow: - MvWAddCh(work, row2, col2, (chtype) buffer[col]); - break; - } - } - } else { - beep(); - } - break; - default: - buffer[length++] = ch; - buffer[length] = '\0'; - - /* put the string in, one character at a time */ - col = ColOf(buffer, length - 1, margin); - switch (option) { - case oDefault: - if (move(row, col) != ERR) { - AddStr(ChWStr(buffer + length - 1)); - } - break; - case oMove: - MvAddStr(row, col, ChWStr(buffer + length - 1)); - break; - case oWindow: - if (wmove(work, row, col) != ERR) { - WAddStr(work, ChWStr(buffer + length - 1)); - } - break; - case oMoveWindow: - MvWAddStr(work, row, col, ChWStr(buffer + length - 1)); - break; - } - - /* do the corresponding single-character add */ - switch (option) { - case oDefault: - if (move(limit + row, col) != ERR) { - AddCh((chtype) ch); - } - break; - case oMove: - MvAddCh(limit + row, col, (chtype) ch); - break; - case oWindow: - if (wmove(work, limit + row, col) != ERR) { - WAddCh(work, (chtype) ch); - } - break; - case oMoveWindow: - MvWAddCh(work, limit + row, col, (chtype) ch); - break; - } - - wnoutrefresh(work); - - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - break; - } - } - if (level > 0) { - delwin(show); - delwin(work); - delwin(look); - } -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: test_add_wchstr [options]" - ,"" - ,"Options:" - ," -f FILE read data from given file" - ," -n NUM limit string-adds to NUM bytes on ^N replay" - ," -m perform wmove/move separately from add-functions" - ," -p pass-thru control characters without using unctrl()" - ," -w use window-parameter even when stdscr would be implied" - }; - 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; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) { - switch (ch) { - case 'f': - init_linedata(optarg); - break; - case 'm': - m_opt = TRUE; - break; - case 'n': - n_opt = atoi(optarg); - if (n_opt == 0) - n_opt = -1; - break; - case 'p': - pass_ctls = TRUE; - break; - case 'w': - w_opt = TRUE; - break; - default: - usage(); - break; - } - } - if (optind < argc) - usage(); - - test_add_wchstr(0); - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/test_addchstr.c b/test/test_addchstr.c deleted file mode 100644 index 815ccc595bf..00000000000 --- a/test/test_addchstr.c +++ /dev/null @@ -1,511 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,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"), 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_addchstr.c,v 1.13 2010/12/12 01:28:24 tom Exp $ - * - * Demonstrate the waddchstr() and waddch functions. - * Thomas Dickey - 2009/9/12 - */ - -#include - -#include - -#undef MvAddStr -#undef MvWAddStr - -#define AddNStr addchnstr -#define AddStr addchstr -#define MvAddNStr (void) mvaddchnstr -#define MvAddStr (void) mvaddchstr -#define MvWAddNStr (void) mvwaddchnstr -#define MvWAddStr (void) mvwaddchstr -#define WAddNStr waddchnstr -#define WAddStr waddchstr - -#define AddCh addch -#define WAddCh waddch - -#define MY_TABSIZE 8 - -typedef enum { - oDefault = 0, - oMove = 1, - oWindow = 2, - oMoveWindow = 3 -} Options; - -static bool m_opt = FALSE; -static bool pass_ctls = FALSE; -static bool w_opt = FALSE; -static int n_opt = -1; - -static attr_t show_attr; -static chtype *temp_buffer; -static size_t temp_length; - -#define TempBuffer(source_cast) - -static size_t -ChLen(const char *source) -{ - size_t result = strlen(source); - - if (!pass_ctls) { - size_t adjust = 0; - size_t n; - - for (n = 0; n < result; ++n) { - const char *s = unctrl(UChar(source[n])); - if (s != 0) { - adjust += (strlen(s) - 1); - } - } - result += adjust; - } - return result; -} - -static chtype * -ChStr(const char *source) -{ - if (source != 0) { - size_t need = ChLen(source) + 1; - int n = 0; - - if (need > temp_length) { - temp_length = need * 2; - temp_buffer = typeRealloc(chtype, temp_length, temp_buffer); - } - do { - const char *s; - chtype ch = UChar(*source++); - if (!pass_ctls && (s = unctrl(ch)) != 0) { - while (*s != '\0') { - temp_buffer[n++] = UChar(*s++); - } - } else { - temp_buffer[n++] = ch; - } - } while (source[0] != 0); - temp_buffer[n] = 0; - } else if (temp_buffer != 0) { - free(temp_buffer); - temp_buffer = 0; - temp_length = 0; - } - return temp_buffer; -} - -/* color the strings drawn in the workspace */ -static chtype * -ChStr2(const char *source) -{ - size_t len = ChLen(source); - size_t n; - chtype *result = ChStr(source); - for (n = 0; n < len; ++n) { - result[n] |= show_attr; - } - return result; -} - -static void -legend(WINDOW *win, int level, Options state, char *buffer, int length) -{ - const char *showstate; - - switch (state) { - default: - case oDefault: - showstate = ""; - break; - case oMove: - showstate = " (mvXXX)"; - break; - case oWindow: - showstate = " (winXXX)"; - break; - case oMoveWindow: - showstate = " (mvwinXXX)"; - break; - } - - wmove(win, 0, 0); - wprintw(win, - "The Strings/Chars displays should match. Enter any characters, except:\n"); - 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 added %d characters <%s>", level, - showstate, length, buffer); -} - -static int -ColOf(char *buffer, int length, int margin) -{ - int n; - int result; - - for (n = 0, result = margin + 1; n < length; ++n) { - int ch = UChar(buffer[n]); - switch (ch) { - case '\n': - /* actually newline should clear the remainder of the line - * and move to the next line - but that seems a little awkward - * in this example. - */ - case '\r': - result = 0; - break; - case '\b': - if (result > 0) - --result; - break; - case '\t': - result += (MY_TABSIZE - (result % MY_TABSIZE)); - break; - case '\177': - result += 2; - break; - default: - ++result; - if (ch < 32) - ++result; - break; - } - } - return result; -} - -#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) -static void -test_adds(int level) -{ - static bool first = TRUE; - - int ch; - int limit; - int row = 1; - int col; - int row2, col2; - int length; - char buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; - int margin = (2 * MY_TABSIZE) - 1; - 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")); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - keypad(stdscr, TRUE); - } - - limit = LINES - 5; - if (level > 0) { - look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); - work = newwin(limit - 2, COLS - (2 * level), 1, level); - show = newwin(4, COLS, limit + 1, 0); - box(look, 0, 0); - wnoutrefresh(look); - limit -= 2; - } else { - work = stdscr; - show = derwin(stdscr, 4, COLS, limit + 1, 0); - } - keypad(work, TRUE); - - for (col = margin + 1; col < COLS; col += MY_TABSIZE) - MvWVLine(work, row, col, '.', limit - 2); - - MvWVLine(work, row, margin, ACS_VLINE, limit - 2); - MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); - limit /= 2; - - MvWAddChStr(work, 1, 2, ChStr("String")); - MvWAddChStr(work, limit + 1, 2, ChStr("Chars")); - wnoutrefresh(work); - - buffer[length = 0] = '\0'; - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - - /* - * Show the characters added in color, to distinguish from those that - * are shifted. - */ - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - show_attr = COLOR_PAIR(1); - wbkgdset(work, show_attr | ' '); - } else { - show_attr = A_STANDOUT; - } - - while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { - wmove(work, row, margin + 1); - switch (ch) { - case key_RECUR: - test_adds(level + 1); - - touchwin(look); - touchwin(work); - touchwin(show); - - wnoutrefresh(look); - wnoutrefresh(work); - wnoutrefresh(show); - - doupdate(); - break; - case key_NEWLINE: - if (row < limit) { - ++row; - /* put the whole string in, all at once */ - col2 = margin + 1; - switch (option) { - case oDefault: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (move(row, col2) != ERR) { - AddNStr(ChStr2(buffer + col), LEN(col)); - } - } - } else { - if (move(row, col2) != ERR) { - AddStr(ChStr2(buffer)); - } - } - break; - case oMove: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvAddNStr(row, col2, ChStr2(buffer + col), LEN(col)); - } - } else { - MvAddStr(row, col2, ChStr2(buffer)); - } - break; - case oWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (wmove(work, row, col2) != ERR) { - WAddNStr(work, ChStr2(buffer + col), LEN(col)); - } - } - } else { - if (wmove(work, row, col2) != ERR) { - WAddStr(work, ChStr2(buffer)); - } - } - break; - case oMoveWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvWAddNStr(work, row, col2, ChStr2(buffer + col), - LEN(col)); - } - } else { - MvWAddStr(work, row, col2, ChStr2(buffer)); - } - break; - } - - /* do the corresponding single-character add */ - row2 = limit + row; - for (col = 0; col < length; ++col) { - col2 = ColOf(buffer, col, margin); - switch (option) { - case oDefault: - if (move(row2, col2) != ERR) { - AddCh(UChar(buffer[col])); - } - break; - case oMove: - MvAddCh(row2, col2, UChar(buffer[col])); - break; - case oWindow: - if (wmove(work, row2, col2) != ERR) { - WAddCh(work, UChar(buffer[col])); - } - break; - case oMoveWindow: - MvWAddCh(work, row2, col2, UChar(buffer[col])); - break; - } - } - } else { - beep(); - } - break; - case KEY_BACKSPACE: - ch = '\b'; - /* FALLTHRU */ - default: - if (ch <= 0 || ch > 255) { - beep(); - break; - } - buffer[length++] = (char) ch; - buffer[length] = '\0'; - - /* put the string in, one character at a time */ - col = ColOf(buffer, length - 1, margin); - switch (option) { - case oDefault: - if (move(row, col) != ERR) { - AddStr(ChStr2(buffer + length - 1)); - } - break; - case oMove: - MvAddStr(row, col, ChStr2(buffer + length - 1)); - break; - case oWindow: - if (wmove(work, row, col) != ERR) { - WAddStr(work, ChStr2(buffer + length - 1)); - } - break; - case oMoveWindow: - MvWAddStr(work, row, col, ChStr2(buffer + length - 1)); - break; - } - - /* do the corresponding single-character add */ - switch (option) { - case oDefault: - if (move(limit + row, col) != ERR) { - AddCh(UChar(ch)); - } - break; - case oMove: - MvAddCh(limit + row, col, UChar(ch)); - break; - case oWindow: - if (wmove(work, limit + row, col) != ERR) { - WAddCh(work, UChar(ch)); - } - break; - case oMoveWindow: - MvWAddCh(work, limit + row, col, UChar(ch)); - break; - } - - wnoutrefresh(work); - - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - break; - } - } - if (level > 0) { - delwin(show); - delwin(work); - delwin(look); - } -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: test_addchstr [options]" - ,"" - ,"Options:" - ," -f FILE read data from given file" - ," -n NUM limit string-adds to NUM bytes on ^N replay" - ," -m perform wmove/move separately from add-functions" - ," -p pass-thru control characters without using unctrl()" - ," -w use window-parameter even when stdscr would be implied" - }; - 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; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "f:mn:pw")) != -1) { - switch (ch) { - case 'f': - init_linedata(optarg); - break; - case 'm': - m_opt = TRUE; - break; - case 'n': - n_opt = atoi(optarg); - if (n_opt == 0) - n_opt = -1; - break; - case 'p': - pass_ctls = TRUE; - break; - case 'w': - w_opt = TRUE; - break; - default: - usage(); - break; - } - } - if (optind < argc) - usage(); - - test_adds(0); - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/test_addstr.c b/test/test_addstr.c deleted file mode 100644 index 5cc184a2d4b..00000000000 --- a/test/test_addstr.c +++ /dev/null @@ -1,424 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,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"), 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_addstr.c,v 1.6 2010/12/12 00:17:37 tom Exp $ - * - * Demonstrate the waddstr() and waddch functions. - * Thomas Dickey - 2009/9/12 - */ - -#include - -#include - -#define AddNStr addnstr -#define AddStr addstr -#define MvAddNStr (void) mvaddnstr -#define MvWAddNStr (void) mvwaddnstr -#define WAddNStr waddnstr -#define WAddStr waddstr - -#define AddCh addch -#define WAddCh waddch - -#define MY_TABSIZE 8 - -typedef enum { - oDefault = 0, - oMove = 1, - oWindow = 2, - oMoveWindow = 3 -} Options; - -static bool m_opt = FALSE; -static bool w_opt = FALSE; -static int n_opt = -1; - -static void -legend(WINDOW *win, int level, Options state, char *buffer, int length) -{ - const char *showstate; - - switch (state) { - default: - case oDefault: - showstate = ""; - break; - case oMove: - showstate = " (mvXXX)"; - break; - case oWindow: - showstate = " (winXXX)"; - break; - case oMoveWindow: - showstate = " (mvwinXXX)"; - break; - } - - wmove(win, 0, 0); - wprintw(win, - "The Strings/Chars displays should match. Enter any characters, except:\n"); - 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 added %d characters <%s>", level, - showstate, length, buffer); -} - -static int -ColOf(char *buffer, int length, int margin) -{ - int n; - int result; - - for (n = 0, result = margin + 1; n < length; ++n) { - int ch = UChar(buffer[n]); - switch (ch) { - case '\n': - /* actually newline should clear the remainder of the line - * and move to the next line - but that seems a little awkward - * in this example. - */ - case '\r': - result = 0; - break; - case '\b': - if (result > 0) - --result; - break; - case '\t': - result += (MY_TABSIZE - (result % MY_TABSIZE)); - break; - case '\177': - result += 2; - break; - default: - ++result; - if (ch < 32) - ++result; - break; - } - } - return result; -} - -#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) -static void -test_adds(int level) -{ - static bool first = TRUE; - - int ch; - int limit; - int row = 1; - int col; - int row2, col2; - int length; - char buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; - int margin = (2 * MY_TABSIZE) - 1; - 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")); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - keypad(stdscr, TRUE); - } - - limit = LINES - 5; - if (level > 0) { - look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); - work = newwin(limit - 2, COLS - (2 * level), 1, level); - show = newwin(4, COLS, limit + 1, 0); - box(look, 0, 0); - wnoutrefresh(look); - limit -= 2; - } else { - work = stdscr; - show = derwin(stdscr, 4, COLS, limit + 1, 0); - } - keypad(work, TRUE); - - for (col = margin + 1; col < COLS; col += MY_TABSIZE) - MvWVLine(work, row, col, '.', limit - 2); - - MvWVLine(work, row, margin, ACS_VLINE, limit - 2); - MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); - limit /= 2; - - MvWAddStr(work, 1, 2, "String"); - MvWAddStr(work, limit + 1, 2, "Chars"); - wnoutrefresh(work); - - buffer[length = 0] = '\0'; - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - - /* - * Show the characters added in color, to distinguish from those that - * are shifted. - */ - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - wbkgdset(work, COLOR_PAIR(1) | ' '); - } - - while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { - wmove(work, row, margin + 1); - switch (ch) { - case key_RECUR: - test_adds(level + 1); - - touchwin(look); - touchwin(work); - touchwin(show); - - wnoutrefresh(look); - wnoutrefresh(work); - wnoutrefresh(show); - - doupdate(); - break; - case key_NEWLINE: - if (row < limit) { - ++row; - /* put the whole string in, all at once */ - col2 = margin + 1; - switch (option) { - case oDefault: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (move(row, col2) != ERR) { - AddNStr(buffer + col, LEN(col)); - } - } - } else { - if (move(row, col2) != ERR) { - AddStr(buffer); - } - } - break; - case oMove: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvAddNStr(row, col2, buffer + col, LEN(col)); - } - } else { - MvAddStr(row, col2, buffer); - } - break; - case oWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (wmove(work, row, col2) != ERR) { - WAddNStr(work, buffer + col, LEN(col)); - } - } - } else { - if (wmove(work, row, col2) != ERR) { - WAddStr(work, buffer); - } - } - break; - case oMoveWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvWAddNStr(work, row, col2, buffer + col, LEN(col)); - } - } else { - MvWAddStr(work, row, col2, buffer); - } - break; - } - - /* do the corresponding single-character add */ - row2 = limit + row; - for (col = 0; col < length; ++col) { - col2 = ColOf(buffer, col, margin); - switch (option) { - case oDefault: - if (move(row2, col2) != ERR) { - AddCh(UChar(buffer[col])); - } - break; - case oMove: - MvAddCh(row2, col2, UChar(buffer[col])); - break; - case oWindow: - if (wmove(work, row2, col2) != ERR) { - WAddCh(work, UChar(buffer[col])); - } - break; - case oMoveWindow: - MvWAddCh(work, row2, col2, UChar(buffer[col])); - break; - } - } - } else { - beep(); - } - break; - default: - if (ch <= 0 || ch > 255) { - beep(); - break; - } - buffer[length++] = (char) ch; - buffer[length] = '\0'; - - /* put the string in, one character at a time */ - col = ColOf(buffer, length - 1, margin); - switch (option) { - case oDefault: - if (move(row, col) != ERR) { - AddStr(buffer + length - 1); - } - break; - case oMove: - MvAddStr(row, col, buffer + length - 1); - break; - case oWindow: - if (wmove(work, row, col) != ERR) { - WAddStr(work, buffer + length - 1); - } - break; - case oMoveWindow: - MvWAddStr(work, row, col, buffer + length - 1); - break; - } - - /* do the corresponding single-character add */ - switch (option) { - case oDefault: - if (move(limit + row, col) != ERR) { - AddCh(UChar(ch)); - } - break; - case oMove: - MvAddCh(limit + row, col, UChar(ch)); - break; - case oWindow: - if (wmove(work, limit + row, col) != ERR) { - WAddCh(work, UChar(ch)); - } - break; - case oMoveWindow: - MvWAddCh(work, limit + row, col, UChar(ch)); - break; - } - - wnoutrefresh(work); - - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - break; - } - } - if (level > 0) { - delwin(show); - delwin(work); - delwin(look); - } -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: test_addstr [options]" - ,"" - ,"Options:" - ," -f FILE read data from given file" - ," -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; - 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; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { - switch (ch) { - case 'f': - init_linedata(optarg); - break; - case 'm': - m_opt = TRUE; - break; - case 'n': - n_opt = atoi(optarg); - if (n_opt == 0) - n_opt = -1; - break; - case 'w': - w_opt = TRUE; - break; - default: - usage(); - break; - } - } - if (optind < argc) - usage(); - - test_adds(0); - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/test_addwstr.c b/test/test_addwstr.c deleted file mode 100644 index 92334aee3b1..00000000000 --- a/test/test_addwstr.c +++ /dev/null @@ -1,516 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2009,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"), 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_addwstr.c,v 1.6 2010/12/12 00:18:00 tom Exp $ - * - * Demonstrate the waddwstr() and wadd_wch functions. - * Thomas Dickey - 2009/9/12 - * - * Note: to provide inputs for *add_wch(), we use setcchar(). A quirk of the - * X/Open definition for that function is that the string contains no - * characters with negative width. Any control character (such as tab) falls - * into that category. So it follows that *add_wch() cannot render a tab - * character because there is no legal way to construct a cchar_t containing - * one. X/Open does not document this, and it would be logical to assume that - * *addwstr() has the same limitation, but it uses a wchar_t string directly, - * and does not document how tabs are handled. - */ - -#include - -#if USE_WIDEC_SUPPORT - -#define WIDE_LINEDATA -#include - -#undef MvAddCh -#undef MvAddStr -#undef MvWAddCh -#undef MvWAddStr - -/* definitions to make it simpler to compare with inserts.c */ -#define AddNStr addnwstr -#define AddStr addwstr -#define MvAddNStr (void) mvaddnwstr -#define MvAddStr (void) mvaddwstr -#define MvWAddNStr (void) mvwaddnwstr -#define MvWAddStr (void) mvwaddwstr -#define WAddNStr waddnwstr -#define WAddStr waddwstr - -#define MY_TABSIZE 8 - -typedef enum { - oDefault = 0, - oMove = 1, - oWindow = 2, - oMoveWindow = 3 -} Options; - -static bool m_opt = FALSE; -static bool w_opt = FALSE; -static int n_opt = -1; - -static void -legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) -{ - const char *showstate; - - switch (state) { - default: - case oDefault: - showstate = ""; - break; - case oMove: - showstate = " (mvXXX)"; - break; - case oWindow: - showstate = " (winXXX)"; - break; - case oMoveWindow: - showstate = " (mvwinXXX)"; - break; - } - - wmove(win, 0, 0); - wprintw(win, - "The Strings/Chars displays should match. Enter any characters, except:\n"); - 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); - waddwstr(win, buffer); - waddstr(win, ">"); -} - -static int -ColOf(wchar_t *buffer, int length, int margin) -{ - int n; - int result; - - for (n = 0, result = margin + 1; n < length; ++n) { - int ch = buffer[n]; - switch (ch) { - case '\n': - /* actually newline should clear the remainder of the line - * and move to the next line - but that seems a little awkward - * in this example. - */ - case '\r': - result = 0; - break; - case '\b': - if (result > 0) - --result; - break; - case '\t': - result += (MY_TABSIZE - (result % MY_TABSIZE)); - break; - case '\177': - result += 2; - break; - default: - result += wcwidth(ch); - if (ch < 32) - ++result; - break; - } - } - return result; -} - -static int -ConvertCh(chtype source, cchar_t *target) -{ - wchar_t tmp_wchar[2]; - - tmp_wchar[0] = (wchar_t) source; - tmp_wchar[1] = 0; - if (setcchar(target, tmp_wchar, A_NORMAL, 0, (void *) 0) == ERR) { - beep(); - return FALSE; - } - return TRUE; -} - -static int -MvWAddCh(WINDOW *win, int y, int x, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = mvwadd_wch(win, y, x, &tmp_cchar); - } else { - code = mvwaddch(win, y, x, ch); - } - return code; -} - -static int -MvAddCh(int y, int x, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = mvadd_wch(y, x, &tmp_cchar); - } else { - code = mvaddch(y, x, ch); - } - return code; -} - -static int -WAddCh(WINDOW *win, chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = wadd_wch(win, &tmp_cchar); - } else { - code = waddch(win, ch); - } - return code; -} - -static int -AddCh(chtype ch) -{ - int code; - cchar_t tmp_cchar; - - if (ConvertCh(ch, &tmp_cchar)) { - code = add_wch(&tmp_cchar); - } else { - code = addch(ch); - } - return code; -} - -#define LEN(n) ((length - (n) > n_opt) ? n_opt : (length - (n))) -static void -test_inserts(int level) -{ - static bool first = TRUE; - - int ch; - int limit; - int row = 1; - int col; - int row2, col2; - int length; - wchar_t buffer[BUFSIZ]; - WINDOW *look = 0; - WINDOW *work = 0; - WINDOW *show = 0; - int margin = (2 * MY_TABSIZE) - 1; - Options option = ((m_opt ? oMove : oDefault) - | ((w_opt || (level > 0)) ? oWindow : oDefault)); - - if (first) { - static char cmd[80]; - setlocale(LC_ALL, ""); - - putenv(strcpy(cmd, "TABSIZE=8")); - - initscr(); - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - keypad(stdscr, TRUE); - } - - limit = LINES - 5; - if (level > 0) { - look = newwin(limit, COLS - (2 * (level - 1)), 0, level - 1); - work = newwin(limit - 2, COLS - (2 * level), 1, level); - show = newwin(4, COLS, limit + 1, 0); - box(look, 0, 0); - wnoutrefresh(look); - limit -= 2; - } else { - work = stdscr; - show = derwin(stdscr, 4, COLS, limit + 1, 0); - } - keypad(work, TRUE); - - for (col = margin + 1; col < COLS; col += MY_TABSIZE) - MvWVLine(work, row, col, '.', limit - 2); - - MvWVLine(work, row, margin, ACS_VLINE, limit - 2); - MvWVLine(work, row, margin + 1, ACS_VLINE, limit - 2); - limit /= 2; - - (void) mvwaddstr(work, 1, 2, "String"); - (void) mvwaddstr(work, limit + 1, 2, "Chars"); - wnoutrefresh(work); - - buffer[length = 0] = '\0'; - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - - /* - * Show the characters inserted in color, to distinguish from those that - * are shifted. - */ - if (has_colors()) { - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - wbkgdset(work, COLOR_PAIR(1) | ' '); - } - - while ((ch = read_linedata(work)) != ERR && !isQUIT(ch)) { - wmove(work, row, margin + 1); - switch (ch) { - case key_RECUR: - test_inserts(level + 1); - - touchwin(look); - touchwin(work); - touchwin(show); - - wnoutrefresh(look); - wnoutrefresh(work); - wnoutrefresh(show); - - doupdate(); - break; - case key_NEWLINE: - if (row < limit) { - ++row; - /* put the whole string in, all at once */ - col2 = margin + 1; - switch (option) { - case oDefault: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (move(row, col2) != ERR) { - AddNStr(buffer + col, LEN(col)); - } - } - } else { - if (move(row, col2) != ERR) { - AddStr(buffer); - } - } - break; - case oMove: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvAddNStr(row, col2, buffer + col, LEN(col)); - } - } else { - MvAddStr(row, col2, buffer); - } - break; - case oWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - if (wmove(work, row, col2) != ERR) { - WAddNStr(work, buffer + col, LEN(col)); - } - } - } else { - if (wmove(work, row, col2) != ERR) { - WAddStr(work, buffer); - } - } - break; - case oMoveWindow: - if (n_opt > 1) { - for (col = 0; col < length; col += n_opt) { - col2 = ColOf(buffer, col, margin); - MvWAddNStr(work, row, col2, buffer + col, LEN(col)); - } - } else { - MvWAddStr(work, row, col2, buffer); - } - break; - } - - /* do the corresponding single-character insertion */ - row2 = limit + row; - for (col = 0; col < length; ++col) { - col2 = ColOf(buffer, col, margin); - switch (option) { - case oDefault: - if (move(row2, col2) != ERR) { - AddCh((chtype) buffer[col]); - } - break; - case oMove: - MvAddCh(row2, col2, (chtype) buffer[col]); - break; - case oWindow: - if (wmove(work, row2, col2) != ERR) { - WAddCh(work, (chtype) buffer[col]); - } - break; - case oMoveWindow: - MvWAddCh(work, row2, col2, (chtype) buffer[col]); - break; - } - } - } else { - beep(); - } - break; - case KEY_BACKSPACE: - ch = '\b'; - /* FALLTHRU */ - default: - buffer[length++] = ch; - buffer[length] = '\0'; - - /* put the string in, one character at a time */ - col = ColOf(buffer, length - 1, margin); - switch (option) { - case oDefault: - if (move(row, col) != ERR) { - AddStr(buffer + length - 1); - } - break; - case oMove: - MvAddStr(row, col, buffer + length - 1); - break; - case oWindow: - if (wmove(work, row, col) != ERR) { - WAddStr(work, buffer + length - 1); - } - break; - case oMoveWindow: - MvWAddStr(work, row, col, buffer + length - 1); - break; - } - - /* do the corresponding single-character insertion */ - switch (option) { - case oDefault: - if (move(limit + row, col) != ERR) { - AddCh((chtype) ch); - } - break; - case oMove: - MvAddCh(limit + row, col, (chtype) ch); - break; - case oWindow: - if (wmove(work, limit + row, col) != ERR) { - WAddCh(work, (chtype) ch); - } - break; - case oMoveWindow: - MvWAddCh(work, limit + row, col, (chtype) ch); - break; - } - - wnoutrefresh(work); - - legend(show, level, option, buffer, length); - wnoutrefresh(show); - - doupdate(); - break; - } - } - if (level > 0) { - delwin(show); - delwin(work); - delwin(look); - } -} - -static void -usage(void) -{ - static const char *tbl[] = - { - "Usage: inserts [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" - ," -w use window-parameter even when stdscr would be implied" - }; - 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; - - setlocale(LC_ALL, ""); - - while ((ch = getopt(argc, argv, "f:mn:w")) != -1) { - switch (ch) { - case 'f': - init_linedata(optarg); - break; - case 'm': - m_opt = TRUE; - break; - case 'n': - n_opt = atoi(optarg); - if (n_opt == 0) - n_opt = -1; - break; - case 'w': - w_opt = TRUE; - break; - default: - usage(); - break; - } - } - if (optind < argc) - usage(); - - test_inserts(0); - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/test_arrays.c b/test/test_arrays.c deleted file mode 100644 index e4b9fb1d391..00000000000 --- a/test/test_arrays.c +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007,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 * - * "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_arrays.c,v 1.5 2010/11/13 19:57:57 tom Exp $ - * - * Author: Thomas E Dickey - * - * Demonstrate the public arrays from the terminfo library. - -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; - - */ - -#define USE_TINFO -#include - -#if HAVE_TIGETSTR -#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) - -#define DUMP(name) dump_array(#name, name) - -static void -dump_array(const char *name, NCURSES_CONST char *const *list) -{ - int n; - - printf("%s:\n", name); - for (n = 0; list[n] != 0; ++n) { - printf("%5d:%s\n", n, list[n]); - } -} - -int -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) -{ - DUMP(boolnames); - DUMP(boolcodes); - DUMP(boolfnames); - - DUMP(numnames); - DUMP(numcodes); - DUMP(numfnames); - - DUMP(strnames); - DUMP(strcodes); - DUMP(strfnames); - - 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/test_get_wstr.c b/test/test_get_wstr.c deleted file mode 100644 index dc01b0e69c0..00000000000 --- a/test/test_get_wstr.c +++ /dev/null @@ -1,372 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007-2009,2011 Free 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_get_wstr.c,v 1.8 2011/01/15 18:15:11 tom Exp $ - * - * Author: Thomas E Dickey - * - * Demonstrate the get_wstr functions from the curses library. - - int get_wstr(wint_t *wstr); - int getn_wstr(wint_t *wstr, int n); - int wget_wstr(WINDOW *win, wint_t *wstr); - int wgetn_wstr(WINDOW *win, wint_t *wstr, int n); - int mvget_wstr(int y, int x, wint_t *wstr); - int mvgetn_wstr(int y, int x, wint_t *wstr, int n); - int mvwget_wstr(WINDOW *win, int y, int x, wint_t *wstr); - int mvwgetn_wstr(WINDOW *win, int y, int x, wint_t *wstr, int n); - */ - -#include - -#if HAVE_CHGAT -/* NetBSD curses wchgat */ - -#if USE_WIDEC_SUPPORT - -#define BASE_Y 6 -#define MAX_COLS 1024 - -typedef enum { - eGetStr = 0, - eGetNStr, - eMvGetStr, - eMvGetNStr, - eMaxFlavor -} Flavors; - -static bool -Quit(int ch) -{ - return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -static int -Remainder(WINDOW *txtwin) -{ - int result = getmaxx(txtwin) - getcurx(txtwin); - return (result > 0) ? result : 0; -} - -/* - * Show a highlighted line in the place where input will happen. - */ -static void -ShowPrompt(WINDOW *txtwin, int limit) -{ - wchgat(txtwin, limit, A_REVERSE, 0, NULL); - wnoutrefresh(txtwin); -} - -static void -MovePrompt(WINDOW *txtwin, int limit, int y, int x) -{ - wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL); - wmove(txtwin, y, x); - ShowPrompt(txtwin, limit); -} - -static int -ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) -{ - const char *name = "?"; - bool limited = FALSE; - bool wins = (txtwin != stdscr); - int result; - - switch (flavor) { - case eGetStr: - name = wins ? "wget_wstr" : "get_wstr"; - break; - case eGetNStr: - limited = TRUE; - name = wins ? "wgetn_wstr" : "getn_wstr"; - break; - case eMvGetStr: - name = wins ? "mvwget_wstr" : "mvget_wstr"; - break; - case eMvGetNStr: - limited = TRUE; - name = wins ? "mvwgetn_wstr" : "mvgetn_wstr"; - break; - case eMaxFlavor: - break; - } - - wmove(strwin, 0, 0); - werase(strwin); - - if (limited) { - wprintw(strwin, "%s(%d):", name, limit); - } else { - wprintw(strwin, "%s:", name); - } - result = limited ? limit : Remainder(txtwin); - ShowPrompt(txtwin, result); - - wnoutrefresh(strwin); - return result; -} - -static int -test_get_wstr(int level, char **argv, WINDOW *strwin) -{ - WINDOW *txtbox = 0; - WINDOW *txtwin = 0; - FILE *fp; - int ch; - int rc; - int txt_x = 0, txt_y = 0; - int base_y; - int flavor = 0; - int limit = getmaxx(strwin) - 5; - int actual; - wint_t buffer[MAX_COLS]; - - if (argv[level] == 0) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((ch = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(ch)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - wmove(txtwin, txt_y, txt_x); - actual = ShowFlavor(strwin, txtwin, flavor, limit); - while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { - switch (ch) { - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) { - MovePrompt(txtwin, actual, ++txt_y, txt_x); - } else { - beep(); - } - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) { - MovePrompt(txtwin, actual, --txt_y, txt_x); - } else { - beep(); - } - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) { - MovePrompt(txtwin, actual, txt_y, --txt_x); - } else { - beep(); - } - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) { - MovePrompt(txtwin, actual, txt_y, ++txt_x); - } else { - beep(); - } - break; - - case 'w': - test_get_wstr(level + 1, argv, strwin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - - case '-': - if (limit > 0) { - actual = ShowFlavor(strwin, txtwin, flavor, --limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - } else { - beep(); - } - break; - - case '+': - actual = ShowFlavor(strwin, txtwin, flavor, ++limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - break; - - case '<': - if (flavor > 0) { - actual = ShowFlavor(strwin, txtwin, --flavor, limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - } else { - beep(); - } - break; - - case '>': - if (flavor + 1 < eMaxFlavor) { - actual = ShowFlavor(strwin, txtwin, ++flavor, limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - } else { - beep(); - } - break; - - case ':': - actual = ShowFlavor(strwin, txtwin, flavor, limit); - *buffer = '\0'; - rc = ERR; - echo(); - (void) wattrset(txtwin, A_REVERSE); - switch (flavor) { - case eGetStr: - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - rc = wget_wstr(txtwin, buffer); - } else { - move(txt_y, txt_x); - rc = get_wstr(buffer); - } - break; - case eGetNStr: - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - rc = wgetn_wstr(txtwin, buffer, limit); - } else { - move(txt_y, txt_x); - rc = getn_wstr(buffer, limit); - } - break; - case eMvGetStr: - if (txtwin != stdscr) { - rc = mvwget_wstr(txtwin, txt_y, txt_x, buffer); - } else { - rc = mvget_wstr(txt_y, txt_x, buffer); - } - break; - case eMvGetNStr: - if (txtwin != stdscr) { - rc = mvwgetn_wstr(txtwin, txt_y, txt_x, buffer, limit); - } else { - rc = mvgetn_wstr(txt_y, txt_x, buffer, limit); - } - break; - case eMaxFlavor: - break; - } - noecho(); - (void) wattrset(txtwin, A_NORMAL); - wprintw(strwin, "%d", rc); - (void) waddwstr(strwin, (wchar_t *) buffer); - wnoutrefresh(strwin); - break; - default: - beep(); - break; - } - doupdate(); - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - WINDOW *chrbox; - WINDOW *strwin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(chrbox, 0, 0); - wnoutrefresh(chrbox); - - strwin = derwin(chrbox, 4, COLS - 2, 1, 1); - - test_get_wstr(1, argv, strwin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif -#else -int -main(void) -{ - printf("This program requires the curses chgat function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/test_getstr.c b/test/test_getstr.c deleted file mode 100644 index a0863937886..00000000000 --- a/test/test_getstr.c +++ /dev/null @@ -1,363 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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 * - * "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_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $ - * - * Author: Thomas E Dickey - * - * Demonstrate the getstr functions from the curses library. - - int getstr(char *str); - int getnstr(char *str, int n); - int wgetstr(WINDOW *win, char *str); - int wgetnstr(WINDOW *win, char *str, int n); - int mvgetstr(int y, int x, char *str); - int mvwgetstr(WINDOW *win, int y, int x, char *str); - int mvgetnstr(int y, int x, char *str, int n); - int mvwgetnstr(WINDOW *, int y, int x, char *str, int n); - */ - -#include - -#if HAVE_CHGAT -/* Solaris SVr4 curses lacks wchgat, mvgetnstr, mvwgetnstr */ - -#define BASE_Y 6 -#define MAX_COLS 1024 - -typedef enum { - eGetStr = 0, - eGetNStr, - eMvGetStr, - eMvGetNStr, - eMaxFlavor -} Flavors; - -static bool -Quit(int ch) -{ - return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -static int -Remainder(WINDOW *txtwin) -{ - int result = getmaxx(txtwin) - getcurx(txtwin); - return (result > 0) ? result : 0; -} - -/* - * Show a highlighted line in the place where input will happen. - */ -static void -ShowPrompt(WINDOW *txtwin, int limit) -{ - wchgat(txtwin, limit, A_REVERSE, 0, NULL); - wnoutrefresh(txtwin); -} - -static void -MovePrompt(WINDOW *txtwin, int limit, int y, int x) -{ - wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL); - wmove(txtwin, y, x); - ShowPrompt(txtwin, limit); -} - -static int -ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit) -{ - const char *name = "?"; - bool limited = FALSE; - bool wins = (txtwin != stdscr); - int result; - - switch (flavor) { - case eGetStr: - name = wins ? "wgetstr" : "getstr"; - break; - case eGetNStr: - limited = TRUE; - name = wins ? "wgetnstr" : "getnstr"; - break; - case eMvGetStr: - name = wins ? "mvwgetstr" : "mvgetstr"; - break; - case eMvGetNStr: - limited = TRUE; - name = wins ? "mvwgetnstr" : "mvgetnstr"; - break; - case eMaxFlavor: - break; - } - - wmove(strwin, 0, 0); - werase(strwin); - - if (limited) { - wprintw(strwin, "%s(%d):", name, limit); - } else { - wprintw(strwin, "%s:", name); - } - result = limited ? limit : Remainder(txtwin); - ShowPrompt(txtwin, result); - - wnoutrefresh(strwin); - return result; -} - -static int -test_getstr(int level, char **argv, WINDOW *strwin) -{ - WINDOW *txtbox = 0; - WINDOW *txtwin = 0; - FILE *fp; - int ch; - int rc; - int txt_x = 0, txt_y = 0; - int base_y; - int flavor = 0; - int limit = getmaxx(strwin) - 5; - int actual; - - char buffer[MAX_COLS]; - - if (argv[level] == 0) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((ch = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(ch)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - wmove(txtwin, txt_y, txt_x); - actual = ShowFlavor(strwin, txtwin, flavor, limit); - while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { - switch (ch) { - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) { - MovePrompt(txtwin, actual, ++txt_y, txt_x); - } else { - beep(); - } - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) { - MovePrompt(txtwin, actual, --txt_y, txt_x); - } else { - beep(); - } - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) { - MovePrompt(txtwin, actual, txt_y, --txt_x); - } else { - beep(); - } - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) { - MovePrompt(txtwin, actual, txt_y, ++txt_x); - } else { - beep(); - } - break; - - case 'w': - test_getstr(level + 1, argv, strwin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - - case '-': - if (limit > 0) { - actual = ShowFlavor(strwin, txtwin, flavor, --limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - } else { - beep(); - } - break; - - case '+': - actual = ShowFlavor(strwin, txtwin, flavor, ++limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - break; - - case '<': - if (flavor > 0) { - actual = ShowFlavor(strwin, txtwin, --flavor, limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - } else { - beep(); - } - break; - - case '>': - if (flavor + 1 < eMaxFlavor) { - actual = ShowFlavor(strwin, txtwin, ++flavor, limit); - MovePrompt(txtwin, actual, txt_y, txt_x); - } else { - beep(); - } - break; - - case ':': - actual = ShowFlavor(strwin, txtwin, flavor, limit); - *buffer = '\0'; - rc = ERR; - echo(); - (void) wattrset(txtwin, A_REVERSE); - switch (flavor) { - case eGetStr: - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - rc = wgetstr(txtwin, buffer); - } else { - move(txt_y, txt_x); - rc = getstr(buffer); - } - break; - case eGetNStr: - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - rc = wgetnstr(txtwin, buffer, limit); - } else { - move(txt_y, txt_x); - rc = getnstr(buffer, limit); - } - break; - case eMvGetStr: - if (txtwin != stdscr) { - rc = mvwgetstr(txtwin, txt_y, txt_x, buffer); - } else { - rc = mvgetstr(txt_y, txt_x, buffer); - } - break; - case eMvGetNStr: - if (txtwin != stdscr) { - rc = mvwgetnstr(txtwin, txt_y, txt_x, buffer, limit); - } else { - rc = mvgetnstr(txt_y, txt_x, buffer, limit); - } - break; - case eMaxFlavor: - break; - } - noecho(); - (void) wattrset(txtwin, A_NORMAL); - wprintw(strwin, "%d:%s", rc, buffer); - wnoutrefresh(strwin); - break; - default: - beep(); - break; - } - doupdate(); - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - WINDOW *chrbox; - WINDOW *strwin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(chrbox, 0, 0); - wnoutrefresh(chrbox); - - strwin = derwin(chrbox, 4, COLS - 2, 1, 1); - - test_getstr(1, argv, strwin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} - -#else -int -main(void) -{ - printf("This program requires the curses chgat function\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/test_instr.c b/test/test_instr.c deleted file mode 100644 index 627db08e2f3..00000000000 --- a/test/test_instr.c +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007,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"), 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_instr.c,v 1.5 2010/05/01 19:13:46 tom Exp $ - * - * Author: Thomas E Dickey - * - * Demonstrate the instr functions from the curses library. - - int instr(char *str); - int innstr(char *str, int n); - int winstr(WINDOW *win, char *str); - int winnstr(WINDOW *win, char *str, int n); - int mvinstr(int y, int x, char *str); - int mvinnstr(int y, int x, char *str, int n); - int mvwinstr(WINDOW *win, int y, int x, char *str); - int mvwinnstr(WINDOW *win, int y, int x, char *str, int n); - */ - -#include - -#define BASE_Y 6 -#define MAX_COLS 1024 - -static bool -Quit(int ch) -{ - return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -static void -show_1st(WINDOW *win, int line, char *buffer) -{ - MvWAddStr(win, line, 5, buffer); -} - -static void -showmore(WINDOW *win, int line, char *buffer) -{ - wmove(win, line, 0); - wclrtoeol(win); - show_1st(win, line, buffer); -} - -static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) -{ - WINDOW *txtbox = 0; - WINDOW *txtwin = 0; - FILE *fp; - int ch; - int txt_x = 0, txt_y = 0; - int base_y; - int limit = getmaxx(strwin) - 5; - - char buffer[MAX_COLS]; - - if (argv[level] == 0) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((ch = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(ch)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { - switch (ch) { - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) - txt_y++; - else - beep(); - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) - txt_y--; - else - beep(); - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) - txt_x--; - else - beep(); - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) - txt_x++; - else - beep(); - break; - case 'w': - test_inchs(level + 1, argv, chrwin, strwin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - case '-': - if (limit > 0) { - --limit; - } else { - beep(); - } - break; - case '+': - ++limit; - break; - default: - beep(); - break; - } - - MvWPrintw(chrwin, 0, 0, "line:"); - wclrtoeol(chrwin); - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - - if (winstr(txtwin, buffer) != ERR) { - show_1st(chrwin, 0, buffer); - } - if (mvwinstr(txtwin, txt_y, txt_x, buffer) != ERR) { - showmore(chrwin, 1, buffer); - } - } else { - move(txt_y, txt_x); - - if (instr(buffer) != ERR) { - show_1st(chrwin, 0, buffer); - } - if (mvinstr(txt_y, txt_x, buffer) != ERR) { - showmore(chrwin, 1, buffer); - } - } - wnoutrefresh(chrwin); - - MvWPrintw(strwin, 0, 0, "%4d:", limit); - wclrtobot(strwin); - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - if (winnstr(txtwin, buffer, limit) != ERR) { - show_1st(strwin, 0, buffer); - } - - if (mvwinnstr(txtwin, txt_y, txt_x, buffer, limit) != ERR) { - showmore(strwin, 1, buffer); - } - } else { - move(txt_y, txt_x); - if (innstr(buffer, limit) != ERR) { - show_1st(strwin, 0, buffer); - } - - if (mvinnstr(txt_y, txt_x, buffer, limit) != ERR) { - showmore(strwin, 1, buffer); - } - } - - wnoutrefresh(strwin); - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - WINDOW *chrbox; - WINDOW *chrwin; - WINDOW *strwin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(chrbox, 0, 0); - wnoutrefresh(chrbox); - - chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); - strwin = derwin(chrbox, 2, COLS - 2, 3, 1); - - test_inchs(1, argv, chrwin, strwin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/test_inwstr.c b/test/test_inwstr.c deleted file mode 100644 index 3d2656f3aea..00000000000 --- a/test/test_inwstr.c +++ /dev/null @@ -1,269 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2007,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"), 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_inwstr.c,v 1.4 2010/05/01 19:13:46 tom Exp $ - * - * Author: Thomas E Dickey - * - * Demonstrate the inwstr functions from the curses library. - - int inwstr(wchar_t *str); - int innwstr(wchar_t *str, int n); - int winwstr(WINDOW *win, wchar_t *str); - int winnwstr(WINDOW *win, wchar_t *str, int n); - int mvinwstr(int y, int x, wchar_t *str); - int mvinnwstr(int y, int x, wchar_t *str, int n); - int mvwinwstr(WINDOW *win, int y, int x, wchar_t *str); - int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *str, int n); - */ - -#include - -#if USE_WIDEC_SUPPORT - -#define BASE_Y 6 -#define MAX_COLS 1024 - -static bool -Quit(int ch) -{ - return (ch == ERR || ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -static void -show_1st(WINDOW *win, int line, wchar_t *buffer) -{ - (void) mvwaddwstr(win, line, 5, buffer); -} - -static void -showmore(WINDOW *win, int line, wchar_t *buffer) -{ - wmove(win, line, 0); - wclrtoeol(win); - show_1st(win, line, buffer); -} - -static int -test_inchs(int level, char **argv, WINDOW *chrwin, WINDOW *strwin) -{ - WINDOW *txtbox = 0; - WINDOW *txtwin = 0; - FILE *fp; - int ch; - int txt_x = 0, txt_y = 0; - int base_y; - int limit = getmaxx(strwin) - 5; - wchar_t buffer[MAX_COLS]; - - if (argv[level] == 0) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((ch = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(ch)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) { - switch (ch) { - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) - txt_y++; - else - beep(); - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) - txt_y--; - else - beep(); - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) - txt_x--; - else - beep(); - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) - txt_x++; - else - beep(); - break; - case 'w': - test_inchs(level + 1, argv, chrwin, strwin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - case '-': - if (limit > 0) { - --limit; - } else { - beep(); - } - break; - case '+': - ++limit; - break; - default: - beep(); - break; - } - - MvWPrintw(chrwin, 0, 0, "line:"); - wclrtoeol(chrwin); - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - - if (winwstr(txtwin, buffer) != ERR) { - show_1st(chrwin, 0, buffer); - } - if (mvwinwstr(txtwin, txt_y, txt_x, buffer) != ERR) { - showmore(chrwin, 1, buffer); - } - } else { - move(txt_y, txt_x); - - if (inwstr(buffer) != ERR) { - show_1st(chrwin, 0, buffer); - } - if (mvinwstr(txt_y, txt_x, buffer) != ERR) { - showmore(chrwin, 1, buffer); - } - } - wnoutrefresh(chrwin); - - MvWPrintw(strwin, 0, 0, "%4d:", limit); - wclrtobot(strwin); - - if (txtwin != stdscr) { - wmove(txtwin, txt_y, txt_x); - if (winnwstr(txtwin, buffer, limit) != ERR) { - show_1st(strwin, 0, buffer); - } - - if (mvwinnwstr(txtwin, txt_y, txt_x, buffer, limit) != ERR) { - showmore(strwin, 1, buffer); - } - } else { - move(txt_y, txt_x); - if (innwstr(buffer, limit) != ERR) { - show_1st(strwin, 0, buffer); - } - - if (mvinnwstr(txt_y, txt_x, buffer, limit) != ERR) { - showmore(strwin, 1, buffer); - } - } - - wnoutrefresh(strwin); - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -int -main(int argc, char *argv[]) -{ - WINDOW *chrbox; - WINDOW *chrwin; - WINDOW *strwin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - chrbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(chrbox, 0, 0); - wnoutrefresh(chrbox); - - chrwin = derwin(chrbox, 2, COLS - 2, 1, 1); - strwin = derwin(chrbox, 2, COLS - 2, 3, 1); - - test_inchs(1, argv, chrwin, strwin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the wide-ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/test_opaque.c b/test/test_opaque.c deleted file mode 100644 index 6ec75fa11a2..00000000000 --- a/test/test_opaque.c +++ /dev/null @@ -1,471 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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 * - * "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_opaque.c,v 1.9 2009/10/24 21:21:29 tom Exp $ - * - * Author: Thomas E Dickey - * - * Demonstrate the opaque functions from the curses library. - - WINDOW * wgetparent (const WINDOW *); - bool is_cleared(const WINDOW *win); - bool is_idcok(const WINDOW *win); - bool is_idlok(const WINDOW *win); - bool is_immedok(const WINDOW *win); - bool is_keypad(const WINDOW *win); - bool is_leaveok(const WINDOW *win); - bool is_nodelay(const WINDOW *win); - bool is_notimeout(const WINDOW *win); - bool is_scrollok(const WINDOW *win); - bool is_syncok(const WINDOW *win); - int wgetscrreg (const WINDOW *, int *, int *); - */ - -#include - -#define BASE_Y 6 -#define MAX_COLS 1024 - -#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119) && NCURSES_EXT_FUNCS - -static bool -Quit(int ch) -{ - return (ch == 'q' || ch == QUIT || ch == ESCAPE); -} - -typedef bool(*BoolOpaque) (WINDOW *, int); - -static bool -test_opaque_cleared(WINDOW *win, int mode) -{ - if (mode >= 0) { - if (mode) - wclear(win); - } - return is_cleared(win); -} - -static bool -test_opaque_idcok(WINDOW *win, int mode) -{ - if (mode >= 0) { - idcok(win, mode); - } - return is_idcok(win); -} - -static bool -test_opaque_idlok(WINDOW *win, int mode) -{ - if (mode >= 0) { - idlok(win, mode); - } - return is_idlok(win); -} - -static bool -test_opaque_immedok(WINDOW *win, int mode) -{ - if (mode >= 0) { - immedok(win, mode); - } - return is_immedok(win); -} - -static bool -test_opaque_keypad(WINDOW *win, int mode) -{ - if (mode >= 0) { - keypad(win, mode); - } - return is_keypad(win); -} - -static bool -test_opaque_leaveok(WINDOW *win, int mode) -{ - if (mode >= 0) { - leaveok(win, mode); - } - return is_leaveok(win); -} - -static bool -test_opaque_nodelay(WINDOW *win, int mode) -{ - if (mode >= 0) { - nodelay(win, mode); - } - return is_nodelay(win); -} - -static bool -test_opaque_notimeout(WINDOW *win, int mode) -{ - if (mode >= 0) { - notimeout(win, mode); - } - return is_notimeout(win); -} - -static bool -test_opaque_scrollok(WINDOW *win, int mode) -{ - if (mode >= 0) { - scrollok(win, mode); - } - return is_scrollok(win); -} - -static bool -test_opaque_syncok(WINDOW *win, int mode) -{ - if (mode >= 0) { - syncok(win, mode); - } - return is_syncok(win); -} - -static int -status_y(WINDOW *stswin, int cell) -{ - return (cell % getmaxy(stswin)); -} - -static int -status_x(WINDOW *stswin, int cell) -{ - return (15 * (cell / getmaxy(stswin))); -} - -static void -to_keyword(WINDOW *stswin, int cell) -{ - wmove(stswin, status_y(stswin, cell), status_x(stswin, cell)); -} - -static void -to_result(WINDOW *stswin, int cell, bool before) -{ - int y = status_y(stswin, cell); - int x = status_x(stswin, cell) + 11; - if (!before) - ++x; - wmove(stswin, y, x); -} - -static void -show_keyword(WINDOW *stswin, int cell, int active, const char *name) -{ - to_keyword(stswin, cell); - if (active == cell) - (void) wstandout(stswin); - wprintw(stswin, "%s:", name); - if (active == cell) - (void) wstandend(stswin); -} -/* *INDENT-OFF* */ -static struct { - const char *name; - BoolOpaque func; -} bool_funcs[] = { - { "cleared", test_opaque_cleared }, - { "idcok", test_opaque_idcok }, - { "idlok", test_opaque_idlok }, - { "immedok", test_opaque_immedok }, - { "keypad", test_opaque_keypad }, - { "leaveok", test_opaque_leaveok }, - { "nodelay", test_opaque_nodelay }, - { "notimeout", test_opaque_notimeout }, - { "scrollok", test_opaque_scrollok }, - { "syncok", test_opaque_syncok } -}; -/* *INDENT-ON* */ - -/* - * Display and/or allow update for the properties accessed in the opaque - * window. Some may change state after refreshing the window, so we - * distinguish between them using the 'before' parameter. - */ -static int -show_opaque(WINDOW *stswin, WINDOW *txtwin, bool before, int active) -{ - int n; - int top, bottom; - - if (before) { - werase(stswin); - } - for (n = 0; n < (int) SIZEOF(bool_funcs); ++n) { - show_keyword(stswin, n, active, bool_funcs[n].name); - - to_result(stswin, n, before); - wprintw(stswin, "%c", bool_funcs[n].func(txtwin, -1) ? 'T' : 'F'); - } - - show_keyword(stswin, n, active, "wgetparent"); - to_result(stswin, n, TRUE); - wprintw(stswin, "%p", (void *) wgetparent(txtwin)); - - ++n; - show_keyword(stswin, n, active, "wgetscrreg"); - to_result(stswin, n, TRUE); - if (wgetscrreg(txtwin, &top, &bottom) == OK) - wprintw(stswin, "%d,%d", top, bottom); - - wnoutrefresh(stswin); - return active; -} - -static int -test_opaque(int level, char **argv, WINDOW *stswin) -{ - WINDOW *txtbox = 0; - WINDOW *txtwin = 0; - FILE *fp; - int ch; - int txt_x = 0, txt_y = 0; - int base_y; - bool in_status = FALSE; - int active = 0; - - if (argv[level] == 0) { - beep(); - return FALSE; - } - - if (level > 1) { - txtbox = newwin(LINES - BASE_Y, COLS - level, BASE_Y, level); - box(txtbox, 0, 0); - wnoutrefresh(txtbox); - - txtwin = derwin(txtbox, - getmaxy(txtbox) - 2, - getmaxx(txtbox) - 2, - 1, 1); - base_y = 0; - } else { - txtwin = stdscr; - base_y = BASE_Y; - } - - keypad(txtwin, TRUE); /* enable keyboard mapping */ - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - txt_y = base_y; - txt_x = 0; - wmove(txtwin, txt_y, txt_x); - - if ((fp = fopen(argv[level], "r")) != 0) { - while ((ch = fgetc(fp)) != EOF) { - if (waddch(txtwin, UChar(ch)) != OK) { - break; - } - } - fclose(fp); - } else { - wprintw(txtwin, "Cannot open:\n%s", argv[1]); - } - - for (;;) { - if (in_status) { - to_keyword(stswin, active); - - ch = wgetch(stswin); - show_opaque(stswin, txtwin, TRUE, active); - if (Quit(ch)) - break; - - switch (ch) { - case '\t': - in_status = FALSE; - break; - case KEY_DOWN: - case 'j': - if (active < (int) SIZEOF(bool_funcs) - 1) - active++; - else - beep(); - break; - case KEY_UP: - case 'k': - if (active > 0) - active--; - else - beep(); - break; - case ' ': - bool_funcs[active].func(txtwin, - !bool_funcs[active].func(txtwin, -1)); - break; - default: - beep(); - break; - } - show_opaque(stswin, txtwin, FALSE, in_status ? active : -1); - } else { - ch = mvwgetch(txtwin, txt_y, txt_x); - show_opaque(stswin, txtwin, TRUE, -1); - if (Quit(ch)) - break; - - switch (ch) { - case '\t': - in_status = TRUE; - break; - case KEY_DOWN: - case 'j': - if (txt_y < getmaxy(txtwin) - 1) - txt_y++; - else - beep(); - break; - case KEY_UP: - case 'k': - if (txt_y > base_y) - txt_y--; - else - beep(); - break; - case KEY_LEFT: - case 'h': - if (txt_x > 0) - txt_x--; - else - beep(); - break; - case KEY_RIGHT: - case 'l': - if (txt_x < getmaxx(txtwin) - 1) - txt_x++; - else - beep(); - break; - case 'w': - test_opaque(level + 1, argv, stswin); - if (txtbox != 0) { - touchwin(txtbox); - wnoutrefresh(txtbox); - } else { - touchwin(txtwin); - wnoutrefresh(txtwin); - } - break; - default: - beep(); - napms(100); - break; - } - - show_opaque(stswin, txtwin, FALSE, -1); - } - } - if (level > 1) { - delwin(txtwin); - delwin(txtbox); - } - return TRUE; -} - -static void -test_set_escdelay(void) -{ - set_escdelay((100 + ESCDELAY) / 2); -} - -static void -test_set_tabsize(void) -{ - int y0, x0; - int y, x; - int save_tabsize = TABSIZE; - - (void) cbreak(); /* take input chars one at a time, no wait for \n */ - (void) noecho(); /* don't echo input */ - - for (y = 0; y < LINES; ++y) { - set_tabsize(y + 1); - if (move(y, 0) == ERR) - break; - for (x = 0; x < COLS;) { - addch('\t'); - if (addch('*') == ERR) { - break; - } - getyx(stdscr, y0, x0); - if (y0 != y || x0 == x) { - break; - } - } - } - getch(); - erase(); - - set_tabsize(save_tabsize); -} - -int -main(int argc, char *argv[]) -{ - WINDOW *stsbox; - WINDOW *stswin; - - setlocale(LC_ALL, ""); - - if (argc < 2) { - fprintf(stderr, "usage: %s file\n", argv[0]); - return EXIT_FAILURE; - } - - initscr(); - - test_set_escdelay(); - test_set_tabsize(); - - stsbox = derwin(stdscr, BASE_Y, COLS, 0, 0); - box(stsbox, 0, 0); - wnoutrefresh(stsbox); - - stswin = derwin(stsbox, BASE_Y - 2, COLS - 2, 1, 1); - keypad(stswin, TRUE); - - test_opaque(1, argv, stswin); - - endwin(); - ExitProgram(EXIT_SUCCESS); -} -#else -int -main(void) -{ - printf("This program requires the ncurses library\n"); - ExitProgram(EXIT_FAILURE); -} -#endif diff --git a/test/testaddch.c b/test/testaddch.c deleted file mode 100644 index 7a909e28ab9..00000000000 --- a/test/testaddch.c +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2006,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 * - * "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. * - ****************************************************************************/ -/* - * This is an example written by Alexander V. Lukyanov , - * to demonstrate an inconsistency between ncurses and SVr4 curses. - * - * $Id: testaddch.c,v 1.7 2009/08/29 19:02:25 tom Exp $ - */ -#include - -static void -attr_addstr(const char *s, chtype a) -{ - while (*s) - addch(((unsigned char) (*s++)) | a); -} - -int -main( - int argc GCC_UNUSED, - char *argv[]GCC_UNUSED) -{ - unsigned i; - chtype back, set, attr; - - setlocale(LC_ALL, ""); - - initscr(); - start_color(); - init_pair(1, COLOR_WHITE, COLOR_BLUE); - init_pair(2, COLOR_WHITE, COLOR_RED); - init_pair(3, COLOR_BLACK, COLOR_MAGENTA); - init_pair(4, COLOR_BLACK, COLOR_GREEN); - init_pair(5, COLOR_BLACK, COLOR_CYAN); - init_pair(6, COLOR_BLACK, COLOR_YELLOW); - init_pair(7, COLOR_BLACK, COLOR_WHITE); - - for (i = 0; i < 8; i++) { - back = (i & 1) ? A_BOLD | 'B' : ' '; - set = (i & 2) ? A_REVERSE : 0; - attr = (i & 4) ? COLOR_PAIR(4) : 0; - - bkgdset(back); - (void) attrset(set); - - attr_addstr("Test string with spaces -> <-\n", attr); - } - addch('\n'); - for (i = 0; i < 8; i++) { - back = (i & 1) ? A_BOLD | 'B' | COLOR_PAIR(1) : ' '; - set = (i & 2) ? A_REVERSE | COLOR_PAIR(2) : 0; - attr = (i & 4) ? COLOR_PAIR(4) : 0; - - bkgdset(back); - (void) attrset(set); - - attr_addstr("Test string with spaces -> <-\n", attr); - } - - getch(); - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/testcurs.c b/test/testcurs.c deleted file mode 100644 index 5cc62f2df30..00000000000 --- a/test/testcurs.c +++ /dev/null @@ -1,737 +0,0 @@ -/* - * This is a test program for the PDCurses screen package for IBM PC type - * machines. - * - * This program was written by John Burnell (johnb@kea.am.dsir.govt.nz) - * wrs(5/28/93) -- modified to be consistent (perform identically) with either - * PDCurses or under Unix System V, R4 - * - * $Id: testcurs.c,v 1.43 2010/11/13 21:02:28 tom Exp $ - */ - -#include - -#if defined(XCURSES) -char *XCursesProgramName = "testcurs"; -#endif - -static int initTest(WINDOW **); -static void display_menu(int, int); -static void inputTest(WINDOW *); -static void introTest(WINDOW *); -static void outputTest(WINDOW *); -static void padTest(WINDOW *); -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) - -#if !HAVE_STRDUP -#define strdup my_strdup -static char * -strdup(char *s) -{ - char *p = typeMalloc(char, strlen(s) + 1); - if (p) - strcpy(p, s); - return (p); -} -#endif /* not HAVE_STRDUP */ - -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, 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) -{ - int y1 = getmaxy(win); - int x1 = getmaxx(win); - int y0 = y1 < 10 ? y1 : 10; - int x0 = 1; - chtype save; - - save = mvwinch(win, y0, x1 - 1); - - MvWAddStr(win, y0, x0, " Press any key to continue"); - wclrtoeol(win); - getyx(win, y0, x0); - - MvWAddCh(win, y0, x1 - 1, save); - - wmove(win, y0, x0); - raw(); - wgetch(win); -} - -static int -initTest(WINDOW **win) -{ -#ifdef PDCDEBUG - PDC_debug("initTest called\n"); -#endif -#ifdef TRACE - trace(TRACE_MAXIMUM); -#endif - initscr(); -#ifdef PDCDEBUG - PDC_debug("after initscr()\n"); -#endif -#ifdef A_COLOR - if (has_colors()) - start_color(); -#endif - width = 60; - height = 13; /* Create a drawing window */ - *win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); - if (*win == NULL) { - endwin(); - return 0; - } - return 1; -} - -static void -introTest(WINDOW *win) -{ - wmove(win, height / 2 - 5, width / 2); - wvline(win, ACS_VLINE, 10); - wmove(win, height / 2, width / 2 - 10); - whline(win, ACS_HLINE, 20); - Continue(win); - - beep(); - werase(win); - - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - cbreak(); - MvWAddStr(win, 1, 1, - "You should have rectangle in the middle of the screen"); - MvWAddStr(win, 2, 1, "You should have heard a beep"); - Continue(win); - return; -} - -static void -scrollTest(WINDOW *win) -{ - int i; - int half; - int OldY; - NCURSES_CONST char *Message = "The window will now scroll slowly"; - - wclear(win); - OldY = getmaxy(win); - half = OldY / 2; - MvWAddStr(win, OldY - 2, 1, Message); - wrefresh(win); - scrollok(win, TRUE); - for (i = 1; i <= OldY; i++) { - napms(600); - scroll(win); - wrefresh(win); - } - - werase(win); - for (i = 1; i < OldY; i++) { - MvWPrintw(win, i, 1, "Line %d", i); - } - MvWPrintw(win, OldY - 2, 1, "The top of the window will scroll"); - wmove(win, 1, 1); - wsetscrreg(win, 0, half - 1); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - for (i = 1; i <= half; i++) { - napms(600); - scroll(win); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - } - - werase(win); - for (i = 1; i < OldY; i++) { - MvWPrintw(win, i, 1, "Line %d", i); - } - MvWPrintw(win, 1, 1, "The bottom of the window will scroll"); - wmove(win, OldY - 2, 1); - wsetscrreg(win, half, --OldY); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - for (i = half; i <= OldY; i++) { - napms(600); - wscrl(win, -1); - box(win, ACS_VLINE, ACS_HLINE); - wrefresh(win); - } - wsetscrreg(win, 0, OldY); -} - -static void -inputTest(WINDOW *win) -{ - int answered; - int repeat; - int w, h, bx, by, sw, sh, i, c, num; - char buffer[80]; - WINDOW *subWin; - wclear(win); - - getmaxyx(win, h, w); - getbegyx(win, by, bx); - sw = w / 3; - sh = h / 3; - if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == NULL) - return; - -#ifdef A_COLOR - if (has_colors()) { - init_pair(2, COLOR_WHITE, COLOR_RED); - wbkgd(subWin, COLOR_PAIR(2) | A_BOLD); - } else - wbkgd(subWin, A_BOLD); -#else - wbkgd(subWin, A_BOLD); -#endif - box(subWin, ACS_VLINE, ACS_HLINE); - wrefresh(win); - - nocbreak(); - MvWAddStr(win, 2, 1, "Press some keys for 5 seconds"); - MvWAddStr(win, 1, 1, "Pressing ^C should do nothing"); - wrefresh(win); - - werase(subWin); - box(subWin, ACS_VLINE, ACS_HLINE); - for (i = 0; i < 5; i++) { - MvWPrintw(subWin, 1, 1, "Time = %d", i); - wrefresh(subWin); - napms(1000); - flushinp(); - } - - delwin(subWin); - werase(win); - flash(); - wrefresh(win); - napms(500); - - MvWAddStr(win, 2, 1, "Press a key, followed by ENTER"); - wmove(win, 9, 10); - wrefresh(win); - echo(); - noraw(); - wgetch(win); - flushinp(); - - wmove(win, 9, 10); - wdelch(win); - MvWAddStr(win, 4, 1, "The character should now have been deleted"); - Continue(win); - - wclear(win); - MvWAddStr(win, 1, 1, "Press keys (or mouse buttons) to show their names"); - MvWAddStr(win, 2, 1, "Press spacebar to finish"); - wrefresh(win); - - keypad(win, TRUE); - raw(); - noecho(); - -#if HAVE_TYPEAHEAD - typeahead(-1); -#endif - -#if defined(PDCURSES) - mouse_set(ALL_MOUSE_EVENTS); -#endif - - for (;;) { - wmove(win, 3, 5); - c = wgetch(win); - wclrtobot(win); - if (c >= KEY_MIN) - wprintw(win, "Key Pressed: %s", keyname(c)); - else if (isprint(c)) - wprintw(win, "Key Pressed: %c", c); - else - wprintw(win, "Key Pressed: %s", unctrl(UChar(c))); -#if defined(PDCURSES) - if (c == KEY_MOUSE) { - int button = 0; - request_mouse_pos(); - if (BUTTON_CHANGED(1)) - button = 1; - else if (BUTTON_CHANGED(2)) - button = 2; - else if (BUTTON_CHANGED(3)) - button = 3; - else - button = 0; - wmove(win, 4, 18); - wprintw(win, "Button %d: ", button); - if (MOUSE_MOVED) - wprintw(win, "moved: "); - else if ((BUTTON_STATUS(button) & BUTTON_ACTION_MASK) == BUTTON_PRESSED) - wprintw(win, "pressed: "); - else if ((BUTTON_STATUS(button) & BUTTON_ACTION_MASK) == BUTTON_DOUBLE_CLICKED) - wprintw(win, "double: "); - else - wprintw(win, "released: "); - wprintw(win, " Position: Y: %d X: %d", MOUSE_Y_POS, MOUSE_X_POS); - } -#endif - wrefresh(win); - if (c == ' ') - break; - } -#if 0 - nodelay(win, TRUE); - wgetch(win); - nodelay(win, FALSE); -#endif -#if defined(PDCURSES) - mouse_set(0L); -#endif - refresh(); - - repeat = 0; - do { - static const char *fmt[] = - { - "%d %10s", - "%d %[a-zA-Z]s", - "%d %[][a-zA-Z]s", - "%d %[^0-9]" - }; - const char *format = fmt[(unsigned) repeat % SIZEOF(fmt)]; - - wclear(win); - MvWAddStr(win, 3, 2, "The window should have moved"); - MvWAddStr(win, 4, 2, - "This text should have appeared without you pressing a key"); - MvWPrintw(win, 6, 2, - "Scanning with format \"%s\"", format); - mvwin(win, 2 + 2 * (repeat % 4), 1 + 2 * (repeat % 4)); - erase(); - refresh(); - wrefresh(win); - echo(); - noraw(); - num = 0; - *buffer = 0; - answered = mvwscanw(win, 7, 6, strdup(format), &num, buffer); - MvWPrintw(win, 8, 6, - "String: %s Number: %d (%d values read)", - buffer, num, answered); - Continue(win); - ++repeat; - } while (answered > 0); -} - -static void -outputTest(WINDOW *win) -{ - WINDOW *win1; - char Buffer[80]; - chtype ch; - int by, bx; - -#if !HAVE_TIGETSTR -#if HAVE_TGETENT - char tc_buffer[4096]; - char tc_parsed[4096]; - char *area_pointer = tc_parsed; - tgetent(tc_buffer, getenv("TERM")); -#else -#define tgetstr(a,b) 0 -#endif -#endif /* !HAVE_TIGETSTR */ - - nl(); - wclear(win); - MvWAddStr(win, 1, 1, - "You should now have a screen in the upper left corner, and this text should have wrapped"); - mvwin(win, 2, 1); - waddstr(win, "\nThis text should be down\n"); - waddstr(win, "and broken into two here ^"); - Continue(win); - - wclear(win); - wattron(win, A_BOLD); - MvWAddStr(win, 1, 1, "A new window will appear with this text in it"); - MvWAddStr(win, 8, 1, "Press any key to continue"); - wrefresh(win); - wgetch(win); - - getbegyx(win, by, bx); - - if (LINES < 24 || COLS < 75) { - MvWAddStr(win, 5, 1, - "Some tests have been skipped as they require a"); - MvWAddStr(win, 6, 1, "display of at least 24 LINES by 75 COLUMNS"); - Continue(win); - } else { - win1 = newwin(10, 50, 14, 25); - if (win1 == NULL) { - endwin(); - return; - } -#ifdef A_COLOR - if (has_colors()) { - init_pair(3, COLOR_BLUE, COLOR_WHITE); - wbkgd(win1, COLOR_PAIR(3)); - } else - wbkgd(win1, A_NORMAL); -#else - wbkgd(win1, A_NORMAL); -#endif - wclear(win1); - MvWAddStr(win1, 5, 1, - "This text should appear; using overlay option"); - copywin(win, win1, 0, 0, 0, 0, 9, 49, TRUE); - -#if defined(PDCURSES) && !defined(XCURSES) - box(win1, 0xb3, 0xc4); -#else - box(win1, ACS_VLINE, ACS_HLINE); -#endif - wmove(win1, 8, 26); - wrefresh(win1); - wgetch(win1); - - wclear(win1); - wattron(win1, A_BLINK); - MvWAddStr(win1, 4, 1, - "This blinking text should appear in only the second window"); - wattroff(win1, A_BLINK); - mvwin(win1, by, bx); - overlay(win, win1); - mvwin(win1, 14, 25); - wmove(win1, 8, 26); - wrefresh(win1); - wgetch(win1); - delwin(win1); - } - - clear(); - wclear(win); - wrefresh(win); - MvWAddStr(win, 6, 2, "This line shouldn't appear"); - MvWAddStr(win, 4, 2, "Only half of the next line is visible"); - MvWAddStr(win, 5, 2, "Only half of the next line is visible"); - wmove(win, 6, 1); - wclrtobot(win); - wmove(win, 5, 20); - wclrtoeol(win); - MvWAddStr(win, 8, 2, "This line also shouldn't appear"); - wmove(win, 8, 1); - wdeleteln(win); - Continue(win); - - wmove(win, 5, 9); - ch = winch(win); - - wclear(win); - wmove(win, 6, 2); - waddstr(win, "The next char should be l: "); - winsch(win, ch); - Continue(win); - -#if HAVE_WINSSTR - (void) mvwinsstr(win, 6, 2, "A1B2C3D4E5"); - Continue(win); -#endif - - wmove(win, 5, 1); - winsertln(win); - MvWAddStr(win, 5, 2, "The lines below should have moved down"); - Continue(win); - - wclear(win); - wmove(win, 2, 2); - wprintw(win, "This is a formatted string in a window: %d %s\n", 42, - "is it"); - MvWAddStr(win, 10, 1, "Enter a string: "); - wrefresh(win); - noraw(); - echo(); - *Buffer = 0; - wscanw(win, "%s", Buffer); - - printw("This is a formatted string in stdscr: %d %s\n", 42, "is it"); - MvAddStr(10, 1, "Enter a string: "); - *Buffer = 0; - scanw("%s", Buffer); - - if (TIGETSTR("cvvis", "vs") != 0) { - wclear(win); - curs_set(2); - MvWAddStr(win, 1, 1, "The cursor should appear as a block (visible)"); - Continue(win); - } - - if (TIGETSTR("civis", "vi") != 0) { - wclear(win); - curs_set(0); - MvWAddStr(win, 1, 1, - "The cursor should have disappeared (invisible)"); - Continue(win); - } - - if (TIGETSTR("cnorm", "ve") != 0) { - wclear(win); - curs_set(1); - MvWAddStr(win, 1, 1, "The cursor should be an underline (normal)"); - Continue(win); - } -#ifdef A_COLOR - if (has_colors()) { - wclear(win); - MvWAddStr(win, 1, 1, "Colors should change after you press a key"); - Continue(win); - init_pair(1, COLOR_RED, COLOR_WHITE); - wrefresh(win); - } -#endif - - werase(win); - -#if HAVE_TERMNAME - MvWAddStr(win, 1, 1, "Information About Your Terminal"); - MvWAddStr(win, 3, 1, termname()); - MvWAddStr(win, 4, 1, longname()); - if (termattrs() & A_BLINK) - MvWAddStr(win, 5, 1, "This terminal supports blinking."); - else - MvWAddStr(win, 5, 1, "This terminal does NOT support blinking."); -#endif - - (void) mvwaddnstr(win, 7, 5, "Have a nice day!ok", 16); - wrefresh(win); - - (void) mvwinnstr(win, 7, 5, Buffer, 18); - MvAddStr(LINES - 2, 10, Buffer); - refresh(); - Continue(win); -} - -#if defined(PDCURSES) && !defined(XCURSES) -static void -resizeTest(WINDOW *dummy GCC_UNUSED) -{ - WINDOW *win1; - - savetty(); - - clear(); - refresh(); -# if defined(OS2) - resize_term(50, 120); -# else - resize_term(50, 80); -# endif - - win1 = newwin(10, 50, 14, 25); - if (win1 == NULL) { - endwin(); - return; - } -#ifdef A_COLOR - if (has_colors()) { - init_pair(3, COLOR_BLUE, COLOR_WHITE); - wattrset(win1, COLOR_PAIR(3)); - } -#endif - wclear(win1); - - MvWAddStr(win1, 1, 1, "The screen may now have 50 lines"); - Continue(win1); - - wclear(win1); - resetty(); - - MvWAddStr(win1, 1, 1, "The screen should now be reset"); - Continue(win1); - - delwin(win1); - - clear(); - refresh(); - -} -#endif - -static void -padTest(WINDOW *dummy GCC_UNUSED) -{ - WINDOW *pad, *spad; - - if ((pad = newpad(50, 100)) != 0) { - wattron(pad, A_REVERSE); - MvWAddStr(pad, 5, 2, "This is a new pad"); - (void) wattrset(pad, A_NORMAL); - MvWAddStr(pad, 8, 0, - "The end of this line should be truncated here:except now"); - MvWAddStr(pad, 11, 1, "This line should not appear.It will now"); - wmove(pad, 10, 1); - wclrtoeol(pad); - MvWAddStr(pad, 10, 1, " Press any key to continue"); - prefresh(pad, 0, 0, 0, 0, 10, 45); - keypad(pad, TRUE); - raw(); - wgetch(pad); - - spad = subpad(pad, 12, 25, 6, 52); - MvWAddStr(spad, 2, 2, "This is a new subpad"); - box(spad, 0, 0); - prefresh(pad, 0, 0, 0, 0, 15, 75); - keypad(pad, TRUE); - raw(); - wgetch(pad); - - MvWAddStr(pad, 35, 2, "This is displayed at line 35 in the pad"); - MvWAddStr(pad, 40, 1, " Press any key to continue"); - prefresh(pad, 30, 0, 0, 0, 10, 45); - keypad(pad, TRUE); - raw(); - wgetch(pad); - - delwin(pad); - } -} - -static void -display_menu(int old_option, int new_option) -{ - int i; - - assert((new_option >= 0) && (new_option < MAX_OPTIONS)); - - (void) attrset(A_NORMAL); - MvAddStr(3, 20, "PDCurses Test Program"); - - for (i = 0; i < (int) MAX_OPTIONS; i++) - MvAddStr(5 + i, 25, command[i].text); - - if ((old_option >= 0) && (old_option < MAX_OPTIONS)) - MvAddStr(5 + old_option, 25, command[old_option].text); - - (void) attrset(A_REVERSE); - MvAddStr(5 + new_option, 25, command[new_option].text); - (void) attrset(A_NORMAL); - MvAddStr(13, 3, - "Use Up and Down Arrows to select - Enter to run - Q to quit"); - refresh(); -} diff --git a/test/testscanw.c b/test/testscanw.c deleted file mode 100644 index 79589c20386..00000000000 --- a/test/testscanw.c +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * Copyright (c) 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 * - * "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. * - ****************************************************************************/ -/* gleaned from a web-search, shows a bug combining scanw and implicit scroll. - * Date: 1997/03/17 - * From: bayern@morpheus.cis.yale.edu - * - * $Id: testscanw.c,v 1.11 2006/04/01 19:08:03 tom Exp $ - */ -#include - -int -main(int argc, char *argv[]) -{ - long badanswer = 1; - long *response = &badanswer; - - setlocale(LC_ALL, ""); - - initscr(); - scrollok(stdscr, TRUE); - idlok(stdscr, TRUE); - echo(); - -#if 0 - trace(TRACE_UPDATE | TRACE_CALLS); -#endif - while (argc > 1) { - if (isdigit(UChar(*argv[1]))) - move(atoi(argv[1]), 0); - else if (!strcmp(argv[1], "-k")) - keypad(stdscr, TRUE); - argc--, argv++; - } - - while (badanswer) { - printw("Enter a number (0 to quit):\n"); - printw("--> "); - scanw("%20ld", response); /* yes, it's a pointer */ - } - endwin(); - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/tracemunch b/test/tracemunch deleted file mode 100755 index 1ea6f4b6902..00000000000 --- a/test/tracemunch +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/perl -w -# $Id: tracemunch,v 1.6 2005/03/12 21:48:23 tom Exp $ -############################################################################## -# Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. # -# # -# Permission is hereby granted, free of charge, to any person obtaining a # -# copy of this software and associated documentation files (the "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. # -############################################################################## -# tracemunch -- compactify ncurses trace logs -# -# 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; - -our $putattr="PutAttrChar\\({{ '(.)' = 0[0-7]+ }}\\) at \\(([0-9]+), ([0-9]+)\\)"; -our $waddnstr="waddnstr\\(0x([0-9a-f]+),\"([^\"]+)\",[0-9]+\\) called {A_NORMAL}"; - -our $win_nums=0; -our $curscr=""; -our $newscr=""; -our $stdscr=""; -our @win_addr; - -sub transaddr -{ - 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]; - } - - return $arg; -} - -while () -{ - 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 () - { - 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 () - { - 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 () { - if (&transaddr($_) eq $anyline) { - $repeatcount++; - } else { - last; - } - } - if ($repeatcount > 1) { - print "${repeatcount} REPEATS OF $anyline"; - } else { - print $anyline - } - redo CLASSIFY if $_; - - } # :CLASSIFY -} - -# tracemunch ends here diff --git a/test/view.c b/test/view.c deleted file mode 100644 index 6e5c2411cf4..00000000000 --- a/test/view.c +++ /dev/null @@ -1,586 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,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"), 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. * - ****************************************************************************/ -/* - * view.c -- a silly little viewer program - * - * written by Eric S. Raymond December 1994 - * to test the scrolling code in ncurses. - * - * modified by Thomas Dickey July 1995 to demonstrate - * the use of 'resizeterm()', and May 2000 to illustrate wide-character - * handling. - * - * Takes a filename argument. It's a simple file-viewer with various - * scroll-up and scroll-down commands. - * - * n -- scroll one line forward - * p -- scroll one line back - * - * Either command accepts a numeric prefix interpreted as a repeat count. - * Thus, typing `5n' should scroll forward 5 lines in the file. - * - * The way you can tell this is working OK is that, in the trace file, - * there should be one scroll operation plus a small number of line - * updates, as opposed to a whole-page update. This means the physical - * scroll operation worked, and the refresh() code only had to do a - * partial repaint. - * - * $Id: view.c,v 1.81 2010/11/14 01:06:02 tom Exp $ - */ - -#include - -#include - -#undef CTRL /* conflict on AIX 5.2 with */ - -#if HAVE_TERMIOS_H -# include -#else -#if !defined(__MINGW32__) -# include -#endif -#endif - -#if !defined(sun) || !HAVE_TERMIOS_H -# if HAVE_SYS_IOCTL_H -# include -# endif -#endif - -#define my_pair 1 - -/* This is needed to compile 'struct winsize' */ -#if NEED_PTEM_H -#include -#include -#endif - -#if USE_WIDEC_SUPPORT -#if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) IGNORE_RC(mblen(NULL, 0)), IGNORE_RC(mbtowc(NULL, NULL, 0)) -#define count_mbytes(buffer,length,state) mblen(buffer,length) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbtowc(&wch, buffer, length) -#define state_unused -#elif HAVE_MBRTOWC && HAVE_MBRLEN -#define reset_mbytes(state) init_mb(state) -#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbrtowc(&wch, buffer, length, &state) -#else -make an error -#endif -#endif /* USE_WIDEC_SUPPORT */ - -static RETSIGTYPE 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 RETSIGTYPE adjust(int sig); -static int interrupted; -#endif - -static bool waiting = FALSE; -static int shift = 0; -static bool try_color = FALSE; - -static char *fname; -static NCURSES_CH_T **vec_lines; -static NCURSES_CH_T **lptr; -static int num_lines; - -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" - ," -n NUM specify maximum number of lines (default 1000)" -#if defined(KEY_RESIZE) - ," -r use old-style sigwinch handler rather than KEY_RESIZE" -#endif -#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); -} - -static int -ch_len(NCURSES_CH_T * src) -{ - int result = 0; -#if USE_WIDEC_SUPPORT - int count; -#endif - -#if USE_WIDEC_SUPPORT - for (;;) { - TEST_CCHAR(src, count, { - ++result; - ++src; - } - , { - break; - }) - } -#else - while (*src++) - result++; -#endif - 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) -{ - unsigned len = (unsigned) strlen(src); - NCURSES_CH_T *dst = typeMalloc(NCURSES_CH_T, len + 1); - unsigned j, k; -#if USE_WIDEC_SUPPORT - wchar_t wstr[CCHARW_MAX + 1]; - wchar_t wch; - int l = 0; - size_t rc; - int width; -#ifndef state_unused - mbstate_t state; -#endif -#endif /* USE_WIDEC_SUPPORT */ - -#if USE_WIDEC_SUPPORT - reset_mbytes(state); -#endif - for (j = k = 0; j < len; j++) { -#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 (width == 0 && l == 0) - wstr[l++] = L' '; - wstr[l++] = wch; -#else - dst[k++] = (chtype) UChar(src[j]); -#endif - } -#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; -#endif - return dst; -} - -int -main(int argc, char *argv[]) -{ - int MAXLINES = 1000; - FILE *fp; - char buf[BUFSIZ]; - int i; - int my_delay = 0; - NCURSES_CH_T **olptr; - int value = 0; - bool done = FALSE; - bool got_number = 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:rtT:")) != -1) { - switch (i) { - case 'c': - try_color = TRUE; - break; - case 'i': - CATCHALL(SIG_IGN); - break; - case 'n': - if ((MAXLINES = atoi(optarg)) < 1 || - (MAXLINES + 2) <= 1) - usage(); - break; -#if CAN_RESIZE - case 'r': - nonposix_resize = TRUE; - break; -#endif -#ifdef TRACE - case 'T': - trace((unsigned) atoi(optarg)); - break; - case 't': - trace(TRACE_CALLS); - break; -#endif - default: - usage(); - } - } - 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 - - /* 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; - - /* convert tabs so that shift will work properly */ - for (s = buf, d = temp, col = 0; (*d = *s) != '\0'; s++) { - 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 */ - 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 */ - 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(COLOR_PAIR(my_pair)); - } else { - try_color = FALSE; - } - } - - lptr = vec_lines; - while (!done) { - int n, c; - - if (!got_number) - show_all(my_label); - - for (;;) { -#if CAN_RESIZE - if (interrupted) { - adjust(0); - my_label = "interrupt"; - } -#endif - waiting = TRUE; - c = getch(); - waiting = FALSE; - 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': - olptr = lptr; - for (i = 0; i < n; i++) - if ((lptr - vec_lines) < (num_lines - LINES + 1)) - lptr++; - else - break; - scrl((int) (lptr - olptr)); - break; - - case KEY_UP: - case 'p': - olptr = lptr; - for (i = 0; i < n; i++) - if (lptr > vec_lines) - lptr--; - else - break; - scrl((int) (lptr - olptr)); - break; - - case 'h': - case KEY_HOME: - lptr = vec_lines; - break; - - case 'e': - case KEY_END: - if (num_lines > LINES) - lptr = vec_lines + num_lines - LINES + 1; - else - lptr = vec_lines; - 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': - done = TRUE; - break; - -#ifdef KEY_RESIZE - case KEY_RESIZE: /* ignore this; ncurses will repaint */ - break; -#endif - case 's': - if (got_number) { - halfdelay(my_delay = n); - } else { - nodelay(stdscr, FALSE); - my_delay = -1; - } - break; - case ' ': - nodelay(stdscr, TRUE); - my_delay = 0; - break; - case ERR: - if (!my_delay) - napms(50); - break; - default: - beep(); - break; - } - if (c >= KEY_MIN || (c > 0 && !isdigit(c))) { - got_number = FALSE; - value = 0; - } - } - - finish(0); /* we're done */ -} - -static RETSIGTYPE -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 RETSIGTYPE -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); - strcpy(temp, ctime(&this_time)); - 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.txt b/test/widechars-utf8.txt deleted file mode 100644 index 43ecd0f7429..00000000000 --- a/test/widechars-utf8.txt +++ /dev/null @@ -1,7 +0,0 @@ -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. diff --git a/test/worm.c b/test/worm.c deleted file mode 100644 index 98f099cb9cb..00000000000 --- a/test/worm.c +++ /dev/null @@ -1,618 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2007,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 * - * "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. * - ****************************************************************************/ -/* - - @@@ @@@ @@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@ - @@@ @@@ @@@@@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@@@@ - @@@ @@@ @@@@ @@@@ @@@@ @@@@ @@@ @@@@ - @@@ @@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ - @@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ - @@@@ @@@@ @@@@ @@@ @@@ @@@ @@@ @@@ @@@ - @@@@@@@@@@@@ @@@@ @@@@ @@@ @@@ @@@ @@@ - @@@@ @@@@ @@@@@@@@@@@@ @@@ @@@ @@@ @@@ - @@ @@ @@@@@@@@@@ @@@ @@@ @@@ @@@ - - Eric P. Scott - Caltech High Energy Physics - October, 1980 - - Hacks to turn this into a test frame for cursor movement: - Eric S. Raymond - January, 1995 - - July 1995 (esr): worms is now in living color! :-) - -Options: - -f fill screen with copies of 'WORM' at start. - -l set worm length - -n set number of worms - -t make worms leave droppings - -T 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.60 2010/11/13 20:21:21 tom Exp $ -*/ - -#include - -#ifdef USE_PTHREADS -#include -#endif - -WANT_USE_WINDOW(); - -#define MAX_WORMS 40 -#define MAX_LENGTH 1024 - -static chtype flavor[] = -{ - 'O', '*', '#', '$', '%', '0', '@', -}; -static const int xinc[] = -{ - 1, 1, 1, 0, -1, -1, -1, 0 -}, yinc[] = -{ - -1, 0, 1, 1, 1, 0, -1, -1 -}; - -typedef struct worm { - int orientation; - int head; - int *xpos; - int *ypos; - chtype attrs; -#ifdef USE_PTHREADS - pthread_t thread; -#endif -} WORM; - -static unsigned long sequence = 0; -static bool quitting = FALSE; - -static WORM worm[MAX_WORMS]; -static int **refs; -static int last_x, last_y; - -static const char *field; -static int length = 16, number = 3; -static chtype trail = ' '; - -static unsigned pending; -#ifdef TRACE -static int generation, trace_start, trace_end; -#endif /* TRACE */ -/* *INDENT-OFF* */ -static const struct options { - int nopts; - int opts[3]; -} normal[8]={ - { 3, { 7, 0, 1 } }, - { 3, { 0, 1, 2 } }, - { 3, { 1, 2, 3 } }, - { 3, { 2, 3, 4 } }, - { 3, { 3, 4, 5 } }, - { 3, { 4, 5, 6 } }, - { 3, { 5, 6, 7 } }, - { 3, { 6, 7, 0 } } -}, upper[8]={ - { 1, { 1, 0, 0 } }, - { 2, { 1, 2, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 2, { 4, 5, 0 } }, - { 1, { 5, 0, 0 } }, - { 2, { 1, 5, 0 } } -}, left[8]={ - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 2, { 2, 3, 0 } }, - { 1, { 3, 0, 0 } }, - { 2, { 3, 7, 0 } }, - { 1, { 7, 0, 0 } }, - { 2, { 7, 0, 0 } } -}, right[8]={ - { 1, { 7, 0, 0 } }, - { 2, { 3, 7, 0 } }, - { 1, { 3, 0, 0 } }, - { 2, { 3, 4, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 2, { 6, 7, 0 } } -}, lower[8]={ - { 0, { 0, 0, 0 } }, - { 2, { 0, 1, 0 } }, - { 1, { 1, 0, 0 } }, - { 2, { 1, 5, 0 } }, - { 1, { 5, 0, 0 } }, - { 2, { 5, 6, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } } -}, upleft[8]={ - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 1, { 3, 0, 0 } }, - { 2, { 1, 3, 0 } }, - { 1, { 1, 0, 0 } } -}, upright[8]={ - { 2, { 3, 5, 0 } }, - { 1, { 3, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 1, { 5, 0, 0 } } -}, lowleft[8]={ - { 3, { 7, 0, 1 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 1, { 1, 0, 0 } }, - { 2, { 1, 7, 0 } }, - { 1, { 7, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } } -}, lowright[8]={ - { 0, { 0, 0, 0 } }, - { 1, { 7, 0, 0 } }, - { 2, { 5, 7, 0 } }, - { 1, { 5, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } }, - { 0, { 0, 0, 0 } } -}; -/* *INDENT-ON* */ - -static void -cleanup(void) -{ - USING_WINDOW(stdscr, wrefresh); - curs_set(1); - endwin(); -} - -static RETSIGTYPE -onsig(int sig GCC_UNUSED) -{ - cleanup(); - ExitProgram(EXIT_FAILURE); -} - -static double -ranf(void) -{ - long r = (rand() & 077777); - return ((double) r / 32768.); -} - -static int -draw_worm(WINDOW *win, void *data) -{ - WORM *w = (WORM *) data; - const struct options *op; - unsigned mask = (unsigned) (~(1 << (w - worm))); - chtype attrs = w->attrs | ((mask & pending) ? A_REVERSE : 0); - - int x; - int y; - int h; - - bool done = FALSE; - - if ((x = w->xpos[h = w->head]) < 0) { - wmove(win, y = w->ypos[h] = last_y, x = w->xpos[h] = 0); - waddch(win, attrs); - refs[y][x]++; - } else { - y = w->ypos[h]; - } - - if (x > last_x) - x = last_x; - if (y > last_y) - y = last_y; - - if (++h == length) - h = 0; - - if (w->xpos[w->head = h] >= 0) { - int x1, y1; - x1 = w->xpos[h]; - y1 = w->ypos[h]; - if (y1 < LINES - && x1 < COLS - && --refs[y1][x1] == 0) { - wmove(win, y1, x1); - waddch(win, trail); - } - } - - op = &(x == 0 - ? (y == 0 - ? upleft - : (y == last_y - ? lowleft - : left)) - : (x == last_x - ? (y == 0 - ? upright - : (y == last_y - ? lowright - : right)) - : (y == 0 - ? upper - : (y == last_y - ? lower - : normal))))[w->orientation]; - - switch (op->nopts) { - case 0: - done = TRUE; - break; - case 1: - w->orientation = op->opts[0]; - break; - default: - w->orientation = op->opts[(int) (ranf() * (double) op->nopts)]; - break; - } - - if (!done) { - x += xinc[w->orientation]; - y += yinc[w->orientation]; - wmove(win, y, x); - - if (y < 0) - y = 0; - waddch(win, attrs); - - w->ypos[h] = y; - w->xpos[h] = x; - refs[y][x]++; - } - - return done; -} - -#ifdef USE_PTHREADS -static bool -quit_worm(int bitnum) -{ - pending |= (1 << bitnum); - napms(10); /* let the other thread(s) have a chance */ - pending &= ~(1 << bitnum); - return quitting; -} - -static void * -start_worm(void *arg) -{ - unsigned long compare = 0; - Trace(("start_worm")); - while (!quit_worm(((struct worm *) arg) - worm)) { - while (compare < sequence) { - ++compare; -#if HAVE_USE_WINDOW - use_window(stdscr, draw_worm, arg); -#else - draw_worm(stdscr, arg); -#endif - } - } - Trace(("...start_worm (done)")); - return NULL; -} -#endif - -static bool -draw_all_worms(void) -{ - bool done = FALSE; - int n; - struct worm *w; - -#ifdef USE_PTHREADS - static bool first = TRUE; - if (first) { - first = FALSE; - for (n = 0, w = &worm[0]; n < number; n++, w++) { - int rc; - rc = pthread_create(&(w->thread), NULL, start_worm, w); - } - } -#else - for (n = 0, w = &worm[0]; n < number; n++, w++) { - if ( -#if HAVE_USE_WINDOW - USING_WINDOW2(stdscr, draw_worm, w) -#else - draw_worm(stdscr, w) -#endif - ) - done = TRUE; - } -#endif - return done; -} - -static int -get_input(void) -{ - int ch; - ch = USING_WINDOW(stdscr, wgetch); - return ch; -} - -#ifdef KEY_RESIZE -static int -update_refs(WINDOW *win) -{ - int x, y; - - (void) win; - if (last_x != COLS - 1) { - for (y = 0; y <= last_y; y++) { - refs[y] = typeRealloc(int, (size_t) COLS, refs[y]); - for (x = last_x + 1; x < COLS; x++) - refs[y][x] = 0; - } - last_x = COLS - 1; - } - if (last_y != LINES - 1) { - for (y = LINES; y <= last_y; y++) - free(refs[y]); - refs = typeRealloc(int *, (size_t) LINES, refs); - for (y = last_y + 1; y < LINES; y++) { - refs[y] = typeMalloc(int, (size_t) COLS); - for (x = 0; x < COLS; x++) - refs[y][x] = 0; - } - last_y = LINES - 1; - } - return OK; -} -#endif - -int -main(int argc, char *argv[]) -{ - int x, y; - int n; - struct worm *w; - int *ip; - bool done = FALSE; - - setlocale(LC_ALL, ""); - - for (x = 1; x < argc; x++) { - char *p; - p = argv[x]; - if (*p == '-') - p++; - switch (*p) { - case 'f': - field = "WORM"; - break; - case 'l': - if (++x == argc) - goto usage; - if ((length = atoi(argv[x])) < 2 || length > MAX_LENGTH) { - fprintf(stderr, "%s: Invalid length\n", *argv); - ExitProgram(EXIT_FAILURE); - } - break; - case 'n': - if (++x == argc) - goto usage; - if ((number = atoi(argv[x])) < 1 || number > MAX_WORMS) { - fprintf(stderr, "%s: Invalid number of worms\n", *argv); - ExitProgram(EXIT_FAILURE); - } - break; - case 't': - trail = '.'; - break; -#ifdef TRACE - case 'T': - trace_start = atoi(argv[++x]); - trace_end = atoi(argv[++x]); - 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); - } - } - - signal(SIGINT, onsig); - initscr(); - noecho(); - cbreak(); - nonl(); - - curs_set(0); - - last_y = LINES - 1; - last_x = COLS - 1; - -#ifdef A_COLOR - if (has_colors()) { - int bg = COLOR_BLACK; - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - bg = -1; -#endif - -#define SET_COLOR(num, fg) \ - init_pair(num+1, (short) fg, (short) bg); \ - flavor[num] |= COLOR_PAIR(num+1) | A_BOLD - - SET_COLOR(0, COLOR_GREEN); - SET_COLOR(1, COLOR_RED); - SET_COLOR(2, COLOR_CYAN); - SET_COLOR(3, COLOR_WHITE); - SET_COLOR(4, COLOR_MAGENTA); - SET_COLOR(5, COLOR_BLUE); - SET_COLOR(6, COLOR_YELLOW); - } -#endif /* A_COLOR */ - - refs = typeMalloc(int *, (size_t) LINES); - for (y = 0; y < LINES; y++) { - refs[y] = typeMalloc(int, (size_t) COLS); - for (x = 0; x < COLS; x++) { - refs[y][x] = 0; - } - } - -#ifdef BADCORNER - /* if addressing the lower right corner doesn't work in your curses */ - refs[last_y][last_x] = 1; -#endif /* BADCORNER */ - - for (n = number, w = &worm[0]; --n >= 0; w++) { - w->attrs = flavor[(unsigned) n % SIZEOF(flavor)]; - w->orientation = 0; - w->head = 0; - - if (!(ip = typeMalloc(int, (size_t) (length + 1)))) { - fprintf(stderr, "%s: out of memory\n", *argv); - ExitProgram(EXIT_FAILURE); - } - w->xpos = ip; - for (x = length; --x >= 0;) - *ip++ = -1; - if (!(ip = typeMalloc(int, (size_t) (length + 1)))) { - fprintf(stderr, "%s: out of memory\n", *argv); - ExitProgram(EXIT_FAILURE); - } - w->ypos = ip; - for (y = length; --y >= 0;) - *ip++ = -1; - } - if (field) { - const char *p; - p = field; - for (y = last_y; --y >= 0;) { - for (x = COLS; --x >= 0;) { - addch((chtype) (*p++)); - if (!*p) - p = field; - } - } - } - USING_WINDOW(stdscr, 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); - get_input(); - } else if (generation == trace_end) { - trace(0); - get_input(); - } - - generation++; - } -#endif - -#ifdef KEY_RESIZE - if (ch == KEY_RESIZE) { - USING_WINDOW(stdscr, update_refs); - } -#endif - - /* - * Make it simple to put this into single-step mode, or resume - * normal operation -T.Dickey - */ - if (ch == 'q') { - quitting = TRUE; - done = TRUE; - continue; - } else if (ch == 's') { - nodelay(stdscr, FALSE); - } else if (ch == ' ') { - nodelay(stdscr, TRUE); - } - } - - done = draw_all_worms(); - napms(10); - USING_WINDOW(stdscr, wrefresh); - } - - Trace(("Cleanup")); - cleanup(); -#ifdef NO_LEAKS - for (y = 0; y < LINES; y++) { - free(refs[y]); - } - free(refs); - for (n = number, w = &worm[0]; --n >= 0; w++) { - free(w->xpos); - free(w->ypos); - } -#endif -#ifdef USE_PTHREADS - /* - * Do this just in case one of the threads did not really exit. - */ - Trace(("join all threads")); - for (n = 0; n < number; n++) { - pthread_join(worm[n].thread, NULL); - } -#endif - ExitProgram(EXIT_SUCCESS); -} diff --git a/test/xmas.c b/test/xmas.c deleted file mode 100644 index fc0cc4cbd0e..00000000000 --- a/test/xmas.c +++ /dev/null @@ -1,1162 +0,0 @@ -/******************************************************************************/ -/* asciixmas */ -/* December 1989 Larry Bartz Indianapolis, IN */ -/* */ -/* */ -/* I'm dreaming of an ascii character-based monochrome Christmas, */ -/* Just like the one's I used to know! */ -/* Via a full duplex communications channel, */ -/* At 9600 bits per second, */ -/* Even though it's kinda slow. */ -/* */ -/* I'm dreaming of an ascii character-based monochrome Christmas, */ -/* With ev'ry C program I write! */ -/* May your screen be merry and bright! */ -/* And may all your Christmases be amber or green, */ -/* (for reduced eyestrain and improved visibility)! */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* IMPLEMENTATION */ -/* */ -/* Feel free to modify the defined string FROMWHO to reflect you, your */ -/* organization, your site, whatever. */ -/* */ -/* This really looks a lot better if you can turn off your cursor before */ -/* execution. I wanted to do that here but very few termcap entries or */ -/* terminfo definitions have the appropriate string defined. If you know */ -/* the string(s) for the terminal(s) you use or which your site supports, */ -/* you could call asciixmas from within a shell in which you issue the */ -/* string to the terminal. The cursor is distracting but it doesn't really */ -/* ruin the show. */ -/* */ -/* At our site, we invoke this for our users just after login and the */ -/* determination of terminal type. */ -/* */ -/* */ -/* PORTABILITY */ -/* */ -/* I wrote this using only the very simplest curses functions so that it */ -/* might be the most portable. I was personally able to test on five */ -/* different cpu/UNIX combinations. */ -/* */ -/* */ -/* COMPILE */ -/* */ -/* usually this: */ -/* */ -/* cc -O asciixmas.c -lcurses -o asciixmas -s */ -/* */ -/* */ -/* Zilog S8000 models 11, 21, 31, etc with ZEUS variant of SYSTEM III */ -/* maybe other SYSTEM III also: */ -/* */ -/* cc asciixmas.c -lcurses -ltermlib -o asciixmas -s */ -/* */ -/* as above with optional "peephole optimizer" installed: */ -/* */ -/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */ -/* */ -/* */ -/* Zilog S8000 models 32, 130 with WE32100 chip and SYS V, REL2 */ -/* maybe 3B2 also? */ -/* */ -/* cc -f -O -K sd asciixmas.c -lcurses -o asciixmas -s */ -/* */ -/* */ -/* Pyramid, Sequent, any other "dual universe" types compile and execute */ -/* under either universe. The compile line for the ucb universe (as you */ -/* might expect) is the same as for SYS III UNIX: */ -/* */ -/* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */ -/* */ -/* The above compile will also hold true for other BSD systems. (I hope) */ -/* */ -/* */ -/* */ -/* */ -/* For the Scrooges out there among you who don't want this thing to loop */ -/* forever (or until the user hits a key), insert this into your compile */ -/* line just after "cc" : */ -/* */ -/* -DNOLOOP */ -/* */ -/* like so: */ -/* */ -/* cc -DNOLOOP -O asciixmas.c -lcurses -o asciixmas -s */ -/* */ -/* */ -/* */ -/******************************************************************************/ - -/* - * $Id: xmas.c,v 1.27 2010/11/13 20:24:10 tom Exp $ - */ -#include - -#define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)" - -static int my_bg = COLOR_BLACK; -static int y_pos, x_pos; - -static WINDOW *treescrn; -static WINDOW *treescrn2; -static WINDOW *treescrn3; -static WINDOW *treescrn4; -static WINDOW *treescrn5; -static WINDOW *treescrn6; -static WINDOW *treescrn7; -static WINDOW *treescrn8; -static WINDOW *dotdeer0; -static WINDOW *stardeer0; -static WINDOW *lildeer0; -static WINDOW *lildeer1; -static WINDOW *lildeer2; -static WINDOW *lildeer3; -static WINDOW *middeer0; -static WINDOW *middeer1; -static WINDOW *middeer2; -static WINDOW *middeer3; -static WINDOW *bigdeer0; -static WINDOW *bigdeer1; -static WINDOW *bigdeer2; -static WINDOW *bigdeer3; -static WINDOW *bigdeer4; -static WINDOW *lookdeer0; -static WINDOW *lookdeer1; -static WINDOW *lookdeer2; -static WINDOW *lookdeer3; -static WINDOW *lookdeer4; -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 RETSIGTYPE done(int sig) GCC_NORETURN; - -static void -set_color(WINDOW *win, chtype color) -{ - if (has_colors()) { - int n = (int) (color + 1); - if (my_pairs == 0) - my_pairs = typeCalloc(bool, (size_t) (COLORS + 1)); - if (!my_pairs[n]) { - init_pair((short) n, (short) color, (short) my_bg); - my_pairs[n] = TRUE; - } - wattroff(win, A_COLOR); - wattron(win, COLOR_PAIR(n)); - } -} - -static void -unset_color(WINDOW *win) -{ - if (has_colors()) - (void) wattrset(win, COLOR_PAIR(0)); -} - -static void -look_out(int msecs) -{ - napms(msecs); - if (getch() != ERR) { - beep(); - done(0); - } -} - -int -main(int argc GCC_UNUSED, char **argv GCC_UNUSED) -{ - int loopy; - - setlocale(LC_ALL, ""); - - initscr(); - noecho(); - nonl(); - refresh(); - - CATCHALL(done); - - if (has_colors()) { - start_color(); -#if HAVE_USE_DEFAULT_COLORS - if (use_default_colors() == OK) - my_bg = -1; -#endif - } - curs_set(0); - - if ((treescrn = newwin(16, 27, 3, 53)) == 0 || - (treescrn2 = newwin(16, 27, 3, 53)) == 0 || - (treescrn3 = newwin(16, 27, 3, 53)) == 0 || - (treescrn4 = newwin(16, 27, 3, 53)) == 0 || - (treescrn5 = newwin(16, 27, 3, 53)) == 0 || - (treescrn6 = newwin(16, 27, 3, 53)) == 0 || - (treescrn7 = newwin(16, 27, 3, 53)) == 0 || - (treescrn8 = newwin(16, 27, 3, 53)) == 0 || - - (dotdeer0 = newwin(3, 71, 0, 8)) == 0 || - - (stardeer0 = newwin(4, 56, 0, 8)) == 0 || - - (lildeer0 = newwin(7, 53, 0, 8)) == 0 || - (lildeer1 = newwin(2, 4, 0, 0)) == 0 || - (lildeer2 = newwin(2, 4, 0, 0)) == 0 || - (lildeer3 = newwin(2, 4, 0, 0)) == 0 || - - (middeer0 = newwin(15, 42, 0, 8)) == 0 || - (middeer1 = newwin(3, 7, 0, 0)) == 0 || - (middeer2 = newwin(3, 7, 0, 0)) == 0 || - (middeer3 = newwin(3, 7, 0, 0)) == 0 || - - (bigdeer0 = newwin(10, 23, 0, 0)) == 0 || - (bigdeer1 = newwin(10, 23, 0, 0)) == 0 || - (bigdeer2 = newwin(10, 23, 0, 0)) == 0 || - (bigdeer3 = newwin(10, 23, 0, 0)) == 0 || - (bigdeer4 = newwin(10, 23, 0, 0)) == 0 || - - (lookdeer0 = newwin(10, 25, 0, 0)) == 0 || - (lookdeer1 = newwin(10, 25, 0, 0)) == 0 || - (lookdeer2 = newwin(10, 25, 0, 0)) == 0 || - (lookdeer3 = newwin(10, 25, 0, 0)) == 0 || - (lookdeer4 = newwin(10, 25, 0, 0)) == 0 || - - (w_holiday = newwin(1, 26, 3, 27)) == 0 || - - (w_del_msg = newwin(1, 19, 23, 60)) == 0) { - endwin(); - fprintf(stderr, "Cannot create windows - screen too small\n"); - ExitProgram(EXIT_FAILURE); - } - - MvWAddStr(w_del_msg, 0, 0, "Hit any key to quit"); - - MvWAddStr(w_holiday, 0, 0, "H A P P Y H O L I D A Y S"); - - /* set up the windows for our various reindeer */ - - /* lildeer1 */ - MvWAddCh(lildeer1, 0, 0, (chtype) 'V'); - MvWAddCh(lildeer1, 1, 0, (chtype) '@'); - MvWAddCh(lildeer1, 1, 1, (chtype) '<'); - MvWAddCh(lildeer1, 1, 2, (chtype) '>'); - MvWAddCh(lildeer1, 1, 3, (chtype) '~'); - - /* lildeer2 */ - MvWAddCh(lildeer2, 0, 0, (chtype) 'V'); - MvWAddCh(lildeer2, 1, 0, (chtype) '@'); - MvWAddCh(lildeer2, 1, 1, (chtype) '|'); - MvWAddCh(lildeer2, 1, 2, (chtype) '|'); - MvWAddCh(lildeer2, 1, 3, (chtype) '~'); - - /* lildeer3 */ - MvWAddCh(lildeer3, 0, 0, (chtype) 'V'); - MvWAddCh(lildeer3, 1, 0, (chtype) '@'); - MvWAddCh(lildeer3, 1, 1, (chtype) '>'); - MvWAddCh(lildeer3, 1, 2, (chtype) '<'); - MvWAddCh(lildeer2, 1, 3, (chtype) '~'); - - /* middeer1 */ - MvWAddCh(middeer1, 0, 2, (chtype) 'y'); - MvWAddCh(middeer1, 0, 3, (chtype) 'y'); - MvWAddCh(middeer1, 1, 2, (chtype) '0'); - MvWAddCh(middeer1, 1, 3, (chtype) '('); - MvWAddCh(middeer1, 1, 4, (chtype) '='); - MvWAddCh(middeer1, 1, 5, (chtype) ')'); - MvWAddCh(middeer1, 1, 6, (chtype) '~'); - MvWAddCh(middeer1, 2, 3, (chtype) '\\'); - MvWAddCh(middeer1, 2, 4, (chtype) '/'); - - /* middeer2 */ - MvWAddCh(middeer2, 0, 2, (chtype) 'y'); - MvWAddCh(middeer2, 0, 3, (chtype) 'y'); - MvWAddCh(middeer2, 1, 2, (chtype) '0'); - MvWAddCh(middeer2, 1, 3, (chtype) '('); - MvWAddCh(middeer2, 1, 4, (chtype) '='); - MvWAddCh(middeer2, 1, 5, (chtype) ')'); - MvWAddCh(middeer2, 1, 6, (chtype) '~'); - MvWAddCh(middeer2, 2, 3, (chtype) '|'); - MvWAddCh(middeer2, 2, 5, (chtype) '|'); - - /* middeer3 */ - MvWAddCh(middeer3, 0, 2, (chtype) 'y'); - MvWAddCh(middeer3, 0, 3, (chtype) 'y'); - MvWAddCh(middeer3, 1, 2, (chtype) '0'); - MvWAddCh(middeer3, 1, 3, (chtype) '('); - MvWAddCh(middeer3, 1, 4, (chtype) '='); - MvWAddCh(middeer3, 1, 5, (chtype) ')'); - MvWAddCh(middeer3, 1, 6, (chtype) '~'); - MvWAddCh(middeer3, 2, 2, (chtype) '/'); - MvWAddCh(middeer3, 2, 6, (chtype) '\\'); - - /* bigdeer1 */ - MvWAddCh(bigdeer1, 0, 17, (chtype) '\\'); - MvWAddCh(bigdeer1, 0, 18, (chtype) '/'); - MvWAddCh(bigdeer1, 0, 20, (chtype) '\\'); - MvWAddCh(bigdeer1, 0, 21, (chtype) '/'); - MvWAddCh(bigdeer1, 1, 18, (chtype) '\\'); - MvWAddCh(bigdeer1, 1, 20, (chtype) '/'); - MvWAddCh(bigdeer1, 2, 19, (chtype) '|'); - MvWAddCh(bigdeer1, 2, 20, (chtype) '_'); - MvWAddCh(bigdeer1, 3, 18, (chtype) '/'); - MvWAddCh(bigdeer1, 3, 19, (chtype) '^'); - MvWAddCh(bigdeer1, 3, 20, (chtype) '0'); - MvWAddCh(bigdeer1, 3, 21, (chtype) '\\'); - MvWAddCh(bigdeer1, 4, 17, (chtype) '/'); - MvWAddCh(bigdeer1, 4, 18, (chtype) '/'); - MvWAddCh(bigdeer1, 4, 19, (chtype) '\\'); - MvWAddCh(bigdeer1, 4, 22, (chtype) '\\'); - MvWAddStr(bigdeer1, 5, 7, "^~~~~~~~~// ~~U"); - MvWAddStr(bigdeer1, 6, 7, "( \\_____( /"); - MvWAddStr(bigdeer1, 7, 8, "( ) /"); - MvWAddStr(bigdeer1, 8, 9, "\\\\ /"); - MvWAddStr(bigdeer1, 9, 11, "\\>/>"); - - /* bigdeer2 */ - MvWAddCh(bigdeer2, 0, 17, (chtype) '\\'); - MvWAddCh(bigdeer2, 0, 18, (chtype) '/'); - MvWAddCh(bigdeer2, 0, 20, (chtype) '\\'); - MvWAddCh(bigdeer2, 0, 21, (chtype) '/'); - MvWAddCh(bigdeer2, 1, 18, (chtype) '\\'); - MvWAddCh(bigdeer2, 1, 20, (chtype) '/'); - MvWAddCh(bigdeer2, 2, 19, (chtype) '|'); - MvWAddCh(bigdeer2, 2, 20, (chtype) '_'); - MvWAddCh(bigdeer2, 3, 18, (chtype) '/'); - MvWAddCh(bigdeer2, 3, 19, (chtype) '^'); - MvWAddCh(bigdeer2, 3, 20, (chtype) '0'); - MvWAddCh(bigdeer2, 3, 21, (chtype) '\\'); - MvWAddCh(bigdeer2, 4, 17, (chtype) '/'); - MvWAddCh(bigdeer2, 4, 18, (chtype) '/'); - MvWAddCh(bigdeer2, 4, 19, (chtype) '\\'); - MvWAddCh(bigdeer2, 4, 22, (chtype) '\\'); - MvWAddStr(bigdeer2, 5, 7, "^~~~~~~~~// ~~U"); - MvWAddStr(bigdeer2, 6, 7, "(( )____( /"); - MvWAddStr(bigdeer2, 7, 7, "( / |"); - MvWAddStr(bigdeer2, 8, 8, "\\/ |"); - MvWAddStr(bigdeer2, 9, 9, "|> |>"); - - /* bigdeer3 */ - MvWAddCh(bigdeer3, 0, 17, (chtype) '\\'); - MvWAddCh(bigdeer3, 0, 18, (chtype) '/'); - MvWAddCh(bigdeer3, 0, 20, (chtype) '\\'); - MvWAddCh(bigdeer3, 0, 21, (chtype) '/'); - MvWAddCh(bigdeer3, 1, 18, (chtype) '\\'); - MvWAddCh(bigdeer3, 1, 20, (chtype) '/'); - MvWAddCh(bigdeer3, 2, 19, (chtype) '|'); - MvWAddCh(bigdeer3, 2, 20, (chtype) '_'); - MvWAddCh(bigdeer3, 3, 18, (chtype) '/'); - MvWAddCh(bigdeer3, 3, 19, (chtype) '^'); - MvWAddCh(bigdeer3, 3, 20, (chtype) '0'); - MvWAddCh(bigdeer3, 3, 21, (chtype) '\\'); - MvWAddCh(bigdeer3, 4, 17, (chtype) '/'); - MvWAddCh(bigdeer3, 4, 18, (chtype) '/'); - MvWAddCh(bigdeer3, 4, 19, (chtype) '\\'); - MvWAddCh(bigdeer3, 4, 22, (chtype) '\\'); - MvWAddStr(bigdeer3, 5, 7, "^~~~~~~~~// ~~U"); - MvWAddStr(bigdeer3, 6, 6, "( ()_____( /"); - MvWAddStr(bigdeer3, 7, 6, "/ / /"); - MvWAddStr(bigdeer3, 8, 5, "|/ \\"); - MvWAddStr(bigdeer3, 9, 5, "/> \\>"); - - /* bigdeer4 */ - MvWAddCh(bigdeer4, 0, 17, (chtype) '\\'); - MvWAddCh(bigdeer4, 0, 18, (chtype) '/'); - MvWAddCh(bigdeer4, 0, 20, (chtype) '\\'); - MvWAddCh(bigdeer4, 0, 21, (chtype) '/'); - MvWAddCh(bigdeer4, 1, 18, (chtype) '\\'); - MvWAddCh(bigdeer4, 1, 20, (chtype) '/'); - MvWAddCh(bigdeer4, 2, 19, (chtype) '|'); - MvWAddCh(bigdeer4, 2, 20, (chtype) '_'); - MvWAddCh(bigdeer4, 3, 18, (chtype) '/'); - MvWAddCh(bigdeer4, 3, 19, (chtype) '^'); - MvWAddCh(bigdeer4, 3, 20, (chtype) '0'); - MvWAddCh(bigdeer4, 3, 21, (chtype) '\\'); - MvWAddCh(bigdeer4, 4, 17, (chtype) '/'); - MvWAddCh(bigdeer4, 4, 18, (chtype) '/'); - MvWAddCh(bigdeer4, 4, 19, (chtype) '\\'); - MvWAddCh(bigdeer4, 4, 22, (chtype) '\\'); - MvWAddStr(bigdeer4, 5, 7, "^~~~~~~~~// ~~U"); - MvWAddStr(bigdeer4, 6, 6, "( )______( /"); - MvWAddStr(bigdeer4, 7, 5, "(/ \\"); - MvWAddStr(bigdeer4, 8, 0, "v___= ----^"); - - /* lookdeer1 */ - MvWAddStr(lookdeer1, 0, 16, "\\/ \\/"); - MvWAddStr(lookdeer1, 1, 17, "\\Y/ \\Y/"); - MvWAddStr(lookdeer1, 2, 19, "\\=/"); - MvWAddStr(lookdeer1, 3, 17, "^\\o o/^"); - MvWAddStr(lookdeer1, 4, 17, "//( )"); - MvWAddStr(lookdeer1, 5, 7, "^~~~~~~~~// \\O/"); - MvWAddStr(lookdeer1, 6, 7, "( \\_____( /"); - MvWAddStr(lookdeer1, 7, 8, "( ) /"); - MvWAddStr(lookdeer1, 8, 9, "\\\\ /"); - MvWAddStr(lookdeer1, 9, 11, "\\>/>"); - - /* lookdeer2 */ - MvWAddStr(lookdeer2, 0, 16, "\\/ \\/"); - MvWAddStr(lookdeer2, 1, 17, "\\Y/ \\Y/"); - MvWAddStr(lookdeer2, 2, 19, "\\=/"); - MvWAddStr(lookdeer2, 3, 17, "^\\o o/^"); - MvWAddStr(lookdeer2, 4, 17, "//( )"); - MvWAddStr(lookdeer2, 5, 7, "^~~~~~~~~// \\O/"); - MvWAddStr(lookdeer2, 6, 7, "(( )____( /"); - MvWAddStr(lookdeer2, 7, 7, "( / |"); - MvWAddStr(lookdeer2, 8, 8, "\\/ |"); - MvWAddStr(lookdeer2, 9, 9, "|> |>"); - - /* lookdeer3 */ - MvWAddStr(lookdeer3, 0, 16, "\\/ \\/"); - MvWAddStr(lookdeer3, 1, 17, "\\Y/ \\Y/"); - MvWAddStr(lookdeer3, 2, 19, "\\=/"); - MvWAddStr(lookdeer3, 3, 17, "^\\o o/^"); - MvWAddStr(lookdeer3, 4, 17, "//( )"); - MvWAddStr(lookdeer3, 5, 7, "^~~~~~~~~// \\O/"); - MvWAddStr(lookdeer3, 6, 6, "( ()_____( /"); - MvWAddStr(lookdeer3, 7, 6, "/ / /"); - MvWAddStr(lookdeer3, 8, 5, "|/ \\"); - MvWAddStr(lookdeer3, 9, 5, "/> \\>"); - - /* lookdeer4 */ - MvWAddStr(lookdeer4, 0, 16, "\\/ \\/"); - MvWAddStr(lookdeer4, 1, 17, "\\Y/ \\Y/"); - MvWAddStr(lookdeer4, 2, 19, "\\=/"); - MvWAddStr(lookdeer4, 3, 17, "^\\o o/^"); - MvWAddStr(lookdeer4, 4, 17, "//( )"); - MvWAddStr(lookdeer4, 5, 7, "^~~~~~~~~// \\O/"); - MvWAddStr(lookdeer4, 6, 6, "( )______( /"); - MvWAddStr(lookdeer4, 7, 5, "(/ \\"); - MvWAddStr(lookdeer4, 8, 0, "v___= ----^"); - - /***********************************************/ - cbreak(); - nodelay(stdscr, TRUE); - for (;;) { - clear(); - werase(treescrn); - touchwin(w_del_msg); - touchwin(treescrn); - werase(treescrn2); - touchwin(treescrn2); - werase(treescrn8); - touchwin(treescrn8); - refresh(); - look_out(150); - boxit(); - refresh(); - look_out(150); - seas(); - refresh(); - look_out(150); - greet(); - refresh(); - look_out(150); - fromwho(); - refresh(); - look_out(150); - tree(); - look_out(150); - balls(); - look_out(150); - star(); - look_out(150); - strng1(); - strng2(); - strng3(); - strng4(); - strng5(); - - /* set up the windows for our blinking trees */ - /* **************************************** */ - /* treescrn3 */ - - overlay(treescrn, treescrn3); - - /*balls */ - MvWAddCh(treescrn3, 4, 18, ' '); - MvWAddCh(treescrn3, 7, 6, ' '); - MvWAddCh(treescrn3, 8, 19, ' '); - MvWAddCh(treescrn3, 11, 22, ' '); - - /*star */ - MvWAddCh(treescrn3, 0, 12, '*'); - - /*strng1 */ - MvWAddCh(treescrn3, 3, 11, ' '); - - /*strng2 */ - MvWAddCh(treescrn3, 5, 13, ' '); - MvWAddCh(treescrn3, 6, 10, ' '); - - /*strng3 */ - MvWAddCh(treescrn3, 7, 16, ' '); - MvWAddCh(treescrn3, 7, 14, ' '); - - /*strng4 */ - MvWAddCh(treescrn3, 10, 13, ' '); - MvWAddCh(treescrn3, 10, 10, ' '); - MvWAddCh(treescrn3, 11, 8, ' '); - - /*strng5 */ - MvWAddCh(treescrn3, 11, 18, ' '); - MvWAddCh(treescrn3, 12, 13, ' '); - - /* treescrn4 */ - - overlay(treescrn, treescrn4); - - /*balls */ - MvWAddCh(treescrn4, 3, 9, ' '); - MvWAddCh(treescrn4, 4, 16, ' '); - MvWAddCh(treescrn4, 7, 6, ' '); - MvWAddCh(treescrn4, 8, 19, ' '); - MvWAddCh(treescrn4, 11, 2, ' '); - MvWAddCh(treescrn4, 12, 23, ' '); - - /*star */ - (void) wstandout(treescrn4); - MvWAddCh(treescrn4, 0, 12, '*'); - (void) wstandend(treescrn4); - - /*strng1 */ - MvWAddCh(treescrn4, 3, 13, ' '); - - /*strng2 */ - - /*strng3 */ - MvWAddCh(treescrn4, 7, 15, ' '); - MvWAddCh(treescrn4, 8, 11, ' '); - - /*strng4 */ - MvWAddCh(treescrn4, 9, 16, ' '); - MvWAddCh(treescrn4, 10, 12, ' '); - MvWAddCh(treescrn4, 11, 8, ' '); - - /*strng5 */ - MvWAddCh(treescrn4, 11, 18, ' '); - MvWAddCh(treescrn4, 12, 14, ' '); - - /* treescrn5 */ - - overlay(treescrn, treescrn5); - - /*balls */ - MvWAddCh(treescrn5, 3, 15, ' '); - MvWAddCh(treescrn5, 10, 20, ' '); - MvWAddCh(treescrn5, 12, 1, ' '); - - /*star */ - MvWAddCh(treescrn5, 0, 12, '*'); - - /*strng1 */ - MvWAddCh(treescrn5, 3, 11, ' '); - - /*strng2 */ - MvWAddCh(treescrn5, 5, 12, ' '); - - /*strng3 */ - MvWAddCh(treescrn5, 7, 14, ' '); - MvWAddCh(treescrn5, 8, 10, ' '); - - /*strng4 */ - MvWAddCh(treescrn5, 9, 15, ' '); - MvWAddCh(treescrn5, 10, 11, ' '); - MvWAddCh(treescrn5, 11, 7, ' '); - - /*strng5 */ - MvWAddCh(treescrn5, 11, 17, ' '); - MvWAddCh(treescrn5, 12, 13, ' '); - - /* treescrn6 */ - - overlay(treescrn, treescrn6); - - /*balls */ - MvWAddCh(treescrn6, 6, 7, ' '); - MvWAddCh(treescrn6, 7, 18, ' '); - MvWAddCh(treescrn6, 10, 4, ' '); - MvWAddCh(treescrn6, 11, 23, ' '); - - /*star */ - (void) wstandout(treescrn6); - MvWAddCh(treescrn6, 0, 12, '*'); - (void) wstandend(treescrn6); - - /*strng1 */ - - /*strng2 */ - MvWAddCh(treescrn6, 5, 11, ' '); - - /*strng3 */ - MvWAddCh(treescrn6, 7, 13, ' '); - MvWAddCh(treescrn6, 8, 9, ' '); - - /*strng4 */ - MvWAddCh(treescrn6, 9, 14, ' '); - MvWAddCh(treescrn6, 10, 10, ' '); - MvWAddCh(treescrn6, 11, 6, ' '); - - /*strng5 */ - MvWAddCh(treescrn6, 11, 16, ' '); - MvWAddCh(treescrn6, 12, 12, ' '); - - /* treescrn7 */ - - overlay(treescrn, treescrn7); - - /*balls */ - MvWAddCh(treescrn7, 3, 15, ' '); - MvWAddCh(treescrn7, 6, 7, ' '); - MvWAddCh(treescrn7, 7, 18, ' '); - MvWAddCh(treescrn7, 10, 4, ' '); - MvWAddCh(treescrn7, 11, 22, ' '); - - /*star */ - MvWAddCh(treescrn7, 0, 12, '*'); - - /*strng1 */ - MvWAddCh(treescrn7, 3, 12, ' '); - - /*strng2 */ - MvWAddCh(treescrn7, 5, 13, ' '); - MvWAddCh(treescrn7, 6, 9, ' '); - - /*strng3 */ - MvWAddCh(treescrn7, 7, 15, ' '); - MvWAddCh(treescrn7, 8, 11, ' '); - - /*strng4 */ - MvWAddCh(treescrn7, 9, 16, ' '); - MvWAddCh(treescrn7, 10, 12, ' '); - MvWAddCh(treescrn7, 11, 8, ' '); - - /*strng5 */ - MvWAddCh(treescrn7, 11, 18, ' '); - MvWAddCh(treescrn7, 12, 14, ' '); - - look_out(150); - reindeer(); - - touchwin(w_holiday); - wrefresh(w_holiday); - wrefresh(w_del_msg); - - look_out(500); - 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 RETSIGTYPE -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); -} diff --git a/test/xterm-16color.dat b/test/xterm-16color.dat deleted file mode 100644 index 6d47d93cb75..00000000000 --- a/test/xterm-16color.dat +++ /dev/null @@ -1,53 +0,0 @@ -############################################################################## -# Copyright (c) 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"), # -# 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: xterm-16color.dat,v 1.2 2006/04/22 21:40:00 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 -# manipulate the colors shown in the screen. The 'd' screen is limited to -# 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. -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 -5: 205 0 205 magenta3 -6: 0 205 205 cyan3 -7: 229 229 229 gray90 -8: 127 127 127 gray50 -9: 255 0 0 red -10: 0 255 0 green -11: 255 255 0 yellow -12: 99 184 255 SteelBlue1 -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 deleted file mode 100644 index 3dcaabdf28b..00000000000 --- a/test/xterm-256color.dat +++ /dev/null @@ -1,293 +0,0 @@ -############################################################################## -# Copyright (c) 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 "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: xterm-256color.dat,v 1.1 2009/10/30 22:33:40 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 -# manipulate the colors shown in the screen. The 'd' screen is limited to -# 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. -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 -5: 205 0 205 magenta3 -6: 0 205 205 cyan3 -7: 229 229 229 gray90 -8: 127 127 127 gray50 -9: 255 0 0 red -10: 0 255 0 green -11: 255 255 0 yellow -12: 99 184 255 SteelBlue1 -13: 255 0 255 magenta -14: 0 255 255 cyan -15: 255 255 255 white -16: 0 0 0 -17: 0 0 95 -18: 0 0 135 -19: 0 0 175 -20: 0 0 215 -21: 0 0 255 -22: 0 95 0 -23: 0 95 95 -24: 0 95 135 -25: 0 95 175 -26: 0 95 215 -27: 0 95 255 -28: 0 135 0 -29: 0 135 95 -30: 0 135 135 -31: 0 135 175 -32: 0 135 215 -33: 0 135 255 -34: 0 175 0 -35: 0 175 95 -36: 0 175 135 -37: 0 175 175 -38: 0 175 215 -39: 0 175 255 -40: 0 215 0 -41: 0 215 95 -42: 0 215 135 -43: 0 215 175 -44: 0 215 215 -45: 0 215 255 -46: 0 255 0 -47: 0 255 95 -48: 0 255 135 -49: 0 255 175 -50: 0 255 215 -51: 0 255 255 -52: 95 0 0 -53: 95 0 95 -54: 95 0 135 -55: 95 0 175 -56: 95 0 215 -57: 95 0 255 -58: 95 95 0 -59: 95 95 95 -60: 95 95 135 -61: 95 95 175 -62: 95 95 215 -63: 95 95 255 -64: 95 135 0 -65: 95 135 95 -66: 95 135 135 -67: 95 135 175 -68: 95 135 215 -69: 95 135 255 -70: 95 175 0 -71: 95 175 95 -72: 95 175 135 -73: 95 175 175 -74: 95 175 215 -75: 95 175 255 -76: 95 215 0 -77: 95 215 95 -78: 95 215 135 -79: 95 215 175 -80: 95 215 215 -81: 95 215 255 -82: 95 255 0 -83: 95 255 95 -84: 95 255 135 -85: 95 255 175 -86: 95 255 215 -87: 95 255 255 -88: 135 0 0 -89: 135 0 95 -90: 135 0 135 -91: 135 0 175 -92: 135 0 215 -93: 135 0 255 -94: 135 95 0 -95: 135 95 95 -96: 135 95 135 -97: 135 95 175 -98: 135 95 215 -99: 135 95 255 -100: 135 135 0 -101: 135 135 95 -102: 135 135 135 -103: 135 135 175 -104: 135 135 215 -105: 135 135 255 -106: 135 175 0 -107: 135 175 95 -108: 135 175 135 -109: 135 175 175 -110: 135 175 215 -111: 135 175 255 -112: 135 215 0 -113: 135 215 95 -114: 135 215 135 -115: 135 215 175 -116: 135 215 215 -117: 135 215 255 -118: 135 255 0 -119: 135 255 95 -120: 135 255 135 -121: 135 255 175 -122: 135 255 215 -123: 135 255 255 -124: 175 0 0 -125: 175 0 95 -126: 175 0 135 -127: 175 0 175 -128: 175 0 215 -129: 175 0 255 -130: 175 95 0 -131: 175 95 95 -132: 175 95 135 -133: 175 95 175 -134: 175 95 215 -135: 175 95 255 -136: 175 135 0 -137: 175 135 95 -138: 175 135 135 -139: 175 135 175 -140: 175 135 215 -141: 175 135 255 -142: 175 175 0 -143: 175 175 95 -144: 175 175 135 -145: 175 175 175 -146: 175 175 215 -147: 175 175 255 -148: 175 215 0 -149: 175 215 95 -150: 175 215 135 -151: 175 215 175 -152: 175 215 215 -153: 175 215 255 -154: 175 255 0 -155: 175 255 95 -156: 175 255 135 -157: 175 255 175 -158: 175 255 215 -159: 175 255 255 -160: 215 0 0 -161: 215 0 95 -162: 215 0 135 -163: 215 0 175 -164: 215 0 215 -165: 215 0 255 -166: 215 95 0 -167: 215 95 95 -168: 215 95 135 -169: 215 95 175 -170: 215 95 215 -171: 215 95 255 -172: 215 135 0 -173: 215 135 95 -174: 215 135 135 -175: 215 135 175 -176: 215 135 215 -177: 215 135 255 -178: 215 175 0 -179: 215 175 95 -180: 215 175 135 -181: 215 175 175 -182: 215 175 215 -183: 215 175 255 -184: 215 215 0 -185: 215 215 95 -186: 215 215 135 -187: 215 215 175 -188: 215 215 215 -189: 215 215 255 -190: 215 255 0 -191: 215 255 95 -192: 215 255 135 -193: 215 255 175 -194: 215 255 215 -195: 215 255 255 -196: 255 0 0 -197: 255 0 95 -198: 255 0 135 -199: 255 0 175 -200: 255 0 215 -201: 255 0 255 -202: 255 95 0 -203: 255 95 95 -204: 255 95 135 -205: 255 95 175 -206: 255 95 215 -207: 255 95 255 -208: 255 135 0 -209: 255 135 95 -210: 255 135 135 -211: 255 135 175 -212: 255 135 215 -213: 255 135 255 -214: 255 175 0 -215: 255 175 95 -216: 255 175 135 -217: 255 175 175 -218: 255 175 215 -219: 255 175 255 -220: 255 215 0 -221: 255 215 95 -222: 255 215 135 -223: 255 215 175 -224: 255 215 215 -225: 255 215 255 -226: 255 255 0 -227: 255 255 95 -228: 255 255 135 -229: 255 255 175 -230: 255 255 215 -231: 255 255 255 -232: 8 8 8 -233: 18 18 18 -234: 28 28 28 -235: 38 38 38 -236: 48 48 48 -237: 58 58 58 -238: 68 68 68 -239: 78 78 78 -240: 88 88 88 -241: 98 98 98 -242: 108 108 108 -243: 118 118 118 -244: 128 128 128 -245: 138 138 138 -246: 148 148 148 -247: 158 158 158 -248: 168 168 168 -249: 178 178 178 -250: 188 188 188 -251: 198 198 198 -252: 208 208 208 -253: 218 218 218 -254: 228 228 228 -255: 238 238 238 diff --git a/test/xterm-88color.dat b/test/xterm-88color.dat deleted file mode 100644 index 95a753cdcec..00000000000 --- a/test/xterm-88color.dat +++ /dev/null @@ -1,125 +0,0 @@ -############################################################################## -# Copyright (c) 2005-2006,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 "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: xterm-88color.dat,v 1.3 2009/10/30 22:33:56 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 -# manipulate the colors shown in the screen. The 'd' screen is limited to -# 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. -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 -5: 205 0 205 magenta3 -6: 0 205 205 cyan3 -7: 229 229 229 gray90 -8: 127 127 127 gray50 -9: 255 0 0 red -10: 0 255 0 green -11: 255 255 0 yellow -12: 99 184 255 SteelBlue1 -13: 255 0 255 magenta -14: 0 255 255 cyan -15: 255 255 255 white -16: 0 0 0 -17: 0 0 139 -18: 0 0 205 -19: 0 0 255 -20: 0 139 0 -21: 0 139 139 -22: 0 139 205 -23: 0 139 255 -24: 0 205 0 -25: 0 205 139 -26: 0 205 205 -27: 0 205 255 -28: 0 255 0 -29: 0 255 139 -30: 0 255 205 -31: 0 255 255 -32: 139 0 0 -33: 139 0 139 -34: 139 0 205 -35: 139 0 255 -36: 139 139 0 -37: 139 139 139 -38: 139 139 205 -39: 139 139 255 -40: 139 205 0 -41: 139 205 139 -42: 139 205 205 -43: 139 205 255 -44: 139 255 0 -45: 139 255 139 -46: 139 255 205 -47: 139 255 255 -48: 205 0 0 -49: 205 0 139 -50: 205 0 205 -51: 205 0 255 -52: 205 139 0 -53: 205 139 139 -54: 205 139 205 -55: 205 139 255 -56: 205 205 0 -57: 205 205 139 -58: 205 205 205 -59: 205 205 255 -60: 205 255 0 -61: 205 255 139 -62: 205 255 205 -63: 205 255 255 -64: 255 0 0 -65: 255 0 139 -66: 255 0 205 -67: 255 0 255 -68: 255 139 0 -69: 255 139 139 -70: 255 139 205 -71: 255 139 255 -72: 255 205 0 -73: 255 205 139 -74: 255 205 205 -75: 255 205 255 -76: 255 255 0 -77: 255 255 139 -78: 255 255 205 -79: 255 255 255 -80: 46 46 46 -81: 92 92 92 -82: 113 113 113 -83: 139 139 139 -84: 162 162 162 -85: 185 185 185 -86: 208 208 208 -87: 231 231 231 From a0044ffc69cfe39a3b0b2d208e0952254555afc6 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Fri, 28 Feb 2014 19:18:07 +0000 Subject: [PATCH 4/4] Redo import of ncurses 5.9 (stripped). --- ANNOUNCE | 323 +- INSTALL | 219 +- MANIFEST | 86 +- Makefile.in | 15 +- NEWS | 1082 ++- README.MinGW | 149 + TO-DO | 39 +- aclocal.m4 | 1808 +++-- announce.html.in | 907 +-- config.guess | 370 +- config.sub | 166 +- configure | 6943 +++++++++++++------ configure.in | 454 +- dist.mk | 11 +- doc/html/announce.html | 907 +-- doc/html/hackguide.html | 6 +- doc/html/ncurses-intro.html | 6 +- form/Makefile.in | 19 +- form/f_trace.c | 12 +- form/fld_arg.c | 8 +- form/fld_attr.c | 6 +- form/fld_current.c | 10 +- form/fld_def.c | 10 +- form/fld_dup.c | 8 +- form/fld_ftchoice.c | 11 +- form/fld_ftlink.c | 8 +- form/fld_info.c | 18 +- form/fld_just.c | 8 +- form/fld_link.c | 8 +- form/fld_max.c | 6 +- form/fld_move.c | 6 +- form/fld_newftyp.c | 28 +- form/fld_opts.c | 12 +- form/fld_pad.c | 8 +- form/fld_page.c | 8 +- form/fld_stat.c | 8 +- form/fld_type.c | 8 +- form/fld_user.c | 8 +- form/form.h | 81 +- form/form.priv.h | 61 +- form/frm_cursor.c | 6 +- form/frm_data.c | 8 +- form/frm_def.c | 67 +- form/frm_driver.c | 350 +- form/frm_hook.c | 6 +- form/frm_opts.c | 12 +- form/frm_page.c | 8 +- form/frm_post.c | 8 +- form/frm_req_name.c | 8 +- form/frm_scale.c | 9 +- form/frm_sub.c | 23 +- form/frm_user.c | 8 +- form/frm_win.c | 29 +- form/fty_alnum.c | 65 +- form/fty_alpha.c | 65 +- form/fty_enum.c | 160 +- form/fty_generic.c | 297 + form/fty_int.c | 79 +- form/fty_ipv4.c | 25 +- form/fty_num.c | 91 +- form/fty_regex.c | 228 +- form/llib-lform | 51 +- form/llib-lformt | 777 +++ form/llib-lformtw | 783 +++ form/llib-lformw | 51 +- form/modules | 86 +- include/Caps | 10 +- include/Caps.aix4 | 10 +- include/Caps.hpux11 | 10 +- include/Caps.keys | 10 +- include/Caps.osf1r5 | 10 +- include/Caps.uwin | 10 +- include/MKterm.h.awk.in | 56 +- include/Makefile.in | 20 +- include/capdefaults.c | 6 +- include/curses.h.in | 270 +- include/curses.tail | 32 +- include/curses.wide | 68 +- include/headers | 6 +- include/nc_alloc.h | 18 +- include/nc_mingw.h | 69 + include/nc_panel.h | 35 +- include/nc_tparm.h | 12 +- include/ncurses_defs | 11 +- include/{ncurses_dll.h => ncurses_dll.h.in} | 20 +- include/ncurses_mingw.h | 164 + include/term_entry.h | 12 +- include/tic.h | 28 +- include/unctrl.h.in | 8 +- man/MKada_config.in | 57 + man/MKncu_config.in | 98 + man/Makefile.in | 11 +- man/captoinfo.1m | 59 +- man/clear.1 | 12 +- man/curs_add_wch.3x | 129 +- man/curs_add_wchstr.3x | 16 +- man/curs_addch.3x | 34 +- man/curs_addchstr.3x | 18 +- man/curs_addstr.3x | 18 +- man/curs_addwstr.3x | 16 +- man/curs_attr.3x | 24 +- man/curs_beep.3x | 12 +- man/curs_bkgd.3x | 14 +- man/curs_bkgrnd.3x | 10 +- man/curs_border.3x | 32 +- man/curs_border_set.3x | 31 +- man/curs_clear.3x | 17 +- man/curs_color.3x | 51 +- man/curs_delch.3x | 16 +- man/curs_deleteln.3x | 12 +- man/curs_extend.3x | 12 +- man/curs_get_wch.3x | 8 +- man/curs_get_wstr.3x | 14 +- man/curs_getcchar.3x | 45 +- man/curs_getch.3x | 34 +- man/curs_getstr.3x | 20 +- man/curs_getyx.3x | 14 +- man/curs_in_wch.3x | 16 +- man/curs_in_wchstr.3x | 14 +- man/curs_inch.3x | 20 +- man/curs_inchstr.3x | 18 +- man/curs_initscr.3x | 20 +- man/curs_inopts.3x | 14 +- man/curs_ins_wch.3x | 14 +- man/curs_ins_wstr.3x | 14 +- man/curs_insch.3x | 16 +- man/curs_insstr.3x | 16 +- man/curs_instr.3x | 16 +- man/curs_inwstr.3x | 14 +- man/curs_kernel.3x | 29 +- man/curs_legacy.3x | 21 +- man/curs_memleaks.3x | 14 +- man/curs_mouse.3x | 29 +- man/curs_move.3x | 12 +- man/curs_opaque.3x | 28 +- man/curs_outopts.3x | 26 +- man/curs_overlay.3x | 12 +- man/curs_pad.3x | 19 +- man/curs_print.3x | 12 +- man/curs_printw.3x | 16 +- man/curs_refresh.3x | 16 +- man/curs_scanw.3x | 16 +- man/curs_scr_dump.3x | 12 +- man/curs_scroll.3x | 12 +- man/curs_slk.3x | 111 +- man/curs_sp_funcs.3x | 353 + man/curs_termattrs.3x | 12 +- man/curs_termcap.3x | 29 +- man/curs_terminfo.3x | 41 +- man/curs_threads.3x | 40 +- man/curs_touch.3x | 16 +- man/curs_trace.3x | 37 +- man/curs_util.3x | 59 +- man/curs_variables.3x | 135 + man/curs_window.3x | 21 +- man/default_colors.3x | 22 +- man/define_key.3x | 16 +- man/form.3x | 16 +- man/form_cursor.3x | 12 +- man/form_data.3x | 12 +- man/form_driver.3x | 44 +- man/form_field.3x | 14 +- man/form_field_attributes.3x | 12 +- man/form_field_buffer.3x | 40 +- man/form_field_info.3x | 12 +- man/form_field_just.3x | 12 +- man/form_field_new.3x | 12 +- man/form_field_opts.3x | 13 +- man/form_field_userptr.3x | 12 +- man/form_field_validation.3x | 26 +- man/form_fieldtype.3x | 12 +- man/form_hook.3x | 12 +- man/form_new.3x | 12 +- man/form_new_page.3x | 12 +- man/form_opts.3x | 12 +- man/form_page.3x | 12 +- man/form_post.3x | 12 +- man/form_requestname.3x | 12 +- man/form_userptr.3x | 12 +- man/form_variables.3x | 82 + man/form_win.3x | 16 +- man/infocmp.1m | 182 +- man/infotocap.1m | 45 +- man/key_defined.3x | 12 +- man/keybound.3x | 10 +- man/keyok.3x | 12 +- man/legacy_coding.3x | 10 +- man/man_db.renames | 20 +- man/menu.3x | 16 +- man/menu_attributes.3x | 12 +- man/menu_cursor.3x | 12 +- man/menu_driver.3x | 55 +- man/menu_format.3x | 12 +- man/menu_hook.3x | 12 +- man/menu_items.3x | 14 +- man/menu_mark.3x | 14 +- man/menu_new.3x | 12 +- man/menu_opts.3x | 12 +- man/menu_pattern.3x | 12 +- man/menu_post.3x | 12 +- man/menu_requestname.3x | 12 +- man/menu_spacing.3x | 52 +- man/menu_userptr.3x | 12 +- man/menu_win.3x | 16 +- man/mitem_current.3x | 14 +- man/mitem_name.3x | 12 +- man/mitem_new.3x | 12 +- man/mitem_opts.3x | 12 +- man/mitem_userptr.3x | 12 +- man/mitem_value.3x | 12 +- man/mitem_visible.3x | 12 +- man/ncurses.3x | 130 +- man/panel.3x | 19 +- man/resizeterm.3x | 13 +- man/tabs.1 | 141 + man/term.5 | 22 +- man/term.7 | 62 +- man/term_variables.3x | 153 + man/terminfo.head | 34 +- man/terminfo.tail | 103 +- man/tic.1m | 180 +- man/toe.1m | 26 +- man/tput.1 | 56 +- man/tset.1 | 95 +- man/wresize.3x | 17 +- menu/Makefile.in | 19 +- menu/llib-lmenu | 12 +- menu/llib-lmenut | 551 ++ menu/llib-lmenutw | 553 ++ menu/llib-lmenuw | 12 +- menu/m_attribs.c | 11 +- menu/m_cursor.c | 8 +- menu/m_driver.c | 11 +- menu/m_format.c | 6 +- menu/m_global.c | 14 +- menu/m_hook.c | 6 +- menu/m_item_cur.c | 10 +- menu/m_item_nam.c | 8 +- menu/m_item_new.c | 15 +- menu/m_item_opt.c | 12 +- menu/m_item_top.c | 8 +- menu/m_item_use.c | 8 +- menu/m_item_val.c | 8 +- menu/m_item_vis.c | 6 +- menu/m_items.c | 10 +- menu/m_new.c | 84 +- menu/m_opts.c | 12 +- menu/m_pad.c | 12 +- menu/m_pattern.c | 8 +- menu/m_post.c | 14 +- menu/m_req_name.c | 6 +- menu/m_scale.c | 9 +- menu/m_spacing.c | 13 +- menu/m_sub.c | 28 +- menu/m_trace.c | 10 +- menu/m_userptr.c | 8 +- menu/m_win.c | 30 +- menu/menu.h | 8 +- menu/menu.priv.h | 10 +- menu/modules | 58 +- misc/Makefile.in | 38 +- misc/gen-pkgconfig.in | 139 + misc/jpf-indent | 119 - misc/ncu-indent | 132 - misc/ncurses-config.in | 59 +- misc/run_tic.in | 90 +- misc/terminfo.src | 1084 ++- mk-0th.awk | 16 +- mk-1st.awk | 39 +- mk-dlls.sh.in | 114 + mk-hdr.awk | 6 +- mkdirs.sh | 51 - ncurses/Makefile.in | 54 +- ncurses/README | 23 +- ncurses/base/MKkeyname.awk | 21 +- ncurses/base/MKlib_gen.sh | 75 +- ncurses/base/MKunctrl.awk | 26 +- ncurses/base/define_key.c | 39 +- ncurses/base/key_defined.c | 20 +- ncurses/base/keybound.c | 23 +- ncurses/base/keyok.c | 39 +- ncurses/base/legacy_coding.c | 25 +- ncurses/base/lib_addch.c | 80 +- ncurses/base/lib_addstr.c | 19 +- ncurses/base/lib_beep.c | 27 +- ncurses/base/lib_bkgd.c | 16 +- ncurses/base/lib_box.c | 9 +- ncurses/base/lib_chgat.c | 8 +- ncurses/base/lib_clear.c | 6 +- ncurses/base/lib_clearok.c | 6 +- ncurses/base/lib_clrbot.c | 6 +- ncurses/base/lib_clreol.c | 6 +- ncurses/base/lib_color.c | 566 +- ncurses/base/lib_colorset.c | 19 +- ncurses/base/lib_delch.c | 6 +- ncurses/base/lib_delwin.c | 21 +- ncurses/base/lib_dft_fgbg.c | 74 +- ncurses/base/lib_driver.c | 143 + ncurses/base/lib_echo.c | 36 +- ncurses/base/lib_endwin.c | 47 +- ncurses/base/lib_erase.c | 6 +- ncurses/base/lib_flash.c | 30 +- ncurses/base/lib_freeall.c | 62 +- ncurses/base/lib_getch.c | 181 +- ncurses/base/lib_getstr.c | 25 +- ncurses/base/lib_hline.c | 10 +- ncurses/base/lib_immedok.c | 6 +- ncurses/base/lib_inchstr.c | 11 +- ncurses/base/lib_initscr.c | 8 +- ncurses/base/lib_insch.c | 48 +- ncurses/base/lib_insdel.c | 6 +- ncurses/base/lib_insnstr.c | 10 +- ncurses/base/lib_instr.c | 30 +- ncurses/base/lib_isendwin.c | 20 +- ncurses/base/lib_leaveok.c | 6 +- ncurses/base/lib_mouse.c | 277 +- ncurses/base/lib_move.c | 6 +- ncurses/base/lib_mvwin.c | 20 +- ncurses/base/lib_newterm.c | 238 +- ncurses/base/lib_newwin.c | 156 +- ncurses/base/lib_nl.c | 54 +- ncurses/base/lib_overlay.c | 16 +- ncurses/base/lib_pad.c | 82 +- ncurses/base/lib_printw.c | 16 +- ncurses/base/lib_redrawln.c | 27 +- ncurses/base/lib_refresh.c | 69 +- ncurses/base/lib_restart.c | 78 +- ncurses/base/lib_scanw.c | 6 +- ncurses/base/lib_screen.c | 130 +- ncurses/base/lib_scroll.c | 10 +- ncurses/base/lib_scrollok.c | 6 +- ncurses/base/lib_scrreg.c | 6 +- ncurses/base/lib_set_term.c | 468 +- ncurses/base/lib_slk.c | 240 +- ncurses/base/lib_slkatr_set.c | 52 +- ncurses/base/lib_slkatrof.c | 26 +- ncurses/base/lib_slkatron.c | 26 +- ncurses/base/lib_slkatrset.c | 20 +- ncurses/base/lib_slkattr.c | 24 +- ncurses/base/lib_slkclear.c | 30 +- ncurses/base/lib_slkcolor.c | 40 +- ncurses/base/lib_slkinit.c | 39 +- ncurses/base/lib_slklab.c | 24 +- ncurses/base/lib_slkrefr.c | 103 +- ncurses/base/lib_slkset.c | 28 +- ncurses/base/lib_slktouch.c | 24 +- ncurses/base/lib_touch.c | 14 +- ncurses/base/lib_ungetch.c | 14 +- ncurses/base/lib_vline.c | 10 +- ncurses/base/lib_wattroff.c | 6 +- ncurses/base/lib_wattron.c | 8 +- ncurses/base/lib_winch.c | 12 +- ncurses/base/lib_window.c | 66 +- ncurses/base/nc_panel.c | 18 +- ncurses/base/resizeterm.c | 198 +- ncurses/base/safe_sprintf.c | 37 +- ncurses/base/tries.c | 12 +- ncurses/base/use_window.c | 6 +- ncurses/base/wresize.c | 33 +- ncurses/build.priv.h | 108 + ncurses/curses.priv.h | 878 ++- ncurses/llib-lncurses | 1026 ++- ncurses/llib-lncursest | 1055 ++- ncurses/llib-lncursestw | 5270 ++++++++++++++ ncurses/llib-lncursesw | 1071 ++- ncurses/modules | 370 +- ncurses/tinfo/MKcaptab.sh | 136 +- ncurses/tinfo/MKcodes.awk | 23 +- ncurses/tinfo/MKfallback.sh | 18 +- ncurses/tinfo/MKnames.awk | 26 +- ncurses/tinfo/access.c | 7 +- ncurses/tinfo/add_tries.c | 11 +- ncurses/tinfo/alloc_entry.c | 19 +- ncurses/tinfo/alloc_ttype.c | 90 +- ncurses/tinfo/captoinfo.c | 49 +- ncurses/tinfo/comp_expand.c | 6 +- ncurses/tinfo/comp_hash.c | 330 +- ncurses/tinfo/comp_parse.c | 18 +- ncurses/tinfo/comp_scan.c | 92 +- ncurses/tinfo/db_iterator.c | 11 +- ncurses/tinfo/entries.c | 18 +- ncurses/tinfo/free_ttype.c | 6 +- ncurses/tinfo/hashed_db.c | 60 +- ncurses/tinfo/home_terminfo.c | 6 +- ncurses/tinfo/init_keytry.c | 20 +- ncurses/tinfo/lib_acs.c | 82 +- ncurses/tinfo/lib_baudrate.c | 32 +- ncurses/tinfo/lib_cur_term.c | 122 +- ncurses/tinfo/lib_data.c | 50 +- ncurses/tinfo/lib_has_cap.c | 53 +- ncurses/tinfo/lib_kernel.c | 82 +- ncurses/tinfo/lib_longname.c | 42 +- ncurses/tinfo/lib_napms.c | 21 +- ncurses/tinfo/lib_options.c | 281 +- ncurses/tinfo/lib_print.c | 39 +- ncurses/tinfo/lib_raw.c | 202 +- ncurses/tinfo/lib_setup.c | 403 +- ncurses/tinfo/lib_termcap.c | 223 +- ncurses/tinfo/lib_termname.c | 22 +- ncurses/tinfo/lib_ti.c | 164 +- ncurses/tinfo/lib_tparm.c | 49 +- ncurses/tinfo/lib_tputs.c | 168 +- ncurses/tinfo/lib_ttyflags.c | 217 +- ncurses/tinfo/make_hash.c | 294 + ncurses/tinfo/make_keys.c | 24 +- ncurses/tinfo/name_match.c | 3 +- ncurses/tinfo/parse_entry.c | 55 +- ncurses/tinfo/read_entry.c | 71 +- ncurses/tinfo/read_termcap.c | 20 +- ncurses/tinfo/setbuf.c | 35 +- ncurses/tinfo/tinfo_driver.c | 1337 ++++ ncurses/tinfo/trim_sgr0.c | 38 +- ncurses/tinfo/use_screen.c | 8 +- ncurses/tinfo/write_entry.c | 82 +- ncurses/trace/lib_trace.c | 37 +- ncurses/trace/lib_traceatr.c | 55 +- ncurses/trace/lib_tracebits.c | 7 +- ncurses/trace/lib_tracechr.c | 10 +- ncurses/trace/lib_tracedmp.c | 12 +- ncurses/trace/lib_tracemse.c | 42 +- ncurses/trace/trace_buf.c | 11 +- ncurses/trace/trace_tries.c | 14 +- ncurses/trace/trace_xnames.c | 7 +- ncurses/trace/varargs.c | 4 +- ncurses/trace/visbuf.c | 57 +- ncurses/tty/MKexpanded.sh | 61 +- ncurses/tty/hardscroll.c | 113 +- ncurses/tty/hashmap.c | 257 +- ncurses/tty/lib_mvcur.c | 500 +- ncurses/tty/lib_tstp.c | 45 +- ncurses/tty/lib_twait.c | 82 +- ncurses/tty/lib_vidattr.c | 133 +- ncurses/tty/tty_update.c | 1222 ++-- ncurses/wcwidth.h | 309 + ncurses/widechar/lib_add_wch.c | 438 +- ncurses/widechar/lib_box_set.c | 6 +- ncurses/widechar/lib_cchar.c | 34 +- ncurses/widechar/lib_erasewchar.c | 8 +- ncurses/widechar/lib_get_wch.c | 33 +- ncurses/widechar/lib_get_wstr.c | 7 +- ncurses/widechar/lib_hline_set.c | 12 +- ncurses/widechar/lib_in_wch.c | 6 +- ncurses/widechar/lib_in_wchnstr.c | 6 +- ncurses/widechar/lib_ins_wch.c | 56 +- ncurses/widechar/lib_inwstr.c | 8 +- ncurses/widechar/lib_pecho_wchar.c | 8 +- ncurses/widechar/lib_unget_wch.c | 28 +- ncurses/widechar/lib_vid_attr.c | 124 +- ncurses/widechar/lib_vline_set.c | 12 +- ncurses/widechar/lib_wacs.c | 31 +- ncurses/widechar/lib_wunctrl.c | 26 +- ncurses/win32con/gettimeofday.c | 51 + ncurses/win32con/wcwidth.c | 50 + ncurses/win32con/win_driver.c | 1241 ++++ panel/Makefile.in | 19 +- panel/llib-lpanel | 21 +- panel/llib-lpanelt | 197 + panel/llib-lpaneltw | 197 + panel/llib-lpanelw | 21 +- panel/modules | 34 +- panel/p_above.c | 46 +- panel/p_below.c | 45 +- panel/p_bottom.c | 8 +- panel/p_delete.c | 14 +- panel/p_hidden.c | 18 +- panel/p_hide.c | 24 +- panel/p_move.c | 24 +- panel/p_new.c | 29 +- panel/p_replace.c | 26 +- panel/p_show.c | 39 +- panel/p_top.c | 6 +- panel/p_update.c | 43 +- panel/p_user.c | 8 +- panel/p_win.c | 6 +- panel/panel.c | 10 +- panel/panel.h | 12 +- panel/panel.priv.h | 61 +- progs/Makefile.in | 49 +- progs/dump_entry.c | 16 +- progs/infocmp.c | 24 +- progs/modules | 10 +- progs/tabs.c | 510 ++ progs/tic.c | 207 +- progs/toe.c | 23 +- progs/tput.c | 60 +- progs/transform.c | 79 + progs/tset.c | 38 +- tar-copy.sh | 77 - 488 files changed, 39934 insertions(+), 12728 deletions(-) create mode 100644 README.MinGW create mode 100644 form/fty_generic.c create mode 100644 form/llib-lformt create mode 100644 form/llib-lformtw create mode 100644 include/nc_mingw.h rename include/{ncurses_dll.h => ncurses_dll.h.in} (93%) create mode 100644 include/ncurses_mingw.h create mode 100644 man/MKada_config.in create mode 100644 man/MKncu_config.in create mode 100644 man/curs_sp_funcs.3x create mode 100644 man/curs_variables.3x create mode 100644 man/form_variables.3x create mode 100644 man/tabs.1 create mode 100644 man/term_variables.3x create mode 100644 menu/llib-lmenut create mode 100644 menu/llib-lmenutw create mode 100644 misc/gen-pkgconfig.in delete mode 100755 misc/jpf-indent delete mode 100755 misc/ncu-indent create mode 100644 mk-dlls.sh.in delete mode 100644 mkdirs.sh create mode 100644 ncurses/base/lib_driver.c create mode 100644 ncurses/build.priv.h create mode 100644 ncurses/llib-lncursestw create mode 100644 ncurses/tinfo/make_hash.c create mode 100644 ncurses/tinfo/tinfo_driver.c create mode 100644 ncurses/wcwidth.h create mode 100644 ncurses/win32con/gettimeofday.c create mode 100644 ncurses/win32con/wcwidth.c create mode 100644 ncurses/win32con/win_driver.c create mode 100644 panel/llib-lpanelt create mode 100644 panel/llib-lpaneltw create mode 100644 progs/tabs.c create mode 100644 progs/transform.c delete mode 100755 tar-copy.sh diff --git a/ANNOUNCE b/ANNOUNCE index e09e73177a4..11933c5f6d5 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ - Announcing ncurses 5.7 + Announcing ncurses 5.9 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,217 +27,30 @@ Release Notes This release is designed to be upward compatible from ncurses 5.0 - through 5.6; very few applications will require recompilation, + through 5.8; very few applications will require recompilation, depending on the platform. These are the highlights from the - change-log since ncurses 5.6 release. + change-log since ncurses 5.8 release. - Interface changes: - * generate linkable stubs for some macros: - getattrs + This is a bug-fix release, correcting a small number of urgent + problems in the ncurses library from the 5.8 release. - New features and improvements: - * library - + new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are reentrant, - but most require either a window-level or screen-level mutex. - (This is API-compatible, but not ABI-compatible with the - normal library). - + add NCURSES_OPAQUE symbol to curses.h, will use to make - structs opaque in selected configurations. - + add NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS symbols to - curses.h to make it simpler to tell if the extended functions - and/or colors are declared. - + add wresize() to C++ binding - + eliminate fixed-buffer vsprintf() calls in C++ binding. - + add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - + adapt mouse-handling code from menu library in form-library - + improve tracing for form library, showing created forms, - fields, etc. - + make $NCURSES_NO_PADDING feature work for termcap interface . - + add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - + several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x - * programs: - + modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - + several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - + add adacurses-config to the Ada95 install. - + modify tic -f option to format spaces as \s to prevent them - from being lost when that is read back in unformatted - strings. - + The tack program is now distributed separately from ncurses. - * terminal database - + added entries: - o Eterm-256color, Eterm-88color and rxvt-88color - o aterm - o konsole-256color - o mrxvt - o screen.mlterm - o screen.rxvt - o teraterm4.59 is now the primary primary teraterm entry, - renamed original to teraterm2.3 - o 9term terminal - o Newbury Data entries - + updated/improved entries: - o gnome to version 2.22.3 - o h19, z100 - o konsole to version 1.6.6 - o mlterm, mlterm+pcfkeys - o xterm, and building-blocks for function-keys to [3]xterm - patch #230. - - Major bug fixes: - * add logic to tic for cancelling strings in user-defined - capabilities (this is needed for current konsole terminfo entry). - * modify mk-1st.awk so the generated makefile rules for linking or - installing shared libraries do not first remove the library, in - case it is in use, e.g., libncurses.so by /bin/sh. - * correct check for notimeout() in wgetch(). - * fix a sign-extension bug in infocmp's repair_acsc() function. - * change winnstr() to stop at the end of the line. - * make Ada95 demo_panels() example work. - * fix for adding a non-spacing character at the beginning of a line. - * fill in extended-color pair to make colors work for - wide-characters using extended-colors. - * improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - * modify win_wchnstr() to ensure that only a base cell is returned - for each multi-column character. - * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by - using unctrl() to display illegal bytes rather than trying to - append further bytes to make up a valid sequence. - * restore curs_set() state after endwin()/refresh() - * modify keyname() to use "^X" form only if meta() has been called, - or if keyname() is called without initializing curses, e.g., via - initscr() or newterm(). - * modify unctrl() to check codes in 128-255 range versus isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - * improve resizeterm() by moving ripped-off lines, and repainting - the soft-keys. - * modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - * use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., - to make those work properly with the --enable-ext-mouse - configuration - * correct some functions in Ada95 binding which were using return - value from C where none was returned. - * reviewed/fixed issues reported by Coverity and Klocwork tools. - - Portability: - * configure script: - + new options: - - --disable-big-strings - control whether static string tables are generated - as single large strings (to improve startup - performance), or as array of individual strings. - - --disable-relink - control whether shared libraries are relinked - (during install) when rpath is enabled. - - --disable-tic-depends - make explicit whether tic library depends on - ncurses/ncursesw library. - - --enable-mixed-case - override the configure script's check if the - filesystem supports mixed-case filenames. This - allows one to control how the terminal database - maps to the filesystem. For filesystems that do not - support mixed-case, the library uses generate - 2-character (hexadecimal) codes for the lower-level - of the filesystem terminfo database - - --enable-reentrant - builds a different flavor of the ncurses library - (ncursest) which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded - support). - - --enable-weak-symbols - use weak-symbols for linking to the POSIX thread - library, and use the same soname for the ncurses - shared library as the normal library (caveat: the - ABI is for the threaded library, which makes global - data accessed via functions). - - --with-pthread - build with the POSIX thread library (tested with - AIX, Linux, FreeBSD, OpenBSD, HPUX, IRIX64, - Solaris, Tru64). - - --with-ticlib - build/install the tic-support functions in a - separate library - - + improved options: - - --enable-ext-colors - requires the wide-character configuration. - - --with-chtype - ignore option value "unsigned" is always added to - the type in curses.h; do the same for - --with-mmask-t. - - --with-dmalloc - build-fix for redefinition of strndup. - - --with-hashed-db - accepts a parameter which is the install-prefix of - a given Berkeley Database. - - --with-hashed-db - the $LIBS environment variable overrides the search - for the db library. - - --without-hashed-db - assumed when "--disable-database" is used. - - * other configure/build issues: - + build-fixes for LynxOS - + modify shared-library rules to allow FreeBSD 3.x to use - rpath. - + build-fix for FreeBSD "contemporary" TTY interface. - + build-fixes for AIX with libtool. - + build-fixes for Darwin and libtool. - + modify BeOS-specific ifdef's to build on Haiku. - + corrected gcc options for building shared libraries on - Solaris and IRIX64. - + change shared-library configuration for OpenBSD, make rpath - work. - + build-fixes for using libutf8, e.g., on OpenBSD 3.7 - + add "-e" option in ncurses/Makefile.in when generating - source-files to force earlier exit if the build environment - fails unexpectedly. - + add support for shared libraries for QNX. - + change delimiter in MKlib_gen.sh from '%' to '@', to avoid - substitution by IBM xlc to '#' as part of its extensions to - digraphs. - * library: - + rewrite wrapper for wcrtomb(), making it work on Solaris. - This is used in the form library to determine the length of - the buffer needed by field_buffer. - + add/use configure script macro CF_SIG_ATOMIC_T, use the - corresponding type for data manipulated by signal handlers. - + set locale in misc/ncurses-config.in since it uses a range - + disable GPM mouse support when $TERM does not happen to - contain "linux", since Gpm_Open() no longer limits its - assertion to terminals that it might handle, e.g., within - "screen" in xterm. - + reset mouse file-descriptor when unloading GPM library. - * test programs: - + update test programs to build/work with various UNIX curses - for comparisons. + It also improves the Ada95 binding: + * fixes a longstanding portability problem with its use of the + [3]set_field_type function. Because that function uses + variable-length argument lists, its interface with gnat does not + work with certain platforms. + * improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. + Those were a proof of concept. For the 5.9 release, those scripts + are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + [4]here. + * additional improvements were made for portability of the ncurses + examples, adding rpm- and dpkg-scripts for test-builds. See + [5]this page for snapshots and other information. Features of Ncurses @@ -274,15 +87,15 @@ * Support for mouse event reporting with X Window xterm and FreeBSD and OS/2 console windows. * Extended mouse support via Alessandro Rubini's gpm package. - * The function wresize() allows you to resize windows, preserving + * The function wresize allows you to resize windows, preserving their data. - * The function use_default_colors() allows you to use the terminal's + * The function use_default_colors allows you to use the terminal's default colors for the default color pair, achieving the effect of transparent colors. - * The functions keyok() and define_key() allow you to better control - the use of function keys, e.g., disabling the ncurses KEY_MOUSE, - or by defining more than one control sequence to map to a given - key code. + * The functions keyok and define_key allow you to better control the + use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code. * Support for 256-color terminals, such as modern xterm, when configured using the --enable-ext-colors option. * Support for 16-color terminals, such as aixterm and modern xterm. @@ -293,7 +106,7 @@ incorporates a novel, simple, and cheap algorithm that enables it to make optimal use of hardware scrolling, line-insertion, and line-deletion for screen-line movements. This algorithm is more - powerful than the 4.4BSD curses quickch() routine. + powerful than the 4.4BSD curses quickch routine. * Real support for terminals with the magic-cookie glitch. The screen-update code will refrain from drawing a highlight if the magic- cookie unattributed spaces required just before the @@ -356,55 +169,55 @@ cdk Curses Development Kit - [4]http://invisible-island.net/cdk/ - [5]http://www.vexus.ca/products/CDK/ + [6]http://invisible-island.net/cdk/ + [7]http://www.vexus.ca/products/CDK/ ded directory-editor - [6]http://invisible-island.net/ded/ + [8]http://invisible-island.net/ded/ dialog the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [7]http://invisible-island.net/dialog/ + [9]http://invisible-island.net/dialog/ lynx the character-screen WWW browser - [8]http://lynx.isc.org/release/ + [10]http://lynx.isc.org/release/ Midnight Commander file manager - [9]http://www.ibiblio.org/mc/ + [11]http://www.midnight-commander.org/ mutt mail utility - [10]http://www.mutt.org/ + [12]http://www.mutt.org/ ncftp file-transfer utility - [11]http://www.ncftp.com/ + [13]http://www.ncftp.com/ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [12]http://www.bostic.com/vi/ + [14]https://sites.google.com/a/bostic.com/keithbostic/nvi pinfo Lynx-like info browser. - [13]https://alioth.debian.org/projects/pinfo/ + [15]https://alioth.debian.org/projects/pinfo/ tin - newsreader, supporting color, MIME [14]http://www.tin.org/ + newsreader, supporting color, MIME [16]http://www.tin.org/ as well as some that use ncurses for the terminfo support alone: minicom terminal emulator - [15]http://alioth.debian.org/projects/minicom/ + [17]http://alioth.debian.org/projects/minicom/ vile vi-like-emacs - [16]http://invisible-island.net/vile/ + [18]http://invisible-island.net/vile/ The ncurses distribution includes a selection of test programs (including a few games). @@ -412,11 +225,11 @@ Who's Who and What's What Zeyd Ben-Halim started it from a previous package pcurses, written by - Pavel Curtis. Eric S. Raymond continued development. Jürgen Pfeifer + Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer wrote most of the form and menu libraries. Ongoing work is being done - by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the + by [19]Thomas Dickey. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. - Contact the current maintainers at [18]bug-ncurses@gnu.org. + Contact the current maintainers at [20]bug-ncurses@gnu.org. To join the ncurses mailing list, please write email to bug-ncurses-request@gnu.org containing the line: @@ -426,7 +239,7 @@ Who's Who and What's What and testing of this package. Beta versions of ncurses and patches to the current release are made - available at [19]ftp://invisible-island.net/ncurses/ . + available at [21]ftp://invisible-island.net/ncurses/ . Future Plans @@ -440,34 +253,36 @@ Future Plans Other Related Resources The distribution provides a newer version of the terminfo-format - terminal description file once maintained by [20]Eric Raymond . Unlike + terminal description file once maintained by [22]Eric Raymond . Unlike the older version, the termcap and terminfo data are provided in the same file, and provides several user-definable extensions beyond the X/Open specification. You can find lots of information on terminal-related topics not - covered in the terminfo file at [21]Richard Shuford's archive . + covered in the terminfo file at [23]Richard Shuford's archive . References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/xterm/xterm.log.html#xterm_230 - 4. http://invisible-island.net/cdk/ - 5. http://www.vexus.ca/products/CDK/ - 6. http://invisible-island.net/ded/ - 7. http://invisible-island.net/dialog/ - 8. http://lynx.isc.org/release/ - 9. http://www.ibiblio.org/mc/ - 10. http://www.mutt.org/ - 11. http://www.ncftp.com/ - 12. http://www.bostic.com/vi/ - 13. https://alioth.debian.org/projects/pinfo/ - 14. http://www.tin.org/ - 15. http://alioth.debian.org/projects/minicom/ - 16. http://invisible-island.net/vile/ - 17. mailto:dickey@invisible-island.net - 18. mailto:bug-ncurses@gnu.org - 19. ftp://invisible-island.net/ncurses/ - 20. http://www.catb.org/~esr/terminfo/ - 21. http://www.cs.utk.edu/~shuford/terminal_index.html + 3. http://invisible-island.net/ncurses/man/form_fieldtype.3x + 4. http://invisible-island.net/ncurses/ncurses-Ada95.html + 5. http://invisible-island.net/ncurses/ncurses-examples.html + 6. http://invisible-island.net/cdk/ + 7. http://www.vexus.ca/products/CDK/ + 8. http://invisible-island.net/ded/ + 9. http://invisible-island.net/dialog/ + 10. http://lynx.isc.org/release/ + 11. http://www.midnight-commander.org/ + 12. http://www.mutt.org/ + 13. http://www.ncftp.com/ + 14. https://sites.google.com/a/bostic.com/keithbostic/nvi + 15. https://alioth.debian.org/projects/pinfo/ + 16. http://www.tin.org/ + 17. http://alioth.debian.org/projects/minicom/ + 18. http://invisible-island.net/vile/ + 19. mailto:dickey@invisible-island.net + 20. mailto:bug-ncurses@gnu.org + 21. ftp://invisible-island.net/ncurses/ + 22. http://www.catb.org/~esr/terminfo/ + 23. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal diff --git a/INSTALL b/INSTALL index ab7dcd82995..eb26ab103ef 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ +-- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -39,9 +39,8 @@ d.d is the current version number. There should be several subdirectories, including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs', and `test'. See the README file for a roadmap to the package. -If you are a Linux or FreeBSD or NetBSD distribution integrator or packager, -please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR -below. +If you are a distribution integrator or packager, please read and act on the +section titled IF YOU ARE A SYSTEM INTEGRATOR below. If you are converting from BSD curses and do not have root access, be sure to read the BSD CONVERSION NOTES section below. @@ -58,10 +57,6 @@ CROSS-COMPILER. If you want to build the Ada95 binding, go to the Ada95 directory and follow the instructions there. The Ada95 binding is not covered below. -If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based -i386 Unixes, go read the Portability section in the TO-DO file before you -do anything else. - REQUIREMENTS: ------------ @@ -86,14 +81,14 @@ INSTALLATION PROCEDURE: The --prefix option to configure changes the root directory for installing ncurses. The default is normally in subdirectories of /usr/local, except - for systems where ncurses is normally installed as a system library, e.g., - Linux, the various BSD systems and Cygwin. Use --prefix=/usr to replace - your default curses distribution. + for systems where ncurses is normally installed as a system library (see + "IF YOU ARE A SYSTEM INTEGRATOR"). Use --prefix=/usr to replace your + default curses distribution. The package gets installed beneath the --prefix directory as follows: In $(prefix)/bin: tic, infocmp, captoinfo, tset, - reset, clear, tput, toe + reset, clear, tput, toe, tabs In $(prefix)/lib: libncurses*.* libcurses.a In $(prefix)/share/terminfo: compiled terminal descriptions In $(prefix)/include: C header files @@ -105,12 +100,12 @@ INSTALLATION PROCEDURE: Do not use commands such as - make install prefix=XXX + make install prefix=XXX to change the prefix after configuration, since the prefix value is used for some absolute pathnames such as TERMINFO. Instead do this - make install DESTDIR=XXX + make install DESTDIR=XXX See also the discussion of --with-install-prefix. @@ -147,7 +142,7 @@ INSTALLATION PROCEDURE: library interfaces are not binary-compatible with the non-wide-character version. Building and running the wide-character code relies on a fairly recent implementation of libiconv. We have built this configuration on - Linux using libiconv, sometimes requiring libutf8. + various systems using libiconv, sometimes requiring libutf8. If you configure using the --with-pthread option, a "t" is appended to the library names (e.g., libncursest.a, libncursestw.a). @@ -170,8 +165,8 @@ INSTALLATION PROCEDURE: ./configure --with-shared --without-normal --without-debug Rules for generating shared libraries are highly dependent upon the choice - of host system and compiler. We've been testing shared libraries on Linux - and SunOS with gcc, but more work needs to be done to make shared libraries + of host system and compiler. We've been testing shared libraries on + several systems, but more work needs to be done to make shared libraries work on other systems. If you have libtool installed, you can type @@ -338,6 +333,17 @@ SUMMARY OF CONFIGURE OPTIONS: --disable-largefile Disable compiler flags needed to use large-file interfaces. + --disable-libtool-version + when using --with-libtool, control how the major/minor version numbers + are used for constructing the library name. + + The default uses the -version-number feature of libtool, which makes + the library names compatible (though not identical) with the standard + build using --with-shared. + + Use --disable-libtool-version to use the libtool -version-info feature. + This corresponds to the setting used before patch 20100515. + --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. @@ -389,6 +395,12 @@ SUMMARY OF CONFIGURE OPTIONS: application. These are (for example $TERMINFO) those that allow the search path for the terminfo or termcap entry to be customized. + --disable-rpath-hack + Normally the configure script helps link libraries found in unusual + places by adding an rpath option to the link command. If you are + building packages, this feature may be redundant. Use this option + to suppress the feature. + --disable-scroll-hints Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. @@ -421,7 +433,7 @@ SUMMARY OF CONFIGURE OPTIONS: changes several data references to functions to work around this problem. - NOTE: With ncurses 5.1, this may not be necessary, since we are + NOTE: With ncurses 5.1, this may not be necessary, since we are told that some linkers interpret uninitialized global data as a different type of reference which behaves as described above. We have explicitly initialized all of the global data to work around the @@ -450,7 +462,7 @@ SUMMARY OF CONFIGURE OPTIONS: warning. There will still be warnings due to subtle inconsistencies in the interface, but at a lower level. - NOTE: configuring ncurses with this option may detract from the + NOTE: configuring ncurses with this option may detract from the portability of your applications by encouraging you to use const in places where the XSI curses interface would not allow them. Similar issues arise when porting to SVr4 curses, which uses const in even @@ -471,7 +483,7 @@ SUMMARY OF CONFIGURE OPTIONS: encoded. This applies only to the wide-character (--enable-widec) configuration. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have an array of cchar_t's must be recompiled. @@ -480,7 +492,7 @@ SUMMARY OF CONFIGURE OPTIONS: That allows one to use ncurses with a wheel mouse with xterm or similar X terminal emulators. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have mouse mask mmask_t's must be recompiled. @@ -500,7 +512,7 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-getcap-cache Cache translated termcaps under the directory $HOME/.terminfo - NOTE: this sounds good - it makes ncurses run faster the second time. + NOTE: this sounds good - it makes ncurses run faster the second time. But look where the data comes from - an /etc/termcap containing lots of entries that are not up to date. If you configure with this option and forget to install the terminfo database before running an ncurses @@ -513,6 +525,10 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. + --enable-interop + Compile-in experimental interop bindings. These provide generic types + for the form-library. + --enable-mixed-case Controls whether the filesystem on which the terminfo database resides supports mixed-case filenames (normal for UNIX, but not on other @@ -525,6 +541,15 @@ SUMMARY OF CONFIGURE OPTIONS: terminfo entries. This is the default, unless you have disabled the extended functions. + --enable-pc-files + If pkg-config is found (see --with-pkg-config), generate ".pc" files + for each of the libraries, and install them in pkg-config's library + directory. + + --enable-pthreads-eintr + add logic in threaded configuration to ensure that a read(2) system + call can be interrupted for SIGWINCH. + --enable-reentrant Compile experimental configuration which improves reentrant use of the library by reducing global and static variables. This option is also @@ -565,6 +590,11 @@ SUMMARY OF CONFIGURE OPTIONS: is not strictly compatible. This option allows one to implement this alteration without patching the source code. + --enable-sp-funcs + Compile-in support for extended functions which accept a SCREEN pointer, + reducing the need for juggling the global SP value with set_term() and + delscreen(). + --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -576,6 +606,11 @@ SUMMARY OF CONFIGURE OPTIONS: capabilities as user-defined strings. This option is the default, unless you have disabled the extended functions. + --enable-term-driver + Enable experimental terminal-driver. This is currently used for the + MinGW port, by providing a way to substitute the low-level terminfo + library with different terminal drivers. + --enable-termcap Compile in support for reading terminal descriptions from termcap if no match is found in the terminfo database. See also the --enable-getcap @@ -630,12 +665,23 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib + Build a shared library for Ada95 binding, if the compiler permits. + + NOTE: You must also set the --with-shared option on some platforms + for a successful build. You need not use this option when you set + --with-shared, unless you want to use the Ada shared library. + --with-bool=TYPE If --without-cxx is specified, override the type used for the "bool" declared in curses.h (normally the type is automatically chosen to correspond with that in , or defaults to platform-specific sizes). + --with-build-cpp=XXX + This option is provided by the same macro used for $BUILD_CC, etc., + but is not directly used by ncurses. + --with-build-cc=XXX If cross-compiling, specify a host C compiler, which is needed to compile a few utilities which generate source modules for ncurses. @@ -682,12 +728,17 @@ SUMMARY OF CONFIGURE OPTIONS: to use a terminfo database which is compatible with the native applications. + --with-ccharw-max=XXX + Override the size of the wide-character array in cchar_t structures. + Changing this will alter the binary interface. This defaults to 5. + --with-chtype=TYPE Override type of chtype, which stores the video attributes and (if --enable-widec is not given) a character. Prior to ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it may be unsigned. Use this option if you need to preserve compatibility with 64-bit - executables. + executables, e.g., by setting "--with-chtype=long" (the configure + script supplies "unsigned"). --with-database=XXX Specify the terminfo source file to install. Usually you will wish @@ -719,7 +770,7 @@ SUMMARY OF CONFIGURE OPTIONS: use Alessandro Rubini's GPM library to provide mouse support on the Linux console. Prior to ncurses 5.5, this introduced a dependency on the GPM library. - + Currently ncurses uses the dlsym() function to bind to the library at runtime, so it is only necessary that the library be present when ncurses is built, to obtain the filename (or soname) used in the @@ -736,7 +787,7 @@ SUMMARY OF CONFIGURE OPTIONS: Use a hashed database for storing terminfo data rather than storing each compiled entry in a separate binary file within a directory tree. - + In particular, this uses the Berkeley database 1.8.5 interface, as provided by that and its successors db 2, 3, and 4. The actual interface is slightly different in the successor versions of the @@ -770,7 +821,7 @@ SUMMARY OF CONFIGURE OPTIONS: make install DESTDIR=XXX since the makefiles pass that variable to subordinate makes. - NOTE: a few systems build shared libraries with fixed pathnames; this + NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. --with-libtool[=XXX] @@ -807,9 +858,9 @@ SUMMARY OF CONFIGURE OPTIONS: --with-manpage-renames=XXX Tell the configure script that you wish to rename the manpages while - installing. Currently the only distribution which does this is - the Linux Debian. The option value specifies the name of a file - that lists the renamed files, e.g., $srcdir/man/man_db.renames + installing. Currently the only distribution which does this is Debian. + The option value specifies the name of a file that lists the renamed + files, e.g., $srcdir/man/man_db.renames --with-manpage-symlinks Tell the configure script that you wish to make symbolic links in the @@ -850,6 +901,9 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. + --with-pkg-config=[DIR] + Check for pkg-config, optionally specifying its path. + --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -873,7 +927,7 @@ SUMMARY OF CONFIGURE OPTIONS: which you are building, typically using a ".so" suffix, along with symbolic links that refer to the release version. - NOTE: Unless you override the configure script by setting the $CFLAGS + NOTE: Unless you override the configure script by setting the $CFLAGS environment variable, these will not be built with the -g debugging option. @@ -885,7 +939,11 @@ SUMMARY OF CONFIGURE OPTIONS: loads the system's copy of the ncurses shared libraries. In that case, using the misc/shlib script may be helpful, since it sets $LD_LIBRARY_PATH to point to the build tree, e.g., - ./misc/shlib make install + ./misc/shlib make install + + NOTE: If you use the --with-ada-sharedlib option, you should also + set this option, to ensure that C-language modules needed for the + Ada binding use appropriate compiler options. --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. @@ -946,6 +1004,17 @@ SUMMARY OF CONFIGURE OPTIONS: For testing, compile with debug option. This also sets the --disable-leaks option. + --with-wrap-prefix=XXX + When using the --enable-reentrant option, ncurses redefines variables + that would be global in curses, e.g., LINES, as a macro that calls a + "wrapping" function which fetches the data from the current SCREEN + structure. Normally that function is named by prepending "_nc_" to the + variable's name. The function is technically private (since portable + applications would not refer directly to it). But according to one + line of reasoning, it is not the same type of "private" as functions + which applications should not call even via a macro. This configure + option lets you choose the prefix for these wrapped variables. + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -975,11 +1044,18 @@ SUMMARY OF CONFIGURE OPTIONS: --without-dlsym Do not use dlsym() to load GPM dynamically. + --without-manpages + Tell the configure script to suppress the install of ncurses' manpages. + --without-progs Tell the configure script to suppress the build of ncurses' application programs (e.g., tic). The test applications will still be built if you type "make", though not if you simply do "make install". + --without-tests + Tell the configure script to suppress the build of ncurses' test + programs. + --without-xterm-new Tell the configure script to use "xterm-old" for the entry used in the terminfo database. This will work with variations such as @@ -1001,6 +1077,60 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: you may encounter when building a system with different versions of ncurses: + 5.8 (Feb 26, 2011) + Interface changes: + + + add an alternate library configuration, i.e., "terminal driver" to + support port to Windows, built with MinGW. There are two drivers + (terminfo and Windows console). The terminfo driver works on other + platforms. + + + add a new set of functions which accept a SCREEN* parameter, in + contrast with the original set which use the global value "sp". + By default, these names end with "_sp", and are otherwise + functionally identical with the originals. + + In addition to the "_sp" functions, there are a few new functions + associated with this feature: ceiling_panel, ground_panel, + new_prescr. + + If the library is not built with the sp-funcs extension, there + are no related interface changes. + + + add tiparm function based on review of X/Open Curses Issue 7. + + + change internal _nc_has_mouse function to public has_mouse function + + Added extensions: + + + add a few more functions to support the NCURSES_OPAQUE feature: + get_escdelay, is_pad, is_subwin + + Added internal functions (other than "_sp" variants): + _nc_curscr_of + _nc_format_slks + _nc_get_alias_table + _nc_get_hash_info + _nc_insert_wch + _nc_newscr_of + _nc_outc_wrapper + _nc_retrace_char + _nc_retrace_int_attr_t + _nc_retrace_mmask_t + _nc_setup_tinfo + _nc_stdscr_of + _nc_tinfo_cmdch + + Removed internal functions: + _nc_makenew (some configurations replace by _nc_makenew_sp) + + Modified internal functions: + _nc_UpdateAttrs + _nc_get_hash_table + _nc_has_mouse + _nc_insert_ch + _nc_wgetch + 5.7 (November 2, 2008) Interface changes: @@ -1011,7 +1141,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: of the ncurses library used for the tic program as well as some others such as tack. There is no API change, but makefiles would be changed to use the tic-library built separately. - + tack, distributed separately from ncurses, uses some of the internal _nc_XXX functions, which are declared in the tic.h header file. @@ -1158,7 +1288,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: still used in this release to allow compiling with not-so-old compilers. - + form and menu libraries now work with wide-character data. + + form and menu libraries now work with wide-character data. Applications which bypassed the form library and manipulated the FIELD.buf data directly will not work properly with libformw, since that no longer points to an array of char. The set_field_buffer() @@ -1438,8 +1568,8 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: 4.0 (December 24, 1996) - We bumped to version 4.0 because the newly released dynamic loader - (ld.so.1.8.5) on Linux did not load shared libraries whose ABI and REL + We bumped to version 4.0 because the newly released Linux dynamic + loader (ld.so.1.8.5) did not load shared libraries whose ABI and REL versions were inconsistent. At that point, ncurses ABI was 3.4 and the REL was 1.9.9g, so we made them consistent. @@ -1496,10 +1626,10 @@ IF YOU ARE A SYSTEM INTEGRATOR: Configuration and Installation: - On platforms where ncurses is assumed to be installed in /usr/lib, + On platforms where ncurses is assumed to be installed in /usr/lib, the configure script uses "/usr" as a default: - Linux, FreeBSD, NetBSD, OpenBSD, Cygwin + GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin For other platforms, the default is "/usr/local". See the discussion of the "--disable-overwrite" option. @@ -1562,7 +1692,7 @@ IF YOU ARE A SYSTEM INTEGRATOR: bsdos -- BSD/OS If you are responsible for integrating ncurses for one of these - distribution, please either use the recommended name or get back + distributions, please either use the recommended name or get back to us explaining why you don't want to, so we can work out nomenclature that will make users' lives easier rather than harder. @@ -1584,7 +1714,8 @@ CONFIGURING FALLBACK ENTRIES: tree is accessible (that is, in single-user mode or at OS installation time) the ncurses library can be compiled to include an array of pre-fetched fallback entries. This must be done on a machine which - has ncurses' infocmp and terminfo database installed. + has ncurses' infocmp and terminfo database installed (as well as + ncurses' tic and infocmp programs). These entries are checked by setupterm() only when the conventional fetches from the terminfo tree and the termcap fallback (if configured) @@ -1689,8 +1820,8 @@ USING NCURSES WITH AFS: with this by making tic use symbolic links. USING NCURSES WITH GPM: - Ncurses 4.1 and up can be configured to use GPM (General Purpose - Mouse) which is used on Linux console. Be aware that GPM is commonly + Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) + which is used with Linux console. Be aware that GPM is commonly installed as a shared library which contains a wrapper for the curses wgetch() function (libcurses.o). Some integrators have simplified linking applications by combining all or part of libcurses.so into the @@ -1735,6 +1866,10 @@ BUILDING NCURSES WITH A CROSS-COMPILER option), ncurses uses the development platform's tic to do the "make install.data" portion. + The system's tic program is used to install the terminal database, + even for cross-compiles. For best results, the tic program should + be from the most current version of ncurses. + BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to diff --git a/MANIFEST b/MANIFEST index db3871f2e11..421cc678cd6 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,6 +3,10 @@ ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO +./Ada95/aclocal.m4 +./Ada95/configure +./Ada95/configure.in +./Ada95/doc/Makefile.in ./Ada95/gen/Makefile.in ./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c @@ -23,6 +27,21 @@ ./Ada95/gen/terminal_interface-curses-trace.ads.m4 ./Ada95/gen/terminal_interface-curses.adb.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 +./Ada95/include/MKncurses_def.sh +./Ada95/include/Makefile.in +./Ada95/include/ncurses_cfg.hin +./Ada95/include/ncurses_defs +./Ada95/make-tar.sh +./Ada95/mk-1st.awk +./Ada95/package/AdaCurses-doc.spec +./Ada95/package/AdaCurses.spec +./Ada95/package/debian/compat +./Ada95/package/debian/control +./Ada95/package/debian/copyright +./Ada95/package/debian/docs +./Ada95/package/debian/rules +./Ada95/package/debian/source/format +./Ada95/package/debian/watch ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -109,6 +128,11 @@ ./Ada95/samples/tour.adb ./Ada95/samples/tour.ads ./Ada95/src/Makefile.in +./Ada95/src/c_varargs_to_ada.c +./Ada95/src/c_varargs_to_ada.h +./Ada95/src/library.gpr +./Ada95/src/modules +./Ada95/src/ncurses_compat.c ./Ada95/src/terminal_interface-curses-aux.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -172,6 +196,7 @@ ./Makefile.os2 ./NEWS ./README +./README.MinGW ./README.emx ./TO-DO ./aclocal.m4 @@ -311,6 +336,7 @@ ./doc/html/announce.html ./doc/html/hackguide.html ./doc/html/index.html +./doc/html/man/adacurses-config.1.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html ./doc/html/man/curs_add_wch.3x.html @@ -350,6 +376,7 @@ ./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html ./doc/html/man/curs_legacy.3x.html +./doc/html/man/curs_memleaks.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html ./doc/html/man/curs_opaque.3x.html @@ -363,6 +390,7 @@ ./doc/html/man/curs_scr_dump.3x.html ./doc/html/man/curs_scroll.3x.html ./doc/html/man/curs_slk.3x.html +./doc/html/man/curs_sp_funcs.3x.html ./doc/html/man/curs_termattrs.3x.html ./doc/html/man/curs_termcap.3x.html ./doc/html/man/curs_terminfo.3x.html @@ -370,6 +398,7 @@ ./doc/html/man/curs_touch.3x.html ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html +./doc/html/man/curs_variables.3x.html ./doc/html/man/curs_window.3x.html ./doc/html/man/default_colors.3x.html ./doc/html/man/define_key.3x.html @@ -395,6 +424,7 @@ ./doc/html/man/form_post.3x.html ./doc/html/man/form_requestname.3x.html ./doc/html/man/form_userptr.3x.html +./doc/html/man/form_variables.3x.html ./doc/html/man/form_win.3x.html ./doc/html/man/index.html ./doc/html/man/infocmp.1m.html @@ -427,10 +457,13 @@ ./doc/html/man/mitem_value.3x.html ./doc/html/man/mitem_visible.3x.html ./doc/html/man/ncurses.3x.html +./doc/html/man/ncurses5-config.1.html ./doc/html/man/panel.3x.html ./doc/html/man/resizeterm.3x.html +./doc/html/man/tabs.1.html ./doc/html/man/term.5.html ./doc/html/man/term.7.html +./doc/html/man/term_variables.3x.html ./doc/html/man/terminfo.5.html ./doc/html/man/tic.1m.html ./doc/html/man/toe.1m.html @@ -479,12 +512,15 @@ ./form/fty_alnum.c ./form/fty_alpha.c ./form/fty_enum.c +./form/fty_generic.c ./form/fty_int.c ./form/fty_ipv4.c ./form/fty_num.c ./form/fty_regex.c ./form/headers ./form/llib-lform +./form/llib-lformt +./form/llib-lformtw ./form/llib-lformw ./form/modules ./include/Caps @@ -507,16 +543,20 @@ ./include/hashed_db.h ./include/headers ./include/nc_alloc.h +./include/nc_mingw.h ./include/nc_panel.h ./include/nc_tparm.h ./include/ncurses_cfg.hin ./include/ncurses_defs -./include/ncurses_dll.h +./include/ncurses_dll.h.in +./include/ncurses_mingw.h ./include/term_entry.h ./include/termcap.h.in ./include/tic.h ./include/unctrl.h.in ./install-sh +./man/MKada_config.in +./man/MKncu_config.in ./man/MKterminfo.sh ./man/Makefile.in ./man/captoinfo.1m @@ -572,6 +612,7 @@ ./man/curs_scr_dump.3x ./man/curs_scroll.3x ./man/curs_slk.3x +./man/curs_sp_funcs.3x ./man/curs_termattrs.3x ./man/curs_termcap.3x ./man/curs_terminfo.3x @@ -579,6 +620,7 @@ ./man/curs_touch.3x ./man/curs_trace.3x ./man/curs_util.3x +./man/curs_variables.3x ./man/curs_window.3x ./man/default_colors.3x ./man/define_key.3x @@ -604,6 +646,7 @@ ./man/form_post.3x ./man/form_requestname.3x ./man/form_userptr.3x +./man/form_variables.3x ./man/form_win.3x ./man/infocmp.1m ./man/infotocap.1m @@ -640,8 +683,10 @@ ./man/ncurses.3x ./man/panel.3x ./man/resizeterm.3x +./man/tabs.1 ./man/term.5 ./man/term.7 +./man/term_variables.3x ./man/terminfo.head ./man/terminfo.tail ./man/tic.1m @@ -654,6 +699,8 @@ ./menu/eti.h ./menu/headers ./menu/llib-lmenu +./menu/llib-lmenut +./menu/llib-lmenutw ./menu/llib-lmenuw ./menu/m_attribs.c ./menu/m_cursor.c @@ -694,13 +741,12 @@ ./misc/emx.src ./misc/form.def ./misc/form.ref +./misc/gen-pkgconfig.in ./misc/gen_edit.sh -./misc/jpf-indent ./misc/makedef.cmd ./misc/makellib ./misc/menu.def ./misc/menu.ref -./misc/ncu-indent ./misc/ncurses-config.in ./misc/ncurses.def ./misc/ncurses.ref @@ -718,8 +764,8 @@ ./mk-0th.awk ./mk-1st.awk ./mk-2nd.awk +./mk-dlls.sh.in ./mk-hdr.awk -./mkdirs.sh ./ncurses/Makefile.in ./ncurses/README ./ncurses/README.IZ @@ -748,6 +794,7 @@ ./ncurses/base/lib_delch.c ./ncurses/base/lib_delwin.c ./ncurses/base/lib_dft_fgbg.c +./ncurses/base/lib_driver.c ./ncurses/base/lib_echo.c ./ncurses/base/lib_endwin.c ./ncurses/base/lib_erase.c @@ -813,10 +860,12 @@ ./ncurses/base/version.c ./ncurses/base/vsscanf.c ./ncurses/base/wresize.c +./ncurses/build.priv.h ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses ./ncurses/llib-lncursest +./ncurses/llib-lncursestw ./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk @@ -863,6 +912,7 @@ ./ncurses/tinfo/lib_tparm.c ./ncurses/tinfo/lib_tputs.c ./ncurses/tinfo/lib_ttyflags.c +./ncurses/tinfo/make_hash.c ./ncurses/tinfo/make_keys.c ./ncurses/tinfo/name_match.c ./ncurses/tinfo/parse_entry.c @@ -870,6 +920,7 @@ ./ncurses/tinfo/read_termcap.c ./ncurses/tinfo/setbuf.c ./ncurses/tinfo/strings.c +./ncurses/tinfo/tinfo_driver.c ./ncurses/tinfo/trim_sgr0.c ./ncurses/tinfo/use_screen.c ./ncurses/tinfo/write_entry.c @@ -895,6 +946,7 @@ ./ncurses/tty/tty_display.h ./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c +./ncurses/wcwidth.h ./ncurses/widechar/charable.c ./ncurses/widechar/lib_add_wch.c ./ncurses/widechar/lib_box_set.c @@ -915,9 +967,14 @@ ./ncurses/widechar/lib_vline_set.c ./ncurses/widechar/lib_wacs.c ./ncurses/widechar/lib_wunctrl.c +./ncurses/win32con/gettimeofday.c +./ncurses/win32con/wcwidth.c +./ncurses/win32con/win_driver.c ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel +./panel/llib-lpanelt +./panel/llib-lpaneltw ./panel/llib-lpanelw ./panel/modules ./panel/p_above.c @@ -947,11 +1004,12 @@ ./progs/infocmp.c ./progs/modules ./progs/progs.priv.h +./progs/tabs.c ./progs/tic.c ./progs/toe.c ./progs/tput.c +./progs/transform.c ./progs/tset.c -./tar-copy.sh ./test/Makefile.in ./test/README ./test/aclocal.m4 @@ -963,6 +1021,7 @@ ./test/cardfile.c ./test/cardfile.dat ./test/chgat.c +./test/clip_printw.c ./test/color_set.c ./test/configure ./test/configure.in @@ -973,6 +1032,7 @@ ./test/demo_menus.c ./test/demo_panels.c ./test/demo_termcap.c +./test/demo_terminfo.c ./test/ditto.c ./test/dots.c ./test/dots_mvcur.c @@ -990,19 +1050,30 @@ ./test/inch_wide.c ./test/inchs.c ./test/ins_wide.c +./test/insdelln.c ./test/inserts.c ./test/key_names.c ./test/keynames.c ./test/knight.c +./test/linedata.h ./test/linux-color.dat ./test/listused.sh ./test/lrtest.c +./test/make-tar.sh ./test/mk-test.awk ./test/modules ./test/movewindow.c ./test/ncurses.c ./test/ncurses_tst.hin ./test/newdemo.c +./test/package/debian/compat +./test/package/debian/control +./test/package/debian/copyright +./test/package/debian/docs +./test/package/debian/rules +./test/package/debian/source/format +./test/package/debian/watch +./test/package/ncurses-examples.spec ./test/programs ./test/railroad.c ./test/rain.c @@ -1011,6 +1082,10 @@ ./test/savescreen.sh ./test/tclock.c ./test/test.priv.h +./test/test_add_wchstr.c +./test/test_addchstr.c +./test/test_addstr.c +./test/test_addwstr.c ./test/test_arrays.c ./test/test_get_wstr.c ./test/test_getstr.c @@ -1026,4 +1101,5 @@ ./test/worm.c ./test/xmas.c ./test/xterm-16color.dat +./test/xterm-256color.dat ./test/xterm-88color.dat diff --git a/Makefile.in b/Makefile.in index cb8cd422cc4..d891e002fd8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.24 2005/01/29 19:30:06 tom Exp $ +# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,6 +32,7 @@ # Master Makefile for ncurses library. SHELL = /bin/sh +VPATH = @srcdir@ DESTDIR=@DESTDIR@ CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" @@ -42,6 +43,9 @@ NCURSES_MAJOR = @NCURSES_MAJOR@ NCURSES_MINOR = @NCURSES_MINOR@ NCURSES_PATCH = @NCURSES_PATCH@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ + prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -83,6 +87,13 @@ preinstall : fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ echo '** Will overwrite non-ncurses curses.h' +dlls: libs + $(SHELL) $(srcdir)/mk-dlls.sh + +distclean \ +realclean :: + -rm -f mk-dlls.sh mingw_arch + # Put the common rules here so that we can easily construct the list of # directories to visit. all \ diff --git a/NEWS b/NEWS index a64450b3022..e8f9cefbabd 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ +-- $Id: NEWS,v 1.1682 2011/04/04 00:02:42 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,1076 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20110404 5.9 release for upload to ftp.gnu.org + +20110402 + + various build-fixes for the rpm/dpkg scripts. + + add "--enable-rpath-link" option to Ada95/configure, to allow + packages to suppress the rpath feature which is normally used for + the in-tree build of sample programs. + + corrected definition of libdir variable in Ada95/src/Makefile.in, + needed for rpm script. + + add "--with-shared" option to Ada95/configure script, to allow + making the C-language parts of the binding use appropriate compiler + options if building a shared library with gnat. + +20110329 + > portability fixes for Ada95 binding: + + add configure check to ensure that SIGINT works with gnat. This is + needed for the "rain" sample program. If SIGINT does not work, omit + that sample program. + + correct typo in check of $PKG_CONFIG variable in Ada95/configure + + add ncurses_compat.c, to supply functions used in the Ada95 binding + which were added in 5.7 and later. + + modify sed expression in CF_NCURSES_ADDON to eliminate a dependency + upon GNU sed. + +20110326 + + add special check in Ada95/configure script for ncurses6 reentrant + code. + + regen Ada html documentation. + + build-fix for Ada shared libraries versus the varargs workaround. + + add rpm and dpkg scripts for Ada95 and test directories, for test + builds. + + update test/configure macros CF_CURSES_LIBS, CF_XOPEN_SOURCE and + CF_X_ATHENA_LIBS. + + add configure check to determine if gnat's project feature supports + libraries, i.e., collections of .ali files. + + make all dereferences in Ada95 samples explicit. + + fix typo in comment in lib_add_wch.c (patch by Petr Pavlu). + + add configure check for, ifdef's for math.h which is in a separate + package on Solaris and potentially not installed (report by Petr + Pavlu). + > fixes for Ada95 binding (Nicolas Boulenguez): + + improve type-checking in Ada95 by eliminating a few warning-suppress + pragmas. + + suppress unreferenced warnings. + + make all dereferences in binding explicit. + +20110319 + + regen Ada html documentation. + + change order of -I options from ncurses*-config script when the + --disable-overwrite option was used, so that the subdirectory include + is listed first. + + modify the make-tar.sh scripts to add a MANIFEST and NEWS file. + + modify configure script to provide value for HTML_DIR in + Ada95/gen/Makefile.in, which depends on whether the Ada95 binding is + distributed separately (report by Nicolas Boulenguez). + + modify configure script to add -g and/or -O3 to ADAFLAGS if the + CFLAGS for the build has these options. + + amend change from 20070324, to not add 1 to the result of getmaxx + and getmaxy in the Ada binding (report by Nicolas Boulenguez for + thread in comp.lang.ada). + + build-fix Ada95/samples for gnat 4.5 + + spelling fixes for Ada95/samples/explain.txt + > fixes for Ada95 binding (Nicolas Boulenguez): + + add item in Trace_Attribute_Set corresponding to TRACE_ATTRS. + + add workaround for binding to set_field_type(), which uses varargs. + The original binding from 990220 relied on the prevalent + implementation of varargs which did not support or need va_copy(). + + add dependency on gen/Makefile.in needed for *-panels.ads + + add Library_Options to library.gpr + + add Languages to library.gpr, for gprbuild + +20110307 + + revert changes to limit-checks from 20110122 (Debian #616711). + > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): + + corrected a minor sign error in a field of Low_Level_Field_Type, to + conform to form.h. + + replaced C_Int by Curses_Bool as return type for some callbacks, see + fieldtype(3FORM). + + modify samples/sample-explain.adb to provide explicit message when + explain.txt is not found. + +20110305 + + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes + for compiler warnings (report by Nicolas Boulenguez). + + modify Ada95/gen/gen.c to declare unused bits in generated layouts, + needed to compile when chtype is 64-bits using gnat 4.4.5 + +20110226 5.8 release for upload to ftp.gnu.org + +20110226 + + update release notes, for 5.8. + + regenerated html manpages. + + change open() in _nc_read_file_entry() to fopen() for consistency + with write_file(). + + modify misc/run_tic.in to create parent directory, in case this is + a new install of hashed database. + + fix typo in Ada95/mk-1st.awk which causes error with original awk. + +20110220 + + configure script rpath fixes from xterm #269. + + workaround for cygwin's non-functional features.h, to force ncurses' + configure script to define _XOPEN_SOURCE_EXTENDED when building + wide-character configuration. + + build-fix in run_tic.sh for OS/2 EMX install + + add cons25-debian entry (patch by Brian M Carlson, Debian #607662). + +20110212 + + regenerated html manpages. + + use _tracef() in show_where() function of tic, to work correctly with + special case of trace configuration. + +20110205 + + add xterm-utf8 entry as a demo of the U8 feature -TD + + add U8 feature to denote entries for terminal emulators which do not + support VT100 SI/SO when processing UTF-8 encoding -TD + + improve the NCURSES_NO_UTF8_ACS feature by adding a check for an + extended terminfo capability U8 (prompted by mailing list + discussion). + +20110122 + + start documenting interface changes for upcoming 5.8 release. + + correct limit-checks in derwin(). + + correct limit-checks in newwin(), to ensure that windows have nonzero + size (report by Garrett Cooper). + + fix a missing "weak" declaration for pthread_kill (patch by Nicholas + Alcock). + + improve documentation of KEY_ENTER in curs_getch.3x manpage (prompted + by discussion with Kevin Martin). + +20110115 + + modify Ada95/configure script to make the --with-curses-dir option + work without requiring the --with-ncurses option. + + modify test programs to allow them to be built with NetBSD curses. + + document thick- and double-line symbols in curs_add_wch.3x manpage. + + document WACS_xxx constants in curs_add_wch.3x manpage. + + fix some warnings for clang 2.6 "--analyze" + + modify Ada95 makefiles to make html-documentation with the project + file configuration if that is used. + + update config.guess, config.sub + +20110108 + + regenerated html manpages. + + minor fixes to enable lint when trace is not enabled, e.g., with + clang --analyze. + + fix typo in man/default_colors.3x (patch by Tim van der Molen). + + update ncurses/llib-lncurses* + +20110101 + + fix remaining strict compiler warnings in ncurses library ABI=5, + except those dealing with function pointers, etc. + +20101225 + + modify nc_tparm.h, adding guards against repeated inclusion, and + allowing TPARM_ARG to be overridden. + + fix some strict compiler warnings in ncurses library. + +20101211 + + suppress ncv in screen entry, allowing underline (patch by Alejandro + R Sedeno). + + also suppress ncv in konsole-base -TD + + fixes in wins_nwstr() and related functions to ensure that special + characters, i.e., control characters are handled properly with the + wide-character configuration. + + correct a comparison in wins_nwstr() (Redhat #661506). + + correct help-messages in some of the test-programs, which still + referred to quitting with 'q'. + +20101204 + + add special case to _nc_infotocap() to recognize the setaf/setab + strings from xterm+256color and xterm+88color, and provide a reduced + version which works with termcap. + + remove obsolete emacs "Local Variables" section from documentation + (request by Sven Joachim). + + update doc/html/index.html to include NCURSES-Programming-HOWTO.html + (report by Sven Joachim). + +20101128 + + modify test/configure and test/Makefile.in to handle this special + case of building within a build-tree (Debian #34182): + mkdir -p build && cd build && ../test/configure && make + +20101127 + + miscellaneous build-fixes for Ada95 and test-directories when built + out-of-tree. + + use VPATH in makefiles to simplify out-of-tree builds (Debian #34182). + + fix typo in rmso for tek4106 entry -Goran Weinholt + +20101120 + + improve checks in test/configure for X libraries, from xterm #267 + changes. + + modify test/configure to allow it to use the build-tree's libraries + e.g., when using that to configure the test-programs without the + rpath feature (request by Sven Joachim). + + repurpose "gnome" terminfo entries as "vte", retaining "gnome" items + for compatibility, but generally deprecating those since the VTE + library is what actually defines the behavior of "gnome", etc., + since 2003 -TD + +20101113 + + compiler warning fixes for test programs. + + various build-fixes for test-programs with pdcurses. + + updated configure checks for X packages in test/configure from xterm + #267 changes. + + add configure check to gnatmake, to accommodate cygwin. + +20101106 + + correct list of sub-directories needed in Ada95 tree for building as + a separate package. + + modify scripts in test-directory to improve builds as a separate + package. + +20101023 + + correct parsing of relative tab-stops in tabs program (report by + Philip Ganchev). + + adjust configure script so that "t" is not added to library suffix + when weak-symbols are used, allowing the pthread configuration to + more closely match the non-thread naming (report by Werner Fink). + + modify configure check for tic program, used for fallbacks, to a + warning if not found. This makes it simpler to use additonal + scripts to bootstrap the fallbacks code using tic from the build + tree (report by Werner Fink). + + fix several places in configure script using ${variable-value} form. + + modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders + which do not support selectively linking against static libraries + (report by John P. Hartmann) + + fix an unescaped dash in man/tset.1 (report by Sven Joachim). + +20101009 + + correct comparison used for setting 16-colors in linux-16color + entry (Novell #644831) -TD + + improve linux-16color entry, using "dim" for color-8 which makes it + gray rather than black like color-0 -TD + + drop misc/ncu-indent and misc/jpf-indent; they are provided by an + external package "cindent". + +20101002 + + improve linkages in html manpages, adding references to the newer + pages, e.g., *_variables, curs_sp_funcs, curs_threads. + + add checks in tic for inconsistent cursor-movement controls, and for + inconsistent printer-controls. + + fill in no-parameter forms of cursor-movement where a parameterized + form is available -TD + + fill in missing cursor controls where the form of the controls is + ANSI -TD + + fix inconsistent punctuation in form_variables manpage (patch by + Sven Joachim). + + add parameterized cursor-controls to linux-basic (report by Dae) -TD + > patch by Juergen Pfeifer: + + document how to build 32-bit libraries in README.MinGW + + fixes to filename computation in mk-dlls.sh.in + + use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven + Joachim). + + add a check in mk-dlls.sh.in to obtain the size of a pointer to + distinguish between 32-bit and 64-bit hosts. The result is stored + in mingw_arch + +20100925 + + add "XT" capability to entries for terminals that support both + xterm-style mouse- and title-controls, for "screen" which + special-cases TERM beginning with "xterm" or "rxvt" -TD + > patch by Juergen Pfeifer: + + use 64-Bit MinGW toolchain (recommended package from TDM, see + README.MinGW). + + support pthreads when using the TDM MinGW toolchain + +20100918 + + regenerated html manpages. + + minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages. + + add manpage for sp-funcs. + + add sp-funcs to test/listused.sh, for documentation aids. + +20100911 + + add manpages for summarizing public variables of curses-, terminfo- + and form-libraries. + + minor fixes to manpages for consistency (patch by Jason McIntyre). + + modify tic's -I/-C dump to reformat acsc strings into canonical form + (sorted, unique mapping) (cf: 971004). + + add configure check for pthread_kill(), needed for some old + platforms. + +20100904 + + add configure option --without-tests, to suppress building test + programs (request by Frederic L W Meunier). + +20100828 + + modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD + + add check in terminfo source-reader to provide more informative + message when someone attempts to run tic on a compiled terminal + description (prompted by Debian #593920). + + note in infotocap and captoinfo manpages that they read terminal + descriptions from text-files (Debian #593920). + + improve acsc string for vt52, show arrow keys (patch by Benjamin + Sittler). + +20100814 + + document in manpages that "mv" functions first use wmove() to check + the window pointer and whether the position lies within the window + (suggested by Poul-Henning Kamp). + + fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch + by Tim van der Molen). + + modify configure script to transform library names for tic- and + tinfo-libraries so that those build properly with Mac OS X shared + library configuration. + + modify configure script to ensure that it removes conftest.dSYM + directory leftover on checks with Mac OS X. + + modify configure script to cleanup after check for symbolic links. + +20100807 + + correct a typo in mk-1st.awk (patch by Gabriele Balducci) + (cf: 20100724) + + improve configure checks for location of tic and infocmp programs + used for installing database and for generating fallback data, + e.g., for cross-compiling. + + add Markus Kuhn's wcwidth function for compiling MinGW + + add special case to CF_REGEX for cross-compiling to MinGW target. + +20100731 + + modify initialization check for win32con driver to eliminate need for + special case for TERM "unknown", using terminal database if available + (prompted by discussion with Roumen Petrov). + + for MinGW port, ensure that terminal driver is setup if tgetent() + is called (patch by Roumen Petrov). + + document tabs "-0" and "-8" options in manpage. + + fix Debian "lintian" issues with manpages reported in + http://lintian.debian.org/full/csmall@debian.org.html#ncurses + +20100724 + + add a check in tic for missing set_tab if clear_all_tabs given. + + improve use of symbolic links in makefiles by using "-f" option if + it is supported, to eliminate temporary removal of the target + (prompted by http://www.t2-project.org/packages/ncurses.html) + + minor improvement to test/ncurses.c, reset color pairs in 'd' test + after exit from 'm' main-menu command. + + improved ncu-indent, from mawk changes, allows more than one of + GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line. + +20100717 + + add hard-reset for rs2 to wsvt25 to help ensure that reset ends + the alternate character set (patch by Nicholas Marriott) + + remove tar-copy.sh and related configure/Makefile chunks, since the + Ada95 binding is now installed using rules in Ada95/src. + +20100703 + + continue integrating changes to use gnatmake project files in Ada95 + + add/use configure check to turn on project rules for Ada95/src. + + revert the vfork change from 20100130, since it does not work. + +20100626 + + continue integrating changes to use gnatmake project files in Ada95 + + old gnatmake (3.15) does not produce libraries using project-file; + work around by adding script to generate alternate makefile. + +20100619 + + continue integrating changes to use gnatmake project files in Ada95 + + add configure --with-ada-sharedlib option, for the test_make rule. + + move Ada95-related logic into aclocal.m4, since additional checks + will be needed to distinguish old/new implementations of gnat. + +20100612 + + start integrating changes to use gnatmake project files in Ada95 tree + + add test_make / test_clean / test_install rules in Ada95/src + + change install-path for adainclude directory to /usr/share/ada (was + /usr/lib/ada). + + update Ada95/configure. + + add mlterm+256color entry, for mlterm 3.0.0 -TD + + modify test/configure to use macros to ensure consistent order + of updating LIBS variable. + +20100605 + + change search order of options for Solaris in CF_SHARED_OPTS, to + work with 64-bit compiles. + + correct quoting of assignment in CF_SHARED_OPTS case for aix + (cf: 20081227) + +20100529 + + regenerated html documentation. + + modify test/configure to support pkg-config for checking X libraries + used by PDCurses. + + add/use configure macro CF_ADD_LIB to force consistency of + assignments to $LIBS, etc. + + fix configure script for combining --with-pthread + and --enable-weak-symbols options. + +20100522 + + correct cross-compiling configure check for CF_MKSTEMP macro, by + adding a check cache variable set by AC_CHECK_FUNC (report by + Pierre Labastie). + + simplify include-dependencies of make_hash and make_keys, to reduce + the need for setting BUILD_CPPFLAGS in cross-compiling when the + build- and target-machines differ. + + repair broken-linker configuration by restoring a definition of SP + variable to curses.priv.h, and adjusting for cases where sp-funcs + are used. + + improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment + variable to override (prompted by report by Pablo Cazallas). + +20100515 + + add configure option --enable-pthreads-eintr to control whether the + new EINTR feature is enabled. + + modify logic in pthread configuration to allow EINTR to interrupt + a read operation in wgetch() (Novell #540571, patch by Werner Fink). + + drop mkdirs.sh, use "mkdir -p". + + add configure option --disable-libtool-version, to use the + "-version-number" feature which was added in libtool 1.5 (report by + Peter Haering). The default value for the option uses the newer + feature, which makes libraries generated using libtool compatible + with the standard builds of ncurses. + + updated test/configure to match configure script macros. + + fixes for configure script from lynx changes: + + improve CF_FIND_LINKAGE logic for the case where a function is + found in predefined libraries. + + revert part of change to CF_HEADER (cf: 20100424) + +20100501 + + correct limit-check in wredrawln, accounting for begy/begx values + (patch by David Benjamin). + + fix most compiler warnings from clang. + + amend build-fix for OpenSolaris, to ensure that a system header is + included in curses.h before testing feature symbols, since they + may be defined by that route. + +20100424 + + fix some strict compiler warnings in ncurses library. + + modify configure macro CF_HEADER_PATH to not look for variations in + the predefined include directories. + + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work + with gcc 4.x's c89 alias, which gives warning messages for cases + where older versions would produce an error. + +20100417 + + modify _nc_capcmp() to work with cancelled strings. + + correct translation of "^" in _nc_infotocap(), used to transform + terminfo to termcap strings + + add configure --disable-rpath-hack, to allow disabling the feature + which adds rpath options for libraries in unusual places. + + improve CF_RPATH_HACK_2 by checking if the rpath option for a given + directory was already added. + + improve CF_RPATH_HACK_2 by using ldd to provide a standard list of + directories (which will be ignored). + +20100410 + + improve win_driver.c handling of mouse: + + discard motion events + + avoid calling _nc_timed_wait when there is a mouse event + + handle 4th and "rightmost" buttons. + + quote substitutions in CF_RPATH_HACK_2 configure macro, needed for + cases where there are embedded blanks in the rpath option. + +20100403 + + add configure check for exctags vs ctags, to work around pkgsrc. + + simplify logic in _nc_get_screensize() to make it easier to see how + environment variables may override system- and terminfo-values + (prompted by discussion with Igor Bujna). + + make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose. + + improve handling of color-pairs embedded in attributes for the + extended-colors configuration. + + modify MKlib_gen.sh to build link_test with sp-funcs. + + build-fixes for OpenSolaris aka Solaris 11, for wide-character + configuration as well as for rpath feature in *-config scripts. + +20100327 + + refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more + reusable. + + improve configure CF_REGEX, similar fixes. + + improve configure CF_FIND_LINKAGE, adding add check between system + (default) and explicit paths, where we can find the entrypoint in the + given library. + + add check if Gpm_Open() returns a -2, e.g., for "xterm". This is + normally suppressed but can be overridden using $NCURSES_GPM_TERMS. + Ensure that Gpm_Close() is called in this case. + +20100320 + + rename atari and st52 terminfo entries to atari-old, st52-old, use + newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan + Hourihane). + +20100313 + + modify install-rule for manpages so that *-config manpages will + install when building with --srcdir (report by Sven Joachim). + + modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks + option is not the same as --disable-leaks (GenToo #305889). + + modify #define's for build-compiler to suppress cchar_t symbol from + compile of make_hash and make_keys, improving cross-compilation of + ncursesw (report by Bernhard Rosenkraenzer). + + modify CF_MAN_PAGES configure macro to replace all occurrences of + TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders + Kaseorg). + +20100306 + + generate manpages for the *-config scripts, adapted from help2man + (suggested by Sven Joachim). + + use va_copy() in _nc_printf_string() to avoid conflicting use of + va_list value in _nc_printf_length() (report by Wim Lewis). + +20100227 + + add Ada95/configure script, to use in tar-file created by + Ada95/make-tar.sh + + fix typo in wresize.3x (patch by Tim van der Molen). + + modify screen-bce.XXX entries to exclude ech, since screen's color + model does not clear with color for that feature -TD + +20100220 + + add make-tar.sh scripts to Ada95 and test subdirectories to help with + making those separately distributable. + + build-fix for static libraries without dlsym (Debian #556378). + + fix a syntax error in man/form_field_opts.3x (patch by Ingo + Schwarze). + +20100213 + + add several screen-bce.XXX entries -TD + +20100206 + + update mrxvt terminfo entry -TD + + modify win_driver.c to support mouse single-clicks. + + correct name for termlib in ncurses*-config, e.g., if it is renamed + to provide a single file for ncurses/ncursesw libraries (patch by + Miroslav Lichvar). + +20100130 + + use vfork in test/ditto.c if available (request by Mike Frysinger). + + miscellaneous cleanup of manpages. + + fix typo in curs_bkgd.3x (patch by Tim van der Molen). + + build-fix for --srcdir (patch by Miroslav Lichvar). + +20100123 + + for term-driver configuration, ensure that the driver pointer is + initialized in setupterm so that terminfo/termcap programs work. + + amend fix for Debian #542031 to ensure that wattrset() returns only + OK or ERR, rather than the attribute value (report by Miroslav + Lichvar). + + reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making + _nc_screen_of() compatible between normal/wide libraries again (patch + by Miroslav Lichvar) + + review/fix include-dependencies in modules files (report by Miroslav + Lichvar). + +20100116 + + modify win_driver.c to initialize acs_map for win32 console, so + that line-drawing works. + + modify win_driver.c to initialize TERMINAL struct so that programs + such as test/lrtest.c and test/ncurses.c which test string + capabilities can run. + + modify term-driver modules to eliminate forward-reference + declarations. + +20100109 + + modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS + consistently to add new -D's while removing duplicates. + + modify a few configure macros to consistently put new options + before older in the list. + + add tiparm(), based on review of X/Open Curses Issue 7. + + minor documentation cleanup. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + (caveat - its maintainer put 2010 copyright date on files dated 2009) + +20100102 + + minor improvement to tic's checking of similar SGR's to allow for the + most common case of SGR 0. + + modify getmouse() to act as its documentation implied, returning on + each call the preceding event until none are left. When no more + events remain, it will return ERR. + +20091227 + + change order of lookup in progs/tput.c, looking for terminfo data + first. This fixes a confusion between termcap "sg" and terminfo + "sgr" or "sgr0", originally from 990123 changes, but exposed by + 20091114 fixes for hashing. With this change, only "dl" and "ed" are + ambiguous (Mandriva #56272). + +20091226 + + add bterm terminfo entry, based on bogl 0.1.18 -TD + + minor fix to rxvt+pcfkeys terminfo entry -TD + + build-fixes for Ada95 tree for gnat 4.4 "style". + +20091219 + + remove old check in mvderwin() which prevented moving a derived + window whose origin happened to coincide with its parent's origin + (report by Katarina Machalkova). + + improve test/ncurses.c to put mouse droppings in the proper window. + + update minix terminfo entry -TD + + add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler) + +20091212 + + correct transfer of multicolumn characters in multirow + field_buffer(), which stopped at the end of the first row due to + filling of unused entries in a cchar_t array with nulls. + + updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta) + + modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character + nulls. + + use strdup() in set_menu_mark(), restore .marklen struct member on + failure. + + eliminate clause 3 from the UCB copyrights in read_termcap.c and + tset.c per + ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + (patch by Nicholas Marriott). + + replace a malloc in tic.c with strdup, checking for failure (patch by + Nicholas Marriott). + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + +20091205 + + correct layout of working window used to extract data in + wide-character configured by set_field_buffer (patch by Rafael + Garrido Fernandez) + + improve some limit-checks related to filename length in reading and + writing terminfo entries. + + ensure that filename is always filled in when attempting to read + a terminfo entry, so that infocmp can report the filename (patch + by Nicholas Marriott). + +20091128 + + modify mk-1st.awk to allow tinfo library to be built when term-driver + is enabled. + + add error-check to configure script to ensure that sp-funcs is + enabled if term-driver is, since some internal interfaces rely upon + this. + +20091121 + + fix case where progs/tput is used while sp-funcs is configure; this + requires save/restore of out-character function from _nc_prescreen + rather than the SCREEN structure (report by Charles Wilson). + + fix typo in man/curs_trace.3x which caused incorrect symbolic links + + improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT. + +20091114 + + + updated man/curs_trace.3x + + limit hashing for termcap-names to 2-characters (Ubuntu #481740). + + change a variable name in lib_newwin.c to make it clearer which + value is being freed on error (patch by Nicholas Marriott). + +20091107 + + improve test/ncurses.c color-cycling test by reusing attribute- + and color-cycling logic from the video-attributes screen. + + add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form + library which help make it compatible with interop applications + (patch by Juergen Pfeifer). + + add configure option --enable-interop, for integrating changes + for generic/interop support to form-library by Juergen Pfeifer + +20091031 + + modify use of $CC environment variable which is defined by X/Open + as a curses feature, to ignore it if it is not a single character + (prompted by discussion with Benjamin C W Sittler). + + add START_TRACE in slk_init + + fix a regression in _nc_ripoffline which made test/ncurses.c not show + soft-keys, broken in 20090927 merging. + + change initialization of "hidden" flag for soft-keys from true to + false, broken in 20090704 merging (Ubuntu #464274). + + update nsterm entries (patch by Benjamin C W Sittler, prompted by + discussion with Fabian Groffen in GenToo #206201). + + add test/xterm-256color.dat + +20091024 + + quiet some pedantic gcc warnings. + + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a + SIGWINCH, and discard that value, to avoid confusing application + (patch by Eygene Ryabinkin, FreeBSD bin/136223). + +20091017 + + modify handling of $PKG_CONFIG_LIBDIR to use only the first item in + a possibly colon-separated list (Debian #550716). + +20091010 + + supply a null-terminator to buffer in _nc_viswibuf(). + + fix a sign-extension bug in unget_wch() (report by Mike Gran). + + minor fixes to error-returns in default function for tputs, as well + as in lib_screen.c + +20091003 + + add WACS_xxx definitions to wide-character configuration for thick- + and double-lines (discussion with Slava Zanko). + + remove unnecessary kcan assignment to ^C from putty (Sven Joachim) + + add ccc and initc capabilities to xterm-16color -TD + > patch by Benjamin C W Sittler: + + add linux-16color + + correct initc capability of linux-c-nc end-of-range + + similar change for dg+ccc and dgunix+ccc + +20090927 + + move leak-checking for comp_captab.c into _nc_leaks_tinfo() since + that module since 20090711 is in libtinfo. + + add configure option --enable-term-driver, to allow compiling with + terminal-driver. That is used in MinGW port, and (being somewhat + more complicated) is an experimental alternative to the conventional + termlib internals. Currently, it requires the sp-funcs feature to + be enabled. + + completed integrating "sp-funcs" by Juergen Pfeifer in ncurses + library (some work remains for forms library). + +20090919 + + document return code from define_key (report by Mike Gran). + + make some symbolic links in the terminfo directory-tree shorter + (patch by Daniel Jacobowitz, forwarded by Sven Joachim).). + + fix some groff warnings in terminfo.5, etc., from recent Debian + changes. + + change ncv and op capabilities in sun-color terminfo entry to match + Sun's entry for this (report by Laszlo Peter). + + improve interix smso terminfo capability by using reverse rather than + bold (report by Kristof Zelechovski). + +20090912 + + add some test programs (and make these use the same special keys + by sharing linedata.h functions): + test/test_addstr.c + test/test_addwstr.c + test/test_addchstr.c + test/test_add_wchstr.c + + correct internal _nc_insert_ch() to use _nc_insert_wch() when + inserting wide characters, since the wins_wch() function that it used + did not update the cursor position (report by Ciprian Craciun). + +20090906 + + fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not + work. + + add null-pointer checks to other opaque-functions. + + add is_pad() and is_subwin() functions for opaque access to WINDOW + (discussion with Mark Dickinson). + + correct merge to lib_newterm.c, which broke when sp-funcs was + enabled. + +20090905 + + build-fix for building outside source-tree (report by Sven Joachim). + + fix Debian lintian warning for man/tabs.1 by making section number + agree with file-suffix (report by Sven Joachim). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090829 + + workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on + amd64 (Debian #542031). + + fix typo in curs_mouse.3x (Debian #429198). + +20090822 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090815 + + correct use of terminfo capabilities for initializing soft-keys, + broken in 20090509 merging. + + modify wgetch() to ensure it checks SIGWINCH when it gets an error + in non-blocking mode (patch by Clemens Ladisch). + + use PATH_SEPARATOR symbol when substituting into run_tic.sh, to + help with builds on non-Unix platforms such as OS/2 EMX. + + modify scripting for misc/run_tic.sh to test configure script's + $cross_compiling variable directly rather than comparing host/build + compiler names (prompted by comment in GenToo #249363). + + fix configure script option --with-database, which was coded as an + enable-type switch. + + build-fixes for --srcdir (report by Frederic L W Meunier). + +20090808 + + separate _nc_find_entry() and _nc_find_type_entry() from + implementation details of hash function. + +20090803 + + add tabs.1 to man/man_db.renames + + modify lib_addch.c to compensate for removal of wide-character test + from unctrl() in 20090704 (Debian #539735). + +20090801 + + improve discussion in INSTALL for use of system's tic/infocmp for + cross-compiling and building fallbacks. + + modify test/demo_termcap.c to correspond better to options in + test/demo_terminfo.c + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + fix logic for 'V' in test/ncurses.c tests f/F. + +20090728 + + correct logic in tigetnum(), which caused tput program to treat all + string capabilities as numeric (report by Rajeev V Pillai, + cf: 20090711). + +20090725 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090718 + + fix a null-pointer check in _nc_format_slks() in lib_slk.c, from + 20070704 changes. + + modify _nc_find_type_entry() to use hashing. + + make CCHARW_MAX value configurable, noting that changing this would + change the size of cchar_t, and would be ABI-incompatible. + + modify test-programs, e.g,. test/view.c, to address subtle + differences between Tru64/Solaris and HPUX/AIX getcchar() return + values. + + modify length returned by getcchar() to count the trailing null + which is documented in X/Open (cf: 20020427). + + fixes for test programs to build/work on HPUX and AIX, etc. + +20090711 + + improve performance of tigetstr, etc., by using hashing code from tic. + + minor fixes for memory-leak checking. + + add test/demo_terminfo, for comparison with demo_termcap + +20090704 + + remove wide-character checks from unctrl() (patch by Clemens Ladisch). + + revise wadd_wch() and wecho_wchar() to eliminate dependency on + unctrl(). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090627 + + update llib-lncurses[wt] to use sp-funcs. + + various code-fixes to build/work with --disable-macros configure + option. + + add several new files from Juergen Pfeifer which will be used when + integration of "sp-funcs" is complete. This includes a port to + MinGW. + +20090613 + + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to + make includes of term.h without curses.h work (report by "Nix"). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090607 + + fix a regression in lib_tputs.c, from ongoing merges. + +20090606 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090530 + + fix an infinite recursion when adding a legacy-coding 8-bit value + using insch() (report by Clemens Ladisch). + + free home-terminfo string in del_curterm() (patch by Dan Weber). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090523 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090516 + + work around antique BSD game's manipulation of stdscr, etc., versus + SCREEN's copy of the pointer (Debian #528411). + + add a cast to wattrset macro to avoid compiler warning when comparing + its result against ERR (adapted from patch by Matt Kraii, Debian + #528374). + +20090510 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090502 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + add vwmterm terminfo entry (patch by Bryan Christ). + +20090425 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090419 + + build fix for _nc_free_and_exit() change in 20090418 (report by + Christian Ebert). + +20090418 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090411 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + This change finishes merging for menu and panel libraries, does + part of the form library. + +20090404 + + suppress configure check for static/dynamic linker flags for gcc on + Darwin (report by Nelson Beebe). + +20090328 + + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving + function key definitions from emx-base for consistency -TD + + correct missing final 'p' in pfkey capability of ansi.sys-old (report + by Kalle Olavi Niemitalo). + + improve test/ncurses.c 'F' test, show combining characters in color. + + quiet a false report by cppcheck in c++/cursesw.cc by eliminating + a temporary variable. + + use _nc_doalloc() rather than realloc() in a few places in ncurses + library to avoid leak in out-of-memory condition (reports by William + Egert and Martin Ettl based on cppcheck tool). + + add --with-ncurses-wrap-prefix option to test/configure (discussion + with Charles Wilson). + + use ncurses*-config scripts if available for test/configure. + + update test/aclocal.m4 and test/configure + > patches by Charles Wilson: + + modify CF_WITH_LIBTOOL configure check to allow unreleased libtool + version numbers (e.g. which include alphabetic chars, as well as + digits, after the final '.'). + + improve use of -no-undefined option for libtool by setting an + intermediate variable LT_UNDEF in the configure script, and then + using that in the libtool link-commands. + + fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk + from 2009031 changes. + + improve mk-1st.awk script by writing separate cases for the + LIBTOOL_LINK command, depending on which library (ncurses, ticlib, + termlib) is to be linked. + + modify configure.in to allow broken-linker configurations, not just + enable-reentrant, to set public wrap prefix. + +20090321 + + add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to + build with tic and term libraries (patch by Charles Wilson). + + add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX + (report by Charles Wilson). + + fix definition for c++/Makefile.in's SHLIB_LIST, which did not list + the form, menu or panel libraries (patch by Charles Wilson). + + add configure option --with-wrap-prefix to allow setting the prefix + for functions used to wrap global variables to something other than + "_nc_" (discussion with Charles Wilson). + +20090314 + + modify scripts to generate ncurses*-config and pc-files to add + dependency for tinfo library (patch by Charles Wilson). + + improve comparison of program-names when checking for linked flavors + such as "reset" by ignoring the executable suffix (reports by Charles + Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing + list). + + suppress configure check for static/dynamic linker flags for gcc on + Solaris 10, since gcc is confused by absence of static libc, and + does not switch back to dynamic mode before finishing the libraries + (reports by Joel Bertrand, Alan Pae). + + minor fixes to Intel compiler warning checks in configure script. + + modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works. + + modify set_curterm() to make broken-linker configuration work with + changes from 20090228 (report by Charles Wilson). + +20090228 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + modify declaration of cur_term when broken-linker is used, but + enable-reentrant is not, to match pre-5.7 (report by Charles Wilson). + +20090221 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090214 + + add configure script --enable-sp-funcs to enable the new set of + extended functions. + + start integrating patches by Juergen Pfeifer: + + add extended functions which specify the SCREEN pointer for several + curses functions which use the global SP (these are incomplete; + some internals work is needed to complete these). + + add special cases to configure script for MinGW port. + +20090207 + + update several configure macros from lynx changes + + append (not prepend) to CFLAGS/CPPFLAGS + + change variable from PATHSEP to PATH_SEPARATOR + + improve install-rules for pc-files (patch by Miroslav Lichvar). + + make it work with $DESTDIR + + create the pkg-config library directory if needed. + +20090124 + + modify init_pair() to allow caller to create extra color pairs beyond + the color_pairs limit, which use default colors (request by Emanuele + Giaquinta). + + add misc/terminfo.tmp and misc/*.pc to "sources" rule. + + fix typo "==" where "=" is needed in ncurses-config.in and + gen-pkgconfig.in files (Debian #512161). + +20090117 + + add -shared option to MK_SHARED_LIB when -Bsharable is used, for + *BSD's, without which "main" might be one of the shared library's + dependencies (report/analysis by Ken Dickey). + + modify waddch_literal(), updating line-pointer after a multicolumn + character is found to not fit on the current row, and wrapping is + done. Since the line-pointer was not updated, the wrapped + multicolumn character was written to the beginning of the current row + (cf: 20041023, reported by "Nick" regarding problem with ncmpc + http://musicpd.org/mantis/bug_view_page.php?bug_id=1930). + +20090110 + + add screen.Eterm terminfo entry (GenToo #124887) -TD + + modify adacurses-config to look for ".ali" files in the adalib + directory. + + correct install for Ada95, which omitted libAdaCurses.a used in + adacurses-config + + change install for adacurses-config to provide additional flavors + such as adacursesw-config, for ncursesw (GenToo #167849). + +20090105 + + remove undeveloped feature in ncurses-config.in for setting + prefix variable. + + recent change to ncurses-config.in did not take into account the + --disable-overwrite option, which sets $includedir to the + subdirectory and using just that for a -I option does not work - fix + (report by Frederic L W Meunier). + +20090104 + + modify gen-pkgconfig.in to eliminate a dependency on rpath when + deciding whether to add $LIBS to --libs output; that should be shown + for the ncurses and tinfo libraries without taking rpath into + account. + + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk, + used in static libraries (report by Marty Jack). + +20090103 + + add a configure-time check to pick a suitable value for + CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen). + + add configure --with-pkg-config and --enable-pc-files options, along + with misc/gen-pkgconfig.in which can be used to generate ".pc" files + for pkg-config (request by Jan Engelhardt). + + use $includedir symbol in misc/ncurses-config.in, add --includedir + option. + + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a + configure check to detect whether a "-" is needed before "ar" + options. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + +20081227 + + modify mk-1st.awk to work with extra categories for tinfo library. + + modify configure script to allow building shared libraries with gcc + on AIX 5 or 6 (adapted from patch by Lital Natan). + +20081220 + + modify to omit the opaque-functions from lib_gen.o when + --disable-ext-funcs is used. + + add test/clip_printw.c to illustrate how to use printw without + wrapping. + + modify ncurses 'F' test to demo wborder_set() with colored lines. + + modify ncurses 'f' test to demo wborder() with colored lines. + +20081213 + + add check for failure to open hashed-database needed for db4.6 + (GenToo #245370). + + corrected --without-manpages option; previous change only suppressed + the auxiliary rules install.man and uninstall.man + + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from + GenToo #250454). + + fixes from NetBSD port at + http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches + patch-ac (build-fix for DragonFly) + patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config). + + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH + by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the + search-lists. + + correct title string for keybound manpage (patch by Frederic Culot, + OpenBSD documentation/6019), + +20081206 + + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to + work for progs/clear, progs/tabs, etc. + + correct buffer-size after internal resizing of wide-character + set_field_buffer(), broken in 20081018 changes (report by Mike Gran). + + add "-i" option to test/filter.c to tell it to use initscr() rather + than newterm(), to investigate report on comp.unix.programmer that + ncurses would clear the screen in that case (it does not - the issue + was xterm's alternate screen feature). + + add check in mouse-driver to disable connection if GPM returns a + zero, indicating that the connection is closed (Debian #506717, + adapted from patch by Samuel Thibault). + +20081129 + + improve a workaround in adding wide-characters, when a control + character is found. The library (cf: 20040207) uses unctrl() to + obtain a printable version of the control character, but was not + passing color or video attributes. + + improve test/ncurses.c 'a' test, using unctrl() more consistently to + display meta-characters. + + turn on _XOPEN_CURSES definition in curses.h + + add eterm-color entry (report by Vincent Lefevre) -TD + + correct use of key_name() in test/ncurses.c 'A' test, which only + displays wide-characters, not key-codes since 20070612 (report by + Ricardo Cantu). + +20081122 + + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and + Ada95 (patch by Juergen Pfeifer). + + document in TO-DO an issue with Cygwin's package for GNAT (report + by Mike Dennison). + + improve error-checking of command-line options in "tabs" program. + +20081115 + + change several terminfo entries to make consistent use of ANSI + clear-all-tabs -TD + + add "tabs" program (prompted by Debian #502260). + + add configure --without-manpages option (request by Mike Frysinger). + 20081102 5.7 release for upload to ftp.gnu.org 20081025 @@ -77,7 +1147,7 @@ it is not possible to add this information. overlooked til now. 20081011 - + update html documentation. + + regenerated html documentation. + add -m and -s options to test/keynames.c and test/key_names.c to test the meta() function with keyname() or key_name(), respectively. + correct return value of key_name() on error; it is null. @@ -2204,7 +3274,7 @@ it is not possible to add this information. (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., - #define NCURSES_ENABLE_STDBOOL_H 0 + #define NCURSES_ENABLE_STDBOOL_H 0 #include (discussion on XFree86 mailing list). @@ -2784,7 +3854,7 @@ it is not possible to add this information. 20030208 + add checking in tic for incomplete line-drawing character mapping. - + update configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, + + updated configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda ). + make return value from _nc_printf_string() consistent. Before, @@ -3503,7 +4573,7 @@ it is not possible to add this information. + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. - + update configure macro CF_WITH_PATHLIST, to omit some double quotes + + updated configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) diff --git a/README.MinGW b/README.MinGW new file mode 100644 index 00000000000..d111b387784 --- /dev/null +++ b/README.MinGW @@ -0,0 +1,149 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 2008-2010,2011 Free 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: README.MinGW,v 1.5 2011/02/26 16:57:17 tom Exp $ +-- Author: Juergen Pfeifer +------------------------------------------------------------------------------- + +This is work in progress, but it's in an state where one can see it +works at least on the Windows Console. + +You should install the MSYS package, so that you've a shell environment that +allows you to run the scripts, especially configure etc. You can get that +from http://www.mingw.org + +To build ncurses for native Windows, you need the MinGW toolchain. The +original MinGW toolchain from the above site is only for 32-Bit Windows. As +Windows Server - and also regular workstations - are moving to 64-Bit, it +seems to be reasonable to have a toolchain that supports both architectures. +I recommend to use the TDM gcc toolchain which you can find at +http://tdm-gcc.tdragon.net/download. Go to the download section and select +the bundle installer for tdm64 (MinGW-w64). This installs a multilib version +of the gcc toolchain that can compile for native 32- and 64-Bit Windows +versions. It also comes with a working pthread implementation. + +The latest config and build scripts we use for MinGW have only been tested +for the gcc-4.4 compiler toolchain (or better). + +Using MinGW is a pragmatic decision, it's the easiest way to port this +heavily UNIX based sourcebase to native Windows. The goal is of course +to provide the includes, libraries and DLLs to be used with the more +common traditional development environments on Windows, mainly with +Microsoft Visual Studio. + +If you start a bash from the MSYS environment, please make sure that the +Microsoft Development tools are in your PATH right after the MinGW +tools. The LIB.EXE tool is the only one needed. You need this only if +you want to build DLLs that work with native Windows programs. If you +don't have any Microsoft Development tools on your machine, consider +at least to get the free "Visual C++ 2010 Express Edition". +It contains the LIB.EXE tool. You may also use this compiler to test +writing native Windows programs using the ncurses DLLs without using +MinGW then for writing apps. + +It is necessary to unset the TERM environment variable, to activate the +Windows console-driver. + +Please also make sure that MSYS links to the correct directory containing +your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows +CMD.EXE command shell go to the MSYS root directory (most probably +C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw +that points to the MinGW toolchain directory. If not, delete the mingw +directory and use the mklink command (or the linkd.exe utility on older +Windows) to create the junction point. + +This code requires WindowsNT 5.1 or better, which means on the client +Windows XP or better, on the server Windows Server 2003 or better. + +In order to build ncurses for the planned interop layer with .NET, we +recommend to use these options with configure + + --disable-home-terminfo + --enable-reentrant + --enable-sp-funcs + --enable-term-driver + --enable-interop + --with-pthread (if using TDM toolchain as recommended) + +This is the configuration commandline as I'm using it at the moment: + +./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread + +If you are on a 64-Bit Windows system and want to build a 32-Bit version +of ncurses, you may use this commandline for configuration (when using +the TDM toolchain): + +CC="gcc -m32" LD="ld -m32" ./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread + +All the options above are - like the whole Windows support - +experimental. + +In order to build the DLLs, after your regular make you must call + + make dlls + +A lot is still TODO, e.g.: + + - Wide Character support + The Win32Con driver should actually only use Unicode in the + future. + - Thread support (locking). If using TDM toolchain this is done by + configuring pthreads. + - A GUI console driver + - Support for Terminals attached via a serial port (via terminfo) + - Support for networked Terminal connections (via terminfo) + - Workarounds for MinGW's filesystem access are necessary to make infocmp + work (though tic works). + +To support terminfo, we need to have an ioctl() simulation for the +serial and networked Terminals. diff --git a/TO-DO b/TO-DO index ca47d02d0ec..5df7f47e722 100644 --- a/TO-DO +++ b/TO-DO @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $ +-- $Id: TO-DO,v 1.57 2011/03/28 00:23:02 tom Exp $ ------------------------------------------------------------------------------- SHORT-TERM TO-DO ITEMS: @@ -45,7 +45,7 @@ Known Problems: + Scrolling optimization has holes: for example, it forces repaints of the screen between calls to refresh(). -+ SVr4 uses slightly different rules for determining when softkeys are shown. ++ SVr4 uses slightly different rules for determining when softkeys are shown. For example, they are initially displayed (before the ncurses 'e' test activates them), and a touchwin can apparently also force them to be displayed. @@ -58,7 +58,7 @@ Known Problems: + The window classes defined in the c++ subdirectory need documentation. Some C++ programmer could earn a lot of good karma by doing this... -+ vid_attr() should support the set_a_attributes (sgr1) string, but does not. ++ vid_attr() should support the set_a_attributes (sgr1) string, but does not. There appear to be no terminals that require that functionality. + the configure --disable-ext-funcs option does not work for Ada95 tree. @@ -72,27 +72,28 @@ Known Problems: Building those with libtool does not work either. (This is a problem with the BSD platforms). ++ more work is needed to make the MinGW port support ordinary terminals. + Portability (or lack thereof): + Users of older System V UNIXes (but not Solaris, and probably not SVr4) may trip over a known problem with the signal-handling code which causes abrupt termination of ncurses applications following resume from a ^Z suspend (this problem was first seen running lynx). You will not see this problem if you - are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or - BSDI. For details, see the analysis in the header comment of - ncurses/tty/lib_tstp.c . + are using one of the 4.4BSD derivatives like such as, NetBSD, or BSDI, or + systems using that convention. For details, see the analysis in the header + comment of ncurses/tty/lib_tstp.c . + In theory, vwprintw and vwscanf are supposed to use the older varargs.h interface for handling variadic argument lists (and are deprecated by X/Open - for that reason). Linux doesn't have varargs.h, it has the newer - X/Open-standard stdargs.h equivalent. So these functions use stdargs - instead. This is unlikely to be a problem unless you're building ncurses on - a System V old enough to only have varargs.h. (Solaris 2.5.1 used the - stdarg.h binding as well). + for that reason). Many newer systems do no have varargs.h, instead they have + only the newer X/Open-standard stdargs.h equivalent. So these functions use + stdargs instead. This is unlikely to be a problem unless you're building + ncurses on a System V old enough to only have varargs.h. (Solaris 2.5.1 used + the stdarg.h binding as well). -+ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have - a native vsscanf(3) in its library, vwscanw() will not work. You lose. (It - should work on any System V, however). If you want to fix this, add an ++ If you're using a system old enough not to have a native vsscanf(3) in its + library, vwscanw() will not work. If you want to fix this, add an implementation to ncurses/vsscanf.c. + The C++ binding fails to build with a few C++ compilers. @@ -122,7 +123,7 @@ supporting internationalization. 2. DOS port Only a few of the files in the library depend on the terminfo format. -It should be possible to further kernelize the package, then rewrite +It should be possible to further kernelize the package, then rewrite a small number of core files to produce a functionally-compatible port that would do updates to a memory-mapped screen area. The first result of this would be a DOS port. @@ -195,10 +196,10 @@ F. Unused VDT capabilities: move_insert, dest_tabs_magic_smso, transparent_underline, needs_xon_xoff, hard_cursor. Numerics: lines_of_memory, buttons. - Strings: pkey_key, pkey_local, pkey_xmit, underline_char, - enter_xon_mode, exit_xon_mode, xon_character, xoff_character, + Strings: pkey_key, pkey_local, pkey_xmit, underline_char, + enter_xon_mode, exit_xon_mode, xon_character, xoff_character, display_clock, remove_clock, user[0-5], display_pc_char, - enter_scancode_mode, exit_scancode_mode, pc_term_options, + enter_scancode_mode, exit_scancode_mode, pc_term_options, scancode_escape, alt_scancode_esc. These are the potentially important ones for ncurses. Notes: diff --git a/aclocal.m4 b/aclocal.m4 index 4c8e818f240..9a828559d4a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2010,2011 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 * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.470 2008/10/25 22:15:32 tom Exp $ +dnl $Id: aclocal.m4,v 1.553 2011/03/31 23:35:38 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -62,13 +62,13 @@ AC_DEFUN([AM_LANGINFO_CODESET], fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. AC_DEFUN([CF_ADA_INCLUDE_DIRS], [ -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -86,7 +86,15 @@ fi AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30 +dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18 +dnl --------------- +dnl Add to $ADAFLAGS, which is substituted into makefile and scripts. +AC_DEFUN([CF_ADD_ADAFLAGS],[ + ADAFLAGS="$ADAFLAGS $1" + AC_SUBST(ADAFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -112,8 +120,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -128,6 +136,12 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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" ;; esac @@ -143,24 +157,24 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) + CPPFLAGS="$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)]) + ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi @@ -168,7 +182,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 +dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 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, @@ -195,7 +209,7 @@ if test -n "$1" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS @@ -211,11 +225,11 @@ if test -n "$1" ; then if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) - ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)" + ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -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" + 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 @@ -225,7 +239,15 @@ if test -n "$1" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34 +dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 +dnl ---------- +dnl Add a library, used to enforce consistency. +dnl +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 ------------- dnl Adds to the library-path dnl @@ -254,14 +276,22 @@ if test -n "$1" ; then 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)" + ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59 +dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl ----------- +dnl Add one or more libraries, used to enforce consistency. +dnl +dnl $1 = libraries to add, with the "-l", etc. +dnl $2 = variable to update (default $LIBS) +AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -273,7 +303,7 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "$4" != "$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { +ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" @@ -283,13 +313,13 @@ ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { } ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 +dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 dnl ---------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ -AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -353,7 +383,89 @@ You have the following choices: fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_AWK_BIG_PRINTF version: 2 updated: 2008/10/04 17:16:18 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 +dnl -------------- +dnl Allow user to disable a normally-on option. +AC_DEFUN([CF_ARG_DISABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 +dnl ------------- +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus +dnl values. +dnl +dnl Parameters: +dnl $1 = option name +dnl $2 = help-string +dnl $3 = action to perform if option is not default +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 +ifelse([$3],,[ :]dnl +,[ $3]) ifelse([$4],,,[ + else + $4]) + fi],[enableval=$5 ifelse([$4],,,[ + $4 +])dnl + ])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29 +dnl ----------- +dnl Check for suitable "ar" (archiver) options for updating an archive. +AC_DEFUN([CF_AR_FLAGS],[ +AC_REQUIRE([CF_PROG_AR]) + +AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do + + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&AC_FD_CC + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + CF_VERBOSE(cannot compile test-program) + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext +]) + +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags +fi + +AC_SUBST(ARFLAGS) +]) +dnl --------------------------------------------------------------------------- +dnl CF_AWK_BIG_PRINTF version: 3 updated: 2008/12/27 12:30:03 dnl ----------------- dnl Check if awk can handle big strings using printf. Some older versions of dnl awk choke on large strings passed via "%s". @@ -362,19 +474,19 @@ dnl $1 = desired string size dnl $2 = variable to set with result AC_DEFUN([CF_AWK_BIG_PRINTF], [ - case x$AWK in #(vi - x) - eval $2=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval $2=yes - else - eval $2=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval $2=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval $2=yes + else + eval $2=no + fi + ;; + esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18 @@ -695,7 +807,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22 +dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it @@ -713,7 +825,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ #include #include #include ], - ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1, + ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) @@ -724,7 +836,7 @@ if test "$cf_cv_dcl_$1" = no ; then fi # It's possible (for near-UNIX clones) that the data doesn't exist -CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2)) +CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23 @@ -752,7 +864,7 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_GPM_WGETCH version: 1 updated: 2007/04/28 14:38:06 +dnl CF_CHECK_GPM_WGETCH version: 2 updated: 2010/08/14 18:25:37 dnl ------------------- dnl Check if GPM is already linked with curses. If so - and if the linkage dnl is not "weak" - warn about this because it can create problems linking @@ -786,7 +898,7 @@ CF_EOF test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -f conftest* + rm -rf conftest* LIBS="$cf_save_LIBS" fi ]) @@ -887,7 +999,7 @@ fi test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50 +dnl CF_C_INLINE version: 3 updated: 2010/05/01 15:14:41 dnl ----------- dnl Check if the C compiler supports "inline". dnl $1 is the name of a shell variable to set if inline is supported @@ -902,7 +1014,7 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[ + AC_CACHE_CHECK(if $CC supports options to tune inlining,cf_cv_gcc_inline,[ cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=$2" AC_TRY_COMPILE([inline int foo(void) { return 1; }], @@ -945,7 +1057,7 @@ done AC_SUBST(DIRS_TO_MAKE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 4 updated: 2006/12/16 15:10:42 +dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. @@ -958,27 +1070,71 @@ AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], - [with_no_leaks=yes], + [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], : ${with_no_leaks:=no}) AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then AC_DEFINE(NO_LEAKS) + AC_DEFINE(YY_NO_LEAKS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_RPATH version: 1 updated: 2008/09/13 10:22:30 +dnl CF_DISABLE_LIBTOOL_VERSION version: 1 updated: 2010/05/15 15:45:59 +dnl -------------------------- +dnl Check if we should use the libtool 1.5 feature "-version-number" instead of +dnl the older "-version-info" feature. The newer feature allows us to use +dnl version numbering on shared libraries which make them compatible with +dnl various systems. +AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION], +[ +AC_MSG_CHECKING(if libtool -version-number should be used) +CF_ARG_DISABLE(libtool-version, + [ --disable-libtool-version enable to use libtool's incompatible naming scheme], + [cf_libtool_version=no], + [cf_libtool_version=yes]) +AC_MSG_RESULT($cf_libtool_version) + +if test "$cf_libtool_version" = yes ; then + LIBTOOL_VERSION="-version-number" +else + LIBTOOL_VERSION="-version-info" +fi + +AC_SUBST(LIBTOOL_VERSION) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33 +dnl --------------------- +dnl The rpath-hack makes it simpler to build programs, particularly with the +dnl *BSD ports which may have essential libraries in unusual places. But it +dnl can interfere with building an executable for the base system. Use this +dnl option in that case. +AC_DEFUN([CF_DISABLE_RPATH_HACK], +[ +AC_MSG_CHECKING(if rpath-hack should be disabled) +CF_ARG_DISABLE(rpath-hack, + [ --disable-rpath-hack don't add rpath options for additional libraries], + [cf_disable_rpath_hack=yes], + [cf_disable_rpath_hack=no]) +AC_MSG_RESULT($cf_disable_rpath_hack) +if test "$cf_disable_rpath_hack" = no ; then + CF_RPATH_HACK +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42 dnl --------------- dnl Check if the rpath option should be used, setting cache variable -dnl cf_cv_ld_rpath if so. +dnl cf_cv_enable_rpath if so. AC_DEFUN([CF_ENABLE_RPATH], [ AC_MSG_CHECKING(if rpath option should be used) AC_ARG_ENABLE(rpath, [ --enable-rpath use rpath option when generating shared libraries], -[cf_cv_ld_rpath=$enableval], -[cf_cv_ld_rpath=no]) -AC_MSG_RESULT($cf_cv_ld_rpath) +[cf_cv_enable_rpath=$enableval], +[cf_cv_enable_rpath=no]) +AC_MSG_RESULT($cf_cv_enable_rpath) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 @@ -1019,7 +1175,7 @@ AC_MSG_RESULT($cf_result) CXXFLAGS="$cf_save_CXXFLAGS" ]) dnl --------------------------------------------------------------------------- -dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53 +dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 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. @@ -1048,10 +1204,26 @@ cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) -AC_TRY_LINK([$1],[$2], - cf_cv_find_linkage_$3=yes,[ - cf_cv_find_linkage_$3=no +cf_save_LIBS="$LIBS" +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib +],[ + +LIBS="-l$3 $7 $cf_save_LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib + cf_cv_library_file_$3="-l$3" +],[ + 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" @@ -1110,7 +1282,6 @@ AC_TRY_LINK([$1],[$2], ]) fi done - LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -1119,19 +1290,22 @@ AC_TRY_LINK([$1],[$2], cf_cv_find_linkage_$3=no fi ],$7) +]) + +LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ - CF_ADD_INCDIR($cf_cv_header_path_$3) - CF_ADD_LIBDIR($cf_cv_library_path_$3) - LIBS="-l$3 $LIBS" + CF_ADD_INCDIR($cf_cv_header_path_$3) + CF_ADD_LIBDIR($cf_cv_library_path_$3) + CF_ADD_LIB($3) ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_DLSYM version: 1 updated: 2004/06/16 20:52:45 +dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02 dnl ------------- dnl Test for dlsym() and related functions, as well as libdl. dnl @@ -1148,7 +1322,7 @@ AC_CHECK_LIB(dl,dlsym,[ cf_have_libdl=yes])]) if test "$cf_have_dlsym" = yes ; then - test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" + test "$cf_have_libdl" = yes && CF_ADD_LIB(dl) AC_MSG_CHECKING(whether able to link to dl*() functions) AC_TRY_LINK([#include ],[ @@ -1231,7 +1405,7 @@ int main() { test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP) ]) dnl --------------------------------------------------------------------------- -dnl CF_FUNC_OPENPTY version: 2 updated: 2008/04/12 19:49:01 +dnl CF_FUNC_OPENPTY version: 3 updated: 2010/05/29 16:31:02 dnl --------------- dnl Check for openpty() function, along with header. It may need the dnl "util" library as well. @@ -1240,7 +1414,7 @@ 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 && LIBS="-lutil $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([ @@ -1362,7 +1536,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 +dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1389,7 +1563,7 @@ if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) cat > conftest.$ac_ext <&AC_FD_CC - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* + ;; + esac + ;; +esac +AC_MSG_RESULT($cf_gnat_projects) + +if test $cf_gnat_projects = yes +then + AC_MSG_CHECKING(if GNAT supports libraries) + AC_MSG_RESULT($cf_gnat_libraries) +fi + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi + +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + +AC_SUBST(USE_OLD_MAKERULES) +AC_SUBST(USE_GNAT_PROJECTS) +AC_SUBST(USE_GNAT_LIBRARIES) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 +dnl -------------- +dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it +dnl is noted that gnat may compile a tasking unit even for configurations which +dnl fail at runtime. +AC_DEFUN([CF_GNAT_SIGINT],[ +AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ +CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; + +package ConfTest is + + pragma Warnings (Off); -- the next pragma exists since 3.11p + pragma Unreserve_All_Interrupts; + pragma Warnings (On); + + protected Process is + procedure Stop; + function Continue return Boolean; + pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); + private + Done : Boolean := False; + end Process; + +end ConfTest;], +[package body ConfTest is + protected body Process is + procedure Stop is + begin + Done := True; + end Stop; + function Continue return Boolean is + begin + return not Done; + end Continue; + end Process; +end ConfTest;], + [cf_cv_gnat_sigint=yes], + [cf_cv_gnat_sigint=no])]) + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi +AC_SUBST(USE_GNAT_SIGINT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1574,7 +1994,7 @@ dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ -rm -f conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.ads <&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ - sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` AC_MSG_RESULT($cf_gnat_version) -case $cf_gnat_version in - 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; -esac -case $cf_gnat_version in - 3.[[1-9]]*|[[4-9]].*) - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; +case $cf_gnat_version in #(vi +3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) + cf_cv_prog_gnat_correct=no + ;; esac ]) dnl --------------------------------------------------------------------------- @@ -1679,7 +2092,7 @@ make an error test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46 +dnl CF_GPP_LIBRARY version: 10 updated: 2010/05/29 16:31:02 dnl -------------- dnl If we're trying to use g++, test if libg++ is installed (a rather common dnl problem :-). If we have the compiler but no library, we'll be able to @@ -1698,13 +2111,13 @@ esac if test "$GXX" = yes; then AC_MSG_CHECKING([for lib$cf_gpp_libname]) cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname) AC_TRY_LINK([ #include <$cf_gpp_libname/builtin.h> ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname,CXXLIBS) if test "$cf_gpp_libname" = cpp ; then AC_DEFINE(HAVE_GPP_BUILTIN_H) else @@ -1715,7 +2128,7 @@ if test "$GXX" = yes; then ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname,CXXLIBS) AC_DEFINE(HAVE_BUILTIN_H)], [cf_cxx_library=no])]) LIBS="$cf_save" @@ -1723,7 +2136,7 @@ if test "$GXX" = yes; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_VERSION version: 5 updated: 2005/08/27 09:53:42 +dnl CF_GXX_VERSION version: 6 updated: 2010/10/23 15:44:18 dnl -------------- dnl Check for version of g++ AC_DEFUN([CF_GXX_VERSION],[ @@ -1731,13 +2144,13 @@ AC_REQUIRE([AC_PROG_CPP]) GXX_VERSION=none if test "$GXX" = yes; then AC_MSG_CHECKING(version of g++) - GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown AC_MSG_RESULT($GXX_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_WARNINGS version: 5 updated: 2005/08/13 14:54:38 +dnl CF_GXX_WARNINGS version: 6 updated: 2010/08/14 18:25:37 dnl --------------- dnl Check if the compiler supports useful warning options. dnl @@ -1848,12 +2261,12 @@ then CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -f conftest* +rm -rf conftest* AC_LANG_RESTORE AC_SUBST(EXTRA_CXXFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB version: 3 updated: 2007/11/24 17:43:37 +dnl CF_HASHED_DB version: 4 updated: 2010/05/29 16:31:02 dnl ------------ dnl Look for an instance of the Berkeley hashed database. dnl @@ -1880,7 +2293,7 @@ else if test "$cf_cv_hashed_db_libs" = unknown ; then AC_MSG_ERROR(Cannot determine library for db) elif test "$cf_cv_hashed_db_libs" != default ; then - LIBS="-l$cf_cv_hashed_db_libs $LIBS" + CF_ADD_LIB($cf_cv_hashed_db_libs) fi fi ],[ @@ -1888,7 +2301,7 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB_LIBS version: 8 updated: 2008/08/04 06:18:06 +dnl CF_HASHED_DB_LIBS version: 9 updated: 2010/05/29 16:31:02 dnl ----------------- dnl Given that we have the header and version for hashed database, find the dnl library information. @@ -1900,7 +2313,7 @@ for cf_db_libs in "" db$cf_cv_hashed_db_version db-$cf_cv_hashed_db_version db ' do cf_save_libs="$LIBS" if test -n "$cf_db_libs"; then - LIBS="-l$cf_db_libs $LIBS" + CF_ADD_LIB($cf_db_libs) fi CF_MSG_LOG(checking for library "$cf_db_libs") AC_TRY_LINK([ @@ -1998,11 +2411,35 @@ done ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59 +dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 dnl -------------- -dnl Construct a search-list for a nonstandard header-file +dnl Construct a search-list of directories for a nonstandard header-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name AC_DEFUN([CF_HEADER_PATH], -[CF_SUBDIR_PATH($1,$2,include) +[ +$1= + +# 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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) + cf_header_path_list="$cf_header_path_list [$]$1" + ;; + esac + done +fi + +# add the variations for the package we are looking for +CF_SUBDIR_PATH($1,$2,include) + test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { @@ -2017,6 +2454,7 @@ test -d "$oldincludedir" && { test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" } +$1="[$]$1 $cf_header_path_list" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 @@ -2026,7 +2464,7 @@ AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40 dnl --------------- dnl Construct the list of include-options according to whether we're building dnl in the source directory or using '--srcdir=DIR' option. If we're building @@ -2034,9 +2472,9 @@ dnl with gcc, don't append the includedir if it happens to be /usr/include, dnl since that usually breaks gcc's shadow-includes. AC_DEFUN([CF_INCLUDE_DIRS], [ -CPPFLAGS="-I. -I../include $CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then - CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -2052,7 +2490,7 @@ fi AC_SUBST(CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29 +dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 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 @@ -2066,24 +2504,24 @@ dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ -ifelse($2,,INTEL_COMPILER,[$2])=no +ifelse([$2],,INTEL_COMPILER,[$2])=no -if test "$ifelse($1,,[$1],GCC)" = yes ; then +if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in 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" + 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" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif -],[ifelse($2,,INTEL_COMPILER,[$2])=yes +],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" ],[]) - ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS" - AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2])) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi @@ -2143,7 +2581,7 @@ ifdef([AC_FUNC_FSEEKO],[ ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LDFLAGS_STATIC version: 4 updated: 2008/10/18 17:58:20 +dnl CF_LDFLAGS_STATIC version: 8 updated: 2010/10/23 14:39:56 dnl ----------------- dnl Check for compiler/linker flags used to temporarily force usage of static dnl libraries. This depends on the compiler and platform. Use this to help @@ -2153,7 +2591,7 @@ AC_DEFUN([CF_LDFLAGS_STATIC],[ if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[[45]]*) #( vi + OS/2*|os2*|aix[[4]]*|solaris2.1[[0-9]]|darwin*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -2164,7 +2602,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[[45]]*) #( from ld manpage + aix[[456]]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -2179,7 +2617,7 @@ else ;; osf[[45]]*) #( from ld manpage osf4.0d, osf5.1 # alternative "-oldstyle_liblookup" (not in cc manpage) - LDFLAGS_STATIC=-noso + LDFLAGS_STATIC=-noso LDFLAGS_SHARED=-so_archive ;; solaris2*) @@ -2189,15 +2627,134 @@ else esac fi +if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" +then + AC_MSG_CHECKING(if linker supports switching between static/dynamic) + + rm -f libconftest.a + cat >conftest.$ac_ext < +int cf_ldflags_static(FILE *fp) { return fflush(fp); } +EOF + if AC_TRY_EVAL(ac_compile) ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&AC_FD_CC 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&AC_FD_CC >/dev/null + fi + rm -f conftest.* + + cf_save_LIBS="$LIBS" + + LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" + AC_TRY_LINK([ +#line __oline__ "configure" +#include +int cf_ldflags_static(FILE *fp); +],[ + return cf_ldflags_static(stdin); +],[cf_ldflags_static=yes],[cf_ldflags_static=no]) + + rm -f libconftest.* + LIBS="$cf_save_LIBS" + + AC_MSG_RESULT($cf_ldflags_static) + + if test $cf_ldflags_static != yes + then + LDFLAGS_STATIC= + LDFLAGS_SHARED= + fi +else + LDFLAGS_STATIC= + LDFLAGS_SHARED= +fi + AC_SUBST(LDFLAGS_STATIC) AC_SUBST(LDFLAGS_SHARED) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59 +dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 dnl --------------- -dnl Construct a search-list for a nonstandard library-file +dnl For the given system and compiler, find the compiler flags to pass to the +dnl loader to use the "rpath" feature. +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 + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[[2-9]].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +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) + +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 +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 +dnl --------------- +dnl Construct a search-list of directories for a nonstandard library-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name AC_DEFUN([CF_LIBRARY_PATH], -[CF_SUBDIR_PATH($1,$2,lib)])dnl +[ +$1= +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$,,'` + CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) + cf_library_path_list="$cf_library_path_list [$]$1" + ;; + esac + done +fi + +CF_SUBDIR_PATH($1,$2,lib) + +$1="$cf_library_path_list [$]$1" +])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 dnl ------------- @@ -2216,7 +2773,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59 +dnl CF_LIB_RULES version: 61 updated: 2010/10/23 16:10:30 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -2239,6 +2796,23 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi +if test -n "$TINFO_SUFFIX" ; then + case $TINFO_SUFFIX in + tw*) + TINFO_NAME="${TINFO_NAME}tw" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` + ;; + t*) + TINFO_NAME="${TINFO_NAME}t" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` + ;; + w*) + TINFO_NAME="${TINFO_NAME}w" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` + ;; + esac +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -2257,6 +2831,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${REL_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -2273,6 +2855,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -2393,6 +2983,16 @@ do if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in + tw*) + cf_libname=`echo $cf_libname | sed 's/tw$//'` + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_dir_suffix=tw + ;; + t*) + cf_libname=`echo $cf_libname | sed 's/t$//'` + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_dir_suffix=t + ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -2410,17 +3010,19 @@ do prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink-no} \ + ReLink=${cf_cv_do_relink:-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ + libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -2504,18 +3106,28 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile </dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.` test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown fi fi -rm -f conftest* +rm -rf conftest* LIBS="$cf_save_LIBS" fi ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 15 updated: 2008/09/13 11:54:48 +dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name @@ -2689,40 +3302,44 @@ dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_SUFFIX], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - case $1 in - libtool) + case $1 in #(vi + libtool) #(vi $2='.la' $3=[$]$2 ;; - normal) + normal) #(vi $2='.a' $3=[$]$2 ;; - debug) + debug) #(vi $2='_g.a' $3=[$]$2 ;; - profile) + profile) #(vi $2='_p.a' $3=[$]$2 ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[[56]]*) #(vi + $2='.a' + $3=[$]$2 + ;; + cygwin*) #(vi $2='.dll' $3='.dll.a' ;; - darwin*) + darwin*) #(vi $2='.dylib' $3=[$]$2 ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi $2='.so' $3=[$]$2 ;; - *) + *) #(vi $2='.sl' $3=[$]$2 ;; @@ -2755,7 +3372,7 @@ AC_DEFUN([CF_LIB_TYPE], test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 8 updated: 2006/12/16 12:33:30 +dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll @@ -2772,7 +3389,7 @@ int testdata[[3]] = { 123, 456, 789 }; EOF if AC_TRY_EVAL(ac_compile) ; then mv conftest.o data.o && \ - ( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null + ( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null + ( $AR $ARFLAGS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null @@ -2887,7 +3504,7 @@ AC_DEFUN([CF_MAIN_RETURN], cf_cv_main_return=return ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03 +dnl CF_MAKEFLAGS version: 14 updated: 2011/03/31 19:29:46 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. @@ -2904,10 +3521,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -2927,16 +3544,20 @@ CF_EOF AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40 +dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have dnl a monocase filesystem. AC_DEFUN([CF_MAKE_TAGS],[ AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) -AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no) + +AC_CHECK_PROGS(CTAGS, exctags ctags) +AC_CHECK_PROGS(ETAGS, exetags etags) + +AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) if test "$cf_cv_mixedcase" = yes ; then - AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) + AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) else MAKE_UPPER_TAGS=no fi @@ -2946,17 +3567,21 @@ if test "$MAKE_UPPER_TAGS" = yes ; then else MAKE_UPPER_TAGS="#" fi -AC_SUBST(MAKE_UPPER_TAGS) if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi + +AC_SUBST(CTAGS) +AC_SUBST(ETAGS) + +AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34 +dnl CF_MANPAGE_FORMAT version: 9 updated: 2010/10/23 16:10:30 dnl ----------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases: @@ -2998,7 +3623,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -3112,7 +3737,7 @@ AC_MSG_RESULT($MANPAGE_RENAMES) AC_SUBST(MANPAGE_RENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58 +dnl CF_MANPAGE_SYMLINKS version: 5 updated: 2010/07/24 17:12:40 dnl ------------------- dnl Some people expect each tool to make all aliases for manpages in the dnl man-directory. This accommodates the older, less-capable implementations @@ -3128,11 +3753,14 @@ AC_ARG_WITH(manpage-aliases, AC_MSG_RESULT($MANPAGE_ALIASES) -if test "$LN_S" = "ln -s"; then +case "x$LN_S" in #(vi +xln*) #(vi cf_use_symlinks=yes -else + ;; +*) cf_use_symlinks=no -fi + ;; +esac MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then @@ -3171,7 +3799,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29 +dnl CF_MAN_PAGES version: 39 updated: 2010/10/23 15:44:18 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -3214,7 +3842,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) #(vi +*gzip*) cf_so_strip="gz" cf_compress=gzip ;; @@ -3237,14 +3865,12 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" - INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR-/tmp}/man\$\$ +TMP=\${TMPDIR:=/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\[$]1 @@ -3282,7 +3908,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - \$MKDIRS \$cf_subdir\$section + mkdir -p \$cf_subdir\$section fi fi @@ -3302,7 +3928,7 @@ CF_EOF cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name, + s,@$cf_NAME@,$cf_name,g CF_EOF done ]) @@ -3431,8 +4057,21 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -3491,7 +4130,7 @@ chmod 755 $cf_edit_man ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10 +dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02 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 @@ -3504,13 +4143,13 @@ AC_CACHE_CHECK(if -lm needed for math functions, #include #include ], - [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)], + [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])]) if test "$cf_cv_need_libm" = yes then ifelse($1,,[ - LIBS="$LIBS -lm" + CF_ADD_LIB(m) ],[$1=-lm]) fi ]) @@ -3545,13 +4184,13 @@ fi test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 5 updated: 2006/12/16 12:33:30 +dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ -rm -f conftest* +rm -rf conftest* AC_TRY_RUN([ #include #include @@ -3590,17 +4229,17 @@ int main() ],[AC_CHECK_FUNC(mkstemp) ]) ]) -if test "$cf_cv_func_mkstemp" = yes ; then +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then AC_DEFINE(HAVE_MKSTEMP) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12 +dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ -echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49 @@ -3687,20 +4326,20 @@ AC_DEFUN([CF_OBJ_SUBDIR], esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53 +dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42 dnl ---------- dnl Provide a value for the $PATH and similar separator AC_DEFUN([CF_PATHSEP], [ case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; esac -ifelse($1,,,[$1=$PATHSEP]) - AC_SUBST(PATHSEP) +ifelse([$1],,,[$1=$PATH_SEPARATOR]) + AC_SUBST(PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59 +dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 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 @@ -3732,12 +4371,44 @@ case ".[$]$1" in #(vi $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; *) - ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10 +dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24 +dnl ------------- +dnl Check for the package-config program, unless disabled by command-line. +AC_DEFUN([CF_PKG_CONFIG], +[ +AC_MSG_CHECKING(if you want to use pkg-config) +AC_ARG_WITH(pkg-config, + [ --with-pkg-config{=path} enable/disable use of pkg-config], + [cf_pkg_config=$withval], + [cf_pkg_config=yes]) +AC_MSG_RESULT($cf_pkg_config) + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + AC_PATH_TOOL(PKG_CONFIG, pkg-config, none) + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + CF_PATH_SYNTAX(PKG_CONFIG) +fi + +AC_SUBST(PKG_CONFIG) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -3753,7 +4424,7 @@ dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ -cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1) +cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -3805,17 +4476,12 @@ make an error if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56 +dnl CF_PREDEFINE version: 2 updated: 2010/05/26 16:44:57 dnl ------------ dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles. dnl @@ -3832,7 +4498,7 @@ make an error AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then - CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])" + CPPFLAGS="$CPPFLAGS ifelse([$2],,-D$1,[-D$1=$2])" elif test "x$2" != "x" ; then AC_MSG_CHECKING(checking for compatible value versus $2) AC_TRY_COMPILE([#include @@ -3872,6 +4538,13 @@ done ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 +dnl ---------- +dnl Check for archiver "ar". +AC_DEFUN([CF_PROG_AR],[ +AC_CHECK_TOOL(AR, ar, ar) +]) +dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. @@ -3881,7 +4554,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC_C_O version: 2 updated: 2006/12/16 15:55:46 +dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37 dnl -------------- dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that dnl the output file can be renamed, and allows for a shell variable that can @@ -3911,7 +4584,7 @@ then else eval cf_cv_prog_$1_c_o=no fi -rm -f conftest* +rm -rf conftest* ])dnl if test $cf_cv_prog_$1_c_o = yes; then AC_MSG_RESULT([yes]) @@ -3985,6 +4658,39 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 +dnl ------------ +dnl Check for gnatmake, ensure that it is complete. +AC_DEFUN([CF_PROG_GNAT],[ +cf_ada_make=gnatmake +AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= +else + CF_GNAT_VERSION + AC_CHECK_PROG(M4_exists, m4, yes, no) + if test "$ac_cv_prog_M4_exists" = no; then + cf_cv_prog_gnat_correct=no + echo Ada95 binding required program m4 not found. Ada95 binding disabled. + fi + if test "$cf_cv_prog_gnat_correct" = yes; then + AC_MSG_CHECKING(if GNAT works) + CF_GNAT_TRY_RUN([procedure conftest;], +[with Text_IO; +with GNAT.OS_Lib; +procedure conftest is +begin + Text_IO.Put ("Hello World"); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (0); +end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) + AC_MSG_RESULT($cf_cv_prog_gnat_correct) + fi +fi + +AC_SUBST(cf_ada_make) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 dnl --------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -4003,7 +4709,7 @@ case $INSTALL in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55 +dnl CF_PROG_LDCONFIG version: 2 updated: 2008/12/13 14:08:40 dnl ---------------- dnl Check for ldconfig, needed to fixup shared libraries that would be built dnl and then used in the install. @@ -4012,7 +4718,7 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -freebsd*) #(vi +dragonfly*|freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin @@ -4023,49 +4729,117 @@ fi AC_SUBST(LDCONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 1 updated: 2006/09/16 11:40:59 +dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ -AC_CHECK_PROGS(LINT, tdlint lint alint) +AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01 +dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 +dnl ------------ +dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" +dnl option if it is supported. +AC_DEFUN([CF_PROG_LN_S],[ +AC_PROG_LN_S +AC_MSG_CHECKING(if $LN_S -f options work) + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +AC_MSG_RESULT($cf_prog_ln_sf) + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REGEX version: 8 updated: 2010/08/07 14:09:44 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression dnl code that we can support. AC_DEFUN([CF_REGEX], [ -AC_MSG_CHECKING([for regular-expression headers]) -AC_CACHE_VAL(cf_cv_regex,[ -AC_TRY_LINK([#include -#include ],[ - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - ],[cf_cv_regex="regex.h"],[ - AC_TRY_LINK([#include ],[ - char *p = compile("", "", "", 0); - int x = step("", ""); - ],[cf_cv_regex="regexp.h"],[ - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" - AC_TRY_LINK([#include ],[ - char *p = compile("", "", ""); - int x = step("", ""); - ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])]) + +cf_regex_func=no + +cf_regex_libs="regex re" +case $host_os in #(vi +mingw*) + cf_regex_libs="regex.dll $cf_regex_libs" + ;; +esac + +AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ + for cf_regex_lib in $cf_regex_libs + do + AC_CHECK_LIB($cf_regex_lib,regcomp,[ + CF_ADD_LIB($cf_regex_lib) + cf_regex_func=regcomp + break]) + done ]) -AC_MSG_RESULT($cf_cv_regex) -case $cf_cv_regex in - regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; - regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; - regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; + +if test "$cf_regex_func" = no ; then + AC_CHECK_FUNC(compile,[cf_regex_func=compile],[ + AC_CHECK_LIB(gen,compile,[ + CF_ADD_LIB(gen) + cf_regex_func=compile])]) +fi + +if test "$cf_regex_func" = no ; then + AC_MSG_WARN(cannot find regular expression library) +fi + +AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[ + +cf_cv_regex_hdrs=no +case $cf_regex_func in #(vi +compile) #(vi + for cf_regex_hdr in regexp.h regexpr.h + do + AC_TRY_LINK([#include <$cf_regex_hdr>],[ + char *p = compile("", "", "", 0); + int x = step("", ""); + ],[ + cf_cv_regex_hdrs=$cf_regex_hdr + break + ]) + done + ;; +*) + for cf_regex_hdr in regex.h + do + AC_TRY_LINK([#include +#include <$cf_regex_hdr>],[ + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + ],[ + cf_cv_regex_hdrs=$cf_regex_hdr + break + ]) + done + ;; +esac + +]) + +case $cf_cv_regex_hdrs in #(vi + no) AC_MSG_WARN(no regular expression header found) ;; #(vi + regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; #(vi + regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; #(vi + regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18 +dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all @@ -4077,10 +4851,9 @@ dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ -# remove $3 symbol from $2 $1=`echo "$2" | \ - sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \ - -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` + sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 @@ -4096,58 +4869,122 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK version: 4 updated: 2008/09/13 12:53:26 +dnl CF_RPATH_HACK version: 9 updated: 2011/02/13 13:31:33 dnl ------------- AC_DEFUN([CF_RPATH_HACK], [ -AC_REQUIRE([CF_SHARED_OPTS]) +AC_REQUIRE([CF_LD_RPATH_OPT]) AC_MSG_CHECKING(for updated LDFLAGS) -if test -n "$LDFLAGS" ; then -AC_MSG_RESULT(maybe) -CF_VERBOSE(...checking LDFLAGS $LDFLAGS) -CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) -case "$EXTRA_LDFLAGS" in #(vi --Wl,-rpath,*) #(vi - cf_rpath_hack="-Wl,-rpath," - ;; --R\ *) - cf_rpath_hack="-R " - ;; --R*) - cf_rpath_hack="-R" - ;; -*) - cf_rpath_hack= - ;; -esac -if test -n "$cf_rpath_hack" ; then - cf_rpath_dst= - for cf_rpath_src in $LDFLAGS - do - CF_VERBOSE(Filtering $cf_rpath_src) - case $cf_rpath_src in #(vi - -L*) #(vi - if test "$cf_rpath_hack" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` - fi - CF_VERBOSE(...Filter $cf_rpath_tmp) - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" - done - LDFLAGS=$cf_rpath_dst - CF_VERBOSE(...checked LDFLAGS $LDFLAGS) +if test -n "$LD_RPATH_OPT" ; then + AC_MSG_RESULT(maybe) + + AC_CHECK_PROGS(cf_ldd_prog,ldd,no) + cf_rpath_list="/usr/lib /lib" + if test "$cf_ldd_prog" != no + then + cf_rpath_oops= + +AC_TRY_LINK([#include ], + [printf("Hello");], + [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` + cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`]) + + # If we passed the link-test, but get a "not found" on a given library, + # this could be due to inept reconfiguration of gcc to make it only + # partly honor /usr/local/lib (or whatever). Sometimes this behavior + # is intentional, e.g., installing gcc in /usr/bin and suppressing the + # /usr/local libraries. + if test -n "$cf_rpath_oops" + then + for cf_rpath_src in $cf_rpath_oops + do + for cf_rpath_dir in \ + /usr/local \ + /usr/pkg \ + /opt/sfw + do + if test -f $cf_rpath_dir/lib/$cf_rpath_src + then + CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src) + LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" + break + fi + done + done + fi + fi + + CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) + + CF_RPATH_HACK_2(LDFLAGS) + CF_RPATH_HACK_2(LIBS) + CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS) fi -else -AC_MSG_RESULT(no) -fi +AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 53 updated: 2008/10/25 18:14:20 +dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24 +dnl --------------- +dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to +dnl EXTRA_LDFLAGS for each -L option found. +dnl +dnl $cf_rpath_list contains a list of directories to ignore. +dnl +dnl $1 = variable name to update. The LDFLAGS variable should be the only one, +dnl but LIBS often has misplaced -L options. +AC_DEFUN([CF_RPATH_HACK_2], +[ +CF_VERBOSE(...checking $1 [$]$1) + +cf_rpath_dst= +for cf_rpath_src in [$]$1 +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp) + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +$1=$cf_rpath_dst + +CF_VERBOSE(...checked $1 [$]$1) +AC_SUBST(EXTRA_LDFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4174,12 +5011,15 @@ dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + AC_REQUIRE([CF_LD_RPATH_OPT]) LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" AC_MSG_CHECKING(if release/abi version should be used for shared libs) AC_ARG_WITH(shlib-version, @@ -4218,11 +5058,17 @@ AC_DEFUN([CF_SHARED_OPTS], cf_cv_shlib_version_infix=no - case $cf_cv_system_name in - beos*) + case $cf_cv_system_name in #(vi + aix[[56]]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; - cygwin*) + cygwin*) #(vi CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' cf_cv_shlib_version=cygdll @@ -4239,9 +5085,9 @@ AC_DEFUN([CF_SHARED_OPTS], EOF exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} CF_EOF - chmod +x mk_shared_lib.sh + chmod +x mk_shared_lib.sh ;; - darwin*) + darwin*) #(vi EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' @@ -4256,7 +5102,7 @@ CF_EOF LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) + hpux*) #(vi # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -4269,15 +5115,9 @@ CF_EOF # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - if test "$GCC" = yes; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" - else - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" - fi + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -4288,54 +5128,50 @@ CF_EOF fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) + linux*|gnu*|k*bsd*-gnu) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - openbsd[[2-9]].*) + openbsd[[2-9]].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - nto-qnx*|openbsd*|freebsd[[12]].*) + nto-qnx*|openbsd*|freebsd[[12]].*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) + freebsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $[@]` -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]' ;; - netbsd*) + netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -4346,37 +5182,33 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${LD} -Bshareable -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]' fi ;; - osf*|mls+*) + osf*|mls+*) #(vi # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`' - case $host_os in + case $host_os in #(vi osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@' - if test "$cf_cv_ld_rpath" = yes ; then + if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -4384,7 +5216,7 @@ CF_EOF LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) + sunos4*) #(vi # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -4392,26 +5224,32 @@ CF_EOF MK_SHARED_LIB='${LD} -assert pure-text -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) + solaris2*) #(vi # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then - CC_SHARED_OPTS='-xcode=pic32' + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break]) + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' fi ;; - sysv5uw7*|unix_sv*) + sysv5uw7*|unix_sv*) #(vi # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -4428,7 +5266,7 @@ CF_EOF case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $[@]') + *'-o $[@]') #(vi test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) @@ -4439,17 +5277,11 @@ CF_EOF esac if test -n "$cf_ld_rpath_opt" ; then - AC_MSG_CHECKING(if we need a space after rpath option) - cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_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 && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi AC_SUBST(CC_SHARED_OPTS) + AC_SUBST(LD_RPATH_OPT) AC_SUBST(LD_SHARED_OPTS) AC_SUBST(MK_SHARED_LIB) AC_SUBST(LINK_PROGS) @@ -4642,7 +5474,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 18 updated: 2005/05/28 12:58:54 +dnl CF_SRC_MODULES version: 21 updated: 2010/09/04 17:37:40 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll @@ -4717,19 +5549,28 @@ AC_SUBST(TEST_DEPS) AC_SUBST(TEST_ARG2) AC_SUBST(TEST_DEP2) -SRC_SUBDIRS="man include" +SRC_SUBDIRS= +if test "x$cf_with_manpages" != xno ; then + SRC_SUBDIRS="$SRC_SUBDIRS man" +fi +SRC_SUBDIRS="$SRC_SUBDIRS include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS test" +if test "x$cf_with_tests" != "xno" ; then + SRC_SUBDIRS="$SRC_SUBDIRS test" +fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src" + if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" + fi fi SUB_MAKEFILES= @@ -4739,15 +5580,15 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done - AC_SUBST(ADA_SUBDIRS) + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done + AC_SUBST(ADA_SUBDIRS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52 +dnl CF_STDCPP_LIBRARY version: 7 updated: 2010/05/29 16:31:02 dnl ----------------- dnl Check for -lstdc++, which is GNU's standard C++ library. AC_DEFUN([CF_STDCPP_LIBRARY], @@ -4763,7 +5604,7 @@ os2*) #(vi esac AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + CF_ADD_LIB($cf_stdcpp_libname) AC_TRY_LINK([ #include ],[ char buf[80]; @@ -4773,7 +5614,7 @@ strstreambuf foo(buf, sizeof(buf)) [cf_cv_libstdcpp=no]) LIBS="$cf_save" ]) -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CF_ADD_LIB($cf_stdcpp_libname,CXXLIBS) fi ])dnl dnl --------------------------------------------------------------------------- @@ -4846,14 +5687,15 @@ if test "$ac_cv_header_termios_h" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12 +dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], -[$1="" +[ +$1= CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) @@ -5048,7 +5890,7 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52 +dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], @@ -5070,10 +5912,40 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H) CF_ADD_INCDIR($cf_cv_header_path_utf8) CF_ADD_LIBDIR($cf_cv_library_path_utf8) - LIBS="-lutf8 $LIBS" + CF_ADD_LIBS($cf_cv_library_file_utf8) fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29 +dnl ---------- +dnl check for va_copy, part of stdarg.h +dnl Also, workaround for glibc's __va_copy, by checking for both. +AC_DEFUN([CF_VA_COPY],[ +AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + va_copy(dst, src)], + cf_cv_have_va_copy=yes, + cf_cv_have_va_copy=no)]) + +test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY) + +AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + __va_copy(dst, src)], + cf_cv_have___va_copy=yes, + cf_cv_have___va_copy=no)]) + +test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY) +]) +dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings @@ -5082,7 +5954,7 @@ AC_DEFUN([CF_VERBOSE], CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20 +dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57 dnl ------------- dnl Check if type wide-character type $1 is declared, and if so, which header dnl file is needed. The second parameter is used to set a shell variable when @@ -5118,7 +5990,7 @@ if test "$cf_cv_$1" = yes ; then NEED_WCHAR_H=1 fi -ifelse($2,,,[ +ifelse([$2],,,[ # if we do not find $1 in either place, use substitution to provide a fallback. if test "$cf_cv_$1" = unknown ; then $2=1 @@ -5178,7 +6050,76 @@ $1_ABI=$cf_cv_abi_version ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05 +dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 +dnl -------------------- +dnl Command-line option to specify the Ada95 compiler. +AC_DEFUN([CF_WITH_ADA_COMPILER],[ +AC_MSG_CHECKING(for ada-compiler) +AC_ARG_WITH(ada-compiler, + [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], + [cf_ada_compiler=$withval], + [cf_ada_compiler=gnatmake]) +AC_SUBST(cf_ada_compiler) +AC_MSG_RESULT($cf_ada_compiler) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada includes will install. +AC_DEFUN([CF_WITH_ADA_INCLUDE],[ +AC_MSG_CHECKING(for ada-include) +CF_WITH_PATH(ada-include, + [ --with-ada-include=DIR Ada includes are in DIR], + ADA_INCLUDE, + PREFIX/share/ada/adainclude, + [$]prefix/share/ada/adainclude) +AC_SUBST(ADA_INCLUDE) +AC_MSG_RESULT($ADA_INCLUDE) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada objects will install. +AC_DEFUN([CF_WITH_ADA_OBJECTS],[ +AC_MSG_CHECKING(for ada-objects) +CF_WITH_PATH(ada-objects, + [ --with-ada-objects=DIR Ada objects are in DIR], + ADA_OBJECTS, + PREFIX/lib/ada/adalib, + [$]prefix/lib/ada/adalib) +AC_SUBST(ADA_OBJECTS) +AC_MSG_RESULT($ADA_OBJECTS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58 +dnl --------------------- +dnl Command-line option to specify if an Ada95 shared-library should be built, +dnl and optionally what its soname should be. +AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ +AC_MSG_CHECKING(if an Ada95 shared-library should be built) +AC_ARG_WITH(ada-sharedlib, + [ --with-ada-sharedlib=XX build Ada95 shared-library], + [with_ada_sharedlib=$withval], + [with_ada_sharedlib=no]) +AC_MSG_RESULT($with_ada_sharedlib) + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + +AC_SUBST(ADA_SHAREDLIB) +AC_SUBST(MAKE_ADA_SHAREDLIB) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. @@ -5189,11 +6130,11 @@ CF_NO_LEAKS_OPTION(dbmalloc, if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, - [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))]) + [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05 +dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. @@ -5204,7 +6145,7 @@ CF_NO_LEAKS_OPTION(dmalloc, if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, - [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))]) + [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- @@ -5241,7 +6182,7 @@ if test "$with_gpm" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_LIBTOOL version: 19 updated: 2008/03/29 15:46:43 +dnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24 dnl --------------- dnl Provide a configure option to incorporate libtool. Define several useful dnl symbols for the makefile rules. @@ -5261,22 +6202,23 @@ dnl elif test ! -f $ACLOCAL/libtool.m4 ; then dnl echo cannot find libtool.m4 file dnl exit 1 dnl fi -dnl +dnl dnl LOCAL=aclocal.m4 dnl ORIG=aclocal.m4.orig -dnl +dnl dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15 dnl rm -f $ORIG dnl mv $LOCAL $ORIG -dnl +dnl dnl # sed the LIBTOOL= assignment to omit the current directory? -dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL +dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL dnl cat $ORIG >>$LOCAL -dnl +dnl dnl autoconf-257 $* dnl AC_DEFUN([CF_WITH_LIBTOOL], [ +AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION]) ifdef([AC_PROG_LIBTOOL],,[ LIBTOOL= ]) @@ -5306,17 +6248,17 @@ ifdef([AC_PROG_LIBTOOL],[ AC_PROG_LIBTOOL # missing_content_AC_PROG_LIBTOOL}} ],[ - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then CF_PATH_SYNTAX(with_libtool) LIBTOOL=$with_libtool else - AC_PATH_PROG(LIBTOOL,libtool) - fi - if test -z "$LIBTOOL" ; then - AC_MSG_ERROR(Cannot find libtool) - fi + AC_PATH_PROG(LIBTOOL,libtool) + fi + if test -z "$LIBTOOL" ; then + AC_MSG_ERROR(Cannot find libtool) + fi ])dnl - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -5331,16 +6273,25 @@ ifdef([AC_PROG_LIBTOOL],[ # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. + # bug reports it might be useful to have the original string. "(" cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'` AC_MSG_RESULT($cf_cv_libtool_version) if test -z "$cf_cv_libtool_version" ; then AC_MSG_ERROR(This is not GNU libtool) fi + # special hack to add -no-undefined (which libtool should do for itself) + LT_UNDEF= + case "$cf_cv_system_name" in #(vi + cygwin*|mingw32*|uwin*|aix[[456]]) #(vi + LT_UNDEF=-no-undefined + ;; + esac + AC_SUBST([LT_UNDEF]) + # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[[5-9]]*|[[2-9]]*) + case $cf_cv_libtool_version in #(vi + 1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*) #(vi LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -5372,7 +6323,7 @@ AC_SUBST(LIB_UNINSTALL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35 +dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. @@ -5384,16 +6335,16 @@ dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], -[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl -if ifelse($5,,true,[test -n "$5"]) ; then +[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, +ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl +if ifelse([$5],,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30 +dnl CF_WITH_PATHLIST version: 7 updated: 2010/10/23 16:10:30 dnl ---------------- dnl Process an option specifying a list of colon-separated paths. dnl @@ -5407,9 +6358,9 @@ dnl AC_DEFUN([CF_WITH_PATHLIST],[ AC_REQUIRE([CF_PATHSEP]) AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl +ifelse($4,,[withval=${$3}],[withval=${$3:-ifelse($5,,$4,$5)}]))dnl -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5435,7 +6386,7 @@ AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05 +dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -5453,7 +6404,7 @@ if test "$with_pthread" != no ; then AC_MSG_CHECKING(if we can link with the pthread library) cf_save_LIBS="$LIBS" - LIBS="-lpthread $LIBS" + CF_ADD_LIB(pthread) AC_TRY_LINK([ #include ],[ @@ -5463,7 +6414,7 @@ if test "$with_pthread" != no ; then AC_MSG_RESULT($with_pthread) if test "$with_pthread" = yes ; then - LIBS="-lpthread $LIBS" + CF_ADD_LIB(pthread) AC_DEFINE(HAVE_LIBPTHREADS) else AC_MSG_ERROR(Cannot link with pthread library) @@ -5535,7 +6486,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57 +dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 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, @@ -5546,14 +6497,22 @@ 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([CF_PROG_CC_U_D]) - -cf_XOPEN_SOURCE=ifelse($1,,500,$1) -cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) +cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) +cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) +cf_xopen_source= case $host_os in #(vi -aix[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" +aix[[456]]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; +darwin[[0-8]].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -5561,15 +6520,18 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[[56]].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; -linux*|gnu*|k*bsd*-gnu) #(vi +linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi @@ -5582,16 +6544,19 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" +solaris2.1[[0-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[[1-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ @@ -5614,11 +6579,14 @@ make an error if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_ADD_CFLAGS($cf_temp_xopen_source) fi CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac + +if test -n "$cf_xopen_source" ; then + CF_ADD_CFLAGS($cf_xopen_source) +fi ]) diff --git a/announce.html.in b/announce.html.in index 1d4121ee4ff..e385204de50 100644 --- a/announce.html.in +++ b/announce.html.in @@ -1,8 +1,8 @@ - + - - -Announcing ncurses @VERSION@ - - - - - -

Announcing ncurses @VERSION@

- -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

- -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and encouraged the keepers of -Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to -ncurses.

- -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

- -The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

- -The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . - -

Release Notes

- -This release is designed to be upward compatible from ncurses 5.0 through 5.6; -very few applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.6 release. -

-Interface changes: -

    -
  • generate linkable stubs for some macros: -
    - getattrs - -
-New features and improvements: -
    -
  • library -
      -
    • new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are - reentrant, but most require either a window-level or - screen-level mutex.
      - (This is API-compatible, - but not ABI-compatible with the normal library). - -
    • add NCURSES_OPAQUE symbol to curses.h, will - use to make structs opaque in selected configurations. - -
    • add NCURSES_EXT_FUNCS and - NCURSES_EXT_COLORS symbols to curses.h to make - it simpler to tell if the extended functions and/or colors - are declared. - -
    • add wresize() to C++ binding - -
    • eliminate fixed-buffer vsprintf() calls in C++ binding. - -
    • add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - -
    • adapt mouse-handling code from menu library in form-library - -
    • improve tracing for form library, showing created forms, - fields, etc. - -
    • make $NCURSES_NO_PADDING feature work for termcap interface . - -
    • add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - -
    • several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x -
    - -
  • programs: -
      -
    • modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - -
    • several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - -
    • add adacurses-config to the Ada95 install. - -
    • modify tic -f option to format spaces as - \s to prevent them from being lost when that - is read back in unformatted strings. - -
    • The tack program is now distributed separately - from ncurses. -
    - -
  • terminal database -
      -
    • added entries: -
        -
      • Eterm-256color, - Eterm-88color and - rxvt-88color -
      • aterm -
      • konsole-256color -
      • mrxvt -
      • screen.mlterm -
      • screen.rxvt -
      • teraterm4.59 is now the primary primary - teraterm entry, renamed original to - teraterm2.3 -
      • 9term terminal -
      • Newbury Data entries -
      -
    • updated/improved entries: -
        -
      • gnome to version 2.22.3 -
      • h19, z100 -
      • konsole to version 1.6.6 -
      • mlterm, mlterm+pcfkeys -
      • xterm, and building-blocks for function-keys - to xterm patch #230. -
      -
    -
-Major bug fixes: -
    -
  • add logic to tic for cancelling strings in user-defined - capabilities - (this is needed for - current konsole terminfo entry). - -
  • modify mk-1st.awk so the generated makefile rules for - linking or installing shared libraries do not first remove the - library, in case it is in use, e.g., libncurses.so by - /bin/sh. - -
  • correct check for notimeout() in wgetch(). - -
  • fix a sign-extension bug in infocmp's repair_acsc() function. - -
  • change winnstr() to stop at the end of the line. - -
  • make Ada95 demo_panels() example work. - -
  • fix for adding a non-spacing character at the beginning of a line. - -
  • fill in extended-color pair to make colors work - for wide-characters using extended-colors. - -
  • improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - -
  • modify win_wchnstr() to ensure that only a base cell - is returned for each multi-column character. - -
  • improve waddch() and winsch() handling of - EILSEQ from mbrtowc() by using unctrl() - to display illegal bytes rather than trying to append further bytes - to make up a valid sequence. - -
  • restore curs_set() state after - endwin()/refresh() - -
  • modify keyname() to use "^X" form only if - meta() has been called, or if keyname() - is called without initializing curses, e.g., via - initscr() or newterm(). - -
  • modify unctrl() to check codes in 128-255 range versus - isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - -
  • improve resizeterm() by moving ripped-off lines, and - repainting the soft-keys. - -
  • modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - -
  • use NCURSES_MOUSE_MASK() in definition of - BUTTON_RELEASE(), etc., to make those work properly - with the --enable-ext-mouse configuration - -
  • correct some functions in Ada95 binding which were using return - value from C where none was returned. - -
  • reviewed/fixed issues reported by Coverity and Klocwork tools. -
- -Portability: -
    -
  • configure script: -
      -
    • new options: -
      - -
      --disable-big-strings -
      control whether static string tables are generated as single - large strings (to improve startup performance), or as array - of individual strings. - -
      --disable-relink -
      control whether shared libraries are relinked (during install) - when rpath is enabled. - -
      --disable-tic-depends -
      make explicit whether tic library depends on ncurses/ncursesw - library. - -
      --enable-mixed-case -
      override the configure script's check if the filesystem - supports mixed-case filenames. - This allows one to control how the terminal database - maps to the filesystem. - For filesystems that do not support mixed-case, the library - uses generate 2-character (hexadecimal) codes for the - lower-level of the filesystem terminfo database - -
      --enable-reentrant -
      builds a different flavor of the ncurses library (ncursest) - which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded support). - -
      --enable-weak-symbols -
      use weak-symbols for linking to the POSIX thread library, - and use the same soname for the ncurses shared library - as the normal library (caveat: the ABI is for the threaded - library, which makes global data accessed via functions). - -
      --with-pthread -
      build with the POSIX thread library (tested with AIX, - Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). - -
      --with-ticlib -
      build/install the tic-support functions in a separate library - -
      - -
    • improved options: -
      - -
      --enable-ext-colors -
      requires the wide-character configuration. - -
      --with-chtype -
      ignore option value "unsigned" is always added to - the type in curses.h; do the same for --with-mmask-t. - -
      --with-dmalloc -
      build-fix for redefinition of strndup. - -
      --with-hashed-db -
      accepts a parameter which is the install-prefix of a given - Berkeley Database. - -
      --with-hashed-db -
      the $LIBS environment variable overrides the search for the db - library. - -
      --without-hashed-db -
      assumed when "--disable-database" is used. - -
      - -
    - -
  • other configure/build issues: -
      -
    • build-fixes for LynxOS -
    • modify shared-library rules to allow FreeBSD 3.x to use rpath. -
    • build-fix for FreeBSD "contemporary" TTY interface. -
    • build-fixes for AIX with libtool. -
    • build-fixes for Darwin and libtool. -
    • modify BeOS-specific ifdef's to build on Haiku. -
    • corrected gcc options for building shared libraries on Solaris - and IRIX64. -
    • change shared-library configuration for OpenBSD, make rpath work. -
    • build-fixes for using libutf8, e.g., on OpenBSD 3.7 -
    • add "-e" option in ncurses/Makefile.in when generating source-files - to force earlier exit if the build environment fails unexpectedly. -
    • add support for shared libraries for QNX. -
    • change delimiter in MKlib_gen.sh from '%' to '@', to - avoid substitution by IBM xlc to '#' as part of its extensions to - digraphs. -
    - -
  • library: -
      -
    • rewrite wrapper for wcrtomb(), making it work on - Solaris. This is used in the form library to determine the length - of the buffer needed by field_buffer. -
    • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding - type for data manipulated by signal handlers. -
    • set locale in misc/ncurses-config.in since it uses a range -
    • disable GPM mouse support when $TERM does not happen to contain - "linux", since Gpm_Open() no longer limits its assertion to terminals - that it might handle, e.g., within "screen" in xterm. -
    • reset mouse file-descriptor when unloading GPM library. -
    - -
  • test programs: -
      -
    • update test programs to build/work with various UNIX curses for - comparisons. -
    -
- -

Features of Ncurses

- -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
- -The ncurses package also has many useful extensions over SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -and most EXTENDED features). -It includes many function calls not supported under SVr4 curses -(but portability of all -calls is documented so you can use the SVr4 subset only). -
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
  • Ada95 and C++ bindings. -
  • Support for mouse event reporting with X Window xterm -and FreeBSD and OS/2 console windows. -
  • Extended mouse support via Alessandro Rubini's gpm package. -
  • The function wresize() allows you to resize windows, preserving -their data. -
  • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
  • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
  • Support for 256-color terminals, such as modern xterm, when configured -using the --enable-ext-colors option. -
  • Support for 16-color terminals, such as aixterm and modern xterm. -
  • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
  • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
  • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
  • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
  • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
  • A BSD-like tset(1) utility is provided. -
  • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
  • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
  • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
  • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
  • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
  • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
  • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
  • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
- -

State of the Package

- -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

- -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -

-
cdk -
Curses Development Kit -
-http://invisible-island.net/cdk/ -
-http://www.vexus.ca/products/CDK/ -
ded -
directory-editor -
-http://invisible-island.net/ded/ -
dialog -
the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
-http://invisible-island.net/dialog/ -
lynx -
the character-screen WWW browser -
-http://lynx.isc.org/release/ -
Midnight Commander -
file manager -
-http://www.ibiblio.org/mc/ -
mutt -
mail utility -
-http://www.mutt.org/ -
ncftp -
file-transfer utility -
-http://www.ncftp.com/ -
nvi -
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
-http://www.bostic.com/vi/ -
-
pinfo -
Lynx-like info browser. -https://alioth.debian.org/projects/pinfo/ -
tin -
newsreader, supporting color, MIME -http://www.tin.org/ -
-as well as some that use ncurses for the terminfo support alone: -
-
minicom -
terminal emulator -
- -http://alioth.debian.org/projects/minicom/ -
vile -
vi-like-emacs -
-http://invisible-island.net/vile/ -
-

- -The ncurses distribution includes a selection of test programs (including -a few games). - -

Who's Who and What's What

- -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

- -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -

+
+
+
+  
+
+  Announcing ncurses @VERSION@
+  
+  
+
+
+
+  

Announcing ncurses @VERSION@

The ncurses (new curses) + library is a free software emulation of curses in System V + Release 4.0, and more. It uses terminfo format, supports pads and + color and multiple highlights and forms characters and + function-key mapping, and has all the other SYSV-curses + enhancements over BSD curses. + +

In mid-June 1995, the maintainer of 4.4BSD curses declared + that he considered 4.4BSD curses obsolete, and encouraged the + keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to + switch over to ncurses.

+ +

The ncurses code was developed under GNU/Linux. It has been in + use for some time with OpenBSD as the system curses library, and + on FreeBSD and NetBSD as an external package. It should port + easily to any ANSI/POSIX-conforming UNIX. It has even been ported + to OS/2 Warp!

+ +

The distribution includes the library and support utilities, + including a terminfo compiler tic(1), a decompiler infocmp(1), + clear(1), tput(1), tset(1), and a termcap conversion tool + captoinfo(1). Full manual pages are provided for the library and + tools.

+ +

The ncurses distribution is available via anonymous FTP at the + GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
+ + It is also available at ftp://invisible-island.net/ncurses/ .

+ +

Release Notes

This release is designed to be upward + compatible from ncurses 5.0 through 5.8; very few applications + will require recompilation, depending on the platform. These are + the highlights from the change-log since ncurses 5.8 release. +

+ This is a bug-fix release, correcting a small number of urgent problems + in the ncurses library from the 5.8 release. +

+ It also improves the Ada95 binding: +

    +
  • fixes a longstanding portability problem with its use of the + set_field_type + function. Because that function uses variable-length argument lists, + its interface with gnat does not work with certain platforms. +
  • improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. +

    Those were a proof of concept. For the 5.9 release, those + scripts are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + here. +

  • additional improvements were made for portability of the + ncurses examples, adding rpm- and dpkg-scripts for test-builds. + See + this page + for snapshots and other information. +
+ +

Features of Ncurses

The ncurses package is fully + compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are + documented).
  • + +
  • Full support for SVr4 curses features including keyboard + mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys.
  • + +
  • An emulation of the SVr4 panels library, supporting a stack + of windows with backing store, is included.
  • + +
  • An emulation of the SVr4 menus library, supporting a + uniform but flexible interface for menu programming, is + included.
  • + +
  • An emulation of the SVr4 form library, supporting data + collection through on-screen forms, is included.
  • + +
  • Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses.
  • + +
  • The utilities have options to allow you to filter terminfo + entries for use with less capable + curses/terminfo versions such + as the HP/UX and AIX ports.
  • +
The ncurses package also has many useful extensions over + SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the + X/OPEN curses specification, XSI curses (that is, it implements + all BASE level features, and most EXTENDED features). It + includes many function calls not supported under SVr4 curses + (but portability of all calls is documented so you can use the + SVr4 subset only).
  • + +
  • Unlike SVr3 curses, ncurses can write to the + rightmost-bottommost corner of the screen if your terminal has + an insert-character capability.
  • + +
  • Ada95 and C++ bindings.
  • + +
  • Support for mouse event reporting with X Window xterm and + FreeBSD and OS/2 console windows.
  • + +
  • Extended mouse support via Alessandro Rubini's gpm + package.
  • + +
  • The function wresize allows you to resize + windows, preserving their data.
  • + +
  • The function use_default_colors allows you to + use the terminal's default colors for the default color pair, + achieving the effect of transparent colors.
  • + +
  • The functions keyok and + define_key allow you to better control the use of + function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code.
  • + +
  • Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors + option.
  • + +
  • Support for 16-color terminals, such as aixterm + and modern xterm.
  • + +
  • Better cursor-movement optimization. The package now + features a cursor-local-movement computation more efficient + than either BSD's or System V's.
  • + +
  • Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables + it to make optimal use of hardware scrolling, line-insertion, + and line-deletion for screen-line movements. This algorithm is + more powerful than the 4.4BSD curses quickch + routine.
  • + +
  • Real support for terminals with the magic-cookie glitch. + The screen-update code will refrain from drawing a highlight if + the magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space + character. It will automatically shift highlight boundaries + when doing so would make it possible to draw the highlight + without changing the visual appearance of the screen.
  • + +
  • It is possible to generate the library with a list of + pre-loaded fallback entries linked to it so that it can serve + those terminal types even when no terminfo tree or termcap file + is accessible (this may be useful for support of + screen-oriented programs that must run in single-user + mode).
  • + +
  • The tic(1)/captoinfo utility provided with ncurses has the + ability to translate many termcaps from the XENIX, IBM and + AT&T extension sets.
  • + +
  • A BSD-like tset(1) utility is provided.
  • + +
  • The ncurses library and utilities will automatically read + terminfo entries from $HOME/.terminfo if it exists, and compile + to that directory if it exists and the user has no write access + to the system directory. This feature makes it easier for users + to have personal terminfo entries without giving up access to + the system terminfo directory.
  • + +
  • You may specify a path of directories to search for + compiled descriptions with the environment variable + TERMINFO_DIRS (this generalizes the feature provided by + TERMINFO under stock System V.)
  • + +
  • In terminfo source files, use capabilities may refer not + just to other entries in the same source file (as in System V) + but also to compiled entries in either the system terminfo + directory or the user's $HOME/.terminfo directory.
  • + +
  • A script (capconvert) is provided to help + BSD users transition from termcap to terminfo. It gathers the + information in a TERMCAP environment variable and/or a + ~/.termcap local entries file and converts it to an equivalent + local terminfo tree under $HOME/.terminfo.
  • + +
  • Automatic fallback to the /etc/termcap file can be compiled + in when it is not possible to build a terminfo tree. This + feature is neither fast nor cheap, you don't want to use it + unless you have to, but it's there.
  • + +
  • The table-of-entries utility toe makes it + easy for users to see exactly what terminal types are available + on the system.
  • + +
  • The library meets the XSI requirement that every macro + entry point have a corresponding function which may be linked + (and will be prototype-checked) if the macro definition is + disabled with #undef.
  • + +
  • An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface.
  • +
+ +

State of the Package

Numerous bugs present in earlier + versions have been fixed; the library is far more reliable than + it used to be. Bounds checking in many `dangerous' entry points + has been improved. The code is now type-safe according to gcc + -Wall. The library has been checked for malloc leaks and arena + corruption by the Purify memory-allocation tester. + +

The ncurses code has been tested with a wide variety of + applications including (versions starting with those noted):

+ +
+
cdk
+ +
Curses Development Kit
+ http://invisible-island.net/cdk/
+ + http://www.vexus.ca/products/CDK/
+ +
ded
+ +
directory-editor
+ http://invisible-island.net/ded/
+ +
dialog
+ +
the underlying application used in Slackware's setup, and + the basis for similar applications on GNU/Linux.
+ http://invisible-island.net/dialog/
+ +
lynx
+ +
the character-screen WWW browser
+ http://lynx.isc.org/release/
+ +
Midnight Commander
+ +
file manager
+ http://www.midnight-commander.org/
+ +
mutt
+ +
mail utility
+ http://www.mutt.org/
+ +
ncftp
+ +
file-transfer utility
+ http://www.ncftp.com/
+ +
nvi
+ +
New vi versions 1.50 are able to use ncurses versions 1.9.7 + and later.
+ https://sites.google.com/a/bostic.com/keithbostic/nvi
+
+ +
pinfo
+ +
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
+ +
tin
+ +
newsreader, supporting color, MIME http://www.tin.org/
+
as well as some that use ncurses for the terminfo support + alone: + +
+
minicom
+ +
terminal emulator
+ http://alioth.debian.org/projects/minicom/
+ +
vile
+ +
vi-like-emacs
+ http://invisible-island.net/vile/
+
+ +

The ncurses distribution includes a selection of test programs + (including a few games).

+ +

Who's Who and What's What

Zeyd Ben-Halim started it from + a previous package pcurses, written by Pavel Curtis. Eric S. + Raymond continued development. Jürgen Pfeifer wrote most of + the form and menu libraries. Ongoing work is being done by + Thomas Dickey. + Thomas Dickey acts as the maintainer for the Free Software + Foundation, which holds the copyright on ncurses. Contact the + current maintainers at bug-ncurses@gnu.org. + +

To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line:

+
              subscribe <name>@<host.domain>
-
+
-This list is open to anyone interested in helping with the development and -testing of this package.

+

This list is open to anyone interested in helping with the + development and testing of this package.

-Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . +

Beta versions of ncurses and patches to the current release + are made available at ftp://invisible-island.net/ncurses/ .

-

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. +

Future Plans

-

Other Related Resources

+
    +
  • Extended-level XPG4 conformance, with internationalization + support.
  • -The distribution provides a newer version of the terminfo-format -terminal description file once maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file, and provides several user-definable extensions -beyond the X/Open specification.

    +

  • Ports to more systems, including DOS and Windows.
  • +
We need people to help with these projects. If you are + interested in working on them, please join the ncurses list. -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - +

Other Related Resources

The distribution provides a newer + version of the terminfo-format terminal description file once + maintained by Eric + Raymond . Unlike the older version, the termcap and + terminfo data are provided in the same file, and provides several + user-definable extensions beyond the X/Open specification. + +

You can find lots of information on terminal-related topics + not covered in the terminfo file at + Richard Shuford's archive .

+ + diff --git a/config.guess b/config.guess index c7607c74f1b..bec935b96fc 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-04-14' +timestamp='2010-09-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2008-04-14' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -91,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +trap 'exit 1' HUP INT TERM # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -105,7 +106,7 @@ trap 'exit 1' 1 2 15 set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -219,11 +220,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -295,7 +296,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -324,14 +325,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -375,23 +395,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -461,8 +481,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -532,7 +552,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -575,8 +595,8 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 @@ -640,7 +660,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -711,22 +731,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -750,14 +770,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -785,27 +805,30 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -835,10 +858,24 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ + grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else @@ -855,7 +892,18 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -866,75 +914,34 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -943,14 +950,17 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -958,6 +968,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -965,68 +978,8 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1034,11 +987,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1055,7 +1008,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1070,7 +1023,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1098,10 +1051,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1136,8 +1092,18 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1150,7 +1116,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1171,9 +1137,9 @@ EOF fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1203,7 +1169,7 @@ EOF else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1243,6 +1209,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1250,14 +1226,17 @@ EOF *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1303,13 +1282,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1324,6 +1303,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/config.sub b/config.sub index a649350a6ca..de11910f0b1 100755 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-06-16' +timestamp='2010-09-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2008-06-16' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,8 +124,10 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -148,10 +154,13 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -249,6 +258,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -270,28 +280,41 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be\ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -306,8 +329,8 @@ case $basic_machine in # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; + basic_machine=$basic_machine-pc + ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 @@ -322,7 +345,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -331,9 +354,10 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -355,27 +379,30 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -397,7 +424,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -443,6 +470,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,11 +490,24 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -711,6 +755,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -815,6 +862,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -1049,17 +1102,10 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu ;; tile*) basic_machine=tile-unknown @@ -1140,6 +1186,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1178,7 +1228,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1225,9 +1275,12 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1248,10 +1301,11 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1262,7 +1316,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1270,7 +1325,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1309,7 +1364,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1358,7 +1413,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1403,6 +1458,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1425,10 +1482,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1440,8 +1497,17 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1468,7 +1534,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1495,7 +1561,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) @@ -1600,7 +1666,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff --git a/configure b/configure index 1342387ce63..639b790dc3a 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.454 . +# From configure.in Revision: 1.520 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20080325. +# Generated by Autoconf 2.52.20101002. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -697,8 +697,12 @@ Optional Features: --without-cxx do not adjust ncurses bool to match C++ --without-cxx-binding do not build C++ binding and demo --without-ada suppress check for Ada95, don't build demo + --without-manpages suppress install of manpages --without-progs suppress build with programs (e.g., tic) + --without-tests suppress build with test-programs --without-curses-h install curses.h as ncurses.h only + --with-pkg-config{=path} enable/disable use of pkg-config + --enable-pc-files generate and install .pc files for pkg-config --enable-mixed-case tic should assume mixed-case filenames --with-install-prefix prefixes actual install-location ($DESTDIR) Build-Tools Needed to Compile Temporary Applications for Cross-compiling: @@ -709,6 +713,7 @@ Build-Tools Needed to Compile Temporary Applications for Cross-compiling: --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS) --with-build-libs=XXX the build libraries (${BUILD_LIBS}) Options to Specify the Libraries Built/Used: + --disable-libtool-version enable to use libtool's incompatible naming scheme --with-libtool generate libraries with libtool --with-shared generate shared-libraries --with-normal generate normal-libraries (default) @@ -722,6 +727,7 @@ Options to Specify the Libraries Built/Used: --enable-rpath use rpath option when generating shared libraries --disable-relink relink shared libraries during install --with-shlib-version=X Specify rel or abi version for shared libs + --disable-rpath-hack don't add rpath options for additional libraries Fine-Tuning Your Configuration: --disable-overwrite leave out the link to -lcurses --disable-database do not use terminfo, only fallbacks/termcap @@ -752,6 +758,7 @@ Fine-Tuning Your Configuration: --with-chtype=TYPE override type of chtype --with-ospeed=TYPE override type of ospeed variable --with-mmask-t=TYPE override type of mmask_t + --with-ccharw-max=XXX override size CCHARW_MAX --with-rcs-ids compile-in RCS identifiers Options to Specify How Manpages are Installed: --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and @@ -762,6 +769,8 @@ Options to Specify How Manpages are Installed: --with-manpage-tbl specify manpage processing with tbl Extensions: --disable-ext-funcs disable function-extensions + --enable-sp-funcs enable experimental SCREEN-extensions + --enable-term-driver enable experimental terminal-driver --enable-const compile with extra/non-standard const --enable-ext-colors compile for 256-color support --enable-ext-mouse compile for extended mouse-encoding @@ -776,10 +785,13 @@ Development Code: Experimental Code: --disable-assumed-color do not assume anything about default-colors --disable-hashmap compile without hashmap scrolling-optimization - --enable-colorfgbg compile with $COLORFGBG code + --enable-colorfgbg compile-in experimental $COLORFGBG code + --enable-interop compile-in experimental interop bindings --with-pthread use POSIX thread library + --enable-pthreads-eintr enable EINTR in wgetch with pthreads --enable-weak-symbols enable weak-symbols for pthreads --enable-reentrant compile with experimental reentrant code + --with-wrap-prefix=XXX override prefix used for public variables --enable-safe-sprintf compile with experimental safe-sprintf code --disable-scroll-hints compile without scroll-hints code --enable-wgetch-events compile with experimental wgetch-events code @@ -796,8 +808,9 @@ Testing/development Options: --with-trace test: add trace() function to all models of ncurses Ada95 Binding Options: --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake) - --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/lib/ada/adainclude) + --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/share/ada/adainclude) --with-ada-objects=DIR Ada objects are in DIR (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib=XX build Ada95 shared-library Some influential environment variables: CC C compiler command @@ -870,7 +883,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.20080325. Invocation command line was +generated by GNU Autoconf 2.52.20101002. Invocation command line was $ $0 $@ @@ -994,7 +1007,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:997: loading site script $ac_site_file" >&5 + { echo "$as_me:1010: 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" @@ -1005,7 +1018,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:1008: loading cache $cache_file" >&5 + { echo "$as_me:1021: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -1013,7 +1026,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:1016: creating cache $cache_file" >&5 + { echo "$as_me:1029: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1029,21 +1042,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:1032: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:1045: 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:1036: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:1049: 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:1042: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:1055: 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:1044: former value: $ac_old_val" >&5 + { echo "$as_me:1057: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:1046: current value: $ac_new_val" >&5 + { echo "$as_me:1059: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -1062,9 +1075,9 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:1065: error: changes in the environment can compromise the build" >&5 + { echo "$as_me:1078: 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:1067: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:1080: 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 @@ -1085,10 +1098,10 @@ esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:1088: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:1101: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:1091: \$? = $ac_status" >&5 + echo "$as_me:1104: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else @@ -1101,7 +1114,7 @@ ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg. top_builddir=`pwd` -echo "$as_me:1104: checking for egrep" >&5 +echo "$as_me:1117: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1111,11 +1124,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:1114: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:1127: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:1118: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:1131: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -1125,7 +1138,7 @@ NCURSES_PATCH="`$ac_cv_prog_egrep '^NCURSES_PATCH[ ]*=' $srcdir/dist.mk | sed - cf_cv_abi_version=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} cf_cv_timestamp=`date` -echo "$as_me:1128: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "$as_me:1141: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 @@ -1133,7 +1146,7 @@ test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 # Check whether --with-rel-version or --without-rel-version was given. if test "${with_rel_version+set}" = set; then withval="$with_rel_version" - { echo "$as_me:1136: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 + { echo "$as_me:1149: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 echo "$as_me: WARNING: overriding release version $cf_cv_rel_version to $withval" >&2;} cf_cv_rel_version=$withval fi; @@ -1146,13 +1159,13 @@ if test -n "$NCURSES_MAJOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1149: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 + { { echo "$as_me:1162: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 echo "$as_me: error: Release major-version is not a number: $NCURSES_MAJOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1155: error: Release major-version value is empty" >&5 + { { echo "$as_me:1168: error: Release major-version value is empty" >&5 echo "$as_me: error: Release major-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1162,13 +1175,13 @@ if test -n "$NCURSES_MINOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1165: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 + { { echo "$as_me:1178: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 echo "$as_me: error: Release minor-version is not a number: $NCURSES_MINOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1171: error: Release minor-version value is empty" >&5 + { { echo "$as_me:1184: error: Release minor-version value is empty" >&5 echo "$as_me: error: Release minor-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1178,7 +1191,7 @@ test -z "$cf_cv_abi_version" && cf_cv_abi_version=0 # Check whether --with-abi-version or --without-abi-version was given. if test "${with_abi_version+set}" = set; then withval="$with_abi_version" - { echo "$as_me:1181: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 + { echo "$as_me:1194: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 echo "$as_me: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&2;} cf_cv_abi_version=$withval fi; @@ -1188,13 +1201,13 @@ if test -n "$cf_cv_abi_version" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1191: error: ABI version is not a number: $cf_cv_abi_version" >&5 + { { echo "$as_me:1204: error: ABI version is not a number: $cf_cv_abi_version" >&5 echo "$as_me: error: ABI version is not a number: $cf_cv_abi_version" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1197: error: ABI version value is empty" >&5 + { { echo "$as_me:1210: error: ABI version value is empty" >&5 echo "$as_me: error: ABI version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1216,7 +1229,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1219: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1232: 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 @@ -1226,11 +1239,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:1229: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1242: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1233: checking build system type" >&5 +echo "$as_me:1246: 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 @@ -1239,23 +1252,23 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1242: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1255: 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:1246: error: $ac_config_sub $ac_cv_build_alias failed." >&5 + { { echo "$as_me:1259: 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:1251: result: $ac_cv_build" >&5 +echo "$as_me:1264: 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/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:1258: checking host system type" >&5 +echo "$as_me:1271: 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 @@ -1264,12 +1277,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:1267: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { echo "$as_me:1280: 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:1272: result: $ac_cv_host" >&5 +echo "$as_me:1285: 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/'` @@ -1277,7 +1290,7 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1280: checking target system type" >&5 + echo "$as_me:1293: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1286,12 +1299,12 @@ else test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1289: error: $ac_config_sub $ac_cv_target_alias failed" >&5 + { { echo "$as_me:1302: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1294: result: $ac_cv_target" >&5 +echo "$as_me:1307: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1322,13 +1335,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1325: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1338: 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:1329: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1342: 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:1331: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1344: 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 @@ -1336,7 +1349,7 @@ fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" - { echo "$as_me:1339: WARNING: overriding system type to $withval" >&5 + { echo "$as_me:1352: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval fi; @@ -1346,7 +1359,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location -echo "$as_me:1349: checking for prefix" >&5 +echo "$as_me:1362: checking for prefix" >&5 echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in @@ -1358,11 +1371,11 @@ if test "x$prefix" = "xNONE" ; then ;; esac fi -echo "$as_me:1361: result: $prefix" >&5 +echo "$as_me:1374: result: $prefix" >&5 echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then -echo "$as_me:1365: checking for default include-directory" >&5 +echo "$as_me:1378: checking for default include-directory" >&5 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ @@ -1385,7 +1398,7 @@ do fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done -echo "$as_me:1388: result: $includedir" >&5 +echo "$as_me:1401: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 fi @@ -1399,7 +1412,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:1402: checking for $ac_word" >&5 +echo "$as_me:1415: 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 @@ -1414,7 +1427,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:1417: found $ac_dir/$ac_word" >&5 +echo "$as_me:1430: found $ac_dir/$ac_word" >&5 break done @@ -1422,10 +1435,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1425: result: $CC" >&5 + echo "$as_me:1438: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1428: result: no" >&5 + echo "$as_me:1441: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1434,7 +1447,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:1437: checking for $ac_word" >&5 +echo "$as_me:1450: 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 @@ -1449,7 +1462,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:1452: found $ac_dir/$ac_word" >&5 +echo "$as_me:1465: found $ac_dir/$ac_word" >&5 break done @@ -1457,10 +1470,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1460: result: $ac_ct_CC" >&5 + echo "$as_me:1473: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1463: result: no" >&5 + echo "$as_me:1476: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1473,7 +1486,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:1476: checking for $ac_word" >&5 +echo "$as_me:1489: 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 @@ -1488,7 +1501,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:1491: found $ac_dir/$ac_word" >&5 +echo "$as_me:1504: found $ac_dir/$ac_word" >&5 break done @@ -1496,10 +1509,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1499: result: $CC" >&5 + echo "$as_me:1512: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1502: result: no" >&5 + echo "$as_me:1515: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1508,7 +1521,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:1511: checking for $ac_word" >&5 +echo "$as_me:1524: 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 @@ -1523,7 +1536,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:1526: found $ac_dir/$ac_word" >&5 +echo "$as_me:1539: found $ac_dir/$ac_word" >&5 break done @@ -1531,10 +1544,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1534: result: $ac_ct_CC" >&5 + echo "$as_me:1547: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1537: result: no" >&5 + echo "$as_me:1550: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1547,7 +1560,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:1550: checking for $ac_word" >&5 +echo "$as_me:1563: 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 @@ -1567,7 +1580,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1570: found $ac_dir/$ac_word" >&5 +echo "$as_me:1583: found $ac_dir/$ac_word" >&5 break done @@ -1589,10 +1602,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1592: result: $CC" >&5 + echo "$as_me:1605: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1595: result: no" >&5 + echo "$as_me:1608: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1603,7 +1616,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:1606: checking for $ac_word" >&5 +echo "$as_me:1619: 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 @@ -1618,7 +1631,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:1621: found $ac_dir/$ac_word" >&5 +echo "$as_me:1634: found $ac_dir/$ac_word" >&5 break done @@ -1626,10 +1639,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1629: result: $CC" >&5 + echo "$as_me:1642: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1632: result: no" >&5 + echo "$as_me:1645: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1642,7 +1655,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:1645: checking for $ac_word" >&5 +echo "$as_me:1658: 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 @@ -1657,7 +1670,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:1660: found $ac_dir/$ac_word" >&5 +echo "$as_me:1673: found $ac_dir/$ac_word" >&5 break done @@ -1665,10 +1678,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1668: result: $ac_ct_CC" >&5 + echo "$as_me:1681: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1671: result: no" >&5 + echo "$as_me:1684: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1680,32 +1693,32 @@ fi fi -test -z "$CC" && { { echo "$as_me:1683: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1696: 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:1688:" \ +echo "$as_me:1701:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1691: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:1704: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:1694: \$? = $ac_status" >&5 + echo "$as_me:1707: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1696: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:1709: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:1699: \$? = $ac_status" >&5 + echo "$as_me:1712: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1701: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:1714: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:1704: \$? = $ac_status" >&5 + echo "$as_me:1717: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1708 "configure" +#line 1721 "configure" #include "confdefs.h" int @@ -1721,13 +1734,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:1724: checking for C compiler default output" >&5 +echo "$as_me:1737: 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:1727: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:1740: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1730: \$? = $ac_status" >&5 + echo "$as_me:1743: \$? = $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 @@ -1736,7 +1749,7 @@ for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; @@ -1750,34 +1763,34 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1753: error: C compiler cannot create executables" >&5 +{ { echo "$as_me:1766: 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:1759: result: $ac_file" >&5 +echo "$as_me:1772: 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:1764: checking whether the C compiler works" >&5 +echo "$as_me:1777: 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:1770: \"$ac_try\"") >&5 + { (eval echo "$as_me:1783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1773: \$? = $ac_status" >&5 + echo "$as_me:1786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1780: error: cannot run C compiled programs. + { { echo "$as_me:1793: 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;} @@ -1785,24 +1798,24 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1788: result: yes" >&5 +echo "$as_me:1801: 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:1795: checking whether we are cross compiling" >&5 +echo "$as_me:1808: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1797: result: $cross_compiling" >&5 +echo "$as_me:1810: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1800: checking for executable suffix" >&5 +echo "$as_me:1813: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1805: \$? = $ac_status" >&5 + echo "$as_me:1818: \$? = $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 @@ -1810,7 +1823,7 @@ if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -1818,25 +1831,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1821: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1834: 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:1827: result: $ac_cv_exeext" >&5 +echo "$as_me:1840: 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:1833: checking for object suffix" >&5 +echo "$as_me:1846: 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 1839 "configure" +#line 1852 "configure" #include "confdefs.h" int @@ -1848,14 +1861,14 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1851: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1854: \$? = $ac_status" >&5 + echo "$as_me:1867: \$? = $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 - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1863,24 +1876,24 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1866: error: cannot compute OBJEXT: cannot compile" >&5 +{ { echo "$as_me:1879: 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:1873: result: $ac_cv_objext" >&5 +echo "$as_me:1886: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1877: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1890: 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 1883 "configure" +#line 1896 "configure" #include "confdefs.h" int @@ -1895,16 +1908,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1911: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1901: \$? = $ac_status" >&5 + echo "$as_me:1914: \$? = $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:1917: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1907: \$? = $ac_status" >&5 + echo "$as_me:1920: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -1916,19 +1929,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1919: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1932: 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:1925: checking whether $CC accepts -g" >&5 +echo "$as_me:1938: 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 1931 "configure" +#line 1944 "configure" #include "confdefs.h" int @@ -1940,16 +1953,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1943: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1956: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1946: \$? = $ac_status" >&5 + echo "$as_me:1959: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1949: \"$ac_try\"") >&5 + { (eval echo "$as_me:1962: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1952: \$? = $ac_status" >&5 + echo "$as_me:1965: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -1959,7 +1972,7 @@ ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1962: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1975: 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 @@ -1986,16 +1999,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1992: \$? = $ac_status" >&5 + echo "$as_me:2005: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1995: \"$ac_try\"") >&5 + { (eval echo "$as_me:2008: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1998: \$? = $ac_status" >&5 + echo "$as_me:2011: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -2007,7 +2020,7 @@ if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2010 "configure" +#line 2023 "configure" #include "confdefs.h" #include $ac_declaration @@ -2020,16 +2033,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2023: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2036: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2026: \$? = $ac_status" >&5 + echo "$as_me:2039: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2029: \"$ac_try\"") >&5 + { (eval echo "$as_me:2042: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2032: \$? = $ac_status" >&5 + echo "$as_me:2045: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2039,7 +2052,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2042 "configure" +#line 2055 "configure" #include "confdefs.h" $ac_declaration int @@ -2051,16 +2064,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2054: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2067: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2057: \$? = $ac_status" >&5 + echo "$as_me:2070: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2060: \"$ac_try\"") >&5 + { (eval echo "$as_me:2073: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2063: \$? = $ac_status" >&5 + echo "$as_me:2076: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -2069,7 +2082,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -f conftest* +rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -2090,11 +2103,11 @@ ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:2093: checking version of $CC" >&5 + echo "$as_me:2106: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 - GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:2097: result: $GCC_VERSION" >&5 + echo "$as_me:2110: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi @@ -2104,7 +2117,7 @@ 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:2107: checking how to run the C preprocessor" >&5 +echo "$as_me:2120: 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 @@ -2125,18 +2138,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 2128 "configure" +#line 2141 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2133: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2146: \"$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:2139: \$? = $ac_status" >&5 + echo "$as_me:2152: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2159,17 +2172,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 2162 "configure" +#line 2175 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2179: \"$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:2172: \$? = $ac_status" >&5 + echo "$as_me:2185: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2206,7 +2219,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:2209: result: $CPP" >&5 +echo "$as_me:2222: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2216,18 +2229,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 2219 "configure" +#line 2232 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2224: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2237: \"$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:2230: \$? = $ac_status" >&5 + echo "$as_me:2243: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2250,17 +2263,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 2253 "configure" +#line 2266 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2257: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2270: \"$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:2263: \$? = $ac_status" >&5 + echo "$as_me:2276: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2288,7 +2301,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2291: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2304: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2301,14 +2314,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:2304: checking whether $CC needs -traditional" >&5 + echo "$as_me:2317: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line 2311 "configure" +#line 2324 "configure" #include "confdefs.h" #include int Autoconf = TIOCGETP; @@ -2319,11 +2332,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_prog_gcc_traditional=no fi -rm -f conftest* +rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line 2326 "configure" +#line 2339 "configure" #include "confdefs.h" #include int Autoconf = TCGETA; @@ -2332,18 +2345,18 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* +rm -rf conftest* fi fi -echo "$as_me:2339: result: $ac_cv_prog_gcc_traditional" >&5 +echo "$as_me:2352: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo "$as_me:2346: checking whether $CC understands -c and -o together" >&5 +echo "$as_me:2359: checking whether $CC understands -c and -o together" >&5 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CC_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2359,38 +2372,38 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:2362: \"$ac_try\"") >&5 +if { (eval echo "$as_me:2375: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2365: \$? = $ac_status" >&5 + echo "$as_me:2378: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:2367: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:2380: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2370: \$? = $ac_status" >&5 + echo "$as_me:2383: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CC_c_o=yes else eval cf_cv_prog_CC_c_o=no fi -rm -f conftest* +rm -rf conftest* fi if test $cf_cv_prog_CC_c_o = yes; then - echo "$as_me:2381: result: yes" >&5 + echo "$as_me:2394: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2384: result: no" >&5 + echo "$as_me:2397: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:2388: checking for POSIXized ISC" >&5 +echo "$as_me:2401: checking for POSIXized ISC" >&5 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then - echo "$as_me:2393: result: yes" >&5 + echo "$as_me:2406: result: yes" >&5 echo "${ECHO_T}yes" >&6 ISC=yes # If later tests want to check for ISC. @@ -2404,13 +2417,13 @@ EOF CC="$CC -Xp" fi else - echo "$as_me:2407: result: no" >&5 + echo "$as_me:2420: result: no" >&5 echo "${ECHO_T}no" >&6 ISC= fi -echo "$as_me:2412: checking for ${CC-cc} option to accept ANSI C" >&5 -echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 +echo "$as_me:2425: checking for ${CC:-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2450,8 +2463,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2466,6 +2479,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2481,8 +2504,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2494,7 +2517,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2503,7 +2526,7 @@ if test -n "$cf_new_extra_cppflags" ; then fi cat >conftest.$ac_ext <<_ACEOF -#line 2506 "configure" +#line 2529 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2524,16 +2547,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2527: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2550: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2530: \$? = $ac_status" >&5 + echo "$as_me:2553: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2533: \"$ac_try\"") >&5 + { (eval echo "$as_me:2556: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2536: \$? = $ac_status" >&5 + echo "$as_me:2559: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else @@ -2546,7 +2569,7 @@ CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$as_me:2549: result: $cf_cv_ansi_cc" >&5 +echo "$as_me:2572: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then @@ -2568,8 +2591,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2584,6 +2607,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2599,8 +2632,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2612,7 +2645,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2629,7 +2662,7 @@ fi fi if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2632: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2665: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler @@ -2663,13 +2696,13 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -freebsd*) #(vi +dragonfly*|freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 -echo "$as_me:2672: checking for $ac_word" >&5 +echo "$as_me:2705: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2686,7 +2719,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_LDCONFIG="$ac_dir/$ac_word" - echo "$as_me:2689: found $ac_dir/$ac_word" >&5 + echo "$as_me:2722: found $ac_dir/$ac_word" >&5 break fi done @@ -2697,10 +2730,10 @@ fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then - echo "$as_me:2700: result: $LDCONFIG" >&5 + echo "$as_me:2733: result: $LDCONFIG" >&5 echo "${ECHO_T}$LDCONFIG" >&6 else - echo "$as_me:2703: result: no" >&5 + echo "$as_me:2736: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2708,7 +2741,7 @@ fi esac fi -echo "$as_me:2711: checking if you want to ensure bool is consistent with C++" >&5 +echo "$as_me:2744: checking if you want to ensure bool is consistent with C++" >&5 echo $ECHO_N "checking if you want to ensure bool is consistent with C++... $ECHO_C" >&6 # Check whether --with-cxx or --without-cxx was given. @@ -2718,7 +2751,7 @@ if test "${with_cxx+set}" = set; then else cf_with_cxx=yes fi; -echo "$as_me:2721: result: $cf_with_cxx" >&5 +echo "$as_me:2754: result: $cf_with_cxx" >&5 echo "${ECHO_T}$cf_with_cxx" >&6 if test "X$cf_with_cxx" = Xno ; then CXX="" @@ -2736,7 +2769,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:2739: checking for $ac_word" >&5 +echo "$as_me:2772: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2751,7 +2784,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_CXX="$ac_tool_prefix$ac_prog" -echo "$as_me:2754: found $ac_dir/$ac_word" >&5 +echo "$as_me:2787: found $ac_dir/$ac_word" >&5 break done @@ -2759,10 +2792,10 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:2762: result: $CXX" >&5 + echo "$as_me:2795: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:2765: result: no" >&5 + echo "$as_me:2798: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2775,7 +2808,7 @@ if test -z "$CXX"; 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:2778: checking for $ac_word" >&5 +echo "$as_me:2811: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2790,7 +2823,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_CXX="$ac_prog" -echo "$as_me:2793: found $ac_dir/$ac_word" >&5 +echo "$as_me:2826: found $ac_dir/$ac_word" >&5 break done @@ -2798,10 +2831,10 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:2801: result: $ac_ct_CXX" >&5 + echo "$as_me:2834: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else - echo "$as_me:2804: result: no" >&5 + echo "$as_me:2837: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2813,32 +2846,32 @@ test -n "$ac_ct_CXX" || ac_ct_CXX="g++" fi # Provide some information about the compiler. -echo "$as_me:2816:" \ +echo "$as_me:2849:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:2819: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:2852: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:2822: \$? = $ac_status" >&5 + echo "$as_me:2855: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2824: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:2857: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:2827: \$? = $ac_status" >&5 + echo "$as_me:2860: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2829: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:2862: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:2832: \$? = $ac_status" >&5 + echo "$as_me:2865: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:2835: checking whether we are using the GNU C++ compiler" >&5 +echo "$as_me:2868: 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_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2841 "configure" +#line 2874 "configure" #include "confdefs.h" int @@ -2853,16 +2886,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2856: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2889: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2859: \$? = $ac_status" >&5 + echo "$as_me:2892: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2862: \"$ac_try\"") >&5 + { (eval echo "$as_me:2895: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2865: \$? = $ac_status" >&5 + echo "$as_me:2898: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -2874,19 +2907,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:2877: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "$as_me:2910: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" -echo "$as_me:2883: checking whether $CXX accepts -g" >&5 +echo "$as_me:2916: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2889 "configure" +#line 2922 "configure" #include "confdefs.h" int @@ -2898,16 +2931,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2901: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2934: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2904: \$? = $ac_status" >&5 + echo "$as_me:2937: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2907: \"$ac_try\"") >&5 + { (eval echo "$as_me:2940: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2910: \$? = $ac_status" >&5 + echo "$as_me:2943: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else @@ -2917,7 +2950,7 @@ ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2920: result: $ac_cv_prog_cxx_g" >&5 +echo "$as_me:2953: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS @@ -2944,7 +2977,7 @@ for ac_declaration in \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2947 "configure" +#line 2980 "configure" #include "confdefs.h" #include $ac_declaration @@ -2957,16 +2990,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2960: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2993: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2963: \$? = $ac_status" >&5 + echo "$as_me:2996: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2966: \"$ac_try\"") >&5 + { (eval echo "$as_me:2999: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2969: \$? = $ac_status" >&5 + echo "$as_me:3002: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2976,7 +3009,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2979 "configure" +#line 3012 "configure" #include "confdefs.h" $ac_declaration int @@ -2988,16 +3021,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2991: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3024: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2994: \$? = $ac_status" >&5 + echo "$as_me:3027: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2997: \"$ac_try\"") >&5 + { (eval echo "$as_me:3030: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3000: \$? = $ac_status" >&5 + echo "$as_me:3033: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -3006,7 +3039,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -f conftest* +rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -3024,7 +3057,7 @@ ac_main_return=return if test "$CXX" = "g++" ; then # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -echo "$as_me:3027: checking for $ac_word" >&5 +echo "$as_me:3060: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3041,7 +3074,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_CXX="$ac_dir/$ac_word" - echo "$as_me:3044: found $ac_dir/$ac_word" >&5 + echo "$as_me:3077: found $ac_dir/$ac_word" >&5 break fi done @@ -3052,16 +3085,16 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - echo "$as_me:3055: result: $CXX" >&5 + echo "$as_me:3088: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:3058: result: no" >&5 + echo "$as_me:3091: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$CXX" = "g++" ; then - { echo "$as_me:3064: WARNING: ignoring hardcoded g++" >&5 + { echo "$as_me:3097: WARNING: ignoring hardcoded g++" >&5 echo "$as_me: WARNING: ignoring hardcoded g++" >&2;} cf_with_cxx=no; CXX=""; GXX=""; fi @@ -3069,11 +3102,11 @@ fi GXX_VERSION=none if test "$GXX" = yes; then - echo "$as_me:3072: checking version of g++" >&5 + echo "$as_me:3105: checking version of g++" >&5 echo $ECHO_N "checking version of g++... $ECHO_C" >&6 - GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown - echo "$as_me:3076: result: $GXX_VERSION" >&5 + echo "$as_me:3109: result: $GXX_VERSION" >&5 echo "${ECHO_T}$GXX_VERSION" >&6 fi @@ -3081,12 +3114,12 @@ case $GXX_VERSION in 1*|2.[0-6]*) # GXX=""; CXX=""; ac_cv_prog_gxx=no # cf_cxx_library=no - { echo "$as_me:3084: WARNING: templates do not work" >&5 + { echo "$as_me:3117: WARNING: templates do not work" >&5 echo "$as_me: WARNING: templates do not work" >&2;} ;; esac -echo "$as_me:3089: checking if you want to build C++ binding and demo" >&5 +echo "$as_me:3122: checking if you want to build C++ binding and demo" >&5 echo $ECHO_N "checking if you want to build C++ binding and demo... $ECHO_C" >&6 # Check whether --with-cxx-binding or --without-cxx-binding was given. @@ -3096,10 +3129,10 @@ if test "${with_cxx_binding+set}" = set; then else cf_with_cxx_binding=$cf_with_cxx fi; -echo "$as_me:3099: result: $cf_with_cxx_binding" >&5 +echo "$as_me:3132: result: $cf_with_cxx_binding" >&5 echo "${ECHO_T}$cf_with_cxx_binding" >&6 -echo "$as_me:3102: checking if you want to build with Ada95" >&5 +echo "$as_me:3135: checking if you want to build with Ada95" >&5 echo $ECHO_N "checking if you want to build with Ada95... $ECHO_C" >&6 # Check whether --with-ada or --without-ada was given. @@ -3109,10 +3142,23 @@ if test "${with_ada+set}" = set; then else cf_with_ada=yes fi; -echo "$as_me:3112: result: $cf_with_ada" >&5 +echo "$as_me:3145: result: $cf_with_ada" >&5 echo "${ECHO_T}$cf_with_ada" >&6 -echo "$as_me:3115: checking if you want to build programs such as tic" >&5 +echo "$as_me:3148: checking if you want to install manpages" >&5 +echo $ECHO_N "checking if you want to install manpages... $ECHO_C" >&6 + +# Check whether --with-manpages or --without-manpages was given. +if test "${with_manpages+set}" = set; then + withval="$with_manpages" + cf_with_manpages=$withval +else + cf_with_manpages=yes +fi; +echo "$as_me:3158: result: $cf_with_manpages" >&5 +echo "${ECHO_T}$cf_with_manpages" >&6 + +echo "$as_me:3161: checking if you want to build programs such as tic" >&5 echo $ECHO_N "checking if you want to build programs such as tic... $ECHO_C" >&6 # Check whether --with-progs or --without-progs was given. @@ -3122,10 +3168,23 @@ if test "${with_progs+set}" = set; then else cf_with_progs=yes fi; -echo "$as_me:3125: result: $cf_with_progs" >&5 +echo "$as_me:3171: result: $cf_with_progs" >&5 echo "${ECHO_T}$cf_with_progs" >&6 -echo "$as_me:3128: checking if you wish to install curses.h" >&5 +echo "$as_me:3174: checking if you want to build test-programs" >&5 +echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 + +# Check whether --with-tests or --without-tests was given. +if test "${with_tests+set}" = set; then + withval="$with_tests" + cf_with_tests=$withval +else + cf_with_tests=yes +fi; +echo "$as_me:3184: result: $cf_with_tests" >&5 +echo "${ECHO_T}$cf_with_tests" >&6 + +echo "$as_me:3187: checking if you wish to install curses.h" >&5 echo $ECHO_N "checking if you wish to install curses.h... $ECHO_C" >&6 # Check whether --with-curses-h or --without-curses-h was given. @@ -3135,7 +3194,7 @@ if test "${with_curses_h+set}" = set; then else with_curses_h=yes fi; -echo "$as_me:3138: result: $with_curses_h" >&5 +echo "$as_me:3197: result: $with_curses_h" >&5 echo "${ECHO_T}$with_curses_h" >&6 modules_to_build="ncurses" @@ -3161,7 +3220,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:3164: checking for $ac_word" >&5 +echo "$as_me:3223: 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 @@ -3176,7 +3235,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:3179: found $ac_dir/$ac_word" >&5 +echo "$as_me:3238: found $ac_dir/$ac_word" >&5 break done @@ -3184,21 +3243,21 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:3187: result: $AWK" >&5 + echo "$as_me:3246: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:3190: result: no" >&5 + echo "$as_me:3249: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done -test -z "$AWK" && { { echo "$as_me:3197: error: No awk program found" >&5 +test -z "$AWK" && { { echo "$as_me:3256: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:3201: checking for egrep" >&5 +echo "$as_me:3260: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3208,11 +3267,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:3211: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:3270: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:3215: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:3274: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -3228,7 +3287,7 @@ echo "$as_me: error: No egrep program found" >&2;} # 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:3231: checking for a BSD compatible install" >&5 +echo "$as_me:3290: 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 @@ -3277,7 +3336,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:3280: result: $INSTALL" >&5 +echo "$as_me:3339: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -3298,11 +3357,11 @@ case $INSTALL in ;; esac -for ac_prog in tdlint lint alint +for ac_prog in tdlint lint alint splint lclint 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:3305: checking for $ac_word" >&5 +echo "$as_me:3364: 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 @@ -3317,7 +3376,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:3320: found $ac_dir/$ac_word" >&5 +echo "$as_me:3379: found $ac_dir/$ac_word" >&5 break done @@ -3325,28 +3384,45 @@ fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$as_me:3328: result: $LINT" >&5 + echo "$as_me:3387: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else - echo "$as_me:3331: result: no" >&5 + echo "$as_me:3390: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done -echo "$as_me:3338: checking whether ln -s works" >&5 +echo "$as_me:3397: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:3342: result: yes" >&5 + echo "$as_me:3401: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:3345: result: no, using $LN_S" >&5 + echo "$as_me:3404: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi -echo "$as_me:3349: checking for long file names" >&5 +echo "$as_me:3408: checking if $LN_S -f options work" >&5 +echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +echo "$as_me:3420: result: $cf_prog_ln_sf" >&5 +echo "${ECHO_T}$cf_prog_ln_sf" >&6 + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" + +echo "$as_me:3425: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3385,7 +3461,7 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do rm -rf $ac_xdir 2>/dev/null done fi -echo "$as_me:3388: result: $ac_cv_sys_long_file_names" >&5 +echo "$as_me:3464: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then @@ -3395,7 +3471,182 @@ EOF fi -echo "$as_me:3398: checking if we should assume mixed-case filenames" >&5 +# if we find pkg-config, check if we should install the ".pc" files. + +echo "$as_me:3476: 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. +if test "${with_pkg_config+set}" = set; then + withval="$with_pkg_config" + cf_pkg_config=$withval +else + cf_pkg_config=yes +fi; +echo "$as_me:3486: result: $cf_pkg_config" >&5 +echo "${ECHO_T}$cf_pkg_config" >&6 + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + 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:3497: 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 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:3514: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:3525: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:3528: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +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:3537: 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 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:3554: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:3566: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:3569: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$PKG_CONFIG" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(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:3612: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 +echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi + +if test "$PKG_CONFIG" != no ; then + echo "$as_me:3621: checking if we should install .pc files for $PKG_CONFIG" >&5 +echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6 + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + +# Check whether --enable-pc-files or --disable-pc-files was given. +if test "${enable_pc_files+set}" = set; then + enableval="$enable_pc_files" + enable_pc_files=$enableval +else + enable_pc_files=no +fi; + echo "$as_me:3638: result: $enable_pc_files" >&5 +echo "${ECHO_T}$enable_pc_files" >&6 + else + echo "$as_me:3641: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:3643: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 +echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} + enable_pc_files=no + fi +fi + +echo "$as_me:3649: checking if we should assume mixed-case filenames" >&5 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 # Check whether --enable-mixed-case or --disable-mixed-case was given. @@ -3405,11 +3656,11 @@ if test "${enable_mixed_case+set}" = set; then else enable_mixedcase=auto fi; -echo "$as_me:3408: result: $enable_mixedcase" >&5 +echo "$as_me:3659: result: $enable_mixedcase" >&5 echo "${ECHO_T}$enable_mixedcase" >&6 if test "$enable_mixedcase" = "auto" ; then -echo "$as_me:3412: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:3663: 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 @@ -3436,7 +3687,7 @@ else fi fi -echo "$as_me:3439: result: $cf_cv_mixedcase" >&5 +echo "$as_me:3690: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 @@ -3453,7 +3704,7 @@ EOF fi # do this after mixed-case option (tags/TAGS is not as important as tic). -echo "$as_me:3456: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "$as_me:3707: 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 @@ -3473,18 +3724,92 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:3476: result: yes" >&5 + echo "$as_me:3727: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:3480: result: no" >&5 + echo "$as_me:3731: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi -# Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -echo "$as_me:3487: checking for $ac_word" >&5 +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:3740: 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 +else + if test -n "$CTAGS"; then + ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CTAGS="$ac_prog" +echo "$as_me:3755: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CTAGS=$ac_cv_prog_CTAGS +if test -n "$CTAGS"; then + echo "$as_me:3763: result: $CTAGS" >&5 +echo "${ECHO_T}$CTAGS" >&6 +else + echo "$as_me:3766: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CTAGS" && break +done + +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:3777: 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 +else + if test -n "$ETAGS"; then + ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ETAGS="$ac_prog" +echo "$as_me:3792: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ETAGS=$ac_cv_prog_ETAGS +if test -n "$ETAGS"; then + echo "$as_me:3800: result: $ETAGS" >&5 +echo "${ECHO_T}$ETAGS" >&6 +else + echo "$as_me:3803: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ETAGS" && break +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:3812: 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 @@ -3499,7 +3824,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:3502: found $ac_dir/$ac_word" >&5 +echo "$as_me:3827: found $ac_dir/$ac_word" >&5 break done @@ -3508,17 +3833,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:3511: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:3836: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:3514: result: no" >&5 + echo "$as_me:3839: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then - # Extract the first word of "etags", so it can be a program name with args. -set dummy etags; ac_word=$2 -echo "$as_me:3521: checking for $ac_word" >&5 + # 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:3846: 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 @@ -3533,7 +3858,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:3536: found $ac_dir/$ac_word" >&5 +echo "$as_me:3861: found $ac_dir/$ac_word" >&5 break done @@ -3542,10 +3867,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:3545: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:3870: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:3548: result: no" >&5 + echo "$as_me:3873: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3565,7 +3890,7 @@ else MAKE_LOWER_TAGS="#" fi -echo "$as_me:3568: checking for makeflags variable" >&5 +echo "$as_me:3893: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3579,10 +3904,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[ ]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -3599,13 +3924,13 @@ CF_EOF rm -f cf_makeflags.tmp fi -echo "$as_me:3602: result: $cf_cv_makeflags" >&5 +echo "$as_me:3927: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:3608: checking for $ac_word" >&5 +echo "$as_me:3933: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3620,7 +3945,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_RANLIB="${ac_tool_prefix}ranlib" -echo "$as_me:3623: found $ac_dir/$ac_word" >&5 +echo "$as_me:3948: found $ac_dir/$ac_word" >&5 break done @@ -3628,10 +3953,10 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:3631: result: $RANLIB" >&5 + echo "$as_me:3956: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else - echo "$as_me:3634: result: no" >&5 + echo "$as_me:3959: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3640,7 +3965,7 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:3643: checking for $ac_word" >&5 +echo "$as_me:3968: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3655,7 +3980,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_RANLIB="ranlib" -echo "$as_me:3658: found $ac_dir/$ac_word" >&5 +echo "$as_me:3983: found $ac_dir/$ac_word" >&5 break done @@ -3664,10 +3989,10 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:3667: result: $ac_ct_RANLIB" >&5 + echo "$as_me:3992: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$as_me:3670: result: no" >&5 + echo "$as_me:3995: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3679,7 +4004,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 -echo "$as_me:3682: checking for $ac_word" >&5 +echo "$as_me:4007: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3694,7 +4019,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_LD="${ac_tool_prefix}ld" -echo "$as_me:3697: found $ac_dir/$ac_word" >&5 +echo "$as_me:4022: found $ac_dir/$ac_word" >&5 break done @@ -3702,10 +4027,10 @@ fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$as_me:3705: result: $LD" >&5 + echo "$as_me:4030: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else - echo "$as_me:3708: result: no" >&5 + echo "$as_me:4033: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3714,7 +4039,7 @@ if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo "$as_me:3717: checking for $ac_word" >&5 +echo "$as_me:4042: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3729,7 +4054,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_LD="ld" -echo "$as_me:3732: found $ac_dir/$ac_word" >&5 +echo "$as_me:4057: found $ac_dir/$ac_word" >&5 break done @@ -3738,10 +4063,10 @@ fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then - echo "$as_me:3741: result: $ac_ct_LD" >&5 + echo "$as_me:4066: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else - echo "$as_me:3744: result: no" >&5 + echo "$as_me:4069: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3753,7 +4078,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:3756: checking for $ac_word" >&5 +echo "$as_me:4081: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3768,7 +4093,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_AR="${ac_tool_prefix}ar" -echo "$as_me:3771: found $ac_dir/$ac_word" >&5 +echo "$as_me:4096: found $ac_dir/$ac_word" >&5 break done @@ -3776,10 +4101,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:3779: result: $AR" >&5 + echo "$as_me:4104: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:3782: result: no" >&5 + echo "$as_me:4107: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3788,7 +4113,7 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:3791: checking for $ac_word" >&5 +echo "$as_me:4116: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3803,7 +4128,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_AR="ar" -echo "$as_me:3806: found $ac_dir/$ac_word" >&5 +echo "$as_me:4131: found $ac_dir/$ac_word" >&5 break done @@ -3812,10 +4137,10 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:3815: result: $ac_ct_AR" >&5 + echo "$as_me:4140: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else - echo "$as_me:3818: result: no" >&5 + echo "$as_me:4143: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3824,25 +4149,140 @@ else AR="$ac_cv_prog_AR" fi -if test "${cf_cv_subst_AR_OPTS+set}" = set; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:4155: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${ac_tool_prefix}ar" +echo "$as_me:4170: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:4178: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:4181: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:4190: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_AR="ar" +echo "$as_me:4205: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:4214: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:4217: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +echo "$as_me:4226: checking for options to update archives" >&5 +echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 +if test "${cf_cv_ar_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "$as_me:3831: checking for archiver options (symbol AR_OPTS)" >&5 -echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6 + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do -if test -z "$AR_OPTS" ; then - AR_OPTS=rv + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4255: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + test -n "$verbose" && echo " cannot compile test-program" 1>&6 + +echo "${as_me:-configure}:4266: testing cannot compile test-program ..." 1>&5 + + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext fi +echo "$as_me:4274: result: $cf_cv_ar_flags" >&5 +echo "${ECHO_T}$cf_cv_ar_flags" >&6 -cf_cv_subst_AR_OPTS=$AR_OPTS -echo "$as_me:3840: result: $AR_OPTS" >&5 -echo "${ECHO_T}$AR_OPTS" >&6 - +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags fi -echo "$as_me:3845: checking if you have specified an install-prefix" >&5 +echo "$as_me:4285: checking if you have specified an install-prefix" >&5 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. @@ -3855,7 +4295,7 @@ if test "${with_install_prefix+set}" = set; then ;; esac fi; -echo "$as_me:3858: result: $DESTDIR" >&5 +echo "$as_me:4298: result: $DESTDIR" >&5 echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### @@ -3883,7 +4323,7 @@ else 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:3886: checking for $ac_word" >&5 +echo "$as_me:4326: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3898,7 +4338,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_BUILD_CC="$ac_prog" -echo "$as_me:3901: found $ac_dir/$ac_word" >&5 +echo "$as_me:4341: found $ac_dir/$ac_word" >&5 break done @@ -3906,10 +4346,10 @@ fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - echo "$as_me:3909: result: $BUILD_CC" >&5 + echo "$as_me:4349: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else - echo "$as_me:3912: result: no" >&5 + echo "$as_me:4352: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3917,12 +4357,12 @@ fi done fi; - echo "$as_me:3920: checking for native build C compiler" >&5 + echo "$as_me:4360: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 - echo "$as_me:3922: result: $BUILD_CC" >&5 + echo "$as_me:4362: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 - echo "$as_me:3925: checking for native build C preprocessor" >&5 + echo "$as_me:4365: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. @@ -3932,10 +4372,10 @@ if test "${with_build_cpp+set}" = set; then else BUILD_CPP='${BUILD_CC} -E' fi; - echo "$as_me:3935: result: $BUILD_CPP" >&5 + echo "$as_me:4375: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 - echo "$as_me:3938: checking for native build C flags" >&5 + echo "$as_me:4378: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. @@ -3943,10 +4383,10 @@ if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; - echo "$as_me:3946: result: $BUILD_CFLAGS" >&5 + echo "$as_me:4386: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 - echo "$as_me:3949: checking for native build C preprocessor-flags" >&5 + echo "$as_me:4389: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. @@ -3954,10 +4394,10 @@ if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; - echo "$as_me:3957: result: $BUILD_CPPFLAGS" >&5 + echo "$as_me:4397: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 - echo "$as_me:3960: checking for native build linker-flags" >&5 + echo "$as_me:4400: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. @@ -3965,10 +4405,10 @@ if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; - echo "$as_me:3968: result: $BUILD_LDFLAGS" >&5 + echo "$as_me:4408: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 - echo "$as_me:3971: checking for native build linker-libraries" >&5 + echo "$as_me:4411: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. @@ -3976,7 +4416,7 @@ if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; - echo "$as_me:3979: result: $BUILD_LIBS" >&5 + echo "$as_me:4419: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. @@ -3986,7 +4426,7 @@ echo "${ECHO_T}$BUILD_LIBS" >&6 : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then - { { echo "$as_me:3989: error: Cross-build requires two compilers. + { { echo "$as_me:4429: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} @@ -4011,6 +4451,32 @@ fi ### shared, for example. cf_list_models="" +echo "$as_me:4454: checking if libtool -version-number should be used" >&5 +echo $ECHO_N "checking if libtool -version-number should be used... $ECHO_C" >&6 + +# Check whether --enable-libtool-version or --disable-libtool-version was given. +if test "${enable_libtool_version+set}" = set; then + enableval="$enable_libtool_version" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + cf_libtool_version=no + else + cf_libtool_version=yes + fi +else + enableval=yes + cf_libtool_version=yes + +fi; +echo "$as_me:4471: result: $cf_libtool_version" >&5 +echo "${ECHO_T}$cf_libtool_version" >&6 + +if test "$cf_libtool_version" = yes ; then + LIBTOOL_VERSION="-version-number" +else + LIBTOOL_VERSION="-version-info" +fi + LIBTOOL= # common library maintenance symbols that are convenient for libtool scripts: @@ -4027,7 +4493,7 @@ LIB_LINK='${CC}' LIB_INSTALL= LIB_UNINSTALL= -echo "$as_me:4030: checking if you want to build libraries with libtool" >&5 +echo "$as_me:4496: checking if you want to build libraries with libtool" >&5 echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6 # Check whether --with-libtool or --without-libtool was given. @@ -4037,11 +4503,11 @@ if test "${with_libtool+set}" = set; then else with_libtool=no fi; -echo "$as_me:4040: result: $with_libtool" >&5 +echo "$as_me:4506: result: $with_libtool" >&5 echo "${ECHO_T}$with_libtool" >&6 if test "$with_libtool" != "no"; then - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -4068,7 +4534,7 @@ case ".$with_libtool" in #(vi with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:4071: error: expected a pathname, not \"$with_libtool\"" >&5 + { { echo "$as_me:4537: error: expected a pathname, not \"$with_libtool\"" >&5 echo "$as_me: error: expected a pathname, not \"$with_libtool\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -4076,9 +4542,9 @@ esac LIBTOOL=$with_libtool else - # Extract the first word of "libtool", so it can be a program name with args. + # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 -echo "$as_me:4081: checking for $ac_word" >&5 +echo "$as_me:4547: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LIBTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4095,7 +4561,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_LIBTOOL="$ac_dir/$ac_word" - echo "$as_me:4098: found $ac_dir/$ac_word" >&5 + echo "$as_me:4564: found $ac_dir/$ac_word" >&5 break fi done @@ -4106,20 +4572,20 @@ fi LIBTOOL=$ac_cv_path_LIBTOOL if test -n "$LIBTOOL"; then - echo "$as_me:4109: result: $LIBTOOL" >&5 + echo "$as_me:4575: result: $LIBTOOL" >&5 echo "${ECHO_T}$LIBTOOL" >&6 else - echo "$as_me:4112: result: no" >&5 + echo "$as_me:4578: result: no" >&5 echo "${ECHO_T}no" >&6 fi - fi - if test -z "$LIBTOOL" ; then - { { echo "$as_me:4118: error: Cannot find libtool" >&5 + fi + if test -z "$LIBTOOL" ; then + { { echo "$as_me:4584: error: Cannot find libtool" >&5 echo "$as_me: error: Cannot find libtool" >&2;} { (exit 1); exit 1; }; } - fi - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + fi + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -4130,24 +4596,32 @@ echo "$as_me: error: Cannot find libtool" >&2;} LIB_PREP=: # Show the version of libtool - echo "$as_me:4133: checking version of libtool" >&5 + echo "$as_me:4599: checking version of libtool" >&5 echo $ECHO_N "checking version of libtool... $ECHO_C" >&6 # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. + # bug reports it might be useful to have the original string. "(" cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([^)]*)//g' -e 's/^[^1-9]*//' -e 's/[^0-9.].*//'` - echo "$as_me:4140: result: $cf_cv_libtool_version" >&5 + echo "$as_me:4606: result: $cf_cv_libtool_version" >&5 echo "${ECHO_T}$cf_cv_libtool_version" >&6 if test -z "$cf_cv_libtool_version" ; then - { { echo "$as_me:4143: error: This is not GNU libtool" >&5 + { { echo "$as_me:4609: error: This is not GNU libtool" >&5 echo "$as_me: error: This is not GNU libtool" >&2;} { (exit 1); exit 1; }; } fi + # special hack to add -no-undefined (which libtool should do for itself) + LT_UNDEF= + case "$cf_cv_system_name" in #(vi + cygwin*|mingw32*|uwin*|aix[456]) #(vi + LT_UNDEF=-no-undefined + ;; + esac + # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[5-9]*|[2-9]*) + case $cf_cv_libtool_version in #(vi + 1.[5-9]*|[2-9].[0-9.a-z]*) #(vi LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -4168,7 +4642,7 @@ cf_list_models="$cf_list_models libtool" else -echo "$as_me:4171: checking if you want to build shared libraries" >&5 +echo "$as_me:4645: checking if you want to build shared libraries" >&5 echo $ECHO_N "checking if you want to build shared libraries... $ECHO_C" >&6 # Check whether --with-shared or --without-shared was given. @@ -4178,11 +4652,11 @@ if test "${with_shared+set}" = set; then else with_shared=no fi; -echo "$as_me:4181: result: $with_shared" >&5 +echo "$as_me:4655: result: $with_shared" >&5 echo "${ECHO_T}$with_shared" >&6 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" -echo "$as_me:4185: checking if you want to build static libraries" >&5 +echo "$as_me:4659: checking if you want to build static libraries" >&5 echo $ECHO_N "checking if you want to build static libraries... $ECHO_C" >&6 # Check whether --with-normal or --without-normal was given. @@ -4192,11 +4666,11 @@ if test "${with_normal+set}" = set; then else with_normal=yes fi; -echo "$as_me:4195: result: $with_normal" >&5 +echo "$as_me:4669: result: $with_normal" >&5 echo "${ECHO_T}$with_normal" >&6 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" -echo "$as_me:4199: checking if you want to build debug libraries" >&5 +echo "$as_me:4673: checking if you want to build debug libraries" >&5 echo $ECHO_N "checking if you want to build debug libraries... $ECHO_C" >&6 # Check whether --with-debug or --without-debug was given. @@ -4206,11 +4680,11 @@ if test "${with_debug+set}" = set; then else with_debug=yes fi; -echo "$as_me:4209: result: $with_debug" >&5 +echo "$as_me:4683: result: $with_debug" >&5 echo "${ECHO_T}$with_debug" >&6 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" -echo "$as_me:4213: checking if you want to build profiling libraries" >&5 +echo "$as_me:4687: checking if you want to build profiling libraries" >&5 echo $ECHO_N "checking if you want to build profiling libraries... $ECHO_C" >&6 # Check whether --with-profile or --without-profile was given. @@ -4220,7 +4694,7 @@ if test "${with_profile+set}" = set; then else with_profile=no fi; -echo "$as_me:4223: result: $with_profile" >&5 +echo "$as_me:4697: result: $with_profile" >&5 echo "${ECHO_T}$with_profile" >&6 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" @@ -4228,19 +4702,19 @@ fi ############################################################################### -echo "$as_me:4231: checking for specified models" >&5 +echo "$as_me:4705: checking for specified models" >&5 echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal test "$with_libtool" != "no" && cf_list_models=libtool -echo "$as_me:4235: result: $cf_list_models" >&5 +echo "$as_me:4709: result: $cf_list_models" >&5 echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. -echo "$as_me:4240: checking for default model" >&5 +echo "$as_me:4714: checking for default model" >&5 echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` -echo "$as_me:4243: result: $DFT_LWR_MODEL" >&5 +echo "$as_me:4717: result: $DFT_LWR_MODEL" >&5 echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` @@ -4269,7 +4743,7 @@ LIB_SUFFIX= ############################################################################### -echo "$as_me:4272: checking if you want to build a separate terminfo library" >&5 +echo "$as_me:4746: checking if you want to build a separate terminfo library" >&5 echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6 # Check whether --with-termlib or --without-termlib was given. @@ -4279,10 +4753,10 @@ if test "${with_termlib+set}" = set; then else with_termlib=no fi; -echo "$as_me:4282: result: $with_termlib" >&5 +echo "$as_me:4756: result: $with_termlib" >&5 echo "${ECHO_T}$with_termlib" >&6 -echo "$as_me:4285: checking if you want to build a separate tic library" >&5 +echo "$as_me:4759: checking if you want to build a separate tic library" >&5 echo $ECHO_N "checking if you want to build a separate tic library... $ECHO_C" >&6 # Check whether --with-ticlib or --without-ticlib was given. @@ -4292,13 +4766,13 @@ if test "${with_ticlib+set}" = set; then else with_ticlib=no fi; -echo "$as_me:4295: result: $with_ticlib" >&5 +echo "$as_me:4769: result: $with_ticlib" >&5 echo "${ECHO_T}$with_ticlib" >&6 ### Checks for special libraries, must be done up-front. SHLIB_LIST="" -echo "$as_me:4301: checking if you want to link with the GPM mouse library" >&5 +echo "$as_me:4775: checking if you want to link with the GPM mouse library" >&5 echo $ECHO_N "checking if you want to link with the GPM mouse library... $ECHO_C" >&6 # Check whether --with-gpm or --without-gpm was given. @@ -4308,27 +4782,27 @@ if test "${with_gpm+set}" = set; then else with_gpm=maybe fi; -echo "$as_me:4311: result: $with_gpm" >&5 +echo "$as_me:4785: result: $with_gpm" >&5 echo "${ECHO_T}$with_gpm" >&6 if test "$with_gpm" != no ; then - echo "$as_me:4315: checking for gpm.h" >&5 + echo "$as_me:4789: checking for gpm.h" >&5 echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6 if test "${ac_cv_header_gpm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4321 "configure" +#line 4795 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4325: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4799: \"$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:4331: \$? = $ac_status" >&5 + echo "$as_me:4805: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4347,7 +4821,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4350: result: $ac_cv_header_gpm_h" >&5 +echo "$as_me:4824: result: $ac_cv_header_gpm_h" >&5 echo "${ECHO_T}$ac_cv_header_gpm_h" >&6 if test $ac_cv_header_gpm_h = yes; then @@ -4358,14 +4832,14 @@ EOF if test "$with_gpm" != yes && test "$with_gpm" != maybe ; then test -n "$verbose" && echo " assuming we really have GPM library" 1>&6 -echo "${as_me-configure}:4361: testing assuming we really have GPM library ..." 1>&5 +echo "${as_me:-configure}:4835: testing assuming we really have GPM library ..." 1>&5 cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF else - echo "$as_me:4368: checking for Gpm_Open in -lgpm" >&5 + echo "$as_me:4842: 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 @@ -4373,7 +4847,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4376 "configure" +#line 4850 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4392,16 +4866,16 @@ Gpm_Open (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4395: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4869: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4398: \$? = $ac_status" >&5 + echo "$as_me:4872: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4401: \"$ac_try\"") >&5 + { (eval echo "$as_me:4875: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4404: \$? = $ac_status" >&5 + echo "$as_me:4878: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else @@ -4412,13 +4886,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4415: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "$as_me:4889: 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 : else - { { echo "$as_me:4421: error: Cannot link with GPM library" >&5 + { { echo "$as_me:4895: error: Cannot link with GPM library" >&5 echo "$as_me: error: Cannot link with GPM library" >&2;} { (exit 1); exit 1; }; } fi @@ -4428,7 +4902,7 @@ fi else - test "$with_gpm" != maybe && { echo "$as_me:4431: WARNING: Cannot find GPM header" >&5 + test "$with_gpm" != maybe && { echo "$as_me:4905: WARNING: Cannot find GPM header" >&5 echo "$as_me: WARNING: Cannot find GPM header" >&2;} with_gpm=no @@ -4437,7 +4911,7 @@ fi fi if test "$with_gpm" != no ; then - echo "$as_me:4440: checking if you want to load GPM dynamically" >&5 + echo "$as_me:4914: checking if you want to load GPM dynamically" >&5 echo $ECHO_N "checking if you want to load GPM dynamically... $ECHO_C" >&6 # Check whether --with-dlsym or --without-dlsym was given. @@ -4447,18 +4921,18 @@ if test "${with_dlsym+set}" = set; then else with_dlsym=yes fi; - echo "$as_me:4450: result: $with_dlsym" >&5 + echo "$as_me:4924: result: $with_dlsym" >&5 echo "${ECHO_T}$with_dlsym" >&6 if test "$with_dlsym" = yes ; then cf_have_dlsym=no -echo "$as_me:4455: checking for dlsym" >&5 +echo "$as_me:4929: checking for dlsym" >&5 echo $ECHO_N "checking for dlsym... $ECHO_C" >&6 if test "${ac_cv_func_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4461 "configure" +#line 4935 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlsym (); below. */ @@ -4489,16 +4963,16 @@ f = dlsym; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4492: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4966: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4495: \$? = $ac_status" >&5 + echo "$as_me:4969: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4498: \"$ac_try\"") >&5 + { (eval echo "$as_me:4972: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4501: \$? = $ac_status" >&5 + echo "$as_me:4975: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlsym=yes else @@ -4508,14 +4982,14 @@ ac_cv_func_dlsym=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4511: result: $ac_cv_func_dlsym" >&5 +echo "$as_me:4985: result: $ac_cv_func_dlsym" >&5 echo "${ECHO_T}$ac_cv_func_dlsym" >&6 if test $ac_cv_func_dlsym = yes; then cf_have_dlsym=yes else cf_have_libdl=no -echo "$as_me:4518: checking for dlsym in -ldl" >&5 +echo "$as_me:4992: checking for dlsym in -ldl" >&5 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4523,7 +4997,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4526 "configure" +#line 5000 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4542,16 +5016,16 @@ dlsym (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4545: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5019: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4548: \$? = $ac_status" >&5 + echo "$as_me:5022: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4551: \"$ac_try\"") >&5 + { (eval echo "$as_me:5025: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4554: \$? = $ac_status" >&5 + echo "$as_me:5028: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlsym=yes else @@ -4562,7 +5036,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4565: result: $ac_cv_lib_dl_dlsym" >&5 +echo "$as_me:5039: result: $ac_cv_lib_dl_dlsym" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6 if test $ac_cv_lib_dl_dlsym = yes; then @@ -4575,10 +5049,10 @@ fi if test "$cf_have_dlsym" = yes ; then test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" - echo "$as_me:4578: checking whether able to link to dl*() functions" >&5 + echo "$as_me:5052: checking whether able to link to dl*() functions" >&5 echo $ECHO_N "checking whether able to link to dl*() functions... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 4581 "configure" +#line 5055 "configure" #include "confdefs.h" #include int @@ -4596,16 +5070,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4599: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5073: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4602: \$? = $ac_status" >&5 + echo "$as_me:5076: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4605: \"$ac_try\"") >&5 + { (eval echo "$as_me:5079: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4608: \$? = $ac_status" >&5 + echo "$as_me:5082: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\EOF @@ -4616,15 +5090,15 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - { { echo "$as_me:4619: error: Cannot link test program for libdl" >&5 + { { echo "$as_me:5093: error: Cannot link test program for libdl" >&5 echo "$as_me: error: Cannot link test program for libdl" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:4624: result: ok" >&5 + echo "$as_me:5098: result: ok" >&5 echo "${ECHO_T}ok" >&6 else - { { echo "$as_me:4627: error: Cannot find dlsym function" >&5 + { { echo "$as_me:5101: error: Cannot find dlsym function" >&5 echo "$as_me: error: Cannot find dlsym function" >&2;} { (exit 1); exit 1; }; } fi @@ -4632,12 +5106,12 @@ fi if test "$with_gpm" != yes ; then test -n "$verbose" && echo " assuming soname for gpm is $with_gpm" 1>&6 -echo "${as_me-configure}:4635: testing assuming soname for gpm is $with_gpm ..." 1>&5 +echo "${as_me:-configure}:5109: testing assuming soname for gpm is $with_gpm ..." 1>&5 cf_cv_gpm_soname="$with_gpm" else -echo "$as_me:4640: checking for soname of gpm library" >&5 +echo "$as_me:5114: checking for soname of gpm library" >&5 echo $ECHO_N "checking for soname of gpm library... $ECHO_C" >&6 if test "${cf_cv_gpm_soname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4655,26 +5129,26 @@ if (Gpm_Open(0,0)) Gpm_Close(); CF_EOF cf_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" - if { (eval echo "$as_me:4658: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4661: \$? = $ac_status" >&5 + echo "$as_me:5135: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:4663: \"$ac_link\"") >&5 + if { (eval echo "$as_me:5137: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4666: \$? = $ac_status" >&5 + echo "$as_me:5140: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_gpm_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep libgpm.` test -z "$cf_cv_gpm_soname" && cf_cv_gpm_soname=unknown fi fi -rm -f conftest* +rm -rf conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:4677: result: $cf_cv_gpm_soname" >&5 +echo "$as_me:5151: result: $cf_cv_gpm_soname" >&5 echo "${ECHO_T}$cf_cv_gpm_soname" >&6 fi @@ -4685,12 +5159,13 @@ EOF SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" + TEST_LIBS="-lgpm $TEST_LIBS" fi cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF -echo "$as_me:4693: checking for Gpm_Wgetch in -lgpm" >&5 +echo "$as_me:5168: checking for Gpm_Wgetch in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Wgetch in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4698,7 +5173,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4701 "configure" +#line 5176 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4717,16 +5192,16 @@ Gpm_Wgetch (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4720: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5195: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4723: \$? = $ac_status" >&5 + echo "$as_me:5198: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4726: \"$ac_try\"") >&5 + { (eval echo "$as_me:5201: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4729: \$? = $ac_status" >&5 + echo "$as_me:5204: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Wgetch=yes else @@ -4737,11 +5212,11 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4740: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 +echo "$as_me:5215: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Wgetch" >&6 if test $ac_cv_lib_gpm_Gpm_Wgetch = yes; then -echo "$as_me:4744: checking if GPM is weakly bound to curses library" >&5 +echo "$as_me:5219: checking if GPM is weakly bound to curses library" >&5 echo $ECHO_N "checking if GPM is weakly bound to curses library... $ECHO_C" >&6 if test "${cf_cv_check_gpm_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4765,31 +5240,31 @@ CF_EOF # to rely on the static library, noting that some packagers may not # include it. LIBS="-static -lgpm -dynamic $LIBS" - if { (eval echo "$as_me:4768: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5243: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4771: \$? = $ac_status" >&5 + echo "$as_me:5246: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:4773: \"$ac_link\"") >&5 + if { (eval echo "$as_me:5248: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4776: \$? = $ac_status" >&5 + echo "$as_me:5251: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_check_gpm_wgetch=`nm conftest$ac_exeext | egrep '\' | egrep '\<[vVwW]\>'` test -n "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=yes test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -f conftest* + rm -rf conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:4788: result: $cf_cv_check_gpm_wgetch" >&5 +echo "$as_me:5263: result: $cf_cv_check_gpm_wgetch" >&5 echo "${ECHO_T}$cf_cv_check_gpm_wgetch" >&6 if test "$cf_cv_check_gpm_wgetch" != yes ; then - { echo "$as_me:4792: WARNING: GPM library is already linked with curses - read the FAQ" >&5 + { echo "$as_me:5267: WARNING: GPM library is already linked with curses - read the FAQ" >&5 echo "$as_me: WARNING: GPM library is already linked with curses - read the FAQ" >&2;} fi @@ -4799,7 +5274,7 @@ fi # not everyone has "test -c" if test -c /dev/sysmouse 2>/dev/null ; then -echo "$as_me:4802: checking if you want to use sysmouse" >&5 +echo "$as_me:5277: checking if you want to use sysmouse" >&5 echo $ECHO_N "checking if you want to use sysmouse... $ECHO_C" >&6 # Check whether --with-sysmouse or --without-sysmouse was given. @@ -4811,7 +5286,7 @@ else fi; if test "$cf_with_sysmouse" != no ; then cat >conftest.$ac_ext <<_ACEOF -#line 4814 "configure" +#line 5289 "configure" #include "confdefs.h" #include @@ -4834,16 +5309,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5312: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4840: \$? = $ac_status" >&5 + echo "$as_me:5315: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4843: \"$ac_try\"") >&5 + { (eval echo "$as_me:5318: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4846: \$? = $ac_status" >&5 + echo "$as_me:5321: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_with_sysmouse=yes else @@ -4853,7 +5328,7 @@ cf_with_sysmouse=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4856: result: $cf_with_sysmouse" >&5 +echo "$as_me:5331: result: $cf_with_sysmouse" >&5 echo "${ECHO_T}$cf_with_sysmouse" >&6 test "$cf_with_sysmouse" = yes && cat >>confdefs.h <<\EOF #define USE_SYSMOUSE 1 @@ -4871,7 +5346,7 @@ if test X"$CXX_G_OPT" = X"" ; then test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' fi -echo "$as_me:4874: checking for default loader flags" >&5 +echo "$as_me:5349: checking for default loader flags" >&5 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) LD_MODEL='' ;; @@ -4880,26 +5355,26 @@ debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; shared) LD_MODEL='' ;; esac -echo "$as_me:4883: result: $LD_MODEL" >&5 +echo "$as_me:5358: result: $LD_MODEL" >&5 echo "${ECHO_T}$LD_MODEL" >&6 case $DFT_LWR_MODEL in shared) -echo "$as_me:4889: checking if rpath option should be used" >&5 +echo "$as_me:5364: checking if rpath option should be used" >&5 echo $ECHO_N "checking if rpath option should be used... $ECHO_C" >&6 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" - cf_cv_ld_rpath=$enableval + cf_cv_enable_rpath=$enableval else - cf_cv_ld_rpath=no + cf_cv_enable_rpath=no fi; -echo "$as_me:4899: result: $cf_cv_ld_rpath" >&5 -echo "${ECHO_T}$cf_cv_ld_rpath" >&6 +echo "$as_me:5374: result: $cf_cv_enable_rpath" >&5 +echo "${ECHO_T}$cf_cv_enable_rpath" >&6 -echo "$as_me:4902: checking if shared libraries should be relinked during install" >&5 +echo "$as_me:5377: checking if shared libraries should be relinked during install" >&5 echo $ECHO_N "checking if shared libraries should be relinked during install... $ECHO_C" >&6 # Check whether --enable-relink or --disable-relink was given. @@ -4909,19 +5384,100 @@ if test "${enable_relink+set}" = set; then else cf_cv_do_relink=yes fi; -echo "$as_me:4912: result: $cf_cv_do_relink" >&5 +echo "$as_me:5387: result: $cf_cv_do_relink" >&5 echo "${ECHO_T}$cf_cv_do_relink" >&6 ;; esac +LD_RPATH_OPT= +echo "$as_me:5393: 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 + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[2-9].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +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:5424: result: $LD_RPATH_OPT" >&5 +echo "${ECHO_T}$LD_RPATH_OPT" >&6 + +case "x$LD_RPATH_OPT" in #(vi +x-R*) + echo "$as_me:5429: 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" + LIBS="${LD_RPATH_OPT}$libdir $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 5434 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5446: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5449: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5452: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5455: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_space=no +else + echo "$as_me: failed program was:" >&5 +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:5465: result: $cf_rpath_space" >&5 +echo "${ECHO_T}$cf_rpath_space" >&6 + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; +esac + LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" - echo "$as_me:4924: checking if release/abi version should be used for shared libs" >&5 + echo "$as_me:5480: checking if release/abi version should be used for shared libs" >&5 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 # Check whether --with-shlib-version or --without-shlib-version was given. @@ -4936,7 +5492,7 @@ if test "${with_shlib_version+set}" = set; then cf_cv_shlib_version=$withval ;; *) - { { echo "$as_me:4939: error: option value must be one of: rel, abi, auto or no" >&5 + { { echo "$as_me:5495: error: option value must be one of: rel, abi, auto or no" >&5 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} { (exit 1); exit 1; }; } ;; @@ -4945,7 +5501,7 @@ echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} else cf_cv_shlib_version=auto fi; - echo "$as_me:4948: result: $cf_cv_shlib_version" >&5 + echo "$as_me:5504: result: $cf_cv_shlib_version" >&5 echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no @@ -4954,14 +5510,14 @@ echo "${ECHO_T}$cf_cv_shlib_version" >&6 CC_SHARED_OPTS= if test "$GCC" = yes then - echo "$as_me:4957: checking which $CC option to use" >&5 + echo "$as_me:5513: checking which $CC option to use" >&5 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat >conftest.$ac_ext <<_ACEOF -#line 4964 "configure" +#line 5520 "configure" #include "confdefs.h" #include int @@ -4973,16 +5529,16 @@ int x = 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4976: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5532: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4979: \$? = $ac_status" >&5 + echo "$as_me:5535: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4982: \"$ac_try\"") >&5 + { (eval echo "$as_me:5538: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4985: \$? = $ac_status" >&5 + echo "$as_me:5541: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -4991,18 +5547,24 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done - echo "$as_me:4994: result: $CC_SHARED_OPTS" >&5 + echo "$as_me:5550: result: $CC_SHARED_OPTS" >&5 echo "${ECHO_T}$CC_SHARED_OPTS" >&6 CFLAGS="$cf_save_CFLAGS" fi cf_cv_shlib_version_infix=no - case $cf_cv_system_name in - beos*) + case $cf_cv_system_name in #(vi + aix[56]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; - cygwin*) + cygwin*) #(vi CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}' cf_cv_shlib_version=cygdll @@ -5021,13 +5583,13 @@ EOF CF_EOF chmod +x mk_shared_lib.sh ;; - darwin*) + darwin*) #(vi EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes - echo "$as_me:5030: checking if ld -search_paths_first works" >&5 + echo "$as_me:5592: checking if ld -search_paths_first works" >&5 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5036,7 +5598,7 @@ else cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF -#line 5039 "configure" +#line 5601 "configure" #include "confdefs.h" int @@ -5048,16 +5610,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5051: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5613: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5054: \$? = $ac_status" >&5 + echo "$as_me:5616: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5057: \"$ac_try\"") >&5 + { (eval echo "$as_me:5619: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5060: \$? = $ac_status" >&5 + echo "$as_me:5622: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ldflags_search_paths_first=yes else @@ -5068,13 +5630,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS=$cf_save_LDFLAGS fi -echo "$as_me:5071: result: $cf_cv_ldflags_search_paths_first" >&5 +echo "$as_me:5633: result: $cf_cv_ldflags_search_paths_first" >&5 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) + hpux*) #(vi # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -5087,15 +5649,9 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - if test "$GCC" = yes; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" - else - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" - fi + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -5106,14 +5662,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) + linux*|gnu*|k*bsd*-gnu) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5125,14 +5680,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - openbsd[2-9].*) + openbsd[2-9].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" @@ -5143,20 +5697,19 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - nto-qnx*|openbsd*|freebsd[12].*) + nto-qnx*|openbsd*|freebsd[12].*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) + freebsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5166,15 +5719,14 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $@` -o $@' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@' ;; - netbsd*) + netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -5192,37 +5744,33 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@' else - MK_SHARED_LIB='${LD} -Bshareable -o $@' + MK_SHARED_LIB='${LD} -shared -Bshareable -o $@' fi ;; - osf*|mls+*) + osf*|mls+*) #(vi # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`' - case $host_os in + case $host_os in #(vi osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@' - if test "$cf_cv_ld_rpath" = yes ; then + if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -5230,7 +5778,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) + sunos4*) #(vi # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5238,16 +5786,15 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${LD} -assert pure-text -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) + solaris2*) #(vi # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5258,13 +5805,49 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi if test "$GCC" != yes; then - CC_SHARED_OPTS='-xcode=pic32' + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +#line 5813 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello\n"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5825: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5828: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5831: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5834: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@' fi ;; - sysv5uw7*|unix_sv*) + sysv5uw7*|unix_sv*) #(vi # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5281,11 +5864,11 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $@') + *'-o $@') #(vi test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) - { echo "$as_me:5288: WARNING: ignored --with-shlib-version" >&5 + { echo "$as_me:5871: WARNING: ignored --with-shlib-version" >&5 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac @@ -5293,62 +5876,278 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} esac if test -n "$cf_ld_rpath_opt" ; then - echo "$as_me:5296: 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" - LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" - cat >conftest.$ac_ext <<_ACEOF -#line 5301 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5313: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5316: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5319: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5322: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_rpath_space=no -else - echo "$as_me: failed program was:" >&5 -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:5332: result: $cf_rpath_space" >&5 -echo "${ECHO_T}$cf_rpath_space" >&6 - test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi if test "$CC_SHARED_OPTS" = "unknown"; then for model in $cf_list_models; do if test "$model" = "shared"; then - { { echo "$as_me:5341: error: Shared libraries are not supported in this version" >&5 + { { echo "$as_me:5885: error: Shared libraries are not supported in this version" >&5 echo "$as_me: error: Shared libraries are not supported in this version" >&2;} { (exit 1); exit 1; }; } fi done fi +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + +echo "$as_me:5895: 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 + cf_disable_rpath_hack=yes + else + cf_disable_rpath_hack=no + fi +else + enableval=yes + cf_disable_rpath_hack=no + +fi; +echo "$as_me:5912: 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:5916: 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:5919: 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:5926: 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 +else + if test -n "$cf_ldd_prog"; then + ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + 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:5941: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +cf_ldd_prog=$ac_cv_prog_cf_ldd_prog +if test -n "$cf_ldd_prog"; then + echo "$as_me:5949: result: $cf_ldd_prog" >&5 +echo "${ECHO_T}$cf_ldd_prog" >&6 +else + echo "$as_me:5952: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$cf_ldd_prog" && break +done +test -n "$cf_ldd_prog" || cf_ldd_prog="no" + + cf_rpath_list="/usr/lib /lib" + if test "$cf_ldd_prog" != no + then + cf_rpath_oops= + +cat >conftest.$ac_ext <<_ACEOF +#line 5966 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5978: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5981: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5984: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5987: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` + cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u` +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + # If we passed the link-test, but get a "not found" on a given library, + # this could be due to inept reconfiguration of gcc to make it only + # partly honor /usr/local/lib (or whatever). Sometimes this behavior + # is intentional, e.g., installing gcc in /usr/bin and suppressing the + # /usr/local libraries. + if test -n "$cf_rpath_oops" + then + for cf_rpath_src in $cf_rpath_oops + do + for cf_rpath_dir in \ + /usr/local \ + /usr/pkg \ + /opt/sfw + do + if test -f $cf_rpath_dir/lib/$cf_rpath_src + then + test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 + +echo "${as_me:-configure}:6015: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 + + LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" + break + fi + done + done + fi + fi + + test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6027: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6031: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 + +cf_rpath_dst= +for cf_rpath_src in $LDFLAGS +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 + +echo "${as_me:-configure}:6068: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +LDFLAGS=$cf_rpath_dst + +test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6081: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 + +echo "${as_me:-configure}:6085: testing ...checking LIBS $LIBS ..." 1>&5 + +cf_rpath_dst= +for cf_rpath_src in $LIBS +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 + +echo "${as_me:-configure}:6122: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +LIBS=$cf_rpath_dst + +test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 + +echo "${as_me:-configure}:6135: testing ...checked LIBS $LIBS ..." 1>&5 + + test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6139: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +fi + +fi + +fi + ############################################################################### ### use option --disable-overwrite to leave out the link to -lcurses -echo "$as_me:5351: checking if you wish to install ncurses overwriting curses" >&5 +echo "$as_me:6150: checking if you wish to install ncurses overwriting curses" >&5 echo $ECHO_N "checking if you wish to install ncurses overwriting curses... $ECHO_C" >&6 # Check whether --enable-overwrite or --disable-overwrite was given. @@ -5358,10 +6157,10 @@ if test "${enable_overwrite+set}" = set; then else if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi fi; -echo "$as_me:5361: result: $with_overwrite" >&5 +echo "$as_me:6160: result: $with_overwrite" >&5 echo "${ECHO_T}$with_overwrite" >&6 -echo "$as_me:5364: checking if external terminfo-database is used" >&5 +echo "$as_me:6163: checking if external terminfo-database is used" >&5 echo $ECHO_N "checking if external terminfo-database is used... $ECHO_C" >&6 # Check whether --enable-database or --disable-database was given. @@ -5371,7 +6170,7 @@ if test "${enable_database+set}" = set; then else use_database=yes fi; -echo "$as_me:5374: result: $use_database" >&5 +echo "$as_me:6173: result: $use_database" >&5 echo "${ECHO_T}$use_database" >&6 case $host_os in #(vi @@ -5384,8 +6183,8 @@ os2*) #(vi esac case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; esac if test "$use_database" != no ; then @@ -5393,18 +6192,18 @@ if test "$use_database" != no ; then #define USE_DATABASE 1 EOF - echo "$as_me:5396: checking which terminfo source-file will be installed" >&5 + echo "$as_me:6195: checking which terminfo source-file will be installed" >&5 echo $ECHO_N "checking which terminfo source-file will be installed... $ECHO_C" >&6 -# Check whether --enable-database or --disable-database was given. -if test "${enable_database+set}" = set; then - enableval="$enable_database" +# Check whether --with-database or --without-database was given. +if test "${with_database+set}" = set; then + withval="$with_database" TERMINFO_SRC=$withval fi; - echo "$as_me:5404: result: $TERMINFO_SRC" >&5 + echo "$as_me:6203: result: $TERMINFO_SRC" >&5 echo "${ECHO_T}$TERMINFO_SRC" >&6 - echo "$as_me:5407: checking whether to use hashed database instead of directory/tree" >&5 + echo "$as_me:6206: checking whether to use hashed database instead of directory/tree" >&5 echo $ECHO_N "checking whether to use hashed database instead of directory/tree... $ECHO_C" >&6 # Check whether --with-hashed-db or --without-hashed-db was given. @@ -5414,13 +6213,13 @@ if test "${with_hashed_db+set}" = set; then else with_hashed_db=no fi; - echo "$as_me:5417: result: $with_hashed_db" >&5 + echo "$as_me:6216: result: $with_hashed_db" >&5 echo "${ECHO_T}$with_hashed_db" >&6 else with_hashed_db=no fi -echo "$as_me:5423: checking for list of fallback descriptions" >&5 +echo "$as_me:6222: checking for list of fallback descriptions" >&5 echo $ECHO_N "checking for list of fallback descriptions... $ECHO_C" >&6 # Check whether --with-fallbacks or --without-fallbacks was given. @@ -5430,11 +6229,11 @@ if test "${with_fallbacks+set}" = set; then else with_fallback= fi; -echo "$as_me:5433: result: $with_fallback" >&5 +echo "$as_me:6232: result: $with_fallback" >&5 echo "${ECHO_T}$with_fallback" >&6 FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'` -echo "$as_me:5437: checking if you want modern xterm or antique" >&5 +echo "$as_me:6236: checking if you want modern xterm or antique" >&5 echo $ECHO_N "checking if you want modern xterm or antique... $ECHO_C" >&6 # Check whether --with-xterm-new or --without-xterm-new was given. @@ -5448,7 +6247,7 @@ case $with_xterm_new in no) with_xterm_new=xterm-old;; *) with_xterm_new=xterm-new;; esac -echo "$as_me:5451: result: $with_xterm_new" >&5 +echo "$as_me:6250: result: $with_xterm_new" >&5 echo "${ECHO_T}$with_xterm_new" >&6 WHICH_XTERM=$with_xterm_new @@ -5458,7 +6257,7 @@ if test "$use_database" = no ; then MAKE_TERMINFO="#" else -echo "$as_me:5461: checking for list of terminfo directories" >&5 +echo "$as_me:6260: checking for list of terminfo directories" >&5 echo $ECHO_N "checking for list of terminfo directories... $ECHO_C" >&6 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given. @@ -5466,9 +6265,9 @@ if test "${with_terminfo_dirs+set}" = set; then withval="$with_terminfo_dirs" else - withval=${TERMINFO_DIRS-${datadir}/terminfo} + withval=${TERMINFO_DIRS:-${datadir}/terminfo} fi; -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5498,7 +6297,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5501: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:6300: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5511,13 +6310,13 @@ IFS="$ac_save_ifs" eval 'TERMINFO_DIRS="$cf_dst_path"' -echo "$as_me:5514: result: $TERMINFO_DIRS" >&5 +echo "$as_me:6313: result: $TERMINFO_DIRS" >&5 echo "${ECHO_T}$TERMINFO_DIRS" >&6 test -n "$TERMINFO_DIRS" && cat >>confdefs.h <&5 +echo "$as_me:6319: checking for default terminfo directory" >&5 echo $ECHO_N "checking for default terminfo directory... $ECHO_C" >&6 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given. @@ -5525,7 +6324,7 @@ if test "${with_default_terminfo_dir+set}" = set; then withval="$with_default_terminfo_dir" else - withval="${TERMINFO-${datadir}/terminfo}" + withval="${TERMINFO:-${datadir}/terminfo}" fi; if test -n "${datadir}/terminfo" ; then if test "x$prefix" != xNONE; then @@ -5553,7 +6352,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5556: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:6355: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5562,7 +6361,7 @@ esac fi TERMINFO="$withval" -echo "$as_me:5565: result: $TERMINFO" >&5 +echo "$as_me:6364: result: $TERMINFO" >&5 echo "${ECHO_T}$TERMINFO" >&6 cat >>confdefs.h <&5 +echo "$as_me:6374: checking if big-core option selected" >&5 echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6 # Check whether --enable-big-core or --disable-big-core was given. @@ -5584,7 +6383,7 @@ else with_big_core=no else cat >conftest.$ac_ext <<_ACEOF -#line 5587 "configure" +#line 6386 "configure" #include "confdefs.h" #include @@ -5598,15 +6397,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:5601: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6400: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5604: \$? = $ac_status" >&5 + echo "$as_me:6403: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5606: \"$ac_try\"") >&5 + { (eval echo "$as_me:6405: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5609: \$? = $ac_status" >&5 + echo "$as_me:6408: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_big_core=yes else @@ -5618,7 +6417,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi; -echo "$as_me:5621: result: $with_big_core" >&5 +echo "$as_me:6420: result: $with_big_core" >&5 echo "${ECHO_T}$with_big_core" >&6 test "$with_big_core" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_BIG_CORE 1 @@ -5627,7 +6426,7 @@ EOF ### ISO C only guarantees 512-char strings, we have tables which load faster ### when constructed using "big" strings. More than the C compiler, the awk ### program is a limit on most vendor UNIX systems. Check that we can build. -echo "$as_me:5630: checking if big-strings option selected" >&5 +echo "$as_me:6429: checking if big-strings option selected" >&5 echo $ECHO_N "checking if big-strings option selected... $ECHO_C" >&6 # Check whether --enable-big-strings or --disable-big-strings was given. @@ -5636,29 +6435,29 @@ if test "${enable_big_strings+set}" = set; then with_big_strings=$enableval else - case x$AWK in #(vi - x) - eval with_big_strings=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval with_big_strings=yes - else - eval with_big_strings=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval with_big_strings=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval with_big_strings=yes + else + eval with_big_strings=no + fi + ;; + esac fi; -echo "$as_me:5654: result: $with_big_strings" >&5 +echo "$as_me:6453: result: $with_big_strings" >&5 echo "${ECHO_T}$with_big_strings" >&6 USE_BIG_STRINGS=0 test "$with_big_strings" = "yes" && USE_BIG_STRINGS=1 ### use option --enable-termcap to compile in the termcap fallback support -echo "$as_me:5661: checking if you want termcap-fallback support" >&5 +echo "$as_me:6460: checking if you want termcap-fallback support" >&5 echo $ECHO_N "checking if you want termcap-fallback support... $ECHO_C" >&6 # Check whether --enable-termcap or --disable-termcap was given. @@ -5668,13 +6467,13 @@ if test "${enable_termcap+set}" = set; then else with_termcap=no fi; -echo "$as_me:5671: result: $with_termcap" >&5 +echo "$as_me:6470: result: $with_termcap" >&5 echo "${ECHO_T}$with_termcap" >&6 if test "$with_termcap" != "yes" ; then if test "$use_database" = no ; then if test -z "$with_fallback" ; then - { { echo "$as_me:5677: error: You have disabled the database w/o specifying fallbacks" >&5 + { { echo "$as_me:6476: error: You have disabled the database w/o specifying fallbacks" >&5 echo "$as_me: error: You have disabled the database w/o specifying fallbacks" >&2;} { (exit 1); exit 1; }; } fi @@ -5686,7 +6485,7 @@ EOF else if test "$with_ticlib" != no ; then - { { echo "$as_me:5689: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 + { { echo "$as_me:6488: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 echo "$as_me: error: Options --with-ticlib and --enable-termcap cannot be combined" >&2;} { (exit 1); exit 1; }; } fi @@ -5695,7 +6494,7 @@ cat >>confdefs.h <<\EOF #define USE_TERMCAP 1 EOF -echo "$as_me:5698: checking for list of termcap files" >&5 +echo "$as_me:6497: checking for list of termcap files" >&5 echo $ECHO_N "checking for list of termcap files... $ECHO_C" >&6 # Check whether --with-termpath or --without-termpath was given. @@ -5703,9 +6502,9 @@ if test "${with_termpath+set}" = set; then withval="$with_termpath" else - withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} + withval=${TERMPATH:-/etc/termcap:/usr/share/misc/termcap} fi; -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5735,7 +6534,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5738: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:6537: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5748,14 +6547,14 @@ IFS="$ac_save_ifs" eval 'TERMPATH="$cf_dst_path"' -echo "$as_me:5751: result: $TERMPATH" >&5 +echo "$as_me:6550: result: $TERMPATH" >&5 echo "${ECHO_T}$TERMPATH" >&6 test -n "$TERMPATH" && cat >>confdefs.h <&5 +echo "$as_me:6557: checking if fast termcap-loader is needed" >&5 echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6 # Check whether --enable-getcap or --disable-getcap was given. @@ -5765,13 +6564,13 @@ if test "${enable_getcap+set}" = set; then else with_getcap=no fi; -echo "$as_me:5768: result: $with_getcap" >&5 +echo "$as_me:6567: result: $with_getcap" >&5 echo "${ECHO_T}$with_getcap" >&6 test "$with_getcap" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP 1 EOF -echo "$as_me:5774: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "$as_me:6573: checking if translated termcaps will be cached in ~/.terminfo" >&5 echo $ECHO_N "checking if translated termcaps will be cached in ~/.terminfo... $ECHO_C" >&6 # Check whether --enable-getcap-cache or --disable-getcap-cache was given. @@ -5781,7 +6580,7 @@ if test "${enable_getcap_cache+set}" = set; then else with_getcap_cache=no fi; -echo "$as_me:5784: result: $with_getcap_cache" >&5 +echo "$as_me:6583: result: $with_getcap_cache" >&5 echo "${ECHO_T}$with_getcap_cache" >&6 test "$with_getcap_cache" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP_CACHE 1 @@ -5790,7 +6589,7 @@ EOF fi ### Use option --disable-home-terminfo to completely remove ~/.terminfo -echo "$as_me:5793: checking if ~/.terminfo is wanted" >&5 +echo "$as_me:6592: checking if ~/.terminfo is wanted" >&5 echo $ECHO_N "checking if ~/.terminfo is wanted... $ECHO_C" >&6 # Check whether --enable-home-terminfo or --disable-home-terminfo was given. @@ -5800,13 +6599,13 @@ if test "${enable_home_terminfo+set}" = set; then else with_home_terminfo=yes fi; -echo "$as_me:5803: result: $with_home_terminfo" >&5 +echo "$as_me:6602: result: $with_home_terminfo" >&5 echo "${ECHO_T}$with_home_terminfo" >&6 test "$with_home_terminfo" = "yes" && cat >>confdefs.h <<\EOF #define USE_HOME_TERMINFO 1 EOF -echo "$as_me:5809: checking if you want to use restricted environment when running as root" >&5 +echo "$as_me:6608: checking if you want to use restricted environment when running as root" >&5 echo $ECHO_N "checking if you want to use restricted environment when running as root... $ECHO_C" >&6 # Check whether --enable-root-environ or --disable-root-environ was given. @@ -5816,7 +6615,7 @@ if test "${enable_root_environ+set}" = set; then else with_root_environ=yes fi; -echo "$as_me:5819: result: $with_root_environ" >&5 +echo "$as_me:6618: result: $with_root_environ" >&5 echo "${ECHO_T}$with_root_environ" >&6 test "$with_root_environ" = yes && cat >>confdefs.h <<\EOF #define USE_ROOT_ENVIRON 1 @@ -5830,13 +6629,13 @@ for ac_func in \ unlink do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:5833: checking for $ac_func" >&5 +echo "$as_me:6632: 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 5839 "configure" +#line 6638 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -5867,16 +6666,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5870: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6669: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5873: \$? = $ac_status" >&5 + echo "$as_me:6672: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5876: \"$ac_try\"") >&5 + { (eval echo "$as_me:6675: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5879: \$? = $ac_status" >&5 + echo "$as_me:6678: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -5886,7 +6685,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5889: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6688: 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 <&5 +echo "$as_me:6705: 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 5912 "configure" +#line 6711 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -5940,16 +6739,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5943: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6742: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5946: \$? = $ac_status" >&5 + echo "$as_me:6745: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5949: \"$ac_try\"") >&5 + { (eval echo "$as_me:6748: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5952: \$? = $ac_status" >&5 + echo "$as_me:6751: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -5959,7 +6758,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5962: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6761: 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 <&5 + echo "$as_me:6772: checking if link/symlink functions work" >&5 echo $ECHO_N "checking if link/symlink functions work... $ECHO_C" >&6 if test "${cf_cv_link_funcs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5983,7 +6782,7 @@ else eval 'ac_cv_func_'$cf_func'=error' else cat >conftest.$ac_ext <<_ACEOF -#line 5986 "configure" +#line 6785 "configure" #include "confdefs.h" #include @@ -6013,15 +6812,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:6016: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6019: \$? = $ac_status" >&5 + echo "$as_me:6818: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6021: \"$ac_try\"") >&5 + { (eval echo "$as_me:6820: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6024: \$? = $ac_status" >&5 + echo "$as_me:6823: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" @@ -6039,7 +6838,7 @@ fi test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no fi -echo "$as_me:6042: result: $cf_cv_link_funcs" >&5 +echo "$as_me:6841: result: $cf_cv_link_funcs" >&5 echo "${ECHO_T}$cf_cv_link_funcs" >&6 test "$ac_cv_func_link" = yes && cat >>confdefs.h <<\EOF #define HAVE_LINK 1 @@ -6057,7 +6856,7 @@ with_symlinks=no # soft links (symbolic links) are useful for some systems where hard links do # not work, or to make it simpler to copy terminfo trees around. if test "$ac_cv_func_symlink" = yes ; then - echo "$as_me:6060: checking if tic should use symbolic links" >&5 + echo "$as_me:6859: checking if tic should use symbolic links" >&5 echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 # Check whether --enable-symlinks or --disable-symlinks was given. @@ -6067,21 +6866,21 @@ if test "${enable_symlinks+set}" = set; then else with_symlinks=no fi; - echo "$as_me:6070: result: $with_symlinks" >&5 + echo "$as_me:6869: result: $with_symlinks" >&5 echo "${ECHO_T}$with_symlinks" >&6 fi # If we have hard links and did not choose to use soft links instead, there is # no reason to make this choice optional - use the hard links. if test "$with_symlinks" = no ; then - echo "$as_me:6077: checking if tic should use hard links" >&5 + echo "$as_me:6876: checking if tic should use hard links" >&5 echo $ECHO_N "checking if tic should use hard links... $ECHO_C" >&6 if test "$ac_cv_func_link" = yes ; then with_links=yes else with_links=no fi - echo "$as_me:6084: result: $with_links" >&5 + echo "$as_me:6883: result: $with_links" >&5 echo "${ECHO_T}$with_links" >&6 fi @@ -6094,7 +6893,7 @@ test "$with_symlinks" = yes && cat >>confdefs.h <<\EOF EOF ### use option --enable-broken-linker to force on use of broken-linker support -echo "$as_me:6097: checking if you want broken-linker support code" >&5 +echo "$as_me:6896: checking if you want broken-linker support code" >&5 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. @@ -6102,9 +6901,9 @@ if test "${enable_broken_linker+set}" = set; then enableval="$enable_broken_linker" with_broken_linker=$enableval else - with_broken_linker=${BROKEN_LINKER-no} + with_broken_linker=${BROKEN_LINKER:-no} fi; -echo "$as_me:6107: result: $with_broken_linker" >&5 +echo "$as_me:6906: result: $with_broken_linker" >&5 echo "${ECHO_T}$with_broken_linker" >&6 BROKEN_LINKER=0 @@ -6124,14 +6923,14 @@ EOF BROKEN_LINKER=1 test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 -echo "${as_me-configure}:6127: testing cygwin linker is broken anyway ..." 1>&5 +echo "${as_me:-configure}:6926: testing cygwin linker is broken anyway ..." 1>&5 ;; esac fi ### use option --enable-bsdpad to have tputs process BSD-style prefix padding -echo "$as_me:6134: checking if tputs should process BSD-style prefix padding" >&5 +echo "$as_me:6933: checking if tputs should process BSD-style prefix padding" >&5 echo $ECHO_N "checking if tputs should process BSD-style prefix padding... $ECHO_C" >&6 # Check whether --enable-bsdpad or --disable-bsdpad was given. @@ -6141,7 +6940,7 @@ if test "${enable_bsdpad+set}" = set; then else with_bsdpad=no fi; -echo "$as_me:6144: result: $with_bsdpad" >&5 +echo "$as_me:6943: result: $with_bsdpad" >&5 echo "${ECHO_T}$with_bsdpad" >&6 test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF #define BSD_TPUTS 1 @@ -6158,66 +6957,22 @@ NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -echo "$as_me:6161: checking if $CC -U and -D options work together" >&5 -echo $ECHO_N "checking if $CC -U and -D options work together... $ECHO_C" >&6 -if test "${cf_cv_cc_u_d_options+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" - cat >conftest.$ac_ext <<_ACEOF -#line 6170 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifndef U_D_OPTIONS -make an undefined-error -#endif -#ifdef D_U_OPTIONS -make a defined-error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6189: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6192: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6195: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6198: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_cc_u_d_options=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cf_cv_cc_u_d_options=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save_CPPFLAGS" - -fi -echo "$as_me:6212: result: $cf_cv_cc_u_d_options" >&5 -echo "${ECHO_T}$cf_cv_cc_u_d_options" >&6 - cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L +cf_xopen_source= case $host_os in #(vi -aix[45]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" +aix[456]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; +darwin[0-8].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -6225,24 +6980,27 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + 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 + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[56].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; -linux*|gnu*|k*bsd*-gnu) #(vi +linux*|gnu*|mint*|k*bsd*-gnu) #(vi -echo "$as_me:6238: checking if we must define _GNU_SOURCE" >&5 +echo "$as_me:6996: 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 6245 "configure" +#line 7003 "configure" #include "confdefs.h" #include int @@ -6257,16 +7015,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6260: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7018: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6263: \$? = $ac_status" >&5 + echo "$as_me:7021: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6266: \"$ac_try\"") >&5 + { (eval echo "$as_me:7024: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6269: \$? = $ac_status" >&5 + echo "$as_me:7027: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -6275,7 +7033,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 6278 "configure" +#line 7036 "configure" #include "confdefs.h" #include int @@ -6290,16 +7048,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6293: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7051: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6296: \$? = $ac_status" >&5 + echo "$as_me:7054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6299: \"$ac_try\"") >&5 + { (eval echo "$as_me:7057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6302: \$? = $ac_status" >&5 + echo "$as_me:7060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -6314,7 +7072,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6317: result: $cf_cv_gnu_source" >&5 +echo "$as_me:7075: 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" @@ -6329,26 +7087,29 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[45]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" +solaris2.1[0-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[1-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__" ;; *) - echo "$as_me:6344: checking if we should define _XOPEN_SOURCE" >&5 + echo "$as_me:7105: 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 6351 "configure" +#line 7112 "configure" #include "confdefs.h" #include int @@ -6363,16 +7124,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6366: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7127: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6369: \$? = $ac_status" >&5 + echo "$as_me:7130: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6372: \"$ac_try\"") >&5 + { (eval echo "$as_me:7133: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6375: \$? = $ac_status" >&5 + echo "$as_me:7136: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -6381,7 +7142,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 6384 "configure" +#line 7145 "configure" #include "confdefs.h" #include int @@ -6396,16 +7157,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6399: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7160: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6402: \$? = $ac_status" >&5 + echo "$as_me:7163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6405: \"$ac_try\"") >&5 + { (eval echo "$as_me:7166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6408: \$? = $ac_status" >&5 + echo "$as_me:7169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -6420,23 +7181,98 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6423: result: $cf_cv_xopen_source" >&5 +echo "$as_me:7184: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then -# remove _XOPEN_SOURCE symbol from $CFLAGS CFLAGS=`echo "$CFLAGS" | \ - sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` -# remove _XOPEN_SOURCE symbol from $CPPFLAGS CPPFLAGS=`echo "$CPPFLAGS" | \ - sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" fi cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE @@ -6444,26 +7280,24 @@ cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" -# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ - sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ - sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:6457: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:7291: 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}:6463: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:7297: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 6466 "configure" +#line 7300 "configure" #include "confdefs.h" #include int @@ -6478,16 +7312,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6481: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7315: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6484: \$? = $ac_status" >&5 + echo "$as_me:7318: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6487: \"$ac_try\"") >&5 + { (eval echo "$as_me:7321: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6490: \$? = $ac_status" >&5 + echo "$as_me:7324: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -6508,7 +7342,7 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 6511 "configure" +#line 7345 "configure" #include "confdefs.h" #include int @@ -6523,16 +7357,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6526: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7360: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6529: \$? = $ac_status" >&5 + echo "$as_me:7363: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6532: \"$ac_try\"") >&5 + { (eval echo "$as_me:7366: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6535: \$? = $ac_status" >&5 + echo "$as_me:7369: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6543,15 +7377,15 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me-configure}:6546: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:7380: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "${as_me-configure}:6551: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:7385: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 6554 "configure" +#line 7388 "configure" #include "confdefs.h" #include int @@ -6566,16 +7400,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6569: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7403: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6572: \$? = $ac_status" >&5 + echo "$as_me:7406: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6575: \"$ac_try\"") >&5 + { (eval echo "$as_me:7409: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6578: \$? = $ac_status" >&5 + echo "$as_me:7412: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6591,33 +7425,188 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6594: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:7428: 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 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[^ ]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + fi ;; esac +if test -n "$cf_xopen_source" ; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +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 + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + 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" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -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 + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + # Work around breakage on OS X -echo "$as_me:6613: checking if SIGWINCH is defined" >&5 +echo "$as_me:7602: 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 6620 "configure" +#line 7609 "configure" #include "confdefs.h" #include @@ -6632,23 +7621,23 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6635: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7624: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6638: \$? = $ac_status" >&5 + echo "$as_me:7627: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6641: \"$ac_try\"") >&5 + { (eval echo "$as_me:7630: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6644: \$? = $ac_status" >&5 + echo "$as_me:7633: \$? = $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 6651 "configure" +#line 7640 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -6666,16 +7655,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6669: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7658: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6672: \$? = $ac_status" >&5 + echo "$as_me:7661: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6675: \"$ac_try\"") >&5 + { (eval echo "$as_me:7664: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6678: \$? = $ac_status" >&5 + echo "$as_me:7667: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_define_sigwinch=maybe else @@ -6689,11 +7678,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6692: result: $cf_cv_define_sigwinch" >&5 +echo "$as_me:7681: 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:6696: checking for actual SIGWINCH definition" >&5 +echo "$as_me:7685: 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 @@ -6704,7 +7693,7 @@ cf_sigwinch=32 while test $cf_sigwinch != 1 do cat >conftest.$ac_ext <<_ACEOF -#line 6707 "configure" +#line 7696 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -6726,16 +7715,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6729: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7718: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6732: \$? = $ac_status" >&5 + echo "$as_me:7721: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6735: \"$ac_try\"") >&5 + { (eval echo "$as_me:7724: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6738: \$? = $ac_status" >&5 + echo "$as_me:7727: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_fixup_sigwinch=$cf_sigwinch break @@ -6749,7 +7738,7 @@ cf_sigwinch=`expr $cf_sigwinch - 1` done fi -echo "$as_me:6752: result: $cf_cv_fixup_sigwinch" >&5 +echo "$as_me:7741: result: $cf_cv_fixup_sigwinch" >&5 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6 if test "$cf_cv_fixup_sigwinch" != unknown ; then @@ -6759,13 +7748,13 @@ fi # Checks for CODESET support. - echo "$as_me:6762: checking for nl_langinfo and CODESET" >&5 + echo "$as_me:7751: 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 6768 "configure" +#line 7757 "configure" #include "confdefs.h" #include int @@ -6777,16 +7766,16 @@ char* cs = nl_langinfo(CODESET); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6780: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7769: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6783: \$? = $ac_status" >&5 + echo "$as_me:7772: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6786: \"$ac_try\"") >&5 + { (eval echo "$as_me:7775: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6789: \$? = $ac_status" >&5 + echo "$as_me:7778: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else @@ -6797,7 +7786,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6800: result: $am_cv_langinfo_codeset" >&5 +echo "$as_me:7789: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then @@ -6811,7 +7800,7 @@ EOF NCURSES_OK_WCHAR_T= NCURSES_OK_WINT_T= -echo "$as_me:6814: checking if you want wide-character code" >&5 +echo "$as_me:7803: checking if you want wide-character code" >&5 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. @@ -6821,7 +7810,7 @@ if test "${enable_widec+set}" = set; then else with_widec=no fi; -echo "$as_me:6824: result: $with_widec" >&5 +echo "$as_me:7813: result: $with_widec" >&5 echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" @@ -6829,10 +7818,15 @@ if test "$with_widec" = yes ; then #define USE_WIDEC_SUPPORT 1 EOF -echo "$as_me:6832: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 + case "$CFLAGS $CPPFLAGS" in #(vi + *-D_XOPEN_SOURCE=500) #(vi + ;; + *) + +echo "$as_me:7826: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 6835 "configure" +#line 7829 "configure" #include "confdefs.h" #include @@ -6848,16 +7842,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6851: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7845: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6854: \$? = $ac_status" >&5 + echo "$as_me:7848: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6857: \"$ac_try\"") >&5 + { (eval echo "$as_me:7851: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6860: \$? = $ac_status" >&5 + echo "$as_me:7854: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=no else @@ -6866,16 +7860,16 @@ cat conftest.$ac_ext >&5 cf_result=yes fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:6869: result: $cf_result" >&5 +echo "$as_me:7863: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" elif test "x" != "x" ; then - echo "$as_me:6875: checking checking for compatible value versus " >&5 + echo "$as_me:7869: checking checking for compatible value versus " >&5 echo $ECHO_N "checking checking for compatible value versus ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 6878 "configure" +#line 7872 "configure" #include "confdefs.h" #include @@ -6891,16 +7885,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6894: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7888: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6897: \$? = $ac_status" >&5 + echo "$as_me:7891: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6900: \"$ac_try\"") >&5 + { (eval echo "$as_me:7894: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6903: \$? = $ac_status" >&5 + echo "$as_me:7897: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes else @@ -6909,7 +7903,7 @@ cat conftest.$ac_ext >&5 cf_result=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:6912: result: $cf_result" >&5 + echo "$as_me:7906: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = no ; then # perhaps we can override it - try... @@ -6917,19 +7911,22 @@ echo "${ECHO_T}$cf_result" >&6 fi fi + ;; + esac + # with_overwrite=no NCURSES_CH_T=cchar_t for ac_func in putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:6926: checking for $ac_func" >&5 +echo "$as_me:7923: 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 6932 "configure" +#line 7929 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -6960,16 +7957,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6963: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7960: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6966: \$? = $ac_status" >&5 + echo "$as_me:7963: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6969: \"$ac_try\"") >&5 + { (eval echo "$as_me:7966: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6972: \$? = $ac_status" >&5 + echo "$as_me:7969: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -6979,7 +7976,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6982: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:7979: 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 <&5 +echo "$as_me:7991: 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 @@ -6999,7 +7996,7 @@ else cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7002 "configure" +#line 7999 "configure" #include "confdefs.h" #include @@ -7012,16 +8009,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7015: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8012: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7018: \$? = $ac_status" >&5 + echo "$as_me:8015: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7021: \"$ac_try\"") >&5 + { (eval echo "$as_me:8018: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7024: \$? = $ac_status" >&5 + echo "$as_me:8021: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_utf8_lib=yes else @@ -7033,10 +8030,12 @@ cat conftest.$ac_ext >&5 cf_cv_header_path_utf8= cf_cv_library_path_utf8= -echo "${as_me-configure}:7036: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:8033: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 + +cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7039 "configure" +#line 8038 "configure" #include "confdefs.h" #include @@ -7049,34 +8048,110 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7052: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8051: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7055: \$? = $ac_status" >&5 + echo "$as_me:8054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7058: \"$ac_try\"") >&5 + { (eval echo "$as_me:8057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7061: \$? = $ac_status" >&5 + echo "$as_me:8060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cf_cv_find_linkage_utf8=yes + + 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 - cf_cv_find_linkage_utf8=no +LIBS="-lutf8 $cf_save_LIBS" -echo "${as_me-configure}:7070: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 +cat >conftest.$ac_ext <<_ACEOF +#line 8074 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8087: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8090: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8093: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8096: \$? = $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}:8113: testing find linkage for utf8 library ..." 1>&5 + +echo "${as_me:-configure}:8115: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" - cf_search="" +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 #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /usr" test -d /usr/include && cf_search="$cf_search /usr/include" test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" @@ -7098,7 +8173,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr/local" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /usr/local" test -d /usr/local/include && cf_search="$cf_search /usr/local/include" test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" @@ -7109,7 +8184,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/opt" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /opt" test -d /opt/include && cf_search="$cf_search /opt/include" test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" @@ -7120,7 +8195,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "$HOME" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $HOME" test -d $HOME/include && cf_search="$cf_search $HOME/include" test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" @@ -7143,16 +8218,18 @@ test -d "$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}:7151: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8228: 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 7155 "configure" +#line 8232 "configure" #include "confdefs.h" #include @@ -7165,21 +8242,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7168: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8245: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7171: \$? = $ac_status" >&5 + echo "$as_me:8248: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7174: \"$ac_try\"") >&5 + { (eval echo "$as_me:8251: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7177: \$? = $ac_status" >&5 + echo "$as_me:8254: \$? = $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}:7182: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8259: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=maybe cf_test_CPPFLAGS="$CPPFLAGS" @@ -7197,17 +8274,44 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_find_linkage_utf8" = maybe ; then -echo "${as_me-configure}:7200: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:8277: 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_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$,,'` + +test "$cf_library_path" != "NONE" && \ +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 "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /usr" test -d /usr/lib && cf_search="$cf_search /usr/lib" test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" @@ -7229,7 +8333,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr/local" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" @@ -7240,7 +8344,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/opt" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /opt" test -d /opt/lib && cf_search="$cf_search /opt/lib" test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" @@ -7251,7 +8355,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "$HOME" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $HOME" test -d $HOME/lib && cf_search="$cf_search $HOME/lib" test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" @@ -7260,18 +8364,20 @@ test -d "$HOME" && \ test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" } +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}:7268: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8374: 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 7274 "configure" +#line 8380 "configure" #include "confdefs.h" #include @@ -7284,21 +8390,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7287: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8393: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7290: \$? = $ac_status" >&5 + echo "$as_me:8396: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7293: \"$ac_try\"") >&5 + { (eval echo "$as_me:8399: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7296: \$? = $ac_status" >&5 + echo "$as_me:8402: \$? = $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}:7301: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8407: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" @@ -7315,7 +8421,6 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done - LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -7327,6 +8432,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext 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 @@ -7336,7 +8446,7 @@ fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:7339: result: $cf_cv_utf8_lib" >&5 +echo "$as_me:8449: 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 @@ -7364,13 +8474,13 @@ if test -n "$cf_cv_header_path_utf8" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; 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 7373 "configure" +#line 8483 "configure" #include "confdefs.h" #include int @@ -7382,16 +8492,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7385: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8495: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7388: \$? = $ac_status" >&5 + echo "$as_me:8498: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7391: \"$ac_try\"") >&5 + { (eval echo "$as_me:8501: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7394: \$? = $ac_status" >&5 + echo "$as_me:8504: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -7408,13 +8518,13 @@ 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}:7411: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:8521: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + 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" + 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 @@ -7442,7 +8552,7 @@ if test -n "$cf_cv_library_path_utf8" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:8555: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -7450,7 +8560,7 @@ echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ... done fi - LIBS="-lutf8 $LIBS" + LIBS="$cf_cv_library_file_utf8 $LIBS" fi if test "$cf_cv_utf8_lib" != no ; then @@ -7459,14 +8569,14 @@ fi fi # This is needed on Tru64 5.0 to declare mbstate_t -echo "$as_me:7462: checking if we must include wchar.h to declare mbstate_t" >&5 +echo "$as_me:8572: 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 7469 "configure" +#line 8579 "configure" #include "confdefs.h" #include @@ -7484,23 +8594,23 @@ mbstate_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7487: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8597: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7490: \$? = $ac_status" >&5 + echo "$as_me:8600: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7493: \"$ac_try\"") >&5 + { (eval echo "$as_me:8603: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7496: \$? = $ac_status" >&5 + echo "$as_me:8606: \$? = $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 7503 "configure" +#line 8613 "configure" #include "confdefs.h" #include @@ -7519,16 +8629,16 @@ mbstate_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7522: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8632: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7525: \$? = $ac_status" >&5 + echo "$as_me:8635: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7528: \"$ac_try\"") >&5 + { (eval echo "$as_me:8638: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7531: \$? = $ac_status" >&5 + echo "$as_me:8641: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_mbstate_t=yes else @@ -7540,7 +8650,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7543: result: $cf_cv_mbstate_t" >&5 +echo "$as_me:8653: result: $cf_cv_mbstate_t" >&5 echo "${ECHO_T}$cf_cv_mbstate_t" >&6 if test "$cf_cv_mbstate_t" = yes ; then @@ -7557,14 +8667,14 @@ if test "$cf_cv_mbstate_t" = unknown ; then fi # This is needed on Tru64 5.0 to declare wchar_t -echo "$as_me:7560: checking if we must include wchar.h to declare wchar_t" >&5 +echo "$as_me:8670: 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 7567 "configure" +#line 8677 "configure" #include "confdefs.h" #include @@ -7582,23 +8692,23 @@ wchar_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7585: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8695: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7588: \$? = $ac_status" >&5 + echo "$as_me:8698: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7591: \"$ac_try\"") >&5 + { (eval echo "$as_me:8701: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7594: \$? = $ac_status" >&5 + echo "$as_me:8704: \$? = $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 7601 "configure" +#line 8711 "configure" #include "confdefs.h" #include @@ -7617,16 +8727,16 @@ wchar_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7620: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8730: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7623: \$? = $ac_status" >&5 + echo "$as_me:8733: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7626: \"$ac_try\"") >&5 + { (eval echo "$as_me:8736: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7629: \$? = $ac_status" >&5 + echo "$as_me:8739: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wchar_t=yes else @@ -7638,7 +8748,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7641: result: $cf_cv_wchar_t" >&5 +echo "$as_me:8751: result: $cf_cv_wchar_t" >&5 echo "${ECHO_T}$cf_cv_wchar_t" >&6 if test "$cf_cv_wchar_t" = yes ; then @@ -7660,14 +8770,14 @@ if test "$cf_cv_wchar_t" != unknown ; then fi # This is needed on Tru64 5.0 to declare wint_t -echo "$as_me:7663: checking if we must include wchar.h to declare wint_t" >&5 +echo "$as_me:8773: 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 7670 "configure" +#line 8780 "configure" #include "confdefs.h" #include @@ -7685,23 +8795,23 @@ wint_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7688: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8798: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7691: \$? = $ac_status" >&5 + echo "$as_me:8801: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7694: \"$ac_try\"") >&5 + { (eval echo "$as_me:8804: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7697: \$? = $ac_status" >&5 + echo "$as_me:8807: \$? = $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 7704 "configure" +#line 8814 "configure" #include "confdefs.h" #include @@ -7720,16 +8830,16 @@ wint_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7723: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7726: \$? = $ac_status" >&5 + echo "$as_me:8836: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7729: \"$ac_try\"") >&5 + { (eval echo "$as_me:8839: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7732: \$? = $ac_status" >&5 + echo "$as_me:8842: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wint_t=yes else @@ -7741,7 +8851,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7744: result: $cf_cv_wint_t" >&5 +echo "$as_me:8854: result: $cf_cv_wint_t" >&5 echo "${ECHO_T}$cf_cv_wint_t" >&6 if test "$cf_cv_wint_t" = yes ; then @@ -7780,7 +8890,7 @@ case $cf_cv_abi_version in ;; esac -echo "$as_me:7783: checking whether to enable _LP64 definition in curses.h" >&5 +echo "$as_me:8893: checking whether to enable _LP64 definition in curses.h" >&5 echo $ECHO_N "checking whether to enable _LP64 definition in curses.h... $ECHO_C" >&6 # Check whether --enable-lp64 or --disable-lp64 was given. @@ -7790,7 +8900,7 @@ if test "${enable_lp64+set}" = set; then else with_lp64=$default_with_lp64 fi; -echo "$as_me:7793: result: $with_lp64" >&5 +echo "$as_me:8903: result: $with_lp64" >&5 echo "${ECHO_T}$with_lp64" >&6 if test "$with_lp64" = yes ; then @@ -7806,7 +8916,7 @@ if test "${enable_largefile+set}" = set; then fi; if test "$enable_largefile" != no; then - echo "$as_me:7809: checking for special C compiler options needed for large files" >&5 + echo "$as_me:8919: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7818,7 +8928,7 @@ else # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF -#line 7821 "configure" +#line 8931 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7838,16 +8948,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7841: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8951: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7844: \$? = $ac_status" >&5 + echo "$as_me:8954: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7847: \"$ac_try\"") >&5 + { (eval echo "$as_me:8957: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7850: \$? = $ac_status" >&5 + echo "$as_me:8960: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7857,16 +8967,16 @@ fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext -if { (eval echo "$as_me:7860: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8970: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7863: \$? = $ac_status" >&5 + echo "$as_me:8973: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7866: \"$ac_try\"") >&5 + { (eval echo "$as_me:8976: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7869: \$? = $ac_status" >&5 + echo "$as_me:8979: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else @@ -7880,13 +8990,13 @@ rm -f conftest.$ac_objext rm -f conftest.$ac_ext fi fi -echo "$as_me:7883: result: $ac_cv_sys_largefile_CC" >&5 +echo "$as_me:8993: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:7889: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + echo "$as_me:8999: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7894,7 +9004,7 @@ else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF -#line 7897 "configure" +#line 9007 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7914,16 +9024,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7917: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9027: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7920: \$? = $ac_status" >&5 + echo "$as_me:9030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7923: \"$ac_try\"") >&5 + { (eval echo "$as_me:9033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7926: \$? = $ac_status" >&5 + echo "$as_me:9036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7932,7 +9042,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 7935 "configure" +#line 9045 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include @@ -7953,16 +9063,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9066: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7959: \$? = $ac_status" >&5 + echo "$as_me:9069: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7962: \"$ac_try\"") >&5 + { (eval echo "$as_me:9072: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7965: \$? = $ac_status" >&5 + echo "$as_me:9075: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else @@ -7973,7 +9083,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:7976: result: $ac_cv_sys_file_offset_bits" >&5 +echo "$as_me:9086: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then @@ -7982,8 +9092,8 @@ cat >>confdefs.h <&5 +rm -rf conftest* + echo "$as_me:9096: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7991,7 +9101,7 @@ else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF -#line 7994 "configure" +#line 9104 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8011,16 +9121,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8014: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9124: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8017: \$? = $ac_status" >&5 + echo "$as_me:9127: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8020: \"$ac_try\"") >&5 + { (eval echo "$as_me:9130: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8023: \$? = $ac_status" >&5 + echo "$as_me:9133: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8029,7 +9139,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8032 "configure" +#line 9142 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include @@ -8050,16 +9160,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9163: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8056: \$? = $ac_status" >&5 + echo "$as_me:9166: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8059: \"$ac_try\"") >&5 + { (eval echo "$as_me:9169: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8062: \$? = $ac_status" >&5 + echo "$as_me:9172: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else @@ -8070,7 +9180,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8073: result: $ac_cv_sys_large_files" >&5 +echo "$as_me:9183: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then @@ -8079,11 +9189,11 @@ cat >>confdefs.h <&5 + echo "$as_me:9196: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8091,7 +9201,7 @@ else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF -#line 8094 "configure" +#line 9204 "configure" #include "confdefs.h" #include int @@ -8103,16 +9213,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8106: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9216: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8109: \$? = $ac_status" >&5 + echo "$as_me:9219: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8112: \"$ac_try\"") >&5 + { (eval echo "$as_me:9222: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8115: \$? = $ac_status" >&5 + echo "$as_me:9225: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8121,7 +9231,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8124 "configure" +#line 9234 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include @@ -8134,16 +9244,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8137: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9247: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8140: \$? = $ac_status" >&5 + echo "$as_me:9250: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8143: \"$ac_try\"") >&5 + { (eval echo "$as_me:9253: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8146: \$? = $ac_status" >&5 + echo "$as_me:9256: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else @@ -8154,7 +9264,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8157: result: $ac_cv_sys_largefile_source" >&5 +echo "$as_me:9267: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then @@ -8163,18 +9273,18 @@ cat >>confdefs.h <&5 +echo "$as_me:9281: checking for fseeko" >&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8177 "configure" +#line 9287 "configure" #include "confdefs.h" #include int @@ -8186,16 +9296,16 @@ return fseeko && fseeko (stdin, 0, 0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8189: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9299: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8192: \$? = $ac_status" >&5 + echo "$as_me:9302: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8195: \"$ac_try\"") >&5 + { (eval echo "$as_me:9305: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8198: \$? = $ac_status" >&5 + echo "$as_me:9308: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else @@ -8205,7 +9315,7 @@ ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:8208: result: $ac_cv_func_fseeko" >&5 +echo "$as_me:9318: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then @@ -8226,14 +9336,14 @@ fi test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " - echo "$as_me:8229: checking whether to use struct dirent64" >&5 + echo "$as_me:9339: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8236 "configure" +#line 9346 "configure" #include "confdefs.h" #include @@ -8254,16 +9364,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8257: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9367: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8260: \$? = $ac_status" >&5 + echo "$as_me:9370: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8263: \"$ac_try\"") >&5 + { (eval echo "$as_me:9373: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8266: \$? = $ac_status" >&5 + echo "$as_me:9376: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else @@ -8274,7 +9384,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8277: result: $cf_cv_struct_dirent64" >&5 +echo "$as_me:9387: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 @@ -8283,7 +9393,7 @@ EOF fi ### use option --disable-tparm-varargs to make tparm() conform to X/Open -echo "$as_me:8286: checking if you want tparm not to use X/Open fixed-parameter list" >&5 +echo "$as_me:9396: checking if you want tparm not to use X/Open fixed-parameter list" >&5 echo $ECHO_N "checking if you want tparm not to use X/Open fixed-parameter list... $ECHO_C" >&6 # Check whether --enable-tparm-varargs or --disable-tparm-varargs was given. @@ -8293,14 +9403,14 @@ if test "${enable_tparm_varargs+set}" = set; then else with_tparm_varargs=yes fi; -echo "$as_me:8296: result: $with_tparm_varargs" >&5 +echo "$as_me:9406: result: $with_tparm_varargs" >&5 echo "${ECHO_T}$with_tparm_varargs" >&6 NCURSES_TPARM_VARARGS=0 test "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1 ### use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw if test "$with_ticlib" != no ; then -echo "$as_me:8303: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 +echo "$as_me:9413: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 echo $ECHO_N "checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library... $ECHO_C" >&6 # Check whether --enable-tic-depends or --disable-tic-depends was given. @@ -8310,14 +9420,14 @@ if test "${enable_tic_depends+set}" = set; then else with_tic_depends=yes fi; -echo "$as_me:8313: result: $with_tic_depends" >&5 +echo "$as_me:9423: result: $with_tic_depends" >&5 echo "${ECHO_T}$with_tic_depends" >&6 else with_tic_depends=no fi ### use option --with-bool to override bool's type -echo "$as_me:8320: checking for type of bool" >&5 +echo "$as_me:9430: checking for type of bool" >&5 echo $ECHO_N "checking for type of bool... $ECHO_C" >&6 # Check whether --with-bool or --without-bool was given. @@ -8327,10 +9437,10 @@ if test "${with_bool+set}" = set; then else NCURSES_BOOL=auto fi; -echo "$as_me:8330: result: $NCURSES_BOOL" >&5 +echo "$as_me:9440: result: $NCURSES_BOOL" >&5 echo "${ECHO_T}$NCURSES_BOOL" >&6 -echo "$as_me:8333: checking for alternate terminal capabilities file" >&5 +echo "$as_me:9443: checking for alternate terminal capabilities file" >&5 echo $ECHO_N "checking for alternate terminal capabilities file... $ECHO_C" >&6 # Check whether --with-caps or --without-caps was given. @@ -8341,11 +9451,11 @@ else TERMINFO_CAPS=Caps fi; test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps -echo "$as_me:8344: result: $TERMINFO_CAPS" >&5 +echo "$as_me:9454: result: $TERMINFO_CAPS" >&5 echo "${ECHO_T}$TERMINFO_CAPS" >&6 ### use option --with-chtype to override chtype's type -echo "$as_me:8348: checking for type of chtype" >&5 +echo "$as_me:9458: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 # Check whether --with-chtype or --without-chtype was given. @@ -8355,11 +9465,11 @@ if test "${with_chtype+set}" = set; then else NCURSES_CHTYPE=auto fi; -echo "$as_me:8358: result: $NCURSES_CHTYPE" >&5 +echo "$as_me:9468: result: $NCURSES_CHTYPE" >&5 echo "${ECHO_T}$NCURSES_CHTYPE" >&6 ### use option --with-ospeed to override ospeed's type -echo "$as_me:8362: checking for type of ospeed" >&5 +echo "$as_me:9472: checking for type of ospeed" >&5 echo $ECHO_N "checking for type of ospeed... $ECHO_C" >&6 # Check whether --with-ospeed or --without-ospeed was given. @@ -8369,11 +9479,11 @@ if test "${with_ospeed+set}" = set; then else NCURSES_OSPEED=short fi; -echo "$as_me:8372: result: $NCURSES_OSPEED" >&5 +echo "$as_me:9482: result: $NCURSES_OSPEED" >&5 echo "${ECHO_T}$NCURSES_OSPEED" >&6 ### use option --with-mmask-t to override mmask_t's type -echo "$as_me:8376: checking for type of mmask_t" >&5 +echo "$as_me:9486: checking for type of mmask_t" >&5 echo $ECHO_N "checking for type of mmask_t... $ECHO_C" >&6 # Check whether --with-mmask-t or --without-mmask-t was given. @@ -8383,11 +9493,25 @@ if test "${with_mmask_t+set}" = set; then else NCURSES_MMASK_T=auto fi; -echo "$as_me:8386: result: $NCURSES_MMASK_T" >&5 +echo "$as_me:9496: result: $NCURSES_MMASK_T" >&5 echo "${ECHO_T}$NCURSES_MMASK_T" >&6 +### use option --with-ccharw-max to override CCHARW_MAX size +echo "$as_me:9500: checking for size CCHARW_MAX" >&5 +echo $ECHO_N "checking for size CCHARW_MAX... $ECHO_C" >&6 + +# Check whether --with-ccharw-max or --without-ccharw-max was given. +if test "${with_ccharw_max+set}" = set; then + withval="$with_ccharw_max" + NCURSES_CCHARW_MAX="$withval" +else + NCURSES_CCHARW_MAX=5 +fi; +echo "$as_me:9510: result: $NCURSES_CCHARW_MAX" >&5 +echo "${ECHO_T}$NCURSES_CCHARW_MAX" >&6 + ### Enable compiling-in rcs id's -echo "$as_me:8390: checking if RCS identifiers should be compiled-in" >&5 +echo "$as_me:9514: checking if RCS identifiers should be compiled-in" >&5 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. @@ -8397,7 +9521,7 @@ if test "${with_rcs_ids+set}" = set; then else with_rcs_ids=no fi; -echo "$as_me:8400: result: $with_rcs_ids" >&5 +echo "$as_me:9524: result: $with_rcs_ids" >&5 echo "${ECHO_T}$with_rcs_ids" >&6 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 @@ -8405,7 +9529,7 @@ EOF ############################################################################### -echo "$as_me:8408: checking format of man-pages" >&5 +echo "$as_me:9532: checking format of man-pages" >&5 echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6 # Check whether --with-manpage-format or --without-manpage-format was given. @@ -8433,7 +9557,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[01]* $cf_dir/cat*/$cf_example.[01]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -8494,14 +9618,14 @@ unknown) ;; esac -echo "$as_me:8497: result: $MANPAGE_FORMAT" >&5 +echo "$as_me:9621: result: $MANPAGE_FORMAT" >&5 echo "${ECHO_T}$MANPAGE_FORMAT" >&6 if test -n "$cf_unknown" ; then - { echo "$as_me:8500: WARNING: Unexpected manpage-format $cf_unknown" >&5 + { echo "$as_me:9624: WARNING: Unexpected manpage-format $cf_unknown" >&5 echo "$as_me: WARNING: Unexpected manpage-format $cf_unknown" >&2;} fi -echo "$as_me:8504: checking for manpage renaming" >&5 +echo "$as_me:9628: checking for manpage renaming" >&5 echo $ECHO_N "checking for manpage renaming... $ECHO_C" >&6 # Check whether --with-manpage-renames or --without-manpage-renames was given. @@ -8529,7 +9653,7 @@ if test "$MANPAGE_RENAMES" != no ; then if test -f $srcdir/man/$MANPAGE_RENAMES ; then MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES elif test ! -f $MANPAGE_RENAMES ; then - { { echo "$as_me:8532: error: not a filename: $MANPAGE_RENAMES" >&5 + { { echo "$as_me:9656: error: not a filename: $MANPAGE_RENAMES" >&5 echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} { (exit 1); exit 1; }; } fi @@ -8543,10 +9667,10 @@ echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} fi fi -echo "$as_me:8546: result: $MANPAGE_RENAMES" >&5 +echo "$as_me:9670: result: $MANPAGE_RENAMES" >&5 echo "${ECHO_T}$MANPAGE_RENAMES" >&6 -echo "$as_me:8549: checking if manpage aliases will be installed" >&5 +echo "$as_me:9673: checking if manpage aliases will be installed" >&5 echo $ECHO_N "checking if manpage aliases will be installed... $ECHO_C" >&6 # Check whether --with-manpage-aliases or --without-manpage-aliases was given. @@ -8557,18 +9681,21 @@ else MANPAGE_ALIASES=yes fi; -echo "$as_me:8560: result: $MANPAGE_ALIASES" >&5 +echo "$as_me:9684: result: $MANPAGE_ALIASES" >&5 echo "${ECHO_T}$MANPAGE_ALIASES" >&6 -if test "$LN_S" = "ln -s"; then +case "x$LN_S" in #(vi +xln*) #(vi cf_use_symlinks=yes -else + ;; +*) cf_use_symlinks=no -fi + ;; +esac MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then -echo "$as_me:8571: checking if manpage symlinks should be used" >&5 +echo "$as_me:9698: checking if manpage symlinks should be used" >&5 echo $ECHO_N "checking if manpage symlinks should be used... $ECHO_C" >&6 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. @@ -8581,17 +9708,17 @@ fi; if test "$$cf_use_symlinks" = no; then if test "$MANPAGE_SYMLINKS" = yes ; then - { echo "$as_me:8584: WARNING: cannot make symlinks" >&5 + { echo "$as_me:9711: WARNING: cannot make symlinks" >&5 echo "$as_me: WARNING: cannot make symlinks" >&2;} MANPAGE_SYMLINKS=no fi fi -echo "$as_me:8590: result: $MANPAGE_SYMLINKS" >&5 +echo "$as_me:9717: result: $MANPAGE_SYMLINKS" >&5 echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6 fi -echo "$as_me:8594: checking for manpage tbl" >&5 +echo "$as_me:9721: checking for manpage tbl" >&5 echo $ECHO_N "checking for manpage tbl... $ECHO_C" >&6 # Check whether --with-manpage-tbl or --without-manpage-tbl was given. @@ -8602,7 +9729,7 @@ else MANPAGE_TBL=no fi; -echo "$as_me:8605: result: $MANPAGE_TBL" >&5 +echo "$as_me:9732: result: $MANPAGE_TBL" >&5 echo "${ECHO_T}$MANPAGE_TBL" >&6 if test "$prefix" = "NONE" ; then @@ -8635,7 +9762,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) #(vi +*gzip*) cf_so_strip="gz" cf_compress=gzip ;; @@ -8658,14 +9785,12 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" - INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR-/tmp}/man\$\$ +TMP=\${TMPDIR:=/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\$1 @@ -8703,7 +9828,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - \$MKDIRS \$cf_subdir\$section + mkdir -p \$cf_subdir\$section fi fi @@ -8718,12 +9843,12 @@ cat >>$cf_man_alias <<-CF_EOF2 s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g CF_EOF - for cf_name in captoinfo clear infocmp infotocap tic toe tput + for cf_name in captoinfo clear infocmp infotocap tabs tic toe tput tset do cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name, + s,@$cf_NAME@,$cf_name,g CF_EOF done @@ -8852,8 +9977,21 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -8913,7 +10051,7 @@ chmod 755 $cf_edit_man ############################################################################### ### Note that some functions (such as const) are normally disabled anyway. -echo "$as_me:8916: checking if you want to build with function extensions" >&5 +echo "$as_me:10054: checking if you want to build with function extensions" >&5 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. @@ -8923,7 +10061,7 @@ if test "${enable_ext_funcs+set}" = set; then else with_ext_funcs=yes fi; -echo "$as_me:8926: result: $with_ext_funcs" >&5 +echo "$as_me:10064: result: $with_ext_funcs" >&5 echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 @@ -8941,6 +10079,10 @@ EOF cat >>confdefs.h <<\EOF #define HAVE_RESIZE_TERM 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_TERM_ENTRY_H 1 EOF cat >>confdefs.h <<\EOF @@ -8955,12 +10097,62 @@ EOF #define NCURSES_EXT_FUNCS 1 EOF + GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 + GENERATED_EXT_FUNCS= +fi + +echo "$as_me:10106: checking if you want to build with experimental SCREEN extensions" >&5 +echo $ECHO_N "checking if you want to build with experimental SCREEN extensions... $ECHO_C" >&6 + +# Check whether --enable-sp-funcs or --disable-sp-funcs was given. +if test "${enable_sp_funcs+set}" = set; then + enableval="$enable_sp_funcs" + with_sp_funcs=$enableval +else + with_sp_funcs=no +fi; +echo "$as_me:10116: result: $with_sp_funcs" >&5 +echo "${ECHO_T}$with_sp_funcs" >&6 +if test "$with_sp_funcs" = yes ; then + NCURSES_SP_FUNCS=1 + cat >>confdefs.h <<\EOF +#define NCURSES_SP_FUNCS 1 +EOF + + GENERATED_SP_FUNCS=generated +else + NCURSES_SP_FUNCS=0 + GENERATED_SP_FUNCS= +fi + +echo "$as_me:10130: checking if you want to build with experimental terminal-driver" >&5 +echo $ECHO_N "checking if you want to build with experimental terminal-driver... $ECHO_C" >&6 + +# Check whether --enable-term-driver or --disable-term-driver was given. +if test "${enable_term_driver+set}" = set; then + enableval="$enable_term_driver" + with_term_driver=$enableval +else + with_term_driver=no +fi; +echo "$as_me:10140: result: $with_term_driver" >&5 +echo "${ECHO_T}$with_term_driver" >&6 +if test "$with_term_driver" = yes ; then + cat >>confdefs.h <<\EOF +#define USE_TERM_DRIVER 1 +EOF + + if test "$with_sp_funcs" != yes ; then + { { echo "$as_me:10148: error: The term-driver option relies upon sp-funcs" >&5 +echo "$as_me: error: The term-driver option relies upon sp-funcs" >&2;} + { (exit 1); exit 1; }; } + fi fi ### use option --enable-const to turn on use of const beyond that in XSI. -echo "$as_me:8963: checking for extended use of const keyword" >&5 +echo "$as_me:10155: checking for extended use of const keyword" >&5 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. @@ -8970,7 +10162,7 @@ if test "${enable_const+set}" = set; then else with_ext_const=no fi; -echo "$as_me:8973: result: $with_ext_const" >&5 +echo "$as_me:10165: result: $with_ext_const" >&5 echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then @@ -8978,7 +10170,7 @@ if test "$with_ext_const" = yes ; then fi ### use option --enable-ext-colors to turn on use of colors beyond 16. -echo "$as_me:8981: checking if you want to use extended colors" >&5 +echo "$as_me:10173: checking if you want to use extended colors" >&5 echo $ECHO_N "checking if you want to use extended colors... $ECHO_C" >&6 # Check whether --enable-ext-colors or --disable-ext-colors was given. @@ -8988,12 +10180,12 @@ if test "${enable_ext_colors+set}" = set; then else with_ext_colors=no fi; -echo "$as_me:8991: result: $with_ext_colors" >&5 +echo "$as_me:10183: result: $with_ext_colors" >&5 echo "${ECHO_T}$with_ext_colors" >&6 NCURSES_EXT_COLORS=0 if test "$with_ext_colors" = yes ; then if test "$with_widec" != yes ; then - { { echo "$as_me:8996: error: This option applies only to wide-character library" >&5 + { { echo "$as_me:10188: error: This option applies only to wide-character library" >&5 echo "$as_me: error: This option applies only to wide-character library" >&2;} { (exit 1); exit 1; }; } else @@ -9004,7 +10196,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9007: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:10199: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9019,7 +10211,7 @@ EOF fi ### use option --enable-ext-mouse to modify coding to support 5-button mice -echo "$as_me:9022: checking if you want to use extended mouse encoding" >&5 +echo "$as_me:10214: checking if you want to use extended mouse encoding" >&5 echo $ECHO_N "checking if you want to use extended mouse encoding... $ECHO_C" >&6 # Check whether --enable-ext-mouse or --disable-ext-mouse was given. @@ -9029,7 +10221,7 @@ if test "${enable_ext_mouse+set}" = set; then else with_ext_mouse=no fi; -echo "$as_me:9032: result: $with_ext_mouse" >&5 +echo "$as_me:10224: result: $with_ext_mouse" >&5 echo "${ECHO_T}$with_ext_mouse" >&6 NCURSES_MOUSE_VERSION=1 if test "$with_ext_mouse" = yes ; then @@ -9040,7 +10232,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9043: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:10235: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9048,7 +10240,7 @@ fi fi -echo "$as_me:9051: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "$as_me:10243: checking if you want \$NCURSES_NO_PADDING code" >&5 echo $ECHO_N "checking if you want \$NCURSES_NO_PADDING code... $ECHO_C" >&6 # Check whether --enable-no-padding or --disable-no-padding was given. @@ -9058,19 +10250,19 @@ if test "${enable_no_padding+set}" = set; then else with_no_padding=$with_ext_funcs fi; -echo "$as_me:9061: result: $with_no_padding" >&5 +echo "$as_me:10253: result: $with_no_padding" >&5 echo "${ECHO_T}$with_no_padding" >&6 test "$with_no_padding" = yes && cat >>confdefs.h <<\EOF #define NCURSES_NO_PADDING 1 EOF -echo "$as_me:9067: checking for ANSI C header files" >&5 +echo "$as_me:10259: 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 9073 "configure" +#line 10265 "configure" #include "confdefs.h" #include #include @@ -9078,13 +10270,13 @@ else #include _ACEOF -if { (eval echo "$as_me:9081: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10273: \"$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:9087: \$? = $ac_status" >&5 + echo "$as_me:10279: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9106,7 +10298,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 9109 "configure" +#line 10301 "configure" #include "confdefs.h" #include @@ -9117,14 +10309,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* 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 9127 "configure" +#line 10319 "configure" #include "confdefs.h" #include @@ -9135,7 +10327,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -9145,7 +10337,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 9148 "configure" +#line 10340 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -9171,15 +10363,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9174: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10366: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9177: \$? = $ac_status" >&5 + echo "$as_me:10369: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9179: \"$ac_try\"") >&5 + { (eval echo "$as_me:10371: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9182: \$? = $ac_status" >&5 + echo "$as_me:10374: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -9192,7 +10384,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:9195: result: $ac_cv_header_stdc" >&5 +echo "$as_me:10387: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -9208,28 +10400,28 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:9211: checking for $ac_header" >&5 +echo "$as_me:10403: 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 9217 "configure" +#line 10409 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9223: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10415: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9226: \$? = $ac_status" >&5 + echo "$as_me:10418: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9229: \"$ac_try\"") >&5 + { (eval echo "$as_me:10421: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9232: \$? = $ac_status" >&5 + echo "$as_me:10424: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -9239,7 +10431,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9242: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:10434: 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 <&5 +echo "$as_me:10444: checking for signed char" >&5 echo $ECHO_N "checking for signed char... $ECHO_C" >&6 if test "${ac_cv_type_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9258 "configure" +#line 10450 "configure" #include "confdefs.h" $ac_includes_default int @@ -9270,16 +10462,16 @@ if (sizeof (signed char)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9273: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10465: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9276: \$? = $ac_status" >&5 + echo "$as_me:10468: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9279: \"$ac_try\"") >&5 + { (eval echo "$as_me:10471: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9282: \$? = $ac_status" >&5 + echo "$as_me:10474: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signed_char=yes else @@ -9289,10 +10481,10 @@ ac_cv_type_signed_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9292: result: $ac_cv_type_signed_char" >&5 +echo "$as_me:10484: result: $ac_cv_type_signed_char" >&5 echo "${ECHO_T}$ac_cv_type_signed_char" >&6 -echo "$as_me:9295: checking size of signed char" >&5 +echo "$as_me:10487: checking size of signed char" >&5 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6 if test "${ac_cv_sizeof_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9301,7 +10493,7 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line 9304 "configure" +#line 10496 "configure" #include "confdefs.h" $ac_includes_default int @@ -9313,21 +10505,21 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9316: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10508: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9319: \$? = $ac_status" >&5 + echo "$as_me:10511: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9322: \"$ac_try\"") >&5 + { (eval echo "$as_me:10514: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9325: \$? = $ac_status" >&5 + echo "$as_me:10517: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 9330 "configure" +#line 10522 "configure" #include "confdefs.h" $ac_includes_default int @@ -9339,16 +10531,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9342: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10534: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9345: \$? = $ac_status" >&5 + echo "$as_me:10537: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9348: \"$ac_try\"") >&5 + { (eval echo "$as_me:10540: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9351: \$? = $ac_status" >&5 + echo "$as_me:10543: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else @@ -9364,7 +10556,7 @@ cat conftest.$ac_ext >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 9367 "configure" +#line 10559 "configure" #include "confdefs.h" $ac_includes_default int @@ -9376,16 +10568,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9379: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10571: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9382: \$? = $ac_status" >&5 + echo "$as_me:10574: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9385: \"$ac_try\"") >&5 + { (eval echo "$as_me:10577: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9388: \$? = $ac_status" >&5 + echo "$as_me:10580: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else @@ -9401,7 +10593,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line 9404 "configure" +#line 10596 "configure" #include "confdefs.h" $ac_includes_default int @@ -9413,16 +10605,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9416: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10608: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9419: \$? = $ac_status" >&5 + echo "$as_me:10611: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9422: \"$ac_try\"") >&5 + { (eval echo "$as_me:10614: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9425: \$? = $ac_status" >&5 + echo "$as_me:10617: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else @@ -9435,12 +10627,12 @@ done ac_cv_sizeof_signed_char=$ac_lo else if test "$cross_compiling" = yes; then - { { echo "$as_me:9438: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:10630: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 9443 "configure" +#line 10635 "configure" #include "confdefs.h" $ac_includes_default int @@ -9456,15 +10648,15 @@ fclose (f); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9459: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10651: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9462: \$? = $ac_status" >&5 + echo "$as_me:10654: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9464: \"$ac_try\"") >&5 + { (eval echo "$as_me:10656: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9467: \$? = $ac_status" >&5 + echo "$as_me:10659: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_signed_char=`cat conftest.val` else @@ -9480,7 +10672,7 @@ else ac_cv_sizeof_signed_char=0 fi fi -echo "$as_me:9483: result: $ac_cv_sizeof_signed_char" >&5 +echo "$as_me:10675: result: $ac_cv_sizeof_signed_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6 cat >>confdefs.h <&5 +echo "$as_me:10686: checking if you want to use signed Boolean array in term.h" >&5 echo $ECHO_N "checking if you want to use signed Boolean array in term.h... $ECHO_C" >&6 # Check whether --enable-signed-char or --disable-signed-char was given. @@ -9501,12 +10693,12 @@ if test "${enable_signed_char+set}" = set; then else with_signed_char=no fi; -echo "$as_me:9504: result: $with_signed_char" >&5 +echo "$as_me:10696: result: $with_signed_char" >&5 echo "${ECHO_T}$with_signed_char" >&6 test "$with_signed_char" != yes && NCURSES_SBOOL="char" ### use option --enable-sigwinch to turn on use of SIGWINCH logic -echo "$as_me:9509: checking if you want SIGWINCH handler" >&5 +echo "$as_me:10701: checking if you want SIGWINCH handler" >&5 echo $ECHO_N "checking if you want SIGWINCH handler... $ECHO_C" >&6 # Check whether --enable-sigwinch or --disable-sigwinch was given. @@ -9516,14 +10708,14 @@ if test "${enable_sigwinch+set}" = set; then else with_sigwinch=$with_ext_funcs fi; -echo "$as_me:9519: result: $with_sigwinch" >&5 +echo "$as_me:10711: result: $with_sigwinch" >&5 echo "${ECHO_T}$with_sigwinch" >&6 test "$with_sigwinch" = yes && cat >>confdefs.h <<\EOF #define USE_SIGWINCH 1 EOF ### use option --enable-tcap-names to allow user to define new capabilities -echo "$as_me:9526: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "$as_me:10718: checking if you want user-definable terminal capabilities like termcap" >&5 echo $ECHO_N "checking if you want user-definable terminal capabilities like termcap... $ECHO_C" >&6 # Check whether --enable-tcap-names or --disable-tcap-names was given. @@ -9533,7 +10725,7 @@ if test "${enable_tcap_names+set}" = set; then else with_tcap_names=$with_ext_funcs fi; -echo "$as_me:9536: result: $with_tcap_names" >&5 +echo "$as_me:10728: result: $with_tcap_names" >&5 echo "${ECHO_T}$with_tcap_names" >&6 NCURSES_XNAMES=0 test "$with_tcap_names" = yes && NCURSES_XNAMES=1 @@ -9541,7 +10733,7 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 ############################################################################### # These options are relatively safe to experiment with. -echo "$as_me:9544: checking if you want all development code" >&5 +echo "$as_me:10736: checking if you want all development code" >&5 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. @@ -9551,11 +10743,11 @@ if test "${with_develop+set}" = set; then else with_develop=no fi; -echo "$as_me:9554: result: $with_develop" >&5 +echo "$as_me:10746: result: $with_develop" >&5 echo "${ECHO_T}$with_develop" >&6 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -echo "$as_me:9558: checking if you want hard-tabs code" >&5 +echo "$as_me:10750: checking if you want hard-tabs code" >&5 echo $ECHO_N "checking if you want hard-tabs code... $ECHO_C" >&6 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. @@ -9565,14 +10757,14 @@ if test "${enable_hard_tabs+set}" = set; then else enable_hard_tabs=$with_develop fi; -echo "$as_me:9568: result: $enable_hard_tabs" >&5 +echo "$as_me:10760: result: $enable_hard_tabs" >&5 echo "${ECHO_T}$enable_hard_tabs" >&6 test "$enable_hard_tabs" = yes && cat >>confdefs.h <<\EOF #define USE_HARD_TABS 1 EOF ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -echo "$as_me:9575: checking if you want limited support for xmc" >&5 +echo "$as_me:10767: checking if you want limited support for xmc" >&5 echo $ECHO_N "checking if you want limited support for xmc... $ECHO_C" >&6 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. @@ -9582,7 +10774,7 @@ if test "${enable_xmc_glitch+set}" = set; then else enable_xmc_glitch=$with_develop fi; -echo "$as_me:9585: result: $enable_xmc_glitch" >&5 +echo "$as_me:10777: result: $enable_xmc_glitch" >&5 echo "${ECHO_T}$enable_xmc_glitch" >&6 test "$enable_xmc_glitch" = yes && cat >>confdefs.h <<\EOF #define USE_XMC_SUPPORT 1 @@ -9591,7 +10783,7 @@ EOF ############################################################################### # These are just experimental, probably should not be in a package: -echo "$as_me:9594: checking if you do not want to assume colors are white-on-black" >&5 +echo "$as_me:10786: checking if you do not want to assume colors are white-on-black" >&5 echo $ECHO_N "checking if you do not want to assume colors are white-on-black... $ECHO_C" >&6 # Check whether --enable-assumed-color or --disable-assumed-color was given. @@ -9601,14 +10793,14 @@ if test "${enable_assumed_color+set}" = set; then else with_assumed_color=yes fi; -echo "$as_me:9604: result: $with_assumed_color" >&5 +echo "$as_me:10796: result: $with_assumed_color" >&5 echo "${ECHO_T}$with_assumed_color" >&6 test "$with_assumed_color" = yes && cat >>confdefs.h <<\EOF #define USE_ASSUMED_COLOR 1 EOF ### use option --enable-hashmap to turn on use of hashmap scrolling logic -echo "$as_me:9611: checking if you want hashmap scrolling-optimization code" >&5 +echo "$as_me:10803: checking if you want hashmap scrolling-optimization code" >&5 echo $ECHO_N "checking if you want hashmap scrolling-optimization code... $ECHO_C" >&6 # Check whether --enable-hashmap or --disable-hashmap was given. @@ -9618,14 +10810,14 @@ if test "${enable_hashmap+set}" = set; then else with_hashmap=yes fi; -echo "$as_me:9621: result: $with_hashmap" >&5 +echo "$as_me:10813: result: $with_hashmap" >&5 echo "${ECHO_T}$with_hashmap" >&6 test "$with_hashmap" = yes && cat >>confdefs.h <<\EOF #define USE_HASHMAP 1 EOF ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -echo "$as_me:9628: checking if you want colorfgbg code" >&5 +echo "$as_me:10820: checking if you want colorfgbg code" >&5 echo $ECHO_N "checking if you want colorfgbg code... $ECHO_C" >&6 # Check whether --enable-colorfgbg or --disable-colorfgbg was given. @@ -9635,16 +10827,33 @@ if test "${enable_colorfgbg+set}" = set; then else with_colorfgbg=no fi; -echo "$as_me:9638: result: $with_colorfgbg" >&5 +echo "$as_me:10830: result: $with_colorfgbg" >&5 echo "${ECHO_T}$with_colorfgbg" >&6 test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF #define USE_COLORFGBG 1 EOF +### use option --enable-interop to turn on use of bindings used for interop +echo "$as_me:10837: checking if you want interop bindings" >&5 +echo $ECHO_N "checking if you want interop bindings... $ECHO_C" >&6 + +# Check whether --enable-interop or --disable-interop was given. +if test "${enable_interop+set}" = set; then + enableval="$enable_interop" + with_exp_interop=$enableval +else + with_exp_interop=no +fi; +echo "$as_me:10847: result: $with_exp_interop" >&5 +echo "${ECHO_T}$with_exp_interop" >&6 + +NCURSES_INTEROP_FUNCS=0 +test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 + # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. -echo "$as_me:9647: checking if you want to link with the pthread library" >&5 +echo "$as_me:10856: checking if you want to link with the pthread library" >&5 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 # Check whether --with-pthread or --without-pthread was given. @@ -9654,27 +10863,27 @@ if test "${with_pthread+set}" = set; then else with_pthread=no fi; -echo "$as_me:9657: result: $with_pthread" >&5 +echo "$as_me:10866: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" != no ; then - echo "$as_me:9661: checking for pthread.h" >&5 + echo "$as_me:10870: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9667 "configure" +#line 10876 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:9671: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10880: \"$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:9677: \$? = $ac_status" >&5 + echo "$as_me:10886: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9693,7 +10902,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:9696: result: $ac_cv_header_pthread_h" >&5 +echo "$as_me:10905: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 if test $ac_cv_header_pthread_h = yes; then @@ -9701,12 +10910,12 @@ if test $ac_cv_header_pthread_h = yes; then #define HAVE_PTHREADS_H 1 EOF - echo "$as_me:9704: checking if we can link with the pthread library" >&5 + echo "$as_me:10913: checking if we can link with the pthread library" >&5 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6 cf_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 9709 "configure" +#line 10918 "configure" #include "confdefs.h" #include @@ -9722,16 +10931,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9725: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10934: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9728: \$? = $ac_status" >&5 + echo "$as_me:10937: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9731: \"$ac_try\"") >&5 + { (eval echo "$as_me:10940: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9734: \$? = $ac_status" >&5 + echo "$as_me:10943: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_pthread=yes else @@ -9741,7 +10950,7 @@ with_pthread=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:9744: result: $with_pthread" >&5 + echo "$as_me:10953: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" = yes ; then @@ -9751,7 +10960,7 @@ echo "${ECHO_T}$with_pthread" >&6 EOF else - { { echo "$as_me:9754: error: Cannot link with pthread library" >&5 + { { echo "$as_me:10963: error: Cannot link with pthread library" >&5 echo "$as_me: error: Cannot link with pthread library" >&2;} { (exit 1); exit 1; }; } fi @@ -9760,28 +10969,109 @@ fi fi -echo "$as_me:9763: checking if you want to use weak-symbols for pthreads" >&5 +if test "x$with_pthread" != xno; then + echo "$as_me:10973: checking for pthread_kill" >&5 +echo $ECHO_N "checking for pthread_kill... $ECHO_C" >&6 +if test "${ac_cv_func_pthread_kill+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 10979 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_kill (); below. */ +#include +/* 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 pthread_kill (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_pthread_kill) || defined (__stub___pthread_kill) +choke me +#else +f = pthread_kill; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11010: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11013: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11016: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11019: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_pthread_kill=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_pthread_kill=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11029: result: $ac_cv_func_pthread_kill" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_kill" >&6 +if test $ac_cv_func_pthread_kill = yes; then + + echo "$as_me:11033: checking if you want to allow EINTR in wgetch with pthreads" >&5 +echo $ECHO_N "checking if you want to allow EINTR in wgetch with pthreads... $ECHO_C" >&6 + +# Check whether --enable-pthreads-eintr or --disable-pthreads-eintr was given. +if test "${enable_pthreads_eintr+set}" = set; then + enableval="$enable_pthreads_eintr" + use_pthreads_eintr=$enableval +else + use_pthreads_eintr=no +fi; + echo "$as_me:11043: result: $use_pthreads_eintr" >&5 +echo "${ECHO_T}$use_pthreads_eintr" >&6 + if test $use_pthreads_eintr = yes ; then + cat >>confdefs.h <<\EOF +#define USE_PTHREADS_EINTR 1 +EOF + + fi +fi + + echo "$as_me:11053: checking if you want to use weak-symbols for pthreads" >&5 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 # Check whether --enable-weak-symbols or --disable-weak-symbols was given. if test "${enable_weak_symbols+set}" = set; then enableval="$enable_weak_symbols" - use_weak_symbols=$withval + use_weak_symbols=$enableval else use_weak_symbols=no fi; -echo "$as_me:9773: result: $use_weak_symbols" >&5 + echo "$as_me:11063: result: $use_weak_symbols" >&5 echo "${ECHO_T}$use_weak_symbols" >&6 -if test "$use_weak_symbols" = yes ; then + if test "$use_weak_symbols" = yes ; then -echo "$as_me:9777: checking if $CC supports weak symbols" >&5 +echo "$as_me:11067: checking if $CC supports weak symbols" >&5 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 if test "${cf_cv_weak_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9784 "configure" +#line 11074 "configure" #include "confdefs.h" #include @@ -9807,16 +11097,16 @@ weak_symbol(fopen); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9810: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11100: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9813: \$? = $ac_status" >&5 + echo "$as_me:11103: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9816: \"$ac_try\"") >&5 + { (eval echo "$as_me:11106: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9819: \$? = $ac_status" >&5 + echo "$as_me:11109: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_weak_symbols=yes else @@ -9827,18 +11117,19 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9830: result: $cf_cv_weak_symbols" >&5 +echo "$as_me:11120: result: $cf_cv_weak_symbols" >&5 echo "${ECHO_T}$cf_cv_weak_symbols" >&6 -else - cf_cv_weak_symbols=no -fi + else + cf_cv_weak_symbols=no + fi -if test $cf_cv_weak_symbols = yes ; then - cat >>confdefs.h <<\EOF + if test $cf_cv_weak_symbols = yes ; then + cat >>confdefs.h <<\EOF #define USE_WEAK_SYMBOLS 1 EOF + fi fi PTHREAD= @@ -9857,7 +11148,7 @@ fi # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. -echo "$as_me:9860: checking if you want experimental reentrant code" >&5 +echo "$as_me:11151: checking if you want experimental reentrant code" >&5 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 # Check whether --enable-reentrant or --disable-reentrant was given. @@ -9867,21 +11158,23 @@ if test "${enable_reentrant+set}" = set; then else with_reentrant=no fi; -echo "$as_me:9870: result: $with_reentrant" >&5 +echo "$as_me:11161: result: $with_reentrant" >&5 echo "${ECHO_T}$with_reentrant" >&6 if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then + if test $cf_cv_weak_symbols = yes ; then # remove pthread library from $LIBS LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + TEST_LIBS="-lpthread $TEST_LIBS" + TEST_LIBS2="-lpthread $TEST_LIBS2" + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi cat >>confdefs.h <<\EOF #define USE_REENTRANT 1 EOF @@ -9891,7 +11184,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9894: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:11187: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9904,7 +11197,29 @@ else NCURSES_SIZE_T=short fi -echo "$as_me:9907: checking if you want experimental safe-sprintf code" >&5 +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + echo "$as_me:11202: checking for prefix used to wrap public variables" >&5 +echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 + +# Check whether --with-wrap-prefix or --without-wrap-prefix was given. +if test "${with_wrap_prefix+set}" = set; then + withval="$with_wrap_prefix" + NCURSES_WRAP_PREFIX=$withval +else + NCURSES_WRAP_PREFIX=_nc_ +fi; + echo "$as_me:11212: result: $NCURSES_WRAP_PREFIX" >&5 +echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 +else + NCURSES_WRAP_PREFIX=_nc_ +fi + +cat >>confdefs.h <&5 echo $ECHO_N "checking if you want experimental safe-sprintf code... $ECHO_C" >&6 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given. @@ -9914,7 +11229,7 @@ if test "${enable_safe_sprintf+set}" = set; then else with_safe_sprintf=no fi; -echo "$as_me:9917: result: $with_safe_sprintf" >&5 +echo "$as_me:11232: result: $with_safe_sprintf" >&5 echo "${ECHO_T}$with_safe_sprintf" >&6 test "$with_safe_sprintf" = yes && cat >>confdefs.h <<\EOF #define USE_SAFE_SPRINTF 1 @@ -9923,7 +11238,7 @@ EOF ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic # when hashmap is used scroll hints are useless if test "$with_hashmap" = no ; then -echo "$as_me:9926: checking if you want to experiment without scrolling-hints code" >&5 +echo "$as_me:11241: checking if you want to experiment without scrolling-hints code" >&5 echo $ECHO_N "checking if you want to experiment without scrolling-hints code... $ECHO_C" >&6 # Check whether --enable-scroll-hints or --disable-scroll-hints was given. @@ -9933,7 +11248,7 @@ if test "${enable_scroll_hints+set}" = set; then else with_scroll_hints=yes fi; -echo "$as_me:9936: result: $with_scroll_hints" >&5 +echo "$as_me:11251: result: $with_scroll_hints" >&5 echo "${ECHO_T}$with_scroll_hints" >&6 test "$with_scroll_hints" = yes && cat >>confdefs.h <<\EOF #define USE_SCROLL_HINTS 1 @@ -9941,7 +11256,7 @@ EOF fi -echo "$as_me:9944: checking if you want experimental wgetch-events code" >&5 +echo "$as_me:11259: checking if you want experimental wgetch-events code" >&5 echo $ECHO_N "checking if you want experimental wgetch-events code... $ECHO_C" >&6 # Check whether --enable-wgetch-events or --disable-wgetch-events was given. @@ -9951,7 +11266,7 @@ if test "${enable_wgetch_events+set}" = set; then else with_wgetch_events=no fi; -echo "$as_me:9954: result: $with_wgetch_events" >&5 +echo "$as_me:11269: result: $with_wgetch_events" >&5 echo "${ECHO_T}$with_wgetch_events" >&6 test "$with_wgetch_events" = yes && cat >>confdefs.h <<\EOF #define NCURSES_WGETCH_EVENTS 1 @@ -9960,7 +11275,7 @@ EOF ############################################################################### ### use option --disable-echo to suppress full display compiling commands -echo "$as_me:9963: checking if you want to display full commands during build" >&5 +echo "$as_me:11278: checking if you want to display full commands during build" >&5 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -9977,11 +11292,11 @@ else test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent" fi -echo "$as_me:9980: result: $with_echo" >&5 +echo "$as_me:11295: result: $with_echo" >&5 echo "${ECHO_T}$with_echo" >&6 ### use option --enable-warnings to turn on all gcc warnings -echo "$as_me:9984: checking if you want to see compiler warnings" >&5 +echo "$as_me:11299: checking if you want to see compiler warnings" >&5 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. @@ -9989,10 +11304,11 @@ if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval fi; -echo "$as_me:9992: result: $with_warnings" >&5 +echo "$as_me:11307: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "x$with_warnings" = "xyes"; then + ADAFLAGS="$ADAFLAGS -gnatg" INTEL_COMPILER=no @@ -10000,12 +11316,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:10003: checking if this is really Intel C compiler" >&5 + echo "$as_me:11319: 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 10008 "configure" +#line 11324 "configure" #include "confdefs.h" int @@ -10022,16 +11338,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10025: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11341: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10028: \$? = $ac_status" >&5 + echo "$as_me:11344: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10031: \"$ac_try\"") >&5 + { (eval echo "$as_me:11347: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10034: \$? = $ac_status" >&5 + echo "$as_me:11350: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -10042,14 +11358,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:10045: result: $INTEL_COMPILER" >&5 + echo "$as_me:11361: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <&5 + { echo "$as_me:11385: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ - wd1682 \ wd1683 \ wd1684 \ wd193 \ - wd279 \ wd593 \ + wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:10087: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11401: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10090: \$? = $ac_status" >&5 + echo "$as_me:11404: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10092: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11406: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -10098,13 +11412,13 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:10101: checking for $CC warning options..." >&5 + { echo "$as_me:11415: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS="-W -Wall" + EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" - for cf_opt in \ + for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ @@ -10118,12 +11432,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:10121: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11435: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10124: \$? = $ac_status" >&5 + echo "$as_me:11438: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10126: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11440: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -10134,7 +11448,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:11451: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -10145,7 +11459,7 @@ echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION .. done CFLAGS="$cf_save_CFLAGS" fi -rm -f conftest* +rm -rf conftest* if test "$cf_with_cxx" = yes ; then @@ -10154,12 +11468,12 @@ INTEL_CPLUSPLUS=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:10157: checking if this is really Intel C++ compiler" >&5 + echo "$as_me:11471: 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="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 10162 "configure" +#line 11476 "configure" #include "confdefs.h" int @@ -10176,16 +11490,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10179: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11493: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10182: \$? = $ac_status" >&5 + echo "$as_me:11496: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10185: \"$ac_try\"") >&5 + { (eval echo "$as_me:11499: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10188: \$? = $ac_status" >&5 + echo "$as_me:11502: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_CPLUSPLUS=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -10196,7 +11510,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$cf_save_CFLAGS" - echo "$as_me:10199: result: $INTEL_CPLUSPLUS" >&5 + echo "$as_me:11513: result: $INTEL_CPLUSPLUS" >&5 echo "${ECHO_T}$INTEL_CPLUSPLUS" >&6 ;; esac @@ -10210,7 +11524,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat > conftest.$ac_ext <&5 + { echo "$as_me:11545: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-Wall" @@ -10245,12 +11559,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -$cf_opt" - if { (eval echo "$as_me:10248: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11562: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10251: \$? = $ac_status" >&5 + echo "$as_me:11565: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10253: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11567: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" fi @@ -10259,7 +11573,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GXX" = yes then - { echo "$as_me:10262: checking for $CXX warning options..." >&5 + { echo "$as_me:11576: checking for $CXX warning options..." >&5 echo "$as_me: checking for $CXX warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-W -Wall" @@ -10288,23 +11602,23 @@ echo "$as_me: checking for $CXX warning options..." >&6;} Wundef $cf_gxx_extra_warnings Wno-unused do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -Werror -$cf_opt" - if { (eval echo "$as_me:10291: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11605: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10294: \$? = $ac_status" >&5 + echo "$as_me:11608: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10296: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11610: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" else - test -n "$verbose" && echo "$as_me:10300: result: ... no -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11614: result: ... no -$cf_opt" >&5 echo "${ECHO_T}... no -$cf_opt" >&6 fi done CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -f conftest* +rm -rf conftest* ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -10333,10 +11647,10 @@ cat > conftest.i <&5 + { echo "$as_me:11650: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <&5 + + if { (eval echo "$as_me:11702: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10380: \$? = $ac_status" >&5 + echo "$as_me:11705: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10382: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:11707: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <&5 +echo "$as_me:11743: checking if you want to enable runtime assertions" >&5 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. @@ -10401,7 +11750,7 @@ if test "${enable_assertions+set}" = set; then else with_assertions=no fi; -echo "$as_me:10404: result: $with_assertions" >&5 +echo "$as_me:11753: result: $with_assertions" >&5 echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then @@ -10413,13 +11762,15 @@ EOF CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + + ADAFLAGS="$ADAFLAGS -gnata" + fi fi ### use option --disable-leaks to suppress "permanent" leaks, for testing -echo "$as_me:10422: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:11773: 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. @@ -10435,7 +11786,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:10438: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:11789: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -10461,8 +11812,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10477,6 +11828,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10492,8 +11853,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10505,7 +11866,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10519,23 +11880,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:10522: checking for dmalloc.h" >&5 + echo "$as_me:11883: 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 10528 "configure" +#line 11889 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10532: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:11893: \"$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:10538: \$? = $ac_status" >&5 + echo "$as_me:11899: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10554,11 +11915,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10557: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:11918: 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:10561: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:11922: 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 @@ -10566,7 +11927,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10569 "configure" +#line 11930 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10585,16 +11946,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10588: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11949: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10591: \$? = $ac_status" >&5 + echo "$as_me:11952: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10594: \"$ac_try\"") >&5 + { (eval echo "$as_me:11955: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10597: \$? = $ac_status" >&5 + echo "$as_me:11958: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -10605,7 +11966,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10608: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:11969: 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 <&5 +echo "$as_me:11984: 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. @@ -10636,7 +11997,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:10639: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:12000: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -10662,8 +12023,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10678,6 +12039,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10693,8 +12064,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10706,7 +12077,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10720,23 +12091,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:10723: checking for dbmalloc.h" >&5 + echo "$as_me:12094: 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 10729 "configure" +#line 12100 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10733: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:12104: \"$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:10739: \$? = $ac_status" >&5 + echo "$as_me:12110: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10755,11 +12126,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10758: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:12129: 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:10762: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:12133: 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 @@ -10767,7 +12138,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10770 "configure" +#line 12141 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10786,16 +12157,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10789: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12160: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10792: \$? = $ac_status" >&5 + echo "$as_me:12163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10795: \"$ac_try\"") >&5 + { (eval echo "$as_me:12166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10798: \$? = $ac_status" >&5 + echo "$as_me:12169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -10806,7 +12177,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10809: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:12180: 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 <&5 +echo "$as_me:12195: 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. @@ -10837,7 +12208,7 @@ EOF else with_valgrind= fi; -echo "$as_me:10840: result: ${with_valgrind:-no}" >&5 +echo "$as_me:12211: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in #(vi @@ -10863,8 +12234,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10879,6 +12250,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10894,8 +12275,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10907,7 +12288,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10920,22 +12301,26 @@ fi ;; esac -echo "$as_me:10923: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:12304: 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. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - with_no_leaks=yes + if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi else : ${with_no_leaks:=no} fi; -echo "$as_me:10933: result: $with_no_leaks" >&5 +echo "$as_me:12314: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 +EOF + + cat >>confdefs.h <<\EOF +#define YY_NO_LEAKS 1 EOF fi @@ -10975,7 +12360,7 @@ case "$CFLAGS $CPPFLAGS" in ;; esac -echo "$as_me:10978: checking whether to add trace feature to all models" >&5 +echo "$as_me:12363: checking whether to add trace feature to all models" >&5 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 # Check whether --with-trace or --without-trace was given. @@ -10985,7 +12370,7 @@ if test "${with_trace+set}" = set; then else cf_with_trace=$cf_all_traces fi; -echo "$as_me:10988: result: $cf_with_trace" >&5 +echo "$as_me:12373: result: $cf_with_trace" >&5 echo "${ECHO_T}$cf_with_trace" >&6 if test "$cf_with_trace" = yes ; then @@ -11008,8 +12393,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -11024,6 +12409,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -11039,8 +12434,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -11052,7 +12447,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -11066,13 +12461,17 @@ else fi ### Checks for libraries. -echo "$as_me:11069: checking for gettimeofday" >&5 +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) +echo "$as_me:12468: checking for gettimeofday" >&5 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 if test "${ac_cv_func_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11075 "configure" +#line 12474 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday (); below. */ @@ -11103,16 +12502,16 @@ f = gettimeofday; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11106: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12505: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11109: \$? = $ac_status" >&5 + echo "$as_me:12508: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11112: \"$ac_try\"") >&5 + { (eval echo "$as_me:12511: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11115: \$? = $ac_status" >&5 + echo "$as_me:12514: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gettimeofday=yes else @@ -11122,7 +12521,7 @@ ac_cv_func_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:11125: result: $ac_cv_func_gettimeofday" >&5 +echo "$as_me:12524: result: $ac_cv_func_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 if test $ac_cv_func_gettimeofday = yes; then cat >>confdefs.h <<\EOF @@ -11131,7 +12530,7 @@ EOF else -echo "$as_me:11134: checking for gettimeofday in -lbsd" >&5 +echo "$as_me:12533: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11139,7 +12538,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11142 "configure" +#line 12541 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11158,16 +12557,16 @@ gettimeofday (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11161: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12560: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11164: \$? = $ac_status" >&5 + echo "$as_me:12563: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11167: \"$ac_try\"") >&5 + { (eval echo "$as_me:12566: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11170: \$? = $ac_status" >&5 + echo "$as_me:12569: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else @@ -11178,26 +12577,28 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11181: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "$as_me:12580: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF - LIBS="$LIBS -lbsd" + LIBS="-lbsd $LIBS" fi fi + ;; +esac -echo "$as_me:11193: checking if -lm needed for math functions" >&5 +echo "$as_me:12594: 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 11200 "configure" +#line 12601 "configure" #include "confdefs.h" #include @@ -11212,16 +12613,16 @@ double x = rand(); printf("result = %g\n", sin(x)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11215: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12616: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11218: \$? = $ac_status" >&5 + echo "$as_me:12619: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11221: \"$ac_try\"") >&5 + { (eval echo "$as_me:12622: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11224: \$? = $ac_status" >&5 + echo "$as_me:12625: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_need_libm=no else @@ -11231,7 +12632,7 @@ cf_cv_need_libm=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:11234: result: $cf_cv_need_libm" >&5 +echo "$as_me:12635: result: $cf_cv_need_libm" >&5 echo "${ECHO_T}$cf_cv_need_libm" >&6 if test "$cf_cv_need_libm" = yes then @@ -11239,13 +12640,13 @@ MATH_LIB=-lm fi ### Checks for header files. -echo "$as_me:11242: checking for ANSI C header files" >&5 +echo "$as_me:12643: 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 11248 "configure" +#line 12649 "configure" #include "confdefs.h" #include #include @@ -11253,13 +12654,13 @@ else #include _ACEOF -if { (eval echo "$as_me:11256: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:12657: \"$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:11262: \$? = $ac_status" >&5 + echo "$as_me:12663: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11281,7 +12682,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 11284 "configure" +#line 12685 "configure" #include "confdefs.h" #include @@ -11292,14 +12693,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* 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 11302 "configure" +#line 12703 "configure" #include "confdefs.h" #include @@ -11310,7 +12711,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -11320,7 +12721,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 11323 "configure" +#line 12724 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -11346,15 +12747,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:11349: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12750: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11352: \$? = $ac_status" >&5 + echo "$as_me:12753: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:11354: \"$ac_try\"") >&5 + { (eval echo "$as_me:12755: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11357: \$? = $ac_status" >&5 + echo "$as_me:12758: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -11367,7 +12768,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:11370: result: $ac_cv_header_stdc" >&5 +echo "$as_me:12771: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -11380,13 +12781,13 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:11383: checking for $ac_hdr that defines DIR" >&5 +echo "$as_me:12784: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $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 11389 "configure" +#line 12790 "configure" #include "confdefs.h" #include #include <$ac_hdr> @@ -11401,16 +12802,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11404: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12805: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11407: \$? = $ac_status" >&5 + echo "$as_me:12808: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11410: \"$ac_try\"") >&5 + { (eval echo "$as_me:12811: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11413: \$? = $ac_status" >&5 + echo "$as_me:12814: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -11420,7 +12821,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11423: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:12824: 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 <&5 + echo "$as_me:12837: checking for opendir in -ldir" >&5 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 if test "${ac_cv_lib_dir_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11441,7 +12842,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11444 "configure" +#line 12845 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11460,16 +12861,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11463: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12864: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11466: \$? = $ac_status" >&5 + echo "$as_me:12867: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11469: \"$ac_try\"") >&5 + { (eval echo "$as_me:12870: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11472: \$? = $ac_status" >&5 + echo "$as_me:12873: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dir_opendir=yes else @@ -11480,14 +12881,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11483: result: $ac_cv_lib_dir_opendir" >&5 +echo "$as_me:12884: result: $ac_cv_lib_dir_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" fi else - echo "$as_me:11490: checking for opendir in -lx" >&5 + echo "$as_me:12891: checking for opendir in -lx" >&5 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 if test "${ac_cv_lib_x_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11495,7 +12896,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11498 "configure" +#line 12899 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11514,16 +12915,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11517: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12918: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11520: \$? = $ac_status" >&5 + echo "$as_me:12921: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11523: \"$ac_try\"") >&5 + { (eval echo "$as_me:12924: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11526: \$? = $ac_status" >&5 + echo "$as_me:12927: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_x_opendir=yes else @@ -11534,7 +12935,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11537: result: $ac_cv_lib_x_opendir" >&5 +echo "$as_me:12938: result: $ac_cv_lib_x_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 if test $ac_cv_lib_x_opendir = yes; then LIBS="$LIBS -lx" @@ -11542,13 +12943,13 @@ fi fi -echo "$as_me:11545: checking whether time.h and sys/time.h may both be included" >&5 +echo "$as_me:12946: 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 11551 "configure" +#line 12952 "configure" #include "confdefs.h" #include #include @@ -11564,16 +12965,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11567: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12968: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11570: \$? = $ac_status" >&5 + echo "$as_me:12971: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11573: \"$ac_try\"") >&5 + { (eval echo "$as_me:12974: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11576: \$? = $ac_status" >&5 + echo "$as_me:12977: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else @@ -11583,7 +12984,7 @@ ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11586: result: $ac_cv_header_time" >&5 +echo "$as_me:12987: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then @@ -11593,90 +12994,287 @@ EOF fi -echo "$as_me:11596: checking for regular-expression headers" >&5 +cf_regex_func=no + +cf_regex_libs="regex re" +case $host_os in #(vi +mingw*) + cf_regex_libs="regex.dll $cf_regex_libs" + ;; +esac + +echo "$as_me:13006: checking for regcomp" >&5 +echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 +if test "${ac_cv_func_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13012 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char regcomp (); below. */ +#include +/* 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 regcomp (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_regcomp) || defined (__stub___regcomp) +choke me +#else +f = regcomp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13043: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13046: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13049: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13052: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_regcomp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:13062: result: $ac_cv_func_regcomp" >&5 +echo "${ECHO_T}$ac_cv_func_regcomp" >&6 +if test $ac_cv_func_regcomp = yes; then + cf_regex_func=regcomp +else + + for cf_regex_lib in $cf_regex_libs + do + as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` +echo "$as_me:13071: checking for regcomp in -l$cf_regex_lib" >&5 +echo $ECHO_N "checking for regcomp in -l$cf_regex_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_regex_lib $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 13079 "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 regcomp (); +int +main () +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13098: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13101: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13104: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13107: \$? = $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:13118: 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 + + LIBS="-l$cf_regex_lib $LIBS" + cf_regex_func=regcomp + break +fi + + done + +fi + +if test "$cf_regex_func" = no ; then + echo "$as_me:13132: checking for compile" >&5 +echo $ECHO_N "checking for compile... $ECHO_C" >&6 +if test "${ac_cv_func_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13138 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char compile (); below. */ +#include +/* 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 compile (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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_compile) || defined (__stub___compile) +choke me +#else +f = compile; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13169: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13172: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13175: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13178: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_compile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_compile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:13188: result: $ac_cv_func_compile" >&5 +echo "${ECHO_T}$ac_cv_func_compile" >&6 +if test $ac_cv_func_compile = yes; then + cf_regex_func=compile +else + + echo "$as_me:13194: checking for compile in -lgen" >&5 +echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6 +if test "${ac_cv_lib_gen_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgen $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 13202 "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 compile (); +int +main () +{ +compile (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13221: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13224: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13227: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13230: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gen_compile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gen_compile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:13241: result: $ac_cv_lib_gen_compile" >&5 +echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6 +if test $ac_cv_lib_gen_compile = yes; then + + LIBS="-lgen $LIBS" + cf_regex_func=compile +fi + +fi + +fi + +if test "$cf_regex_func" = no ; then + { echo "$as_me:13254: WARNING: cannot find regular expression library" >&5 +echo "$as_me: WARNING: cannot find regular expression library" >&2;} +fi + +echo "$as_me:13258: checking for regular-expression headers" >&5 echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 -if test "${cf_cv_regex+set}" = set; then +if test "${cf_cv_regex_hdrs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 11603 "configure" -#include "confdefs.h" -#include -#include -int -main () -{ - - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11621: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11624: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11627: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11630: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_regex="regex.h" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -#line 11638 "configure" -#include "confdefs.h" -#include -int -main () -{ - - char *p = compile("", "", "", 0); - int x = step("", ""); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11653: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11656: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11659: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11662: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_regex="regexp.h" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" +cf_cv_regex_hdrs=no +case $cf_regex_func in #(vi +compile) #(vi + for cf_regex_hdr in regexp.h regexpr.h + do cat >conftest.$ac_ext <<_ACEOF -#line 11672 "configure" +#line 13270 "configure" #include "confdefs.h" -#include +#include <$cf_regex_hdr> int main () { - char *p = compile("", "", ""); + char *p = compile("", "", "", 0); int x = step("", ""); ; @@ -11684,43 +13282,90 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11687: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13285: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11690: \$? = $ac_status" >&5 + echo "$as_me:13288: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11693: \"$ac_try\"") >&5 + { (eval echo "$as_me:13291: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11696: \$? = $ac_status" >&5 + echo "$as_me:13294: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cf_cv_regex="regexpr.h" + + cf_cv_regex_hdrs=$cf_regex_hdr + break + else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -LIBS="$cf_save_LIBS" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done + ;; +*) + for cf_regex_hdr in regex.h + do + cat >conftest.$ac_ext <<_ACEOF +#line 13311 "configure" +#include "confdefs.h" +#include +#include <$cf_regex_hdr> +int +main () +{ + + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13329: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13332: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13335: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13338: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_regex_hdrs=$cf_regex_hdr + break + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done + ;; +esac fi +echo "$as_me:13354: result: $cf_cv_regex_hdrs" >&5 +echo "${ECHO_T}$cf_cv_regex_hdrs" >&6 -echo "$as_me:11712: result: $cf_cv_regex" >&5 -echo "${ECHO_T}$cf_cv_regex" >&6 -case $cf_cv_regex in - regex.h) cat >>confdefs.h <<\EOF +case $cf_cv_regex_hdrs in #(vi + no) { echo "$as_me:13358: WARNING: no regular expression header found" >&5 +echo "$as_me: WARNING: no regular expression header found" >&2;} ;; #(vi + regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF - ;; - regexp.h) cat >>confdefs.h <<\EOF + ;; #(vi + regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF - ;; - regexpr.h) cat >>confdefs.h <<\EOF + ;; #(vi + regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; @@ -11731,6 +13376,7 @@ fcntl.h \ getopt.h \ limits.h \ locale.h \ +math.h \ poll.h \ sys/bsdtypes.h \ sys/ioctl.h \ @@ -11745,23 +13391,23 @@ wctype.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:11748: checking for $ac_header" >&5 +echo "$as_me:13394: 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 11754 "configure" +#line 13400 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:11758: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:13404: \"$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:11764: \$? = $ac_status" >&5 + echo "$as_me:13410: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11780,7 +13426,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:11783: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:13429: 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 < to declare fd_set if test "$ISC" = yes ; then -echo "$as_me:11797: checking for main in -lcposix" >&5 +echo "$as_me:13443: checking for main in -lcposix" >&5 echo $ECHO_N "checking for main in -lcposix... $ECHO_C" >&6 if test "${ac_cv_lib_cposix_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11802,7 +13448,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11805 "configure" +#line 13451 "configure" #include "confdefs.h" int @@ -11814,16 +13460,16 @@ main (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11817: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13463: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11820: \$? = $ac_status" >&5 + echo "$as_me:13466: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11823: \"$ac_try\"") >&5 + { (eval echo "$as_me:13469: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11826: \$? = $ac_status" >&5 + echo "$as_me:13472: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cposix_main=yes else @@ -11834,7 +13480,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11837: result: $ac_cv_lib_cposix_main" >&5 +echo "$as_me:13483: result: $ac_cv_lib_cposix_main" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_main" >&6 if test $ac_cv_lib_cposix_main = yes; then cat >>confdefs.h <&5 + echo "$as_me:13494: checking for bzero in -linet" >&5 echo $ECHO_N "checking for bzero in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_bzero+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11853,7 +13499,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11856 "configure" +#line 13502 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11872,16 +13518,16 @@ bzero (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11875: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13521: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11878: \$? = $ac_status" >&5 + echo "$as_me:13524: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11881: \"$ac_try\"") >&5 + { (eval echo "$as_me:13527: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11884: \$? = $ac_status" >&5 + echo "$as_me:13530: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_bzero=yes else @@ -11892,21 +13538,21 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11895: result: $ac_cv_lib_inet_bzero" >&5 +echo "$as_me:13541: result: $ac_cv_lib_inet_bzero" >&5 echo "${ECHO_T}$ac_cv_lib_inet_bzero" >&6 if test $ac_cv_lib_inet_bzero = yes; then - LIBS="$LIBS -linet" + LIBS="-linet $LIBS" fi fi -echo "$as_me:11902: checking if sys/time.h works with sys/select.h" >&5 +echo "$as_me:13548: 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 11909 "configure" +#line 13555 "configure" #include "confdefs.h" #include @@ -11926,16 +13572,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11929: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13575: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11932: \$? = $ac_status" >&5 + echo "$as_me:13578: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11935: \"$ac_try\"") >&5 + { (eval echo "$as_me:13581: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11938: \$? = $ac_status" >&5 + echo "$as_me:13584: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sys_time_select=yes else @@ -11947,7 +13593,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11950: result: $cf_cv_sys_time_select" >&5 +echo "$as_me:13596: 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 @@ -11961,7 +13607,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:11964: checking for $CC option to accept ANSI C" >&5 +echo "$as_me:13610: 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 @@ -11969,7 +13615,7 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line 11972 "configure" +#line 13618 "configure" #include "confdefs.h" #include #include @@ -12018,16 +13664,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:12021: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13667: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12024: \$? = $ac_status" >&5 + echo "$as_me:13670: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12027: \"$ac_try\"") >&5 + { (eval echo "$as_me:13673: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12030: \$? = $ac_status" >&5 + echo "$as_me:13676: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -12044,21 +13690,21 @@ fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:12047: result: none needed" >&5 + echo "$as_me:13693: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:12050: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:13696: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac -echo "$as_me:12055: checking for an ANSI C-conforming const" >&5 +echo "$as_me:13701: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12061 "configure" +#line 13707 "configure" #include "confdefs.h" int @@ -12116,16 +13762,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12119: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13765: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12122: \$? = $ac_status" >&5 + echo "$as_me:13768: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12125: \"$ac_try\"") >&5 + { (eval echo "$as_me:13771: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12128: \$? = $ac_status" >&5 + echo "$as_me:13774: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else @@ -12135,7 +13781,7 @@ ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12138: result: $ac_cv_c_const" >&5 +echo "$as_me:13784: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then @@ -12145,7 +13791,7 @@ EOF fi -echo "$as_me:12148: checking for inline" >&5 +echo "$as_me:13794: 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 @@ -12153,7 +13799,7 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line 12156 "configure" +#line 13802 "configure" #include "confdefs.h" #ifndef __cplusplus static $ac_kw int static_foo () {return 0; } @@ -12162,16 +13808,16 @@ $ac_kw int foo () {return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12165: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13811: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12168: \$? = $ac_status" >&5 + echo "$as_me:13814: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12171: \"$ac_try\"") >&5 + { (eval echo "$as_me:13817: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12174: \$? = $ac_status" >&5 + echo "$as_me:13820: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else @@ -12182,7 +13828,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:12185: result: $ac_cv_c_inline" >&5 +echo "$as_me:13831: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; @@ -12205,8 +13851,8 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - echo "$as_me:12208: checking if gcc supports options to tune inlining" >&5 -echo $ECHO_N "checking if gcc supports options to tune inlining... $ECHO_C" >&6 + echo "$as_me:13854: checking if $CC supports options to tune inlining" >&5 +echo $ECHO_N "checking if $CC supports options to tune inlining... $ECHO_C" >&6 if test "${cf_cv_gcc_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12214,7 +13860,7 @@ else cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=1200" cat >conftest.$ac_ext <<_ACEOF -#line 12217 "configure" +#line 13863 "configure" #include "confdefs.h" inline int foo(void) { return 1; } int @@ -12226,16 +13872,16 @@ ${cf_cv_main_return:-return} foo() } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13875: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12232: \$? = $ac_status" >&5 + echo "$as_me:13878: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12235: \"$ac_try\"") >&5 + { (eval echo "$as_me:13881: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12238: \$? = $ac_status" >&5 + echo "$as_me:13884: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gcc_inline=yes else @@ -12247,7 +13893,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS=$cf_save_CFLAGS fi -echo "$as_me:12250: result: $cf_cv_gcc_inline" >&5 +echo "$as_me:13896: result: $cf_cv_gcc_inline" >&5 echo "${ECHO_T}$cf_cv_gcc_inline" >&6 if test "$cf_cv_gcc_inline" = yes ; then @@ -12267,8 +13913,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -12283,6 +13929,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -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 cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -12298,8 +13954,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -12311,7 +13967,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -12323,7 +13979,7 @@ fi fi fi -echo "$as_me:12326: checking for signal global datatype" >&5 +echo "$as_me:13982: 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 @@ -12335,7 +13991,7 @@ else "int" do cat >conftest.$ac_ext <<_ACEOF -#line 12338 "configure" +#line 13994 "configure" #include "confdefs.h" #include @@ -12358,16 +14014,16 @@ signal(SIGINT, handler); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12361: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14017: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12364: \$? = $ac_status" >&5 + echo "$as_me:14020: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12367: \"$ac_try\"") >&5 + { (eval echo "$as_me:14023: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12370: \$? = $ac_status" >&5 + echo "$as_me:14026: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sig_atomic_t=$cf_type else @@ -12381,7 +14037,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12384: result: $cf_cv_sig_atomic_t" >&5 +echo "$as_me:14040: 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 <&5 +echo "$as_me:14048: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 if test "${cf_cv_typeof_chtype+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12399,7 +14055,7 @@ else cf_cv_typeof_chtype=long else cat >conftest.$ac_ext <<_ACEOF -#line 12402 "configure" +#line 14058 "configure" #include "confdefs.h" #define WANT_BITS 31 @@ -12434,15 +14090,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12437: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12440: \$? = $ac_status" >&5 + echo "$as_me:14096: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12442: \"$ac_try\"") >&5 + { (eval echo "$as_me:14098: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12445: \$? = $ac_status" >&5 + echo "$as_me:14101: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_typeof_chtype=`cat cf_test.out` else @@ -12457,7 +14113,7 @@ fi fi -echo "$as_me:12460: result: $cf_cv_typeof_chtype" >&5 +echo "$as_me:14116: result: $cf_cv_typeof_chtype" >&5 echo "${ECHO_T}$cf_cv_typeof_chtype" >&6 cat >>confdefs.h <&5 +echo "$as_me:14128: checking if unsigned literals are legal" >&5 echo $ECHO_N "checking if unsigned literals are legal... $ECHO_C" >&6 if test "${cf_cv_unsigned_literals+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12479 "configure" +#line 14135 "configure" #include "confdefs.h" int @@ -12488,16 +14144,16 @@ long x = 1L + 1UL + 1U + 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12491: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14147: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12494: \$? = $ac_status" >&5 + echo "$as_me:14150: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12497: \"$ac_try\"") >&5 + { (eval echo "$as_me:14153: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12500: \$? = $ac_status" >&5 + echo "$as_me:14156: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_unsigned_literals=yes else @@ -12509,7 +14165,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12512: result: $cf_cv_unsigned_literals" >&5 +echo "$as_me:14168: result: $cf_cv_unsigned_literals" >&5 echo "${ECHO_T}$cf_cv_unsigned_literals" >&6 cf_cv_1UL="1" @@ -12525,14 +14181,14 @@ test "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t="" ### Checks for external-data -echo "$as_me:12528: checking if external errno is declared" >&5 +echo "$as_me:14184: checking if external errno is declared" >&5 echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12535 "configure" +#line 14191 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -12550,16 +14206,16 @@ int x = (int) errno } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12553: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12556: \$? = $ac_status" >&5 + echo "$as_me:14212: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12559: \"$ac_try\"") >&5 + { (eval echo "$as_me:14215: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12562: \$? = $ac_status" >&5 + echo "$as_me:14218: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_dcl_errno=yes else @@ -12570,7 +14226,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12573: result: $cf_cv_dcl_errno" >&5 +echo "$as_me:14229: result: $cf_cv_dcl_errno" >&5 echo "${ECHO_T}$cf_cv_dcl_errno" >&6 if test "$cf_cv_dcl_errno" = no ; then @@ -12585,14 +14241,14 @@ fi # It's possible (for near-UNIX clones) that the data doesn't exist -echo "$as_me:12588: checking if external errno exists" >&5 +echo "$as_me:14244: checking if external errno exists" >&5 echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6 if test "${cf_cv_have_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12595 "configure" +#line 14251 "configure" #include "confdefs.h" #undef errno @@ -12607,16 +14263,16 @@ errno = 2 } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12610: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14266: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12613: \$? = $ac_status" >&5 + echo "$as_me:14269: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12616: \"$ac_try\"") >&5 + { (eval echo "$as_me:14272: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12619: \$? = $ac_status" >&5 + echo "$as_me:14275: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_errno=yes else @@ -12627,7 +14283,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12630: result: $cf_cv_have_errno" >&5 +echo "$as_me:14286: result: $cf_cv_have_errno" >&5 echo "${ECHO_T}$cf_cv_have_errno" >&6 if test "$cf_cv_have_errno" = yes ; then @@ -12640,7 +14296,7 @@ EOF fi -echo "$as_me:12643: checking if data-only library module links" >&5 +echo "$as_me:14299: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12648,20 +14304,20 @@ else rm -f conftest.a cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:14310: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12657: \$? = $ac_status" >&5 + echo "$as_me:14313: \$? = $ac_status" >&5 (exit $ac_status); } ; then mv conftest.o data.o && \ - ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null + ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:14333: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12680: \$? = $ac_status" >&5 + echo "$as_me:14336: \$? = $ac_status" >&5 (exit $ac_status); }; then mv conftest.o func.o && \ - ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null + ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&5 >/dev/null @@ -12690,7 +14346,7 @@ EOF cf_cv_link_dataonly=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 12693 "configure" +#line 14349 "configure" #include "confdefs.h" int main() @@ -12701,15 +14357,15 @@ else _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12704: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14360: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12707: \$? = $ac_status" >&5 + echo "$as_me:14363: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12709: \"$ac_try\"") >&5 + { (eval echo "$as_me:14365: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12712: \$? = $ac_status" >&5 + echo "$as_me:14368: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else @@ -12724,7 +14380,7 @@ fi fi -echo "$as_me:12727: result: $cf_cv_link_dataonly" >&5 +echo "$as_me:14383: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then @@ -12759,13 +14415,13 @@ vsnprintf \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:12762: checking for $ac_func" >&5 +echo "$as_me:14418: 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 12768 "configure" +#line 14424 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -12796,16 +14452,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12799: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14455: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12802: \$? = $ac_status" >&5 + echo "$as_me:14458: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12805: \"$ac_try\"") >&5 + { (eval echo "$as_me:14461: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12808: \$? = $ac_status" >&5 + echo "$as_me:14464: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -12815,7 +14471,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12818: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:14474: 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 <&5 +echo "$as_me:14486: checking for terminal-capability database functions" >&5 echo $ECHO_N "checking for terminal-capability database functions... $ECHO_C" >&6 if test "${cf_cv_cgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12837 "configure" +#line 14493 "configure" #include "confdefs.h" #include @@ -12854,16 +14510,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12857: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14513: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12860: \$? = $ac_status" >&5 + echo "$as_me:14516: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12863: \"$ac_try\"") >&5 + { (eval echo "$as_me:14519: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12866: \$? = $ac_status" >&5 + echo "$as_me:14522: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cgetent=yes else @@ -12875,7 +14531,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12878: result: $cf_cv_cgetent" >&5 +echo "$as_me:14534: result: $cf_cv_cgetent" >&5 echo "${ECHO_T}$cf_cv_cgetent" >&6 test "$cf_cv_cgetent" = yes && cat >>confdefs.h <<\EOF #define HAVE_BSD_CGETENT 1 @@ -12883,14 +14539,14 @@ EOF fi -echo "$as_me:12886: checking for isascii" >&5 +echo "$as_me:14542: checking for isascii" >&5 echo $ECHO_N "checking for isascii... $ECHO_C" >&6 if test "${cf_cv_have_isascii+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12893 "configure" +#line 14549 "configure" #include "confdefs.h" #include int @@ -12902,16 +14558,16 @@ int x = isascii(' ') } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12905: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14561: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12908: \$? = $ac_status" >&5 + echo "$as_me:14564: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12911: \"$ac_try\"") >&5 + { (eval echo "$as_me:14567: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12914: \$? = $ac_status" >&5 + echo "$as_me:14570: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_isascii=yes else @@ -12922,17 +14578,17 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12925: result: $cf_cv_have_isascii" >&5 +echo "$as_me:14581: result: $cf_cv_have_isascii" >&5 echo "${ECHO_T}$cf_cv_have_isascii" >&6 test "$cf_cv_have_isascii" = yes && cat >>confdefs.h <<\EOF #define HAVE_ISASCII 1 EOF if test "$ac_cv_func_sigaction" = yes; then -echo "$as_me:12932: checking whether sigaction needs _POSIX_SOURCE" >&5 +echo "$as_me:14588: checking whether sigaction needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether sigaction needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 12935 "configure" +#line 14591 "configure" #include "confdefs.h" #include @@ -12946,16 +14602,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12949: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14605: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12952: \$? = $ac_status" >&5 + echo "$as_me:14608: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12955: \"$ac_try\"") >&5 + { (eval echo "$as_me:14611: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12958: \$? = $ac_status" >&5 + echo "$as_me:14614: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=no else @@ -12963,7 +14619,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 12966 "configure" +#line 14622 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -12978,16 +14634,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12981: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14637: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12984: \$? = $ac_status" >&5 + echo "$as_me:14640: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12987: \"$ac_try\"") >&5 + { (eval echo "$as_me:14643: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12990: \$? = $ac_status" >&5 + echo "$as_me:14646: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=yes cat >>confdefs.h <<\EOF @@ -13002,11 +14658,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:13005: result: $sigact_bad" >&5 +echo "$as_me:14661: result: $sigact_bad" >&5 echo "${ECHO_T}$sigact_bad" >&6 fi -echo "$as_me:13009: checking if nanosleep really works" >&5 +echo "$as_me:14665: checking if nanosleep really works" >&5 echo $ECHO_N "checking if nanosleep really works... $ECHO_C" >&6 if test "${cf_cv_func_nanosleep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13016,7 +14672,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_nanosleep=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 13019 "configure" +#line 14675 "configure" #include "confdefs.h" #include @@ -13041,15 +14697,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13044: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14700: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13047: \$? = $ac_status" >&5 + echo "$as_me:14703: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13049: \"$ac_try\"") >&5 + { (eval echo "$as_me:14705: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13052: \$? = $ac_status" >&5 + echo "$as_me:14708: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_nanosleep=yes else @@ -13061,7 +14717,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:13064: result: $cf_cv_func_nanosleep" >&5 +echo "$as_me:14720: result: $cf_cv_func_nanosleep" >&5 echo "${ECHO_T}$cf_cv_func_nanosleep" >&6 test "$cf_cv_func_nanosleep" = "yes" && cat >>confdefs.h <<\EOF @@ -13075,23 +14731,23 @@ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:13078: checking for $ac_header" >&5 +echo "$as_me:14734: 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 13084 "configure" +#line 14740 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13088: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14744: \"$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:13094: \$? = $ac_status" >&5 + echo "$as_me:14750: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13110,7 +14766,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13113: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:14769: 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 <&5 +echo "$as_me:14784: 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 13134 "configure" +#line 14790 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13138: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14794: \"$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:13144: \$? = $ac_status" >&5 + echo "$as_me:14800: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13160,7 +14816,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13163: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:14819: 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 <&5 + echo "$as_me:14837: checking whether termios.h needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 13184 "configure" +#line 14840 "configure" #include "confdefs.h" #include int @@ -13193,16 +14849,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13196: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14852: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13199: \$? = $ac_status" >&5 + echo "$as_me:14855: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13202: \"$ac_try\"") >&5 + { (eval echo "$as_me:14858: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13205: \$? = $ac_status" >&5 + echo "$as_me:14861: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=no else @@ -13210,7 +14866,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13213 "configure" +#line 14869 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -13224,16 +14880,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13227: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14883: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13230: \$? = $ac_status" >&5 + echo "$as_me:14886: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13233: \"$ac_try\"") >&5 + { (eval echo "$as_me:14889: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13236: \$? = $ac_status" >&5 + echo "$as_me:14892: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=unknown else @@ -13248,19 +14904,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:13251: result: $termios_bad" >&5 + echo "$as_me:14907: result: $termios_bad" >&5 echo "${ECHO_T}$termios_bad" >&6 fi fi -echo "$as_me:13256: checking for tcgetattr" >&5 +echo "$as_me:14912: checking for tcgetattr" >&5 echo $ECHO_N "checking for tcgetattr... $ECHO_C" >&6 if test "${cf_cv_have_tcgetattr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13263 "configure" +#line 14919 "configure" #include "confdefs.h" #include @@ -13288,16 +14944,16 @@ tcgetattr(1, &foo); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13291: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14947: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13294: \$? = $ac_status" >&5 + echo "$as_me:14950: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13297: \"$ac_try\"") >&5 + { (eval echo "$as_me:14953: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13300: \$? = $ac_status" >&5 + echo "$as_me:14956: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_tcgetattr=yes else @@ -13307,20 +14963,20 @@ cf_cv_have_tcgetattr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13310: result: $cf_cv_have_tcgetattr" >&5 +echo "$as_me:14966: result: $cf_cv_have_tcgetattr" >&5 echo "${ECHO_T}$cf_cv_have_tcgetattr" >&6 test "$cf_cv_have_tcgetattr" = yes && cat >>confdefs.h <<\EOF #define HAVE_TCGETATTR 1 EOF -echo "$as_me:13316: checking for vsscanf function or workaround" >&5 +echo "$as_me:14972: checking for vsscanf function or workaround" >&5 echo $ECHO_N "checking for vsscanf function or workaround... $ECHO_C" >&6 if test "${cf_cv_func_vsscanf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13323 "configure" +#line 14979 "configure" #include "confdefs.h" #include @@ -13336,16 +14992,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13339: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14995: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13342: \$? = $ac_status" >&5 + echo "$as_me:14998: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13345: \"$ac_try\"") >&5 + { (eval echo "$as_me:15001: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13348: \$? = $ac_status" >&5 + echo "$as_me:15004: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vsscanf else @@ -13353,7 +15009,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13356 "configure" +#line 15012 "configure" #include "confdefs.h" #include @@ -13375,16 +15031,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13378: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15034: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13381: \$? = $ac_status" >&5 + echo "$as_me:15037: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13384: \"$ac_try\"") >&5 + { (eval echo "$as_me:15040: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13387: \$? = $ac_status" >&5 + echo "$as_me:15043: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vfscanf else @@ -13392,7 +15048,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13395 "configure" +#line 15051 "configure" #include "confdefs.h" #include @@ -13414,16 +15070,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13417: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15073: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13420: \$? = $ac_status" >&5 + echo "$as_me:15076: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13423: \"$ac_try\"") >&5 + { (eval echo "$as_me:15079: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13426: \$? = $ac_status" >&5 + echo "$as_me:15082: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=_doscan else @@ -13438,7 +15094,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13441: result: $cf_cv_func_vsscanf" >&5 +echo "$as_me:15097: result: $cf_cv_func_vsscanf" >&5 echo "${ECHO_T}$cf_cv_func_vsscanf" >&6 case $cf_cv_func_vsscanf in #(vi @@ -13456,21 +15112,21 @@ EOF ;; esac -echo "$as_me:13459: checking for working mkstemp" >&5 +echo "$as_me:15115: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -rm -f conftest* +rm -rf conftest* if test "$cross_compiling" = yes; then - echo "$as_me:13467: checking for mkstemp" >&5 + echo "$as_me:15123: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13473 "configure" +#line 15129 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -13501,16 +15157,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13504: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15160: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13507: \$? = $ac_status" >&5 + echo "$as_me:15163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13510: \"$ac_try\"") >&5 + { (eval echo "$as_me:15166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13513: \$? = $ac_status" >&5 + echo "$as_me:15169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -13520,12 +15176,12 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13523: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:15179: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13528 "configure" +#line 15184 "configure" #include "confdefs.h" #include @@ -13563,15 +15219,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13566: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15222: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13569: \$? = $ac_status" >&5 + echo "$as_me:15225: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13571: \"$ac_try\"") >&5 + { (eval echo "$as_me:15227: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13574: \$? = $ac_status" >&5 + echo "$as_me:15230: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -13586,9 +15242,9 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:13589: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:15245: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 -if test "$cf_cv_func_mkstemp" = yes ; then +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF #define HAVE_MKSTEMP 1 EOF @@ -13604,21 +15260,21 @@ else fi if test "$cross_compiling" = yes ; then - { echo "$as_me:13607: WARNING: cross compiling: assume setvbuf params not reversed" >&5 + { echo "$as_me:15263: WARNING: cross compiling: assume setvbuf params not reversed" >&5 echo "$as_me: WARNING: cross compiling: assume setvbuf params not reversed" >&2;} else - echo "$as_me:13610: checking whether setvbuf arguments are reversed" >&5 + echo "$as_me:15266: checking whether setvbuf arguments are reversed" >&5 echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6 if test "${ac_cv_func_setvbuf_reversed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:13616: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:15272: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 13621 "configure" +#line 15277 "configure" #include "confdefs.h" #include /* If setvbuf has the reversed format, exit 0. */ @@ -13635,15 +15291,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13638: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15294: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13641: \$? = $ac_status" >&5 + echo "$as_me:15297: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13643: \"$ac_try\"") >&5 + { (eval echo "$as_me:15299: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13646: \$? = $ac_status" >&5 + echo "$as_me:15302: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setvbuf_reversed=yes else @@ -13656,7 +15312,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f core core.* *.core fi -echo "$as_me:13659: result: $ac_cv_func_setvbuf_reversed" >&5 +echo "$as_me:15315: result: $ac_cv_func_setvbuf_reversed" >&5 echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6 if test $ac_cv_func_setvbuf_reversed = yes; then @@ -13667,13 +15323,13 @@ EOF fi fi -echo "$as_me:13670: checking return type of signal handlers" >&5 +echo "$as_me:15326: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13676 "configure" +#line 15332 "configure" #include "confdefs.h" #include #include @@ -13695,16 +15351,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13698: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15354: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13701: \$? = $ac_status" >&5 + echo "$as_me:15357: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13704: \"$ac_try\"") >&5 + { (eval echo "$as_me:15360: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13707: \$? = $ac_status" >&5 + echo "$as_me:15363: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else @@ -13714,21 +15370,21 @@ ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13717: result: $ac_cv_type_signal" >&5 +echo "$as_me:15373: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 +echo "$as_me:15380: checking for type sigaction_t" >&5 echo $ECHO_N "checking for type sigaction_t... $ECHO_C" >&6 if test "${cf_cv_type_sigaction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13731 "configure" +#line 15387 "configure" #include "confdefs.h" #include @@ -13741,16 +15397,16 @@ sigaction_t x } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13744: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15400: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13747: \$? = $ac_status" >&5 + echo "$as_me:15403: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13750: \"$ac_try\"") >&5 + { (eval echo "$as_me:15406: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13753: \$? = $ac_status" >&5 + echo "$as_me:15409: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_sigaction=yes else @@ -13761,13 +15417,13 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13764: result: $cf_cv_type_sigaction" >&5 +echo "$as_me:15420: result: $cf_cv_type_sigaction" >&5 echo "${ECHO_T}$cf_cv_type_sigaction" >&6 test "$cf_cv_type_sigaction" = yes && cat >>confdefs.h <<\EOF #define HAVE_TYPE_SIGACTION 1 EOF -echo "$as_me:13770: checking declaration of size-change" >&5 +echo "$as_me:15426: checking declaration of size-change" >&5 echo $ECHO_N "checking declaration of size-change... $ECHO_C" >&6 if test "${cf_cv_sizechange+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13782,7 +15438,7 @@ do CPPFLAGS="$cf_save_CPPFLAGS" test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" cat >conftest.$ac_ext <<_ACEOF -#line 13785 "configure" +#line 15441 "configure" #include "confdefs.h" #include #ifdef HAVE_TERMIOS_H @@ -13826,16 +15482,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13829: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15485: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13832: \$? = $ac_status" >&5 + echo "$as_me:15488: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13835: \"$ac_try\"") >&5 + { (eval echo "$as_me:15491: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13838: \$? = $ac_status" >&5 + echo "$as_me:15494: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sizechange=yes else @@ -13854,7 +15510,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:13857: result: $cf_cv_sizechange" >&5 +echo "$as_me:15513: result: $cf_cv_sizechange" >&5 echo "${ECHO_T}$cf_cv_sizechange" >&6 if test "$cf_cv_sizechange" != no ; then cat >>confdefs.h <<\EOF @@ -13871,13 +15527,13 @@ EOF esac fi -echo "$as_me:13874: checking for memmove" >&5 +echo "$as_me:15530: checking for memmove" >&5 echo $ECHO_N "checking for memmove... $ECHO_C" >&6 if test "${ac_cv_func_memmove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13880 "configure" +#line 15536 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memmove (); below. */ @@ -13908,16 +15564,16 @@ f = memmove; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13911: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15567: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13914: \$? = $ac_status" >&5 + echo "$as_me:15570: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13917: \"$ac_try\"") >&5 + { (eval echo "$as_me:15573: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13920: \$? = $ac_status" >&5 + echo "$as_me:15576: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memmove=yes else @@ -13927,19 +15583,19 @@ ac_cv_func_memmove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13930: result: $ac_cv_func_memmove" >&5 +echo "$as_me:15586: result: $ac_cv_func_memmove" >&5 echo "${ECHO_T}$ac_cv_func_memmove" >&6 if test $ac_cv_func_memmove = yes; then : else -echo "$as_me:13936: checking for bcopy" >&5 +echo "$as_me:15592: checking for bcopy" >&5 echo $ECHO_N "checking for bcopy... $ECHO_C" >&6 if test "${ac_cv_func_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13942 "configure" +#line 15598 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bcopy (); below. */ @@ -13970,16 +15626,16 @@ f = bcopy; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13973: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15629: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13976: \$? = $ac_status" >&5 + echo "$as_me:15632: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13979: \"$ac_try\"") >&5 + { (eval echo "$as_me:15635: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13982: \$? = $ac_status" >&5 + echo "$as_me:15638: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_bcopy=yes else @@ -13989,11 +15645,11 @@ ac_cv_func_bcopy=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13992: result: $ac_cv_func_bcopy" >&5 +echo "$as_me:15648: result: $ac_cv_func_bcopy" >&5 echo "${ECHO_T}$ac_cv_func_bcopy" >&6 if test $ac_cv_func_bcopy = yes; then - echo "$as_me:13996: checking if bcopy does overlapping moves" >&5 + echo "$as_me:15652: checking if bcopy does overlapping moves" >&5 echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6 if test "${cf_cv_good_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14003,7 +15659,7 @@ else cf_cv_good_bcopy=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14006 "configure" +#line 15662 "configure" #include "confdefs.h" int main() { @@ -14017,15 +15673,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14020: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15676: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14023: \$? = $ac_status" >&5 + echo "$as_me:15679: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14025: \"$ac_try\"") >&5 + { (eval echo "$as_me:15681: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14028: \$? = $ac_status" >&5 + echo "$as_me:15684: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_good_bcopy=yes else @@ -14038,7 +15694,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14041: result: $cf_cv_good_bcopy" >&5 +echo "$as_me:15697: result: $cf_cv_good_bcopy" >&5 echo "${ECHO_T}$cf_cv_good_bcopy" >&6 else @@ -14059,7 +15715,7 @@ EOF fi -echo "$as_me:14062: checking if poll really works" >&5 +echo "$as_me:15718: checking if poll really works" >&5 echo $ECHO_N "checking if poll really works... $ECHO_C" >&6 if test "${cf_cv_working_poll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14069,7 +15725,7 @@ if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14072 "configure" +#line 15728 "configure" #include "confdefs.h" #include @@ -14090,15 +15746,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15749: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14096: \$? = $ac_status" >&5 + echo "$as_me:15752: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14098: \"$ac_try\"") >&5 + { (eval echo "$as_me:15754: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14101: \$? = $ac_status" >&5 + echo "$as_me:15757: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_working_poll=yes else @@ -14110,15 +15766,505 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14113: result: $cf_cv_working_poll" >&5 +echo "$as_me:15769: result: $cf_cv_working_poll" >&5 echo "${ECHO_T}$cf_cv_working_poll" >&6 test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_WORKING_POLL 1 EOF +echo "$as_me:15775: checking for va_copy" >&5 +echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 +if test "${cf_cv_have_va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 15782 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + static va_list dst; + static va_list src; + va_copy(dst, src) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:15799: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:15802: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:15805: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15808: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_va_copy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_va_copy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:15818: result: $cf_cv_have_va_copy" >&5 +echo "${ECHO_T}$cf_cv_have_va_copy" >&6 + +test "$cf_cv_have_va_copy" = yes && cat >>confdefs.h <<\EOF +#define HAVE_VA_COPY 1 +EOF + +echo "$as_me:15825: checking for __va_copy" >&5 +echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6 +if test "${cf_cv_have___va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 15832 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + static va_list dst; + static va_list src; + __va_copy(dst, src) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:15849: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:15852: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:15855: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15858: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have___va_copy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have___va_copy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:15868: result: $cf_cv_have___va_copy" >&5 +echo "${ECHO_T}$cf_cv_have___va_copy" >&6 + +test "$cf_cv_have___va_copy" = yes && cat >>confdefs.h <<\EOF +#define HAVE___VA_COPY 1 +EOF + +echo "$as_me:15875: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 15881 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:15896: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:15899: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:15902: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15905: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_pid_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:15915: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <&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 15936 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:15940: \"$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:15946: \$? = $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:15965: 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 <&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 15984 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* 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 $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this 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; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:16015: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16018: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:16021: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16024: \$? = $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:16034: 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 <&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6 +if test "${ac_cv_func_fork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_fork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* By Rüdiger Kuhlmann. */ + #include + #if HAVE_UNISTD_H + # include + #endif + /* Some systems only have a dummy stub for fork() */ + int main () + { + if (fork() < 0) + $ac_main_return (1); + $ac_main_return (0); + } +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:16069: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16072: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:16074: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16077: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_fork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:16089: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6 + +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { echo "$as_me:16103: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + echo "$as_me:16108: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 +if test "${ac_cv_func_vfork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_vfork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +#line 16117 "configure" +#include "confdefs.h" +/* Thanks to Paul Eggert for this test. */ +#include +#include +#include +#if HAVE_UNISTD_H +# include +#endif +#if HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + $ac_main_return( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:16214: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16217: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:16219: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16222: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_vfork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_vfork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:16234: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=ac_cv_func_vfork + { echo "$as_me:16240: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_VFORK 1 +EOF + +else + +cat >>confdefs.h <<\EOF +#define vfork fork +EOF + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_FORK 1 +EOF + +fi + # special check for test/ditto.c -echo "$as_me:14121: checking for openpty in -lutil" >&5 +echo "$as_me:16267: 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 @@ -14126,7 +16272,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14129 "configure" +#line 16275 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -14145,16 +16291,16 @@ openpty (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14148: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16294: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14151: \$? = $ac_status" >&5 + echo "$as_me:16297: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14154: \"$ac_try\"") >&5 + { (eval echo "$as_me:16300: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14157: \$? = $ac_status" >&5 + echo "$as_me:16303: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_util_openpty=yes else @@ -14165,7 +16311,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:14168: result: $ac_cv_lib_util_openpty" >&5 +echo "$as_me:16314: 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 @@ -14173,7 +16319,7 @@ else cf_cv_lib_util=no fi -echo "$as_me:14176: checking for openpty header" >&5 +echo "$as_me:16322: 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 @@ -14184,7 +16330,7 @@ else for cf_header in pty.h libutil.h util.h do cat >conftest.$ac_ext <<_ACEOF -#line 14187 "configure" +#line 16333 "configure" #include "confdefs.h" #include <$cf_header> @@ -14201,16 +16347,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14204: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16350: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14207: \$? = $ac_status" >&5 + echo "$as_me:16353: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14210: \"$ac_try\"") >&5 + { (eval echo "$as_me:16356: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14213: \$? = $ac_status" >&5 + echo "$as_me:16359: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_openpty=$cf_header @@ -14228,7 +16374,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" fi -echo "$as_me:14231: result: $cf_cv_func_openpty" >&5 +echo "$as_me:16377: result: $cf_cv_func_openpty" >&5 echo "${ECHO_T}$cf_cv_func_openpty" >&6 if test "$cf_cv_func_openpty" != no ; then @@ -14274,13 +16420,13 @@ if test -n "$with_hashed_db/include" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; 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 14283 "configure" +#line 16429 "configure" #include "confdefs.h" #include int @@ -14292,16 +16438,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14295: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16441: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14298: \$? = $ac_status" >&5 + echo "$as_me:16444: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14301: \"$ac_try\"") >&5 + { (eval echo "$as_me:16447: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14304: \$? = $ac_status" >&5 + echo "$as_me:16450: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -14318,13 +16464,13 @@ 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}:14321: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:16467: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + 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" + 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 @@ -14352,7 +16498,7 @@ if test -n "$with_hashed_db/lib" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me-configure}:14355: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:16501: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -14363,23 +16509,23 @@ fi fi esac -echo "$as_me:14366: checking for db.h" >&5 +echo "$as_me:16512: checking for db.h" >&5 echo $ECHO_N "checking for db.h... $ECHO_C" >&6 if test "${ac_cv_header_db_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14372 "configure" +#line 16518 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:14376: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:16522: \"$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:14382: \$? = $ac_status" >&5 + echo "$as_me:16528: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -14398,11 +16544,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:14401: result: $ac_cv_header_db_h" >&5 +echo "$as_me:16547: result: $ac_cv_header_db_h" >&5 echo "${ECHO_T}$ac_cv_header_db_h" >&6 if test $ac_cv_header_db_h = yes; then -echo "$as_me:14405: checking for version of db" >&5 +echo "$as_me:16551: checking for version of db" >&5 echo $ECHO_N "checking for version of db... $ECHO_C" >&6 if test "${cf_cv_hashed_db_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14413,10 +16559,10 @@ cf_cv_hashed_db_version=unknown for cf_db_version in 1 2 3 4 5 do -echo "${as_me-configure}:14416: testing checking for db version $cf_db_version ..." 1>&5 +echo "${as_me:-configure}:16562: testing checking for db version $cf_db_version ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 14419 "configure" +#line 16565 "configure" #include "confdefs.h" $ac_includes_default @@ -14446,16 +16592,16 @@ DBT *foo = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14449: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16595: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14452: \$? = $ac_status" >&5 + echo "$as_me:16598: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14455: \"$ac_try\"") >&5 + { (eval echo "$as_me:16601: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14458: \$? = $ac_status" >&5 + echo "$as_me:16604: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_hashed_db_version=$cf_db_version @@ -14469,16 +16615,16 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:14472: result: $cf_cv_hashed_db_version" >&5 +echo "$as_me:16618: result: $cf_cv_hashed_db_version" >&5 echo "${ECHO_T}$cf_cv_hashed_db_version" >&6 if test "$cf_cv_hashed_db_version" = unknown ; then - { { echo "$as_me:14476: error: Cannot determine version of db" >&5 + { { echo "$as_me:16622: error: Cannot determine version of db" >&5 echo "$as_me: error: Cannot determine version of db" >&2;} { (exit 1); exit 1; }; } else -echo "$as_me:14481: checking for db libraries" >&5 +echo "$as_me:16627: checking for db libraries" >&5 echo $ECHO_N "checking for db libraries... $ECHO_C" >&6 if test "${cf_cv_hashed_db_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14492,10 +16638,10 @@ do LIBS="-l$cf_db_libs $LIBS" fi -echo "${as_me-configure}:14495: testing checking for library "$cf_db_libs" ..." 1>&5 +echo "${as_me:-configure}:16641: testing checking for library "$cf_db_libs" ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 14498 "configure" +#line 16644 "configure" #include "confdefs.h" $ac_includes_default @@ -14550,16 +16696,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14553: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16699: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14556: \$? = $ac_status" >&5 + echo "$as_me:16702: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14559: \"$ac_try\"") >&5 + { (eval echo "$as_me:16705: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14562: \$? = $ac_status" >&5 + echo "$as_me:16708: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test -n "$cf_db_libs" ; then @@ -14579,11 +16725,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi -echo "$as_me:14582: result: $cf_cv_hashed_db_libs" >&5 +echo "$as_me:16728: result: $cf_cv_hashed_db_libs" >&5 echo "${ECHO_T}$cf_cv_hashed_db_libs" >&6 if test "$cf_cv_hashed_db_libs" = unknown ; then - { { echo "$as_me:14586: error: Cannot determine library for db" >&5 + { { echo "$as_me:16732: error: Cannot determine library for db" >&5 echo "$as_me: error: Cannot determine library for db" >&2;} { (exit 1); exit 1; }; } elif test "$cf_cv_hashed_db_libs" != default ; then @@ -14593,7 +16739,7 @@ fi else - { { echo "$as_me:14596: error: Cannot find db.h" >&5 + { { echo "$as_me:16742: error: Cannot find db.h" >&5 echo "$as_me: error: Cannot find db.h" >&2;} { (exit 1); exit 1; }; } @@ -14608,7 +16754,7 @@ fi # Just in case, check if the C compiler has a bool type. -echo "$as_me:14611: checking if we should include stdbool.h" >&5 +echo "$as_me:16757: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -14616,7 +16762,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 14619 "configure" +#line 16765 "configure" #include "confdefs.h" int @@ -14628,23 +16774,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14631: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16777: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14634: \$? = $ac_status" >&5 + echo "$as_me:16780: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14637: \"$ac_try\"") >&5 + { (eval echo "$as_me:16783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14640: \$? = $ac_status" >&5 + echo "$as_me:16786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14647 "configure" +#line 16793 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -14660,16 +16806,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16809: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14666: \$? = $ac_status" >&5 + echo "$as_me:16812: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14669: \"$ac_try\"") >&5 + { (eval echo "$as_me:16815: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14672: \$? = $ac_status" >&5 + echo "$as_me:16818: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -14683,13 +16829,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:14686: result: yes" >&5 +then echo "$as_me:16832: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:14688: result: no" >&5 +else echo "$as_me:16834: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:14692: checking for builtin bool type" >&5 +echo "$as_me:16838: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_cc_bool_type+set}" = set; then @@ -14697,7 +16843,7 @@ if test "${cf_cv_cc_bool_type+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 14700 "configure" +#line 16846 "configure" #include "confdefs.h" #include @@ -14712,16 +16858,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14715: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16861: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14718: \$? = $ac_status" >&5 + echo "$as_me:16864: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14721: \"$ac_try\"") >&5 + { (eval echo "$as_me:16867: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14724: \$? = $ac_status" >&5 + echo "$as_me:16870: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cc_bool_type=1 else @@ -14734,9 +16880,9 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_cc_bool_type" = 1 -then echo "$as_me:14737: result: yes" >&5 +then echo "$as_me:16883: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:14739: result: no" >&5 +else echo "$as_me:16885: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14758,16 +16904,16 @@ os2*) #(vi cf_stdcpp_libname=stdc++ ;; esac -echo "$as_me:14761: checking for library $cf_stdcpp_libname" >&5 +echo "$as_me:16907: checking for library $cf_stdcpp_libname" >&5 echo $ECHO_N "checking for library $cf_stdcpp_libname... $ECHO_C" >&6 if test "${cf_cv_libstdcpp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + LIBS="-l$cf_stdcpp_libname $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14770 "configure" +#line 16916 "configure" #include "confdefs.h" #include @@ -14783,16 +16929,16 @@ strstreambuf foo(buf, sizeof(buf)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14786: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16932: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14789: \$? = $ac_status" >&5 + echo "$as_me:16935: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14792: \"$ac_try\"") >&5 + { (eval echo "$as_me:16938: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14795: \$? = $ac_status" >&5 + echo "$as_me:16941: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_libstdcpp=yes else @@ -14804,12 +16950,12 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" fi -echo "$as_me:14807: result: $cf_cv_libstdcpp" >&5 +echo "$as_me:16953: result: $cf_cv_libstdcpp" >&5 echo "${ECHO_T}$cf_cv_libstdcpp" >&6 -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CXXLIBS="-l$cf_stdcpp_libname $CXXLIBS" fi - echo "$as_me:14812: checking whether $CXX understands -c and -o together" >&5 + echo "$as_me:16958: checking whether $CXX understands -c and -o together" >&5 echo $ECHO_N "checking whether $CXX understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CXX_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14825,29 +16971,29 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CXX -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:14828: \"$ac_try\"") >&5 +if { (eval echo "$as_me:16974: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14831: \$? = $ac_status" >&5 + echo "$as_me:16977: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:14833: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:16979: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14836: \$? = $ac_status" >&5 + echo "$as_me:16982: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CXX_c_o=yes else eval cf_cv_prog_CXX_c_o=no fi -rm -f conftest* +rm -rf conftest* fi if test $cf_cv_prog_CXX_c_o = yes; then - echo "$as_me:14847: result: yes" >&5 + echo "$as_me:16993: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:14850: result: no" >&5 + echo "$as_me:16996: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14867,12 +17013,12 @@ os2*) #(vi ;; esac if test "$GXX" = yes; then - echo "$as_me:14870: checking for lib$cf_gpp_libname" >&5 + echo "$as_me:17016: checking for lib$cf_gpp_libname" >&5 echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6 cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" + LIBS="-l$cf_gpp_libname $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14875 "configure" +#line 17021 "configure" #include "confdefs.h" #include <$cf_gpp_libname/builtin.h> @@ -14886,19 +17032,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14889: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17035: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14892: \$? = $ac_status" >&5 + echo "$as_me:17038: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14895: \"$ac_try\"") >&5 + { (eval echo "$as_me:17041: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14898: \$? = $ac_status" >&5 + echo "$as_me:17044: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CXXLIBS="-l$cf_gpp_libname $CXXLIBS" if test "$cf_gpp_libname" = cpp ; then cat >>confdefs.h <<\EOF #define HAVE_GPP_BUILTIN_H 1 @@ -14914,7 +17060,7 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14917 "configure" +#line 17063 "configure" #include "confdefs.h" #include @@ -14928,19 +17074,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14931: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17077: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14934: \$? = $ac_status" >&5 + echo "$as_me:17080: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14937: \"$ac_try\"") >&5 + { (eval echo "$as_me:17083: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14940: \$? = $ac_status" >&5 + echo "$as_me:17086: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CXXLIBS="-l$cf_gpp_libname $CXXLIBS" cat >>confdefs.h <<\EOF #define HAVE_BUILTIN_H 1 EOF @@ -14954,7 +17100,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" - echo "$as_me:14957: result: $cf_cxx_library" >&5 + echo "$as_me:17103: result: $cf_cxx_library" >&5 echo "${ECHO_T}$cf_cxx_library" >&6 fi @@ -14970,7 +17116,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return -echo "$as_me:14973: checking how to run the C++ preprocessor" >&5 +echo "$as_me:17119: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then @@ -14987,18 +17133,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 14990 "configure" +#line 17136 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:14995: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17141: \"$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:15001: \$? = $ac_status" >&5 + echo "$as_me:17147: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15021,17 +17167,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 15024 "configure" +#line 17170 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:15028: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17174: \"$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:15034: \$? = $ac_status" >&5 + echo "$as_me:17180: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15068,7 +17214,7 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:15071: result: $CXXCPP" >&5 +echo "$as_me:17217: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes @@ -15078,18 +17224,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 15081 "configure" +#line 17227 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:15086: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17232: \"$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:15092: \$? = $ac_status" >&5 + echo "$as_me:17238: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15112,17 +17258,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 15115 "configure" +#line 17261 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:15119: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17265: \"$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:15125: \$? = $ac_status" >&5 + echo "$as_me:17271: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15150,7 +17296,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:15153: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 + { { echo "$as_me:17299: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -15165,23 +17311,23 @@ ac_main_return=return for ac_header in iostream typeinfo do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:15168: checking for $ac_header" >&5 +echo "$as_me:17314: 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 15174 "configure" +#line 17320 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:15178: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17324: \"$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:15184: \$? = $ac_status" >&5 + echo "$as_me:17330: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15200,7 +17346,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:15203: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:17349: 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 <&5 + echo "$as_me:17360: checking if iostream uses std-namespace" >&5 echo $ECHO_N "checking if iostream uses std-namespace... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 15217 "configure" +#line 17363 "configure" #include "confdefs.h" #include @@ -15231,16 +17377,16 @@ cerr << "testing" << endl; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15234: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17380: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15237: \$? = $ac_status" >&5 + echo "$as_me:17383: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15240: \"$ac_try\"") >&5 + { (eval echo "$as_me:17386: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15243: \$? = $ac_status" >&5 + echo "$as_me:17389: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_iostream_namespace=yes else @@ -15249,7 +17395,7 @@ cat conftest.$ac_ext >&5 cf_iostream_namespace=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:15252: result: $cf_iostream_namespace" >&5 + echo "$as_me:17398: result: $cf_iostream_namespace" >&5 echo "${ECHO_T}$cf_iostream_namespace" >&6 if test "$cf_iostream_namespace" = yes ; then cat >>confdefs.h <<\EOF @@ -15259,7 +17405,7 @@ EOF fi fi -echo "$as_me:15262: checking if we should include stdbool.h" >&5 +echo "$as_me:17408: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -15267,7 +17413,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 15270 "configure" +#line 17416 "configure" #include "confdefs.h" int @@ -15279,23 +17425,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15282: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17428: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15285: \$? = $ac_status" >&5 + echo "$as_me:17431: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15288: \"$ac_try\"") >&5 + { (eval echo "$as_me:17434: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15291: \$? = $ac_status" >&5 + echo "$as_me:17437: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 15298 "configure" +#line 17444 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -15311,16 +17457,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15314: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17460: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15317: \$? = $ac_status" >&5 + echo "$as_me:17463: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15320: \"$ac_try\"") >&5 + { (eval echo "$as_me:17466: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15323: \$? = $ac_status" >&5 + echo "$as_me:17469: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -15334,13 +17480,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:15337: result: yes" >&5 +then echo "$as_me:17483: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:15339: result: no" >&5 +else echo "$as_me:17485: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:15343: checking for builtin bool type" >&5 +echo "$as_me:17489: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_builtin_bool+set}" = set; then @@ -15348,7 +17494,7 @@ if test "${cf_cv_builtin_bool+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 15351 "configure" +#line 17497 "configure" #include "confdefs.h" #include @@ -15363,16 +17509,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15366: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17512: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15369: \$? = $ac_status" >&5 + echo "$as_me:17515: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15372: \"$ac_try\"") >&5 + { (eval echo "$as_me:17518: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15375: \$? = $ac_status" >&5 + echo "$as_me:17521: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_builtin_bool=1 else @@ -15385,13 +17531,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_builtin_bool" = 1 -then echo "$as_me:15388: result: yes" >&5 +then echo "$as_me:17534: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:15390: result: no" >&5 +else echo "$as_me:17536: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:15394: checking for size of bool" >&5 +echo "$as_me:17540: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15402,7 +17548,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15405 "configure" +#line 17551 "configure" #include "confdefs.h" #include @@ -15444,15 +17590,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15447: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17593: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15450: \$? = $ac_status" >&5 + echo "$as_me:17596: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15452: \"$ac_try\"") >&5 + { (eval echo "$as_me:17598: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15455: \$? = $ac_status" >&5 + echo "$as_me:17601: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -15470,18 +17616,18 @@ fi fi rm -f cf_test.out -echo "$as_me:15473: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:17619: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:15479: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:17625: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi -echo "$as_me:15484: checking for special defines needed for etip.h" >&5 +echo "$as_me:17630: checking for special defines needed for etip.h" >&5 echo $ECHO_N "checking for special defines needed for etip.h... $ECHO_C" >&6 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" @@ -15493,7 +17639,7 @@ do test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" cat >conftest.$ac_ext <<_ACEOF -#line 15496 "configure" +#line 17642 "configure" #include "confdefs.h" #include @@ -15507,16 +17653,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15510: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17656: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15513: \$? = $ac_status" >&5 + echo "$as_me:17659: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15516: \"$ac_try\"") >&5 + { (eval echo "$as_me:17662: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15519: \$? = $ac_status" >&5 + echo "$as_me:17665: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$cf_math" && cat >>confdefs.h <&5 +echo "$as_me:17686: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 CXXFLAGS="$cf_save_CXXFLAGS" if test -n "$CXX"; then -echo "$as_me:15545: checking if $CXX accepts parameter initialization" >&5 +echo "$as_me:17691: checking if $CXX accepts parameter initialization" >&5 echo $ECHO_N "checking if $CXX accepts parameter initialization... $ECHO_C" >&6 if test "${cf_cv_cpp_param_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15559,7 +17705,7 @@ ac_main_return=return cf_cv_cpp_param_init=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15562 "configure" +#line 17708 "configure" #include "confdefs.h" class TEST { @@ -15578,15 +17724,15 @@ void main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15581: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17727: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15584: \$? = $ac_status" >&5 + echo "$as_me:17730: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15586: \"$ac_try\"") >&5 + { (eval echo "$as_me:17732: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15589: \$? = $ac_status" >&5 + echo "$as_me:17735: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_param_init=yes else @@ -15605,7 +17751,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:15608: result: $cf_cv_cpp_param_init" >&5 +echo "$as_me:17754: result: $cf_cv_cpp_param_init" >&5 echo "${ECHO_T}$cf_cv_cpp_param_init" >&6 fi test "$cf_cv_cpp_param_init" = yes && cat >>confdefs.h <<\EOF @@ -15614,7 +17760,7 @@ EOF if test -n "$CXX"; then -echo "$as_me:15617: checking if $CXX accepts static_cast" >&5 +echo "$as_me:17763: checking if $CXX accepts static_cast" >&5 echo $ECHO_N "checking if $CXX accepts static_cast... $ECHO_C" >&6 if test "${cf_cv_cpp_static_cast+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15628,7 +17774,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat >conftest.$ac_ext <<_ACEOF -#line 15631 "configure" +#line 17777 "configure" #include "confdefs.h" class NCursesPanel @@ -15672,16 +17818,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15675: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17821: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15678: \$? = $ac_status" >&5 + echo "$as_me:17824: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15681: \"$ac_try\"") >&5 + { (eval echo "$as_me:17827: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15684: \$? = $ac_status" >&5 + echo "$as_me:17830: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_static_cast=yes else @@ -15699,7 +17845,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:15702: result: $cf_cv_cpp_static_cast" >&5 +echo "$as_me:17848: result: $cf_cv_cpp_static_cast" >&5 echo "${ECHO_T}$cf_cv_cpp_static_cast" >&6 fi @@ -15709,12 +17855,12 @@ test "$cf_cv_cpp_static_cast" = yes && cat >>confdefs.h <<\EOF EOF CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' + CXX_ARFLAGS='$(ARFLAGS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-ar -o' + CXX_ARFLAGS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -15723,7 +17869,7 @@ EOF solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-xar -o' + CXX_ARFLAGS='-xar -o' fi ;; esac @@ -15747,7 +17893,7 @@ else else if test "$cf_cv_header_stdbool_h" = 1 ; then -echo "$as_me:15750: checking for size of bool" >&5 +echo "$as_me:17896: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15758,7 +17904,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15761 "configure" +#line 17907 "configure" #include "confdefs.h" #include @@ -15800,15 +17946,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15803: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17949: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15806: \$? = $ac_status" >&5 + echo "$as_me:17952: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15808: \"$ac_try\"") >&5 + { (eval echo "$as_me:17954: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15811: \$? = $ac_status" >&5 + echo "$as_me:17957: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -15826,25 +17972,25 @@ fi fi rm -f cf_test.out -echo "$as_me:15829: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:17975: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:15835: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:17981: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi else - echo "$as_me:15841: checking for fallback type of bool" >&5 + echo "$as_me:17987: checking for fallback type of bool" >&5 echo $ECHO_N "checking for fallback type of bool... $ECHO_C" >&6 case "$host_cpu" in #(vi i?86) cf_cv_type_of_bool=char ;; #(vi *) cf_cv_type_of_bool=int ;; esac - echo "$as_me:15847: result: $cf_cv_type_of_bool" >&5 + echo "$as_me:17993: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 fi fi @@ -15871,19 +18017,20 @@ fi if test -f "${srcdir}/Ada95/Makefile.in" ; then -if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - { echo "$as_me:15876: WARNING: libtool does not support Ada - disabling feature" >&5 + if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + { echo "$as_me:18022: WARNING: libtool does not support Ada - disabling feature" >&5 echo "$as_me: WARNING: libtool does not support Ada - disabling feature" >&2;} - cf_with_ada=no - fi -fi + cf_with_ada=no + fi + fi + + if test "$cf_with_ada" != "no" ; then -if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 -echo "$as_me:15886: checking for $ac_word" >&5 +echo "$as_me:18033: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15898,7 +18045,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_gnat_exists="yes" -echo "$as_me:15901: found $ac_dir/$ac_word" >&5 +echo "$as_me:18048: found $ac_dir/$ac_word" >&5 break done @@ -15907,10 +18054,10 @@ fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$as_me:15910: result: $gnat_exists" >&5 + echo "$as_me:18057: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else - echo "$as_me:15913: result: no" >&5 + echo "$as_me:18060: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15918,34 +18065,28 @@ if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else -echo "$as_me:15921: checking for gnat version" >&5 +echo "$as_me:18068: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 -cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ - sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:15925: result: $cf_gnat_version" >&5 +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[0-9].[0-9][0-9]*' |\ + sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` +echo "$as_me:18073: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 -case $cf_gnat_version in - 3.1[1-9]*|3.[2-9]*|[4-9].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; -esac -case $cf_gnat_version in - 3.[1-9]*|[4-9].*) - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; +case $cf_gnat_version in #(vi +3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + { echo "$as_me:18081: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 +echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} + cf_cv_prog_gnat_correct=no + ;; esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:15948: checking for $ac_word" >&5 +echo "$as_me:18089: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15960,7 +18101,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_M4_exists="yes" -echo "$as_me:15963: found $ac_dir/$ac_word" >&5 +echo "$as_me:18104: found $ac_dir/$ac_word" >&5 break done @@ -15969,10 +18110,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:15972: result: $M4_exists" >&5 + echo "$as_me:18113: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:15975: result: no" >&5 + echo "$as_me:18116: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15981,10 +18122,10 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:15984: checking if GNAT works" >&5 + echo "$as_me:18125: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 -rm -f conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_prog_gnat_correct=no fi -rm -f conftest* +rm -rf conftest* *~conftest* - echo "$as_me:16012: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:18153: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - echo "$as_me:16019: checking if GNAT pragma Unreferenced works" >&5 + if test "$cf_cv_prog_gnat_correct" = yes; then + + ADAFLAGS="$ADAFLAGS -gnatpn" + + # make ADAFLAGS consistent with CFLAGS + case "$CFLAGS" in + *-g*) + + ADAFLAGS="$ADAFLAGS -g" + + ;; + esac + case "$CFLAGS" in + *-O*) + + ADAFLAGS="$ADAFLAGS -O3" + + ;; + esac + +echo "$as_me:18178: checking if GNAT supports generics" >&5 +echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[1-9]*|[4-9].*) #(vi + cf_gnat_generics=yes + ;; +*) + cf_gnat_generics=no + ;; +esac +echo "$as_me:18188: result: $cf_gnat_generics" >&5 +echo "${ECHO_T}$cf_gnat_generics" >&6 + +if test "$cf_gnat_generics" = yes +then + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" +else + cf_compile_generics= + cf_generic_objects= +fi + +echo "$as_me:18200: checking if GNAT supports SIGINT" >&5 +echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 +if test "${cf_cv_gnat_sigint+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rm -rf conftest* *~conftest* +cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then + cf_cv_gnat_sigint=yes +else + cf_cv_gnat_sigint=no +fi +rm -rf conftest* *~conftest* + +fi +echo "$as_me:18248: result: $cf_cv_gnat_sigint" >&5 +echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi + +echo "$as_me:18257: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 +if test "${cf_cv_pragma_unreferenced+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -rm -f conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_pragma_unreferenced=no fi -rm -f conftest* +rm -rf conftest* *~conftest* - echo "$as_me:16046: result: $cf_cv_pragma_unreferenced" >&5 +fi +echo "$as_me:18288: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 - # if the pragma is supported, use it (needed in the Trace code). - if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE - else - PRAGMA_UNREF=FALSE - fi +# if the pragma is supported, use it (needed in the Trace code). +if test $cf_cv_pragma_unreferenced = yes ; then + PRAGMA_UNREF=TRUE +else + PRAGMA_UNREF=FALSE +fi + +cf_gnat_libraries=no +cf_gnat_projects=no + +echo "$as_me:18301: checking if GNAT supports project files" >&5 +echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[0-9]*) #(vi + ;; +*) + case $cf_cv_system_name in #(vi + cygwin*) #(vi + ;; + *) + mkdir conftest.src conftest.bin conftest.lib + cd conftest.src + rm -rf conftest* *~conftest* + cat >>library.gpr <>confpackage.ads <>confpackage.adb <&5 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* + ;; + esac + ;; +esac +echo "$as_me:18369: result: $cf_gnat_projects" >&5 +echo "${ECHO_T}$cf_gnat_projects" >&6 + +if test $cf_gnat_projects = yes +then + echo "$as_me:18374: checking if GNAT supports libraries" >&5 +echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 + echo "$as_me:18376: result: $cf_gnat_libraries" >&5 +echo "${ECHO_T}$cf_gnat_libraries" >&6 +fi + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi + +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + +echo "$as_me:18396: checking for ada-compiler" >&5 +echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. if test "${with_ada_compiler+set}" = set; then @@ -16061,15 +18404,21 @@ else cf_ada_compiler=gnatmake fi; - cf_ada_package=terminal_interface +echo "$as_me:18407: result: $cf_ada_compiler" >&5 +echo "${ECHO_T}$cf_ada_compiler" >&6 + + cf_ada_package=terminal_interface + +echo "$as_me:18412: checking for ada-include" >&5 +echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. if test "${with_ada_include+set}" = set; then withval="$with_ada_include" else - withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}" -fi; if test -n "$prefix/lib/ada/adainclude" ; then + withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}" +fi; if test -n "$prefix/share/ada/adainclude" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -16096,7 +18445,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:16099: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18448: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -16105,12 +18454,18 @@ esac fi ADA_INCLUDE="$withval" +echo "$as_me:18457: result: $ADA_INCLUDE" >&5 +echo "${ECHO_T}$ADA_INCLUDE" >&6 + +echo "$as_me:18460: checking for ada-objects" >&5 +echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 + # Check whether --with-ada-objects or --without-ada-objects was given. if test "${with_ada_objects+set}" = set; then withval="$with_ada_objects" else - withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}" + withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}" fi; if test -n "$prefix/lib/ada/adalib" ; then if test "x$prefix" != xNONE; then @@ -16138,7 +18493,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:16141: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18496: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -16147,10 +18502,38 @@ esac fi ADA_OBJECTS="$withval" -fi -fi +echo "$as_me:18505: result: $ADA_OBJECTS" >&5 +echo "${ECHO_T}$ADA_OBJECTS" >&6 + +echo "$as_me:18508: checking if an Ada95 shared-library should be built" >&5 +echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 + +# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. +if test "${with_ada_sharedlib+set}" = set; then + withval="$with_ada_sharedlib" + with_ada_sharedlib=$withval else - cf_with_ada=no + with_ada_sharedlib=no +fi; +echo "$as_me:18518: result: $with_ada_sharedlib" >&5 +echo "${ECHO_T}$with_ada_sharedlib" >&6 + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + + fi + fi +else + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -16163,7 +18546,7 @@ fi ### chooses to split module lists into libraries. ### ### (see CF_LIB_RULES). -echo "$as_me:16166: checking for library subsets" >&5 +echo "$as_me:18549: checking for library subsets" >&5 echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 LIB_SUBSETS= @@ -16178,6 +18561,7 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" + if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -16185,17 +18569,32 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" + +# Most term-driver calls are to tinfo, but some like init_pair are to the +# base library (so it resides in base). +if test "$with_term_driver" != no ; then + LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" + case $cf_cv_system_name in #(vi + *mingw32*) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" + ;; + *) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" + ;; + esac +fi + test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" -echo "$as_me:16191: result: $LIB_SUBSETS" >&5 +echo "$as_me:18590: result: $LIB_SUBSETS" >&5 echo "${ECHO_T}$LIB_SUBSETS" >&6 ### Construct the list of include-directories to be generated -CPPFLAGS="-I. -I../include $CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then - CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -16209,7 +18608,7 @@ elif test "$includedir" != "/usr/include"; then fi fi -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -16226,7 +18625,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:16229: checking default library suffix" >&5 +echo "$as_me:18628: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -16237,46 +18636,50 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:16240: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:18639: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:16243: checking default library-dependency suffix" >&5 +echo "$as_me:18642: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 - case $DFT_LWR_MODEL in - libtool) + case $DFT_LWR_MODEL in #(vi + libtool) #(vi DFT_LIB_SUFFIX='.la' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - normal) + normal) #(vi DFT_LIB_SUFFIX='.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - debug) + debug) #(vi DFT_LIB_SUFFIX='_g.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - profile) + profile) #(vi DFT_LIB_SUFFIX='_p.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + DFT_LIB_SUFFIX='.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + cygwin*) #(vi DFT_LIB_SUFFIX='.dll' DFT_DEP_SUFFIX='.dll.a' ;; - darwin*) + darwin*) #(vi DFT_LIB_SUFFIX='.dylib' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - *) + *) #(vi DFT_LIB_SUFFIX='.sl' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; @@ -16289,10 +18692,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:16292: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:18695: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:16295: checking default object directory" >&5 +echo "$as_me:18698: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -16308,51 +18711,55 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:16311: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:18714: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 # libtool thinks it can make c++ shared libraries (perhaps only g++) if test "$cf_with_cxx" = yes ; then -echo "$as_me:16316: checking c++ library-dependency suffix" >&5 +echo "$as_me:18719: checking c++ library-dependency suffix" >&5 echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 if test "$with_libtool" != "no"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else - case normal in - libtool) + case normal in #(vi + libtool) #(vi CXX_LIB_SUFFIX='.la' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - normal) + normal) #(vi CXX_LIB_SUFFIX='.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - debug) + debug) #(vi CXX_LIB_SUFFIX='_g.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - profile) + profile) #(vi CXX_LIB_SUFFIX='_p.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + CXX_LIB_SUFFIX='.a' + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + cygwin*) #(vi CXX_LIB_SUFFIX='.dll' CXX_DEP_SUFFIX='.dll.a' ;; - darwin*) + darwin*) #(vi CXX_LIB_SUFFIX='.dylib' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi CXX_LIB_SUFFIX='.so' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - *) + *) #(vi CXX_LIB_SUFFIX='.sl' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; @@ -16366,7 +18773,7 @@ else test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && CXX_DEP_SUFFIX="${LIB_SUFFIX}${CXX_DEP_SUFFIX}" fi -echo "$as_me:16369: result: $CXX_LIB_SUFFIX" >&5 +echo "$as_me:18776: result: $CXX_LIB_SUFFIX" >&5 echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 fi @@ -16431,6 +18838,8 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" + TICS_LIST="$SHLIB_LIST $TEST_ARGS" + SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -16480,7 +18889,7 @@ normal|debug|profile) if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[45]*) #( vi + OS/2*|os2*|aix[4]*|solaris2.1[0-9]|darwin*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -16491,7 +18900,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[45]*) #( from ld manpage + aix[456]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -16516,15 +18925,93 @@ else esac fi +if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" +then + echo "$as_me:18930: checking if linker supports switching between static/dynamic" >&5 +echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6 + + rm -f libconftest.a + cat >conftest.$ac_ext < +int cf_ldflags_static(FILE *fp) { return fflush(fp); } +EOF + if { (eval echo "$as_me:18939: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:18942: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&5 >/dev/null + fi + rm -f conftest.* + + cf_save_LIBS="$LIBS" + + LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 18953 "configure" +#include "confdefs.h" + +#line 18956 "configure" +#include +int cf_ldflags_static(FILE *fp); + +int +main () +{ + + return cf_ldflags_static(stdin); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:18971: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:18974: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:18977: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:18980: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_ldflags_static=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_ldflags_static=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + rm -f libconftest.* + LIBS="$cf_save_LIBS" + + echo "$as_me:18993: result: $cf_ldflags_static" >&5 +echo "${ECHO_T}$cf_ldflags_static" >&6 + + if test $cf_ldflags_static != yes + then + LDFLAGS_STATIC= + LDFLAGS_SHARED= + fi +else + LDFLAGS_STATIC= + LDFLAGS_SHARED= +fi + ;; esac -echo "$as_me:16522: checking where we will install curses.h" >&5 +echo "$as_me:19009: checking where we will install curses.h" >&5 echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='${prefix}/include/ncurses'${LIB_SUFFIX} -echo "$as_me:16527: result: $includedir" >&5 +echo "$as_me:19014: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 ### Resolve a conflict between normal and wide-curses by forcing applications @@ -16532,10 +19019,11 @@ echo "${ECHO_T}$includedir" >&6 if test "$with_overwrite" != no ; then if test "$NCURSES_LIBUTF8" = 1 ; then NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' - { echo "$as_me:16535: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 + { echo "$as_me:19022: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} fi fi +WITH_OVERWRITE=$with_overwrite # used to separate tack out of the tree NCURSES_TREE= @@ -16548,7 +19036,7 @@ EOF ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. -echo "$as_me:16551: checking for src modules" >&5 +echo "$as_me:19039: checking for src modules" >&5 echo $ECHO_N "checking for src modules... $ECHO_C" >&6 # dependencies and linker-arguments for test-programs @@ -16611,25 +19099,34 @@ EOF fi fi done -echo "$as_me:16614: result: $cf_cv_src_modules" >&5 +echo "$as_me:19102: result: $cf_cv_src_modules" >&5 echo "${ECHO_T}$cf_cv_src_modules" >&6 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" TEST_ARG2="-L${LIB_2ND} $TEST_ARG2" -SRC_SUBDIRS="man include" +SRC_SUBDIRS= +if test "x$cf_with_manpages" != xno ; then + SRC_SUBDIRS="$SRC_SUBDIRS man" +fi +SRC_SUBDIRS="$SRC_SUBDIRS include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS test" +if test "x$cf_with_tests" != "xno" ; then + SRC_SUBDIRS="$SRC_SUBDIRS test" +fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src" + if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" + fi fi SUB_MAKEFILES= @@ -16639,15 +19136,16 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done fi if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" + SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi DIRS_TO_MAKE="lib" @@ -16679,8 +19177,12 @@ do test ! -d $cf_dir && mkdir $cf_dir done +# symbols that differ when compiling Ada95 by itself. +NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' + +# values to use as strings cat >>confdefs.h <>confdefs.h <&5 -echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 -if test -n "$LDFLAGS" ; then -echo "$as_me:16766: result: maybe" >&5 -echo "${ECHO_T}maybe" >&6 -test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me-configure}:16770: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 - -test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me-configure}:16774: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -case "$EXTRA_LDFLAGS" in #(vi --Wl,-rpath,*) #(vi - cf_rpath_hack="-Wl,-rpath," - ;; --R\ *) - cf_rpath_hack="-R " - ;; --R*) - cf_rpath_hack="-R" - ;; -*) - cf_rpath_hack= - ;; -esac -if test -n "$cf_rpath_hack" ; then - cf_rpath_dst= - for cf_rpath_src in $LDFLAGS - do - test -n "$verbose" && echo " Filtering $cf_rpath_src" 1>&6 - -echo "${as_me-configure}:16796: testing Filtering $cf_rpath_src ..." 1>&5 - - case $cf_rpath_src in #(vi - -L*) #(vi - if test "$cf_rpath_hack" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` - fi - test -n "$verbose" && echo " ...Filter $cf_rpath_tmp" 1>&6 - -echo "${as_me-configure}:16807: testing ...Filter $cf_rpath_tmp ..." 1>&5 - - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" - done - LDFLAGS=$cf_rpath_dst - test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me-configure}:16817: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 - - test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me-configure}:16821: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -fi -else -echo "$as_me:16825: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi - ### Define substitutions for header files to avoid name-pollution if test "$cf_cv_have_tcgetattr" = yes ; then @@ -16849,9 +19290,82 @@ else fi ################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" +test "$use_database" = yes && \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" + SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" -ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" +SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi + +# Extract the first word of "tic", so it can be a program name with args. +set dummy tic; ac_word=$2 +echo "$as_me:19308: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_TIC_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $TIC_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_TIC_PATH="$TIC_PATH" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH:/usr/local/ncurses/bin" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_TIC_PATH="$ac_dir/$ac_word" + echo "$as_me:19325: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_TIC_PATH" && ac_cv_path_TIC_PATH="unknown" + ;; +esac +fi +TIC_PATH=$ac_cv_path_TIC_PATH + +if test -n "$TIC_PATH"; then + echo "$as_me:19337: result: $TIC_PATH" >&5 +echo "${ECHO_T}$TIC_PATH" >&6 +else + echo "$as_me:19340: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$FALLBACK_LIST" +then + if test "$TIC_PATH" = unknown + then + { echo "$as_me:19348: WARNING: no tic program found for fallbacks" >&5 +echo "$as_me: WARNING: no tic program found for fallbacks" >&2;} + fi +fi + +if test "x$cf_with_tests" != xno ; then + MAKE_TESTS= +else + MAKE_TESTS="#" +fi + +ADAHTML_DIR=../../doc/html/ada + +SUB_SCRIPTS= +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + SUB_SCRIPTS="mk-dlls.sh" + ;; +esac + +ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_SCRIPTS $SUB_MAKEFILES Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16932,7 +19446,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:16935: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:19449: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -17058,13 +19572,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:17111: error: ambiguous option: $1 + { { echo "$as_me:19625: 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;} @@ -17127,7 +19641,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:17130: error: unrecognized option: $1 + -*) { { echo "$as_me:19644: 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;} @@ -17146,7 +19660,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20080325, executed with +This file was extended by $as_me 2.52.20101002, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -17170,10 +19684,12 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" +LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -17181,13 +19697,15 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" +TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -17205,7 +19723,10 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" +cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" +cf_with_manpages="$cf_with_manpages" +cf_with_tests="$cf_with_tests" host="$host" target="$target" @@ -17218,13 +19739,15 @@ do # Handling of arguments. "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; + "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; + "$SUB_SCRIPTS" ) CONFIG_FILES="$CONFIG_FILES $SUB_SCRIPTS" ;; "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:17227: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:19750: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -17349,7 +19872,12 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@LN_S@,$LN_S,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t s,@SET_MAKE@,$SET_MAKE,;t t +s,@CTAGS@,$CTAGS,;t t +s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t @@ -17359,7 +19887,7 @@ s,@LD@,$LD,;t t s,@ac_ct_LD@,$ac_ct_LD,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@AR_OPTS@,$AR_OPTS,;t t +s,@ARFLAGS@,$ARFLAGS,;t t s,@DESTDIR@,$DESTDIR,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@BUILD_CPP@,$BUILD_CPP,;t t @@ -17370,7 +19898,9 @@ s,@BUILD_LIBS@,$BUILD_LIBS,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t s,@cf_list_models@,$cf_list_models,;t t +s,@LIBTOOL_VERSION@,$LIBTOOL_VERSION,;t t s,@LIBTOOL@,$LIBTOOL,;t t +s,@LT_UNDEF@,$LT_UNDEF,;t t s,@LIBTOOL_CXX@,$LIBTOOL_CXX,;t t s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t s,@LIB_CREATE@,$LIB_CREATE,;t t @@ -17392,6 +19922,7 @@ s,@CC_G_OPT@,$CC_G_OPT,;t t s,@CXX_G_OPT@,$CXX_G_OPT,;t t s,@LD_MODEL@,$LD_MODEL,;t t s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t +s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t s,@LINK_PROGS@,$LINK_PROGS,;t t @@ -17400,8 +19931,8 @@ s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@cf_ldd_prog@,$cf_ldd_prog,;t t s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t -s,@PATHSEP@,$PATHSEP,;t t s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t s,@WHICH_XTERM@,$WHICH_XTERM,;t t s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t @@ -17423,19 +19954,26 @@ s,@NCURSES_TPARM_VARARGS@,$NCURSES_TPARM_VARARGS,;t t s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t +s,@NCURSES_CCHARW_MAX@,$NCURSES_CCHARW_MAX,;t t s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t +s,@GENERATED_EXT_FUNCS@,$GENERATED_EXT_FUNCS,;t t +s,@NCURSES_SP_FUNCS@,$NCURSES_SP_FUNCS,;t t +s,@GENERATED_SP_FUNCS@,$GENERATED_SP_FUNCS,;t t s,@NCURSES_CONST@,$NCURSES_CONST,;t t s,@NCURSES_EXT_COLORS@,$NCURSES_EXT_COLORS,;t t s,@NCURSES_MOUSE_VERSION@,$NCURSES_MOUSE_VERSION,;t t s,@NCURSES_SBOOL@,$NCURSES_SBOOL,;t t s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t +s,@NCURSES_INTEROP_FUNCS@,$NCURSES_INTEROP_FUNCS,;t t s,@PTHREAD@,$PTHREAD,;t t s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t s,@cf_cv_enable_opaque@,$cf_cv_enable_opaque,;t t s,@NCURSES_OPAQUE@,$NCURSES_OPAQUE,;t t s,@NCURSES_SIZE_T@,$NCURSES_SIZE_T,;t t +s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@EXTRA_CXXFLAGS@,$EXTRA_CXXFLAGS,;t t s,@ADA_TRACE@,$ADA_TRACE,;t t @@ -17446,23 +19984,29 @@ s,@cf_cv_1UL@,$cf_cv_1UL,;t t s,@cf_cv_typeof_mmask_t@,$cf_cv_typeof_mmask_t,;t t s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;t t s,@TEST_LIBS@,$TEST_LIBS,;t t +s,@TEST_LIBS2@,$TEST_LIBS2,;t t s,@CXXCPP@,$CXXCPP,;t t s,@CXXLDFLAGS@,$CXXLDFLAGS,;t t s,@CXX_AR@,$CXX_AR,;t t -s,@CXX_AR_OPTS@,$CXX_AR_OPTS,;t t +s,@CXX_ARFLAGS@,$CXX_ARFLAGS,;t t s,@CXXLIBS@,$CXXLIBS,;t t s,@USE_CXX_BOOL@,$USE_CXX_BOOL,;t t s,@gnat_exists@,$gnat_exists,;t t s,@M4_exists@,$M4_exists,;t t s,@cf_ada_make@,$cf_ada_make,;t t -s,@cf_ada_compiler@,$cf_ada_compiler,;t t -s,@cf_ada_package@,$cf_ada_package,;t t -s,@ADAFLAGS@,$ADAFLAGS,;t t s,@cf_compile_generics@,$cf_compile_generics,;t t s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t +s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t +s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t +s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t +s,@cf_ada_compiler@,$cf_ada_compiler,;t t +s,@cf_ada_package@,$cf_ada_package,;t t s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t +s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t +s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t s,@ACPPFLAGS@,$ACPPFLAGS,;t t s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t @@ -17490,9 +20034,15 @@ s,@TEST_ARG2@,$TEST_ARG2,;t t s,@TEST_DEP2@,$TEST_DEP2,;t t s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;t t +s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t s,@HAVE_TCGETATTR@,$HAVE_TCGETATTR,;t t s,@HAVE_TERMIO_H@,$HAVE_TERMIO_H,;t t s,@HAVE_TERMIOS_H@,$HAVE_TERMIOS_H,;t t +s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t +s,@cross_compiling@,$cross_compiling,;t t +s,@TIC_PATH@,$TIC_PATH,;t t +s,@MAKE_TESTS@,$MAKE_TESTS,;t t +s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t CEOF EOF @@ -17607,7 +20157,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:17610: creating $ac_file" >&5 + { echo "$as_me:20160: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -17625,7 +20175,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:17628: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20178: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -17638,7 +20188,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:17641: error: cannot find input file: $f" >&5 + { { echo "$as_me:20191: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -17704,7 +20254,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:17707: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:20257: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -17715,7 +20265,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:17718: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20268: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -17728,7 +20278,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:17731: error: cannot find input file: $f" >&5 + { { echo "$as_me:20281: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -17786,7 +20336,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:17789: $ac_file is unchanged" >&5 + { echo "$as_me:20339: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -17828,7 +20378,6 @@ done; } done EOF cat >>$CONFIG_STATUS <<\EOF - # # CONFIG_COMMANDS section. # @@ -17838,16 +20387,19 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue case $ac_dest in default ) +if test "x$cf_with_tests" != xno ; then for cf_dir in test do if test ! -d $srcdir/$cf_dir; then continue elif test -f $srcdir/$cf_dir/programs; then - $AWK -f $srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile + $AWK -f $srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile fi done +fi + case $cf_cv_system_name in #(vi OS/2*|os2*) #(vi LIB_PREFIX='' @@ -17862,6 +20414,23 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi +if test -n "$TINFO_SUFFIX" ; then + case $TINFO_SUFFIX in + tw*) + TINFO_NAME="${TINFO_NAME}tw" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` + ;; + t*) + TINFO_NAME="${TINFO_NAME}t" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` + ;; + w*) + TINFO_NAME="${TINFO_NAME}w" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` + ;; + esac +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -17873,40 +20442,44 @@ do for cf_item in $cf_LIST_MODELS do - case $cf_item in - libtool) + case $cf_item in #(vi + libtool) #(vi cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) + normal) #(vi cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) + debug) #(vi cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) + profile) #(vi cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + cf_suffix='.a' + cf_depsuf=$cf_suffix + ;; + cygwin*) #(vi cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) + darwin*) #(vi cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) + *) #(vi cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -17927,6 +20500,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${REL_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -17943,6 +20524,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -18020,40 +20609,44 @@ do cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - case $cf_item in - libtool) + case $cf_item in #(vi + libtool) #(vi cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) + normal) #(vi cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) + debug) #(vi cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) + profile) #(vi cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + cf_suffix='.a' + cf_depsuf=$cf_suffix + ;; + cygwin*) #(vi cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) + darwin*) #(vi cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) + *) #(vi cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -18123,6 +20716,16 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in + tw*) + cf_libname=`echo $cf_libname | sed 's/tw$//'` + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_dir_suffix=tw + ;; + t*) + cf_libname=`echo $cf_libname | sed 's/t$//'` + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_dir_suffix=t + ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -18140,17 +20743,19 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink-no} \ + ReLink=${cf_cv_do_relink:-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ + libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -18234,18 +20839,28 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile <>Ada95/src/Makefile +fi +fi ;; esac done @@ -18392,4 +21013,4 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -${MAKE-make} preinstall +${MAKE:-make} preinstall diff --git a/configure.in b/configure.in index 2b4422a439d..d5bc841e9b0 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2010,2011 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 * @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $ +dnl $Id: configure.in,v 1.520 2011/03/28 00:22:26 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.454 $) +AC_REVISION($Revision: 1.520 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -122,6 +122,13 @@ AC_ARG_WITH(ada, [cf_with_ada=yes]) AC_MSG_RESULT($cf_with_ada) +AC_MSG_CHECKING(if you want to install manpages) +AC_ARG_WITH(manpages, + [ --without-manpages suppress install of manpages], + [cf_with_manpages=$withval], + [cf_with_manpages=yes]) +AC_MSG_RESULT($cf_with_manpages) + AC_MSG_CHECKING(if you want to build programs such as tic) AC_ARG_WITH(progs, [ --without-progs suppress build with programs (e.g., tic)], @@ -129,6 +136,13 @@ AC_ARG_WITH(progs, [cf_with_progs=yes]) AC_MSG_RESULT($cf_with_progs) +AC_MSG_CHECKING(if you want to build test-programs) +AC_ARG_WITH(tests, + [ --without-tests suppress build with test-programs], + [cf_with_tests=$withval], + [cf_with_tests=yes]) +AC_MSG_RESULT($cf_with_tests) + AC_MSG_CHECKING(if you wish to install curses.h) AC_ARG_WITH(curses-h, [ --without-curses-h install curses.h as ncurses.h only], @@ -148,10 +162,35 @@ CF_PROG_AWK CF_PROG_EGREP CF_PROG_INSTALL CF_PROG_LINT -AC_PROG_LN_S +CF_PROG_LN_S AC_SYS_LONG_FILE_NAMES +# if we find pkg-config, check if we should install the ".pc" files. +CF_PKG_CONFIG + +if test "$PKG_CONFIG" != no ; then + AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) + AC_MSG_RESULT($enable_pc_files) + else + AC_MSG_RESULT(no) + AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR) + enable_pc_files=no + fi +fi +AC_SUBST(PKG_CONFIG_LIBDIR) + AC_MSG_CHECKING(if we should assume mixed-case filenames) AC_ARG_ENABLE(mixed-case, [ --enable-mixed-case tic should assume mixed-case filenames], @@ -176,7 +215,7 @@ dnl These are standard among *NIX systems, but not when cross-compiling AC_CHECK_TOOL(RANLIB, ranlib, ':') AC_CHECK_TOOL(LD, ld, ld) AC_CHECK_TOOL(AR, ar, ar) -CF_SUBST(archiver options,AR_OPTS,rv) +CF_AR_FLAGS dnl Special option for use by system-builders: the install-prefix is used to dnl adjust the location into which the actual install is done, so that an @@ -327,6 +366,7 @@ if test "$with_gpm" != no ; then SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" + CF_ADD_LIB(gpm,TEST_LIBS) fi AC_DEFINE(HAVE_LIBGPM) CF_CHECK_GPM_WGETCH @@ -380,6 +420,11 @@ if test "$CC_SHARED_OPTS" = "unknown"; then done fi +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + CF_DISABLE_RPATH_HACK +fi + ############################################################################### CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) @@ -413,7 +458,7 @@ if test "$use_database" != no ; then AC_DEFINE(USE_DATABASE) AC_MSG_CHECKING(which terminfo source-file will be installed) - AC_ARG_ENABLE(database, + AC_ARG_WITH(database, [ --with-database=XXX specify terminfo source to install], [TERMINFO_SRC=$withval]) AC_MSG_RESULT($TERMINFO_SRC) @@ -618,7 +663,7 @@ AC_MSG_CHECKING(if you want broken-linker support code) AC_ARG_ENABLE(broken_linker, [ --enable-broken_linker compile with broken-linker support code], [with_broken_linker=$enableval], - [with_broken_linker=${BROKEN_LINKER-no}]) + [with_broken_linker=${BROKEN_LINKER:-no}]) AC_MSG_RESULT($with_broken_linker) BROKEN_LINKER=0 @@ -655,7 +700,7 @@ NCURSES_WCHAR_T=0 NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -CF_XOPEN_SOURCE +CF_XOPEN_SOURCE(500) # Work around breakage on OS X CF_SIGWINCH @@ -676,7 +721,15 @@ AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" AC_DEFINE(USE_WIDEC_SUPPORT) - CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) + + case "$CFLAGS $CPPFLAGS" in #(vi + *-D_XOPEN_SOURCE=500) #(vi + ;; + *) + CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) + ;; + esac + # with_overwrite=no NCURSES_CH_T=cchar_t AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs) @@ -797,6 +850,15 @@ AC_ARG_WITH(mmask-t, [NCURSES_MMASK_T=auto]) AC_MSG_RESULT($NCURSES_MMASK_T) +### use option --with-ccharw-max to override CCHARW_MAX size +AC_MSG_CHECKING(for size CCHARW_MAX) +AC_ARG_WITH(ccharw-max, + [ --with-ccharw-max=XXX override size CCHARW_MAX], + [NCURSES_CCHARW_MAX="$withval"], + [NCURSES_CCHARW_MAX=5]) +AC_MSG_RESULT($NCURSES_CCHARW_MAX) +AC_SUBST(NCURSES_CCHARW_MAX) + ### Enable compiling-in rcs id's AC_MSG_CHECKING(if RCS identifiers should be compiled-in) AC_ARG_WITH(rcs-ids, @@ -807,7 +869,7 @@ AC_MSG_RESULT($with_rcs_ids) test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) ############################################################################### -CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) +CF_MAN_PAGES([ captoinfo clear infocmp infotocap tabs tic toe tput tset ]) ############################################################################### CF_HELP_MESSAGE(Extensions:) @@ -825,13 +887,47 @@ if test "$with_ext_funcs" = yes ; then AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_RESIZE_TERM) + AC_DEFINE(HAVE_TERM_ENTRY_H) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) AC_DEFINE(HAVE_WRESIZE) AC_DEFINE(NCURSES_EXT_FUNCS) + GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 + GENERATED_EXT_FUNCS= fi AC_SUBST(NCURSES_EXT_FUNCS) +AC_SUBST(GENERATED_EXT_FUNCS) + +AC_MSG_CHECKING(if you want to build with experimental SCREEN extensions) +AC_ARG_ENABLE(sp-funcs, + [ --enable-sp-funcs enable experimental SCREEN-extensions], + [with_sp_funcs=$enableval], + [with_sp_funcs=no]) +AC_MSG_RESULT($with_sp_funcs) +if test "$with_sp_funcs" = yes ; then + NCURSES_SP_FUNCS=1 + AC_DEFINE(NCURSES_SP_FUNCS) + GENERATED_SP_FUNCS=generated +else + NCURSES_SP_FUNCS=0 + GENERATED_SP_FUNCS= +fi +AC_SUBST(NCURSES_SP_FUNCS) +AC_SUBST(GENERATED_SP_FUNCS) + +AC_MSG_CHECKING(if you want to build with experimental terminal-driver) +AC_ARG_ENABLE(term-driver, + [ --enable-term-driver enable experimental terminal-driver], + [with_term_driver=$enableval], + [with_term_driver=no]) +AC_MSG_RESULT($with_term_driver) +if test "$with_term_driver" = yes ; then + AC_DEFINE(USE_TERM_DRIVER) + if test "$with_sp_funcs" != yes ; then + AC_MSG_ERROR(The term-driver option relies upon sp-funcs) + fi +fi ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) @@ -973,30 +1069,55 @@ test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment AC_MSG_CHECKING(if you want colorfgbg code) AC_ARG_ENABLE(colorfgbg, - [ --enable-colorfgbg compile with $COLORFGBG code], + [ --enable-colorfgbg compile-in experimental $COLORFGBG code], [with_colorfgbg=$enableval], [with_colorfgbg=no]) AC_MSG_RESULT($with_colorfgbg) test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) +### use option --enable-interop to turn on use of bindings used for interop +AC_MSG_CHECKING(if you want interop bindings) +AC_ARG_ENABLE(interop, + [ --enable-interop compile-in experimental interop bindings], + [with_exp_interop=$enableval], + [with_exp_interop=no]) +AC_MSG_RESULT($with_exp_interop) + +NCURSES_INTEROP_FUNCS=0 +test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 +AC_SUBST(NCURSES_INTEROP_FUNCS) + # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. CF_WITH_PTHREAD -AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) -AC_ARG_ENABLE(weak-symbols, - [ --enable-weak-symbols enable weak-symbols for pthreads], - [use_weak_symbols=$withval], - [use_weak_symbols=no]) -AC_MSG_RESULT($use_weak_symbols) -if test "$use_weak_symbols" = yes ; then - CF_WEAK_SYMBOLS -else - cf_cv_weak_symbols=no -fi +if test "x$with_pthread" != xno; then + AC_CHECK_FUNC(pthread_kill,[ + AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads) + AC_ARG_ENABLE(pthreads-eintr, + [ --enable-pthreads-eintr enable EINTR in wgetch with pthreads], + [use_pthreads_eintr=$enableval], + [use_pthreads_eintr=no]) + AC_MSG_RESULT($use_pthreads_eintr) + if test $use_pthreads_eintr = yes ; then + AC_DEFINE(USE_PTHREADS_EINTR) + fi]) -if test $cf_cv_weak_symbols = yes ; then - AC_DEFINE(USE_WEAK_SYMBOLS) + AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) + AC_ARG_ENABLE(weak-symbols, + [ --enable-weak-symbols enable weak-symbols for pthreads], + [use_weak_symbols=$enableval], + [use_weak_symbols=no]) + AC_MSG_RESULT($use_weak_symbols) + if test "$use_weak_symbols" = yes ; then + CF_WEAK_SYMBOLS + else + cf_cv_weak_symbols=no + fi + + if test $cf_cv_weak_symbols = yes ; then + AC_DEFINE(USE_WEAK_SYMBOLS) + fi fi PTHREAD= @@ -1024,11 +1145,13 @@ if test "$with_reentrant" = yes ; then cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then - CF_REMOVE_LIB(LIBS,$LIBS,pthread) - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + if test $cf_cv_weak_symbols = yes ; then + CF_REMOVE_LIB(LIBS,$LIBS,pthread) + CF_ADD_LIB(pthread,TEST_LIBS) + CF_ADD_LIB(pthread,TEST_LIBS2) + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi AC_DEFINE(USE_REENTRANT) CF_NCURSES_ABI_6 else @@ -1042,6 +1165,20 @@ AC_SUBST(cf_cv_enable_opaque) AC_SUBST(NCURSES_OPAQUE) AC_SUBST(NCURSES_SIZE_T) +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + AC_MSG_CHECKING(for prefix used to wrap public variables) + AC_ARG_WITH(wrap-prefix, + [ --with-wrap-prefix=XXX override prefix used for public variables], + [NCURSES_WRAP_PREFIX=$withval], + [NCURSES_WRAP_PREFIX=_nc_]) + AC_MSG_RESULT($NCURSES_WRAP_PREFIX) +else + NCURSES_WRAP_PREFIX=_nc_ +fi +AC_SUBST(NCURSES_WRAP_PREFIX) +AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX") + AC_MSG_CHECKING(if you want experimental safe-sprintf code) AC_ARG_ENABLE(safe-sprintf, [ --enable-safe-sprintf compile with experimental safe-sprintf code], @@ -1097,7 +1234,7 @@ AC_ARG_ENABLE(warnings, AC_MSG_RESULT($with_warnings) if test "x$with_warnings" = "xyes"; then - ADAFLAGS="$ADAFLAGS -gnatg" + CF_ADD_ADAFLAGS(-gnatg) CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) if test "$cf_with_cxx" = yes ; then CF_GXX_WARNINGS(Wno-unused) @@ -1119,7 +1256,7 @@ then AC_DEFINE(NDEBUG) CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + CF_ADD_ADAFLAGS(-gnata) fi fi @@ -1165,12 +1302,18 @@ fi AC_SUBST(ADA_TRACE) ### Checks for libraries. +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY),[ AC_CHECK_LIB(bsd, gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY) - LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday + CF_ADD_LIB(bsd))])dnl CLIX: bzero, select, gettimeofday + ;; +esac CF_MATH_LIB(MATH_LIB,sin(x)) AC_SUBST(MATH_LIB) @@ -1187,6 +1330,7 @@ fcntl.h \ getopt.h \ limits.h \ locale.h \ +math.h \ poll.h \ sys/bsdtypes.h \ sys/ioctl.h \ @@ -1204,7 +1348,7 @@ wctype.h \ # Note: even non-Posix ISC needs to declare fd_set if test "$ISC" = yes ; then AC_CHECK_LIB(cposix,main) - AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()' + AC_CHECK_LIB(inet,bzero,CF_ADD_LIB(inet))dnl also 'select()' fi CF_SYS_TIME_SELECT @@ -1287,6 +1431,8 @@ CF_TYPE_SIGACTION CF_SIZECHANGE CF_FUNC_MEMMOVE CF_FUNC_POLL +CF_VA_COPY +AC_FUNC_VFORK # special check for test/ditto.c CF_FUNC_OPENPTY @@ -1294,10 +1440,11 @@ if test "$cf_cv_func_openpty" != no ; then AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>) AC_DEFINE(USE_XTERM_PTY) if test "$cf_cv_lib_util" = yes ; then - TEST_LIBS="-lutil $TEST_LIBS" + CF_ADD_LIB(util,TEST_LIBS) fi fi AC_SUBST(TEST_LIBS) +AC_SUBST(TEST_LIBS2) if test "$with_hashed_db" != no ; then AC_DEFINE(USE_HASHED_DB) @@ -1354,12 +1501,12 @@ cerr << "testing" << endl; CF_CPP_STATIC_CAST CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' + CXX_ARFLAGS='$(ARFLAGS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-ar -o' + CXX_ARFLAGS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -1368,13 +1515,13 @@ cerr << "testing" << endl; solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-xar -o' + CXX_ARFLAGS='-xar -o' fi ;; esac AC_SUBST(CXXLDFLAGS) AC_SUBST(CXX_AR) - AC_SUBST(CXX_AR_OPTS) + AC_SUBST(CXX_ARFLAGS) else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -1435,99 +1582,49 @@ if test -f "${srcdir}/Ada95/Makefile.in" ; then dnl libtool does not know anything about GNAT, though a change made in 1998 dnl provided for it "someday". Disable the ada subtree if we are using dnl libtool -TD 20070714 -if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - AC_MSG_WARN(libtool does not support Ada - disabling feature) - cf_with_ada=no - fi -fi + if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + AC_MSG_WARN(libtool does not support Ada - disabling feature) + cf_with_ada=no + fi + fi dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. -if test "$cf_with_ada" != "no" ; then -cf_ada_make=gnatmake -AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) -if test "$ac_cv_prog_gnat_exists" = no; then - cf_ada_make= + if test "$cf_with_ada" != "no" ; then + CF_PROG_GNAT + if test "$cf_cv_prog_gnat_correct" = yes; then + CF_ADD_ADAFLAGS(-gnatpn) + + # make ADAFLAGS consistent with CFLAGS + case "$CFLAGS" in + *-g*) + CF_ADD_ADAFLAGS(-g) + ;; + esac + case "$CFLAGS" in + *-O*) + CF_ADD_ADAFLAGS(-O3) + ;; + esac + + CF_GNAT_GENERICS + CF_GNAT_SIGINT + CF_GNAT_PRAGMA_UNREF + CF_GNAT_PROJECTS + + CF_WITH_ADA_COMPILER + + cf_ada_package=terminal_interface + AC_SUBST(cf_ada_package) + + CF_WITH_ADA_INCLUDE + CF_WITH_ADA_OBJECTS + CF_WITH_ADA_SHAREDLIB + fi + fi else - CF_GNAT_VERSION - AC_CHECK_PROG(M4_exists, m4, yes, no) - if test "$ac_cv_prog_M4_exists" = no; then - cf_cv_prog_gnat_correct=no - echo Ada95 binding required program m4 not found. Ada95 binding disabled. - fi - if test "$cf_cv_prog_gnat_correct" = yes; then - AC_MSG_CHECKING(if GNAT works) - CF_GNAT_TRY_RUN([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is -begin - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) - AC_MSG_RESULT($cf_cv_prog_gnat_correct) - fi -fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - - AC_MSG_CHECKING(if GNAT pragma Unreferenced works) - CF_GNAT_TRY_LINK([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is - test : Integer; - pragma Unreferenced (test); -begin - test := 1; - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no]) - AC_MSG_RESULT($cf_cv_pragma_unreferenced) - - # if the pragma is supported, use it (needed in the Trace code). - if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE - else - PRAGMA_UNREF=FALSE - fi - - AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], - [cf_ada_compiler=$withval], - [cf_ada_compiler=gnatmake]) - - cf_ada_package=terminal_interface - - AC_SUBST(cf_ada_make) - AC_SUBST(cf_ada_compiler) - AC_SUBST(cf_ada_package) - AC_SUBST(ADAFLAGS) - AC_SUBST(cf_compile_generics) - AC_SUBST(cf_generic_objects) - AC_SUBST(PRAGMA_UNREF) - - CF_WITH_PATH(ada-include, - [ --with-ada-include=DIR Ada includes are in DIR], - ADA_INCLUDE, - PREFIX/lib/ada/adainclude, - [$]prefix/lib/ada/adainclude) - AC_SUBST(ADA_INCLUDE) - - CF_WITH_PATH(ada-objects, - [ --with-ada-objects=DIR Ada objects are in DIR], - ADA_OBJECTS, - PREFIX/lib/ada/adalib, - [$]prefix/lib/ada/adalib) - AC_SUBST(ADA_OBJECTS) - -fi -fi -else - cf_with_ada=no + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -1554,6 +1651,7 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" + if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -1561,6 +1659,21 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" + +# Most term-driver calls are to tinfo, but some like init_pair are to the +# base library (so it resides in base). +if test "$with_term_driver" != no ; then + LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" + case $cf_cv_system_name in #(vi + *mingw32*) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" + ;; + *) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" + ;; + esac +fi + test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" @@ -1656,6 +1769,8 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" + TICS_LIST="$SHLIB_LIST $TEST_ARGS" + SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -1723,6 +1838,7 @@ if test "$NCURSES_LIBUTF8" = 1 ; then AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h) fi fi +WITH_OVERWRITE=$with_overwrite AC_SUBST(WITH_OVERWRITE) AC_SUBST(TICS_LIST) @@ -1742,40 +1858,91 @@ AC_DEFINE(HAVE_SLK_COLOR) CF_SRC_MODULES($modules_to_build) if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" + SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi CF_DIRS_TO_MAKE -AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') +# symbols that differ when compiling Ada95 by itself. +NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' +AC_SUBST(NCURSES_SHLIB2) + +# values to use as strings +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR') AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}") ### Now that we're done running tests, add the compiler-warnings, if any CF_ADD_CFLAGS($EXTRA_CFLAGS) -### If we're building with rpath, try to link non-standard libs that way too. -if test "$DFT_LWR_MODEL" = "shared"; then - CF_RPATH_HACK -fi - ### Define substitutions for header files to avoid name-pollution CF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0) CF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0) CF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0) ################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" +test "$use_database" = yes && \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" + SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" +SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi +AC_SUBST(MAKE_PC_FILES) +AC_SUBST(cross_compiling) + +AC_PATH_PROG(TIC_PATH,tic,unknown,$PATH:/usr/local/ncurses/bin) +if test -n "$FALLBACK_LIST" +then + if test "$TIC_PATH" = unknown + then + AC_MSG_WARN(no tic program found for fallbacks) + fi +fi +AC_SUBST(TIC_PATH) + +if test "x$cf_with_tests" != xno ; then + MAKE_TESTS= +else + MAKE_TESTS="#" +fi +AC_SUBST(MAKE_TESTS) + +ADAHTML_DIR=../../doc/html/ada +AC_SUBST(ADAHTML_DIR) + +SUB_SCRIPTS= +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + SUB_SCRIPTS="mk-dlls.sh" + ;; +esac + AC_OUTPUT( \ include/MKterm.h.awk \ include/curses.head:include/curses.h.in \ + include/ncurses_dll.h \ include/termcap.h \ include/unctrl.h \ + $SUB_SCRIPTS \ $SUB_MAKEFILES \ Makefile,[ -CF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test) +if test "x$cf_with_tests" != xno ; then + CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK"], test) +fi CF_LIB_RULES($SRC_SUBDIRS) + +if test "x$cf_with_ada" != xno ; then +if test -z "$USE_OLD_MAKERULES" ; then + $AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile +fi +fi ],[ ### Special initialization commands, used to pass information from the ### configuration-run into config.status @@ -1785,10 +1952,12 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" +LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -1796,13 +1965,15 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" +TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -1820,9 +1991,12 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" +cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" +cf_with_manpages="$cf_with_manpages" +cf_with_tests="$cf_with_tests" host="$host" target="$target" ],cat)dnl -${MAKE-make} preinstall +${MAKE:-make} preinstall diff --git a/dist.mk b/dist.mk index 551d773313f..371f0043b3f 100644 --- a/dist.mk +++ b/dist.mk @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998-2010,2011 Free 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 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.671 2008/11/02 00:58:38 tom Exp $ +# $Id: dist.mk,v 1.810 2011/04/04 22:42:20 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -36,8 +36,8 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 -NCURSES_MINOR = 7 -NCURSES_PATCH = 20081102 +NCURSES_MINOR = 9 +NCURSES_PATCH = 20110404 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) @@ -57,8 +57,7 @@ GNATHTML= `type -p gnathtml || type -p gnathtml.pl` # has the effect of lengthening the text portion of the page -- so man2html # would remove some text. The man program on Redhat 6.1 appears to work with # man2html if we set the top/bottom margins to 6 (the default is 7). Newer -# versions of 'man' on Linux leave no margin (and make it harder to sync with -# pages). +# versions of 'man' leave no margin (and make it harder to sync with pages). MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html' ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml diff --git a/doc/html/announce.html b/doc/html/announce.html index 234c703145a..961e7571cf6 100644 --- a/doc/html/announce.html +++ b/doc/html/announce.html @@ -1,8 +1,8 @@ - + - - -Announcing ncurses 5.7 - - - - - -

Announcing ncurses 5.7

- -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

- -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and encouraged the keepers of -Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to -ncurses.

- -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

- -The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

- -The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . - -

Release Notes

- -This release is designed to be upward compatible from ncurses 5.0 through 5.6; -very few applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.6 release. -

-Interface changes: -

    -
  • generate linkable stubs for some macros: -
    - getattrs - -
-New features and improvements: -
    -
  • library -
      -
    • new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are - reentrant, but most require either a window-level or - screen-level mutex.
      - (This is API-compatible, - but not ABI-compatible with the normal library). - -
    • add NCURSES_OPAQUE symbol to curses.h, will - use to make structs opaque in selected configurations. - -
    • add NCURSES_EXT_FUNCS and - NCURSES_EXT_COLORS symbols to curses.h to make - it simpler to tell if the extended functions and/or colors - are declared. - -
    • add wresize() to C++ binding - -
    • eliminate fixed-buffer vsprintf() calls in C++ binding. - -
    • add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - -
    • adapt mouse-handling code from menu library in form-library - -
    • improve tracing for form library, showing created forms, - fields, etc. - -
    • make $NCURSES_NO_PADDING feature work for termcap interface . - -
    • add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - -
    • several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x -
    - -
  • programs: -
      -
    • modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - -
    • several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - -
    • add adacurses-config to the Ada95 install. - -
    • modify tic -f option to format spaces as - \s to prevent them from being lost when that - is read back in unformatted strings. - -
    • The tack program is now distributed separately - from ncurses. -
    - -
  • terminal database -
      -
    • added entries: -
        -
      • Eterm-256color, - Eterm-88color and - rxvt-88color -
      • aterm -
      • konsole-256color -
      • mrxvt -
      • screen.mlterm -
      • screen.rxvt -
      • teraterm4.59 is now the primary primary - teraterm entry, renamed original to - teraterm2.3 -
      • 9term terminal -
      • Newbury Data entries -
      -
    • updated/improved entries: -
        -
      • gnome to version 2.22.3 -
      • h19, z100 -
      • konsole to version 1.6.6 -
      • mlterm, mlterm+pcfkeys -
      • xterm, and building-blocks for function-keys - to xterm patch #230. -
      -
    -
-Major bug fixes: -
    -
  • add logic to tic for cancelling strings in user-defined - capabilities - (this is needed for - current konsole terminfo entry). - -
  • modify mk-1st.awk so the generated makefile rules for - linking or installing shared libraries do not first remove the - library, in case it is in use, e.g., libncurses.so by - /bin/sh. - -
  • correct check for notimeout() in wgetch(). - -
  • fix a sign-extension bug in infocmp's repair_acsc() function. - -
  • change winnstr() to stop at the end of the line. - -
  • make Ada95 demo_panels() example work. - -
  • fix for adding a non-spacing character at the beginning of a line. - -
  • fill in extended-color pair to make colors work - for wide-characters using extended-colors. - -
  • improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - -
  • modify win_wchnstr() to ensure that only a base cell - is returned for each multi-column character. - -
  • improve waddch() and winsch() handling of - EILSEQ from mbrtowc() by using unctrl() - to display illegal bytes rather than trying to append further bytes - to make up a valid sequence. - -
  • restore curs_set() state after - endwin()/refresh() - -
  • modify keyname() to use "^X" form only if - meta() has been called, or if keyname() - is called without initializing curses, e.g., via - initscr() or newterm(). - -
  • modify unctrl() to check codes in 128-255 range versus - isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - -
  • improve resizeterm() by moving ripped-off lines, and - repainting the soft-keys. - -
  • modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - -
  • use NCURSES_MOUSE_MASK() in definition of - BUTTON_RELEASE(), etc., to make those work properly - with the --enable-ext-mouse configuration - -
  • correct some functions in Ada95 binding which were using return - value from C where none was returned. - -
  • reviewed/fixed issues reported by Coverity and Klocwork tools. -
- -Portability: -
    -
  • configure script: -
      -
    • new options: -
      - -
      --disable-big-strings -
      control whether static string tables are generated as single - large strings (to improve startup performance), or as array - of individual strings. - -
      --disable-relink -
      control whether shared libraries are relinked (during install) - when rpath is enabled. - -
      --disable-tic-depends -
      make explicit whether tic library depends on ncurses/ncursesw - library. - -
      --enable-mixed-case -
      override the configure script's check if the filesystem - supports mixed-case filenames. - This allows one to control how the terminal database - maps to the filesystem. - For filesystems that do not support mixed-case, the library - uses generate 2-character (hexadecimal) codes for the - lower-level of the filesystem terminfo database - -
      --enable-reentrant -
      builds a different flavor of the ncurses library (ncursest) - which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded support). - -
      --enable-weak-symbols -
      use weak-symbols for linking to the POSIX thread library, - and use the same soname for the ncurses shared library - as the normal library (caveat: the ABI is for the threaded - library, which makes global data accessed via functions). - -
      --with-pthread -
      build with the POSIX thread library (tested with AIX, - Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). - -
      --with-ticlib -
      build/install the tic-support functions in a separate library - -
      - -
    • improved options: -
      - -
      --enable-ext-colors -
      requires the wide-character configuration. - -
      --with-chtype -
      ignore option value "unsigned" is always added to - the type in curses.h; do the same for --with-mmask-t. - -
      --with-dmalloc -
      build-fix for redefinition of strndup. - -
      --with-hashed-db -
      accepts a parameter which is the install-prefix of a given - Berkeley Database. - -
      --with-hashed-db -
      the $LIBS environment variable overrides the search for the db - library. - -
      --without-hashed-db -
      assumed when "--disable-database" is used. - -
      - -
    - -
  • other configure/build issues: -
      -
    • build-fixes for LynxOS -
    • modify shared-library rules to allow FreeBSD 3.x to use rpath. -
    • build-fix for FreeBSD "contemporary" TTY interface. -
    • build-fixes for AIX with libtool. -
    • build-fixes for Darwin and libtool. -
    • modify BeOS-specific ifdef's to build on Haiku. -
    • corrected gcc options for building shared libraries on Solaris - and IRIX64. -
    • change shared-library configuration for OpenBSD, make rpath work. -
    • build-fixes for using libutf8, e.g., on OpenBSD 3.7 -
    • add "-e" option in ncurses/Makefile.in when generating source-files - to force earlier exit if the build environment fails unexpectedly. -
    • add support for shared libraries for QNX. -
    • change delimiter in MKlib_gen.sh from '%' to '@', to - avoid substitution by IBM xlc to '#' as part of its extensions to - digraphs. -
    - -
  • library: -
      -
    • rewrite wrapper for wcrtomb(), making it work on - Solaris. This is used in the form library to determine the length - of the buffer needed by field_buffer. -
    • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding - type for data manipulated by signal handlers. -
    • set locale in misc/ncurses-config.in since it uses a range -
    • disable GPM mouse support when $TERM does not happen to contain - "linux", since Gpm_Open() no longer limits its assertion to terminals - that it might handle, e.g., within "screen" in xterm. -
    • reset mouse file-descriptor when unloading GPM library. -
    - -
  • test programs: -
      -
    • update test programs to build/work with various UNIX curses for - comparisons. -
    -
- -

Features of Ncurses

- -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
- -The ncurses package also has many useful extensions over SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -and most EXTENDED features). -It includes many function calls not supported under SVr4 curses -(but portability of all -calls is documented so you can use the SVr4 subset only). -
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
  • Ada95 and C++ bindings. -
  • Support for mouse event reporting with X Window xterm -and FreeBSD and OS/2 console windows. -
  • Extended mouse support via Alessandro Rubini's gpm package. -
  • The function wresize() allows you to resize windows, preserving -their data. -
  • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
  • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
  • Support for 256-color terminals, such as modern xterm, when configured -using the --enable-ext-colors option. -
  • Support for 16-color terminals, such as aixterm and modern xterm. -
  • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
  • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
  • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
  • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
  • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
  • A BSD-like tset(1) utility is provided. -
  • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
  • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
  • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
  • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
  • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
  • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
  • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
  • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
- -

State of the Package

- -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

- -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -

-
cdk -
Curses Development Kit -
-http://invisible-island.net/cdk/ -
-http://www.vexus.ca/products/CDK/ -
ded -
directory-editor -
-http://invisible-island.net/ded/ -
dialog -
the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
-http://invisible-island.net/dialog/ -
lynx -
the character-screen WWW browser -
-http://lynx.isc.org/release/ -
Midnight Commander -
file manager -
-http://www.ibiblio.org/mc/ -
mutt -
mail utility -
-http://www.mutt.org/ -
ncftp -
file-transfer utility -
-http://www.ncftp.com/ -
nvi -
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
-http://www.bostic.com/vi/ -
-
pinfo -
Lynx-like info browser. -https://alioth.debian.org/projects/pinfo/ -
tin -
newsreader, supporting color, MIME -http://www.tin.org/ -
-as well as some that use ncurses for the terminfo support alone: -
-
minicom -
terminal emulator -
- -http://alioth.debian.org/projects/minicom/ -
vile -
vi-like-emacs -
-http://invisible-island.net/vile/ -
-

- -The ncurses distribution includes a selection of test programs (including -a few games). - -

Who's Who and What's What

- -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

- -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -

+
+
+
+  
+
+  Announcing ncurses 5.9
+  
+  
+
+
+
+  

Announcing ncurses 5.9

The ncurses (new curses) + library is a free software emulation of curses in System V + Release 4.0, and more. It uses terminfo format, supports pads and + color and multiple highlights and forms characters and + function-key mapping, and has all the other SYSV-curses + enhancements over BSD curses. + +

In mid-June 1995, the maintainer of 4.4BSD curses declared + that he considered 4.4BSD curses obsolete, and encouraged the + keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to + switch over to ncurses.

+ +

The ncurses code was developed under GNU/Linux. It has been in + use for some time with OpenBSD as the system curses library, and + on FreeBSD and NetBSD as an external package. It should port + easily to any ANSI/POSIX-conforming UNIX. It has even been ported + to OS/2 Warp!

+ +

The distribution includes the library and support utilities, + including a terminfo compiler tic(1), a decompiler infocmp(1), + clear(1), tput(1), tset(1), and a termcap conversion tool + captoinfo(1). Full manual pages are provided for the library and + tools.

+ +

The ncurses distribution is available via anonymous FTP at the + GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
+ + It is also available at ftp://invisible-island.net/ncurses/ .

+ +

Release Notes

This release is designed to be upward + compatible from ncurses 5.0 through 5.8; very few applications + will require recompilation, depending on the platform. These are + the highlights from the change-log since ncurses 5.8 release. +

+ This is a bug-fix release, correcting a small number of urgent problems + in the ncurses library from the 5.8 release. +

+ It also improves the Ada95 binding: +

    +
  • fixes a longstanding portability problem with its use of the + set_field_type + function. Because that function uses variable-length argument lists, + its interface with gnat does not work with certain platforms. +
  • improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. +

    Those were a proof of concept. For the 5.9 release, those + scripts are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + here. +

  • additional improvements were made for portability of the + ncurses examples, adding rpm- and dpkg-scripts for test-builds. + See + this page + for snapshots and other information. +
+ +

Features of Ncurses

The ncurses package is fully + compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are + documented).
  • + +
  • Full support for SVr4 curses features including keyboard + mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys.
  • + +
  • An emulation of the SVr4 panels library, supporting a stack + of windows with backing store, is included.
  • + +
  • An emulation of the SVr4 menus library, supporting a + uniform but flexible interface for menu programming, is + included.
  • + +
  • An emulation of the SVr4 form library, supporting data + collection through on-screen forms, is included.
  • + +
  • Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses.
  • + +
  • The utilities have options to allow you to filter terminfo + entries for use with less capable + curses/terminfo versions such + as the HP/UX and AIX ports.
  • +
The ncurses package also has many useful extensions over + SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the + X/OPEN curses specification, XSI curses (that is, it implements + all BASE level features, and most EXTENDED features). It + includes many function calls not supported under SVr4 curses + (but portability of all calls is documented so you can use the + SVr4 subset only).
  • + +
  • Unlike SVr3 curses, ncurses can write to the + rightmost-bottommost corner of the screen if your terminal has + an insert-character capability.
  • + +
  • Ada95 and C++ bindings.
  • + +
  • Support for mouse event reporting with X Window xterm and + FreeBSD and OS/2 console windows.
  • + +
  • Extended mouse support via Alessandro Rubini's gpm + package.
  • + +
  • The function wresize allows you to resize + windows, preserving their data.
  • + +
  • The function use_default_colors allows you to + use the terminal's default colors for the default color pair, + achieving the effect of transparent colors.
  • + +
  • The functions keyok and + define_key allow you to better control the use of + function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code.
  • + +
  • Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors + option.
  • + +
  • Support for 16-color terminals, such as aixterm + and modern xterm.
  • + +
  • Better cursor-movement optimization. The package now + features a cursor-local-movement computation more efficient + than either BSD's or System V's.
  • + +
  • Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables + it to make optimal use of hardware scrolling, line-insertion, + and line-deletion for screen-line movements. This algorithm is + more powerful than the 4.4BSD curses quickch + routine.
  • + +
  • Real support for terminals with the magic-cookie glitch. + The screen-update code will refrain from drawing a highlight if + the magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space + character. It will automatically shift highlight boundaries + when doing so would make it possible to draw the highlight + without changing the visual appearance of the screen.
  • + +
  • It is possible to generate the library with a list of + pre-loaded fallback entries linked to it so that it can serve + those terminal types even when no terminfo tree or termcap file + is accessible (this may be useful for support of + screen-oriented programs that must run in single-user + mode).
  • + +
  • The tic(1)/captoinfo utility provided with ncurses has the + ability to translate many termcaps from the XENIX, IBM and + AT&T extension sets.
  • + +
  • A BSD-like tset(1) utility is provided.
  • + +
  • The ncurses library and utilities will automatically read + terminfo entries from $HOME/.terminfo if it exists, and compile + to that directory if it exists and the user has no write access + to the system directory. This feature makes it easier for users + to have personal terminfo entries without giving up access to + the system terminfo directory.
  • + +
  • You may specify a path of directories to search for + compiled descriptions with the environment variable + TERMINFO_DIRS (this generalizes the feature provided by + TERMINFO under stock System V.)
  • + +
  • In terminfo source files, use capabilities may refer not + just to other entries in the same source file (as in System V) + but also to compiled entries in either the system terminfo + directory or the user's $HOME/.terminfo directory.
  • + +
  • A script (capconvert) is provided to help + BSD users transition from termcap to terminfo. It gathers the + information in a TERMCAP environment variable and/or a + ~/.termcap local entries file and converts it to an equivalent + local terminfo tree under $HOME/.terminfo.
  • + +
  • Automatic fallback to the /etc/termcap file can be compiled + in when it is not possible to build a terminfo tree. This + feature is neither fast nor cheap, you don't want to use it + unless you have to, but it's there.
  • + +
  • The table-of-entries utility toe makes it + easy for users to see exactly what terminal types are available + on the system.
  • + +
  • The library meets the XSI requirement that every macro + entry point have a corresponding function which may be linked + (and will be prototype-checked) if the macro definition is + disabled with #undef.
  • + +
  • An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface.
  • +
+ +

State of the Package

Numerous bugs present in earlier + versions have been fixed; the library is far more reliable than + it used to be. Bounds checking in many `dangerous' entry points + has been improved. The code is now type-safe according to gcc + -Wall. The library has been checked for malloc leaks and arena + corruption by the Purify memory-allocation tester. + +

The ncurses code has been tested with a wide variety of + applications including (versions starting with those noted):

+ +
+
cdk
+ +
Curses Development Kit
+ http://invisible-island.net/cdk/
+ + http://www.vexus.ca/products/CDK/
+ +
ded
+ +
directory-editor
+ http://invisible-island.net/ded/
+ +
dialog
+ +
the underlying application used in Slackware's setup, and + the basis for similar applications on GNU/Linux.
+ http://invisible-island.net/dialog/
+ +
lynx
+ +
the character-screen WWW browser
+ http://lynx.isc.org/release/
+ +
Midnight Commander
+ +
file manager
+ http://www.midnight-commander.org/
+ +
mutt
+ +
mail utility
+ http://www.mutt.org/
+ +
ncftp
+ +
file-transfer utility
+ http://www.ncftp.com/
+ +
nvi
+ +
New vi versions 1.50 are able to use ncurses versions 1.9.7 + and later.
+ https://sites.google.com/a/bostic.com/keithbostic/nvi
+
+ +
pinfo
+ +
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
+ +
tin
+ +
newsreader, supporting color, MIME http://www.tin.org/
+
as well as some that use ncurses for the terminfo support + alone: + +
+
minicom
+ +
terminal emulator
+ http://alioth.debian.org/projects/minicom/
+ +
vile
+ +
vi-like-emacs
+ http://invisible-island.net/vile/
+
+ +

The ncurses distribution includes a selection of test programs + (including a few games).

+ +

Who's Who and What's What

Zeyd Ben-Halim started it from + a previous package pcurses, written by Pavel Curtis. Eric S. + Raymond continued development. Jürgen Pfeifer wrote most of + the form and menu libraries. Ongoing work is being done by + Thomas Dickey. + Thomas Dickey acts as the maintainer for the Free Software + Foundation, which holds the copyright on ncurses. Contact the + current maintainers at bug-ncurses@gnu.org. + +

To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line:

+
              subscribe <name>@<host.domain>
-
+
-This list is open to anyone interested in helping with the development and -testing of this package.

+

This list is open to anyone interested in helping with the + development and testing of this package.

-Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . +

Beta versions of ncurses and patches to the current release + are made available at ftp://invisible-island.net/ncurses/ .

-

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. +

Future Plans

-

Other Related Resources

+
    +
  • Extended-level XPG4 conformance, with internationalization + support.
  • -The distribution provides a newer version of the terminfo-format -terminal description file once maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file, and provides several user-definable extensions -beyond the X/Open specification.

    +

  • Ports to more systems, including DOS and Windows.
  • +
We need people to help with these projects. If you are + interested in working on them, please join the ncurses list. -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - +

Other Related Resources

The distribution provides a newer + version of the terminfo-format terminal description file once + maintained by Eric + Raymond . Unlike the older version, the termcap and + terminfo data are provided in the same file, and provides several + user-definable extensions beyond the X/Open specification. + +

You can find lots of information on terminal-related topics + not covered in the terminfo file at + Richard Shuford's archive .

+ + diff --git a/doc/html/hackguide.html b/doc/html/hackguide.html index 97d1369170c..417f4c9855e 100644 --- a/doc/html/hackguide.html +++ b/doc/html/hackguide.html @@ -1,8 +1,8 @@ - + term.h and comp_captab.c disagree about the <--\n"); - printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); - printf("#endif\n\n"); - - free(hash_table); - return EXIT_SUCCESS; + return ptr; } -#endif diff --git a/ncurses/tinfo/comp_parse.c b/ncurses/tinfo/comp_parse.c index 3325a0ddae6..8204d75a819 100644 --- a/ncurses/tinfo/comp_parse.c +++ b/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -51,9 +51,8 @@ #include #include -#include -MODULE_ID("$Id: comp_parse.c,v 1.69 2008/08/16 21:58:16 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -92,16 +91,18 @@ force_bar(char *dst, char *src) } return src; } +#define ForceBar(dst, src) ((strchr(src, '|') == 0) ? force_bar(dst, src) : src) NCURSES_EXPORT(bool) _nc_entry_match(char *n1, char *n2) /* do any of the aliases in a pair of terminal names match? */ { char *pstart, *qstart, *pend, *qend; - char nc1[MAX_NAME_SIZE + 2], nc2[MAX_NAME_SIZE + 2]; + char nc1[MAX_NAME_SIZE + 2]; + char nc2[MAX_NAME_SIZE + 2]; - n1 = force_bar(nc1, n1); - n2 = force_bar(nc2, n2); + n1 = ForceBar(nc1, n1); + n2 = ForceBar(nc2, n2); for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) @@ -273,7 +274,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) unresolved++; total_unresolved++; - _nc_curr_line = lookline; + _nc_curr_line = (int) lookline; _nc_warning("resolution of use=%s failed", lookfor); qp->uses[i].link = 0; } @@ -375,7 +376,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) if (_nc_check_termtype != 0) { _nc_curr_col = -1; for_entry_list(qp) { - _nc_curr_line = qp->startline; + _nc_curr_line = (int) qp->startline; _nc_set_type(_nc_first_name(qp->tterm.term_names)); _nc_check_termtype2(&qp->tterm, literal); } @@ -473,7 +474,6 @@ _nc_leaks_tic(void) { _nc_alloc_entry_leaks(); _nc_captoinfo_leaks(); - _nc_comp_captab_leaks(); _nc_comp_scan_leaks(); #if BROKEN_LINKER || USE_REENTRANT _nc_names_leaks(); diff --git a/ncurses/tinfo/comp_scan.c b/ncurses/tinfo/comp_scan.c index 5ad750f930d..8725b2edb7e 100644 --- a/ncurses/tinfo/comp_scan.c +++ b/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,10 +48,9 @@ #include #include -#include #include -MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -61,19 +60,13 @@ MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") #define iswhite(ch) (ch == ' ' || ch == '\t') -NCURSES_EXPORT_VAR(int) -_nc_syntax = 0; /* termcap or terminfo? */ -NCURSES_EXPORT_VAR(long) -_nc_curr_file_pos = 0; /* file offset of current line */ -NCURSES_EXPORT_VAR(long) -_nc_comment_start = 0; /* start of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_comment_end = 0; /* end of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_start_line = 0; /* start line of current entry */ +NCURSES_EXPORT_VAR (int) _nc_syntax = 0; /* termcap or terminfo? */ +NCURSES_EXPORT_VAR (long) _nc_curr_file_pos = 0; /* file offset of current line */ +NCURSES_EXPORT_VAR (long) _nc_comment_start = 0; /* start of comment range before name */ +NCURSES_EXPORT_VAR (long) _nc_comment_end = 0; /* end of comment range before name */ +NCURSES_EXPORT_VAR (long) _nc_start_line = 0; /* start line of current entry */ -NCURSES_EXPORT_VAR(struct token) -_nc_curr_token = +NCURSES_EXPORT_VAR (struct token) _nc_curr_token = { 0, 0, 0 }; @@ -91,8 +84,7 @@ static int pushtype; /* type of pushback token */ static char *pushname; #if NCURSES_EXT_FUNCS -NCURSES_EXPORT_VAR(bool) -_nc_disable_period = FALSE; /* used by tic -a option */ +NCURSES_EXPORT_VAR (bool) _nc_disable_period = FALSE; /* used by tic -a option */ #endif /***************************************************************************** @@ -211,6 +203,10 @@ next_char(void) if (fgets(result + used, (int) (allocated - used), yyin) != 0) { bufstart = result; if (used == 0) { + if (_nc_curr_line == 0 + && IS_TIC_MAGIC(result)) { + _nc_err_abort("This is a compiled terminal description, not a source"); + } _nc_curr_line++; _nc_curr_col = 0; } @@ -431,7 +427,7 @@ _nc_get_token(bool silent) && !strchr(terminfo_punct, (char) ch)) { if (!silent) _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'", - terminfo_punct, unctrl((chtype) ch)); + terminfo_punct, unctrl(UChar(ch))); _nc_panic_mode(separator); goto start_token; } @@ -487,7 +483,6 @@ _nc_get_token(bool silent) if (OkToAdd()) { AddCh(ch); } else { - ch = EOF; break; } } @@ -596,7 +591,7 @@ _nc_get_token(bool silent) case '@': if ((ch = next_char()) != separator && !silent) _nc_warning("Missing separator after `%s', have %s", - tok_buf, unctrl((chtype) ch)); + tok_buf, unctrl(UChar(ch))); _nc_curr_token.tk_name = tok_buf; type = CANCEL; break; @@ -617,7 +612,7 @@ _nc_get_token(bool silent) _nc_warning("Missing separator"); } _nc_curr_token.tk_name = tok_buf; - _nc_curr_token.tk_valnumber = number; + _nc_curr_token.tk_valnumber = (int) number; type = NUMBER; break; @@ -637,7 +632,7 @@ _nc_get_token(bool silent) /* just to get rid of the compiler warning */ type = UNDEF; if (!silent) - _nc_warning("Illegal character - '%s'", unctrl((chtype) ch)); + _nc_warning("Illegal character - '%s'", unctrl(UChar(ch))); } } /* end else (first_column == FALSE) */ } /* end else (ch != EOF) */ @@ -730,48 +725,47 @@ _nc_trans_string(char *ptr, char *last) int count = 0; int number = 0; int i, c; - chtype ch, last_ch = '\0'; + int last_ch = '\0'; bool ignored = FALSE; bool long_warning = FALSE; - while ((ch = c = next_char()) != (chtype) separator && c != EOF) { + while ((c = next_char()) != separator && c != EOF) { if (ptr >= (last - 1)) { if (c != EOF) { while ((c = next_char()) != separator && c != EOF) { ; } - ch = c; } break; } if ((_nc_syntax == SYN_TERMCAP) && c == '\n') break; - if (ch == '^' && last_ch != '%') { - ch = c = next_char(); + if (c == '^' && last_ch != '%') { + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (!(is7bits(ch) && isprint(ch))) { - _nc_warning("Illegal ^ character - '%s'", unctrl(ch)); + if (!(is7bits(c) && isprint(c))) { + _nc_warning("Illegal ^ character - '%s'", unctrl(UChar(c))); } - if (ch == '?') { + if (c == '?') { *(ptr++) = '\177'; if (_nc_tracing) _nc_warning("Allow ^? as synonym for \\177"); } else { - if ((ch &= 037) == 0) - ch = 128; - *(ptr++) = (char) (ch); + if ((c &= 037) == 0) + c = 128; + *(ptr++) = (char) (c); } - } else if (ch == '\\') { - ch = c = next_char(); + } else if (c == '\\') { + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (ch >= '0' && ch <= '7') { - number = ch - '0'; + if (c >= '0' && c <= '7') { + number = c - '0'; for (i = 0; i < 2; i++) { - ch = c = next_char(); + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); @@ -848,31 +842,31 @@ _nc_trans_string(char *ptr, char *last) default: _nc_warning("Illegal character '%s' in \\ sequence", - unctrl(ch)); + unctrl(UChar(c))); /* FALLTHRU */ case '|': - *(ptr++) = (char) ch; - } /* endswitch (ch) */ - } /* endelse (ch < '0' || ch > '7') */ + *(ptr++) = (char) c; + } /* endswitch (c) */ + } /* endelse (c < '0' || c > '7') */ } - /* end else if (ch == '\\') */ - else if (ch == '\n' && (_nc_syntax == SYN_TERMINFO)) { + /* end else if (c == '\\') */ + else if (c == '\n' && (_nc_syntax == SYN_TERMINFO)) { /* * Newlines embedded in a terminfo string are ignored, provided * that the next line begins with whitespace. */ ignored = TRUE; } else { - *(ptr++) = (char) ch; + *(ptr++) = (char) c; } if (!ignored) { if (_nc_curr_col <= 1) { - push_back((char) ch); - ch = '\n'; + push_back((char) c); + c = '\n'; break; } - last_ch = ch; + last_ch = c; count++; } ignored = FALSE; @@ -885,7 +879,7 @@ _nc_trans_string(char *ptr, char *last) *ptr = '\0'; - return (ch); + return (c); } /* diff --git a/ncurses/tinfo/db_iterator.c b/ncurses/tinfo/db_iterator.c index fdc2bb09ead..82665cb54be 100644 --- a/ncurses/tinfo/db_iterator.c +++ b/ncurses/tinfo/db_iterator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2006-2007,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 * @@ -38,7 +38,7 @@ #include -MODULE_ID("$Id: db_iterator.c,v 1.6 2007/04/22 00:00:26 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.9 2010/12/25 23:00:25 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -104,7 +104,7 @@ next_list_item(const char *source, int *offset) if (source != 0) { FreeIfNeeded(ThisDbList); ThisDbList = strdup(source); - ThisDbSize = strlen(source); + ThisDbSize = (int) strlen(source); } if (ThisDbList != 0 && ThisDbSize && *offset < ThisDbSize) { @@ -118,11 +118,10 @@ next_list_item(const char *source, int *offset) * again, using the data at the offset. */ if (marker == 0) { - *offset += strlen(result) + 1; - marker = result + *offset; + *offset += (int) strlen(result); } else { *marker++ = 0; - *offset = marker - ThisDbList; + *offset = (int) (marker - ThisDbList); } if (*result == 0 && result != (ThisDbList + ThisDbSize)) result = system_db; diff --git a/ncurses/tinfo/entries.c b/ncurses/tinfo/entries.c index cf2a8337b87..b1e14a803f3 100644 --- a/ncurses/tinfo/entries.c +++ b/ncurses/tinfo/entries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2006-2009,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 * @@ -28,6 +28,7 @@ /**************************************************************************** * Author: Thomas E. Dickey * + * and: Juergen Pfeifer * ****************************************************************************/ #include @@ -35,9 +36,8 @@ #include #include -#include -MODULE_ID("$Id: entries.c,v 1.8 2008/09/27 13:11:10 tom Exp $") +MODULE_ID("$Id: entries.c,v 1.17 2010/01/23 17:57:43 tom Exp $") /**************************************************************************** * @@ -119,6 +119,12 @@ _nc_leaks_tinfo(void) #if NO_LEAKS _nc_free_tparm(); _nc_tgetent_leaks(); + + if (TerminalOf(CURRENT_SCREEN) != 0) { + del_curterm(TerminalOf(CURRENT_SCREEN)); + } + + _nc_comp_captab_leaks(); _nc_free_entries(_nc_head); _nc_get_type(0); _nc_first_name(0); @@ -131,6 +137,12 @@ _nc_leaks_tinfo(void) if ((s = _nc_home_terminfo()) != 0) free(s); + +#ifdef TRACE + trace(0); + _nc_trace_buf(-1, 0); +#endif + #endif /* NO_LEAKS */ returnVoid; } diff --git a/ncurses/tinfo/free_ttype.c b/ncurses/tinfo/free_ttype.c index fa0fff1b83f..ad056ba4545 100644 --- a/ncurses/tinfo/free_ttype.c +++ b/ncurses/tinfo/free_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1999-2010,2011 Free 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,9 +41,8 @@ #include #include -#include -MODULE_ID("$Id: free_ttype.c,v 1.13 2006/06/25 10:46:02 tom Exp $") +MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $") NCURSES_EXPORT(void) _nc_free_termtype(TERMTYPE *ptr) @@ -70,6 +69,7 @@ use_extended_names(bool flag) { int oldflag = _nc_user_definable; + START_TRACE(); T((T_CALLED("use_extended_names(%d)"), flag)); _nc_user_definable = flag; returnBool(oldflag); diff --git a/ncurses/tinfo/hashed_db.c b/ncurses/tinfo/hashed_db.c index 3fc04eae3cc..bf7a968ee96 100644 --- a/ncurses/tinfo/hashed_db.c +++ b/ncurses/tinfo/hashed_db.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2006 * + * Author: Thomas E. Dickey 2006-on * ****************************************************************************/ #include @@ -36,7 +36,7 @@ #if USE_HASHED_DB -MODULE_ID("$Id: hashed_db.c,v 1.13 2006/08/19 19:48:38 tom Exp $") +MODULE_ID("$Id: hashed_db.c,v 1.14 2008/12/13 20:59:02 tom Exp $") #if HASHED_DB_API >= 2 static DBC *cursor; @@ -49,27 +49,30 @@ NCURSES_EXPORT(DB *) _nc_db_open(const char *path, bool modify) { DB *result = 0; + int code; #if HASHED_DB_API >= 4 db_create(&result, NULL, 0); - result->open(result, - NULL, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644); + if ((code = result->open(result, + NULL, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644)) != 0) { + result = 0; + } #elif HASHED_DB_API >= 3 db_create(&result, NULL, 0); - result->open(result, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644); + if ((code = result->open(result, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644)) != 0) { + result = 0; + } #elif HASHED_DB_API >= 2 - int code; - if ((code = db_open(path, DB_HASH, modify ? DB_CREATE : DB_RDONLY, @@ -77,21 +80,22 @@ _nc_db_open(const char *path, bool modify) (DB_ENV *) 0, (DB_INFO *) 0, &result)) != 0) { - T(("cannot open %s: %s", path, strerror(code))); result = 0; - } else { - T(("opened %s", path)); } #else - result = dbopen(path, - modify ? (O_CREAT | O_RDWR) : O_RDONLY, - 0644, - DB_HASH, - NULL); - if (result != 0) { - T(("opened %s", path)); + if ((result = dbopen(path, + modify ? (O_CREAT | O_RDWR) : O_RDONLY, + 0644, + DB_HASH, + NULL)) == 0) { + code = errno; } #endif + if (result != 0) { + T(("opened %s", path)); + } else { + T(("cannot open %s: %s", path, strerror(code))); + } return result; } diff --git a/ncurses/tinfo/home_terminfo.c b/ncurses/tinfo/home_terminfo.c index 4521c4a8da6..69d69f95bf7 100644 --- a/ncurses/tinfo/home_terminfo.c +++ b/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: home_terminfo.c,v 1.11 2008/08/03 23:43:11 tom Exp $") +MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $") /* ncurses extension...fall back on user's private directory */ @@ -53,7 +53,7 @@ _nc_home_terminfo(void) if (use_terminfo_vars()) { if (MyBuffer == 0) { if ((home = getenv("HOME")) != 0) { - unsigned want = (strlen(home) + sizeof(PRIVATE_INFO)); + size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); MyBuffer = typeMalloc(char, want); if (MyBuffer == 0) _nc_err_abort(MSG_NO_MEMORY); diff --git a/ncurses/tinfo/init_keytry.c b/ncurses/tinfo/init_keytry.c index 2f6fe4f6fad..ea47b382b49 100644 --- a/ncurses/tinfo/init_keytry.c +++ b/ncurses/tinfo/init_keytry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2009,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 * @@ -27,16 +27,9 @@ ****************************************************************************/ #include - -#include -/* keypad_xmit, keypad_local, meta_on, meta_off */ -/* cursor_visible,cursor_normal,cursor_invisible */ - #include /* struct tinfo_fkeys */ -#include - -MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") +MODULE_ID("$Id: init_keytry.c,v 1.17 2010/04/24 22:29:56 tom Exp $") /* ** _nc_init_keytry() @@ -50,7 +43,7 @@ MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") * than cur_term. */ #undef CUR -#define CUR (sp->_term)->type. +#define CUR SP_TERMTYPE #if BROKEN_LINKER #undef _nc_tinfo_fkeys @@ -73,7 +66,7 @@ _nc_tinfo_fkeysf(void) NCURSES_EXPORT(void) _nc_init_keytry(SCREEN *sp) { - size_t n; + unsigned n; /* The sp->_keytry value is initialized in newterm(), where the sp * structure is created, because we can not tell where keypad() or @@ -97,12 +90,13 @@ _nc_init_keytry(SCREEN *sp) { TERMTYPE *tp = &(sp->_term->type); for (n = STRCOUNT; n < NUM_STRINGS(tp); ++n) { - const char *name = ExtStrname(tp, n, strnames); + const char *name = ExtStrname(tp, (int) n, strnames); char *value = tp->Strings[n]; if (name != 0 && *name == 'k' && value != 0 - && key_defined(value) == 0) { + && NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx + value) == 0) { (void) _nc_add_to_try(&(sp->_keytry), value, n - STRCOUNT + KEY_MAX); diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index 919e47287a7..d8fdedca843 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,17 +30,21 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ #include -#include /* ena_acs, acs_chars */ -MODULE_ID("$Id: lib_acs.c,v 1.36 2008/08/16 19:22:55 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_acs.c,v 1.43 2010/12/25 23:00:45 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map -NCURSES_EXPORT_VAR(chtype *) -_nc_acs_map(void) +NCURSES_EXPORT(chtype *) +NCURSES_PUBLIC_VAR(acs_map) (void) { if (MyBuffer == 0) MyBuffer = typeCalloc(chtype, ACS_LEN); @@ -48,17 +52,35 @@ _nc_acs_map(void) } #undef MyBuffer #else -NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = +NCURSES_EXPORT_VAR (chtype) acs_map[ACS_LEN] = { 0 }; #endif +#ifdef USE_TERM_DRIVER +NCURSES_EXPORT(chtype) +NCURSES_SP_NAME(_nc_acs_char) (NCURSES_SP_DCLx int c) +{ + chtype *map; + if (c < 0 || c >= ACS_LEN) + return (chtype) 0; + map = (SP_PARM != 0) ? SP_PARM->_acs_map : +#if BROKEN_LINKER || USE_REENTRANT + _nc_prescreen.real_acs_map +#else + acs_map +#endif + ; + return map[c]; +} +#endif /* USE_TERM_DRIVER */ + NCURSES_EXPORT(void) -_nc_init_acs(void) +NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) { chtype *fake_map = acs_map; - chtype *real_map = SP != 0 ? SP->_acs_map : fake_map; + chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map; int j; T(("initializing ACS map")); @@ -71,9 +93,9 @@ _nc_init_acs(void) if (real_map != fake_map) { for (j = 1; j < ACS_LEN; ++j) { real_map[j] = 0; - fake_map[j] = A_ALTCHARSET | j; - if (SP) - SP->_screen_acs_map[j] = FALSE; + fake_map[j] = A_ALTCHARSET | (chtype) j; + if (SP_PARM) + SP_PARM->_screen_acs_map[j] = FALSE; } } else { for (j = 1; j < ACS_LEN; ++j) { @@ -118,7 +140,34 @@ _nc_init_acs(void) real_map['{'] = '*'; /* should be greek pi */ real_map['|'] = '!'; /* should be not-equal */ real_map['}'] = 'f'; /* should be pound-sterling symbol */ + /* thick-line-drawing */ + real_map['L'] = '+'; /* upper left corner */ + real_map['M'] = '+'; /* lower left corner */ + real_map['K'] = '+'; /* upper right corner */ + real_map['J'] = '+'; /* lower right corner */ + real_map['T'] = '+'; /* tee pointing left */ + real_map['U'] = '+'; /* tee pointing right */ + real_map['V'] = '+'; /* tee pointing up */ + real_map['W'] = '+'; /* tee pointing down */ + real_map['Q'] = '-'; /* horizontal line */ + real_map['X'] = '|'; /* vertical line */ + real_map['N'] = '+'; /* large plus or crossover */ + /* double-line-drawing */ + real_map['C'] = '+'; /* upper left corner */ + real_map['D'] = '+'; /* lower left corner */ + real_map['B'] = '+'; /* upper right corner */ + real_map['A'] = '+'; /* lower right corner */ + real_map['G'] = '+'; /* tee pointing left */ + real_map['F'] = '+'; /* tee pointing right */ + real_map['H'] = '+'; /* tee pointing up */ + real_map['I'] = '+'; /* tee pointing down */ + real_map['R'] = '-'; /* horizontal line */ + real_map['Y'] = '|'; /* vertical line */ + real_map['E'] = '+'; /* large plus or crossover */ +#ifdef USE_TERM_DRIVER + CallDriver_2(SP_PARM, initacs, real_map, fake_map); +#else if (ena_acs != NULL) { TPUTS_TRACE("ena_acs"); putp(ena_acs); @@ -140,7 +189,7 @@ _nc_init_acs(void) size_t i; for (i = 1; i < ACS_LEN; ++i) { if (real_map[i] == 0) { - real_map[i] = i; + real_map[i] = (chtype) i; if (real_map != fake_map) { if (SP != 0) SP->_screen_acs_map[i] = TRUE; @@ -191,4 +240,13 @@ _nc_init_acs(void) _nc_unlock_global(tracef); } #endif /* TRACE */ +#endif } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_init_acs(void) +{ + NCURSES_SP_NAME(_nc_init_acs) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_baudrate.c b/ncurses/tinfo/lib_baudrate.c index b9cdfda9acc..9302f022b89 100644 --- a/ncurses/tinfo/lib_baudrate.c +++ b/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -38,7 +38,6 @@ */ #include -#include /* cur_term, pad_char */ #include /* ospeed */ #if defined(__FreeBSD__) #include @@ -80,7 +79,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.27 2008/06/28 15:19:24 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.31 2010/12/19 01:50:50 tom Exp $") /* * int @@ -195,11 +194,11 @@ _nc_ospeed(int BaudRate) } NCURSES_EXPORT(int) -baudrate(void) +NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) { int result; - T((T_CALLED("baudrate()"))); + T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); /* * In debugging, allow the environment symbol to override when we're @@ -207,32 +206,41 @@ baudrate(void) * that take into account costs that depend on baudrate. */ #ifdef TRACE - if (!isatty(fileno(SP ? SP->_ofp : stdout)) + if (IsValidTIScreen(SP_PARM) + && !isatty(fileno(SP_PARM ? SP_PARM->_ofp : stdout)) && getenv("BAUDRATE") != 0) { int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; - ospeed = _nc_ospeed(ret); + ospeed = (NCURSES_OSPEED) _nc_ospeed(ret); returnCode(ret); } #endif - if (cur_term != 0) { + if (IsValidTIScreen(SP_PARM)) { #ifdef USE_OLD_TTY - result = cfgetospeed(&cur_term->Nttyb); + result = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); ospeed = _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS - ospeed = cfgetospeed(&cur_term->Nttyb); + ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); #else - ospeed = cur_term->Nttyb.sg_ospeed; + ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif - cur_term->_baudrate = result; + TerminalOf(SP_PARM)->_baudrate = result; } else { result = ERR; } returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +baudrate(void) +{ + return NCURSES_SP_NAME(baudrate) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_cur_term.c b/ncurses/tinfo/lib_cur_term.c index 626578d5c08..86e130e7852 100644 --- a/ncurses/tinfo/lib_cur_term.c +++ b/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -37,69 +37,141 @@ */ #include -#include /* TTY, cur_term */ #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.18 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.30 2010/12/19 01:38:45 tom Exp $") #undef CUR #define CUR termp->type. -#if BROKEN_LINKER || USE_REENTRANT +#if BROKEN_LINKER && !USE_REENTRANT +NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; +#elif BROKEN_LINKER || USE_REENTRANT + +NCURSES_EXPORT(TERMINAL *) +NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_DCL0) +{ + return ((0 != TerminalOf(SP_PARM)) ? TerminalOf(SP_PARM) : CurTerm); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(TERMINAL *) +_nc_get_cur_term(void) +{ + return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(TERMINAL *) NCURSES_PUBLIC_VAR(cur_term) (void) { - return (SP != 0 && SP->_term != 0) ? SP->_term : _nc_prescreen._cur_term; +#if NCURSES_SP_FUNCS + return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); +#else + return NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG); +#endif } + #else NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; #endif NCURSES_EXPORT(TERMINAL *) -set_curterm(TERMINAL * termp) +NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) { TERMINAL *oldterm; - T((T_CALLED("set_curterm(%p)"), termp)); + T((T_CALLED("set_curterm(%p)"), (void *) termp)); _nc_lock_global(curses); oldterm = cur_term; - if (SP) - SP->_term = termp; -#if BROKEN_LINKER || USE_REENTRANT - _nc_prescreen._cur_term = termp; -#else + if (SP_PARM) + SP_PARM->_term = termp; +#if BROKEN_LINKER && !USE_REENTRANT cur_term = termp; +#else + CurTerm = termp; #endif if (termp != 0) { - ospeed = _nc_ospeed(termp->_baudrate); +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); + if (TCB->drv->isTerminfo && termp->type.Strings) { + PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); + } + TCB->csp = SP_PARM; +#else + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } +#endif } _nc_unlock_global(curses); - T((T_RETURN("%p"), oldterm)); + T((T_RETURN("%p"), (void *) oldterm)); return (oldterm); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(TERMINAL *) +set_curterm(TERMINAL * termp) +{ + return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) +{ + int rc = ERR; + + T((T_CALLED("del_curterm(%p, %p)"), (void *) SP_PARM, (void *) termp)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; +#endif + TERMINAL *cur = ( +#if BROKEN_LINKER && !USE_REENTRANT + cur_term +#elif BROKEN_LINKER || USE_REENTRANT + NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG) +#else + cur_term +#endif + ); + + _nc_free_termtype(&(termp->type)); + if (termp == cur) + NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0); + + FreeIfNeeded(termp->_termname); +#if USE_HOME_TERMINFO + if (_nc_globals.home_terminfo != 0) + FreeAndNull(_nc_globals.home_terminfo); +#endif +#ifdef USE_TERM_DRIVER + if (TCB->drv) + TCB->drv->release(TCB); +#endif + free(termp); + + rc = OK; + } + returnCode(rc); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) del_curterm(TERMINAL * termp) { int rc = ERR; - T((T_CALLED("del_curterm(%p)"), termp)); - _nc_lock_global(curses); - if (termp != 0) { - _nc_free_termtype(&(termp->type)); - FreeIfNeeded(termp->_termname); - free(termp); - if (termp == cur_term) - set_curterm(0); - rc = OK; - } + rc = NCURSES_SP_NAME(del_curterm) (CURRENT_SCREEN, termp); _nc_unlock_global(curses); - returnCode(rc); + return (rc); } +#endif diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index e84209d4022..195ddf978ab 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -41,7 +42,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.61 2010/05/15 22:06:56 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -51,17 +52,17 @@ MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(stdscr) (void) { - return SP ? SP->_stdscr : 0; + return CURRENT_SCREEN ? StdScreen(CURRENT_SCREEN) : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(curscr) (void) { - return SP ? SP->_curscr : 0; + return CURRENT_SCREEN ? CurScreen(CURRENT_SCREEN) : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(newscr) (void) { - return SP ? SP->_newscr : 0; + return CURRENT_SCREEN ? NewScreen(CURRENT_SCREEN) : 0; } #else NCURSES_EXPORT_VAR(WINDOW *) stdscr = 0; @@ -93,7 +94,7 @@ _nc_screen(void) NCURSES_EXPORT(int) _nc_alloc_screen(void) { - return ((my_screen = typeCalloc(SCREEN, 1)) != 0); + return ((my_screen = _nc_alloc_screen_sp()) != 0); } NCURSES_EXPORT(void) @@ -103,6 +104,7 @@ _nc_set_screen(SCREEN *sp) } #else + NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ #endif /* *INDENT-OFF* */ @@ -140,7 +142,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* tgetent_index */ 0, /* tgetent_sequence */ +#ifndef USE_SP_WINDOWLIST 0, /* _nc_windowlist */ +#endif #if USE_HOME_TERMINFO NULL, /* home_terminfo */ @@ -151,6 +155,10 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* safeprint_rows */ #endif +#ifdef USE_TERM_DRIVER + 0, /* term_driver */ +#endif + #ifdef TRACE FALSE, /* init_trace */ CHARS_0s, /* trace_fname */ @@ -174,7 +182,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { { CHARS_0s, CHARS_0s }, /* traceatr_color_buf */ 0, /* traceatr_color_sel */ -1, /* traceatr_color_last */ - +#if !defined(USE_PTHREADS) && USE_REENTRANT + 0, /* nested_tracef */ +#endif #endif /* TRACE */ #ifdef USE_PTHREADS PTHREAD_MUTEX_INITIALIZER, /* mutex_curses */ @@ -183,6 +193,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* nested_tracef */ 0, /* use_pthreads */ #endif +#if USE_PTHREADS_EINTR + 0, /* read_thread */ +#endif }; #define STACK_FRAME_0 { { 0 }, 0 } @@ -196,8 +209,10 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { TRUE, /* use_env */ FALSE, /* filter_mode */ A_NORMAL, /* previous_attr */ +#ifndef USE_SP_RIPOFF RIPOFF_0s, /* ripoff */ NULL, /* rsp */ +#endif { /* tparm_state */ #ifdef TRACE NULL, /* tname */ @@ -221,10 +236,13 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { #if NCURSES_NO_PADDING FALSE, /* flag to set if padding disabled */ #endif + 0, /* _outch */ #if BROKEN_LINKER || USE_REENTRANT NULL, /* real_acs_map */ 0, /* LINES */ 0, /* COLS */ + 8, /* TABSIZE */ + 1000, /* ESCDELAY */ 0, /* cur_term */ #ifdef TRACE 0L, /* _outchars */ @@ -234,6 +252,22 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { }; /* *INDENT-ON* */ +/* + * wgetch() and other functions with a WINDOW* parameter may use a SCREEN* + * internally, and it is useful to allow those to be invoked without switching + * SCREEN's, e.g., for multi-threaded applications. + */ +NCURSES_EXPORT(SCREEN *) +_nc_screen_of(WINDOW *win) +{ + SCREEN *sp = 0; + + if (win != 0) { + sp = WINDOW_EXT(win, screen); + } + return (sp); +} + /******************************************************************************/ #ifdef USE_PTHREADS static void @@ -314,7 +348,9 @@ _nc_mutex_unlock(pthread_mutex_t * obj) return 0; return pthread_mutex_unlock(obj); } +#endif /* USE_PTHREADS */ +#if defined(USE_PTHREADS) || USE_PTHREADS_EINTR #if USE_WEAK_SYMBOLS /* * NB: sigprocmask(2) is global but pthread_sigmask(3p) diff --git a/ncurses/tinfo/lib_has_cap.c b/ncurses/tinfo/lib_has_cap.c index 0dc66bd9b91..d1b9b8d966d 100644 --- a/ncurses/tinfo/lib_has_cap.c +++ b/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-2003 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,25 +42,53 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_has_cap.c,v 1.4 2003/10/25 19:43:55 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.9 2009/10/24 22:15:47 tom Exp $") +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + + T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); + + if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { + code = ((insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)) ? TRUE : FALSE; + } + + returnCode(code); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_ic(void) { - T((T_CALLED("has_ic()"))); - returnCode(cur_term && - (insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); + return NCURSES_SP_NAME(has_ic) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); + if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { + code = ((insert_line || parm_insert_line) + && (delete_line || parm_delete_line)) ? TRUE : FALSE; + } + + returnCode(code); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_il(void) { - T((T_CALLED("has_il()"))); - returnCode(cur_term - && (insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); + return NCURSES_SP_NAME(has_il) (CURRENT_SCREEN); } +#endif diff --git a/ncurses/tinfo/lib_kernel.c b/ncurses/tinfo/lib_kernel.c index 89dc1e80ea8..37f70842907 100644 --- a/ncurses/tinfo/lib_kernel.c +++ b/ncurses/tinfo/lib_kernel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 2002 * + * and: Thomas E. Dickey 2002 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -46,9 +47,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_kernel.c,v 1.24 2004/05/08 17:11:21 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.31 2010/12/19 01:21:19 tom Exp $") static int _nc_vdisable(void) @@ -59,7 +59,7 @@ _nc_vdisable(void) #endif #if defined(_PC_VDISABLE) if (value == -1) { - value = fpathconf(0, _PC_VDISABLE); + value = (int) fpathconf(0, _PC_VDISABLE); if (value == -1) { value = 0377; } @@ -79,23 +79,33 @@ _nc_vdisable(void) */ NCURSES_EXPORT(char) -erasechar(void) +NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) { int result = ERR; - T((T_CALLED("erasechar()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("erasechar(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - result = cur_term->Ottyb.c_cc[VERASE]; + result = termp->Ottyb.c_cc[VERASE]; if (result == _nc_vdisable()) result = ERR; #else - result = cur_term->Ottyb.sg_erase; + result = termp->Ottyb.sg_erase; #endif } - returnCode(result); + returnChar((char) result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char) +erasechar(void) +{ + return NCURSES_SP_NAME(erasechar) (CURRENT_SCREEN); +} +#endif + /* * killchar() * @@ -104,23 +114,33 @@ erasechar(void) */ NCURSES_EXPORT(char) -killchar(void) +NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) { int result = ERR; - T((T_CALLED("killchar()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("killchar(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - result = cur_term->Ottyb.c_cc[VKILL]; + result = termp->Ottyb.c_cc[VKILL]; if (result == _nc_vdisable()) result = ERR; #else - result = cur_term->Ottyb.sg_kill; + result = termp->Ottyb.sg_kill; #endif } - returnCode(result); + returnChar((char) result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char) +killchar(void) +{ + return NCURSES_SP_NAME(killchar) (CURRENT_SCREEN); +} +#endif + /* * flushinp() * @@ -129,26 +149,36 @@ killchar(void) */ NCURSES_EXPORT(int) -flushinp(void) +NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0) { - T((T_CALLED("flushinp()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("flushinp(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - tcflush(cur_term->Filedes, TCIFLUSH); + tcflush(termp->Filedes, TCIFLUSH); #else errno = 0; do { - ioctl(cur_term->Filedes, TIOCFLUSH, 0); + ioctl(termp->Filedes, TIOCFLUSH, 0); } while (errno == EINTR); #endif - if (SP) { - SP->_fifohead = -1; - SP->_fifotail = 0; - SP->_fifopeek = 0; + if (SP_PARM) { + SP_PARM->_fifohead = -1; + SP_PARM->_fifotail = 0; + SP_PARM->_fifopeek = 0; } returnCode(OK); } returnCode(ERR); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +flushinp(void) +{ + return NCURSES_SP_NAME(flushinp) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_longname.c b/ncurses/tinfo/lib_longname.c index 1301ee51694..14903175b32 100644 --- a/ncurses/tinfo/lib_longname.c +++ b/ncurses/tinfo/lib_longname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -40,8 +42,38 @@ #include -MODULE_ID("$Id: lib_longname.c,v 1.9 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $") +#if USE_REENTRANT +NCURSES_EXPORT(char *) +NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0) +{ + static char empty[] = + {'\0'}; + char *ptr; + + T((T_CALLED("longname(%p)"), (void *) SP_PARM)); + + if (SP_PARM) { + for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype); + ptr > SP_PARM->_ttytype; + ptr--) + if (*ptr == '|') + returnPtr(ptr + 1); + returnPtr(SP_PARM->_ttytype); + } + return empty; +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +longname(void) +{ + return NCURSES_SP_NAME(longname) (CURRENT_SCREEN); +} +#endif + +#else NCURSES_EXPORT(char *) longname(void) { @@ -49,9 +81,11 @@ longname(void) T((T_CALLED("longname()"))); - for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) + for (ptr = ttytype + strlen(ttytype); + ptr > ttytype; + ptr--) if (*ptr == '|') returnPtr(ptr + 1); - returnPtr(ttytype); } +#endif diff --git a/ncurses/tinfo/lib_napms.c b/ncurses/tinfo/lib_napms.c index 417b3b4b4db..1e6abda10d0 100644 --- a/ncurses/tinfo/lib_napms.c +++ b/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -49,13 +51,17 @@ #endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.17 2008/05/03 21:34:13 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.20 2009/11/07 20:37:30 tom Exp $") NCURSES_EXPORT(int) -napms(int ms) +NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) { + (void) SP_PARM; T((T_CALLED("napms(%d)"), ms)); +#ifdef USE_TERM_DRIVER + CallDriver_1(SP_PARM, nap, ms); +#else /* !USE_TERM_DRIVER */ #if HAVE_NANOSLEEP { struct timespec request, remaining; @@ -69,6 +75,15 @@ napms(int ms) #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif +#endif /* !USE_TERM_DRIVER */ returnCode(OK); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +napms(int ms) +{ + return NCURSES_SP_NAME(napms) (CURRENT_SCREEN, ms); +} +#endif diff --git a/ncurses/tinfo/lib_options.c b/ncurses/tinfo/lib_options.c index f3b1485bf11..654bf940aa1 100644 --- a/ncurses/tinfo/lib_options.c +++ b/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,53 +42,67 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_options.c,v 1.58 2008/08/16 21:20:48 Werner.Fink Exp $") - -static int _nc_curs_set(SCREEN *, int); -static int _nc_meta(SCREEN *, bool); +MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { - T((T_CALLED("idlok(%p,%d)"), win, flag)); + int res = ERR; + T((T_CALLED("idlok(%p,%d)"), (void *) win, flag)); if (win) { - _nc_idlok = win->_idlok = (flag && (has_il() || change_scroll_region)); - returnCode(OK); - } else - returnCode(ERR); + SCREEN *sp = _nc_screen_of(win); + if (sp && IsTermInfo(sp)) { + sp->_nc_sp_idlok = + win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG) + || change_scroll_region)); + res = OK; + } + } + returnCode(res); } NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { - T((T_CALLED("idcok(%p,%d)"), win, flag)); - - if (win) - _nc_idcok = win->_idcok = (flag && has_ic()); + T((T_CALLED("idcok(%p,%d)"), (void *) win, flag)); + if (win) { + SCREEN *sp = _nc_screen_of(win); + sp->_nc_sp_idcok = win->_idcok = (flag && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)); + } returnVoid; } NCURSES_EXPORT(int) -halfdelay(int t) +NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { - T((T_CALLED("halfdelay(%d)"), t)); + T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); - if (t < 1 || t > 255 || SP == 0) + if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) returnCode(ERR); - cbreak(); - SP->_cbreak = t + 1; + NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); + SP_PARM->_cbreak = t + 1; returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +halfdelay(int t) +{ + return NCURSES_SP_NAME(halfdelay) (CURRENT_SCREEN, t); +} +#endif + NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { - T((T_CALLED("nodelay(%p,%d)"), win, flag)); + T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag)); if (win) { if (flag == TRUE) @@ -102,7 +117,7 @@ nodelay(WINDOW *win, bool flag) NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { - T((T_CALLED("notimeout(%p,%d)"), win, f)); + T((T_CALLED("notimeout(%p,%d)"), (void *) win, f)); if (win) { win->_notimeout = f; @@ -114,7 +129,7 @@ notimeout(WINDOW *win, bool f) NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { - T((T_CALLED("wtimeout(%p,%d)"), win, delay)); + T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay)); if (win) { win->_delay = delay; @@ -125,11 +140,11 @@ wtimeout(WINDOW *win, int delay) NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { - T((T_CALLED("keypad(%p,%d)"), win, flag)); + T((T_CALLED("keypad(%p,%d)"), (void *) win, flag)); if (win) { win->_use_keypad = flag; - returnCode(_nc_keypad(SP, flag)); + returnCode(_nc_keypad(_nc_screen_of(win), flag)); } else returnCode(ERR); } @@ -137,38 +152,106 @@ keypad(WINDOW *win, bool flag) NCURSES_EXPORT(int) meta(WINDOW *win GCC_UNUSED, bool flag) { - int result; + int result = ERR; + SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win); /* Ok, we stay relaxed and don't signal an error if win is NULL */ - T((T_CALLED("meta(%p,%d)"), win, flag)); - result = _nc_meta(SP, flag); + T((T_CALLED("meta(%p,%d)"), (void *) win, flag)); + + /* Ok, we stay relaxed and don't signal an error if win is NULL */ + + if (sp != 0) { + sp->_use_meta = flag; +#ifdef USE_TERM_DRIVER + if (IsTermInfo(sp)) { + if (flag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + } + } +#else + if (flag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + } +#endif + result = OK; + } returnCode(result); } /* curs_set() moved here to narrow the kernel interface */ NCURSES_EXPORT(int) -curs_set(int vis) +NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) { - int result; + int code = ERR; + T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis)); - T((T_CALLED("curs_set(%d)"), vis)); - result = _nc_curs_set(SP, vis); - returnCode(result); + if (SP_PARM != 0 && vis >= 0 && vis <= 2) { + int cursor = SP_PARM->_cursor; + bool bBuiltIn = !IsTermInfo(SP_PARM); + if (vis == cursor) { + code = cursor; + } else { + if (!bBuiltIn) { + switch (vis) { + case 2: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_visible", + cursor_visible); + break; + case 1: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_normal", + cursor_normal); + break; + case 0: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_invisible", + cursor_invisible); + break; + } + } else + code = ERR; + if (code != ERR) + code = (cursor == -1 ? 1 : cursor); + SP_PARM->_cursor = vis; + } + } + returnCode(code); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -typeahead(int fd) +curs_set(int vis) { - T((T_CALLED("typeahead(%d)"), fd)); - if (SP != 0) { - SP->_checkfd = fd; + return (NCURSES_SP_NAME(curs_set) (CURRENT_SCREEN, vis)); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) +{ + T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); + if (IsValidTIScreen(SP_PARM)) { + SP_PARM->_checkfd = fd; returnCode(OK); } else { returnCode(ERR); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +typeahead(int fd) +{ + return NCURSES_SP_NAME(typeahead) (CURRENT_SCREEN, fd); +} +#endif + /* ** has_key() ** @@ -189,43 +272,50 @@ has_key_internal(int keycode, TRIES * tp) || has_key_internal(keycode, tp->sibling)); } +#ifdef USE_TERM_DRIVER +NCURSES_EXPORT(int) +TINFO_HAS_KEY(SCREEN *sp, int keycode) +{ + return IsValidTIScreen(sp) ? + has_key_internal(keycode, sp->_keytry) : 0; +} +#else +NCURSES_EXPORT(int) +NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode) +{ + T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode)); + returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) has_key(int keycode) { - T((T_CALLED("has_key(%d)"), keycode)); - returnCode(SP != 0 ? has_key_internal(keycode, SP->_keytry) : FALSE); + return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode); } +#endif +#endif #endif /* NCURSES_EXT_FUNCS */ -/* - * Internal entrypoints use SCREEN* parameter to obtain capabilities rather - * than cur_term. - */ -#undef CUR -#define CUR (sp->_term)->type. - -static int -_nc_putp(const char *name GCC_UNUSED, const char *value) +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx + const char *name, const char *value) { - int rc = ERR; - - if (value) { - TPUTS_TRACE(name); - rc = putp(value); - } - return rc; -} - -static int -_nc_putp_flush(const char *name, const char *value) -{ - int rc = _nc_putp(name, value); + int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); if (rc != ERR) { _nc_flush(); } return rc; } +#if 0 && NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_putp_flush(const char *name, const char *value) +{ + return NCURSES_SP_NAME(_nc_putp_flush) (CURRENT_SCREEN, name, value); +} +#endif + /* Turn the keypad on/off * * Note: we flush the output because changing this mode causes some terminals @@ -245,12 +335,12 @@ _nc_keypad(SCREEN *sp, bool flag) * has wgetch() reading in more than one thread. putp() and below * may use SP explicitly. */ - if (_nc_use_pthreads && sp != SP) { + if (_nc_use_pthreads && sp != CURRENT_SCREEN) { SCREEN *save_sp; /* cannot use use_screen(), since that is not in tinfo library */ _nc_lock_global(curses); - save_sp = SP; + save_sp = CURRENT_SCREEN; _nc_set_screen(sp); rc = _nc_keypad(sp, flag); _nc_set_screen(save_sp); @@ -258,10 +348,19 @@ _nc_keypad(SCREEN *sp, bool flag) } else #endif { +#ifdef USE_TERM_DRIVER + rc = CallDriver_1(sp, kpad, flag); + if (rc == OK) + sp->_keypad_on = flag; +#else if (flag) { - (void) _nc_putp_flush("keypad_xmit", keypad_xmit); + (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "keypad_xmit", + keypad_xmit); } else if (!flag && keypad_local) { - (void) _nc_putp_flush("keypad_local", keypad_local); + (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "keypad_local", + keypad_local); } if (flag && !sp->_tried) { @@ -270,58 +369,8 @@ _nc_keypad(SCREEN *sp, bool flag) } sp->_keypad_on = flag; rc = OK; +#endif } } return (rc); } - -static int -_nc_curs_set(SCREEN *sp, int vis) -{ - int result = ERR; - - T((T_CALLED("curs_set(%d)"), vis)); - if (sp != 0 && vis >= 0 && vis <= 2) { - int cursor = sp->_cursor; - - if (vis == cursor) { - result = cursor; - } else { - switch (vis) { - case 2: - result = _nc_putp_flush("cursor_visible", cursor_visible); - break; - case 1: - result = _nc_putp_flush("cursor_normal", cursor_normal); - break; - case 0: - result = _nc_putp_flush("cursor_invisible", cursor_invisible); - break; - } - if (result != ERR) - result = (cursor == -1 ? 1 : cursor); - sp->_cursor = vis; - } - } - returnCode(result); -} - -static int -_nc_meta(SCREEN *sp, bool flag) -{ - int result = ERR; - - /* Ok, we stay relaxed and don't signal an error if win is NULL */ - - if (SP != 0) { - SP->_use_meta = flag; - - if (flag) { - _nc_putp("meta_on", meta_on); - } else { - _nc_putp("meta_off", meta_off); - } - result = OK; - } - return result; -} diff --git a/ncurses/tinfo/lib_print.c b/ncurses/tinfo/lib_print.c index 975b46d8577..c7bd3a62fa8 100644 --- a/ncurses/tinfo/lib_print.c +++ b/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,23 +29,31 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_print.c,v 1.16 2006/11/26 00:26:34 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $") NCURSES_EXPORT(int) -mcprint(char *data, int len) +NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ { + int result; char *mybuf, *switchon; - size_t onsize, offsize, res; + size_t onsize, offsize; + size_t need; errno = 0; - if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { + if (!HasTInfoTerminal(SP_PARM) + || len <= 0 + || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; return (ERR); } @@ -60,8 +68,10 @@ mcprint(char *data, int len) offsize = strlen(prtr_off); } + need = onsize + (size_t) len + offsize; + if (switchon == 0 - || (mybuf = typeMalloc(char, onsize + len + offsize + 1)) == 0) { + || (mybuf = typeMalloc(char, need + 1)) == 0) { errno = ENOMEM; return (ERR); } @@ -78,15 +88,24 @@ mcprint(char *data, int len) * data has actually been shipped to the terminal. If the write(2) * operation is truly atomic we're protected from this. */ - res = write(cur_term->Filedes, mybuf, onsize + len + offsize); + result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need); /* * By giving up our scheduler slot here we increase the odds that the * kernel will ship the contiguous clist items from the last write * immediately. */ +#ifndef __MINGW32__ (void) sleep(0); - +#endif free(mybuf); - return (res); + return (result); } + +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +mcprint(char *data, int len) +{ + return NCURSES_SP_NAME(mcprint) (CURRENT_SCREEN, data, len); +} +#endif diff --git a/ncurses/tinfo/lib_raw.c b/ncurses/tinfo/lib_raw.c index 58e71889af1..b524a1bb55b 100644 --- a/ncurses/tinfo/lib_raw.c +++ b/ncurses/tinfo/lib_raw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1998 on * + * and: Thomas E. Dickey 1998-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -47,9 +48,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -61,7 +61,7 @@ MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #ifdef __EMX__ #include -#define _nc_setmode(mode) setmode(SP->_ifd, mode) +#define _nc_setmode(mode) setmode(SP_PARM->_ifd, mode) #else #define _nc_setmode(mode) /* nothing */ #endif @@ -77,188 +77,235 @@ MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #endif /* TRACE */ NCURSES_EXPORT(int) -raw(void) +NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("raw()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("raw(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("raw"); _nc_setmode(O_BINARY); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~(ICANON | ISIG | IEXTEN); - buf.c_iflag &= ~(COOKED_INPUT); + buf.c_lflag &= (unsigned) ~(ICANON | ISIG | IEXTEN); + buf.c_iflag &= (unsigned) ~(COOKED_INPUT); buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= RAW; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_raw = TRUE; - SP->_cbreak = 1; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_raw = TRUE; + SP_PARM->_cbreak = 1; + termp->Nttyb = buf; } AFTER("raw"); } returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -cbreak(void) +raw(void) +{ + return NCURSES_SP_NAME(raw) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("cbreak()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("cbreak(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("cbreak"); _nc_setmode(O_BINARY); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~ICANON; - buf.c_iflag &= ~ICRNL; + buf.c_lflag &= (unsigned) ~ICANON; + buf.c_iflag &= (unsigned) ~ICRNL; buf.c_lflag |= ISIG; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= CBREAK; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_cbreak = 1; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_cbreak = 1; + termp->Nttyb = buf; } AFTER("cbreak"); } returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +cbreak(void) +{ + return NCURSES_SP_NAME(cbreak) (CURRENT_SCREEN); +} +#endif + /* * Note: * this implementation may be wrong. See the comment under intrflush(). */ NCURSES_EXPORT(void) -qiflush(void) +NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("qiflush()"))); - - if (cur_term != 0) { + T((T_CALLED("qiflush(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("qiflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~(NOFLSH); - result = _nc_set_tty_mode(&buf); + buf.c_lflag &= (unsigned) ~(NOFLSH); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif if (result == OK) - cur_term->Nttyb = buf; + termp->Nttyb = buf; AFTER("qiflush"); } returnVoid; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +qiflush(void) +{ + NCURSES_SP_NAME(qiflush) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(int) -noraw(void) +NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("noraw()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("noraw(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("noraw"); _nc_setmode(O_TEXT); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= ISIG | ICANON | - (cur_term->Ottyb.c_lflag & IEXTEN); + (termp->Ottyb.c_lflag & IEXTEN); buf.c_iflag |= COOKED_INPUT; #else buf.sg_flags &= ~(RAW | CBREAK); #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_raw = FALSE; - SP->_cbreak = 0; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_raw = FALSE; + SP_PARM->_cbreak = 0; + termp->Nttyb = buf; } AFTER("noraw"); } returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -nocbreak(void) +noraw(void) +{ + return NCURSES_SP_NAME(noraw) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("nocbreak()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("nocbreak(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("nocbreak"); _nc_setmode(O_TEXT); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= ICANON; buf.c_iflag |= ICRNL; #else buf.sg_flags &= ~CBREAK; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_cbreak = 0; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_cbreak = 0; + termp->Nttyb = buf; } AFTER("nocbreak"); } returnCode(result); } -/* - * Note: - * this implementation may be wrong. See the comment under intrflush(). - */ +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +nocbreak(void) +{ + return NCURSES_SP_NAME(nocbreak) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(void) -noqiflush(void) +NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("noqiflush()"))); - - if (cur_term != 0) { + T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("noqiflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= NOFLSH; - result = _nc_set_tty_mode(&buf); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif - if (result == OK) { - cur_term->Nttyb = buf; - } + if (result == OK) + termp->Nttyb = buf; AFTER("noqiflush"); } returnVoid; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +noqiflush(void) +{ + NCURSES_SP_NAME(noqiflush) (CURRENT_SCREEN); +} +#endif + /* * This call does the same thing as the qiflush()/noqiflush() pair. We know * for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the other hand, @@ -267,30 +314,41 @@ noqiflush(void) * curs_inopts(3x) is too exact to be coincidence. */ NCURSES_EXPORT(int) -intrflush(WINDOW *win GCC_UNUSED, bool flag) +NCURSES_SP_NAME(intrflush) (NCURSES_SP_DCLx WINDOW *win GCC_UNUSED, bool flag) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("intrflush(%d)"), flag)); + T((T_CALLED("intrflush(%p,%d)"), (void *) SP_PARM, flag)); + if (SP_PARM == 0) + returnCode(ERR); - if (cur_term != 0) { + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("intrflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS if (flag) - buf.c_lflag &= ~(NOFLSH); + buf.c_lflag &= (unsigned) ~(NOFLSH); else buf.c_lflag |= (NOFLSH); - result = _nc_set_tty_mode(&buf); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif if (result == OK) { - cur_term->Nttyb = buf; + termp->Nttyb = buf; } AFTER("intrflush"); } returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +intrflush(WINDOW *win GCC_UNUSED, bool flag) +{ + return NCURSES_SP_NAME(intrflush) (CURRENT_SCREEN, win, flag); +} +#endif diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 8cfaf12c534..5fcf2ae3fc3 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,7 +42,6 @@ #include #include /* for MAX_NAME_SIZE */ -#include #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -51,9 +51,7 @@ #include #endif -#include /* lines, columns, cur_term */ - -MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.135 2011/02/06 01:04:21 tom Exp $") /**************************************************************************** * @@ -109,61 +107,96 @@ MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") * Wrap global variables in this module. */ #if USE_REENTRANT + NCURSES_EXPORT(char *) NCURSES_PUBLIC_VAR(ttytype) (void) { static char empty[] = ""; - return cur_term ? cur_term->type.term_names : empty; + char *result = empty; + +#if NCURSES_SP_FUNCS + if (CURRENT_SCREEN) { + TERMINAL *termp = TerminalOf(CURRENT_SCREEN); + if (termp != 0) { + result = termp->type.term_names; + } + } +#else + if (cur_term != 0) { + result = cur_term->type.term_names; + } +#endif + return result; } + NCURSES_EXPORT(int *) -_nc_ptr_Lines(void) +_nc_ptr_Lines(SCREEN *sp) { - return ptrLines(); + return ptrLines(sp); } + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(LINES) (void) { - return *_nc_ptr_Lines(); + return *_nc_ptr_Lines(CURRENT_SCREEN); } + NCURSES_EXPORT(int *) -_nc_ptr_Cols(void) +_nc_ptr_Cols(SCREEN *sp) { - return ptrCols(); + return ptrCols(sp); } + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(COLS) (void) { - return *_nc_ptr_Cols(); + return *_nc_ptr_Cols(CURRENT_SCREEN); } + +NCURSES_EXPORT(int *) +_nc_ptr_Tabsize(SCREEN *sp) +{ + return ptrTabsize(sp); +} + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(TABSIZE) (void) { - return SP ? SP->_TABSIZE : 8; + return *_nc_ptr_Tabsize(CURRENT_SCREEN); } #else NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; NCURSES_EXPORT_VAR(int) LINES = 0; NCURSES_EXPORT_VAR(int) COLS = 0; -NCURSES_EXPORT_VAR(int) TABSIZE = 0; +NCURSES_EXPORT_VAR(int) TABSIZE = 8; #endif #if NCURSES_EXT_FUNCS NCURSES_EXPORT(int) -set_tabsize(int value) +NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value) { int code = OK; #if USE_REENTRANT - if (SP) { - SP->_TABSIZE = value; + if (SP_PARM) { + SP_PARM->_TABSIZE = value; } else { code = ERR; } #else + (void) SP_PARM; TABSIZE = value; #endif return code; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +set_tabsize(int value) +{ + return NCURSES_SP_NAME(set_tabsize) (CURRENT_SCREEN, value); +} #endif +#endif /* NCURSES_EXT_FUNCS */ #if USE_SIGWINCH /* @@ -188,42 +221,71 @@ _nc_handle_sigwinch(SCREEN *sp) #endif NCURSES_EXPORT(void) -use_env(bool f) +NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f) { - T((T_CALLED("use_env()"))); + T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f)); +#if NCURSES_SP_FUNCS + if (IsPreScreen(SP_PARM)) { + SP_PARM->_use_env = f; + } +#else _nc_prescreen.use_env = f; +#endif returnVoid; } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_get_screensize(SCREEN *sp, int *linep, int *colp) +use_env(bool f) +{ + T((T_CALLED("use_env(%d)"), (int) f)); + _nc_prescreen.use_env = f; + returnVoid; +} +#endif + +NCURSES_EXPORT(void) +_nc_get_screensize(SCREEN *sp, +#ifdef USE_TERM_DRIVER + TERMINAL * termp, +#endif + int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ { +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB; + int my_tabsize; + + assert(termp != 0 && linep != 0 && colp != 0); + TCB = (TERMINAL_CONTROL_BLOCK *) termp; + + my_tabsize = TCB->info.tabsize; + TCB->drv->size(TCB, linep, colp); + +#if USE_REENTRANT + if (sp != 0) { + sp->_TABSIZE = my_tabsize; + } +#else + (void) sp; + TABSIZE = my_tabsize; +#endif + T(("TABSIZE = %d", my_tabsize)); +#else /* !USE_TERM_DRIVER */ TERMINAL *termp = cur_term; int my_tabsize; /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); - if (!_nc_prescreen.use_env) { - *linep = (int) lines; - *colp = (int) columns; - } else { /* usually want to query LINES and COLUMNS from environment */ + *linep = (int) lines; + *colp = (int) columns; + + if (_nc_prescreen.use_env) { int value; - *linep = *colp = 0; - - /* first, look for environment variables */ - if ((value = _nc_getenv_num("LINES")) > 0) { - *linep = value; - } - if ((value = _nc_getenv_num("COLUMNS")) > 0) { - *colp = value; - } - T(("screen size: environment LINES = %d COLUMNS = %d", *linep, *colp)); - #ifdef __EMX__ - if (*linep <= 0 || *colp <= 0) { + { int screendata[2]; _scrsize(screendata); *colp = screendata[0]; @@ -233,33 +295,41 @@ _nc_get_screensize(SCREEN *sp, int *linep, int *colp) } #endif #if HAVE_SIZECHANGE - /* if that didn't work, maybe we can try asking the OS */ - if (*linep <= 0 || *colp <= 0) { - if (isatty(cur_term->Filedes)) { - STRUCT_WINSIZE size; + /* try asking the OS */ + if (isatty(cur_term->Filedes)) { + STRUCT_WINSIZE size; - errno = 0; - do { - if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) < 0 - && errno != EINTR) - goto failure; - } while - (errno == EINTR); - - /* - * Solaris lets users override either dimension with an - * environment variable. - */ - if (*linep <= 0) - *linep = (sp != 0 && sp->_filtered) ? 1 : WINSIZE_ROWS(size); - if (*colp <= 0) + errno = 0; + do { + if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) >= 0) { + *linep = ((sp != 0 && sp->_filtered) + ? 1 + : WINSIZE_ROWS(size)); *colp = WINSIZE_COLS(size); - } - /* FALLTHRU */ - failure:; + T(("SYS screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + break; + } + } while + (errno == EINTR); } #endif /* HAVE_SIZECHANGE */ + /* + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. + */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); + } + /* if we can't get dynamic info about the size, use static */ if (*linep <= 0) { *linep = (int) lines; @@ -298,19 +368,31 @@ _nc_get_screensize(SCREEN *sp, int *linep, int *colp) TABSIZE = my_tabsize; #endif T(("TABSIZE = %d", TABSIZE)); +#endif /* USE_TERM_DRIVER */ } #if USE_SIZECHANGE NCURSES_EXPORT(void) _nc_update_screensize(SCREEN *sp) { - TERMINAL *termp = cur_term; - int old_lines = lines; int new_lines; - int old_cols = columns; int new_cols; - _nc_get_screensize(sp, &new_lines, &new_cols); +#ifdef USE_TERM_DRIVER + int old_lines; + int old_cols; + + assert(sp != 0); + + CallDriver_2(sp, getsize, &old_lines, &old_cols); + +#else + TERMINAL *termp = cur_term; + int old_lines = lines; + int old_cols = columns; +#endif + + TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols); /* * See is_term_resized() and resizeterm(). @@ -320,7 +402,7 @@ _nc_update_screensize(SCREEN *sp) if (sp != 0 && sp->_resize != 0) { if ((new_lines != old_lines) || (new_cols != old_cols)) - sp->_resize(new_lines, new_cols); + sp->_resize(NCURSES_SP_ARGx new_lines, new_cols); sp->_sig_winch = FALSE; } } @@ -353,8 +435,8 @@ _nc_update_screensize(SCREEN *sp) * Return 1 if entry found, 0 if not found, -1 if database not accessible, * just like tgetent(). */ -static int -grab_entry(const char *const tn, TERMTYPE *const tp) +int +_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) { char filename[PATH_MAX]; int status = _nc_read_entry(tn, filename, tp); @@ -381,28 +463,27 @@ grab_entry(const char *const tn, TERMTYPE *const tp) #endif /* -** do_prototype() -** ** Take the real command character out of the CC environment variable ** and substitute it in for the prototype given in 'command_character'. */ -static void -do_prototype(TERMINAL * termp) +void +_nc_tinfo_cmdch(TERMINAL * termp, char proto) { unsigned i; char CC; - char proto; char *tmp; - if ((tmp = getenv("CC")) != 0) { - if ((CC = *tmp) != 0) { - proto = *command_character; - - for_each_string(i, &(termp->type)) { - for (tmp = termp->type.Strings[i]; *tmp; tmp++) { - if (*tmp == proto) - *tmp = CC; - } + /* + * Only use the character if the string is a single character, + * since it is fairly common for developers to set the C compiler + * name as an environment variable - using the same symbol. + */ + if ((tmp = getenv("CC")) != 0 && strlen(tmp) == 1) { + CC = *tmp; + for_each_string(i, &(termp->type)) { + for (tmp = termp->type.Strings[i]; *tmp; tmp++) { + if (*tmp == proto) + *tmp = CC; } } } @@ -465,39 +546,64 @@ _nc_unicode_locale(void) NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL * termp) { + const char *env_name = "NCURSES_NO_UTF8_ACS"; char *env; + int value; + int result = 0; - if ((env = getenv("NCURSES_NO_UTF8_ACS")) != 0) { - return atoi(env); + if ((env = getenv(env_name)) != 0) { + result = _nc_getenv_num(env_name); + } else if ((value = tigetnum("U8")) >= 0) { + result = value; /* use extension feature */ } else if ((env = getenv("TERM")) != 0) { - if (strstr(env, "linux")) - return 1; /* always broken */ - if (strstr(env, "screen") != 0 - && ((env = getenv("TERMCAP")) != 0 - && strstr(env, "screen") != 0) - && strstr(env, "hhII00") != 0) { + if (strstr(env, "linux")) { + result = 1; /* always broken */ + } else if (strstr(env, "screen") != 0 + && ((env = getenv("TERMCAP")) != 0 + && strstr(env, "screen") != 0) + && strstr(env, "hhII00") != 0) { if (CONTROL_N(enter_alt_charset_mode) || CONTROL_O(enter_alt_charset_mode) || CONTROL_N(set_attributes) || - CONTROL_O(set_attributes)) - return 1; + CONTROL_O(set_attributes)) { + result = 1; + } } } - return 0; + return result; } -/* - * This entrypoint is called from tgetent() to allow a special case of reusing - * the same TERMINAL data (see comment). - */ NCURSES_EXPORT(int) -_nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) +TINFO_SETUP_TERM(TERMINAL ** tp, + NCURSES_CONST char *tname, + int Filedes, + int *errret, + bool reuse) { - TERMINAL *termp; +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = 0; +#else int status; +#endif + TERMINAL *termp; + SCREEN *sp = 0; + int code = ERR; START_TRACE(); - T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); + +#ifdef USE_TERM_DRIVER + T((T_CALLED("_nc_setupterm_ex(%p,%s,%d,%p)"), + (void *) tp, _nc_visbuf(tname), Filedes, (void *) errret)); + + if (tp == 0) { + ret_error0(TGETENT_ERR, + "Invalid parameter, internal error.\n"); + } else + termp = *tp; +#else + termp = cur_term; + T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, (void *) errret)); +#endif if (tname == 0) { tname = getenv("TERM"); @@ -538,22 +644,37 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) * properly with this feature). */ if (reuse - && (termp = cur_term) != 0 + && (termp != 0) && termp->Filedes == Filedes && termp->_termname != 0 && !strcmp(termp->_termname, tname) && _nc_name_match(termp->type.term_names, tname, "|")) { T(("reusing existing terminal information and mode-settings")); + code = OK; } else { - +#ifdef USE_TERM_DRIVER + termp = (TERMINAL *) typeCalloc(TERMINAL_CONTROL_BLOCK, 1); +#else termp = typeCalloc(TERMINAL, 1); - +#endif if (termp == 0) { ret_error0(TGETENT_ERR, "Not enough memory to create terminal structure.\n"); } +#ifdef USE_TERM_DRIVER + INIT_TERM_DRIVER(); + TCB = (TERMINAL_CONTROL_BLOCK *) termp; + code = _nc_globals.term_driver(TCB, tname, errret); + if (code == OK) { + termp->Filedes = (short) Filedes; + termp->_termname = strdup(tname); + } else { + ret_error0(TGETENT_ERR, + "Could not find any driver to handle this terminal.\n"); + } +#else #if USE_DATABASE || USE_TERMCAP - status = grab_entry(tname, &termp->type); + status = _nc_setup_tinfo(tname, &termp->type); #else status = TGETENT_NO; #endif @@ -581,13 +702,13 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) ttytype[NAMESIZE - 1] = '\0'; #endif - termp->Filedes = Filedes; + termp->Filedes = (short) Filedes; termp->_termname = strdup(tname); set_curterm(termp); - if (command_character && getenv("CC")) - do_prototype(termp); + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); /* * If an application calls setupterm() rather than initscr() or @@ -599,25 +720,95 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) def_prog_mode(); baudrate(); } + code = OK; +#endif } +#ifdef USE_TERM_DRIVER + *tp = termp; + NCURSES_SP_NAME(set_curterm) (sp, termp); + TCB->drv->init(TCB); +#else + sp = SP; +#endif + /* * We should always check the screensize, just in case. */ - _nc_get_screensize(SP, ptrLines(), ptrCols()); + TINFO_GET_SIZE(sp, termp, ptrLines(sp), ptrCols(sp)); if (errret) *errret = TGETENT_YES; +#ifndef USE_TERM_DRIVER if (generic_type) { ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); } if (hard_copy) { ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); } - returnCode(OK); +#endif + returnCode(code); } +#if NCURSES_SP_FUNCS +/* + * In case of handling multiple screens, we need to have a screen before + * initialization in setupscreen takes place. This is to extend the substitute + * for some of the stuff in _nc_prescreen, especially for slk and ripoff + * handling which should be done per screen. + */ +NCURSES_EXPORT(SCREEN *) +new_prescr(void) +{ + static SCREEN *sp; + + START_TRACE(); + T((T_CALLED("new_prescr()"))); + + if (sp == 0) { + sp = _nc_alloc_screen_sp(); + if (sp != 0) { + sp->rsp = sp->rippedoff; + sp->_filtered = _nc_prescreen.filter_mode; + sp->_use_env = _nc_prescreen.use_env; +#if NCURSES_NO_PADDING + sp->_no_padding = _nc_prescreen._no_padding; +#endif + sp->slk_format = 0; + sp->_slk = 0; + sp->_prescreen = TRUE; + SP_PRE_INIT(sp); +#if USE_REENTRANT + sp->_TABSIZE = _nc_prescreen._TABSIZE; + sp->_ESCDELAY = _nc_prescreen._ESCDELAY; +#endif + } + } + returnSP(sp); +} +#endif + +#ifdef USE_TERM_DRIVER +/* + * This entrypoint is called from tgetent() to allow a special case of reusing + * the same TERMINAL data (see comment). + */ +NCURSES_EXPORT(int) +_nc_setupterm(NCURSES_CONST char *tname, + int Filedes, + int *errret, + bool reuse) +{ + int res; + TERMINAL *termp; + res = TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse); + if (ERR != res) + NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN_PRE, termp); + return res; +} +#endif + /* * setupterm(termname, Filedes, errret) * diff --git a/ncurses/tinfo/lib_termcap.c b/ncurses/tinfo/lib_termcap.c index 2d245ffbb61..e9dae85bdd9 100644 --- a/ncurses/tinfo/lib_termcap.c +++ b/ncurses/tinfo/lib_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * * * * some of the code in here was contributed by: * * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) * @@ -43,9 +44,11 @@ #include #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_termcap.c,v 1.63 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.73 2010/12/25 19:27:12 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -76,16 +79,26 @@ NCURSES_EXPORT_VAR(char *) BC = 0; ***************************************************************************/ NCURSES_EXPORT(int) -tgetent(char *bufp, const char *name) +NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) { - int errcode; + int rc = ERR; int n; bool found_cache = FALSE; +#ifdef USE_TERM_DRIVER + TERMINAL *termp = 0; +#endif START_TRACE(); T((T_CALLED("tgetent()"))); - _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE); + TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name, + STDOUT_FILENO, &rc, TRUE); + +#ifdef USE_TERM_DRIVER + if (termp == 0 || + !((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo) + return (rc); +#endif /* * In general we cannot tell if the fixed sgr0 is still used by the @@ -109,9 +122,9 @@ tgetent(char *bufp, const char *name) /* * Also free the terminfo data that we loaded (much bigger leak). */ - if (LAST_TRM != 0 && LAST_TRM != cur_term) { + if (LAST_TRM != 0 && LAST_TRM != TerminalOf(SP_PARM)) { TERMINAL *trm = LAST_TRM; - del_curterm(LAST_TRM); + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; @@ -131,7 +144,7 @@ tgetent(char *bufp, const char *name) } CacheInx = best; } - LAST_TRM = cur_term; + LAST_TRM = TerminalOf(SP_PARM); LAST_SEQ = ++CacheSeq; PC = 0; @@ -139,7 +152,7 @@ tgetent(char *bufp, const char *name) BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ - if (errcode == 1) { + if (rc == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) @@ -153,7 +166,7 @@ tgetent(char *bufp, const char *name) if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; - if ((FIX_SGR0 = _nc_trim_sgr0(&(cur_term->type))) != 0) { + if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); @@ -164,8 +177,8 @@ tgetent(char *bufp, const char *name) LAST_BUF = bufp; LAST_USE = TRUE; - SetNoPadding(SP); - (void) baudrate(); /* sets ospeed as a side-effect */ + SetNoPadding(SP_PARM); + (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -174,9 +187,28 @@ tgetent(char *bufp, const char *name) #endif*/ } - returnCode(errcode); + returnCode(rc); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetent(char *bufp, const char *name) +{ + return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name); +} +#endif + +#if 0 +static bool +same_tcname(const char *a, const char *b) +{ + fprintf(stderr, "compare(%s,%s)\n", a, b); + return !strncmp(a, b, 2); +} +#else +#define same_tcname(a,b) !strncmp(a,b,2) +#endif + /*************************************************************************** * * tgetflag(str) @@ -187,24 +219,48 @@ tgetent(char *bufp, const char *name) ***************************************************************************/ NCURSES_EXPORT(int) -tgetflag(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) { - unsigned i; + int result = 0; /* Solaris returns zero for missing flag */ + int i, j; - T((T_CALLED("tgetflag(%s)"), id)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolcodes); - if (!strncmp(id, capname, 2)) { - /* setupterm forces invalid booleans to false */ - returnCode(tp->Booleans[i]); + T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, BOOLEAN, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + /* note: setupterm forces invalid booleans to false */ + result = tp->Booleans[j]; + } } - returnCode(0); /* Solaris does this */ + returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetflag(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetnum(str) @@ -215,25 +271,48 @@ tgetflag(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(int) -tgetnum(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) { - unsigned i; + int result = ABSENT_NUMERIC; + int i, j; - T((T_CALLED("tgetnum(%s)"), id)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_number(i, tp) { - const char *capname = ExtNumname(tp, i, numcodes); - if (!strncmp(id, capname, 2)) { - if (!VALID_NUMERIC(tp->Numbers[i])) - returnCode(ABSENT_NUMERIC); - returnCode(tp->Numbers[i]); + T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, NUMBER, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_number(i, tp) { + const char *capname = ExtNumname(tp, i, numcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + if (VALID_NUMERIC(tp->Numbers[j])) + result = tp->Numbers[j]; + } } - returnCode(ABSENT_NUMERIC); + returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetnum(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetstr(str, area) @@ -244,40 +323,62 @@ tgetnum(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(char *) -tgetstr(NCURSES_CONST char *id, char **area) +NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) { - unsigned i; char *result = NULL; + int i, j; - T((T_CALLED("tgetstr(%s,%p)"), id, area)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_string(i, tp) { - const char *capname = ExtStrname(tp, i, strcodes); - if (!strncmp(id, capname, 2)) { - result = tp->Strings[i]; - TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); - /* setupterm forces canceled strings to null */ - if (VALID_STRING(result)) { - if (result == exit_attribute_mode - && FIX_SGR0 != 0) { - result = FIX_SGR0; - TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); - } - if (area != 0 - && *area != 0) { - (void) strcpy(*area, result); - result = *area; - *area += strlen(*area) + 1; - } + T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, STRING, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_string(i, tp) { + const char *capname = ExtStrname(tp, i, strcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } + } + } +#endif + if (j >= 0) { + result = tp->Strings[j]; + TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); + /* setupterm forces canceled strings to null */ + if (VALID_STRING(result)) { + if (result == exit_attribute_mode + && FIX_SGR0 != 0) { + result = FIX_SGR0; + TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); + } + if (area != 0 + && *area != 0) { + (void) strcpy(*area, result); + result = *area; + *area += strlen(*area) + 1; } - break; } } } returnPtr(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +tgetstr(NCURSES_CONST char *id, char **area) +{ + return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area); +} +#endif + #if NO_LEAKS NCURSES_EXPORT(void) _nc_tgetent_leaks(void) diff --git a/ncurses/tinfo/lib_termname.c b/ncurses/tinfo/lib_termname.c index 713d0be8c36..e3f6827ee01 100644 --- a/ncurses/tinfo/lib_termname.c +++ b/ncurses/tinfo/lib_termname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,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 * @@ -28,17 +28,31 @@ #include -MODULE_ID("$Id: lib_termname.c,v 1.8 2003/12/27 18:23:01 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT(char *) -termname(void) +NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0) { char *name = 0; - T((T_CALLED("termname()"))); + T((T_CALLED("termname(%p)"), (void *) SP_PARM)); +#if NCURSES_SP_FUNCS + if (TerminalOf(SP_PARM) != 0) { + name = TerminalOf(SP_PARM)->_termname; + } +#else if (cur_term != 0) name = cur_term->_termname; +#endif returnPtr(name); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +termname(void) +{ + return NCURSES_SP_NAME(termname) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tinfo/lib_ti.c b/ncurses/tinfo/lib_ti.c index df460f953ea..e41234210c8 100644 --- a/ncurses/tinfo/lib_ti.c +++ b/ncurses/tinfo/lib_ti.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,75 +29,159 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ #include -#include #include -MODULE_ID("$Id: lib_ti.c,v 1.23 2003/05/24 21:10:28 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.29 2010/01/23 17:57:43 tom Exp $") +#if 0 +static bool +same_name(const char *a, const char *b) +{ + fprintf(stderr, "compare(%s,%s)\n", a, b); + return !strcmp(a, b); +} +#else +#define same_name(a,b) !strcmp(a,b) +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + int result = ABSENT_BOOLEAN; + int i, j; + + T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolnames); + if (same_name(str, capname)) { + j = i; + break; + } + } + } +#endif + if (j >= 0) { + /* note: setupterm forces invalid booleans to false */ + result = tp->Booleans[j]; + } + } + + returnCode(result); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetflag(NCURSES_CONST char *str) { - unsigned i; + return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str); +} +#endif - T((T_CALLED("tigetflag(%s)"), str)); +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + int i, j; + int result = CANCELLED_NUMERIC; /* Solaris returns a -1 on error */ - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolnames); - if (!strcmp(str, capname)) { - /* setupterm forces invalid booleans to false */ - returnCode(tp->Booleans[i]); + T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_number(i, tp) { + const char *capname = ExtNumname(tp, i, numnames); + if (same_name(str, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + if (VALID_NUMERIC(tp->Numbers[j])) + result = tp->Numbers[j]; + else + result = ABSENT_NUMERIC; + } } - returnCode(ABSENT_BOOLEAN); + returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetnum(NCURSES_CONST char *str) { - unsigned i; + return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str); +} +#endif - T((T_CALLED("tigetnum(%s)"), str)); +NCURSES_EXPORT(char *) +NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + char *result = CANCELLED_STRING; + int i, j; - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_number(i, tp) { - const char *capname = ExtNumname(tp, i, numnames); - if (!strcmp(str, capname)) { - if (!VALID_NUMERIC(tp->Numbers[i])) - returnCode(ABSENT_NUMERIC); - returnCode(tp->Numbers[i]); + T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, STRING, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_string(i, tp) { + const char *capname = ExtStrname(tp, i, strnames); + if (same_name(str, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + /* note: setupterm forces cancelled strings to null */ + result = tp->Strings[j]; + } } - returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ + returnPtr(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(char *) tigetstr(NCURSES_CONST char *str) { - unsigned i; - - T((T_CALLED("tigetstr(%s)"), str)); - - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_string(i, tp) { - const char *capname = ExtStrname(tp, i, strnames); - if (!strcmp(str, capname)) { - /* setupterm forces cancelled strings to null */ - returnPtr(tp->Strings[i]); - } - } - } - - returnPtr(CANCELLED_STRING); + return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str); } +#endif diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index ba2a8404030..7cd12f7f684 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,10 +40,9 @@ #include #include -#include #include -MODULE_ID("$Id: lib_tparm.c,v 1.76 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.82 2011/01/15 22:19:12 tom Exp $") /* * char * @@ -140,7 +139,7 @@ save_text(const char *fmt, const char *s, int len) { size_t s_len = strlen(s); if (len > (int) s_len) - s_len = len; + s_len = (size_t) len; get_space(s_len + 1); @@ -451,12 +450,13 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) } static NCURSES_INLINE char * -tparam_internal(const char *string, va_list ap) +tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) { char *p_is_s[NUM_PARM]; TPARM_ARG param[NUM_PARM]; - int popcount; + int popcount = 0; int number; + int num_args; int len; int level; int x, y; @@ -479,7 +479,13 @@ tparam_internal(const char *string, va_list ap) if (TPS(fmt_buff) == 0) return NULL; - for (i = 0; i < max(popcount, number); i++) { + if (number > NUM_PARM) + number = NUM_PARM; + if (popcount > NUM_PARM) + popcount = NUM_PARM; + num_args = max(popcount, number); + + for (i = 0; i < num_args; i++) { /* * A few caps (such as plab_norm) have string-valued parms. * We'll have to assume that the caller knows the difference, since @@ -489,8 +495,11 @@ tparam_internal(const char *string, va_list ap) */ if (p_is_s[i] != 0) { p_is_s[i] = va_arg(ap, char *); - } else { + param[i] = 0; + } else if (use_TPARM_ARG) { param[i] = va_arg(ap, TPARM_ARG); + } else { + param[i] = (TPARM_ARG) va_arg(ap, int); } } @@ -508,7 +517,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } } #ifdef TRACE @@ -517,7 +526,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i] != 0) save_text(", %s", _nc_visbuf(p_is_s[i]), 0); else - save_number(", %d", param[i], 0); + save_number(", %d", (int) param[i], 0); } _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff)); TPS(out_used) = 0; @@ -564,7 +573,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } break; @@ -772,7 +781,7 @@ tparm_varargs(NCURSES_CONST char *string,...) #ifdef TRACE TPS(tname) = "tparm"; #endif /* TRACE */ - result = tparam_internal(string, ap); + result = tparam_internal(TRUE, string, ap); va_end(ap); return result; } @@ -793,3 +802,19 @@ tparm_proto(NCURSES_CONST char *string, return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9); } #endif /* NCURSES_TPARM_VARARGS */ + +NCURSES_EXPORT(char *) +tiparm(const char *string,...) +{ + va_list ap; + char *result; + + _nc_tparm_err = 0; + va_start(ap, string); +#ifdef TRACE + TPS(tname) = "tiparm"; +#endif /* TRACE */ + result = tparam_internal(FALSE, string, ap); + va_end(ap); + return result; +} diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index a8b7276895a..dc70f3e0b0b 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,12 +42,16 @@ */ #include + +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #include -#include /* padding_baud_rate, xon_xoff */ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.66 2008/06/28 13:12:15 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -69,63 +74,136 @@ _nc_set_no_padding(SCREEN *sp) } #endif -static int (*my_outch) (int c) = _nc_outch; +#if NCURSES_SP_FUNCS +#define SetOutCh(func) if (SP_PARM) SP_PARM->_outch = func; else _nc_prescreen._outch = func +#define GetOutCh() (SP_PARM ? SP_PARM->_outch : _nc_prescreen._outch) +#else +#define SetOutCh(func) static_outch = func +#define GetOutCh() static_outch +static NCURSES_SP_OUTC static_outch = NCURSES_SP_NAME(_nc_outch); +#endif NCURSES_EXPORT(int) -delay_output(int ms) +NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) { - T((T_CALLED("delay_output(%d)"), ms)); + T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms)); + + if (!HasTInfoTerminal(SP_PARM)) + returnCode(ERR); if (no_pad_char) { - _nc_flush(); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); napms(ms); } else { + NCURSES_SP_OUTC my_outch = GetOutCh(); register int nullcount; nullcount = (ms * _nc_baudrate(ospeed)) / (BAUDBYTE * 1000); for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--) - my_outch(PC); - if (my_outch == _nc_outch) - _nc_flush(); + my_outch(NCURSES_SP_ARGx PC); + if (my_outch == NCURSES_SP_NAME(_nc_outch)) + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); } returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +delay_output(int ms) +{ + return NCURSES_SP_NAME(delay_output) (CURRENT_SCREEN, ms); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) +{ + (void) fflush(NC_OUTPUT(SP_PARM)); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_flush(void) { - (void) fflush(NC_OUTPUT); + NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN); } +#endif NCURSES_EXPORT(int) -_nc_outch(int ch) +NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) { + int rc = OK; + COUNT_OUTCHARS(1); - if (SP != 0 - && SP->_cleanup) { - char tmp = ch; + if (HasTInfoTerminal(SP_PARM) + && SP_PARM != 0 + && SP_PARM->_cleanup) { + char tmp = (char) ch; /* * POSIX says write() is safe in a signal handler, but the * buffered I/O is not. */ - write(fileno(NC_OUTPUT), &tmp, 1); + if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1) + rc = ERR; } else { - putc(ch, NC_OUTPUT); + if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF) + rc = ERR; } - return OK; + return rc; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outch(int ch) +{ + return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string) +{ + return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + string, 1, NCURSES_SP_NAME(_nc_outch)); +} + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx + const char *name GCC_UNUSED, + const char *string) +{ + int rc = ERR; + + if (string != 0) { + TPUTS_TRACE(name); + rc = NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx string); + } + return rc; +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) putp(const char *string) { - return tputs(string, 1, _nc_outch); + return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string); } NCURSES_EXPORT(int) -tputs(const char *string, int affcnt, int (*outc) (int)) +_nc_putp(const char *name, const char *string) { + return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, string); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx + const char *string, + int affcnt, + NCURSES_SP_OUTC outc) +{ + NCURSES_SP_OUTC my_outch = GetOutCh(); bool always_delay; bool normal_delay; int number; @@ -137,7 +215,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) char addrbuf[32]; if (USE_TRACEF(TRACE_TPUTS)) { - if (outc == _nc_outch) + if (outc == NCURSES_SP_NAME(_nc_outch)) (void) strcpy(addrbuf, "_nc_outch"); else (void) sprintf(addrbuf, "%p", outc); @@ -152,10 +230,19 @@ tputs(const char *string, int affcnt, int (*outc) (int)) } #endif /* TRACE */ + if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM)) + return ERR; + if (!VALID_STRING(string)) return ERR; - if (cur_term == 0) { + if ( +#if NCURSES_SP_FUNCS + (SP_PARM != 0 && SP_PARM->_term == 0) +#else + cur_term == 0 +#endif + ) { always_delay = FALSE; normal_delay = TRUE; } else { @@ -164,7 +251,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) !xon_xoff && padding_baud_rate #if NCURSES_NO_PADDING - && !GetNoPadding(SP) + && !GetNoPadding(SP_PARM) #endif && (_nc_baudrate(ospeed) >= padding_baud_rate); } @@ -198,24 +285,24 @@ tputs(const char *string, int affcnt, int (*outc) (int)) } #endif /* BSD_TPUTS */ - my_outch = outc; /* redirect delay_output() */ + SetOutCh(outc); /* redirect delay_output() */ while (*string) { if (*string != '$') - (*outc) (*string); + (*outc) (NCURSES_SP_ARGx *string); else { string++; if (*string != '<') { - (*outc) ('$'); + (*outc) (NCURSES_SP_ARGx '$'); if (*string) - (*outc) (*string); + (*outc) (NCURSES_SP_ARGx *string); } else { bool mandatory; string++; if ((!isdigit(UChar(*string)) && *string != '.') || !strchr(string, '>')) { - (*outc) ('$'); - (*outc) ('<'); + (*outc) (NCURSES_SP_ARGx '$'); + (*outc) (NCURSES_SP_ARGx '<'); continue; } @@ -250,7 +337,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) && (always_delay || normal_delay || mandatory)) - delay_output(number / 10); + NCURSES_SP_NAME(delay_output) (NCURSES_SP_ARGx number / 10); } /* endelse (*string == '<') */ } /* endelse (*string == '$') */ @@ -270,6 +357,25 @@ tputs(const char *string, int affcnt, int (*outc) (int)) delay_output(trailpad / 10); #endif /* BSD_TPUTS */ - my_outch = _nc_outch; + SetOutCh(my_outch); return OK; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outc_wrapper(SCREEN *sp, int c) +{ + if (0 == sp) { + return (ERR); + } else { + return sp->jump(c); + } +} + +NCURSES_EXPORT(int) +tputs(const char *string, int affcnt, int (*outc) (int)) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx string, affcnt, _nc_outc_wrapper); +} +#endif diff --git a/ncurses/tinfo/lib_ttyflags.c b/ncurses/tinfo/lib_ttyflags.c index a2b38a3327f..663a0689809 100644 --- a/ncurses/tinfo/lib_ttyflags.c +++ b/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -36,159 +36,246 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_ttyflags.c,v 1.18 2008/08/03 22:10:44 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_ttyflags.c,v 1.27 2010/12/25 23:43:58 tom Exp $") NCURSES_EXPORT(int) -_nc_get_tty_mode(TTY * buf) +NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; - if (buf == 0) { + if (buf == 0 || SP_PARM == 0) { result = ERR; } else { - if (cur_term == 0) { + TERMINAL *termp = TerminalOf(SP_PARM); + + if (0 == termp) { result = ERR; } else { +#ifdef USE_TERM_DRIVER + result = CallDriver_2(SP_PARM, sgmode, FALSE, buf); +#else for (;;) { - if (GET_TTY(cur_term->Filedes, buf) != 0) { + if (GET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; result = ERR; } break; } +#endif } if (result == ERR) memset(buf, 0, sizeof(*buf)); TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", - cur_term ? cur_term->Filedes : -1, + termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -_nc_set_tty_mode(TTY * buf) +_nc_get_tty_mode(TTY * buf) +{ + return NCURSES_SP_NAME(_nc_get_tty_mode) (CURRENT_SCREEN, buf); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; - if (buf == 0) { + if (buf == 0 || SP_PARM == 0) { result = ERR; } else { - if (cur_term == 0) { + TERMINAL *termp = TerminalOf(SP_PARM); + + if (0 == termp) { result = ERR; } else { +#ifdef USE_TERM_DRIVER + result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); +#else for (;;) { - if (SET_TTY(cur_term->Filedes, buf) != 0) { + if (SET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; - if ((errno == ENOTTY) && (SP != 0)) - SP->_notty = TRUE; + if ((errno == ENOTTY) && (SP_PARM != 0)) + SP_PARM->_notty = TRUE; result = ERR; } break; } +#endif } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", - cur_term ? cur_term->Filedes : -1, + termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -def_shell_mode(void) +_nc_set_tty_mode(TTY * buf) +{ + return NCURSES_SP_NAME(_nc_set_tty_mode) (CURRENT_SCREEN, buf); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) { int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_shell_mode()"))); + T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM)); - if (cur_term != 0) { + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, FALSE, TRUE); +#else /* * If XTABS was on, remove the tab and backtab capabilities. */ - if (_nc_get_tty_mode(&cur_term->Ottyb) == OK) { + if (_nc_get_tty_mode(&termp->Ottyb) == OK) { #ifdef TERMIOS - if (cur_term->Ottyb.c_oflag & OFLAGS_TABS) + if (termp->Ottyb.c_oflag & OFLAGS_TABS) tab = back_tab = NULL; #else - if (cur_term->Ottyb.sg_flags & XTABS) + if (termp->Ottyb.sg_flags & XTABS) tab = back_tab = NULL; #endif rc = OK; } +#endif } returnCode(rc); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -def_prog_mode(void) +def_shell_mode(void) +{ + return NCURSES_SP_NAME(def_shell_mode) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) { int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_prog_mode()"))); + T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM)); - if (cur_term != 0) { + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, TRUE, TRUE); +#else /* * Turn off the XTABS bit in the tty structure if it was on. */ - if (_nc_get_tty_mode(&cur_term->Nttyb) == OK) { + if (_nc_get_tty_mode(&termp->Nttyb) == OK) { #ifdef TERMIOS - cur_term->Nttyb.c_oflag &= ~OFLAGS_TABS; + termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); #else - cur_term->Nttyb.sg_flags &= ~XTABS; + termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif rc = OK; } +#endif } returnCode(rc); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +def_prog_mode(void) +{ + return NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) +{ + int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); + + T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, TRUE, FALSE); +#else + if (_nc_set_tty_mode(&termp->Nttyb) == OK) { + if (SP_PARM) { + if (SP_PARM->_keypad_on) + _nc_keypad(SP_PARM, TRUE); + NC_BUFFERED(SP_PARM, TRUE); + } + rc = OK; + } +#endif + } + returnCode(rc); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_prog_mode(void) { - T((T_CALLED("reset_prog_mode()"))); + return NCURSES_SP_NAME(reset_prog_mode) (CURRENT_SCREEN); +} +#endif - if (cur_term != 0) { - if (_nc_set_tty_mode(&cur_term->Nttyb) == OK) { - if (SP) { - if (SP->_keypad_on) - _nc_keypad(SP, TRUE); - NC_BUFFERED(TRUE); - } - returnCode(OK); +NCURSES_EXPORT(int) +NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) +{ + int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); + + T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, FALSE, FALSE); +#else + if (SP_PARM) { + _nc_keypad(SP_PARM, FALSE); + _nc_flush(); + NC_BUFFERED(SP_PARM, FALSE); } + rc = _nc_set_tty_mode(&termp->Ottyb); +#endif } - returnCode(ERR); + returnCode(rc); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_shell_mode(void) { - T((T_CALLED("reset_shell_mode()"))); - - if (cur_term != 0) { - if (SP) { - _nc_keypad(SP, FALSE); - _nc_flush(); - NC_BUFFERED(FALSE); - } - returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); - } - returnCode(ERR); + return NCURSES_SP_NAME(reset_shell_mode) (CURRENT_SCREEN); } +#endif static TTY * -saved_tty(void) +saved_tty(NCURSES_SP_DCL0) { TTY *result = 0; - if (SP != 0) { - result = &(SP->_saved_tty); + if (SP_PARM != 0) { + result = (TTY *) & (SP_PARM->_saved_tty); } else { if (_nc_prescreen.saved_tty == 0) { _nc_prescreen.saved_tty = typeCalloc(TTY, 1); @@ -204,17 +291,31 @@ saved_tty(void) */ NCURSES_EXPORT(int) -savetty(void) +NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0) { - T((T_CALLED("savetty()"))); - - returnCode(_nc_get_tty_mode(saved_tty())); + T((T_CALLED("savetty(%p)"), (void *) SP_PARM)); + returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +savetty(void) +{ + return NCURSES_SP_NAME(savetty) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0) +{ + T((T_CALLED("resetty(%p)"), (void *) SP_PARM)); + returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) resetty(void) { - T((T_CALLED("resetty()"))); - - returnCode(_nc_set_tty_mode(saved_tty())); + return NCURSES_SP_NAME(resetty) (CURRENT_SCREEN); } +#endif diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c new file mode 100644 index 00000000000..15c281def50 --- /dev/null +++ b/ncurses/tinfo/make_hash.c @@ -0,0 +1,294 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + ****************************************************************************/ + +/* + * make_hash.c --- build-time program for constructing comp_captab.c + * + */ + +#include + +#include +#include + +#include + +MODULE_ID("$Id: make_hash.c,v 1.3 2010/05/22 18:02:50 tom Exp $") + +/* + * _nc_make_hash_table() + * + * Takes the entries in table[] and hashes them into hash_table[] + * by name. There are CAPTABSIZE entries in table[] and HASHTABSIZE + * slots in hash_table[]. + * + */ + +#undef MODULE_ID +#define MODULE_ID(id) /*nothing */ +#include + +/* + * int hash_function(string) + * + * Computes the hashing function on the given string. + * + * The current hash function is the sum of each consectutive pair + * of characters, taken as two-byte integers, mod HASHTABSIZE. + * + */ + +static int +hash_function(const char *string) +{ + long sum = 0; + + while (*string) { + sum += (long) (*string + (*(string + 1) << 8)); + string++; + } + + return (int) (sum % HASHTABSIZE); +} + +static void +_nc_make_hash_table(struct name_table_entry *table, + HashValue * hash_table) +{ + short i; + int hashvalue; + int collisions = 0; + + for (i = 0; i < HASHTABSIZE; i++) { + hash_table[i] = -1; + } + for (i = 0; i < CAPTABSIZE; i++) { + hashvalue = hash_function(table[i].nte_name); + + if (hash_table[hashvalue] >= 0) + collisions++; + + if (hash_table[hashvalue] != 0) + table[i].nte_link = hash_table[hashvalue]; + hash_table[hashvalue] = i; + } + + printf("/* %d collisions out of %d entries */\n", collisions, CAPTABSIZE); +} + +/* + * This filter reads from standard input a list of tab-delimited columns, + * (e.g., from Caps.filtered) computes the hash-value of a specified column and + * writes the hashed tables to standard output. + * + * By compiling the hash table at build time, we're able to make the entire + * set of terminfo and termcap tables readonly (and also provide some runtime + * performance enhancement). + */ + +#define MAX_COLUMNS BUFSIZ /* this _has_ to be worst-case */ + +static char ** +parse_columns(char *buffer) +{ + static char **list; + + int col = 0; + + if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) + return (0); + + if (*buffer != '#') { + while (*buffer != '\0') { + char *s; + for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++) + /*EMPTY */ ; + if (s != buffer) { + char mark = *s; + *s = '\0'; + if ((s - buffer) > 1 + && (*buffer == '"') + && (s[-1] == '"')) { /* strip the quotes */ + assert(s > buffer + 1); + s[-1] = '\0'; + buffer++; + } + list[col] = buffer; + col++; + if (mark == '\0') + break; + while (*++s && isspace(UChar(*s))) + /*EMPTY */ ; + buffer = s; + } else + break; + } + } + return col ? list : 0; +} + +int +main(int argc, char **argv) +{ + struct name_table_entry *name_table = typeCalloc(struct + name_table_entry, CAPTABSIZE); + HashValue *hash_table = typeCalloc(HashValue, HASHTABSIZE); + const char *root_name = ""; + int column = 0; + int bigstring = 0; + int n; + char buffer[BUFSIZ]; + + static const char *typenames[] = + {"BOOLEAN", "NUMBER", "STRING"}; + + short BoolCount = 0; + short NumCount = 0; + short StrCount = 0; + + /* The first argument is the column-number (starting with 0). + * The second is the root name of the tables to generate. + */ + if (argc <= 3 + || (column = atoi(argv[1])) <= 0 + || (column >= MAX_COLUMNS) + || *(root_name = argv[2]) == 0 + || (bigstring = atoi(argv[3])) < 0 + || name_table == 0 + || hash_table == 0) { + fprintf(stderr, "usage: make_hash column root_name bigstring\n"); + exit(EXIT_FAILURE); + } + + /* + * Read the table into our arrays. + */ + for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) { + char **list, *nlp = strchr(buffer, '\n'); + if (nlp) + *nlp = '\0'; + list = parse_columns(buffer); + if (list == 0) /* blank or comment */ + continue; + name_table[n].nte_link = -1; /* end-of-hash */ + name_table[n].nte_name = strdup(list[column]); + if (!strcmp(list[2], "bool")) { + name_table[n].nte_type = BOOLEAN; + name_table[n].nte_index = BoolCount++; + } else if (!strcmp(list[2], "num")) { + name_table[n].nte_type = NUMBER; + name_table[n].nte_index = NumCount++; + } else if (!strcmp(list[2], "str")) { + name_table[n].nte_type = STRING; + name_table[n].nte_index = StrCount++; + } else { + fprintf(stderr, "Unknown type: %s\n", list[2]); + exit(EXIT_FAILURE); + } + n++; + } + _nc_make_hash_table(name_table, hash_table); + + /* + * Write the compiled tables to standard output + */ + if (bigstring) { + int len = 0; + int nxt; + + printf("static const char %s_names_text[] = \\\n", root_name); + for (n = 0; n < CAPTABSIZE; n++) { + nxt = (int) strlen(name_table[n].nte_name) + 5; + if (nxt + len > 72) { + printf("\\\n"); + len = 0; + } + printf("\"%s\\0\" ", name_table[n].nte_name); + len += nxt; + } + printf(";\n\n"); + + len = 0; + printf("static name_table_data const %s_names_data[] =\n", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n", + len, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + len += (int) strlen(name_table[n].nte_name) + 1; + } + printf("};\n\n"); + printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name); + } else { + + printf("static struct name_table_entry %s _nc_%s_table[] =\n", + bigstring ? "" : "const", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + sprintf(buffer, "\"%s\"", + name_table[n].nte_name); + printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n", + buffer, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + } + printf("};\n\n"); + } + + printf("static const HashValue _nc_%s_hash_table[%d] =\n", + root_name, + HASHTABSIZE + 1); + printf("{\n"); + for (n = 0; n < HASHTABSIZE; n++) { + printf("\t%3d,\n", hash_table[n]); + } + printf("\t0\t/* base-of-table */\n"); + printf("};\n\n"); + + printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n", + BoolCount, NumCount, StrCount); + printf("#error\t--> term.h and comp_captab.c disagree about the <--\n"); + printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); + printf("#endif\n\n"); + + free(hash_table); + return EXIT_SUCCESS; +} diff --git a/ncurses/tinfo/make_keys.c b/ncurses/tinfo/make_keys.c index c084f87fb94..a7854e3fe60 100644 --- a/ncurses/tinfo/make_keys.c +++ b/ncurses/tinfo/make_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,18 +37,18 @@ */ #define USE_TERMLIB 1 -#include +#include -MODULE_ID("$Id: make_keys.c,v 1.14 2008/08/03 21:57:22 tom Exp $") +MODULE_ID("$Id: make_keys.c,v 1.19 2010/06/05 22:08:00 tom Exp $") #include -#define UNKNOWN (SIZEOF(strnames) + SIZEOF(strfnames)) +#define UNKNOWN (unsigned) (SIZEOF(strnames) + SIZEOF(strfnames)) -static size_t +static unsigned lookup(const char *name) { - size_t n; + unsigned n; bool found = FALSE; for (n = 0; strnames[n] != 0; n++) { if (!strcmp(name, strnames[n])) { @@ -73,7 +73,7 @@ make_keys(FILE *ifp, FILE *ofp) char buffer[BUFSIZ]; char from[256]; char to[256]; - int maxlen = 16; + unsigned maxlen = 16; int scanned; while (fgets(buffer, sizeof(buffer), ifp) != 0) { @@ -85,14 +85,14 @@ make_keys(FILE *ifp, FILE *ofp) scanned = sscanf(buffer, "%255s %255s", to, from); if (scanned == 2) { - int code = lookup(from); + unsigned code = lookup(from); if (code == UNKNOWN) continue; - if ((int) strlen(from) > maxlen) - maxlen = strlen(from); - fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n", + if (strlen(from) > maxlen) + maxlen = (unsigned) strlen(from); + fprintf(ofp, "\t{ %4u, %-*.*s },\t/* %s */\n", code, - maxlen, maxlen, + (int) maxlen, (int) maxlen, to, from); } diff --git a/ncurses/tinfo/name_match.c b/ncurses/tinfo/name_match.c index d576901fa2e..a9ac6427888 100644 --- a/ncurses/tinfo/name_match.c +++ b/ncurses/tinfo/name_match.c @@ -31,10 +31,9 @@ ****************************************************************************/ #include -#include #include -MODULE_ID("$Id: name_match.c,v 1.17 2008/08/03 19:49:33 tom Exp $") +MODULE_ID("$Id: name_match.c,v 1.18 2008/11/16 00:19:59 juergen Exp $") /* * _nc_first_name(char *names) diff --git a/ncurses/tinfo/parse_entry.c b/ncurses/tinfo/parse_entry.c index cf7a5f409d7..ddbc25204fe 100644 --- a/ncurses/tinfo/parse_entry.c +++ b/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -46,9 +46,8 @@ #include #include -#include -MODULE_ID("$Id: parse_entry.c,v 1.69 2008/08/16 21:52:03 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -84,13 +83,13 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) case NUMBER: first = tp->ext_Booleans; last = tp->ext_Numbers + first; - offset = tp->ext_Booleans + tp->ext_Numbers; + offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); tindex = tp->num_Numbers; break; case STRING: - first = tp->ext_Booleans + tp->ext_Numbers; + first = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); last = tp->ext_Strings + first; - offset = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings; + offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings); tindex = tp->num_Strings; break; case CANCEL: @@ -137,27 +136,31 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) break; } } + +#define for_each_value(max) \ + for (last = (unsigned) (max - 1); last > tindex; last--) + if (!found) { switch (token_type) { case BOOLEAN: - tp->ext_Booleans += 1; - tp->num_Booleans += 1; + tp->ext_Booleans++; + tp->num_Booleans++; tp->Booleans = typeRealloc(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans); - for (last = tp->num_Booleans - 1; last > tindex; last--) + for_each_value(tp->num_Booleans) tp->Booleans[last] = tp->Booleans[last - 1]; break; case NUMBER: - tp->ext_Numbers += 1; - tp->num_Numbers += 1; + tp->ext_Numbers++; + tp->num_Numbers++; tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers); - for (last = tp->num_Numbers - 1; last > tindex; last--) + for_each_value(tp->num_Numbers) tp->Numbers[last] = tp->Numbers[last - 1]; break; case STRING: - tp->ext_Strings += 1; - tp->num_Strings += 1; + tp->ext_Strings++; + tp->num_Strings++; tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings); - for (last = tp->num_Strings - 1; last > tindex; last--) + for_each_value(tp->num_Strings) tp->Strings[last] = tp->Strings[last - 1]; break; } @@ -170,7 +173,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) temp.nte_name = tp->ext_Names[offset]; temp.nte_type = token_type; - temp.nte_index = tindex; + temp.nte_index = (short) tindex; temp.nte_link = -1; return &temp; @@ -379,16 +382,14 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) && !strcmp("ma", _nc_curr_token.tk_name)) { /* tell max_attributes from arrow_key_map */ entry_ptr = _nc_find_type_entry("ma", NUMBER, - _nc_get_table(_nc_syntax - != 0)); + _nc_syntax != 0); assert(entry_ptr != 0); } else if (token_type == STRING && !strcmp("MT", _nc_curr_token.tk_name)) { /* map terminfo's string MT to MT */ entry_ptr = _nc_find_type_entry("MT", STRING, - _nc_get_table(_nc_syntax - != 0)); + _nc_syntax != 0); assert(entry_ptr != 0); } else if (token_type == BOOLEAN @@ -444,7 +445,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) case NUMBER: entryp->tterm.Numbers[entry_ptr->nte_index] = - _nc_curr_token.tk_valnumber; + (short) _nc_curr_token.tk_valnumber; break; case STRING: @@ -510,9 +511,9 @@ NCURSES_EXPORT(int) _nc_capcmp(const char *s, const char *t) /* compare two string capabilities, stripping out padding */ { - if (!s && !t) + if (!VALID_STRING(s) && !VALID_STRING(t)) return (0); - else if (!s || !t) + else if (!VALID_STRING(s) || !VALID_STRING(t)) return (1); for (;;) { @@ -667,7 +668,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) else if (PRESENT(backspace_if_not_bs)) cursor_left = backspace_if_not_bs; } - /* vi doesn't use "do", but it does seems to use nl (or '\n') instead */ + /* vi doesn't use "do", but it does seem to use nl (or '\n') instead */ if (WANTED(cursor_down)) { if (PRESENT(linefeed_if_not_lf)) cursor_down = linefeed_if_not_lf; @@ -772,7 +773,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) * isn't from mytinfo... */ if (PRESENT(other_non_function_keys)) { - char *base = other_non_function_keys; + char *base; char *bp, *cp, *dp; struct name_table_entry const *from_ptr; struct name_table_entry const *to_ptr; @@ -788,7 +789,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) for (base = other_non_function_keys; (cp = strchr(base, ',')) != 0; base = cp + 1) { - size_t len = cp - base; + size_t len = (unsigned) (cp - base); for (ap = ko_xlate; ap->from; ap++) { if (len == strlen(ap->from) @@ -840,7 +841,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) } else *dp++ = *bp; } - *dp++ = '\0'; + *dp = '\0'; tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2); } diff --git a/ncurses/tinfo/read_entry.c b/ncurses/tinfo/read_entry.c index b4ea61ca194..e38b9cbe49d 100644 --- a/ncurses/tinfo/read_entry.c +++ b/ncurses/tinfo/read_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,9 +40,8 @@ #include #include -#include -MODULE_ID("$Id: read_entry.c,v 1.102 2008/08/03 19:33:04 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.108 2011/02/26 15:36:06 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -57,7 +56,7 @@ convert_shorts(char *buf, short *Numbers, int count) else if (IS_NEG2(buf + 2 * i)) Numbers[i] = CANCELLED_NUMERIC; else - Numbers[i] = LOW_MSB(buf + 2 * i); + Numbers[i] = (short) LOW_MSB(buf + 2 * i); TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i])); } } @@ -99,9 +98,9 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) if (have > 0) { if ((int) want > have) - want = have; + want = (unsigned) have; memcpy(dst, src + *offset, want); - *offset += want; + *offset += (int) want; } else { want = 0; } @@ -155,7 +154,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) return (TGETENT_NO); } - want = str_size + name_size + 1; + want = (unsigned) (str_size + name_size + 1); if (str_size) { /* try to allocate space for the string table */ if (str_count * 2 >= (int) sizeof(buf) @@ -173,14 +172,14 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) want = min(MAX_NAME_SIZE, (unsigned) name_size); ptr->str_table = string_table; ptr->term_names = string_table; - if ((have = Read(ptr->term_names, want)) != want) { + if ((have = (unsigned) Read(ptr->term_names, want)) != want) { memset(ptr->term_names + have, 0, want - have); } ptr->term_names[want] = '\0'; string_table += (want + 1); if (have > MAX_NAME_SIZE) - offset = (have - MAX_NAME_SIZE); + offset = (int) (have - MAX_NAME_SIZE); /* grab the booleans */ if ((ptr->Booleans = TYPE_CALLOC(NCURSES_SBOOL, @@ -234,7 +233,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) int ext_str_count = LOW_MSB(buf + 4); int ext_str_size = LOW_MSB(buf + 6); int ext_str_limit = LOW_MSB(buf + 8); - unsigned need = (ext_bool_count + ext_num_count + ext_str_count); + unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count); int base = 0; if (need >= sizeof(buf) @@ -247,9 +246,9 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) || ext_str_limit < 0) return (TGETENT_NO); - ptr->num_Booleans = BOOLCOUNT + ext_bool_count; - ptr->num_Numbers = NUMCOUNT + ext_num_count; - ptr->num_Strings = STRCOUNT + ext_str_count; + ptr->num_Booleans = UShort(BOOLCOUNT + ext_bool_count); + ptr->num_Numbers = UShort(NUMCOUNT + ext_num_count); + ptr->num_Strings = UShort(STRCOUNT + ext_str_count); ptr->Booleans = typeRealloc(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans); ptr->Numbers = typeRealloc(short, ptr->num_Numbers, ptr->Numbers); @@ -261,7 +260,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-booleans @%d", ext_bool_count, offset)); - if ((ptr->ext_Booleans = ext_bool_count) != 0) { + if ((ptr->ext_Booleans = UShort(ext_bool_count)) != 0) { if (Read(ptr->Booleans + BOOLCOUNT, (unsigned) ext_bool_count) != ext_bool_count) return (TGETENT_NO); @@ -270,7 +269,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-numbers @%d", ext_num_count, offset)); - if ((ptr->ext_Numbers = ext_num_count) != 0) { + if ((ptr->ext_Numbers = UShort(ext_num_count)) != 0) { if (!read_shorts(buf, ext_num_count)) return (TGETENT_NO); TR(TRACE_DATABASE, ("Before converting extended-numbers")); @@ -279,21 +278,22 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset)); if ((ext_str_count || need) - && !read_shorts(buf, ext_str_count + need)) + && !read_shorts(buf, ext_str_count + (int) need)) return (TGETENT_NO); TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d", ext_str_limit, offset)); if (ext_str_limit) { - if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0) - return (TGETENT_NO); + ptr->ext_str_table = typeMalloc(char, (size_t) ext_str_limit); + if (ptr->ext_str_table == 0) + return (TGETENT_NO); if (Read(ptr->ext_str_table, (unsigned) ext_str_limit) != ext_str_limit) return (TGETENT_NO); TR(TRACE_DATABASE, ("first extended-string is %s", _nc_visbuf(ptr->ext_str_table))); } - if ((ptr->ext_Strings = ext_str_count) != 0) { + if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) { TR(TRACE_DATABASE, ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d", str_count, ext_str_count)); @@ -305,7 +305,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) _nc_visbuf(ptr->Strings[i + str_count]))); ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count]; if (VALID_STRING(ptr->Strings[i + STRCOUNT])) - base += (strlen(ptr->Strings[i + STRCOUNT]) + 1); + base += (int) (strlen(ptr->Strings[i + STRCOUNT]) + 1); TR(TRACE_DATABASE, ("... to [%d] %s", i + STRCOUNT, _nc_visbuf(ptr->Strings[i + STRCOUNT]))); @@ -314,7 +314,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) if (need) { if (ext_str_count >= (MAX_ENTRY_SIZE * 2)) - return (TGETENT_NO); + return (TGETENT_NO); if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0) return (TGETENT_NO); TR(TRACE_DATABASE, @@ -364,16 +364,18 @@ NCURSES_EXPORT(int) _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) /* return 1 if read, 0 if not found or garbled */ { - int code, fd = -1; + FILE *fp = 0; + int code; int limit; char buffer[MAX_ENTRY_SIZE + 1]; if (_nc_access(filename, R_OK) < 0 - || (fd = open(filename, O_RDONLY | O_BINARY)) < 0) { + || (fp = fopen(filename, "rb")) == 0) { T(("cannot open terminfo %s (errno=%d)", filename, errno)); code = TGETENT_NO; } else { - if ((limit = read(fd, buffer, sizeof(buffer))) > 0) { + if ((limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp)) + > 0) { T(("read terminfo %s", filename)); if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) { @@ -382,7 +384,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) } else { code = TGETENT_NO; } - close(fd); + fclose(fp); } return (code); @@ -404,26 +406,22 @@ _nc_read_tic_entry(char *filename, /* * If we are looking in a directory, assume the entry is a file under that, * according to the normal rules. - * - * FIXME - add caseless-filename fixup. */ - if (_nc_is_dir_path(path)) { - unsigned need = 4 + strlen(path) + strlen(name); + unsigned need = (unsigned) (LEAF_LEN + 3 + strlen(path) + strlen(name)); + if (need <= limit) + (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); - if (need <= limit) { - (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); - result = _nc_read_file_entry(filename, tp); - } - } + if (_nc_is_dir_path(path)) + result = _nc_read_file_entry(filename, tp); #if USE_HASHED_DB else { static const char suffix[] = DBM_SUFFIX; DB *capdbp; unsigned lens = sizeof(suffix) - 1; unsigned size = strlen(path); - unsigned need = lens + size; + unsigned test = lens + size; - if (need <= limit) { + if (test < limit) { if (size >= lens && !strcmp(path + size - lens, suffix)) (void) strcpy(filename, path); @@ -515,6 +513,7 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) { int code = TGETENT_NO; + sprintf(filename, "%.*s", PATH_MAX - 1, name); if (strlen(name) == 0 || strcmp(name, ".") == 0 || strcmp(name, "..") == 0 diff --git a/ncurses/tinfo/read_termcap.c b/ncurses/tinfo/read_termcap.c index d94d1a42466..b39a5bebaa4 100644 --- a/ncurses/tinfo/read_termcap.c +++ b/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -56,9 +56,8 @@ #include #include #include -#include -MODULE_ID("$Id: read_termcap.c,v 1.71 2006/07/29 12:06:51 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.74 2010/01/23 17:57:43 tom Exp $") #if !PURE_TERMINFO @@ -79,6 +78,15 @@ get_termpath(void) return result; } +/* + * Note: + * getcap(), cgetent(), etc., are BSD functions. A copy of those was added to + * this file in November 1995, derived from the BSD4.4 Lite sources. + * + * The initial adaptation uses 518 lines from that source. + * The current source (in 2009) uses 183 lines of BSD4.4 Lite (441 ignoring + * whitespace). + */ #if USE_GETCAP #if HAVE_BSD_CGETENT @@ -107,11 +115,7 @@ static int _nc_nfcmp(const char *, char *); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgment: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/ncurses/tinfo/setbuf.c b/ncurses/tinfo/setbuf.c index ba910e8983a..a2e2660c866 100644 --- a/ncurses/tinfo/setbuf.c +++ b/ncurses/tinfo/setbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ /* @@ -40,7 +42,7 @@ #include -MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") +MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -98,11 +100,20 @@ MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") * buffer. So we disable this by default (there may yet be a workaround). */ NCURSES_EXPORT(void) -_nc_set_buffer(FILE *ofp, bool buffered) +NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) { + int Cols; + int Lines; + + if (0 == SP_PARM) + return; + + Cols = *(ptrCols(SP_PARM)); + Lines = *(ptrLines(SP_PARM)); + /* optional optimization hack -- do before any output to ofp */ #if HAVE_SETVBUF || HAVE_SETBUFFER - if (SP->_buffered != buffered) { + if (SP_PARM->_buffered != buffered) { unsigned buf_len; char *buf_ptr; @@ -114,11 +125,11 @@ _nc_set_buffer(FILE *ofp, bool buffered) setmode(ofp, O_BINARY); #endif if (buffered != 0) { - buf_len = min(LINES * (COLS + 6), 2800); - if ((buf_ptr = SP->_setbuf) == 0) { + buf_len = (unsigned) min(Lines * (Cols + 6), 2800); + if ((buf_ptr = SP_PARM->_setbuf) == 0) { if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) return; - SP->_setbuf = buf_ptr; + SP_PARM->_setbuf = buf_ptr; /* Don't try to free this! */ } #if !USE_SETBUF_0 @@ -144,7 +155,15 @@ _nc_set_buffer(FILE *ofp, bool buffered) (void) setbuffer(ofp, buf_ptr, (int) buf_len); #endif - SP->_buffered = buffered; + SP_PARM->_buffered = buffered; } #endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_set_buffer(FILE *ofp, bool buffered) +{ + NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered); +} +#endif diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c new file mode 100644 index 00000000000..5b3b55a4519 --- /dev/null +++ b/ncurses/tinfo/tinfo_driver.c @@ -0,0 +1,1337 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,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"), 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: Juergen Pfeifer * + * * + ****************************************************************************/ + +#include +#define CUR ((TERMINAL*)TCB)->type. +#include + +#if HAVE_NANOSLEEP +#include +#if HAVE_SYS_TIME_H +#include /* needed for MacOS X DP3 */ +#endif +#endif + +#if HAVE_SIZECHANGE +# if !defined(sun) || !TERMIOS +# if HAVE_SYS_IOCTL_H +# include +# endif +# endif +#endif + +MODULE_ID("$Id: tinfo_driver.c,v 1.13 2010/12/20 01:47:09 tom Exp $") + +/* + * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, + * Solaris, IRIX) define TIOCGWINSZ and struct winsize. + */ +#ifdef TIOCGSIZE +# define IOCTL_WINSIZE TIOCGSIZE +# define STRUCT_WINSIZE struct ttysize +# define WINSIZE_ROWS(n) (int)n.ts_lines +# define WINSIZE_COLS(n) (int)n.ts_cols +#else +# ifdef TIOCGWINSZ +# define IOCTL_WINSIZE TIOCGWINSZ +# define STRUCT_WINSIZE struct winsize +# define WINSIZE_ROWS(n) (int)n.ws_row +# define WINSIZE_COLS(n) (int)n.ws_col +# endif +#endif + +/* + * These should be screen structure members. They need to be globals for + * historical reasons. So we assign them in start_color() and also in + * set_term()'s screen-switching logic. + */ +#if USE_REENTRANT +NCURSES_EXPORT(int) +NCURSES_PUBLIC_VAR(COLOR_PAIRS) (void) +{ + return CURRENT_SCREEN ? CURRENT_SCREEN->_pair_count : -1; +} +NCURSES_EXPORT(int) +NCURSES_PUBLIC_VAR(COLORS) (void) +{ + return CURRENT_SCREEN ? CURRENT_SCREEN->_color_count : -1; +} +#else +NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; +NCURSES_EXPORT_VAR(int) COLORS = 0; +#endif + +#define TCBMAGIC NCDRV_MAGIC(NCDRV_TINFO) +#define AssertTCB() assert(TCB!=0 && TCB->magic==TCBMAGIC) +#define SetSP() assert(TCB->csp!=0); sp = TCB->csp + +/* + * This routine needs to do all the work to make curscr look + * like newscr. + */ +static int +drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + AssertTCB(); + return TINFO_DOUPDATE(TCB->csp); +} + +#define ret_error(code, fmt, arg) if (errret) {\ + *errret = code;\ + return(FALSE); \ + } else {\ + fprintf(stderr, fmt, arg);\ + exit(EXIT_FAILURE);\ + } + +#define ret_error0(code, msg) if (errret) {\ + *errret = code;\ + return(FALSE);\ + } else {\ + fprintf(stderr, msg);\ + exit(EXIT_FAILURE);\ + } + +static bool +drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) +{ + bool result = FALSE; + int status; + TERMINAL *termp; + SCREEN *sp; + + assert(TCB != 0 && tname != 0); + termp = (TERMINAL *) TCB; + sp = TCB->csp; + TCB->magic = TCBMAGIC; + +#if (USE_DATABASE || USE_TERMCAP) + status = _nc_setup_tinfo(tname, &termp->type); +#else + status = TGETENT_NO; +#endif + + /* try fallback list if entry on disk */ + if (status != TGETENT_YES) { + const TERMTYPE *fallback = _nc_fallback(tname); + + if (fallback) { + termp->type = *fallback; + status = TGETENT_YES; + } + } + + if (status != TGETENT_YES) { + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp); + if (status == TGETENT_ERR) { + ret_error0(status, "terminals database is inaccessible\n"); + } else if (status == TGETENT_NO) { + ret_error(status, "'%s': unknown terminal type.\n", tname); + } + } + result = TRUE; +#if !USE_REENTRANT + strncpy(ttytype, termp->type.term_names, NAMESIZE - 1); + ttytype[NAMESIZE - 1] = '\0'; +#endif + + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); + + if (generic_type) { + ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); + } + if (hard_copy) { + ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); + } + + return result; +} + +static int +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bool beepFlag) +{ + SCREEN *sp; + int res = ERR; + + AssertTCB(); + SetSP(); + + /* FIXME: should make sure that we are not in altchar mode */ + if (beepFlag) { + if (bell) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); + NCURSES_SP_NAME(_nc_flush) (sp); + } else if (flash_screen) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "flash_screen", + flash_screen); + NCURSES_SP_NAME(_nc_flush) (sp); + } + } else { + if (flash_screen) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "flash_screen", + flash_screen); + NCURSES_SP_NAME(_nc_flush) (sp); + } else if (bell) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); + NCURSES_SP_NAME(_nc_flush) (sp); + } + } + return res; +} + +/* + * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly + * to maintain compatibility with a pre-ANSI scheme. The same scheme is + * also used in the FreeBSD syscons. + */ +static int +toggled_colors(int c) +{ + if (c < 16) { + static const int table[] = + {0, 4, 2, 6, 1, 5, 3, 7, + 8, 12, 10, 14, 9, 13, 11, 15}; + c = table[c]; + } + return c; +} + +static int +drv_print(TERMINAL_CONTROL_BLOCK * TCB, char *data, int len) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +#if NCURSES_EXT_FUNCS + return NCURSES_SP_NAME(mcprint) (TCB->csp, data, len); +#else + return ERR; +#endif +} + +static int +drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, int fg, int bg) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + if (sp != 0 && orig_pair && orig_colors && (initialize_pair != 0)) { +#if NCURSES_EXT_FUNCS + sp->_default_color = isDefaultColor(fg) || isDefaultColor(bg); + sp->_has_sgr_39_49 = (NCURSES_SP_NAME(tigetflag) (NCURSES_SP_ARGx + "AX") + == TRUE); + sp->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK); + sp->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK); + if (sp->_color_pairs != 0) { + bool save = sp->_default_color; + sp->_default_color = TRUE; + NCURSES_SP_NAME(init_pair) (NCURSES_SP_ARGx + 0, + (short)fg, + (short)bg); + sp->_default_color = save; + } +#endif + code = OK; + } + return (code); +} + +static void +drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + bool fore, + int color, + NCURSES_SP_OUTC outc) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (fore) { + if (set_a_foreground) { + TPUTS_TRACE("set_a_foreground"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_a_foreground, color), 1, outc); + } else { + TPUTS_TRACE("set_foreground"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_foreground, + toggled_colors(color)), 1, outc); + } + } else { + if (set_a_background) { + TPUTS_TRACE("set_a_background"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_a_background, color), 1, outc); + } else { + TPUTS_TRACE("set_background"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_background, + toggled_colors(color)), 1, outc); + } + } +} + +static bool +drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (orig_pair != 0) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair); + result = TRUE; + } + return result; +} + +static bool +drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (orig_colors != 0) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors); + result = TRUE; + } + return result; +} + +static int +drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) +{ + SCREEN *sp; + bool useEnv = TRUE; + + AssertTCB(); + sp = TCB->csp; /* can be null here */ + + if (sp) { + useEnv = sp->_use_env; + } else + useEnv = _nc_prescreen.use_env; + + /* figure out the size of the screen */ + T(("screen size: terminfo lines = %d columns = %d", lines, columns)); + + *linep = (int) lines; + *colp = (int) columns; + + if (useEnv) { + int value; + +#ifdef __EMX__ + { + int screendata[2]; + _scrsize(screendata); + *colp = screendata[0]; + *linep = screendata[1]; + T(("EMX screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + } +#endif +#if HAVE_SIZECHANGE + /* try asking the OS */ + { + TERMINAL *termp = (TERMINAL *) TCB; + if (isatty(termp->Filedes)) { + STRUCT_WINSIZE size; + + errno = 0; + do { + if (ioctl(termp->Filedes, IOCTL_WINSIZE, &size) >= 0) { + *linep = ((sp != 0 && sp->_filtered) + ? 1 + : WINSIZE_ROWS(size)); + *colp = WINSIZE_COLS(size); + T(("SYS screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + break; + } + } while + (errno == EINTR); + } + } +#endif /* HAVE_SIZECHANGE */ + + /* + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. + */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); + } + + /* if we can't get dynamic info about the size, use static */ + if (*linep <= 0) { + *linep = (int) lines; + } + if (*colp <= 0) { + *colp = (int) columns; + } + + /* the ultimate fallback, assume fixed 24x80 size */ + if (*linep <= 0) { + *linep = 24; + } + if (*colp <= 0) { + *colp = 80; + } + + /* + * Put the derived values back in the screen-size caps, so + * tigetnum() and tgetnum() will do the right thing. + */ + lines = (short) (*linep); + columns = (short) (*colp); + } + + T(("screen size is %dx%d", *linep, *colp)); + return OK; +} + +static int +drv_getsize(TERMINAL_CONTROL_BLOCK * TCB, int *l, int *c) +{ + AssertTCB(); + assert(l != 0 && c != 0); + *l = lines; + *c = columns; + return OK; +} + +static int +drv_setsize(TERMINAL_CONTROL_BLOCK * TCB, int l, int c) +{ + AssertTCB(); + lines = (short) l; + columns = (short) c; + return OK; +} + +static int +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +{ + SCREEN *sp = TCB->csp; + TERMINAL *_term = (TERMINAL *) TCB; + int result = OK; + + AssertTCB(); + if (setFlag) { + for (;;) { + if (SET_TTY(_term->Filedes, buf) != 0) { + if (errno == EINTR) + continue; + if (errno == ENOTTY) { + if (sp) + sp->_notty = TRUE; + } + result = ERR; + } + break; + } + } else { + for (;;) { + if (GET_TTY(_term->Filedes, buf) != 0) { + if (errno == EINTR) + continue; + result = ERR; + } + break; + } + } + return result; +} + +static int +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + if (progFlag) /* prog mode */ + { + if (defFlag) { + /* def_prog_mode */ + /* + * Turn off the XTABS bit in the tty structure if it was on. + */ + if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { +#ifdef TERMIOS + _term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS; +#else + _term->Nttyb.sg_flags &= (unsigned) ~XTABS; +#endif + code = OK; + } + } else { + /* reset_prog_mode */ + if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + NC_BUFFERED(sp, TRUE); + } + code = OK; + } + } + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + /* + * If XTABS was on, remove the tab and backtab capabilities. + */ + if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { +#ifdef TERMIOS + if (_term->Ottyb.c_oflag & OFLAGS_TABS) + tab = back_tab = NULL; +#else + if (_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; +#endif + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + NC_BUFFERED(sp, FALSE); + } + code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + } + } + return (code); +} + +static void +drv_wrap(SCREEN *sp) +{ + if (sp) { + sp->_mouse_wrap(sp); + NCURSES_SP_NAME(_nc_screen_wrap) (sp); + NCURSES_SP_NAME(_nc_mvcur_wrap) (sp); /* wrap up cursor addressing */ + } +} + +static void +drv_release(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ +} + +# define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) + +static void +drv_screen_init(SCREEN *sp) +{ + TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp); + + AssertTCB(); + + /* + * Check for mismatched graphic-rendition capabilities. Most SVr4 + * terminfo trees contain entries that have rmul or rmso equated to + * sgr0 (Solaris curses copes with those entries). We do this only + * for curses, since many termcap applications assume that + * smso/rmso and smul/rmul are paired, and will not function + * properly if we remove rmso or rmul. Curses applications + * shouldn't be looking at this detail. + */ + sp->_use_rmso = SGR0_TEST(exit_standout_mode); + sp->_use_rmul = SGR0_TEST(exit_underline_mode); + + /* + * Check whether we can optimize scrolling under dumb terminals in + * case we do not have any of these capabilities, scrolling + * optimization will be useless. + */ + sp->_scrolling = ((scroll_forward && scroll_reverse) || + ((parm_rindex || + parm_insert_line || + insert_line) && + (parm_index || + parm_delete_line || + delete_line))); + + NCURSES_SP_NAME(baudrate) (sp); + + NCURSES_SP_NAME(_nc_mvcur_init) (sp); + /* initialize terminal to a sane state */ + NCURSES_SP_NAME(_nc_screen_init) (sp); +} + +static void +drv_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + TERMINAL *trm; + + AssertTCB(); + + trm = (TERMINAL *) TCB; + sp = TCB->csp; + + TCB->info.initcolor = initialize_color; + TCB->info.canchange = can_change; + TCB->info.hascolor = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs) + && (((set_foreground != NULL) + && (set_background != NULL)) + || ((set_a_foreground != NULL) + && (set_a_background != NULL)) + || set_color_pair)) ? TRUE : FALSE); + + TCB->info.caninit = !(exit_ca_mode && non_rev_rmcup); + + TCB->info.maxpairs = VALID_NUMERIC(max_pairs) ? max_pairs : 0; + TCB->info.maxcolors = VALID_NUMERIC(max_colors) ? max_colors : 0; + TCB->info.numlabels = VALID_NUMERIC(num_labels) ? num_labels : 0; + TCB->info.labelwidth = VALID_NUMERIC(label_width) ? label_width : 0; + TCB->info.labelheight = VALID_NUMERIC(label_height) ? label_height : 0; + TCB->info.nocolorvideo = VALID_NUMERIC(no_color_video) ? no_color_video + : 0; + TCB->info.tabsize = VALID_NUMERIC(init_tabs) ? (int) init_tabs : 8; + + TCB->info.defaultPalette = hue_lightness_saturation ? _nc_hls_palette : _nc_cga_palette; + + /* + * If an application calls setupterm() rather than initscr() or + * newterm(), we will not have the def_prog_mode() call in + * _nc_setupscreen(). Do it now anyway, so we can initialize the + * baudrate. + */ + if (isatty(trm->Filedes)) { + TCB->drv->mode(TCB, TRUE, TRUE); + } +} + +#define MAX_PALETTE 8 +#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE) + +static void +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, short pair, short f, short b) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if ((initialize_pair != NULL) && InPalette(f) && InPalette(b)) { + const color_t *tp = InfoOf(sp).defaultPalette; + + TR(TRACE_ATTRS, + ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)", + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); + + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "initialize_pair", + TPARM_7(initialize_pair, + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); + } +} + +static int +default_fg(SCREEN *sp) +{ +#if NCURSES_EXT_FUNCS + return (sp != 0) ? sp->_default_fg : COLOR_WHITE; +#else + return COLOR_WHITE; +#endif +} + +static int +default_bg(SCREEN *sp) +{ +#if NCURSES_EXT_FUNCS + return sp != 0 ? sp->_default_bg : COLOR_BLACK; +#else + return COLOR_BLACK; +#endif +} + +static void +drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + short color, short r, short g, short b) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (initialize_color != NULL) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "initialize_color", + TPARM_4(initialize_color, color, r, g, b)); + } +} + +static void +drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, + short old_pair, + short pair, + bool reverse, + NCURSES_SP_OUTC outc) +{ + SCREEN *sp = TCB->csp; + NCURSES_COLOR_T fg = COLOR_DEFAULT; + NCURSES_COLOR_T bg = COLOR_DEFAULT; + NCURSES_COLOR_T old_fg, old_bg; + + AssertTCB(); + if (sp == 0) + return; + + if (pair < 0 || pair >= COLOR_PAIRS) { + return; + } else if (pair != 0) { + if (set_color_pair) { + TPUTS_TRACE("set_color_pair"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_color_pair, pair), 1, outc); + return; + } else if (sp != 0) { + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, + &bg); + } + } + + if (old_pair >= 0 + && sp != 0 + && NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + old_pair, + &old_fg, + &old_bg) !=ERR) { + if ((isDefaultColor(fg) && !isDefaultColor(old_fg)) + || (isDefaultColor(bg) && !isDefaultColor(old_bg))) { +#if NCURSES_EXT_FUNCS + /* + * A minor optimization - but extension. If "AX" is specified in + * the terminal description, treat it as screen's indicator of ECMA + * SGR 39 and SGR 49, and assume the two sequences are independent. + */ + if (sp->_has_sgr_39_49 + && isDefaultColor(old_bg) + && !isDefaultColor(old_fg)) { + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc); + } else if (sp->_has_sgr_39_49 + && isDefaultColor(old_fg) + && !isDefaultColor(old_bg)) { + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc); + } else +#endif + drv_rescol(TCB); + } + } else { + drv_rescol(TCB); + if (old_pair < 0) + return; + } + +#if NCURSES_EXT_FUNCS + if (isDefaultColor(fg)) + fg = (NCURSES_COLOR_T) default_fg(sp); + if (isDefaultColor(bg)) + bg = (NCURSES_COLOR_T) default_bg(sp); +#endif + + if (reverse) { + NCURSES_COLOR_T xx = fg; + fg = bg; + bg = xx; + } + + TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, + fg, bg)); + + if (!isDefaultColor(fg)) { + drv_setcolor(TCB, TRUE, fg, outc); + } + if (!isDefaultColor(bg)) { + drv_setcolor(TCB, FALSE, bg, outc); + } +} + +#define xterm_kmous "\033[M" +static void +init_xterm_mouse(SCREEN *sp) +{ + sp->_mouse_type = M_XTERM; + sp->_mouse_xtermcap = NCURSES_SP_NAME(tigetstr) (NCURSES_SP_ARGx "XM"); + if (!VALID_STRING(sp->_mouse_xtermcap)) + sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;"; +} + +static void +drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + /* we know how to recognize mouse events under "xterm" */ + if (sp != 0) { + if (key_mouse != 0) { + if (!strcmp(key_mouse, xterm_kmous) + || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { + init_xterm_mouse(sp); + } + } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { + if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK) + init_xterm_mouse(sp); + } + } +} + +static int +drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) +{ + int rc = 0; + SCREEN *sp; + + AssertTCB(); + SetSP(); + +#if USE_SYSMOUSE + if ((sp->_mouse_type == M_SYSMOUSE) + && (sp->_sysmouse_head < sp->_sysmouse_tail)) { + rc = TW_MOUSE; + } else +#endif + { + rc = TCBOf(sp)->drv->twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); +#if USE_SYSMOUSE + if ((sp->_mouse_type == M_SYSMOUSE) + && (sp->_sysmouse_head < sp->_sysmouse_tail) + && (rc == 0) + && (errno == EINTR)) { + rc |= TW_MOUSE; + } +#endif + } + return rc; +} + +static int +drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew) +{ + SCREEN *sp = TCB->csp; + AssertTCB(); + return TINFO_MVCUR(sp, yold, xold, ynew, xnew); +} + +static void +drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (labnum > 0 && labnum <= num_labels) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "plab_norm", + TPARM_2(plab_norm, labnum, text)); + } +} + +static void +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, bool OnFlag) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (OnFlag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off); + } +} + +static chtype +drv_conattr(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp = TCB->csp; + chtype attrs = A_NORMAL; + + AssertTCB(); + if (enter_alt_charset_mode) + attrs |= A_ALTCHARSET; + + if (enter_blink_mode) + attrs |= A_BLINK; + + if (enter_bold_mode) + attrs |= A_BOLD; + + if (enter_dim_mode) + attrs |= A_DIM; + + if (enter_reverse_mode) + attrs |= A_REVERSE; + + if (enter_standout_mode) + attrs |= A_STANDOUT; + + if (enter_protected_mode) + attrs |= A_PROTECT; + + if (enter_secure_mode) + attrs |= A_INVIS; + + if (enter_underline_mode) + attrs |= A_UNDERLINE; + + if (sp && sp->_coloron) + attrs |= A_COLOR; + + return (attrs); +} + +static void +drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + AssertTCB(); + + clear_screen = 0; + cursor_down = parm_down_cursor = 0; + cursor_address = 0; + cursor_up = parm_up_cursor = 0; + row_address = 0; + cursor_home = carriage_return; +} + +static void +drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + assert(sp != 0); + if (ena_acs != NULL) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs); + } +#if NCURSES_EXT_FUNCS + /* + * Linux console "supports" the "PC ROM" character set by the coincidence + * that smpch/rmpch and smacs/rmacs have the same values. ncurses has + * no codepage support (see SCO Merge for an example). Outside of the + * values defined in acsc, there are no definitions for the "PC ROM" + * character set (assumed by some applications to be codepage 437), but we + * allow those applications to use those codepoints. + * + * test/blue.c uses this feature. + */ +#define PCH_KLUDGE(a,b) (a != 0 && b != 0 && !strcmp(a,b)) + if (PCH_KLUDGE(enter_pc_charset_mode, enter_alt_charset_mode) && + PCH_KLUDGE(exit_pc_charset_mode, exit_alt_charset_mode)) { + size_t i; + for (i = 1; i < ACS_LEN; ++i) { + if (real_map[i] == 0) { + real_map[i] = i; + if (real_map != fake_map) { + if (sp != 0) + sp->_screen_acs_map[i] = TRUE; + } + } + } + } +#endif + + if (acs_chars != NULL) { + size_t i = 0; + size_t length = strlen(acs_chars); + + while (i + 1 < length) { + if (acs_chars[i] != 0 && UChar(acs_chars[i]) < ACS_LEN) { + real_map[UChar(acs_chars[i])] = UChar(acs_chars[i + 1]) | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[UChar(acs_chars[i])] = TRUE; + } + i += 2; + } + } +#ifdef TRACE + /* Show the equivalent mapping, noting if it does not match the + * given attribute, whether by re-ordering or duplication. + */ + if (USE_TRACEF(TRACE_CALLS)) { + size_t n, m; + char show[ACS_LEN * 2 + 1]; + for (n = 1, m = 0; n < ACS_LEN; n++) { + if (real_map[n] != 0) { + show[m++] = (char) n; + show[m++] = (char) ChCharOf(real_map[n]); + } + } + show[m] = 0; + if (acs_chars == NULL || strcmp(acs_chars, show)) + _tracef("%s acs_chars %s", + (acs_chars == NULL) ? "NULL" : "READ", + _nc_visbuf(acs_chars)); + _tracef("%s acs_chars %s", + (acs_chars == NULL) + ? "NULL" + : (strcmp(acs_chars, show) + ? "DIFF" + : "SAME"), + _nc_visbuf(show)); + + _nc_unlock_global(tracef); + } +#endif /* TRACE */ +} + +#define ENSURE_TINFO(sp) (TCBOf(sp)->drv->isTerminfo) + +NCURSES_EXPORT(void) +_nc_cookie_init(SCREEN *sp) +{ + bool support_cookies = USE_XMC_SUPPORT; + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) (sp->_term); + + if (sp == 0 || !ENSURE_TINFO(sp)) + return; + +#if USE_XMC_SUPPORT + /* + * If we have no magic-cookie support compiled-in, or if it is suppressed + * in the environment, reset the support-flag. + */ + if (magic_cookie_glitch >= 0) { + if (getenv("NCURSES_NO_MAGIC_COOKIE") != 0) { + support_cookies = FALSE; + } + } +#endif + + if (!support_cookies && magic_cookie_glitch >= 0) { + T(("will disable attributes to work w/o magic cookies")); + } + + if (magic_cookie_glitch > 0) { /* tvi, wyse */ + + sp->_xmc_triggers = sp->_ok_attributes & ( + A_STANDOUT | + A_UNDERLINE | + A_REVERSE | + A_BLINK | + A_DIM | + A_BOLD | + A_INVIS | + A_PROTECT + ); +#if 0 + /* + * We "should" treat colors as an attribute. The wyse350 (and its + * clones) appear to be the only ones that have both colors and magic + * cookies. + */ + if (has_colors()) { + sp->_xmc_triggers |= A_COLOR; + } +#endif + sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD); + + T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress))); + /* + * Supporting line-drawing may be possible. But make the regular + * video attributes work first. + */ + acs_chars = ABSENT_STRING; + ena_acs = ABSENT_STRING; + enter_alt_charset_mode = ABSENT_STRING; + exit_alt_charset_mode = ABSENT_STRING; +#if USE_XMC_SUPPORT + /* + * To keep the cookie support simple, suppress all of the optimization + * hooks except for clear_screen and the cursor addressing. + */ + if (support_cookies) { + clr_eol = ABSENT_STRING; + clr_eos = ABSENT_STRING; + set_attributes = ABSENT_STRING; + } +#endif + } else if (magic_cookie_glitch == 0) { /* hpterm */ + } + + /* + * If magic cookies are not supported, cancel the strings that set + * video attributes. + */ + if (!support_cookies && magic_cookie_glitch >= 0) { + magic_cookie_glitch = ABSENT_NUMERIC; + set_attributes = ABSENT_STRING; + enter_blink_mode = ABSENT_STRING; + enter_bold_mode = ABSENT_STRING; + enter_dim_mode = ABSENT_STRING; + enter_reverse_mode = ABSENT_STRING; + enter_standout_mode = ABSENT_STRING; + enter_underline_mode = ABSENT_STRING; + } + + /* initialize normal acs before wide, since we use mapping in the latter */ +#if !USE_WIDEC_SUPPORT + if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) { + acs_chars = NULL; + ena_acs = NULL; + enter_alt_charset_mode = NULL; + exit_alt_charset_mode = NULL; + set_attributes = NULL; + } +#endif +} + +static int +drv_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return _nc_timed_wait(sp, mode, milliseconds, timeleft EVENTLIST_2nd(evl)); +} + +static int +drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + unsigned char c2 = 0; + int n; + + AssertTCB(); + assert(buf); + SetSP(); + +# if USE_PTHREADS_EINTR + if ((pthread_self) && (pthread_kill) && (pthread_equal)) + _nc_globals.read_thread = pthread_self(); +# endif + n = read(sp->_ifd, &c2, 1); +#if USE_PTHREADS_EINTR + _nc_globals.read_thread = 0; +#endif + *buf = (int) c2; + return n; +} + +static int +drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ +#if HAVE_NANOSLEEP + { + struct timespec request, remaining; + request.tv_sec = ms / 1000; + request.tv_nsec = (ms % 1000) * 1000000; + while (nanosleep(&request, &remaining) == -1 + && errno == EINTR) { + request = remaining; + } + } +#else + _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); +#endif + return OK; +} + +static int +__nc_putp(SCREEN *sp, const char *name GCC_UNUSED, const char *value) +{ + int rc = ERR; + + if (value) { + rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); + } + return rc; +} + +static int +__nc_putp_flush(SCREEN *sp, const char *name, const char *value) +{ + int rc = __nc_putp(sp, name, value); + if (rc != ERR) { + NCURSES_SP_NAME(_nc_flush) (sp); + } + return rc; +} + +static int +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag) +{ + int ret = ERR; + SCREEN *sp; + + AssertTCB(); + + sp = TCB->csp; + + if (sp) { + if (flag) { + (void) __nc_putp_flush(sp, "keypad_xmit", keypad_xmit); + } else if (!flag && keypad_local) { + (void) __nc_putp_flush(sp, "keypad_local", keypad_local); + } + if (flag && !sp->_tried) { + _nc_init_keytry(sp); + sp->_tried = TRUE; + } + ret = OK; + } + + return ret; +} + +static int +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) +{ + SCREEN *sp; + int code = ERR; + int count = 0; + char *s; + + AssertTCB(); + SetSP(); + + if (c >= 0) { + unsigned ch = (unsigned) c; + if (flag) { + while ((s = _nc_expand_try(sp->_key_ok, ch, &count, 0)) != 0 + && _nc_remove_key(&(sp->_key_ok), ch)) { + code = _nc_add_to_try(&(sp->_keytry), s, ch); + free(s); + count = 0; + if (code != OK) + break; + } + } else { + while ((s = _nc_expand_try(sp->_keytry, ch, &count, 0)) != 0 + && _nc_remove_key(&(sp->_keytry), ch)) { + code = _nc_add_to_try(&(sp->_key_ok), s, ch); + free(s); + count = 0; + if (code != OK) + break; + } + } + } + return (code); +} + +static bool +drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key) +{ + bool res = FALSE; + + AssertTCB(); + if (TCB->csp) + res = TINFO_HAS_KEY(TCB->csp, key) == 0 ? FALSE : TRUE; + + return res; +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = { + TRUE, + drv_CanHandle, /* CanHandle */ + drv_init, /* init */ + drv_release, /* release */ + drv_size, /* size */ + drv_sgmode, /* sgmode */ + drv_conattr, /* conattr */ + drv_mvcur, /* hwcur */ + drv_mode, /* mode */ + drv_rescol, /* rescol */ + drv_rescolors, /* rescolors */ + drv_setcolor, /* color */ + drv_dobeepflash, /* doBeepOrFlash */ + drv_initpair, /* initpair */ + drv_initcolor, /* initcolor */ + drv_do_color, /* docolor */ + drv_initmouse, /* initmouse */ + drv_testmouse, /* testmouse */ + drv_setfilter, /* setfilter */ + drv_hwlabel, /* hwlabel */ + drv_hwlabelOnOff, /* hwlabelOnOff */ + drv_doupdate, /* update */ + drv_defaultcolors, /* defaultcolors */ + drv_print, /* print */ + drv_getsize, /* getsize */ + drv_setsize, /* setsize */ + drv_initacs, /* initacs */ + drv_screen_init, /* scinit */ + drv_wrap, /* scexit */ + drv_twait, /* twait */ + drv_read, /* read */ + drv_nap, /* nap */ + drv_kpad, /* kpad */ + drv_keyok, /* kyOk */ + drv_kyExist /* kyExist */ +}; diff --git a/ncurses/tinfo/trim_sgr0.c b/ncurses/tinfo/trim_sgr0.c index 80c8f77fbeb..1f99208667e 100644 --- a/ncurses/tinfo/trim_sgr0.c +++ b/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2005-2007,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 * @@ -35,9 +35,8 @@ #include #include -#include -MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $") #undef CUR #define CUR tp-> @@ -100,8 +99,8 @@ rewrite_sgr(char *s, char *attr) { if (PRESENT(s)) { if (PRESENT(attr)) { - unsigned len_s = strlen(s); - unsigned len_a = strlen(attr); + size_t len_s = strlen(s); + size_t len_a = strlen(attr); if (len_s > len_a && !strncmp(attr, s, len_a)) { unsigned n; @@ -124,8 +123,8 @@ similar_sgr(char *a, char *b) bool result = FALSE; int csi_a = is_csi(a); int csi_b = is_csi(b); - unsigned len_a; - unsigned len_b; + size_t len_a; + size_t len_b; TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s", _nc_visbuf2(1, a), @@ -170,13 +169,13 @@ chop_out(char *string, unsigned i, unsigned j) * Returns the number of chars from 'full' that we matched. If any mismatch * occurs, return zero. */ -static int +static unsigned compare_part(const char *part, const char *full) { const char *next_part; const char *next_full; - int used_full = 0; - int used_delay = 0; + unsigned used_full = 0; + unsigned used_delay = 0; while (*part != 0) { if (*part != *full) { @@ -199,7 +198,7 @@ compare_part(const char *part, const char *full) next_part = skip_delay(part); next_full = skip_delay(full); if (next_part != part && next_full != full) { - used_delay += (next_full - full); + used_delay += (unsigned) (next_full - full); full = next_full; part = next_part; continue; @@ -261,10 +260,11 @@ _nc_trim_sgr0(TERMTYPE *tp) k = strlen(exit_alt_charset_mode); if (j > k) { for (i = 0; i <= (j - k); ++i) { - int k2 = compare_part(exit_alt_charset_mode, off + i); + unsigned k2 = compare_part(exit_alt_charset_mode, + off + i); if (k2 != 0) { found = TRUE; - chop_out(off, i, i + k2); + chop_out(off, (unsigned) i, (unsigned) (i + k2)); break; } } @@ -274,18 +274,18 @@ _nc_trim_sgr0(TERMTYPE *tp) * SGR 10 would reset to normal font. */ if (!found) { - if ((i = is_csi(off)) != 0 + if ((i = (size_t) is_csi(off)) != 0 && off[strlen(off) - 1] == 'm') { TR(TRACE_DATABASE, ("looking for SGR 10 in %s", _nc_visbuf(off))); tmp = skip_zero(off + i); if (tmp[0] == '1' && skip_zero(tmp + 1) != tmp + 1) { - i = tmp - off; + i = (size_t) (tmp - off); if (off[i - 1] == ';') i--; - j = skip_zero(tmp + 1) - off; - i = chop_out(off, i, j); + j = (size_t) (skip_zero(tmp + 1) - off); + (void) chop_out(off, (unsigned) i, (unsigned) j); found = TRUE; } } @@ -293,10 +293,10 @@ _nc_trim_sgr0(TERMTYPE *tp) if (!found && (tmp = strstr(end, off)) != 0 && strcmp(end, off) != 0) { - i = tmp - end; + i = (size_t) (tmp - end); j = strlen(off); tmp = strdup(end); - chop_out(tmp, i, j); + chop_out(tmp, (unsigned) i, (unsigned) j); free(off); result = tmp; } diff --git a/ncurses/tinfo/use_screen.c b/ncurses/tinfo/use_screen.c index 6c3b12fb923..6a0297cebd5 100644 --- a/ncurses/tinfo/use_screen.c +++ b/ncurses/tinfo/use_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: use_screen.c,v 1.6 2008/06/07 19:16:56 tom Exp $") +MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $") NCURSES_EXPORT(int) use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) @@ -40,14 +40,14 @@ use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) SCREEN *save_SP; int code = OK; - T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data)); + T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data)); /* * FIXME - add a flag so a given thread can check if _it_ has already * recurred through this point, return an error if so. */ _nc_lock_global(curses); - save_SP = SP; + save_SP = CURRENT_SCREEN; set_term(screen); code = func(screen, data); diff --git a/ncurses/tinfo/write_entry.c b/ncurses/tinfo/write_entry.c index b53bb210230..a86c11267e9 100644 --- a/ncurses/tinfo/write_entry.c +++ b/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -42,7 +42,6 @@ #include #include -#include #ifndef S_ISDIR #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) @@ -54,7 +53,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.72 2008/08/03 19:24:00 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.78 2010/12/25 23:23:08 tom Exp $") static int total_written; @@ -137,10 +136,12 @@ make_db_path(char *dst, const char *src, unsigned limit) if (_nc_is_dir_path(dst)) { rc = -1; } else { + static const char suffix[] = DBM_SUFFIX; unsigned have = strlen(dst); - if (have > 3 && strcmp(dst + have - 3, DBM_SUFFIX)) { - if (have + 3 <= limit) - strcat(dst, DBM_SUFFIX); + unsigned need = strlen(suffix); + if (have > need && strcmp(dst + have - need, suffix)) { + if (have + need <= limit) + strcat(dst, suffix); else rc = -1; } @@ -171,7 +172,11 @@ make_db_root(const char *path) struct stat statbuf; if ((rc = stat(path, &statbuf)) < 0) { - rc = mkdir(path, 0777); + rc = mkdir(path +#if !defined(__MINGW32__) + ,0777 +#endif + ); } else if (_nc_access(path, R_OK | W_OK | X_OK) < 0) { rc = -1; /* permission denied */ } else if (!(S_ISDIR(statbuf.st_mode))) { @@ -338,6 +343,7 @@ _nc_write_entry(TERMTYPE *const tp) while (*other_names != '\0') { ptr = other_names++; + assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; @@ -357,7 +363,7 @@ _nc_write_entry(TERMTYPE *const tp) start_time = 0; } - if (strlen(first_name) >= sizeof(filename) - 3) + if (strlen(first_name) >= sizeof(filename) - (2 + LEAF_LEN)) _nc_warning("terminal name too long."); sprintf(filename, LEAF_FMT "/%s", first_name[0], first_name); @@ -385,14 +391,13 @@ _nc_write_entry(TERMTYPE *const tp) } while (*other_names != '\0') { ptr = other_names++; - assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; if (*other_names != '\0') *(other_names++) = '\0'; - if (strlen(ptr) > sizeof(linkname) - 3) { + if (strlen(ptr) > sizeof(linkname) - (2 + LEAF_LEN)) { _nc_warning("terminal alias %s too long.", ptr); continue; } @@ -414,8 +419,12 @@ _nc_write_entry(TERMTYPE *const tp) { int code; #if USE_SYMLINKS - strcpy(symlinkname, "../"); - strncat(symlinkname, filename, sizeof(symlinkname) - 4); + if (first_name[0] == linkname[0]) + strncpy(symlinkname, first_name, sizeof(symlinkname) - 1); + else { + strcpy(symlinkname, "../"); + strncat(symlinkname, filename, sizeof(symlinkname) - 4); + } symlinkname[sizeof(symlinkname) - 1] = '\0'; #endif /* USE_SYMLINKS */ #if HAVE_REMOVE @@ -460,26 +469,26 @@ _nc_write_entry(TERMTYPE *const tp) #endif /* USE_HASHED_DB */ } -static unsigned +static size_t fake_write(char *dst, unsigned *offset, - unsigned limit, + size_t limit, char *src, - unsigned want, - unsigned size) + size_t want, + size_t size) { - int have = (limit - *offset); + size_t have = (limit - *offset); want *= size; if (have > 0) { - if ((int) want > have) + if (want > have) want = have; memcpy(dst + *offset, src, want); - *offset += want; + *offset += (unsigned) want; } else { want = 0; } - return (int) (want / size); + return (want / size); } #define Write(buf, size, count) fake_write(buffer, offset, limit, (char *) buf, count, size) @@ -487,15 +496,16 @@ fake_write(char *dst, #undef LITTLE_ENDIAN /* BSD/OS defines this as a feature macro */ #define HI(x) ((x) / 256) #define LO(x) ((x) % 256) -#define LITTLE_ENDIAN(p, x) (p)[0] = LO(x), (p)[1] = HI(x) +#define LITTLE_ENDIAN(p, x) (p)[0] = (unsigned char)LO(x), \ + (p)[1] = (unsigned char)HI(x) #define WRITE_STRING(str) (Write(str, sizeof(char), strlen(str) + 1) == strlen(str) + 1) static int -compute_offsets(char **Strings, unsigned strmax, short *offsets) +compute_offsets(char **Strings, size_t strmax, short *offsets) { - size_t nextfree = 0; - unsigned i; + int nextfree = 0; + size_t i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -503,8 +513,8 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } else if (Strings[i] == CANCELLED_STRING) { offsets[i] = -2; } else { - offsets[i] = nextfree; - nextfree += strlen(Strings[i]) + 1; + offsets[i] = (short) nextfree; + nextfree += (int) strlen(Strings[i]) + 1; TRACE_OUT(("put Strings[%d]=%s(%d)", (int) i, _nc_visbuf(Strings[i]), (int) nextfree)); } @@ -513,9 +523,9 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, unsigned count) +convert_shorts(unsigned char *buf, short *Numbers, size_t count) { - unsigned i; + size_t i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; @@ -524,7 +534,7 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) buf[2 * i + 1] = 0377; } else { LITTLE_ENDIAN(buf + 2 * i, Numbers[i]); - TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i])); + TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i])); } } } @@ -536,8 +546,8 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) static unsigned extended_Booleans(TERMTYPE *tp) { - unsigned short result = 0; - unsigned short i; + unsigned result = 0; + unsigned i; for (i = 0; i < tp->ext_Booleans; ++i) { if (tp->Booleans[BOOLCOUNT + i] == TRUE) @@ -549,8 +559,8 @@ extended_Booleans(TERMTYPE *tp) static unsigned extended_Numbers(TERMTYPE *tp) { - unsigned short result = 0; - unsigned short i; + unsigned result = 0; + unsigned i; for (i = 0; i < tp->ext_Numbers; ++i) { if (tp->Numbers[NUMCOUNT + i] != ABSENT_NUMERIC) @@ -567,7 +577,7 @@ extended_Strings(TERMTYPE *tp) for (i = 0; i < tp->ext_Strings; ++i) { if (tp->Strings[STRCOUNT + i] != ABSENT_STRING) - result = (i + 1); + result = (unsigned short) (i + 1); } return result; } @@ -597,7 +607,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) size_t namelen, boolmax, nummax, strmax; char zero = '\0'; size_t i; - short nextfree; + int nextfree; short offsets[MAX_ENTRY_SIZE / 2]; unsigned char buf[MAX_ENTRY_SIZE]; unsigned last_bool = BOOLWRITE; @@ -690,7 +700,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) #if NCURSES_XNAMES if (extended_object(tp)) { - unsigned extcnt = NUM_EXT_NAMES(tp); + unsigned extcnt = (unsigned) NUM_EXT_NAMES(tp); if (even_boundary(nextfree)) return (ERR); diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 743b1f64f1a..a726901d4a3 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -46,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -56,26 +57,26 @@ NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ NCURSES_EXPORT(const char *) NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void) { - return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace; + return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace; } NCURSES_EXPORT(long) NCURSES_PUBLIC_VAR(_nc_outchars) (void) { - return SP ? SP->_outchars : _nc_prescreen._outchars; + return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars; } NCURSES_EXPORT(void) _nc_set_tputs_trace(const char *s) { - if (SP) - SP->_tputs_trace = s; + if (CURRENT_SCREEN) + CURRENT_SCREEN->_tputs_trace = s; else _nc_prescreen._tputs_trace = s; } NCURSES_EXPORT(void) _nc_count_outchars(long increment) { - if (SP) - SP->_outchars += increment; + if (CURRENT_SCREEN) + CURRENT_SCREEN->_outchars += increment; else _nc_prescreen._outchars += increment; } @@ -95,7 +96,7 @@ trace(const unsigned int tracelevel) const char *mode = _nc_globals.init_trace ? "ab" : "wb"; if (TracePath[0] == '\0') { - int size = sizeof(TracePath) - 12; + size_t size = sizeof(TracePath) - 12; if (getcwd(TracePath, size) == 0) { perror("curses: Can't get working directory"); exit(EXIT_FAILURE); @@ -121,7 +122,7 @@ trace(const unsigned int tracelevel) */ #if HAVE_SETVBUF /* ANSI */ (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); -#elif HAVE_SETBUF /* POSIX */ +#elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif _tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)", @@ -183,7 +184,11 @@ _nc_va_tracef(const char *fmt, va_list ap) # if USE_WEAK_SYMBOLS if ((pthread_self)) # endif +#ifdef __MINGW32__ + fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p); +#else fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self()); +#endif #endif if (before || after) { int n; @@ -219,6 +224,14 @@ _nc_retrace_bool(NCURSES_BOOL code) return code; } +/* Trace 'char' return-values */ +NCURSES_EXPORT(char) +_nc_retrace_char(char code) +{ + T((T_RETURN("%c"), code)); + return code; +} + /* Trace 'int' return-values */ NCURSES_EXPORT(int) _nc_retrace_int(int code) @@ -271,7 +284,7 @@ _nc_retrace_void_ptr(void *code) NCURSES_EXPORT(SCREEN *) _nc_retrace_sp(SCREEN *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } @@ -279,7 +292,7 @@ _nc_retrace_sp(SCREEN *code) NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index 45a03cea05f..35ba0d3e679 100644 --- a/ncurses/trace/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,6 +30,7 @@ * Author: Thomas Dickey 1996-on * * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -37,9 +38,12 @@ */ #include -#include /* acs_chars */ -MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_traceatr.c,v 1.74 2011/01/22 19:48:01 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -128,11 +132,11 @@ _traceattr2(int bufnum, chtype newmode) for (n = 0; n < SIZEOF(names); n++) { if ((newmode & names[n].val) != 0) { if (result[1] != '\0') - result = _nc_trace_bufcat(bufnum, "|"); + (void) _nc_trace_bufcat(bufnum, "|"); result = _nc_trace_bufcat(bufnum, names[n].name); if (names[n].val == A_COLOR) { - short pairnum = PAIR_NUMBER(newmode); + short pairnum = (short) PairNumber(newmode); #ifdef USE_TERMLIB /* pair_content lives in libncurses */ (void) sprintf(temp, "{%d}", pairnum); @@ -172,6 +176,14 @@ _traceattr(attr_t newmode) } /* Trace 'int' return-values */ +NCURSES_EXPORT(int) +_nc_retrace_int_attr_t(attr_t code) +{ + T((T_RETURN("%s"), _traceattr(code))); + return (int) code; +} + +/* Trace 'attr_t' return-values */ NCURSES_EXPORT(attr_t) _nc_retrace_attr_t(attr_t code) { @@ -186,6 +198,9 @@ _nc_altcharset_name(attr_t attr, chtype ch) unsigned int val; const char *name; } ALT_NAMES; +#if NCURSES_SP_FUNCS + SCREEN *sp = CURRENT_SCREEN; +#endif static const ALT_NAMES names[] = { {'l', "ACS_ULCORNER"}, /* upper left corner */ @@ -225,23 +240,26 @@ _nc_altcharset_name(attr_t attr, chtype ch) const char *result = 0; +#if NCURSES_SP_FUNCS + (void) sp; +#endif if ((attr & A_ALTCHARSET) && (acs_chars != 0)) { char *cp; char *found = 0; - const ALT_NAMES *sp; + const ALT_NAMES *strp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (ChCharOf(cp[1]) == ChCharOf(ch)) { + if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = ChCharOf(*found); - for (sp = names; sp->val; sp++) - if (sp->val == ch) { - result = sp->name; + ch = ChCharOf(UChar(*found)); + for (strp = names; strp->val; strp++) + if (strp->val == ch) { + result = strp->name; break; } } @@ -260,7 +278,9 @@ _tracechtype2(int bufnum, chtype ch) if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) { (void) _nc_trace_bufcat(bufnum, found); } else - (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch))); + (void) _nc_trace_bufcat(bufnum, + _nc_tracechar(CURRENT_SCREEN, + (int) ChCharOf(ch))); if (ChAttrOf(ch) != A_NORMAL) { (void) _nc_trace_bufcat(bufnum, " | "); @@ -313,14 +333,17 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) (void) _nc_trace_bufcat(bufnum, "{ "); for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { PUTC_ch = ch->chars[PUTC_i]; - if (PUTC_ch == L'\0') + if (PUTC_ch == L'\0') { + if (PUTC_i == 0) + (void) _nc_trace_bufcat(bufnum, "\\000"); break; - PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + } + PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) { if (PUTC_ch != L'\0') { /* it could not be a multibyte sequence */ (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(SP, + _nc_tracechar(CURRENT_SCREEN, UChar(ch->chars[PUTC_i]))); } break; @@ -329,7 +352,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) if (n) (void) _nc_trace_bufcat(bufnum, ", "); (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(SP, + _nc_tracechar(CURRENT_SCREEN, UChar(PUTC_buf[n]))); } } diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c index cc441b391e5..d19d0e420ac 100644 --- a/ncurses/trace/lib_tracebits.c +++ b/ncurses/trace/lib_tracebits.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2011 Free 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,9 +33,8 @@ ****************************************************************************/ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_tracebits.c,v 1.17 2008/08/03 16:09:26 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.19 2011/01/09 00:23:03 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -262,5 +261,5 @@ _nc_tracebits(void) return _nc_trace_ttymode(&(cur_term->Nttyb)); } #else -EMPTY_MODULE(_nc_tracebits) +EMPTY_MODULE(_nc_empty_lib_tracebits) #endif /* TRACE */ diff --git a/ncurses/trace/lib_tracechr.c b/ncurses/trace/lib_tracechr.c index 79cf03b4870..a1f9f5aa270 100644 --- a/ncurses/trace/lib_tracechr.c +++ b/ncurses/trace/lib_tracechr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_tracechr.c,v 1.19 2008/08/03 15:39:29 tom Exp $") +MODULE_ID("$Id: lib_tracechr.c,v 1.20 2009/04/18 22:48:29 tom Exp $") #ifdef TRACE @@ -52,7 +52,7 @@ _nc_tracechar(SCREEN *sp, int ch) : _nc_globals.tracechr_buf); if (ch > KEY_MIN || ch < 0) { - name = _nc_keyname(sp, ch); + name = safe_keyname(SP_PARM, ch); if (name == 0 || *name == '\0') name = "NULL"; (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -64,7 +64,7 @@ _nc_tracechar(SCREEN *sp, int ch) */ (void) sprintf(MyBuffer, "%#03o", ch); } else { - name = _nc_unctrl(sp, (chtype) ch); + name = safe_unctrl(SP_PARM, (chtype) ch); if (name == 0 || *name == 0) name = "null"; /* shouldn't happen */ (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -75,7 +75,7 @@ _nc_tracechar(SCREEN *sp, int ch) NCURSES_EXPORT(char *) _tracechar(int ch) { - return _nc_tracechar(SP, ch); + return _nc_tracechar(CURRENT_SCREEN, ch); } #else EMPTY_MODULE(_nc_lib_tracechr) diff --git a/ncurses/trace/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c index 58732a06c24..c7fcbf2e0d5 100644 --- a/ncurses/trace/lib_tracedmp.c +++ b/ncurses/trace/lib_tracedmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 * @@ -39,7 +39,7 @@ #include #include -MODULE_ID("$Id: lib_tracedmp.c,v 1.31 2008/08/16 19:30:56 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.32 2009/04/18 21:01:38 tom Exp $") #ifdef TRACE @@ -68,7 +68,7 @@ _tracedump(const char *name, WINDOW *win) if (width < win->_maxx) ++width; if (++width + 1 > (int) my_length) { - my_length = 2 * (width + 1); + my_length = (unsigned) (2 * (width + 1)); my_buffer = typeRealloc(char, my_length, my_buffer); } @@ -82,7 +82,7 @@ _tracedump(const char *name, WINDOW *win) * we map those to '.' and '?' respectively. */ for (j = 0; j < width; ++j) { - chtype test = CharOf(win->_line[n].text[j]); + chtype test = (chtype) CharOf(win->_line[n].text[j]); ep[j] = (char) ((UChar(test) == test #if USE_WIDEC_SUPPORT && (win->_line[n].text[j].chars[1] == 0) @@ -111,7 +111,7 @@ _tracedump(const char *name, WINDOW *win) if (multicolumn) { ep = my_buffer; for (j = 0; j < width; ++j) { - int test = WidecExt(win->_line[n].text[j]); + chtype test = WidecExt(win->_line[n].text[j]); if (test) { ep[j] = (char) (test + '0'); } else { @@ -153,7 +153,7 @@ _tracedump(const char *name, WINDOW *win) for (i = 0; i < 4; ++i) { const char *hex = " 123456789ABCDEF"; - attr_t mask = (0xf << ((i + 4) * 4)); + attr_t mask = (attr_t) (0xf << ((i + 4) * 4)); haveattrs = FALSE; for (j = 0; j < width; ++j) diff --git a/ncurses/trace/lib_tracemse.c b/ncurses/trace/lib_tracemse.c index 74cc177d51b..1afd15d2e78 100644 --- a/ncurses/trace/lib_tracemse.c +++ b/ncurses/trace/lib_tracemse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,23 +38,16 @@ #include -MODULE_ID("$Id: lib_tracemse.c,v 1.15 2008/08/03 15:39:29 tom Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.18 2011/01/22 19:48:08 tom Exp $") #ifdef TRACE #define my_buffer sp->tracemse_buf -NCURSES_EXPORT(char *) -_nc_tracemouse(SCREEN *sp, MEVENT const *ep) +static char * +_trace_mmask_t(SCREEN *sp, mmask_t code) { - (void) sprintf(my_buffer, TRACEMSE_FMT, - ep->id, - ep->x, - ep->y, - ep->z, - (unsigned long) ep->bstate); - -#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(my_buffer, s), ", ") +#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ") SHOW(BUTTON1_RELEASED, "release-1"); SHOW(BUTTON1_PRESSED, "press-1"); @@ -110,14 +103,37 @@ _nc_tracemouse(SCREEN *sp, MEVENT const *ep) if (my_buffer[strlen(my_buffer) - 1] == ' ') my_buffer[strlen(my_buffer) - 2] = '\0'; + + return (my_buffer); +} + +NCURSES_EXPORT(char *) +_nc_tracemouse(SCREEN *sp, MEVENT const *ep) +{ + (void) sprintf(my_buffer, TRACEMSE_FMT, + ep->id, + ep->x, + ep->y, + ep->z, + (unsigned long) ep->bstate); + + (void) _trace_mmask_t(sp, ep->bstate); (void) strcat(my_buffer, "}"); return (my_buffer); } +NCURSES_EXPORT(mmask_t) +_nc_retrace_mmask_t(SCREEN *sp, mmask_t code) +{ + *my_buffer = '\0'; + T((T_RETURN("{%s}"), _trace_mmask_t(sp, code))); + return code; +} + NCURSES_EXPORT(char *) _tracemouse(MEVENT const *ep) { - return _nc_tracemouse(SP, ep); + return _nc_tracemouse(CURRENT_SCREEN, ep); } #else /* !TRACE */ diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c index 6345acc035f..46baba4796b 100644 --- a/ncurses/trace/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,9 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.14 2008/08/03 15:13:56 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $") + +#ifdef TRACE #define MyList _nc_globals.tracebuf_ptr #define MySize _nc_globals.tracebuf_used @@ -47,7 +49,7 @@ _nc_trace_alloc(int bufnum, size_t want) if (bufnum >= 0) { if ((size_t) (bufnum + 1) > MySize) { - size_t need = (bufnum + 1) * 2; + size_t need = (size_t) (bufnum + 1) * 2; if ((MyList = typeRealloc(TRACEBUF, need, MyList)) != 0) { while (need > MySize) MyList[MySize++].text = 0; @@ -112,3 +114,6 @@ _nc_trace_bufcat(int bufnum, const char *value) } return buffer; } +#else +EMPTY_MODULE(_nc_empty_trace_buf) +#endif /* TRACE */ diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c index f813aba1582..d3380131eca 100644 --- a/ncurses/trace/trace_tries.c +++ b/ncurses/trace/trace_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2009,2011 Free 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,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1999 * + * Author: Thomas E. Dickey 1999 * ****************************************************************************/ /* * trace_tries.c - Tracing/Debugging buffers (keycode tries-trees) @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: trace_tries.c,v 1.13 2008/08/03 15:43:30 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.16 2011/01/09 00:23:27 tom Exp $") #ifdef TRACE #define my_buffer _nc_globals.tracetry_buf @@ -46,7 +46,7 @@ recur_tries(TRIES * tree, unsigned level) { if (level > my_length) { my_length = (level + 1) * 4; - my_buffer = (unsigned char *) realloc(my_buffer, my_length); + my_buffer = (unsigned char *) _nc_doalloc(my_buffer, my_length); } while (tree != 0) { @@ -67,12 +67,12 @@ NCURSES_EXPORT(void) _nc_trace_tries(TRIES * tree) { my_buffer = typeMalloc(unsigned char, my_length = 80); - _tracef("BEGIN tries %p", tree); + _tracef("BEGIN tries %p", (void *) tree); recur_tries(tree, 0); - _tracef(". . . tries %p", tree); + _tracef(". . . tries %p", (void *) tree); free(my_buffer); } #else -EMPTY_MODULE(_nc_trace_tries) +EMPTY_MODULE(_nc_empty_trace_tries) #endif diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c index 9b0b5920d81..38a48730ccd 100644 --- a/ncurses/trace/trace_xnames.c +++ b/ncurses/trace/trace_xnames.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2000,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 * @@ -34,12 +34,11 @@ */ #include -#include -MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $") NCURSES_EXPORT(void) -_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED) +_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) { #ifdef TRACE #if NCURSES_XNAMES diff --git a/ncurses/trace/varargs.c b/ncurses/trace/varargs.c index f4ee46710ab..541173d2745 100644 --- a/ncurses/trace/varargs.c +++ b/ncurses/trace/varargs.c @@ -34,7 +34,7 @@ #include -MODULE_ID("$Id: varargs.c,v 1.7 2008/08/03 15:42:49 tom Exp $") +MODULE_ID("$Id: varargs.c,v 1.8 2008/11/16 00:19:59 juergen Exp $") #ifdef TRACE @@ -44,7 +44,7 @@ typedef enum { atUnknown = 0, atInteger, atFloat, atPoint, atString } ARGTYPE; -#define VA_INT(type) ival = va_arg(ap, type) +#define VA_INT(type) ival = (int) va_arg(ap, type) #define VA_FLT(type) fval = va_arg(ap, type) #define VA_PTR(type) pval = (char *)va_arg(ap, type) #define VA_STR(type) sval = va_arg(ap, type) diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index bf9fb147200..66da4f4beca 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,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 * @@ -42,7 +42,9 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.32 2008/08/04 23:07:39 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $") + +#define NUM_VISBUFS 4 #define NormalLen(len) (size_t) (((size_t)(len) + 1) * 4) #define WideLen(len) (size_t) (((size_t)(len) + 1) * 4 * MB_CUR_MAX) @@ -92,7 +94,7 @@ _nc_vischar(char *tp, unsigned c) static const char * _nc_visbuf2n(int bufnum, const char *buf, int len) { - const char *vbuf; + const char *vbuf = 0; char *tp; int c; @@ -108,9 +110,16 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, NormalLen(len)); #else { - static char *mybuf[4]; - mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); - vbuf = tp = mybuf[bufnum]; + static char *mybuf[NUM_VISBUFS]; + if (bufnum < 0) { + for (c = 0; c < NUM_VISBUFS; ++c) { + FreeAndNull(mybuf[c]); + } + tp = 0; + } else { + mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); + vbuf = tp = mybuf[bufnum]; + } } #endif if (tp != 0) { @@ -119,7 +128,7 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) tp = _nc_vischar(tp, UChar(c)); } *tp++ = D_QUOTE; - *tp++ = '\0'; + *tp = '\0'; } else { vbuf = ("(_nc_visbuf2n failed)"); } @@ -177,7 +186,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, WideLen(len)); #else { - static char *mybuf[2]; + static char *mybuf[NUM_VISBUFS]; mybuf[bufnum] = typeRealloc(char, WideLen(len), mybuf[bufnum]); vbuf = tp = mybuf[bufnum]; } @@ -196,7 +205,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) } } *tp++ = D_QUOTE; - *tp++ = '\0'; + *tp = '\0'; } else { vbuf = ("(_nc_viswbuf2n failed)"); } @@ -229,7 +238,9 @@ _nc_viswibuf(const wint_t *buf) static unsigned mylen; unsigned n; - for (n = 0; buf[n] != 0; ++n) ; + for (n = 0; buf[n] != 0; ++n) { + ; /* empty */ + } if (mylen < ++n) { mylen = n + 80; if (mybuf != 0) @@ -237,8 +248,10 @@ _nc_viswibuf(const wint_t *buf) else mybuf = typeMalloc(wchar_t, mylen); } - for (n = 0; buf[n] != 0; ++n) + for (n = 0; buf[n] != 0; ++n) { mybuf[n] = (wchar_t) buf[n]; + } + mybuf[n] = L'\0'; return _nc_viswbuf2(0, mybuf); } @@ -274,12 +287,12 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } } - result = _nc_trace_bufcat(bufnum, l_brace); - result = _nc_trace_bufcat(bufnum, d_quote); + (void) _nc_trace_bufcat(bufnum, l_brace); + (void) _nc_trace_bufcat(bufnum, d_quote); for (j = first; j <= last; ++j) { found = _nc_altcharset_name(attr, (chtype) CharOf(buf[j])); if (found != 0) { - result = _nc_trace_bufcat(bufnum, found); + (void) _nc_trace_bufcat(bufnum, found); attr &= ~A_ALTCHARSET; } else #if USE_WIDEC_SUPPORT @@ -291,15 +304,19 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) int k; PUTC_ch = buf[j].chars[PUTC_i]; - if (PUTC_ch == L'\0') + if (PUTC_ch == L'\0') { + if (PUTC_i == 0) + (void) _nc_trace_bufcat(bufnum, "\\000"); break; - PUTC_n = (int) wcrtomb(PUTC_buf, buf[j].chars[PUTC_i], &PUT_st); + } + PUTC_n = (int) wcrtomb(PUTC_buf, + buf[j].chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) break; for (k = 0; k < PUTC_n; k++) { char temp[80]; _nc_vischar(temp, UChar(PUTC_buf[k])); - result = _nc_trace_bufcat(bufnum, temp); + (void) _nc_trace_bufcat(bufnum, temp); } } } @@ -311,10 +328,10 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } #endif /* USE_WIDEC_SUPPORT */ } - result = _nc_trace_bufcat(bufnum, d_quote); + (void) _nc_trace_bufcat(bufnum, d_quote); if (attr != A_NORMAL) { - result = _nc_trace_bufcat(bufnum, " | "); - result = _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); + (void) _nc_trace_bufcat(bufnum, " | "); + (void) _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); } result = _nc_trace_bufcat(bufnum, r_brace); first = last + 1; diff --git a/ncurses/tty/MKexpanded.sh b/ncurses/tty/MKexpanded.sh index bf9acf21aa4..7a5f5993c48 100755 --- a/ncurses/tty/MKexpanded.sh +++ b/ncurses/tty/MKexpanded.sh @@ -1,6 +1,6 @@ #! /bin/sh ############################################################################## -# Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -27,9 +27,9 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1997 +# Author: Thomas E. Dickey, 1997-on # -# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $ +# $Id: MKexpanded.sh,v 1.17 2010/01/23 17:57:43 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -52,8 +52,13 @@ trap "rm -f $TMP" 0 1 2 5 15 cat < -#include + +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #if NCURSES_EXPANDED EOF @@ -68,29 +73,59 @@ cat >$TMP </dev/null | sed -e '1,/^IGNORE$/d' +$preprocessor $TMP 2>/dev/null | \ + sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#if_/#if /' cat < -MODULE_ID("$Id: hardscroll.c,v 1.42 2008/08/03 23:49:30 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.47 2010/04/24 23:46:47 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) # undef screen_lines -# define screen_lines MAXLINES -NCURSES_EXPORT_VAR(int) -oldnums[MAXLINES]; -# define OLDNUM(n) oldnums[n] +# define screen_lines(sp) MAXLINES +NCURSES_EXPORT_VAR (int) + oldnums[MAXLINES]; +# define OLDNUM(sp,n) oldnums[n] # define _tracef printf # undef TR # define TR(n, a) if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); } -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; #else /* no debug */ /* OLDNUM(n) indicates which line will be shifted to the position n. if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from somewhere. */ -NCURSES_EXPORT_VAR(int *) -_nc_oldnums = 0; /* obsolete: keep for ABI compat */ +NCURSES_EXPORT_VAR (int *) + _nc_oldnums = 0; /* obsolete: keep for ABI compat */ # if USE_HASHMAP -# define oldnums SP->_oldnum_list -# define OLDNUM(n) oldnums[n] +# define oldnums(sp) (sp)->_oldnum_list +# define OLDNUM(sp,n) oldnums(sp)[n] # else /* !USE_HASHMAP */ -# define OLDNUM(n) newscr->_line[n].oldindex +# define OLDNUM(sp,n) NewScreen(sp)->_line[n].oldindex # endif /* !USE_HASHMAP */ -#define OLDNUM_SIZE SP->_oldnum_size +#define OLDNUM_SIZE(sp) (sp)->_oldnum_size #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */ NCURSES_EXPORT(void) -_nc_scroll_optimize(void) +NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) /* scroll optimization to transform curscr to newscr */ { int i; int start, end, shift; - TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize"))); + TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), (void *) SP_PARM)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) #if USE_HASHMAP /* get enough storage */ - if (OLDNUM_SIZE < screen_lines) { - int *new_oldnums = typeRealloc(int, screen_lines, oldnums); + if (OLDNUM_SIZE(SP_PARM) < screen_lines(SP_PARM)) { + int *new_oldnums = typeRealloc(int, + (size_t) screen_lines(SP_PARM), + oldnums(SP_PARM)); if (!new_oldnums) return; - oldnums = new_oldnums; - OLDNUM_SIZE = screen_lines; + oldnums(SP_PARM) = new_oldnums; + OLDNUM_SIZE(SP_PARM) = screen_lines(SP_PARM); } /* calculate the indices */ - _nc_hash_map(); + NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG); #endif #endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */ #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) { - _nc_linedump(); + NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_ARG); _nc_unlock_global(tracef); } #endif /* TRACE */ /* pass 1 - from top to bottom scrolling up */ - for (i = 0; i < screen_lines;) { - while (i < screen_lines && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) <= i)) + for (i = 0; i < screen_lines(SP_PARM);) { + while (i < screen_lines(SP_PARM) + && (OLDNUM(SP_PARM, i) == _NEWINDEX || OLDNUM(SP_PARM, i) <= i)) i++; - if (i >= screen_lines) + if (i >= screen_lines(SP_PARM)) break; - shift = OLDNUM(i) - i; /* shift > 0 */ + shift = OLDNUM(SP_PARM, i) - i; /* shift > 0 */ start = i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(SP_PARM) + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) i++; end = i - 1 + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { + if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx + shift, + start, + end, + screen_lines(SP_PARM) - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -238,23 +246,33 @@ _nc_scroll_optimize(void) } /* pass 2 - from bottom to top scrolling down */ - for (i = screen_lines - 1; i >= 0;) { - while (i >= 0 && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) >= i)) + for (i = screen_lines(SP_PARM) - 1; i >= 0;) { + while (i >= 0 + && (OLDNUM(SP_PARM, i) == _NEWINDEX + || OLDNUM(SP_PARM, i) >= i)) { i--; + } if (i < 0) break; - shift = OLDNUM(i) - i; /* shift < 0 */ + shift = OLDNUM(SP_PARM, i) - i; /* shift < 0 */ end = i; i--; - while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) + while (i >= 0 + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) { i--; + } start = i + 1 - (-shift); TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { + if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx + shift, + start, + end, + screen_lines(SP_PARM) - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -263,24 +281,41 @@ _nc_scroll_optimize(void) TR(TRACE_ICALLS, (T_RETURN(""))); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_scroll_optimize(void) +{ + NCURSES_SP_NAME(_nc_scroll_optimize) (CURRENT_SCREEN); +} +#endif + #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) NCURSES_EXPORT(void) -_nc_linedump(void) +NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0) /* dump the state of the real and virtual oldnum fields */ { int n; char *buf = 0; - size_t want = (screen_lines + 1) * 4; + size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4; if ((buf = typeMalloc(char, want)) != 0) { - (void) strcpy(buf, "virt"); - for (n = 0; n < screen_lines; n++) - (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n)); - TR(TRACE_UPDATE | TRACE_MOVE, (buf)); + *buf = '\0'; + for (n = 0; n < screen_lines(SP_PARM); n++) + (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(SP_PARM, n)); + TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf)); free(buf); } } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_linedump(void) +{ + NCURSES_SP_NAME(_nc_linedump) (CURRENT_SCREEN); +} +#endif + #endif /* defined(TRACE) || defined(SCROLLDEBUG) */ #ifdef SCROLLDEBUG diff --git a/ncurses/tty/hashmap.c b/ncurses/tty/hashmap.c index 9b60df62d5c..b670e1b9691 100644 --- a/ncurses/tty/hashmap.c +++ b/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -68,9 +68,12 @@ AUTHOR *****************************************************************************/ #include -#include /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $") #ifdef HASHDEBUG @@ -83,25 +86,25 @@ MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") int oldnums[MAXLINES], reallines[MAXLINES]; static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH]; static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; -# define OLDNUM(n) oldnums[n] -# define OLDTEXT(n) oldtext[n] -# define NEWTEXT(m) newtext[m] -# define PENDING(n) 1 +# define OLDNUM(sp,n) oldnums[n] +# define OLDTEXT(sp,n) oldtext[n] +# define NEWTEXT(sp,m) newtext[m] +# define PENDING(sp,n) 1 #else /* !HASHDEBUG */ -# define OLDNUM(n) SP->_oldnum_list[n] -# define OLDTEXT(n) curscr->_line[n].text -# define NEWTEXT(m) newscr->_line[m].text -# define TEXTWIDTH (curscr->_maxx+1) -# define PENDING(n) (newscr->_line[n].firstchar != _NOCHANGE) +# define OLDNUM(sp,n) (sp)->_oldnum_list[n] +# define OLDTEXT(sp,n) CurScreen(sp)->_line[n].text +# define NEWTEXT(sp,m) NewScreen(sp)->_line[m].text +# define TEXTWIDTH(sp) (CurScreen(sp)->_maxx + 1) +# define PENDING(sp,n) (NewScreen(sp)->_line[n].firstchar != _NOCHANGE) #endif /* !HASHDEBUG */ -#define oldhash (SP->oldhash) -#define newhash (SP->newhash) -#define hashtab (SP->hashtab) -#define lines_alloc (SP->hashtab_len) +#define oldhash(sp) ((sp)->oldhash) +#define newhash(sp) ((sp)->newhash) +#define hashtab(sp) ((sp)->hashtab) +#define lines_alloc(sp) ((sp)->hashtab_len) #if USE_WIDEC_SUPPORT #define HASH_VAL(ch) (ch.chars[0]) @@ -112,26 +115,26 @@ static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_INLINE unsigned long -hash(NCURSES_CH_T * text) +hash(SCREEN *sp, NCURSES_CH_T * text) { int i; NCURSES_CH_T ch; unsigned long result = 0; - for (i = TEXTWIDTH; i > 0; i--) { + for (i = TEXTWIDTH(sp); i > 0; i--) { ch = *text++; - result += (result << 5) + HASH_VAL(ch); + result += (result << 5) + (unsigned long) HASH_VAL(ch); } return result; } /* approximate update cost */ static int -update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) +update_cost(SCREEN *sp, NCURSES_CH_T * from, NCURSES_CH_T * to) { int cost = 0; int i; - for (i = TEXTWIDTH; i > 0; i--, from++, to++) + for (i = TEXTWIDTH(sp); i > 0; i--, from++, to++) if (!(CharEq(*from, *to))) cost++; @@ -139,7 +142,7 @@ update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) } static int -update_cost_from_blank(NCURSES_CH_T * to) +update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) { int cost = 0; int i; @@ -148,7 +151,7 @@ update_cost_from_blank(NCURSES_CH_T * to) if (back_color_erase) SetPair(blank, GetPair(stdscr->_nc_bkgd)); - for (i = TEXTWIDTH; i > 0; i--, to++) + for (i = TEXTWIDTH(sp); i > 0; i--, to++) if (!(CharEq(blank, *to))) cost++; @@ -160,14 +163,14 @@ update_cost_from_blank(NCURSES_CH_T * to) * effective. 'blank' indicates whether the line 'to' would become blank. */ static NCURSES_INLINE bool -cost_effective(const int from, const int to, const bool blank) +cost_effective(SCREEN *sp, const int from, const int to, const bool blank) { int new_from; if (from == to) return FALSE; - new_from = OLDNUM(from); + new_from = OLDNUM(sp, from); if (new_from == _NEWINDEX) new_from = from; @@ -175,16 +178,17 @@ cost_effective(const int from, const int to, const bool blank) * On the left side of >= is the cost before moving; * on the right side -- cost after moving. */ - return (((blank ? update_cost_from_blank(NEWTEXT(to)) - : update_cost(OLDTEXT(to), NEWTEXT(to))) - + update_cost(OLDTEXT(new_from), NEWTEXT(from))) - >= ((new_from == from ? update_cost_from_blank(NEWTEXT(from)) - : update_cost(OLDTEXT(new_from), NEWTEXT(from))) - + update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE; + return (((blank ? update_cost_from_blank(sp, NEWTEXT(sp, to)) + : update_cost(sp, OLDTEXT(sp, to), NEWTEXT(sp, to))) + + update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) + >= ((new_from == from ? update_cost_from_blank(sp, NEWTEXT(sp, from)) + : update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) + + update_cost(sp, OLDTEXT(sp, from), NEWTEXT(sp, to)))) + ? TRUE : FALSE; } static void -grow_hunks(void) +grow_hunks(SCREEN *sp) { int start, end, shift; int back_limit, forward_limit; /* limits for cells to fill */ @@ -200,35 +204,36 @@ grow_hunks(void) back_ref_limit = 0; i = 0; - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) i++; - for (; i < screen_lines; i = next_hunk) { + for (; i < screen_lines(sp); i = next_hunk) { start = i; - shift = OLDNUM(i) - i; + shift = OLDNUM(sp, i) - i; /* get forward limit */ i = start + 1; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(sp) + && OLDNUM(sp, i) != _NEWINDEX + && OLDNUM(sp, i) - i == shift) i++; end = i; - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) i++; next_hunk = i; forward_limit = i; - if (i >= screen_lines || OLDNUM(i) >= i) + if (i >= screen_lines(sp) || OLDNUM(sp, i) >= i) forward_ref_limit = i; else - forward_ref_limit = OLDNUM(i); + forward_ref_limit = OLDNUM(sp, i); i = start - 1; /* grow back */ if (shift < 0) back_limit = back_ref_limit + (-shift); while (i >= back_limit) { - if (newhash[i] == oldhash[i + shift] - || cost_effective(i + shift, i, shift < 0)) { - OLDNUM(i) = i + shift; + if (newhash(sp)[i] == oldhash(sp)[i + shift] + || cost_effective(sp, i + shift, i, shift < 0)) { + OLDNUM(sp, i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (backward continuation)", i, i + shift)); @@ -246,9 +251,9 @@ grow_hunks(void) if (shift > 0) forward_limit = forward_ref_limit - shift; while (i < forward_limit) { - if (newhash[i] == oldhash[i + shift] - || cost_effective(i + shift, i, shift > 0)) { - OLDNUM(i) = i + shift; + if (newhash(sp)[i] == oldhash(sp)[i + shift] + || cost_effective(sp, i + shift, i, shift > 0)) { + OLDNUM(sp, i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (forward continuation)", i, i + shift)); @@ -268,51 +273,54 @@ grow_hunks(void) } NCURSES_EXPORT(void) -_nc_hash_map(void) +NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) { - HASHMAP *sp; + HASHMAP *hsp; register int i; int start, shift, size; - if (screen_lines > lines_alloc) { - if (hashtab) - free(hashtab); - hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2); - if (!hashtab) { - if (oldhash) { - FreeAndNull(oldhash); + if (screen_lines(SP_PARM) > lines_alloc(SP_PARM)) { + if (hashtab(SP_PARM)) + free(hashtab(SP_PARM)); + hashtab(SP_PARM) = typeMalloc(HASHMAP, + ((size_t) screen_lines(SP_PARM) + 1) * 2); + if (!hashtab(SP_PARM)) { + if (oldhash(SP_PARM)) { + FreeAndNull(oldhash(SP_PARM)); } - lines_alloc = 0; + lines_alloc(SP_PARM) = 0; return; } - lines_alloc = screen_lines; + lines_alloc(SP_PARM) = screen_lines(SP_PARM); } - if (oldhash && newhash) { + if (oldhash(SP_PARM) && newhash(SP_PARM)) { /* re-hash only changed lines */ - for (i = 0; i < screen_lines; i++) { - if (PENDING(i)) - newhash[i] = hash(NEWTEXT(i)); + for (i = 0; i < screen_lines(SP_PARM); i++) { + if (PENDING(SP_PARM, i)) + newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); } } else { /* re-hash all */ - if (oldhash == 0) - oldhash = typeCalloc(unsigned long, (unsigned) screen_lines); - if (newhash == 0) - newhash = typeCalloc(unsigned long, (unsigned) screen_lines); - if (!oldhash || !newhash) + if (oldhash(SP_PARM) == 0) + oldhash(SP_PARM) = typeCalloc(unsigned long, + (size_t) screen_lines(SP_PARM)); + if (newhash(SP_PARM) == 0) + newhash(SP_PARM) = typeCalloc(unsigned long, + (size_t) screen_lines(SP_PARM)); + if (!oldhash(SP_PARM) || !newhash(SP_PARM)) return; /* malloc failure */ - for (i = 0; i < screen_lines; i++) { - newhash[i] = hash(NEWTEXT(i)); - oldhash[i] = hash(OLDTEXT(i)); + for (i = 0; i < screen_lines(SP_PARM); i++) { + newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } } #ifdef HASH_VERIFY - for (i = 0; i < screen_lines; i++) { - if (newhash[i] != hash(NEWTEXT(i))) + for (i = 0; i < screen_lines(SP_PARM); i++) { + if (newhash(SP_PARM)[i] != hash(SP_PARM, NEWTEXT(SP_PARM, i))) fprintf(stderr, "error in newhash[%d]\n", i); - if (oldhash[i] != hash(OLDTEXT(i))) + if (oldhash(SP_PARM)[i] != hash(SP_PARM, OLDTEXT(SP_PARM, i))) fprintf(stderr, "error in oldhash[%d]\n", i); } #endif @@ -320,28 +328,30 @@ _nc_hash_map(void) /* * Set up and count line-hash values. */ - memset(hashtab, '\0', sizeof(*hashtab) * (screen_lines + 1) * 2); - for (i = 0; i < screen_lines; i++) { - unsigned long hashval = oldhash[i]; + memset(hashtab(SP_PARM), '\0', + sizeof(*(hashtab(SP_PARM))) + * ((size_t) screen_lines(SP_PARM) + 1) * 2); + for (i = 0; i < screen_lines(SP_PARM); i++) { + unsigned long hashval = oldhash(SP_PARM)[i]; - for (sp = hashtab; sp->hashval; sp++) - if (sp->hashval == hashval) + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->hashval == hashval) break; - sp->hashval = hashval; /* in case this is a new entry */ - sp->oldcount++; - sp->oldindex = i; + hsp->hashval = hashval; /* in case this is a new entry */ + hsp->oldcount++; + hsp->oldindex = i; } - for (i = 0; i < screen_lines; i++) { - unsigned long hashval = newhash[i]; + for (i = 0; i < screen_lines(SP_PARM); i++) { + unsigned long hashval = newhash(SP_PARM)[i]; - for (sp = hashtab; sp->hashval; sp++) - if (sp->hashval == hashval) + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->hashval == hashval) break; - sp->hashval = hashval; /* in case this is a new entry */ - sp->newcount++; - sp->newindex = i; + hsp->hashval = hashval; /* in case this is a new entry */ + hsp->newcount++; + hsp->newindex = i; - OLDNUM(i) = _NEWINDEX; /* initialize old indices array */ + OLDNUM(SP_PARM, i) = _NEWINDEX; /* initialize old indices array */ } /* @@ -351,16 +361,16 @@ _nc_hash_map(void) * extending hunks by cost_effective. Otherwise, it does not * have any side effects. */ - for (sp = hashtab; sp->hashval; sp++) - if (sp->oldcount == 1 && sp->newcount == 1 - && sp->oldindex != sp->newindex) { + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->oldcount == 1 && hsp->newcount == 1 + && hsp->oldindex != hsp->newindex) { TR(TRACE_UPDATE | TRACE_MOVE, ("new line %d is hash-identical to old line %d (unique)", - sp->newindex, sp->oldindex)); - OLDNUM(sp->newindex) = sp->oldindex; + hsp->newindex, hsp->oldindex)); + OLDNUM(SP_PARM, hsp->newindex) = hsp->oldindex; } - grow_hunks(); + grow_hunks(SP_PARM); /* * Eliminate bad or impossible shifts -- this includes removing @@ -368,58 +378,83 @@ _nc_hash_map(void) * those which are to be moved too far, they are likely to destroy * more than carry. */ - for (i = 0; i < screen_lines;) { - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + for (i = 0; i < screen_lines(SP_PARM);) { + while (i < screen_lines(SP_PARM) && OLDNUM(SP_PARM, i) == _NEWINDEX) i++; - if (i >= screen_lines) + if (i >= screen_lines(SP_PARM)) break; start = i; - shift = OLDNUM(i) - i; + shift = OLDNUM(SP_PARM, i) - i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(SP_PARM) + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) i++; size = i - start; if (size < 3 || size + min(size / 8, 2) < abs(shift)) { while (start < i) { - OLDNUM(start) = _NEWINDEX; + OLDNUM(SP_PARM, start) = _NEWINDEX; start++; } } } /* After clearing invalid hunks, try grow the rest. */ - grow_hunks(); + grow_hunks(SP_PARM); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_hash_map(void) +{ + NCURSES_SP_NAME(_nc_hash_map) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_DCLx int i) +{ + if (oldhash(SP_PARM)) + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_make_oldhash(int i) { - if (oldhash) - oldhash[i] = hash(OLDTEXT(i)); + NCURSES_SP_NAME(_nc_make_oldhash) (CURRENT_SCREEN, i); } +#endif NCURSES_EXPORT(void) -_nc_scroll_oldhash(int n, int top, int bot) +NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_DCLx int n, int top, int bot) { size_t size; int i; - if (!oldhash) + if (!oldhash(SP_PARM)) return; - size = sizeof(*oldhash) * (bot - top + 1 - abs(n)); + size = sizeof(*(oldhash(SP_PARM))) * (size_t) (bot - top + 1 - abs(n)); if (n > 0) { - memmove(oldhash + top, oldhash + top + n, size); + memmove(oldhash(SP_PARM) + top, oldhash(SP_PARM) + top + n, size); for (i = bot; i > bot - n; i--) - oldhash[i] = hash(OLDTEXT(i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } else { - memmove(oldhash + top - n, oldhash + top, size); + memmove(oldhash(SP_PARM) + top - n, oldhash(SP_PARM) + top, size); for (i = top; i < top - n; i++) - oldhash[i] = hash(OLDTEXT(i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_scroll_oldhash(int n, int top, int bot) +{ + NCURSES_SP_NAME(_nc_scroll_oldhash) (CURRENT_SCREEN, n, top, bot); +} +#endif + #ifdef HASHDEBUG static void usage(void) diff --git a/ncurses/tty/lib_mvcur.c b/ncurses/tty/lib_mvcur.c index 8e66fa3bf64..ad41f8dd72d 100644 --- a/ncurses/tty/lib_mvcur.c +++ b/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free 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,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -109,8 +110,8 @@ * LONG_DIST and (b) further inward from the right or left edge than LONG_DIST, * we'll consider nonlocal. */ -#define NOT_LOCAL(fy, fx, ty, tx) ((tx > LONG_DIST) \ - && (tx < screen_columns - 1 - LONG_DIST) \ +#define NOT_LOCAL(sp, fy, fx, ty, tx) ((tx > LONG_DIST) \ + && (tx < screen_columns(sp) - 1 - LONG_DIST) \ && (abs(ty-fy) + abs(tx-fx) > LONG_DIST)) /**************************************************************************** @@ -152,13 +153,21 @@ */ #include -#include #include -MODULE_ID("$Id: lib_mvcur.c,v 1.113 2008/08/16 19:30:58 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define WANT_CHAR(y, x) SP->_newscr->_line[y].text[x] /* desired state */ -#define BAUDRATE cur_term->_baudrate /* bits per second */ +MODULE_ID("$Id: lib_mvcur.c,v 1.126 2011/01/22 19:48:21 tom Exp $") + +#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ + +#if NCURSES_SP_FUNCS +#define BAUDRATE(sp) sp->_term->_baudrate /* bits per second */ +#else +#define BAUDRATE(sp) cur_term->_baudrate /* bits per second */ +#endif #if defined(MAIN) || defined(NCURSES_TEST) #include @@ -169,7 +178,7 @@ static float diff; #define OPT_SIZE 512 -static int normalized_cost(const char *const cap, int affcnt); +static int normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt); /**************************************************************************** * @@ -179,34 +188,34 @@ static int normalized_cost(const char *const cap, int affcnt); #ifdef TRACE static int -trace_cost_of(const char *capname, const char *cap, int affcnt) +trace_cost_of(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) { - int result = _nc_msec_cost(cap, affcnt); + int result = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("CostOf %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define CostOf(cap,affcnt) trace_cost_of(#cap,cap,affcnt); +#define CostOf(cap,affcnt) trace_cost_of(NCURSES_SP_ARGx #cap, cap, affcnt) static int -trace_normalized_cost(const char *capname, const char *cap, int affcnt) +trace_normalized_cost(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) { - int result = normalized_cost(cap, affcnt); + int result = normalized_cost(NCURSES_SP_ARGx cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define NormalizedCost(cap,affcnt) trace_normalized_cost(#cap,cap,affcnt); +#define NormalizedCost(cap,affcnt) trace_normalized_cost(NCURSES_SP_ARGx #cap, cap, affcnt) #else -#define CostOf(cap,affcnt) _nc_msec_cost(cap,affcnt); -#define NormalizedCost(cap,affcnt) normalized_cost(cap,affcnt); +#define CostOf(cap,affcnt) NCURSES_SP_NAME(_nc_msec_cost)(NCURSES_SP_ARGx cap, affcnt) +#define NormalizedCost(cap,affcnt) normalized_cost(NCURSES_SP_ARGx cap, affcnt) #endif NCURSES_EXPORT(int) -_nc_msec_cost(const char *const cap, int affcnt) +NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcnt) /* compute the cost of a given operation */ { if (cap == 0) @@ -222,53 +231,68 @@ _nc_msec_cost(const char *const cap, int affcnt) for (cp += 2; *cp != '>'; cp++) { if (isdigit(UChar(*cp))) - number = number * 10 + (*cp - '0'); + number = number * 10 + (float) (*cp - '0'); else if (*cp == '*') - number *= affcnt; + number *= (float) affcnt; else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) - number += (*cp - '0') / 10.0; + number += (float) ((*cp - '0') / 10.0); } #if NCURSES_NO_PADDING - if (!GetNoPadding(SP)) + if (!GetNoPadding(SP_PARM)) #endif cum_cost += number * 10; - } else - cum_cost += SP->_char_padding; + } else if (SP_PARM) { + cum_cost += (float) SP_PARM->_char_padding; + } } return ((int) cum_cost); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_msec_cost(const char *const cap, int affcnt) +{ + return NCURSES_SP_NAME(_nc_msec_cost) (CURRENT_SCREEN, cap, affcnt); +} +#endif + static int -normalized_cost(const char *const cap, int affcnt) +normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt) /* compute the effective character-count for an operation (round up) */ { - int cost = _nc_msec_cost(cap, affcnt); + int cost = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); if (cost != INFINITY) - cost = (cost + SP->_char_padding - 1) / SP->_char_padding; + cost = (cost + SP_PARM->_char_padding - 1) / SP_PARM->_char_padding; return cost; } static void -reset_scroll_region(void) +reset_scroll_region(NCURSES_SP_DCL0) /* Set the scroll-region to a known state (the default) */ { if (change_scroll_region) { - TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, screen_lines - 1)); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "change_scroll_region", + TPARM_2(change_scroll_region, + 0, screen_lines(SP_PARM) - 1)); } } NCURSES_EXPORT(void) -_nc_mvcur_resume(void) +NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0) /* what to do at initialization time and after each shellout */ { + if (SP_PARM && !IsTermInfo(SP_PARM)) + return; + /* initialize screen for cursor access */ if (enter_ca_mode) { - TPUTS_TRACE("enter_ca_mode"); - putp(enter_ca_mode); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "enter_ca_mode", + enter_ca_mode); } /* @@ -280,53 +304,63 @@ _nc_mvcur_resume(void) * they know the screen size. This is useful when you're running * a vt100 emulation through xterm. */ - reset_scroll_region(); - SP->_cursrow = SP->_curscol = -1; + reset_scroll_region(NCURSES_SP_ARG); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; /* restore cursor shape */ - if (SP->_cursor != -1) { - int cursor = SP->_cursor; - SP->_cursor = -1; - curs_set(cursor); + if (SP_PARM->_cursor != -1) { + int cursor = SP_PARM->_cursor; + SP_PARM->_cursor = -1; + NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx cursor); } } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_init(void) +_nc_mvcur_resume(void) +{ + NCURSES_SP_NAME(_nc_mvcur_resume) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) /* initialize the cost structure */ { - if (isatty(fileno(SP->_ofp))) - SP->_char_padding = ((BAUDBYTE * 1000 * 10) - / (BAUDRATE > 0 ? BAUDRATE : 9600)); + if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp))) + SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10) + / (BAUDRATE(SP_PARM) > 0 + ? BAUDRATE(SP_PARM) + : 9600)); else - SP->_char_padding = 1; /* must be nonzero */ - if (SP->_char_padding <= 0) - SP->_char_padding = 1; /* must be nonzero */ - TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP->_char_padding)); + SP_PARM->_char_padding = 1; /* must be nonzero */ + if (SP_PARM->_char_padding <= 0) + SP_PARM->_char_padding = 1; /* must be nonzero */ + TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP_PARM->_char_padding)); /* non-parameterized local-motion strings */ - SP->_cr_cost = CostOf(carriage_return, 0); - SP->_home_cost = CostOf(cursor_home, 0); - SP->_ll_cost = CostOf(cursor_to_ll, 0); + SP_PARM->_cr_cost = CostOf(carriage_return, 0); + SP_PARM->_home_cost = CostOf(cursor_home, 0); + SP_PARM->_ll_cost = CostOf(cursor_to_ll, 0); #if USE_HARD_TABS if (getenv("NCURSES_NO_HARD_TABS") == 0) { - SP->_ht_cost = CostOf(tab, 0); - SP->_cbt_cost = CostOf(back_tab, 0); + SP_PARM->_ht_cost = CostOf(tab, 0); + SP_PARM->_cbt_cost = CostOf(back_tab, 0); } else { - SP->_ht_cost = INFINITY; - SP->_cbt_cost = INFINITY; + SP_PARM->_ht_cost = INFINITY; + SP_PARM->_cbt_cost = INFINITY; } #endif /* USE_HARD_TABS */ - SP->_cub1_cost = CostOf(cursor_left, 0); - SP->_cuf1_cost = CostOf(cursor_right, 0); - SP->_cud1_cost = CostOf(cursor_down, 0); - SP->_cuu1_cost = CostOf(cursor_up, 0); + SP_PARM->_cub1_cost = CostOf(cursor_left, 0); + SP_PARM->_cuf1_cost = CostOf(cursor_right, 0); + SP_PARM->_cud1_cost = CostOf(cursor_down, 0); + SP_PARM->_cuu1_cost = CostOf(cursor_up, 0); - SP->_smir_cost = CostOf(enter_insert_mode, 0); - SP->_rmir_cost = CostOf(exit_insert_mode, 0); - SP->_ip_cost = 0; + SP_PARM->_smir_cost = CostOf(enter_insert_mode, 0); + SP_PARM->_rmir_cost = CostOf(exit_insert_mode, 0); + SP_PARM->_ip_cost = 0; if (insert_padding) { - SP->_ip_cost = CostOf(insert_padding, 0); + SP_PARM->_ip_cost = CostOf(insert_padding, 0); } /* @@ -335,7 +369,7 @@ _nc_mvcur_init(void) * can treat it like absolute screen addressing. This seems to be true * for all cursor_mem_address terminal types in the terminfo database. */ - SP->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; + SP_PARM->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; /* * Parametrized local-motion strings. This static cost computation @@ -361,40 +395,43 @@ _nc_mvcur_init(void) * All these averages depend on the assumption that all parameter values * are equally probable. */ - SP->_cup_cost = CostOf(TPARM_2(SP->_address_cursor, 23, 23), 1); - SP->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); - SP->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); - SP->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); - SP->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); - SP->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); - SP->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); + SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1); + SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); + SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); + SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); + SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); + SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); /* non-parameterized screen-update strings */ - SP->_ed_cost = NormalizedCost(clr_eos, 1); - SP->_el_cost = NormalizedCost(clr_eol, 1); - SP->_el1_cost = NormalizedCost(clr_bol, 1); - SP->_dch1_cost = NormalizedCost(delete_character, 1); - SP->_ich1_cost = NormalizedCost(insert_character, 1); + SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1); + SP_PARM->_el_cost = NormalizedCost(clr_eol, 1); + SP_PARM->_el1_cost = NormalizedCost(clr_bol, 1); + SP_PARM->_dch1_cost = NormalizedCost(delete_character, 1); + SP_PARM->_ich1_cost = NormalizedCost(insert_character, 1); /* * If this is a bce-terminal, we want to bias the choice so we use clr_eol * rather than spaces at the end of a line. */ if (back_color_erase) - SP->_el_cost = 0; + SP_PARM->_el_cost = 0; /* parameterized screen-update strings */ - SP->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); - SP->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); - SP->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); - SP->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); + SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); + SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); + SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); + SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); - SP->_cup_ch_cost = NormalizedCost(TPARM_2(SP->_address_cursor, 23, 23), 1); - SP->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); - SP->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); - SP->_inline_cost = min(SP->_cup_ch_cost, - min(SP->_hpa_ch_cost, - SP->_cuf_ch_cost)); + SP_PARM->_cup_ch_cost = NormalizedCost( + TPARM_2(SP_PARM->_address_cursor, + 23, 23), + 1); + SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); + SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost, + min(SP_PARM->_hpa_ch_cost, + SP_PARM->_cuf_ch_cost)); /* * If save_cursor is used within enter_ca_mode, we should not use it for @@ -411,30 +448,42 @@ _nc_mvcur_init(void) } /* - * A different, possibly better way to arrange this would be to set - * SP->_endwin = TRUE at window initialization time and let this be + * A different, possibly better way to arrange this would be to set the + * SCREEN's _endwin to TRUE at window initialization time and let this be * called by doupdate's return-from-shellout code. */ - _nc_mvcur_resume(); + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_wrap(void) +_nc_mvcur_init(void) +{ + NCURSES_SP_NAME(_nc_mvcur_init) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0) /* wrap up cursor-addressing mode */ { /* leave cursor at screen bottom */ - mvcur(-1, -1, screen_lines - 1, 0); + TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0); + + if (!SP_PARM || !IsTermInfo(SP_PARM)) + return; /* set cursor to normal mode */ - if (SP->_cursor != -1) { - int cursor = SP->_cursor; - curs_set(1); - SP->_cursor = cursor; + if (SP_PARM->_cursor != -1) { + int cursor = SP_PARM->_cursor; + NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx 1); + SP_PARM->_cursor = cursor; } if (exit_ca_mode) { - TPUTS_TRACE("exit_ca_mode"); - putp(exit_ca_mode); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "exit_ca_mode", + exit_ca_mode); } /* * Reset terminal's tab counter. There's a long-time bug that @@ -444,9 +493,17 @@ _nc_mvcur_wrap(void) * escape sequences that reset things as column positions. * Utter a \r to reset this invisibly. */ - _nc_outch('\r'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_mvcur_wrap(void) +{ + NCURSES_SP_NAME(_nc_mvcur_wrap) (CURRENT_SCREEN); +} +#endif + /**************************************************************************** * * Optimized cursor movement @@ -459,7 +516,7 @@ _nc_mvcur_wrap(void) static NCURSES_INLINE int repeated_append(string_desc * target, int total, int num, int repeat, const char *src) { - size_t need = repeat * strlen(src); + size_t need = (size_t) repeat * strlen(src); if (need < target->s_size) { while (repeat-- > 0) { @@ -486,8 +543,13 @@ repeated_append(string_desc * target, int total, int num, int repeat, const char #define LASTTAB(fr) ((fr > 0) ? ((fr - 1) / init_tabs) * init_tabs : -1) static int -relative_move(string_desc * target, int from_y, int from_x, int to_y, int - to_x, bool ovw) +relative_move(NCURSES_SP_DCLx + string_desc * target, + int from_y, + int from_x, + int to_y, + int to_x, + bool ovw) /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */ { string_desc save; @@ -500,38 +562,38 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (row_address != 0 && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) { - vcost = SP->_vpa_cost; + vcost = SP_PARM->_vpa_cost; } if (to_y > from_y) { n = (to_y - from_y); if (parm_down_cursor - && SP->_cud_cost < vcost + && SP_PARM->_cud_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_down_cursor, n))) { - vcost = SP->_cud_cost; + vcost = SP_PARM->_cud_cost; } if (cursor_down - && (*cursor_down != '\n' || SP->_nl) - && (n * SP->_cud1_cost < vcost)) { + && (*cursor_down != '\n' || SP_PARM->_nl) + && (n * SP_PARM->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP->_cud1_cost, n, cursor_down); + SP_PARM->_cud1_cost, n, cursor_down); } } else { /* (to_y < from_y) */ n = (from_y - to_y); if (parm_up_cursor - && SP->_cuu_cost < vcost + && SP_PARM->_cuu_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_up_cursor, n))) { - vcost = SP->_cuu_cost; + vcost = SP_PARM->_cuu_cost; } - if (cursor_up && (n * SP->_cuu1_cost < vcost)) { + if (cursor_up && (n * SP_PARM->_cuu1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP->_cuu1_cost, n, cursor_up); + SP_PARM->_cuu1_cost, n, cursor_up); } } @@ -550,17 +612,17 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (column_address && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(column_address, to_x))) { - hcost = SP->_hpa_cost; + hcost = SP_PARM->_hpa_cost; } if (to_x > from_x) { n = to_x - from_x; if (parm_right_cursor - && SP->_cuf_cost < hcost + && SP_PARM->_cuf_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_right_cursor, n))) { - hcost = SP->_cuf_cost; + hcost = SP_PARM->_cuf_cost; } if (cursor_right) { @@ -575,7 +637,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int for (fr = from_x; (nxt = NEXTTAB(fr)) <= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP->_ht_cost, 1, tab); + SP_PARM->_ht_cost, 1, tab); if (lhcost == INFINITY) break; } @@ -599,7 +661,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int && n < (int) check.s_size && vcost == 0 && str[0] == '\0') { - int wanted = CharOf(WANT_CHAR(to_y, from_x)); + int wanted = CharOf(WANT_CHAR(SP_PARM, to_y, from_x)); if (is8bits(wanted) && isdigit(wanted)) ovw = FALSE; } @@ -616,8 +678,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) { - NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i); - if (!SameAttrOf(ch, SCREEN_ATTRS(SP)) + NCURSES_CH_T ch = WANT_CHAR(SP_PARM, to_y, from_x + i); + if (!SameAttrOf(ch, SCREEN_ATTRS(SP_PARM)) #if USE_WIDEC_SUPPORT || !Charable(ch) #endif @@ -631,13 +693,13 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) - *check.s_tail++ = (char) CharOf(WANT_CHAR(to_y, + *check.s_tail++ = (char) CharOf(WANT_CHAR(SP_PARM, to_y, from_x + i)); *check.s_tail = '\0'; - check.s_size -= n; - lhcost += n * SP->_char_padding; + check.s_size -= (size_t) n; + lhcost += n * SP_PARM->_char_padding; } else { - lhcost = repeated_append(&check, lhcost, SP->_cuf1_cost, + lhcost = repeated_append(&check, lhcost, SP_PARM->_cuf1_cost, n, cursor_right); } @@ -650,10 +712,10 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int n = from_x - to_x; if (parm_left_cursor - && SP->_cub_cost < hcost + && SP_PARM->_cub_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_left_cursor, n))) { - hcost = SP->_cub_cost; + hcost = SP_PARM->_cub_cost; } if (cursor_left) { @@ -667,7 +729,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int for (fr = from_x; (nxt = LASTTAB(fr)) >= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP->_cbt_cost, 1, back_tab); + SP_PARM->_cbt_cost, + 1, back_tab); if (lhcost == INFINITY) break; } @@ -676,7 +739,9 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int } #endif /* USE_HARD_TABS */ - lhcost = repeated_append(&check, lhcost, SP->_cub1_cost, n, cursor_left); + lhcost = repeated_append(&check, lhcost, + SP_PARM->_cub1_cost, + n, cursor_left); if (lhcost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), str)) { @@ -705,7 +770,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int */ static NCURSES_INLINE int -onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) +onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) /* onscreen move from (yold, xold) to (ynew, xnew) */ { string_desc result; @@ -723,9 +788,9 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) #define InitResult _nc_str_init(&result, buffer, sizeof(buffer)) /* tactic #0: use direct cursor addressing */ - if (_nc_safe_strcpy(InitResult, TPARM_2(SP->_address_cursor, ynew, xnew))) { + if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) { tactic = 0; - usecost = SP->_cup_cost; + usecost = SP_PARM->_cup_cost; #if defined(TRACE) || defined(NCURSES_TEST) if (!(_nc_optimize_enable & OPTIMIZE_MVCUR)) @@ -740,7 +805,7 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) * (like, say, local-movement \n getting mapped to some obscure * character because A_ALTCHARSET is on). */ - if (yold == -1 || xold == -1 || NOT_LOCAL(yold, xold, ynew, xnew)) { + if (yold == -1 || xold == -1 || NOT_LOCAL(SP_PARM, yold, xold, ynew, xnew)) { #if defined(MAIN) || defined(NCURSES_TEST) if (!profiling) { (void) fputs("nonlocal\n", stderr); @@ -754,8 +819,10 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) #ifndef NO_OPTIMIZE /* tactic #1: use local movement */ if (yold != -1 && xold != -1 - && ((newcost = relative_move(NullResult, yold, xold, ynew, xnew, - ovw)) != INFINITY) + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold, xold, + ynew, xnew, ovw)) != INFINITY) && newcost < usecost) { tactic = 1; usecost = newcost; @@ -763,42 +830,51 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) /* tactic #2: use carriage-return + local movement */ if (yold != -1 && carriage_return - && ((newcost = relative_move(NullResult, yold, 0, ynew, xnew, ovw)) - != INFINITY) - && SP->_cr_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_cr_cost + newcost < usecost) { tactic = 2; - usecost = SP->_cr_cost + newcost; + usecost = SP_PARM->_cr_cost + newcost; } /* tactic #3: use home-cursor + local movement */ if (cursor_home - && ((newcost = relative_move(NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY) - && SP->_home_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + 0, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_home_cost + newcost < usecost) { tactic = 3; - usecost = SP->_home_cost + newcost; + usecost = SP_PARM->_home_cost + newcost; } /* tactic #4: use home-down + local movement */ if (cursor_to_ll - && ((newcost = relative_move(NullResult, screen_lines - 1, 0, ynew, - xnew, ovw)) != INFINITY) - && SP->_ll_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + screen_lines(SP_PARM) - 1, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_ll_cost + newcost < usecost) { tactic = 4; - usecost = SP->_ll_cost + newcost; + usecost = SP_PARM->_ll_cost + newcost; } /* * tactic #5: use left margin for wrap to right-hand side, * unless strange wrap behavior indicated by xenl might hose us. */ - t5_cr_cost = (xold > 0 ? SP->_cr_cost : 0); + t5_cr_cost = (xold > 0 ? SP_PARM->_cr_cost : 0); if (auto_left_margin && !eat_newline_glitch && yold > 0 && cursor_left - && ((newcost = relative_move(NullResult, yold - 1, screen_columns - - 1, ynew, xnew, ovw)) != INFINITY) - && t5_cr_cost + SP->_cub1_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold - 1, screen_columns(SP_PARM) - 1, + ynew, xnew, ovw)) != INFINITY) + && t5_cr_cost + SP_PARM->_cub1_cost + newcost < usecost) { tactic = 5; - usecost = t5_cr_cost + SP->_cub1_cost + newcost; + usecost = t5_cr_cost + SP_PARM->_cub1_cost + newcost; } /* @@ -808,26 +884,39 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) InitResult; switch (tactic) { case 1: - (void) relative_move(&result, yold, xold, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold, xold, + ynew, xnew, ovw); break; case 2: (void) _nc_safe_strcpy(&result, carriage_return); - (void) relative_move(&result, yold, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold, 0, + ynew, xnew, ovw); break; case 3: (void) _nc_safe_strcpy(&result, cursor_home); - (void) relative_move(&result, 0, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, 0, 0, + ynew, xnew, ovw); break; case 4: (void) _nc_safe_strcpy(&result, cursor_to_ll); - (void) relative_move(&result, screen_lines - 1, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + screen_lines(SP_PARM) - 1, 0, + ynew, xnew, ovw); break; case 5: if (xold > 0) (void) _nc_safe_strcat(&result, carriage_return); (void) _nc_safe_strcat(&result, cursor_left); - (void) relative_move(&result, yold - 1, screen_columns - 1, ynew, - xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold - 1, screen_columns(SP_PARM) - 1, + ynew, xnew, ovw); break; } #endif /* !NO_OPTIMIZE */ @@ -845,25 +934,26 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) if (usecost != INFINITY) { TPUTS_TRACE("mvcur"); - tputs(buffer, 1, _nc_outch); - SP->_cursrow = ynew; - SP->_curscol = xnew; + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + buffer, 1, NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_cursrow = ynew; + SP_PARM->_curscol = xnew; return (OK); } else return (ERR); } NCURSES_EXPORT(int) -mvcur(int yold, int xold, int ynew, int xnew) +TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { NCURSES_CH_T oldattr; int code; - TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"), - yold, xold, ynew, xnew)); + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), + (void *) SP_PARM, yold, xold, ynew, xnew)); - if (SP == 0) { + if (SP_PARM == 0) { code = ERR; } else if (yold == ynew && xold == xnew) { code = OK; @@ -874,9 +964,9 @@ mvcur(int yold, int xold, int ynew, int xnew) * column position implied by wraparound or the lack thereof and * rolling up the screen to get ynew on the screen. */ - if (xnew >= screen_columns) { - ynew += xnew / screen_columns; - xnew %= screen_columns; + if (xnew >= screen_columns(SP_PARM)) { + ynew += xnew / screen_columns(SP_PARM); + xnew %= screen_columns(SP_PARM); } /* @@ -884,38 +974,40 @@ mvcur(int yold, int xold, int ynew, int xnew) * character set -- these have a strong tendency to screw up the CR & * LF used for local character motions! */ - oldattr = SCREEN_ATTRS(SP); + oldattr = SCREEN_ATTRS(SP_PARM); if ((AttrOf(oldattr) & A_ALTCHARSET) || (AttrOf(oldattr) && !move_standout_mode)) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(A_NORMAL, 0); + (void) VIDATTR(SP_PARM, A_NORMAL, 0); } - if (xold >= screen_columns) { + if (xold >= screen_columns(SP_PARM)) { int l; - if (SP->_nl) { - l = (xold + 1) / screen_columns; + if (SP_PARM->_nl) { + l = (xold + 1) / screen_columns(SP_PARM); yold += l; - if (yold >= screen_lines) - l -= (yold - screen_lines - 1); + if (yold >= screen_lines(SP_PARM)) + l -= (yold - screen_lines(SP_PARM) - 1); if (l > 0) { if (carriage_return) { - TPUTS_TRACE("carriage_return"); - putp(carriage_return); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "carriage_return", + carriage_return); } else - _nc_outch('\r'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); xold = 0; while (l > 0) { if (newline) { - TPUTS_TRACE("newline"); - putp(newline); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "newline", + newline); } else - _nc_outch('\n'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n'); l--; } } @@ -929,27 +1021,35 @@ mvcur(int yold, int xold, int ynew, int xnew) } } - if (yold > screen_lines - 1) - yold = screen_lines - 1; - if (ynew > screen_lines - 1) - ynew = screen_lines - 1; + if (yold > screen_lines(SP_PARM) - 1) + yold = screen_lines(SP_PARM) - 1; + if (ynew > screen_lines(SP_PARM) - 1) + ynew = screen_lines(SP_PARM) - 1; /* destination location is on screen now */ - code = onscreen_mvcur(yold, xold, ynew, xnew, TRUE); + code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE); /* * Restore attributes if we disabled them before moving. */ - if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP))) { + if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP_PARM))) { TR(TRACE_CHARPUT, ("turning on (%#lx) %s after move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(AttrOf(oldattr), GetPair(oldattr)); + (void) VIDATTR(SP_PARM, AttrOf(oldattr), GetPair(oldattr)); } } returnCode(code); } +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +mvcur(int yold, int xold, int ynew, int xnew) +{ + return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew); +} +#endif + #if defined(TRACE) || defined(NCURSES_TEST) NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; #endif @@ -1212,25 +1312,25 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) speeds[i], overhead, totalest); } } else if (buf[0] == 'c') { - (void) printf("char padding: %d\n", SP->_char_padding); - (void) printf("cr cost: %d\n", SP->_cr_cost); - (void) printf("cup cost: %d\n", SP->_cup_cost); - (void) printf("home cost: %d\n", SP->_home_cost); - (void) printf("ll cost: %d\n", SP->_ll_cost); + (void) printf("char padding: %d\n", CURRENT_SCREEN->_char_padding); + (void) printf("cr cost: %d\n", CURRENT_SCREEN->_cr_cost); + (void) printf("cup cost: %d\n", CURRENT_SCREEN->_cup_cost); + (void) printf("home cost: %d\n", CURRENT_SCREEN->_home_cost); + (void) printf("ll cost: %d\n", CURRENT_SCREEN->_ll_cost); #if USE_HARD_TABS - (void) printf("ht cost: %d\n", SP->_ht_cost); - (void) printf("cbt cost: %d\n", SP->_cbt_cost); + (void) printf("ht cost: %d\n", CURRENT_SCREEN->_ht_cost); + (void) printf("cbt cost: %d\n", CURRENT_SCREEN->_cbt_cost); #endif /* USE_HARD_TABS */ - (void) printf("cub1 cost: %d\n", SP->_cub1_cost); - (void) printf("cuf1 cost: %d\n", SP->_cuf1_cost); - (void) printf("cud1 cost: %d\n", SP->_cud1_cost); - (void) printf("cuu1 cost: %d\n", SP->_cuu1_cost); - (void) printf("cub cost: %d\n", SP->_cub_cost); - (void) printf("cuf cost: %d\n", SP->_cuf_cost); - (void) printf("cud cost: %d\n", SP->_cud_cost); - (void) printf("cuu cost: %d\n", SP->_cuu_cost); - (void) printf("hpa cost: %d\n", SP->_hpa_cost); - (void) printf("vpa cost: %d\n", SP->_vpa_cost); + (void) printf("cub1 cost: %d\n", CURRENT_SCREEN->_cub1_cost); + (void) printf("cuf1 cost: %d\n", CURRENT_SCREEN->_cuf1_cost); + (void) printf("cud1 cost: %d\n", CURRENT_SCREEN->_cud1_cost); + (void) printf("cuu1 cost: %d\n", CURRENT_SCREEN->_cuu1_cost); + (void) printf("cub cost: %d\n", CURRENT_SCREEN->_cub_cost); + (void) printf("cuf cost: %d\n", CURRENT_SCREEN->_cuf_cost); + (void) printf("cud cost: %d\n", CURRENT_SCREEN->_cud_cost); + (void) printf("cuu cost: %d\n", CURRENT_SCREEN->_cuu_cost); + (void) printf("hpa cost: %d\n", CURRENT_SCREEN->_hpa_cost); + (void) printf("vpa cost: %d\n", CURRENT_SCREEN->_vpa_cost); } else if (buf[0] == 'x' || buf[0] == 'q') break; else diff --git a/ncurses/tty/lib_tstp.c b/ncurses/tty/lib_tstp.c index 06c8411caa4..70f805a2ad5 100644 --- a/ncurses/tty/lib_tstp.c +++ b/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -46,7 +46,7 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.37 2008/05/03 16:24:56 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.41 2010/05/15 21:31:12 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -59,16 +59,20 @@ static const char * signal_name(int sig) { switch (sig) { +#ifdef SIGALRM case SIGALRM: return "SIGALRM"; +#endif #ifdef SIGCONT case SIGCONT: return "SIGCONT"; #endif case SIGINT: return "SIGINT"; +#ifdef SIGQUIT case SIGQUIT: return "SIGQUIT"; +#endif case SIGTERM: return "SIGTERM"; #ifdef SIGTSTP @@ -136,6 +140,7 @@ signal_name(int sig) static void tstp(int dummy GCC_UNUSED) { + SCREEN *sp = CURRENT_SCREEN; sigset_t mask, omask; sigaction_t act, oact; @@ -154,11 +159,11 @@ tstp(int dummy GCC_UNUSED) * parent was stopped before us, and we would likely pick up the * settings already modified by the shell. */ - if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */ + if (sp != 0 && !sp->_endwin) /* don't do this if we're not in curses */ #if HAVE_TCGETPGRP if (tcgetpgrp(STDIN_FILENO) == getpgrp()) #endif - def_prog_mode(); + NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG); /* * Block window change and timer signals. The latter @@ -166,7 +171,9 @@ tstp(int dummy GCC_UNUSED) * to repaint the screen. */ (void) sigemptyset(&mask); +#ifdef SIGALRM (void) sigaddset(&mask, SIGALRM); +#endif #if USE_SIGWINCH (void) sigaddset(&mask, SIGWINCH); #endif @@ -185,7 +192,7 @@ tstp(int dummy GCC_UNUSED) * End window mode, which also resets the terminal state to the * original (pre-curses) modes. */ - endwin(); + NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); /* Unblock SIGTSTP. */ (void) sigemptyset(&mask); @@ -212,19 +219,19 @@ tstp(int dummy GCC_UNUSED) T(("SIGCONT received")); sigaction(SIGTSTP, &oact, NULL); - flushinp(); + NCURSES_SP_NAME(flushinp) (NCURSES_SP_ARG); /* * If the user modified the tty state while suspended, he wants * those changes to stick. So save the new "default" terminal state. */ - def_shell_mode(); + NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG); /* * This relies on the fact that doupdate() will restore the * program-mode tty state, and issue enter_ca_mode if need be. */ - doupdate(); + NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG); /* Reset the signals. */ (void) sigprocmask(SIG_SETMASK, &omask, NULL); @@ -234,6 +241,8 @@ tstp(int dummy GCC_UNUSED) static void cleanup(int sig) { + SCREEN *sp = CURRENT_SCREEN; + /* * Actually, doing any sort of I/O from within an signal handler is * "unsafe". But we'll _try_ to clean up the screen and terminal @@ -241,7 +250,10 @@ cleanup(int sig) */ if (!_nc_globals.cleanup_nested++ && (sig == SIGINT - || sig == SIGQUIT)) { +#ifdef SIGQUIT + || sig == SIGQUIT +#endif + )) { #if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t act; sigemptyset(&act.sa_mask); @@ -257,12 +269,12 @@ cleanup(int sig) if (scan->_ofp != 0 && isatty(fileno(scan->_ofp))) { scan->_cleanup = TRUE; - scan->_outch = _nc_outch; + scan->_outch = NCURSES_SP_NAME(_nc_outch); } set_term(scan); - endwin(); - if (SP) - SP->_endwin = FALSE; /* in case we have an atexit! */ + NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); + if (sp) + sp->_endwin = FALSE; /* in case we have an atexit! */ } } } @@ -274,6 +286,13 @@ static void sigwinch(int sig GCC_UNUSED) { _nc_globals.have_sigwinch = 1; +# if USE_PTHREADS_EINTR + if (_nc_globals.read_thread) { + if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) + pthread_kill(_nc_globals.read_thread, SIGWINCH); + _nc_globals.read_thread = 0; + } +# endif } #endif /* USE_SIGWINCH */ diff --git a/ncurses/tty/lib_twait.c b/ncurses/tty/lib_twait.c index 16d12edbbe3..329ec29a019 100644 --- a/ncurses/tty/lib_twait.c +++ b/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -65,10 +65,12 @@ # include # endif #endif - +#ifdef __MINGW32__ +# include +#endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.59 2008/08/30 20:08:19 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $") static long _nc_gettime(TimeType * t0, bool first) @@ -124,15 +126,27 @@ _nc_eventlist_timeout(_nc_eventlist * evl) } #endif /* NCURSES_WGETCH_EVENTS */ +#if (USE_FUNC_POLL || HAVE_SELECT) +# define MAYBE_UNUSED +#else +# define MAYBE_UNUSED GCC_UNUSED +#endif + +#if (USE_FUNC_POLL || HAVE_SELECT) +# define MAYBE_UNUSED +#else +# define MAYBE_UNUSED GCC_UNUSED +#endif + /* * Wait a specified number of milliseconds, returning nonzero if the timer * didn't expire before there is activity on the specified file descriptors. * The file-descriptors are specified by the mode: - * 0 - none (absolute time) - * 1 - ncurses' normal input-descriptor - * 2 - mouse descriptor, if any - * 3 - either input or mouse. - * + * TW_NONE 0 - none (absolute time) + * TW_INPUT 1 - ncurses' normal input-descriptor + * TW_MOUSE 2 - mouse descriptor, if any + * TW_ANY 3 - either input or mouse. + * TW_EVENT 4 - * Experimental: if NCURSES_WGETCH_EVENTS is defined, (mode & 4) determines * whether to pay attention to evl argument. If set, the smallest of * millisecond and of timeout of evl is taken. @@ -143,16 +157,18 @@ _nc_eventlist_timeout(_nc_eventlist * evl) * descriptors. */ NCURSES_EXPORT(int) -_nc_timed_wait(SCREEN *sp, - int mode, +_nc_timed_wait(SCREEN *sp MAYBE_UNUSED, + int mode MAYBE_UNUSED, int milliseconds, int *timeleft EVENTLIST_2nd(_nc_eventlist * evl)) { - int fd; int count; - int result = 0; + int result = TW_NONE; TimeType t0; +#if (USE_FUNC_POLL || HAVE_SELECT) + int fd; +#endif #ifdef NCURSES_WGETCH_EVENTS int timeout_is_event = 0; @@ -174,7 +190,7 @@ _nc_timed_wait(SCREEN *sp, milliseconds, mode)); #ifdef NCURSES_WGETCH_EVENTS - if (mode & 4) { + if (mode & TW_EVENT) { int event_delay = _nc_eventlist_timeout(evl); if (event_delay >= 0 @@ -193,7 +209,7 @@ _nc_timed_wait(SCREEN *sp, count = 0; #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) + if ((mode & TW_EVENT) && evl) evl->result_flags = 0; #endif @@ -201,23 +217,23 @@ _nc_timed_wait(SCREEN *sp, memset(fd_list, 0, sizeof(fd_list)); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) + if ((mode & TW_EVENT) && evl) fds = typeMalloc(struct pollfd, MIN_FDS + evl->count); #endif - if (mode & 1) { + if (mode & TW_INPUT) { fds[count].fd = sp->_ifd; fds[count].events = POLLIN; count++; } - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0) { fds[count].fd = fd; fds[count].events = POLLIN; count++; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -234,7 +250,7 @@ _nc_timed_wait(SCREEN *sp, result = poll(fds, (unsigned) count, milliseconds); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { int c; if (!result) @@ -276,8 +292,8 @@ _nc_timed_wait(SCREEN *sp, * * FIXME: this assumes mode&1 if milliseconds < 0 (see lib_getch.c). */ - result = 0; - if (mode & 1) { + result = TW_NONE; + if (mode & TW_INPUT) { int step = (milliseconds < 0) ? 0 : 5000; bigtime_t d; bigtime_t useconds = milliseconds * 1000; @@ -313,17 +329,17 @@ _nc_timed_wait(SCREEN *sp, */ FD_ZERO(&set); - if (mode & 1) { + if (mode & TW_INPUT) { FD_SET(sp->_ifd, &set); count = sp->_ifd + 1; } - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0) { FD_SET(fd, &set); count = max(fd, count) + 1; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -346,7 +362,7 @@ _nc_timed_wait(SCREEN *sp, } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { evl->result_flags = 0; for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -370,7 +386,7 @@ _nc_timed_wait(SCREEN *sp, returntime = _nc_gettime(&t0, FALSE); if (milliseconds >= 0) - milliseconds -= (returntime - starttime); + milliseconds -= (int) (returntime - starttime); #ifdef NCURSES_WGETCH_EVENTS if (evl) { @@ -428,22 +444,22 @@ _nc_timed_wait(SCREEN *sp, } } #elif defined(__BEOS__) - result = 1; /* redundant, but simple */ + result = TW_INPUT; /* redundant, but simple */ #elif HAVE_SELECT - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0 && FD_ISSET(fd, &set)) - result |= 2; - if ((mode & 1) + result |= TW_MOUSE; + if ((mode & TW_INPUT) && FD_ISSET(sp->_ifd, &set)) - result |= 1; + result |= TW_INPUT; #endif } else result = 0; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl && evl->result_flags) - result |= 4; + if ((mode & TW_EVENT) && evl && evl->result_flags) + result |= TW_EVENT; #endif return (result); diff --git a/ncurses/tty/lib_vidattr.c b/ncurses/tty/lib_vidattr.c index ac2a74f08e0..9656b3c70ee 100644 --- a/ncurses/tty/lib_vidattr.c +++ b/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996 on * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -63,11 +64,16 @@ */ #include -#include -MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) +MODULE_ID("$Id: lib_vidattr.c,v 1.61 2010/06/05 22:22:04 tom Exp $") + +#define doPut(mode) \ + TPUTS_TRACE(#mode); \ + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -78,40 +84,49 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") /* if there is no current screen, assume we *can* do color */ #define SetColorsIf(why,old_attr) \ if (can_color && (why)) { \ - int old_pair = PAIR_NUMBER(old_attr); \ + int old_pair = PairNumber(old_attr); \ TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \ if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - _nc_do_color(old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \ + (short) old_pair, \ + (short) pair, \ + reverse, outc); \ } \ } #define PreviousAttr _nc_prescreen.previous_attr NCURSES_EXPORT(int) -vidputs(chtype newmode, int (*outc) (int)) +NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx + chtype newmode, + NCURSES_SP_OUTC outc) { attr_t turn_on, turn_off; int pair; bool reverse = FALSE; - bool can_color = (SP == 0 || SP->_coloron); + bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); + bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); #else #define fix_pair0 FALSE #endif newmode &= A_ATTRIBUTES; - T((T_CALLED("vidputs(%s)"), _traceattr(newmode))); + + T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); + + if (!IsTermInfo(SP_PARM)) + returnCode(ERR); /* this allows us to go on whether or not newterm() has been called */ - if (SP) - PreviousAttr = AttrOf(SCREEN_ATTRS(SP)); + if (SP_PARM) + PreviousAttr = AttrOf(SCREEN_ATTRS(SP_PARM)); TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(PreviousAttr))); - if ((SP != 0) + if ((SP_PARM != 0) && (magic_cookie_glitch > 0)) { #if USE_XMC_SUPPORT static const chtype table[] = @@ -135,7 +150,7 @@ vidputs(chtype newmode, int (*outc) (int)) * the terminfo max_attributes value. */ for (n = 0; n < SIZEOF(table); ++n) { - if ((table[n] & SP->_ok_attributes) == 0) { + if ((table[n] & SP_PARM->_ok_attributes) == 0) { newmode &= ~table[n]; } else if ((table[n] & newmode) != 0) { if (used++ >= limit) { @@ -148,7 +163,7 @@ vidputs(chtype newmode, int (*outc) (int)) } } #else - newmode &= ~(SP->_xmc_suppress); + newmode &= ~(SP_PARM->_xmc_suppress); #endif TR(TRACE_ATTRS, ("suppressed attribute is %s", _traceattr(newmode))); } @@ -172,7 +187,7 @@ vidputs(chtype newmode, int (*outc) (int)) * A_ALTCHARSET (256) down 2 to line up. We use the NCURSES_BITS * macro so this will work properly for the wide-character layout. */ - unsigned value = no_color_video; + unsigned value = (unsigned) no_color_video; attr_t mask = NCURSES_BITS((value & 63) | ((value & 192) << 1) | ((value & 256) >> 2), 8); @@ -188,7 +203,7 @@ vidputs(chtype newmode, int (*outc) (int)) if (newmode == PreviousAttr) returnCode(OK); - pair = PAIR_NUMBER(newmode); + pair = PairNumber(newmode); if (reverse) { newmode &= ~A_REVERSE; @@ -208,10 +223,10 @@ vidputs(chtype newmode, int (*outc) (int)) if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -222,16 +237,18 @@ vidputs(chtype newmode, int (*outc) (int)) } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - tputs(tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + tparm(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), + 1, outc); PreviousAttr &= ALL_BUT_COLOR; } SetColorsIf((pair != 0) || fix_pair0, PreviousAttr); @@ -241,11 +258,11 @@ vidputs(chtype newmode, int (*outc) (int)) TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -282,28 +299,53 @@ vidputs(chtype newmode, int (*outc) (int)) if (reverse) newmode |= A_REVERSE; - if (SP) - SetAttr(SCREEN_ATTRS(SP), newmode); + if (SP_PARM) + SetAttr(SCREEN_ATTRS(SP_PARM), newmode); else PreviousAttr = newmode; returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +vidputs(chtype newmode, NCURSES_OUTC outc) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, + newmode, + _nc_outc_wrapper); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode) +{ + T((T_CALLED("vidattr(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx + newmode, + NCURSES_SP_NAME(_nc_outch))); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) vidattr(chtype newmode) { - T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); - - returnCode(vidputs(newmode, _nc_outch)); + return NCURSES_SP_NAME(vidattr) (CURRENT_SCREEN, newmode); } +#endif NCURSES_EXPORT(chtype) -termattrs(void) +NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) { chtype attrs = A_NORMAL; - T((T_CALLED("termattrs()"))); + T((T_CALLED("termattrs(%p)"), (void *) SP_PARM)); +#ifdef USE_TERM_DRIVER + if (HasTerminal(SP_PARM)) + attrs = CallDriver(SP_PARM, conattr); +#else + if (enter_alt_charset_mode) attrs |= A_ALTCHARSET; @@ -331,8 +373,17 @@ termattrs(void) if (enter_underline_mode) attrs |= A_UNDERLINE; - if (SP->_coloron) + if (SP_PARM->_coloron) attrs |= A_COLOR; - returnChar(attrs); +#endif + returnChtype(attrs); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(chtype) +termattrs(void) +{ + return NCURSES_SP_NAME(termattrs) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index 6a3a0c8e934..f0d2369c18d 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /*----------------------------------------------------------------- @@ -38,12 +39,16 @@ * * The routine doupdate() and its dependents. * All physical output is concentrated here (except _nc_outch() - * in lib_tputs.c). + * in lib_tputs.c). * *-----------------------------------------------------------------*/ #include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #if defined __HAIKU__ && defined __BEOS__ #undef __BEOS__ #endif @@ -76,9 +81,8 @@ #endif #include -#include -MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -91,7 +95,7 @@ MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") */ #define CHECK_INTERVAL 5 -#define FILL_BCE() (SP->_coloron && !SP->_default_color && !back_color_erase) +#define FILL_BCE(sp) (sp->_coloron && !sp->_default_color && !back_color_erase) static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_CH_T normal = NewChar(BLANK_TEXT); @@ -103,13 +107,23 @@ static NCURSES_CH_T normal = NewChar(BLANK_TEXT); */ /* #define POSITION_DEBUG */ -static NCURSES_INLINE NCURSES_CH_T ClrBlank(WINDOW *win); +static NCURSES_INLINE NCURSES_CH_T ClrBlank(NCURSES_SP_DCLx WINDOW *win); + +#if NCURSES_SP_FUNCS +static int ClrBottom(SCREEN *, int total); +static void ClearScreen(SCREEN *, NCURSES_CH_T blank); +static void ClrUpdate(SCREEN *); +static void DelChar(SCREEN *, int count); +static void InsStr(SCREEN *, NCURSES_CH_T * line, int count); +static void TransformLine(SCREEN *, int const lineno); +#else static int ClrBottom(int total); static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); static void InsStr(NCURSES_CH_T * line, int count); static void TransformLine(int const lineno); +#endif #ifdef POSITION_DEBUG /**************************************************************************** @@ -119,7 +133,7 @@ static void TransformLine(int const lineno); ****************************************************************************/ static void -position_check(int expected_y, int expected_x, char *legend) +position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) /* check to see if the real cursor position matches the virtual */ { char buf[20]; @@ -129,10 +143,10 @@ position_check(int expected_y, int expected_x, char *legend) if (!_nc_tracing || (expected_y < 0 && expected_x < 0)) return; - _nc_flush(); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); memset(buf, '\0', sizeof(buf)); - putp("\033[6n"); /* only works on ANSI-compatibles */ - _nc_flush(); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx "\033[6n"); /* only works on ANSI-compatibles */ + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); *(s = buf) = 0; do { int ask = sizeof(buf) - 1 - (s - buf); @@ -152,8 +166,12 @@ position_check(int expected_y, int expected_x, char *legend) if (expected_y < 0) expected_y = y - 1; if (y - 1 != expected_y || x - 1 != expected_x) { - beep(); - tputs(tparm("\033[%d;%dH", expected_y + 1, expected_x + 1), 1, _nc_outch); + NCURSES_SP_NAME(beep) (NCURSES_SP_ARG); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + tparm("\033[%d;%dH", + expected_y + 1, + expected_x + 1), + 1, NCURSES_SP_NAME(_nc_outch)); _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", y - 1, x - 1, expected_y, expected_x, legend); } else { @@ -162,7 +180,7 @@ position_check(int expected_y, int expected_x, char *legend) } } #else -#define position_check(expected_y, expected_x, legend) /* nothing */ +#define position_check(sp, expected_y, expected_x, legend) /* nothing */ #endif /* POSITION_DEBUG */ /**************************************************************************** @@ -172,19 +190,22 @@ position_check(int expected_y, int expected_x, char *legend) ****************************************************************************/ static NCURSES_INLINE void -GoTo(int const row, int const col) +GoTo(NCURSES_SP_DCLx int const row, int const col) { - TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", - row, col, SP->_cursrow, SP->_curscol)); + TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)", + (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); - position_check(SP->_cursrow, SP->_curscol, "GoTo"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo"); - mvcur(SP->_cursrow, SP->_curscol, row, col); - position_check(SP->_cursrow, SP->_curscol, "GoTo2"); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + row, col); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo2"); } static NCURSES_INLINE void -PutAttrChar(CARG_CH_T ch) +PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) { int chlen = 1; NCURSES_CH_T my_ch; @@ -194,7 +215,7 @@ PutAttrChar(CARG_CH_T ch) TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)", _tracech_t(ch), - SP->_cursrow, SP->_curscol)); + SP_PARM->_cursrow, SP_PARM->_curscol)); #if USE_WIDEC_SUPPORT /* * If this is not a valid character, there is nothing more to do. @@ -224,12 +245,12 @@ PutAttrChar(CARG_CH_T ch) */ if (is8bits(CharOf(CHDEREF(ch))) && (isprint(CharOf(CHDEREF(ch))) - || (SP->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) - || (SP->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) + || (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) + || (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) || (AttrOf(attr) & A_ALTCHARSET && ((CharOfD(ch) < ACS_LEN - && SP->_acs_map != 0 - && SP->_acs_map[CharOfD(ch)] != 0) + && SP_PARM->_acs_map != 0 + && SP_PARM->_acs_map[CharOfD(ch)] != 0) || (CharOfD(ch) >= 128))))) { ; } else { @@ -241,7 +262,7 @@ PutAttrChar(CARG_CH_T ch) #endif if ((AttrOf(attr) & A_ALTCHARSET) - && SP->_acs_map != 0 + && SP_PARM->_acs_map != 0 && CharOfD(ch) < ACS_LEN) { my_ch = CHDEREF(ch); /* work around const param */ #if USE_WIDEC_SUPPORT @@ -251,8 +272,8 @@ PutAttrChar(CARG_CH_T ch) * character, and uses the wide-character mapping when we expect the * normal one to be broken (by mis-design ;-). */ - if (SP->_screen_acs_fix - && SP->_screen_acs_map[CharOf(my_ch)]) { + if (SP_PARM->_screen_acs_fix + && SP_PARM->_screen_acs_map[CharOf(my_ch)]) { RemAttr(attr, A_ALTCHARSET); my_ch = _nc_wacs[CharOf(my_ch)]; } @@ -265,9 +286,9 @@ PutAttrChar(CARG_CH_T ch) */ if (AttrOf(attr) & A_ALTCHARSET) { int j = CharOfD(ch); - chtype temp = UChar(SP->_acs_map[j]); + chtype temp = UChar(SP_PARM->_acs_map[j]); - if (!(SP->_screen_acs_map[j])) { + if (!(SP_PARM->_screen_acs_map[j])) { RemAttr(attr, A_ALTCHARSET); if (temp == 0) temp = ' '; @@ -282,28 +303,28 @@ PutAttrChar(CARG_CH_T ch) ch = CHREF(tilde); } - UpdateAttrs(attr); + UpdateAttrs(SP_PARM, attr); #if !USE_WIDEC_SUPPORT /* FIXME - we do this special case for signal handling, should see how to * make it work for wide characters. */ - if (SP->_outch != 0) { - SP->_outch(UChar(ch)); + if (SP_PARM->_outch != 0) { + SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch)); } else #endif { - PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ + PUTC(CHDEREF(ch), SP_PARM->_ofp); /* macro's fastest... */ COUNT_OUTCHARS(1); } - SP->_curscol += chlen; + SP_PARM->_curscol += chlen; if (char_padding) { TPUTS_TRACE("char_padding"); - putp(char_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx char_padding); } } static bool -check_pending(void) +check_pending(NCURSES_SP_DCL0) /* check for pending input */ { bool have_pending = FALSE; @@ -313,13 +334,13 @@ check_pending(void) * have the refreshing slow down drastically (or stop) if there's an * unread character available. */ - if (SP->_fifohold != 0) + if (SP_PARM->_fifohold != 0) return FALSE; - if (SP->_checkfd >= 0) { + if (SP_PARM->_checkfd >= 0) { #if USE_FUNC_POLL struct pollfd fds[1]; - fds[0].fd = SP->_checkfd; + fds[0].fd = SP_PARM->_checkfd; fds[0].events = POLLIN; if (poll(fds, 1, 0) > 0) { have_pending = TRUE; @@ -347,43 +368,52 @@ check_pending(void) ktimeout.tv_usec = 0; FD_ZERO(&fdset); - FD_SET(SP->_checkfd, &fdset); - if (select(SP->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { + FD_SET(SP_PARM->_checkfd, &fdset); + if (select(SP_PARM->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { have_pending = TRUE; } #endif } if (have_pending) { - SP->_fifohold = 5; - _nc_flush(); + SP_PARM->_fifohold = 5; + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); } return FALSE; } /* put char at lower right corner */ static void -PutCharLR(const ARG_CH_T ch) +PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) { if (!auto_right_margin) { /* we can put the char directly */ - PutAttrChar(ch); + PutAttrChar(NCURSES_SP_ARGx ch); } else if (enter_am_mode && exit_am_mode) { /* we can suppress automargin */ TPUTS_TRACE("exit_am_mode"); - putp(exit_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_am_mode); - PutAttrChar(ch); - SP->_curscol--; - position_check(SP->_cursrow, SP->_curscol, "exit_am_mode"); + PutAttrChar(NCURSES_SP_ARGx ch); + SP_PARM->_curscol--; + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "exit_am_mode"); TPUTS_TRACE("enter_am_mode"); - putp(enter_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_am_mode); } else if ((enter_insert_mode && exit_insert_mode) || insert_character || parm_ich) { - GoTo(screen_lines - 1, screen_columns - 2); - PutAttrChar(ch); - GoTo(screen_lines - 1, screen_columns - 2); - InsStr(newscr->_line[screen_lines - 1].text + screen_columns - 2, 1); + GoTo(NCURSES_SP_ARGx + screen_lines(SP_PARM) - 1, + screen_columns(SP_PARM) - 2); + PutAttrChar(NCURSES_SP_ARGx ch); + GoTo(NCURSES_SP_ARGx + screen_lines(SP_PARM) - 1, + screen_columns(SP_PARM) - 2); + InsStr(NCURSES_SP_ARGx + NewScreen(SP_PARM)->_line[screen_lines(SP_PARM) - 1].text + + screen_columns(SP_PARM) - 2, 1); } } @@ -391,7 +421,7 @@ PutCharLR(const ARG_CH_T ch) * Wrap the cursor position, i.e., advance to the beginning of the next line. */ static void -wrap_cursor(void) +wrap_cursor(NCURSES_SP_DCL0) { if (eat_newline_glitch) { /* @@ -407,40 +437,45 @@ wrap_cursor(void) * it's safe to just tell the code that the cursor is in hyperspace and * let the next mvcur() call straighten things out. */ - SP->_curscol = -1; - SP->_cursrow = -1; + SP_PARM->_curscol = -1; + SP_PARM->_cursrow = -1; } else if (auto_right_margin) { - SP->_curscol = 0; - SP->_cursrow++; + SP_PARM->_curscol = 0; + SP_PARM->_cursrow++; /* * We've actually moved - but may have to work around problems with * video attributes not working. */ - if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP))) { + if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP_PARM))) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before wrapping", - (unsigned long) AttrOf(SCREEN_ATTRS(SP)), - _traceattr(AttrOf(SCREEN_ATTRS(SP))))); - (void) VIDATTR(A_NORMAL, 0); + (unsigned long) AttrOf(SCREEN_ATTRS(SP_PARM)), + _traceattr(AttrOf(SCREEN_ATTRS(SP_PARM))))); + (void) VIDATTR(SP_PARM, A_NORMAL, 0); } } else { - SP->_curscol--; + SP_PARM->_curscol--; } - position_check(SP->_cursrow, SP->_curscol, "wrap_cursor"); + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "wrap_cursor"); } static NCURSES_INLINE void -PutChar(const ARG_CH_T ch) +PutChar(NCURSES_SP_DCLx const ARG_CH_T ch) /* insert character, handling automargin stuff */ { - if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1) - PutCharLR(ch); - else - PutAttrChar(ch); + if (SP_PARM->_cursrow == screen_lines(SP_PARM) - 1 && + SP_PARM->_curscol == screen_columns(SP_PARM) - 1) { + PutCharLR(NCURSES_SP_ARGx ch); + } else { + PutAttrChar(NCURSES_SP_ARGx ch); + } - if (SP->_curscol >= screen_columns) - wrap_cursor(); + if (SP_PARM->_curscol >= screen_columns(SP_PARM)) + wrap_cursor(NCURSES_SP_ARG); - position_check(SP->_cursrow, SP->_curscol, "PutChar"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "PutChar"); } /* @@ -450,19 +485,21 @@ PutChar(const ARG_CH_T ch) * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. */ static NCURSES_INLINE bool -can_clear_with(ARG_CH_T ch) +can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) { - if (!back_color_erase && SP->_coloron) { + if (!back_color_erase && SP_PARM->_coloron) { #if NCURSES_EXT_FUNCS int pair; - if (!SP->_default_color) + if (!SP_PARM->_default_color) return FALSE; - if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK) + if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK) return FALSE; if ((pair = GetPair(CHDEREF(ch))) != 0) { short fg, bg; - pair_content(pair, &fg, &bg); + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, &bg); if (fg != C_MASK || bg != C_MASK) return FALSE; } @@ -488,7 +525,7 @@ can_clear_with(ARG_CH_T ch) * This code is optimized using ech and rep. */ static int -EmitRange(const NCURSES_CH_T * ntext, int num) +EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) { int i; @@ -500,13 +537,13 @@ EmitRange(const NCURSES_CH_T * ntext, int num) NCURSES_CH_T ntext0; while (num > 1 && !CharEq(ntext[0], ntext[1])) { - PutChar(CHREF(ntext[0])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[0])); ntext++; num--; } ntext0 = ntext[0]; if (num == 1) { - PutChar(CHREF(ntext0)); + PutChar(NCURSES_SP_ARGx CHREF(ntext0)); return 0; } runcount = 2; @@ -523,10 +560,11 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * which it would be marginally advantageous. */ if (erase_chars - && runcount > SP->_ech_cost + SP->_cup_ch_cost - && can_clear_with(CHREF(ntext0))) { - UpdateAttrs(ntext0); - putp(TPARM_1(erase_chars, runcount)); + && runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost + && can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) { + UpdateAttrs(SP_PARM, ntext0); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_1(erase_chars, runcount)); /* * If this is the last part of the given interval, @@ -534,27 +572,34 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * last update on the line. */ if (runcount < num) { - GoTo(SP->_cursrow, SP->_curscol + runcount); + GoTo(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol + runcount); } else { return 1; /* cursor stays in the middle */ } - } else if (repeat_char && runcount > SP->_rep_cost) { - bool wrap_possible = (SP->_curscol + runcount >= screen_columns); + } else if (repeat_char && runcount > SP_PARM->_rep_cost) { + bool wrap_possible = (SP_PARM->_curscol + runcount >= + screen_columns(SP_PARM)); int rep_count = runcount; if (wrap_possible) rep_count--; - UpdateAttrs(ntext0); - tputs(TPARM_2(repeat_char, CharOf(ntext0), rep_count), - rep_count, _nc_outch); - SP->_curscol += rep_count; + UpdateAttrs(SP_PARM, ntext0); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(repeat_char, + CharOf(ntext0), + rep_count), + rep_count, + NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_curscol += rep_count; if (wrap_possible) - PutChar(CHREF(ntext0)); + PutChar(NCURSES_SP_ARGx CHREF(ntext0)); } else { for (i = 0; i < runcount; i++) - PutChar(CHREF(ntext[i])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); } ntext += runcount; num -= runcount; @@ -563,7 +608,7 @@ EmitRange(const NCURSES_CH_T * ntext, int num) } for (i = 0; i < num; i++) - PutChar(CHREF(ntext[i])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); return 0; } @@ -576,39 +621,43 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * Returns: same as EmitRange */ static int -PutRange(const NCURSES_CH_T * otext, +PutRange(NCURSES_SP_DCLx + const NCURSES_CH_T * otext, const NCURSES_CH_T * ntext, int row, int first, int last) { int i, j, same; - TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)", - otext, ntext, row, first, last)); + TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)", + (void *) SP_PARM, + (const void *) otext, + (const void *) ntext, + row, first, last)); if (otext != ntext - && (last - first + 1) > SP->_inline_cost) { + && (last - first + 1) > SP_PARM->_inline_cost) { for (j = first, same = 0; j <= last; j++) { if (!same && isWidecExt(otext[j])) continue; if (CharEq(otext[j], ntext[j])) { same++; } else { - if (same > SP->_inline_cost) { - EmitRange(ntext + first, j - same - first); - GoTo(row, first = j); + if (same > SP_PARM->_inline_cost) { + EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); + GoTo(NCURSES_SP_ARGx row, first = j); } same = 0; } } - i = EmitRange(ntext + first, j - same - first); + i = EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); /* * Always return 1 for the next GoTo() after a PutRange() if we found * identical characters at end of interval */ return (same == 0 ? i : 1); } - return EmitRange(ntext + first, last - first + 1); + return EmitRange(NCURSES_SP_ARGx ntext + first, last - first + 1); } /* leave unbracketed here so 'indent' works */ @@ -618,7 +667,7 @@ PutRange(const NCURSES_CH_T * otext, if_USE_SCROLL_HINTS(win->_line[row].oldindex = row) NCURSES_EXPORT(int) -doupdate(void) +TINFO_DOUPDATE(NCURSES_SP_DCL0) { int i; int nonempty; @@ -626,30 +675,49 @@ doupdate(void) struct tms before, after; #endif /* USE_TRACE_TIMES */ - T((T_CALLED("doupdate()"))); + T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM)); - if (curscr == 0 - || newscr == 0) +#if !USE_REENTRANT + /* + * It is "legal" but unlikely that an application could assign a new + * value to one of the standard windows. Check for that possibility + * and try to recover. + * + * We do not allow applications to assign new values in the reentrant + * model. + */ +#define SyncScreens(internal,exported) \ + if (internal == 0) internal = exported; \ + if (internal != exported) exported = internal + + SyncScreens(CurScreen(SP_PARM), curscr); + SyncScreens(NewScreen(SP_PARM), newscr); + SyncScreens(StdScreen(SP_PARM), stdscr); +#endif + + if (CurScreen(SP_PARM) == 0 + || NewScreen(SP_PARM) == 0 + || StdScreen(SP_PARM) == 0) returnCode(ERR); #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { - if (curscr->_clear) + if (CurScreen(SP_PARM)->_clear) _tracef("curscr is clear"); else - _tracedump("curscr", curscr); - _tracedump("newscr", newscr); + _tracedump("curscr", CurScreen(SP_PARM)); + _tracedump("newscr", NewScreen(SP_PARM)); _nc_unlock_global(tracef); } #endif /* TRACE */ _nc_signal_handler(FALSE); - if (SP->_fifohold) - SP->_fifohold--; + if (SP_PARM->_fifohold) + SP_PARM->_fifohold--; #if USE_SIZECHANGE - if (SP->_endwin || _nc_handle_sigwinch(SP)) { + if (SP_PARM->_endwin || _nc_handle_sigwinch(SP_PARM)) { /* * This is a transparent extension: XSI does not address it, * and applications need not know that ncurses can do it. @@ -658,20 +726,20 @@ doupdate(void) * (this can happen in an xterm, for example), and resize the * ncurses data structures accordingly. */ - _nc_update_screensize(SP); + _nc_update_screensize(SP_PARM); } #endif - if (SP->_endwin) { + if (SP_PARM->_endwin) { T(("coming back from shell mode")); - reset_prog_mode(); + NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG); - _nc_mvcur_resume(); - _nc_screen_resume(); - SP->_mouse_resume(SP); + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); + SP_PARM->_mouse_resume(SP_PARM); - SP->_endwin = FALSE; + SP_PARM->_endwin = FALSE; } #if USE_TRACE_TIMES /* zero the metering machinery */ @@ -695,11 +763,11 @@ doupdate(void) int j, k; attr_t rattr = A_NORMAL; - for (i = 0; i < screen_lines; i++) { - for (j = 0; j < screen_columns; j++) { + for (i = 0; i < screen_lines(SP_PARM); i++) { + for (j = 0; j < screen_columns(SP_PARM); j++) { bool failed = FALSE; - NCURSES_CH_T *thisline = newscr->_line[i].text; - attr_t thisattr = AttrOf(thisline[j]) & SP->_xmc_triggers; + NCURSES_CH_T *thisline = NewScreen(SP_PARM)->_line[i].text; + attr_t thisattr = AttrOf(thisline[j]) & SP_PARM->_xmc_triggers; attr_t turnon = thisattr & ~rattr; /* is an attribute turned on here? */ @@ -717,8 +785,8 @@ doupdate(void) * there's enough room to set the attribute before the first * non-blank in the run. */ -#define SAFE(a) (!((a) & SP->_xmc_triggers)) - if (ISBLANK(thisline[j]) && SAFE(turnon)) { +#define SAFE(scr,a) (!((a) & (scr)->_xmc_triggers)) + if (ISBLANK(thisline[j]) && SAFE(SP_PARM, turnon)) { RemAttr(thisline[j], turnon); continue; } @@ -727,14 +795,14 @@ doupdate(void) for (k = 1; k <= magic_cookie_glitch; k++) { if (j - k < 0 || !ISBLANK(thisline[j - k]) - || !SAFE(AttrOf(thisline[j - k]))) { + || !SAFE(SP_PARM, AttrOf(thisline[j - k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at start in %d,%d%s%s", i, j - k, (ISBLANK(thisline[j - k]) ? "" : ":nonblank"), - (SAFE(AttrOf(thisline[j - k])) + (SAFE(SP_PARM, AttrOf(thisline[j - k])) ? "" : ":unsafe"))); break; @@ -745,10 +813,11 @@ doupdate(void) int m, n = j; /* find end of span, if it's onscreen */ - for (m = i; m < screen_lines; m++) { - for (; n < screen_columns; n++) { - attr_t testattr = AttrOf(newscr->_line[m].text[n]); - if ((testattr & SP->_xmc_triggers) == rattr) { + for (m = i; m < screen_lines(SP_PARM); m++) { + for (; n < screen_columns(SP_PARM); n++) { + attr_t testattr = + AttrOf(NewScreen(SP_PARM)->_line[m].text[n]); + if ((testattr & SP_PARM->_xmc_triggers) == rattr) { end_onscreen = TRUE; TR(TRACE_ATTRS, ("Range attributed with %s ends at (%d, %d)", @@ -764,7 +833,8 @@ doupdate(void) foundit:; if (end_onscreen) { - NCURSES_CH_T *lastline = newscr->_line[m].text; + NCURSES_CH_T *lastline = + NewScreen(SP_PARM)->_line[m].text; /* * If there are safely-attributed blanks at the end of @@ -773,15 +843,15 @@ doupdate(void) */ while (n >= 0 && ISBLANK(lastline[n]) - && SAFE(AttrOf(lastline[n]))) { + && SAFE(SP_PARM, AttrOf(lastline[n]))) { RemAttr(lastline[n--], turnon); } /* check that there's enough room at end of span */ for (k = 1; k <= magic_cookie_glitch; k++) { - if (n + k >= screen_columns + if (n + k >= screen_columns(SP_PARM) || !ISBLANK(lastline[n + k]) - || !SAFE(AttrOf(lastline[n + k]))) { + || !SAFE(SP_PARM, AttrOf(lastline[n + k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at end in %d,%d%s%s", @@ -789,7 +859,7 @@ doupdate(void) (ISBLANK(lastline[n + k]) ? "" : ":nonblank"), - (SAFE(AttrOf(lastline[n + k])) + (SAFE(SP_PARM, AttrOf(lastline[n + k])) ? "" : ":unsafe"))); break; @@ -806,12 +876,12 @@ doupdate(void) _traceattr(turnon), i, j)); /* turn off new attributes over span */ - for (p = i; p < screen_lines; p++) { - for (; q < screen_columns; q++) { + for (p = i; p < screen_lines(SP_PARM); p++) { + for (; q < screen_columns(SP_PARM); q++) { attr_t testattr = AttrOf(newscr->_line[p].text[q]); - if ((testattr & SP->_xmc_triggers) == rattr) + if ((testattr & SP_PARM->_xmc_triggers) == rattr) goto foundend; - RemAttr(newscr->_line[p].text[q], turnon); + RemAttr(NewScreen(SP_PARM)->_line[p].text[q], turnon); } q = 0; } @@ -837,7 +907,7 @@ doupdate(void) /* show altered highlights after magic-cookie check */ if (USE_TRACEF(TRACE_UPDATE)) { _tracef("After magic-cookie check..."); - _tracedump("newscr", newscr); + _tracedump("newscr", NewScreen(SP_PARM)); _nc_unlock_global(tracef); } #endif /* TRACE */ @@ -845,23 +915,23 @@ doupdate(void) #endif /* USE_XMC_SUPPORT */ nonempty = 0; - if (curscr->_clear || newscr->_clear) { /* force refresh ? */ - ClrUpdate(); - curscr->_clear = FALSE; /* reset flag */ - newscr->_clear = FALSE; /* reset flag */ + if (CurScreen(SP_PARM)->_clear || NewScreen(SP_PARM)->_clear) { /* force refresh ? */ + ClrUpdate(NCURSES_SP_ARG); + CurScreen(SP_PARM)->_clear = FALSE; /* reset flag */ + NewScreen(SP_PARM)->_clear = FALSE; /* reset flag */ } else { int changedlines = CHECK_INTERVAL; - if (check_pending()) + if (check_pending(NCURSES_SP_ARG)) goto cleanup; - nonempty = min(screen_lines, newscr->_maxy + 1); + nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); - if (SP->_scrolling) { - _nc_scroll_optimize(); + if (SP_PARM->_scrolling) { + NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG); } - nonempty = ClrBottom(nonempty); + nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); TR(TRACE_UPDATE, ("Transforming lines, nonempty %d", nonempty)); for (i = 0; i < nonempty; i++) { @@ -869,7 +939,7 @@ doupdate(void) * Here is our line-breakout optimization. */ if (changedlines == CHECK_INTERVAL) { - if (check_pending()) + if (check_pending(NCURSES_SP_ARG)) goto cleanup; changedlines = 0; } @@ -880,35 +950,35 @@ doupdate(void) * is normally set by _nc_scroll_window in the * vertical-movement optimization code, */ - if (newscr->_line[i].firstchar != _NOCHANGE - || curscr->_line[i].firstchar != _NOCHANGE) { - TransformLine(i); + if (NewScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE + || CurScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE) { + TransformLine(NCURSES_SP_ARGx i); changedlines++; } /* mark line changed successfully */ - if (i <= newscr->_maxy) { - MARK_NOCHANGE(newscr, i); + if (i <= NewScreen(SP_PARM)->_maxy) { + MARK_NOCHANGE(NewScreen(SP_PARM), i); } - if (i <= curscr->_maxy) { - MARK_NOCHANGE(curscr, i); + if (i <= CurScreen(SP_PARM)->_maxy) { + MARK_NOCHANGE(CurScreen(SP_PARM), i); } } } /* put everything back in sync */ - for (i = nonempty; i <= newscr->_maxy; i++) { - MARK_NOCHANGE(newscr, i); + for (i = nonempty; i <= NewScreen(SP_PARM)->_maxy; i++) { + MARK_NOCHANGE(NewScreen(SP_PARM), i); } - for (i = nonempty; i <= curscr->_maxy; i++) { - MARK_NOCHANGE(curscr, i); + for (i = nonempty; i <= CurScreen(SP_PARM)->_maxy; i++) { + MARK_NOCHANGE(CurScreen(SP_PARM), i); } - if (!newscr->_leaveok) { - curscr->_curx = newscr->_curx; - curscr->_cury = newscr->_cury; + if (!NewScreen(SP_PARM)->_leaveok) { + CurScreen(SP_PARM)->_curx = NewScreen(SP_PARM)->_curx; + CurScreen(SP_PARM)->_cury = NewScreen(SP_PARM)->_cury; - GoTo(curscr->_cury, curscr->_curx); + GoTo(NCURSES_SP_ARGx CurScreen(SP_PARM)->_cury, CurScreen(SP_PARM)->_curx); } cleanup: @@ -921,10 +991,10 @@ doupdate(void) #if USE_XMC_SUPPORT if (magic_cookie_glitch != 0) #endif - UpdateAttrs(normal); + UpdateAttrs(SP_PARM, normal); - _nc_flush(); - WINDOW_ATTRS(curscr) = WINDOW_ATTRS(newscr); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + WINDOW_ATTRS(CurScreen(SP_PARM)) = WINDOW_ATTRS(NewScreen(SP_PARM)); #if USE_TRACE_TIMES (void) times(&after); @@ -940,6 +1010,14 @@ doupdate(void) returnCode(OK); } +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +doupdate(void) +{ + return TINFO_DOUPDATE(CURRENT_SCREEN); +} +#endif + /* * ClrBlank(win) * @@ -951,14 +1029,14 @@ doupdate(void) * in the wbkgd() call. Assume 'stdscr' for this case. */ #define BCE_ATTRS (A_NORMAL|A_COLOR) -#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd) +#define BCE_BKGD(sp,win) (((win) == CurScreen(sp) ? StdScreen(sp) : (win))->_nc_bkgd) static NCURSES_INLINE NCURSES_CH_T -ClrBlank(WINDOW *win) +ClrBlank(NCURSES_SP_DCLx WINDOW *win) { NCURSES_CH_T blank = blankchar; if (back_color_erase) - AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS)); + AddAttr(blank, (AttrOf(BCE_BKGD(SP_PARM, win)) & BCE_ATTRS)); return blank; } @@ -970,23 +1048,24 @@ ClrBlank(WINDOW *win) */ static void -ClrUpdate(void) +ClrUpdate(NCURSES_SP_DCL0) { - int i; - NCURSES_CH_T blank = ClrBlank(stdscr); - int nonempty = min(screen_lines, newscr->_maxy + 1); - TR(TRACE_UPDATE, (T_CALLED("ClrUpdate"))); + if (0 != SP_PARM) { + int i; + NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); + int nonempty = min(screen_lines(SP_PARM), + NewScreen(SP_PARM)->_maxy + 1); - ClearScreen(blank); + ClearScreen(NCURSES_SP_ARGx blank); - TR(TRACE_UPDATE, ("updating screen from scratch")); + TR(TRACE_UPDATE, ("updating screen from scratch")); - nonempty = ClrBottom(nonempty); - - for (i = 0; i < nonempty; i++) - TransformLine(i); + nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); + for (i = 0; i < nonempty; i++) + TransformLine(NCURSES_SP_ARGx i); + } TR(TRACE_UPDATE, (T_RETURN(""))); } @@ -997,35 +1076,36 @@ ClrUpdate(void) */ static void -ClrToEOL(NCURSES_CH_T blank, bool needclear) +ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) { int j; - if (curscr != 0 - && SP->_cursrow >= 0) { - for (j = SP->_curscol; j < screen_columns; j++) { - if (j >= 0) { - NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]); + if (SP_PARM != 0) { + if (CurScreen(SP_PARM) != 0 + && SP_PARM->_cursrow >= 0) { + for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) { + if (j >= 0) { + NCURSES_CH_T *cp = + &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]); - if (!CharEq(*cp, blank)) { - *cp = blank; - needclear = TRUE; + if (!CharEq(*cp, blank)) { + *cp = blank; + needclear = TRUE; + } } } } - } else { - needclear = TRUE; } - if (needclear) { - UpdateAttrs(blank); + if (needclear && (SP_PARM != 0)) { + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); - if (clr_eol && SP->_el_cost <= (screen_columns - SP->_curscol)) { - putp(clr_eol); + if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) { + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } else { - int count = (screen_columns - SP->_curscol); + int count = (screen_columns(SP_PARM) - SP_PARM->_curscol); while (count-- > 0) - PutChar(CHREF(blank)); + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } } @@ -1037,23 +1117,29 @@ ClrToEOL(NCURSES_CH_T blank, bool needclear) */ static void -ClrToEOS(NCURSES_CH_T blank) +ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank) { int row, col; - row = SP->_cursrow; - col = SP->_curscol; + if (0 == SP_PARM) + return; - UpdateAttrs(blank); + row = SP_PARM->_cursrow; + col = SP_PARM->_curscol; + + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eos"); - tputs(clr_eos, screen_lines - row, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + clr_eos, + screen_lines(SP_PARM) - row, + NCURSES_SP_NAME(_nc_outch)); - while (col < screen_columns) - curscr->_line[row].text[col++] = blank; + while (col < screen_columns(SP_PARM)) + CurScreen(SP_PARM)->_line[row].text[col++] = blank; - for (row++; row < screen_lines; row++) { - for (col = 0; col < screen_columns; col++) - curscr->_line[row].text[col] = blank; + for (row++; row < screen_lines(SP_PARM); row++) { + for (col = 0; col < screen_columns(SP_PARM); col++) + CurScreen(SP_PARM)->_line[row].text[col] = blank; } } @@ -1065,26 +1151,26 @@ ClrToEOS(NCURSES_CH_T blank) * screen, checking if each is blank, and one or more are changed. */ static int -ClrBottom(int total) +ClrBottom(NCURSES_SP_DCLx int total) { int row; int col; int top = total; - int last = min(screen_columns, newscr->_maxx + 1); - NCURSES_CH_T blank = newscr->_line[total - 1].text[last - 1]; + int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1); + NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1]; bool ok; - if (clr_eos && can_clear_with(CHREF(blank))) { + if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { for (row = total - 1; row >= 0; row--) { for (col = 0, ok = TRUE; ok && col < last; col++) { - ok = (CharEq(newscr->_line[row].text[col], blank)); + ok = (CharEq(NewScreen(SP_PARM)->_line[row].text[col], blank)); } if (!ok) break; for (col = 0; ok && col < last; col++) { - ok = (CharEq(curscr->_line[row].text[col], blank)); + ok = (CharEq(CurScreen(SP_PARM)->_line[row].text[col], blank)); } if (!ok) top = row; @@ -1092,11 +1178,11 @@ ClrBottom(int total) /* don't use clr_eos for just one line if clr_eol available */ if (top < total) { - GoTo(top, 0); - ClrToEOS(blank); - if (SP->oldhash && SP->newhash) { - for (row = top; row < screen_lines; row++) - SP->oldhash[row] = SP->newhash[row]; + GoTo(NCURSES_SP_ARGx top, 0); + ClrToEOS(NCURSES_SP_ARGx blank); + if (SP_PARM->oldhash && SP_PARM->newhash) { + for (row = top; row < screen_lines(SP_PARM); row++) + SP_PARM->oldhash[row] = SP_PARM->newhash[row]; } } } @@ -1105,22 +1191,22 @@ ClrBottom(int total) #if USE_XMC_SUPPORT #if USE_WIDEC_SUPPORT -#define check_xmc_transition(a, b) \ - ((((a)->attr ^ (b)->attr) & ~((a)->attr) & SP->_xmc_triggers) != 0) -#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b)) +#define check_xmc_transition(sp, a, b) \ + ((((a)->attr ^ (b)->attr) & ~((a)->attr) & (sp)->_xmc_triggers) != 0) +#define xmc_turn_on(sp,a,b) check_xmc_transition(sp,&(a), &(b)) #else -#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) +#define xmc_turn_on(sp,a,b) ((((a)^(b)) & ~(a) & (sp)->_xmc_triggers) != 0) #endif -#define xmc_new(r,c) newscr->_line[r].text[c] -#define xmc_turn_off(a,b) xmc_turn_on(b,a) +#define xmc_new(sp,r,c) NewScreen(sp)->_line[r].text[c] +#define xmc_turn_off(sp,a,b) xmc_turn_on(sp,b,a) #endif /* USE_XMC_SUPPORT */ /* ** TransformLine(lineno) ** ** Transform the given line in curscr to the one in newscr, using -** Insert/Delete Character if _nc_idcok && has_ic(). +** Insert/Delete Character if idcok && has_ic(). ** ** firstChar = position of first different character in line ** oLastChar = position of last different character in old line @@ -1135,19 +1221,19 @@ ClrBottom(int total) */ static void -TransformLine(int const lineno) +TransformLine(NCURSES_SP_DCLx int const lineno) { int firstChar, oLastChar, nLastChar; - NCURSES_CH_T *newLine = newscr->_line[lineno].text; - NCURSES_CH_T *oldLine = curscr->_line[lineno].text; + NCURSES_CH_T *newLine = NewScreen(SP_PARM)->_line[lineno].text; + NCURSES_CH_T *oldLine = CurScreen(SP_PARM)->_line[lineno].text; int n; bool attrchanged = FALSE; - TR(TRACE_UPDATE, (T_CALLED("TransformLine(%d)"), lineno)); + TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno)); /* copy new hash value to old one */ - if (SP->oldhash && SP->newhash) - SP->oldhash[lineno] = SP->newhash[lineno]; + if (SP_PARM->oldhash && SP_PARM->newhash) + SP_PARM->oldhash[lineno] = SP_PARM->newhash[lineno]; /* * If we have colors, there is the possibility of having two color pairs @@ -1155,19 +1241,20 @@ TransformLine(int const lineno) * for this case, and update the old line with the new line's colors when * they are equivalent. */ - if (SP->_coloron) { + if (SP_PARM->_coloron) { int oldPair; int newPair; - for (n = 0; n < screen_columns; n++) { + for (n = 0; n < screen_columns(SP_PARM); n++) { if (!CharEq(newLine[n], oldLine[n])) { oldPair = GetPair(oldLine[n]); newPair = GetPair(newLine[n]); if (oldPair != newPair && unColor(oldLine[n]) == unColor(newLine[n])) { - if (oldPair < COLOR_PAIRS - && newPair < COLOR_PAIRS - && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) { + if (oldPair < SP_PARM->_pair_limit + && newPair < SP_PARM->_pair_limit + && (SP_PARM->_color_pairs[oldPair] == + SP_PARM->_color_pairs[newPair])) { SetPair(oldLine[n], GetPair(newLine[n])); } } @@ -1177,7 +1264,7 @@ TransformLine(int const lineno) if (ceol_standout_glitch && clr_eol) { firstChar = 0; - while (firstChar < screen_columns) { + while (firstChar < screen_columns(SP_PARM)) { if (!SameAttrOf(newLine[firstChar], oldLine[firstChar])) { attrchanged = TRUE; break; @@ -1189,9 +1276,13 @@ TransformLine(int const lineno) firstChar = 0; if (attrchanged) { /* we may have to disregard the whole line */ - GoTo(lineno, firstChar); - ClrToEOL(ClrBlank(curscr), FALSE); - PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1)); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + ClrToEOL(NCURSES_SP_ARGx + ClrBlank(NCURSES_SP_ARGx + CurScreen(SP_PARM)), FALSE); + PutRange(NCURSES_SP_ARGx + oldLine, newLine, lineno, 0, + screen_columns(SP_PARM) - 1); #if USE_XMC_SUPPORT /* @@ -1206,8 +1297,8 @@ TransformLine(int const lineno) * following operation. */ } else if (magic_cookie_glitch > 0) { - GoTo(lineno, firstChar); - for (n = 0; n < screen_columns; n++) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); + for (n = 0; n < screen_columns(SP_PARM); n++) { int m = n + magic_cookie_glitch; /* check for turn-on: @@ -1216,26 +1307,30 @@ TransformLine(int const lineno) */ if (ISBLANK(newLine[n]) && ((n > 0 - && xmc_turn_on(newLine[n - 1], newLine[n])) + && xmc_turn_on(SP_PARM, newLine[n - 1], newLine[n])) || (n == 0 && lineno > 0 - && xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1), + && xmc_turn_on(SP_PARM, + xmc_new(SP_PARM, lineno - 1, + screen_columns(SP_PARM) - 1), newLine[n])))) { n = m; } - PutChar(CHREF(newLine[n])); + PutChar(NCURSES_SP_ARGx CHREF(newLine[n])); /* check for turn-off: * If we are writing an attributed non-blank, where the * next cell is blank, and not attributed. */ if (!ISBLANK(newLine[n]) - && ((n + 1 < screen_columns - && xmc_turn_off(newLine[n], newLine[n + 1])) - || (n + 1 >= screen_columns - && lineno + 1 < screen_lines - && xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) { + && ((n + 1 < screen_columns(SP_PARM) + && xmc_turn_off(SP_PARM, newLine[n], newLine[n + 1])) + || (n + 1 >= screen_columns(SP_PARM) + && lineno + 1 < screen_lines(SP_PARM) + && xmc_turn_off(SP_PARM, + newLine[n], + xmc_new(SP_PARM, lineno + 1, 0))))) { n = m; } @@ -1246,38 +1341,42 @@ TransformLine(int const lineno) /* it may be cheap to clear leading whitespace with clr_bol */ blank = newLine[0]; - if (clr_bol && can_clear_with(CHREF(blank))) { + if (clr_bol && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { int oFirstChar, nFirstChar; - for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++) + for (oFirstChar = 0; + oFirstChar < screen_columns(SP_PARM); + oFirstChar++) if (!CharEq(oldLine[oFirstChar], blank)) break; - for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++) + for (nFirstChar = 0; + nFirstChar < screen_columns(SP_PARM); + nFirstChar++) if (!CharEq(newLine[nFirstChar], blank)) break; if (nFirstChar == oFirstChar) { firstChar = nFirstChar; /* find the first differing character */ - while (firstChar < screen_columns + while (firstChar < screen_columns(SP_PARM) && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } else if (oFirstChar > nFirstChar) { firstChar = nFirstChar; } else { /* oFirstChar < nFirstChar */ firstChar = oFirstChar; - if (SP->_el1_cost < nFirstChar - oFirstChar) { - if (nFirstChar >= screen_columns - && SP->_el_cost <= SP->_el1_cost) { - GoTo(lineno, 0); - UpdateAttrs(blank); + if (SP_PARM->_el1_cost < nFirstChar - oFirstChar) { + if (nFirstChar >= screen_columns(SP_PARM) + && SP_PARM->_el_cost <= SP_PARM->_el1_cost) { + GoTo(NCURSES_SP_ARGx lineno, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); - putp(clr_eol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } else { - GoTo(lineno, nFirstChar - 1); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx lineno, nFirstChar - 1); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_bol"); - putp(clr_bol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_bol); } while (firstChar < nFirstChar) @@ -1286,64 +1385,81 @@ TransformLine(int const lineno) } } else { /* find the first differing character */ - while (firstChar < screen_columns + while (firstChar < screen_columns(SP_PARM) && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } /* if there wasn't one, we're done */ - if (firstChar >= screen_columns) { + if (firstChar >= screen_columns(SP_PARM)) { TR(TRACE_UPDATE, (T_RETURN(""))); return; } - blank = newLine[screen_columns - 1]; + blank = newLine[screen_columns(SP_PARM) - 1]; - if (!can_clear_with(CHREF(blank))) { + if (!can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { /* find the last differing character */ - nLastChar = screen_columns - 1; + nLastChar = screen_columns(SP_PARM) - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], oldLine[nLastChar])) nLastChar--; if (nLastChar >= firstChar) { - GoTo(lineno, firstChar); - PutRange(oldLine, newLine, lineno, firstChar, nLastChar); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); + (unsigned) (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } TR(TRACE_UPDATE, (T_RETURN(""))); return; } /* find last non-blank character on old line */ - oLastChar = screen_columns - 1; + oLastChar = screen_columns(SP_PARM) - 1; while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank)) oLastChar--; /* find last non-blank character on new line */ - nLastChar = screen_columns - 1; + nLastChar = screen_columns(SP_PARM) - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank)) nLastChar--; if ((nLastChar == firstChar) - && (SP->_el_cost < (oLastChar - nLastChar))) { - GoTo(lineno, firstChar); + && (SP_PARM->_el_cost < (oLastChar - nLastChar))) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); if (!CharEq(newLine[firstChar], blank)) - PutChar(CHREF(newLine[firstChar])); - ClrToEOL(blank, FALSE); + PutChar(NCURSES_SP_ARGx CHREF(newLine[firstChar])); + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else if ((nLastChar != oLastChar) && (!CharEq(newLine[nLastChar], oldLine[oLastChar]) - || !(_nc_idcok && has_ic()))) { - GoTo(lineno, firstChar); - if ((oLastChar - nLastChar) > SP->_el_cost) { - if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar)) - GoTo(lineno, nLastChar + 1); - ClrToEOL(blank, FALSE); + || !(SP_PARM->_nc_sp_idcok + && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)))) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); + if ((oLastChar - nLastChar) > SP_PARM->_el_cost) { + if (PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + nLastChar)) { + GoTo(NCURSES_SP_ARGx lineno, nLastChar + 1); + } + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { n = max(nLastChar, oLastChar); - PutRange(oldLine, newLine, lineno, firstChar, n); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + n); } } else { int nLastNonblank = nLastChar; @@ -1364,8 +1480,13 @@ TransformLine(int const lineno) n = min(oLastChar, nLastChar); if (n >= firstChar) { - GoTo(lineno, firstChar); - PutRange(oldLine, newLine, lineno, firstChar, n); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + n); } if (oLastChar < nLastChar) { @@ -1376,21 +1497,26 @@ TransformLine(int const lineno) --oLastChar; } #endif - GoTo(lineno, n + 1); + GoTo(NCURSES_SP_ARGx lineno, n + 1); if ((nLastChar < nLastNonblank) - || InsCharCost(nLastChar - oLastChar) > (m - n)) { - PutRange(oldLine, newLine, lineno, n + 1, m); + || InsCharCost(SP_PARM, nLastChar - oLastChar) > (m - n)) { + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + n + 1, + m); } else { - InsStr(&newLine[n + 1], nLastChar - oLastChar); + InsStr(NCURSES_SP_ARGx &newLine[n + 1], nLastChar - oLastChar); } } else if (oLastChar > nLastChar) { - GoTo(lineno, n + 1); - if (DelCharCost(oLastChar - nLastChar) - > SP->_el_cost + nLastNonblank - (n + 1)) { - if (PutRange(oldLine, newLine, lineno, + GoTo(NCURSES_SP_ARGx lineno, n + 1); + if (DelCharCost(SP_PARM, oLastChar - nLastChar) + > SP_PARM->_el_cost + nLastNonblank - (n + 1)) { + if (PutRange(NCURSES_SP_ARGx oldLine, newLine, lineno, n + 1, nLastNonblank)) - GoTo(lineno, nLastNonblank + 1); - ClrToEOL(blank, FALSE); + GoTo(NCURSES_SP_ARGx lineno, nLastNonblank + 1); + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { /* * The delete-char sequence will @@ -1400,18 +1526,18 @@ TransformLine(int const lineno) * setting the video attributes from * the last character on the row. */ - UpdateAttrs(blank); - DelChar(oLastChar - nLastChar); + UpdateAttrs(SP_PARM, blank); + DelChar(NCURSES_SP_ARGx oLastChar - nLastChar); } } } } /* update the code's internal representation */ - if (screen_columns > firstChar) + if (screen_columns(SP_PARM) > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (screen_columns - firstChar) * sizeof(NCURSES_CH_T)); + (unsigned) (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T)); TR(TRACE_UPDATE, (T_RETURN(""))); return; } @@ -1424,7 +1550,7 @@ TransformLine(int const lineno) */ static void -ClearScreen(NCURSES_CH_T blank) +ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) { int i, j; bool fast_clear = (clear_screen || clr_eos || clr_eol); @@ -1432,9 +1558,13 @@ ClearScreen(NCURSES_CH_T blank) TR(TRACE_UPDATE, ("ClearScreen() called")); #if NCURSES_EXT_FUNCS - if (SP->_coloron - && !SP->_default_color) { - _nc_do_color(GET_SCREEN_PAIR(SP), 0, FALSE, _nc_outch); + if (SP_PARM->_coloron + && !SP_PARM->_default_color) { + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx + (short) GET_SCREEN_PAIR(SP_PARM), + 0, + FALSE, + NCURSES_SP_NAME(_nc_outch)); if (!back_color_erase) { fast_clear = FALSE; } @@ -1443,42 +1573,46 @@ ClearScreen(NCURSES_CH_T blank) if (fast_clear) { if (clear_screen) { - UpdateAttrs(blank); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clear_screen"); - putp(clear_screen); - SP->_cursrow = SP->_curscol = 0; - position_check(SP->_cursrow, SP->_curscol, "ClearScreen"); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clear_screen); + SP_PARM->_cursrow = SP_PARM->_curscol = 0; + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "ClearScreen"); } else if (clr_eos) { - SP->_cursrow = SP->_curscol = -1; - GoTo(0, 0); - - UpdateAttrs(blank); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; + GoTo(NCURSES_SP_ARGx 0, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eos"); - tputs(clr_eos, screen_lines, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + clr_eos, + screen_lines(SP_PARM), + NCURSES_SP_NAME(_nc_outch)); } else if (clr_eol) { - SP->_cursrow = SP->_curscol = -1; - - UpdateAttrs(blank); - for (i = 0; i < screen_lines; i++) { - GoTo(i, 0); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; + UpdateAttrs(SP_PARM, blank); + for (i = 0; i < screen_lines(SP_PARM); i++) { + GoTo(NCURSES_SP_ARGx i, 0); TPUTS_TRACE("clr_eol"); - putp(clr_eol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } - GoTo(0, 0); + GoTo(NCURSES_SP_ARGx 0, 0); } } else { - UpdateAttrs(blank); - for (i = 0; i < screen_lines; i++) { - GoTo(i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + UpdateAttrs(SP_PARM, blank); + for (i = 0; i < screen_lines(SP_PARM); i++) { + GoTo(NCURSES_SP_ARGx i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } - GoTo(0, 0); + GoTo(NCURSES_SP_ARGx 0, 0); } - for (i = 0; i < screen_lines; i++) { - for (j = 0; j < screen_columns; j++) - curscr->_line[i].text[j] = blank; + for (i = 0; i < screen_lines(SP_PARM); i++) { + for (j = 0; j < screen_columns(SP_PARM); j++) + CurScreen(SP_PARM)->_line[i].text[j] = blank; } TR(TRACE_UPDATE, ("screen cleared")); @@ -1492,49 +1626,54 @@ ClearScreen(NCURSES_CH_T blank) */ static void -InsStr(NCURSES_CH_T * line, int count) +InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) { - TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count)); + TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", + (void *) SP_PARM, + (void *) line, count)); /* Prefer parm_ich as it has the smallest cost - no need to shift * the whole line on each character. */ /* The order must match that of InsCharCost. */ if (parm_ich) { TPUTS_TRACE("parm_ich"); - tputs(TPARM_1(parm_ich, count), count, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(parm_ich, count), + count, + NCURSES_SP_NAME(_nc_outch)); while (count) { - PutAttrChar(CHREF(*line)); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); line++; count--; } } else if (enter_insert_mode && exit_insert_mode) { TPUTS_TRACE("enter_insert_mode"); - putp(enter_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_insert_mode); while (count) { - PutAttrChar(CHREF(*line)); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - putp(insert_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); } line++; count--; } TPUTS_TRACE("exit_insert_mode"); - putp(exit_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); } else { while (count) { TPUTS_TRACE("insert_character"); - putp(insert_character); - PutAttrChar(CHREF(*line)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_character); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - putp(insert_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); } line++; count--; } } - position_check(SP->_cursrow, SP->_curscol, "InsStr"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "InsStr"); } /* @@ -1545,22 +1684,25 @@ InsStr(NCURSES_CH_T * line, int count) */ static void -DelChar(int count) +DelChar(NCURSES_SP_DCLx int count) { int n; - TR(TRACE_UPDATE, ("DelChar(%d) called, position = (%ld,%ld)", - count, - (long) newscr->_cury, - (long) newscr->_curx)); + TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)", + (void *) SP_PARM, count, + (long) NewScreen(SP_PARM)->_cury, + (long) NewScreen(SP_PARM)->_curx)); if (parm_dch) { TPUTS_TRACE("parm_dch"); - tputs(TPARM_1(parm_dch, count), count, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(parm_dch, count), + count, + NCURSES_SP_NAME(_nc_outch)); } else { for (n = 0; n < count; n++) { TPUTS_TRACE("delete_character"); - putp(delete_character); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_character); } } } @@ -1599,54 +1741,66 @@ DelChar(int count) /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */ static int -scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) +scroll_csr_forward(NCURSES_SP_DCLx + int n, + int top, + int bot, + int miny, + int maxy, + NCURSES_CH_T blank) { int i; if (n == 1 && scroll_forward && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("scroll_forward"); - putp(scroll_forward); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); } else if (n == 1 && delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } else if (parm_index && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_index"); - tputs(TPARM_2(parm_index, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_index, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (parm_delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_delete_line"); - tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_delete_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (scroll_forward && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_forward"); - putp(scroll_forward); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); } } else if (delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE()) { + if (FILL_BCE(SP_PARM)) { int j; for (i = 0; i < n; i++) { - GoTo(bot - i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + GoTo(NCURSES_SP_ARGx bot - i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } #endif @@ -1656,55 +1810,66 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T bla /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */ /* n > 0 */ static int -scroll_csr_backward(int n, int top, int bot, int miny, int maxy, +scroll_csr_backward(NCURSES_SP_DCLx + int n, + int top, + int bot, + int miny, + int maxy, NCURSES_CH_T blank) { int i; if (n == 1 && scroll_reverse && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("scroll_reverse"); - putp(scroll_reverse); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); } else if (n == 1 && insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } else if (parm_rindex && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_rindex"); - tputs(TPARM_2(parm_rindex, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_rindex, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (parm_insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_insert_line"); - tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_insert_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (scroll_reverse && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_reverse"); - putp(scroll_reverse); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); } } else if (insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE()) { + if (FILL_BCE(SP_PARM)) { int j; for (i = 0; i < n; i++) { - GoTo(top + i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + GoTo(NCURSES_SP_ARGx top + i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } #endif @@ -1714,40 +1879,46 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, /* scroll by using delete_line at del and insert_line at ins */ /* n > 0 */ static int -scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) +scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) { int i; if (!((parm_delete_line || delete_line) && (parm_insert_line || insert_line))) return ERR; - GoTo(del, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx del, 0); + UpdateAttrs(SP_PARM, blank); if (n == 1 && delete_line) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } else if (parm_delete_line) { TPUTS_TRACE("parm_delete_line"); - tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_delete_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else { /* if (delete_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } } - GoTo(ins, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx ins, 0); + UpdateAttrs(SP_PARM, blank); if (n == 1 && insert_line) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } else if (parm_insert_line) { TPUTS_TRACE("parm_insert_line"); - tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_insert_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else { /* if (insert_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } } @@ -1763,15 +1934,25 @@ scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) * save/restore cursor capabilities if the terminal has them. */ NCURSES_EXPORT(int) -_nc_scrolln(int n, int top, int bot, int maxy) +NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx + int n, + int top, + int bot, + int maxy) /* scroll region from top to bot by n lines */ { - NCURSES_CH_T blank = ClrBlank(stdscr); + NCURSES_CH_T blank; int i; bool cursor_saved = FALSE; int res; - TR(TRACE_MOVE, ("mvcur_scrolln(%d, %d, %d, %d)", n, top, bot, maxy)); + TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", + (void *) SP_PARM, n, top, bot, maxy)); + + if (!IsValidScreen(SP_PARM)) + return (ERR); + + blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); #if USE_XMC_SUPPORT /* @@ -1787,34 +1968,36 @@ _nc_scrolln(int n, int top, int bot, int maxy) * Explicitly clear if stuff pushed off top of region might * be saved by the terminal. */ - res = scroll_csr_forward(n, top, bot, 0, maxy, blank); + res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { if ((((n == 1 && scroll_forward) || parm_index) - && (SP->_cursrow == bot || SP->_cursrow == bot - 1)) + && (SP_PARM->_cursrow == bot || SP_PARM->_cursrow == bot - 1)) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - putp(save_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); } TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, top, bot)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - putp(restore_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); } else { - SP->_cursrow = SP->_curscol = -1; + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - res = scroll_csr_forward(n, top, bot, top, bot, blank); + res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, maxy)); - SP->_cursrow = SP->_curscol = -1; + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, 0, maxy)); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - if (res == ERR && _nc_idlok) - res = scroll_idl(n, top, bot - n + 1, blank); + if (res == ERR && SP_PARM->_nc_sp_idlok) + res = scroll_idl(NCURSES_SP_ARGx n, top, bot - n + 1, blank); /* * Clear the newly shifted-in text. @@ -1823,44 +2006,49 @@ _nc_scrolln(int n, int top, int bot, int maxy) && (non_dest_scroll_region || (memory_below && bot == maxy))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); if (bot == maxy && clr_eos) { - GoTo(bot - n + 1, 0); - ClrToEOS(blank2); + GoTo(NCURSES_SP_ARGx bot - n + 1, 0); + ClrToEOS(NCURSES_SP_ARGx blank2); } else { for (i = 0; i < n; i++) { - GoTo(bot - i, 0); - ClrToEOL(blank2, FALSE); + GoTo(NCURSES_SP_ARGx bot - i, 0); + ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); } } } } else { /* (n < 0) - scroll down (backward) */ - res = scroll_csr_backward(-n, top, bot, 0, maxy, blank); + res = scroll_csr_backward(NCURSES_SP_ARGx -n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { - if (top != 0 && (SP->_cursrow == top || SP->_cursrow == top - 1) + if (top != 0 + && (SP_PARM->_cursrow == top || + SP_PARM->_cursrow == top - 1) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - putp(save_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); } TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, top, bot)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - putp(restore_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); } else { - SP->_cursrow = SP->_curscol = -1; + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - res = scroll_csr_backward(-n, top, bot, top, bot, blank); + res = scroll_csr_backward(NCURSES_SP_ARGx + -n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, maxy)); - SP->_cursrow = SP->_curscol = -1; + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, 0, maxy)); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - if (res == ERR && _nc_idlok) - res = scroll_idl(-n, bot + n + 1, top, blank); + if (res == ERR && SP_PARM->_nc_sp_idlok) + res = scroll_idl(NCURSES_SP_ARGx -n, bot + n + 1, top, blank); /* * Clear the newly shifted-in text. @@ -1869,8 +2057,8 @@ _nc_scrolln(int n, int top, int bot, int maxy) && (non_dest_scroll_region || (memory_above && top == 0))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); for (i = 0; i < -n; i++) { - GoTo(i + top, 0); - ClrToEOL(blank2, FALSE); + GoTo(NCURSES_SP_ARGx i + top, 0); + ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); } } } @@ -1878,99 +2066,163 @@ _nc_scrolln(int n, int top, int bot, int maxy) if (res == ERR) return (ERR); - _nc_scroll_window(curscr, n, top, bot, blank); + _nc_scroll_window(CurScreen(SP_PARM), n, + (NCURSES_SIZE_T) top, + (NCURSES_SIZE_T) bot, + blank); /* shift hash values too - they can be reused */ - _nc_scroll_oldhash(n, top, bot); + NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_ARGx n, top, bot); return (OK); } -NCURSES_EXPORT(void) -_nc_screen_resume(void) +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_scrolln(int n, int top, int bot, int maxy) { + return NCURSES_SP_NAME(_nc_scrolln) (CURRENT_SCREEN, n, top, bot, maxy); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0) +{ + assert(SP_PARM); + /* make sure terminal is in a sane known state */ - SetAttr(SCREEN_ATTRS(SP), A_NORMAL); - newscr->_clear = TRUE; + SetAttr(SCREEN_ATTRS(SP_PARM), A_NORMAL); + NewScreen(SP_PARM)->_clear = TRUE; /* reset color pairs and definitions */ - if (SP->_coloron || SP->_color_defs) - _nc_reset_colors(); + if (SP_PARM->_coloron || SP_PARM->_color_defs) + NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); /* restore user-defined colors, if any */ - if (SP->_color_defs < 0) { + if (SP_PARM->_color_defs < 0) { int n; - SP->_color_defs = -(SP->_color_defs); - for (n = 0; n < SP->_color_defs; ++n) { - if (SP->_color_table[n].init) { - init_color(n, - SP->_color_table[n].r, - SP->_color_table[n].g, - SP->_color_table[n].b); + SP_PARM->_color_defs = -(SP_PARM->_color_defs); + for (n = 0; n < SP_PARM->_color_defs; ++n) { + if (SP_PARM->_color_table[n].init) { + NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx + (short) n, + SP_PARM->_color_table[n].r, + SP_PARM->_color_table[n].g, + SP_PARM->_color_table[n].b); } } } if (exit_attribute_mode) - putp(exit_attribute_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_attribute_mode); else { /* turn off attributes */ if (exit_alt_charset_mode) - putp(exit_alt_charset_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_alt_charset_mode); if (exit_standout_mode) - putp(exit_standout_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_standout_mode); if (exit_underline_mode) - putp(exit_underline_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_underline_mode); } if (exit_insert_mode) - putp(exit_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); if (enter_am_mode && exit_am_mode) - putp(auto_right_margin ? enter_am_mode : exit_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + (auto_right_margin + ? enter_am_mode + : exit_am_mode)); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_screen_resume(void) +{ + NCURSES_SP_NAME(_nc_screen_resume) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_screen_init) (NCURSES_SP_DCL0) +{ + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_screen_init(void) { - _nc_screen_resume(); + NCURSES_SP_NAME(_nc_screen_init) (CURRENT_SCREEN); } +#endif /* wrap up screen handling */ NCURSES_EXPORT(void) -_nc_screen_wrap(void) +NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0) { - UpdateAttrs(normal); + if (SP_PARM == 0) + return; + + UpdateAttrs(SP_PARM, normal); #if NCURSES_EXT_FUNCS - if (SP->_coloron - && !SP->_default_color) { + if (SP_PARM->_coloron + && !SP_PARM->_default_color) { static const NCURSES_CH_T blank = NewChar(BLANK_TEXT); - SP->_default_color = TRUE; - _nc_do_color(-1, 0, FALSE, _nc_outch); - SP->_default_color = FALSE; + SP_PARM->_default_color = TRUE; + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx + -1, + 0, + FALSE, + NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_default_color = FALSE; - mvcur(SP->_cursrow, SP->_curscol, screen_lines - 1, 0); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + screen_lines(SP_PARM) - 1, + 0); - ClrToEOL(blank, TRUE); + ClrToEOL(NCURSES_SP_ARGx blank, TRUE); } #endif - if (SP->_color_defs) { - _nc_reset_colors(); + if (SP_PARM->_color_defs) { + NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_screen_wrap(void) +{ + NCURSES_SP_NAME(_nc_screen_wrap) (CURRENT_SCREEN); +} +#endif + #if USE_XMC_SUPPORT NCURSES_EXPORT(void) -_nc_do_xmc_glitch(attr_t previous) +NCURSES_SP_NAME(_nc_do_xmc_glitch) (NCURSES_SP_DCLx attr_t previous) { - attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP))); + if (SP_PARM != 0) { + attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP_PARM))); - while (chg != 0) { - if (chg & 1) { - SP->_curscol += magic_cookie_glitch; - if (SP->_curscol >= SP->_columns) - wrap_cursor(); - TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol)); + while (chg != 0) { + if (chg & 1) { + SP_PARM->_curscol += magic_cookie_glitch; + if (SP_PARM->_curscol >= SP_PARM->_columns) + wrap_cursor(NCURSES_SP_ARG); + TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", + SP_PARM->_cursrow, SP_PARM->_curscol)); + } + chg >>= 1; } - chg >>= 1; } } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_do_xmc_glitch(attr_t previous) +{ + NCURSES_SP_NAME(_nc_do_xmc_glitch) (CURRENT_SCREEN, previous); +} +#endif + #endif /* USE_XMC_SUPPORT */ diff --git a/ncurses/wcwidth.h b/ncurses/wcwidth.h new file mode 100644 index 00000000000..61e822ad679 --- /dev/null +++ b/ncurses/wcwidth.h @@ -0,0 +1,309 @@ +/* + * This is an implementation of wcwidth() and wcswidth() (defined in + * IEEE Std 1002.1-2001) for Unicode. + * + * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html + * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html + * + * In fixed-width output devices, Latin characters all occupy a single + * "cell" position of equal width, whereas ideographic CJK characters + * occupy two such cells. Interoperability between terminal-line + * applications and (teletype-style) character terminals using the + * UTF-8 encoding requires agreement on which character should advance + * the cursor by how many cell positions. No established formal + * standards exist at present on which Unicode character shall occupy + * how many cell positions on character terminals. These routines are + * a first attempt of defining such behavior based on simple rules + * applied to data provided by the Unicode Consortium. + * + * For some graphical characters, the Unicode standard explicitly + * defines a character-cell width via the definition of the East Asian + * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. + * In all these cases, there is no ambiguity about which width a + * terminal shall use. For characters in the East Asian Ambiguous (A) + * class, the width choice depends purely on a preference of backward + * compatibility with either historic CJK or Western practice. + * Choosing single-width for these characters is easy to justify as + * the appropriate long-term solution, as the CJK practice of + * displaying these characters as double-width comes from historic + * implementation simplicity (8-bit encoded characters were displayed + * single-width and 16-bit ones double-width, even for Greek, + * Cyrillic, etc.) and not any typographic considerations. + * + * Much less clear is the choice of width for the Not East Asian + * (Neutral) class. Existing practice does not dictate a width for any + * of these characters. It would nevertheless make sense + * typographically to allocate two character cells to characters such + * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be + * represented adequately with a single-width glyph. The following + * routines at present merely assign a single-cell width to all + * neutral characters, in the interest of simplicity. This is not + * entirely satisfactory and should be reconsidered before + * establishing a formal standard in this area. At the moment, the + * decision which Not East Asian (Neutral) characters should be + * represented by double-width glyphs cannot yet be answered by + * applying a simple rule from the Unicode database content. Setting + * up a proper standard for the behavior of UTF-8 character terminals + * will require a careful analysis not only of each Unicode character, + * but also of each presentation form, something the author of these + * routines has avoided to do so far. + * + * http://www.unicode.org/unicode/reports/tr11/ + * + * Markus Kuhn -- 2007-05-26 (Unicode 5.0) + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted. The author + * disclaims all warranties with regard to this software. + * + * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + */ + +#include + +struct interval { + int first; + int last; +}; + +/* auxiliary function for binary search in interval table */ +static int bisearch(wchar_t ucs, const struct interval *table, int max) { + int min = 0; + int mid; + + if (ucs < table[0].first || ucs > table[max].last) + return 0; + while (max >= min) { + mid = (min + max) / 2; + if (ucs > table[mid].last) + min = mid + 1; + else if (ucs < table[mid].first) + max = mid - 1; + else + return 1; + } + + return 0; +} + + +/* The following two functions define the column width of an ISO 10646 + * character as follows: + * + * - The null character (U+0000) has a column width of 0. + * + * - Other C0/C1 control characters and DEL will lead to a return + * value of -1. + * + * - Non-spacing and enclosing combining characters (general + * category code Mn or Me in the Unicode database) have a + * column width of 0. + * + * - SOFT HYPHEN (U+00AD) has a column width of 1. + * + * - Other format characters (general category code Cf in the Unicode + * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. + * + * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) + * have a column width of 0. + * + * - Spacing characters in the East Asian Wide (W) or East Asian + * Full-width (F) category as defined in Unicode Technical + * Report #11 have a column width of 2. + * + * - All remaining characters (including all printable + * ISO 8859-1 and WGL4 characters, Unicode control characters, + * etc.) have a column width of 1. + * + * This implementation assumes that wchar_t characters are encoded + * in ISO 10646. + */ + +int mk_wcwidth(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of non-spacing characters */ + /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ + static const struct interval combining[] = { + { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, + { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, + { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, + { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, + { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, + { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, + { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, + { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, + { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, + { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, + { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, + { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, + { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, + { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, + { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, + { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, + { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, + { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, + { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, + { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, + { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, + { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, + { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, + { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, + { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, + { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, + { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, + { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, + { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, + { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, + { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, + { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, + { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, + { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, + { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, + { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, + { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, + { 0xE0100, 0xE01EF } + }; + + /* test for 8-bit control characters */ + if (ucs == 0) + return 0; + if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) + return -1; + + /* binary search in table of non-spacing characters */ + if (bisearch(ucs, combining, + sizeof(combining) / sizeof(struct interval) - 1)) + return 0; + + /* if we arrive here, ucs is not a combining or C0/C1 control character */ + + return 1 + + (ucs >= 0x1100 && + (ucs <= 0x115f || /* Hangul Jamo init. consonants */ + ucs == 0x2329 || ucs == 0x232a || + (ucs >= 0x2e80 && ucs <= 0xa4cf && + ucs != 0x303f) || /* CJK ... Yi */ + (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ + (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ + (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */ + (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ + (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ + (ucs >= 0xffe0 && ucs <= 0xffe6) || + (ucs >= 0x20000 && ucs <= 0x2fffd) || + (ucs >= 0x30000 && ucs <= 0x3fffd))); +} + + +int mk_wcswidth(const wchar_t *pwcs, size_t n) +{ + int w, width = 0; + + for (;*pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth(*pwcs)) < 0) + return -1; + else + width += w; + + return width; +} + + +/* + * The following functions are the same as mk_wcwidth() and + * mk_wcswidth(), except that spacing characters in the East Asian + * Ambiguous (A) category as defined in Unicode Technical Report #11 + * have a column width of 2. This variant might be useful for users of + * CJK legacy encodings who want to migrate to UCS without changing + * the traditional terminal character-width behaviour. It is not + * otherwise recommended for general use. + */ +int mk_wcwidth_cjk(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of East Asian Ambiguous + * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ + static const struct interval ambiguous[] = { + { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, + { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 }, + { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 }, + { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 }, + { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED }, + { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA }, + { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, + { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, + { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 }, + { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 }, + { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 }, + { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, + { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, + { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, + { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, + { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB }, + { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB }, + { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 }, + { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 }, + { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 }, + { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, + { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, + { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, + { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 }, + { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC }, + { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, + { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, + { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 }, + { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 }, + { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 }, + { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 }, + { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B }, + { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, + { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 }, + { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E }, + { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 }, + { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 }, + { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F }, + { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 }, + { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF }, + { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B }, + { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 }, + { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 }, + { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 }, + { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 }, + { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 }, + { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 }, + { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 }, + { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, + { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F }, + { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF }, + { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } + }; + + /* binary search in table of non-spacing characters */ + if (bisearch(ucs, ambiguous, + sizeof(ambiguous) / sizeof(struct interval) - 1)) + return 2; + + return mk_wcwidth(ucs); +} + + +int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) +{ + int w, width = 0; + + for (;*pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth_cjk(*pwcs)) < 0) + return -1; + else + width += w; + + return width; +} diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index 93b41bb4930..38d3130a54c 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2004-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,39 +35,387 @@ #include -MODULE_ID("$Id: lib_add_wch.c,v 1.6 2006/12/02 21:19:17 tom Exp $") +#if HAVE_WCTYPE_H +#include +#endif + +MODULE_ID("$Id: lib_add_wch.c,v 1.12 2011/03/22 09:31:15 Petr.Pavlu Exp $") + +/* clone/adapt lib_addch.c */ +static const cchar_t blankchar = NewChar(BLANK_TEXT); + +/* + * Ugly microtweaking alert. Everything from here to end of module is + * likely to be speed-critical -- profiling data sure says it is! + * Most of the important screen-painting functions are shells around + * wadd_wch(). So we make every effort to reduce function-call overhead + * by inlining stuff, even at the cost of making wrapped copies for + * export. Also we supply some internal versions that don't call the + * window sync hook, for use by string-put functions. + */ + +/* Return bit mask for clearing color pair number if given ch has color */ +#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0)) + +static NCURSES_INLINE cchar_t +render_char(WINDOW *win, cchar_t ch) +/* compute a rendition of the given char correct for the current context */ +{ + attr_t a = WINDOW_ATTRS(win); + int pair = GetPair(ch); + + if (ISBLANK(ch) + && AttrOf(ch) == A_NORMAL + && pair == 0) { + /* color/pair in attrs has precedence over bkgrnd */ + ch = win->_nc_bkgd; + SetAttr(ch, a | AttrOf(win->_nc_bkgd)); + if ((pair = GET_WINDOW_PAIR(win)) == 0) + pair = GetPair(win->_nc_bkgd); + SetPair(ch, pair); + } else { + /* color in attrs has precedence over bkgrnd */ + a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a); + /* color in ch has precedence */ + if (pair == 0) { + if ((pair = GET_WINDOW_PAIR(win)) == 0) + pair = GetPair(win->_nc_bkgd); + } + AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); + SetPair(ch, pair); + } + + TR(TRACE_VIRTPUT, + ("render_char bkg %s (%d), attrs %s (%d) -> ch %s (%d)", + _tracech_t2(1, CHREF(win->_nc_bkgd)), + GetPair(win->_nc_bkgd), + _traceattr(WINDOW_ATTRS(win)), + GET_WINDOW_PAIR(win), + _tracech_t2(3, CHREF(ch)), + GetPair(ch))); + + return (ch); +} + +/* check if position is legal; if not, return error */ +#ifndef NDEBUG /* treat this like an assertion */ +#define CHECK_POSITION(win, x, y) \ + if (y > win->_maxy \ + || x > win->_maxx \ + || y < 0 \ + || x < 0) { \ + TR(TRACE_VIRTPUT, ("Alert! Win=%p _curx = %d, _cury = %d " \ + "(_maxx = %d, _maxy = %d)", win, x, y, \ + win->_maxx, win->_maxy)); \ + return(ERR); \ + } +#else +#define CHECK_POSITION(win, x, y) /* nothing */ +#endif + +static bool +newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos) +{ + bool result = FALSE; + + if (*ypos >= win->_regtop && *ypos == win->_regbottom) { + *ypos = win->_regbottom; + result = TRUE; + } else { + *ypos = (NCURSES_SIZE_T) (*ypos + 1); + } + return result; +} + +/* + * The _WRAPPED flag is useful only for telling an application that we've just + * wrapped the cursor. We don't do anything with this flag except set it when + * wrapping, and clear it whenever we move the cursor. If we try to wrap at + * the lower-right corner of a window, we cannot move the cursor (since that + * wouldn't be legal). So we return an error (which is what SVr4 does). + * Unlike SVr4, we can successfully add a character to the lower-right corner + * (Solaris 2.6 does this also, however). + */ +static int +wrap_to_next_line(WINDOW *win) +{ + win->_flags |= _WRAPPED; + if (newline_forces_scroll(win, &(win->_cury))) { + win->_curx = win->_maxx; + if (!win->_scroll) + return (ERR); + scroll(win); + } + win->_curx = 0; + return (OK); +} + +static int wadd_wch_literal(WINDOW *, cchar_t); +/* + * Fill the given number of cells with blanks using the current background + * rendition. This saves/restores the current x-position. + */ +static void +fill_cells(WINDOW *win, int count) +{ + cchar_t blank = blankchar; + int save_x = win->_curx; + int save_y = win->_cury; + + while (count-- > 0) { + if (wadd_wch_literal(win, blank) == ERR) + break; + } + win->_curx = (NCURSES_SIZE_T) save_x; + win->_cury = (NCURSES_SIZE_T) save_y; +} + +static int +wadd_wch_literal(WINDOW *win, cchar_t ch) +{ + int x; + int y; + struct ldat *line; + + x = win->_curx; + y = win->_cury; + + CHECK_POSITION(win, x, y); + + ch = render_char(win, ch); + + line = win->_line + y; + + CHANGED_CELL(line, x); + + /* + * Non-spacing characters are added to the current cell. + * + * Spacing characters that are wider than one column require some display + * adjustments. + */ + { + int len = wcwidth(CharOf(ch)); + int i; + int j; + wchar_t *chars; + + if (len == 0) { /* non-spacing */ + if ((x > 0 && y >= 0) + || (win->_maxx >= 0 && win->_cury >= 1)) { + if (x > 0 && y >= 0) + chars = (win->_line[y].text[x - 1].chars); + else + chars = (win->_line[y - 1].text[win->_maxx].chars); + for (i = 0; i < CCHARW_MAX; ++i) { + if (chars[i] == 0) { + TR(TRACE_VIRTPUT, + ("added non-spacing %d: %x", + x, (int) CharOf(ch))); + chars[i] = CharOf(ch); + break; + } + } + } + goto testwrapping; + } else if (len > 1) { /* multi-column characters */ + /* + * Check if the character will fit on the current line. If it does + * not fit, fill in the remainder of the line with blanks. and + * move to the next line. + */ + if (len > win->_maxx + 1) { + TR(TRACE_VIRTPUT, ("character will not fit")); + return ERR; + } else if (x + len > win->_maxx + 1) { + int count = win->_maxx + 1 - x; + TR(TRACE_VIRTPUT, ("fill %d remaining cells", count)); + fill_cells(win, count); + if (wrap_to_next_line(win) == ERR) + return ERR; + x = win->_curx; + y = win->_cury; + line = win->_line + y; + } + /* + * Check for cells which are orphaned by adding this character, set + * those to blanks. + * + * FIXME: this actually could fill j-i cells, more complicated to + * setup though. + */ + for (i = 0; i < len; ++i) { + if (isWidecBase(win->_line[y].text[x + i])) { + break; + } else if (isWidecExt(win->_line[y].text[x + i])) { + for (j = i; x + j <= win->_maxx; ++j) { + if (!isWidecExt(win->_line[y].text[x + j])) { + TR(TRACE_VIRTPUT, ("fill %d orphan cells", j)); + fill_cells(win, j); + break; + } + } + break; + } + } + /* + * Finally, add the cells for this character. + */ + for (i = 0; i < len; ++i) { + cchar_t value = ch; + SetWidecExt(value, i); + TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)", + i + 1, len, + win->_begy + y, win->_begx + x)); + line->text[x] = value; + CHANGED_CELL(line, x); + ++x; + } + goto testwrapping; + } + } + + /* + * Single-column characters. + */ + line->text[x++] = ch; + /* + * This label is used only for wide-characters. + */ + testwrapping: + + TR(TRACE_VIRTPUT, ("cell (%ld, %ld..%d) = %s", + (long) win->_cury, (long) win->_curx, x - 1, + _tracech_t(CHREF(ch)))); + + if (x > win->_maxx) { + return wrap_to_next_line(win); + } + win->_curx = (NCURSES_SIZE_T) x; + return OK; +} + +static NCURSES_INLINE int +wadd_wch_nosync(WINDOW *win, cchar_t ch) +/* the workhorse function -- add a character to the given window */ +{ + NCURSES_SIZE_T x, y; + wchar_t *s; + int tabsize = 8; +#if USE_REENTRANT + SCREEN *sp = _nc_screen_of(win); +#endif + + /* + * If we are using the alternate character set, forget about locale. + * Otherwise, if the locale claims the code is printable, treat it that + * way. + */ + if ((AttrOf(ch) & A_ALTCHARSET) + || iswprint((wint_t) CharOf(ch))) + return wadd_wch_literal(win, ch); + + /* + * Handle carriage control and other codes that are not printable, or are + * known to expand to more than one character according to unctrl(). + */ + x = win->_curx; + y = win->_cury; + + switch (CharOf(ch)) { + case '\t': +#if USE_REENTRANT + tabsize = *ptrTabsize(sp); +#else + tabsize = TABSIZE; +#endif + x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize))); + /* + * Space-fill the tab on the bottom line so that we'll get the + * "correct" cursor position. + */ + if ((!win->_scroll && (y == win->_regbottom)) + || (x <= win->_maxx)) { + cchar_t blank = blankchar; + AddAttr(blank, AttrOf(ch)); + while (win->_curx < x) { + if (wadd_wch_literal(win, blank) == ERR) + return (ERR); + } + break; + } else { + wclrtoeol(win); + win->_flags |= _WRAPPED; + if (newline_forces_scroll(win, &y)) { + x = win->_maxx; + if (win->_scroll) { + scroll(win); + x = 0; + } + } else { + x = 0; + } + } + break; + case '\n': + wclrtoeol(win); + if (newline_forces_scroll(win, &y)) { + if (win->_scroll) + scroll(win); + else + return (ERR); + } + /* FALLTHRU */ + case '\r': + x = 0; + win->_flags &= ~_WRAPPED; + break; + case '\b': + if (x == 0) + return (OK); + x--; + win->_flags &= ~_WRAPPED; + break; + default: + if ((s = wunctrl(&ch)) != 0) { + while (*s) { + cchar_t sch; + SetChar(sch, *s++, AttrOf(ch)); + if_EXT_COLORS(SetPair(sch, GetPair(ch))); + if (wadd_wch_literal(win, sch) == ERR) + return ERR; + } + return OK; + } + return ERR; + } + + win->_curx = x; + win->_cury = y; + + return OK; +} + +/* + * The versions below call _nc_synchook(). We wanted to avoid this in the + * version exported for string puts; they'll call _nc_synchook once at end + * of run. + */ + +/* These are actual entry points */ NCURSES_EXPORT(int) wadd_wch(WINDOW *win, const cchar_t *wch) { - PUTC_DATA; - int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, - _tracech_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), + (void *) win, + _tracecchar_t(wch))); - if (win != 0) { - PUTC_INIT; - for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { - attr_t attrs = (wch->attr & A_ATTRIBUTES); - - if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') - break; - if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { - code = ERR; - if (is8bits(PUTC_ch)) - code = waddch(win, UChar(PUTC_ch) | attrs); - break; - } - for (n = 0; n < PUTC_n; n++) { - if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { - break; - } - } - if (code == ERR) - break; - } + if (win && (wadd_wch_nosync(win, *wch) != ERR)) { + _nc_synchook(win); + code = OK; } TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); @@ -77,37 +425,19 @@ wadd_wch(WINDOW *win, const cchar_t *wch) NCURSES_EXPORT(int) wecho_wchar(WINDOW *win, const cchar_t *wch) { - PUTC_DATA; - int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win, - _tracech_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), + (void *) win, + _tracecchar_t(wch))); - if (win != 0) { - PUTC_INIT; - for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { - attr_t attrs = (wch->attr & A_ATTRIBUTES); - - if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') - break; - if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { - code = ERR; - if (is8bits(PUTC_ch)) - code = waddch(win, UChar(PUTC_ch) | attrs); - break; - } - for (n = 0; n < PUTC_n; n++) { - if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { - break; - } - } - if (code == ERR) - break; - } - wrefresh(win); + if (win && (wadd_wch_nosync(win, *wch) != ERR)) { + bool save_immed = win->_immed; + win->_immed = TRUE; + _nc_synchook(win); + win->_immed = save_immed; + code = OK; } - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); return (code); } diff --git a/ncurses/widechar/lib_box_set.c b/ncurses/widechar/lib_box_set.c index 35fce46d8d4..585c94963b0 100644 --- a/ncurses/widechar/lib_box_set.c +++ b/ncurses/widechar/lib_box_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2003,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_box_set.c,v 1.4 2003/12/06 18:02:13 tom Exp $") +MODULE_ID("$Id: lib_box_set.c,v 1.5 2009/10/24 22:36:56 tom Exp $") NCURSES_EXPORT(int) wborder_set(WINDOW *win, @@ -53,7 +53,7 @@ wborder_set(WINDOW *win, NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, + (void *) win, _tracech_t2(1, ls), _tracech_t2(2, rs), _tracech_t2(3, ts), diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index b4a0c37a285..c61c79529db 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,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 * @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.12 2007/05/12 19:03:06 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.20 2010/12/25 23:46:26 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -50,15 +50,15 @@ setcchar(cchar_t *wcval, short color_pair, const void *opts) { - int i; - int len; + unsigned i; + unsigned len; int code = OK; TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), - wcval, _nc_viswbuf(wch), + (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); - len = wcslen(wch); + len = (unsigned) wcslen(wch); if (opts != NULL || (len > 1 && wcwidth(wch[0]) < 0)) { code = ERR; @@ -80,7 +80,7 @@ setcchar(cchar_t *wcval, memset(wcval, 0, sizeof(*wcval)); if (len != 0) { - SetAttr(*wcval, attrs | COLOR_PAIR(color_pair)); + SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair)); SetPair(CHDEREF(wcval), color_pair); memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, @@ -104,20 +104,28 @@ getcchar(const cchar_t *wcval, int code = ERR; TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), - wcval, wch, attrs, color_pair, opts)); + (const void *) wcval, + (void *) wch, + (void *) attrs, + (void *) color_pair, + opts)); if (opts == NULL) { - len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) - ? wp - wcval->chars - : CCHARW_MAX; + len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? (int) (wp - wcval->chars) + : CCHARW_MAX); if (wch == NULL) { - code = len; + /* + * If the value is a null, set the length to 1. + * If the value is not a null, return the length plus 1 for null. + */ + code = (len < CCHARW_MAX) ? (len + 1) : CCHARW_MAX; } else if (attrs == 0 || color_pair == 0) { code = ERR; } else if (len >= 0) { *attrs = AttrOf(*wcval) & A_ATTRIBUTES; - *color_pair = GetPair(*wcval); + *color_pair = (short) GetPair(*wcval); wmemcpy(wch, wcval->chars, (unsigned) len); wch[len] = L'\0'; code = OK; diff --git a/ncurses/widechar/lib_erasewchar.c b/ncurses/widechar/lib_erasewchar.c index 7d6455370ff..a4ee93ffa42 100644 --- a/ncurses/widechar/lib_erasewchar.c +++ b/ncurses/widechar/lib_erasewchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002,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 * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") +MODULE_ID("$Id: lib_erasewchar.c,v 1.2 2010/07/24 11:35:12 tom Exp $") /* * erasewchar() @@ -42,7 +42,7 @@ MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") */ NCURSES_EXPORT(int) -erasewchar(wchar_t * wch) +erasewchar(wchar_t *wch) { int value; int result = ERR; @@ -63,7 +63,7 @@ erasewchar(wchar_t * wch) */ NCURSES_EXPORT(int) -killwchar(wchar_t * wch) +killwchar(wchar_t *wch) { int value; int result = ERR; diff --git a/ncurses/widechar/lib_get_wch.c b/ncurses/widechar/lib_get_wch.c index 6cf3129f2d1..32033df2ff9 100644 --- a/ncurses/widechar/lib_get_wch.c +++ b/ncurses/widechar/lib_get_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -40,22 +40,7 @@ #include #include -MODULE_ID("$Id: lib_get_wch.c,v 1.17 2008/08/16 19:22:55 tom Exp $") - -#if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) -#define count_mbytes(buffer,length,state) mblen(buffer,length) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbtowc(&wch, buffer, length) -#define state_unused -#elif HAVE_MBRTOWC && HAVE_MBRLEN -#define reset_mbytes(state) init_mb(state) -#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbrtowc(&wch, buffer, length, &state) -#else -make an error -#endif +MODULE_ID("$Id: lib_get_wch.c,v 1.22 2010/08/28 21:00:35 tom Exp $") NCURSES_EXPORT(int) wget_wch(WINDOW *win, wint_t *result) @@ -65,13 +50,13 @@ wget_wch(WINDOW *win, wint_t *result) char buffer[(MB_LEN_MAX * 9) + 1]; /* allow some redundant shifts */ int status; size_t count = 0; - unsigned long value; + int value = 0; wchar_t wch; #ifndef state_unused mbstate_t state; #endif - T((T_CALLED("wget_wch(%p)"), win)); + T((T_CALLED("wget_wch(%p)"), (void *) win)); /* * We can get a stream of single-byte characters and KEY_xxx codes from @@ -95,12 +80,12 @@ wget_wch(WINDOW *win, wint_t *result) * whether the improvement would be worth the effort. */ if (count != 0) { - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); code = ERR; } break; } else if (count + 1 >= sizeof(buffer)) { - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); code = ERR; break; } else { @@ -111,7 +96,7 @@ wget_wch(WINDOW *win, wint_t *result) reset_mbytes(state); if (check_mbytes(wch, buffer, count, state) != status) { code = ERR; /* the two calls should match */ - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); } value = wch; break; @@ -121,8 +106,8 @@ wget_wch(WINDOW *win, wint_t *result) } else { code = ERR; } - *result = value; + *result = (wint_t) value; _nc_unlock_global(curses); - T(("result %#lo", value)); + T(("result %#o", value)); returnCode(code); } diff --git a/ncurses/widechar/lib_get_wstr.c b/ncurses/widechar/lib_get_wstr.c index baa70a5a53f..0b450211b2c 100644 --- a/ncurses/widechar/lib_get_wstr.c +++ b/ncurses/widechar/lib_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-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 * @@ -38,9 +38,8 @@ */ #include -#include -MODULE_ID("$Id: lib_get_wstr.c,v 1.10 2008/08/16 19:25:33 tom Exp $") +MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -96,7 +95,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen) wint_t ch; int y, x, code; - T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), (void *) win, (void *) str, maxlen)); if (!win) returnCode(ERR); diff --git a/ncurses/widechar/lib_hline_set.c b/ncurses/widechar/lib_hline_set.c index 43175de8346..da92b834f1c 100644 --- a/ncurses/widechar/lib_hline_set.c +++ b/ncurses/widechar/lib_hline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") +MODULE_ID("$Id: lib_hline_set.c,v 1.4 2010/12/19 01:45:03 tom Exp $") NCURSES_EXPORT(int) -whline_set(WINDOW *win, const cchar_t * ch, int n) +whline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T start; - NCURSES_SIZE_T end; + int start; + int end; - T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/ncurses/widechar/lib_in_wch.c b/ncurses/widechar/lib_in_wch.c index 5cd92e382de..b2396508ba2 100644 --- a/ncurses/widechar/lib_in_wch.c +++ b/ncurses/widechar/lib_in_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2006,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_in_wch.c,v 1.4 2006/09/03 15:41:22 tom Exp $") +MODULE_ID("$Id: lib_in_wch.c,v 1.5 2009/10/24 22:37:55 tom Exp $") NCURSES_EXPORT(int) win_wch(WINDOW *win, cchar_t *wcval) @@ -47,7 +47,7 @@ win_wch(WINDOW *win, cchar_t *wcval) int row, col; int code = OK; - TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval)); if (win != 0 && wcval != 0) { getyx(win, row, col); diff --git a/ncurses/widechar/lib_in_wchnstr.c b/ncurses/widechar/lib_in_wchnstr.c index e9f0646ea66..57cc2ca6e73 100644 --- a/ncurses/widechar/lib_in_wchnstr.c +++ b/ncurses/widechar/lib_in_wchnstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004-2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2007,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 * @@ -39,14 +39,14 @@ #include -MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $") +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.8 2009/10/24 22:37:48 tom Exp $") NCURSES_EXPORT(int) win_wchnstr(WINDOW *win, cchar_t *wchstr, int n) { int code = OK; - T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); + T((T_CALLED("win_wchnstr(%p,%p,%d)"), (void *) win, (void *) wchstr, n)); if (win != 0 && wchstr != 0) { NCURSES_CH_T *src; diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index c3d0420e53b..1eee8a3ec01 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2003,2005 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,39 +39,44 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.8 2005/12/03 20:24:19 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $") /* * Insert the given character, updating the current location to simplify * inserting a string. */ -static int +NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *win, const cchar_t *wch) { int cells = wcwidth(CharOf(CHDEREF(wch))); int cell; + int code = OK; - if (cells <= 0) - cells = 1; + if (cells < 0) { + code = winsch(win, (chtype) CharOf(CHDEREF(wch))); + } else { + if (cells == 0) + cells = 1; - if (win->_curx <= win->_maxx) { - struct ldat *line = &(win->_line[win->_cury]); - NCURSES_CH_T *end = &(line->text[win->_curx]); - NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); - NCURSES_CH_T *temp2 = temp1 - cells; + if (win->_curx <= win->_maxx) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - cells; - CHANGED_TO_EOL(line, win->_curx, win->_maxx); - while (temp1 > end) - *temp1-- = *temp2--; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; - *temp1 = _nc_render(win, *wch); - for (cell = 1; cell < cells; ++cell) { - SetWidecExt(temp1[cell], cell); + *temp1 = _nc_render(win, *wch); + for (cell = 1; cell < cells; ++cell) { + SetWidecExt(temp1[cell], cell); + } + + win->_curx++; } - - win->_curx++; } - return OK; + return code; } NCURSES_EXPORT(int) @@ -81,7 +86,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) NCURSES_SIZE_T ox; int code = ERR; - T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); + T((T_CALLED("wins_wch(%p, %s)"), (void *) win, _tracecchar_t(wch))); if (win != 0) { oy = win->_cury; @@ -104,20 +109,23 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T ox; const wchar_t *cp; - T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n)); + T((T_CALLED("wins_nwstr(%p,%s,%d)"), + (void *) win, _nc_viswbufn(wstr, n), n)); if (win != 0 && wstr != 0) { if (n < 1) - n = wcslen(wstr); + n = (int) wcslen(wstr); code = OK; if (n > 0) { + SCREEN *sp = _nc_screen_of(win); + oy = win->_cury; ox = win->_curx; for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { int len = wcwidth(*cp); - if (len != 1 || !is8bits(*cp)) { + if ((len >= 0 && len != 1) || !is7bits(*cp)) { cchar_t tmp_cchar; wchar_t tmp_wchar = *cp; memset(&tmp_cchar, 0, sizeof(tmp_cchar)); @@ -129,7 +137,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) code = _nc_insert_wch(win, &tmp_cchar); } else { /* tabs, other ASCII stuff */ - code = _nc_insert_ch(win, (chtype) (*cp)); + code = _nc_insert_ch(sp, win, (chtype) (*cp)); } if (code != OK) break; diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c index 2207a5f5d19..4cf7182ae06 100644 --- a/ncurses/widechar/lib_inwstr.c +++ b/ncurses/widechar/lib_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2004 Free Software Foundation, Inc. * + * Copyright (c) 2002-2004,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_inwstr.c,v 1.4 2004/10/23 20:41:28 tom Exp $") +MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) @@ -50,7 +50,7 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n) cchar_t *text; wchar_t wch; - T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); + T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n)); if (wstr != 0) { if (win) { getyx(win, row, col); @@ -93,7 +93,7 @@ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; - T((T_CALLED("winwstr(%p,%p)"), win, wstr)); + T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) result = ERR; returnCode(result); diff --git a/ncurses/widechar/lib_pecho_wchar.c b/ncurses/widechar/lib_pecho_wchar.c index e6127757431..b6da7a86569 100644 --- a/ncurses/widechar/lib_pecho_wchar.c +++ b/ncurses/widechar/lib_pecho_wchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004 Free Software Foundation, Inc. * + * Copyright (c) 2004,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 * @@ -32,12 +32,12 @@ #include -MODULE_ID("$Id: lib_pecho_wchar.c,v 1.1 2004/01/03 21:42:01 tom Exp $") +MODULE_ID("$Id: lib_pecho_wchar.c,v 1.2 2009/10/24 22:43:32 tom Exp $") NCURSES_EXPORT(int) -pecho_wchar(WINDOW *pad, const cchar_t * wch) +pecho_wchar(WINDOW *pad, const cchar_t *wch) { - T((T_CALLED("pecho_wchar(%p, %s)"), pad, _tracech_t(wch))); + T((T_CALLED("pecho_wchar(%p, %s)"), (void *) pad, _tracech_t(wch))); if (pad == 0) returnCode(ERR); diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c index bb2c4a084b1..7a626a9eee8 100644 --- a/ncurses/widechar/lib_unget_wch.c +++ b/ncurses/widechar/lib_unget_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.10 2008/06/07 14:50:37 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.14 2010/07/24 11:35:21 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -55,24 +55,24 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state) const wchar_t *tempp = temp; temp[0] = source; temp[1] = 0; - result = wcsrtombs(NULL, &tempp, 0, state); + result = (int) wcsrtombs(NULL, &tempp, 0, state); } else { - result = wcrtomb(target, source, state); + result = (int) wcrtomb(target, source, state); } if (!isEILSEQ(result) && (result == 0)) result = 1; - return result; + return (size_t) result; } NCURSES_EXPORT(int) -unget_wch(const wchar_t wch) +NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) { int result = OK; mbstate_t state; size_t length; int n; - T((T_CALLED("unget_wch(%#lx)"), (unsigned long) wch)); + T((T_CALLED("unget_wch(%p, %#lx)"), (void *) SP_PARM, (unsigned long) wch)); init_mb(state); length = _nc_wcrtomb(0, wch, &state); @@ -83,10 +83,12 @@ unget_wch(const wchar_t wch) if ((string = (char *) malloc(length)) != 0) { init_mb(state); - wcrtomb(string, wch, &state); + /* ignore the result, since we already validated the character */ + IGNORE_RC((int) wcrtomb(string, wch, &state)); for (n = (int) (length - 1); n >= 0; --n) { - if (_nc_ungetch(SP, string[n]) != OK) { + if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx + UChar(string[n])) !=OK) { result = ERR; break; } @@ -101,3 +103,11 @@ unget_wch(const wchar_t wch) returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +unget_wch(const wchar_t wch) +{ + return NCURSES_SP_NAME(unget_wch) (CURRENT_SCREEN, wch); +} +#endif diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c index 1dc679e6d90..e4cf093a1f6 100644 --- a/ncurses/widechar/lib_vid_attr.c +++ b/ncurses/widechar/lib_vid_attr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -31,11 +31,14 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) +MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $") + +#define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -50,14 +53,22 @@ MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - _nc_do_color(old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \ + old_pair, pair, \ + reverse, outc); \ } \ } -#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= COLOR_PAIR(pair) +#define set_color(mode, pair) \ + mode &= ALL_BUT_COLOR; \ + mode |= (attr_t) ColorPair(pair) NCURSES_EXPORT(int) -vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) +NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx + attr_t newmode, + short pair, + void *opts GCC_UNUSED, + NCURSES_SP_OUTC outc) { #if NCURSES_EXT_COLORS static attr_t previous_attr = A_NORMAL; @@ -65,9 +76,9 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) attr_t turn_on, turn_off; bool reverse = FALSE; - bool can_color = (SP == 0 || SP->_coloron); + bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); + bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); #else #define fix_pair0 FALSE #endif @@ -76,18 +87,18 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); /* this allows us to go on whether or not newterm() has been called */ - if (SP) { - previous_attr = AttrOf(SCREEN_ATTRS(SP)); - previous_pair = GetPair(SCREEN_ATTRS(SP)); + if (SP_PARM) { + previous_attr = AttrOf(SCREEN_ATTRS(SP_PARM)); + previous_pair = GetPair(SCREEN_ATTRS(SP_PARM)); } TR(TRACE_ATTRS, ("previous attribute was %s, %d", _traceattr(previous_attr), previous_pair)); #if !USE_XMC_SUPPORT - if ((SP != 0) + if ((SP_PARM != 0) && (magic_cookie_glitch > 0)) - newmode &= ~(SP->_xmc_suppress); + newmode &= ~(SP_PARM->_xmc_suppress); #endif /* @@ -144,10 +155,10 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -159,16 +170,18 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - tputs(TPARM_9(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), + 1, outc); previous_attr &= ALL_BUT_COLOR; previous_pair = 0; } @@ -179,11 +192,11 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -221,9 +234,9 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) if (reverse) newmode |= A_REVERSE; - if (SP) { - SetAttr(SCREEN_ATTRS(SP), newmode); - SetPair(SCREEN_ATTRS(SP), pair); + if (SP_PARM) { + SetAttr(SCREEN_ATTRS(SP_PARM), newmode); + SetPair(SCREEN_ATTRS(SP_PARM), pair); } else { previous_attr = newmode; previous_pair = pair; @@ -233,29 +246,60 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) #else T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); set_color(newmode, pair); - returnCode(vidputs(newmode, outc)); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, outc)); #endif } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +vid_puts(attr_t newmode, + short pair, + void *opts GCC_UNUSED, + NCURSES_OUTC outc) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vid_puts) (CURRENT_SCREEN, + newmode, + pair, + opts, + _nc_outc_wrapper); +} +#endif + #undef vid_attr NCURSES_EXPORT(int) +NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx + attr_t newmode, + short pair, + void *opts) +{ + T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); + returnCode(NCURSES_SP_NAME(vid_puts) (NCURSES_SP_ARGx + newmode, + pair, + opts, + NCURSES_SP_NAME(_nc_outch))); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) vid_attr(attr_t newmode, short pair, void *opts) { - T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); - returnCode(vid_puts(newmode, pair, opts, _nc_outch)); + return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts); } +#endif /* * This implementation uses the same mask values for A_xxx and WA_xxx, so * we can use termattrs() for part of the logic. */ NCURSES_EXPORT(attr_t) -term_attrs(void) +NCURSES_SP_NAME(term_attrs) (NCURSES_SP_DCL0) { attr_t attrs; T((T_CALLED("term_attrs()"))); - attrs = termattrs(); + attrs = SP_PARM ? NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG) : 0; /* these are only supported for wide-character mode */ if (enter_horizontal_hl_mode) @@ -273,3 +317,11 @@ term_attrs(void) returnAttr(attrs); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(attr_t) +term_attrs(void) +{ + return NCURSES_SP_NAME(term_attrs) (CURRENT_SCREEN); +} +#endif diff --git a/ncurses/widechar/lib_vline_set.c b/ncurses/widechar/lib_vline_set.c index af42df1f24a..917caac44b4 100644 --- a/ncurses/widechar/lib_vline_set.c +++ b/ncurses/widechar/lib_vline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") +MODULE_ID("$Id: lib_vline_set.c,v 1.4 2010/12/19 01:50:50 tom Exp $") NCURSES_EXPORT(int) -wvline_set(WINDOW *win, const cchar_t * ch, int n) +wvline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T row, col; - NCURSES_SIZE_T end; + int row, col; + int end; - T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { NCURSES_CH_T wch; diff --git a/ncurses/widechar/lib_wacs.c b/ncurses/widechar/lib_wacs.c index fe893b4d2f8..5a16e457e09 100644 --- a/ncurses/widechar/lib_wacs.c +++ b/ncurses/widechar/lib_wacs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,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 * @@ -31,9 +31,8 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: lib_wacs.c,v 1.7 2006/12/17 15:16:17 tom Exp $") +MODULE_ID("$Id: lib_wacs.c,v 1.10 2010/12/19 01:43:19 tom Exp $") NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; @@ -42,7 +41,7 @@ _nc_init_wacs(void) { /* *INDENT-OFF* */ static const struct { - int map; + unsigned map; int value[2]; } table[] = { /* VT100 symbols */ @@ -80,6 +79,30 @@ _nc_init_wacs(void) { '{', { '*', 0x03c0 }}, /* greek pi */ { '|', { '!', 0x2260 }}, /* not-equal */ { '}', { 'f', 0x00a3 }}, /* pound-sterling symbol */ + /* thick-line-drawing */ + { 'L', { '+', 0x250f }}, /* upper left corner */ + { 'M', { '+', 0x2517 }}, /* lower left corner */ + { 'K', { '+', 0x2513 }}, /* upper right corner */ + { 'J', { '+', 0x251b }}, /* lower right corner */ + { 'T', { '+', 0x2523 }}, /* tee pointing left */ + { 'U', { '+', 0x252b }}, /* tee pointing right */ + { 'V', { '+', 0x253b }}, /* tee pointing up */ + { 'W', { '+', 0x2533 }}, /* tee pointing down */ + { 'Q', { '-', 0x2501 }}, /* horizontal line */ + { 'X', { '|', 0x2503 }}, /* vertical line */ + { 'N', { '+', 0x254b }}, /* large plus or crossover */ + /* double-line-drawing */ + { 'C', { '+', 0x2554 }}, /* upper left corner */ + { 'D', { '+', 0x255a }}, /* lower left corner */ + { 'B', { '+', 0x2557 }}, /* upper right corner */ + { 'A', { '+', 0x255d }}, /* lower right corner */ + { 'G', { '+', 0x2563 }}, /* tee pointing left */ + { 'F', { '+', 0x2560 }}, /* tee pointing right */ + { 'H', { '+', 0x2569 }}, /* tee pointing up */ + { 'I', { '+', 0x2566 }}, /* tee pointing down */ + { 'R', { '-', 0x2550 }}, /* horizontal line */ + { 'Y', { '|', 0x2551 }}, /* vertical line */ + { 'E', { '+', 0x256c }}, /* large plus or crossover */ }; /* *INDENT-ON* */ diff --git a/ncurses/widechar/lib_wunctrl.c b/ncurses/widechar/lib_wunctrl.c index be2259acdcf..50958e44c7b 100644 --- a/ncurses/widechar/lib_wunctrl.c +++ b/ncurses/widechar/lib_wunctrl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,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 * @@ -35,21 +35,31 @@ #include -MODULE_ID("$Id: lib_wunctrl.c,v 1.12 2007/06/12 20:22:32 tom Exp $") +MODULE_ID("$Id: lib_wunctrl.c,v 1.14 2010/12/19 01:42:15 tom Exp $") NCURSES_EXPORT(wchar_t *) -wunctrl(cchar_t *wc) +NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc) { - static wchar_t str[CCHARW_MAX + 1], *sp; + static wchar_t str[CCHARW_MAX + 1], *wsp; if (Charable(*wc)) { - const char *p = unctrl((unsigned) _nc_to_char((wint_t) CharOf(*wc))); + const char *p = + NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx + (unsigned) _nc_to_char((wint_t)CharOf(*wc))); - for (sp = str; *p; ++p) { - *sp++ = _nc_to_widechar(*p); + for (wsp = str; *p; ++p) { + *wsp++ = (wchar_t) _nc_to_widechar(*p); } - *sp = 0; + *wsp = 0; return str; } else return wc->chars; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(wchar_t *) +wunctrl(cchar_t *wc) +{ + return NCURSES_SP_NAME(wunctrl) (CURRENT_SCREEN, wc); +} +#endif diff --git a/ncurses/win32con/gettimeofday.c b/ncurses/win32con/gettimeofday.c new file mode 100644 index 00000000000..e1ef3401de3 --- /dev/null +++ b/ncurses/win32con/gettimeofday.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * Copyright (c) 2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "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. * + ****************************************************************************/ + +#define WINVER 0x0501 + +#include + +#include + +MODULE_ID("$Id: gettimeofday.c,v 1.2 2010/01/16 15:18:51 tom Exp $") + +#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ + +int +gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) +{ + union { + FILETIME ft; + long long since1601; /* time since 1 Jan 1601 in 100ns units */ + } data; + + GetSystemTimeAsFileTime(&data.ft); + tv->tv_usec = (long) ((data.since1601 / 10LL) % 1000000LL); + tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL); + return (0); +} diff --git a/ncurses/win32con/wcwidth.c b/ncurses/win32con/wcwidth.c new file mode 100644 index 00000000000..cdef64a23c0 --- /dev/null +++ b/ncurses/win32con/wcwidth.c @@ -0,0 +1,50 @@ +/**************************************************************************** + * Copyright (c) 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"), 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. * + ****************************************************************************/ +#include + +MODULE_ID("$Id: wcwidth.c,v 1.2 2010/08/07 20:52:43 tom Exp $") + +#if USE_WIDEC_SUPPORT +#define mk_wcwidth(ucs) _nc_wcwidth(ucs) +#define mk_wcswidth(pwcs, n) _nc_wcswidth(pwcs, n) +#define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) +#define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) + +extern int mk_wcwidth(wchar_t); +extern int mk_wcswidth(const wchar_t *, size_t); +extern int mk_wcwidth_cjk(wchar_t); +extern int mk_wcswidth_cjk(const wchar_t *, size_t); + +#include +#else +void _nc_empty_wcwidth(void); +void +_nc_empty_wcwidth(void) +{ +} +#endif diff --git a/ncurses/win32con/win_driver.c b/ncurses/win32con/win_driver.c new file mode 100644 index 00000000000..c214639cd4d --- /dev/null +++ b/ncurses/win32con/win_driver.c @@ -0,0 +1,1241 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,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"), 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: Juergen Pfeifer * + * * + ****************************************************************************/ + +/* + * TODO - GetMousePos(POINT * result) from ntconio.c + * TODO - implement nodelay + */ + +#include +#define CUR my_term.type. + +MODULE_ID("$Id: win_driver.c,v 1.10 2010/12/25 19:28:21 tom Exp $") + +#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) + +#define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC) +#define SetSP() assert(TCB->csp!=0); sp = TCB->csp + +#define GenMap(vKey,key) MAKELONG(key, vKey) + +static const LONG keylist[] = +{ + GenMap(VK_PRIOR, KEY_PPAGE), + GenMap(VK_NEXT, KEY_NPAGE), + GenMap(VK_END, KEY_END), + GenMap(VK_HOME, KEY_HOME), + GenMap(VK_LEFT, KEY_LEFT), + GenMap(VK_UP, KEY_UP), + GenMap(VK_RIGHT, KEY_RIGHT), + GenMap(VK_DOWN, KEY_DOWN), + GenMap(VK_DELETE, KEY_DC), + GenMap(VK_INSERT, KEY_IC) +}; +#define N_INI ((int)(sizeof(keylist)/sizeof(keylist[0]))) +#define FKEYS 24 +#define MAPSIZE (FKEYS + N_INI) +#define NUMPAIRS 64 + +typedef struct props { + CONSOLE_SCREEN_BUFFER_INFO SBI; + bool progMode; + DWORD map[MAPSIZE]; + DWORD rmap[MAPSIZE]; + WORD pairs[NUMPAIRS]; +} Properties; + +#define PropOf(TCB) ((Properties*)TCB->prop) + +int +_nc_mingw_ioctl(int fd GCC_UNUSED, + long int request GCC_UNUSED, + struct termios *arg GCC_UNUSED) +{ + return 0; + endwin(); + fprintf(stderr, "TERMINFO currently not supported on Windows.\n"); + exit(1); +} + +static WORD +MapColor(bool fore, int color) +{ + static const int _cmap[] = + {0, 4, 2, 6, 1, 5, 3, 7}; + int a; + if (color < 0 || color > 7) + a = fore ? 7 : 0; + else + a = _cmap[color]; + if (!fore) + a = a << 4; + return (WORD) a; +} + +static WORD +MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, chtype ch) +{ + if (ch & A_COLOR) { + int p; + SCREEN *sp; + + AssertTCB(); + SetSP(); + p = PairNumber(ch); + if (p > 0 && p < NUMPAIRS && TCB != 0 && sp != 0) { + WORD a; + a = PropOf(TCB)->pairs[p]; + res = (res & 0xff00) | a; + } + } + + if (ch & A_REVERSE) + res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4))); + + if (ch & A_STANDOUT) + res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4)) + | BACKGROUND_INTENSITY); + + if (ch & A_BOLD) + res |= FOREGROUND_INTENSITY; + + if (ch & A_DIM) + res |= BACKGROUND_INTENSITY; + + return res; +} + +static BOOL +con_write(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) +{ + CHAR_INFO ci[n]; + COORD loc, siz; + SMALL_RECT rec; + int i; + chtype ch; + SCREEN *sp; + + AssertTCB(); + + if (TCB == 0 || InvalidConsoleHandle(TCB->hdl)) + return FALSE; + + SetSP(); + + for (i = 0; i < n; i++) { + ch = str[i]; + ci[i].Char.AsciiChar = ChCharOf(ch); + ci[i].Attributes = MapAttr(TCB, + PropOf(TCB)->SBI.wAttributes, + ChAttrOf(ch)); + if (ChAttrOf(ch) & A_ALTCHARSET) { + if (sp->_acs_map) + ci[i].Char.AsciiChar = + ChCharOf(NCURSES_SP_NAME(_nc_acs_char) (sp, ChCharOf(ch))); + } + } + + loc.X = (short) 0; + loc.Y = (short) 0; + siz.X = (short) n; + siz.Y = 1; + + rec.Left = (short) x; + rec.Top = (short) y; + rec.Right = (short) (x + n - 1); + rec.Bottom = rec.Top; + + return WriteConsoleOutput(TCB->hdl, ci, siz, loc, &rec); +} + +#define MARK_NOCHANGE(win,row) \ + win->_line[row].firstchar = _NOCHANGE; \ + win->_line[row].lastchar = _NOCHANGE + +static int +drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + int y, nonempty, n, x0, x1, Width, Height; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + Width = screen_columns(sp); + Height = screen_lines(sp); + nonempty = min(Height, NewScreen(sp)->_maxy + 1); + + if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { + int x; + chtype empty[Width]; + + for (x = 0; x < Width; x++) + empty[x] = ' '; + + for (y = 0; y < nonempty; y++) { + con_write(TCB, y, 0, empty, Width); + memcpy(empty, + CurScreen(sp)->_line[y].text, + Width * sizeof(chtype)); + } + CurScreen(sp)->_clear = FALSE; + NewScreen(sp)->_clear = FALSE; + touchwin(NewScreen(sp)); + } + + for (y = 0; y < nonempty; y++) { + x0 = NewScreen(sp)->_line[y].firstchar; + if (x0 != _NOCHANGE) { + x1 = NewScreen(sp)->_line[y].lastchar; + n = x1 - x0 + 1; + if (n > 0) { + memcpy(CurScreen(sp)->_line[y].text + x0, + NewScreen(sp)->_line[y].text + x0, + n * sizeof(chtype)); + con_write(TCB, + y, + x0, + ((chtype *) CurScreen(sp)->_line[y].text) + x0, n); + + /* mark line changed successfully */ + if (y <= NewScreen(sp)->_maxy) { + MARK_NOCHANGE(NewScreen(sp), y); + } + if (y <= CurScreen(sp)->_maxy) { + MARK_NOCHANGE(CurScreen(sp), y); + } + } + } + } + + /* put everything back in sync */ + for (y = nonempty; y <= NewScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(NewScreen(sp), y); + } + for (y = nonempty; y <= CurScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(CurScreen(sp), y); + } + + if (!NewScreen(sp)->_leaveok) { + CurScreen(sp)->_curx = NewScreen(sp)->_curx; + CurScreen(sp)->_cury = NewScreen(sp)->_cury; + + TCB->drv->hwcur(TCB, 0, 0, CurScreen(sp)->_cury, CurScreen(sp)->_curx); + } + SetConsoleActiveScreenBuffer(TCB->hdl); + return OK; +} + +static bool +drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, + const char *tname, + int *errret GCC_UNUSED) +{ + bool code = FALSE; + + T((T_CALLED("win32con::drv_CanHandle(%p)"), TCB)); + + assert(TCB != 0); + assert(tname != 0); + + TCB->magic = WINMAGIC; + if (*tname == 0 || *tname == 0) { + code = TRUE; + } else { + TERMINAL my_term; + int status; + + code = FALSE; +#if (USE_DATABASE || USE_TERMCAP) + status = _nc_setup_tinfo(tname, &my_term.type); +#else + status = TGETENT_NO; +#endif + if (status != TGETENT_YES) { + const TERMTYPE *fallback = _nc_fallback(tname); + + if (fallback) { + my_term.type = *fallback; + status = TGETENT_YES; + } else if (!strcmp(tname, "unknown")) { + code = TRUE; + } + } + if (status == TGETENT_YES) { + if (generic_type || hard_copy) + code = TRUE; + } + } + + if (code) { + if ((TCB->term.type.Booleans) == 0) { + _nc_init_entry(&(TCB->term.type)); + } + } + + returnBool(code); +} + +static int +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, + bool beepFlag GCC_UNUSED) +{ + SCREEN *sp; + int res = ERR; + + AssertTCB(); + SetSP(); + + return res; +} + +static int +drv_print(TERMINAL_CONTROL_BLOCK * TCB, + char *data GCC_UNUSED, + int len GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return ERR; +} + +static int +drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, + int fg GCC_UNUSED, + int bg GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + return (code); +} + +static void +drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + bool fore, + int color, + int (*outc) (SCREEN *, int) GCC_UNUSED) +{ + AssertTCB(); + + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + WORD a = MapColor(fore, color); + a = ((PropOf(TCB)->SBI.wAttributes) & (fore ? 0xfff8 : 0xff8f)) | a; + SetConsoleTextAttribute(TCB->hdl, a); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + } +} + +static bool +drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool res = FALSE; + + AssertTCB(); + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + WORD a = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; + SetConsoleTextAttribute(TCB->hdl, a); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + res = TRUE; + } + return res; +} + +static bool +drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return result; +} + +static int +drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *Lines, int *Cols) +{ + AssertTCB(); + + if (TCB == NULL || Lines == NULL || Cols == NULL || InvalidConsoleHandle(TCB->hdl)) + return ERR; + + *Lines = (int) (PropOf(TCB)->SBI.dwSize.Y); + *Cols = (int) (PropOf(TCB)->SBI.dwSize.X); + return OK; +} + +static int +drv_setsize(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, + int l GCC_UNUSED, + int c GCC_UNUSED) +{ + AssertTCB(); + return ERR; +} + +static int +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +{ + DWORD dwFlag = 0; + tcflag_t iflag; + tcflag_t lflag; + + AssertTCB(); + + if (TCB == 0 || buf == NULL) + return ERR; + + if (setFlag) { + iflag = buf->c_iflag; + lflag = buf->c_lflag; + + GetConsoleMode(TCB->inp, &dwFlag); + + if (lflag & ICANON) + dwFlag |= ENABLE_LINE_INPUT; + else + dwFlag &= ~ENABLE_LINE_INPUT; + + if (lflag & ECHO) + dwFlag |= ENABLE_ECHO_INPUT; + else + dwFlag &= ~ENABLE_ECHO_INPUT; + + if (iflag & BRKINT) + dwFlag |= ENABLE_PROCESSED_INPUT; + else + dwFlag &= ~ENABLE_PROCESSED_INPUT; + + dwFlag |= ENABLE_MOUSE_INPUT; + + buf->c_iflag = iflag; + buf->c_lflag = lflag; + SetConsoleMode(TCB->inp, dwFlag); + TCB->term.Nttyb = *buf; + } else { + iflag = TCB->term.Nttyb.c_iflag; + lflag = TCB->term.Nttyb.c_lflag; + GetConsoleMode(TCB->inp, &dwFlag); + + if (dwFlag & ENABLE_LINE_INPUT) + lflag |= ICANON; + else + lflag &= ~ICANON; + + if (dwFlag & ENABLE_ECHO_INPUT) + lflag |= ECHO; + else + lflag &= ~ECHO; + + if (dwFlag & ENABLE_PROCESSED_INPUT) + iflag |= BRKINT; + else + iflag &= ~BRKINT; + + TCB->term.Nttyb.c_iflag = iflag; + TCB->term.Nttyb.c_lflag = lflag; + + *buf = TCB->term.Nttyb; + } + return OK; +} + +static int +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + PropOf(TCB)->progMode = progFlag; + SetConsoleActiveScreenBuffer(progFlag ? TCB->hdl : TCB->out); + + if (progFlag) /* prog mode */ { + if (defFlag) { + if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { + _term->Nttyb.c_oflag &= ~OFLAGS_TABS; + code = OK; + } + } else { + /* reset_prog_mode */ + if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + NC_BUFFERED(sp, TRUE); + } + code = OK; + } + } + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + NC_BUFFERED(sp, FALSE); + } + code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + } + } + + return (code); +} + +static void +drv_screen_init(SCREEN *sp GCC_UNUSED) +{ +} + +static void +drv_wrap(SCREEN *sp GCC_UNUSED) +{ +} + +static int +rkeycompare(const void *el1, const void *el2) +{ + WORD key1 = (LOWORD((*((const LONG *) el1)))) & 0x7fff; + WORD key2 = (LOWORD((*((const LONG *) el2)))) & 0x7fff; + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +keycompare(const void *el1, const void *el2) +{ + WORD key1 = HIWORD((*((const LONG *) el1))); + WORD key2 = HIWORD((*((const LONG *) el2))); + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +MapKey(TERMINAL_CONTROL_BLOCK * TCB, WORD vKey) +{ + WORD nKey = 0; + void *res; + LONG key = GenMap(vKey, 0); + int code = -1; + + AssertTCB(); + + res = bsearch(&key, + PropOf(TCB)->map, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + keycompare); + if (res) { + key = *((LONG *) res); + nKey = LOWORD(key); + code = (int) (nKey & 0x7fff); + if (nKey & 0x8000) + code = -code; + } + return code; +} + +static void +drv_release(TERMINAL_CONTROL_BLOCK * TCB) +{ + T((T_CALLED("win32con::drv_release(%p)"), TCB)); + + AssertTCB(); + if (TCB->prop) + free(TCB->prop); + + returnVoid; +} + +static void +drv_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + DWORD num_buttons; + + T((T_CALLED("win32con::drv_init(%p)"), TCB)); + + AssertTCB(); + + if (TCB) { + BOOL b = AllocConsole(); + WORD a; + int i; + + if (!b) + b = AttachConsole(ATTACH_PARENT_PROCESS); + + TCB->inp = GetStdHandle(STD_INPUT_HANDLE); + TCB->out = GetStdHandle(STD_OUTPUT_HANDLE); + + if (getenv("NCGDB")) + TCB->hdl = TCB->out; + else + TCB->hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + CONSOLE_TEXTMODE_BUFFER, + NULL); + + if (!InvalidConsoleHandle(TCB->hdl)) { + TCB->prop = typeCalloc(Properties, 1); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + } + + TCB->info.initcolor = TRUE; + TCB->info.canchange = FALSE; + TCB->info.hascolor = TRUE; + TCB->info.caninit = TRUE; + + TCB->info.maxpairs = NUMPAIRS; + TCB->info.maxcolors = 8; + TCB->info.numlabels = 0; + TCB->info.labelwidth = 0; + TCB->info.labelheight = 0; + TCB->info.nocolorvideo = 1; + TCB->info.tabsize = 8; + + if (GetNumberOfConsoleMouseButtons(&num_buttons)) { + T(("mouse has %ld buttons", num_buttons)); + TCB->info.numbuttons = num_buttons; + } else { + TCB->info.numbuttons = 1; + } + + TCB->info.defaultPalette = _nc_cga_palette; + + for (i = 0; i < (N_INI + FKEYS); i++) { + if (i < N_INI) + PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = keylist[i]; + else + PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = + GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI))); + } + qsort(PropOf(TCB)->map, + (size_t) (MAPSIZE), + sizeof(keylist[0]), + keycompare); + qsort(PropOf(TCB)->rmap, + (size_t) (MAPSIZE), + sizeof(keylist[0]), + rkeycompare); + + a = MapColor(true, COLOR_WHITE) | MapColor(false, COLOR_BLACK); + for (i = 0; i < NUMPAIRS; i++) + PropOf(TCB)->pairs[i] = a; + } + returnVoid; +} + +static void +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, + short pair, + short f, + short b) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if ((pair > 0) && (pair < NUMPAIRS) && (f >= 0) && (f < 8) + && (b >= 0) && (b < 8)) { + PropOf(TCB)->pairs[pair] = MapColor(true, f) | MapColor(false, b); + } +} + +static void +drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + short color GCC_UNUSED, + short r GCC_UNUSED, + short g GCC_UNUSED, + short b GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, + short old_pair GCC_UNUSED, + short pair GCC_UNUSED, + bool reverse GCC_UNUSED, + int (*outc) (SCREEN *, int) GCC_UNUSED +) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + sp->_mouse_type = M_TERM_DRIVER; +} + +static int +drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) +{ + int rc = 0; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (sp->_drv_mouse_head < sp->_drv_mouse_tail) { + rc = TW_MOUSE; + } else { + rc = TCBOf(sp)->drv->twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); + } + + return rc; +} + +static int +drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, + int yold GCC_UNUSED, int xold GCC_UNUSED, + int y, int x) +{ + int ret = ERR; + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + COORD loc; + loc.X = (short) x; + loc.Y = (short) y; + SetConsoleCursorPosition(TCB->hdl, loc); + ret = OK; + } + return ret; +} + +static void +drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, + int labnum GCC_UNUSED, + char *text GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, + bool OnFlag GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static chtype +drv_conattr(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ + chtype res = A_NORMAL; + res |= (A_BOLD | A_DIM | A_REVERSE | A_STANDOUT | A_COLOR); + return res; +} + +static void +drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, + chtype *real_map GCC_UNUSED, + chtype *fake_map GCC_UNUSED) +{ +#define DATA(a,b) { a, b } + static struct { + int acs_code; + int use_code; + } table[] = { + DATA('a', 0xb1), /* ACS_CKBOARD */ + DATA('f', 0xf8), /* ACS_DEGREE */ + DATA('g', 0xf1), /* ACS_PLMINUS */ + DATA('j', 0xd9), /* ACS_LRCORNER */ + DATA('l', 0xda), /* ACS_ULCORNER */ + DATA('k', 0xbf), /* ACS_URCORNER */ + DATA('m', 0xc0), /* ACS_LLCORNER */ + DATA('n', 0xc5), /* ACS_PLUS */ + DATA('q', 0xc4), /* ACS_HLINE */ + DATA('t', 0xc3), /* ACS_LTEE */ + DATA('u', 0xb4), /* ACS_RTEE */ + DATA('v', 0xc1), /* ACS_BTEE */ + DATA('w', 0xc2), /* ACS_TTEE */ + DATA('x', 0xb3), /* ACS_VLINE */ + DATA('y', 0xf3), /* ACS_LEQUAL */ + DATA('z', 0xf2), /* ACS_GEQUAL */ + DATA('0', 0xdb), /* ACS_BLOCK */ + DATA('{', 0xe3), /* ACS_PI */ + DATA('}', 0x9c), /* ACS_STERLING */ + DATA(',', 0xae), /* ACS_LARROW */ + DATA('+', 0xaf), /* ACS_RARROW */ + DATA('~', 0xf9), /* ACS_BULLET */ + }; +#undef DATA + unsigned n; + + SCREEN *sp; + AssertTCB(); + SetSP(); + + for (n = 0; n < SIZEOF(table); ++n) { + real_map[table[n].acs_code] = table[n].use_code | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[table[n].acs_code] = TRUE; + } +} + +static ULONGLONG +tdiff(FILETIME fstart, FILETIME fend) +{ + ULARGE_INTEGER ustart; + ULARGE_INTEGER uend; + ULONGLONG diff; + + ustart.LowPart = fstart.dwLowDateTime; + ustart.HighPart = fstart.dwHighDateTime; + uend.LowPart = fend.dwLowDateTime; + uend.HighPart = fend.dwHighDateTime; + + diff = (uend.QuadPart - ustart.QuadPart) / 10000; + return diff; +} + +static int +Adjust(int milliseconds, int diff) +{ + if (milliseconds == INFINITY) + return milliseconds; + milliseconds -= diff; + if (milliseconds < 0) + milliseconds = 0; + return milliseconds; +} + +#define BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | \ + FROM_LEFT_2ND_BUTTON_PRESSED | \ + FROM_LEFT_3RD_BUTTON_PRESSED | \ + FROM_LEFT_4TH_BUTTON_PRESSED | \ + RIGHTMOST_BUTTON_PRESSED) + +static int +decode_mouse(TERMINAL_CONTROL_BLOCK * TCB, int mask) +{ + SCREEN *sp; + int result = 0; + + AssertTCB(); + SetSP(); + + if (mask & FROM_LEFT_1ST_BUTTON_PRESSED) + result |= BUTTON1_PRESSED; + if (mask & FROM_LEFT_2ND_BUTTON_PRESSED) + result |= BUTTON2_PRESSED; + if (mask & FROM_LEFT_3RD_BUTTON_PRESSED) + result |= BUTTON3_PRESSED; + if (mask & FROM_LEFT_4TH_BUTTON_PRESSED) + result |= BUTTON4_PRESSED; + + if (mask & RIGHTMOST_BUTTON_PRESSED) { + switch (TCB->info.numbuttons) { + case 1: + result |= BUTTON1_PRESSED; + break; + case 2: + result |= BUTTON2_PRESSED; + break; + case 3: + result |= BUTTON3_PRESSED; + break; + case 4: + result |= BUTTON4_PRESSED; + break; + } + } + + return result; +} + +static int +drv_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead = 0, rc = -1; + int code = 0; + FILETIME fstart; + FILETIME fend; + int diff; + bool isImmed = (milliseconds == 0); + +#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead) + + AssertTCB(); + SetSP(); + + TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d", + milliseconds, mode)); + + if (milliseconds < 0) + milliseconds = INFINITY; + + memset(&inp_rec, 0, sizeof(inp_rec)); + + while (true) { + GetSystemTimeAsFileTime(&fstart); + rc = WaitForSingleObject(TCB->inp, milliseconds); + GetSystemTimeAsFileTime(&fend); + diff = (int) tdiff(fstart, fend); + milliseconds = Adjust(milliseconds, diff); + + if (!isImmed && milliseconds == 0) + break; + + if (rc == WAIT_OBJECT_0) { + if (mode) { + b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead); + if (b && nRead > 0) { + b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead); + if (b && nRead > 0) { + switch (inp_rec.EventType) { + case KEY_EVENT: + if (mode & TW_INPUT) { + WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar; + + if (inp_rec.Event.KeyEvent.bKeyDown) { + if (0 == ch) { + int nKey = MapKey(TCB, vk); + if ((nKey < 0) || FALSE == sp->_keypad_on) { + CONSUME(); + continue; + } + } + code = TW_INPUT; + goto end; + } else { + CONSUME(); + } + } + continue; + case MOUSE_EVENT: + if (decode_mouse(TCB, + (inp_rec.Event.MouseEvent.dwButtonState + & BUTTON_MASK)) == 0) { + CONSUME(); + } else if (mode & TW_MOUSE) { + code = TW_MOUSE; + goto end; + } + continue; + default: + SetConsoleActiveScreenBuffer(!PropOf(TCB)->progMode ? + TCB->hdl : TCB->out); + continue; + } + } + } + } + continue; + } else { + if (rc != WAIT_TIMEOUT) { + code = -1; + break; + } else { + code = 0; + break; + } + } + } + end: + + TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec", + code, errno, milliseconds)); + + if (timeleft) + *timeleft = milliseconds; + + return code; +} + +static bool +handle_mouse(TERMINAL_CONTROL_BLOCK * TCB, MOUSE_EVENT_RECORD mer) +{ + SCREEN *sp; + MEVENT work; + bool result = FALSE; + + AssertTCB(); + SetSP(); + + sp->_drv_mouse_old_buttons = sp->_drv_mouse_new_buttons; + sp->_drv_mouse_new_buttons = mer.dwButtonState & BUTTON_MASK; + + /* + * We're only interested if the button is pressed or released. + * FIXME: implement continuous event-tracking. + */ + if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) { + + memset(&work, 0, sizeof(work)); + + if (sp->_drv_mouse_new_buttons) { + + work.bstate |= decode_mouse(TCB, sp->_drv_mouse_new_buttons); + + } else { + + /* cf: BUTTON_PRESSED, BUTTON_RELEASED */ + work.bstate |= (decode_mouse(TCB, sp->_drv_mouse_old_buttons) >> 1); + + result = TRUE; + } + + work.x = mer.dwMousePosition.X; + work.y = mer.dwMousePosition.Y; + + sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work; + sp->_drv_mouse_tail += 1; + } + + return result; +} + +static int +drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + int n = 1; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead; + WORD vk; + WORD sc; + + AssertTCB(); + assert(buf); + SetSP(); + + memset(&inp_rec, 0, sizeof(inp_rec)); + + T((T_CALLED("win32con::drv_read(%p)"), TCB)); + while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) { + if (b && nRead > 0) { + if (inp_rec.EventType == KEY_EVENT) { + if (!inp_rec.Event.KeyEvent.bKeyDown) + continue; + *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar; + vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + sc = inp_rec.Event.KeyEvent.wVirtualScanCode; + if (*buf == 0) { + if (sp->_keypad_on) { + *buf = MapKey(TCB, vk); + if (0 > (*buf)) + continue; + else + break; + } else + continue; + } else { /* *buf != 0 */ + break; + } + } else if (inp_rec.EventType == MOUSE_EVENT) { + if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) { + *buf = KEY_MOUSE; + break; + } + } + continue; + } + } + returnCode(n); +} + +static int +drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ + Sleep(ms); + return OK; +} + +static bool +drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int keycode) +{ + SCREEN *sp; + WORD nKey; + void *res; + bool found = FALSE; + LONG key = GenMap(0, (WORD) keycode); + + AssertTCB(); + SetSP(); + + AssertTCB(); + + res = bsearch(&key, + PropOf(TCB)->rmap, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + rkeycompare); + if (res) { + key = *((LONG *) res); + nKey = LOWORD(key); + if (!(nKey & 0x8000)) + found = TRUE; + } + return found; +} + +static int +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + if (sp) { + code = OK; + } + return code; +} + +static int +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, bool flag) +{ + int code = ERR; + SCREEN *sp; + WORD nKey; + WORD vKey; + void *res; + LONG key = GenMap(0, (WORD) keycode); + + AssertTCB(); + SetSP(); + + if (sp) { + res = bsearch(&key, + PropOf(TCB)->rmap, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + rkeycompare); + if (res) { + key = *((LONG *) res); + vKey = HIWORD(key); + nKey = (LOWORD(key)) & 0x7fff; + if (!flag) + nKey |= 0x8000; + *(LONG *) res = GenMap(vKey, nKey); + } + } + return code; +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_WIN_DRIVER = { + FALSE, + drv_CanHandle, /* CanHandle */ + drv_init, /* init */ + drv_release, /* release */ + drv_size, /* size */ + drv_sgmode, /* sgmode */ + drv_conattr, /* conattr */ + drv_mvcur, /* hwcur */ + drv_mode, /* mode */ + drv_rescol, /* rescol */ + drv_rescolors, /* rescolors */ + drv_setcolor, /* color */ + drv_dobeepflash, /* DoBeepFlash */ + drv_initpair, /* initpair */ + drv_initcolor, /* initcolor */ + drv_do_color, /* docolor */ + drv_initmouse, /* initmouse */ + drv_testmouse, /* testmouse */ + drv_setfilter, /* setfilter */ + drv_hwlabel, /* hwlabel */ + drv_hwlabelOnOff, /* hwlabelOnOff */ + drv_doupdate, /* update */ + drv_defaultcolors, /* defaultcolors */ + drv_print, /* print */ + drv_size, /* getsize */ + drv_setsize, /* setsize */ + drv_initacs, /* initacs */ + drv_screen_init, /* scinit */ + drv_wrap, /* scexit */ + drv_twait, /* twait */ + drv_read, /* read */ + drv_nap, /* nap */ + drv_kpad, /* kpad */ + drv_keyok, /* kyOk */ + drv_kyExist /* kyExist */ +}; diff --git a/panel/Makefile.in b/panel/Makefile.in index 89dbeeac900..f0f0a4922bd 100644 --- a/panel/Makefile.in +++ b/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $ +# $Id: Makefile.in,v 1.58 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ @@ -64,6 +65,7 @@ LIBTOOL_COMPILE = @LIB_COMPILE@ LIBTOOL_LINK = @LIB_LINK@ LIBTOOL_INSTALL = @LIB_INSTALL@ LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ +LT_UNDEF = @LT_UNDEF@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ @@ -71,11 +73,14 @@ INSTALL_PROG = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ -AR_OPTS = @AR_OPTS@ +ARFLAGS = @ARFLAGS@ AWK = @AWK@ LD = @LD@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -125,7 +130,7 @@ sources: $(AUTO_SRC) $(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - sh $(srcdir)/../mkdirs.sh $@ + mkdir -p $@ # make a copy to simplify include-paths while still keeping panel's include # file in this directory. @@ -133,15 +138,15 @@ $(DESTDIR)$(libdir) : -rm -f $@ cp $(srcdir)/panel.h $@ -PANEL_PRIV_H = \ +HEADER_DEPS = \ $(srcdir)/panel.priv.h \ $(srcdir)/panel.h tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace diff --git a/panel/llib-lpanel b/panel/llib-lpanel index de49c234eca..85371ec73e0 100644 --- a/panel/llib-lpanel +++ b/panel/llib-lpanel @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997,2002,2005 * + * Author: Thomas E. Dickey 1997,2005,2010 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include "panel.priv.h" +#include #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,6 +77,11 @@ void _nc_Touchline( /* ./p_above.c */ +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -84,6 +89,11 @@ PANEL *panel_above( /* ./p_below.c */ +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -157,6 +167,11 @@ int top_panel( /* ./p_update.c */ +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + #undef update_panels void update_panels(void) { /* void */ } diff --git a/panel/llib-lpanelt b/panel/llib-lpanelt new file mode 100644 index 00000000000..8fcd42c9b6d --- /dev/null +++ b/panel/llib-lpanelt @@ -0,0 +1,197 @@ +/**************************************************************************** + * Copyright (c) 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"), 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 2010 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include + +#undef _nc_retrace_panel +PANEL *_nc_retrace_panel( + PANEL *pan) + { return(*(PANEL **)0); } + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/panel/llib-lpaneltw b/panel/llib-lpaneltw new file mode 100644 index 00000000000..1d3cd8d84c8 --- /dev/null +++ b/panel/llib-lpaneltw @@ -0,0 +1,197 @@ +/**************************************************************************** + * Copyright (c) 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"), 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 2010 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include + +#undef _nc_retrace_panel +PANEL *_nc_retrace_panel( + PANEL *pan) + { return(*(PANEL **)0); } + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/panel/llib-lpanelw b/panel/llib-lpanelw index 48bd1e0db5a..503b34345ba 100644 --- a/panel/llib-lpanelw +++ b/panel/llib-lpanelw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 2002-2005,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 * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2002,2005 * + * Author: Thomas E. Dickey 2002-2005,2010 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include "panel.priv.h" +#include #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,6 +77,11 @@ void _nc_Touchline( /* ./p_above.c */ +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -84,6 +89,11 @@ PANEL *panel_above( /* ./p_below.c */ +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -157,6 +167,11 @@ int top_panel( /* ./p_update.c */ +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + #undef update_panels void update_panels(void) { /* void */ } diff --git a/panel/modules b/panel/modules index d0f7a796678..cd3f545630f 100644 --- a/panel/modules +++ b/panel/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.9 2006/12/24 00:53:17 tom Exp $ +# $Id: modules,v 1.10 2010/01/23 16:31:16 tom Exp $ ############################################################################## -# Copyright (c) 1998,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-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"), # @@ -32,20 +32,20 @@ @ base # Library objects -panel lib $(srcdir) $(PANEL_PRIV_H) -p_above lib $(srcdir) $(PANEL_PRIV_H) -p_below lib $(srcdir) $(PANEL_PRIV_H) -p_bottom lib $(srcdir) $(PANEL_PRIV_H) -p_delete lib $(srcdir) $(PANEL_PRIV_H) -p_hide lib $(srcdir) $(PANEL_PRIV_H) -p_hidden lib $(srcdir) $(PANEL_PRIV_H) -p_move lib $(srcdir) $(PANEL_PRIV_H) -p_new lib $(srcdir) $(PANEL_PRIV_H) -p_replace lib $(srcdir) $(PANEL_PRIV_H) -p_show lib $(srcdir) $(PANEL_PRIV_H) -p_top lib $(srcdir) $(PANEL_PRIV_H) -p_update lib $(srcdir) $(PANEL_PRIV_H) -p_user lib $(srcdir) $(PANEL_PRIV_H) -p_win lib $(srcdir) $(PANEL_PRIV_H) +panel lib $(srcdir) $(HEADER_DEPS) +p_above lib $(srcdir) $(HEADER_DEPS) +p_below lib $(srcdir) $(HEADER_DEPS) +p_bottom lib $(srcdir) $(HEADER_DEPS) +p_delete lib $(srcdir) $(HEADER_DEPS) +p_hide lib $(srcdir) $(HEADER_DEPS) +p_hidden lib $(srcdir) $(HEADER_DEPS) +p_move lib $(srcdir) $(HEADER_DEPS) +p_new lib $(srcdir) $(HEADER_DEPS) +p_replace lib $(srcdir) $(HEADER_DEPS) +p_show lib $(srcdir) $(HEADER_DEPS) +p_top lib $(srcdir) $(HEADER_DEPS) +p_update lib $(srcdir) $(HEADER_DEPS) +p_user lib $(srcdir) $(HEADER_DEPS) +p_win lib $(srcdir) $(HEADER_DEPS) # vile:makemode diff --git a/panel/p_above.c b/panel/p_above.c index 32495f627f2..8bbf1bc21ce 100644 --- a/panel/p_above.c +++ b/panel/p_above.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,24 +29,56 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_above.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $") +MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $") + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(PANEL *) +ground_panel(SCREEN * sp) +{ + T((T_CALLED("ground_panel(%p)"), sp)); + if (sp) + { + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + + if (_nc_bottom_panel) /* this is the pseudo panel */ + returnPanel(_nc_bottom_panel->above); + else + returnPanel(0); + } + else + { + if (0 == CURRENT_SCREEN) + returnPanel(0); + else + returnPanel(ground_panel(CURRENT_SCREEN)); + } +} +#endif NCURSES_EXPORT(PANEL *) panel_above(const PANEL * pan) { - T((T_CALLED("panel_above(%p)"), pan)); - if (!pan) + PANEL *result; + + T((T_CALLED("panel_above(%p)"), (const void *)pan)); + if (pan) + result = pan->above; + else { +#if NCURSES_SP_FUNCS + result = ground_panel(CURRENT_SCREEN); +#else /* if top and bottom are equal, we have no or only the pseudo panel; if not, we return the panel above the pseudo panel */ - returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above); + result = EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above; +#endif } - else - returnPanel(pan->above); + returnPanel(result); } diff --git a/panel/p_below.c b/panel/p_below.c index c4b241015f5..f276ef959da 100644 --- a/panel/p_below.c +++ b/panel/p_below.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,26 +29,57 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_below.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $") +MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $") +#if NCURSES_SP_FUNCS NCURSES_EXPORT(PANEL *) -panel_below(const PANEL * pan) +ceiling_panel(SCREEN * sp) { - T((T_CALLED("panel_below(%p)"), pan)); - if (!pan) + T((T_CALLED("ceiling_panel(%p)"), sp)); + if (sp) { + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + /* if top and bottom are equal, we have no or only the pseudo panel */ returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel); } else { - /* we must not return the pseudo panel */ - returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below); + if (0 == CURRENT_SCREEN) + returnPanel(0); + else + returnPanel(ceiling_panel(CURRENT_SCREEN)); } } +#endif + +NCURSES_EXPORT(PANEL *) +panel_below(const PANEL * pan) +{ + PANEL *result; + + T((T_CALLED("panel_below(%p)"), (const void *)pan)); + if (pan) + { + GetHook(pan); + /* we must not return the pseudo panel */ + result = Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below; + } + else + { +#if NCURSES_SP_FUNCS + result = ceiling_panel(CURRENT_SCREEN); +#else + /* if top and bottom are equal, we have no or only the pseudo panel */ + result = EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel; +#endif + } + returnPanel(result); +} diff --git a/panel/p_bottom.c b/panel/p_bottom.c index b861fd9b2ce..db814415375 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_bottom.c @@ -36,16 +37,17 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.13 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) bottom_panel(PANEL * pan) { int err = OK; - T((T_CALLED("bottom_panel(%p)"), pan)); + T((T_CALLED("bottom_panel(%p)"), (void *)pan)); if (pan) { + GetHook(pan); if (!Is_Bottom(pan)) { diff --git a/panel/p_delete.c b/panel/p_delete.c index 24ee26b4ff2..39b055377c1 100644 --- a/panel/p_delete.c +++ b/panel/p_delete.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1999,2008 * ****************************************************************************/ /* p_delete.c @@ -36,19 +37,22 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $") +MODULE_ID("$Id: p_delete.c,v 1.10 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) del_panel(PANEL * pan) { int err = OK; - T((T_CALLED("del_panel(%p)"), pan)); + T((T_CALLED("del_panel(%p)"), (void *)pan)); if (pan) { dBug(("--> del_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); - free((void *)pan); + { + GetHook(pan); + HIDE_PANEL(pan, err, OK); + free((void *)pan); + } } else err = ERR; diff --git a/panel/p_hidden.c b/panel/p_hidden.c index 624c07dae0b..01b69b91d91 100644 --- a/panel/p_hidden.c +++ b/panel/p_hidden.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_hidden.c @@ -36,13 +37,18 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.9 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(int) panel_hidden(const PANEL * pan) { - T((T_CALLED("panel_hidden(%p)"), pan)); - if (!pan) - returnCode(ERR); - returnCode(IS_LINKED(pan) ? FALSE : TRUE); + int rc = ERR; + + T((T_CALLED("panel_hidden(%p)"), (const void *)pan)); + if (pan) + { + GetHook(pan); + rc = (IS_LINKED(pan) ? FALSE : TRUE); + } + returnCode(rc); } diff --git a/panel/p_hide.c b/panel/p_hide.c index 08d8853a201..7b780d464e1 100644 --- a/panel/p_hide.c +++ b/panel/p_hide.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,23 +36,27 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $") +MODULE_ID("$Id: p_hide.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) hide_panel(register PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("hide_panel(%p)"), pan)); - if (!pan) - returnCode(ERR); + T((T_CALLED("hide_panel(%p)"), (void *)pan)); - dBug(("--> hide_panel %s", USER_PTR(pan->user))); - dStack("", 1, pan); + if (pan) + { + GetHook(pan); - HIDE_PANEL(pan, err, ERR); + dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dStack("", 1, pan); - dStack("", 9, pan); + HIDE_PANEL(pan, err, ERR); + err = OK; + + dStack("", 9, pan); + } returnCode(err); } diff --git a/panel/p_move.c b/panel/p_move.c index 3818e8cba86..adae6458322 100644 --- a/panel/p_move.c +++ b/panel/p_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2009 * ****************************************************************************/ /* p_move.c @@ -36,21 +37,24 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $") +MODULE_ID("$Id: p_move.c,v 1.11 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(int) move_panel(PANEL * pan, int starty, int startx) { - T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx)); + int rc = ERR; - if (!pan) - returnCode(ERR); + T((T_CALLED("move_panel(%p,%d,%d)"), (void *)pan, starty, startx)); - if (IS_LINKED(pan)) + if (pan) { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); + GetHook(pan); + if (IS_LINKED(pan)) + { + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); + } + rc = mvwin(pan->win, starty, startx); } - - returnCode(mvwin(pan->win, starty, startx)); + returnCode(rc); } diff --git a/panel/p_new.c b/panel/p_new.c index 2719316888e..235336c22f5 100644 --- a/panel/p_new.c +++ b/panel/p_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -38,7 +38,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.10 2008/08/04 18:25:48 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.16 2010/01/23 21:22:16 tom Exp $") #ifdef TRACE static char *stdscr_id; @@ -50,20 +50,27 @@ static char *new_id; Establish the pseudo panel for stdscr if necessary. --------------------------------------------------------------------------*/ static PANEL * -root_panel(void) +root_panel(NCURSES_SP_DCL0) { +#if NCURSES_SP_FUNCS + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + +#elif NO_LEAKS + struct panelhook *ph = _nc_panelhook(); +#endif + if (_nc_stdscr_pseudo_panel == (PANEL *) 0) { - assert(stdscr && !_nc_bottom_panel && !_nc_top_panel); + assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel); #if NO_LEAKS - _nc_panelhook()->destroy = del_panel; + ph->destroy = del_panel; #endif - _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL)); + _nc_stdscr_pseudo_panel = typeMalloc(PANEL, 1); if (_nc_stdscr_pseudo_panel != 0) { PANEL *pan = _nc_stdscr_pseudo_panel; - WINDOW *win = stdscr; + WINDOW *win = SP_PARM->_stdscr; pan->win = win; pan->below = (PANEL *) 0; @@ -86,16 +93,18 @@ new_panel(WINDOW *win) { PANEL *pan = (PANEL *) 0; - T((T_CALLED("new_panel(%p)"), win)); + GetWindowHook(win); + + T((T_CALLED("new_panel(%p)"), (void *)win)); if (!win) returnPanel(pan); if (!_nc_stdscr_pseudo_panel) - (void)root_panel(); + (void)root_panel(NCURSES_SP_ARG); assert(_nc_stdscr_pseudo_panel); - if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL)))) + if (!(win->_flags & _ISPAD) && (pan = typeMalloc(PANEL, 1))) { pan->win = win; pan->above = (PANEL *) 0; diff --git a/panel/p_replace.c b/panel/p_replace.c index 5d0d295c8b1..d3733ed22e2 100644 --- a/panel/p_replace.c +++ b/panel/p_replace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,23 +36,25 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $") +MODULE_ID("$Id: p_replace.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) replace_panel(PANEL * pan, WINDOW *win) { - T((T_CALLED("replace_panel(%p,%p)"), pan, win)); + int rc = ERR; - if (!pan) - returnCode(ERR); + T((T_CALLED("replace_panel(%p,%p)"), (void *)pan, (void *)win)); - if (IS_LINKED(pan)) + if (pan) { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); + GetHook(pan); + if (IS_LINKED(pan)) + { + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); + } + pan->win = win; + rc = OK; } - - pan->win = win; - - returnCode(OK); + returnCode(rc); } diff --git a/panel/p_show.c b/panel/p_show.c index 35eee237b95..d5b09bd9426 100644 --- a/panel/p_show.c +++ b/panel/p_show.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,34 +36,37 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.13 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) show_panel(PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("show_panel(%p)"), pan)); + T((T_CALLED("show_panel(%p)"), (void *)pan)); - if (!pan) - returnCode(ERR); + if (pan) + { + GetHook(pan); - if (Is_Top(pan)) - returnCode(OK); + if (Is_Top(pan)) + returnCode(OK); - dBug(("--> show_panel %s", USER_PTR(pan->user))); + dBug(("--> show_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); + HIDE_PANEL(pan, err, OK); - dStack("", 1, pan); - assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + dStack("", 1, pan); + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); - _nc_top_panel->above = pan; - pan->below = _nc_top_panel; - pan->above = (PANEL *) 0; - _nc_top_panel = pan; + _nc_top_panel->above = pan; + pan->below = _nc_top_panel; + pan->above = (PANEL *) 0; + _nc_top_panel = pan; - dStack("", 9, pan); + err = OK; - returnCode(OK); + dStack("", 9, pan); + } + returnCode(err); } diff --git a/panel/p_top.c b/panel/p_top.c index 8bd1d9fb3fe..fdcdee9afcd 100644 --- a/panel/p_top.c +++ b/panel/p_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_top.c,v 1.5 2005/02/19 16:42:23 tom Exp $") +MODULE_ID("$Id: p_top.c,v 1.6 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) top_panel(PANEL * pan) { - T((T_CALLED("top_panel(%p)"), pan)); + T((T_CALLED("top_panel(%p)"), (void *)pan)); returnCode(show_panel(pan)); } diff --git a/panel/p_update.c b/panel/p_update.c index 5967718160f..a2f45063cf5 100644 --- a/panel/p_update.c +++ b/panel/p_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_update.c @@ -36,28 +37,42 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $") +MODULE_ID("$Id: p_update.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(void) -update_panels(void) +NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) { PANEL *pan; - T((T_CALLED("update_panels()"))); + T((T_CALLED("update_panels(%p)"), (void *)SP_PARM)); dBug(("--> update_panels")); - pan = _nc_bottom_panel; - while (pan && pan->above) - { - PANEL_UPDATE(pan, pan->above); - pan = pan->above; - } - pan = _nc_bottom_panel; - while (pan) + if (SP_PARM) { - Wnoutrefresh(pan); - pan = pan->above; + GetScreenHook(SP_PARM); + + pan = _nc_bottom_panel; + while (pan && pan->above) + { + PANEL_UPDATE(pan, pan->above); + pan = pan->above; + } + + pan = _nc_bottom_panel; + while (pan) + { + Wnoutrefresh(pan); + pan = pan->above; + } } returnVoid; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +update_panels(void) +{ + NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); +} +#endif diff --git a/panel/p_user.c b/panel/p_user.c index ffa25f85ae1..deb5bdf7e4c 100644 --- a/panel/p_user.c +++ b/panel/p_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,12 +36,12 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_user.c,v 1.6 2005/02/19 16:52:44 tom Exp $") +MODULE_ID("$Id: p_user.c,v 1.8 2010/01/23 23:18:35 tom Exp $") NCURSES_EXPORT(int) set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) { - T((T_CALLED("set_panel_userptr(%p,%p)"), pan, uptr)); + T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); if (!pan) returnCode(ERR); pan->user = uptr; @@ -51,6 +51,6 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) NCURSES_EXPORT(NCURSES_CONST void *) panel_userptr(const PANEL * pan) { - T((T_CALLED("panel_userptr(%p)"), pan)); + T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); returnCVoidPtr(pan ? pan->user : (NCURSES_CONST void *)0); } diff --git a/panel/p_win.c b/panel/p_win.c index e7d2cea8e3f..6643d5c2671 100644 --- a/panel/p_win.c +++ b/panel/p_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,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 * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_win.c,v 1.5 2005/02/19 16:44:16 tom Exp $") +MODULE_ID("$Id: p_win.c,v 1.6 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(WINDOW *) panel_window(const PANEL * pan) { - T((T_CALLED("panel_window(%p)"), pan)); + T((T_CALLED("panel_window(%p)"), (const void *)pan)); returnWin(pan ? pan->win : (WINDOW *)0); } diff --git a/panel/panel.c b/panel/panel.c index 16a8083d64b..96cbbab7740 100644 --- a/panel/panel.c +++ b/panel/panel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -29,12 +29,14 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1996-1999,2008 * + * and: Thomas E. Dickey * ****************************************************************************/ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") +MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $") /*+------------------------------------------------------------------------- _nc_retrace_panel (pan) @@ -43,7 +45,7 @@ MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") NCURSES_EXPORT(PANEL *) _nc_retrace_panel(PANEL * pan) { - T((T_RETURN("%p"), pan)); + T((T_RETURN("%p"), (void *)pan)); return pan; } #endif @@ -91,6 +93,8 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) { char s80[80]; + GetPanelHook(pan); + sprintf(s80, fmt, num, pan); _tracef("%s b=%s t=%s", s80, (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--", diff --git a/panel/panel.h b/panel/panel.h index 1e02091d97f..6ed2061d1ff 100644 --- a/panel/panel.h +++ b/panel/panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,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 * @@ -29,9 +29,10 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1996-1999,2008 * ****************************************************************************/ -/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */ +/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */ /* panel.h -- interface file for panels library */ @@ -68,6 +69,13 @@ extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); +extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); + +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); +#endif + #if defined(__cplusplus) } #endif diff --git a/panel/panel.priv.h b/panel/panel.priv.h index 4fb8144e1b7..ce4f98937fc 100644 --- a/panel/panel.priv.h +++ b/panel/panel.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-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 +26,7 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */ +/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 @@ -39,9 +39,11 @@ #include #include -#include "curses.priv.h" +struct screen; /* forward declaration */ + +#include "curses.priv.h" /* includes nc_panel.h */ #include "panel.h" -#include + #if USE_RCS_IDS # define MODULE_ID(id) static const char Ident[] = id; @@ -83,14 +85,38 @@ # define Touchline(pan,start,count) touchline((pan)->win,start,count) #endif -#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel -#define _nc_top_panel _nc_panelhook()->top_panel -#define _nc_bottom_panel _nc_panelhook()->bottom_panel +#if NCURSES_SP_FUNCS +#define GetScreenHook(sp) \ + struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp) +#define GetPanelHook(pan) \ + GetScreenHook(_nc_screen_of((pan)->win)) +#define GetWindowHook(win) \ + SCREEN* sp = _nc_screen_of(win); \ + GetScreenHook(sp) +#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); \ + GetScreenHook(sp) -#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel) -#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p))) -#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) -#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) +#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel) +#define _nc_top_panel ((ph)->top_panel) +#define _nc_bottom_panel ((ph)->bottom_panel) + +#else /* !NCURSES_SP_FUNCS */ + +#define GetScreenHook(sp) /* nothing */ +#define GetPanelHook(pan) /* nothing */ +#define GetWindowHook(win) /* nothing */ +#define GetHook(pan) /* nothing */ + +#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel +#define _nc_top_panel _nc_panelhook()->top_panel +#define _nc_bottom_panel _nc_panelhook()->bottom_panel + +#endif /* NCURSES_SP_FUNCS */ + +#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel) +#define Is_Bottom(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p))) +#define Is_Top(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p))) +#define Is_Pseudo(p) (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel)) /*+------------------------------------------------------------------------- IS_LINKED(pan) - check to see if panel is in the stack @@ -122,7 +148,7 @@ ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\ iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\ iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\ - assert((ix1<=ix2) && (iy1<=iy2));\ + assert((ix1<=ix2) && (iy1<=iy2)) /*+------------------------------------------------------------------------- @@ -136,12 +162,12 @@ { PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\ while(pan2) {\ if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\ - int y,ix1,ix2,iy1,iy2;\ - COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\ + int y, ix1, ix2, iy1, iy2;\ + COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\ for(y = iy1; y <= iy2; y++) {\ if (is_linetouched(pan->win,y - PSTARTY(pan))) {\ struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\ - CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\ + CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\ }\ }\ }\ @@ -180,4 +206,9 @@ err = err_if_unlinked;\ } +#if NCURSES_SP_FUNCS +/* These may become later renamed and part of panel.h and the public API */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); +#endif + #endif /* NCURSES_PANEL_PRIV_H */ diff --git a/progs/Makefile.in b/progs/Makefile.in index 886fd5be246..bdb8a0f0489 100644 --- a/progs/Makefile.in +++ b/progs/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $ +# $Id: Makefile.in,v 1.85 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile CF_MFLAGS = @cf_cv_makeflags@ @@ -76,6 +77,9 @@ transform = @program_transform_name@ AWK = @AWK@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -124,7 +128,7 @@ AUTO_SRC = \ transform.h # tic relies on direct access to the terminfo database -GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x +GET_PROGS = infocmp$x clear$x tabs$x tput$x tset$x toe$x PUT_PROGS = @MAKE_TERMINFO@ tic$x PROGS = $(PUT_PROGS) $(GET_PROGS) @@ -159,6 +163,7 @@ actual_infocmp = `echo infocmp$x| $(TRANSFORM)` actual_infotocap = `echo infotocap$x| $(TRANSFORM)` actual_init = `echo init$x| $(TRANSFORM)` actual_reset = `echo reset$x| $(TRANSFORM)` +actual_tabs = `echo tabs$x| $(TRANSFORM)` actual_tic = `echo tic$x| $(TRANSFORM)` actual_toe = `echo toe$x| $(TRANSFORM)` actual_tput = `echo tput$x| $(TRANSFORM)` @@ -171,10 +176,16 @@ define_init = `echo init| $(TRANSFORM)` define_reset = `echo reset| $(TRANSFORM)` transform.h : - echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@ - echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ - echo "#define PROG_RESET \"$(define_reset)\"" >>$@ - echo "#define PROG_INIT \"$(define_init)\"" >>$@ + echo "#ifndef __TRANSFORM_H" >$@ + echo "#define __TRANSFORM_H 1" >>$@ + echo "#include " >>$@ + echo "extern bool same_program(const char *, const char *);" >>$@ + -sh -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi' + echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >>$@ + echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ + echo "#define PROG_RESET \"$(define_reset)\"" >>$@ + echo "#define PROG_INIT \"$(define_init)\"" >>$@ + echo "#endif /* __TRANSFORM_H */" >>$@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ $(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x $(DESTDIR)$(bindir)/$(actual_tic) @@ -187,6 +198,7 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) $(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp) $(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x $(DESTDIR)$(bindir)/$(actual_clear) + $(LIBTOOL_INSTALL) $(INSTALL_PROG) tabs$x $(DESTDIR)$(bindir)/$(actual_tabs) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x $(DESTDIR)$(bindir)/$(actual_tput) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x $(DESTDIR)$(bindir)/$(actual_tset) @echo "linking $(actual_reset) to $(actual_tset)" @@ -200,12 +212,13 @@ uninstall.progs: @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear) + -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tabs) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset) -@rm -f $(DESTDIR)$(bindir)/$(actual_reset) $(DESTDIR)$(bindir) : - sh $(srcdir)/../mkdirs.sh $@ + mkdir -p $@ # # Utilities normally built by make all start here @@ -213,7 +226,8 @@ $(DESTDIR)$(bindir) : DEPS_TIC = \ $(MODEL)/tic$o \ - $(MODEL)/dump_entry$o + $(MODEL)/dump_entry$o \ + $(MODEL)/transform$o tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@ @@ -230,8 +244,15 @@ DEPS_CLEAR = \ clear$x: $(DEPS_CLEAR) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@ +DEPS_TABS = \ + $(MODEL)/tabs$o + +tabs$x: $(DEPS_TABS) $(DEPS_TABS) + @ECHO_LINK@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@ + DEPS_TPUT = \ - $(MODEL)/tput$o + $(MODEL)/tput$o \ + $(MODEL)/transform$o tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@ @@ -244,7 +265,8 @@ infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@ DEPS_TSET = \ - $(MODEL)/tset$o + $(MODEL)/tset$o \ + $(MODEL)/transform$o tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@ @@ -257,10 +279,10 @@ termsort.c: $(srcdir)/MKtermsort.sh # tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace @@ -289,6 +311,7 @@ lint: @MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tabs.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS) diff --git a/progs/dump_entry.c b/progs/dump_entry.c index bd2422008bf..485bbbd91d6 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.88 2008/08/04 12:36:12 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.89 2010/05/01 22:04:08 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -1040,7 +1040,7 @@ dump_entry(TERMTYPE *tterm, save_sgr = set_attributes; - if (((len = FMT_ENTRY()) > critlen) + if ((FMT_ENTRY() > critlen) && limited) { save_tterm = *tterm; @@ -1049,7 +1049,7 @@ dump_entry(TERMTYPE *tterm, critlen); suppress_untranslatable = TRUE; } - if ((len = FMT_ENTRY()) > critlen) { + if (FMT_ENTRY() > critlen) { /* * We pick on sgr because it's a nice long string capability that * is really just an optimization hack. Another good candidate is @@ -1075,7 +1075,7 @@ dump_entry(TERMTYPE *tterm, critlen); } changed = TRUE; - if ((len = FMT_ENTRY()) <= critlen) + if (FMT_ENTRY() <= critlen) break; } } @@ -1086,7 +1086,7 @@ dump_entry(TERMTYPE *tterm, critlen); changed = TRUE; } - if (!changed || ((len = FMT_ENTRY()) > critlen)) { + if (!changed || (FMT_ENTRY() > critlen)) { if (purged_acs(tterm)) { acs_chars = ABSENT_STRING; SHOW_WHY("# (acsc removed to fit entry within %d bytes)\n", @@ -1094,7 +1094,7 @@ dump_entry(TERMTYPE *tterm, changed = TRUE; } } - if (!changed || ((len = FMT_ENTRY()) > critlen)) { + if (!changed || (FMT_ENTRY() > critlen)) { int oldversion = tversion; tversion = V_BSD; @@ -1130,7 +1130,7 @@ dump_entry(TERMTYPE *tterm, } else if (!version_filter(STRING, STR_IDX(acs_chars))) { save_tterm = *tterm; if (purged_acs(tterm)) { - len = FMT_ENTRY(); + (void) FMT_ENTRY(); } *tterm = save_tterm; } diff --git a/progs/infocmp.c b/progs/infocmp.c index 84989ffc63d..2af9cb50b1d 100644 --- a/progs/infocmp.c +++ b/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.103 2008/08/16 22:04:56 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.105 2010/05/01 22:04:08 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -894,8 +894,6 @@ file_comparison(int argc, char *argv[]) (void) printf("The following entries are equivalent:\n"); for (qp = heads[0]; qp; qp = qp->next) { - rp = qp->crosslinks[0]; - if (qp->ncrosslinks == 1) { rp = qp->crosslinks[0]; @@ -1255,6 +1253,15 @@ terminal_env(void) * ***************************************************************************/ +#if NO_LEAKS +#define MAIN_LEAKS() \ + free(myargv); \ + free(tfile); \ + free(tname) +#else +#define MAIN_LEAKS() /* nothing */ +#endif + int main(int argc, char *argv[]) { @@ -1514,6 +1521,7 @@ main(int argc, char *argv[]) #else (void) fprintf(stderr, "%s: terminfo files not supported\n", _nc_progname); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); #endif } else { @@ -1526,7 +1534,6 @@ main(int argc, char *argv[]) status = _nc_read_entry(tname[termcount], tfile[termcount], &entries[termcount].tterm); - directory = TERMINFO; /* for error message */ } if (status <= 0) { @@ -1534,6 +1541,7 @@ main(int argc, char *argv[]) "%s: couldn't open terminfo file %s.\n", _nc_progname, tfile[termcount]); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); } repair_acsc(&entries[termcount].tterm); @@ -1642,11 +1650,7 @@ main(int argc, char *argv[]) else file_comparison(argc - optind, argv + optind); -#if NO_LEAKS - free(myargv); - free(tfile); - free(tname); -#endif + MAIN_LEAKS(); ExitProgram(EXIT_SUCCESS); } diff --git a/progs/modules b/progs/modules index 3b4f3b60236..55d7a9fb969 100644 --- a/progs/modules +++ b/progs/modules @@ -1,7 +1,7 @@ -# $Id: modules,v 1.13 2006/12/24 00:53:21 tom Exp $ +# $Id: modules,v 1.17 2010/01/23 17:47:23 tom Exp $ # Program modules (some are in ncurses lib!) ############################################################################## -# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,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"), # @@ -34,10 +34,12 @@ @ base clear progs $(srcdir) $(HEADER_DEPS) tic progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h -toe progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h +toe progs $(srcdir) $(HEADER_DEPS) $(INCDIR)/hashed_db.h dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c infocmp progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h -tput progs $(srcdir) $(HEADER_DEPS) transform.h termsort.c +tabs progs $(srcdir) $(HEADER_DEPS) +tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h termsort.c tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h +transform progs $(srcdir) $(HEADER_DEPS) transform.h # vile:makemode diff --git a/progs/tabs.c b/progs/tabs.c new file mode 100644 index 00000000000..b59c9086d8d --- /dev/null +++ b/progs/tabs.c @@ -0,0 +1,510 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,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"), 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 2008 * + ****************************************************************************/ + +/* + * tabs.c -- set terminal hard-tabstops + */ + +#define USE_LIBTINFO +#include + +MODULE_ID("$Id: tabs.c,v 1.19 2010/10/23 22:26:01 tom Exp $") + +static void usage(void) GCC_NORETURN; + +static int max_cols; + +static int +putch(int c) +{ + return putchar(c); +} + +static void +do_tabs(int *tab_list) +{ + int last = 1; + int stop; + + putchar('\r'); + while ((stop = *tab_list++) > 0) { + if (last < stop) { + while (last++ < stop) { + if (last > max_cols) + break; + putchar(' '); + } + } + if (stop <= max_cols) { + tputs(tparm(set_tab, stop), 1, putch); + last = stop; + } else { + break; + } + } + putchar('\n'); +} + +static int * +decode_tabs(const char *tab_list) +{ + int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols); + int n = 0; + int value = 0; + int prior = 0; + int ch; + + if (result != 0) { + while ((ch = *tab_list++) != '\0') { + if (isdigit(UChar(ch))) { + value *= 10; + value += (ch - '0'); + } else if (ch == ',') { + result[n] = value + prior; + if (n > 0 && result[n] <= result[n - 1]) { + fprintf(stderr, + "tab-stops are not in increasing order: %d %d\n", + value, result[n - 1]); + free(result); + result = 0; + break; + } + ++n; + value = 0; + prior = 0; + } else if (ch == '+') { + if (n) + prior = result[n - 1]; + } + } + } + + if (result != 0) { + /* + * If there is only one value, then it is an option such as "-8". + */ + if ((n == 0) && (value > 0)) { + int step = value; + while (n < max_cols - 1) { + result[n++] = value; + value += step; + } + } + + /* + * Add the last value, if any. + */ + result[n++] = value + prior; + result[n] = 0; + } + return result; +} + +static void +print_ruler(int *tab_list) +{ + int last = 0; + int stop; + int n; + + /* first print a readable ruler */ + for (n = 0; n < max_cols; n += 10) { + int ch = 1 + (n / 10); + char buffer[20]; + sprintf(buffer, "----+----%c", + ((ch < 10) + ? (ch + '0') + : (ch + 'A' - 10))); + printf("%.*s", ((max_cols - n) > 10) ? 10 : (max_cols - n), buffer); + } + putchar('\n'); + + /* now, print '*' for each stop */ + for (n = 0, last = 0; (tab_list[n] > 0) && (last < max_cols); ++n) { + stop = tab_list[n]; + while (++last < stop) { + if (last <= max_cols) { + putchar('-'); + } else { + break; + } + } + if (last <= max_cols) { + putchar('*'); + last = stop; + } else { + break; + } + } + while (++last <= max_cols) + putchar('-'); + putchar('\n'); +} + +/* + * Write an '*' on each tabstop, to demonstrate whether it lines up with the + * ruler. + */ +static void +write_tabs(int *tab_list) +{ + int stop; + + while ((stop = *tab_list++) > 0 && stop <= max_cols) { + fputs((stop == 1) ? "*" : "\t*", stdout); + }; + /* also show a tab _past_ the stops */ + if (stop < max_cols) + fputs("\t+", stdout); + putchar('\n'); +} + +/* + * Trim leading/trailing blanks, as well as blanks after a comma. + * Convert embedded blanks to commas. + */ +static char * +trimmed_tab_list(const char *source) +{ + char *result = strdup(source); + int ch, j, k, last; + + if (result != 0) { + for (j = k = last = 0; result[j] != 0; ++j) { + ch = UChar(result[j]); + if (isspace(ch)) { + if (last == '\0') { + continue; + } else if (isdigit(last) || last == ',') { + ch = ','; + } + } else if (ch == ',') { + ; + } else { + if (last == ',') + result[k++] = (char) last; + result[k++] = (char) ch; + } + last = ch; + } + result[k] = '\0'; + } + return result; +} + +static bool +comma_is_needed(const char *source) +{ + bool result = FALSE; + + if (source != 0) { + unsigned len = strlen(source); + if (len != 0) + result = (source[len - 1] != ','); + } else { + result = FALSE; + } + return result; +} + +/* + * Add a command-line parameter to the tab-list. It can be blank- or comma- + * separated (or a mixture). For simplicity, empty tabs are ignored, e.g., + * tabs 1,,6,11 + * tabs 1,6,11 + * are treated the same. + */ +static const char * +add_to_tab_list(char **append, const char *value) +{ + char *result = *append; + char *copied = trimmed_tab_list(value); + + if (copied != 0 && *copied != '\0') { + const char *comma = ","; + unsigned need = 1 + strlen(copied); + + if (*copied == ',') + comma = ""; + else if (!comma_is_needed(*append)) + comma = ""; + + need += strlen(comma); + if (*append != 0) + need += strlen(*append); + + result = malloc(need); + if (result != 0) { + *result = '\0'; + if (*append != 0) { + strcpy(result, *append); + free(*append); + } + strcat(result, comma); + strcat(result, copied); + } + + *append = result; + } + return result; +} + +/* + * Check for illegal characters in the tab-list. + */ +static bool +legal_tab_list(const char *program, const char *tab_list) +{ + bool result = TRUE; + + if (tab_list != 0 && *tab_list != '\0') { + if (comma_is_needed(tab_list)) { + int n, ch; + for (n = 0; tab_list[n] != '\0'; ++n) { + ch = UChar(tab_list[n]); + if (!(isdigit(ch) || ch == ',' || ch == '+')) { + fprintf(stderr, + "%s: unexpected character found '%c'\n", + program, ch); + result = FALSE; + break; + } + } + } else { + fprintf(stderr, "%s: trailing comma found '%s'\n", program, tab_list); + result = FALSE; + } + } else { + fprintf(stderr, "%s: no tab-list given\n", program); + result = FALSE; + } + return result; +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: tabs [options] [tabstop-list]" + ,"" + ,"Options:" + ," -0 reset tabs" + ," -8 set tabs to standard interval" + ," -a Assembler, IBM S/370, first format" + ," -a2 Assembler, IBM S/370, second format" + ," -c COBOL, normal format" + ," -c2 COBOL compact format" + ," -c3 COBOL compact format extended" + ," -d debug (show ruler with expected/actual tab positions)" + ," -f FORTRAN" + ," -n no-op (do not modify terminal settings)" + ," -p PL/I" + ," -s SNOBOL" + ," -u UNIVAC 1100 Assembler" + ," -T name use terminal type 'name'" + ,"" + ,"A tabstop-list is an ordered list of column numbers, e.g., 1,11,21" + ,"or 1,+10,+10 which is the same." + }; + unsigned n; + + fflush(stdout); + for (n = 0; n < SIZEOF(msg); ++n) { + fprintf(stderr, "%s\n", msg[n]); + } + ExitProgram(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + int rc = EXIT_FAILURE; + bool debug = FALSE; + bool no_op = FALSE; + int n, ch; + NCURSES_CONST char *term_name = 0; + const char *mar_list = 0; /* ignored */ + char *append = 0; + const char *tab_list = 0; + + if ((term_name = getenv("TERM")) == 0) + term_name = "ansi+tabs"; + + /* cannot use getopt, since some options are two-character */ + for (n = 1; n < argc; ++n) { + char *option = argv[n]; + switch (option[0]) { + case '-': + while ((ch = *++option) != '\0') { + switch (ch) { + case 'a': + switch (*option) { + case '\0': + tab_list = "1,10,16,36,72"; + /* Assembler, IBM S/370, first format */ + break; + case '2': + tab_list = "1,10,16,40,72"; + /* Assembler, IBM S/370, second format */ + break; + default: + usage(); + } + break; + case 'c': + switch (*option) { + case '\0': + tab_list = "1,8,12,16,20,55"; + /* COBOL, normal format */ + break; + case '2': + tab_list = "1,6,10,14,49"; + /* COBOL compact format */ + break; + case '3': + tab_list = "1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67"; + /* COBOL compact format extended */ + break; + default: + usage(); + } + break; + case 'd': /* ncurses extension */ + debug = TRUE; + break; + case 'f': + tab_list = "1,7,11,15,19,23"; + /* FORTRAN */ + break; + case 'n': /* ncurses extension */ + no_op = TRUE; + break; + case 'p': + tab_list = "1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61"; + /* PL/I */ + break; + case 's': + tab_list = "1,10,55"; + /* SNOBOL */ + break; + case 'u': + tab_list = "1,12,20,44"; + /* UNIVAC 1100 Assembler */ + break; + case 'T': + ++n; + if (*++option != '\0') { + term_name = option; + } else { + term_name = argv[n++]; + } + option += ((int) strlen(option)) - 1; + continue; + default: + if (isdigit(UChar(*option))) { + tab_list = option; + ++n; + } else { + usage(); + } + option += ((int) strlen(option)) - 1; + break; + } + } + break; + case '+': + while ((ch = *++option) != '\0') { + switch (ch) { + case 'm': + mar_list = option; + break; + default: + /* special case of relative stops separated by spaces? */ + if (option == argv[n] + 1) { + tab_list = add_to_tab_list(&append, argv[n]); + } + break; + } + } + break; + default: + if (append != 0) { + if (tab_list != (const char *) append) { + /* one of the predefined options was used */ + free(append); + append = 0; + } + } + tab_list = add_to_tab_list(&append, option); + break; + } + } + + setupterm(term_name, STDOUT_FILENO, (int *) 0); + + max_cols = (columns > 0) ? columns : 80; + + if (!VALID_STRING(clear_all_tabs)) { + fprintf(stderr, + "%s: terminal type '%s' cannot reset tabs\n", + argv[0], term_name); + } else if (!VALID_STRING(set_tab)) { + fprintf(stderr, + "%s: terminal type '%s' cannot set tabs\n", + argv[0], term_name); + } else if (legal_tab_list(argv[0], tab_list)) { + int *list = decode_tabs(tab_list); + + if (!no_op) + tputs(clear_all_tabs, 1, putch); + + if (list != 0) { + if (!no_op) + do_tabs(list); + if (debug) { + fflush(stderr); + printf("tabs %s\n", tab_list); + print_ruler(list); + write_tabs(list); + } + free(list); + } else if (debug) { + fflush(stderr); + printf("tabs %s\n", tab_list); + } + rc = EXIT_SUCCESS; + } + if (append != 0) + free(append); + ExitProgram(rc); +} diff --git a/progs/tic.c b/progs/tic.c index 82bc3ea0d78..8e89095fc67 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.137 2008/09/13 16:59:24 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.147 2011/02/12 18:39:08 tom Exp $") const char *_nc_progname = "tic"; @@ -342,8 +342,15 @@ stripped(char *src) while (isspace(UChar(*src))) src++; if (*src != '\0') { - char *dst = strcpy((char *) malloc(strlen(src) + 1), src); - size_t len = strlen(dst); + char *dst; + size_t len; + + if ((dst = strdup(src)) == NULL) + failed("strdup"); + + assert(dst != 0); + + len = strlen(dst); while (--len != 0 && isspace(UChar(dst[len]))) dst[len] = '\0'; return dst; @@ -495,11 +502,11 @@ main(int argc, char *argv[]) _nc_progname = _nc_rootname(argv[0]); - if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) { + if ((infodump = same_program(_nc_progname, PROG_CAPTOINFO)) != FALSE) { outform = F_TERMINFO; sortmode = S_TERMINFO; } - if ((capdump = (strcmp(_nc_progname, PROG_INFOTOCAP) == 0)) != FALSE) { + if ((capdump = same_program(_nc_progname, PROG_INFOTOCAP)) != FALSE) { outform = F_TERMCAP; sortmode = S_TERMCAP; } @@ -757,6 +764,7 @@ main(int argc, char *argv[]) put_translate(fgetc(tmp_fp)); } + repair_acsc(&qp->tterm); dump_entry(&qp->tterm, suppress_untranslatable, limited, numbers, NULL); for (j = 0; j < (int) qp->nuses; j++) @@ -923,6 +931,156 @@ keypad_index(const char *string) return result; } +/* + * list[] is down, up, left, right + * "left" may be ^H rather than \E[D + * "down" may be ^J rather than \E[B + * But up/right are generally consistently escape sequences for ANSI terminals. + */ +static void +check_ansi_cursor(char *list[4]) +{ + int j, k; + int want; + size_t prefix = 0; + size_t suffix; + bool skip[4]; + bool repeated = FALSE; + + for (j = 0; j < 4; ++j) { + skip[j] = FALSE; + for (k = 0; k < j; ++k) { + if (j != k + && !strcmp(list[j], list[k])) { + char *value = _nc_tic_expand(list[k], TRUE, 0); + _nc_warning("repeated cursor control %s\n", value); + repeated = TRUE; + } + } + } + if (!repeated) { + char *up = list[1]; + + if (UChar(up[0]) == '\033') { + if (up[1] == '[') { + prefix = 2; + } else { + prefix = 1; + } + } else if (UChar(up[0]) == UChar('\233')) { + prefix = 1; + } + if (prefix) { + suffix = prefix; + while (up[suffix] && isdigit(UChar(up[suffix]))) + ++suffix; + } + if (prefix && up[suffix] == 'A') { + skip[1] = TRUE; + if (!strcmp(list[0], "\n")) + skip[0] = TRUE; + if (!strcmp(list[2], "\b")) + skip[2] = TRUE; + + for (j = 0; j < 4; ++j) { + if (skip[j] || strlen(list[j]) == 1) + continue; + if (memcmp(list[j], up, prefix)) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent prefix for %s\n", value); + continue; + } + if (strlen(list[j]) < suffix) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent length for %s, expected %d\n", + value, (int) suffix + 1); + continue; + } + want = "BADC"[j]; + if (list[j][suffix] != want) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent suffix for %s, expected %c, have %c\n", + value, want, list[j][suffix]); + } + } + } + } +} + +#define EXPECTED(name) if (!PRESENT(name)) _nc_warning("expected " #name) + +static void +check_cursor(TERMTYPE *tp) +{ + int count; + char *list[4]; + + /* if we have a parameterized form, then the non-parameterized is easy */ + ANDMISSING(parm_down_cursor, cursor_down); + ANDMISSING(parm_up_cursor, cursor_up); + ANDMISSING(parm_left_cursor, cursor_left); + ANDMISSING(parm_right_cursor, cursor_right); + + /* Given any of a set of cursor movement, the whole set should be present. + * Technically this is not true (we could use cursor_address to fill in + * unsupported controls), but it is likely. + */ + count = 0; + if (PRESENT(parm_down_cursor)) { + list[count++] = parm_down_cursor; + } + if (PRESENT(parm_up_cursor)) { + list[count++] = parm_up_cursor; + } + if (PRESENT(parm_left_cursor)) { + list[count++] = parm_left_cursor; + } + if (PRESENT(parm_right_cursor)) { + list[count++] = parm_right_cursor; + } + if (count == 4) { + check_ansi_cursor(list); + } else if (count != 0) { + EXPECTED(parm_down_cursor); + EXPECTED(parm_up_cursor); + EXPECTED(parm_left_cursor); + EXPECTED(parm_right_cursor); + } + + count = 0; + if (PRESENT(cursor_down)) { + list[count++] = cursor_down; + } + if (PRESENT(cursor_up)) { + list[count++] = cursor_up; + } + if (PRESENT(cursor_left)) { + list[count++] = cursor_left; + } + if (PRESENT(cursor_right)) { + list[count++] = cursor_right; + } + if (count == 4) { + check_ansi_cursor(list); + } else if (count != 0) { + count = 0; + if (PRESENT(cursor_down) && strcmp(cursor_down, "\n")) + ++count; + if (PRESENT(cursor_left) && strcmp(cursor_left, "\b")) + ++count; + if (PRESENT(cursor_up) && strlen(cursor_up) > 1) + ++count; + if (PRESENT(cursor_right) && strlen(cursor_right) > 1) + ++count; + if (count) { + EXPECTED(cursor_down); + EXPECTED(cursor_up); + EXPECTED(cursor_left); + EXPECTED(cursor_right); + } + } +} + #define MAX_KP 5 /* * Do a quick sanity-check for vt100-style keypads to see if the 5-key keypad @@ -1032,6 +1190,32 @@ check_keypad(TERMTYPE *tp) } } +static void +check_printer(TERMTYPE *tp) +{ + PAIRED(enter_doublewide_mode, exit_doublewide_mode); + PAIRED(enter_italics_mode, exit_italics_mode); + PAIRED(enter_leftward_mode, exit_leftward_mode); + PAIRED(enter_micro_mode, exit_micro_mode); + PAIRED(enter_shadow_mode, exit_shadow_mode); + PAIRED(enter_subscript_mode, exit_subscript_mode); + PAIRED(enter_superscript_mode, exit_superscript_mode); + PAIRED(enter_upward_mode, exit_upward_mode); + + ANDMISSING(start_char_set_def, stop_char_set_def); + + /* if we have a parameterized form, then the non-parameterized is easy */ + ANDMISSING(set_bottom_margin_parm, set_bottom_margin); + ANDMISSING(set_left_margin_parm, set_left_margin); + ANDMISSING(set_right_margin_parm, set_right_margin); + ANDMISSING(set_top_margin_parm, set_top_margin); + + ANDMISSING(parm_down_micro, micro_down); + ANDMISSING(parm_left_micro, micro_left); + ANDMISSING(parm_right_micro, micro_right); + ANDMISSING(parm_up_micro, micro_up); +} + /* * Returns the expected number of parameters for the given capability. */ @@ -1268,6 +1452,8 @@ similar_sgr(int num, char *a, char *b) } else if (delaying) { a = skip_delay(a); b = skip_delay(b); + } else if ((*b == '0' || (*b == ';')) && *a == 'm') { + b++; } else { a++; } @@ -1343,7 +1529,7 @@ show_where(unsigned level) if (_nc_tracing >= DEBUG_LEVEL(level)) { char my_name[256]; _nc_get_type(my_name); - fprintf(stderr, "\"%s\", line %d, '%s' ", + _tracef("\"%s\", line %d, '%s'", _nc_get_source(), _nc_curr_line, my_name); } @@ -1411,7 +1597,9 @@ check_termtype(TERMTYPE *tp, bool literal) check_acs(tp); check_colors(tp); + check_cursor(tp); check_keypad(tp); + check_printer(tp); /* * These may be mismatched because the terminal description relies on @@ -1432,6 +1620,11 @@ check_termtype(TERMTYPE *tp, bool literal) ANDMISSING(change_scroll_region, save_cursor); ANDMISSING(change_scroll_region, restore_cursor); + /* + * If we can clear tabs, we should be able to initialize them. + */ + ANDMISSING(clear_all_tabs, set_tab); + if (PRESENT(set_attributes)) { char *zero = 0; diff --git a/progs/toe.c b/progs/toe.c index 8af6f371b77..6f45992f712 100644 --- a/progs/toe.c +++ b/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: toe.c,v 1.51 2008/08/16 21:53:25 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.52 2010/05/01 22:04:08 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -61,6 +61,13 @@ ExitProgram(int code) } #endif +static void +failed(const char *msg) +{ + perror(msg); + ExitProgram(EXIT_FAILURE); +} + #if USE_HASHED_DB static bool make_db_name(char *dst, const char *src, unsigned limit) @@ -184,10 +191,10 @@ typelist(int eargc, char *eargv[], DIRENT *entry; cwd_buf = typeRealloc(char, cwd_len, cwd_buf); - if (cwd_buf == 0) { - perror("realloc cwd_buf"); - continue; - } + if (cwd_buf == 0) + failed("realloc cwd_buf"); + + assert(cwd_buf != 0); strncpy(name_1, subdir->d_name, len)[len] = '\0'; if (isDotname(name_1)) @@ -480,6 +487,10 @@ main(int argc, char *argv[]) } if (!pass) { eargv = typeCalloc(char *, count + 1); + if (eargv == 0) + failed("realloc eargv"); + + assert(eargv != 0); } else { code = typelist((int) count, eargv, header, deschook); while (count-- > 0) diff --git a/progs/tput.c b/progs/tput.c index 022d4940c2a..2e67cfecbef 100644 --- a/progs/tput.c +++ b/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -47,7 +47,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.42 2008/07/13 11:05:12 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.46 2010/01/09 16:53:24 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -86,8 +86,8 @@ usage(void) static void check_aliases(const char *name) { - is_init = (strcmp(name, PROG_INIT) == 0); - is_reset = (strcmp(name, PROG_RESET) == 0); + is_init = same_program(name, PROG_INIT); + is_reset = same_program(name, PROG_RESET); } /* @@ -153,6 +153,9 @@ tput(int argc, char *argv[]) int i, j, c; int status; FILE *f; +#if !PURE_TERMINFO + bool termcap = FALSE; +#endif if ((name = argv[0]) == 0) name = ""; @@ -265,35 +268,40 @@ tput(int argc, char *argv[]) return 0; } #if !PURE_TERMINFO - { - const struct name_table_entry *np; - - if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0) - switch (np->nte_type) { - case BOOLEAN: - if (bool_from_termcap[np->nte_index]) - name = boolnames[np->nte_index]; - break; - - case NUMBER: - if (num_from_termcap[np->nte_index]) - name = numnames[np->nte_index]; - break; - - case STRING: - if (str_from_termcap[np->nte_index]) - name = strnames[np->nte_index]; - break; - } - } + retry: #endif - if ((status = tigetflag(name)) != -1) { return exit_code(BOOLEAN, status); } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); return exit_code(NUMBER, 0); } else if ((s = tigetstr(name)) == CANCELLED_STRING) { +#if !PURE_TERMINFO + if (!termcap) { + const struct name_table_entry *np; + + termcap = TRUE; + if ((np = _nc_find_entry(name, _nc_get_hash_table(termcap))) != 0) { + switch (np->nte_type) { + case BOOLEAN: + if (bool_from_termcap[np->nte_index]) + name = boolnames[np->nte_index]; + break; + + case NUMBER: + if (num_from_termcap[np->nte_index]) + name = numnames[np->nte_index]; + break; + + case STRING: + if (str_from_termcap[np->nte_index]) + name = strnames[np->nte_index]; + break; + } + goto retry; + } + } +#endif quit(4, "unknown terminfo capability '%s'", name); } else if (s != ABSENT_STRING) { if (argc > 1) { diff --git a/progs/transform.c b/progs/transform.c new file mode 100644 index 00000000000..75f4573357c --- /dev/null +++ b/progs/transform.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2009,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"), 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 * + ****************************************************************************/ +#include +#include + +#include + +MODULE_ID("$Id: transform.c,v 1.2 2010/09/04 21:16:17 tom Exp $") + +#ifdef SUFFIX_IGNORED +static void +trim_suffix(const char *a, unsigned *len) +{ + const char ignore[] = SUFFIX_IGNORED; + + if (sizeof(ignore) != 0) { + bool trim = FALSE; + unsigned need = (sizeof(ignore) - 1); + + if (*len > need) { + unsigned first = *len - need; + unsigned n; + trim = TRUE; + for (n = first; n < *len; ++n) { + if (tolower(UChar(a[n])) != tolower(UChar(ignore[n - first]))) { + trim = FALSE; + break; + } + } + if (trim) { + *len -= need; + } + } + } +} +#else +#define trim_suffix(a, len) /* nothing */ +#endif + +bool +same_program(const char *a, const char *b) +{ + unsigned len_a = strlen(a); + unsigned len_b = strlen(b); + + trim_suffix(a, &len_a); + trim_suffix(b, &len_b); + + return (len_a == len_b) && (strncmp(a, b, len_a) == 0); +} diff --git a/progs/tset.c b/progs/tset.c index 6a4d2d61c3d..084e41d6db2 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,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 * @@ -32,6 +32,22 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ +/* + * Notes: + * The initial adaptation from 4.4BSD Lite sources in September 1995 used 686 + * lines from that version, and made changes/additions for 150 lines. There + * was no reformatting, so with/without ignoring whitespace, the amount of + * change is the same. + * + * Comparing with current (2009) source, excluding this comment: + * a) 209 lines match identically to the 4.4BSD Lite sources, with 771 lines + * changed/added. + * a) Ignoring whitespace, the current version still uses 516 lines from the + * 4.4BSD Lite sources, with 402 lines changed/added. + * + * Raymond's original comment on this follows... + */ + /* * tset.c - terminal initialization utility * @@ -52,11 +68,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -107,7 +119,7 @@ char *ttyname(int fd); #include #include -MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.82 2010/05/01 21:42:46 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -129,7 +141,9 @@ MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") # endif #endif +#ifndef environ extern char **environ; +#endif #undef CTRL #define CTRL(x) ((x) & 0x1f) @@ -385,9 +399,13 @@ add_mapping(const char *port, char *arg) char *base = 0; copy = strdup(arg); - mapp = (MAP *) malloc(sizeof(MAP)); + mapp = typeMalloc(MAP, 1); if (copy == 0 || mapp == 0) failed("malloc"); + + assert(copy != 0); + assert(mapp != 0); + mapp->next = 0; if (maplist == 0) cur = maplist = mapp; @@ -1247,12 +1265,12 @@ main(int argc, char **argv) ospeed = (NCURSES_OSPEED) mode.sg_ospeed; #endif - if (!strcmp(_nc_progname, PROG_RESET)) { + if (same_program(_nc_progname, PROG_RESET)) { isreset = TRUE; reset_mode(); } - ttype = get_termcap_entry(*argv); + (void) get_termcap_entry(*argv); if (!noset) { tcolumns = columns; diff --git a/tar-copy.sh b/tar-copy.sh deleted file mode 100755 index 3df1bc11169..00000000000 --- a/tar-copy.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# $Id: tar-copy.sh,v 1.5 2003/10/25 14:40:07 tom Exp $ -############################################################################## -# Copyright (c) 1998,2003 Free Software Foundation, Inc. # -# # -# Permission is hereby granted, free of charge, to any person obtaining a # -# copy of this software and associated documentation files (the "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 -# -# Copy a collection of files using 'tar', so that their dates and links are -# preserved -# -# Parameters: -# $1 = files to copy -# $2 = source directory -# $3 = destination directory -# -#DOIT=echo -DOIT=eval - -if test $# != 3 ; then - echo "Usage: $0 files source target" - exit 1 -elif test ! -d "$2" ; then - echo "Source directory not found: $2" - exit 1 -elif test ! -d "$3" ; then - echo "Target directory not found: $3" - exit 1 -fi - -WD=`pwd` - -TMP=$WD/copy$$ - -cd $2 -TEST=`ls -d $1 2>/dev/null` -if test -z "$TEST" -then - echo "... no match for \"$1\" in $2" -else - echo "... installing files matching \"$1\" in $2" - trap "rm -f $TMP" 0 1 2 5 15 - if ( tar cf $TMP $1 ) - then - cd $3 - LIST=`tar tf $TMP 2>&1` - $DOIT rm -rf $LIST 2>/dev/null - $DOIT tar xvf $TMP - else - echo "Cannot create tar of $1 files" - exit 1 - fi -fi